// Code generated by 'ccgo -D__printf__=printf -export-defines "" -export-enums "" -export-externs X -export-fields F -export-structs "" -export-typedefs "" -hide TclpCreateProcess -lmodernc.org/z/lib -o lib/tcl_linux_amd64.go -pkgname tcl -replace-fd-zero __ccgo_fd_zero -replace-tcl-default-double-rounding __ccgo_tcl_default_double_rounding -replace-tcl-ieee-double-rounding __ccgo_tcl_ieee_double_rounding -trace-translation-units --load-config "" -save-config "" /tmp/go-generate-3071617706/cdb.json libtcl8.6.a libtclstub8.6.a', DO NOT EDIT.

package tcl

import (
	"math"
	"reflect"
	"sync/atomic"
	"unsafe"

	"modernc.org/libc"
	"modernc.org/libc/sys/types"
	"modernc.org/z/lib"
)

var _ = math.Pi
var _ reflect.Kind
var _ atomic.Value
var _ unsafe.Pointer
var _ *libc.TLS
var _ types.Size_t

const (
	ACCESSPERMS                           = 511
	AF_ALG                                = 38
	AF_APPLETALK                          = 5
	AF_ASH                                = 18
	AF_ATMPVC                             = 8
	AF_ATMSVC                             = 20
	AF_AX25                               = 3
	AF_BLUETOOTH                          = 31
	AF_BRIDGE                             = 7
	AF_CAIF                               = 37
	AF_CAN                                = 29
	AF_DECnet                             = 12
	AF_ECONET                             = 19
	AF_FILE                               = 1
	AF_IB                                 = 27
	AF_IEEE802154                         = 36
	AF_INET                               = 2
	AF_INET6                              = 10
	AF_IPX                                = 4
	AF_IRDA                               = 23
	AF_ISDN                               = 34
	AF_IUCV                               = 32
	AF_KCM                                = 41
	AF_KEY                                = 15
	AF_LLC                                = 26
	AF_LOCAL                              = 1
	AF_MAX                                = 45
	AF_MPLS                               = 28
	AF_NETBEUI                            = 13
	AF_NETLINK                            = 16
	AF_NETROM                             = 6
	AF_NFC                                = 39
	AF_PACKET                             = 17
	AF_PHONET                             = 35
	AF_PPPOX                              = 24
	AF_QIPCRTR                            = 42
	AF_RDS                                = 21
	AF_ROSE                               = 11
	AF_ROUTE                              = 16
	AF_RXRPC                              = 33
	AF_SECURITY                           = 14
	AF_SMC                                = 43
	AF_SNA                                = 22
	AF_TIPC                               = 30
	AF_UNIX                               = 1
	AF_UNSPEC                             = 0
	AF_VSOCK                              = 40
	AF_WANPIPE                            = 25
	AF_X25                                = 9
	AF_XDP                                = 44
	AIO_PRIO_DELTA_MAX                    = 20
	AI_ADDRCONFIG                         = 0x0020
	AI_ALL                                = 0x0010
	AI_CANONNAME                          = 0x0002
	AI_NUMERICHOST                        = 0x0004
	AI_NUMERICSERV                        = 0x0400
	AI_PASSIVE                            = 0x0001
	AI_V4MAPPED                           = 0x0008
	ALLOC_NOBJHIGH                        = 1200
	ALLPERMS                              = 4095
	AT_EACCESS                            = 0x200
	AT_FDCWD                              = -100
	AT_REMOVEDIR                          = 0x200
	AT_SYMLINK_FOLLOW                     = 0x400
	AT_SYMLINK_NOFOLLOW                   = 0x100
	BC_BASE_MAX                           = 99
	BC_DIM_MAX                            = 2048
	BC_SCALE_MAX                          = 99
	BC_STRING_MAX                         = 1000
	BIG_ENDIAN                            = 4321
	BN_CUTOFFS_C                          = 0
	BN_DEPRECATED_C                       = 0
	BN_FAST_MP_INVMOD_C                   = 0
	BN_FAST_MP_MONTGOMERY_REDUCE_C        = 0
	BN_FAST_S_MP_MUL_DIGS_C               = 0
	BN_FAST_S_MP_MUL_HIGH_DIGS_C          = 0
	BN_FAST_S_MP_SQR_C                    = 0
	BN_H_                                 = 0
	BN_MP_2EXPT_C                         = 0
	BN_MP_ABS_C                           = 0
	BN_MP_ADDMOD_C                        = 0
	BN_MP_ADD_C                           = 0
	BN_MP_ADD_D_C                         = 0
	BN_MP_AND_C                           = 0
	BN_MP_BALANCE_MUL_C                   = 0
	BN_MP_CLAMP_C                         = 0
	BN_MP_CLEAR_C                         = 0
	BN_MP_CLEAR_MULTI_C                   = 0
	BN_MP_CMP_C                           = 0
	BN_MP_CMP_D_C                         = 0
	BN_MP_CMP_MAG_C                       = 0
	BN_MP_CNT_LSB_C                       = 0
	BN_MP_COMPLEMENT_C                    = 0
	BN_MP_COPY_C                          = 0
	BN_MP_COUNT_BITS_C                    = 0
	BN_MP_DECR_C                          = 0
	BN_MP_DIV_2D_C                        = 0
	BN_MP_DIV_2_C                         = 0
	BN_MP_DIV_3_C                         = 0
	BN_MP_DIV_C                           = 0
	BN_MP_DIV_D_C                         = 0
	BN_MP_DR_IS_MODULUS_C                 = 0
	BN_MP_DR_REDUCE_C                     = 0
	BN_MP_DR_SETUP_C                      = 0
	BN_MP_ERROR_TO_STRING_C               = 0
	BN_MP_EXCH_C                          = 0
	BN_MP_EXPORT_C                        = 0
	BN_MP_EXPTMOD_C                       = 0
	BN_MP_EXPTMOD_FAST_C                  = 0
	BN_MP_EXPT_D_C                        = 0
	BN_MP_EXPT_D_EX_C                     = 0
	BN_MP_EXPT_U32_C                      = 0
	BN_MP_EXTEUCLID_C                     = 0
	BN_MP_FREAD_C                         = 0
	BN_MP_FROM_SBIN_C                     = 0
	BN_MP_FROM_UBIN_C                     = 0
	BN_MP_FWRITE_C                        = 0
	BN_MP_GCD_C                           = 0
	BN_MP_GET_BIT_C                       = 0
	BN_MP_GET_DOUBLE_C                    = 0
	BN_MP_GET_I32_C                       = 0
	BN_MP_GET_I64_C                       = 0
	BN_MP_GET_INT_C                       = 0
	BN_MP_GET_LL_C                        = 0
	BN_MP_GET_LONG_C                      = 0
	BN_MP_GET_LONG_LONG_C                 = 0
	BN_MP_GET_L_C                         = 0
	BN_MP_GET_MAG_U32_C                   = 0
	BN_MP_GET_MAG_U64_C                   = 0
	BN_MP_GET_MAG_ULL_C                   = 0
	BN_MP_GET_MAG_UL_C                    = 0
	BN_MP_GROW_C                          = 0
	BN_MP_IMPORT_C                        = 0
	BN_MP_INCR_C                          = 0
	BN_MP_INIT_C                          = 0
	BN_MP_INIT_COPY_C                     = 0
	BN_MP_INIT_I32_C                      = 0
	BN_MP_INIT_I64_C                      = 0
	BN_MP_INIT_LL_C                       = 0
	BN_MP_INIT_L_C                        = 0
	BN_MP_INIT_MULTI_C                    = 0
	BN_MP_INIT_SET_C                      = 0
	BN_MP_INIT_SET_INT_C                  = 0
	BN_MP_INIT_SIZE_C                     = 0
	BN_MP_INIT_U32_C                      = 0
	BN_MP_INIT_U64_C                      = 0
	BN_MP_INIT_ULL_C                      = 0
	BN_MP_INIT_UL_C                       = 0
	BN_MP_INVMOD_C                        = 0
	BN_MP_INVMOD_SLOW_C                   = 0
	BN_MP_ISEVEN_C                        = 0
	BN_MP_ISODD_C                         = 0
	BN_MP_IS_SQUARE_C                     = 0
	BN_MP_JACOBI_C                        = 0
	BN_MP_KARATSUBA_MUL_C                 = 0
	BN_MP_KARATSUBA_SQR_C                 = 0
	BN_MP_KRONECKER_C                     = 0
	BN_MP_LCM_C                           = 0
	BN_MP_LOG_U32_C                       = 0
	BN_MP_LSHD_C                          = 0
	BN_MP_MOD_2D_C                        = 0
	BN_MP_MOD_C                           = 0
	BN_MP_MOD_D_C                         = 0
	BN_MP_MONTGOMERY_CALC_NORMALIZATION_C = 0
	BN_MP_MONTGOMERY_REDUCE_C             = 0
	BN_MP_MONTGOMERY_SETUP_C              = 0
	BN_MP_MULMOD_C                        = 0
	BN_MP_MUL_2D_C                        = 0
	BN_MP_MUL_2_C                         = 0
	BN_MP_MUL_C                           = 0
	BN_MP_MUL_D_C                         = 0
	BN_MP_NEG_C                           = 0
	BN_MP_N_ROOT_C                        = 0
	BN_MP_N_ROOT_EX_C                     = 0
	BN_MP_OR_C                            = 0
	BN_MP_PACK_C                          = 0
	BN_MP_PACK_COUNT_C                    = 0
	BN_MP_PRIME_FERMAT_C                  = 0
	BN_MP_PRIME_FROBENIUS_UNDERWOOD_C     = 0
	BN_MP_PRIME_IS_DIVISIBLE_C            = 0
	BN_MP_PRIME_IS_PRIME_C                = 0
	BN_MP_PRIME_MILLER_RABIN_C            = 0
	BN_MP_PRIME_NEXT_PRIME_C              = 0
	BN_MP_PRIME_RABIN_MILLER_TRIALS_C     = 0
	BN_MP_PRIME_RANDOM_EX_C               = 0
	BN_MP_PRIME_RAND_C                    = 0
	BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C  = 0
	BN_MP_RADIX_SIZE_C                    = 0
	BN_MP_RADIX_SMAP_C                    = 0
	BN_MP_RAND_C                          = 0
	BN_MP_RAND_DIGIT_C                    = 0
	BN_MP_RAND_SOURCE_C                   = 0
	BN_MP_READ_RADIX_C                    = 0
	BN_MP_READ_SIGNED_BIN_C               = 0
	BN_MP_READ_UNSIGNED_BIN_C             = 0
	BN_MP_REDUCE_2K_C                     = 0
	BN_MP_REDUCE_2K_L_C                   = 0
	BN_MP_REDUCE_2K_SETUP_C               = 0
	BN_MP_REDUCE_2K_SETUP_L_C             = 0
	BN_MP_REDUCE_C                        = 0
	BN_MP_REDUCE_IS_2K_C                  = 0
	BN_MP_REDUCE_IS_2K_L_C                = 0
	BN_MP_REDUCE_SETUP_C                  = 0
	BN_MP_ROOT_U32_C                      = 0
	BN_MP_RSHD_C                          = 0
	BN_MP_SBIN_SIZE_C                     = 0
	BN_MP_SET_C                           = 0
	BN_MP_SET_DOUBLE_C                    = 0
	BN_MP_SET_I32_C                       = 0
	BN_MP_SET_I64_C                       = 0
	BN_MP_SET_INT_C                       = 0
	BN_MP_SET_LL_C                        = 0
	BN_MP_SET_LONG_C                      = 0
	BN_MP_SET_LONG_LONG_C                 = 0
	BN_MP_SET_L_C                         = 0
	BN_MP_SET_U32_C                       = 0
	BN_MP_SET_U64_C                       = 0
	BN_MP_SET_ULL_C                       = 0
	BN_MP_SET_UL_C                        = 0
	BN_MP_SHRINK_C                        = 0
	BN_MP_SIGNED_BIN_SIZE_C               = 0
	BN_MP_SIGNED_RSH_C                    = 0
	BN_MP_SQRMOD_C                        = 0
	BN_MP_SQRTMOD_PRIME_C                 = 0
	BN_MP_SQRT_C                          = 0
	BN_MP_SQR_C                           = 0
	BN_MP_SUBMOD_C                        = 0
	BN_MP_SUB_C                           = 0
	BN_MP_SUB_D_C                         = 0
	BN_MP_TC_AND_C                        = 0
	BN_MP_TC_DIV_2D_C                     = 0
	BN_MP_TC_OR_C                         = 0
	BN_MP_TC_XOR_C                        = 0
	BN_MP_TOOM_MUL_C                      = 0
	BN_MP_TOOM_SQR_C                      = 0
	BN_MP_TORADIX_C                       = 0
	BN_MP_TORADIX_N_C                     = 0
	BN_MP_TO_RADIX_C                      = 0
	BN_MP_TO_SBIN_C                       = 0
	BN_MP_TO_SIGNED_BIN_C                 = 0
	BN_MP_TO_SIGNED_BIN_N_C               = 0
	BN_MP_TO_UBIN_C                       = 0
	BN_MP_TO_UNSIGNED_BIN_C               = 0
	BN_MP_TO_UNSIGNED_BIN_N_C             = 0
	BN_MP_UBIN_SIZE_C                     = 0
	BN_MP_UNPACK_C                        = 0
	BN_MP_UNSIGNED_BIN_SIZE_C             = 0
	BN_MP_XOR_C                           = 0
	BN_MP_ZERO_C                          = 0
	BN_PRIME_TAB_C                        = 0
	BN_S_MP_ADD_C                         = 0
	BN_S_MP_BALANCE_MUL_C                 = 0
	BN_S_MP_EXPTMOD_C                     = 0
	BN_S_MP_EXPTMOD_FAST_C                = 0
	BN_S_MP_GET_BIT_C                     = 0
	BN_S_MP_INVMOD_FAST_C                 = 0
	BN_S_MP_INVMOD_SLOW_C                 = 0
	BN_S_MP_KARATSUBA_MUL_C               = 0
	BN_S_MP_KARATSUBA_SQR_C               = 0
	BN_S_MP_MONTGOMERY_REDUCE_FAST_C      = 0
	BN_S_MP_MUL_DIGS_C                    = 0
	BN_S_MP_MUL_DIGS_FAST_C               = 0
	BN_S_MP_MUL_HIGH_DIGS_C               = 0
	BN_S_MP_MUL_HIGH_DIGS_FAST_C          = 0
	BN_S_MP_MUL_SI_C                      = 0
	BN_S_MP_PRIME_IS_DIVISIBLE_C          = 0
	BN_S_MP_PRIME_RANDOM_EX_C             = 0
	BN_S_MP_RAND_CB_C                     = 0
	BN_S_MP_RAND_JENKINS_C                = 0
	BN_S_MP_RAND_JENKINS_INIT_C           = 0
	BN_S_MP_RAND_PLATFORM_C               = 0
	BN_S_MP_RAND_SOURCE_C                 = 0
	BN_S_MP_REVERSE_C                     = 0
	BN_S_MP_SQR_C                         = 0
	BN_S_MP_SQR_FAST_C                    = 0
	BN_S_MP_SUB_C                         = 0
	BN_S_MP_TOOM_MUL_C                    = 0
	BN_S_MP_TOOM_SQR_C                    = 0
	BUFSIZ                                = 8192
	BUILD_tcl                             = 1
	BYTE_ORDER                            = 1234
	CANBSIZ                               = 255
	CANCELED                              = 0x1000
	CHARCLASS_NAME_MAX                    = 2048
	CHAR_BIT                              = 8
	CHAR_MAX                              = 127
	CHAR_MIN                              = -128
	CLL_END                               = -1
	CLOCK_BOOTTIME                        = 7
	CLOCK_BOOTTIME_ALARM                  = 9
	CLOCK_MONOTONIC                       = 1
	CLOCK_MONOTONIC_COARSE                = 6
	CLOCK_MONOTONIC_RAW                   = 4
	CLOCK_PROCESS_CPUTIME_ID              = 2
	CLOCK_REALTIME                        = 0
	CLOCK_REALTIME_ALARM                  = 8
	CLOCK_REALTIME_COARSE                 = 5
	CLOCK_TAI                             = 11
	CLOCK_THREAD_CPUTIME_ID               = 3
	CMD_COMPILES_EXPANDED                 = 0x08
	CMD_DEAD                              = 0x40
	CMD_HAS_EXEC_TRACES                   = 0x04
	CMD_IS_DELETED                        = 0x01
	CMD_REDEF_IN_PROGRESS                 = 0x10
	CMD_TRACE_ACTIVE                      = 0x02
	CMD_VIA_RESOLVER                      = 0x20
	COLL_WEIGHTS_MAX                      = 255
	CRTIMPORT                             = 0
	DBL_DECIMAL_DIG                       = 17
	DBL_DIG                               = 15
	DBL_HAS_SUBNORM                       = 1
	DBL_MANT_DIG                          = 53
	DBL_MAX_10_EXP                        = 308
	DBL_MAX_EXP                           = 1024
	DBL_MIN_10_EXP                        = -307
	DBL_MIN_EXP                           = -1021
	DECIMAL_DIG                           = 21
	DEFFILEMODE                           = 438
	DELAYTIMER_MAX                        = 2147483647
	DELETED                               = 1
	DEV_BSIZE                             = 512
	DICT_PATH_CREATE                      = 5
	DICT_PATH_EXISTS                      = 2
	DICT_PATH_READ                        = 0
	DICT_PATH_UPDATE                      = 1
	DIGIT_BIT                             = 28
	DLLIMPORT                             = 0
	DONT_COMPILE_CMDS_INLINE              = 0x20
	E2BIG                                 = 7
	EACCES                                = 13
	EADDRINUSE                            = 98
	EADDRNOTAVAIL                         = 99
	EADV                                  = 68
	EAFNOSUPPORT                          = 97
	EAGAIN                                = 11
	EAI_AGAIN                             = -3
	EAI_BADFLAGS                          = -1
	EAI_FAIL                              = -4
	EAI_FAMILY                            = -6
	EAI_MEMORY                            = -10
	EAI_NONAME                            = -2
	EAI_OVERFLOW                          = -12
	EAI_SERVICE                           = -8
	EAI_SOCKTYPE                          = -7
	EAI_SYSTEM                            = -11
	EALREADY                              = 114
	EBADE                                 = 52
	EBADF                                 = 9
	EBADFD                                = 77
	EBADMSG                               = 74
	EBADR                                 = 53
	EBADRQC                               = 56
	EBADSLT                               = 57
	EBFONT                                = 59
	EBUSY                                 = 16
	ECANCELED                             = 125
	ECHILD                                = 10
	ECHRNG                                = 44
	ECOMM                                 = 70
	ECONNABORTED                          = 103
	ECONNREFUSED                          = 111
	ECONNRESET                            = 104
	EDEADLK                               = 35
	EDEADLOCK                             = 35
	EDESTADDRREQ                          = 89
	EDOM                                  = 33
	EDOTDOT                               = 73
	EDQUOT                                = 122
	EEXIST                                = 17
	EFAULT                                = 14
	EFBIG                                 = 27
	EHOSTDOWN                             = 112
	EHOSTUNREACH                          = 113
	EHWPOISON                             = 133
	EIDRM                                 = 43
	EILSEQ                                = 84
	EINPROGRESS                           = 115
	EINTR                                 = 4
	EINVAL                                = 22
	EIO                                   = 5
	EISCONN                               = 106
	EISDIR                                = 21
	EISNAM                                = 120
	EKEYEXPIRED                           = 127
	EKEYREJECTED                          = 129
	EKEYREVOKED                           = 128
	EL2HLT                                = 51
	EL2NSYNC                              = 45
	EL3HLT                                = 46
	EL3RST                                = 47
	ELIBACC                               = 79
	ELIBBAD                               = 80
	ELIBEXEC                              = 83
	ELIBMAX                               = 82
	ELIBSCN                               = 81
	ELNRNG                                = 48
	ELOOP                                 = 40
	EMEDIUMTYPE                           = 124
	EMFILE                                = 24
	EMLINK                                = 31
	EMSGSIZE                              = 90
	EMULTIHOP                             = 72
	ENAMETOOLONG                          = 36
	ENAVAIL                               = 119
	ENETDOWN                              = 100
	ENETRESET                             = 102
	ENETUNREACH                           = 101
	ENFILE                                = 23
	ENOANO                                = 55
	ENOBUFS                               = 105
	ENOCSI                                = 50
	ENODATA                               = 61
	ENODEV                                = 19
	ENOENT                                = 2
	ENOEXEC                               = 8
	ENOKEY                                = 126
	ENOLCK                                = 37
	ENOLINK                               = 67
	ENOMEDIUM                             = 123
	ENOMEM                                = 12
	ENOMSG                                = 42
	ENONET                                = 64
	ENOPKG                                = 65
	ENOPROTOOPT                           = 92
	ENOSPC                                = 28
	ENOSR                                 = 63
	ENOSTR                                = 60
	ENOSYS                                = 38
	ENOTBLK                               = 15
	ENOTCONN                              = 107
	ENOTDIR                               = 20
	ENOTEMPTY                             = 39
	ENOTNAM                               = 118
	ENOTRECOVERABLE                       = 131
	ENOTSOCK                              = 88
	ENOTSUP                               = 95
	ENOTTY                                = 25
	ENOTUNIQ                              = 76
	ENSEMBLE_COMPILE                      = 0x4
	ENSEMBLE_DEAD                         = 0x1
	ENXIO                                 = 6
	EOF                                   = -1
	EOPNOTSUPP                            = 95
	EOVERFLOW                             = 75
	EOWNERDEAD                            = 130
	EPERM                                 = 1
	EPFNOSUPPORT                          = 96
	EPIPE                                 = 32
	EPROTO                                = 71
	EPROTONOSUPPORT                       = 93
	EPROTOTYPE                            = 91
	ERANGE                                = 34
	EREMCHG                               = 78
	EREMOTE                               = 66
	EREMOTEIO                             = 121
	ERESTART                              = 85
	ERFKILL                               = 132
	EROFS                                 = 30
	ERR_ALREADY_LOGGED                    = 4
	ERR_LEGACY_COPY                       = 0x800
	ESHUTDOWN                             = 108
	ESOCKTNOSUPPORT                       = 94
	ESPIPE                                = 29
	ESRCH                                 = 3
	ESRMNT                                = 69
	ESTALE                                = 116
	ESTRPIPE                              = 86
	ETIME                                 = 62
	ETIMEDOUT                             = 110
	ETOOMANYREFS                          = 109
	ETXTBSY                               = 26
	EUCLEAN                               = 117
	EUNATCH                               = 49
	EUSERS                                = 87
	EWOULDBLOCK                           = 11
	EXDEV                                 = 18
	EXEC_PAGESIZE                         = 4096
	EXFULL                                = 54
	EXIT_FAILURE                          = 1
	EXIT_SUCCESS                          = 0
	EXPR_NEST_MAX                         = 32
	FAPPEND                               = 1024
	FASYNC                                = 8192
	FD_CLOEXEC                            = 1
	FD_SETSIZE                            = 1024
	FFSYNC                                = 1052672
	FILENAME_MAX                          = 4096
	FIOGETOWN                             = 0x8903
	FIOSETOWN                             = 0x8901
	FLT_DECIMAL_DIG                       = 9
	FLT_DIG                               = 6
	FLT_EVAL_METHOD                       = 0
	FLT_HAS_SUBNORM                       = 1
	FLT_MANT_DIG                          = 24
	FLT_MAX_10_EXP                        = 38
	FLT_MAX_EXP                           = 128
	FLT_MIN_10_EXP                        = -37
	FLT_MIN_EXP                           = -125
	FLT_RADIX                             = 2
	FLT_ROUNDS                            = 1
	FNDELAY                               = 2048
	FNONBLOCK                             = 2048
	FOPEN_MAX                             = 16
	FP_XSTATE_MAGIC1                      = 0x46505853
	FP_XSTATE_MAGIC2                      = 0x46505845
	FRAME_IS_LAMBDA                       = 0x2
	FRAME_IS_METHOD                       = 0x4
	FRAME_IS_OO_DEFINE                    = 0x8
	FRAME_IS_PROC                         = 0x1
	F_DUPFD                               = 0
	F_DUPFD_CLOEXEC                       = 1030
	F_EXLCK                               = 4
	F_GETFD                               = 1
	F_GETFL                               = 3
	F_GETLK                               = 5
	F_GETLK64                             = 5
	F_GETOWN                              = 9
	F_LOCK                                = 1
	F_OK                                  = 0
	F_RDLCK                               = 0
	F_SETFD                               = 2
	F_SETFL                               = 4
	F_SETLK                               = 6
	F_SETLK64                             = 6
	F_SETLKW                              = 7
	F_SETLKW64                            = 7
	F_SETOWN                              = 8
	F_SHLCK                               = 8
	F_TEST                                = 3
	F_TLOCK                               = 2
	F_ULOCK                               = 0
	F_UNLCK                               = 2
	F_WRLCK                               = 1
	HAVE_BLKCNT_T                         = 1
	HAVE_CAST_TO_UNION                    = 1
	HAVE_DECL_GETHOSTBYADDR_R             = 1
	HAVE_DECL_GETHOSTBYNAME_R             = 1
	HAVE_FREEADDRINFO                     = 1
	HAVE_FTS                              = 1
	HAVE_GAI_STRERROR                     = 1
	HAVE_GETADDRINFO                      = 1
	HAVE_GETCWD                           = 1
	HAVE_GETGRGID_R                       = 1
	HAVE_GETGRGID_R_5                     = 1
	HAVE_GETGRNAM_R                       = 1
	HAVE_GETGRNAM_R_5                     = 1
	HAVE_GETHOSTBYADDR_R                  = 1
	HAVE_GETHOSTBYADDR_R_8                = 1
	HAVE_GETHOSTBYNAME_R                  = 1
	HAVE_GETHOSTBYNAME_R_6                = 1
	HAVE_GETNAMEINFO                      = 1
	HAVE_GETPWNAM_R                       = 1
	HAVE_GETPWNAM_R_5                     = 1
	HAVE_GETPWUID_R                       = 1
	HAVE_GETPWUID_R_5                     = 1
	HAVE_GMTIME_R                         = 1
	HAVE_HIDDEN                           = 1
	HAVE_INTPTR_T                         = 1
	HAVE_INTTYPES_H                       = 1
	HAVE_LANGINFO                         = 1
	HAVE_LOCALTIME_R                      = 1
	HAVE_MEMORY_H                         = 1
	HAVE_MKSTEMP                          = 1
	HAVE_MKSTEMPS                         = 1
	HAVE_MKTIME                           = 1
	HAVE_OPENDIR                          = 1
	HAVE_PTHREAD_ATTR_SETSTACKSIZE        = 1
	HAVE_SIGNED_CHAR                      = 1
	HAVE_STDINT_H                         = 1
	HAVE_STDLIB_H                         = 1
	HAVE_STRINGS_H                        = 1
	HAVE_STRING_H                         = 1
	HAVE_STRTOL                           = 1
	HAVE_STRUCT_ADDRINFO                  = 1
	HAVE_STRUCT_IN6_ADDR                  = 1
	HAVE_STRUCT_SOCKADDR_IN6              = 1
	HAVE_STRUCT_SOCKADDR_STORAGE          = 1
	HAVE_STRUCT_STAT_ST_BLKSIZE           = 1
	HAVE_STRUCT_STAT_ST_BLOCKS            = 1
	HAVE_SYS_IOCTL_H                      = 1
	HAVE_SYS_PARAM_H                      = 1
	HAVE_SYS_STAT_H                       = 1
	HAVE_SYS_TIME_H                       = 1
	HAVE_SYS_TYPES_H                      = 1
	HAVE_TERMIOS_H                        = 1
	HAVE_TIMEZONE_VAR                     = 1
	HAVE_TM_GMTOFF                        = 1
	HAVE_UINTPTR_T                        = 1
	HAVE_UNISTD_H                         = 1
	HAVE_WAITPID                          = 1
	HAVE_ZLIB                             = 1
	HOST_NAME_MAX                         = 64
	HOST_NOT_FOUND                        = 1
	HZ                                    = 100
	INET6_ADDRSTRLEN                      = 46
	INET_ADDRSTRLEN                       = 16
	INLINE                                = 0
	INT16_MAX                             = 32767
	INT16_MIN                             = -32768
	INT32_MAX                             = 2147483647
	INT32_MIN                             = -2147483648
	INT64_MAX                             = 9223372036854775807
	INT64_MIN                             = -9223372036854775808
	INT8_MAX                              = 127
	INT8_MIN                              = -128
	INTERP_ALTERNATE_WRONG_ARGS           = 0x400
	INTERP_DEBUG_FRAME                    = 0x10
	INTERP_TRACE_IN_PROGRESS              = 0x200
	INTMAX_MAX                            = 9223372036854775807
	INTMAX_MIN                            = -9223372036854775808
	INTPTR_MAX                            = 9223372036854775807
	INTPTR_MIN                            = -9223372036854775808
	INT_FAST16_MAX                        = 9223372036854775807
	INT_FAST16_MIN                        = -9223372036854775808
	INT_FAST32_MAX                        = 9223372036854775807
	INT_FAST32_MIN                        = -9223372036854775808
	INT_FAST64_MAX                        = 9223372036854775807
	INT_FAST64_MIN                        = -9223372036854775808
	INT_FAST8_MAX                         = 127
	INT_FAST8_MIN                         = -128
	INT_LEAST16_MAX                       = 32767
	INT_LEAST16_MIN                       = -32768
	INT_LEAST32_MAX                       = 2147483647
	INT_LEAST32_MIN                       = -2147483648
	INT_LEAST64_MAX                       = 9223372036854775807
	INT_LEAST64_MIN                       = -9223372036854775808
	INT_LEAST8_MAX                        = 127
	INT_LEAST8_MIN                        = -128
	INT_MAX                               = 2147483647
	INT_MIN                               = -2147483648
	IN_CLASSA_HOST                        = 16777215
	IN_CLASSA_MAX                         = 128
	IN_CLASSA_NET                         = 0xff000000
	IN_CLASSA_NSHIFT                      = 24
	IN_CLASSB_HOST                        = 65535
	IN_CLASSB_MAX                         = 65536
	IN_CLASSB_NET                         = 0xffff0000
	IN_CLASSB_NSHIFT                      = 16
	IN_CLASSC_HOST                        = 255
	IN_CLASSC_NET                         = 0xffffff00
	IN_CLASSC_NSHIFT                      = 8
	IN_LOOPBACKNET                        = 127
	IPPORT_RESERVED1                      = 1024
	IPV6_2292DSTOPTS                      = 4
	IPV6_2292HOPLIMIT                     = 8
	IPV6_2292HOPOPTS                      = 3
	IPV6_2292PKTINFO                      = 2
	IPV6_2292PKTOPTIONS                   = 6
	IPV6_2292RTHDR                        = 5
	IPV6_ADDRFORM                         = 1
	IPV6_ADDR_PREFERENCES                 = 72
	IPV6_ADD_MEMBERSHIP                   = 20
	IPV6_AUTHHDR                          = 10
	IPV6_AUTOFLOWLABEL                    = 70
	IPV6_CHECKSUM                         = 7
	IPV6_DONTFRAG                         = 62
	IPV6_DROP_MEMBERSHIP                  = 21
	IPV6_DSTOPTS                          = 59
	IPV6_FREEBIND                         = 78
	IPV6_HDRINCL                          = 36
	IPV6_HOPLIMIT                         = 52
	IPV6_HOPOPTS                          = 54
	IPV6_IPSEC_POLICY                     = 34
	IPV6_JOIN_ANYCAST                     = 27
	IPV6_JOIN_GROUP                       = 20
	IPV6_LEAVE_ANYCAST                    = 28
	IPV6_LEAVE_GROUP                      = 21
	IPV6_MINHOPCOUNT                      = 73
	IPV6_MTU                              = 24
	IPV6_MTU_DISCOVER                     = 23
	IPV6_MULTICAST_ALL                    = 29
	IPV6_MULTICAST_HOPS                   = 18
	IPV6_MULTICAST_IF                     = 17
	IPV6_MULTICAST_LOOP                   = 19
	IPV6_NEXTHOP                          = 9
	IPV6_ORIGDSTADDR                      = 74
	IPV6_PATHMTU                          = 61
	IPV6_PKTINFO                          = 50
	IPV6_PMTUDISC_DO                      = 2
	IPV6_PMTUDISC_DONT                    = 0
	IPV6_PMTUDISC_INTERFACE               = 4
	IPV6_PMTUDISC_OMIT                    = 5
	IPV6_PMTUDISC_PROBE                   = 3
	IPV6_PMTUDISC_WANT                    = 1
	IPV6_RECVDSTOPTS                      = 58
	IPV6_RECVERR                          = 25
	IPV6_RECVFRAGSIZE                     = 77
	IPV6_RECVHOPLIMIT                     = 51
	IPV6_RECVHOPOPTS                      = 53
	IPV6_RECVORIGDSTADDR                  = 74
	IPV6_RECVPATHMTU                      = 60
	IPV6_RECVPKTINFO                      = 49
	IPV6_RECVRTHDR                        = 56
	IPV6_RECVTCLASS                       = 66
	IPV6_ROUTER_ALERT                     = 22
	IPV6_ROUTER_ALERT_ISOLATE             = 30
	IPV6_RTHDR                            = 57
	IPV6_RTHDRDSTOPTS                     = 55
	IPV6_RTHDR_LOOSE                      = 0
	IPV6_RTHDR_STRICT                     = 1
	IPV6_RTHDR_TYPE_0                     = 0
	IPV6_RXDSTOPTS                        = 59
	IPV6_RXHOPOPTS                        = 54
	IPV6_TCLASS                           = 67
	IPV6_TRANSPARENT                      = 75
	IPV6_UNICAST_HOPS                     = 16
	IPV6_UNICAST_IF                       = 76
	IPV6_V6ONLY                           = 26
	IPV6_XFRM_POLICY                      = 35
	IP_ADD_MEMBERSHIP                     = 35
	IP_ADD_SOURCE_MEMBERSHIP              = 39
	IP_BIND_ADDRESS_NO_PORT               = 24
	IP_BLOCK_SOURCE                       = 38
	IP_CHECKSUM                           = 23
	IP_DEFAULT_MULTICAST_LOOP             = 1
	IP_DEFAULT_MULTICAST_TTL              = 1
	IP_DROP_MEMBERSHIP                    = 36
	IP_DROP_SOURCE_MEMBERSHIP             = 40
	IP_FREEBIND                           = 15
	IP_HDRINCL                            = 3
	IP_IPSEC_POLICY                       = 16
	IP_MAX_MEMBERSHIPS                    = 20
	IP_MINTTL                             = 21
	IP_MSFILTER                           = 41
	IP_MTU                                = 14
	IP_MTU_DISCOVER                       = 10
	IP_MULTICAST_ALL                      = 49
	IP_MULTICAST_IF                       = 32
	IP_MULTICAST_LOOP                     = 34
	IP_MULTICAST_TTL                      = 33
	IP_NODEFRAG                           = 22
	IP_OPTIONS                            = 4
	IP_ORIGDSTADDR                        = 20
	IP_PASSSEC                            = 18
	IP_PKTINFO                            = 8
	IP_PKTOPTIONS                         = 9
	IP_PMTUDISC                           = 10
	IP_PMTUDISC_DO                        = 2
	IP_PMTUDISC_DONT                      = 0
	IP_PMTUDISC_INTERFACE                 = 4
	IP_PMTUDISC_OMIT                      = 5
	IP_PMTUDISC_PROBE                     = 3
	IP_PMTUDISC_WANT                      = 1
	IP_RECVERR                            = 11
	IP_RECVFRAGSIZE                       = 25
	IP_RECVOPTS                           = 6
	IP_RECVORIGDSTADDR                    = 20
	IP_RECVRETOPTS                        = 7
	IP_RECVTOS                            = 13
	IP_RECVTTL                            = 12
	IP_RETOPTS                            = 7
	IP_ROUTER_ALERT                       = 5
	IP_TOS                                = 1
	IP_TRANSPARENT                        = 19
	IP_TTL                                = 2
	IP_UNBLOCK_SOURCE                     = 37
	IP_UNICAST_IF                         = 50
	IP_XFRM_POLICY                        = 17
	LDBL_DECIMAL_DIG                      = 21
	LDBL_DIG                              = 18
	LDBL_HAS_SUBNORM                      = 1
	LDBL_MANT_DIG                         = 64
	LDBL_MAX_10_EXP                       = 4932
	LDBL_MAX_EXP                          = 16384
	LDBL_MIN_10_EXP                       = -4931
	LDBL_MIN_EXP                          = -16381
	LINE_MAX                              = 2048
	LITTLE_ENDIAN                         = 1234
	LLONG_MAX                             = 9223372036854775807
	LLONG_MIN                             = -9223372036854775808
	LOCK_EX                               = 2
	LOCK_NB                               = 4
	LOCK_SH                               = 1
	LOCK_UN                               = 8
	LOGIN_NAME_MAX                        = 256
	LONG_MAX                              = 9223372036854775807
	LONG_MIN                              = -9223372036854775808
	LTM1                                  = 0
	LTM2                                  = 0
	LTM3                                  = 0
	LTM_ALL                               = 0
	LTM_LAST                              = 0
	L_INCR                                = 1
	L_SET                                 = 0
	L_XTND                                = 2
	L_ctermid                             = 9
	L_tmpnam                              = 20
	MAXHOSTNAMELEN                        = 64
	MAXNAMLEN                             = 255
	MAXPATHLEN                            = 4096
	MAXSYMLINKS                           = 20
	MAX_CANON                             = 255
	MAX_INPUT                             = 255
	MAX_NESTING_DEPTH                     = 1000
	MB_LEN_MAX                            = 16
	MCAST_BLOCK_SOURCE                    = 43
	MCAST_EXCLUDE                         = 0
	MCAST_INCLUDE                         = 1
	MCAST_JOIN_GROUP                      = 42
	MCAST_JOIN_SOURCE_GROUP               = 46
	MCAST_LEAVE_GROUP                     = 45
	MCAST_LEAVE_SOURCE_GROUP              = 47
	MCAST_MSFILTER                        = 48
	MCAST_UNBLOCK_SOURCE                  = 44
	MINSIGSTKSZ                           = 2048
	MP_28BIT                              = 0
	MP_BIG_ENDIAN                         = 1
	MP_BUF                                = -5
	MP_DEFAULT_KARATSUBA_MUL_CUTOFF       = 80
	MP_DEFAULT_KARATSUBA_SQR_CUTOFF       = 120
	MP_DEFAULT_TOOM_MUL_CUTOFF            = 350
	MP_DEFAULT_TOOM_SQR_CUTOFF            = 400
	MP_DIGIT_BIT                          = 28
	MP_DIGIT_DECLARED                     = 0
	MP_EQ                                 = 0
	MP_ERR                                = -1
	MP_FIXED_CUTOFFS                      = 1
	MP_GT                                 = 1
	MP_INT_DECLARED                       = 0
	MP_ITER                               = -4
	MP_KARATSUBA_MUL_CUTOFF               = 80
	MP_KARATSUBA_SQR_CUTOFF               = 120
	MP_LITTLE_ENDIAN                      = -1
	MP_LSB_FIRST                          = -1
	MP_LT                                 = -1
	MP_MEM                                = -2
	MP_MSB_FIRST                          = 1
	MP_NATIVE_ENDIAN                      = 0
	MP_NEG                                = 1
	MP_NO                                 = 0
	MP_NO_STDINT                          = 1
	MP_OKAY                               = 0
	MP_PREC                               = 4
	MP_PRIME_2MSB_ON                      = 0x0008
	MP_PRIME_BBS                          = 0x0001
	MP_PRIME_SAFE                         = 0x0002
	MP_PRIVATE                            = 0
	MP_TOOM_MUL_CUTOFF                    = 350
	MP_TOOM_SQR_CUTOFF                    = 400
	MP_VAL                                = -3
	MP_WORD_DECLARED                      = 0
	MP_YES                                = 1
	MP_ZPOS                               = 0
	MQ_PRIO_MAX                           = 32768
	NAME_MAX                              = 255
	NBBY                                  = 8
	NCARGS                                = 131072
	NDEBUG                                = 1
	NETDB_INTERNAL                        = -1
	NETDB_SUCCESS                         = 0
	NGREG                                 = 23
	NGROUPS                               = 65536
	NGROUPS_MAX                           = 65536
	NI_DGRAM                              = 16
	NI_MAXHOST                            = 1025
	NI_MAXSERV                            = 32
	NI_NAMEREQD                           = 8
	NI_NOFQDN                             = 4
	NI_NUMERICHOST                        = 1
	NI_NUMERICSERV                        = 2
	NOFILE                                = 256
	NOGROUP                               = -1
	NO_ADDRESS                            = 4
	NO_DATA                               = 4
	NO_RECOVERY                           = 3
	NO_UNION_WAIT                         = 1
	NRE_ENABLE_ASSERTS                    = 0
	NRE_USE_SMALL_ALLOC                   = 1
	NSIG                                  = 65
	NSS_BUFLEN_GROUP                      = 1024
	NSS_BUFLEN_PASSWD                     = 1024
	NS_DEAD                               = 0x02
	NS_DYING                              = 0x01
	NS_KILLED                             = 0x04
	NS_SUPPRESS_COMPILATION               = 0x08
	NUM_STATIC_TOKENS                     = 20
	O_ACCMODE                             = 0003
	O_APPEND                              = 02000
	O_ASYNC                               = 020000
	O_CLOEXEC                             = 524288
	O_CREAT                               = 0100
	O_DIRECTORY                           = 65536
	O_DSYNC                               = 4096
	O_EXCL                                = 0200
	O_FSYNC                               = 1052672
	O_LARGEFILE                           = 0
	O_NDELAY                              = 2048
	O_NOCTTY                              = 0400
	O_NOFOLLOW                            = 131072
	O_NONBLOCK                            = 04000
	O_RDONLY                              = 00
	O_RDWR                                = 02
	O_RSYNC                               = 1052672
	O_SYNC                                = 04010000
	O_TRUNC                               = 01000
	O_WRONLY                              = 01
	PACKAGE_BUGREPORT                     = ""
	PACKAGE_NAME                          = "tcl"
	PACKAGE_STRING                        = "tcl 8.6"
	PACKAGE_TARNAME                       = "tcl"
	PACKAGE_VERSION                       = "8.6"
	PATH_MAX                              = 4096
	PDP_ENDIAN                            = 3412
	PF_ALG                                = 38
	PF_APPLETALK                          = 5
	PF_ASH                                = 18
	PF_ATMPVC                             = 8
	PF_ATMSVC                             = 20
	PF_AX25                               = 3
	PF_BLUETOOTH                          = 31
	PF_BRIDGE                             = 7
	PF_CAIF                               = 37
	PF_CAN                                = 29
	PF_DECnet                             = 12
	PF_ECONET                             = 19
	PF_FILE                               = 1
	PF_IB                                 = 27
	PF_IEEE802154                         = 36
	PF_INET                               = 2
	PF_INET6                              = 10
	PF_IPX                                = 4
	PF_IRDA                               = 23
	PF_ISDN                               = 34
	PF_IUCV                               = 32
	PF_KCM                                = 41
	PF_KEY                                = 15
	PF_LLC                                = 26
	PF_LOCAL                              = 1
	PF_MAX                                = 45
	PF_MPLS                               = 28
	PF_NETBEUI                            = 13
	PF_NETLINK                            = 16
	PF_NETROM                             = 6
	PF_NFC                                = 39
	PF_PACKET                             = 17
	PF_PHONET                             = 35
	PF_PPPOX                              = 24
	PF_QIPCRTR                            = 42
	PF_RDS                                = 21
	PF_ROSE                               = 11
	PF_ROUTE                              = 16
	PF_RXRPC                              = 33
	PF_SECURITY                           = 14
	PF_SMC                                = 43
	PF_SNA                                = 22
	PF_TIPC                               = 30
	PF_UNIX                               = 1
	PF_UNSPEC                             = 0
	PF_VSOCK                              = 40
	PF_WANPIPE                            = 25
	PF_X25                                = 9
	PF_XDP                                = 44
	PIPE_BUF                              = 4096
	POSIX_FADV_DONTNEED                   = 4
	POSIX_FADV_NOREUSE                    = 5
	POSIX_FADV_NORMAL                     = 0
	POSIX_FADV_RANDOM                     = 1
	POSIX_FADV_SEQUENTIAL                 = 2
	POSIX_FADV_WILLNEED                   = 3
	PRIVATE_MP_PRIME_TAB_SIZE             = 256
	PRIX16                                = "X"
	PRIX32                                = "X"
	PRIX8                                 = "X"
	PRIXFAST8                             = "X"
	PRIXLEAST16                           = "X"
	PRIXLEAST32                           = "X"
	PRIXLEAST8                            = "X"
	PRId16                                = "d"
	PRId32                                = "d"
	PRId8                                 = "d"
	PRIdFAST8                             = "d"
	PRIdLEAST16                           = "d"
	PRIdLEAST32                           = "d"
	PRIdLEAST8                            = "d"
	PRIi16                                = "i"
	PRIi32                                = "i"
	PRIi8                                 = "i"
	PRIiFAST8                             = "i"
	PRIiLEAST16                           = "i"
	PRIiLEAST32                           = "i"
	PRIiLEAST8                            = "i"
	PRIo16                                = "o"
	PRIo32                                = "o"
	PRIo8                                 = "o"
	PRIoFAST8                             = "o"
	PRIoLEAST16                           = "o"
	PRIoLEAST32                           = "o"
	PRIoLEAST8                            = "o"
	PRIu16                                = "u"
	PRIu32                                = "u"
	PRIu8                                 = "u"
	PRIuFAST8                             = "u"
	PRIuLEAST16                           = "u"
	PRIuLEAST32                           = "u"
	PRIuLEAST8                            = "u"
	PRIx16                                = "x"
	PRIx32                                = "x"
	PRIx8                                 = "x"
	PRIxFAST8                             = "x"
	PRIxLEAST16                           = "x"
	PRIxLEAST32                           = "x"
	PRIxLEAST8                            = "x"
	PTHREAD_BARRIER_SERIAL_THREAD         = -1
	PTHREAD_DESTRUCTOR_ITERATIONS         = 4
	PTHREAD_KEYS_MAX                      = 1024
	PTHREAD_ONCE_INIT                     = 0
	PTHREAD_STACK_MIN                     = 16384
	PTRDIFF_MAX                           = 9223372036854775807
	PTRDIFF_MIN                           = -9223372036854775808
	P_tmpdir                              = "/tmp"
	RAND_MAX                              = 2147483647
	RAND_SEED_INITIALIZED                 = 0x40
	RE_DUP_MAX                            = 32767
	RTSIG_MAX                             = 32
	R_OK                                  = 4
	SAFE_INTERP                           = 0x80
	SA_INTERRUPT                          = 0x20000000
	SA_NOCLDSTOP                          = 1
	SA_NOCLDWAIT                          = 2
	SA_NODEFER                            = 0x40000000
	SA_NOMASK                             = 1073741824
	SA_ONESHOT                            = 2147483648
	SA_ONSTACK                            = 0x08000000
	SA_RESETHAND                          = 0x80000000
	SA_RESTART                            = 0x10000000
	SA_SIGINFO                            = 4
	SA_STACK                              = 134217728
	SCHAR_MAX                             = 127
	SCHAR_MIN                             = -128
	SCHED_FIFO                            = 1
	SCHED_OTHER                           = 0
	SCHED_RR                              = 2
	SCM_TIMESTAMP                         = 29
	SCM_TIMESTAMPING                      = 37
	SCM_TIMESTAMPING_OPT_STATS            = 54
	SCM_TIMESTAMPING_PKTINFO              = 58
	SCM_TIMESTAMPNS                       = 35
	SCM_TXTIME                            = 61
	SCM_WIFI_STATUS                       = 41
	SCNd16                                = "hd"
	SCNd32                                = "d"
	SCNd8                                 = "hhd"
	SCNdFAST8                             = "hhd"
	SCNdLEAST16                           = "hd"
	SCNdLEAST32                           = "d"
	SCNdLEAST8                            = "hhd"
	SCNi16                                = "hi"
	SCNi32                                = "i"
	SCNi8                                 = "hhi"
	SCNiFAST8                             = "hhi"
	SCNiLEAST16                           = "hi"
	SCNiLEAST32                           = "i"
	SCNiLEAST8                            = "hhi"
	SCNo16                                = "ho"
	SCNo32                                = "o"
	SCNo8                                 = "hho"
	SCNoFAST8                             = "hho"
	SCNoLEAST16                           = "ho"
	SCNoLEAST32                           = "o"
	SCNoLEAST8                            = "hho"
	SCNu16                                = "hu"
	SCNu32                                = "u"
	SCNu8                                 = "hhu"
	SCNuFAST8                             = "hhu"
	SCNuLEAST16                           = "hu"
	SCNuLEAST32                           = "u"
	SCNuLEAST8                            = "hhu"
	SCNx16                                = "hx"
	SCNx32                                = "x"
	SCNx8                                 = "hhx"
	SCNxFAST8                             = "hhx"
	SCNxLEAST16                           = "hx"
	SCNxLEAST32                           = "x"
	SCNxLEAST8                            = "hhx"
	SEEK_CUR                              = 1
	SEEK_END                              = 2
	SEEK_SET                              = 0
	SEM_VALUE_MAX                         = 2147483647
	SHRT_MAX                              = 32767
	SHRT_MIN                              = -32768
	SIGABRT                               = 6
	SIGALRM                               = 14
	SIGBUS                                = 7
	SIGCHLD                               = 17
	SIGCLD                                = 17
	SIGCONT                               = 18
	SIGFPE                                = 8
	SIGHUP                                = 1
	SIGILL                                = 4
	SIGINT                                = 2
	SIGIO                                 = 29
	SIGIOT                                = 6
	SIGKILL                               = 9
	SIGPIPE                               = 13
	SIGPOLL                               = 29
	SIGPROF                               = 27
	SIGPWR                                = 30
	SIGQUIT                               = 3
	SIGSEGV                               = 11
	SIGSTKFLT                             = 16
	SIGSTKSZ                              = 8192
	SIGSTOP                               = 19
	SIGSYS                                = 31
	SIGTERM                               = 15
	SIGTRAP                               = 5
	SIGTSTP                               = 20
	SIGTTIN                               = 21
	SIGTTOU                               = 22
	SIGURG                                = 23
	SIGUSR1                               = 10
	SIGUSR2                               = 12
	SIGVTALRM                             = 26
	SIGWINCH                              = 28
	SIGXCPU                               = 24
	SIGXFSZ                               = 25
	SIG_ATOMIC_MAX                        = 2147483647
	SIG_ATOMIC_MIN                        = -2147483648
	SIG_BLOCK                             = 0
	SIG_SETMASK                           = 2
	SIG_UNBLOCK                           = 1
	SIOCATMARK                            = 0x8905
	SIOCGPGRP                             = 0x8904
	SIOCGSTAMP                            = 0x8906
	SIOCGSTAMPNS                          = 0x8907
	SIOCSPGRP                             = 0x8902
	SIZE_MAX                              = 18446744073709551615
	SOL_AAL                               = 265
	SOL_ALG                               = 279
	SOL_ATM                               = 264
	SOL_BLUETOOTH                         = 274
	SOL_CAIF                              = 278
	SOL_DCCP                              = 269
	SOL_DECNET                            = 261
	SOL_ICMPV6                            = 58
	SOL_IP                                = 0
	SOL_IPV6                              = 41
	SOL_IRDA                              = 266
	SOL_IUCV                              = 277
	SOL_KCM                               = 281
	SOL_LLC                               = 268
	SOL_NETBEUI                           = 267
	SOL_NETLINK                           = 270
	SOL_NFC                               = 280
	SOL_PACKET                            = 263
	SOL_PNPIPE                            = 275
	SOL_PPPOL2TP                          = 273
	SOL_RAW                               = 255
	SOL_RDS                               = 276
	SOL_RXRPC                             = 272
	SOL_SOCKET                            = 1
	SOL_TIPC                              = 271
	SOL_TLS                               = 282
	SOL_X25                               = 262
	SOL_XDP                               = 283
	SOMAXCONN                             = 4096
	SO_ACCEPTCONN                         = 30
	SO_ATTACH_BPF                         = 50
	SO_ATTACH_FILTER                      = 26
	SO_ATTACH_REUSEPORT_CBPF              = 51
	SO_ATTACH_REUSEPORT_EBPF              = 52
	SO_BINDTODEVICE                       = 25
	SO_BINDTOIFINDEX                      = 62
	SO_BPF_EXTENSIONS                     = 48
	SO_BROADCAST                          = 6
	SO_BSDCOMPAT                          = 14
	SO_BUSY_POLL                          = 46
	SO_CNX_ADVICE                         = 53
	SO_COOKIE                             = 57
	SO_DEBUG                              = 1
	SO_DETACH_BPF                         = 27
	SO_DETACH_FILTER                      = 27
	SO_DETACH_REUSEPORT_BPF               = 68
	SO_DOMAIN                             = 39
	SO_DONTROUTE                          = 5
	SO_ERROR                              = 4
	SO_GET_FILTER                         = 26
	SO_INCOMING_CPU                       = 49
	SO_INCOMING_NAPI_ID                   = 56
	SO_KEEPALIVE                          = 9
	SO_LINGER                             = 13
	SO_LOCK_FILTER                        = 44
	SO_MARK                               = 36
	SO_MAX_PACING_RATE                    = 47
	SO_MEMINFO                            = 55
	SO_NOFCS                              = 43
	SO_NO_CHECK                           = 11
	SO_OOBINLINE                          = 10
	SO_PASSCRED                           = 16
	SO_PASSSEC                            = 34
	SO_PEEK_OFF                           = 42
	SO_PEERCRED                           = 17
	SO_PEERGROUPS                         = 59
	SO_PEERNAME                           = 28
	SO_PEERSEC                            = 31
	SO_PRIORITY                           = 12
	SO_PROTOCOL                           = 38
	SO_RCVBUF                             = 8
	SO_RCVBUFFORCE                        = 33
	SO_RCVLOWAT                           = 18
	SO_RCVTIMEO                           = 20
	SO_RCVTIMEO_NEW                       = 66
	SO_RCVTIMEO_OLD                       = 20
	SO_REUSEADDR                          = 2
	SO_REUSEPORT                          = 15
	SO_RXQ_OVFL                           = 40
	SO_SECURITY_AUTHENTICATION            = 22
	SO_SECURITY_ENCRYPTION_NETWORK        = 24
	SO_SECURITY_ENCRYPTION_TRANSPORT      = 23
	SO_SELECT_ERR_QUEUE                   = 45
	SO_SNDBUF                             = 7
	SO_SNDBUFFORCE                        = 32
	SO_SNDLOWAT                           = 19
	SO_SNDTIMEO                           = 21
	SO_SNDTIMEO_NEW                       = 67
	SO_SNDTIMEO_OLD                       = 21
	SO_TIMESTAMP                          = 29
	SO_TIMESTAMPING                       = 37
	SO_TIMESTAMPING_NEW                   = 65
	SO_TIMESTAMPING_OLD                   = 37
	SO_TIMESTAMPNS                        = 35
	SO_TIMESTAMPNS_NEW                    = 64
	SO_TIMESTAMPNS_OLD                    = 35
	SO_TIMESTAMP_NEW                      = 63
	SO_TIMESTAMP_OLD                      = 29
	SO_TXTIME                             = 61
	SO_TYPE                               = 3
	SO_WIFI_STATUS                        = 41
	SO_ZEROCOPY                           = 60
	SSIZE_MAX                             = 9223372036854775807
	STATIC_BUILD                          = 1
	STDC_HEADERS                          = 1
	STDERR_FILENO                         = 2
	STDIN_FILENO                          = 0
	STDOUT_FILENO                         = 1
	SYS_NMLN                              = 65
	S_BLKSIZE                             = 512
	S_IEXEC                               = 64
	S_IFBLK                               = 24576
	S_IFCHR                               = 8192
	S_IFDIR                               = 16384
	S_IFIFO                               = 4096
	S_IFLNK                               = 40960
	S_IFMT                                = 61440
	S_IFREG                               = 32768
	S_IFSOCK                              = 49152
	S_IREAD                               = 256
	S_IRGRP                               = 32
	S_IROTH                               = 4
	S_IRUSR                               = 256
	S_IRWXG                               = 56
	S_IRWXO                               = 7
	S_IRWXU                               = 448
	S_ISGID                               = 1024
	S_ISUID                               = 2048
	S_ISVTX                               = 512
	S_IWGRP                               = 16
	S_IWOTH                               = 2
	S_IWRITE                              = 128
	S_IWUSR                               = 128
	S_IXGRP                               = 8
	S_IXOTH                               = 1
	S_IXUSR                               = 64
	TCLFLEXARRAY                          = 0
	TCLTOMMATH_EPOCH                      = 0
	TCLTOMMATH_REVISION                   = 0
	TCL_ALLOW_EXCEPTIONS                  = 0x04
	TCL_ALLOW_INLINE_COMPILATION          = 0x20000
	TCL_ALL_EVENTS                        = -3
	TCL_ALPHA_RELEASE                     = 0
	TCL_APPEND_VALUE                      = 4
	TCL_ARGV_CONSTANT                     = 15
	TCL_ARGV_END                          = 23
	TCL_ARGV_FLOAT                        = 19
	TCL_ARGV_FUNC                         = 20
	TCL_ARGV_GENFUNC                      = 21
	TCL_ARGV_HELP                         = 22
	TCL_ARGV_INT                          = 16
	TCL_ARGV_REST                         = 18
	TCL_ARGV_STRING                       = 17
	TCL_AVOID_RESOLVERS                   = 0x40000
	TCL_BETA_RELEASE                      = 1
	TCL_BREAK                             = 3
	TCL_CANCEL_UNWIND                     = 0x100000
	TCL_CFGVAL_ENCODING                   = "iso8859-1"
	TCL_CFG_OPTIMIZED                     = 1
	TCL_CHANNEL_THREAD_INSERT             = 0
	TCL_CHANNEL_THREAD_REMOVE             = 1
	TCL_CLOSE_READ                        = 2
	TCL_CLOSE_WRITE                       = 4
	TCL_CONTINUE                          = 4
	TCL_CONVERT_MULTIBYTE                 = -1
	TCL_CONVERT_NOSPACE                   = -4
	TCL_CONVERT_SYNTAX                    = -2
	TCL_CONVERT_UNKNOWN                   = -3
	TCL_CREATE_HARD_LINK                  = 0x02
	TCL_CREATE_NS_IF_UNKNOWN              = 0x800
	TCL_CREATE_SYMBOLIC_LINK              = 0x01
	TCL_CUSTOM_PTR_KEYS                   = -1
	TCL_CUSTOM_TYPE_KEYS                  = -2
	TCL_DD_CONVERSION_TYPE_MASK           = 0x3
	TCL_DD_E_FORMAT                       = 0x2
	TCL_DD_F_FORMAT                       = 0x3
	TCL_DD_NO_QUICK                       = 0x8
	TCL_DD_SHORTEN_FLAG                   = 0x4
	TCL_DD_SHORTEST                       = 0x4
	TCL_DD_SHORTEST0                      = 0x0
	TCL_DD_STEELE                         = 0x5
	TCL_DD_STEELE0                        = 0x1
	TCL_DONT_QUOTE_HASH                   = 8
	TCL_DONT_USE_BRACES                   = 1
	TCL_DONT_WAIT                         = 2
	TCL_DOUBLE_SPACE                      = 27
	TCL_DSTRING_STATIC_SIZE               = 200
	TCL_EACH_COLLECT                      = 1
	TCL_EACH_KEEP_NONE                    = 0
	TCL_ENCODING_CHAR_LIMIT               = 0x10
	TCL_ENCODING_END                      = 0x02
	TCL_ENCODING_NO_TERMINATE             = 0x08
	TCL_ENCODING_START                    = 0x01
	TCL_ENCODING_STOPONERROR              = 0x04
	TCL_ENFORCE_MODE                      = 16
	TCL_ENSEMBLE_PREFIX                   = 0x02
	TCL_ERROR                             = 1
	TCL_EVAL_DIRECT                       = 0x040000
	TCL_EVAL_DISCARD_RESULT               = 0x40
	TCL_EVAL_FILE                         = 0x02
	TCL_EVAL_GLOBAL                       = 0x020000
	TCL_EVAL_INVOKE                       = 0x080000
	TCL_EVAL_NOERR                        = 0x200000
	TCL_EVAL_NORESOLVE                    = 0x20
	TCL_EVAL_SOURCE_IN_FRAME              = 0x10
	TCL_EXACT                             = 1
	TCL_EXCEPTION                         = 8
	TCL_FILE_EVENTS                       = 8
	TCL_FINAL_RELEASE                     = 2
	TCL_FIND_ONLY_NS                      = 0x1000
	TCL_GLOBAL_ONLY                       = 1
	TCL_GLOBMODE_DIR                      = 4
	TCL_GLOBMODE_JOIN                     = 2
	TCL_GLOBMODE_NO_COMPLAIN              = 1
	TCL_GLOBMODE_TAILS                    = 8
	TCL_GLOB_PERM_HIDDEN                  = 2
	TCL_GLOB_PERM_R                       = 4
	TCL_GLOB_PERM_RONLY                   = 1
	TCL_GLOB_PERM_W                       = 8
	TCL_GLOB_PERM_X                       = 16
	TCL_GLOB_TYPE_BLOCK                   = 1
	TCL_GLOB_TYPE_CHAR                    = 2
	TCL_GLOB_TYPE_DIR                     = 4
	TCL_GLOB_TYPE_FILE                    = 16
	TCL_GLOB_TYPE_LINK                    = 32
	TCL_GLOB_TYPE_MOUNT                   = 128
	TCL_GLOB_TYPE_PIPE                    = 8
	TCL_GLOB_TYPE_SOCK                    = 64
	TCL_HASH_KEY_RANDOMIZE_HASH           = 0x1
	TCL_HASH_KEY_STORE_HASH               = 1
	TCL_HASH_KEY_SYSTEM_HASH              = 0x2
	TCL_HASH_KEY_TYPE_VERSION             = 1
	TCL_IDLE_EVENTS                       = 32
	TCL_INDEX_AFTER                       = 2147483647
	TCL_INDEX_BEFORE                      = -1
	TCL_INDEX_END                         = -2
	TCL_INDEX_START                       = 0
	TCL_INTEGER_SPACE                     = 24
	TCL_INTERP_DESTROYED                  = 0x100
	TCL_INVOKE_HIDDEN                     = 1
	TCL_INVOKE_NO_TRACEBACK               = 4
	TCL_INVOKE_NO_UNKNOWN                 = 2
	TCL_LEAVE_ERR_MSG                     = 0x200
	TCL_LIMIT_COMMANDS                    = 0x01
	TCL_LIMIT_TIME                        = 0x02
	TCL_LINK_BOOLEAN                      = 3
	TCL_LINK_CHAR                         = 6
	TCL_LINK_DOUBLE                       = 2
	TCL_LINK_FLOAT                        = 13
	TCL_LINK_INT                          = 1
	TCL_LINK_LONG                         = 11
	TCL_LINK_READ_ONLY                    = 0x80
	TCL_LINK_SHORT                        = 8
	TCL_LINK_STRING                       = 4
	TCL_LINK_UCHAR                        = 7
	TCL_LINK_UINT                         = 10
	TCL_LINK_ULONG                        = 12
	TCL_LINK_USHORT                       = 9
	TCL_LINK_WIDE_INT                     = 5
	TCL_LINK_WIDE_UINT                    = 14
	TCL_LIST_ELEMENT                      = 8
	TCL_LL_MODIFIER                       = "l"
	TCL_LOAD_GLOBAL                       = 1
	TCL_LOAD_LAZY                         = 2
	TCL_LOCATION_BC                       = 2
	TCL_LOCATION_EVAL                     = 0
	TCL_LOCATION_LAST                     = 6
	TCL_LOCATION_PREBC                    = 3
	TCL_LOCATION_PROC                     = 5
	TCL_LOCATION_SOURCE                   = 4
	TCL_MAJOR_VERSION                     = 8
	TCL_MATCH_NOCASE                      = 1
	TCL_MAX_PREC                          = 17
	TCL_MINOR_VERSION                     = 6
	TCL_MIN_GROWTH                        = 1024
	TCL_MODE_BLOCKING                     = 0
	TCL_MODE_NONBLOCKING                  = 1
	TCL_NAMESPACE_ONLY                    = 2
	TCL_NO_EVAL                           = 0x010000
	TCL_NUMBER_BIG                        = 3
	TCL_NUMBER_DOUBLE                     = 4
	TCL_NUMBER_LONG                       = 1
	TCL_NUMBER_NAN                        = 5
	TCL_NUMBER_WIDE                       = 2
	TCL_OK                                = 0
	TCL_ONE_WORD_KEYS                     = 1
	TCL_OUT_LINE_COMPILE                  = 1
	TCL_PARSE_BAD_NUMBER                  = 9
	TCL_PARSE_BINARY_ONLY                 = 64
	TCL_PARSE_BRACE_EXTRA                 = 2
	TCL_PARSE_DECIMAL_ONLY                = 1
	TCL_PARSE_HEXADECIMAL_ONLY            = 4
	TCL_PARSE_INTEGER_ONLY                = 8
	TCL_PARSE_MISSING_BRACE               = 3
	TCL_PARSE_MISSING_BRACKET             = 4
	TCL_PARSE_MISSING_PAREN               = 5
	TCL_PARSE_MISSING_QUOTE               = 6
	TCL_PARSE_MISSING_VAR_BRACE           = 7
	TCL_PARSE_NO_WHITESPACE               = 32
	TCL_PARSE_OCTAL_ONLY                  = 2
	TCL_PARSE_PART1                       = 0x400
	TCL_PARSE_QUOTE_EXTRA                 = 1
	TCL_PARSE_SCAN_PREFIXES               = 16
	TCL_PARSE_SUCCESS                     = 0
	TCL_PARSE_SYNTAX                      = 8
	TCL_PATCH_LEVEL                       = "8.6.12"
	TCL_READABLE                          = 2
	TCL_REG_ADVANCED                      = 000003
	TCL_REG_ADVF                          = 000002
	TCL_REG_BASIC                         = 000000
	TCL_REG_BOSONLY                       = 002000
	TCL_REG_CANMATCH                      = 001000
	TCL_REG_EXPANDED                      = 000040
	TCL_REG_EXTENDED                      = 000001
	TCL_REG_NEWLINE                       = 000300
	TCL_REG_NLANCH                        = 000200
	TCL_REG_NLSTOP                        = 000100
	TCL_REG_NOCASE                        = 000010
	TCL_REG_NOSUB                         = 000020
	TCL_REG_NOTBOL                        = 0001
	TCL_REG_NOTEOL                        = 0002
	TCL_REG_QUOTE                         = 000004
	TCL_RELEASE_LEVEL                     = 2
	TCL_RELEASE_SERIAL                    = 12
	TCL_RESULT_SIZE                       = 200
	TCL_RETURN                            = 2
	TCL_SERVICE_ALL                       = 1
	TCL_SERVICE_NONE                      = 0
	TCL_SHLIB_EXT                         = ""
	TCL_SMALL_HASH_TABLE                  = 4
	TCL_STDERR                            = 8
	TCL_STDIN                             = 2
	TCL_STDOUT                            = 4
	TCL_STORAGE_CLASS                     = 0
	TCL_STRING_KEYS                       = 0
	TCL_SUBST_ALL                         = 007
	TCL_SUBST_BACKSLASHES                 = 004
	TCL_SUBST_COMMANDS                    = 001
	TCL_SUBST_VARIABLES                   = 002
	TCL_THREADS                           = 1
	TCL_THREAD_CREATE_RETURN              = 0
	TCL_THREAD_JOINABLE                   = 1
	TCL_THREAD_NOFLAGS                    = 0
	TCL_THREAD_STACK_DEFAULT              = 0
	TCL_TIMER_EVENTS                      = 16
	TCL_TOKEN_BS                          = 8
	TCL_TOKEN_COMMAND                     = 16
	TCL_TOKEN_EXPAND_WORD                 = 256
	TCL_TOKEN_OPERATOR                    = 128
	TCL_TOKEN_SIMPLE_WORD                 = 2
	TCL_TOKEN_SUB_EXPR                    = 64
	TCL_TOKEN_TEXT                        = 4
	TCL_TOKEN_VARIABLE                    = 32
	TCL_TOKEN_WORD                        = 1
	TCL_TOMMATH                           = 1
	TCL_TRACE_ARRAY                       = 0x800
	TCL_TRACE_DELETE                      = 0x4000
	TCL_TRACE_DESTROYED                   = 0x80
	TCL_TRACE_ENTER_EXEC                  = 1
	TCL_TRACE_LEAVE_EXEC                  = 2
	TCL_TRACE_OLD_STYLE                   = 0x1000
	TCL_TRACE_READS                       = 0x10
	TCL_TRACE_RENAME                      = 0x2000
	TCL_TRACE_RESULT_DYNAMIC              = 0x8000
	TCL_TRACE_RESULT_OBJECT               = 0x10000
	TCL_TRACE_UNSETS                      = 0x40
	TCL_TRACE_WRITES                      = 0x20
	TCL_UNLOAD_DETACH_FROM_INTERPRETER    = 1
	TCL_UNLOAD_DETACH_FROM_PROCESS        = 2
	TCL_UNLOAD_DLLS                       = 1
	TCL_UTF_MAX                           = 3
	TCL_VERSION                           = "8.6"
	TCL_WIDE_INT_IS_LONG                  = 1
	TCL_WINDOW_EVENTS                     = 4
	TCL_WRITABLE                          = 4
	TCL_ZLIB_COMPRESS_BEST                = 9
	TCL_ZLIB_COMPRESS_DEFAULT             = -1
	TCL_ZLIB_COMPRESS_FAST                = 1
	TCL_ZLIB_COMPRESS_NONE                = 0
	TCL_ZLIB_FINALIZE                     = 4
	TCL_ZLIB_FLUSH                        = 2
	TCL_ZLIB_FORMAT_AUTO                  = 8
	TCL_ZLIB_FORMAT_GZIP                  = 4
	TCL_ZLIB_FORMAT_RAW                   = 1
	TCL_ZLIB_FORMAT_ZLIB                  = 2
	TCL_ZLIB_FULLFLUSH                    = 3
	TCL_ZLIB_NO_FLUSH                     = 0
	TCL_ZLIB_STREAM_DEFLATE               = 16
	TCL_ZLIB_STREAM_INFLATE               = 32
	TIMER_ABSTIME                         = 1
	TIME_UTC                              = 1
	TIME_WITH_SYS_TIME                    = 1
	TMP_MAX                               = 238328
	TOMMATH_PRIV_H_                       = 0
	TRY_AGAIN                             = 2
	TTY_NAME_MAX                          = 32
	UCHAR_MAX                             = 255
	UINT16_MAX                            = 65535
	UINT32_MAX                            = 4294967295
	UINT64_MAX                            = 18446744073709551615
	UINT8_MAX                             = 255
	UINTMAX_MAX                           = 18446744073709551615
	UINTPTR_MAX                           = 18446744073709551615
	UINT_FAST16_MAX                       = 18446744073709551615
	UINT_FAST32_MAX                       = 18446744073709551615
	UINT_FAST64_MAX                       = 18446744073709551615
	UINT_FAST8_MAX                        = 255
	UINT_LEAST16_MAX                      = 65535
	UINT_LEAST32_MAX                      = 4294967295
	UINT_LEAST64_MAX                      = 18446744073709551615
	UINT_LEAST8_MAX                       = 255
	UINT_MAX                              = 4294967295
	ULLONG_MAX                            = 18446744073709551615
	ULONG_MAX                             = 18446744073709551615
	USE_THREAD_ALLOC                      = 1
	USHRT_MAX                             = 65535
	UTIME_NOW                             = 1073741823
	UTIME_OMIT                            = 1073741822
	VAR_ALL_HASH                          = 4236
	VAR_ALL_TRACES                        = 2160
	VAR_ARGUMENT                          = 0x100
	VAR_ARRAY                             = 0x1
	VAR_ARRAY_ELEMENT                     = 0x1000
	VAR_DEAD_HASH                         = 0x8
	VAR_IN_HASHTABLE                      = 0x4
	VAR_IS_ARGS                           = 0x400
	VAR_LINK                              = 0x2
	VAR_NAMESPACE_VAR                     = 0x80
	VAR_RESOLVED                          = 0x8000
	VAR_SEARCH_ACTIVE                     = 0x4000
	VAR_TEMPORARY                         = 0x200
	VAR_TRACED_ARRAY                      = 0x800
	VAR_TRACED_READ                       = 0x10
	VAR_TRACED_UNSET                      = 0x40
	VAR_TRACED_WRITE                      = 0x20
	VAR_TRACE_ACTIVE                      = 0x2000
	WAIT_ANY                              = -1
	WAIT_MYPGRP                           = 0
	WCHAR_MAX                             = 2147483647
	WCHAR_MIN                             = -2147483648
	WCONTINUED                            = 8
	WCOREFLAG                             = 128
	WEXITED                               = 4
	WINT_MAX                              = 4294967295
	WINT_MIN                              = 0
	WNOHANG                               = 1
	WNOWAIT                               = 0x01000000
	WSTOPPED                              = 2
	WUNTRACED                             = 2
	W_OK                                  = 2
	XATTR_LIST_MAX                        = 65536
	XATTR_NAME_MAX                        = 255
	XATTR_SIZE_MAX                        = 65536
	X_OK                                  = 1
	X_ALLOCA_H                            = 1
	X_ANSI_STDARG_H_                      = 0
	X_ANSI_STDDEF_H                       = 0
	X_ARPA_INET_H                         = 1
	X_ASM_GENERIC_ERRNO_BASE_H            = 0
	X_ASM_GENERIC_ERRNO_H                 = 0
	X_ASM_X86_POSIX_TYPES_64_H            = 0
	X_ATFILE_SOURCE                       = 1
	X_BITS_BYTESWAP_H                     = 1
	X_BITS_CPU_SET_H                      = 1
	X_BITS_ENDIANNESS_H                   = 1
	X_BITS_ENDIAN_H                       = 1
	X_BITS_ERRNO_H                        = 1
	X_BITS_FLOATN_COMMON_H                = 0
	X_BITS_FLOATN_H                       = 0
	X_BITS_POSIX1_LIM_H                   = 1
	X_BITS_POSIX2_LIM_H                   = 1
	X_BITS_POSIX_OPT_H                    = 1
	X_BITS_PTHREADTYPES_ARCH_H            = 1
	X_BITS_PTHREADTYPES_COMMON_H          = 1
	X_BITS_SCHED_H                        = 1
	X_BITS_SETJMP_H                       = 1
	X_BITS_SIGACTION_H                    = 1
	X_BITS_SIGCONTEXT_H                   = 1
	X_BITS_SIGEVENT_CONSTS_H              = 1
	X_BITS_SIGINFO_ARCH_H                 = 1
	X_BITS_SIGINFO_CONSTS_H               = 1
	X_BITS_SIGNUM_GENERIC_H               = 1
	X_BITS_SIGNUM_H                       = 1
	X_BITS_SIGSTACK_H                     = 1
	X_BITS_SIGTHREAD_H                    = 1
	X_BITS_SOCKADDR_H                     = 1
	X_BITS_SS_FLAGS_H                     = 1
	X_BITS_STAT_H                         = 1
	X_BITS_STDINT_INTN_H                  = 1
	X_BITS_STDINT_UINTN_H                 = 1
	X_BITS_STDIO_LIM_H                    = 1
	X_BITS_TIME64_H                       = 1
	X_BITS_TIME_H                         = 1
	X_BITS_TYPESIZES_H                    = 1
	X_BITS_TYPES_H                        = 1
	X_BITS_TYPES_LOCALE_T_H               = 1
	X_BITS_TYPES_STRUCT_SCHED_PARAM       = 1
	X_BITS_TYPES___LOCALE_T_H             = 1
	X_BITS_UINTN_IDENTITY_H               = 1
	X_BITS_WCHAR_H                        = 1
	X_BSD_PTRDIFF_T_                      = 0
	X_BSD_SIZE_T_                         = 0
	X_BSD_SIZE_T_DEFINED_                 = 0
	X_CLIENTDATA                          = 0
	X_CTYPE_H                             = 1
	X_DEFAULT_SOURCE                      = 1
	X_DIRENT_H                            = 1
	X_DIRENT_HAVE_D_OFF                   = 0
	X_DIRENT_HAVE_D_RECLEN                = 0
	X_DIRENT_HAVE_D_TYPE                  = 0
	X_DIRENT_MATCHES_DIRENT64             = 1
	X_ENDIAN_H                            = 1
	X_ERRNO_H                             = 1
	X_FCNTL_H                             = 1
	X_FEATURES_H                          = 1
	X_FILE_OFFSET_BITS                    = 64
	X_FLOAT_H___                          = 0
	X_GCC_LIMITS_H_                       = 0
	X_GCC_MAX_ALIGN_T                     = 0
	X_GCC_PTRDIFF_T                       = 0
	X_GCC_SIZE_T                          = 0
	X_GCC_WCHAR_T                         = 0
	X_GCC_WRAP_STDINT_H                   = 0
	X_GETOPT_CORE_H                       = 1
	X_GETOPT_POSIX_H                      = 1
	X_GRP_H                               = 1
	X_INTTYPES_H                          = 1
	X_IOFBF                               = 0
	X_IOLBF                               = 1
	X_IONBF                               = 2
	X_IO_EOF_SEEN                         = 0x0010
	X_IO_ERR_SEEN                         = 0x0020
	X_IO_USER_LOCK                        = 0x8000
	X_LARGEFILE64_SOURCE                  = 1
	X_LFS64_ASYNCHRONOUS_IO               = 1
	X_LFS64_LARGEFILE                     = 1
	X_LFS64_STDIO                         = 1
	X_LFS_ASYNCHRONOUS_IO                 = 1
	X_LFS_LARGEFILE                       = 1
	X_LIBC_LIMITS_H_                      = 1
	X_LIMITS_H___                         = 0
	X_LINUX_LIMITS_H                      = 0
	X_LINUX_PARAM_H                       = 0
	X_LINUX_POSIX_TYPES_H                 = 0
	X_LP64                                = 1
	X_MKNOD_VER                           = 0
	X_MKNOD_VER_LINUX                     = 0
	X_NETDB_H                             = 1
	X_NETINET_IN_H                        = 1
	X_NSIG                                = 65
	X_PATH_HEQUIV                         = "/etc/hosts.equiv"
	X_PATH_HOSTS                          = "/etc/hosts"
	X_PATH_NETWORKS                       = "/etc/networks"
	X_PATH_NSSWITCH_CONF                  = "/etc/nsswitch.conf"
	X_PATH_PROTOCOLS                      = "/etc/protocols"
	X_PATH_SERVICES                       = "/etc/services"
	X_POSIX2_BC_BASE_MAX                  = 99
	X_POSIX2_BC_DIM_MAX                   = 2048
	X_POSIX2_BC_SCALE_MAX                 = 99
	X_POSIX2_BC_STRING_MAX                = 1000
	X_POSIX2_CHARCLASS_NAME_MAX           = 14
	X_POSIX2_CHAR_TERM                    = 200809
	X_POSIX2_COLL_WEIGHTS_MAX             = 2
	X_POSIX2_C_BIND                       = 200809
	X_POSIX2_C_DEV                        = 200809
	X_POSIX2_C_VERSION                    = 200809
	X_POSIX2_EXPR_NEST_MAX                = 32
	X_POSIX2_LINE_MAX                     = 2048
	X_POSIX2_LOCALEDEF                    = 200809
	X_POSIX2_RE_DUP_MAX                   = 255
	X_POSIX2_SW_DEV                       = 200809
	X_POSIX2_VERSION                      = 200809
	X_POSIX_ADVISORY_INFO                 = 200809
	X_POSIX_AIO_LISTIO_MAX                = 2
	X_POSIX_AIO_MAX                       = 1
	X_POSIX_ARG_MAX                       = 4096
	X_POSIX_ASYNCHRONOUS_IO               = 200809
	X_POSIX_ASYNC_IO                      = 1
	X_POSIX_BARRIERS                      = 200809
	X_POSIX_CHILD_MAX                     = 25
	X_POSIX_CHOWN_RESTRICTED              = 0
	X_POSIX_CLOCKRES_MIN                  = 20000000
	X_POSIX_CLOCK_SELECTION               = 200809
	X_POSIX_CPUTIME                       = 0
	X_POSIX_C_SOURCE                      = 200809
	X_POSIX_DELAYTIMER_MAX                = 32
	X_POSIX_FSYNC                         = 200809
	X_POSIX_HOST_NAME_MAX                 = 255
	X_POSIX_IPV6                          = 200809
	X_POSIX_JOB_CONTROL                   = 1
	X_POSIX_LINK_MAX                      = 8
	X_POSIX_LOGIN_NAME_MAX                = 9
	X_POSIX_MAPPED_FILES                  = 200809
	X_POSIX_MAX_CANON                     = 255
	X_POSIX_MAX_INPUT                     = 255
	X_POSIX_MEMLOCK                       = 200809
	X_POSIX_MEMLOCK_RANGE                 = 200809
	X_POSIX_MEMORY_PROTECTION             = 200809
	X_POSIX_MESSAGE_PASSING               = 200809
	X_POSIX_MONOTONIC_CLOCK               = 0
	X_POSIX_MQ_OPEN_MAX                   = 8
	X_POSIX_MQ_PRIO_MAX                   = 32
	X_POSIX_NAME_MAX                      = 14
	X_POSIX_NGROUPS_MAX                   = 8
	X_POSIX_NO_TRUNC                      = 1
	X_POSIX_OPEN_MAX                      = 20
	X_POSIX_PATH_MAX                      = 256
	X_POSIX_PIPE_BUF                      = 512
	X_POSIX_PRIORITIZED_IO                = 200809
	X_POSIX_PRIORITY_SCHEDULING           = 200809
	X_POSIX_RAW_SOCKETS                   = 200809
	X_POSIX_READER_WRITER_LOCKS           = 200809
	X_POSIX_REALTIME_SIGNALS              = 200809
	X_POSIX_REENTRANT_FUNCTIONS           = 1
	X_POSIX_REGEXP                        = 1
	X_POSIX_RE_DUP_MAX                    = 255
	X_POSIX_RTSIG_MAX                     = 8
	X_POSIX_SAVED_IDS                     = 1
	X_POSIX_SEMAPHORES                    = 200809
	X_POSIX_SEM_NSEMS_MAX                 = 256
	X_POSIX_SEM_VALUE_MAX                 = 32767
	X_POSIX_SHARED_MEMORY_OBJECTS         = 200809
	X_POSIX_SHELL                         = 1
	X_POSIX_SIGQUEUE_MAX                  = 32
	X_POSIX_SOURCE                        = 1
	X_POSIX_SPAWN                         = 200809
	X_POSIX_SPIN_LOCKS                    = 200809
	X_POSIX_SPORADIC_SERVER               = -1
	X_POSIX_SSIZE_MAX                     = 32767
	X_POSIX_STREAM_MAX                    = 8
	X_POSIX_SYMLINK_MAX                   = 255
	X_POSIX_SYMLOOP_MAX                   = 8
	X_POSIX_SYNCHRONIZED_IO               = 200809
	X_POSIX_THREADS                       = 200809
	X_POSIX_THREAD_ATTR_STACKADDR         = 200809
	X_POSIX_THREAD_ATTR_STACKSIZE         = 200809
	X_POSIX_THREAD_CPUTIME                = 0
	X_POSIX_THREAD_DESTRUCTOR_ITERATIONS  = 4
	X_POSIX_THREAD_KEYS_MAX               = 128
	X_POSIX_THREAD_PRIORITY_SCHEDULING    = 200809
	X_POSIX_THREAD_PRIO_INHERIT           = 200809
	X_POSIX_THREAD_PRIO_PROTECT           = 200809
	X_POSIX_THREAD_PROCESS_SHARED         = 200809
	X_POSIX_THREAD_ROBUST_PRIO_INHERIT    = 200809
	X_POSIX_THREAD_ROBUST_PRIO_PROTECT    = -1
	X_POSIX_THREAD_SAFE_FUNCTIONS         = 200809
	X_POSIX_THREAD_SPORADIC_SERVER        = -1
	X_POSIX_THREAD_THREADS_MAX            = 64
	X_POSIX_TIMEOUTS                      = 200809
	X_POSIX_TIMERS                        = 200809
	X_POSIX_TIMER_MAX                     = 32
	X_POSIX_TRACE                         = -1
	X_POSIX_TRACE_EVENT_FILTER            = -1
	X_POSIX_TRACE_INHERIT                 = -1
	X_POSIX_TRACE_LOG                     = -1
	X_POSIX_TTY_NAME_MAX                  = 9
	X_POSIX_TYPED_MEMORY_OBJECTS          = -1
	X_POSIX_TZNAME_MAX                    = 6
	X_POSIX_V6_LP64_OFF64                 = 1
	X_POSIX_V6_LPBIG_OFFBIG               = -1
	X_POSIX_V7_LP64_OFF64                 = 1
	X_POSIX_V7_LPBIG_OFFBIG               = -1
	X_POSIX_VDISABLE                      = 0
	X_POSIX_VERSION                       = 200809
	X_PTHREAD_H                           = 1
	X_PTRDIFF_T                           = 0
	X_PTRDIFF_T_                          = 0
	X_PTRDIFF_T_DECLARED                  = 0
	X_PWD_H                               = 1
	X_REENTRANT                           = 1
	X_RPC_NETDB_H                         = 1
	X_RWLOCK_INTERNAL_H                   = 0
	X_SCHED_H                             = 1
	X_SIGNAL_H                            = 0
	X_SIZET_                              = 0
	X_SIZE_T                              = 0
	X_SIZE_T_                             = 0
	X_SIZE_T_DECLARED                     = 0
	X_SIZE_T_DEFINED                      = 0
	X_SIZE_T_DEFINED_                     = 0
	X_SS_SIZE                             = 128
	X_STATBUF_ST_BLKSIZE                  = 0
	X_STATBUF_ST_NSEC                     = 0
	X_STATBUF_ST_RDEV                     = 0
	X_STAT_VER                            = 1
	X_STAT_VER_KERNEL                     = 0
	X_STAT_VER_LINUX                      = 1
	X_STDARG_H                            = 0
	X_STDC_PREDEF_H                       = 1
	X_STDDEF_H                            = 0
	X_STDDEF_H_                           = 0
	X_STDINT_H                            = 1
	X_STDIO_H                             = 1
	X_STDLIB_H                            = 1
	X_STRINGS_H                           = 1
	X_STRING_H                            = 1
	X_STRUCT_TIMESPEC                     = 1
	X_SYS_CDEFS_H                         = 1
	X_SYS_FILE_H                          = 1
	X_SYS_PARAM_H                         = 1
	X_SYS_SELECT_H                        = 1
	X_SYS_SIZE_T_H                        = 0
	X_SYS_SOCKET_H                        = 1
	X_SYS_STAT_H                          = 1
	X_SYS_TIME_H                          = 1
	X_SYS_TYPES_H                         = 1
	X_SYS_UCONTEXT_H                      = 1
	X_SYS_UTSNAME_H                       = 1
	X_SYS_WAIT_H                          = 1
	X_TCL                                 = 0
	X_TCLDECLS                            = 0
	X_TCLINT                              = 0
	X_TCLINTDECLS                         = 0
	X_TCLINTPLATDECLS                     = 0
	X_TCLPLATDECLS                        = 0
	X_TCLPORT                             = 0
	X_TCLTOMMATHDECLS                     = 0
	X_TCLUNIXPORT                         = 0
	X_THREAD_MUTEX_INTERNAL_H             = 1
	X_THREAD_SAFE                         = 1
	X_THREAD_SHARED_TYPES_H               = 1
	X_TIME_H                              = 1
	X_T_PTRDIFF                           = 0
	X_T_PTRDIFF_                          = 0
	X_T_SIZE                              = 0
	X_T_SIZE_                             = 0
	X_T_WCHAR                             = 0
	X_T_WCHAR_                            = 0
	X_UNISTD_H                            = 1
	X_UTIME_H                             = 1
	X_UTSNAME_DOMAIN_LENGTH               = 65
	X_UTSNAME_LENGTH                      = 65
	X_UTSNAME_MACHINE_LENGTH              = 65
	X_UTSNAME_NODENAME_LENGTH             = 65
	X_UTSNAME_RELEASE_LENGTH              = 65
	X_UTSNAME_SYSNAME_LENGTH              = 65
	X_UTSNAME_VERSION_LENGTH              = 65
	X_VA_LIST                             = 0
	X_VA_LIST_                            = 0
	X_VA_LIST_DEFINED                     = 0
	X_VA_LIST_T_H                         = 0
	X_WCHAR_T                             = 0
	X_WCHAR_T_                            = 0
	X_WCHAR_T_DECLARED                    = 0
	X_WCHAR_T_DEFINED                     = 0
	X_WCHAR_T_DEFINED_                    = 0
	X_WCHAR_T_H                           = 0
	X_XBS5_LP64_OFF64                     = 1
	X_XBS5_LPBIG_OFFBIG                   = -1
	X_XOPEN_ENH_I18N                      = 1
	X_XOPEN_LEGACY                        = 1
	X_XOPEN_REALTIME                      = 1
	X_XOPEN_REALTIME_THREADS              = 1
	X_XOPEN_SHM                           = 1
	X_XOPEN_UNIX                          = 1
	X_XOPEN_VERSION                       = 700
	X_XOPEN_XCU_VERSION                   = 4
	X_XOPEN_XPG2                          = 1
	X_XOPEN_XPG3                          = 1
	X_XOPEN_XPG4                          = 1
	Linux                                 = 1
	Unix                                  = 1
	FP_ILOGB0                             = -2147483648
	FP_ILOGBNAN                           = -2147483648
	FP_INFINITE1                          = 1
	FP_NAN1                               = 0
	FP_NORMAL1                            = 4
	FP_SUBNORMAL1                         = 3
	FP_ZERO1                              = 2
	MATH_ERREXCEPT                        = 2
	MATH_ERRNO                            = 1
	M_1_PI                                = 0.31830988618379067154
	M_2_PI                                = 0.63661977236758134308
	M_2_SQRTPI                            = 1.12837916709551257390
	M_E                                   = 2.7182818284590452354
	M_LN10                                = 2.30258509299404568402
	M_LN2                                 = 0.69314718055994530942
	M_LOG10E                              = 0.43429448190325182765
	M_LOG2E                               = 1.4426950408889634074
	M_PI                                  = 3.14159265358979323846
	M_PI_2                                = 1.57079632679489661923
	M_PI_4                                = 0.78539816339744830962
	M_SQRT1_2                             = 0.70710678118654752440
	M_SQRT2                               = 1.41421356237309504880
	X_BITS_LIBM_SIMD_DECL_STUBS_H         = 1
	X_MATH_H                              = 1
	Math_errhandling                      = 3
	ABSIZE                                = 10
	AHEAD                                 = 97
	BACKR                                 = 020
	BACKREF                               = 98
	BEHIND                                = 114
	BYTBITS                               = 8
	BYTMASK                               = 255
	BYTTAB                                = 256
	CAP                                   = 010
	CCLASS                                = 67
	CH                                    = -1
	CHRBITS                               = 16
	CHR_MAX                               = 0xFFFF
	CHR_MIN                               = 0x0000
	CMMAGIC                               = 0x876
	CNFA_NOPROGRESS                       = 01
	COLLEL                                = 73
	COLORLESS                             = -1
	COMPATIBLE                            = 3
	DIGIT                                 = 100
	DUPINF                                = 256
	DUPMAX                                = 255
	DUPTRAVERSE_MAX_DEPTH                 = 15000
	ECLASS                                = 69
	EMPTY                                 = 110
	END                                   = 88
	EOS                                   = 101
	FREECOL                               = 01
	FREESTATE                             = -1
	GUTSMAGIC                             = 0xFED9
	HASLACONS                             = 01
	INCOMPATIBLE                          = 1
	INF                                   = 3
	INUSE                                 = 0100
	LACON                                 = 76
	LONGER                                = 01
	L_BBND                                = 5
	L_BRACK                               = 6
	L_BRE                                 = 2
	L_CCL                                 = 9
	L_CEL                                 = 7
	L_EBND                                = 4
	L_ECL                                 = 8
	L_ERE                                 = 1
	L_Q                                   = 3
	MAX_COLOR                             = 32767
	MIXED                                 = 04
	NBYTS                                 = 2
	NOCELT                                = -1
	NOPROP                                = 03
	NOSUB                                 = -1
	NOTREACHED                            = 0
	NWBDRY                                = 87
	PLAIN                                 = 112
	PREFER                                = 80
	PSEUDO                                = 02
	RANGE                                 = 82
	REG_ADVANCED                          = 000003
	REG_ADVF                              = 000002
	REG_ASSERT                            = 15
	REG_ATOI                              = 101
	REG_BADBR                             = 10
	REG_BADOPT                            = 18
	REG_BADPAT                            = 2
	REG_BADRPT                            = 13
	REG_BASIC                             = 000000
	REG_BOSONLY                           = 002000
	REG_CANCEL                            = 777
	REG_DUMP                              = 004000
	REG_EBRACE                            = 9
	REG_EBRACK                            = 7
	REG_ECOLLATE                          = 3
	REG_ECOLORS                           = 20
	REG_ECTYPE                            = 4
	REG_EESCAPE                           = 5
	REG_EPAREN                            = 8
	REG_ERANGE                            = 11
	REG_ESPACE                            = 12
	REG_ESUBREG                           = 6
	REG_ETOOBIG                           = 19
	REG_EXPANDED                          = 000040
	REG_EXPECT                            = 001000
	REG_EXTENDED                          = 000001
	REG_FAKE                              = 010000
	REG_FTRACE                            = 0010
	REG_ICASE                             = 000010
	REG_INVARG                            = 16
	REG_ITOA                              = 102
	REG_MIXED                             = 17
	REG_MTRACE                            = 0020
	REG_NEWLINE                           = 000300
	REG_NLANCH                            = 000200
	REG_NLSTOP                            = 000100
	REG_NOMATCH                           = 1
	REG_NOSPEC                            = 4
	REG_NOSUB                             = 000020
	REG_NOTBOL                            = 0001
	REG_NOTEOL                            = 0002
	REG_OKAY                              = 0
	REG_PEND                              = 000400
	REG_PROGRESS                          = 020000
	REG_QUOTE                             = 000004
	REG_SMALL                             = 0040
	REG_STARTEND                          = 0004
	REG_UBACKREF                          = 000001
	REG_UBBS                              = 000100
	REG_UBOUNDS                           = 000004
	REG_UBRACES                           = 000010
	REG_UBSALNUM                          = 000020
	REG_UEMPTYMATCH                       = 004000
	REG_UIMPOSSIBLE                       = 010000
	REG_ULOCALE                           = 002000
	REG_ULOOKAHEAD                        = 000002
	REG_UNONPOSIX                         = 000200
	REG_UPBOTCH                           = 000040
	REG_USHORTEST                         = 020000
	REG_UUNPORT                           = 001000
	REG_UUNSPEC                           = 000400
	REMAGIC                               = 0xFED7
	SATISFIED                             = 2
	SBEGIN                                = 65
	SEND                                  = 90
	SHORTER                               = 02
	SOME                                  = 2
	WBDRY                                 = 119
	WHITE                                 = 0
	X_ASSERT_H                            = 1
	X_REGEX_H_                            = 0
	Xxx                                   = 1
	FEWCOLORS                             = 15
	FEWSTATES                             = 20
	LOCALDFAS                             = 40
	LOCALMAT                              = 20
	LOCKED                                = 04
	NOPROGRESS                            = 010
	POSTSTATE                             = 02
	STARTER                               = 01
	WORK                                  = 1
	CALL_CHAIN_STATIC_SIZE                = 4
	COMPILEENV_INIT_AUX_DATA_SIZE         = 5
	COMPILEENV_INIT_CMD_MAP_SIZE          = 40
	COMPILEENV_INIT_CODE_BYTES            = 250
	COMPILEENV_INIT_EXCEPT_RANGES         = 5
	COMPILEENV_INIT_NUM_OBJECTS           = 60
	CONSTRUCTOR                           = 0x08
	DESTRUCTOR                            = 0x10
	DESTRUCTOR_CALLED                     = 2
	DONT_DELETE                           = 0x20000
	FILTER_HANDLING                       = 0x2000
	FORCE_UNKNOWN                         = 0x10000
	INST_ADD                              = 53
	INST_APPEND_ARRAY1                    = 84
	INST_APPEND_ARRAY4                    = 85
	INST_APPEND_ARRAY_STK                 = 86
	INST_APPEND_SCALAR1                   = 82
	INST_APPEND_SCALAR4                   = 83
	INST_APPEND_STK                       = 87
	INST_ARRAY_EXISTS_IMM                 = 160
	INST_ARRAY_EXISTS_STK                 = 159
	INST_ARRAY_MAKE_IMM                   = 162
	INST_ARRAY_MAKE_STK                   = 161
	INST_BEGIN_CATCH4                     = 69
	INST_BITAND                           = 44
	INST_BITNOT                           = 60
	INST_BITOR                            = 42
	INST_BITXOR                           = 43
	INST_BREAK                            = 65
	INST_CALL_BUILTIN_FUNC1               = 62
	INST_CALL_FUNC1                       = 63
	INST_CLOCK_READ                       = 189
	INST_CONCAT_STK                       = 173
	INST_CONTINUE                         = 66
	INST_COROUTINE_NAME                   = 149
	INST_DICT_APPEND                      = 114
	INST_DICT_DONE                        = 118
	INST_DICT_EXISTS                      = 141
	INST_DICT_EXPAND                      = 138
	INST_DICT_FIRST                       = 116
	INST_DICT_GET                         = 110
	INST_DICT_INCR_IMM                    = 113
	INST_DICT_LAPPEND                     = 115
	INST_DICT_NEXT                        = 117
	INST_DICT_RECOMBINE_IMM               = 140
	INST_DICT_RECOMBINE_STK               = 139
	INST_DICT_SET                         = 111
	INST_DICT_UNSET                       = 112
	INST_DICT_UPDATE_END                  = 120
	INST_DICT_UPDATE_START                = 119
	INST_DICT_VERIFY                      = 142
	INST_DIV                              = 56
	INST_DONE                             = 0
	INST_DUP                              = 4
	INST_END_CATCH                        = 70
	INST_EQ                               = 45
	INST_EVAL_STK                         = 8
	INST_EXIST_ARRAY                      = 129
	INST_EXIST_ARRAY_STK                  = 130
	INST_EXIST_SCALAR                     = 128
	INST_EXIST_STK                        = 131
	INST_EXPAND_DROP                      = 165
	INST_EXPAND_START                     = 100
	INST_EXPAND_STKTOP                    = 101
	INST_EXPON                            = 99
	INST_EXPR_STK                         = 9
	INST_FOREACH_END                      = 168
	INST_FOREACH_START                    = 166
	INST_FOREACH_START4                   = 67
	INST_FOREACH_STEP                     = 167
	INST_FOREACH_STEP4                    = 68
	INST_GE                               = 50
	INST_GT                               = 48
	INST_INCR_ARRAY1                      = 26
	INST_INCR_ARRAY1_IMM                  = 31
	INST_INCR_ARRAY_STK                   = 27
	INST_INCR_ARRAY_STK_IMM               = 32
	INST_INCR_SCALAR1                     = 24
	INST_INCR_SCALAR1_IMM                 = 29
	INST_INCR_SCALAR_STK                  = 25
	INST_INCR_SCALAR_STK_IMM              = 30
	INST_INCR_STK                         = 28
	INST_INCR_STK_IMM                     = 33
	INST_INFO_LEVEL_ARGS                  = 153
	INST_INFO_LEVEL_NUM                   = 152
	INST_INVOKE_EXPANDED                  = 102
	INST_INVOKE_REPLACE                   = 163
	INST_INVOKE_STK1                      = 6
	INST_INVOKE_STK4                      = 7
	INST_JUMP1                            = 34
	INST_JUMP4                            = 35
	INST_JUMP_FALSE1                      = 38
	INST_JUMP_FALSE4                      = 39
	INST_JUMP_TABLE                       = 121
	INST_JUMP_TRUE1                       = 36
	INST_JUMP_TRUE4                       = 37
	INST_LAND                             = 41
	INST_LAPPEND_ARRAY1                   = 90
	INST_LAPPEND_ARRAY4                   = 91
	INST_LAPPEND_ARRAY_STK                = 92
	INST_LAPPEND_LIST                     = 185
	INST_LAPPEND_LIST_ARRAY               = 186
	INST_LAPPEND_LIST_ARRAY_STK           = 187
	INST_LAPPEND_LIST_STK                 = 188
	INST_LAPPEND_SCALAR1                  = 88
	INST_LAPPEND_SCALAR4                  = 89
	INST_LAPPEND_STK                      = 93
	INST_LE                               = 49
	INST_LIST                             = 79
	INST_LIST_CONCAT                      = 164
	INST_LIST_IN                          = 106
	INST_LIST_INDEX                       = 80
	INST_LIST_INDEX_IMM                   = 103
	INST_LIST_INDEX_MULTI                 = 94
	INST_LIST_LENGTH                      = 81
	INST_LIST_NOT_IN                      = 107
	INST_LIST_RANGE_IMM                   = 104
	INST_LMAP_COLLECT                     = 169
	INST_LNOT                             = 61
	INST_LOAD_ARRAY1                      = 13
	INST_LOAD_ARRAY4                      = 14
	INST_LOAD_ARRAY_STK                   = 15
	INST_LOAD_SCALAR1                     = 10
	INST_LOAD_SCALAR4                     = 11
	INST_LOAD_SCALAR_STK                  = 12
	INST_LOAD_STK                         = 16
	INST_LOR                              = 40
	INST_LSET_FLAT                        = 97
	INST_LSET_LIST                        = 96
	INST_LSHIFT                           = 51
	INST_LT                               = 47
	INST_MOD                              = 57
	INST_MULT                             = 55
	INST_NEQ                              = 46
	INST_NOP                              = 132
	INST_NSUPVAR                          = 123
	INST_NS_CURRENT                       = 151
	INST_NUM_TYPE                         = 182
	INST_ORIGIN_COMMAND                   = 178
	INST_OVER                             = 95
	INST_POP                              = 3
	INST_PUSH1                            = 1
	INST_PUSH4                            = 2
	INST_PUSH_RESULT                      = 71
	INST_PUSH_RETURN_CODE                 = 72
	INST_PUSH_RETURN_OPTIONS              = 108
	INST_REGEXP                           = 127
	INST_RESOLVE_COMMAND                  = 154
	INST_RETURN_CODE_BRANCH               = 133
	INST_RETURN_IMM                       = 98
	INST_RETURN_STK                       = 109
	INST_REVERSE                          = 126
	INST_RSHIFT                           = 52
	INST_START_CMD                        = 105
	INST_STORE_ARRAY1                     = 20
	INST_STORE_ARRAY4                     = 21
	INST_STORE_ARRAY_STK                  = 22
	INST_STORE_SCALAR1                    = 17
	INST_STORE_SCALAR4                    = 18
	INST_STORE_SCALAR_STK                 = 19
	INST_STORE_STK                        = 23
	INST_STR_CLASS                        = 184
	INST_STR_CMP                          = 75
	INST_STR_CONCAT1                      = 5
	INST_STR_EQ                           = 73
	INST_STR_FIND                         = 144
	INST_STR_FIND_LAST                    = 145
	INST_STR_INDEX                        = 77
	INST_STR_LEN                          = 76
	INST_STR_LOWER                        = 175
	INST_STR_MAP                          = 143
	INST_STR_MATCH                        = 78
	INST_STR_NEQ                          = 74
	INST_STR_RANGE                        = 147
	INST_STR_RANGE_IMM                    = 146
	INST_STR_REPLACE                      = 177
	INST_STR_TITLE                        = 176
	INST_STR_TRIM                         = 170
	INST_STR_TRIM_LEFT                    = 171
	INST_STR_TRIM_RIGHT                   = 172
	INST_STR_UPPER                        = 174
	INST_SUB                              = 54
	INST_SYNTAX                           = 125
	INST_TAILCALL                         = 150
	INST_TCLOO_CLASS                      = 156
	INST_TCLOO_IS_OBJECT                  = 158
	INST_TCLOO_NEXT                       = 179
	INST_TCLOO_NEXT_CLASS                 = 180
	INST_TCLOO_NS                         = 157
	INST_TCLOO_SELF                       = 155
	INST_TRY_CVT_TO_BOOLEAN               = 183
	INST_TRY_CVT_TO_NUMERIC               = 64
	INST_UMINUS                           = 59
	INST_UNSET_ARRAY                      = 135
	INST_UNSET_ARRAY_STK                  = 136
	INST_UNSET_SCALAR                     = 134
	INST_UNSET_STK                        = 137
	INST_UPLUS                            = 58
	INST_UPVAR                            = 122
	INST_VARIABLE                         = 124
	INST_YIELD                            = 148
	INST_YIELD_TO_INVOKE                  = 181
	JUMPFIXUP_INIT_ENTRIES                = 10
	LAST_INST_OPCODE                      = 189
	LITERAL_CMD_NAME                      = 0x02
	LITERAL_ON_HEAP                       = 0x01
	LITERAL_UNSHARED                      = 0x04
	MAX_INSTRUCTION_OPERANDS              = 2
	OBJECT_DESTRUCTING                    = 1
	OO_UNKNOWN_METHOD                     = 0x04
	OO_UNUSED_4                           = 4
	PRIVATE_METHOD                        = 0x02
	PUBLIC_METHOD                         = 0x01
	ROOT_CLASS                            = 0x8000
	ROOT_OBJECT                           = 0x1000
	TCLOO_H_INCLUDED                      = 0
	TCLOO_PROCEDURE_METHOD_VERSION        = 0
	TCLOO_VERSION                         = "1.1.0"
	TCL_BYTECODE_PRECOMPILED              = 0x0001
	TCL_BYTECODE_RECOMPILE                = 0x0004
	TCL_BYTECODE_RESOLVE_VARS             = 0x0002
	TCL_NO_ELEMENT                        = 2
	TCL_NO_LARGE_INDEX                    = 1
	TCL_OO_INTERNAL_H                     = 1
	TCL_OO_METADATA_VERSION_CURRENT       = 1
	TCL_OO_METHOD_VERSION_CURRENT         = 1
	USE_CLASS_CACHE                       = 0x4000
	USE_DECLARER_NS                       = 0x80
	X_TCLCOMPILATION                      = 1
	X_TCLOODECLS                          = 0
	X_TCLOOINTDECLS                       = 0
	CMD_IS_SAFE                           = 1
	COROUTINE_ARGUMENTS_ARBITRARY         = -2
	COROUTINE_ARGUMENTS_SINGLE_OPTIONAL   = -1
	CORO_STACK_INITIAL_SIZE               = 200
	IEEE_FLOATING_POINT                   = 0
	INTERP_STACK_INITIAL_SIZE             = 2000
	MATH_FUNC_PREFIX_LEN                  = 17
	MATH_OP_PREFIX_LEN                    = 15
	MAX_EXACT                             = 9007199254740991.0
	RAND_IA                               = 16807
	RAND_IM                               = 2147483647
	RAND_IQ                               = 127773
	RAND_IR                               = 2836
	RAND_MASK                             = 123459876
	BINARY_ALL                            = -1
	BINARY_NOCOUNT                        = -2
	BINARY_SCAN_MAX_CACHE                 = 260
	BINARY_SIGNED                         = 0
	BINARY_UNSIGNED                       = 1
	FALSE                                 = 0
	TRUE                                  = 1
	FOUR_CENTURIES                        = 146097
	FOUR_YEARS                            = 1461
	JDAY_1_JAN_1_CE_GREGORIAN             = 1721426
	JDAY_1_JAN_1_CE_JULIAN                = 1721424
	JULIAN_DAY_POSIX_EPOCH                = 2440588
	ONE_CENTURY_GREGORIAN                 = 36524
	ONE_YEAR                              = 365
	SECONDS_PER_DAY                       = 86400
	TCL_CLOCK_PREFIX_LEN                  = 14
	LC_ADDRESS                            = 9
	LC_ADDRESS_MASK                       = 512
	LC_ALL                                = 6
	LC_ALL_MASK                           = 8127
	LC_COLLATE                            = 3
	LC_COLLATE_MASK                       = 8
	LC_CTYPE                              = 0
	LC_CTYPE_MASK                         = 1
	LC_IDENTIFICATION                     = 12
	LC_IDENTIFICATION_MASK                = 4096
	LC_MEASUREMENT                        = 11
	LC_MEASUREMENT_MASK                   = 2048
	LC_MESSAGES                           = 5
	LC_MESSAGES_MASK                      = 32
	LC_MONETARY                           = 4
	LC_MONETARY_MASK                      = 16
	LC_NAME                               = 8
	LC_NAME_MASK                          = 256
	LC_NUMERIC                            = 1
	LC_NUMERIC_MASK                       = 2
	LC_PAPER                              = 7
	LC_PAPER_MASK                         = 128
	LC_TELEPHONE                          = 10
	LC_TELEPHONE_MASK                     = 1024
	LC_TIME                               = 2
	LC_TIME_MASK                          = 4
	X_BITS_LOCALE_H                       = 1
	X_LOCALE_H                            = 1
	MAXCALLOC                             = 1024000
	NUM_LISTS                             = 30
	SORTMODE_ASCII                        = 0
	SORTMODE_ASCII_NC                     = 8
	SORTMODE_COMMAND                      = 3
	SORTMODE_DICTIONARY                   = 4
	SORTMODE_INTEGER                      = 1
	SORTMODE_REAL                         = 2
	X_TCLREGEXP                           = 0
	CONCAT_TRIM_SET                       = " \f\v\r\t\n"
	TCL_STRING_TRIM_H                     = 0
	AND                                   = 84
	BAREWORD                              = 3
	BINARY                                = 0x40
	BINARY_MINUS                          = 66
	BINARY_PLUS                           = 65
	BIT_AND                               = 73
	BIT_NOT                               = 135
	BIT_OR                                = 75
	BIT_XOR                               = 74
	BOOLEAN                               = 195
	BRACED                                = 196
	CLOSE_PAREN                           = 91
	COLON                                 = 77
	COMMA                                 = 67
	DIVIDE                                = 69
	EQUAL                                 = 82
	EXPON                                 = 88
	FUNCTION                              = 131
	GEQ                                   = 81
	GREATER                               = 72
	INCOMPLETE                            = 4
	INVALID                               = 5
	IN_LIST                               = 89
	LEAF                                  = 0xC0
	LEFT_SHIFT                            = 78
	LEQ                                   = 80
	LESS                                  = 71
	MINUS                                 = 2
	MOD                                   = 70
	MULT                                  = 68
	NEQ                                   = 83
	NODE_TYPE                             = 0xC0
	NOT                                   = 134
	NOT_IN_LIST                           = 90
	NUMBER                                = 193
	OPEN_PAREN                            = 133
	OR                                    = 85
	PLUS                                  = 1
	QUESTION                              = 76
	QUOTED                                = 198
	RIGHT_SHIFT                           = 79
	SCRIPT                                = 194
	START                                 = 132
	STREQ                                 = 86
	STRNEQ                                = 87
	UNARY                                 = 0x80
	UNARY_MINUS                           = 130
	UNARY_PLUS                            = 129
	VARIABLE                              = 197
	NUM_STATIC_POS                        = 20
	ASSOC_KEY                             = "tclPackageAboutDict"
	END_OF_TIME                           = 2037
	EPOCH                                 = 1970
	SECSPERDAY                            = 86400
	START_OF_TIME                         = 1902
	TM_YEAR_BASE                          = 1900
	YYBISON                               = 1
	YYBISON_VERSION                       = "3.1"
	YYCOPY_NEEDED                         = 1
	YYDEBUG                               = 0
	YYEMPTY                               = -2
	YYEOF                                 = 0
	YYERRCODE                             = 256
	YYERROR_VERBOSE                       = 0
	YYFINAL                               = 2
	YYINITDEPTH                           = 200
	YYLAST                                = 81
	YYLTYPE_IS_DECLARED                   = 1
	YYLTYPE_IS_TRIVIAL                    = 1
	YYMAXDEPTH                            = 10000
	YYMAXUTOK                             = 274
	YYNNTS                                = 16
	YYNRULES                              = 56
	YYNSTATES                             = 85
	YYNTOKENS                             = 26
	YYPACT_NINF                           = -18
	YYPULL                                = 1
	YYPURE                                = 1
	YYPUSH                                = 0
	YYSKELETON_NAME                       = "yacc.c"
	YYSTYPE_IS_DECLARED                   = 1
	YYSTYPE_IS_TRIVIAL                    = 1
	YYTABLE_NINF                          = -1
	YYTERROR                              = 1
	YYTOKENTYPE                           = 0
	YYUNDEFTOK                            = 2
	YY_NULLPTR                            = 0
	LOCAL_SIZE                            = 64
	ENCODING_DOUBLEBYTE                   = 1
	ENCODING_ESCAPE                       = 3
	ENCODING_MULTIBYTE                    = 2
	ENCODING_SINGLEBYTE                   = 0
	ASYNC_CHECK_COUNT_MASK                = 63
	LAST_BUILTIN_FUNC                     = 25
	TCL_SUPPORT_84_BYTECODE               = 1
	X_TCLFILESYSTEM                       = 0
	NUM_COUNTERS                          = 10
	REBUILD_MULTIPLIER                    = 3
	HISTORY_OBJS_KEY                      = "::tcl::HistoryObjs"
	BG_FLUSH_SCHEDULED                    = 128
	BUFFER_PADDING                        = 16
	CHANNELBUFFER_DEFAULT_SIZE            = 4096
	CHANNEL_BLOCKED                       = 2048
	CHANNEL_CLOSED                        = 256
	CHANNEL_CLOSEDWRITE                   = 2097152
	CHANNEL_DEAD                          = 8192
	CHANNEL_EOF                           = 512
	CHANNEL_INCLOSE                       = 524288
	CHANNEL_LINEBUFFERED                  = 16
	CHANNEL_NEED_MORE_DATA                = 16384
	CHANNEL_NONBLOCKING                   = 8
	CHANNEL_RAW_MODE                      = 65536
	CHANNEL_STICKY_EOF                    = 1024
	CHANNEL_UNBUFFERED                    = 32
	ENCODING_LINESIZE                     = 20
	INPUT_SAW_CR                          = 4096
	MAX_CHANNEL_BUFFER_SIZE               = 1048576
	SYNTHETIC_EVENT_TIME                  = 0
	UTF_EXPANSION_FACTOR                  = 1024
	CHANNEL_ASYNC                         = 1
	FLUSH_DELAY                           = 5
	INCREMENT                             = 512
	P_NO_PRESERVE                         = 0
	P_PRESERVE                            = 1
	TRANSMIT_DONT                         = 0
	TRANSMIT_DOWN                         = 1
	TRANSMIT_IBUF                         = 3
	TRANSMIT_NUM                          = 4
	TRANSMIT_SELF                         = 2
	EOK                                   = 0
	RANDW                                 = 6
	RCMKEY                                = "ReflectedChannelMap"
	FLUSH_DISCARD                         = 0
	FLUSH_WRITE                           = 1
	RB_INCREMENT                          = 512
	RTMKEY                                = "ReflectedTransformMap"
	RW_MODES                              = 3
	NUM_SPACES                            = 20
	LIMIT_HANDLER_ACTIVE                  = 0x01
	LIMIT_HANDLER_DELETED                 = 0x02
	LINK_BEING_UPDATED                    = 2
	LINK_READ_ONLY                        = 1
	DEFAULT_PRIMARY_PROMPT                = "% "
	ALLOC_CHUNK                           = 8
	BUILDING_MIXINS                       = 0x400000
	DEFINITE_PROTECTED                    = 0x100000
	DEFINITE_PUBLIC                       = 0x200000
	KNOWN_STATE                           = 3145728
	NO_IMPLEMENTATION                     = 2
	OBJECT_MIXIN                          = 0x1000000
	SPECIAL                               = 65560
	TRAVERSED_MIXIN                       = 0x800000
	OBJNAME_LENGTH_IN_ERRORINFO_LIMIT     = 30
	PUBLIC_PATTERN                        = "[a-z]*"
	LIMIT                                 = 60
	TclOOUnusedStubEntry                  = 0
	TYPE_BRACE                            = 0x40
	TYPE_CLOSE_BRACK                      = 0x20
	TYPE_CLOSE_PAREN                      = 0x10
	TYPE_COMMAND_END                      = 0x2
	TYPE_NORMAL                           = 0
	TYPE_QUOTE                            = 0x8
	TYPE_SPACE                            = 0x1
	TYPE_SUBS                             = 0x4
	TCLPATH_APPENDED                      = 1
	TCLPATH_NEEDNORM                      = 4
	CFG_64                                = "0"
	CFG_COMPILE_DEBUG                     = "0"
	CFG_COMPILE_STATS                     = "0"
	CFG_DEBUG                             = "0"
	CFG_INSTALL_BINDIR                    = "/usr/local/bin"
	CFG_INSTALL_DOCDIR                    = "/usr/local/man"
	CFG_INSTALL_INCDIR                    = "/usr/local/include"
	CFG_INSTALL_LIBDIR                    = "/usr/local/lib"
	CFG_INSTALL_SCRDIR                    = "/usr/local/lib/tcl8.6"
	CFG_MEMDEBUG                          = "0"
	CFG_OPTIMIZED                         = "1"
	CFG_PROFILED                          = "0"
	CFG_RUNTIME_BINDIR                    = "/usr/local/bin"
	CFG_RUNTIME_DLLFILE                   = "libtcl8.6.a"
	CFG_RUNTIME_DOCDIR                    = "/usr/local/man"
	CFG_RUNTIME_INCDIR                    = "/usr/local/include"
	CFG_RUNTIME_LIBDIR                    = "/usr/local/lib"
	CFG_RUNTIME_SCRDIR                    = "/usr/local/lib/tcl8.6"
	CFG_RUNTIME_ZIPFILE                   = ""
	CFG_THREADED                          = "1"
	INITIAL_SIZE                          = 2
	JOE_EXTENSION                         = 0
	NUM_REGEXPS                           = 30
	TCL_REG_GLOBOK_FLAGS                  = 27
	SCAN_BIG                              = 0x800
	SCAN_LONGER                           = 0x400
	SCAN_NOSKIP                           = 0x1
	SCAN_SUPPRESS                         = 0x2
	SCAN_UNSIGNED                         = 0x4
	SCAN_WIDTH                            = 0x8
	BLETCH                                = 0x10
	DIGIT_GROUP                           = 8
	EXPONENT_BIAS                         = 0x3FF
	EXP_MASK                              = 0x7FF00000
	EXP_SHIFT                             = 20
	FP_PRECISION                          = 53
	HI_ORDER_SIG_MASK                     = 0x000FFFFF
	LOG10_2                               = 0.3010299956639812
	LOG10_3HALVES_PLUS_FUDGE              = 0.1760912590558
	MAXPOW                                = 22
	NAN_START                             = 0x7FF8
	N_BIGTENS                             = 5
	N_LOG2POW5                            = 27
	QUICK_MAX                             = 14
	SIGN_BIT                              = 0x80000000
	TEN_PMAX                              = 22
	TWO_OVER_3LOG10                       = 0.28952965460216784
	COMPAT                                = 0
	MAX_FLOAT_SIZE                        = 320
	TclUnusedStubEntry                    = 0
	MAGIC                                 = 0xEF
	NOBJALLOC                             = 800
	NOBJHIGH                              = 1200
	RCHECK                                = 0
	SLEEP_OFFLOAD_GETTIMEOFDAY            = 20
	TCL_TIME_MAXIMUM_SLICE                = 500
	TCL_TRACE_ANY_EXEC                    = 15
	TCL_TRACE_ENTER_DURING_EXEC           = 4
	TCL_TRACE_EXEC_DIRECT                 = 0x20
	TCL_TRACE_EXEC_IN_PROGRESS            = 0x10
	TCL_TRACE_LEAVE_DURING_EXEC           = 8
	B0                                    = 0000000
	B1000000                              = 0010010
	B110                                  = 0000003
	B115200                               = 0010002
	B1152000                              = 0010011
	B1200                                 = 0000011
	B134                                  = 0000004
	B150                                  = 0000005
	B1500000                              = 0010012
	B1800                                 = 0000012
	B19200                                = 0000016
	B200                                  = 0000006
	B2000000                              = 0010013
	B230400                               = 0010003
	B2400                                 = 0000013
	B2500000                              = 0010014
	B300                                  = 0000007
	B3000000                              = 0010015
	B3500000                              = 0010016
	B38400                                = 0000017
	B4000000                              = 0010017
	B460800                               = 0010004
	B4800                                 = 0000014
	B50                                   = 0000001
	B500000                               = 0010005
	B57600                                = 0010001
	B576000                               = 0010006
	B600                                  = 0000010
	B75                                   = 0000002
	B921600                               = 0010007
	B9600                                 = 0000015
	BRKINT                                = 0000002
	BS0                                   = 0000000
	BS1                                   = 0020000
	BSDLY                                 = 0020000
	CBAUD                                 = 000000010017
	CBAUDEX                               = 000000010000
	CBRK                                  = 0
	CDISCARD                              = 15
	CDSUSP                                = 25
	CEOF                                  = 4
	CEOL                                  = 0
	CEOT                                  = 4
	CERASE                                = 0177
	CFLUSH                                = 15
	CIBAUD                                = 002003600000
	CINTR                                 = 3
	CKILL                                 = 21
	CLNEXT                                = 22
	CLOCAL                                = 0004000
	CMIN                                  = 1
	CMSPAR                                = 010000000000
	CQUIT                                 = 034
	CR0                                   = 0000000
	CR1                                   = 0001000
	CR2                                   = 0002000
	CR3                                   = 0003000
	CRDLY                                 = 0003000
	CREAD                                 = 0000200
	CREPRINT                              = 18
	CRPRNT                                = 18
	CRTSCTS                               = 020000000000
	CS5                                   = 0000000
	CS6                                   = 0000020
	CS7                                   = 0000040
	CS8                                   = 0000060
	CSIZE                                 = 0000060
	CSTART                                = 17
	CSTATUS                               = 0
	CSTOP                                 = 19
	CSTOPB                                = 0000100
	CSUSP                                 = 26
	CTIME                                 = 0
	CWERASE                               = 23
	ECHO                                  = 0000010
	ECHOCTL                               = 0001000
	ECHOE                                 = 0000020
	ECHOK                                 = 0000040
	ECHOKE                                = 0004000
	ECHONL                                = 0000100
	ECHOPRT                               = 0002000
	EXTA                                  = 14
	EXTB                                  = 15
	EXTPROC                               = 0200000
	FF0                                   = 0000000
	FF1                                   = 0100000
	FFDLY                                 = 0100000
	FIOASYNC                              = 0x5452
	FIOCLEX                               = 0x5451
	FIONBIO                               = 0x5421
	FIONCLEX                              = 0x5450
	FIONREAD                              = 0x541B
	FIOQSIZE                              = 0x5460
	FLUSHO                                = 0010000
	HUPCL                                 = 0002000
	ICANON                                = 0000002
	ICRNL                                 = 0000400
	IEXTEN                                = 0100000
	IGNBRK                                = 0000001
	IGNCR                                 = 0000200
	IGNPAR                                = 0000004
	IMAXBEL                               = 0020000
	INLCR                                 = 0000100
	INPCK                                 = 0000020
	IOCSIZE_MASK                          = 1073676288
	IOCSIZE_SHIFT                         = 16
	IOC_IN                                = 1073741824
	IOC_INOUT                             = 3221225472
	IOC_OUT                               = 2147483648
	ISIG                                  = 0000001
	ISTRIP                                = 0000040
	IUCLC                                 = 0001000
	IUTF8                                 = 0040000
	IXANY                                 = 0004000
	IXOFF                                 = 0010000
	IXON                                  = 0002000
	NCC                                   = 8
	NCCS                                  = 32
	NL0                                   = 0000000
	NL1                                   = 0000400
	NLDLY                                 = 0000400
	NOFLSH                                = 0000200
	N_6PACK                               = 7
	N_AX25                                = 5
	N_HCI                                 = 15
	N_HDLC                                = 13
	N_IRDA                                = 11
	N_MASC                                = 8
	N_MOUSE                               = 2
	N_PPP                                 = 3
	N_PROFIBUS_FDL                        = 10
	N_R3964                               = 9
	N_SLIP                                = 1
	N_SMSBLOCK                            = 12
	N_STRIP                               = 4
	N_SYNC_PPP                            = 14
	N_TTY                                 = 0
	N_X25                                 = 6
	OCRNL                                 = 0000010
	OFDEL                                 = 0000200
	OFILL                                 = 0000100
	OLCUC                                 = 0000002
	ONLCR                                 = 0000004
	ONLRET                                = 0000040
	ONOCR                                 = 0000020
	OPOST                                 = 0000001
	PARENB                                = 0000400
	PAREXT                                = 1073741824
	PARMRK                                = 0000010
	PARODD                                = 0001000
	PENDIN                                = 0040000
	SIOCADDDLCI                           = 0x8980
	SIOCADDMULTI                          = 0x8931
	SIOCADDRT                             = 0x890B
	SIOCDARP                              = 0x8953
	SIOCDELDLCI                           = 0x8981
	SIOCDELMULTI                          = 0x8932
	SIOCDELRT                             = 0x890C
	SIOCDEVPRIVATE                        = 0x89F0
	SIOCDIFADDR                           = 0x8936
	SIOCDRARP                             = 0x8960
	SIOCGARP                              = 0x8954
	SIOCGIFADDR                           = 0x8915
	SIOCGIFBR                             = 0x8940
	SIOCGIFBRDADDR                        = 0x8919
	SIOCGIFCONF                           = 0x8912
	SIOCGIFCOUNT                          = 0x8938
	SIOCGIFDSTADDR                        = 0x8917
	SIOCGIFENCAP                          = 0x8925
	SIOCGIFFLAGS                          = 0x8913
	SIOCGIFHWADDR                         = 0x8927
	SIOCGIFINDEX                          = 0x8933
	SIOCGIFMAP                            = 0x8970
	SIOCGIFMEM                            = 0x891f
	SIOCGIFMETRIC                         = 0x891d
	SIOCGIFMTU                            = 0x8921
	SIOCGIFNAME                           = 0x8910
	SIOCGIFNETMASK                        = 0x891b
	SIOCGIFPFLAGS                         = 0x8935
	SIOCGIFSLAVE                          = 0x8929
	SIOCGIFTXQLEN                         = 0x8942
	SIOCGRARP                             = 0x8961
	SIOCPROTOPRIVATE                      = 0x89E0
	SIOCRTMSG                             = 0x890D
	SIOCSARP                              = 0x8955
	SIOCSIFADDR                           = 0x8916
	SIOCSIFBR                             = 0x8941
	SIOCSIFBRDADDR                        = 0x891a
	SIOCSIFDSTADDR                        = 0x8918
	SIOCSIFENCAP                          = 0x8926
	SIOCSIFFLAGS                          = 0x8914
	SIOCSIFHWADDR                         = 0x8924
	SIOCSIFHWBROADCAST                    = 0x8937
	SIOCSIFLINK                           = 0x8911
	SIOCSIFMAP                            = 0x8971
	SIOCSIFMEM                            = 0x8920
	SIOCSIFMETRIC                         = 0x891e
	SIOCSIFMTU                            = 0x8922
	SIOCSIFNAME                           = 0x8923
	SIOCSIFNETMASK                        = 0x891c
	SIOCSIFPFLAGS                         = 0x8934
	SIOCSIFSLAVE                          = 0x8930
	SIOCSIFTXQLEN                         = 0x8943
	SIOCSRARP                             = 0x8962
	SIOGIFINDEX                           = 35123
	SUPPORTS_TTY                          = 1
	TAB0                                  = 0000000
	TAB1                                  = 0004000
	TAB2                                  = 0010000
	TAB3                                  = 0014000
	TABDLY                                = 0014000
	TCFLSH                                = 0x540B
	TCGETA                                = 0x5405
	TCGETS                                = 0x5401
	TCGETX                                = 0x5432
	TCIFLUSH                              = 0
	TCIOFF                                = 2
	TCIOFLUSH                             = 2
	TCION                                 = 3
	TCOFLUSH                              = 1
	TCOOFF                                = 0
	TCOON                                 = 1
	TCSADRAIN                             = 1
	TCSAFLUSH                             = 2
	TCSANOW                               = 0
	TCSBRK                                = 0x5409
	TCSBRKP                               = 0x5425
	TCSETA                                = 0x5406
	TCSETAF                               = 0x5408
	TCSETAW                               = 0x5407
	TCSETS                                = 0x5402
	TCSETSF                               = 0x5404
	TCSETSW                               = 0x5403
	TCSETX                                = 0x5433
	TCSETXF                               = 0x5434
	TCSETXW                               = 0x5435
	TCXONC                                = 0x540A
	TIOCCBRK                              = 0x5428
	TIOCCONS                              = 0x541D
	TIOCEXCL                              = 0x540C
	TIOCGETD                              = 0x5424
	TIOCGICOUNT                           = 0x545D
	TIOCGLCKTRMIOS                        = 0x5456
	TIOCGPGRP                             = 0x540F
	TIOCGPTPEER                           = 21569
	TIOCGRS485                            = 0x542E
	TIOCGSERIAL                           = 0x541E
	TIOCGSID                              = 0x5429
	TIOCGSOFTCAR                          = 0x5419
	TIOCGWINSZ                            = 0x5413
	TIOCINQ                               = 21531
	TIOCLINUX                             = 0x541C
	TIOCMBIC                              = 0x5417
	TIOCMBIS                              = 0x5416
	TIOCMGET                              = 0x5415
	TIOCMIWAIT                            = 0x545C
	TIOCMSET                              = 0x5418
	TIOCM_CAR                             = 0x040
	TIOCM_CD                              = 64
	TIOCM_CTS                             = 0x020
	TIOCM_DSR                             = 0x100
	TIOCM_DTR                             = 0x002
	TIOCM_LE                              = 0x001
	TIOCM_RI                              = 128
	TIOCM_RNG                             = 0x080
	TIOCM_RTS                             = 0x004
	TIOCM_SR                              = 0x010
	TIOCM_ST                              = 0x008
	TIOCNOTTY                             = 0x5422
	TIOCNXCL                              = 0x540D
	TIOCOUTQ                              = 0x5411
	TIOCPKT                               = 0x5420
	TIOCPKT_DATA                          = 0
	TIOCPKT_DOSTOP                        = 32
	TIOCPKT_FLUSHREAD                     = 1
	TIOCPKT_FLUSHWRITE                    = 2
	TIOCPKT_IOCTL                         = 64
	TIOCPKT_NOSTOP                        = 16
	TIOCPKT_START                         = 8
	TIOCPKT_STOP                          = 4
	TIOCSBRK                              = 0x5427
	TIOCSCTTY                             = 0x540E
	TIOCSERCONFIG                         = 0x5453
	TIOCSERGETLSR                         = 0x5459
	TIOCSERGETMULTI                       = 0x545A
	TIOCSERGSTRUCT                        = 0x5458
	TIOCSERGWILD                          = 0x5454
	TIOCSERSETMULTI                       = 0x545B
	TIOCSERSWILD                          = 0x5455
	TIOCSER_TEMT                          = 0x01
	TIOCSETD                              = 0x5423
	TIOCSLCKTRMIOS                        = 0x5457
	TIOCSPGRP                             = 0x5410
	TIOCSRS485                            = 0x542F
	TIOCSSERIAL                           = 0x541F
	TIOCSSOFTCAR                          = 0x541A
	TIOCSTI                               = 0x5412
	TIOCSWINSZ                            = 0x5414
	TIOCVHANGUP                           = 0x5437
	TOSTOP                                = 0000400
	TTYDEF_CFLAG                          = 1440
	TTYDEF_IFLAG                          = 11554
	TTYDEF_LFLAG                          = 35355
	TTYDEF_OFLAG                          = 6149
	TTYDEF_SPEED                          = 13
	VDISCARD                              = 13
	VEOF                                  = 4
	VEOL                                  = 11
	VEOL2                                 = 16
	VERASE                                = 2
	VINTR                                 = 0
	VKILL                                 = 3
	VLNEXT                                = 15
	VMIN                                  = 6
	VQUIT                                 = 1
	VREPRINT                              = 12
	VSTART                                = 8
	VSTOP                                 = 9
	VSUSP                                 = 10
	VSWTC                                 = 7
	VT0                                   = 0000000
	VT1                                   = 0040000
	VTDLY                                 = 0040000
	VTIME                                 = 5
	VWERASE                               = 14
	XCASE                                 = 0000004
	XTABS                                 = 0014000
	X_ASM_GENERIC_IOCTL_H                 = 0
	X_HAVE_STRUCT_TERMIOS_C_ISPEED        = 1
	X_HAVE_STRUCT_TERMIOS_C_OSPEED        = 1
	X_IOC_DIRBITS                         = 2
	X_IOC_DIRMASK                         = 3
	X_IOC_DIRSHIFT                        = 30
	X_IOC_NONE                            = 0
	X_IOC_NRBITS                          = 8
	X_IOC_NRMASK                          = 255
	X_IOC_NRSHIFT                         = 0
	X_IOC_READ                            = 2
	X_IOC_SIZEBITS                        = 14
	X_IOC_SIZEMASK                        = 16383
	X_IOC_SIZESHIFT                       = 16
	X_IOC_TYPEBITS                        = 8
	X_IOC_TYPEMASK                        = 255
	X_IOC_TYPESHIFT                       = 8
	X_IOC_WRITE                           = 1
	X_LINUX_IOCTL_H                       = 0
	X_SYS_IOCTL_H                         = 1
	X_SYS_TTYDEFAULTS_H_                  = 0
	X_TERMIOS_H                           = 1
	NEED_GR_CLEANER                       = 1
	NEED_PW_CLEANER                       = 1
	BINMODE                               = 0
	DEFAULT_COPY_BLOCK_SIZE               = 4096
	DOTREE_F                              = 3
	DOTREE_POSTD                          = 2
	DOTREE_PRED                           = 1
	FTS_AGAIN                             = 1
	FTS_COMFOLLOW                         = 0x0001
	FTS_D                                 = 1
	FTS_DC                                = 2
	FTS_DEFAULT                           = 3
	FTS_DNR                               = 4
	FTS_DONTCHDIR                         = 0x01
	FTS_DOT                               = 5
	FTS_DP                                = 6
	FTS_ERR                               = 7
	FTS_F                                 = 8
	FTS_FOLLOW                            = 2
	FTS_INIT                              = 9
	FTS_LOGICAL                           = 0x0002
	FTS_NAMEONLY                          = 0x0100
	FTS_NOCHDIR                           = 0x0004
	FTS_NOINSTR                           = 3
	FTS_NOSTAT                            = 0x0008
	FTS_NS                                = 10
	FTS_NSOK                              = 11
	FTS_OPTIONMASK                        = 0x00ff
	FTS_PHYSICAL                          = 0x0010
	FTS_ROOTLEVEL                         = 0
	FTS_ROOTPARENTLEVEL                   = -1
	FTS_SEEDOT                            = 0x0020
	FTS_SKIP                              = 4
	FTS_SL                                = 12
	FTS_SLNONE                            = 13
	FTS_STOP                              = 0x0200
	FTS_SYMFOLLOW                         = 0x02
	FTS_W                                 = 14
	FTS_WHITEOUT                          = 0x0080
	FTS_XDEV                              = 0x0040
	MAX_READDIR_UNLINK_THRESHOLD          = 130
	TCL_TEMPORARY_FILE_DIRECTORY          = "/tmp"
	X_FTS_H                               = 1
	HaveRealpath                          = 1
	NoFtsStat                             = 0
	LIBRARY_SIZE                          = 32
	NL_CAT_LOCALE                         = 1
	NL_SETD                               = 1
	PRIO_MAX                              = 20
	PRIO_MIN                              = -20
	RLIM64_INFINITY                       = 0xffffffffffffffff
	RLIM_INFINITY                         = 0xffffffffffffffff
	RLIM_SAVED_CUR                        = 18446744073709551615
	RLIM_SAVED_MAX                        = 18446744073709551615
	TCL_DEFAULT_ENCODING                  = "iso8859-1"
	TCL_LIBRARY                           = "/usr/local/lib/tcl8.6"
	TCL_PACKAGE_PATH                      = "{/usr/local/lib} "
	X_LANGINFO_H                          = 1
	X_NL_TYPES_H                          = 1
	X_SYS_RESOURCE_H                      = 1
	AT_FORK_INIT_VALUE                    = 0
	POLL_DONE                             = 0x2
	POLL_WANT                             = 0x1
	RESET_ATFORK_MUTEX                    = 1
	SOCKET_BUFSIZE                        = 4096
	SOCK_TEMPLATE                         = "sock%lx"
	SUPPRESS_RDNS_VAR                     = "::tcl::unsupported::noReverseDNS"
	TCP_ASYNC_CONNECT                     = 2
	TCP_ASYNC_FAILED                      = 32
	TCP_ASYNC_PENDING                     = 16
	TCP_NONBLOCKING                       = 1
	LINE_LENGTH                           = 128
	OFFSET_BITS                           = 5
	UNICODE_SELF                          = 0x80
	CONVERT_ANY                           = 16
	CONVERT_BRACE                         = 2
	CONVERT_ESCAPE                        = 4
	CONVERT_MASK                          = 6
	CONVERT_NONE                          = 0
	ASYNC                                 = 0x01
	BUFFER_SIZE_LIMIT                     = 0xFFFF
	DEFAULT_BUFFER_SIZE                   = 4096
	DICT_TO_SET                           = 0x1
	FAR                                   = 0
	IN_HEADER                             = 0x02
	MAX_BUFFER_SIZE                       = 65536
	MAX_COMMENT_LEN                       = 256
	MAX_MEM_LEVEL                         = 9
	MAX_WBITS                             = 15
	MIN_NONSTREAM_BUFFER_SIZE             = 16
	OUT_HEADER                            = 0x04
	STDC                                  = 0
	STDC99                                = 0
	STREAM_DECOMPRESS                     = 0x08
	STREAM_DONE                           = 0x10
	TCL_ZLIB_VERSION                      = "2.0.1"
	WBITS_AUTODETECT                      = 47
	WBITS_GZIP                            = 31
	WBITS_RAW                             = -15
	WBITS_ZLIB                            = 15
	ZCONF_H                               = 0
	ZEXPORT                               = 0
	ZEXPORTVA                             = 0
	ZLIB_H                                = 0
	ZLIB_VERNUM                           = 0x12b0
	ZLIB_VERSION                          = "1.2.11"
	ZLIB_VER_MAJOR                        = 1
	ZLIB_VER_MINOR                        = 2
	ZLIB_VER_REVISION                     = 11
	ZLIB_VER_SUBREVISION                  = 0
	Z_ASCII                               = 1
	Z_BEST_COMPRESSION                    = 9
	Z_BEST_SPEED                          = 1
	Z_BINARY                              = 0
	Z_BLOCK                               = 5
	Z_BUF_ERROR                           = -5
	Z_DATA_ERROR                          = -3
	Z_DEFAULT_COMPRESSION                 = -1
	Z_DEFAULT_STRATEGY                    = 0
	Z_DEFLATED                            = 8
	Z_ERRNO                               = -1
	Z_FILTERED                            = 1
	Z_FINISH                              = 4
	Z_FIXED                               = 4
	Z_FULL_FLUSH                          = 3
	Z_HAVE_STDARG_H                       = 0
	Z_HAVE_UNISTD_H                       = 0
	Z_HUFFMAN_ONLY                        = 2
	Z_LARGE64                             = 0
	Z_LFS64                               = 0
	Z_MEM_ERROR                           = -4
	Z_NEED_DICT                           = 2
	Z_NO_COMPRESSION                      = 0
	Z_NO_FLUSH                            = 0
	Z_NULL                                = 0
	Z_OK                                  = 0
	Z_PARTIAL_FLUSH                       = 1
	Z_RLE                                 = 3
	Z_STREAM_END                          = 1
	Z_STREAM_ERROR                        = -2
	Z_SYNC_FLUSH                          = 2
	Z_TEXT                                = 1
	Z_TREES                               = 6
	Z_UNKNOWN                             = 2
	Z_VERSION_ERROR                       = -6
	Z_WANT64                              = 0
	Z_const                               = 0
)

// Positions to pass to Tcl_QueueEvent:

const ( /* tcl.h:1402:1: */
	TCL_QUEUE_TAIL = 0
	TCL_QUEUE_HEAD = 1
	TCL_QUEUE_MARK = 2
)

// The following flags determine whether the blockModeProc above should set
// the channel into blocking or nonblocking mode. They are passed as arguments
// to the blockModeProc function in the above structure.

//----------------------------------------------------------------------------
// Enum for different types of file paths.

const ( /* tcl.h:1624:1: */
	TCL_PATH_ABSOLUTE        = 0
	TCL_PATH_RELATIVE        = 1
	TCL_PATH_VOLUME_RELATIVE = 2
)

//----------------------------------------------------------------------------
// When a TCL command returns, the interpreter contains a result from the
// command. Programmers are strongly encouraged to use one of the functions
// Tcl_GetObjResult() or Tcl_GetStringResult() to read the interpreter's
// result. See the SetResult man page for details. Besides this result, the
// command function returns an integer code, which is one of the following:
//
// TCL_OK		Command completed normally; the interpreter's result
//			contains the command's result.
// TCL_ERROR		The command couldn't be completed successfully; the
//			interpreter's result describes what went wrong.
// TCL_RETURN		The command requests that the current function return;
//			the interpreter's result contains the function's
//			return value.
// TCL_BREAK		The command requests that the innermost loop be
//			exited; the interpreter's result is meaningless.
// TCL_CONTINUE		Go on to the next iteration of the current loop; the
//			interpreter's result is meaningless.

//----------------------------------------------------------------------------
// Flags to control what substitutions are performed by Tcl_SubstObj():

// Argument descriptors for math function callbacks in expressions:

const ( /* tcl.h:705:1: */
	TCL_INT      = 0
	TCL_DOUBLE   = 1
	TCL_EITHER   = 2
	TCL_WIDE_INT = 3
)

// Flags that pertain to a basic block.

const ( /* tclAssembly.c:112:1: */
	BB_VISITED = 1 // Block has been visited in the current
	// traversal
	BB_FALLTHRU = 2 // Control may pass from this block to a
	// successor
	BB_JUMP1 = 4 // Basic block ends with a 1-byte-offset jump
	// and may need expansion
	BB_JUMPTABLE  = 8  // Basic block ends with a jump table
	BB_BEGINCATCH = 16 // Block ends with a 'beginCatch' instruction,
	// marking it as the start of a 'catch'
	// sequence. The 'jumpTarget' is the exception
	// exit from the catch block.
	BB_ENDCATCH = 32
)

// Source instruction type recognized by the assembler.

const ( /* tclAssembly.c:133:1: */
	ASSEM_1BYTE       = 0 // Fixed arity, 1-byte instruction
	ASSEM_BEGIN_CATCH = 1 // Begin catch: one 4-byte jump offset to be
	// converted to appropriate exception
	// ranges
	ASSEM_BOOL       = 2 // One Boolean operand
	ASSEM_BOOL_LVT4  = 3 // One Boolean, one 4-byte LVT ref.
	ASSEM_CLOCK_READ = 4 // 1-byte unsigned-integer case number, in the
	// range 0-3
	ASSEM_CONCAT1 = 5 // 1-byte unsigned-integer operand count, must
	// be strictly positive, consumes N, produces
	// 1
	ASSEM_DICT_GET = 6 // 'dict get' and related - consumes N+1
	// operands, produces 1, N > 0
	ASSEM_DICT_SET = 7 // specifies key count and LVT index, consumes
	// N+1 operands, produces 1, N > 0
	ASSEM_DICT_UNSET = 8 // specifies key count and LVT index, consumes
	// N operands, produces 1, N > 0
	ASSEM_END_CATCH = 9 // End catch. No args. Exception range popped
	// from stack and stack pointer restored.
	ASSEM_EVAL = 10 // 'eval' - evaluate a constant script (by
	// compiling it in line with the assembly
	// code! I love Tcl!)
	ASSEM_INDEX  = 11 // 4 byte operand, integer or end-integer
	ASSEM_INVOKE = 12 // 1- or 4-byte operand count, must be
	// strictly positive, consumes N, produces
	// 1.
	ASSEM_JUMP      = 13 // Jump instructions
	ASSEM_JUMP4     = 14 // Jump instructions forcing a 4-byte offset
	ASSEM_JUMPTABLE = 15 // Jumptable (switch -exact)
	ASSEM_LABEL     = 16 // The assembly directive that defines a
	// label
	ASSEM_LINDEX_MULTI = 17 // 4-byte operand count, must be strictly
	// positive, consumes N, produces 1
	ASSEM_LIST = 18 // 4-byte operand count, must be nonnegative,
	// consumses N, produces 1
	ASSEM_LSET_FLAT = 19 // 4-byte operand count, must be >= 3,
	// consumes N, produces 1
	ASSEM_LVT = 20 // One operand that references a local
	// variable
	ASSEM_LVT1 = 21 // One 1-byte operand that references a local
	// variable
	ASSEM_LVT1_SINT1 = 22 // One 1-byte operand that references a local
	// variable, one signed-integer 1-byte
	// operand
	ASSEM_LVT4 = 23 // One 4-byte operand that references a local
	// variable
	ASSEM_OVER = 24 // OVER: 4-byte operand count, consumes N+1,
	// produces N+2
	ASSEM_PUSH   = 25 // one literal operand
	ASSEM_REGEXP = 26 // One Boolean operand, but weird mapping to
	// call flags
	ASSEM_REVERSE = 27 // REVERSE: 4-byte operand count, consumes N,
	// produces N
	ASSEM_SINT1 = 28 // One 1-byte signed-integer operand
	// (INCR_STK_IMM)
	ASSEM_SINT4_LVT4 = 29
)

// State identified for a basic block's catch context.

const ( /* tclAssembly.c:49:1: */
	BBCS_UNKNOWN = 0 // Catch context has not yet been identified
	BBCS_NONE    = 1 // Block is outside of any catch
	BBCS_INCATCH = 2 // Block is within a catch context
	BBCS_CAUGHT  = 3
)

// Enumeration of the string literals used in [clock]

const ( /* tclClock.c:58:1: */
	LIT__NIL                        = 0
	LIT__DEFAULT_FORMAT             = 1
	LIT_BCE                         = 2
	LIT_C                           = 3
	LIT_CANNOT_USE_GMT_AND_TIMEZONE = 4
	LIT_CE                          = 5
	LIT_DAYOFMONTH                  = 6
	LIT_DAYOFWEEK                   = 7
	LIT_DAYOFYEAR                   = 8
	LIT_ERA                         = 9
	LIT_GMT                         = 10
	LIT_GREGORIAN                   = 11
	LIT_INTEGER_VALUE_TOO_LARGE     = 12
	LIT_ISO8601WEEK                 = 13
	LIT_ISO8601YEAR                 = 14
	LIT_JULIANDAY                   = 15
	LIT_LOCALSECONDS                = 16
	LIT_MONTH                       = 17
	LIT_SECONDS                     = 18
	LIT_TZNAME                      = 19
	LIT_TZOFFSET                    = 20
	LIT_YEAR                        = 21
	LIT__END                        = 22
)

// Readable macros to test whether a "pointer" value points to an operator.
// They operate on the "non-negative integer -> operator; negative integer ->
// a non-operator OperandType" distinction.

// Note that it is sufficient to store in the tree just the type of leaf
// operand, without any explicit pointer to which leaf. This is true because
// the traversals of the completed tree we perform are known to visit the
// leaves in the same order as the original parse.
//
// In a completed parse tree, those OpNodes that are themselves (roots of
// subexpression trees that are) operands of some operator store in their
// p.parent field a "pointer" to the OpNode of that operator. The p.parent
// field permits a traversal of the tree within a non-recursive routine
// (ConvertTreeToTokens() and CompileExprTree()). This means that even
// expression trees of great depth pose no risk of blowing the C stack.
//
// While the parse tree is being constructed, the same memory space is used to
// hold the p.prev field which chains together a stack of incomplete trees
// awaiting their right operands.
//
// The lexeme field is filled in with the lexeme of the operator that is
// returned by the ParseLexeme() routine. Only lexemes for unary and binary
// operators get stored in an OpNode. Other lexmes get different treatement.
//
// The precedence field provides a place to store the precedence of the
// operator, so it need not be looked up again and again.
//
// The mark field is use to control the traversal of the tree, so that it can
// be done non-recursively. The mark values are:

const ( /* tclCompExpr.c:108:1: */
	MARK_LEFT   = 0 // Next step of traversal is to visit left subtree
	MARK_RIGHT  = 1 // Next step of traversal is to visit right subtree
	MARK_PARENT = 2
)

// The constant field is a boolean flag marking which subexpressions are
// completely known at compile time, and are eligible for computing then
// rather than waiting until run time.

// Each lexeme belongs to one of four categories, which determine its place in
// the parse tree. We use the two high bits of the (unsigned char) value to
// store a NODE_TYPE code.

// The four category values are LEAF, UNARY, and BINARY, explained below, and
// "uncategorized", which is used either temporarily, until context determines
// which of the other three categories is correct, or for lexemes like
// INVALID, which aren't really lexemes at all, but indicators of a parsing
// error. Note that the codes must be distinct to distinguish categories, but
// need not take the form of a bit array.

// Uncategorized lexemes

// Leaf lexemes

// For literal numbers
// Script substitution; [foo]
// For literal booleans
// Braced string; {foo bar}
// Variable substitution; $x
// Quoted string; "foo $bar [soom]"
// Used only for an empty argument list to a
// function. Represents the empty string
// within parens in the expression: rand()

// Unary operator lexemes

// This is a bit of "creative interpretation"
// on the part of the parser. A function call
// is parsed into the parse tree according to
// the perspective that the function name is a
// unary operator and its argument list,
// enclosed in parens, is its operand. The
// additional requirements not implied
// generally by treatment as a unary operator
// -- for example, the requirement that the
// operand be enclosed in parens -- are hard
// coded in the relevant portions of
// ParseExpr(). We trade off the need to
// include such exceptional handling in the
// code against the need we would otherwise
// have for more lexeme categories.
// This lexeme isn't parsed from the
// expression text at all. It represents the
// start of the expression and sits at the
// root of the parse tree where it serves as
// the start/end point of traversals.
// Another bit of creative interpretation,
// where we treat "(" as a unary operator with
// the sub-expression between it and its
// matching ")" as its operand. See
// CLOSE_PAREN below.

// Binary operator lexemes

// The "," operator is a low precedence binary
// operator that separates the arguments in a
// function call. The additional constraint
// that this operator can only legally appear
// at the right places within a function call
// argument list are hard coded within
// ParseExpr().
// These two lexemes make up the
// ternary conditional operator, $x ? $y : $z.
// We treat them as two binary operators to
// avoid another lexeme category, and code the
// additional constraints directly in
// ParseExpr(). For instance, the right
// operand of a "?" operator must be a ":"
// operator.
// Unlike the other binary operators, EXPON is
// right associative and this distinction is
// coded directly in ParseExpr().
// By categorizing the CLOSE_PAREN lexeme as a
// BINARY operator, the normal parsing rules
// for binary operators assure that a close
// paren will not directly follow another
// operator, and the machinery already in
// place to connect operands to operators
// according to precedence performs most of
// the work of matching open and close parens
// for us. In the end though, a close paren is
// not really a binary operator, and some
// special coding in ParseExpr() make sure we
// never put an actual CLOSE_PAREN node in the
// parse tree. The sub-expression between
// parens becomes the single argument of the
// matching OPEN_PAREN unary operator.
// This lexeme represents the end of the
// string being parsed. Treating it as a
// binary operator follows the same logic as
// the CLOSE_PAREN lexeme and END pairs with
// START, in the same way that CLOSE_PAREN
// pairs with OPEN_PAREN.

// When ParseExpr() builds the parse tree it must choose which operands to
// connect to which operators.  This is done according to operator precedence.
// The greater an operator's precedence the greater claim it has to link to an
// available operand.  The Precedence enumeration lists the precedence values
// used by Tcl expression operators, from lowest to highest claim.  Each
// precedence level is commented with the operators that hold that precedence.

const ( /* tclCompExpr.c:301:1: */
	PREC_END         = 1  // END
	PREC_START       = 2  // START
	PREC_CLOSE_PAREN = 3  // ")"
	PREC_OPEN_PAREN  = 4  // "("
	PREC_COMMA       = 5  // ","
	PREC_CONDITIONAL = 6  // "?", ":"
	PREC_OR          = 7  // "||"
	PREC_AND         = 8  // "&&"
	PREC_BIT_OR      = 9  // "|"
	PREC_BIT_XOR     = 10 // "^"
	PREC_BIT_AND     = 11 // "&"
	PREC_EQUAL       = 12 // "==", "!=", "eq", "ne", "in", "ni"
	PREC_COMPARE     = 13 // "<", ">", "<=", ">="
	PREC_SHIFT       = 14 // "<<", ">>"
	PREC_ADD         = 15 // "+", "-"
	PREC_MULT        = 16 // "*", "/", "%"
	PREC_EXPON       = 17 // "**"
	PREC_UNARY       = 18
)

// The storage for the tree is dynamically allocated array of OpNodes. The
// array is grown as parsing needs dictate according to a scheme similar to
// Tcl's string growth algorithm, so that the resizing costs are O(N) and so
// that we use at least half the memory allocated as expressions get large.
//
// Each OpNode in the tree represents an operator in the expression, either
// unary or binary. When parsing is completed successfully, a binary operator
// OpNode will have its left and right fields filled with "pointers" to its
// left and right operands. A unary operator OpNode will have its right field
// filled with a pointer to its single operand. When an operand is a
// subexpression the "pointer" takes the form of the index -- a non-negative
// integer -- into the OpNode storage array where the root of that
// subexpression parse tree is found.
//
// Non-operator elements of the expression do not get stored in the OpNode
// tree. They are stored in the other structures according to their type.
// Literal values get appended to the literal list. Elements that denote forms
// of quoting or substitution known to the Tcl parser get stored as
// Tcl_Tokens. These non-operator elements of the expression are the leaves of
// the completed parse tree. When an operand of an OpNode is one of these leaf
// elements, the following negative integer codes are used to indicate which
// kind of elements it is.

const ( /* tclCompExpr.c:63:1: */
	OT_LITERAL = -3 // Operand is a literal in the literal list
	OT_TOKENS  = -2 // Operand is sequence of Tcl_Tokens
	OT_EMPTY   = -1
)

//------------------------------------------------------------------------
// Data structures related to compilation.
//------------------------------------------------------------------------

// The structure used to implement Tcl "exceptions" (exceptional returns): for
// example, those generated in loops by the break and continue commands, and
// those generated by scripts and caught by the catch command. This
// ExceptionRange structure describes a range of code (e.g., a loop body), the
// kind of exceptions (e.g., a break or continue) that might occur, and the PC
// offsets to jump to if a matching exception does occur. Exception ranges can
// nest so this structure includes a nesting level that is used at runtime to
// find the closest exception range surrounding a PC. For example, when a
// break command is executed, the ExceptionRange structure for the most deeply
// nested loop, if any, is found and used. These structures are also generated
// for the "next" subcommands of for loops since a break there terminates the
// for command. This means a for command actually generates two LoopInfo
// structures.

const ( /* tclCompile.h:81:1: */
	LOOP_EXCEPTION_RANGE = 0 // Exception's range is part of a loop. Break
	// and continue "exceptions" cause jumps to
	// appropriate PC offsets.
	CATCH_EXCEPTION_RANGE = 1
)

// Opcodes for the Tcl bytecode instructions. These must correspond to the
// entries in the table of instruction descriptions, tclInstructionTable, in
// tclCompile.c. Also, the order and number of the expression opcodes (e.g.,
// INST_LOR) must match the entries in the array operatorStrings in
// tclExecute.c.

// Opcodes 0 to 9

// Opcodes 10 to 23

// Opcodes 24 to 33

// Opcodes 34 to 39

// Opcodes 40 to 64

// Opcodes 65 to 66

// Opcodes 67 to 68

// Opcodes 69 to 72

// Opcodes 73 to 78

// Opcodes 78 to 81

// Opcodes 82 to 87

// Opcodes 88 to 93

// TIP #22 - LINDEX operator with flat arg list

// TIP #33 - 'lset' command. Code gen also required a Forth-like
//	     OVER operation.

// TIP#90 - 'return' command.

// TIP#123 - exponentiation operator.

// TIP #157 - {*}... (word expansion) language syntax support.

// TIP #57 - 'lassign' command. Code generation requires immediate
//	     LINDEX and LRANGE operators.

// Dictionary (TIP#111) related commands.

// Instruction to support jumps defined by tables (instead of the classic
// [switch] technique of chained comparisons).

// Instructions to support compilation of global, variable, upvar and
// [namespace upvar].

// Instruction to support compiling syntax error to bytecode

// Instruction to reverse N items on top of stack

// regexp instruction

// For [info exists] compilation

// For [subst] compilation

// For [unset] compilation

// For [dict with], [dict exists], [dict create] and [dict merge]

// For [string map] and [regsub] compilation

// For operations to do with coroutines and other NRE-manipulators

// For compilation of basic information operations

// For compilation relating to TclOO

// For compilation of [array] subcommands

// New foreach implementation

// For compilation of [string trim] and related

// The last opcode

// Table describing the Tcl bytecode instructions: their name (for displaying
// code), total number of code bytes required (including operand bytes), and a
// description of the type of each operand. These operand types include signed
// and unsigned integers of length one and four bytes. The unsigned integers
// are used for indexes or for, e.g., the count of objects to push in a "push"
// instruction.

const ( /* tclCompile.h:840:1: */
	OPERAND_NONE  = 0
	OPERAND_INT1  = 1 // One byte signed integer.
	OPERAND_INT4  = 2 // Four byte signed integer.
	OPERAND_UINT1 = 3 // One byte unsigned integer.
	OPERAND_UINT4 = 4 // Four byte unsigned integer.
	OPERAND_IDX4  = 5 // Four byte signed index (actually an
	// integer, but displayed differently.)
	OPERAND_LVT1 = 6 // One byte unsigned index into the local
	// variable table.
	OPERAND_LVT4 = 7 // Four byte unsigned index into the local
	// variable table.
	OPERAND_AUX4 = 8 // Four byte unsigned index into the aux data
	// table.
	OPERAND_OFFSET1 = 9  // One byte signed jump offset.
	OPERAND_OFFSET4 = 10 // Four byte signed jump offset.
	OPERAND_LIT1    = 11 // One byte unsigned index into table of
	// literals.
	OPERAND_LIT4 = 12 // Four byte unsigned index into table of
	// literals.
	OPERAND_SCLS1 = 13
)

// Constants used by INST_STRING_CLASS to indicate character classes. These
// correspond closely by name with what [string is] can support, but there is
// no requirement to keep the values the same.

const ( /* tclCompile.h:884:1: */
	STR_CLASS_ALNUM   = 0 // Unicode alphabet or digit characters.
	STR_CLASS_ALPHA   = 1 // Unicode alphabet characters.
	STR_CLASS_ASCII   = 2 // Characters in range U+000000..U+00007F.
	STR_CLASS_CONTROL = 3 // Unicode control characters.
	STR_CLASS_DIGIT   = 4 // Unicode digit characters.
	STR_CLASS_GRAPH   = 5 // Unicode printing characters, excluding
	// space.
	STR_CLASS_LOWER = 6 // Unicode lower-case alphabet characters.
	STR_CLASS_PRINT = 7 // Unicode printing characters, including
	// spaces.
	STR_CLASS_PUNCT = 8  // Unicode punctuation characters.
	STR_CLASS_SPACE = 9  // Unicode space characters.
	STR_CLASS_UPPER = 10 // Unicode upper-case alphabet characters.
	STR_CLASS_WORD  = 11 // Unicode word (alphabetic, digit, connector
	// punctuation) characters.
	STR_CLASS_XDIGIT = 12
)

// Compilation of some Tcl constructs such as if commands and the logical or
// (||) and logical and (&&) operators in expressions requires the generation
// of forward jumps. Since the PC target of these jumps isn't known when the
// jumps are emitted, we record the offset of each jump in an array of
// JumpFixup structures. There is one array for each sequence of jumps to one
// target PC. When we learn the target PC, we update the jumps with the
// correct distance. Also, if the distance is too great (> 127 bytes), we
// replace the single-byte jump with a four byte jump instruction, move the
// instructions after the jump down, and update the code offsets for any
// commands between the jump and the target.

const ( /* tclCompile.h:925:1: */
	TCL_UNCONDITIONAL_JUMP = 0
	TCL_TRUE_JUMP          = 1
	TCL_FALSE_JUMP         = 2
) // Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Bison generates several labels that happen to be unused. MS Visual C++
// doesn't like that, and complains. Tell it to shut up.

// Meridian: am, pm, or 24-hour style.

const ( /* tclDate.c:101:1: */
	MERam = 0
	MERpm = 1
	MER24 = 2
)

// Daylight-savings mode: on, off, or not yet known.

const ( /* tclDate.c:206:1: */
	DSTon    = 0
	DSToff   = 1
	DSTmaybe = 2
)

// Enabling verbose error messages.

// Debug traces.

// Token type.
const ( /* tclDate.c:241:3: */
	TAGO        = 258
	TDAY        = 259
	TDAYZONE    = 260
	TID         = 261
	TMERIDIAN   = 262
	TMONTH      = 263
	TMONTH_UNIT = 264
	TSTARDATE   = 265
	TSEC_UNIT   = 266
	TSNUMBER    = 267
	TUNUMBER    = 268
	TZONE       = 269
	TEPOCH      = 270
	TDST        = 271
	TISOBASE    = 272
	TDAY_UNIT   = 273
	TNEXT       = 274
)
const ( /* tclEnsemble.c:53:1: */
	ENS_CONFIG = 0
	ENS_CREATE = 1
	ENS_EXISTS = 2
)
const ( /* tclEnsemble.c:61:1: */
	CRT_CMD     = 0
	CRT_MAP     = 1
	CRT_PARAM   = 2
	CRT_PREFIX  = 3
	CRT_SUBCMDS = 4
	CRT_UNKNOWN = 5
)
const ( /* tclEnsemble.c:69:1: */
	CONF_MAP       = 0
	CONF_NAMESPACE = 1
	CONF_PARAM     = 2
	CONF_PREFIX    = 3
	CONF_SUBCMDS   = 4
	CONF_UNKNOWN   = 5
)
const ( /* tclIORChan.c:157:1: */
	EVENT_READ  = 0
	EVENT_WRITE = 1
)
const ( /* tclIORChan.c:178:1: */
	METH_BLOCKING  = 0
	METH_CGET      = 1
	METH_CGETALL   = 2
	METH_CONFIGURE = 3
	METH_READ      = 6
	METH_SEEK      = 7
	METH_WATCH     = 8
)

// Thread specific types and structures.
//
// We are here essentially creating a very specific implementation of 'thread
// send'.

// Enumeration of all operations which can be forwarded.

const ( /* tclIORChan.c:217:1: */
	ForwardedSeek      = 3
	ForwardedWatch     = 4
	ForwardedBlock     = 5
	ForwardedSetOpt    = 6
	ForwardedGetOpt    = 7
	ForwardedGetOptAll = 8
)
const ( /* tclIORTrans.c:200:1: */
	METH_CLEAR = 0
	METH_DRAIN = 1
	METH_FLUSH = 3
	METH_LIMIT = 5
)

// Thread specific types and structures.
//
// We are here essentially creating a very specific implementation of 'thread
// send'.

// Enumeration of all operations which can be forwarded.

const ( /* tclIORTrans.c:233:1: */
	ForwardedClear = 0
	ForwardedDrain = 2
	ForwardedFlush = 3
	ForwardedLimit = 5
)

// TIP #268.
// Values for the selection mode, i.e the package require preferences.

const ( /* tclInt.h:1736:1: */
	PKG_PREFER_LATEST = 0
	PKG_PREFER_STABLE = 1
)

// Macros that use the TSD-ekeko.

// Macros for script cancellation support (TIP #285).

// Macros for splicing into and out of doubly linked lists. They assume
// existence of struct items 'prevPtr' and 'nextPtr'.
//
// a = element to add or remove.
// b = list head.
//
// TclSpliceIn adds to the head of the list.

// EvalFlag bits for Interp structures:
//
// TCL_ALLOW_EXCEPTIONS	1 means it's OK for the script to terminate with a
//			code other than TCL_OK or TCL_ERROR; 0 means codes
//			other than these should be turned into errors.

// Flag bits for Interp structures:
//
// DELETED:		Non-zero means the interpreter has been deleted:
//			don't process any more commands for it, and destroy
//			the structure as soon as all nested invocations of
//			Tcl_Eval are done.
// ERR_ALREADY_LOGGED:	Non-zero means information has already been logged in
//			iPtr->errorInfo for the current Tcl_Eval instance, so
//			Tcl_Eval needn't log it (used to implement the "error
//			message log" command).
// DONT_COMPILE_CMDS_INLINE: Non-zero means that the bytecode compiler should
//			not compile any commands into an inline sequence of
//			instructions. This is set 1, for example, when command
//			traces are requested.
// RAND_SEED_INITIALIZED: Non-zero means that the randSeed value of the interp
//			has not be initialized. This is set 1 when we first
//			use the rand() or srand() functions.
// SAFE_INTERP:		Non zero means that the current interp is a safe
//			interp (i.e. it has only the safe commands installed,
//			less privilege than a regular interp).
// INTERP_DEBUG_FRAME:	Used for switching on various extra interpreter
//			debug/info mechanisms (e.g. info frame eval/uplevel
//			tracing) which are performance intensive.
// INTERP_TRACE_IN_PROGRESS: Non-zero means that an interp trace is currently
//			active; so no further trace callbacks should be
//			invoked.
// INTERP_ALTERNATE_WRONG_ARGS: Used for listing second and subsequent forms
//			of the wrong-num-args string in Tcl_WrongNumArgs.
//			Makes it append instead of replacing and uses
//			different intermediate text.
// CANCELED:		Non-zero means that the script in progress should be
//			canceled as soon as possible. This can be checked by
//			extensions (and the core itself) by calling
//			Tcl_Canceled and checking if TCL_ERROR is returned.
//			This is a one-shot flag that is reset immediately upon
//			being detected; however, if the TCL_CANCEL_UNWIND flag
//			is set Tcl_Canceled will continue to report that the
//			script in progress has been canceled thereby allowing
//			the evaluation stack for the interp to be fully
//			unwound.
//
// WARNING: For the sake of some extensions that have made use of former
// internal values, do not re-use the flag values 2 (formerly ERR_IN_PROGRESS)
// or 8 (formerly ERROR_CODE_SET).

// Maximum number of levels of nesting permitted in Tcl commands (used to
// catch infinite recursion).

// The macro below is used to modify a "char" value (e.g. by casting it to an
// unsigned character) so that it can be used safely with macros such as
// isspace.

// This macro is used to properly align the memory allocated by Tcl, giving
// the same alignment as the native malloc.

// This macro is used to determine the offset needed to safely allocate any
// data structure in memory. Given a starting offset or size, it "rounds up"
// or "aligns" the offset to the next 8-byte boundary so that any data
// structure can be placed at the resulting offset without fear of an
// alignment error.
//
// WARNING!! DO NOT USE THIS MACRO TO ALIGN POINTERS: it will produce the
// wrong result on platforms that allocate addresses that are divisible by 4
// or 2. Only use it for offsets or sizes.
//
// This macro is only used by tclCompile.c in the core (Bug 926445). It
// however not be made file static, as extensions that touch bytecodes
// (notably tbcload) require it.

// The following enum values are used to specify the runtime platform setting
// of the tclPlatform variable.

const ( /* tclInt.h:2325:1: */
	TCL_PLATFORM_UNIX    = 0 // Any Unix-like OS.
	TCL_PLATFORM_WINDOWS = 2
)

// The following enum values are used to indicate the translation of a Tcl
// channel. Declared here so that each platform can define
// TCL_PLATFORM_TRANSLATION to the native translation on that platform.

const ( /* tclInt.h:2336:1: */
	TCL_TRANSLATE_AUTO = 0 // Eol == \r, \n and \r\n.
	TCL_TRANSLATE_CR   = 1 // Eol == \r.
	TCL_TRANSLATE_LF   = 2 // Eol == \n.
	TCL_TRANSLATE_CRLF = 3
)

// The "globParameters" argument of the function TclGlob is an or'ed
// combination of the following values:

const ( /* tclInt.h:2572:1: */
	TCL_PATH_DIRNAME   = 0
	TCL_PATH_TAIL      = 1
	TCL_PATH_EXTENSION = 2
	TCL_PATH_ROOT      = 3
)

const ( /* tclInt.h:2746:1: */
	TCL_EMPTYSTRING_UNKNOWN = -1
	TCL_EMPTYSTRING_NO      = 0
	TCL_EMPTYSTRING_YES     = 1
)

// Structure definition for information used to keep the state of an
// interactive command processor that reads lines from standard input and
// writes prompts and results to standard output.

const ( /* tclMain.c:92:1: */
	PROMPT_NONE     = 0 // Print no prompt
	PROMPT_START    = 1 // Print prompt for command start
	PROMPT_CONTINUE = 2
) // Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Indices of the standard return options dictionary keys.

const ( /* tclResult.c:18:1: */
	KEY_CODE       = 0
	KEY_ERRORCODE  = 1
	KEY_ERRORINFO  = 2
	KEY_ERRORLINE  = 3
	KEY_LEVEL      = 4
	KEY_OPTIONS    = 5
	KEY_ERRORSTACK = 6
	KEY_LAST       = 7
)

// The following constants are used to determine the category of a
// Unicode character.

const ( /* tclUniData.c:1685:1: */
	UNASSIGNED                = 0
	UPPERCASE_LETTER          = 1
	LOWERCASE_LETTER          = 2
	TITLECASE_LETTER          = 3
	MODIFIER_LETTER           = 4
	OTHER_LETTER              = 5
	NON_SPACING_MARK          = 6
	ENCLOSING_MARK            = 7
	COMBINING_SPACING_MARK    = 8
	DECIMAL_DIGIT_NUMBER      = 9
	LETTER_NUMBER             = 10
	OTHER_NUMBER              = 11
	SPACE_SEPARATOR           = 12
	LINE_SEPARATOR            = 13
	PARAGRAPH_SEPARATOR       = 14
	CONTROL                   = 15
	FORMAT                    = 16
	PRIVATE_USE               = 17
	SURROGATE                 = 18
	CONNECTOR_PUNCTUATION     = 19
	DASH_PUNCTUATION          = 20
	OPEN_PUNCTUATION          = 21
	CLOSE_PUNCTUATION         = 22
	INITIAL_QUOTE_PUNCTUATION = 23
	FINAL_QUOTE_PUNCTUATION   = 24
	OTHER_PUNCTUATION         = 25
	MATH_SYMBOL               = 26
	CURRENCY_SYMBOL           = 27
	MODIFIER_SYMBOL           = 28
	OTHER_SYMBOL              = 29
)

// Constants and variables necessary for file attributes subcommand.
//
// IMPORTANT: The permissions attribute is assumed to be the third item (i.e.
// to be indexed with '2' in arrays) in code in tclIOUtil.c and possibly
// elsewhere in Tcl's core.

const ( /* tclUnixFCmd.c:126:1: */
	UNIX_GROUP_ATTRIBUTE       = 0
	UNIX_OWNER_ATTRIBUTE       = 1
	UNIX_PERMISSIONS_ATTRIBUTE = 2
	UNIX_INVALID_ATTRIBUTE     = 3
)

// end block for C++

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Define ISO C stdio on top of C++ iostreams.
//    Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.19 Input/output	<stdio.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard 7.4: Character handling	<ctype.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// These are all the characteristics of characters.
//    If there get to be more than 16 distinct characteristics,
//    many things must be changed that use `unsigned short int's.
//
//    The characteristics are stored always in network byte order (big
//    endian).  We define the bit value interpretations here dependent on the
//    machine's byte order.

// Endian macros for string.h functions
//    Copyright (C) 1992-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <http://www.gnu.org/licenses/>.

const ( /* ctype.h:46:1: */
	X_ISupper  = 256   // UPPERCASE.
	X_ISlower  = 512   // lowercase.
	X_ISalpha  = 1024  // Alphabetic.
	X_ISdigit  = 2048  // Numeric.
	X_ISxdigit = 4096  // Hexadecimal numeric.
	X_ISspace  = 8192  // Whitespace.
	X_ISprint  = 16384 // Printing.
	X_ISgraph  = 32768 // Graphical.
	X_ISblank  = 1     // Blank (usually SPC and TAB).
	X_IScntrl  = 2     // Control character.
	X_ISpunct  = 4     // Punctuation.
	X_ISalnum  = 8
)

// Inform libc code that these two types are effectively identical.

// These macros extract size information from a `struct dirent *'.
//    They may evaluate their argument multiple times, so it must not
//    have side effects.  Each of these may involve a relatively costly
//    call to `strlen' on some systems, so these values should be cached.
//
//    _D_EXACT_NAMLEN (DP)	returns the length of DP->d_name, not including
//    its terminating null character.
//
//    _D_ALLOC_NAMLEN (DP)	returns a size at least (_D_EXACT_NAMLEN (DP) + 1);
//    that is, the allocation size needed to hold the DP->d_name string.
//    Use this macro when you don't need the exact length, just an upper bound.
//    This macro is less likely to require calling `strlen' than _D_EXACT_NAMLEN.
//

// File types for `d_type'.
const ( /* dirent.h:97:1: */
	DT_UNKNOWN = 0
	DT_FIFO    = 1
	DT_CHR     = 2
	DT_DIR     = 4
	DT_BLK     = 6
	DT_REG     = 8
	DT_LNK     = 10
	DT_SOCK    = 12
	DT_WHT     = 14
)

// Definition of locale category symbol values.
//    Copyright (C) 2001-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Construct an `nl_item' value for `nl_langinfo' from a locale category
//    (LC_*) and an item index within the category.  Some code may depend on
//    the item values within a category increasing monotonically with the
//    indices.

// Extract the category and item index from a constructed `nl_item' value.

// Enumeration of locale items that can be queried with `nl_langinfo'.
const ( /* langinfo.h:41:1: */
	// LC_TIME category: date and time formatting.

	// Abbreviated days of the week.
	ABDAY_1 = 131072 // Sun
	ABDAY_2 = 131073
	ABDAY_3 = 131074
	ABDAY_4 = 131075
	ABDAY_5 = 131076
	ABDAY_6 = 131077
	ABDAY_7 = 131078

	// Long-named days of the week.
	DAY_1 = 131079 // Sunday
	DAY_2 = 131080 // Monday
	DAY_3 = 131081 // Tuesday
	DAY_4 = 131082 // Wednesday
	DAY_5 = 131083 // Thursday
	DAY_6 = 131084 // Friday
	DAY_7 = 131085 // Saturday

	// Abbreviated month names, in the grammatical form used when the month
	//      is a part of a complete date.
	ABMON_1  = 131086 // Jan
	ABMON_2  = 131087
	ABMON_3  = 131088
	ABMON_4  = 131089
	ABMON_5  = 131090
	ABMON_6  = 131091
	ABMON_7  = 131092
	ABMON_8  = 131093
	ABMON_9  = 131094
	ABMON_10 = 131095
	ABMON_11 = 131096
	ABMON_12 = 131097

	// Long month names, in the grammatical form used when the month
	//      is a part of a complete date.
	MON_1  = 131098 // January
	MON_2  = 131099
	MON_3  = 131100
	MON_4  = 131101
	MON_5  = 131102
	MON_6  = 131103
	MON_7  = 131104
	MON_8  = 131105
	MON_9  = 131106
	MON_10 = 131107
	MON_11 = 131108
	MON_12 = 131109

	AM_STR = 131110 // Ante meridiem string.
	PM_STR = 131111 // Post meridiem string.

	D_T_FMT    = 131112 // Date and time format for strftime.
	D_FMT      = 131113 // Date format for strftime.
	T_FMT      = 131114 // Time format for strftime.
	T_FMT_AMPM = 131115 // 12-hour time format for strftime.

	ERA         = 131116 // Alternate era.
	X__ERA_YEAR = 131117 // Year in alternate era format.
	ERA_D_FMT   = 131118 // Date in alternate era format.
	ALT_DIGITS  = 131119 // Alternate symbols for digits.
	ERA_D_T_FMT = 131120 // Date and time in alternate era format.
	ERA_T_FMT   = 131121 // Time in alternate era format.

	X_NL_TIME_ERA_NUM_ENTRIES = 131122 // Number entries in the era arrays.
	X_NL_TIME_ERA_ENTRIES     = 131123 // Structure with era entries in usable form.

	X_NL_WABDAY_1 = 131124 // Sun
	X_NL_WABDAY_2 = 131125
	X_NL_WABDAY_3 = 131126
	X_NL_WABDAY_4 = 131127
	X_NL_WABDAY_5 = 131128
	X_NL_WABDAY_6 = 131129
	X_NL_WABDAY_7 = 131130

	// Long-named days of the week.
	X_NL_WDAY_1 = 131131 // Sunday
	X_NL_WDAY_2 = 131132 // Monday
	X_NL_WDAY_3 = 131133 // Tuesday
	X_NL_WDAY_4 = 131134 // Wednesday
	X_NL_WDAY_5 = 131135 // Thursday
	X_NL_WDAY_6 = 131136 // Friday
	X_NL_WDAY_7 = 131137 // Saturday

	// Abbreviated month names, in the grammatical form used when the month
	//      is a part of a complete date.
	X_NL_WABMON_1  = 131138 // Jan
	X_NL_WABMON_2  = 131139
	X_NL_WABMON_3  = 131140
	X_NL_WABMON_4  = 131141
	X_NL_WABMON_5  = 131142
	X_NL_WABMON_6  = 131143
	X_NL_WABMON_7  = 131144
	X_NL_WABMON_8  = 131145
	X_NL_WABMON_9  = 131146
	X_NL_WABMON_10 = 131147
	X_NL_WABMON_11 = 131148
	X_NL_WABMON_12 = 131149

	// Long month names, in the grammatical form used when the month
	//      is a part of a complete date.
	X_NL_WMON_1  = 131150 // January
	X_NL_WMON_2  = 131151
	X_NL_WMON_3  = 131152
	X_NL_WMON_4  = 131153
	X_NL_WMON_5  = 131154
	X_NL_WMON_6  = 131155
	X_NL_WMON_7  = 131156
	X_NL_WMON_8  = 131157
	X_NL_WMON_9  = 131158
	X_NL_WMON_10 = 131159
	X_NL_WMON_11 = 131160
	X_NL_WMON_12 = 131161

	X_NL_WAM_STR = 131162 // Ante meridiem string.
	X_NL_WPM_STR = 131163 // Post meridiem string.

	X_NL_WD_T_FMT    = 131164 // Date and time format for strftime.
	X_NL_WD_FMT      = 131165 // Date format for strftime.
	X_NL_WT_FMT      = 131166 // Time format for strftime.
	X_NL_WT_FMT_AMPM = 131167 // 12-hour time format for strftime.

	X_NL_WERA_YEAR    = 131168 // Year in alternate era format.
	X_NL_WERA_D_FMT   = 131169 // Date in alternate era format.
	X_NL_WALT_DIGITS  = 131170 // Alternate symbols for digits.
	X_NL_WERA_D_T_FMT = 131171 // Date and time in alternate era format.
	X_NL_WERA_T_FMT   = 131172 // Time in alternate era format.

	X_NL_TIME_WEEK_NDAYS    = 131173
	X_NL_TIME_WEEK_1STDAY   = 131174
	X_NL_TIME_WEEK_1STWEEK  = 131175
	X_NL_TIME_FIRST_WEEKDAY = 131176
	X_NL_TIME_FIRST_WORKDAY = 131177
	X_NL_TIME_CAL_DIRECTION = 131178
	X_NL_TIME_TIMEZONE      = 131179

	X_DATE_FMT      = 131180 // strftime format for date.
	X_NL_W_DATE_FMT = 131181

	X_NL_TIME_CODESET = 131182

	// Long month names, in the grammatical form used when the month
	//      is named by itself.
	X__ALTMON_1  = 131183 // January
	X__ALTMON_2  = 131184
	X__ALTMON_3  = 131185
	X__ALTMON_4  = 131186
	X__ALTMON_5  = 131187
	X__ALTMON_6  = 131188
	X__ALTMON_7  = 131189
	X__ALTMON_8  = 131190
	X__ALTMON_9  = 131191
	X__ALTMON_10 = 131192
	X__ALTMON_11 = 131193
	X__ALTMON_12 = 131194

	// Long month names, in the grammatical form used when the month
	//      is named by itself.
	X_NL_WALTMON_1  = 131195 // January
	X_NL_WALTMON_2  = 131196
	X_NL_WALTMON_3  = 131197
	X_NL_WALTMON_4  = 131198
	X_NL_WALTMON_5  = 131199
	X_NL_WALTMON_6  = 131200
	X_NL_WALTMON_7  = 131201
	X_NL_WALTMON_8  = 131202
	X_NL_WALTMON_9  = 131203
	X_NL_WALTMON_10 = 131204
	X_NL_WALTMON_11 = 131205
	X_NL_WALTMON_12 = 131206

	// Abbreviated month names, in the grammatical form used when the month
	//      is named by itself.
	X_NL_ABALTMON_1  = 131207 // Jan
	X_NL_ABALTMON_2  = 131208
	X_NL_ABALTMON_3  = 131209
	X_NL_ABALTMON_4  = 131210
	X_NL_ABALTMON_5  = 131211
	X_NL_ABALTMON_6  = 131212
	X_NL_ABALTMON_7  = 131213
	X_NL_ABALTMON_8  = 131214
	X_NL_ABALTMON_9  = 131215
	X_NL_ABALTMON_10 = 131216
	X_NL_ABALTMON_11 = 131217
	X_NL_ABALTMON_12 = 131218

	// Abbreviated month names, in the grammatical form used when the month
	//      is named by itself.
	X_NL_WABALTMON_1  = 131219 // Jan
	X_NL_WABALTMON_2  = 131220
	X_NL_WABALTMON_3  = 131221
	X_NL_WABALTMON_4  = 131222
	X_NL_WABALTMON_5  = 131223
	X_NL_WABALTMON_6  = 131224
	X_NL_WABALTMON_7  = 131225
	X_NL_WABALTMON_8  = 131226
	X_NL_WABALTMON_9  = 131227
	X_NL_WABALTMON_10 = 131228
	X_NL_WABALTMON_11 = 131229
	X_NL_WABALTMON_12 = 131230

	X_NL_NUM_LC_TIME = 131231 // Number of indices in LC_TIME category.

	// LC_COLLATE category: text sorting.
	//      This information is accessed by the strcoll and strxfrm functions.
	//      These `nl_langinfo' names are used only internally.
	X_NL_COLLATE_NRULES           = 196608
	X_NL_COLLATE_RULESETS         = 196609
	X_NL_COLLATE_TABLEMB          = 196610
	X_NL_COLLATE_WEIGHTMB         = 196611
	X_NL_COLLATE_EXTRAMB          = 196612
	X_NL_COLLATE_INDIRECTMB       = 196613
	X_NL_COLLATE_GAP1             = 196614
	X_NL_COLLATE_GAP2             = 196615
	X_NL_COLLATE_GAP3             = 196616
	X_NL_COLLATE_TABLEWC          = 196617
	X_NL_COLLATE_WEIGHTWC         = 196618
	X_NL_COLLATE_EXTRAWC          = 196619
	X_NL_COLLATE_INDIRECTWC       = 196620
	X_NL_COLLATE_SYMB_HASH_SIZEMB = 196621
	X_NL_COLLATE_SYMB_TABLEMB     = 196622
	X_NL_COLLATE_SYMB_EXTRAMB     = 196623
	X_NL_COLLATE_COLLSEQMB        = 196624
	X_NL_COLLATE_COLLSEQWC        = 196625
	X_NL_COLLATE_CODESET          = 196626
	X_NL_NUM_LC_COLLATE           = 196627

	// LC_CTYPE category: character classification.
	//      This information is accessed by the functions in <ctype.h>.
	//      These `nl_langinfo' names are used only internally.
	X_NL_CTYPE_CLASS                        = 0
	X_NL_CTYPE_TOUPPER                      = 1
	X_NL_CTYPE_GAP1                         = 2
	X_NL_CTYPE_TOLOWER                      = 3
	X_NL_CTYPE_GAP2                         = 4
	X_NL_CTYPE_CLASS32                      = 5
	X_NL_CTYPE_GAP3                         = 6
	X_NL_CTYPE_GAP4                         = 7
	X_NL_CTYPE_GAP5                         = 8
	X_NL_CTYPE_GAP6                         = 9
	X_NL_CTYPE_CLASS_NAMES                  = 10
	X_NL_CTYPE_MAP_NAMES                    = 11
	X_NL_CTYPE_WIDTH                        = 12
	X_NL_CTYPE_MB_CUR_MAX                   = 13
	X_NL_CTYPE_CODESET_NAME                 = 14
	CODESET                                 = 14
	X_NL_CTYPE_TOUPPER32                    = 15
	X_NL_CTYPE_TOLOWER32                    = 16
	X_NL_CTYPE_CLASS_OFFSET                 = 17
	X_NL_CTYPE_MAP_OFFSET                   = 18
	X_NL_CTYPE_INDIGITS_MB_LEN              = 19
	X_NL_CTYPE_INDIGITS0_MB                 = 20
	X_NL_CTYPE_INDIGITS1_MB                 = 21
	X_NL_CTYPE_INDIGITS2_MB                 = 22
	X_NL_CTYPE_INDIGITS3_MB                 = 23
	X_NL_CTYPE_INDIGITS4_MB                 = 24
	X_NL_CTYPE_INDIGITS5_MB                 = 25
	X_NL_CTYPE_INDIGITS6_MB                 = 26
	X_NL_CTYPE_INDIGITS7_MB                 = 27
	X_NL_CTYPE_INDIGITS8_MB                 = 28
	X_NL_CTYPE_INDIGITS9_MB                 = 29
	X_NL_CTYPE_INDIGITS_WC_LEN              = 30
	X_NL_CTYPE_INDIGITS0_WC                 = 31
	X_NL_CTYPE_INDIGITS1_WC                 = 32
	X_NL_CTYPE_INDIGITS2_WC                 = 33
	X_NL_CTYPE_INDIGITS3_WC                 = 34
	X_NL_CTYPE_INDIGITS4_WC                 = 35
	X_NL_CTYPE_INDIGITS5_WC                 = 36
	X_NL_CTYPE_INDIGITS6_WC                 = 37
	X_NL_CTYPE_INDIGITS7_WC                 = 38
	X_NL_CTYPE_INDIGITS8_WC                 = 39
	X_NL_CTYPE_INDIGITS9_WC                 = 40
	X_NL_CTYPE_OUTDIGIT0_MB                 = 41
	X_NL_CTYPE_OUTDIGIT1_MB                 = 42
	X_NL_CTYPE_OUTDIGIT2_MB                 = 43
	X_NL_CTYPE_OUTDIGIT3_MB                 = 44
	X_NL_CTYPE_OUTDIGIT4_MB                 = 45
	X_NL_CTYPE_OUTDIGIT5_MB                 = 46
	X_NL_CTYPE_OUTDIGIT6_MB                 = 47
	X_NL_CTYPE_OUTDIGIT7_MB                 = 48
	X_NL_CTYPE_OUTDIGIT8_MB                 = 49
	X_NL_CTYPE_OUTDIGIT9_MB                 = 50
	X_NL_CTYPE_OUTDIGIT0_WC                 = 51
	X_NL_CTYPE_OUTDIGIT1_WC                 = 52
	X_NL_CTYPE_OUTDIGIT2_WC                 = 53
	X_NL_CTYPE_OUTDIGIT3_WC                 = 54
	X_NL_CTYPE_OUTDIGIT4_WC                 = 55
	X_NL_CTYPE_OUTDIGIT5_WC                 = 56
	X_NL_CTYPE_OUTDIGIT6_WC                 = 57
	X_NL_CTYPE_OUTDIGIT7_WC                 = 58
	X_NL_CTYPE_OUTDIGIT8_WC                 = 59
	X_NL_CTYPE_OUTDIGIT9_WC                 = 60
	X_NL_CTYPE_TRANSLIT_TAB_SIZE            = 61
	X_NL_CTYPE_TRANSLIT_FROM_IDX            = 62
	X_NL_CTYPE_TRANSLIT_FROM_TBL            = 63
	X_NL_CTYPE_TRANSLIT_TO_IDX              = 64
	X_NL_CTYPE_TRANSLIT_TO_TBL              = 65
	X_NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN = 66
	X_NL_CTYPE_TRANSLIT_DEFAULT_MISSING     = 67
	X_NL_CTYPE_TRANSLIT_IGNORE_LEN          = 68
	X_NL_CTYPE_TRANSLIT_IGNORE              = 69
	X_NL_CTYPE_MAP_TO_NONASCII              = 70
	X_NL_CTYPE_NONASCII_CASE                = 71
	X_NL_CTYPE_EXTRA_MAP_1                  = 72
	X_NL_CTYPE_EXTRA_MAP_2                  = 73
	X_NL_CTYPE_EXTRA_MAP_3                  = 74
	X_NL_CTYPE_EXTRA_MAP_4                  = 75
	X_NL_CTYPE_EXTRA_MAP_5                  = 76
	X_NL_CTYPE_EXTRA_MAP_6                  = 77
	X_NL_CTYPE_EXTRA_MAP_7                  = 78
	X_NL_CTYPE_EXTRA_MAP_8                  = 79
	X_NL_CTYPE_EXTRA_MAP_9                  = 80
	X_NL_CTYPE_EXTRA_MAP_10                 = 81
	X_NL_CTYPE_EXTRA_MAP_11                 = 82
	X_NL_CTYPE_EXTRA_MAP_12                 = 83
	X_NL_CTYPE_EXTRA_MAP_13                 = 84
	X_NL_CTYPE_EXTRA_MAP_14                 = 85
	X_NL_NUM_LC_CTYPE                       = 86

	// LC_MONETARY category: formatting of monetary quantities.
	//      These items each correspond to a member of `struct lconv',
	//      defined in <locale.h>.
	X__INT_CURR_SYMBOL                   = 262144
	X__CURRENCY_SYMBOL                   = 262145
	X__MON_DECIMAL_POINT                 = 262146
	X__MON_THOUSANDS_SEP                 = 262147
	X__MON_GROUPING                      = 262148
	X__POSITIVE_SIGN                     = 262149
	X__NEGATIVE_SIGN                     = 262150
	X__INT_FRAC_DIGITS                   = 262151
	X__FRAC_DIGITS                       = 262152
	X__P_CS_PRECEDES                     = 262153
	X__P_SEP_BY_SPACE                    = 262154
	X__N_CS_PRECEDES                     = 262155
	X__N_SEP_BY_SPACE                    = 262156
	X__P_SIGN_POSN                       = 262157
	X__N_SIGN_POSN                       = 262158
	X_NL_MONETARY_CRNCYSTR               = 262159
	X__INT_P_CS_PRECEDES                 = 262160
	X__INT_P_SEP_BY_SPACE                = 262161
	X__INT_N_CS_PRECEDES                 = 262162
	X__INT_N_SEP_BY_SPACE                = 262163
	X__INT_P_SIGN_POSN                   = 262164
	X__INT_N_SIGN_POSN                   = 262165
	X_NL_MONETARY_DUO_INT_CURR_SYMBOL    = 262166
	X_NL_MONETARY_DUO_CURRENCY_SYMBOL    = 262167
	X_NL_MONETARY_DUO_INT_FRAC_DIGITS    = 262168
	X_NL_MONETARY_DUO_FRAC_DIGITS        = 262169
	X_NL_MONETARY_DUO_P_CS_PRECEDES      = 262170
	X_NL_MONETARY_DUO_P_SEP_BY_SPACE     = 262171
	X_NL_MONETARY_DUO_N_CS_PRECEDES      = 262172
	X_NL_MONETARY_DUO_N_SEP_BY_SPACE     = 262173
	X_NL_MONETARY_DUO_INT_P_CS_PRECEDES  = 262174
	X_NL_MONETARY_DUO_INT_P_SEP_BY_SPACE = 262175
	X_NL_MONETARY_DUO_INT_N_CS_PRECEDES  = 262176
	X_NL_MONETARY_DUO_INT_N_SEP_BY_SPACE = 262177
	X_NL_MONETARY_DUO_P_SIGN_POSN        = 262178
	X_NL_MONETARY_DUO_N_SIGN_POSN        = 262179
	X_NL_MONETARY_DUO_INT_P_SIGN_POSN    = 262180
	X_NL_MONETARY_DUO_INT_N_SIGN_POSN    = 262181
	X_NL_MONETARY_UNO_VALID_FROM         = 262182
	X_NL_MONETARY_UNO_VALID_TO           = 262183
	X_NL_MONETARY_DUO_VALID_FROM         = 262184
	X_NL_MONETARY_DUO_VALID_TO           = 262185
	X_NL_MONETARY_CONVERSION_RATE        = 262186
	X_NL_MONETARY_DECIMAL_POINT_WC       = 262187
	X_NL_MONETARY_THOUSANDS_SEP_WC       = 262188
	X_NL_MONETARY_CODESET                = 262189
	X_NL_NUM_LC_MONETARY                 = 262190

	// LC_NUMERIC category: formatting of numbers.
	//      These also correspond to members of `struct lconv'; see <locale.h>.
	X__DECIMAL_POINT              = 65536
	RADIXCHAR                     = 65536
	X__THOUSANDS_SEP              = 65537
	THOUSEP                       = 65537
	X__GROUPING                   = 65538
	X_NL_NUMERIC_DECIMAL_POINT_WC = 65539
	X_NL_NUMERIC_THOUSANDS_SEP_WC = 65540
	X_NL_NUMERIC_CODESET          = 65541
	X_NL_NUM_LC_NUMERIC           = 65542

	X__YESEXPR            = 327680 // Regex matching ``yes'' input.
	X__NOEXPR             = 327681 // Regex matching ``no'' input.
	X__YESSTR             = 327682 // Output string for ``yes''.
	X__NOSTR              = 327683 // Output string for ``no''.
	X_NL_MESSAGES_CODESET = 327684
	X_NL_NUM_LC_MESSAGES  = 327685

	X_NL_PAPER_HEIGHT  = 458752
	X_NL_PAPER_WIDTH   = 458753
	X_NL_PAPER_CODESET = 458754
	X_NL_NUM_LC_PAPER  = 458755

	X_NL_NAME_NAME_FMT  = 524288
	X_NL_NAME_NAME_GEN  = 524289
	X_NL_NAME_NAME_MR   = 524290
	X_NL_NAME_NAME_MRS  = 524291
	X_NL_NAME_NAME_MISS = 524292
	X_NL_NAME_NAME_MS   = 524293
	X_NL_NAME_CODESET   = 524294
	X_NL_NUM_LC_NAME    = 524295

	X_NL_ADDRESS_POSTAL_FMT   = 589824
	X_NL_ADDRESS_COUNTRY_NAME = 589825
	X_NL_ADDRESS_COUNTRY_POST = 589826
	X_NL_ADDRESS_COUNTRY_AB2  = 589827
	X_NL_ADDRESS_COUNTRY_AB3  = 589828
	X_NL_ADDRESS_COUNTRY_CAR  = 589829
	X_NL_ADDRESS_COUNTRY_NUM  = 589830
	X_NL_ADDRESS_COUNTRY_ISBN = 589831
	X_NL_ADDRESS_LANG_NAME    = 589832
	X_NL_ADDRESS_LANG_AB      = 589833
	X_NL_ADDRESS_LANG_TERM    = 589834
	X_NL_ADDRESS_LANG_LIB     = 589835
	X_NL_ADDRESS_CODESET      = 589836
	X_NL_NUM_LC_ADDRESS       = 589837

	X_NL_TELEPHONE_TEL_INT_FMT = 655360
	X_NL_TELEPHONE_TEL_DOM_FMT = 655361
	X_NL_TELEPHONE_INT_SELECT  = 655362
	X_NL_TELEPHONE_INT_PREFIX  = 655363
	X_NL_TELEPHONE_CODESET     = 655364
	X_NL_NUM_LC_TELEPHONE      = 655365

	X_NL_MEASUREMENT_MEASUREMENT = 720896
	X_NL_MEASUREMENT_CODESET     = 720897
	X_NL_NUM_LC_MEASUREMENT      = 720898

	X_NL_IDENTIFICATION_TITLE        = 786432
	X_NL_IDENTIFICATION_SOURCE       = 786433
	X_NL_IDENTIFICATION_ADDRESS      = 786434
	X_NL_IDENTIFICATION_CONTACT      = 786435
	X_NL_IDENTIFICATION_EMAIL        = 786436
	X_NL_IDENTIFICATION_TEL          = 786437
	X_NL_IDENTIFICATION_FAX          = 786438
	X_NL_IDENTIFICATION_LANGUAGE     = 786439
	X_NL_IDENTIFICATION_TERRITORY    = 786440
	X_NL_IDENTIFICATION_AUDIENCE     = 786441
	X_NL_IDENTIFICATION_APPLICATION  = 786442
	X_NL_IDENTIFICATION_ABBREVIATION = 786443
	X_NL_IDENTIFICATION_REVISION     = 786444
	X_NL_IDENTIFICATION_DATE         = 786445
	X_NL_IDENTIFICATION_CATEGORY     = 786446
	X_NL_IDENTIFICATION_CODESET      = 786447
	X_NL_NUM_LC_IDENTIFICATION       = 786448

	// This marks the highest value used.
	X_NL_NUM = 786449
)

// Depending on the type of TG_ARG, call an appropriately suffixed
//    version of FUNC with arguments (including parentheses) ARGS.
//    Suffixed functions may not exist for long double if it has the same
//    format as double, or for other types with the same format as float,
//    double or long double.  The behavior is undefined if the argument
//    does not have a real floating type.  The definition may use a
//    conditional expression, so all suffixed versions of FUNC must
//    return the same type (FUNC may include a cast if necessary rather
//    than being a single identifier).

// ISO C99 defines some generic macros which work on any data type.

// All floating-point numbers can be put in one of these categories.
const ( /* math.h:853:1: */
	FP_NAN       = 0
	FP_INFINITE  = 1
	FP_ZERO      = 2
	FP_SUBNORMAL = 3
	FP_NORMAL    = 4
)

// Standard well-known ports.
const ( /* in.h:122:1: */
	IPPORT_ECHO       = 7  // Echo service.
	IPPORT_DISCARD    = 9  // Discard transmissions service.
	IPPORT_SYSTAT     = 11 // System status service.
	IPPORT_DAYTIME    = 13 // Time of day service.
	IPPORT_NETSTAT    = 15 // Network status service.
	IPPORT_FTP        = 21 // File Transfer Protocol.
	IPPORT_TELNET     = 23 // Telnet protocol.
	IPPORT_SMTP       = 25 // Simple Mail Transfer Protocol.
	IPPORT_TIMESERVER = 37 // Timeserver service.
	IPPORT_NAMESERVER = 42 // Domain Name Service.
	IPPORT_WHOIS      = 43 // Internet Whois service.
	IPPORT_MTP        = 57

	IPPORT_TFTP    = 69 // Trivial File Transfer Protocol.
	IPPORT_RJE     = 77
	IPPORT_FINGER  = 79 // Finger service.
	IPPORT_TTYLINK = 87
	IPPORT_SUPDUP  = 95 // SUPDUP protocol.

	IPPORT_EXECSERVER  = 512 // execd service.
	IPPORT_LOGINSERVER = 513 // rlogind service.
	IPPORT_CMDSERVER   = 514
	IPPORT_EFSSERVER   = 520

	// UDP ports.
	IPPORT_BIFFUDP     = 512
	IPPORT_WHOSERVER   = 513
	IPPORT_ROUTESERVER = 520

	// Ports less than this value are reserved for privileged processes.
	IPPORT_RESERVED = 1024

	// Ports greater this value are reserved for (non-privileged) servers.
	IPPORT_USERRESERVED = 5000
)

// Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
//    The first word in the comment at the right is the data type used;
//    "bool" means a boolean value stored in an `int'.

// Advanced API (RFC3542) (1).

// Advanced API (RFC3542) (2).

// RFC5014.

// RFC5082.

// Obsolete synonyms for the above.

// IPV6_MTU_DISCOVER values.

// Socket level values for IPv6.

// Routing header options for IPv6.

// Standard well-defined IP protocols.
const ( /* in.h:40:1: */
	IPPROTO_IP      = 0   // Dummy protocol for TCP.
	IPPROTO_ICMP    = 1   // Internet Control Message Protocol.
	IPPROTO_IGMP    = 2   // Internet Group Management Protocol.
	IPPROTO_IPIP    = 4   // IPIP tunnels (older KA9Q tunnels use 94).
	IPPROTO_TCP     = 6   // Transmission Control Protocol.
	IPPROTO_EGP     = 8   // Exterior Gateway Protocol.
	IPPROTO_PUP     = 12  // PUP protocol.
	IPPROTO_UDP     = 17  // User Datagram Protocol.
	IPPROTO_IDP     = 22  // XNS IDP protocol.
	IPPROTO_TP      = 29  // SO Transport Protocol Class 4.
	IPPROTO_DCCP    = 33  // Datagram Congestion Control Protocol.
	IPPROTO_IPV6    = 41  // IPv6 header.
	IPPROTO_RSVP    = 46  // Reservation Protocol.
	IPPROTO_GRE     = 47  // General Routing Encapsulation.
	IPPROTO_ESP     = 50  // encapsulating security payload.
	IPPROTO_AH      = 51  // authentication header.
	IPPROTO_MTP     = 92  // Multicast Transport Protocol.
	IPPROTO_BEETPH  = 94  // IP option pseudo header for BEET.
	IPPROTO_ENCAP   = 98  // Encapsulation Header.
	IPPROTO_PIM     = 103 // Protocol Independent Multicast.
	IPPROTO_COMP    = 108 // Compression Header Protocol.
	IPPROTO_SCTP    = 132 // Stream Control Transmission Protocol.
	IPPROTO_UDPLITE = 136 // UDP-Lite protocol.
	IPPROTO_MPLS    = 137 // MPLS in IP.
	IPPROTO_RAW     = 255 // Raw IP packets.
	IPPROTO_MAX     = 256
)

// If __USE_KERNEL_IPV6_DEFS is 1 then the user has included the kernel
//    network headers first and we should use those ABI-identical definitions
//    instead of our own, otherwise 0.
const ( /* in.h:99:1: */
	IPPROTO_HOPOPTS  = 0  // IPv6 Hop-by-Hop options.
	IPPROTO_ROUTING  = 43 // IPv6 routing header.
	IPPROTO_FRAGMENT = 44 // IPv6 fragmentation header.
	IPPROTO_ICMPV6   = 58 // ICMPv6.
	IPPROTO_NONE     = 59 // IPv6 no next header.
	IPPROTO_DSTOPTS  = 60 // IPv6 destination options.
	IPPROTO_MH       = 135
)

// Read-write lock types.
const ( /* pthread.h:100:1: */
	PTHREAD_RWLOCK_PREFER_READER_NP              = 0
	PTHREAD_RWLOCK_PREFER_WRITER_NP              = 1
	PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP = 2
	PTHREAD_RWLOCK_DEFAULT_NP                    = 0
)

// Read-write lock initializers.

// Scheduler inheritance.
const ( /* pthread.h:120:1: */
	PTHREAD_INHERIT_SCHED  = 0
	PTHREAD_EXPLICIT_SCHED = 1
)

// Scope handling.
const ( /* pthread.h:130:1: */
	PTHREAD_SCOPE_SYSTEM  = 0
	PTHREAD_SCOPE_PROCESS = 1
)

// Process shared or private flag.
const ( /* pthread.h:140:1: */
	PTHREAD_PROCESS_PRIVATE = 0
	PTHREAD_PROCESS_SHARED  = 1
)

// Cancellation
const ( /* pthread.h:164:1: */
	PTHREAD_CANCEL_ENABLE  = 0
	PTHREAD_CANCEL_DISABLE = 1
)
const ( /* pthread.h:171:1: */
	PTHREAD_CANCEL_DEFERRED     = 0
	PTHREAD_CANCEL_ASYNCHRONOUS = 1
)

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.
// NB: Include guard matches what <linux/time.h> uses.

// Detach state.
const ( /* pthread.h:33:1: */
	PTHREAD_CREATE_JOINABLE = 0
	PTHREAD_CREATE_DETACHED = 1
)

// Mutex types.
const ( /* pthread.h:43:1: */
	PTHREAD_MUTEX_TIMED_NP      = 0
	PTHREAD_MUTEX_RECURSIVE_NP  = 1
	PTHREAD_MUTEX_ERRORCHECK_NP = 2
	PTHREAD_MUTEX_ADAPTIVE_NP   = 3
	PTHREAD_MUTEX_NORMAL        = 0
	PTHREAD_MUTEX_RECURSIVE     = 1
	PTHREAD_MUTEX_ERRORCHECK    = 2
	PTHREAD_MUTEX_DEFAULT       = 0
)

// Robust mutex or not flags.
const ( /* pthread.h:65:1: */
	PTHREAD_MUTEX_STALLED    = 0
	PTHREAD_MUTEX_STALLED_NP = 0
	PTHREAD_MUTEX_ROBUST     = 1
	PTHREAD_MUTEX_ROBUST_NP  = 1
)

// Mutex protocols.
const ( /* pthread.h:77:1: */
	PTHREAD_PRIO_NONE    = 0
	PTHREAD_PRIO_INHERIT = 1
	PTHREAD_PRIO_PROTECT = 2
)

// Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf';
//    the `_SC_*' symbols for the NAME argument to `sysconf';
//    and the `_CS_*' symbols for the NAME argument to `confstr'.
// `sysconf', `pathconf', and `confstr' NAME values.  Generic version.
//    Copyright (C) 1993-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Values for the NAME argument to `pathconf' and `fpathconf'.
const ( /* confname.h:24:1: */
	X_PC_LINK_MAX           = 0
	X_PC_MAX_CANON          = 1
	X_PC_MAX_INPUT          = 2
	X_PC_NAME_MAX           = 3
	X_PC_PATH_MAX           = 4
	X_PC_PIPE_BUF           = 5
	X_PC_CHOWN_RESTRICTED   = 6
	X_PC_NO_TRUNC           = 7
	X_PC_VDISABLE           = 8
	X_PC_SYNC_IO            = 9
	X_PC_ASYNC_IO           = 10
	X_PC_PRIO_IO            = 11
	X_PC_SOCK_MAXBUF        = 12
	X_PC_FILESIZEBITS       = 13
	X_PC_REC_INCR_XFER_SIZE = 14
	X_PC_REC_MAX_XFER_SIZE  = 15
	X_PC_REC_MIN_XFER_SIZE  = 16
	X_PC_REC_XFER_ALIGN     = 17
	X_PC_ALLOC_SIZE_MIN     = 18
	X_PC_SYMLINK_MAX        = 19
	X_PC_2_SYMLINKS         = 20
)

// Values for the NAME argument to `confstr'.
const ( /* confname.h:533:1: */
	X_CS_PATH = 0 // The default search path.

	X_CS_V6_WIDTH_RESTRICTED_ENVS = 1

	X_CS_GNU_LIBC_VERSION       = 2
	X_CS_GNU_LIBPTHREAD_VERSION = 3

	X_CS_V5_WIDTH_RESTRICTED_ENVS = 4

	X_CS_V7_WIDTH_RESTRICTED_ENVS = 5

	X_CS_LFS_CFLAGS      = 1000
	X_CS_LFS_LDFLAGS     = 1001
	X_CS_LFS_LIBS        = 1002
	X_CS_LFS_LINTFLAGS   = 1003
	X_CS_LFS64_CFLAGS    = 1004
	X_CS_LFS64_LDFLAGS   = 1005
	X_CS_LFS64_LIBS      = 1006
	X_CS_LFS64_LINTFLAGS = 1007

	X_CS_XBS5_ILP32_OFF32_CFLAGS     = 1100
	X_CS_XBS5_ILP32_OFF32_LDFLAGS    = 1101
	X_CS_XBS5_ILP32_OFF32_LIBS       = 1102
	X_CS_XBS5_ILP32_OFF32_LINTFLAGS  = 1103
	X_CS_XBS5_ILP32_OFFBIG_CFLAGS    = 1104
	X_CS_XBS5_ILP32_OFFBIG_LDFLAGS   = 1105
	X_CS_XBS5_ILP32_OFFBIG_LIBS      = 1106
	X_CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107
	X_CS_XBS5_LP64_OFF64_CFLAGS      = 1108
	X_CS_XBS5_LP64_OFF64_LDFLAGS     = 1109
	X_CS_XBS5_LP64_OFF64_LIBS        = 1110
	X_CS_XBS5_LP64_OFF64_LINTFLAGS   = 1111
	X_CS_XBS5_LPBIG_OFFBIG_CFLAGS    = 1112
	X_CS_XBS5_LPBIG_OFFBIG_LDFLAGS   = 1113
	X_CS_XBS5_LPBIG_OFFBIG_LIBS      = 1114
	X_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115

	X_CS_POSIX_V6_ILP32_OFF32_CFLAGS     = 1116
	X_CS_POSIX_V6_ILP32_OFF32_LDFLAGS    = 1117
	X_CS_POSIX_V6_ILP32_OFF32_LIBS       = 1118
	X_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS  = 1119
	X_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS    = 1120
	X_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS   = 1121
	X_CS_POSIX_V6_ILP32_OFFBIG_LIBS      = 1122
	X_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123
	X_CS_POSIX_V6_LP64_OFF64_CFLAGS      = 1124
	X_CS_POSIX_V6_LP64_OFF64_LDFLAGS     = 1125
	X_CS_POSIX_V6_LP64_OFF64_LIBS        = 1126
	X_CS_POSIX_V6_LP64_OFF64_LINTFLAGS   = 1127
	X_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS    = 1128
	X_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS   = 1129
	X_CS_POSIX_V6_LPBIG_OFFBIG_LIBS      = 1130
	X_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131

	X_CS_POSIX_V7_ILP32_OFF32_CFLAGS     = 1132
	X_CS_POSIX_V7_ILP32_OFF32_LDFLAGS    = 1133
	X_CS_POSIX_V7_ILP32_OFF32_LIBS       = 1134
	X_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS  = 1135
	X_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS    = 1136
	X_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS   = 1137
	X_CS_POSIX_V7_ILP32_OFFBIG_LIBS      = 1138
	X_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139
	X_CS_POSIX_V7_LP64_OFF64_CFLAGS      = 1140
	X_CS_POSIX_V7_LP64_OFF64_LDFLAGS     = 1141
	X_CS_POSIX_V7_LP64_OFF64_LIBS        = 1142
	X_CS_POSIX_V7_LP64_OFF64_LINTFLAGS   = 1143
	X_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS    = 1144
	X_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS   = 1145
	X_CS_POSIX_V7_LPBIG_OFFBIG_LIBS      = 1146
	X_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147

	X_CS_V6_ENV = 1148
	X_CS_V7_ENV = 1149
)

// Values for the argument to `sysconf'.
const ( /* confname.h:71:1: */
	X_SC_ARG_MAX               = 0
	X_SC_CHILD_MAX             = 1
	X_SC_CLK_TCK               = 2
	X_SC_NGROUPS_MAX           = 3
	X_SC_OPEN_MAX              = 4
	X_SC_STREAM_MAX            = 5
	X_SC_TZNAME_MAX            = 6
	X_SC_JOB_CONTROL           = 7
	X_SC_SAVED_IDS             = 8
	X_SC_REALTIME_SIGNALS      = 9
	X_SC_PRIORITY_SCHEDULING   = 10
	X_SC_TIMERS                = 11
	X_SC_ASYNCHRONOUS_IO       = 12
	X_SC_PRIORITIZED_IO        = 13
	X_SC_SYNCHRONIZED_IO       = 14
	X_SC_FSYNC                 = 15
	X_SC_MAPPED_FILES          = 16
	X_SC_MEMLOCK               = 17
	X_SC_MEMLOCK_RANGE         = 18
	X_SC_MEMORY_PROTECTION     = 19
	X_SC_MESSAGE_PASSING       = 20
	X_SC_SEMAPHORES            = 21
	X_SC_SHARED_MEMORY_OBJECTS = 22
	X_SC_AIO_LISTIO_MAX        = 23
	X_SC_AIO_MAX               = 24
	X_SC_AIO_PRIO_DELTA_MAX    = 25
	X_SC_DELAYTIMER_MAX        = 26
	X_SC_MQ_OPEN_MAX           = 27
	X_SC_MQ_PRIO_MAX           = 28
	X_SC_VERSION               = 29
	X_SC_PAGESIZE              = 30
	X_SC_RTSIG_MAX             = 31
	X_SC_SEM_NSEMS_MAX         = 32
	X_SC_SEM_VALUE_MAX         = 33
	X_SC_SIGQUEUE_MAX          = 34
	X_SC_TIMER_MAX             = 35

	// Values for the argument to `sysconf'
	//        corresponding to _POSIX2_* symbols.
	X_SC_BC_BASE_MAX        = 36
	X_SC_BC_DIM_MAX         = 37
	X_SC_BC_SCALE_MAX       = 38
	X_SC_BC_STRING_MAX      = 39
	X_SC_COLL_WEIGHTS_MAX   = 40
	X_SC_EQUIV_CLASS_MAX    = 41
	X_SC_EXPR_NEST_MAX      = 42
	X_SC_LINE_MAX           = 43
	X_SC_RE_DUP_MAX         = 44
	X_SC_CHARCLASS_NAME_MAX = 45

	X_SC_2_VERSION   = 46
	X_SC_2_C_BIND    = 47
	X_SC_2_C_DEV     = 48
	X_SC_2_FORT_DEV  = 49
	X_SC_2_FORT_RUN  = 50
	X_SC_2_SW_DEV    = 51
	X_SC_2_LOCALEDEF = 52

	X_SC_PII                 = 53
	X_SC_PII_XTI             = 54
	X_SC_PII_SOCKET          = 55
	X_SC_PII_INTERNET        = 56
	X_SC_PII_OSI             = 57
	X_SC_POLL                = 58
	X_SC_SELECT              = 59
	X_SC_UIO_MAXIOV          = 60
	X_SC_IOV_MAX             = 60
	X_SC_PII_INTERNET_STREAM = 61
	X_SC_PII_INTERNET_DGRAM  = 62
	X_SC_PII_OSI_COTS        = 63
	X_SC_PII_OSI_CLTS        = 64
	X_SC_PII_OSI_M           = 65
	X_SC_T_IOV_MAX           = 66

	// Values according to POSIX 1003.1c (POSIX threads).
	X_SC_THREADS                      = 67
	X_SC_THREAD_SAFE_FUNCTIONS        = 68
	X_SC_GETGR_R_SIZE_MAX             = 69
	X_SC_GETPW_R_SIZE_MAX             = 70
	X_SC_LOGIN_NAME_MAX               = 71
	X_SC_TTY_NAME_MAX                 = 72
	X_SC_THREAD_DESTRUCTOR_ITERATIONS = 73
	X_SC_THREAD_KEYS_MAX              = 74
	X_SC_THREAD_STACK_MIN             = 75
	X_SC_THREAD_THREADS_MAX           = 76
	X_SC_THREAD_ATTR_STACKADDR        = 77
	X_SC_THREAD_ATTR_STACKSIZE        = 78
	X_SC_THREAD_PRIORITY_SCHEDULING   = 79
	X_SC_THREAD_PRIO_INHERIT          = 80
	X_SC_THREAD_PRIO_PROTECT          = 81
	X_SC_THREAD_PROCESS_SHARED        = 82

	X_SC_NPROCESSORS_CONF = 83
	X_SC_NPROCESSORS_ONLN = 84
	X_SC_PHYS_PAGES       = 85
	X_SC_AVPHYS_PAGES     = 86
	X_SC_ATEXIT_MAX       = 87
	X_SC_PASS_MAX         = 88

	X_SC_XOPEN_VERSION     = 89
	X_SC_XOPEN_XCU_VERSION = 90
	X_SC_XOPEN_UNIX        = 91
	X_SC_XOPEN_CRYPT       = 92
	X_SC_XOPEN_ENH_I18N    = 93
	X_SC_XOPEN_SHM         = 94

	X_SC_2_CHAR_TERM = 95
	X_SC_2_C_VERSION = 96
	X_SC_2_UPE       = 97

	X_SC_XOPEN_XPG2 = 98
	X_SC_XOPEN_XPG3 = 99
	X_SC_XOPEN_XPG4 = 100

	X_SC_CHAR_BIT   = 101
	X_SC_CHAR_MAX   = 102
	X_SC_CHAR_MIN   = 103
	X_SC_INT_MAX    = 104
	X_SC_INT_MIN    = 105
	X_SC_LONG_BIT   = 106
	X_SC_WORD_BIT   = 107
	X_SC_MB_LEN_MAX = 108
	X_SC_NZERO      = 109
	X_SC_SSIZE_MAX  = 110
	X_SC_SCHAR_MAX  = 111
	X_SC_SCHAR_MIN  = 112
	X_SC_SHRT_MAX   = 113
	X_SC_SHRT_MIN   = 114
	X_SC_UCHAR_MAX  = 115
	X_SC_UINT_MAX   = 116
	X_SC_ULONG_MAX  = 117
	X_SC_USHRT_MAX  = 118

	X_SC_NL_ARGMAX  = 119
	X_SC_NL_LANGMAX = 120
	X_SC_NL_MSGMAX  = 121
	X_SC_NL_NMAX    = 122
	X_SC_NL_SETMAX  = 123
	X_SC_NL_TEXTMAX = 124

	X_SC_XBS5_ILP32_OFF32  = 125
	X_SC_XBS5_ILP32_OFFBIG = 126
	X_SC_XBS5_LP64_OFF64   = 127
	X_SC_XBS5_LPBIG_OFFBIG = 128

	X_SC_XOPEN_LEGACY           = 129
	X_SC_XOPEN_REALTIME         = 130
	X_SC_XOPEN_REALTIME_THREADS = 131

	X_SC_ADVISORY_INFO          = 132
	X_SC_BARRIERS               = 133
	X_SC_BASE                   = 134
	X_SC_C_LANG_SUPPORT         = 135
	X_SC_C_LANG_SUPPORT_R       = 136
	X_SC_CLOCK_SELECTION        = 137
	X_SC_CPUTIME                = 138
	X_SC_THREAD_CPUTIME         = 139
	X_SC_DEVICE_IO              = 140
	X_SC_DEVICE_SPECIFIC        = 141
	X_SC_DEVICE_SPECIFIC_R      = 142
	X_SC_FD_MGMT                = 143
	X_SC_FIFO                   = 144
	X_SC_PIPE                   = 145
	X_SC_FILE_ATTRIBUTES        = 146
	X_SC_FILE_LOCKING           = 147
	X_SC_FILE_SYSTEM            = 148
	X_SC_MONOTONIC_CLOCK        = 149
	X_SC_MULTI_PROCESS          = 150
	X_SC_SINGLE_PROCESS         = 151
	X_SC_NETWORKING             = 152
	X_SC_READER_WRITER_LOCKS    = 153
	X_SC_SPIN_LOCKS             = 154
	X_SC_REGEXP                 = 155
	X_SC_REGEX_VERSION          = 156
	X_SC_SHELL                  = 157
	X_SC_SIGNALS                = 158
	X_SC_SPAWN                  = 159
	X_SC_SPORADIC_SERVER        = 160
	X_SC_THREAD_SPORADIC_SERVER = 161
	X_SC_SYSTEM_DATABASE        = 162
	X_SC_SYSTEM_DATABASE_R      = 163
	X_SC_TIMEOUTS               = 164
	X_SC_TYPED_MEMORY_OBJECTS   = 165
	X_SC_USER_GROUPS            = 166
	X_SC_USER_GROUPS_R          = 167
	X_SC_2_PBS                  = 168
	X_SC_2_PBS_ACCOUNTING       = 169
	X_SC_2_PBS_LOCATE           = 170
	X_SC_2_PBS_MESSAGE          = 171
	X_SC_2_PBS_TRACK            = 172
	X_SC_SYMLOOP_MAX            = 173
	X_SC_STREAMS                = 174
	X_SC_2_PBS_CHECKPOINT       = 175

	X_SC_V6_ILP32_OFF32  = 176
	X_SC_V6_ILP32_OFFBIG = 177
	X_SC_V6_LP64_OFF64   = 178
	X_SC_V6_LPBIG_OFFBIG = 179

	X_SC_HOST_NAME_MAX      = 180
	X_SC_TRACE              = 181
	X_SC_TRACE_EVENT_FILTER = 182
	X_SC_TRACE_INHERIT      = 183
	X_SC_TRACE_LOG          = 184

	X_SC_LEVEL1_ICACHE_SIZE     = 185
	X_SC_LEVEL1_ICACHE_ASSOC    = 186
	X_SC_LEVEL1_ICACHE_LINESIZE = 187
	X_SC_LEVEL1_DCACHE_SIZE     = 188
	X_SC_LEVEL1_DCACHE_ASSOC    = 189
	X_SC_LEVEL1_DCACHE_LINESIZE = 190
	X_SC_LEVEL2_CACHE_SIZE      = 191
	X_SC_LEVEL2_CACHE_ASSOC     = 192
	X_SC_LEVEL2_CACHE_LINESIZE  = 193
	X_SC_LEVEL3_CACHE_SIZE      = 194
	X_SC_LEVEL3_CACHE_ASSOC     = 195
	X_SC_LEVEL3_CACHE_LINESIZE  = 196
	X_SC_LEVEL4_CACHE_SIZE      = 197
	X_SC_LEVEL4_CACHE_ASSOC     = 198
	X_SC_LEVEL4_CACHE_LINESIZE  = 199
	// Leave room here, maybe we need a few more cache levels some day.

	X_SC_IPV6        = 235
	X_SC_RAW_SOCKETS = 236

	X_SC_V7_ILP32_OFF32  = 237
	X_SC_V7_ILP32_OFFBIG = 238
	X_SC_V7_LP64_OFF64   = 239
	X_SC_V7_LPBIG_OFFBIG = 240

	X_SC_SS_REPL_MAX = 241

	X_SC_TRACE_EVENT_NAME_MAX = 242
	X_SC_TRACE_NAME_MAX       = 243
	X_SC_TRACE_SYS_MAX        = 244
	X_SC_TRACE_USER_EVENT_MAX = 245

	X_SC_XOPEN_STREAMS = 246

	X_SC_THREAD_ROBUST_PRIO_INHERIT = 247
	X_SC_THREAD_ROBUST_PRIO_PROTECT = 248
)

// Whose usage statistics do you want?
const ( /* resource.h:158:1: */
	// The calling process.
	RUSAGE_SELF = 0

	// All of its terminated child processes.
	RUSAGE_CHILDREN = -1
)

// Priority limits.

// The type of the WHICH argument to `getpriority' and `setpriority',
//    indicating what flavor of entity the WHO argument specifies.
const ( /* resource.h:187:1: */
	PRIO_PROCESS = 0 // WHO is a process ID.
	PRIO_PGRP    = 1 // WHO is a process group ID.
	PRIO_USER    = 2
)

// Copyright (C) 1992-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Get the system-dependent definitions of structures and bit values.
// Bit values & structures for resource limits.  Linux version.
//    Copyright (C) 1994-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Transmute defines to enumerations.  The macro re-definitions are
//    necessary because some programs want to test for operating system
//    features with #ifdef RUSAGE_SELF.  In ISO C the reflexive
//    definition is a no-op.

// Kinds of resource limit.
const ( /* resource.h:31:1: */
	// Per-process CPU limit, in seconds.
	RLIMIT_CPU = 0

	// Largest file that can be created, in bytes.
	RLIMIT_FSIZE = 1

	// Maximum size of data segment, in bytes.
	RLIMIT_DATA = 2

	// Maximum size of stack segment, in bytes.
	RLIMIT_STACK = 3

	// Largest core file that can be created, in bytes.
	RLIMIT_CORE = 4

	// Largest resident set size, in bytes.
	//      This affects swapping; processes that are exceeding their
	//      resident set size will be more likely to have physical memory
	//      taken from them.
	X__RLIMIT_RSS = 5

	// Number of open files.
	RLIMIT_NOFILE   = 7
	X__RLIMIT_OFILE = 7 // BSD name for same.

	// Address space limit.
	RLIMIT_AS = 9

	// Number of processes.
	X__RLIMIT_NPROC = 6

	// Locked-in-memory address space.
	X__RLIMIT_MEMLOCK = 8

	// Maximum number of file locks.
	X__RLIMIT_LOCKS = 10

	// Maximum number of pending signals.
	X__RLIMIT_SIGPENDING = 11

	// Maximum bytes in POSIX message queues.
	X__RLIMIT_MSGQUEUE = 12

	// Maximum nice priority allowed to raise to.
	//      Nice levels 19 .. -20 correspond to 0 .. 39
	//      values of this resource limit.
	X__RLIMIT_NICE = 13

	// Maximum realtime priority allowed for non-priviledged
	//      processes.
	X__RLIMIT_RTPRIO = 14

	// Maximum CPU time in µs that a process scheduled under a real-time
	//      scheduling policy may consume without making a blocking system
	//      call before being forcibly descheduled.
	X__RLIMIT_RTTIME = 15

	X__RLIMIT_NLIMITS = 16
	X__RLIM_NLIMITS   = 16
)

// POSIX names to access some of the members.

// sigevent constants.  Linux version.
//    Copyright (C) 1997-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// `sigev_notify' values.
const ( /* sigevent-consts.h:27:1: */
	SIGEV_SIGNAL = 0 // Notify via signal.
	SIGEV_NONE   = 1 // Other notification: meaningless.
	SIGEV_THREAD = 2 // Deliver via thread creation.

	SIGEV_THREAD_ID = 4
)

// `si_code' values for SIGSEGV signal.
const ( /* siginfo-consts.h:119:1: */
	SEGV_MAPERR  = 1 // Address not mapped to object.
	SEGV_ACCERR  = 2 // Invalid permissions for mapped object.
	SEGV_BNDERR  = 3 // Bounds checking failure.
	SEGV_PKUERR  = 4 // Protection key checking failure.
	SEGV_ACCADI  = 5 // ADI not enabled for mapped object.
	SEGV_ADIDERR = 6 // Disrupting MCD error.
	SEGV_ADIPERR = 7
)

// `si_code' values for SIGBUS signal.
const ( /* siginfo-consts.h:138:1: */
	BUS_ADRALN    = 1 // Invalid address alignment.
	BUS_ADRERR    = 2 // Non-existant physical address.
	BUS_OBJERR    = 3 // Object specific hardware error.
	BUS_MCEERR_AR = 4 // Hardware memory error: action required.
	BUS_MCEERR_AO = 5
)

// `si_code' values for SIGCHLD signal.
const ( /* siginfo-consts.h:172:1: */
	CLD_EXITED    = 1 // Child has exited.
	CLD_KILLED    = 2 // Child was killed.
	CLD_DUMPED    = 3 // Child terminated abnormally.
	CLD_TRAPPED   = 4 // Traced child has trapped.
	CLD_STOPPED   = 5 // Child has stopped.
	CLD_CONTINUED = 6
)

// `si_code' values for SIGPOLL signal.
const ( /* siginfo-consts.h:189:1: */
	POLL_IN  = 1 // Data input available.
	POLL_OUT = 2 // Output buffers available.
	POLL_MSG = 3 // Input message available.
	POLL_ERR = 4 // I/O error.
	POLL_PRI = 5 // High priority input available.
	POLL_HUP = 6
)

// X/Open requires some more fields with fixed names.

// siginfo constants.  Linux version.
//    Copyright (C) 1997-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Most of these constants are uniform across all architectures, but there
//    is one exception.
// Architecture-specific adjustments to siginfo_t.  x86 version.

// Values for `si_code'.  Positive values are reserved for kernel-generated
//    signals.
const ( /* siginfo-consts.h:35:1: */
	SI_ASYNCNL  = -60 // Sent by asynch name lookup completion.
	SI_DETHREAD = -7  // Sent by execve killing subsidiary
	// 				   threads.
	SI_TKILL   = -6 // Sent by tkill.
	SI_SIGIO   = -5 // Sent by queued SIGIO.
	SI_ASYNCIO = -4 // Sent by AIO completion.
	SI_MESGQ   = -3 // Sent by real time mesq state change.
	SI_TIMER   = -2 // Sent by timer expiration.
	SI_QUEUE   = -1 // Sent by sigqueue.
	SI_USER    = 0  // Sent by kill, sigsend.
	SI_KERNEL  = 128
)

// `si_code' values for SIGILL signal.
const ( /* siginfo-consts.h:71:1: */
	ILL_ILLOPC   = 1 // Illegal opcode.
	ILL_ILLOPN   = 2 // Illegal operand.
	ILL_ILLADR   = 3 // Illegal addressing mode.
	ILL_ILLTRP   = 4 // Illegal trap.
	ILL_PRVOPC   = 5 // Privileged opcode.
	ILL_PRVREG   = 6 // Privileged register.
	ILL_COPROC   = 7 // Coprocessor error.
	ILL_BADSTK   = 8 // Internal stack error.
	ILL_BADIADDR = 9
)

// `si_code' values for SIGFPE signal.
const ( /* siginfo-consts.h:94:1: */
	FPE_INTDIV   = 1  // Integer divide by zero.
	FPE_INTOVF   = 2  // Integer overflow.
	FPE_FLTDIV   = 3  // Floating point divide by zero.
	FPE_FLTOVF   = 4  // Floating point overflow.
	FPE_FLTUND   = 5  // Floating point underflow.
	FPE_FLTRES   = 6  // Floating point inexact result.
	FPE_FLTINV   = 7  // Floating point invalid operation.
	FPE_FLTSUB   = 8  // Subscript out of range.
	FPE_FLTUNK   = 14 // Undiagnosed floating-point exception.
	FPE_CONDTRAP = 15
)

// Bits in the FLAGS argument to `send', `recv', et al.
const ( /* socket.h:200:1: */
	MSG_OOB        = 1  // Process out-of-band data.
	MSG_PEEK       = 2  // Peek at incoming messages.
	MSG_DONTROUTE  = 4  // Don't use local routing.
	MSG_CTRUNC     = 8  // Control data lost before delivery.
	MSG_PROXY      = 16 // Supply or ask second address.
	MSG_TRUNC      = 32
	MSG_DONTWAIT   = 64  // Nonblocking IO.
	MSG_EOR        = 128 // End of record.
	MSG_WAITALL    = 256 // Wait for a full request.
	MSG_FIN        = 512
	MSG_SYN        = 1024
	MSG_CONFIRM    = 2048 // Confirm path validity.
	MSG_RST        = 4096
	MSG_ERRQUEUE   = 8192      // Fetch message from error queue.
	MSG_NOSIGNAL   = 16384     // Do not generate SIGPIPE.
	MSG_MORE       = 32768     // Sender will send more.
	MSG_WAITFORONE = 65536     // Wait for at least one packet to return.
	MSG_BATCH      = 262144    // sendmmsg: more messages coming.
	MSG_ZEROCOPY   = 67108864  // Use user data in kernel path.
	MSG_FASTOPEN   = 536870912 // Send data in TCP SYN.

	MSG_CMSG_CLOEXEC = 1073741824
)

// Socket level message types.  This must match the definitions in
//    <linux/socket.h>.
const ( /* socket.h:332:1: */
	SCM_RIGHTS = 1
)

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// This operating system-specific header file defines the SOCK_*, PF_*,
//    AF_*, MSG_*, SOL_*, and SO_* constants, and the `struct sockaddr',
//    `struct msghdr', and `struct linger' types.
// System-specific socket constants and types.  Linux version.
//    Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 2.6 Primitive System Data Types	<sys/types.h>

// Type for length arguments in socket calls.

// Get the architecture-dependent definition of enum __socket_type.
// Define enum __socket_type for generic Linux.
//    Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Types of sockets.
const ( /* socket_type.h:24:1: */
	SOCK_STREAM = 1 // Sequenced, reliable, connection-based
	// 				   byte streams.
	SOCK_DGRAM = 2 // Connectionless, unreliable datagrams
	// 				   of fixed maximum length.
	SOCK_RAW       = 3 // Raw protocol interface.
	SOCK_RDM       = 4 // Reliably-delivered messages.
	SOCK_SEQPACKET = 5 // Sequenced, reliable, connection-based,
	// 				   datagrams of fixed maximum length.
	SOCK_DCCP   = 6  // Datagram Congestion Control Protocol.
	SOCK_PACKET = 10 // Linux specific way of getting packets
	// 				   at the dev level.  For writing rarp and
	// 				   other similar things on the user level.

	// Flags to be ORed into the type parameter of socket and socketpair and
	//      used for the flags parameter of paccept.

	SOCK_CLOEXEC = 524288 // Atomically set close-on-exec flag for the
	// 				   new descriptor(s).
	SOCK_NONBLOCK = 2048
)

// sigstack, sigaltstack definitions.
//    Copyright (C) 1998-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Minimum stack size for a signal handler.

// System default stack size.

// ss_flags values for stack_t.  Linux version.
//    Copyright (C) 1998-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Possible values for `ss_flags'.
const ( /* ss_flags.h:27:1: */
	SS_ONSTACK = 1
	SS_DISABLE = 2
)

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 3.2.1 Wait for Process Termination	<sys/wait.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.14 Signal handling <signal.h>

// These macros could also be defined in <stdlib.h>.
// This will define the `W*' macros for the flag
//    bits to `waitpid', `wait3', and `wait4'.
// Definitions of flag bits for `waitpid' et al.
//    Copyright (C) 1992-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Bits in the third argument to `waitpid'.

// Bits in the fourth argument to `waitid'.

// The following values are used by the `waitid' function.

// The Linux kernel defines these bare, rather than an enum,
//    which causes a conflict if the include order is reversed.

const ( /* waitflags.h:52:1: */
	P_ALL  = 0 // Wait for any child.
	P_PID  = 1 // Wait for specified process.
	P_PGID = 2
)

// The following constants should be used for the second parameter of
//    `shutdown'.
const ( /* socket.h:41:1: */
	SHUT_RD   = 0 // No more receptions.
	SHUT_WR   = 1 // No more transmissions.
	SHUT_RDWR = 2
)

// Values for the first argument to `getitimer' and `setitimer'.
const ( /* time.h:89:1: */
	// Timers run in real time.
	ITIMER_REAL = 0
	// Timers run only when the process is executing.
	ITIMER_VIRTUAL = 1
	// Timers run when the process is executing and when
	//        the system is executing on behalf of the process.
	ITIMER_PROF = 2
)

type Ptrdiff_t = int64 /* <builtin>:3:26 */

type Size_t = uint64 /* <builtin>:9:23 */

type Wchar_t = int32 /* <builtin>:15:24 */

type X__int128_t = struct {
	Flo int64
	Fhi int64
} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128
type X__uint128_t = struct {
	Flo uint64
	Fhi uint64
} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128

type X__builtin_va_list = uintptr /* <builtin>:46:14 */
type X__float128 = float64        /* <builtin>:47:21 */

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 6.5 File Control Operations	<fcntl.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// This must be early so <bits/fcntl.h> can define types winningly.

// Get __mode_t, __dev_t and __off_t  .
// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.
// Bit size of the time_t type at glibc build time, x86-64 and x32 case.
//    Copyright (C) 2018-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// For others, time size is word size.

// Convenience types.
type X__u_char = uint8   /* types.h:31:23 */
type X__u_short = uint16 /* types.h:32:28 */
type X__u_int = uint32   /* types.h:33:22 */
type X__u_long = uint64  /* types.h:34:27 */

// Fixed-size types, underlying types depend on word size and compiler.
type X__int8_t = int8     /* types.h:37:21 */
type X__uint8_t = uint8   /* types.h:38:23 */
type X__int16_t = int16   /* types.h:39:26 */
type X__uint16_t = uint16 /* types.h:40:28 */
type X__int32_t = int32   /* types.h:41:20 */
type X__uint32_t = uint32 /* types.h:42:22 */
type X__int64_t = int64   /* types.h:44:25 */
type X__uint64_t = uint64 /* types.h:45:27 */

// Smallest types with at least a given width.
type X__int_least8_t = X__int8_t     /* types.h:52:18 */
type X__uint_least8_t = X__uint8_t   /* types.h:53:19 */
type X__int_least16_t = X__int16_t   /* types.h:54:19 */
type X__uint_least16_t = X__uint16_t /* types.h:55:20 */
type X__int_least32_t = X__int32_t   /* types.h:56:19 */
type X__uint_least32_t = X__uint32_t /* types.h:57:20 */
type X__int_least64_t = X__int64_t   /* types.h:58:19 */
type X__uint_least64_t = X__uint64_t /* types.h:59:20 */

// quad_t is also 64 bits.
type X__quad_t = int64    /* types.h:63:18 */
type X__u_quad_t = uint64 /* types.h:64:27 */

// Largest integral types.
type X__intmax_t = int64   /* types.h:72:18 */
type X__uintmax_t = uint64 /* types.h:73:27 */

// The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
//    macros for each of the OS types we define below.  The definitions
//    of those macros must use the following macros for underlying types.
//    We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
//    variants of each of the following integer types on this machine.
//
// 	16		-- "natural" 16-bit type (always short)
// 	32		-- "natural" 32-bit type (always int)
// 	64		-- "natural" 64-bit type (long or long long)
// 	LONG32		-- 32-bit type, traditionally long
// 	QUAD		-- 64-bit type, traditionally long long
// 	WORD		-- natural type of __WORDSIZE bits (int or long)
// 	LONGWORD	-- type of __WORDSIZE bits, traditionally long
//
//    We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
//    conventional uses of `long' or `long long' type modifiers match the
//    types we define, even when a less-adorned type would be the same size.
//    This matters for (somewhat) portably writing printf/scanf formats for
//    these types, where using the appropriate l or ll format modifiers can
//    make the typedefs and the formats match up across all GNU platforms.  If
//    we used `long' when it's 64 bits where `long long' is expected, then the
//    compiler would warn about the formats not matching the argument types,
//    and the programmer changing them to shut up the compiler would break the
//    program's portability.
//
//    Here we assume what is presently the case in all the GCC configurations
//    we support: long long is always 64 bits, long is always word/address size,
//    and int is always 32 bits.

// No need to mark the typedef with __extension__.
// bits/typesizes.h -- underlying types for *_t.  Linux/x86-64 version.
//    Copyright (C) 2012-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// See <bits/types.h> for the meaning of these macros.  This file exists so
//    that <bits/types.h> need not vary across different GNU platforms.

// X32 kernel interface is 64-bit.

// Tell the libc code that off_t and off64_t are actually the same type
//    for all ABI purposes, even if possibly expressed as different base types
//    for C type-checking purposes.

// Same for ino_t and ino64_t.

// And for __rlim_t and __rlim64_t.

// And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.

// Number of descriptors that can fit in an `fd_set'.

// bits/time64.h -- underlying types for __time64_t.  Generic version.
//    Copyright (C) 2018-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Define __TIME64_T_TYPE so that it is always a 64-bit type.

// If we already have 64-bit time type then use it.

type X__dev_t = uint64                     /* types.h:145:25 */ // Type of device numbers.
type X__uid_t = uint32                     /* types.h:146:25 */ // Type of user identifications.
type X__gid_t = uint32                     /* types.h:147:25 */ // Type of group identifications.
type X__ino_t = uint64                     /* types.h:148:25 */ // Type of file serial numbers.
type X__ino64_t = uint64                   /* types.h:149:27 */ // Type of file serial numbers (LFS).
type X__mode_t = uint32                    /* types.h:150:26 */ // Type of file attribute bitmasks.
type X__nlink_t = uint64                   /* types.h:151:27 */ // Type of file link counts.
type X__off_t = int64                      /* types.h:152:25 */ // Type of file sizes and offsets.
type X__off64_t = int64                    /* types.h:153:27 */ // Type of file sizes and offsets (LFS).
type X__pid_t = int32                      /* types.h:154:25 */ // Type of process identifications.
type X__fsid_t = struct{ F__val [2]int32 } /* types.h:155:26 */ // Type of file system IDs.
type X__clock_t = int64                    /* types.h:156:27 */ // Type of CPU usage counts.
type X__rlim_t = uint64                    /* types.h:157:26 */ // Type for resource measurement.
type X__rlim64_t = uint64                  /* types.h:158:28 */ // Type for resource measurement (LFS).
type X__id_t = uint32                      /* types.h:159:24 */ // General type for IDs.
type X__time_t = int64                     /* types.h:160:26 */ // Seconds since the Epoch.
type X__useconds_t = uint32                /* types.h:161:30 */ // Count of microseconds.
type X__suseconds_t = int64                /* types.h:162:31 */ // Signed count of microseconds.

type X__daddr_t = int32 /* types.h:164:27 */ // The type of a disk address.
type X__key_t = int32   /* types.h:165:25 */ // Type of an IPC key.

// Clock ID used in clock and timer functions.
type X__clockid_t = int32 /* types.h:168:29 */

// Timer ID returned by `timer_create'.
type X__timer_t = uintptr /* types.h:171:12 */

// Type to represent block size.
type X__blksize_t = int64 /* types.h:174:29 */

// Types from the Large File Support interface.

// Type to count number of disk blocks.
type X__blkcnt_t = int64   /* types.h:179:28 */
type X__blkcnt64_t = int64 /* types.h:180:30 */

// Type to count file system blocks.
type X__fsblkcnt_t = uint64   /* types.h:183:30 */
type X__fsblkcnt64_t = uint64 /* types.h:184:32 */

// Type to count file system nodes.
type X__fsfilcnt_t = uint64   /* types.h:187:30 */
type X__fsfilcnt64_t = uint64 /* types.h:188:32 */

// Type of miscellaneous file system fields.
type X__fsword_t = int64 /* types.h:191:28 */

type X__ssize_t = int64 /* types.h:193:27 */ // Type of a byte count, or error.

// Signed long type used in system calls.
type X__syscall_slong_t = int64 /* types.h:196:33 */
// Unsigned long type used in system calls.
type X__syscall_ulong_t = uint64 /* types.h:198:33 */

// These few don't really vary by system, they always correspond
//    to one of the other defined types.
type X__loff_t = X__off64_t /* types.h:202:19 */ // Type of file sizes and offsets (LFS).
type X__caddr_t = uintptr   /* types.h:203:14 */

// Duplicates info from stdint.h but this is used in unistd.h.
type X__intptr_t = int64 /* types.h:206:25 */

// Duplicate info from sys/socket.h.
type X__socklen_t = uint32 /* types.h:209:23 */

// C99: An integer type that can be accessed as an atomic entity,
//    even in the presence of asynchronous interrupts.
//    It is not currently necessary for this to be machine-specific.
type X__sig_atomic_t = int32 /* types.h:214:13 */

// Seconds since the Epoch, visible to user code when time_t is too
//    narrow only for consistency with the old way of widening too-narrow
//    types.  User code should never use __time64_t.

// Get the definitions of O_*, F_*, FD_*: all the
//    numbers and flag bits for `open', `fcntl', et al.
// O_*, F_*, FD_* bit values for Linux/x86.
//    Copyright (C) 2001-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Not necessary, we always have 64-bit offsets.

type Flock = struct {
	Fl_type      int16
	Fl_whence    int16
	F__ccgo_pad1 [4]byte
	Fl_start     X__off64_t
	Fl_len       X__off64_t
	Fl_pid       X__pid_t
	F__ccgo_pad2 [4]byte
} /* fcntl.h:35:1 */

type Flock64 = struct {
	Fl_type      int16
	Fl_whence    int16
	F__ccgo_pad1 [4]byte
	Fl_start     X__off64_t
	Fl_len       X__off64_t
	Fl_pid       X__pid_t
	F__ccgo_pad2 [4]byte
} /* fcntl.h:50:1 */

// Include generic Linux declarations.
// O_*, F_*, FD_* bit values for Linux.
//    Copyright (C) 2001-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// This file contains shared definitions between Linux architectures
//    and is included by <bits/fcntl.h> to declare them.  The various
//    #ifndef cases allow the architecture specific file to define those
//    values with different values.
//
//    A minimal <bits/fcntl.h> contains just:
//
//    struct flock {...}
//    #ifdef __USE_LARGEFILE64
//    struct flock64 {...}
//    #endif
//    #include <bits/fcntl-linux.h>

// open/fcntl.

// open file description locks.
//
//    Usually record locks held by a process are released on *any* close and are
//    not inherited across a fork.
//
//    These cmd values will set locks that conflict with process-associated record
//    locks, but are "owned" by the opened file description, not the process.
//    This means that they are inherited across fork or clone with CLONE_FILES
//    like BSD (flock) locks, and they are only released automatically when the
//    last reference to the the file description against which they were acquired
//    is put.

// For now, Linux has no separate synchronicity options for read
//    operations.  We define O_RSYNC therefore as the same as O_SYNC
//    since this is a superset.

// Values for the second argument to `fcntl'.

// For F_[GET|SET]FD.

// For posix fcntl() and `l_type' field of a `struct flock' for lockf().

// For old implementation of BSD flock.

// Operations for BSD flock, also used by the kernel implementation.

// Define some more compatibility macros to be backward compatible with
//    BSD systems which did not managed to hide these kernel macros.

// Advise to `posix_fadvise'.

// Values for `*at' functions.

// Detect if open needs mode as a third argument (or for openat as a fourth
//    argument).

// POSIX.1-2001 specifies that these types are defined by <fcntl.h>.
//    Earlier POSIX standards permitted any type ending in `_t' to be defined
//    by any POSIX header, so we don't conditionalize the definitions here.
type Mode_t = X__mode_t /* fcntl.h:50:18 */

type Off_t = X__off64_t /* fcntl.h:58:19 */

type Off64_t = X__off64_t /* fcntl.h:64:19 */

type Pid_t = X__pid_t /* fcntl.h:69:17 */

// For XPG all symbols from <sys/stat.h> should also be available.
// NB: Include guard matches what <linux/time.h> uses.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Endian macros for string.h functions
//    Copyright (C) 1992-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <http://www.gnu.org/licenses/>.

// Definitions for byte order, according to significance of bytes,
//    from low addresses to high addresses.  The value is what you get by
//    putting '4' in the most significant byte, '3' in the second most
//    significant byte, '2' in the second least significant byte, and '1'
//    in the least significant byte, and then writing down one digit for
//    each byte, starting with the byte at the lowest address at the left,
//    and proceeding to the byte with the highest address at the right.

// This file defines `__BYTE_ORDER' for the particular machine.

// i386/x86_64 are little-endian.

// Some machines may need to use a different endianness for floating point
//    values.

// POSIX.1b structure for a time value.  This is like a `struct timeval' but
//    has nanoseconds instead of microseconds.
type Timespec = struct {
	Ftv_sec  X__time_t
	Ftv_nsec X__syscall_slong_t
} /* struct_timespec.h:10:1 */

// Copyright (C) 1999-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Versions of the `struct stat' data structure.

// x86-64 versions of the `xmknod' interface.

type Stat = struct {
	Fst_dev     X__dev_t
	Fst_ino     X__ino_t
	Fst_nlink   X__nlink_t
	Fst_mode    X__mode_t
	Fst_uid     X__uid_t
	Fst_gid     X__gid_t
	F__pad0     int32
	Fst_rdev    X__dev_t
	Fst_size    X__off_t
	Fst_blksize X__blksize_t
	Fst_blocks  X__blkcnt_t
	Fst_atim    struct {
		Ftv_sec  X__time_t
		Ftv_nsec X__syscall_slong_t
	}
	Fst_mtim struct {
		Ftv_sec  X__time_t
		Ftv_nsec X__syscall_slong_t
	}
	Fst_ctim struct {
		Ftv_sec  X__time_t
		Ftv_nsec X__syscall_slong_t
	}
	F__glibc_reserved [3]X__syscall_slong_t
} /* stat.h:46:1 */

// Note stat64 has the same shape as stat for x86-64.
type Stat64 = struct {
	Fst_dev     X__dev_t
	Fst_ino     X__ino64_t
	Fst_nlink   X__nlink_t
	Fst_mode    X__mode_t
	Fst_uid     X__uid_t
	Fst_gid     X__gid_t
	F__pad0     int32
	Fst_rdev    X__dev_t
	Fst_size    X__off_t
	Fst_blksize X__blksize_t
	Fst_blocks  X__blkcnt64_t
	Fst_atim    struct {
		Ftv_sec  X__time_t
		Ftv_nsec X__syscall_slong_t
	}
	Fst_mtim struct {
		Ftv_sec  X__time_t
		Ftv_nsec X__syscall_slong_t
	}
	Fst_ctim struct {
		Ftv_sec  X__time_t
		Ftv_nsec X__syscall_slong_t
	}
	F__glibc_reserved [3]X__syscall_slong_t
} /* stat.h:119:1 */

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// The Single Unix specification says that some more types are
//    available here.
type Gid_t = X__gid_t /* pwd.h:38:17 */

type Uid_t = X__uid_t /* pwd.h:43:17 */

// A record in the user database.
type Passwd = struct {
	Fpw_name   uintptr
	Fpw_passwd uintptr
	Fpw_uid    X__uid_t
	Fpw_gid    X__gid_t
	Fpw_gecos  uintptr
	Fpw_dir    uintptr
	Fpw_shell  uintptr
} /* pwd.h:49:1 */

type X_IO_FILE = struct {
	F_flags          int32
	F__ccgo_pad1     [4]byte
	F_IO_read_ptr    uintptr
	F_IO_read_end    uintptr
	F_IO_read_base   uintptr
	F_IO_write_base  uintptr
	F_IO_write_ptr   uintptr
	F_IO_write_end   uintptr
	F_IO_buf_base    uintptr
	F_IO_buf_end     uintptr
	F_IO_save_base   uintptr
	F_IO_backup_base uintptr
	F_IO_save_end    uintptr
	F_markers        uintptr
	F_chain          uintptr
	F_fileno         int32
	F_flags2         int32
	F_old_offset     X__off_t
	F_cur_column     uint16
	F_vtable_offset  int8
	F_shortbuf       [1]int8
	F__ccgo_pad2     [4]byte
	F_lock           uintptr
	F_offset         X__off64_t
	F_codecvt        uintptr
	F_wide_data      uintptr
	F_freeres_list   uintptr
	F_freeres_buf    uintptr
	F__pad5          Size_t
	F_mode           int32
	F_unused2        [20]int8
} /* FILE.h:4:1 */

// The opaque type of streams.  This is the definition used elsewhere.
type FILE = X_IO_FILE /* FILE.h:7:25 */

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.14 Signal handling <signal.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Signal number definitions.  Linux version.
//    Copyright (C) 1995-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Signal number constants.  Generic template.
//    Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Fake signal functions.

// We define here all the signal names listed in POSIX (1003.1-2008);
//    as of 1003.1-2013, no additional signals have been added by POSIX.
//    We also define here signal names that historically exist in every
//    real-world POSIX variant (e.g. SIGWINCH).
//
//    Signals in the 1-15 range are defined with their historical numbers.
//    For other signals, we use the BSD numbers.
//    There are two unallocated signal numbers in the 1-31 range: 7 and 29.
//    Signal number 0 is reserved for use as kill(pid, 0), to test whether
//    a process exists without sending it a signal.

// ISO C99 signals.

// Historical signals specified by POSIX.

// New(er) POSIX signals (1003.1-2008, 1003.1-2013).

// Nonstandard signals found in all modern POSIX systems
//    (including both BSD and Linux).

// Archaic names for compatibility.

// Not all systems support real-time signals.  bits/signum.h indicates
//    that they are supported by overriding __SIGRTMAX to a value greater
//    than __SIGRTMIN.  These constants give the kernel-level hard limits,
//    but some real-time signals may be used internally by glibc.  Do not
//    use these constants in application code; use SIGRTMIN and SIGRTMAX
//    (defined in signal.h) instead.

// Biggest signal number + 1 (including real-time signals).

// Adjustments and additions to the signal number constants for
//    most Linux systems.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// An integral type that can be modified atomically, without the
//    possibility of a signal arriving in the middle of the operation.
type Sig_atomic_t = X__sig_atomic_t /* sig_atomic_t.h:8:24 */

type X__sigset_t = struct{ F__val [16]uint64 } /* __sigset_t.h:8:3 */

// A set of signals to be blocked, unblocked, or waited for.
type Sigset_t = X__sigset_t /* sigset_t.h:7:20 */

// We need `struct timespec' later on.
// NB: Include guard matches what <linux/time.h> uses.

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.
// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Define __sigval_t.
//    Copyright (C) 1997-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Type for data associated with a signal.
type Sigval = struct {
	F__ccgo_pad1 [0]uint64
	Fsival_int   int32
	F__ccgo_pad2 [4]byte
} /* __sigval_t.h:24:1 */

type X__sigval_t = Sigval /* __sigval_t.h:30:22 */

// Some fields of siginfo_t have architecture-specific variations.
// Architecture-specific adjustments to siginfo_t.  x86 version.

type Siginfo_t = struct {
	Fsi_signo  int32
	Fsi_errno  int32
	Fsi_code   int32
	F__pad0    int32
	F_sifields struct {
		F__ccgo_pad1 [0]uint64
		F_pad        [28]int32
	}
} /* siginfo_t.h:124:5 */

// Architectures might also add architecture-specific constants.
//    These are all considered GNU extensions.

// Define __sigval_t.
//    Copyright (C) 1997-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// To avoid sigval_t (not a standard type name) having C++ name
//    mangling depending on whether the selected standard includes union
//    sigval, it should not be defined at all when using a standard for
//    which the sigval name is not reserved; in that case, headers should
//    not include <bits/types/sigval_t.h> and should use only the
//    internal __sigval_t name.

type Sigval_t = X__sigval_t /* sigval_t.h:16:20 */

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.
// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Define __sigval_t.
//    Copyright (C) 1997-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Forward declaration.
type Pthread_attr_t1 = struct {
	F__ccgo_pad1 [0]uint64
	F__size      [56]int8
} /* sigevent_t.h:17:9 */

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.
// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Define __sigval_t.
//    Copyright (C) 1997-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Forward declaration.
type Pthread_attr_t = Pthread_attr_t1 /* sigevent_t.h:17:30 */

// Structure to transport application-defined values with signals.
type Sigevent = struct {
	Fsigev_value  X__sigval_t
	Fsigev_signo  int32
	Fsigev_notify int32
	F_sigev_un    struct {
		F__ccgo_pad1 [0]uint64
		F_pad        [12]int32
	}
} /* sigevent_t.h:22:9 */

// Structure to transport application-defined values with signals.
type Sigevent_t = Sigevent /* sigevent_t.h:42:5 */

// Type of a signal handler.
type X__sighandler_t = uintptr /* signal.h:72:14 */

// 4.4 BSD uses the name `sig_t' for this.
type Sig_t = X__sighandler_t /* signal.h:190:24 */

// Get the system-specific definitions of `struct sigaction'
//    and the `SA_*' and `SIG_*'. constants.
// The proper definitions for Linux's sigaction.
//    Copyright (C) 1993-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Structure describing the action to be taken when a signal arrives.
type Sigaction = struct {
	F__sigaction_handler struct{ Fsa_handler X__sighandler_t }
	Fsa_mask             X__sigset_t
	Fsa_flags            int32
	F__ccgo_pad1         [4]byte
	Fsa_restorer         uintptr
} /* sigaction.h:27:1 */

// Get machine-dependent `struct sigcontext' and signal subcodes.
// Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

type X_fpx_sw_bytes = struct {
	Fmagic1            X__uint32_t
	Fextended_size     X__uint32_t
	Fxstate_bv         X__uint64_t
	Fxstate_size       X__uint32_t
	F__glibc_reserved1 [7]X__uint32_t
} /* sigcontext.h:31:1 */

type X_fpreg = struct {
	Fsignificand [4]uint16
	Fexponent    uint16
} /* sigcontext.h:40:1 */

type X_fpxreg = struct {
	Fsignificand       [4]uint16
	Fexponent          uint16
	F__glibc_reserved1 [3]uint16
} /* sigcontext.h:46:1 */

type X_xmmreg = struct{ Felement [4]X__uint32_t } /* sigcontext.h:53:1 */

type X_fpstate = struct {
	Fcwd       X__uint16_t
	Fswd       X__uint16_t
	Fftw       X__uint16_t
	Ffop       X__uint16_t
	Frip       X__uint64_t
	Frdp       X__uint64_t
	Fmxcsr     X__uint32_t
	Fmxcr_mask X__uint32_t
	F_st       [8]struct {
		Fsignificand       [4]uint16
		Fexponent          uint16
		F__glibc_reserved1 [3]uint16
	}
	F_xmm              [16]struct{ Felement [4]X__uint32_t }
	F__glibc_reserved1 [24]X__uint32_t
} /* sigcontext.h:123:1 */

type Sigcontext = struct {
	Fr8          X__uint64_t
	Fr9          X__uint64_t
	Fr10         X__uint64_t
	Fr11         X__uint64_t
	Fr12         X__uint64_t
	Fr13         X__uint64_t
	Fr14         X__uint64_t
	Fr15         X__uint64_t
	Frdi         X__uint64_t
	Frsi         X__uint64_t
	Frbp         X__uint64_t
	Frbx         X__uint64_t
	Frdx         X__uint64_t
	Frax         X__uint64_t
	Frcx         X__uint64_t
	Frsp         X__uint64_t
	Frip         X__uint64_t
	Feflags      X__uint64_t
	Fcs          uint16
	Fgs          uint16
	Ffs          uint16
	F__pad0      uint16
	Ferr         X__uint64_t
	Ftrapno      X__uint64_t
	Foldmask     X__uint64_t
	Fcr2         X__uint64_t
	F__184       struct{ Ffpstate uintptr }
	F__reserved1 [8]X__uint64_t
} /* sigcontext.h:139:1 */

type X_xsave_hdr = struct {
	Fxstate_bv         X__uint64_t
	F__glibc_reserved1 [2]X__uint64_t
	F__glibc_reserved2 [5]X__uint64_t
} /* sigcontext.h:177:1 */

type X_ymmh_state = struct{ Fymmh_space [64]X__uint32_t } /* sigcontext.h:184:1 */

type X_xstate = struct {
	Ffpstate struct {
		Fcwd       X__uint16_t
		Fswd       X__uint16_t
		Fftw       X__uint16_t
		Ffop       X__uint16_t
		Frip       X__uint64_t
		Frdp       X__uint64_t
		Fmxcsr     X__uint32_t
		Fmxcr_mask X__uint32_t
		F_st       [8]struct {
			Fsignificand       [4]uint16
			Fexponent          uint16
			F__glibc_reserved1 [3]uint16
		}
		F_xmm              [16]struct{ Felement [4]X__uint32_t }
		F__glibc_reserved1 [24]X__uint32_t
	}
	Fxstate_hdr struct {
		Fxstate_bv         X__uint64_t
		F__glibc_reserved1 [2]X__uint64_t
		F__glibc_reserved2 [5]X__uint64_t
	}
	Fymmh struct{ Fymmh_space [64]X__uint32_t }
} /* sigcontext.h:189:1 */

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// Define stack_t.  Linux version.
//    Copyright (C) 1998-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// Structure describing a signal stack.
type Stack_t = struct {
	Fss_sp       uintptr
	Fss_flags    int32
	F__ccgo_pad1 [4]byte
	Fss_size     Size_t
} /* stack_t.h:31:5 */

// This will define `ucontext_t' and `mcontext_t'.
// Copyright (C) 2001-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Define stack_t.  Linux version.
//    Copyright (C) 1998-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Type for general register.
type Greg_t = int64 /* ucontext.h:37:37 */

// Number of general registers.

// Container for all general registers.
type Gregset_t = [23]Greg_t /* ucontext.h:46:16 */

type X_libc_fpxreg = struct {
	Fsignificand       [4]uint16
	Fexponent          uint16
	F__glibc_reserved1 [3]uint16
} /* ucontext.h:101:1 */

type X_libc_xmmreg = struct{ Felement [4]X__uint32_t } /* ucontext.h:108:1 */

type X_libc_fpstate = struct {
	Fcwd       X__uint16_t
	Fswd       X__uint16_t
	Fftw       X__uint16_t
	Ffop       X__uint16_t
	Frip       X__uint64_t
	Frdp       X__uint64_t
	Fmxcsr     X__uint32_t
	Fmxcr_mask X__uint32_t
	F_st       [8]struct {
		Fsignificand       [4]uint16
		Fexponent          uint16
		F__glibc_reserved1 [3]uint16
	}
	F_xmm              [16]struct{ Felement [4]X__uint32_t }
	F__glibc_reserved1 [24]X__uint32_t
} /* ucontext.h:113:1 */

// Structure to describe FPU registers.
type Fpregset_t = uintptr /* ucontext.h:130:30 */

// Context to describe whole processor state.
type Mcontext_t = struct {
	Fgregs       Gregset_t
	Ffpregs      Fpregset_t
	F__reserved1 [8]uint64
} /* ucontext.h:139:3 */

// Userlevel context.
type Ucontext_t1 = struct {
	Fuc_flags     uint64
	Fuc_link      uintptr
	Fuc_stack     Stack_t
	Fuc_mcontext  Mcontext_t
	Fuc_sigmask   Sigset_t
	F__fpregs_mem struct {
		Fcwd       X__uint16_t
		Fswd       X__uint16_t
		Fftw       X__uint16_t
		Ffop       X__uint16_t
		Frip       X__uint64_t
		Frdp       X__uint64_t
		Fmxcsr     X__uint32_t
		Fmxcr_mask X__uint32_t
		F_st       [8]struct {
			Fsignificand       [4]uint16
			Fexponent          uint16
			F__glibc_reserved1 [3]uint16
		}
		F_xmm              [16]struct{ Felement [4]X__uint32_t }
		F__glibc_reserved1 [24]X__uint32_t
	}
	F__ssp [4]uint64
} /* ucontext.h:142:9 */

// Userlevel context.
type Ucontext_t = Ucontext_t1 /* ucontext.h:151:5 */

// Define struct sigstack.
//    Copyright (C) 1998-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Structure describing a signal stack (obsolete).
type Sigstack = struct {
	Fss_sp       uintptr
	Fss_onstack  int32
	F__ccgo_pad1 [4]byte
} /* struct_sigstack.h:23:1 */

// Some of the functions for handling signals in threaded programs must
//    be defined here.
// Declaration of common pthread types for all architectures.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// For internal mutex and condition variable definitions.
// Common threading primitives definitions for both POSIX and C11.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Arch-specific definitions.  Each architecture must define the following
//    macros to define the expected sizes of pthread data types:
//
//    __SIZEOF_PTHREAD_ATTR_T        - size of pthread_attr_t.
//    __SIZEOF_PTHREAD_MUTEX_T       - size of pthread_mutex_t.
//    __SIZEOF_PTHREAD_MUTEXATTR_T   - size of pthread_mutexattr_t.
//    __SIZEOF_PTHREAD_COND_T        - size of pthread_cond_t.
//    __SIZEOF_PTHREAD_CONDATTR_T    - size of pthread_condattr_t.
//    __SIZEOF_PTHREAD_RWLOCK_T      - size of pthread_rwlock_t.
//    __SIZEOF_PTHREAD_RWLOCKATTR_T  - size of pthread_rwlockattr_t.
//    __SIZEOF_PTHREAD_BARRIER_T     - size of pthread_barrier_t.
//    __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
//
//    The additional macro defines any constraint for the lock alignment
//    inside the thread structures:
//
//    __LOCK_ALIGNMENT - for internal lock/futex usage.
//
//    Same idea but for the once locking primitive:
//
//    __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.

// Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.

// Common definition of pthread_mutex_t.

type X__pthread_internal_list = struct {
	F__prev uintptr
	F__next uintptr
} /* thread-shared-types.h:49:9 */

// Some of the functions for handling signals in threaded programs must
//    be defined here.
// Declaration of common pthread types for all architectures.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// For internal mutex and condition variable definitions.
// Common threading primitives definitions for both POSIX and C11.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Arch-specific definitions.  Each architecture must define the following
//    macros to define the expected sizes of pthread data types:
//
//    __SIZEOF_PTHREAD_ATTR_T        - size of pthread_attr_t.
//    __SIZEOF_PTHREAD_MUTEX_T       - size of pthread_mutex_t.
//    __SIZEOF_PTHREAD_MUTEXATTR_T   - size of pthread_mutexattr_t.
//    __SIZEOF_PTHREAD_COND_T        - size of pthread_cond_t.
//    __SIZEOF_PTHREAD_CONDATTR_T    - size of pthread_condattr_t.
//    __SIZEOF_PTHREAD_RWLOCK_T      - size of pthread_rwlock_t.
//    __SIZEOF_PTHREAD_RWLOCKATTR_T  - size of pthread_rwlockattr_t.
//    __SIZEOF_PTHREAD_BARRIER_T     - size of pthread_barrier_t.
//    __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
//
//    The additional macro defines any constraint for the lock alignment
//    inside the thread structures:
//
//    __LOCK_ALIGNMENT - for internal lock/futex usage.
//
//    Same idea but for the once locking primitive:
//
//    __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.

// Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.

// Common definition of pthread_mutex_t.

type X__pthread_list_t = X__pthread_internal_list /* thread-shared-types.h:53:3 */

type X__pthread_internal_slist = struct{ F__next uintptr } /* thread-shared-types.h:55:9 */

type X__pthread_slist_t = X__pthread_internal_slist /* thread-shared-types.h:58:3 */

// Arch-specific mutex definitions.  A generic implementation is provided
//    by sysdeps/nptl/bits/struct_mutex.h.  If required, an architecture
//    can override it by defining:
//
//    1. struct __pthread_mutex_s (used on both pthread_mutex_t and mtx_t
//       definition).  It should contains at least the internal members
//       defined in the generic version.
//
//    2. __LOCK_ALIGNMENT for any extra attribute for internal lock used with
//       atomic operations.
//
//    3. The macro __PTHREAD_MUTEX_INITIALIZER used for static initialization.
//       It should initialize the mutex internal flag.

// x86 internal mutex struct definitions.
//    Copyright (C) 2019-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <http://www.gnu.org/licenses/>.

type X__pthread_mutex_s = struct {
	F__lock    int32
	F__count   uint32
	F__owner   int32
	F__nusers  uint32
	F__kind    int32
	F__spins   int16
	F__elision int16
	F__list    X__pthread_list_t
} /* struct_mutex.h:22:1 */

// Arch-sepecific read-write lock definitions.  A generic implementation is
//    provided by struct_rwlock.h.  If required, an architecture can override it
//    by defining:
//
//    1. struct __pthread_rwlock_arch_t (used on pthread_rwlock_t definition).
//       It should contain at least the internal members defined in the
//       generic version.
//
//    2. The macro __PTHREAD_RWLOCK_INITIALIZER used for static initialization.
//       It should initialize the rwlock internal type.

// x86 internal rwlock struct definitions.
//    Copyright (C) 2019-2020 Free Software Foundation, Inc.
//
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <http://www.gnu.org/licenses/>.

type X__pthread_rwlock_arch_t = struct {
	F__readers       uint32
	F__writers       uint32
	F__wrphase_futex uint32
	F__writers_futex uint32
	F__pad3          uint32
	F__pad4          uint32
	F__cur_writer    int32
	F__shared        int32
	F__rwelision     int8
	F__pad1          [7]uint8
	F__pad2          uint64
	F__flags         uint32
	F__ccgo_pad1     [4]byte
} /* struct_rwlock.h:23:1 */

// Common definition of pthread_cond_t.

type X__pthread_cond_s = struct {
	F__0            struct{ F__wseq uint64 }
	F__8            struct{ F__g1_start uint64 }
	F__g_refs       [2]uint32
	F__g_size       [2]uint32
	F__g1_orig_size uint32
	F__wrefs        uint32
	F__g_signals    [2]uint32
} /* thread-shared-types.h:92:1 */

// Thread identifiers.  The structure of the attribute type is not
//    exposed on purpose.
type Pthread_t = uint64 /* pthreadtypes.h:27:27 */

// Data structures for mutex handling.  The structure of the attribute
//    type is not exposed on purpose.
type Pthread_mutexattr_t = struct {
	F__ccgo_pad1 [0]uint32
	F__size      [4]int8
} /* pthreadtypes.h:36:3 */

// Data structure for condition variable handling.  The structure of
//    the attribute type is not exposed on purpose.
type Pthread_condattr_t = struct {
	F__ccgo_pad1 [0]uint32
	F__size      [4]int8
} /* pthreadtypes.h:45:3 */

// Keys for thread-specific data
type Pthread_key_t = uint32 /* pthreadtypes.h:49:22 */

// Once-only execution
type Pthread_once_t = int32 /* pthreadtypes.h:53:30 */

type Pthread_mutex_t = struct{ F__data X__pthread_mutex_s } /* pthreadtypes.h:72:3 */

type Pthread_cond_t = struct{ F__data X__pthread_cond_s } /* pthreadtypes.h:80:3 */

// Data structure for reader-writer lock variable handling.  The
//    structure of the attribute type is deliberately not exposed.
type Pthread_rwlock_t = struct{ F__data X__pthread_rwlock_arch_t } /* pthreadtypes.h:91:3 */

type Pthread_rwlockattr_t = struct {
	F__ccgo_pad1 [0]uint64
	F__size      [8]int8
} /* pthreadtypes.h:97:3 */

// POSIX spinlock data type.
type Pthread_spinlock_t = int32 /* pthreadtypes.h:103:22 */

// POSIX barriers data type.  The structure of the type is
//    deliberately not exposed.
type Pthread_barrier_t = struct {
	F__ccgo_pad1 [0]uint64
	F__size      [32]int8
} /* pthreadtypes.h:112:3 */

type Pthread_barrierattr_t = struct {
	F__ccgo_pad1 [0]uint32
	F__size      [4]int8
} /* pthreadtypes.h:118:3 */

// System-specific extensions.
// System-specific extensions of <signal.h>, Linux version.
//    Copyright (C) 2019-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Compatibility header for old-style Unix parameters and limits.
//    Copyright (C) 1995-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 2.6 Primitive System Data Types	<sys/types.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

type U_char = X__u_char     /* types.h:33:18 */
type U_short = X__u_short   /* types.h:34:19 */
type U_int = X__u_int       /* types.h:35:17 */
type U_long = X__u_long     /* types.h:36:18 */
type Quad_t = X__quad_t     /* types.h:37:18 */
type U_quad_t = X__u_quad_t /* types.h:38:20 */
type Fsid_t = X__fsid_t     /* types.h:39:18 */
type Loff_t = X__loff_t     /* types.h:42:18 */

type Ino_t = X__ino64_t   /* types.h:49:19 */
type Ino64_t = X__ino64_t /* types.h:54:19 */

type Dev_t = X__dev_t /* types.h:59:17 */

type Nlink_t = X__nlink_t /* types.h:74:19 */

type Id_t = X__id_t /* types.h:103:16 */

type Ssize_t = X__ssize_t /* types.h:108:19 */

type Daddr_t = X__daddr_t /* types.h:114:19 */
type Caddr_t = X__caddr_t /* types.h:115:19 */

type Key_t = X__key_t /* types.h:121:17 */

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Returned by `clock'.
type Clock_t = X__clock_t /* clock_t.h:7:19 */

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Clock ID used in clock and timer functions.
type Clockid_t = X__clockid_t /* clockid_t.h:7:21 */

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Returned by `time'.
type Time_t = X__time_t /* time_t.h:7:18 */

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Timer ID returned by `timer_create'.
type Timer_t = X__timer_t /* timer_t.h:7:19 */

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// Old compatibility names for C types.
type Ulong = uint64  /* types.h:148:27 */
type Ushort = uint16 /* types.h:149:28 */
type Uint = uint32   /* types.h:150:22 */

// These size-specific names are used by some of the inet code.

// Define intN_t types.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

type Int8_t = X__int8_t   /* stdint-intn.h:24:18 */
type Int16_t = X__int16_t /* stdint-intn.h:25:19 */
type Int32_t = X__int32_t /* stdint-intn.h:26:19 */
type Int64_t = X__int64_t /* stdint-intn.h:27:19 */

// These were defined by ISO C without the first `_'.
type U_int8_t = X__uint8_t   /* types.h:158:19 */
type U_int16_t = X__uint16_t /* types.h:159:20 */
type U_int32_t = X__uint32_t /* types.h:160:20 */
type U_int64_t = X__uint64_t /* types.h:161:20 */

type Register_t = int32 /* types.h:164:13 */

// It also defines `fd_set' and the FD_* macros for `select'.
// `fd_set' type and related macros, and `select'/`pselect' declarations.
//    Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Get definition of needed basic types.
// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Get __FD_* definitions.
// Copyright (C) 1997-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.

// Get sigset_t.

// Get definition of timer specification structures.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// A time value that is accurate to the nearest
//    microsecond but also has a range of years.
type Timeval = struct {
	Ftv_sec  X__time_t
	Ftv_usec X__suseconds_t
} /* struct_timeval.h:8:1 */

// NB: Include guard matches what <linux/time.h> uses.

type Suseconds_t = X__suseconds_t /* select.h:43:23 */

// The fd_set member is required to be an array of longs.
type X__fd_mask = int64 /* select.h:49:18 */

// Some versions of <linux/posix_types.h> define this macros.
// It's easier to assume 8-bit bytes than to get CHAR_BIT.

// fd_set for select and pselect.
type Fd_set = struct{ F__fds_bits [16]X__fd_mask } /* select.h:70:5 */

// Maximum number of file descriptors in `fd_set'.

// Sometimes the fd_set member is assumed to have this type.
type Fd_mask = X__fd_mask /* select.h:77:19 */

// Define some inlines helping to catch common problems.

type Blksize_t = X__blksize_t /* types.h:185:21 */

// Types from the Large File Support interface.
type Blkcnt_t = X__blkcnt64_t     /* types.h:205:22 */ // Type to count number of disk blocks.
type Fsblkcnt_t = X__fsblkcnt64_t /* types.h:209:24 */ // Type to count file system blocks.
type Fsfilcnt_t = X__fsfilcnt64_t /* types.h:213:24 */ // Type to count file system inodes.

type Blkcnt64_t = X__blkcnt64_t     /* types.h:219:22 */ // Type to count number of disk blocks.
type Fsblkcnt64_t = X__fsblkcnt64_t /* types.h:220:24 */ // Type to count file system blocks.
type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:221:24 */ // Type to count file system inodes.

// Now add the thread types.
// Declaration of common pthread types for all architectures.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1992-2020 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
// <http://www.gnu.org/licenses/>.

// This administrivia gets added to the beginning of limits.h
//    if the system has its own version of limits.h.

// We use _GCC_LIMITS_H_ because we want this not to match
//    any macros that the system's limits.h uses for its own purposes.

// Use "..." so that we find syslimits.h only in this same directory.
// syslimits.h stands for the system's own limits.h file.
//    If we can use it ok unmodified, then we install this text.
//    If fixincludes fixes it, then the fixed version is installed
//    instead of this text.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types	<limits.h>

// Handle feature test macros at the start of a header.
//    Copyright (C) 2016-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// This header is internal to glibc and should not be included outside
//    of glibc headers.  Headers including it must define
//    __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first.  This header
//    cannot have multiple include guards because ISO C feature test
//    macros depend on the definition of the macro when an affected
//    header is included, not when the first system header is
//    included.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__
//    macro.

// ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
//    macro.  Most but not all symbols enabled by that macro in TS
//    18661-1 are enabled unconditionally in C2X; the symbols in Annex F
//    still require that macro in C2X.

// ISO/IEC TS 18661-4:2015 defines the
//    __STDC_WANT_IEC_60559_FUNCS_EXT__ macro.  Other than the reduction
//    functions, the symbols from this TS are enabled unconditionally in
//    C2X.

// ISO/IEC TS 18661-3:2015 defines the
//    __STDC_WANT_IEC_60559_TYPES_EXT__ macro.

// Maximum length of any multibyte character in any locale.
//    We define this value here since the gcc header does not define
//    the correct value.

// If we are not using GNU CC we have to define all the symbols ourself.
//    Otherwise use gcc's definitions (see below).

// Get the compiler's limits.h, which defines almost all the ISO constants.
//
//     We put this #include_next outside the double inclusion check because
//     it should be possible to include this file more than once and still get
//     the definitions from gcc's header.

// The <limits.h> files in some gcc versions don't define LLONG_MIN,
//    LLONG_MAX, and ULLONG_MAX.  Instead only the values gcc defined for
//    ages are available.

// The integer width macros are not defined by GCC's <limits.h> before
//    GCC 7, or if _GNU_SOURCE rather than
//    __STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature.

// POSIX adds things to <limits.h>.
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 2.9.2 Minimum Values	Added to <limits.h>
//
//	Never include this file directly; use <limits.h> instead.

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.

// These are the standard-mandated minimum values.

// Minimum number of operations in one list I/O call.

// Minimal number of outstanding asynchronous I/O operations.

// Maximum length of arguments to `execve', including environment.

// Maximum simultaneous processes per real user ID.

// Minimal number of timer expiration overruns.

// Maximum length of a host name (not including the terminating null)
//    as returned from the GETHOSTNAME function.

// Maximum link count of a file.

// Maximum length of login name.

// Number of bytes in a terminal canonical input queue.

// Number of bytes for which space will be
//    available in a terminal input queue.

// Maximum number of message queues open for a process.

// Maximum number of supported message priorities.

// Number of bytes in a filename.

// Number of simultaneous supplementary group IDs per process.

// Number of files one process can have open at once.

// Number of bytes in a pathname.

// Number of bytes than can be written atomically to a pipe.

// The number of repeated occurrences of a BRE permitted by the
//    REGEXEC and REGCOMP functions when using the interval notation.

// Minimal number of realtime signals reserved for the application.

// Number of semaphores a process can have.

// Maximal value of a semaphore.

// Number of pending realtime signals.

// Largest value of a `ssize_t'.

// Number of streams a process can have open at once.

// The number of bytes in a symbolic link.

// The number of symbolic links that can be traversed in the
//    resolution of a pathname in the absence of a loop.

// Number of timer for a process.

// Maximum number of characters in a tty name.

// Maximum length of a timezone name (element of `tzname').

// Maximum clock resolution in nanoseconds.

// Get the implementation-specific values for the above.
// Minimum guaranteed maximum values for system limits.  Linux version.
//    Copyright (C) 1993-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public License as
//    published by the Free Software Foundation; either version 2.1 of the
//    License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; see the file COPYING.LIB.  If
//    not, see <https://www.gnu.org/licenses/>.

// The kernel header pollutes the namespace with the NR_OPEN symbol
//    and defines LINK_MAX although filesystems have different maxima.  A
//    similar thing is true for OPEN_MAX: the limit can be changed at
//    runtime and therefore the macro must not be defined.  Remove this
//    after including the header if necessary.

// The kernel sources contain a file with all the needed information.
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// Have to remove NR_OPEN?
// Have to remove LINK_MAX?
// Have to remove OPEN_MAX?
// Have to remove ARG_MAX?

// The number of data keys per process.
// This is the value this implementation supports.

// Controlling the iterations of destructors for thread-specific data.
// Number of iterations this implementation does.

// The number of threads per process.
// We have no predefined limit on the number of threads.

// Maximum amount by which a process can descrease its asynchronous I/O
//    priority level.

// Minimum size for a thread.  We are free to choose a reasonable value.

// Maximum number of timer expiration overruns.

// Maximum tty name length.

// Maximum login name length.  This is arbitrary.

// Maximum host name length.

// Maximum message queue priority level.

// Maximum value the semaphore can have.

// ssize_t is not formally required to be the signed type
//    corresponding to size_t, but it is for all configurations supported
//    by glibc.

// This value is a guaranteed minimum maximum.
//    The current maximum can be got from `sysconf'.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; include <limits.h> instead.

// The maximum `ibase' and `obase' values allowed by the `bc' utility.

// The maximum number of elements allowed in an array by the `bc' utility.

// The maximum `scale' value allowed by the `bc' utility.

// The maximum length of a string constant accepted by the `bc' utility.

// The maximum number of weights that can be assigned to an entry of
//    the LC_COLLATE `order' keyword in the locale definition file.

// The maximum number of expressions that can be nested
//    within parentheses by the `expr' utility.

// The maximum length, in bytes, of an input line.

// The maximum number of repeated occurrences of a regular expression
//    permitted when using the interval notation `\{M,N\}'.

// The maximum number of bytes in a character class name.  We have no
//    fixed limit, 2048 is a high number.

// These values are implementation-specific,
//    and may vary within the implementation.
//    Their precise values can be obtained from sysconf.

// This value is defined like this in regex.h.

// Copyright (C) 1991-2020 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
// <http://www.gnu.org/licenses/>.

// Number of bits in a `char'.

// Maximum length of a multibyte character.

// Minimum and maximum values a `signed char' can hold.

// Maximum value an `unsigned char' can hold.  (Minimum is 0).

// Minimum and maximum values a `char' can hold.

// Minimum and maximum values a `signed short int' can hold.

// Maximum value an `unsigned short int' can hold.  (Minimum is 0).

// Minimum and maximum values a `signed int' can hold.

// Maximum value an `unsigned int' can hold.  (Minimum is 0).

// Minimum and maximum values a `signed long int' can hold.
//    (Same as `int').

// Maximum value an `unsigned long int' can hold.  (Minimum is 0).

// Minimum and maximum values a `signed long long int' can hold.

// Maximum value an `unsigned long long int' can hold.  (Minimum is 0).

// This administrivia gets added to the end of limits.h
//    if the system has its own version of limits.h.

// Copyright (C) 1992-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.14 Signal handling <signal.h>

// This file defines some things in system-specific ways.
// Old-style Unix parameters and limits.  Linux version.
//    Copyright (C) 1995-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// The kernel headers define ARG_MAX.  The value is wrong, though.

// The following are not really correct but it is a value we used for a
//    long time and which seems to be usable.  People should not use NOFILE
//    and NCARGS anyway.

// BSD names for some <limits.h> values.

// Magical constants.

// Unit of `st_blocks'.

// Bit map related macros.

// Macros for counting and rounding.

// Macros for min/max.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 2.6 Primitive System Data Types	<sys/types.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 5.1.2 Directory Operations	<dirent.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// This file defines `struct dirent'.
//
//    It defines the macro `_DIRENT_HAVE_D_NAMLEN' iff there is a `d_namlen'
//    member that gives the length of `d_name'.
//
//    It defines the macro `_DIRENT_HAVE_D_RECLEN' iff there is a `d_reclen'
//    member that gives the size of the entire directory entry.
//
//    It defines the macro `_DIRENT_HAVE_D_OFF' iff there is a `d_off'
//    member that gives the file offset of the next directory entry.
//
//    It defines the macro `_DIRENT_HAVE_D_TYPE' iff there is a `d_type'
//    member that gives the type of the file.
//

// Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

type Dirent = struct {
	Fd_ino       X__ino64_t
	Fd_off       X__off64_t
	Fd_reclen    uint16
	Fd_type      uint8
	Fd_name      [256]int8
	F__ccgo_pad1 [5]byte
} /* dirent.h:22:1 */

type Dirent64 = struct {
	Fd_ino       X__ino64_t
	Fd_off       X__off64_t
	Fd_reclen    uint16
	Fd_type      uint8
	Fd_name      [256]int8
	F__ccgo_pad1 [5]byte
} /* dirent.h:37:1 */

// System-specific extensions of <dirent.h>.  Linux version.
//    Copyright (C) 2019-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//---------------------------------------------------------------------------
// Parameterize for 64-bit filesystem support.
//---------------------------------------------------------------------------

type Tcl_DirEntry = Dirent /* tclUnixPort.h:63:24 */

type Tcl_SeekOffset = Off_t /* tclUnixPort.h:83:16 */

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// `fd_set' type and related macros, and `select'/`pselect' declarations.
//    Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h>

// Structure crudely representing a timezone.
//    This is obsolete and should never be used.
type Timezone = struct {
	Ftz_minuteswest int32
	Ftz_dsttime     int32
} /* time.h:52:1 */

// Type of the second argument to `getitimer' and
//    the second and third arguments `setitimer'.
type Itimerval = struct {
	Fit_interval struct {
		Ftv_sec  X__time_t
		Ftv_usec X__suseconds_t
	}
	Fit_value struct {
		Ftv_sec  X__time_t
		Ftv_usec X__suseconds_t
	}
} /* time.h:105:1 */

type X__itimer_which_t = int32 /* time.h:118:13 */

// Convenience macros for operations on timevals.
//    NOTE: `timercmp' does not work for >= or <=.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.23 Date and time	<time.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// This defines CLOCKS_PER_SEC, which is the number of processor clock
//    ticks per second, and possibly a number of other constants.
// System-dependent timing definitions.  Linux version.
//    Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <time.h> instead.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// ISO/IEC 9899:1999 7.23.1: Components of time
//    The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is
//    the number per second of the value returned by the `clock' function.
// CAE XSH, Issue 4, Version 2: <time.h>
//    The value of CLOCKS_PER_SEC is required to be 1 million on all
//    XSI-conformant systems.

// Identifier for system-wide realtime clock.
// Monotonic system-wide clock.
// High-resolution timer from the CPU.
// Thread-specific CPU-time clock.
// Monotonic system-wide clock, not adjusted for frequency scaling.
// Identifier for system-wide realtime clock, updated only on ticks.
// Monotonic system-wide clock, updated only on ticks.
// Monotonic system-wide clock that includes time spent in suspension.
// Like CLOCK_REALTIME but also wakes suspended system.
// Like CLOCK_BOOTTIME but also wakes suspended system.
// Like CLOCK_REALTIME but in International Atomic Time.

// Flag to indicate time is absolute.

// Many of the typedefs and structs whose official home is this header
//    may also need to be defined by other headers.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// ISO C `broken-down time' structure.
type Tm = struct {
	Ftm_sec      int32
	Ftm_min      int32
	Ftm_hour     int32
	Ftm_mday     int32
	Ftm_mon      int32
	Ftm_year     int32
	Ftm_wday     int32
	Ftm_yday     int32
	Ftm_isdst    int32
	F__ccgo_pad1 [4]byte
	Ftm_gmtoff   int64
	Ftm_zone     uintptr
} /* struct_tm.h:7:1 */

// NB: Include guard matches what <linux/time.h> uses.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// NB: Include guard matches what <linux/time.h> uses.

// POSIX.1b structure for timer start values and intervals.
type Itimerspec = struct {
	Fit_interval struct {
		Ftv_sec  X__time_t
		Ftv_nsec X__syscall_slong_t
	}
	Fit_value struct {
		Ftv_sec  X__time_t
		Ftv_nsec X__syscall_slong_t
	}
} /* struct_itimerspec.h:8:1 */

// Definition of locale_t.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Definition of struct __locale_struct and __locale_t.
//    Copyright (C) 1997-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// POSIX.1-2008: the locale_t type, representing a locale context
//    (implementation-namespace version).  This type should be treated
//    as opaque by applications; some details are exposed for the sake of
//    efficiency in e.g. ctype functions.

type X__locale_struct = struct {
	F__locales       [13]uintptr
	F__ctype_b       uintptr
	F__ctype_tolower uintptr
	F__ctype_toupper uintptr
	F__names         [13]uintptr
} /* __locale_t.h:28:1 */

type X__locale_t = uintptr /* __locale_t.h:42:32 */

type Locale_t = X__locale_t /* locale_t.h:24:20 */

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 3.2.1 Wait for Process Termination	<sys/wait.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.14 Signal handling <signal.h>

// These macros could also be defined in <stdlib.h>.
// This will define the `W*' macros for the flag
//    bits to `waitpid', `wait3', and `wait4'.
// Definitions of flag bits for `waitpid' et al.
//    Copyright (C) 1992-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Bits in the third argument to `waitpid'.

// Bits in the fourth argument to `waitid'.

// The following values are used by the `waitid' function.

// The Linux kernel defines these bare, rather than an enum,
//    which causes a conflict if the include order is reversed.

type Idtype_t = uint32 /* waitflags.h:57:3 */

// This being here makes the prototypes valid whether or not
//    we have already included <sys/resource.h> to define `struct rusage'.
type Rusage = struct {
	Fru_utime struct {
		Ftv_sec  X__time_t
		Ftv_usec X__suseconds_t
	}
	Fru_stime struct {
		Ftv_sec  X__time_t
		Ftv_usec X__suseconds_t
	}
	F__32  struct{ Fru_maxrss int64 }
	F__40  struct{ Fru_ixrss int64 }
	F__48  struct{ Fru_idrss int64 }
	F__56  struct{ Fru_isrss int64 }
	F__64  struct{ Fru_minflt int64 }
	F__72  struct{ Fru_majflt int64 }
	F__80  struct{ Fru_nswap int64 }
	F__88  struct{ Fru_inblock int64 }
	F__96  struct{ Fru_oublock int64 }
	F__104 struct{ Fru_msgsnd int64 }
	F__112 struct{ Fru_msgrcv int64 }
	F__120 struct{ Fru_nsignals int64 }
	F__128 struct{ Fru_nvcsw int64 }
	F__136 struct{ Fru_nivcsw int64 }
} /* wait.h:129:1 */

// Copyright (C) 1997-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99: 7.8 Format conversion of integer types	<inttypes.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Get the type definitions.
// Copyright (C) 1997-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99: 7.18 Integer types <stdint.h>

// Handle feature test macros at the start of a header.
//    Copyright (C) 2016-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// This header is internal to glibc and should not be included outside
//    of glibc headers.  Headers including it must define
//    __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first.  This header
//    cannot have multiple include guards because ISO C feature test
//    macros depend on the definition of the macro when an affected
//    header is included, not when the first system header is
//    included.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__
//    macro.

// ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
//    macro.  Most but not all symbols enabled by that macro in TS
//    18661-1 are enabled unconditionally in C2X; the symbols in Annex F
//    still require that macro in C2X.

// ISO/IEC TS 18661-4:2015 defines the
//    __STDC_WANT_IEC_60559_FUNCS_EXT__ macro.  Other than the reduction
//    functions, the symbols from this TS are enabled unconditionally in
//    C2X.

// ISO/IEC TS 18661-3:2015 defines the
//    __STDC_WANT_IEC_60559_TYPES_EXT__ macro.
// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// wchar_t type related definitions.
//    Copyright (C) 2000-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// The fallback definitions, for when __WCHAR_MAX__ or __WCHAR_MIN__
//    are not defined, give the right value and type as long as both int
//    and wchar_t are 32-bit types.  Adding L'\0' to a constant value
//    ensures that the type is correct; it is necessary to use (L'\0' +
//    0) rather than just L'\0' so that the type in C++ is the promoted
//    version of wchar_t rather than the distinct wchar_t type itself.
//    Because wchar_t in preprocessor #if expressions is treated as
//    intmax_t or uintmax_t, the expression (L'\0' - 1) would have the
//    wrong value for WCHAR_MAX in such expressions and so cannot be used
//    to define __WCHAR_MAX in the unsigned case.

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.

// Exact integral types.

// Signed.
// Define intN_t types.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Unsigned.
// Define uintN_t types.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

type Uint8_t = X__uint8_t   /* stdint-uintn.h:24:19 */
type Uint16_t = X__uint16_t /* stdint-uintn.h:25:20 */
type Uint32_t = X__uint32_t /* stdint-uintn.h:26:20 */
type Uint64_t = X__uint64_t /* stdint-uintn.h:27:20 */

// Small types.

// Signed.
type Int_least8_t = X__int_least8_t   /* stdint.h:43:24 */
type Int_least16_t = X__int_least16_t /* stdint.h:44:25 */
type Int_least32_t = X__int_least32_t /* stdint.h:45:25 */
type Int_least64_t = X__int_least64_t /* stdint.h:46:25 */

// Unsigned.
type Uint_least8_t = X__uint_least8_t   /* stdint.h:49:25 */
type Uint_least16_t = X__uint_least16_t /* stdint.h:50:26 */
type Uint_least32_t = X__uint_least32_t /* stdint.h:51:26 */
type Uint_least64_t = X__uint_least64_t /* stdint.h:52:26 */

// Fast types.

// Signed.
type Int_fast8_t = int8   /* stdint.h:58:22 */
type Int_fast16_t = int64 /* stdint.h:60:19 */
type Int_fast32_t = int64 /* stdint.h:61:19 */
type Int_fast64_t = int64 /* stdint.h:62:19 */

// Unsigned.
type Uint_fast8_t = uint8   /* stdint.h:71:24 */
type Uint_fast16_t = uint64 /* stdint.h:73:27 */
type Uint_fast32_t = uint64 /* stdint.h:74:27 */
type Uint_fast64_t = uint64 /* stdint.h:75:27 */

// Types for `void *' pointers.
type Intptr_t = int64   /* stdint.h:87:19 */
type Uintptr_t = uint64 /* stdint.h:90:27 */

// Largest integral types.
type Intmax_t = X__intmax_t   /* stdint.h:101:21 */
type Uintmax_t = X__uintmax_t /* stdint.h:102:22 */

// Limits of integral types.

// Minimum of signed integral types.
// Maximum of signed integral types.

// Maximum of unsigned integral types.

// Minimum of signed integral types having a minimum size.
// Maximum of signed integral types having a minimum size.

// Maximum of unsigned integral types having a minimum size.

// Minimum of fast signed integral types having a minimum size.
// Maximum of fast signed integral types having a minimum size.

// Maximum of fast unsigned integral types having a minimum size.

// Values to test for integral types holding `void *' pointer.

// Minimum for largest signed integral type.
// Maximum for largest signed integral type.

// Maximum for largest unsigned integral type.

// Limits of other integer types.

// Limits of `ptrdiff_t' type.

// Limits of `sig_atomic_t'.

// Limit of `size_t' type.

// Limits of `wchar_t'.
// These constants might also be defined in <wchar.h>.

// Limits of `wint_t'.

// Signed.

// Unsigned.

// Maximal type.

// Get a definition for wchar_t.  But we must not define wchar_t itself.
type X__gwchar_t = int32 /* inttypes.h:34:24 */

// Macros for printing format specifiers.

// Decimal notation.

// Octal notation.

// Unsigned integers.

// lowercase hexadecimal notation.

// UPPERCASE hexadecimal notation.

// Macros for printing `intmax_t' and `uintmax_t'.

// Macros for printing `intptr_t' and `uintptr_t'.

// Macros for scanning format specifiers.

// Signed decimal notation.

// Signed decimal notation.

// Unsigned decimal notation.

// Octal notation.

// Hexadecimal notation.

// Macros for scanning `intmax_t' and `uintmax_t'.

// Macros for scaning `intptr_t' and `uintptr_t'.

// We have to define the `uintmax_t' type using `ldiv_t'.
type Imaxdiv_t = struct {
	Fquot int64
	Frem  int64
} /* inttypes.h:275:5 */

// Copyright (C) 1992-2020 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
// <http://www.gnu.org/licenses/>.

// This administrivia gets added to the beginning of limits.h
//    if the system has its own version of limits.h.

// We use _GCC_LIMITS_H_ because we want this not to match
//    any macros that the system's limits.h uses for its own purposes.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 2.10 Symbolic Constants		<unistd.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// These may be used to determine what facilities are present at compile time.
//    Their values can be obtained at run time from `sysconf'.

// POSIX Standard approved as ISO/IEC 9945-1 as of September 2008.

// These are not #ifdef __USE_POSIX2 because they are
//    in the theoretically application-owned namespace.

// The utilities on GNU systems also correspond to this version.

// The utilities on GNU systems also correspond to this version.

// This symbol was required until the 2001 edition of POSIX.

// If defined, the implementation supports the
//    C Language Bindings Option.

// If defined, the implementation supports the
//    C Language Development Utilities Option.

// If defined, the implementation supports the
//    Software Development Utilities Option.

// If defined, the implementation supports the
//    creation of locales with the localedef utility.

// X/Open version number to which the library conforms.  It is selectable.

// Commands and utilities from XPG4 are available.

// We are compatible with the old published standards as well.

// The X/Open Unix extensions are available.

// The enhanced internationalization capabilities according to XPG4.2
//    are present.

// The legacy interfaces are also available.

// Get values of POSIX options:
//
//    If these symbols are defined, the corresponding features are
//    always available.  If not, they may be available sometimes.
//    The current values can be obtained with `sysconf'.
//
//    _POSIX_JOB_CONTROL		Job control is supported.
//    _POSIX_SAVED_IDS		Processes have a saved set-user-ID
// 				and a saved set-group-ID.
//    _POSIX_REALTIME_SIGNALS	Real-time, queued signals are supported.
//    _POSIX_PRIORITY_SCHEDULING	Priority scheduling is supported.
//    _POSIX_TIMERS		POSIX.4 clocks and timers are supported.
//    _POSIX_ASYNCHRONOUS_IO	Asynchronous I/O is supported.
//    _POSIX_PRIORITIZED_IO	Prioritized asynchronous I/O is supported.
//    _POSIX_SYNCHRONIZED_IO	Synchronizing file data is supported.
//    _POSIX_FSYNC			The fsync function is present.
//    _POSIX_MAPPED_FILES		Mapping of files to memory is supported.
//    _POSIX_MEMLOCK		Locking of all memory is supported.
//    _POSIX_MEMLOCK_RANGE		Locking of ranges of memory is supported.
//    _POSIX_MEMORY_PROTECTION	Setting of memory protections is supported.
//    _POSIX_MESSAGE_PASSING	POSIX.4 message queues are supported.
//    _POSIX_SEMAPHORES		POSIX.4 counting semaphores are supported.
//    _POSIX_SHARED_MEMORY_OBJECTS	POSIX.4 shared memory objects are supported.
//    _POSIX_THREADS		POSIX.1c pthreads are supported.
//    _POSIX_THREAD_ATTR_STACKADDR	Thread stack address attribute option supported.
//    _POSIX_THREAD_ATTR_STACKSIZE	Thread stack size attribute option supported.
//    _POSIX_THREAD_SAFE_FUNCTIONS	Thread-safe functions are supported.
//    _POSIX_THREAD_PRIORITY_SCHEDULING
// 				POSIX.1c thread execution scheduling supported.
//    _POSIX_THREAD_PRIO_INHERIT	Thread priority inheritance option supported.
//    _POSIX_THREAD_PRIO_PROTECT	Thread priority protection option supported.
//    _POSIX_THREAD_PROCESS_SHARED	Process-shared synchronization supported.
//    _POSIX_PII			Protocol-independent interfaces are supported.
//    _POSIX_PII_XTI		XTI protocol-indep. interfaces are supported.
//    _POSIX_PII_SOCKET		Socket protocol-indep. interfaces are supported.
//    _POSIX_PII_INTERNET		Internet family of protocols supported.
//    _POSIX_PII_INTERNET_STREAM	Connection-mode Internet protocol supported.
//    _POSIX_PII_INTERNET_DGRAM	Connectionless Internet protocol supported.
//    _POSIX_PII_OSI		ISO/OSI family of protocols supported.
//    _POSIX_PII_OSI_COTS		Connection-mode ISO/OSI service supported.
//    _POSIX_PII_OSI_CLTS		Connectionless ISO/OSI service supported.
//    _POSIX_POLL			Implementation supports `poll' function.
//    _POSIX_SELECT		Implementation supports `select' and `pselect'.
//
//    _XOPEN_REALTIME		X/Open realtime support is available.
//    _XOPEN_REALTIME_THREADS	X/Open realtime thread support is available.
//    _XOPEN_SHM			Shared memory interface according to XPG4.2.
//
//    _XBS5_ILP32_OFF32		Implementation provides environment with 32-bit
// 				int, long, pointer, and off_t types.
//    _XBS5_ILP32_OFFBIG		Implementation provides environment with 32-bit
// 				int, long, and pointer and off_t with at least
// 				64 bits.
//    _XBS5_LP64_OFF64		Implementation provides environment with 32-bit
// 				int, and 64-bit long, pointer, and off_t types.
//    _XBS5_LPBIG_OFFBIG		Implementation provides environment with at
// 				least 32 bits int and long, pointer, and off_t
// 				with at least 64 bits.
//
//    If any of these symbols is defined as -1, the corresponding option is not
//    true for any file.  If any is defined as other than -1, the corresponding
//    option is true for all files.  If a symbol is not defined at all, the value
//    for a specific file can be obtained from `pathconf' and `fpathconf'.
//
//    _POSIX_CHOWN_RESTRICTED	Only the super user can use `chown' to change
// 				the owner of a file.  `chown' can only be used
// 				to change the group ID of a file to a group of
// 				which the calling process is a member.
//    _POSIX_NO_TRUNC		Pathname components longer than
// 				NAME_MAX generate an error.
//    _POSIX_VDISABLE		If defined, if the value of an element of the
// 				`c_cc' member of `struct termios' is
// 				_POSIX_VDISABLE, no character will have the
// 				effect associated with that element.
//    _POSIX_SYNC_IO		Synchronous I/O may be performed.
//    _POSIX_ASYNC_IO		Asynchronous I/O may be performed.
//    _POSIX_PRIO_IO		Prioritized Asynchronous I/O may be performed.
//
//    Support for the Large File Support interface is not generally available.
//    If it is available the following constants are defined to one.
//    _LFS64_LARGEFILE		Low-level I/O supports large files.
//    _LFS64_STDIO			Standard I/O supports large files.
//

// Define POSIX options for Linux.
//    Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public License as
//    published by the Free Software Foundation; either version 2.1 of the
//    License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; see the file COPYING.LIB.  If
//    not, see <https://www.gnu.org/licenses/>.

// Job control is supported.

// Processes have a saved set-user-ID and a saved set-group-ID.

// Priority scheduling is not supported with the correct semantics,
//    but GNU/Linux applications expect that the corresponding interfaces
//    are available, even though the semantics do not meet the POSIX
//    requirements.  See glibc bug 14829.

// Synchronizing file data is supported.

// The fsync function is present.

// Mapping of files to memory is supported.

// Locking of all memory is supported.

// Locking of ranges of memory is supported.

// Setting of memory protections is supported.

// Some filesystems allow all users to change file ownership.

// `c_cc' member of 'struct termios' structure can be disabled by
//    using the value _POSIX_VDISABLE.

// Filenames are not silently truncated.

// X/Open realtime support is available.

// X/Open thread realtime support is available.

// XPG4.2 shared memory is supported.

// Tell we have POSIX threads.

// We have the reentrant functions described in POSIX.

// We provide priority scheduling for threads.

// We support user-defined stack sizes.

// We support user-defined stacks.

// We support priority inheritence.

// We support priority protection, though only for non-robust
//    mutexes.

// We support priority inheritence for robust mutexes.

// We do not support priority protection for robust mutexes.

// We support POSIX.1b semaphores.

// Real-time signals are supported.

// We support asynchronous I/O.
// Alternative name for Unix98.
// Support for prioritization is also available.

// The LFS support in asynchronous I/O is also available.

// The rest of the LFS is also available.

// POSIX shared memory objects are implemented.

// CPU-time clocks support needs to be checked at runtime.

// Clock support in threads must be also checked at runtime.

// GNU libc provides regular expression handling.

// Reader/Writer locks are available.

// We have a POSIX shell.

// We support the Timeouts option.

// We support spinlocks.

// The `spawn' function family is supported.

// We have POSIX timers.

// The barrier functions are available.

// POSIX message queues are available.

// Thread process-shared synchronization is supported.

// The monotonic clock might be available.

// The clock selection interfaces are available.

// Advisory information interfaces are available.

// IPv6 support is available.

// Raw socket support is available.

// We have at least one terminal.

// Neither process nor thread sporadic server interfaces is available.

// trace.h is not available.

// Typed memory objects are not available.

// Get the environment definitions from Unix98.
// Copyright (C) 1999-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.

// This header should define the following symbols under the described
//    situations.  A value `1' means that the model is always supported,
//    `-1' means it is never supported.  Undefined means it cannot be
//    statically decided.
//
//    _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
//    _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
//
//    _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
//    _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
//
//    The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
//    _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
//    _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
//    used in previous versions of the Unix standard and are available
//    only for compatibility.

// Environments with 32-bit wide pointers are optionally provided.
//    Therefore following macros aren't defined:
//    # undef _POSIX_V7_ILP32_OFF32
//    # undef _POSIX_V7_ILP32_OFFBIG
//    # undef _POSIX_V6_ILP32_OFF32
//    # undef _POSIX_V6_ILP32_OFFBIG
//    # undef _XBS5_ILP32_OFF32
//    # undef _XBS5_ILP32_OFFBIG
//    and users need to check at runtime.

// We also have no use (for now) for an environment with bigger pointers
//    and offsets.

// By default we have 64-bit wide `long int', pointers and `off_t'.

// Standard file descriptors.

// All functions that are not declared anywhere else.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// The Single Unix specification says that some more types are
//    available here.

type Useconds_t = X__useconds_t /* unistd.h:255:22 */

type Socklen_t = X__socklen_t /* unistd.h:274:21 */

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 5.6.6 Set File Access and Modification Times  <utime.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Structure describing file times.
type Utimbuf = struct {
	Factime  X__time_t
	Fmodtime X__time_t
} /* utime.h:36:1 */

//---------------------------------------------------------------------------
// Socket support stuff: This likely needs more work to parameterize for each
// system.
//---------------------------------------------------------------------------

// Declarations of socket constants, types, and functions.
//    Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Define struct iovec.
//    Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// Structure for scatter/gather I/O.
type Iovec = struct {
	Fiov_base uintptr
	Fiov_len  Size_t
} /* struct_iovec.h:26:1 */

// Protocol families.

// Address families.

// Socket level values.  Others are defined in the appropriate headers.
//
//    XXX These definitions also should go into the appropriate headers as
//    far as they are available.

// Maximum queue length specifiable by listen.

// Get the definition of the macro to define the common sockaddr members.
// Definition of struct sockaddr_* common members and sizes, generic version.
//    Copyright (C) 1995-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/socket.h> instead.

// POSIX.1g specifies this type name for the `sa_family' member.
type Sa_family_t = uint16 /* sockaddr.h:28:28 */

// This macro is used to declare the initial common members
//    of the data types used for socket addresses, `struct sockaddr',
//    `struct sockaddr_in', `struct sockaddr_un', etc.

// Size of struct sockaddr_storage.

// Structure describing a generic socket address.
type Sockaddr = struct {
	Fsa_family Sa_family_t
	Fsa_data   [14]int8
} /* socket.h:178:1 */

// Structure large enough to hold any socket address (with the historical
//    exception of AF_UNIX).

type Sockaddr_storage = struct {
	Fss_family    Sa_family_t
	F__ss_padding [118]int8
	F__ss_align   uint64
} /* socket.h:191:1 */

// Structure describing messages sent by
//    `sendmsg' and received by `recvmsg'.
type Msghdr = struct {
	Fmsg_name       uintptr
	Fmsg_namelen    Socklen_t
	F__ccgo_pad1    [4]byte
	Fmsg_iov        uintptr
	Fmsg_iovlen     Size_t
	Fmsg_control    uintptr
	Fmsg_controllen Size_t
	Fmsg_flags      int32
	F__ccgo_pad2    [4]byte
} /* socket.h:257:1 */

// Structure used for storage of ancillary data object information.
type Cmsghdr = struct {
	F__ccgo_pad1 [0]uint64
	Fcmsg_len    Size_t
	Fcmsg_level  int32
	Fcmsg_type   int32
} /* socket.h:275:1 */

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// This allows for 1024 file descriptors: if NR_OPEN is ever grown
// beyond that you'll have to change this too. But 1024 fd's seem to be
// enough even for such "real" unices like OSF/1, so hopefully this is
// one limit that doesn't have to be changed [again].
//
// Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in
// <sys/time.h> (and thus <linux/time.h>) - but this is a more logical
// place for them. Solved by having dummy defines in <sys/time.h>.

// This macro may have been defined in <gnu/types.h>. But we always
// use the one here.

type X__kernel_fd_set = struct{ Ffds_bits [16]uint64 } /* posix_types.h:27:3 */

// Type of a signal handler.
type X__kernel_sighandler_t = uintptr /* posix_types.h:30:14 */

// Type of a SYSV IPC key.
type X__kernel_key_t = int32 /* posix_types.h:33:13 */
type X__kernel_mqd_t = int32 /* posix_types.h:34:13 */

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// This file is generally used by user-level software, so you need to
// be a little careful about namespace pollution etc.  Also, we cannot
// assume GCC is being used.

type X__kernel_old_uid_t = uint16 /* posix_types_64.h:11:24 */
type X__kernel_old_gid_t = uint16 /* posix_types_64.h:12:24 */

type X__kernel_old_dev_t = uint64 /* posix_types_64.h:15:23 */

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// There seems to be no way of detecting this automatically from user
// space, so 64 bit architectures should override this in their
// bitsperlong.h. In particular, an architecture that supports
// both 32 and 64 bit user space must not rely on CONFIG_64BIT
// to decide it, but rather check a compiler provided macro.

// This file is generally used by user-level software, so you need to
// be a little careful about namespace pollution etc.
//
// First the types that are often defined in different ways across
// architectures, so that you can override them.

type X__kernel_long_t = int64   /* posix_types.h:15:15 */
type X__kernel_ulong_t = uint64 /* posix_types.h:16:23 */

type X__kernel_ino_t = X__kernel_ulong_t /* posix_types.h:20:26 */

type X__kernel_mode_t = uint32 /* posix_types.h:24:22 */

type X__kernel_pid_t = int32 /* posix_types.h:28:14 */

type X__kernel_ipc_pid_t = int32 /* posix_types.h:32:14 */

type X__kernel_uid_t = uint32 /* posix_types.h:36:22 */
type X__kernel_gid_t = uint32 /* posix_types.h:37:22 */

type X__kernel_suseconds_t = X__kernel_long_t /* posix_types.h:41:26 */

type X__kernel_daddr_t = int32 /* posix_types.h:45:14 */

type X__kernel_uid32_t = uint32 /* posix_types.h:49:22 */
type X__kernel_gid32_t = uint32 /* posix_types.h:50:22 */

// Most 32 bit architectures use "unsigned int" size_t,
// and all 64 bit architectures use "unsigned long" size_t.
type X__kernel_size_t = X__kernel_ulong_t   /* posix_types.h:72:26 */
type X__kernel_ssize_t = X__kernel_long_t   /* posix_types.h:73:25 */
type X__kernel_ptrdiff_t = X__kernel_long_t /* posix_types.h:74:25 */

type X__kernel_fsid_t = struct{ Fval [2]int32 } /* posix_types.h:81:3 */

// anything below here should be completely generic
type X__kernel_off_t = X__kernel_long_t      /* posix_types.h:87:25 */
type X__kernel_loff_t = int64                /* posix_types.h:88:19 */
type X__kernel_old_time_t = X__kernel_long_t /* posix_types.h:89:25 */
type X__kernel_time_t = X__kernel_long_t     /* posix_types.h:90:25 */
type X__kernel_time64_t = int64              /* posix_types.h:91:19 */
type X__kernel_clock_t = X__kernel_long_t    /* posix_types.h:92:25 */
type X__kernel_timer_t = int32               /* posix_types.h:93:14 */
type X__kernel_clockid_t = int32             /* posix_types.h:94:14 */
type X__kernel_caddr_t = uintptr             /* posix_types.h:95:14 */
type X__kernel_uid16_t = uint16              /* posix_types.h:96:24 */
type X__kernel_gid16_t = uint16              /* posix_types.h:97:24 */

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// Socket-level I/O control calls.

// For setsockopt(2)

// Security levels - as per NRL IPv6 - don't actually do anything

// Socket filtering

// Instruct lower device to use last 4-bytes of skb data as FCS

// on 64-bit and x32, avoid the ?: operator

// Structure used to manipulate the SO_LINGER option.
type Linger = struct {
	Fl_onoff  int32
	Fl_linger int32
} /* socket.h:361:1 */

// This is the 4.3 BSD `struct sockaddr' format, which is used as wire
//    format in the grotty old 4.3 `talk' protocol.
type Osockaddr = struct {
	Fsa_family uint16
	Fsa_data   [14]uint8
} /* struct_osockaddr.h:6:1 */

// Define some macros helping to catch buffer overflows.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 4.4 System Identification	<sys/utsname.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1995-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Length of the entries in `struct utsname' is 65.

// Linux provides as additional information in the `struct utsname'
//    the name of the current domain.  Define _UTSNAME_DOMAIN_LENGTH
//    to a value != 0 to activate this entry.

// Structure describing the system and machine.
type Utsname = struct {
	Fsysname      [65]int8
	Fnodename     [65]int8
	Frelease      [65]int8
	Fversion      [65]int8
	Fmachine      [65]int8
	F__domainname [65]int8
} /* utsname.h:48:1 */

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Define uintN_t types.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Declarations of socket constants, types, and functions.
//    Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Internet address.
type In_addr_t = Uint32_t                  /* in.h:30:18 */
type In_addr = struct{ Fs_addr In_addr_t } /* in.h:31:1 */

// Get system-specific definitions.
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Linux version.

// If the application has already included linux/in6.h from a linux-based
//    kernel then we will not define the IPv6 IPPROTO_* defines, in6_addr (nor the
//    defines), sockaddr_in6, or ipv6_mreq. Same for in6_ptkinfo or ip6_mtuinfo
//    in linux/ipv6.h. The ABI used by the linux-kernel and glibc match exactly.
//    Neither the linux kernel nor glibc should break this ABI without coordination.
//    In upstream kernel 56c176c9 the _UAPI prefix was stripped so we need to check
//    for _LINUX_IN6_H and _IPV6_H now, and keep checking the old versions for
//    maximum backwards compatibility.

// Options for use with `getsockopt' and `setsockopt' at the IP level.
//    The first word in the comment at the right is the data type used;
//    "bool" means a boolean value stored in an `int'.
// For BSD compatibility.

// TProxy original addresses

// IP_MTU_DISCOVER arguments.
// Always use interface mtu (ignores dst pmtu) but don't set DF flag.
//    Also incoming ICMP frag_needed notifications will be ignored on
//    this socket to prevent accepting spoofed ones.
// Like IP_PMTUDISC_INTERFACE but allow packets to be fragmented.

// To select the IP level.

// Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
//    The `ip_dst' field is used for the first-hop gateway when using a
//    source route (this gets put into the header proper).
type Ip_opts = struct {
	Fip_dst  struct{ Fs_addr In_addr_t }
	Fip_opts [40]int8
} /* in.h:142:1 */

// Like `struct ip_mreq' but including interface specification by index.
type Ip_mreqn = struct {
	Fimr_multiaddr struct{ Fs_addr In_addr_t }
	Fimr_address   struct{ Fs_addr In_addr_t }
	Fimr_ifindex   int32
} /* in.h:149:1 */

// Structure used for IP_PKTINFO.
type In_pktinfo = struct {
	Fipi_ifindex  int32
	Fipi_spec_dst struct{ Fs_addr In_addr_t }
	Fipi_addr     struct{ Fs_addr In_addr_t }
} /* in.h:157:1 */

// Type to represent a port.
type In_port_t = Uint16_t /* in.h:119:18 */

// Definitions of the bits in an Internet address integer.
//
//    On subnets, host and network parts are found according to
//    the subnet mask, not these masks.

// Address to accept any incoming messages.
// Address to send to all hosts.
// Address indicating an error return.

// Network number for local host loopback.
// Address to loopback in software to local host.

// Defines for Multicast INADDR.

// IPv6 address
type In6_addr = struct {
	F__in6_u struct {
		F__ccgo_pad1 [0]uint32
		F__u6_addr8  [16]Uint8_t
	}
} /* in.h:212:1 */

// ::1

// Structure describing an Internet socket address.
type Sockaddr_in = struct {
	Fsin_family Sa_family_t
	Fsin_port   In_port_t
	Fsin_addr   struct{ Fs_addr In_addr_t }
	Fsin_zero   [8]uint8
} /* in.h:238:1 */

// Ditto, for IPv6.
type Sockaddr_in6 = struct {
	Fsin6_family   Sa_family_t
	Fsin6_port     In_port_t
	Fsin6_flowinfo Uint32_t
	Fsin6_addr     struct {
		F__in6_u struct {
			F__ccgo_pad1 [0]uint32
			F__u6_addr8  [16]Uint8_t
		}
	}
	Fsin6_scope_id Uint32_t
} /* in.h:253:1 */

// IPv4 multicast request.
type Ip_mreq = struct {
	Fimr_multiaddr struct{ Fs_addr In_addr_t }
	Fimr_interface struct{ Fs_addr In_addr_t }
} /* in.h:265:1 */

type Ip_mreq_source = struct {
	Fimr_multiaddr  struct{ Fs_addr In_addr_t }
	Fimr_interface  struct{ Fs_addr In_addr_t }
	Fimr_sourceaddr struct{ Fs_addr In_addr_t }
} /* in.h:274:1 */

// Likewise, for IPv6.
type Ipv6_mreq = struct {
	Fipv6mr_multiaddr struct {
		F__in6_u struct {
			F__ccgo_pad1 [0]uint32
			F__u6_addr8  [16]Uint8_t
		}
	}
	Fipv6mr_interface uint32
} /* in.h:289:1 */

// Multicast group request.
type Group_req = struct {
	Fgr_interface Uint32_t
	F__ccgo_pad1  [4]byte
	Fgr_group     struct {
		Fss_family    Sa_family_t
		F__ss_padding [118]int8
		F__ss_align   uint64
	}
} /* in.h:301:1 */

type Group_source_req = struct {
	Fgsr_interface Uint32_t
	F__ccgo_pad1   [4]byte
	Fgsr_group     struct {
		Fss_family    Sa_family_t
		F__ss_padding [118]int8
		F__ss_align   uint64
	}
	Fgsr_source struct {
		Fss_family    Sa_family_t
		F__ss_padding [118]int8
		F__ss_align   uint64
	}
} /* in.h:310:1 */

// Full-state filter operations.
type Ip_msfilter = struct {
	Fimsf_multiaddr struct{ Fs_addr In_addr_t }
	Fimsf_interface struct{ Fs_addr In_addr_t }
	Fimsf_fmode     Uint32_t
	Fimsf_numsrc    Uint32_t
	Fimsf_slist     [1]struct{ Fs_addr In_addr_t }
} /* in.h:324:1 */

type Group_filter = struct {
	Fgf_interface Uint32_t
	F__ccgo_pad1  [4]byte
	Fgf_group     struct {
		Fss_family    Sa_family_t
		F__ss_padding [118]int8
		F__ss_align   uint64
	}
	Fgf_fmode  Uint32_t
	Fgf_numsrc Uint32_t
	Fgf_slist  [1]struct {
		Fss_family    Sa_family_t
		F__ss_padding [118]int8
		F__ss_align   uint64
	}
} /* in.h:345:1 */

// Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// All data returned by the network data base library are supplied in
//    host order and returned in network order (suitable for use in
//    system calls).

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Define uintN_t types.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// This is necessary to make this include file properly replace the
//    Sun version.
// @(#)netdb.h	2.1 88/07/29 3.9 RPCSRC
// Copyright (c) 2010, Oracle America, Inc.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
//       copyright notice, this list of conditions and the following
//       disclaimer in the documentation and/or other materials
//       provided with the distribution.
//     * Neither the name of the "Oracle America, Inc." nor the names of its
//       contributors may be used to endorse or promote products derived
//       from this software without specific prior written permission.
//
//   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
//   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
//   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
//   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
//   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
//   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
//   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
//   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
//   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
//   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
//   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// Cleaned up for GNU C library roland@gnu.ai.mit.edu:
//    added multiple inclusion protection and use of <sys/cdefs.h>.
//    In GNU this file is #include'd by <netdb.h>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

type Rpcent = struct {
	Fr_name      uintptr
	Fr_aliases   uintptr
	Fr_number    int32
	F__ccgo_pad1 [4]byte
} /* netdb.h:46:1 */

// Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Description of data base entry for a single network.  NOTE: here a
//    poor assumption is made.  The network number is expected to fit
//    into an unsigned long int variable.
type Netent = struct {
	Fn_name     uintptr
	Fn_aliases  uintptr
	Fn_addrtype int32
	Fn_net      Uint32_t
} /* netdb.h:26:1 */

// Description of data base entry for a single host.
type Hostent = struct {
	Fh_name      uintptr
	Fh_aliases   uintptr
	Fh_addrtype  int32
	Fh_length    int32
	Fh_addr_list uintptr
} /* netdb.h:98:1 */

// Description of data base entry for a single service.
type Servent = struct {
	Fs_name      uintptr
	Fs_aliases   uintptr
	Fs_port      int32
	F__ccgo_pad1 [4]byte
	Fs_proto     uintptr
} /* netdb.h:255:1 */

// Description of data base entry for a single service.
type Protoent = struct {
	Fp_name      uintptr
	Fp_aliases   uintptr
	Fp_proto     int32
	F__ccgo_pad1 [4]byte
} /* netdb.h:324:1 */

// Extension from POSIX.1:2001.
// Structure to contain information about address of a service provider.
type Addrinfo = struct {
	Fai_flags     int32
	Fai_family    int32
	Fai_socktype  int32
	Fai_protocol  int32
	Fai_addrlen   Socklen_t
	F__ccgo_pad1  [4]byte
	Fai_addr      uintptr
	Fai_canonname uintptr
	Fai_next      uintptr
} /* netdb.h:565:1 */

//---------------------------------------------------------------------------
// Darwin specifc configure overrides.
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
// The following macros and declarations represent the interface between
// generic and unix-specific parts of Tcl. Some of the macros may override
// functions declared in tclInt.h.
//---------------------------------------------------------------------------

// The default platform eol translation on Unix is TCL_TRANSLATE_LF.

//---------------------------------------------------------------------------
// The following macros have trivial definitions, allowing generic code to
// address platform-specific issues.
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
// The following defines wrap the system memory allocation routines.
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
// The following macros and declaration wrap the C runtime library functions.
//---------------------------------------------------------------------------

// Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
//    Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Get type definitions.
// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// NB: Include guard matches what <linux/time.h> uses.

// Get system specific constant and data structure definitions.
// Definitions of constants and data structure for POSIX 1003.1b-1993
//    scheduling interface.
//    Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Scheduling algorithms.

// Sched parameter structure.  Generic version.
//    Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library;  if not, see
//    <https://www.gnu.org/licenses/>.

// Data structure to describe a process' schedulability.
type Sched_param = struct{ Fsched_priority int32 } /* struct_sched_param.h:23:1 */

// Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993
//    scheduling interface.
//    Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Size definition for CPU sets.

// Type for array elements in 'cpu_set_t'.
type X__cpu_mask = uint64 /* cpu-set.h:32:25 */

// Basic access functions.

// Data structure to describe CPU mask.
type Cpu_set_t = struct{ F__bits [16]X__cpu_mask } /* cpu-set.h:42:3 */

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.23 Date and time	<time.h>

// Endian macros for string.h functions
//    Copyright (C) 1992-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <http://www.gnu.org/licenses/>.

// Declaration of common pthread types for all architectures.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 2001-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Define the machine-dependent type `jmp_buf'.  x86-64 version.

// Determine the wordsize from the preprocessor defines.

// Both x86-64 and x32 use the 64-bit system call interface.

type X__jmp_buf = [8]int64 /* setjmp.h:31:18 */

// Conditional variable handling.

// Cleanup buffers
type X_pthread_cleanup_buffer = struct {
	F__routine    uintptr
	F__arg        uintptr
	F__canceltype int32
	F__ccgo_pad1  [4]byte
	F__prev       uintptr
} /* pthread.h:155:1 */

// Cancellation handling with integration into exception handling.

type X__pthread_unwind_buf_t = struct {
	F__cancel_jmp_buf [1]struct {
		F__cancel_jmp_buf X__jmp_buf
		F__mask_was_saved int32
		F__ccgo_pad1      [4]byte
	}
	F__pad [4]uintptr
} /* pthread.h:507:3 */

// No special attributes by default.

// Structure to hold the cleanup handler information.
type X__pthread_cleanup_frame = struct {
	F__cancel_routine uintptr
	F__cancel_arg     uintptr
	F__do_it          int32
	F__cancel_type    int32
} /* pthread.h:516:1 */

// FIXME - Hyper-enormous platform assumption!

//---------------------------------------------------------------------------
// Set of MT-safe implementations of some known-to-be-MT-unsafe library calls.
// Instead of returning pointers to the static storage, those return pointers
// to the TSD data.
//---------------------------------------------------------------------------

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 9.2.2 User Database Access	<pwd.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 9.2.1 Group Database Access	<grp.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// For the Single Unix specification we must define this type here.

// The group structure.
type Group = struct {
	Fgr_name     uintptr
	Fgr_passwd   uintptr
	Fgr_gid      X__gid_t
	F__ccgo_pad1 [4]byte
	Fgr_mem      uintptr
} /* grp.h:42:1 */

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// tcl.h --
//
//	This header file describes the externally-visible facilities of the
//	Tcl interpreter.
//
// Copyright (c) 1987-1994 The Regents of the University of California.
// Copyright (c) 1993-1996 Lucent Technologies.
// Copyright (c) 1994-1998 Sun Microsystems, Inc.
// Copyright (c) 1998-2000 by Scriptics Corporation.
// Copyright (c) 2002 by Kevin B. Kenny.  All rights reserved.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// For C++ compilers, use extern "C"

// The following defines are used to indicate the various release levels.

// When version numbers change here, must also go into the following files and
// update the version numbers:
//
// library/init.tcl	(1 LOC patch)
// unix/configure.in	(2 LOC Major, 2 LOC minor, 1 LOC patch)
// win/configure.in	(as above)
// win/tcl.m4		(not patchlevel)
// README		(sections 0 and 2, with and without separator)
// macosx/Tcl-Common.xcconfig (not patchlevel) 1 LOC
// win/README		(not patchlevel) (sections 0 and 2)
// unix/tcl.spec	(1 LOC patch)
// tools/tcl.hpj.in	(not patchlevel, for windows installer)

//----------------------------------------------------------------------------
// The following definitions set up the proper options for Windows compilers.
// We use this method because there is no autoconf equivalent.

// Utility macros: STRINGIFY takes an argument and wraps it in "" (double
// quotation marks), JOIN joins two arguments.

// A special definition used to allow this header file to be included from
// windows resource files so that they can obtain version information.
// RC_INVOKED is defined by default by the windows RC tool.
//
// Resource compilers don't like all the C stuff, like typedefs and function
// declarations, that occur below, so block them out.

// Special macro to define mutexes, that doesn't do anything if we are not
// using threads.

// Tcl's public routine Tcl_FSSeek() uses the values SEEK_SET, SEEK_CUR, and
// SEEK_END, all #define'd by stdio.h .
//
// Also, many extensions need stdio.h, and they've grown accustomed to tcl.h
// providing it for them rather than #include-ing it themselves as they
// should, so also for their sake, we keep the #include to be consistent with
// prior Tcl releases.

// Define ISO C stdio on top of C++ iostreams.
//    Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.19 Input/output	<stdio.h>

// Handle feature test macros at the start of a header.
//    Copyright (C) 2016-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// This header is internal to glibc and should not be included outside
//    of glibc headers.  Headers including it must define
//    __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first.  This header
//    cannot have multiple include guards because ISO C feature test
//    macros depend on the definition of the macro when an affected
//    header is included, not when the first system header is
//    included.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__
//    macro.

// ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
//    macro.  Most but not all symbols enabled by that macro in TS
//    18661-1 are enabled unconditionally in C2X; the symbols in Annex F
//    still require that macro in C2X.

// ISO/IEC TS 18661-4:2015 defines the
//    __STDC_WANT_IEC_60559_FUNCS_EXT__ macro.  Other than the reduction
//    functions, the symbols from this TS are enabled unconditionally in
//    C2X.

// ISO/IEC TS 18661-3:2015 defines the
//    __STDC_WANT_IEC_60559_TYPES_EXT__ macro.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.15  Variable arguments  <stdarg.h>

// Define __gnuc_va_list.

type X__gnuc_va_list = X__builtin_va_list /* stdarg.h:40:27 */

// Define the standard macros for the user,
//    if this invocation was from the user program.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Integral type unchanged by default argument promotions that can
//    hold any value corresponding to members of the extended character
//    set, as well as at least one value that does not correspond to any
//    member of the extended character set.

// Conversion state information.
type X__mbstate_t = struct {
	F__count int32
	F__value struct{ F__wch uint32 }
} /* __mbstate_t.h:21:3 */

// The tag name of this struct is _G_fpos_t to preserve historic
//    C++ mangled names for functions taking fpos_t arguments.
//    That name should not be used in new code.
type X_G_fpos_t = struct {
	F__pos   X__off_t
	F__state X__mbstate_t
} /* __fpos_t.h:10:9 */

// The tag name of this struct is _G_fpos_t to preserve historic
//    C++ mangled names for functions taking fpos_t arguments.
//    That name should not be used in new code.
type X__fpos_t = X_G_fpos_t /* __fpos_t.h:14:3 */

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// The tag name of this struct is _G_fpos64_t to preserve historic
//    C++ mangled names for functions taking fpos_t and/or fpos64_t
//    arguments.  That name should not be used in new code.
type X_G_fpos64_t = struct {
	F__pos   X__off64_t
	F__state X__mbstate_t
} /* __fpos64_t.h:10:9 */

// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// The tag name of this struct is _G_fpos64_t to preserve historic
//    C++ mangled names for functions taking fpos_t and/or fpos64_t
//    arguments.  That name should not be used in new code.
type X__fpos64_t = X_G_fpos64_t /* __fpos64_t.h:14:3 */
type X__FILE = X_IO_FILE        /* __FILE.h:5:25 */

// These macros are used by bits/stdio.h and internal headers.

// Many more flag bits are defined internally.

type Va_list = X__gnuc_va_list /* stdio.h:52:24 */

// The type of the second argument to `fgetpos' and `fsetpos'.
type Fpos_t = X__fpos64_t   /* stdio.h:86:20 */
type Fpos64_t = X__fpos64_t /* stdio.h:89:20 */

// If we are compiling with optimizing read this file.  It contains
//    several optimizing inline functions and macros.

//----------------------------------------------------------------------------
// Support for functions with a variable number of arguments.
//
// The following TCL_VARARGS* macros are to support old extensions
// written for older versions of Tcl where the macros permitted
// support for the varargs.h system as well as stdarg.h .
//
// New code should just directly be written to use stdarg.h conventions.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.15  Variable arguments  <stdarg.h>

// Define __gnuc_va_list.

// Define the standard macros for the user,
//    if this invocation was from the user program.

// Define va_list, if desired, from __gnuc_va_list.
// We deliberately do not define va_list when called from
//    stdio.h, because ANSI C says that stdio.h is not supposed to define
//    va_list.  stdio.h needs to have access to that data type,
//    but must not use that name.  It should use the name __gnuc_va_list,
//    which is safe because it is reserved for the implementation.

// The macro _VA_LIST_ is the same thing used by this file in Ultrix.
//    But on BSD NET2 we must not test or define or undef it.
//    (Note that the comments in NET 2's ansi.h
//    are incorrect for _VA_LIST_--see stdio.h!)
// The macro _VA_LIST_DEFINED is used in Windows NT 3.5

// Allow a part of Tcl's API to be explicitly marked as deprecated.
//
// Used to make TIP 330/336 generate moans even if people use the
// compatibility macros. Change your code, guys! We won't support you forever.

//----------------------------------------------------------------------------
// Macros used to declare a function to be exported by a DLL. Used by Windows,
// maps to no-op declarations on non-Windows systems. The default build on
// windows is for a DLL, which causes the DLLIMPORT and DLLEXPORT macros to be
// nonempty. To build a static library, the macro STATIC_BUILD should be
// defined.
//
// Note: when building static but linking dynamically to MSVCRT we must still
//       correctly decorate the C library imported function.  Use CRTIMPORT
//       for this purpose.  _DLL is defined by the compiler when linking to
//       MSVCRT.

// These macros are used to control whether functions are being declared for
// import or export. If a function is being declared while it is being built
// to be included in a shared library, then it should have the DLLEXPORT
// storage class. If is being declared for use by a module that is going to
// link against the shared library, then it should have the DLLIMPORT storage
// class. If the symbol is being declared for a static build or for use from a
// stub library, then the storage class should be empty.
//
// The convention is that a macro called BUILD_xxxx, where xxxx is the name of
// a library we are building, is set on the compile line for sources that are
// to be placed in the library. When this macro is set, the storage class will
// be set to DLLEXPORT. At the end of the header file, the storage class will
// be reset to DLLIMPORT.

// The following _ANSI_ARGS_ macro is to support old extensions
// written for older versions of Tcl where it permitted support
// for compilers written in the pre-prototype era of C.
//
// New code should use prototypes.

// Definitions that allow this header file to be used either with or without
// ANSI C features.

// Make sure EXTERN isn't defined elsewhere.

//----------------------------------------------------------------------------
// The following code is copied from winnt.h. If we don't replicate it here,
// then <windows.h> can't be included after tcl.h, since tcl.h also defines
// VOID. This block is skipped under Cygwin and Mingw.

// Macro to use instead of "void" for arguments that must have type "void *"
// in ANSI C; maps them to type "char *" in non-ANSI systems.

// Miscellaneous declarations.

type ClientData = uintptr /* tcl.h:344:15 */

// Darwin specific configure overrides (to support fat compiles, where
// configure runs only once for multiple architectures):

// Cross-compiling 32-bit on a 64-bit platform? Then our
// configure script does the wrong thing. Correct that here.

// Define Tcl_WideInt to be a type that is (at least) 64-bits wide, and define
// Tcl_WideUInt to be the unsigned variant of that type (assuming that where
// we have one, we can have the other.)
//
// Also defines the following macros:
// TCL_WIDE_INT_IS_LONG - if wide ints are really longs (i.e. we're on a
//	LP64 system such as modern Solaris or Linux ... not including Win64)
// Tcl_WideAsLong - forgetful converter from wideInt to long.
// Tcl_LongAsWide - sign-extending converter from long to wideInt.
// Tcl_WideAsDouble - converter from wideInt to double.
// Tcl_DoubleAsWide - converter from double to wideInt.
//
// The following invariant should hold for any long value 'longVal':
//	longVal == Tcl_WideAsLong(Tcl_LongAsWide(longVal))
//
// Note on converting between Tcl_WideInt and strings. This implementation (in
// tclObj.c) depends on the function
// sprintf(...,"%" TCL_LL_MODIFIER "d",...).

type Tcl_WideInt = int64   /* tcl.h:430:28 */
type Tcl_WideUInt = uint64 /* tcl.h:431:36 */

type Tcl_StatBuf = Stat /* tcl.h:485:25 */

//----------------------------------------------------------------------------
// Data structures defined opaquely in this module. The definitions below just
// provide dummy types. A few fields are made visible in Tcl_Interp
// structures, namely those used for returning a string result from commands.
// Direct access to the result field is discouraged in Tcl 8.0. The
// interpreter result is either an object or a string, and the two values are
// kept consistent unless some C code sets interp->result directly.
// Programmers should use either the function Tcl_GetObjResult() or
// Tcl_GetStringResult() to read the interpreter's result. See the SetResult
// man page for details.
//
// Note: any change to the Tcl_Interp definition below must be mirrored in the
// "real" definition in tclInt.h.
//
// Note: Tcl_ObjCmdProc functions do not directly set result and freeProc.
// Instead, they set a Tcl_Obj member in the "real" structure that can be
// accessed with Tcl_GetObjResult() and Tcl_SetObjResult().

type Tcl_Interp1 = struct {
	FresultDontUse    uintptr
	FfreeProcDontUse  uintptr
	FerrorLineDontUse int32
	F__ccgo_pad1      [4]byte
} /* tcl.h:508:9 */

//----------------------------------------------------------------------------
// Data structures defined opaquely in this module. The definitions below just
// provide dummy types. A few fields are made visible in Tcl_Interp
// structures, namely those used for returning a string result from commands.
// Direct access to the result field is discouraged in Tcl 8.0. The
// interpreter result is either an object or a string, and the two values are
// kept consistent unless some C code sets interp->result directly.
// Programmers should use either the function Tcl_GetObjResult() or
// Tcl_GetStringResult() to read the interpreter's result. See the SetResult
// man page for details.
//
// Note: any change to the Tcl_Interp definition below must be mirrored in the
// "real" definition in tclInt.h.
//
// Note: Tcl_ObjCmdProc functions do not directly set result and freeProc.
// Instead, they set a Tcl_Obj member in the "real" structure that can be
// accessed with Tcl_GetObjResult() and Tcl_SetObjResult().

type Tcl_Interp = Tcl_Interp1 /* tcl.h:540:1 */

type Tcl_AsyncHandler = uintptr       /* tcl.h:542:34 */
type Tcl_Channel = uintptr            /* tcl.h:543:29 */
type Tcl_ChannelTypeVersion = uintptr /* tcl.h:544:40 */
type Tcl_Command = uintptr            /* tcl.h:545:29 */
type Tcl_Condition = uintptr          /* tcl.h:546:31 */
type Tcl_Dict = uintptr               /* tcl.h:547:26 */
type Tcl_EncodingState = uintptr      /* tcl.h:548:35 */
type Tcl_Encoding = uintptr           /* tcl.h:549:30 */
type Tcl_Event1 = struct {
	Fproc    uintptr
	FnextPtr uintptr
} /* tcl.h:550:9 */

type Tcl_Event = Tcl_Event1    /* tcl.h:550:26 */
type Tcl_InterpState = uintptr /* tcl.h:551:33 */
type Tcl_LoadHandle_ = struct {
	FclientData        ClientData
	FfindSymbolProcPtr uintptr
	FunloadFileProcPtr uintptr
} /* tcl.h:552:9 */

type Tcl_LoadHandle = uintptr    /* tcl.h:552:32 */
type Tcl_Mutex = uintptr         /* tcl.h:553:27 */
type Tcl_Pid = uintptr           /* tcl.h:554:25 */
type Tcl_RegExp = uintptr        /* tcl.h:555:28 */
type Tcl_ThreadDataKey = uintptr /* tcl.h:556:35 */
type Tcl_ThreadId = uintptr      /* tcl.h:557:30 */
type Tcl_TimerToken = uintptr    /* tcl.h:558:32 */
type Tcl_Trace = uintptr         /* tcl.h:559:27 */
type Tcl_Var = uintptr           /* tcl.h:560:25 */
type Tcl_ZlibStream = uintptr    /* tcl.h:561:32 */

// Threading function return types used for abstracting away platform
// differences when writing a Tcl_ThreadCreateProc. See the NewThread function
// in generic/tclThreadTest.c for it's usage.

// Definition of values for default stacksize and the possible flags to be
// given to Tcl_CreateThread.

// Flag values passed to Tcl_StringCaseMatch.

// Flag values passed to Tcl_GetRegExpFromObj.

// Flags values passed to Tcl_RegExpExecObj.

// Structures filled in by Tcl_RegExpInfo. Note that all offset values are
// relative to the start of the match string, not the beginning of the entire
// string.

type Tcl_RegExpIndices1 = struct {
	Fstart int64
	Fend   int64
} /* tcl.h:638:9 */

// Threading function return types used for abstracting away platform
// differences when writing a Tcl_ThreadCreateProc. See the NewThread function
// in generic/tclThreadTest.c for it's usage.

// Definition of values for default stacksize and the possible flags to be
// given to Tcl_CreateThread.

// Flag values passed to Tcl_StringCaseMatch.

// Flag values passed to Tcl_GetRegExpFromObj.

// Flags values passed to Tcl_RegExpExecObj.

// Structures filled in by Tcl_RegExpInfo. Note that all offset values are
// relative to the start of the match string, not the beginning of the entire
// string.

type Tcl_RegExpIndices = Tcl_RegExpIndices1 /* tcl.h:643:3 */

type Tcl_RegExpInfo1 = struct {
	Fnsubs       int32
	F__ccgo_pad1 [4]byte
	Fmatches     uintptr
	FextendStart int64
	Freserved    int64
} /* tcl.h:645:9 */

type Tcl_RegExpInfo = Tcl_RegExpInfo1 /* tcl.h:652:3 */

// Picky compilers complain if this typdef doesn't appear before the struct's
// reference in tclDecls.h.

type Tcl_Stat_ = uintptr    /* tcl.h:659:21 */
type Tcl_OldStat_ = uintptr /* tcl.h:660:21 */

//----------------------------------------------------------------------------
// When a TCL command returns, the interpreter contains a result from the
// command. Programmers are strongly encouraged to use one of the functions
// Tcl_GetObjResult() or Tcl_GetStringResult() to read the interpreter's
// result. See the SetResult man page for details. Besides this result, the
// command function returns an integer code, which is one of the following:
//
// TCL_OK		Command completed normally; the interpreter's result
//			contains the command's result.
// TCL_ERROR		The command couldn't be completed successfully; the
//			interpreter's result describes what went wrong.
// TCL_RETURN		The command requests that the current function return;
//			the interpreter's result contains the function's
//			return value.
// TCL_BREAK		The command requests that the innermost loop be
//			exited; the interpreter's result is meaningless.
// TCL_CONTINUE		Go on to the next iteration of the current loop; the
//			interpreter's result is meaningless.

//----------------------------------------------------------------------------
// Flags to control what substitutions are performed by Tcl_SubstObj():

// Argument descriptors for math function callbacks in expressions:

type Tcl_ValueType = uint32 /* tcl.h:707:3 */

type Tcl_Value1 = struct {
	Ftype        Tcl_ValueType
	F__ccgo_pad1 [4]byte
	FintValue    int64
	FdoubleValue float64
	FwideValue   Tcl_WideInt
} /* tcl.h:709:9 */

type Tcl_Value = Tcl_Value1 /* tcl.h:715:3 */

// Forward declaration of Tcl_Obj to prevent an error when the forward
// reference to Tcl_Obj is encountered in the function types declared below.

type Tcl_Obj1 = struct {
	FrefCount    int32
	F__ccgo_pad1 [4]byte
	Fbytes       uintptr
	Flength      int32
	F__ccgo_pad2 [4]byte
	FtypePtr     uintptr
	FinternalRep struct {
		FlongValue   int64
		F__ccgo_pad1 [8]byte
	}
} /* tcl.h:722:1 */

//----------------------------------------------------------------------------
// The following structure represents a type of object, which is a particular
// internal representation for an object plus a set of functions that provide
// standard operations on objects of that type.

type Tcl_ObjType1 = struct {
	Fname             uintptr
	FfreeIntRepProc   uintptr
	FdupIntRepProc    uintptr
	FupdateStringProc uintptr
	FsetFromAnyProc   uintptr
} /* tcl.h:722:1 */

//----------------------------------------------------------------------------
// The following structure represents a type of object, which is a particular
// internal representation for an object plus a set of functions that provide
// standard operations on objects of that type.

type Tcl_ObjType = Tcl_ObjType1 /* tcl.h:811:3 */

// One of the following structures exists for each object in the Tcl system.
// An object stores a value as either a string, some internal representation,
// or both.

type Tcl_Obj = Tcl_Obj1 /* tcl.h:858:3 */

//----------------------------------------------------------------------------
// The following structure contains the state needed by Tcl_SaveResult. No-one
// outside of Tcl should access any of these fields. This structure is
// typically allocated on the stack.

type Tcl_SavedResult1 = struct {
	Fresult       uintptr
	FfreeProc     uintptr
	FobjResultPtr uintptr
	FappendResult uintptr
	FappendAvl    int32
	FappendUsed   int32
	FresultSpace  [201]int8
	F__ccgo_pad1  [7]byte
} /* tcl.h:879:9 */

//----------------------------------------------------------------------------
// The following structure contains the state needed by Tcl_SaveResult. No-one
// outside of Tcl should access any of these fields. This structure is
// typically allocated on the stack.

type Tcl_SavedResult = Tcl_SavedResult1 /* tcl.h:887:3 */

//----------------------------------------------------------------------------
// The following definitions support Tcl's namespace facility. Note: the first
// five fields must match exactly the fields in a Namespace structure (see
// tclInt.h).

type Tcl_Namespace1 = struct {
	Fname       uintptr
	FfullName   uintptr
	FclientData ClientData
	FdeleteProc uintptr
	FparentPtr  uintptr
} /* tcl.h:896:9 */

//----------------------------------------------------------------------------
// The following definitions support Tcl's namespace facility. Note: the first
// five fields must match exactly the fields in a Namespace structure (see
// tclInt.h).

type Tcl_Namespace = Tcl_Namespace1 /* tcl.h:912:3 */

//----------------------------------------------------------------------------
// The following structure represents a call frame, or activation record. A
// call frame defines a naming context for a procedure call: its local scope
// (for local variables) and its namespace scope (used for non-local
// variables; often the global :: namespace). A call frame can also define the
// naming context for a namespace eval or namespace inscope command: the
// namespace in which the command's code should execute. The Tcl_CallFrame
// structures exist only while procedures or namespace eval/inscope's are
// being executed, and provide a Tcl call stack.
//
// A call frame is initialized and pushed using Tcl_PushCallFrame and popped
// using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be provided by the
// Tcl_PushCallFrame caller, and callers typically allocate them on the C call
// stack for efficiency. For this reason, Tcl_CallFrame is defined as a
// structure and not as an opaque token. However, most Tcl_CallFrame fields
// are hidden since applications should not access them directly; others are
// declared as "dummyX".
//
// WARNING!! The structure definition must be kept consistent with the
// CallFrame structure in tclInt.h. If you change one, change the other.

type Tcl_CallFrame1 = struct {
	FnsPtr       uintptr
	Fdummy1      int32
	Fdummy2      int32
	Fdummy3      uintptr
	Fdummy4      uintptr
	Fdummy5      uintptr
	Fdummy6      int32
	F__ccgo_pad1 [4]byte
	Fdummy7      uintptr
	Fdummy8      uintptr
	Fdummy9      int32
	F__ccgo_pad2 [4]byte
	Fdummy10     uintptr
	Fdummy11     uintptr
	Fdummy12     uintptr
	Fdummy13     uintptr
} /* tcl.h:937:9 */

//----------------------------------------------------------------------------
// The following structure represents a call frame, or activation record. A
// call frame defines a naming context for a procedure call: its local scope
// (for local variables) and its namespace scope (used for non-local
// variables; often the global :: namespace). A call frame can also define the
// naming context for a namespace eval or namespace inscope command: the
// namespace in which the command's code should execute. The Tcl_CallFrame
// structures exist only while procedures or namespace eval/inscope's are
// being executed, and provide a Tcl call stack.
//
// A call frame is initialized and pushed using Tcl_PushCallFrame and popped
// using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be provided by the
// Tcl_PushCallFrame caller, and callers typically allocate them on the C call
// stack for efficiency. For this reason, Tcl_CallFrame is defined as a
// structure and not as an opaque token. However, most Tcl_CallFrame fields
// are hidden since applications should not access them directly; others are
// declared as "dummyX".
//
// WARNING!! The structure definition must be kept consistent with the
// CallFrame structure in tclInt.h. If you change one, change the other.

type Tcl_CallFrame = Tcl_CallFrame1 /* tcl.h:952:3 */

//----------------------------------------------------------------------------
// Information about commands that is returned by Tcl_GetCommandInfo and
// passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based command
// function while proc is a traditional Tcl argc/argv string-based function.
// Tcl_CreateObjCommand and Tcl_CreateCommand ensure that both objProc and
// proc are non-NULL and can be called to execute the command. However, it may
// be faster to call one instead of the other. The member isNativeObjectProc
// is set to 1 if an object-based function was registered by
// Tcl_CreateObjCommand, and to 0 if a string-based function was registered by
// Tcl_CreateCommand. The other function is typically set to a compatibility
// wrapper that does string-to-object or object-to-string argument conversions
// then calls the other function.

type Tcl_CmdInfo1 = struct {
	FisNativeObjectProc int32
	F__ccgo_pad1        [4]byte
	FobjProc            uintptr
	FobjClientData      ClientData
	Fproc               uintptr
	FclientData         ClientData
	FdeleteProc         uintptr
	FdeleteData         ClientData
	FnamespacePtr       uintptr
} /* tcl.h:969:9 */

//----------------------------------------------------------------------------
// Information about commands that is returned by Tcl_GetCommandInfo and
// passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based command
// function while proc is a traditional Tcl argc/argv string-based function.
// Tcl_CreateObjCommand and Tcl_CreateCommand ensure that both objProc and
// proc are non-NULL and can be called to execute the command. However, it may
// be faster to call one instead of the other. The member isNativeObjectProc
// is set to 1 if an object-based function was registered by
// Tcl_CreateObjCommand, and to 0 if a string-based function was registered by
// Tcl_CreateCommand. The other function is typically set to a compatibility
// wrapper that does string-to-object or object-to-string argument conversions
// then calls the other function.

type Tcl_CmdInfo = Tcl_CmdInfo1 /* tcl.h:988:3 */

//----------------------------------------------------------------------------
// The structure defined below is used to hold dynamic strings. The only
// fields that clients should use are string and length, accessible via the
// macros Tcl_DStringValue and Tcl_DStringLength.

type Tcl_DString1 = struct {
	Fstring      uintptr
	Flength      int32
	FspaceAvl    int32
	FstaticSpace [200]int8
} /* tcl.h:998:9 */

//----------------------------------------------------------------------------
// The structure defined below is used to hold dynamic strings. The only
// fields that clients should use are string and length, accessible via the
// macros Tcl_DStringValue and Tcl_DStringLength.

type Tcl_DString = Tcl_DString1 /* tcl.h:1008:3 */

// Definitions for the maximum number of digits of precision that may be
// specified in the "tcl_precision" variable, and the number of bytes of
// buffer space required by Tcl_PrintDouble.

// Definition for a number of bytes of buffer space sufficient to hold the
// string representation of an integer in base 10 (assuming the existence of
// 64-bit integers).

// Flag values passed to Tcl_ConvertElement.
// TCL_DONT_USE_BRACES forces it not to enclose the element in braces, but to
//	use backslash quoting instead.
// TCL_DONT_QUOTE_HASH disables the default quoting of the '#' character. It
//	is safe to leave the hash unquoted when the element is not the first
//	element of a list, and this flag can be used by the caller to indicate
//	that condition.

// Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
// abbreviated strings.

//----------------------------------------------------------------------------
// Flag values passed to Tcl_RecordAndEval, Tcl_EvalObj, Tcl_EvalObjv.
// WARNING: these bit choices must not conflict with the bit choices for
// evalFlag bits in tclInt.h!
//
// Meanings:
//	TCL_NO_EVAL:		Just record this command
//	TCL_EVAL_GLOBAL:	Execute script in global namespace
//	TCL_EVAL_DIRECT:	Do not compile this script
//	TCL_EVAL_INVOKE:	Magical Tcl_EvalObjv mode for aliases/ensembles
//				o Run in iPtr->lookupNsPtr or global namespace
//				o Cut out of error traces
//				o Don't reset the flags controlling ensemble
//				  error message rewriting.
//	TCL_CANCEL_UNWIND:	Magical Tcl_CancelEval mode that causes the
//				stack for the script in progress to be
//				completely unwound.
//	TCL_EVAL_NOERR:	Do no exception reporting at all, just return
//				as the caller will report.

// Special freeProc values that may be passed to Tcl_SetResult (see the man
// page for details):

// Flag values passed to variable-related functions.
// WARNING: these bit choices must not conflict with the bit choice for
// TCL_CANCEL_UNWIND, above.

// Required to support old variable/vdelete/vinfo traces.
// Indicate the semantics of the result of a trace.

// Flag values for ensemble commands.

// Flag values passed to command-related functions.

// The TCL_PARSE_PART1 flag is deprecated and has no effect. The part1 is now
// always parsed whenever the part2 is NULL. (This is to avoid a common error
// when converting code to use the new object based APIs and forgetting to
// give the flag)

// Types for linked variables:

//----------------------------------------------------------------------------
// Forward declarations of Tcl_HashTable and related types.

type Tcl_HashKeyType1 = struct {
	Fversion         int32
	Fflags           int32
	FhashKeyProc     uintptr
	FcompareKeysProc uintptr
	FallocEntryProc  uintptr
	FfreeEntryProc   uintptr
} /* tcl.h:1167:9 */

// Definitions for the maximum number of digits of precision that may be
// specified in the "tcl_precision" variable, and the number of bytes of
// buffer space required by Tcl_PrintDouble.

// Definition for a number of bytes of buffer space sufficient to hold the
// string representation of an integer in base 10 (assuming the existence of
// 64-bit integers).

// Flag values passed to Tcl_ConvertElement.
// TCL_DONT_USE_BRACES forces it not to enclose the element in braces, but to
//	use backslash quoting instead.
// TCL_DONT_QUOTE_HASH disables the default quoting of the '#' character. It
//	is safe to leave the hash unquoted when the element is not the first
//	element of a list, and this flag can be used by the caller to indicate
//	that condition.

// Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
// abbreviated strings.

//----------------------------------------------------------------------------
// Flag values passed to Tcl_RecordAndEval, Tcl_EvalObj, Tcl_EvalObjv.
// WARNING: these bit choices must not conflict with the bit choices for
// evalFlag bits in tclInt.h!
//
// Meanings:
//	TCL_NO_EVAL:		Just record this command
//	TCL_EVAL_GLOBAL:	Execute script in global namespace
//	TCL_EVAL_DIRECT:	Do not compile this script
//	TCL_EVAL_INVOKE:	Magical Tcl_EvalObjv mode for aliases/ensembles
//				o Run in iPtr->lookupNsPtr or global namespace
//				o Cut out of error traces
//				o Don't reset the flags controlling ensemble
//				  error message rewriting.
//	TCL_CANCEL_UNWIND:	Magical Tcl_CancelEval mode that causes the
//				stack for the script in progress to be
//				completely unwound.
//	TCL_EVAL_NOERR:	Do no exception reporting at all, just return
//				as the caller will report.

// Special freeProc values that may be passed to Tcl_SetResult (see the man
// page for details):

// Flag values passed to variable-related functions.
// WARNING: these bit choices must not conflict with the bit choice for
// TCL_CANCEL_UNWIND, above.

// Required to support old variable/vdelete/vinfo traces.
// Indicate the semantics of the result of a trace.

// Flag values for ensemble commands.

// Flag values passed to command-related functions.

// The TCL_PARSE_PART1 flag is deprecated and has no effect. The part1 is now
// always parsed whenever the part2 is NULL. (This is to avoid a common error
// when converting code to use the new object based APIs and forgetting to
// give the flag)

// Types for linked variables:

//----------------------------------------------------------------------------
// Forward declarations of Tcl_HashTable and related types.

type Tcl_HashKeyType = Tcl_HashKeyType1 /* tcl.h:1167:32 */
type Tcl_HashTable1 = struct {
	Fbuckets       uintptr
	FstaticBuckets [4]uintptr
	FnumBuckets    int32
	FnumEntries    int32
	FrebuildSize   int32
	FdownShift     int32
	Fmask          int32
	FkeyType       int32
	FfindProc      uintptr
	FcreateProc    uintptr
	FtypePtr       uintptr
} /* tcl.h:1168:9 */

type Tcl_HashTable = Tcl_HashTable1 /* tcl.h:1168:30 */
type Tcl_HashEntry1 = struct {
	FnextPtr    uintptr
	FtablePtr   uintptr
	Fhash       uintptr
	FclientData ClientData
	Fkey        struct{ FoneWordValue uintptr }
} /* tcl.h:1168:9 */

type Tcl_HashEntry = Tcl_HashEntry1 /* tcl.h:1169:30 */

// Structure definition for information used to keep track of searches through
// hash tables:

type Tcl_HashSearch1 = struct {
	FtablePtr     uintptr
	FnextIndex    int32
	F__ccgo_pad1  [4]byte
	FnextEntryPtr uintptr
} /* tcl.h:1323:9 */

// Structure definition for information used to keep track of searches through
// hash tables:

type Tcl_HashSearch = Tcl_HashSearch1 /* tcl.h:1329:3 */

// Acceptable key types for hash tables:
//
// TCL_STRING_KEYS:		The keys are strings, they are copied into the
//				entry.
// TCL_ONE_WORD_KEYS:		The keys are pointers, the pointer is stored
//				in the entry.
// TCL_CUSTOM_TYPE_KEYS:	The keys are arbitrary types which are copied
//				into the entry.
// TCL_CUSTOM_PTR_KEYS:		The keys are pointers to arbitrary types, the
//				pointer is stored in the entry.
//
// While maintaining binary compatibility the above have to be distinct values
// as they are used to differentiate between old versions of the hash table
// which don't have a typePtr and new ones which do. Once binary compatibility
// is discarded in favour of making more wide spread changes TCL_STRING_KEYS
// can be the same as TCL_CUSTOM_TYPE_KEYS, and TCL_ONE_WORD_KEYS can be the
// same as TCL_CUSTOM_PTR_KEYS because they simply determine how the key is
// accessed from the entry and not the behaviour.

// Structure definition for information used to keep track of searches through
// dictionaries. These fields should not be accessed by code outside
// tclDictObj.c

type Tcl_DictSearch = struct {
	Fnext          uintptr
	Fepoch         int32
	F__ccgo_pad1   [4]byte
	FdictionaryPtr Tcl_Dict
} /* tcl.h:1369:3 */

// Positions to pass to Tcl_QueueEvent:

type Tcl_QueuePosition = uint32 /* tcl.h:1404:3 */

// Values to pass to Tcl_SetServiceMode to specify the behavior of notifier
// event routines.

// The following structure keeps is used to hold a time value, either as an
// absolute time (the number of seconds from the epoch) or as an elapsed time.
// On Unix systems the epoch is Midnight Jan 1, 1970 GMT.

type Tcl_Time1 = struct {
	Fsec  int64
	Fusec int64
} /* tcl.h:1420:9 */

// Values to pass to Tcl_SetServiceMode to specify the behavior of notifier
// event routines.

// The following structure keeps is used to hold a time value, either as an
// absolute time (the number of seconds from the epoch) or as an elapsed time.
// On Unix systems the epoch is Midnight Jan 1, 1970 GMT.

type Tcl_Time = Tcl_Time1 /* tcl.h:1423:3 */

// struct Tcl_ChannelType:
//
// One such structure exists for each type (kind) of channel. It collects
// together in one place all the functions that are part of the specific
// channel type.
//
// It is recommend that the Tcl_Channel* functions are used to access elements
// of this structure, instead of direct accessing.

type Tcl_ChannelType1 = struct {
	FtypeName         uintptr
	Fversion          Tcl_ChannelTypeVersion
	FcloseProc        uintptr
	FinputProc        uintptr
	FoutputProc       uintptr
	FseekProc         uintptr
	FsetOptionProc    uintptr
	FgetOptionProc    uintptr
	FwatchProc        uintptr
	FgetHandleProc    uintptr
	Fclose2Proc       uintptr
	FblockModeProc    uintptr
	FflushProc        uintptr
	FhandlerProc      uintptr
	FwideSeekProc     uintptr
	FthreadActionProc uintptr
	FtruncateProc     uintptr
} /* tcl.h:1539:9 */

// struct Tcl_ChannelType:
//
// One such structure exists for each type (kind) of channel. It collects
// together in one place all the functions that are part of the specific
// channel type.
//
// It is recommend that the Tcl_Channel* functions are used to access elements
// of this structure, instead of direct accessing.

type Tcl_ChannelType = Tcl_ChannelType1 /* tcl.h:1607:3 */

// The following flags determine whether the blockModeProc above should set
// the channel into blocking or nonblocking mode. They are passed as arguments
// to the blockModeProc function in the above structure.

//----------------------------------------------------------------------------
// Enum for different types of file paths.

type Tcl_PathType = uint32 /* tcl.h:1628:3 */

// The following structure is used to pass glob type data amongst the various
// glob routines and Tcl_FSMatchInDirectory.

type Tcl_GlobTypeData1 = struct {
	Ftype       int32
	Fperm       int32
	FmacType    uintptr
	FmacCreator uintptr
} /* tcl.h:1635:9 */

// The following structure is used to pass glob type data amongst the various
// glob routines and Tcl_FSMatchInDirectory.

type Tcl_GlobTypeData = Tcl_GlobTypeData1 /* tcl.h:1640:3 */

type Tcl_FSVersion = uintptr /* tcl.h:1715:31 */

//----------------------------------------------------------------------------
// Data structures related to hooking into the filesystem

// Filesystem version tag.  This was introduced in 8.4.

// struct Tcl_Filesystem:
//
// One such structure exists for each type (kind) of filesystem. It collects
// together the functions that form the interface for a particulr the
// filesystem. Tcl always accesses the filesystem through one of these
// structures.
//
// Not all entries need be non-NULL; any which are NULL are simply ignored.
// However, a complete filesystem should provide all of these functions. The
// explanations in the structure show the importance of each function.

type Tcl_Filesystem1 = struct {
	FtypeName                 uintptr
	FstructureLength          int32
	F__ccgo_pad1              [4]byte
	Fversion                  Tcl_FSVersion
	FpathInFilesystemProc     uintptr
	FdupInternalRepProc       uintptr
	FfreeInternalRepProc      uintptr
	FinternalToNormalizedProc uintptr
	FcreateInternalRepProc    uintptr
	FnormalizePathProc        uintptr
	FfilesystemPathTypeProc   uintptr
	FfilesystemSeparatorProc  uintptr
	FstatProc                 uintptr
	FaccessProc               uintptr
	FopenFileChannelProc      uintptr
	FmatchInDirectoryProc     uintptr
	FutimeProc                uintptr
	FlinkProc                 uintptr
	FlistVolumesProc          uintptr
	FfileAttrStringsProc      uintptr
	FfileAttrsGetProc         uintptr
	FfileAttrsSetProc         uintptr
	FcreateDirectoryProc      uintptr
	FremoveDirectoryProc      uintptr
	FdeleteFileProc           uintptr
	FcopyFileProc             uintptr
	FrenameFileProc           uintptr
	FcopyDirectoryProc        uintptr
	FlstatProc                uintptr
	FloadFileProc             uintptr
	FgetCwdProc               uintptr
	FchdirProc                uintptr
} /* tcl.h:1741:9 */

//----------------------------------------------------------------------------
// Data structures related to hooking into the filesystem

// Filesystem version tag.  This was introduced in 8.4.

// struct Tcl_Filesystem:
//
// One such structure exists for each type (kind) of filesystem. It collects
// together the functions that form the interface for a particulr the
// filesystem. Tcl always accesses the filesystem through one of these
// structures.
//
// Not all entries need be non-NULL; any which are NULL are simply ignored.
// However, a complete filesystem should provide all of these functions. The
// explanations in the structure show the importance of each function.

type Tcl_Filesystem = Tcl_Filesystem1 /* tcl.h:1860:3 */

// The following definitions are used as values for the 'linkAction' flag to
// Tcl_FSLink, or the linkProc of any filesystem. Any combination of flags can
// be given. For link creation, the linkProc should create a link which
// matches any of the types given.
//
// TCL_CREATE_SYMBOLIC_LINK -	Create a symbolic or soft link.
// TCL_CREATE_HARD_LINK -	Create a hard link.

//----------------------------------------------------------------------------
// The following structure represents the Notifier functions that you can
// override with the Tcl_SetNotifier call.

type Tcl_NotifierProcs1 = struct {
	FsetTimerProc          uintptr
	FwaitForEventProc      uintptr
	FcreateFileHandlerProc uintptr
	FdeleteFileHandlerProc uintptr
	FinitNotifierProc      uintptr
	FfinalizeNotifierProc  uintptr
	FalertNotifierProc     uintptr
	FserviceModeHookProc   uintptr
} /* tcl.h:1881:9 */

// The following definitions are used as values for the 'linkAction' flag to
// Tcl_FSLink, or the linkProc of any filesystem. Any combination of flags can
// be given. For link creation, the linkProc should create a link which
// matches any of the types given.
//
// TCL_CREATE_SYMBOLIC_LINK -	Create a symbolic or soft link.
// TCL_CREATE_HARD_LINK -	Create a hard link.

//----------------------------------------------------------------------------
// The following structure represents the Notifier functions that you can
// override with the Tcl_SetNotifier call.

type Tcl_NotifierProcs = Tcl_NotifierProcs1 /* tcl.h:1890:3 */

//----------------------------------------------------------------------------
// The following data structures and declarations are for the new Tcl parser.
//
// For each word of a command, and for each piece of a word such as a variable
// reference, one of the following structures is created to describe the
// token.

type Tcl_Token1 = struct {
	Ftype          int32
	F__ccgo_pad1   [4]byte
	Fstart         uintptr
	Fsize          int32
	FnumComponents int32
} /* tcl.h:1901:9 */

//----------------------------------------------------------------------------
// The following data structures and declarations are for the new Tcl parser.
//
// For each word of a command, and for each piece of a word such as a variable
// reference, one of the following structures is created to describe the
// token.

type Tcl_Token = Tcl_Token1 /* tcl.h:1911:3 */

// Type values defined for Tcl_Token structures. These values are defined as
// mask bits so that it's easy to check for collections of types.
//
// TCL_TOKEN_WORD -		The token describes one word of a command,
//				from the first non-blank character of the word
//				(which may be " or {) up to but not including
//				the space, semicolon, or bracket that
//				terminates the word. NumComponents counts the
//				total number of sub-tokens that make up the
//				word. This includes, for example, sub-tokens
//				of TCL_TOKEN_VARIABLE tokens.
// TCL_TOKEN_SIMPLE_WORD -	This token is just like TCL_TOKEN_WORD except
//				that the word is guaranteed to consist of a
//				single TCL_TOKEN_TEXT sub-token.
// TCL_TOKEN_TEXT -		The token describes a range of literal text
//				that is part of a word. NumComponents is
//				always 0.
// TCL_TOKEN_BS -		The token describes a backslash sequence that
//				must be collapsed. NumComponents is always 0.
// TCL_TOKEN_COMMAND -		The token describes a command whose result
//				must be substituted into the word. The token
//				includes the enclosing brackets. NumComponents
//				is always 0.
// TCL_TOKEN_VARIABLE -		The token describes a variable substitution,
//				including the dollar sign, variable name, and
//				array index (if there is one) up through the
//				right parentheses. NumComponents tells how
//				many additional tokens follow to represent the
//				variable name. The first token will be a
//				TCL_TOKEN_TEXT token that describes the
//				variable name. If the variable is an array
//				reference then there will be one or more
//				additional tokens, of type TCL_TOKEN_TEXT,
//				TCL_TOKEN_BS, TCL_TOKEN_COMMAND, and
//				TCL_TOKEN_VARIABLE, that describe the array
//				index; numComponents counts the total number
//				of nested tokens that make up the variable
//				reference, including sub-tokens of
//				TCL_TOKEN_VARIABLE tokens.
// TCL_TOKEN_SUB_EXPR -		The token describes one subexpression of an
//				expression, from the first non-blank character
//				of the subexpression up to but not including
//				the space, brace, or bracket that terminates
//				the subexpression. NumComponents counts the
//				total number of following subtokens that make
//				up the subexpression; this includes all
//				subtokens for any nested TCL_TOKEN_SUB_EXPR
//				tokens. For example, a numeric value used as a
//				primitive operand is described by a
//				TCL_TOKEN_SUB_EXPR token followed by a
//				TCL_TOKEN_TEXT token. A binary subexpression
//				is described by a TCL_TOKEN_SUB_EXPR token
//				followed by the TCL_TOKEN_OPERATOR token for
//				the operator, then TCL_TOKEN_SUB_EXPR tokens
//				for the left then the right operands.
// TCL_TOKEN_OPERATOR -		The token describes one expression operator.
//				An operator might be the name of a math
//				function such as "abs". A TCL_TOKEN_OPERATOR
//				token is always preceded by one
//				TCL_TOKEN_SUB_EXPR token for the operator's
//				subexpression, and is followed by zero or more
//				TCL_TOKEN_SUB_EXPR tokens for the operator's
//				operands. NumComponents is always 0.
// TCL_TOKEN_EXPAND_WORD -	This token is just like TCL_TOKEN_WORD except
//				that it marks a word that began with the
//				literal character prefix "{*}". This word is
//				marked to be expanded - that is, broken into
//				words after substitution is complete.

// Parsing error types. On any parsing error, one of these values will be
// stored in the error field of the Tcl_Parse structure defined below.

// A structure of the following type is filled in by Tcl_ParseCommand. It
// describes a single command parsed from an input string.

type Tcl_Parse1 = struct {
	FcommentStart    uintptr
	FcommentSize     int32
	F__ccgo_pad1     [4]byte
	FcommandStart    uintptr
	FcommandSize     int32
	FnumWords        int32
	FtokenPtr        uintptr
	FnumTokens       int32
	FtokensAvailable int32
	FerrorType       int32
	F__ccgo_pad2     [4]byte
	Fstring          uintptr
	Fend             uintptr
	Finterp          uintptr
	Fterm            uintptr
	Fincomplete      int32
	F__ccgo_pad3     [4]byte
	FstaticTokens    [20]Tcl_Token
} /* tcl.h:2017:9 */

// Type values defined for Tcl_Token structures. These values are defined as
// mask bits so that it's easy to check for collections of types.
//
// TCL_TOKEN_WORD -		The token describes one word of a command,
//				from the first non-blank character of the word
//				(which may be " or {) up to but not including
//				the space, semicolon, or bracket that
//				terminates the word. NumComponents counts the
//				total number of sub-tokens that make up the
//				word. This includes, for example, sub-tokens
//				of TCL_TOKEN_VARIABLE tokens.
// TCL_TOKEN_SIMPLE_WORD -	This token is just like TCL_TOKEN_WORD except
//				that the word is guaranteed to consist of a
//				single TCL_TOKEN_TEXT sub-token.
// TCL_TOKEN_TEXT -		The token describes a range of literal text
//				that is part of a word. NumComponents is
//				always 0.
// TCL_TOKEN_BS -		The token describes a backslash sequence that
//				must be collapsed. NumComponents is always 0.
// TCL_TOKEN_COMMAND -		The token describes a command whose result
//				must be substituted into the word. The token
//				includes the enclosing brackets. NumComponents
//				is always 0.
// TCL_TOKEN_VARIABLE -		The token describes a variable substitution,
//				including the dollar sign, variable name, and
//				array index (if there is one) up through the
//				right parentheses. NumComponents tells how
//				many additional tokens follow to represent the
//				variable name. The first token will be a
//				TCL_TOKEN_TEXT token that describes the
//				variable name. If the variable is an array
//				reference then there will be one or more
//				additional tokens, of type TCL_TOKEN_TEXT,
//				TCL_TOKEN_BS, TCL_TOKEN_COMMAND, and
//				TCL_TOKEN_VARIABLE, that describe the array
//				index; numComponents counts the total number
//				of nested tokens that make up the variable
//				reference, including sub-tokens of
//				TCL_TOKEN_VARIABLE tokens.
// TCL_TOKEN_SUB_EXPR -		The token describes one subexpression of an
//				expression, from the first non-blank character
//				of the subexpression up to but not including
//				the space, brace, or bracket that terminates
//				the subexpression. NumComponents counts the
//				total number of following subtokens that make
//				up the subexpression; this includes all
//				subtokens for any nested TCL_TOKEN_SUB_EXPR
//				tokens. For example, a numeric value used as a
//				primitive operand is described by a
//				TCL_TOKEN_SUB_EXPR token followed by a
//				TCL_TOKEN_TEXT token. A binary subexpression
//				is described by a TCL_TOKEN_SUB_EXPR token
//				followed by the TCL_TOKEN_OPERATOR token for
//				the operator, then TCL_TOKEN_SUB_EXPR tokens
//				for the left then the right operands.
// TCL_TOKEN_OPERATOR -		The token describes one expression operator.
//				An operator might be the name of a math
//				function such as "abs". A TCL_TOKEN_OPERATOR
//				token is always preceded by one
//				TCL_TOKEN_SUB_EXPR token for the operator's
//				subexpression, and is followed by zero or more
//				TCL_TOKEN_SUB_EXPR tokens for the operator's
//				operands. NumComponents is always 0.
// TCL_TOKEN_EXPAND_WORD -	This token is just like TCL_TOKEN_WORD except
//				that it marks a word that began with the
//				literal character prefix "{*}". This word is
//				marked to be expanded - that is, broken into
//				words after substitution is complete.

// Parsing error types. On any parsing error, one of these values will be
// stored in the error field of the Tcl_Parse structure defined below.

// A structure of the following type is filled in by Tcl_ParseCommand. It
// describes a single command parsed from an input string.

type Tcl_Parse = Tcl_Parse1 /* tcl.h:2070:3 */

//----------------------------------------------------------------------------
// The following structure represents a user-defined encoding. It collects
// together all the functions that are used by the specific encoding.

type Tcl_EncodingType1 = struct {
	FencodingName uintptr
	FtoUtfProc    uintptr
	FfromUtfProc  uintptr
	FfreeProc     uintptr
	FclientData   ClientData
	FnullSize     int32
	F__ccgo_pad1  [4]byte
} /* tcl.h:2078:9 */

//----------------------------------------------------------------------------
// The following structure represents a user-defined encoding. It collects
// together all the functions that are used by the specific encoding.

type Tcl_EncodingType = Tcl_EncodingType1 /* tcl.h:2098:3 */

// The following definitions are used as values for the conversion control
// flags argument when converting text from one character set to another:
//
// TCL_ENCODING_START -		Signifies that the source buffer is the first
//				block in a (potentially multi-block) input
//				stream. Tells the conversion function to reset
//				to an initial state and perform any
//				initialization that needs to occur before the
//				first byte is converted. If the source buffer
//				contains the entire input stream to be
//				converted, this flag should be set.
// TCL_ENCODING_END -		Signifies that the source buffer is the last
//				block in a (potentially multi-block) input
//				stream. Tells the conversion routine to
//				perform any finalization that needs to occur
//				after the last byte is converted and then to
//				reset to an initial state. If the source
//				buffer contains the entire input stream to be
//				converted, this flag should be set.
// TCL_ENCODING_STOPONERROR -	If set, the converter returns immediately upon
//				encountering an invalid byte sequence or a
//				source character that has no mapping in the
//				target encoding. If clear, the converter
//				substitues the problematic character(s) with
//				one or more "close" characters in the
//				destination buffer and then continues to
//				convert the source.
// TCL_ENCODING_NO_TERMINATE - 	If set, Tcl_ExternalToUtf does not append a
//				terminating NUL byte.  Since it does not need
//				an extra byte for a terminating NUL, it fills
//				all dstLen bytes with encoded UTF-8 content if
//				needed.  If clear, a byte is reserved in the
//				dst space for NUL termination, and a
//				terminating NUL is appended.
// TCL_ENCODING_CHAR_LIMIT -	If set and dstCharsPtr is not NULL, then
//				Tcl_ExternalToUtf takes the initial value of
//				*dstCharsPtr as a limit of the maximum number
//				of chars to produce in the encoded UTF-8
//				content.  Otherwise, the number of chars
//				produced is controlled only by other limiting
//				factors.

// The following definitions are the error codes returned by the conversion
// routines:
//
// TCL_OK -			All characters were converted.
// TCL_CONVERT_NOSPACE -	The output buffer would not have been large
//				enough for all of the converted data; as many
//				characters as could fit were converted though.
// TCL_CONVERT_MULTIBYTE -	The last few bytes in the source string were
//				the beginning of a multibyte sequence, but
//				more bytes were needed to complete this
//				sequence. A subsequent call to the conversion
//				routine should pass the beginning of this
//				unconverted sequence plus additional bytes
//				from the source stream to properly convert the
//				formerly split-up multibyte sequence.
// TCL_CONVERT_SYNTAX -		The source stream contained an invalid
//				character sequence. This may occur if the
//				input stream has been damaged or if the input
//				encoding method was misidentified. This error
//				is reported only if TCL_ENCODING_STOPONERROR
//				was specified.
// TCL_CONVERT_UNKNOWN -	The source string contained a character that
//				could not be represented in the target
//				encoding. This error is reported only if
//				TCL_ENCODING_STOPONERROR was specified.

// The maximum number of bytes that are necessary to represent a single
// Unicode character in UTF-8. The valid values should be 3, 4 or 6
// (or perhaps 1 if we want to support a non-unicode enabled core). If 3 or
// 4, then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If 6,
// then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode
// is the default and recommended mode. UCS-4 is experimental and not
// recommended. It works for the core, but most extensions expect UCS-2.

// This represents a Unicode character. Any changes to this should also be
// reflected in regcustom.h.

type Tcl_UniChar = uint16 /* tcl.h:2212:24 */

//----------------------------------------------------------------------------
// TIP #59: The following structure is used in calls 'Tcl_RegisterConfig' to
// provide the system with the embedded configuration data.

type Tcl_Config1 = struct {
	Fkey   uintptr
	Fvalue uintptr
} /* tcl.h:2221:9 */

//----------------------------------------------------------------------------
// TIP #59: The following structure is used in calls 'Tcl_RegisterConfig' to
// provide the system with the embedded configuration data.

type Tcl_Config = Tcl_Config1 /* tcl.h:2226:3 */

//----------------------------------------------------------------------------
// Override definitions for libtommath.

type Mp_int1 = struct {
	Fused        int32
	Falloc       int32
	Fsign        Mp_sign
	F__ccgo_pad1 [4]byte
	Fdp          uintptr
} /* tcl.h:2250:9 */

//----------------------------------------------------------------------------
// Override definitions for libtommath.

type Mp_int = Mp_int1  /* tcl.h:2250:23 */
type Mp_digit = uint32 /* tcl.h:2252:22 */

//----------------------------------------------------------------------------
// Definitions needed for Tcl_ParseArgvObj routines.
// Based on tkArgv.c.
// Modifications from the original are copyright (c) Sam Bromley 2006

type Tcl_ArgvInfo = struct {
	Ftype        int32
	F__ccgo_pad1 [4]byte
	FkeyStr      uintptr
	FsrcPtr      uintptr
	FdstPtr      uintptr
	FhelpStr     uintptr
	FclientData  ClientData
} /* tcl.h:2273:3 */

type TclPlatStubs1 = struct {
	Fmagic       int32
	F__ccgo_pad1 [4]byte
	Fhooks       uintptr
} /* tclDecls.h:1851:11 */

type TclIntStubs1 = struct {
	Fmagic                        int32
	F__ccgo_pad1                  [4]byte
	Fhooks                        uintptr
	Freserved0                    uintptr
	Freserved1                    uintptr
	Freserved2                    uintptr
	FtclAllocateFreeObjects       uintptr
	Freserved4                    uintptr
	FtclCleanupChildren           uintptr
	FtclCleanupCommand            uintptr
	FtclCopyAndCollapse           uintptr
	FtclCopyChannelOld            uintptr
	FtclCreatePipeline            uintptr
	FtclCreateProc                uintptr
	FtclDeleteCompiledLocalVars   uintptr
	FtclDeleteVars                uintptr
	Freserved13                   uintptr
	FtclDumpMemoryInfo            uintptr
	Freserved15                   uintptr
	FtclExprFloatError            uintptr
	Freserved17                   uintptr
	Freserved18                   uintptr
	Freserved19                   uintptr
	Freserved20                   uintptr
	Freserved21                   uintptr
	FtclFindElement               uintptr
	FtclFindProc                  uintptr
	FtclFormatInt                 uintptr
	FtclFreePackageInfo           uintptr
	Freserved26                   uintptr
	Freserved27                   uintptr
	FtclpGetDefaultStdChannel     uintptr
	Freserved29                   uintptr
	Freserved30                   uintptr
	FtclGetExtension              uintptr
	FtclGetFrame                  uintptr
	Freserved33                   uintptr
	FtclGetIntForIndex            uintptr
	Freserved35                   uintptr
	Freserved36                   uintptr
	FtclGetLoadedPackages         uintptr
	FtclGetNamespaceForQualName   uintptr
	FtclGetObjInterpProc          uintptr
	FtclGetOpenMode               uintptr
	FtclGetOriginalCommand        uintptr
	FtclpGetUserHome              uintptr
	Freserved43                   uintptr
	FtclGuessPackageName          uintptr
	FtclHideUnsafeCommands        uintptr
	FtclInExit                    uintptr
	Freserved47                   uintptr
	Freserved48                   uintptr
	Freserved49                   uintptr
	FtclInitCompiledLocals        uintptr
	FtclInterpInit                uintptr
	Freserved52                   uintptr
	FtclInvokeObjectCommand       uintptr
	FtclInvokeStringCommand       uintptr
	FtclIsProc                    uintptr
	Freserved56                   uintptr
	Freserved57                   uintptr
	FtclLookupVar                 uintptr
	Freserved59                   uintptr
	FtclNeedSpace                 uintptr
	FtclNewProcBodyObj            uintptr
	FtclObjCommandComplete        uintptr
	FtclObjInterpProc             uintptr
	FtclObjInvoke                 uintptr
	Freserved65                   uintptr
	Freserved66                   uintptr
	Freserved67                   uintptr
	Freserved68                   uintptr
	FtclpAlloc                    uintptr
	Freserved70                   uintptr
	Freserved71                   uintptr
	Freserved72                   uintptr
	Freserved73                   uintptr
	FtclpFree                     uintptr
	FtclpGetClicks                uintptr
	FtclpGetSeconds               uintptr
	FtclpGetTime                  uintptr
	Freserved78                   uintptr
	Freserved79                   uintptr
	Freserved80                   uintptr
	FtclpRealloc                  uintptr
	Freserved82                   uintptr
	Freserved83                   uintptr
	Freserved84                   uintptr
	Freserved85                   uintptr
	Freserved86                   uintptr
	Freserved87                   uintptr
	FtclPrecTraceProc             uintptr
	FtclPreventAliasLoop          uintptr
	Freserved90                   uintptr
	FtclProcCleanupProc           uintptr
	FtclProcCompileProc           uintptr
	FtclProcDeleteProc            uintptr
	Freserved94                   uintptr
	Freserved95                   uintptr
	FtclRenameCommand             uintptr
	FtclResetShadowedCmdRefs      uintptr
	FtclServiceIdle               uintptr
	Freserved99                   uintptr
	Freserved100                  uintptr
	FtclSetPreInitScript          uintptr
	FtclSetupEnv                  uintptr
	FtclSockGetPort               uintptr
	FtclSockMinimumBuffersOld     uintptr
	Freserved105                  uintptr
	Freserved106                  uintptr
	Freserved107                  uintptr
	FtclTeardownNamespace         uintptr
	FtclUpdateReturnInfo          uintptr
	FtclSockMinimumBuffers        uintptr
	Ftcl_AddInterpResolvers       uintptr
	Ftcl_AppendExportList         uintptr
	Ftcl_CreateNamespace          uintptr
	Ftcl_DeleteNamespace          uintptr
	Ftcl_Export                   uintptr
	Ftcl_FindCommand              uintptr
	Ftcl_FindNamespace            uintptr
	Ftcl_GetInterpResolvers       uintptr
	Ftcl_GetNamespaceResolvers    uintptr
	Ftcl_FindNamespaceVar         uintptr
	Ftcl_ForgetImport             uintptr
	Ftcl_GetCommandFromObj        uintptr
	Ftcl_GetCommandFullName       uintptr
	Ftcl_GetCurrentNamespace      uintptr
	Ftcl_GetGlobalNamespace       uintptr
	Ftcl_GetVariableFullName      uintptr
	Ftcl_Import                   uintptr
	Ftcl_PopCallFrame             uintptr
	Ftcl_PushCallFrame            uintptr
	Ftcl_RemoveInterpResolvers    uintptr
	Ftcl_SetNamespaceResolvers    uintptr
	FtclpHasSockets               uintptr
	FtclpGetDate                  uintptr
	Freserved134                  uintptr
	Freserved135                  uintptr
	Freserved136                  uintptr
	Freserved137                  uintptr
	FtclGetEnv                    uintptr
	Freserved139                  uintptr
	Freserved140                  uintptr
	FtclpGetCwd                   uintptr
	FtclSetByteCodeFromAny        uintptr
	FtclAddLiteralObj             uintptr
	FtclHideLiteral               uintptr
	FtclGetAuxDataType            uintptr
	FtclHandleCreate              uintptr
	FtclHandleFree                uintptr
	FtclHandlePreserve            uintptr
	FtclHandleRelease             uintptr
	FtclRegAbout                  uintptr
	FtclRegExpRangeUniChar        uintptr
	FtclSetLibraryPath            uintptr
	FtclGetLibraryPath            uintptr
	Freserved154                  uintptr
	Freserved155                  uintptr
	FtclRegError                  uintptr
	FtclVarTraceExists            uintptr
	FtclSetStartupScriptFileName  uintptr
	FtclGetStartupScriptFileName  uintptr
	Freserved160                  uintptr
	FtclChannelTransform          uintptr
	FtclChannelEventScriptInvoker uintptr
	FtclGetInstructionTable       uintptr
	FtclExpandCodeArray           uintptr
	FtclpSetInitialEncodings      uintptr
	FtclListObjSetElement         uintptr
	FtclSetStartupScriptPath      uintptr
	FtclGetStartupScriptPath      uintptr
	FtclpUtfNcmp2                 uintptr
	FtclCheckInterpTraces         uintptr
	FtclCheckExecutionTraces      uintptr
	FtclInThreadExit              uintptr
	FtclUniCharMatch              uintptr
	Freserved174                  uintptr
	FtclCallVarTraces             uintptr
	FtclCleanupVar                uintptr
	FtclVarErrMsg                 uintptr
	Ftcl_SetStartupScript         uintptr
	Ftcl_GetStartupScript         uintptr
	Freserved180                  uintptr
	Freserved181                  uintptr
	FtclpLocaltime                uintptr
	FtclpGmtime                   uintptr
	Freserved184                  uintptr
	Freserved185                  uintptr
	Freserved186                  uintptr
	Freserved187                  uintptr
	Freserved188                  uintptr
	Freserved189                  uintptr
	Freserved190                  uintptr
	Freserved191                  uintptr
	Freserved192                  uintptr
	Freserved193                  uintptr
	Freserved194                  uintptr
	Freserved195                  uintptr
	Freserved196                  uintptr
	Freserved197                  uintptr
	FtclObjGetFrame               uintptr
	Freserved199                  uintptr
	FtclpObjRemoveDirectory       uintptr
	FtclpObjCopyDirectory         uintptr
	FtclpObjCreateDirectory       uintptr
	FtclpObjDeleteFile            uintptr
	FtclpObjCopyFile              uintptr
	FtclpObjRenameFile            uintptr
	FtclpObjStat                  uintptr
	FtclpObjAccess                uintptr
	FtclpOpenFileChannel          uintptr
	Freserved209                  uintptr
	Freserved210                  uintptr
	Freserved211                  uintptr
	FtclpFindExecutable           uintptr
	FtclGetObjNameOfExecutable    uintptr
	FtclSetObjNameOfExecutable    uintptr
	FtclStackAlloc                uintptr
	FtclStackFree                 uintptr
	FtclPushStackFrame            uintptr
	FtclPopStackFrame             uintptr
	Freserved219                  uintptr
	Freserved220                  uintptr
	Freserved221                  uintptr
	Freserved222                  uintptr
	Freserved223                  uintptr
	FtclGetPlatform               uintptr
	FtclTraceDictPath             uintptr
	FtclObjBeingDeleted           uintptr
	FtclSetNsPath                 uintptr
	Freserved228                  uintptr
	FtclPtrMakeUpvar              uintptr
	FtclObjLookupVar              uintptr
	FtclGetNamespaceFromObj       uintptr
	FtclEvalObjEx                 uintptr
	FtclGetSrcInfoForPc           uintptr
	FtclVarHashCreateVar          uintptr
	FtclInitVarHashTable          uintptr
	FtclBackgroundException       uintptr
	FtclResetCancellation         uintptr
	FtclNRInterpProc              uintptr
	FtclNRInterpProcCore          uintptr
	FtclNRRunCallbacks            uintptr
	FtclNREvalObjEx               uintptr
	FtclNREvalObjv                uintptr
	FtclDbDumpActiveObjects       uintptr
	FtclGetNamespaceChildTable    uintptr
	FtclGetNamespaceCommandTable  uintptr
	FtclInitRewriteEnsemble       uintptr
	FtclResetRewriteEnsemble      uintptr
	FtclCopyChannel               uintptr
	FtclDoubleDigits              uintptr
	FtclSetSlaveCancelFlags       uintptr
	FtclRegisterLiteral           uintptr
	FtclPtrGetVar                 uintptr
	FtclPtrSetVar                 uintptr
	FtclPtrIncrObjVar             uintptr
	FtclPtrObjMakeUpvar           uintptr
	FtclPtrUnsetVar               uintptr
	FtclStaticPackage             uintptr
	Freserved258                  uintptr
	Freserved259                  uintptr
	FtclUnusedStubEntry           uintptr
} /* tclDecls.h:1852:11 */

type TclIntPlatStubs1 = struct {
	Fmagic                           int32
	F__ccgo_pad1                     [4]byte
	Fhooks                           uintptr
	FtclGetAndDetachPids             uintptr
	FtclpCloseFile                   uintptr
	FtclpCreateCommandChannel        uintptr
	FtclpCreatePipe                  uintptr
	FtclpCreateProcess               uintptr
	FtclUnixWaitForFile_             uintptr
	FtclpMakeFile                    uintptr
	FtclpOpenFile                    uintptr
	FtclUnixWaitForFile              uintptr
	FtclpCreateTempFile              uintptr
	FtclpReaddir                     uintptr
	FtclpLocaltime_unix              uintptr
	FtclpGmtime_unix                 uintptr
	FtclpInetNtoa                    uintptr
	FtclUnixCopyFile                 uintptr
	FtclMacOSXGetFileAttribute       uintptr
	FtclMacOSXSetFileAttribute       uintptr
	FtclMacOSXCopyFileAttributes     uintptr
	FtclMacOSXMatchType              uintptr
	FtclMacOSXNotifierAddRunLoopMode uintptr
	Freserved20                      uintptr
	Freserved21                      uintptr
	FtclpCreateTempFile_             uintptr
	Freserved23                      uintptr
	Freserved24                      uintptr
	Freserved25                      uintptr
	Freserved26                      uintptr
	Freserved27                      uintptr
	Freserved28                      uintptr
	FtclWinCPUID                     uintptr
	FtclUnixOpenTemporaryFile        uintptr
} /* tclDecls.h:1853:11 */

type TclStubHooks = struct {
	FtclPlatStubs    uintptr
	FtclIntStubs     uintptr
	FtclIntPlatStubs uintptr
} /* tclDecls.h:1854:3 */

type TclStubs1 = struct {
	Fmagic                                  int32
	F__ccgo_pad1                            [4]byte
	Fhooks                                  uintptr
	Ftcl_PkgProvideEx                       uintptr
	Ftcl_PkgRequireEx                       uintptr
	Ftcl_Panic                              uintptr
	Ftcl_Alloc                              uintptr
	Ftcl_Free                               uintptr
	Ftcl_Realloc                            uintptr
	Ftcl_DbCkalloc                          uintptr
	Ftcl_DbCkfree                           uintptr
	Ftcl_DbCkrealloc                        uintptr
	Ftcl_CreateFileHandler                  uintptr
	Ftcl_DeleteFileHandler                  uintptr
	Ftcl_SetTimer                           uintptr
	Ftcl_Sleep                              uintptr
	Ftcl_WaitForEvent                       uintptr
	Ftcl_AppendAllObjTypes                  uintptr
	Ftcl_AppendStringsToObj                 uintptr
	Ftcl_AppendToObj                        uintptr
	Ftcl_ConcatObj                          uintptr
	Ftcl_ConvertToType                      uintptr
	Ftcl_DbDecrRefCount                     uintptr
	Ftcl_DbIncrRefCount                     uintptr
	Ftcl_DbIsShared                         uintptr
	Ftcl_DbNewBooleanObj                    uintptr
	Ftcl_DbNewByteArrayObj                  uintptr
	Ftcl_DbNewDoubleObj                     uintptr
	Ftcl_DbNewListObj                       uintptr
	Ftcl_DbNewLongObj                       uintptr
	Ftcl_DbNewObj                           uintptr
	Ftcl_DbNewStringObj                     uintptr
	Ftcl_DuplicateObj                       uintptr
	FtclFreeObj                             uintptr
	Ftcl_GetBoolean                         uintptr
	Ftcl_GetBooleanFromObj                  uintptr
	Ftcl_GetByteArrayFromObj                uintptr
	Ftcl_GetDouble                          uintptr
	Ftcl_GetDoubleFromObj                   uintptr
	Ftcl_GetIndexFromObj                    uintptr
	Ftcl_GetInt                             uintptr
	Ftcl_GetIntFromObj                      uintptr
	Ftcl_GetLongFromObj                     uintptr
	Ftcl_GetObjType                         uintptr
	Ftcl_GetStringFromObj                   uintptr
	Ftcl_InvalidateStringRep                uintptr
	Ftcl_ListObjAppendList                  uintptr
	Ftcl_ListObjAppendElement               uintptr
	Ftcl_ListObjGetElements                 uintptr
	Ftcl_ListObjIndex                       uintptr
	Ftcl_ListObjLength                      uintptr
	Ftcl_ListObjReplace                     uintptr
	Ftcl_NewBooleanObj                      uintptr
	Ftcl_NewByteArrayObj                    uintptr
	Ftcl_NewDoubleObj                       uintptr
	Ftcl_NewIntObj                          uintptr
	Ftcl_NewListObj                         uintptr
	Ftcl_NewLongObj                         uintptr
	Ftcl_NewObj                             uintptr
	Ftcl_NewStringObj                       uintptr
	Ftcl_SetBooleanObj                      uintptr
	Ftcl_SetByteArrayLength                 uintptr
	Ftcl_SetByteArrayObj                    uintptr
	Ftcl_SetDoubleObj                       uintptr
	Ftcl_SetIntObj                          uintptr
	Ftcl_SetListObj                         uintptr
	Ftcl_SetLongObj                         uintptr
	Ftcl_SetObjLength                       uintptr
	Ftcl_SetStringObj                       uintptr
	Ftcl_AddErrorInfo                       uintptr
	Ftcl_AddObjErrorInfo                    uintptr
	Ftcl_AllowExceptions                    uintptr
	Ftcl_AppendElement                      uintptr
	Ftcl_AppendResult                       uintptr
	Ftcl_AsyncCreate                        uintptr
	Ftcl_AsyncDelete                        uintptr
	Ftcl_AsyncInvoke                        uintptr
	Ftcl_AsyncMark                          uintptr
	Ftcl_AsyncReady                         uintptr
	Ftcl_BackgroundError                    uintptr
	Ftcl_Backslash                          uintptr
	Ftcl_BadChannelOption                   uintptr
	Ftcl_CallWhenDeleted                    uintptr
	Ftcl_CancelIdleCall                     uintptr
	Ftcl_Close                              uintptr
	Ftcl_CommandComplete                    uintptr
	Ftcl_Concat                             uintptr
	Ftcl_ConvertElement                     uintptr
	Ftcl_ConvertCountedElement              uintptr
	Ftcl_CreateAlias                        uintptr
	Ftcl_CreateAliasObj                     uintptr
	Ftcl_CreateChannel                      uintptr
	Ftcl_CreateChannelHandler               uintptr
	Ftcl_CreateCloseHandler                 uintptr
	Ftcl_CreateCommand                      uintptr
	Ftcl_CreateEventSource                  uintptr
	Ftcl_CreateExitHandler                  uintptr
	Ftcl_CreateInterp                       uintptr
	Ftcl_CreateMathFunc                     uintptr
	Ftcl_CreateObjCommand                   uintptr
	Ftcl_CreateSlave                        uintptr
	Ftcl_CreateTimerHandler                 uintptr
	Ftcl_CreateTrace                        uintptr
	Ftcl_DeleteAssocData                    uintptr
	Ftcl_DeleteChannelHandler               uintptr
	Ftcl_DeleteCloseHandler                 uintptr
	Ftcl_DeleteCommand                      uintptr
	Ftcl_DeleteCommandFromToken             uintptr
	Ftcl_DeleteEvents                       uintptr
	Ftcl_DeleteEventSource                  uintptr
	Ftcl_DeleteExitHandler                  uintptr
	Ftcl_DeleteHashEntry                    uintptr
	Ftcl_DeleteHashTable                    uintptr
	Ftcl_DeleteInterp                       uintptr
	Ftcl_DetachPids                         uintptr
	Ftcl_DeleteTimerHandler                 uintptr
	Ftcl_DeleteTrace                        uintptr
	Ftcl_DontCallWhenDeleted                uintptr
	Ftcl_DoOneEvent                         uintptr
	Ftcl_DoWhenIdle                         uintptr
	Ftcl_DStringAppend                      uintptr
	Ftcl_DStringAppendElement               uintptr
	Ftcl_DStringEndSublist                  uintptr
	Ftcl_DStringFree                        uintptr
	Ftcl_DStringGetResult                   uintptr
	Ftcl_DStringInit                        uintptr
	Ftcl_DStringResult                      uintptr
	Ftcl_DStringSetLength                   uintptr
	Ftcl_DStringStartSublist                uintptr
	Ftcl_Eof                                uintptr
	Ftcl_ErrnoId                            uintptr
	Ftcl_ErrnoMsg                           uintptr
	Ftcl_Eval                               uintptr
	Ftcl_EvalFile                           uintptr
	Ftcl_EvalObj                            uintptr
	Ftcl_EventuallyFree                     uintptr
	Ftcl_Exit                               uintptr
	Ftcl_ExposeCommand                      uintptr
	Ftcl_ExprBoolean                        uintptr
	Ftcl_ExprBooleanObj                     uintptr
	Ftcl_ExprDouble                         uintptr
	Ftcl_ExprDoubleObj                      uintptr
	Ftcl_ExprLong                           uintptr
	Ftcl_ExprLongObj                        uintptr
	Ftcl_ExprObj                            uintptr
	Ftcl_ExprString                         uintptr
	Ftcl_Finalize                           uintptr
	Ftcl_FindExecutable                     uintptr
	Ftcl_FirstHashEntry                     uintptr
	Ftcl_Flush                              uintptr
	Ftcl_FreeResult                         uintptr
	Ftcl_GetAlias                           uintptr
	Ftcl_GetAliasObj                        uintptr
	Ftcl_GetAssocData                       uintptr
	Ftcl_GetChannel                         uintptr
	Ftcl_GetChannelBufferSize               uintptr
	Ftcl_GetChannelHandle                   uintptr
	Ftcl_GetChannelInstanceData             uintptr
	Ftcl_GetChannelMode                     uintptr
	Ftcl_GetChannelName                     uintptr
	Ftcl_GetChannelOption                   uintptr
	Ftcl_GetChannelType                     uintptr
	Ftcl_GetCommandInfo                     uintptr
	Ftcl_GetCommandName                     uintptr
	Ftcl_GetErrno                           uintptr
	Ftcl_GetHostName                        uintptr
	Ftcl_GetInterpPath                      uintptr
	Ftcl_GetMaster                          uintptr
	Ftcl_GetNameOfExecutable                uintptr
	Ftcl_GetObjResult                       uintptr
	Ftcl_GetOpenFile                        uintptr
	Ftcl_GetPathType                        uintptr
	Ftcl_Gets                               uintptr
	Ftcl_GetsObj                            uintptr
	Ftcl_GetServiceMode                     uintptr
	Ftcl_GetSlave                           uintptr
	Ftcl_GetStdChannel                      uintptr
	Ftcl_GetStringResult                    uintptr
	Ftcl_GetVar                             uintptr
	Ftcl_GetVar2                            uintptr
	Ftcl_GlobalEval                         uintptr
	Ftcl_GlobalEvalObj                      uintptr
	Ftcl_HideCommand                        uintptr
	Ftcl_Init                               uintptr
	Ftcl_InitHashTable                      uintptr
	Ftcl_InputBlocked                       uintptr
	Ftcl_InputBuffered                      uintptr
	Ftcl_InterpDeleted                      uintptr
	Ftcl_IsSafe                             uintptr
	Ftcl_JoinPath                           uintptr
	Ftcl_LinkVar                            uintptr
	Freserved188                            uintptr
	Ftcl_MakeFileChannel                    uintptr
	Ftcl_MakeSafe                           uintptr
	Ftcl_MakeTcpClientChannel               uintptr
	Ftcl_Merge                              uintptr
	Ftcl_NextHashEntry                      uintptr
	Ftcl_NotifyChannel                      uintptr
	Ftcl_ObjGetVar2                         uintptr
	Ftcl_ObjSetVar2                         uintptr
	Ftcl_OpenCommandChannel                 uintptr
	Ftcl_OpenFileChannel                    uintptr
	Ftcl_OpenTcpClient                      uintptr
	Ftcl_OpenTcpServer                      uintptr
	Ftcl_Preserve                           uintptr
	Ftcl_PrintDouble                        uintptr
	Ftcl_PutEnv                             uintptr
	Ftcl_PosixError                         uintptr
	Ftcl_QueueEvent                         uintptr
	Ftcl_Read                               uintptr
	Ftcl_ReapDetachedProcs                  uintptr
	Ftcl_RecordAndEval                      uintptr
	Ftcl_RecordAndEvalObj                   uintptr
	Ftcl_RegisterChannel                    uintptr
	Ftcl_RegisterObjType                    uintptr
	Ftcl_RegExpCompile                      uintptr
	Ftcl_RegExpExec                         uintptr
	Ftcl_RegExpMatch                        uintptr
	Ftcl_RegExpRange                        uintptr
	Ftcl_Release                            uintptr
	Ftcl_ResetResult                        uintptr
	Ftcl_ScanElement                        uintptr
	Ftcl_ScanCountedElement                 uintptr
	Ftcl_SeekOld                            uintptr
	Ftcl_ServiceAll                         uintptr
	Ftcl_ServiceEvent                       uintptr
	Ftcl_SetAssocData                       uintptr
	Ftcl_SetChannelBufferSize               uintptr
	Ftcl_SetChannelOption                   uintptr
	Ftcl_SetCommandInfo                     uintptr
	Ftcl_SetErrno                           uintptr
	Ftcl_SetErrorCode                       uintptr
	Ftcl_SetMaxBlockTime                    uintptr
	Ftcl_SetPanicProc                       uintptr
	Ftcl_SetRecursionLimit                  uintptr
	Ftcl_SetResult                          uintptr
	Ftcl_SetServiceMode                     uintptr
	Ftcl_SetObjErrorCode                    uintptr
	Ftcl_SetObjResult                       uintptr
	Ftcl_SetStdChannel                      uintptr
	Ftcl_SetVar                             uintptr
	Ftcl_SetVar2                            uintptr
	Ftcl_SignalId                           uintptr
	Ftcl_SignalMsg                          uintptr
	Ftcl_SourceRCFile                       uintptr
	Ftcl_SplitList                          uintptr
	Ftcl_SplitPath                          uintptr
	Ftcl_StaticPackage                      uintptr
	Ftcl_StringMatch                        uintptr
	Ftcl_TellOld                            uintptr
	Ftcl_TraceVar                           uintptr
	Ftcl_TraceVar2                          uintptr
	Ftcl_TranslateFileName                  uintptr
	Ftcl_Ungets                             uintptr
	Ftcl_UnlinkVar                          uintptr
	Ftcl_UnregisterChannel                  uintptr
	Ftcl_UnsetVar                           uintptr
	Ftcl_UnsetVar2                          uintptr
	Ftcl_UntraceVar                         uintptr
	Ftcl_UntraceVar2                        uintptr
	Ftcl_UpdateLinkedVar                    uintptr
	Ftcl_UpVar                              uintptr
	Ftcl_UpVar2                             uintptr
	Ftcl_VarEval                            uintptr
	Ftcl_VarTraceInfo                       uintptr
	Ftcl_VarTraceInfo2                      uintptr
	Ftcl_Write                              uintptr
	Ftcl_WrongNumArgs                       uintptr
	Ftcl_DumpActiveMemory                   uintptr
	Ftcl_ValidateAllMemory                  uintptr
	Ftcl_AppendResultVA                     uintptr
	Ftcl_AppendStringsToObjVA               uintptr
	Ftcl_HashStats                          uintptr
	Ftcl_ParseVar                           uintptr
	Ftcl_PkgPresent                         uintptr
	Ftcl_PkgPresentEx                       uintptr
	Ftcl_PkgProvide                         uintptr
	Ftcl_PkgRequire                         uintptr
	Ftcl_SetErrorCodeVA                     uintptr
	Ftcl_VarEvalVA                          uintptr
	Ftcl_WaitPid                            uintptr
	Ftcl_PanicVA                            uintptr
	Ftcl_GetVersion                         uintptr
	Ftcl_InitMemory                         uintptr
	Ftcl_StackChannel                       uintptr
	Ftcl_UnstackChannel                     uintptr
	Ftcl_GetStackedChannel                  uintptr
	Ftcl_SetMainLoop                        uintptr
	Freserved285                            uintptr
	Ftcl_AppendObjToObj                     uintptr
	Ftcl_CreateEncoding                     uintptr
	Ftcl_CreateThreadExitHandler            uintptr
	Ftcl_DeleteThreadExitHandler            uintptr
	Ftcl_DiscardResult                      uintptr
	Ftcl_EvalEx                             uintptr
	Ftcl_EvalObjv                           uintptr
	Ftcl_EvalObjEx                          uintptr
	Ftcl_ExitThread                         uintptr
	Ftcl_ExternalToUtf                      uintptr
	Ftcl_ExternalToUtfDString               uintptr
	Ftcl_FinalizeThread                     uintptr
	Ftcl_FinalizeNotifier                   uintptr
	Ftcl_FreeEncoding                       uintptr
	Ftcl_GetCurrentThread                   uintptr
	Ftcl_GetEncoding                        uintptr
	Ftcl_GetEncodingName                    uintptr
	Ftcl_GetEncodingNames                   uintptr
	Ftcl_GetIndexFromObjStruct              uintptr
	Ftcl_GetThreadData                      uintptr
	Ftcl_GetVar2Ex                          uintptr
	Ftcl_InitNotifier                       uintptr
	Ftcl_MutexLock                          uintptr
	Ftcl_MutexUnlock                        uintptr
	Ftcl_ConditionNotify                    uintptr
	Ftcl_ConditionWait                      uintptr
	Ftcl_NumUtfChars                        uintptr
	Ftcl_ReadChars                          uintptr
	Ftcl_RestoreResult                      uintptr
	Ftcl_SaveResult                         uintptr
	Ftcl_SetSystemEncoding                  uintptr
	Ftcl_SetVar2Ex                          uintptr
	Ftcl_ThreadAlert                        uintptr
	Ftcl_ThreadQueueEvent                   uintptr
	Ftcl_UniCharAtIndex                     uintptr
	Ftcl_UniCharToLower                     uintptr
	Ftcl_UniCharToTitle                     uintptr
	Ftcl_UniCharToUpper                     uintptr
	Ftcl_UniCharToUtf                       uintptr
	Ftcl_UtfAtIndex                         uintptr
	Ftcl_UtfCharComplete                    uintptr
	Ftcl_UtfBackslash                       uintptr
	Ftcl_UtfFindFirst                       uintptr
	Ftcl_UtfFindLast                        uintptr
	Ftcl_UtfNext                            uintptr
	Ftcl_UtfPrev                            uintptr
	Ftcl_UtfToExternal                      uintptr
	Ftcl_UtfToExternalDString               uintptr
	Ftcl_UtfToLower                         uintptr
	Ftcl_UtfToTitle                         uintptr
	Ftcl_UtfToUniChar                       uintptr
	Ftcl_UtfToUpper                         uintptr
	Ftcl_WriteChars                         uintptr
	Ftcl_WriteObj                           uintptr
	Ftcl_GetString                          uintptr
	Ftcl_GetDefaultEncodingDir              uintptr
	Ftcl_SetDefaultEncodingDir              uintptr
	Ftcl_AlertNotifier                      uintptr
	Ftcl_ServiceModeHook                    uintptr
	Ftcl_UniCharIsAlnum                     uintptr
	Ftcl_UniCharIsAlpha                     uintptr
	Ftcl_UniCharIsDigit                     uintptr
	Ftcl_UniCharIsLower                     uintptr
	Ftcl_UniCharIsSpace                     uintptr
	Ftcl_UniCharIsUpper                     uintptr
	Ftcl_UniCharIsWordChar                  uintptr
	Ftcl_UniCharLen                         uintptr
	Ftcl_UniCharNcmp                        uintptr
	Ftcl_UniCharToUtfDString                uintptr
	Ftcl_UtfToUniCharDString                uintptr
	Ftcl_GetRegExpFromObj                   uintptr
	Ftcl_EvalTokens                         uintptr
	Ftcl_FreeParse                          uintptr
	Ftcl_LogCommandInfo                     uintptr
	Ftcl_ParseBraces                        uintptr
	Ftcl_ParseCommand                       uintptr
	Ftcl_ParseExpr                          uintptr
	Ftcl_ParseQuotedString                  uintptr
	Ftcl_ParseVarName                       uintptr
	Ftcl_GetCwd                             uintptr
	Ftcl_Chdir                              uintptr
	Ftcl_Access                             uintptr
	Ftcl_Stat                               uintptr
	Ftcl_UtfNcmp                            uintptr
	Ftcl_UtfNcasecmp                        uintptr
	Ftcl_StringCaseMatch                    uintptr
	Ftcl_UniCharIsControl                   uintptr
	Ftcl_UniCharIsGraph                     uintptr
	Ftcl_UniCharIsPrint                     uintptr
	Ftcl_UniCharIsPunct                     uintptr
	Ftcl_RegExpExecObj                      uintptr
	Ftcl_RegExpGetInfo                      uintptr
	Ftcl_NewUnicodeObj                      uintptr
	Ftcl_SetUnicodeObj                      uintptr
	Ftcl_GetCharLength                      uintptr
	Ftcl_GetUniChar                         uintptr
	Ftcl_GetUnicode                         uintptr
	Ftcl_GetRange                           uintptr
	Ftcl_AppendUnicodeToObj                 uintptr
	Ftcl_RegExpMatchObj                     uintptr
	Ftcl_SetNotifier                        uintptr
	Ftcl_GetAllocMutex                      uintptr
	Ftcl_GetChannelNames                    uintptr
	Ftcl_GetChannelNamesEx                  uintptr
	Ftcl_ProcObjCmd                         uintptr
	Ftcl_ConditionFinalize                  uintptr
	Ftcl_MutexFinalize                      uintptr
	Ftcl_CreateThread                       uintptr
	Ftcl_ReadRaw                            uintptr
	Ftcl_WriteRaw                           uintptr
	Ftcl_GetTopChannel                      uintptr
	Ftcl_ChannelBuffered                    uintptr
	Ftcl_ChannelName                        uintptr
	Ftcl_ChannelVersion                     uintptr
	Ftcl_ChannelBlockModeProc               uintptr
	Ftcl_ChannelCloseProc                   uintptr
	Ftcl_ChannelClose2Proc                  uintptr
	Ftcl_ChannelInputProc                   uintptr
	Ftcl_ChannelOutputProc                  uintptr
	Ftcl_ChannelSeekProc                    uintptr
	Ftcl_ChannelSetOptionProc               uintptr
	Ftcl_ChannelGetOptionProc               uintptr
	Ftcl_ChannelWatchProc                   uintptr
	Ftcl_ChannelGetHandleProc               uintptr
	Ftcl_ChannelFlushProc                   uintptr
	Ftcl_ChannelHandlerProc                 uintptr
	Ftcl_JoinThread                         uintptr
	Ftcl_IsChannelShared                    uintptr
	Ftcl_IsChannelRegistered                uintptr
	Ftcl_CutChannel                         uintptr
	Ftcl_SpliceChannel                      uintptr
	Ftcl_ClearChannelHandlers               uintptr
	Ftcl_IsChannelExisting                  uintptr
	Ftcl_UniCharNcasecmp                    uintptr
	Ftcl_UniCharCaseMatch                   uintptr
	Ftcl_FindHashEntry                      uintptr
	Ftcl_CreateHashEntry                    uintptr
	Ftcl_InitCustomHashTable                uintptr
	Ftcl_InitObjHashTable                   uintptr
	Ftcl_CommandTraceInfo                   uintptr
	Ftcl_TraceCommand                       uintptr
	Ftcl_UntraceCommand                     uintptr
	Ftcl_AttemptAlloc                       uintptr
	Ftcl_AttemptDbCkalloc                   uintptr
	Ftcl_AttemptRealloc                     uintptr
	Ftcl_AttemptDbCkrealloc                 uintptr
	Ftcl_AttemptSetObjLength                uintptr
	Ftcl_GetChannelThread                   uintptr
	Ftcl_GetUnicodeFromObj                  uintptr
	Ftcl_GetMathFuncInfo                    uintptr
	Ftcl_ListMathFuncs                      uintptr
	Ftcl_SubstObj                           uintptr
	Ftcl_DetachChannel                      uintptr
	Ftcl_IsStandardChannel                  uintptr
	Ftcl_FSCopyFile                         uintptr
	Ftcl_FSCopyDirectory                    uintptr
	Ftcl_FSCreateDirectory                  uintptr
	Ftcl_FSDeleteFile                       uintptr
	Ftcl_FSLoadFile                         uintptr
	Ftcl_FSMatchInDirectory                 uintptr
	Ftcl_FSLink                             uintptr
	Ftcl_FSRemoveDirectory                  uintptr
	Ftcl_FSRenameFile                       uintptr
	Ftcl_FSLstat                            uintptr
	Ftcl_FSUtime                            uintptr
	Ftcl_FSFileAttrsGet                     uintptr
	Ftcl_FSFileAttrsSet                     uintptr
	Ftcl_FSFileAttrStrings                  uintptr
	Ftcl_FSStat                             uintptr
	Ftcl_FSAccess                           uintptr
	Ftcl_FSOpenFileChannel                  uintptr
	Ftcl_FSGetCwd                           uintptr
	Ftcl_FSChdir                            uintptr
	Ftcl_FSConvertToPathType                uintptr
	Ftcl_FSJoinPath                         uintptr
	Ftcl_FSSplitPath                        uintptr
	Ftcl_FSEqualPaths                       uintptr
	Ftcl_FSGetNormalizedPath                uintptr
	Ftcl_FSJoinToPath                       uintptr
	Ftcl_FSGetInternalRep                   uintptr
	Ftcl_FSGetTranslatedPath                uintptr
	Ftcl_FSEvalFile                         uintptr
	Ftcl_FSNewNativePath                    uintptr
	Ftcl_FSGetNativePath                    uintptr
	Ftcl_FSFileSystemInfo                   uintptr
	Ftcl_FSPathSeparator                    uintptr
	Ftcl_FSListVolumes                      uintptr
	Ftcl_FSRegister                         uintptr
	Ftcl_FSUnregister                       uintptr
	Ftcl_FSData                             uintptr
	Ftcl_FSGetTranslatedStringPath          uintptr
	Ftcl_FSGetFileSystemForPath             uintptr
	Ftcl_FSGetPathType                      uintptr
	Ftcl_OutputBuffered                     uintptr
	Ftcl_FSMountsChanged                    uintptr
	Ftcl_EvalTokensStandard                 uintptr
	Ftcl_GetTime                            uintptr
	Ftcl_CreateObjTrace                     uintptr
	Ftcl_GetCommandInfoFromToken            uintptr
	Ftcl_SetCommandInfoFromToken            uintptr
	Ftcl_DbNewWideIntObj                    uintptr
	Ftcl_GetWideIntFromObj                  uintptr
	Ftcl_NewWideIntObj                      uintptr
	Ftcl_SetWideIntObj                      uintptr
	Ftcl_AllocStatBuf                       uintptr
	Ftcl_Seek                               uintptr
	Ftcl_Tell                               uintptr
	Ftcl_ChannelWideSeekProc                uintptr
	Ftcl_DictObjPut                         uintptr
	Ftcl_DictObjGet                         uintptr
	Ftcl_DictObjRemove                      uintptr
	Ftcl_DictObjSize                        uintptr
	Ftcl_DictObjFirst                       uintptr
	Ftcl_DictObjNext                        uintptr
	Ftcl_DictObjDone                        uintptr
	Ftcl_DictObjPutKeyList                  uintptr
	Ftcl_DictObjRemoveKeyList               uintptr
	Ftcl_NewDictObj                         uintptr
	Ftcl_DbNewDictObj                       uintptr
	Ftcl_RegisterConfig                     uintptr
	Ftcl_CreateNamespace                    uintptr
	Ftcl_DeleteNamespace                    uintptr
	Ftcl_AppendExportList                   uintptr
	Ftcl_Export                             uintptr
	Ftcl_Import                             uintptr
	Ftcl_ForgetImport                       uintptr
	Ftcl_GetCurrentNamespace                uintptr
	Ftcl_GetGlobalNamespace                 uintptr
	Ftcl_FindNamespace                      uintptr
	Ftcl_FindCommand                        uintptr
	Ftcl_GetCommandFromObj                  uintptr
	Ftcl_GetCommandFullName                 uintptr
	Ftcl_FSEvalFileEx                       uintptr
	Ftcl_SetExitProc                        uintptr
	Ftcl_LimitAddHandler                    uintptr
	Ftcl_LimitRemoveHandler                 uintptr
	Ftcl_LimitReady                         uintptr
	Ftcl_LimitCheck                         uintptr
	Ftcl_LimitExceeded                      uintptr
	Ftcl_LimitSetCommands                   uintptr
	Ftcl_LimitSetTime                       uintptr
	Ftcl_LimitSetGranularity                uintptr
	Ftcl_LimitTypeEnabled                   uintptr
	Ftcl_LimitTypeExceeded                  uintptr
	Ftcl_LimitTypeSet                       uintptr
	Ftcl_LimitTypeReset                     uintptr
	Ftcl_LimitGetCommands                   uintptr
	Ftcl_LimitGetTime                       uintptr
	Ftcl_LimitGetGranularity                uintptr
	Ftcl_SaveInterpState                    uintptr
	Ftcl_RestoreInterpState                 uintptr
	Ftcl_DiscardInterpState                 uintptr
	Ftcl_SetReturnOptions                   uintptr
	Ftcl_GetReturnOptions                   uintptr
	Ftcl_IsEnsemble                         uintptr
	Ftcl_CreateEnsemble                     uintptr
	Ftcl_FindEnsemble                       uintptr
	Ftcl_SetEnsembleSubcommandList          uintptr
	Ftcl_SetEnsembleMappingDict             uintptr
	Ftcl_SetEnsembleUnknownHandler          uintptr
	Ftcl_SetEnsembleFlags                   uintptr
	Ftcl_GetEnsembleSubcommandList          uintptr
	Ftcl_GetEnsembleMappingDict             uintptr
	Ftcl_GetEnsembleUnknownHandler          uintptr
	Ftcl_GetEnsembleFlags                   uintptr
	Ftcl_GetEnsembleNamespace               uintptr
	Ftcl_SetTimeProc                        uintptr
	Ftcl_QueryTimeProc                      uintptr
	Ftcl_ChannelThreadActionProc            uintptr
	Ftcl_NewBignumObj                       uintptr
	Ftcl_DbNewBignumObj                     uintptr
	Ftcl_SetBignumObj                       uintptr
	Ftcl_GetBignumFromObj                   uintptr
	Ftcl_TakeBignumFromObj                  uintptr
	Ftcl_TruncateChannel                    uintptr
	Ftcl_ChannelTruncateProc                uintptr
	Ftcl_SetChannelErrorInterp              uintptr
	Ftcl_GetChannelErrorInterp              uintptr
	Ftcl_SetChannelError                    uintptr
	Ftcl_GetChannelError                    uintptr
	Ftcl_InitBignumFromDouble               uintptr
	Ftcl_GetNamespaceUnknownHandler         uintptr
	Ftcl_SetNamespaceUnknownHandler         uintptr
	Ftcl_GetEncodingFromObj                 uintptr
	Ftcl_GetEncodingSearchPath              uintptr
	Ftcl_SetEncodingSearchPath              uintptr
	Ftcl_GetEncodingNameFromEnvironment     uintptr
	Ftcl_PkgRequireProc                     uintptr
	Ftcl_AppendObjToErrorInfo               uintptr
	Ftcl_AppendLimitedToObj                 uintptr
	Ftcl_Format                             uintptr
	Ftcl_AppendFormatToObj                  uintptr
	Ftcl_ObjPrintf                          uintptr
	Ftcl_AppendPrintfToObj                  uintptr
	Ftcl_CancelEval                         uintptr
	Ftcl_Canceled                           uintptr
	Ftcl_CreatePipe                         uintptr
	Ftcl_NRCreateCommand                    uintptr
	Ftcl_NREvalObj                          uintptr
	Ftcl_NREvalObjv                         uintptr
	Ftcl_NRCmdSwap                          uintptr
	Ftcl_NRAddCallback                      uintptr
	Ftcl_NRCallObjProc                      uintptr
	Ftcl_GetFSDeviceFromStat                uintptr
	Ftcl_GetFSInodeFromStat                 uintptr
	Ftcl_GetModeFromStat                    uintptr
	Ftcl_GetLinkCountFromStat               uintptr
	Ftcl_GetUserIdFromStat                  uintptr
	Ftcl_GetGroupIdFromStat                 uintptr
	Ftcl_GetDeviceTypeFromStat              uintptr
	Ftcl_GetAccessTimeFromStat              uintptr
	Ftcl_GetModificationTimeFromStat        uintptr
	Ftcl_GetChangeTimeFromStat              uintptr
	Ftcl_GetSizeFromStat                    uintptr
	Ftcl_GetBlocksFromStat                  uintptr
	Ftcl_GetBlockSizeFromStat               uintptr
	Ftcl_SetEnsembleParameterList           uintptr
	Ftcl_GetEnsembleParameterList           uintptr
	Ftcl_ParseArgsObjv                      uintptr
	Ftcl_GetErrorLine                       uintptr
	Ftcl_SetErrorLine                       uintptr
	Ftcl_TransferResult                     uintptr
	Ftcl_InterpActive                       uintptr
	Ftcl_BackgroundException                uintptr
	Ftcl_ZlibDeflate                        uintptr
	Ftcl_ZlibInflate                        uintptr
	Ftcl_ZlibCRC32                          uintptr
	Ftcl_ZlibAdler32                        uintptr
	Ftcl_ZlibStreamInit                     uintptr
	Ftcl_ZlibStreamGetCommandName           uintptr
	Ftcl_ZlibStreamEof                      uintptr
	Ftcl_ZlibStreamChecksum                 uintptr
	Ftcl_ZlibStreamPut                      uintptr
	Ftcl_ZlibStreamGet                      uintptr
	Ftcl_ZlibStreamClose                    uintptr
	Ftcl_ZlibStreamReset                    uintptr
	Ftcl_SetStartupScript                   uintptr
	Ftcl_GetStartupScript                   uintptr
	Ftcl_CloseEx                            uintptr
	Ftcl_NRExprObj                          uintptr
	Ftcl_NRSubstObj                         uintptr
	Ftcl_LoadFile                           uintptr
	Ftcl_FindSymbol                         uintptr
	Ftcl_FSUnloadFile                       uintptr
	Ftcl_ZlibStreamSetCompressionDictionary uintptr
	Freserved631                            uintptr
	Freserved632                            uintptr
	Freserved633                            uintptr
	Freserved634                            uintptr
	Freserved635                            uintptr
	Freserved636                            uintptr
	Freserved637                            uintptr
	Freserved638                            uintptr
	Freserved639                            uintptr
	Freserved640                            uintptr
	Freserved641                            uintptr
	Freserved642                            uintptr
	Freserved643                            uintptr
	Freserved644                            uintptr
	Freserved645                            uintptr
	Freserved646                            uintptr
	Freserved647                            uintptr
	Freserved648                            uintptr
	Freserved649                            uintptr
	Freserved650                            uintptr
	Freserved651                            uintptr
	Freserved652                            uintptr
	Freserved653                            uintptr
	Freserved654                            uintptr
	Freserved655                            uintptr
	Freserved656                            uintptr
	Freserved657                            uintptr
	Freserved658                            uintptr
	Freserved659                            uintptr
	FtclUnusedStubEntry                     uintptr
} /* tclDecls.h:1856:9 */

type TclStubs = TclStubs1 /* tclDecls.h:2545:3 */

// !END!: Do not edit above this line.

// Deprecated Tcl procedures:

// Include platform specific public function declarations that are accessible
// via the stubs table. Make all TclOO symbols MODULE_SCOPE (which only
// has effect on building it as a shared library). See ticket [3010352].

// tclPlatDecls.h --
//
//	Declarations of platform specific Tcl APIs.
//
// Copyright (c) 1998-1999 by Scriptics Corporation.
// All rights reserved.

// WARNING: This file is automatically generated by the tools/genStubs.tcl
// script.  Any modifications to the function declarations below should be made
// in the generic/tcl.decls script.

// TCHAR is needed here for win32, so if it is not defined yet do it here.
// This way, we don't need to include <tchar.h> just for one define.

// !BEGIN!: Do not edit below this line.

// Exported function declarations:

type TclPlatStubs = TclPlatStubs1 /* tclPlatDecls.h:89:3 */

// A null pointer constant.

// _FloatN API tests for enablement.
// Macros to control TS 18661-3 glibc features on x86.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Defined to 1 if the current compiler invocation provides a
//    floating-point type with the IEEE 754 binary128 format, and this
//    glibc includes corresponding *f128 interfaces for it.  The required
//    libgcc support was added some time after the basic compiler
//    support, for x86_64 and x86.

// Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
//    from the default float, double and long double types in this glibc.

// Defined to 1 if the current compiler invocation provides a
//    floating-point type with the right format for _Float64x, and this
//    glibc includes corresponding *f64x interfaces for it.

// Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
//    of long double.  Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
//    the format of _Float128, which must be different from that of long
//    double.

// Defined to concatenate the literal suffix to be used with _Float128
//    types, if __HAVE_FLOAT128 is 1.

// Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.

// The remaining of this file provides support for older compilers.

// The type _Float128 exists only since GCC 7.0.

// __builtin_huge_valf128 doesn't exist before GCC 7.0.

// Older GCC has only a subset of built-in functions for _Float128 on
//    x86, and __builtin_infq is not usable in static initializers.
//    Converting a narrower sNaN to _Float128 produces a quiet NaN, so
//    attempts to use _Float128 sNaNs will not work properly with older
//    compilers.

// In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*,
//    e.g.: __builtin_signbitf128, before GCC 6.  However, there has never
//    been a __builtin_signbitf128 in GCC and the type-generic builtin is
//    only available since GCC 6.

// Macros to control TS 18661-3 glibc features where the same
//    definitions are appropriate for all platforms.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Properties of long double type.  ldbl-96 version.
//    Copyright (C) 2016-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License  published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// long double is distinct from double, so there is nothing to
//    define here.

// This header should be included at the bottom of each bits/floatn.h.
//    It defines the following macros for each _FloatN and _FloatNx type,
//    where the same definitions, or definitions based only on the macros
//    in bits/floatn.h, are appropriate for all glibc configurations.

// Defined to 1 if the current compiler invocation provides a
//    floating-point type with the right format for this type, and this
//    glibc includes corresponding *fN or *fNx interfaces for it.

// Defined to 1 if the corresponding __HAVE_<type> macro is 1 and the
//    type is the first with its format in the sequence of (the default
//    choices for) float, double, long double, _Float16, _Float32,
//    _Float64, _Float128, _Float32x, _Float64x, _Float128x for this
//    glibc; that is, if functions present once per floating-point format
//    rather than once per type are present for this type.
//
//    All configurations supported by glibc have _Float32 the same format
//    as float, _Float64 and _Float32x the same format as double, the
//    _Float64x the same format as either long double or _Float128.  No
//    configurations support _Float128x or, as of GCC 7, have compiler
//    support for a type meeting the requirements for _Float128x.

// Defined to 1 if the corresponding _FloatN type is not binary compatible
//    with the corresponding ISO C type in the current compilation unit as
//    opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built
//    in glibc.

// Defined to 1 if any _FloatN or _FloatNx types that are not
//    ABI-distinct are however distinct types at the C language level (so
//    for the purposes of __builtin_types_compatible_p and _Generic).

// Defined to concatenate the literal suffix to be used with _FloatN
//    or _FloatNx types, if __HAVE_<type> is 1.  The corresponding
//    literal suffixes exist since GCC 7, for C only.

// Defined to a complex type if __HAVE_<type> is 1.

// The remaining of this file provides support for older compilers.

// If double, long double and _Float64 all have the same set of
//    values, TS 18661-3 requires the usual arithmetic conversions on
//    long double and _Float64 to produce _Float64.  For this to be the
//    case when building with a compiler without a distinct _Float64
//    type, _Float64 must be a typedef for long double, not for
//    double.

// Returned by `div'.
type Div_t = struct {
	Fquot int32
	Frem  int32
} /* stdlib.h:62:5 */

// Returned by `ldiv'.
type Ldiv_t = struct {
	Fquot int64
	Frem  int64
} /* stdlib.h:70:5 */

// Returned by `lldiv'.
type Lldiv_t = struct {
	Fquot int64
	Frem  int64
} /* stdlib.h:80:5 */

// Reentrant versions of the `random' family of functions.
//    These functions all use the following data structure to contain
//    state, rather than global state variables.

type Random_data = struct {
	Ffptr        uintptr
	Frptr        uintptr
	Fstate       uintptr
	Frand_type   int32
	Frand_deg    int32
	Frand_sep    int32
	F__ccgo_pad1 [4]byte
	Fend_ptr     uintptr
} /* stdlib.h:423:1 */

// Data structure for communication with thread safe versions.  This
//    type is to be regarded as opaque.  It's only exported because users
//    have to allocate objects of this type.
type Drand48_data = struct {
	F__x     [3]uint16
	F__old_x [3]uint16
	F__c     uint16
	F__init  uint16
	F__a     uint64
} /* stdlib.h:490:1 */

// Shorthand for type of comparison functions.
type X__compar_fn_t = uintptr /* stdlib.h:808:13 */

// If this symbol has done its job, get rid of it.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// Offset of member MEMBER in a struct of type TYPE.

// Type whose alignment is supported in every context and is at least
//    as great as that of any standard type not using alignment
//    specifiers.
type Max_align_t = struct {
	F__max_align_ll int64
	F__max_align_ld float64
} /* stddef.h:426:3 */

// Ensure WORDS_BIGENDIAN is defined correctly:
// Needs to happen here in addition to configure to work with fat compiles on
// Darwin (where configure runs only once for multiple architectures).

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 2.6 Primitive System Data Types	<sys/types.h>

// Compatibility header for old-style Unix parameters and limits.
//    Copyright (C) 1995-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Used to tag functions that are only to be visible within the module being
// built and not outside it (where this is supported by the linker).

// Macros used to cast between pointers and integers (e.g. when storing an int
// in ClientData), on 64-bit architectures they avoid gcc warning about "cast
// to/from pointer from/to integer of different size".

// The following procedures allow namespaces to be customized to support
// special name resolution rules for commands/variables.

type Tcl_ResolvedVarInfo1 = struct {
	FfetchProc  uintptr
	FdeleteProc uintptr
} /* tclInt.h:131:1 */

// The following structure encapsulates the routines needed to resolve a
// variable reference at runtime. Any variable specific state will typically
// be appended to this structure.

type Tcl_ResolvedVarInfo = Tcl_ResolvedVarInfo1 /* tclInt.h:147:3 */

type Tcl_ResolverInfo1 = struct {
	FcmdResProc         uintptr
	FvarResProc         uintptr
	FcompiledVarResProc uintptr
} /* tclInt.h:159:9 */

type Tcl_ResolverInfo = Tcl_ResolverInfo1 /* tclInt.h:170:3 */
type NamespacePathEntry1 = struct {
	FnsPtr        uintptr
	FcreatorNsPtr uintptr
	FprevPtr      uintptr
	FnextPtr      uintptr
} /* tclInt.h:194:9 */

type NamespacePathEntry = NamespacePathEntry1 /* tclInt.h:194:35 */

// Special hashtable for variables: this is just a Tcl_HashTable with an nsPtr
// field added at the end: in this way variables can find their namespace
// without having to copy a pointer in their struct: they can access it via
// their hPtr->tablePtr.

type TclVarHashTable1 = struct {
	Ftable Tcl_HashTable
	FnsPtr uintptr
} /* tclInt.h:194:9 */

// Special hashtable for variables: this is just a Tcl_HashTable with an nsPtr
// field added at the end: in this way variables can find their namespace
// without having to copy a pointer in their struct: they can access it via
// their hPtr->tablePtr.

type Namespace1 = struct {
	Fname                  uintptr
	FfullName              uintptr
	FclientData            ClientData
	FdeleteProc            uintptr
	FparentPtr             uintptr
	FchildTable            Tcl_HashTable
	FnsId                  int64
	Finterp                uintptr
	Fflags                 int32
	FactivationCount       int32
	FrefCount              int32
	F__ccgo_pad1           [4]byte
	FcmdTable              Tcl_HashTable
	FvarTable              TclVarHashTable
	FexportArrayPtr        uintptr
	FnumExportPatterns     int32
	FmaxExportPatterns     int32
	FcmdRefEpoch           int32
	FresolverEpoch         int32
	FcmdResProc            uintptr
	FvarResProc            uintptr
	FcompiledVarResProc    uintptr
	FexportLookupEpoch     int32
	F__ccgo_pad2           [4]byte
	Fensembles             uintptr
	FunknownHandlerPtr     uintptr
	FcommandPathLength     int32
	F__ccgo_pad3           [4]byte
	FcommandPathArray      uintptr
	FcommandPathSourceList uintptr
	FearlyDeleteProc       uintptr
} /* tclInt.h:194:9 */

// Special hashtable for variables: this is just a Tcl_HashTable with an nsPtr
// field added at the end: in this way variables can find their namespace
// without having to copy a pointer in their struct: they can access it via
// their hPtr->tablePtr.

type TclVarHashTable = TclVarHashTable1 /* tclInt.h:206:3 */

// This is for itcl - it likes to search our varTables directly :(

// Define this to reduce the amount of space that the average namespace
// consumes by only allocating the table of child namespaces when necessary.
// Defining it breaks compatibility for Tcl extensions (e.g., itcl) which
// reach directly into the Namespace structure.

// The structure below defines a namespace.
// Note: the first five fields must match exactly the fields in a
// Tcl_Namespace structure (see tcl.h). If you change one, be sure to change
// the other.

type Namespace = Namespace1 /* tclInt.h:345:3 */

// Flags used to represent the status of a namespace:
//
// NS_DYING -	1 means Tcl_DeleteNamespace has been called to delete the
//		namespace but there are still active call frames on the Tcl
//		stack that refer to the namespace. When the last call frame
//		referring to it has been popped, it's variables and command
//		will be destroyed and it will be marked "dead" (NS_DEAD). The
//		namespace can no longer be looked up by name.
// NS_DEAD -	1 means Tcl_DeleteNamespace has been called to delete the
//		namespace and no call frames still refer to it. Its variables
//		and command have already been destroyed. This bit allows the
//		namespace resolution code to recognize that the namespace is
//		"deleted". When the last namespaceName object in any byte code
//		unit that refers to the namespace has been freed (i.e., when
//		the namespace's refCount is 0), the namespace's storage will
//		be freed.
// NS_KILLED -	1 means that TclTeardownNamespace has already been called on
//		this namespace and it should not be called again [Bug 1355942]
// NS_SUPPRESS_COMPILATION -
//		Marks the commands in this namespace for not being compiled,
//		forcing them to be looked up every time.

// Flags passed to TclGetNamespaceForQualName:
//
// TCL_GLOBAL_ONLY		- (see tcl.h) Look only in the global ns.
// TCL_NAMESPACE_ONLY		- (see tcl.h) Look only in the context ns.
// TCL_CREATE_NS_IF_UNKNOWN	- Create unknown namespaces.
// TCL_FIND_ONLY_NS		- The name sought is a namespace name.

// The client data for an ensemble command. This consists of the table of
// commands that are actually exported by the namespace, and an epoch counter
// that, combined with the exportLookupEpoch field of the namespace structure,
// defines whether the table contains valid data or will need to be recomputed
// next time the ensemble command is called.

type EnsembleConfig1 = struct {
	FnsPtr              uintptr
	Ftoken              Tcl_Command
	Fepoch              int32
	F__ccgo_pad1        [4]byte
	FsubcommandArrayPtr uintptr
	FsubcommandTable    Tcl_HashTable
	Fnext               uintptr
	Fflags              int32
	F__ccgo_pad2        [4]byte
	FsubcommandDict     uintptr
	FsubcmdList         uintptr
	FunknownHandler     uintptr
	FparameterList      uintptr
	FnumParameters      int32
	F__ccgo_pad3        [4]byte
} /* tclInt.h:415:9 */

// Flags used to represent the status of a namespace:
//
// NS_DYING -	1 means Tcl_DeleteNamespace has been called to delete the
//		namespace but there are still active call frames on the Tcl
//		stack that refer to the namespace. When the last call frame
//		referring to it has been popped, it's variables and command
//		will be destroyed and it will be marked "dead" (NS_DEAD). The
//		namespace can no longer be looked up by name.
// NS_DEAD -	1 means Tcl_DeleteNamespace has been called to delete the
//		namespace and no call frames still refer to it. Its variables
//		and command have already been destroyed. This bit allows the
//		namespace resolution code to recognize that the namespace is
//		"deleted". When the last namespaceName object in any byte code
//		unit that refers to the namespace has been freed (i.e., when
//		the namespace's refCount is 0), the namespace's storage will
//		be freed.
// NS_KILLED -	1 means that TclTeardownNamespace has already been called on
//		this namespace and it should not be called again [Bug 1355942]
// NS_SUPPRESS_COMPILATION -
//		Marks the commands in this namespace for not being compiled,
//		forcing them to be looked up every time.

// Flags passed to TclGetNamespaceForQualName:
//
// TCL_GLOBAL_ONLY		- (see tcl.h) Look only in the global ns.
// TCL_NAMESPACE_ONLY		- (see tcl.h) Look only in the context ns.
// TCL_CREATE_NS_IF_UNKNOWN	- Create unknown namespaces.
// TCL_FIND_ONLY_NS		- The name sought is a namespace name.

// The client data for an ensemble command. This consists of the table of
// commands that are actually exported by the namespace, and an epoch counter
// that, combined with the exportLookupEpoch field of the namespace structure,
// defines whether the table contains valid data or will need to be recomputed
// next time the ensemble command is called.

type EnsembleConfig = EnsembleConfig1 /* tclInt.h:483:3 */

// Various bits for the EnsembleConfig.flags field.

//----------------------------------------------------------------
// Data structures related to variables. These are used primarily in tclVar.c
//----------------------------------------------------------------

// The following structure defines a variable trace, which is used to invoke a
// specific C procedure whenever certain operations are performed on a
// variable.

type VarTrace1 = struct {
	FtraceProc   uintptr
	FclientData  ClientData
	Fflags       int32
	F__ccgo_pad1 [4]byte
	FnextPtr     uintptr
} /* tclInt.h:506:9 */

// Various bits for the EnsembleConfig.flags field.

//----------------------------------------------------------------
// Data structures related to variables. These are used primarily in tclVar.c
//----------------------------------------------------------------

// The following structure defines a variable trace, which is used to invoke a
// specific C procedure whenever certain operations are performed on a
// variable.

type VarTrace = VarTrace1 /* tclInt.h:516:3 */

// The following structure defines a command trace, which is used to invoke a
// specific C procedure whenever certain operations are performed on a
// command.

type CommandTrace1 = struct {
	FtraceProc   uintptr
	FclientData  ClientData
	Fflags       int32
	F__ccgo_pad1 [4]byte
	FnextPtr     uintptr
	FrefCount    int32
	F__ccgo_pad2 [4]byte
} /* tclInt.h:524:9 */

// The following structure defines a command trace, which is used to invoke a
// specific C procedure whenever certain operations are performed on a
// command.

type CommandTrace = CommandTrace1 /* tclInt.h:539:3 */

// When a command trace is active (i.e. its associated procedure is executing)
// one of the following structures is linked into a list associated with the
// command's interpreter. The information in the structure is needed in order
// for Tcl to behave reasonably if traces are deleted while traces are active.

type ActiveCommandTrace1 = struct {
	FcmdPtr       uintptr
	FnextPtr      uintptr
	FnextTracePtr uintptr
	FreverseScan  int32
	F__ccgo_pad1  [4]byte
} /* tclInt.h:548:9 */

// When a command trace is active (i.e. its associated procedure is executing)
// one of the following structures is linked into a list associated with the
// command's interpreter. The information in the structure is needed in order
// for Tcl to behave reasonably if traces are deleted while traces are active.

type Command1 = struct {
	FhPtr          uintptr
	FnsPtr         uintptr
	FrefCount      int32
	FcmdEpoch      int32
	FcompileProc   uintptr
	FobjProc       uintptr
	FobjClientData ClientData
	Fproc          uintptr
	FclientData    ClientData
	FdeleteProc    uintptr
	FdeleteData    ClientData
	Fflags         int32
	F__ccgo_pad1   [4]byte
	FimportRefPtr  uintptr
	FtracePtr      uintptr
	FnreProc       uintptr
} /* tclInt.h:548:9 */

// When a command trace is active (i.e. its associated procedure is executing)
// one of the following structures is linked into a list associated with the
// command's interpreter. The information in the structure is needed in order
// for Tcl to behave reasonably if traces are deleted while traces are active.

type ActiveCommandTrace = ActiveCommandTrace1 /* tclInt.h:559:3 */

// When a variable trace is active (i.e. its associated procedure is
// executing) one of the following structures is linked into a list associated
// with the variable's interpreter. The information in the structure is needed
// in order for Tcl to behave reasonably if traces are deleted while traces
// are active.

type ActiveVarTrace1 = struct {
	FvarPtr       uintptr
	FnextPtr      uintptr
	FnextTracePtr uintptr
} /* tclInt.h:569:9 */

// When a variable trace is active (i.e. its associated procedure is
// executing) one of the following structures is linked into a list associated
// with the variable's interpreter. The information in the structure is needed
// in order for Tcl to behave reasonably if traces are deleted while traces
// are active.

type Var1 = struct {
	Fflags       int32
	F__ccgo_pad1 [4]byte
	Fvalue       struct{ FobjPtr uintptr }
} /* tclInt.h:569:9 */

// When a variable trace is active (i.e. its associated procedure is
// executing) one of the following structures is linked into a list associated
// with the variable's interpreter. The information in the structure is needed
// in order for Tcl to behave reasonably if traces are deleted while traces
// are active.

type ActiveVarTrace = ActiveVarTrace1 /* tclInt.h:578:3 */

// The structure below defines a variable, which associates a string name with
// a Tcl_Obj value. These structures are kept in procedure call frames (for
// local variables recognized by the compiler) or in the heap (for global
// variables and any variable not known to the compiler). For each Var
// structure in the heap, a hash table entry holds the variable name and a
// pointer to the Var structure.

type Var = Var1 /* tclInt.h:604:3 */

type VarInHash1 = struct {
	Fvar         Var
	FrefCount    int32
	F__ccgo_pad1 [4]byte
	Fentry       Tcl_HashEntry
} /* tclInt.h:606:9 */

type VarInHash = VarInHash1 /* tclInt.h:621:3 */

// The variable-length structure below describes a local variable of a
// procedure that was recognized by the compiler. These variables have a name,
// an element in the array of compiler-assigned local variables in the
// procedure's call frame, and various other items of information. If the
// local variable is a formal argument, it may also have a default value. The
// compiler can't recognize local variables whose names are expressions (these
// names are only known at runtime when the expressions are evaluated) or
// local variables that are created as a result of an "upvar" or "uplevel"
// command. These other local variables are kept separately in a hash table in
// the call frame.

type CompiledLocal1 = struct {
	F__ccgo_pad1 [0]uint64
	FnextPtr     uintptr
	FnameLength  int32
	FframeIndex  int32
	Fflags       int32
	F__ccgo_pad2 [4]byte
	FdefValuePtr uintptr
	FresolveInfo uintptr
} /* tclInt.h:906:9 */

// The variable-length structure below describes a local variable of a
// procedure that was recognized by the compiler. These variables have a name,
// an element in the array of compiler-assigned local variables in the
// procedure's call frame, and various other items of information. If the
// local variable is a formal argument, it may also have a default value. The
// compiler can't recognize local variables whose names are expressions (these
// names are only known at runtime when the expressions are evaluated) or
// local variables that are created as a result of an "upvar" or "uplevel"
// command. These other local variables are kept separately in a hash table in
// the call frame.

type CompiledLocal = CompiledLocal1 /* tclInt.h:934:3 */

// The structure below defines a command procedure, which consists of a
// collection of Tcl commands plus information about arguments and other local
// variables recognized at compile time.

type Proc1 = struct {
	FiPtr              uintptr
	FrefCount          int32
	F__ccgo_pad1       [4]byte
	FcmdPtr            uintptr
	FbodyPtr           uintptr
	FnumArgs           int32
	FnumCompiledLocals int32
	FfirstLocalPtr     uintptr
	FlastLocalPtr      uintptr
} /* tclInt.h:942:9 */

// The structure below defines a command procedure, which consists of a
// collection of Tcl commands plus information about arguments and other local
// variables recognized at compile time.

type Interp1 = struct {
	Fresult            uintptr
	FfreeProc          uintptr
	FerrorLine         int32
	F__ccgo_pad1       [4]byte
	FstubTable         uintptr
	Fhandle            TclHandle
	FglobalNsPtr       uintptr
	FhiddenCmdTablePtr uintptr
	FinterpInfo        ClientData
	Fextra             struct {
		Foptimizer   uintptr
		F__ccgo_pad1 [80]byte
	}
	FnumLevels              int32
	FmaxNestingDepth        int32
	FframePtr               uintptr
	FvarFramePtr            uintptr
	FactiveVarTracePtr      uintptr
	FreturnCode             int32
	F__ccgo_pad2            [4]byte
	FrootFramePtr           uintptr
	FlookupNsPtr            uintptr
	FappendResult           uintptr
	FappendAvl              int32
	FappendUsed             int32
	FpackageTable           Tcl_HashTable
	FpackageUnknown         uintptr
	FcmdCount               int32
	FevalFlags              int32
	Funused1                int32
	F__ccgo_pad3            [4]byte
	FliteralTable           LiteralTable
	FcompileEpoch           int32
	F__ccgo_pad4            [4]byte
	FcompiledProcPtr        uintptr
	FresolverPtr            uintptr
	FscriptFile             uintptr
	Fflags                  int32
	F__ccgo_pad5            [4]byte
	FrandSeed               int64
	FtracePtr               uintptr
	FassocData              uintptr
	FexecEnvPtr             uintptr
	FemptyObjPtr            uintptr
	FresultSpace            [201]int8
	F__ccgo_pad6            [7]byte
	FobjResultPtr           uintptr
	FthreadId               Tcl_ThreadId
	FactiveCmdTracePtr      uintptr
	FactiveInterpTracePtr   uintptr
	FtracesForbiddingInline int32
	F__ccgo_pad7            [4]byte
	FreturnOpts             uintptr
	FerrorInfo              uintptr
	FeiVar                  uintptr
	FerrorCode              uintptr
	FecVar                  uintptr
	FreturnLevel            int32
	F__ccgo_pad8            [4]byte
	Flimit                  struct {
		Factive            int32
		FgranularityTicker int32
		Fexceeded          int32
		FcmdCount          int32
		FcmdHandlers       uintptr
		FcmdGranularity    int32
		F__ccgo_pad1       [4]byte
		Ftime              Tcl_Time
		FtimeHandlers      uintptr
		FtimeGranularity   int32
		F__ccgo_pad2       [4]byte
		FtimeEvent         Tcl_TimerToken
		Fcallbacks         Tcl_HashTable
	}
	FensembleRewrite struct {
		FsourceObjs      uintptr
		FnumRemovedObjs  int32
		FnumInsertedObjs int32
	}
	FchanMsg           uintptr
	FcmdFramePtr       uintptr
	FinvokeCmdFramePtr uintptr
	FinvokeWord        int32
	F__ccgo_pad9       [4]byte
	FlinePBodyPtr      uintptr
	FlineBCPtr         uintptr
	FlineLABCPtr       uintptr
	FlineLAPtr         uintptr
	FscriptCLLocPtr    uintptr
	FpackagePrefer     int32
	F__ccgo_pad10      [4]byte
	FvarTraces         Tcl_HashTable
	FvarSearches       Tcl_HashTable
	FallocCache        uintptr
	FpendingObjDataPtr uintptr
	FasyncReadyPtr     uintptr
	FobjectFoundation  uintptr
	FdeferredCallbacks uintptr
	FasyncCancel       Tcl_AsyncHandler
	FasyncCancelMsg    uintptr
	FerrorStack        uintptr
	FupLiteral         uintptr
	FcallLiteral       uintptr
	FinnerLiteral      uintptr
	FinnerContext      uintptr
	FresetErrorStack   int32
	F__ccgo_pad11      [4]byte
} /* tclInt.h:942:9 */

// The structure below defines a command procedure, which consists of a
// collection of Tcl commands plus information about arguments and other local
// variables recognized at compile time.

type Proc = Proc1 /* tclInt.h:969:3 */

// The structure below defines a command trace. This is used to allow Tcl
// clients to find out whenever a command is about to be executed.

type Trace1 = struct {
	Flevel       int32
	F__ccgo_pad1 [4]byte
	Fproc        uintptr
	FclientData  ClientData
	FnextPtr     uintptr
	Fflags       int32
	F__ccgo_pad2 [4]byte
	FdelProc     uintptr
} /* tclInt.h:942:9 */

// The structure below defines a command trace. This is used to allow Tcl
// clients to find out whenever a command is about to be executed.

type Trace = Trace1 /* tclInt.h:993:3 */

// When an interpreter trace is active (i.e. its associated procedure is
// executing), one of the following structures is linked into a list
// associated with the interpreter. The information in the structure is needed
// in order for Tcl to behave reasonably if traces are deleted while traces
// are active.

type ActiveInterpTrace1 = struct {
	FnextPtr      uintptr
	FnextTracePtr uintptr
	FreverseScan  int32
	F__ccgo_pad1  [4]byte
} /* tclInt.h:942:9 */

// When an interpreter trace is active (i.e. its associated procedure is
// executing), one of the following structures is linked into a list
// associated with the interpreter. The information in the structure is needed
// in order for Tcl to behave reasonably if traces are deleted while traces
// are active.

type ActiveInterpTrace = ActiveInterpTrace1 /* tclInt.h:1013:3 */

// Flag values designating types of execution traces. See tclTrace.c for
// related flag values.
//
// TCL_TRACE_ENTER_EXEC		- triggers enter/enterstep traces.
// 				- passed to Tcl_CreateObjTrace to set up
//				  "enterstep" traces.
// TCL_TRACE_LEAVE_EXEC		- triggers leave/leavestep traces.
// 				- passed to Tcl_CreateObjTrace to set up
//				  "leavestep" traces.

// The structure below defines an entry in the assocData hash table which is
// associated with an interpreter. The entry contains a pointer to a function
// to call when the interpreter is deleted, and a pointer to a user-defined
// piece of data.

type AssocData1 = struct {
	Fproc       uintptr
	FclientData ClientData
} /* tclInt.h:1037:9 */

// Flag values designating types of execution traces. See tclTrace.c for
// related flag values.
//
// TCL_TRACE_ENTER_EXEC		- triggers enter/enterstep traces.
// 				- passed to Tcl_CreateObjTrace to set up
//				  "enterstep" traces.
// TCL_TRACE_LEAVE_EXEC		- triggers leave/leavestep traces.
// 				- passed to Tcl_CreateObjTrace to set up
//				  "leavestep" traces.

// The structure below defines an entry in the assocData hash table which is
// associated with an interpreter. The entry contains a pointer to a function
// to call when the interpreter is deleted, and a pointer to a user-defined
// piece of data.

type AssocData = AssocData1 /* tclInt.h:1040:3 */

// The structure below defines a call frame. A call frame defines a naming
// context for a procedure call: its local naming scope (for local variables)
// and its global naming scope (a namespace, perhaps the global :: namespace).
// A call frame can also define the naming context for a namespace eval or
// namespace inscope command: the namespace in which the command's code should
// execute. The Tcl_CallFrame structures exist only while procedures or
// namespace eval/inscope's are being executed, and provide a kind of Tcl call
// stack.
//
// WARNING!! The structure definition must be kept consistent with the
// Tcl_CallFrame structure in tcl.h. If you change one, change the other.

// Will be grown to contain: pointers to the varnames (allocated at the end),
// plus the init values for each variable (suitable to be memcopied on init)

type LocalCache1 = struct {
	FrefCount int32
	FnumVars  int32
	FvarName0 uintptr
} /* tclInt.h:942:9 */

// The structure below defines a call frame. A call frame defines a naming
// context for a procedure call: its local naming scope (for local variables)
// and its global naming scope (a namespace, perhaps the global :: namespace).
// A call frame can also define the naming context for a namespace eval or
// namespace inscope command: the namespace in which the command's code should
// execute. The Tcl_CallFrame structures exist only while procedures or
// namespace eval/inscope's are being executed, and provide a kind of Tcl call
// stack.
//
// WARNING!! The structure definition must be kept consistent with the
// Tcl_CallFrame structure in tcl.h. If you change one, change the other.

// Will be grown to contain: pointers to the varnames (allocated at the end),
// plus the init values for each variable (suitable to be memcopied on init)

type LocalCache = LocalCache1 /* tclInt.h:1065:3 */

type CallFrame1 = struct {
	FnsPtr             uintptr
	FisProcCallFrame   int32
	Fobjc              int32
	Fobjv              uintptr
	FcallerPtr         uintptr
	FcallerVarPtr      uintptr
	Flevel             int32
	F__ccgo_pad1       [4]byte
	FprocPtr           uintptr
	FvarTablePtr       uintptr
	FnumCompiledLocals int32
	F__ccgo_pad2       [4]byte
	FcompiledLocals    uintptr
	FclientData        ClientData
	FlocalCachePtr     uintptr
	FtailcallPtr       uintptr
} /* tclInt.h:942:9 */

type CallFrame = CallFrame1 /* tclInt.h:1129:3 */

// TIP #280
// The structure below defines a command frame. A command frame provides
// location information for all commands executing a tcl script (source, eval,
// uplevel, procedure bodies, ...). The runtime structure essentially contains
// the stack trace as it would be if the currently executing command were to
// throw an error.
//
// For commands where it makes sense it refers to the associated CallFrame as
// well.
//
// The structures are chained in a single list, with the top of the stack
// anchored in the Interp structure.
//
// Instances can be allocated on the C stack, or the heap, the former making
// cleanup a bit simpler.

type CmdFrame1 = struct {
	Ftype        int32
	Flevel       int32
	Fline        uintptr
	Fnline       int32
	F__ccgo_pad1 [4]byte
	FframePtr    uintptr
	FnextPtr     uintptr
	Fdata        struct {
		Feval        struct{ Fpath uintptr }
		F__ccgo_pad1 [8]byte
	}
	FcmdObj      uintptr
	Fcmd         uintptr
	Flen         int32
	F__ccgo_pad2 [4]byte
	Flitarg      uintptr
} /* tclInt.h:942:9 */

// TIP #280
// The structure below defines a command frame. A command frame provides
// location information for all commands executing a tcl script (source, eval,
// uplevel, procedure bodies, ...). The runtime structure essentially contains
// the stack trace as it would be if the currently executing command were to
// throw an error.
//
// For commands where it makes sense it refers to the associated CallFrame as
// well.
//
// The structures are chained in a single list, with the top of the stack
// anchored in the Interp structure.
//
// Instances can be allocated on the C stack, or the heap, the former making
// cleanup a bit simpler.

type CFWordBC1 = struct {
	FframePtr uintptr
	Fpc       int32
	Fword     int32
	FprevPtr  uintptr
	FnextPtr  uintptr
	Fobj      uintptr
} /* tclInt.h:942:9 */

// TIP #280
// The structure below defines a command frame. A command frame provides
// location information for all commands executing a tcl script (source, eval,
// uplevel, procedure bodies, ...). The runtime structure essentially contains
// the stack trace as it would be if the currently executing command were to
// throw an error.
//
// For commands where it makes sense it refers to the associated CallFrame as
// well.
//
// The structures are chained in a single list, with the top of the stack
// anchored in the Interp structure.
//
// Instances can be allocated on the C stack, or the heap, the former making
// cleanup a bit simpler.

type CmdFrame = CmdFrame1 /* tclInt.h:1219:3 */

type CFWord1 = struct {
	FframePtr uintptr
	Fword     int32
	FrefCount int32
} /* tclInt.h:1221:9 */

type CFWord = CFWord1 /* tclInt.h:1226:3 */

type CFWordBC = CFWordBC1 /* tclInt.h:1238:3 */

// Structure to record the locations of invisible continuation lines in
// literal scripts, as character offset from the beginning of the script. Both
// compiler and direct evaluator use this information to adjust their line
// counters when tracking through the script, because when it is invoked the
// continuation line marker as a whole has been removed already, meaning that
// the \n which was part of it is gone as well, breaking regular line
// tracking.
//
// These structures are allocated and filled by both the function
// TclSubstTokens() in the file "tclParse.c" and its caller TclEvalEx() in the
// file "tclBasic.c", and stored in the thread-global hashtable "lineCLPtr" in
// file "tclObj.c". They are used by the functions TclSetByteCodeFromAny() and
// TclCompileScript(), both found in the file "tclCompile.c". Their memory is
// released by the function TclFreeObj(), in the file "tclObj.c", and also by
// the function TclThreadFinalizeObjects(), in the same file.

type ContLineLoc1 = struct {
	F__ccgo_pad1 [0]uint32
	Fnum         int32
} /* tclInt.h:942:9 */

// Structure to record the locations of invisible continuation lines in
// literal scripts, as character offset from the beginning of the script. Both
// compiler and direct evaluator use this information to adjust their line
// counters when tracking through the script, because when it is invoked the
// continuation line marker as a whole has been removed already, meaning that
// the \n which was part of it is gone as well, breaking regular line
// tracking.
//
// These structures are allocated and filled by both the function
// TclSubstTokens() in the file "tclParse.c" and its caller TclEvalEx() in the
// file "tclBasic.c", and stored in the thread-global hashtable "lineCLPtr" in
// file "tclObj.c". They are used by the functions TclSetByteCodeFromAny() and
// TclCompileScript(), both found in the file "tclCompile.c". Their memory is
// released by the function TclFreeObj(), in the file "tclObj.c", and also by
// the function TclThreadFinalizeObjects(), in the same file.

type ContLineLoc = ContLineLoc1 /* tclInt.h:1269:3 */
type ExtraFrameInfoField = struct {
	Fname       uintptr
	Fproc       uintptr
	FclientData ClientData
} /* tclInt.h:1309:3 */
type ExtraFrameInfo = struct {
	Flength      int32
	F__ccgo_pad1 [4]byte
	Ffields      [2]ExtraFrameInfoField
} /* tclInt.h:1315:3 */

//----------------------------------------------------------------
// Data structures and procedures related to TclHandles, which are a very
// lightweight method of preserving enough information to determine if an
// arbitrary malloc'd block has been deleted.
//----------------------------------------------------------------

type TclHandle = uintptr /* tclInt.h:1325:14 */

// This is a convenience macro used to initialize a thread local storage ptr.

//----------------------------------------------------------------
// Data structures related to bytecode compilation and execution. These are
// used primarily in tclCompile.c, tclExecute.c, and tclBasic.c.
//----------------------------------------------------------------

// Forward declaration to prevent errors when the forward references to
// Tcl_Parse and CompileEnv are encountered in the procedure type CompileProc
// declared below.

type CompileEnv1 = struct {
	FiPtr                    uintptr
	Fsource                  uintptr
	FnumSrcBytes             int32
	F__ccgo_pad1             [4]byte
	FprocPtr                 uintptr
	FnumCommands             int32
	FexceptDepth             int32
	FmaxExceptDepth          int32
	FmaxStackDepth           int32
	FcurrStackDepth          int32
	F__ccgo_pad2             [4]byte
	FlocalLitTable           LiteralTable
	FcodeStart               uintptr
	FcodeNext                uintptr
	FcodeEnd                 uintptr
	FmallocedCodeArray       int32
	F__ccgo_pad3             [4]byte
	FliteralArrayPtr         uintptr
	FliteralArrayNext        int32
	FliteralArrayEnd         int32
	FmallocedLiteralArray    int32
	F__ccgo_pad4             [4]byte
	FexceptArrayPtr          uintptr
	FexceptArrayNext         int32
	FexceptArrayEnd          int32
	FmallocedExceptArray     int32
	F__ccgo_pad5             [4]byte
	FexceptAuxArrayPtr       uintptr
	FcmdMapPtr               uintptr
	FcmdMapEnd               int32
	FmallocedCmdMap          int32
	FauxDataArrayPtr         uintptr
	FauxDataArrayNext        int32
	FauxDataArrayEnd         int32
	FmallocedAuxDataArray    int32
	FstaticCodeSpace         [250]uint8
	F__ccgo_pad6             [2]byte
	FstaticLiteralSpace      [60]LiteralEntry
	FstaticExceptArraySpace  [5]ExceptionRange
	F__ccgo_pad7             [4]byte
	FstaticExAuxArraySpace   [5]ExceptionAux
	FstaticCmdMapSpace       [40]CmdLocation
	FstaticAuxDataArraySpace [5]AuxData
	FextCmdMapPtr            uintptr
	Fline                    int32
	FatCmdStart              int32
	FexpandCount             int32
	F__ccgo_pad8             [4]byte
	FclNext                  uintptr
} /* tclInt.h:1367:1 */

// The data structure for a (linked list of) execution stacks.

type ExecStack1 = struct {
	F__ccgo_pad1 [0]uint64
	FprevPtr     uintptr
	FnextPtr     uintptr
	FmarkerPtr   uintptr
	FendPtr      uintptr
	FtosPtr      uintptr
} /* tclInt.h:942:9 */

// The data structure for a (linked list of) execution stacks.

type ExecStack = ExecStack1 /* tclInt.h:1413:3 */

// The data structure defining the execution environment for ByteCode's.
// There is one ExecEnv structure per Tcl interpreter. It holds the evaluation
// stack that holds command operands and results. The stack grows towards
// increasing addresses. The member stackPtr points to the stackItems of the
// currently active execution stack.

type CorContext1 = struct {
	FframePtr    uintptr
	FvarFramePtr uintptr
	FcmdFramePtr uintptr
	FlineLABCPtr uintptr
} /* tclInt.h:942:9 */

// The data structure defining the execution environment for ByteCode's.
// There is one ExecEnv structure per Tcl interpreter. It holds the evaluation
// stack that holds command operands and results. The stack grows towards
// increasing addresses. The member stackPtr points to the stackItems of the
// currently active execution stack.

type CorContext = CorContext1 /* tclInt.h:1428:3 */

type CoroutineData1 = struct {
	FcmdPtr       uintptr
	FeePtr        uintptr
	FcallerEEPtr  uintptr
	Fcaller       CorContext
	Frunning      CorContext
	FlineLABCPtr  uintptr
	FstackLevel   uintptr
	FauxNumLevels int32
	Fnargs        int32
} /* tclInt.h:942:9 */

type ExecEnv1 = struct {
	FexecStackPtr uintptr
	Fconstants    [2]uintptr
	Finterp       uintptr
	FcallbackPtr  uintptr
	FcorPtr       uintptr
	Frewind       int32
	F__ccgo_pad1  [4]byte
} /* tclInt.h:942:9 */

type CoroutineData = CoroutineData1 /* tclInt.h:1449:3 */

type NRE_callback1 = struct {
	FprocPtr uintptr
	Fdata    [4]ClientData
	FnextPtr uintptr
} /* tclInt.h:942:9 */

type ExecEnv = ExecEnv1 /* tclInt.h:1460:3 */

// The definitions for the LiteralTable and LiteralEntry structures. Each
// interpreter contains a LiteralTable. It is used to reduce the storage
// needed for all the Tcl objects that hold the literals of scripts compiled
// by the interpreter. A literal's object is shared by all the ByteCodes that
// refer to the literal. Each distinct literal has one LiteralEntry entry in
// the LiteralTable. A literal table is a specialized hash table that is
// indexed by the literal's string representation, which may contain null
// characters.
//
// Note that we reduce the space needed for literals by sharing literal
// objects both within a ByteCode (each ByteCode contains a local
// LiteralTable) and across all an interpreter's ByteCodes (with the
// interpreter's global LiteralTable).

type LiteralEntry1 = struct {
	FnextPtr     uintptr
	FobjPtr      uintptr
	FrefCount    int32
	F__ccgo_pad1 [4]byte
	FnsPtr       uintptr
} /* tclInt.h:942:9 */

// The definitions for the LiteralTable and LiteralEntry structures. Each
// interpreter contains a LiteralTable. It is used to reduce the storage
// needed for all the Tcl objects that hold the literals of scripts compiled
// by the interpreter. A literal's object is shared by all the ByteCodes that
// refer to the literal. Each distinct literal has one LiteralEntry entry in
// the LiteralTable. A literal table is a specialized hash table that is
// indexed by the literal's string representation, which may contain null
// characters.
//
// Note that we reduce the space needed for literals by sharing literal
// objects both within a ByteCode (each ByteCode contains a local
// LiteralTable) and across all an interpreter's ByteCodes (with the
// interpreter's global LiteralTable).

type LiteralEntry = LiteralEntry1 /* tclInt.h:1496:3 */

type LiteralTable1 = struct {
	Fbuckets       uintptr
	FstaticBuckets [4]uintptr
	FnumBuckets    int32
	FnumEntries    int32
	FrebuildSize   int32
	Fmask          int32
} /* tclInt.h:942:9 */

type LiteralTable = LiteralTable1 /* tclInt.h:1512:3 */

// The following structure defines for each Tcl interpreter various
// statistics-related information about the bytecode compiler and
// interpreter's operation in that interpreter.

// Structure used in implementation of those core ensembles which are
// partially compiled. Used as an array of these, with a terminating field
// whose 'name' is NULL.

type EnsembleImplMap = struct {
	Fname        uintptr
	Fproc        uintptr
	FcompileProc uintptr
	FnreProc     uintptr
	FclientData  ClientData
	Funsafe      int32
	F__ccgo_pad1 [4]byte
} /* tclInt.h:1566:3 */

//----------------------------------------------------------------
// Data structures related to commands.
//----------------------------------------------------------------

// An imported command is created in an namespace when it imports a "real"
// command from another namespace. An imported command has a Command structure
// that points (via its ClientData value) to the "real" Command structure in
// the source namespace's command table. The real command records all the
// imported commands that refer to it in a list of ImportRef structures so
// that they can be deleted when the real command is deleted.

type ImportRef1 = struct {
	FimportedCmdPtr uintptr
	FnextPtr        uintptr
} /* tclInt.h:548:9 */

//----------------------------------------------------------------
// Data structures related to commands.
//----------------------------------------------------------------

// An imported command is created in an namespace when it imports a "real"
// command from another namespace. An imported command has a Command structure
// that points (via its ClientData value) to the "real" Command structure in
// the source namespace's command table. The real command records all the
// imported commands that refer to it in a list of ImportRef structures so
// that they can be deleted when the real command is deleted.

type ImportRef = ImportRef1 /* tclInt.h:1594:3 */

// Data structure used as the ClientData of imported commands: commands
// created in an namespace when it imports a "real" command from another
// namespace.

type ImportedCmdData1 = struct {
	FrealCmdPtr uintptr
	FselfPtr    uintptr
} /* tclInt.h:1602:9 */

// Data structure used as the ClientData of imported commands: commands
// created in an namespace when it imports a "real" command from another
// namespace.

type ImportedCmdData = ImportedCmdData1 /* tclInt.h:1609:3 */

// A Command structure exists for each command in a namespace. The Tcl_Command
// opaque type actually refers to these structures.

type Command = Command1 /* tclInt.h:1659:3 */

// Flag bits for commands.
//
// CMD_IS_DELETED -		Means that the command is in the process of
//				being deleted (its deleteProc is currently
//				executing). Other attempts to delete the
//				command should be ignored.
// CMD_TRACE_ACTIVE -		1 means that trace processing is currently
//				underway for a rename/delete change. See the
//				two flags below for which is currently being
//				processed.
// CMD_HAS_EXEC_TRACES -	1 means that this command has at least one
//				execution trace (as opposed to simple
//				delete/rename traces) in its tracePtr list.
// CMD_COMPILES_EXPANDED -	1 means that this command has a compiler that
//				can handle expansion (provided it is not the
//				first word).
// TCL_TRACE_RENAME -		A rename trace is in progress. Further
//				recursive renames will not be traced.
// TCL_TRACE_DELETE -		A delete trace is in progress. Further
//				recursive deletes will not be traced.
// (these last two flags are defined in tcl.h)

//----------------------------------------------------------------
// Data structures related to name resolution procedures.
//----------------------------------------------------------------

// The interpreter keeps a linked list of name resolution schemes. The scheme
// for a namespace is consulted first, followed by the list of schemes in an
// interpreter, followed by the default name resolution in Tcl. Schemes are
// added/removed from the interpreter's list by calling Tcl_AddInterpResolver
// and Tcl_RemoveInterpResolver.

type ResolverScheme1 = struct {
	Fname               uintptr
	FcmdResProc         uintptr
	FvarResProc         uintptr
	FcompiledVarResProc uintptr
	FnextPtr            uintptr
} /* tclInt.h:942:9 */

// Flag bits for commands.
//
// CMD_IS_DELETED -		Means that the command is in the process of
//				being deleted (its deleteProc is currently
//				executing). Other attempts to delete the
//				command should be ignored.
// CMD_TRACE_ACTIVE -		1 means that trace processing is currently
//				underway for a rename/delete change. See the
//				two flags below for which is currently being
//				processed.
// CMD_HAS_EXEC_TRACES -	1 means that this command has at least one
//				execution trace (as opposed to simple
//				delete/rename traces) in its tracePtr list.
// CMD_COMPILES_EXPANDED -	1 means that this command has a compiler that
//				can handle expansion (provided it is not the
//				first word).
// TCL_TRACE_RENAME -		A rename trace is in progress. Further
//				recursive renames will not be traced.
// TCL_TRACE_DELETE -		A delete trace is in progress. Further
//				recursive deletes will not be traced.
// (these last two flags are defined in tcl.h)

//----------------------------------------------------------------
// Data structures related to name resolution procedures.
//----------------------------------------------------------------

// The interpreter keeps a linked list of name resolution schemes. The scheme
// for a namespace is consulted first, followed by the list of schemes in an
// interpreter, followed by the default name resolution in Tcl. Schemes are
// added/removed from the interpreter's list by calling Tcl_AddInterpResolver
// and Tcl_RemoveInterpResolver.

type ResolverScheme = ResolverScheme1 /* tclInt.h:1723:3 */

// Forward declaration of the TIP#143 limit handler structure.

type LimitHandler1 = struct {
	Fflags       int32
	F__ccgo_pad1 [4]byte
	FhandlerProc uintptr
	FclientData  ClientData
	FdeleteProc  uintptr
	FprevPtr     uintptr
	FnextPtr     uintptr
} /* tclInt.h:1729:9 */

//----------------------------------------------------------------
// This structure shadows the first few fields of the memory cache for the
// allocator defined in tclThreadAlloc.c; it has to be kept in sync with the
// definition there.
// Some macros require knowledge of some fields in the struct in order to
// avoid hitting the TSD unnecessarily. In order to facilitate this, a pointer
// to the relevant fields is kept in the allocCache field in struct Interp.
//----------------------------------------------------------------

type AllocCache1 = struct {
	FnextPtr     uintptr
	Fowner       Tcl_ThreadId
	FfirstObjPtr uintptr
	FnumObjects  int32
	F__ccgo_pad1 [4]byte
} /* tclInt.h:942:9 */

//----------------------------------------------------------------
// This structure shadows the first few fields of the memory cache for the
// allocator defined in tclThreadAlloc.c; it has to be kept in sync with the
// definition there.
// Some macros require knowledge of some fields in the struct in order to
// avoid hitting the TSD unnecessarily. In order to facilitate this, a pointer
// to the relevant fields is kept in the allocCache field in struct Interp.
//----------------------------------------------------------------

type Cache1 = struct {
	FnextPtr       uintptr
	Fowner         Tcl_ThreadId
	FfirstObjPtr   uintptr
	FnumObjects    int32
	F__ccgo_pad1   [4]byte
	FlastPtr       uintptr
	FtotalAssigned int32
	F__ccgo_pad2   [4]byte
	Fbuckets       [10]Bucket
} /* tclInt.h:1752:5 */

//----------------------------------------------------------------
// This structure shadows the first few fields of the memory cache for the
// allocator defined in tclThreadAlloc.c; it has to be kept in sync with the
// definition there.
// Some macros require knowledge of some fields in the struct in order to
// avoid hitting the TSD unnecessarily. In order to facilitate this, a pointer
// to the relevant fields is kept in the allocCache field in struct Interp.
//----------------------------------------------------------------

type AllocCache = AllocCache1 /* tclInt.h:1756:3 */

//----------------------------------------------------------------
// This structure defines an interpreter, which is a collection of commands
// plus other state information related to interpreting commands, such as
// variable storage. Primary responsibility for this data structure is in
// tclBasic.c, but almost every Tcl source file uses something in here.
//----------------------------------------------------------------

type Interp = Interp1 /* tclInt.h:2152:3 */

// Macros that use the TSD-ekeko.

// Macros for script cancellation support (TIP #285).

// Macros for splicing into and out of doubly linked lists. They assume
// existence of struct items 'prevPtr' and 'nextPtr'.
//
// a = element to add or remove.
// b = list head.
//
// TclSpliceIn adds to the head of the list.

// EvalFlag bits for Interp structures:
//
// TCL_ALLOW_EXCEPTIONS	1 means it's OK for the script to terminate with a
//			code other than TCL_OK or TCL_ERROR; 0 means codes
//			other than these should be turned into errors.

// Flag bits for Interp structures:
//
// DELETED:		Non-zero means the interpreter has been deleted:
//			don't process any more commands for it, and destroy
//			the structure as soon as all nested invocations of
//			Tcl_Eval are done.
// ERR_ALREADY_LOGGED:	Non-zero means information has already been logged in
//			iPtr->errorInfo for the current Tcl_Eval instance, so
//			Tcl_Eval needn't log it (used to implement the "error
//			message log" command).
// DONT_COMPILE_CMDS_INLINE: Non-zero means that the bytecode compiler should
//			not compile any commands into an inline sequence of
//			instructions. This is set 1, for example, when command
//			traces are requested.
// RAND_SEED_INITIALIZED: Non-zero means that the randSeed value of the interp
//			has not be initialized. This is set 1 when we first
//			use the rand() or srand() functions.
// SAFE_INTERP:		Non zero means that the current interp is a safe
//			interp (i.e. it has only the safe commands installed,
//			less privilege than a regular interp).
// INTERP_DEBUG_FRAME:	Used for switching on various extra interpreter
//			debug/info mechanisms (e.g. info frame eval/uplevel
//			tracing) which are performance intensive.
// INTERP_TRACE_IN_PROGRESS: Non-zero means that an interp trace is currently
//			active; so no further trace callbacks should be
//			invoked.
// INTERP_ALTERNATE_WRONG_ARGS: Used for listing second and subsequent forms
//			of the wrong-num-args string in Tcl_WrongNumArgs.
//			Makes it append instead of replacing and uses
//			different intermediate text.
// CANCELED:		Non-zero means that the script in progress should be
//			canceled as soon as possible. This can be checked by
//			extensions (and the core itself) by calling
//			Tcl_Canceled and checking if TCL_ERROR is returned.
//			This is a one-shot flag that is reset immediately upon
//			being detected; however, if the TCL_CANCEL_UNWIND flag
//			is set Tcl_Canceled will continue to report that the
//			script in progress has been canceled thereby allowing
//			the evaluation stack for the interp to be fully
//			unwound.
//
// WARNING: For the sake of some extensions that have made use of former
// internal values, do not re-use the flag values 2 (formerly ERR_IN_PROGRESS)
// or 8 (formerly ERROR_CODE_SET).

// Maximum number of levels of nesting permitted in Tcl commands (used to
// catch infinite recursion).

// The macro below is used to modify a "char" value (e.g. by casting it to an
// unsigned character) so that it can be used safely with macros such as
// isspace.

// This macro is used to properly align the memory allocated by Tcl, giving
// the same alignment as the native malloc.

// This macro is used to determine the offset needed to safely allocate any
// data structure in memory. Given a starting offset or size, it "rounds up"
// or "aligns" the offset to the next 8-byte boundary so that any data
// structure can be placed at the resulting offset without fear of an
// alignment error.
//
// WARNING!! DO NOT USE THIS MACRO TO ALIGN POINTERS: it will produce the
// wrong result on platforms that allocate addresses that are divisible by 4
// or 2. Only use it for offsets or sizes.
//
// This macro is only used by tclCompile.c in the core (Bug 926445). It
// however not be made file static, as extensions that touch bytecodes
// (notably tbcload) require it.

// The following enum values are used to specify the runtime platform setting
// of the tclPlatform variable.

type TclPlatformType = uint32 /* tclInt.h:2328:3 */

// The following enum values are used to indicate the translation of a Tcl
// channel. Declared here so that each platform can define
// TCL_PLATFORM_TRANSLATION to the native translation on that platform.

type TclEolTranslation = uint32 /* tclInt.h:2341:3 */

// Flags for TclInvoke:
//
// TCL_INVOKE_HIDDEN		Invoke a hidden command; if not set, invokes
//				an exposed command.
// TCL_INVOKE_NO_UNKNOWN	If set, "unknown" is not invoked if the
//				command to be invoked is not found. Only has
//				an effect if invoking an exposed command,
//				i.e. if TCL_INVOKE_HIDDEN is not also set.
// TCL_INVOKE_NO_TRACEBACK	Does not record traceback information if the
//				invoked command returns an error. Used if the
//				caller plans on recording its own traceback
//				information.

// The structure used as the internal representation of Tcl list objects. This
// struct is grown (reallocated and copied) as necessary to hold all the
// list's element pointers. The struct might contain more slots than currently
// used to hold all element pointers. This is done to make append operations
// faster.

type List1 = struct {
	FrefCount      int32
	FmaxElemCount  int32
	FelemCount     int32
	FcanonicalFlag int32
	Felements      uintptr
} /* tclInt.h:2370:9 */

// Flags for TclInvoke:
//
// TCL_INVOKE_HIDDEN		Invoke a hidden command; if not set, invokes
//				an exposed command.
// TCL_INVOKE_NO_UNKNOWN	If set, "unknown" is not invoked if the
//				command to be invoked is not found. Only has
//				an effect if invoking an exposed command,
//				i.e. if TCL_INVOKE_HIDDEN is not also set.
// TCL_INVOKE_NO_TRACEBACK	Does not record traceback information if the
//				invoked command returns an error. Used if the
//				caller plans on recording its own traceback
//				information.

// The structure used as the internal representation of Tcl list objects. This
// struct is grown (reallocated and copied) as necessary to hold all the
// list's element pointers. The struct might contain more slots than currently
// used to hold all element pointers. This is done to make append operations
// faster.

type List = List1 /* tclInt.h:2380:3 */

type TclFileAttrProcs1 = struct {
	FgetProc uintptr
	FsetProc uintptr
} /* tclInt.h:2550:9 */

type TclFileAttrProcs = TclFileAttrProcs1 /* tclInt.h:2553:3 */

// Opaque handle used in pipeline routines to encapsulate platform-dependent
// state.

type TclFile = uintptr /* tclInt.h:2560:25 */

// The "globParameters" argument of the function TclGlob is an or'ed
// combination of the following values:

type Tcl_PathPart = uint32 /* tclInt.h:2577:3 */

//----------------------------------------------------------------
// Data structures related to procedures
//----------------------------------------------------------------

type TclCmdProcType = uintptr    /* tclInt.h:2596:21 */
type TclObjCmdProcType = uintptr /* tclInt.h:2597:24 */

// A ProcessGlobalValue struct exists for each internal value in Tcl that is
// to be shared among several threads. Each thread sees a (Tcl_Obj) copy of
// the value, and the gobal value is kept as a counted string, with epoch and
// mutex control. Each ProcessGlobalValue struct should be a static variable in
// some file.

type ProcessGlobalValue1 = struct {
	Fepoch    int32
	FnumBytes int32
	Fvalue    uintptr
	Fencoding Tcl_Encoding
	Fproc     uintptr
	Fmutex    Tcl_Mutex
	Fkey      Tcl_ThreadDataKey
} /* tclInt.h:2616:9 */

// A ProcessGlobalValue struct exists for each internal value in Tcl that is
// to be shared among several threads. Each thread sees a (Tcl_Obj) copy of
// the value, and the gobal value is kept as a counted string, with epoch and
// mutex control. Each ProcessGlobalValue struct should be a static variable in
// some file.

type ProcessGlobalValue = ProcessGlobalValue1 /* tclInt.h:2631:3 */

// This structure holds the data for the various iteration callbacks used to
// NRE the 'for' and 'while' commands. We need a separate structure because we
// have more than the 4 client data entries we can provide directly thorugh
// the callback API. It is the 'word' information which puts us over the
// limit. It is needed because the loop body is argument 4 of 'for' and
// argument 2 of 'while'. Not providing the correct index confuses the #280
// code. We TclSmallAlloc/Free this.

type ForIterData1 = struct {
	Fcond        uintptr
	Fbody        uintptr
	Fnext        uintptr
	Fmsg         uintptr
	Fword        int32
	F__ccgo_pad1 [4]byte
} /* tclInt.h:2801:9 */

// This structure holds the data for the various iteration callbacks used to
// NRE the 'for' and 'while' commands. We need a separate structure because we
// have more than the 4 client data entries we can provide directly thorugh
// the callback API. It is the 'word' information which puts us over the
// limit. It is needed because the loop body is argument 4 of 'for' and
// argument 2 of 'while'. Not providing the correct index confuses the #280
// code. We TclSmallAlloc/Free this.

type ForIterData = ForIterData1 /* tclInt.h:2807:3 */

type MemCmpFn_t = uintptr /* tclInt.h:3166:13 */

//----------------------------------------------------------------
// Macro used by the Tcl core to check whether a pattern has any characters
// special to [string match]. The ANSI C "prototype" for this macro is:
//
// MODULE_SCOPE int	TclMatchIsTrivial(const char *pattern);
//----------------------------------------------------------------

//----------------------------------------------------------------
// Macros used by the Tcl core to set a Tcl_Obj's numeric representation
// avoiding the corresponding function calls in time critical parts of the
// core. They should only be called on unshared objects. The ANSI C
// "prototypes" for these macros are:
//
// MODULE_SCOPE void	TclSetIntObj(Tcl_Obj *objPtr, int intValue);
// MODULE_SCOPE void	TclSetLongObj(Tcl_Obj *objPtr, long longValue);
// MODULE_SCOPE void	TclSetBooleanObj(Tcl_Obj *objPtr, long boolValue);
// MODULE_SCOPE void	TclSetWideIntObj(Tcl_Obj *objPtr, Tcl_WideInt w);
// MODULE_SCOPE void	TclSetDoubleObj(Tcl_Obj *objPtr, double d);
//----------------------------------------------------------------

// NOTE: There is to be no such thing as a "pure" boolean. Boolean values set
// programmatically go straight to being "int" Tcl_Obj's, with value 0 or 1.
// The only "boolean" Tcl_Obj's shall be those holding the cached boolean
// value of strings like: "yes", "no", "true", "false", "on", "off".

//----------------------------------------------------------------
// Macros used by the Tcl core to create and initialise objects of standard
// types, avoiding the corresponding function calls in time critical parts of
// the core. The ANSI C "prototypes" for these macros are:
//
// MODULE_SCOPE void	TclNewIntObj(Tcl_Obj *objPtr, int i);
// MODULE_SCOPE void	TclNewLongObj(Tcl_Obj *objPtr, long l);
// MODULE_SCOPE void	TclNewBooleanObj(Tcl_Obj *objPtr, int b);
// MODULE_SCOPE void	TclNewWideObj(Tcl_Obj *objPtr, Tcl_WideInt w);
// MODULE_SCOPE void	TclNewDoubleObj(Tcl_Obj *objPtr, double d);
// MODULE_SCOPE void	TclNewStringObj(Tcl_Obj *objPtr, char *s, int len);
// MODULE_SCOPE void	TclNewLiteralStringObj(Tcl_Obj*objPtr, char*sLiteral);
//
//----------------------------------------------------------------

// NOTE: There is to be no such thing as a "pure" boolean.
// See comment above TclSetBooleanObj macro above.

// The sLiteral argument *must* be a string literal; the incantation with
// sizeof(sLiteral "") will fail to compile otherwise.

//----------------------------------------------------------------
// Convenience macros for DStrings.
// The ANSI C "prototypes" for these macros are:
//
// MODULE_SCOPE char * TclDStringAppendLiteral(Tcl_DString *dsPtr,
//			const char *sLiteral);
// MODULE_SCOPE void   TclDStringClear(Tcl_DString *dsPtr);

//----------------------------------------------------------------
// Macros used by the Tcl core to test for some special double values.
// The ANSI C "prototypes" for these macros are:
//
// MODULE_SCOPE int	TclIsInfinite(double d);
// MODULE_SCOPE int	TclIsNaN(double d);

// ----------------------------------------------------------------------
// Macro to use to find the offset of a field in a structure. Computes number
// of bytes from beginning of structure to a given field.

//----------------------------------------------------------------
// Inline version of Tcl_GetCurrentNamespace and Tcl_GetGlobalNamespace.

//----------------------------------------------------------------
// Inline version of TclCleanupCommand; still need the function as it is in
// the internal stubs, but the core can use the macro instead.

//----------------------------------------------------------------
// Inline versions of Tcl_LimitReady() and Tcl_LimitExceeded to limit number
// of calls out of the critical path. Note that this code isn't particularly
// readable; the non-inline version (in tclInterp.c) is much easier to
// understand. Note also that these macros takes different args (iPtr->limit)
// to the non-inline version.

// Compile-time assertions: these produce a compile time error if the
// expression is not known to be true at compile time. If the assertion is
// known to be false, the compiler (or optimizer?) will error out with
// "division by zero". If the assertion cannot be evaluated at compile time,
// the compiler will error out with "non-static initializer".
//
// Adapted with permission from
// http://www.pixelbeat.org/programming/gcc/static_assert.html

//----------------------------------------------------------------
// Allocator for small structs (<=sizeof(Tcl_Obj)) using the Tcl_Obj pool.
// Only checked at compile time.
//
// ONLY USE FOR CONSTANT nBytes.
//
// DO NOT LET THEM CROSS THREAD BOUNDARIES
//----------------------------------------------------------------

// Support for Clang Static Analyzer <http://clang-analyzer.llvm.org>

//----------------------------------------------------------------
// Parameters, structs and macros for the non-recursive engine (NRE)
//----------------------------------------------------------------

// This is the main data struct for representing NR commands. It is designed
// to fit in sizeof(Tcl_Obj) in order to exploit the fastest memory allocator
// available.

type NRE_callback = NRE_callback1 /* tclInt.h:4934:3 */
// 145
type AuxDataType1 = struct {
	Fname            uintptr
	FdupProc         uintptr
	FfreeProc        uintptr
	FprintProc       uintptr
	FdisassembleProc uintptr
} /* tclInt.h:1367:1 */

type TclIntStubs = TclIntStubs1 /* tclIntDecls.h:916:3 */

type TclIntPlatStubs = TclIntPlatStubs1 /* tclIntPlatDecls.h:374:3 */

// !END!: Do not edit above this line.

//----------------------------------------------------------------------
//
// tclTomMathDecls.h --
//
//	This file contains the declarations for the 'libtommath'
//	functions that are exported by the Tcl library.
//
// Copyright (c) 2005 by Kevin B. Kenny.  All rights reserved.
//
// See the file "license.terms" for information on usage and redistribution
// of this file, and for a DISCLAIMER OF ALL WARRANTIES.

// tcl.h --
//
//	This header file describes the externally-visible facilities of the
//	Tcl interpreter.
//
// Copyright (c) 1987-1994 The Regents of the University of California.
// Copyright (c) 1993-1996 Lucent Technologies.
// Copyright (c) 1994-1998 Sun Microsystems, Inc.
// Copyright (c) 1998-2000 by Scriptics Corporation.
// Copyright (c) 2002 by Kevin B. Kenny.  All rights reserved.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// MS Visual C++ doesn't have a 128bit type for words, so fall back to 32bit MPI's (where words are 64bit)

// detect 64-bit mode if possible

// some default configurations.
//
// A "mp_digit" must be able to hold MP_DIGIT_BIT + 1 bits
// A "mp_word" must be able to hold 2*MP_DIGIT_BIT + 1 bits
//
// At the very least a mp_digit must be able to hold 7 bits
// [any size beyond that is ok provided it doesn't overflow the data type]

// this is the default case, 28-bit digits

// this is to make porting into LibTomCrypt easier :-)
type Private_mp_word = uint64 /* tclTomMath.h:94:30 */

// default case is 28-bit digits, defines MP_28BIT as a handy macro to test

// otherwise the bits per digit is calculated automatically from the size of a mp_digit

// Primality generation flags

type Mp_sign = int32   /* tclTomMath.h:163:13 */
type Mp_ord = int32    /* tclTomMath.h:166:13 */
type Mp_bool = int32   /* tclTomMath.h:170:13 */
type Mp_err = int32    /* tclTomMath.h:173:13 */
type Mp_order = int32  /* tclTomMath.h:181:13 */
type Mp_endian = int32 /* tclTomMath.h:184:13 */

type TclTomMathStubs1 = struct {
	Fmagic                       int32
	F__ccgo_pad1                 [4]byte
	Fhooks                       uintptr
	FtclBN_epoch                 uintptr
	FtclBN_revision              uintptr
	FtclBN_mp_add                uintptr
	FtclBN_mp_add_d              uintptr
	FtclBN_mp_and                uintptr
	FtclBN_mp_clamp              uintptr
	FtclBN_mp_clear              uintptr
	FtclBN_mp_clear_multi        uintptr
	FtclBN_mp_cmp                uintptr
	FtclBN_mp_cmp_d              uintptr
	FtclBN_mp_cmp_mag            uintptr
	FtclBN_mp_copy               uintptr
	FtclBN_mp_count_bits         uintptr
	FtclBN_mp_div                uintptr
	FtclBN_mp_div_d              uintptr
	FtclBN_mp_div_2              uintptr
	FtclBN_mp_div_2d             uintptr
	FtclBN_mp_div_3              uintptr
	FtclBN_mp_exch               uintptr
	FtclBN_mp_expt_d             uintptr
	FtclBN_mp_grow               uintptr
	FtclBN_mp_init               uintptr
	FtclBN_mp_init_copy          uintptr
	FtclBN_mp_init_multi         uintptr
	FtclBN_mp_init_set           uintptr
	FtclBN_mp_init_size          uintptr
	FtclBN_mp_lshd               uintptr
	FtclBN_mp_mod                uintptr
	FtclBN_mp_mod_2d             uintptr
	FtclBN_mp_mul                uintptr
	FtclBN_mp_mul_d              uintptr
	FtclBN_mp_mul_2              uintptr
	FtclBN_mp_mul_2d             uintptr
	FtclBN_mp_neg                uintptr
	FtclBN_mp_or                 uintptr
	FtclBN_mp_radix_size         uintptr
	FtclBN_mp_read_radix         uintptr
	FtclBN_mp_rshd               uintptr
	FtclBN_mp_shrink             uintptr
	FtclBN_mp_set                uintptr
	FtclBN_mp_sqr                uintptr
	FtclBN_mp_sqrt               uintptr
	FtclBN_mp_sub                uintptr
	FtclBN_mp_sub_d              uintptr
	FtclBN_mp_to_unsigned_bin    uintptr
	FtclBN_mp_to_unsigned_bin_n  uintptr
	FtclBN_mp_toradix_n          uintptr
	FtclBN_mp_unsigned_bin_size  uintptr
	FtclBN_mp_xor                uintptr
	FtclBN_mp_zero               uintptr
	FtclBN_reverse               uintptr
	FtclBN_fast_s_mp_mul_digs    uintptr
	FtclBN_fast_s_mp_sqr         uintptr
	FtclBN_mp_karatsuba_mul      uintptr
	FtclBN_mp_karatsuba_sqr      uintptr
	FtclBN_mp_toom_mul           uintptr
	FtclBN_mp_toom_sqr           uintptr
	FtclBN_s_mp_add              uintptr
	FtclBN_s_mp_mul_digs         uintptr
	FtclBN_s_mp_sqr              uintptr
	FtclBN_s_mp_sub              uintptr
	FtclBN_mp_init_set_int       uintptr
	FtclBN_mp_set_int            uintptr
	FtclBN_mp_cnt_lsb            uintptr
	FtclBNInitBignumFromLong     uintptr
	FtclBNInitBignumFromWideInt  uintptr
	FtclBNInitBignumFromWideUInt uintptr
	FtclBN_mp_expt_d_ex          uintptr
	FtclBN_mp_set_ull            uintptr
	FtclBN_mp_get_mag_ull        uintptr
	FtclBN_mp_set_ll             uintptr
	Freserved71                  uintptr
	Freserved72                  uintptr
	FtclBN_mp_tc_and             uintptr
	FtclBN_mp_tc_or              uintptr
	FtclBN_mp_tc_xor             uintptr
	FtclBN_mp_signed_rsh         uintptr
	Freserved77                  uintptr
	FtclBN_mp_to_ubin            uintptr
	FtclBN_mp_div_ld             uintptr
	FtclBN_mp_to_radix           uintptr
} /* tclTomMathDecls.h:357:9 */

type TclTomMathStubs = TclTomMathStubs1 /* tclTomMathDecls.h:442:3 */ // Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// Private symbols
// ---------------
//
// On Unix symbols can be marked as hidden if libtommath is compiled
// as a shared object. By default, symbols are visible.
// As of now, this feature is opt-in via the MP_PRIVATE_SYMBOLS define.
//
// On Win32 a .def file must be used to specify the exported symbols.

// Hardening libtommath
// --------------------
//
// By default memory is zeroed before calling
// MP_FREE to avoid leaking data. This is good
// practice in cryptographical applications.
//
// Note however that memory allocators used
// in cryptographical applications can often
// be configured by itself to clear memory,
// rendering the clearing in tommath unnecessary.
// See for example https://github.com/GrapheneOS/hardened_malloc
// and the option CONFIG_ZERO_ON_FREE.
//
// Furthermore there are applications which
// value performance more and want this
// feature to be disabled. For such applications
// define MP_NO_ZERO_ON_FREE during compilation.

// Tunable cutoffs
// ---------------
//
//  - In the default settings, a cutoff X can be modified at runtime
//    by adjusting the corresponding X_CUTOFF variable.
//
//  - Tunability of the library can be disabled at compile time
//    by defining the MP_FIXED_CUTOFFS macro.
//
//  - There is an additional file tommath_cutoffs.h, which defines
//    the default cutoffs. These can be adjusted manually or by the
//    autotuner.
//

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense
//
//    Current values evaluated on an AMD A8-6600K (64-bit).
//    Type "make tune" to optimize them for your machine but
//    be aware that it may take a long time. It took 2:30 minutes
//    on the aforementioned machine for example.
//

// define heap macros

// feature detection macro

// TODO: Remove private_mp_word as soon as deprecated mp_word is removed from tommath.
type Mp_word = Private_mp_word /* tommath_private.h:154:25 */

// Static assertion

// ---> Basic Manipulations <---

// TODO: Remove PRIVATE_MP_WARRAY as soon as deprecated MP_WARRAY is removed from tommath.h

// TODO: Remove PRIVATE_MP_PREC as soon as deprecated MP_PREC is removed from tommath.h

// Minimum number of available digits in mp_int, MP_PREC >= MP_MIN_PREC

type Mp_static_assert_prec_geq_min_prec = [1]int8 /* tommath_private.h:183:1 */

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// high level addition (handles signs)
func XTclBN_mp_add(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_mp_add.c:7:8: */
	var sa Mp_sign
	var sb Mp_sign
	var err Mp_err

	// get sign of both inputs
	sa = (*Mp_int)(unsafe.Pointer(a)).Fsign
	sb = (*Mp_int)(unsafe.Pointer(b)).Fsign

	// handle two cases, not four
	if sa == sb {
		// both positive or both negative
		// add their magnitudes, copy the sign
		(*Mp_int)(unsafe.Pointer(c)).Fsign = sa
		err = XTclBN_s_mp_add(tls, a, b, c)
	} else {
		// one positive, the other negative
		// subtract the one with the greater magnitude from
		// the one of the lesser magnitude.  The result gets
		// the sign of the one with the greater magnitude.
		if XTclBN_mp_cmp_mag(tls, a, b) == -1 {
			(*Mp_int)(unsafe.Pointer(c)).Fsign = sb
			err = XTclBN_s_mp_sub(tls, b, a, c)
		} else {
			(*Mp_int)(unsafe.Pointer(c)).Fsign = sa
			err = XTclBN_s_mp_sub(tls, a, b, c)
		}
	}
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// single digit addition
func XTclBN_mp_add_d(tls *libc.TLS, a uintptr, b Mp_digit, c uintptr) Mp_err { /* bn_mp_add_d.c:7:8: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var err Mp_err
	var ix int32
	var oldused int32
	var tmpa uintptr
	var tmpc uintptr

	// grow c as required
	if (*Mp_int)(unsafe.Pointer(c)).Falloc < (*Mp_int)(unsafe.Pointer(a)).Fused+1 {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, c, (*Mp_int)(unsafe.Pointer(a)).Fused+1)) != MP_OKAY {
			return err
		}
	}

	// if a is negative and |a| >= b, call c = |a| - b
	if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG && ((*Mp_int)(unsafe.Pointer(a)).Fused > 1 || *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp)) >= b) {
		*(*Mp_int)(unsafe.Pointer(bp /* a_ */)) = *(*Mp_int)(unsafe.Pointer(a))
		// temporarily fix sign of a
		(*Mp_int)(unsafe.Pointer(bp /* &a_ */)).Fsign = MP_ZPOS

		// c = |a| - b
		err = XTclBN_mp_sub_d(tls, bp, b, c)

		// fix sign
		(*Mp_int)(unsafe.Pointer(c)).Fsign = MP_NEG

		// clamp
		XTclBN_mp_clamp(tls, c)

		return err
	}

	// old number of used digits in c
	oldused = (*Mp_int)(unsafe.Pointer(c)).Fused

	// source alias
	tmpa = (*Mp_int)(unsafe.Pointer(a)).Fdp

	// destination alias
	tmpc = (*Mp_int)(unsafe.Pointer(c)).Fdp

	// if a is positive
	if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_ZPOS {
		// add digits, mu is carry
		var mu Mp_digit = b
		for ix = 0; ix < (*Mp_int)(unsafe.Pointer(a)).Fused; ix++ {
			*(*Mp_digit)(unsafe.Pointer(tmpc)) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4))) + mu
			mu = *(*Mp_digit)(unsafe.Pointer(tmpc)) >> MP_DIGIT_BIT
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) &= Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
		}
		// set final carry
		ix++
		*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = mu

		// setup size
		(*Mp_int)(unsafe.Pointer(c)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused + 1
	} else {
		// a was negative and |a| < b
		(*Mp_int)(unsafe.Pointer(c)).Fused = 1

		// the result is a single digit
		if (*Mp_int)(unsafe.Pointer(a)).Fused == 1 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = b - *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp))
		} else {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = b
		}

		// setup count so the clearing of oldused
		// can fall through correctly
		ix = 1
	}

	// sign always positive
	(*Mp_int)(unsafe.Pointer(c)).Fsign = MP_ZPOS

	// now zero to oldused
	for ok := true; ok; ok = 0 != 0 {
		var zd_ int32 = oldused - ix
		var zm_ uintptr = tmpc
		for libc.PostDecInt32(&zd_, 1) > 0 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
		}
	}
	XTclBN_mp_clamp(tls, c)

	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// two complement and
func XTclBN_mp_and(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_mp_and.c:7:8: */
	var used int32 = func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused > (*Mp_int)(unsafe.Pointer(b)).Fused {
			return (*Mp_int)(unsafe.Pointer(a)).Fused
		}
		return (*Mp_int)(unsafe.Pointer(b)).Fused
	}() + 1
	var i int32
	var err Mp_err
	var ac Mp_digit = Mp_digit(1)
	var bc Mp_digit = Mp_digit(1)
	var cc Mp_digit = Mp_digit(1)
	var csign Mp_sign
	if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG && (*Mp_int)(unsafe.Pointer(b)).Fsign == MP_NEG {
		csign = MP_NEG
	} else {
		csign = MP_ZPOS
	}

	if (*Mp_int)(unsafe.Pointer(c)).Falloc < used {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, c, used)) != MP_OKAY {
			return err
		}
	}

	for i = 0; i < used; i++ {
		var x Mp_digit
		var y Mp_digit

		// convert to two complement if negative
		if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG {
			ac = ac + func() uint32 {
				if i >= (*Mp_int)(unsafe.Pointer(a)).Fused {
					return Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
				}
				return ^*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(i)*4)) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			}()
			x = ac & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			ac >>= MP_DIGIT_BIT
		} else {
			if i >= (*Mp_int)(unsafe.Pointer(a)).Fused {
				x = uint32(0)
			} else {
				x = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(i)*4))
			}
		}

		// convert to two complement if negative
		if (*Mp_int)(unsafe.Pointer(b)).Fsign == MP_NEG {
			bc = bc + func() uint32 {
				if i >= (*Mp_int)(unsafe.Pointer(b)).Fused {
					return Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
				}
				return ^*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(i)*4)) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			}()
			y = bc & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			bc >>= MP_DIGIT_BIT
		} else {
			if i >= (*Mp_int)(unsafe.Pointer(b)).Fused {
				y = uint32(0)
			} else {
				y = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(i)*4))
			}
		}

		*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(i)*4)) = x & y

		// convert to to sign-magnitude if negative
		if csign == MP_NEG {
			cc = cc + ^*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(i)*4))&(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1))
			*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(i)*4)) = cc & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			cc >>= MP_DIGIT_BIT
		}
	}

	(*Mp_int)(unsafe.Pointer(c)).Fused = used
	(*Mp_int)(unsafe.Pointer(c)).Fsign = csign
	XTclBN_mp_clamp(tls, c)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// trim unused digits
//
// This is used to ensure that leading zero digits are
// trimed and the leading "used" digit will be non-zero
// Typically very fast.  Also fixes the sign if there
// are no more leading digits
func XTclBN_mp_clamp(tls *libc.TLS, a uintptr) { /* bn_mp_clamp.c:13:6: */
	// decrease used while the most significant digit is
	// zero.
	for (*Mp_int)(unsafe.Pointer(a)).Fused > 0 && *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(a)).Fused-1)*4)) == 0 {
		(*Mp_int)(unsafe.Pointer(a)).Fused--
	}

	// reset the sign flag if used == 0
	if (*Mp_int)(unsafe.Pointer(a)).Fused == 0 {
		(*Mp_int)(unsafe.Pointer(a)).Fsign = MP_ZPOS
	}
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// clear one (frees)
func XTclBN_mp_clear(tls *libc.TLS, a uintptr) { /* bn_mp_clear.c:7:6: */
	// only do anything if a hasn't been freed previously
	if (*Mp_int)(unsafe.Pointer(a)).Fdp != uintptr(0) {
		// free ram
		for ok := true; ok; ok = 0 != 0 {
			var fd_ int32 = (*Mp_int)(unsafe.Pointer(a)).Falloc
			var fm_ uintptr = (*Mp_int)(unsafe.Pointer(a)).Fdp
			if fm_ != uintptr(0) {
				var fs_ Size_t = uint64(unsafe.Sizeof(Mp_digit(0))) * Size_t(fd_)
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var zs_ Size_t = fs_
					var zm_ uintptr = fm_
					for libc.PostDecUint64(&zs_, 1) > uint64(0) {
						*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 1))) = int8(0)
					}
				}
				XTclpFree(tls, fm_)
			}
		}

		// reset members to make debugging easier
		(*Mp_int)(unsafe.Pointer(a)).Fdp = uintptr(0)
		(*Mp_int)(unsafe.Pointer(a)).Falloc = libc.AssignPtrInt32(a, 0)
		(*Mp_int)(unsafe.Pointer(a)).Fsign = MP_ZPOS
	}
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.15  Variable arguments  <stdarg.h>

func XTclBN_mp_clear_multi(tls *libc.TLS, mp uintptr, va uintptr) { /* bn_mp_clear_multi.c:8:6: */
	var next_mp uintptr = mp
	var args Va_list
	_ = args
	args = va
	for next_mp != uintptr(0) {
		XTclBN_mp_clear(tls, next_mp)
		next_mp = libc.VaUintptr(&args)
	}
	_ = args
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// compare two ints (signed)
func XTclBN_mp_cmp(tls *libc.TLS, a uintptr, b uintptr) Mp_ord { /* bn_mp_cmp.c:7:8: */
	// compare based on sign
	if (*Mp_int)(unsafe.Pointer(a)).Fsign != (*Mp_int)(unsafe.Pointer(b)).Fsign {
		if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG {
			return -1
		} else {
			return MP_GT
		}
	}

	// compare digits
	if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG {
		// if negative compare opposite direction
		return XTclBN_mp_cmp_mag(tls, b, a)
	} else {
		return XTclBN_mp_cmp_mag(tls, a, b)
	}
	return Mp_ord(0)
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// compare a digit
func XTclBN_mp_cmp_d(tls *libc.TLS, a uintptr, b Mp_digit) Mp_ord { /* bn_mp_cmp_d.c:7:8: */
	// compare based on sign
	if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG {
		return -1
	}

	// compare based on magnitude
	if (*Mp_int)(unsafe.Pointer(a)).Fused > 1 {
		return MP_GT
	}

	// compare the only digit of a to b
	if *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp)) > b {
		return MP_GT
	} else if *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp)) < b {
		return -1
	} else {
		return MP_EQ
	}
	return Mp_ord(0)
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// compare maginitude of two ints (unsigned)
func XTclBN_mp_cmp_mag(tls *libc.TLS, a uintptr, b uintptr) Mp_ord { /* bn_mp_cmp_mag.c:7:8: */
	var n int32
	var tmpa uintptr
	var tmpb uintptr

	// compare based on # of non-zero digits
	if (*Mp_int)(unsafe.Pointer(a)).Fused > (*Mp_int)(unsafe.Pointer(b)).Fused {
		return MP_GT
	}

	if (*Mp_int)(unsafe.Pointer(a)).Fused < (*Mp_int)(unsafe.Pointer(b)).Fused {
		return -1
	}

	// alias for a
	tmpa = (*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(a)).Fused-1)*4

	// alias for b
	tmpb = (*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(a)).Fused-1)*4

	// compare based on digits
	n = 0
__1:
	if !(n < (*Mp_int)(unsafe.Pointer(a)).Fused) {
		goto __3
	}
	{
		if *(*Mp_digit)(unsafe.Pointer(tmpa)) > *(*Mp_digit)(unsafe.Pointer(tmpb)) {
			return MP_GT
		}

		if *(*Mp_digit)(unsafe.Pointer(tmpa)) < *(*Mp_digit)(unsafe.Pointer(tmpb)) {
			return -1
		}

	}
	goto __2
__2:
	n++
	tmpa -= 4
	tmpb -= 4
	goto __1
	goto __3
__3:
	;
	return MP_EQ
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

var lnz = [16]int32{
	4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
} /* bn_mp_cnt_lsb.c:6:18 */

// Counts the number of lsbs which are zero before the first zero bit
func XTclBN_mp_cnt_lsb(tls *libc.TLS, a uintptr) int32 { /* bn_mp_cnt_lsb.c:11:5: */
	var x int32
	var q Mp_digit
	var qq Mp_digit

	// easy out
	if (*Mp_int)(unsafe.Pointer(a)).Fused == 0 {
		return 0
	}

	// scan lower digits until non-zero
	for x = 0; x < (*Mp_int)(unsafe.Pointer(a)).Fused && *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(x)*4)) == 0; x++ {
	}
	q = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(x)*4))
	x = x * MP_DIGIT_BIT

	// now scan this digit until a 1 is found
	if q&1 == 0 {
		for ok := true; ok; ok = qq == 0 {
			qq = q & 15
			x = x + lnz[qq]
			q >>= 4
		}
	}
	return x
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// copy, b = a
func XTclBN_mp_copy(tls *libc.TLS, a uintptr, b uintptr) Mp_err { /* bn_mp_copy.c:7:8: */
	var n int32
	var tmpa uintptr
	var tmpb uintptr
	var err Mp_err

	// if dst == src do nothing
	if a == b {
		return MP_OKAY
	}

	// grow dest
	if (*Mp_int)(unsafe.Pointer(b)).Falloc < (*Mp_int)(unsafe.Pointer(a)).Fused {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, b, (*Mp_int)(unsafe.Pointer(a)).Fused)) != MP_OKAY {
			return err
		}
	}

	// zero b and copy the parameters over
	// pointer aliases

	// source
	tmpa = (*Mp_int)(unsafe.Pointer(a)).Fdp

	// destination
	tmpb = (*Mp_int)(unsafe.Pointer(b)).Fdp

	// copy all the digits
	for n = 0; n < (*Mp_int)(unsafe.Pointer(a)).Fused; n++ {
		*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpb, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4)))
	}

	// clear high digits
	for ok := true; ok; ok = 0 != 0 {
		var zd_ int32 = (*Mp_int)(unsafe.Pointer(b)).Fused - n
		var zm_ uintptr = tmpb
		for libc.PostDecInt32(&zd_, 1) > 0 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
		}
	}

	// copy used count and sign
	(*Mp_int)(unsafe.Pointer(b)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused
	(*Mp_int)(unsafe.Pointer(b)).Fsign = (*Mp_int)(unsafe.Pointer(a)).Fsign
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// returns the number of bits in an int
func XTclBN_mp_count_bits(tls *libc.TLS, a uintptr) int32 { /* bn_mp_count_bits.c:7:5: */
	var r int32
	var q Mp_digit

	// shortcut
	if (*Mp_int)(unsafe.Pointer(a)).Fused == 0 {
		return 0
	}

	// get number of digits and add that
	r = ((*Mp_int)(unsafe.Pointer(a)).Fused - 1) * MP_DIGIT_BIT

	// take the last digit and count the bits in it
	q = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(a)).Fused-1)*4))
	for q > 0 {
		r++
		q >>= 1
	}
	return r
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// integer signed division.
// c*b + d == a [e.g. a/b, c=quotient, d=remainder]
// HAC pp.598 Algorithm 14.20
//
// Note that the description in HAC is horribly
// incomplete.  For example, it doesn't consider
// the case where digits are removed from 'x' in
// the inner loop.  It also doesn't consider the
// case that y has fewer than three digits, etc..
//
// The overall algorithm is as described as
// 14.20 from HAC but fixed to treat these cases.
func XTclBN_mp_div(tls *libc.TLS, a uintptr, b uintptr, c uintptr, d uintptr) Mp_err { /* bn_mp_div.c:86:8: */
	bp := tls.Alloc(120)
	defer tls.Free(120)

	// var q Mp_int at bp, 24

	// var x Mp_int at bp+72, 24

	// var y Mp_int at bp+96, 24

	// var t1 Mp_int at bp+24, 24

	// var t2 Mp_int at bp+48, 24

	var n int32
	var t int32
	var i int32
	var norm int32
	var neg Mp_sign
	var err Mp_err
	var tmp Mp_word

	// is divisor zero ?
	if !((*Mp_int)(unsafe.Pointer(b)).Fused == 0) {
		goto __1
	}
	return -3
__1:
	;

	// if a < b then q=0, r = a
	if !(XTclBN_mp_cmp_mag(tls, a, b) == -1) {
		goto __2
	}
	if !(d != uintptr(0)) {
		goto __3
	}
	err = XTclBN_mp_copy(tls, a, d)
	goto __4
__3:
	err = MP_OKAY
__4:
	;
	if !(c != uintptr(0)) {
		goto __5
	}
	XTclBN_mp_zero(tls, c)
__5:
	;
	return err
__2:
	;

	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp, (*Mp_int)(unsafe.Pointer(a)).Fused+2)) != MP_OKAY) {
		goto __6
	}
	return err
__6:
	;
	(*Mp_int)(unsafe.Pointer(bp /* &q */)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused + 2

	if !(libc.AssignInt32(&err, XTclBN_mp_init(tls, bp+24)) != MP_OKAY) {
		goto __7
	}
	goto LBL_Q
__7:
	;

	if !(libc.AssignInt32(&err, XTclBN_mp_init(tls, bp+48)) != MP_OKAY) {
		goto __8
	}
	goto LBL_T1
__8:
	;

	if !(libc.AssignInt32(&err, XTclBN_mp_init_copy(tls, bp+72, a)) != MP_OKAY) {
		goto __9
	}
	goto LBL_T2
__9:
	;

	if !(libc.AssignInt32(&err, XTclBN_mp_init_copy(tls, bp+96, b)) != MP_OKAY) {
		goto __10
	}
	goto LBL_X
__10:
	;

	// fix the sign
	if (*Mp_int)(unsafe.Pointer(a)).Fsign == (*Mp_int)(unsafe.Pointer(b)).Fsign {
		neg = MP_ZPOS
	} else {
		neg = MP_NEG
	}
	(*Mp_int)(unsafe.Pointer(bp + 72 /* &x */)).Fsign = libc.AssignPtrInt32(bp+96+8, MP_ZPOS)

	// normalize both x and y, ensure that y >= b/2, [b == 2**MP_DIGIT_BIT]
	norm = XTclBN_mp_count_bits(tls, bp+96) % MP_DIGIT_BIT
	if !(norm < MP_DIGIT_BIT-1) {
		goto __11
	}
	norm = MP_DIGIT_BIT - 1 - norm
	if !(libc.AssignInt32(&err, XTclBN_mp_mul_2d(tls, bp+72, norm, bp+72)) != MP_OKAY) {
		goto __13
	}
	goto LBL_Y
__13:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_mul_2d(tls, bp+96, norm, bp+96)) != MP_OKAY) {
		goto __14
	}
	goto LBL_Y
__14:
	;
	goto __12
__11:
	norm = 0
__12:
	;

	// note hac does 0 based, so if used==5 then its 0,1,2,3,4, e.g. use 4
	n = (*Mp_int)(unsafe.Pointer(bp+72)).Fused - 1
	t = (*Mp_int)(unsafe.Pointer(bp+96)).Fused - 1

	// while (x >= y*b**n-t) do { q[n-t] += 1; x -= y*b**{n-t} }
	// y = y*b**{n-t}
	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+96, n-t)) != MP_OKAY) {
		goto __15
	}
	goto LBL_Y
__15:
	;

__16:
	if !(XTclBN_mp_cmp(tls, bp+72, bp+96) != -1) {
		goto __17
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(n-t)*4))++
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+72, bp+96, bp+72)) != MP_OKAY) {
		goto __18
	}
	goto LBL_Y
__18:
	;
	goto __16
__17:
	;

	// reset y by shifting it back down
	XTclBN_mp_rshd(tls, bp+96, n-t)

	// step 3. for i from n down to (t + 1)
	i = n
__19:
	if !(i >= t+1) {
		goto __21
	}
	if !(i > (*Mp_int)(unsafe.Pointer(bp+72)).Fused) {
		goto __22
	}
	goto __20
__22:
	;

	// step 3.1 if xi == yt then set q{i-t-1} to b-1,
	// otherwise set q{i-t-1} to (xi*b + x{i-1})/yt
	if !(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+72)).Fdp + uintptr(i)*4)) == *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+96)).Fdp + uintptr(t)*4))) {
		goto __23
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &q */)).Fdp + uintptr(i-t-1)*4)) = Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
	goto __24
__23:
	tmp = Mp_word(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+72)).Fdp + uintptr(i)*4))) << uint64(MP_DIGIT_BIT)
	tmp = tmp | Mp_word(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+72)).Fdp + uintptr(i-1)*4)))
	tmp = tmp / Mp_word(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+96)).Fdp + uintptr(t)*4)))
	if !(tmp > uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1))) {
		goto __25
	}
	tmp = uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
__25:
	;
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &q */)).Fdp + uintptr(i-t-1)*4)) = Mp_digit(tmp & uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1)))
__24:
	;

	// while (q{i-t-1} * (yt * b + y{t-1})) >
	//                xi * b**2 + xi-1 * b + xi-2
	//
	//          do q{i-t-1} -= 1;
	//
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &q */)).Fdp + uintptr(i-t-1)*4)) = Mp_digit((uint64(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(i-t-1)*4))) + 1) & uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1)))
__26:
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &q */)).Fdp + uintptr(i-t-1)*4)) = Mp_digit((uint64(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(i-t-1)*4))) - 1) & uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1)))

	// find left hand
	XTclBN_mp_zero(tls, bp+24)
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp + 24 /* &t1 */)).Fdp)) = func() uint32 {
		if t-1 < 0 {
			return 0
		}
		return *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+96 /* &y */)).Fdp + uintptr(t-1)*4))
	}()
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+24 /* &t1 */)).Fdp + 1*4)) = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+96 /* &y */)).Fdp + uintptr(t)*4))
	(*Mp_int)(unsafe.Pointer(bp + 24 /* &t1 */)).Fused = 2
	if !(libc.AssignInt32(&err, XTclBN_mp_mul_d(tls, bp+24, *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(i-t-1)*4)), bp+24)) != MP_OKAY) {
		goto __29
	}
	goto LBL_Y
__29:
	;

	// find right hand
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp + 48 /* &t2 */)).Fdp)) = func() uint32 {
		if i-2 < 0 {
			return 0
		}
		return *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+72 /* &x */)).Fdp + uintptr(i-2)*4))
	}()
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+48 /* &t2 */)).Fdp + 1*4)) = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+72 /* &x */)).Fdp + uintptr(i-1)*4)) // i >= 1 always holds
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+48 /* &t2 */)).Fdp + 2*4)) = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+72 /* &x */)).Fdp + uintptr(i)*4))
	(*Mp_int)(unsafe.Pointer(bp + 48 /* &t2 */)).Fused = 3
	goto __27
__27:
	if XTclBN_mp_cmp_mag(tls, bp+24, bp+48) == MP_GT {
		goto __26
	}
	goto __28
__28:
	;

	// step 3.3 x = x - q{i-t-1} * y * b**{i-t-1}
	if !(libc.AssignInt32(&err, XTclBN_mp_mul_d(tls, bp+96, *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(i-t-1)*4)), bp+24)) != MP_OKAY) {
		goto __30
	}
	goto LBL_Y
__30:
	;

	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+24, i-t-1)) != MP_OKAY) {
		goto __31
	}
	goto LBL_Y
__31:
	;

	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+72, bp+24, bp+72)) != MP_OKAY) {
		goto __32
	}
	goto LBL_Y
__32:
	;

	// if x < 0 then { x = x + y*b**{i-t-1}; q{i-t-1} -= 1; }
	if !((*Mp_int)(unsafe.Pointer(bp+72)).Fsign == MP_NEG) {
		goto __33
	}
	if !(libc.AssignInt32(&err, XTclBN_mp_copy(tls, bp+96, bp+24)) != MP_OKAY) {
		goto __34
	}
	goto LBL_Y
__34:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+24, i-t-1)) != MP_OKAY) {
		goto __35
	}
	goto LBL_Y
__35:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+72, bp+24, bp+72)) != MP_OKAY) {
		goto __36
	}
	goto LBL_Y
__36:
	;

	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &q */)).Fdp + uintptr(i-t-1)*4)) = Mp_digit((uint64(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(i-t-1)*4))) - 1) & uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1)))
__33:
	;
	goto __20
__20:
	i--
	goto __19
	goto __21
__21:
	;

	// now q is the quotient and x is the remainder
	// [which we have to normalize]

	// get sign before writing to c
	(*Mp_int)(unsafe.Pointer(bp + 72 /* &x */)).Fsign = func() int32 {
		if (*Mp_int)(unsafe.Pointer(bp+72)).Fused == 0 {
			return MP_ZPOS
		}
		return (*Mp_int)(unsafe.Pointer(a)).Fsign
	}()

	if !(c != uintptr(0)) {
		goto __37
	}
	XTclBN_mp_clamp(tls, bp)
	XTclBN_mp_exch(tls, bp, c)
	(*Mp_int)(unsafe.Pointer(c)).Fsign = neg
__37:
	;

	if !(d != uintptr(0)) {
		goto __38
	}
	if !(libc.AssignInt32(&err, XTclBN_mp_div_2d(tls, bp+72, norm, bp+72, uintptr(0))) != MP_OKAY) {
		goto __39
	}
	goto LBL_Y
__39:
	;
	XTclBN_mp_exch(tls, bp+72, d)
__38:
	;

	err = MP_OKAY

LBL_Y:
	XTclBN_mp_clear(tls, bp+96)
LBL_X:
	XTclBN_mp_clear(tls, bp+72)
LBL_T2:
	XTclBN_mp_clear(tls, bp+48)
LBL_T1:
	XTclBN_mp_clear(tls, bp+24)
LBL_Q:
	XTclBN_mp_clear(tls, bp)
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// b = a/2
func XTclBN_mp_div_2(tls *libc.TLS, a uintptr, b uintptr) Mp_err { /* bn_mp_div_2.c:7:8: */
	var x int32
	var oldused int32
	var r Mp_digit
	var rr Mp_digit
	var tmpa uintptr
	var tmpb uintptr
	var err Mp_err

	// copy
	if (*Mp_int)(unsafe.Pointer(b)).Falloc < (*Mp_int)(unsafe.Pointer(a)).Fused {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, b, (*Mp_int)(unsafe.Pointer(a)).Fused)) != MP_OKAY {
			return err
		}
	}

	oldused = (*Mp_int)(unsafe.Pointer(b)).Fused
	(*Mp_int)(unsafe.Pointer(b)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused

	// source alias
	tmpa = (*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(b)).Fused)*4 - uintptr(1)*4

	// dest alias
	tmpb = (*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(b)).Fused)*4 - uintptr(1)*4

	// carry
	r = Mp_digit(0)
	for x = (*Mp_int)(unsafe.Pointer(b)).Fused - 1; x >= 0; x-- {
		// get the carry for the next iteration
		rr = *(*Mp_digit)(unsafe.Pointer(tmpa)) & 1

		// shift the current digit, add in carry and store
		*(*Mp_digit)(unsafe.Pointer(libc.PostDecUintptr(&tmpb, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostDecUintptr(&tmpa, 4)))>>1 | r<<(MP_DIGIT_BIT-1)

		// forward carry to next iteration
		r = rr
	}

	// zero excess digits
	for ok := true; ok; ok = 0 != 0 {
		var zd_ int32 = oldused - (*Mp_int)(unsafe.Pointer(b)).Fused
		var zm_ uintptr = (*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(b)).Fused)*4
		for libc.PostDecInt32(&zd_, 1) > 0 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
		}
	}

	(*Mp_int)(unsafe.Pointer(b)).Fsign = (*Mp_int)(unsafe.Pointer(a)).Fsign
	XTclBN_mp_clamp(tls, b)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// shift right by a certain bit count (store quotient in c, optional remainder in d)
func XTclBN_mp_div_2d(tls *libc.TLS, a uintptr, b int32, c uintptr, d uintptr) Mp_err { /* bn_mp_div_2d.c:7:8: */
	var D Mp_digit
	var r Mp_digit
	var rr Mp_digit
	var x int32
	var err Mp_err

	// if the shift count is <= 0 then we do no work
	if b <= 0 {
		err = XTclBN_mp_copy(tls, a, c)
		if d != uintptr(0) {
			XTclBN_mp_zero(tls, d)
		}
		return err
	}

	// copy
	if libc.AssignInt32(&err, XTclBN_mp_copy(tls, a, c)) != MP_OKAY {
		return err
	}
	// 'a' should not be used after here - it might be the same as d

	// get the remainder
	if d != uintptr(0) {
		if libc.AssignInt32(&err, XTclBN_mp_mod_2d(tls, a, b, d)) != MP_OKAY {
			return err
		}
	}

	// shift by as many digits in the bit count
	if b >= MP_DIGIT_BIT {
		XTclBN_mp_rshd(tls, c, b/MP_DIGIT_BIT)
	}

	// shift any bit count < MP_DIGIT_BIT
	D = Mp_digit(b % MP_DIGIT_BIT)
	if D != 0 {
		var tmpc uintptr
		var mask Mp_digit
		var shift Mp_digit

		// mask
		mask = Mp_digit(uint64(Mp_digit(Mp_digit(1))<<D) - 1)

		// shift for lsb
		shift = Mp_digit(MP_DIGIT_BIT) - D

		// alias
		tmpc = (*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(c)).Fused-1)*4

		// carry
		r = Mp_digit(0)
		for x = (*Mp_int)(unsafe.Pointer(c)).Fused - 1; x >= 0; x-- {
			// get the lower  bits of this word in a temp
			rr = *(*Mp_digit)(unsafe.Pointer(tmpc)) & mask

			// shift the current word and mix in the carry bits from the previous word
			*(*Mp_digit)(unsafe.Pointer(tmpc)) = *(*Mp_digit)(unsafe.Pointer(tmpc))>>D | r<<shift
			tmpc -= 4

			// set the carry to the carry bits of the current word found above
			r = rr
		}
	}
	XTclBN_mp_clamp(tls, c)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// divide by three (based on routine from MPI and the GMP manual)
func XTclBN_mp_div_3(tls *libc.TLS, a uintptr, c uintptr, d uintptr) Mp_err { /* bn_mp_div_3.c:7:8: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var q Mp_int at bp, 24

	var w Mp_word
	var t Mp_word
	var b Mp_digit
	var err Mp_err
	var ix int32

	// b = 2**MP_DIGIT_BIT / 3
	b = uint32(Mp_word(uint64(1)) << uint64(MP_DIGIT_BIT) / uint64(3))

	if libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp, (*Mp_int)(unsafe.Pointer(a)).Fused)) != MP_OKAY {
		return err
	}

	(*Mp_int)(unsafe.Pointer(bp /* &q */)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused
	(*Mp_int)(unsafe.Pointer(bp /* &q */)).Fsign = (*Mp_int)(unsafe.Pointer(a)).Fsign
	w = uint64(0)
	for ix = (*Mp_int)(unsafe.Pointer(a)).Fused - 1; ix >= 0; ix-- {
		w = w<<uint64(MP_DIGIT_BIT) | Mp_word(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(ix)*4)))

		if w >= uint64(3) {
			// multiply w by [1/3]
			t = w * Mp_word(b) >> uint64(MP_DIGIT_BIT)

			// now subtract 3 * [w/3] from w, to get the remainder
			w = w - (t + t + t)

			// fixup the remainder as required since
			// the optimization is not exact.
			for w >= uint64(3) {
				t = t + uint64(1)
				w = w - uint64(3)
			}
		} else {
			t = uint64(0)
		}
		*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &q */)).Fdp + uintptr(ix)*4)) = Mp_digit(t)
	}

	// [optional] store the remainder
	if d != uintptr(0) {
		*(*Mp_digit)(unsafe.Pointer(d)) = Mp_digit(w)
	}

	// [optional] store the quotient
	if c != uintptr(0) {
		XTclBN_mp_clamp(tls, bp)
		XTclBN_mp_exch(tls, bp, c)
	}
	XTclBN_mp_clear(tls, bp)

	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// single digit division (based on routine from MPI)
func XTclBN_mp_div_d(tls *libc.TLS, a uintptr, b Mp_digit, c uintptr, d uintptr) Mp_err { /* bn_mp_div_d.c:7:8: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var q Mp_int at bp, 24

	var w Mp_word
	var t Mp_digit
	var err Mp_err
	var ix int32

	// cannot divide by zero
	if b == 0 {
		return -3
	}

	// quick outs
	if b == 1 || (*Mp_int)(unsafe.Pointer(a)).Fused == 0 {
		if d != uintptr(0) {
			*(*Mp_digit)(unsafe.Pointer(d)) = Mp_digit(0)
		}
		if c != uintptr(0) {
			return XTclBN_mp_copy(tls, a, c)
		}
		return MP_OKAY
	}

	// power of two ?
	if b&(b-1) == 0 {
		ix = 1
		for ix < MP_DIGIT_BIT && b != Mp_digit(Mp_digit(1))<<ix {
			ix++
		}
		if d != uintptr(0) {
			*(*Mp_digit)(unsafe.Pointer(d)) = Mp_digit(uint64(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp))) & (uint64(Mp_digit(Mp_digit(1))<<Mp_digit(ix)) - 1))
		}
		if c != uintptr(0) {
			return XTclBN_mp_div_2d(tls, a, ix, c, uintptr(0))
		}
		return MP_OKAY
	}

	// three?
	if uint64(unsafe.Sizeof([1]int8{})) == uint64(1) && b == 3 {
		return XTclBN_mp_div_3(tls, a, c, d)
	}

	// no easy answer [c'est la vie].  Just division
	if libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp, (*Mp_int)(unsafe.Pointer(a)).Fused)) != MP_OKAY {
		return err
	}

	(*Mp_int)(unsafe.Pointer(bp /* &q */)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused
	(*Mp_int)(unsafe.Pointer(bp /* &q */)).Fsign = (*Mp_int)(unsafe.Pointer(a)).Fsign
	w = uint64(0)
	for ix = (*Mp_int)(unsafe.Pointer(a)).Fused - 1; ix >= 0; ix-- {
		w = w<<uint64(MP_DIGIT_BIT) | Mp_word(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(ix)*4)))

		if w >= Mp_word(b) {
			t = Mp_digit(w / Mp_word(b))
			w = w - Mp_word(t)*Mp_word(b)
		} else {
			t = Mp_digit(0)
		}
		*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &q */)).Fdp + uintptr(ix)*4)) = t
	}

	if d != uintptr(0) {
		*(*Mp_digit)(unsafe.Pointer(d)) = Mp_digit(w)
	}

	if c != uintptr(0) {
		XTclBN_mp_clamp(tls, bp)
		XTclBN_mp_exch(tls, bp, c)
	}
	XTclBN_mp_clear(tls, bp)

	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// swap the elements of two integers, for cases where you can't simply swap the
// mp_int pointers around
func XTclBN_mp_exch(tls *libc.TLS, a uintptr, b uintptr) { /* bn_mp_exch.c:9:6: */
	var t Mp_int

	t = *(*Mp_int)(unsafe.Pointer(a))
	*(*Mp_int)(unsafe.Pointer(a)) = *(*Mp_int)(unsafe.Pointer(b))
	*(*Mp_int)(unsafe.Pointer(b)) = t
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// calculate c = a**b  using a square-multiply algorithm
func XTclBN_mp_expt_d(tls *libc.TLS, a uintptr, b uint32, c uintptr) Mp_err { /* bn_mp_expt_u32.c:7:8: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var err Mp_err
	// var g Mp_int at bp, 24

	if !(libc.AssignInt32(&err, XTclBN_mp_init_copy(tls, bp, a)) != MP_OKAY) {
		goto __1
	}
	return err
__1:
	;

	// set initial result
	XTclBN_mp_set(tls, c, uint32(1))

__2:
	if !(b > 0) {
		goto __3
	}
	// if the bit is set multiply
	if !(b&1 != 0) {
		goto __4
	}
	if !(libc.AssignInt32(&err, XTclBN_mp_mul(tls, c, bp, c)) != MP_OKAY) {
		goto __5
	}
	goto LBL_ERR
__5:
	;
__4:
	;

	// square
	if !(b > 1) {
		goto __6
	}
	if !(libc.AssignInt32(&err, XTclBN_mp_sqr(tls, bp, bp)) != MP_OKAY) {
		goto __7
	}
	goto LBL_ERR
__7:
	;
__6:
	;

	// shift to next bit
	b >>= 1
	goto __2
__3:
	;

	err = MP_OKAY

LBL_ERR:
	XTclBN_mp_clear(tls, bp)
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// grow as required
func XTclBN_mp_grow(tls *libc.TLS, a uintptr, size int32) Mp_err { /* bn_mp_grow.c:7:8: */
	var i int32
	var tmp uintptr

	// if the alloc size is smaller alloc more ram
	if (*Mp_int)(unsafe.Pointer(a)).Falloc < size {
		// reallocate the array a->dp
		//
		// We store the return in a temporary variable
		// in case the operation failed we don't want
		// to overwrite the dp member of a.
		tmp = XTcl_Realloc(tls, (*Mp_int)(unsafe.Pointer(a)).Fdp, uint32(Size_t(size)*Size_t(unsafe.Sizeof(Mp_digit(0)))))
		if tmp == uintptr(0) {
			// reallocation failed but "a" is still valid [can be freed]
			return -2
		}

		// reallocation succeeded so set a->dp
		(*Mp_int)(unsafe.Pointer(a)).Fdp = tmp

		// zero excess digits
		i = (*Mp_int)(unsafe.Pointer(a)).Falloc
		(*Mp_int)(unsafe.Pointer(a)).Falloc = size
		for ok := true; ok; ok = 0 != 0 {
			var zd_ int32 = (*Mp_int)(unsafe.Pointer(a)).Falloc - i
			var zm_ uintptr = (*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(i)*4
			for libc.PostDecInt32(&zd_, 1) > 0 {
				*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
			}
		}
	}
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// init a new mp_int
func XTclBN_mp_init(tls *libc.TLS, a uintptr) Mp_err { /* bn_mp_init.c:7:8: */
	// allocate memory required and clear it
	(*Mp_int)(unsafe.Pointer(a)).Fdp = libc.Xmemset(tls, XTcl_Alloc(tls, uint32(uint64(MP_PREC)*Size_t(unsafe.Sizeof(Mp_digit(0))))), 0, uint64(MP_PREC)*Size_t(unsafe.Sizeof(Mp_digit(0))))
	if (*Mp_int)(unsafe.Pointer(a)).Fdp == uintptr(0) {
		return -2
	}

	// set the used to zero, allocated digits to the default precision
	// and sign to positive
	(*Mp_int)(unsafe.Pointer(a)).Fused = 0
	(*Mp_int)(unsafe.Pointer(a)).Falloc = MP_PREC
	(*Mp_int)(unsafe.Pointer(a)).Fsign = MP_ZPOS

	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// creates "a" then copies b into it
func XTclBN_mp_init_copy(tls *libc.TLS, a uintptr, b uintptr) Mp_err { /* bn_mp_init_copy.c:7:8: */
	var err Mp_err

	if libc.AssignInt32(&err, XTclBN_mp_init_size(tls, a, (*Mp_int)(unsafe.Pointer(b)).Fused)) != MP_OKAY {
		return err
	}

	if libc.AssignInt32(&err, XTclBN_mp_copy(tls, b, a)) != MP_OKAY {
		XTclBN_mp_clear(tls, a)
	}

	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.15  Variable arguments  <stdarg.h>

func XTclBN_mp_init_multi(tls *libc.TLS, mp uintptr, va uintptr) Mp_err { /* bn_mp_init_multi.c:8:8: */
	var err Mp_err = MP_OKAY // Assume ok until proven otherwise
	var n int32 = 0          // Number of ok inits
	var cur_arg uintptr = mp
	var args Va_list
	_ = args

	args = va // init args to next argument from caller
	for cur_arg != uintptr(0) {
		if XTclBN_mp_init(tls, cur_arg) != MP_OKAY {
			// Oops - error! Back-track and mp_clear what we already
			//             succeeded in init-ing, then return error.
			//
			var clean_args Va_list
			_ = clean_args

			// now start cleaning up
			cur_arg = mp
			clean_args = va
			for libc.PostDecInt32(&n, 1) != 0 {
				XTclBN_mp_clear(tls, cur_arg)
				cur_arg = libc.VaUintptr(&clean_args)
			}
			_ = clean_args
			err = -2
			break
		}
		n++
		cur_arg = libc.VaUintptr(&args)
	}
	_ = args
	return err // Assumed ok, if error flagged above.
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// initialize and set a digit
func XTclBN_mp_init_set(tls *libc.TLS, a uintptr, b Mp_digit) Mp_err { /* bn_mp_init_set.c:7:8: */
	var err Mp_err
	if libc.AssignInt32(&err, XTclBN_mp_init(tls, a)) != MP_OKAY {
		return err
	}
	XTclBN_mp_set(tls, a, b)
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// init an mp_init for a given size
func XTclBN_mp_init_size(tls *libc.TLS, a uintptr, size int32) Mp_err { /* bn_mp_init_size.c:7:8: */
	size = func() int32 {
		if (int32(uint64(8)*Size_t(unsafe.Sizeof(Tcl_WideInt(0))))+MP_DIGIT_BIT-1)/MP_DIGIT_BIT > size {
			return (int32(uint64(8)*Size_t(unsafe.Sizeof(Tcl_WideInt(0)))) + MP_DIGIT_BIT - 1) / MP_DIGIT_BIT
		}
		return size
	}()

	// alloc mem
	(*Mp_int)(unsafe.Pointer(a)).Fdp = libc.Xmemset(tls, XTcl_Alloc(tls, uint32(Size_t(size)*Size_t(unsafe.Sizeof(Mp_digit(0))))), 0, Size_t(size)*Size_t(unsafe.Sizeof(Mp_digit(0))))
	if (*Mp_int)(unsafe.Pointer(a)).Fdp == uintptr(0) {
		return -2
	}

	// set the members
	(*Mp_int)(unsafe.Pointer(a)).Fused = 0
	(*Mp_int)(unsafe.Pointer(a)).Falloc = size
	(*Mp_int)(unsafe.Pointer(a)).Fsign = MP_ZPOS

	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// shift left a certain amount of digits
func XTclBN_mp_lshd(tls *libc.TLS, a uintptr, b int32) Mp_err { /* bn_mp_lshd.c:7:8: */
	var x int32
	var err Mp_err
	var top uintptr
	var bottom uintptr

	// if its less than zero return
	if b <= 0 {
		return MP_OKAY
	}
	// no need to shift 0 around
	if (*Mp_int)(unsafe.Pointer(a)).Fused == 0 {
		return MP_OKAY
	}

	// grow to fit the new digits
	if (*Mp_int)(unsafe.Pointer(a)).Falloc < (*Mp_int)(unsafe.Pointer(a)).Fused+b {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, a, (*Mp_int)(unsafe.Pointer(a)).Fused+b)) != MP_OKAY {
			return err
		}
	}

	// increment the used by the shift amount then copy upwards
	*(*int32)(unsafe.Pointer(a)) += b

	// top
	top = (*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(a)).Fused)*4 - uintptr(1)*4

	// base
	bottom = (*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(a)).Fused)*4 - uintptr(1)*4 - uintptr(b)*4

	// much like mp_rshd this is implemented using a sliding window
	// except the window goes the otherway around.  Copying from
	// the bottom to the top.  see bn_mp_rshd.c for more info.
	for x = (*Mp_int)(unsafe.Pointer(a)).Fused - 1; x >= b; x-- {
		*(*Mp_digit)(unsafe.Pointer(libc.PostDecUintptr(&top, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostDecUintptr(&bottom, 4)))
	}

	// zero the lower digits
	for ok := true; ok; ok = 0 != 0 {
		var zd_ int32 = b
		var zm_ uintptr = (*Mp_int)(unsafe.Pointer(a)).Fdp
		for libc.PostDecInt32(&zd_, 1) > 0 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
		}
	}

	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// c = a mod b, 0 <= c < b if b > 0, b < c <= 0 if b < 0
func XTclBN_mp_mod(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_mp_mod.c:7:8: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var t Mp_int at bp, 24

	var err Mp_err

	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp, (*Mp_int)(unsafe.Pointer(b)).Fused)) != MP_OKAY) {
		goto __1
	}
	return err
__1:
	;

	if !(libc.AssignInt32(&err, XTclBN_mp_div(tls, a, b, uintptr(0), bp)) != MP_OKAY) {
		goto __2
	}
	goto LBL_ERR
__2:
	;

	if !((*Mp_int)(unsafe.Pointer(bp)).Fused == 0 || (*Mp_int)(unsafe.Pointer(bp)).Fsign == (*Mp_int)(unsafe.Pointer(b)).Fsign) {
		goto __3
	}
	err = MP_OKAY
	XTclBN_mp_exch(tls, bp, c)
	goto __4
__3:
	err = XTclBN_mp_add(tls, b, bp, c)
__4:
	;

LBL_ERR:
	XTclBN_mp_clear(tls, bp)
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// calc a value mod 2**b
func XTclBN_mp_mod_2d(tls *libc.TLS, a uintptr, b int32, c uintptr) Mp_err { /* bn_mp_mod_2d.c:7:8: */
	var x int32
	var err Mp_err

	// if b is <= 0 then zero the int
	if b <= 0 {
		XTclBN_mp_zero(tls, c)
		return MP_OKAY
	}

	// if the modulus is larger than the value than return
	if b >= (*Mp_int)(unsafe.Pointer(a)).Fused*MP_DIGIT_BIT {
		return XTclBN_mp_copy(tls, a, c)
	}

	// copy
	if libc.AssignInt32(&err, XTclBN_mp_copy(tls, a, c)) != MP_OKAY {
		return err
	}

	// zero digits above the last digit of the modulus
	x = b/MP_DIGIT_BIT + func() int32 {
		if b%MP_DIGIT_BIT == 0 {
			return 0
		}
		return 1
	}()
	for ok := true; ok; ok = 0 != 0 {
		var zd_ int32 = (*Mp_int)(unsafe.Pointer(c)).Fused - x
		var zm_ uintptr = (*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(x)*4
		for libc.PostDecInt32(&zd_, 1) > 0 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
		}
	}

	// clear the digit that is not completely outside/inside the modulus
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(b/MP_DIGIT_BIT)*4)) &= Mp_digit(Mp_digit(1))<<Mp_digit(b%MP_DIGIT_BIT) - Mp_digit(1)
	XTclBN_mp_clamp(tls, c)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// high level multiplication (handles sign)
func XTclBN_mp_mul(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_mp_mul.c:7:8: */
	var err Mp_err
	var min_len int32 = func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused < (*Mp_int)(unsafe.Pointer(b)).Fused {
			return (*Mp_int)(unsafe.Pointer(a)).Fused
		}
		return (*Mp_int)(unsafe.Pointer(b)).Fused
	}()
	var max_len int32 = func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused > (*Mp_int)(unsafe.Pointer(b)).Fused {
			return (*Mp_int)(unsafe.Pointer(a)).Fused
		}
		return (*Mp_int)(unsafe.Pointer(b)).Fused
	}()
	var digs int32 = (*Mp_int)(unsafe.Pointer(a)).Fused + (*Mp_int)(unsafe.Pointer(b)).Fused + 1
	var neg Mp_sign
	if (*Mp_int)(unsafe.Pointer(a)).Fsign == (*Mp_int)(unsafe.Pointer(b)).Fsign {
		neg = MP_ZPOS
	} else {
		neg = MP_NEG
	}

	if a == b {
		return XTclBN_mp_sqr(tls, a, c)
	} else if uint64(unsafe.Sizeof([1]int8{})) == uint64(1) && min_len >= MP_DEFAULT_KARATSUBA_MUL_CUTOFF && max_len/2 >= MP_DEFAULT_KARATSUBA_MUL_CUTOFF && max_len >= 2*min_len {
		err = XTclBN_mp_balance_mul(tls, a, b, c)
	} else if uint64(unsafe.Sizeof([1]int8{})) == uint64(1) && min_len >= MP_DEFAULT_TOOM_MUL_CUTOFF {
		err = XTclBN_mp_toom_mul(tls, a, b, c)
	} else if uint64(unsafe.Sizeof([1]int8{})) == uint64(1) && min_len >= MP_DEFAULT_KARATSUBA_MUL_CUTOFF {
		err = XTclBN_mp_karatsuba_mul(tls, a, b, c)
	} else if uint64(unsafe.Sizeof([1]int8{})) == uint64(1) && digs < int32(1)<<(uint64(8)*uint64(unsafe.Sizeof(Private_mp_word(0)))-uint64(2*MP_DIGIT_BIT)+uint64(1)) && min_len <= int32(uint64(1)<<(uint64(8)*Size_t(unsafe.Sizeof(Mp_word(0)))-uint64(2)*uint64(MP_DIGIT_BIT))) {
		err = XTclBN_fast_s_mp_mul_digs(tls, a, b, c, digs)
	} else if uint64(unsafe.Sizeof([1]int8{})) == uint64(1) {
		err = XTclBN_s_mp_mul_digs(tls, a, b, c, digs)
	} else {
		err = -3
	}
	(*Mp_int)(unsafe.Pointer(c)).Fsign = func() int32 {
		if (*Mp_int)(unsafe.Pointer(c)).Fused > 0 {
			return neg
		}
		return MP_ZPOS
	}()
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// b = a*2
func XTclBN_mp_mul_2(tls *libc.TLS, a uintptr, b uintptr) Mp_err { /* bn_mp_mul_2.c:7:8: */
	var x int32
	var oldused int32
	var err Mp_err

	// grow to accomodate result
	if (*Mp_int)(unsafe.Pointer(b)).Falloc < (*Mp_int)(unsafe.Pointer(a)).Fused+1 {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, b, (*Mp_int)(unsafe.Pointer(a)).Fused+1)) != MP_OKAY {
			return err
		}
	}

	oldused = (*Mp_int)(unsafe.Pointer(b)).Fused
	(*Mp_int)(unsafe.Pointer(b)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused

	{
		var r Mp_digit
		var rr Mp_digit
		var tmpa uintptr
		var tmpb uintptr

		// alias for source
		tmpa = (*Mp_int)(unsafe.Pointer(a)).Fdp

		// alias for dest
		tmpb = (*Mp_int)(unsafe.Pointer(b)).Fdp

		// carry
		r = Mp_digit(0)
		for x = 0; x < (*Mp_int)(unsafe.Pointer(a)).Fused; x++ {

			// get what will be the *next* carry bit from the
			// MSB of the current digit
			rr = *(*Mp_digit)(unsafe.Pointer(tmpa)) >> Mp_digit(MP_DIGIT_BIT-1)

			// now shift up this digit, add in the carry [from the previous]
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpb, 4))) = (*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4)))<<1 | r) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))

			// copy the carry that would be from the source
			// digit into the next iteration
			r = rr
		}

		// new leading digit?
		if r != 0 {
			// add a MSB which is always 1 at this point
			*(*Mp_digit)(unsafe.Pointer(tmpb)) = Mp_digit(1)
			(*Mp_int)(unsafe.Pointer(b)).Fused++
		}

		// now zero any excess digits on the destination
		// that we didn't write to
		for ok := true; ok; ok = 0 != 0 {
			var zd_ int32 = oldused - (*Mp_int)(unsafe.Pointer(b)).Fused
			var zm_ uintptr = (*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(b)).Fused)*4
			for libc.PostDecInt32(&zd_, 1) > 0 {
				*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
			}
		}

	}
	(*Mp_int)(unsafe.Pointer(b)).Fsign = (*Mp_int)(unsafe.Pointer(a)).Fsign
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// shift left by a certain bit count
func XTclBN_mp_mul_2d(tls *libc.TLS, a uintptr, b int32, c uintptr) Mp_err { /* bn_mp_mul_2d.c:7:8: */
	var d Mp_digit
	var err Mp_err

	// copy
	if a != c {
		if libc.AssignInt32(&err, XTclBN_mp_copy(tls, a, c)) != MP_OKAY {
			return err
		}
	}

	if (*Mp_int)(unsafe.Pointer(c)).Falloc < (*Mp_int)(unsafe.Pointer(c)).Fused+b/MP_DIGIT_BIT+1 {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, c, (*Mp_int)(unsafe.Pointer(c)).Fused+b/MP_DIGIT_BIT+1)) != MP_OKAY {
			return err
		}
	}

	// shift by as many digits in the bit count
	if b >= MP_DIGIT_BIT {
		if libc.AssignInt32(&err, XTclBN_mp_lshd(tls, c, b/MP_DIGIT_BIT)) != MP_OKAY {
			return err
		}
	}

	// shift any bit count < MP_DIGIT_BIT
	d = Mp_digit(b % MP_DIGIT_BIT)
	if d != 0 {
		var tmpc uintptr
		var shift Mp_digit
		var mask Mp_digit
		var r Mp_digit
		var rr Mp_digit
		var x int32

		// bitmask for carries
		mask = Mp_digit(Mp_digit(1))<<d - Mp_digit(1)

		// shift for msbs
		shift = Mp_digit(MP_DIGIT_BIT) - d

		// alias
		tmpc = (*Mp_int)(unsafe.Pointer(c)).Fdp

		// carry
		r = Mp_digit(0)
		for x = 0; x < (*Mp_int)(unsafe.Pointer(c)).Fused; x++ {
			// get the higher bits of the current word
			rr = *(*Mp_digit)(unsafe.Pointer(tmpc)) >> shift & mask

			// shift the current word and OR in the carry
			*(*Mp_digit)(unsafe.Pointer(tmpc)) = (*(*Mp_digit)(unsafe.Pointer(tmpc))<<d | r) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			tmpc += 4

			// set the carry to the carry bits of the current word
			r = rr
		}

		// set final carry
		if r != 0 {
			*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(libc.PostIncInt32(&(*Mp_int)(unsafe.Pointer(c)).Fused, 1))*4)) = r
		}
	}
	XTclBN_mp_clamp(tls, c)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// multiply by a digit
func XTclBN_mp_mul_d(tls *libc.TLS, a uintptr, b Mp_digit, c uintptr) Mp_err { /* bn_mp_mul_d.c:7:8: */
	var u Mp_digit
	var tmpa uintptr
	var tmpc uintptr
	var r Mp_word
	var err Mp_err
	var ix int32
	var olduse int32

	// make sure c is big enough to hold a*b
	if (*Mp_int)(unsafe.Pointer(c)).Falloc < (*Mp_int)(unsafe.Pointer(a)).Fused+1 {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, c, (*Mp_int)(unsafe.Pointer(a)).Fused+1)) != MP_OKAY {
			return err
		}
	}

	// get the original destinations used count
	olduse = (*Mp_int)(unsafe.Pointer(c)).Fused

	// set the sign
	(*Mp_int)(unsafe.Pointer(c)).Fsign = (*Mp_int)(unsafe.Pointer(a)).Fsign

	// alias for a->dp [source]
	tmpa = (*Mp_int)(unsafe.Pointer(a)).Fdp

	// alias for c->dp [dest]
	tmpc = (*Mp_int)(unsafe.Pointer(c)).Fdp

	// zero carry
	u = Mp_digit(0)

	// compute columns
	for ix = 0; ix < (*Mp_int)(unsafe.Pointer(a)).Fused; ix++ {
		// compute product and carry sum for this term
		r = Mp_word(u) + Mp_word(*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4))))*Mp_word(b)

		// mask off higher bits to get a single digit
		*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = Mp_digit(r & uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1)))

		// send carry into next iteration
		u = Mp_digit(r >> uint64(MP_DIGIT_BIT))
	}

	// store final carry [if any] and increment ix offset
	*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = u
	ix++

	// now zero digits above the top
	for ok := true; ok; ok = 0 != 0 {
		var zd_ int32 = olduse - ix
		var zm_ uintptr = tmpc
		for libc.PostDecInt32(&zd_, 1) > 0 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
		}
	}

	// set used count
	(*Mp_int)(unsafe.Pointer(c)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused + 1
	XTclBN_mp_clamp(tls, c)

	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// b = -a
func XTclBN_mp_neg(tls *libc.TLS, a uintptr, b uintptr) Mp_err { /* bn_mp_neg.c:7:8: */
	var err Mp_err
	if a != b {
		if libc.AssignInt32(&err, XTclBN_mp_copy(tls, a, b)) != MP_OKAY {
			return err
		}
	}

	if !((*Mp_int)(unsafe.Pointer(b)).Fused == 0) {
		(*Mp_int)(unsafe.Pointer(b)).Fsign = func() int32 {
			if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_ZPOS {
				return MP_NEG
			}
			return MP_ZPOS
		}()
	} else {
		(*Mp_int)(unsafe.Pointer(b)).Fsign = MP_ZPOS
	}

	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// two complement or
func XTclBN_mp_or(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_mp_or.c:7:8: */
	var used int32 = func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused > (*Mp_int)(unsafe.Pointer(b)).Fused {
			return (*Mp_int)(unsafe.Pointer(a)).Fused
		}
		return (*Mp_int)(unsafe.Pointer(b)).Fused
	}() + 1
	var i int32
	var err Mp_err
	var ac Mp_digit = Mp_digit(1)
	var bc Mp_digit = Mp_digit(1)
	var cc Mp_digit = Mp_digit(1)
	var csign Mp_sign
	if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG || (*Mp_int)(unsafe.Pointer(b)).Fsign == MP_NEG {
		csign = MP_NEG
	} else {
		csign = MP_ZPOS
	}

	if (*Mp_int)(unsafe.Pointer(c)).Falloc < used {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, c, used)) != MP_OKAY {
			return err
		}
	}

	for i = 0; i < used; i++ {
		var x Mp_digit
		var y Mp_digit

		// convert to two complement if negative
		if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG {
			ac = ac + func() uint32 {
				if i >= (*Mp_int)(unsafe.Pointer(a)).Fused {
					return Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
				}
				return ^*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(i)*4)) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			}()
			x = ac & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			ac >>= MP_DIGIT_BIT
		} else {
			if i >= (*Mp_int)(unsafe.Pointer(a)).Fused {
				x = uint32(0)
			} else {
				x = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(i)*4))
			}
		}

		// convert to two complement if negative
		if (*Mp_int)(unsafe.Pointer(b)).Fsign == MP_NEG {
			bc = bc + func() uint32 {
				if i >= (*Mp_int)(unsafe.Pointer(b)).Fused {
					return Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
				}
				return ^*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(i)*4)) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			}()
			y = bc & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			bc >>= MP_DIGIT_BIT
		} else {
			if i >= (*Mp_int)(unsafe.Pointer(b)).Fused {
				y = uint32(0)
			} else {
				y = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(i)*4))
			}
		}

		*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(i)*4)) = x | y

		// convert to to sign-magnitude if negative
		if csign == MP_NEG {
			cc = cc + ^*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(i)*4))&(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1))
			*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(i)*4)) = cc & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			cc >>= MP_DIGIT_BIT
		}
	}

	(*Mp_int)(unsafe.Pointer(c)).Fused = used
	(*Mp_int)(unsafe.Pointer(c)).Fsign = csign
	XTclBN_mp_clamp(tls, c)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// returns size of ASCII representation
func XTclBN_mp_radix_size(tls *libc.TLS, a uintptr, radix int32, size uintptr) Mp_err { /* bn_mp_radix_size.c:7:8: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var err Mp_err
	var digs int32
	// var t Mp_int at bp, 24

	// var d Mp_digit at bp+24, 4

	*(*int32)(unsafe.Pointer(size)) = 0

	// make sure the radix is in range
	if !(radix < 2 || radix > 64) {
		goto __1
	}
	return -3
__1:
	;

	if !((*Mp_int)(unsafe.Pointer(a)).Fused == 0) {
		goto __2
	}
	*(*int32)(unsafe.Pointer(size)) = 2
	return MP_OKAY
__2:
	;

	// special case for binary
	if !(radix == 2) {
		goto __3
	}
	*(*int32)(unsafe.Pointer(size)) = XTclBN_mp_count_bits(tls, a) + func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG {
			return 1
		}
		return 0
	}() + 1
	return MP_OKAY
__3:
	;

	// digs is the digit count
	digs = 0

	// if it's negative add one for the sign
	if !((*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG) {
		goto __4
	}
	digs++
__4:
	;

	// init a copy of the input
	if !(libc.AssignInt32(&err, XTclBN_mp_init_copy(tls, bp, a)) != MP_OKAY) {
		goto __5
	}
	return err
__5:
	;

	// force temp to positive
	(*Mp_int)(unsafe.Pointer(bp /* &t */)).Fsign = MP_ZPOS

	// fetch out all of the digits
__6:
	if !!((*Mp_int)(unsafe.Pointer(bp)).Fused == 0) {
		goto __7
	}
	if !(libc.AssignInt32(&err, XTclBN_mp_div_d(tls, bp, Mp_digit(radix), bp, bp+24)) != MP_OKAY) {
		goto __8
	}
	goto LBL_ERR
__8:
	;
	digs++
	goto __6
__7:
	;

	// return digs + 1, the 1 is for the NULL byte that would be required.
	*(*int32)(unsafe.Pointer(size)) = digs + 1
	err = MP_OKAY

LBL_ERR:
	XTclBN_mp_clear(tls, bp)
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// chars used in radix conversions
var Xmp_s_rmap uintptr = ts /* "0123456789ABCDEF..." */ /* bn_mp_radix_smap.c:7:12 */
var Xmp_s_rmap_reverse = [88]uint8{
	uint8(0xff), uint8(0xff), uint8(0xff), uint8(0x3e), uint8(0xff), uint8(0xff), uint8(0xff), uint8(0x3f), // ()*+,-./
	uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x04), uint8(0x05), uint8(0x06), uint8(0x07), // 01234567
	uint8(0x08), uint8(0x09), uint8(0xff), uint8(0xff), uint8(0xff), uint8(0xff), uint8(0xff), uint8(0xff), // 89:;<=>?
	uint8(0xff), uint8(0x0a), uint8(0x0b), uint8(0x0c), uint8(0x0d), uint8(0x0e), uint8(0x0f), uint8(0x10), // @ABCDEFG
	uint8(0x11), uint8(0x12), uint8(0x13), uint8(0x14), uint8(0x15), uint8(0x16), uint8(0x17), uint8(0x18), // HIJKLMNO
	uint8(0x19), uint8(0x1a), uint8(0x1b), uint8(0x1c), uint8(0x1d), uint8(0x1e), uint8(0x1f), uint8(0x20), // PQRSTUVW
	uint8(0x21), uint8(0x22), uint8(0x23), uint8(0xff), uint8(0xff), uint8(0xff), uint8(0xff), uint8(0xff), // XYZ[\]^_
	uint8(0xff), uint8(0x24), uint8(0x25), uint8(0x26), uint8(0x27), uint8(0x28), uint8(0x29), uint8(0x2a), // `abcdefg
	uint8(0x2b), uint8(0x2c), uint8(0x2d), uint8(0x2e), uint8(0x2f), uint8(0x30), uint8(0x31), uint8(0x32), // hijklmno
	uint8(0x33), uint8(0x34), uint8(0x35), uint8(0x36), uint8(0x37), uint8(0x38), uint8(0x39), uint8(0x3a), // pqrstuvw
	uint8(0x3b), uint8(0x3c), uint8(0x3d), uint8(0xff), uint8(0xff), uint8(0xff), uint8(0xff), uint8(0xff), // xyz{|}~.
}                                                                            /* bn_mp_radix_smap.c:8:21 */
var Xmp_s_rmap_reverse_sz Size_t = Size_t(unsafe.Sizeof(Xmp_s_rmap_reverse)) /* bn_mp_radix_smap.c:21:14 */

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// read a string [ASCII] in a given radix
func XTclBN_mp_read_radix(tls *libc.TLS, a uintptr, str uintptr, radix int32) Mp_err { /* bn_mp_read_radix.c:9:8: */
	var err Mp_err
	var y int32
	var neg Mp_sign
	var pos uint32
	var ch int8

	// zero the digit bignum
	XTclBN_mp_zero(tls, a)

	// make sure the radix is ok
	if radix < 2 || radix > 64 {
		return -3
	}

	// if the leading digit is a
	// minus set the sign to negative.
	if int32(*(*int8)(unsafe.Pointer(str))) == '-' {
		str++
		neg = MP_NEG
	} else {
		neg = MP_ZPOS
	}

	// set the integer to the default of zero
	XTclBN_mp_zero(tls, a)

	// process each digit of the string
	for int32(*(*int8)(unsafe.Pointer(str))) != 0 {
		// if the radix <= 36 the conversion is case insensitive
		// this allows numbers like 1AB and 1ab to represent the same  value
		// [e.g. in hex]
		if radix <= 36 {
			ch = func() int8 {
				if int32(*(*int8)(unsafe.Pointer(str))) >= 'a' && int32(*(*int8)(unsafe.Pointer(str))) <= 'z' {
					return int8(int32(*(*int8)(unsafe.Pointer(str))) + 'A' - 'a')
				}
				return int8(int32(*(*int8)(unsafe.Pointer(str))))
			}()
		} else {
			ch = *(*int8)(unsafe.Pointer(str))
		}
		pos = uint32(int32(ch) - '(')
		if Xmp_s_rmap_reverse_sz < Size_t(pos) {
			break
		}
		y = int32(Xmp_s_rmap_reverse[pos])

		// if the char was found in the map
		// and is less than the given radix add it
		// to the number, otherwise exit the loop.
		if y == 0xff || y >= radix {
			break
		}
		if libc.AssignInt32(&err, XTclBN_mp_mul_d(tls, a, Mp_digit(radix), a)) != MP_OKAY {
			return err
		}
		if libc.AssignInt32(&err, XTclBN_mp_add_d(tls, a, Mp_digit(y), a)) != MP_OKAY {
			return err
		}
		str++
	}

	// if an illegal character was found, fail.
	if !(int32(*(*int8)(unsafe.Pointer(str))) == 0 || int32(*(*int8)(unsafe.Pointer(str))) == '\r' || int32(*(*int8)(unsafe.Pointer(str))) == '\n') {
		XTclBN_mp_zero(tls, a)
		return -3
	}

	// set the sign only if a != 0
	if !((*Mp_int)(unsafe.Pointer(a)).Fused == 0) {
		(*Mp_int)(unsafe.Pointer(a)).Fsign = neg
	}
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// shift right a certain amount of digits
func XTclBN_mp_rshd(tls *libc.TLS, a uintptr, b int32) { /* bn_mp_rshd.c:7:6: */
	var x int32
	var bottom uintptr
	var top uintptr

	// if b <= 0 then ignore it
	if b <= 0 {
		return
	}

	// if b > used then simply zero it and return
	if (*Mp_int)(unsafe.Pointer(a)).Fused <= b {
		XTclBN_mp_zero(tls, a)
		return
	}

	// shift the digits down

	// bottom
	bottom = (*Mp_int)(unsafe.Pointer(a)).Fdp

	// top [offset into digits]
	top = (*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(b)*4

	// this is implemented as a sliding window where
	//  the window is b-digits long and digits from
	//  the top of the window are copied to the bottom
	//
	//  e.g.
	//
	//     b-2 | b-1 | b0 | b1 | b2 | ... | bb |   ---->
	//                 /\                   |      ---->
	//                  \-------------------/      ---->
	//
	for x = 0; x < (*Mp_int)(unsafe.Pointer(a)).Fused-b; x++ {
		*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&bottom, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&top, 4)))
	}

	// zero the top digits
	for ok := true; ok; ok = 0 != 0 {
		var zd_ int32 = (*Mp_int)(unsafe.Pointer(a)).Fused - x
		var zm_ uintptr = bottom
		for libc.PostDecInt32(&zd_, 1) > 0 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
		}
	}

	// remove excess digits
	*(*int32)(unsafe.Pointer(a)) -= b
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// set to a digit
func XTclBN_mp_set(tls *libc.TLS, a uintptr, b Mp_digit) { /* bn_mp_set.c:7:6: */
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp)) = b & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
	(*Mp_int)(unsafe.Pointer(a)).Fsign = MP_ZPOS
	(*Mp_int)(unsafe.Pointer(a)).Fused = func() int32 {
		if *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp)) != 0 {
			return 1
		}
		return 0
	}()
	for ok := true; ok; ok = 0 != 0 {
		var zd_ int32 = (*Mp_int)(unsafe.Pointer(a)).Falloc - (*Mp_int)(unsafe.Pointer(a)).Fused
		var zm_ uintptr = (*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(a)).Fused)*4
		for libc.PostDecInt32(&zd_, 1) > 0 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
		}
	}
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// shrink a bignum
func XTclBN_mp_shrink(tls *libc.TLS, a uintptr) Mp_err { /* bn_mp_shrink.c:7:8: */
	var tmp uintptr
	var alloc int32 = func() int32 {
		if (int32(uint64(8)*Size_t(unsafe.Sizeof(Tcl_WideInt(0))))+MP_DIGIT_BIT-1)/MP_DIGIT_BIT > (*Mp_int)(unsafe.Pointer(a)).Fused {
			return (int32(uint64(8)*Size_t(unsafe.Sizeof(Tcl_WideInt(0)))) + MP_DIGIT_BIT - 1) / MP_DIGIT_BIT
		}
		return (*Mp_int)(unsafe.Pointer(a)).Fused
	}()
	if (*Mp_int)(unsafe.Pointer(a)).Falloc != alloc {
		if libc.AssignUintptr(&tmp, XTcl_Realloc(tls, (*Mp_int)(unsafe.Pointer(a)).Fdp, uint32(Size_t(alloc)*Size_t(unsafe.Sizeof(Mp_digit(0)))))) == uintptr(0) {
			return -2
		}
		(*Mp_int)(unsafe.Pointer(a)).Fdp = tmp
		(*Mp_int)(unsafe.Pointer(a)).Falloc = alloc
	}
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// shift right by a certain bit count with sign extension
func XTclBN_mp_signed_rsh(tls *libc.TLS, a uintptr, b int32, c uintptr) Mp_err { /* bn_mp_signed_rsh.c:7:8: */
	var res Mp_err
	if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_ZPOS {
		return XTclBN_mp_div_2d(tls, a, b, c, uintptr(0))
	}

	res = XTclBN_mp_add_d(tls, a, uint32(1), c)
	if res != MP_OKAY {
		return res
	}

	res = XTclBN_mp_div_2d(tls, c, b, c, uintptr(0))
	if res == MP_OKAY {
		return XTclBN_mp_sub_d(tls, c, uint32(1), c)
	}
	return res
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// computes b = a*a
func XTclBN_mp_sqr(tls *libc.TLS, a uintptr, b uintptr) Mp_err { /* bn_mp_sqr.c:7:8: */
	var err Mp_err
	if uint64(unsafe.Sizeof([1]int8{})) == uint64(1) && (*Mp_int)(unsafe.Pointer(a)).Fused >= MP_DEFAULT_TOOM_SQR_CUTOFF {
		err = XTclBN_mp_toom_sqr(tls, a, b)
	} else if uint64(unsafe.Sizeof([1]int8{})) == uint64(1) && (*Mp_int)(unsafe.Pointer(a)).Fused >= MP_DEFAULT_KARATSUBA_SQR_CUTOFF {
		err = XTclBN_mp_karatsuba_sqr(tls, a, b)
	} else if uint64(unsafe.Sizeof([1]int8{})) == uint64(1) && (*Mp_int)(unsafe.Pointer(a)).Fused*2+1 < int32(1)<<(uint64(8)*uint64(unsafe.Sizeof(Private_mp_word(0)))-uint64(2*MP_DIGIT_BIT)+uint64(1)) && (*Mp_int)(unsafe.Pointer(a)).Fused < int32(uint64(1)<<(uint64(8)*Size_t(unsafe.Sizeof(Mp_word(0)))-uint64(2)*uint64(MP_DIGIT_BIT)))/2 {
		err = XTclBN_fast_s_mp_sqr(tls, a, b)
	} else if uint64(unsafe.Sizeof([1]int8{})) == uint64(1) {
		err = XTclBN_s_mp_sqr(tls, a, b)
	} else {
		err = -3
	}
	(*Mp_int)(unsafe.Pointer(b)).Fsign = MP_ZPOS
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// Copyright (C) 2002-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  5.2.4.2.2  Characteristics of floating types <float.h>

// Declarations for math functions.
//    Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.12 Mathematics	<math.h>

// Handle feature test macros at the start of a header.
//    Copyright (C) 2016-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// This header is internal to glibc and should not be included outside
//    of glibc headers.  Headers including it must define
//    __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first.  This header
//    cannot have multiple include guards because ISO C feature test
//    macros depend on the definition of the macro when an affected
//    header is included, not when the first system header is
//    included.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__
//    macro.

// ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
//    macro.  Most but not all symbols enabled by that macro in TS
//    18661-1 are enabled unconditionally in C2X; the symbols in Annex F
//    still require that macro in C2X.

// ISO/IEC TS 18661-4:2015 defines the
//    __STDC_WANT_IEC_60559_FUNCS_EXT__ macro.  Other than the reduction
//    functions, the symbols from this TS are enabled unconditionally in
//    C2X.

// ISO/IEC TS 18661-3:2015 defines the
//    __STDC_WANT_IEC_60559_TYPES_EXT__ macro.

// Get definitions of __intmax_t and __uintmax_t.
// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Get machine-dependent vector math functions declarations.
// Platform-specific SIMD declarations of math functions.
//    Copyright (C) 2014-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Get default empty definitions for simd declarations.
// Empty definitions required for __MATHCALL_VEC unfolding in mathcalls.h.
//    Copyright (C) 2014-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Needed definitions could be generated with:
//    for func in $(grep __MATHCALL_VEC math/bits/mathcalls.h |		 sed -r "s|__MATHCALL_VEC.?\(||; s|,.*||"); do
//      echo "#define __DECL_SIMD_${func}";
//      echo "#define __DECL_SIMD_${func}f";
//      echo "#define __DECL_SIMD_${func}l";
//    done
//

// Gather machine dependent type support.
// Macros to control TS 18661-3 glibc features on x86.
//    Copyright (C) 2017-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Value returned on overflow.  With IEEE 754 floating point, this is
//    +Infinity, otherwise the largest representable positive value.

// IEEE positive infinity.

// IEEE Not A Number.

// Get __GLIBC_FLT_EVAL_METHOD.
// Define __GLIBC_FLT_EVAL_METHOD.  x86 version.
//    Copyright (C) 2016-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Define the following typedefs.
//
//     float_t	floating-point type at least as wide as `float' used
// 		to evaluate `float' expressions
//     double_t	floating-point type at least as wide as `double' used
// 		to evaluate `double' expressions
type Float_t = float32  /* math.h:149:15 */
type Double_t = float64 /* math.h:150:16 */

// GCC bug 66462 means we cannot use the math builtins with -fsignaling-nan,
//    so disable builtins if this is enabled.  When fixed in a newer GCC,
//    the __SUPPORT_SNAN__ check may be skipped for those versions.

// Return number of classification appropriate for X.
// The check for __cplusplus allows the use of the builtin, even
// 	when optimization for size is on.  This is provided for
// 	libstdc++, only to let its configure test work when it is built
// 	with -Os.  No further use of this definition of fpclassify is
// 	expected in C++ mode, since libstdc++ provides its own version
// 	of fpclassify in cmath (which undefines fpclassify).

// Return nonzero value if sign of X is negative.

// Return nonzero value if X is not +-Inf or NaN.

// Return nonzero value if X is neither zero, subnormal, Inf, nor NaN.

// Return nonzero value if X is a NaN.  We could use `fpclassify' but
//    we already have this functions `__isnan' and it is faster.

// Return nonzero value if X is positive or negative infinity.

// Bitmasks for the math_errhandling macro.

// By default all math functions support both errno and exception handling
//    (except for soft floating point implementations which may only support
//    errno handling).  If errno handling is disabled, exceptions are still
//    supported by GLIBC.  Set math_errhandling to 0 with -ffast-math (this is
//    nonconforming but it is more useful than leaving it undefined).

// Some useful constants.

// The above constants are not adequate for computation using `long double's.
//    Therefore we provide as an extension constants with similar names as a
//    GNU extension.  Provide enough digits for the 128-bit IEEE quad.

// When compiling in strict ISO C compatible mode we must not use the
//    inline functions since they, among other things, do not set the
//    `errno' variable correctly.

// ISO C99 defines some macros to compare number while taking care for
//    unordered numbers.  Many FPUs provide special instructions to support
//    these operations.  Generic support in GCC for these as builtins went
//    in 2.97, but not all cpus added their patterns until 3.1.  Therefore
//    we enable the builtins from 3.1 onwards and use a generic implementation
//    othwerwise.

// Get machine-dependent inline versions (if there are any).

// this function is less generic than mp_n_root, simpler and faster
func XTclBN_mp_sqrt(tls *libc.TLS, arg uintptr, ret uintptr) Mp_err { /* bn_mp_sqrt.c:15:8: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var err Mp_err
	// var t1 Mp_int at bp, 24

	// var t2 Mp_int at bp+24, 24

	var i int32
	var j int32
	var k int32
	var d float64
	var dig Mp_digit

	// must be positive
	if !((*Mp_int)(unsafe.Pointer(arg)).Fsign == MP_NEG) {
		goto __1
	}
	return -3
__1:
	;

	// easy out
	if !((*Mp_int)(unsafe.Pointer(arg)).Fused == 0) {
		goto __2
	}
	XTclBN_mp_zero(tls, ret)
	return MP_OKAY
__2:
	;

	i = (*Mp_int)(unsafe.Pointer(arg)).Fused/2 - 1
	j = 2 * i
	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp, i+2)) != MP_OKAY) {
		goto __3
	}
	return err
__3:
	;

	if !(libc.AssignInt32(&err, XTclBN_mp_init(tls, bp+24)) != MP_OKAY) {
		goto __4
	}
	goto E2
__4:
	;

	k = 0
__5:
	if !(k < i) {
		goto __7
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &t1 */)).Fdp + uintptr(k)*4)) = Mp_digit(0)
	goto __6
__6:
	k++
	goto __5
	goto __7
__7:
	;

	// Estimate the square root using the hardware floating point unit.

	libc.AtomicStoreFloat64(&d, float64(0.0))
	k = (*Mp_int)(unsafe.Pointer(arg)).Fused - 1
__8:
	if !(k >= j) {
		goto __10
	}
	libc.AtomicStoreFloat64(&d, float64(libc.Xldexp(tls, d, MP_DIGIT_BIT)+float64(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(arg)).Fdp + uintptr(k)*4)))))
	goto __9
__9:
	k--
	goto __8
	goto __10
__10:
	;

	// At this point, d is the nearest floating point number to the most
	// significant 1 or 2 mp_digits of arg. Extract its square root.

	libc.AtomicStoreFloat64(&d, float64(libc.Xsqrt(tls, d)))

	// dig is the most significant mp_digit of the square root

	dig = libc.Uint32FromFloat64(libc.Xldexp(tls, d, -MP_DIGIT_BIT))

	// If the most significant digit is nonzero, find the next digit down
	// by subtracting MP_DIGIT_BIT times thie most significant digit.
	// Subtract one from the result so that our initial estimate is always
	// low.

	if !(dig != 0) {
		goto __11
	}
	(*Mp_int)(unsafe.Pointer(bp /* &t1 */)).Fused = i + 2
	libc.AtomicAddFloat64(&d, -float64(libc.Xldexp(tls, float64(dig), MP_DIGIT_BIT)))
	if !(d >= 1.0) {
		goto __13
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &t1 */)).Fdp + uintptr(i+1)*4)) = dig
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &t1 */)).Fdp + uintptr(i)*4)) = Mp_digit(d) - Mp_digit(1)
	goto __14
__13:
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &t1 */)).Fdp + uintptr(i+1)*4)) = dig - Mp_digit(1)
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &t1 */)).Fdp + uintptr(i)*4)) = Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
__14:
	;
	goto __12
__11:
	(*Mp_int)(unsafe.Pointer(bp /* &t1 */)).Fused = i + 1
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &t1 */)).Fdp + uintptr(i)*4)) = Mp_digit(d) - Mp_digit(1)
__12:
	;

	// t1 > 0
	if !(libc.AssignInt32(&err, XTclBN_mp_div(tls, arg, bp, bp+24, uintptr(0))) != MP_OKAY) {
		goto __15
	}
	goto E1
__15:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp, bp+24, bp)) != MP_OKAY) {
		goto __16
	}
	goto E1
__16:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_div_2(tls, bp, bp)) != MP_OKAY) {
		goto __17
	}
	goto E1
__17:
	;
	// And now t1 > sqrt(arg)
__18:
	if !(libc.AssignInt32(&err, XTclBN_mp_div(tls, arg, bp, bp+24, uintptr(0))) != MP_OKAY) {
		goto __21
	}
	goto E1
__21:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp, bp+24, bp)) != MP_OKAY) {
		goto __22
	}
	goto E1
__22:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_div_2(tls, bp, bp)) != MP_OKAY) {
		goto __23
	}
	goto E1
__23:
	;
	// t1 >= sqrt(arg) >= t2 at this point
	goto __19
__19:
	if XTclBN_mp_cmp_mag(tls, bp, bp+24) == MP_GT {
		goto __18
	}
	goto __20
__20:
	;

	XTclBN_mp_exch(tls, bp, ret)

E1:
	XTclBN_mp_clear(tls, bp+24)
E2:
	XTclBN_mp_clear(tls, bp)
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// high level subtraction (handles signs)
func XTclBN_mp_sub(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_mp_sub.c:7:8: */
	var sa Mp_sign = (*Mp_int)(unsafe.Pointer(a)).Fsign
	var sb Mp_sign = (*Mp_int)(unsafe.Pointer(b)).Fsign
	var err Mp_err

	if sa != sb {
		// subtract a negative from a positive, OR
		// subtract a positive from a negative.
		// In either case, ADD their magnitudes,
		// and use the sign of the first number.
		(*Mp_int)(unsafe.Pointer(c)).Fsign = sa
		err = XTclBN_s_mp_add(tls, a, b, c)
	} else {
		// subtract a positive from a positive, OR
		// subtract a negative from a negative.
		// First, take the difference between their
		// magnitudes, then...
		if XTclBN_mp_cmp_mag(tls, a, b) != -1 {
			// Copy the sign from the first
			(*Mp_int)(unsafe.Pointer(c)).Fsign = sa
			// The first has a larger or equal magnitude
			err = XTclBN_s_mp_sub(tls, a, b, c)
		} else {
			// The result has the *opposite* sign from
			// the first number.
			(*Mp_int)(unsafe.Pointer(c)).Fsign = func() int32 {
				if sa == MP_ZPOS {
					return MP_NEG
				}
				return MP_ZPOS
			}()
			// The second has a larger magnitude
			err = XTclBN_s_mp_sub(tls, b, a, c)
		}
	}
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// single digit subtraction
func XTclBN_mp_sub_d(tls *libc.TLS, a uintptr, b Mp_digit, c uintptr) Mp_err { /* bn_mp_sub_d.c:7:8: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var tmpa uintptr
	var tmpc uintptr
	var err Mp_err
	var ix int32
	var oldused int32

	// grow c as required
	if (*Mp_int)(unsafe.Pointer(c)).Falloc < (*Mp_int)(unsafe.Pointer(a)).Fused+1 {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, c, (*Mp_int)(unsafe.Pointer(a)).Fused+1)) != MP_OKAY {
			return err
		}
	}

	// if a is negative just do an unsigned
	// addition [with fudged signs]
	if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG {
		*(*Mp_int)(unsafe.Pointer(bp /* a_ */)) = *(*Mp_int)(unsafe.Pointer(a))
		(*Mp_int)(unsafe.Pointer(bp /* &a_ */)).Fsign = MP_ZPOS
		err = XTclBN_mp_add_d(tls, bp, b, c)
		(*Mp_int)(unsafe.Pointer(c)).Fsign = MP_NEG

		// clamp
		XTclBN_mp_clamp(tls, c)

		return err
	}

	// setup regs
	oldused = (*Mp_int)(unsafe.Pointer(c)).Fused
	tmpa = (*Mp_int)(unsafe.Pointer(a)).Fdp
	tmpc = (*Mp_int)(unsafe.Pointer(c)).Fdp

	// if a <= b simply fix the single digit
	if (*Mp_int)(unsafe.Pointer(a)).Fused == 1 && *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp)) <= b || (*Mp_int)(unsafe.Pointer(a)).Fused == 0 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused == 1 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = b - *(*Mp_digit)(unsafe.Pointer(tmpa))
		} else {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = b
		}
		ix = 1

		// negative/1digit
		(*Mp_int)(unsafe.Pointer(c)).Fsign = MP_NEG
		(*Mp_int)(unsafe.Pointer(c)).Fused = 1
	} else {
		var mu Mp_digit = b

		// positive/size
		(*Mp_int)(unsafe.Pointer(c)).Fsign = MP_ZPOS
		(*Mp_int)(unsafe.Pointer(c)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused

		// subtract digits, mu is carry
		for ix = 0; ix < (*Mp_int)(unsafe.Pointer(a)).Fused; ix++ {
			*(*Mp_digit)(unsafe.Pointer(tmpc)) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4))) - mu
			mu = *(*Mp_digit)(unsafe.Pointer(tmpc)) >> (uint64(8)*Size_t(unsafe.Sizeof(Mp_digit(0))) - uint64(1))
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) &= Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
		}
	}

	// zero excess digits
	for ok := true; ok; ok = 0 != 0 {
		var zd_ int32 = oldused - ix
		var zm_ uintptr = tmpc
		for libc.PostDecInt32(&zd_, 1) > 0 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
		}
	}

	XTclBN_mp_clamp(tls, c)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// stores a bignum as a ASCII string in a given radix (2..64)
//
// Stores upto "size - 1" chars and always a NULL byte, puts the number of characters
// written, including the '\0', in "written".
func XTclBN_mp_to_radix(tls *libc.TLS, a uintptr, str uintptr, maxlen Size_t, written uintptr, radix int32) Mp_err { /* bn_mp_to_radix.c:11:8: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var digs Size_t
	var err Mp_err
	// var t Mp_int at bp, 24

	// var d Mp_digit at bp+24, 4

	var _s uintptr
	_s = str

	// check range of radix and size
	if !(maxlen < uint64(2)) {
		goto __1
	}
	return -5
__1:
	;
	if !(radix < 2 || radix > 64) {
		goto __2
	}
	return -3
__2:
	;

	// quick out if its zero
	if !((*Mp_int)(unsafe.Pointer(a)).Fused == 0) {
		goto __3
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&str, 1))) = int8('0')
	*(*int8)(unsafe.Pointer(str)) = int8(0)
	if !(written != uintptr(0)) {
		goto __4
	}
	*(*Size_t)(unsafe.Pointer(written)) = uint64(2)
__4:
	;
	return MP_OKAY
__3:
	;

	if !(libc.AssignInt32(&err, XTclBN_mp_init_copy(tls, bp, a)) != MP_OKAY) {
		goto __5
	}
	return err
__5:
	;

	// if it is negative output a -
	if !((*Mp_int)(unsafe.Pointer(bp)).Fsign == MP_NEG) {
		goto __6
	}
	// we have to reverse our digits later... but not the - sign!!
	_s++

	// store the flag and mark the number as positive
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&str, 1))) = int8('-')
	(*Mp_int)(unsafe.Pointer(bp /* &t */)).Fsign = MP_ZPOS

	// subtract a char
	maxlen--
__6:
	;
	digs = uint64(0)
__7:
	if !!((*Mp_int)(unsafe.Pointer(bp)).Fused == 0) {
		goto __8
	}
	if !(libc.PreDecUint64(&maxlen, 1) < uint64(1)) {
		goto __9
	}
	// no more room
	err = -5
	goto LBL_ERR
__9:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_div_d(tls, bp, Mp_digit(radix), bp, bp+24)) != MP_OKAY) {
		goto __10
	}
	goto LBL_ERR
__10:
	;
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&str, 1))) = *(*int8)(unsafe.Pointer(Xmp_s_rmap + uintptr(*(*Mp_digit)(unsafe.Pointer(bp + 24 /* d */)))))
	digs++
	goto __7
__8:
	;
	// reverse the digits of the string.  In this case _s points
	// to the first digit [exluding the sign] of the number
	XTclBN_s_mp_reverse(tls, _s, digs)

	// append a NULL so the string is properly terminated
	*(*int8)(unsafe.Pointer(str)) = int8(0)
	digs++

	if !(written != uintptr(0)) {
		goto __11
	}
	*(*Size_t)(unsafe.Pointer(written)) = func() uint64 {
		if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG {
			return digs + uint64(1)
		}
		return digs
	}()
__11:
	;

LBL_ERR:
	XTclBN_mp_clear(tls, bp)
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// store in unsigned [big endian] format
func XTclBN_mp_to_ubin(tls *libc.TLS, a uintptr, buf uintptr, maxlen Size_t, written uintptr) Mp_err { /* bn_mp_to_ubin.c:7:8: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var x Size_t
	var count Size_t
	var err Mp_err
	// var t Mp_int at bp, 24

	var size Size_t
	size = Size_t(XTclBN_mp_count_bits(tls, a))
	count = size/uint64(8) + func() uint64 {
		if size&uint64(7) != uint64(0) {
			return uint64(1)
		}
		return uint64(0)
	}()
	if !(count > maxlen) {
		goto __1
	}
	return -5
__1:
	;

	if !(libc.AssignInt32(&err, XTclBN_mp_init_copy(tls, bp, a)) != MP_OKAY) {
		goto __2
	}
	return err
__2:
	;

	x = count
__3:
	if !(libc.PostDecUint64(&x, 1) > uint64(0)) {
		goto __5
	}
	*(*uint8)(unsafe.Pointer(buf + uintptr(x))) = uint8(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp)) & 255)
	if !(libc.AssignInt32(&err, XTclBN_mp_div_2d(tls, bp, 8, bp, uintptr(0))) != MP_OKAY) {
		goto __6
	}
	goto LBL_ERR
__6:
	;
	goto __4
__4:
	;
	goto __3
	goto __5
__5:
	;

	if !(written != uintptr(0)) {
		goto __7
	}
	*(*Size_t)(unsafe.Pointer(written)) = count
__7:
	;

LBL_ERR:
	XTclBN_mp_clear(tls, bp)
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// get the size for an unsigned equivalent
func XTclBN_mp_unsigned_bin_size(tls *libc.TLS, a uintptr) Size_t { /* bn_mp_ubin_size.c:7:8: */
	var size Size_t = Size_t(XTclBN_mp_count_bits(tls, a))
	return size/uint64(8) + func() uint64 {
		if size&uint64(7) != uint64(0) {
			return uint64(1)
		}
		return uint64(0)
	}()
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// two complement xor
func XTclBN_mp_xor(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_mp_xor.c:7:8: */
	var used int32 = func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused > (*Mp_int)(unsafe.Pointer(b)).Fused {
			return (*Mp_int)(unsafe.Pointer(a)).Fused
		}
		return (*Mp_int)(unsafe.Pointer(b)).Fused
	}() + 1
	var i int32
	var err Mp_err
	var ac Mp_digit = Mp_digit(1)
	var bc Mp_digit = Mp_digit(1)
	var cc Mp_digit = Mp_digit(1)
	var csign Mp_sign
	if (*Mp_int)(unsafe.Pointer(a)).Fsign != (*Mp_int)(unsafe.Pointer(b)).Fsign {
		csign = MP_NEG
	} else {
		csign = MP_ZPOS
	}

	if (*Mp_int)(unsafe.Pointer(c)).Falloc < used {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, c, used)) != MP_OKAY {
			return err
		}
	}

	for i = 0; i < used; i++ {
		var x Mp_digit
		var y Mp_digit

		// convert to two complement if negative
		if (*Mp_int)(unsafe.Pointer(a)).Fsign == MP_NEG {
			ac = ac + func() uint32 {
				if i >= (*Mp_int)(unsafe.Pointer(a)).Fused {
					return Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
				}
				return ^*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(i)*4)) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			}()
			x = ac & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			ac >>= MP_DIGIT_BIT
		} else {
			if i >= (*Mp_int)(unsafe.Pointer(a)).Fused {
				x = uint32(0)
			} else {
				x = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(i)*4))
			}
		}

		// convert to two complement if negative
		if (*Mp_int)(unsafe.Pointer(b)).Fsign == MP_NEG {
			bc = bc + func() uint32 {
				if i >= (*Mp_int)(unsafe.Pointer(b)).Fused {
					return Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
				}
				return ^*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(i)*4)) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			}()
			y = bc & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			bc >>= MP_DIGIT_BIT
		} else {
			if i >= (*Mp_int)(unsafe.Pointer(b)).Fused {
				y = uint32(0)
			} else {
				y = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(i)*4))
			}
		}

		*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(i)*4)) = x ^ y

		// convert to to sign-magnitude if negative
		if csign == MP_NEG {
			cc = cc + ^*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(i)*4))&(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1))
			*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(c)).Fdp + uintptr(i)*4)) = cc & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
			cc >>= MP_DIGIT_BIT
		}
	}

	(*Mp_int)(unsafe.Pointer(c)).Fused = used
	(*Mp_int)(unsafe.Pointer(c)).Fsign = csign
	XTclBN_mp_clamp(tls, c)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// set to zero
func XTclBN_mp_zero(tls *libc.TLS, a uintptr) { /* bn_mp_zero.c:7:6: */
	(*Mp_int)(unsafe.Pointer(a)).Fsign = MP_ZPOS
	(*Mp_int)(unsafe.Pointer(a)).Fused = 0
	for ok := true; ok; ok = 0 != 0 {
		var zd_ int32 = (*Mp_int)(unsafe.Pointer(a)).Falloc
		var zm_ uintptr = (*Mp_int)(unsafe.Pointer(a)).Fdp
		for libc.PostDecInt32(&zd_, 1) > 0 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
		}
	}
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// low level addition, based on HAC pp.594, Algorithm 14.7
func XTclBN_s_mp_add(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_s_mp_add.c:7:8: */
	var x uintptr
	var err Mp_err
	var olduse int32
	var min int32
	var max int32

	// find sizes, we let |a| <= |b| which means we have to sort
	// them.  "x" will point to the input with the most digits
	if (*Mp_int)(unsafe.Pointer(a)).Fused > (*Mp_int)(unsafe.Pointer(b)).Fused {
		min = (*Mp_int)(unsafe.Pointer(b)).Fused
		max = (*Mp_int)(unsafe.Pointer(a)).Fused
		x = a
	} else {
		min = (*Mp_int)(unsafe.Pointer(a)).Fused
		max = (*Mp_int)(unsafe.Pointer(b)).Fused
		x = b
	}

	// init result
	if (*Mp_int)(unsafe.Pointer(c)).Falloc < max+1 {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, c, max+1)) != MP_OKAY {
			return err
		}
	}

	// get old used digit count and set new one
	olduse = (*Mp_int)(unsafe.Pointer(c)).Fused
	(*Mp_int)(unsafe.Pointer(c)).Fused = max + 1

	{
		var u Mp_digit
		var tmpa uintptr
		var tmpb uintptr
		var tmpc uintptr
		var i int32

		// alias for digit pointers

		// first input
		tmpa = (*Mp_int)(unsafe.Pointer(a)).Fdp

		// second input
		tmpb = (*Mp_int)(unsafe.Pointer(b)).Fdp

		// destination
		tmpc = (*Mp_int)(unsafe.Pointer(c)).Fdp

		// zero the carry
		u = Mp_digit(0)
		for i = 0; i < min; i++ {
			// Compute the sum at one digit, T[i] = A[i] + B[i] + U
			*(*Mp_digit)(unsafe.Pointer(tmpc)) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4))) + *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpb, 4))) + u

			// U = carry bit of T[i]
			u = *(*Mp_digit)(unsafe.Pointer(tmpc)) >> Mp_digit(MP_DIGIT_BIT)

			// take away carry bit from T[i]
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) &= Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
		}

		// now copy higher words if any, that is in A+B
		// if A or B has more digits add those in
		if min != max {
			for ; i < max; i++ {
				// T[i] = X[i] + U
				*(*Mp_digit)(unsafe.Pointer(tmpc)) = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(x)).Fdp + uintptr(i)*4)) + u

				// U = carry bit of T[i]
				u = *(*Mp_digit)(unsafe.Pointer(tmpc)) >> Mp_digit(MP_DIGIT_BIT)

				// take away carry bit from T[i]
				*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) &= Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
			}
		}

		// add carry
		*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = u

		// clear digits above oldused
		for ok := true; ok; ok = 0 != 0 {
			var zd_ int32 = olduse - (*Mp_int)(unsafe.Pointer(c)).Fused
			var zm_ uintptr = tmpc
			for libc.PostDecInt32(&zd_, 1) > 0 {
				*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
			}
		}

	}

	XTclBN_mp_clamp(tls, c)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// single-digit multiplication with the smaller number as the single-digit
func XTclBN_mp_balance_mul(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_s_mp_balance_mul.c:7:8: */
	bp := tls.Alloc(136)
	defer tls.Free(136)

	var count int32
	var len_a int32
	var len_b int32
	var nblocks int32
	var i int32
	var j int32
	var bsize int32
	// var a0 Mp_int at bp+40, 24

	// var tmp Mp_int at bp+64, 24

	var A Mp_int
	// var B Mp_int at bp+112, 24

	// var r Mp_int at bp+88, 24

	var err Mp_err

	len_a = (*Mp_int)(unsafe.Pointer(a)).Fused
	len_b = (*Mp_int)(unsafe.Pointer(b)).Fused

	nblocks = func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused > (*Mp_int)(unsafe.Pointer(b)).Fused {
			return (*Mp_int)(unsafe.Pointer(a)).Fused
		}
		return (*Mp_int)(unsafe.Pointer(b)).Fused
	}() / func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused < (*Mp_int)(unsafe.Pointer(b)).Fused {
			return (*Mp_int)(unsafe.Pointer(a)).Fused
		}
		return (*Mp_int)(unsafe.Pointer(b)).Fused
	}()
	bsize = func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused < (*Mp_int)(unsafe.Pointer(b)).Fused {
			return (*Mp_int)(unsafe.Pointer(a)).Fused
		}
		return (*Mp_int)(unsafe.Pointer(b)).Fused
	}()

	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp+40, bsize+2)) != MP_OKAY) {
		goto __1
	}
	return err
__1:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_init_multi(tls, bp+64, libc.VaList(bp, bp+88, uintptr(0)))) != MP_OKAY) {
		goto __2
	}
	XTclBN_mp_clear(tls, bp+40)
	return err
__2:
	;

	// Make sure that A is the larger one
	if !(len_a < len_b) {
		goto __3
	}
	*(*Mp_int)(unsafe.Pointer(bp + 112 /* B */)) = *(*Mp_int)(unsafe.Pointer(a))
	A = *(*Mp_int)(unsafe.Pointer(b))
	goto __4
__3:
	A = *(*Mp_int)(unsafe.Pointer(a))
	*(*Mp_int)(unsafe.Pointer(bp + 112 /* B */)) = *(*Mp_int)(unsafe.Pointer(b))
__4:
	;

	i = 0
	j = 0
__5:
	if !(i < nblocks) {
		goto __7
	}
	// Cut a slice off of a
	(*Mp_int)(unsafe.Pointer(bp + 40 /* &a0 */)).Fused = 0
	count = 0
__8:
	if !(count < bsize) {
		goto __10
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+40 /* &a0 */)).Fdp + uintptr(count)*4)) = *(*Mp_digit)(unsafe.Pointer(A.Fdp + uintptr(libc.PostIncInt32(&j, 1))*4))
	(*Mp_int)(unsafe.Pointer(bp+40 /* &a0 */)).Fused++
	goto __9
__9:
	count++
	goto __8
	goto __10
__10:
	;
	XTclBN_mp_clamp(tls, bp+40)
	// Multiply with b
	if !(libc.AssignInt32(&err, XTclBN_mp_mul(tls, bp+40, bp+112, bp+64)) != MP_OKAY) {
		goto __11
	}
	goto LBL_ERR
__11:
	;
	// Shift tmp to the correct position
	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+64, bsize*i)) != MP_OKAY) {
		goto __12
	}
	goto LBL_ERR
__12:
	;
	// Add to output. No carry needed
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+88, bp+64, bp+88)) != MP_OKAY) {
		goto __13
	}
	goto LBL_ERR
__13:
	;
	goto __6
__6:
	i++
	goto __5
	goto __7
__7:
	;
	// The left-overs; there are always left-overs
	if !(j < A.Fused) {
		goto __14
	}
	(*Mp_int)(unsafe.Pointer(bp + 40 /* &a0 */)).Fused = 0
	count = 0
__15:
	if !(j < A.Fused) {
		goto __17
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+40 /* &a0 */)).Fdp + uintptr(count)*4)) = *(*Mp_digit)(unsafe.Pointer(A.Fdp + uintptr(libc.PostIncInt32(&j, 1))*4))
	(*Mp_int)(unsafe.Pointer(bp+40 /* &a0 */)).Fused++
	goto __16
__16:
	count++
	goto __15
	goto __17
__17:
	;
	XTclBN_mp_clamp(tls, bp+40)
	if !(libc.AssignInt32(&err, XTclBN_mp_mul(tls, bp+40, bp+112, bp+64)) != MP_OKAY) {
		goto __18
	}
	goto LBL_ERR
__18:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+64, bsize*i)) != MP_OKAY) {
		goto __19
	}
	goto LBL_ERR
__19:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+88, bp+64, bp+88)) != MP_OKAY) {
		goto __20
	}
	goto LBL_ERR
__20:
	;
__14:
	;

	XTclBN_mp_exch(tls, bp+88, c)
LBL_ERR:
	XTclBN_mp_clear_multi(tls, bp+40, libc.VaList(bp+16, bp+64, bp+88, uintptr(0)))
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// c = |a| * |b| using Karatsuba Multiplication using
//  three half size multiplications
//
//  Let B represent the radix [e.g. 2**MP_DIGIT_BIT] and
//  let n represent half of the number of digits in
//  the min(a,b)
//
//  a = a1 * B**n + a0
//  b = b1 * B**n + b0
//
//  Then, a * b =>
//    a1b1 * B**2n + ((a1 + a0)(b1 + b0) - (a0b0 + a1b1)) * B + a0b0
//  *
//  * Note that a1b1 and a0b0 are used twice and only need to be
//  * computed once.  So in total three half size (half # of
//  * digit) multiplications are performed, a0b0, a1b1 and
//  * (a1+b1)(a0+b0)
//  *
//  * Note that a multiplication of half the digits requires
//  * 1/4th the number of single precision multiplications so in
//  * total after one call 25% of the single precision multiplications
//  * are saved.  Note also that the call to mp_mul can end up back
//  * in this function if the a0, a1, b0, or b1 are above the threshold.
//  * This is known as divide-and-conquer and leads to the famous
//  * O(N**lg(3)) or O(N**1.584) work which is asymptopically lower than
//  * the standard O(N**2) that the baseline/comba methods use.
//  * Generally though the overhead of this method doesn't pay off
//  * until a certain size (N ~ 80) is reached.
//
func XTclBN_mp_karatsuba_mul(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_s_mp_karatsuba_mul.c:35:8: */
	bp := tls.Alloc(168)
	defer tls.Free(168)

	// var x0 Mp_int at bp, 24

	// var x1 Mp_int at bp+24, 24

	// var y0 Mp_int at bp+48, 24

	// var y1 Mp_int at bp+72, 24

	// var t1 Mp_int at bp+96, 24

	// var x0y0 Mp_int at bp+120, 24

	// var x1y1 Mp_int at bp+144, 24

	var B int32
	var err Mp_err
	var x int32
	var tmpa uintptr
	var tmpb uintptr
	var tmpx uintptr
	var tmpy uintptr
	err = -2 // default the return code to an error

	// min # of digits
	B = func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused < (*Mp_int)(unsafe.Pointer(b)).Fused {
			return (*Mp_int)(unsafe.Pointer(a)).Fused
		}
		return (*Mp_int)(unsafe.Pointer(b)).Fused
	}()

	// now divide in two
	B = B >> 1

	// init copy all the temps
	if !(XTclBN_mp_init_size(tls, bp, B) != MP_OKAY) {
		goto __1
	}
	goto LBL_ERR
__1:
	;
	if !(XTclBN_mp_init_size(tls, bp+24, (*Mp_int)(unsafe.Pointer(a)).Fused-B) != MP_OKAY) {
		goto __2
	}
	goto X0
__2:
	;
	if !(XTclBN_mp_init_size(tls, bp+48, B) != MP_OKAY) {
		goto __3
	}
	goto X1
__3:
	;
	if !(XTclBN_mp_init_size(tls, bp+72, (*Mp_int)(unsafe.Pointer(b)).Fused-B) != MP_OKAY) {
		goto __4
	}
	goto Y0
__4:
	;

	// init temps
	if !(XTclBN_mp_init_size(tls, bp+96, B*2) != MP_OKAY) {
		goto __5
	}
	goto Y1
__5:
	;
	if !(XTclBN_mp_init_size(tls, bp+120, B*2) != MP_OKAY) {
		goto __6
	}
	goto T1
__6:
	;
	if !(XTclBN_mp_init_size(tls, bp+144, B*2) != MP_OKAY) {
		goto __7
	}
	goto X0Y0
__7:
	;

	// now shift the digits
	(*Mp_int)(unsafe.Pointer(bp /* &x0 */)).Fused = libc.AssignPtrInt32(bp+48, B)
	(*Mp_int)(unsafe.Pointer(bp + 24 /* &x1 */)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused - B
	(*Mp_int)(unsafe.Pointer(bp + 72 /* &y1 */)).Fused = (*Mp_int)(unsafe.Pointer(b)).Fused - B

	// we copy the digits directly instead of using higher level functions
	// since we also need to shift the digits
	tmpa = (*Mp_int)(unsafe.Pointer(a)).Fdp
	tmpb = (*Mp_int)(unsafe.Pointer(b)).Fdp

	tmpx = (*Mp_int)(unsafe.Pointer(bp /* &x0 */)).Fdp
	tmpy = (*Mp_int)(unsafe.Pointer(bp + 48 /* &y0 */)).Fdp
	x = 0
__8:
	if !(x < B) {
		goto __10
	}
	*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpx, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4)))
	*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpy, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpb, 4)))
	goto __9
__9:
	x++
	goto __8
	goto __10
__10:
	;

	tmpx = (*Mp_int)(unsafe.Pointer(bp + 24 /* &x1 */)).Fdp
	x = B
__11:
	if !(x < (*Mp_int)(unsafe.Pointer(a)).Fused) {
		goto __13
	}
	*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpx, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4)))
	goto __12
__12:
	x++
	goto __11
	goto __13
__13:
	;

	tmpy = (*Mp_int)(unsafe.Pointer(bp + 72 /* &y1 */)).Fdp
	x = B
__14:
	if !(x < (*Mp_int)(unsafe.Pointer(b)).Fused) {
		goto __16
	}
	*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpy, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpb, 4)))
	goto __15
__15:
	x++
	goto __14
	goto __16
__16:
	;

	// only need to clamp the lower words since by definition the
	// upper words x1/y1 must have a known number of digits
	XTclBN_mp_clamp(tls, bp)
	XTclBN_mp_clamp(tls, bp+48)

	// now calc the products x0y0 and x1y1
	// after this x0 is no longer required, free temp [x0==t2]!
	if !(XTclBN_mp_mul(tls, bp, bp+48, bp+120) != MP_OKAY) {
		goto __17
	}
	goto X1Y1 // x0y0 = x0*y0
__17:
	;
	if !(XTclBN_mp_mul(tls, bp+24, bp+72, bp+144) != MP_OKAY) {
		goto __18
	}
	goto X1Y1 // x1y1 = x1*y1
__18:
	;

	// now calc x1+x0 and y1+y0
	if !(XTclBN_s_mp_add(tls, bp+24, bp, bp+96) != MP_OKAY) {
		goto __19
	}
	goto X1Y1 // t1 = x1 - x0
__19:
	;
	if !(XTclBN_s_mp_add(tls, bp+72, bp+48, bp) != MP_OKAY) {
		goto __20
	}
	goto X1Y1 // t2 = y1 - y0
__20:
	;
	if !(XTclBN_mp_mul(tls, bp+96, bp, bp+96) != MP_OKAY) {
		goto __21
	}
	goto X1Y1 // t1 = (x1 + x0) * (y1 + y0)
__21:
	;

	// add x0y0
	if !(XTclBN_mp_add(tls, bp+120, bp+144, bp) != MP_OKAY) {
		goto __22
	}
	goto X1Y1 // t2 = x0y0 + x1y1
__22:
	;
	if !(XTclBN_s_mp_sub(tls, bp+96, bp, bp+96) != MP_OKAY) {
		goto __23
	}
	goto X1Y1 // t1 = (x1+x0)*(y1+y0) - (x1y1 + x0y0)
__23:
	;

	// shift by B
	if !(XTclBN_mp_lshd(tls, bp+96, B) != MP_OKAY) {
		goto __24
	}
	goto X1Y1 // t1 = (x0y0 + x1y1 - (x1-x0)*(y1-y0))<<B
__24:
	;
	if !(XTclBN_mp_lshd(tls, bp+144, B*2) != MP_OKAY) {
		goto __25
	}
	goto X1Y1 // x1y1 = x1y1 << 2*B
__25:
	;

	if !(XTclBN_mp_add(tls, bp+120, bp+96, bp+96) != MP_OKAY) {
		goto __26
	}
	goto X1Y1 // t1 = x0y0 + t1
__26:
	;
	if !(XTclBN_mp_add(tls, bp+96, bp+144, c) != MP_OKAY) {
		goto __27
	}
	goto X1Y1 // t1 = x0y0 + t1 + x1y1
__27:
	;

	// Algorithm succeeded set the return code to MP_OKAY
	err = MP_OKAY

X1Y1:
	XTclBN_mp_clear(tls, bp+144)
X0Y0:
	XTclBN_mp_clear(tls, bp+120)
T1:
	XTclBN_mp_clear(tls, bp+96)
Y1:
	XTclBN_mp_clear(tls, bp+72)
Y0:
	XTclBN_mp_clear(tls, bp+48)
X1:
	XTclBN_mp_clear(tls, bp+24)
X0:
	XTclBN_mp_clear(tls, bp)
LBL_ERR:
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// Karatsuba squaring, computes b = a*a using three
// half size squarings
//
// See comments of karatsuba_mul for details.  It
// is essentially the same algorithm but merely
// tuned to perform recursive squarings.
func XTclBN_mp_karatsuba_sqr(tls *libc.TLS, a uintptr, b uintptr) Mp_err { /* bn_s_mp_karatsuba_sqr.c:13:8: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	// var x0 Mp_int at bp, 24

	// var x1 Mp_int at bp+24, 24

	// var t1 Mp_int at bp+48, 24

	// var t2 Mp_int at bp+72, 24

	// var x0x0 Mp_int at bp+96, 24

	// var x1x1 Mp_int at bp+120, 24

	var B int32
	var err Mp_err
	var x int32
	var dst uintptr
	var src uintptr
	err = -2

	// min # of digits
	B = (*Mp_int)(unsafe.Pointer(a)).Fused

	// now divide in two
	B = B >> 1

	// init copy all the temps
	if !(XTclBN_mp_init_size(tls, bp, B) != MP_OKAY) {
		goto __1
	}
	goto LBL_ERR
__1:
	;
	if !(XTclBN_mp_init_size(tls, bp+24, (*Mp_int)(unsafe.Pointer(a)).Fused-B) != MP_OKAY) {
		goto __2
	}
	goto X0
__2:
	;

	// init temps
	if !(XTclBN_mp_init_size(tls, bp+48, (*Mp_int)(unsafe.Pointer(a)).Fused*2) != MP_OKAY) {
		goto __3
	}
	goto X1
__3:
	;
	if !(XTclBN_mp_init_size(tls, bp+72, (*Mp_int)(unsafe.Pointer(a)).Fused*2) != MP_OKAY) {
		goto __4
	}
	goto T1
__4:
	;
	if !(XTclBN_mp_init_size(tls, bp+96, B*2) != MP_OKAY) {
		goto __5
	}
	goto T2
__5:
	;
	if !(XTclBN_mp_init_size(tls, bp+120, ((*Mp_int)(unsafe.Pointer(a)).Fused-B)*2) != MP_OKAY) {
		goto __6
	}
	goto X0X0
__6:
	;

	src = (*Mp_int)(unsafe.Pointer(a)).Fdp

	// now shift the digits
	dst = (*Mp_int)(unsafe.Pointer(bp /* &x0 */)).Fdp
	x = 0
__7:
	if !(x < B) {
		goto __9
	}
	*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&dst, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&src, 4)))
	goto __8
__8:
	x++
	goto __7
	goto __9
__9:
	;

	dst = (*Mp_int)(unsafe.Pointer(bp + 24 /* &x1 */)).Fdp
	x = B
__10:
	if !(x < (*Mp_int)(unsafe.Pointer(a)).Fused) {
		goto __12
	}
	*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&dst, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&src, 4)))
	goto __11
__11:
	x++
	goto __10
	goto __12
__12:
	;

	(*Mp_int)(unsafe.Pointer(bp /* &x0 */)).Fused = B
	(*Mp_int)(unsafe.Pointer(bp + 24 /* &x1 */)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused - B

	XTclBN_mp_clamp(tls, bp)

	// now calc the products x0*x0 and x1*x1
	if !(XTclBN_mp_sqr(tls, bp, bp+96) != MP_OKAY) {
		goto __13
	}
	goto X1X1
__13:
	; // x0x0 = x0*x0
	if !(XTclBN_mp_sqr(tls, bp+24, bp+120) != MP_OKAY) {
		goto __14
	}
	goto X1X1
__14:
	; // x1x1 = x1*x1

	// now calc (x1+x0)**2
	if !(XTclBN_s_mp_add(tls, bp+24, bp, bp+48) != MP_OKAY) {
		goto __15
	}
	goto X1X1
__15:
	; // t1 = x1 - x0
	if !(XTclBN_mp_sqr(tls, bp+48, bp+48) != MP_OKAY) {
		goto __16
	}
	goto X1X1
__16:
	; // t1 = (x1 - x0) * (x1 - x0)

	// add x0y0
	if !(XTclBN_s_mp_add(tls, bp+96, bp+120, bp+72) != MP_OKAY) {
		goto __17
	}
	goto X1X1
__17:
	; // t2 = x0x0 + x1x1
	if !(XTclBN_s_mp_sub(tls, bp+48, bp+72, bp+48) != MP_OKAY) {
		goto __18
	}
	goto X1X1
__18:
	; // t1 = (x1+x0)**2 - (x0x0 + x1x1)

	// shift by B
	if !(XTclBN_mp_lshd(tls, bp+48, B) != MP_OKAY) {
		goto __19
	}
	goto X1X1
__19:
	; // t1 = (x0x0 + x1x1 - (x1-x0)*(x1-x0))<<B
	if !(XTclBN_mp_lshd(tls, bp+120, B*2) != MP_OKAY) {
		goto __20
	}
	goto X1X1
__20:
	; // x1x1 = x1x1 << 2*B

	if !(XTclBN_mp_add(tls, bp+96, bp+48, bp+48) != MP_OKAY) {
		goto __21
	}
	goto X1X1
__21:
	; // t1 = x0x0 + t1
	if !(XTclBN_mp_add(tls, bp+48, bp+120, b) != MP_OKAY) {
		goto __22
	}
	goto X1X1
__22:
	; // t1 = x0x0 + t1 + x1x1

	err = MP_OKAY

X1X1:
	XTclBN_mp_clear(tls, bp+120)
X0X0:
	XTclBN_mp_clear(tls, bp+96)
T2:
	XTclBN_mp_clear(tls, bp+72)
T1:
	XTclBN_mp_clear(tls, bp+48)
X1:
	XTclBN_mp_clear(tls, bp+24)
X0:
	XTclBN_mp_clear(tls, bp)
LBL_ERR:
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// multiplies |a| * |b| and only computes upto digs digits of result
// HAC pp. 595, Algorithm 14.12  Modified so you can control how
// many digits of output are created.
func XTclBN_s_mp_mul_digs(tls *libc.TLS, a uintptr, b uintptr, c uintptr, digs int32) Mp_err { /* bn_s_mp_mul_digs.c:10:8: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var t Mp_int at bp, 24

	var err Mp_err
	var pa int32
	var pb int32
	var ix int32
	var iy int32
	var u Mp_digit
	var r Mp_word
	var tmpx Mp_digit
	var tmpt uintptr
	var tmpy uintptr

	// can we use the fast multiplier?
	if digs < int32(1)<<(uint64(8)*uint64(unsafe.Sizeof(Private_mp_word(0)))-uint64(2*MP_DIGIT_BIT)+uint64(1)) && func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused < (*Mp_int)(unsafe.Pointer(b)).Fused {
			return (*Mp_int)(unsafe.Pointer(a)).Fused
		}
		return (*Mp_int)(unsafe.Pointer(b)).Fused
	}() < int32(uint64(1)<<(uint64(8)*Size_t(unsafe.Sizeof(Mp_word(0)))-uint64(2)*uint64(MP_DIGIT_BIT))) {
		return XTclBN_fast_s_mp_mul_digs(tls, a, b, c, digs)
	}

	if libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp, digs)) != MP_OKAY {
		return err
	}
	(*Mp_int)(unsafe.Pointer(bp /* &t */)).Fused = digs

	// compute the digits of the product directly
	pa = (*Mp_int)(unsafe.Pointer(a)).Fused
	for ix = 0; ix < pa; ix++ {
		// set the carry to zero
		u = Mp_digit(0)

		// limit ourselves to making digs digits of output
		pb = func() int32 {
			if (*Mp_int)(unsafe.Pointer(b)).Fused < digs-ix {
				return (*Mp_int)(unsafe.Pointer(b)).Fused
			}
			return digs - ix
		}()

		// setup some aliases
		// copy of the digit from a used within the nested loop
		tmpx = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(ix)*4))

		// an alias for the destination shifted ix places
		tmpt = (*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(ix)*4

		// an alias for the digits of b
		tmpy = (*Mp_int)(unsafe.Pointer(b)).Fdp

		// compute the columns of the output and propagate the carry
		for iy = 0; iy < pb; iy++ {
			// compute the column as a mp_word
			r = Mp_word(*(*Mp_digit)(unsafe.Pointer(tmpt))) + Mp_word(tmpx)*Mp_word(*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpy, 4)))) + Mp_word(u)

			// the new column is the lower part of the result
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpt, 4))) = Mp_digit(r & uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1)))

			// get the carry word from the result
			u = Mp_digit(r >> uint64(MP_DIGIT_BIT))
		}
		// set carry if it is placed below digs
		if ix+iy < digs {
			*(*Mp_digit)(unsafe.Pointer(tmpt)) = u
		}
	}

	XTclBN_mp_clamp(tls, bp)
	XTclBN_mp_exch(tls, bp, c)

	XTclBN_mp_clear(tls, bp)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// Fast (comba) multiplier
//
// This is the fast column-array [comba] multiplier.  It is
// designed to compute the columns of the product first
// then handle the carries afterwards.  This has the effect
// of making the nested loops that compute the columns very
// simple and schedulable on super-scalar processors.
//
// This has been modified to produce a variable number of
// digits of output so if say only a half-product is required
// you don't have to compute the upper half (a feature
// required for fast Barrett reduction).
//
// Based on Algorithm 14.12 on pp.595 of HAC.
//
func XTclBN_fast_s_mp_mul_digs(tls *libc.TLS, a uintptr, b uintptr, c uintptr, digs int32) Mp_err { /* bn_s_mp_mul_digs_fast.c:22:8: */
	bp := tls.Alloc(2048)
	defer tls.Free(2048)

	var olduse int32
	var pa int32
	var ix int32
	var iz int32
	var err Mp_err
	// var W [512]Mp_digit at bp, 2048

	var _W Mp_word

	// grow the destination as required
	if (*Mp_int)(unsafe.Pointer(c)).Falloc < digs {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, c, digs)) != MP_OKAY {
			return err
		}
	}

	// number of output digits to produce
	pa = func() int32 {
		if digs < (*Mp_int)(unsafe.Pointer(a)).Fused+(*Mp_int)(unsafe.Pointer(b)).Fused {
			return digs
		}
		return (*Mp_int)(unsafe.Pointer(a)).Fused + (*Mp_int)(unsafe.Pointer(b)).Fused
	}()

	// clear the carry
	_W = uint64(0)
	for ix = 0; ix < pa; ix++ {
		var tx int32
		var ty int32
		var iy int32
		var tmpx uintptr
		var tmpy uintptr

		// get offsets into the two bignums
		ty = func() int32 {
			if (*Mp_int)(unsafe.Pointer(b)).Fused-1 < ix {
				return (*Mp_int)(unsafe.Pointer(b)).Fused - 1
			}
			return ix
		}()
		tx = ix - ty

		// setup temp aliases
		tmpx = (*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(tx)*4
		tmpy = (*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(ty)*4

		// this is the number of times the loop will iterrate, essentially
		//          while (tx++ < a->used && ty-- >= 0) { ... }
		//
		iy = func() int32 {
			if (*Mp_int)(unsafe.Pointer(a)).Fused-tx < ty+1 {
				return (*Mp_int)(unsafe.Pointer(a)).Fused - tx
			}
			return ty + 1
		}()

		// execute loop
		for iz = 0; iz < iy; iz++ {
			_W = _W + Mp_word(*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpx, 4))))*Mp_word(*(*Mp_digit)(unsafe.Pointer(libc.PostDecUintptr(&tmpy, 4))))

		}

		// store term
		*(*Mp_digit)(unsafe.Pointer(bp + uintptr(ix)*4)) = Mp_digit(_W) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))

		// make next carry
		_W = _W >> uint64(MP_DIGIT_BIT)
	}

	// setup dest
	olduse = (*Mp_int)(unsafe.Pointer(c)).Fused
	(*Mp_int)(unsafe.Pointer(c)).Fused = pa

	{
		var tmpc uintptr
		tmpc = (*Mp_int)(unsafe.Pointer(c)).Fdp
		for ix = 0; ix < pa; ix++ {
			// now extract the previous digit [below the carry]
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = *(*Mp_digit)(unsafe.Pointer(bp + uintptr(ix)*4))
		}

		// clear unused digits [that existed in the old copy of c]
		for ok := true; ok; ok = 0 != 0 {
			var zd_ int32 = olduse - ix
			var zm_ uintptr = tmpc
			for libc.PostDecInt32(&zd_, 1) > 0 {
				*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
			}
		}

	}
	XTclBN_mp_clamp(tls, c)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// reverse an array, used for radix code
func XTclBN_s_mp_reverse(tls *libc.TLS, s uintptr, len Size_t) { /* bn_s_mp_reverse.c:7:6: */
	var ix Size_t
	var iy Size_t
	var t uint8

	ix = uint64(0)
	iy = len - uint64(1)
	for ix < iy {
		t = *(*uint8)(unsafe.Pointer(s + uintptr(ix)))
		*(*uint8)(unsafe.Pointer(s + uintptr(ix))) = *(*uint8)(unsafe.Pointer(s + uintptr(iy)))
		*(*uint8)(unsafe.Pointer(s + uintptr(iy))) = t
		ix++
		iy--
	}
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16
func XTclBN_s_mp_sqr(tls *libc.TLS, a uintptr, b uintptr) Mp_err { /* bn_s_mp_sqr.c:7:8: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var t Mp_int at bp, 24

	var ix int32
	var iy int32
	var pa int32
	var err Mp_err
	var r Mp_word
	var u Mp_digit
	var tmpx Mp_digit
	var tmpt uintptr

	pa = (*Mp_int)(unsafe.Pointer(a)).Fused
	if libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp, 2*pa+1)) != MP_OKAY {
		return err
	}

	// default used is maximum possible size
	(*Mp_int)(unsafe.Pointer(bp /* &t */)).Fused = 2*pa + 1

	for ix = 0; ix < pa; ix++ {
		// first calculate the digit at 2*ix
		// calculate double precision result
		r = Mp_word(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(2*ix)*4))) + Mp_word(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(ix)*4)))*Mp_word(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(ix)*4)))

		// store lower part in result
		*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp /* &t */)).Fdp + uintptr(ix+ix)*4)) = Mp_digit(r & uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1)))

		// get the carry
		u = Mp_digit(r >> uint64(MP_DIGIT_BIT))

		// left hand side of A[ix] * A[iy]
		tmpx = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(ix)*4))

		// alias for where to store the results
		tmpt = (*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(2*ix+1)*4

		for iy = ix + 1; iy < pa; iy++ {
			// first calculate the product
			r = Mp_word(tmpx) * Mp_word(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(iy)*4)))

			// now calculate the double precision result, note we use
			// addition instead of *2 since it's easier to optimize
			r = Mp_word(*(*Mp_digit)(unsafe.Pointer(tmpt))) + r + r + Mp_word(u)

			// store lower part
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpt, 4))) = Mp_digit(r & uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1)))

			// get carry
			u = Mp_digit(r >> uint64(MP_DIGIT_BIT))
		}
		// propagate upwards
		for uint64(u) != 0 {
			r = Mp_word(*(*Mp_digit)(unsafe.Pointer(tmpt))) + Mp_word(u)
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpt, 4))) = Mp_digit(r & uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1)))
			u = Mp_digit(r >> uint64(MP_DIGIT_BIT))
		}
	}

	XTclBN_mp_clamp(tls, bp)
	XTclBN_mp_exch(tls, bp, b)
	XTclBN_mp_clear(tls, bp)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// the jist of squaring...
//  you do like mult except the offset of the tmpx [one that
//  starts closer to zero] can't equal the offset of tmpy.
//  So basically you set up iy like before then you min it with
//  (ty-tx) so that it never happens.  You double all those
//  you add in the inner loop
//
// After that loop you do the squares and add them in.

func XTclBN_fast_s_mp_sqr(tls *libc.TLS, a uintptr, b uintptr) Mp_err { /* bn_s_mp_sqr_fast.c:16:8: */
	bp := tls.Alloc(2048)
	defer tls.Free(2048)

	var olduse int32
	var pa int32
	var ix int32
	var iz int32
	// var W [512]Mp_digit at bp, 2048

	var tmpx uintptr
	var W1 Mp_word
	var err Mp_err

	// grow the destination as required
	pa = (*Mp_int)(unsafe.Pointer(a)).Fused + (*Mp_int)(unsafe.Pointer(a)).Fused
	if (*Mp_int)(unsafe.Pointer(b)).Falloc < pa {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, b, pa)) != MP_OKAY {
			return err
		}
	}

	// number of output digits to produce
	W1 = uint64(0)
	for ix = 0; ix < pa; ix++ {
		var tx int32
		var ty int32
		var iy int32
		var _W Mp_word
		var tmpy uintptr

		// clear counter
		_W = uint64(0)

		// get offsets into the two bignums
		ty = func() int32 {
			if (*Mp_int)(unsafe.Pointer(a)).Fused-1 < ix {
				return (*Mp_int)(unsafe.Pointer(a)).Fused - 1
			}
			return ix
		}()
		tx = ix - ty

		// setup temp aliases
		tmpx = (*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(tx)*4
		tmpy = (*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(ty)*4

		// this is the number of times the loop will iterrate, essentially
		//          while (tx++ < a->used && ty-- >= 0) { ... }
		//
		iy = func() int32 {
			if (*Mp_int)(unsafe.Pointer(a)).Fused-tx < ty+1 {
				return (*Mp_int)(unsafe.Pointer(a)).Fused - tx
			}
			return ty + 1
		}()

		// now for squaring tx can never equal ty
		// we halve the distance since they approach at a rate of 2x
		// and we have to round because odd cases need to be executed
		iy = func() int32 {
			if iy < (ty-tx+1)>>1 {
				return iy
			}
			return (ty - tx + 1) >> 1
		}()

		// execute loop
		for iz = 0; iz < iy; iz++ {
			_W = _W + Mp_word(*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpx, 4))))*Mp_word(*(*Mp_digit)(unsafe.Pointer(libc.PostDecUintptr(&tmpy, 4))))
		}

		// double the inner product and add carry
		_W = _W + _W + W1

		// even columns have the square term in them
		if uint32(ix)&1 == 0 {
			_W = _W + Mp_word(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(ix>>1)*4)))*Mp_word(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(ix>>1)*4)))
		}

		// store it
		*(*Mp_digit)(unsafe.Pointer(bp + uintptr(ix)*4)) = Mp_digit(_W) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))

		// make next carry
		W1 = _W >> uint64(MP_DIGIT_BIT)
	}

	// setup dest
	olduse = (*Mp_int)(unsafe.Pointer(b)).Fused
	(*Mp_int)(unsafe.Pointer(b)).Fused = (*Mp_int)(unsafe.Pointer(a)).Fused + (*Mp_int)(unsafe.Pointer(a)).Fused

	{
		var tmpb uintptr
		tmpb = (*Mp_int)(unsafe.Pointer(b)).Fdp
		for ix = 0; ix < pa; ix++ {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpb, 4))) = *(*Mp_digit)(unsafe.Pointer(bp + uintptr(ix)*4)) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
		}

		// clear unused digits [that existed in the old copy of c]
		for ok := true; ok; ok = 0 != 0 {
			var zd_ int32 = olduse - ix
			var zm_ uintptr = tmpb
			for libc.PostDecInt32(&zd_, 1) > 0 {
				*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
			}
		}

	}
	XTclBN_mp_clamp(tls, b)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9
func XTclBN_s_mp_sub(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_s_mp_sub.c:7:8: */
	var olduse int32
	var min int32
	var max int32
	var err Mp_err

	// find sizes
	min = (*Mp_int)(unsafe.Pointer(b)).Fused
	max = (*Mp_int)(unsafe.Pointer(a)).Fused

	// init result
	if (*Mp_int)(unsafe.Pointer(c)).Falloc < max {
		if libc.AssignInt32(&err, XTclBN_mp_grow(tls, c, max)) != MP_OKAY {
			return err
		}
	}
	olduse = (*Mp_int)(unsafe.Pointer(c)).Fused
	(*Mp_int)(unsafe.Pointer(c)).Fused = max

	{
		var u Mp_digit
		var tmpa uintptr
		var tmpb uintptr
		var tmpc uintptr
		var i int32

		// alias for digit pointers
		tmpa = (*Mp_int)(unsafe.Pointer(a)).Fdp
		tmpb = (*Mp_int)(unsafe.Pointer(b)).Fdp
		tmpc = (*Mp_int)(unsafe.Pointer(c)).Fdp

		// set carry to zero
		u = Mp_digit(0)
		for i = 0; i < min; i++ {
			// T[i] = A[i] - B[i] - U
			*(*Mp_digit)(unsafe.Pointer(tmpc)) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4))) - *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpb, 4))) - u

			// U = carry bit of T[i]
			// Note this saves performing an AND operation since
			// if a carry does occur it will propagate all the way to the
			// MSB.  As a result a single shift is enough to get the carry
			u = *(*Mp_digit)(unsafe.Pointer(tmpc)) >> (uint64(8)*Size_t(unsafe.Sizeof(Mp_digit(0))) - uint64(1))

			// Clear carry from T[i]
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) &= Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
		}

		// now copy higher words if any, e.g. if A has more digits than B
		for ; i < max; i++ {
			// T[i] = A[i] - U
			*(*Mp_digit)(unsafe.Pointer(tmpc)) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4))) - u

			// U = carry bit of T[i]
			u = *(*Mp_digit)(unsafe.Pointer(tmpc)) >> (uint64(8)*Size_t(unsafe.Sizeof(Mp_digit(0))) - uint64(1))

			// Clear carry from T[i]
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) &= Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1)
		}

		// clear digits above used (since we may not have grown result above)
		for ok := true; ok; ok = 0 != 0 {
			var zd_ int32 = olduse - (*Mp_int)(unsafe.Pointer(c)).Fused
			var zm_ uintptr = tmpc
			for libc.PostDecInt32(&zd_, 1) > 0 {
				*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
			}
		}

	}

	XTclBN_mp_clamp(tls, c)
	return MP_OKAY
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// multiplication using the Toom-Cook 3-way algorithm
//
// Much more complicated than Karatsuba but has a lower
// asymptotic running time of O(N**1.464).  This algorithm is
// only particularly useful on VERY large inputs
// (we're talking 1000s of digits here...).

//
//    This file contains code from J. Arndt's book  "Matters Computational"
//    and the accompanying FXT-library with permission of the author.

//
//    Setup from
//
//      Chung, Jaewook, and M. Anwar Hasan. "Asymmetric squaring formulae."
//      18th IEEE Symposium on Computer Arithmetic (ARITH'07). IEEE, 2007.
//
//    The interpolation from above needed one temporary variable more
//    than the interpolation here:
//
//      Bodrato, Marco, and Alberto Zanoni. "What about Toom-Cook matrices optimality."
//      Centro Vito Volterra Universita di Roma Tor Vergata (2006)

func XTclBN_mp_toom_mul(tls *libc.TLS, a uintptr, b uintptr, c uintptr) Mp_err { /* bn_s_mp_toom_mul.c:32:8: */
	bp := tls.Alloc(264)
	defer tls.Free(264)

	// var S1 Mp_int at bp+48, 24

	// var S2 Mp_int at bp+72, 24

	// var T1 Mp_int at bp+96, 24

	// var a0 Mp_int at bp+120, 24

	// var a1 Mp_int at bp+144, 24

	// var a2 Mp_int at bp+168, 24

	// var b0 Mp_int at bp+192, 24

	// var b1 Mp_int at bp+216, 24

	// var b2 Mp_int at bp+240, 24

	var B int32
	var count int32
	var err Mp_err

	// init temps
	if !(libc.AssignInt32(&err, XTclBN_mp_init_multi(tls, bp+48, libc.VaList(bp, bp+72, bp+96, uintptr(0)))) != MP_OKAY) {
		goto __1
	}
	return err
__1:
	;

	// B
	B = func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fused < (*Mp_int)(unsafe.Pointer(b)).Fused {
			return (*Mp_int)(unsafe.Pointer(a)).Fused
		}
		return (*Mp_int)(unsafe.Pointer(b)).Fused
	}() / 3

	//* a = a2 * x^2 + a1 * x + a0;
	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp+120, B)) != MP_OKAY) {
		goto __2
	}
	goto LBL_ERRa0
__2:
	;

	count = 0
__3:
	if !(count < B) {
		goto __5
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+120 /* &a0 */)).Fdp + uintptr(count)*4)) = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(count)*4))
	(*Mp_int)(unsafe.Pointer(bp+120 /* &a0 */)).Fused++
	goto __4
__4:
	count++
	goto __3
	goto __5
__5:
	;
	XTclBN_mp_clamp(tls, bp+120)
	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp+144, B)) != MP_OKAY) {
		goto __6
	}
	goto LBL_ERRa1
__6:
	;
__7:
	if !(count < 2*B) {
		goto __9
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+144 /* &a1 */)).Fdp + uintptr(count-B)*4)) = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(count)*4))
	(*Mp_int)(unsafe.Pointer(bp+144 /* &a1 */)).Fused++
	goto __8
__8:
	count++
	goto __7
	goto __9
__9:
	;
	XTclBN_mp_clamp(tls, bp+144)
	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp+168, B+((*Mp_int)(unsafe.Pointer(a)).Fused-3*B))) != MP_OKAY) {
		goto __10
	}
	goto LBL_ERRa2
__10:
	;
__11:
	if !(count < (*Mp_int)(unsafe.Pointer(a)).Fused) {
		goto __13
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+168 /* &a2 */)).Fdp + uintptr(count-2*B)*4)) = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(count)*4))
	(*Mp_int)(unsafe.Pointer(bp+168 /* &a2 */)).Fused++
	goto __12
__12:
	count++
	goto __11
	goto __13
__13:
	;
	XTclBN_mp_clamp(tls, bp+168)

	//* b = b2 * x^2 + b1 * x + b0;
	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp+192, B)) != MP_OKAY) {
		goto __14
	}
	goto LBL_ERRb0
__14:
	;
	count = 0
__15:
	if !(count < B) {
		goto __17
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+192 /* &b0 */)).Fdp + uintptr(count)*4)) = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(count)*4))
	(*Mp_int)(unsafe.Pointer(bp+192 /* &b0 */)).Fused++
	goto __16
__16:
	count++
	goto __15
	goto __17
__17:
	;
	XTclBN_mp_clamp(tls, bp+192)
	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp+216, B)) != MP_OKAY) {
		goto __18
	}
	goto LBL_ERRb1
__18:
	;
__19:
	if !(count < 2*B) {
		goto __21
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+216 /* &b1 */)).Fdp + uintptr(count-B)*4)) = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(count)*4))
	(*Mp_int)(unsafe.Pointer(bp+216 /* &b1 */)).Fused++
	goto __20
__20:
	count++
	goto __19
	goto __21
__21:
	;
	XTclBN_mp_clamp(tls, bp+216)
	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp+240, B+((*Mp_int)(unsafe.Pointer(b)).Fused-3*B))) != MP_OKAY) {
		goto __22
	}
	goto LBL_ERRb2
__22:
	;
__23:
	if !(count < (*Mp_int)(unsafe.Pointer(b)).Fused) {
		goto __25
	}
	*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+240 /* &b2 */)).Fdp + uintptr(count-2*B)*4)) = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(count)*4))
	(*Mp_int)(unsafe.Pointer(bp+240 /* &b2 */)).Fused++
	goto __24
__24:
	count++
	goto __23
	goto __25
__25:
	;
	XTclBN_mp_clamp(tls, bp+240)

	//* \\ S1 = (a2+a1+a0) * (b2+b1+b0);
	//* T1 = a2 + a1;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+168, bp+144, bp+96)) != MP_OKAY) {
		goto __26
	}
	goto LBL_ERR
__26:
	;

	//* S2 = T1 + a0;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+96, bp+120, bp+72)) != MP_OKAY) {
		goto __27
	}
	goto LBL_ERR
__27:
	;

	//* c = b2 + b1;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+240, bp+216, c)) != MP_OKAY) {
		goto __28
	}
	goto LBL_ERR
__28:
	;

	//* S1 = c + b0;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, c, bp+192, bp+48)) != MP_OKAY) {
		goto __29
	}
	goto LBL_ERR
__29:
	;

	//* S1 = S1 * S2;
	if !(libc.AssignInt32(&err, XTclBN_mp_mul(tls, bp+48, bp+72, bp+48)) != MP_OKAY) {
		goto __30
	}
	goto LBL_ERR
__30:
	;

	//* \\S2 = (4*a2+2*a1+a0) * (4*b2+2*b1+b0);
	//* T1 = T1 + a2;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+96, bp+168, bp+96)) != MP_OKAY) {
		goto __31
	}
	goto LBL_ERR
__31:
	;

	//* T1 = T1 << 1;
	if !(libc.AssignInt32(&err, XTclBN_mp_mul_2(tls, bp+96, bp+96)) != MP_OKAY) {
		goto __32
	}
	goto LBL_ERR
__32:
	;

	//* T1 = T1 + a0;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+96, bp+120, bp+96)) != MP_OKAY) {
		goto __33
	}
	goto LBL_ERR
__33:
	;

	//* c = c + b2;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, c, bp+240, c)) != MP_OKAY) {
		goto __34
	}
	goto LBL_ERR
__34:
	;

	//* c = c << 1;
	if !(libc.AssignInt32(&err, XTclBN_mp_mul_2(tls, c, c)) != MP_OKAY) {
		goto __35
	}
	goto LBL_ERR
__35:
	;

	//* c = c + b0;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, c, bp+192, c)) != MP_OKAY) {
		goto __36
	}
	goto LBL_ERR
__36:
	;

	//* S2 = T1 * c;
	if !(libc.AssignInt32(&err, XTclBN_mp_mul(tls, bp+96, c, bp+72)) != MP_OKAY) {
		goto __37
	}
	goto LBL_ERR
__37:
	;

	//* \\S3 = (a2-a1+a0) * (b2-b1+b0);
	//* a1 = a2 - a1;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+168, bp+144, bp+144)) != MP_OKAY) {
		goto __38
	}
	goto LBL_ERR
__38:
	;

	//* a1 = a1 + a0;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+144, bp+120, bp+144)) != MP_OKAY) {
		goto __39
	}
	goto LBL_ERR
__39:
	;

	//* b1 = b2 - b1;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+240, bp+216, bp+216)) != MP_OKAY) {
		goto __40
	}
	goto LBL_ERR
__40:
	;

	//* b1 = b1 + b0;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+216, bp+192, bp+216)) != MP_OKAY) {
		goto __41
	}
	goto LBL_ERR
__41:
	;

	//* a1 = a1 * b1;
	if !(libc.AssignInt32(&err, XTclBN_mp_mul(tls, bp+144, bp+216, bp+144)) != MP_OKAY) {
		goto __42
	}
	goto LBL_ERR
__42:
	;

	//* b1 = a2 * b2;
	if !(libc.AssignInt32(&err, XTclBN_mp_mul(tls, bp+168, bp+240, bp+216)) != MP_OKAY) {
		goto __43
	}
	goto LBL_ERR
__43:
	;

	//* \\S2 = (S2 - S3)/3;
	//* S2 = S2 - a1;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+72, bp+144, bp+72)) != MP_OKAY) {
		goto __44
	}
	goto LBL_ERR
__44:
	;

	//* S2 = S2 / 3; \\ this is an exact division
	if !(libc.AssignInt32(&err, XTclBN_mp_div_3(tls, bp+72, bp+72, uintptr(0))) != MP_OKAY) {
		goto __45
	}
	goto LBL_ERR
__45:
	;

	//* a1 = S1 - a1;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+48, bp+144, bp+144)) != MP_OKAY) {
		goto __46
	}
	goto LBL_ERR
__46:
	;

	//* a1 = a1 >> 1;
	if !(libc.AssignInt32(&err, XTclBN_mp_div_2(tls, bp+144, bp+144)) != MP_OKAY) {
		goto __47
	}
	goto LBL_ERR
__47:
	;

	//* a0 = a0 * b0;
	if !(libc.AssignInt32(&err, XTclBN_mp_mul(tls, bp+120, bp+192, bp+120)) != MP_OKAY) {
		goto __48
	}
	goto LBL_ERR
__48:
	;

	//* S1 = S1 - a0;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+48, bp+120, bp+48)) != MP_OKAY) {
		goto __49
	}
	goto LBL_ERR
__49:
	;

	//* S2 = S2 - S1;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+72, bp+48, bp+72)) != MP_OKAY) {
		goto __50
	}
	goto LBL_ERR
__50:
	;

	//* S2 = S2 >> 1;
	if !(libc.AssignInt32(&err, XTclBN_mp_div_2(tls, bp+72, bp+72)) != MP_OKAY) {
		goto __51
	}
	goto LBL_ERR
__51:
	;

	//* S1 = S1 - a1;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+48, bp+144, bp+48)) != MP_OKAY) {
		goto __52
	}
	goto LBL_ERR
__52:
	;

	//* S1 = S1 - b1;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+48, bp+216, bp+48)) != MP_OKAY) {
		goto __53
	}
	goto LBL_ERR
__53:
	;

	//* T1 = b1 << 1;
	if !(libc.AssignInt32(&err, XTclBN_mp_mul_2(tls, bp+216, bp+96)) != MP_OKAY) {
		goto __54
	}
	goto LBL_ERR
__54:
	;

	//* S2 = S2 - T1;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+72, bp+96, bp+72)) != MP_OKAY) {
		goto __55
	}
	goto LBL_ERR
__55:
	;

	//* a1 = a1 - S2;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+144, bp+72, bp+144)) != MP_OKAY) {
		goto __56
	}
	goto LBL_ERR
__56:
	;

	//* P = b1*x^4+ S2*x^3+ S1*x^2+ a1*x + a0;
	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+216, 4*B)) != MP_OKAY) {
		goto __57
	}
	goto LBL_ERR
__57:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+72, 3*B)) != MP_OKAY) {
		goto __58
	}
	goto LBL_ERR
__58:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+216, bp+72, bp+216)) != MP_OKAY) {
		goto __59
	}
	goto LBL_ERR
__59:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+48, 2*B)) != MP_OKAY) {
		goto __60
	}
	goto LBL_ERR
__60:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+216, bp+48, bp+216)) != MP_OKAY) {
		goto __61
	}
	goto LBL_ERR
__61:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+144, 1*B)) != MP_OKAY) {
		goto __62
	}
	goto LBL_ERR
__62:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+216, bp+144, bp+216)) != MP_OKAY) {
		goto __63
	}
	goto LBL_ERR
__63:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+216, bp+120, c)) != MP_OKAY) {
		goto __64
	}
	goto LBL_ERR
__64:
	;

	//* a * b - P

LBL_ERR:
	XTclBN_mp_clear(tls, bp+240)
LBL_ERRb2:
	XTclBN_mp_clear(tls, bp+216)
LBL_ERRb1:
	XTclBN_mp_clear(tls, bp+192)
LBL_ERRb0:
	XTclBN_mp_clear(tls, bp+168)
LBL_ERRa2:
	XTclBN_mp_clear(tls, bp+144)
LBL_ERRa1:
	XTclBN_mp_clear(tls, bp+120)
LBL_ERRa0:
	XTclBN_mp_clear_multi(tls, bp+48, libc.VaList(bp+24, bp+72, bp+96, uintptr(0)))
	return err
}

// deprecated functions

// code-generating macros

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// squaring using Toom-Cook 3-way algorithm

//
//    This file contains code from J. Arndt's book  "Matters Computational"
//    and the accompanying FXT-library with permission of the author.

// squaring using Toom-Cook 3-way algorithm
//
//    Setup and interpolation from algorithm SQR_3 in
//
//      Chung, Jaewook, and M. Anwar Hasan. "Asymmetric squaring formulae."
//      18th IEEE Symposium on Computer Arithmetic (ARITH'07). IEEE, 2007.
//
func XTclBN_mp_toom_sqr(tls *libc.TLS, a uintptr, b uintptr) Mp_err { /* bn_s_mp_toom_sqr.c:21:8: */
	bp := tls.Alloc(96)
	defer tls.Free(96)

	// var S0 Mp_int at bp, 24

	// var a0 Mp_int at bp+24, 24

	// var a1 Mp_int at bp+48, 24

	// var a2 Mp_int at bp+72, 24

	var tmpa uintptr
	var tmpc uintptr
	var B int32
	var count int32
	var err Mp_err

	// init temps
	if !(libc.AssignInt32(&err, XTclBN_mp_init(tls, bp)) != MP_OKAY) {
		goto __1
	}
	return err
__1:
	;

	// B
	B = (*Mp_int)(unsafe.Pointer(a)).Fused / 3

	//* a = a2 * x^2 + a1 * x + a0;
	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp+24, B)) != MP_OKAY) {
		goto __2
	}
	goto LBL_ERRa0
__2:
	;

	(*Mp_int)(unsafe.Pointer(bp + 24 /* &a0 */)).Fused = B
	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp+48, B)) != MP_OKAY) {
		goto __3
	}
	goto LBL_ERRa1
__3:
	;
	(*Mp_int)(unsafe.Pointer(bp + 48 /* &a1 */)).Fused = B
	if !(libc.AssignInt32(&err, XTclBN_mp_init_size(tls, bp+72, B+((*Mp_int)(unsafe.Pointer(a)).Fused-3*B))) != MP_OKAY) {
		goto __4
	}
	goto LBL_ERRa2
__4:
	;

	tmpa = (*Mp_int)(unsafe.Pointer(a)).Fdp
	tmpc = (*Mp_int)(unsafe.Pointer(bp + 24 /* &a0 */)).Fdp
	count = 0
__5:
	if !(count < B) {
		goto __7
	}
	*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4)))
	goto __6
__6:
	count++
	goto __5
	goto __7
__7:
	;
	tmpc = (*Mp_int)(unsafe.Pointer(bp + 48 /* &a1 */)).Fdp
__8:
	if !(count < 2*B) {
		goto __10
	}
	*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4)))
	goto __9
__9:
	count++
	goto __8
	goto __10
__10:
	;
	tmpc = (*Mp_int)(unsafe.Pointer(bp + 72 /* &a2 */)).Fdp
__11:
	if !(count < (*Mp_int)(unsafe.Pointer(a)).Fused) {
		goto __13
	}
	*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpc, 4))) = *(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&tmpa, 4)))
	(*Mp_int)(unsafe.Pointer(bp+72 /* &a2 */)).Fused++
	goto __12
__12:
	count++
	goto __11
	goto __13
__13:
	;
	XTclBN_mp_clamp(tls, bp+24)
	XTclBN_mp_clamp(tls, bp+48)
	XTclBN_mp_clamp(tls, bp+72)

	//* S0 = a0^2;
	if !(libc.AssignInt32(&err, XTclBN_mp_sqr(tls, bp+24, bp)) != MP_OKAY) {
		goto __14
	}
	goto LBL_ERR
__14:
	;

	//* \\S1 = (a2 + a1 + a0)^2
	//* \\S2 = (a2 - a1 + a0)^2
	//* \\S1 = a0 + a2;
	//* a0 = a0 + a2;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+24, bp+72, bp+24)) != MP_OKAY) {
		goto __15
	}
	goto LBL_ERR
__15:
	;
	//* \\S2 = S1 - a1;
	//* b = a0 - a1;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+24, bp+48, b)) != MP_OKAY) {
		goto __16
	}
	goto LBL_ERR
__16:
	;
	//* \\S1 = S1 + a1;
	//* a0 = a0 + a1;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+24, bp+48, bp+24)) != MP_OKAY) {
		goto __17
	}
	goto LBL_ERR
__17:
	;
	//* \\S1 = S1^2;
	//* a0 = a0^2;
	if !(libc.AssignInt32(&err, XTclBN_mp_sqr(tls, bp+24, bp+24)) != MP_OKAY) {
		goto __18
	}
	goto LBL_ERR
__18:
	;
	//* \\S2 = S2^2;
	//* b = b^2;
	if !(libc.AssignInt32(&err, XTclBN_mp_sqr(tls, b, b)) != MP_OKAY) {
		goto __19
	}
	goto LBL_ERR
__19:
	;

	//* \\ S3 = 2 * a1 * a2
	//* \\S3 = a1 * a2;
	//* a1 = a1 * a2;
	if !(libc.AssignInt32(&err, XTclBN_mp_mul(tls, bp+48, bp+72, bp+48)) != MP_OKAY) {
		goto __20
	}
	goto LBL_ERR
__20:
	;
	//* \\S3 = S3 << 1;
	//* a1 = a1 << 1;
	if !(libc.AssignInt32(&err, XTclBN_mp_mul_2(tls, bp+48, bp+48)) != MP_OKAY) {
		goto __21
	}
	goto LBL_ERR
__21:
	;

	//* \\S4 = a2^2;
	//* a2 = a2^2;
	if !(libc.AssignInt32(&err, XTclBN_mp_sqr(tls, bp+72, bp+72)) != MP_OKAY) {
		goto __22
	}
	goto LBL_ERR
__22:
	;

	//* \\ tmp = (S1 + S2)/2
	//* \\tmp = S1 + S2;
	//* b = a0 + b;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+24, b, b)) != MP_OKAY) {
		goto __23
	}
	goto LBL_ERR
__23:
	;
	//* \\tmp = tmp >> 1;
	//* b = b >> 1;
	if !(libc.AssignInt32(&err, XTclBN_mp_div_2(tls, b, b)) != MP_OKAY) {
		goto __24
	}
	goto LBL_ERR
__24:
	;

	//* \\ S1 = S1 - tmp - S3
	//* \\S1 = S1 - tmp;
	//* a0 = a0 - b;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+24, b, bp+24)) != MP_OKAY) {
		goto __25
	}
	goto LBL_ERR
__25:
	;
	//* \\S1 = S1 - S3;
	//* a0 = a0 - a1;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, bp+24, bp+48, bp+24)) != MP_OKAY) {
		goto __26
	}
	goto LBL_ERR
__26:
	;

	//* \\S2 = tmp - S4 -S0
	//* \\S2 = tmp - S4;
	//* b = b - a2;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, b, bp+72, b)) != MP_OKAY) {
		goto __27
	}
	goto LBL_ERR
__27:
	;
	//* \\S2 = S2 - S0;
	//* b = b - S0;
	if !(libc.AssignInt32(&err, XTclBN_mp_sub(tls, b, bp, b)) != MP_OKAY) {
		goto __28
	}
	goto LBL_ERR
__28:
	;

	//* \\P = S4*x^4 + S3*x^3 + S2*x^2 + S1*x + S0;
	//* P = a2*x^4 + a1*x^3 + b*x^2 + a0*x + S0;

	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+72, 4*B)) != MP_OKAY) {
		goto __29
	}
	goto LBL_ERR
__29:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+48, 3*B)) != MP_OKAY) {
		goto __30
	}
	goto LBL_ERR
__30:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, b, 2*B)) != MP_OKAY) {
		goto __31
	}
	goto LBL_ERR
__31:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_lshd(tls, bp+24, 1*B)) != MP_OKAY) {
		goto __32
	}
	goto LBL_ERR
__32:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+72, bp+48, bp+72)) != MP_OKAY) {
		goto __33
	}
	goto LBL_ERR
__33:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, bp+72, b, b)) != MP_OKAY) {
		goto __34
	}
	goto LBL_ERR
__34:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, b, bp+24, b)) != MP_OKAY) {
		goto __35
	}
	goto LBL_ERR
__35:
	;
	if !(libc.AssignInt32(&err, XTclBN_mp_add(tls, b, bp, b)) != MP_OKAY) {
		goto __36
	}
	goto LBL_ERR
__36:
	;
	//* a^2 - P

LBL_ERR:
	XTclBN_mp_clear(tls, bp+72)
LBL_ERRa2:
	XTclBN_mp_clear(tls, bp+48)
LBL_ERRa1:
	XTclBN_mp_clear(tls, bp+24)
LBL_ERRa0:
	XTclBN_mp_clear(tls, bp)

	return err
}

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// regular expressions
//
// Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.
//
// Development of this software was funded, in part, by Cray Research Inc.,
// UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
// Corporation, none of whom are responsible for the results. The author
// thanks all of them.
//
// Redistribution and use in source and binary forms -- with or without
// modification -- are permitted for any purpose, provided that
// redistributions in source form retain this entire copyright notice and
// indicate the origin and nature of any modifications.
//
// I'd appreciate being given credit for this package in the documentation of
// software which uses it, but that is not a requirement.
//
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
// HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//
// Prototypes etc. marked with "^" within comments get gathered up (and
// possibly edited) by the regfwd program and inserted near the bottom of this
// file.
//
// We offer the option of declaring one wide-character version of the RE
// functions as well as the char versions. To do that, define __REG_WIDE_T to
// the type of wide characters (unfortunately, there is no consensus that
// wchar_t is suitable) and __REG_WIDE_COMPILE and __REG_WIDE_EXEC to the
// names to be used for the compile and execute functions (suggestion:
// re_Xcomp and re_Xexec, where X is a letter suggestive of the wide type,
// e.g. re_ucomp and re_uexec for Unicode). For cranky old compilers, it may
// be necessary to do something like:
// #define	__REG_WIDE_COMPILE(a,b,c,d)	re_Xcomp(a,b,c,d)
// #define	__REG_WIDE_EXEC(a,b,c,d,e,f,g)	re_Xexec(a,b,c,d,e,f,g)
// rather than just #defining the names as parameterless macros.
//
// For some specialized purposes, it may be desirable to suppress the
// declarations of the "front end" functions, regcomp() and regexec(), or of
// the char versions of the compile and execute functions. To suppress the
// front-end functions, define __REG_NOFRONT. To suppress the char versions,
// define __REG_NOCHAR.
//
// The right place to do those defines (and some others you may want, see
// below) would be <sys/types.h>. If you don't have control of that file, the
// right place to add your own defines to this file is marked below. This is
// normally done automatically, by the makefile and regmkhdr, based on the
// contents of regcustom.h.

// voodoo for C++

// Add your own defines, if needed, here.

// Location where a chunk of regcustom.h is automatically spliced into this
// file (working from its prototype, regproto.h).

// --- begin ---
// ensure certain things don't sneak in from system headers
// interface types
// names and declarations
// --- end ---

// interface types etc.

// regoff_t has to be large enough to hold either off_t or ssize_t, and must
// be signed; it's only a guess that long is suitable, so we offer
// <sys/types.h> an override.
type Regoff_t = int64 /* regex.h:123:24 */

// other interface types

// the biggie, a compiled RE (or rather, a front end to same)
type Regex_t = struct {
	Fre_magic    int32
	F__ccgo_pad1 [4]byte
	Fre_nsub     Size_t
	Fre_info     int64
	Fre_csize    int32
	F__ccgo_pad2 [4]byte
	Fre_endp     uintptr
	Fre_guts     uintptr
	Fre_fns      uintptr
} /* regex.h:156:3 */

// result reporting (may acquire more fields later)
type Regmatch_t = struct {
	Frm_so Regoff_t
	Frm_eo Regoff_t
} /* regex.h:162:3 */

// supplementary control and reporting
type Rm_detail_t = struct{ Frm_extend Regmatch_t } /* regex.h:167:3 */
// automatically gathered by fwd; do not hand-edit
// =====^!^===== end forwards =====^!^=====

// more C++ voodoo

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Overrides for regguts.h definitions, if any.

// Do not insert extras between the "begin" and "end" lines - this chunk is
// automatically extracted to be fitted into regex.h.

// --- begin ---
// Ensure certain things don't sneak in from system headers.
// Interface types
// Names and declarations
// --- end ---

// Internal character type and related.

type Chr = Tcl_UniChar /* regcustom.h:85:21 */ // The type itself.
type Pchr = int32      /* regcustom.h:86:13 */ // What it promotes to.
type Uchr = uint32     /* regcustom.h:87:18 */ // Unsigned type that will hold a chr.
type Celt = int32      /* regcustom.h:88:13 */ // Type to hold chr, or NOCELT

// Functions operating on chr.

// Name the external functions.

//
// & Enable/disable debugging code (by whether REG_DEBUG is defined or not).

// Method of allocating a local workspace. We used a thread-specific data
// space to store this because the regular expression engine is never
// reentered from the same thread; it doesn't make any callbacks.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Things that regcustom.h might override.

// assertions
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.2 Diagnostics	<assert.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// void assert (int expression);
//
//    If NDEBUG is defined, do nothing.
//    If not, and EXPRESSION is zero, print an error message and abort.

// void assert_perror (int errnum);
//
//    If NDEBUG is defined, do nothing.  If not, and ERRNUM is not zero, print an
//    error message with the error text for ERRNUM and abort.
//    (This is a GNU extension.)

// voids

// function-pointer declarator

// memory allocation

// want size of a char in bits, and max value in bounded quantifiers

// misc

// debugging facilities

// bitmap manipulation

// We dissect a chr into byts for colormap table indexing. Here we define a
// byt, which will be the same as a byte on most machines... The exact size of
// a byt is not critical, but about 8 bits is good, and extraction of 8-bit
// chunks is sometimes especially fast.

// the definition of GETCOLOR(), below, assumes NBYTS <= 4

// As soon as possible, we map chrs into equivalence classes -- "colors" --
// which are of much more manageable number.

type Color = int16  /* regguts.h:146:15 */ // colors of characters
type Pcolor = int32 /* regguts.h:147:13 */ // what color promotes to

// A colormap is a tree -- more precisely, a DAG -- indexed at each level by a
// byt of the chr, to map the chr to a color efficiently. Because lower
// sections of the tree can be shared, it can exploit the usual sparseness of
// such a mapping table. The tree is always NBYTS levels deep (in the past it
// was shallower during construction but was "filled" to full depth at the end
// of that); areas that are unaltered as yet point to "fill blocks" which are
// entirely WHITE in color.

// the tree itself
type Colors = struct{ Fccolor [256]Color } /* regguts.h:163:1 */

type Ptrs = struct{ Fpptr [256]uintptr } /* regguts.h:166:1 */

type Tree = struct {
	F__ccgo_pad1 [0]uint64
	Fcolors      struct{ Fccolor [256]Color }
	F__ccgo_pad2 [1536]byte
} /* regguts.h:166:1 */

// Internal per-color descriptor structure for the color machinery
type Colordesc = struct {
	Fnchrs       Uchr
	Fsub         Color
	F__ccgo_pad1 [2]byte
	Farcs        uintptr
	Fflags       int32
	F__ccgo_pad2 [4]byte
	Fblock       uintptr
} /* regguts.h:177:1 */

// Internal per-color descriptor structure for the color machinery
type Arc = struct {
	Ftype          int32
	Fco            Color
	F__ccgo_pad1   [2]byte
	Ffrom          uintptr
	Fto            uintptr
	Foutchain      uintptr
	FoutchainRev   uintptr
	Finchain       uintptr
	FinchainRev    uintptr
	Fcolorchain    uintptr
	FcolorchainRev uintptr
} /* regguts.h:177:1 */

// The color map itself
//
// Much of the data in the colormap struct is only used at compile time.
// However, the bulk of the space usage is in the "tree" structure, so it's
// not clear that there's much point in converting the rest to a more compact
// form when compilation is finished.
type Colormap = struct {
	Fmagic       int32
	F__ccgo_pad1 [4]byte
	Fv           uintptr
	Fncds        Size_t
	Fmax         Size_t
	Ffree        Color
	F__ccgo_pad2 [6]byte
	Fcd          uintptr
	Fcdspace     [10]struct {
		Fnchrs       Uchr
		Fsub         Color
		F__ccgo_pad1 [2]byte
		Farcs        uintptr
		Fflags       int32
		F__ccgo_pad2 [4]byte
		Fblock       uintptr
	}
	Ftree [2]struct {
		F__ccgo_pad1 [0]uint64
		Fcolors      struct{ Fccolor [256]Color }
		F__ccgo_pad2 [1536]byte
	}
} /* regguts.h:197:1 */

// optimization magic to do fast chr->color mapping
// beware, for NBYTS>1, GETCOLOR() is unsafe -- 2nd arg used repeatedly

// Interface definitions for locale-interface functions in locale.c.

// Representation of a set of characters.
type Cvec = struct {
	Fnchrs      int32
	Fchrspace   int32
	Fchrs       uintptr
	Fnranges    int32
	Frangespace int32
	Franges     uintptr
} /* regguts.h:197:1 */

// definitions for non-deterministic finite autmaton (NFA) internal
// representation
//
// Having a "from" pointer within each arc may seem redundant, but it saves a
// lot of hassle.

type State = struct {
	Fno          int32
	Fflag        int8
	F__ccgo_pad1 [3]byte
	Fnins        int32
	F__ccgo_pad2 [4]byte
	Fins         uintptr
	Fnouts       int32
	F__ccgo_pad3 [4]byte
	Fouts        uintptr
	Ffree        uintptr
	Ftmp         uintptr
	Fnext        uintptr
	Fprev        uintptr
	Foas         struct {
		Fnext uintptr
		Fa    [10]struct {
			Ftype          int32
			Fco            Color
			F__ccgo_pad1   [2]byte
			Ffrom          uintptr
			Fto            uintptr
			Foutchain      uintptr
			FoutchainRev   uintptr
			Finchain       uintptr
			FinchainRev    uintptr
			Fcolorchain    uintptr
			FcolorchainRev uintptr
		}
	}
	Fnoas        int32
	F__ccgo_pad4 [4]byte
} /* regguts.h:177:1 */

type Arcbatch = struct {
	Fnext uintptr
	Fa    [10]struct {
		Ftype          int32
		Fco            Color
		F__ccgo_pad1   [2]byte
		Ffrom          uintptr
		Fto            uintptr
		Foutchain      uintptr
		FoutchainRev   uintptr
		Finchain       uintptr
		FinchainRev    uintptr
		Fcolorchain    uintptr
		FcolorchainRev uintptr
	}
} /* regguts.h:177:1 */

type Nfa = struct {
	Fpre         uintptr
	Finit        uintptr
	Ffinal       uintptr
	Fpost        uintptr
	Fnstates     int32
	F__ccgo_pad1 [4]byte
	Fstates      uintptr
	Fslast       uintptr
	Ffree        uintptr
	Fcm          uintptr
	Fbos         [2]Color
	Feos         [2]Color
	Fv           uintptr
	Fparent      uintptr
} /* regguts.h:197:1 */

// definitions for compacted NFA
//
// The main space savings in a compacted NFA is from making the arcs as small
// as possible.  We store only the transition color and next-state number for
// each arc.  The list of out arcs for each state is an array beginning at
// cnfa.states[statenumber], and terminated by a dummy carc struct with
// co == COLORLESS.
//
// The non-dummy carc structs are of two types: plain arcs and LACON arcs.
// Plain arcs just store the transition color number as "co".  LACON arcs
// store the lookahead constraint number plus cnfa.ncolors as "co".  LACON
// arcs can be distinguished from plain by testing for co >= cnfa.ncolors.

type Carc = struct {
	Fco          Color
	F__ccgo_pad1 [2]byte
	Fto          int32
} /* regguts.h:197:1 */

type Cnfa = struct {
	Fnstates     int32
	Fncolors     int32
	Fflags       int32
	Fpre         int32
	Fpost        int32
	Fbos         [2]Color
	Feos         [2]Color
	F__ccgo_pad1 [4]byte
	Fstflags     uintptr
	Fstates      uintptr
	Farcs        uintptr
} /* regguts.h:197:1 */

// This symbol limits the transient heap space used by the regex compiler,
// and thereby also the maximum complexity of NFAs that we'll deal with.
// Currently we only count NFA states and arcs against this; the other
// transient data is generally not large enough to notice compared to those.
// Note that we do not charge anything for the final output data structures
// (the compacted NFA and the colormap).

// subexpression tree
//
// "op" is one of:
//	'='  plain regex without interesting substructure (implemented as DFA)
//	'b'  back-reference (has no substructure either)
//	'('  capture node: captures the match of its single child
//	'.'  concatenation: matches a match for left, then a match for right
//	'|'  alternation: matches a match for left or a match for right
//	'*'  iteration: matches some number of matches of its single child
//
// Note: the right child of an alternation must be another alternation or
// NULL; hence, an N-way branch requires N alternation nodes, not N-1 as you
// might expect.  This could stand to be changed.  Actually I'd rather see
// a single alternation node with N children, but that will take revising
// the representation of struct subre.
//
// Note: when a backref is directly quantified, we stick the min/max counts
// into the backref rather than plastering an iteration node on top.  This is
// for efficiency: there is no need to search for possible division points.

type Subre = struct {
	Fop          int8
	Fflags       int8
	Fid          int16
	Fsubno       int32
	Fmin         int16
	Fmax         int16
	F__ccgo_pad1 [4]byte
	Fleft        uintptr
	Fright       uintptr
	Fbegin       uintptr
	Fend         uintptr
	Fcnfa        struct {
		Fnstates     int32
		Fncolors     int32
		Fflags       int32
		Fpre         int32
		Fpost        int32
		Fbos         [2]Color
		Feos         [2]Color
		F__ccgo_pad1 [4]byte
		Fstflags     uintptr
		Fstates      uintptr
		Farcs        uintptr
	}
	Fchain uintptr
} /* regguts.h:197:1 */

// table of function pointers for generic manipulation functions. A regex_t's
// re_fns points to one of these.

type Fns = struct{ Ffree uintptr } /* regguts.h:410:1 */

// the insides of a regex_t, hidden behind a void *

type Guts = struct {
	Fmagic  int32
	Fcflags int32
	Finfo   int64
	Fnsub   Size_t
	Ftree   uintptr
	Fsearch struct {
		Fnstates     int32
		Fncolors     int32
		Fflags       int32
		Fpre         int32
		Fpost        int32
		Fbos         [2]Color
		Feos         [2]Color
		F__ccgo_pad1 [4]byte
		Fstflags     uintptr
		Fstates      uintptr
		Farcs        uintptr
	}
	Fntree       int32
	F__ccgo_pad1 [4]byte
	Fcmap        struct {
		Fmagic       int32
		F__ccgo_pad1 [4]byte
		Fv           uintptr
		Fncds        Size_t
		Fmax         Size_t
		Ffree        Color
		F__ccgo_pad2 [6]byte
		Fcd          uintptr
		Fcdspace     [10]struct {
			Fnchrs       Uchr
			Fsub         Color
			F__ccgo_pad1 [2]byte
			Farcs        uintptr
			Fflags       int32
			F__ccgo_pad2 [4]byte
			Fblock       uintptr
		}
		Ftree [2]struct {
			F__ccgo_pad1 [0]uint64
			Fcolors      struct{ Fccolor [256]Color }
			F__ccgo_pad2 [1536]byte
		}
	}
	Fcompare     uintptr
	Flacons      uintptr
	Fnlacons     int32
	F__ccgo_pad2 [4]byte
} /* regguts.h:418:1 */

// parsing macros; most know that `v' is the struct vars pointer

// token type codes, some also used as NFA arc types

// is an arc colored, and hence on a color chain?

// static function list
var functions = Fns{
	Ffree: 0, // regfree insides
} /* regcomp.c:271:25 */

//
//  - compile - compile regular expression
//  * Note: on failure, no resources remain allocated, so regfree()
//  * need not be applied to re.
//  ^ int compile(regex_t *, const chr *, size_t, int);
//
func XTclReComp(tls *libc.TLS, re uintptr, string uintptr, len Size_t, flags int32) int32 { /* regcomp.c:282:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)
	var v uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&varsKey)), int32(unsafe.Sizeof(struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	}{})))
	var g uintptr
	var i int32
	var j Size_t
	var debug uintptr
	if flags&REG_PROGRESS != 0 {
		debug = libc.Xstdout
	} else {
		debug = uintptr(0)
	}

	// Sanity checks.

	if re == uintptr(0) || string == uintptr(0) {

		return REG_INVARG
	}
	if flags&REG_QUOTE != 0 && flags&(REG_ADVANCED|REG_EXPANDED|REG_NEWLINE) != 0 {

		return REG_INVARG
	}
	if !(flags&REG_EXTENDED != 0) && flags&REG_ADVF != 0 {

		return REG_INVARG
	}

	// Initial setup (after which freev() is callable).

	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fre = re
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow = string
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fstop = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow + uintptr(len)*2
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fsavenow = libc.AssignPtrUintptr(v+32, uintptr(0))
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr = 0
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags = flags
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnsubexp = 0
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fsubs = v + 88 /* &.sub10 */
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnsubs = uint64(10)
	for j = uint64(0); j < (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnsubs; j++ {
		*(*uintptr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fsubs + uintptr(j)*8)) = uintptr(0)
	}
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa = uintptr(0)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcm = uintptr(0)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnlcolor = int16(-1)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fwordchrs = uintptr(0)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftree = uintptr(0)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftreechain = uintptr(0)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftreefree = uintptr(0)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv = uintptr(0)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv2 = uintptr(0)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Flacons = uintptr(0)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnlacons = 0
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fspaceused = uint64(0)
	(*Regex_t)(unsafe.Pointer(re)).Fre_magic = REMAGIC
	(*Regex_t)(unsafe.Pointer(re)).Fre_info = int64(0) // bits get set during parse
	(*Regex_t)(unsafe.Pointer(re)).Fre_csize = int32(unsafe.Sizeof(Chr(0)))
	(*Regex_t)(unsafe.Pointer(re)).Fre_guts = uintptr(0)
	(*Regex_t)(unsafe.Pointer(re)).Fre_fns = uintptr(unsafe.Pointer(&functions))

	// More complex setup, malloced things.

	(*Regex_t)(unsafe.Pointer(re)).Fre_guts = XTclpAlloc(tls, uint32(unsafe.Sizeof(Guts{})))
	if (*Regex_t)(unsafe.Pointer(re)).Fre_guts == uintptr(0) {
		return freev(tls, v, REG_ESPACE)
	}
	g = (*Regex_t)(unsafe.Pointer(re)).Fre_guts
	(*Guts)(unsafe.Pointer(g)).Ftree = uintptr(0)
	initcm(tls, v, g+96)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcm = g + 96
	(*Guts)(unsafe.Pointer(g)).Flacons = uintptr(0)
	(*Guts)(unsafe.Pointer(g)).Fnlacons = 0
	(*Guts)(unsafe.Pointer(g)).Fsearch.Fnstates = 0
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa = newnfa(tls, v, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcm, uintptr(0))
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return freev(tls, v, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr)
		}
	}

	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv = newcvec(tls, 100, 20)
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv == uintptr(0) {
		return freev(tls, v, REG_ESPACE)
	}

	// Parsing.

	lexstart(tls, v) // also handles prefixes
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_NLSTOP != 0 || (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_NLANCH != 0 {
		// Assign newline a unique color.

		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnlcolor = subcolor(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcm, int32(newline(tls)))
		okcolors(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcm)
	}
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return freev(tls, v, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr)
		}
	}

	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftree = parse(tls, v, 'e', 'p', (*Nfa)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa)).Finit, (*Nfa)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa)).Ffinal)
	/* even if error; ISERR() => SEE(EOS) */
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return freev(tls, v, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr)
		}
	}

	// Finish setup of nfa and its subre tree.

	specialcolors(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return freev(tls, v, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr)
		}
	}

	if debug != uintptr(0) {
		libc.Xfprintf(tls, debug, ts+65, 0)
		dumpnfa(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, debug)
		dumpst(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ftree, debug, 1)
	}
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fntree = numst(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftree, 1)
	markst(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftree)
	cleanst(tls, v)
	if debug != uintptr(0) {
		libc.Xfprintf(tls, debug, ts+94, 0)
		dumpst(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ftree, debug, 1)
	}

	// Build compacted NFAs for tree and lacons.

	*(*int64)(unsafe.Pointer(re + 16)) |= nfatree(tls, v, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftree, debug)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return freev(tls, v, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr)
		}
	}

	for i = 1; i < (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnlacons; i++ {
		if debug != uintptr(0) {
			libc.Xfprintf(tls, debug, ts+130, libc.VaList(bp, i))
		}
		nfanode(tls, v, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flacons+uintptr(i)*112, debug)
	}
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return freev(tls, v, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr)
		}
	}

	if int32((*Subre)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftree)).Fflags)&SHORTER != 0 {
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_USHORTEST)
	}

	// Build compacted NFAs for tree, lacons, fast search.

	if debug != uintptr(0) {
		libc.Xfprintf(tls, debug, ts+160, 0)
	}

	// Can sacrifice main NFA now, so use it as work area.

	optimize(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, debug)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return freev(tls, v, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr)
		}
	}

	makesearch(tls, v, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return freev(tls, v, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr)
		}
	}

	compact(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, g+32)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return freev(tls, v, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr)
		}
	}

	// Looks okay, package it up.

	(*Regex_t)(unsafe.Pointer(re)).Fre_nsub = Size_t((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnsubexp)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fre = uintptr(0) // freev no longer frees re
	(*Guts)(unsafe.Pointer(g)).Fmagic = GUTSMAGIC
	(*Guts)(unsafe.Pointer(g)).Fcflags = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags
	(*Guts)(unsafe.Pointer(g)).Finfo = (*Regex_t)(unsafe.Pointer(re)).Fre_info
	(*Guts)(unsafe.Pointer(g)).Fnsub = (*Regex_t)(unsafe.Pointer(re)).Fre_nsub
	(*Guts)(unsafe.Pointer(g)).Ftree = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftree
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftree = uintptr(0)
	(*Guts)(unsafe.Pointer(g)).Fntree = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fntree
	(*Guts)(unsafe.Pointer(g)).Fcompare = func() uintptr {
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_ICASE != 0 {
			return *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, Size_t) int32
			}{casecmp}))
		}
		return *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, Size_t) int32
		}{cmp}))
	}()
	(*Guts)(unsafe.Pointer(g)).Flacons = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Flacons
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Flacons = uintptr(0)
	(*Guts)(unsafe.Pointer(g)).Fnlacons = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnlacons

	if flags&REG_DUMP != 0 {
		dump(tls, re, libc.Xstdout)
	}

	return freev(tls, v, 0)
}

var varsKey Tcl_ThreadDataKey /* regcomp.c:288:5: */

//
//  - moresubs - enlarge subRE vector
//  ^ static void moresubs(struct vars *, int);
//
func moresubs(tls *libc.TLS, v uintptr, wanted int32) { /* regcomp.c:474:1: */
	var p uintptr
	var n Size_t

	n = Size_t(wanted)*uint64(3)/uint64(2) + uint64(1)
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fsubs == v+88 {
		p = XTclpAlloc(tls, uint32(n*Size_t(unsafe.Sizeof(uintptr(0)))))
		if p != uintptr(0) {
			libc.Xmemcpy(tls, p, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fsubs, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnsubs*Size_t(unsafe.Sizeof(uintptr(0))))
		}
	} else {
		p = XTclpRealloc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fsubs, uint32(n*Size_t(unsafe.Sizeof(uintptr(0)))))
	}
	if p == uintptr(0) {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ESPACE
		}()
		return
	}

	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fsubs = p
	p = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fsubs + uintptr((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnsubs)*8
__1:
	if !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnsubs < n) {
		goto __3
	}
	{
		*(*uintptr)(unsafe.Pointer(p)) = uintptr(0)

	}
	goto __2
__2:
	p += 8
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnsubs++
	goto __1
	goto __3
__3:
}

//
//  - freev - free vars struct's substructures where necessary
//  * Optionally does error-number setting, and always returns error code (if
//  * any), to make error-handling code terser.
//  ^ static int freev(struct vars *, int);
//
func freev(tls *libc.TLS, v uintptr, err int32) int32 { /* regcomp.c:511:1: */
	var ret int32

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fre != uintptr(0) {
		rfree(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre)
	}
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fsubs != v+88 {
		XTclpFree(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fsubs)
	}
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa != uintptr(0) {
		freenfa(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
	}
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftree != uintptr(0) {
		freesubre(tls, v, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ftree)
	}
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftreechain != uintptr(0) {
		cleanst(tls, v)
	}
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv != uintptr(0) {
		freecvec(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcv)
	}
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv2 != uintptr(0) {
		freecvec(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcv2)
	}
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Flacons != uintptr(0) {
		freelacons(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flacons, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnlacons)
	}
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype = 'e'
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr = func() int32 {
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr
		}
		return err
	}() // nop if err==0

	ret = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr

	return ret
}

//
//  - makesearch - turn an NFA into a search NFA (implicit prepend of .*?)
//  * NFA must have been optimize()d already.
//  ^ static void makesearch(struct vars *, struct nfa *);
//
func makesearch(tls *libc.TLS, v uintptr, nfa uintptr) { /* regcomp.c:554:1: */
	var a uintptr
	var b uintptr
	var pre uintptr = (*Nfa)(unsafe.Pointer(nfa)).Fpre
	var s uintptr
	var s2 uintptr
	var slist uintptr

	// No loops are needed if it's anchored.

	for a = (*State)(unsafe.Pointer(pre)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {

		if int32((*Arc)(unsafe.Pointer(a)).Fco) != int32(*(*Color)(unsafe.Pointer(nfa + 72))) && int32((*Arc)(unsafe.Pointer(a)).Fco) != int32(*(*Color)(unsafe.Pointer(nfa + 72 + 1*2))) {
			break
		}
	}
	if a != uintptr(0) {
		// Add implicit .* in front.

		rainbow(tls, nfa, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcm, 'p', -1, pre, pre)

		// And ^* and \A* too -- not always necessary, but harmless.

		newarc(tls, nfa, 'p', int32(*(*Color)(unsafe.Pointer(nfa + 72))), pre, pre)
		newarc(tls, nfa, 'p', int32(*(*Color)(unsafe.Pointer(nfa + 72 + 1*2))), pre, pre)
	}

	// Now here's the subtle part. Because many REs have no lookback
	// constraints, often knowing when you were in the pre state tells you
	// little; it's the next state(s) that are informative. But some of them
	// may have other inarcs, i.e. it may be possible to make actual progress
	// and then return to one of them. We must de-optimize such cases,
	// splitting each such state into progress and no-progress states.

	// First, make a list of the states.

	slist = uintptr(0)
	for a = (*State)(unsafe.Pointer(pre)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		s = (*Arc)(unsafe.Pointer(a)).Fto
		for b = (*State)(unsafe.Pointer(s)).Fins; b != uintptr(0); b = (*Arc)(unsafe.Pointer(b)).Finchain {
			if (*Arc)(unsafe.Pointer(b)).Ffrom != pre {
				break
			}
		}

		// We want to mark states as being in the list already by having non
		// NULL tmp fields, but we can't just store the old slist value in tmp
		// because that doesn't work for the first such state.  Instead, the
		// first list entry gets its own address in tmp.
		if b != uintptr(0) && (*State)(unsafe.Pointer(s)).Ftmp == uintptr(0) {
			(*State)(unsafe.Pointer(s)).Ftmp = func() uintptr {
				if slist != uintptr(0) {
					return slist
				}
				return s
			}()
			slist = s
		}
	}

	// Do the splits.

	for s = slist; s != uintptr(0); s = s2 {
		s2 = newstate(tls, nfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		copyouts(tls, nfa, s, s2)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		for a = (*State)(unsafe.Pointer(s)).Fins; a != uintptr(0); a = b {
			b = (*Arc)(unsafe.Pointer(a)).Finchain

			if (*Arc)(unsafe.Pointer(a)).Ffrom != pre {
				cparc(tls, nfa, a, (*Arc)(unsafe.Pointer(a)).Ffrom, s2)
				freearc(tls, nfa, a)
			}
		}
		if (*State)(unsafe.Pointer(s)).Ftmp != s {
			s2 = (*State)(unsafe.Pointer(s)).Ftmp
		} else {
			s2 = uintptr(0)
		}
		(*State)(unsafe.Pointer(s)).Ftmp = uintptr(0) // clean up while we're at it
	}
}

//
//  - parse - parse an RE
//  * This is actually just the top level, which parses a bunch of branches tied
//  * together with '|'. They appear in the tree as the left children of a chain
//  * of '|' subres.
//  ^ static struct subre *parse(struct vars *, int, int, struct state *,
//  ^ 	struct state *);
//
func parse(tls *libc.TLS, v uintptr, stopper int32, type1 int32, init1 uintptr, final uintptr) uintptr { /* regcomp.c:651:21: */
	var left uintptr
	var right uintptr     // scaffolding for branch
	var branches uintptr  // top level
	var branch uintptr    // current branch
	var t uintptr         // temporary
	var firstbranch int32 // is this the first branch?

	branches = subre(tls, v, '|', LONGER, init1, final)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return uintptr(0)
		}
	}

	branch = branches
	firstbranch = 1
	for ok := true; ok; ok = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == '|' && next(tls, v) != 0 { // a branch
		if !(firstbranch != 0) {
			// Need a place to hang the branch.

			(*Subre)(unsafe.Pointer(branch)).Fright = subre(tls, v, '|', LONGER, init1, final)
			{
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return uintptr(0)
				}
			}

			branch = (*Subre)(unsafe.Pointer(branch)).Fright
		}
		firstbranch = 0
		left = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		right = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return uintptr(0)
			}
		}

		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, init1, left)
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, right, final)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return uintptr(0)
			}
		}

		(*Subre)(unsafe.Pointer(branch)).Fleft = parsebranch(tls, v, stopper, type1, left, right, 0)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return uintptr(0)
			}
		}

		*(*int8)(unsafe.Pointer(branch + 1)) |= int8((int32((*Subre)(unsafe.Pointer(branch)).Fflags)|int32((*Subre)(unsafe.Pointer((*Subre)(unsafe.Pointer(branch)).Fleft)).Fflags))&libc.CplInt32(NOPROP) | (int32((*Subre)(unsafe.Pointer(branch)).Fflags)|int32((*Subre)(unsafe.Pointer((*Subre)(unsafe.Pointer(branch)).Fleft)).Fflags))<<2&((int32((*Subre)(unsafe.Pointer(branch)).Fflags)|int32((*Subre)(unsafe.Pointer((*Subre)(unsafe.Pointer(branch)).Fleft)).Fflags))<<1)&MIXED)
		if int32((*Subre)(unsafe.Pointer(branch)).Fflags) & ^int32((*Subre)(unsafe.Pointer(branches)).Fflags) != 0 { // new flags
			for t = branches; t != branch; t = (*Subre)(unsafe.Pointer(t)).Fright {
				*(*int8)(unsafe.Pointer(t + 1)) |= int8(int32((*Subre)(unsafe.Pointer(branch)).Fflags))
			}
		}
	}

	if !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == stopper) {

		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_EPAREN
		}()
	}

	// Optimize out simple cases.

	if branch == branches { // only one branch

		t = (*Subre)(unsafe.Pointer(branch)).Fleft
		(*Subre)(unsafe.Pointer(branch)).Fleft = uintptr(0)
		freesubre(tls, v, branches)
		branches = t
	} else if !(int32((*Subre)(unsafe.Pointer(branches)).Fflags)&(MIXED|CAP|BACKR) != 0) { // no interesting innards
		freesubre(tls, v, (*Subre)(unsafe.Pointer(branches)).Fleft)
		(*Subre)(unsafe.Pointer(branches)).Fleft = uintptr(0)
		freesubre(tls, v, (*Subre)(unsafe.Pointer(branches)).Fright)
		(*Subre)(unsafe.Pointer(branches)).Fright = uintptr(0)
		(*Subre)(unsafe.Pointer(branches)).Fop = int8('=')
	}

	return branches
}

//
//  - parsebranch - parse one branch of an RE
//  * This mostly manages concatenation, working closely with parseqatom().
//  * Concatenated things are bundled up as much as possible, with separate
//  * ',' nodes introduced only when necessary due to substructure.
//  ^ static struct subre *parsebranch(struct vars *, int, int, struct state *,
//  ^ 	struct state *, int);
//
func parsebranch(tls *libc.TLS, v uintptr, stopper int32, type1 int32, left uintptr, right uintptr, partial int32) uintptr { /* regcomp.c:733:21: */
	var lp uintptr        // left end of current construct
	var seencontent int32 // is there anything in this branch yet?
	var t uintptr

	lp = left
	seencontent = 0
	t = subre(tls, v, '=', 0, left, right) /* op '=' is tentative */
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return uintptr(0)
		}
	}

	for !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == '|') && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == stopper) && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == 'e') {
		if seencontent != 0 { // implicit concat operator
			lp = newstate(tls, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnfa)
			{
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return uintptr(0)
				}
			}

			moveins(tls, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnfa, right, lp)
		}
		seencontent = 1

		// NB, recursion in parseqatom() may swallow rest of branch
		parseqatom(tls, v, stopper, type1, lp, right, t)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return uintptr(0)
			}
		}

	}

	if !(seencontent != 0) { // empty branch
		if !(partial != 0) {
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNSPEC)
		}

		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, left, right)
	}

	return t
}

//
//  - parseqatom - parse one quantified atom or constraint of an RE
//  * The bookkeeping near the end cooperates very closely with parsebranch(); in
//  * particular, it contains a recursion that can involve parsing the rest of
//  * the branch, making this function's name somewhat inaccurate.
//  ^ static void parseqatom(struct vars *, int, int, struct state *,
//  ^ 	struct state *, struct subre *);
//
func parseqatom(tls *libc.TLS, v uintptr, stopper int32, type1 int32, lp uintptr, rp uintptr, top uintptr) { /* regcomp.c:783:1: */
	var s uintptr // temporaries for new states
	var s2 uintptr
	var m int32
	var n int32
	var atom uintptr // atom's subtree
	var t uintptr
	var cap int32   // capturing parens?
	var pos int32   // positive lookahead?
	var subno int32 // capturing-parens or backref number
	var atomtype int32
	var qprefer int32 // quantifier short/long preference
	var f int32
	var atomp uintptr // where the pointer to atom is

	// Initial bookkeeping.

	atom = uintptr(0)
	// must string new code
	// between lp and rp
	subno = 0 // just to shut lint up

	// An atom or constraint...

	atomtype = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype
	switch atomtype {
	// first, constraints, which end by returning
	case '^':
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, '^', 1, lp, rp)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_NLANCH != 0 {
			newarc(tls, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnfa, 'r', int32((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnlcolor), lp, rp)
		}
		next(tls, v)
		return
	case '$':
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, '$', 1, lp, rp)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_NLANCH != 0 {
			newarc(tls, (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnfa, 'a', int32((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnlcolor), lp, rp)
		}
		next(tls, v)
		return
	case 'A':
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, '^', 1, lp, rp) // BOL
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, '^', 0, lp, rp) // or BOS
		next(tls, v)
		return
	case 'Z':
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, '$', 1, lp, rp) // EOL
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, '$', 0, lp, rp) // or EOS
		next(tls, v)
		return
	case '<':
		wordchrs(tls, v) // does NEXT()
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		nonword(tls, v, 'r', lp, s)
		word(tls, v, 'a', s, rp)
		return
	case '>':
		wordchrs(tls, v) // does NEXT()
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		word(tls, v, 'r', lp, s)
		nonword(tls, v, 'a', s, rp)
		return
	case 'w':
		wordchrs(tls, v) // does NEXT()
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		nonword(tls, v, 'r', lp, s)
		word(tls, v, 'a', s, rp)
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		word(tls, v, 'r', lp, s)
		nonword(tls, v, 'a', s, rp)
		return
	case 'W':
		wordchrs(tls, v) // does NEXT()
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		word(tls, v, 'r', lp, s)
		word(tls, v, 'a', s, rp)
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		nonword(tls, v, 'r', lp, s)
		nonword(tls, v, 'a', s, rp)
		return
	case 'L': // lookahead constraint
		pos = int32((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnextvalue)
		next(tls, v)
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		s2 = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		t = parse(tls, v, ')', 'L', s, s2)
		freesubre(tls, v, t) // internal structure irrelevant

		next(tls, v)
		n = newlacon(tls, v, s, s2, pos)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'L', n, lp, rp)
		return

		// Then errors, to get them out of the way.

	case '*':
		fallthrough
	case '+':
		fallthrough
	case '?':
		fallthrough
	case '{':
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_BADRPT
		}()
		return
	default:
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ASSERT
		}()
		return

		// Then plain characters, and minor variants on that theme.

	case ')': // unbalanced paren
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_ADVANCED != REG_EXTENDED {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_EPAREN
			}()
			return
		}

		// Legal in EREs due to specification botch.

		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UPBOTCH)
		fallthrough
		// FALLTHRU
	case 'p':
		onechr(tls, v, int32((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnextvalue), lp, rp)
		okcolors(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcm)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		next(tls, v)
		break
	case '[':
		if int32((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnextvalue) == 1 {
			bracket(tls, v, lp, rp)
		} else {
			cbracket(tls, v, lp, rp)
		}

		next(tls, v)
		break
	case '.':
		rainbow(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcm, 'p',
			func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fcflags&REG_NLSTOP != 0 {
					return int32((*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnlcolor)
				}
				return -1
			}(), lp, rp)
		next(tls, v)
		break

		// And finally the ugly stuff.

	case '(': // value flags as capturing or non
		if type1 == 'L' {
			cap = 0
		} else {
			cap = int32((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue)
		}
		if cap != 0 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnsubexp++
			subno = (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnsubexp
			if Size_t(subno) >= (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnsubs {
				moresubs(tls, v, subno)
			}

		} else {
			atomtype = 'p' // something that's not '('
		}
		next(tls, v)

		// Need new endpoints because tree will contain pointers.

		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		s2 = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, lp, s)
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, s2, rp)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		atom = parse(tls, v, ')', 'p', s, s2)

		next(tls, v)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		if cap != 0 {
			*(*uintptr)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fsubs + uintptr(subno)*8)) = atom
			t = subre(tls, v, '(', int32((*Subre)(unsafe.Pointer(atom)).Fflags)|CAP, lp, rp)
			{
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return
				}
			}

			(*Subre)(unsafe.Pointer(t)).Fsubno = subno
			(*Subre)(unsafe.Pointer(t)).Fleft = atom
			atom = t
		}

		// Postpone everything else pending possible {0}.

		break
	case 'b': // the Feature From The Black Lagoon
		for ok := true; ok; ok = 0 != 0 {
			if !(type1 != 'L') {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_ESUBREG
				}()
			}
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			if !(Size_t((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue) < (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnsubs) {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_ESUBREG
				}()
			}
		}
		for ok2 := true; ok2; ok2 = 0 != 0 {
			if !(*(*uintptr)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fsubs + uintptr((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue)*8)) != uintptr(0)) {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_ESUBREG
				}()
			}
		}
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		atom = subre(tls, v, 'b', BACKR, lp, rp)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		subno = int32((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnextvalue)
		(*Subre)(unsafe.Pointer(atom)).Fsubno = subno
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, lp, rp) // temporarily, so there's something
		next(tls, v)
		break
	}

	// ...and an atom may be followed by a quantifier.

	switch (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype {
	case '*':
		m = 0
		n = X_POSIX2_RE_DUP_MAX + 1
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnextvalue != 0 {
			qprefer = LONGER
		} else {
			qprefer = SHORTER
		}
		next(tls, v)
		break
	case '+':
		m = 1
		n = X_POSIX2_RE_DUP_MAX + 1
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnextvalue != 0 {
			qprefer = LONGER
		} else {
			qprefer = SHORTER
		}
		next(tls, v)
		break
	case '?':
		m = 0
		n = 1
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnextvalue != 0 {
			qprefer = LONGER
		} else {
			qprefer = SHORTER
		}
		next(tls, v)
		break
	case '{':
		next(tls, v)
		m = scannum(tls, v)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype == ',' && next(tls, v) != 0 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype == 'd' {
				n = scannum(tls, v)
			} else {
				n = X_POSIX2_RE_DUP_MAX + 1
			}
			if m > n {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_BADBR
				}()
				return
			}

			// {m,n} exercises preference, even if it's {m,m}

			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue != 0 {
				qprefer = LONGER
			} else {
				qprefer = SHORTER
			}
		} else {
			n = m
			// {m} passes operand's preference through.

			qprefer = 0
		}
		if !((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype == '}') { // catches errors too
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_BADBR
			}()
			return
		}
		next(tls, v)
		break
	default: // no quantifier
		m = libc.AssignInt32(&n, 1)
		qprefer = 0
		break
	}

	// Annoying special case: {0} or {0,0} cancels everything.

	if m == 0 && n == 0 {
		if atom != uintptr(0) {
			freesubre(tls, v, atom)
		}
		if atomtype == '(' {
			*(*uintptr)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fsubs + uintptr(subno)*8)) = uintptr(0)
		}
		delsub(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, lp, rp)
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, lp, rp)
		return
	}

	// If not a messy case, avoid hard part.

	f = int32((*Subre)(unsafe.Pointer(top)).Fflags) | qprefer | func() int32 {
		if atom != uintptr(0) {
			return int32((*Subre)(unsafe.Pointer(atom)).Fflags)
		}
		return 0
	}()
	if atomtype != '(' && atomtype != 'b' && !((f&libc.CplInt32(NOPROP)|f<<2&(f<<1)&MIXED)&(MIXED|CAP|BACKR) != 0) {
		if !(m == 1 && n == 1) {
			repeat(tls, v, lp, rp, m, n)
		}
		if atom != uintptr(0) {
			freesubre(tls, v, atom)
		}
		(*Subre)(unsafe.Pointer(top)).Fflags = int8(f)
		return
	}

	// hard part: something messy
	// That is, capturing parens, back reference, short/long clash, or an atom
	// with substructure containing one of those.

	// Now we'll need a subre for the contents even if they're boring.

	if atom == uintptr(0) {
		atom = subre(tls, v, '=', 0, lp, rp)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

	}

	// Prepare a general-purpose state skeleton.
	//
	// In the no-backrefs case, we want this:
	//
	// [lp] ---> [s] ---prefix---> [begin] ---atom---> [end] ---rest---> [rp]
	//
	// where prefix is some repetitions of atom.  In the general case we need
	//
	// [lp] ---> [s] ---iterator---> [s2] ---rest---> [rp]
	//
	// where the iterator wraps around [begin] ---atom---> [end]
	//
	// We make the s state here for both cases; s2 is made below if needed

	s = newstate(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa) // first, new endpoints for the atom
	s2 = newstate(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	moveouts(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, lp, s)
	moveins(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, rp, s2)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	(*Subre)(unsafe.Pointer(atom)).Fbegin = s
	(*Subre)(unsafe.Pointer(atom)).Fend = s2
	s = newstate(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa) /* set up starting state */
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	newarc(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, 'n', 0, lp, s)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	// Break remaining subRE into x{...} and what follows.

	t = subre(tls, v, '.', (qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))&libc.CplInt32(NOPROP)|(qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))<<2&((qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))<<1)&MIXED|func() int32 {
		if qprefer&NOPROP != 0 {
			return qprefer & NOPROP
		}
		return int32((*Subre)(unsafe.Pointer(atom)).Fflags) & NOPROP
	}(), lp, rp)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	(*Subre)(unsafe.Pointer(t)).Fleft = atom
	atomp = t + 16

	// Here we should recurse... but we must postpone that to the end.

	// Split top into prefix and remaining.

	(*Subre)(unsafe.Pointer(top)).Fleft = subre(tls, v, '=', int32((*Subre)(unsafe.Pointer(top)).Fflags), (*Subre)(unsafe.Pointer(top)).Fbegin, lp)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	(*Subre)(unsafe.Pointer(top)).Fop = int8('.')
	(*Subre)(unsafe.Pointer(top)).Fright = t

	// If it's a backref, now is the time to replicate the subNFA.

	if atomtype == 'b' {
		// just the EMPTY
		delsub(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, (*Subre)(unsafe.Pointer(atom)).Fbegin, (*Subre)(unsafe.Pointer(atom)).Fend)

		// And here's why the recursion got postponed: it must wait until the
		// skeleton is filled in, because it may hit a backref that wants to
		// copy the filled-in skeleton.

		dupnfa(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, (*Subre)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fsubs + uintptr(subno)*8)))).Fbegin, (*Subre)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fsubs + uintptr(subno)*8)))).Fend,
			(*Subre)(unsafe.Pointer(atom)).Fbegin, (*Subre)(unsafe.Pointer(atom)).Fend)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

	}

	// It's quantifier time.  If the atom is just a backref, we'll let it deal
	// with quantifiers internally.

	if atomtype == 'b' {
		// Special case: backrefs have internal quantifiers.

		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, s, (*Subre)(unsafe.Pointer(atom)).Fbegin) // empty prefix

		// Just stuff everything into atom.

		repeat(tls, v, (*Subre)(unsafe.Pointer(atom)).Fbegin, (*Subre)(unsafe.Pointer(atom)).Fend, m, n)
		(*Subre)(unsafe.Pointer(atom)).Fmin = int16(m)
		(*Subre)(unsafe.Pointer(atom)).Fmax = int16(n)
		*(*int8)(unsafe.Pointer(atom + 1)) |= int8((qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))&libc.CplInt32(NOPROP) | (qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))<<2&((qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))<<1)&MIXED | func() int32 {
			if qprefer&NOPROP != 0 {
				return qprefer & NOPROP
			}
			return int32((*Subre)(unsafe.Pointer(atom)).Fflags) & NOPROP
		}())
		// rest of branch can be strung starting from atom->end
		s2 = (*Subre)(unsafe.Pointer(atom)).Fend
	} else if m == 1 && n == 1 {
		// No/vacuous quantifier: done.

		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, s, (*Subre)(unsafe.Pointer(atom)).Fbegin) // empty prefix
		// rest of branch can be strung starting from atom->end
		s2 = (*Subre)(unsafe.Pointer(atom)).Fend
	} else if m > 0 && !(int32((*Subre)(unsafe.Pointer(atom)).Fflags)&BACKR != 0) {
		// If there's no backrefs involved, we can turn x{m,n} into
		// x{m-1,n-1}x, with capturing parens in only the second x.  This
		// is valid because we only care about capturing matches from the
		// final iteration of the quantifier.  It's a win because we can
		// implement the backref-free left side as a plain DFA node, since
		// we don't really care where its submatches are.

		dupnfa(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, (*Subre)(unsafe.Pointer(atom)).Fbegin, (*Subre)(unsafe.Pointer(atom)).Fend, s, (*Subre)(unsafe.Pointer(atom)).Fbegin)

		repeat(tls, v, s, (*Subre)(unsafe.Pointer(atom)).Fbegin, m-1, func() int32 {
			if n == X_POSIX2_RE_DUP_MAX+1 {
				return n
			}
			return n - 1
		}())
		f = (qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))&libc.CplInt32(NOPROP) | (qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))<<2&((qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))<<1)&MIXED | func() int32 {
			if qprefer&NOPROP != 0 {
				return qprefer & NOPROP
			}
			return int32((*Subre)(unsafe.Pointer(atom)).Fflags) & NOPROP
		}()
		t = subre(tls, v, '.', f, s, (*Subre)(unsafe.Pointer(atom)).Fend) /* prefix and atom */
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		(*Subre)(unsafe.Pointer(t)).Fleft = subre(tls, v, '=', f&NOPROP, s, (*Subre)(unsafe.Pointer(atom)).Fbegin)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		(*Subre)(unsafe.Pointer(t)).Fright = atom
		*(*uintptr)(unsafe.Pointer(atomp)) = t
		// rest of branch can be strung starting from atom->end
		s2 = (*Subre)(unsafe.Pointer(atom)).Fend
	} else {
		// general case: need an iteration node
		s2 = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		moveouts(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, (*Subre)(unsafe.Pointer(atom)).Fend, s2)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		dupnfa(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, (*Subre)(unsafe.Pointer(atom)).Fbegin, (*Subre)(unsafe.Pointer(atom)).Fend, s, s2)
		repeat(tls, v, s, s2, m, n)
		f = (qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))&libc.CplInt32(NOPROP) | (qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))<<2&((qprefer|int32((*Subre)(unsafe.Pointer(atom)).Fflags))<<1)&MIXED | func() int32 {
			if qprefer&NOPROP != 0 {
				return qprefer & NOPROP
			}
			return int32((*Subre)(unsafe.Pointer(atom)).Fflags) & NOPROP
		}()
		t = subre(tls, v, '*', f, s, s2)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		(*Subre)(unsafe.Pointer(t)).Fmin = int16(m)
		(*Subre)(unsafe.Pointer(t)).Fmax = int16(n)
		(*Subre)(unsafe.Pointer(t)).Fleft = atom
		*(*uintptr)(unsafe.Pointer(atomp)) = t
		// rest of branch is to be strung from iteration's end state
	}

	// And finally, look after that postponed recursion.

	t = (*Subre)(unsafe.Pointer(top)).Fright
	if !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == '|' || (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == stopper || (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == 'e') {
		(*Subre)(unsafe.Pointer(t)).Fright = parsebranch(tls, v, stopper, type1, s2, rp, 1)
	} else {
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, s2, rp)
		(*Subre)(unsafe.Pointer(t)).Fright = subre(tls, v, '=', 0, s2, rp)
	}
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	*(*int8)(unsafe.Pointer(t + 1)) |= int8((int32((*Subre)(unsafe.Pointer(t)).Fflags)|int32((*Subre)(unsafe.Pointer((*Subre)(unsafe.Pointer(t)).Fright)).Fflags))&libc.CplInt32(NOPROP) | (int32((*Subre)(unsafe.Pointer(t)).Fflags)|int32((*Subre)(unsafe.Pointer((*Subre)(unsafe.Pointer(t)).Fright)).Fflags))<<2&((int32((*Subre)(unsafe.Pointer(t)).Fflags)|int32((*Subre)(unsafe.Pointer((*Subre)(unsafe.Pointer(t)).Fright)).Fflags))<<1)&MIXED | func() int32 {
		if int32((*Subre)(unsafe.Pointer(t)).Fflags)&NOPROP != 0 {
			return int32((*Subre)(unsafe.Pointer(t)).Fflags) & NOPROP
		}
		return int32((*Subre)(unsafe.Pointer((*Subre)(unsafe.Pointer(t)).Fright)).Fflags) & NOPROP
	}())
	*(*int8)(unsafe.Pointer(top + 1)) |= int8((int32((*Subre)(unsafe.Pointer(top)).Fflags)|int32((*Subre)(unsafe.Pointer(t)).Fflags))&libc.CplInt32(NOPROP) | (int32((*Subre)(unsafe.Pointer(top)).Fflags)|int32((*Subre)(unsafe.Pointer(t)).Fflags))<<2&((int32((*Subre)(unsafe.Pointer(top)).Fflags)|int32((*Subre)(unsafe.Pointer(t)).Fflags))<<1)&MIXED | func() int32 {
		if int32((*Subre)(unsafe.Pointer(top)).Fflags)&NOPROP != 0 {
			return int32((*Subre)(unsafe.Pointer(top)).Fflags) & NOPROP
		}
		return int32((*Subre)(unsafe.Pointer(t)).Fflags) & NOPROP
	}())
}

//
//  - nonword - generate arcs for non-word-character ahead or behind
//  ^ static void nonword(struct vars *, int, struct state *, struct state *);
//
func nonword(tls *libc.TLS, v uintptr, dir int32, lp uintptr, rp uintptr) { /* regcomp.c:1282:1: */
	var anchor int32
	if dir == 'a' {
		anchor = '$'
	} else {
		anchor = '^'
	}

	newarc(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, anchor, 1, lp, rp)
	newarc(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, anchor, 0, lp, rp)
	colorcomplement(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcm, dir, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fwordchrs, lp, rp)
	// (no need for special attention to \n)
}

//
//  - word - generate arcs for word character ahead or behind
//  ^ static void word(struct vars *, int, struct state *, struct state *);
//
func word(tls *libc.TLS, v uintptr, dir int32, lp uintptr, rp uintptr) { /* regcomp.c:1302:1: */

	cloneouts(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fwordchrs, lp, rp, dir)
	// (no need for special attention to \n)
}

//
//  - scannum - scan a number
//  ^ static int scannum(struct vars *);
//
func scannum(tls *libc.TLS, v uintptr) int32 { /* regcomp.c:1318:1: */
	var n int32 = 0

	for (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == 'd' && n < X_POSIX2_RE_DUP_MAX {
		n = n*10 + int32((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnextvalue)
		next(tls, v)
	}
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == 'd' || n > X_POSIX2_RE_DUP_MAX {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_BADBR
		}()
		return 0
	}
	return n
}

//
//  - repeat - replicate subNFA for quantifiers
//  * The sub-NFA strung from lp to rp is modified to represent m to n
//  * repetitions of its initial contents.
//  * The duplication sequences used here are chosen carefully so that any
//  * pointers starting out pointing into the subexpression end up pointing into
//  * the last occurrence. (Note that it may not be strung between the same left
//  * and right end states, however!) This used to be important for the subRE
//  * tree, although the important bits are now handled by the in-line code in
//  * parse(), and when this is called, it doesn't matter any more.
//  ^ static void repeat(struct vars *, struct state *, struct state *, int, int);
//
func repeat(tls *libc.TLS, v uintptr, lp uintptr, rp uintptr, m int32, n int32) { /* regcomp.c:1347:1: */
	var rm int32 = func() int32 {
		if m == X_POSIX2_RE_DUP_MAX+1 {
			return INF
		}
		return func() int32 {
			if m > 1 {
				return SOME
			}
			return m
		}()
	}()
	var rn int32 = func() int32 {
		if n == X_POSIX2_RE_DUP_MAX+1 {
			return INF
		}
		return func() int32 {
			if n > 1 {
				return SOME
			}
			return n
		}()
	}()
	var s uintptr
	var s2 uintptr

	switch rm*4 + rn {
	case 0*4 + 0:
		delsub(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, lp, rp)
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, lp, rp)
		break
	case 0*4 + 1:
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, lp, rp)
		break
	case 0*4 + SOME:
		repeat(tls, v, lp, rp, 1, n)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, lp, rp)
		break
	case 0*4 + INF:
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		moveouts(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, lp, s)
		moveins(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, rp, s)
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, lp, s)
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, s, rp)
		break
	case 1*4 + 1:
		break
	case 1*4 + SOME:
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		moveouts(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, lp, s)
		dupnfa(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, s, rp, lp, s)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		repeat(tls, v, lp, s, 1, n-1)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, lp, s)
		break
	case 1*4 + INF:
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		s2 = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		moveouts(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, lp, s)
		moveins(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, rp, s2)
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, lp, s)
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, s2, rp)
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'n', 0, s2, s)
		break
	case SOME*4 + SOME:
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		moveouts(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, lp, s)
		dupnfa(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, s, rp, lp, s)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		repeat(tls, v, lp, s, m-1, n-1)
		break
	case SOME*4 + INF:
		s = newstate(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		moveouts(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, lp, s)
		dupnfa(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, s, rp, lp, s)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		repeat(tls, v, lp, s, m-1, n)
		break
	default:
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ASSERT
		}()
		break
	}
}

//
//  - bracket - handle non-complemented bracket expression
//  * Also called from cbracket for complemented bracket expressions.
//  ^ static void bracket(struct vars *, struct state *, struct state *);
//
func bracket(tls *libc.TLS, v uintptr, lp uintptr, rp uintptr) { /* regcomp.c:1433:1: */

	next(tls, v)
	for !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == ']') && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == 'e') {
		brackpart(tls, v, lp, rp)
	}

	okcolors(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcm)
}

//
//  - cbracket - handle complemented bracket expression
//  * We do it by calling bracket() with dummy endpoints, and then complementing
//  * the result. The alternative would be to invoke rainbow(), and then delete
//  * arcs as the b.e. is seen... but that gets messy.
//  ^ static void cbracket(struct vars *, struct state *, struct state *);
//
func cbracket(tls *libc.TLS, v uintptr, lp uintptr, rp uintptr) { /* regcomp.c:1455:1: */
	var left uintptr = newstate(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa)
	var right uintptr = newstate(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa)

	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	bracket(tls, v, left, right)
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_NLSTOP != 0 {
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'p', int32((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnlcolor), left, right)
	}
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	// all outarcs will be ours

	// Easy part of complementing, and all there is to do since the MCCE code
	// was removed.

	colorcomplement(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcm, 'p', left, lp, rp)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	dropstate(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, left)

	freestate(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa, right)
	return
}

//
//  - brackpart - handle one item (or range) within a bracket expression
//  ^ static void brackpart(struct vars *, struct state *, struct state *);
//
func brackpart(tls *libc.TLS, v uintptr, lp uintptr, rp uintptr) { /* regcomp.c:1490:1: */
	bp := tls.Alloc(2)
	defer tls.Free(2)

	var startc Celt
	var endc Celt
	var cv uintptr
	var startp uintptr
	var endp uintptr
	// var c Chr at bp, 2

	// Parse something, get rid of special cases, take shortcuts.

	switch (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype {
	case 'R': // a-b-c or other botch
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ERANGE
		}()
		return
		break
	case 'p':
		*(*Chr)(unsafe.Pointer(bp /* c */)) = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnextvalue
		next(tls, v)

		// Shortcut for ordinary chr (not range).

		if !((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype == 'R') {
			onechr(tls, v, int32(*(*Chr)(unsafe.Pointer(bp /* c */))), lp, rp)
			return
		}
		startc = element(tls, v, bp, bp+uintptr(1)*2)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		break
	case 'I':
		startp = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow
		endp = scanplain(tls, v)
		for ok := true; ok; ok = 0 != 0 {
			if !(startp < endp) {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_ECOLLATE
				}()
			}
		}
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		startc = element(tls, v, startp, endp)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		break
	case 'E':
		startp = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow
		endp = scanplain(tls, v)
		for ok1 := true; ok1; ok1 = 0 != 0 {
			if !(startp < endp) {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_ECOLLATE
				}()
			}
		}
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		startc = element(tls, v, startp, endp)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		cv = eclass(tls, v, startc, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_ICASE)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		dovec(tls, v, cv, lp, rp)
		return
		break
	case 'C':
		startp = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow
		endp = scanplain(tls, v)
		for ok2 := true; ok2; ok2 = 0 != 0 {
			if !(startp < endp) {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_ECTYPE
				}()
			}
		}
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		cv = cclass(tls, v, startp, endp, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_ICASE)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return
			}
		}

		dovec(tls, v, cv, lp, rp)
		return
		break
	default:
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ASSERT
		}()
		return
		break
	}

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == 'R' {
		next(tls, v)
		switch (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype {
		case 'p':
			fallthrough
		case 'R':
			*(*Chr)(unsafe.Pointer(bp /* c */)) = (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue
			next(tls, v)
			endc = element(tls, v, bp, bp+uintptr(1)*2)
			{
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return
				}
			}

			break
			fallthrough
		case 'I':
			startp = (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow
			endp = scanplain(tls, v)
			for ok3 := true; ok3; ok3 = 0 != 0 {
				if !(startp < endp) {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'e'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr = func() int32 {
						if (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr != 0 {
							return (*struct {
								Fre          uintptr
								Fnow         uintptr
								Fstop        uintptr
								Fsavenow     uintptr
								Fsavestop    uintptr
								Ferr         int32
								Fcflags      int32
								Flasttype    int32
								Fnexttype    int32
								Fnextvalue   Chr
								F__ccgo_pad1 [2]byte
								Flexcon      int32
								Fnsubexp     int32
								F__ccgo_pad2 [4]byte
								Fsubs        uintptr
								Fnsubs       Size_t
								Fsub10       [10]uintptr
								Fnfa         uintptr
								Fcm          uintptr
								Fnlcolor     Color
								F__ccgo_pad3 [6]byte
								Fwordchrs    uintptr
								Ftree        uintptr
								Ftreechain   uintptr
								Ftreefree    uintptr
								Fntree       int32
								F__ccgo_pad4 [4]byte
								Fcv          uintptr
								Fcv2         uintptr
								Flacons      uintptr
								Fnlacons     int32
								F__ccgo_pad5 [4]byte
								Fspaceused   Size_t
							})(unsafe.Pointer(v)).Ferr
						}
						return REG_ECOLLATE
					}()
				}
			}
			{
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return
				}
			}

			endc = element(tls, v, startp, endp)
			{
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return
				}
			}

			break
			fallthrough
		default:
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_ERANGE
			}()
			return
			break
		}
	} else {
		endc = startc
	}

	// Ranges are unportable. Actually, standard C does guarantee that digits
	// are contiguous, but making that an exception is just too complicated.

	if startc != endc {
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNPORT)
	}
	cv = range1(tls, v, startc, endc, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_ICASE)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	dovec(tls, v, cv, lp, rp)
}

//
//  - scanplain - scan PLAIN contents of [. etc.
//  * Certain bits of trickery in lex.c know that this code does not try to look
//  * past the final bracket of the [. etc.
//  ^ static const chr *scanplain(struct vars *);
//
func scanplain(tls *libc.TLS, v uintptr) uintptr { /* regcomp.c:1606:18: */
	var endp uintptr

	next(tls, v)

	endp = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow
	for (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == 'p' {
		endp = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow
		next(tls, v)
	}

	next(tls, v)

	return endp
}

//
//  - onechr - fill in arcs for a plain character, and possible case complements
//  * This is mostly a shortcut for efficient handling of the common case.
//  ^ static void onechr(struct vars *, pchr, struct state *, struct state *);
//
func onechr(tls *libc.TLS, v uintptr, c Pchr, lp uintptr, rp uintptr) { /* regcomp.c:1633:1: */
	if !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_ICASE != 0) {
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'p', int32(subcolor(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcm, c)), lp, rp)
		return
	}

	// Rats, need general case anyway...

	dovec(tls, v, allcases(tls, v, c), lp, rp)
}

//
//  - dovec - fill in arcs for each element of a cvec
//  ^ static void dovec(struct vars *, struct cvec *, struct state *,
//  ^ 	struct state *);
//
func dovec(tls *libc.TLS, v uintptr, cv uintptr, lp uintptr, rp uintptr) { /* regcomp.c:1657:1: */
	var ch Chr
	var from Chr
	var to Chr
	var p uintptr
	var i int32

	p = (*Cvec)(unsafe.Pointer(cv)).Fchrs
	i = (*Cvec)(unsafe.Pointer(cv)).Fnchrs
__1:
	if !(i > 0) {
		goto __3
	}
	{
		ch = *(*Chr)(unsafe.Pointer(p))
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'p', int32(subcolor(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcm, int32(ch))), lp, rp)

	}
	goto __2
__2:
	p += 2
	i--
	goto __1
	goto __3
__3:
	;

	p = (*Cvec)(unsafe.Pointer(cv)).Franges
	i = (*Cvec)(unsafe.Pointer(cv)).Fnranges
__4:
	if !(i > 0) {
		goto __6
	}
	{
		from = *(*Chr)(unsafe.Pointer(p))
		to = *(*Chr)(unsafe.Pointer(p + uintptr(1)*2))
		if int32(from) <= int32(to) {
			subrange(tls, v, int32(from), int32(to), lp, rp)
		}

	}
	goto __5
__5:
	p += 2 * uintptr(2)
	i--
	goto __4
	goto __6
__6:
}

//
//  - wordchrs - set up word-chr list for word-boundary stuff, if needed
//  * The list is kept as a bunch of arcs between two dummy states; it's disposed
//  * of by the unreachable-states sweep in NFA optimization. Does NEXT(). Must
//  * not be called from any unusual lexical context. This should be reconciled
//  * with the \w etc. handling in lex.c, and should be cleaned up to reduce
//  * dependencies on input scanning.
//  ^ static void wordchrs(struct vars *);
//
func wordchrs(tls *libc.TLS, v uintptr) { /* regcomp.c:1692:1: */
	var left uintptr
	var right uintptr

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fwordchrs != uintptr(0) {
		next(tls, v) // for consistency
		return
	}

	left = newstate(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa)
	right = newstate(tls, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	// Fine point: implemented with [::], and lexer will set REG_ULOCALE.

	lexword(tls, v)
	next(tls, v)

	bracket(tls, v, left, right)

	next(tls, v)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fwordchrs = left
}

//
//  - subre - allocate a subre
//  ^ static struct subre *subre(struct vars *, int, int, struct state *,
//  ^	struct state *);
//
func subre(tls *libc.TLS, v uintptr, op int32, flags int32, begin uintptr, end uintptr) uintptr { /* regcomp.c:1725:21: */
	var ret uintptr = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftreefree

	if ret != uintptr(0) {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ftreefree = (*Subre)(unsafe.Pointer(ret)).Fleft
	} else {
		ret = XTclpAlloc(tls, uint32(unsafe.Sizeof(Subre{})))
		if ret == uintptr(0) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_ESPACE
			}()
			return uintptr(0)
		}
		(*Subre)(unsafe.Pointer(ret)).Fchain = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ftreechain
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ftreechain = ret
	}

	(*Subre)(unsafe.Pointer(ret)).Fop = int8(op)
	(*Subre)(unsafe.Pointer(ret)).Fflags = int8(flags)
	(*Subre)(unsafe.Pointer(ret)).Fid = int16(0) // will be assigned later
	(*Subre)(unsafe.Pointer(ret)).Fsubno = 0
	(*Subre)(unsafe.Pointer(ret)).Fmin = libc.AssignPtrInt16(ret+10, int16(1))
	(*Subre)(unsafe.Pointer(ret)).Fleft = uintptr(0)
	(*Subre)(unsafe.Pointer(ret)).Fright = uintptr(0)
	(*Subre)(unsafe.Pointer(ret)).Fbegin = begin
	(*Subre)(unsafe.Pointer(ret)).Fend = end
	(*Subre)(unsafe.Pointer(ret)).Fcnfa.Fnstates = 0

	return ret
}

//
//  - freesubre - free a subRE subtree
//  ^ static void freesubre(struct vars *, struct subre *);
//
func freesubre(tls *libc.TLS, v uintptr, sr uintptr) { /* regcomp.c:1768:1: */
	if sr == uintptr(0) {
		return
	}

	if (*Subre)(unsafe.Pointer(sr)).Fleft != uintptr(0) {
		freesubre(tls, v, (*Subre)(unsafe.Pointer(sr)).Fleft)
	}
	if (*Subre)(unsafe.Pointer(sr)).Fright != uintptr(0) {
		freesubre(tls, v, (*Subre)(unsafe.Pointer(sr)).Fright)
	}

	freesrnode(tls, v, sr)
}

//
//  - freesrnode - free one node in a subRE subtree
//  ^ static void freesrnode(struct vars *, struct subre *);
//
func freesrnode(tls *libc.TLS, v uintptr, sr uintptr) { /* regcomp.c:1791:1: */
	if sr == uintptr(0) {
		return
	}

	if !((*Subre)(unsafe.Pointer(sr)).Fcnfa.Fnstates == 0) {
		freecnfa(tls, sr+48)
	}
	(*Subre)(unsafe.Pointer(sr)).Fflags = int8(0)

	if v != uintptr(0) && (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftreechain != uintptr(0) {
		// we're still parsing, maybe we can reuse the subre
		(*Subre)(unsafe.Pointer(sr)).Fleft = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ftreefree
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ftreefree = sr
	} else {
		XTclpFree(tls, sr)
	}
}

//
//  - numst - number tree nodes (assigning "id" indexes)
//  ^ static int numst(struct subre *, int);
//
func numst(tls *libc.TLS, t uintptr, start int32) int32 { /* regcomp.c:1818:1: */
	var i int32

	i = start
	(*Subre)(unsafe.Pointer(t)).Fid = int16(libc.PostIncInt32(&i, 1))
	if (*Subre)(unsafe.Pointer(t)).Fleft != uintptr(0) {
		i = numst(tls, (*Subre)(unsafe.Pointer(t)).Fleft, i)
	}
	if (*Subre)(unsafe.Pointer(t)).Fright != uintptr(0) {
		i = numst(tls, (*Subre)(unsafe.Pointer(t)).Fright, i)
	}
	return i
}

//
//  - markst - mark tree nodes as INUSE
//  * Note: this is a great deal more subtle than it looks.  During initial
//  * parsing of a regex, all subres are linked into the treechain list;
//  * discarded ones are also linked into the treefree list for possible reuse.
//  * After we are done creating all subres required for a regex, we run markst()
//  * then cleanst(), which results in discarding all subres not reachable from
//  * v->tree.  We then clear v->treechain, indicating that subres must be found
//  * by descending from v->tree.  This changes the behavior of freesubre(): it
//  * will henceforth FREE() unwanted subres rather than sticking them into the
//  * treefree list.  (Doing that any earlier would result in dangling links in
//  * the treechain list.)  This all means that freev() will clean up correctly
//  * if invoked before or after markst()+cleanst(); but it would not work if
//  * called partway through this state conversion, so we mustn't error out
//  * in or between these two functions.
//  ^ static void markst(struct subre *);
//
func markst(tls *libc.TLS, t uintptr) { /* regcomp.c:1855:1: */

	*(*int8)(unsafe.Pointer(t + 1)) |= int8(INUSE)
	if (*Subre)(unsafe.Pointer(t)).Fleft != uintptr(0) {
		markst(tls, (*Subre)(unsafe.Pointer(t)).Fleft)
	}
	if (*Subre)(unsafe.Pointer(t)).Fright != uintptr(0) {
		markst(tls, (*Subre)(unsafe.Pointer(t)).Fright)
	}
}

//
//  - cleanst - free any tree nodes not marked INUSE
//  ^ static void cleanst(struct vars *);
//
func cleanst(tls *libc.TLS, v uintptr) { /* regcomp.c:1874:1: */
	var t uintptr
	var next uintptr

	for t = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftreechain; t != uintptr(0); t = next {
		next = (*Subre)(unsafe.Pointer(t)).Fchain
		if !(int32((*Subre)(unsafe.Pointer(t)).Fflags)&INUSE != 0) {
			XTclpFree(tls, t)
		}
	}
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftreechain = uintptr(0)
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ftreefree = uintptr(0) // just on general principles
}

//
//  - nfatree - turn a subRE subtree into a tree of compacted NFAs
//  ^ static long nfatree(struct vars *, struct subre *, FILE *);
//
func nfatree(tls *libc.TLS, v uintptr, t uintptr, f uintptr) int64 { /* regcomp.c:1895:1: */

	if (*Subre)(unsafe.Pointer(t)).Fleft != uintptr(0) {
		nfatree(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft, f)
	}
	if (*Subre)(unsafe.Pointer(t)).Fright != uintptr(0) {
		nfatree(tls, v, (*Subre)(unsafe.Pointer(t)).Fright, f)
	}

	return nfanode(tls, v, t, f)
}

//
//  - nfanode - do one NFA for nfatree
//  ^ static long nfanode(struct vars *, struct subre *, FILE *);
//
func nfanode(tls *libc.TLS, v uintptr, t uintptr, f uintptr) int64 { /* regcomp.c:1917:1: */
	bp := tls.Alloc(58)
	defer tls.Free(58)

	var nfa uintptr
	var ret int64 = int64(0)
	// var idbuf [50]int8 at bp+8, 50

	if f != uintptr(0) {
		libc.Xfprintf(tls, f, ts+192,
			libc.VaList(bp, stid(tls, t, bp+8, uint64(unsafe.Sizeof([50]int8{})))))
	}
	nfa = newnfa(tls, v, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcm, (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnfa)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return int64(0)
		}
	}

	dupnfa(tls, nfa, (*Subre)(unsafe.Pointer(t)).Fbegin, (*Subre)(unsafe.Pointer(t)).Fend, (*Nfa)(unsafe.Pointer(nfa)).Finit, (*Nfa)(unsafe.Pointer(nfa)).Ffinal)
	if !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr != 0) {
		specialcolors(tls, nfa)
		ret = optimize(tls, nfa, f)
	}
	if !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr != 0) {
		compact(tls, nfa, t+48)
	}

	freenfa(tls, nfa)
	return ret
}

//
//  - newlacon - allocate a lookahead-constraint subRE
//  ^ static int newlacon(struct vars *, struct state *, struct state *, int);
//
func newlacon(tls *libc.TLS, v uintptr, begin uintptr, end uintptr, pos int32) int32 { /* regcomp.c:1952:1: */
	var n int32
	var newlacons uintptr
	var sub uintptr

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnlacons == 0 {
		n = 1 // skip 0th
		newlacons = XTclpAlloc(tls, uint32(uint64(2)*uint64(unsafe.Sizeof(Subre{}))))
	} else {
		n = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnlacons
		newlacons = XTclpRealloc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flacons, uint32(uint64(n+1)*uint64(unsafe.Sizeof(Subre{}))))
	}

	if newlacons == uintptr(0) {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ESPACE
		}()
		return 0
	}

	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Flacons = newlacons
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnlacons = n + 1
	sub = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Flacons + uintptr(n)*112
	(*Subre)(unsafe.Pointer(sub)).Fbegin = begin
	(*Subre)(unsafe.Pointer(sub)).Fend = end
	(*Subre)(unsafe.Pointer(sub)).Fsubno = pos
	(*Subre)(unsafe.Pointer(sub)).Fcnfa.Fnstates = 0
	return n
}

//
//  - freelacons - free lookahead-constraint subRE vector
//  ^ static void freelacons(struct subre *, int);
//
func freelacons(tls *libc.TLS, subs uintptr, n int32) { /* regcomp.c:1991:1: */
	var sub uintptr
	var i int32

	sub = subs + uintptr(1)*112
	i = n - 1
__1:
	if !(i > 0) {
		goto __3
	}
	{ // no 0th
		if !((*Subre)(unsafe.Pointer(sub)).Fcnfa.Fnstates == 0) {
			freecnfa(tls, sub+48)
		}

	}
	goto __2
__2:
	sub += 112
	i--
	goto __1
	goto __3
__3:
	;
	XTclpFree(tls, subs)
}

//
//  - rfree - free a whole RE (insides of regfree)
//  ^ static void rfree(regex_t *);
//
func rfree(tls *libc.TLS, re uintptr) { /* regcomp.c:2012:1: */
	var g uintptr

	if re == uintptr(0) || (*Regex_t)(unsafe.Pointer(re)).Fre_magic != REMAGIC {
		return
	}

	(*Regex_t)(unsafe.Pointer(re)).Fre_magic = 0 // invalidate RE
	g = (*Regex_t)(unsafe.Pointer(re)).Fre_guts
	(*Regex_t)(unsafe.Pointer(re)).Fre_guts = uintptr(0)
	(*Regex_t)(unsafe.Pointer(re)).Fre_fns = uintptr(0)
	if g != uintptr(0) {
		(*Guts)(unsafe.Pointer(g)).Fmagic = 0
		freecm(tls, g+96)
		if (*Guts)(unsafe.Pointer(g)).Ftree != uintptr(0) {
			freesubre(tls, uintptr(0), (*Guts)(unsafe.Pointer(g)).Ftree)
		}
		if (*Guts)(unsafe.Pointer(g)).Flacons != uintptr(0) {
			freelacons(tls, (*Guts)(unsafe.Pointer(g)).Flacons, (*Guts)(unsafe.Pointer(g)).Fnlacons)
		}
		if !((*Guts)(unsafe.Pointer(g)).Fsearch.Fnstates == 0) {
			freecnfa(tls, g+32)
		}
		XTclpFree(tls, g)
	}
}

//
//  - dump - dump an RE in human-readable form
//  ^ static void dump(regex_t *, FILE *);
//
func dump(tls *libc.TLS, re uintptr, f uintptr) { /* regcomp.c:2046:1: */
	_ = re
	_ = f
}

//
//  - dumpst - dump a subRE tree
//  ^ static void dumpst(struct subre *, FILE *, int);
//
func dumpst(tls *libc.TLS, t uintptr, f uintptr, nfapresent int32) { /* regcomp.c:2095:1: */
	if t == uintptr(0) {
		libc.Xfprintf(tls, f, ts+230, 0)
	} else {
		stdump(tls, t, f, nfapresent)
	}
	libc.Xfflush(tls, f)
}

//
//  - stdump - recursive guts of dumpst
//  ^ static void stdump(struct subre *, FILE *, int);
//
func stdump(tls *libc.TLS, t uintptr, f uintptr, nfapresent int32) { /* regcomp.c:2113:1: */
	bp := tls.Alloc(122)
	defer tls.Free(122)

	// var idbuf [50]int8 at bp+72, 50

	libc.Xfprintf(tls, f, ts+241, libc.VaList(bp, stid(tls, t, bp+72, uint64(unsafe.Sizeof([50]int8{}))), int32((*Subre)(unsafe.Pointer(t)).Fop)))
	if int32((*Subre)(unsafe.Pointer(t)).Fflags)&LONGER != 0 {
		libc.Xfprintf(tls, f, ts+250, 0)
	}
	if int32((*Subre)(unsafe.Pointer(t)).Fflags)&SHORTER != 0 {
		libc.Xfprintf(tls, f, ts+259, 0)
	}
	if int32((*Subre)(unsafe.Pointer(t)).Fflags)&MIXED != 0 {
		libc.Xfprintf(tls, f, ts+269, 0)
	}
	if int32((*Subre)(unsafe.Pointer(t)).Fflags)&CAP != 0 {
		libc.Xfprintf(tls, f, ts+279, 0)
	}
	if int32((*Subre)(unsafe.Pointer(t)).Fflags)&BACKR != 0 {
		libc.Xfprintf(tls, f, ts+291, 0)
	}
	if !(int32((*Subre)(unsafe.Pointer(t)).Fflags)&INUSE != 0) {
		libc.Xfprintf(tls, f, ts+303, 0)
	}
	if (*Subre)(unsafe.Pointer(t)).Fsubno != 0 {
		libc.Xfprintf(tls, f, ts+311, libc.VaList(bp+16, (*Subre)(unsafe.Pointer(t)).Fsubno))
	}
	if int32((*Subre)(unsafe.Pointer(t)).Fmin) != 1 || int32((*Subre)(unsafe.Pointer(t)).Fmax) != 1 {
		libc.Xfprintf(tls, f, ts+318, libc.VaList(bp+24, int32((*Subre)(unsafe.Pointer(t)).Fmin)))
		if int32((*Subre)(unsafe.Pointer(t)).Fmax) != X_POSIX2_RE_DUP_MAX+1 {
			libc.Xfprintf(tls, f, ts+324, libc.VaList(bp+32, int32((*Subre)(unsafe.Pointer(t)).Fmax)))
		}
		libc.Xfprintf(tls, f, ts+327, 0)
	}
	if nfapresent != 0 {
		libc.Xfprintf(tls, f, ts+329, libc.VaList(bp+40, int64((*State)(unsafe.Pointer((*Subre)(unsafe.Pointer(t)).Fbegin)).Fno), int64((*State)(unsafe.Pointer((*Subre)(unsafe.Pointer(t)).Fend)).Fno)))
	}
	if (*Subre)(unsafe.Pointer(t)).Fleft != uintptr(0) {
		libc.Xfprintf(tls, f, ts+338, libc.VaList(bp+56, stid(tls, (*Subre)(unsafe.Pointer(t)).Fleft, bp+72, uint64(unsafe.Sizeof([50]int8{})))))
	}
	if (*Subre)(unsafe.Pointer(t)).Fright != uintptr(0) {
		libc.Xfprintf(tls, f, ts+344, libc.VaList(bp+64, stid(tls, (*Subre)(unsafe.Pointer(t)).Fright, bp+72, uint64(unsafe.Sizeof([50]int8{})))))
	}
	if !((*Subre)(unsafe.Pointer(t)).Fcnfa.Fnstates == 0) {
		libc.Xfprintf(tls, f, ts+350, 0)
		dumpcnfa(tls, t+48, f)
	}
	libc.Xfprintf(tls, f, ts+350, 0)
	if (*Subre)(unsafe.Pointer(t)).Fleft != uintptr(0) {
		stdump(tls, (*Subre)(unsafe.Pointer(t)).Fleft, f, nfapresent)
	}
	if (*Subre)(unsafe.Pointer(t)).Fright != uintptr(0) {
		stdump(tls, (*Subre)(unsafe.Pointer(t)).Fright, f, nfapresent)
	}
}

//
//  - stid - identify a subtree node for dumping
//  ^ static const char *stid(struct subre *, char *, size_t);
//
func stid(tls *libc.TLS, t uintptr, buf uintptr, bufsize Size_t) uintptr { /* regcomp.c:2175:19: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// Big enough for hex int or decimal t->id?

	if bufsize < uint64(unsafe.Sizeof(uintptr(0)))*uint64(2)+uint64(3) || bufsize < uint64(unsafe.Sizeof(int16(0)))*uint64(3)+uint64(1) {
		return ts + 352 /* "unable" */
	}
	if int32((*Subre)(unsafe.Pointer(t)).Fid) != 0 {
		libc.Xsprintf(tls, buf, ts+324, libc.VaList(bp, int32((*Subre)(unsafe.Pointer(t)).Fid)))
	} else {
		libc.Xsprintf(tls, buf, ts+359, libc.VaList(bp+8, t))
	}
	return buf
}

// lexical analyzer
// This file is #included by regcomp.c.
//
// Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.
//
// Development of this software was funded, in part, by Cray Research Inc.,
// UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
// Corporation, none of whom are responsible for the results.  The author
// thanks all of them.
//
// Redistribution and use in source and binary forms -- with or without
// modification -- are permitted for any purpose, provided that
// redistributions in source form retain this entire copyright notice and
// indicate the origin and nature of any modifications.
//
// I'd appreciate being given credit for this package in the documentation of
// software which uses it, but that is not a requirement.
//
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
// HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// scanning macros (know about v)

// lexical contexts

// construct pointer past end of chr array

//
//  - lexstart - set up lexical stuff, scan leading options
//  ^ static void lexstart(struct vars *);
//
func lexstart(tls *libc.TLS, v uintptr) { /* regc_lex.c:69:1: */
	prefixes(tls, v) /* may turn on new type bits etc. */
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return
		}
	}

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_QUOTE != 0 {

		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flexcon = L_Q
	} else if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_EXTENDED != 0 {

		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flexcon = L_ERE
	} else {

		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flexcon = L_BRE
	}

	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype = 'n' // remember we were at the start
	next(tls, v) // set up the first token
}

//
//  - prefixes - implement various special prefixes
//  ^ static void prefixes(struct vars *);
//
func prefixes(tls *libc.TLS, v uintptr) { /* regc_lex.c:95:1: */
	// Literal string doesn't get any of this stuff.

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_QUOTE != 0 {
		return
	}

	// Initial "***" gets special things.

	if (int64((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fstop)-int64((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow))/2 >= int64(4) && ((int64((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fstop)-int64((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow))/2 >= int64(3) && int32(*(*Chr)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow))) == int32(uint8('*')) && int32(*(*Chr)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow + uintptr(1)*2))) == int32(uint8('*')) && int32(*(*Chr)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow + uintptr(2)*2))) == int32(uint8('*'))) {
		switch int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(3)*2))) {
		case int32(uint8('?')):
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_BADPAT
			}()
			return // proceed no further
			break
			fallthrough
		case int32(uint8('=')):
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
			*(*int32)(unsafe.Pointer(v + 44)) |= REG_QUOTE
			*(*int32)(unsafe.Pointer(v + 44)) &= libc.CplInt32(REG_ADVANCED | REG_EXPANDED | REG_NEWLINE)
			*(*uintptr)(unsafe.Pointer(v + 8)) += uintptr(4) * 2
			return // and there can be no more prefixes
			break
			fallthrough
		case int32(uint8(':')):
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
			*(*int32)(unsafe.Pointer(v + 44)) |= REG_ADVANCED
			*(*uintptr)(unsafe.Pointer(v + 8)) += uintptr(4) * 2
			break
			fallthrough
		default: // otherwise *** is just an error
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_BADRPT
			}()
			return
			break
		}
	}

	// BREs and EREs don't get embedded options.

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_ADVANCED != REG_ADVANCED {
		return
	}

	// Embedded options (AREs only).

	if (int64((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fstop)-int64((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow))/2 >= int64(3) && ((int64((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fstop)-int64((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow))/2 >= int64(2) && int32(*(*Chr)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow))) == int32(uint8('(')) && int32(*(*Chr)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow + uintptr(1)*2))) == int32(uint8('?'))) && XTcl_UniCharIsAlpha(tls, int32(*(*Chr)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow + uintptr(2)*2)))) != 0 {
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
		*(*uintptr)(unsafe.Pointer(v + 8)) += uintptr(2) * 2
		for ; !((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && XTcl_UniCharIsAlpha(tls, int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow)))) != 0; (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow += 2 {
			switch int32(*(*Chr)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow))) {
			case int32(uint8('b')):
				*(*int32)(unsafe.Pointer(v + 44)) &= libc.CplInt32(REG_ADVANCED | REG_QUOTE)
				break
				fallthrough
			case int32(uint8('c')):
				*(*int32)(unsafe.Pointer(v + 44)) &= libc.CplInt32(REG_ICASE)
				break
				fallthrough
			case int32(uint8('e')):
				*(*int32)(unsafe.Pointer(v + 44)) |= REG_EXTENDED
				*(*int32)(unsafe.Pointer(v + 44)) &= libc.CplInt32(REG_ADVF | REG_QUOTE)
				break
				fallthrough
			case int32(uint8('i')):
				*(*int32)(unsafe.Pointer(v + 44)) |= REG_ICASE
				break
				fallthrough
			case int32(uint8('m')):
				fallthrough // Perloid synonym for n
			case int32(uint8('n')):
				*(*int32)(unsafe.Pointer(v + 44)) |= REG_NEWLINE
				break
				fallthrough
			case int32(uint8('p')):
				*(*int32)(unsafe.Pointer(v + 44)) |= REG_NLSTOP
				*(*int32)(unsafe.Pointer(v + 44)) &= libc.CplInt32(REG_NLANCH)
				break
				fallthrough
			case int32(uint8('q')):
				*(*int32)(unsafe.Pointer(v + 44)) |= REG_QUOTE
				*(*int32)(unsafe.Pointer(v + 44)) &= libc.CplInt32(REG_ADVANCED)
				break
				fallthrough
			case int32(uint8('s')):
				*(*int32)(unsafe.Pointer(v + 44)) &= libc.CplInt32(REG_NEWLINE)
				break
				fallthrough
			case int32(uint8('t')):
				*(*int32)(unsafe.Pointer(v + 44)) &= libc.CplInt32(REG_EXPANDED)
				break
				fallthrough
			case int32(uint8('w')):
				*(*int32)(unsafe.Pointer(v + 44)) &= libc.CplInt32(REG_NLSTOP)
				*(*int32)(unsafe.Pointer(v + 44)) |= REG_NLANCH
				break
				fallthrough
			case int32(uint8('x')):
				*(*int32)(unsafe.Pointer(v + 44)) |= REG_EXPANDED
				break
				fallthrough
			default:
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_BADOPT
				}()
				return
			}
		}
		if !(!((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) == int32(uint8(')'))) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_BADOPT
			}()
			return
		}
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow += 2
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_QUOTE != 0 {
			*(*int32)(unsafe.Pointer(v + 44)) &= libc.CplInt32(REG_EXPANDED | REG_NEWLINE)
		}
	}
}

//
//  - lexnest - "call a subroutine", interpolating string at the lexical level
//  * Note, this is not a very general facility.  There are a number of
//  * implicit assumptions about what sorts of strings can be subroutines.
//  ^ static void lexnest(struct vars *, const chr *, const chr *);
//
func lexnest(tls *libc.TLS, v uintptr, beginp uintptr, endp uintptr) { /* regc_lex.c:213:1: */
	// only one level of nesting
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fsavenow = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fsavestop = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fstop
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow = beginp
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fstop = endp
}

// string constants to interpolate as expansions of things like \d

var backd = [11]Chr{ // \d
	Chr(uint8('[')), Chr(uint8('[')), Chr(uint8(':')),
	Chr(uint8('d')), Chr(uint8('i')), Chr(uint8('g')), Chr(uint8('i')), Chr(uint8('t')),
	Chr(uint8(':')), Chr(uint8(']')), Chr(uint8(']')),
}                    /* regc_lex.c:229:18 */
var backD = [12]Chr{ // \D
	Chr(uint8('[')), Chr(uint8('^')), Chr(uint8('[')), Chr(uint8(':')),
	Chr(uint8('d')), Chr(uint8('i')), Chr(uint8('g')), Chr(uint8('i')), Chr(uint8('t')),
	Chr(uint8(':')), Chr(uint8(']')), Chr(uint8(']')),
}                     /* regc_lex.c:234:18 */
var brbackd = [9]Chr{ // \d within brackets
	Chr(uint8('[')), Chr(uint8(':')),
	Chr(uint8('d')), Chr(uint8('i')), Chr(uint8('g')), Chr(uint8('i')), Chr(uint8('t')),
	Chr(uint8(':')), Chr(uint8(']')),
}                    /* regc_lex.c:239:18 */
var backs = [11]Chr{ // \s
	Chr(uint8('[')), Chr(uint8('[')), Chr(uint8(':')),
	Chr(uint8('s')), Chr(uint8('p')), Chr(uint8('a')), Chr(uint8('c')), Chr(uint8('e')),
	Chr(uint8(':')), Chr(uint8(']')), Chr(uint8(']')),
}                    /* regc_lex.c:244:18 */
var backS = [12]Chr{ // \S
	Chr(uint8('[')), Chr(uint8('^')), Chr(uint8('[')), Chr(uint8(':')),
	Chr(uint8('s')), Chr(uint8('p')), Chr(uint8('a')), Chr(uint8('c')), Chr(uint8('e')),
	Chr(uint8(':')), Chr(uint8(']')), Chr(uint8(']')),
}                     /* regc_lex.c:249:18 */
var brbacks = [9]Chr{ // \s within brackets
	Chr(uint8('[')), Chr(uint8(':')),
	Chr(uint8('s')), Chr(uint8('p')), Chr(uint8('a')), Chr(uint8('c')), Chr(uint8('e')),
	Chr(uint8(':')), Chr(uint8(']')),
} /* regc_lex.c:254:18 */

var backw = [21]Chr{ // \w
	Chr(uint8('[')), Chr(uint8('[')), Chr(uint8(':')),
	Chr(uint8('a')), Chr(uint8('l')), Chr(uint8('n')), Chr(uint8('u')), Chr(uint8('m')),
	Chr(uint8(':')), Chr(uint8(']')), Chr(uint8('_')), Chr(0x203F) /* UNDERTIE */, Chr(0x2040) /* CHARACTER TIE */, Chr(0x2054) /* INVERTED UNDERTIE */, Chr(0xFE33) /* PRESENTATION FORM FOR VERTICAL LOW LINE */, Chr(0xFE34) /* PRESENTATION FORM FOR VERTICAL WAVY LOW LINE */, Chr(0xFE4D) /* DASHED LOW LINE */, Chr(0xFE4E) /* CENTRELINE LOW LINE */, Chr(0xFE4F) /* WAVY LOW LINE */, Chr(0xFF3F), Chr(uint8(']')),
}                    /* regc_lex.c:272:18 */
var backW = [22]Chr{ // \W
	Chr(uint8('[')), Chr(uint8('^')), Chr(uint8('[')), Chr(uint8(':')),
	Chr(uint8('a')), Chr(uint8('l')), Chr(uint8('n')), Chr(uint8('u')), Chr(uint8('m')),
	Chr(uint8(':')), Chr(uint8(']')), Chr(uint8('_')), Chr(0x203F) /* UNDERTIE */, Chr(0x2040) /* CHARACTER TIE */, Chr(0x2054) /* INVERTED UNDERTIE */, Chr(0xFE33) /* PRESENTATION FORM FOR VERTICAL LOW LINE */, Chr(0xFE34) /* PRESENTATION FORM FOR VERTICAL WAVY LOW LINE */, Chr(0xFE4D) /* DASHED LOW LINE */, Chr(0xFE4E) /* CENTRELINE LOW LINE */, Chr(0xFE4F) /* WAVY LOW LINE */, Chr(0xFF3F), Chr(uint8(']')),
}                      /* regc_lex.c:277:18 */
var brbackw = [19]Chr{ // \w within brackets
	Chr(uint8('[')), Chr(uint8(':')),
	Chr(uint8('a')), Chr(uint8('l')), Chr(uint8('n')), Chr(uint8('u')), Chr(uint8('m')),
	Chr(uint8(':')), Chr(uint8(']')), Chr(uint8('_')), Chr(0x203F) /* UNDERTIE */, Chr(0x2040) /* CHARACTER TIE */, Chr(0x2054) /* INVERTED UNDERTIE */, Chr(0xFE33) /* PRESENTATION FORM FOR VERTICAL LOW LINE */, Chr(0xFE34) /* PRESENTATION FORM FOR VERTICAL WAVY LOW LINE */, Chr(0xFE4D) /* DASHED LOW LINE */, Chr(0xFE4E) /* CENTRELINE LOW LINE */, Chr(0xFE4F) /* WAVY LOW LINE */, Chr(0xFF3F),
} /* regc_lex.c:282:18 */

//
//  - lexword - interpolate a bracket expression for word characters
//  * Possibly ought to inquire whether there is a "word" character class.
//  ^ static void lexword(struct vars *);
//
func lexword(tls *libc.TLS, v uintptr) { /* regc_lex.c:294:1: */
	lexnest(tls, v, uintptr(unsafe.Pointer(&backw)), uintptr(unsafe.Pointer(&backw))+uintptr(uint64(unsafe.Sizeof(backw))/uint64(unsafe.Sizeof(Chr(0))))*2)
}

//
//  - next - get next token
//  ^ static int next(struct vars *);
//
func next(tls *libc.TLS, v uintptr) int32 { /* regc_lex.c:305:1: */
	var c Chr

	// Errors yield an infinite sequence of failures.

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr != 0 {
		return 0 // the error has set nexttype to EOS
	}

	// Remember flavor of last token.

	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Flasttype = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype

	// REG_BOSONLY

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == 'n' && (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_BOSONLY != 0 {
		// at start of a REG_BOSONLY RE
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'A'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
			return 1
		}() // same as \A
	}

	// If we're nested and we've hit end, return to outer level.

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fsavenow != uintptr(0) && (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow >= (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fstop {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fsavenow
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fsavestop
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fsavenow = libc.AssignPtrUintptr(v+32, uintptr(0))
	}

	// Skip white space etc. if appropriate (not in literal or [])

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_EXPANDED != 0 {
		switch (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flexcon {
		case L_ERE:
			fallthrough
		case L_BRE:
			fallthrough
		case L_EBND:
			fallthrough
		case L_BBND:
			skip(tls, v)
			break
		}
	}

	// Handle EOS, depending on context.

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow >= (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fstop {
		switch (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flexcon {
		case L_ERE:
			fallthrough
		case L_BRE:
			fallthrough
		case L_Q:
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				return 1
			}()
			break
			fallthrough
		case L_EBND:
			fallthrough
		case L_BBND:
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_EBRACE
				}()
				return 0
			}()
			break
			fallthrough
		case L_BRACK:
			fallthrough
		case L_CEL:
			fallthrough
		case L_ECL:
			fallthrough
		case L_CCL:
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_EBRACK
				}()
				return 0
			}()
			break
		}

	}

	// Okay, time to actually get a character.

	c = *(*Chr)(unsafe.Pointer(libc.PostIncUintptr(&(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow, 2)))

	// Deal with the easy contexts, punt EREs to code below.

	switch (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Flexcon {
	case L_BRE: // punt BREs to separate function
		return brenext(tls, v, int32(c))
		break
	case L_ERE: // see below
		break
	case L_Q: // literal strings are easy
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
		break
	case L_BBND:
		fallthrough // bounds are fairly simple
	case L_EBND:
		switch int32(c) {
		case int32(uint8('0')):
			fallthrough
		case int32(uint8('1')):
			fallthrough
		case int32(uint8('2')):
			fallthrough
		case int32(uint8('3')):
			fallthrough
		case int32(uint8('4')):
			fallthrough
		case int32(uint8('5')):
			fallthrough
		case int32(uint8('6')):
			fallthrough
		case int32(uint8('7')):
			fallthrough
		case int32(uint8('8')):
			fallthrough
		case int32(uint8('9')):
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'd'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = Chr(int32(c) - '0')
				return 1
			}()
			break
		case int32(uint8(',')):
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = ','
				return 1
			}()
			break
		case int32(uint8('}')):
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Flexcon == L_EBND {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Flexcon = L_ERE
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fcflags&REG_ADVF != 0 && (!((*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnow >= (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnow))) == int32(uint8('?'))) {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnow += 2
					*(*int64)(unsafe.Pointer((*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
					return func() int32 {
						(*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Fnexttype = '}'
						(*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
						return 1
					}()
				}
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = '}'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnextvalue = Chr(1)
					return 1
				}()
			} else {
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'e'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr = func() int32 {
						if (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr != 0 {
							return (*struct {
								Fre          uintptr
								Fnow         uintptr
								Fstop        uintptr
								Fsavenow     uintptr
								Fsavestop    uintptr
								Ferr         int32
								Fcflags      int32
								Flasttype    int32
								Fnexttype    int32
								Fnextvalue   Chr
								F__ccgo_pad1 [2]byte
								Flexcon      int32
								Fnsubexp     int32
								F__ccgo_pad2 [4]byte
								Fsubs        uintptr
								Fnsubs       Size_t
								Fsub10       [10]uintptr
								Fnfa         uintptr
								Fcm          uintptr
								Fnlcolor     Color
								F__ccgo_pad3 [6]byte
								Fwordchrs    uintptr
								Ftree        uintptr
								Ftreechain   uintptr
								Ftreefree    uintptr
								Fntree       int32
								F__ccgo_pad4 [4]byte
								Fcv          uintptr
								Fcv2         uintptr
								Flacons      uintptr
								Fnlacons     int32
								F__ccgo_pad5 [4]byte
								Fspaceused   Size_t
							})(unsafe.Pointer(v)).Ferr
						}
						return REG_BADBR
					}()
					return 0
				}()
			}
			break
		case int32(uint8('\\')):
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Flexcon == L_BBND && (!((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow >= (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow))) == int32(uint8('}'))) {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnow += 2
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Flexcon = L_BRE
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = '}'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnextvalue = Chr(1)
					return 1
				}()
			} else {
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'e'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr = func() int32 {
						if (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr != 0 {
							return (*struct {
								Fre          uintptr
								Fnow         uintptr
								Fstop        uintptr
								Fsavenow     uintptr
								Fsavestop    uintptr
								Ferr         int32
								Fcflags      int32
								Flasttype    int32
								Fnexttype    int32
								Fnextvalue   Chr
								F__ccgo_pad1 [2]byte
								Flexcon      int32
								Fnsubexp     int32
								F__ccgo_pad2 [4]byte
								Fsubs        uintptr
								Fnsubs       Size_t
								Fsub10       [10]uintptr
								Fnfa         uintptr
								Fcm          uintptr
								Fnlcolor     Color
								F__ccgo_pad3 [6]byte
								Fwordchrs    uintptr
								Ftree        uintptr
								Ftreechain   uintptr
								Ftreefree    uintptr
								Fntree       int32
								F__ccgo_pad4 [4]byte
								Fcv          uintptr
								Fcv2         uintptr
								Flacons      uintptr
								Fnlacons     int32
								F__ccgo_pad5 [4]byte
								Fspaceused   Size_t
							})(unsafe.Pointer(v)).Ferr
						}
						return REG_BADBR
					}()
					return 0
				}()
			}
			break
		default:
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_BADBR
				}()
				return 0
			}()
			break
		}

		break
	case L_BRACK: // brackets are not too hard
		switch int32(c) {
		case int32(uint8(']')):
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Flasttype == '[' {
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'p'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnextvalue = c
					return 1
				}()
			} else {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Flexcon = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fcflags&REG_EXTENDED != 0 {
						return L_ERE
					}
					return L_BRE
				}()
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = ']'
					return 1
				}()
			}
			break
		case int32(uint8('\\')):
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UBBS)
			if !((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fcflags&REG_ADVF != 0) {
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'p'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnextvalue = c
					return 1
				}()
			}
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow >= (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fstop {
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'e'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr = func() int32 {
						if (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr != 0 {
							return (*struct {
								Fre          uintptr
								Fnow         uintptr
								Fstop        uintptr
								Fsavenow     uintptr
								Fsavestop    uintptr
								Ferr         int32
								Fcflags      int32
								Flasttype    int32
								Fnexttype    int32
								Fnextvalue   Chr
								F__ccgo_pad1 [2]byte
								Flexcon      int32
								Fnsubexp     int32
								F__ccgo_pad2 [4]byte
								Fsubs        uintptr
								Fnsubs       Size_t
								Fsub10       [10]uintptr
								Fnfa         uintptr
								Fcm          uintptr
								Fnlcolor     Color
								F__ccgo_pad3 [6]byte
								Fwordchrs    uintptr
								Ftree        uintptr
								Ftreechain   uintptr
								Ftreefree    uintptr
								Fntree       int32
								F__ccgo_pad4 [4]byte
								Fcv          uintptr
								Fcv2         uintptr
								Flacons      uintptr
								Fnlacons     int32
								F__ccgo_pad5 [4]byte
								Fspaceused   Size_t
							})(unsafe.Pointer(v)).Ferr
						}
						return REG_EESCAPE
					}()
					return 0
				}()
			}
			lexescape(tls, v)
			switch (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype { // not all escapes okay here
			case 'p':
				return 1
				break
			case 'C':
				switch int32((*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue) {
				case 'd':
					lexnest(tls, v, uintptr(unsafe.Pointer(&brbackd)), uintptr(unsafe.Pointer(&brbackd))+uintptr(uint64(unsafe.Sizeof(brbackd))/uint64(unsafe.Sizeof(Chr(0))))*2)
					break
				case 's':
					lexnest(tls, v, uintptr(unsafe.Pointer(&brbacks)), uintptr(unsafe.Pointer(&brbacks))+uintptr(uint64(unsafe.Sizeof(brbacks))/uint64(unsafe.Sizeof(Chr(0))))*2)
					break
				case 'w':
					lexnest(tls, v, uintptr(unsafe.Pointer(&brbackw)), uintptr(unsafe.Pointer(&brbackw))+uintptr(uint64(unsafe.Sizeof(brbackw))/uint64(unsafe.Sizeof(Chr(0))))*2)
					break
				default:
					return func() int32 {
						(*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Fnexttype = 'e'
						(*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr = func() int32 {
							if (*struct {
								Fre          uintptr
								Fnow         uintptr
								Fstop        uintptr
								Fsavenow     uintptr
								Fsavestop    uintptr
								Ferr         int32
								Fcflags      int32
								Flasttype    int32
								Fnexttype    int32
								Fnextvalue   Chr
								F__ccgo_pad1 [2]byte
								Flexcon      int32
								Fnsubexp     int32
								F__ccgo_pad2 [4]byte
								Fsubs        uintptr
								Fnsubs       Size_t
								Fsub10       [10]uintptr
								Fnfa         uintptr
								Fcm          uintptr
								Fnlcolor     Color
								F__ccgo_pad3 [6]byte
								Fwordchrs    uintptr
								Ftree        uintptr
								Ftreechain   uintptr
								Ftreefree    uintptr
								Fntree       int32
								F__ccgo_pad4 [4]byte
								Fcv          uintptr
								Fcv2         uintptr
								Flacons      uintptr
								Fnlacons     int32
								F__ccgo_pad5 [4]byte
								Fspaceused   Size_t
							})(unsafe.Pointer(v)).Ferr != 0 {
								return (*struct {
									Fre          uintptr
									Fnow         uintptr
									Fstop        uintptr
									Fsavenow     uintptr
									Fsavestop    uintptr
									Ferr         int32
									Fcflags      int32
									Flasttype    int32
									Fnexttype    int32
									Fnextvalue   Chr
									F__ccgo_pad1 [2]byte
									Flexcon      int32
									Fnsubexp     int32
									F__ccgo_pad2 [4]byte
									Fsubs        uintptr
									Fnsubs       Size_t
									Fsub10       [10]uintptr
									Fnfa         uintptr
									Fcm          uintptr
									Fnlcolor     Color
									F__ccgo_pad3 [6]byte
									Fwordchrs    uintptr
									Ftree        uintptr
									Ftreechain   uintptr
									Ftreefree    uintptr
									Fntree       int32
									F__ccgo_pad4 [4]byte
									Fcv          uintptr
									Fcv2         uintptr
									Flacons      uintptr
									Fnlacons     int32
									F__ccgo_pad5 [4]byte
									Fspaceused   Size_t
								})(unsafe.Pointer(v)).Ferr
							}
							return REG_EESCAPE
						}()
						return 0
					}()
					break
				}

				// lexnest() done, back up and try again.

				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Flasttype
				return next(tls, v)
				break
			}

			// Not one of the acceptable escapes.

			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_EESCAPE
				}()
				return 0
			}()
			break
		case int32(uint8('-')):
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Flasttype == '[' || !((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow >= (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow))) == int32(uint8(']')) {
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'p'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnextvalue = c
					return 1
				}()
			} else {
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'R'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnextvalue = c
					return 1
				}()
			}
			break
		case int32(uint8('[')):
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow >= (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fstop {
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'e'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr = func() int32 {
						if (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr != 0 {
							return (*struct {
								Fre          uintptr
								Fnow         uintptr
								Fstop        uintptr
								Fsavenow     uintptr
								Fsavestop    uintptr
								Ferr         int32
								Fcflags      int32
								Flasttype    int32
								Fnexttype    int32
								Fnextvalue   Chr
								F__ccgo_pad1 [2]byte
								Flexcon      int32
								Fnsubexp     int32
								F__ccgo_pad2 [4]byte
								Fsubs        uintptr
								Fnsubs       Size_t
								Fsub10       [10]uintptr
								Fnfa         uintptr
								Fcm          uintptr
								Fnlcolor     Color
								F__ccgo_pad3 [6]byte
								Fwordchrs    uintptr
								Ftree        uintptr
								Ftreechain   uintptr
								Ftreefree    uintptr
								Fntree       int32
								F__ccgo_pad4 [4]byte
								Fcv          uintptr
								Fcv2         uintptr
								Flacons      uintptr
								Fnlacons     int32
								F__ccgo_pad5 [4]byte
								Fspaceused   Size_t
							})(unsafe.Pointer(v)).Ferr
						}
						return REG_EBRACK
					}()
					return 0
				}()
			}
			switch int32(*(*Chr)(unsafe.Pointer(libc.PostIncUintptr(&(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow, 2)))) {
			case int32(uint8('.')):
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Flexcon = L_CEL

				// Might or might not be locale-specific.

				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'I'
					return 1
				}()
				break
			case int32(uint8('=')):
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Flexcon = L_ECL
				*(*int64)(unsafe.Pointer((*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOCALE)
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'E'
					return 1
				}()
				break
			case int32(uint8(':')):
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Flexcon = L_CCL
				*(*int64)(unsafe.Pointer((*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOCALE)
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'C'
					return 1
				}()
				break
			default: // oops
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnow -= 2
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'p'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnextvalue = c
					return 1
				}()
				break
			}

			break
		default:
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'p'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = c
				return 1
			}()
			break
		}

		break
	case L_CEL: // collating elements are easy
		if int32(c) == int32(uint8('.')) && (!((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) == int32(uint8(']'))) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow += 2
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Flexcon = L_BRACK
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'X'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = Chr('.')
				return 1
			}()
		} else {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'p'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = c
				return 1
			}()
		}
		break
	case L_ECL: // ditto equivalence classes
		if int32(c) == int32(uint8('=')) && (!((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) == int32(uint8(']'))) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow += 2
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Flexcon = L_BRACK
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'X'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = Chr('=')
				return 1
			}()
		} else {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'p'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = c
				return 1
			}()
		}
		break
	case L_CCL: // ditto character classes
		if int32(c) == int32(uint8(':')) && (!((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) == int32(uint8(']'))) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow += 2
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Flexcon = L_BRACK
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'X'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = Chr(':')
				return 1
			}()
		} else {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'p'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = c
				return 1
			}()
		}
		break
	default:

		break
	}

	// That got rid of everything except EREs and AREs.

	// Deal with EREs and AREs, except for backslashes.

	switch int32(c) {
	case int32(uint8('|')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '|'
			return 1
		}()
		break
	case int32(uint8('*')):
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_ADVF != 0 && (!((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) == int32(uint8('?'))) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow += 2
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '*'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
				return 1
			}()
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '*'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(1)
			return 1
		}()
		break
	case int32(uint8('+')):
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_ADVF != 0 && (!((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) == int32(uint8('?'))) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow += 2
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '+'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
				return 1
			}()
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '+'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(1)
			return 1
		}()
		break
	case int32(uint8('?')):
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_ADVF != 0 && (!((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) == int32(uint8('?'))) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow += 2
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '?'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
				return 1
			}()
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '?'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(1)
			return 1
		}()
		break
	case int32(uint8('{')):
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_EXPANDED != 0 {
			skip(tls, v)
		}
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop || !(XTcl_UniCharIsDigit(tls, int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow)))) != 0) {
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UBRACES)
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNSPEC)
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'p'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = c
				return 1
			}()
		} else {
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UBOUNDS)
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Flexcon = L_EBND
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '{'
				return 1
			}()
		}

		break
	case int32(uint8('(')):
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_ADVF != 0 && (!((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) == int32(uint8('?'))) {
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow += 2
			switch int32(*(*Chr)(unsafe.Pointer(libc.PostIncUintptr(&(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow, 2)))) {
			case int32(uint8(':')):
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = '('
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
					return 1
				}()
				break
				fallthrough
			case int32(uint8('#')):
				for !((*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnow >= (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnow))) != int32(uint8(')')) {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnow += 2
				}
				if !((*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnow >= (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fstop) {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnow += 2
				}

				return next(tls, v)
				break
				fallthrough
			case int32(uint8('=')):
				*(*int64)(unsafe.Pointer((*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOOKAHEAD)
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'L'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnextvalue = Chr(1)
					return 1
				}()
				break
				fallthrough
			case int32(uint8('!')):
				*(*int64)(unsafe.Pointer((*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOOKAHEAD)
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'L'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
					return 1
				}()
				break
				fallthrough
			default:
				return func() int32 {
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Fnexttype = 'e'
					(*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr = func() int32 {
						if (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr != 0 {
							return (*struct {
								Fre          uintptr
								Fnow         uintptr
								Fstop        uintptr
								Fsavenow     uintptr
								Fsavestop    uintptr
								Ferr         int32
								Fcflags      int32
								Flasttype    int32
								Fnexttype    int32
								Fnextvalue   Chr
								F__ccgo_pad1 [2]byte
								Flexcon      int32
								Fnsubexp     int32
								F__ccgo_pad2 [4]byte
								Fsubs        uintptr
								Fnsubs       Size_t
								Fsub10       [10]uintptr
								Fnfa         uintptr
								Fcm          uintptr
								Fnlcolor     Color
								F__ccgo_pad3 [6]byte
								Fwordchrs    uintptr
								Ftree        uintptr
								Ftreechain   uintptr
								Ftreefree    uintptr
								Fntree       int32
								F__ccgo_pad4 [4]byte
								Fcv          uintptr
								Fcv2         uintptr
								Flacons      uintptr
								Fnlacons     int32
								F__ccgo_pad5 [4]byte
								Fspaceused   Size_t
							})(unsafe.Pointer(v)).Ferr
						}
						return REG_BADRPT
					}()
					return 0
				}()
				break
			}

		}
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_NOSUB != 0 {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '('
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
				return 1
			}() // all parens non-capturing
		} else {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '('
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = Chr(1)
				return 1
			}()
		}
		break
	case int32(uint8(')')):
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flasttype == '(' {
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNSPEC)
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = ')'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
		break
	case int32(uint8('[')):
		if (int64((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop)-int64((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))/2 >= int64(6) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(0)*2))) == int32(uint8('[')) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(1)*2))) == int32(uint8(':')) && (int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(2)*2))) == int32(uint8('<')) || int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(2)*2))) == int32(uint8('>'))) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(3)*2))) == int32(uint8(':')) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(4)*2))) == int32(uint8(']')) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(5)*2))) == int32(uint8(']')) {
			c = *(*Chr)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow + uintptr(2)*2))
			*(*uintptr)(unsafe.Pointer(v + 8)) += uintptr(6) * 2
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = func() int32 {
					if int32(c) == int32(uint8('<')) {
						return '<'
					}
					return '>'
				}()
				return 1
			}()
		}
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flexcon = L_BRACK
		if !((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) == int32(uint8('^')) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow += 2
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '['
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
				return 1
			}()
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '['
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(1)
			return 1
		}()
		break
	case int32(uint8('.')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '.'
			return 1
		}()
		break
	case int32(uint8('^')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '^'
			return 1
		}()
		break
	case int32(uint8('$')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '$'
			return 1
		}()
		break
	case int32(uint8('\\')):
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_EESCAPE
				}()
				return 0
			}()
		}
		break
	default: // ordinary character
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
		break
	}

	// ERE/ARE backslash handling; backslash already eaten.

	if !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_ADVF != 0) { // only AREs have non-trivial escapes
		if XTcl_UniCharIsAlnum(tls, int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow)))) != 0 {
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UBSALNUM)
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNSPEC)
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = *(*Chr)(unsafe.Pointer(libc.PostIncUintptr(&(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow, 2)))
			return 1
		}()
	}
	lexescape(tls, v)
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr != 0 {
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_EESCAPE
			}()
			return 0
		}()
	}
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype == 'C' { // fudge at lexical level
		switch int32((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnextvalue) {
		case 'd':
			lexnest(tls, v, uintptr(unsafe.Pointer(&backd)), uintptr(unsafe.Pointer(&backd))+uintptr(uint64(unsafe.Sizeof(backd))/uint64(unsafe.Sizeof(Chr(0))))*2)
			break
			fallthrough
		case 'D':
			lexnest(tls, v, uintptr(unsafe.Pointer(&backD)), uintptr(unsafe.Pointer(&backD))+uintptr(uint64(unsafe.Sizeof(backD))/uint64(unsafe.Sizeof(Chr(0))))*2)
			break
			fallthrough
		case 's':
			lexnest(tls, v, uintptr(unsafe.Pointer(&backs)), uintptr(unsafe.Pointer(&backs))+uintptr(uint64(unsafe.Sizeof(backs))/uint64(unsafe.Sizeof(Chr(0))))*2)
			break
			fallthrough
		case 'S':
			lexnest(tls, v, uintptr(unsafe.Pointer(&backS)), uintptr(unsafe.Pointer(&backS))+uintptr(uint64(unsafe.Sizeof(backS))/uint64(unsafe.Sizeof(Chr(0))))*2)
			break
			fallthrough
		case 'w':
			lexnest(tls, v, uintptr(unsafe.Pointer(&backw)), uintptr(unsafe.Pointer(&backw))+uintptr(uint64(unsafe.Sizeof(backw))/uint64(unsafe.Sizeof(Chr(0))))*2)
			break
			fallthrough
		case 'W':
			lexnest(tls, v, uintptr(unsafe.Pointer(&backW)), uintptr(unsafe.Pointer(&backW))+uintptr(uint64(unsafe.Sizeof(backW))/uint64(unsafe.Sizeof(Chr(0))))*2)
			break
			fallthrough
		default:

			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_ASSERT
				}()
				return 0
			}()
			break
		}
		// lexnest done, back up and try again
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flasttype
		return next(tls, v)
	}

	// Otherwise, lexescape has already done the work.

	return libc.BoolInt32(!((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr != 0))
}

//
//  - lexescape - parse an ARE backslash escape (backslash already eaten)
//  * Note slightly nonstandard use of the CCLASS type code.
//  ^ static int lexescape(struct vars *);
//
func lexescape(tls *libc.TLS, v uintptr) int32 { /* regc_lex.c:754:1: */
	var c Chr
	var i int32
	var save uintptr

	c = *(*Chr)(unsafe.Pointer(libc.PostIncUintptr(&(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow, 2)))
	if !(XTcl_UniCharIsAlnum(tls, int32(c)) != 0) {
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
	}

	*(*int64)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
	switch int32(c) {
	case int32(uint8('a')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = chrnamed(tls, v, uintptr(unsafe.Pointer(&alert)), uintptr(unsafe.Pointer(&alert))+uintptr(uint64(unsafe.Sizeof(alert))/uint64(unsafe.Sizeof(Chr(0))))*2, int32(uint8('\007')))
			return 1
		}()
		break
	case int32(uint8('A')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'A'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
			return 1
		}()
		break
	case int32(uint8('b')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(uint8('\b'))
			return 1
		}()
		break
	case int32(uint8('B')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(uint8('\\'))
			return 1
		}()
		break
	case int32(uint8('c')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNPORT)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_EESCAPE
				}()
				return 0
			}()
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(int32(*(*Chr)(unsafe.Pointer(libc.PostIncUintptr(&(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow, 2)))) & 037)
			return 1
		}()
		break
	case int32(uint8('d')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOCALE)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'C'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr('d')
			return 1
		}()
		break
	case int32(uint8('D')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOCALE)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'C'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr('D')
			return 1
		}()
		break
	case int32(uint8('e')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNPORT)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = chrnamed(tls, v, uintptr(unsafe.Pointer(&esc)), uintptr(unsafe.Pointer(&esc))+uintptr(uint64(unsafe.Sizeof(esc))/uint64(unsafe.Sizeof(Chr(0))))*2, int32(uint8('\033')))
			return 1
		}()
		break
	case int32(uint8('f')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(uint8('\f'))
			return 1
		}()
		break
	case int32(uint8('m')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '<'
			return 1
		}()
		break
	case int32(uint8('M')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '>'
			return 1
		}()
		break
	case int32(uint8('n')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(uint8('\n'))
			return 1
		}()
		break
	case int32(uint8('r')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(uint8('\r'))
			return 1
		}()
		break
	case int32(uint8('s')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOCALE)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'C'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr('s')
			return 1
		}()
		break
	case int32(uint8('S')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOCALE)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'C'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr('S')
			return 1
		}()
		break
	case int32(uint8('t')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(uint8('\t'))
			return 1
		}()
		break
	case int32(uint8('u')):
		c = Chr(Uchr(lexdigits(tls, v, 16, 1, 4)))
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_EESCAPE
				}()
				return 0
			}()
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
		break
	case int32(uint8('U')):
		i = lexdigits(tls, v, 16, 1, 8)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_EESCAPE
				}()
				return 0
			}()
		}
		if i > 0xFFFF {
			// TODO: output a Surrogate pair
			i = 0xFFFD
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(Uchr(i))
			return 1
		}()
		break
	case int32(uint8('v')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(uint8('\v'))
			return 1
		}()
		break
	case int32(uint8('w')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOCALE)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'C'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr('w')
			return 1
		}()
		break
	case int32(uint8('W')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOCALE)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'C'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr('W')
			return 1
		}()
		break
	case int32(uint8('x')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNPORT)
		c = Chr(Uchr(lexdigits(tls, v, 16, 1, 2)))
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_EESCAPE
				}()
				return 0
			}()
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
		break
	case int32(uint8('y')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOCALE)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'w'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
			return 1
		}()
		break
	case int32(uint8('Y')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOCALE)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'W'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
			return 1
		}()
		break
	case int32(uint8('Z')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'Z'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
			return 1
		}()
		break
	case int32(uint8('1')):
		fallthrough
	case int32(uint8('2')):
		fallthrough
	case int32(uint8('3')):
		fallthrough
	case int32(uint8('4')):
		fallthrough
	case int32(uint8('5')):
		fallthrough
	case int32(uint8('6')):
		fallthrough
	case int32(uint8('7')):
		fallthrough
	case int32(uint8('8')):
		fallthrough
	case int32(uint8('9')):
		save = (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow -= 2 // put first digit back
		c = Chr(Uchr(lexdigits(tls, v, 10, 1, 255))) // REs >255 long outside spec
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_EESCAPE
				}()
				return 0
			}()
		}

		// Ugly heuristic (first test is "exactly 1 digit?")

		if (int64((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow)-int64(save))/2 == int64(0) || int32(c) > 0 && int32(c) <= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnsubexp {
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UBACKREF)
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'b'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = c
				return 1
			}()
		}

		// Oops, doesn't look like it's a backref after all...

		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow = save
		fallthrough

		// FALLTHRU

	case int32(uint8('0')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNPORT)
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow -= 2 // put first digit back
		c = Chr(Uchr(lexdigits(tls, v, 8, 1, 3)))
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_EESCAPE
				}()
				return 0
			}()
		}
		if int32(c) > 0xFF {
			// out of range, so we handled one digit too much
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow -= 2
			c >>= 3
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
		break
	default:

		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_EESCAPE
			}()
			return 0
		}() // unknown alphabetic escape
		break
	}

	return int32(0)
}

var alert = [5]Chr{
	Chr(uint8('a')), Chr(uint8('l')), Chr(uint8('e')), Chr(uint8('r')), Chr(uint8('t')),
} /* regc_lex.c:759:22 */
var esc = [3]Chr{
	Chr(uint8('E')), Chr(uint8('S')), Chr(uint8('C')),
} /* regc_lex.c:762:22 */

//
//  - lexdigits - slurp up digits and return chr value
//  ^ static int lexdigits(struct vars *, int, int, int);
//
func lexdigits(tls *libc.TLS, v uintptr, base int32, minlen int32, maxlen int32) int32 { /* regc_lex.c:937:1: */
	var n int32
	var len int32
	var c Chr
	var d int32
	var ub Uchr = Uchr(base)

	n = 0
	for len = 0; len < maxlen && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow >= (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fstop); len++ {
		if n > 0x10FFF {
			// Stop when continuing would otherwise overflow
			break
		}
		c = *(*Chr)(unsafe.Pointer(libc.PostIncUintptr(&(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow, 2)))
		switch int32(c) {
		case int32(uint8('0')):
			fallthrough
		case int32(uint8('1')):
			fallthrough
		case int32(uint8('2')):
			fallthrough
		case int32(uint8('3')):
			fallthrough
		case int32(uint8('4')):
			fallthrough
		case int32(uint8('5')):
			fallthrough
		case int32(uint8('6')):
			fallthrough
		case int32(uint8('7')):
			fallthrough
		case int32(uint8('8')):
			fallthrough
		case int32(uint8('9')):
			d = int32(c) - '0'
			break
		case int32(uint8('a')):
			fallthrough
		case int32(uint8('A')):
			d = 10
			break
		case int32(uint8('b')):
			fallthrough
		case int32(uint8('B')):
			d = 11
			break
		case int32(uint8('c')):
			fallthrough
		case int32(uint8('C')):
			d = 12
			break
		case int32(uint8('d')):
			fallthrough
		case int32(uint8('D')):
			d = 13
			break
		case int32(uint8('e')):
			fallthrough
		case int32(uint8('E')):
			d = 14
			break
		case int32(uint8('f')):
			fallthrough
		case int32(uint8('F')):
			d = 15
			break
		default:
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow -= 2 // oops, not a digit at all
			d = -1
			break
		}

		if d >= base { // not a plausible digit
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow -= 2
			d = -1
		}
		if d < 0 {
			break // NOTE BREAK OUT
		}
		n = int32(Uchr(n)*ub + Uchr(d))
	}
	if len < minlen {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_EESCAPE
		}()
	}

	return n
}

//
//  - brenext - get next BRE token
//  * This is much like EREs except for all the stupid backslashes and the
//  * context-dependency of some things.
//  ^ static int brenext(struct vars *, pchr);
//
func brenext(tls *libc.TLS, v uintptr, pc Pchr) int32 { /* regc_lex.c:997:1: */
	var c Chr = Chr(pc)

	switch int32(c) {
	case int32(uint8('*')):
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flasttype == 'n' || (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flasttype == '(' || (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flasttype == '^' {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = 'p'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = c
				return 1
			}()
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '*'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(1)
			return 1
		}()
		break
	case int32(uint8('[')):
		if (int64((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop)-int64((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))/2 >= int64(6) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(0)*2))) == int32(uint8('[')) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(1)*2))) == int32(uint8(':')) && (int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(2)*2))) == int32(uint8('<')) || int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(2)*2))) == int32(uint8('>'))) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(3)*2))) == int32(uint8(':')) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(4)*2))) == int32(uint8(']')) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(5)*2))) == int32(uint8(']')) {
			c = *(*Chr)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow + uintptr(2)*2))
			*(*uintptr)(unsafe.Pointer(v + 8)) += uintptr(6) * 2
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = func() int32 {
					if int32(c) == int32(uint8('<')) {
						return '<'
					}
					return '>'
				}()
				return 1
			}()
		}
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flexcon = L_BRACK
		if !((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) == int32(uint8('^')) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow += 2
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '['
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnextvalue = Chr(0)
				return 1
			}()
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '['
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(1)
			return 1
		}()
		break
	case int32(uint8('.')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '.'
			return 1
		}()
		break
	case int32(uint8('^')):
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flasttype == 'n' {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '^'
				return 1
			}()
		}
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flasttype == '(' {
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNSPEC)
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '^'
				return 1
			}()
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
		break
	case int32(uint8('$')):
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcflags&REG_EXPANDED != 0 {
			skip(tls, v)
		}
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop {
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '$'
				return 1
			}()
		}
		if (int64((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop)-int64((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))/2 >= int64(2) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) == int32(uint8('\\')) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow + uintptr(1)*2))) == int32(uint8(')')) {
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNSPEC)
			return func() int32 {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Fnexttype = '$'
				return 1
			}()
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
		break
	case int32(uint8('\\')):
		break // see below
	default:
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
		break
	}

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow >= (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fstop {
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_EESCAPE
			}()
			return 0
		}()
	}

	c = *(*Chr)(unsafe.Pointer(libc.PostIncUintptr(&(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow, 2)))
	switch int32(c) {
	case int32(uint8('{')):
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Flexcon = L_BBND
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UBOUNDS)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '{'
			return 1
		}()
		break
	case int32(uint8('(')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '('
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(1)
			return 1
		}()
		break
	case int32(uint8(')')):
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = ')'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
		break
	case int32(uint8('<')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '<'
			return 1
		}()
		break
	case int32(uint8('>')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = '>'
			return 1
		}()
		break
	case int32(uint8('1')):
		fallthrough
	case int32(uint8('2')):
		fallthrough
	case int32(uint8('3')):
		fallthrough
	case int32(uint8('4')):
		fallthrough
	case int32(uint8('5')):
		fallthrough
	case int32(uint8('6')):
		fallthrough
	case int32(uint8('7')):
		fallthrough
	case int32(uint8('8')):
		fallthrough
	case int32(uint8('9')):
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UBACKREF)
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'b'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = Chr(int32(c) - '0')
			return 1
		}()
		break
	default:
		if XTcl_UniCharIsAlnum(tls, int32(c)) != 0 {
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UBSALNUM)
			*(*int64)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UUNSPEC)
		}
		return func() int32 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnexttype = 'p'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnextvalue = c
			return 1
		}()
		break
	}

	return int32(0)
}

//
//  - skip - skip white space and comments in expanded form
//  ^ static void skip(struct vars *);
//
func skip(tls *libc.TLS, v uintptr) { /* regc_lex.c:1112:1: */
	var start uintptr = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow

	for {
		for !((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && XTcl_UniCharIsSpace(tls, int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow)))) != 0 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow += 2
		}
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop || int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) != int32(uint8('#')) {
			break // NOTE BREAK OUT
		}

		for !((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow >= (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fstop) && int32(*(*Chr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnow))) != int32(uint8('\n')) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Fnow += 2
		}

		// Leave the newline to be picked up by the iscspace loop.
	}

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnow != start {
		*(*int64)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_UNONPOSIX)
	}
}

//
//  - newline - return the chr for a newline
//  * This helps confine use of CHR to this source file.
//  ^ static chr newline(NOPARMS);
//
func newline(tls *libc.TLS) Chr { /* regc_lex.c:1147:1: */
	return Chr(uint8('\n'))
}

//
//  - chrnamed - return the chr known by a given (chr string) name
//  * The code is a bit clumsy, but this routine gets only such specialized
//  * use that it hardly matters.
//  ^ static chr chrnamed(struct vars *, const chr *, const chr *, pchr);
//
func chrnamed(tls *libc.TLS, v uintptr, startp uintptr, endp uintptr, lastresort Pchr) Chr { /* regc_lex.c:1159:1: */
	var c Celt
	var errsave int32
	var e int32
	var cv uintptr

	errsave = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr = 0
	c = element(tls, v, startp, endp)
	e = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr = errsave

	if e != 0 {
		return Chr(lastresort)
	}

	cv = range1(tls, v, c, c, 0)
	if (*Cvec)(unsafe.Pointer(cv)).Fnchrs == 0 {
		return Chr(lastresort)
	}
	return *(*Chr)(unsafe.Pointer((*Cvec)(unsafe.Pointer(cv)).Fchrs))
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// colorings of characters
// This file is #included by regcomp.c.
//
// Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
//
// Development of this software was funded, in part, by Cray Research Inc.,
// UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
// Corporation, none of whom are responsible for the results. The author
// thanks all of them.
//
// Redistribution and use in source and binary forms -- with or without
// modification -- are permitted for any purpose, provided that
// redistributions in source form retain this entire copyright notice and
// indicate the origin and nature of any modifications.
//
// I'd appreciate being given credit for this package in the documentation of
// software which uses it, but that is not a requirement.
//
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Note that there are some incestuous relationships between this code and NFA
// arc maintenance, which perhaps ought to be cleaned up sometime.

//
//  - initcm - set up new colormap
//  ^ static void initcm(struct vars *, struct colormap *);
//
func initcm(tls *libc.TLS, v uintptr, cm uintptr) { /* regc_color.c:43:1: */
	var i int32
	var j int32
	var t uintptr
	var nextt uintptr
	var cd uintptr

	(*Colormap)(unsafe.Pointer(cm)).Fmagic = CMMAGIC
	(*Colormap)(unsafe.Pointer(cm)).Fv = v

	(*Colormap)(unsafe.Pointer(cm)).Fncds = uint64(10)
	(*Colormap)(unsafe.Pointer(cm)).Fcd = cm + 48 /* &.cdspace */
	(*Colormap)(unsafe.Pointer(cm)).Fmax = uint64(0)
	(*Colormap)(unsafe.Pointer(cm)).Ffree = int16(0)

	cd = (*Colormap)(unsafe.Pointer(cm)).Fcd // cm->cd[WHITE]
	(*Colordesc)(unsafe.Pointer(cd)).Fsub = int16(-1)
	(*Colordesc)(unsafe.Pointer(cd)).Farcs = uintptr(0)
	(*Colordesc)(unsafe.Pointer(cd)).Fflags = 0
	(*Colordesc)(unsafe.Pointer(cd)).Fnchrs = Uchr(CHR_MAX - CHR_MIN + 1)

	// Upper levels of tree.

	t = cm + 368
	j = (CHRBITS+BYTBITS-1)/BYTBITS - 1
__1:
	if !(j > 0) {
		goto __3
	}
	{
		nextt = t + uintptr(1)*2048
		for i = int32(1)<<BYTBITS - 1; i >= 0; i-- {
			*(*uintptr)(unsafe.Pointer(t + uintptr(i)*8)) = nextt
		}

	}
	goto __2
__2:
	t = nextt
	j--
	goto __1
	goto __3
__3:
	;

	// Bottom level is solid white.

	t = cm + 368 + 1*2048
	for i = int32(1)<<BYTBITS - 1; i >= 0; i-- {
		*(*Color)(unsafe.Pointer(t + uintptr(i)*2)) = int16(WHITE)
	}
	(*Colordesc)(unsafe.Pointer(cd)).Fblock = t
}

//
//  - freecm - free dynamically-allocated things in a colormap
//  ^ static void freecm(struct colormap *);
//
func freecm(tls *libc.TLS, cm uintptr) { /* regc_color.c:94:1: */
	var i Size_t
	var cb uintptr

	(*Colormap)(unsafe.Pointer(cm)).Fmagic = 0
	if (CHRBITS+BYTBITS-1)/BYTBITS > 1 {
		cmtreefree(tls, cm, cm+368, 0)
	}
	for i = uint64(1); i <= (*Colormap)(unsafe.Pointer(cm)).Fmax; i++ { // skip WHITE
		if !((*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd+uintptr(i)*32)).Fflags&FREECOL != 0) {
			cb = (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(i)*32)).Fblock
			if cb != uintptr(0) {
				XTclpFree(tls, cb)
			}
		}
	}
	if (*Colormap)(unsafe.Pointer(cm)).Fcd != cm+48 {
		XTclpFree(tls, (*Colormap)(unsafe.Pointer(cm)).Fcd)
	}
}

//
//  - cmtreefree - free a non-terminal part of a colormap tree
//  ^ static void cmtreefree(struct colormap *, union tree *, int);
//
func cmtreefree(tls *libc.TLS, cm uintptr, tree uintptr, level int32) { /* regc_color.c:122:1: */
	var i int32
	var t uintptr
	var fillt uintptr = cm + 368 + uintptr(level+1)*2048
	var cb uintptr

	// this level has pointers
	for i = int32(1)<<BYTBITS - 1; i >= 0; i-- {
		t = *(*uintptr)(unsafe.Pointer(tree + uintptr(i)*8))

		if t != fillt {
			if level < (CHRBITS+BYTBITS-1)/BYTBITS-2 { // more pointer blocks below
				cmtreefree(tls, cm, t, level+1)
				XTclpFree(tls, t)
			} else { // color block below
				cb = (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(*(*Color)(unsafe.Pointer(t)))*32)).Fblock
				if t != cb { // not a solid block
					XTclpFree(tls, t)
				}
			}
		}
	}
}

//
//  - setcolor - set the color of a character in a colormap
//  ^ static color setcolor(struct colormap *, pchr, pcolor);
//
func setcolor(tls *libc.TLS, cm uintptr, c Pchr, co Pcolor) Color { /* regc_color.c:155:1: */
	var uc Uchr = Uchr(c)
	var shift int32
	var level int32
	var b int32
	var bottom int32
	var t uintptr
	var newt uintptr
	var fillt uintptr
	var lastt uintptr
	var cb uintptr
	var prev Color

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 || co == -1 {
		return int16(-1)
	}

	t = cm + 368 /* &.tree */
	level = 0
	shift = BYTBITS * ((CHRBITS+BYTBITS-1)/BYTBITS - 1)
__1:
	if !(shift > 0) {
		goto __3
	}
	{
		b = int32(uc >> shift & Uchr(int32(1)<<BYTBITS-1))
		lastt = t
		t = *(*uintptr)(unsafe.Pointer(lastt + uintptr(b)*8))

		fillt = cm + 368 + uintptr(level+1)*2048
		if shift <= BYTBITS {
			bottom = 1
		} else {
			bottom = 0
		}
		if bottom != 0 {
			cb = (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(*(*Color)(unsafe.Pointer(t)))*32)).Fblock
		} else {
			cb = fillt
		}
		if t == fillt || t == cb { // must allocate a new block
			newt = XTclpAlloc(tls, func() uint32 {
				if bottom != 0 {
					return uint32(unsafe.Sizeof(Colors{}))
				}
				return uint32(unsafe.Sizeof(Ptrs{}))
			}())
			if newt == uintptr(0) {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr
					}
					return REG_ESPACE
				}()
				return int16(-1)
			}
			if bottom != 0 {
				libc.Xmemcpy(tls, newt, t, uint64(int32(1)<<BYTBITS)*uint64(unsafe.Sizeof(Color(0))))
			} else {
				libc.Xmemcpy(tls, newt, t, uint64(int32(1)<<BYTBITS)*uint64(unsafe.Sizeof(uintptr(0))))
			}
			t = newt
			*(*uintptr)(unsafe.Pointer(lastt + uintptr(b)*8)) = t
		}

	}
	goto __2
__2:
	level++
	shift = shift - BYTBITS
	goto __1
	goto __3
__3:
	;

	b = int32(uc & Uchr(int32(1)<<BYTBITS-1))
	prev = *(*Color)(unsafe.Pointer(t + uintptr(b)*2))
	*(*Color)(unsafe.Pointer(t + uintptr(b)*2)) = Color(co)
	return prev
}

//
//  - maxcolor - report largest color number in use
//  ^ static color maxcolor(struct colormap *);
//
func maxcolor(tls *libc.TLS, cm uintptr) Color { /* regc_color.c:214:1: */
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 {
		return int16(-1)
	}

	return Color((*Colormap)(unsafe.Pointer(cm)).Fmax)
}

//
//  - newcolor - find a new color (must be subject of setcolor at once)
//  * Beware: may relocate the colordescs.
//  ^ static color newcolor(struct colormap *);
//
func newcolor(tls *libc.TLS, cm uintptr) Color { /* regc_color.c:230:1: */
	var cd uintptr
	var n Size_t

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 {
		return int16(-1)
	}

	if int32((*Colormap)(unsafe.Pointer(cm)).Ffree) != 0 {

		cd = (*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr((*Colormap)(unsafe.Pointer(cm)).Ffree)*32

		(*Colormap)(unsafe.Pointer(cm)).Ffree = (*Colordesc)(unsafe.Pointer(cd)).Fsub
	} else if (*Colormap)(unsafe.Pointer(cm)).Fmax < (*Colormap)(unsafe.Pointer(cm)).Fncds-uint64(1) {
		(*Colormap)(unsafe.Pointer(cm)).Fmax++
		cd = (*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr((*Colormap)(unsafe.Pointer(cm)).Fmax)*32
	} else {
		var newCd uintptr

		// Oops, must allocate more.

		if (*Colormap)(unsafe.Pointer(cm)).Fmax == uint64(0x7fff) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr
				}
				return REG_ECOLORS
			}()
			return int16(-1) // too many colors
		}
		n = (*Colormap)(unsafe.Pointer(cm)).Fncds * uint64(2)
		if n > uint64(0x7fff+1) {
			n = uint64(0x7fff + 1)
		}
		if (*Colormap)(unsafe.Pointer(cm)).Fcd == cm+48 {
			newCd = XTclpAlloc(tls, uint32(n*Size_t(unsafe.Sizeof(Colordesc{}))))
			if newCd != uintptr(0) {
				libc.Xmemcpy(tls, newCd, cm+48,
					(*Colormap)(unsafe.Pointer(cm)).Fncds*Size_t(unsafe.Sizeof(Colordesc{})))
			}
		} else {
			newCd = XTclpRealloc(tls, (*Colormap)(unsafe.Pointer(cm)).Fcd, uint32(n*Size_t(unsafe.Sizeof(Colordesc{}))))
		}
		if newCd == uintptr(0) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr
				}
				return REG_ESPACE
			}()
			return int16(-1)
		}
		(*Colormap)(unsafe.Pointer(cm)).Fcd = newCd
		(*Colormap)(unsafe.Pointer(cm)).Fncds = n

		(*Colormap)(unsafe.Pointer(cm)).Fmax++
		cd = (*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr((*Colormap)(unsafe.Pointer(cm)).Fmax)*32
	}

	(*Colordesc)(unsafe.Pointer(cd)).Fnchrs = Uchr(0)
	(*Colordesc)(unsafe.Pointer(cd)).Fsub = int16(-1)
	(*Colordesc)(unsafe.Pointer(cd)).Farcs = uintptr(0)
	(*Colordesc)(unsafe.Pointer(cd)).Fflags = 0
	(*Colordesc)(unsafe.Pointer(cd)).Fblock = uintptr(0)

	return Color((int64(cd) - int64((*Colormap)(unsafe.Pointer(cm)).Fcd)) / 32)
}

//
//  - freecolor - free a color (must have no arcs or subcolor)
//  ^ static void freecolor(struct colormap *, pcolor);
//
func freecolor(tls *libc.TLS, cm uintptr, co Pcolor) { /* regc_color.c:300:1: */
	var cd uintptr = (*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(co)*32
	var pco Color
	var nco Color // for freelist scan

	if co == WHITE {
		return
	}

	(*Colordesc)(unsafe.Pointer(cd)).Fflags = FREECOL
	if (*Colordesc)(unsafe.Pointer(cd)).Fblock != uintptr(0) {
		XTclpFree(tls, (*Colordesc)(unsafe.Pointer(cd)).Fblock)
		(*Colordesc)(unsafe.Pointer(cd)).Fblock = uintptr(0) // just paranoia
	}

	if Size_t(co) == (*Colormap)(unsafe.Pointer(cm)).Fmax {
		for (*Colormap)(unsafe.Pointer(cm)).Fmax > uint64(WHITE) && (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd+uintptr((*Colormap)(unsafe.Pointer(cm)).Fmax)*32)).Fflags&FREECOL != 0 {
			(*Colormap)(unsafe.Pointer(cm)).Fmax--
		}

		for Size_t((*Colormap)(unsafe.Pointer(cm)).Ffree) > (*Colormap)(unsafe.Pointer(cm)).Fmax {
			(*Colormap)(unsafe.Pointer(cm)).Ffree = (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr((*Colormap)(unsafe.Pointer(cm)).Ffree)*32)).Fsub
		}
		if int32((*Colormap)(unsafe.Pointer(cm)).Ffree) > 0 {

			pco = (*Colormap)(unsafe.Pointer(cm)).Ffree
			nco = (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(pco)*32)).Fsub
			for int32(nco) > 0 {
				if Size_t(nco) > (*Colormap)(unsafe.Pointer(cm)).Fmax {
					// Take this one out of freelist.

					nco = (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(nco)*32)).Fsub
					(*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(pco)*32)).Fsub = nco
				} else {

					pco = nco
					nco = (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(pco)*32)).Fsub
				}
			}
		}
	} else {
		(*Colordesc)(unsafe.Pointer(cd)).Fsub = (*Colormap)(unsafe.Pointer(cm)).Ffree
		(*Colormap)(unsafe.Pointer(cm)).Ffree = Color((int64(cd) - int64((*Colormap)(unsafe.Pointer(cm)).Fcd)) / 32)
	}
}

//
//  - pseudocolor - allocate a false color, to be managed by other means
//  ^ static color pseudocolor(struct colormap *);
//
func pseudocolor(tls *libc.TLS, cm uintptr) Color { /* regc_color.c:359:1: */
	var co Color

	co = newcolor(tls, cm)
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 {
		return int16(-1)
	}
	(*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(co)*32)).Fnchrs = Uchr(1)
	(*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(co)*32)).Fflags = PSEUDO
	return co
}

//
//  - subcolor - allocate a new subcolor (if necessary) to this chr
//  ^ static color subcolor(struct colormap *, pchr c);
//
func subcolor(tls *libc.TLS, cm uintptr, c Pchr) Color { /* regc_color.c:378:1: */
	var co Color  // current color of c
	var sco Color // new subcolor

	co = *(*Color)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cm + 368 + uintptr(c>>BYTBITS&(int32(1)<<BYTBITS-1))*8)) + uintptr(c&(int32(1)<<BYTBITS-1))*2))
	sco = newsub(tls, cm, int32(co))
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 {
		return int16(-1)
	}

	if int32(co) == int32(sco) { // already in an open subcolor
		return co // rest is redundant
	}
	(*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd+uintptr(co)*32)).Fnchrs--
	(*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd+uintptr(sco)*32)).Fnchrs++
	setcolor(tls, cm, c, int32(sco))
	return sco
}

//
//  - newsub - allocate a new subcolor (if necessary) for a color
//  ^ static color newsub(struct colormap *, pcolor);
//
func newsub(tls *libc.TLS, cm uintptr, co Pcolor) Color { /* regc_color.c:406:1: */
	var sco Color // new subcolor

	sco = (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(co)*32)).Fsub
	if int32(sco) == -1 { // color has no open subcolor
		if (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd+uintptr(co)*32)).Fnchrs == Uchr(1) { // optimization
			return Color(co)
		}
		sco = newcolor(tls, cm) // must create subcolor
		if int32(sco) == -1 {

			return int16(-1)
		}
		(*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(co)*32)).Fsub = sco
		(*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(sco)*32)).Fsub = sco // open subcolor points to self
	}

	return sco
}

//
//  - subrange - allocate new subcolors to this range of chrs, fill in arcs
//  ^ static void subrange(struct vars *, pchr, pchr, struct state *,
//  ^ 	struct state *);
//
func subrange(tls *libc.TLS, v uintptr, from Pchr, to Pchr, lp uintptr, rp uintptr) { /* regc_color.c:436:1: */
	var uf Uchr
	var i int32

	// First, align "from" on a tree-block boundary

	uf = Uchr(from)
	i = int32((uf+Uchr(int32(1)<<BYTBITS)-Uchr(1))&libc.Uint32(libc.Uint32FromInt32(libc.CplInt32(int32(1)<<BYTBITS-1))) - uf)
__1:
	if !(from <= to && i > 0) {
		goto __3
	}
	{
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'p', int32(subcolor(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcm, from)), lp, rp)

	}
	goto __2
__2:
	i--
	from++
	goto __1
	goto __3
__3:
	;
	if from > to { // didn't reach a boundary
		return
	}

	// Deal with whole blocks.

	for ; to-from >= int32(1)<<BYTBITS; from = from + int32(1)<<BYTBITS {
		subblock(tls, v, from, lp, rp)
	}

	// Clean up any remaining partial table.

	for ; from <= to; from++ {
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'p', int32(subcolor(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcm, from)), lp, rp)
	}
}

//
//  - subblock - allocate new subcolors for one tree block of chrs, fill in arcs
//  ^ static void subblock(struct vars *, pchr, struct state *, struct state *);
//
func subblock(tls *libc.TLS, v uintptr, start Pchr, lp uintptr, rp uintptr) { /* regc_color.c:483:1: */
	var uc Uchr = Uchr(start)
	var cm uintptr = (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcm
	var shift int32
	var level int32
	var i int32
	var b int32
	var t uintptr
	var cb uintptr
	var fillt uintptr
	var lastt uintptr
	var previ int32
	var ndone int32
	var co Color
	var sco Color

	// Find its color block, making new pointer blocks as needed.

	t = cm + 368 /* &.tree */
	fillt = uintptr(0)
	level = 0
	shift = BYTBITS * ((CHRBITS+BYTBITS-1)/BYTBITS - 1)
__1:
	if !(shift > 0) {
		goto __3
	}
	{
		b = int32(uc >> shift & Uchr(int32(1)<<BYTBITS-1))
		lastt = t
		t = *(*uintptr)(unsafe.Pointer(lastt + uintptr(b)*8))

		fillt = cm + 368 + uintptr(level+1)*2048
		if t == fillt && shift > BYTBITS { // need new ptr block
			t = XTclpAlloc(tls, uint32(unsafe.Sizeof(Ptrs{})))
			if t == uintptr(0) {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr
					}
					return REG_ESPACE
				}()
				return
			}
			libc.Xmemcpy(tls, t, fillt, uint64(int32(1)<<BYTBITS)*uint64(unsafe.Sizeof(uintptr(0))))
			*(*uintptr)(unsafe.Pointer(lastt + uintptr(b)*8)) = t
		}

	}
	goto __2
__2:
	level++
	shift = shift - BYTBITS
	goto __1
	goto __3
__3:
	;

	// Special cases: fill block or solid block.
	co = *(*Color)(unsafe.Pointer(t))
	cb = (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(co)*32)).Fblock
	if t == fillt || t == cb {
		// Either way, we want a subcolor solid block.

		sco = newsub(tls, cm, int32(co))
		t = (*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(sco)*32)).Fblock
		if t == uintptr(0) { // must set it up
			t = XTclpAlloc(tls, uint32(unsafe.Sizeof(Colors{})))
			if t == uintptr(0) {
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr
					}
					return REG_ESPACE
				}()
				return
			}
			for i = 0; i < int32(1)<<BYTBITS; i++ {
				*(*Color)(unsafe.Pointer(t + uintptr(i)*2)) = sco
			}
			(*Colordesc)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(sco)*32)).Fblock = t
		}

		// Find loop must have run at least once.

		*(*uintptr)(unsafe.Pointer(lastt + uintptr(b)*8)) = t
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'p', int32(sco), lp, rp)
		*(*Uchr)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(co)*32)) -= Uchr(int32(1) << BYTBITS)
		*(*Uchr)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(sco)*32)) += Uchr(int32(1) << BYTBITS)
		return
	}

	// General case, a mixed block to be altered.

	i = 0
	for i < int32(1)<<BYTBITS {
		co = *(*Color)(unsafe.Pointer(t + uintptr(i)*2))
		sco = newsub(tls, cm, int32(co))
		newarc(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnfa, 'p', int32(sco), lp, rp)
		previ = i
		for ok := true; ok; ok = i < int32(1)<<BYTBITS && int32(*(*Color)(unsafe.Pointer(t + uintptr(i)*2))) == int32(co) {
			*(*Color)(unsafe.Pointer(t + uintptr(libc.PostIncInt32(&i, 1))*2)) = sco
		}
		ndone = i - previ
		*(*Uchr)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(co)*32)) -= Uchr(ndone)
		*(*Uchr)(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(sco)*32)) += Uchr(ndone)
	}
}

//
//  - okcolors - promote subcolors to full colors
//  ^ static void okcolors(struct nfa *, struct colormap *);
//
func okcolors(tls *libc.TLS, nfa uintptr, cm uintptr) { /* regc_color.c:588:1: */
	var cd uintptr
	var end uintptr = (*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr((*Colormap)(unsafe.Pointer(cm)).Fmax+uint64(1))*32
	var scd uintptr
	var a uintptr
	var co Color
	var sco Color

	cd = (*Colormap)(unsafe.Pointer(cm)).Fcd
	co = int16(0)
__1:
	if !(cd < end) {
		goto __3
	}
	{
		sco = (*Colordesc)(unsafe.Pointer(cd)).Fsub
		if (*Colordesc)(unsafe.Pointer(cd)).Fflags&FREECOL != 0 || int32(sco) == -1 {
			// Has no subcolor, no further action.
		} else if int32(sco) == int32(co) {
			// Is subcolor, let parent deal with it.
		} else if (*Colordesc)(unsafe.Pointer(cd)).Fnchrs == Uchr(0) {
			// Parent empty, its arcs change color to subcolor.

			(*Colordesc)(unsafe.Pointer(cd)).Fsub = int16(-1)
			scd = (*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(sco)*32

			(*Colordesc)(unsafe.Pointer(scd)).Fsub = int16(-1)
			for libc.AssignUintptr(&a, (*Colordesc)(unsafe.Pointer(cd)).Farcs) != uintptr(0) {

				uncolorchain(tls, cm, a)
				(*Arc)(unsafe.Pointer(a)).Fco = sco
				colorchain(tls, cm, a)
			}
			freecolor(tls, cm, int32(co))
		} else {
			// Parent's arcs must gain parallel subcolor arcs.

			(*Colordesc)(unsafe.Pointer(cd)).Fsub = int16(-1)
			scd = (*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr(sco)*32

			(*Colordesc)(unsafe.Pointer(scd)).Fsub = int16(-1)
			for a = (*Colordesc)(unsafe.Pointer(cd)).Farcs; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Fcolorchain {

				newarc(tls, nfa, (*Arc)(unsafe.Pointer(a)).Ftype, int32(sco), (*Arc)(unsafe.Pointer(a)).Ffrom, (*Arc)(unsafe.Pointer(a)).Fto)
			}
		}

	}
	goto __2
__2:
	cd += 32
	co++
	goto __1
	goto __3
__3:
}

//
//  - colorchain - add this arc to the color chain of its color
//  ^ static void colorchain(struct colormap *, struct arc *);
//
func colorchain(tls *libc.TLS, cm uintptr, a uintptr) { /* regc_color.c:649:1: */
	var cd uintptr = (*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr((*Arc)(unsafe.Pointer(a)).Fco)*32

	if (*Colordesc)(unsafe.Pointer(cd)).Farcs != uintptr(0) {
		(*Arc)(unsafe.Pointer((*Colordesc)(unsafe.Pointer(cd)).Farcs)).FcolorchainRev = a
	}
	(*Arc)(unsafe.Pointer(a)).Fcolorchain = (*Colordesc)(unsafe.Pointer(cd)).Farcs
	(*Arc)(unsafe.Pointer(a)).FcolorchainRev = uintptr(0)
	(*Colordesc)(unsafe.Pointer(cd)).Farcs = a
}

//
//  - uncolorchain - delete this arc from the color chain of its color
//  ^ static void uncolorchain(struct colormap *, struct arc *);
//
func uncolorchain(tls *libc.TLS, cm uintptr, a uintptr) { /* regc_color.c:668:1: */
	var cd uintptr = (*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr((*Arc)(unsafe.Pointer(a)).Fco)*32
	var aa uintptr = (*Arc)(unsafe.Pointer(a)).FcolorchainRev

	if aa == uintptr(0) {

		(*Colordesc)(unsafe.Pointer(cd)).Farcs = (*Arc)(unsafe.Pointer(a)).Fcolorchain
	} else {

		(*Arc)(unsafe.Pointer(aa)).Fcolorchain = (*Arc)(unsafe.Pointer(a)).Fcolorchain
	}
	if (*Arc)(unsafe.Pointer(a)).Fcolorchain != uintptr(0) {
		(*Arc)(unsafe.Pointer((*Arc)(unsafe.Pointer(a)).Fcolorchain)).FcolorchainRev = aa
	}
	(*Arc)(unsafe.Pointer(a)).Fcolorchain = uintptr(0) // paranoia
	(*Arc)(unsafe.Pointer(a)).FcolorchainRev = uintptr(0)
}

//
//  - rainbow - add arcs of all full colors (but one) between specified states
//  ^ static void rainbow(struct nfa *, struct colormap *, int, pcolor,
//  ^ 	struct state *, struct state *);
//
func rainbow(tls *libc.TLS, nfa uintptr, cm uintptr, type1 int32, but Pcolor, from uintptr, to uintptr) { /* regc_color.c:695:1: */
	var cd uintptr
	var end uintptr = (*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr((*Colormap)(unsafe.Pointer(cm)).Fmax+uint64(1))*32
	var co Color

	cd = (*Colormap)(unsafe.Pointer(cm)).Fcd
	co = int16(0)
__1:
	if !(cd < end && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0)) {
		goto __3
	}
	{
		if !((*Colordesc)(unsafe.Pointer(cd)).Fflags&FREECOL != 0) && int32((*Colordesc)(unsafe.Pointer(cd)).Fsub) != int32(co) && int32(co) != but &&
			!((*Colordesc)(unsafe.Pointer(cd)).Fflags&PSEUDO != 0) {
			newarc(tls, nfa, type1, int32(co), from, to)
		}

	}
	goto __2
__2:
	cd += 32
	co++
	goto __1
	goto __3
__3:
}

//
//  - colorcomplement - add arcs of complementary colors
//  * The calling sequence ought to be reconciled with cloneouts().
//  ^ static void colorcomplement(struct nfa *, struct colormap *, int,
//  ^ 	struct state *, struct state *, struct state *);
//
func colorcomplement(tls *libc.TLS, nfa uintptr, cm uintptr, type1 int32, of uintptr, from uintptr, to uintptr) { /* regc_color.c:722:1: */
	var cd uintptr
	var end uintptr = (*Colormap)(unsafe.Pointer(cm)).Fcd + uintptr((*Colormap)(unsafe.Pointer(cm)).Fmax+uint64(1))*32
	var co Color

	cd = (*Colormap)(unsafe.Pointer(cm)).Fcd
	co = int16(0)
__1:
	if !(cd < end && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Colormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0)) {
		goto __3
	}
	{
		if !((*Colordesc)(unsafe.Pointer(cd)).Fflags&FREECOL != 0) && !((*Colordesc)(unsafe.Pointer(cd)).Fflags&PSEUDO != 0) {
			if findarc(tls, of, 'p', int32(co)) == uintptr(0) {
				newarc(tls, nfa, type1, int32(co), from, to)
			}
		}

	}
	goto __2
__2:
	cd += 32
	co++
	goto __1
	goto __3
__3:
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// NFA utilities.
// This file is #included by regcomp.c.
//
// Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
//
// Development of this software was funded, in part, by Cray Research Inc.,
// UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
// Corporation, none of whom are responsible for the results. The author
// thanks all of them.
//
// Redistribution and use in source and binary forms -- with or without
// modification -- are permitted for any purpose, provided that
// redistributions in source form retain this entire copyright notice and
// indicate the origin and nature of any modifications.
//
// I'd appreciate being given credit for this package in the documentation of
// software which uses it, but that is not a requirement.
//
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// One or two things that technically ought to be in here are actually in
// color.c, thanks to some incestuous relationships in the color chains.

//
//  - newnfa - set up an NFA
//  ^ static struct nfa *newnfa(struct vars *, struct colormap *, struct nfa *);
//
func newnfa(tls *libc.TLS, v uintptr, cm uintptr, parent uintptr) uintptr { /* regc_nfa.c:45:19: */
	var nfa uintptr

	nfa = XTclpAlloc(tls, uint32(unsafe.Sizeof(Nfa{})))
	if nfa == uintptr(0) {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ESPACE
		}()
		return uintptr(0)
	}

	(*Nfa)(unsafe.Pointer(nfa)).Fstates = uintptr(0)
	(*Nfa)(unsafe.Pointer(nfa)).Fslast = uintptr(0)
	(*Nfa)(unsafe.Pointer(nfa)).Ffree = uintptr(0)
	(*Nfa)(unsafe.Pointer(nfa)).Fnstates = 0
	(*Nfa)(unsafe.Pointer(nfa)).Fcm = cm
	(*Nfa)(unsafe.Pointer(nfa)).Fv = v
	*(*Color)(unsafe.Pointer(nfa + 72)) = libc.AssignPtrInt16(nfa+72+1*2, int16(-1))
	*(*Color)(unsafe.Pointer(nfa + 76)) = libc.AssignPtrInt16(nfa+76+1*2, int16(-1))
	(*Nfa)(unsafe.Pointer(nfa)).Fparent = parent                 // Precedes newfstate so parent is valid.
	(*Nfa)(unsafe.Pointer(nfa)).Fpost = newfstate(tls, nfa, '@') // number 0
	(*Nfa)(unsafe.Pointer(nfa)).Fpre = newfstate(tls, nfa, '>')  // number 1

	(*Nfa)(unsafe.Pointer(nfa)).Finit = newstate(tls, nfa) // May become invalid later.
	(*Nfa)(unsafe.Pointer(nfa)).Ffinal = newstate(tls, nfa)
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr != 0 {
		freenfa(tls, nfa)
		return uintptr(0)
	}
	rainbow(tls, nfa, (*Nfa)(unsafe.Pointer(nfa)).Fcm, 'p', -1, (*Nfa)(unsafe.Pointer(nfa)).Fpre, (*Nfa)(unsafe.Pointer(nfa)).Finit)
	newarc(tls, nfa, '^', 1, (*Nfa)(unsafe.Pointer(nfa)).Fpre, (*Nfa)(unsafe.Pointer(nfa)).Finit)
	newarc(tls, nfa, '^', 0, (*Nfa)(unsafe.Pointer(nfa)).Fpre, (*Nfa)(unsafe.Pointer(nfa)).Finit)
	rainbow(tls, nfa, (*Nfa)(unsafe.Pointer(nfa)).Fcm, 'p', -1, (*Nfa)(unsafe.Pointer(nfa)).Ffinal, (*Nfa)(unsafe.Pointer(nfa)).Fpost)
	newarc(tls, nfa, '$', 1, (*Nfa)(unsafe.Pointer(nfa)).Ffinal, (*Nfa)(unsafe.Pointer(nfa)).Fpost)
	newarc(tls, nfa, '$', 0, (*Nfa)(unsafe.Pointer(nfa)).Ffinal, (*Nfa)(unsafe.Pointer(nfa)).Fpost)

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr != 0 {
		freenfa(tls, nfa)
		return uintptr(0)
	}
	return nfa
}

//
//  - freenfa - free an entire NFA
//  ^ static void freenfa(struct nfa *);
//
func freenfa(tls *libc.TLS, nfa uintptr) { /* regc_nfa.c:96:1: */
	var s uintptr

	for libc.AssignUintptr(&s, (*Nfa)(unsafe.Pointer(nfa)).Fstates) != uintptr(0) {
		(*State)(unsafe.Pointer(s)).Fnins = libc.AssignPtrInt32(s+24, 0) // don't worry about arcs
		freestate(tls, nfa, s)
	}
	for libc.AssignUintptr(&s, (*Nfa)(unsafe.Pointer(nfa)).Ffree) != uintptr(0) {
		(*Nfa)(unsafe.Pointer(nfa)).Ffree = (*State)(unsafe.Pointer(s)).Fnext
		destroystate(tls, nfa, s)
	}

	(*Nfa)(unsafe.Pointer(nfa)).Fslast = uintptr(0)
	(*Nfa)(unsafe.Pointer(nfa)).Fnstates = -1
	(*Nfa)(unsafe.Pointer(nfa)).Fpre = uintptr(0)
	(*Nfa)(unsafe.Pointer(nfa)).Fpost = uintptr(0)
	XTclpFree(tls, nfa)
}

//
//  - newstate - allocate an NFA state, with zero flag value
//  ^ static struct state *newstate(struct nfa *);
//
func newstate(tls *libc.TLS, nfa uintptr) uintptr { /* regc_nfa.c:121:21: */
	var s uintptr

	if (*Nfa)(unsafe.Pointer(nfa)).Ffree != uintptr(0) {
		s = (*Nfa)(unsafe.Pointer(nfa)).Ffree
		(*Nfa)(unsafe.Pointer(nfa)).Ffree = (*State)(unsafe.Pointer(s)).Fnext
	} else {
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fspaceused >= uint64(100000)*uint64(unsafe.Sizeof(State{}))+uint64(100000)*uint64(unsafe.Sizeof(Arcbatch{})) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
				}
				return REG_ETOOBIG
			}()
			return uintptr(0)
		}
		s = XTclpAlloc(tls, uint32(unsafe.Sizeof(State{})))
		if s == uintptr(0) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
				}
				return REG_ESPACE
			}()
			return uintptr(0)
		}
		*(*Size_t)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv + 264)) += Size_t(unsafe.Sizeof(State{}))
		(*State)(unsafe.Pointer(s)).Foas.Fnext = uintptr(0)
		(*State)(unsafe.Pointer(s)).Ffree = uintptr(0)
		(*State)(unsafe.Pointer(s)).Fnoas = 0
	}

	(*State)(unsafe.Pointer(s)).Fno = libc.PostIncInt32(&(*Nfa)(unsafe.Pointer(nfa)).Fnstates, 1)
	(*State)(unsafe.Pointer(s)).Fflag = int8(0)
	if (*Nfa)(unsafe.Pointer(nfa)).Fstates == uintptr(0) {
		(*Nfa)(unsafe.Pointer(nfa)).Fstates = s
	}
	(*State)(unsafe.Pointer(s)).Fnins = 0
	(*State)(unsafe.Pointer(s)).Fins = uintptr(0)
	(*State)(unsafe.Pointer(s)).Fnouts = 0
	(*State)(unsafe.Pointer(s)).Fouts = uintptr(0)
	(*State)(unsafe.Pointer(s)).Ftmp = uintptr(0)
	(*State)(unsafe.Pointer(s)).Fnext = uintptr(0)
	if (*Nfa)(unsafe.Pointer(nfa)).Fslast != uintptr(0) {

		(*State)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fslast)).Fnext = s
	}
	(*State)(unsafe.Pointer(s)).Fprev = (*Nfa)(unsafe.Pointer(nfa)).Fslast
	(*Nfa)(unsafe.Pointer(nfa)).Fslast = s
	return s
}

//
//  - newfstate - allocate an NFA state with a specified flag value
//  ^ static struct state *newfstate(struct nfa *, int flag);
//
func newfstate(tls *libc.TLS, nfa uintptr, flag int32) uintptr { /* regc_nfa.c:171:21: */
	var s uintptr

	s = newstate(tls, nfa)
	if s != uintptr(0) {
		(*State)(unsafe.Pointer(s)).Fflag = int8(flag)
	}
	return s
}

//
//  - dropstate - delete a state's inarcs and outarcs and free it
//  ^ static void dropstate(struct nfa *, struct state *);
//
func dropstate(tls *libc.TLS, nfa uintptr, s uintptr) { /* regc_nfa.c:190:1: */
	var a uintptr

	for libc.AssignUintptr(&a, (*State)(unsafe.Pointer(s)).Fins) != uintptr(0) {
		freearc(tls, nfa, a)
	}
	for libc.AssignUintptr(&a, (*State)(unsafe.Pointer(s)).Fouts) != uintptr(0) {
		freearc(tls, nfa, a)
	}
	freestate(tls, nfa, s)
}

//
//  - freestate - free a state, which has no in-arcs or out-arcs
//  ^ static void freestate(struct nfa *, struct state *);
//
func freestate(tls *libc.TLS, nfa uintptr, s uintptr) { /* regc_nfa.c:210:1: */

	(*State)(unsafe.Pointer(s)).Fno = -1
	(*State)(unsafe.Pointer(s)).Fflag = int8(0)
	if (*State)(unsafe.Pointer(s)).Fnext != uintptr(0) {
		(*State)(unsafe.Pointer((*State)(unsafe.Pointer(s)).Fnext)).Fprev = (*State)(unsafe.Pointer(s)).Fprev
	} else {

		(*Nfa)(unsafe.Pointer(nfa)).Fslast = (*State)(unsafe.Pointer(s)).Fprev
	}
	if (*State)(unsafe.Pointer(s)).Fprev != uintptr(0) {
		(*State)(unsafe.Pointer((*State)(unsafe.Pointer(s)).Fprev)).Fnext = (*State)(unsafe.Pointer(s)).Fnext
	} else {

		(*Nfa)(unsafe.Pointer(nfa)).Fstates = (*State)(unsafe.Pointer(s)).Fnext
	}
	(*State)(unsafe.Pointer(s)).Fprev = uintptr(0)
	(*State)(unsafe.Pointer(s)).Fnext = (*Nfa)(unsafe.Pointer(nfa)).Ffree // don't delete it, put it on the free list
	(*Nfa)(unsafe.Pointer(nfa)).Ffree = s
}

//
//  - destroystate - really get rid of an already-freed state
//  ^ static void destroystate(struct nfa *, struct state *);
//
func destroystate(tls *libc.TLS, nfa uintptr, s uintptr) { /* regc_nfa.c:241:1: */
	var ab uintptr
	var abnext uintptr

	for ab = (*State)(unsafe.Pointer(s)).Foas.Fnext; ab != uintptr(0); ab = abnext {
		abnext = (*Arcbatch)(unsafe.Pointer(ab)).Fnext
		XTclpFree(tls, ab)
		*(*Size_t)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv + 264)) -= Size_t(unsafe.Sizeof(Arcbatch{}))
	}
	(*State)(unsafe.Pointer(s)).Fins = uintptr(0)
	(*State)(unsafe.Pointer(s)).Fouts = uintptr(0)
	(*State)(unsafe.Pointer(s)).Fnext = uintptr(0)
	XTclpFree(tls, s)
	*(*Size_t)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv + 264)) -= Size_t(unsafe.Sizeof(State{}))
}

//
//  - newarc - set up a new arc within an NFA
//  ^ static void newarc(struct nfa *, int, pcolor, struct state *,
//  ^	struct state *);
//
// This function checks to make sure that no duplicate arcs are created.
// In general we never want duplicates.
func newarc(tls *libc.TLS, nfa uintptr, t int32, co Pcolor, from uintptr, to uintptr) { /* regc_nfa.c:271:1: */
	var a uintptr

	// check for duplicate arc, using whichever chain is shorter
	if (*State)(unsafe.Pointer(from)).Fnouts <= (*State)(unsafe.Pointer(to)).Fnins {
		for a = (*State)(unsafe.Pointer(from)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
			if (*Arc)(unsafe.Pointer(a)).Fto == to && int32((*Arc)(unsafe.Pointer(a)).Fco) == co && (*Arc)(unsafe.Pointer(a)).Ftype == t {
				return
			}
		}
	} else {
		for a = (*State)(unsafe.Pointer(to)).Fins; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Finchain {
			if (*Arc)(unsafe.Pointer(a)).Ffrom == from && int32((*Arc)(unsafe.Pointer(a)).Fco) == co && (*Arc)(unsafe.Pointer(a)).Ftype == t {
				return
			}
		}
	}

	// no dup, so create the arc
	createarc(tls, nfa, t, co, from, to)
}

// createarc - create a new arc within an NFA
//
// This function must *only* be used after verifying that there is no existing
// identical arc (same type/color/from/to).
func createarc(tls *libc.TLS, nfa uintptr, t int32, co Pcolor, from uintptr, to uintptr) { /* regc_nfa.c:308:1: */
	var a uintptr

	// the arc is physically allocated within its from-state
	a = allocarc(tls, nfa, from)
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
		return
	}

	(*Arc)(unsafe.Pointer(a)).Ftype = t
	(*Arc)(unsafe.Pointer(a)).Fco = Color(co)
	(*Arc)(unsafe.Pointer(a)).Fto = to
	(*Arc)(unsafe.Pointer(a)).Ffrom = from

	// Put the new arc on the beginning, not the end, of the chains; it's
	// simpler here, and freearc() is the same cost either way.  See also the
	// logic in moveins() and its cohorts, as well as fixempties().
	(*Arc)(unsafe.Pointer(a)).Finchain = (*State)(unsafe.Pointer(to)).Fins
	(*Arc)(unsafe.Pointer(a)).FinchainRev = uintptr(0)
	if (*State)(unsafe.Pointer(to)).Fins != 0 {
		(*Arc)(unsafe.Pointer((*State)(unsafe.Pointer(to)).Fins)).FinchainRev = a
	}
	(*State)(unsafe.Pointer(to)).Fins = a
	(*Arc)(unsafe.Pointer(a)).Foutchain = (*State)(unsafe.Pointer(from)).Fouts
	(*Arc)(unsafe.Pointer(a)).FoutchainRev = uintptr(0)
	if (*State)(unsafe.Pointer(from)).Fouts != 0 {
		(*Arc)(unsafe.Pointer((*State)(unsafe.Pointer(from)).Fouts)).FoutchainRev = a
	}
	(*State)(unsafe.Pointer(from)).Fouts = a

	(*State)(unsafe.Pointer(from)).Fnouts++
	(*State)(unsafe.Pointer(to)).Fnins++

	if ((*Arc)(unsafe.Pointer(a)).Ftype == 'p' || (*Arc)(unsafe.Pointer(a)).Ftype == 'a' || (*Arc)(unsafe.Pointer(a)).Ftype == 'r') && (*Nfa)(unsafe.Pointer(nfa)).Fparent == uintptr(0) {
		colorchain(tls, (*Nfa)(unsafe.Pointer(nfa)).Fcm, a)
	}
}

//
//  - allocarc - allocate a new out-arc within a state
//  ^ static struct arc *allocarc(struct nfa *, struct state *);
//
func allocarc(tls *libc.TLS, nfa uintptr, s uintptr) uintptr { /* regc_nfa.c:359:19: */
	var a uintptr

	// Shortcut

	if (*State)(unsafe.Pointer(s)).Ffree == uintptr(0) && (*State)(unsafe.Pointer(s)).Fnoas < ABSIZE {
		a = s + 72 + 8 + uintptr((*State)(unsafe.Pointer(s)).Fnoas)*72
		(*State)(unsafe.Pointer(s)).Fnoas++
		return a
	}

	// if none at hand, get more

	if (*State)(unsafe.Pointer(s)).Ffree == uintptr(0) {
		var newAb uintptr
		var i int32

		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fspaceused >= uint64(100000)*uint64(unsafe.Sizeof(State{}))+uint64(100000)*uint64(unsafe.Sizeof(Arcbatch{})) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
				}
				return REG_ETOOBIG
			}()
			return uintptr(0)
		}
		newAb = XTclpAlloc(tls, uint32(unsafe.Sizeof(Arcbatch{})))
		if newAb == uintptr(0) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
				}
				return REG_ESPACE
			}()
			return uintptr(0)
		}
		*(*Size_t)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv + 264)) += Size_t(unsafe.Sizeof(Arcbatch{}))
		(*Arcbatch)(unsafe.Pointer(newAb)).Fnext = (*State)(unsafe.Pointer(s)).Foas.Fnext
		(*State)(unsafe.Pointer(s)).Foas.Fnext = newAb

		for i = 0; i < ABSIZE; i++ {
			(*Arc)(unsafe.Pointer(newAb + 8 + uintptr(i)*72)).Ftype = 0
			(*Arc)(unsafe.Pointer(newAb + 8 + uintptr(i)*72)).Foutchain = newAb + 8 + uintptr(i+1)*72
		}
		(*Arc)(unsafe.Pointer(newAb + 8 + 9*72)).Foutchain = uintptr(0)
		(*State)(unsafe.Pointer(s)).Ffree = newAb + 8
	}

	a = (*State)(unsafe.Pointer(s)).Ffree
	(*State)(unsafe.Pointer(s)).Ffree = (*Arc)(unsafe.Pointer(a)).Foutchain
	return a
}

//
//  - freearc - free an arc
//  ^ static void freearc(struct nfa *, struct arc *);
//
func freearc(tls *libc.TLS, nfa uintptr, victim uintptr) { /* regc_nfa.c:416:1: */
	var from uintptr = (*Arc)(unsafe.Pointer(victim)).Ffrom
	var to uintptr = (*Arc)(unsafe.Pointer(victim)).Fto
	var predecessor uintptr

	// Take it off color chain if necessary.

	if ((*Arc)(unsafe.Pointer(victim)).Ftype == 'p' || (*Arc)(unsafe.Pointer(victim)).Ftype == 'a' || (*Arc)(unsafe.Pointer(victim)).Ftype == 'r') && (*Nfa)(unsafe.Pointer(nfa)).Fparent == uintptr(0) {
		uncolorchain(tls, (*Nfa)(unsafe.Pointer(nfa)).Fcm, victim)
	}

	// Take it off source's out-chain.

	predecessor = (*Arc)(unsafe.Pointer(victim)).FoutchainRev
	if predecessor == uintptr(0) {

		(*State)(unsafe.Pointer(from)).Fouts = (*Arc)(unsafe.Pointer(victim)).Foutchain
	} else {

		(*Arc)(unsafe.Pointer(predecessor)).Foutchain = (*Arc)(unsafe.Pointer(victim)).Foutchain
	}
	if (*Arc)(unsafe.Pointer(victim)).Foutchain != uintptr(0) {

		(*Arc)(unsafe.Pointer((*Arc)(unsafe.Pointer(victim)).Foutchain)).FoutchainRev = predecessor
	}
	(*State)(unsafe.Pointer(from)).Fnouts--

	// Take it off target's in-chain.

	predecessor = (*Arc)(unsafe.Pointer(victim)).FinchainRev
	if predecessor == uintptr(0) {

		(*State)(unsafe.Pointer(to)).Fins = (*Arc)(unsafe.Pointer(victim)).Finchain
	} else {

		(*Arc)(unsafe.Pointer(predecessor)).Finchain = (*Arc)(unsafe.Pointer(victim)).Finchain
	}
	if (*Arc)(unsafe.Pointer(victim)).Finchain != uintptr(0) {

		(*Arc)(unsafe.Pointer((*Arc)(unsafe.Pointer(victim)).Finchain)).FinchainRev = predecessor
	}
	(*State)(unsafe.Pointer(to)).Fnins--

	// Clean up and place on from-state's free list.

	(*Arc)(unsafe.Pointer(victim)).Ftype = 0
	(*Arc)(unsafe.Pointer(victim)).Ffrom = uintptr(0) // precautions...
	(*Arc)(unsafe.Pointer(victim)).Fto = uintptr(0)
	(*Arc)(unsafe.Pointer(victim)).Finchain = uintptr(0)
	(*Arc)(unsafe.Pointer(victim)).FinchainRev = uintptr(0)
	(*Arc)(unsafe.Pointer(victim)).Foutchain = uintptr(0)
	(*Arc)(unsafe.Pointer(victim)).FoutchainRev = uintptr(0)
	(*Arc)(unsafe.Pointer(victim)).Foutchain = (*State)(unsafe.Pointer(from)).Ffree
	(*State)(unsafe.Pointer(from)).Ffree = victim
}

// changearctarget - flip an arc to have a different to state
//
// Caller must have verified that there is no pre-existing duplicate arc.
//
// Note that because we store arcs in their from state, we can't easily have
// a similar changearcsource function.
func changearctarget(tls *libc.TLS, a uintptr, newto uintptr) { /* regc_nfa.c:496:1: */
	var oldto uintptr = (*Arc)(unsafe.Pointer(a)).Fto
	var predecessor uintptr

	// take it off old target's in-chain

	predecessor = (*Arc)(unsafe.Pointer(a)).FinchainRev
	if predecessor == uintptr(0) {

		(*State)(unsafe.Pointer(oldto)).Fins = (*Arc)(unsafe.Pointer(a)).Finchain
	} else {

		(*Arc)(unsafe.Pointer(predecessor)).Finchain = (*Arc)(unsafe.Pointer(a)).Finchain
	}
	if (*Arc)(unsafe.Pointer(a)).Finchain != uintptr(0) {

		(*Arc)(unsafe.Pointer((*Arc)(unsafe.Pointer(a)).Finchain)).FinchainRev = predecessor
	}
	(*State)(unsafe.Pointer(oldto)).Fnins--

	(*Arc)(unsafe.Pointer(a)).Fto = newto

	// prepend it to new target's in-chain
	(*Arc)(unsafe.Pointer(a)).Finchain = (*State)(unsafe.Pointer(newto)).Fins
	(*Arc)(unsafe.Pointer(a)).FinchainRev = uintptr(0)
	if (*State)(unsafe.Pointer(newto)).Fins != 0 {
		(*Arc)(unsafe.Pointer((*State)(unsafe.Pointer(newto)).Fins)).FinchainRev = a
	}
	(*State)(unsafe.Pointer(newto)).Fins = a
	(*State)(unsafe.Pointer(newto)).Fnins++
}

//
//  - hasnonemptyout - Does state have a non-EMPTY out arc?
//  ^ static int hasnonemptyout(struct state *);
//
func hasnonemptyout(tls *libc.TLS, s uintptr) int32 { /* regc_nfa.c:536:1: */
	var a uintptr

	for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		if (*Arc)(unsafe.Pointer(a)).Ftype != 'n' {
			return 1
		}
	}
	return 0
}

//
//  - findarc - find arc, if any, from given source with given type and color
//  * If there is more than one such arc, the result is random.
//  ^ static struct arc *findarc(struct state *, int, pcolor);
//
func findarc(tls *libc.TLS, s uintptr, type1 int32, co Pcolor) uintptr { /* regc_nfa.c:554:19: */
	var a uintptr

	for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		if (*Arc)(unsafe.Pointer(a)).Ftype == type1 && int32((*Arc)(unsafe.Pointer(a)).Fco) == co {
			return a
		}
	}
	return uintptr(0)
}

//
//  - cparc - allocate a new arc within an NFA, copying details from old one
//  ^ static void cparc(struct nfa *, struct arc *, struct state *,
//  ^ 	struct state *);
//
func cparc(tls *libc.TLS, nfa uintptr, oa uintptr, from uintptr, to uintptr) { /* regc_nfa.c:576:1: */
	newarc(tls, nfa, (*Arc)(unsafe.Pointer(oa)).Ftype, int32((*Arc)(unsafe.Pointer(oa)).Fco), from, to)
}

// sortins - sort the in arcs of a state by from/color/type
func sortins(tls *libc.TLS, nfa uintptr, s uintptr) { /* regc_nfa.c:589:1: */
	var sortarray uintptr
	var a uintptr
	var n int32 = (*State)(unsafe.Pointer(s)).Fnins
	var i int32

	if n <= 1 {
		return // nothing to do
	}
	// make an array of arc pointers ...
	sortarray = XTclpAlloc(tls, uint32(uint64(n)*uint64(unsafe.Sizeof(uintptr(0)))))
	if sortarray == uintptr(0) {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
			}
			return REG_ESPACE
		}()
		return
	}
	i = 0
	for a = (*State)(unsafe.Pointer(s)).Fins; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Finchain {
		*(*uintptr)(unsafe.Pointer(sortarray + uintptr(libc.PostIncInt32(&i, 1))*8)) = a
	}

	// ... sort the array
	libc.Xqsort(tls, sortarray, uint64(n), uint64(unsafe.Sizeof(uintptr(0))), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{sortins_cmp})))
	// ... and rebuild arc list in order
	// it seems worth special-casing first and last items to simplify loop
	a = *(*uintptr)(unsafe.Pointer(sortarray))
	(*State)(unsafe.Pointer(s)).Fins = a
	(*Arc)(unsafe.Pointer(a)).Finchain = *(*uintptr)(unsafe.Pointer(sortarray + 1*8))
	(*Arc)(unsafe.Pointer(a)).FinchainRev = uintptr(0)
	for i = 1; i < n-1; i++ {
		a = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i)*8))
		(*Arc)(unsafe.Pointer(a)).Finchain = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i+1)*8))
		(*Arc)(unsafe.Pointer(a)).FinchainRev = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i-1)*8))
	}
	a = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i)*8))
	(*Arc)(unsafe.Pointer(a)).Finchain = uintptr(0)
	(*Arc)(unsafe.Pointer(a)).FinchainRev = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i-1)*8))
	XTclpFree(tls, sortarray)
}

func sortins_cmp(tls *libc.TLS, a uintptr, b uintptr) int32 { /* regc_nfa.c:632:1: */
	var aa uintptr = *(*uintptr)(unsafe.Pointer(a))
	var bb uintptr = *(*uintptr)(unsafe.Pointer(b))

	// we check the fields in the order they are most likely to be different
	if (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(aa)).Ffrom)).Fno < (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(bb)).Ffrom)).Fno {
		return -1
	}
	if (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(aa)).Ffrom)).Fno > (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(bb)).Ffrom)).Fno {
		return 1
	}
	if int32((*Arc)(unsafe.Pointer(aa)).Fco) < int32((*Arc)(unsafe.Pointer(bb)).Fco) {
		return -1
	}
	if int32((*Arc)(unsafe.Pointer(aa)).Fco) > int32((*Arc)(unsafe.Pointer(bb)).Fco) {
		return 1
	}
	if (*Arc)(unsafe.Pointer(aa)).Ftype < (*Arc)(unsafe.Pointer(bb)).Ftype {
		return -1
	}
	if (*Arc)(unsafe.Pointer(aa)).Ftype > (*Arc)(unsafe.Pointer(bb)).Ftype {
		return 1
	}
	return 0
}

// sortouts - sort the out arcs of a state by to/color/type
func sortouts(tls *libc.TLS, nfa uintptr, s uintptr) { /* regc_nfa.c:665:1: */
	var sortarray uintptr
	var a uintptr
	var n int32 = (*State)(unsafe.Pointer(s)).Fnouts
	var i int32

	if n <= 1 {
		return // nothing to do
	}
	// make an array of arc pointers ...
	sortarray = XTclpAlloc(tls, uint32(uint64(n)*uint64(unsafe.Sizeof(uintptr(0)))))
	if sortarray == uintptr(0) {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
			}
			return REG_ESPACE
		}()
		return
	}
	i = 0
	for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		*(*uintptr)(unsafe.Pointer(sortarray + uintptr(libc.PostIncInt32(&i, 1))*8)) = a
	}

	// ... sort the array
	libc.Xqsort(tls, sortarray, uint64(n), uint64(unsafe.Sizeof(uintptr(0))), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{sortouts_cmp})))
	// ... and rebuild arc list in order
	// it seems worth special-casing first and last items to simplify loop
	a = *(*uintptr)(unsafe.Pointer(sortarray))
	(*State)(unsafe.Pointer(s)).Fouts = a
	(*Arc)(unsafe.Pointer(a)).Foutchain = *(*uintptr)(unsafe.Pointer(sortarray + 1*8))
	(*Arc)(unsafe.Pointer(a)).FoutchainRev = uintptr(0)
	for i = 1; i < n-1; i++ {
		a = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i)*8))
		(*Arc)(unsafe.Pointer(a)).Foutchain = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i+1)*8))
		(*Arc)(unsafe.Pointer(a)).FoutchainRev = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i-1)*8))
	}
	a = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i)*8))
	(*Arc)(unsafe.Pointer(a)).Foutchain = uintptr(0)
	(*Arc)(unsafe.Pointer(a)).FoutchainRev = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i-1)*8))
	XTclpFree(tls, sortarray)
}

func sortouts_cmp(tls *libc.TLS, a uintptr, b uintptr) int32 { /* regc_nfa.c:708:1: */
	var aa uintptr = *(*uintptr)(unsafe.Pointer(a))
	var bb uintptr = *(*uintptr)(unsafe.Pointer(b))

	// we check the fields in the order they are most likely to be different
	if (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(aa)).Fto)).Fno < (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(bb)).Fto)).Fno {
		return -1
	}
	if (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(aa)).Fto)).Fno > (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(bb)).Fto)).Fno {
		return 1
	}
	if int32((*Arc)(unsafe.Pointer(aa)).Fco) < int32((*Arc)(unsafe.Pointer(bb)).Fco) {
		return -1
	}
	if int32((*Arc)(unsafe.Pointer(aa)).Fco) > int32((*Arc)(unsafe.Pointer(bb)).Fco) {
		return 1
	}
	if (*Arc)(unsafe.Pointer(aa)).Ftype < (*Arc)(unsafe.Pointer(bb)).Ftype {
		return -1
	}
	if (*Arc)(unsafe.Pointer(aa)).Ftype > (*Arc)(unsafe.Pointer(bb)).Ftype {
		return 1
	}
	return 0
}

// Common decision logic about whether to use arc-by-arc operations or
// sort/merge.  If there's just a few source arcs we cannot recoup the
// cost of sorting the destination arc list, no matter how large it is.
// Otherwise, limit the number of arc-by-arc comparisons to about 1000
// (a somewhat arbitrary choice, but the breakeven point would probably
// be machine dependent anyway).

//
//  - moveins - move all in arcs of a state to another state
//  * You might think this could be done better by just updating the
//  * existing arcs, and you would be right if it weren't for the need
//  * for duplicate suppression, which makes it easier to just make new
//  * ones to exploit the suppression built into newarc.
//  *
//  * However, if we have a whole lot of arcs to deal with, retail duplicate
//  * checks become too slow.  In that case we proceed by sorting and merging
//  * the arc lists, and then we can indeed just update the arcs in-place.
//  *
//  ^ static void moveins(struct nfa *, struct state *, struct state *);
//
func moveins(tls *libc.TLS, nfa uintptr, oldState uintptr, newState uintptr) { /* regc_nfa.c:762:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	if !(func() int32 {
		if (*State)(unsafe.Pointer(oldState)).Fnins < 4 {
			return 0
		}
		return libc.Bool32((*State)(unsafe.Pointer(oldState)).Fnins > 32 || (*State)(unsafe.Pointer(newState)).Fnins > 32)
	}() != 0) {
		// With not too many arcs, just do them one at a time
		var a uintptr

		for libc.AssignUintptr(&a, (*State)(unsafe.Pointer(oldState)).Fins) != uintptr(0) {
			cparc(tls, nfa, a, (*Arc)(unsafe.Pointer(a)).Ffrom, newState)
			freearc(tls, nfa, a)
		}
	} else {
		// With many arcs, use a sort-merge approach.  Note changearctarget()
		// will put the arc onto the front of newState's chain, so it does not
		// break our walk through the sorted part of the chain.
		// var oa uintptr at bp, 8

		// var na uintptr at bp+8, 8

		// Because we bypass newarc() in this code path, we'd better include a
		// cancel check.
		if 0 != 0 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
				}
				return REG_CANCEL
			}()
			return
		}

		sortins(tls, nfa, oldState)
		sortins(tls, nfa, newState)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
			return // might have failed to sort
		}
		*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*State)(unsafe.Pointer(oldState)).Fins
		*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*State)(unsafe.Pointer(newState)).Fins
		for *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) && *(*uintptr)(unsafe.Pointer(bp + 8)) != uintptr(0) {
			var a uintptr = *(*uintptr)(unsafe.Pointer(bp /* oa */))

			switch sortins_cmp(tls, bp, bp+8) {
			case -1:
				// newState does not have anything matching oa
				*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Finchain

				// Rather than doing createarc+freearc, we can just unlink
				// and relink the existing arc struct.
				changearctarget(tls, a, newState)
				break
				fallthrough
			case 0:
				// match, advance in both lists
				*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Finchain
				*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)))).Finchain
				// ... and drop duplicate arc from oldState
				freearc(tls, nfa, a)
				break
				fallthrough
			case +1:
				// advance only na; oa might have a match later
				*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)))).Finchain
				break
				fallthrough
			default:

			}
		}
		for *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			// newState does not have anything matching oa
			var a uintptr = *(*uintptr)(unsafe.Pointer(bp /* oa */))

			*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Finchain
			changearctarget(tls, a, newState)
		}
	}

}

//
//  - copyins - copy in arcs of a state to another state
//  ^ static VOID copyins(struct nfa *, struct state *, struct state *, int);
//
func copyins(tls *libc.TLS, nfa uintptr, oldState uintptr, newState uintptr) { /* regc_nfa.c:849:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	if !(func() int32 {
		if (*State)(unsafe.Pointer(oldState)).Fnins < 4 {
			return 0
		}
		return libc.Bool32((*State)(unsafe.Pointer(oldState)).Fnins > 32 || (*State)(unsafe.Pointer(newState)).Fnins > 32)
	}() != 0) {
		// With not too many arcs, just do them one at a time
		var a uintptr

		for a = (*State)(unsafe.Pointer(oldState)).Fins; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Finchain {
			cparc(tls, nfa, a, (*Arc)(unsafe.Pointer(a)).Ffrom, newState)
		}
	} else {
		// With many arcs, use a sort-merge approach.  Note that createarc()
		// will put new arcs onto the front of newState's chain, so it does
		// not break our walk through the sorted part of the chain.
		// var oa uintptr at bp, 8

		// var na uintptr at bp+8, 8

		// Because we bypass newarc() in this code path, we'd better include a
		// cancel check.
		if 0 != 0 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
				}
				return REG_CANCEL
			}()
			return
		}

		sortins(tls, nfa, oldState)
		sortins(tls, nfa, newState)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
			return // might have failed to sort
		}
		*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*State)(unsafe.Pointer(oldState)).Fins
		*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*State)(unsafe.Pointer(newState)).Fins
		for *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) && *(*uintptr)(unsafe.Pointer(bp + 8)) != uintptr(0) {
			var a uintptr = *(*uintptr)(unsafe.Pointer(bp /* oa */))

			switch sortins_cmp(tls, bp, bp+8) {
			case -1:
				// newState does not have anything matching oa
				*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Finchain
				createarc(tls, nfa, (*Arc)(unsafe.Pointer(a)).Ftype, int32((*Arc)(unsafe.Pointer(a)).Fco), (*Arc)(unsafe.Pointer(a)).Ffrom, newState)
				break
				fallthrough
			case 0:
				// match, advance in both lists
				*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Finchain
				*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)))).Finchain
				break
				fallthrough
			case +1:
				// advance only na; oa might have a match later
				*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)))).Finchain
				break
				fallthrough
			default:

			}
		}
		for *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			// newState does not have anything matching oa
			var a uintptr = *(*uintptr)(unsafe.Pointer(bp /* oa */))

			*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Finchain
			createarc(tls, nfa, (*Arc)(unsafe.Pointer(a)).Ftype, int32((*Arc)(unsafe.Pointer(a)).Fco), (*Arc)(unsafe.Pointer(a)).Ffrom, newState)
		}
	}
}

// mergeins - merge a list of inarcs into a state
//
// This is much like copyins, but the source arcs are listed in an array,
// and are not guaranteed unique.  It's okay to clobber the array contents.
func mergeins(tls *libc.TLS, nfa uintptr, s uintptr, arcarray uintptr, arccount int32) { /* regc_nfa.c:927:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var na uintptr at bp+8, 8

	var i int32
	var j int32

	if arccount <= 0 {
		return
	}

	// Because we bypass newarc() in this code path, we'd better include a
	// cancel check.
	if 0 != 0 {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
			}
			return REG_CANCEL
		}()
		return
	}

	// Sort existing inarcs as well as proposed new ones
	sortins(tls, nfa, s)
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
		return // might have failed to sort
	}

	libc.Xqsort(tls, arcarray, uint64(arccount), uint64(unsafe.Sizeof(uintptr(0))), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{sortins_cmp})))

	// arcarray very likely includes dups, so we must eliminate them.  (This
	// could be folded into the next loop, but it's not worth the trouble.)
	j = 0
	for i = 1; i < arccount; i++ {
		switch sortins_cmp(tls, arcarray+uintptr(j)*8, arcarray+uintptr(i)*8) {
		case -1:
			// non-dup
			*(*uintptr)(unsafe.Pointer(arcarray + uintptr(libc.PreIncInt32(&j, 1))*8)) = *(*uintptr)(unsafe.Pointer(arcarray + uintptr(i)*8))
			break
		case 0:
			// dup
			break
		default:
			// trouble

		}
	}
	arccount = j + 1

	// Now merge into s' inchain.  Note that createarc() will put new arcs
	// onto the front of s's chain, so it does not break our walk through the
	// sorted part of the chain.
	i = 0
	*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*State)(unsafe.Pointer(s)).Fins
	for i < arccount && *(*uintptr)(unsafe.Pointer(bp + 8)) != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(bp /* a */)) = *(*uintptr)(unsafe.Pointer(arcarray + uintptr(i)*8))

		switch sortins_cmp(tls, bp, bp+8) {
		case -1:
			// s does not have anything matching a
			createarc(tls, nfa, (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* a */)))).Ftype, int32((*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* a */)))).Fco), (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* a */)))).Ffrom, s)
			i++
			break
		case 0:
			// match, advance in both lists
			i++
			*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)))).Finchain
			break
		case +1:
			// advance only na; array might have a match later
			*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)))).Finchain
			break
		default:

		}
	}
	for i < arccount {
		// s does not have anything matching a
		var a uintptr = *(*uintptr)(unsafe.Pointer(arcarray + uintptr(i)*8))

		createarc(tls, nfa, (*Arc)(unsafe.Pointer(a)).Ftype, int32((*Arc)(unsafe.Pointer(a)).Fco), (*Arc)(unsafe.Pointer(a)).Ffrom, s)
		i++
	}
}

//
//  - moveouts - move all out arcs of a state to another state
//  ^ static void moveouts(struct nfa *, struct state *, struct state *);
//
func moveouts(tls *libc.TLS, nfa uintptr, oldState uintptr, newState uintptr) { /* regc_nfa.c:1022:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	if !(func() int32 {
		if (*State)(unsafe.Pointer(oldState)).Fnouts < 4 {
			return 0
		}
		return libc.Bool32((*State)(unsafe.Pointer(oldState)).Fnouts > 32 || (*State)(unsafe.Pointer(newState)).Fnouts > 32)
	}() != 0) {
		// With not too many arcs, just do them one at a time
		var a uintptr

		for libc.AssignUintptr(&a, (*State)(unsafe.Pointer(oldState)).Fouts) != uintptr(0) {
			cparc(tls, nfa, a, newState, (*Arc)(unsafe.Pointer(a)).Fto)
			freearc(tls, nfa, a)
		}
	} else {
		// With many arcs, use a sort-merge approach.  Note that createarc()
		// will put new arcs onto the front of newState's chain, so it does
		// not break our walk through the sorted part of the chain.
		// var oa uintptr at bp, 8

		// var na uintptr at bp+8, 8

		// Because we bypass newarc() in this code path, we'd better include a
		// cancel check.
		if 0 != 0 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
				}
				return REG_CANCEL
			}()
			return
		}

		sortouts(tls, nfa, oldState)
		sortouts(tls, nfa, newState)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
			return // might have failed to sort
		}
		*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*State)(unsafe.Pointer(oldState)).Fouts
		*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*State)(unsafe.Pointer(newState)).Fouts
		for *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) && *(*uintptr)(unsafe.Pointer(bp + 8)) != uintptr(0) {
			var a uintptr = *(*uintptr)(unsafe.Pointer(bp /* oa */))

			switch sortouts_cmp(tls, bp, bp+8) {
			case -1:
				// newState does not have anything matching oa
				*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Foutchain
				createarc(tls, nfa, (*Arc)(unsafe.Pointer(a)).Ftype, int32((*Arc)(unsafe.Pointer(a)).Fco), newState, (*Arc)(unsafe.Pointer(a)).Fto)
				freearc(tls, nfa, a)
				break
				fallthrough
			case 0:
				// match, advance in both lists
				*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Foutchain
				*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)))).Foutchain
				// ... and drop duplicate arc from oldState
				freearc(tls, nfa, a)
				break
				fallthrough
			case +1:
				// advance only na; oa might have a match later
				*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)))).Foutchain
				break
				fallthrough
			default:

			}
		}
		for *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			// newState does not have anything matching oa
			var a uintptr = *(*uintptr)(unsafe.Pointer(bp /* oa */))

			*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Foutchain
			createarc(tls, nfa, (*Arc)(unsafe.Pointer(a)).Ftype, int32((*Arc)(unsafe.Pointer(a)).Fco), newState, (*Arc)(unsafe.Pointer(a)).Fto)
			freearc(tls, nfa, a)
		}
	}

}

//
//  - copyouts - copy out arcs of a state to another state
//  ^ static VOID copyouts(struct nfa *, struct state *, struct state *, int);
//
func copyouts(tls *libc.TLS, nfa uintptr, oldState uintptr, newState uintptr) { /* regc_nfa.c:1106:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	if !(func() int32 {
		if (*State)(unsafe.Pointer(oldState)).Fnouts < 4 {
			return 0
		}
		return libc.Bool32((*State)(unsafe.Pointer(oldState)).Fnouts > 32 || (*State)(unsafe.Pointer(newState)).Fnouts > 32)
	}() != 0) {
		// With not too many arcs, just do them one at a time
		var a uintptr

		for a = (*State)(unsafe.Pointer(oldState)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
			cparc(tls, nfa, a, newState, (*Arc)(unsafe.Pointer(a)).Fto)
		}
	} else {
		// With many arcs, use a sort-merge approach.  Note that createarc()
		// will put new arcs onto the front of newState's chain, so it does
		// not break our walk through the sorted part of the chain.
		// var oa uintptr at bp, 8

		// var na uintptr at bp+8, 8

		// Because we bypass newarc() in this code path, we'd better include a
		// cancel check.
		if 0 != 0 {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
				}
				return REG_CANCEL
			}()
			return
		}

		sortouts(tls, nfa, oldState)
		sortouts(tls, nfa, newState)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
			return // might have failed to sort
		}
		*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*State)(unsafe.Pointer(oldState)).Fouts
		*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*State)(unsafe.Pointer(newState)).Fouts
		for *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) && *(*uintptr)(unsafe.Pointer(bp + 8)) != uintptr(0) {
			var a uintptr = *(*uintptr)(unsafe.Pointer(bp /* oa */))

			switch sortouts_cmp(tls, bp, bp+8) {
			case -1:
				// newState does not have anything matching oa
				*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Foutchain
				createarc(tls, nfa, (*Arc)(unsafe.Pointer(a)).Ftype, int32((*Arc)(unsafe.Pointer(a)).Fco), newState, (*Arc)(unsafe.Pointer(a)).Fto)
				break
				fallthrough
			case 0:
				// match, advance in both lists
				*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Foutchain
				*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)))).Foutchain
				break
				fallthrough
			case +1:
				// advance only na; oa might have a match later
				*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* na */)))).Foutchain
				break
				fallthrough
			default:

			}
		}
		for *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			// newState does not have anything matching oa
			var a uintptr = *(*uintptr)(unsafe.Pointer(bp /* oa */))

			*(*uintptr)(unsafe.Pointer(bp /* oa */)) = (*Arc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* oa */)))).Foutchain
			createarc(tls, nfa, (*Arc)(unsafe.Pointer(a)).Ftype, int32((*Arc)(unsafe.Pointer(a)).Fco), newState, (*Arc)(unsafe.Pointer(a)).Fto)
		}
	}
}

//
//  - cloneouts - copy out arcs of a state to another state pair, modifying type
//  ^ static void cloneouts(struct nfa *, struct state *, struct state *,
//  ^ 	struct state *, int);
//
func cloneouts(tls *libc.TLS, nfa uintptr, old uintptr, from uintptr, to uintptr, type1 int32) { /* regc_nfa.c:1183:1: */
	var a uintptr

	for a = (*State)(unsafe.Pointer(old)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		newarc(tls, nfa, type1, int32((*Arc)(unsafe.Pointer(a)).Fco), from, to)
	}
}

//
//  - delsub - delete a sub-NFA, updating subre pointers if necessary
//  * This uses a recursive traversal of the sub-NFA, marking already-seen
//  * states using their tmp pointer.
//  ^ static void delsub(struct nfa *, struct state *, struct state *);
//
func delsub(tls *libc.TLS, nfa uintptr, lp uintptr, rp uintptr) { /* regc_nfa.c:1206:1: */

	(*State)(unsafe.Pointer(rp)).Ftmp = rp // mark end

	deltraverse(tls, nfa, lp, lp)
	// did the job
	// no more

	(*State)(unsafe.Pointer(rp)).Ftmp = uintptr(0) // unmark end
	(*State)(unsafe.Pointer(lp)).Ftmp = uintptr(0) // and begin, marked by deltraverse
}

//
//  - deltraverse - the recursive heart of delsub
//  * This routine's basic job is to destroy all out-arcs of the state.
//  ^ static void deltraverse(struct nfa *, struct state *, struct state *);
//
func deltraverse(tls *libc.TLS, nfa uintptr, leftend uintptr, s uintptr) { /* regc_nfa.c:1229:1: */
	var a uintptr
	var to uintptr

	if (*State)(unsafe.Pointer(s)).Fnouts == 0 {
		return // nothing to do
	}
	if (*State)(unsafe.Pointer(s)).Ftmp != uintptr(0) {
		return // already in progress
	}

	(*State)(unsafe.Pointer(s)).Ftmp = s // mark as in progress

	for libc.AssignUintptr(&a, (*State)(unsafe.Pointer(s)).Fouts) != uintptr(0) {
		to = (*Arc)(unsafe.Pointer(a)).Fto
		deltraverse(tls, nfa, leftend, to)

		freearc(tls, nfa, a)
		if (*State)(unsafe.Pointer(to)).Fnins == 0 && (*State)(unsafe.Pointer(to)).Ftmp == uintptr(0) {

			freestate(tls, nfa, to)
		}
	}

	// we're still here
	// and still reachable
	// but have no outarcs

	(*State)(unsafe.Pointer(s)).Ftmp = uintptr(0) // we're done here
}

//
//  - dupnfa - duplicate sub-NFA
//  * Another recursive traversal, this time using tmp to point to duplicates as
//  * well as mark already-seen states. (You knew there was a reason why it's a
//  * state pointer, didn't you? :-))
//  ^ static void dupnfa(struct nfa *, struct state *, struct state *,
//  ^ 	struct state *, struct state *);
//
func dupnfa(tls *libc.TLS, nfa uintptr, start uintptr, stop uintptr, from uintptr, to uintptr) { /* regc_nfa.c:1273:1: */
	if start == stop {
		newarc(tls, nfa, 'n', 0, from, to)
		return
	}

	(*State)(unsafe.Pointer(stop)).Ftmp = to
	duptraverse(tls, nfa, start, from, 0)
	// done, except for clearing out the tmp pointers

	(*State)(unsafe.Pointer(stop)).Ftmp = uintptr(0)
	cleartraverse(tls, nfa, start)
}

//
//  - duptraverse - recursive heart of dupnfa
//  ^ static void duptraverse(struct nfa *, struct state *, struct state *);
//
func duptraverse(tls *libc.TLS, nfa uintptr, s uintptr, stmp uintptr, depth int32) { /* regc_nfa.c:1298:1: */
	var a uintptr

	if (*State)(unsafe.Pointer(s)).Ftmp != uintptr(0) {
		return // already done
	}

	(*State)(unsafe.Pointer(s)).Ftmp = func() uintptr {
		if stmp == uintptr(0) {
			return newstate(tls, nfa)
		}
		return stmp
	}()
	if (*State)(unsafe.Pointer(s)).Ftmp == uintptr(0) {

		return
	}

	// Arbitrary depth limit. Needs tuning, but this value is sufficient to
	// make all normal tests (not reg-33.14) pass.

	if libc.PostIncInt32(&depth, 1) > DUPTRAVERSE_MAX_DEPTH {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
			}
			return REG_ESPACE
		}()
	}

	for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0) && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		duptraverse(tls, nfa, (*Arc)(unsafe.Pointer(a)).Fto, uintptr(0), depth)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
			break
		}

		cparc(tls, nfa, a, (*State)(unsafe.Pointer(s)).Ftmp, (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(a)).Fto)).Ftmp)
	}
}

//
//  - cleartraverse - recursive cleanup for algorithms that leave tmp ptrs set
//  ^ static void cleartraverse(struct nfa *, struct state *);
//
func cleartraverse(tls *libc.TLS, nfa uintptr, s uintptr) { /* regc_nfa.c:1343:1: */
	var a uintptr

	if (*State)(unsafe.Pointer(s)).Ftmp == uintptr(0) {
		return
	}
	(*State)(unsafe.Pointer(s)).Ftmp = uintptr(0)

	for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		cleartraverse(tls, nfa, (*Arc)(unsafe.Pointer(a)).Fto)
	}
}

//
//  - specialcolors - fill in special colors for an NFA
//  ^ static void specialcolors(struct nfa *);
//
func specialcolors(tls *libc.TLS, nfa uintptr) { /* regc_nfa.c:1364:1: */
	// False colors for BOS, BOL, EOS, EOL

	if (*Nfa)(unsafe.Pointer(nfa)).Fparent == uintptr(0) {
		*(*Color)(unsafe.Pointer(nfa + 72)) = pseudocolor(tls, (*Nfa)(unsafe.Pointer(nfa)).Fcm)
		*(*Color)(unsafe.Pointer(nfa + 72 + 1*2)) = pseudocolor(tls, (*Nfa)(unsafe.Pointer(nfa)).Fcm)
		*(*Color)(unsafe.Pointer(nfa + 76)) = pseudocolor(tls, (*Nfa)(unsafe.Pointer(nfa)).Fcm)
		*(*Color)(unsafe.Pointer(nfa + 76 + 1*2)) = pseudocolor(tls, (*Nfa)(unsafe.Pointer(nfa)).Fcm)
	} else {

		*(*Color)(unsafe.Pointer(nfa + 72)) = *(*Color)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fparent + 72))

		*(*Color)(unsafe.Pointer(nfa + 72 + 1*2)) = *(*Color)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fparent + 72 + 1*2))

		*(*Color)(unsafe.Pointer(nfa + 76)) = *(*Color)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fparent + 76))

		*(*Color)(unsafe.Pointer(nfa + 76 + 1*2)) = *(*Color)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fparent + 76 + 1*2))
	}
}

//
//  - optimize - optimize an NFA
//  ^ static long optimize(struct nfa *, FILE *);
//

// The main goal of this function is not so much "optimization" (though it
// does try to get rid of useless NFA states) as reducing the NFA to a form
// the regex executor can handle.  The executor, and indeed the cNFA format
// that is its input, can only handle PLAIN and LACON arcs.  The output of
// the regex parser also includes EMPTY (do-nothing) arcs, as well as
// ^, $, AHEAD, and BEHIND constraint arcs, which we must get rid of here.
// We first get rid of EMPTY arcs and then deal with the constraint arcs.
// The hardest part of either job is to get rid of circular loops of the
// target arc type.  We would have to do that in any case, though, as such a
// loop would otherwise allow the executor to cycle through the loop endlessly
// without making any progress in the input string.
func optimize(tls *libc.TLS, nfa uintptr, f uintptr) int64 { /* regc_nfa.c:1407:1: */
	var verbose int32
	if f != uintptr(0) {
		verbose = 1
	} else {
		verbose = 0
	}

	if verbose != 0 {
		libc.Xfprintf(tls, f, ts+362, 0)
	}
	cleanup(tls, nfa) // may simplify situation
	if verbose != 0 {
		dumpnfa(tls, nfa, f)
	}
	if verbose != 0 {
		libc.Xfprintf(tls, f, ts+381, 0)
	}
	fixempties(tls, nfa, f) // get rid of EMPTY arcs
	if verbose != 0 {
		libc.Xfprintf(tls, f, ts+392, 0)
	}
	fixconstraintloops(tls, nfa, f) // get rid of constraint loops
	pullback(tls, nfa, f)           // pull back constraints backward
	pushfwd(tls, nfa, f)            // push fwd constraints forward
	if verbose != 0 {
		libc.Xfprintf(tls, f, ts+407, 0)
	}
	cleanup(tls, nfa)        // final tidying
	return analyze(tls, nfa) // and analysis
}

//
//  - pullback - pull back constraints backward to eliminate them
//  ^ static void pullback(struct nfa *, FILE *);
//
func pullback(tls *libc.TLS, nfa uintptr, f uintptr) { /* regc_nfa.c:1447:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var s uintptr
	var nexts uintptr
	var a uintptr
	var nexta uintptr
	// var intermediates uintptr at bp, 8

	var progress int32

	// Find and pull until there are no more.

	for ok := true; ok; ok = progress != 0 && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0) {
		progress = 0
		for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0) && !((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); s = nexts {
			nexts = (*State)(unsafe.Pointer(s)).Fnext
			*(*uintptr)(unsafe.Pointer(bp /* intermediates */)) = uintptr(0)
			for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0) && !((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); a = nexta {
				nexta = (*Arc)(unsafe.Pointer(a)).Foutchain
				if (*Arc)(unsafe.Pointer(a)).Ftype == '^' || (*Arc)(unsafe.Pointer(a)).Ftype == 'r' {
					if pull(tls, nfa, a, bp) != 0 {
						progress = 1
					}
				}

			}
			// clear tmp fields of intermediate states created here
			for *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
				var ns uintptr = (*State)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* intermediates */)))).Ftmp

				(*State)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* intermediates */)))).Ftmp = uintptr(0)
				*(*uintptr)(unsafe.Pointer(bp /* intermediates */)) = ns
			}
			// if s is now useless, get rid of it
			if ((*State)(unsafe.Pointer(s)).Fnins == 0 || (*State)(unsafe.Pointer(s)).Fnouts == 0) && !(int32((*State)(unsafe.Pointer(s)).Fflag) != 0) {
				dropstate(tls, nfa, s)
			}
		}
		if progress != 0 && f != uintptr(0) {
			dumpnfa(tls, nfa, f)
		}
	}
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
		return
	}

	// Any ^ constraints we were able to pull to the start state can now be
	// replaced by PLAIN arcs referencing the BOS or BOL colors.  There should
	// be no other ^ or BEHIND arcs left in the NFA, though we do not check
	// that here (compact() will fail if so).
	for a = (*State)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fpre)).Fouts; a != uintptr(0); a = nexta {
		nexta = (*Arc)(unsafe.Pointer(a)).Foutchain
		if (*Arc)(unsafe.Pointer(a)).Ftype == '^' {

			newarc(tls, nfa, 'p', int32(*(*Color)(unsafe.Pointer(nfa + 72 + uintptr((*Arc)(unsafe.Pointer(a)).Fco)*2))), (*Arc)(unsafe.Pointer(a)).Ffrom, (*Arc)(unsafe.Pointer(a)).Fto)
			freearc(tls, nfa, a)
		}
	}
}

//
//  - pull - pull a back constraint backward past its source state
//  *
//  * Returns 1 if successful (which it always is unless the source is the
//  * start state or we have an internal error), 0 if nothing happened.
//  *
//  * A significant property of this function is that it deletes no pre-existing
//  * states, and no outarcs of the constraint's from state other than the given
//  * constraint arc.  This makes the loops in pullback() safe, at the cost that
//  * we may leave useless states behind.  Therefore, we leave it to pullback()
//  * to delete such states.
//  *
//  * If the from state has multiple back-constraint outarcs, and/or multiple
//  * compatible constraint inarcs, we only need to create one new intermediate
//  * state per combination of predecessor and successor states.  *intermediates
//  * points to a list of such intermediate states for this from state (chained
//  * through their tmp fields).
//  ^ static int pull(struct nfa *, struct arc *);
//
func pull(tls *libc.TLS, nfa uintptr, con uintptr, intermediates uintptr) int32 { /* regc_nfa.c:1532:1: */
	var from uintptr = (*Arc)(unsafe.Pointer(con)).Ffrom
	var to uintptr = (*Arc)(unsafe.Pointer(con)).Fto
	var a uintptr
	var nexta uintptr
	var s uintptr

	// should have gotten rid of this earlier
	if (*State)(unsafe.Pointer(from)).Fflag != 0 { // can't pull back beyond start
		return 0
	}
	if (*State)(unsafe.Pointer(from)).Fnins == 0 { // unreachable
		freearc(tls, nfa, con)
		return 1
	}

	// First, clone from state if necessary to avoid other outarcs.  This may
	// seem wasteful, but it simplifies the logic, and we'll get rid of the
	// clone state again at the bottom.

	if (*State)(unsafe.Pointer(from)).Fnouts > 1 {
		s = newstate(tls, nfa)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
			return 0
		}
		copyins(tls, nfa, from, s)  // duplicate inarcs
		cparc(tls, nfa, con, s, to) // move constraint arc
		freearc(tls, nfa, con)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
			return 0
		}
		from = s
		con = (*State)(unsafe.Pointer(from)).Fouts
	}

	// Propagate the constraint into the from state's inarcs.

	for a = (*State)(unsafe.Pointer(from)).Fins; a != uintptr(0) && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); a = nexta {
		nexta = (*Arc)(unsafe.Pointer(a)).Finchain
		switch combine(tls, con, a) {
		case INCOMPATIBLE: // destroy the arc
			freearc(tls, nfa, a)
			break
		case SATISFIED: // no action needed
			break
		case COMPATIBLE: // swap the two arcs, more or less
			// need an intermediate state, but might have one already
			for s = *(*uintptr)(unsafe.Pointer(intermediates)); s != uintptr(0); s = (*State)(unsafe.Pointer(s)).Ftmp {

				if (*Arc)(unsafe.Pointer((*State)(unsafe.Pointer(s)).Fins)).Ffrom == (*Arc)(unsafe.Pointer(a)).Ffrom && (*Arc)(unsafe.Pointer((*State)(unsafe.Pointer(s)).Fouts)).Fto == to {
					break
				}
			}
			if s == uintptr(0) {
				s = newstate(tls, nfa)
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
					return 0
				}
				(*State)(unsafe.Pointer(s)).Ftmp = *(*uintptr)(unsafe.Pointer(intermediates))
				*(*uintptr)(unsafe.Pointer(intermediates)) = s
			}
			cparc(tls, nfa, con, (*Arc)(unsafe.Pointer(a)).Ffrom, s)
			cparc(tls, nfa, a, s, to)
			freearc(tls, nfa, a)
			break
		default:

			break
		}
	}

	// Remaining inarcs, if any, incorporate the constraint.

	moveins(tls, nfa, from, to)
	freearc(tls, nfa, con)
	// from state is now useless, but we leave it to pullback() to clean up
	return 1
}

//
//  - pushfwd - push forward constraints forward to eliminate them
//  ^ static void pushfwd(struct nfa *, FILE *);
//
func pushfwd(tls *libc.TLS, nfa uintptr, f uintptr) { /* regc_nfa.c:1627:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var s uintptr
	var nexts uintptr
	var a uintptr
	var nexta uintptr
	// var intermediates uintptr at bp, 8

	var progress int32

	// Find and push until there are no more.

	for ok := true; ok; ok = progress != 0 && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0) {
		progress = 0
		for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0) && !((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); s = nexts {
			nexts = (*State)(unsafe.Pointer(s)).Fnext
			*(*uintptr)(unsafe.Pointer(bp /* intermediates */)) = uintptr(0)
			for a = (*State)(unsafe.Pointer(s)).Fins; a != uintptr(0) && !((*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); a = nexta {
				nexta = (*Arc)(unsafe.Pointer(a)).Finchain
				if (*Arc)(unsafe.Pointer(a)).Ftype == '$' || (*Arc)(unsafe.Pointer(a)).Ftype == 'a' {
					if push(tls, nfa, a, bp) != 0 {
						progress = 1
					}
				}
			}
			// clear tmp fields of intermediate states created here
			for *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
				var ns uintptr = (*State)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* intermediates */)))).Ftmp

				(*State)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* intermediates */)))).Ftmp = uintptr(0)
				*(*uintptr)(unsafe.Pointer(bp /* intermediates */)) = ns
			}
			// if s is now useless, get rid of it
			if ((*State)(unsafe.Pointer(s)).Fnins == 0 || (*State)(unsafe.Pointer(s)).Fnouts == 0) && !(int32((*State)(unsafe.Pointer(s)).Fflag) != 0) {
				dropstate(tls, nfa, s)
			}
		}
		if progress != 0 && f != uintptr(0) {
			dumpnfa(tls, nfa, f)
		}
	}
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
		return
	}

	// Any $ constraints we were able to push to the post state can now be
	// replaced by PLAIN arcs referencing the EOS or EOL colors.  There should
	// be no other $ or AHEAD arcs left in the NFA, though we do not check
	// that here (compact() will fail if so).
	for a = (*State)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fpost)).Fins; a != uintptr(0); a = nexta {
		nexta = (*Arc)(unsafe.Pointer(a)).Finchain
		if (*Arc)(unsafe.Pointer(a)).Ftype == '$' {

			newarc(tls, nfa, 'p', int32(*(*Color)(unsafe.Pointer(nfa + 76 + uintptr((*Arc)(unsafe.Pointer(a)).Fco)*2))), (*Arc)(unsafe.Pointer(a)).Ffrom, (*Arc)(unsafe.Pointer(a)).Fto)
			freearc(tls, nfa, a)
		}
	}
}

//
//  - push - push a forward constraint forward past its destination state
//  *
//  * Returns 1 if successful (which it always is unless the destination is the
//  * post state or we have an internal error), 0 if nothing happened.
//  *
//  * A significant property of this function is that it deletes no pre-existing
//  * states, and no inarcs of the constraint's to state other than the given
//  * constraint arc.  This makes the loops in pushfwd() safe, at the cost that
//  * we may leave useless states behind.  Therefore, we leave it to pushfwd()
//  * to delete such states.
//  *
//  * If the to state has multiple forward-constraint inarcs, and/or multiple
//  * compatible constraint outarcs, we only need to create one new intermediate
//  * state per combination of predecessor and successor states.  *intermediates
//  * points to a list of such intermediate states for this to state (chained
//  * through their tmp fields).
//  ^ static int push(struct nfa *, struct arc *);
//
func push(tls *libc.TLS, nfa uintptr, con uintptr, intermediates uintptr) int32 { /* regc_nfa.c:1711:1: */
	var from uintptr = (*Arc)(unsafe.Pointer(con)).Ffrom
	var to uintptr = (*Arc)(unsafe.Pointer(con)).Fto
	var a uintptr
	var nexta uintptr
	var s uintptr

	// should have gotten rid of this earlier
	if (*State)(unsafe.Pointer(to)).Fflag != 0 { // can't push forward beyond end
		return 0
	}
	if (*State)(unsafe.Pointer(to)).Fnouts == 0 { // dead end
		freearc(tls, nfa, con)
		return 1
	}

	// First, clone to state if necessary to avoid other inarcs.  This may
	// seem wasteful, but it simplifies the logic, and we'll get rid of the
	// clone state again at the bottom.

	if (*State)(unsafe.Pointer(to)).Fnins > 1 {
		s = newstate(tls, nfa)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
			return 0
		}
		copyouts(tls, nfa, to, s)     // duplicate outarcs
		cparc(tls, nfa, con, from, s) // move constraint arc
		freearc(tls, nfa, con)
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
			return 0
		}
		to = s
		con = (*State)(unsafe.Pointer(to)).Fins
	}

	// Propagate the constraint into the to state's outarcs.

	for a = (*State)(unsafe.Pointer(to)).Fouts; a != uintptr(0) && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); a = nexta {
		nexta = (*Arc)(unsafe.Pointer(a)).Foutchain
		switch combine(tls, con, a) {
		case INCOMPATIBLE: // destroy the arc
			freearc(tls, nfa, a)
			break
		case SATISFIED: // no action needed
			break
		case COMPATIBLE: // swap the two arcs, more or less
			// need an intermediate state, but might have one already
			for s = *(*uintptr)(unsafe.Pointer(intermediates)); s != uintptr(0); s = (*State)(unsafe.Pointer(s)).Ftmp {

				if (*Arc)(unsafe.Pointer((*State)(unsafe.Pointer(s)).Fins)).Ffrom == from && (*Arc)(unsafe.Pointer((*State)(unsafe.Pointer(s)).Fouts)).Fto == (*Arc)(unsafe.Pointer(a)).Fto {
					break
				}
			}
			if s == uintptr(0) {
				s = newstate(tls, nfa)
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
					return 0
				}
				(*State)(unsafe.Pointer(s)).Ftmp = *(*uintptr)(unsafe.Pointer(intermediates))
				*(*uintptr)(unsafe.Pointer(intermediates)) = s
			}
			cparc(tls, nfa, con, s, (*Arc)(unsafe.Pointer(a)).Fto)
			cparc(tls, nfa, a, from, s)
			freearc(tls, nfa, a)
			break
		default:

			break
		}
	}

	// Remaining outarcs, if any, incorporate the constraint.

	moveouts(tls, nfa, to, from)
	freearc(tls, nfa, con)
	// to state is now useless, but we leave it to pushfwd() to clean up
	return 1
}

//
//  - combine - constraint lands on an arc, what happens?
//  ^ #def	INCOMPATIBLE	1	// destroys arc
//  ^ #def	SATISFIED	2	// constraint satisfied
//  ^ #def	COMPATIBLE	3	// compatible but not satisfied yet
//  ^ static int combine(struct arc *, struct arc *);
//
func combine(tls *libc.TLS, con uintptr, a uintptr) int32 { /* regc_nfa.c:1809:1: */

	switch (*Arc)(unsafe.Pointer(con)).Ftype<<8 | (*Arc)(unsafe.Pointer(a)).Ftype {
	case int32('^')<<8 | 'p':
		fallthrough // newlines are handled separately
	case int32('$')<<8 | 'p':
		return INCOMPATIBLE
		break
	case int32('a')<<8 | 'p':
		fallthrough // color constraints meet colors
	case int32('r')<<8 | 'p':
		if int32((*Arc)(unsafe.Pointer(con)).Fco) == int32((*Arc)(unsafe.Pointer(a)).Fco) {
			return SATISFIED
		}
		return INCOMPATIBLE
		break
	case int32('^')<<8 | '^':
		fallthrough // collision, similar constraints
	case int32('$')<<8 | '$':
		fallthrough
	case int32('a')<<8 | 'a':
		fallthrough
	case int32('r')<<8 | 'r':
		if int32((*Arc)(unsafe.Pointer(con)).Fco) == int32((*Arc)(unsafe.Pointer(a)).Fco) { // true duplication
			return SATISFIED
		}
		return INCOMPATIBLE
		break
	case int32('^')<<8 | 'r':
		fallthrough // collision, dissimilar constraints
	case int32('r')<<8 | '^':
		fallthrough
	case int32('$')<<8 | 'a':
		fallthrough
	case int32('a')<<8 | '$':
		return INCOMPATIBLE
		break
	case int32('^')<<8 | '$':
		fallthrough // constraints passing each other
	case int32('^')<<8 | 'a':
		fallthrough
	case int32('r')<<8 | '$':
		fallthrough
	case int32('r')<<8 | 'a':
		fallthrough
	case int32('$')<<8 | '^':
		fallthrough
	case int32('$')<<8 | 'r':
		fallthrough
	case int32('a')<<8 | '^':
		fallthrough
	case int32('a')<<8 | 'r':
		fallthrough
	case int32('^')<<8 | 'L':
		fallthrough
	case int32('r')<<8 | 'L':
		fallthrough
	case int32('$')<<8 | 'L':
		fallthrough
	case int32('a')<<8 | 'L':
		return COMPATIBLE
		break
	}

	return INCOMPATIBLE // for benefit of blind compilers
}

//
//  - fixempties - get rid of EMPTY arcs
//  ^ static void fixempties(struct nfa *, FILE *);
//
func fixempties(tls *libc.TLS, nfa uintptr, f uintptr) { /* regc_nfa.c:1866:1: */
	var s uintptr
	var s2 uintptr
	var nexts uintptr
	var a uintptr
	var nexta uintptr
	var totalinarcs int32
	var inarcsorig uintptr
	var arcarray uintptr
	var arccount int32
	var prevnins int32
	var nskip int32

	// First, get rid of any states whose sole out-arc is an EMPTY,
	// since they're basically just aliases for their successor.  The
	// parsing algorithm creates enough of these that it's worth
	// special-casing this.
	for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0) && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); s = nexts {
		nexts = (*State)(unsafe.Pointer(s)).Fnext
		if (*State)(unsafe.Pointer(s)).Fflag != 0 || (*State)(unsafe.Pointer(s)).Fnouts != 1 {
			continue
		}
		a = (*State)(unsafe.Pointer(s)).Fouts

		if (*Arc)(unsafe.Pointer(a)).Ftype != 'n' {
			continue
		}
		if s != (*Arc)(unsafe.Pointer(a)).Fto {
			moveins(tls, nfa, s, (*Arc)(unsafe.Pointer(a)).Fto)
		}
		dropstate(tls, nfa, s)
	}

	// Similarly, get rid of any state with a single EMPTY in-arc, by
	// folding it into its predecessor.
	for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0) && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); s = nexts {
		nexts = (*State)(unsafe.Pointer(s)).Fnext
		// Ensure tmp fields are clear for next step

		if (*State)(unsafe.Pointer(s)).Fflag != 0 || (*State)(unsafe.Pointer(s)).Fnins != 1 {
			continue
		}
		a = (*State)(unsafe.Pointer(s)).Fins

		if (*Arc)(unsafe.Pointer(a)).Ftype != 'n' {
			continue
		}
		if s != (*Arc)(unsafe.Pointer(a)).Ffrom {
			moveouts(tls, nfa, s, (*Arc)(unsafe.Pointer(a)).Ffrom)
		}
		dropstate(tls, nfa, s)
	}

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
		return
	}

	// For each remaining NFA state, find all other states from which it is
	// reachable by a chain of one or more EMPTY arcs.  Then generate new arcs
	// that eliminate the need for each such chain.
	//
	// We could replace a chain of EMPTY arcs that leads from a "from" state
	// to a "to" state either by pushing non-EMPTY arcs forward (linking
	// directly from "from"'s predecessors to "to") or by pulling them back
	// (linking directly from "from" to "to"'s successors).  We choose to
	// always do the former; this choice is somewhat arbitrary, but the
	// approach below requires that we uniformly do one or the other.
	//
	// Suppose we have a chain of N successive EMPTY arcs (where N can easily
	// approach the size of the NFA).  All of the intermediate states must
	// have additional inarcs and outarcs, else they'd have been removed by
	// the steps above.  Assuming their inarcs are mostly not empties, we will
	// add O(N^2) arcs to the NFA, since a non-EMPTY inarc leading to any one
	// state in the chain must be duplicated to lead to all its successor
	// states as well.  So there is no hope of doing less than O(N^2) work;
	// however, we should endeavor to keep the big-O cost from being even
	// worse than that, which it can easily become without care.  In
	// particular, suppose we were to copy all S1's inarcs forward to S2, and
	// then also to S3, and then later we consider pushing S2's inarcs forward
	// to S3.  If we include the arcs already copied from S1 in that, we'd be
	// doing O(N^3) work.  (The duplicate-arc elimination built into newarc()
	// and its cohorts would get rid of the extra arcs, but not without cost.)
	//
	// We can avoid this cost by treating only arcs that existed at the start
	// of this phase as candidates to be pushed forward.  To identify those,
	// we remember the first inarc each state had to start with.  We rely on
	// the fact that newarc() and friends put new arcs on the front of their
	// to-states' inchains, and that this phase never deletes arcs, so that
	// the original arcs must be the last arcs in their to-states' inchains.
	//
	// So the process here is that, for each state in the NFA, we gather up
	// all non-EMPTY inarcs of states that can reach the target state via
	// EMPTY arcs.  We then sort, de-duplicate, and merge these arcs into the
	// target state's inchain.  (We can safely use sort-merge for this as long
	// as we update each state's original-arcs pointer after we add arcs to
	// it; the sort step of mergeins probably changed the order of the old
	// arcs.)
	//
	// Another refinement worth making is that, because we only add non-EMPTY
	// arcs during this phase, and all added arcs have the same from-state as
	// the non-EMPTY arc they were cloned from, we know ahead of time that any
	// states having only EMPTY outarcs will be useless for lack of outarcs
	// after we drop the EMPTY arcs.  (They cannot gain non-EMPTY outarcs if
	// they had none to start with.)  So we need not bother to update the
	// inchains of such states at all.

	// Remember the states' first original inarcs
	// ... and while at it, count how many old inarcs there are altogether
	inarcsorig = XTclpAlloc(tls, uint32(uint64((*Nfa)(unsafe.Pointer(nfa)).Fnstates)*uint64(unsafe.Sizeof(uintptr(0)))))
	if inarcsorig == uintptr(0) {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
			}
			return REG_ESPACE
		}()
		return
	}
	totalinarcs = 0
	for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0); s = (*State)(unsafe.Pointer(s)).Fnext {
		*(*uintptr)(unsafe.Pointer(inarcsorig + uintptr((*State)(unsafe.Pointer(s)).Fno)*8)) = (*State)(unsafe.Pointer(s)).Fins
		totalinarcs = totalinarcs + (*State)(unsafe.Pointer(s)).Fnins
	}

	// Create a workspace for accumulating the inarcs to be added to the
	// current target state.  totalinarcs is probably a considerable
	// overestimate of the space needed, but the NFA is unlikely to be large
	// enough at this point to make it worth being smarter.
	arcarray = XTclpAlloc(tls, uint32(uint64(totalinarcs)*uint64(unsafe.Sizeof(uintptr(0)))))
	if arcarray == uintptr(0) {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
			}
			return REG_ESPACE
		}()
		XTclpFree(tls, inarcsorig)
		return
	}

	// And iterate over the target states
	for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0) && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); s = (*State)(unsafe.Pointer(s)).Fnext {
		// Ignore target states without non-EMPTY outarcs, per note above
		if !(int32((*State)(unsafe.Pointer(s)).Fflag) != 0) && !(hasnonemptyout(tls, s) != 0) {
			continue
		}

		// Find predecessor states and accumulate their original inarcs
		arccount = 0
		for s2 = emptyreachable(tls, nfa, s, s, inarcsorig); s2 != s; s2 = nexts {
			// Add s2's original inarcs to arcarray[], but ignore empties
			for a = *(*uintptr)(unsafe.Pointer(inarcsorig + uintptr((*State)(unsafe.Pointer(s2)).Fno)*8)); a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Finchain {
				if (*Arc)(unsafe.Pointer(a)).Ftype != 'n' {
					*(*uintptr)(unsafe.Pointer(arcarray + uintptr(libc.PostIncInt32(&arccount, 1))*8)) = a
				}
			}

			// Reset the tmp fields as we walk back
			nexts = (*State)(unsafe.Pointer(s2)).Ftmp
			(*State)(unsafe.Pointer(s2)).Ftmp = uintptr(0)
		}
		(*State)(unsafe.Pointer(s)).Ftmp = uintptr(0)

		// Remember how many original inarcs this state has
		prevnins = (*State)(unsafe.Pointer(s)).Fnins

		// Add non-duplicate inarcs to target state
		mergeins(tls, nfa, s, arcarray, arccount)

		// Now we must update the state's inarcsorig pointer
		nskip = (*State)(unsafe.Pointer(s)).Fnins - prevnins
		a = (*State)(unsafe.Pointer(s)).Fins
		for libc.PostDecInt32(&nskip, 1) > 0 {
			a = (*Arc)(unsafe.Pointer(a)).Finchain
		}
		*(*uintptr)(unsafe.Pointer(inarcsorig + uintptr((*State)(unsafe.Pointer(s)).Fno)*8)) = a
	}

	XTclpFree(tls, arcarray)
	XTclpFree(tls, inarcsorig)

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
		return
	}

	// Remove all the EMPTY arcs, since we don't need them anymore.
	for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0); s = (*State)(unsafe.Pointer(s)).Fnext {
		for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0); a = nexta {
			nexta = (*Arc)(unsafe.Pointer(a)).Foutchain
			if (*Arc)(unsafe.Pointer(a)).Ftype == 'n' {
				freearc(tls, nfa, a)
			}
		}
	}

	// And remove any states that have become useless.  (This cleanup is
	// not very thorough, and would be even less so if we tried to
	// combine it with the previous step; but cleanup() will take care
	// of anything we miss.)
	for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0); s = nexts {
		nexts = (*State)(unsafe.Pointer(s)).Fnext
		if ((*State)(unsafe.Pointer(s)).Fnins == 0 || (*State)(unsafe.Pointer(s)).Fnouts == 0) && !(int32((*State)(unsafe.Pointer(s)).Fflag) != 0) {
			dropstate(tls, nfa, s)
		}
	}

	if f != uintptr(0) {
		dumpnfa(tls, nfa, f)
	}
}

//
//  - emptyreachable - recursively find all states that can reach s by EMPTY arcs
//  * The return value is the last such state found.  Its tmp field links back
//  * to the next-to-last such state, and so on back to s, so that all these
//  * states can be located without searching the whole NFA.
//  *
//  * Since this is only used in fixempties(), we pass in the inarcsorig[] array
//  * maintained by that function.  This lets us skip over all new inarcs, which
//  * are certainly not EMPTY arcs.
//  *
//  * The maximum recursion depth here is equal to the length of the longest
//  * loop-free chain of EMPTY arcs, which is surely no more than the size of
//  * the NFA, and in practice will be less than that.
//  ^ static struct state *emptyreachable(struct state *, struct state *);
//
func emptyreachable(tls *libc.TLS, nfa uintptr, s uintptr, lastfound uintptr, inarcsorig uintptr) uintptr { /* regc_nfa.c:2098:21: */
	var a uintptr

	(*State)(unsafe.Pointer(s)).Ftmp = lastfound
	lastfound = s
	for a = *(*uintptr)(unsafe.Pointer(inarcsorig + uintptr((*State)(unsafe.Pointer(s)).Fno)*8)); a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Finchain {
		if (*Arc)(unsafe.Pointer(a)).Ftype == 'n' && (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(a)).Ffrom)).Ftmp == uintptr(0) {
			lastfound = emptyreachable(tls, nfa, (*Arc)(unsafe.Pointer(a)).Ffrom, lastfound, inarcsorig)
		}
	}
	return lastfound
}

// isconstraintarc - detect whether an arc is of a constraint type
func isconstraintarc(tls *libc.TLS, a uintptr) int32 { /* regc_nfa.c:2121:1: */
	switch (*Arc)(unsafe.Pointer(a)).Ftype {
	case '^':
		fallthrough
	case '$':
		fallthrough
	case 'r':
		fallthrough
	case 'a':
		fallthrough
	case 'L':
		return 1
	}
	return 0
}

// hasconstraintout - does state have a constraint out arc?
func hasconstraintout(tls *libc.TLS, s uintptr) int32 { /* regc_nfa.c:2139:1: */
	var a uintptr

	for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		if isconstraintarc(tls, a) != 0 {
			return 1
		}
	}
	return 0
}

// fixconstraintloops - get rid of loops containing only constraint arcs
//
// A loop of states that contains only constraint arcs is useless, since
// passing around the loop represents no forward progress.  Moreover, it
// would cause infinite looping in pullback/pushfwd, so we need to get rid
// of such loops before doing that.
func fixconstraintloops(tls *libc.TLS, nfa uintptr, f uintptr) { /* regc_nfa.c:2160:1: */
	var s uintptr
	var nexts uintptr
	var a uintptr
	var nexta uintptr
	var hasconstraints int32

	// In the trivial case of a state that loops to itself, we can just drop
	// the constraint arc altogether.  This is worth special-casing because
	// such loops are far more common than loops containing multiple states.
	// While we're at it, note whether any constraint arcs survive.
	hasconstraints = 0
	s = (*Nfa)(unsafe.Pointer(nfa)).Fstates
__1:
	if !(s != uintptr(0) && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0)) {
		goto __3
	}
	nexts = (*State)(unsafe.Pointer(s)).Fnext
	// while we're at it, ensure tmp fields are clear for next step

	a = (*State)(unsafe.Pointer(s)).Fouts
__4:
	if !(a != uintptr(0) && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0)) {
		goto __6
	}
	nexta = (*Arc)(unsafe.Pointer(a)).Foutchain
	if !(isconstraintarc(tls, a) != 0) {
		goto __7
	}
	if !((*Arc)(unsafe.Pointer(a)).Fto == s) {
		goto __8
	}
	freearc(tls, nfa, a)
	goto __9
__8:
	hasconstraints = 1
__9:
	;
__7:
	;
	goto __5
__5:
	a = nexta
	goto __4
	goto __6
__6:
	;
	// If we removed all the outarcs, the state is useless.
	if !((*State)(unsafe.Pointer(s)).Fnouts == 0 && !(int32((*State)(unsafe.Pointer(s)).Fflag) != 0)) {
		goto __10
	}
	dropstate(tls, nfa, s)
__10:
	;
	goto __2
__2:
	s = nexts
	goto __1
	goto __3
__3:
	;

	// Nothing to do if no remaining constraint arcs
	if !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 || !(hasconstraints != 0)) {
		goto __11
	}
	return
__11:
	;

	// Starting from each remaining NFA state, search outwards for a
	// constraint loop.  If we find a loop, break the loop, then start the
	// search over.  (We could possibly retain some state from the first scan,
	// but it would complicate things greatly, and multi-state constraint
	// loops are rare enough that it's not worth optimizing the case.)
restart:
	s = (*Nfa)(unsafe.Pointer(nfa)).Fstates
__12:
	if !(s != uintptr(0) && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0)) {
		goto __14
	}
	if !(findconstraintloop(tls, nfa, s) != 0) {
		goto __15
	}
	goto restart
__15:
	;
	goto __13
__13:
	s = (*State)(unsafe.Pointer(s)).Fnext
	goto __12
	goto __14
__14:
	;

	if !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0) {
		goto __16
	}
	return
__16:
	;

	// Now remove any states that have become useless.  (This cleanup is not
	// very thorough, and would be even less so if we tried to combine it with
	// the previous step; but cleanup() will take care of anything we miss.)
	//
	// Because findconstraintloop intentionally doesn't reset all tmp fields,
	// we have to clear them after it's done.  This is a convenient place to
	// do that, too.
	s = (*Nfa)(unsafe.Pointer(nfa)).Fstates
__17:
	if !(s != uintptr(0)) {
		goto __19
	}
	nexts = (*State)(unsafe.Pointer(s)).Fnext
	(*State)(unsafe.Pointer(s)).Ftmp = uintptr(0)
	if !(((*State)(unsafe.Pointer(s)).Fnins == 0 || (*State)(unsafe.Pointer(s)).Fnouts == 0) && !(int32((*State)(unsafe.Pointer(s)).Fflag) != 0)) {
		goto __20
	}
	dropstate(tls, nfa, s)
__20:
	;
	goto __18
__18:
	s = nexts
	goto __17
	goto __19
__19:
	;

	if !(f != uintptr(0)) {
		goto __21
	}
	dumpnfa(tls, nfa, f)
__21:
}

// findconstraintloop - recursively find a loop of constraint arcs
//
// If we find a loop, break it by calling breakconstraintloop(), then
// return 1; otherwise return 0.
//
// State tmp fields are guaranteed all NULL on a success return, because
// breakconstraintloop does that.  After a failure return, any state that
// is known not to be part of a loop is marked with s->tmp == s; this allows
// us not to have to re-prove that fact on later calls.  (This convention is
// workable because we already eliminated single-state loops.)
//
// Note that the found loop doesn't necessarily include the first state we
// are called on.  Any loop reachable from that state will do.
//
// The maximum recursion depth here is one more than the length of the longest
// loop-free chain of constraint arcs, which is surely no more than the size
// of the NFA, and in practice will be a lot less than that.
func findconstraintloop(tls *libc.TLS, nfa uintptr, s uintptr) int32 { /* regc_nfa.c:2262:1: */
	var a uintptr

	// Since this is recursive, it could be driven to stack overflow
	if 0 != 0 {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
			}
			return REG_ETOOBIG
		}()
		return 1 // to exit as quickly as possible
	}

	if (*State)(unsafe.Pointer(s)).Ftmp != uintptr(0) {
		// Already proven uninteresting?
		if (*State)(unsafe.Pointer(s)).Ftmp == s {
			return 0
		}
		// Found a loop involving s
		breakconstraintloop(tls, nfa, s)
		// The tmp fields have been cleaned up by breakconstraintloop
		return 1
	}
	for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		if isconstraintarc(tls, a) != 0 {
			var sto uintptr = (*Arc)(unsafe.Pointer(a)).Fto

			(*State)(unsafe.Pointer(s)).Ftmp = sto
			if findconstraintloop(tls, nfa, sto) != 0 {
				return 1
			}
		}
	}

	// If we get here, no constraint loop exists leading out from s.  Mark it
	// with s->tmp == s so we need not rediscover that fact again later.
	(*State)(unsafe.Pointer(s)).Ftmp = s
	return 0
}

// breakconstraintloop - break a loop of constraint arcs
//
// sinitial is any one member state of the loop.  Each loop member's tmp
// field links to its successor within the loop.  (Note that this function
// will reset all the tmp fields to NULL.)
//
// We can break the loop by, for any one state S1 in the loop, cloning its
// loop successor state S2 (and possibly following states), and then moving
// all S1->S2 constraint arcs to point to the cloned S2.  The cloned S2 should
// copy any non-constraint outarcs of S2.  Constraint outarcs should be
// dropped if they point back to S1, else they need to be copied as arcs to
// similarly cloned states S3, S4, etc.  In general, each cloned state copies
// non-constraint outarcs, drops constraint outarcs that would lead to itself
// or any earlier cloned state, and sends other constraint outarcs to newly
// cloned states.  No cloned state will have any inarcs that aren't constraint
// arcs or do not lead from S1 or earlier-cloned states.  It's okay to drop
// constraint back-arcs since they would not take us to any state we've not
// already been in; therefore, no new constraint loop is created.  In this way
// we generate a modified NFA that can still represent every useful state
// sequence, but not sequences that represent state loops with no consumption
// of input data.  Note that the set of cloned states will certainly include
// all of the loop member states other than S1, and it may also include
// non-loop states that are reachable from S2 via constraint arcs.  This is
// important because there is no guarantee that findconstraintloop found a
// maximal loop (and searching for one would be NP-hard, so don't try).
// Frequently the "non-loop states" are actually part of a larger loop that
// we didn't notice, and indeed there may be several overlapping loops.
// This technique ensures convergence in such cases, while considering only
// the originally-found loop does not.
//
// If there is only one S1->S2 constraint arc, then that constraint is
// certainly satisfied when we enter any of the clone states.  This means that
// in the common case where many of the constraint arcs are identically
// labeled, we can merge together clone states linked by a similarly-labeled
// constraint: if we can get to the first one we can certainly get to the
// second, so there's no need to distinguish.  This greatly reduces the number
// of new states needed, so we preferentially break the given loop at a state
// pair where this is true.
//
// Furthermore, it's fairly common to find that a cloned successor state has
// no outarcs, especially if we're a bit aggressive about removing unnecessary
// outarcs.  If that happens, then there is simply not any interesting state
// that can be reached through the predecessor's loop arcs, which means we can
// break the loop just by removing those loop arcs, with no new states added.
func breakconstraintloop(tls *libc.TLS, nfa uintptr, sinitial uintptr) { /* regc_nfa.c:2349:1: */
	var s uintptr
	var shead uintptr
	var stail uintptr
	var sclone uintptr
	var nexts uintptr
	var refarc uintptr
	var a uintptr
	var nexta uintptr

	// Start by identifying which loop step we want to break at.
	// Preferentially this is one with only one constraint arc.  (XXX are
	// there any other secondary heuristics we want to use here?)  Set refarc
	// to point to the selected lone constraint arc, if there is one.
	refarc = uintptr(0)
	s = sinitial
	for ok := true; ok; ok = s != sinitial {
		nexts = (*State)(unsafe.Pointer(s)).Ftmp
		// should not see any one-element loops
		if refarc == uintptr(0) {
			var narcs int32 = 0

			for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
				if (*Arc)(unsafe.Pointer(a)).Fto == nexts && isconstraintarc(tls, a) != 0 {
					refarc = a
					narcs++
				}
			}

			if narcs > 1 {
				refarc = uintptr(0) // multiple constraint arcs here, no good
			}
		}
		s = nexts
	}

	if refarc != 0 {
		// break at the refarc
		shead = (*Arc)(unsafe.Pointer(refarc)).Ffrom
		stail = (*Arc)(unsafe.Pointer(refarc)).Fto

	} else {
		// for lack of a better idea, break after sinitial
		shead = sinitial
		stail = (*State)(unsafe.Pointer(sinitial)).Ftmp
	}

	// Reset the tmp fields so that we can use them for local storage in
	// clonesuccessorstates.  (findconstraintloop won't mind, since it's just
	// going to abandon its search anyway.)
	for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0); s = (*State)(unsafe.Pointer(s)).Fnext {
		(*State)(unsafe.Pointer(s)).Ftmp = uintptr(0)
	}

	// Recursively build clone state(s) as needed.
	sclone = newstate(tls, nfa)
	if sclone == uintptr(0) {

		return
	}

	clonesuccessorstates(tls, nfa, stail, sclone, shead, refarc,
		uintptr(0), uintptr(0), (*Nfa)(unsafe.Pointer(nfa)).Fnstates)

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
		return
	}

	// It's possible that sclone has no outarcs at all, in which case it's
	// useless.  (We don't try extremely hard to get rid of useless states
	// here, but this is an easy and fairly common case.)
	if (*State)(unsafe.Pointer(sclone)).Fnouts == 0 {
		freestate(tls, nfa, sclone)
		sclone = uintptr(0)
	}

	// Move shead's constraint-loop arcs to point to sclone, or just drop them
	// if we discovered we don't need sclone.
	for a = (*State)(unsafe.Pointer(shead)).Fouts; a != uintptr(0); a = nexta {
		nexta = (*Arc)(unsafe.Pointer(a)).Foutchain
		if (*Arc)(unsafe.Pointer(a)).Fto == stail && isconstraintarc(tls, a) != 0 {
			if sclone != 0 {
				cparc(tls, nfa, a, shead, sclone)
			}
			freearc(tls, nfa, a)
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
				break
			}
		}
	}
}

// clonesuccessorstates - create a tree of constraint-arc successor states
//
// ssource is the state to be cloned, and sclone is the state to copy its
// outarcs into.  sclone's inarcs, if any, should already be set up.
//
// spredecessor is the original predecessor state that we are trying to build
// successors for (it may not be the immediate predecessor of ssource).
// refarc, if not NULL, is the original constraint arc that is known to have
// been traversed out of spredecessor to reach the successor(s).
//
// For each cloned successor state, we transiently create a "donemap" that is
// a boolean array showing which source states we've already visited for this
// clone state.  This prevents infinite recursion as well as useless repeat
// visits to the same state subtree (which can add up fast, since typical NFAs
// have multiple redundant arc pathways).  Each donemap is a char array
// indexed by state number.  The donemaps are all of the same size "nstates",
// which is nfa->nstates as of the start of the recursion.  This is enough to
// have entries for all pre-existing states, but *not* entries for clone
// states created during the recursion.  That's okay since we have no need to
// mark those.
//
// curdonemap is NULL when recursing to a new sclone state, or sclone's
// donemap when we are recursing without having created a new state (which we
// do when we decide we can merge a successor state into the current clone
// state).  outerdonemap is NULL at the top level and otherwise the parent
// clone state's donemap.
//
// The successor states we create and fill here form a strict tree structure,
// with each state having exactly one predecessor, except that the toplevel
// state has no inarcs as yet (breakconstraintloop will add its inarcs from
// spredecessor after we're done).  Thus, we can examine sclone's inarcs back
// to the root, plus refarc if any, to identify the set of constraints already
// known valid at the current point.  This allows us to avoid generating extra
// successor states.
func clonesuccessorstates(tls *libc.TLS, nfa uintptr, ssource uintptr, sclone uintptr, spredecessor uintptr, refarc uintptr, curdonemap uintptr, outerdonemap uintptr, nstates int32) { /* regc_nfa.c:2489:1: */
	var donemap uintptr
	var a uintptr

	// Since this is recursive, it could be driven to stack overflow
	if 0 != 0 {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
			}
			return REG_ETOOBIG
		}()
		return
	}

	// If this state hasn't already got a donemap, create one
	donemap = curdonemap
	if donemap == uintptr(0) {
		donemap = XTclpAlloc(tls, uint32(uint64(nstates)*uint64(unsafe.Sizeof(int8(0)))))
		if donemap == uintptr(0) {
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
			(*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
				}
				return REG_ESPACE
			}()
			return
		}

		if outerdonemap != uintptr(0) {
			// Not at outermost recursion level, so copy the outer level's
			// donemap; this ensures that we see states in process of being
			// visited at outer levels, or already merged into predecessor
			// states, as ones we shouldn't traverse back to.
			libc.Xmemcpy(tls, donemap, outerdonemap, uint64(nstates)*uint64(unsafe.Sizeof(int8(0))))
		} else {
			// At outermost level, only spredecessor is off-limits
			libc.Xmemset(tls, donemap, 0, uint64(nstates)*uint64(unsafe.Sizeof(int8(0))))

			*(*int8)(unsafe.Pointer(donemap + uintptr((*State)(unsafe.Pointer(spredecessor)).Fno))) = int8(1)
		}
	}

	// Mark ssource as visited in the donemap

	*(*int8)(unsafe.Pointer(donemap + uintptr((*State)(unsafe.Pointer(ssource)).Fno))) = int8(1)

	// We proceed by first cloning all of ssource's outarcs, creating new
	// clone states as needed but not doing more with them than that.  Then in
	// a second pass, recurse to process the child clone states.  This allows
	// us to have only one child clone state per reachable source state, even
	// when there are multiple outarcs leading to the same state.  Also, when
	// we do visit a child state, its set of inarcs is known exactly, which
	// makes it safe to apply the constraint-is-already-checked optimization.
	// Also, this ensures that we've merged all the states we can into the
	// current clone before we recurse to any children, thus possibly saving
	// them from making extra images of those states.
	//
	// While this function runs, child clone states of the current state are
	// marked by setting their tmp fields to point to the original state they
	// were cloned from.  This makes it possible to detect multiple outarcs
	// leading to the same state, and also makes it easy to distinguish clone
	// states from original states (which will have tmp == NULL).
	for a = (*State)(unsafe.Pointer(ssource)).Fouts; a != uintptr(0) && !((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		var sto uintptr = (*Arc)(unsafe.Pointer(a)).Fto

		// We do not consider cloning successor states that have no constraint
		// outarcs; just link to them as-is.  They cannot be part of a
		// constraint loop so there is no need to make copies.  In particular,
		// this rule keeps us from trying to clone the post state, which would
		// be a bad idea.
		if isconstraintarc(tls, a) != 0 && hasconstraintout(tls, sto) != 0 {
			var prevclone uintptr
			var canmerge int32
			var a2 uintptr

			// Back-link constraint arcs must not be followed.  Nor is there a
			// need to revisit states previously merged into this clone.

			if int32(*(*int8)(unsafe.Pointer(donemap + uintptr((*State)(unsafe.Pointer(sto)).Fno)))) != 0 {
				continue
			}

			// Check whether we already have a child clone state for this
			// source state.
			prevclone = uintptr(0)
			for a2 = (*State)(unsafe.Pointer(sclone)).Fouts; a2 != uintptr(0); a2 = (*Arc)(unsafe.Pointer(a2)).Foutchain {
				if (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(a2)).Fto)).Ftmp == sto {
					prevclone = (*Arc)(unsafe.Pointer(a2)).Fto
					break
				}
			}

			// If this arc is labeled the same as refarc, or the same as any
			// arc we must have traversed to get to sclone, then no additional
			// constraints need to be met to get to sto, so we should just
			// merge its outarcs into sclone.
			if refarc != 0 && (*Arc)(unsafe.Pointer(a)).Ftype == (*Arc)(unsafe.Pointer(refarc)).Ftype && int32((*Arc)(unsafe.Pointer(a)).Fco) == int32((*Arc)(unsafe.Pointer(refarc)).Fco) {
				canmerge = 1
			} else {
				var s uintptr

				canmerge = 0
				for s = sclone; (*State)(unsafe.Pointer(s)).Fins != 0; s = (*Arc)(unsafe.Pointer((*State)(unsafe.Pointer(s)).Fins)).Ffrom {
					if (*State)(unsafe.Pointer(s)).Fnins == 1 && (*Arc)(unsafe.Pointer(a)).Ftype == (*Arc)(unsafe.Pointer((*State)(unsafe.Pointer(s)).Fins)).Ftype && int32((*Arc)(unsafe.Pointer(a)).Fco) == int32((*Arc)(unsafe.Pointer((*State)(unsafe.Pointer(s)).Fins)).Fco) {
						canmerge = 1
						break
					}
				}
			}

			if canmerge != 0 {
				// We can merge into sclone.  If we previously made a child
				// clone state, drop it; there's no need to visit it.  (This
				// can happen if ssource has multiple pathways to sto, and we
				// only just now found one that is provably a no-op.)
				if prevclone != 0 {
					dropstate(tls, nfa, prevclone) // kills our outarc, too
				}

				// Recurse to merge sto's outarcs into sclone
				clonesuccessorstates(tls, nfa, sto, sclone, spredecessor, refarc,
					donemap, outerdonemap, nstates)
				// sto should now be marked as previously visited

			} else if prevclone != 0 {
				// We already have a clone state for this successor, so just
				// make another arc to it.
				cparc(tls, nfa, a, sclone, prevclone)
			} else {
				// We need to create a new successor clone state.
				var stoclone uintptr

				stoclone = newstate(tls, nfa)
				if stoclone == uintptr(0) {

					break
				}
				// Mark it as to what it's a clone of
				(*State)(unsafe.Pointer(stoclone)).Ftmp = sto
				// ... and add the outarc leading to it
				cparc(tls, nfa, a, sclone, stoclone)
			}
		} else {
			// Non-constraint outarcs just get copied to sclone, as do outarcs
			// leading to states with no constraint outarc.
			cparc(tls, nfa, a, sclone, sto)
		}
	}

	// If we are at outer level for this clone state, recurse to all its child
	// clone states, clearing their tmp fields as we go.  (If we're not
	// outermost for sclone, leave this to be done by the outer call level.)
	// Note that if we have multiple outarcs leading to the same clone state,
	// it will only be recursed-to once.
	if curdonemap == uintptr(0) {
		for a = (*State)(unsafe.Pointer(sclone)).Fouts; a != uintptr(0) && !((*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
			var stoclone uintptr = (*Arc)(unsafe.Pointer(a)).Fto
			var sto uintptr = (*State)(unsafe.Pointer(stoclone)).Ftmp

			if sto != uintptr(0) {
				(*State)(unsafe.Pointer(stoclone)).Ftmp = uintptr(0)
				clonesuccessorstates(tls, nfa, sto, stoclone, spredecessor, refarc,
					uintptr(0), donemap, nstates)
			}
		}

		// Don't forget to free sclone's donemap when done with it
		XTclpFree(tls, donemap)
	}
}

//
//  - cleanup - clean up NFA after optimizations
//  ^ static void cleanup(struct nfa *);
//
func cleanup(tls *libc.TLS, nfa uintptr) { /* regc_nfa.c:2689:1: */
	var s uintptr
	var nexts uintptr
	var n int32

	// Clear out unreachable or dead-end states. Use pre to mark reachable,
	// then post to mark can-reach-post.

	markreachable(tls, nfa, (*Nfa)(unsafe.Pointer(nfa)).Fpre, uintptr(0), (*Nfa)(unsafe.Pointer(nfa)).Fpre)
	markcanreach(tls, nfa, (*Nfa)(unsafe.Pointer(nfa)).Fpost, (*Nfa)(unsafe.Pointer(nfa)).Fpre, (*Nfa)(unsafe.Pointer(nfa)).Fpost)
	for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0); s = nexts {
		nexts = (*State)(unsafe.Pointer(s)).Fnext
		if (*State)(unsafe.Pointer(s)).Ftmp != (*Nfa)(unsafe.Pointer(nfa)).Fpost && !(int32((*State)(unsafe.Pointer(s)).Fflag) != 0) {
			dropstate(tls, nfa, s)
		}
	}

	cleartraverse(tls, nfa, (*Nfa)(unsafe.Pointer(nfa)).Fpre)

	// the nins==0 (final unreachable) case will be caught later

	// Renumber surviving states.

	n = 0
	for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0); s = (*State)(unsafe.Pointer(s)).Fnext {
		(*State)(unsafe.Pointer(s)).Fno = libc.PostIncInt32(&n, 1)
	}
	(*Nfa)(unsafe.Pointer(nfa)).Fnstates = n
}

//
//  - markreachable - recursive marking of reachable states
//  ^ static void markreachable(struct nfa *, struct state *, struct state *,
//  ^ 	struct state *);
//
func markreachable(tls *libc.TLS, nfa uintptr, s uintptr, okay uintptr, mark uintptr) { /* regc_nfa.c:2731:1: */
	var a uintptr

	if (*State)(unsafe.Pointer(s)).Ftmp != okay {
		return
	}
	(*State)(unsafe.Pointer(s)).Ftmp = mark

	for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		markreachable(tls, nfa, (*Arc)(unsafe.Pointer(a)).Fto, okay, mark)
	}
}

//
//  - markcanreach - recursive marking of states which can reach here
//  ^ static void markcanreach(struct nfa *, struct state *, struct state *,
//  ^ 	struct state *);
//
func markcanreach(tls *libc.TLS, nfa uintptr, s uintptr, okay uintptr, mark uintptr) { /* regc_nfa.c:2755:1: */
	var a uintptr

	if (*State)(unsafe.Pointer(s)).Ftmp != okay {
		return
	}
	(*State)(unsafe.Pointer(s)).Ftmp = mark

	for a = (*State)(unsafe.Pointer(s)).Fins; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Finchain {
		markcanreach(tls, nfa, (*Arc)(unsafe.Pointer(a)).Ffrom, okay, mark)
	}
}

//
//  - analyze - ascertain potentially-useful facts about an optimized NFA
//  ^ static long analyze(struct nfa *);
//
func analyze(tls *libc.TLS, nfa uintptr) int64 { /* regc_nfa.c:2778:1: */
	var a uintptr
	var aa uintptr

	if (*State)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fpre)).Fouts == uintptr(0) {
		return int64(REG_UIMPOSSIBLE)
	}
	for a = (*State)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fpre)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		for aa = (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(a)).Fto)).Fouts; aa != uintptr(0); aa = (*Arc)(unsafe.Pointer(aa)).Foutchain {
			if (*Arc)(unsafe.Pointer(aa)).Fto == (*Nfa)(unsafe.Pointer(nfa)).Fpost {
				return int64(REG_UEMPTYMATCH)
			}
		}
	}
	return int64(0)
}

//
//  - compact - construct the compact representation of an NFA
//  ^ static void compact(struct nfa *, struct cnfa *);
//
func compact(tls *libc.TLS, nfa uintptr, cnfa uintptr) { /* regc_nfa.c:2802:1: */
	var s uintptr
	var a uintptr
	var nstates Size_t
	var narcs Size_t
	var ca uintptr
	var first uintptr

	nstates = uint64(0)
	narcs = uint64(0)
	for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0); s = (*State)(unsafe.Pointer(s)).Fnext {
		nstates++
		narcs = narcs + Size_t((*State)(unsafe.Pointer(s)).Fnouts+1) // need one extra for endmarker
	}

	(*Cnfa)(unsafe.Pointer(cnfa)).Fstflags = XTclpAlloc(tls, uint32(nstates*Size_t(unsafe.Sizeof(int8(0)))))
	(*Cnfa)(unsafe.Pointer(cnfa)).Fstates = XTclpAlloc(tls, uint32(nstates*Size_t(unsafe.Sizeof(uintptr(0)))))
	(*Cnfa)(unsafe.Pointer(cnfa)).Farcs = XTclpAlloc(tls, uint32(narcs*Size_t(unsafe.Sizeof(Carc{}))))
	if (*Cnfa)(unsafe.Pointer(cnfa)).Fstflags == uintptr(0) || (*Cnfa)(unsafe.Pointer(cnfa)).Fstates == uintptr(0) || (*Cnfa)(unsafe.Pointer(cnfa)).Farcs == uintptr(0) {
		if (*Cnfa)(unsafe.Pointer(cnfa)).Fstflags != uintptr(0) {
			XTclpFree(tls, (*Cnfa)(unsafe.Pointer(cnfa)).Fstflags)
		}
		if (*Cnfa)(unsafe.Pointer(cnfa)).Fstates != uintptr(0) {
			XTclpFree(tls, (*Cnfa)(unsafe.Pointer(cnfa)).Fstates)
		}
		if (*Cnfa)(unsafe.Pointer(cnfa)).Farcs != uintptr(0) {
			XTclpFree(tls, (*Cnfa)(unsafe.Pointer(cnfa)).Farcs)
		}
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
			}
			return REG_ESPACE
		}()
		return
	}
	(*Cnfa)(unsafe.Pointer(cnfa)).Fnstates = int32(nstates)
	(*Cnfa)(unsafe.Pointer(cnfa)).Fpre = (*State)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fpre)).Fno
	(*Cnfa)(unsafe.Pointer(cnfa)).Fpost = (*State)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fpost)).Fno
	*(*Color)(unsafe.Pointer(cnfa + 20)) = *(*Color)(unsafe.Pointer(nfa + 72))
	*(*Color)(unsafe.Pointer(cnfa + 20 + 1*2)) = *(*Color)(unsafe.Pointer(nfa + 72 + 1*2))
	*(*Color)(unsafe.Pointer(cnfa + 24)) = *(*Color)(unsafe.Pointer(nfa + 76))
	*(*Color)(unsafe.Pointer(cnfa + 24 + 1*2)) = *(*Color)(unsafe.Pointer(nfa + 76 + 1*2))
	(*Cnfa)(unsafe.Pointer(cnfa)).Fncolors = int32(maxcolor(tls, (*Nfa)(unsafe.Pointer(nfa)).Fcm)) + 1
	(*Cnfa)(unsafe.Pointer(cnfa)).Fflags = 0

	ca = (*Cnfa)(unsafe.Pointer(cnfa)).Farcs
	for s = (*Nfa)(unsafe.Pointer(nfa)).Fstates; s != uintptr(0); s = (*State)(unsafe.Pointer(s)).Fnext {

		*(*int8)(unsafe.Pointer((*Cnfa)(unsafe.Pointer(cnfa)).Fstflags + uintptr((*State)(unsafe.Pointer(s)).Fno))) = int8(0)
		*(*uintptr)(unsafe.Pointer((*Cnfa)(unsafe.Pointer(cnfa)).Fstates + uintptr((*State)(unsafe.Pointer(s)).Fno)*8)) = ca
		first = ca
		for a = (*State)(unsafe.Pointer(s)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
			switch (*Arc)(unsafe.Pointer(a)).Ftype {
			case 'p':
				(*Carc)(unsafe.Pointer(ca)).Fco = (*Arc)(unsafe.Pointer(a)).Fco
				(*Carc)(unsafe.Pointer(ca)).Fto = (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(a)).Fto)).Fno
				ca += 8
				break
			case 'L':

				(*Carc)(unsafe.Pointer(ca)).Fco = Color((*Cnfa)(unsafe.Pointer(cnfa)).Fncolors + int32((*Arc)(unsafe.Pointer(a)).Fco))
				(*Carc)(unsafe.Pointer(ca)).Fto = (*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(a)).Fto)).Fno
				ca += 8
				*(*int32)(unsafe.Pointer(cnfa + 8)) |= HASLACONS
				break
			default:
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = 'e'
				(*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fnow         uintptr
						Fstop        uintptr
						Fsavenow     uintptr
						Fsavestop    uintptr
						Ferr         int32
						Fcflags      int32
						Flasttype    int32
						Fnexttype    int32
						Fnextvalue   Chr
						F__ccgo_pad1 [2]byte
						Flexcon      int32
						Fnsubexp     int32
						F__ccgo_pad2 [4]byte
						Fsubs        uintptr
						Fnsubs       Size_t
						Fsub10       [10]uintptr
						Fnfa         uintptr
						Fcm          uintptr
						Fnlcolor     Color
						F__ccgo_pad3 [6]byte
						Fwordchrs    uintptr
						Ftree        uintptr
						Ftreechain   uintptr
						Ftreefree    uintptr
						Fntree       int32
						F__ccgo_pad4 [4]byte
						Fcv          uintptr
						Fcv2         uintptr
						Flacons      uintptr
						Fnlacons     int32
						F__ccgo_pad5 [4]byte
						Fspaceused   Size_t
					})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fnow         uintptr
							Fstop        uintptr
							Fsavenow     uintptr
							Fsavestop    uintptr
							Ferr         int32
							Fcflags      int32
							Flasttype    int32
							Fnexttype    int32
							Fnextvalue   Chr
							F__ccgo_pad1 [2]byte
							Flexcon      int32
							Fnsubexp     int32
							F__ccgo_pad2 [4]byte
							Fsubs        uintptr
							Fnsubs       Size_t
							Fsub10       [10]uintptr
							Fnfa         uintptr
							Fcm          uintptr
							Fnlcolor     Color
							F__ccgo_pad3 [6]byte
							Fwordchrs    uintptr
							Ftree        uintptr
							Ftreechain   uintptr
							Ftreefree    uintptr
							Fntree       int32
							F__ccgo_pad4 [4]byte
							Fcv          uintptr
							Fcv2         uintptr
							Flacons      uintptr
							Fnlacons     int32
							F__ccgo_pad5 [4]byte
							Fspaceused   Size_t
						})(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fv)).Ferr
					}
					return REG_ASSERT
				}()
				break
			}
		}
		carcsort(tls, first, uint64((int64(ca)-int64(first))/8))
		(*Carc)(unsafe.Pointer(ca)).Fco = int16(-1)
		(*Carc)(unsafe.Pointer(ca)).Fto = 0
		ca += 8
	}

	// Mark no-progress states.

	for a = (*State)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fpre)).Fouts; a != uintptr(0); a = (*Arc)(unsafe.Pointer(a)).Foutchain {
		*(*int8)(unsafe.Pointer((*Cnfa)(unsafe.Pointer(cnfa)).Fstflags + uintptr((*State)(unsafe.Pointer((*Arc)(unsafe.Pointer(a)).Fto)).Fno))) = int8(CNFA_NOPROGRESS)
	}
	*(*int8)(unsafe.Pointer((*Cnfa)(unsafe.Pointer(cnfa)).Fstflags + uintptr((*State)(unsafe.Pointer((*Nfa)(unsafe.Pointer(nfa)).Fpre)).Fno))) = int8(CNFA_NOPROGRESS)
}

//
//  - carcsort - sort compacted-NFA arcs by color
//  ^ static void carcsort(struct carc *, struct carc *);
//
func carcsort(tls *libc.TLS, first uintptr, n Size_t) { /* regc_nfa.c:2896:1: */
	if n > uint64(1) {
		libc.Xqsort(tls, first, n, uint64(unsafe.Sizeof(Carc{})), *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr) int32
		}{carc_cmp})))
	}
}

func carc_cmp(tls *libc.TLS, a uintptr, b uintptr) int32 { /* regc_nfa.c:2906:1: */
	var aa uintptr = a
	var bb uintptr = b

	if int32((*Carc)(unsafe.Pointer(aa)).Fco) < int32((*Carc)(unsafe.Pointer(bb)).Fco) {
		return -1
	}
	if int32((*Carc)(unsafe.Pointer(aa)).Fco) > int32((*Carc)(unsafe.Pointer(bb)).Fco) {
		return +1
	}
	if (*Carc)(unsafe.Pointer(aa)).Fto < (*Carc)(unsafe.Pointer(bb)).Fto {
		return -1
	}
	if (*Carc)(unsafe.Pointer(aa)).Fto > (*Carc)(unsafe.Pointer(bb)).Fto {
		return +1
	}
	return 0
}

//
//  - freecnfa - free a compacted NFA
//  ^ static void freecnfa(struct cnfa *);
//
func freecnfa(tls *libc.TLS, cnfa uintptr) { /* regc_nfa.c:2933:1: */
	// not empty already
	(*Cnfa)(unsafe.Pointer(cnfa)).Fnstates = 0
	XTclpFree(tls, (*Cnfa)(unsafe.Pointer(cnfa)).Fstflags)
	XTclpFree(tls, (*Cnfa)(unsafe.Pointer(cnfa)).Fstates)
	XTclpFree(tls, (*Cnfa)(unsafe.Pointer(cnfa)).Farcs)
}

//
//  - dumpnfa - dump an NFA in human-readable form
//  ^ static void dumpnfa(struct nfa *, FILE *);
//
func dumpnfa(tls *libc.TLS, nfa uintptr, f uintptr) { /* regc_nfa.c:2948:1: */
	_ = nfa
	_ = f
}

//
//  - dumpcnfa - dump a compacted NFA in human-readable form
//  ^ static void dumpcnfa(struct cnfa *, FILE *);
//
func dumpcnfa(tls *libc.TLS, cnfa uintptr, f uintptr) { /* regc_nfa.c:3135:1: */
	_ = cnfa
	_ = f
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Utility functions for handling cvecs
// This file is #included by regcomp.c.
//
// Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.
//
// Development of this software was funded, in part, by Cray Research Inc.,
// UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
// Corporation, none of whom are responsible for the results. The author
// thanks all of them.
//
// Redistribution and use in source and binary forms -- with or without
// modification -- are permitted for any purpose, provided that
// redistributions in source form retain this entire copyright notice and
// indicate the origin and nature of any modifications.
//
// I'd appreciate being given credit for this package in the documentation of
// software which uses it, but that is not a requirement.
//
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
// HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// Notes:
// Only (selected) functions in _this_ file should treat chr* as non-constant.

//
//  - newcvec - allocate a new cvec
//  ^ static struct cvec *newcvec(int, int);
//
func newcvec(tls *libc.TLS, nchrs int32, nranges int32) uintptr { /* regc_cvec.c:41:20: */
	var nc Size_t = Size_t(nchrs) + Size_t(nranges)*uint64(2)
	var n Size_t = uint64(unsafe.Sizeof(Cvec{})) + nc*Size_t(unsafe.Sizeof(Chr(0)))
	var cv uintptr = XTclpAlloc(tls, uint32(n))

	if cv == uintptr(0) {
		return uintptr(0)
	}
	(*Cvec)(unsafe.Pointer(cv)).Fchrspace = nchrs
	(*Cvec)(unsafe.Pointer(cv)).Fchrs = cv + uintptr(uint64(unsafe.Sizeof(Cvec{})))
	(*Cvec)(unsafe.Pointer(cv)).Franges = (*Cvec)(unsafe.Pointer(cv)).Fchrs + uintptr(nchrs)*2
	(*Cvec)(unsafe.Pointer(cv)).Frangespace = nranges
	return clearcvec(tls, cv)
}

//
//  - clearcvec - clear a possibly-new cvec
//  * Returns pointer as convenience.
//  ^ static struct cvec *clearcvec(struct cvec *);
//
func clearcvec(tls *libc.TLS, cv uintptr) uintptr { /* regc_cvec.c:65:20: */

	(*Cvec)(unsafe.Pointer(cv)).Fnchrs = 0
	(*Cvec)(unsafe.Pointer(cv)).Fnranges = 0
	return cv
}

//
//  - addchr - add a chr to a cvec
//  ^ static void addchr(struct cvec *, pchr);
//
func addchr(tls *libc.TLS, cv uintptr, c Pchr) { /* regc_cvec.c:80:1: */

	*(*Chr)(unsafe.Pointer((*Cvec)(unsafe.Pointer(cv)).Fchrs + uintptr(libc.PostIncInt32(&(*Cvec)(unsafe.Pointer(cv)).Fnchrs, 1))*2)) = Chr(c)
}

//
//  - addrange - add a range to a cvec
//  ^ static void addrange(struct cvec *, pchr, pchr);
//
func addrange(tls *libc.TLS, cv uintptr, from Pchr, to Pchr) { /* regc_cvec.c:93:1: */

	*(*Chr)(unsafe.Pointer((*Cvec)(unsafe.Pointer(cv)).Franges + uintptr((*Cvec)(unsafe.Pointer(cv)).Fnranges*2)*2)) = Chr(from)
	*(*Chr)(unsafe.Pointer((*Cvec)(unsafe.Pointer(cv)).Franges + uintptr((*Cvec)(unsafe.Pointer(cv)).Fnranges*2+1)*2)) = Chr(to)
	(*Cvec)(unsafe.Pointer(cv)).Fnranges++
}

//
//  - getcvec - get a cvec, remembering it as v->cv
//  ^ static struct cvec *getcvec(struct vars *, int, int);
//
func getcvec(tls *libc.TLS, v uintptr, nchrs int32, nranges int32) uintptr { /* regc_cvec.c:108:20: */
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv != uintptr(0) && nchrs <= (*Cvec)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv)).Fchrspace && nranges <= (*Cvec)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv)).Frangespace {
		return clearcvec(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcv)
	}

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv != uintptr(0) {
		freecvec(tls, (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fcv)
	}
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv = newcvec(tls, nchrs, nranges)
	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv == uintptr(0) {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ESPACE
		}()
	}

	return (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcv
}

//
//  - freecvec - free a cvec
//  ^ static void freecvec(struct cvec *);
//
func freecvec(tls *libc.TLS, cv uintptr) { /* regc_cvec.c:135:1: */
	XTclpFree(tls, cv)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// regc_locale.c --
//
//	This file contains the Unicode locale specific regexp routines.
//	This file is #included by regcomp.c.
//
// Copyright (c) 1998 by Scriptics Corporation.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// ASCII character-name table

type Cname = struct {
	Fname        uintptr
	Fcode        int8
	F__ccgo_pad1 [7]byte
} /* regc_locale.c:15:14 */

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// regc_locale.c --
//
//	This file contains the Unicode locale specific regexp routines.
//	This file is #included by regcomp.c.
//
// Copyright (c) 1998 by Scriptics Corporation.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// ASCII character-name table

var cnames = [96]Cname{
	{Fname: ts + 424},
	{Fname: ts + 428, Fcode: int8('\001')},
	{Fname: ts + 432, Fcode: int8('\002')},
	{Fname: ts + 436, Fcode: int8('\003')},
	{Fname: ts + 440, Fcode: int8('\004')},
	{Fname: ts + 444, Fcode: int8('\005')},
	{Fname: ts + 448, Fcode: int8('\006')},
	{Fname: ts + 452, Fcode: int8('\007')},
	{Fname: ts + 456, Fcode: int8('\007')},
	{Fname: ts + 462, Fcode: int8('\010')},
	{Fname: ts + 465, Fcode: int8('\b')},
	{Fname: ts + 475, Fcode: int8('\011')},
	{Fname: ts + 478, Fcode: int8('\t')},
	{Fname: ts + 482, Fcode: int8('\012')},
	{Fname: ts + 485, Fcode: int8('\n')},
	{Fname: ts + 493, Fcode: int8('\013')},
	{Fname: ts + 496, Fcode: int8('\v')},
	{Fname: ts + 509, Fcode: int8('\014')},
	{Fname: ts + 512, Fcode: int8('\f')},
	{Fname: ts + 522, Fcode: int8('\015')},
	{Fname: ts + 525, Fcode: int8('\r')},
	{Fname: ts + 541, Fcode: int8('\016')},
	{Fname: ts + 544, Fcode: int8('\017')},
	{Fname: ts + 547, Fcode: int8('\020')},
	{Fname: ts + 551, Fcode: int8('\021')},
	{Fname: ts + 555, Fcode: int8('\022')},
	{Fname: ts + 559, Fcode: int8('\023')},
	{Fname: ts + 563, Fcode: int8('\024')},
	{Fname: ts + 567, Fcode: int8('\025')},
	{Fname: ts + 571, Fcode: int8('\026')},
	{Fname: ts + 575, Fcode: int8('\027')},
	{Fname: ts + 579, Fcode: int8('\030')},
	{Fname: ts + 583, Fcode: int8('\031')},
	{Fname: ts + 586, Fcode: int8('\032')},
	{Fname: ts + 590, Fcode: int8('\033')},
	{Fname: ts + 594, Fcode: int8('\034')},
	{Fname: ts + 598, Fcode: int8('\034')},
	{Fname: ts + 601, Fcode: int8('\035')},
	{Fname: ts + 605, Fcode: int8('\035')},
	{Fname: ts + 608, Fcode: int8('\036')},
	{Fname: ts + 612, Fcode: int8('\036')},
	{Fname: ts + 615, Fcode: int8('\037')},
	{Fname: ts + 619, Fcode: int8('\037')},
	{Fname: ts + 622, Fcode: int8(' ')},
	{Fname: ts + 628, Fcode: int8('!')},
	{Fname: ts + 645, Fcode: int8('"')},
	{Fname: ts + 660, Fcode: int8('#')},
	{Fname: ts + 672, Fcode: int8('$')},
	{Fname: ts + 684, Fcode: int8('%')},
	{Fname: ts + 697, Fcode: int8('&')},
	{Fname: ts + 707, Fcode: int8('\'')},
	{Fname: ts + 718, Fcode: int8('(')},
	{Fname: ts + 735, Fcode: int8(')')},
	{Fname: ts + 753, Fcode: int8('*')},
	{Fname: ts + 762, Fcode: int8('+')},
	{Fname: ts + 772, Fcode: int8(',')},
	{Fname: ts + 778, Fcode: int8('-')},
	{Fname: ts + 785, Fcode: int8('-')},
	{Fname: ts + 798, Fcode: int8('.')},
	{Fname: ts + 805, Fcode: int8('.')},
	{Fname: ts + 815, Fcode: int8('/')},
	{Fname: ts + 821, Fcode: int8('/')},
	{Fname: ts + 829, Fcode: int8('0')},
	{Fname: ts + 834, Fcode: int8('1')},
	{Fname: ts + 838, Fcode: int8('2')},
	{Fname: ts + 842, Fcode: int8('3')},
	{Fname: ts + 848, Fcode: int8('4')},
	{Fname: ts + 853, Fcode: int8('5')},
	{Fname: ts + 858, Fcode: int8('6')},
	{Fname: ts + 862, Fcode: int8('7')},
	{Fname: ts + 868, Fcode: int8('8')},
	{Fname: ts + 874, Fcode: int8('9')},
	{Fname: ts + 879, Fcode: int8(':')},
	{Fname: ts + 885, Fcode: int8(';')},
	{Fname: ts + 895, Fcode: int8('<')},
	{Fname: ts + 910, Fcode: int8('=')},
	{Fname: ts + 922, Fcode: int8('>')},
	{Fname: ts + 940, Fcode: int8('?')},
	{Fname: ts + 954, Fcode: int8('@')},
	{Fname: ts + 968, Fcode: int8('[')},
	{Fname: ts + 988, Fcode: int8('\\')},
	{Fname: ts + 998, Fcode: int8('\\')},
	{Fname: ts + 1014, Fcode: int8(']')},
	{Fname: ts + 1035, Fcode: int8('^')},
	{Fname: ts + 1046, Fcode: int8('^')},
	{Fname: ts + 1064, Fcode: int8('_')},
	{Fname: ts + 1075, Fcode: int8('_')},
	{Fname: ts + 1084, Fcode: int8('`')},
	{Fname: ts + 1097, Fcode: int8('{')},
	{Fname: ts + 1108, Fcode: int8('{')},
	{Fname: ts + 1127, Fcode: int8('|')},
	{Fname: ts + 1141, Fcode: int8('}')},
	{Fname: ts + 1153, Fcode: int8('}')},
	{Fname: ts + 1173, Fcode: int8('~')},
	{Fname: ts + 1179, Fcode: int8('\177')},
	{},
} /* regc_locale.c:18:3 */

// Unicode character-class tables.

type Crange = struct {
	Fstart Chr
	Fend   Chr
} /* regc_locale.c:124:3 */

//	Declarations of Unicode character ranges.  This code
//	is automatically generated by the tools/uniClass.tcl script
//	and used in generic/regc_locale.c.  Do not modify by hand.

// Unicode: alphabetic characters.

var alphaRangeTable = [258]Crange{
	{Fstart: Chr(0x41), Fend: Chr(0x5A)}, {Fstart: Chr(0x61), Fend: Chr(0x7A)}, {Fstart: Chr(0xC0), Fend: Chr(0xD6)}, {Fstart: Chr(0xD8), Fend: Chr(0xF6)},
	{Fstart: Chr(0xF8), Fend: Chr(0x2C1)}, {Fstart: Chr(0x2C6), Fend: Chr(0x2D1)}, {Fstart: Chr(0x2E0), Fend: Chr(0x2E4)}, {Fstart: Chr(0x370), Fend: Chr(0x374)},
	{Fstart: Chr(0x37A), Fend: Chr(0x37D)}, {Fstart: Chr(0x388), Fend: Chr(0x38A)}, {Fstart: Chr(0x38E), Fend: Chr(0x3A1)}, {Fstart: Chr(0x3A3), Fend: Chr(0x3F5)},
	{Fstart: Chr(0x3F7), Fend: Chr(0x481)}, {Fstart: Chr(0x48A), Fend: Chr(0x52F)}, {Fstart: Chr(0x531), Fend: Chr(0x556)}, {Fstart: Chr(0x560), Fend: Chr(0x588)},
	{Fstart: Chr(0x5D0), Fend: Chr(0x5EA)}, {Fstart: Chr(0x5EF), Fend: Chr(0x5F2)}, {Fstart: Chr(0x620), Fend: Chr(0x64A)}, {Fstart: Chr(0x671), Fend: Chr(0x6D3)},
	{Fstart: Chr(0x6FA), Fend: Chr(0x6FC)}, {Fstart: Chr(0x712), Fend: Chr(0x72F)}, {Fstart: Chr(0x74D), Fend: Chr(0x7A5)}, {Fstart: Chr(0x7CA), Fend: Chr(0x7EA)},
	{Fstart: Chr(0x800), Fend: Chr(0x815)}, {Fstart: Chr(0x840), Fend: Chr(0x858)}, {Fstart: Chr(0x860), Fend: Chr(0x86A)}, {Fstart: Chr(0x870), Fend: Chr(0x887)},
	{Fstart: Chr(0x889), Fend: Chr(0x88E)}, {Fstart: Chr(0x8A0), Fend: Chr(0x8C9)}, {Fstart: Chr(0x904), Fend: Chr(0x939)}, {Fstart: Chr(0x958), Fend: Chr(0x961)},
	{Fstart: Chr(0x971), Fend: Chr(0x980)}, {Fstart: Chr(0x985), Fend: Chr(0x98C)}, {Fstart: Chr(0x993), Fend: Chr(0x9A8)}, {Fstart: Chr(0x9AA), Fend: Chr(0x9B0)},
	{Fstart: Chr(0x9B6), Fend: Chr(0x9B9)}, {Fstart: Chr(0x9DF), Fend: Chr(0x9E1)}, {Fstart: Chr(0xA05), Fend: Chr(0xA0A)}, {Fstart: Chr(0xA13), Fend: Chr(0xA28)},
	{Fstart: Chr(0xA2A), Fend: Chr(0xA30)}, {Fstart: Chr(0xA59), Fend: Chr(0xA5C)}, {Fstart: Chr(0xA72), Fend: Chr(0xA74)}, {Fstart: Chr(0xA85), Fend: Chr(0xA8D)},
	{Fstart: Chr(0xA8F), Fend: Chr(0xA91)}, {Fstart: Chr(0xA93), Fend: Chr(0xAA8)}, {Fstart: Chr(0xAAA), Fend: Chr(0xAB0)}, {Fstart: Chr(0xAB5), Fend: Chr(0xAB9)},
	{Fstart: Chr(0xB05), Fend: Chr(0xB0C)}, {Fstart: Chr(0xB13), Fend: Chr(0xB28)}, {Fstart: Chr(0xB2A), Fend: Chr(0xB30)}, {Fstart: Chr(0xB35), Fend: Chr(0xB39)},
	{Fstart: Chr(0xB5F), Fend: Chr(0xB61)}, {Fstart: Chr(0xB85), Fend: Chr(0xB8A)}, {Fstart: Chr(0xB8E), Fend: Chr(0xB90)}, {Fstart: Chr(0xB92), Fend: Chr(0xB95)},
	{Fstart: Chr(0xBA8), Fend: Chr(0xBAA)}, {Fstart: Chr(0xBAE), Fend: Chr(0xBB9)}, {Fstart: Chr(0xC05), Fend: Chr(0xC0C)}, {Fstart: Chr(0xC0E), Fend: Chr(0xC10)},
	{Fstart: Chr(0xC12), Fend: Chr(0xC28)}, {Fstart: Chr(0xC2A), Fend: Chr(0xC39)}, {Fstart: Chr(0xC58), Fend: Chr(0xC5A)}, {Fstart: Chr(0xC85), Fend: Chr(0xC8C)},
	{Fstart: Chr(0xC8E), Fend: Chr(0xC90)}, {Fstart: Chr(0xC92), Fend: Chr(0xCA8)}, {Fstart: Chr(0xCAA), Fend: Chr(0xCB3)}, {Fstart: Chr(0xCB5), Fend: Chr(0xCB9)},
	{Fstart: Chr(0xD04), Fend: Chr(0xD0C)}, {Fstart: Chr(0xD0E), Fend: Chr(0xD10)}, {Fstart: Chr(0xD12), Fend: Chr(0xD3A)}, {Fstart: Chr(0xD54), Fend: Chr(0xD56)},
	{Fstart: Chr(0xD5F), Fend: Chr(0xD61)}, {Fstart: Chr(0xD7A), Fend: Chr(0xD7F)}, {Fstart: Chr(0xD85), Fend: Chr(0xD96)}, {Fstart: Chr(0xD9A), Fend: Chr(0xDB1)},
	{Fstart: Chr(0xDB3), Fend: Chr(0xDBB)}, {Fstart: Chr(0xDC0), Fend: Chr(0xDC6)}, {Fstart: Chr(0xE01), Fend: Chr(0xE30)}, {Fstart: Chr(0xE40), Fend: Chr(0xE46)},
	{Fstart: Chr(0xE86), Fend: Chr(0xE8A)}, {Fstart: Chr(0xE8C), Fend: Chr(0xEA3)}, {Fstart: Chr(0xEA7), Fend: Chr(0xEB0)}, {Fstart: Chr(0xEC0), Fend: Chr(0xEC4)},
	{Fstart: Chr(0xEDC), Fend: Chr(0xEDF)}, {Fstart: Chr(0xF40), Fend: Chr(0xF47)}, {Fstart: Chr(0xF49), Fend: Chr(0xF6C)}, {Fstart: Chr(0xF88), Fend: Chr(0xF8C)},
	{Fstart: Chr(0x1000), Fend: Chr(0x102A)}, {Fstart: Chr(0x1050), Fend: Chr(0x1055)}, {Fstart: Chr(0x105A), Fend: Chr(0x105D)}, {Fstart: Chr(0x106E), Fend: Chr(0x1070)},
	{Fstart: Chr(0x1075), Fend: Chr(0x1081)}, {Fstart: Chr(0x10A0), Fend: Chr(0x10C5)}, {Fstart: Chr(0x10D0), Fend: Chr(0x10FA)}, {Fstart: Chr(0x10FC), Fend: Chr(0x1248)},
	{Fstart: Chr(0x124A), Fend: Chr(0x124D)}, {Fstart: Chr(0x1250), Fend: Chr(0x1256)}, {Fstart: Chr(0x125A), Fend: Chr(0x125D)}, {Fstart: Chr(0x1260), Fend: Chr(0x1288)},
	{Fstart: Chr(0x128A), Fend: Chr(0x128D)}, {Fstart: Chr(0x1290), Fend: Chr(0x12B0)}, {Fstart: Chr(0x12B2), Fend: Chr(0x12B5)}, {Fstart: Chr(0x12B8), Fend: Chr(0x12BE)},
	{Fstart: Chr(0x12C2), Fend: Chr(0x12C5)}, {Fstart: Chr(0x12C8), Fend: Chr(0x12D6)}, {Fstart: Chr(0x12D8), Fend: Chr(0x1310)}, {Fstart: Chr(0x1312), Fend: Chr(0x1315)},
	{Fstart: Chr(0x1318), Fend: Chr(0x135A)}, {Fstart: Chr(0x1380), Fend: Chr(0x138F)}, {Fstart: Chr(0x13A0), Fend: Chr(0x13F5)}, {Fstart: Chr(0x13F8), Fend: Chr(0x13FD)},
	{Fstart: Chr(0x1401), Fend: Chr(0x166C)}, {Fstart: Chr(0x166F), Fend: Chr(0x167F)}, {Fstart: Chr(0x1681), Fend: Chr(0x169A)}, {Fstart: Chr(0x16A0), Fend: Chr(0x16EA)},
	{Fstart: Chr(0x16F1), Fend: Chr(0x16F8)}, {Fstart: Chr(0x1700), Fend: Chr(0x1711)}, {Fstart: Chr(0x171F), Fend: Chr(0x1731)}, {Fstart: Chr(0x1740), Fend: Chr(0x1751)},
	{Fstart: Chr(0x1760), Fend: Chr(0x176C)}, {Fstart: Chr(0x176E), Fend: Chr(0x1770)}, {Fstart: Chr(0x1780), Fend: Chr(0x17B3)}, {Fstart: Chr(0x1820), Fend: Chr(0x1878)},
	{Fstart: Chr(0x1880), Fend: Chr(0x1884)}, {Fstart: Chr(0x1887), Fend: Chr(0x18A8)}, {Fstart: Chr(0x18B0), Fend: Chr(0x18F5)}, {Fstart: Chr(0x1900), Fend: Chr(0x191E)},
	{Fstart: Chr(0x1950), Fend: Chr(0x196D)}, {Fstart: Chr(0x1970), Fend: Chr(0x1974)}, {Fstart: Chr(0x1980), Fend: Chr(0x19AB)}, {Fstart: Chr(0x19B0), Fend: Chr(0x19C9)},
	{Fstart: Chr(0x1A00), Fend: Chr(0x1A16)}, {Fstart: Chr(0x1A20), Fend: Chr(0x1A54)}, {Fstart: Chr(0x1B05), Fend: Chr(0x1B33)}, {Fstart: Chr(0x1B45), Fend: Chr(0x1B4C)},
	{Fstart: Chr(0x1B83), Fend: Chr(0x1BA0)}, {Fstart: Chr(0x1BBA), Fend: Chr(0x1BE5)}, {Fstart: Chr(0x1C00), Fend: Chr(0x1C23)}, {Fstart: Chr(0x1C4D), Fend: Chr(0x1C4F)},
	{Fstart: Chr(0x1C5A), Fend: Chr(0x1C7D)}, {Fstart: Chr(0x1C80), Fend: Chr(0x1C88)}, {Fstart: Chr(0x1C90), Fend: Chr(0x1CBA)}, {Fstart: Chr(0x1CBD), Fend: Chr(0x1CBF)},
	{Fstart: Chr(0x1CE9), Fend: Chr(0x1CEC)}, {Fstart: Chr(0x1CEE), Fend: Chr(0x1CF3)}, {Fstart: Chr(0x1D00), Fend: Chr(0x1DBF)}, {Fstart: Chr(0x1E00), Fend: Chr(0x1F15)},
	{Fstart: Chr(0x1F18), Fend: Chr(0x1F1D)}, {Fstart: Chr(0x1F20), Fend: Chr(0x1F45)}, {Fstart: Chr(0x1F48), Fend: Chr(0x1F4D)}, {Fstart: Chr(0x1F50), Fend: Chr(0x1F57)},
	{Fstart: Chr(0x1F5F), Fend: Chr(0x1F7D)}, {Fstart: Chr(0x1F80), Fend: Chr(0x1FB4)}, {Fstart: Chr(0x1FB6), Fend: Chr(0x1FBC)}, {Fstart: Chr(0x1FC2), Fend: Chr(0x1FC4)},
	{Fstart: Chr(0x1FC6), Fend: Chr(0x1FCC)}, {Fstart: Chr(0x1FD0), Fend: Chr(0x1FD3)}, {Fstart: Chr(0x1FD6), Fend: Chr(0x1FDB)}, {Fstart: Chr(0x1FE0), Fend: Chr(0x1FEC)},
	{Fstart: Chr(0x1FF2), Fend: Chr(0x1FF4)}, {Fstart: Chr(0x1FF6), Fend: Chr(0x1FFC)}, {Fstart: Chr(0x2090), Fend: Chr(0x209C)}, {Fstart: Chr(0x210A), Fend: Chr(0x2113)},
	{Fstart: Chr(0x2119), Fend: Chr(0x211D)}, {Fstart: Chr(0x212A), Fend: Chr(0x212D)}, {Fstart: Chr(0x212F), Fend: Chr(0x2139)}, {Fstart: Chr(0x213C), Fend: Chr(0x213F)},
	{Fstart: Chr(0x2145), Fend: Chr(0x2149)}, {Fstart: Chr(0x2C00), Fend: Chr(0x2CE4)}, {Fstart: Chr(0x2CEB), Fend: Chr(0x2CEE)}, {Fstart: Chr(0x2D00), Fend: Chr(0x2D25)},
	{Fstart: Chr(0x2D30), Fend: Chr(0x2D67)}, {Fstart: Chr(0x2D80), Fend: Chr(0x2D96)}, {Fstart: Chr(0x2DA0), Fend: Chr(0x2DA6)}, {Fstart: Chr(0x2DA8), Fend: Chr(0x2DAE)},
	{Fstart: Chr(0x2DB0), Fend: Chr(0x2DB6)}, {Fstart: Chr(0x2DB8), Fend: Chr(0x2DBE)}, {Fstart: Chr(0x2DC0), Fend: Chr(0x2DC6)}, {Fstart: Chr(0x2DC8), Fend: Chr(0x2DCE)},
	{Fstart: Chr(0x2DD0), Fend: Chr(0x2DD6)}, {Fstart: Chr(0x2DD8), Fend: Chr(0x2DDE)}, {Fstart: Chr(0x3031), Fend: Chr(0x3035)}, {Fstart: Chr(0x3041), Fend: Chr(0x3096)},
	{Fstart: Chr(0x309D), Fend: Chr(0x309F)}, {Fstart: Chr(0x30A1), Fend: Chr(0x30FA)}, {Fstart: Chr(0x30FC), Fend: Chr(0x30FF)}, {Fstart: Chr(0x3105), Fend: Chr(0x312F)},
	{Fstart: Chr(0x3131), Fend: Chr(0x318E)}, {Fstart: Chr(0x31A0), Fend: Chr(0x31BF)}, {Fstart: Chr(0x31F0), Fend: Chr(0x31FF)}, {Fstart: Chr(0x3400), Fend: Chr(0x4DBF)},
	{Fstart: Chr(0x4E00), Fend: Chr(0xA48C)}, {Fstart: Chr(0xA4D0), Fend: Chr(0xA4FD)}, {Fstart: Chr(0xA500), Fend: Chr(0xA60C)}, {Fstart: Chr(0xA610), Fend: Chr(0xA61F)},
	{Fstart: Chr(0xA640), Fend: Chr(0xA66E)}, {Fstart: Chr(0xA67F), Fend: Chr(0xA69D)}, {Fstart: Chr(0xA6A0), Fend: Chr(0xA6E5)}, {Fstart: Chr(0xA717), Fend: Chr(0xA71F)},
	{Fstart: Chr(0xA722), Fend: Chr(0xA788)}, {Fstart: Chr(0xA78B), Fend: Chr(0xA7CA)}, {Fstart: Chr(0xA7D5), Fend: Chr(0xA7D9)}, {Fstart: Chr(0xA7F2), Fend: Chr(0xA801)},
	{Fstart: Chr(0xA803), Fend: Chr(0xA805)}, {Fstart: Chr(0xA807), Fend: Chr(0xA80A)}, {Fstart: Chr(0xA80C), Fend: Chr(0xA822)}, {Fstart: Chr(0xA840), Fend: Chr(0xA873)},
	{Fstart: Chr(0xA882), Fend: Chr(0xA8B3)}, {Fstart: Chr(0xA8F2), Fend: Chr(0xA8F7)}, {Fstart: Chr(0xA90A), Fend: Chr(0xA925)}, {Fstart: Chr(0xA930), Fend: Chr(0xA946)},
	{Fstart: Chr(0xA960), Fend: Chr(0xA97C)}, {Fstart: Chr(0xA984), Fend: Chr(0xA9B2)}, {Fstart: Chr(0xA9E0), Fend: Chr(0xA9E4)}, {Fstart: Chr(0xA9E6), Fend: Chr(0xA9EF)},
	{Fstart: Chr(0xA9FA), Fend: Chr(0xA9FE)}, {Fstart: Chr(0xAA00), Fend: Chr(0xAA28)}, {Fstart: Chr(0xAA40), Fend: Chr(0xAA42)}, {Fstart: Chr(0xAA44), Fend: Chr(0xAA4B)},
	{Fstart: Chr(0xAA60), Fend: Chr(0xAA76)}, {Fstart: Chr(0xAA7E), Fend: Chr(0xAAAF)}, {Fstart: Chr(0xAAB9), Fend: Chr(0xAABD)}, {Fstart: Chr(0xAADB), Fend: Chr(0xAADD)},
	{Fstart: Chr(0xAAE0), Fend: Chr(0xAAEA)}, {Fstart: Chr(0xAAF2), Fend: Chr(0xAAF4)}, {Fstart: Chr(0xAB01), Fend: Chr(0xAB06)}, {Fstart: Chr(0xAB09), Fend: Chr(0xAB0E)},
	{Fstart: Chr(0xAB11), Fend: Chr(0xAB16)}, {Fstart: Chr(0xAB20), Fend: Chr(0xAB26)}, {Fstart: Chr(0xAB28), Fend: Chr(0xAB2E)}, {Fstart: Chr(0xAB30), Fend: Chr(0xAB5A)},
	{Fstart: Chr(0xAB5C), Fend: Chr(0xAB69)}, {Fstart: Chr(0xAB70), Fend: Chr(0xABE2)}, {Fstart: Chr(0xAC00), Fend: Chr(0xD7A3)}, {Fstart: Chr(0xD7B0), Fend: Chr(0xD7C6)},
	{Fstart: Chr(0xD7CB), Fend: Chr(0xD7FB)}, {Fstart: Chr(0xF900), Fend: Chr(0xFA6D)}, {Fstart: Chr(0xFA70), Fend: Chr(0xFAD9)}, {Fstart: Chr(0xFB00), Fend: Chr(0xFB06)},
	{Fstart: Chr(0xFB13), Fend: Chr(0xFB17)}, {Fstart: Chr(0xFB1F), Fend: Chr(0xFB28)}, {Fstart: Chr(0xFB2A), Fend: Chr(0xFB36)}, {Fstart: Chr(0xFB38), Fend: Chr(0xFB3C)},
	{Fstart: Chr(0xFB46), Fend: Chr(0xFBB1)}, {Fstart: Chr(0xFBD3), Fend: Chr(0xFD3D)}, {Fstart: Chr(0xFD50), Fend: Chr(0xFD8F)}, {Fstart: Chr(0xFD92), Fend: Chr(0xFDC7)},
	{Fstart: Chr(0xFDF0), Fend: Chr(0xFDFB)}, {Fstart: Chr(0xFE70), Fend: Chr(0xFE74)}, {Fstart: Chr(0xFE76), Fend: Chr(0xFEFC)}, {Fstart: Chr(0xFF21), Fend: Chr(0xFF3A)},
	{Fstart: Chr(0xFF41), Fend: Chr(0xFF5A)}, {Fstart: Chr(0xFF66), Fend: Chr(0xFFBE)}, {Fstart: Chr(0xFFC2), Fend: Chr(0xFFC7)}, {Fstart: Chr(0xFFCA), Fend: Chr(0xFFCF)},
	{Fstart: Chr(0xFFD2), Fend: Chr(0xFFD7)}, {Fstart: Chr(0xFFDA), Fend: Chr(0xFFDC)},
} /* regc_locale.c:136:21 */

var alphaCharTable = [162]Chr{
	Chr(0xAA), Chr(0xB5), Chr(0xBA), Chr(0x2EC), Chr(0x2EE), Chr(0x376), Chr(0x377), Chr(0x37F), Chr(0x386),
	Chr(0x38C), Chr(0x559), Chr(0x66E), Chr(0x66F), Chr(0x6D5), Chr(0x6E5), Chr(0x6E6), Chr(0x6EE), Chr(0x6EF),
	Chr(0x6FF), Chr(0x710), Chr(0x7B1), Chr(0x7F4), Chr(0x7F5), Chr(0x7FA), Chr(0x81A), Chr(0x824), Chr(0x828),
	Chr(0x93D), Chr(0x950), Chr(0x98F), Chr(0x990), Chr(0x9B2), Chr(0x9BD), Chr(0x9CE), Chr(0x9DC), Chr(0x9DD),
	Chr(0x9F0), Chr(0x9F1), Chr(0x9FC), Chr(0xA0F), Chr(0xA10), Chr(0xA32), Chr(0xA33), Chr(0xA35), Chr(0xA36),
	Chr(0xA38), Chr(0xA39), Chr(0xA5E), Chr(0xAB2), Chr(0xAB3), Chr(0xABD), Chr(0xAD0), Chr(0xAE0), Chr(0xAE1),
	Chr(0xAF9), Chr(0xB0F), Chr(0xB10), Chr(0xB32), Chr(0xB33), Chr(0xB3D), Chr(0xB5C), Chr(0xB5D), Chr(0xB71),
	Chr(0xB83), Chr(0xB99), Chr(0xB9A), Chr(0xB9C), Chr(0xB9E), Chr(0xB9F), Chr(0xBA3), Chr(0xBA4), Chr(0xBD0),
	Chr(0xC3D), Chr(0xC5D), Chr(0xC60), Chr(0xC61), Chr(0xC80), Chr(0xCBD), Chr(0xCDD), Chr(0xCDE), Chr(0xCE0),
	Chr(0xCE1), Chr(0xCF1), Chr(0xCF2), Chr(0xD3D), Chr(0xD4E), Chr(0xDBD), Chr(0xE32), Chr(0xE33), Chr(0xE81),
	Chr(0xE82), Chr(0xE84), Chr(0xEA5), Chr(0xEB2), Chr(0xEB3), Chr(0xEBD), Chr(0xEC6), Chr(0xF00), Chr(0x103F),
	Chr(0x1061), Chr(0x1065), Chr(0x1066), Chr(0x108E), Chr(0x10C7), Chr(0x10CD), Chr(0x1258), Chr(0x12C0), Chr(0x17D7),
	Chr(0x17DC), Chr(0x18AA), Chr(0x1AA7), Chr(0x1BAE), Chr(0x1BAF), Chr(0x1CF5), Chr(0x1CF6), Chr(0x1CFA), Chr(0x1F59),
	Chr(0x1F5B), Chr(0x1F5D), Chr(0x1FBE), Chr(0x2071), Chr(0x207F), Chr(0x2102), Chr(0x2107), Chr(0x2115), Chr(0x2124),
	Chr(0x2126), Chr(0x2128), Chr(0x214E), Chr(0x2183), Chr(0x2184), Chr(0x2CF2), Chr(0x2CF3), Chr(0x2D27), Chr(0x2D2D),
	Chr(0x2D6F), Chr(0x2E2F), Chr(0x3005), Chr(0x3006), Chr(0x303B), Chr(0x303C), Chr(0xA62A), Chr(0xA62B), Chr(0xA7D0),
	Chr(0xA7D1), Chr(0xA7D3), Chr(0xA8FB), Chr(0xA8FD), Chr(0xA8FE), Chr(0xA9CF), Chr(0xAA7A), Chr(0xAAB1), Chr(0xAAB5),
	Chr(0xAAB6), Chr(0xAAC0), Chr(0xAAC2), Chr(0xFB1D), Chr(0xFB3E), Chr(0xFB40), Chr(0xFB41), Chr(0xFB43), Chr(0xFB44),
} /* regc_locale.c:257:18 */

// Unicode: control characters.

var controlRangeTable = [9]Crange{
	{Fend: Chr(0x1F)}, {Fstart: Chr(0x7F), Fend: Chr(0x9F)}, {Fstart: Chr(0x600), Fend: Chr(0x605)}, {Fstart: Chr(0x200B), Fend: Chr(0x200F)},
	{Fstart: Chr(0x202A), Fend: Chr(0x202E)}, {Fstart: Chr(0x2060), Fend: Chr(0x2064)}, {Fstart: Chr(0x2066), Fend: Chr(0x206F)}, {Fstart: Chr(0xE000), Fend: Chr(0xF8FF)},
	{Fstart: Chr(0xFFF9), Fend: Chr(0xFFFB)},
} /* regc_locale.c:297:21 */

var controlCharTable = [9]Chr{
	Chr(0xAD), Chr(0x61C), Chr(0x6DD), Chr(0x70F), Chr(0x890), Chr(0x891), Chr(0x8E2), Chr(0x180E), Chr(0xFEFF),
} /* regc_locale.c:309:18 */

// Unicode: decimal digit characters.

var digitRangeTable = [37]Crange{
	{Fstart: Chr(0x30), Fend: Chr(0x39)}, {Fstart: Chr(0x660), Fend: Chr(0x669)}, {Fstart: Chr(0x6F0), Fend: Chr(0x6F9)}, {Fstart: Chr(0x7C0), Fend: Chr(0x7C9)},
	{Fstart: Chr(0x966), Fend: Chr(0x96F)}, {Fstart: Chr(0x9E6), Fend: Chr(0x9EF)}, {Fstart: Chr(0xA66), Fend: Chr(0xA6F)}, {Fstart: Chr(0xAE6), Fend: Chr(0xAEF)},
	{Fstart: Chr(0xB66), Fend: Chr(0xB6F)}, {Fstart: Chr(0xBE6), Fend: Chr(0xBEF)}, {Fstart: Chr(0xC66), Fend: Chr(0xC6F)}, {Fstart: Chr(0xCE6), Fend: Chr(0xCEF)},
	{Fstart: Chr(0xD66), Fend: Chr(0xD6F)}, {Fstart: Chr(0xDE6), Fend: Chr(0xDEF)}, {Fstart: Chr(0xE50), Fend: Chr(0xE59)}, {Fstart: Chr(0xED0), Fend: Chr(0xED9)},
	{Fstart: Chr(0xF20), Fend: Chr(0xF29)}, {Fstart: Chr(0x1040), Fend: Chr(0x1049)}, {Fstart: Chr(0x1090), Fend: Chr(0x1099)}, {Fstart: Chr(0x17E0), Fend: Chr(0x17E9)},
	{Fstart: Chr(0x1810), Fend: Chr(0x1819)}, {Fstart: Chr(0x1946), Fend: Chr(0x194F)}, {Fstart: Chr(0x19D0), Fend: Chr(0x19D9)}, {Fstart: Chr(0x1A80), Fend: Chr(0x1A89)},
	{Fstart: Chr(0x1A90), Fend: Chr(0x1A99)}, {Fstart: Chr(0x1B50), Fend: Chr(0x1B59)}, {Fstart: Chr(0x1BB0), Fend: Chr(0x1BB9)}, {Fstart: Chr(0x1C40), Fend: Chr(0x1C49)},
	{Fstart: Chr(0x1C50), Fend: Chr(0x1C59)}, {Fstart: Chr(0xA620), Fend: Chr(0xA629)}, {Fstart: Chr(0xA8D0), Fend: Chr(0xA8D9)}, {Fstart: Chr(0xA900), Fend: Chr(0xA909)},
	{Fstart: Chr(0xA9D0), Fend: Chr(0xA9D9)}, {Fstart: Chr(0xA9F0), Fend: Chr(0xA9F9)}, {Fstart: Chr(0xAA50), Fend: Chr(0xAA59)}, {Fstart: Chr(0xABF0), Fend: Chr(0xABF9)},
	{Fstart: Chr(0xFF10), Fend: Chr(0xFF19)},
} /* regc_locale.c:322:21 */

// no singletons of digit characters.

// Unicode: punctuation characters.

var punctRangeTable = [55]Crange{
	{Fstart: Chr(0x21), Fend: Chr(0x23)}, {Fstart: Chr(0x25), Fend: Chr(0x2A)}, {Fstart: Chr(0x2C), Fend: Chr(0x2F)}, {Fstart: Chr(0x5B), Fend: Chr(0x5D)},
	{Fstart: Chr(0x55A), Fend: Chr(0x55F)}, {Fstart: Chr(0x61D), Fend: Chr(0x61F)}, {Fstart: Chr(0x66A), Fend: Chr(0x66D)}, {Fstart: Chr(0x700), Fend: Chr(0x70D)},
	{Fstart: Chr(0x7F7), Fend: Chr(0x7F9)}, {Fstart: Chr(0x830), Fend: Chr(0x83E)}, {Fstart: Chr(0xF04), Fend: Chr(0xF12)}, {Fstart: Chr(0xF3A), Fend: Chr(0xF3D)},
	{Fstart: Chr(0xFD0), Fend: Chr(0xFD4)}, {Fstart: Chr(0x104A), Fend: Chr(0x104F)}, {Fstart: Chr(0x1360), Fend: Chr(0x1368)}, {Fstart: Chr(0x16EB), Fend: Chr(0x16ED)},
	{Fstart: Chr(0x17D4), Fend: Chr(0x17D6)}, {Fstart: Chr(0x17D8), Fend: Chr(0x17DA)}, {Fstart: Chr(0x1800), Fend: Chr(0x180A)}, {Fstart: Chr(0x1AA0), Fend: Chr(0x1AA6)},
	{Fstart: Chr(0x1AA8), Fend: Chr(0x1AAD)}, {Fstart: Chr(0x1B5A), Fend: Chr(0x1B60)}, {Fstart: Chr(0x1BFC), Fend: Chr(0x1BFF)}, {Fstart: Chr(0x1C3B), Fend: Chr(0x1C3F)},
	{Fstart: Chr(0x1CC0), Fend: Chr(0x1CC7)}, {Fstart: Chr(0x2010), Fend: Chr(0x2027)}, {Fstart: Chr(0x2030), Fend: Chr(0x2043)}, {Fstart: Chr(0x2045), Fend: Chr(0x2051)},
	{Fstart: Chr(0x2053), Fend: Chr(0x205E)}, {Fstart: Chr(0x2308), Fend: Chr(0x230B)}, {Fstart: Chr(0x2768), Fend: Chr(0x2775)}, {Fstart: Chr(0x27E6), Fend: Chr(0x27EF)},
	{Fstart: Chr(0x2983), Fend: Chr(0x2998)}, {Fstart: Chr(0x29D8), Fend: Chr(0x29DB)}, {Fstart: Chr(0x2CF9), Fend: Chr(0x2CFC)}, {Fstart: Chr(0x2E00), Fend: Chr(0x2E2E)},
	{Fstart: Chr(0x2E30), Fend: Chr(0x2E4F)}, {Fstart: Chr(0x2E52), Fend: Chr(0x2E5D)}, {Fstart: Chr(0x3001), Fend: Chr(0x3003)}, {Fstart: Chr(0x3008), Fend: Chr(0x3011)},
	{Fstart: Chr(0x3014), Fend: Chr(0x301F)}, {Fstart: Chr(0xA60D), Fend: Chr(0xA60F)}, {Fstart: Chr(0xA6F2), Fend: Chr(0xA6F7)}, {Fstart: Chr(0xA874), Fend: Chr(0xA877)},
	{Fstart: Chr(0xA8F8), Fend: Chr(0xA8FA)}, {Fstart: Chr(0xA9C1), Fend: Chr(0xA9CD)}, {Fstart: Chr(0xAA5C), Fend: Chr(0xAA5F)}, {Fstart: Chr(0xFE10), Fend: Chr(0xFE19)},
	{Fstart: Chr(0xFE30), Fend: Chr(0xFE52)}, {Fstart: Chr(0xFE54), Fend: Chr(0xFE61)}, {Fstart: Chr(0xFF01), Fend: Chr(0xFF03)}, {Fstart: Chr(0xFF05), Fend: Chr(0xFF0A)},
	{Fstart: Chr(0xFF0C), Fend: Chr(0xFF0F)}, {Fstart: Chr(0xFF3B), Fend: Chr(0xFF3D)}, {Fstart: Chr(0xFF5F), Fend: Chr(0xFF65)},
} /* regc_locale.c:354:21 */

var punctCharTable = [110]Chr{
	Chr(0x3A), Chr(0x3B), Chr(0x3F), Chr(0x40), Chr(0x5F), Chr(0x7B), Chr(0x7D), Chr(0xA1), Chr(0xA7),
	Chr(0xAB), Chr(0xB6), Chr(0xB7), Chr(0xBB), Chr(0xBF), Chr(0x37E), Chr(0x387), Chr(0x589), Chr(0x58A),
	Chr(0x5BE), Chr(0x5C0), Chr(0x5C3), Chr(0x5C6), Chr(0x5F3), Chr(0x5F4), Chr(0x609), Chr(0x60A), Chr(0x60C),
	Chr(0x60D), Chr(0x61B), Chr(0x6D4), Chr(0x85E), Chr(0x964), Chr(0x965), Chr(0x970), Chr(0x9FD), Chr(0xA76),
	Chr(0xAF0), Chr(0xC77), Chr(0xC84), Chr(0xDF4), Chr(0xE4F), Chr(0xE5A), Chr(0xE5B), Chr(0xF14), Chr(0xF85),
	Chr(0xFD9), Chr(0xFDA), Chr(0x10FB), Chr(0x1400), Chr(0x166E), Chr(0x169B), Chr(0x169C), Chr(0x1735), Chr(0x1736),
	Chr(0x1944), Chr(0x1945), Chr(0x1A1E), Chr(0x1A1F), Chr(0x1B7D), Chr(0x1B7E), Chr(0x1C7E), Chr(0x1C7F), Chr(0x1CD3),
	Chr(0x207D), Chr(0x207E), Chr(0x208D), Chr(0x208E), Chr(0x2329), Chr(0x232A), Chr(0x27C5), Chr(0x27C6), Chr(0x29FC),
	Chr(0x29FD), Chr(0x2CFE), Chr(0x2CFF), Chr(0x2D70), Chr(0x3030), Chr(0x303D), Chr(0x30A0), Chr(0x30FB), Chr(0xA4FE),
	Chr(0xA4FF), Chr(0xA673), Chr(0xA67E), Chr(0xA8CE), Chr(0xA8CF), Chr(0xA8FC), Chr(0xA92E), Chr(0xA92F), Chr(0xA95F),
	Chr(0xA9DE), Chr(0xA9DF), Chr(0xAADE), Chr(0xAADF), Chr(0xAAF0), Chr(0xAAF1), Chr(0xABEB), Chr(0xFD3E), Chr(0xFD3F),
	Chr(0xFE63), Chr(0xFE68), Chr(0xFE6A), Chr(0xFE6B), Chr(0xFF1A), Chr(0xFF1B), Chr(0xFF1F), Chr(0xFF20), Chr(0xFF3F),
	Chr(0xFF5B), Chr(0xFF5D),
} /* regc_locale.c:382:18 */

// Unicode: white space characters.

var spaceRangeTable = [2]Crange{
	{Fstart: Chr(0x9), Fend: Chr(0xD)}, {Fstart: Chr(0x2000), Fend: Chr(0x200B)},
} /* regc_locale.c:411:21 */

var spaceCharTable = [12]Chr{
	Chr(0x20), Chr(0x85), Chr(0xA0), Chr(0x1680), Chr(0x180E), Chr(0x2028), Chr(0x2029), Chr(0x202F), Chr(0x205F),
	Chr(0x2060), Chr(0x3000), Chr(0xFEFF),
} /* regc_locale.c:417:18 */

// Unicode: lowercase characters.

var lowerRangeTable = [52]Crange{
	{Fstart: Chr(0x61), Fend: Chr(0x7A)}, {Fstart: Chr(0xDF), Fend: Chr(0xF6)}, {Fstart: Chr(0xF8), Fend: Chr(0xFF)}, {Fstart: Chr(0x17E), Fend: Chr(0x180)},
	{Fstart: Chr(0x199), Fend: Chr(0x19B)}, {Fstart: Chr(0x1BD), Fend: Chr(0x1BF)}, {Fstart: Chr(0x233), Fend: Chr(0x239)}, {Fstart: Chr(0x24F), Fend: Chr(0x293)},
	{Fstart: Chr(0x295), Fend: Chr(0x2AF)}, {Fstart: Chr(0x37B), Fend: Chr(0x37D)}, {Fstart: Chr(0x3AC), Fend: Chr(0x3CE)}, {Fstart: Chr(0x3D5), Fend: Chr(0x3D7)},
	{Fstart: Chr(0x3EF), Fend: Chr(0x3F3)}, {Fstart: Chr(0x430), Fend: Chr(0x45F)}, {Fstart: Chr(0x560), Fend: Chr(0x588)}, {Fstart: Chr(0x10D0), Fend: Chr(0x10FA)},
	{Fstart: Chr(0x10FD), Fend: Chr(0x10FF)}, {Fstart: Chr(0x13F8), Fend: Chr(0x13FD)}, {Fstart: Chr(0x1C80), Fend: Chr(0x1C88)}, {Fstart: Chr(0x1D00), Fend: Chr(0x1D2B)},
	{Fstart: Chr(0x1D6B), Fend: Chr(0x1D77)}, {Fstart: Chr(0x1D79), Fend: Chr(0x1D9A)}, {Fstart: Chr(0x1E95), Fend: Chr(0x1E9D)}, {Fstart: Chr(0x1EFF), Fend: Chr(0x1F07)},
	{Fstart: Chr(0x1F10), Fend: Chr(0x1F15)}, {Fstart: Chr(0x1F20), Fend: Chr(0x1F27)}, {Fstart: Chr(0x1F30), Fend: Chr(0x1F37)}, {Fstart: Chr(0x1F40), Fend: Chr(0x1F45)},
	{Fstart: Chr(0x1F50), Fend: Chr(0x1F57)}, {Fstart: Chr(0x1F60), Fend: Chr(0x1F67)}, {Fstart: Chr(0x1F70), Fend: Chr(0x1F7D)}, {Fstart: Chr(0x1F80), Fend: Chr(0x1F87)},
	{Fstart: Chr(0x1F90), Fend: Chr(0x1F97)}, {Fstart: Chr(0x1FA0), Fend: Chr(0x1FA7)}, {Fstart: Chr(0x1FB0), Fend: Chr(0x1FB4)}, {Fstart: Chr(0x1FC2), Fend: Chr(0x1FC4)},
	{Fstart: Chr(0x1FD0), Fend: Chr(0x1FD3)}, {Fstart: Chr(0x1FE0), Fend: Chr(0x1FE7)}, {Fstart: Chr(0x1FF2), Fend: Chr(0x1FF4)}, {Fstart: Chr(0x2146), Fend: Chr(0x2149)},
	{Fstart: Chr(0x2C30), Fend: Chr(0x2C5F)}, {Fstart: Chr(0x2C76), Fend: Chr(0x2C7B)}, {Fstart: Chr(0x2D00), Fend: Chr(0x2D25)}, {Fstart: Chr(0xA72F), Fend: Chr(0xA731)},
	{Fstart: Chr(0xA771), Fend: Chr(0xA778)}, {Fstart: Chr(0xA793), Fend: Chr(0xA795)}, {Fstart: Chr(0xAB30), Fend: Chr(0xAB5A)}, {Fstart: Chr(0xAB60), Fend: Chr(0xAB68)},
	{Fstart: Chr(0xAB70), Fend: Chr(0xABBF)}, {Fstart: Chr(0xFB00), Fend: Chr(0xFB06)}, {Fstart: Chr(0xFB13), Fend: Chr(0xFB17)}, {Fstart: Chr(0xFF41), Fend: Chr(0xFF5A)},
} /* regc_locale.c:428:21 */

var lowerCharTable = [585]Chr{
	Chr(0xB5), Chr(0x101), Chr(0x103), Chr(0x105), Chr(0x107), Chr(0x109), Chr(0x10B), Chr(0x10D), Chr(0x10F),
	Chr(0x111), Chr(0x113), Chr(0x115), Chr(0x117), Chr(0x119), Chr(0x11B), Chr(0x11D), Chr(0x11F), Chr(0x121),
	Chr(0x123), Chr(0x125), Chr(0x127), Chr(0x129), Chr(0x12B), Chr(0x12D), Chr(0x12F), Chr(0x131), Chr(0x133),
	Chr(0x135), Chr(0x137), Chr(0x138), Chr(0x13A), Chr(0x13C), Chr(0x13E), Chr(0x140), Chr(0x142), Chr(0x144),
	Chr(0x146), Chr(0x148), Chr(0x149), Chr(0x14B), Chr(0x14D), Chr(0x14F), Chr(0x151), Chr(0x153), Chr(0x155),
	Chr(0x157), Chr(0x159), Chr(0x15B), Chr(0x15D), Chr(0x15F), Chr(0x161), Chr(0x163), Chr(0x165), Chr(0x167),
	Chr(0x169), Chr(0x16B), Chr(0x16D), Chr(0x16F), Chr(0x171), Chr(0x173), Chr(0x175), Chr(0x177), Chr(0x17A),
	Chr(0x17C), Chr(0x183), Chr(0x185), Chr(0x188), Chr(0x18C), Chr(0x18D), Chr(0x192), Chr(0x195), Chr(0x19E),
	Chr(0x1A1), Chr(0x1A3), Chr(0x1A5), Chr(0x1A8), Chr(0x1AA), Chr(0x1AB), Chr(0x1AD), Chr(0x1B0), Chr(0x1B4),
	Chr(0x1B6), Chr(0x1B9), Chr(0x1BA), Chr(0x1C6), Chr(0x1C9), Chr(0x1CC), Chr(0x1CE), Chr(0x1D0), Chr(0x1D2),
	Chr(0x1D4), Chr(0x1D6), Chr(0x1D8), Chr(0x1DA), Chr(0x1DC), Chr(0x1DD), Chr(0x1DF), Chr(0x1E1), Chr(0x1E3),
	Chr(0x1E5), Chr(0x1E7), Chr(0x1E9), Chr(0x1EB), Chr(0x1ED), Chr(0x1EF), Chr(0x1F0), Chr(0x1F3), Chr(0x1F5),
	Chr(0x1F9), Chr(0x1FB), Chr(0x1FD), Chr(0x1FF), Chr(0x201), Chr(0x203), Chr(0x205), Chr(0x207), Chr(0x209),
	Chr(0x20B), Chr(0x20D), Chr(0x20F), Chr(0x211), Chr(0x213), Chr(0x215), Chr(0x217), Chr(0x219), Chr(0x21B),
	Chr(0x21D), Chr(0x21F), Chr(0x221), Chr(0x223), Chr(0x225), Chr(0x227), Chr(0x229), Chr(0x22B), Chr(0x22D),
	Chr(0x22F), Chr(0x231), Chr(0x23C), Chr(0x23F), Chr(0x240), Chr(0x242), Chr(0x247), Chr(0x249), Chr(0x24B),
	Chr(0x24D), Chr(0x371), Chr(0x373), Chr(0x377), Chr(0x390), Chr(0x3D0), Chr(0x3D1), Chr(0x3D9), Chr(0x3DB),
	Chr(0x3DD), Chr(0x3DF), Chr(0x3E1), Chr(0x3E3), Chr(0x3E5), Chr(0x3E7), Chr(0x3E9), Chr(0x3EB), Chr(0x3ED),
	Chr(0x3F5), Chr(0x3F8), Chr(0x3FB), Chr(0x3FC), Chr(0x461), Chr(0x463), Chr(0x465), Chr(0x467), Chr(0x469),
	Chr(0x46B), Chr(0x46D), Chr(0x46F), Chr(0x471), Chr(0x473), Chr(0x475), Chr(0x477), Chr(0x479), Chr(0x47B),
	Chr(0x47D), Chr(0x47F), Chr(0x481), Chr(0x48B), Chr(0x48D), Chr(0x48F), Chr(0x491), Chr(0x493), Chr(0x495),
	Chr(0x497), Chr(0x499), Chr(0x49B), Chr(0x49D), Chr(0x49F), Chr(0x4A1), Chr(0x4A3), Chr(0x4A5), Chr(0x4A7),
	Chr(0x4A9), Chr(0x4AB), Chr(0x4AD), Chr(0x4AF), Chr(0x4B1), Chr(0x4B3), Chr(0x4B5), Chr(0x4B7), Chr(0x4B9),
	Chr(0x4BB), Chr(0x4BD), Chr(0x4BF), Chr(0x4C2), Chr(0x4C4), Chr(0x4C6), Chr(0x4C8), Chr(0x4CA), Chr(0x4CC),
	Chr(0x4CE), Chr(0x4CF), Chr(0x4D1), Chr(0x4D3), Chr(0x4D5), Chr(0x4D7), Chr(0x4D9), Chr(0x4DB), Chr(0x4DD),
	Chr(0x4DF), Chr(0x4E1), Chr(0x4E3), Chr(0x4E5), Chr(0x4E7), Chr(0x4E9), Chr(0x4EB), Chr(0x4ED), Chr(0x4EF),
	Chr(0x4F1), Chr(0x4F3), Chr(0x4F5), Chr(0x4F7), Chr(0x4F9), Chr(0x4FB), Chr(0x4FD), Chr(0x4FF), Chr(0x501),
	Chr(0x503), Chr(0x505), Chr(0x507), Chr(0x509), Chr(0x50B), Chr(0x50D), Chr(0x50F), Chr(0x511), Chr(0x513),
	Chr(0x515), Chr(0x517), Chr(0x519), Chr(0x51B), Chr(0x51D), Chr(0x51F), Chr(0x521), Chr(0x523), Chr(0x525),
	Chr(0x527), Chr(0x529), Chr(0x52B), Chr(0x52D), Chr(0x52F), Chr(0x1E01), Chr(0x1E03), Chr(0x1E05), Chr(0x1E07),
	Chr(0x1E09), Chr(0x1E0B), Chr(0x1E0D), Chr(0x1E0F), Chr(0x1E11), Chr(0x1E13), Chr(0x1E15), Chr(0x1E17), Chr(0x1E19),
	Chr(0x1E1B), Chr(0x1E1D), Chr(0x1E1F), Chr(0x1E21), Chr(0x1E23), Chr(0x1E25), Chr(0x1E27), Chr(0x1E29), Chr(0x1E2B),
	Chr(0x1E2D), Chr(0x1E2F), Chr(0x1E31), Chr(0x1E33), Chr(0x1E35), Chr(0x1E37), Chr(0x1E39), Chr(0x1E3B), Chr(0x1E3D),
	Chr(0x1E3F), Chr(0x1E41), Chr(0x1E43), Chr(0x1E45), Chr(0x1E47), Chr(0x1E49), Chr(0x1E4B), Chr(0x1E4D), Chr(0x1E4F),
	Chr(0x1E51), Chr(0x1E53), Chr(0x1E55), Chr(0x1E57), Chr(0x1E59), Chr(0x1E5B), Chr(0x1E5D), Chr(0x1E5F), Chr(0x1E61),
	Chr(0x1E63), Chr(0x1E65), Chr(0x1E67), Chr(0x1E69), Chr(0x1E6B), Chr(0x1E6D), Chr(0x1E6F), Chr(0x1E71), Chr(0x1E73),
	Chr(0x1E75), Chr(0x1E77), Chr(0x1E79), Chr(0x1E7B), Chr(0x1E7D), Chr(0x1E7F), Chr(0x1E81), Chr(0x1E83), Chr(0x1E85),
	Chr(0x1E87), Chr(0x1E89), Chr(0x1E8B), Chr(0x1E8D), Chr(0x1E8F), Chr(0x1E91), Chr(0x1E93), Chr(0x1E9F), Chr(0x1EA1),
	Chr(0x1EA3), Chr(0x1EA5), Chr(0x1EA7), Chr(0x1EA9), Chr(0x1EAB), Chr(0x1EAD), Chr(0x1EAF), Chr(0x1EB1), Chr(0x1EB3),
	Chr(0x1EB5), Chr(0x1EB7), Chr(0x1EB9), Chr(0x1EBB), Chr(0x1EBD), Chr(0x1EBF), Chr(0x1EC1), Chr(0x1EC3), Chr(0x1EC5),
	Chr(0x1EC7), Chr(0x1EC9), Chr(0x1ECB), Chr(0x1ECD), Chr(0x1ECF), Chr(0x1ED1), Chr(0x1ED3), Chr(0x1ED5), Chr(0x1ED7),
	Chr(0x1ED9), Chr(0x1EDB), Chr(0x1EDD), Chr(0x1EDF), Chr(0x1EE1), Chr(0x1EE3), Chr(0x1EE5), Chr(0x1EE7), Chr(0x1EE9),
	Chr(0x1EEB), Chr(0x1EED), Chr(0x1EEF), Chr(0x1EF1), Chr(0x1EF3), Chr(0x1EF5), Chr(0x1EF7), Chr(0x1EF9), Chr(0x1EFB),
	Chr(0x1EFD), Chr(0x1FB6), Chr(0x1FB7), Chr(0x1FBE), Chr(0x1FC6), Chr(0x1FC7), Chr(0x1FD6), Chr(0x1FD7), Chr(0x1FF6),
	Chr(0x1FF7), Chr(0x210A), Chr(0x210E), Chr(0x210F), Chr(0x2113), Chr(0x212F), Chr(0x2134), Chr(0x2139), Chr(0x213C),
	Chr(0x213D), Chr(0x214E), Chr(0x2184), Chr(0x2C61), Chr(0x2C65), Chr(0x2C66), Chr(0x2C68), Chr(0x2C6A), Chr(0x2C6C),
	Chr(0x2C71), Chr(0x2C73), Chr(0x2C74), Chr(0x2C81), Chr(0x2C83), Chr(0x2C85), Chr(0x2C87), Chr(0x2C89), Chr(0x2C8B),
	Chr(0x2C8D), Chr(0x2C8F), Chr(0x2C91), Chr(0x2C93), Chr(0x2C95), Chr(0x2C97), Chr(0x2C99), Chr(0x2C9B), Chr(0x2C9D),
	Chr(0x2C9F), Chr(0x2CA1), Chr(0x2CA3), Chr(0x2CA5), Chr(0x2CA7), Chr(0x2CA9), Chr(0x2CAB), Chr(0x2CAD), Chr(0x2CAF),
	Chr(0x2CB1), Chr(0x2CB3), Chr(0x2CB5), Chr(0x2CB7), Chr(0x2CB9), Chr(0x2CBB), Chr(0x2CBD), Chr(0x2CBF), Chr(0x2CC1),
	Chr(0x2CC3), Chr(0x2CC5), Chr(0x2CC7), Chr(0x2CC9), Chr(0x2CCB), Chr(0x2CCD), Chr(0x2CCF), Chr(0x2CD1), Chr(0x2CD3),
	Chr(0x2CD5), Chr(0x2CD7), Chr(0x2CD9), Chr(0x2CDB), Chr(0x2CDD), Chr(0x2CDF), Chr(0x2CE1), Chr(0x2CE3), Chr(0x2CE4),
	Chr(0x2CEC), Chr(0x2CEE), Chr(0x2CF3), Chr(0x2D27), Chr(0x2D2D), Chr(0xA641), Chr(0xA643), Chr(0xA645), Chr(0xA647),
	Chr(0xA649), Chr(0xA64B), Chr(0xA64D), Chr(0xA64F), Chr(0xA651), Chr(0xA653), Chr(0xA655), Chr(0xA657), Chr(0xA659),
	Chr(0xA65B), Chr(0xA65D), Chr(0xA65F), Chr(0xA661), Chr(0xA663), Chr(0xA665), Chr(0xA667), Chr(0xA669), Chr(0xA66B),
	Chr(0xA66D), Chr(0xA681), Chr(0xA683), Chr(0xA685), Chr(0xA687), Chr(0xA689), Chr(0xA68B), Chr(0xA68D), Chr(0xA68F),
	Chr(0xA691), Chr(0xA693), Chr(0xA695), Chr(0xA697), Chr(0xA699), Chr(0xA69B), Chr(0xA723), Chr(0xA725), Chr(0xA727),
	Chr(0xA729), Chr(0xA72B), Chr(0xA72D), Chr(0xA733), Chr(0xA735), Chr(0xA737), Chr(0xA739), Chr(0xA73B), Chr(0xA73D),
	Chr(0xA73F), Chr(0xA741), Chr(0xA743), Chr(0xA745), Chr(0xA747), Chr(0xA749), Chr(0xA74B), Chr(0xA74D), Chr(0xA74F),
	Chr(0xA751), Chr(0xA753), Chr(0xA755), Chr(0xA757), Chr(0xA759), Chr(0xA75B), Chr(0xA75D), Chr(0xA75F), Chr(0xA761),
	Chr(0xA763), Chr(0xA765), Chr(0xA767), Chr(0xA769), Chr(0xA76B), Chr(0xA76D), Chr(0xA76F), Chr(0xA77A), Chr(0xA77C),
	Chr(0xA77F), Chr(0xA781), Chr(0xA783), Chr(0xA785), Chr(0xA787), Chr(0xA78C), Chr(0xA78E), Chr(0xA791), Chr(0xA797),
	Chr(0xA799), Chr(0xA79B), Chr(0xA79D), Chr(0xA79F), Chr(0xA7A1), Chr(0xA7A3), Chr(0xA7A5), Chr(0xA7A7), Chr(0xA7A9),
	Chr(0xA7AF), Chr(0xA7B5), Chr(0xA7B7), Chr(0xA7B9), Chr(0xA7BB), Chr(0xA7BD), Chr(0xA7BF), Chr(0xA7C1), Chr(0xA7C3),
	Chr(0xA7C8), Chr(0xA7CA), Chr(0xA7D1), Chr(0xA7D3), Chr(0xA7D5), Chr(0xA7D7), Chr(0xA7D9), Chr(0xA7F6), Chr(0xA7FA),
} /* regc_locale.c:458:18 */

// Unicode: uppercase characters.

var upperRangeTable = [43]Crange{
	{Fstart: Chr(0x41), Fend: Chr(0x5A)}, {Fstart: Chr(0xC0), Fend: Chr(0xD6)}, {Fstart: Chr(0xD8), Fend: Chr(0xDE)}, {Fstart: Chr(0x189), Fend: Chr(0x18B)},
	{Fstart: Chr(0x18E), Fend: Chr(0x191)}, {Fstart: Chr(0x196), Fend: Chr(0x198)}, {Fstart: Chr(0x1B1), Fend: Chr(0x1B3)}, {Fstart: Chr(0x1F6), Fend: Chr(0x1F8)},
	{Fstart: Chr(0x243), Fend: Chr(0x246)}, {Fstart: Chr(0x388), Fend: Chr(0x38A)}, {Fstart: Chr(0x391), Fend: Chr(0x3A1)}, {Fstart: Chr(0x3A3), Fend: Chr(0x3AB)},
	{Fstart: Chr(0x3D2), Fend: Chr(0x3D4)}, {Fstart: Chr(0x3FD), Fend: Chr(0x42F)}, {Fstart: Chr(0x531), Fend: Chr(0x556)}, {Fstart: Chr(0x10A0), Fend: Chr(0x10C5)},
	{Fstart: Chr(0x13A0), Fend: Chr(0x13F5)}, {Fstart: Chr(0x1C90), Fend: Chr(0x1CBA)}, {Fstart: Chr(0x1CBD), Fend: Chr(0x1CBF)}, {Fstart: Chr(0x1F08), Fend: Chr(0x1F0F)},
	{Fstart: Chr(0x1F18), Fend: Chr(0x1F1D)}, {Fstart: Chr(0x1F28), Fend: Chr(0x1F2F)}, {Fstart: Chr(0x1F38), Fend: Chr(0x1F3F)}, {Fstart: Chr(0x1F48), Fend: Chr(0x1F4D)},
	{Fstart: Chr(0x1F68), Fend: Chr(0x1F6F)}, {Fstart: Chr(0x1FB8), Fend: Chr(0x1FBB)}, {Fstart: Chr(0x1FC8), Fend: Chr(0x1FCB)}, {Fstart: Chr(0x1FD8), Fend: Chr(0x1FDB)},
	{Fstart: Chr(0x1FE8), Fend: Chr(0x1FEC)}, {Fstart: Chr(0x1FF8), Fend: Chr(0x1FFB)}, {Fstart: Chr(0x210B), Fend: Chr(0x210D)}, {Fstart: Chr(0x2110), Fend: Chr(0x2112)},
	{Fstart: Chr(0x2119), Fend: Chr(0x211D)}, {Fstart: Chr(0x212A), Fend: Chr(0x212D)}, {Fstart: Chr(0x2130), Fend: Chr(0x2133)}, {Fstart: Chr(0x2C00), Fend: Chr(0x2C2F)},
	{Fstart: Chr(0x2C62), Fend: Chr(0x2C64)}, {Fstart: Chr(0x2C6D), Fend: Chr(0x2C70)}, {Fstart: Chr(0x2C7E), Fend: Chr(0x2C80)}, {Fstart: Chr(0xA7AA), Fend: Chr(0xA7AE)},
	{Fstart: Chr(0xA7B0), Fend: Chr(0xA7B4)}, {Fstart: Chr(0xA7C4), Fend: Chr(0xA7C7)}, {Fstart: Chr(0xFF21), Fend: Chr(0xFF3A)},
} /* regc_locale.c:535:21 */

var upperCharTable = [578]Chr{
	Chr(0x100), Chr(0x102), Chr(0x104), Chr(0x106), Chr(0x108), Chr(0x10A), Chr(0x10C), Chr(0x10E), Chr(0x110),
	Chr(0x112), Chr(0x114), Chr(0x116), Chr(0x118), Chr(0x11A), Chr(0x11C), Chr(0x11E), Chr(0x120), Chr(0x122),
	Chr(0x124), Chr(0x126), Chr(0x128), Chr(0x12A), Chr(0x12C), Chr(0x12E), Chr(0x130), Chr(0x132), Chr(0x134),
	Chr(0x136), Chr(0x139), Chr(0x13B), Chr(0x13D), Chr(0x13F), Chr(0x141), Chr(0x143), Chr(0x145), Chr(0x147),
	Chr(0x14A), Chr(0x14C), Chr(0x14E), Chr(0x150), Chr(0x152), Chr(0x154), Chr(0x156), Chr(0x158), Chr(0x15A),
	Chr(0x15C), Chr(0x15E), Chr(0x160), Chr(0x162), Chr(0x164), Chr(0x166), Chr(0x168), Chr(0x16A), Chr(0x16C),
	Chr(0x16E), Chr(0x170), Chr(0x172), Chr(0x174), Chr(0x176), Chr(0x178), Chr(0x179), Chr(0x17B), Chr(0x17D),
	Chr(0x181), Chr(0x182), Chr(0x184), Chr(0x186), Chr(0x187), Chr(0x193), Chr(0x194), Chr(0x19C), Chr(0x19D),
	Chr(0x19F), Chr(0x1A0), Chr(0x1A2), Chr(0x1A4), Chr(0x1A6), Chr(0x1A7), Chr(0x1A9), Chr(0x1AC), Chr(0x1AE),
	Chr(0x1AF), Chr(0x1B5), Chr(0x1B7), Chr(0x1B8), Chr(0x1BC), Chr(0x1C4), Chr(0x1C7), Chr(0x1CA), Chr(0x1CD),
	Chr(0x1CF), Chr(0x1D1), Chr(0x1D3), Chr(0x1D5), Chr(0x1D7), Chr(0x1D9), Chr(0x1DB), Chr(0x1DE), Chr(0x1E0),
	Chr(0x1E2), Chr(0x1E4), Chr(0x1E6), Chr(0x1E8), Chr(0x1EA), Chr(0x1EC), Chr(0x1EE), Chr(0x1F1), Chr(0x1F4),
	Chr(0x1FA), Chr(0x1FC), Chr(0x1FE), Chr(0x200), Chr(0x202), Chr(0x204), Chr(0x206), Chr(0x208), Chr(0x20A),
	Chr(0x20C), Chr(0x20E), Chr(0x210), Chr(0x212), Chr(0x214), Chr(0x216), Chr(0x218), Chr(0x21A), Chr(0x21C),
	Chr(0x21E), Chr(0x220), Chr(0x222), Chr(0x224), Chr(0x226), Chr(0x228), Chr(0x22A), Chr(0x22C), Chr(0x22E),
	Chr(0x230), Chr(0x232), Chr(0x23A), Chr(0x23B), Chr(0x23D), Chr(0x23E), Chr(0x241), Chr(0x248), Chr(0x24A),
	Chr(0x24C), Chr(0x24E), Chr(0x370), Chr(0x372), Chr(0x376), Chr(0x37F), Chr(0x386), Chr(0x38C), Chr(0x38E),
	Chr(0x38F), Chr(0x3CF), Chr(0x3D8), Chr(0x3DA), Chr(0x3DC), Chr(0x3DE), Chr(0x3E0), Chr(0x3E2), Chr(0x3E4),
	Chr(0x3E6), Chr(0x3E8), Chr(0x3EA), Chr(0x3EC), Chr(0x3EE), Chr(0x3F4), Chr(0x3F7), Chr(0x3F9), Chr(0x3FA),
	Chr(0x460), Chr(0x462), Chr(0x464), Chr(0x466), Chr(0x468), Chr(0x46A), Chr(0x46C), Chr(0x46E), Chr(0x470),
	Chr(0x472), Chr(0x474), Chr(0x476), Chr(0x478), Chr(0x47A), Chr(0x47C), Chr(0x47E), Chr(0x480), Chr(0x48A),
	Chr(0x48C), Chr(0x48E), Chr(0x490), Chr(0x492), Chr(0x494), Chr(0x496), Chr(0x498), Chr(0x49A), Chr(0x49C),
	Chr(0x49E), Chr(0x4A0), Chr(0x4A2), Chr(0x4A4), Chr(0x4A6), Chr(0x4A8), Chr(0x4AA), Chr(0x4AC), Chr(0x4AE),
	Chr(0x4B0), Chr(0x4B2), Chr(0x4B4), Chr(0x4B6), Chr(0x4B8), Chr(0x4BA), Chr(0x4BC), Chr(0x4BE), Chr(0x4C0),
	Chr(0x4C1), Chr(0x4C3), Chr(0x4C5), Chr(0x4C7), Chr(0x4C9), Chr(0x4CB), Chr(0x4CD), Chr(0x4D0), Chr(0x4D2),
	Chr(0x4D4), Chr(0x4D6), Chr(0x4D8), Chr(0x4DA), Chr(0x4DC), Chr(0x4DE), Chr(0x4E0), Chr(0x4E2), Chr(0x4E4),
	Chr(0x4E6), Chr(0x4E8), Chr(0x4EA), Chr(0x4EC), Chr(0x4EE), Chr(0x4F0), Chr(0x4F2), Chr(0x4F4), Chr(0x4F6),
	Chr(0x4F8), Chr(0x4FA), Chr(0x4FC), Chr(0x4FE), Chr(0x500), Chr(0x502), Chr(0x504), Chr(0x506), Chr(0x508),
	Chr(0x50A), Chr(0x50C), Chr(0x50E), Chr(0x510), Chr(0x512), Chr(0x514), Chr(0x516), Chr(0x518), Chr(0x51A),
	Chr(0x51C), Chr(0x51E), Chr(0x520), Chr(0x522), Chr(0x524), Chr(0x526), Chr(0x528), Chr(0x52A), Chr(0x52C),
	Chr(0x52E), Chr(0x10C7), Chr(0x10CD), Chr(0x1E00), Chr(0x1E02), Chr(0x1E04), Chr(0x1E06), Chr(0x1E08), Chr(0x1E0A),
	Chr(0x1E0C), Chr(0x1E0E), Chr(0x1E10), Chr(0x1E12), Chr(0x1E14), Chr(0x1E16), Chr(0x1E18), Chr(0x1E1A), Chr(0x1E1C),
	Chr(0x1E1E), Chr(0x1E20), Chr(0x1E22), Chr(0x1E24), Chr(0x1E26), Chr(0x1E28), Chr(0x1E2A), Chr(0x1E2C), Chr(0x1E2E),
	Chr(0x1E30), Chr(0x1E32), Chr(0x1E34), Chr(0x1E36), Chr(0x1E38), Chr(0x1E3A), Chr(0x1E3C), Chr(0x1E3E), Chr(0x1E40),
	Chr(0x1E42), Chr(0x1E44), Chr(0x1E46), Chr(0x1E48), Chr(0x1E4A), Chr(0x1E4C), Chr(0x1E4E), Chr(0x1E50), Chr(0x1E52),
	Chr(0x1E54), Chr(0x1E56), Chr(0x1E58), Chr(0x1E5A), Chr(0x1E5C), Chr(0x1E5E), Chr(0x1E60), Chr(0x1E62), Chr(0x1E64),
	Chr(0x1E66), Chr(0x1E68), Chr(0x1E6A), Chr(0x1E6C), Chr(0x1E6E), Chr(0x1E70), Chr(0x1E72), Chr(0x1E74), Chr(0x1E76),
	Chr(0x1E78), Chr(0x1E7A), Chr(0x1E7C), Chr(0x1E7E), Chr(0x1E80), Chr(0x1E82), Chr(0x1E84), Chr(0x1E86), Chr(0x1E88),
	Chr(0x1E8A), Chr(0x1E8C), Chr(0x1E8E), Chr(0x1E90), Chr(0x1E92), Chr(0x1E94), Chr(0x1E9E), Chr(0x1EA0), Chr(0x1EA2),
	Chr(0x1EA4), Chr(0x1EA6), Chr(0x1EA8), Chr(0x1EAA), Chr(0x1EAC), Chr(0x1EAE), Chr(0x1EB0), Chr(0x1EB2), Chr(0x1EB4),
	Chr(0x1EB6), Chr(0x1EB8), Chr(0x1EBA), Chr(0x1EBC), Chr(0x1EBE), Chr(0x1EC0), Chr(0x1EC2), Chr(0x1EC4), Chr(0x1EC6),
	Chr(0x1EC8), Chr(0x1ECA), Chr(0x1ECC), Chr(0x1ECE), Chr(0x1ED0), Chr(0x1ED2), Chr(0x1ED4), Chr(0x1ED6), Chr(0x1ED8),
	Chr(0x1EDA), Chr(0x1EDC), Chr(0x1EDE), Chr(0x1EE0), Chr(0x1EE2), Chr(0x1EE4), Chr(0x1EE6), Chr(0x1EE8), Chr(0x1EEA),
	Chr(0x1EEC), Chr(0x1EEE), Chr(0x1EF0), Chr(0x1EF2), Chr(0x1EF4), Chr(0x1EF6), Chr(0x1EF8), Chr(0x1EFA), Chr(0x1EFC),
	Chr(0x1EFE), Chr(0x1F59), Chr(0x1F5B), Chr(0x1F5D), Chr(0x1F5F), Chr(0x2102), Chr(0x2107), Chr(0x2115), Chr(0x2124),
	Chr(0x2126), Chr(0x2128), Chr(0x213E), Chr(0x213F), Chr(0x2145), Chr(0x2183), Chr(0x2C60), Chr(0x2C67), Chr(0x2C69),
	Chr(0x2C6B), Chr(0x2C72), Chr(0x2C75), Chr(0x2C82), Chr(0x2C84), Chr(0x2C86), Chr(0x2C88), Chr(0x2C8A), Chr(0x2C8C),
	Chr(0x2C8E), Chr(0x2C90), Chr(0x2C92), Chr(0x2C94), Chr(0x2C96), Chr(0x2C98), Chr(0x2C9A), Chr(0x2C9C), Chr(0x2C9E),
	Chr(0x2CA0), Chr(0x2CA2), Chr(0x2CA4), Chr(0x2CA6), Chr(0x2CA8), Chr(0x2CAA), Chr(0x2CAC), Chr(0x2CAE), Chr(0x2CB0),
	Chr(0x2CB2), Chr(0x2CB4), Chr(0x2CB6), Chr(0x2CB8), Chr(0x2CBA), Chr(0x2CBC), Chr(0x2CBE), Chr(0x2CC0), Chr(0x2CC2),
	Chr(0x2CC4), Chr(0x2CC6), Chr(0x2CC8), Chr(0x2CCA), Chr(0x2CCC), Chr(0x2CCE), Chr(0x2CD0), Chr(0x2CD2), Chr(0x2CD4),
	Chr(0x2CD6), Chr(0x2CD8), Chr(0x2CDA), Chr(0x2CDC), Chr(0x2CDE), Chr(0x2CE0), Chr(0x2CE2), Chr(0x2CEB), Chr(0x2CED),
	Chr(0x2CF2), Chr(0xA640), Chr(0xA642), Chr(0xA644), Chr(0xA646), Chr(0xA648), Chr(0xA64A), Chr(0xA64C), Chr(0xA64E),
	Chr(0xA650), Chr(0xA652), Chr(0xA654), Chr(0xA656), Chr(0xA658), Chr(0xA65A), Chr(0xA65C), Chr(0xA65E), Chr(0xA660),
	Chr(0xA662), Chr(0xA664), Chr(0xA666), Chr(0xA668), Chr(0xA66A), Chr(0xA66C), Chr(0xA680), Chr(0xA682), Chr(0xA684),
	Chr(0xA686), Chr(0xA688), Chr(0xA68A), Chr(0xA68C), Chr(0xA68E), Chr(0xA690), Chr(0xA692), Chr(0xA694), Chr(0xA696),
	Chr(0xA698), Chr(0xA69A), Chr(0xA722), Chr(0xA724), Chr(0xA726), Chr(0xA728), Chr(0xA72A), Chr(0xA72C), Chr(0xA72E),
	Chr(0xA732), Chr(0xA734), Chr(0xA736), Chr(0xA738), Chr(0xA73A), Chr(0xA73C), Chr(0xA73E), Chr(0xA740), Chr(0xA742),
	Chr(0xA744), Chr(0xA746), Chr(0xA748), Chr(0xA74A), Chr(0xA74C), Chr(0xA74E), Chr(0xA750), Chr(0xA752), Chr(0xA754),
	Chr(0xA756), Chr(0xA758), Chr(0xA75A), Chr(0xA75C), Chr(0xA75E), Chr(0xA760), Chr(0xA762), Chr(0xA764), Chr(0xA766),
	Chr(0xA768), Chr(0xA76A), Chr(0xA76C), Chr(0xA76E), Chr(0xA779), Chr(0xA77B), Chr(0xA77D), Chr(0xA77E), Chr(0xA780),
	Chr(0xA782), Chr(0xA784), Chr(0xA786), Chr(0xA78B), Chr(0xA78D), Chr(0xA790), Chr(0xA792), Chr(0xA796), Chr(0xA798),
	Chr(0xA79A), Chr(0xA79C), Chr(0xA79E), Chr(0xA7A0), Chr(0xA7A2), Chr(0xA7A4), Chr(0xA7A6), Chr(0xA7A8), Chr(0xA7B6),
	Chr(0xA7B8), Chr(0xA7BA), Chr(0xA7BC), Chr(0xA7BE), Chr(0xA7C0), Chr(0xA7C2), Chr(0xA7C9), Chr(0xA7D0), Chr(0xA7D6),
	Chr(0xA7D8), Chr(0xA7F5),
} /* regc_locale.c:561:18 */

// Unicode: unicode print characters excluding space.

var graphRangeTable = [285]Crange{
	{Fstart: Chr(0x21), Fend: Chr(0x7E)}, {Fstart: Chr(0xA1), Fend: Chr(0xAC)}, {Fstart: Chr(0xAE), Fend: Chr(0x377)}, {Fstart: Chr(0x37A), Fend: Chr(0x37F)},
	{Fstart: Chr(0x384), Fend: Chr(0x38A)}, {Fstart: Chr(0x38E), Fend: Chr(0x3A1)}, {Fstart: Chr(0x3A3), Fend: Chr(0x52F)}, {Fstart: Chr(0x531), Fend: Chr(0x556)},
	{Fstart: Chr(0x559), Fend: Chr(0x58A)}, {Fstart: Chr(0x58D), Fend: Chr(0x58F)}, {Fstart: Chr(0x591), Fend: Chr(0x5C7)}, {Fstart: Chr(0x5D0), Fend: Chr(0x5EA)},
	{Fstart: Chr(0x5EF), Fend: Chr(0x5F4)}, {Fstart: Chr(0x606), Fend: Chr(0x61B)}, {Fstart: Chr(0x61D), Fend: Chr(0x6DC)}, {Fstart: Chr(0x6DE), Fend: Chr(0x70D)},
	{Fstart: Chr(0x710), Fend: Chr(0x74A)}, {Fstart: Chr(0x74D), Fend: Chr(0x7B1)}, {Fstart: Chr(0x7C0), Fend: Chr(0x7FA)}, {Fstart: Chr(0x7FD), Fend: Chr(0x82D)},
	{Fstart: Chr(0x830), Fend: Chr(0x83E)}, {Fstart: Chr(0x840), Fend: Chr(0x85B)}, {Fstart: Chr(0x860), Fend: Chr(0x86A)}, {Fstart: Chr(0x870), Fend: Chr(0x88E)},
	{Fstart: Chr(0x898), Fend: Chr(0x8E1)}, {Fstart: Chr(0x8E3), Fend: Chr(0x983)}, {Fstart: Chr(0x985), Fend: Chr(0x98C)}, {Fstart: Chr(0x993), Fend: Chr(0x9A8)},
	{Fstart: Chr(0x9AA), Fend: Chr(0x9B0)}, {Fstart: Chr(0x9B6), Fend: Chr(0x9B9)}, {Fstart: Chr(0x9BC), Fend: Chr(0x9C4)}, {Fstart: Chr(0x9CB), Fend: Chr(0x9CE)},
	{Fstart: Chr(0x9DF), Fend: Chr(0x9E3)}, {Fstart: Chr(0x9E6), Fend: Chr(0x9FE)}, {Fstart: Chr(0xA01), Fend: Chr(0xA03)}, {Fstart: Chr(0xA05), Fend: Chr(0xA0A)},
	{Fstart: Chr(0xA13), Fend: Chr(0xA28)}, {Fstart: Chr(0xA2A), Fend: Chr(0xA30)}, {Fstart: Chr(0xA3E), Fend: Chr(0xA42)}, {Fstart: Chr(0xA4B), Fend: Chr(0xA4D)},
	{Fstart: Chr(0xA59), Fend: Chr(0xA5C)}, {Fstart: Chr(0xA66), Fend: Chr(0xA76)}, {Fstart: Chr(0xA81), Fend: Chr(0xA83)}, {Fstart: Chr(0xA85), Fend: Chr(0xA8D)},
	{Fstart: Chr(0xA8F), Fend: Chr(0xA91)}, {Fstart: Chr(0xA93), Fend: Chr(0xAA8)}, {Fstart: Chr(0xAAA), Fend: Chr(0xAB0)}, {Fstart: Chr(0xAB5), Fend: Chr(0xAB9)},
	{Fstart: Chr(0xABC), Fend: Chr(0xAC5)}, {Fstart: Chr(0xAC7), Fend: Chr(0xAC9)}, {Fstart: Chr(0xACB), Fend: Chr(0xACD)}, {Fstart: Chr(0xAE0), Fend: Chr(0xAE3)},
	{Fstart: Chr(0xAE6), Fend: Chr(0xAF1)}, {Fstart: Chr(0xAF9), Fend: Chr(0xAFF)}, {Fstart: Chr(0xB01), Fend: Chr(0xB03)}, {Fstart: Chr(0xB05), Fend: Chr(0xB0C)},
	{Fstart: Chr(0xB13), Fend: Chr(0xB28)}, {Fstart: Chr(0xB2A), Fend: Chr(0xB30)}, {Fstart: Chr(0xB35), Fend: Chr(0xB39)}, {Fstart: Chr(0xB3C), Fend: Chr(0xB44)},
	{Fstart: Chr(0xB4B), Fend: Chr(0xB4D)}, {Fstart: Chr(0xB55), Fend: Chr(0xB57)}, {Fstart: Chr(0xB5F), Fend: Chr(0xB63)}, {Fstart: Chr(0xB66), Fend: Chr(0xB77)},
	{Fstart: Chr(0xB85), Fend: Chr(0xB8A)}, {Fstart: Chr(0xB8E), Fend: Chr(0xB90)}, {Fstart: Chr(0xB92), Fend: Chr(0xB95)}, {Fstart: Chr(0xBA8), Fend: Chr(0xBAA)},
	{Fstart: Chr(0xBAE), Fend: Chr(0xBB9)}, {Fstart: Chr(0xBBE), Fend: Chr(0xBC2)}, {Fstart: Chr(0xBC6), Fend: Chr(0xBC8)}, {Fstart: Chr(0xBCA), Fend: Chr(0xBCD)},
	{Fstart: Chr(0xBE6), Fend: Chr(0xBFA)}, {Fstart: Chr(0xC00), Fend: Chr(0xC0C)}, {Fstart: Chr(0xC0E), Fend: Chr(0xC10)}, {Fstart: Chr(0xC12), Fend: Chr(0xC28)},
	{Fstart: Chr(0xC2A), Fend: Chr(0xC39)}, {Fstart: Chr(0xC3C), Fend: Chr(0xC44)}, {Fstart: Chr(0xC46), Fend: Chr(0xC48)}, {Fstart: Chr(0xC4A), Fend: Chr(0xC4D)},
	{Fstart: Chr(0xC58), Fend: Chr(0xC5A)}, {Fstart: Chr(0xC60), Fend: Chr(0xC63)}, {Fstart: Chr(0xC66), Fend: Chr(0xC6F)}, {Fstart: Chr(0xC77), Fend: Chr(0xC8C)},
	{Fstart: Chr(0xC8E), Fend: Chr(0xC90)}, {Fstart: Chr(0xC92), Fend: Chr(0xCA8)}, {Fstart: Chr(0xCAA), Fend: Chr(0xCB3)}, {Fstart: Chr(0xCB5), Fend: Chr(0xCB9)},
	{Fstart: Chr(0xCBC), Fend: Chr(0xCC4)}, {Fstart: Chr(0xCC6), Fend: Chr(0xCC8)}, {Fstart: Chr(0xCCA), Fend: Chr(0xCCD)}, {Fstart: Chr(0xCE0), Fend: Chr(0xCE3)},
	{Fstart: Chr(0xCE6), Fend: Chr(0xCEF)}, {Fstart: Chr(0xD00), Fend: Chr(0xD0C)}, {Fstart: Chr(0xD0E), Fend: Chr(0xD10)}, {Fstart: Chr(0xD12), Fend: Chr(0xD44)},
	{Fstart: Chr(0xD46), Fend: Chr(0xD48)}, {Fstart: Chr(0xD4A), Fend: Chr(0xD4F)}, {Fstart: Chr(0xD54), Fend: Chr(0xD63)}, {Fstart: Chr(0xD66), Fend: Chr(0xD7F)},
	{Fstart: Chr(0xD81), Fend: Chr(0xD83)}, {Fstart: Chr(0xD85), Fend: Chr(0xD96)}, {Fstart: Chr(0xD9A), Fend: Chr(0xDB1)}, {Fstart: Chr(0xDB3), Fend: Chr(0xDBB)},
	{Fstart: Chr(0xDC0), Fend: Chr(0xDC6)}, {Fstart: Chr(0xDCF), Fend: Chr(0xDD4)}, {Fstart: Chr(0xDD8), Fend: Chr(0xDDF)}, {Fstart: Chr(0xDE6), Fend: Chr(0xDEF)},
	{Fstart: Chr(0xDF2), Fend: Chr(0xDF4)}, {Fstart: Chr(0xE01), Fend: Chr(0xE3A)}, {Fstart: Chr(0xE3F), Fend: Chr(0xE5B)}, {Fstart: Chr(0xE86), Fend: Chr(0xE8A)},
	{Fstart: Chr(0xE8C), Fend: Chr(0xEA3)}, {Fstart: Chr(0xEA7), Fend: Chr(0xEBD)}, {Fstart: Chr(0xEC0), Fend: Chr(0xEC4)}, {Fstart: Chr(0xEC8), Fend: Chr(0xECD)},
	{Fstart: Chr(0xED0), Fend: Chr(0xED9)}, {Fstart: Chr(0xEDC), Fend: Chr(0xEDF)}, {Fstart: Chr(0xF00), Fend: Chr(0xF47)}, {Fstart: Chr(0xF49), Fend: Chr(0xF6C)},
	{Fstart: Chr(0xF71), Fend: Chr(0xF97)}, {Fstart: Chr(0xF99), Fend: Chr(0xFBC)}, {Fstart: Chr(0xFBE), Fend: Chr(0xFCC)}, {Fstart: Chr(0xFCE), Fend: Chr(0xFDA)},
	{Fstart: Chr(0x1000), Fend: Chr(0x10C5)}, {Fstart: Chr(0x10D0), Fend: Chr(0x1248)}, {Fstart: Chr(0x124A), Fend: Chr(0x124D)}, {Fstart: Chr(0x1250), Fend: Chr(0x1256)},
	{Fstart: Chr(0x125A), Fend: Chr(0x125D)}, {Fstart: Chr(0x1260), Fend: Chr(0x1288)}, {Fstart: Chr(0x128A), Fend: Chr(0x128D)}, {Fstart: Chr(0x1290), Fend: Chr(0x12B0)},
	{Fstart: Chr(0x12B2), Fend: Chr(0x12B5)}, {Fstart: Chr(0x12B8), Fend: Chr(0x12BE)}, {Fstart: Chr(0x12C2), Fend: Chr(0x12C5)}, {Fstart: Chr(0x12C8), Fend: Chr(0x12D6)},
	{Fstart: Chr(0x12D8), Fend: Chr(0x1310)}, {Fstart: Chr(0x1312), Fend: Chr(0x1315)}, {Fstart: Chr(0x1318), Fend: Chr(0x135A)}, {Fstart: Chr(0x135D), Fend: Chr(0x137C)},
	{Fstart: Chr(0x1380), Fend: Chr(0x1399)}, {Fstart: Chr(0x13A0), Fend: Chr(0x13F5)}, {Fstart: Chr(0x13F8), Fend: Chr(0x13FD)}, {Fstart: Chr(0x1400), Fend: Chr(0x167F)},
	{Fstart: Chr(0x1681), Fend: Chr(0x169C)}, {Fstart: Chr(0x16A0), Fend: Chr(0x16F8)}, {Fstart: Chr(0x1700), Fend: Chr(0x1715)}, {Fstart: Chr(0x171F), Fend: Chr(0x1736)},
	{Fstart: Chr(0x1740), Fend: Chr(0x1753)}, {Fstart: Chr(0x1760), Fend: Chr(0x176C)}, {Fstart: Chr(0x176E), Fend: Chr(0x1770)}, {Fstart: Chr(0x1780), Fend: Chr(0x17DD)},
	{Fstart: Chr(0x17E0), Fend: Chr(0x17E9)}, {Fstart: Chr(0x17F0), Fend: Chr(0x17F9)}, {Fstart: Chr(0x1800), Fend: Chr(0x180D)}, {Fstart: Chr(0x180F), Fend: Chr(0x1819)},
	{Fstart: Chr(0x1820), Fend: Chr(0x1878)}, {Fstart: Chr(0x1880), Fend: Chr(0x18AA)}, {Fstart: Chr(0x18B0), Fend: Chr(0x18F5)}, {Fstart: Chr(0x1900), Fend: Chr(0x191E)},
	{Fstart: Chr(0x1920), Fend: Chr(0x192B)}, {Fstart: Chr(0x1930), Fend: Chr(0x193B)}, {Fstart: Chr(0x1944), Fend: Chr(0x196D)}, {Fstart: Chr(0x1970), Fend: Chr(0x1974)},
	{Fstart: Chr(0x1980), Fend: Chr(0x19AB)}, {Fstart: Chr(0x19B0), Fend: Chr(0x19C9)}, {Fstart: Chr(0x19D0), Fend: Chr(0x19DA)}, {Fstart: Chr(0x19DE), Fend: Chr(0x1A1B)},
	{Fstart: Chr(0x1A1E), Fend: Chr(0x1A5E)}, {Fstart: Chr(0x1A60), Fend: Chr(0x1A7C)}, {Fstart: Chr(0x1A7F), Fend: Chr(0x1A89)}, {Fstart: Chr(0x1A90), Fend: Chr(0x1A99)},
	{Fstart: Chr(0x1AA0), Fend: Chr(0x1AAD)}, {Fstart: Chr(0x1AB0), Fend: Chr(0x1ACE)}, {Fstart: Chr(0x1B00), Fend: Chr(0x1B4C)}, {Fstart: Chr(0x1B50), Fend: Chr(0x1B7E)},
	{Fstart: Chr(0x1B80), Fend: Chr(0x1BF3)}, {Fstart: Chr(0x1BFC), Fend: Chr(0x1C37)}, {Fstart: Chr(0x1C3B), Fend: Chr(0x1C49)}, {Fstart: Chr(0x1C4D), Fend: Chr(0x1C88)},
	{Fstart: Chr(0x1C90), Fend: Chr(0x1CBA)}, {Fstart: Chr(0x1CBD), Fend: Chr(0x1CC7)}, {Fstart: Chr(0x1CD0), Fend: Chr(0x1CFA)}, {Fstart: Chr(0x1D00), Fend: Chr(0x1F15)},
	{Fstart: Chr(0x1F18), Fend: Chr(0x1F1D)}, {Fstart: Chr(0x1F20), Fend: Chr(0x1F45)}, {Fstart: Chr(0x1F48), Fend: Chr(0x1F4D)}, {Fstart: Chr(0x1F50), Fend: Chr(0x1F57)},
	{Fstart: Chr(0x1F5F), Fend: Chr(0x1F7D)}, {Fstart: Chr(0x1F80), Fend: Chr(0x1FB4)}, {Fstart: Chr(0x1FB6), Fend: Chr(0x1FC4)}, {Fstart: Chr(0x1FC6), Fend: Chr(0x1FD3)},
	{Fstart: Chr(0x1FD6), Fend: Chr(0x1FDB)}, {Fstart: Chr(0x1FDD), Fend: Chr(0x1FEF)}, {Fstart: Chr(0x1FF2), Fend: Chr(0x1FF4)}, {Fstart: Chr(0x1FF6), Fend: Chr(0x1FFE)},
	{Fstart: Chr(0x2010), Fend: Chr(0x2027)}, {Fstart: Chr(0x2030), Fend: Chr(0x205E)}, {Fstart: Chr(0x2074), Fend: Chr(0x208E)}, {Fstart: Chr(0x2090), Fend: Chr(0x209C)},
	{Fstart: Chr(0x20A0), Fend: Chr(0x20C0)}, {Fstart: Chr(0x20D0), Fend: Chr(0x20F0)}, {Fstart: Chr(0x2100), Fend: Chr(0x218B)}, {Fstart: Chr(0x2190), Fend: Chr(0x2426)},
	{Fstart: Chr(0x2440), Fend: Chr(0x244A)}, {Fstart: Chr(0x2460), Fend: Chr(0x2B73)}, {Fstart: Chr(0x2B76), Fend: Chr(0x2B95)}, {Fstart: Chr(0x2B97), Fend: Chr(0x2CF3)},
	{Fstart: Chr(0x2CF9), Fend: Chr(0x2D25)}, {Fstart: Chr(0x2D30), Fend: Chr(0x2D67)}, {Fstart: Chr(0x2D7F), Fend: Chr(0x2D96)}, {Fstart: Chr(0x2DA0), Fend: Chr(0x2DA6)},
	{Fstart: Chr(0x2DA8), Fend: Chr(0x2DAE)}, {Fstart: Chr(0x2DB0), Fend: Chr(0x2DB6)}, {Fstart: Chr(0x2DB8), Fend: Chr(0x2DBE)}, {Fstart: Chr(0x2DC0), Fend: Chr(0x2DC6)},
	{Fstart: Chr(0x2DC8), Fend: Chr(0x2DCE)}, {Fstart: Chr(0x2DD0), Fend: Chr(0x2DD6)}, {Fstart: Chr(0x2DD8), Fend: Chr(0x2DDE)}, {Fstart: Chr(0x2DE0), Fend: Chr(0x2E5D)},
	{Fstart: Chr(0x2E80), Fend: Chr(0x2E99)}, {Fstart: Chr(0x2E9B), Fend: Chr(0x2EF3)}, {Fstart: Chr(0x2F00), Fend: Chr(0x2FD5)}, {Fstart: Chr(0x2FF0), Fend: Chr(0x2FFB)},
	{Fstart: Chr(0x3001), Fend: Chr(0x303F)}, {Fstart: Chr(0x3041), Fend: Chr(0x3096)}, {Fstart: Chr(0x3099), Fend: Chr(0x30FF)}, {Fstart: Chr(0x3105), Fend: Chr(0x312F)},
	{Fstart: Chr(0x3131), Fend: Chr(0x318E)}, {Fstart: Chr(0x3190), Fend: Chr(0x31E3)}, {Fstart: Chr(0x31F0), Fend: Chr(0x321E)}, {Fstart: Chr(0x3220), Fend: Chr(0xA48C)},
	{Fstart: Chr(0xA490), Fend: Chr(0xA4C6)}, {Fstart: Chr(0xA4D0), Fend: Chr(0xA62B)}, {Fstart: Chr(0xA640), Fend: Chr(0xA6F7)}, {Fstart: Chr(0xA700), Fend: Chr(0xA7CA)},
	{Fstart: Chr(0xA7D5), Fend: Chr(0xA7D9)}, {Fstart: Chr(0xA7F2), Fend: Chr(0xA82C)}, {Fstart: Chr(0xA830), Fend: Chr(0xA839)}, {Fstart: Chr(0xA840), Fend: Chr(0xA877)},
	{Fstart: Chr(0xA880), Fend: Chr(0xA8C5)}, {Fstart: Chr(0xA8CE), Fend: Chr(0xA8D9)}, {Fstart: Chr(0xA8E0), Fend: Chr(0xA953)}, {Fstart: Chr(0xA95F), Fend: Chr(0xA97C)},
	{Fstart: Chr(0xA980), Fend: Chr(0xA9CD)}, {Fstart: Chr(0xA9CF), Fend: Chr(0xA9D9)}, {Fstart: Chr(0xA9DE), Fend: Chr(0xA9FE)}, {Fstart: Chr(0xAA00), Fend: Chr(0xAA36)},
	{Fstart: Chr(0xAA40), Fend: Chr(0xAA4D)}, {Fstart: Chr(0xAA50), Fend: Chr(0xAA59)}, {Fstart: Chr(0xAA5C), Fend: Chr(0xAAC2)}, {Fstart: Chr(0xAADB), Fend: Chr(0xAAF6)},
	{Fstart: Chr(0xAB01), Fend: Chr(0xAB06)}, {Fstart: Chr(0xAB09), Fend: Chr(0xAB0E)}, {Fstart: Chr(0xAB11), Fend: Chr(0xAB16)}, {Fstart: Chr(0xAB20), Fend: Chr(0xAB26)},
	{Fstart: Chr(0xAB28), Fend: Chr(0xAB2E)}, {Fstart: Chr(0xAB30), Fend: Chr(0xAB6B)}, {Fstart: Chr(0xAB70), Fend: Chr(0xABED)}, {Fstart: Chr(0xABF0), Fend: Chr(0xABF9)},
	{Fstart: Chr(0xAC00), Fend: Chr(0xD7A3)}, {Fstart: Chr(0xD7B0), Fend: Chr(0xD7C6)}, {Fstart: Chr(0xD7CB), Fend: Chr(0xD7FB)}, {Fstart: Chr(0xF900), Fend: Chr(0xFA6D)},
	{Fstart: Chr(0xFA70), Fend: Chr(0xFAD9)}, {Fstart: Chr(0xFB00), Fend: Chr(0xFB06)}, {Fstart: Chr(0xFB13), Fend: Chr(0xFB17)}, {Fstart: Chr(0xFB1D), Fend: Chr(0xFB36)},
	{Fstart: Chr(0xFB38), Fend: Chr(0xFB3C)}, {Fstart: Chr(0xFB46), Fend: Chr(0xFBC2)}, {Fstart: Chr(0xFBD3), Fend: Chr(0xFD8F)}, {Fstart: Chr(0xFD92), Fend: Chr(0xFDC7)},
	{Fstart: Chr(0xFDF0), Fend: Chr(0xFE19)}, {Fstart: Chr(0xFE20), Fend: Chr(0xFE52)}, {Fstart: Chr(0xFE54), Fend: Chr(0xFE66)}, {Fstart: Chr(0xFE68), Fend: Chr(0xFE6B)},
	{Fstart: Chr(0xFE70), Fend: Chr(0xFE74)}, {Fstart: Chr(0xFE76), Fend: Chr(0xFEFC)}, {Fstart: Chr(0xFF01), Fend: Chr(0xFFBE)}, {Fstart: Chr(0xFFC2), Fend: Chr(0xFFC7)},
	{Fstart: Chr(0xFFCA), Fend: Chr(0xFFCF)}, {Fstart: Chr(0xFFD2), Fend: Chr(0xFFD7)}, {Fstart: Chr(0xFFDA), Fend: Chr(0xFFDC)}, {Fstart: Chr(0xFFE0), Fend: Chr(0xFFE6)},
	{Fstart: Chr(0xFFE8), Fend: Chr(0xFFEE)},
} /* regc_locale.c:639:21 */

var graphCharTable = [89]Chr{
	Chr(0x38C), Chr(0x85E), Chr(0x98F), Chr(0x990), Chr(0x9B2), Chr(0x9C7), Chr(0x9C8), Chr(0x9D7), Chr(0x9DC),
	Chr(0x9DD), Chr(0xA0F), Chr(0xA10), Chr(0xA32), Chr(0xA33), Chr(0xA35), Chr(0xA36), Chr(0xA38), Chr(0xA39),
	Chr(0xA3C), Chr(0xA47), Chr(0xA48), Chr(0xA51), Chr(0xA5E), Chr(0xAB2), Chr(0xAB3), Chr(0xAD0), Chr(0xB0F),
	Chr(0xB10), Chr(0xB32), Chr(0xB33), Chr(0xB47), Chr(0xB48), Chr(0xB5C), Chr(0xB5D), Chr(0xB82), Chr(0xB83),
	Chr(0xB99), Chr(0xB9A), Chr(0xB9C), Chr(0xB9E), Chr(0xB9F), Chr(0xBA3), Chr(0xBA4), Chr(0xBD0), Chr(0xBD7),
	Chr(0xC55), Chr(0xC56), Chr(0xC5D), Chr(0xCD5), Chr(0xCD6), Chr(0xCDD), Chr(0xCDE), Chr(0xCF1), Chr(0xCF2),
	Chr(0xDBD), Chr(0xDCA), Chr(0xDD6), Chr(0xE81), Chr(0xE82), Chr(0xE84), Chr(0xEA5), Chr(0xEC6), Chr(0x10C7),
	Chr(0x10CD), Chr(0x1258), Chr(0x12C0), Chr(0x1772), Chr(0x1773), Chr(0x1940), Chr(0x1F59), Chr(0x1F5B), Chr(0x1F5D),
	Chr(0x2070), Chr(0x2071), Chr(0x2D27), Chr(0x2D2D), Chr(0x2D6F), Chr(0x2D70), Chr(0xA7D0), Chr(0xA7D1), Chr(0xA7D3),
	Chr(0xFB3E), Chr(0xFB40), Chr(0xFB41), Chr(0xFB43), Chr(0xFB44), Chr(0xFDCF), Chr(0xFFFC), Chr(0xFFFD),
} /* regc_locale.c:792:18 */

//	End of auto-generated Unicode character ranges declarations.

//
//  - element - map collating-element name to celt
//  ^ static celt element(struct vars *, const chr *, const chr *);
//
func element(tls *libc.TLS, v uintptr, startp uintptr, endp uintptr) Celt { /* regc_locale.c:831:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var cn uintptr
	var len Size_t
	// var ds Tcl_DString at bp, 216

	var np uintptr

	// Generic: one-chr names stand for themselves.

	len = Size_t((int64(endp) - int64(startp)) / 2)
	if len == uint64(1) {
		return Celt(*(*Chr)(unsafe.Pointer(startp)))
	}

	*(*int64)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fre + 16)) |= int64(REG_ULOCALE)

	// Search table.

	XTcl_DStringInit(tls, bp)
	np = XTcl_UniCharToUtfDString(tls, startp, int32(len), bp)
	for cn = uintptr(unsafe.Pointer(&cnames)); (*Cname)(unsafe.Pointer(cn)).Fname != uintptr(0); cn += 16 {
		if libc.Xstrlen(tls, (*Cname)(unsafe.Pointer(cn)).Fname) == len && libc.Xstrncmp(tls, (*Cname)(unsafe.Pointer(cn)).Fname, np, len) == 0 {
			break // NOTE BREAK OUT
		}
	}
	XTcl_DStringFree(tls, bp)
	if (*Cname)(unsafe.Pointer(cn)).Fname != uintptr(0) {
		return Celt(uint8((*Cname)(unsafe.Pointer(cn)).Fcode))
	}

	// Couldn't find it.

	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fnexttype = 'e'
	(*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Ferr = func() int32 {
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr
		}
		return REG_ECOLLATE
	}()
	return 0
}

//
//  - range - supply cvec for a range, including legality check
//  ^ static struct cvec *range(struct vars *, celt, celt, int);
//
func range1(tls *libc.TLS, v uintptr, a Celt, b Celt, cases int32) uintptr { /* regc_locale.c:881:20: */
	var nchrs int32
	var cv uintptr
	var c Celt
	var lc Celt
	var uc Celt
	var tc Celt

	if a != b && !(before(tls, a, b) != 0) {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ERANGE
		}()
		return uintptr(0)
	}

	if !(cases != 0) { // easy version
		cv = getcvec(tls, v, 0, 1)
		{
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return uintptr(0)
			}
		}

		addrange(tls, cv, a, b)
		return cv
	}

	// When case-independent, it's hard to decide when cvec ranges are usable,
	// so for now at least, we won't try. We allocate enough space for two
	// case variants plus a little extra for the two title case variants.

	nchrs = (b-a+1)*2 + 4

	cv = getcvec(tls, v, nchrs, 0)
	{
		if (*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr != 0 {
			return uintptr(0)
		}
	}

	for c = a; c <= b; c++ {
		addchr(tls, cv, c)
		lc = Celt(XTcl_UniCharToLower(tls, int32(Chr(c))))
		uc = Celt(XTcl_UniCharToUpper(tls, int32(Chr(c))))
		tc = Celt(XTcl_UniCharToTitle(tls, int32(Chr(c))))
		if c != lc {
			addchr(tls, cv, lc)
		}
		if c != uc {
			addchr(tls, cv, uc)
		}
		if c != tc && tc != uc {
			addchr(tls, cv, tc)
		}
	}

	return cv
}

//
//  - before - is celt x before celt y, for purposes of range legality?
//  ^ static int before(celt, celt);
//
func before(tls *libc.TLS, x Celt, y Celt) int32 { /* regc_locale.c:939:1: */
	if x < y {
		return 1
	}
	return 0
}

//
//  - eclass - supply cvec for an equivalence class
//  * Must include case counterparts on request.
//  ^ static struct cvec *eclass(struct vars *, celt, int);
//
func eclass(tls *libc.TLS, v uintptr, c Celt, cases int32) uintptr { /* regc_locale.c:953:20: */
	var cv uintptr

	// Crude fake equivalence class for testing.

	if (*struct {
		Fre          uintptr
		Fnow         uintptr
		Fstop        uintptr
		Fsavenow     uintptr
		Fsavestop    uintptr
		Ferr         int32
		Fcflags      int32
		Flasttype    int32
		Fnexttype    int32
		Fnextvalue   Chr
		F__ccgo_pad1 [2]byte
		Flexcon      int32
		Fnsubexp     int32
		F__ccgo_pad2 [4]byte
		Fsubs        uintptr
		Fnsubs       Size_t
		Fsub10       [10]uintptr
		Fnfa         uintptr
		Fcm          uintptr
		Fnlcolor     Color
		F__ccgo_pad3 [6]byte
		Fwordchrs    uintptr
		Ftree        uintptr
		Ftreechain   uintptr
		Ftreefree    uintptr
		Fntree       int32
		F__ccgo_pad4 [4]byte
		Fcv          uintptr
		Fcv2         uintptr
		Flacons      uintptr
		Fnlacons     int32
		F__ccgo_pad5 [4]byte
		Fspaceused   Size_t
	})(unsafe.Pointer(v)).Fcflags&REG_FAKE != 0 && c == 'x' {
		cv = getcvec(tls, v, 4, 0)
		addchr(tls, cv, int32(Chr('x')))
		addchr(tls, cv, int32(Chr('y')))
		if cases != 0 {
			addchr(tls, cv, int32(Chr('X')))
			addchr(tls, cv, int32(Chr('Y')))
		}
		return cv
	}

	// Otherwise, none.

	if cases != 0 {
		return allcases(tls, v, c)
	}
	cv = getcvec(tls, v, 1, 0)

	addchr(tls, cv, int32(Chr(c)))
	return cv
}

//
//  - cclass - supply cvec for a character class
//  * Must include case counterparts on request.
//  ^ static struct cvec *cclass(struct vars *, const chr *, const chr *, int);
//
func cclass(tls *libc.TLS, v uintptr, startp uintptr, endp uintptr, cases int32) uintptr { /* regc_locale.c:995:20: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var len Size_t
	var cv uintptr = uintptr(0)
	// var ds Tcl_DString at bp, 216

	var np uintptr
	var namePtr uintptr
	var i int32
	var index int32

	// Extract the class name

	len = Size_t((int64(endp) - int64(startp)) / 2)
	XTcl_DStringInit(tls, bp)
	np = XTcl_UniCharToUtfDString(tls, startp, int32(len), bp)

	// Map the name to the corresponding enumerated value.

	index = -1
	namePtr = uintptr(unsafe.Pointer(&classNames))
	i = 0
__1:
	if !(*(*uintptr)(unsafe.Pointer(namePtr)) != uintptr(0)) {
		goto __3
	}
	{
		if libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(namePtr))) == len && libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(namePtr)), np, len) == 0 {
			index = i
			goto __3
		}

	}
	goto __2
__2:
	namePtr += 8
	i++
	goto __1
	goto __3
__3:
	;
	XTcl_DStringFree(tls, bp)
	if index == -1 {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ECTYPE
		}()
		return uintptr(0)
	}

	// Remap lower and upper to alpha if the match is case insensitive.

	if cases != 0 && (index == 7 || index == 11) {
		index = 0 /* CC_ALNUM */
	}

	// Now compute the character class contents.

	switch uint32(index) {
	case uint32(0) /* CC_ALNUM */ :
		cv = getcvec(tls, v, int32(uint64(unsafe.Sizeof(alphaCharTable))/uint64(unsafe.Sizeof(Chr(0)))), int32(uint64(unsafe.Sizeof(digitRangeTable))/uint64(unsafe.Sizeof(Crange{}))+uint64(unsafe.Sizeof(alphaRangeTable))/uint64(unsafe.Sizeof(Crange{}))))
		if cv != 0 {
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(alphaCharTable))/uint64(unsafe.Sizeof(Chr(0))); i++ {
				addchr(tls, cv, int32(alphaCharTable[i]))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(alphaRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(alphaRangeTable[i].Fstart),
					int32(alphaRangeTable[i].Fend))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(digitRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(digitRangeTable[i].Fstart),
					int32(digitRangeTable[i].Fend))
			}
		}
		break
	case uint32(1) /* CC_ALPHA */ :
		cv = getcvec(tls, v, int32(uint64(unsafe.Sizeof(alphaCharTable))/uint64(unsafe.Sizeof(Chr(0)))), int32(uint64(unsafe.Sizeof(alphaRangeTable))/uint64(unsafe.Sizeof(Crange{}))))
		if cv != 0 {
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(alphaRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(alphaRangeTable[i].Fstart),
					int32(alphaRangeTable[i].Fend))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(alphaCharTable))/uint64(unsafe.Sizeof(Chr(0))); i++ {
				addchr(tls, cv, int32(alphaCharTable[i]))
			}
		}
		break
	case uint32(2) /* CC_ASCII */ :
		cv = getcvec(tls, v, 0, 1)
		if cv != 0 {
			addrange(tls, cv, 0, 0x7F)
		}
		break
	case uint32(3) /* CC_BLANK */ :
		cv = getcvec(tls, v, 2, 0)
		addchr(tls, cv, '\t')
		addchr(tls, cv, ' ')
		break
	case uint32(4) /* CC_CNTRL */ :
		cv = getcvec(tls, v, int32(uint64(unsafe.Sizeof(controlCharTable))/uint64(unsafe.Sizeof(Chr(0)))), int32(uint64(unsafe.Sizeof(controlRangeTable))/uint64(unsafe.Sizeof(Crange{}))))
		if cv != 0 {
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(controlRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(controlRangeTable[i].Fstart),
					int32(controlRangeTable[i].Fend))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(controlCharTable))/uint64(unsafe.Sizeof(Chr(0))); i++ {
				addchr(tls, cv, int32(controlCharTable[i]))
			}
		}
		break
	case uint32(5) /* CC_DIGIT */ :
		cv = getcvec(tls, v, 0, int32(uint64(unsafe.Sizeof(digitRangeTable))/uint64(unsafe.Sizeof(Crange{}))))
		if cv != 0 {
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(digitRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(digitRangeTable[i].Fstart),
					int32(digitRangeTable[i].Fend))
			}
		}
		break
	case uint32(9) /* CC_PUNCT */ :
		cv = getcvec(tls, v, int32(uint64(unsafe.Sizeof(punctCharTable))/uint64(unsafe.Sizeof(Chr(0)))), int32(uint64(unsafe.Sizeof(punctRangeTable))/uint64(unsafe.Sizeof(Crange{}))))
		if cv != 0 {
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(punctRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(punctRangeTable[i].Fstart),
					int32(punctRangeTable[i].Fend))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(punctCharTable))/uint64(unsafe.Sizeof(Chr(0))); i++ {
				addchr(tls, cv, int32(punctCharTable[i]))
			}
		}
		break
	case uint32(12) /* CC_XDIGIT */ :
		// This is a 3 instead of (NUM_DIGIT_RANGE+2) because I've no idea how
		// to define the digits 'a' through 'f' in non-western locales. The
		// concept is quite possibly non portable, or only used in contextx
		// where the characters used would be the western ones anyway!
		// Whatever is actually the case, the number of ranges is fixed (until
		// someone comes up with a better arrangement!)

		cv = getcvec(tls, v, 0, 3)
		if cv != 0 {
			addrange(tls, cv, '0', '9')
			addrange(tls, cv, 'a', 'f')
			addrange(tls, cv, 'A', 'F')
		}
		break
	case uint32(10) /* CC_SPACE */ :
		cv = getcvec(tls, v, int32(uint64(unsafe.Sizeof(spaceCharTable))/uint64(unsafe.Sizeof(Chr(0)))), int32(uint64(unsafe.Sizeof(spaceRangeTable))/uint64(unsafe.Sizeof(Crange{}))))
		if cv != 0 {
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(spaceRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(spaceRangeTable[i].Fstart),
					int32(spaceRangeTable[i].Fend))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(spaceCharTable))/uint64(unsafe.Sizeof(Chr(0))); i++ {
				addchr(tls, cv, int32(spaceCharTable[i]))
			}
		}
		break
	case uint32(7) /* CC_LOWER */ :
		cv = getcvec(tls, v, int32(uint64(unsafe.Sizeof(lowerCharTable))/uint64(unsafe.Sizeof(Chr(0)))), int32(uint64(unsafe.Sizeof(lowerRangeTable))/uint64(unsafe.Sizeof(Crange{}))))
		if cv != 0 {
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(lowerRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(lowerRangeTable[i].Fstart),
					int32(lowerRangeTable[i].Fend))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(lowerCharTable))/uint64(unsafe.Sizeof(Chr(0))); i++ {
				addchr(tls, cv, int32(lowerCharTable[i]))
			}
		}
		break
	case uint32(11) /* CC_UPPER */ :
		cv = getcvec(tls, v, int32(uint64(unsafe.Sizeof(upperCharTable))/uint64(unsafe.Sizeof(Chr(0)))), int32(uint64(unsafe.Sizeof(upperRangeTable))/uint64(unsafe.Sizeof(Crange{}))))
		if cv != 0 {
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(upperRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(upperRangeTable[i].Fstart),
					int32(upperRangeTable[i].Fend))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(upperCharTable))/uint64(unsafe.Sizeof(Chr(0))); i++ {
				addchr(tls, cv, int32(upperCharTable[i]))
			}
		}
		break
	case uint32(8) /* CC_PRINT */ :
		cv = getcvec(tls, v, int32(uint64(unsafe.Sizeof(spaceCharTable))/uint64(unsafe.Sizeof(Chr(0)))+uint64(unsafe.Sizeof(graphCharTable))/uint64(unsafe.Sizeof(Chr(0)))), int32(uint64(unsafe.Sizeof(spaceRangeTable))/uint64(unsafe.Sizeof(Crange{}))+uint64(unsafe.Sizeof(graphRangeTable))/uint64(unsafe.Sizeof(Crange{}))-uint64(1)))
		if cv != 0 {
			for i = 1; Size_t(i) < uint64(unsafe.Sizeof(spaceRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(spaceRangeTable[i].Fstart),
					int32(spaceRangeTable[i].Fend))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(spaceCharTable))/uint64(unsafe.Sizeof(Chr(0))); i++ {
				addchr(tls, cv, int32(spaceCharTable[i]))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(graphRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(graphRangeTable[i].Fstart),
					int32(graphRangeTable[i].Fend))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(graphCharTable))/uint64(unsafe.Sizeof(Chr(0))); i++ {
				addchr(tls, cv, int32(graphCharTable[i]))
			}
		}
		break
	case uint32(6) /* CC_GRAPH */ :
		cv = getcvec(tls, v, int32(uint64(unsafe.Sizeof(graphCharTable))/uint64(unsafe.Sizeof(Chr(0)))), int32(uint64(unsafe.Sizeof(graphRangeTable))/uint64(unsafe.Sizeof(Crange{}))))
		if cv != 0 {
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(graphRangeTable))/uint64(unsafe.Sizeof(Crange{})); i++ {
				addrange(tls, cv, int32(graphRangeTable[i].Fstart),
					int32(graphRangeTable[i].Fend))
			}
			for i = 0; Size_t(i) < uint64(unsafe.Sizeof(graphCharTable))/uint64(unsafe.Sizeof(Chr(0))); i++ {
				addchr(tls, cv, int32(graphCharTable[i]))
			}
		}
		break
	}
	if cv == uintptr(0) {
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Fnexttype = 'e'
		(*struct {
			Fre          uintptr
			Fnow         uintptr
			Fstop        uintptr
			Fsavenow     uintptr
			Fsavestop    uintptr
			Ferr         int32
			Fcflags      int32
			Flasttype    int32
			Fnexttype    int32
			Fnextvalue   Chr
			F__ccgo_pad1 [2]byte
			Flexcon      int32
			Fnsubexp     int32
			F__ccgo_pad2 [4]byte
			Fsubs        uintptr
			Fnsubs       Size_t
			Fsub10       [10]uintptr
			Fnfa         uintptr
			Fcm          uintptr
			Fnlcolor     Color
			F__ccgo_pad3 [6]byte
			Fwordchrs    uintptr
			Ftree        uintptr
			Ftreechain   uintptr
			Ftreefree    uintptr
			Fntree       int32
			F__ccgo_pad4 [4]byte
			Fcv          uintptr
			Fcv2         uintptr
			Flacons      uintptr
			Fnlacons     int32
			F__ccgo_pad5 [4]byte
			Fspaceused   Size_t
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fnow         uintptr
				Fstop        uintptr
				Fsavenow     uintptr
				Fsavestop    uintptr
				Ferr         int32
				Fcflags      int32
				Flasttype    int32
				Fnexttype    int32
				Fnextvalue   Chr
				F__ccgo_pad1 [2]byte
				Flexcon      int32
				Fnsubexp     int32
				F__ccgo_pad2 [4]byte
				Fsubs        uintptr
				Fnsubs       Size_t
				Fsub10       [10]uintptr
				Fnfa         uintptr
				Fcm          uintptr
				Fnlcolor     Color
				F__ccgo_pad3 [6]byte
				Fwordchrs    uintptr
				Ftree        uintptr
				Ftreechain   uintptr
				Ftreefree    uintptr
				Fntree       int32
				F__ccgo_pad4 [4]byte
				Fcv          uintptr
				Fcv2         uintptr
				Flacons      uintptr
				Fnlacons     int32
				F__ccgo_pad5 [4]byte
				Fspaceused   Size_t
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fnow         uintptr
					Fstop        uintptr
					Fsavenow     uintptr
					Fsavestop    uintptr
					Ferr         int32
					Fcflags      int32
					Flasttype    int32
					Fnexttype    int32
					Fnextvalue   Chr
					F__ccgo_pad1 [2]byte
					Flexcon      int32
					Fnsubexp     int32
					F__ccgo_pad2 [4]byte
					Fsubs        uintptr
					Fnsubs       Size_t
					Fsub10       [10]uintptr
					Fnfa         uintptr
					Fcm          uintptr
					Fnlcolor     Color
					F__ccgo_pad3 [6]byte
					Fwordchrs    uintptr
					Ftree        uintptr
					Ftreechain   uintptr
					Ftreefree    uintptr
					Fntree       int32
					F__ccgo_pad4 [4]byte
					Fcv          uintptr
					Fcv2         uintptr
					Flacons      uintptr
					Fnlacons     int32
					F__ccgo_pad5 [4]byte
					Fspaceused   Size_t
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ESPACE
		}()
	}
	return cv
}

var classNames = [14]uintptr{
	ts + 1183, ts + 1189, ts + 1195, ts + 1201, ts + 1207, ts + 1213, ts + 1219,
	ts + 1225, ts + 1231, ts + 1237, ts + 622, ts + 1243, ts + 1249, uintptr(0),
} /* regc_locale.c:1013:23 */

//
//  - allcases - supply cvec for all case counterparts of a chr (including itself)
//  * This is a shortcut, preferably an efficient one, for simple characters;
//  * messy cases are done via range().
//  ^ static struct cvec *allcases(struct vars *, pchr);
//
func allcases(tls *libc.TLS, v uintptr, pc Pchr) uintptr { /* regc_locale.c:1231:20: */
	var cv uintptr
	var c Chr = Chr(pc)
	var lc Chr
	var uc Chr
	var tc Chr

	lc = XTcl_UniCharToLower(tls, int32(c))
	uc = XTcl_UniCharToUpper(tls, int32(c))
	tc = XTcl_UniCharToTitle(tls, int32(c))

	if int32(tc) != int32(uc) {
		cv = getcvec(tls, v, 3, 0)
		addchr(tls, cv, int32(tc))
	} else {
		cv = getcvec(tls, v, 2, 0)
	}
	addchr(tls, cv, int32(lc))
	if int32(lc) != int32(uc) {
		addchr(tls, cv, int32(uc))
	}
	return cv
}

//
//  - cmp - chr-substring compare
//  * Backrefs need this.  It should preferably be efficient.
//  * Note that it does not need to report anything except equal/unequal.
//  * Note also that the length is exact, and the comparison should not
//  * stop at embedded NULs!
//  ^ static int cmp(const chr *, const chr *, size_t);
//
func cmp(tls *libc.TLS, x uintptr, y uintptr, len Size_t) int32 { /* regc_locale.c:1266:1: */
	return libc.Xmemcmp(tls, x, y, len*Size_t(unsafe.Sizeof(Chr(0))))
}

//
//  - casecmp - case-independent chr-substring compare
//  * REG_ICASE backrefs need this.  It should preferably be efficient.
//  * Note that it does not need to report anything except equal/unequal.
//  * Note also that the length is exact, and the comparison should not
//  * stop at embedded NULs!
//  ^ static int casecmp(const chr *, const chr *, size_t);
//
func casecmp(tls *libc.TLS, x uintptr, y uintptr, len Size_t) int32 { /* regc_locale.c:1282:1: */
__1:
	if !(len > uint64(0)) {
		goto __3
	}
	{
		if int32(*(*Chr)(unsafe.Pointer(x))) != int32(*(*Chr)(unsafe.Pointer(y))) && int32(XTcl_UniCharToLower(tls, int32(*(*Chr)(unsafe.Pointer(x))))) != int32(XTcl_UniCharToLower(tls, int32(*(*Chr)(unsafe.Pointer(y))))) {
			return 1
		}

	}
	goto __2
__2:
	len--
	x += 2
	y += 2
	goto __1
	goto __3
__3:
	;
	return 0
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Magic for allocating a variable workspace. This default version is
// stack-hungry.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Unknown-error explanation.

var unk = *(*[38]int8)(unsafe.Pointer(ts + 1256)) /* regerror.c:38:19 */

// Struct to map among codes, code names, and explanations.

type Rerr = struct {
	Fcode        int32
	F__ccgo_pad1 [4]byte
	Fname        uintptr
	Fexplain     uintptr
} /* regerror.c:44:14 */

// Struct to map among codes, code names, and explanations.

var rerrs = [21]Rerr{
	// The actual table is built from regex.h
	{Fname: ts + 1294, Fexplain: ts + 1303},
	{Fcode: REG_NOMATCH, Fname: ts + 1322, Fexplain: ts + 1334},
	{Fcode: REG_BADPAT, Fname: ts + 1350, Fexplain: ts + 1361},
	{Fcode: REG_ECOLLATE, Fname: ts + 1394, Fexplain: ts + 1407},
	{Fcode: REG_ECTYPE, Fname: ts + 1433, Fexplain: ts + 1444},
	{Fcode: REG_EESCAPE, Fname: ts + 1468, Fexplain: ts + 1480},
	{Fcode: REG_ESUBREG, Fname: ts + 1506, Fexplain: ts + 1518},
	{Fcode: REG_EBRACK, Fname: ts + 1547, Fexplain: ts + 1558},
	{Fcode: REG_EPAREN, Fname: ts + 1583, Fexplain: ts + 1594},
	{Fcode: REG_EBRACE, Fname: ts + 1622, Fexplain: ts + 1633},
	{Fcode: REG_BADBR, Fname: ts + 1656, Fexplain: ts + 1666},
	{Fcode: REG_ERANGE, Fname: ts + 1694, Fexplain: ts + 1705},
	{Fcode: REG_ESPACE, Fname: ts + 1729, Fexplain: ts + 1740},
	{Fcode: REG_BADRPT, Fname: ts + 1754, Fexplain: ts + 1765},
	{Fcode: REG_ASSERT, Fname: ts + 1792, Fexplain: ts + 1803},
	{Fcode: REG_INVARG, Fname: ts + 1837, Fexplain: ts + 1848},
	{Fcode: REG_MIXED, Fname: ts + 1883, Fexplain: ts + 1893},
	{Fcode: REG_BADOPT, Fname: ts + 1937, Fexplain: ts + 1948},
	{Fcode: REG_ETOOBIG, Fname: ts + 1972, Fexplain: ts + 1984},
	{Fcode: REG_ECOLORS, Fname: ts + 2018, Fexplain: ts + 2030},
	{Fcode: -1, Fname: ts + 2046, Fexplain: ts + 2047},
} /* regerror.c:48:3 */

//
//  - regerror - the interface to error numbers
//
// ARGSUSED
func XTclReError(tls *libc.TLS, code int32, errbuf uintptr, errbuf_size Size_t) Size_t { /* regerror.c:59:1: */
	bp := tls.Alloc(112)
	defer tls.Free(112)

	var r uintptr
	var msg uintptr
	// var convbuf [88]int8 at bp+24, 88
	// 50 = plenty for int
	var len Size_t
	var icode int32

	switch code {
	case REG_ATOI: // Convert name to number
		for r = uintptr(unsafe.Pointer(&rerrs)); (*Rerr)(unsafe.Pointer(r)).Fcode >= 0; r += 24 {
			if libc.Xstrcmp(tls, (*Rerr)(unsafe.Pointer(r)).Fname, errbuf) == 0 {
				break
			}
		}
		libc.Xsprintf(tls, bp+24, ts+324, libc.VaList(bp, (*Rerr)(unsafe.Pointer(r)).Fcode)) // -1 for unknown
		msg = bp + 24                                                                        /* &convbuf[0] */
		break
	case REG_ITOA: // Convert number to name
		icode = libc.Xatoi(tls, errbuf) // Not our problem if this fails
		for r = uintptr(unsafe.Pointer(&rerrs)); (*Rerr)(unsafe.Pointer(r)).Fcode >= 0; r += 24 {
			if (*Rerr)(unsafe.Pointer(r)).Fcode == icode {
				break
			}
		}
		if (*Rerr)(unsafe.Pointer(r)).Fcode >= 0 {
			msg = (*Rerr)(unsafe.Pointer(r)).Fname
		} else { // Unknown; tell him the number
			libc.Xsprintf(tls, bp+24, ts+2052, libc.VaList(bp+8, uint32(icode)))
			msg = bp + 24 /* &convbuf[0] */
		}
		break
	default: // A real, normal error code
		for r = uintptr(unsafe.Pointer(&rerrs)); (*Rerr)(unsafe.Pointer(r)).Fcode >= 0; r += 24 {
			if (*Rerr)(unsafe.Pointer(r)).Fcode == code {
				break
			}
		}
		if (*Rerr)(unsafe.Pointer(r)).Fcode >= 0 {
			msg = (*Rerr)(unsafe.Pointer(r)).Fexplain
		} else { // Unknown; say so
			libc.Xsprintf(tls, bp+24, uintptr(unsafe.Pointer(&unk)), libc.VaList(bp+16, code))
			msg = bp + 24 /* &convbuf[0] */
		}
		break
	}

	len = libc.Xstrlen(tls, msg) + uint64(1) // Space needed, including NUL
	if errbuf_size > uint64(0) {
		if errbuf_size > len {
			libc.Xstrcpy(tls, errbuf, msg)
		} else { // Truncate to fit
			libc.Xstrncpy(tls, errbuf, msg, errbuf_size-uint64(1))
			*(*int8)(unsafe.Pointer(errbuf + uintptr(errbuf_size-uint64(1)))) = int8(0)
		}
	}

	return len
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Magic for allocating a variable workspace. This default version is
// stack-hungry.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Lazy-DFA representation.

type Arcp = struct {
	Fss          uintptr
	Fco          Color
	F__ccgo_pad1 [6]byte
} /* regexec.c:37:1 */

// Magic for allocating a variable workspace. This default version is
// stack-hungry.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Lazy-DFA representation.

type Sset = struct {
	Fstates uintptr
	Fhash   uint32
	Fflags  int32
	Fins    struct {
		Fss          uintptr
		Fco          Color
		F__ccgo_pad1 [6]byte
	}
	Flastseen uintptr
	Fouts     uintptr
	Finchain  uintptr
} /* regexec.c:37:1 */

type Dfa = struct {
	Fnssets       int32
	Fnssused      int32
	Fnstates      int32
	Fncolors      int32
	Fwordsper     int32
	F__ccgo_pad1  [4]byte
	Fssets        uintptr
	Fstatesarea   uintptr
	Fwork         uintptr
	Foutsarea     uintptr
	Fincarea      uintptr
	Fcnfa         uintptr
	Fcm           uintptr
	Flastpost     uintptr
	Flastnopr     uintptr
	Fsearch       uintptr
	Fcptsmalloced int32
	F__ccgo_pad2  [4]byte
	Fmallocarea   uintptr
} /* regexec.c:59:1 */

// Setup for non-malloc allocation for small cases.

type Smalldfa = struct {
	Fdfa struct {
		Fnssets       int32
		Fnssused      int32
		Fnstates      int32
		Fncolors      int32
		Fwordsper     int32
		F__ccgo_pad1  [4]byte
		Fssets        uintptr
		Fstatesarea   uintptr
		Fwork         uintptr
		Foutsarea     uintptr
		Fincarea      uintptr
		Fcnfa         uintptr
		Fcm           uintptr
		Flastpost     uintptr
		Flastnopr     uintptr
		Fsearch       uintptr
		Fcptsmalloced int32
		F__ccgo_pad2  [4]byte
		Fmallocarea   uintptr
	}
	Fssets [40]struct {
		Fstates uintptr
		Fhash   uint32
		Fflags  int32
		Fins    struct {
			Fss          uintptr
			Fco          Color
			F__ccgo_pad1 [6]byte
		}
		Flastseen uintptr
		Fouts     uintptr
		Finchain  uintptr
	}
	Fstatesarea  [41]uint32
	F__ccgo_pad1 [4]byte
	Foutsarea    [600]uintptr
	Fincarea     [600]struct {
		Fss          uintptr
		Fco          Color
		F__ccgo_pad1 [6]byte
	}
} /* regexec.c:87:1 */

// automatically gathered by fwd; do not hand-edit
// =====^!^===== end forwards =====^!^=====

//
//  - exec - match regular expression
//  ^ int exec(regex_t *, const chr *, size_t, rm_detail_t *,
//  ^					size_t, regmatch_t [], int);
//
func XTclReExec(tls *libc.TLS, re uintptr, string uintptr, len Size_t, details uintptr, nmatch Size_t, pmatch uintptr, flags int32) int32 { /* regexec.c:164:1: */
	bp := tls.Alloc(640)
	defer tls.Free(640)
	var v uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&varsKey1)), int32(unsafe.Sizeof(struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	}{})))
	var st int32
	var backref int32
	var n Size_t
	var i Size_t
	// var mat [20]Regmatch_t at bp, 320

	// var subdfas [40]uintptr at bp+320, 320

	// Sanity checks.

	if re == uintptr(0) || string == uintptr(0) || (*Regex_t)(unsafe.Pointer(re)).Fre_magic != REMAGIC {

		return REG_INVARG
	}
	if uint64((*Regex_t)(unsafe.Pointer(re)).Fre_csize) != uint64(unsafe.Sizeof(Chr(0))) {

		return REG_MIXED
	}

	// Setup.

	(*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fre = re
	(*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg = (*Regex_t)(unsafe.Pointer(re)).Fre_guts
	if (*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Fcflags&REG_EXPECT != 0 && details == uintptr(0) {

		return REG_INVARG
	}
	if (*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Finfo&int64(REG_UIMPOSSIBLE) != 0 {

		return REG_NOMATCH
	}
	if (*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Finfo&int64(REG_UBACKREF) != 0 {
		backref = 1
	} else {
		backref = 0
	}
	(*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Feflags = flags
	if (*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Fcflags&REG_NOSUB != 0 {
		nmatch = uint64(0) // override client
	}
	(*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fnmatch = nmatch
	if backref != 0 {
		// Need work area.

		if (*Guts)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fg)).Fnsub+uint64(1) <= uint64(LOCALMAT) {
			(*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fpmatch = bp /* &mat[0] */
		} else {
			(*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fpmatch = XTclpAlloc(tls, uint32(((*Guts)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fg)).Fnsub+uint64(1))*Size_t(unsafe.Sizeof(Regmatch_t{}))))
		}
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fpmatch == uintptr(0) {

			return REG_ESPACE
		}
		(*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fnmatch = (*Guts)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fg)).Fnsub + uint64(1)
	} else {
		(*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fpmatch = pmatch
	}
	(*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fdetails = details
	(*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstart = string
	(*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstop = string + uintptr(len)*2
	(*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Ferr = 0

	n = Size_t((*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Fntree)
	if n <= uint64(LOCALDFAS) {
		(*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fsubdfas = bp + 320 /* &subdfas[0] */
	} else {
		(*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fsubdfas = XTclpAlloc(tls, uint32(n*Size_t(unsafe.Sizeof(uintptr(0)))))
	}
	if (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fsubdfas == uintptr(0) {
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fpmatch != pmatch && (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fpmatch != bp {
			XTclpFree(tls, (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fpmatch)
		}

		return REG_ESPACE
	}
	for i = uint64(0); i < n; i++ {
		*(*uintptr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fsubdfas + uintptr(i)*8)) = uintptr(0)
	}

	// Do it.

	if backref != 0 {
		st = complicatedFind(tls, v, (*Guts)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fg)).Ftree+48, (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fg+96)
	} else {
		st = simpleFind(tls, v, (*Guts)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fg)).Ftree+48, (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fg+96)
	}

	// Copy (portion of) match vector over if necessary.

	if st == REG_OKAY && (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch != pmatch && nmatch > uint64(0) {
		zapallsubs(tls, pmatch, nmatch)
		if nmatch < (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fnmatch {
			n = nmatch
		} else {
			n = (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fnmatch
		}
		libc.Xmemcpy(tls, pmatch, (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fpmatch, n*Size_t(unsafe.Sizeof(Regmatch_t{})))
	}

	// Clean up.

	if (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch != pmatch && (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch != bp {
		XTclpFree(tls, (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fpmatch)
	}
	n = Size_t((*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Fntree)
	for i = uint64(0); i < n; i++ {
		if *(*uintptr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fsubdfas + uintptr(i)*8)) != uintptr(0) {
			freeDFA(tls, *(*uintptr)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fsubdfas + uintptr(i)*8)))
		}
	}
	if (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fsubdfas != bp+320 {
		XTclpFree(tls, (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fsubdfas)
	}

	return st
}

var varsKey1 Tcl_ThreadDataKey /* regexec.c:173:5: */

//
//  - getsubdfa - create or re-fetch the DFA for a subre node
//  * We only need to create the DFA once per overall regex execution.
//  * The DFA will be freed by the cleanup step in exec().
//
func getsubdfa(tls *libc.TLS, v uintptr, t uintptr) uintptr { /* regexec.c:297:19: */
	if *(*uintptr)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fsubdfas + uintptr((*Subre)(unsafe.Pointer(t)).Fid)*8)) == uintptr(0) {
		*(*uintptr)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fsubdfas + uintptr((*Subre)(unsafe.Pointer(t)).Fid)*8)) = newDFA(tls, v, t+48, (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fg+96, uintptr(0))
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			return uintptr(0)
		}
	}
	return *(*uintptr)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fsubdfas + uintptr((*Subre)(unsafe.Pointer(t)).Fid)*8))
}

//
//  - simpleFind - find a match for the main NFA (no-complications case)
//  ^ static int simpleFind(struct vars *, struct cnfa *, struct colormap *);
//
func simpleFind(tls *libc.TLS, v uintptr, cnfa uintptr, cm uintptr) int32 { /* regexec.c:314:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var s uintptr
	var d uintptr
	var begin uintptr
	var end uintptr = uintptr(0)
	// var cold uintptr at bp, 8

	var open uintptr
	var close uintptr // Open and close of range of possible
	// starts
	// var hitend int32 at bp+8, 4

	var shorter int32
	if int32((*Subre)(unsafe.Pointer((*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Ftree)).Fflags)&SHORTER != 0 {
		shorter = 1
	} else {
		shorter = 0
	}

	// First, a shot with the search RE.

	s = newDFA(tls, v, (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg+32, cm, v+80)

	{
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr
		}
	}

	{
	}

	*(*uintptr)(unsafe.Pointer(bp /* cold */)) = uintptr(0)
	close = shortest(tls, v, s, (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstart, (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstart, (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstop, bp, uintptr(0))
	freeDFA(tls, s)
	{
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr
		}
	}

	if (*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Fcflags&REG_EXPECT != 0 {

		if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			(*Rm_detail_t)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = (int64(*(*uintptr)(unsafe.Pointer(bp))) - int64((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstart)) / 2
		} else {
			(*Rm_detail_t)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = (int64((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstop) - int64((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstart)) / 2
		}
		(*Rm_detail_t)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_eo = (int64((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fstop) - int64((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fstart)) / 2 // unknown
	}
	if close == uintptr(0) { // not found
		return REG_NOMATCH
	}
	if (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fnmatch == uint64(0) { // found, don't need exact location
		return REG_OKAY
	}

	// Find starting point and match.

	open = *(*uintptr)(unsafe.Pointer(bp /* cold */))
	*(*uintptr)(unsafe.Pointer(bp /* cold */)) = uintptr(0)
	{
	}

	d = newDFA(tls, v, cnfa, cm, v+80)

	{
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr
		}
	}

	for begin = open; begin <= close; begin += 2 {
		{
		}

		if shorter != 0 {
			end = shortest(tls, v, d, begin, begin, (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstop, uintptr(0), bp+8)
		} else {
			end = longest(tls, v, d, begin, (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstop, bp+8)
		}
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			freeDFA(tls, d)
			return (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr
		}
		if *(*int32)(unsafe.Pointer(bp + 8)) != 0 && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
			*(*uintptr)(unsafe.Pointer(bp /* cold */)) = begin
		}
		if end != uintptr(0) {
			break // NOTE BREAK OUT
		}
	}
	// search RE succeeded so loop should
	freeDFA(tls, d)

	// And pin down details.

	(*Regmatch_t)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch)).Frm_so = (int64(begin) - int64((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstart)) / 2
	(*Regmatch_t)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch)).Frm_eo = (int64(end) - int64((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstart)) / 2
	if (*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Fcflags&REG_EXPECT != 0 {
		if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			(*Rm_detail_t)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = (int64(*(*uintptr)(unsafe.Pointer(bp))) - int64((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstart)) / 2
		} else {
			(*Rm_detail_t)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = (int64((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstop) - int64((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstart)) / 2
		}
		(*Rm_detail_t)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_eo = (int64((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fstop) - int64((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fstart)) / 2 // unknown
	}
	if (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fnmatch == uint64(1) { // no need for submatches
		return REG_OKAY
	}

	// Find submatches.

	zapallsubs(tls, (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch, (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fnmatch)
	return cdissect(tls, v, (*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Ftree, begin, end)
}

//
//  - complicatedFind - find a match for the main NFA (with complications)
//  ^ static int complicatedFind(struct vars *, struct cnfa *, struct colormap *);
//
func complicatedFind(tls *libc.TLS, v uintptr, cnfa uintptr, cm uintptr) int32 { /* regexec.c:419:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var s uintptr
	var d uintptr
	*(*uintptr)(unsafe.Pointer(bp /* cold */)) = uintptr(0) // silence gcc 4 warning
	var ret int32

	s = newDFA(tls, v, (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg+32, cm, v+80)
	{
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr
		}
	}

	d = newDFA(tls, v, cnfa, cm, v+17008)
	if (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Ferr != 0 {

		freeDFA(tls, s)
		return (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr
	}

	ret = complicatedFindLoop(tls, v, d, s, bp)

	freeDFA(tls, d)
	freeDFA(tls, s)
	{
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr
		}
	}

	if (*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Fcflags&REG_EXPECT != 0 {

		if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			(*Rm_detail_t)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = (int64(*(*uintptr)(unsafe.Pointer(bp))) - int64((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstart)) / 2
		} else {
			(*Rm_detail_t)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = (int64((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstop) - int64((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstart)) / 2
		}
		(*Rm_detail_t)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_eo = (int64((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fstop) - int64((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fstart)) / 2 // unknown
	}
	return ret
}

//
//  - complicatedFindLoop - the heart of complicatedFind
//  ^ static int complicatedFindLoop(struct vars *,
//  ^	struct dfa *, struct dfa *, chr **);
//
func complicatedFindLoop(tls *libc.TLS, v uintptr, d uintptr, s uintptr, coldp uintptr) int32 { /* regexec.c:460:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var begin uintptr
	var end uintptr
	// var cold uintptr at bp, 8

	var open uintptr
	var close uintptr // Open and close of range of possible
	// starts
	var estart uintptr
	var estop uintptr
	var er int32
	// var hitend int32 at bp+8, 4

	var shorter int32 = int32((*Subre)(unsafe.Pointer((*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Ftree)).Fflags) & SHORTER

	*(*uintptr)(unsafe.Pointer(bp /* cold */)) = uintptr(0)
	close = (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstart
	for ok := true; ok; ok = close < (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstop {
		{
		}

		close = shortest(tls, v, s, close, close, (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fstop, bp, uintptr(0))
		if close == uintptr(0) {
			break // NOTE BREAK
		}

		open = *(*uintptr)(unsafe.Pointer(bp /* cold */))
		*(*uintptr)(unsafe.Pointer(bp /* cold */)) = uintptr(0)
		{
		}

		for begin = open; begin <= close; begin += 2 {
			{
			}

			estart = begin
			estop = (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fstop
			for {
				if shorter != 0 {
					end = shortest(tls, v, d, begin, estart, estop, uintptr(0), bp+8)
				} else {
					end = longest(tls, v, d, begin, estop, bp+8)
				}
				if *(*int32)(unsafe.Pointer(bp + 8)) != 0 && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
					*(*uintptr)(unsafe.Pointer(bp /* cold */)) = begin
				}
				if end == uintptr(0) {
					break // NOTE BREAK OUT
				}

				{
				}

				zapallsubs(tls, (*struct {
					Fre          uintptr
					Fg           uintptr
					Feflags      int32
					F__ccgo_pad1 [4]byte
					Fnmatch      Size_t
					Fpmatch      uintptr
					Fdetails     uintptr
					Fstart       uintptr
					Fstop        uintptr
					Ferr         int32
					F__ccgo_pad2 [4]byte
					Fsubdfas     uintptr
					Fdfa1        Smalldfa
					Fdfa2        Smalldfa
				})(unsafe.Pointer(v)).Fpmatch, (*struct {
					Fre          uintptr
					Fg           uintptr
					Feflags      int32
					F__ccgo_pad1 [4]byte
					Fnmatch      Size_t
					Fpmatch      uintptr
					Fdetails     uintptr
					Fstart       uintptr
					Fstop        uintptr
					Ferr         int32
					F__ccgo_pad2 [4]byte
					Fsubdfas     uintptr
					Fdfa1        Smalldfa
					Fdfa2        Smalldfa
				})(unsafe.Pointer(v)).Fnmatch)
				er = cdissect(tls, v, (*Guts)(unsafe.Pointer((*struct {
					Fre          uintptr
					Fg           uintptr
					Feflags      int32
					F__ccgo_pad1 [4]byte
					Fnmatch      Size_t
					Fpmatch      uintptr
					Fdetails     uintptr
					Fstart       uintptr
					Fstop        uintptr
					Ferr         int32
					F__ccgo_pad2 [4]byte
					Fsubdfas     uintptr
					Fdfa1        Smalldfa
					Fdfa2        Smalldfa
				})(unsafe.Pointer(v)).Fg)).Ftree, begin, end)
				if er == REG_OKAY {
					if (*struct {
						Fre          uintptr
						Fg           uintptr
						Feflags      int32
						F__ccgo_pad1 [4]byte
						Fnmatch      Size_t
						Fpmatch      uintptr
						Fdetails     uintptr
						Fstart       uintptr
						Fstop        uintptr
						Ferr         int32
						F__ccgo_pad2 [4]byte
						Fsubdfas     uintptr
						Fdfa1        Smalldfa
						Fdfa2        Smalldfa
					})(unsafe.Pointer(v)).Fnmatch > uint64(0) {
						(*Regmatch_t)(unsafe.Pointer((*struct {
							Fre          uintptr
							Fg           uintptr
							Feflags      int32
							F__ccgo_pad1 [4]byte
							Fnmatch      Size_t
							Fpmatch      uintptr
							Fdetails     uintptr
							Fstart       uintptr
							Fstop        uintptr
							Ferr         int32
							F__ccgo_pad2 [4]byte
							Fsubdfas     uintptr
							Fdfa1        Smalldfa
							Fdfa2        Smalldfa
						})(unsafe.Pointer(v)).Fpmatch)).Frm_so = (int64(begin) - int64((*struct {
							Fre          uintptr
							Fg           uintptr
							Feflags      int32
							F__ccgo_pad1 [4]byte
							Fnmatch      Size_t
							Fpmatch      uintptr
							Fdetails     uintptr
							Fstart       uintptr
							Fstop        uintptr
							Ferr         int32
							F__ccgo_pad2 [4]byte
							Fsubdfas     uintptr
							Fdfa1        Smalldfa
							Fdfa2        Smalldfa
						})(unsafe.Pointer(v)).Fstart)) / 2
						(*Regmatch_t)(unsafe.Pointer((*struct {
							Fre          uintptr
							Fg           uintptr
							Feflags      int32
							F__ccgo_pad1 [4]byte
							Fnmatch      Size_t
							Fpmatch      uintptr
							Fdetails     uintptr
							Fstart       uintptr
							Fstop        uintptr
							Ferr         int32
							F__ccgo_pad2 [4]byte
							Fsubdfas     uintptr
							Fdfa1        Smalldfa
							Fdfa2        Smalldfa
						})(unsafe.Pointer(v)).Fpmatch)).Frm_eo = (int64(end) - int64((*struct {
							Fre          uintptr
							Fg           uintptr
							Feflags      int32
							F__ccgo_pad1 [4]byte
							Fnmatch      Size_t
							Fpmatch      uintptr
							Fdetails     uintptr
							Fstart       uintptr
							Fstop        uintptr
							Ferr         int32
							F__ccgo_pad2 [4]byte
							Fsubdfas     uintptr
							Fdfa1        Smalldfa
							Fdfa2        Smalldfa
						})(unsafe.Pointer(v)).Fstart)) / 2
					}
					*(*uintptr)(unsafe.Pointer(coldp)) = *(*uintptr)(unsafe.Pointer(bp /* cold */))
					return REG_OKAY
				}
				if er != REG_NOMATCH {
					(*struct {
						Fre          uintptr
						Fg           uintptr
						Feflags      int32
						F__ccgo_pad1 [4]byte
						Fnmatch      Size_t
						Fpmatch      uintptr
						Fdetails     uintptr
						Fstart       uintptr
						Fstop        uintptr
						Ferr         int32
						F__ccgo_pad2 [4]byte
						Fsubdfas     uintptr
						Fdfa1        Smalldfa
						Fdfa2        Smalldfa
					})(unsafe.Pointer(v)).Ferr = func() int32 {
						if (*struct {
							Fre          uintptr
							Fg           uintptr
							Feflags      int32
							F__ccgo_pad1 [4]byte
							Fnmatch      Size_t
							Fpmatch      uintptr
							Fdetails     uintptr
							Fstart       uintptr
							Fstop        uintptr
							Ferr         int32
							F__ccgo_pad2 [4]byte
							Fsubdfas     uintptr
							Fdfa1        Smalldfa
							Fdfa2        Smalldfa
						})(unsafe.Pointer(v)).Ferr != 0 {
							return (*struct {
								Fre          uintptr
								Fg           uintptr
								Feflags      int32
								F__ccgo_pad1 [4]byte
								Fnmatch      Size_t
								Fpmatch      uintptr
								Fdetails     uintptr
								Fstart       uintptr
								Fstop        uintptr
								Ferr         int32
								F__ccgo_pad2 [4]byte
								Fsubdfas     uintptr
								Fdfa1        Smalldfa
								Fdfa2        Smalldfa
							})(unsafe.Pointer(v)).Ferr
						}
						return er
					}()
					*(*uintptr)(unsafe.Pointer(coldp)) = *(*uintptr)(unsafe.Pointer(bp /* cold */))
					return er
				}
				if func() int32 {
					if shorter != 0 {
						return libc.Bool32(end == estop)
					}
					return libc.Bool32(end == begin)
				}() != 0 {
					break
				}

				// Go around and try again

				if shorter != 0 {
					estart = end + uintptr(1)*2
				} else {
					estop = end - uintptr(1)*2
				}
			}
		}
	}

	*(*uintptr)(unsafe.Pointer(coldp)) = *(*uintptr)(unsafe.Pointer(bp /* cold */))
	return REG_NOMATCH
}

//
//  - zapallsubs - initialize all subexpression matches to "no match"
//  ^ static void zapallsubs(regmatch_t *, size_t);
//
func zapallsubs(tls *libc.TLS, p uintptr, n Size_t) { /* regexec.c:546:1: */
	var i Size_t

	for i = n - uint64(1); i > uint64(0); i-- {
		(*Regmatch_t)(unsafe.Pointer(p + uintptr(i)*16)).Frm_so = int64(-1)
		(*Regmatch_t)(unsafe.Pointer(p + uintptr(i)*16)).Frm_eo = int64(-1)
	}
}

//
//  - zaptreesubs - initialize subexpressions within subtree to "no match"
//  ^ static void zaptreesubs(struct vars *, struct subre *);
//
func zaptreesubs(tls *libc.TLS, v uintptr, t uintptr) { /* regexec.c:563:1: */
	if int32((*Subre)(unsafe.Pointer(t)).Fop) == '(' {
		var n int32 = (*Subre)(unsafe.Pointer(t)).Fsubno

		if Size_t(n) < (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fnmatch {
			(*Regmatch_t)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16)).Frm_so = int64(-1)
			(*Regmatch_t)(unsafe.Pointer((*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16)).Frm_eo = int64(-1)
		}
	}

	if (*Subre)(unsafe.Pointer(t)).Fleft != uintptr(0) {
		zaptreesubs(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft)
	}
	if (*Subre)(unsafe.Pointer(t)).Fright != uintptr(0) {
		zaptreesubs(tls, v, (*Subre)(unsafe.Pointer(t)).Fright)
	}
}

//
//  - subset - set subexpression match data for a successful subre
//  ^ static void subset(struct vars *, struct subre *, chr *, chr *);
//
func subset(tls *libc.TLS, v uintptr, sub uintptr, begin uintptr, end uintptr) { /* regexec.c:589:1: */
	var n int32 = (*Subre)(unsafe.Pointer(sub)).Fsubno

	if Size_t(n) >= (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fnmatch {
		return
	}

	{
	}

	(*Regmatch_t)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16)).Frm_so = (int64(begin) - int64((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstart)) / 2
	(*Regmatch_t)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16)).Frm_eo = (int64(end) - int64((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstart)) / 2
}

//
//  - cdissect - check backrefs and determine subexpression matches
//  * cdissect recursively processes a subre tree to check matching of backrefs
//  * and/or identify submatch boundaries for capture nodes.  The proposed match
//  * runs from "begin" to "end" (not including "end"), and we are basically
//  * "dissecting" it to see where the submatches are.
//  * Before calling any level of cdissect, the caller must have run the node's
//  * DFA and found that the proposed substring satisfies the DFA.  (We make
//  * the caller do that because in concatenation and iteration nodes, it's
//  * much faster to check all the substrings against the child DFAs before we
//  * recurse.)  Also, caller must have cleared subexpression match data via
//  * zaptreesubs (or zapallsubs at the top level).
//  ^ static int cdissect(struct vars *, struct subre *, chr *, chr *);
//
func cdissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) int32 { /* regexec.c:622:1: */
	var er int32

	{
	}

	switch int32((*Subre)(unsafe.Pointer(t)).Fop) {
	case '=': // terminal node

		er = REG_OKAY // no action, parent did the work
		break
	case 'b': // back reference

		er = cbrdissect(tls, v, t, begin, end)
		break
	case '.': // concatenation

		if int32((*Subre)(unsafe.Pointer((*Subre)(unsafe.Pointer(t)).Fleft)).Fflags)&SHORTER != 0 { // reverse scan
			er = crevcondissect(tls, v, t, begin, end)
		} else {
			er = ccondissect(tls, v, t, begin, end)
		}
		break
	case '|': // alternation

		er = caltdissect(tls, v, t, begin, end)
		break
	case '*': // iteration

		if int32((*Subre)(unsafe.Pointer((*Subre)(unsafe.Pointer(t)).Fleft)).Fflags)&SHORTER != 0 { // reverse scan
			er = creviterdissect(tls, v, t, begin, end)
		} else {
			er = citerdissect(tls, v, t, begin, end)
		}
		break
	case '(': // capturing

		er = cdissect(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft, begin, end)
		if er == REG_OKAY {
			subset(tls, v, t, begin, end)
		}
		break
	default:
		er = REG_ASSERT
		break
	}

	// We should never have a match failure unless backrefs lurk below;
	// otherwise, either caller failed to check the DFA, or there's some
	// inconsistency between the DFA and the node's innards.

	return er
}

//
//  - ccondissect - dissect match for concatenation node
//  ^ static int ccondissect(struct vars *, struct subre *, chr *, chr *);
//
func ccondissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) int32 { /* regexec.c:688:1: */
	var d uintptr
	var d2 uintptr
	var mid uintptr

	d = getsubdfa(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft)
	{
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr
		}
	}

	d2 = getsubdfa(tls, v, (*Subre)(unsafe.Pointer(t)).Fright)
	{
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr
		}
	}

	{
	}

	// Pick a tentative midpoint.
	mid = longest(tls, v, d, begin, end, uintptr(0))
	if mid == uintptr(0) {
		return REG_NOMATCH
	}
	{
	}

	// Iterate until satisfaction or failure.

	for {
		// Try this midpoint on for size.

		if longest(tls, v, d2, mid, end, uintptr(0)) == end {
			var er int32 = cdissect(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft, begin, mid)

			if er == REG_OKAY {
				er = cdissect(tls, v, (*Subre)(unsafe.Pointer(t)).Fright, mid, end)
				if er == REG_OKAY {
					/*
					 * Satisfaction.
					 */

					{
					}

					return REG_OKAY
				}
			}
			if er != REG_NOMATCH {
				return er
			}
		}

		// That midpoint didn't work, find a new one.

		if mid == begin {
			/*
			 * All possibilities exhausted.
			 */

			{
			}

			return REG_NOMATCH
		}
		mid = longest(tls, v, d, begin, mid-uintptr(1)*2, uintptr(0))
		if mid == uintptr(0) {
			/*
			 * Failed to find a new one.
			 */

			{
			}

			return REG_NOMATCH
		}
		{
		}

		zaptreesubs(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft)
		zaptreesubs(tls, v, (*Subre)(unsafe.Pointer(t)).Fright)
	}
	return int32(0)
}

//
//  - crevcondissect - dissect match for concatenation node, shortest-first
//  ^ static int crevcondissect(struct vars *, struct subre *, chr *, chr *);
//
func crevcondissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) int32 { /* regexec.c:778:1: */
	var d uintptr
	var d2 uintptr
	var mid uintptr

	d = getsubdfa(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft)
	{
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr
		}
	}

	d2 = getsubdfa(tls, v, (*Subre)(unsafe.Pointer(t)).Fright)
	{
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr
		}
	}

	{
	}

	// Pick a tentative midpoint.

	mid = shortest(tls, v, d, begin, begin, end, uintptr(0), uintptr(0))
	if mid == uintptr(0) {
		return REG_NOMATCH
	}
	{
	}

	// Iterate until satisfaction or failure.

	for {
		// Try this midpoint on for size.

		if longest(tls, v, d2, mid, end, uintptr(0)) == end {
			var er int32 = cdissect(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft, begin, mid)

			if er == REG_OKAY {
				er = cdissect(tls, v, (*Subre)(unsafe.Pointer(t)).Fright, mid, end)
				if er == REG_OKAY {
					/*
					 * Satisfaction.
					 */

					{
					}

					return REG_OKAY
				}
			}
			if er != REG_NOMATCH {
				return er
			}
		}

		// That midpoint didn't work, find a new one.

		if mid == end {
			/*
			 * All possibilities exhausted.
			 */

			{
			}

			return REG_NOMATCH
		}
		mid = shortest(tls, v, d, begin, mid+uintptr(1)*2, end, uintptr(0), uintptr(0))
		if mid == uintptr(0) {
			/*
			 * Failed to find a new one.
			 */

			{
			}

			return REG_NOMATCH
		}
		{
		}

		zaptreesubs(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft)
		zaptreesubs(tls, v, (*Subre)(unsafe.Pointer(t)).Fright)
	}
	return int32(0)
}

//
//  - cbrdissect - dissect match for backref node
//  ^ static int cbrdissect(struct vars *, struct subre *, chr *, chr *);
//
func cbrdissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) int32 { /* regexec.c:869:1: */
	var n int32 = (*Subre)(unsafe.Pointer(t)).Fsubno
	var min int32 = int32((*Subre)(unsafe.Pointer(t)).Fmin)
	var max int32 = int32((*Subre)(unsafe.Pointer(t)).Fmax)
	var numreps Size_t
	var tlen Size_t
	var brlen Size_t
	var brstring uintptr
	var p uintptr

	{
	}

	// get the backreferenced string
	if (*Regmatch_t)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch+uintptr(n)*16)).Frm_so == int64(-1) {
		return REG_NOMATCH
	}
	brstring = (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstart + uintptr((*Regmatch_t)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch+uintptr(n)*16)).Frm_so)*2
	brlen = Size_t((*Regmatch_t)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch+uintptr(n)*16)).Frm_eo - (*Regmatch_t)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fpmatch+uintptr(n)*16)).Frm_so)

	// special cases for zero-length strings
	if brlen == uint64(0) {
		// matches only if target is zero length, but any number of
		// repetitions can be considered to be present
		if begin == end && min <= max {
			{
			}

			return REG_OKAY
		}
		return REG_NOMATCH
	}
	if begin == end {
		// matches only if zero repetitions are okay
		if min == 0 {
			{
			}

			return REG_OKAY
		}
		return REG_NOMATCH
	}

	// check target length to see if it could possibly be an allowed number of
	// repetitions of brstring

	tlen = Size_t((int64(end) - int64(begin)) / 2)
	if tlen%brlen != uint64(0) {
		return REG_NOMATCH
	}
	numreps = tlen / brlen
	if numreps < Size_t(min) || numreps > Size_t(max) && max != X_POSIX2_RE_DUP_MAX+1 {
		return REG_NOMATCH
	}

	// okay, compare the actual string contents
	p = begin
	for libc.PostDecUint64(&numreps, 1) > uint64(0) {
		if (*struct {
			f func(*libc.TLS, uintptr, uintptr, Size_t) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Guts)(unsafe.Pointer((*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fg)).Fcompare})).f(tls, brstring, p, brlen) != 0 {
			return REG_NOMATCH
		}
		p += 2 * uintptr(brlen)
	}

	{
	}

	return REG_OKAY
}

//
//  - caltdissect - dissect match for alternation node
//  ^ static int caltdissect(struct vars *, struct subre *, chr *, chr *);
//
func caltdissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) int32 { /* regexec.c:947:1: */
	var d uintptr
	var er int32

	// We loop, rather than tail-recurse, to handle a chain of alternatives
	for t != uintptr(0) {

		{
		}

		d = getsubdfa(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft)
		{
			if (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fg           uintptr
					Feflags      int32
					F__ccgo_pad1 [4]byte
					Fnmatch      Size_t
					Fpmatch      uintptr
					Fdetails     uintptr
					Fstart       uintptr
					Fstop        uintptr
					Ferr         int32
					F__ccgo_pad2 [4]byte
					Fsubdfas     uintptr
					Fdfa1        Smalldfa
					Fdfa2        Smalldfa
				})(unsafe.Pointer(v)).Ferr
			}
		}

		if longest(tls, v, d, begin, end, uintptr(0)) == end {
			{
			}

			er = cdissect(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft, begin, end)
			if er != REG_NOMATCH {
				return er
			}
		}

		t = (*Subre)(unsafe.Pointer(t)).Fright
	}

	return REG_NOMATCH
}

//
//  - citerdissect - dissect match for iteration node
//  ^ static int citerdissect(struct vars *, struct subre *, chr *, chr *);
//
func citerdissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) int32 { /* regexec.c:984:1: */
	var d uintptr
	var endpts uintptr
	var limit uintptr
	var min_matches int32
	var max_matches Size_t
	var nverified int32
	var k int32
	var i int32
	var er int32
	var prev_end uintptr

	// If zero matches are allowed, and target string is empty, just declare
	// victory.  OTOH, if target string isn't empty, zero matches can't work
	// so we pretend the min is 1.
	min_matches = int32((*Subre)(unsafe.Pointer(t)).Fmin)
	if !(min_matches <= 0) {
		goto __1
	}
	if !(begin == end) {
		goto __2
	}
	return REG_OKAY
__2:
	;
	min_matches = 1
__1:
	;

	// We need workspace to track the endpoints of each sub-match.  Normally
	// we consider only nonzero-length sub-matches, so there can be at most
	// end-begin of them.  However, if min is larger than that, we will also
	// consider zero-length sub-matches in order to find enough matches.
	//
	// For convenience, endpts[0] contains the "begin" pointer and we store
	// sub-match endpoints in endpts[1..max_matches].
	max_matches = Size_t((int64(end) - int64(begin)) / 2)
	if !(max_matches > Size_t((*Subre)(unsafe.Pointer(t)).Fmax) && int32((*Subre)(unsafe.Pointer(t)).Fmax) != X_POSIX2_RE_DUP_MAX+1) {
		goto __3
	}
	max_matches = Size_t((*Subre)(unsafe.Pointer(t)).Fmax)
__3:
	;
	if !(max_matches < Size_t(min_matches)) {
		goto __4
	}
	max_matches = Size_t(min_matches)
__4:
	;
	endpts = XTclpAlloc(tls, uint32((max_matches+uint64(1))*Size_t(unsafe.Sizeof(uintptr(0)))))
	if !(endpts == uintptr(0)) {
		goto __5
	}
	return REG_ESPACE
__5:
	;
	*(*uintptr)(unsafe.Pointer(endpts)) = begin

	d = getsubdfa(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft)
	if !((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Ferr != 0) {
		goto __6
	}
	XTclpFree(tls, endpts)
	return (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Ferr
__6:
	;

	// Our strategy is to first find a set of sub-match endpoints that are
	// valid according to the child node's DFA, and then recursively dissect
	// each sub-match to confirm validity.  If any validity check fails,
	// backtrack the last sub-match and try again.  And, when we next try for
	// a validity check, we need not recheck any successfully verified
	// sub-matches that we didn't move the endpoints of.  nverified remembers
	// how many sub-matches are currently known okay.

	// initialize to consider first sub-match
	nverified = 0
	k = 1
	limit = end

	// iterate until satisfaction or failure
__7:
	if !(k > 0) {
		goto __8
	}
	// try to find an endpoint for the k'th sub-match
	*(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) = longest(tls, v, d, *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-1)*8)), limit, uintptr(0))
	if !(*(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) == uintptr(0)) {
		goto __9
	}
	// no match possible, so see if we can shorten previous one
	k--
	goto backtrack
__9:
	;

	// k'th sub-match can no longer be considered verified
	if !(nverified >= k) {
		goto __10
	}
	nverified = k - 1
__10:
	;

	if !(*(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) != end) {
		goto __11
	}
	// haven't reached end yet, try another iteration if allowed
	if !(Size_t(k) >= max_matches) {
		goto __12
	}
	// must try to shorten some previous match
	k--
	goto backtrack
__12:
	;

	// reject zero-length match unless necessary to achieve min
	if !(*(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) == *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-1)*8)) && (k >= min_matches || int64(min_matches-k) < (int64(end)-int64(*(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8))))/2)) {
		goto __13
	}
	goto backtrack
__13:
	;

	k++
	limit = end
	goto __7
__11:
	;

	// We've identified a way to divide the string into k sub-matches
	// that works so far as the child DFA can tell.  If k is an allowed
	// number of matches, start the slow part: recurse to verify each
	// sub-match.  We always have k <= max_matches, needn't check that.
	if !(k < min_matches) {
		goto __14
	}
	goto backtrack
__14:
	;

	i = nverified + 1
__15:
	if !(i <= k) {
		goto __17
	}
	zaptreesubs(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft)
	er = cdissect(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft, *(*uintptr)(unsafe.Pointer(endpts + uintptr(i-1)*8)), *(*uintptr)(unsafe.Pointer(endpts + uintptr(i)*8)))
	if !(er == REG_OKAY) {
		goto __18
	}
	nverified = i
	goto __16
__18:
	;
	if !(er == REG_NOMATCH) {
		goto __19
	}
	goto __17
__19:
	;
	// oops, something failed
	XTclpFree(tls, endpts)
	return er
	goto __16
__16:
	i++
	goto __15
	goto __17
__17:
	;

	if !(i > k) {
		goto __20
	}
	/* satisfaction */

	XTclpFree(tls, endpts)
	return REG_OKAY
__20:
	;

	// match failed to verify, so backtrack

backtrack:
	// Must consider shorter versions of the current sub-match.  However,
	// we'll only ask for a zero-length match if necessary.
__21:
	if !(k > 0) {
		goto __22
	}
	prev_end = *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-1)*8))

	if !(*(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) > prev_end) {
		goto __23
	}
	limit = *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) - uintptr(1)*2
	if !(limit > prev_end || k < min_matches && int64(min_matches-k) >= (int64(end)-int64(prev_end))/2) {
		goto __24
	}
	// break out of backtrack loop, continue the outer one
	goto __22
__24:
	;
__23:
	;
	// can't shorten k'th sub-match any more, consider previous one
	k--
	goto __21
__22:
	;
	goto __7
__8:
	;

	/* all possibilities exhausted */

	XTclpFree(tls, endpts)
	return REG_NOMATCH
}

//
//  - creviterdissect - dissect match for iteration node, shortest-first
//  ^ static int creviterdissect(struct vars *, struct subre *, chr *, chr *);
//
func creviterdissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) int32 { /* regexec.c:1157:1: */
	var d uintptr
	var endpts uintptr
	var limit uintptr
	var min_matches int32
	var max_matches Size_t
	var nverified int32
	var k int32
	var i int32
	var er int32

	// If zero matches are allowed, and target string is empty, just declare
	// victory.  OTOH, if target string isn't empty, zero matches can't work
	// so we pretend the min is 1.
	min_matches = int32((*Subre)(unsafe.Pointer(t)).Fmin)
	if !(min_matches <= 0) {
		goto __1
	}
	if !(begin == end) {
		goto __2
	}
	return REG_OKAY
__2:
	;
	min_matches = 1
__1:
	;

	// We need workspace to track the endpoints of each sub-match.  Normally
	// we consider only nonzero-length sub-matches, so there can be at most
	// end-begin of them.  However, if min is larger than that, we will also
	// consider zero-length sub-matches in order to find enough matches.
	//
	// For convenience, endpts[0] contains the "begin" pointer and we store
	// sub-match endpoints in endpts[1..max_matches].
	max_matches = Size_t((int64(end) - int64(begin)) / 2)
	if !(max_matches > Size_t((*Subre)(unsafe.Pointer(t)).Fmax) && int32((*Subre)(unsafe.Pointer(t)).Fmax) != X_POSIX2_RE_DUP_MAX+1) {
		goto __3
	}
	max_matches = Size_t((*Subre)(unsafe.Pointer(t)).Fmax)
__3:
	;
	if !(max_matches < Size_t(min_matches)) {
		goto __4
	}
	max_matches = Size_t(min_matches)
__4:
	;
	endpts = XTclpAlloc(tls, uint32((max_matches+uint64(1))*Size_t(unsafe.Sizeof(uintptr(0)))))
	if !(endpts == uintptr(0)) {
		goto __5
	}
	return REG_ESPACE
__5:
	;
	*(*uintptr)(unsafe.Pointer(endpts)) = begin

	d = getsubdfa(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft)
	if !((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Ferr != 0) {
		goto __6
	}
	XTclpFree(tls, endpts)
	return (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Ferr
__6:
	;

	// Our strategy is to first find a set of sub-match endpoints that are
	// valid according to the child node's DFA, and then recursively dissect
	// each sub-match to confirm validity.  If any validity check fails,
	// backtrack the last sub-match and try again.  And, when we next try for
	// a validity check, we need not recheck any successfully verified
	// sub-matches that we didn't move the endpoints of.  nverified remembers
	// how many sub-matches are currently known okay.

	// initialize to consider first sub-match
	nverified = 0
	k = 1
	limit = begin

	// iterate until satisfaction or failure
__7:
	if !(k > 0) {
		goto __8
	}
	// disallow zero-length match unless necessary to achieve min
	if !(limit == *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-1)*8)) && limit != end && (k >= min_matches || int64(min_matches-k) < (int64(end)-int64(limit))/2)) {
		goto __9
	}
	limit += 2
__9:
	;

	// if this is the last allowed sub-match, it must reach to the end
	if !(Size_t(k) >= max_matches) {
		goto __10
	}
	limit = end
__10:
	;

	// try to find an endpoint for the k'th sub-match
	*(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) = shortest(tls, v, d, *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-1)*8)), limit, end,
		uintptr(0), uintptr(0))
	if !(*(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) == uintptr(0)) {
		goto __11
	}
	// no match possible, so see if we can lengthen previous one
	k--
	goto backtrack
__11:
	;

	// k'th sub-match can no longer be considered verified
	if !(nverified >= k) {
		goto __12
	}
	nverified = k - 1
__12:
	;

	if !(*(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) != end) {
		goto __13
	}
	// haven't reached end yet, try another iteration if allowed
	if !(Size_t(k) >= max_matches) {
		goto __14
	}
	// must try to lengthen some previous match
	k--
	goto backtrack
__14:
	;

	k++
	limit = *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-1)*8))
	goto __7
__13:
	;

	// We've identified a way to divide the string into k sub-matches
	// that works so far as the child DFA can tell.  If k is an allowed
	// number of matches, start the slow part: recurse to verify each
	// sub-match.  We always have k <= max_matches, needn't check that.
	if !(k < min_matches) {
		goto __15
	}
	goto backtrack
__15:
	;

	i = nverified + 1
__16:
	if !(i <= k) {
		goto __18
	}
	zaptreesubs(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft)
	er = cdissect(tls, v, (*Subre)(unsafe.Pointer(t)).Fleft, *(*uintptr)(unsafe.Pointer(endpts + uintptr(i-1)*8)), *(*uintptr)(unsafe.Pointer(endpts + uintptr(i)*8)))
	if !(er == REG_OKAY) {
		goto __19
	}
	nverified = i
	goto __17
__19:
	;
	if !(er == REG_NOMATCH) {
		goto __20
	}
	goto __18
__20:
	;
	// oops, something failed
	XTclpFree(tls, endpts)
	return er
	goto __17
__17:
	i++
	goto __16
	goto __18
__18:
	;

	if !(i > k) {
		goto __21
	}
	/* satisfaction */

	XTclpFree(tls, endpts)
	return REG_OKAY
__21:
	;

	// match failed to verify, so backtrack

backtrack:
	// Must consider longer versions of the current sub-match.
__22:
	if !(k > 0) {
		goto __23
	}
	if !(*(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) < end) {
		goto __24
	}
	limit = *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) + uintptr(1)*2
	// break out of backtrack loop, continue the outer one
	goto __23
__24:
	;
	// can't lengthen k'th sub-match any more, consider previous one
	k--
	goto __22
__23:
	;
	goto __7
__8:
	;

	/* all possibilities exhausted */

	XTclpFree(tls, endpts)
	return REG_NOMATCH
}

// DFA routines
// This file is #included by regexec.c.
//
// Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.
//
// Development of this software was funded, in part, by Cray Research Inc.,
// UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
// Corporation, none of whom are responsible for the results.  The author
// thanks all of them.
//
// Redistribution and use in source and binary forms -- with or without
// modification -- are permitted for any purpose, provided that
// redistributions in source form retain this entire copyright notice and
// indicate the origin and nature of any modifications.
//
// I'd appreciate being given credit for this package in the documentation
// of software which uses it, but that is not a requirement.
//
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
// HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//

//
//  - longest - longest-preferred matching engine
//  ^ static chr *longest(struct vars *, struct dfa *, chr *, chr *, int *);
//
func longest(tls *libc.TLS, v uintptr, d uintptr, start uintptr, stop uintptr, hitstopp uintptr) uintptr { /* rege_dfa.c:37:12: */
	var cp uintptr
	var realstop uintptr
	if stop == (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstop {
		realstop = stop
	} else {
		realstop = stop + uintptr(1)*2
	}
	var co Color
	var css uintptr
	var ss uintptr
	var post uintptr
	var i int32
	var cm uintptr = (*Dfa)(unsafe.Pointer(d)).Fcm

	// Initialize.

	css = initialize(tls, v, d, start)
	cp = start
	if hitstopp != uintptr(0) {
		*(*int32)(unsafe.Pointer(hitstopp)) = 0
	}

	/*
	 * Startup.
	 */

	{
	}

	if cp == (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstart {
		co = *(*Color)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fcnfa + 20 + uintptr(func() int32 {
			if (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Feflags&REG_NOTBOL != 0 {
				return 0
			}
			return 1
		}())*2))
		{
		}

	} else {
		co = *(*Color)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cm + 368 + uintptr(int32(*(*Chr)(unsafe.Pointer(cp - uintptr(1)*2)))>>BYTBITS&(int32(1)<<BYTBITS-1))*8)) + uintptr(int32(*(*Chr)(unsafe.Pointer(cp - uintptr(1)*2)))&(int32(1)<<BYTBITS-1))*2))
		{
		}

	}
	css = miss(tls, v, d, css, int32(co), cp, start)
	if css == uintptr(0) {
		return uintptr(0)
	}
	(*Sset)(unsafe.Pointer(css)).Flastseen = cp

	// Main loop.

	if (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Feflags&REG_FTRACE != 0 {
		for cp < realstop {
			{
			}

			co = *(*Color)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cm + 368 + uintptr(int32(*(*Chr)(unsafe.Pointer(cp)))>>BYTBITS&(int32(1)<<BYTBITS-1))*8)) + uintptr(int32(*(*Chr)(unsafe.Pointer(cp)))&(int32(1)<<BYTBITS-1))*2))
			{
			}

			ss = *(*uintptr)(unsafe.Pointer((*Sset)(unsafe.Pointer(css)).Fouts + uintptr(co)*8))
			if ss == uintptr(0) {
				ss = miss(tls, v, d, css, int32(co), cp+uintptr(1)*2, start)
				if ss == uintptr(0) {
					break // NOTE BREAK OUT
				}
			}
			cp += 2
			(*Sset)(unsafe.Pointer(ss)).Flastseen = cp
			css = ss
		}
	} else {
		for cp < realstop {
			co = *(*Color)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cm + 368 + uintptr(int32(*(*Chr)(unsafe.Pointer(cp)))>>BYTBITS&(int32(1)<<BYTBITS-1))*8)) + uintptr(int32(*(*Chr)(unsafe.Pointer(cp)))&(int32(1)<<BYTBITS-1))*2))
			ss = *(*uintptr)(unsafe.Pointer((*Sset)(unsafe.Pointer(css)).Fouts + uintptr(co)*8))
			if ss == uintptr(0) {
				ss = miss(tls, v, d, css, int32(co), cp+uintptr(1)*2, start)
				if ss == uintptr(0) {
					break // NOTE BREAK OUT
				}
			}
			cp += 2
			(*Sset)(unsafe.Pointer(ss)).Flastseen = cp
			css = ss
		}
	}

	/*
	 * Shutdown.
	 */

	{
	}

	if cp == (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstop && stop == (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstop {
		if hitstopp != uintptr(0) {
			*(*int32)(unsafe.Pointer(hitstopp)) = 1
		}
		co = *(*Color)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fcnfa + 24 + uintptr(func() int32 {
			if (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Feflags&REG_NOTEOL != 0 {
				return 0
			}
			return 1
		}())*2))
		{
		}

		ss = miss(tls, v, d, css, int32(co), cp, start)

		// Special case: match ended at eol?

		if ss != uintptr(0) && (*Sset)(unsafe.Pointer(ss)).Fflags&POSTSTATE != 0 {
			return cp
		} else if ss != uintptr(0) {
			(*Sset)(unsafe.Pointer(ss)).Flastseen = cp // to be tidy
		}
	}

	// Find last match, if any.

	post = (*Dfa)(unsafe.Pointer(d)).Flastpost
	ss = (*Dfa)(unsafe.Pointer(d)).Fssets
	i = (*Dfa)(unsafe.Pointer(d)).Fnssused
__1:
	if !(i > 0) {
		goto __3
	}
	{
		if (*Sset)(unsafe.Pointer(ss)).Fflags&POSTSTATE != 0 && post != (*Sset)(unsafe.Pointer(ss)).Flastseen && (post == uintptr(0) || post < (*Sset)(unsafe.Pointer(ss)).Flastseen) {
			post = (*Sset)(unsafe.Pointer(ss)).Flastseen
		}

	}
	goto __2
__2:
	ss += 56
	i--
	goto __1
	goto __3
__3:
	;
	if post != uintptr(0) { // found one
		return post - uintptr(1)*2
	}

	return uintptr(0)
}

//
//  - shortest - shortest-preferred matching engine
//  ^ static chr *shortest(struct vars *, struct dfa *, chr *, chr *, chr *,
//  ^ 	chr **, int *);
//
func shortest(tls *libc.TLS, v uintptr, d uintptr, start uintptr, min uintptr, max uintptr, coldp uintptr, hitstopp uintptr) uintptr { /* rege_dfa.c:164:12: */
	var cp uintptr
	var realmin uintptr
	if min == (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstop {
		realmin = min
	} else {
		realmin = min + uintptr(1)*2
	}
	var realmax uintptr
	if max == (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstop {
		realmax = max
	} else {
		realmax = max + uintptr(1)*2
	}
	var co Color
	var css uintptr
	var ss uintptr
	var cm uintptr = (*Dfa)(unsafe.Pointer(d)).Fcm

	// Initialize.

	css = initialize(tls, v, d, start)
	cp = start
	if hitstopp != uintptr(0) {
		*(*int32)(unsafe.Pointer(hitstopp)) = 0
	}

	/*
	 * Startup.
	 */

	{
	}

	if cp == (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstart {
		co = *(*Color)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fcnfa + 20 + uintptr(func() int32 {
			if (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Feflags&REG_NOTBOL != 0 {
				return 0
			}
			return 1
		}())*2))
		{
		}

	} else {
		co = *(*Color)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cm + 368 + uintptr(int32(*(*Chr)(unsafe.Pointer(cp - uintptr(1)*2)))>>BYTBITS&(int32(1)<<BYTBITS-1))*8)) + uintptr(int32(*(*Chr)(unsafe.Pointer(cp - uintptr(1)*2)))&(int32(1)<<BYTBITS-1))*2))
		{
		}

	}
	css = miss(tls, v, d, css, int32(co), cp, start)
	if css == uintptr(0) {
		return uintptr(0)
	}
	(*Sset)(unsafe.Pointer(css)).Flastseen = cp
	ss = css

	// Main loop.

	if (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Feflags&REG_FTRACE != 0 {
		for cp < realmax {
			{
			}

			co = *(*Color)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cm + 368 + uintptr(int32(*(*Chr)(unsafe.Pointer(cp)))>>BYTBITS&(int32(1)<<BYTBITS-1))*8)) + uintptr(int32(*(*Chr)(unsafe.Pointer(cp)))&(int32(1)<<BYTBITS-1))*2))
			{
			}

			ss = *(*uintptr)(unsafe.Pointer((*Sset)(unsafe.Pointer(css)).Fouts + uintptr(co)*8))
			if ss == uintptr(0) {
				ss = miss(tls, v, d, css, int32(co), cp+uintptr(1)*2, start)
				if ss == uintptr(0) {
					break // NOTE BREAK OUT
				}
			}
			cp += 2
			(*Sset)(unsafe.Pointer(ss)).Flastseen = cp
			css = ss
			if (*Sset)(unsafe.Pointer(ss)).Fflags&POSTSTATE != 0 && cp >= realmin {
				break // NOTE BREAK OUT
			}
		}
	} else {
		for cp < realmax {
			co = *(*Color)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cm + 368 + uintptr(int32(*(*Chr)(unsafe.Pointer(cp)))>>BYTBITS&(int32(1)<<BYTBITS-1))*8)) + uintptr(int32(*(*Chr)(unsafe.Pointer(cp)))&(int32(1)<<BYTBITS-1))*2))
			ss = *(*uintptr)(unsafe.Pointer((*Sset)(unsafe.Pointer(css)).Fouts + uintptr(co)*8))
			if ss == uintptr(0) {
				ss = miss(tls, v, d, css, int32(co), cp+uintptr(1)*2, start)
				if ss == uintptr(0) {
					break // NOTE BREAK OUT
				}
			}
			cp += 2
			(*Sset)(unsafe.Pointer(ss)).Flastseen = cp
			css = ss
			if (*Sset)(unsafe.Pointer(ss)).Fflags&POSTSTATE != 0 && cp >= realmin {
				break // NOTE BREAK OUT
			}
		}
	}

	if ss == uintptr(0) {
		return uintptr(0)
	}

	if coldp != uintptr(0) { // report last no-progress state set, if any
		*(*uintptr)(unsafe.Pointer(coldp)) = lastCold(tls, v, d)
	}

	if (*Sset)(unsafe.Pointer(ss)).Fflags&POSTSTATE != 0 && cp > min {

		cp -= 2
	} else if cp == (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstop && max == (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstop {
		co = *(*Color)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fcnfa + 24 + uintptr(func() int32 {
			if (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Feflags&REG_NOTEOL != 0 {
				return 0
			}
			return 1
		}())*2))
		{
		}

		ss = miss(tls, v, d, css, int32(co), cp, start)

		// Match might have ended at eol.

		if (ss == uintptr(0) || !((*Sset)(unsafe.Pointer(ss)).Fflags&POSTSTATE != 0)) && hitstopp != uintptr(0) {
			*(*int32)(unsafe.Pointer(hitstopp)) = 1
		}
	}

	if ss == uintptr(0) || !((*Sset)(unsafe.Pointer(ss)).Fflags&POSTSTATE != 0) {
		return uintptr(0)
	}

	return cp
}

//
//  - lastCold - determine last point at which no progress had been made
//  ^ static chr *lastCold(struct vars *, struct dfa *);
//
func lastCold(tls *libc.TLS, v uintptr, d uintptr) uintptr { /* rege_dfa.c:288:12: */
	var ss uintptr
	var nopr uintptr = (*Dfa)(unsafe.Pointer(d)).Flastnopr
	var i int32

	if nopr == uintptr(0) {
		nopr = (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Fstart
	}
	ss = (*Dfa)(unsafe.Pointer(d)).Fssets
	i = (*Dfa)(unsafe.Pointer(d)).Fnssused
__1:
	if !(i > 0) {
		goto __3
	}
	{
		if (*Sset)(unsafe.Pointer(ss)).Fflags&NOPROGRESS != 0 && nopr < (*Sset)(unsafe.Pointer(ss)).Flastseen {
			nopr = (*Sset)(unsafe.Pointer(ss)).Flastseen
		}

	}
	goto __2
__2:
	ss += 56
	i--
	goto __1
	goto __3
__3:
	;
	return nopr
}

//
//  - newDFA - set up a fresh DFA
//  ^ static struct dfa *newDFA(struct vars *, struct cnfa *,
//  ^ 	struct colormap *, struct smalldfa *);
//
func newDFA(tls *libc.TLS, v uintptr, cnfa uintptr, cm uintptr, sml uintptr) uintptr { /* rege_dfa.c:313:19: */
	var d uintptr
	var nss Size_t = Size_t((*Cnfa)(unsafe.Pointer(cnfa)).Fnstates * 2)
	var wordsper int32 = int32((uint64((*Cnfa)(unsafe.Pointer(cnfa)).Fnstates) + uint64(8)*uint64(unsafe.Sizeof(uint32(0))) - uint64(1)) / (uint64(8) * uint64(unsafe.Sizeof(uint32(0)))))
	var smallwas uintptr = sml

	if nss <= uint64(FEWSTATES) && (*Cnfa)(unsafe.Pointer(cnfa)).Fncolors <= FEWCOLORS {

		if sml == uintptr(0) {
			sml = XTclpAlloc(tls, uint32(unsafe.Sizeof(Smalldfa{})))
			if sml == uintptr(0) {
				(*struct {
					Fre          uintptr
					Fg           uintptr
					Feflags      int32
					F__ccgo_pad1 [4]byte
					Fnmatch      Size_t
					Fpmatch      uintptr
					Fdetails     uintptr
					Fstart       uintptr
					Fstop        uintptr
					Ferr         int32
					F__ccgo_pad2 [4]byte
					Fsubdfas     uintptr
					Fdfa1        Smalldfa
					Fdfa2        Smalldfa
				})(unsafe.Pointer(v)).Ferr = func() int32 {
					if (*struct {
						Fre          uintptr
						Fg           uintptr
						Feflags      int32
						F__ccgo_pad1 [4]byte
						Fnmatch      Size_t
						Fpmatch      uintptr
						Fdetails     uintptr
						Fstart       uintptr
						Fstop        uintptr
						Ferr         int32
						F__ccgo_pad2 [4]byte
						Fsubdfas     uintptr
						Fdfa1        Smalldfa
						Fdfa2        Smalldfa
					})(unsafe.Pointer(v)).Ferr != 0 {
						return (*struct {
							Fre          uintptr
							Fg           uintptr
							Feflags      int32
							F__ccgo_pad1 [4]byte
							Fnmatch      Size_t
							Fpmatch      uintptr
							Fdetails     uintptr
							Fstart       uintptr
							Fstop        uintptr
							Ferr         int32
							F__ccgo_pad2 [4]byte
							Fsubdfas     uintptr
							Fdfa1        Smalldfa
							Fdfa2        Smalldfa
						})(unsafe.Pointer(v)).Ferr
					}
					return REG_ESPACE
				}()
				return uintptr(0)
			}
		}
		d = sml
		(*Dfa)(unsafe.Pointer(d)).Fssets = sml + 120       /* &.ssets */
		(*Dfa)(unsafe.Pointer(d)).Fstatesarea = sml + 2360 /* &.statesarea */
		(*Dfa)(unsafe.Pointer(d)).Fwork = (*Dfa)(unsafe.Pointer(d)).Fstatesarea + uintptr(nss)*4
		(*Dfa)(unsafe.Pointer(d)).Foutsarea = sml + 2528 /* &.outsarea */
		(*Dfa)(unsafe.Pointer(d)).Fincarea = sml + 7328  /* &.incarea */
		(*Dfa)(unsafe.Pointer(d)).Fcptsmalloced = 0
		(*Dfa)(unsafe.Pointer(d)).Fmallocarea = func() uintptr {
			if smallwas == uintptr(0) {
				return sml
			}
			return uintptr(0)
		}()
	} else {
		d = XTclpAlloc(tls, uint32(unsafe.Sizeof(Dfa{})))
		if d == uintptr(0) {
			(*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fg           uintptr
					Feflags      int32
					F__ccgo_pad1 [4]byte
					Fnmatch      Size_t
					Fpmatch      uintptr
					Fdetails     uintptr
					Fstart       uintptr
					Fstop        uintptr
					Ferr         int32
					F__ccgo_pad2 [4]byte
					Fsubdfas     uintptr
					Fdfa1        Smalldfa
					Fdfa2        Smalldfa
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fg           uintptr
						Feflags      int32
						F__ccgo_pad1 [4]byte
						Fnmatch      Size_t
						Fpmatch      uintptr
						Fdetails     uintptr
						Fstart       uintptr
						Fstop        uintptr
						Ferr         int32
						F__ccgo_pad2 [4]byte
						Fsubdfas     uintptr
						Fdfa1        Smalldfa
						Fdfa2        Smalldfa
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_ESPACE
			}()
			return uintptr(0)
		}
		(*Dfa)(unsafe.Pointer(d)).Fssets = XTclpAlloc(tls, uint32(nss*Size_t(unsafe.Sizeof(Sset{}))))
		(*Dfa)(unsafe.Pointer(d)).Fstatesarea = XTclpAlloc(tls, uint32((nss+uint64(WORK))*Size_t(wordsper)*Size_t(unsafe.Sizeof(uint32(0)))))
		(*Dfa)(unsafe.Pointer(d)).Fwork = (*Dfa)(unsafe.Pointer(d)).Fstatesarea + uintptr(nss*Size_t(wordsper))*4
		(*Dfa)(unsafe.Pointer(d)).Foutsarea = XTclpAlloc(tls, uint32(nss*Size_t((*Cnfa)(unsafe.Pointer(cnfa)).Fncolors)*Size_t(unsafe.Sizeof(uintptr(0)))))
		(*Dfa)(unsafe.Pointer(d)).Fincarea = XTclpAlloc(tls, uint32(nss*Size_t((*Cnfa)(unsafe.Pointer(cnfa)).Fncolors)*Size_t(unsafe.Sizeof(Arcp{}))))
		(*Dfa)(unsafe.Pointer(d)).Fcptsmalloced = 1
		(*Dfa)(unsafe.Pointer(d)).Fmallocarea = d
		if (*Dfa)(unsafe.Pointer(d)).Fssets == uintptr(0) || (*Dfa)(unsafe.Pointer(d)).Fstatesarea == uintptr(0) || (*Dfa)(unsafe.Pointer(d)).Foutsarea == uintptr(0) || (*Dfa)(unsafe.Pointer(d)).Fincarea == uintptr(0) {
			freeDFA(tls, d)
			(*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr = func() int32 {
				if (*struct {
					Fre          uintptr
					Fg           uintptr
					Feflags      int32
					F__ccgo_pad1 [4]byte
					Fnmatch      Size_t
					Fpmatch      uintptr
					Fdetails     uintptr
					Fstart       uintptr
					Fstop        uintptr
					Ferr         int32
					F__ccgo_pad2 [4]byte
					Fsubdfas     uintptr
					Fdfa1        Smalldfa
					Fdfa2        Smalldfa
				})(unsafe.Pointer(v)).Ferr != 0 {
					return (*struct {
						Fre          uintptr
						Fg           uintptr
						Feflags      int32
						F__ccgo_pad1 [4]byte
						Fnmatch      Size_t
						Fpmatch      uintptr
						Fdetails     uintptr
						Fstart       uintptr
						Fstop        uintptr
						Ferr         int32
						F__ccgo_pad2 [4]byte
						Fsubdfas     uintptr
						Fdfa1        Smalldfa
						Fdfa2        Smalldfa
					})(unsafe.Pointer(v)).Ferr
				}
				return REG_ESPACE
			}()
			return uintptr(0)
		}
	}

	(*Dfa)(unsafe.Pointer(d)).Fnssets = func() int32 {
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Feflags&REG_SMALL != 0 {
			return 7
		}
		return int32(nss)
	}()
	(*Dfa)(unsafe.Pointer(d)).Fnssused = 0
	(*Dfa)(unsafe.Pointer(d)).Fnstates = (*Cnfa)(unsafe.Pointer(cnfa)).Fnstates
	(*Dfa)(unsafe.Pointer(d)).Fncolors = (*Cnfa)(unsafe.Pointer(cnfa)).Fncolors
	(*Dfa)(unsafe.Pointer(d)).Fwordsper = wordsper
	(*Dfa)(unsafe.Pointer(d)).Fcnfa = cnfa
	(*Dfa)(unsafe.Pointer(d)).Fcm = cm
	(*Dfa)(unsafe.Pointer(d)).Flastpost = uintptr(0)
	(*Dfa)(unsafe.Pointer(d)).Flastnopr = uintptr(0)
	(*Dfa)(unsafe.Pointer(d)).Fsearch = (*Dfa)(unsafe.Pointer(d)).Fssets

	// Initialization of sset fields is done as needed.

	return d
}

//
//  - freeDFA - free a DFA
//  ^ static void freeDFA(struct dfa *);
//
func freeDFA(tls *libc.TLS, d uintptr) { /* rege_dfa.c:391:1: */
	if (*Dfa)(unsafe.Pointer(d)).Fcptsmalloced != 0 {
		if (*Dfa)(unsafe.Pointer(d)).Fssets != uintptr(0) {
			XTclpFree(tls, (*Dfa)(unsafe.Pointer(d)).Fssets)
		}
		if (*Dfa)(unsafe.Pointer(d)).Fstatesarea != uintptr(0) {
			XTclpFree(tls, (*Dfa)(unsafe.Pointer(d)).Fstatesarea)
		}
		if (*Dfa)(unsafe.Pointer(d)).Foutsarea != uintptr(0) {
			XTclpFree(tls, (*Dfa)(unsafe.Pointer(d)).Foutsarea)
		}
		if (*Dfa)(unsafe.Pointer(d)).Fincarea != uintptr(0) {
			XTclpFree(tls, (*Dfa)(unsafe.Pointer(d)).Fincarea)
		}
	}

	if (*Dfa)(unsafe.Pointer(d)).Fmallocarea != uintptr(0) {
		XTclpFree(tls, (*Dfa)(unsafe.Pointer(d)).Fmallocarea)
	}
}

//
//  - hash - construct a hash code for a bitvector
//  * There are probably better ways, but they're more expensive.
//  ^ static unsigned hash(unsigned *, int);
//
func hash(tls *libc.TLS, uv uintptr, n int32) uint32 { /* rege_dfa.c:420:1: */
	var i int32
	var h uint32

	h = uint32(0)
	for i = 0; i < n; i++ {
		h = h ^ *(*uint32)(unsafe.Pointer(uv + uintptr(i)*4))
	}
	return h
}

//
//  - initialize - hand-craft a cache entry for startup, otherwise get ready
//  ^ static struct sset *initialize(struct vars *, struct dfa *, chr *);
//
func initialize(tls *libc.TLS, v uintptr, d uintptr, start uintptr) uintptr { /* rege_dfa.c:438:20: */
	var ss uintptr
	var i int32

	// Is previous one still there?

	if (*Dfa)(unsafe.Pointer(d)).Fnssused > 0 && (*Sset)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fssets)).Fflags&STARTER != 0 {
		ss = (*Dfa)(unsafe.Pointer(d)).Fssets
	} else { // no, must (re)build it
		ss = getVacantSS(tls, v, d, start, start)
		for i = 0; i < (*Dfa)(unsafe.Pointer(d)).Fwordsper; i++ {
			*(*uint32)(unsafe.Pointer((*Sset)(unsafe.Pointer(ss)).Fstates + uintptr(i)*4)) = uint32(0)
		}
		*(*uint32)(unsafe.Pointer((*Sset)(unsafe.Pointer(ss)).Fstates + uintptr(uint64((*Cnfa)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fcnfa)).Fpre)/(uint64(8)*uint64(unsafe.Sizeof(uint32(0)))))*4)) |= uint32(uint32(1)) << (uint64((*Cnfa)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fcnfa)).Fpre) % (uint64(8) * uint64(unsafe.Sizeof(uint32(0)))))
		(*Sset)(unsafe.Pointer(ss)).Fhash = func() uint32 {
			if (*Dfa)(unsafe.Pointer(d)).Fwordsper == 1 {
				return *(*uint32)(unsafe.Pointer((*Sset)(unsafe.Pointer(ss)).Fstates))
			}
			return hash(tls, (*Sset)(unsafe.Pointer(ss)).Fstates, (*Dfa)(unsafe.Pointer(d)).Fwordsper)
		}()

		(*Sset)(unsafe.Pointer(ss)).Fflags = STARTER | LOCKED | NOPROGRESS

		// lastseen dealt with below
	}

	for i = 0; i < (*Dfa)(unsafe.Pointer(d)).Fnssused; i++ {
		(*Sset)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fssets + uintptr(i)*56)).Flastseen = uintptr(0)
	}
	(*Sset)(unsafe.Pointer(ss)).Flastseen = start // maybe untrue, but harmless
	(*Dfa)(unsafe.Pointer(d)).Flastpost = uintptr(0)
	(*Dfa)(unsafe.Pointer(d)).Flastnopr = uintptr(0)
	return ss
}

//
//  - miss - handle a cache miss
//  ^ static struct sset *miss(struct vars *, struct dfa *, struct sset *,
//  ^ 	pcolor, chr *, chr *);
//
func miss(tls *libc.TLS, v uintptr, d uintptr, css uintptr, co Pcolor, cp uintptr, start uintptr) uintptr { /* rege_dfa.c:482:20: */
	var cnfa uintptr = (*Dfa)(unsafe.Pointer(d)).Fcnfa
	var h uint32
	var ca uintptr
	var p uintptr
	var i int32
	var isPost int32
	var noProgress int32
	var gotState int32
	var doLAConstraints int32
	var sawLAConstraints int32

	// For convenience, we can be called even if it might not be a miss.

	if *(*uintptr)(unsafe.Pointer((*Sset)(unsafe.Pointer(css)).Fouts + uintptr(co)*8)) != uintptr(0) {
		{
		}

		return *(*uintptr)(unsafe.Pointer((*Sset)(unsafe.Pointer(css)).Fouts + uintptr(co)*8))
	}
	{
	}

	// First, what set of states would we end up in?

	for i = 0; i < (*Dfa)(unsafe.Pointer(d)).Fwordsper; i++ {
		*(*uint32)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fwork + uintptr(i)*4)) = uint32(0)
	}
	isPost = 0
	noProgress = 1
	gotState = 0
	for i = 0; i < (*Dfa)(unsafe.Pointer(d)).Fnstates; i++ {
		if *(*uint32)(unsafe.Pointer((*Sset)(unsafe.Pointer(css)).Fstates + uintptr(uint64(i)/(uint64(8)*uint64(unsafe.Sizeof(uint32(0)))))*4))&(uint32(uint32(1))<<(uint64(i)%(uint64(8)*uint64(unsafe.Sizeof(uint32(0)))))) != 0 {
			for ca = *(*uintptr)(unsafe.Pointer((*Cnfa)(unsafe.Pointer(cnfa)).Fstates + uintptr(i)*8)); int32((*Carc)(unsafe.Pointer(ca)).Fco) != -1; ca += 8 {
				if int32((*Carc)(unsafe.Pointer(ca)).Fco) == co {
					*(*uint32)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fwork + uintptr(uint64((*Carc)(unsafe.Pointer(ca)).Fto)/(uint64(8)*uint64(unsafe.Sizeof(uint32(0)))))*4)) |= uint32(uint32(1)) << (uint64((*Carc)(unsafe.Pointer(ca)).Fto) % (uint64(8) * uint64(unsafe.Sizeof(uint32(0)))))
					gotState = 1
					if (*Carc)(unsafe.Pointer(ca)).Fto == (*Cnfa)(unsafe.Pointer(cnfa)).Fpost {
						isPost = 1
					}
					if !(int32(*(*int8)(unsafe.Pointer((*Cnfa)(unsafe.Pointer(cnfa)).Fstflags + uintptr((*Carc)(unsafe.Pointer(ca)).Fto))))&CNFA_NOPROGRESS != 0) {
						noProgress = 0
					}
					{
					}

				}
			}
		}
	}
	doLAConstraints = func() int32 {
		if gotState != 0 {
			return (*Cnfa)(unsafe.Pointer(cnfa)).Fflags & HASLACONS
		}
		return 0
	}()
	sawLAConstraints = 0
	for doLAConstraints != 0 { // transitive closure
		doLAConstraints = 0
		for i = 0; i < (*Dfa)(unsafe.Pointer(d)).Fnstates; i++ {
			if *(*uint32)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fwork + uintptr(uint64(i)/(uint64(8)*uint64(unsafe.Sizeof(uint32(0)))))*4))&(uint32(uint32(1))<<(uint64(i)%(uint64(8)*uint64(unsafe.Sizeof(uint32(0)))))) != 0 {
				for ca = *(*uintptr)(unsafe.Pointer((*Cnfa)(unsafe.Pointer(cnfa)).Fstates + uintptr(i)*8)); int32((*Carc)(unsafe.Pointer(ca)).Fco) != -1; ca += 8 {
					if int32((*Carc)(unsafe.Pointer(ca)).Fco) < (*Cnfa)(unsafe.Pointer(cnfa)).Fncolors {
						continue // NOTE CONTINUE
					}
					sawLAConstraints = 1
					if *(*uint32)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fwork + uintptr(uint64((*Carc)(unsafe.Pointer(ca)).Fto)/(uint64(8)*uint64(unsafe.Sizeof(uint32(0)))))*4))&(uint32(uint32(1))<<(uint64((*Carc)(unsafe.Pointer(ca)).Fto)%(uint64(8)*uint64(unsafe.Sizeof(uint32(0)))))) != 0 {
						continue // NOTE CONTINUE
					}
					if !(checkLAConstraint(tls, v, cnfa, cp, int32((*Carc)(unsafe.Pointer(ca)).Fco)) != 0) {
						continue // NOTE CONTINUE
					}
					*(*uint32)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fwork + uintptr(uint64((*Carc)(unsafe.Pointer(ca)).Fto)/(uint64(8)*uint64(unsafe.Sizeof(uint32(0)))))*4)) |= uint32(uint32(1)) << (uint64((*Carc)(unsafe.Pointer(ca)).Fto) % (uint64(8) * uint64(unsafe.Sizeof(uint32(0)))))
					doLAConstraints = 1
					if (*Carc)(unsafe.Pointer(ca)).Fto == (*Cnfa)(unsafe.Pointer(cnfa)).Fpost {
						isPost = 1
					}
					if !(int32(*(*int8)(unsafe.Pointer((*Cnfa)(unsafe.Pointer(cnfa)).Fstflags + uintptr((*Carc)(unsafe.Pointer(ca)).Fto))))&CNFA_NOPROGRESS != 0) {
						noProgress = 0
					}
					{
					}

				}
			}
		}
	}
	if !(gotState != 0) {
		return uintptr(0)
	}
	h = func() uint32 {
		if (*Dfa)(unsafe.Pointer(d)).Fwordsper == 1 {
			return *(*uint32)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fwork))
		}
		return hash(tls, (*Dfa)(unsafe.Pointer(d)).Fwork, (*Dfa)(unsafe.Pointer(d)).Fwordsper)
	}()

	// Next, is that in the cache?

	p = (*Dfa)(unsafe.Pointer(d)).Fssets
	i = (*Dfa)(unsafe.Pointer(d)).Fnssused
__1:
	if !(i > 0) {
		goto __3
	}
	{
		if (*Sset)(unsafe.Pointer(p)).Fhash == h && ((*Dfa)(unsafe.Pointer(d)).Fwordsper == 1 || libc.Xmemcmp(tls, (*Dfa)(unsafe.Pointer(d)).Fwork, (*Sset)(unsafe.Pointer(p)).Fstates, uint64((*Dfa)(unsafe.Pointer(d)).Fwordsper)*uint64(unsafe.Sizeof(uint32(0)))) == 0) {
			{
			}

			goto __3 // NOTE BREAK OUT
		}

	}
	goto __2
__2:
	p += 56
	i--
	goto __1
	goto __3
__3:
	;
	if i == 0 { // nope, need a new cache entry
		p = getVacantSS(tls, v, d, cp, start)

		for i = 0; i < (*Dfa)(unsafe.Pointer(d)).Fwordsper; i++ {
			*(*uint32)(unsafe.Pointer((*Sset)(unsafe.Pointer(p)).Fstates + uintptr(i)*4)) = *(*uint32)(unsafe.Pointer((*Dfa)(unsafe.Pointer(d)).Fwork + uintptr(i)*4))
		}
		(*Sset)(unsafe.Pointer(p)).Fhash = h
		(*Sset)(unsafe.Pointer(p)).Fflags = func() int32 {
			if isPost != 0 {
				return POSTSTATE
			}
			return 0
		}()
		if noProgress != 0 {
			*(*int32)(unsafe.Pointer(p + 12)) |= NOPROGRESS
		}

		// lastseen to be dealt with by caller
	}

	if !(sawLAConstraints != 0) { /* lookahead conds. always cache miss */
		{
		}

		*(*uintptr)(unsafe.Pointer((*Sset)(unsafe.Pointer(css)).Fouts + uintptr(co)*8)) = p
		*(*Arcp)(unsafe.Pointer((*Sset)(unsafe.Pointer(css)).Finchain + uintptr(co)*16)) = (*Sset)(unsafe.Pointer(p)).Fins
		(*Sset)(unsafe.Pointer(p)).Fins.Fss = css
		(*Sset)(unsafe.Pointer(p)).Fins.Fco = Color(co)
	}
	return p
}

//
//  - checkLAConstraint - lookahead-constraint checker for miss()
//  ^ static int checkLAConstraint(struct vars *, struct cnfa *, chr *, pcolor);
//
func checkLAConstraint(tls *libc.TLS, v uintptr, pcnfa uintptr, cp uintptr, co Pcolor) int32 { /* rege_dfa.c:612:1: */
	bp := tls.Alloc(16928)
	defer tls.Free(16928)

	var n int32
	var sub uintptr
	var d uintptr
	// var sd Smalldfa at bp, 16928

	var end uintptr

	n = co - (*Cnfa)(unsafe.Pointer(pcnfa)).Fncolors

	{
	}

	sub = (*Guts)(unsafe.Pointer((*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg)).Flacons + uintptr(n)*112
	d = newDFA(tls, v, sub+48, (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fg+96, bp)
	if d == uintptr(0) {
		(*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr = func() int32 {
			if (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr != 0 {
				return (*struct {
					Fre          uintptr
					Fg           uintptr
					Feflags      int32
					F__ccgo_pad1 [4]byte
					Fnmatch      Size_t
					Fpmatch      uintptr
					Fdetails     uintptr
					Fstart       uintptr
					Fstop        uintptr
					Ferr         int32
					F__ccgo_pad2 [4]byte
					Fsubdfas     uintptr
					Fdfa1        Smalldfa
					Fdfa2        Smalldfa
				})(unsafe.Pointer(v)).Ferr
			}
			return REG_ESPACE
		}()
		return 0
	}
	end = longest(tls, v, d, cp, (*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Fstop, uintptr(0))
	freeDFA(tls, d)
	{
	}

	if (*Subre)(unsafe.Pointer(sub)).Fsubno != 0 {
		return libc.Bool32(end != uintptr(0))
	}
	return libc.Bool32(end == uintptr(0))
}

//
//  - getVacantSS - get a vacant state set
//  * This routine clears out the inarcs and outarcs, but does not otherwise
//  * clear the innards of the state set -- that's up to the caller.
//  ^ static struct sset *getVacantSS(struct vars *, struct dfa *, chr *, chr *);
//
func getVacantSS(tls *libc.TLS, v uintptr, d uintptr, cp uintptr, start uintptr) uintptr { /* rege_dfa.c:645:20: */
	var i int32
	var ss uintptr
	var p uintptr
	var ap Arcp
	var lastap = Arcp{} // silence gcc 4 warning
	var co Color

	ss = pickNextSS(tls, v, d, cp, start)

	// Clear out its inarcs, including self-referential ones.

	ap = (*Sset)(unsafe.Pointer(ss)).Fins
	for libc.AssignUintptr(&p, ap.Fss) != uintptr(0) {
		co = ap.Fco
		{
		}

		*(*uintptr)(unsafe.Pointer((*Sset)(unsafe.Pointer(p)).Fouts + uintptr(co)*8)) = uintptr(0)
		ap = *(*Arcp)(unsafe.Pointer((*Sset)(unsafe.Pointer(p)).Finchain + uintptr(co)*16))
		(*Arcp)(unsafe.Pointer((*Sset)(unsafe.Pointer(p)).Finchain + uintptr(co)*16)).Fss = uintptr(0) // paranoia
	}
	(*Sset)(unsafe.Pointer(ss)).Fins.Fss = uintptr(0)

	// Take it off the inarc chains of the ssets reached by its outarcs.

	for i = 0; i < (*Dfa)(unsafe.Pointer(d)).Fncolors; i++ {
		p = *(*uintptr)(unsafe.Pointer((*Sset)(unsafe.Pointer(ss)).Fouts + uintptr(i)*8))
		// not self-referential
		if p == uintptr(0) {
			continue // NOTE CONTINUE
		}
		{
		}

		if (*Sset)(unsafe.Pointer(p)).Fins.Fss == ss && int32((*Sset)(unsafe.Pointer(p)).Fins.Fco) == i {
			(*Sset)(unsafe.Pointer(p)).Fins = *(*Arcp)(unsafe.Pointer((*Sset)(unsafe.Pointer(ss)).Finchain + uintptr(i)*16))
		} else {

			for ap = (*Sset)(unsafe.Pointer(p)).Fins; ap.Fss != uintptr(0) && !(ap.Fss == ss && int32(ap.Fco) == i); ap = *(*Arcp)(unsafe.Pointer((*Sset)(unsafe.Pointer(ap.Fss)).Finchain + uintptr(ap.Fco)*16)) {
				lastap = ap
			}

			*(*Arcp)(unsafe.Pointer((*Sset)(unsafe.Pointer(lastap.Fss)).Finchain + uintptr(lastap.Fco)*16)) = *(*Arcp)(unsafe.Pointer((*Sset)(unsafe.Pointer(ss)).Finchain + uintptr(i)*16))
		}
		*(*uintptr)(unsafe.Pointer((*Sset)(unsafe.Pointer(ss)).Fouts + uintptr(i)*8)) = uintptr(0)
		(*Arcp)(unsafe.Pointer((*Sset)(unsafe.Pointer(ss)).Finchain + uintptr(i)*16)).Fss = uintptr(0)
	}

	// If ss was a success state, may need to remember location.

	if (*Sset)(unsafe.Pointer(ss)).Fflags&POSTSTATE != 0 && (*Sset)(unsafe.Pointer(ss)).Flastseen != (*Dfa)(unsafe.Pointer(d)).Flastpost && ((*Dfa)(unsafe.Pointer(d)).Flastpost == uintptr(0) || (*Dfa)(unsafe.Pointer(d)).Flastpost < (*Sset)(unsafe.Pointer(ss)).Flastseen) {
		(*Dfa)(unsafe.Pointer(d)).Flastpost = (*Sset)(unsafe.Pointer(ss)).Flastseen
	}

	// Likewise for a no-progress state.

	if (*Sset)(unsafe.Pointer(ss)).Fflags&NOPROGRESS != 0 && (*Sset)(unsafe.Pointer(ss)).Flastseen != (*Dfa)(unsafe.Pointer(d)).Flastnopr && ((*Dfa)(unsafe.Pointer(d)).Flastnopr == uintptr(0) || (*Dfa)(unsafe.Pointer(d)).Flastnopr < (*Sset)(unsafe.Pointer(ss)).Flastseen) {
		(*Dfa)(unsafe.Pointer(d)).Flastnopr = (*Sset)(unsafe.Pointer(ss)).Flastseen
	}

	return ss
}

//
//  - pickNextSS - pick the next stateset to be used
//  ^ static struct sset *pickNextSS(struct vars *, struct dfa *, chr *, chr *);
//
func pickNextSS(tls *libc.TLS, v uintptr, d uintptr, cp uintptr, start uintptr) uintptr { /* rege_dfa.c:725:20: */
	var i int32
	var ss uintptr
	var end uintptr
	var ancient uintptr

	// Shortcut for cases where cache isn't full.

	if (*Dfa)(unsafe.Pointer(d)).Fnssused < (*Dfa)(unsafe.Pointer(d)).Fnssets {
		i = (*Dfa)(unsafe.Pointer(d)).Fnssused
		(*Dfa)(unsafe.Pointer(d)).Fnssused++
		ss = (*Dfa)(unsafe.Pointer(d)).Fssets + uintptr(i)*56
		{
		}

		// Set up innards.

		(*Sset)(unsafe.Pointer(ss)).Fstates = (*Dfa)(unsafe.Pointer(d)).Fstatesarea + uintptr(i*(*Dfa)(unsafe.Pointer(d)).Fwordsper)*4
		(*Sset)(unsafe.Pointer(ss)).Fflags = 0
		(*Sset)(unsafe.Pointer(ss)).Fins.Fss = uintptr(0)
		(*Sset)(unsafe.Pointer(ss)).Fins.Fco = int16(WHITE) // give it some value
		(*Sset)(unsafe.Pointer(ss)).Fouts = (*Dfa)(unsafe.Pointer(d)).Foutsarea + uintptr(i*(*Dfa)(unsafe.Pointer(d)).Fncolors)*8
		(*Sset)(unsafe.Pointer(ss)).Finchain = (*Dfa)(unsafe.Pointer(d)).Fincarea + uintptr(i*(*Dfa)(unsafe.Pointer(d)).Fncolors)*16
		for i = 0; i < (*Dfa)(unsafe.Pointer(d)).Fncolors; i++ {
			*(*uintptr)(unsafe.Pointer((*Sset)(unsafe.Pointer(ss)).Fouts + uintptr(i)*8)) = uintptr(0)
			(*Arcp)(unsafe.Pointer((*Sset)(unsafe.Pointer(ss)).Finchain + uintptr(i)*16)).Fss = uintptr(0)
		}
		return ss
	}

	// Look for oldest, or old enough anyway.

	if (int64(cp)-int64(start))/2 > int64((*Dfa)(unsafe.Pointer(d)).Fnssets*2/3) { // oldest 33% are expendable
		ancient = cp - uintptr((*Dfa)(unsafe.Pointer(d)).Fnssets*2/3)*2
	} else {
		ancient = start
	}
	ss = (*Dfa)(unsafe.Pointer(d)).Fsearch
	end = (*Dfa)(unsafe.Pointer(d)).Fssets + uintptr((*Dfa)(unsafe.Pointer(d)).Fnssets)*56
	for ; ss < end; ss += 56 {
		if ((*Sset)(unsafe.Pointer(ss)).Flastseen == uintptr(0) || (*Sset)(unsafe.Pointer(ss)).Flastseen < ancient) &&
			!((*Sset)(unsafe.Pointer(ss)).Fflags&LOCKED != 0) {
			(*Dfa)(unsafe.Pointer(d)).Fsearch = ss + uintptr(1)*56
			{
			}

			return ss
		}
	}
	ss = (*Dfa)(unsafe.Pointer(d)).Fssets
	end = (*Dfa)(unsafe.Pointer(d)).Fsearch
	for ; ss < end; ss += 56 {
		if ((*Sset)(unsafe.Pointer(ss)).Flastseen == uintptr(0) || (*Sset)(unsafe.Pointer(ss)).Flastseen < ancient) &&
			!((*Sset)(unsafe.Pointer(ss)).Fflags&LOCKED != 0) {
			(*Dfa)(unsafe.Pointer(d)).Fsearch = ss + uintptr(1)*56
			{
			}

			return ss
		}
	}

	/*
	 * Nobody's old enough?!? -- something's really wrong.
	 */

	{
	}

	(*struct {
		Fre          uintptr
		Fg           uintptr
		Feflags      int32
		F__ccgo_pad1 [4]byte
		Fnmatch      Size_t
		Fpmatch      uintptr
		Fdetails     uintptr
		Fstart       uintptr
		Fstop        uintptr
		Ferr         int32
		F__ccgo_pad2 [4]byte
		Fsubdfas     uintptr
		Fdfa1        Smalldfa
		Fdfa2        Smalldfa
	})(unsafe.Pointer(v)).Ferr = func() int32 {
		if (*struct {
			Fre          uintptr
			Fg           uintptr
			Feflags      int32
			F__ccgo_pad1 [4]byte
			Fnmatch      Size_t
			Fpmatch      uintptr
			Fdetails     uintptr
			Fstart       uintptr
			Fstop        uintptr
			Ferr         int32
			F__ccgo_pad2 [4]byte
			Fsubdfas     uintptr
			Fdfa1        Smalldfa
			Fdfa2        Smalldfa
		})(unsafe.Pointer(v)).Ferr != 0 {
			return (*struct {
				Fre          uintptr
				Fg           uintptr
				Feflags      int32
				F__ccgo_pad1 [4]byte
				Fnmatch      Size_t
				Fpmatch      uintptr
				Fdetails     uintptr
				Fstart       uintptr
				Fstop        uintptr
				Ferr         int32
				F__ccgo_pad2 [4]byte
				Fsubdfas     uintptr
				Fdfa1        Smalldfa
				Fdfa2        Smalldfa
			})(unsafe.Pointer(v)).Ferr
		}
		return REG_ASSERT
	}()
	return (*Dfa)(unsafe.Pointer(d)).Fssets
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Magic for allocating a variable workspace. This default version is
// stack-hungry.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//
//  - regfree - free an RE (generic function, punts to RE-specific function)
//  *
//  * Ignoring invocation with NULL is a convenience.
//
func XTclReFree(tls *libc.TLS, re uintptr) { /* regfree.c:45:1: */
	if re == uintptr(0) {
		return
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Fns)(unsafe.Pointer((*Regex_t)(unsafe.Pointer(re)).Fre_fns)).Ffree})).f(tls, re)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// tclCompile.h --
//
// Copyright (c) 1996-1998 Sun Microsystems, Inc.
// Copyright (c) 1998-2000 by Scriptics Corporation.
// Copyright (c) 2001 by Kevin B. Kenny. All rights reserved.
// Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// tclInt.h --
//
//	Declarations of things used internally by the Tcl interpreter.
//
// Copyright (c) 1987-1993 The Regents of the University of California.
// Copyright (c) 1993-1997 Lucent Technologies.
// Copyright (c) 1994-1998 Sun Microsystems, Inc.
// Copyright (c) 1998-1999 by Scriptics Corporation.
// Copyright (c) 2001, 2002 by Kevin B. Kenny.  All rights reserved.
// Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
// Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
// Copyright (c) 2008 by Miguel Sofer. All rights reserved.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

type ByteCode1 = struct {
	FinterpHandle    TclHandle
	FcompileEpoch    int32
	F__ccgo_pad1     [4]byte
	FnsPtr           uintptr
	FnsEpoch         int32
	FrefCount        int32
	Fflags           uint32
	F__ccgo_pad2     [4]byte
	Fsource          uintptr
	FprocPtr         uintptr
	FstructureSize   Size_t
	FnumCommands     int32
	FnumSrcBytes     int32
	FnumCodeBytes    int32
	FnumLitObjects   int32
	FnumExceptRanges int32
	FnumAuxDataItems int32
	FnumCmdLocBytes  int32
	FmaxExceptDepth  int32
	FmaxStackDepth   int32
	F__ccgo_pad3     [4]byte
	FcodeStart       uintptr
	FobjArrayPtr     uintptr
	FexceptArrayPtr  uintptr
	FauxDataArrayPtr uintptr
	FcodeDeltaStart  uintptr
	FcodeLengthStart uintptr
	FsrcDeltaStart   uintptr
	FsrcLengthStart  uintptr
	FlocalCachePtr   uintptr
} /* tclCompile.h:18:1 */

//------------------------------------------------------------------------
// Data structures related to compilation.
//------------------------------------------------------------------------

// The structure used to implement Tcl "exceptions" (exceptional returns): for
// example, those generated in loops by the break and continue commands, and
// those generated by scripts and caught by the catch command. This
// ExceptionRange structure describes a range of code (e.g., a loop body), the
// kind of exceptions (e.g., a break or continue) that might occur, and the PC
// offsets to jump to if a matching exception does occur. Exception ranges can
// nest so this structure includes a nesting level that is used at runtime to
// find the closest exception range surrounding a PC. For example, when a
// break command is executed, the ExceptionRange structure for the most deeply
// nested loop, if any, is found and used. These structures are also generated
// for the "next" subcommands of for loops since a break there terminates the
// for command. This means a for command actually generates two LoopInfo
// structures.

type ExceptionRangeType = uint32 /* tclCompile.h:88:3 */

type ExceptionRange1 = struct {
	Ftype           ExceptionRangeType
	FnestingLevel   int32
	FcodeOffset     int32
	FnumCodeBytes   int32
	FbreakOffset    int32
	FcontinueOffset int32
	FcatchOffset    int32
} /* tclInt.h:1367:1 */

type ExceptionRange = ExceptionRange1 /* tclCompile.h:107:3 */

// Auxiliary data used when issuing (currently just loop) exception ranges,
// but which is not required during execution.

type ExceptionAux1 = struct {
	FsupportsContinue     int32
	FstackDepth           int32
	FexpandTarget         int32
	FexpandTargetDepth    int32
	FnumBreakTargets      int32
	F__ccgo_pad1          [4]byte
	FbreakTargets         uintptr
	FallocBreakTargets    int32
	FnumContinueTargets   int32
	FcontinueTargets      uintptr
	FallocContinueTargets int32
	F__ccgo_pad2          [4]byte
} /* tclInt.h:1367:1 */

// Auxiliary data used when issuing (currently just loop) exception ranges,
// but which is not required during execution.

type ExceptionAux = ExceptionAux1 /* tclCompile.h:155:3 */

// Structure used to map between instruction pc and source locations. It
// defines for each compiled Tcl command its code's starting offset and its
// source's starting offset and length. Note that the code offset increases
// monotonically: that is, the table is sorted in code offset order. The
// source offset is not monotonic.

type CmdLocation1 = struct {
	FcodeOffset   int32
	FnumCodeBytes int32
	FsrcOffset    int32
	FnumSrcBytes  int32
} /* tclInt.h:1367:1 */

// Structure used to map between instruction pc and source locations. It
// defines for each compiled Tcl command its code's starting offset and its
// source's starting offset and length. Note that the code offset increases
// monotonically: that is, the table is sorted in code offset order. The
// source offset is not monotonic.

type CmdLocation = CmdLocation1 /* tclCompile.h:170:3 */

// TIP #280
// Structure to record additional location information for byte code. This
// information is internal and not saved. i.e. tbcload'ed code will not have
// this information. It records the lines for all words of all commands found
// in the byte code. The association with a ByteCode structure BC is done
// through the 'lineBCPtr' HashTable in Interp, keyed by the address of BC.
// Also recorded is information coming from the context, i.e. type of the
// frame and associated information, like the path of a sourced file.

type ECL1 = struct {
	FsrcOffset int32
	Fnline     int32
	Fline      uintptr
	Fnext      uintptr
} /* tclInt.h:1367:1 */

// TIP #280
// Structure to record additional location information for byte code. This
// information is internal and not saved. i.e. tbcload'ed code will not have
// this information. It records the lines for all words of all commands found
// in the byte code. The association with a ByteCode structure BC is done
// through the 'lineBCPtr' HashTable in Interp, keyed by the address of BC.
// Also recorded is information coming from the context, i.e. type of the
// frame and associated information, like the path of a sourced file.

type ECL = ECL1 /* tclCompile.h:191:3 */

type ExtCmdLoc1 = struct {
	Ftype  int32
	Fstart int32
	Fpath  uintptr
	Floc   uintptr
	Fnloc  int32
	Fnuloc int32
} /* tclInt.h:1367:1 */

type ExtCmdLoc = ExtCmdLoc1 /* tclCompile.h:203:3 */

// We define a separate AuxDataType struct to hold type-related information
// for the AuxData structure. This separation makes it possible for clients
// outside of the TCL core to manipulate (in a limited fashion!) AuxData; for
// example, it makes it possible to pickle and unpickle AuxData structs.

type AuxDataType = AuxDataType1 /* tclCompile.h:258:3 */

// The definition of the AuxData structure that holds information created
// during compilation by CompileProcs and used by instructions during
// execution.

type AuxData1 = struct {
	Ftype       uintptr
	FclientData ClientData
} /* tclInt.h:1367:1 */

// The definition of the AuxData structure that holds information created
// during compilation by CompileProcs and used by instructions during
// execution.

type AuxData = AuxData1 /* tclCompile.h:270:3 */

// Structure defining the compilation environment. After compilation, fields
// describing bytecode instructions are copied out into the more compact
// ByteCode structure defined below.

type CompileEnv = CompileEnv1 /* tclCompile.h:388:3 */

// The structure defining the bytecode instructions resulting from compiling a
// Tcl script. Note that this structure is variable length: a single heap
// object is allocated to hold the ByteCode structure immediately followed by
// the code bytes, the literal object array, the ExceptionRange array, the
// CmdLocation map, and the compilation AuxData array.

// A PRECOMPILED bytecode struct is one that was generated from a compiled
// image rather than implicitly compiled from source

// When a bytecode is compiled, interp or namespace resolvers have not been
// applied yet: this is indicated by the TCL_BYTECODE_RESOLVE_VARS flag.

type ByteCode = ByteCode1 /* tclCompile.h:516:3 */

// Opcodes for the Tcl bytecode instructions. These must correspond to the
// entries in the table of instruction descriptions, tclInstructionTable, in
// tclCompile.c. Also, the order and number of the expression opcodes (e.g.,
// INST_LOR) must match the entries in the array operatorStrings in
// tclExecute.c.

// Opcodes 0 to 9

// Opcodes 10 to 23

// Opcodes 24 to 33

// Opcodes 34 to 39

// Opcodes 40 to 64

// Opcodes 65 to 66

// Opcodes 67 to 68

// Opcodes 69 to 72

// Opcodes 73 to 78

// Opcodes 78 to 81

// Opcodes 82 to 87

// Opcodes 88 to 93

// TIP #22 - LINDEX operator with flat arg list

// TIP #33 - 'lset' command. Code gen also required a Forth-like
//	     OVER operation.

// TIP#90 - 'return' command.

// TIP#123 - exponentiation operator.

// TIP #157 - {*}... (word expansion) language syntax support.

// TIP #57 - 'lassign' command. Code generation requires immediate
//	     LINDEX and LRANGE operators.

// Dictionary (TIP#111) related commands.

// Instruction to support jumps defined by tables (instead of the classic
// [switch] technique of chained comparisons).

// Instructions to support compilation of global, variable, upvar and
// [namespace upvar].

// Instruction to support compiling syntax error to bytecode

// Instruction to reverse N items on top of stack

// regexp instruction

// For [info exists] compilation

// For [subst] compilation

// For [unset] compilation

// For [dict with], [dict exists], [dict create] and [dict merge]

// For [string map] and [regsub] compilation

// For operations to do with coroutines and other NRE-manipulators

// For compilation of basic information operations

// For compilation relating to TclOO

// For compilation of [array] subcommands

// New foreach implementation

// For compilation of [string trim] and related

// The last opcode

// Table describing the Tcl bytecode instructions: their name (for displaying
// code), total number of code bytes required (including operand bytes), and a
// description of the type of each operand. These operand types include signed
// and unsigned integers of length one and four bytes. The unsigned integers
// are used for indexes or for, e.g., the count of objects to push in a "push"
// instruction.

type InstOperandType = uint32 /* tclCompile.h:861:3 */

type InstructionDesc1 = struct {
	Fname        uintptr
	FnumBytes    int32
	FstackEffect int32
	FnumOperands int32
	FopTypes     [2]InstOperandType
	F__ccgo_pad1 [4]byte
} /* tclCompile.h:863:9 */

type InstructionDesc = InstructionDesc1 /* tclCompile.h:874:3 */

// Constants used by INST_STRING_CLASS to indicate character classes. These
// correspond closely by name with what [string is] can support, but there is
// no requirement to keep the values the same.

type InstStringClassType = uint32 /* tclCompile.h:902:3 */

type StringClassDesc1 = struct {
	Fname       uintptr
	Fcomparator uintptr
} /* tclCompile.h:904:9 */

type StringClassDesc = StringClassDesc1 /* tclCompile.h:908:3 */

// Compilation of some Tcl constructs such as if commands and the logical or
// (||) and logical and (&&) operators in expressions requires the generation
// of forward jumps. Since the PC target of these jumps isn't known when the
// jumps are emitted, we record the offset of each jump in an array of
// JumpFixup structures. There is one array for each sequence of jumps to one
// target PC. When we learn the target PC, we update the jumps with the
// correct distance. Also, if the distance is too great (> 127 bytes), we
// replace the single-byte jump with a four byte jump instruction, move the
// instructions after the jump down, and update the code offsets for any
// commands between the jump and the target.

type TclJumpType = uint32 /* tclCompile.h:929:3 */

type JumpFixup1 = struct {
	FjumpType    TclJumpType
	FcodeOffset  uint32
	FcmdIndex    int32
	FexceptIndex int32
} /* tclCompile.h:931:9 */

type JumpFixup = JumpFixup1 /* tclCompile.h:946:3 */

type JumpFixupArray1 = struct {
	Ffixup            uintptr
	Fnext             int32
	Fend              int32
	FmallocedArray    int32
	FstaticFixupSpace [10]JumpFixup
	F__ccgo_pad1      [4]byte
} /* tclCompile.h:950:9 */

type JumpFixupArray = JumpFixupArray1 /* tclCompile.h:958:3 */

// The structure describing one variable list of a foreach command. Note that
// only foreach commands inside procedure bodies are compiled inline so a
// ForeachVarList structure always describes local variables. Furthermore,
// only scalar variables are supported for inline-compiled foreach loops.

type ForeachVarList1 = struct {
	F__ccgo_pad1 [0]uint32
	FnumVars     int32
} /* tclCompile.h:967:9 */

// The structure describing one variable list of a foreach command. Note that
// only foreach commands inside procedure bodies are compiled inline so a
// ForeachVarList structure always describes local variables. Furthermore,
// only scalar variables are supported for inline-compiled foreach loops.

type ForeachVarList = ForeachVarList1 /* tclCompile.h:976:3 */

// Structure used to hold information about a foreach command that is needed
// during program execution. These structures are stored in CompileEnv and
// ByteCode structures as auxiliary data.

type ForeachInfo1 = struct {
	F__ccgo_pad1    [0]uint64
	FnumLists       int32
	FfirstValueTemp int32
	FloopCtTemp     int32
	F__ccgo_pad2    [4]byte
} /* tclCompile.h:984:9 */

// Structure used to hold information about a foreach command that is needed
// during program execution. These structures are stored in CompileEnv and
// ByteCode structures as auxiliary data.

type ForeachInfo = ForeachInfo1 /* tclCompile.h:998:3 */

// Structure used to hold information about a switch command that is needed
// during program execution. These structures are stored in CompileEnv and
// ByteCode structures as auxiliary data.

type JumptableInfo1 = struct{ FhashTable Tcl_HashTable } /* tclCompile.h:1006:9 */

// Structure used to hold information about a switch command that is needed
// during program execution. These structures are stored in CompileEnv and
// ByteCode structures as auxiliary data.

type JumptableInfo = JumptableInfo1 /* tclCompile.h:1009:3 */

// Structure used to hold information about a [dict update] command that is
// needed during program execution. These structures are stored in CompileEnv
// and ByteCode structures as auxiliary data.

type DictUpdateInfo = struct {
	F__ccgo_pad1 [0]uint32
	Flength      int32
} /* tclCompile.h:1030:3 */

// ClientData type used by the math operator commands.

type TclOpCmdClientData = struct {
	Fop          uintptr
	Fexpected    uintptr
	Fi           struct{ FnumArgs int32 }
	F__ccgo_pad1 [4]byte
} /* tclCompile.h:1043:3 */

func sTclPreserveByteCode(tls *libc.TLS, codePtr uintptr) { /* tclCompile.h:1166:1: */
	(*ByteCode)(unsafe.Pointer(codePtr)).FrefCount++
}

func sTclReleaseByteCode(tls *libc.TLS, codePtr uintptr) { /* tclCompile.h:1173:1: */
	if libc.PostDecInt32(&(*ByteCode)(unsafe.Pointer(codePtr)).FrefCount, 1) > 1 {
		return
	}
	// Just dropped to refcount==0.  Clean up.
	XTclCleanupByteCode(tls, codePtr)
}

// These are opaque types.

type Tcl_Class = uintptr         /* tclOO.h:52:27 */
type Tcl_Method = uintptr        /* tclOO.h:53:28 */
type Tcl_Object = uintptr        /* tclOO.h:54:28 */
type Tcl_ObjectContext = uintptr /* tclOO.h:55:35 */

// The type of a method implementation. This describes how to call the method
// implementation, how to delete it (when the object or class is deleted) and
// how to create a clone of it (when the object or class is copied).

type Tcl_MethodType = struct {
	Fversion     int32
	F__ccgo_pad1 [4]byte
	Fname        uintptr
	FcallProc    uintptr
	FdeleteProc  uintptr
	FcloneProc   uintptr
} /* tclOO.h:93:3 */

// The correct value for the version field of the Tcl_MethodType structure.
// This allows new versions of the structure to be introduced without breaking
// binary compatability.

// The type of some object (or class) metadata. This describes how to delete
// the metadata (when the object or class is deleted) and how to create a
// clone of it (when the object or class is copied).

type Tcl_ObjectMetadataType = struct {
	Fversion     int32
	F__ccgo_pad1 [4]byte
	Fname        uintptr
	FdeleteProc  uintptr
	FcloneProc   uintptr
} /* tclOO.h:120:3 */

type TclOOIntStubs1 = struct {
	Fmagic                         int32
	F__ccgo_pad1                   [4]byte
	Fhooks                         uintptr
	FtclOOGetDefineCmdContext      uintptr
	FtclOOMakeProcInstanceMethod   uintptr
	FtclOOMakeProcMethod           uintptr
	FtclOONewProcInstanceMethod    uintptr
	FtclOONewProcMethod            uintptr
	FtclOOObjectCmdCore            uintptr
	FtclOOIsReachable              uintptr
	FtclOONewForwardMethod         uintptr
	FtclOONewForwardInstanceMethod uintptr
	FtclOONewProcInstanceMethodEx  uintptr
	FtclOONewProcMethodEx          uintptr
	FtclOOInvokeObject             uintptr
	FtclOOObjectSetFilters         uintptr
	FtclOOClassSetFilters          uintptr
	FtclOOObjectSetMixins          uintptr
	FtclOOClassSetMixins           uintptr
} /* tclOODecls.h:125:11 */

type TclOOStubHooks = struct{ FtclOOIntStubs uintptr } /* tclOODecls.h:126:3 */

type TclOOStubs1 = struct {
	Fmagic                         int32
	F__ccgo_pad1                   [4]byte
	Fhooks                         uintptr
	Ftcl_CopyObjectInstance        uintptr
	Ftcl_GetClassAsObject          uintptr
	Ftcl_GetObjectAsClass          uintptr
	Ftcl_GetObjectCommand          uintptr
	Ftcl_GetObjectFromObj          uintptr
	Ftcl_GetObjectNamespace        uintptr
	Ftcl_MethodDeclarerClass       uintptr
	Ftcl_MethodDeclarerObject      uintptr
	Ftcl_MethodIsPublic            uintptr
	Ftcl_MethodIsType              uintptr
	Ftcl_MethodName                uintptr
	Ftcl_NewInstanceMethod         uintptr
	Ftcl_NewMethod                 uintptr
	Ftcl_NewObjectInstance         uintptr
	Ftcl_ObjectDeleted             uintptr
	Ftcl_ObjectContextIsFiltering  uintptr
	Ftcl_ObjectContextMethod       uintptr
	Ftcl_ObjectContextObject       uintptr
	Ftcl_ObjectContextSkippedArgs  uintptr
	Ftcl_ClassGetMetadata          uintptr
	Ftcl_ClassSetMetadata          uintptr
	Ftcl_ObjectGetMetadata         uintptr
	Ftcl_ObjectSetMetadata         uintptr
	Ftcl_ObjectContextInvokeNext   uintptr
	Ftcl_ObjectGetMethodNameMapper uintptr
	Ftcl_ObjectSetMethodNameMapper uintptr
	Ftcl_ClassSetConstructor       uintptr
	Ftcl_ClassSetDestructor        uintptr
	Ftcl_GetObjectName             uintptr
	Freserved29                    uintptr
	Freserved30                    uintptr
	FtclOOUnusedStubEntry          uintptr
} /* tclOODecls.h:128:9 */

type TclOOStubs = TclOOStubs1 /* tclOODecls.h:164:3 */

// !END!: Do not edit above this line.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Hack to make things work with Objective C. Note that ObjC isn't really
// supported, but we don't want to to be actively hostile to it. [Bug 2163447]

// Forward declarations.

type CallChain1 = struct {
	FobjectCreationEpoch int32
	FobjectEpoch         int32
	Fepoch               int32
	Fflags               int32
	FrefCount            int32
	FnumChain            int32
	Fchain               uintptr
	FstaticChain         [4]struct {
		FmPtr           uintptr
		FisFilter       int32
		F__ccgo_pad1    [4]byte
		FfilterDeclarer uintptr
	}
} /* tclOOInt.h:33:1 */

type Class1 = struct {
	FthisPtr      uintptr
	Fflags        int32
	F__ccgo_pad1  [4]byte
	Fsuperclasses struct {
		Fnum         int32
		F__ccgo_pad1 [4]byte
		Flist        uintptr
	}
	Fsubclasses struct {
		Fnum  int32
		Fsize int32
		Flist uintptr
	}
	Finstances struct {
		Fnum  int32
		Fsize int32
		Flist uintptr
	}
	Ffilters struct {
		Fnum         int32
		F__ccgo_pad1 [4]byte
		Flist        uintptr
	}
	Fmixins struct {
		Fnum         int32
		F__ccgo_pad1 [4]byte
		Flist        uintptr
	}
	FmixinSubs struct {
		Fnum  int32
		Fsize int32
		Flist uintptr
	}
	FclassMethods        Tcl_HashTable
	FconstructorPtr      uintptr
	FdestructorPtr       uintptr
	FmetadataPtr         uintptr
	FconstructorChainPtr uintptr
	FdestructorChainPtr  uintptr
	FclassChainCache     uintptr
	Fvariables           struct {
		Fnum         int32
		F__ccgo_pad1 [4]byte
		Flist        uintptr
	}
} /* tclOOInt.h:33:1 */

type Foundation1 = struct {
	Finterp               uintptr
	FobjectCls            uintptr
	FclassCls             uintptr
	FooNs                 uintptr
	FdefineNs             uintptr
	FobjdefNs             uintptr
	FhelpersNs            uintptr
	Fepoch                int32
	F__ccgo_pad1          [4]byte
	FtsdPtr               uintptr
	FunknownMethodNameObj uintptr
	FconstructorName      uintptr
	FdestructorName       uintptr
	FclonedName           uintptr
	FdefineName           uintptr
} /* tclOOInt.h:33:1 */

type Object1 = struct {
	FfPtr         uintptr
	FnamespacePtr uintptr
	Fcommand      Tcl_Command
	FmyCommand    Tcl_Command
	FselfCls      uintptr
	FmethodsPtr   uintptr
	Fmixins       struct {
		Fnum         int32
		F__ccgo_pad1 [4]byte
		Flist        uintptr
	}
	Ffilters struct {
		Fnum         int32
		F__ccgo_pad1 [4]byte
		Flist        uintptr
	}
	FclassPtr          uintptr
	FrefCount          int32
	Fflags             int32
	FcreationEpoch     int32
	Fepoch             int32
	FmetadataPtr       uintptr
	FcachedNameObj     uintptr
	FchainCache        uintptr
	FmapMethodNameProc uintptr
	Fvariables         struct {
		Fnum         int32
		F__ccgo_pad1 [4]byte
		Flist        uintptr
	}
} /* tclOOInt.h:33:1 */

// The data that needs to be stored per method. This record is used to collect
// information about all sorts of methods, including forwards, constructors
// and destructors.

type Method1 = struct {
	FtypePtr            uintptr
	FrefCount           int32
	F__ccgo_pad1        [4]byte
	FclientData         ClientData
	FnamePtr            uintptr
	FdeclaringObjectPtr uintptr
	FdeclaringClassPtr  uintptr
	Fflags              int32
	F__ccgo_pad2        [4]byte
} /* tclOOInt.h:33:1 */

// The data that needs to be stored per method. This record is used to collect
// information about all sorts of methods, including forwards, constructors
// and destructors.

type Method = Method1 /* tclOOInt.h:61:3 */

// Procedure-like methods have the following extra information.

type ProcedureMethod1 = struct {
	Fversion              int32
	F__ccgo_pad1          [4]byte
	FprocPtr              uintptr
	Fflags                int32
	FrefCount             int32
	FclientData           ClientData
	FdeleteClientdataProc uintptr
	FcloneClientdataProc  uintptr
	FerrProc              uintptr
	FpreCallProc          uintptr
	FpostCallProc         uintptr
	FgfivProc             uintptr
} /* tclOOInt.h:79:9 */

// Procedure-like methods have the following extra information.

type ProcedureMethod = ProcedureMethod1 /* tclOOInt.h:100:3 */

// Flags for use in a ProcedureMethod.
//
// When the USE_DECLARER_NS flag is set, the method will use the namespace of
// the object or class that declared it (or the clone of it, if it was from
// such that the implementation of the method came to the particular use)
// instead of the namespace of the object on which the method was invoked.
// This flag must be distinct from all others that are associated with
// methods.

// Forwarded methods have the following extra information.

type ForwardMethod1 = struct{ FprefixObj uintptr } /* tclOOInt.h:121:9 */

// Flags for use in a ProcedureMethod.
//
// When the USE_DECLARER_NS flag is set, the method will use the namespace of
// the object or class that declared it (or the clone of it, if it was from
// such that the implementation of the method came to the particular use)
// instead of the namespace of the object on which the method was invoked.
// This flag must be distinct from all others that are associated with
// methods.

// Forwarded methods have the following extra information.

type ForwardMethod = ForwardMethod1 /* tclOOInt.h:125:3 */

// Helper definitions that declare a "list" array. The two varieties are
// either optimized for simplicity (in the case that the whole array is
// typically assigned at once) or efficiency (in the case that the array is
// expected to be expanded over time). These lists are designed to be iterated
// over with the help of the FOREACH macro (see later in this file).
//
// The "num" field always counts the number of listType_t elements used in the
// "list" field. When a "size" field exists, it describes how many elements
// are present in the list; when absent, exactly "num" elements are present.

// Now, the definition of what an object actually is.

type Object = Object1 /* tclOOInt.h:190:3 */

// And the definition of a class. Note that every class also has an associated
// object, through which it is manipulated.

type Class = Class1 /* tclOOInt.h:270:3 */

// The foundation of the object system within an interpreter contains
// references to the key classes and namespaces, together with a few other
// useful bits and pieces. Probably ought to eventually go in the Interp
// structure itself.

type ThreadLocalData1 = struct{ FnsCount int32 } /* tclOOInt.h:33:1 */

// The foundation of the object system within an interpreter contains
// references to the key classes and namespaces, together with a few other
// useful bits and pieces. Probably ought to eventually go in the Interp
// structure itself.

type ThreadLocalData = ThreadLocalData1 /* tclOOInt.h:286:3 */

type Foundation = Foundation1 /* tclOOInt.h:318:3 */

// A call context structure is built when a method is called. It contains the
// chain of method implementations that are to be invoked by a particular
// call, and the process of calling walks the chain, with the [next] command
// proceeding to the next entry in the chain.

type MInvoke = struct {
	FmPtr           uintptr
	FisFilter       int32
	F__ccgo_pad1    [4]byte
	FfilterDeclarer uintptr
} /* tclOOInt.h:33:1 */

type CallChain = CallChain1 /* tclOOInt.h:352:3 */

type CallContext1 = struct {
	FoPtr    uintptr
	Findex   int32
	Fskip    int32
	FcallPtr uintptr
} /* tclOOInt.h:354:9 */

type CallContext = CallContext1 /* tclOOInt.h:363:3 */

// Bits for the 'flags' field of the call chain.

// Structure containing definition information about basic class methods.

type DeclaredClassMethod = struct {
	Fname        uintptr
	FisPublic    int32
	F__ccgo_pad1 [4]byte
	Fdefinition  Tcl_MethodType
} /* tclOOInt.h:384:3 */

type TclOOIntStubs = TclOOIntStubs1 /* tclOOIntDecls.h:115:3 */

// !END!: Do not edit above this line.

// Alternatives to Tcl_Preserve/Tcl_EventuallyFree/Tcl_Release.

// A convenience macro for iterating through the lists used in the internal
// memory management of objects.
// REQUIRES DECLARATION: int i;

// Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
// sets up the declarations needed for the main macro, FOREACH_HASH, which
// does the actual iteration. FOREACH_HASH_VALUE is a restricted version that
// only iterates over values.

// Convenience macro for duplicating a list. Needs no external declaration,
// but all arguments are used multiple times and so must have no side effects.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Structure that represents a range of instructions in the bytecode.

type CodeRange1 = struct {
	FstartOffset int32
	FendOffset   int32
} /* tclAssembly.c:40:9 */

// !END!: Do not edit above this line.

// Alternatives to Tcl_Preserve/Tcl_EventuallyFree/Tcl_Release.

// A convenience macro for iterating through the lists used in the internal
// memory management of objects.
// REQUIRES DECLARATION: int i;

// Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
// sets up the declarations needed for the main macro, FOREACH_HASH, which
// does the actual iteration. FOREACH_HASH_VALUE is a restricted version that
// only iterates over values.

// Convenience macro for duplicating a list. Needs no external declaration,
// but all arguments are used multiple times and so must have no side effects.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Structure that represents a range of instructions in the bytecode.

type CodeRange = CodeRange1 /* tclAssembly.c:43:3 */

// State identified for a basic block's catch context.

type BasicBlockCatchState = uint32 /* tclAssembly.c:55:3 */

// Structure that defines a basic block - a linear sequence of bytecode
// instructions with no jumps in or out (including not changing the
// state of any exception range).

type BasicBlock1 = struct {
	ForiginalStartOffset   int32
	FstartOffset           int32
	FstartLine             int32
	FjumpOffset            int32
	FjumpLine              int32
	F__ccgo_pad1           [4]byte
	FprevPtr               uintptr
	Fpredecessor           uintptr
	Fsuccessor1            uintptr
	FjumpTarget            uintptr
	FinitialStackDepth     int32
	FminStackDepth         int32
	FmaxStackDepth         int32
	FfinalStackDepth       int32
	FcatchState            uint32
	FcatchDepth            int32
	FenclosingCatch        uintptr
	FforeignExceptionBase  int32
	FforeignExceptionCount int32
	FforeignExceptions     uintptr
	FjtPtr                 uintptr
	Fflags                 int32
	F__ccgo_pad2           [4]byte
} /* tclAssembly.c:63:9 */

// Structure that defines a basic block - a linear sequence of bytecode
// instructions with no jumps in or out (including not changing the
// state of any exception range).

type BasicBlock = BasicBlock1 /* tclAssembly.c:106:3 */

// Source instruction type recognized by the assembler.

type TalInstType = uint32 /* tclAssembly.c:191:3 */

// Description of an instruction recognized by the assembler.

type TalInstDesc1 = struct {
	Fname             uintptr
	FinstType         TalInstType
	FtclInstCode      int32
	FoperandsConsumed int32
	FoperandsProduced int32
} /* tclAssembly.c:197:9 */

// Description of an instruction recognized by the assembler.

type TalInstDesc = TalInstDesc1 /* tclAssembly.c:209:3 */

// Structure that holds the state of the assembler while generating code.

type AssemblyEnv1 = struct {
	FenvPtr        uintptr
	FparsePtr      uintptr
	FlabelHash     Tcl_HashTable
	FcmdLine       int32
	F__ccgo_pad1   [4]byte
	FclNext        uintptr
	Fhead_bb       uintptr
	Fcurr_bb       uintptr
	FmaxDepth      int32
	FcurCatchDepth int32
	FmaxCatchDepth int32
	Fflags         int32
} /* tclAssembly.c:215:9 */

// Structure that holds the state of the assembler while generating code.

type AssemblyEnv = AssemblyEnv1 /* tclAssembly.c:232:3 */

// Tcl_ObjType that describes bytecode emitted by the assembler.

var assembleCodeType = Tcl_ObjType{
	Fname:           ts + 2059,
	FfreeIntRepProc: 0, // freeIntRepProc
	FdupIntRepProc:  0, // setFromAnyProc
} /* tclAssembly.c:320:26 */

// Source instructions recognized in the Tcl Assembly Language (TAL)

var sTalInstructionTable = [148]TalInstDesc{
	// PUSH must be first, see the code near the end of TclAssembleCode
	{Fname: ts + 2072, FinstType: ASSEM_PUSH, FtclInstCode: int32(INST_PUSH1)<<8 |
		INST_PUSH4, FoperandsProduced: 1},

	{Fname: ts + 2077, FtclInstCode: INST_ADD, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2081, FinstType: ASSEM_LVT, FtclInstCode: int32(INST_APPEND_SCALAR1)<<8 |
		INST_APPEND_SCALAR4, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2088, FinstType: ASSEM_LVT, FtclInstCode: int32(INST_APPEND_ARRAY1)<<8 |
		INST_APPEND_ARRAY4, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2100, FtclInstCode: INST_APPEND_ARRAY_STK, FoperandsConsumed: 3, FoperandsProduced: 1},
	{Fname: ts + 2115, FtclInstCode: INST_APPEND_STK, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2125, FinstType: ASSEM_LVT4, FtclInstCode: INST_ARRAY_EXISTS_IMM, FoperandsProduced: 1},
	{Fname: ts + 2140, FtclInstCode: INST_ARRAY_EXISTS_STK, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2155, FinstType: ASSEM_LVT4, FtclInstCode: INST_ARRAY_MAKE_IMM},
	{Fname: ts + 2168, FtclInstCode: INST_ARRAY_MAKE_STK, FoperandsConsumed: 1},
	{Fname: ts + 2181, FinstType: ASSEM_BEGIN_CATCH,
		FtclInstCode: INST_BEGIN_CATCH4},
	{Fname: ts + 2192, FtclInstCode: INST_BITAND, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2199, FtclInstCode: INST_BITNOT, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2206, FtclInstCode: INST_BITOR, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2212, FtclInstCode: INST_BITXOR, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2219, FinstType: ASSEM_CLOCK_READ, FtclInstCode: INST_CLOCK_READ, FoperandsProduced: 1},
	{Fname: ts + 2229, FinstType: ASSEM_CONCAT1, FtclInstCode: INST_STR_CONCAT1, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: 1},
	{Fname: ts + 2236, FinstType: ASSEM_LIST, FtclInstCode: INST_CONCAT_STK, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: 1},
	{Fname: ts + 2246, FtclInstCode: INST_COROUTINE_NAME, FoperandsProduced: 1},
	{Fname: ts + 2255, FtclInstCode: INST_NS_CURRENT, FoperandsProduced: 1},
	{Fname: ts + 2272, FinstType: ASSEM_LVT4, FtclInstCode: INST_DICT_APPEND, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2283, FinstType: ASSEM_DICT_GET, FtclInstCode: INST_DICT_EXISTS, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: 1},
	{Fname: ts + 2294, FtclInstCode: INST_DICT_EXPAND, FoperandsConsumed: 3, FoperandsProduced: 1},
	{Fname: ts + 2305, FinstType: ASSEM_DICT_GET, FtclInstCode: INST_DICT_GET, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: 1},
	{Fname: ts + 2313, FinstType: ASSEM_SINT4_LVT4,
		FtclInstCode: INST_DICT_INCR_IMM, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2325, FinstType: ASSEM_LVT4, FtclInstCode: INST_DICT_LAPPEND, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2337, FtclInstCode: INST_DICT_RECOMBINE_STK, FoperandsConsumed: 3},
	{Fname: ts + 2354, FinstType: ASSEM_LVT4, FtclInstCode: INST_DICT_RECOMBINE_IMM, FoperandsConsumed: 2},
	{Fname: ts + 2371, FinstType: ASSEM_DICT_SET, FtclInstCode: INST_DICT_SET, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: 1},
	{Fname: ts + 2379, FinstType: ASSEM_DICT_UNSET,
		FtclInstCode: INST_DICT_UNSET, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: 1},
	{Fname: ts + 2389, FtclInstCode: INST_DIV, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2393, FtclInstCode: INST_DUP, FoperandsConsumed: 1, FoperandsProduced: 2},
	{Fname: ts + 2397, FinstType: ASSEM_END_CATCH, FtclInstCode: INST_END_CATCH},
	{Fname: ts + 2406, FtclInstCode: INST_EQ, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2409, FinstType: ASSEM_EVAL, FtclInstCode: INST_EVAL_STK, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2414, FtclInstCode: INST_EVAL_STK, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2422, FinstType: ASSEM_LVT4, FtclInstCode: INST_EXIST_SCALAR, FoperandsProduced: 1},
	{Fname: ts + 2428, FinstType: ASSEM_LVT4, FtclInstCode: INST_EXIST_ARRAY, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2439, FtclInstCode: INST_EXIST_ARRAY_STK, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2453, FtclInstCode: INST_EXIST_STK, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2462, FtclInstCode: INST_EXPON, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2468, FinstType: ASSEM_EVAL, FtclInstCode: INST_EXPR_STK, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2473, FtclInstCode: INST_EXPR_STK, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2481, FtclInstCode: INST_GE, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2484, FtclInstCode: INST_GT, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2487, FinstType: ASSEM_LVT1, FtclInstCode: INST_INCR_SCALAR1, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2492, FinstType: ASSEM_LVT1, FtclInstCode: INST_INCR_ARRAY1, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2502, FinstType: ASSEM_LVT1_SINT1,
		FtclInstCode: INST_INCR_ARRAY1_IMM, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2515, FtclInstCode: INST_INCR_ARRAY_STK, FoperandsConsumed: 3, FoperandsProduced: 1},
	{Fname: ts + 2528, FinstType: ASSEM_SINT1, FtclInstCode: INST_INCR_ARRAY_STK_IMM, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2544, FinstType: ASSEM_LVT1_SINT1,
		FtclInstCode: INST_INCR_SCALAR1_IMM, FoperandsProduced: 1},
	{Fname: ts + 2552, FtclInstCode: INST_INCR_STK, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2560, FinstType: ASSEM_SINT1, FtclInstCode: INST_INCR_STK_IMM, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2571, FtclInstCode: INST_INFO_LEVEL_ARGS, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2585, FtclInstCode: INST_INFO_LEVEL_NUM, FoperandsProduced: 1},
	{Fname: ts + 2601, FinstType: ASSEM_INVOKE, FtclInstCode: int32(INST_INVOKE_STK1)<<8 |
		INST_INVOKE_STK4, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: 1},
	{Fname: ts + 2611, FinstType: ASSEM_JUMP, FtclInstCode: INST_JUMP1},
	{Fname: ts + 2616, FinstType: ASSEM_JUMP4, FtclInstCode: INST_JUMP4},
	{Fname: ts + 2622, FinstType: ASSEM_JUMP, FtclInstCode: INST_JUMP_FALSE1, FoperandsConsumed: 1},
	{Fname: ts + 2632, FinstType: ASSEM_JUMP4, FtclInstCode: INST_JUMP_FALSE4, FoperandsConsumed: 1},
	{Fname: ts + 2643, FinstType: ASSEM_JUMPTABLE, FtclInstCode: INST_JUMP_TABLE, FoperandsConsumed: 1},
	{Fname: ts + 2653, FinstType: ASSEM_JUMP, FtclInstCode: INST_JUMP_TRUE1, FoperandsConsumed: 1},
	{Fname: ts + 2662, FinstType: ASSEM_JUMP4, FtclInstCode: INST_JUMP_TRUE4, FoperandsConsumed: 1},
	{Fname: ts + 2672, FinstType: ASSEM_LABEL},
	{Fname: ts + 2678, FtclInstCode: INST_LAND, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2683, FinstType: ASSEM_LVT, FtclInstCode: int32(INST_LAPPEND_SCALAR1)<<8 |
		INST_LAPPEND_SCALAR4,
		FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2691, FinstType: ASSEM_LVT, FtclInstCode: int32(INST_LAPPEND_ARRAY1)<<8 |
		INST_LAPPEND_ARRAY4, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2704, FtclInstCode: INST_LAPPEND_ARRAY_STK, FoperandsConsumed: 3, FoperandsProduced: 1},
	{Fname: ts + 2720, FinstType: ASSEM_LVT4, FtclInstCode: INST_LAPPEND_LIST, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2732, FinstType: ASSEM_LVT4, FtclInstCode: INST_LAPPEND_LIST_ARRAY, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2749, FtclInstCode: INST_LAPPEND_LIST_ARRAY_STK, FoperandsConsumed: 3, FoperandsProduced: 1},
	{Fname: ts + 2769, FtclInstCode: INST_LAPPEND_LIST_STK, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2784, FtclInstCode: INST_LAPPEND_STK, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2795, FtclInstCode: INST_LE, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2798, FinstType: ASSEM_LINDEX_MULTI,
		FtclInstCode: INST_LIST_INDEX_MULTI, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: 1},
	{Fname: ts + 2810, FinstType: ASSEM_LIST, FtclInstCode: INST_LIST, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: 1},
	{Fname: ts + 2815, FtclInstCode: INST_LIST_CONCAT, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2826, FtclInstCode: INST_LIST_IN, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2833, FtclInstCode: INST_LIST_INDEX, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2843, FinstType: ASSEM_INDEX, FtclInstCode: INST_LIST_INDEX_IMM, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2856, FtclInstCode: INST_LIST_LENGTH, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2867, FtclInstCode: INST_LIST_NOT_IN, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2877, FinstType: ASSEM_LVT, FtclInstCode: int32(INST_LOAD_SCALAR1)<<8 |
		INST_LOAD_SCALAR4, FoperandsProduced: 1},
	{Fname: ts + 2882, FinstType: ASSEM_LVT, FtclInstCode: int32(INST_LOAD_ARRAY1)<<8 |
		INST_LOAD_ARRAY4, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2892, FtclInstCode: INST_LOAD_ARRAY_STK, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2905, FtclInstCode: INST_LOAD_STK, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2913, FtclInstCode: INST_LOR, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2917, FinstType: ASSEM_LSET_FLAT, FtclInstCode: INST_LSET_FLAT, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: 1},
	{Fname: ts + 2926, FtclInstCode: INST_LSET_LIST, FoperandsConsumed: 3, FoperandsProduced: 1},
	{Fname: ts + 2935, FtclInstCode: INST_LSHIFT, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2942, FtclInstCode: INST_LT, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2945, FtclInstCode: INST_MOD, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2949, FtclInstCode: INST_MULT, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2954, FtclInstCode: INST_NEQ, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2958, FtclInstCode: INST_NOP},
	{Fname: ts + 2962, FtclInstCode: INST_LNOT, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2966, FinstType: ASSEM_LVT4, FtclInstCode: INST_NSUPVAR, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 2974, FtclInstCode: INST_NUM_TYPE, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2986, FtclInstCode: INST_ORIGIN_COMMAND, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 2996, FinstType: ASSEM_OVER, FtclInstCode: INST_OVER, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: -1 - 1},
	{Fname: ts + 3001, FtclInstCode: INST_POP, FoperandsConsumed: 1},
	{Fname: ts + 3005, FtclInstCode: INST_PUSH_RETURN_CODE, FoperandsProduced: 1},
	{Fname: ts + 3020, FtclInstCode: INST_PUSH_RETURN_OPTIONS, FoperandsProduced: 1},
	{Fname: ts + 3035, FtclInstCode: INST_PUSH_RESULT, FoperandsProduced: 1},
	{Fname: ts + 3046, FinstType: ASSEM_REGEXP, FtclInstCode: INST_REGEXP, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3053, FtclInstCode: INST_RESOLVE_COMMAND, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3064, FinstType: ASSEM_REVERSE, FtclInstCode: INST_REVERSE, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: -1 - 0},
	{Fname: ts + 3072, FtclInstCode: INST_RSHIFT, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3079, FinstType: ASSEM_LVT, FtclInstCode: int32(INST_STORE_SCALAR1)<<8 |
		INST_STORE_SCALAR4, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3085, FinstType: ASSEM_LVT, FtclInstCode: int32(INST_STORE_ARRAY1)<<8 |
		INST_STORE_ARRAY4, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3096, FtclInstCode: INST_STORE_ARRAY_STK, FoperandsConsumed: 3, FoperandsProduced: 1},
	{Fname: ts + 3110, FtclInstCode: INST_STORE_STK, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3119, FtclInstCode: INST_STR_LOWER, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3132, FtclInstCode: INST_STR_TITLE, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3145, FtclInstCode: INST_STR_UPPER, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3158, FtclInstCode: INST_STR_CMP, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3165, FinstType: ASSEM_CONCAT1, FtclInstCode: INST_STR_CONCAT1, FoperandsConsumed: -0x7fffffff - 1, FoperandsProduced: 1},
	{Fname: ts + 3172, FtclInstCode: INST_STR_EQ, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3178, FtclInstCode: INST_STR_FIND, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3186, FtclInstCode: INST_STR_INDEX, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3195, FtclInstCode: INST_STR_LEN, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3202, FtclInstCode: INST_STR_MAP, FoperandsConsumed: 3, FoperandsProduced: 1},
	{Fname: ts + 3209, FinstType: ASSEM_BOOL, FtclInstCode: INST_STR_MATCH, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3218, FtclInstCode: INST_STR_NEQ, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3225, FtclInstCode: INST_STR_RANGE, FoperandsConsumed: 3, FoperandsProduced: 1},
	{Fname: ts + 3234, FtclInstCode: INST_STR_REPLACE, FoperandsConsumed: 4, FoperandsProduced: 1},
	{Fname: ts + 3245, FtclInstCode: INST_STR_FIND_LAST, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3254, FtclInstCode: INST_STR_TRIM, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3262, FtclInstCode: INST_STR_TRIM_LEFT, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3274, FtclInstCode: INST_STR_TRIM_RIGHT, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3287, FtclInstCode: INST_SUB, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3291, FtclInstCode: INST_TCLOO_CLASS, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3302, FtclInstCode: INST_TCLOO_IS_OBJECT, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3316, FtclInstCode: INST_TCLOO_NS, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3331, FtclInstCode: INST_TCLOO_SELF, FoperandsProduced: 1},
	{Fname: ts + 3341, FtclInstCode: INST_TRY_CVT_TO_BOOLEAN, FoperandsConsumed: 1, FoperandsProduced: 2},
	{Fname: ts + 3357, FtclInstCode: INST_TRY_CVT_TO_NUMERIC, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3373, FtclInstCode: INST_UMINUS, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3380, FinstType: ASSEM_BOOL_LVT4, FtclInstCode: INST_UNSET_SCALAR},
	{Fname: ts + 3386, FinstType: ASSEM_BOOL_LVT4, FtclInstCode: INST_UNSET_ARRAY, FoperandsConsumed: 1},
	{Fname: ts + 3397, FinstType: ASSEM_BOOL, FtclInstCode: INST_UNSET_ARRAY_STK, FoperandsConsumed: 2},
	{Fname: ts + 3411, FinstType: ASSEM_BOOL, FtclInstCode: INST_UNSET_STK, FoperandsConsumed: 1},
	{Fname: ts + 3420, FtclInstCode: INST_UPLUS, FoperandsConsumed: 1, FoperandsProduced: 1},
	{Fname: ts + 3426, FinstType: ASSEM_LVT4, FtclInstCode: INST_UPVAR, FoperandsConsumed: 2, FoperandsProduced: 1},
	{Fname: ts + 3432, FinstType: ASSEM_LVT4, FtclInstCode: INST_VARIABLE, FoperandsConsumed: 1},
	{Fname: ts + 3441, FtclInstCode: INST_DICT_VERIFY, FoperandsConsumed: 1},
	{Fname: ts + 3452, FtclInstCode: INST_YIELD, FoperandsConsumed: 1, FoperandsProduced: 1},
	{},
} /* tclAssembly.c:332:26 */

// List of instructions that cannot throw an exception under any
// circumstances.  These instructions are the ones that are permissible after
// an exception is caught but before the corresponding exception range is
// popped from the stack.
// The instructions must be in ascending order by numeric operation code.

var sNonThrowingByteCodes = [32]uint8{
	uint8(INST_PUSH1), uint8(INST_PUSH4), uint8(INST_POP), uint8(INST_DUP), // 1-4
	uint8(INST_JUMP1), uint8(INST_JUMP4), // 34-35
	uint8(INST_END_CATCH), uint8(INST_PUSH_RESULT), uint8(INST_PUSH_RETURN_CODE), // 70-72
	uint8(INST_STR_EQ), uint8(INST_STR_NEQ), uint8(INST_STR_CMP), uint8(INST_STR_LEN), // 73-76
	uint8(INST_LIST),                                                            // 79
	uint8(INST_OVER),                                                            // 95
	uint8(INST_PUSH_RETURN_OPTIONS),                                             // 108
	uint8(INST_REVERSE),                                                         // 126
	uint8(INST_NOP),                                                             // 132
	uint8(INST_STR_MAP),                                                         // 143
	uint8(INST_STR_FIND),                                                        // 144
	uint8(INST_COROUTINE_NAME),                                                  // 149
	uint8(INST_NS_CURRENT),                                                      // 151
	uint8(INST_INFO_LEVEL_NUM),                                                  // 152
	uint8(INST_RESOLVE_COMMAND),                                                 // 154
	uint8(INST_STR_TRIM), uint8(INST_STR_TRIM_LEFT), uint8(INST_STR_TRIM_RIGHT), // 166-168
	uint8(INST_CONCAT_STK),                                              // 169
	uint8(INST_STR_UPPER), uint8(INST_STR_LOWER), uint8(INST_STR_TITLE), // 170-172
	uint8(INST_NUM_TYPE), // 180
} /* tclAssembly.c:511:28 */

// Helper macros.

//-----------------------------------------------------------------------------
//
// BBAdjustStackDepth --
//
//	When an opcode is emitted, adjusts the stack information in the basic
//	block to reflect the number of operands produced and consumed.
//
// Results:
//	None.
//
// Side effects:
//	Updates minimum, maximum and final stack requirements in the basic
//	block.
//
//-----------------------------------------------------------------------------

func sBBAdjustStackDepth(tls *libc.TLS, bbPtr uintptr, consumed int32, produced int32) { /* tclAssembly.c:564:1: */
	var depth int32 = (*BasicBlock)(unsafe.Pointer(bbPtr)).FfinalStackDepth

	depth = depth - consumed
	if depth < (*BasicBlock)(unsafe.Pointer(bbPtr)).FminStackDepth {
		(*BasicBlock)(unsafe.Pointer(bbPtr)).FminStackDepth = depth
	}
	depth = depth + produced
	if depth > (*BasicBlock)(unsafe.Pointer(bbPtr)).FmaxStackDepth {
		(*BasicBlock)(unsafe.Pointer(bbPtr)).FmaxStackDepth = depth
	}
	(*BasicBlock)(unsafe.Pointer(bbPtr)).FfinalStackDepth = depth
}

//-----------------------------------------------------------------------------
//
// BBUpdateStackReqs --
//
//	Updates the stack requirements of a basic block, given the opcode
//	being emitted and an operand count.
//
// Results:
//	None.
//
// Side effects:
//	Updates min, max and final stack requirements in the basic block.
//
// Notes:
//	This function must not be called for instructions such as REVERSE and
//	OVER that are variadic but do not consume all their operands. Instead,
//	BBAdjustStackDepth should be called directly.
//
//	count should be provided only for variadic operations. For operations
//	with known arity, count should be 0.
//
//-----------------------------------------------------------------------------

func sBBUpdateStackReqs(tls *libc.TLS, bbPtr uintptr, tblIdx int32, count int32) { /* tclAssembly.c:610:1: */
	var consumed int32 = sTalInstructionTable[tblIdx].FoperandsConsumed
	var produced int32 = sTalInstructionTable[tblIdx].FoperandsProduced

	if consumed == -0x7fffffff-1 {
		// The instruction is variadic; it consumes 'count' operands.

		consumed = count
	}
	if produced < 0 {
		// The instruction leaves some of its variadic operands on the stack,
		// with net stack effect of '-1-produced'

		produced = consumed - produced - 1
	}
	sBBAdjustStackDepth(tls, bbPtr, consumed, produced)
}

//-----------------------------------------------------------------------------
//
// BBEmitOpcode, BBEmitInstInt1, BBEmitInstInt4 --
//
//	Emit the opcode part of an instruction, or the entirety of an
//	instruction with a 1- or 4-byte operand, and adjust stack
//	requirements.
//
// Results:
//	None.
//
// Side effects:
//	Stores instruction and operand in the operand stream, and adjusts the
//	stack.
//
//-----------------------------------------------------------------------------

func sBBEmitOpcode(tls *libc.TLS, assemEnvPtr uintptr, tblIdx int32, count int32) { /* tclAssembly.c:657:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var bbPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb
	// Current basic block
	var op int32 = sTalInstructionTable[tblIdx].FtclInstCode & 0xFF

	// If this is the first instruction in a basic block, record its line
	// number.

	if int64((*BasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) == (int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 {
		(*BasicBlock)(unsafe.Pointer(bbPtr)).FstartLine = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine
	}

	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(op))
	}
	if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
		(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
			if op == INST_START_CMD {
				return 1
			}
			return 0
		}()
	}

	sBBUpdateStackReqs(tls, bbPtr, tblIdx, count)
}

func sBBEmitInstInt1(tls *libc.TLS, assemEnvPtr uintptr, tblIdx int32, opnd int32, count int32) { /* tclAssembly.c:683:1: */
	sBBEmitOpcode(tls, assemEnvPtr, tblIdx, count)
	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeNext, 1))) = uint8(uint32(opnd))
	}
}

func sBBEmitInstInt4(tls *libc.TLS, assemEnvPtr uintptr, tblIdx int32, opnd int32, count int32) { /* tclAssembly.c:694:1: */
	sBBEmitOpcode(tls, assemEnvPtr, tblIdx, count)
	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeNext, 1))) = uint8(uint32(opnd) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeNext, 1))) = uint8(uint32(opnd) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeNext, 1))) = uint8(uint32(opnd) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeNext, 1))) = uint8(uint32(opnd))
	}
}

//-----------------------------------------------------------------------------
//
// BBEmitInst1or4 --
//
//	Emits a 1- or 4-byte operation according to the magnitude of the
//	operand.
//
//-----------------------------------------------------------------------------

func sBBEmitInst1or4(tls *libc.TLS, assemEnvPtr uintptr, tblIdx int32, param int32, count int32) { /* tclAssembly.c:716:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var bbPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb
	// Current basic block
	var op int32 = sTalInstructionTable[tblIdx].FtclInstCode

	if param <= 0xFF {
		op >>= 8
	} else {
		op = op & 0xFF
	}
	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(op))
	}
	if param <= 0xFF {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(param))
		}
	} else {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(param) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(param) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(param) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(param))
		}
	}
	if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
		(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
			if op == INST_START_CMD {
				return 1
			}
			return 0
		}()
	}

	sBBUpdateStackReqs(tls, bbPtr, tblIdx, count)
}

//-----------------------------------------------------------------------------
//
// Tcl_AssembleObjCmd, TclNRAssembleObjCmd --
//
//	Direct evaluation path for tcl::unsupported::assemble
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Assembles the code in objv[1], and executes it, so side effects
//	include whatever the code does.
//
//-----------------------------------------------------------------------------

func XTcl_AssembleObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclAssembly.c:761:1: */
	// Boilerplate - make sure that there is an NRE trampoline on the C stack
	// because there needs to be one in place to execute bytecode.

	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRAssembleObjCmd})), dummy, objc, objv)
}

func XTclNRAssembleObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclAssembly.c:776:1: */
	var codePtr uintptr   // Pointer to the bytecode to execute
	var backtrace uintptr // Object where extra error information is
	// constructed.

	_ = dummy
	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3458)
		return TCL_ERROR
	}

	// Assemble the source to bytecode.

	codePtr = sCompileAssembleObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))

	// On failure, report error line.

	if codePtr == uintptr(0) {
		XTcl_AddErrorInfo(tls, interp, ts+3471)
		XTcl_AppendObjToErrorInfo(tls, interp, *(*uintptr)(unsafe.Pointer(objv)))
		XTcl_AddErrorInfo(tls, interp, ts+3479)
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					backtrace = XTclThreadAllocObj(tls)
				} else {
					backtrace = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(backtrace + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(backtrace)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(backtrace)).Fbytes = uintptr(0)
			*(*int64)(unsafe.Pointer(backtrace + 32)) = int64(XTcl_GetErrorLine(tls, interp))
			(*Tcl_Obj)(unsafe.Pointer(backtrace)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
			{
			}
		}
		XTcl_AppendObjToErrorInfo(tls, interp, backtrace)
		XTcl_AddErrorInfo(tls, interp, ts+3493)
		return TCL_ERROR
	}

	// Use NRE to evaluate the bytecode from the trampoline.

	return XTclNRExecuteByteCode(tls, interp, codePtr)
}

//-----------------------------------------------------------------------------
//
// CompileAssembleObj --
//
//	Sets up and assembles Tcl bytecode for the direct-execution path in
//	the Tcl bytecode assembler.
//
// Results:
//	Returns a pointer to the assembled code. Returns NULL if the assembly
//	fails for any reason, with an appropriate error message in the
//	interpreter.
//
//-----------------------------------------------------------------------------

func sCompileAssembleObj(tls *libc.TLS, interp uintptr, objPtr uintptr) uintptr { /* tclAssembly.c:835:17: */
	bp := tls.Alloc(3592)
	defer tls.Free(3592)

	var iPtr uintptr = interp
	// Internals of the interpreter
	// var compEnv CompileEnv at bp+8, 3584
	// Compilation environment structure
	var codePtr uintptr = uintptr(0)
	// Bytecode resulting from the assembly
	var namespacePtr uintptr // Namespace in which variable and command
	// names in the bytecode resolve
	var status int32   // Status return from Tcl_AssembleCode
	var source uintptr // String representation of the source code
	// var sourceLen int32 at bp, 4
	// Length of the source code in bytes

	// Get the expression ByteCode from the object. If it exists, make sure it
	// is valid in the current context.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&assembleCodeType)) {
		namespacePtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr
		codePtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		if *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) == iPtr &&
			(*ByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch == (*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch &&
			(*ByteCode)(unsafe.Pointer(codePtr)).FnsPtr == namespacePtr &&
			(*ByteCode)(unsafe.Pointer(codePtr)).FnsEpoch == (*Namespace)(unsafe.Pointer(namespacePtr)).FresolverEpoch &&
			(*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr ==
				(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr {
			return codePtr
		}

		// Not valid, so free it and regenerate.

		sFreeAssembleCodeInternalRep(tls, objPtr)
	}

	// Set up the compilation environment, and assemble the code.

	source = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp)
	}()
	XTclInitCompileEnv(tls, interp, bp+8, source, *(*int32)(unsafe.Pointer(bp /* sourceLen */)), uintptr(0), 0)
	status = sTclAssembleCode(tls, bp+8, source, *(*int32)(unsafe.Pointer(bp /* sourceLen */)), TCL_EVAL_DIRECT)
	if status != TCL_OK {
		// Assembly failed. Clean up and report the error.
		XTclFreeCompileEnv(tls, bp+8)
		return uintptr(0)
	}

	// Add a "done" instruction as the last instruction and change the object
	// into a ByteCode object. Ownership of the literal objects and aux data
	// items is given to the ByteCode object.

	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext == (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeEnd {
			XTclExpandCodeArray(tls, bp+8)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(INST_DONE)
		if (*CompileEnv)(unsafe.Pointer(bp+8)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(bp + 8)).FatCmdStart = func() int32 {
				if INST_DONE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DONE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(bp+8)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(bp+8)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(bp + 8)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(bp + 8)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(bp + 8 + 48)) += _delta
				}
			}
		}
	}
	XTclInitByteCodeObj(tls, objPtr, bp+8)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&assembleCodeType))
	XTclFreeCompileEnv(tls, bp+8)

	// Record the local variable context to which the bytecode pertains

	codePtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	if (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr != 0 {
		(*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr
		(*LocalCache)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr)).FrefCount++
	}

	// Report on what the assembler did.

	return codePtr
}

//-----------------------------------------------------------------------------
//
// TclCompileAssembleCmd --
//
//	Compilation procedure for the '::tcl::unsupported::assemble' command.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Puts the result of assembling the code into the bytecode stream in
//	'compileEnv'.
//
// This procedure makes sure that the command has a single arg, which is
// constant. If that condition is met, the procedure calls TclAssembleCode to
// produce bytecode for the given assembly code, and returns any error
// resulting from the assembly.
//
//-----------------------------------------------------------------------------

func XTclCompileAssembleCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclAssembly.c:948:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var tokenPtr uintptr // Token in the input script

	var numCommands int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands
	var offset int32 = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	var depth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
	_ = cmdPtr
	// Make sure that the command has a single arg that is a simple word.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
		return TCL_ERROR
	}

	// Compile the code and convert any error from the compilation into
	// bytecode reporting the error;

	if TCL_ERROR == sTclAssembleCode(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart,
		(*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, TCL_EVAL_DIRECT) {

		XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
			ts+3495,
			libc.VaList(bp, (*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).Fsize, (*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).Fstart,
				XTcl_GetErrorLine(tls, interp))))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands = numCommands
		(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(offset)
		(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = depth
		XTclCompileSyntaxError(tls, interp, envPtr)
	}
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// TclAssembleCode --
//
//	Take a list of instructions in a Tcl_Obj, and assemble them to Tcl
//	bytecodes
//
// Results:
//	Returns TCL_OK on success, TCL_ERROR on failure.  If 'flags' includes
//	TCL_EVAL_DIRECT, places an error message in the interpreter result.
//
// Side effects:
//	Adds byte codes to the compile environment, and updates the
//	environment's stack depth.
//
//-----------------------------------------------------------------------------

func sTclAssembleCode(tls *libc.TLS, envPtr uintptr, codePtr uintptr, codeLen int32, flags int32) int32 { /* tclAssembly.c:1014:1: */
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	// Walk through the assembly script using the Tcl parser.  Each 'command'
	// will be an instruction or assembly directive.

	var instPtr uintptr = codePtr
	// Where to start looking for a line of code
	var nextPtr uintptr           // Pointer to the end of the line of code
	var bytesLeft int32 = codeLen // Number of bytes of source code remaining to
	// be parsed
	var status int32 // Tcl status return
	var assemEnvPtr uintptr = sNewAssemblyEnv(tls, envPtr, flags)
	var parsePtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FparsePtr

	for ok := true; ok; ok = bytesLeft > 0 {
		// Parse out one command line from the assembly script.

		status = XTcl_ParseCommand(tls, interp, instPtr, bytesLeft, 0, parsePtr)

		// Report errors in the parse.

		if status != TCL_OK {
			if flags&TCL_EVAL_DIRECT != 0 {
				XTcl_LogCommandInfo(tls, interp, codePtr, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart,
					int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm+uintptr(1))-int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart))/1))
			}
			sFreeAssemblyEnv(tls, assemEnvPtr)
			return TCL_ERROR
		}

		// Advance the pointers around any leading commentary.

		XTclAdvanceLines(tls, assemEnvPtr+104, instPtr,
			(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)
		XTclAdvanceContinuations(tls, assemEnvPtr+104, assemEnvPtr+112,
			int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1))

		// Process the line of code.

		if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 0 {
			var instLen int32 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize
			// Length in bytes of the current command

			if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm == (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart+uintptr(instLen)-uintptr(1) {
				instLen--
			}

			// If tracing, show each line assembled as it happens.

			if sAssembleOneLine(tls, assemEnvPtr) != TCL_OK {
				if flags&TCL_EVAL_DIRECT != 0 {
					XTcl_LogCommandInfo(tls, interp, codePtr,
						(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, instLen)
				}
				XTcl_FreeParse(tls, parsePtr)
				sFreeAssemblyEnv(tls, assemEnvPtr)
				return TCL_ERROR
			}
		}

		// Advance to the next line of code.

		nextPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize)
		bytesLeft = int32(int64(bytesLeft) - (int64(nextPtr)-int64(instPtr))/1)
		instPtr = nextPtr
		XTclAdvanceLines(tls, assemEnvPtr+104, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart,
			instPtr)
		XTclAdvanceContinuations(tls, assemEnvPtr+104, assemEnvPtr+112,
			int32((int64(instPtr)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1))
		XTcl_FreeParse(tls, parsePtr)
	}

	// Done with parsing the code.

	status = sFinishAssembly(tls, assemEnvPtr)
	sFreeAssemblyEnv(tls, assemEnvPtr)
	return status
}

//-----------------------------------------------------------------------------
//
// NewAssemblyEnv --
//
//	Creates an environment for the assembler to run in.
//
// Results:
//	Allocates, initialises and returns an assembler environment
//
//-----------------------------------------------------------------------------

func sNewAssemblyEnv(tls *libc.TLS, envPtr uintptr, flags int32) uintptr { /* tclAssembly.c:1138:19: */
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var assemEnvPtr uintptr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(AssemblyEnv{})))
	// Assembler environment under construction
	var parsePtr uintptr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(Tcl_Parse{})))
	// Parse of one line of assembly code

	(*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr = envPtr
	(*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FparsePtr = parsePtr
	(*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine = 1
	(*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FclNext = (*CompileEnv)(unsafe.Pointer(envPtr)).FclNext

	// Make the hashtables that store symbol resolution.

	XTcl_InitHashTable(tls, assemEnvPtr+16, 0)

	// Start the first basic block.

	(*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb = uintptr(0)
	(*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb = sAllocBB(tls, assemEnvPtr)
	(*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb
	(*BasicBlock)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb)).FstartLine = 1

	// Stash compilation flags.

	(*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags = flags
	return assemEnvPtr
}

//-----------------------------------------------------------------------------
//
// FreeAssemblyEnv --
//
//	Cleans up the assembler environment when assembly is complete.
//
//-----------------------------------------------------------------------------

func sFreeAssemblyEnv(tls *libc.TLS, assemEnvPtr uintptr) { /* tclAssembly.c:1190:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment being used for code
	// generation
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var thisBB uintptr // Pointer to a basic block being deleted
	var nextBB uintptr // Pointer to a deleted basic block's
	// successor

	// Free all the basic block structures.

	for thisBB = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb; thisBB != uintptr(0); thisBB = nextBB {
		if (*BasicBlock)(unsafe.Pointer(thisBB)).FjumpTarget != uintptr(0) {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = (*BasicBlock)(unsafe.Pointer(thisBB)).FjumpTarget
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		if (*BasicBlock)(unsafe.Pointer(thisBB)).FforeignExceptions != uintptr(0) {
			XTclpFree(tls, (*BasicBlock)(unsafe.Pointer(thisBB)).FforeignExceptions)
		}
		nextBB = (*BasicBlock)(unsafe.Pointer(thisBB)).Fsuccessor1
		if (*BasicBlock)(unsafe.Pointer(thisBB)).FjtPtr != uintptr(0) {
			sDeleteMirrorJumpTable(tls, (*BasicBlock)(unsafe.Pointer(thisBB)).FjtPtr)
			(*BasicBlock)(unsafe.Pointer(thisBB)).FjtPtr = uintptr(0)
		}
		XTclpFree(tls, thisBB)
	}

	// Dispose what's left.

	XTcl_DeleteHashTable(tls, assemEnvPtr+16)
	XTclStackFree(tls, interp, (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FparsePtr)
	XTclStackFree(tls, interp, assemEnvPtr)
}

//-----------------------------------------------------------------------------
//
// AssembleOneLine --
//
//	Assembles a single command from an assembly language source.
//
// Results:
//	Returns TCL_ERROR with an appropriate error message if the assembly
//	fails. Returns TCL_OK if the assembly succeeds. Updates the assembly
//	environment with the state of the assembly.
//
//-----------------------------------------------------------------------------

func sAssembleOneLine(tls *libc.TLS, assemEnvPtr uintptr) int32 { /* tclAssembly.c:1246:1: */
	bp := tls.Alloc(112)
	defer tls.Free(112)

	var envPtr uintptr
	// Compilation environment being used for code
	// gen
	var interp uintptr
	// Tcl interpreter
	var parsePtr uintptr
	// Parse of the line of code
	// var tokenPtr uintptr at bp+72, 8
	// Current token within the line of code
	// var instNameObj uintptr at bp+80, 8
	// Name of the instruction
	// var tblIdx int32 at bp+88, 4
	// Index in TalInstructionTable of the
	// instruction
	var instType uint32 // Type of the instruction
	// var operand1Obj uintptr at bp+96, 8

	// First operand to the instruction
	var operand1 uintptr // String rep of the operand
	// var operand1Len int32 at bp+104, 4
	// String length of the operand
	// var opnd int32 at bp+108, 4
	// Integer representation of an operand
	var litIndex int32  // Literal pool index of a constant
	var localVar int32  // LVT index of a local variable
	var flags int32     // Flags for a basic block
	var jtPtr uintptr   // Pointer to a jumptable
	var infoIndex int32 // Index of the jumptable in auxdata
	var status int32
	var _objPtr uintptr
	var _objPtr1 uintptr
	envPtr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	interp = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	parsePtr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FparsePtr
	*(*uintptr)(unsafe.Pointer(bp + 96 /* operand1Obj */)) = uintptr(0)
	status = TCL_ERROR // Return value from this function

	// Make sure that the instruction name is known at compile time.

	*(*uintptr)(unsafe.Pointer(bp + 72 /* tokenPtr */)) = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(sGetNextOperand(tls, assemEnvPtr, bp+72, bp+80) != TCL_OK) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	// Look up the instruction name.

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 80)),
		uintptr(unsafe.Pointer(&sTalInstructionTable)), int32(unsafe.Sizeof(TalInstDesc{})), ts+3523,
		TCL_EXACT, bp+88) != TCL_OK) {
		goto __2
	}
	goto cleanup
__2:
	;

	// Vector on the type of instruction being processed.

	instType = uint32(sTalInstructionTable[*(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */))].FinstType)
	switch instType {

	case ASSEM_PUSH:
		goto __4

	case ASSEM_1BYTE:
		goto __5

	case ASSEM_BEGIN_CATCH:
		goto __6

	case ASSEM_BOOL:
		goto __7

	case ASSEM_BOOL_LVT4:
		goto __8

	case ASSEM_CLOCK_READ:
		goto __9

	case ASSEM_CONCAT1:
		goto __10

	case ASSEM_DICT_GET:
		goto __11

	case ASSEM_DICT_SET:
		goto __12

	case ASSEM_DICT_UNSET:
		goto __13

	case ASSEM_END_CATCH:
		goto __14

	case ASSEM_EVAL:
		goto __15

	case ASSEM_INVOKE:
		goto __16

	case ASSEM_JUMP:
		goto __17
	case ASSEM_JUMP4:
		goto __18

	case ASSEM_JUMPTABLE:
		goto __19

	case ASSEM_LABEL:
		goto __20

	case ASSEM_LINDEX_MULTI:
		goto __21

	case ASSEM_LIST:
		goto __22

	case ASSEM_INDEX:
		goto __23

	case ASSEM_LSET_FLAT:
		goto __24

	case ASSEM_LVT:
		goto __25

	case ASSEM_LVT1:
		goto __26

	case ASSEM_LVT1_SINT1:
		goto __27

	case ASSEM_LVT4:
		goto __28

	case ASSEM_OVER:
		goto __29

	case ASSEM_REGEXP:
		goto __30

	case ASSEM_REVERSE:
		goto __31

	case ASSEM_SINT1:
		goto __32

	case ASSEM_SINT4_LVT4:
		goto __33

	default:
		goto __34
	}
	goto __3

__4:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __35
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3535)
	goto cleanup
__35:
	;
	if !(sGetNextOperand(tls, assemEnvPtr, bp+72, bp+96) != TCL_OK) {
		goto __36
	}
	goto cleanup
__36:
	;
	operand1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* operand1Obj */)), bp+104)
	litIndex = XTclRegisterLiteral(tls, envPtr, operand1, *(*int32)(unsafe.Pointer(bp + 104 /* operand1Len */)) /*flags*/, 0)
	sBBEmitInst1or4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), litIndex, 0)
	goto __3

__5:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 1) {
		goto __37
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+2046)
	goto cleanup
__37:
	;
	sBBEmitOpcode(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), 0)
	goto __3

__6:
	// Emit the BEGIN_CATCH instruction with the code offset of the
	// exception branch target instead of the exception range index. The
	// correct index will be generated and inserted later, when catches
	// are being resolved.

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __38
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+2672)
	goto cleanup
__38:
	;
	if !(sGetNextOperand(tls, assemEnvPtr, bp+72, bp+96) != TCL_OK) {
		goto __39
	}
	goto cleanup
__39:
	;
	(*BasicBlock)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FjumpLine = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine
	(*BasicBlock)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FjumpOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), 0, 0)
	*(*int32)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb + 112)) |= BB_BEGINCATCH
	sStartBasicBlock(tls, assemEnvPtr, BB_FALLTHRU, *(*uintptr)(unsafe.Pointer(bp + 96 /* operand1Obj */)))
	goto __3

__7:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __40
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3541)
	goto cleanup
__40:
	;
	if !(sGetBooleanOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK) {
		goto __41
	}
	goto cleanup
__41:
	;
	sBBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), 0)
	goto __3

__8:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3) {
		goto __42
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3549)
	goto cleanup
__42:
	;
	if !(sGetBooleanOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK) {
		goto __43
	}
	goto cleanup
__43:
	;
	localVar = sFindLocalVar(tls, assemEnvPtr, bp+72)
	if !(localVar < 0) {
		goto __44
	}
	goto cleanup
__44:
	;
	sBBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), 0)
__45:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __48
	}
	XTclExpandCodeArray(tls, envPtr)
__48:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar))
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
	goto __3

__9:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __49
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3565)
	goto cleanup
__49:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK) {
		goto __50
	}
	goto cleanup
__50:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 108)) < 0 || *(*int32)(unsafe.Pointer(bp + 108)) > 3) {
		goto __51
	}
	XTcl_SetObjResult(tls, interp,
		XTcl_NewStringObj(tls, ts+3570, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+3597, ts+3603, uintptr(0)))
	goto cleanup
__51:
	;
	sBBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)))
	goto __3

__10:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __52
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3565)
	goto cleanup
__52:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK ||
		sCheckOneByte(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != TCL_OK ||
		sCheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != TCL_OK) {
		goto __53
	}
	goto cleanup
__53:
	;
	sBBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)))
	goto __3

__11:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __54
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3616)
	goto cleanup
__54:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK ||
		sCheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != TCL_OK) {
		goto __55
	}
	goto cleanup
__55:
	;
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108))+1)
	goto __3

__12:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3) {
		goto __56
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3622)
	goto cleanup
__56:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK ||
		sCheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != TCL_OK) {
		goto __57
	}
	goto cleanup
__57:
	;
	localVar = sFindLocalVar(tls, assemEnvPtr, bp+72)
	if !(localVar < 0) {
		goto __58
	}
	goto cleanup
__58:
	;
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108))+1)
__59:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __62
	}
	XTclExpandCodeArray(tls, envPtr)
__62:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar))
	goto __60
__60:
	if 0 != 0 {
		goto __59
	}
	goto __61
__61:
	;
	goto __3

__13:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3) {
		goto __63
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3622)
	goto cleanup
__63:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK ||
		sCheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != TCL_OK) {
		goto __64
	}
	goto cleanup
__64:
	;
	localVar = sFindLocalVar(tls, assemEnvPtr, bp+72)
	if !(localVar < 0) {
		goto __65
	}
	goto cleanup
__65:
	;
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)))
__66:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __69
	}
	XTclExpandCodeArray(tls, envPtr)
__69:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar))
	goto __67
__67:
	if 0 != 0 {
		goto __66
	}
	goto __68
__68:
	;
	goto __3

__14:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 1) {
		goto __70
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+2046)
	goto cleanup
__70:
	;
	*(*int32)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb + 112)) |= BB_ENDCATCH
	sBBEmitOpcode(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), 0)
	sStartBasicBlock(tls, assemEnvPtr, BB_FALLTHRU, uintptr(0))
	goto __3

__15:
	// TODO - Refactor this stuff into a subroutine that takes the inst
	// code, the message ("script" or "expression") and an evaluator
	// callback that calls TclCompileScript or TclCompileExpr.

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __71
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80,
		func() uintptr {
			if sTalInstructionTable[*(*int32)(unsafe.Pointer(bp + 88))].FtclInstCode ==
				INST_EVAL_STK {
				return ts + 3636 /* "script" */
			}
			return ts + 3643 /* "expression" */
		}())
	goto cleanup
__71:
	;
	if !((*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __72
	}
	sCompileEmbeddedScript(tls, assemEnvPtr, *(*uintptr)(unsafe.Pointer(bp + 72))+uintptr(1)*24,
		uintptr(unsafe.Pointer(&sTalInstructionTable))+uintptr(*(*int32)(unsafe.Pointer(bp + 88)))*24)
	goto __73
__72:
	if !(sGetNextOperand(tls, assemEnvPtr, bp+72,
		bp+96) != TCL_OK) {
		goto __74
	}
	goto cleanup
	goto __75
__74:
	operand1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* operand1Obj */)), bp+104)
	litIndex = XTclRegisterLiteral(tls, envPtr, operand1, *(*int32)(unsafe.Pointer(bp + 104 /* operand1Len */)) /*flags*/, 0)

	// Assumes that PUSH is the first slot!

	sBBEmitInst1or4(tls, assemEnvPtr, 0, litIndex, 0)
	sBBEmitOpcode(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), 0)
__75:
	;
__73:
	;
	goto __3

__16:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __76
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3616)
	goto cleanup
__76:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK ||
		sCheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != TCL_OK) {
		goto __77
	}
	goto cleanup
__77:
	;

	sBBEmitInst1or4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)))
	goto __3

__17:
__18:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __78
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+2672)
	goto cleanup
__78:
	;
	if !(sGetNextOperand(tls, assemEnvPtr, bp+72, bp+96) != TCL_OK) {
		goto __79
	}
	goto cleanup
__79:
	;
	(*BasicBlock)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FjumpOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	if !(int32(instType) == ASSEM_JUMP) {
		goto __80
	}
	flags = BB_JUMP1
	sBBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), 0, 0)
	goto __81
__80:
	flags = 0
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), 0, 0)
__81:
	;

	// Start a new basic block at the instruction following the jump.

	(*BasicBlock)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FjumpLine = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine
	if !(sTalInstructionTable[*(*int32)(unsafe.Pointer(bp + 88))].FoperandsConsumed != 0) {
		goto __82
	}
	flags = flags | BB_FALLTHRU
__82:
	;
	sStartBasicBlock(tls, assemEnvPtr, flags, *(*uintptr)(unsafe.Pointer(bp + 96 /* operand1Obj */)))
	goto __3

__19:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __83
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3654)
	goto cleanup
__83:
	;
	if !(sGetNextOperand(tls, assemEnvPtr, bp+72, bp+96) != TCL_OK) {
		goto __84
	}
	goto cleanup
__84:
	;

	jtPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(JumptableInfo{})))

	XTcl_InitHashTable(tls, jtPtr, 0)
	(*BasicBlock)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FjumpLine = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine
	(*BasicBlock)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FjumpOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)

	infoIndex = XTclCreateAuxData(tls, jtPtr, uintptr(unsafe.Pointer(&XtclJumptableInfoType)), envPtr)

	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), infoIndex, 0)
	if !(sCreateMirrorJumpTable(tls, assemEnvPtr, *(*uintptr)(unsafe.Pointer(bp + 96))) != TCL_OK) {
		goto __85
	}
	goto cleanup
__85:
	;
	sStartBasicBlock(tls, assemEnvPtr, BB_JUMPTABLE|BB_FALLTHRU, uintptr(0))
	goto __3

__20:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __86
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3660)
	goto cleanup
__86:
	;
	if !(sGetNextOperand(tls, assemEnvPtr, bp+72, bp+96) != TCL_OK) {
		goto __87
	}
	goto cleanup
__87:
	;

	// Add the (label_name, address) pair to the hash table.

	if !(sDefineLabel(tls, assemEnvPtr, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 96)))) != TCL_OK) {
		goto __88
	}
	goto cleanup
__88:
	;
	goto __3

__21:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __89
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3616)
	goto cleanup
__89:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK ||
		sCheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != TCL_OK) {
		goto __90
	}
	goto cleanup
__90:
	;
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)))
	goto __3

__22:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __91
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3616)
	goto cleanup
__91:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK ||
		sCheckNonNegative(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != TCL_OK) {
		goto __92
	}
	goto cleanup
__92:
	;
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)))
	goto __3

__23:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __93
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3616)
	goto cleanup
__93:
	;
	if !(sGetListIndexOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK) {
		goto __94
	}
	goto cleanup
__94:
	;
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)))
	goto __3

__24:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __95
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3616)
	goto cleanup
__95:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK) {
		goto __96
	}
	goto cleanup
__96:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 108)) < 2) {
		goto __97
	}
	if !((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0) {
		goto __98
	}
	XTcl_SetObjResult(tls, interp,
		XTcl_NewStringObj(tls, ts+3665, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+3597, ts+3685, uintptr(0)))
__98:
	;
	goto cleanup
__97:
	;
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)))
	goto __3

__25:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __99
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3696)
	goto cleanup
__99:
	;
	localVar = sFindLocalVar(tls, assemEnvPtr, bp+72)
	if !(localVar < 0) {
		goto __100
	}
	goto cleanup
__100:
	;
	sBBEmitInst1or4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), localVar, 0)
	goto __3

__26:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __101
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3696)
	goto cleanup
__101:
	;
	localVar = sFindLocalVar(tls, assemEnvPtr, bp+72)
	if !(localVar < 0 || sCheckOneByte(tls, interp, localVar) != 0) {
		goto __102
	}
	goto cleanup
__102:
	;
	sBBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), localVar, 0)
	goto __3

__27:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3) {
		goto __103
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3704)
	goto cleanup
__103:
	;
	localVar = sFindLocalVar(tls, assemEnvPtr, bp+72)
	if !(localVar < 0 || sCheckOneByte(tls, interp, localVar) != 0 ||
		sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK ||
		sCheckSignedOneByte(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != 0) {
		goto __104
	}
	goto cleanup
__104:
	;
	sBBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), localVar, 0)
__105:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __108
	}
	XTclExpandCodeArray(tls, envPtr)
__108:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 108))))
	goto __106
__106:
	if 0 != 0 {
		goto __105
	}
	goto __107
__107:
	;
	goto __3

__28:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __109
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3696)
	goto cleanup
__109:
	;
	localVar = sFindLocalVar(tls, assemEnvPtr, bp+72)
	if !(localVar < 0) {
		goto __110
	}
	goto cleanup
__110:
	;
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), localVar, 0)
	goto __3

__29:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __111
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3616)
	goto cleanup
__111:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK ||
		sCheckNonNegative(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != TCL_OK) {
		goto __112
	}
	goto cleanup
__112:
	;
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108))+1)
	goto __3

__30:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __113
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3541)
	goto cleanup
__113:
	;
	if !(sGetBooleanOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK) {
		goto __114
	}
	goto cleanup
__114:
	;

	sBBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), TCL_REG_ADVANCED|func() int32 {
		if *(*int32)(unsafe.Pointer(bp + 108)) != 0 {
			return TCL_REG_NOCASE
		}
		return 0
	}(), 0)

	goto __3

__31:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __115
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3616)
	goto cleanup
__115:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK ||
		sCheckNonNegative(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != TCL_OK) {
		goto __116
	}
	goto cleanup
__116:
	;
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)))
	goto __3

__32:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __117
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3565)
	goto cleanup
__117:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK ||
		sCheckSignedOneByte(tls, interp, *(*int32)(unsafe.Pointer(bp + 108))) != TCL_OK) {
		goto __118
	}
	goto cleanup
__118:
	;
	sBBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), 0)
	goto __3

__33:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3) {
		goto __119
	}
	XTcl_WrongNumArgs(tls, interp, 1, bp+80, ts+3622)
	goto cleanup
__119:
	;
	if !(sGetIntegerOperand(tls, assemEnvPtr, bp+72, bp+108) != TCL_OK) {
		goto __120
	}
	goto cleanup
__120:
	;
	localVar = sFindLocalVar(tls, assemEnvPtr, bp+72)
	if !(localVar < 0) {
		goto __121
	}
	goto cleanup
__121:
	;
	sBBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 88 /* tblIdx */)), *(*int32)(unsafe.Pointer(bp + 108 /* opnd */)), 0)
__122:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __125
	}
	XTclExpandCodeArray(tls, envPtr)
__125:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar))
	goto __123
__123:
	if 0 != 0 {
		goto __122
	}
	goto __124
__124:
	;
	goto __3

__34:
	XTcl_Panic(tls, ts+3717,
		libc.VaList(bp+64, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* instNameObj */)))))
__3:
	;

	status = TCL_OK
cleanup:
__126:
	_objPtr = *(*uintptr)(unsafe.Pointer(bp + 80))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __129
	}
	XTclFreeObj(tls, _objPtr)
__129:
	;
	goto __127
__127:
	if 0 != 0 {
		goto __126
	}
	goto __128
__128:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 96)) != 0) {
		goto __130
	}
__131:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 96))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __134
	}
	XTclFreeObj(tls, _objPtr1)
__134:
	;
	goto __132
__132:
	if 0 != 0 {
		goto __131
	}
	goto __133
__133:
	;
__130:
	;
	return status
}

//-----------------------------------------------------------------------------
//
// CompileEmbeddedScript --
//
//	Compile an embedded 'eval' or 'expr' that appears in assembly code.
//
// This procedure is called when the 'eval' or 'expr' assembly directive is
// encountered, and the argument to the directive is a simple word that
// requires no substitution. The appropriate compiler (TclCompileScript or
// TclCompileExpr) is invoked recursively, and emits bytecode.
//
// Before the compiler is invoked, the compilation environment's stack
// consumption is reset to zero. Upon return from the compilation, the net
// stack effect of the compilation is in the compiler env, and this stack
// effect is posted to the assembler environment. The compile environment's
// stack consumption is then restored to what it was before (which is actually
// the state of the stack on entry to the block of assembly code).
//
// Any exception ranges pushed by the compilation are copied to the basic
// block and removed from the compiler environment. They will be rebuilt at
// the end of assembly, when the exception stack depth is actually known.
//
//-----------------------------------------------------------------------------

func sCompileEmbeddedScript(tls *libc.TLS, assemEnvPtr uintptr, tokenPtr uintptr, instPtr uintptr) { /* tclAssembly.c:1784:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter

	// The expression or script is not only known at compile time, but
	// actually a "simple word". It can be compiled inline by invoking the
	// compiler recursively.
	//
	// Save away the stack depth and reset it before compiling the script.
	// We'll record the stack usage of the script in the BasicBlock, and
	// accumulate it together with the stack usage of the enclosing assembly
	// code.

	var savedStackDepth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
	var savedMaxStackDepth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth
	var savedExceptArrayNext int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext

	(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = 0
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = 0

	sStartBasicBlock(tls, assemEnvPtr, BB_FALLTHRU, uintptr(0))
	switch (*TalInstDesc)(unsafe.Pointer(instPtr)).FtclInstCode {
	case INST_EVAL_STK:
		XTclCompileScript(tls, interp, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, envPtr)
		break
	case INST_EXPR_STK:
		XTclCompileExpr(tls, interp, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, envPtr, 1)
		break
	default:
		XTcl_Panic(tls, ts+3768,
			libc.VaList(bp, (*TalInstDesc)(unsafe.Pointer(instPtr)).Fname, (*TalInstDesc)(unsafe.Pointer(instPtr)).FtclInstCode))
	}

	// Roll up the stack usage of the embedded block into the assembler
	// environment.

	sSyncStackDepth(tls, assemEnvPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = savedStackDepth
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = savedMaxStackDepth

	// Save any exception ranges that were pushed by the compiler; they will
	// need to be fixed up once the stack depth is known.

	sMoveExceptionRangesToBasicBlock(tls, assemEnvPtr, savedExceptArrayNext)

	// Flush the current basic block.

	sStartBasicBlock(tls, assemEnvPtr, BB_FALLTHRU, uintptr(0))
}

//-----------------------------------------------------------------------------
//
// SyncStackDepth --
//
//	Copies the stack depth from the compile environment to a basic block.
//
// Side effects:
//	Current and max stack depth in the current basic block are adjusted.
//
// This procedure is called on return from invoking the compiler for the
// 'eval' and 'expr' operations. It adjusts the stack depth of the current
// basic block to reflect the stack required by the just-compiled code.
//
//-----------------------------------------------------------------------------

func sSyncStackDepth(tls *libc.TLS, assemEnvPtr uintptr) { /* tclAssembly.c:1867:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var curr_bb uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb
	// Current basic block
	var maxStackDepth int32 = (*BasicBlock)(unsafe.Pointer(curr_bb)).FfinalStackDepth + (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth
	// Max stack depth in the basic block

	if maxStackDepth > (*BasicBlock)(unsafe.Pointer(curr_bb)).FmaxStackDepth {
		(*BasicBlock)(unsafe.Pointer(curr_bb)).FmaxStackDepth = maxStackDepth
	}
	*(*int32)(unsafe.Pointer(curr_bb + 68)) += (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
}

//-----------------------------------------------------------------------------
//
// MoveExceptionRangesToBasicBlock --
//
//	Removes exception ranges that were created by compiling an embedded
//	script from the CompileEnv, and stores them in the BasicBlock. They
//	will be reinstalled, at the correct stack depth, after control flow
//	analysis is complete on the assembly code.
//
//-----------------------------------------------------------------------------

func sMoveExceptionRangesToBasicBlock(tls *libc.TLS, assemEnvPtr uintptr, savedExceptArrayNext int32) { /* tclAssembly.c:1897:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var curr_bb uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb
	// Current basic block
	var exceptionCount int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext - savedExceptArrayNext
	// Number of ranges that must be moved
	var i int32

	if exceptionCount == 0 {
		// Nothing to do
		return
	}

	// Save the exception ranges in the basic block. They will be re-added at
	// the conclusion of assembly; at this time, the INST_BEGIN_CATCH
	// instructions in the block will be adjusted from whatever range indices
	// they have [savedExceptArrayNext .. envPtr->exceptArrayNext) to the
	// indices that the exceptions acquire. The saved exception ranges are
	// converted to a relative nesting depth. The depth will be recomputed
	// once flow analysis has determined the actual stack depth of the block.

	(*BasicBlock)(unsafe.Pointer(curr_bb)).FforeignExceptionBase = savedExceptArrayNext
	(*BasicBlock)(unsafe.Pointer(curr_bb)).FforeignExceptionCount = exceptionCount
	(*BasicBlock)(unsafe.Pointer(curr_bb)).FforeignExceptions = XTcl_Alloc(tls, uint32(uint64(exceptionCount)*uint64(unsafe.Sizeof(ExceptionRange{}))))
	libc.Xmemcpy(tls, (*BasicBlock)(unsafe.Pointer(curr_bb)).FforeignExceptions,
		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(savedExceptArrayNext)*28,
		uint64(exceptionCount)*uint64(unsafe.Sizeof(ExceptionRange{})))
	for i = 0; i < exceptionCount; i++ {
		*(*int32)(unsafe.Pointer((*BasicBlock)(unsafe.Pointer(curr_bb)).FforeignExceptions + uintptr(i)*28 + 4)) -= (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext = savedExceptArrayNext
}

//-----------------------------------------------------------------------------
//
// CreateMirrorJumpTable --
//
//	Makes a jump table with comparison values and assembly code labels.
//
// Results:
//	Returns a standard Tcl status, with an error message in the
//	interpreter on error.
//
// Side effects:
//	Initializes the jump table pointer in the current basic block to a
//	JumptableInfo. The keys in the JumptableInfo are the comparison
//	strings. The values, instead of being jump displacements, are
//	Tcl_Obj's with the code labels.

func sCreateMirrorJumpTable(tls *libc.TLS, assemEnvPtr uintptr, jumps uintptr) int32 { /* tclAssembly.c:1959:1: */
	bp := tls.Alloc(84)
	defer tls.Free(84)

	// var objc int32 at bp+64, 4
	// Number of elements in the 'jumps' list
	// var objv uintptr at bp+72, 8
	// Pointers to the elements in the list
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var bbPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb
	// Current basic block
	var jtPtr uintptr
	var jtHashPtr uintptr // Hashtable in the JumptableInfo
	var hashEntry uintptr // Entry for a key in the hashtable
	// var isNew int32 at bp+80, 4
	// Flag==1 if the key is not yet in the
	// table.
	var i int32

	if XTcl_ListObjGetElements(tls, interp, jumps, bp+64, bp+72) != TCL_OK {
		return TCL_ERROR
	}
	if *(*int32)(unsafe.Pointer(bp + 64))%2 != 0 {
		if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+3813,
				-1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+3597, ts+3866, uintptr(0)))
		}
		return TCL_ERROR
	}

	// Allocate the jumptable.

	jtPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(JumptableInfo{})))
	jtHashPtr = jtPtr
	XTcl_InitHashTable(tls, jtHashPtr, 0)

	// Fill the keys and labels into the table.

	for i = 0; i < *(*int32)(unsafe.Pointer(bp + 64 /* objc */)); i = i + 2 {

		hashEntry = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(jtHashPtr)).FcreateProc})).f(tls, jtHashPtr, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 /* objv */)) + uintptr(i)*8))), bp+80 /* &isNew */)
		if !(*(*int32)(unsafe.Pointer(bp + 80)) != 0) {
			if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+3879,
					libc.VaList(bp+32, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 /* objv */)) + uintptr(i)*8))))))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+3597, ts+3918))
				sDeleteMirrorJumpTable(tls, jtPtr)
				return TCL_ERROR
			}
		}
		(*Tcl_HashEntry)(unsafe.Pointer(hashEntry)).FclientData = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)) + uintptr(i+1)*8))
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)) + uintptr(i+1)*8)))).FrefCount++
	}

	// Put the mirror jumptable in the basic block struct.

	(*BasicBlock)(unsafe.Pointer(bbPtr)).FjtPtr = jtPtr
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// DeleteMirrorJumpTable --
//
//	Cleans up a jump table when the basic block is deleted.
//
//-----------------------------------------------------------------------------

func sDeleteMirrorJumpTable(tls *libc.TLS, jtPtr uintptr) { /* tclAssembly.c:2043:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var jtHashPtr uintptr = jtPtr
	// Hash table pointer
	// var search Tcl_HashSearch at bp, 24
	// Hash search control
	var entry uintptr // Hash table entry containing a jump label
	var label uintptr // Jump label from the hash table

	for entry = XTcl_FirstHashEntry(tls, jtHashPtr, bp); entry != uintptr(0); entry = XTcl_NextHashEntry(tls, bp) {
		label = (*Tcl_HashEntry)(unsafe.Pointer(entry)).FclientData
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = label
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Tcl_HashEntry)(unsafe.Pointer(entry)).FclientData = uintptr(0)
	}
	XTcl_DeleteHashTable(tls, jtHashPtr)
	XTclpFree(tls, jtPtr)
}

//-----------------------------------------------------------------------------
//
// GetNextOperand --
//
//	Retrieves the next operand in sequence from an assembly instruction,
//	and makes sure that its value is known at compile time.
//
// Results:
//	If successful, returns TCL_OK and leaves a Tcl_Obj with the operand
//	text in *operandObjPtr. In case of failure, returns TCL_ERROR and
//	leaves *operandObjPtr untouched.
//
// Side effects:
//	Advances *tokenPtrPtr around the token just processed.
//
//-----------------------------------------------------------------------------

func sGetNextOperand(tls *libc.TLS, assemEnvPtr uintptr, tokenPtrPtr uintptr, operandObjPtr uintptr) int32 { /* tclAssembly.c:2083:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var interp uintptr = (*CompileEnv)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FiPtr
	var operandObj uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			operandObj = XTclThreadAllocObj(tls)
		} else {
			operandObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(operandObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(operandObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(operandObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(operandObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(operandObj)).FtypePtr = uintptr(0)
	{
	}

	if !(XTclWordKnownAtCompileTime(tls, *(*uintptr)(unsafe.Pointer(tokenPtrPtr)), operandObj) != 0) {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = operandObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+3936, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+3597, ts+3980, uintptr(0)))
		}
		return TCL_ERROR
	}
	*(*uintptr)(unsafe.Pointer(tokenPtrPtr)) = *(*uintptr)(unsafe.Pointer(tokenPtrPtr)) + uintptr((*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tokenPtrPtr)))).FnumComponents+1)*24
	(*Tcl_Obj)(unsafe.Pointer(operandObj)).FrefCount++
	*(*uintptr)(unsafe.Pointer(operandObjPtr)) = operandObj
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// GetBooleanOperand --
//
//	Retrieves a Boolean operand from the input stream and advances
//	the token pointer.
//
// Results:
//	Returns a standard Tcl result (with an error message in the
//	interpreter on failure).
//
// Side effects:
//	Stores the Boolean value in (*result) and advances (*tokenPtrPtr)
//	to the next token.
//
//-----------------------------------------------------------------------------

func sGetBooleanOperand(tls *libc.TLS, assemEnvPtr uintptr, tokenPtrPtr uintptr, result uintptr) int32 { /* tclAssembly.c:2129:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var tokenPtr uintptr = *(*uintptr)(unsafe.Pointer(tokenPtrPtr))
	// INOUT: Pointer to the next token in the
	// source code
	// var intObj uintptr at bp, 8
	// Integer from the source code
	var status int32 // Tcl status return

	// Extract the next token as a string.

	if sGetNextOperand(tls, assemEnvPtr, tokenPtrPtr, bp) != TCL_OK {
		return TCL_ERROR
	}

	// Convert to an integer, advance to the next token and return.

	status = XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* intObj */)), result)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	*(*uintptr)(unsafe.Pointer(tokenPtrPtr)) = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	return status
}

//-----------------------------------------------------------------------------
//
// GetIntegerOperand --
//
//	Retrieves an integer operand from the input stream and advances the
//	token pointer.
//
// Results:
//	Returns a standard Tcl result (with an error message in the
//	interpreter on failure).
//
// Side effects:
//	Stores the integer value in (*result) and advances (*tokenPtrPtr) to
//	the next token.
//
//-----------------------------------------------------------------------------

func sGetIntegerOperand(tls *libc.TLS, assemEnvPtr uintptr, tokenPtrPtr uintptr, result uintptr) int32 { /* tclAssembly.c:2182:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var tokenPtr uintptr = *(*uintptr)(unsafe.Pointer(tokenPtrPtr))
	// INOUT: Pointer to the next token in the
	// source code
	// var intObj uintptr at bp, 8
	// Integer from the source code
	var status int32 // Tcl status return

	// Extract the next token as a string.

	if sGetNextOperand(tls, assemEnvPtr, tokenPtrPtr, bp) != TCL_OK {
		return TCL_ERROR
	}

	// Convert to an integer, advance to the next token and return.

	status = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* intObj */)), result)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	*(*uintptr)(unsafe.Pointer(tokenPtrPtr)) = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	return status
}

//-----------------------------------------------------------------------------
//
// GetListIndexOperand --
//
//	Gets the value of an operand intended to serve as a list index.
//
// Results:
//	Returns a standard Tcl result: TCL_OK if the parse is successful and
//	TCL_ERROR (with an appropriate error message) if the parse fails.
//
// Side effects:
//	Stores the list index at '*index'. Values between -1 and 0x7FFFFFFF
//	have their natural meaning; values between -2 and -0x80000000
//	represent 'end-2-N'.
//
//-----------------------------------------------------------------------------

func sGetListIndexOperand(tls *libc.TLS, assemEnvPtr uintptr, tokenPtrPtr uintptr, result uintptr) int32 { /* tclAssembly.c:2235:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var tokenPtr uintptr = *(*uintptr)(unsafe.Pointer(tokenPtrPtr))
	// INOUT: Pointer to the next token in the
	// source code
	// var value uintptr at bp, 8

	var status int32

	// General operand validity check
	if sGetNextOperand(tls, assemEnvPtr, tokenPtrPtr, bp) != TCL_OK {
		return TCL_ERROR
	}

	// Convert to an integer, advance to the next token and return.
	// NOTE: Indexing a list with an index before it yields the
	// same result as indexing after it, and might be more easily portable
	// when list size limits grow.
	status = XTclIndexEncode(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* value */)),
		-1, -1, result)

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	*(*uintptr)(unsafe.Pointer(tokenPtrPtr)) = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	return status
}

//-----------------------------------------------------------------------------
//
// FindLocalVar --
//
//	Gets the name of a local variable from the input stream and advances
//	the token pointer.
//
// Results:
//	Returns the LVT index of the local variable.  Returns -1 if the
//	variable is non-local, not known at compile time, or cannot be
//	installed in the LVT (leaving an error message in the interpreter
//	result if necessary).
//
// Side effects:
//	Advances the token pointer.  May define a new LVT slot if the variable
//	has not yet been seen and the execution context allows for it.
//
//-----------------------------------------------------------------------------

func sFindLocalVar(tls *libc.TLS, assemEnvPtr uintptr, tokenPtrPtr uintptr) int32 { /* tclAssembly.c:2291:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var tokenPtr uintptr = *(*uintptr)(unsafe.Pointer(tokenPtrPtr))
	// INOUT: Pointer to the next token in the
	// source code.
	// var varNameObj uintptr at bp+32, 8
	// Name of the variable
	var varNameStr uintptr
	// var varNameLen int32 at bp+40, 4

	var localVar int32 // Index of the variable in the LVT

	if sGetNextOperand(tls, assemEnvPtr, tokenPtrPtr, bp+32) != TCL_OK {
		return -1
	}
	varNameStr = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* varNameObj */)), bp+40)
	if sCheckNamespaceQualifiers(tls, interp, varNameStr, *(*int32)(unsafe.Pointer(bp + 40))) != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 32))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return -1
	}
	localVar = XTclFindCompiledLocal(tls, varNameStr, *(*int32)(unsafe.Pointer(bp + 40 /* varNameLen */)), 1, envPtr)
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 32))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if localVar == -1 {
		if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

				ts+3988, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+3597, ts+4059, uintptr(0)))
		}
		return -1
	}
	*(*uintptr)(unsafe.Pointer(tokenPtrPtr)) = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	return localVar
}

//-----------------------------------------------------------------------------
//
// CheckNamespaceQualifiers --
//
//	Verify that a variable name has no namespace qualifiers before
//	attempting to install it in the LVT.
//
// Results:
//	On success, returns TCL_OK. On failure, returns TCL_ERROR and stores
//	an error message in the interpreter result.
//
//-----------------------------------------------------------------------------

func sCheckNamespaceQualifiers(tls *libc.TLS, interp uintptr, name uintptr, nameLen int32) int32 { /* tclAssembly.c:2346:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var p uintptr

	for p = name; p+uintptr(2) < name+uintptr(nameLen); p++ {
		if int32(*(*int8)(unsafe.Pointer(p))) == ':' && int32(*(*int8)(unsafe.Pointer(p + 1))) == ':' {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+4063, libc.VaList(bp, name)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+3597, ts+4090, name, uintptr(0)))
			return TCL_ERROR
		}
	}
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// CheckOneByte --
//
//	Verify that a constant fits in a single byte in the instruction
//	stream.
//
// Results:
//	On success, returns TCL_OK. On failure, returns TCL_ERROR and stores
//	an error message in the interpreter result.
//
// This code is here primarily to verify that instructions like INCR_SCALAR1
// are possible on a given local variable. The fact that there is no
// INCR_SCALAR4 is puzzling.
//
//-----------------------------------------------------------------------------

func sCheckOneByte(tls *libc.TLS, interp uintptr, value int32) int32 { /* tclAssembly.c:2384:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var result uintptr // Error message

	if value < 0 || value > 0xFF {
		result = XTcl_NewStringObj(tls, ts+4099, -1)
		XTcl_SetObjResult(tls, interp, result)
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+3597, ts+4132, uintptr(0)))
		return TCL_ERROR
	}
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// CheckSignedOneByte --
//
//	Verify that a constant fits in a single signed byte in the instruction
//	stream.
//
// Results:
//	On success, returns TCL_OK. On failure, returns TCL_ERROR and stores
//	an error message in the interpreter result.
//
// This code is here primarily to verify that instructions like INCR_SCALAR1
// are possible on a given local variable. The fact that there is no
// INCR_SCALAR4 is puzzling.
//
//-----------------------------------------------------------------------------

func sCheckSignedOneByte(tls *libc.TLS, interp uintptr, value int32) int32 { /* tclAssembly.c:2419:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var result uintptr // Error message

	if value > 0x7F || value < -0x80 {
		result = XTcl_NewStringObj(tls, ts+4099, -1)
		XTcl_SetObjResult(tls, interp, result)
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+3597, ts+4132, uintptr(0)))
		return TCL_ERROR
	}
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// CheckNonNegative --
//
//	Verify that a constant is nonnegative
//
// Results:
//	On success, returns TCL_OK. On failure, returns TCL_ERROR and stores
//	an error message in the interpreter result.
//
// This code is here primarily to verify that instructions like INCR_INVOKE
// are consuming a positive number of operands
//
//-----------------------------------------------------------------------------

func sCheckNonNegative(tls *libc.TLS, interp uintptr, value int32) int32 { /* tclAssembly.c:2452:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var result uintptr // Error message

	if value < 0 {
		result = XTcl_NewStringObj(tls, ts+4138, -1)
		XTcl_SetObjResult(tls, interp, result)
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+3597, ts+4166, uintptr(0)))
		return TCL_ERROR
	}
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// CheckStrictlyPositive --
//
//	Verify that a constant is positive
//
// Results:
//	On success, returns TCL_OK. On failure, returns TCL_ERROR and
//	stores an error message in the interpreter result.
//
// This code is here primarily to verify that instructions like INCR_INVOKE
// are consuming a positive number of operands
//
//-----------------------------------------------------------------------------

func sCheckStrictlyPositive(tls *libc.TLS, interp uintptr, value int32) int32 { /* tclAssembly.c:2485:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var result uintptr // Error message

	if value <= 0 {
		result = XTcl_NewStringObj(tls, ts+4178, -1)
		XTcl_SetObjResult(tls, interp, result)
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+3597, ts+4203, uintptr(0)))
		return TCL_ERROR
	}
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// DefineLabel --
//
//	Defines a label appearing in the assembly sequence.
//
// Results:
//	Returns a standard Tcl result. Returns TCL_OK and an empty result if
//	the definition succeeds; returns TCL_ERROR and an appropriate message
//	if a duplicate definition is found.
//
//-----------------------------------------------------------------------------

func sDefineLabel(tls *libc.TLS, assemEnvPtr uintptr, labelName uintptr) int32 { /* tclAssembly.c:2516:1: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var entry uintptr // Label's entry in the symbol table
	// var isNew int32 at bp+48, 4
	// Flag == 1 iff the label was previously
	// undefined

	// TODO - This can now be simplified!

	sStartBasicBlock(tls, assemEnvPtr, BB_FALLTHRU, uintptr(0))

	// Look up the newly-defined label in the symbol table.

	entry = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16 /* &.labelHash */)).FcreateProc})).f(tls, assemEnvPtr+16 /* &.labelHash */, labelName, bp+48 /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp + 48)) != 0) {
		// This is a duplicate label.

		if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+4212, libc.VaList(bp, labelName)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+3597, ts+4247, labelName,
				uintptr(0)))
		}
		return TCL_ERROR
	}

	// This is the first appearance of the label in the code.

	(*Tcl_HashEntry)(unsafe.Pointer(entry)).FclientData = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// StartBasicBlock --
//
//	Starts a new basic block when a label or jump is encountered.
//
// Results:
//	Returns a pointer to the BasicBlock structure of the new
//	basic block.
//
//-----------------------------------------------------------------------------

func sStartBasicBlock(tls *libc.TLS, assemEnvPtr uintptr, flags int32, jumpLabel uintptr) uintptr { /* tclAssembly.c:2573:18: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var newBB uintptr // BasicBlock structure for the new block
	var currBB uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb

	// Coalesce zero-length blocks.

	if int64((*BasicBlock)(unsafe.Pointer(currBB)).FstartOffset) == (int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 {
		(*BasicBlock)(unsafe.Pointer(currBB)).FstartLine = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine
		return currBB
	}

	// Make the new basic block.

	newBB = sAllocBB(tls, assemEnvPtr)

	// Record the jump target if there is one.

	(*BasicBlock)(unsafe.Pointer(currBB)).FjumpTarget = jumpLabel
	if jumpLabel != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer((*BasicBlock)(unsafe.Pointer(currBB)).FjumpTarget)).FrefCount++
	}

	// Record the fallthrough if there is one.

	*(*int32)(unsafe.Pointer(currBB + 112)) |= flags

	// Record the successor block.

	(*BasicBlock)(unsafe.Pointer(currBB)).Fsuccessor1 = newBB
	(*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb = newBB
	return newBB
}

//-----------------------------------------------------------------------------
//
// AllocBB --
//
//	Allocates a new basic block
//
// Results:
//	Returns a pointer to the newly allocated block, which is initialized
//	to contain no code and begin at the current instruction pointer.
//
//-----------------------------------------------------------------------------

func sAllocBB(tls *libc.TLS, assemEnvPtr uintptr) uintptr { /* tclAssembly.c:2639:19: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	var bb uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(BasicBlock{})))

	(*BasicBlock)(unsafe.Pointer(bb)).ForiginalStartOffset = libc.AssignPtrInt32(bb+4, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1))
	(*BasicBlock)(unsafe.Pointer(bb)).FstartLine = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine + 1
	(*BasicBlock)(unsafe.Pointer(bb)).FjumpOffset = -1
	(*BasicBlock)(unsafe.Pointer(bb)).FjumpLine = -1
	(*BasicBlock)(unsafe.Pointer(bb)).FprevPtr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb
	(*BasicBlock)(unsafe.Pointer(bb)).Fpredecessor = uintptr(0)
	(*BasicBlock)(unsafe.Pointer(bb)).Fsuccessor1 = uintptr(0)
	(*BasicBlock)(unsafe.Pointer(bb)).FjumpTarget = uintptr(0)
	(*BasicBlock)(unsafe.Pointer(bb)).FinitialStackDepth = 0
	(*BasicBlock)(unsafe.Pointer(bb)).FminStackDepth = 0
	(*BasicBlock)(unsafe.Pointer(bb)).FmaxStackDepth = 0
	(*BasicBlock)(unsafe.Pointer(bb)).FfinalStackDepth = 0
	(*BasicBlock)(unsafe.Pointer(bb)).FcatchDepth = 0
	(*BasicBlock)(unsafe.Pointer(bb)).FenclosingCatch = uintptr(0)
	(*BasicBlock)(unsafe.Pointer(bb)).FforeignExceptionBase = -1
	(*BasicBlock)(unsafe.Pointer(bb)).FforeignExceptionCount = 0
	(*BasicBlock)(unsafe.Pointer(bb)).FforeignExceptions = uintptr(0)
	(*BasicBlock)(unsafe.Pointer(bb)).FjtPtr = uintptr(0)
	(*BasicBlock)(unsafe.Pointer(bb)).Fflags = 0

	return bb
}

//-----------------------------------------------------------------------------
//
// FinishAssembly --
//
//	Postprocessing after all bytecode has been generated for a block of
//	assembly code.
//
// Results:
//	Returns a standard Tcl result, with an error message left in the
//	interpreter if appropriate.
//
// Side effects:
//	The program is checked to see if any undefined labels remain.  The
//	initial stack depth of all the basic blocks in the flow graph is
//	calculated and saved.  The stack balance on exit is computed, checked
//	and saved.
//
//-----------------------------------------------------------------------------

func sFinishAssembly(tls *libc.TLS, assemEnvPtr uintptr) int32 { /* tclAssembly.c:2692:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var mustMove int32 at bp, 4
	// Amount by which the code needs to be grown
	// because of expanding jumps

	// Resolve the targets of all jumps and determine whether code needs to be
	// moved around.

	if sCalculateJumpRelocations(tls, assemEnvPtr, bp) != 0 {
		return TCL_ERROR
	}

	// Move the code if necessary.

	if *(*int32)(unsafe.Pointer(bp)) != 0 {
		sMoveCodeForJumps(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp /* mustMove */)))
	}

	// Resolve jump target labels to bytecode offsets.

	sFillInJumpOffsets(tls, assemEnvPtr)

	// Label each basic block with its catch context. Quit on inconsistency.

	if sProcessCatches(tls, assemEnvPtr) != TCL_OK {
		return TCL_ERROR
	}

	// Make sure that no block accessible from a catch's error exit that hasn't
	// popped the exception stack can throw an exception.

	if sCheckForThrowInWrongContext(tls, assemEnvPtr) != TCL_OK {
		return TCL_ERROR
	}

	// Compute stack balance throughout the program.

	if sCheckStack(tls, assemEnvPtr) != TCL_OK {
		return TCL_ERROR
	}

	// TODO - Check for unreachable code. Or maybe not; unreachable code is
	// Mostly Harmless.

	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// CalculateJumpRelocations --
//
//	Calculate any movement that has to be done in the assembly code to
//	expand JUMP1 instructions to JUMP4 (because they jump more than a
//	1-byte range).
//
// Results:
//	Returns a standard Tcl result, with an appropriate error message if
//	anything fails.
//
// Side effects:
//	Sets the 'startOffset' pointer in every basic block to the new origin
//	of the block, and turns off JUMP1 flags on instructions that must be
//	expanded (and adjusts them to the corresponding JUMP4's).  Does *not*
//	store the jump offsets at this point.
//
//	Sets *mustMove to 1 if and only if at least one instruction changed
//	size so the code must be moved.
//
//	As a side effect, also checks for undefined labels and reports them.
//
//-----------------------------------------------------------------------------

func sCalculateJumpRelocations(tls *libc.TLS, assemEnvPtr uintptr, mustMove uintptr) int32 { /* tclAssembly.c:2782:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var bbPtr uintptr      // Pointer to a basic block being checked
	var entry uintptr      // Exit label's entry in the symbol table
	var jumpTarget uintptr // Basic block where the jump goes
	var motion int32       // Amount by which the code has expanded
	var offset int32       // Offset in the bytecode from a jump
	// instruction to its target
	var opcode uint32 // Opcode in the bytecode being adjusted

	// Iterate through basic blocks as long as a change results in code
	// expansion.

	*(*int32)(unsafe.Pointer(mustMove)) = 0
	for ok := true; ok; ok = motion != 0 {
		motion = 0
		for bbPtr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb; bbPtr != uintptr(0); bbPtr = (*BasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 {
			// Advance the basic block start offset by however many bytes we
			// have inserted in the code up to this point

			*(*int32)(unsafe.Pointer(bbPtr + 4)) += motion

			// If the basic block references a label (and hence performs a
			// jump), find the location of the label. Report an error if the
			// label is missing.

			if (*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget != uintptr(0) {
				entry = (*struct {
					f func(*libc.TLS, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16 /* &.labelHash */)).FfindProc})).f(tls, assemEnvPtr+16 /* &.labelHash */, XTcl_GetString(tls, (*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget))
				if entry == uintptr(0) {
					sReportUndefinedLabel(tls, assemEnvPtr, bbPtr,
						(*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget)
					return TCL_ERROR
				}

				// If the instruction is a JUMP1, turn it into a JUMP4 if its
				// target is out of range.

				jumpTarget = (*Tcl_HashEntry)(unsafe.Pointer(entry)).FclientData
				if (*BasicBlock)(unsafe.Pointer(bbPtr)).Fflags&BB_JUMP1 != 0 {
					offset = (*BasicBlock)(unsafe.Pointer(jumpTarget)).FstartOffset -
						((*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset + motion)
					if offset < -0x80 || offset > 0x7F {
						opcode = uint32(*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset))))
						opcode++
						*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset))) = uint8(opcode)
						motion = motion + 3
						*(*int32)(unsafe.Pointer(bbPtr + 112)) &= libc.CplInt32(BB_JUMP1)
					}
				}
			}

			// If the basic block references a jump table, that doesn't affect
			// the code locations, but resolve the labels now, and store basic
			// block pointers in the jumptable hash.

			if (*BasicBlock)(unsafe.Pointer(bbPtr)).Fflags&BB_JUMPTABLE != 0 {
				if sCheckJumpTableLabels(tls, assemEnvPtr, bbPtr) != TCL_OK {
					return TCL_ERROR
				}
			}
		}
		*(*int32)(unsafe.Pointer(mustMove)) += motion
	}

	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// CheckJumpTableLabels --
//
//	Make sure that all the labels in a jump table are defined.
//
// Results:
//	Returns TCL_OK if they are, TCL_ERROR if they aren't.
//
//-----------------------------------------------------------------------------

func sCheckJumpTableLabels(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr) int32 { /* tclAssembly.c:2883:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var symHash uintptr = (*BasicBlock)(unsafe.Pointer(bbPtr)).FjtPtr
	// Hash table with the symbols
	// var search Tcl_HashSearch at bp, 24
	// Hash table iterator
	var symEntryPtr uintptr // Hash entry for the symbols
	var symbolObj uintptr   // Jump target
	var valEntryPtr uintptr // Hash entry for the resolutions

	// Look up every jump target in the jump hash.

	for symEntryPtr = XTcl_FirstHashEntry(tls, symHash, bp); symEntryPtr != uintptr(0); symEntryPtr = XTcl_NextHashEntry(tls, bp) {
		symbolObj = (*Tcl_HashEntry)(unsafe.Pointer(symEntryPtr)).FclientData
		valEntryPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16 /* &.labelHash */)).FfindProc})).f(tls, assemEnvPtr+16 /* &.labelHash */, XTcl_GetString(tls, symbolObj))

		if valEntryPtr == uintptr(0) {
			sReportUndefinedLabel(tls, assemEnvPtr, bbPtr, symbolObj)
			return TCL_ERROR
		}
	}

	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// ReportUndefinedLabel --
//
//	Report that a basic block refers to an undefined jump label
//
// Side effects:
//	Stores an error message, error code, and line number information in
//	the assembler's Tcl interpreter.
//
//-----------------------------------------------------------------------------

func sReportUndefinedLabel(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr, jumpTarget uintptr) { /* tclAssembly.c:2932:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter

	if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+4256, libc.VaList(bp, XTcl_GetString(tls, jumpTarget))))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+3597, ts+4277,
			XTcl_GetString(tls, jumpTarget), uintptr(0)))
		XTcl_SetErrorLine(tls, interp, (*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpLine)
	}
}

//-----------------------------------------------------------------------------
//
// MoveCodeForJumps --
//
//	Move bytecodes in memory to accommodate JUMP1 instructions that have
//	expanded to become JUMP4's.
//
//-----------------------------------------------------------------------------

func sMoveCodeForJumps(tls *libc.TLS, assemEnvPtr uintptr, mustMove int32) { /* tclAssembly.c:2964:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var bbPtr uintptr   // Pointer to a basic block being checked
	var topOffset int32 // Bytecode offset of the following basic
	// block before code motion

	// Make sure that there is enough space in the bytecode array to
	// accommodate the expanded code.

	for (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd < (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(mustMove) {
		XTclExpandCodeArray(tls, envPtr)
	}

	// Iterate through the bytecodes in reverse order, and move them upward to
	// their new homes.

	topOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for bbPtr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb; bbPtr != uintptr(0); bbPtr = (*BasicBlock)(unsafe.Pointer(bbPtr)).FprevPtr {

		libc.Xmemmove(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart+uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset),
			(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart+uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).ForiginalStartOffset),
			uint64(topOffset-(*BasicBlock)(unsafe.Pointer(bbPtr)).ForiginalStartOffset))
		topOffset = (*BasicBlock)(unsafe.Pointer(bbPtr)).ForiginalStartOffset
		*(*int32)(unsafe.Pointer(bbPtr + 12)) += (*BasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset - (*BasicBlock)(unsafe.Pointer(bbPtr)).ForiginalStartOffset
	}
	*(*uintptr)(unsafe.Pointer(envPtr + 120)) += uintptr(mustMove)
}

//-----------------------------------------------------------------------------
//
// FillInJumpOffsets --
//
//	Fill in the final offsets of all jump instructions once bytecode
//	locations have been completely determined.
//
//-----------------------------------------------------------------------------

func sFillInJumpOffsets(tls *libc.TLS, assemEnvPtr uintptr) { /* tclAssembly.c:3013:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var bbPtr uintptr      // Pointer to a basic block being checked
	var entry uintptr      // Hashtable entry for a jump target label
	var jumpTarget uintptr // Basic block where a jump goes
	var fromOffset int32   // Bytecode location of a jump instruction
	var targetOffset int32 // Bytecode location of a jump instruction's
	// target

	for bbPtr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb; bbPtr != uintptr(0); bbPtr = (*BasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 {
		if (*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget != uintptr(0) {
			entry = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16 /* &.labelHash */)).FfindProc})).f(tls, assemEnvPtr+16 /* &.labelHash */, XTcl_GetString(tls, (*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget))
			jumpTarget = (*Tcl_HashEntry)(unsafe.Pointer(entry)).FclientData
			fromOffset = (*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset
			targetOffset = (*BasicBlock)(unsafe.Pointer(jumpTarget)).FstartOffset
			if (*BasicBlock)(unsafe.Pointer(bbPtr)).Fflags&BB_JUMP1 != 0 {
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(fromOffset) + uintptr(1))) = uint8(uint32(targetOffset - fromOffset))
			} else {
				for ok := true; ok; ok = 0 != 0 {
					*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(fromOffset) + uintptr(1))) = uint8(uint32(targetOffset-fromOffset) >> 24)
					*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(fromOffset) + uintptr(1) + uintptr(1))) = uint8(uint32(targetOffset-fromOffset) >> 16)
					*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(fromOffset) + uintptr(1) + uintptr(2))) = uint8(uint32(targetOffset-fromOffset) >> 8)
					*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(fromOffset) + uintptr(1) + uintptr(3))) = uint8(uint32(targetOffset - fromOffset))
				}
			}
		}
		if (*BasicBlock)(unsafe.Pointer(bbPtr)).Fflags&BB_JUMPTABLE != 0 {
			sResolveJumpTableTargets(tls, assemEnvPtr, bbPtr)
		}
	}
}

//-----------------------------------------------------------------------------
//
// ResolveJumpTableTargets --
//
//	Puts bytecode addresses for the targets of a jumptable into the
//	table
//
// Results:
//	Returns TCL_OK if they are, TCL_ERROR if they aren't.
//
//-----------------------------------------------------------------------------

func sResolveJumpTableTargets(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr) { /* tclAssembly.c:3063:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var symHash uintptr = (*BasicBlock)(unsafe.Pointer(bbPtr)).FjtPtr
	// Hash table with the symbols
	// var search Tcl_HashSearch at bp, 24
	// Hash table iterator
	var symEntryPtr uintptr // Hash entry for the symbols
	var symbolObj uintptr   // Jump target
	var valEntryPtr uintptr // Hash entry for the resolutions
	var auxDataIndex int32  // Index of the auxdata
	var realJumpTablePtr uintptr
	// Jump table in the actual code
	var realJumpHashPtr uintptr
	// Jump table hash in the actual code
	var realJumpEntryPtr uintptr
	// Entry in the jump table hash in
	// the actual code
	var jumpTargetBBPtr uintptr
	// Basic block that the jump proceeds to
	// var junk int32 at bp+24, 4

	auxDataIndex = int32(uint32(*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset) + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset) + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset) + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset) + uintptr(1) + uintptr(3))))

	realJumpTablePtr = (*AuxData)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr + uintptr(auxDataIndex)*16)).FclientData
	realJumpHashPtr = realJumpTablePtr

	// Look up every jump target in the jump hash.

	for symEntryPtr = XTcl_FirstHashEntry(tls, symHash, bp); symEntryPtr != uintptr(0); symEntryPtr = XTcl_NextHashEntry(tls, bp) {
		symbolObj = (*Tcl_HashEntry)(unsafe.Pointer(symEntryPtr)).FclientData

		valEntryPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16 /* &.labelHash */)).FfindProc})).f(tls, assemEnvPtr+16 /* &.labelHash */, XTcl_GetString(tls, symbolObj))
		jumpTargetBBPtr = (*Tcl_HashEntry)(unsafe.Pointer(valEntryPtr)).FclientData

		realJumpEntryPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(realJumpHashPtr)).FcreateProc})).f(tls, realJumpHashPtr, func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(symHash)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(symHash)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(symEntryPtr + 32))
			}
			return symEntryPtr + 32
		}(), bp+24)

		(*Tcl_HashEntry)(unsafe.Pointer(realJumpEntryPtr)).FclientData = uintptr(Intptr_t((*BasicBlock)(unsafe.Pointer(jumpTargetBBPtr)).FstartOffset - (*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset))
	}

}

//-----------------------------------------------------------------------------
//
// CheckForThrowInWrongContext --
//
//	Verify that no beginCatch/endCatch sequence can throw an exception
//	after an original exception is caught and before its exception context
//	is removed from the stack.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Stores an appropriate error message in the interpreter as needed.
//
//-----------------------------------------------------------------------------

func sCheckForThrowInWrongContext(tls *libc.TLS, assemEnvPtr uintptr) int32 { /* tclAssembly.c:3140:1: */
	var blockPtr uintptr // Current basic block

	// Walk through the basic blocks in turn, checking all the ones that have
	// caught an exception and not disposed of it properly.

	for blockPtr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb; blockPtr != uintptr(0); blockPtr = (*BasicBlock)(unsafe.Pointer(blockPtr)).Fsuccessor1 {
		if int32((*BasicBlock)(unsafe.Pointer(blockPtr)).FcatchState) == BBCS_CAUGHT {
			// Walk through the instructions in the basic block.

			if sCheckNonThrowingBlock(tls, assemEnvPtr, blockPtr) != TCL_OK {
				return TCL_ERROR
			}
		}
	}
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// CheckNonThrowingBlock --
//
//	Check that a basic block cannot throw an exception.
//
// Results:
//	Returns TCL_ERROR if the block cannot be proven to be nonthrowing.
//
// Side effects:
//	Stashes an error message in the interpreter result.
//
//-----------------------------------------------------------------------------

func sCheckNonThrowingBlock(tls *libc.TLS, assemEnvPtr uintptr, blockPtr uintptr) int32 { /* tclAssembly.c:3183:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var nextPtr uintptr // Pointer to the succeeding basic block
	var offset int32    // Bytecode offset of the current
	// instruction
	var bound int32 // Bytecode offset following the last
	// instruction of the block.
	var opcode uint8 // Current bytecode instruction

	// Determine where in the code array the basic block ends.

	nextPtr = (*BasicBlock)(unsafe.Pointer(blockPtr)).Fsuccessor1
	if nextPtr == uintptr(0) {
		bound = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	} else {
		bound = (*BasicBlock)(unsafe.Pointer(nextPtr)).FstartOffset
	}

	// Walk through the instructions of the block.

	offset = (*BasicBlock)(unsafe.Pointer(blockPtr)).FstartOffset
	for offset < bound {
		// Determine whether an instruction is nonthrowing.

		opcode = *(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(offset)))
		if sBytecodeMightThrow(tls, opcode) != 0 {
			// Report an error for a throw in the wrong context.

			if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

					ts+4285,
					libc.VaList(bp, XtclInstructionTable[opcode].Fname)))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+3597, ts+4386, uintptr(0)))
				sAddBasicBlockRangeToErrorInfo(tls, assemEnvPtr, blockPtr)
			}
			return TCL_ERROR
		}
		offset = offset + XtclInstructionTable[opcode].FnumBytes
	}
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// BytecodeMightThrow --
//
//	Tests if a given bytecode instruction might throw an exception.
//
// Results:
//	Returns 1 if the bytecode might throw an exception, 0 if the
//	instruction is known never to throw.
//
//-----------------------------------------------------------------------------

func sBytecodeMightThrow(tls *libc.TLS, opcode uint8) int32 { /* tclAssembly.c:3257:1: */
	// Binary search on the non-throwing bytecode list.

	var min int32 = 0
	var max int32 = int32(uint64(unsafe.Sizeof(sNonThrowingByteCodes)) - uint64(1))
	var mid int32
	var c uint8

	for max >= min {
		mid = (min + max) / 2
		c = sNonThrowingByteCodes[mid]
		if int32(opcode) < int32(c) {
			max = mid - 1
		} else if int32(opcode) > int32(c) {
			min = mid + 1
		} else {
			// Opcode is nonthrowing.

			return 0
		}
	}

	return 1
}

//-----------------------------------------------------------------------------
//
// CheckStack --
//
//	Audit stack usage in a block of assembly code.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Updates stack depth on entry for all basic blocks in the flowgraph.
//	Calculates the max stack depth used in the program, and updates the
//	compilation environment to reflect it.
//
//-----------------------------------------------------------------------------

func sCheckStack(tls *libc.TLS, assemEnvPtr uintptr) int32 { /* tclAssembly.c:3307:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var maxDepth int32 // Maximum stack depth overall

	// Checking the head block will check all the other blocks recursively.

	(*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FmaxDepth = 0
	if sStackCheckBasicBlock(tls, assemEnvPtr, (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb, uintptr(0),
		0) == TCL_ERROR {
		return TCL_ERROR
	}

	// Post the max stack depth back to the compilation environment.

	maxDepth = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FmaxDepth + (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
	if maxDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth {
		(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = maxDepth
	}

	// If the exit is reachable, make sure that the program exits with 1
	// operand on the stack.

	if sStackCheckExit(tls, assemEnvPtr) != TCL_OK {
		return TCL_ERROR
	}

	// Reset the visited state on all basic blocks.

	sResetVisitedBasicBlocks(tls, assemEnvPtr)
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// StackCheckBasicBlock --
//
//	Checks stack consumption for a basic block (and recursively for its
//	successors).
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Updates initial stack depth for the basic block and its successors.
//	(Final and maximum stack depth are relative to initial, and are not
//	touched).
//
// This procedure eventually checks, for the entire flow graph, whether stack
// balance is consistent.  It is an error for a given basic block to be
// reachable along multiple flow paths with different stack depths.
//
//-----------------------------------------------------------------------------

func sStackCheckBasicBlock(tls *libc.TLS, assemEnvPtr uintptr, blockPtr uintptr, predecessor uintptr, initialStackDepth int32) int32 { /* tclAssembly.c:3374:1: */
	bp := tls.Alloc(120)
	defer tls.Free(120)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var jumpTarget uintptr // Basic block where a jump goes
	var stackDepth int32   // Current stack depth
	var maxDepth int32     // Maximum stack depth so far
	var result int32       // Tcl status return
	// var jtSearch Tcl_HashSearch at bp+96, 24
	// Search structure for the jump table
	var jtEntry uintptr     // Hash entry in the jump table
	var targetLabel uintptr // Target label from the jump table
	var entry uintptr       // Hash entry in the label table

	if (*BasicBlock)(unsafe.Pointer(blockPtr)).Fflags&BB_VISITED != 0 {
		// If the block is already visited, check stack depth for consistency
		// among the paths that reach it.

		if (*BasicBlock)(unsafe.Pointer(blockPtr)).FinitialStackDepth == initialStackDepth {
			return TCL_OK
		}
		if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+4395, -1))

			// TODO - add execution trace of both paths

			XTcl_SetErrorLine(tls, interp, (*BasicBlock)(unsafe.Pointer(blockPtr)).FstartLine)
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+3597, ts+4444, uintptr(0)))
		}
		return TCL_ERROR
	}

	// If the block is not already visited, set the 'predecessor' link to
	// indicate how control got to it. Set the initial stack depth to the
	// current stack depth in the flow of control.

	*(*int32)(unsafe.Pointer(blockPtr + 112)) |= BB_VISITED
	(*BasicBlock)(unsafe.Pointer(blockPtr)).Fpredecessor = predecessor
	(*BasicBlock)(unsafe.Pointer(blockPtr)).FinitialStackDepth = initialStackDepth

	// Calculate minimum stack depth, and flag an error if the block
	// underflows the stack.

	if initialStackDepth+(*BasicBlock)(unsafe.Pointer(blockPtr)).FminStackDepth < 0 {
		if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+4453, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+3597, ts+4444, uintptr(0)))
			sAddBasicBlockRangeToErrorInfo(tls, assemEnvPtr, blockPtr)
			XTcl_SetErrorLine(tls, interp, (*BasicBlock)(unsafe.Pointer(blockPtr)).FstartLine)
		}
		return TCL_ERROR
	}

	// Make sure that the block doesn't try to pop below the stack level of an
	// enclosing catch.

	if (*BasicBlock)(unsafe.Pointer(blockPtr)).FenclosingCatch != uintptr(0) && initialStackDepth+(*BasicBlock)(unsafe.Pointer(blockPtr)).FminStackDepth <
		(*BasicBlock1)(unsafe.Pointer((*BasicBlock)(unsafe.Pointer(blockPtr)).FenclosingCatch)).FinitialStackDepth+
			(*BasicBlock1)(unsafe.Pointer((*BasicBlock)(unsafe.Pointer(blockPtr)).FenclosingCatch)).FfinalStackDepth {
		if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+4469, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+3597, ts+4516, -1))
			sAddBasicBlockRangeToErrorInfo(tls, assemEnvPtr, blockPtr)
			XTcl_SetErrorLine(tls, interp, (*BasicBlock)(unsafe.Pointer(blockPtr)).FstartLine)
		}
		return TCL_ERROR
	}

	// Update maximum stgack depth.

	maxDepth = initialStackDepth + (*BasicBlock)(unsafe.Pointer(blockPtr)).FmaxStackDepth
	if maxDepth > (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FmaxDepth {
		(*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FmaxDepth = maxDepth
	}

	// Calculate stack depth on exit from the block, and invoke this procedure
	// recursively to check successor blocks.

	stackDepth = initialStackDepth + (*BasicBlock)(unsafe.Pointer(blockPtr)).FfinalStackDepth
	result = TCL_OK
	if (*BasicBlock)(unsafe.Pointer(blockPtr)).Fflags&BB_FALLTHRU != 0 {
		result = sStackCheckBasicBlock(tls, assemEnvPtr, (*BasicBlock)(unsafe.Pointer(blockPtr)).Fsuccessor1,
			blockPtr, stackDepth)
	}

	if result == TCL_OK && (*BasicBlock)(unsafe.Pointer(blockPtr)).FjumpTarget != uintptr(0) {
		entry = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16 /* &.labelHash */)).FfindProc})).f(tls, assemEnvPtr+16 /* &.labelHash */, XTcl_GetString(tls, (*BasicBlock)(unsafe.Pointer(blockPtr)).FjumpTarget))
		jumpTarget = (*Tcl_HashEntry)(unsafe.Pointer(entry)).FclientData
		result = sStackCheckBasicBlock(tls, assemEnvPtr, jumpTarget, blockPtr,
			stackDepth)
	}

	// All blocks referenced in a jump table are successors.

	if (*BasicBlock)(unsafe.Pointer(blockPtr)).Fflags&BB_JUMPTABLE != 0 {
		for jtEntry = XTcl_FirstHashEntry(tls, (*BasicBlock)(unsafe.Pointer(blockPtr)).FjtPtr,
			bp+96); result == TCL_OK && jtEntry != uintptr(0); jtEntry = XTcl_NextHashEntry(tls, bp+96) {
			targetLabel = (*Tcl_HashEntry)(unsafe.Pointer(jtEntry)).FclientData
			entry = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16 /* &.labelHash */)).FfindProc})).f(tls, assemEnvPtr+16 /* &.labelHash */, XTcl_GetString(tls, targetLabel))
			jumpTarget = (*Tcl_HashEntry)(unsafe.Pointer(entry)).FclientData
			result = sStackCheckBasicBlock(tls, assemEnvPtr, jumpTarget,
				blockPtr, stackDepth)
		}
	}

	return result
}

//-----------------------------------------------------------------------------
//
// StackCheckExit --
//
//	Makes sure that the net stack effect of an entire assembly language
//	script is to push 1 result.
//
// Results:
//	Returns a standard Tcl result, with an error message in the
//	interpreter result if the stack is wrong.
//
// Side effects:
//	If the assembly code had a net stack effect of zero, emits code to the
//	concluding block to push a null result. In any case, updates the stack
//	depth in the compile environment to reflect the net effect of the
//	assembly code.
//
//-----------------------------------------------------------------------------

func sStackCheckExit(tls *libc.TLS, assemEnvPtr uintptr) int32 { /* tclAssembly.c:3533:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var depth int32    // Net stack effect
	var litIndex int32 // Index in the literal pool of the empty
	// string
	var curr_bb uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb
	// Final basic block in the assembly

	// Don't perform these checks if execution doesn't reach the exit (either
	// because of an infinite loop or because the only return is from the
	// middle.

	if (*BasicBlock)(unsafe.Pointer(curr_bb)).Fflags&BB_VISITED != 0 {
		// Exit with no operands; push an empty one.

		depth = (*BasicBlock)(unsafe.Pointer(curr_bb)).FfinalStackDepth + (*BasicBlock)(unsafe.Pointer(curr_bb)).FinitialStackDepth
		if depth == 0 {
			// Emit a 'push' of the empty literal.

			litIndex = XTclRegisterLiteral(tls, envPtr, ts+2046, 0 /*flags*/, 0)

			// Assumes that 'push' is at slot 0 in TalInstructionTable.

			sBBEmitInst1or4(tls, assemEnvPtr, 0, litIndex, 0)
			depth++
		}

		// Exit with unbalanced stack.

		if depth != 1 {
			if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+4532,
					libc.VaList(bp, depth)))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+3597, ts+4444, uintptr(0)))
			}
			return TCL_ERROR
		}

		// Record stack usage.

		*(*int32)(unsafe.Pointer(envPtr + 48)) += depth
	}

	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// ProcessCatches --
//
//	First pass of 'catch' processing.
//
// Results:
//	Returns a standard Tcl result, with an appropriate error message if
//	the result is TCL_ERROR.
//
// Side effects:
//	Labels all basic blocks with their enclosing catches.
//
//-----------------------------------------------------------------------------

func sProcessCatches(tls *libc.TLS, assemEnvPtr uintptr) int32 { /* tclAssembly.c:3615:1: */
	var blockPtr uintptr // Pointer to a basic block

	// Clear the catch state of all basic blocks.

	for blockPtr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb; blockPtr != uintptr(0); blockPtr = (*BasicBlock)(unsafe.Pointer(blockPtr)).Fsuccessor1 {
		(*BasicBlock)(unsafe.Pointer(blockPtr)).FcatchState = BBCS_UNKNOWN
		(*BasicBlock)(unsafe.Pointer(blockPtr)).FenclosingCatch = uintptr(0)
	}

	// Start the check recursively from the first basic block, which is
	// outside any exception context

	if sProcessCatchesInBasicBlock(tls, assemEnvPtr, (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb,
		uintptr(0), BBCS_NONE, 0) != TCL_OK {
		return TCL_ERROR
	}

	// Check for unclosed catch on exit.

	if sCheckForUnclosedCatches(tls, assemEnvPtr) != TCL_OK {
		return TCL_ERROR
	}

	// Now there's enough information to build the exception ranges.

	if sBuildExceptionRanges(tls, assemEnvPtr) != TCL_OK {
		return TCL_ERROR
	}

	// Finally, restore any exception ranges from embedded scripts.

	sRestoreEmbeddedExceptionRanges(tls, assemEnvPtr)
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// ProcessCatchesInBasicBlock --
//
//	First-pass catch processing for one basic block.
//
// Results:
//	Returns a standard Tcl result, with error message in the interpreter
//	result if an error occurs.
//
// This procedure checks consistency of the exception context through the
// assembler program, and records the enclosing 'catch' for every basic block.
//
//-----------------------------------------------------------------------------

func sProcessCatchesInBasicBlock(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr, enclosing uintptr, state uint32, catchDepth int32) int32 { /* tclAssembly.c:3683:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var result int32 // Return value from this procedure
	var fallThruEnclosing uintptr
	// Enclosing catch if execution falls thru
	var fallThruState uint32
	// Catch state of the successor block
	var jumpEnclosing uintptr // Enclosing catch if execution goes to jump
	// target
	var jumpState uint32
	// Catch state of the jump target
	var changed int32 = 0 // Flag == 1 iff successor blocks need to be
	// checked because the state of this block has
	// changed.
	var jumpTarget uintptr // Basic block where a jump goes
	// var jtSearch Tcl_HashSearch at bp+64, 24
	// Hash search control for a jumptable
	var jtEntry uintptr     // Entry in a jumptable
	var targetLabel uintptr // Target label from a jumptable
	var entry uintptr       // Entry from the label table

	// Update the state of the current block, checking for consistency.  Set
	// 'changed' to 1 if the state changes and successor blocks need to be
	// rechecked.

	if int32((*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchState) == BBCS_UNKNOWN {
		(*BasicBlock)(unsafe.Pointer(bbPtr)).FenclosingCatch = enclosing
	} else if (*BasicBlock)(unsafe.Pointer(bbPtr)).FenclosingCatch != enclosing {
		if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

				ts+4585, -1))
			XTcl_SetErrorLine(tls, interp, (*BasicBlock)(unsafe.Pointer(bbPtr)).FstartLine)
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+3597, ts+4653, uintptr(0)))
		}
		return TCL_ERROR
	}
	if state > (*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchState {
		(*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchState = state
		changed = 1
	}

	// If this block has been visited before, and its state hasn't changed,
	// we're done with it for now.

	if !(changed != 0) {
		return TCL_OK
	}
	(*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth = catchDepth

	// Determine enclosing catch and 'caught' state for the fallthrough and
	// the jump target. Default for both is the state of the current block.

	fallThruEnclosing = enclosing
	fallThruState = state
	jumpEnclosing = enclosing
	jumpState = state

	// TODO: Make sure that the test cases include validating that a natural
	// loop can't include 'beginCatch' or 'endCatch'

	if (*BasicBlock)(unsafe.Pointer(bbPtr)).Fflags&BB_BEGINCATCH != 0 {
		// If the block begins a catch, the state for the successor is 'in
		// catch'. The jump target is the exception exit, and the state of the
		// jump target is 'caught.'

		fallThruEnclosing = bbPtr
		fallThruState = BBCS_INCATCH
		jumpEnclosing = bbPtr
		jumpState = BBCS_CAUGHT
		catchDepth++
	}

	if (*BasicBlock)(unsafe.Pointer(bbPtr)).Fflags&BB_ENDCATCH != 0 {
		// If the block ends a catch, the state for the successor is whatever
		// the state was on entry to the catch.

		if enclosing == uintptr(0) {
			if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+4662, -1))
				XTcl_SetErrorLine(tls, interp, (*BasicBlock)(unsafe.Pointer(bbPtr)).FstartLine)
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+3597, ts+4706, uintptr(0)))
			}
			return TCL_ERROR
		}
		fallThruEnclosing = (*BasicBlock)(unsafe.Pointer(enclosing)).FenclosingCatch
		fallThruState = (*BasicBlock)(unsafe.Pointer(enclosing)).FcatchState
		catchDepth--
	}

	// Visit any successor blocks with the appropriate exception context

	result = TCL_OK
	if (*BasicBlock)(unsafe.Pointer(bbPtr)).Fflags&BB_FALLTHRU != 0 {
		result = sProcessCatchesInBasicBlock(tls, assemEnvPtr, (*BasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1,
			fallThruEnclosing, fallThruState, catchDepth)
	}
	if result == TCL_OK && (*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget != uintptr(0) {
		entry = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16 /* &.labelHash */)).FfindProc})).f(tls, assemEnvPtr+16 /* &.labelHash */, XTcl_GetString(tls, (*BasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget))
		jumpTarget = (*Tcl_HashEntry)(unsafe.Pointer(entry)).FclientData
		result = sProcessCatchesInBasicBlock(tls, assemEnvPtr, jumpTarget,
			jumpEnclosing, jumpState, catchDepth)
	}

	// All blocks referenced in a jump table are successors.

	if (*BasicBlock)(unsafe.Pointer(bbPtr)).Fflags&BB_JUMPTABLE != 0 {
		for jtEntry = XTcl_FirstHashEntry(tls, (*BasicBlock)(unsafe.Pointer(bbPtr)).FjtPtr, bp+64); result == TCL_OK && jtEntry != uintptr(0); jtEntry = XTcl_NextHashEntry(tls, bp+64) {
			targetLabel = (*Tcl_HashEntry)(unsafe.Pointer(jtEntry)).FclientData
			entry = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16 /* &.labelHash */)).FfindProc})).f(tls, assemEnvPtr+16 /* &.labelHash */, XTcl_GetString(tls, targetLabel))
			jumpTarget = (*Tcl_HashEntry)(unsafe.Pointer(entry)).FclientData
			result = sProcessCatchesInBasicBlock(tls, assemEnvPtr, jumpTarget,
				jumpEnclosing, jumpState, catchDepth)
		}
	}

	return result
}

//-----------------------------------------------------------------------------
//
// CheckForUnclosedCatches --
//
//	Checks that a sequence of assembly code has no unclosed catches on
//	exit.
//
// Results:
//	Returns a standard Tcl result, with an error message for unclosed
//	catches.
//
//-----------------------------------------------------------------------------

func sCheckForUnclosedCatches(tls *libc.TLS, assemEnvPtr uintptr) int32 { /* tclAssembly.c:3848:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter

	if int32((*BasicBlock)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FcatchState) >= BBCS_INCATCH {
		if (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&TCL_EVAL_DIRECT != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+4718, -1))
			XTcl_SetErrorLine(tls, interp,
				(*BasicBlock1)(unsafe.Pointer((*BasicBlock)(unsafe.Pointer((*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FenclosingCatch)).FstartLine)
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+3597, ts+4764, uintptr(0)))
		}
		return TCL_ERROR
	}
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// BuildExceptionRanges --
//
//	Walks through the assembly code and builds exception ranges for the
//	catches embedded therein.
//
// Results:
//	Returns a standard Tcl result with an error message in the interpreter
//	if anything is unsuccessful.
//
// Side effects:
//	Each contiguous block of code with a given catch exit is assigned an
//	exception range at the appropriate level.
//	Exception ranges in embedded blocks have their levels corrected and
//	collated into the table.
//	Blocks that end with 'beginCatch' are associated with the innermost
//	exception range of the following block.
//
//-----------------------------------------------------------------------------

func sBuildExceptionRanges(tls *libc.TLS, assemEnvPtr uintptr) int32 { /* tclAssembly.c:3893:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var bbPtr uintptr                // Current basic block
	var prevPtr uintptr = uintptr(0) // Previous basic block
	var catchDepth int32 = 0         // Current catch depth
	var maxCatchDepth int32 = 0      // Maximum catch depth in the program
	var catches uintptr              // Stack of catches in progress
	var catchIndices uintptr         // Indices of the exception ranges of catches
	// in progress
	var i int32

	// Determine the max catch depth for the entire assembly script
	// (excluding embedded eval's and expr's, which will be handled later).

	for bbPtr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb; bbPtr != uintptr(0); bbPtr = (*BasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 {
		if (*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth > maxCatchDepth {
			maxCatchDepth = (*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth
		}
	}

	// Allocate memory for a stack of active catches.

	catches = XTcl_Alloc(tls, uint32(uint64(maxCatchDepth)*uint64(unsafe.Sizeof(uintptr(0)))))
	catchIndices = XTcl_Alloc(tls, uint32(uint64(maxCatchDepth)*uint64(unsafe.Sizeof(int32(0)))))
	for i = 0; i < maxCatchDepth; i++ {
		*(*uintptr)(unsafe.Pointer(catches + uintptr(i)*8)) = uintptr(0)
		*(*int32)(unsafe.Pointer(catchIndices + uintptr(i)*4)) = -1
	}

	// Walk through the basic blocks and manage exception ranges.

	for bbPtr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb; bbPtr != uintptr(0); bbPtr = (*BasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 {
		sUnstackExpiredCatches(tls, envPtr, bbPtr, catchDepth, catches,
			catchIndices)
		sLookForFreshCatches(tls, bbPtr, catches)
		sStackFreshCatches(tls, assemEnvPtr, bbPtr, catchDepth, catches,
			catchIndices)

		// If the last block was a 'begin catch', fill in the exception range.

		catchDepth = (*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth
		if prevPtr != uintptr(0) && (*BasicBlock)(unsafe.Pointer(prevPtr)).Fflags&BB_BEGINCATCH != 0 {
			for ok := true; ok; ok = 0 != 0 {
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) - uintptr(4))) = uint8(uint32(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth-1)*4))) >> 24)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) - uintptr(4) + uintptr(1))) = uint8(uint32(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth-1)*4))) >> 16)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) - uintptr(4) + uintptr(2))) = uint8(uint32(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth-1)*4))) >> 8)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*BasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) - uintptr(4) + uintptr(3))) = uint8(uint32(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth-1)*4))))
			}
		}

		prevPtr = bbPtr
	}

	// Make sure that all catches are closed

	if catchDepth != 0 {
		XTcl_Panic(tls,
			ts+4778, 0)
	}

	// Free temp storage

	XTclpFree(tls, catchIndices)
	XTclpFree(tls, catches)

	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// UnstackExpiredCatches --
//
//	Unstacks and closes the exception ranges for any catch contexts that
//	were active in the previous basic block but are inactive in the
//	current one.
//
//-----------------------------------------------------------------------------

func sUnstackExpiredCatches(tls *libc.TLS, envPtr uintptr, bbPtr uintptr, catchDepth int32, catches uintptr, catchIndices uintptr) { /* tclAssembly.c:3981:1: */
	var range1 uintptr // Exception range for a specific catch
	var block uintptr  // Catch block being examined
	var catchState BasicBlockCatchState
	// State of the code relative to the catch
	// block being examined ("in catch" or
	// "caught").

	// Unstack any catches that are deeper than the nesting level of the basic
	// block being entered.

	for catchDepth > (*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth {
		catchDepth--
		if *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) != uintptr(0) {
			range1 = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)))*28
			(*ExceptionRange)(unsafe.Pointer(range1)).FnumCodeBytes = (*BasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset - (*ExceptionRange)(unsafe.Pointer(range1)).FcodeOffset
			*(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) = uintptr(0)
			*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)) = -1
		}
	}

	// Unstack any catches that don't match the basic block being entered,
	// either because they are no longer part of the context, or because the
	// context has changed from INCATCH to CAUGHT.

	catchState = BasicBlockCatchState((*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchState)
	block = (*BasicBlock)(unsafe.Pointer(bbPtr)).FenclosingCatch
	for catchDepth > 0 {
		catchDepth--
		if *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) != uintptr(0) {
			if *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) != block || catchState >= BBCS_CAUGHT {
				range1 = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)))*28
				(*ExceptionRange)(unsafe.Pointer(range1)).FnumCodeBytes = (*BasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset - (*ExceptionRange)(unsafe.Pointer(range1)).FcodeOffset
				*(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) = uintptr(0)
				*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)) = -1
			}
			catchState = BasicBlockCatchState((*BasicBlock)(unsafe.Pointer(block)).FcatchState)
			block = (*BasicBlock)(unsafe.Pointer(block)).FenclosingCatch
		}
	}
}

//-----------------------------------------------------------------------------
//
// LookForFreshCatches --
//
//	Determines whether a basic block being entered needs any exception
//	ranges that are not already stacked.
//
// Does not create the ranges: this procedure iterates from the innermost
// catch outward, but exception ranges must be created from the outermost
// catch inward.
//
//-----------------------------------------------------------------------------

func sLookForFreshCatches(tls *libc.TLS, bbPtr uintptr, catches uintptr) { /* tclAssembly.c:4051:1: */
	var catchState BasicBlockCatchState
	// State ("in catch" or "caught") of the
	// current catch.
	var block uintptr    // Current enclosing catch
	var catchDepth int32 // Nesting depth of the current catch

	catchState = BasicBlockCatchState((*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchState)
	block = (*BasicBlock)(unsafe.Pointer(bbPtr)).FenclosingCatch
	catchDepth = (*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth
	for catchDepth > 0 {
		catchDepth--
		if *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) != block && catchState < BBCS_CAUGHT {
			*(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) = block
		}
		catchState = BasicBlockCatchState((*BasicBlock)(unsafe.Pointer(block)).FcatchState)
		block = (*BasicBlock)(unsafe.Pointer(block)).FenclosingCatch
	}
}

//-----------------------------------------------------------------------------
//
// StackFreshCatches --
//
//	Make ExceptionRange records for any catches that are in the basic
//	block being entered and were not in the previous basic block.
//
//-----------------------------------------------------------------------------

func sStackFreshCatches(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr, catchDepth int32, catches uintptr, catchIndices uintptr) { /* tclAssembly.c:4087:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var range1 uintptr    // Exception range for a specific catch
	var block uintptr     // Catch block being examined
	var errorExit uintptr // Error exit from the catch block
	var entryPtr uintptr

	catchDepth = 0

	// Iterate through the enclosing catch blocks from the outside in,
	// looking for ones that don't have exception ranges (and are uncaught)

	for catchDepth = 0; catchDepth < (*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth; catchDepth++ {
		if *(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)) == -1 && *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) != uintptr(0) {
			// Create an exception range for a block that needs one.

			block = *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8))
			*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)) = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
			range1 = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)))*28
			(*ExceptionRange)(unsafe.Pointer(range1)).FnestingLevel = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth + catchDepth
			(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
				if (*ExceptionRange)(unsafe.Pointer(range1)).FnestingLevel+1 > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
					return (*ExceptionRange)(unsafe.Pointer(range1)).FnestingLevel + 1
				}
				return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
			}()
			(*ExceptionRange)(unsafe.Pointer(range1)).FcodeOffset = (*BasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset

			entryPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16 /* &.labelHash */)).FfindProc})).f(tls, assemEnvPtr+16 /* &.labelHash */, XTcl_GetString(tls, (*BasicBlock)(unsafe.Pointer(block)).FjumpTarget))
			if entryPtr == uintptr(0) {
				XTcl_Panic(tls,
					ts+4860, 0)
			}

			errorExit = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
			(*ExceptionRange)(unsafe.Pointer(range1)).FcatchOffset = (*BasicBlock)(unsafe.Pointer(errorExit)).FstartOffset
		}
	}
}

//-----------------------------------------------------------------------------
//
// RestoreEmbeddedExceptionRanges --
//
//	Processes an assembly script, replacing any exception ranges that
//	were present in embedded code.
//
//-----------------------------------------------------------------------------

func sRestoreEmbeddedExceptionRanges(tls *libc.TLS, assemEnvPtr uintptr) { /* tclAssembly.c:4150:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var bbPtr uintptr   // Current basic block
	var rangeBase int32 // Base of the foreign exception ranges when
	// they are reinstalled
	var rangeIndex int32 // Index of the current foreign exception
	// range as reinstalled
	var range1 uintptr   // Current foreign exception range
	var opcode uint8     // Current instruction's opcode
	var catchIndex int32 // Index of the exception range to which the
	// current instruction refers
	var i int32

	// Walk the basic blocks looking for exceptions in embedded scripts.

	for bbPtr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb; bbPtr != uintptr(0); bbPtr = (*BasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 {
		if (*BasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionCount != 0 {
			// Reinstall the embedded exceptions and track their nesting level

			rangeBase = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext
			for i = 0; i < (*BasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionCount; i++ {
				range1 = (*BasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptions + uintptr(i)*28
				rangeIndex = XTclCreateExceptRange(tls, (*ExceptionRange)(unsafe.Pointer(range1)).Ftype, envPtr)
				*(*int32)(unsafe.Pointer(range1 + 4)) += (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth + (*BasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth
				libc.Xmemcpy(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(rangeIndex)*28, range1,
					uint64(unsafe.Sizeof(ExceptionRange{})))
				if (*ExceptionRange)(unsafe.Pointer(range1)).FnestingLevel >= (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = (*ExceptionRange)(unsafe.Pointer(range1)).FnestingLevel + 1
				}
			}

			// Walk through the bytecode of the basic block, and relocate
			// INST_BEGIN_CATCH4 instructions to the new locations

			i = (*BasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset
			for i < (*BasicBlock1)(unsafe.Pointer((*BasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1)).FstartOffset {
				opcode = *(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i)))
				if int32(opcode) == INST_BEGIN_CATCH4 {
					catchIndex = int32(uint32(int32(*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + uintptr(1) + uintptr(3)))))
					if catchIndex >= (*BasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionBase &&
						catchIndex < (*BasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionBase+(*BasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionCount {
						catchIndex = catchIndex - (*BasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionBase
						catchIndex = catchIndex + rangeBase
						for ok := true; ok; ok = 0 != 0 {
							*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + uintptr(1))) = uint8(uint32(catchIndex) >> 24)
							*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + uintptr(1) + uintptr(1))) = uint8(uint32(catchIndex) >> 16)
							*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + uintptr(1) + uintptr(2))) = uint8(uint32(catchIndex) >> 8)
							*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + uintptr(1) + uintptr(3))) = uint8(uint32(catchIndex))
						}
					}
				}
				i = i + XtclInstructionTable[opcode].FnumBytes
			}
		}
	}
}

//-----------------------------------------------------------------------------
//
// ResetVisitedBasicBlocks --
//
//	Turns off the 'visited' flag in all basic blocks at the conclusion
//	of a pass.
//
//-----------------------------------------------------------------------------

func sResetVisitedBasicBlocks(tls *libc.TLS, assemEnvPtr uintptr) { /* tclAssembly.c:4226:1: */
	var block uintptr

	for block = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb; block != uintptr(0); block = (*BasicBlock)(unsafe.Pointer(block)).Fsuccessor1 {
		*(*int32)(unsafe.Pointer(block + 112)) &= libc.CplInt32(BB_VISITED)
	}
}

//-----------------------------------------------------------------------------
//
// AddBasicBlockRangeToErrorInfo --
//
//	Updates the error info of the Tcl interpreter to show a given basic
//	block in the code.
//
// This procedure is used to label the callstack with source location
// information when reporting an error in stack checking.
//
//-----------------------------------------------------------------------------

func sAddBasicBlockRangeToErrorInfo(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr) { /* tclAssembly.c:4252:1: */
	var envPtr uintptr = (*AssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr
	// Compilation environment
	var interp uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	// Tcl interpreter
	var lineNo uintptr // Line number in the source

	XTcl_AddErrorInfo(tls, interp, ts+4928)
	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				lineNo = XTclThreadAllocObj(tls)
			} else {
				lineNo = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(lineNo + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(lineNo)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(lineNo)).Fbytes = uintptr(0)
		*(*int64)(unsafe.Pointer(lineNo + 32)) = int64((*BasicBlock)(unsafe.Pointer(bbPtr)).FstartLine)
		(*Tcl_Obj)(unsafe.Pointer(lineNo)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(lineNo)).FrefCount++
	XTcl_AppendObjToErrorInfo(tls, interp, lineNo)
	XTcl_AddErrorInfo(tls, interp, ts+4965)
	if (*BasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 != uintptr(0) {
		XTcl_SetIntObj(tls, lineNo, (*BasicBlock1)(unsafe.Pointer((*BasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1)).FstartLine)
		XTcl_AppendObjToErrorInfo(tls, interp, lineNo)
	} else {
		XTcl_AddErrorInfo(tls, interp, ts+4971)
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = lineNo
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
}

//-----------------------------------------------------------------------------
//
// DupAssembleCodeInternalRep --
//
//	Part of the Tcl object type implementation for Tcl assembly language
//	bytecode. We do not copy the bytecode internalrep. Instead, we return
//	without setting copyPtr->typePtr, so the copy is a plain string copy
//	of the assembly source, and if it is to be used as a compiled
//	expression, it will need to be reprocessed.
//
//	This makes sense, because with Tcl's copy-on-write practices, the
//	usual (only?) time Tcl_DuplicateObj() will be called is when the copy
//	is about to be modified, which would invalidate any copied bytecode
//	anyway. The only reason it might make sense to copy the bytecode is if
//	we had some modifying routines that operated directly on the internalrep,
//	as we do for lists and dicts.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//-----------------------------------------------------------------------------

func sDupAssembleCodeInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclAssembly.c:4304:1: */
	_ = srcPtr
	_ = copyPtr

	return
}

//-----------------------------------------------------------------------------
//
// FreeAssembleCodeInternalRep --
//
//	Part of the Tcl object type implementation for Tcl expression
//	bytecode. Frees the storage allocated to hold the internal rep, unless
//	ref counts indicate bytecode execution is still in progress.
//
// Results:
//	None.
//
// Side effects:
//	May free allocated memory. Leaves objPtr untyped.
//
//-----------------------------------------------------------------------------

func sFreeAssembleCodeInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclAssembly.c:4333:1: */
	var codePtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if libc.PostDecInt32(&(*ByteCode)(unsafe.Pointer(codePtr)).FrefCount, 1) <= 1 {
		XTclCleanupByteCode(tls, codePtr)
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// One of the following structures exists for each asynchronous handler:

type AsyncHandler1 = struct {
	Fready        int32
	F__ccgo_pad1  [4]byte
	FnextPtr      uintptr
	Fproc         uintptr
	FclientData   ClientData
	ForiginTsd    uintptr
	ForiginThrdId Tcl_ThreadId
} /* tclAsync.c:18:1 */

// One of the following structures exists for each asynchronous handler:

type AsyncHandler = AsyncHandler1 /* tclAsync.c:41:3 */

type ThreadSpecificData = struct {
	FfirstHandler uintptr
	FlastHandler  uintptr
	FasyncReady   int32
	FasyncActive  int32
	FasyncMutex   Tcl_Mutex
}                             /* tclAsync.c:63:3 */
var dataKey Tcl_ThreadDataKey /* tclAsync.c:64:26: */

//----------------------------------------------------------------------
//
// TclFinalizeAsync --
//
//	Finalizes the mutex in the thread local data structure for the async
//	subsystem.
//
// Results:
//	None.
//
// Side effects:
//	Forgets knowledge of the mutex should it have been created.
//
//----------------------------------------------------------------------

func XTclFinalizeAsync(tls *libc.TLS) { /* tclAsync.c:84:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey)), int32(unsafe.Sizeof(ThreadSpecificData{})))

	if (*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FasyncMutex != uintptr(0) {
		XTcl_MutexFinalize(tls, tsdPtr+24)
	}
}

//----------------------------------------------------------------------
//
// Tcl_AsyncCreate --
//
//	This procedure creates the data structures for an asynchronous
//	handler, so that no memory has to be allocated when the handler is
//	activated.
//
// Results:
//	The return value is a token for the handler, which can be used to
//	activate it later on.
//
// Side effects:
//	Information about the handler is recorded.
//
//----------------------------------------------------------------------

func XTcl_AsyncCreate(tls *libc.TLS, proc uintptr, clientData ClientData) Tcl_AsyncHandler { /* tclAsync.c:113:1: */
	var asyncPtr uintptr
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey)), int32(unsafe.Sizeof(ThreadSpecificData{})))

	asyncPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(AsyncHandler{})))
	(*AsyncHandler)(unsafe.Pointer(asyncPtr)).Fready = 0
	(*AsyncHandler)(unsafe.Pointer(asyncPtr)).FnextPtr = uintptr(0)
	(*AsyncHandler)(unsafe.Pointer(asyncPtr)).Fproc = proc
	(*AsyncHandler)(unsafe.Pointer(asyncPtr)).FclientData = clientData
	(*AsyncHandler)(unsafe.Pointer(asyncPtr)).ForiginTsd = tsdPtr
	(*AsyncHandler)(unsafe.Pointer(asyncPtr)).ForiginThrdId = XTcl_GetCurrentThread(tls)

	XTcl_MutexLock(tls, tsdPtr+24)
	if (*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FfirstHandler == uintptr(0) {
		(*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FfirstHandler = asyncPtr
	} else {
		(*AsyncHandler)(unsafe.Pointer((*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FlastHandler)).FnextPtr = asyncPtr
	}
	(*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FlastHandler = asyncPtr
	XTcl_MutexUnlock(tls, tsdPtr+24)
	return asyncPtr
}

//----------------------------------------------------------------------
//
// Tcl_AsyncMark --
//
//	This procedure is called to request that an asynchronous handler be
//	invoked as soon as possible. It's typically called from an interrupt
//	handler, where it isn't safe to do anything that depends on or
//	modifies application state.
//
// Results:
//	None.
//
// Side effects:
//	The handler gets marked for invocation later.
//
//----------------------------------------------------------------------

func XTcl_AsyncMark(tls *libc.TLS, async Tcl_AsyncHandler) { /* tclAsync.c:160:1: */
	var token uintptr = async

	XTcl_MutexLock(tls, (*AsyncHandler)(unsafe.Pointer(token)).ForiginTsd+24)
	(*AsyncHandler)(unsafe.Pointer(token)).Fready = 1
	if !((*struct {
		FfirstHandler uintptr
		FlastHandler  uintptr
		FasyncReady   int32
		FasyncActive  int32
		FasyncMutex   Tcl_Mutex
	})(unsafe.Pointer((*AsyncHandler)(unsafe.Pointer(token)).ForiginTsd)).FasyncActive != 0) {
		(*struct {
			FfirstHandler uintptr
			FlastHandler  uintptr
			FasyncReady   int32
			FasyncActive  int32
			FasyncMutex   Tcl_Mutex
		})(unsafe.Pointer((*AsyncHandler)(unsafe.Pointer(token)).ForiginTsd)).FasyncReady = 1
		XTcl_ThreadAlert(tls, (*AsyncHandler)(unsafe.Pointer(token)).ForiginThrdId)
	}
	XTcl_MutexUnlock(tls, (*AsyncHandler)(unsafe.Pointer(token)).ForiginTsd+24)
}

//----------------------------------------------------------------------
//
// Tcl_AsyncInvoke --
//
//	This procedure is called at a "safe" time at background level to
//	invoke any active asynchronous handlers.
//
// Results:
//	The return value is a normal Tcl result, which is intended to replace
//	the code argument as the current completion code for interp.
//
// Side effects:
//	Depends on the handlers that are active.
//
//----------------------------------------------------------------------

func XTcl_AsyncInvoke(tls *libc.TLS, interp uintptr, code int32) int32 { /* tclAsync.c:193:1: */
	var asyncPtr uintptr
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey)), int32(unsafe.Sizeof(ThreadSpecificData{})))

	XTcl_MutexLock(tls, tsdPtr+24)

	if (*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FasyncReady == 0 {
		XTcl_MutexUnlock(tls, tsdPtr+24)
		return code
	}
	(*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FasyncReady = 0
	(*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FasyncActive = 1
	if interp == uintptr(0) {
		code = 0
	}

	// Make one or more passes over the list of handlers, invoking at most one
	// handler in each pass. After invoking a handler, go back to the start of
	// the list again so that (a) if a new higher-priority handler gets marked
	// while executing a lower priority handler, we execute the higher-
	// priority handler next, and (b) if a handler gets deleted during the
	// execution of a handler, then the list structure may change so it isn't
	// safe to continue down the list anyway.

	for 1 != 0 {
		for asyncPtr = (*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FfirstHandler; asyncPtr != uintptr(0); asyncPtr = (*AsyncHandler)(unsafe.Pointer(asyncPtr)).FnextPtr {
			if (*AsyncHandler)(unsafe.Pointer(asyncPtr)).Fready != 0 {
				break
			}
		}
		if asyncPtr == uintptr(0) {
			break
		}
		(*AsyncHandler)(unsafe.Pointer(asyncPtr)).Fready = 0
		XTcl_MutexUnlock(tls, tsdPtr+24)
		code = (*struct {
			f func(*libc.TLS, ClientData, uintptr, int32) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*AsyncHandler)(unsafe.Pointer(asyncPtr)).Fproc})).f(tls, (*AsyncHandler)(unsafe.Pointer(asyncPtr)).FclientData, interp, code)
		XTcl_MutexLock(tls, tsdPtr+24)
	}
	(*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FasyncActive = 0
	XTcl_MutexUnlock(tls, tsdPtr+24)
	return code
}

//----------------------------------------------------------------------
//
// Tcl_AsyncDelete --
//
//	Frees up all the state for an asynchronous handler. The handler should
//	never be used again.
//
// Results:
//	None.
//
// Side effects:
//	The state associated with the handler is deleted.
//
//	Failure to locate the handler in current thread private list
//	of async handlers will result in panic; exception: the list
//	is already empty (potential trouble?).
//	Consequently, threads should create and delete handlers
//	themselves.  I.e. a handler created by one should not be
//	deleted by some other thread.
//
//----------------------------------------------------------------------

func XTcl_AsyncDelete(tls *libc.TLS, async Tcl_AsyncHandler) { /* tclAsync.c:271:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey)), int32(unsafe.Sizeof(ThreadSpecificData{})))
	var asyncPtr uintptr = async
	var prevPtr uintptr
	var thisPtr uintptr

	// Assure early handling of the constraint

	if (*AsyncHandler)(unsafe.Pointer(asyncPtr)).ForiginThrdId != XTcl_GetCurrentThread(tls) {
		XTcl_Panic(tls, ts+4992, 0)
	}

	// If we come to this point when TSD's for the current
	// thread have already been garbage-collected, we are
	// in the _serious_ trouble. OTOH, we tolerate calling
	// with already cleaned-up handler list (should we?).

	XTcl_MutexLock(tls, tsdPtr+24)
	if (*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FfirstHandler != uintptr(0) {
		prevPtr = libc.AssignUintptr(&thisPtr, (*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FfirstHandler)
		for thisPtr != uintptr(0) && thisPtr != asyncPtr {
			prevPtr = thisPtr
			thisPtr = (*AsyncHandler)(unsafe.Pointer(thisPtr)).FnextPtr
		}
		if thisPtr == uintptr(0) {
			XTcl_Panic(tls, ts+5051, 0)
		}
		if asyncPtr == (*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FfirstHandler {
			(*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FfirstHandler = (*AsyncHandler)(unsafe.Pointer(asyncPtr)).FnextPtr
		} else {
			(*AsyncHandler)(unsafe.Pointer(prevPtr)).FnextPtr = (*AsyncHandler)(unsafe.Pointer(asyncPtr)).FnextPtr
		}
		if asyncPtr == (*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FlastHandler {
			(*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FlastHandler = prevPtr
		}
	}
	XTcl_MutexUnlock(tls, tsdPtr+24)
	XTclpFree(tls, asyncPtr)
}

//----------------------------------------------------------------------
//
// Tcl_AsyncReady --
//
//	This procedure can be used to tell whether Tcl_AsyncInvoke needs to be
//	called. This procedure is the external interface for checking the
//	thread-specific asyncReady variable.
//
// Results:
//	The return value is 1 whenever a handler is ready and is 0 when no
//	handlers are ready.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_AsyncReady(tls *libc.TLS) int32 { /* tclAsync.c:336:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey)), int32(unsafe.Sizeof(ThreadSpecificData{})))
	return (*ThreadSpecificData)(unsafe.Pointer(tsdPtr)).FasyncReady
}

func XTclGetAsyncReadyPtr(tls *libc.TLS) uintptr { /* tclAsync.c:342:5: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey)), int32(unsafe.Sizeof(ThreadSpecificData{})))
	return tsdPtr + 16
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// GCC bug 66462 means we cannot use the math builtins with -fsignaling-nan,
//    so disable builtins if this is enabled.  When fixed in a newer GCC,
//    the __SUPPORT_SNAN__ check may be skipped for those versions.

// Return number of classification appropriate for X.
// The check for __cplusplus allows the use of the builtin, even
// 	when optimization for size is on.  This is provided for
// 	libstdc++, only to let its configure test work when it is built
// 	with -Os.  No further use of this definition of fpclassify is
// 	expected in C++ mode, since libstdc++ provides its own version
// 	of fpclassify in cmath (which undefines fpclassify).

// Return nonzero value if sign of X is negative.

// Return nonzero value if X is not +-Inf or NaN.

// Return nonzero value if X is neither zero, subnormal, Inf, nor NaN.

// Return nonzero value if X is a NaN.  We could use `fpclassify' but
//    we already have this functions `__isnan' and it is faster.

// Return nonzero value if X is positive or negative infinity.

// Bitmasks for the math_errhandling macro.

// By default all math functions support both errno and exception handling
//    (except for soft floating point implementations which may only support
//    errno handling).  If errno handling is disabled, exceptions are still
//    supported by GLIBC.  Set math_errhandling to 0 with -ffast-math (this is
//    nonconforming but it is more useful than leaving it undefined).

// Some useful constants.

// The above constants are not adequate for computation using `long double's.
//    Therefore we provide as an extension constants with similar names as a
//    GNU extension.  Provide enough digits for the 128-bit IEEE quad.

// When compiling in strict ISO C compatible mode we must not use the
//    inline functions since they, among other things, do not set the
//    `errno' variable correctly.

// ISO C99 defines some macros to compare number while taking care for
//    unordered numbers.  Many FPUs provide special instructions to support
//    these operations.  Generic support in GCC for these as builtins went
//    in 2.97, but not all cpus added their patterns until 3.1.  Therefore
//    we enable the builtins from 3.1 onwards and use a generic implementation
//    othwerwise.

// Get machine-dependent inline versions (if there are any).

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.2 Diagnostics	<assert.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// void assert (int expression);
//
//    If NDEBUG is defined, do nothing.
//    If not, and EXPRESSION is zero, print an error message and abort.

// void assert_perror (int errnum);
//
//    If NDEBUG is defined, do nothing.  If not, and ERRNUM is not zero, print an
//    error message with the error text for ERRNUM and abort.
//    (This is a GNU extension.)

// Determine whether we're using IEEE floating point

// Largest odd integer that can be represented exactly in a double

// The following structure defines the client data for a math function
// registered with Tcl_CreateMathFunc

type OldMathFuncData1 = struct {
	Fproc        uintptr
	FnumArgs     int32
	F__ccgo_pad1 [4]byte
	FargTypes    uintptr
	FclientData  ClientData
} /* tclBasic.c:45:9 */

// GCC bug 66462 means we cannot use the math builtins with -fsignaling-nan,
//    so disable builtins if this is enabled.  When fixed in a newer GCC,
//    the __SUPPORT_SNAN__ check may be skipped for those versions.

// Return number of classification appropriate for X.
// The check for __cplusplus allows the use of the builtin, even
// 	when optimization for size is on.  This is provided for
// 	libstdc++, only to let its configure test work when it is built
// 	with -Os.  No further use of this definition of fpclassify is
// 	expected in C++ mode, since libstdc++ provides its own version
// 	of fpclassify in cmath (which undefines fpclassify).

// Return nonzero value if sign of X is negative.

// Return nonzero value if X is not +-Inf or NaN.

// Return nonzero value if X is neither zero, subnormal, Inf, nor NaN.

// Return nonzero value if X is a NaN.  We could use `fpclassify' but
//    we already have this functions `__isnan' and it is faster.

// Return nonzero value if X is positive or negative infinity.

// Bitmasks for the math_errhandling macro.

// By default all math functions support both errno and exception handling
//    (except for soft floating point implementations which may only support
//    errno handling).  If errno handling is disabled, exceptions are still
//    supported by GLIBC.  Set math_errhandling to 0 with -ffast-math (this is
//    nonconforming but it is more useful than leaving it undefined).

// Some useful constants.

// The above constants are not adequate for computation using `long double's.
//    Therefore we provide as an extension constants with similar names as a
//    GNU extension.  Provide enough digits for the 128-bit IEEE quad.

// When compiling in strict ISO C compatible mode we must not use the
//    inline functions since they, among other things, do not set the
//    `errno' variable correctly.

// ISO C99 defines some macros to compare number while taking care for
//    unordered numbers.  Many FPUs provide special instructions to support
//    these operations.  Generic support in GCC for these as builtins went
//    in 2.97, but not all cpus added their patterns until 3.1.  Therefore
//    we enable the builtins from 3.1 onwards and use a generic implementation
//    othwerwise.

// Get machine-dependent inline versions (if there are any).

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.2 Diagnostics	<assert.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// void assert (int expression);
//
//    If NDEBUG is defined, do nothing.
//    If not, and EXPRESSION is zero, print an error message and abort.

// void assert_perror (int errnum);
//
//    If NDEBUG is defined, do nothing.  If not, and ERRNUM is not zero, print an
//    error message with the error text for ERRNUM and abort.
//    (This is a GNU extension.)

// Determine whether we're using IEEE floating point

// Largest odd integer that can be represented exactly in a double

// The following structure defines the client data for a math function
// registered with Tcl_CreateMathFunc

type OldMathFuncData = OldMathFuncData1 /* tclBasic.c:50:3 */

// This is the script cancellation struct and hash table. The hash table is
// used to keep track of the information necessary to process script
// cancellation requests, including the original interp, asynchronous handler
// tokens (created by Tcl_AsyncCreate), and the clientData and flags arguments
// passed to Tcl_CancelEval on a per-interp basis. The cancelLock mutex is
// used for protecting calls to Tcl_CancelEval as well as protecting access to
// the hash table below.

type CancelInfo = struct {
	Finterp      uintptr
	Fasync       Tcl_AsyncHandler
	Fresult      uintptr
	Flength      int32
	F__ccgo_pad1 [4]byte
	FclientData  ClientData
	Fflags       int32
	F__ccgo_pad2 [4]byte
}                                    /* tclBasic.c:71:3 */
var cancelTable Tcl_HashTable        /* tclBasic.c:72:22: */
var cancelTableInitialized int32 = 0 /* tclBasic.c:73:12 */ // 0 means not yet initialized.
var cancelLock Tcl_Mutex             /* tclBasic.c:74:1: */

// Magical counts for the number of arguments accepted by a coroutine command
// after particular kinds of [yield].

// The following structure define the commands in the Tcl core.

type CmdInfo = struct {
	Fname        uintptr
	FobjProc     uintptr
	FcompileProc uintptr
	FnreProc     uintptr
	Fflags       int32
	F__ccgo_pad1 [4]byte
} /* tclBasic.c:186:3 */

// CMD_COMPILES_EXPANDED - Whether the compiler for this command can handle
// expansion for itself rather than needing the generic layer to take care of
// it for it. Defined in tclInt.h.

// The built-in commands, and the functions that implement them:

var builtInCmds = [82]CmdInfo{
	// Commands in the generic core.

	{Fname: ts + 2081, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5094, FobjProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5100, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5106, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5111, FobjProc: 0, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 2229, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5117, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5126, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5136, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 2409, FobjProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 2468, FobjProc: 0, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5142, FobjProc: 0, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5146, FobjProc: 0, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5154, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5161, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5168, FobjProc: 0, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 2487, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5171, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 2683, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5176, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5184, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5191, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 2810, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE | CMD_COMPILES_EXPANDED},
	{Fname: ts + 5199, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5207, FobjProc: 0, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5212, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5219, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5227, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5236, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5245, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5253, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5258, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5264, FobjProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5272, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 3046, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5277, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5284, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5291, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5298, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5303, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5307, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5313, FobjProc: 0, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5319, FobjProc: 0, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5326, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5335, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5341, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5347, FobjProc: 0, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 3380, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5351, FobjProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 3426, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 3432, FobjProc: 0, FcompileProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5359, FobjProc: 0, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 3452, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5365, FcompileProc: 0, FnreProc: 0, Fflags: CMD_IS_SAFE},

	// Commands in the OS-interface. Note that many of these are unsafe.

	{Fname: ts + 5373, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5379, FobjProc: 0},
	{Fname: ts + 5382, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5388, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5392, FobjProc: 0},
	{Fname: ts + 5397, FobjProc: 0},
	{Fname: ts + 5402, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5411, FobjProc: 0},
	{Fname: ts + 5422, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5428, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5438, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5444, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5449, FobjProc: 0},
	{Fname: ts + 2877, FobjProc: 0},
	{Fname: ts + 5454, FobjProc: 0},
	{Fname: ts + 5459, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5463, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5468, FobjProc: 0},
	{Fname: ts + 5472, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5477, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5482, FobjProc: 0},
	{Fname: ts + 5489, FobjProc: 0, FnreProc: 0},
	{Fname: ts + 5496, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5501, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5506, FobjProc: 0},
	{Fname: ts + 5513, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{Fname: ts + 5520, FobjProc: 0, Fflags: CMD_IS_SAFE},
	{},
} /* tclBasic.c:199:22 */

// Math functions. All are safe.

type BuiltinFuncDef = struct {
	Fname       uintptr
	FobjCmdProc uintptr
	FclientData ClientData
} /* tclBasic.c:307:3 */
var sBuiltinFuncTable = [30]BuiltinFuncDef{
	{Fname: ts + 5526, FobjCmdProc: 0},
	{Fname: ts + 5530, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5535, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5540, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5545, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5551, FobjCmdProc: 0},
	{Fname: ts + 5556, FobjCmdProc: 0},
	{Fname: ts + 5561, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5565, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5570, FobjCmdProc: 0},
	{Fname: ts + 5577, FobjCmdProc: 0},
	{Fname: ts + 5584, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5588, FobjCmdProc: 0},
	{Fname: ts + 5594, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5599, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5605, FobjCmdProc: 0},
	{Fname: ts + 5609, FobjCmdProc: 0},
	{Fname: ts + 5615, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5619, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5625, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5629, FobjCmdProc: 0},
	{Fname: ts + 5634, FobjCmdProc: 0},
	{Fname: ts + 5640, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5644, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5649, FobjCmdProc: 0},
	{Fname: ts + 5654, FobjCmdProc: 0},
	{Fname: ts + 5660, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5664, FobjCmdProc: 0, FclientData: 0},
	{Fname: ts + 5669, FobjCmdProc: 0},
	{},
} /* tclBasic.c:308:29 */

// TIP#174's math operators. All are safe.

type OpCmdInfo = struct {
	Fname        uintptr
	FobjProc     uintptr
	FcompileProc uintptr
	Fi           struct{ FnumArgs int32 }
	F__ccgo_pad1 [4]byte
	Fexpected    uintptr
} /* tclBasic.c:355:3 */
var mathOpCmds = [24]OpCmdInfo{
	{Fname: ts + 5674, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = 1
		return r
	}(), Fexpected: ts + 5676 /* "integer" */},
	{Fname: ts + 5684, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = 1
		return r
	}(), Fexpected: ts + 3541 /* "boolean" */},
	{Fname: ts + 5686, FobjProc: 0, FcompileProc: 0},
	{Fname: ts + 5688, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = 1
		return r
	}()},
	{Fname: ts + 5690, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = -1
		return r
	}()},
	{Fname: ts + 5692, FobjProc: 0, FcompileProc: 0},
	{Fname: ts + 5694, FobjProc: 0, FcompileProc: 0},
	{Fname: ts + 5696, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = 1
		return r
	}()},
	{Fname: ts + 5699, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = 2
		return r
	}(), Fexpected: ts + 5702 /* "integer shift" */},
	{Fname: ts + 5716, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = 2
		return r
	}(), Fexpected: ts + 5702 /* "integer shift" */},
	{Fname: ts + 5719, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = 2
		return r
	}(), Fexpected: ts + 5721 /* "integer integer" */},
	{Fname: ts + 5737, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = 2
		return r
	}(), Fexpected: ts + 5740 /* "value value" */},
	{Fname: ts + 5752, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = 2
		return r
	}(), Fexpected: ts + 5740 /* "value value" */},
	{Fname: ts + 5755, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = 2
		return r
	}(), Fexpected: ts + 5758 /* "value list" */},
	{Fname: ts + 5769, FobjProc: 0, FcompileProc: 0, Fi: func() (r struct{ FnumArgs int32 }) {
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = 2
		return r
	}(), Fexpected: ts + 5758 /* "value list" */},
	{Fname: ts + 5772, FobjProc: 0, FcompileProc: 0, Fexpected: ts + 5774},
	{Fname: ts + 5792, FobjProc: 0, FcompileProc: 0, Fexpected: ts + 5774},
	{Fname: ts + 5794, FobjProc: 0, FcompileProc: 0},
	{Fname: ts + 5796, FobjProc: 0, FcompileProc: 0},
	{Fname: ts + 5799, FobjProc: 0, FcompileProc: 0},
	{Fname: ts + 5801, FobjProc: 0, FcompileProc: 0},
	{Fname: ts + 5804, FobjProc: 0, FcompileProc: 0},
	{Fname: ts + 2406, FobjProc: 0, FcompileProc: 0},
	{}} /* tclBasic.c:356:24 */

//----------------------------------------------------------------------
//
// TclFinalizeEvaluation --
//
//	Finalizes the script cancellation hash table.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFinalizeEvaluation(tls *libc.TLS) { /* tclBasic.c:424:1: */
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&cancelLock)))
	if cancelTableInitialized == 1 {
		XTcl_DeleteHashTable(tls, uintptr(unsafe.Pointer(&cancelTable)))
		cancelTableInitialized = 0
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&cancelLock)))
}

//----------------------------------------------------------------------
//
// Tcl_CreateInterp --
//
//	Create a new TCL command interpreter.
//
// Results:
//	The return value is a token for the interpreter, which may be used in
//	calls to functions like Tcl_CreateCmd, Tcl_Eval, or Tcl_DeleteInterp.
//
// Side effects:
//	The command interpreter is initialized with the built-in commands and
//	with the variables documented in tclvars(n).
//
//----------------------------------------------------------------------

func XTcl_CreateInterp(tls *libc.TLS) uintptr { /* tclBasic.c:452:12: */
	bp := tls.Alloc(70)
	defer tls.Free(70)

	var iPtr uintptr
	var interp uintptr
	var cmdPtr uintptr
	var builtinFuncPtr uintptr
	var opcmdInfoPtr uintptr
	var cmdInfoPtr uintptr
	var nsPtr uintptr
	var hPtr uintptr
	// var isNew int32 at bp+32, 4

	var cancelInfo uintptr
	// var order struct {F__ccgo_pad1 [0]uint16;Fc [2]int8;} at bp+68, 2

	// var mathFuncName [32]int8 at bp+36, 32

	var framePtr uintptr

	XTclInitSubsystems(tls)

	// Panic if someone updated the CallFrame structure without also updating
	// the Tcl_CallFrame structure (or vice versa).

	if uint64(unsafe.Sizeof(Tcl_CallFrame{})) < uint64(unsafe.Sizeof(CallFrame{})) {
		//NOTREACHED
		XTcl_Panic(tls, ts+5807, 0)
	}

	if cancelTableInitialized == 0 {
		XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&cancelLock)))
		if cancelTableInitialized == 0 {
			XTcl_InitHashTable(tls, uintptr(unsafe.Pointer(&cancelTable)), 1)
			cancelTableInitialized = 1
		}
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&cancelLock)))
	}

	// Initialize support for namespaces and create the global namespace
	// (whose name is ""; an alias is "::"). This also initializes the Tcl
	// object type table and other object management code.

	iPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Interp{})))
	interp = iPtr

	(*Interp)(unsafe.Pointer(iPtr)).Fresult = iPtr + 472 /* &.resultSpace */
	(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FerrorLine = 0
	(*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).FrefCount++
	(*Interp)(unsafe.Pointer(iPtr)).Fhandle = XTclHandleCreate(tls, iPtr)
	(*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FhiddenCmdTablePtr = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FinterpInfo = uintptr(0)

	{
	}

	*(*uintptr)(unsafe.Pointer(iPtr + 64)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{XTclOptimizeBytecode}))

	(*Interp)(unsafe.Pointer(iPtr)).FnumLevels = 0
	(*Interp)(unsafe.Pointer(iPtr)).FmaxNestingDepth = MAX_NESTING_DEPTH
	(*Interp)(unsafe.Pointer(iPtr)).FframePtr = uintptr(0)    // Initialise as soon as :: is available
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = uintptr(0) // Initialise as soon as :: is available

	// TIP #280 - Initialize the arrays used to extend the ByteCode and Proc
	// structures.

	(*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
	(*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
	(*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
	(*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
	XTcl_InitHashTable(tls, (*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr, 1)
	XTcl_InitHashTable(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr, 1)
	XTcl_InitHashTable(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr, 1)
	XTcl_InitHashTable(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr, 1)
	(*Interp)(unsafe.Pointer(iPtr)).FscriptCLLocPtr = uintptr(0)

	(*Interp)(unsafe.Pointer(iPtr)).FactiveVarTracePtr = uintptr(0)

	(*Interp)(unsafe.Pointer(iPtr)).FreturnOpts = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FerrorInfo = uintptr(0)
	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				(*Interp)(unsafe.Pointer(iPtr)).FeiVar = XTclThreadAllocObj(tls)
			} else {
				(*Interp)(unsafe.Pointer(iPtr)).FeiVar = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FeiVar + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FeiVar)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FeiVar)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FeiVar)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FeiVar)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FeiVar)).Fbytes, ts+5856, uint64(int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FeiVar)).Fbytes + 11)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FeiVar)).Flength = int32(uint64(unsafe.Sizeof([12]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FeiVar)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FeiVar)).FrefCount++
	(*Interp)(unsafe.Pointer(iPtr)).FerrorStack = XTcl_NewListObj(tls, 0, uintptr(0))
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorStack)).FrefCount++
	(*Interp)(unsafe.Pointer(iPtr)).FresetErrorStack = 1
	for ok2 := true; ok2; ok2 = 0 != 0 {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				(*Interp)(unsafe.Pointer(iPtr)).FupLiteral = XTclThreadAllocObj(tls)
			} else {
				(*Interp)(unsafe.Pointer(iPtr)).FupLiteral = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FupLiteral + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FupLiteral)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FupLiteral)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FupLiteral)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FupLiteral)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FupLiteral)).Fbytes, ts+5868, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FupLiteral)).Fbytes + 2)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FupLiteral)).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FupLiteral)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FupLiteral)).FrefCount++
	for ok4 := true; ok4; ok4 = 0 != 0 {
		for ok5 := true; ok5; ok5 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				(*Interp)(unsafe.Pointer(iPtr)).FcallLiteral = XTclThreadAllocObj(tls)
			} else {
				(*Interp)(unsafe.Pointer(iPtr)).FcallLiteral = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcallLiteral + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcallLiteral)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcallLiteral)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcallLiteral)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcallLiteral)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcallLiteral)).Fbytes, ts+5871, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcallLiteral)).Fbytes + 4)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcallLiteral)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcallLiteral)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcallLiteral)).FrefCount++
	for ok6 := true; ok6; ok6 = 0 != 0 {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				(*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral = XTclThreadAllocObj(tls)
			} else {
				(*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)).Fbytes, ts+5876, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)).Fbytes + 5)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)).FrefCount++
	(*Interp)(unsafe.Pointer(iPtr)).FinnerContext = XTcl_NewListObj(tls, 0, uintptr(0))
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinnerContext)).FrefCount++
	(*Interp)(unsafe.Pointer(iPtr)).FerrorCode = uintptr(0)
	for ok8 := true; ok8; ok8 = 0 != 0 {
		for ok9 := true; ok9; ok9 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				(*Interp)(unsafe.Pointer(iPtr)).FecVar = XTclThreadAllocObj(tls)
			} else {
				(*Interp)(unsafe.Pointer(iPtr)).FecVar = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FecVar + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FecVar)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FecVar)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FecVar)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FecVar)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FecVar)).Fbytes, ts+5882, uint64(int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FecVar)).Fbytes + 11)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FecVar)).Flength = int32(uint64(unsafe.Sizeof([12]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FecVar)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FecVar)).FrefCount++
	(*Interp)(unsafe.Pointer(iPtr)).FreturnLevel = 1
	(*Interp)(unsafe.Pointer(iPtr)).FreturnCode = TCL_OK

	(*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr = uintptr(0) // Initialise as soon as :: is available
	(*Interp)(unsafe.Pointer(iPtr)).FlookupNsPtr = uintptr(0)

	(*Interp)(unsafe.Pointer(iPtr)).FappendResult = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FappendAvl = 0
	(*Interp)(unsafe.Pointer(iPtr)).FappendUsed = 0

	XTcl_InitHashTable(tls, iPtr+224, 0)
	(*Interp)(unsafe.Pointer(iPtr)).FpackageUnknown = uintptr(0)

	// TIP #268
	if libc.Xgetenv(tls, ts+5894) == uintptr(0) {
		(*Interp)(unsafe.Pointer(iPtr)).FpackagePrefer = PKG_PREFER_STABLE
	} else {
		(*Interp)(unsafe.Pointer(iPtr)).FpackagePrefer = PKG_PREFER_LATEST
	}

	(*Interp)(unsafe.Pointer(iPtr)).FcmdCount = 0
	XTclInitLiteralTable(tls, iPtr+336)
	(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch = 0
	(*Interp)(unsafe.Pointer(iPtr)).FcompiledProcPtr = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FresolverPtr = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FevalFlags = 0
	(*Interp)(unsafe.Pointer(iPtr)).FscriptFile = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).Fflags = 0
	(*Interp)(unsafe.Pointer(iPtr)).FtracePtr = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FtracesForbiddingInline = 0
	(*Interp)(unsafe.Pointer(iPtr)).FactiveCmdTracePtr = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FactiveInterpTracePtr = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FassocData = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr = uintptr(0) // Set after namespaces initialized.
	(*Interp)(unsafe.Pointer(iPtr)).FemptyObjPtr = XTcl_NewObj(tls)
	// Another empty object.
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FemptyObjPtr)).FrefCount++
	*(*int8)(unsafe.Pointer(iPtr + 472)) = int8(0)
	(*Interp)(unsafe.Pointer(iPtr)).FthreadId = XTcl_GetCurrentThread(tls)

	// TIP #378
	if libc.Xgetenv(tls, ts+5916) != uintptr(0) {
		*(*int32)(unsafe.Pointer(iPtr + 424)) |= INTERP_DEBUG_FRAME
	}

	// Initialise the tables for variable traces and searches *before*
	// creating the global ns - so that the trace on errorInfo can be
	// recorded.

	XTcl_InitHashTable(tls, iPtr+1024, 1)
	XTcl_InitHashTable(tls, iPtr+1112, 1)

	(*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr = uintptr(0) // Force creation of global ns below.
	(*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr = XTcl_CreateNamespace(tls, interp, ts+2046,
		uintptr(0), uintptr(0))
	if (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr == uintptr(0) {
		XTcl_Panic(tls, ts+5939, 0)
	}

	// Initialise the rootCallframe. It cannot be allocated on the stack, as
	// it has to be in place before TclCreateExecEnv tries to use a variable.

	// This is needed to satisfy GCC 3.3's strict aliasing rules
	framePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CallFrame{})))
	XTcl_PushCallFrame(tls, interp, framePtr,
		(*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr /*isProcCallFrame*/, 0)
	(*CallFrame)(unsafe.Pointer(framePtr)).Fobjc = 0

	(*Interp)(unsafe.Pointer(iPtr)).FframePtr = framePtr
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = framePtr
	(*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr = framePtr

	// Initialize support for code compilation and execution. We call
	// TclCreateExecEnv after initializing namespaces since it tries to
	// reference a Tcl variable (it links to the Tcl "tcl_traceExec"
	// variable).

	(*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr = XTclCreateExecEnv(tls, interp, INTERP_STACK_INITIAL_SIZE)

	// TIP #219, Tcl Channel Reflection API support.

	(*Interp)(unsafe.Pointer(iPtr)).FchanMsg = uintptr(0)

	// TIP #285, Script cancellation support.

	(*Interp)(unsafe.Pointer(iPtr)).FasyncCancelMsg = XTcl_NewObj(tls)

	cancelInfo = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CancelInfo{})))
	(*CancelInfo)(unsafe.Pointer(cancelInfo)).Finterp = interp

	(*Interp)(unsafe.Pointer(iPtr)).FasyncCancel = XTcl_AsyncCreate(tls, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32) int32
	}{sCancelEvalProc})), cancelInfo)
	(*CancelInfo)(unsafe.Pointer(cancelInfo)).Fasync = (*Interp)(unsafe.Pointer(iPtr)).FasyncCancel
	(*CancelInfo)(unsafe.Pointer(cancelInfo)).Fresult = uintptr(0)
	(*CancelInfo)(unsafe.Pointer(cancelInfo)).Flength = 0

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&cancelLock)))
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&cancelTable)))).FcreateProc})).f(tls, uintptr(unsafe.Pointer(&cancelTable)), iPtr, bp+32 /* &isNew */)
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cancelInfo
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&cancelLock)))

	// Initialize the compilation and execution statistics kept for this
	// interpreter.

	// Initialise the stub table pointer.

	(*Interp)(unsafe.Pointer(iPtr)).FstubTable = uintptr(unsafe.Pointer(&XtclStubs))

	// Initialize the ensemble error message rewriting support.

	XTclResetRewriteEnsemble(tls, interp, 1)

	// TIP#143: Initialise the resource limit support.

	XTclInitLimitSupport(tls, interp)

	// Initialise the thread-specific data ekeko. Note that the thread's alloc
	// cache was already initialised by the call to alloc the interp struct.

	(*Interp)(unsafe.Pointer(iPtr)).FallocCache = XTclpGetAllocCache(tls)
	(*Interp)(unsafe.Pointer(iPtr)).FpendingObjDataPtr = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).FasyncReadyPtr = XTclGetAsyncReadyPtr(tls)
	(*Interp)(unsafe.Pointer(iPtr)).FdeferredCallbacks = uintptr(0)

	// Create the core commands. Do it here, rather than calling
	// Tcl_CreateCommand, because it's faster (there's no need to check for a
	// pre-existing command by the same name). If a command has a Tcl_CmdProc
	// but no Tcl_ObjCmdProc, set the Tcl_ObjCmdProc to
	// TclInvokeStringCommand. This is an object-based wrapper function that
	// extracts strings, calls the string function, and creates an object for
	// the result. Similarly, if a command has a Tcl_ObjCmdProc but no
	// Tcl_CmdProc, set the Tcl_CmdProc to TclInvokeObjectCommand.

	for cmdInfoPtr = uintptr(unsafe.Pointer(&builtInCmds)); (*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).Fname != uintptr(0); cmdInfoPtr += 40 {
		if (*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).FobjProc == uintptr(0) &&
			(*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).FcompileProc == uintptr(0) &&
			(*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).FnreProc == uintptr(0) {
			XTcl_Panic(tls, ts+5987, 0)
		}

		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr + 160 /* &.cmdTable */)).FcreateProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr+160 /* &.cmdTable */, (*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).Fname, bp+32 /* &isNew */)
		if *(*int32)(unsafe.Pointer(bp + 32)) != 0 {
			cmdPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Command{})))
			(*Command)(unsafe.Pointer(cmdPtr)).FhPtr = hPtr
			(*Command)(unsafe.Pointer(cmdPtr)).FnsPtr = (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr
			(*Command)(unsafe.Pointer(cmdPtr)).FrefCount = 1
			(*Command)(unsafe.Pointer(cmdPtr)).FcmdEpoch = 0
			(*Command)(unsafe.Pointer(cmdPtr)).FcompileProc = (*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).FcompileProc
			(*Command)(unsafe.Pointer(cmdPtr)).Fproc = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
			}{XTclInvokeObjectCommand}))
			(*Command)(unsafe.Pointer(cmdPtr)).FclientData = cmdPtr
			(*Command)(unsafe.Pointer(cmdPtr)).FobjProc = (*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).FobjProc
			(*Command)(unsafe.Pointer(cmdPtr)).FobjClientData = uintptr(0)
			(*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc = uintptr(0)
			(*Command)(unsafe.Pointer(cmdPtr)).FdeleteData = uintptr(0)
			(*Command)(unsafe.Pointer(cmdPtr)).Fflags = 0
			if (*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).Fflags&CMD_COMPILES_EXPANDED != 0 {
				*(*int32)(unsafe.Pointer(cmdPtr + 80)) |= CMD_COMPILES_EXPANDED
			}
			(*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr = uintptr(0)
			(*Command)(unsafe.Pointer(cmdPtr)).FtracePtr = uintptr(0)
			(*Command)(unsafe.Pointer(cmdPtr)).FnreProc = (*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).FnreProc
			(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPtr
		}
	}

	// Create the "array", "binary", "chan", "clock", "dict", "encoding",
	// "file", "info", "namespace" and "string" ensembles. Note that all these
	// commands (and their subcommands that are not present in the global
	// namespace) are wholly safe *except* for "clock", "encoding" and "file".

	XTclInitArrayCmd(tls, interp)
	XTclInitBinaryCmd(tls, interp)
	XTclInitChanCmd(tls, interp)
	XTclInitDictCmd(tls, interp)
	XTclInitEncodingCmd(tls, interp)
	XTclInitFileCmd(tls, interp)
	XTclInitInfoCmd(tls, interp)
	XTclInitNamespaceCmd(tls, interp)
	XTclInitStringCmd(tls, interp)
	XTclInitPrefixCmd(tls, interp)

	// Register "clock" subcommands. These *do* go through
	// Tcl_CreateObjCommand, since they aren't in the global namespace and
	// involve ensembles.

	XTclClockInit(tls, interp)

	// Register the built-in functions. This is empty now that they are
	// implemented as commands in the ::tcl::mathfunc namespace.

	// Register the default [interp bgerror] handler.

	XTcl_CreateObjCommand(tls, interp, ts+6057,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclDefaultBgErrorHandlerObjCmd})), uintptr(0), uintptr(0))

	// Create unsupported commands for debugging bytecode and objects.

	XTcl_CreateObjCommand(tls, interp, ts+6072,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTcl_DisassembleObjCmd})), uintptr(int64(0)), uintptr(0))
	XTcl_CreateObjCommand(tls, interp, ts+6104,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTcl_DisassembleObjCmd})), uintptr(int64(1)), uintptr(0))
	XTcl_CreateObjCommand(tls, interp, ts+6136,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTcl_RepresentationCmd})), uintptr(0), uintptr(0))

	// Adding the bytecode assembler command
	cmdPtr = XTcl_NRCreateCommand(tls, interp,
		ts+6171, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTcl_AssembleObjCmd})),
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclNRAssembleObjCmd})), uintptr(0), uintptr(0))
	(*Command)(unsafe.Pointer(cmdPtr)).FcompileProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
	}{XTclCompileAssembleCmd}))

	// Coroutine monkeybusiness
	XTcl_NRCreateCommand(tls, interp, ts+6200, uintptr(0),
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sNRCoroInjectObjCmd})), uintptr(0), uintptr(0))
	XTcl_CreateObjCommand(tls, interp, ts+6227,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sCoroTypeObjCmd})), uintptr(0), uintptr(0))

	// Create an unsupported command for timerate
	XTcl_CreateObjCommand(tls, interp, ts+6256,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTcl_TimeRateObjCmd})), uintptr(0), uintptr(0))

	// Export unsupported commands
	nsPtr = XTcl_FindNamespace(tls, interp, ts+6285, uintptr(0), 0)
	if nsPtr != 0 {
		XTcl_Export(tls, interp, nsPtr, ts+5688, 1)
	}

	// Register the builtin math functions.

	nsPtr = XTcl_CreateNamespace(tls, interp, ts+6304, uintptr(0), uintptr(0))
	if nsPtr == uintptr(0) {
		XTcl_Panic(tls, ts+6320, 0)
	}
	libc.Xmemcpy(tls, bp+36, ts+6357, uint64(MATH_FUNC_PREFIX_LEN))
	for builtinFuncPtr = uintptr(unsafe.Pointer(&sBuiltinFuncTable)); (*BuiltinFuncDef)(unsafe.Pointer(builtinFuncPtr)).Fname != uintptr(0); builtinFuncPtr += 24 {
		libc.Xstrcpy(tls, bp+36+uintptr(MATH_FUNC_PREFIX_LEN), (*BuiltinFuncDef)(unsafe.Pointer(builtinFuncPtr)).Fname)
		XTcl_CreateObjCommand(tls, interp, bp+36,
			(*BuiltinFuncDef)(unsafe.Pointer(builtinFuncPtr)).FobjCmdProc, (*BuiltinFuncDef)(unsafe.Pointer(builtinFuncPtr)).FclientData, uintptr(0))
		XTcl_Export(tls, interp, nsPtr, (*BuiltinFuncDef)(unsafe.Pointer(builtinFuncPtr)).Fname, 0)
	}

	// Register the mathematical "operator" commands. [TIP #174]

	nsPtr = XTcl_CreateNamespace(tls, interp, ts+6375, uintptr(0), uintptr(0))
	if nsPtr == uintptr(0) {
		XTcl_Panic(tls, ts+6389, 0)
	}
	XTcl_Export(tls, interp, nsPtr, ts+5688, 1)
	libc.Xmemcpy(tls, bp+36, ts+6426, uint64(MATH_OP_PREFIX_LEN))
	for opcmdInfoPtr = uintptr(unsafe.Pointer(&mathOpCmds)); (*OpCmdInfo)(unsafe.Pointer(opcmdInfoPtr)).Fname != uintptr(0); opcmdInfoPtr += 40 {
		var occdPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TclOpCmdClientData{})))

		(*TclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop = (*OpCmdInfo)(unsafe.Pointer(opcmdInfoPtr)).Fname
		*(*int32)(unsafe.Pointer(occdPtr + 16)) = *(*int32)(unsafe.Pointer(opcmdInfoPtr + 24))
		(*TclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fexpected = (*OpCmdInfo)(unsafe.Pointer(opcmdInfoPtr)).Fexpected
		libc.Xstrcpy(tls, bp+36+uintptr(MATH_OP_PREFIX_LEN), (*OpCmdInfo)(unsafe.Pointer(opcmdInfoPtr)).Fname)
		cmdPtr = XTcl_CreateObjCommand(tls, interp, bp+36,
			(*OpCmdInfo)(unsafe.Pointer(opcmdInfoPtr)).FobjProc, occdPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteOpCmdClientData})))
		if cmdPtr == uintptr(0) {
			XTcl_Panic(tls, ts+6442,
				libc.VaList(bp, (*OpCmdInfo)(unsafe.Pointer(opcmdInfoPtr)).Fname))
		} else if (*OpCmdInfo)(unsafe.Pointer(opcmdInfoPtr)).FcompileProc != uintptr(0) {
			(*Command)(unsafe.Pointer(cmdPtr)).FcompileProc = (*OpCmdInfo)(unsafe.Pointer(opcmdInfoPtr)).FcompileProc
		}
	}

	// Do Multiple/Safe Interps Tcl init stuff

	XTclInterpInit(tls, interp)
	XTclSetupEnv(tls, interp)

	// TIP #59: Make embedded configuration information available.

	XTclInitEmbeddedConfigurationInformation(tls, interp)

	// TIP #440: Declare the name of the script engine to be "Tcl".

	XTcl_SetVar2(tls, interp, ts+6476, ts+6489, ts+6496,
		TCL_GLOBAL_ONLY)

	// Compute the byte order of this machine.

	*(*int16)(unsafe.Pointer(bp + 68)) = int16(1)
	XTcl_SetVar2(tls, interp, ts+6476, ts+6500,
		func() uintptr {
			if int32(*(*int8)(unsafe.Pointer(bp + 68))) == 1 {
				return ts + 6510 /* "littleEndian" */
			}
			return ts + 6523 /* "bigEndian" */
		}(),
		TCL_GLOBAL_ONLY)

	XTcl_SetVar2Ex(tls, interp, ts+6476, ts+6533,
		XTcl_NewLongObj(tls, int64(unsafe.Sizeof(int64(0)))), TCL_GLOBAL_ONLY)

	// TIP #291
	XTcl_SetVar2Ex(tls, interp, ts+6476, ts+6542,
		XTcl_NewLongObj(tls, int64(unsafe.Sizeof(uintptr(0)))), TCL_GLOBAL_ONLY)

	// Set up other variables such as tcl_version and tcl_library

	XTcl_SetVar2(tls, interp, ts+6554, uintptr(0), ts+6569, TCL_GLOBAL_ONLY)
	XTcl_SetVar2(tls, interp, ts+6576, uintptr(0), ts+6588, TCL_GLOBAL_ONLY)
	XTcl_TraceVar2(tls, interp, ts+6592, uintptr(0),
		TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{XTclPrecTraceProc})), uintptr(0))
	XTclpSetVariables(tls, interp)

	// The existence of the "threaded" element of the tcl_platform array
	// indicates that this particular Tcl shell has been compiled with threads
	// turned on. Using "info exists tcl_platform(threaded)" a Tcl script can
	// introspect on the interpreter level of thread safety.

	XTcl_SetVar2(tls, interp, ts+6476, ts+6606, ts+6615, TCL_GLOBAL_ONLY)

	// Register Tcl's version number.
	// TIP #268: Full patchlevel instead of just major.minor

	XTcl_PkgProvideEx(tls, interp, ts+6496, ts+6569, uintptr(unsafe.Pointer(&XtclStubs)))

	if XTclTommath_Init(tls, interp) != TCL_OK {
		XTcl_Panic(tls, ts+6617, libc.VaList(bp+8, XTcl_GetString(tls, XTcl_GetObjResult(tls, interp))))
	}

	if XTclOOInit(tls, interp) != TCL_OK {
		XTcl_Panic(tls, ts+6617, libc.VaList(bp+16, XTcl_GetString(tls, XTcl_GetObjResult(tls, interp))))
	}

	// Only build in zlib support if we've successfully detected a library to
	// compile and link against.

	if XTclZlibInit(tls, interp) != TCL_OK {
		XTcl_Panic(tls, ts+6617, libc.VaList(bp+24, XTcl_GetString(tls, XTcl_GetObjResult(tls, interp))))
	}

	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr)).FcallbackPtr = uintptr(0)
	return interp
}

func sDeleteOpCmdClientData(tls *libc.TLS, clientData ClientData) { /* tclBasic.c:1015:1: */
	var occdPtr uintptr = clientData

	XTclpFree(tls, occdPtr)
}

//----------------------------------------------------------------------
//
// TclHideUnsafeCommands --
//
//	Hides base commands that are not marked as safe from this interpreter.
//
// Results:
//	TCL_OK if it succeeds, TCL_ERROR else.
//
// Side effects:
//	Hides functionality in an interpreter.
//
//----------------------------------------------------------------------

func XTclHideUnsafeCommands(tls *libc.TLS, interp uintptr) int32 { /* tclBasic.c:1040:1: */
	var cmdInfoPtr uintptr

	if interp == uintptr(0) {
		return TCL_ERROR
	}
	for cmdInfoPtr = uintptr(unsafe.Pointer(&builtInCmds)); (*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).Fname != uintptr(0); cmdInfoPtr += 40 {
		if !((*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).Fflags&CMD_IS_SAFE != 0) {
			XTcl_HideCommand(tls, interp, (*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).Fname, (*CmdInfo)(unsafe.Pointer(cmdInfoPtr)).Fname)
		}
	}
	XTclMakeEncodingCommandSafe(tls, interp) // Ugh!
	XTclMakeFileCommandSafe(tls, interp)     // Ugh!
	return TCL_OK
}

//--------------------------------------------------------------
//
// Tcl_CallWhenDeleted --
//
//	Arrange for a function to be called before a given interpreter is
//	deleted. The function is called as soon as Tcl_DeleteInterp is called;
//	if Tcl_CallWhenDeleted is called on an interpreter that has already
//	been deleted, the function will be called when the last Tcl_Release is
//	done on the interpreter.
//
// Results:
//	None.
//
// Side effects:
//	When Tcl_DeleteInterp is invoked to delete interp, proc will be
//	invoked. See the manual entry for details.
//
//--------------------------------------------------------------

func XTcl_CallWhenDeleted(tls *libc.TLS, interp uintptr, proc uintptr, clientData ClientData) { /* tclBasic.c:1080:1: */
	bp := tls.Alloc(68)
	defer tls.Free(68)

	var iPtr uintptr = interp
	var assocDataCounterPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&assocDataCounterKey)), int32(unsafe.Sizeof(int32(0))))
	// var isNew int32 at bp+64, 4

	// var buffer [56]int8 at bp+8, 56

	var dPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(AssocData{})))
	var hPtr uintptr

	libc.Xsprintf(tls, bp+8, ts+6620, libc.VaList(bp, *(*int32)(unsafe.Pointer(assocDataCounterPtr))))
	*(*int32)(unsafe.Pointer(assocDataCounterPtr))++

	if (*Interp)(unsafe.Pointer(iPtr)).FassocData == uintptr(0) {
		(*Interp)(unsafe.Pointer(iPtr)).FassocData = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
		XTcl_InitHashTable(tls, (*Interp)(unsafe.Pointer(iPtr)).FassocData, 0)
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FassocData)).FcreateProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FassocData, bp+8 /* buffer */, bp+64 /* &isNew */)
	(*AssocData)(unsafe.Pointer(dPtr)).Fproc = proc
	(*AssocData)(unsafe.Pointer(dPtr)).FclientData = clientData
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = dPtr
}

var assocDataCounterKey Tcl_ThreadDataKey /* tclBasic.c:1087:30: */

//--------------------------------------------------------------
//
// Tcl_DontCallWhenDeleted --
//
//	Cancel the arrangement for a function to be called when a given
//	interpreter is deleted.
//
// Results:
//	None.
//
// Side effects:
//	If proc and clientData were previously registered as a callback via
//	Tcl_CallWhenDeleted, they are unregistered. If they weren't previously
//	registered then nothing happens.
//
//--------------------------------------------------------------

func XTcl_DontCallWhenDeleted(tls *libc.TLS, interp uintptr, proc uintptr, clientData ClientData) { /* tclBasic.c:1128:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var iPtr uintptr = interp
	var hTablePtr uintptr
	// var hSearch Tcl_HashSearch at bp, 24

	var hPtr uintptr
	var dPtr uintptr

	hTablePtr = (*Interp)(unsafe.Pointer(iPtr)).FassocData
	if hTablePtr == uintptr(0) {
		return
	}
	for hPtr = XTcl_FirstHashEntry(tls, hTablePtr, bp); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
		dPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		if (*AssocData)(unsafe.Pointer(dPtr)).Fproc == proc && (*AssocData)(unsafe.Pointer(dPtr)).FclientData == clientData {
			XTclpFree(tls, dPtr)
			XTcl_DeleteHashEntry(tls, hPtr)
			return
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_SetAssocData --
//
//	Creates a named association between user-specified data, a delete
//	function and this interpreter. If the association already exists the
//	data is overwritten with the new data. The delete function will be
//	invoked when the interpreter is deleted.
//
// Results:
//	None.
//
// Side effects:
//	Sets the associated data, creates the association if needed.
//
//----------------------------------------------------------------------

func XTcl_SetAssocData(tls *libc.TLS, interp uintptr, name uintptr, proc uintptr, clientData ClientData) { /* tclBasic.c:1175:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp
	var dPtr uintptr
	var hPtr uintptr
	// var isNew int32 at bp, 4

	if (*Interp)(unsafe.Pointer(iPtr)).FassocData == uintptr(0) {
		(*Interp)(unsafe.Pointer(iPtr)).FassocData = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
		XTcl_InitHashTable(tls, (*Interp)(unsafe.Pointer(iPtr)).FassocData, 0)
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FassocData)).FcreateProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FassocData, name, bp /* &isNew */)
	if *(*int32)(unsafe.Pointer(bp)) == 0 {
		dPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	} else {
		dPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(AssocData{})))
	}
	(*AssocData)(unsafe.Pointer(dPtr)).Fproc = proc
	(*AssocData)(unsafe.Pointer(dPtr)).FclientData = clientData

	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = dPtr
}

//----------------------------------------------------------------------
//
// Tcl_DeleteAssocData --
//
//	Deletes a named association of user-specified data with the specified
//	interpreter.
//
// Results:
//	None.
//
// Side effects:
//	Deletes the association.
//
//----------------------------------------------------------------------

func XTcl_DeleteAssocData(tls *libc.TLS, interp uintptr, name uintptr) { /* tclBasic.c:1221:1: */
	var iPtr uintptr = interp
	var dPtr uintptr
	var hPtr uintptr

	if (*Interp)(unsafe.Pointer(iPtr)).FassocData == uintptr(0) {
		return
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FassocData)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FassocData, name)
	if hPtr == uintptr(0) {
		return
	}
	dPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if (*AssocData)(unsafe.Pointer(dPtr)).Fproc != uintptr(0) {
		(*struct {
			f func(*libc.TLS, ClientData, uintptr)
		})(unsafe.Pointer(&struct{ uintptr }{(*AssocData)(unsafe.Pointer(dPtr)).Fproc})).f(tls, (*AssocData)(unsafe.Pointer(dPtr)).FclientData, interp)
	}
	XTclpFree(tls, dPtr)
	XTcl_DeleteHashEntry(tls, hPtr)
}

//----------------------------------------------------------------------
//
// Tcl_GetAssocData --
//
//	Returns the client data associated with this name in the specified
//	interpreter.
//
// Results:
//	The client data in the AssocData record denoted by the named
//	association, or NULL.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetAssocData(tls *libc.TLS, interp uintptr, name uintptr, procPtr uintptr) ClientData { /* tclBasic.c:1263:1: */
	var iPtr uintptr = interp
	var dPtr uintptr
	var hPtr uintptr

	if (*Interp)(unsafe.Pointer(iPtr)).FassocData == uintptr(0) {
		return uintptr(0)
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FassocData)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FassocData, name)
	if hPtr == uintptr(0) {
		return uintptr(0)
	}
	dPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if procPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(procPtr)) = (*AssocData)(unsafe.Pointer(dPtr)).Fproc
	}
	return (*AssocData)(unsafe.Pointer(dPtr)).FclientData
}

//----------------------------------------------------------------------
//
// Tcl_InterpDeleted --
//
//	Returns nonzero if the interpreter has been deleted with a call to
//	Tcl_DeleteInterp.
//
// Results:
//	Nonzero if the interpreter is deleted, zero otherwise.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_InterpDeleted(tls *libc.TLS, interp uintptr) int32 { /* tclBasic.c:1306:1: */
	if (*Interp)(unsafe.Pointer(interp)).Fflags&DELETED != 0 {
		return 1
	}
	return 0
}

//----------------------------------------------------------------------
//
// Tcl_DeleteInterp --
//
//	Ensures that the interpreter will be deleted eventually. If there are
//	no Tcl_Preserve calls in effect for this interpreter, it is deleted
//	immediately, otherwise the interpreter is deleted when the last
//	Tcl_Preserve is matched by a call to Tcl_Release. In either case, the
//	function runs the currently registered deletion callbacks.
//
// Results:
//	None.
//
// Side effects:
//	The interpreter is marked as deleted. The caller may still use it
//	safely if there are calls to Tcl_Preserve in effect for the
//	interpreter, but further calls to Tcl_Eval etc in this interpreter
//	will fail.
//
//----------------------------------------------------------------------

func XTcl_DeleteInterp(tls *libc.TLS, interp uintptr) { /* tclBasic.c:1336:1: */
	var iPtr uintptr = interp

	// If the interpreter has already been marked deleted, just punt.

	if (*Interp)(unsafe.Pointer(iPtr)).Fflags&DELETED != 0 {
		return
	}

	// Mark the interpreter as deleted. No further evals will be allowed.
	// Increase the compileEpoch as a signal to compiled bytecodes.

	*(*int32)(unsafe.Pointer(iPtr + 424)) |= DELETED
	(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch++

	// Ensure that the interpreter is eventually deleted.

	XTcl_EventuallyFree(tls, interp, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sDeleteInterpProc})))
}

//----------------------------------------------------------------------
//
// DeleteInterpProc --
//
//	Helper function to delete an interpreter. This function is called when
//	the last call to Tcl_Preserve on this interpreter is matched by a call
//	to Tcl_Release. The function cleans up all resources used in the
//	interpreter and calls all currently registered interpreter deletion
//	callbacks.
//
// Results:
//	None.
//
// Side effects:
//	Whatever the interpreter deletion callbacks do. Frees resources used
//	by the interpreter.
//
//----------------------------------------------------------------------

func sDeleteInterpProc(tls *libc.TLS, interp uintptr) { /* tclBasic.c:1387:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var iPtr uintptr = interp
	var hPtr uintptr
	// var search Tcl_HashSearch at bp, 24

	var hTablePtr uintptr
	var resPtr uintptr
	var nextResPtr uintptr
	var i int32

	// Punt if there is an error in the Tcl_Release/Tcl_Preserve matchup,
	// unless we are exiting.

	if (*Interp)(unsafe.Pointer(iPtr)).FnumLevels > 0 && !(XTclInExit(tls) != 0) {
		XTcl_Panic(tls, ts+6639, 0)
	}

	// The interpreter should already be marked deleted; otherwise how did we
	// get here?

	if !((*Interp)(unsafe.Pointer(iPtr)).Fflags&DELETED != 0) {
		XTcl_Panic(tls, ts+6681, 0)
	}

	// TIP #219, Tcl Channel Reflection API. Discard a leftover state.

	if (*Interp)(unsafe.Pointer(iPtr)).FchanMsg != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FchanMsg
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Interp)(unsafe.Pointer(iPtr)).FchanMsg = uintptr(0)
	}

	// TIP #285, Script cancellation support. Delete this interp from the
	// global hash table of CancelInfo structs.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&cancelLock)))
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&cancelTable)))).FfindProc})).f(tls, uintptr(unsafe.Pointer(&cancelTable)), iPtr)
	if hPtr != uintptr(0) {
		var cancelInfo uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		if cancelInfo != uintptr(0) {
			if (*CancelInfo)(unsafe.Pointer(cancelInfo)).Fresult != uintptr(0) {
				XTclpFree(tls, (*CancelInfo)(unsafe.Pointer(cancelInfo)).Fresult)
			}
			XTclpFree(tls, cancelInfo)
		}

		XTcl_DeleteHashEntry(tls, hPtr)
	}

	if (*Interp)(unsafe.Pointer(iPtr)).FasyncCancel != uintptr(0) {
		XTcl_AsyncDelete(tls, (*Interp)(unsafe.Pointer(iPtr)).FasyncCancel)
		(*Interp)(unsafe.Pointer(iPtr)).FasyncCancel = uintptr(0)
	}

	if (*Interp)(unsafe.Pointer(iPtr)).FasyncCancelMsg != uintptr(0) {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FasyncCancelMsg
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Interp)(unsafe.Pointer(iPtr)).FasyncCancelMsg = uintptr(0)
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&cancelLock)))

	// Shut down all limit handler callback scripts that call back into this
	// interpreter. Then eliminate all limit handlers for this interpreter.

	XTclRemoveScriptLimitCallbacks(tls, interp)
	XTclLimitRemoveAllHandlers(tls, interp)

	// Dismantle the namespace here, before we clear the assocData. If any
	// background errors occur here, they will be deleted below.
	//
	// Dismantle the namespace after freeing the iPtr->handle so that each
	// bytecode releases its literals without caring to update the literal
	// table, as it will be freed later in this function without further use.

	XTclHandleFree(tls, (*Interp)(unsafe.Pointer(iPtr)).Fhandle)
	XTclTeardownNamespace(tls, (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr)

	// Delete all the hidden commands.

	hTablePtr = (*Interp)(unsafe.Pointer(iPtr)).FhiddenCmdTablePtr
	if hTablePtr != uintptr(0) {
		// Non-pernicious deletion. The deletion callbacks will not be allowed
		// to create any new hidden or non-hidden commands.
		// Tcl_DeleteCommandFromToken will remove the entry from the
		// hiddenCmdTablePtr.

		hPtr = XTcl_FirstHashEntry(tls, hTablePtr, bp)
		for ; hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
			XTcl_DeleteCommandFromToken(tls, interp, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
		}
		XTcl_DeleteHashTable(tls, hTablePtr)
		XTclpFree(tls, hTablePtr)
	}

	// Invoke deletion callbacks; note that a callback can create new
	// callbacks, so we iterate.

	for (*Interp)(unsafe.Pointer(iPtr)).FassocData != uintptr(0) {
		var dPtr uintptr

		hTablePtr = (*Interp)(unsafe.Pointer(iPtr)).FassocData
		(*Interp)(unsafe.Pointer(iPtr)).FassocData = uintptr(0)
		for hPtr = XTcl_FirstHashEntry(tls, hTablePtr, bp); hPtr != uintptr(0); hPtr = XTcl_FirstHashEntry(tls, hTablePtr, bp) {
			dPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
			XTcl_DeleteHashEntry(tls, hPtr)
			if (*AssocData)(unsafe.Pointer(dPtr)).Fproc != uintptr(0) {
				(*struct {
					f func(*libc.TLS, ClientData, uintptr)
				})(unsafe.Pointer(&struct{ uintptr }{(*AssocData)(unsafe.Pointer(dPtr)).Fproc})).f(tls, (*AssocData)(unsafe.Pointer(dPtr)).FclientData, interp)
			}
			XTclpFree(tls, dPtr)
		}
		XTcl_DeleteHashTable(tls, hTablePtr)
		XTclpFree(tls, hTablePtr)
	}

	// Pop the root frame pointer and finish deleting the global
	// namespace. The order is important [Bug 1658572].

	if (*Interp)(unsafe.Pointer(iPtr)).FframePtr != (*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr && !(XTclInExit(tls) != 0) {
		XTcl_Panic(tls, ts+6739, 0)
	}
	XTcl_PopCallFrame(tls, interp)
	XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr)
	(*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr = uintptr(0)
	XTcl_DeleteNamespace(tls, (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr)

	// Free up the result *after* deleting variables, since variable deletion
	// could have transferred ownership of the result string to Tcl.

	XTcl_FreeResult(tls, interp)
	(*Interp)(unsafe.Pointer(iPtr)).Fresult = uintptr(0)
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr = uintptr(0)
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FecVar
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorCode != 0 {
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorCode
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Interp)(unsafe.Pointer(iPtr)).FerrorCode = uintptr(0)
	}
	for ok5 := true; ok5; ok5 = 0 != 0 {
		var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FeiVar
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo != 0 {
		for ok6 := true; ok6; ok6 = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Interp)(unsafe.Pointer(iPtr)).FerrorInfo = uintptr(0)
	}
	for ok7 := true; ok7; ok7 = 0 != 0 {
		var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorStack
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FerrorStack = uintptr(0)
	for ok8 := true; ok8; ok8 = 0 != 0 {
		var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FupLiteral
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok9 := true; ok9; ok9 = 0 != 0 {
		var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FcallLiteral
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok10 := true; ok10; ok10 = 0 != 0 {
		var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok11 := true; ok11; ok11 = 0 != 0 {
		var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FinnerContext
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts != 0 {
		for ok12 := true; ok12; ok12 = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FappendResult != uintptr(0) {
		XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).FappendResult)
		(*Interp)(unsafe.Pointer(iPtr)).FappendResult = uintptr(0)
	}
	XTclFreePackageInfo(tls, iPtr)
	for (*Interp)(unsafe.Pointer(iPtr)).FtracePtr != uintptr(0) {
		XTcl_DeleteTrace(tls, iPtr, (*Interp)(unsafe.Pointer(iPtr)).FtracePtr)
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr != uintptr(0) {
		XTclDeleteExecEnv(tls, (*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr)
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FscriptFile != 0 {
		for ok13 := true; ok13; ok13 = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FscriptFile
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Interp)(unsafe.Pointer(iPtr)).FscriptFile = uintptr(0)
	}
	for ok14 := true; ok14; ok14 = 0 != 0 {
		var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FemptyObjPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FemptyObjPtr = uintptr(0)

	resPtr = (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr
	for resPtr != 0 {
		nextResPtr = (*ResolverScheme)(unsafe.Pointer(resPtr)).FnextPtr
		XTclpFree(tls, (*ResolverScheme)(unsafe.Pointer(resPtr)).Fname)
		XTclpFree(tls, resPtr)
		resPtr = nextResPtr
	}

	// Free up literal objects created for scripts compiled by the
	// interpreter.

	XTclDeleteLiteralTable(tls, interp, iPtr+336)

	// TIP #280 - Release the arrays for ByteCode/Proc extension, and
	// contents.

	for hPtr = XTcl_FirstHashEntry(tls, (*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr, bp); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
		var cfPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		var procPtr uintptr = func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(hPtr + 32))
			}
			return hPtr + 32
		}()

		(*Proc)(unsafe.Pointer(procPtr)).FiPtr = uintptr(0)
		if cfPtr != 0 {
			if (*CmdFrame)(unsafe.Pointer(cfPtr)).Ftype == 4 {
				for ok15 := true; ok15; ok15 = 0 != 0 {
					var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(cfPtr + 40))
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
			XTclpFree(tls, (*CmdFrame)(unsafe.Pointer(cfPtr)).Fline)
			XTclpFree(tls, cfPtr)
		}
		XTcl_DeleteHashEntry(tls, hPtr)
	}
	XTcl_DeleteHashTable(tls, (*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)
	XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)
	(*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr = uintptr(0)

	// See also tclCompile.c, TclCleanupByteCode

	for hPtr = XTcl_FirstHashEntry(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr, bp); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
		var eclPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		if (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Ftype == 4 {
			for ok16 := true; ok16; ok16 = 0 != 0 {
				var _objPtr uintptr = (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fpath
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		for i = 0; i < (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc; i++ {
			XTclpFree(tls, (*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc+uintptr(i)*24)).Fline)
		}

		if (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc != uintptr(0) {
			XTclpFree(tls, (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc)
		}

		XTclpFree(tls, eclPtr)
		XTcl_DeleteHashEntry(tls, hPtr)
	}
	XTcl_DeleteHashTable(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr)
	XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr)
	(*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr = uintptr(0)

	// Location stack for uplevel/eval/... scripts which were passed through
	// proc arguments. Actually we track all arguments as we do not and cannot
	// know which arguments will be used as scripts and which will not.

	if (*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr)).FnumEntries != 0 && !(XTclInExit(tls) != 0) {
		// When the interp goes away we have nothing on the stack, so there
		// are no arguments, so this table has to be empty.

		XTcl_Panic(tls, ts+6804, 0)
	}

	XTcl_DeleteHashTable(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr)
	XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr)
	(*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr = uintptr(0)

	if (*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr)).FnumEntries != 0 && !(XTclInExit(tls) != 0) {
		// When the interp goes away we have nothing on the stack, so there
		// are no arguments, so this table has to be empty.

		XTcl_Panic(tls, ts+6804, 0)
	}

	XTcl_DeleteHashTable(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr)
	XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr)
	(*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr = uintptr(0)

	// Squelch the tables of traces on variables and searches over arrays in
	// the in the interpreter.

	XTcl_DeleteHashTable(tls, iPtr+1024)
	XTcl_DeleteHashTable(tls, iPtr+1112)

	XTclpFree(tls, iPtr)
}

//---------------------------------------------------------------------------
//
// Tcl_HideCommand --
//
//	Makes a command hidden so that it cannot be invoked from within an
//	interpreter, only from within an ancestor.
//
// Results:
//	A standard Tcl result; also leaves a message in the interp's result if
//	an error occurs.
//
// Side effects:
//	Removes a command from the command table and create an entry into the
//	hidden command table under the specified token name.
//
//---------------------------------------------------------------------------

func XTcl_HideCommand(tls *libc.TLS, interp uintptr, cmdName uintptr, hiddenCmdToken uintptr) int32 { /* tclBasic.c:1709:1: */
	bp := tls.Alloc(108)
	defer tls.Free(108)

	var iPtr uintptr = interp
	var cmd Tcl_Command
	var cmdPtr uintptr
	var hiddenCmdTablePtr uintptr
	var hPtr uintptr
	// var isNew int32 at bp+104, 4

	if (*Interp)(unsafe.Pointer(iPtr)).Fflags&DELETED != 0 {
		// The interpreter is being deleted. Do not create any new structures,
		// because it is not safe to modify the interpreter.

		return TCL_ERROR
	}

	// Disallow hiding of commands that are currently in a namespace or
	// renaming (as part of hiding) into a namespace (because the current
	// implementation with a single global table and the needed uniqueness of
	// names cause problems with namespaces).
	//
	// We don't need to check for "::" in cmdName because the real check is on
	// the nsPtr below.
	//
	// hiddenCmdToken is just a string which is not interpreted in any way. It
	// may contain :: but the string is not interpreted as a namespace
	// qualifier command name. Thus, hiding foo::bar to foo::bar and then
	// trying to expose or invoke ::foo::bar will NOT work; but if the
	// application always uses the same strings it will get consistent
	// behaviour.
	//
	// But as we currently limit ourselves to the global namespace only for
	// the source, in order to avoid potential confusion, lets prevent "::" in
	// the token too. - dl

	if libc.Xstrstr(tls, hiddenCmdToken, ts+6847) != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

			ts+6850, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+6915, ts+6921, uintptr(0)))
		return TCL_ERROR
	}

	// Find the command to hide. An error is returned if cmdName can't be
	// found. Look up the command only from the global namespace. Full path of
	// the command must be given if using namespaces.

	cmd = XTcl_FindCommand(tls, interp, cmdName, uintptr(0),
		TCL_LEAVE_ERR_MSG|TCL_GLOBAL_ONLY)
	if cmd == uintptr(0) {
		return TCL_ERROR
	}
	cmdPtr = cmd

	// Check that the command is really in global namespace

	if (*Command)(unsafe.Pointer(cmdPtr)).FnsPtr != (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+6933,
			-1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+6996, ts+7001, uintptr(0)))
		return TCL_ERROR
	}

	// Initialize the hidden command table if necessary.

	hiddenCmdTablePtr = (*Interp)(unsafe.Pointer(iPtr)).FhiddenCmdTablePtr
	if hiddenCmdTablePtr == uintptr(0) {
		hiddenCmdTablePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
		XTcl_InitHashTable(tls, hiddenCmdTablePtr, 0)
		(*Interp)(unsafe.Pointer(iPtr)).FhiddenCmdTablePtr = hiddenCmdTablePtr
	}

	// It is an error to move an exposed command to a hidden command with
	// hiddenCmdToken if a hidden command with the name hiddenCmdToken already
	// exists.

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hiddenCmdTablePtr)).FcreateProc})).f(tls, hiddenCmdTablePtr, hiddenCmdToken, bp+104 /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp + 104)) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+7012,
			libc.VaList(bp+64, hiddenCmdToken)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+6996, ts+7053, uintptr(0)))
		return TCL_ERROR
	}

	// NB: This code is currently 'like' a rename to a specialy set apart name
	// table. Changes here and in TclRenameCommand must be kept in synch until
	// the common parts are actually factorized out.

	// Remove the hash entry for the command from the interpreter command
	// table. This is like deleting the command, so bump its command epoch;
	// this invalidates any cached references that point to the command.

	if (*Command)(unsafe.Pointer(cmdPtr)).FhPtr != uintptr(0) {
		XTcl_DeleteHashEntry(tls, (*Command)(unsafe.Pointer(cmdPtr)).FhPtr)
		(*Command)(unsafe.Pointer(cmdPtr)).FhPtr = uintptr(0)
		(*Command)(unsafe.Pointer(cmdPtr)).FcmdEpoch++
	}

	// The list of command exported from the namespace might have changed.
	// However, we do not need to recompute this just yet; next time we need
	// the info will be soon enough.

	if (*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FnumExportPatterns != 0 {
		(*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FexportLookupEpoch++
	}
	if (*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcommandPathLength != 0 {
		(*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcmdRefEpoch++
	}

	// Now link the hash table entry with the command structure. We ensured
	// above that the nsPtr was right.

	(*Command)(unsafe.Pointer(cmdPtr)).FhPtr = hPtr
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPtr

	// If the command being hidden has a compile function, increment the
	// interpreter's compileEpoch to invalidate its compiled code. This makes
	// sure that we don't later try to execute old code compiled with
	// command-specific (i.e., inline) bytecodes for the now-hidden command.
	// This field is checked in Tcl_EvalObj and ObjInterpProc, and code whose
	// compilation epoch doesn't match is recompiled.

	if (*Command)(unsafe.Pointer(cmdPtr)).FcompileProc != uintptr(0) {
		(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch++
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ExposeCommand --
//
//	Makes a previously hidden command callable from inside the interpreter
//	instead of only by its ancestors.
//
// Results:
//	A standard Tcl result. If an error occurs, a message is left in the
//	interp's result.
//
// Side effects:
//	Moves commands from one hash table to another.
//
//----------------------------------------------------------------------

func XTcl_ExposeCommand(tls *libc.TLS, interp uintptr, hiddenCmdToken uintptr, cmdName uintptr) int32 { /* tclBasic.c:1878:1: */
	bp := tls.Alloc(124)
	defer tls.Free(124)

	var iPtr uintptr = interp
	var cmdPtr uintptr
	var nsPtr uintptr
	var hPtr uintptr
	var hiddenCmdTablePtr uintptr
	// var isNew int32 at bp+120, 4

	if (*Interp)(unsafe.Pointer(iPtr)).Fflags&DELETED != 0 {
		// The interpreter is being deleted. Do not create any new structures,
		// because it is not safe to modify the interpreter.

		return TCL_ERROR
	}

	// Check that we have a regular name for the command (that the user is not
	// trying to do an expose and a rename (to another namespace) at the same
	// time).

	if libc.Xstrstr(tls, cmdName, ts+6847) != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+7068,
			-1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7135, ts+7001, uintptr(0)))
		return TCL_ERROR
	}

	// Get the command from the hidden command table:

	hPtr = uintptr(0)
	hiddenCmdTablePtr = (*Interp)(unsafe.Pointer(iPtr)).FhiddenCmdTablePtr
	if hiddenCmdTablePtr != uintptr(0) {
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hiddenCmdTablePtr)).FfindProc})).f(tls, hiddenCmdTablePtr, hiddenCmdToken)
	}
	if hPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+7142, libc.VaList(bp+32, hiddenCmdToken)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7170, ts+6921,
			hiddenCmdToken, uintptr(0)))
		return TCL_ERROR
	}
	cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

	// Check that we have a true global namespace command (enforced by
	// Tcl_HideCommand but let's double check. (If it was not, we would not
	// really know how to handle it).

	if (*Command)(unsafe.Pointer(cmdPtr)).FnsPtr != (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr {
		// This case is theoritically impossible, we might rather Tcl_Panic
		// than 'nicely' erroring out ?

		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+7177,
			-1))
		return TCL_ERROR
	}

	// This is the global table.

	nsPtr = (*Command)(unsafe.Pointer(cmdPtr)).FnsPtr

	// It is an error to overwrite an existing exposed command as a result of
	// exposing a previously hidden command.

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(nsPtr + 160 /* &.cmdTable */)).FcreateProc})).f(tls, nsPtr+160 /* &.cmdTable */, cmdName, bp+120 /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+7233, libc.VaList(bp+80, cmdName)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, ts+3593, ts+7135, ts+7269, uintptr(0)))
		return TCL_ERROR
	}

	// Command resolvers (per-interp, per-namespace) might have resolved to a
	// command for the given namespace scope with this command not being
	// registered with the namespace's command table. During BC compilation,
	// the so-resolved command turns into a CmdName literal. Without
	// invalidating a possible CmdName literal here explicitly, such literals
	// keep being reused while pointing to overhauled commands.

	XTclInvalidateCmdLiteral(tls, interp, cmdName, nsPtr)

	// The list of command exported from the namespace might have changed.
	// However, we do not need to recompute this just yet; next time we need
	// the info will be soon enough.

	if (*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns != 0 {
		(*Namespace)(unsafe.Pointer(nsPtr)).FexportLookupEpoch++
	}
	if (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength != 0 {
		(*Namespace)(unsafe.Pointer(nsPtr)).FcmdRefEpoch++
	}

	// Remove the hash entry for the command from the interpreter hidden
	// command table.

	if (*Command)(unsafe.Pointer(cmdPtr)).FhPtr != uintptr(0) {
		XTcl_DeleteHashEntry(tls, (*Command)(unsafe.Pointer(cmdPtr)).FhPtr)
		(*Command)(unsafe.Pointer(cmdPtr)).FhPtr = uintptr(0)
	}

	// Now link the hash table entry with the command structure. This is like
	// creating a new command, so deal with any shadowing of commands in the
	// global namespace.

	(*Command)(unsafe.Pointer(cmdPtr)).FhPtr = hPtr

	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPtr

	// Not needed as we are only in the global namespace (but would be needed
	// again if we supported namespace command hiding)
	//
	// TclResetShadowedCmdRefs(interp, cmdPtr);

	// If the command being exposed has a compile function, increment
	// interpreter's compileEpoch to invalidate its compiled code. This makes
	// sure that we don't later try to execute old code compiled assuming the
	// command is hidden. This field is checked in Tcl_EvalObj and
	// ObjInterpProc, and code whose compilation epoch doesn't match is
	// recompiled.

	if (*Command)(unsafe.Pointer(cmdPtr)).FcompileProc != uintptr(0) {
		(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch++
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_CreateCommand --
//
//	Define a new command in a command table.
//
// Results:
//	The return value is a token for the command, which can be used in
//	future calls to Tcl_GetCommandName.
//
// Side effects:
//	If a command named cmdName already exists for interp, it is deleted.
//	In the future, when cmdName is seen as the name of a command by
//	Tcl_Eval, proc will be called. To support the bytecode interpreter,
//	the command is created with a wrapper Tcl_ObjCmdProc
//	(TclInvokeStringCommand) that eventially calls proc. When the command
//	is deleted from the table, deleteProc will be called. See the manual
//	entry for details on the calling sequence.
//
//----------------------------------------------------------------------

func XTcl_CreateCommand(tls *libc.TLS, interp uintptr, cmdName uintptr, proc uintptr, clientData ClientData, deleteProc uintptr) Tcl_Command { /* tclBasic.c:2054:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var iPtr uintptr = interp
	var oldRefPtr uintptr = uintptr(0)
	// var nsPtr uintptr at bp, 8

	var cmdPtr uintptr
	var hPtr uintptr
	// var tail uintptr at bp+24, 8

	*(*int32)(unsafe.Pointer(bp + 32 /* isNew */)) = 0
	var deleted int32 = 0
	var dataPtr uintptr

	if (*Interp)(unsafe.Pointer(iPtr)).Fflags&DELETED != 0 {
		// The interpreter is being deleted. Don't create any new commands;
		// it's not safe to muck with the interpreter anymore.

		return uintptr(0)
	}

	// If the command name we seek to create already exists, we need to
	// delete that first.  That can be tricky in the presence of traces.
	// Loop until we no longer find an existing command in the way, or
	// until we've deleted one command and that didn't finish the job.

	for 1 != 0 {
		// Determine where the command should reside. If its name contains
		// namespace qualifiers, we put it in the specified namespace;
		// otherwise, we always put it in the global namespace.

		if libc.Xstrstr(tls, cmdName, ts+6847) != uintptr(0) {
			// var dummy1 uintptr at bp+8, 8

			// var dummy2 uintptr at bp+16, 8

			XTclGetNamespaceForQualName(tls, interp, cmdName, uintptr(0),
				TCL_CREATE_NS_IF_UNKNOWN, bp, bp+8, bp+16, bp+24)
			if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) {
				return uintptr(0)
			}
		} else {
			*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)) = (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr
			*(*uintptr)(unsafe.Pointer(bp + 24 /* tail */)) = cmdName
		}

		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)) + 160 /* &.cmdTable */)).FcreateProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp /* nsPtr */))+160 /* &.cmdTable */, *(*uintptr)(unsafe.Pointer(bp + 24 /* tail */)), bp+32 /* &isNew */)

		if *(*int32)(unsafe.Pointer(bp + 32)) != 0 || deleted != 0 {
			// isNew - No conflict with existing command.
			// deleted - We've already deleted a conflicting command
			break
		}

		// An existing command conflicts. Try to delete it...

		cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		// Be careful to preserve any existing import links so we can restore
		// them down below. That way, you can redefine a command and its
		// import status will remain intact.

		(*Command)(unsafe.Pointer(cmdPtr)).FrefCount++
		if (*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr != 0 {
			*(*int32)(unsafe.Pointer(cmdPtr + 80)) |= CMD_REDEF_IN_PROGRESS
		}

		XTcl_DeleteCommandFromToken(tls, interp, cmdPtr)

		if (*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_REDEF_IN_PROGRESS != 0 {
			oldRefPtr = (*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr
			(*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr = uintptr(0)
		}
		if libc.PostDecInt32(&(*Command)(unsafe.Pointer(cmdPtr)).FrefCount, 1) <= 1 {
			XTclpFree(tls, cmdPtr)
		}

		deleted = 1
	}

	if !(*(*int32)(unsafe.Pointer(bp + 32)) != 0) {
		// If the deletion callback recreated the command, just throw away the
		// new command (if we try to delete it again, we could get stuck in an
		// infinite loop).

		XTclpFree(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	}

	if !(deleted != 0) {
		// Command resolvers (per-interp, per-namespace) might have resolved
		// to a command for the given namespace scope with this command not
		// being registered with the namespace's command table. During BC
		// compilation, the so-resolved command turns into a CmdName literal.
		// Without invalidating a possible CmdName literal here explicitly,
		// such literals keep being reused while pointing to overhauled
		// commands.

		XTclInvalidateCmdLiteral(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 24 /* tail */)), *(*uintptr)(unsafe.Pointer(bp /* nsPtr */)))

		// The list of command exported from the namespace might have changed.
		// However, we do not need to recompute this just yet; next time we
		// need the info will be soon enough.

		if (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnumExportPatterns != 0 {
			(*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FexportLookupEpoch++
		}
		if (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FcommandPathLength != 0 {
			(*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FcmdRefEpoch++
		}

		XTclInvalidateNsPath(tls, *(*uintptr)(unsafe.Pointer(bp /* nsPtr */)))
	}
	cmdPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Command{})))
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPtr
	(*Command)(unsafe.Pointer(cmdPtr)).FhPtr = hPtr
	(*Command)(unsafe.Pointer(cmdPtr)).FnsPtr = *(*uintptr)(unsafe.Pointer(bp /* nsPtr */))
	(*Command)(unsafe.Pointer(cmdPtr)).FrefCount = 1
	(*Command)(unsafe.Pointer(cmdPtr)).FcmdEpoch = 0
	(*Command)(unsafe.Pointer(cmdPtr)).FcompileProc = uintptr(0)
	(*Command)(unsafe.Pointer(cmdPtr)).FobjProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclInvokeStringCommand}))
	(*Command)(unsafe.Pointer(cmdPtr)).FobjClientData = cmdPtr
	(*Command)(unsafe.Pointer(cmdPtr)).Fproc = proc
	(*Command)(unsafe.Pointer(cmdPtr)).FclientData = clientData
	(*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc = deleteProc
	(*Command)(unsafe.Pointer(cmdPtr)).FdeleteData = clientData
	(*Command)(unsafe.Pointer(cmdPtr)).Fflags = 0
	(*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr = uintptr(0)
	(*Command)(unsafe.Pointer(cmdPtr)).FtracePtr = uintptr(0)
	(*Command)(unsafe.Pointer(cmdPtr)).FnreProc = uintptr(0)

	// Plug in any existing import references found above. Be sure to update
	// all of these references to point to the new command.

	if oldRefPtr != uintptr(0) {
		(*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr = oldRefPtr
		for oldRefPtr != uintptr(0) {
			var refCmdPtr uintptr = (*ImportRef)(unsafe.Pointer(oldRefPtr)).FimportedCmdPtr
			dataPtr = (*Command)(unsafe.Pointer(refCmdPtr)).FobjClientData
			(*ImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr = cmdPtr
			oldRefPtr = (*ImportRef)(unsafe.Pointer(oldRefPtr)).FnextPtr
		}
	}

	// We just created a command, so in its namespace and all of its parent
	// namespaces, it may shadow global commands with the same name. If any
	// shadowed commands are found, invalidate all cached command references
	// in the affected namespaces.

	XTclResetShadowedCmdRefs(tls, interp, cmdPtr)
	return cmdPtr
}

//----------------------------------------------------------------------
//
// Tcl_CreateObjCommand --
//
//	Define a new object-based command in a command table.
//
// Results:
//	The return value is a token for the command, which can be used in
//	future calls to Tcl_GetCommandName.
//
// Side effects:
//	If a command named "cmdName" already exists for interp, it is
//	first deleted.  Then the new command is created from the arguments.
//	[***] (See below for exception).
//
//	In the future, during bytecode evaluation when "cmdName" is seen as
//	the name of a command by Tcl_EvalObj or Tcl_Eval, the object-based
//	Tcl_ObjCmdProc proc will be called. When the command is deleted from
//	the table, deleteProc will be called. See the manual entry for details
//	on the calling sequence.
//
//----------------------------------------------------------------------

func XTcl_CreateObjCommand(tls *libc.TLS, interp uintptr, cmdName uintptr, proc uintptr, clientData ClientData, deleteProc uintptr) Tcl_Command { /* tclBasic.c:2251:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var iPtr uintptr = interp
	// var nsPtr uintptr at bp, 8

	// var tail uintptr at bp+24, 8

	if (*Interp)(unsafe.Pointer(iPtr)).Fflags&DELETED != 0 {
		// The interpreter is being deleted. Don't create any new commands;
		// it's not safe to muck with the interpreter anymore.
		return uintptr(0)
	}

	// Determine where the command should reside. If its name contains
	// namespace qualifiers, we put it in the specified namespace;
	// otherwise, we always put it in the global namespace.

	if libc.Xstrstr(tls, cmdName, ts+6847) != uintptr(0) {
		// var dummy1 uintptr at bp+8, 8

		// var dummy2 uintptr at bp+16, 8

		XTclGetNamespaceForQualName(tls, interp, cmdName, uintptr(0),
			TCL_CREATE_NS_IF_UNKNOWN, bp, bp+8, bp+16, bp+24)
		if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) {
			return uintptr(0)
		}
	} else {
		*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)) = (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr
		*(*uintptr)(unsafe.Pointer(bp + 24 /* tail */)) = cmdName
	}

	return XTclCreateObjCommandInNs(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 24 /* tail */)), *(*uintptr)(unsafe.Pointer(bp /* nsPtr */)),
		proc, clientData, deleteProc)
}

func XTclCreateObjCommandInNs(tls *libc.TLS, interp uintptr, cmdName uintptr, namespace uintptr, proc uintptr, clientData ClientData, deleteProc uintptr) Tcl_Command { /* tclBasic.c:2303:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var deleted int32 = 0
	*(*int32)(unsafe.Pointer(bp /* isNew */)) = 0
	var cmdPtr uintptr
	var oldRefPtr uintptr = uintptr(0)
	var dataPtr uintptr
	var hPtr uintptr
	var nsPtr uintptr = namespace
	// If the command name we seek to create already exists, we need to
	// delete that first.  That can be tricky in the presence of traces.
	// Loop until we no longer find an existing command in the way, or
	// until we've deleted one command and that didn't finish the job.
	for 1 != 0 {
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(nsPtr + 160 /* &.cmdTable */)).FcreateProc})).f(tls, nsPtr+160 /* &.cmdTable */, cmdName, bp /* &isNew */)

		if *(*int32)(unsafe.Pointer(bp)) != 0 || deleted != 0 {
			// isNew - No conflict with existing command.
			// deleted - We've already deleted a conflicting command
			break
		}

		// An existing command conflicts. Try to delete it...

		cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		// [***] This is wrong.  See Tcl Bug a16752c252.
		// However, this buggy behavior is kept under particular circumstances
		// to accommodate deployed binaries of the "tclcompiler" program
		// <http://sourceforge.net/projects/tclpro/> that crash if the bug is
		// fixed.

		if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc == *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclInvokeStringCommand})) &&
			(*Command)(unsafe.Pointer(cmdPtr)).FclientData == clientData &&
			(*Command)(unsafe.Pointer(cmdPtr)).FdeleteData == clientData &&
			(*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc == deleteProc {
			(*Command)(unsafe.Pointer(cmdPtr)).FobjProc = proc
			(*Command)(unsafe.Pointer(cmdPtr)).FobjClientData = clientData
			return cmdPtr
		}

		// Otherwise, we delete the old command. Be careful to preserve any
		// existing import links so we can restore them down below. That way,
		// you can redefine a command and its import status will remain
		// intact.

		(*Command)(unsafe.Pointer(cmdPtr)).FrefCount++
		if (*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr != 0 {
			*(*int32)(unsafe.Pointer(cmdPtr + 80)) |= CMD_REDEF_IN_PROGRESS
		}

		// Make sure namespace doesn't get deallocated.

		(*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FrefCount++

		XTcl_DeleteCommandFromToken(tls, interp, cmdPtr)
		nsPtr = XTclEnsureNamespace(tls, interp,
			(*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)
		XTclNsDecrRefCount(tls, (*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)

		if (*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_REDEF_IN_PROGRESS != 0 {
			oldRefPtr = (*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr
			(*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr = uintptr(0)
		}
		if libc.PostDecInt32(&(*Command)(unsafe.Pointer(cmdPtr)).FrefCount, 1) <= 1 {
			XTclpFree(tls, cmdPtr)
		}

		deleted = 1
	}
	if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
		// If the deletion callback recreated the command, just throw away
		// the new command (if we try to delete it again, we could get
		// stuck in an infinite loop).

		XTclpFree(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	}

	if !(deleted != 0) {
		// Command resolvers (per-interp, per-namespace) might have resolved
		// to a command for the given namespace scope with this command not
		// being registered with the namespace's command table. During BC
		// compilation, the so-resolved command turns into a CmdName literal.
		// Without invalidating a possible CmdName literal here explicitly,
		// such literals keep being reused while pointing to overhauled
		// commands.

		XTclInvalidateCmdLiteral(tls, interp, cmdName, nsPtr)

		// The list of command exported from the namespace might have changed.
		// However, we do not need to recompute this just yet; next time we
		// need the info will be soon enough.

		if (*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns != 0 {
			(*Namespace)(unsafe.Pointer(nsPtr)).FexportLookupEpoch++
		}
		if (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength != 0 {
			(*Namespace)(unsafe.Pointer(nsPtr)).FcmdRefEpoch++
		}

		XTclInvalidateNsPath(tls, nsPtr)
	}
	cmdPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Command{})))
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPtr
	(*Command)(unsafe.Pointer(cmdPtr)).FhPtr = hPtr
	(*Command)(unsafe.Pointer(cmdPtr)).FnsPtr = nsPtr
	(*Command)(unsafe.Pointer(cmdPtr)).FrefCount = 1
	(*Command)(unsafe.Pointer(cmdPtr)).FcmdEpoch = 0
	(*Command)(unsafe.Pointer(cmdPtr)).FcompileProc = uintptr(0)
	(*Command)(unsafe.Pointer(cmdPtr)).FobjProc = proc
	(*Command)(unsafe.Pointer(cmdPtr)).FobjClientData = clientData
	(*Command)(unsafe.Pointer(cmdPtr)).Fproc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclInvokeObjectCommand}))
	(*Command)(unsafe.Pointer(cmdPtr)).FclientData = cmdPtr
	(*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc = deleteProc
	(*Command)(unsafe.Pointer(cmdPtr)).FdeleteData = clientData
	(*Command)(unsafe.Pointer(cmdPtr)).Fflags = 0
	(*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr = uintptr(0)
	(*Command)(unsafe.Pointer(cmdPtr)).FtracePtr = uintptr(0)
	(*Command)(unsafe.Pointer(cmdPtr)).FnreProc = uintptr(0)

	// Plug in any existing import references found above. Be sure to update
	// all of these references to point to the new command.

	if oldRefPtr != uintptr(0) {
		(*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr = oldRefPtr
		for oldRefPtr != uintptr(0) {
			var refCmdPtr uintptr = (*ImportRef)(unsafe.Pointer(oldRefPtr)).FimportedCmdPtr
			dataPtr = (*Command)(unsafe.Pointer(refCmdPtr)).FobjClientData
			(*ImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr = cmdPtr
			oldRefPtr = (*ImportRef)(unsafe.Pointer(oldRefPtr)).FnextPtr
		}
	}

	// We just created a command, so in its namespace and all of its parent
	// namespaces, it may shadow global commands with the same name. If any
	// shadowed commands are found, invalidate all cached command references
	// in the affected namespaces.

	XTclResetShadowedCmdRefs(tls, interp, cmdPtr)
	return cmdPtr
}

//----------------------------------------------------------------------
//
// TclInvokeStringCommand --
//
//	"Wrapper" Tcl_ObjCmdProc used to call an existing string-based
//	Tcl_CmdProc if no object-based function exists for a command. A
//	pointer to this function is stored as the Tcl_ObjCmdProc in a Command
//	structure. It simply turns around and calls the string Tcl_CmdProc in
//	the Command structure.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	Besides those side effects of the called Tcl_CmdProc,
//	TclInvokeStringCommand allocates and frees storage.
//
//----------------------------------------------------------------------

func XTclInvokeStringCommand(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:2489:1: */
	var cmdPtr uintptr = clientData
	var i int32
	var result int32
	var argv uintptr = XTclStackAlloc(tls, interp, int32(uint64(uint32(objc+1))*uint64(unsafe.Sizeof(uintptr(0)))))

	for i = 0; i < objc; i++ {
		*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}
	*(*uintptr)(unsafe.Pointer(argv + uintptr(objc)*8)) = uintptr(0)

	// Invoke the command's string-based Tcl_CmdProc.

	result = (*struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Command)(unsafe.Pointer(cmdPtr)).Fproc})).f(tls, (*Command)(unsafe.Pointer(cmdPtr)).FclientData, interp, objc, argv)

	XTclStackFree(tls, interp, argv)
	return result
}

//----------------------------------------------------------------------
//
// TclInvokeObjectCommand --
//
//	"Wrapper" Tcl_CmdProc used to call an existing object-based
//	Tcl_ObjCmdProc if no string-based function exists for a command. A
//	pointer to this function is stored as the Tcl_CmdProc in a Command
//	structure. It simply turns around and calls the object Tcl_ObjCmdProc
//	in the Command structure.
//
// Results:
//	A standard Tcl string result value.
//
// Side effects:
//	Besides those side effects of the called Tcl_ObjCmdProc,
//	TclInvokeObjectCommand allocates and frees storage.
//
//----------------------------------------------------------------------

func XTclInvokeObjectCommand(tls *libc.TLS, clientData ClientData, interp uintptr, argc int32, argv uintptr) int32 { /* tclBasic.c:2537:1: */
	var cmdPtr uintptr = clientData
	var objPtr uintptr
	var i int32
	var length int32
	var result int32
	var objv uintptr = XTclStackAlloc(tls, interp, int32(uint32(uint64(argc)*uint64(unsafe.Sizeof(uintptr(0))))))

	for i = 0; i < argc; i++ {
		length = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					objPtr = XTclThreadAllocObj(tls)
				} else {
					objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
			if length == 0 {
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(length+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), uint64(length))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(length))) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = length
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
			{
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
		*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) = objPtr
	}

	// Invoke the command's object-based Tcl_ObjCmdProc.

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != uintptr(0) {
		result = (*struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Command)(unsafe.Pointer(cmdPtr)).FobjProc})).f(tls, (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData, interp, argc, objv)
	} else {
		result = XTcl_NRCallObjProc(tls, interp, (*Command)(unsafe.Pointer(cmdPtr)).FnreProc,
			(*Command)(unsafe.Pointer(cmdPtr)).FobjClientData, argc, objv)
	}

	// Move the interpreter's object result to the string result, then reset
	// the object result.

	XTcl_GetStringResult(tls, interp)

	// Decrement the ref counts for the argument objects created above, then
	// free the objv array if malloc'ed storage was used.

	for i = 0; i < argc; i++ {
		objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	XTclStackFree(tls, interp, objv)
	return result
}

//----------------------------------------------------------------------
//
// TclRenameCommand --
//
//	Called to give an existing Tcl command a different name. Both the old
//	command name and the new command name can have "::" namespace
//	qualifiers. If the new command has a different namespace context, the
//	command will be moved to that namespace and will execute in the
//	context of that new namespace.
//
//	If the new command name is NULL or the null string, the command is
//	deleted.
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	If anything goes wrong, an error message is returned in the
//	interpreter's result object.
//
//----------------------------------------------------------------------

func XTclRenameCommand(tls *libc.TLS, interp uintptr, oldName uintptr, newName uintptr) int32 { /* tclBasic.c:2612:1: */
	bp := tls.Alloc(400)
	defer tls.Free(400)

	var iPtr uintptr
	// var newTail uintptr at bp+168, 8

	var cmdNsPtr uintptr
	// var newNsPtr uintptr at bp+144, 8

	// var dummy1 uintptr at bp+152, 8

	// var dummy2 uintptr at bp+160, 8

	var cmd Tcl_Command
	var cmdPtr uintptr
	var hPtr uintptr
	var oldHPtr uintptr
	// var isNew int32 at bp+176, 4

	var result int32
	var oldFullName uintptr
	// var newFullName Tcl_DString at bp+184, 216

	var cachePtr uintptr
	iPtr = interp

	// Find the existing command. An error is returned if cmdName can't be
	// found.

	cmd = XTcl_FindCommand(tls, interp, oldName, uintptr(0), 0)
	cmdPtr = cmd
	if !(cmdPtr == uintptr(0)) {
		goto __1
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+7284,
		libc.VaList(bp, func() uintptr {
			if newName == uintptr(0) || int32(*(*int8)(unsafe.Pointer(newName))) == 0 {
				return ts + 7321 /* "delete" */
			}
			return ts + 5284 /* "rename" */
		}(),
			oldName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+7170, ts+7328, oldName, uintptr(0)))
	return TCL_ERROR
__1:
	;

	// If the new command name is NULL or empty, delete the command. Do this
	// with Tcl_DeleteCommandFromToken, since we already have the command.

	if !(newName == uintptr(0) || int32(*(*int8)(unsafe.Pointer(newName))) == 0) {
		goto __2
	}
	XTcl_DeleteCommandFromToken(tls, interp, cmd)
	return TCL_OK
__2:
	;

	cmdNsPtr = (*Command)(unsafe.Pointer(cmdPtr)).FnsPtr
	oldFullName = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(oldFullName)).FrefCount++
	XTcl_GetCommandFullName(tls, interp, cmd, oldFullName)

	// Make sure that the destination command does not already exist. The
	// rename operation is like creating a command, so we should automatically
	// create the containing namespaces just like Tcl_CreateCommand would.

	XTclGetNamespaceForQualName(tls, interp, newName, uintptr(0),
		TCL_CREATE_NS_IF_UNKNOWN, bp+144, bp+152, bp+160, bp+168)

	if !(*(*uintptr)(unsafe.Pointer(bp + 144)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(bp + 168)) == uintptr(0)) {
		goto __3
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+7336, libc.VaList(bp+56, newName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+6915, ts+7328, uintptr(0)))
	result = TCL_ERROR
	goto done
__3:
	;
	if !((*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 144)) + 160)).FfindProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 144))+160, *(*uintptr)(unsafe.Pointer(bp + 168))) != uintptr(0)) {
		goto __4
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+7375, libc.VaList(bp+96, newName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+104, ts+3593, ts+7420, ts+7430,
		ts+7437, uintptr(0)))
	result = TCL_ERROR
	goto done
__4:
	;

	// Warning: any changes done in the code here are likely to be needed in
	// Tcl_HideCommand code too (until the common parts are extracted out).
	// - dl

	// Put the command in the new namespace so we can check for an alias loop.
	// Since we are adding a new command to a namespace, we must handle any
	// shadowing of the global commands that this might create.

	oldHPtr = (*Command)(unsafe.Pointer(cmdPtr)).FhPtr
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 144 /* newNsPtr */)) + 160 /* &.cmdTable */)).FcreateProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 144 /* newNsPtr */))+160 /* &.cmdTable */, *(*uintptr)(unsafe.Pointer(bp + 168 /* newTail */)), bp+176 /* &isNew */)
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPtr
	(*Command)(unsafe.Pointer(cmdPtr)).FhPtr = hPtr
	(*Command)(unsafe.Pointer(cmdPtr)).FnsPtr = *(*uintptr)(unsafe.Pointer(bp + 144 /* newNsPtr */))
	XTclResetShadowedCmdRefs(tls, interp, cmdPtr)

	// Now check for an alias loop. If we detect one, put everything back the
	// way it was and report the error.

	result = XTclPreventAliasLoop(tls, interp, interp, cmdPtr)
	if !(result != TCL_OK) {
		goto __5
	}
	XTcl_DeleteHashEntry(tls, (*Command)(unsafe.Pointer(cmdPtr)).FhPtr)
	(*Command)(unsafe.Pointer(cmdPtr)).FhPtr = oldHPtr
	(*Command)(unsafe.Pointer(cmdPtr)).FnsPtr = cmdNsPtr
	goto done
__5:
	;

	// The list of command exported from the namespace might have changed.
	// However, we do not need to recompute this just yet; next time we need
	// the info will be soon enough. These might refer to the same variable,
	// but that's no big deal.

	if !((*Namespace)(unsafe.Pointer(cmdNsPtr)).FnumExportPatterns != 0) {
		goto __6
	}
	(*Namespace)(unsafe.Pointer(cmdNsPtr)).FexportLookupEpoch++
__6:
	;
	if !((*Namespace)(unsafe.Pointer(cmdNsPtr)).FcommandPathLength != 0) {
		goto __7
	}
	(*Namespace)(unsafe.Pointer(cmdNsPtr)).FcmdRefEpoch++
__7:
	;

	if !((*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FnumExportPatterns != 0) {
		goto __8
	}
	(*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FexportLookupEpoch++
__8:
	;
	if !((*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcommandPathLength != 0) {
		goto __9
	}
	(*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcmdRefEpoch++
__9:
	;

	// Command resolvers (per-interp, per-namespace) might have resolved to a
	// command for the given namespace scope with this command not being
	// registered with the namespace's command table. During BC compilation,
	// the so-resolved command turns into a CmdName literal. Without
	// invalidating a possible CmdName literal here explicitly, such literals
	// keep being reused while pointing to overhauled commands.

	XTclInvalidateCmdLiteral(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 168 /* newTail */)), (*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)

	// Script for rename traces can delete the command "oldName". Therefore
	// increment the reference count for cmdPtr so that it's Command structure
	// is freed only towards the end of this function by calling
	// TclCleanupCommand.
	//
	// The trace function needs to get a fully qualified name for old and new
	// commands [Tcl bug #651271], or else there's no way for the trace
	// function to get the namespace from which the old command is being
	// renamed!

	XTcl_DStringInit(tls, bp+184)
	XTcl_DStringAppend(tls, bp+184, (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 144 /* newNsPtr */)))).FfullName, -1)
	if !(*(*uintptr)(unsafe.Pointer(bp + 144)) != (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr) {
		goto __10
	}
	XTcl_DStringAppend(tls, bp+184, ts+6847, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
__10:
	;
	XTcl_DStringAppend(tls, bp+184, *(*uintptr)(unsafe.Pointer(bp + 168 /* newTail */)), -1)
	(*Command)(unsafe.Pointer(cmdPtr)).FrefCount++
	sCallCommandTraces(tls, iPtr, cmdPtr, XTcl_GetString(tls, oldFullName),
		(*Tcl_DString)(unsafe.Pointer(bp+184)).Fstring, TCL_TRACE_RENAME)
	XTcl_DStringFree(tls, bp+184)

	// The new command name is okay, so remove the command from its current
	// namespace. This is like deleting the command, so bump the cmdEpoch to
	// invalidate any cached references to the command.

	XTcl_DeleteHashEntry(tls, oldHPtr)
	(*Command)(unsafe.Pointer(cmdPtr)).FcmdEpoch++

	// If the command being renamed has a compile function, increment the
	// interpreter's compileEpoch to invalidate its compiled code. This makes
	// sure that we don't later try to execute old code compiled for the
	// now-renamed command.

	if !((*Command)(unsafe.Pointer(cmdPtr)).FcompileProc != uintptr(0)) {
		goto __11
	}
	(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch++
__11:
	;

	// Now free the Command structure, if the "oldName" command has been
	// deleted by invocation of rename traces.

	if !(libc.PostDecInt32(&(*Command)(unsafe.Pointer(cmdPtr)).FrefCount, 1) <= 1) {
		goto __12
	}
	XTclpFree(tls, cmdPtr)
__12:
	;

	result = TCL_OK

done:
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldFullName)).FrefCount, 1) > 1) {
		goto __13
	}
	goto __14
__13:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(oldFullName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldFullName)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __15
	}

	if !((*Tcl_Obj)(unsafe.Pointer(oldFullName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldFullName)).Fbytes != XtclEmptyStringRep) {
		goto __17
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldFullName)).Fbytes)
__17:
	;
	(*Tcl_Obj)(unsafe.Pointer(oldFullName)).Flength = -1
__18:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __21
	}
	XTclThreadFreeObj(tls, oldFullName)
	goto __22
__21:
	*(*uintptr)(unsafe.Pointer(oldFullName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldFullName
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__22:
	;
	goto __19
__19:
	if 0 != 0 {
		goto __18
	}
	goto __20
__20:
	;
	goto __16
__15:
	XTclFreeObj(tls, oldFullName)
__16:
	;
__14:
	;

	return result
}

//----------------------------------------------------------------------
//
// Tcl_SetCommandInfo --
//
//	Modifies various information about a Tcl command. Note that this
//	function will not change a command's namespace; use TclRenameCommand
//	to do that. Also, the isNativeObjectProc member of *infoPtr is
//	ignored.
//
// Results:
//	If cmdName exists in interp, then the information at *infoPtr is
//	stored with the command in place of the current information and 1 is
//	returned. If the command doesn't exist then 0 is returned.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_SetCommandInfo(tls *libc.TLS, interp uintptr, cmdName uintptr, infoPtr uintptr) int32 { /* tclBasic.c:2814:1: */
	var cmd Tcl_Command

	cmd = XTcl_FindCommand(tls, interp, cmdName, uintptr(0), 0)
	return XTcl_SetCommandInfoFromToken(tls, cmd, infoPtr)
}

//----------------------------------------------------------------------
//
// Tcl_SetCommandInfoFromToken --
//
//	Modifies various information about a Tcl command. Note that this
//	function will not change a command's namespace; use TclRenameCommand
//	to do that. Also, the isNativeObjectProc member of *infoPtr is
//	ignored.
//
// Results:
//	If cmdName exists in interp, then the information at *infoPtr is
//	stored with the command in place of the current information and 1 is
//	returned. If the command doesn't exist then 0 is returned.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_SetCommandInfoFromToken(tls *libc.TLS, cmd Tcl_Command, infoPtr uintptr) int32 { /* tclBasic.c:2849:1: */
	var cmdPtr uintptr // Internal representation of the command

	if cmd == uintptr(0) {
		return 0
	}

	// The isNativeObjectProc and nsPtr members of *infoPtr are ignored.

	cmdPtr = cmd
	(*Command)(unsafe.Pointer(cmdPtr)).Fproc = (*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).Fproc
	(*Command)(unsafe.Pointer(cmdPtr)).FclientData = (*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FclientData
	if (*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc == uintptr(0) {
		(*Command)(unsafe.Pointer(cmdPtr)).FobjProc = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclInvokeStringCommand}))
		(*Command)(unsafe.Pointer(cmdPtr)).FobjClientData = cmdPtr
		(*Command)(unsafe.Pointer(cmdPtr)).FnreProc = uintptr(0)
	} else {
		if (*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc != (*Command)(unsafe.Pointer(cmdPtr)).FobjProc {
			(*Command)(unsafe.Pointer(cmdPtr)).FnreProc = uintptr(0)
			(*Command)(unsafe.Pointer(cmdPtr)).FobjProc = (*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc
		}
		(*Command)(unsafe.Pointer(cmdPtr)).FobjClientData = (*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjClientData
	}
	(*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc = (*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteProc
	(*Command)(unsafe.Pointer(cmdPtr)).FdeleteData = (*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteData
	return 1
}

//----------------------------------------------------------------------
//
// Tcl_GetCommandInfo --
//
//	Returns various information about a Tcl command.
//
// Results:
//	If cmdName exists in interp, then *infoPtr is modified to hold
//	information about cmdName and 1 is returned. If the command doesn't
//	exist then 0 is returned and *infoPtr isn't modified.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetCommandInfo(tls *libc.TLS, interp uintptr, cmdName uintptr, infoPtr uintptr) int32 { /* tclBasic.c:2901:1: */
	var cmd Tcl_Command

	cmd = XTcl_FindCommand(tls, interp, cmdName, uintptr(0), 0)
	return XTcl_GetCommandInfoFromToken(tls, cmd, infoPtr)
}

//----------------------------------------------------------------------
//
// Tcl_GetCommandInfoFromToken --
//
//	Returns various information about a Tcl command.
//
// Results:
//	Copies information from the command identified by 'cmd' into a
//	caller-supplied structure and returns 1. If the 'cmd' is NULL, leaves
//	the structure untouched and returns 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetCommandInfoFromToken(tls *libc.TLS, cmd Tcl_Command, infoPtr uintptr) int32 { /* tclBasic.c:2933:1: */
	var cmdPtr uintptr // Internal representation of the command

	if cmd == uintptr(0) {
		return 0
	}

	// Set isNativeObjectProc 1 if objProc was registered by a call to
	// Tcl_CreateObjCommand. Otherwise set it to 0.

	cmdPtr = cmd
	(*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FisNativeObjectProc = libc.Bool32((*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclInvokeStringCommand})))
	(*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc = (*Command)(unsafe.Pointer(cmdPtr)).FobjProc
	(*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjClientData = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	(*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).Fproc = (*Command)(unsafe.Pointer(cmdPtr)).Fproc
	(*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FclientData = (*Command)(unsafe.Pointer(cmdPtr)).FclientData
	(*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteProc = (*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc
	(*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteData = (*Command)(unsafe.Pointer(cmdPtr)).FdeleteData
	(*Tcl_CmdInfo)(unsafe.Pointer(infoPtr)).FnamespacePtr = (*Command)(unsafe.Pointer(cmdPtr)).FnsPtr

	return 1
}

//----------------------------------------------------------------------
//
// Tcl_GetCommandName --
//
//	Given a token returned by Tcl_CreateCommand, this function returns the
//	current name of the command (which may have changed due to renaming).
//
// Results:
//	The return value is the name of the given command.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetCommandName(tls *libc.TLS, interp uintptr, command Tcl_Command) uintptr { /* tclBasic.c:2979:12: */
	var cmdPtr uintptr = command

	if cmdPtr == uintptr(0) || (*Command)(unsafe.Pointer(cmdPtr)).FhPtr == uintptr(0) {
		// This should only happen if command was "created" after the
		// interpreter began to be deleted, so there isn't really any command.
		// Just return an empty string.

		return ts + 2046 /* "" */
	}

	return func() uintptr {
		if (*Tcl_HashTable)(unsafe.Pointer((*Tcl_HashEntry)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FhPtr)).FtablePtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Tcl_HashEntry)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FhPtr)).FtablePtr)).FkeyType == -1 {
			return *(*uintptr)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FhPtr + 32))
		}
		return (*Command)(unsafe.Pointer(cmdPtr)).FhPtr + 32
	}()
}

//----------------------------------------------------------------------
//
// Tcl_GetCommandFullName --
//
//	Given a token returned by, e.g., Tcl_CreateCommand or Tcl_FindCommand,
//	this function appends to an object the command's full name, qualified
//	by a sequence of parent namespace names. The command's fully-qualified
//	name may have changed due to renaming.
//
// Results:
//	None.
//
// Side effects:
//	The command's fully-qualified name is appended to the string
//	representation of objPtr.
//
//----------------------------------------------------------------------

func XTcl_GetCommandFullName(tls *libc.TLS, interp uintptr, command Tcl_Command, objPtr uintptr) { /* tclBasic.c:3022:1: */
	var iPtr uintptr = interp
	var cmdPtr uintptr = command
	var name uintptr

	// Add the full name of the containing namespace, followed by the "::"
	// separator, and the command name.

	if cmdPtr != uintptr(0) {
		if (*Command)(unsafe.Pointer(cmdPtr)).FnsPtr != uintptr(0) {
			XTcl_AppendToObj(tls, objPtr, (*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FfullName, -1)
			if (*Command)(unsafe.Pointer(cmdPtr)).FnsPtr != (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr {
				XTcl_AppendToObj(tls, objPtr, ts+6847, 2)
			}
		}
		if (*Command)(unsafe.Pointer(cmdPtr)).FhPtr != uintptr(0) {
			name = func() uintptr {
				if (*Tcl_HashTable)(unsafe.Pointer((*Tcl_HashEntry)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FhPtr)).FtablePtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Tcl_HashEntry)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FhPtr)).FtablePtr)).FkeyType == -1 {
					return *(*uintptr)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FhPtr + 32))
				}
				return (*Command)(unsafe.Pointer(cmdPtr)).FhPtr + 32
			}()
			XTcl_AppendToObj(tls, objPtr, name, -1)
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_DeleteCommand --
//
//	Remove the given command from the given interpreter.
//
// Results:
//	0 is returned if the command was deleted successfully. -1 is returned
//	if there didn't exist a command by that name.
//
// Side effects:
//	cmdName will no longer be recognized as a valid command for interp.
//
//----------------------------------------------------------------------

func XTcl_DeleteCommand(tls *libc.TLS, interp uintptr, cmdName uintptr) int32 { /* tclBasic.c:3072:1: */
	var cmd Tcl_Command

	// Find the desired command and delete it.

	cmd = XTcl_FindCommand(tls, interp, cmdName, uintptr(0), 0)
	if cmd == uintptr(0) {
		return -1
	}
	return XTcl_DeleteCommandFromToken(tls, interp, cmd)
}

//----------------------------------------------------------------------
//
// Tcl_DeleteCommandFromToken --
//
//	Removes the given command from the given interpreter. This function
//	resembles Tcl_DeleteCommand, but takes a Tcl_Command token instead of
//	a command name for efficiency.
//
// Results:
//	0 is returned if the command was deleted successfully. -1 is returned
//	if there didn't exist a command by that name.
//
// Side effects:
//	The command specified by "cmd" will no longer be recognized as a valid
//	command for "interp".
//
//----------------------------------------------------------------------

func XTcl_DeleteCommandFromToken(tls *libc.TLS, interp uintptr, cmd Tcl_Command) int32 { /* tclBasic.c:3111:1: */
	var iPtr uintptr = interp
	var cmdPtr uintptr = cmd
	var refPtr uintptr
	var nextRefPtr uintptr
	var importCmd Tcl_Command

	// Bump the command epoch counter. This will invalidate all cached
	// references that point to this command.

	(*Command)(unsafe.Pointer(cmdPtr)).FcmdEpoch++

	// The code here is tricky. We can't delete the hash table entry before
	// invoking the deletion callback because there are cases where the
	// deletion callback needs to invoke the command (e.g. object systems such
	// as OTcl). However, this means that the callback could try to delete or
	// rename the command. The deleted flag allows us to detect these cases
	// and skip nested deletes.

	if (*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_IS_DELETED != 0 {
		// Another deletion is already in progress. Remove the hash table
		// entry now, but don't invoke a callback or free the command
		// structure. Take care to only remove the hash entry if it has not
		// already been removed; otherwise if we manage to hit this function
		// three times, everything goes up in smoke. [Bug 1220058]

		if (*Command)(unsafe.Pointer(cmdPtr)).FhPtr != uintptr(0) {
			XTcl_DeleteHashEntry(tls, (*Command)(unsafe.Pointer(cmdPtr)).FhPtr)
			(*Command)(unsafe.Pointer(cmdPtr)).FhPtr = uintptr(0)
		}
		return 0
	}

	// We must delete this command, even though both traces and delete procs
	// may try to avoid this (renaming the command etc). Also traces and
	// delete procs may try to delete the command themselves. This flag
	// declares that a delete is in progress and that recursive deletes should
	// be ignored.

	*(*int32)(unsafe.Pointer(cmdPtr + 80)) |= CMD_IS_DELETED

	// Call trace functions for the command being deleted. Then delete its
	// traces.

	(*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FrefCount++

	if (*Command)(unsafe.Pointer(cmdPtr)).FtracePtr != uintptr(0) {
		var tracePtr uintptr
		sCallCommandTraces(tls, iPtr, cmdPtr, uintptr(0), uintptr(0), TCL_TRACE_DELETE)

		// Now delete these traces.

		tracePtr = (*Command)(unsafe.Pointer(cmdPtr)).FtracePtr
		for tracePtr != uintptr(0) {
			var nextPtr uintptr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr

			if libc.PostDecInt32(&(*CommandTrace)(unsafe.Pointer(tracePtr)).FrefCount, 1) <= 1 {
				XTclpFree(tls, tracePtr)
			}
			tracePtr = nextPtr
		}
		(*Command)(unsafe.Pointer(cmdPtr)).FtracePtr = uintptr(0)
	}

	// The list of command exported from the namespace might have changed.
	// However, we do not need to recompute this just yet; next time we need
	// the info will be soon enough.

	if (*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FnumExportPatterns != 0 {
		(*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FexportLookupEpoch++
	}
	if (*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcommandPathLength != 0 {
		(*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcmdRefEpoch++
	}

	XTclNsDecrRefCount(tls, (*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)

	// If the command being deleted has a compile function, increment the
	// interpreter's compileEpoch to invalidate its compiled code. This makes
	// sure that we don't later try to execute old code compiled with
	// command-specific (i.e., inline) bytecodes for the now-deleted command.
	// This field is checked in Tcl_EvalObj and ObjInterpProc, and code whose
	// compilation epoch doesn't match is recompiled.

	if (*Command)(unsafe.Pointer(cmdPtr)).FcompileProc != uintptr(0) {
		(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch++
	}

	// Delete any imports of this routine elsewhere before calling deleteProc
	// to that traces on the imports don't reference deallocated storage.
	if !((*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_REDEF_IN_PROGRESS != 0) {
		for refPtr = (*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr; refPtr != uintptr(0); refPtr = nextRefPtr {
			nextRefPtr = (*ImportRef)(unsafe.Pointer(refPtr)).FnextPtr
			importCmd = (*ImportRef)(unsafe.Pointer(refPtr)).FimportedCmdPtr
			XTcl_DeleteCommandFromToken(tls, interp, importCmd)
		}
	}

	if (*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc != uintptr(0) {
		// Delete the command's client data. If this was an imported command
		// created when a command was imported into a namespace, this client
		// data will be a pointer to a ImportedCmdData structure describing
		// the "real" command that this imported command refers to.
		//
		// If you are getting a crash during the call to deleteProc and
		// cmdPtr->deleteProc is a pointer to the function free(), the most
		// likely cause is that your extension allocated memory for the
		// clientData argument to Tcl_CreateObjCommand with the ckalloc()
		// macro and you are now trying to deallocate this memory with free()
		// instead of ckfree(). You should pass a pointer to your own method
		// that calls ckfree().

		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc})).f(tls, (*Command)(unsafe.Pointer(cmdPtr)).FdeleteData)
	}

	// Don't use hPtr to delete the hash entry here, because it's possible
	// that the deletion callback renamed the command. Instead, use
	// cmdPtr->hptr, and make sure that no-one else has already deleted the
	// hash entry.

	if (*Command)(unsafe.Pointer(cmdPtr)).FhPtr != uintptr(0) {
		XTcl_DeleteHashEntry(tls, (*Command)(unsafe.Pointer(cmdPtr)).FhPtr)
		(*Command)(unsafe.Pointer(cmdPtr)).FhPtr = uintptr(0)
	}

	// A number of tests for particular kinds of commands are done by checking
	// whether the objProc field holds a known value. Set the field to NULL so
	// that such tests won't have false positives when applied to deleted
	// commands.

	(*Command)(unsafe.Pointer(cmdPtr)).FobjProc = uintptr(0)

	// Now free the Command structure, unless there is another reference to it
	// from a CmdName Tcl object in some ByteCode code sequence. In that case,
	// delay the cleanup until all references are either discarded (when a
	// ByteCode is freed) or replaced by a new reference (when a cached
	// CmdName Command reference is found to be invalid and
	// TclNRExecuteByteCode looks up the command in the command hashtable).

	*(*int32)(unsafe.Pointer(cmdPtr + 80)) |= CMD_DEAD
	if libc.PostDecInt32(&(*Command)(unsafe.Pointer(cmdPtr)).FrefCount, 1) <= 1 {
		XTclpFree(tls, cmdPtr)
	}

	return 0
}

//----------------------------------------------------------------------
//
// CallCommandTraces --
//
//	Abstraction of the code to call traces on a command.
//
// Results:
//	Currently always NULL.
//
// Side effects:
//	Anything; this may recursively evaluate scripts and code exists to do
//	just that.
//
//----------------------------------------------------------------------

func sCallCommandTraces(tls *libc.TLS, iPtr uintptr, cmdPtr uintptr, oldName uintptr, newName uintptr, flags int32) uintptr { /* tclBasic.c:3296:13: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var tracePtr uintptr
	// var active ActiveCommandTrace at bp, 32

	var result uintptr
	var oldNamePtr uintptr = uintptr(0)
	var state Tcl_InterpState = uintptr(0)

	if (*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_TRACE_ACTIVE != 0 {
		// While a rename trace is active, we will not process any more rename
		// traces; while a delete trace is active we will never reach here -
		// because Tcl_DeleteCommandFromToken checks for the condition
		// (cmdPtr->flags & CMD_IS_DELETED) and returns immediately when a
		// command deletion is in progress. For all other traces, delete
		// traces will not be invoked but a call to TraceCommandProc will
		// ensure that tracePtr->clientData is freed whenever the command
		// "oldName" is deleted.

		if (*Command)(unsafe.Pointer(cmdPtr)).Fflags&TCL_TRACE_RENAME != 0 {
			flags = flags & libc.CplInt32(TCL_TRACE_RENAME)
		}
		if flags == 0 {
			return uintptr(0)
		}
	}
	*(*int32)(unsafe.Pointer(cmdPtr + 80)) |= CMD_TRACE_ACTIVE

	result = uintptr(0)
	(*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FnextPtr = (*Interp)(unsafe.Pointer(iPtr)).FactiveCmdTracePtr
	(*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FreverseScan = 0
	(*Interp)(unsafe.Pointer(iPtr)).FactiveCmdTracePtr = bp /* &active */

	if flags&TCL_TRACE_DELETE != 0 {
		flags = flags | TCL_TRACE_DESTROYED
	}
	(*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FcmdPtr = cmdPtr

	XTcl_Preserve(tls, iPtr)

	for tracePtr = (*Command)(unsafe.Pointer(cmdPtr)).FtracePtr; tracePtr != uintptr(0); tracePtr = (*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr {
		(*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr
		if !((*CommandTrace)(unsafe.Pointer(tracePtr)).Fflags&flags != 0) {
			continue
		}
		*(*int32)(unsafe.Pointer(cmdPtr + 80)) |= (*CommandTrace)(unsafe.Pointer(tracePtr)).Fflags
		if oldName == uintptr(0) {
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					oldNamePtr = XTclThreadAllocObj(tls)
				} else {
					oldNamePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(oldNamePtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).Flength = 0
			(*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).FtypePtr = uintptr(0)
			{
			}

			(*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).FrefCount++
			XTcl_GetCommandFullName(tls, iPtr,
				cmdPtr, oldNamePtr)
			oldName = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes
				}
				return XTcl_GetString(tls, oldNamePtr)
			}()
		}
		(*CommandTrace)(unsafe.Pointer(tracePtr)).FrefCount++
		if state == uintptr(0) {
			state = XTcl_SaveInterpState(tls, iPtr, TCL_OK)
		}
		(*struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
		})(unsafe.Pointer(&struct{ uintptr }{(*CommandTrace)(unsafe.Pointer(tracePtr)).FtraceProc})).f(tls, (*CommandTrace)(unsafe.Pointer(tracePtr)).FclientData, iPtr,
			oldName, newName, flags)
		*(*int32)(unsafe.Pointer(cmdPtr + 80)) &= ^(*CommandTrace)(unsafe.Pointer(tracePtr)).Fflags
		if libc.PostDecInt32(&(*CommandTrace)(unsafe.Pointer(tracePtr)).FrefCount, 1) <= 1 {
			XTclpFree(tls, tracePtr)
		}
	}

	if state != 0 {
		XTcl_RestoreInterpState(tls, iPtr, state)
	}

	// If a new object was created to hold the full oldName, free it now.

	if oldNamePtr != uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(oldNamePtr)).Flength = -1
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, oldNamePtr)
					} else {
						*(*uintptr)(unsafe.Pointer(oldNamePtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldNamePtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, oldNamePtr)
			}
		}

	}

	// Restore the variable's flags, remove the record of our active traces,
	// and then return.

	*(*int32)(unsafe.Pointer(cmdPtr + 80)) &= libc.CplInt32(CMD_TRACE_ACTIVE)
	(*Interp)(unsafe.Pointer(iPtr)).FactiveCmdTracePtr = (*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FnextPtr
	XTcl_Release(tls, iPtr)
	return result
}

//----------------------------------------------------------------------
//
// CancelEvalProc --
//
//	Marks this interpreter as being canceled. This causes current
//	executions to be unwound as the interpreter enters a state where it
//	refuses to execute more commands or handle [catch] or [try], yet the
//	interpreter is still able to execute further commands after the
//	cancelation is cleared (unlike if it is deleted).
//
// Results:
//	The value given for the code argument.
//
// Side effects:
//	Transfers a message from the cancelation message to the interpreter.
//
//----------------------------------------------------------------------

func sCancelEvalProc(tls *libc.TLS, clientData ClientData, interp uintptr, code int32) int32 { /* tclBasic.c:3417:1: */
	var cancelInfo uintptr = clientData
	var iPtr uintptr

	if cancelInfo != uintptr(0) {
		XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&cancelLock)))
		iPtr = (*CancelInfo)(unsafe.Pointer(cancelInfo)).Finterp

		if iPtr != uintptr(0) {
			// Setting the CANCELED flag will cause the script in progress to
			// be canceled as soon as possible. The core honors this flag at
			// all the necessary places to ensure script cancellation is
			// responsive. Extensions can check for this flag by calling
			// Tcl_Canceled and checking if TCL_ERROR is returned or they can
			// choose to ignore the script cancellation flag and the
			// associated functionality altogether. Currently, the only other
			// flag we care about here is the TCL_CANCEL_UNWIND flag (from
			// Tcl_CancelEval). We do not want to simply combine all the flags
			// from original Tcl_CancelEval call with the interp flags here
			// just in case the caller passed flags that might cause behaviour
			// unrelated to script cancellation.

			*(*int32)(unsafe.Pointer(iPtr + 424)) |= CANCELED
			if ((*CancelInfo)(unsafe.Pointer(cancelInfo)).Fflags|CANCELED)&TCL_CANCEL_UNWIND != 0 {
				*(*int32)(unsafe.Pointer(iPtr + 424)) |= TCL_CANCEL_UNWIND
			}

			// Now, we must set the script cancellation flags on all the child
			// interpreters belonging to this one.

			XTclSetSlaveCancelFlags(tls, iPtr,
				(*CancelInfo)(unsafe.Pointer(cancelInfo)).Fflags|CANCELED, 0)

			// Create the result object now so that Tcl_Canceled can avoid
			// locking the cancelLock mutex.

			if (*CancelInfo)(unsafe.Pointer(cancelInfo)).Fresult != uintptr(0) {
				XTcl_SetStringObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FasyncCancelMsg, (*CancelInfo)(unsafe.Pointer(cancelInfo)).Fresult,
					(*CancelInfo)(unsafe.Pointer(cancelInfo)).Flength)
			} else {
				XTcl_SetObjLength(tls, (*Interp)(unsafe.Pointer(iPtr)).FasyncCancelMsg, 0)
			}
		}
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&cancelLock)))
	}

	return code
}

//----------------------------------------------------------------------
//
// TclCleanupCommand --
//
//	This function frees up a Command structure unless it is still
//	referenced from an interpreter's command hashtable or from a CmdName
//	Tcl object representing the name of a command in a ByteCode
//	instruction sequence.
//
// Results:
//	None.
//
// Side effects:
//	Memory gets freed unless a reference to the Command structure still
//	exists. In that case the cleanup is delayed until the command is
//	deleted or when the last ByteCode referring to it is freed.
//
//----------------------------------------------------------------------

func XTclCleanupCommand(tls *libc.TLS, cmdPtr uintptr) { /* tclBasic.c:3495:1: */
	(*Command)(unsafe.Pointer(cmdPtr)).FrefCount--
	if (*Command)(unsafe.Pointer(cmdPtr)).FrefCount <= 0 {
		XTclpFree(tls, cmdPtr)
	}
}

//----------------------------------------------------------------------
//
// Tcl_CreateMathFunc --
//
//	Creates a new math function for expressions in a given interpreter.
//
// Results:
//	None.
//
// Side effects:
//	The Tcl function defined by "name" is created or redefined. If the
//	function already exists then its definition is replaced; this includes
//	the builtin functions. Redefining a builtin function forces all
//	existing code to be invalidated since that code may be compiled using
//	an instruction specific to the replaced function. In addition,
//	redefioning a non-builtin function will force existing code to be
//	invalidated if the number of arguments has changed.
//
//----------------------------------------------------------------------

func XTcl_CreateMathFunc(tls *libc.TLS, interp uintptr, name uintptr, numArgs int32, argTypes uintptr, proc uintptr, clientData ClientData) { /* tclBasic.c:3528:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	// var bigName Tcl_DString at bp, 216

	var data uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(OldMathFuncData{})))

	(*OldMathFuncData)(unsafe.Pointer(data)).Fproc = proc
	(*OldMathFuncData)(unsafe.Pointer(data)).FnumArgs = numArgs
	(*OldMathFuncData)(unsafe.Pointer(data)).FargTypes = XTcl_Alloc(tls, uint32(uint64(numArgs)*uint64(unsafe.Sizeof(Tcl_ValueType(0)))))
	libc.Xmemcpy(tls, (*OldMathFuncData)(unsafe.Pointer(data)).FargTypes, argTypes, uint64(numArgs)*uint64(unsafe.Sizeof(Tcl_ValueType(0))))
	(*OldMathFuncData)(unsafe.Pointer(data)).FclientData = clientData

	XTcl_DStringInit(tls, bp)
	XTcl_DStringAppend(tls, bp, ts+6357, int32(uint64(unsafe.Sizeof([18]int8{}))-uint64(1)))
	XTcl_DStringAppend(tls, bp, name, -1)

	XTcl_CreateObjCommand(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sOldMathFuncProc})), data, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sOldMathFuncDeleteProc})))
	XTcl_DStringFree(tls, bp)
}

//----------------------------------------------------------------------
//
// OldMathFuncProc --
//
//	Dispatch to a math function created with Tcl_CreateMathFunc
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Whatever the math function does.
//
//----------------------------------------------------------------------

func sOldMathFuncProc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:3576:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var valuePtr uintptr
	var dataPtr uintptr = clientData
	// var funcResult Tcl_Value at bp+8, 32

	var args uintptr
	var result int32
	var j int32
	var k int32
	// var d float64 at bp, 8

	// Check argument count.

	if objc != (*OldMathFuncData)(unsafe.Pointer(dataPtr)).FnumArgs+1 {
		sMathFuncWrongNumArgs(tls, interp, (*OldMathFuncData)(unsafe.Pointer(dataPtr)).FnumArgs+1, objc, objv)
		return TCL_ERROR
	}

	// Convert arguments from Tcl_Obj's to Tcl_Value's.

	args = XTcl_Alloc(tls, uint32(uint64((*OldMathFuncData)(unsafe.Pointer(dataPtr)).FnumArgs)*uint64(unsafe.Sizeof(Tcl_Value{}))))
	j = 1
	k = 0
__1:
	if !(j < objc) {
		goto __3
	}
	{
		// TODO: Convert to TclGetNumberFromObj?
		valuePtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8))
		result = XTcl_GetDoubleFromObj(tls, uintptr(0), valuePtr, bp)
		if result != TCL_OK {
			// We have a non-numeric argument.

			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+7451,
				-1))
			XTclCheckBadOctal(tls, interp, XTcl_GetString(tls, valuePtr))
			XTclpFree(tls, args)
			return TCL_ERROR
		}

		// Copy the object's numeric value to the argument record, converting
		// it if necessary.
		//
		// NOTE: no bignum support; use the new mathfunc interface for that.

		(*Tcl_Value)(unsafe.Pointer(args + uintptr(k)*32)).Ftype = *(*Tcl_ValueType)(unsafe.Pointer((*OldMathFuncData)(unsafe.Pointer(dataPtr)).FargTypes + uintptr(k)*4))
		switch (*Tcl_Value)(unsafe.Pointer(args + uintptr(k)*32)).Ftype {
		case TCL_EITHER:
			if XTcl_GetLongFromObj(tls, uintptr(0), valuePtr, args+uintptr(k)*32+8) ==
				TCL_OK {
				(*Tcl_Value)(unsafe.Pointer(args + uintptr(k)*32)).Ftype = TCL_INT
				break
			}
			if func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
					return func() int32 {
						*(*Tcl_WideInt)(unsafe.Pointer(args + uintptr(k)*32 + 24)) = *(*int64)(unsafe.Pointer(valuePtr + 32))
						return TCL_OK
					}()
				}
				return XTcl_GetWideIntFromObj(tls, interp, valuePtr, args+uintptr(k)*32+24)
			}() ==
				TCL_OK {
				(*Tcl_Value)(unsafe.Pointer(args + uintptr(k)*32)).Ftype = TCL_WIDE_INT
				break
			}
			(*Tcl_Value)(unsafe.Pointer(args + uintptr(k)*32)).Ftype = TCL_DOUBLE
			fallthrough
			// FALLTHROUGH

		case TCL_DOUBLE:
			(*Tcl_Value)(unsafe.Pointer(args + uintptr(k)*32)).FdoubleValue = *(*float64)(unsafe.Pointer(bp /* d */))
			break
		case TCL_INT:
			if sExprIntFunc(tls, uintptr(0), interp, 2, objv+uintptr(j-1)*8) != TCL_OK {
				XTclpFree(tls, args)
				return TCL_ERROR
			}
			valuePtr = XTcl_GetObjResult(tls, interp)
			XTcl_GetLongFromObj(tls, uintptr(0), valuePtr, args+uintptr(k)*32+8)
			XTcl_ResetResult(tls, interp)
			break
		case TCL_WIDE_INT:
			if sExprWideFunc(tls, uintptr(0), interp, 2, objv+uintptr(j-1)*8) != TCL_OK {
				XTclpFree(tls, args)
				return TCL_ERROR
			}
			valuePtr = XTcl_GetObjResult(tls, interp)
			if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
				*(*Tcl_WideInt)(unsafe.Pointer(args + uintptr(k)*32 + 24)) = *(*int64)(unsafe.Pointer(valuePtr + 32))
			} else {
				XTcl_GetWideIntFromObj(tls, uintptr(0), valuePtr, args+uintptr(k)*32+24)
			}
			XTcl_ResetResult(tls, interp)
			break
		}

	}
	goto __2
__2:
	j++
	k++
	goto __1
	goto __3
__3:
	;

	// Call the function.

	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
	result = (*struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*OldMathFuncData)(unsafe.Pointer(dataPtr)).Fproc})).f(tls, (*OldMathFuncData)(unsafe.Pointer(dataPtr)).FclientData, interp, args, bp+8 /* &funcResult */)
	XTclpFree(tls, args)
	if result != TCL_OK {
		return result
	}

	// Return the result of the call.

	if (*Tcl_Value)(unsafe.Pointer(bp+8)).Ftype == TCL_INT {
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					valuePtr = XTclThreadAllocObj(tls)
				} else {
					valuePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(valuePtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = uintptr(0)
			*(*int64)(unsafe.Pointer(valuePtr + 32)) = (*Tcl_Value)(unsafe.Pointer(bp + 8)).FintValue
			(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
			{
			}
		}
	} else if (*Tcl_Value)(unsafe.Pointer(bp+8)).Ftype == TCL_WIDE_INT {
		valuePtr = XTcl_NewWideIntObj(tls, (*Tcl_Value)(unsafe.Pointer(bp+8 /* &funcResult */)).FwideValue)
	} else {
		return sCheckDoubleResult(tls, interp, (*Tcl_Value)(unsafe.Pointer(bp+8 /* &funcResult */)).FdoubleValue)
	}
	XTcl_SetObjResult(tls, interp, valuePtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// OldMathFuncDeleteProc --
//
//	Cleans up after deleting a math function registered with
//	Tcl_CreateMathFunc
//
// Results:
//	None.
//
// Side effects:
//	Frees allocated memory.
//
//----------------------------------------------------------------------

func sOldMathFuncDeleteProc(tls *libc.TLS, clientData ClientData) { /* tclBasic.c:3718:1: */
	var dataPtr uintptr = clientData

	XTclpFree(tls, (*OldMathFuncData)(unsafe.Pointer(dataPtr)).FargTypes)
	XTclpFree(tls, dataPtr)
}

//----------------------------------------------------------------------
//
// Tcl_GetMathFuncInfo --
//
//	Discovers how a particular math function was created in a given
//	interpreter.
//
// Results:
//	TCL_OK if it succeeds, TCL_ERROR else (leaving an error message in the
//	interpreter result if that happens.)
//
// Side effects:
//	If this function succeeds, the variables pointed to by the numArgsPtr
//	and argTypePtr arguments will be updated to detail the arguments
//	allowed by the function. The variable pointed to by the procPtr
//	argument will be set to NULL if the function is a builtin function,
//	and will be set to the address of the C function used to implement the
//	math function otherwise (in which case the variable pointed to by the
//	clientDataPtr argument will also be updated.)
//
//----------------------------------------------------------------------

func XTcl_GetMathFuncInfo(tls *libc.TLS, interp uintptr, name uintptr, numArgsPtr uintptr, argTypesPtr uintptr, procPtr uintptr, clientDataPtr uintptr) int32 { /* tclBasic.c:3752:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var cmdNameObj uintptr
	var cmdPtr uintptr

	// Get the command that implements the math function.

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				cmdNameObj = XTclThreadAllocObj(tls)
			} else {
				cmdNameObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(cmdNameObj + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([16]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([16]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes, ts+7503, uint64(int32(uint64(unsafe.Sizeof([16]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes + 15)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Flength = int32(uint64(unsafe.Sizeof([16]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).FtypePtr = uintptr(0)
		{
		}
	}
	XTcl_AppendToObj(tls, cmdNameObj, name, -1)
	(*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).FrefCount++
	cmdPtr = XTcl_GetCommandFromObj(tls, interp, cmdNameObj)
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = cmdNameObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	// Report unknown functions.

	if cmdPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+7519, libc.VaList(bp, name)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+7546, name, uintptr(0)))
		*(*int32)(unsafe.Pointer(numArgsPtr)) = -1
		*(*uintptr)(unsafe.Pointer(argTypesPtr)) = uintptr(0)
		*(*uintptr)(unsafe.Pointer(procPtr)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(clientDataPtr)) = uintptr(0)
		return TCL_ERROR
	}

	// Retrieve function info for user defined functions; return dummy
	// information for builtins.

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc == *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sOldMathFuncProc})) {
		var dataPtr uintptr = (*Command)(unsafe.Pointer(cmdPtr)).FclientData

		*(*uintptr)(unsafe.Pointer(procPtr)) = (*OldMathFuncData)(unsafe.Pointer(dataPtr)).Fproc
		*(*int32)(unsafe.Pointer(numArgsPtr)) = (*OldMathFuncData)(unsafe.Pointer(dataPtr)).FnumArgs
		*(*uintptr)(unsafe.Pointer(argTypesPtr)) = (*OldMathFuncData)(unsafe.Pointer(dataPtr)).FargTypes
		*(*ClientData)(unsafe.Pointer(clientDataPtr)) = (*OldMathFuncData)(unsafe.Pointer(dataPtr)).FclientData
	} else {
		*(*uintptr)(unsafe.Pointer(procPtr)) = uintptr(0)
		*(*int32)(unsafe.Pointer(numArgsPtr)) = -1
		*(*uintptr)(unsafe.Pointer(argTypesPtr)) = uintptr(0)
		*(*uintptr)(unsafe.Pointer(procPtr)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(clientDataPtr)) = uintptr(0)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ListMathFuncs --
//
//	Produces a list of all the math functions defined in a given
//	interpreter.
//
// Results:
//	A pointer to a Tcl_Obj structure with a reference count of zero, or
//	NULL in the case of an error (in which case a suitable error message
//	will be left in the interpreter result.)
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ListMathFuncs(tls *libc.TLS, interp uintptr, pattern uintptr) uintptr { /* tclBasic.c:3829:9: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var script uintptr = XTcl_NewStringObj(tls, ts+7555, -1)
	var result uintptr
	var state Tcl_InterpState

	if pattern != 0 {
		*(*uintptr)(unsafe.Pointer(bp /* patternObj */)) = XTcl_NewStringObj(tls, pattern, -1)
		var arg uintptr = XTcl_NewListObj(tls, 1, bp)

		XTcl_AppendObjToObj(tls, script, arg)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = arg
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		} // Should tear down patternObj too
	}

	state = XTcl_SaveInterpState(tls, interp, TCL_OK)
	(*Tcl_Obj)(unsafe.Pointer(script)).FrefCount++
	if TCL_OK == XTcl_EvalObjEx(tls, interp, script, 0) {
		result = XTcl_DuplicateObj(tls, XTcl_GetObjResult(tls, interp))
	} else {
		result = XTcl_NewObj(tls)
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = script
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTcl_RestoreInterpState(tls, interp, state)

	return result
}

//----------------------------------------------------------------------
//
// TclInterpReady --
//
//	Check if an interpreter is ready to eval commands or scripts, i.e., if
//	it was not deleted and if the nesting level is not too high.
//
// Results:
//	The return value is TCL_OK if it the interpreter is ready, TCL_ERROR
//	otherwise.
//
// Side effects:
//	The interpreters object and string results are cleared.
//
//----------------------------------------------------------------------

func XTclInterpReady(tls *libc.TLS, interp uintptr) int32 { /* tclBasic.c:3878:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	var iPtr uintptr = interp

	// Reset both the interpreter's string and object results and clear out
	// any previous error information.

	XTcl_ResetResult(tls, interp)

	// If the interpreter has been deleted, return an error.

	if (*Interp)(unsafe.Pointer(iPtr)).Fflags&DELETED != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+7573, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7617,
			ts+7573, uintptr(0)))
		return TCL_ERROR
	}

	if (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr)).Frewind != 0 {
		return TCL_ERROR
	}

	// Make sure the script being evaluated (if any) has not been canceled.

	if ((*Interp)(unsafe.Pointer(iPtr)).Fflags&CANCELED != 0 || (*Interp)(unsafe.Pointer(iPtr)).Fflags&TCL_CANCEL_UNWIND != 0) && TCL_OK != XTcl_Canceled(tls, interp, TCL_LEAVE_ERR_MSG) {
		return TCL_ERROR
	}

	// Check depth of nested calls to Tcl_Eval: if this gets too large, it's
	// probably because of an infinite loop somewhere.

	if (*Interp)(unsafe.Pointer(iPtr)).FnumLevels <= (*Interp)(unsafe.Pointer(iPtr)).FmaxNestingDepth {
		return TCL_OK
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+7625, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+7670, ts+7676, uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclResetCancellation --
//
//	Reset the script cancellation flags if the nesting level
//	(iPtr->numLevels) for the interp is zero or argument force is
//	non-zero.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	The script cancellation flags for the interp may be reset.
//
//----------------------------------------------------------------------

func XTclResetCancellation(tls *libc.TLS, interp uintptr, force int32) int32 { /* tclBasic.c:3949:1: */
	var iPtr uintptr = interp

	if iPtr == uintptr(0) {
		return TCL_ERROR
	}

	if force != 0 || (*Interp)(unsafe.Pointer(iPtr)).FnumLevels == 0 {
		*(*int32)(unsafe.Pointer(iPtr + 424)) &= libc.CplInt32(CANCELED | TCL_CANCEL_UNWIND)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_Canceled --
//
//	Check if the script in progress has been canceled, i.e.,
//	Tcl_CancelEval was called for this interpreter or any of its parent
//	interpreters.
//
// Results:
//	The return value is TCL_OK if the script evaluation has not been
//	canceled, TCL_ERROR otherwise.
//
//	If "flags" contains TCL_LEAVE_ERR_MSG, an error message is returned in
//	the interpreter's result object. Otherwise, the interpreter's result
//	object is left unchanged. If "flags" contains TCL_CANCEL_UNWIND,
//	TCL_ERROR will only be returned if the script evaluation is being
//	completely unwound.
//
// Side effects:
//	The CANCELED flag for the interp will be reset if it is set.
//
//----------------------------------------------------------------------

func XTcl_Canceled(tls *libc.TLS, interp uintptr, flags int32) int32 { /* tclBasic.c:3991:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var iPtr uintptr = interp

	// Has the current script in progress for this interpreter been canceled
	// or is the stack being unwound due to the previous script cancellation?

	if !((*Interp)(unsafe.Pointer(iPtr)).Fflags&CANCELED != 0 || (*Interp)(unsafe.Pointer(iPtr)).Fflags&TCL_CANCEL_UNWIND != 0) {
		return TCL_OK
	}

	// The CANCELED flag is a one-shot flag that is reset immediately upon
	// being detected; however, if the TCL_CANCEL_UNWIND flag is set we will
	// continue to report that the script in progress has been canceled
	// thereby allowing the evaluation stack for the interp to be fully
	// unwound.

	*(*int32)(unsafe.Pointer(iPtr + 424)) &= libc.CplInt32(CANCELED)

	// The CANCELED flag was detected and reset; however, if the caller
	// specified the TCL_CANCEL_UNWIND flag, we only return TCL_ERROR
	// (indicating that the script in progress has been canceled) if the
	// evaluation stack for the interp is being fully unwound.

	if flags&TCL_CANCEL_UNWIND != 0 && !((*Interp)(unsafe.Pointer(iPtr)).Fflags&TCL_CANCEL_UNWIND != 0) {
		return TCL_OK
	}

	// If the TCL_LEAVE_ERR_MSG flags bit is set, place an error in the
	// interp's result; otherwise, we leave it alone.

	if flags&TCL_LEAVE_ERR_MSG != 0 {
		var id uintptr
		var message uintptr = uintptr(0)
		// var length int32 at bp+40, 4

		// Setup errorCode variables so that we can differentiate between
		// being canceled and unwound.

		if (*Interp)(unsafe.Pointer(iPtr)).FasyncCancelMsg != uintptr(0) {
			message = XTcl_GetStringFromObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FasyncCancelMsg, bp+40)
		} else {
			*(*int32)(unsafe.Pointer(bp + 40 /* length */)) = 0
		}

		if (*Interp)(unsafe.Pointer(iPtr)).Fflags&TCL_CANCEL_UNWIND != 0 {
			id = ts + 7682 /* "IUNWIND" */
			if *(*int32)(unsafe.Pointer(bp + 40)) == 0 {
				message = ts + 7690 /* "eval unwound" */
			}
		} else {
			id = ts + 7703 /* "ICANCEL" */
			if *(*int32)(unsafe.Pointer(bp + 40)) == 0 {
				message = ts + 7711 /* "eval canceled" */
			}
		}

		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, message, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7725, id, message, uintptr(0)))
	}

	// Return TCL_ERROR to the caller (not necessarily just the Tcl core
	// itself) that indicates further processing of the script or command in
	// progress should halt gracefully and as soon as possible.

	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_CancelEval --
//
//	This function schedules the cancellation of the current script in the
//	given interpreter.
//
// Results:
//	The return value is a standard Tcl completion code such as TCL_OK or
//	TCL_ERROR. Since the interp may belong to a different thread, no error
//	message can be left in the interp's result.
//
// Side effects:
//	The script in progress in the specified interpreter will be canceled
//	with TCL_ERROR after asynchronous handlers are invoked at the next
//	Tcl_Canceled check.
//
//----------------------------------------------------------------------

func XTcl_CancelEval(tls *libc.TLS, interp uintptr, resultObjPtr uintptr, clientData ClientData, flags int32) int32 { /* tclBasic.c:4094:1: */
	var hPtr uintptr
	var cancelInfo uintptr
	var code int32
	var result uintptr
	var cachePtr uintptr
	code = TCL_ERROR

	if !(interp == uintptr(0)) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&cancelLock)))
	if !(cancelTableInitialized != 1) {
		goto __2
	}
	// No CancelInfo hash table (Tcl_CreateInterp has never been called?)

	goto done
__2:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&cancelTable)))).FfindProc})).f(tls, uintptr(unsafe.Pointer(&cancelTable)), interp)
	if !(hPtr == uintptr(0)) {
		goto __3
	}
	// No CancelInfo record for this interpreter.

	goto done
__3:
	;
	cancelInfo = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

	// Populate information needed by the interpreter thread to fulfill the
	// cancellation request. Currently, clientData is ignored. If the
	// TCL_CANCEL_UNWIND flags bit is set, the script in progress is not
	// allowed to catch the script cancellation because the evaluation stack
	// for the interp is completely unwound.

	if !(resultObjPtr != uintptr(0)) {
		goto __4
	}
	result = XTcl_GetStringFromObj(tls, resultObjPtr, cancelInfo+24)
	(*CancelInfo)(unsafe.Pointer(cancelInfo)).Fresult = XTcl_Realloc(tls, (*CancelInfo)(unsafe.Pointer(cancelInfo)).Fresult, uint32((*CancelInfo)(unsafe.Pointer(cancelInfo)).Flength))
	libc.Xmemcpy(tls, (*CancelInfo)(unsafe.Pointer(cancelInfo)).Fresult, result, uint64((*CancelInfo)(unsafe.Pointer(cancelInfo)).Flength))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(resultObjPtr)).FrefCount, 1) > 1) {
		goto __6
	}
	goto __7
__6:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(resultObjPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultObjPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __8
	}

	if !((*Tcl_Obj)(unsafe.Pointer(resultObjPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(resultObjPtr)).Fbytes != XtclEmptyStringRep) {
		goto __10
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(resultObjPtr)).Fbytes)
__10:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObjPtr)).Flength = -1
__11:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __14
	}
	XTclThreadFreeObj(tls, resultObjPtr)
	goto __15
__14:
	*(*uintptr)(unsafe.Pointer(resultObjPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = resultObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__15:
	;
	goto __12
__12:
	if 0 != 0 {
		goto __11
	}
	goto __13
__13:
	;
	goto __9
__8:
	XTclFreeObj(tls, resultObjPtr)
__9:
	;
__7:
	;
	// Discard their result object.
	goto __5
__4:
	(*CancelInfo)(unsafe.Pointer(cancelInfo)).Fresult = uintptr(0)
	(*CancelInfo)(unsafe.Pointer(cancelInfo)).Flength = 0
__5:
	;
	(*CancelInfo)(unsafe.Pointer(cancelInfo)).FclientData = clientData
	(*CancelInfo)(unsafe.Pointer(cancelInfo)).Fflags = flags
	XTcl_AsyncMark(tls, (*CancelInfo)(unsafe.Pointer(cancelInfo)).Fasync)
	code = TCL_OK

done:
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&cancelLock)))
	return code
}

//----------------------------------------------------------------------
//
// Tcl_InterpActive --
//
//	Returns non-zero if the specified interpreter is in use, i.e. if there
//	is an evaluation currently active in the interpreter.
//
// Results:
//	See above.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_InterpActive(tls *libc.TLS, interp uintptr) int32 { /* tclBasic.c:4177:1: */
	return libc.Bool32((*Interp)(unsafe.Pointer(interp)).FnumLevels > 0)
}

//----------------------------------------------------------------------
//
// Tcl_EvalObjv --
//
//	This function evaluates a Tcl command that has already been parsed
//	into words, with one Tcl_Obj holding each word.
//
// Results:
//	The return value is a standard Tcl completion code such as TCL_OK or
//	TCL_ERROR. A result or error message is left in interp's result.
//
// Side effects:
//	Always pushes a callback. Other side effects depend on the command.
//
//----------------------------------------------------------------------

func XTcl_EvalObjv(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, flags int32) int32 { /* tclBasic.c:4202:1: */
	var result int32
	var rootPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr

	result = XTclNREvalObjv(tls, interp, objc, objv, flags, uintptr(0))
	return XTclNRRunCallbacks(tls, interp, result, rootPtr)
}

func XTclNREvalObjv(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, flags int32, cmdPtr uintptr) int32 { /* tclBasic.c:4221:1: */
	var iPtr uintptr = interp

	// data[1] stores a marker for use by tailcalls; it will be set to 1 by
	// command redirectors (imports, alias, ensembles) so that tailcall skips
	// this callback (that marks the end of the target command) and goes back
	// to the end of the source command.

	if (*Interp)(unsafe.Pointer(iPtr)).FdeferredCallbacks != 0 {
		(*Interp)(unsafe.Pointer(iPtr)).FdeferredCallbacks = uintptr(0)
	} else {
		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sNRCommand}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	}

	(*Interp)(unsafe.Pointer(iPtr)).FnumLevels++
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _callbackPtr uintptr
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sEvalObjvCore}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = cmdPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(Intptr_t(flags))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(Intptr_t(objc))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = objv
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return TCL_OK
}

func sEvalObjvCore(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:4257:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	// var cmdPtr uintptr at bp+32, 8

	var preCmdPtr uintptr
	var flags int32
	var objc int32
	var objv uintptr
	var iPtr uintptr
	var lookupNsPtr uintptr
	var enterTracesDone int32
	var _objPtr uintptr
	var _objPtr1 uintptr
	var code int32
	var cachePtr uintptr
	var _objPtr2 uintptr
	var _callbackPtr uintptr
	var commandPtr uintptr
	var cachePtr1 uintptr
	var _objPtr3 uintptr
	var _callbackPtr1 uintptr
	*(*uintptr)(unsafe.Pointer(bp + 32 /* cmdPtr */)) = uintptr(0)
	preCmdPtr = *(*ClientData)(unsafe.Pointer(data))
	flags = int32(*(*ClientData)(unsafe.Pointer(data + 1*8)))
	objc = int32(*(*ClientData)(unsafe.Pointer(data + 2*8)))
	objv = *(*ClientData)(unsafe.Pointer(data + 3*8))
	iPtr = interp
	lookupNsPtr = uintptr(0)
	enterTracesDone = 0

	// Push records for task to be done on return, in INVERSE order. First, if
	// needed, the exception handlers (as they should happen last).

	if !!(flags&TCL_EVAL_NOERR != 0) {
		goto __1
	}
	sTEOV_PushExceptionHandlers(tls, interp, objc, objv, flags)
__1:
	;

	if !(TCL_OK != XTclInterpReady(tls, interp)) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	if !(objc == 0) {
		goto __3
	}
	return TCL_OK
__3:
	;

	if !((*Interp)(unsafe.Pointer(iPtr)).Flimit.Fexceeded != 0) {
		goto __4
	}
	return TCL_ERROR
__4:
	;

	// Configure evaluation context to match the requested flags.

	if !((*Interp)(unsafe.Pointer(iPtr)).FlookupNsPtr != 0) {
		goto __5
	}

	// Capture the namespace we should do command name resolution in, as
	// instructed by our caller sneaking it in to us in a private interp
	// field.  Clear that field right away so we cannot possibly have its
	// use leak where it should not.  The sneaky message pass is done.
	//
	// Use of this mechanism overrides the TCL_EVAL_GLOBAL flag.
	// TODO: Is that a bug?

	lookupNsPtr = (*Interp)(unsafe.Pointer(iPtr)).FlookupNsPtr
	(*Interp)(unsafe.Pointer(iPtr)).FlookupNsPtr = uintptr(0)
	goto __6
__5:
	if !(flags&TCL_EVAL_INVOKE != 0) {
		goto __7
	}
	lookupNsPtr = (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr
	goto __8
__7:

	// TCL_EVAL_INVOKE was not set: clear rewrite rules

	XTclResetRewriteEnsemble(tls, interp, 1)

	if !(flags&TCL_EVAL_GLOBAL != 0) {
		goto __9
	}
	sTEOV_SwitchVarFrame(tls, interp)
	lookupNsPtr = (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr
__9:
	;
__8:
	;
__6:
	;

	// Lookup the Command to dispatch.

reresolve:
	;
	if !(preCmdPtr != 0) {
		goto __10
	}
	// Caller gave it to us.

	if !!((*Command)(unsafe.Pointer(preCmdPtr)).Fflags&CMD_DEAD != 0) {
		goto __11
	}
	// So long as it exists, use it.

	*(*uintptr)(unsafe.Pointer(bp + 32 /* cmdPtr */)) = preCmdPtr
	goto __12
__11:
	if !(flags&TCL_EVAL_NORESOLVE != 0) {
		goto __13
	}
	// When it's been deleted, and we're told not to attempt resolving
	// it ourselves, all we can do is raise an error.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+7732, 0))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7768, ts+7773, uintptr(0)))
	return TCL_ERROR
__13:
	;
__12:
	;
__10:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0)) {
		goto __14
	}
	*(*uintptr)(unsafe.Pointer(bp + 32 /* cmdPtr */)) = sTEOV_LookupCmdFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), lookupNsPtr)
	if !!(*(*uintptr)(unsafe.Pointer(bp + 32)) != 0) {
		goto __15
	}
	return sTEOV_NotFound(tls, interp, objc, objv, lookupNsPtr)
__15:
	;
__14:
	;

	if !(enterTracesDone != 0 || (*Interp)(unsafe.Pointer(iPtr)).FtracePtr != 0 ||
		(*Command)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).Fflags&CMD_HAS_EXEC_TRACES != 0) {
		goto __16
	}
	commandPtr = XTclGetSourceFromFrame(tls,
		func() uintptr {
			if flags&TCL_EVAL_SOURCE_IN_FRAME != 0 {
				return (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr
			}
			return uintptr(0)
		}(),
		objc, objv)

	(*Tcl_Obj)(unsafe.Pointer(commandPtr)).FrefCount++
	if !!(enterTracesDone != 0) {
		goto __17
	}
	code = sTEOV_RunEnterTraces(tls, interp, bp+32, commandPtr,
		objc, objv)

	// Send any exception from enter traces back as an exception
	// raised by the traced command.
	// TODO: Is this a bug?  Letting an execution trace BREAK or
	// CONTINUE or RETURN in the place of the traced command?  Would
	// either converting all exceptions to TCL_ERROR, or just
	// swallowing them be better?  (Swallowing them has the problem of
	// permanently hiding program errors.)

	if !(code != TCL_OK) {
		goto __18
	}
__19:
	_objPtr = commandPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __22
	}
	XTclFreeObj(tls, _objPtr)
__22:
	;
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
	return code
__18:
	;

	// If the enter traces made the resolved cmdPtr unusable, go back
	// and resolve again, but next time don't run enter traces again.

	if !(*(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0)) {
		goto __23
	}
	enterTracesDone = 1
__24:
	_objPtr1 = commandPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __27
	}
	XTclFreeObj(tls, _objPtr1)
__27:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
	goto reresolve
__23:
	;
__17:
	;

	// Schedule leave traces.  Raise the refCount on the resolved cmdPtr,
	// so that when it passes to the leave traces we know it's still
	// valid.

	(*Command)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* cmdPtr */)))).FrefCount++
__28:
__31:
	;
__34:
	if !(interp == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __37
	}
	_objPtr2 = XTclThreadAllocObj(tls)
	goto __38
__37:
	_objPtr2 = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr2 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__38:
	;
	goto __35
__35:
	if 0 != 0 {
		goto __34
	}
	goto __36
__36:
	;
	_callbackPtr = _objPtr2
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTEOV_RunLeaveTraces}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(Intptr_t(objc))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = commandPtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = *(*uintptr)(unsafe.Pointer(bp + 32))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = objv
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
__16:
	;

__39:
__42:
	;
__45:
	if !(interp == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __48
	}
	_objPtr3 = XTclThreadAllocObj(tls)
	goto __49
__48:
	_objPtr3 = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr3 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__49:
	;
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
	_callbackPtr1 = _objPtr3
	goto __43
__43:
	if 0 != 0 {
		goto __42
	}
	goto __44
__44:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr1)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sDispatch}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8)) = func() uintptr {
		if (*Command)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FnreProc != 0 {
			return (*Command)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FnreProc
		}
		return (*Command)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FobjProc
	}()
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8 + 1*8)) = (*Command)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FobjClientData
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8 + 2*8)) = uintptr(Intptr_t(objc))
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8 + 3*8)) = objv
	(*NRE_callback)(unsafe.Pointer(_callbackPtr1)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr1
	goto __40
__40:
	if 0 != 0 {
		goto __39
	}
	goto __41
__41:
	;
	return TCL_OK
}

func sDispatch(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:4417:1: */
	var objProc uintptr = *(*ClientData)(unsafe.Pointer(data))
	var clientData ClientData = *(*ClientData)(unsafe.Pointer(data + 1*8))
	var objc int32 = int32(*(*ClientData)(unsafe.Pointer(data + 2*8)))
	var objv uintptr = *(*ClientData)(unsafe.Pointer(data + 3*8))
	var iPtr uintptr = interp

	(*Interp)(unsafe.Pointer(iPtr)).FcmdCount++
	return (*struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{objProc})).f(tls, clientData, interp, objc, objv)
}

func XTclNRRunCallbacks(tls *libc.TLS, interp uintptr, result int32, rootPtr uintptr) int32 { /* tclBasic.c:4462:1: */
	var iPtr uintptr = interp

	// If the interpreter has a non-empty string result, the result object is
	// either empty or stale because some function set interp->result
	// directly. If so, move the string result to the result object, then
	// reset the string result.
	//
	// This only needs to be done for the first item in the list: all other
	// are for NR function calls, and those are Tcl_Obj based.

	if int32(*(*int8)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).Fresult))) != 0 {
		XTcl_GetObjResult(tls, interp)
	}

	// This is the trampoline.

	for (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr != rootPtr {
		var callbackPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		var procPtr uintptr = (*NRE_callback)(unsafe.Pointer(callbackPtr)).FprocPtr

		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = (*NRE_callback)(unsafe.Pointer(callbackPtr)).FnextPtr
		result = (*struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		})(unsafe.Pointer(&struct{ uintptr }{procPtr})).f(tls, callbackPtr+8 /* &.data */, interp, result)
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, callbackPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(callbackPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = callbackPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		}
	}
	return result
}

func sNRCommand(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:4501:1: */
	var iPtr uintptr = interp

	(*Interp)(unsafe.Pointer(iPtr)).FnumLevels--

	// If there is a tailcall, schedule it next

	if *(*ClientData)(unsafe.Pointer(data + 1*8)) != 0 && *(*ClientData)(unsafe.Pointer(data + 1*8)) != uintptr(int64(1)) {
		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{XTclNRTailcallEval}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = *(*ClientData)(unsafe.Pointer(data + 1*8))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	}

	// OPT ??
	// Do not interrupt a series of cleanups with async or limit checks:
	// just check at the end?

	if *(*int32)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FasyncReadyPtr)) != 0 {
		result = XTcl_AsyncInvoke(tls, interp, result)
	}
	if result == TCL_OK && ((*Interp)(unsafe.Pointer(iPtr)).Fflags&CANCELED != 0 || (*Interp)(unsafe.Pointer(iPtr)).Fflags&TCL_CANCEL_UNWIND != 0) {
		result = XTcl_Canceled(tls, interp, TCL_LEAVE_ERR_MSG)
	}
	if result == TCL_OK && func() int32 {
		if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Factive == 0 {
			return 0
		}
		return func() int32 {
			(*Interp)(unsafe.Pointer(iPtr)).Flimit.FgranularityTicker++
			return func() int32 {
				if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Factive&TCL_LIMIT_COMMANDS != 0 && ((*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdGranularity == 1 || (*Interp)(unsafe.Pointer(iPtr)).Flimit.FgranularityTicker%(*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdGranularity == 0) {
					return 1
				}
				return func() int32 {
					if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Factive&TCL_LIMIT_TIME != 0 && ((*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeGranularity == 1 || (*Interp)(unsafe.Pointer(iPtr)).Flimit.FgranularityTicker%(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeGranularity == 0) {
						return 1
					}
					return 0
				}()
			}()
		}()
	}() != 0 {
		result = XTcl_LimitCheck(tls, interp)
	}

	return result
}

//----------------------------------------------------------------------
//
// TEOV_Exception	 -
// TEOV_LookupCmdFromObj -
// TEOV_RunEnterTraces	 -
// TEOV_RunLeaveTraces	 -
// TEOV_NotFound	 -
//
//	These are helper functions for Tcl_EvalObjv.
//
//----------------------------------------------------------------------

func sTEOV_PushExceptionHandlers(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, flags int32) { /* tclBasic.c:4551:1: */
	var iPtr uintptr = interp

	// If any error processing is necessary, push the appropriate records.
	// Note that we have to push them in the inverse order: first the one that
	// has to run last.

	if !(flags&TCL_EVAL_INVOKE != 0) {
		// Error messages

		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sTEOV_Error}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(Intptr_t(objc))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = objv
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	}

	if (*Interp)(unsafe.Pointer(iPtr)).FnumLevels == 1 {
		// No CONTINUE or BREAK at level 0, manage RETURN

		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _callbackPtr uintptr
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sTEOV_Exception}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(Intptr_t((*Interp)(unsafe.Pointer(iPtr)).FevalFlags))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	}
}

func sTEOV_SwitchVarFrame(tls *libc.TLS, interp uintptr) { /* tclBasic.c:4585:1: */
	var iPtr uintptr = interp

	// Change the varFrame to be the rootVarFrame, and push a record to
	// restore things at the end.

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sTEOV_RestoreVarFrame}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = (*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr
}

func sTEOV_RestoreVarFrame(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:4601:1: */
	(*Interp)(unsafe.Pointer(interp)).FvarFramePtr = *(*ClientData)(unsafe.Pointer(data))
	return result
}

func sTEOV_Exception(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:4611:1: */
	var iPtr uintptr = interp
	var allowExceptions int32 = int32(*(*ClientData)(unsafe.Pointer(data))) & TCL_ALLOW_EXCEPTIONS

	if result != TCL_OK {
		if result == TCL_RETURN {
			result = XTclUpdateReturnInfo(tls, iPtr)
		}
		if result != TCL_OK && result != TCL_ERROR && !(allowExceptions != 0) {
			sProcessUnexpectedResult(tls, interp, result)
			result = TCL_ERROR
		}
	}

	// We are returning to level 0, so should process TclResetCancellation. As
	// numLevels has not *yet* been decreased, do not call it: do the thing
	// here directly.

	*(*int32)(unsafe.Pointer(iPtr + 424)) &= libc.CplInt32(CANCELED | TCL_CANCEL_UNWIND)
	return result
}

func sTEOV_Error(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:4640:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp
	var listPtr uintptr
	var cmdString uintptr
	// var cmdLen int32 at bp, 4

	var objc int32 = int32(*(*ClientData)(unsafe.Pointer(data)))
	var objv uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))

	if result == TCL_ERROR && !((*Interp)(unsafe.Pointer(iPtr)).Fflags&ERR_ALREADY_LOGGED != 0) {
		// If there was an error, a command string will be needed for the
		// error log: get it out of the itemPtr. The details depend on the
		// type.

		listPtr = XTcl_NewListObj(tls, objc, objv)
		cmdString = XTcl_GetStringFromObj(tls, listPtr, bp)
		XTcl_LogCommandInfo(tls, interp, cmdString, cmdString, *(*int32)(unsafe.Pointer(bp /* cmdLen */)))
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = listPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	*(*int32)(unsafe.Pointer(iPtr + 424)) &= libc.CplInt32(ERR_ALREADY_LOGGED)
	return result
}

func sTEOV_NotFound(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, lookupNsPtr uintptr) int32 { /* tclBasic.c:4669:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	var cmdPtr uintptr
	var iPtr uintptr = interp
	var i int32
	var newObjc int32
	// var handlerObjc int32 at bp+48, 4

	var newObjv uintptr
	// var handlerObjv uintptr at bp+56, 8

	var varFramePtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	var currNsPtr uintptr = uintptr(0) // Used to check for and invoke any registered
	// unknown command handler for the current
	// namespace (TIP 181).
	var savedNsPtr uintptr = uintptr(0)

	currNsPtr = (*CallFrame)(unsafe.Pointer(varFramePtr)).FnsPtr
	if currNsPtr == uintptr(0) || (*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr == uintptr(0) {
		currNsPtr = (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr
		if currNsPtr == uintptr(0) {
			XTcl_Panic(tls, ts+7788, 0)
		}
	}

	// Check to see if the resolution namespace has lost its unknown handler.
	// If so, reset it to "::unknown".

	if (*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr == uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					(*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr = XTclThreadAllocObj(tls)
				} else {
					(*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes, ts+7832, uint64(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes + 9)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Flength = int32(uint64(unsafe.Sizeof([10]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).FtypePtr = uintptr(0)
			{
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).FrefCount++
	}

	// Get the list of words for the unknown handler and allocate enough space
	// to hold both the handler prefix and all words of the command invokation
	// itself.

	XTcl_ListObjGetElements(tls, uintptr(0), (*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr,
		bp+48, bp+56)
	newObjc = objc + *(*int32)(unsafe.Pointer(bp + 48))
	newObjv = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(uintptr(0)))*newObjc)

	// Copy command prefix from unknown handler and add on the real command's
	// full argument list. Note that we only use memcpy() once because we have
	// to increment the reference count of all the handler arguments anyway.

	for i = 0; i < *(*int32)(unsafe.Pointer(bp + 48 /* handlerObjc */)); i++ {
		*(*uintptr)(unsafe.Pointer(newObjv + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* handlerObjv */)) + uintptr(i)*8))
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(newObjv + uintptr(i)*8)))).FrefCount++
	}
	libc.Xmemcpy(tls, newObjv+uintptr(*(*int32)(unsafe.Pointer(bp + 48)))*8, objv, uint64(unsafe.Sizeof(uintptr(0)))*uint64(objc))

	// Look up and invoke the handler (by recursive call to this function). If
	// there is no handler at all, instead of doing the recursive call we just
	// generate a generic error message; it would be an infinite-recursion
	// nightmare otherwise.
	//
	// In this case we worry a bit less about recursion for now, and call the
	// "blocking" interface.

	cmdPtr = sTEOV_LookupCmdFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(newObjv)), lookupNsPtr)
	if cmdPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+7842, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+7328,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
			}(), uintptr(0)))

		// Release any resources we locked and allocated during the handler
		// call.

		for i = 0; i < *(*int32)(unsafe.Pointer(bp + 48 /* handlerObjc */)); i++ {
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(newObjv + uintptr(i)*8))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		XTclStackFree(tls, interp, newObjv)
		return TCL_ERROR
	}

	if lookupNsPtr != 0 {
		savedNsPtr = (*CallFrame)(unsafe.Pointer(varFramePtr)).FnsPtr
		(*CallFrame)(unsafe.Pointer(varFramePtr)).FnsPtr = lookupNsPtr
	}
	XTclSkipTailcall(tls, interp)
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _callbackPtr uintptr
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sTEOV_NotFoundCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(Intptr_t(*(*int32)(unsafe.Pointer(bp + 48))))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = newObjv
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = savedNsPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return XTclNREvalObjv(tls, interp, newObjc, newObjv, TCL_EVAL_NOERR, uintptr(0))
}

func sTEOV_NotFoundCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:4766:1: */
	var iPtr uintptr = interp
	var objc int32 = int32(*(*ClientData)(unsafe.Pointer(data)))
	var objv uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))
	var savedNsPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))
	var i int32

	if savedNsPtr != 0 {
		(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr = savedNsPtr
	}

	// Release any resources we locked and allocated during the handler call.

	for i = 0; i < objc; i++ {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	XTclStackFree(tls, interp, objv)

	return result
}

func sTEOV_RunEnterTraces(tls *libc.TLS, interp uintptr, cmdPtrPtr uintptr, commandPtr uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:4795:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp
	var cmdPtr uintptr = *(*uintptr)(unsafe.Pointer(cmdPtrPtr))
	var newEpoch int32
	var cmdEpoch int32 = (*Command)(unsafe.Pointer(cmdPtr)).FcmdEpoch
	// var length int32 at bp, 4

	var traceCode int32 = TCL_OK
	var command uintptr = XTcl_GetStringFromObj(tls, commandPtr, bp)

	// Call trace functions.
	// Execute any command or execution traces. Note that we bump up the
	// command's reference count for the duration of the calling of the
	// traces so that the structure doesn't go away underneath our feet.

	(*Command)(unsafe.Pointer(cmdPtr)).FrefCount++
	if (*Interp)(unsafe.Pointer(iPtr)).FtracePtr != 0 {
		traceCode = XTclCheckInterpTraces(tls, interp, command, *(*int32)(unsafe.Pointer(bp /* length */)),
			cmdPtr, TCL_OK, TCL_TRACE_ENTER_EXEC, objc, objv)
	}
	if (*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_HAS_EXEC_TRACES != 0 && traceCode == TCL_OK {
		traceCode = XTclCheckExecutionTraces(tls, interp, command, *(*int32)(unsafe.Pointer(bp /* length */)),
			cmdPtr, TCL_OK, TCL_TRACE_ENTER_EXEC, objc, objv)
	}
	newEpoch = (*Command)(unsafe.Pointer(cmdPtr)).FcmdEpoch
	if libc.PostDecInt32(&(*Command)(unsafe.Pointer(cmdPtr)).FrefCount, 1) <= 1 {
		XTclpFree(tls, cmdPtr)
	}

	if traceCode != TCL_OK {
		if traceCode == TCL_ERROR {
			var info uintptr

			for ok := true; ok; ok = 0 != 0 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						info = XTclThreadAllocObj(tls)
					} else {
						info = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(info + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(info)).FrefCount = 0
				if int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1)) == 0 {
					(*Tcl_Obj)(unsafe.Pointer(info)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(info)).Flength = 0
				} else {
					(*Tcl_Obj)(unsafe.Pointer(info)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1))+1))
					libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(info)).Fbytes, ts+7868, uint64(int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1))))
					*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(info)).Fbytes + 22)) = int8(0)
					(*Tcl_Obj)(unsafe.Pointer(info)).Flength = int32(uint64(unsafe.Sizeof([23]int8{})) - uint64(1))
				}
				(*Tcl_Obj)(unsafe.Pointer(info)).FtypePtr = uintptr(0)
				{
				}
			}
			XTcl_AppendLimitedToObj(tls, info, command, *(*int32)(unsafe.Pointer(bp /* length */)), 55, ts+7891)
			XTcl_AppendToObj(tls, info, ts+7895, 2)
			XTcl_AppendObjToErrorInfo(tls, interp, info)
			*(*int32)(unsafe.Pointer(iPtr + 424)) |= ERR_ALREADY_LOGGED
		}
		return traceCode
	}
	if cmdEpoch != newEpoch {
		*(*uintptr)(unsafe.Pointer(cmdPtrPtr)) = uintptr(0)
	}
	return TCL_OK
}

func sTEOV_RunLeaveTraces(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:4846:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp
	var traceCode int32 = TCL_OK
	var objc int32 = int32(*(*ClientData)(unsafe.Pointer(data)))
	var commandPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))
	var cmdPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))
	var objv uintptr = *(*ClientData)(unsafe.Pointer(data + 3*8))
	// var length int32 at bp, 4

	var command uintptr = XTcl_GetStringFromObj(tls, commandPtr, bp)

	if !((*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_IS_DELETED != 0) {
		if (*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_HAS_EXEC_TRACES != 0 {
			traceCode = XTclCheckExecutionTraces(tls, interp, command, *(*int32)(unsafe.Pointer(bp /* length */)),
				cmdPtr, result, TCL_TRACE_LEAVE_EXEC, objc, objv)
		}
		if (*Interp)(unsafe.Pointer(iPtr)).FtracePtr != uintptr(0) && traceCode == TCL_OK {
			traceCode = XTclCheckInterpTraces(tls, interp, command, *(*int32)(unsafe.Pointer(bp /* length */)),
				cmdPtr, result, TCL_TRACE_LEAVE_EXEC, objc, objv)
		}
	}

	// As cmdPtr is set, TclNRRunCallbacks is about to reduce the numlevels.
	// Prevent that by resetting the cmdPtr field and dealing right here with
	// cmdPtr->refCount.

	if libc.PostDecInt32(&(*Command)(unsafe.Pointer(cmdPtr)).FrefCount, 1) <= 1 {
		XTclpFree(tls, cmdPtr)
	}

	if traceCode != TCL_OK {
		if traceCode == TCL_ERROR {
			var info uintptr

			for ok := true; ok; ok = 0 != 0 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						info = XTclThreadAllocObj(tls)
					} else {
						info = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(info + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(info)).FrefCount = 0
				if int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1)) == 0 {
					(*Tcl_Obj)(unsafe.Pointer(info)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(info)).Flength = 0
				} else {
					(*Tcl_Obj)(unsafe.Pointer(info)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1))+1))
					libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(info)).Fbytes, ts+7898, uint64(int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1))))
					*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(info)).Fbytes + 22)) = int8(0)
					(*Tcl_Obj)(unsafe.Pointer(info)).Flength = int32(uint64(unsafe.Sizeof([23]int8{})) - uint64(1))
				}
				(*Tcl_Obj)(unsafe.Pointer(info)).FtypePtr = uintptr(0)
				{
				}
			}
			XTcl_AppendLimitedToObj(tls, info, command, *(*int32)(unsafe.Pointer(bp /* length */)), 55, ts+7891)
			XTcl_AppendToObj(tls, info, ts+7895, 2)
			XTcl_AppendObjToErrorInfo(tls, interp, info)
			*(*int32)(unsafe.Pointer(iPtr + 424)) |= ERR_ALREADY_LOGGED
		}
		result = traceCode
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = commandPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return result
}

func sTEOV_LookupCmdFromObj(tls *libc.TLS, interp uintptr, namePtr uintptr, lookupNsPtr uintptr) uintptr { /* tclBasic.c:4895:23: */
	var iPtr uintptr = interp
	var cmdPtr uintptr
	var savedNsPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr

	if lookupNsPtr != 0 {
		(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr = lookupNsPtr
	}
	cmdPtr = XTcl_GetCommandFromObj(tls, interp, namePtr)
	(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr = savedNsPtr
	return cmdPtr
}

//----------------------------------------------------------------------
//
// Tcl_EvalTokensStandard --
//
//	Given an array of tokens parsed from a Tcl command (e.g., the tokens
//	that make up a word or the index for an array variable) this function
//	evaluates the tokens and concatenates their values to form a single
//	result value.
//
// Results:
//	The return value is a standard Tcl completion code such as TCL_OK or
//	TCL_ERROR. A result or error message is left in interp's result.
//
// Side effects:
//	Depends on the array of tokens being evaled.
//
//----------------------------------------------------------------------

func XTcl_EvalTokensStandard(tls *libc.TLS, interp uintptr, tokenPtr uintptr, count int32) int32 { /* tclBasic.c:4934:1: */
	return XTclSubstTokens(tls, interp, tokenPtr, count /* numLeftPtr */, uintptr(0), 1,
		uintptr(0), uintptr(0))
}

//----------------------------------------------------------------------
//
// Tcl_EvalTokens --
//
//	Given an array of tokens parsed from a Tcl command (e.g., the tokens
//	that make up a word or the index for an array variable) this function
//	evaluates the tokens and concatenates their values to form a single
//	result value.
//
// Results:
//	The return value is a pointer to a newly allocated Tcl_Obj containing
//	the value of the array of tokens. The reference count of the returned
//	object has been incremented. If an error occurs in evaluating the
//	tokens then a NULL value is returned and an error message is left in
//	interp's result.
//
// Side effects:
//	A new object is allocated to hold the result.
//
//----------------------------------------------------------------------
//
// This uses a non-standard return convention; its use is now deprecated. It
// is a wrapper for the new function Tcl_EvalTokensStandard, and is not used
// in the core any longer. It is only kept for backward compatibility.

func XTcl_EvalTokens(tls *libc.TLS, interp uintptr, tokenPtr uintptr, count int32) uintptr { /* tclBasic.c:4974:9: */
	var resPtr uintptr

	if XTcl_EvalTokensStandard(tls, interp, tokenPtr, count) != TCL_OK {
		return uintptr(0)
	}
	resPtr = XTcl_GetObjResult(tls, interp)
	(*Tcl_Obj)(unsafe.Pointer(resPtr)).FrefCount++
	XTcl_ResetResult(tls, interp)
	return resPtr
}

//----------------------------------------------------------------------
//
// Tcl_EvalEx, TclEvalEx --
//
//	This function evaluates a Tcl script without using the compiler or
//	byte-code interpreter. It just parses the script, creates values for
//	each word of each command, then calls EvalObjv to execute each
//	command.
//
// Results:
//	The return value is a standard Tcl completion code such as TCL_OK or
//	TCL_ERROR. A result or error message is left in interp's result.
//
// Side effects:
//	Depends on the script.
//
// TIP #280 : Keep public API, internally extended API.
//----------------------------------------------------------------------

func XTcl_EvalEx(tls *libc.TLS, interp uintptr, script uintptr, numBytes int32, flags int32) int32 { /* tclBasic.c:5017:1: */
	return XTclEvalEx(tls, interp, script, numBytes, flags, 1, uintptr(0), script)
}

func XTclEvalEx(tls *libc.TLS, interp uintptr, script uintptr, numBytes int32, flags int32, line int32, clNextOuter uintptr, outerScript uintptr) int32 { /* tclBasic.c:5032:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)
	*(*int32)(unsafe.Pointer(bp + 8)) = line

	var iPtr uintptr
	var p uintptr
	var next uintptr
	var minObjs uint32
	var objv uintptr
	var objvSpace uintptr
	var expand uintptr
	var lines uintptr
	var lineSpace uintptr
	var tokenPtr uintptr
	var commandLength int32
	var bytesLeft int32
	var expandRequested int32
	var code int32
	var savedVarFramePtr uintptr // Saves old copy of iPtr->varFramePtr in case
	// TCL_EVAL_GLOBAL was set.
	var allowExceptions int32
	var gotParse int32
	var i uint32
	var objectsUsed uint32
	// These variables keep track of how much
	// state has been allocated while evaluating
	// the script, so that it can be freed
	// properly if an error occurs.
	var parsePtr uintptr
	var eeFramePtr uintptr
	var stackObjArray uintptr
	var expandStack uintptr
	var linesStack uintptr
	// TIP #280 Structures for tracking of command
	// locations.
	// var clNext uintptr at bp+16, 8

	// Normalization here, to have the correct pwd. Should have
	// negligible impact on performance, as the norm should have been
	// done already by the 'source' invoking us, and it caches the
	// result.

	var norm uintptr
	var cachePtr uintptr
	var _objPtr uintptr
	// var numElements int32 at bp+40, 4

	var _objPtr1 uintptr
	// var numElements1 int32 at bp+44, 4

	// var elements uintptr at bp+48, 8

	var temp uintptr
	// Some word expansion was requested. Check for objv resize.

	var copy uintptr
	var lcopy uintptr
	var wordIdx int32
	var objIdx int32
	var _objPtr2 uintptr
	var _objPtr3 uintptr
	// TIP #280. Track lines within the words of the current
	// command. We use a separate pointer into the table of
	// continuation line locations to not lose our position for the
	// per-command parsing.

	// var wordLine int32 at bp+24, 4

	var wordStart uintptr
	// var wordCLNext uintptr at bp+32, 8

	var objectsNeeded uint32
	var numWords uint32
	var _objPtr4 uintptr
	var _objPtr5 uintptr
	iPtr = interp
	minObjs = uint32(20)
	code = TCL_OK
	allowExceptions = (*Interp)(unsafe.Pointer(iPtr)).FevalFlags & TCL_ALLOW_EXCEPTIONS
	gotParse = 0
	objectsUsed = uint32(0)
	parsePtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(Tcl_Parse{})))
	eeFramePtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(CmdFrame{})))
	stackObjArray =
		XTclStackAlloc(tls, interp, int32(uint64(minObjs)*uint64(unsafe.Sizeof(uintptr(0)))))
	expandStack = XTclStackAlloc(tls, interp, int32(uint64(minObjs)*uint64(unsafe.Sizeof(int32(0)))))
	linesStack = XTclStackAlloc(tls, interp, int32(uint64(minObjs)*uint64(unsafe.Sizeof(int32(0)))))
	*(*uintptr)(unsafe.Pointer(bp + 16 /* clNext */)) = uintptr(0) // Pointer for the tracking of invisible
	// continuation lines. Initialized only if the
	// caller gave us a table of locations to
	// track, via scriptCLLocPtr. It always refers
	// to the table entry holding the location of
	// the next invisible continuation line to
	// look for, while parsing the script.

	if !((*Interp)(unsafe.Pointer(iPtr)).FscriptCLLocPtr != 0) {
		goto __1
	}
	if !(clNextOuter != 0) {
		goto __2
	}
	*(*uintptr)(unsafe.Pointer(bp + 16 /* clNext */)) = clNextOuter
	goto __3
__2:
	*(*uintptr)(unsafe.Pointer(bp + 16 /* clNext */)) = (*Interp)(unsafe.Pointer(iPtr)).FscriptCLLocPtr + 4
__3:
	;
__1:
	;

	if !(numBytes < 0) {
		goto __4
	}
	numBytes = int32(libc.Xstrlen(tls, script))
__4:
	;
	XTcl_ResetResult(tls, interp)

	savedVarFramePtr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	if !(flags&TCL_EVAL_GLOBAL != 0) {
		goto __5
	}
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = (*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr
__5:
	;

	// Each iteration through the following loop parses the next command from
	// the script and then executes it.

	objv = libc.AssignUintptr(&objvSpace, stackObjArray)
	lines = libc.AssignUintptr(&lineSpace, linesStack)
	expand = expandStack
	p = script
	bytesLeft = numBytes

	// TIP #280 Initialize tracking. Do not push on the frame stack yet.
	//
	// We open a new context, either for a sourced script, or 'eval'.
	// For sourced files we always have a path object, even if nothing was
	// specified in the interp itself. That makes code using it simpler as
	// NULL checks can be left out. Sourced file without path in the
	// 'scriptFile' is possible during Tcl initialization.

	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Flevel = func() int32 {
		if (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr != 0 {
			return (*CmdFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr)).Flevel + 1
		}
		return 1
	}()
	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).FframePtr = (*Interp)(unsafe.Pointer(iPtr)).FframePtr
	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).FnextPtr = (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr
	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Fnline = 0
	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Fline = uintptr(0)
	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).FcmdObj = uintptr(0)

	(*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr = eeFramePtr
	if !((*Interp)(unsafe.Pointer(iPtr)).FevalFlags&TCL_EVAL_FILE != 0) {
		goto __6
	}
	// Set up for a sourced file.

	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Ftype = 4

	if !((*Interp)(unsafe.Pointer(iPtr)).FscriptFile != 0) {
		goto __8
	}
	// Normalization here, to have the correct pwd. Should have
	// negligible impact on performance, as the norm should have been
	// done already by the 'source' invoking us, and it caches the
	// result.

	norm = XTcl_FSGetNormalizedPath(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FscriptFile)

	if !(norm == uintptr(0)) {
		goto __10
	}
	// Error message in the interp result.

	code = TCL_ERROR
	goto error
__10:
	;
	*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)) = norm
	goto __9
__8:
__11:
	;
__14:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __17
	}
	*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)) = XTclThreadAllocObj(tls)
	goto __18
__17:
	*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__18:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)))).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)) == 0) {
		goto __19
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)))).Flength = 0
	goto __20
__19:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)))).Fbytes, ts+2046, uint64(int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)))).Fbytes)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)))).Flength = int32(uint64(unsafe.Sizeof([1]int8{})) - uint64(1))
__20:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)))).FtypePtr = uintptr(0)

	goto __12
__12:
	if 0 != 0 {
		goto __11
	}
	goto __13
__13:
	;
__9:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)))).FrefCount++
	goto __7
__6:
	// Set up for plain eval.

	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Ftype = 0
	*(*uintptr)(unsafe.Pointer(eeFramePtr + 40)) = uintptr(0)
__7:
	;

	(*Interp)(unsafe.Pointer(iPtr)).FevalFlags = 0
__21:
	if !(XTcl_ParseCommand(tls, interp, p, bytesLeft, 0, parsePtr) != TCL_OK) {
		goto __24
	}
	code = TCL_ERROR
	XTcl_LogCommandInfo(tls, interp, script, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart,
		int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm+uintptr(1))-int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart))/1))
	goto posterror
__24:
	;

	// TIP #280 Track lines. The parser may have skipped text till it
	// found the command we are now at. We have to count the lines in this
	// block, and do not forget invisible continuation lines.

	XTclAdvanceLines(tls, bp+8, p, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)
	XTclAdvanceContinuations(tls, bp+8, bp+16,
		int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)-int64(outerScript))/1))

	gotParse = 1
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 0) {
		goto __25
	}
	// TIP #280. Track lines within the words of the current
	// command. We use a separate pointer into the table of
	// continuation line locations to not lose our position for the
	// per-command parsing.

	*(*int32)(unsafe.Pointer(bp + 24 /* wordLine */)) = *(*int32)(unsafe.Pointer(bp + 8 /* line */))
	wordStart = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart
	*(*uintptr)(unsafe.Pointer(bp + 32 /* wordCLNext */)) = *(*uintptr)(unsafe.Pointer(bp + 16 /* clNext */))
	objectsNeeded = uint32(0)
	numWords = uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)

	// Generate an array of objects for the words of the command.

	if !(numWords > minObjs) {
		goto __26
	}
	expand = XTcl_Alloc(tls, uint32(uint64(numWords)*uint64(unsafe.Sizeof(int32(0)))))
	objvSpace = XTcl_Alloc(tls, uint32(uint64(numWords)*uint64(unsafe.Sizeof(uintptr(0)))))
	lineSpace = XTcl_Alloc(tls, uint32(uint64(numWords)*uint64(unsafe.Sizeof(int32(0)))))
__26:
	;
	expandRequested = 0
	objv = objvSpace
	lines = lineSpace

	(*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr = (*CmdFrame)(unsafe.Pointer(eeFramePtr)).FnextPtr
	objectsUsed = uint32(0)
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
__27:
	if !(objectsUsed < numWords) {
		goto __29
	}
	// TIP #280. Track lines to current word. Save the information
	// on a per-word basis, signaling dynamic words as needed.
	// Make the information available to the recursively called
	// evaluator as well, including the type of context (source
	// vs. eval).

	XTclAdvanceLines(tls, bp+24, wordStart, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)
	XTclAdvanceContinuations(tls, bp+24, bp+32,
		int32((int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)-int64(outerScript))/1))
	wordStart = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart

	*(*int32)(unsafe.Pointer(lines + uintptr(objectsUsed)*4)) = func() int32 {
		if XTclWordKnownAtCompileTime(tls, tokenPtr, uintptr(0)) != 0 {
			return *(*int32)(unsafe.Pointer(bp + 24 /* wordLine */))
		}
		return -1
	}()

	if !((*CmdFrame)(unsafe.Pointer(eeFramePtr)).Ftype == 4) {
		goto __30
	}
	*(*int32)(unsafe.Pointer(iPtr + 324)) |= TCL_EVAL_FILE
__30:
	;

	code = XTclSubstTokens(tls, interp, tokenPtr+uintptr(1)*24,
		(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, uintptr(0), *(*int32)(unsafe.Pointer(bp + 24 /* wordLine */)),
		*(*uintptr)(unsafe.Pointer(bp + 32 /* wordCLNext */)), outerScript)

	(*Interp)(unsafe.Pointer(iPtr)).FevalFlags = 0

	if !(code != TCL_OK) {
		goto __31
	}
	goto __29
__31:
	;
	*(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)) = XTcl_GetObjResult(tls, interp)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)))).FrefCount++
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_EXPAND_WORD) {
		goto __32
	}

	code = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 40)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)), bp+40)
	}()
	if !(code == TCL_ERROR) {
		goto __34
	}
	// Attempt to expand a non-list.

	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+7921, libc.VaList(bp, objectsUsed)))
__35:
	_objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __38
	}
	XTclFreeObj(tls, _objPtr)
__38:
	;
	goto __36
__36:
	if 0 != 0 {
		goto __35
	}
	goto __37
__37:
	;
	goto __29
__34:
	;
	expandRequested = 1
	*(*int32)(unsafe.Pointer(expand + uintptr(objectsUsed)*4)) = 1

	objectsNeeded = objectsNeeded + func() uint32 {
		if *(*int32)(unsafe.Pointer(bp + 40)) != 0 {
			return uint32(*(*int32)(unsafe.Pointer(bp + 40)))
		}
		return uint32(1)
	}()
	goto __33
__32:
	*(*int32)(unsafe.Pointer(expand + uintptr(objectsUsed)*4)) = 0
	objectsNeeded++
__33:
	;

	if !(*(*uintptr)(unsafe.Pointer(bp + 32)) != 0) {
		goto __39
	}
	XTclContinuationsEnterDerived(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)),
		int32((int64(wordStart)-int64(outerScript))/1), *(*uintptr)(unsafe.Pointer(bp + 32 /* wordCLNext */)))
__39:
	;
	goto __28
__28:
	objectsUsed++
	tokenPtr += 24 * uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)
	goto __27
	goto __29
__29:
	; // for loop
	(*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr = eeFramePtr
	if !(code != TCL_OK) {
		goto __40
	}
	goto error
__40:
	;
	if !(expandRequested != 0) {
		goto __41
	}
	// Some word expansion was requested. Check for objv resize.

	copy = objvSpace
	lcopy = lineSpace
	wordIdx = int32(numWords)
	objIdx = int32(objectsNeeded - uint32(1))

	if !(numWords > minObjs || objectsNeeded > minObjs) {
		goto __42
	}
	objv = libc.AssignUintptr(&objvSpace, XTcl_Alloc(tls, uint32(uint64(objectsNeeded)*uint64(unsafe.Sizeof(uintptr(0))))))
	lines = libc.AssignUintptr(&lineSpace, XTcl_Alloc(tls, uint32(uint64(objectsNeeded)*uint64(unsafe.Sizeof(int32(0))))))
__42:
	;

	objectsUsed = uint32(0)
__43:
	if !(libc.PostDecInt32(&wordIdx, 1) != 0) {
		goto __44
	}
	if !(*(*int32)(unsafe.Pointer(expand + uintptr(wordIdx)*4)) != 0) {
		goto __45
	}
	temp = *(*uintptr)(unsafe.Pointer(copy + uintptr(wordIdx)*8))

	XTcl_ListObjGetElements(tls, uintptr(0), temp, bp+44,
		bp+48)
	objectsUsed = objectsUsed + uint32(*(*int32)(unsafe.Pointer(bp + 44)))
__47:
	if !(libc.PostDecInt32(&*(*int32)(unsafe.Pointer(bp + 44)), 1) != 0) {
		goto __48
	}
	*(*int32)(unsafe.Pointer(lines + uintptr(objIdx)*4)) = -1
	*(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PostDecInt32(&objIdx, 1))*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* elements */)) + uintptr(*(*int32)(unsafe.Pointer(bp + 44 /* numElements1 */)))*8))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + uintptr(*(*int32)(unsafe.Pointer(bp + 44)))*8)))).FrefCount++
	goto __47
__48:
	;
__49:
	_objPtr1 = temp
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __52
	}
	XTclFreeObj(tls, _objPtr1)
__52:
	;
	goto __50
__50:
	if 0 != 0 {
		goto __49
	}
	goto __51
__51:
	;
	goto __46
__45:
	*(*int32)(unsafe.Pointer(lines + uintptr(objIdx)*4)) = *(*int32)(unsafe.Pointer(lcopy + uintptr(wordIdx)*4))
	*(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PostDecInt32(&objIdx, 1))*8)) = *(*uintptr)(unsafe.Pointer(copy + uintptr(wordIdx)*8))
	objectsUsed++
__46:
	;
	goto __43
__44:
	;
	objv += 8 * uintptr(objIdx+1)

	if !(copy != stackObjArray) {
		goto __53
	}
	XTclpFree(tls, copy)
__53:
	;
	if !(lcopy != linesStack) {
		goto __54
	}
	XTclpFree(tls, lcopy)
__54:
	;
__41:
	;

	// Execute the command and free the objects for its words.
	//
	// TIP #280: Remember the command itself for 'info frame'. We
	// shorten the visible command by one char to exclude the
	// termination character, if necessary. Here is where we put our
	// frame on the stack of frames too. _After_ the nested commands
	// have been executed.

	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Fcmd = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart
	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Flen = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm == (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart+uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize)-uintptr(1)) {
		goto __55
	}
	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Flen--
__55:
	;

	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Fnline = int32(objectsUsed)
	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Fline = lines

	XTclArgumentEnter(tls, interp, objv, int32(objectsUsed), eeFramePtr)
	code = XTcl_EvalObjv(tls, interp, int32(objectsUsed), objv,
		TCL_EVAL_NOERR|TCL_EVAL_SOURCE_IN_FRAME)
	XTclArgumentRelease(tls, interp, objv, int32(objectsUsed))

	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Fline = uintptr(0)
	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).Fnline = 0
	if !((*CmdFrame)(unsafe.Pointer(eeFramePtr)).FcmdObj != 0) {
		goto __56
	}
__57:
	_objPtr2 = (*CmdFrame)(unsafe.Pointer(eeFramePtr)).FcmdObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __60
	}
	XTclFreeObj(tls, _objPtr2)
__60:
	;
	goto __58
__58:
	if 0 != 0 {
		goto __57
	}
	goto __59
__59:
	;
	(*CmdFrame)(unsafe.Pointer(eeFramePtr)).FcmdObj = uintptr(0)
__56:
	;

	if !(code != TCL_OK) {
		goto __61
	}
	goto error
__61:
	;
	i = uint32(0)
__62:
	if !(i < objectsUsed) {
		goto __64
	}
__65:
	_objPtr3 = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __68
	}
	XTclFreeObj(tls, _objPtr3)
__68:
	;
	goto __66
__66:
	if 0 != 0 {
		goto __65
	}
	goto __67
__67:
	;
	goto __63
__63:
	i++
	goto __62
	goto __64
__64:
	;
	objectsUsed = uint32(0)
	if !(objvSpace != stackObjArray) {
		goto __69
	}
	XTclpFree(tls, objvSpace)
	objvSpace = stackObjArray
	XTclpFree(tls, lineSpace)
	lineSpace = linesStack
__69:
	;

	// Free expand separately since objvSpace could have been
	// reallocated above.

	if !(expand != expandStack) {
		goto __70
	}
	XTclpFree(tls, expand)
	expand = expandStack
__70:
	;
__25:
	;

	// Advance to the next command in the script.
	//
	// TIP #280 Track Lines. Now we track how many lines were in the
	// executed command.

	next = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize)
	bytesLeft = int32(int64(bytesLeft) - (int64(next)-int64(p))/1)
	p = next
	XTclAdvanceLines(tls, bp+8, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, p)
	XTcl_FreeParse(tls, parsePtr)
	gotParse = 0
	goto __22
__22:
	if bytesLeft > 0 {
		goto __21
	}
	goto __23
__23:
	;
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = savedVarFramePtr
	code = TCL_OK
	goto cleanup_return

error:
	// Generate and log various pieces of error information.

	if !((*Interp)(unsafe.Pointer(iPtr)).FnumLevels == 0) {
		goto __71
	}
	if !(code == TCL_RETURN) {
		goto __72
	}
	code = XTclUpdateReturnInfo(tls, iPtr)
__72:
	;
	if !(code != TCL_OK && code != TCL_ERROR && !(allowExceptions != 0)) {
		goto __73
	}
	sProcessUnexpectedResult(tls, interp, code)
	code = TCL_ERROR
__73:
	;
__71:
	;
	if !(code == TCL_ERROR && !((*Interp)(unsafe.Pointer(iPtr)).Fflags&ERR_ALREADY_LOGGED != 0)) {
		goto __74
	}
	commandLength = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm == (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart+uintptr(commandLength)-uintptr(1)) {
		goto __75
	}
	// The terminator character (such as ; or ]) of the command where
	// the error occurred is the last character in the parsed command.
	// Reduce the length by one so that the error message doesn't
	// include the terminator character.

	commandLength = commandLength - 1
__75:
	;
	XTcl_LogCommandInfo(tls, interp, script, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart,
		commandLength)
__74:
	;
posterror:
	*(*int32)(unsafe.Pointer(iPtr + 424)) &= libc.CplInt32(ERR_ALREADY_LOGGED)

	// Then free resources that had been allocated to the command.

	i = uint32(0)
__76:
	if !(i < objectsUsed) {
		goto __78
	}
__79:
	_objPtr4 = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __82
	}
	XTclFreeObj(tls, _objPtr4)
__82:
	;
	goto __80
__80:
	if 0 != 0 {
		goto __79
	}
	goto __81
__81:
	;
	goto __77
__77:
	i++
	goto __76
	goto __78
__78:
	;
	if !(gotParse != 0) {
		goto __83
	}
	XTcl_FreeParse(tls, parsePtr)
__83:
	;
	if !(objvSpace != stackObjArray) {
		goto __84
	}
	XTclpFree(tls, objvSpace)
	XTclpFree(tls, lineSpace)
__84:
	;
	if !(expand != expandStack) {
		goto __85
	}
	XTclpFree(tls, expand)
__85:
	;
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = savedVarFramePtr

cleanup_return:
	// TIP #280. Release the local CmdFrame, and its contents.

	(*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr = (*CmdFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr)).FnextPtr
	if !((*CmdFrame)(unsafe.Pointer(eeFramePtr)).Ftype == 4) {
		goto __86
	}
__87:
	_objPtr5 = *(*uintptr)(unsafe.Pointer(eeFramePtr + 40))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __90
	}
	XTclFreeObj(tls, _objPtr5)
__90:
	;
	goto __88
__88:
	if 0 != 0 {
		goto __87
	}
	goto __89
__89:
	;
__86:
	;
	XTclStackFree(tls, interp, linesStack)
	XTclStackFree(tls, interp, expandStack)
	XTclStackFree(tls, interp, stackObjArray)
	XTclStackFree(tls, interp, eeFramePtr)
	XTclStackFree(tls, interp, parsePtr)

	return code
}

//----------------------------------------------------------------------
//
// TclAdvanceLines --
//
//	This function is a helper which counts the number of lines in a block
//	of text and advances an external counter.
//
// Results:
//	None.
//
// Side effects:
//	The specified counter is advanced per the number of lines found.
//
// TIP #280
//----------------------------------------------------------------------

func XTclAdvanceLines(tls *libc.TLS, line uintptr, start uintptr, end uintptr) { /* tclBasic.c:5505:1: */
	var p uintptr

	for p = start; p < end; p++ {
		if int32(*(*int8)(unsafe.Pointer(p))) == '\n' {
			*(*int32)(unsafe.Pointer(line))++
		}
	}
}

//----------------------------------------------------------------------
//
// TclAdvanceContinuations --
//
//	This procedure is a helper which counts the number of continuation
//	lines (CL) in a block of text using a table of CL locations and
//	advances an external counter, and the pointer into the table.
//
// Results:
//	None.
//
// Side effects:
//	The specified counter is advanced per the number of continuation lines
//	found.
//
// TIP #280
//----------------------------------------------------------------------

func XTclAdvanceContinuations(tls *libc.TLS, line uintptr, clNextPtrPtr uintptr, loc int32) { /* tclBasic.c:5540:1: */
	// Track the invisible continuation lines embedded in a script, if any.
	// Here they are just spaces (already). They were removed by
	// TclSubstTokens via TclParseBackslash.
	//
	// *clNextPtrPtr         <=> We have continuation lines to track.
	// **clNextPtrPtr >= 0   <=> We are not beyond the last possible location.
	// loc >= **clNextPtrPtr <=> We stepped beyond the current cont. line.

	for *(*uintptr)(unsafe.Pointer(clNextPtrPtr)) != 0 && *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(clNextPtrPtr)))) >= 0 &&
		loc >= *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(clNextPtrPtr)))) {
		// We just stepped over an invisible continuation line. Adjust the
		// line counter and step to the table entry holding the location of
		// the next continuation line to track.

		*(*int32)(unsafe.Pointer(line))++
		*(*uintptr)(unsafe.Pointer(clNextPtrPtr)) += 4
	}
}

//----------------------------------------------------------------------
// Note: The whole data structure access for argument location tracking is
// hidden behind these three functions. The only parts open are the lineLAPtr
// field in the Interp structure. The CFWord definition is internal to here.
// Should make it easier to redo the data structures if we find something more
// space/time efficient.

//----------------------------------------------------------------------
//
// TclArgumentEnter --
//
//	This procedure is a helper for the TIP #280 uplevel extension. It
//	enters location references for the arguments of a command to be
//	invoked. Only the first entry has the actual data, further entries
//	simply count the usage up.
//
// Results:
//	None.
//
// Side effects:
//	May allocate memory.
//
// TIP #280
//----------------------------------------------------------------------

func XTclArgumentEnter(tls *libc.TLS, interp uintptr, objv uintptr, objc int32, cfPtr uintptr) { /* tclBasic.c:5598:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp
	// var new int32 at bp, 4

	var i int32
	var hPtr uintptr
	var cfwPtr uintptr

	for i = 1; i < objc; i++ {
		// Ignore argument words without line information (= dynamic). If they
		// are variables they may have location information associated with
		// that, either through globally recorded 'set' invokations, or
		// literals in bytecode. Eitehr way there is no need to record
		// something here.

		if *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(cfPtr)).Fline + uintptr(i)*4)) < 0 {
			continue
		}
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr)).FcreateProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp /* &new */)
		if *(*int32)(unsafe.Pointer(bp)) != 0 {
			// The word is not on the stack yet, remember the current location
			// and initialize references.

			cfwPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CFWord{})))
			(*CFWord)(unsafe.Pointer(cfwPtr)).FframePtr = cfPtr
			(*CFWord)(unsafe.Pointer(cfwPtr)).Fword = i
			(*CFWord)(unsafe.Pointer(cfwPtr)).FrefCount = 1
			(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cfwPtr
		} else {
			// The word is already on the stack, its current location is not
			// relevant. Just remember the reference to prevent early removal.

			cfwPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
			(*CFWord)(unsafe.Pointer(cfwPtr)).FrefCount++
		}
	}
}

//----------------------------------------------------------------------
//
// TclArgumentRelease --
//
//	This procedure is a helper for the TIP #280 uplevel extension. It
//	removes the location references for the arguments of a command just
//	done. Usage is counted down, the data is removed only when no user is
//	left over.
//
// Results:
//	None.
//
// Side effects:
//	May release memory.
//
// TIP #280
//----------------------------------------------------------------------

func XTclArgumentRelease(tls *libc.TLS, interp uintptr, objv uintptr, objc int32) { /* tclBasic.c:5666:1: */
	var iPtr uintptr = interp
	var i int32

	for i = 1; i < objc; i++ {
		var cfwPtr uintptr
		var hPtr uintptr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))

		if !(hPtr != 0) {
			continue
		}
		cfwPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		(*CFWord)(unsafe.Pointer(cfwPtr)).FrefCount--
		if (*CFWord)(unsafe.Pointer(cfwPtr)).FrefCount > 0 {
			continue
		}

		XTclpFree(tls, cfwPtr)
		XTcl_DeleteHashEntry(tls, hPtr)
	}
}

//----------------------------------------------------------------------
//
// TclArgumentBCEnter --
//
//	This procedure is a helper for the TIP #280 uplevel extension. It
//	enters location references for the literal arguments of commands in
//	bytecode about to be invoked. Only the first entry has the actual
//	data, further entries simply count the usage up.
//
// Results:
//	None.
//
// Side effects:
//	May allocate memory.
//
// TIP #280
//----------------------------------------------------------------------

func XTclArgumentBCEnter(tls *libc.TLS, interp uintptr, objv uintptr, objc int32, codePtr uintptr, cfPtr uintptr, cmd int32, pc int32) { /* tclBasic.c:5715:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var eclPtr uintptr
	var word int32
	var ePtr uintptr
	var lastPtr uintptr = uintptr(0)
	var iPtr uintptr = interp
	var hePtr uintptr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr, codePtr)

	if !(hePtr != 0) {
		return
	}
	eclPtr = (*Tcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData
	ePtr = (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(cmd)*24

	// ePtr->nline is the number of words originally parsed.
	//
	// objc is the number of elements getting invoked.
	//
	// If they are not the same, we arrived here by compiling an
	// ensemble dispatch.  Ensemble subcommands that lead to script
	// evaluation are not supposed to get compiled, because a command
	// such as [info level] in the script can expose some of the dispatch
	// shenanigans.  This means that we don't have to tend to the
	// housekeeping, and can escape now.

	if (*ECL)(unsafe.Pointer(ePtr)).Fnline != objc {
		return
	}

	// Having disposed of the ensemble cases, we can state...
	// A few truths ...
	// (1) ePtr->nline == objc
	// (2) (ePtr->line[word] < 0) => !literal, for all words
	// (3) (word == 0) => !literal
	//
	// Item (2) is why we can use objv to get the literals, and do not
	// have to save them at compile time.

	for word = 1; word < objc; word++ {
		if *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer(ePtr)).Fline + uintptr(word)*4)) >= 0 {
			// var isnew int32 at bp, 4

			var hPtr uintptr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr)).FcreateProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(word)*8)), bp /* &isnew */)
			var cfwPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CFWordBC{})))

			(*CFWordBC)(unsafe.Pointer(cfwPtr)).FframePtr = cfPtr
			(*CFWordBC)(unsafe.Pointer(cfwPtr)).Fobj = *(*uintptr)(unsafe.Pointer(objv + uintptr(word)*8))
			(*CFWordBC)(unsafe.Pointer(cfwPtr)).Fpc = pc
			(*CFWordBC)(unsafe.Pointer(cfwPtr)).Fword = word
			(*CFWordBC)(unsafe.Pointer(cfwPtr)).FnextPtr = lastPtr
			lastPtr = cfwPtr

			if *(*int32)(unsafe.Pointer(bp)) != 0 {
				// The word is not on the stack yet, remember the current
				// location and initialize references.

				(*CFWordBC)(unsafe.Pointer(cfwPtr)).FprevPtr = uintptr(0)
			} else {
				// The object is already on the stack, however it may have
				// a different location now (literal sharing may map
				// multiple location to a single Tcl_Obj*. Save the old
				// information in the new structure.

				(*CFWordBC)(unsafe.Pointer(cfwPtr)).FprevPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
			}

			(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cfwPtr
		}
	} // for

	(*CmdFrame)(unsafe.Pointer(cfPtr)).Flitarg = lastPtr
}

//----------------------------------------------------------------------
//
// TclArgumentBCRelease --
//
//	This procedure is a helper for the TIP #280 uplevel extension. It
//	removes the location references for the literal arguments of commands
//	in bytecode just done. Usage is counted down, the data is removed only
//	when no user is left over.
//
// Results:
//	None.
//
// Side effects:
//	May release memory.
//
// TIP #280
//----------------------------------------------------------------------

func XTclArgumentBCRelease(tls *libc.TLS, interp uintptr, cfPtr uintptr) { /* tclBasic.c:5826:1: */
	var iPtr uintptr = interp
	var cfwPtr uintptr = (*CmdFrame)(unsafe.Pointer(cfPtr)).Flitarg

	for cfwPtr != 0 {
		var nextPtr uintptr = (*CFWordBC)(unsafe.Pointer(cfwPtr)).FnextPtr
		var hPtr uintptr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr, (*CFWordBC)(unsafe.Pointer(cfwPtr)).Fobj)
		var xPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		if xPtr != cfwPtr {
			XTcl_Panic(tls, ts+7946, 0)
		}

		if (*CFWordBC)(unsafe.Pointer(cfwPtr)).FprevPtr != 0 {
			(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = (*CFWordBC)(unsafe.Pointer(cfwPtr)).FprevPtr
		} else {
			XTcl_DeleteHashEntry(tls, hPtr)
		}

		XTclpFree(tls, cfwPtr)
		cfwPtr = nextPtr
	}

	(*CmdFrame)(unsafe.Pointer(cfPtr)).Flitarg = uintptr(0)
}

//----------------------------------------------------------------------
//
// TclArgumentGet --
//
//	This procedure is a helper for the TIP #280 uplevel extension. It
//	finds the location references for a Tcl_Obj, if any.
//
// Results:
//	None.
//
// Side effects:
//	Writes found location information into the result arguments.
//
// TIP #280
//----------------------------------------------------------------------

func XTclArgumentGet(tls *libc.TLS, interp uintptr, obj uintptr, cfPtrPtr uintptr, wordPtr uintptr) { /* tclBasic.c:5875:1: */
	var iPtr uintptr = interp
	var hPtr uintptr
	var framePtr uintptr

	// An object which either has no string rep or else is a canonical list is
	// guaranteed to have been generated dynamically: bail out, this cannot
	// have a usable absolute location. _Do not touch_ the information the set
	// up by the caller. It knows better than us.

	if (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes == uintptr(0) || func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return libc.Bool32((*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes == uintptr(0) || (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(obj + 32)))).FcanonicalFlag != 0)
		}
		return 0
	}() != 0 {
		return
	}

	// First look for location information recorded in the argument
	// stack. That is nearest.

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLAPtr, obj)
	if hPtr != 0 {
		var cfwPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		*(*int32)(unsafe.Pointer(wordPtr)) = (*CFWord)(unsafe.Pointer(cfwPtr)).Fword
		*(*uintptr)(unsafe.Pointer(cfPtrPtr)) = (*CFWord)(unsafe.Pointer(cfwPtr)).FframePtr
		return
	}

	// Check if the Tcl_Obj has location information as a bytecode literal, in
	// that stack.

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineLABCPtr, obj)
	if hPtr != 0 {
		var cfwPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		framePtr = (*CFWordBC)(unsafe.Pointer(cfwPtr)).FframePtr
		*(*uintptr)(unsafe.Pointer(framePtr + 40 + 8 /* &.pc */)) = (*ByteCode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(framePtr + 40)))).FcodeStart + uintptr((*CFWordBC)(unsafe.Pointer(cfwPtr)).Fpc)
		*(*uintptr)(unsafe.Pointer(cfPtrPtr)) = (*CFWordBC)(unsafe.Pointer(cfwPtr)).FframePtr
		*(*int32)(unsafe.Pointer(wordPtr)) = (*CFWordBC)(unsafe.Pointer(cfwPtr)).Fword
		return
	}
}

//----------------------------------------------------------------------
//
// Tcl_Eval --
//
//	Execute a Tcl command in a string. This function executes the script
//	directly, rather than compiling it to bytecodes. Before the arrival of
//	the bytecode compiler in Tcl 8.0 Tcl_Eval was the main function used
//	for executing Tcl commands, but nowadays it isn't used much.
//
// Results:
//	The return value is one of the return codes defined in tcl.h (such as
//	TCL_OK), and interp's result contains a value to supplement the return
//	code. The value of the result will persist only until the next call to
//	Tcl_Eval or Tcl_EvalObj: you must copy it or lose it!
//
// Side effects:
//	Can be almost arbitrary, depending on the commands in the script.
//
//----------------------------------------------------------------------

func XTcl_Eval(tls *libc.TLS, interp uintptr, script uintptr) int32 { /* tclBasic.c:5952:1: */
	var code int32 = XTcl_EvalEx(tls, interp, script, -1, 0)

	// For backwards compatibility with old C code that predates the object
	// system in Tcl 8.0, we have to mirror the object result back into the
	// string result (some callers may expect it there).

	XTcl_GetStringResult(tls, interp)
	return code
}

//----------------------------------------------------------------------
//
// Tcl_EvalObj, Tcl_GlobalEvalObj --
//
//	These functions are deprecated but we keep them around for backwards
//	compatibility reasons.
//
// Results:
//	See the functions they call.
//
// Side effects:
//	See the functions they call.
//
//----------------------------------------------------------------------

func XTcl_EvalObj(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclBasic.c:5988:1: */
	return XTcl_EvalObjEx(tls, interp, objPtr, 0)
}

func XTcl_GlobalEvalObj(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclBasic.c:5996:1: */
	return XTcl_EvalObjEx(tls, interp, objPtr, TCL_EVAL_GLOBAL)
}

//----------------------------------------------------------------------
//
// Tcl_EvalObjEx, TclEvalObjEx --
//
//	Execute Tcl commands stored in a Tcl object. These commands are
//	compiled into bytecodes if necessary, unless TCL_EVAL_DIRECT is
//	specified.
//
//	If the flag TCL_EVAL_DIRECT is passed in, the value of invoker
//	must be NULL.  Support for non-NULL invokers in that mode has
//	been removed since it was unused and untested.  Failure to
//	follow this limitation will lead to an assertion panic.
//
// Results:
//	The return value is one of the return codes defined in tcl.h (such as
//	TCL_OK), and the interpreter's result contains a value to supplement
//	the return code.
//
// Side effects:
//	The object is converted, if necessary, to a ByteCode object that holds
//	the bytecode instructions for the commands. Executing the commands
//	will almost certainly have side effects that depend on those commands.
//
// TIP #280 : Keep public API, internally extended API.
//----------------------------------------------------------------------

func XTcl_EvalObjEx(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32) int32 { /* tclBasic.c:6032:1: */
	return XTclEvalObjEx(tls, interp, objPtr, flags, uintptr(0), 0)
}

func XTclEvalObjEx(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32, invoker uintptr, word int32) int32 { /* tclBasic.c:6045:1: */
	var result int32 = TCL_OK
	var rootPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr

	result = XTclNREvalObjEx(tls, interp, objPtr, flags, invoker, word)
	return XTclNRRunCallbacks(tls, interp, result, rootPtr)
}

func XTclNREvalObjEx(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32, invoker uintptr, word int32) int32 { /* tclBasic.c:6064:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp
	var result int32

	// This function consists of three independent blocks for: direct
	// evaluation of canonical lists, compilation and bytecode execution and
	// finally direct evaluation. Precisely one of these blocks will be run.

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return libc.Bool32((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) || (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32)))).FcanonicalFlag != 0)
		}
		return 0
	}() != 0 {
		var eoFramePtr uintptr = uintptr(0)
		var objc int32
		var listPtr uintptr
		var objv uintptr

		// Canonical List Optimization:  In this case, we
		// can safely use Tcl_EvalObjv instead and get an appreciable
		// improvement in execution speed. This is because it allows us to
		// avoid a setFromAny step that would just pack everything into a
		// string and back out again.
		//
		// This also preserves any associations between list elements and
		// location information for such elements.

		// Shimmer protection! Always pass an unshared obj. The caller could
		// incr the refCount of objPtr AFTER calling us! To be completely safe
		// we always make a copy. The callback takes care od the refCounts for
		// both listPtr and objPtr.
		//
		// TODO: Create a test to demo this need, or eliminate it.
		// FIXME OPT: preserve just the internal rep?

		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
		listPtr = XTclListObjCopy(tls, interp, objPtr)
		(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount++

		if word != -0x7fffffff-1 {
			// TIP #280 Structures for tracking lines. As we know that this is
			// dynamic execution we ignore the invoker, even if known.
			//
			// TIP #280. We do _not_ compute all the line numbers for the
			// words in the command. For the eval of a pure list the most
			// sensible choice is to put all words on line 1. Given that we
			// neither need memory for them nor compute anything. 'line' is
			// left NULL. The two places using this information (TclInfoFrame,
			// and TclInitCompileEnv), are special-cased to use the proper
			// line number directly instead of accessing the 'line' array.
			//
			// Note that we use (word==INTMIN) to signal that no command frame
			// should be pushed, as needed by alias and ensemble redirections.

			eoFramePtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(CmdFrame{})))
			(*CmdFrame)(unsafe.Pointer(eoFramePtr)).Fnline = 0
			(*CmdFrame)(unsafe.Pointer(eoFramePtr)).Fline = uintptr(0)

			(*CmdFrame)(unsafe.Pointer(eoFramePtr)).Ftype = 0
			(*CmdFrame)(unsafe.Pointer(eoFramePtr)).Flevel = func() int32 {
				if (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr == uintptr(0) {
					return 1
				}
				return (*CmdFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr)).Flevel + 1
			}()
			(*CmdFrame)(unsafe.Pointer(eoFramePtr)).FframePtr = (*Interp)(unsafe.Pointer(iPtr)).FframePtr
			(*CmdFrame)(unsafe.Pointer(eoFramePtr)).FnextPtr = (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr

			(*CmdFrame)(unsafe.Pointer(eoFramePtr)).FcmdObj = objPtr
			(*CmdFrame)(unsafe.Pointer(eoFramePtr)).Fcmd = uintptr(0)
			(*CmdFrame)(unsafe.Pointer(eoFramePtr)).Flen = 0
			*(*uintptr)(unsafe.Pointer(eoFramePtr + 40)) = uintptr(0)

			(*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr = eoFramePtr

			flags = flags | TCL_EVAL_SOURCE_IN_FRAME
		}

		XTclMarkTailcall(tls, interp)
		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sTEOEx_ListCallback}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = listPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = eoFramePtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = objPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}

		objv = *(*uintptr)(unsafe.Pointer(listPtr + 32)) + 16
		objc = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(listPtr + 32)))).FelemCount
		return XTclNREvalObjv(tls, interp, objc, objv, flags, uintptr(0))
	}

	if !(flags&TCL_EVAL_DIRECT != 0) {
		// Let the compiler/engine subsystem do the evaluation.
		//
		// TIP #280 The invoker provides us with the context for the script.
		// We transfer this to the byte code compiler.

		var allowExceptions int32 = (*Interp)(unsafe.Pointer(iPtr)).FevalFlags & TCL_ALLOW_EXCEPTIONS
		var codePtr uintptr
		var savedVarFramePtr uintptr = uintptr(0) // Saves old copy of
		// iPtr->varFramePtr in case
		// TCL_EVAL_GLOBAL was set.

		if XTclInterpReady(tls, interp) != TCL_OK {
			return TCL_ERROR
		}
		if flags&TCL_EVAL_GLOBAL != 0 {
			savedVarFramePtr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
			(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = (*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
		codePtr = XTclCompileObj(tls, interp, objPtr, invoker, word)

		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _callbackPtr uintptr
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sTEOEx_ByteCodeCallback}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = savedVarFramePtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = objPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(Intptr_t(allowExceptions))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
		return XTclNRExecuteByteCode(tls, interp, codePtr)
	}

	{
		// We're not supposed to use the compiler or byte-code
		// interpreter. Let Tcl_EvalEx evaluate the command directly (and
		// probably more slowly).

		var script uintptr
		// var numSrcBytes int32 at bp, 4

		// Now we check if we have data about invisible continuation lines for
		// the script, and make it available to the direct script parser and
		// evaluator we are about to call, if so.
		//
		// It may be possible that the script Tcl_Obj* can be free'd while the
		// evaluator is using it, leading to the release of the associated
		// ContLineLoc structure as well. To ensure that the latter doesn't
		// happen we set a lock on it. We release this lock later in this
		// function, after the evaluator is done. The relevant "lineCLPtr"
		// hashtable is managed in the file "tclObj.c".
		//
		// Another important action is to save (and later restore) the
		// continuation line information of the caller, in case we are
		// executing nested commands in the eval/direct path.

		var saveCLLocPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FscriptCLLocPtr

		(*Interp)(unsafe.Pointer(iPtr)).FscriptCLLocPtr = XTclContinuationsGet(tls, objPtr)

		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++

		script = XTcl_GetStringFromObj(tls, objPtr, bp)
		result = XTcl_EvalEx(tls, interp, script, *(*int32)(unsafe.Pointer(bp /* numSrcBytes */)), flags)

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
				for ok6 := true; ok6; ok6 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, objPtr)
					} else {
						*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, objPtr)
			}
		}

		(*Interp)(unsafe.Pointer(iPtr)).FscriptCLLocPtr = saveCLLocPtr
		return result

	}
	return int32(0)
}

func sTEOEx_ByteCodeCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:6234:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp
	var savedVarFramePtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var objPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))
	var allowExceptions int32 = int32(*(*ClientData)(unsafe.Pointer(data + 2*8)))

	if (*Interp)(unsafe.Pointer(iPtr)).FnumLevels == 0 {
		if result == TCL_RETURN {
			result = XTclUpdateReturnInfo(tls, iPtr)
		}
		if result != TCL_OK && result != TCL_ERROR && !(allowExceptions != 0) {
			var script uintptr
			// var numSrcBytes int32 at bp, 4

			sProcessUnexpectedResult(tls, interp, result)
			result = TCL_ERROR
			script = XTcl_GetStringFromObj(tls, objPtr, bp)
			XTcl_LogCommandInfo(tls, interp, script, script, *(*int32)(unsafe.Pointer(bp /* numSrcBytes */)))
		}

		// We are returning to level 0, so should call TclResetCancellation.
		// Let us just unset the flags inline.

		*(*int32)(unsafe.Pointer(iPtr + 424)) &= libc.CplInt32(CANCELED | TCL_CANCEL_UNWIND)
	}
	(*Interp)(unsafe.Pointer(iPtr)).FevalFlags = 0

	// Restore the callFrame if this was a TCL_EVAL_GLOBAL.

	if savedVarFramePtr != 0 {
		(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = savedVarFramePtr
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, objPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, objPtr)
		}
	}

	return result
}

func sTEOEx_ListCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:6280:1: */
	var iPtr uintptr = interp
	var listPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var eoFramePtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))
	var objPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))

	// Remove the cmdFrame

	if eoFramePtr != 0 {
		(*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr = (*CmdFrame)(unsafe.Pointer(eoFramePtr)).FnextPtr
		XTclStackFree(tls, interp, eoFramePtr)
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, objPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, objPtr)
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(listPtr)).Flength = -1
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, listPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(listPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = listPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, listPtr)
		}
	}

	return result
}

//----------------------------------------------------------------------
//
// ProcessUnexpectedResult --
//
//	Function called by Tcl_EvalObj to set the interpreter's result value
//	to an appropriate error message when the code it evaluates returns an
//	unexpected result code (not TCL_OK and not TCL_ERROR) to the topmost
//	evaluation level.
//
// Results:
//	None.
//
// Side effects:
//	The interpreter result is set to an error message appropriate to the
//	result code.
//
//----------------------------------------------------------------------

func sProcessUnexpectedResult(tls *libc.TLS, interp uintptr, returnCode int32) { /* tclBasic.c:6325:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	// var buf [24]int8 at bp+48, 24

	XTcl_ResetResult(tls, interp)
	if returnCode == TCL_BREAK {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+7983, -1))
	} else if returnCode == TCL_CONTINUE {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+8017, -1))
	} else {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+8054, libc.VaList(bp, returnCode)))
	}
	libc.Xsprintf(tls, bp+48, ts+324, libc.VaList(bp+8, returnCode))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+8084, bp+48, uintptr(0)))
}

//---------------------------------------------------------------------------
//
// Tcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBoolean --
//
//	Functions to evaluate an expression and return its value in a
//	particular form.
//
// Results:
//	Each of the functions below returns a standard Tcl result. If an error
//	occurs then an error message is left in the interp's result. Otherwise
//	the value of the expression, in the appropriate form, is stored at
//	*ptr. If the expression had a result that was incompatible with the
//	desired form then an error is returned.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_ExprLong(tls *libc.TLS, interp uintptr, exprstring uintptr, ptr uintptr) int32 { /* tclBasic.c:6369:1: */
	var exprPtr uintptr
	var result int32 = TCL_OK
	if int32(*(*int8)(unsafe.Pointer(exprstring))) == 0 {
		// Legacy compatibility - return 0 for the zero-length string.

		*(*int64)(unsafe.Pointer(ptr)) = int64(0)
	} else {
		exprPtr = XTcl_NewStringObj(tls, exprstring, -1)
		(*Tcl_Obj)(unsafe.Pointer(exprPtr)).FrefCount++
		result = XTcl_ExprLongObj(tls, interp, exprPtr, ptr)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = exprPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		if result != TCL_OK {
			XTcl_GetStringResult(tls, interp)
		}
	}
	return result
}

func XTcl_ExprDouble(tls *libc.TLS, interp uintptr, exprstring uintptr, ptr uintptr) int32 { /* tclBasic.c:6396:1: */
	var exprPtr uintptr
	var result int32 = TCL_OK

	if int32(*(*int8)(unsafe.Pointer(exprstring))) == 0 {
		// Legacy compatibility - return 0 for the zero-length string.

		*(*float64)(unsafe.Pointer(ptr)) = 0.0
	} else {
		exprPtr = XTcl_NewStringObj(tls, exprstring, -1)
		(*Tcl_Obj)(unsafe.Pointer(exprPtr)).FrefCount++
		result = XTcl_ExprDoubleObj(tls, interp, exprPtr, ptr)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = exprPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		// Discard the expression object.
		if result != TCL_OK {
			XTcl_GetStringResult(tls, interp)
		}
	}
	return result
}

func XTcl_ExprBoolean(tls *libc.TLS, interp uintptr, exprstring uintptr, ptr uintptr) int32 { /* tclBasic.c:6425:1: */
	if int32(*(*int8)(unsafe.Pointer(exprstring))) == 0 {
		// An empty string. Just set the result boolean to 0 (false).

		*(*int32)(unsafe.Pointer(ptr)) = 0
		return TCL_OK
	} else {
		var result int32
		var exprPtr uintptr = XTcl_NewStringObj(tls, exprstring, -1)

		(*Tcl_Obj)(unsafe.Pointer(exprPtr)).FrefCount++
		result = XTcl_ExprBooleanObj(tls, interp, exprPtr, ptr)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = exprPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		if result != TCL_OK {
			// Move the interpreter's object result to the string result, then
			// reset the object result.

			XTcl_GetStringResult(tls, interp)
		}
		return result
	}
	return int32(0)
}

//--------------------------------------------------------------
//
// Tcl_ExprLongObj, Tcl_ExprDoubleObj, Tcl_ExprBooleanObj --
//
//	Functions to evaluate an expression in an object and return its value
//	in a particular form.
//
// Results:
//	Each of the functions below returns a standard Tcl result object. If
//	an error occurs then an error message is left in the interpreter's
//	result. Otherwise the value of the expression, in the appropriate
//	form, is stored at *ptr. If the expression had a result that was
//	incompatible with the desired form then an error is returned.
//
// Side effects:
//	None.
//
//--------------------------------------------------------------

func XTcl_ExprLongObj(tls *libc.TLS, interp uintptr, objPtr uintptr, ptr uintptr) int32 { /* tclBasic.c:6479:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	// var resultPtr uintptr at bp, 8

	var result int32
	// var type1 int32 at bp+16, 4

	// var d float64 at bp+48, 8

	// var internalPtr ClientData at bp+8, 8

	result = XTcl_ExprObj(tls, interp, objPtr, bp)
	if result != TCL_OK {
		return TCL_ERROR
	}

	if XTclGetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), bp+8, bp+16) != TCL_OK {
		return TCL_ERROR
	}

	switch *(*int32)(unsafe.Pointer(bp + 16 /* type1 */)) {
	case TCL_NUMBER_DOUBLE:
		{
			// var big Mp_int at bp+24, 24

			*(*float64)(unsafe.Pointer(bp + 48 /* d */)) = *(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8))))
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			if XTcl_InitBignumFromDouble(tls, interp, *(*float64)(unsafe.Pointer(bp + 48)), bp+24) != TCL_OK {
				return TCL_ERROR
			}
			*(*uintptr)(unsafe.Pointer(bp /* resultPtr */)) = XTcl_NewBignumObj(tls, bp+24)

		}
		fallthrough
	// FALLTHRU
	case TCL_NUMBER_LONG:
		fallthrough
	case TCL_NUMBER_WIDE:
		fallthrough
	case TCL_NUMBER_BIG:
		result = func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
				return func() int32 {
					*(*int64)(unsafe.Pointer(ptr)) = *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))
					return TCL_OK
				}()
			}
			return XTcl_GetLongFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), ptr)
		}()
		break

	case TCL_NUMBER_NAN:
		XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* resultPtr */)), bp+48)
		result = TCL_ERROR
	}

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	} // Discard the result object.
	return result
}

func XTcl_ExprDoubleObj(tls *libc.TLS, interp uintptr, objPtr uintptr, ptr uintptr) int32 { /* tclBasic.c:6527:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	// var resultPtr uintptr at bp, 8

	var result int32
	// var type1 int32 at bp+16, 4

	// var internalPtr ClientData at bp+8, 8

	result = XTcl_ExprObj(tls, interp, objPtr, bp)
	if result != TCL_OK {
		return TCL_ERROR
	}

	result = XTclGetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* resultPtr */)), bp+8, bp+16)
	if result == TCL_OK {
		switch *(*int32)(unsafe.Pointer(bp + 16 /* type1 */)) {
		case TCL_NUMBER_NAN:
			result = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* resultPtr */)), ptr)
			break
			fallthrough
		case TCL_NUMBER_DOUBLE:
			*(*float64)(unsafe.Pointer(ptr)) = *(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8))))
			result = TCL_OK
			break
			fallthrough
		default:
			result = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* resultPtr */)), ptr)
		}
	}
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	} // Discard the result object.
	return result
}

func XTcl_ExprBooleanObj(tls *libc.TLS, interp uintptr, objPtr uintptr, ptr uintptr) int32 { /* tclBasic.c:6563:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var resultPtr uintptr at bp, 8

	var result int32

	result = XTcl_ExprObj(tls, interp, objPtr, bp)
	if result == TCL_OK {
		result = XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* resultPtr */)), ptr)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		// Discard the result object.
	}
	return result
}

//----------------------------------------------------------------------
//
// TclObjInvokeNamespace --
//
//	Object version: Invokes a Tcl command, given an objv/objc, from either
//	the exposed or hidden set of commands in the given interpreter.
//
//	NOTE: The command is invoked in the global stack frame of the
//	interpreter or namespace, thus it cannot see any current state on the
//	stack of that interpreter.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Whatever the command does.
//
//----------------------------------------------------------------------

func XTclObjInvokeNamespace(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, nsPtr uintptr, flags int32) int32 { /* tclBasic.c:6603:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var result int32
	// var framePtr uintptr at bp, 8

	// Make the specified namespace the current namespace and invoke the
	// command.

	XTclPushStackFrame(tls, interp, bp, nsPtr /*isProcFrame*/, 0)
	result = XTclObjInvoke(tls, interp, objc, objv, flags)

	XTclPopStackFrame(tls, interp)
	return result
}

//----------------------------------------------------------------------
//
// TclObjInvoke --
//
//	Invokes a Tcl command, given an objv/objc, from either the exposed or
//	the hidden sets of commands in the given interpreter.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	Whatever the command does.
//
//----------------------------------------------------------------------

func XTclObjInvoke(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, flags int32) int32 { /* tclBasic.c:6647:1: */
	if interp == uintptr(0) {
		return TCL_ERROR
	}
	if objc < 1 || objv == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+8107, -1))
		return TCL_ERROR
	}
	if flags&(int32(1)<<0) == 0 {
		XTcl_Panic(tls, ts+8131, 0)
	}
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRInvoke})), uintptr(0), objc, objv)
}

func XTclNRInvoke(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:6672:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var iPtr uintptr = interp
	var hTblPtr uintptr // Table of hidden commands.
	var cmdName uintptr // Name of the command from objv[0].
	var hPtr uintptr = uintptr(0)
	var cmdPtr uintptr

	cmdName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
	}()
	hTblPtr = (*Interp)(unsafe.Pointer(iPtr)).FhiddenCmdTablePtr
	if hTblPtr != uintptr(0) {
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hTblPtr)).FfindProc})).f(tls, hTblPtr, cmdName)
	}
	if hPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+8178, libc.VaList(bp, cmdName)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+6921, cmdName,
			uintptr(0)))
		return TCL_ERROR
	}
	cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

	// Avoid the exception-handling brain damage when numLevels == 0

	(*Interp)(unsafe.Pointer(iPtr)).FnumLevels++
	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sNRPostInvoke})), uintptr(0), uintptr(0), uintptr(0), uintptr(0))

	// Normal command resolution of objv[0] isn't going to find cmdPtr.
	// That's the whole point of **hidden** commands.  So tell the Eval core
	// machinery not to even try (and risk finding something wrong).

	return XTclNREvalObjv(tls, interp, objc, objv, TCL_EVAL_NORESOLVE, cmdPtr)
}

func sNRPostInvoke(tls *libc.TLS, clientData uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:6715:1: */
	var iPtr uintptr = interp
	(*Interp)(unsafe.Pointer(iPtr)).FnumLevels--
	return result
}

//---------------------------------------------------------------------------
//
// Tcl_ExprString --
//
//	Evaluate an expression in a string and return its value in string
//	form.
//
// Results:
//	A standard Tcl result. If the result is TCL_OK, then the interp's
//	result is set to the string value of the expression. If the result is
//	TCL_ERROR, then the interp's result contains an error message.
//
// Side effects:
//	A Tcl object is allocated to hold a copy of the expression string.
//	This expression object is passed to Tcl_ExprObj and then deallocated.
//
//---------------------------------------------------------------------------

func XTcl_ExprString(tls *libc.TLS, interp uintptr, expr uintptr) int32 { /* tclBasic.c:6746:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var code int32 = TCL_OK

	if int32(*(*int8)(unsafe.Pointer(expr))) == 0 {
		// An empty string. Just set the interpreter's result to 0.

		XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, 0))
	} else {
		// var resultPtr uintptr at bp, 8

		var exprObj uintptr = XTcl_NewStringObj(tls, expr, -1)

		(*Tcl_Obj)(unsafe.Pointer(exprObj)).FrefCount++
		code = XTcl_ExprObj(tls, interp, exprObj, bp)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = exprObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		if code == TCL_OK {
			XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* resultPtr */)))
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
	}

	// Force the string rep of the interp result.

	XTcl_GetStringResult(tls, interp)
	return code
}

//----------------------------------------------------------------------
//
// Tcl_AppendObjToErrorInfo --
//
//	Add a Tcl_Obj value to the errorInfo field that describes the current
//	error.
//
// Results:
//	None.
//
// Side effects:
//	The value of the Tcl_obj is appended to the errorInfo field. If we are
//	just starting to log an error, errorInfo is initialized from the error
//	message in the interpreter's result.
//
//----------------------------------------------------------------------

func XTcl_AppendObjToErrorInfo(tls *libc.TLS, interp uintptr, objPtr uintptr) { /* tclBasic.c:6800:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var length int32 at bp, 4

	var message uintptr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp)
	}()

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	XTcl_AddObjErrorInfo(tls, interp, message, *(*int32)(unsafe.Pointer(bp /* length */)))
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = objPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_AddErrorInfo --
//
//	Add information to the errorInfo field that describes the current
//	error.
//
// Results:
//	None.
//
// Side effects:
//	The contents of message are appended to the errorInfo field. If we are
//	just starting to log an error, errorInfo is initialized from the error
//	message in the interpreter's result.
//
//----------------------------------------------------------------------

func XTcl_AddErrorInfo(tls *libc.TLS, interp uintptr, message uintptr) { /* tclBasic.c:6834:1: */
	XTcl_AddObjErrorInfo(tls, interp, message, -1)
}

//----------------------------------------------------------------------
//
// Tcl_AddObjErrorInfo --
//
//	Add information to the errorInfo field that describes the current
//	error. This routine differs from Tcl_AddErrorInfo by taking a byte
//	pointer and length.
//
// Results:
//	None.
//
// Side effects:
//	"length" bytes from "message" are appended to the errorInfo field. If
//	"length" is negative, use bytes up to the first NULL byte. If we are
//	just starting to log an error, errorInfo is initialized from the error
//	message in the interpreter's result.
//
//----------------------------------------------------------------------

func XTcl_AddObjErrorInfo(tls *libc.TLS, interp uintptr, message uintptr, length int32) { /* tclBasic.c:6864:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var iPtr uintptr = interp

	// If we are just starting to log an error, errorInfo is initialized from
	// the error message in the interpreter's result.

	*(*int32)(unsafe.Pointer(iPtr + 424)) |= ERR_LEGACY_COPY
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo == uintptr(0) {
		if int32(*(*int8)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).Fresult))) != 0 {
			// The interp's string result is set, apparently by some extension
			// making a deprecated direct write to it. That extension may
			// expect interp->result to continue to be set, so we'll take
			// special pains to avoid clearing it, until we drop support for
			// interp->result completely.

			(*Interp)(unsafe.Pointer(iPtr)).FerrorInfo = XTcl_NewStringObj(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult, -1)
		} else {
			(*Interp)(unsafe.Pointer(iPtr)).FerrorInfo = (*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr
		}
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorInfo)).FrefCount++
		if !(int32((*Interp)(unsafe.Pointer(iPtr)).FerrorCode) != 0) {
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+8211, uintptr(0)))
		}
	}

	// Now append "message" to the end of errorInfo.

	if length != 0 {
		if (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorInfo)).FrefCount > 1 {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			(*Interp)(unsafe.Pointer(iPtr)).FerrorInfo = XTcl_DuplicateObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo)
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorInfo)).FrefCount++
		}
		XTcl_AppendToObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo, message, length)
	}
}

//---------------------------------------------------------------------------
//
// Tcl_VarEvalVA --
//
//	Given a variable number of string arguments, concatenate them all
//	together and execute the result as a Tcl command.
//
// Results:
//	A standard Tcl return result. An error message or other result may be
//	left in the interp's result.
//
// Side effects:
//	Depends on what was done by the command.
//
//---------------------------------------------------------------------------

func XTcl_VarEvalVA(tls *libc.TLS, interp uintptr, argList Va_list) int32 { /* tclBasic.c:6933:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	// var buf Tcl_DString at bp, 216

	var string uintptr
	var result int32

	// Copy the strings one after the other into a single larger string. Use
	// stack-allocated space for small commands, but if the command gets too
	// large than call ckalloc to create the space.

	XTcl_DStringInit(tls, bp)
	for 1 != 0 {
		string = libc.VaUintptr(&argList)
		if string == uintptr(0) {
			break
		}
		XTcl_DStringAppend(tls, bp, string, -1)
	}

	result = XTcl_Eval(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring)
	XTcl_DStringFree(tls, bp)
	return result
}

//----------------------------------------------------------------------
//
// Tcl_VarEval --
//
//	Given a variable number of string arguments, concatenate them all
//	together and execute the result as a Tcl command.
//
// Results:
//	A standard Tcl return result. An error message or other result may be
//	left in interp->result.
//
// Side effects:
//	Depends on what was done by the command.
//
//----------------------------------------------------------------------
// ARGSUSED
func XTcl_VarEval(tls *libc.TLS, interp uintptr, va uintptr) int32 { /* tclBasic.c:6980:1: */
	var argList Va_list
	_ = argList
	var result int32

	argList = va
	result = XTcl_VarEvalVA(tls, interp, argList)
	_ = argList

	return result
}

//----------------------------------------------------------------------
//
// Tcl_GlobalEval --
//
//	Evaluate a command at global level in an interpreter.
//
// Results:
//	A standard Tcl result is returned, and the interp's result is modified
//	accordingly.
//
// Side effects:
//	The command string is executed in interp, and the execution is carried
//	out in the variable context of global level (no functions active),
//	just as if an "uplevel #0" command were being executed.
//
//----------------------------------------------------------------------

func XTcl_GlobalEval(tls *libc.TLS, interp uintptr, command uintptr) int32 { /* tclBasic.c:7015:1: */
	var iPtr uintptr = interp
	var result int32
	var savedVarFramePtr uintptr

	savedVarFramePtr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = (*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr
	result = XTcl_Eval(tls, interp, command)
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = savedVarFramePtr
	return result
}

//----------------------------------------------------------------------
//
// Tcl_SetRecursionLimit --
//
//	Set the maximum number of recursive calls that may be active for an
//	interpreter at once.
//
// Results:
//	The return value is the old limit on nesting for interp.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_SetRecursionLimit(tls *libc.TLS, interp uintptr, depth int32) int32 { /* tclBasic.c:7049:1: */
	var iPtr uintptr = interp
	var old int32

	old = (*Interp)(unsafe.Pointer(iPtr)).FmaxNestingDepth
	if depth > 0 {
		(*Interp)(unsafe.Pointer(iPtr)).FmaxNestingDepth = depth
	}
	return old
}

//----------------------------------------------------------------------
//
// Tcl_AllowExceptions --
//
//	Sets a flag in an interpreter so that exceptions can occur in the next
//	call to Tcl_Eval without them being turned into errors.
//
// Results:
//	None.
//
// Side effects:
//	The TCL_ALLOW_EXCEPTIONS flag gets set in the interpreter's evalFlags
//	structure. See the reference documentation for more details.
//
//----------------------------------------------------------------------

func XTcl_AllowExceptions(tls *libc.TLS, interp uintptr) { /* tclBasic.c:7083:1: */
	var iPtr uintptr = interp

	*(*int32)(unsafe.Pointer(iPtr + 324)) |= TCL_ALLOW_EXCEPTIONS
}

//----------------------------------------------------------------------
//
// Tcl_GetVersion --
//
//	Get the Tcl major, minor, and patchlevel version numbers and the
//	release type. A patch is a release type TCL_FINAL_RELEASE with a
//	patchLevel > 0.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetVersion(tls *libc.TLS, majorV uintptr, minorV uintptr, patchLevelV uintptr, type1 uintptr) { /* tclBasic.c:7110:1: */
	if majorV != uintptr(0) {
		*(*int32)(unsafe.Pointer(majorV)) = TCL_MAJOR_VERSION
	}
	if minorV != uintptr(0) {
		*(*int32)(unsafe.Pointer(minorV)) = TCL_MINOR_VERSION
	}
	if patchLevelV != uintptr(0) {
		*(*int32)(unsafe.Pointer(patchLevelV)) = TCL_RELEASE_SERIAL
	}
	if type1 != uintptr(0) {
		*(*int32)(unsafe.Pointer(type1)) = TCL_FINAL_RELEASE
	}
}

//----------------------------------------------------------------------
//
// Math Functions --
//
//	This page contains the functions that implement all of the built-in
//	math functions for expressions.
//
// Results:
//	Each function returns TCL_OK if it succeeds and pushes an Tcl object
//	holding the result. If it fails it returns TCL_ERROR and leaves an
//	error message in the interpreter's result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sExprCeilFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7150:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var code int32
	// var d float64 at bp, 8

	// var big Mp_int at bp+8, 24

	if objc != 2 {
		sMathFuncWrongNumArgs(tls, interp, 2, objc, objv)
		return TCL_ERROR
	}
	code = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	if code != TCL_OK {
		return TCL_ERROR
	}

	if XTcl_GetBignumFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8) == TCL_OK {
		XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, XTclCeil(tls, bp+8)))
		XTclBN_mp_clear(tls, bp+8)
	} else {
		XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, libc.Xceil(tls, *(*float64)(unsafe.Pointer(bp /* d */)))))
	}
	return TCL_OK
}

func sExprFloorFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7186:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var code int32
	// var d float64 at bp, 8

	// var big Mp_int at bp+8, 24

	if objc != 2 {
		sMathFuncWrongNumArgs(tls, interp, 2, objc, objv)
		return TCL_ERROR
	}
	code = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	if code != TCL_OK {
		return TCL_ERROR
	}

	if XTcl_GetBignumFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8) == TCL_OK {
		XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, XTclFloor(tls, bp+8)))
		XTclBN_mp_clear(tls, bp+8)
	} else {
		XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, libc.Xfloor(tls, *(*float64)(unsafe.Pointer(bp /* d */)))))
	}
	return TCL_OK
}

func sExprIsqrtFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7222:1: */
	bp := tls.Alloc(112)
	defer tls.Free(112)

	// var ptr ClientData at bp+32, 8

	// var type1 int32 at bp+40, 4

	// var d float64 at bp+48, 8

	// var w Tcl_WideInt at bp+80, 8

	// var big Mp_int at bp+56, 24

	var exact int32
	// var root Mp_int at bp+88, 24
	exact = 0 // Flag ==1 if the argument can be represented
	// in a double as an exact integer.

	// Check syntax.

	if !(objc != 2) {
		goto __1
	}
	sMathFuncWrongNumArgs(tls, interp, 2, objc, objv)
	return TCL_ERROR
__1:
	;

	// Make sure that the arg is a number.

	if !(XTclGetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+32, bp+40) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	switch *(*int32)(unsafe.Pointer(bp + 40 /* type1 */)) {
	case TCL_NUMBER_NAN:
		goto __4
	case TCL_NUMBER_DOUBLE:
		goto __5
	case TCL_NUMBER_BIG:
		goto __6
	default:
		goto __7
	}
	goto __3
__4:
	XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48)
	return TCL_ERROR
__5:
	*(*float64)(unsafe.Pointer(bp + 48 /* d */)) = *(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 32))))
	if !(*(*float64)(unsafe.Pointer(bp + 48)) < float64(0)) {
		goto __8
	}
	goto negarg
__8:
	;
	if !(*(*float64)(unsafe.Pointer(bp + 48)) <= 9007199254740991.0) {
		goto __9
	}
	exact = 1
__9:
	;
	if !!(exact != 0) {
		goto __10
	}
	if !(XTcl_InitBignumFromDouble(tls, interp, *(*float64)(unsafe.Pointer(bp + 48)), bp+56) != TCL_OK) {
		goto __11
	}
	return TCL_ERROR
__11:
	;
__10:
	;
	goto __3
__6:
	if !(XTcl_GetBignumFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+56) != TCL_OK) {
		goto __12
	}
	return TCL_ERROR
__12:
	;
	if !((*Mp_int)(unsafe.Pointer(bp+56)).Fsign != 0) {
		goto __13
	}
	XTclBN_mp_clear(tls, bp+56)
	goto negarg
__13:
	;
	goto __3
__7:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp + 80)) = *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+80)
	}() != TCL_OK) {
		goto __14
	}
	return TCL_ERROR
__14:
	;
	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 80)) < int64(0)) {
		goto __15
	}
	goto negarg
__15:
	;
	*(*float64)(unsafe.Pointer(bp + 48 /* d */)) = float64(*(*Tcl_WideInt)(unsafe.Pointer(bp + 80 /* w */)))
	if !(*(*float64)(unsafe.Pointer(bp + 48)) < 9007199254740991.0) {
		goto __16
	}
	exact = 1
__16:
	;
	if !!(exact != 0) {
		goto __17
	}
	XTcl_GetBignumFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+56)
__17:
	;
	goto __3
__3:
	;

	if !(exact != 0) {
		goto __18
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.Int64FromFloat64(libc.Xsqrt(tls, *(*float64)(unsafe.Pointer(bp + 48 /* d */))))))
	goto __19
__18:

	XTclBN_mp_init(tls, bp+88)
	XTclBN_mp_sqrt(tls, bp+56, bp+88)
	XTclBN_mp_clear(tls, bp+56)
	XTcl_SetObjResult(tls, interp, XTcl_NewBignumObj(tls, bp+88))
__19:
	;
	return TCL_OK

negarg:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+8216, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+8249, ts+8255,
		ts+8262, uintptr(0)))
	return TCL_ERROR
}

func sExprSqrtFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7322:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	var code int32
	// var d float64 at bp, 8

	// var big Mp_int at bp+8, 24

	if objc != 2 {
		sMathFuncWrongNumArgs(tls, interp, 2, objc, objv)
		return TCL_ERROR
	}
	code = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	if code != TCL_OK {
		return TCL_ERROR
	}
	if *(*float64)(unsafe.Pointer(bp)) >= 0.0 && (*(*float64)(unsafe.Pointer(bp)) > 1.79769313486231570814527423731704357e+308 || *(*float64)(unsafe.Pointer(bp)) < -1.79769313486231570814527423731704357e+308) &&
		XTcl_GetBignumFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8) == TCL_OK {
		// var root Mp_int at bp+32, 24

		XTclBN_mp_init(tls, bp+32)
		XTclBN_mp_sqrt(tls, bp+8, bp+32)
		XTclBN_mp_clear(tls, bp+8)
		XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, XTclBignumToDouble(tls, bp+32)))
		XTclBN_mp_clear(tls, bp+32)
	} else {
		XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, libc.Xsqrt(tls, *(*float64)(unsafe.Pointer(bp /* d */)))))
	}
	return TCL_OK
}

func sExprUnaryFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7363:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var code int32
	// var d float64 at bp, 8

	var func1 uintptr = clientData

	if objc != 2 {
		sMathFuncWrongNumArgs(tls, interp, 2, objc, objv)
		return TCL_ERROR
	}
	code = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	if code != TCL_OK {
		return TCL_ERROR
	}
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
	return sCheckDoubleResult(tls, interp, (*struct {
		f func(*libc.TLS, float64) float64
	})(unsafe.Pointer(&struct{ uintptr }{func1})).f(tls, *(*float64)(unsafe.Pointer(bp /* d */))))
}

func sCheckDoubleResult(tls *libc.TLS, interp uintptr, dResult float64) int32 { /* tclBasic.c:7396:1: */
	if libc.X__builtin_isnan(tls, dResult) != 0 {
		XTclExprFloatError(tls, interp, dResult)
		return TCL_ERROR
	}
	if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ERANGE && (dResult == 0.0 || (dResult > 1.79769313486231570814527423731704357e+308 || dResult < -1.79769313486231570814527423731704357e+308)) {
		// When ERANGE signals under/overflow, just accept 0.0 or +/-Inf
	} else if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != 0 {
		// Report other errno values as errors.

		XTclExprFloatError(tls, interp, dResult)
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, dResult))
	return TCL_OK
}

func sExprBinaryFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7423:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var code int32
	// var d1 float64 at bp, 8

	// var d2 float64 at bp+8, 8

	var func1 uintptr = clientData

	if objc != 3 {
		sMathFuncWrongNumArgs(tls, interp, 3, objc, objv)
		return TCL_ERROR
	}
	code = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	if code != TCL_OK {
		return TCL_ERROR
	}
	code = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+8)
	if code != TCL_OK {
		return TCL_ERROR
	}
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
	return sCheckDoubleResult(tls, interp, (*struct {
		f func(*libc.TLS, float64, float64) float64
	})(unsafe.Pointer(&struct{ uintptr }{func1})).f(tls, *(*float64)(unsafe.Pointer(bp /* d1 */)), *(*float64)(unsafe.Pointer(bp + 8 /* d2 */))))
}

func sExprAbsFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7467:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	// var ptr ClientData at bp, 8

	// var type1 int32 at bp+8, 4

	// var big Mp_int at bp+16, 24

	var string uintptr
	var l int64
	// var d float64 at bp+40, 8

	// var d1 float64 at bp+48, 8

	if !(objc != 2) {
		goto __1
	}
	sMathFuncWrongNumArgs(tls, interp, 2, objc, objv)
	return TCL_ERROR
__1:
	;

	if !(XTclGetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, bp+8) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 8)) == TCL_NUMBER_LONG) {
		goto __3
	}
	l = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp))))

	if !(l > int64(0)) {
		goto __4
	}
	goto unChanged
	goto __5
__4:
	if !(l == int64(0)) {
		goto __6
	}
	string = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
	if !(string != 0) {
		goto __8
	}
__9:
	if !(int32(*(*int8)(unsafe.Pointer(string))) != '0') {
		goto __10
	}
	if !(int32(*(*int8)(unsafe.Pointer(string))) == '-') {
		goto __11
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewLongObj(tls, int64(0)))
	return TCL_OK
__11:
	;
	string++
	goto __9
__10:
	;
__8:
	;
	goto unChanged
	goto __7
__6:
	if !(l == -0x7fffffffffffffff-1) {
		goto __12
	}
	XTclBNInitBignumFromLong(tls, bp+16, l)
	goto tooLarge
__12:
	;
__7:
	;
__5:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewLongObj(tls, -l))
	return TCL_OK
__3:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 8)) == TCL_NUMBER_DOUBLE) {
		goto __13
	}
	*(*float64)(unsafe.Pointer(bp + 40 /* d */)) = *(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp))))

	// We need to distinguish here between positive 0.0 and negative -0.0.
	// [Bug 2954959]

	if !(*(*float64)(unsafe.Pointer(bp + 40)) == -libc.Float64FromFloat64(0.0)) {
		goto __14
	}
	if !!(libc.Xmemcmp(tls, bp+40, uintptr(unsafe.Pointer(&poszero)), uint64(unsafe.Sizeof(float64(0)))) != 0) {
		goto __16
	}
	goto unChanged
__16:
	;
	goto __15
__14:
	if !(*(*float64)(unsafe.Pointer(bp + 40)) > -libc.Float64FromFloat64(0.0)) {
		goto __17
	}
	goto unChanged
__17:
	;
__15:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, -*(*float64)(unsafe.Pointer(bp + 40 /* d */))))
	return TCL_OK
__13:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 8)) == TCL_NUMBER_BIG) {
		goto __18
	}
	if !(XTclBN_mp_cmp_d(tls, *(*ClientData)(unsafe.Pointer(bp)), uint32(0)) == -1) {
		goto __19
	}
	XTcl_GetBignumFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16)
tooLarge:
	XTclBN_mp_neg(tls, bp+16, bp+16)
	XTcl_SetObjResult(tls, interp, XTcl_NewBignumObj(tls, bp+16))
	goto __20
__19:
unChanged:
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
__20:
	;
	return TCL_OK
__18:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 8)) == TCL_NUMBER_NAN) {
		goto __21
	}

	XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48)
	return TCL_ERROR
__21:
	;
	return TCL_OK
}

var poszero float64 = 0.0 /* tclBasic.c:7514:22 */

func sExprBoolFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7576:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var value int32 at bp, 4

	if objc != 2 {
		sMathFuncWrongNumArgs(tls, interp, 2, objc, objv)
		return TCL_ERROR
	}
	if XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(*(*int32)(unsafe.Pointer(bp)) != 0)))
	return TCL_OK
}

func sExprDoubleFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7597:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var dResult float64 at bp, 8

	if objc != 2 {
		sMathFuncWrongNumArgs(tls, interp, 2, objc, objv)
		return TCL_ERROR
	}
	if XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, *(*float64)(unsafe.Pointer(bp /* dResult */))))
	return TCL_OK
}

func sExprEntierFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7624:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	// var d float64 at bp+40, 8

	// var type1 int32 at bp+8, 4

	// var ptr ClientData at bp, 8

	if objc != 2 {
		sMathFuncWrongNumArgs(tls, interp, 2, objc, objv)
		return TCL_ERROR
	}
	if XTclGetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, bp+8) != TCL_OK {
		return TCL_ERROR
	}

	if *(*int32)(unsafe.Pointer(bp + 8)) == TCL_NUMBER_DOUBLE {
		*(*float64)(unsafe.Pointer(bp + 40 /* d */)) = *(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp))))
		if *(*float64)(unsafe.Pointer(bp + 40)) < float64(0x7fffffffffffffff) && *(*float64)(unsafe.Pointer(bp + 40)) > float64(-0x7fffffffffffffff-1) {
			var result int64 = int64(*(*float64)(unsafe.Pointer(bp + 40 /* d */)))

			XTcl_SetObjResult(tls, interp, XTcl_NewLongObj(tls, result))
			return TCL_OK
		} else {
			// var big Mp_int at bp+16, 24

			if XTcl_InitBignumFromDouble(tls, interp, *(*float64)(unsafe.Pointer(bp + 40)), bp+16) != TCL_OK {
				// Infinity
				return TCL_ERROR
			}
			XTcl_SetObjResult(tls, interp, XTcl_NewBignumObj(tls, bp+16))
			return TCL_OK
		}
	}

	if *(*int32)(unsafe.Pointer(bp + 8)) != TCL_NUMBER_NAN {
		// All integers are already of integer type.

		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		return TCL_OK
	}

	// Get the error message for NaN.

	XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+40)
	return TCL_ERROR
}

func sExprIntFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7687:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// var iResult int64 at bp, 8

	var objPtr uintptr
	if sExprEntierFunc(tls, uintptr(0), interp, objc, objv) != TCL_OK {
		return TCL_ERROR
	}
	objPtr = XTcl_GetObjResult(tls, interp)
	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 { *(*int64)(unsafe.Pointer(bp)) = *(*int64)(unsafe.Pointer(objPtr + 32)); return TCL_OK }()
		}
		return XTcl_GetLongFromObj(tls, uintptr(0), objPtr, bp)
	}() != TCL_OK {
		// Truncate the bignum; keep only bits in long range.

		// var big Mp_int at bp+8, 24

		XTcl_GetBignumFromObj(tls, uintptr(0), objPtr, bp+8)
		XTclBN_mp_mod_2d(tls, bp+8, int32(uint64(8)*uint64(unsafe.Sizeof(int64(0)))), bp+8)
		objPtr = XTcl_NewBignumObj(tls, bp+8)
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			*(*int64)(unsafe.Pointer(bp)) = *(*int64)(unsafe.Pointer(objPtr + 32))
		} else {
			XTcl_GetLongFromObj(tls, uintptr(0), objPtr, bp)
		}
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewLongObj(tls, *(*int64)(unsafe.Pointer(bp /* iResult */))))
	return TCL_OK
}

func sExprWideFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7719:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// var wResult Tcl_WideInt at bp, 8

	var objPtr uintptr

	if sExprEntierFunc(tls, uintptr(0), interp, objc, objv) != TCL_OK {
		return TCL_ERROR
	}
	objPtr = XTcl_GetObjResult(tls, interp)
	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp)) = *(*int64)(unsafe.Pointer(objPtr + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, uintptr(0), objPtr, bp)
	}() != TCL_OK {
		// Truncate the bignum; keep only bits in wide int range.

		// var big Mp_int at bp+8, 24

		XTcl_GetBignumFromObj(tls, uintptr(0), objPtr, bp+8)
		XTclBN_mp_mod_2d(tls, bp+8, int32(uint64(8)*uint64(unsafe.Sizeof(Tcl_WideInt(0)))), bp+8)
		objPtr = XTcl_NewBignumObj(tls, bp+8)
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			*(*Tcl_WideInt)(unsafe.Pointer(bp)) = *(*int64)(unsafe.Pointer(objPtr + 32))
		} else {
			XTcl_GetWideIntFromObj(tls, uintptr(0), objPtr, bp)
		}
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, *(*Tcl_WideInt)(unsafe.Pointer(bp /* wResult */))))
	return TCL_OK
}

func sExprRandFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7752:1: */
	var iPtr uintptr = interp
	var dResult float64
	var tmp int64 // Algorithm assumes at least 32 bits. Only
	// long guarantees that. See below.
	var oResult uintptr

	if objc != 1 {
		sMathFuncWrongNumArgs(tls, interp, 1, objc, objv)
		return TCL_ERROR
	}

	if !((*Interp)(unsafe.Pointer(iPtr)).Fflags&RAND_SEED_INITIALIZED != 0) {
		*(*int32)(unsafe.Pointer(iPtr + 424)) |= RAND_SEED_INITIALIZED

		// To ensure different seeds in different threads (bug #416643),
		// take into consideration the thread this interp is running in.

		(*Interp)(unsafe.Pointer(iPtr)).FrandSeed = int64(XTclpGetClicks(tls) + uint64(int32(XTcl_GetCurrentThread(tls))<<12))

		// Make sure 1 <= randSeed <= (2^31) - 2. See below.

		*(*int64)(unsafe.Pointer(iPtr + 432)) &= int64(uint64(0x7FFFFFFF))
		if (*Interp)(unsafe.Pointer(iPtr)).FrandSeed == int64(0) || (*Interp)(unsafe.Pointer(iPtr)).FrandSeed == int64(0x7FFFFFFF) {
			*(*int64)(unsafe.Pointer(iPtr + 432)) ^= int64(123459876)
		}
	}

	// Generate the random number using the linear congruential generator
	// defined by the following recurrence:
	//		seed = ( IA * seed ) mod IM
	// where IA is 16807 and IM is (2^31) - 1. The recurrence maps a seed in
	// the range [1, IM - 1] to a new seed in that same range. The recurrence
	// maps IM to 0, and maps 0 back to 0, so those two values must not be
	// allowed as initial values of seed.
	//
	// In order to avoid potential problems with integer overflow, the
	// recurrence is implemented in terms of additional constants IQ and IR
	// such that
	//		IM = IA*IQ + IR
	// None of the operations in the implementation overflows a 32-bit signed
	// integer, and the C type long is guaranteed to be at least 32 bits wide.
	//
	// For more details on how this algorithm works, refer to the following
	// papers:
	//
	//	S.K. Park & K.W. Miller, "Random number generators: good ones are hard
	//	to find," Comm ACM 31(10):1192-1201, Oct 1988
	//
	//	W.H. Press & S.A. Teukolsky, "Portable random number generators,"
	//	Computers in Physics 6(5):522-524, Sep/Oct 1992.

	tmp = (*Interp)(unsafe.Pointer(iPtr)).FrandSeed / int64(RAND_IQ)
	(*Interp)(unsafe.Pointer(iPtr)).FrandSeed = int64(RAND_IA)*((*Interp)(unsafe.Pointer(iPtr)).FrandSeed-tmp*int64(RAND_IQ)) - int64(RAND_IR)*tmp
	if (*Interp)(unsafe.Pointer(iPtr)).FrandSeed < int64(0) {
		*(*int64)(unsafe.Pointer(iPtr + 432)) += int64(RAND_IM)
	}

	// Since the recurrence keeps seed values in the range [1, RAND_IM - 1],
	// dividing by RAND_IM yields a double in the range (0, 1).

	dResult = float64((*Interp)(unsafe.Pointer(iPtr)).FrandSeed) * (float64(1.0) / float64(RAND_IM))

	// Push a Tcl object with the result.

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				oResult = XTclThreadAllocObj(tls)
			} else {
				oResult = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(oResult + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(oResult)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(oResult)).Fbytes = uintptr(0)
		*(*float64)(unsafe.Pointer(oResult + 32)) = dResult
		(*Tcl_Obj)(unsafe.Pointer(oResult)).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType))
		{
		}
	}
	XTcl_SetObjResult(tls, interp, oResult)
	return TCL_OK
}

func sExprRoundFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7845:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	// var d float64 at bp+48, 8

	// var ptr ClientData at bp, 8

	// var type1 int32 at bp+8, 4

	if objc != 2 {
		sMathFuncWrongNumArgs(tls, interp, 2, objc, objv)
		return TCL_ERROR
	}

	if XTclGetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, bp+8) != TCL_OK {
		return TCL_ERROR
	}

	if *(*int32)(unsafe.Pointer(bp + 8)) == TCL_NUMBER_DOUBLE {
		var fractPart float64
		// var intPart float64 at bp+16, 8

		var max int64 = 0x7fffffffffffffff
		var min int64 = -0x7fffffffffffffff - 1

		fractPart = libc.Xmodf(tls, *(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp)))), bp+16)
		if fractPart <= -0.5 {
			min++
		} else if fractPart >= 0.5 {
			max--
		}
		if *(*float64)(unsafe.Pointer(bp + 16)) >= float64(max) || *(*float64)(unsafe.Pointer(bp + 16)) <= float64(min) {
			// var big Mp_int at bp+24, 24

			if XTcl_InitBignumFromDouble(tls, interp, *(*float64)(unsafe.Pointer(bp + 16)), bp+24) != TCL_OK {
				// Infinity
				return TCL_ERROR
			}
			if fractPart <= -0.5 {
				XTclBN_mp_sub_d(tls, bp+24, uint32(1), bp+24)
			} else if fractPart >= 0.5 {
				XTclBN_mp_add_d(tls, bp+24, uint32(1), bp+24)
			}
			XTcl_SetObjResult(tls, interp, XTcl_NewBignumObj(tls, bp+24))
			return TCL_OK
		} else {
			var result int64 = int64(*(*float64)(unsafe.Pointer(bp + 16 /* intPart */)))

			if fractPart <= -0.5 {
				result--
			} else if fractPart >= 0.5 {
				result++
			}
			XTcl_SetObjResult(tls, interp, XTcl_NewLongObj(tls, result))
			return TCL_OK
		}
	}

	if *(*int32)(unsafe.Pointer(bp + 8)) != TCL_NUMBER_NAN {
		// All integers are already rounded

		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		return TCL_OK
	}

	// Get the error message for NaN.

	XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48)
	return TCL_ERROR
}

func sExprSrandFunc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:7920:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var iPtr uintptr = interp
	*(*int64)(unsafe.Pointer(bp /* i */)) = int64(0) // Initialized to avoid compiler warning.

	// Convert argument and use it to reset the seed.

	if objc != 2 {
		sMathFuncWrongNumArgs(tls, interp, 2, objc, objv)
		return TCL_ERROR
	}

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int64)(unsafe.Pointer(bp)) = *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetLongFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}() != TCL_OK {
		var objPtr uintptr
		// var big Mp_int at bp+8, 24

		if XTcl_GetBignumFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8) != TCL_OK {
			// TODO: more ::errorInfo here? or in caller?
			return TCL_ERROR
		}

		XTclBN_mp_mod_2d(tls, bp+8, int32(uint64(8)*uint64(unsafe.Sizeof(int64(0)))), bp+8)
		objPtr = XTcl_NewBignumObj(tls, bp+8)
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			*(*int64)(unsafe.Pointer(bp)) = *(*int64)(unsafe.Pointer(objPtr + 32))
		} else {
			XTcl_GetLongFromObj(tls, uintptr(0), objPtr, bp)
		}
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	// Reset the seed. Make sure 1 <= randSeed <= 2^31 - 2. See comments in
	// ExprRandFunc for more details.

	*(*int32)(unsafe.Pointer(iPtr + 424)) |= RAND_SEED_INITIALIZED
	(*Interp)(unsafe.Pointer(iPtr)).FrandSeed = *(*int64)(unsafe.Pointer(bp /* i */))
	*(*int64)(unsafe.Pointer(iPtr + 432)) &= int64(uint64(0x7FFFFFFF))
	if (*Interp)(unsafe.Pointer(iPtr)).FrandSeed == int64(0) || (*Interp)(unsafe.Pointer(iPtr)).FrandSeed == int64(0x7FFFFFFF) {
		*(*int64)(unsafe.Pointer(iPtr + 432)) ^= int64(123459876)
	}

	// To avoid duplicating the random number generation code we simply clean
	// up our state and call the real random number function. That function
	// will always succeed.

	return sExprRandFunc(tls, clientData, interp, 1, objv)
}

//----------------------------------------------------------------------
//
// MathFuncWrongNumArgs --
//
//	Generate an error message when a math function presents the wrong
//	number of arguments.
//
// Results:
//	None.
//
// Side effects:
//	An error message is stored in the interpreter result.
//
//----------------------------------------------------------------------

func sMathFuncWrongNumArgs(tls *libc.TLS, interp uintptr, expected int32, found int32, objv uintptr) { /* tclBasic.c:7994:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var name uintptr = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
	var tail uintptr = name + uintptr(libc.Xstrlen(tls, name))

	for tail > name+uintptr(1) {
		tail--
		if int32(*(*int8)(unsafe.Pointer(tail))) == ':' && int32(*(*int8)(unsafe.Pointer(tail + libc.UintptrFromInt32(-1)))) == ':' {
			name = tail + uintptr(1)
			break
		}
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+8304,
		libc.VaList(bp, func() uintptr {
			if found < expected {
				return ts + 8340 /* "not enough" */
			}
			return ts + 8351 /* "too many" */
		}(), name)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+8360, uintptr(0)))
}

//----------------------------------------------------------------------
//
// Tcl_NRCallObjProc --
//
//	This function calls an objProc directly while managing things properly
//	if it happens to be an NR objProc. It is meant to be used by extenders
//	that provide an NR implementation of a command, as this function
//	permits a trivial coding of the non-NR objProc.
//
// Results:
//	The return value is a standard Tcl completion code such as TCL_OK or
//	TCL_ERROR. A result or error message is left in interp's result.
//
// Side effects:
//	Depends on the objProc.
//
//----------------------------------------------------------------------

func XTcl_NRCallObjProc(tls *libc.TLS, interp uintptr, objProc uintptr, clientData ClientData, objc int32, objv uintptr) int32 { /* tclBasic.c:8180:1: */
	var rootPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sDispatch}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = objProc
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = clientData
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(Intptr_t(objc))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = objv
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return XTclNRRunCallbacks(tls, interp, TCL_OK, rootPtr)
}

//----------------------------------------------------------------------
//
// Tcl_NRCreateCommand --
//
//	Define a new NRE-enabled object-based command in a command table.
//
// Results:
//	The return value is a token for the command, which can be used in
//	future calls to Tcl_GetCommandName.
//
// Side effects:
//	If no command named "cmdName" already exists for interp, one is
//	created. Otherwise, if a command does exist, then if the object-based
//	Tcl_ObjCmdProc is TclInvokeStringCommand, we assume Tcl_CreateCommand
//	was called previously for the same command and just set its
//	Tcl_ObjCmdProc to the argument "proc"; otherwise, we delete the old
//	command.
//
//	In the future, during bytecode evaluation when "cmdName" is seen as
//	the name of a command by Tcl_EvalObj or Tcl_Eval, the object-based
//	Tcl_ObjCmdProc proc will be called. When the command is deleted from
//	the table, deleteProc will be called. See the manual entry for details
//	on the calling sequence.
//
//----------------------------------------------------------------------

func XTcl_NRCreateCommand(tls *libc.TLS, interp uintptr, cmdName uintptr, proc uintptr, nreProc uintptr, clientData ClientData, deleteProc uintptr) Tcl_Command { /* tclBasic.c:8223:1: */
	var cmdPtr uintptr = XTcl_CreateObjCommand(tls, interp, cmdName, proc, clientData, deleteProc)

	(*Command)(unsafe.Pointer(cmdPtr)).FnreProc = nreProc
	return cmdPtr
}

func XTclNRCreateCommandInNs(tls *libc.TLS, interp uintptr, cmdName uintptr, nsPtr uintptr, proc uintptr, nreProc uintptr, clientData ClientData, deleteProc uintptr) Tcl_Command { /* tclBasic.c:8249:1: */
	var cmdPtr uintptr = XTclCreateObjCommandInNs(tls, interp, cmdName, nsPtr, proc, clientData, deleteProc)

	(*Command)(unsafe.Pointer(cmdPtr)).FnreProc = nreProc
	return cmdPtr
}

// ***************************************************************************
//
// Stuff for the public api
//

func XTcl_NREvalObj(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32) int32 { /* tclBasic.c:8269:1: */
	return XTclNREvalObjEx(tls, interp, objPtr, flags, uintptr(0), -0x7fffffff-1)
}

func XTcl_NREvalObjv(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, flags int32) int32 { /* tclBasic.c:8278:1: */
	return XTclNREvalObjv(tls, interp, objc, objv, flags, uintptr(0))
}

func XTcl_NRCmdSwap(tls *libc.TLS, interp uintptr, cmd Tcl_Command, objc int32, objv uintptr, flags int32) int32 { /* tclBasic.c:8293:1: */
	return XTclNREvalObjv(tls, interp, objc, objv, flags|TCL_EVAL_NOERR,
		cmd)
}

// ****************************************************************************
//
// Tailcall related code
//
//
// The steps of the tailcall dance are as follows:
//
//   1. when [tailcall] is invoked, it stores the corresponding callback in
//      the current CallFrame and returns TCL_RETURN
//   2. when the CallFrame is popped, it calls TclSetTailcall to store the
//      callback in the proper NRCommand callback - the spot where the command
//      that pushed the CallFrame is completely cleaned up
//   3. when the NRCommand callback runs, it schedules the tailcall callback
//      to run immediately after it returns
//
//   One delicate point is to properly define the NRCommand where the tailcall
//   will execute. There are functions whose purpose is to help define the
//   precise spot:
//     TclMarkTailcall: if the NEXT command to be pushed tailcalls, execution
//         should continue right here
//     TclSkipTailcall:  if the NEXT command to be pushed tailcalls, execution
//         should continue after the CURRENT command is fully returned ("skip
//         the next command: we are redirecting to it, tailcalls should run
//         after WE return")
//     TclPushTailcallPoint: the search for a tailcalling spot cannot traverse
//         this point. This is special for OO, as some of the oo constructs
//         that behave like commands may not push an NRCommand callback.

func XTclMarkTailcall(tls *libc.TLS, interp uintptr) { /* tclBasic.c:8333:1: */
	var iPtr uintptr = interp

	if (*Interp)(unsafe.Pointer(iPtr)).FdeferredCallbacks == uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sNRCommand}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
		(*Interp)(unsafe.Pointer(iPtr)).FdeferredCallbacks = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	}
}

func XTclSkipTailcall(tls *libc.TLS, interp uintptr) { /* tclBasic.c:8346:1: */
	var iPtr uintptr = interp

	XTclMarkTailcall(tls, interp)
	*(*ClientData)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FdeferredCallbacks + 8 + 1*8)) = uintptr(int64(1))
}

func XTclPushTailcallPoint(tls *libc.TLS, interp uintptr) { /* tclBasic.c:8356:1: */
	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sNRCommand}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	(*Interp)(unsafe.Pointer(interp)).FnumLevels++
}

//----------------------------------------------------------------------
//
// TclSetTailcall --
//
//	Splice a tailcall command in the proper spot of the NRE callback
//	stack, so that it runs at the right time.
//
//----------------------------------------------------------------------

func XTclSetTailcall(tls *libc.TLS, interp uintptr, listPtr uintptr) { /* tclBasic.c:8376:1: */
	// Find the splicing spot: right before the NRCommand of the thing
	// being tailcalled. Note that we skip NRCommands marked by a 1 in data[1]
	// (used by command redirectors).

	var runPtr uintptr

	for runPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr; runPtr != 0; runPtr = (*NRE_callback)(unsafe.Pointer(runPtr)).FnextPtr {
		if (*NRE_callback)(unsafe.Pointer(runPtr)).FprocPtr == *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sNRCommand})) && !(int32(*(*ClientData)(unsafe.Pointer(runPtr + 8 + 1*8))) != 0) {
			break
		}
	}
	if !(runPtr != 0) {
		XTcl_Panic(tls, ts+8370, 0)
	}
	*(*ClientData)(unsafe.Pointer(runPtr + 8 + 1*8)) = listPtr
}

//----------------------------------------------------------------------
//
// TclNRTailcallObjCmd --
//
//	Prepare the tailcall as a list and store it in the current
//	varFrame. When the frame is later popped the tailcall will be spliced
//	at the proper place.
//
// Results:
//	The first NRCommand callback that is not marked to be skipped is
//	updated so that its data[1] field contains the tailcall list.
//
//----------------------------------------------------------------------

func XTclNRTailcallObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:8417:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var iPtr uintptr = interp

	if objc < 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+8435)
		return TCL_ERROR
	}

	if !((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FisProcCallFrame&1 != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+8455, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+8513, ts+8522, uintptr(0)))
		return TCL_ERROR
	}

	// Invocation without args just clears a scheduled tailcall; invocation
	// with an argument replaces any previously scheduled tailcall.

	if (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FtailcallPtr != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FtailcallPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FtailcallPtr = uintptr(0)
	}

	// Create the callback to actually evaluate the tailcalled
	// command, then set it in the varFrame so that PopCallFrame can use it
	// at the proper time.

	if objc > 1 {
		var listPtr uintptr
		var nsObjPtr uintptr
		var nsPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr

		// The tailcall data is in a Tcl list: the first element is the
		// namespace, the rest the command to be tailcalled.

		nsObjPtr = XTcl_NewStringObj(tls, (*Tcl_Namespace)(unsafe.Pointer(nsPtr)).FfullName, -1)
		listPtr = XTcl_NewListObj(tls, objc, objv)
		XTclListObjSetElement(tls, interp, listPtr, 0, nsObjPtr)

		(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FtailcallPtr = listPtr
	}
	return TCL_RETURN
}

//----------------------------------------------------------------------
//
// TclNRTailcallEval --
//
//	This NREcallback actually causes the tailcall to be evaluated.
//
//----------------------------------------------------------------------

func XTclNRTailcallEval(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:8483:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var iPtr uintptr = interp
	var listPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var nsObjPtr uintptr
	// var nsPtr uintptr at bp+16, 8

	// var objc int32 at bp, 4

	// var objv uintptr at bp+8, 8

	XTcl_ListObjGetElements(tls, interp, listPtr, bp, bp+8)
	nsObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* objv */))))

	if result == TCL_OK {
		result = XTclGetNamespaceFromObj(tls, interp, nsObjPtr, bp+16)
	}

	if result != TCL_OK {
		// Tailcall execution was preempted, eg by an intervening catch or by
		// a now-gone namespace: cleanup and return.

		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = listPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return result
	}

	// Perform the tailcall

	XTclMarkTailcall(tls, interp)
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _callbackPtr uintptr
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{XTclNRReleaseValues}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = listPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	(*Interp)(unsafe.Pointer(iPtr)).FlookupNsPtr = *(*uintptr)(unsafe.Pointer(bp + 16 /* nsPtr */))
	return XTclNREvalObjv(tls, interp, *(*int32)(unsafe.Pointer(bp))-1, *(*uintptr)(unsafe.Pointer(bp + 8))+uintptr(1)*8, 0, uintptr(0))
}

func XTclNRReleaseValues(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:8522:1: */
	var i int32 = 0
	for i < 4 {
		if *(*ClientData)(unsafe.Pointer(data + uintptr(i)*8)) != 0 {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = *(*ClientData)(unsafe.Pointer(data + uintptr(i)*8))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		} else {
			break
		}
		i++
	}
	return result
}

func XTcl_NRAddCallback(tls *libc.TLS, interp uintptr, postProcPtr uintptr, data0 ClientData, data1 ClientData, data2 ClientData, data3 ClientData) { /* tclBasic.c:8541:1: */
	if !(postProcPtr != 0) {
		XTcl_Panic(tls, ts+8530, 0)
	}
	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = postProcPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = data0
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = data1
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = data2
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = data3
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
}

//----------------------------------------------------------------------
//
// TclNRCoroutineObjCmd -- (and friends)
//
//	This object-based function is invoked to process the "coroutine" Tcl
//	command. It is heavily based on "apply".
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	A new procedure gets created.
//
// ** FIRST EXPERIMENTAL IMPLEMENTATION **
//
// It is fairly amateurish and not up to our standards - mainly in terms of
// error messages and [info] interaction. Just to test the infrastructure in
// teov and tebc.
//----------------------------------------------------------------------

func XTclNRYieldObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:8580:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var corPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcorPtr

	if objc > 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+8569)
		return TCL_ERROR
	}

	if !(corPtr != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+8583, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+8623, ts+8633, uintptr(0)))
		return TCL_ERROR
	}

	if objc == 2 {
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{XTclNRCoroutineActivateCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = corPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = clientData
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return TCL_OK
}

func XTclNRYieldToObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:8611:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	var corPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcorPtr
	var listPtr uintptr
	var nsObjPtr uintptr
	var nsPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+8647)
		return TCL_ERROR
	}

	if !(corPtr != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+8665, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+8623, ts+8633, uintptr(0)))
		return TCL_ERROR
	}

	if (*Namespace)(unsafe.Pointer(nsPtr)).Fflags&NS_DYING != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+8707, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+8623, ts+8743,
			uintptr(0)))
		return TCL_ERROR
	}

	// Add the tailcall in the caller env, then just yield.
	//
	// This is essentially code from TclNRTailcallObjCmd

	listPtr = XTcl_NewListObj(tls, objc, objv)
	nsObjPtr = XTcl_NewStringObj(tls, (*Tcl_Namespace)(unsafe.Pointer(nsPtr)).FfullName, -1)
	XTclListObjSetElement(tls, interp, listPtr, 0, nsObjPtr)

	// Add the callback in the caller's env, then instruct TEBC to yield.

	(*Interp)(unsafe.Pointer(interp)).FexecEnvPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr
	XTclSetTailcall(tls, interp, listPtr)
	(*Interp)(unsafe.Pointer(interp)).FexecEnvPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr

	return XTclNRYieldObjCmd(tls, uintptr(int64(int32(uintptr(0))+1)), interp, 1, objv)
}

func sRewindCoroutineCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:8663:1: */
	return XTcl_RestoreInterpState(tls, interp, *(*ClientData)(unsafe.Pointer(data)))
}

func sRewindCoroutine(tls *libc.TLS, corPtr uintptr, result int32) int32 { /* tclBasic.c:8672:1: */
	var interp uintptr = (*ExecEnv1)(unsafe.Pointer((*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr)).Finterp
	var state Tcl_InterpState = XTcl_SaveInterpState(tls, interp, result)

	(*ExecEnv1)(unsafe.Pointer((*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr)).Frewind = 1
	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sRewindCoroutineCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = state
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return XTclNRInterpCoroutine(tls, corPtr, interp, 0, uintptr(0))
}

func sDeleteCoroutine(tls *libc.TLS, clientData ClientData) { /* tclBasic.c:8690:1: */
	var corPtr uintptr = clientData
	var interp uintptr = (*ExecEnv1)(unsafe.Pointer((*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr)).Finterp
	var rootPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr

	if (*CoroutineData)(unsafe.Pointer(corPtr)).FstackLevel == uintptr(0) {
		XTclNRRunCallbacks(tls, interp, sRewindCoroutine(tls, corPtr, TCL_OK), rootPtr)
	}
}

func sNRCoroutineCallerCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:8703:1: */
	var corPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var cmdPtr uintptr = (*CoroutineData)(unsafe.Pointer(corPtr)).FcmdPtr

	// This is the last callback in the caller execEnv, right before switching
	// to the coroutine's

	if !(int32((*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr) != 0) {
		// The execEnv was wound down but not deleted for our sake. We finish
		// the job here. The caller context has already been restored.

		XTclpFree(tls, corPtr)
		return result
	}

	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FframePtr = (*Interp)(unsafe.Pointer(interp)).FframePtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FvarFramePtr = (*Interp)(unsafe.Pointer(interp)).FvarFramePtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FcmdFramePtr = (*Interp)(unsafe.Pointer(interp)).FcmdFramePtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FlineLABCPtr = (*Interp)(unsafe.Pointer(interp)).FlineLABCPtr
	(*Interp)(unsafe.Pointer(interp)).FframePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FframePtr
	(*Interp)(unsafe.Pointer(interp)).FvarFramePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FvarFramePtr
	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr
	(*Interp)(unsafe.Pointer(interp)).FlineLABCPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FlineLABCPtr

	if (*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_IS_DELETED != 0 {
		// The command was deleted while it was running: wind down the
		// execEnv, this will do the complete cleanup. RewindCoroutine will
		// restore both the caller's context and interp state.

		return sRewindCoroutine(tls, corPtr, result)
	}

	return result
}

func sNRCoroutineExitCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:8749:1: */
	var corPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var cmdPtr uintptr = (*CoroutineData)(unsafe.Pointer(corPtr)).FcmdPtr

	// This runs at the bottom of the Coroutine's execEnv: it will be executed
	// when the coroutine returns or is wound down, but not when it yields. It
	// deletes the coroutine and restores the caller's environment.

	(*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc = uintptr(0)
	XTcl_DeleteCommandFromToken(tls, interp, cmdPtr)
	if libc.PostDecInt32(&(*Command)(unsafe.Pointer(cmdPtr)).FrefCount, 1) <= 1 {
		XTclpFree(tls, cmdPtr)
	}

	(*ExecEnv1)(unsafe.Pointer((*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr)).FcorPtr = uintptr(0)
	XTclDeleteExecEnv(tls, (*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr)
	(*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr = uintptr(0)

	(*CoroutineData)(unsafe.Pointer(corPtr)).FstackLevel = uintptr(0)

	// #280.
	// Drop the coroutine-owned copy of the lineLABCPtr hashtable for literal
	// command arguments in bytecode.

	XTcl_DeleteHashTable(tls, (*CoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr)
	XTclpFree(tls, (*CoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr)
	(*CoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr = uintptr(0)

	(*Interp)(unsafe.Pointer(interp)).FframePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FframePtr
	(*Interp)(unsafe.Pointer(interp)).FvarFramePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FvarFramePtr
	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr
	(*Interp)(unsafe.Pointer(interp)).FlineLABCPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FlineLABCPtr
	(*Interp)(unsafe.Pointer(interp)).FexecEnvPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr
	(*Interp)(unsafe.Pointer(interp)).FnumLevels++

	return result
}

//----------------------------------------------------------------------
//
// TclNRCoroutineActivateCallback --
//
//      This is the workhorse for coroutines: it implements both yield and
//      resume.
//
//      It is important that both be implemented in the same callback: the
//      detection of the impossibility to suspend due to a busy C-stack relies
//      on the precise position of a local variable in the stack. We do not
//      want the compiler to play tricks on us, either by moving things around
//      or inlining.
//
//----------------------------------------------------------------------

func XTclNRCoroutineActivateCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:8814:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var corPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var type1 int32 = int32(*(*ClientData)(unsafe.Pointer(data + 1*8)))
	var numLevels int32
	// var unused int32 at bp+32, 4

	var stackLevel uintptr = bp + 32 /* &unused */

	if !(int32((*CoroutineData)(unsafe.Pointer(corPtr)).FstackLevel) != 0) {
		// -- Coroutine is suspended --
		// Push the callback to restore the caller's context on yield or
		// return.

		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sNRCoroutineCallerCallback}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = corPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}

		// Record the stackLevel at which the resume is happening, then swap
		// the interp's environment to make it suitable to run this coroutine.

		(*CoroutineData)(unsafe.Pointer(corPtr)).FstackLevel = stackLevel
		numLevels = (*CoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels
		(*CoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels = (*Interp)(unsafe.Pointer(interp)).FnumLevels

		(*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FframePtr = (*Interp)(unsafe.Pointer(interp)).FframePtr
		(*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FvarFramePtr = (*Interp)(unsafe.Pointer(interp)).FvarFramePtr
		(*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr = (*Interp)(unsafe.Pointer(interp)).FcmdFramePtr
		(*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FlineLABCPtr = (*Interp)(unsafe.Pointer(interp)).FlineLABCPtr
		(*CoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr = (*Interp)(unsafe.Pointer(interp)).FexecEnvPtr
		(*Interp)(unsafe.Pointer(interp)).FframePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FframePtr
		(*Interp)(unsafe.Pointer(interp)).FvarFramePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FvarFramePtr
		(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FcmdFramePtr
		(*Interp)(unsafe.Pointer(interp)).FlineLABCPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FlineLABCPtr
		(*Interp)(unsafe.Pointer(interp)).FexecEnvPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr
		*(*int32)(unsafe.Pointer(interp + 152)) += numLevels
	} else {
		// Coroutine is active: yield

		if (*CoroutineData)(unsafe.Pointer(corPtr)).FstackLevel != stackLevel {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+8762, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+8623, ts+8789,
				uintptr(0)))
			return TCL_ERROR
		}

		if type1 == int32(uintptr(0)) {
			(*CoroutineData)(unsafe.Pointer(corPtr)).Fnargs = -1
		} else if type1 == int32(uintptr(0))+1 {
			(*CoroutineData)(unsafe.Pointer(corPtr)).Fnargs = -2
		} else {
			XTcl_Panic(tls, ts+8800, 0)
		}

		(*CoroutineData)(unsafe.Pointer(corPtr)).FstackLevel = uintptr(0)

		numLevels = (*Interp)(unsafe.Pointer(interp)).FnumLevels
		(*Interp)(unsafe.Pointer(interp)).FnumLevels = (*CoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels
		(*CoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels = numLevels - (*CoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels

		(*Interp)(unsafe.Pointer(interp)).FexecEnvPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclNREvalList --
//
//      Callback to invoke command as list, used in order to delayed
//	processing of canonical list command in sane environment.
//
//----------------------------------------------------------------------

func sTclNREvalList(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclBasic.c:8893:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var objc int32 at bp+8, 4

	// var objv uintptr at bp, 8

	var listPtr uintptr = *(*ClientData)(unsafe.Pointer(data))

	(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount++

	XTclMarkTailcall(tls, interp)
	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{XTclNRReleaseValues}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = listPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(listPtr + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 8)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(listPtr + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), listPtr, bp+8, bp)
	}
	return XTclNREvalObjv(tls, interp, *(*int32)(unsafe.Pointer(bp + 8 /* objc */)), *(*uintptr)(unsafe.Pointer(bp /* objv */)), 0, uintptr(0))
}

//----------------------------------------------------------------------
//
// CoroTypeObjCmd --
//
//      Implementation of [::tcl::unsupported::corotype] command.
//
//----------------------------------------------------------------------

func sCoroTypeObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:8921:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var cmdPtr uintptr
	var corPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2246)
		return TCL_ERROR
	}

	// Look up the coroutine.

	cmdPtr = XTcl_GetCommandFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if !(cmdPtr != 0) || (*Command)(unsafe.Pointer(cmdPtr)).FnreProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRInterpCoroutine})) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+8850, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7170, ts+8623,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}(), uintptr(0)))
		return TCL_ERROR
	}

	// An active coroutine is "active". Can't tell what it might do in the
	// future.

	corPtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	if !((*CoroutineData)(unsafe.Pointer(corPtr)).FstackLevel == uintptr(0)) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+8893, -1))
		return TCL_OK
	}

	// Inactive coroutines are classified by the (effective) command used to
	// suspend them, which matters when you're injecting a probe.

	switch (*CoroutineData)(unsafe.Pointer(corPtr)).Fnargs {
	case -1:
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+3452, -1))
		return TCL_OK
	case -2:
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+5365, -1))
		return TCL_OK
	default:
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+8900, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+8623, ts+8923, uintptr(0)))
		return TCL_ERROR
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// NRCoroInjectObjCmd --
//
//      Implementation of [::tcl::unsupported::inject] command.
//
//----------------------------------------------------------------------

func sNRCoroInjectObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:8990:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var cmdPtr uintptr
	var corPtr uintptr
	var savedEEPtr uintptr = (*Interp)(unsafe.Pointer(interp)).FexecEnvPtr

	// Usage more or less like tailcall:
	//   inject coroName cmd ?arg1 arg2 ...?

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+8932)
		return TCL_ERROR
	}

	cmdPtr = XTcl_GetCommandFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if !(cmdPtr != 0) || (*Command)(unsafe.Pointer(cmdPtr)).FnreProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRInterpCoroutine})) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+8961, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7170, ts+8623,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}(), uintptr(0)))
		return TCL_ERROR
	}

	corPtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	if !((*CoroutineData)(unsafe.Pointer(corPtr)).FstackLevel == uintptr(0)) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+9004, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+8623, ts+9057, uintptr(0)))
		return TCL_ERROR
	}

	// Add the callback to the coro's execEnv, so that it is the first thing
	// to happen when the coro is resumed.

	(*Interp)(unsafe.Pointer(interp)).FexecEnvPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr
	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sTclNREvalList}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = XTcl_NewListObj(tls, objc-2, objv+uintptr(2)*8)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	(*Interp)(unsafe.Pointer(interp)).FexecEnvPtr = savedEEPtr

	return TCL_OK
}

func XTclNRInterpCoroutine(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:9041:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	var corPtr uintptr = clientData

	if !((*CoroutineData)(unsafe.Pointer(corPtr)).FstackLevel == uintptr(0)) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+9064,
			libc.VaList(bp, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))))))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+8623, ts+9098, uintptr(0)))
		return TCL_ERROR
	}

	// Parse all the arguments to work out what to feed as the result of the
	// [yield]. TRICKY POINT: objc==0 happens here! It occurs when a coroutine
	// is deleted!

	switch (*CoroutineData)(unsafe.Pointer(corPtr)).Fnargs {
	case -1:
		if objc == 2 {
			XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		} else if objc > 2 {
			XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9103)
			return TCL_ERROR
		}
		break
	default:
		if (*CoroutineData)(unsafe.Pointer(corPtr)).Fnargs != objc-1 {
			XTcl_SetObjResult(tls, interp,
				XTcl_NewStringObj(tls,
					ts+9109, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+8360, uintptr(0)))
			return TCL_ERROR
		}
		fallthrough
		// fallthrough
	case -2:
		if objc > 1 {
			XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, objc-1, objv+uintptr(1)*8))
		}
		break
	}

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{XTclNRCoroutineActivateCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = corPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclNRCoroutineObjCmd --
//
//      Implementation of [coroutine] command; see documentation for
//      description of what this does.
//
//----------------------------------------------------------------------

func XTclNRCoroutineObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:9105:1: */
	bp := tls.Alloc(148)
	defer tls.Free(148)

	var cmdPtr uintptr
	var corPtr uintptr
	var procName uintptr
	// var simpleName uintptr at bp+112, 8

	// var nsPtr uintptr at bp+88, 8

	// var altNsPtr uintptr at bp+96, 8

	// var cxtNsPtr uintptr at bp+104, 8

	var inNsPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	var lookupNsPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9165)
		return TCL_ERROR
	}

	procName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	XTclGetNamespaceForQualName(tls, interp, procName, inNsPtr, 0,
		bp+88, bp+96, bp+104, bp+112)

	if *(*uintptr)(unsafe.Pointer(bp + 88)) == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+9184,
			libc.VaList(bp, procName)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+9231, uintptr(0)))
		return TCL_ERROR
	}
	if *(*uintptr)(unsafe.Pointer(bp + 112)) == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+9241,
			libc.VaList(bp+40, procName)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+6915, ts+7328, procName, uintptr(0)))
		return TCL_ERROR
	}

	// We ARE creating the coroutine command: allocate the corresponding
	// struct and create the corresponding command.

	corPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CoroutineData{})))

	cmdPtr = XTclNRCreateCommandInNs(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 112 /* simpleName */)),
		*(*uintptr)(unsafe.Pointer(bp + 88 /* nsPtr */)) /*objProc*/, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclNRInterpCoroutine})),
		corPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteCoroutine})))

	(*CoroutineData)(unsafe.Pointer(corPtr)).FcmdPtr = cmdPtr
	(*Command)(unsafe.Pointer(cmdPtr)).FrefCount++

	/*
	 * #280.
	 * Provide the new coroutine with its own copy of the lineLABCPtr
	 * hashtable for literal command arguments in bytecode. Note that that
	 * CFWordBC chains are not duplicated, only the entrypoints to them. This
	 * means that in the presence of coroutines each chain is potentially a
	 * tree. Like the chain -> tree conversion of the CmdFrame stack.
	 */

	{
		// var hSearch Tcl_HashSearch at bp+120, 24

		var hePtr uintptr

		(*CoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
		XTcl_InitHashTable(tls, (*CoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr, 1)

		for hePtr = XTcl_FirstHashEntry(tls, (*Interp)(unsafe.Pointer(interp)).FlineLABCPtr, bp+120); hePtr != 0; hePtr = XTcl_NextHashEntry(tls, bp+120) {
			// var isNew int32 at bp+144, 4

			var newPtr uintptr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*CoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr)).FcreateProc})).f(tls, (*CoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr, func() uintptr {
				if (*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FlineLABCPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FlineLABCPtr)).FkeyType == -1 {
					return *(*uintptr)(unsafe.Pointer(hePtr + 32))
				}
				return hePtr + 32
			}(), bp+144)

			(*Tcl_HashEntry)(unsafe.Pointer(newPtr)).FclientData = (*Tcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData
		}

	}

	// Create the base context.

	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FframePtr = (*Interp)(unsafe.Pointer(interp)).FrootFramePtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FvarFramePtr = (*Interp)(unsafe.Pointer(interp)).FrootFramePtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FcmdFramePtr = uintptr(0)
	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FlineLABCPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).FstackLevel = uintptr(0)
	(*CoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels = 0

	// Create the coro's execEnv, switch to it to push the exit and coro
	// command callbacks, then switch back.

	(*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr = XTclCreateExecEnv(tls, interp, CORO_STACK_INITIAL_SIZE)
	(*CoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr = (*Interp)(unsafe.Pointer(interp)).FexecEnvPtr
	(*ExecEnv1)(unsafe.Pointer((*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr)).FcorPtr = corPtr

	(*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FframePtr = (*Interp)(unsafe.Pointer(interp)).FframePtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FvarFramePtr = (*Interp)(unsafe.Pointer(interp)).FvarFramePtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr = (*Interp)(unsafe.Pointer(interp)).FcmdFramePtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FlineLABCPtr = (*Interp)(unsafe.Pointer(interp)).FlineLABCPtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr = (*Interp)(unsafe.Pointer(interp)).FexecEnvPtr
	(*Interp)(unsafe.Pointer(interp)).FframePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FframePtr
	(*Interp)(unsafe.Pointer(interp)).FvarFramePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FvarFramePtr
	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FcmdFramePtr
	(*Interp)(unsafe.Pointer(interp)).FlineLABCPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FlineLABCPtr
	(*Interp)(unsafe.Pointer(interp)).FexecEnvPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sNRCoroutineExitCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = corPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}

	// Ensure that the command is looked up in the correct namespace.

	(*Interp)(unsafe.Pointer(interp)).FlookupNsPtr = lookupNsPtr
	XTcl_NREvalObj(tls, interp, XTcl_NewListObj(tls, objc-2, objv+uintptr(2)*8), 0)
	(*Interp)(unsafe.Pointer(interp)).FnumLevels--

	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FframePtr = (*Interp)(unsafe.Pointer(interp)).FframePtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FvarFramePtr = (*Interp)(unsafe.Pointer(interp)).FvarFramePtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FcmdFramePtr = (*Interp)(unsafe.Pointer(interp)).FcmdFramePtr
	(*CoroutineData)(unsafe.Pointer(corPtr)).Frunning.FlineLABCPtr = (*Interp)(unsafe.Pointer(interp)).FlineLABCPtr
	(*Interp)(unsafe.Pointer(interp)).FframePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FframePtr
	(*Interp)(unsafe.Pointer(interp)).FvarFramePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FvarFramePtr
	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr
	(*Interp)(unsafe.Pointer(interp)).FlineLABCPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FlineLABCPtr
	(*Interp)(unsafe.Pointer(interp)).FexecEnvPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr

	// Now just resume the coroutine.

	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _callbackPtr uintptr
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{XTclNRCoroutineActivateCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = corPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return TCL_OK
}

// This is used in the [info] ensemble

func XTclInfoCoroutineCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBasic.c:9238:1: */
	var corPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcorPtr

	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}

	if corPtr != 0 && !((*Command1)(unsafe.Pointer((*CoroutineData)(unsafe.Pointer(corPtr)).FcmdPtr)).Fflags&CMD_IS_DELETED != 0) {
		var namePtr uintptr

		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				namePtr = XTclThreadAllocObj(tls)
			} else {
				namePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(namePtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(namePtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(namePtr)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(namePtr)).FtypePtr = uintptr(0)
		{
		}

		XTcl_GetCommandFullName(tls, interp, (*CoroutineData)(unsafe.Pointer(corPtr)).FcmdPtr, namePtr)
		XTcl_SetObjResult(tls, interp, namePtr)
	}
	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// indent-tabs-mode: nil
// End:

// The following tables are used by the binary encoders

var sHexDigits = [16]int8{
	int8('0'), int8('1'), int8('2'), int8('3'), int8('4'), int8('5'), int8('6'), int8('7'),
	int8('8'), int8('9'), int8('a'), int8('b'), int8('c'), int8('d'), int8('e'), int8('f'),
} /* tclBinary.c:104:19 */

var sUueDigits = [65]int8{
	int8('`'), int8('!'), int8('"'), int8('#'), int8('$'), int8('%'), int8('&'), int8('\''),
	int8('('), int8(')'), int8('*'), int8('+'), int8(','), int8('-'), int8('.'), int8('/'),
	int8('0'), int8('1'), int8('2'), int8('3'), int8('4'), int8('5'), int8('6'), int8('7'),
	int8('8'), int8('9'), int8(':'), int8(';'), int8('<'), int8('='), int8('>'), int8('?'),
	int8('@'), int8('A'), int8('B'), int8('C'), int8('D'), int8('E'), int8('F'), int8('G'),
	int8('H'), int8('I'), int8('J'), int8('K'), int8('L'), int8('M'), int8('N'), int8('O'),
	int8('P'), int8('Q'), int8('R'), int8('S'), int8('T'), int8('U'), int8('V'), int8('W'),
	int8('X'), int8('Y'), int8('Z'), int8('['), int8('\\'), int8(']'), int8('^'), int8('_'),
	int8('`'),
} /* tclBinary.c:109:19 */

var sB64Digits = [65]int8{
	int8('A'), int8('B'), int8('C'), int8('D'), int8('E'), int8('F'), int8('G'), int8('H'),
	int8('I'), int8('J'), int8('K'), int8('L'), int8('M'), int8('N'), int8('O'), int8('P'),
	int8('Q'), int8('R'), int8('S'), int8('T'), int8('U'), int8('V'), int8('W'), int8('X'),
	int8('Y'), int8('Z'), int8('a'), int8('b'), int8('c'), int8('d'), int8('e'), int8('f'),
	int8('g'), int8('h'), int8('i'), int8('j'), int8('k'), int8('l'), int8('m'), int8('n'),
	int8('o'), int8('p'), int8('q'), int8('r'), int8('s'), int8('t'), int8('u'), int8('v'),
	int8('w'), int8('x'), int8('y'), int8('z'), int8('0'), int8('1'), int8('2'), int8('3'),
	int8('4'), int8('5'), int8('6'), int8('7'), int8('8'), int8('9'), int8('+'), int8('/'),
	int8('='),
} /* tclBinary.c:121:19 */

// How to construct the ensembles.

var binaryMap = [5]EnsembleImplMap{
	{Fname: ts + 5154, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5298, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 9289},
	{Fname: ts + 9296},
	{},
} /* tclBinary.c:137:30 */
var encodeMap = [4]EnsembleImplMap{
	{Fname: ts + 9303, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 9307, Fproc: 0},
	{Fname: ts + 9316, Fproc: 0},
	{},
} /* tclBinary.c:144:30 */
var decodeMap = [4]EnsembleImplMap{
	{Fname: ts + 9303, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 9307, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 9316, Fproc: 0, FcompileProc: 0},
	{},
} /* tclBinary.c:150:30 */

// The following object type represents an array of bytes. An array of bytes
// is not equivalent to an internationalized string. Conceptually, a string is
// an array of 16-bit quantities organized as a sequence of properly formed
// UTF-8 characters, while a ByteArray is an array of 8-bit quantities.
// Accessor functions are provided to convert a ByteArray to a String or a
// String to a ByteArray. Two or more consecutive bytes in an array of bytes
// may look like a single UTF-8 character if the array is casually treated as
// a string. But obtaining the String from a ByteArray is guaranteed to
// produced properly formed UTF-8 sequences so that there is a one-to-one map
// between bytes and characters.
//
// Converting a ByteArray to a String proceeds by casting each byte in the
// array to a 16-bit quantity, treating that number as a Unicode character,
// and storing the UTF-8 version of that Unicode character in the String. For
// ByteArrays consisting entirely of values 1..127, the corresponding String
// representation is the same as the ByteArray representation.
//
// Converting a String to a ByteArray proceeds by getting the Unicode
// representation of each character in the String, casting it to a byte by
// truncating the upper 8 bits, and then storing the byte in the ByteArray.
// Converting from ByteArray to String and back to ByteArray is not lossy, but
// converting an arbitrary String to a ByteArray may be.

var XtclByteArrayType = Tcl_ObjType{
	Fname:             ts + 9323,
	FfreeIntRepProc:   0,
	FdupIntRepProc:    0,
	FupdateStringProc: 0,
	FsetFromAnyProc:   0,
} /* tclBinary.c:182:19 */

// The following structure is the internal rep for a ByteArray object. Keeps
// track of how much memory has been used and how much has been allocated for
// the byte array to enable growing and shrinking of the ByteArray object with
// fewer mallocs.

type ByteArray1 = struct {
	F__ccgo_pad1 [0]uint32
	Fused        int32
	Fallocated   int32
} /* tclBinary.c:197:9 */

// The following structure is the internal rep for a ByteArray object. Keeps
// track of how much memory has been used and how much has been allocated for
// the byte array to enable growing and shrinking of the ByteArray object with
// fewer mallocs.

type ByteArray = ByteArray1 /* tclBinary.c:205:3 */

//----------------------------------------------------------------------
//
// Tcl_NewByteArrayObj --
//
//	This procedure is creates a new ByteArray object and initializes it
//	from the given array of bytes.
//
// Results:
//	The newly create object is returned. This object will have no initial
//	string representation. The returned object has a ref count of 0.
//
// Side effects:
//	Memory allocated for new object and copy of byte array argument.
//
//----------------------------------------------------------------------

func XTcl_NewByteArrayObj(tls *libc.TLS, bytes uintptr, length int32) uintptr { /* tclBinary.c:235:9: */
	var objPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	XTcl_SetByteArrayObj(tls, objPtr, bytes, length)
	return objPtr
}

//----------------------------------------------------------------------
//
// Tcl_DbNewByteArrayObj --
//
//	This procedure is normally called when debugging: i.e., when
//	TCL_MEM_DEBUG is defined. It is the same as the Tcl_NewByteArrayObj
//	above except that it calls Tcl_DbCkalloc directly with the file name
//	and line number from its caller. This simplifies debugging since then
//	the [memory active] command will report the correct file name and line
//	number when reporting objects that haven't been freed.
//
//	When TCL_MEM_DEBUG is not defined, this procedure just returns the
//	result of calling Tcl_NewByteArrayObj.
//
// Results:
//	The newly create object is returned. This object will have no initial
//	string representation. The returned object has a ref count of 0.
//
// Side effects:
//	Memory allocated for new object and copy of byte array argument.
//
//----------------------------------------------------------------------

func XTcl_DbNewByteArrayObj(tls *libc.TLS, bytes uintptr, length int32, file uintptr, line int32) uintptr { /* tclBinary.c:278:9: */
	return XTcl_NewByteArrayObj(tls, bytes, length)
}

//---------------------------------------------------------------------------
//
// Tcl_SetByteArrayObj --
//
//	Modify an object to be a ByteArray object and to have the specified
//	array of bytes as its value.
//
// Results:
//	None.
//
// Side effects:
//	The object's old string rep and internal rep is freed. Memory
//	allocated for copy of byte array argument.
//
//----------------------------------------------------------------------

func XTcl_SetByteArrayObj(tls *libc.TLS, objPtr uintptr, bytes uintptr, length int32) { /* tclBinary.c:319:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var byteArrayPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+9362))
	}
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	}

	for ok := true; ok; ok = 0 != 0 {
		var _isobjPtr uintptr = objPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}

	if length < 0 {
		length = 0
	}
	byteArrayPtr = XTcl_Alloc(tls, uint32(int32(uintptr(0)+8)+length))
	(*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fused = length
	(*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated = length

	if bytes != uintptr(0) && length > 0 {
		libc.Xmemcpy(tls, byteArrayPtr+8, bytes, uint64(length))
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclByteArrayType))
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = byteArrayPtr
}

//----------------------------------------------------------------------
//
// Tcl_GetByteArrayFromObj --
//
//	Attempt to get the array of bytes from the Tcl object. If the object
//	is not already a ByteArray object, an attempt will be made to convert
//	it to one.
//
// Results:
//	Pointer to array of bytes representing the ByteArray object.
//
// Side effects:
//	Frees old internal rep. Allocates memory for new internal rep.
//
//----------------------------------------------------------------------

func XTcl_GetByteArrayFromObj(tls *libc.TLS, objPtr uintptr, lengthPtr uintptr) uintptr { /* tclBinary.c:366:15: */
	var baPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclByteArrayType)) {
		sSetByteArrayFromAny(tls, uintptr(0), objPtr)
	}
	baPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if lengthPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(lengthPtr)) = (*ByteArray)(unsafe.Pointer(baPtr)).Fused
	}
	return baPtr + 8 /* &.bytes */
}

//----------------------------------------------------------------------
//
// Tcl_SetByteArrayLength --
//
//	This procedure changes the length of the byte array for this object.
//	Once the caller has set the length of the array, it is acceptable to
//	directly modify the bytes in the array up until Tcl_GetStringFromObj()
//	has been called on this object.
//
// Results:
//	The new byte array of the specified length.
//
// Side effects:
//	Allocates enough memory for an array of bytes of the requested size.
//	When growing the array, the old array is copied to the new array; new
//	bytes are undefined. When shrinking, the old array is truncated to the
//	specified length.
//
//----------------------------------------------------------------------

func XTcl_SetByteArrayLength(tls *libc.TLS, objPtr uintptr, length int32) uintptr { /* tclBinary.c:407:15: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var byteArrayPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+9382))
	}
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclByteArrayType)) {
		sSetByteArrayFromAny(tls, uintptr(0), objPtr)
	}

	byteArrayPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	if length > (*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated {
		byteArrayPtr = XTcl_Realloc(tls, byteArrayPtr, uint32(int32(uintptr(0)+8)+length))
		(*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated = length
		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = byteArrayPtr
	}
	for ok := true; ok; ok = 0 != 0 {
		var _isobjPtr uintptr = objPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	(*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fused = length
	return byteArrayPtr + 8 /* &.bytes */
}

//----------------------------------------------------------------------
//
// SetByteArrayFromAny --
//
//	Generate the ByteArray internal rep from the string rep.
//
// Results:
//	The return value is always TCL_OK.
//
// Side effects:
//	A ByteArray object is stored as the internal rep of objPtr.
//
//----------------------------------------------------------------------

func sSetByteArrayFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclBinary.c:449:1: */
	bp := tls.Alloc(6)
	defer tls.Free(6)

	// var length int32 at bp, 4

	var src uintptr
	var srcEnd uintptr
	var dst uintptr
	var byteArrayPtr uintptr
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */)) = Tcl_UniChar(0)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclByteArrayType)) {
		src = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, objPtr, bp)
		}()
		srcEnd = src + uintptr(*(*int32)(unsafe.Pointer(bp)))

		byteArrayPtr = XTcl_Alloc(tls, uint32(int32(uintptr(0)+8)+*(*int32)(unsafe.Pointer(bp))))
		for dst = byteArrayPtr + 8; /* &.bytes */ src < srcEnd; {
			src += func() uintptr {
				if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 {
					return uintptr(func() int32 {
						*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
						return 1
					}())
				}
				return uintptr(XTcl_UtfToUniChar(tls, src, bp+4))
			}()
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = uint8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)))
		}

		(*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fused = int32(int64((dst - (byteArrayPtr + 8)) / 1))
		(*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated = *(*int32)(unsafe.Pointer(bp /* length */))

		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		}

		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclByteArrayType))
		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = byteArrayPtr
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// FreeByteArrayInternalRep --
//
//	Deallocate the storage associated with a ByteArray data object's
//	internal representation.
//
// Results:
//	None.
//
// Side effects:
//	Frees memory.
//
//----------------------------------------------------------------------

func sFreeByteArrayInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclBinary.c:497:1: */
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(objPtr + 32)))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// DupByteArrayInternalRep --
//
//	Initialize the internal representation of a ByteArray Tcl_Obj to a
//	copy of the internal representation of an existing ByteArray object.
//
// Results:
//	None.
//
// Side effects:
//	Allocates memory.
//
//----------------------------------------------------------------------

func sDupByteArrayInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclBinary.c:522:1: */
	var length int32
	var srcArrayPtr uintptr
	var copyArrayPtr uintptr

	srcArrayPtr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))
	length = (*ByteArray)(unsafe.Pointer(srcArrayPtr)).Fused

	copyArrayPtr = XTcl_Alloc(tls, uint32(int32(uintptr(0)+8)+length))
	(*ByteArray)(unsafe.Pointer(copyArrayPtr)).Fused = length
	(*ByteArray)(unsafe.Pointer(copyArrayPtr)).Fallocated = length
	libc.Xmemcpy(tls, copyArrayPtr+8, srcArrayPtr+8, uint64(length))
	*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = copyArrayPtr

	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclByteArrayType))
}

//----------------------------------------------------------------------
//
// UpdateStringOfByteArray --
//
//	Update the string representation for a ByteArray data object. Note:
//	This procedure does not invalidate an existing old string rep so
//	storage will be lost if this has not already been done.
//
// Results:
//	None.
//
// Side effects:
//	The object's string is set to a valid string that results from the
//	ByteArray-to-string conversion.
//
//	The object becomes a string object -- the internal rep is discarded
//	and the typePtr becomes NULL.
//
//----------------------------------------------------------------------

func sUpdateStringOfByteArray(tls *libc.TLS, objPtr uintptr) { /* tclBinary.c:564:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var i int32
	var length int32
	var size int32
	var src uintptr
	var dst uintptr
	var byteArrayPtr uintptr

	byteArrayPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	src = byteArrayPtr + 8 /* &.bytes */
	length = (*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fused

	// How much space will string rep need?

	size = length
	for i = 0; i < length && size >= 0; i++ {
		if int32(*(*uint8)(unsafe.Pointer(src + uintptr(i)))) == 0 || int32(*(*uint8)(unsafe.Pointer(src + uintptr(i)))) > 127 {
			size++
		}
	}
	if size < 0 {
		XTcl_Panic(tls, ts+9405, libc.VaList(bp, 0x7fffffff))
	}

	dst = XTcl_Alloc(tls, uint32(size+1))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = dst
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = size

	if size == length {
		libc.Xmemcpy(tls, dst, src, uint64(size))
		*(*int8)(unsafe.Pointer(dst + uintptr(size))) = int8(0)
	} else {
		for i = 0; i < length; i++ {
			dst += uintptr(XTcl_UniCharToUtf(tls, int32(*(*uint8)(unsafe.Pointer(src + uintptr(i)))), dst))
		}
		*(*int8)(unsafe.Pointer(dst)) = int8(0)
	}
}

//----------------------------------------------------------------------
//
// TclAppendBytesToByteArray --
//
//	This function appends an array of bytes to a byte array object. Note
//	that the object *must* be unshared, and the array of bytes *must not*
//	refer to the object being appended to.
//
// Results:
//	None.
//
// Side effects:
//	Allocates enough memory for an array of bytes of the requested total
//	size, or possibly larger. [Bug 2992970]
//
//----------------------------------------------------------------------

func XTclAppendBytesToByteArray(tls *libc.TLS, objPtr uintptr, bytes uintptr, len int32) { /* tclBinary.c:626:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var byteArrayPtr uintptr
	var needed int32

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+9450))
	}
	if len < 0 {
		XTcl_Panic(tls, ts+9476,
			libc.VaList(bp+8, ts+9450))
	}
	if len == 0 {
		// Append zero bytes is a no-op.

		return
	}
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclByteArrayType)) {
		sSetByteArrayFromAny(tls, uintptr(0), objPtr)
	}
	byteArrayPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if len > 0x7fffffff-(*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fused {
		XTcl_Panic(tls, ts+9405, libc.VaList(bp+16, 0x7fffffff))
	}

	needed = (*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fused + len
	// If we need to, resize the allocated space in the byte array.

	if needed > (*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated {
		var ptr uintptr = uintptr(0)
		var attempt int32

		if needed <= 0x7fffffff/2 {
			// Try to allocate double the total space that is needed.

			attempt = 2 * needed
			ptr = XTclpRealloc(tls, byteArrayPtr, uint32(int32(uintptr(0)+8)+attempt))
		}
		if ptr == uintptr(0) {
			// Try to allocate double the increment that is needed (plus).

			var limit uint32 = uint32(0x7fffffff - needed)
			var extra uint32 = uint32(len + TCL_MIN_GROWTH)
			var growth int32 = func() int32 {
				if extra > limit {
					return int32(limit)
				}
				return int32(extra)
			}()

			attempt = needed + growth
			ptr = XTclpRealloc(tls, byteArrayPtr, uint32(int32(uintptr(0)+8)+attempt))
		}
		if ptr == uintptr(0) {
			// Last chance: Try to allocate exactly what is needed.

			attempt = needed
			ptr = XTcl_Realloc(tls, byteArrayPtr, uint32(int32(uintptr(0)+8)+attempt))
		}
		byteArrayPtr = ptr
		(*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated = attempt
		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = byteArrayPtr
	}

	if bytes != 0 {
		libc.Xmemcpy(tls, byteArrayPtr+8+uintptr((*ByteArray)(unsafe.Pointer(byteArrayPtr)).Fused), bytes, uint64(len))
	}
	*(*int32)(unsafe.Pointer(byteArrayPtr)) += len
	for ok := true; ok; ok = 0 != 0 {
		var _isobjPtr uintptr = objPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
}

//----------------------------------------------------------------------
//
// TclInitBinaryCmd --
//
//	This function is called to create the "binary" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A command token for the new command.
//
// Side effects:
//	Creates a new binary command as a mapped ensemble.
//
//----------------------------------------------------------------------

func XTclInitBinaryCmd(tls *libc.TLS, interp uintptr) Tcl_Command { /* tclBinary.c:724:1: */
	var binaryEnsemble Tcl_Command

	binaryEnsemble = XTclMakeEnsemble(tls, interp, ts+9534, uintptr(unsafe.Pointer(&binaryMap)))
	XTclMakeEnsemble(tls, interp, ts+9541, uintptr(unsafe.Pointer(&encodeMap)))
	XTclMakeEnsemble(tls, interp, ts+9555, uintptr(unsafe.Pointer(&decodeMap)))
	return binaryEnsemble
}

//----------------------------------------------------------------------
//
// BinaryFormatCmd --
//
//	This procedure implements the "binary format" Tcl command.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sBinaryFormatCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBinary.c:752:1: */
	bp := tls.Alloc(100)
	defer tls.Free(100)

	var arg int32   // Index of next argument to consume.
	var value int32 // Current integer value to be packed.
	// Initialized to avoid compiler warning.
	// var cmd int8 at bp+32, 1
	// Current format character.
	// var count int32 at bp+36, 4
	// Count associated with current format
	// character.
	// var flags int32 at bp+40, 4
	// Format field flags
	// var format uintptr at bp+24, 8
	// Pointer to current position in format
	// string.
	var resultPtr uintptr // Object holding result buffer.
	var buffer uintptr    // Start of result buffer.
	// var cursor uintptr at bp+80, 8
	// Current position within result buffer.
	var maxPos uintptr // Greatest position within result buffer that
	// cursor has visited.
	var errorString uintptr
	var errorValue uintptr
	var str uintptr
	var offset int32
	var size int32
	// var length int32 at bp+60, 4

	// var listc int32 at bp+56, 4

	// var listv uintptr at bp+48, 8

	var pad int8
	var bytes uintptr
	var _objPtr uintptr
	var _objPtr1 uintptr
	var last uintptr
	var _objPtr2 uintptr
	var _objPtr3 uintptr
	var last1 uintptr
	var c int32
	var _objPtr4 uintptr
	// var listc1 int32 at bp+72, 4

	var i int32
	// var listv1 uintptr at bp+64, 8

	// var ch int32 at bp+88, 4

	// var buf [8]int8 at bp+92, 8
	value = 0
	resultPtr = uintptr(0)

	if !(objc < 2) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9569)
	return TCL_ERROR
__1:
	;

	// To avoid copying the data, we format the string in two passes. The
	// first pass computes the size of the output buffer. The second pass
	// places the formatted data into the buffer.

	*(*uintptr)(unsafe.Pointer(bp + 24 /* format */)) = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	arg = 2
	offset = 0
	*(*int32)(unsafe.Pointer(bp + 60 /* length */)) = 0
__2:
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24))))) != 0) {
		goto __3
	}
	str = *(*uintptr)(unsafe.Pointer(bp + 24 /* format */))
	*(*int32)(unsafe.Pointer(bp + 40 /* flags */)) = 0
	if !!(sGetFormatSpec(tls, bp+24, bp+32, bp+36, bp+40) != 0) {
		goto __4
	}
	goto __3
__4:
	;
	switch int32(*(*int8)(unsafe.Pointer(bp + 32 /* cmd */))) {
	case 'a':
		goto __6
	case 'A':
		goto __7
	case 'b':
		goto __8
	case 'B':
		goto __9
	case 'h':
		goto __10
	case 'H':
		goto __11
	case 'c':
		goto __12
	case 't':
		goto __13
	case 's':
		goto __14
	case 'S':
		goto __15
	case 'n':
		goto __16
	case 'i':
		goto __17
	case 'I':
		goto __18
	case 'm':
		goto __19
	case 'w':
		goto __20
	case 'W':
		goto __21
	case 'r':
		goto __22
	case 'R':
		goto __23
	case 'f':
		goto __24
	case 'q':
		goto __25
	case 'Q':
		goto __26
	case 'd':
		goto __27

	case 'x':
		goto __28
	case 'X':
		goto __29
	case '@':
		goto __30
	default:
		goto __31
	}
	goto __5
__6:
__7:
__8:
__9:
__10:
__11:
	// For string-type specifiers, the count corresponds to the number
	// of bytes in a single argument.

	if !(arg >= objc) {
		goto __32
	}
	goto badIndex
__32:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -1) {
		goto __33
	}
	XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), bp+36)
	goto __34
__33:
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -2) {
		goto __35
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = 1
__35:
	;
__34:
	;
	arg++
	if !(int32(*(*int8)(unsafe.Pointer(bp + 32))) == 'a' || int32(*(*int8)(unsafe.Pointer(bp + 32))) == 'A') {
		goto __36
	}
	offset = offset + *(*int32)(unsafe.Pointer(bp + 36))
	goto __37
__36:
	if !(int32(*(*int8)(unsafe.Pointer(bp + 32))) == 'b' || int32(*(*int8)(unsafe.Pointer(bp + 32))) == 'B') {
		goto __38
	}
	offset = offset + (*(*int32)(unsafe.Pointer(bp + 36))+7)/8
	goto __39
__38:
	offset = offset + (*(*int32)(unsafe.Pointer(bp + 36))+1)/2
__39:
	;
__37:
	;
	goto __5
__12:
	size = 1
	goto doNumbers
__13:
__14:
__15:
	size = 2
	goto doNumbers
__16:
__17:
__18:
	size = 4
	goto doNumbers
__19:
__20:
__21:
	size = 8
	goto doNumbers
__22:
__23:
__24:
	size = int32(unsafe.Sizeof(float32(0)))
	goto doNumbers
__25:
__26:
__27:
	size = int32(unsafe.Sizeof(float64(0)))

doNumbers:
	if !(arg >= objc) {
		goto __40
	}
	goto badIndex
__40:
	;

	// For number-type specifiers, the count corresponds to the number
	// of elements in the list stored in a single argument. If no
	// count is specified, then the argument is taken as a single
	// non-list value.

	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -2) {
		goto __41
	}
	arg++
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = 1
	goto __42
__41:

	// The macro evals its args more than once: avoid arg++

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 48)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 56)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), bp+56, bp+48)
	}() != TCL_OK) {
		goto __43
	}
	return TCL_ERROR
__43:
	;
	arg++

	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -1) {
		goto __44
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = *(*int32)(unsafe.Pointer(bp + 56 /* listc */))
	goto __45
__44:
	if !(*(*int32)(unsafe.Pointer(bp + 36)) > *(*int32)(unsafe.Pointer(bp + 56))) {
		goto __46
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+9592,
		-1))
	return TCL_ERROR
__46:
	;
__45:
	;
__42:
	;
	offset = offset + *(*int32)(unsafe.Pointer(bp + 36))*size
	goto __5

__28:
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -1) {
		goto __47
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+9640, -1))
	return TCL_ERROR
	goto __48
__47:
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -2) {
		goto __49
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = 1
__49:
	;
__48:
	;
	offset = offset + *(*int32)(unsafe.Pointer(bp + 36))
	goto __5
__29:
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -2) {
		goto __50
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = 1
__50:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 36)) > offset || *(*int32)(unsafe.Pointer(bp + 36)) == -1) {
		goto __51
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = offset
__51:
	;
	if !(offset > *(*int32)(unsafe.Pointer(bp + 60))) {
		goto __52
	}
	*(*int32)(unsafe.Pointer(bp + 60 /* length */)) = offset
__52:
	;
	offset = offset - *(*int32)(unsafe.Pointer(bp + 36))
	goto __5
__30:
	if !(offset > *(*int32)(unsafe.Pointer(bp + 60))) {
		goto __53
	}
	*(*int32)(unsafe.Pointer(bp + 60 /* length */)) = offset
__53:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -1) {
		goto __54
	}
	offset = *(*int32)(unsafe.Pointer(bp + 60 /* length */))
	goto __55
__54:
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -2) {
		goto __56
	}
	goto badCount
	goto __57
__56:
	offset = *(*int32)(unsafe.Pointer(bp + 36 /* count */))
__57:
	;
__55:
	;
	goto __5
__31:
	errorString = str
	goto badField
__5:
	;
	goto __2
__3:
	;
	if !(offset > *(*int32)(unsafe.Pointer(bp + 60))) {
		goto __58
	}
	*(*int32)(unsafe.Pointer(bp + 60 /* length */)) = offset
__58:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 60)) == 0) {
		goto __59
	}
	return TCL_OK
__59:
	;

	// Prepare the result object by preallocating the caclulated number of
	// bytes and filling with nulls.

	resultPtr = XTcl_NewObj(tls)
	buffer = XTcl_SetByteArrayLength(tls, resultPtr, *(*int32)(unsafe.Pointer(bp + 60 /* length */)))
	libc.Xmemset(tls, buffer, 0, uint64(*(*int32)(unsafe.Pointer(bp + 60 /* length */))))

	// Pack the data into the result object. Note that we can skip the error
	// checking during this pass, since we have already parsed the string
	// once.

	arg = 2
	*(*uintptr)(unsafe.Pointer(bp + 24 /* format */)) = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)) = buffer
	maxPos = *(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */))
__60:
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24))))) != 0) {
		goto __61
	}
	*(*int32)(unsafe.Pointer(bp + 40 /* flags */)) = 0
	if !!(sGetFormatSpec(tls, bp+24, bp+32, bp+36, bp+40) != 0) {
		goto __62
	}
	goto __61
__62:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == 0 && int32(*(*int8)(unsafe.Pointer(bp + 32))) != '@') {
		goto __63
	}
	if !(int32(*(*int8)(unsafe.Pointer(bp + 32))) != 'x') {
		goto __64
	}
	arg++
__64:
	;
	goto __60
__63:
	;
	switch int32(*(*int8)(unsafe.Pointer(bp + 32 /* cmd */))) {
	case 'a':
		goto __66
	case 'A':
		goto __67
	case 'b':
		goto __68
	case 'B':
		goto __69
	case 'h':
		goto __70
	case 'H':
		goto __71
	case 'c':
		goto __72
	case 't':
		goto __73
	case 's':
		goto __74
	case 'S':
		goto __75
	case 'n':
		goto __76
	case 'i':
		goto __77
	case 'I':
		goto __78
	case 'm':
		goto __79
	case 'w':
		goto __80
	case 'W':
		goto __81
	case 'r':
		goto __82
	case 'R':
		goto __83
	case 'd':
		goto __84
	case 'q':
		goto __85
	case 'Q':
		goto __86
	case 'f':
		goto __87
	case 'x':
		goto __88
	case 'X':
		goto __89
	case '@':
		goto __90
	}
	goto __65
__66:
__67:
	pad = func() int8 {
		if int32(*(*int8)(unsafe.Pointer(bp + 32))) == 'a' {
			return int8(0)
		}
		return int8(' ')
	}()

	bytes = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PostIncInt32(&arg, 1))*8)), bp+60)

	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -1) {
		goto __91
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = *(*int32)(unsafe.Pointer(bp + 60 /* length */))
	goto __92
__91:
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -2) {
		goto __93
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = 1
__93:
	;
__92:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 60)) >= *(*int32)(unsafe.Pointer(bp + 36))) {
		goto __94
	}
	libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)), bytes, uint64(*(*int32)(unsafe.Pointer(bp + 36 /* count */))))
	goto __95
__94:
	libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)), bytes, uint64(*(*int32)(unsafe.Pointer(bp + 60 /* length */))))
	libc.Xmemset(tls, *(*uintptr)(unsafe.Pointer(bp + 80))+uintptr(*(*int32)(unsafe.Pointer(bp + 60))), int32(pad), uint64(*(*int32)(unsafe.Pointer(bp + 36))-*(*int32)(unsafe.Pointer(bp + 60))))
__95:
	;
	*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)) += uintptr(*(*int32)(unsafe.Pointer(bp + 36 /* count */)))
	goto __65

__68:
__69:

	str = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 60)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), bp+60)
	}()
	arg++
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -1) {
		goto __96
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = *(*int32)(unsafe.Pointer(bp + 60 /* length */))
	goto __97
__96:
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -2) {
		goto __98
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = 1
__98:
	;
__97:
	;
	last = *(*uintptr)(unsafe.Pointer(bp + 80)) + uintptr((*(*int32)(unsafe.Pointer(bp + 36))+7)/8)
	if !(*(*int32)(unsafe.Pointer(bp + 36)) > *(*int32)(unsafe.Pointer(bp + 60))) {
		goto __99
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = *(*int32)(unsafe.Pointer(bp + 60 /* length */))
__99:
	;
	value = 0
	errorString = ts + 9534 /* "binary" */
	if !(int32(*(*int8)(unsafe.Pointer(bp + 32))) == 'B') {
		goto __100
	}
	offset = 0
__102:
	if !(offset < *(*int32)(unsafe.Pointer(bp + 36))) {
		goto __104
	}
	value <<= 1
	if !(int32(*(*int8)(unsafe.Pointer(str + uintptr(offset)))) == '1') {
		goto __105
	}
	value = value | 1
	goto __106
__105:
	if !(int32(*(*int8)(unsafe.Pointer(str + uintptr(offset)))) != '0') {
		goto __107
	}
	errorValue = str
__108:
	_objPtr = resultPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __111
	}
	XTclFreeObj(tls, _objPtr)
__111:
	;
	goto __109
__109:
	if 0 != 0 {
		goto __108
	}
	goto __110
__110:
	;
	goto badValue
__107:
	;
__106:
	;
	if !((offset+1)%8 == 0) {
		goto __112
	}
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)), 1))) = uint8(value)
	value = 0
__112:
	;
	goto __103
__103:
	offset++
	goto __102
	goto __104
__104:
	;
	goto __101
__100:
	offset = 0
__113:
	if !(offset < *(*int32)(unsafe.Pointer(bp + 36))) {
		goto __115
	}
	value >>= 1
	if !(int32(*(*int8)(unsafe.Pointer(str + uintptr(offset)))) == '1') {
		goto __116
	}
	value = value | 128
	goto __117
__116:
	if !(int32(*(*int8)(unsafe.Pointer(str + uintptr(offset)))) != '0') {
		goto __118
	}
	errorValue = str
__119:
	_objPtr1 = resultPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __122
	}
	XTclFreeObj(tls, _objPtr1)
__122:
	;
	goto __120
__120:
	if 0 != 0 {
		goto __119
	}
	goto __121
__121:
	;
	goto badValue
__118:
	;
__117:
	;
	if !!((offset+1)%8 != 0) {
		goto __123
	}
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)), 1))) = uint8(value)
	value = 0
__123:
	;
	goto __114
__114:
	offset++
	goto __113
	goto __115
__115:
	;
__101:
	;
	if !(offset%8 != 0) {
		goto __124
	}
	if !(int32(*(*int8)(unsafe.Pointer(bp + 32))) == 'B') {
		goto __125
	}
	value <<= 8 - offset%8
	goto __126
__125:
	value >>= 8 - offset%8
__126:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)), 1))) = uint8(value)
__124:
	;
__127:
	if !(*(*uintptr)(unsafe.Pointer(bp + 80)) < last) {
		goto __128
	}
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)), 1))) = uint8(0)
	goto __127
__128:
	;
	goto __65

__70:
__71:

	str = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 60)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), bp+60)
	}()
	arg++
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -1) {
		goto __129
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = *(*int32)(unsafe.Pointer(bp + 60 /* length */))
	goto __130
__129:
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -2) {
		goto __131
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = 1
__131:
	;
__130:
	;
	last1 = *(*uintptr)(unsafe.Pointer(bp + 80)) + uintptr((*(*int32)(unsafe.Pointer(bp + 36))+1)/2)
	if !(*(*int32)(unsafe.Pointer(bp + 36)) > *(*int32)(unsafe.Pointer(bp + 60))) {
		goto __132
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = *(*int32)(unsafe.Pointer(bp + 60 /* length */))
__132:
	;
	value = 0
	errorString = ts + 9681 /* "hexadecimal" */
	if !(int32(*(*int8)(unsafe.Pointer(bp + 32))) == 'H') {
		goto __133
	}
	offset = 0
__135:
	if !(offset < *(*int32)(unsafe.Pointer(bp + 36))) {
		goto __137
	}
	value <<= 4
	if !!(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(str + uintptr(offset))))))*2)))&int32(X_ISxdigit) != 0) {
		goto __138
	} // INTL: digit
	errorValue = str
__139:
	_objPtr2 = resultPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __142
	}
	XTclFreeObj(tls, _objPtr2)
__142:
	;
	goto __140
__140:
	if 0 != 0 {
		goto __139
	}
	goto __141
__141:
	;
	goto badValue
__138:
	;
	c = int32(*(*int8)(unsafe.Pointer(str + uintptr(offset)))) - '0'
	if !(c > 9) {
		goto __143
	}
	c = c + ('0' - 'A' + 10)
__143:
	;
	if !(c > 16) {
		goto __144
	}
	c = c + ('A' - 'a')
__144:
	;
	value = value | c&0xF
	if !(offset%2 != 0) {
		goto __145
	}
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)), 1))) = uint8(int8(value))
	value = 0
__145:
	;
	goto __136
__136:
	offset++
	goto __135
	goto __137
__137:
	;
	goto __134
__133:
	offset = 0
__146:
	if !(offset < *(*int32)(unsafe.Pointer(bp + 36))) {
		goto __148
	}
	value >>= 4

	if !!(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(str + uintptr(offset))))))*2)))&int32(X_ISxdigit) != 0) {
		goto __149
	} // INTL: digit
	errorValue = str
__150:
	_objPtr3 = resultPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __153
	}
	XTclFreeObj(tls, _objPtr3)
__153:
	;
	goto __151
__151:
	if 0 != 0 {
		goto __150
	}
	goto __152
__152:
	;
	goto badValue
__149:
	;
	c = int32(*(*int8)(unsafe.Pointer(str + uintptr(offset)))) - '0'
	if !(c > 9) {
		goto __154
	}
	c = c + ('0' - 'A' + 10)
__154:
	;
	if !(c > 16) {
		goto __155
	}
	c = c + ('A' - 'a')
__155:
	;
	value = value | c<<4&0xF0
	if !(offset%2 != 0) {
		goto __156
	}
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)), 1))) = uint8(value & 0xFF)
	value = 0
__156:
	;
	goto __147
__147:
	offset++
	goto __146
	goto __148
__148:
	;
__134:
	;
	if !(offset%2 != 0) {
		goto __157
	}
	if !(int32(*(*int8)(unsafe.Pointer(bp + 32))) == 'H') {
		goto __158
	}
	value <<= 4
	goto __159
__158:
	value >>= 4
__159:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)), 1))) = uint8(value)
__157:
	;

__160:
	if !(*(*uintptr)(unsafe.Pointer(bp + 80)) < last1) {
		goto __161
	}
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)), 1))) = uint8(0)
	goto __160
__161:
	;
	goto __65

__72:
__73:
__74:
__75:
__76:
__77:
__78:
__79:
__80:
__81:
__82:
__83:
__84:
__85:
__86:
__87:

	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -2) {
		goto __162
	}
	// Note that we are casting away the const-ness of objv, but
	// this is safe since we aren't going to modify the array.

	*(*uintptr)(unsafe.Pointer(bp + 64 /* listv1 */)) = objv + uintptr(arg)*8
	*(*int32)(unsafe.Pointer(bp + 72 /* listc1 */)) = 1
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = 1
	goto __163
__162:
	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 64)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 72)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), bp+72, bp+64)
	}
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -1) {
		goto __164
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = *(*int32)(unsafe.Pointer(bp + 72 /* listc1 */))
__164:
	;
__163:
	;
	arg++
	i = 0
__165:
	if !(i < *(*int32)(unsafe.Pointer(bp + 36))) {
		goto __167
	}
	if !(sFormatNumber(tls, interp, int32(*(*int8)(unsafe.Pointer(bp + 32))), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + uintptr(i)*8)), bp+80) != TCL_OK) {
		goto __168
	}
__169:
	_objPtr4 = resultPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __172
	}
	XTclFreeObj(tls, _objPtr4)
__172:
	;
	goto __170
__170:
	if 0 != 0 {
		goto __169
	}
	goto __171
__171:
	;
	return TCL_ERROR
__168:
	;
	goto __166
__166:
	i++
	goto __165
	goto __167
__167:
	;
	goto __65

__88:
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -2) {
		goto __173
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = 1
__173:
	;
	libc.Xmemset(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)), 0, uint64(*(*int32)(unsafe.Pointer(bp + 36 /* count */))))
	*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)) += uintptr(*(*int32)(unsafe.Pointer(bp + 36 /* count */)))
	goto __65
__89:
	if !(*(*uintptr)(unsafe.Pointer(bp + 80)) > maxPos) {
		goto __174
	}
	maxPos = *(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */))
__174:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -2) {
		goto __175
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* count */)) = 1
__175:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -1 || int64(*(*int32)(unsafe.Pointer(bp + 36))) > (int64(*(*uintptr)(unsafe.Pointer(bp + 80)))-int64(buffer))/1) {
		goto __176
	}
	*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)) = buffer
	goto __177
__176:
	*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)) -= uintptr(*(*int32)(unsafe.Pointer(bp + 36 /* count */)))
__177:
	;
	goto __65
__90:
	if !(*(*uintptr)(unsafe.Pointer(bp + 80)) > maxPos) {
		goto __178
	}
	maxPos = *(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */))
__178:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 36)) == -1) {
		goto __179
	}
	*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)) = maxPos
	goto __180
__179:
	*(*uintptr)(unsafe.Pointer(bp + 80 /* cursor */)) = buffer + uintptr(*(*int32)(unsafe.Pointer(bp + 36)))
__180:
	;
	goto __65
__65:
	;
	goto __60
__61:
	;
	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK

badValue:
	XTcl_ResetResult(tls, interp)
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+9693,
		libc.VaList(bp, errorString, errorValue)))
	return TCL_ERROR

badCount:
	errorString = ts + 9733 /* "missing count fo..." */
	goto error

badIndex:
	errorString = ts + 9771 /* "not enough argum..." */
	goto error

badField:

	*(*[8]int8)(unsafe.Pointer(bp + 92 /* buf */)) = *(*[8]int8)(unsafe.Pointer(ts + 9818))

	XTclUtfToUCS4(tls, errorString, bp+88)
	*(*int8)(unsafe.Pointer(bp + 92 + uintptr(XTclUCS4ToUtf(tls, *(*int32)(unsafe.Pointer(bp + 88 /* ch */)), bp+92)))) = int8(0)
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+9826, libc.VaList(bp+16, bp+92)))
	return TCL_ERROR

error:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, errorString, -1))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// BinaryScanCmd --
//
//	This procedure implements the "binary scan" Tcl command.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XBinaryScanCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBinary.c:1257:1: */
	bp := tls.Alloc(148)
	defer tls.Free(148)

	var arg int32   // Index of next argument to consume.
	var value int32 // Current integer value to be packed.
	// Initialized to avoid compiler warning.
	// var cmd int8 at bp+112, 1
	// Current format character.
	// var count int32 at bp+116, 4
	// Count associated with current format
	// character.
	// var flags int32 at bp+120, 4
	// Format field flags
	// var format uintptr at bp+104, 8
	// Pointer to current position in format
	// string.
	var resultPtr uintptr // Object holding result buffer.
	var buffer uintptr    // Start of result buffer.
	var errorString uintptr
	var str uintptr
	var offset int32
	var size int32
	// var length int32 at bp+96, 4

	var i int32
	var valuePtr uintptr
	var elementPtr uintptr
	// var numberCacheHash Tcl_HashTable at bp+8, 88

	// var numberCachePtr uintptr at bp+128, 8

	var src uintptr
	var src1 uintptr
	var dest uintptr
	var dest1 uintptr
	var src2 uintptr
	var src3 uintptr
	// var ch int32 at bp+136, 4

	// var buf [8]int8 at bp+140, 8
	value = 0
	resultPtr = uintptr(0)

	if !(objc < 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+9851)
	return TCL_ERROR
__1:
	;
	*(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)) = bp + 8 /* &numberCacheHash */
	XTcl_InitHashTable(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)), 1)
	buffer = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+96)
	*(*uintptr)(unsafe.Pointer(bp + 104 /* format */)) = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()
	arg = 3
	offset = 0
__2:
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104))))) != 0) {
		goto __3
	}
	str = *(*uintptr)(unsafe.Pointer(bp + 104 /* format */))
	*(*int32)(unsafe.Pointer(bp + 120 /* flags */)) = 0
	if !!(sGetFormatSpec(tls, bp+104, bp+112, bp+116, bp+120) != 0) {
		goto __4
	}
	goto done
__4:
	;
	switch int32(*(*int8)(unsafe.Pointer(bp + 112 /* cmd */))) {
	case 'a':
		goto __6
	case 'A':
		goto __7
	case 'b':
		goto __8
	case 'B':
		goto __9
	case 'h':
		goto __10
	case 'H':
		goto __11
	case 'c':
		goto __12
	case 't':
		goto __13
	case 's':
		goto __14
	case 'S':
		goto __15
	case 'n':
		goto __16
	case 'i':
		goto __17
	case 'I':
		goto __18
	case 'm':
		goto __19
	case 'w':
		goto __20
	case 'W':
		goto __21
	case 'r':
		goto __22
	case 'R':
		goto __23
	case 'f':
		goto __24
	case 'q':
		goto __25
	case 'Q':
		goto __26
	case 'd':
		goto __27
	case 'x':
		goto __28
	case 'X':
		goto __29
	case '@':
		goto __30
	default:
		goto __31
	}
	goto __5
__6:
__7:

	if !(arg >= objc) {
		goto __32
	}
	sDeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)))
	goto badIndex
__32:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -1) {
		goto __33
	}
	*(*int32)(unsafe.Pointer(bp + 116 /* count */)) = *(*int32)(unsafe.Pointer(bp + 96)) - offset
	goto __34
__33:
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -2) {
		goto __35
	}
	*(*int32)(unsafe.Pointer(bp + 116 /* count */)) = 1
__35:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 116)) > *(*int32)(unsafe.Pointer(bp + 96))-offset) {
		goto __36
	}
	goto done
__36:
	;
__34:
	;

	src = buffer + uintptr(offset)
	size = *(*int32)(unsafe.Pointer(bp + 116 /* count */))

	// Trim trailing nulls and spaces, if necessary.

	if !(int32(*(*int8)(unsafe.Pointer(bp + 112))) == 'A') {
		goto __37
	}
__38:
	if !(size > 0) {
		goto __39
	}
	if !(int32(*(*uint8)(unsafe.Pointer(src + uintptr(size-1)))) != 0 && int32(*(*uint8)(unsafe.Pointer(src + uintptr(size-1)))) != ' ') {
		goto __40
	}
	goto __39
__40:
	;
	size--
	goto __38
__39:
	;
__37:
	;

	// Have to do this #ifdef-fery because (as part of defining
	// Tcl_NewByteArrayObj) we removed the #def that hides this stuff
	// normally. If this code ever gets copied to another file, it
	// should be changed back to the simpler version.

	valuePtr = XTcl_NewByteArrayObj(tls, src, size)

	resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), uintptr(0), valuePtr,
		TCL_LEAVE_ERR_MSG)
	arg++
	if !(resultPtr == uintptr(0)) {
		goto __41
	}
	sDeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)))
	return TCL_ERROR
__41:
	;
	offset = offset + *(*int32)(unsafe.Pointer(bp + 116))
	goto __5

__8:
__9:

	if !(arg >= objc) {
		goto __42
	}
	sDeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)))
	goto badIndex
__42:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -1) {
		goto __43
	}
	*(*int32)(unsafe.Pointer(bp + 116 /* count */)) = (*(*int32)(unsafe.Pointer(bp + 96)) - offset) * 8
	goto __44
__43:
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -2) {
		goto __45
	}
	*(*int32)(unsafe.Pointer(bp + 116 /* count */)) = 1
__45:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 116)) > (*(*int32)(unsafe.Pointer(bp + 96))-offset)*8) {
		goto __46
	}
	goto done
__46:
	;
__44:
	;
	src1 = buffer + uintptr(offset)
	valuePtr = XTcl_NewObj(tls)
	XTcl_SetObjLength(tls, valuePtr, *(*int32)(unsafe.Pointer(bp + 116 /* count */)))
	dest = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes
		}
		return XTcl_GetString(tls, valuePtr)
	}()

	if !(int32(*(*int8)(unsafe.Pointer(bp + 112))) == 'b') {
		goto __47
	}
	i = 0
__49:
	if !(i < *(*int32)(unsafe.Pointer(bp + 116))) {
		goto __51
	}
	if !(i%8 != 0) {
		goto __52
	}
	value >>= 1
	goto __53
__52:
	value = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&src1, 1))))
__53:
	;
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dest, 1))) = func() int8 {
		if value&1 != 0 {
			return int8('1')
		}
		return int8('0')
	}()
	goto __50
__50:
	i++
	goto __49
	goto __51
__51:
	;
	goto __48
__47:
	i = 0
__54:
	if !(i < *(*int32)(unsafe.Pointer(bp + 116))) {
		goto __56
	}
	if !(i%8 != 0) {
		goto __57
	}
	value <<= 1
	goto __58
__57:
	value = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&src1, 1))))
__58:
	;
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dest, 1))) = func() int8 {
		if value&0x80 != 0 {
			return int8('1')
		}
		return int8('0')
	}()
	goto __55
__55:
	i++
	goto __54
	goto __56
__56:
	;
__48:
	;

	resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), uintptr(0), valuePtr,
		TCL_LEAVE_ERR_MSG)
	arg++
	if !(resultPtr == uintptr(0)) {
		goto __59
	}
	sDeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)))
	return TCL_ERROR
__59:
	;
	offset = offset + (*(*int32)(unsafe.Pointer(bp + 116))+7)/8
	goto __5

__10:
__11:

	if !(arg >= objc) {
		goto __60
	}
	sDeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)))
	goto badIndex
__60:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -1) {
		goto __61
	}
	*(*int32)(unsafe.Pointer(bp + 116 /* count */)) = (*(*int32)(unsafe.Pointer(bp + 96)) - offset) * 2
	goto __62
__61:
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -2) {
		goto __63
	}
	*(*int32)(unsafe.Pointer(bp + 116 /* count */)) = 1
__63:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 116)) > (*(*int32)(unsafe.Pointer(bp + 96))-offset)*2) {
		goto __64
	}
	goto done
__64:
	;
__62:
	;
	src2 = buffer + uintptr(offset)
	valuePtr = XTcl_NewObj(tls)
	XTcl_SetObjLength(tls, valuePtr, *(*int32)(unsafe.Pointer(bp + 116 /* count */)))
	dest1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes
		}
		return XTcl_GetString(tls, valuePtr)
	}()

	if !(int32(*(*int8)(unsafe.Pointer(bp + 112))) == 'h') {
		goto __65
	}
	i = 0
__67:
	if !(i < *(*int32)(unsafe.Pointer(bp + 116))) {
		goto __69
	}
	if !(i%2 != 0) {
		goto __70
	}
	value >>= 4
	goto __71
__70:
	value = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&src2, 1))))
__71:
	;
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dest1, 1))) = hexdigit[value&0xF]
	goto __68
__68:
	i++
	goto __67
	goto __69
__69:
	;
	goto __66
__65:
	i = 0
__72:
	if !(i < *(*int32)(unsafe.Pointer(bp + 116))) {
		goto __74
	}
	if !(i%2 != 0) {
		goto __75
	}
	value <<= 4
	goto __76
__75:
	value = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&src2, 1))))
__76:
	;
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dest1, 1))) = hexdigit[value>>4&0xF]
	goto __73
__73:
	i++
	goto __72
	goto __74
__74:
	;
__66:
	;

	resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), uintptr(0), valuePtr,
		TCL_LEAVE_ERR_MSG)
	arg++
	if !(resultPtr == uintptr(0)) {
		goto __77
	}
	sDeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)))
	return TCL_ERROR
__77:
	;
	offset = offset + (*(*int32)(unsafe.Pointer(bp + 116))+1)/2
	goto __5

__12:
	size = 1
	goto scanNumber
__13:
__14:
__15:
	size = 2
	goto scanNumber
__16:
__17:
__18:
	size = 4
	goto scanNumber
__19:
__20:
__21:
	size = 8
	goto scanNumber
__22:
__23:
__24:
	size = int32(unsafe.Sizeof(float32(0)))
	goto scanNumber
__25:
__26:
__27:

	size = int32(unsafe.Sizeof(float64(0)))
	// fall through

scanNumber:
	if !(arg >= objc) {
		goto __78
	}
	sDeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)))
	goto badIndex
__78:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -2) {
		goto __79
	}
	if !(*(*int32)(unsafe.Pointer(bp + 96))-offset < size) {
		goto __81
	}
	goto done
__81:
	;
	valuePtr = sScanNumber(tls, buffer+uintptr(offset), int32(*(*int8)(unsafe.Pointer(bp + 112 /* cmd */))), *(*int32)(unsafe.Pointer(bp + 120 /* flags */)),
		bp+128)
	offset = offset + size
	goto __80
__79:
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -1) {
		goto __82
	}
	*(*int32)(unsafe.Pointer(bp + 116 /* count */)) = (*(*int32)(unsafe.Pointer(bp + 96)) - offset) / size
__82:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 96))-offset < *(*int32)(unsafe.Pointer(bp + 116))*size) {
		goto __83
	}
	goto done
__83:
	;
	valuePtr = XTcl_NewObj(tls)
	src3 = buffer + uintptr(offset)
	i = 0
__84:
	if !(i < *(*int32)(unsafe.Pointer(bp + 116))) {
		goto __86
	}
	elementPtr = sScanNumber(tls, src3, int32(*(*int8)(unsafe.Pointer(bp + 112 /* cmd */))), *(*int32)(unsafe.Pointer(bp + 120 /* flags */)), bp+128)
	src3 += uintptr(size)
	XTcl_ListObjAppendElement(tls, uintptr(0), valuePtr, elementPtr)
	goto __85
__85:
	i++
	goto __84
	goto __86
__86:
	;
	offset = offset + *(*int32)(unsafe.Pointer(bp + 116))*size
__80:
	;

	resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), uintptr(0), valuePtr,
		TCL_LEAVE_ERR_MSG)
	arg++
	if !(resultPtr == uintptr(0)) {
		goto __87
	}
	sDeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)))
	return TCL_ERROR
__87:
	;
	goto __5

__28:
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -2) {
		goto __88
	}
	*(*int32)(unsafe.Pointer(bp + 116 /* count */)) = 1
__88:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -1 || *(*int32)(unsafe.Pointer(bp + 116)) > *(*int32)(unsafe.Pointer(bp + 96))-offset) {
		goto __89
	}
	offset = *(*int32)(unsafe.Pointer(bp + 96 /* length */))
	goto __90
__89:
	offset = offset + *(*int32)(unsafe.Pointer(bp + 116))
__90:
	;
	goto __5
__29:
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -2) {
		goto __91
	}
	*(*int32)(unsafe.Pointer(bp + 116 /* count */)) = 1
__91:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -1 || *(*int32)(unsafe.Pointer(bp + 116)) > offset) {
		goto __92
	}
	offset = 0
	goto __93
__92:
	offset = offset - *(*int32)(unsafe.Pointer(bp + 116))
__93:
	;
	goto __5
__30:
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -2) {
		goto __94
	}
	sDeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)))
	goto badCount
__94:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 116)) == -1 || *(*int32)(unsafe.Pointer(bp + 116)) > *(*int32)(unsafe.Pointer(bp + 96))) {
		goto __95
	}
	offset = *(*int32)(unsafe.Pointer(bp + 96 /* length */))
	goto __96
__95:
	offset = *(*int32)(unsafe.Pointer(bp + 116 /* count */))
__96:
	;
	goto __5
__31:
	sDeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)))
	errorString = str
	goto badField
__5:
	;
	goto __2
__3:
	;

	// Set the result to the last position of the cursor.

done:
	XTcl_SetObjResult(tls, interp, XTcl_NewLongObj(tls, int64(arg-3)))
	sDeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* numberCachePtr */)))

	return TCL_OK

badCount:
	errorString = ts + 9733 /* "missing count fo..." */
	goto error

badIndex:
	errorString = ts + 9771 /* "not enough argum..." */
	goto error

badField:

	*(*[8]int8)(unsafe.Pointer(bp + 140 /* buf */)) = *(*[8]int8)(unsafe.Pointer(ts + 9818))

	XTclUtfToUCS4(tls, errorString, bp+136)
	*(*int8)(unsafe.Pointer(bp + 140 + uintptr(XTclUCS4ToUtf(tls, *(*int32)(unsafe.Pointer(bp + 136 /* ch */)), bp+140)))) = int8(0)
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+9826, libc.VaList(bp, bp+140)))
	return TCL_ERROR

error:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, errorString, -1))
	return TCL_ERROR
}

var hexdigit = *(*[17]int8)(unsafe.Pointer(ts + 9884)) /* tclBinary.c:1417:24 */

//----------------------------------------------------------------------
//
// GetFormatSpec --
//
//	This function parses the format strings used in the binary format and
//	scan commands.
//
// Results:
//	Moves the formatPtr to the start of the next command. Returns the
//	current command character and count in cmdPtr and countPtr. The count
//	is set to BINARY_ALL if the count character was '*' or BINARY_NOCOUNT
//	if no count was specified. Returns 1 on success, or 0 if the string
//	did not have a format specifier.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sGetFormatSpec(tls *libc.TLS, formatPtr uintptr, cmdPtr uintptr, countPtr uintptr, flagsPtr uintptr) int32 { /* tclBinary.c:1632:1: */
	// Skip any leading blanks.

	for int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr))))) == ' ' {
		*(*uintptr)(unsafe.Pointer(formatPtr))++
	}

	// The string was empty, except for whitespace, so fail.

	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr))))) != 0) {
		return 0
	}

	// Extract the command character and any trailing digits or '*'.

	*(*int8)(unsafe.Pointer(cmdPtr)) = *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr))))
	*(*uintptr)(unsafe.Pointer(formatPtr))++
	if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr))))) == 'u' {
		*(*uintptr)(unsafe.Pointer(formatPtr))++
		*(*int32)(unsafe.Pointer(flagsPtr)) |= BINARY_UNSIGNED
	}
	if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr))))) == '*' {
		*(*uintptr)(unsafe.Pointer(formatPtr))++
		*(*int32)(unsafe.Pointer(countPtr)) = -1
	} else if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr)))))))*2)))&int32(X_ISdigit) != 0 { // INTL: digit
		var count uint64

		*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
		count = libc.Xstrtoul(tls, *(*uintptr)(unsafe.Pointer(formatPtr)), formatPtr, 10)
		if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != 0 || count > uint64(0x7fffffff) {
			*(*int32)(unsafe.Pointer(countPtr)) = 0x7fffffff
		} else {
			*(*int32)(unsafe.Pointer(countPtr)) = int32(count)
		}
	} else {
		*(*int32)(unsafe.Pointer(countPtr)) = -2
	}
	return 1
}

//----------------------------------------------------------------------
//
// NeedReversing --
//
//	This routine determines, if bytes of a number need to be re-ordered,
//	and returns a numeric code indicating the re-ordering to be done.
//	This depends on the endiannes of the machine and the desired format.
//	It is in effect a table (whose contents depend on the endianness of
//	the system) describing whether a value needs reversing or not. Anyone
//	porting the code to a big-endian platform should take care to make
//	sure that they define WORDS_BIGENDIAN though this is already done by
//	configure for the Unix build; little-endian platforms (including
//	Windows) don't need to do anything.
//
// Results:
//	0	No re-ordering needed.
//	1	Reverse the bytes:	01234567 <-> 76543210 (little to big)
//	2	Apply this re-ordering: 01234567 <-> 45670123 (Nokia to little)
//	3	Apply this re-ordering: 01234567 <-> 32107654 (Nokia to big)
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func sNeedReversing(tls *libc.TLS, format int32) int32 { /* tclBinary.c:1711:1: */
	switch format {
	// native floats and doubles: never reverse
	case 'd':
		fallthrough
	case 'f':
		fallthrough
		// big endian ints: never reverse
	case 'I':
		fallthrough
	case 'S':
		fallthrough
	case 'W':
		fallthrough
		// small endian floats: reverse if we're big-endian
	case 'r':
		return 0

		// native ints: reverse if we're little-endian
	case 'n':
		fallthrough
	case 't':
		fallthrough
	case 'm':
		fallthrough
		// f: reverse if we're little-endian
	case 'R':
		fallthrough
		// small endian ints: always reverse
	case 'i':
		fallthrough
	case 's':
		fallthrough
	case 'w':
		return 1

	// The Q and q formats need special handling to account for the unusual
	// byte ordering of 8-byte floats on Nokia 770 systems, which claim to be
	// little-endian, but also reverse word order.

	case 'Q':
		if XTclNokia770Doubles(tls) != 0 {
			return 3
		}
		return 1
	case 'q':
		if XTclNokia770Doubles(tls) != 0 {
			return 2
		}
		return 0
	}

	XTcl_Panic(tls, ts+9901, 0)
	return 0
}

//----------------------------------------------------------------------
//
// CopyNumber --
//
//	This routine is called by FormatNumber and ScanNumber to copy a
//	floating-point number. If required, bytes are reversed while copying.
//	The behaviour is only fully defined when used with IEEE float and
//	double values (guaranteed to be 4 and 8 bytes long, respectively.)
//
// Results:
//	None
//
// Side effects:
//	Copies length bytes
//
//----------------------------------------------------------------------

func sCopyNumber(tls *libc.TLS, from uintptr, to uintptr, length uint32, type1 int32) { /* tclBinary.c:1798:1: */
	switch sNeedReversing(tls, type1) {
	case 0:
		libc.Xmemcpy(tls, to, from, uint64(length))
		break
	case 1:
		{
			var fromPtr uintptr = from
			var toPtr uintptr = to

			switch length {
			case uint32(4):
				*(*uint8)(unsafe.Pointer(toPtr)) = *(*uint8)(unsafe.Pointer(fromPtr + 3))
				*(*uint8)(unsafe.Pointer(toPtr + 1)) = *(*uint8)(unsafe.Pointer(fromPtr + 2))
				*(*uint8)(unsafe.Pointer(toPtr + 2)) = *(*uint8)(unsafe.Pointer(fromPtr + 1))
				*(*uint8)(unsafe.Pointer(toPtr + 3)) = *(*uint8)(unsafe.Pointer(fromPtr))
				break
			case uint32(8):
				*(*uint8)(unsafe.Pointer(toPtr)) = *(*uint8)(unsafe.Pointer(fromPtr + 7))
				*(*uint8)(unsafe.Pointer(toPtr + 1)) = *(*uint8)(unsafe.Pointer(fromPtr + 6))
				*(*uint8)(unsafe.Pointer(toPtr + 2)) = *(*uint8)(unsafe.Pointer(fromPtr + 5))
				*(*uint8)(unsafe.Pointer(toPtr + 3)) = *(*uint8)(unsafe.Pointer(fromPtr + 4))
				*(*uint8)(unsafe.Pointer(toPtr + 4)) = *(*uint8)(unsafe.Pointer(fromPtr + 3))
				*(*uint8)(unsafe.Pointer(toPtr + 5)) = *(*uint8)(unsafe.Pointer(fromPtr + 2))
				*(*uint8)(unsafe.Pointer(toPtr + 6)) = *(*uint8)(unsafe.Pointer(fromPtr + 1))
				*(*uint8)(unsafe.Pointer(toPtr + 7)) = *(*uint8)(unsafe.Pointer(fromPtr))
				break
			}
			break

		}
	case 2:
		{
			var fromPtr uintptr = from
			var toPtr uintptr = to

			*(*uint8)(unsafe.Pointer(toPtr)) = *(*uint8)(unsafe.Pointer(fromPtr + 4))
			*(*uint8)(unsafe.Pointer(toPtr + 1)) = *(*uint8)(unsafe.Pointer(fromPtr + 5))
			*(*uint8)(unsafe.Pointer(toPtr + 2)) = *(*uint8)(unsafe.Pointer(fromPtr + 6))
			*(*uint8)(unsafe.Pointer(toPtr + 3)) = *(*uint8)(unsafe.Pointer(fromPtr + 7))
			*(*uint8)(unsafe.Pointer(toPtr + 4)) = *(*uint8)(unsafe.Pointer(fromPtr))
			*(*uint8)(unsafe.Pointer(toPtr + 5)) = *(*uint8)(unsafe.Pointer(fromPtr + 1))
			*(*uint8)(unsafe.Pointer(toPtr + 6)) = *(*uint8)(unsafe.Pointer(fromPtr + 2))
			*(*uint8)(unsafe.Pointer(toPtr + 7)) = *(*uint8)(unsafe.Pointer(fromPtr + 3))
			break

		}
	case 3:
		{
			var fromPtr uintptr = from
			var toPtr uintptr = to

			*(*uint8)(unsafe.Pointer(toPtr)) = *(*uint8)(unsafe.Pointer(fromPtr + 3))
			*(*uint8)(unsafe.Pointer(toPtr + 1)) = *(*uint8)(unsafe.Pointer(fromPtr + 2))
			*(*uint8)(unsafe.Pointer(toPtr + 2)) = *(*uint8)(unsafe.Pointer(fromPtr + 1))
			*(*uint8)(unsafe.Pointer(toPtr + 3)) = *(*uint8)(unsafe.Pointer(fromPtr))
			*(*uint8)(unsafe.Pointer(toPtr + 4)) = *(*uint8)(unsafe.Pointer(fromPtr + 7))
			*(*uint8)(unsafe.Pointer(toPtr + 5)) = *(*uint8)(unsafe.Pointer(fromPtr + 6))
			*(*uint8)(unsafe.Pointer(toPtr + 6)) = *(*uint8)(unsafe.Pointer(fromPtr + 5))
			*(*uint8)(unsafe.Pointer(toPtr + 7)) = *(*uint8)(unsafe.Pointer(fromPtr + 4))
			break

		}
	}
}

//----------------------------------------------------------------------
//
// FormatNumber --
//
//	This routine is called by Tcl_BinaryObjCmd to format a number into a
//	location pointed at by cursor.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Moves the cursor to the next location to be written into.
//
//----------------------------------------------------------------------

func sFormatNumber(tls *libc.TLS, interp uintptr, type1 int32, src uintptr, cursorPtr uintptr) int32 { /* tclBinary.c:1881:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// var value int64 at bp+24, 8

	// var dvalue float64 at bp, 8

	// var wvalue Tcl_WideInt at bp+16, 8

	// var fvalue float32 at bp+8, 4

	switch type1 {
	case 'd':
		fallthrough
	case 'q':
		fallthrough
	case 'Q':
		// Double-precision floating point values. Tcl_GetDoubleFromObj
		// returns TCL_ERROR for NaN, but we can check by comparing the
		// object's type pointer.

		if XTcl_GetDoubleFromObj(tls, interp, src, bp) != TCL_OK {
			if (*Tcl_Obj)(unsafe.Pointer(src)).FtypePtr != uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return TCL_ERROR
			}
			*(*float64)(unsafe.Pointer(bp /* dvalue */)) = *(*float64)(unsafe.Pointer(src + 32))
		}
		sCopyNumber(tls, bp, *(*uintptr)(unsafe.Pointer(cursorPtr)), uint32(unsafe.Sizeof(float64(0))), type1)
		*(*uintptr)(unsafe.Pointer(cursorPtr)) += uintptr(unsafe.Sizeof(float64(0)))
		return TCL_OK

	case 'f':
		fallthrough
	case 'r':
		fallthrough
	case 'R':
		// Single-precision floating point values. Tcl_GetDoubleFromObj
		// returns TCL_ERROR for NaN, but we can check by comparing the
		// object's type pointer.

		if XTcl_GetDoubleFromObj(tls, interp, src, bp) != TCL_OK {
			if (*Tcl_Obj)(unsafe.Pointer(src)).FtypePtr != uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return TCL_ERROR
			}
			*(*float64)(unsafe.Pointer(bp /* dvalue */)) = *(*float64)(unsafe.Pointer(src + 32))
		}

		// Because some compilers will generate floating point exceptions on
		// an overflow cast (e.g. Borland), we restrict the values to the
		// valid range for float.

		if libc.Xfabs(tls, *(*float64)(unsafe.Pointer(bp))) > 3.40282346638528859811704183484516925e+38 {
			if *(*float64)(unsafe.Pointer(bp)) >= 0.0 {
				*(*float32)(unsafe.Pointer(bp + 8 /* fvalue */)) = 3.40282346638528859811704183484516925e+38
			} else {
				*(*float32)(unsafe.Pointer(bp + 8 /* fvalue */)) = -3.40282346638528859811704183484516925e+38
			}
		} else {
			*(*float32)(unsafe.Pointer(bp + 8 /* fvalue */)) = float32(*(*float64)(unsafe.Pointer(bp /* dvalue */)))
		}
		sCopyNumber(tls, bp+8, *(*uintptr)(unsafe.Pointer(cursorPtr)), uint32(unsafe.Sizeof(float32(0))), type1)
		*(*uintptr)(unsafe.Pointer(cursorPtr)) += uintptr(unsafe.Sizeof(float32(0)))
		return TCL_OK

		// 64-bit integer values.
	case 'w':
		fallthrough
	case 'W':
		fallthrough
	case 'm':
		if XTcl_GetWideIntFromObj(tls, interp, src, bp+16) != TCL_OK {
			return TCL_ERROR
		}
		if sNeedReversing(tls, type1) != 0 {
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)))
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 32)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 40)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 48)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 56)
		} else {
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 56)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 48)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 40)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 32)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*Tcl_WideInt)(unsafe.Pointer(bp + 16)))
		}
		return TCL_OK

		// 32-bit integer values.
	case 'i':
		fallthrough
	case 'I':
		fallthrough
	case 'n':
		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(src)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
				return func() int32 { *(*int64)(unsafe.Pointer(bp + 24)) = *(*int64)(unsafe.Pointer(src + 32)); return TCL_OK }()
			}
			return XTcl_GetLongFromObj(tls, interp, src, bp+24)
		}() != TCL_OK {
			return TCL_ERROR
		}
		if sNeedReversing(tls, type1) != 0 {
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)))
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)) >> 24)
		} else {
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)))
		}
		return TCL_OK

		// 16-bit integer values.
	case 's':
		fallthrough
	case 'S':
		fallthrough
	case 't':
		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(src)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
				return func() int32 { *(*int64)(unsafe.Pointer(bp + 24)) = *(*int64)(unsafe.Pointer(src + 32)); return TCL_OK }()
			}
			return XTcl_GetLongFromObj(tls, interp, src, bp+24)
		}() != TCL_OK {
			return TCL_ERROR
		}
		if sNeedReversing(tls, type1) != 0 {
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)))
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)) >> 8)
		} else {
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)))
		}
		return TCL_OK

		// 8-bit integer values.
	case 'c':
		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(src)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
				return func() int32 { *(*int64)(unsafe.Pointer(bp + 24)) = *(*int64)(unsafe.Pointer(src + 32)); return TCL_OK }()
			}
			return XTcl_GetLongFromObj(tls, interp, src, bp+24)
		}() != TCL_OK {
			return TCL_ERROR
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(cursorPtr)), 1))) = uint8(*(*int64)(unsafe.Pointer(bp + 24)))
		return TCL_OK

	default:
		XTcl_Panic(tls, ts+9901, 0)
		return TCL_ERROR
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// ScanNumber --
//
//	This routine is called by Tcl_BinaryObjCmd to scan a number out of a
//	buffer.
//
// Results:
//	Returns a newly created object containing the scanned number. This
//	object has a ref count of zero.
//
// Side effects:
//	Might reuse an object in the number cache, place a new object in the
//	cache, or delete the cache and set the reference to it (itself passed
//	in by reference) to NULL.
//
//----------------------------------------------------------------------

func sScanNumber(tls *libc.TLS, buffer uintptr, type1 int32, flags int32, numberCachePtrPtr uintptr) uintptr { /* tclBinary.c:2050:16: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var value int64
	// var fvalue float32 at bp+32, 4

	// var dvalue float64 at bp+40, 8

	var uwvalue Tcl_WideUInt
	var objPtr uintptr
	var tablePtr uintptr
	var hPtr uintptr
	// var isNew int32 at bp, 4

	var bigObj uintptr
	// var big Mp_int at bp+8, 24

	// We cannot rely on the compiler to properly sign extend integer values
	// when we cast from smaller values to larger values because we don't know
	// the exact size of the integer types. So, we have to handle sign
	// extension explicitly by checking the high bit and padding with 1's as
	// needed. This practice is disabled if the BINARY_UNSIGNED flag is set.

	switch type1 {
	case 'c':
		goto __2

		// 16-bit numeric values. We need the sign extension trick (see above)
		// here as well.

	case 's':
		goto __3
	case 'S':
		goto __4
	case 't':
		goto __5

		// 32-bit numeric values.

	case 'i':
		goto __6
	case 'I':
		goto __7
	case 'n':
		goto __8

		// Do not cache wide (64-bit) values; they are already too large to
		// use as keys.

	case 'w':
		goto __9
	case 'W':
		goto __10
	case 'm':
		goto __11

		// Do not cache double values; they are already too large to use as
		// keys and the values stored are utterly incompatible with the
		// integer part of the cache.

		// 32-bit IEEE single-precision floating point.

	case 'f':
		goto __12
	case 'R':
		goto __13
	case 'r':
		goto __14

		// 64-bit IEEE double-precision floating point.

	case 'd':
		goto __15
	case 'Q':
		goto __16
	case 'q':
		goto __17
	}
	goto __1
__2:
	// Characters need special handling. We want to produce a signed
	// result, but on some platforms (such as AIX) chars are unsigned. To
	// deal with this, check for a value that should be negative but
	// isn't.

	value = int64(*(*uint8)(unsafe.Pointer(buffer)))
	if !!(flags&BINARY_UNSIGNED != 0) {
		goto __18
	}
	if !(value&int64(0x80) != 0) {
		goto __19
	}
	value = value | int64(-0x100)
__19:
	;
__18:
	;
	goto returnNumericObject

	// 16-bit numeric values. We need the sign extension trick (see above)
	// here as well.

__3:
__4:
__5:
	if !(sNeedReversing(tls, type1) != 0) {
		goto __20
	}
	value = int64(int32(*(*uint8)(unsafe.Pointer(buffer))) + int32(*(*uint8)(unsafe.Pointer(buffer + 1)))<<8)
	goto __21
__20:
	value = int64(int32(*(*uint8)(unsafe.Pointer(buffer + 1))) + int32(*(*uint8)(unsafe.Pointer(buffer)))<<8)
__21:
	;
	if !!(flags&BINARY_UNSIGNED != 0) {
		goto __22
	}
	if !(value&int64(0x8000) != 0) {
		goto __23
	}
	value = value | int64(-0x10000)
__23:
	;
__22:
	;
	goto returnNumericObject

	// 32-bit numeric values.

__6:
__7:
__8:
	if !(sNeedReversing(tls, type1) != 0) {
		goto __24
	}
	value = int64(int32(*(*uint8)(unsafe.Pointer(buffer)))+
		int32(*(*uint8)(unsafe.Pointer(buffer + 1)))<<8+
		int32(*(*uint8)(unsafe.Pointer(buffer + 2)))<<16) +
		int64(*(*uint8)(unsafe.Pointer(buffer + 3)))<<24
	goto __25
__24:
	value = int64(int32(*(*uint8)(unsafe.Pointer(buffer + 3)))+
		int32(*(*uint8)(unsafe.Pointer(buffer + 2)))<<8+
		int32(*(*uint8)(unsafe.Pointer(buffer + 1)))<<16) +
		int64(*(*uint8)(unsafe.Pointer(buffer)))<<24
__25:
	;

	// Check to see if the value was sign extended properly on systems
	// where an int is more than 32-bits.
	//
	// We avoid caching unsigned integers as we cannot distinguish between
	// 32bit signed and unsigned in the hash (short and char are ok).

	if !(flags&BINARY_UNSIGNED != 0) {
		goto __26
	}
	return XTcl_NewWideIntObj(tls, Tcl_WideInt(uint64(value)))
__26:
	;
	if !(value&int64(uint32(uint32(1))<<31) != 0 && value > int64(0)) {
		goto __27
	}
	value = value - int64(uint32(uint32(1))<<31)
	value = value - int64(uint32(uint32(1))<<31)
__27:
	;

returnNumericObject:
	if !(*(*uintptr)(unsafe.Pointer(numberCachePtrPtr)) == uintptr(0)) {
		goto __28
	}
	return XTcl_NewLongObj(tls, value)
	goto __29
__28:
	tablePtr = *(*uintptr)(unsafe.Pointer(numberCachePtrPtr))

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})).f(tls, tablePtr, uintptr(value), bp /* &isNew */)
	if !!(*(*int32)(unsafe.Pointer(bp)) != 0) {
		goto __30
	}
	return (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
__30:
	;
	if !((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumEntries <= BINARY_SCAN_MAX_CACHE) {
		goto __31
	}
	objPtr = XTcl_NewLongObj(tls, value)

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = objPtr
	return objPtr
__31:
	;

	// We've overflowed the cache! Someone's parsing a LOT of varied
	// binary data in a single call! Bail out by switching back to the
	// old behaviour for the rest of the scan.
	//
	// Note that anyone just using the 'c' conversion (for bytes)
	// cannot trigger this.

	sDeleteScanNumberCache(tls, tablePtr)
	*(*uintptr)(unsafe.Pointer(numberCachePtrPtr)) = uintptr(0)
	return XTcl_NewLongObj(tls, value)
__29:
	;

	// Do not cache wide (64-bit) values; they are already too large to
	// use as keys.

__9:
__10:
__11:
	if !(sNeedReversing(tls, type1) != 0) {
		goto __32
	}
	uwvalue = Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer))) |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 1)))<<8 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 2)))<<16 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 3)))<<24 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 4)))<<32 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 5)))<<40 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 6)))<<48 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 7)))<<56
	goto __33
__32:
	uwvalue = Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 7))) |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 6)))<<8 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 5)))<<16 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 4)))<<24 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 3)))<<32 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 2)))<<40 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer + 1)))<<48 |
		Tcl_WideUInt(*(*uint8)(unsafe.Pointer(buffer)))<<56
__33:
	;
	if !(flags&BINARY_UNSIGNED != 0) {
		goto __34
	}
	bigObj = uintptr(0)

	XTclBNInitBignumFromWideUInt(tls, bp+8, uwvalue)
	bigObj = XTcl_NewBignumObj(tls, bp+8)
	return bigObj
__34:
	;
	return XTcl_NewWideIntObj(tls, Tcl_WideInt(uwvalue))

	// Do not cache double values; they are already too large to use as
	// keys and the values stored are utterly incompatible with the
	// integer part of the cache.

	// 32-bit IEEE single-precision floating point.

__12:
__13:
__14:
	sCopyNumber(tls, buffer, bp+32, uint32(unsafe.Sizeof(float32(0))), type1)
	return XTcl_NewDoubleObj(tls, float64(*(*float32)(unsafe.Pointer(bp + 32 /* fvalue */))))

	// 64-bit IEEE double-precision floating point.

__15:
__16:
__17:
	sCopyNumber(tls, buffer, bp+40, uint32(unsafe.Sizeof(float64(0))), type1)
	return XTcl_NewDoubleObj(tls, *(*float64)(unsafe.Pointer(bp + 40 /* dvalue */)))
__1:
	;
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// DeleteScanNumberCache --
//
//	Deletes the hash table acting as a scan number cache.
//
// Results:
//	None
//
// Side effects:
//	Decrements the reference counts of the objects in the cache.
//
//----------------------------------------------------------------------

func sDeleteScanNumberCache(tls *libc.TLS, numberCachePtr uintptr) { /* tclBinary.c:2262:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var hEntry uintptr
	// var search Tcl_HashSearch at bp, 24

	if numberCachePtr == uintptr(0) {
		return
	}

	hEntry = XTcl_FirstHashEntry(tls, numberCachePtr, bp)
	for hEntry != uintptr(0) {
		var value uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hEntry)).FclientData

		if value != uintptr(0) {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = value
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		hEntry = XTcl_NextHashEntry(tls, bp)
	}
	XTcl_DeleteHashTable(tls, numberCachePtr)
}

// ----------------------------------------------------------------------
//
// NOTES --
//
//	Some measurements show that it is faster to use a table to to perform
//	uuencode and base64 value encoding than to calculate the output (at
//	least on intel P4 arch).
//
//	Conversely using a lookup table for the decoding is slower than just
//	calculating the values. We therefore use the fastest of each method.
//
//	Presumably this has to do with the size of the tables. The base64
//	decode table is 255 bytes while the encode table is only 65 bytes. The
//	choice likely depends on CPU memory cache sizes.

//----------------------------------------------------------------------
//
// BinaryEncodeHex --
//
//	Implement the [binary encode hex] binary encoding. clientData must be
//	a table to convert values to hexadecimal digits.
//
// Results:
//	Interp result set to an encoded byte array object
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func sBinaryEncodeHex(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBinary.c:2322:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var resultObj uintptr = uintptr(0)
	var data uintptr = uintptr(0)
	var cursor uintptr = uintptr(0)
	var offset int32 = 0
	*(*int32)(unsafe.Pointer(bp /* count */)) = 0

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9924)
		return TCL_ERROR
	}

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultObj = XTclThreadAllocObj(tls)
		} else {
			resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)
	{
	}

	data = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	cursor = XTcl_SetByteArrayLength(tls, resultObj, *(*int32)(unsafe.Pointer(bp))*2)
	for offset = 0; offset < *(*int32)(unsafe.Pointer(bp /* count */)); offset++ {
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(sHexDigits[int32(*(*uint8)(unsafe.Pointer(data + uintptr(offset))))>>4&0x0F])
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(sHexDigits[int32(*(*uint8)(unsafe.Pointer(data + uintptr(offset))))&0x0F])
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// BinaryDecodeHex --
//
//	Implement the [binary decode hex] binary encoding.
//
// Results:
//	Interp result set to an decoded byte array object
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func sBinaryDecodeHex(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBinary.c:2366:1: */
	bp := tls.Alloc(66)
	defer tls.Free(66)

	var resultObj uintptr
	var data uintptr
	var datastart uintptr
	var dataend uintptr
	var begin uintptr
	var cursor uintptr
	var c uint8
	var i int32
	// var index int32 at bp+56, 4

	var value int32
	var size int32
	var pure int32
	// var count int32 at bp+60, 4

	var cut int32
	var strict int32
	// var ch Tcl_UniChar at bp+64, 2

	var cachePtr uintptr
	var cachePtr1 uintptr
	resultObj = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 60 /* count */)) = 0
	cut = 0
	strict = 0
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 64 /* ch */)) = Tcl_UniChar(0)

	if !(objc < 2 || objc > 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9929)
	return TCL_ERROR
__1:
	;
	i = 1
__2:
	if !(i < objc-1) {
		goto __4
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&optStrings)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp+56) != TCL_OK) {
		goto __5
	}
	return TCL_ERROR
__5:
	;
	switch *(*int32)(unsafe.Pointer(bp + 56 /* index */)) {
	case 0 /* OPT_STRICT */ :
		goto __7
	}
	goto __6
__7:
	strict = 1
	goto __6
__6:
	;
	goto __3
__3:
	i++
	goto __2
	goto __4
__4:
	;

__8:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __11
	}
	resultObj = XTclThreadAllocObj(tls)
	goto __12
__11:
	resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__12:
	;
	goto __9
__9:
	if 0 != 0 {
		goto __8
	}
	goto __10
__10:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)

	pure = libc.Bool32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes == uintptr(0))
	datastart = libc.AssignUintptr(&data, func() uintptr {
		if pure != 0 {
			return XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), bp+60)
		}
		return func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 60)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), bp+60)
		}()
	}())
	dataend = data + uintptr(*(*int32)(unsafe.Pointer(bp + 60)))
	size = (*(*int32)(unsafe.Pointer(bp + 60)) + 1) / 2
	begin = libc.AssignUintptr(&cursor, XTcl_SetByteArrayLength(tls, resultObj, size))
__13:
	if !(data < dataend) {
		goto __14
	}
	value = 0
	i = 0
__15:
	if !(i < 2) {
		goto __17
	}
	if !(data >= dataend) {
		goto __18
	}
	value <<= 4
	goto __17
__18:
	;

	c = *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&data, 1)))
	if !!(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(c))*2)))&int32(X_ISxdigit) != 0) {
		goto __19
	}
	if !(strict != 0 || !(XTclIsSpaceProc(tls, int32(c)) != 0)) {
		goto __20
	}
	goto badChar
__20:
	;
	i--
	goto __16
__19:
	;

	value <<= 4
	c = uint8(int32(c) - '0')
	if !(int32(c) > 9) {
		goto __21
	}
	c = libc.Uint8FromInt32(int32(c) + ('0' - 'A' + 10))
__21:
	;
	if !(int32(c) > 16) {
		goto __22
	}
	c = libc.Uint8FromInt32(int32(c) + ('A' - 'a'))
__22:
	;
	value = value | int32(c)&0xF
	goto __16
__16:
	i++
	goto __15
	goto __17
__17:
	;
	if !(i < 2) {
		goto __23
	}
	cut++
__23:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(value)
	value = 0
	goto __13
__14:
	;
	if !(cut > size) {
		goto __24
	}
	cut = size
__24:
	;
	XTcl_SetByteArrayLength(tls, resultObj, int32((int64(cursor)-int64(begin))/1-int64(cut)))
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK

badChar:
	if !(pure != 0) {
		goto __25
	}
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 64 /* ch */)) = Tcl_UniChar(c)
	goto __26
__25:
	if int32(uint8(*(*int8)(unsafe.Pointer(data - uintptr(1))))) < 0x80 {
		*(*Tcl_UniChar)(unsafe.Pointer(bp + 64)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(data - uintptr(1)))))
	} else {
		XTcl_UtfToUniChar(tls, data-uintptr(1), bp+64)
	}
__26:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount, 1) > 1) {
		goto __27
	}
	goto __28
__27:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __29
	}

	if !((*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != XtclEmptyStringRep) {
		goto __31
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes)
__31:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = -1
__32:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __35
	}
	XTclThreadFreeObj(tls, resultObj)
	goto __36
__35:
	*(*uintptr)(unsafe.Pointer(resultObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = resultObj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__36:
	;
	goto __33
__33:
	if 0 != 0 {
		goto __32
	}
	goto __34
__34:
	;
	goto __30
__29:
	XTclFreeObj(tls, resultObj)
__30:
	;
__28:
	;

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+9951,
		libc.VaList(bp, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 64 /* ch */))), int32((int64(data)-int64(datastart))/1-int64(1)))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+9997, ts+10004, ts+10011, uintptr(0)))
	return TCL_ERROR
}

var optStrings = [2]uintptr{ts + 10019, uintptr(0)} /* tclBinary.c:2378:23 */

//----------------------------------------------------------------------
//
// BinaryEncode64 --
//
//	This procedure implements the "binary encode base64" Tcl command.
//
// Results:
//	The base64 encoded value prescribed by the input arguments.
//
//----------------------------------------------------------------------

func sBinaryEncode64(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBinary.c:2487:1: */
	bp := tls.Alloc(59)
	defer tls.Free(59)

	var resultObj uintptr
	var data uintptr
	var limit uintptr
	*(*int32)(unsafe.Pointer(bp + 44 /* maxlen */)) = 0
	var wrapchar uintptr = ts + 350 /* "\n" */
	*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */)) = 1
	var offset int32
	var i int32
	// var index int32 at bp+40, 4

	var size int32
	var outindex int32 = 0
	*(*int32)(unsafe.Pointer(bp + 52 /* count */)) = 0
	var purewrap int32 = 1

	if objc < 2 || objc%2 != 0 {
		XTcl_WrongNumArgs(tls, interp, 1, objv,
			ts+10027)
		return TCL_ERROR
	}
	for i = 1; i < objc-1; i = i + 2 {
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&optStrings1)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp+40) != TCL_OK {
			return TCL_ERROR
		}
		switch *(*int32)(unsafe.Pointer(bp + 40 /* index */)) {
		case 0 /* OPT_MAXLEN */ :
			if XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+44) != TCL_OK {
				return TCL_ERROR
			}
			if *(*int32)(unsafe.Pointer(bp + 44)) < 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+10063, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+9997, ts+10088,
					ts+10095, uintptr(0)))
				return TCL_ERROR
			}
			break
		case 1 /* OPT_WRAPCHAR */ :
			purewrap = libc.Bool32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))).Fbytes == uintptr(0))
			if purewrap != 0 {
				wrapchar = XTcl_GetByteArrayFromObj(tls,
					*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+48)
			} else {
				wrapchar = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+48)
			}
			break
		}
	}
	if *(*int32)(unsafe.Pointer(bp + 48)) == 0 {
		*(*int32)(unsafe.Pointer(bp + 44 /* maxlen */)) = 0
	}

	resultObj = XTcl_NewObj(tls)
	data = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), bp+52)
	if *(*int32)(unsafe.Pointer(bp + 52)) > 0 {
		var cursor uintptr = uintptr(0)

		size = (*(*int32)(unsafe.Pointer(bp + 52))*4/3 + 3) & libc.CplInt32(3) // ensure 4 byte chunks
		if *(*int32)(unsafe.Pointer(bp + 44)) > 0 && size > *(*int32)(unsafe.Pointer(bp + 44)) {
			var adjusted int32 = size + *(*int32)(unsafe.Pointer(bp + 48))*(size / *(*int32)(unsafe.Pointer(bp + 44)))

			if size%*(*int32)(unsafe.Pointer(bp + 44)) == 0 {
				adjusted = adjusted - *(*int32)(unsafe.Pointer(bp + 48))
			}
			size = adjusted

			if purewrap == 0 {
				// Wrapchar is (possibly) non-byte, so build result as
				// general string, not bytearray
				XTcl_SetObjLength(tls, resultObj, size)
				cursor = func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes
					}
					return XTcl_GetString(tls, resultObj)
				}()
			}
		}
		if cursor == uintptr(0) {
			cursor = XTcl_SetByteArrayLength(tls, resultObj, size)
		}
		limit = cursor + uintptr(size)
		for offset = 0; offset < *(*int32)(unsafe.Pointer(bp + 52 /* count */)); offset = offset + 3 {
			*(*[3]uint8)(unsafe.Pointer(bp + 56 /* d */)) = [3]uint8{uint8(0), uint8(0), uint8(0)}

			for i = 0; i < 3 && offset+i < *(*int32)(unsafe.Pointer(bp + 52 /* count */)); i++ {
				*(*uint8)(unsafe.Pointer(bp + 56 + uintptr(i))) = *(*uint8)(unsafe.Pointer(data + uintptr(offset+i)))
			}
			for ok := true; ok; ok = 0 != 0 {
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(sB64Digits[int32(*(*uint8)(unsafe.Pointer(bp + 56)))>>2])
				outindex++
				if *(*int32)(unsafe.Pointer(bp + 44)) > 0 && cursor != limit {
					if outindex == *(*int32)(unsafe.Pointer(bp + 44)) {
						libc.Xmemcpy(tls, cursor, wrapchar, uint64(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */))))
						cursor += uintptr(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */)))
						outindex = 0
					}
				}
				if cursor > limit {
					XTcl_Panic(tls, ts+10107, 0)
				}
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(sB64Digits[int32(*(*uint8)(unsafe.Pointer(bp + 56)))&0x03<<4|int32(*(*uint8)(unsafe.Pointer(bp + 56 + 1)))>>4])
				outindex++
				if *(*int32)(unsafe.Pointer(bp + 44)) > 0 && cursor != limit {
					if outindex == *(*int32)(unsafe.Pointer(bp + 44)) {
						libc.Xmemcpy(tls, cursor, wrapchar, uint64(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */))))
						cursor += uintptr(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */)))
						outindex = 0
					}
				}
				if cursor > limit {
					XTcl_Panic(tls, ts+10107, 0)
				}
			}
			if offset+1 < *(*int32)(unsafe.Pointer(bp + 52)) {
				for ok2 := true; ok2; ok2 = 0 != 0 {
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(sB64Digits[int32(*(*uint8)(unsafe.Pointer(bp + 56 + 1)))&0x0F<<2|int32(*(*uint8)(unsafe.Pointer(bp + 56 + 2)))>>6])
					outindex++
					if *(*int32)(unsafe.Pointer(bp + 44)) > 0 && cursor != limit {
						if outindex == *(*int32)(unsafe.Pointer(bp + 44)) {
							libc.Xmemcpy(tls, cursor, wrapchar, uint64(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */))))
							cursor += uintptr(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */)))
							outindex = 0
						}
					}
					if cursor > limit {
						XTcl_Panic(tls, ts+10107, 0)
					}
				}
			} else {
				for ok3 := true; ok3; ok3 = 0 != 0 {
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(sB64Digits[64])
					outindex++
					if *(*int32)(unsafe.Pointer(bp + 44)) > 0 && cursor != limit {
						if outindex == *(*int32)(unsafe.Pointer(bp + 44)) {
							libc.Xmemcpy(tls, cursor, wrapchar, uint64(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */))))
							cursor += uintptr(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */)))
							outindex = 0
						}
					}
					if cursor > limit {
						XTcl_Panic(tls, ts+10107, 0)
					}
				}
			}
			if offset+2 < *(*int32)(unsafe.Pointer(bp + 52)) {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(sB64Digits[int32(*(*uint8)(unsafe.Pointer(bp + 56 + 2)))&0x3F])
					outindex++
					if *(*int32)(unsafe.Pointer(bp + 44)) > 0 && cursor != limit {
						if outindex == *(*int32)(unsafe.Pointer(bp + 44)) {
							libc.Xmemcpy(tls, cursor, wrapchar, uint64(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */))))
							cursor += uintptr(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */)))
							outindex = 0
						}
					}
					if cursor > limit {
						XTcl_Panic(tls, ts+10107, 0)
					}
				}
			} else {
				for ok5 := true; ok5; ok5 = 0 != 0 {
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(sB64Digits[64])
					outindex++
					if *(*int32)(unsafe.Pointer(bp + 44)) > 0 && cursor != limit {
						if outindex == *(*int32)(unsafe.Pointer(bp + 44)) {
							libc.Xmemcpy(tls, cursor, wrapchar, uint64(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */))))
							cursor += uintptr(*(*int32)(unsafe.Pointer(bp + 48 /* wrapcharlen */)))
							outindex = 0
						}
					}
					if cursor > limit {
						XTcl_Panic(tls, ts+10107, 0)
					}
				}
			}
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

var optStrings1 = [3]uintptr{ts + 10117, ts + 10125, uintptr(0)} /* tclBinary.c:2500:23 */

//----------------------------------------------------------------------
//
// BinaryEncodeUu --
//
//	This implements the uuencode binary encoding. Input is broken into 6
//	bit chunks and a lookup table is used to turn these values into output
//	characters. This differs from the generic code above in that line
//	lengths are also encoded.
//
// Results:
//	Interp result set to an encoded byte array object
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func sBinaryEncodeUu(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBinary.c:2610:1: */
	bp := tls.Alloc(100)
	defer tls.Free(100)

	var resultObj uintptr
	var data uintptr
	var start uintptr
	var cursor uintptr
	var offset int32
	// var count int32 at bp+96, 4

	var rawLength int32
	var n int32
	var i int32
	var j int32
	var bits int32
	// var index int32 at bp+84, 4

	// var lineLength int32 at bp+88, 4

	// var SingleNewline [1]uint8 at bp+80, 1

	var wrapchar uintptr
	// var wrapcharlen int32 at bp+92, 4

	var p uintptr
	var numBytes int32
	var cachePtr uintptr
	var lineLen int32
	*(*int32)(unsafe.Pointer(bp + 88 /* lineLength */)) = 61
	*(*[1]uint8)(unsafe.Pointer(bp + 80 /* SingleNewline */)) = [1]uint8{uint8('\n')}
	wrapchar = bp + 80 /* SingleNewline */
	*(*int32)(unsafe.Pointer(bp + 92 /* wrapcharlen */)) = int32(unsafe.Sizeof([1]uint8{}))

	if !(objc < 2 || objc%2 != 0) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+10027)
	return TCL_ERROR
__1:
	;
	i = 1
__2:
	if !(i < objc-1) {
		goto __4
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&optStrings2)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp+84) != TCL_OK) {
		goto __5
	}
	return TCL_ERROR
__5:
	;
	switch *(*int32)(unsafe.Pointer(bp + 84 /* index */)) {
	case 0 /* OPT_MAXLEN */ :
		goto __7
	case 1 /* OPT_WRAPCHAR */ :
		goto __8
	}
	goto __6
__7:
	if !(XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)),
		bp+88) != TCL_OK) {
		goto __9
	}
	return TCL_ERROR
__9:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 88)) < 5 || *(*int32)(unsafe.Pointer(bp + 88)) > 85) {
		goto __10
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+10063, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+9997, ts+10088,
		ts+10095, uintptr(0)))
	return TCL_ERROR
__10:
	;
	*(*int32)(unsafe.Pointer(bp + 88 /* lineLength */)) = (*(*int32)(unsafe.Pointer(bp + 88))-1)&-4 + 1 // 5, 9, 13 ...
	goto __6
__8:
	wrapchar = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 92)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+92)
	}()
	p = wrapchar
	numBytes = *(*int32)(unsafe.Pointer(bp + 92 /* wrapcharlen */))

__11:
	if !(numBytes != 0) {
		goto __12
	}
	switch int32(*(*uint8)(unsafe.Pointer(p))) {
	case '\t':
		goto __14
	case '\v':
		goto __15
	case '\f':
		goto __16
	case '\r':
		goto __17
	case '\n':
		goto __18
	default:
		goto __19
	}
	goto __13
__14:
__15:
__16:
__17:
	p++
	numBytes--
	goto __11
__18:
	numBytes--
	goto __13
__19:
badwrap:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+10135,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+9997,
		ts+10088, ts+10174, uintptr(0)))
	return TCL_ERROR
__13:
	;
	goto __11
__12:
	;
	if !(numBytes != 0) {
		goto __20
	}
	goto badwrap
__20:
	;

	goto __6
__6:
	;
	goto __3
__3:
	i = i + 2
	goto __2
	goto __4
__4:
	;

	// Allocate the buffer. This is a little bit too long, but is "good
	// enough".

__21:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __24
	}
	resultObj = XTclThreadAllocObj(tls)
	goto __25
__24:
	resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__25:
	;
	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)

	offset = 0
	data = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), bp+96)
	rawLength = (*(*int32)(unsafe.Pointer(bp + 88)) - 1) * 3 / 4
	start = libc.AssignUintptr(&cursor, XTcl_SetByteArrayLength(tls, resultObj,
		(*(*int32)(unsafe.Pointer(bp + 88))+*(*int32)(unsafe.Pointer(bp + 92)))*((*(*int32)(unsafe.Pointer(bp + 96))+(rawLength-1))/rawLength)))
	n = libc.AssignInt32(&bits, 0)

	// Encode the data. Each output line first has the length of raw data
	// encoded by the output line described in it by one encoded byte, then
	// the encoded data follows (encoding each 6 bits as one character).
	// Encoded lines are always terminated by a newline.

__26:
	if !(offset < *(*int32)(unsafe.Pointer(bp + 96))) {
		goto __27
	}
	lineLen = *(*int32)(unsafe.Pointer(bp + 96)) - offset

	if !(lineLen > rawLength) {
		goto __28
	}
	lineLen = rawLength
__28:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(sUueDigits[lineLen])
	i = 0
__29:
	if !(i < lineLen) {
		goto __31
	}
	n <<= 8
	n = n | int32(*(*uint8)(unsafe.Pointer(data + uintptr(libc.PostIncInt32(&offset, 1)))))
	bits = bits + 8
__32:
	if !(bits > 6) {
		goto __34
	}
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(sUueDigits[n>>(bits-6)&0x3F])
	goto __33
__33:
	bits = bits - 6
	goto __32
	goto __34
__34:
	;
	goto __30
__30:
	i++
	goto __29
	goto __31
__31:
	;
	if !(bits > 0) {
		goto __35
	}
	n <<= 8
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(sUueDigits[n>>(bits+2)&0x3F])
	bits = 0
__35:
	;
	j = 0
__36:
	if !(j < *(*int32)(unsafe.Pointer(bp + 92))) {
		goto __38
	}
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = *(*uint8)(unsafe.Pointer(wrapchar + uintptr(j)))
	goto __37
__37:
	j++
	goto __36
	goto __38
__38:
	;
	goto __26
__27:
	;

	// Fix the length of the output bytearray.

	XTcl_SetByteArrayLength(tls, resultObj, int32((int64(cursor)-int64(start))/1))
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

var optStrings2 = [3]uintptr{ts + 10117, ts + 10125, uintptr(0)} /* tclBinary.c:2624:23 */

//----------------------------------------------------------------------
//
// BinaryDecodeUu --
//
//	Decode a uuencoded string.
//
// Results:
//	Interp result set to an byte array object
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func sBinaryDecodeUu(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBinary.c:2758:1: */
	bp := tls.Alloc(110)
	defer tls.Free(110)

	var resultObj uintptr
	var data uintptr
	var datastart uintptr
	var dataend uintptr
	var begin uintptr
	var cursor uintptr
	var i int32
	// var index int32 at bp+96, 4

	var size int32
	var pure int32
	// var count int32 at bp+100, 4

	var strict int32
	var lineLen int32
	var c uint8
	// var ch Tcl_UniChar at bp+108, 2

	var cachePtr uintptr
	// var d [4]int8 at bp+104, 4

	var cachePtr1 uintptr
	var cachePtr2 uintptr
	resultObj = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 100 /* count */)) = 0
	strict = 0
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 108 /* ch */)) = Tcl_UniChar(0)

	if !(objc < 2 || objc > 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9929)
	return TCL_ERROR
__1:
	;
	i = 1
__2:
	if !(i < objc-1) {
		goto __4
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&optStrings3)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp+96) != TCL_OK) {
		goto __5
	}
	return TCL_ERROR
__5:
	;
	switch *(*int32)(unsafe.Pointer(bp + 96 /* index */)) {
	case 0 /* OPT_STRICT */ :
		goto __7
	}
	goto __6
__7:
	strict = 1
	goto __6
__6:
	;
	goto __3
__3:
	i++
	goto __2
	goto __4
__4:
	;

__8:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __11
	}
	resultObj = XTclThreadAllocObj(tls)
	goto __12
__11:
	resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__12:
	;
	goto __9
__9:
	if 0 != 0 {
		goto __8
	}
	goto __10
__10:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)

	pure = libc.Bool32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes == uintptr(0))
	datastart = libc.AssignUintptr(&data, func() uintptr {
		if pure != 0 {
			return XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), bp+100)
		}
		return func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 100)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), bp+100)
		}()
	}())
	dataend = data + uintptr(*(*int32)(unsafe.Pointer(bp + 100)))
	size = (*(*int32)(unsafe.Pointer(bp + 100)) + 3) & libc.CplInt32(3) * 3 / 4
	begin = libc.AssignUintptr(&cursor, XTcl_SetByteArrayLength(tls, resultObj, size))
	lineLen = -1

	// The decoding loop. First, we get the length of line (strictly, the
	// number of data bytes we expect to generate from the line) we're
	// processing this time round if it is not already known (i.e., when the
	// lineLen variable is set to the magic value, -1).

__13:
	if !(data < dataend) {
		goto __14
	}
	*(*[4]int8)(unsafe.Pointer(bp + 104 /* d */)) = [4]int8{int8(0), int8(0), int8(0), int8(0)}

	if !(lineLen < 0) {
		goto __15
	}
	c = *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&data, 1)))
	if !(int32(c) < 32 || int32(c) > 96) {
		goto __16
	}
	if !(strict != 0 || !(XTclIsSpaceProc(tls, int32(c)) != 0)) {
		goto __17
	}
	goto badUu
__17:
	;
	i--
	goto __13
__16:
	;
	lineLen = (int32(c) - 32) & 0x3F
__15:
	;

	// Now we read a four-character grouping.

	i = 0
__18:
	if !(i < 4) {
		goto __20
	}
	if !(data < dataend) {
		goto __21
	}
	*(*int8)(unsafe.Pointer(bp + 104 + uintptr(i))) = int8(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&data, 1)))))
	if !(int32(c) < 32 || int32(c) > 96) {
		goto __22
	}
	if !(strict != 0) {
		goto __23
	}
	if !!(XTclIsSpaceProc(tls, int32(c)) != 0) {
		goto __24
	}
	goto badUu
	goto __25
__24:
	if !(int32(c) == '\n') {
		goto __26
	}
	goto shortUu
__26:
	;
__25:
	;
__23:
	;
	i--
	goto __19
__22:
	;
__21:
	;
	goto __19
__19:
	i++
	goto __18
	goto __20
__20:
	;

	// Translate that grouping into (up to) three binary bytes output.

	if !(lineLen > 0) {
		goto __27
	}
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8((int32(*(*int8)(unsafe.Pointer(bp + 104)))-0x20)&0x3F<<2 |
		(int32(*(*int8)(unsafe.Pointer(bp + 104 + 1)))-0x20)&0x3F>>4)
	if !(libc.PreDecInt32(&lineLen, 1) > 0) {
		goto __28
	}
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8((int32(*(*int8)(unsafe.Pointer(bp + 104 + 1)))-0x20)&0x3F<<4 |
		(int32(*(*int8)(unsafe.Pointer(bp + 104 + 2)))-0x20)&0x3F>>2)
	if !(libc.PreDecInt32(&lineLen, 1) > 0) {
		goto __29
	}
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8((int32(*(*int8)(unsafe.Pointer(bp + 104 + 2)))-0x20)&0x3F<<6 |
		(int32(*(*int8)(unsafe.Pointer(bp + 104 + 3)))-0x20)&0x3F)
	lineLen--
__29:
	;
__28:
	;
__27:
	;

	// If we've reached the end of the line, skip until we process a
	// newline.

	if !(lineLen == 0 && data < dataend) {
		goto __30
	}
	lineLen = -1
__31:
	c = *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&data, 1)))
	if !(int32(c) == '\n') {
		goto __34
	}
	goto __33
	goto __35
__34:
	if !(int32(c) >= 32 && int32(c) <= 96) {
		goto __36
	}
	data--
	goto __33
	goto __37
__36:
	if !(strict != 0 || !(XTclIsSpaceProc(tls, int32(c)) != 0)) {
		goto __38
	}
	goto badUu
__38:
	;
__37:
	;
__35:
	;
	goto __32
__32:
	if data < dataend {
		goto __31
	}
	goto __33
__33:
	;
__30:
	;
	goto __13
__14:
	;

	// Sanity check, clean up and finish.

	if !(lineLen > 0 && strict != 0) {
		goto __39
	}
	goto shortUu
__39:
	;
	XTcl_SetByteArrayLength(tls, resultObj, int32((int64(cursor)-int64(begin))/1))
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK

shortUu:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+10183, 0))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+9997, ts+10004, ts+10203, uintptr(0)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount, 1) > 1) {
		goto __40
	}
	goto __41
__40:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __42
	}

	if !((*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != XtclEmptyStringRep) {
		goto __44
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes)
__44:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = -1
__45:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __48
	}
	XTclThreadFreeObj(tls, resultObj)
	goto __49
__48:
	*(*uintptr)(unsafe.Pointer(resultObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = resultObj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__49:
	;
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
	goto __43
__42:
	XTclFreeObj(tls, resultObj)
__43:
	;
__41:
	;

	return TCL_ERROR

badUu:
	if !(pure != 0) {
		goto __50
	}
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 108 /* ch */)) = Tcl_UniChar(c)
	goto __51
__50:
	if int32(uint8(*(*int8)(unsafe.Pointer(data - uintptr(1))))) < 0x80 {
		*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(data - uintptr(1)))))
	} else {
		XTcl_UtfToUniChar(tls, data-uintptr(1), bp+108)
	}
__51:
	;
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+10209,
		libc.VaList(bp+40, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108 /* ch */))), int32((int64(data)-int64(datastart))/1-int64(1)))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+3593, ts+9997, ts+10004, ts+10011, uintptr(0)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount, 1) > 1) {
		goto __52
	}
	goto __53
__52:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __54
	}

	if !((*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != XtclEmptyStringRep) {
		goto __56
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes)
__56:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = -1
__57:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __60
	}
	XTclThreadFreeObj(tls, resultObj)
	goto __61
__60:
	*(*uintptr)(unsafe.Pointer(resultObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = resultObj
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__61:
	;
	goto __58
__58:
	if 0 != 0 {
		goto __57
	}
	goto __59
__59:
	;
	goto __55
__54:
	XTclFreeObj(tls, resultObj)
__55:
	;
__53:
	;

	return TCL_ERROR
}

var optStrings3 = [2]uintptr{ts + 10019, uintptr(0)} /* tclBinary.c:2771:23 */

//----------------------------------------------------------------------
//
// BinaryDecode64 --
//
//	Decode a base64 encoded string.
//
// Results:
//	Interp result set to an byte array object
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func sBinaryDecode64(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclBinary.c:2928:1: */
	bp := tls.Alloc(66)
	defer tls.Free(66)

	var resultObj uintptr
	var data uintptr
	var datastart uintptr
	var dataend uintptr
	var c uint8
	var begin uintptr
	var cursor uintptr
	var pure int32
	var strict int32
	var i int32
	// var index int32 at bp+56, 4

	var size int32
	var cut int32
	// var count int32 at bp+60, 4

	// var ch Tcl_UniChar at bp+64, 2

	var cachePtr uintptr
	var value uint64
	var cachePtr1 uintptr
	resultObj = uintptr(0)
	c = uint8(0)
	begin = uintptr(0)
	cursor = uintptr(0)
	strict = 0
	cut = 0
	*(*int32)(unsafe.Pointer(bp + 60 /* count */)) = 0
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 64 /* ch */)) = Tcl_UniChar(0)

	if !(objc < 2 || objc > 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9929)
	return TCL_ERROR
__1:
	;
	i = 1
__2:
	if !(i < objc-1) {
		goto __4
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&optStrings4)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp+56) != TCL_OK) {
		goto __5
	}
	return TCL_ERROR
__5:
	;
	switch *(*int32)(unsafe.Pointer(bp + 56 /* index */)) {
	case 0 /* OPT_STRICT */ :
		goto __7
	}
	goto __6
__7:
	strict = 1
	goto __6
__6:
	;
	goto __3
__3:
	i++
	goto __2
	goto __4
__4:
	;

__8:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __11
	}
	resultObj = XTclThreadAllocObj(tls)
	goto __12
__11:
	resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__12:
	;
	goto __9
__9:
	if 0 != 0 {
		goto __8
	}
	goto __10
__10:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)

	pure = libc.Bool32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes == uintptr(0))
	datastart = libc.AssignUintptr(&data, func() uintptr {
		if pure != 0 {
			return XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), bp+60)
		}
		return func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 60)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), bp+60)
		}()
	}())
	dataend = data + uintptr(*(*int32)(unsafe.Pointer(bp + 60)))
	size = (*(*int32)(unsafe.Pointer(bp + 60)) + 3) & libc.CplInt32(3) * 3 / 4
	begin = libc.AssignUintptr(&cursor, XTcl_SetByteArrayLength(tls, resultObj, size))
__13:
	if !(data < dataend) {
		goto __14
	}
	value = uint64(0)

	// Decode the current block. Each base64 block consists of four input
	// characters A-Z, a-z, 0-9, +, or /. Each character supplies six bits
	// of output data, so each block's output is 24 bits (three bytes) in
	// length. The final block can be shorter by one or two bytes, denoted
	// by the input ending with one or two ='s, respectively.

	i = 0
__15:
	if !(i < 4) {
		goto __17
	}
	// Get the next input character. At end of input, pad with at most
	// two ='s. If more than two ='s would be needed, instead discard
	// the block read thus far.

	if !(data < dataend) {
		goto __18
	}
	c = *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&data, 1)))
	goto __19
__18:
	if !(i > 1) {
		goto __20
	}
	c = uint8('=')
	goto __21
__20:
	if !(strict != 0 && i <= 1) {
		goto __22
	}
	// Single resp. unfulfilled char (each 4th next single
	// char) is rather bad64 error case in strict mode.

	goto bad64
__22:
	;
	cut = cut + 3
	goto __17
__21:
	;
__19:
	;

	// Load the character into the block value. Handle ='s specially
	// because they're only valid as the last character or two of the
	// final block of input. Unless strict mode is enabled, skip any
	// input whitespace characters.

	if !(cut != 0) {
		goto __23
	}
	if !(int32(c) == '=' && i > 1) {
		goto __25
	}
	value <<= 6
	cut++
	goto __26
__25:
	if !!(strict != 0) {
		goto __27
	}
	i--
	goto __28
__27:
	goto bad64
__28:
	;
__26:
	;
	goto __24
__23:
	if !(int32(c) >= 'A' && int32(c) <= 'Z') {
		goto __29
	}
	value = value<<6 | uint64((int32(c)-'A')&0x3F)
	goto __30
__29:
	if !(int32(c) >= 'a' && int32(c) <= 'z') {
		goto __31
	}
	value = value<<6 | uint64((int32(c)-'a'+26)&0x3F)
	goto __32
__31:
	if !(int32(c) >= '0' && int32(c) <= '9') {
		goto __33
	}
	value = value<<6 | uint64((int32(c)-'0'+52)&0x3F)
	goto __34
__33:
	if !(int32(c) == '+') {
		goto __35
	}
	value = value<<6 | uint64(0x3E)
	goto __36
__35:
	if !(int32(c) == '/') {
		goto __37
	}
	value = value<<6 | uint64(0x3F)
	goto __38
__37:
	if !(int32(c) == '=' && (!(strict != 0) || i > 1)) {
		goto __39
	}
	// "=" and "a=" is rather bad64 error case in strict mode.

	value <<= 6
	if !(i != 0) {
		goto __41
	}
	cut++
__41:
	;
	goto __40
__39:
	if !(strict != 0) {
		goto __42
	}
	goto bad64
	goto __43
__42:
	i--
__43:
	;
__40:
	;
__38:
	;
__36:
	;
__34:
	;
__32:
	;
__30:
	;
__24:
	;
	goto __16
__16:
	i++
	goto __15
	goto __17
__17:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(value >> 16 & uint64(0xFF))
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(value >> 8 & uint64(0xFF))
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&cursor, 1))) = uint8(value & uint64(0xFF))

	// Since = is only valid within the final block, if it was encountered
	// but there are still more input characters, confirm that strict mode
	// is off and all subsequent characters are whitespace.

	if !(cut != 0 && data < dataend) {
		goto __44
	}
	if !(strict != 0) {
		goto __45
	}
	goto bad64
__45:
	;
__44:
	;
	goto __13
__14:
	;
	XTcl_SetByteArrayLength(tls, resultObj, int32((int64(cursor)-int64(begin))/1-int64(cut)))
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK

bad64:
	if !(pure != 0) {
		goto __46
	}
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 64 /* ch */)) = Tcl_UniChar(c)
	goto __47
__46:
	// The decoder is byte-oriented. If we saw a byte that's not a
	// valid member of the base64 alphabet, it could be the lead byte
	// of a multi-byte character.

	// Safe because we know data is NUL-terminated
	if int32(uint8(*(*int8)(unsafe.Pointer(data - uintptr(1))))) < 0x80 {
		*(*Tcl_UniChar)(unsafe.Pointer(bp + 64)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(data - uintptr(1)))))
	} else {
		XTcl_UtfToUniChar(tls, data-uintptr(1), bp+64)
	}
__47:
	;

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+10256, libc.VaList(bp, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 64 /* ch */))),
			int32((int64(data)-int64(datastart))/1-int64(1)))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+9997, ts+10004, ts+10011, uintptr(0)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount, 1) > 1) {
		goto __48
	}
	goto __49
__48:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __50
	}

	if !((*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != XtclEmptyStringRep) {
		goto __52
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes)
__52:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = -1
__53:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __56
	}
	XTclThreadFreeObj(tls, resultObj)
	goto __57
__56:
	*(*uintptr)(unsafe.Pointer(resultObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = resultObj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__57:
	;
	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
	goto __51
__50:
	XTclFreeObj(tls, resultObj)
__51:
	;
__49:
	;

	return TCL_ERROR
}

var optStrings4 = [2]uintptr{ts + 10019, uintptr(0)} /* tclBinary.c:2942:23 */

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// This is the !TCL_MEM_DEBUG case

//----------------------------------------------------------------------
//
// Tcl_Alloc --
//
//	Interface to TclpAlloc when TCL_MEM_DEBUG is disabled. It does check
//	that memory was actually allocated.
//
//----------------------------------------------------------------------

func XTcl_Alloc(tls *libc.TLS, size uint32) uintptr { /* tclCkalloc.c:1053:6: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var result uintptr

	result = XTclpAlloc(tls, size)

	// Most systems will not alloc(0), instead bumping it to one so that NULL
	// isn't returned. Some systems (AIX, Tru64) will alloc(0) by returning
	// NULL, so we have to check that the NULL we get is not in response to
	// alloc(0).
	//
	// The ANSI spec actually says that systems either return NULL *or* a
	// special pointer on failure, but we only check for NULL

	if result == uintptr(0) && size != 0 {
		XTcl_Panic(tls, ts+10301, libc.VaList(bp, size))
	}
	return result
}

func XTcl_DbCkalloc(tls *libc.TLS, size uint32, file uintptr, line int32) uintptr { /* tclCkalloc.c:1077:6: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var result uintptr

	result = XTclpAlloc(tls, size)

	if result == uintptr(0) && size != 0 {
		libc.Xfflush(tls, libc.Xstdout)
		XTcl_Panic(tls, ts+10326, libc.VaList(bp, size, file, line))
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_AttemptAlloc --
//
//	Interface to TclpAlloc when TCL_MEM_DEBUG is disabled. It does not
//	check that memory was actually allocated.
//
//----------------------------------------------------------------------

func XTcl_AttemptAlloc(tls *libc.TLS, size uint32) uintptr { /* tclCkalloc.c:1105:6: */
	var result uintptr

	result = XTclpAlloc(tls, size)
	return result
}

func XTcl_AttemptDbCkalloc(tls *libc.TLS, size uint32, file uintptr, line int32) uintptr { /* tclCkalloc.c:1115:6: */
	var result uintptr
	_ = file
	_ = line

	result = XTclpAlloc(tls, size)
	return result
}

//----------------------------------------------------------------------
//
// Tcl_Realloc --
//
//	Interface to TclpRealloc when TCL_MEM_DEBUG is disabled. It does check
//	that memory was actually allocated.
//
//----------------------------------------------------------------------

func XTcl_Realloc(tls *libc.TLS, ptr uintptr, size uint32) uintptr { /* tclCkalloc.c:1140:6: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var result uintptr

	result = XTclpRealloc(tls, ptr, size)

	if result == uintptr(0) && size != 0 {
		XTcl_Panic(tls, ts+10363, libc.VaList(bp, size))
	}
	return result
}

func XTcl_DbCkrealloc(tls *libc.TLS, ptr uintptr, size uint32, file uintptr, line int32) uintptr { /* tclCkalloc.c:1155:6: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var result uintptr

	result = XTclpRealloc(tls, ptr, size)

	if result == uintptr(0) && size != 0 {
		libc.Xfflush(tls, libc.Xstdout)
		XTcl_Panic(tls, ts+10390, libc.VaList(bp, size, file, line))
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_AttemptRealloc --
//
//	Interface to TclpRealloc when TCL_MEM_DEBUG is disabled. It does not
//	check that memory was actually allocated.
//
//----------------------------------------------------------------------

func XTcl_AttemptRealloc(tls *libc.TLS, ptr uintptr, size uint32) uintptr { /* tclCkalloc.c:1184:6: */
	var result uintptr

	result = XTclpRealloc(tls, ptr, size)
	return result
}

func XTcl_AttemptDbCkrealloc(tls *libc.TLS, ptr uintptr, size uint32, file uintptr, line int32) uintptr { /* tclCkalloc.c:1195:6: */
	var result uintptr
	_ = file
	_ = line

	result = XTclpRealloc(tls, ptr, size)
	return result
}

//----------------------------------------------------------------------
//
// Tcl_Free --
//
//	Interface to TclpFree when TCL_MEM_DEBUG is disabled. Done here rather
//	in the macro to keep some modules from being compiled with
//	TCL_MEM_DEBUG enabled and some with it disabled.
//
//----------------------------------------------------------------------

func XTcl_Free(tls *libc.TLS, ptr uintptr) { /* tclCkalloc.c:1223:1: */
	XTclpFree(tls, ptr)
}

func XTcl_DbCkfree(tls *libc.TLS, ptr uintptr, file uintptr, line int32) { /* tclCkalloc.c:1230:1: */
	_ = file
	_ = line
	XTclpFree(tls, ptr)
}

//----------------------------------------------------------------------
//
// Tcl_InitMemory --
//
//	Dummy initialization for memory command, which is only available if
//	TCL_MEM_DEBUG is on.
//
//----------------------------------------------------------------------
// ARGSUSED
func XTcl_InitMemory(tls *libc.TLS, interp uintptr) { /* tclCkalloc.c:1252:1: */
	_ = interp
}

func XTcl_DumpActiveMemory(tls *libc.TLS, fileName uintptr) int32 { /* tclCkalloc.c:1259:1: */
	_ = fileName
	return TCL_OK
}

func XTcl_ValidateAllMemory(tls *libc.TLS, file uintptr, line int32) { /* tclCkalloc.c:1267:1: */
	_ = file
	_ = line
}

func XTclDumpMemoryInfo(tls *libc.TLS, clientData ClientData, flags int32) int32 { /* tclCkalloc.c:1276:1: */
	_ = clientData
	_ = flags
	return 1
}

//---------------------------------------------------------------------------
//
// TclFinalizeMemorySubsystem --
//
//	This procedure is called to finalize all the structures that are used
//	by the memory allocator on a per-process basis.
//
// Results:
//	None.
//
// Side effects:
//	This subsystem is self-initializing, since memory can be allocated
//	before Tcl is formally initialized. After this call, this subsystem
//	has been reset to its initial state and is usable again.
//
//---------------------------------------------------------------------------

func XTclFinalizeMemorySubsystem(tls *libc.TLS) { /* tclCkalloc.c:1307:1: */

}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// indent-tabs-mode: nil
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Windows has mktime. The configurators do not check.

// Constants

// Table of the days in each month, leap and common years

var hath = [2][12]int32{
	{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
	{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
} /* tclClock.c:45:18 */
var daysInPriorMonths = [2][13]int32{
	{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365},
	{0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366},
} /* tclClock.c:49:18 */

// Enumeration of the string literals used in [clock]

type ClockLiteral = uint32 /* tclClock.c:73:3 */
var literals = [22]uintptr{
	ts + 2046,
	ts + 10429,
	ts + 10453, ts + 10457,
	ts + 10459,
	ts + 10502,
	ts + 10505, ts + 10516, ts + 10526,
	ts + 10536, ts + 10540, ts + 10545,
	ts + 10555,
	ts + 10592, ts + 10604,
	ts + 10616, ts + 10626,
	ts + 10639,
	ts + 10645, ts + 10653, ts + 10660,
	ts + 10669,
} /* tclClock.c:74:19 */

// Structure containing the client data for [clock]

type ClockClientData = struct {
	FrefCount Size_t
	Fliterals uintptr
} /* tclClock.c:97:3 */

// Structure containing the fields used in [clock format] and [clock scan]

type TclDateFields1 = struct {
	Fseconds      Tcl_WideInt
	FlocalSeconds Tcl_WideInt
	FtzOffset     int32
	F__ccgo_pad1  [4]byte
	FtzName       uintptr
	FjulianDay    int32
	Fera          uint32
	Fgregorian    int32
	Fyear         int32
	FdayOfYear    int32
	Fmonth        int32
	FdayOfMonth   int32
	Fiso8601Year  int32
	Fiso8601Week  int32
	FdayOfWeek    int32
} /* tclClock.c:103:9 */

// Structure containing the fields used in [clock format] and [clock scan]

const ( /* tclClock.c:103:1: */
	BCE = 1
	CE  = 0
)

// Structure containing the fields used in [clock format] and [clock scan]

type TclDateFields = TclDateFields1                       /* tclClock.c:121:3 */
var eras = [3]uintptr{ts + 10502, ts + 10453, uintptr(0)} /* tclClock.c:122:19 */

// Thread specific data block holding a 'struct tm' for the 'gmtime' and
// 'localtime' library calls.

var tmKey Tcl_ThreadDataKey /* tclClock.c:129:26: */

// Mutex protecting 'gmtime', 'localtime' and 'mktime' calls and the statics
// in the date parsing code.

var clockMutex Tcl_Mutex /* tclClock.c:136:1: */

// Structure containing description of "native" clock commands to create.

type ClockCommand = struct {
	Fname       uintptr
	FobjCmdProc uintptr
} /* tclClock.c:201:1 */

var clockCommands = [8]ClockCommand{
	{Fname: ts + 10674, FobjCmdProc: 0},
	{Fname: ts + 10681, FobjCmdProc: 0},
	{Fname: ts + 10689, FobjCmdProc: 0},
	{Fname: ts + 10707, FobjCmdProc: 0},
	{Fname: ts + 10721,
		FobjCmdProc: 0},
	{Fname: ts + 10753,
		FobjCmdProc: 0},
	{Fname: ts + 10784, FobjCmdProc: 0},
	{},
} /* tclClock.c:210:34 */

//----------------------------------------------------------------------
//
// TclClockInit --
//
//	Registers the 'clock' subcommands with the Tcl interpreter and
//	initializes its client data (which consists mostly of constant
//	Tcl_Obj's that it is too much trouble to keep recreating).
//
// Results:
//	None.
//
// Side effects:
//	Installs the commands and creates the client data
//
//----------------------------------------------------------------------

func XTclClockInit(tls *libc.TLS, interp uintptr) { /* tclClock.c:242:1: */
	bp := tls.Alloc(50)
	defer tls.Free(50)

	var clockCmdPtr uintptr
	// var cmdName [50]int8 at bp, 50
	// Buffer large enough to hold the string
	//::tcl::clock::GetJulianDayFromEraYearMonthDay
	// plus a terminating NUL.
	var data uintptr
	var i int32

	// Safe interps get [::clock] as alias to a parent, so do not need their
	// own copies of the support routines.

	if XTcl_IsSafe(tls, interp) != 0 {
		return
	}

	// Create the client data, which is a refcounted literal pool.

	data = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ClockClientData{})))
	(*ClockClientData)(unsafe.Pointer(data)).FrefCount = uint64(0)
	(*ClockClientData)(unsafe.Pointer(data)).Fliterals = XTcl_Alloc(tls, uint32(LIT__END*uint64(unsafe.Sizeof(uintptr(0)))))
	for i = 0; i < LIT__END; i++ {
		*(*uintptr)(unsafe.Pointer((*ClockClientData)(unsafe.Pointer(data)).Fliterals + uintptr(i)*8)) = XTcl_NewStringObj(tls, literals[i], -1)
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ClockClientData)(unsafe.Pointer(data)).Fliterals + uintptr(i)*8)))).FrefCount++
	}

	// Install the commands.
	// TODO - Let Tcl_MakeEnsemble do this?

	libc.Xmemcpy(tls, bp, ts+10800, uint64(TCL_CLOCK_PREFIX_LEN))
	for clockCmdPtr = uintptr(unsafe.Pointer(&clockCommands)); (*ClockCommand)(unsafe.Pointer(clockCmdPtr)).Fname != uintptr(0); clockCmdPtr += 16 {
		libc.Xstrcpy(tls, bp+uintptr(TCL_CLOCK_PREFIX_LEN), (*ClockCommand)(unsafe.Pointer(clockCmdPtr)).Fname)
		(*ClockClientData)(unsafe.Pointer(data)).FrefCount++
		XTcl_CreateObjCommand(tls, interp, bp, (*ClockCommand)(unsafe.Pointer(clockCmdPtr)).FobjCmdProc, data,
			*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sClockDeleteCmdProc})))
	}

	// Make the clock ensemble

	XTclMakeEnsemble(tls, interp, ts+10815, uintptr(unsafe.Pointer(&clockImplMap)))
}

var clockImplMap = [8]EnsembleImplMap{
	{Fname: ts + 2077, FcompileProc: 0},
	{Fname: ts + 10821, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5154, FcompileProc: 0},
	{Fname: ts + 10828, Fproc: 0, FcompileProc: 0, FclientData: uintptr(int64(1))},
	{Fname: ts + 10841, Fproc: 0, FcompileProc: 0, FclientData: uintptr(int64(2))},
	{Fname: ts + 5298, FcompileProc: 0},
	{Fname: ts + 10645, Fproc: 0, FcompileProc: 0, FclientData: uintptr(int64(3))},
	{},
} /* tclClock.c:254:34 */

//----------------------------------------------------------------------
//
// ClockConvertlocaltoutcObjCmd --
//
//	Tcl command that converts a UTC time to a local time by whatever means
//	is available.
//
// Usage:
//	::tcl::clock::ConvertUTCToLocal dictionary tzdata changeover
//
// Parameters:
//	dict - Dictionary containing a 'localSeconds' entry.
//	tzdata - Time zone data
//	changeover - Julian Day of the adoption of the Gregorian calendar.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	On success, sets the interpreter result to the given dictionary
//	augmented with a 'seconds' field giving the UTC time. On failure,
//	leaves an error message in the interpreter result.
//
//----------------------------------------------------------------------

func sClockConvertlocaltoutcObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclClock.c:333:1: */
	bp := tls.Alloc(84)
	defer tls.Free(84)

	var data uintptr = clientData
	var lit uintptr = (*ClockClientData)(unsafe.Pointer(data)).Fliterals
	// var secondsObj uintptr at bp, 8

	var dict uintptr
	// var changeover int32 at bp+80, 4

	// var fields TclDateFields at bp+8, 72

	var created int32 = 0
	var status int32

	// Check params and convert time.

	if objc != 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10854)
		return TCL_ERROR
	}
	dict = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if XTcl_DictObjGet(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 16*8)),
		bp) != TCL_OK {
		return TCL_ERROR
	}
	if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+10877, -1))
		return TCL_ERROR
	}
	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp + 8 + 8)) = *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), bp+8+8)
	}() != TCL_OK ||
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 80)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+80)
		}() != TCL_OK ||
		sConvertLocalToUTC(tls, interp, bp+8, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp + 80))) != 0 {
		return TCL_ERROR
	}

	// Copy-on-write; set the 'seconds' field in the dictionary and place the
	// modified dictionary in the interpreter result.

	if (*Tcl_Obj)(unsafe.Pointer(dict)).FrefCount > 1 {
		dict = XTcl_DuplicateObj(tls, dict)
		created = 1
		(*Tcl_Obj)(unsafe.Pointer(dict)).FrefCount++
	}
	status = XTcl_DictObjPut(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 18*8)),
		XTcl_NewWideIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp+8 /* &fields */)).Fseconds))
	if status == TCL_OK {
		XTcl_SetObjResult(tls, interp, dict)
	}
	if created != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = dict
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return status
}

//----------------------------------------------------------------------
//
// ClockGetdatefieldsObjCmd --
//
//	Tcl command that determines the values that [clock format] will use in
//	formatting a date, and populates a dictionary with them.
//
// Usage:
//	::tcl::clock::GetDateFields seconds tzdata changeover
//
// Parameters:
//	seconds - Time expressed in seconds from the Posix epoch.
//	tzdata - Time zone data of the time zone in which time is to be
//		 expressed.
//	changeover - Julian Day Number at which the current locale adopted
//		     the Gregorian calendar
//
// Results:
//	Returns a dictonary populated with the fields:
//		seconds - Seconds from the Posix epoch
//		localSeconds - Nominal seconds from the Posix epoch in the
//			       local time zone.
//		tzOffset - Time zone offset in seconds east of Greenwich
//		tzName - Time zone name
//		julianDay - Julian Day Number in the local time zone
//
//----------------------------------------------------------------------

func XClockGetdatefieldsObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclClock.c:425:1: */
	bp := tls.Alloc(76)
	defer tls.Free(76)

	// var fields TclDateFields at bp, 72

	var dict uintptr
	var data uintptr = clientData
	var lit uintptr = (*ClockClientData)(unsafe.Pointer(data)).Fliterals
	// var changeover int32 at bp+72, 4

	// Check params.

	if objc != 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10920)
		return TCL_ERROR
	}
	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp)) = *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}() != TCL_OK ||
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 72)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+72)
		}() != TCL_OK {
		return TCL_ERROR
	}

	// fields.seconds could be an unsigned number that overflowed. Make sure
	// that it isn't.

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType)) {
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(lit + 12*8)))
		return TCL_ERROR
	}

	// Convert UTC time to local.

	if sConvertUTCToLocal(tls, interp, bp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp + 72))) != TCL_OK {
		return TCL_ERROR
	}

	// Extract Julian day.

	(*TclDateFields)(unsafe.Pointer(bp /* &fields */)).FjulianDay = int32(((*TclDateFields)(unsafe.Pointer(bp)).FlocalSeconds + int64(JULIAN_DAY_POSIX_EPOCH)*int64(SECONDS_PER_DAY)) /
		int64(SECONDS_PER_DAY))

	// Convert to Julian or Gregorian calendar.

	sGetGregorianEraYearDay(tls, bp, *(*int32)(unsafe.Pointer(bp + 72 /* changeover */)))
	sGetMonthDay(tls, bp)
	sGetYearWeekDay(tls, bp, *(*int32)(unsafe.Pointer(bp + 72 /* changeover */)))

	dict = XTcl_NewDictObj(tls)
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 16*8)),
		XTcl_NewWideIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).FlocalSeconds))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 18*8)),
		XTcl_NewWideIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).Fseconds))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 19*8)), (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).FtzName)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = (*TclDateFields)(unsafe.Pointer(bp)).FtzName
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 20*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).FtzOffset))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 15*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).FjulianDay))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 11*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).Fgregorian))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 9*8)),
		*(*uintptr)(unsafe.Pointer(lit + uintptr(func() int32 {
			if (*TclDateFields)(unsafe.Pointer(bp)).Fera != 0 {
				return LIT_BCE
			}
			return LIT_CE
		}())*8)))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 21*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).Fyear))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 8*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).FdayOfYear))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 17*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).Fmonth))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 6*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).FdayOfMonth))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 14*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).Fiso8601Year))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 13*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).Fiso8601Week))
	XTcl_DictObjPut(tls, uintptr(0), dict, *(*uintptr)(unsafe.Pointer(lit + 7*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp /* &fields */)).FdayOfWeek))
	XTcl_SetObjResult(tls, interp, dict)

	return TCL_OK
}

//----------------------------------------------------------------------
//
// ClockGetjuliandayfromerayearmonthdayObjCmd --
//
//	Tcl command that converts a time from era-year-month-day to a Julian
//	Day Number.
//
// Parameters:
//	dict - Dictionary that contains 'era', 'year', 'month' and
//	       'dayOfMonth' keys.
//	changeover - Julian Day of changeover to the Gregorian calendar
//
// Results:
//	Result is either TCL_OK, with the interpreter result being the
//	dictionary augmented with a 'julianDay' key, or TCL_ERROR,
//	with the result being an error message.
//
//----------------------------------------------------------------------

func sFetchEraField(tls *libc.TLS, interp uintptr, dict uintptr, key uintptr, storePtr uintptr) int32 { /* tclClock.c:539:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	*(*uintptr)(unsafe.Pointer(bp /* value */)) = uintptr(0)

	if XTcl_DictObjGet(tls, interp, dict, key, bp) != TCL_OK {
		return TCL_ERROR
	}
	if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+10946, -1))
		return TCL_ERROR
	}
	return XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* value */)), uintptr(unsafe.Pointer(&eras)), int32(unsafe.Sizeof(uintptr(0))), ts+10536, TCL_EXACT, storePtr)
}

func sFetchIntField(tls *libc.TLS, interp uintptr, dict uintptr, key uintptr, storePtr uintptr) int32 { /* tclClock.c:559:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	*(*uintptr)(unsafe.Pointer(bp /* value */)) = uintptr(0)

	if XTcl_DictObjGet(tls, interp, dict, key, bp) != TCL_OK {
		return TCL_ERROR
	}
	if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+10946, -1))
		return TCL_ERROR
	}
	return func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(storePtr)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), storePtr)
	}()
}

func sClockGetjuliandayfromerayearmonthdayObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclClock.c:579:1: */
	bp := tls.Alloc(84)
	defer tls.Free(84)

	// var fields TclDateFields at bp+8, 72

	var dict uintptr
	var data uintptr = clientData
	var lit uintptr = (*ClockClientData)(unsafe.Pointer(data)).Fliterals
	// var changeover int32 at bp+80, 4

	var copied int32 = 0
	var status int32
	*(*int32)(unsafe.Pointer(bp /* era */)) = 0

	// Check params.

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10986)
		return TCL_ERROR
	}
	dict = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if sFetchEraField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 9*8)), bp) != TCL_OK ||
		sFetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 21*8)), bp+8+44) !=
			TCL_OK ||
		sFetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 17*8)), bp+8+52) !=
			TCL_OK ||
		sFetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 6*8)),
			bp+8+56) != TCL_OK ||
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 80)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+80)
		}() != TCL_OK {
		return TCL_ERROR
	}
	(*TclDateFields)(unsafe.Pointer(bp + 8 /* &fields */)).Fera = uint32(*(*int32)(unsafe.Pointer(bp /* era */)))

	// Get Julian day.

	sGetJulianDayFromEraYearMonthDay(tls, bp+8, *(*int32)(unsafe.Pointer(bp + 80 /* changeover */)))

	// Store Julian day in the dictionary - copy on write.

	if (*Tcl_Obj)(unsafe.Pointer(dict)).FrefCount > 1 {
		dict = XTcl_DuplicateObj(tls, dict)
		(*Tcl_Obj)(unsafe.Pointer(dict)).FrefCount++
		copied = 1
	}
	status = XTcl_DictObjPut(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 15*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp+8 /* &fields */)).FjulianDay))
	if status == TCL_OK {
		XTcl_SetObjResult(tls, interp, dict)
	}
	if copied != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = dict
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return status
}

//----------------------------------------------------------------------
//
// ClockGetjuliandayfromerayearweekdayObjCmd --
//
//	Tcl command that converts a time from the ISO calendar to a Julian Day
//	Number.
//
// Parameters:
//	dict - Dictionary that contains 'era', 'iso8601Year', 'iso8601Week'
//	       and 'dayOfWeek' keys.
//	changeover - Julian Day of changeover to the Gregorian calendar
//
// Results:
//	Result is either TCL_OK, with the interpreter result being the
//	dictionary augmented with a 'julianDay' key, or TCL_ERROR, with the
//	result being an error message.
//
//----------------------------------------------------------------------

func sClockGetjuliandayfromerayearweekdayObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclClock.c:663:1: */
	bp := tls.Alloc(84)
	defer tls.Free(84)

	// var fields TclDateFields at bp+8, 72

	var dict uintptr
	var data uintptr = clientData
	var lit uintptr = (*ClockClientData)(unsafe.Pointer(data)).Fliterals
	// var changeover int32 at bp+80, 4

	var copied int32 = 0
	var status int32
	*(*int32)(unsafe.Pointer(bp /* era */)) = 0

	// Check params.

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10986)
		return TCL_ERROR
	}
	dict = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if sFetchEraField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 9*8)), bp) != TCL_OK ||
		sFetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 14*8)),
			bp+8+60) != TCL_OK ||
		sFetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 13*8)),
			bp+8+64) != TCL_OK ||
		sFetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 7*8)),
			bp+8+68) != TCL_OK ||
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 80)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+80)
		}() != TCL_OK {
		return TCL_ERROR
	}
	(*TclDateFields)(unsafe.Pointer(bp + 8 /* &fields */)).Fera = uint32(*(*int32)(unsafe.Pointer(bp /* era */)))

	// Get Julian day.

	sGetJulianDayFromEraYearWeekDay(tls, bp+8, *(*int32)(unsafe.Pointer(bp + 80 /* changeover */)))

	// Store Julian day in the dictionary - copy on write.

	if (*Tcl_Obj)(unsafe.Pointer(dict)).FrefCount > 1 {
		dict = XTcl_DuplicateObj(tls, dict)
		(*Tcl_Obj)(unsafe.Pointer(dict)).FrefCount++
		copied = 1
	}
	status = XTcl_DictObjPut(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + 15*8)),
		XTcl_NewIntObj(tls, (*TclDateFields)(unsafe.Pointer(bp+8 /* &fields */)).FjulianDay))
	if status == TCL_OK {
		XTcl_SetObjResult(tls, interp, dict)
	}
	if copied != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = dict
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return status
}

//----------------------------------------------------------------------
//
// ConvertLocalToUTC --
//
//	Converts a time (in a TclDateFields structure) from the local wall
//	clock to UTC.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Populates the 'seconds' field if successful; stores an error message
//	in the interpreter result on failure.
//
//----------------------------------------------------------------------

func sConvertLocalToUTC(tls *libc.TLS, interp uintptr, fields uintptr, tzdata uintptr, changeover int32) int32 { /* tclClock.c:744:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var rowc int32 at bp+8, 4
	// Number of rows in tzdata
	// var rowv uintptr at bp, 8
	// Pointers to the rows

	// Unpack the tz data.

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(tzdata)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(tzdata + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 8)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tzdata + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, tzdata, bp+8, bp)
	}() != TCL_OK {
		return TCL_ERROR
	}

	// Special case: If the time zone is :localtime, the tzdata will be empty.
	// Use 'mktime' to convert the time to local

	if *(*int32)(unsafe.Pointer(bp + 8)) == 0 {
		return sConvertLocalToUTCUsingC(tls, interp, fields, changeover)
	} else {
		return sConvertLocalToUTCUsingTable(tls, interp, fields, *(*int32)(unsafe.Pointer(bp + 8 /* rowc */)), *(*uintptr)(unsafe.Pointer(bp /* rowv */)))
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// ConvertLocalToUTCUsingTable --
//
//	Converts a time (in a TclDateFields structure) from local time in a
//	given time zone to UTC.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Stores an error message in the interpreter if an error occurs; if
//	successful, stores the 'seconds' field in 'fields.
//
//----------------------------------------------------------------------

func sConvertLocalToUTCUsingTable(tls *libc.TLS, interp uintptr, fields uintptr, rowc int32, rowv uintptr) int32 { /* tclClock.c:792:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var row uintptr
	// var cellc int32 at bp+8, 4

	// var cellv uintptr at bp, 8

	// var have [8]int32 at bp+12, 32

	var nHave int32 = 0
	var i int32
	var found int32

	// Perform an initial lookup assuming that local == UTC, and locate the
	// last time conversion prior to that time. Get the offset from that row,
	// and look up again. Continue until we find an offset that we found
	// before. This definition, rather than "the same offset" ensures that we
	// don't enter an endless loop, as would otherwise happen when trying to
	// convert a non-existent time such as 02:30 during the US Spring Daylight
	// Saving Time transition.

	found = 0
	(*TclDateFields)(unsafe.Pointer(fields)).FtzOffset = 0
	(*TclDateFields)(unsafe.Pointer(fields)).Fseconds = (*TclDateFields)(unsafe.Pointer(fields)).FlocalSeconds
	for !(found != 0) {
		row = sLookupLastTransition(tls, interp, (*TclDateFields)(unsafe.Pointer(fields)).Fseconds, rowc, rowv)
		if row == uintptr(0) ||
			func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(row)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
					return func() int32 {
						*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(row + 32)) + 16
						*(*int32)(unsafe.Pointer(bp + 8)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(row + 32)))).FelemCount
						return TCL_OK
					}()
				}
				return XTcl_ListObjGetElements(tls, interp, row, bp+8, bp)
			}() != TCL_OK ||
			func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
					return func() int32 {
						*(*int32)(unsafe.Pointer(fields + 16)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)) + 32)))
						return TCL_OK
					}()
				}
				return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)), fields+16)
			}() != TCL_OK {
			return TCL_ERROR
		}
		found = 0
		for i = 0; !(found != 0) && i < nHave; i++ {
			if *(*int32)(unsafe.Pointer(bp + 12 + uintptr(i)*4)) == (*TclDateFields)(unsafe.Pointer(fields)).FtzOffset {
				found = 1
				break
			}
		}
		if !(found != 0) {
			if nHave == 8 {
				XTcl_Panic(tls, ts+11002, 0)
			}
			*(*int32)(unsafe.Pointer(bp + 12 + uintptr(libc.PostIncInt32(&nHave, 1))*4)) = (*TclDateFields)(unsafe.Pointer(fields)).FtzOffset
		}
		(*TclDateFields)(unsafe.Pointer(fields)).Fseconds = (*TclDateFields)(unsafe.Pointer(fields)).FlocalSeconds - Tcl_WideInt((*TclDateFields)(unsafe.Pointer(fields)).FtzOffset)
	}
	(*TclDateFields)(unsafe.Pointer(fields)).FtzOffset = *(*int32)(unsafe.Pointer(bp + 12 + uintptr(i)*4))
	(*TclDateFields)(unsafe.Pointer(fields)).Fseconds = (*TclDateFields)(unsafe.Pointer(fields)).FlocalSeconds - Tcl_WideInt((*TclDateFields)(unsafe.Pointer(fields)).FtzOffset)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ConvertLocalToUTCUsingC --
//
//	Converts a time from local wall clock to UTC when the local time zone
//	cannot be determined. Uses 'mktime' to do the job.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Stores an error message in the interpreter if an error occurs; if
//	successful, stores the 'seconds' field in 'fields.
//
//----------------------------------------------------------------------

func sConvertLocalToUTCUsingC(tls *libc.TLS, interp uintptr, fields uintptr, changeover int32) int32 { /* tclClock.c:867:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	// var timeVal Tm at bp, 56

	var localErrno int32
	var secondOfDay int32
	var jsec Tcl_WideInt

	// Convert the given time to a date.

	jsec = (*TclDateFields)(unsafe.Pointer(fields)).FlocalSeconds + int64(JULIAN_DAY_POSIX_EPOCH)*int64(SECONDS_PER_DAY)
	(*TclDateFields)(unsafe.Pointer(fields)).FjulianDay = int32(jsec / int64(SECONDS_PER_DAY))
	secondOfDay = int32(jsec % int64(SECONDS_PER_DAY))
	if secondOfDay < 0 {
		secondOfDay = secondOfDay + SECONDS_PER_DAY
		(*TclDateFields)(unsafe.Pointer(fields)).FjulianDay--
	}
	sGetGregorianEraYearDay(tls, fields, changeover)
	sGetMonthDay(tls, fields)

	// Convert the date/time to a 'struct tm'.

	(*Tm)(unsafe.Pointer(bp /* &timeVal */)).Ftm_year = (*TclDateFields)(unsafe.Pointer(fields)).Fyear - 1900
	(*Tm)(unsafe.Pointer(bp /* &timeVal */)).Ftm_mon = (*TclDateFields)(unsafe.Pointer(fields)).Fmonth - 1
	(*Tm)(unsafe.Pointer(bp /* &timeVal */)).Ftm_mday = (*TclDateFields)(unsafe.Pointer(fields)).FdayOfMonth
	(*Tm)(unsafe.Pointer(bp /* &timeVal */)).Ftm_hour = secondOfDay / 3600 % 24
	(*Tm)(unsafe.Pointer(bp /* &timeVal */)).Ftm_min = secondOfDay / 60 % 60
	(*Tm)(unsafe.Pointer(bp /* &timeVal */)).Ftm_sec = secondOfDay % 60
	(*Tm)(unsafe.Pointer(bp /* &timeVal */)).Ftm_isdst = -1
	(*Tm)(unsafe.Pointer(bp /* &timeVal */)).Ftm_wday = -1
	(*Tm)(unsafe.Pointer(bp /* &timeVal */)).Ftm_yday = -1

	// Get local time. It is rumored that mktime is not thread safe on some
	// platforms, so seize a mutex before attempting this.

	sTzsetIfNecessary(tls)
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&clockMutex)))
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
	(*TclDateFields)(unsafe.Pointer(fields)).Fseconds = libc.Xmktime(tls, bp)
	localErrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&clockMutex)))

	// If conversion fails, report an error.

	if localErrno != 0 ||
		(*TclDateFields)(unsafe.Pointer(fields)).Fseconds == int64(-1) && (*Tm)(unsafe.Pointer(bp)).Ftm_yday == -1 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+11038, -1))
		return TCL_ERROR
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ConvertUTCToLocal --
//
//	Converts a time (in a TclDateFields structure) from UTC to local time.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Populates the 'tzName' and 'tzOffset' fields.
//
//----------------------------------------------------------------------

func sConvertUTCToLocal(tls *libc.TLS, interp uintptr, fields uintptr, tzdata uintptr, changeover int32) int32 { /* tclClock.c:947:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var rowc int32 at bp+8, 4
	// Number of rows in tzdata
	// var rowv uintptr at bp, 8
	// Pointers to the rows

	// Unpack the tz data.

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(tzdata)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(tzdata + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 8)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tzdata + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, tzdata, bp+8, bp)
	}() != TCL_OK {
		return TCL_ERROR
	}

	// Special case: If the time zone is :localtime, the tzdata will be empty.
	// Use 'localtime' to convert the time to local

	if *(*int32)(unsafe.Pointer(bp + 8)) == 0 {
		return sConvertUTCToLocalUsingC(tls, interp, fields, changeover)
	} else {
		return sConvertUTCToLocalUsingTable(tls, interp, fields, *(*int32)(unsafe.Pointer(bp + 8 /* rowc */)), *(*uintptr)(unsafe.Pointer(bp /* rowv */)))
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// ConvertUTCToLocalUsingTable --
//
//	Converts UTC to local time, given a table of transition points
//
// Results:
//	Returns a standard Tcl result
//
// Side effects:
//	On success, fills fields->tzName, fields->tzOffset and
//	fields->localSeconds. On failure, places an error message in the
//	interpreter result.
//
//----------------------------------------------------------------------

func sConvertUTCToLocalUsingTable(tls *libc.TLS, interp uintptr, fields uintptr, rowc int32, rowv uintptr) int32 { /* tclClock.c:995:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var row uintptr // Row containing the current information
	// var cellc int32 at bp+8, 4
	// Count of cells in the row (must be 4)
	// var cellv uintptr at bp, 8
	// Pointers to the cells

	// Look up the nearest transition time.

	row = sLookupLastTransition(tls, interp, (*TclDateFields)(unsafe.Pointer(fields)).Fseconds, rowc, rowv)
	if row == uintptr(0) || func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(row)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(row + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 8)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(row + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, row, bp+8, bp)
	}() != TCL_OK || func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(fields + 16)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)), fields+16)
	}() != TCL_OK {
		return TCL_ERROR
	}

	// Convert the time.

	(*TclDateFields)(unsafe.Pointer(fields)).FtzName = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* cellv */)) + 3*8))
	(*Tcl_Obj)(unsafe.Pointer((*TclDateFields)(unsafe.Pointer(fields)).FtzName)).FrefCount++
	(*TclDateFields)(unsafe.Pointer(fields)).FlocalSeconds = (*TclDateFields)(unsafe.Pointer(fields)).Fseconds + Tcl_WideInt((*TclDateFields)(unsafe.Pointer(fields)).FtzOffset)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ConvertUTCToLocalUsingC --
//
//	Converts UTC to localtime in cases where the local time zone is not
//	determinable, using the C 'localtime' function to do it.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	On success, fills fields->tzName, fields->tzOffset and
//	fields->localSeconds. On failure, places an error message in the
//	interpreter result.
//
//----------------------------------------------------------------------

func sConvertUTCToLocalUsingC(tls *libc.TLS, interp uintptr, fields uintptr, changeover int32) int32 { /* tclClock.c:1047:1: */
	bp := tls.Alloc(96)
	defer tls.Free(96)

	// var tock Time_t at bp+72, 8

	var timeVal uintptr // Time after conversion
	var diff int32      // Time zone diff local-Greenwich
	// var buffer [16]int8 at bp+80, 16
	// Buffer for time zone name

	// Use 'localtime' to determine local year, month, day, time of day.

	*(*Time_t)(unsafe.Pointer(bp + 72 /* tock */)) = (*TclDateFields)(unsafe.Pointer(fields)).Fseconds
	if *(*Time_t)(unsafe.Pointer(bp + 72)) != (*TclDateFields)(unsafe.Pointer(fields)).Fseconds {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+11078, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+11124, ts+11130, uintptr(0)))
		return TCL_ERROR
	}
	sTzsetIfNecessary(tls)
	timeVal = sThreadSafeLocalTime(tls, bp+72)
	if timeVal == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

			ts+11142, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+11124, ts+11209, uintptr(0)))
		return TCL_ERROR
	}

	// Fill in the date in 'fields' and use it to derive Julian Day.

	(*TclDateFields)(unsafe.Pointer(fields)).Fera = CE
	(*TclDateFields)(unsafe.Pointer(fields)).Fyear = (*Tm)(unsafe.Pointer(timeVal)).Ftm_year + 1900
	(*TclDateFields)(unsafe.Pointer(fields)).Fmonth = (*Tm)(unsafe.Pointer(timeVal)).Ftm_mon + 1
	(*TclDateFields)(unsafe.Pointer(fields)).FdayOfMonth = (*Tm)(unsafe.Pointer(timeVal)).Ftm_mday
	sGetJulianDayFromEraYearMonthDay(tls, fields, changeover)

	// Convert that value to seconds.

	(*TclDateFields)(unsafe.Pointer(fields)).FlocalSeconds = ((Tcl_WideInt((*TclDateFields)(unsafe.Pointer(fields)).FjulianDay)*int64(24)+
		Tcl_WideInt((*Tm)(unsafe.Pointer(timeVal)).Ftm_hour))*int64(60)+Tcl_WideInt((*Tm)(unsafe.Pointer(timeVal)).Ftm_min))*int64(60) +
		Tcl_WideInt((*Tm)(unsafe.Pointer(timeVal)).Ftm_sec) - int64(JULIAN_DAY_POSIX_EPOCH)*int64(SECONDS_PER_DAY)

	// Determine a time zone offset and name; just use +hhmm for the name.

	diff = int32((*TclDateFields)(unsafe.Pointer(fields)).FlocalSeconds - (*TclDateFields)(unsafe.Pointer(fields)).Fseconds)
	(*TclDateFields)(unsafe.Pointer(fields)).FtzOffset = diff
	if diff < 0 {
		*(*int8)(unsafe.Pointer(bp + 80)) = int8('-')
		diff = -diff
	} else {
		*(*int8)(unsafe.Pointer(bp + 80)) = int8('+')
	}
	libc.Xsprintf(tls, bp+80+uintptr(1), ts+11225, libc.VaList(bp+48, diff/3600))
	diff = diff % 3600
	libc.Xsprintf(tls, bp+80+uintptr(3), ts+11225, libc.VaList(bp+56, diff/60))
	diff = diff % 60
	if diff > 0 {
		libc.Xsprintf(tls, bp+80+uintptr(5), ts+11225, libc.VaList(bp+64, diff))
	}
	(*TclDateFields)(unsafe.Pointer(fields)).FtzName = XTcl_NewStringObj(tls, bp+80, -1)
	(*Tcl_Obj)(unsafe.Pointer((*TclDateFields)(unsafe.Pointer(fields)).FtzName)).FrefCount++
	return TCL_OK
}

//----------------------------------------------------------------------
//
// LookupLastTransition --
//
//	Given a UTC time and a tzdata array, looks up the last transition on
//	or before the given time.
//
// Results:
//	Returns a pointer to the row, or NULL if an error occurs.
//
//----------------------------------------------------------------------

func sLookupLastTransition(tls *libc.TLS, interp uintptr, tick Tcl_WideInt, rowc int32, rowv uintptr) uintptr { /* tclClock.c:1134:16: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var l int32
	var u int32
	// var compObj uintptr at bp, 8

	// var compVal Tcl_WideInt at bp+8, 8

	// Examine the first row to make sure we're in bounds.

	if XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(rowv)), 0, bp) != TCL_OK ||
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
				return func() int32 {
					*(*Tcl_WideInt)(unsafe.Pointer(bp + 8)) = *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))
					return TCL_OK
				}()
			}
			return XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), bp+8)
		}() != TCL_OK {
		return uintptr(0)
	}

	// Bizarre case - first row doesn't begin at MIN_WIDE_INT. Return it
	// anyway.

	if tick < *(*Tcl_WideInt)(unsafe.Pointer(bp + 8)) {
		return *(*uintptr)(unsafe.Pointer(rowv))
	}

	// Binary-search to find the transition.

	l = 0
	u = rowc - 1
	for l < u {
		var m int32 = (l + u + 1) / 2

		if XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(rowv + uintptr(m)*8)), 0, bp) != TCL_OK || func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
				return func() int32 {
					*(*Tcl_WideInt)(unsafe.Pointer(bp + 8)) = *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))
					return TCL_OK
				}()
			}
			return XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), bp+8)
		}() != TCL_OK {
			return uintptr(0)
		}
		if tick >= *(*Tcl_WideInt)(unsafe.Pointer(bp + 8)) {
			l = m
		} else {
			u = m - 1
		}
	}
	return *(*uintptr)(unsafe.Pointer(rowv + uintptr(l)*8))
}

//----------------------------------------------------------------------
//
// GetYearWeekDay --
//
//	Given a date with Julian Calendar Day, compute the year, week, and day
//	in the ISO8601 calendar.
//
// Results:
//	None.
//
// Side effects:
//	Stores 'iso8601Year', 'iso8601Week' and 'dayOfWeek' in the date
//	fields.
//
//----------------------------------------------------------------------

func sGetYearWeekDay(tls *libc.TLS, fields uintptr, changeover int32) { /* tclClock.c:1205:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	// var temp TclDateFields at bp, 72

	var dayOfFiscalYear int32

	// Find the given date, minus three days, plus one year. That date's
	// iso8601 year is an upper bound on the ISO8601 year of the given date.

	(*TclDateFields)(unsafe.Pointer(bp /* &temp */)).FjulianDay = (*TclDateFields)(unsafe.Pointer(fields)).FjulianDay - 3
	sGetGregorianEraYearDay(tls, bp, changeover)
	if (*TclDateFields)(unsafe.Pointer(bp)).Fera == BCE {
		(*TclDateFields)(unsafe.Pointer(bp /* &temp */)).Fiso8601Year = (*TclDateFields)(unsafe.Pointer(bp)).Fyear - 1
	} else {
		(*TclDateFields)(unsafe.Pointer(bp /* &temp */)).Fiso8601Year = (*TclDateFields)(unsafe.Pointer(bp)).Fyear + 1
	}
	(*TclDateFields)(unsafe.Pointer(bp /* &temp */)).Fiso8601Week = 1
	(*TclDateFields)(unsafe.Pointer(bp /* &temp */)).FdayOfWeek = 1
	sGetJulianDayFromEraYearWeekDay(tls, bp, changeover)

	// temp.julianDay is now the start of an ISO8601 year, either the one
	// corresponding to the given date, or the one after. If we guessed high,
	// move one year earlier

	if (*TclDateFields)(unsafe.Pointer(fields)).FjulianDay < (*TclDateFields)(unsafe.Pointer(bp)).FjulianDay {
		if (*TclDateFields)(unsafe.Pointer(bp)).Fera == BCE {
			*(*int32)(unsafe.Pointer(bp + 60)) += 1
		} else {
			*(*int32)(unsafe.Pointer(bp + 60)) -= 1
		}
		sGetJulianDayFromEraYearWeekDay(tls, bp, changeover)
	}

	(*TclDateFields)(unsafe.Pointer(fields)).Fiso8601Year = (*TclDateFields)(unsafe.Pointer(bp /* &temp */)).Fiso8601Year
	dayOfFiscalYear = (*TclDateFields)(unsafe.Pointer(fields)).FjulianDay - (*TclDateFields)(unsafe.Pointer(bp)).FjulianDay
	(*TclDateFields)(unsafe.Pointer(fields)).Fiso8601Week = dayOfFiscalYear/7 + 1
	(*TclDateFields)(unsafe.Pointer(fields)).FdayOfWeek = (dayOfFiscalYear + 1) % 7
	if (*TclDateFields)(unsafe.Pointer(fields)).FdayOfWeek < 1 {
		*(*int32)(unsafe.Pointer(fields + 68)) += 7
	}
}

//----------------------------------------------------------------------
//
// GetGregorianEraYearDay --
//
//	Given a Julian Day Number, extracts the year and day of the year and
//	puts them into TclDateFields, along with the era (BCE or CE) and a
//	flag indicating whether the date is Gregorian or Julian.
//
// Results:
//	None.
//
// Side effects:
//	Stores 'era', 'gregorian', 'year', and 'dayOfYear'.
//
//----------------------------------------------------------------------

func sGetGregorianEraYearDay(tls *libc.TLS, fields uintptr, changeover int32) { /* tclClock.c:1272:1: */
	var jday int32 = (*TclDateFields)(unsafe.Pointer(fields)).FjulianDay
	var day int32
	var year int32
	var n int32

	if jday >= changeover {
		// Gregorian calendar.

		(*TclDateFields)(unsafe.Pointer(fields)).Fgregorian = 1
		year = 1

		// n = Number of 400-year cycles since 1 January, 1 CE in the
		// proleptic Gregorian calendar. day = remaining days.

		day = jday - JDAY_1_JAN_1_CE_GREGORIAN
		n = day / FOUR_CENTURIES
		day = day % FOUR_CENTURIES
		if day < 0 {
			day = day + FOUR_CENTURIES
			n--
		}
		year = year + 400*n

		// n = number of centuries since the start of (year);
		// day = remaining days

		n = day / ONE_CENTURY_GREGORIAN
		day = day % ONE_CENTURY_GREGORIAN
		if n > 3 {
			// 31 December in the last year of a 400-year cycle.

			n = 3
			day = day + ONE_CENTURY_GREGORIAN
		}
		year = year + 100*n
	} else {
		// Julian calendar.

		(*TclDateFields)(unsafe.Pointer(fields)).Fgregorian = 0
		year = 1
		day = jday - JDAY_1_JAN_1_CE_JULIAN
	}

	// n = number of 4-year cycles; days = remaining days.

	n = day / FOUR_YEARS
	day = day % FOUR_YEARS
	if day < 0 {
		day = day + FOUR_YEARS
		n--
	}
	year = year + 4*n

	// n = number of years; days = remaining days.

	n = day / ONE_YEAR
	day = day % ONE_YEAR
	if n > 3 {
		// 31 December of a leap year.

		n = 3
		day = day + 365
	}
	year = year + n

	// store era/year/day back into fields.

	if year <= 0 {
		(*TclDateFields)(unsafe.Pointer(fields)).Fera = BCE
		(*TclDateFields)(unsafe.Pointer(fields)).Fyear = 1 - year
	} else {
		(*TclDateFields)(unsafe.Pointer(fields)).Fera = CE
		(*TclDateFields)(unsafe.Pointer(fields)).Fyear = year
	}
	(*TclDateFields)(unsafe.Pointer(fields)).FdayOfYear = day + 1
}

//----------------------------------------------------------------------
//
// GetMonthDay --
//
//	Given a date as year and day-of-year, find month and day.
//
// Results:
//	None.
//
// Side effects:
//	Stores 'month' and 'dayOfMonth' in the 'fields' structure.
//
//----------------------------------------------------------------------

func sGetMonthDay(tls *libc.TLS, fields uintptr) { /* tclClock.c:1388:1: */
	var day int32 = (*TclDateFields)(unsafe.Pointer(fields)).FdayOfYear
	var month int32
	var h uintptr = uintptr(unsafe.Pointer(&hath)) + uintptr(sIsGregorianLeapYear(tls, fields))*48

	for month = 0; month < 12 && day > *(*int32)(unsafe.Pointer(h + uintptr(month)*4)); month++ {
		day = day - *(*int32)(unsafe.Pointer(h + uintptr(month)*4))
	}
	(*TclDateFields)(unsafe.Pointer(fields)).Fmonth = month + 1
	(*TclDateFields)(unsafe.Pointer(fields)).FdayOfMonth = day
}

//----------------------------------------------------------------------
//
// GetJulianDayFromEraYearWeekDay --
//
//	Given a TclDateFields structure containing era, ISO8601 year, ISO8601
//	week, and day of week, computes the Julian Day Number.
//
// Results:
//	None.
//
// Side effects:
//	Stores 'julianDay' in the fields.
//
//----------------------------------------------------------------------

func sGetJulianDayFromEraYearWeekDay(tls *libc.TLS, fields uintptr, changeover int32) { /* tclClock.c:1420:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var firstMonday int32 // Julian day number of week 1, day 1 in the
	// given year
	// var firstWeek TclDateFields at bp, 72

	// Find January 4 in the ISO8601 year, which will always be in week 1.

	(*TclDateFields)(unsafe.Pointer(bp /* &firstWeek */)).Fera = (*TclDateFields)(unsafe.Pointer(fields)).Fera
	(*TclDateFields)(unsafe.Pointer(bp /* &firstWeek */)).Fyear = (*TclDateFields)(unsafe.Pointer(fields)).Fiso8601Year
	(*TclDateFields)(unsafe.Pointer(bp /* &firstWeek */)).Fmonth = 1
	(*TclDateFields)(unsafe.Pointer(bp /* &firstWeek */)).FdayOfMonth = 4
	sGetJulianDayFromEraYearMonthDay(tls, bp, changeover)

	// Find Monday of week 1.

	firstMonday = sWeekdayOnOrBefore(tls, 1, (*TclDateFields)(unsafe.Pointer(bp /* &firstWeek */)).FjulianDay)

	// Advance to the given week and day.

	(*TclDateFields)(unsafe.Pointer(fields)).FjulianDay = firstMonday + 7*((*TclDateFields)(unsafe.Pointer(fields)).Fiso8601Week-1) +
		(*TclDateFields)(unsafe.Pointer(fields)).FdayOfWeek - 1
}

//----------------------------------------------------------------------
//
// GetJulianDayFromEraYearMonthDay --
//
//	Given era, year, month, and dayOfMonth (in TclDateFields), and the
//	Gregorian transition date, computes the Julian Day Number.
//
// Results:
//	None.
//
// Side effects:
//	Stores day number in 'julianDay'
//
//----------------------------------------------------------------------

func sGetJulianDayFromEraYearMonthDay(tls *libc.TLS, fields uintptr, changeover int32) { /* tclClock.c:1471:1: */
	var year int32
	var ym1 int32
	var month int32
	var mm1 int32
	var q int32
	var r int32
	var ym1o4 int32
	var ym1o100 int32
	var ym1o400 int32

	if (*TclDateFields)(unsafe.Pointer(fields)).Fera == BCE {
		year = 1 - (*TclDateFields)(unsafe.Pointer(fields)).Fyear
	} else {
		year = (*TclDateFields)(unsafe.Pointer(fields)).Fyear
	}

	// Reduce month modulo 12.

	month = (*TclDateFields)(unsafe.Pointer(fields)).Fmonth
	mm1 = month - 1
	q = mm1 / 12
	r = mm1 % 12
	if r < 0 {
		r = r + 12
		q = q - 1
	}
	year = year + q
	month = r + 1
	ym1 = year - 1

	// Adjust the year after reducing the month.

	(*TclDateFields)(unsafe.Pointer(fields)).Fgregorian = 1
	if year < 1 {
		(*TclDateFields)(unsafe.Pointer(fields)).Fera = BCE
		(*TclDateFields)(unsafe.Pointer(fields)).Fyear = 1 - year
	} else {
		(*TclDateFields)(unsafe.Pointer(fields)).Fera = CE
		(*TclDateFields)(unsafe.Pointer(fields)).Fyear = year
	}

	// Try an initial conversion in the Gregorian calendar.

	// Have to make sure quotient is truncated towards 0 when negative.
	// See above bug for details. The casts are necessary.
	if ym1 >= 0 {
		ym1o4 = ym1 / 4
	} else {
		ym1o4 = -int32(uint32(-ym1) / uint32(4))
	}
	if ym1%4 < 0 {
		ym1o4--
	}
	ym1o100 = ym1 / 100
	if ym1%100 < 0 {
		ym1o100--
	}
	ym1o400 = ym1 / 400
	if ym1%400 < 0 {
		ym1o400--
	}
	(*TclDateFields)(unsafe.Pointer(fields)).FjulianDay = JDAY_1_JAN_1_CE_GREGORIAN - 1 +
		(*TclDateFields)(unsafe.Pointer(fields)).FdayOfMonth +
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&daysInPriorMonths)) + uintptr(sIsGregorianLeapYear(tls, fields))*52 + uintptr(month-1)*4)) +
		ONE_YEAR*ym1 +
		ym1o4 -
		ym1o100 +
		ym1o400

	// If the resulting date is before the Gregorian changeover, convert in
	// the Julian calendar instead.

	if (*TclDateFields)(unsafe.Pointer(fields)).FjulianDay < changeover {
		(*TclDateFields)(unsafe.Pointer(fields)).Fgregorian = 0
		(*TclDateFields)(unsafe.Pointer(fields)).FjulianDay = JDAY_1_JAN_1_CE_JULIAN - 1 +
			(*TclDateFields)(unsafe.Pointer(fields)).FdayOfMonth +
			*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&daysInPriorMonths)) + uintptr(libc.Bool32(year%4 == 0))*52 + uintptr(month-1)*4)) +
			365*ym1 +
			ym1o4
	}
}

//----------------------------------------------------------------------
//
// IsGregorianLeapYear --
//
//	Tests whether a given year is a leap year, in either Julian or
//	Gregorian calendar.
//
// Results:
//	Returns 1 for a leap year, 0 otherwise.
//
//----------------------------------------------------------------------

func sIsGregorianLeapYear(tls *libc.TLS, fields uintptr) int32 { /* tclClock.c:1578:1: */
	var year int32 = (*TclDateFields)(unsafe.Pointer(fields)).Fyear

	if (*TclDateFields)(unsafe.Pointer(fields)).Fera == BCE {
		year = 1 - year
	}
	if year%4 != 0 {
		return 0
	} else if !((*TclDateFields)(unsafe.Pointer(fields)).Fgregorian != 0) {
		return 1
	} else if year%400 == 0 {
		return 1
	} else if year%100 == 0 {
		return 0
	} else {
		return 1
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// WeekdayOnOrBefore --
//
//	Finds the Julian Day Number of a given day of the week that falls on
//	or before a given date, expressed as Julian Day Number.
//
// Results:
//	Returns the Julian Day Number
//
//----------------------------------------------------------------------

func sWeekdayOnOrBefore(tls *libc.TLS, dayOfWeek int32, julianDay int32) int32 { /* tclClock.c:1614:1: */
	var k int32 = (dayOfWeek + 6) % 7
	if k < 0 {
		k = k + 7
	}
	return julianDay - (julianDay-k)%7
}

//----------------------------------------------------------------------
//
// ClockGetenvObjCmd --
//
//	Tcl command that reads an environment variable from the system
//
// Usage:
//	::tcl::clock::getEnv NAME
//
// Parameters:
//	NAME - Name of the environment variable desired
//
// Results:
//	Returns a standard Tcl result. Returns an error if the variable does
//	not exist, with a message left in the interpreter. Returns TCL_OK and
//	the value of the variable if the variable does exist,
//
//----------------------------------------------------------------------

func XClockGetenvObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclClock.c:1647:1: */
	var varName uintptr
	var varValue uintptr
	_ = clientData

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	varName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	varValue = libc.Xgetenv(tls, varName)
	if varValue == uintptr(0) {
		varValue = ts + 2046 /* "" */
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, varValue, -1))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ThreadSafeLocalTime --
//
//	Wrapper around the 'localtime' library function to make it thread
//	safe.
//
// Results:
//	Returns a pointer to a 'struct tm' in thread-specific data.
//
// Side effects:
//	Invokes localtime or localtime_r as appropriate.
//
//----------------------------------------------------------------------

func sThreadSafeLocalTime(tls *libc.TLS, timePtr uintptr) uintptr { /* tclClock.c:1704:18: */
	// Get a thread-local buffer to hold the returned time.

	var tmPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&tmKey)), int32(unsafe.Sizeof(Tm{})))
	libc.Xlocaltime_r(tls, timePtr, tmPtr)
	return tmPtr
}

// ----------------------------------------------------------------------
//
// ClockClicksObjCmd --
//
//	Returns a high-resolution counter.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	None.
//
// This function implements the 'clock clicks' Tcl command. Refer to the user
// documentation for details on what it does.
//
//----------------------------------------------------------------------

func XClockClicksObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclClock.c:1750:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	*(*int32)(unsafe.Pointer(bp /* index */)) = 2 /* CLICKS_NATIVE */
	// var now Tcl_Time at bp+8, 16

	var clicks Tcl_WideInt = int64(0)
	_ = clientData

	switch objc {
	case 1:
		break
	case 2:
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&clicksSwitches)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp) != TCL_OK {
			return TCL_ERROR
		}
		break
	default:
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11230)
		return TCL_ERROR
	}

	switch *(*int32)(unsafe.Pointer(bp /* index */)) {
	case 0 /* CLICKS_MILLIS */ :
		XTcl_GetTime(tls, bp+8)
		clicks = (*Tcl_Time)(unsafe.Pointer(bp+8)).Fsec*int64(1000) + (*Tcl_Time)(unsafe.Pointer(bp+8)).Fusec/int64(1000)
		break
	case 2 /* CLICKS_NATIVE */ :
		clicks = Tcl_WideInt(XTclpGetClicks(tls))
		break
	case 1 /* CLICKS_MICROS */ :
		clicks = XTclpGetMicroseconds(tls)
		break
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, clicks))
	return TCL_OK
}

var clicksSwitches = [3]uintptr{
	ts + 11240, ts + 11254, uintptr(0),
} /* tclClock.c:1756:23 */

// ----------------------------------------------------------------------
//
// ClockMillisecondsObjCmd -
//
//	Returns a count of milliseconds since the epoch.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	None.
//
// This function implements the 'clock milliseconds' Tcl command. Refer to the
// user documentation for details on what it does.
//
//----------------------------------------------------------------------

func XClockMillisecondsObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclClock.c:1821:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var now Tcl_Time at bp, 16

	_ = clientData

	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}
	XTcl_GetTime(tls, bp)
	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, (*Tcl_Time)(unsafe.Pointer(bp)).Fsec*int64(1000)+(*Tcl_Time)(unsafe.Pointer(bp)).Fusec/int64(1000)))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// ClockMicrosecondsObjCmd -
//
//	Returns a count of microseconds since the epoch.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	None.
//
// This function implements the 'clock microseconds' Tcl command. Refer to the
// user documentation for details on what it does.
//
//----------------------------------------------------------------------

func XClockMicrosecondsObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclClock.c:1859:1: */
	_ = clientData
	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, XTclpGetMicroseconds(tls)))
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// ClockParseformatargsObjCmd --
//
//	Parses the arguments for [clock format].
//
// Results:
//	Returns a standard Tcl result, whose value is a four-element list
//	comprising the time format, the locale, and the timezone.
//
// This function exists because the loop that parses the [clock format]
// options is a known performance "hot spot", and is implemented in an effort
// to speed that particular code up.
//
//-----------------------------------------------------------------------------

func sClockParseformatargsObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclClock.c:1893:1: */
	bp := tls.Alloc(120)
	defer tls.Free(120)

	var dataPtr uintptr = clientData
	var litPtr uintptr = (*ClockClientData)(unsafe.Pointer(dataPtr)).Fliterals
	// var results [3]uintptr at bp+80, 24
	// Format, locale and timezone
	*(*int32)(unsafe.Pointer(bp + 108 /* gmtFlag */)) = 0
	// var optionIndex int32 at bp+104, 4
	// Index of an option.
	var saw int32 = 0 // Flag == 1 if option was seen already.
	// var clockVal Tcl_WideInt at bp+112, 8
	// Clock value - just used to parse.
	var i int32

	// Args consist of a time followed by keyword-value pairs.

	if objc < 2 || objc%2 != 0 {
		XTcl_WrongNumArgs(tls, interp, 0, objv,

			ts+11268)
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+11124, ts+11356, uintptr(0)))
		return TCL_ERROR
	}

	// Extract values for the keywords.

	*(*uintptr)(unsafe.Pointer(bp + 80)) = *(*uintptr)(unsafe.Pointer(litPtr + 1*8))
	*(*uintptr)(unsafe.Pointer(bp + 80 + 1*8)) = *(*uintptr)(unsafe.Pointer(litPtr + 3*8))
	*(*uintptr)(unsafe.Pointer(bp + 80 + 2*8)) = *(*uintptr)(unsafe.Pointer(litPtr))
	for i = 2; i < objc; i = i + 2 {
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+104) != TCL_OK {
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+11124, ts+11369,
				XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))), uintptr(0)))
			return TCL_ERROR
		}
		switch *(*int32)(unsafe.Pointer(bp + 104 /* optionIndex */)) {
		case 0 /* CLOCK_FORMAT_FORMAT */ :
			*(*uintptr)(unsafe.Pointer(bp + 80)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
			break
		case 1 /* CLOCK_FORMAT_GMT */ :
			if XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+108) != TCL_OK {
				return TCL_ERROR
			}
			break
		case 2 /* CLOCK_FORMAT_LOCALE */ :
			*(*uintptr)(unsafe.Pointer(bp + 80 + 1*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
			break
		case 3 /* CLOCK_FORMAT_TIMEZONE */ :
			*(*uintptr)(unsafe.Pointer(bp + 80 + 2*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
			break
		}
		saw = saw | int32(1)<<*(*int32)(unsafe.Pointer(bp + 104))
	}

	// Check options.

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp + 112)) = *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+112)
	}() != TCL_OK {
		return TCL_ERROR
	}
	if saw&(int32(1)<<1) != 0 &&
		saw&(int32(1)<<3) != 0 {
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(litPtr + 4*8)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+11124, ts+11379, uintptr(0)))
		return TCL_ERROR
	}
	if *(*int32)(unsafe.Pointer(bp + 108)) != 0 {
		*(*uintptr)(unsafe.Pointer(bp + 80 + 2*8)) = *(*uintptr)(unsafe.Pointer(litPtr + 10*8))
	}

	// Return options as a list.

	XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, 3, bp+80))
	return TCL_OK

}

var options = [5]uintptr{ // Command line options expected
	ts + 11395, ts + 11403, ts + 11408,
	ts + 11416, uintptr(0)} /* tclClock.c:1906:23 */

// ----------------------------------------------------------------------
//
// ClockSecondsObjCmd -
//
//	Returns a count of microseconds since the epoch.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	None.
//
// This function implements the 'clock seconds' Tcl command. Refer to the user
// documentation for details on what it does.
//
//----------------------------------------------------------------------

func XClockSecondsObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclClock.c:2011:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var now Tcl_Time at bp, 16

	_ = clientData

	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}
	XTcl_GetTime(tls, bp)
	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, (*Tcl_Time)(unsafe.Pointer(bp /* &now */)).Fsec))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TzsetIfNecessary --
//
//	Calls the tzset() library function if the contents of the TZ
//	environment variable has changed.
//
// Results:
//	None.
//
// Side effects:
//	Calls tzset.
//
//----------------------------------------------------------------------

func sTzsetIfNecessary(tls *libc.TLS) { /* tclClock.c:2056:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)
	// Last env epoch, for faster signaling,
	// 					    that TZ changed via TCL
	var tzIsNow uintptr // Current value of TZ

	// Prevent performance regression on some platforms by resolving of system time zone:
	// small latency for check whether environment was changed (once per second)
	// no latency if environment was changed with tcl-env (compare both epoch values)
	// var now Tcl_Time at bp, 16

	XTcl_GetTime(tls, bp)
	if (*Tcl_Time)(unsafe.Pointer(bp)).Fsec == tzLastRefresh && tzEnvEpoch == XTclEnvEpoch {
		return
	}

	tzEnvEpoch = XTclEnvEpoch
	tzLastRefresh = (*Tcl_Time)(unsafe.Pointer(bp /* &now */)).Fsec

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&clockMutex)))
	tzIsNow = libc.Xgetenv(tls, ts+11426)
	if tzIsNow != uintptr(0) && (tzWas == uintptr(0) || tzWas == libc.UintptrFromInt64(int64(-1)) ||
		libc.Xstrcmp(tls, tzIsNow, tzWas) != 0) {
		libc.Xtzset(tls)
		if tzWas != uintptr(0) && tzWas != libc.UintptrFromInt64(int64(-1)) {
			XTclpFree(tls, tzWas)
		}
		tzWas = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(int8(0)))*(libc.Xstrlen(tls, tzIsNow)+uint64(1))))
		libc.Xstrcpy(tls, tzWas, tzIsNow)
	} else if tzIsNow == uintptr(0) && tzWas != uintptr(0) {
		libc.Xtzset(tls)
		if tzWas != libc.UintptrFromInt64(int64(-1)) {
			XTclpFree(tls, tzWas)
		}
		tzWas = uintptr(0)
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&clockMutex)))
}

var tzWas uintptr = libc.UintptrFromInt64(int64(-1)) /* tclClock.c:2058:17 */
var tzLastRefresh int64 = int64(0)                   /* tclClock.c:2060:18 */
var tzEnvEpoch Size_t = uint64(0)                    /* tclClock.c:2061:19 */

//----------------------------------------------------------------------
//
// ClockDeleteCmdProc --
//
//	Remove a reference to the clock client data, and clean up memory
//	when it's all gone.
//
// Results:
//	None.
//
//----------------------------------------------------------------------

func sClockDeleteCmdProc(tls *libc.TLS, clientData ClientData) { /* tclClock.c:2112:1: */
	var data uintptr = clientData
	var i int32

	if libc.PostDecUint64(&(*ClockClientData)(unsafe.Pointer(data)).FrefCount, 1) <= uint64(1) {
		for i = 0; i < LIT__END; i++ {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer((*ClockClientData)(unsafe.Pointer(data)).Fliterals + uintptr(i)*8))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		XTclpFree(tls, (*ClockClientData)(unsafe.Pointer(data)).Fliterals)
		XTclpFree(tls, data)
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.11 Localization	<locale.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>

// Any one of these symbols __need_* means that GNU libc
//    wants us just to define one data type.  So don't define
//    the symbols that indicate this file's entire job has been done.

// This avoids lossage on SunOS but only if stdtypes.h comes first.
//    There's no way to win with the other order!  Sun lossage.

// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
//    Just ignore it.

// On VxWorks, <type/vxTypesBase.h> may have defined macros like
//    _TYPE_size_t which will typedef size_t.  fixincludes patched the
//    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
//    not defined, and so that defining this macro defines _GCC_SIZE_T.
//    If we find that the macros are still defined at this point, we must
//    invoke them so that the type is defined as expected.

// In case nobody has defined these types, but we aren't running under
//    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
//    __WCHAR_TYPE__ have reasonable values.  This can happen if the
//    parts of GCC is compiled by an older compiler, that actually
//    include gstddef.h, such as collect2.

// Signed type of difference of two pointers.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// If this symbol has done its job, get rid of it.

// Unsigned type of `sizeof' something.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// Wide character type.
//    Locale-writers should change this as necessary to
//    be big enough to hold unique values not between 0 and 127,
//    and not (wchar_t) -1, for each defined multibyte character.

// Define this type if we are doing the whole job,
//    or if we want this type in particular.

// A null pointer constant.

// Offset of member MEMBER in a struct of type TYPE.

// Definition of locale category symbol values.
//    Copyright (C) 2001-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// These are the possibilities for the first argument to setlocale.
//    The code assumes that the lowest LC_* symbol has the value zero.

// Structure giving information about numeric and monetary notation.
type Lconv = struct {
	Fdecimal_point      uintptr
	Fthousands_sep      uintptr
	Fgrouping           uintptr
	Fint_curr_symbol    uintptr
	Fcurrency_symbol    uintptr
	Fmon_decimal_point  uintptr
	Fmon_thousands_sep  uintptr
	Fmon_grouping       uintptr
	Fpositive_sign      uintptr
	Fnegative_sign      uintptr
	Fint_frac_digits    int8
	Ffrac_digits        int8
	Fp_cs_precedes      int8
	Fp_sep_by_space     int8
	Fn_cs_precedes      int8
	Fn_sep_by_space     int8
	Fp_sign_posn        int8
	Fn_sign_posn        int8
	Fint_p_cs_precedes  int8
	Fint_p_sep_by_space int8
	Fint_n_cs_precedes  int8
	Fint_n_sep_by_space int8
	Fint_p_sign_posn    int8
	Fint_n_sign_posn    int8
	F__ccgo_pad1        [2]byte
} /* locale.h:51:1 */

// This value can be passed to `uselocale' and may be returned by it.
//    Passing this value to any other function has undefined behavior.

// The state structure used by [foreach]. Note that the actual structure has
// all its working arrays appended afterwards so they can be allocated and
// freed in a single step.

type ForeachState = struct {
	FbodyPtr    uintptr
	FbodyIdx    int32
	Fj          int32
	Fmaxj       int32
	FnumLists   int32
	Findex      uintptr
	FvarcList   uintptr
	FvarvList   uintptr
	FvCopyList  uintptr
	FargcList   uintptr
	FargvList   uintptr
	FaCopyList  uintptr
	FresultList uintptr
} /* tclCmdAH.c:26:1 */

//----------------------------------------------------------------------
//
// Tcl_BreakObjCmd --
//
//	This procedure is invoked to process the "break" Tcl command. See the
//	user documentation for details on what it does.
//
//	With the bytecode compiler, this procedure is only called when a
//	command name is computed at runtime, and is "break" or the name to
//	which "break" was renamed: e.g., "set z break; $z"
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_BreakObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:137:1: */
	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}
	return TCL_BREAK
}

//----------------------------------------------------------------------
//
// Tcl_CaseObjCmd --
//
//	This procedure is invoked to process the "case" Tcl command. See the
//	user documentation for details on what it does. THIS COMMAND IS
//	OBSOLETE AND DEPRECATED. SLATED FOR REMOVAL IN TCL 9.0.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_CaseObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:170:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var i int32
	var body int32
	var result int32
	// var caseObjc int32 at bp+24, 4

	var stringPtr uintptr
	var arg uintptr
	var caseObjv uintptr
	var armPtr uintptr
	// var newObjv uintptr at bp+16, 8

	// var patObjc int32 at bp+28, 4

	var j int32
	// var patObjv uintptr at bp+32, 8

	var pat uintptr
	var p uintptr

	if !(objc < 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+11429)
	return TCL_ERROR
__1:
	;

	stringPtr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	body = -1

	arg = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()
	if !(libc.Xstrcmp(tls, arg, ts+5755) == 0) {
		goto __2
	}
	i = 3
	goto __3
__2:
	i = 2
__3:
	;
	*(*int32)(unsafe.Pointer(bp + 24 /* caseObjc */)) = objc - i
	caseObjv = objv + uintptr(i)*8

	// If all of the pattern/command pairs are lumped into a single argument,
	// split them out again.

	if !(*(*int32)(unsafe.Pointer(bp + 24)) == 1) {
		goto __4
	}

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(caseObjv)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 16)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(caseObjv)) + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 24)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(caseObjv)) + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(caseObjv)), bp+24, bp+16)
	}
	caseObjv = *(*uintptr)(unsafe.Pointer(bp + 16 /* newObjv */))
__4:
	;

	i = 0
__5:
	if !(i < *(*int32)(unsafe.Pointer(bp + 24))) {
		goto __7
	}

	if !(i == *(*int32)(unsafe.Pointer(bp + 24))-1) {
		goto __8
	}
	XTcl_ResetResult(tls, interp)
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+11475, -1))
	return TCL_ERROR
__8:
	;

	// Check for special case of single pattern (no list) with no
	// backslash sequences.

	pat = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(caseObjv + uintptr(i)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(caseObjv + uintptr(i)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(caseObjv + uintptr(i)*8)))
	}()
	p = pat
__9:
	if !(int32(*(*int8)(unsafe.Pointer(p))) != 0) {
		goto __11
	}
	if !(func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
	}() != 0 || int32(*(*int8)(unsafe.Pointer(p))) == '\\') {
		goto __12
	}
	goto __11
__12:
	;
	goto __10
__10:
	p++
	goto __9
	goto __11
__11:
	;
	if !(int32(*(*int8)(unsafe.Pointer(p))) == 0) {
		goto __13
	}
	if !(int32(*(*int8)(unsafe.Pointer(pat))) == 'd' && libc.Xstrcmp(tls, pat, ts+11507) == 0) {
		goto __14
	}
	body = i + 1
__14:
	;
	if !(XTcl_StringMatch(tls, stringPtr, pat) != 0) {
		goto __15
	}
	body = i + 1
	goto match
__15:
	;
	goto __6
__13:
	;

	// Break up pattern lists, then check each of the patterns in the
	// list.

	result = XTcl_SplitList(tls, interp, pat, bp+28, bp+32)
	if !(result != TCL_OK) {
		goto __16
	}
	return result
__16:
	;
	j = 0
__17:
	if !(j < *(*int32)(unsafe.Pointer(bp + 28))) {
		goto __19
	}
	if !(XTcl_StringMatch(tls, stringPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(j)*8))) != 0) {
		goto __20
	}
	body = i + 1
	goto __19
__20:
	;
	goto __18
__18:
	j++
	goto __17
	goto __19
__19:
	;
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 32)))
	if !(j < *(*int32)(unsafe.Pointer(bp + 28))) {
		goto __21
	}
	goto __7
__21:
	;
	goto __6
__6:
	i = i + 2
	goto __5
	goto __7
__7:
	;

match:
	if !(body != -1) {
		goto __22
	}
	armPtr = *(*uintptr)(unsafe.Pointer(caseObjv + uintptr(body-1)*8))
	result = XTcl_EvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(caseObjv + uintptr(body)*8)), 0)
	if !(result == TCL_ERROR) {
		goto __23
	}
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+11515,
		libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(armPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(armPtr)).Fbytes
			}
			return XTcl_GetString(tls, armPtr)
		}(), XTcl_GetErrorLine(tls, interp))))
__23:
	;
	return result
__22:
	;

	// Nothing matched: return nothing.

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_CatchObjCmd --
//
//	This object-based procedure is invoked to process the "catch" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_CatchObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:305:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRCatchObjCmd})), dummy, objc, objv)
}

func XTclNRCatchObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:315:1: */
	var varNamePtr uintptr = uintptr(0)
	var optionVarNamePtr uintptr = uintptr(0)
	var iPtr uintptr = interp

	if objc < 2 || objc > 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv,
			ts+11542)
		return TCL_ERROR
	}

	if objc >= 3 {
		varNamePtr = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	}
	if objc == 4 {
		optionVarNamePtr = *(*uintptr)(unsafe.Pointer(objv + 3*8))
	}

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sCatchObjCmdCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(Intptr_t(objc))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = varNamePtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = optionVarNamePtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}

	// TIP #280. Make invoking context available to caught script.

	return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), 0, (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, 1)
}

func sCatchObjCmdCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdAH.c:349:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var iPtr uintptr = interp
	var objc int32 = int32(*(*ClientData)(unsafe.Pointer(data)))
	var varNamePtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))
	var optionVarNamePtr uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))
	var rewind int32 = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr)).Frewind

	// We disable catch in interpreters where the limit has been exceeded.

	if rewind != 0 || XTcl_LimitExceeded(tls, interp) != 0 {
		XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
			ts+11581, libc.VaList(bp, XTcl_GetErrorLine(tls, interp))))
		return TCL_ERROR
	}

	if objc >= 3 {
		if uintptr(0) == XTcl_ObjSetVar2(tls, interp, varNamePtr, uintptr(0),
			XTcl_GetObjResult(tls, interp), TCL_LEAVE_ERR_MSG) {
			return TCL_ERROR
		}
	}
	if objc == 4 {
		var options uintptr = XTcl_GetReturnOptions(tls, interp, result)

		if uintptr(0) == XTcl_ObjSetVar2(tls, interp, optionVarNamePtr, uintptr(0),
			options, TCL_LEAVE_ERR_MSG) {
			// Do not decrRefCount 'options', it was already done by
			// Tcl_ObjSetVar2
			return TCL_ERROR
		}
	}

	XTcl_ResetResult(tls, interp)
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, result))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_CdObjCmd --
//
//	This procedure is invoked to process the "cd" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_CdObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:411:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var dir uintptr
	var result int32

	if objc > 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11609)
		return TCL_ERROR
	}

	if objc == 2 {
		dir = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	} else {
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					dir = XTclThreadAllocObj(tls)
				} else {
					dir = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(dir + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(dir)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(dir)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes, ts+5674, uint64(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes + 1)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(dir)).Flength = int32(uint64(unsafe.Sizeof([2]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(dir)).FtypePtr = uintptr(0)
			{
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(dir)).FrefCount++
	}
	if XTcl_FSConvertToPathType(tls, interp, dir) != TCL_OK {
		result = TCL_ERROR
	} else {
		result = XTcl_FSChdir(tls, dir)
		if result != TCL_OK {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+11619,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes
					}
					return XTcl_GetString(tls, dir)
				}(), XTcl_PosixError(tls, interp))))
			result = TCL_ERROR
		}
	}
	if objc != 2 {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = dir
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_ConcatObjCmd --
//
//	This object-based procedure is invoked to process the "concat" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ConcatObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:467:1: */
	if objc >= 2 {
		XTcl_SetObjResult(tls, interp, XTcl_ConcatObj(tls, objc-1, objv+uintptr(1)*8))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ContinueObjCmd --
//
//	This procedure is invoked to process the "continue" Tcl command. See
//	the user documentation for details on what it does.
//
//	With the bytecode compiler, this procedure is only called when a
//	command name is computed at runtime, and is "continue" or the name to
//	which "continue" was renamed: e.g., "set z continue; $z"
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ContinueObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:502:1: */
	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}
	return TCL_CONTINUE
}

//-----------------------------------------------------------------------------
//
// TclInitEncodingCmd --
//
//	This function creates the 'encoding' ensemble.
//
// Results:
//	Returns the Tcl_Command so created.
//
// Side effects:
//	The ensemble is initialized.
//
// This command is hidden in a safe interpreter.

func XTclInitEncodingCmd(tls *libc.TLS, interp uintptr) Tcl_Command { /* tclCmdAH.c:532:1: */

	return XTclMakeEnsemble(tls, interp, ts+11665, uintptr(unsafe.Pointer(&encodingImplMap)))
}

var encodingImplMap = [6]EnsembleImplMap{
	{Fname: ts + 11674, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 11686, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 11696, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 11701, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 11707, Fproc: 0, FcompileProc: 0},
	{},
} /* tclCmdAH.c:535:34 */

//-----------------------------------------------------------------------------
//
// TclMakeEncodingCommandSafe --
//
//	This function hides the unsafe 'dirs' and 'system' subcommands of
//	the "encoding" Tcl command ensemble. It must be called only from
//	TclHideUnsafeCommands.
//
// Results:
//	A standard Tcl result
//
// Side effects:
//	Adds commands to the table of hidden commands.
//
//-----------------------------------------------------------------------------

func XTclMakeEncodingCommandSafe(tls *libc.TLS, interp uintptr) int32 { /* tclCmdAH.c:566:1: */
	bp := tls.Alloc(456)
	defer tls.Free(456)

	var i int32
	// var oldBuf Tcl_DString at bp+24, 216

	// var newBuf Tcl_DString at bp+240, 216

	XTcl_DStringInit(tls, bp+24)
	XTcl_DStringAppend(tls, bp+24, ts+11714, int32(uint64(unsafe.Sizeof([18]int8{}))-uint64(1)))
	XTcl_DStringInit(tls, bp+240)
	XTcl_DStringAppend(tls, bp+240, ts+11732, int32(uint64(unsafe.Sizeof([14]int8{}))-uint64(1)))
	for i = 0; unsafeInfo[i].FcmdName != uintptr(0); i++ {
		if unsafeInfo[i].Funsafe != 0 {
			var oldName uintptr
			var newName uintptr

			XTcl_DStringSetLength(tls, bp+24, 17)
			oldName = XTcl_DStringAppend(tls, bp+24, unsafeInfo[i].FcmdName, -1)
			XTcl_DStringSetLength(tls, bp+240, 13)
			newName = XTcl_DStringAppend(tls, bp+240, unsafeInfo[i].FcmdName, -1)
			if XTclRenameCommand(tls, interp, oldName, ts+11746) != TCL_OK ||
				XTcl_HideCommand(tls, interp, ts+11746, newName) != TCL_OK {
				XTcl_Panic(tls, ts+11753,
					libc.VaList(bp, unsafeInfo[i].FcmdName,
						XTcl_GetString(tls, XTcl_GetObjResult(tls, interp))))
			}
			XTcl_CreateObjCommand(tls, interp, oldName, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
			}{sBadEncodingSubcommand})),
				unsafeInfo[i].FcmdName, uintptr(0))
		}
	}
	XTcl_DStringFree(tls, bp+24)
	XTcl_DStringFree(tls, bp+240)

	// Ugh. The [encoding] command is now actually safe, but it is assumed by
	// scripts that it is not, which messes up security policies.

	if XTcl_HideCommand(tls, interp, ts+11665, ts+11665) != TCL_OK {
		XTcl_Panic(tls, ts+11791,
			libc.VaList(bp+16, XTcl_GetString(tls, XTcl_GetObjResult(tls, interp))))
	}
	return TCL_OK
}

var unsafeInfo = [6]struct {
	FcmdName     uintptr
	Funsafe      int32
	F__ccgo_pad1 [4]byte
}{
	{FcmdName: ts + 11674 /* "convertfrom" */},
	{FcmdName: ts + 11686 /* "convertto" */},
	{FcmdName: ts + 11696 /* "dirs" */, Funsafe: 1},
	{FcmdName: ts + 11701 /* "names" */},
	{FcmdName: ts + 11707 /* "system" */},
	{},
} /* tclCmdAH.c:572:7 */

//----------------------------------------------------------------------
//
// BadEncodingSubcommand --
//
//	Command used to act as a backstop implementation when subcommands of
//	"encoding" are unsafe (the real implementations of the subcommands are
//	hidden). The clientData is always the full official subcommand name.
//
// Results:
//	A standard Tcl result (always a TCL_ERROR).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sBadEncodingSubcommand(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:640:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var subcommandName uintptr = clientData

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+11826, libc.VaList(bp, subcommandName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+11874, ts+11879, uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// EncodingConvertfromObjCmd --
//
//	This command converts a byte array in an external encoding into a
//	Tcl string
//
// Results:
//	A standard Tcl result.
//
//----------------------------------------------------------------------

func XEncodingConvertfromObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:669:1: */
	bp := tls.Alloc(232)
	defer tls.Free(232)

	var data uintptr // Byte array to convert
	// var ds Tcl_DString at bp+16, 216
	// Buffer to hold the string
	// var encoding Tcl_Encoding at bp, 8
	// Encoding to use
	// var length int32 at bp+8, 4
	// Length of the byte array being converted
	var bytesPtr uintptr // Pointer to the first byte of the array

	if objc == 2 {
		*(*Tcl_Encoding)(unsafe.Pointer(bp /* encoding */)) = XTcl_GetEncoding(tls, interp, uintptr(0))
		data = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	} else if objc == 3 {
		if XTcl_GetEncodingFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK {
			return TCL_ERROR
		}
		data = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11890)
		return TCL_ERROR
	}

	// Convert the string into a byte array in 'ds'
	bytesPtr = XTcl_GetByteArrayFromObj(tls, data, bp+8)
	XTcl_ExternalToUtfDString(tls, *(*Tcl_Encoding)(unsafe.Pointer(bp /* encoding */)), bytesPtr, *(*int32)(unsafe.Pointer(bp + 8 /* length */)), bp+16)

	// Note that we cannot use Tcl_DStringResult here because it will
	// truncate the string at the first null byte.

	XTcl_SetObjResult(tls, interp, XTclDStringToObj(tls, bp+16))

	// We're done with the encoding

	XTcl_FreeEncoding(tls, *(*Tcl_Encoding)(unsafe.Pointer(bp /* encoding */)))
	return TCL_OK

}

//----------------------------------------------------------------------
//
// EncodingConverttoObjCmd --
//
//	This command converts a Tcl string into a byte array that
//	encodes the string according to some encoding.
//
// Results:
//	A standard Tcl result.
//
//----------------------------------------------------------------------

func XEncodingConverttoObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:731:1: */
	bp := tls.Alloc(232)
	defer tls.Free(232)

	var data uintptr // String to convert
	// var ds Tcl_DString at bp+16, 216
	// Buffer to hold the byte array
	// var encoding Tcl_Encoding at bp, 8
	// Encoding to use
	// var length int32 at bp+8, 4
	// Length of the string being converted
	var stringPtr uintptr // Pointer to the first byte of the string

	if objc == 2 {
		*(*Tcl_Encoding)(unsafe.Pointer(bp /* encoding */)) = XTcl_GetEncoding(tls, interp, uintptr(0))
		data = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	} else if objc == 3 {
		if XTcl_GetEncodingFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK {
			return TCL_ERROR
		}
		data = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11890)
		return TCL_ERROR
	}

	// Convert the string to a byte array in 'ds'

	stringPtr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(data)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 8)) = (*Tcl_Obj)(unsafe.Pointer(data)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(data)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, data, bp+8)
	}()
	XTcl_UtfToExternalDString(tls, *(*Tcl_Encoding)(unsafe.Pointer(bp /* encoding */)), stringPtr, *(*int32)(unsafe.Pointer(bp + 8 /* length */)), bp+16)
	XTcl_SetObjResult(tls, interp,
		XTcl_NewByteArrayObj(tls, (*Tcl_DString)(unsafe.Pointer(bp+16)).Fstring,
			(*Tcl_DString)(unsafe.Pointer(bp+16)).Flength))
	XTcl_DStringFree(tls, bp+16)

	// We're done with the encoding

	XTcl_FreeEncoding(tls, *(*Tcl_Encoding)(unsafe.Pointer(bp /* encoding */)))
	return TCL_OK

}

//----------------------------------------------------------------------
//
// EncodingDirsObjCmd --
//
//	This command manipulates the encoding search path.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Can set the encoding search path.
//
//----------------------------------------------------------------------

func XEncodingDirsObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:793:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var dirListObj uintptr

	if objc > 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11906)
		return TCL_ERROR
	}
	if objc == 1 {
		XTcl_SetObjResult(tls, interp, XTcl_GetEncodingSearchPath(tls))
		return TCL_OK
	}

	dirListObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if XTcl_SetEncodingSearchPath(tls, dirListObj) == TCL_ERROR {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+11916,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(dirListObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(dirListObj)).Fbytes
				}
				return XTcl_GetString(tls, dirListObj)
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7420, ts+11953, ts+11962,
			uintptr(0)))
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, dirListObj)
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// EncodingNamesObjCmd --
//
//	This command returns a list of the available encoding names
//
// Results:
//	Returns a standard Tcl result
//
//-----------------------------------------------------------------------------

func XEncodingNamesObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:837:1: */
	if objc > 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}
	XTcl_GetEncodingNames(tls, interp)
	return TCL_OK
}

//-----------------------------------------------------------------------------
//
// EncodingSystemObjCmd --
//
//	This command retrieves or changes the system encoding
//
// Results:
//	Returns a standard Tcl result
//
// Side effects:
//	May change the system encoding.
//
//-----------------------------------------------------------------------------

func XEncodingSystemObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:867:1: */
	if objc > 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11970)
		return TCL_ERROR
	}
	if objc == 1 {
		XTcl_SetObjResult(tls, interp,
			XTcl_NewStringObj(tls, XTcl_GetEncodingName(tls, uintptr(0)), -1))
	} else {
		return XTcl_SetSystemEncoding(tls, interp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}())
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ErrorObjCmd --
//
//	This procedure is invoked to process the "error" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ErrorObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:904:1: */
	var options uintptr
	var optName uintptr

	if objc < 2 || objc > 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11981)
		return TCL_ERROR
	}

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				options = XTclThreadAllocObj(tls)
			} else {
				options = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(options + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(options)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([21]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(options)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(options)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(options)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([21]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(options)).Fbytes, ts+12013, uint64(int32(uint64(unsafe.Sizeof([21]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(options)).Fbytes + 20)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(options)).Flength = int32(uint64(unsafe.Sizeof([21]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(options)).FtypePtr = uintptr(0)
		{
		}
	}

	if objc >= 3 { // Process the optional info argument
		for ok2 := true; ok2; ok2 = 0 != 0 {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					optName = XTclThreadAllocObj(tls)
				} else {
					optName = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(optName + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(optName)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(optName)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(optName)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(optName)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(optName)).Fbytes, ts+12034, uint64(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(optName)).Fbytes + 10)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(optName)).Flength = int32(uint64(unsafe.Sizeof([11]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(optName)).FtypePtr = uintptr(0)
			{
			}
		}
		XTcl_ListObjAppendElement(tls, uintptr(0), options, optName)
		XTcl_ListObjAppendElement(tls, uintptr(0), options, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}

	if objc >= 4 { // Process the optional code argument
		for ok4 := true; ok4; ok4 = 0 != 0 {
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					optName = XTclThreadAllocObj(tls)
				} else {
					optName = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(optName + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(optName)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(optName)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(optName)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(optName)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(optName)).Fbytes, ts+12045, uint64(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(optName)).Fbytes + 10)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(optName)).Flength = int32(uint64(unsafe.Sizeof([11]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(optName)).FtypePtr = uintptr(0)
			{
			}
		}
		XTcl_ListObjAppendElement(tls, uintptr(0), options, optName)
		XTcl_ListObjAppendElement(tls, uintptr(0), options, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}

	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	return XTcl_SetReturnOptions(tls, interp, options)
}

//----------------------------------------------------------------------
//
// Tcl_EvalObjCmd --
//
//	This object-based procedure is invoked to process the "eval" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sEvalCmdErrMsg(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdAH.c:954:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if result == TCL_ERROR {
		XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
			ts+12056, libc.VaList(bp, XTcl_GetErrorLine(tls, interp))))
	}
	return result
}

func XTcl_EvalObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:967:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNREvalObjCmd})), dummy, objc, objv)
}

func XTclNREvalObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:977:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var objPtr uintptr
	var iPtr uintptr = interp
	*(*uintptr)(unsafe.Pointer(bp /* invoker */)) = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 8 /* word */)) = 0

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12083)
		return TCL_ERROR
	}

	if objc == 2 {
		// TIP #280. Make argument location available to eval'd script.

		*(*uintptr)(unsafe.Pointer(bp /* invoker */)) = (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr
		*(*int32)(unsafe.Pointer(bp + 8 /* word */)) = 1
		objPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
		XTclArgumentGet(tls, interp, objPtr, bp, bp+8)
	} else {
		// More than one argument: concatenate them together with spaces
		// between, then evaluate the result. Tcl_EvalObjEx will delete the
		// object when it decrements its refcount after eval'ing it.
		//
		// TIP #280. Make invoking context available to eval'd script, done
		// with the default values.

		objPtr = XTcl_ConcatObj(tls, objc-1, objv+uintptr(1)*8)
	}
	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sEvalCmdErrMsg}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return XTclNREvalObjEx(tls, interp, objPtr, 0, *(*uintptr)(unsafe.Pointer(bp /* invoker */)), *(*int32)(unsafe.Pointer(bp + 8 /* word */)))
}

//----------------------------------------------------------------------
//
// Tcl_ExitObjCmd --
//
//	This procedure is invoked to process the "exit" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ExitObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1037:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var value int32 at bp, 4

	if objc != 1 && objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12097)
		return TCL_ERROR
	}

	if objc == 1 {
		*(*int32)(unsafe.Pointer(bp /* value */)) = 0
	} else if XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK {
		return TCL_ERROR
	}
	XTcl_Exit(tls, *(*int32)(unsafe.Pointer(bp /* value */)))
	//NOTREACHED
	return TCL_OK // Better not ever reach this!
}

//----------------------------------------------------------------------
//
// Tcl_ExprObjCmd --
//
//	This object-based procedure is invoked to process the "expr" Tcl
//	command. See the user documentation for details on what it does.
//
//	With the bytecode compiler, this procedure is called in two
//	circumstances: 1) to execute expr commands that are too complicated or
//	too unsafe to try compiling directly into an inline sequence of
//	instructions, and 2) to execute commands where the command name is
//	computed at runtime and is "expr" or the name to which "expr" was
//	renamed (e.g., "set z expr; $z 2+3")
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ExprObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1086:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRExprObjCmd})), dummy, objc, objv)
}

func XTclNRExprObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1096:1: */
	var resultPtr uintptr
	var objPtr uintptr

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12083)
		return TCL_ERROR
	}

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultPtr = XTclThreadAllocObj(tls)
		} else {
			resultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = uintptr(0)
	{
	}

	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
	if objc == 2 {
		objPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _callbackPtr uintptr
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok3 := true; ok3; ok3 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sExprCallback}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = resultPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	} else {
		objPtr = XTcl_ConcatObj(tls, objc-1, objv+uintptr(1)*8)
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _callbackPtr uintptr
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok6 := true; ok6; ok6 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sExprCallback}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = resultPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = objPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	}

	return XTcl_NRExprObj(tls, interp, objPtr, resultPtr)
}

func sExprCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdAH.c:1123:1: */
	var resultPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var objPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))

	if objPtr != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	if result == TCL_OK {
		XTcl_SetObjResult(tls, interp, resultPtr)
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = resultPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// TclInitFileCmd --
//
//	This function builds the "file" Tcl command ensemble. See the user
//	documentation for details on what that ensemble does.
//
//	PLEASE NOTE THAT THIS FAILS WITH FILENAMES AND PATHS WITH EMBEDDED
//	NULLS. With the object-based Tcl_FS APIs, the above NOTE may no longer
//	be true. In any case this assertion should be tested.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTclInitFileCmd(tls *libc.TLS, interp uintptr) Tcl_Command { /* tclCmdAH.c:1164:1: */
	return XTclMakeEnsemble(tls, interp, ts+12110, uintptr(unsafe.Pointer(&initMap)))
}

var initMap = [35]EnsembleImplMap{
	{Fname: ts + 12115, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12121, Fproc: 0},
	{Fname: ts + 12132, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12141, Fproc: 0},
	{Fname: ts + 7321, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12146, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12154, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12165, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12172, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12182, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12194, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5171, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12201, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12206, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12212, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12218, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12224, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12235, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12245, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12251, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12260, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12269, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5284, Fproc: 0},
	{Fname: ts + 12278, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12287, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12297, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5307, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12302, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 11707, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12307, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12312, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12321, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12326, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12334, Fproc: 0, FcompileProc: 0},
	{},
} /* tclCmdAH.c:1173:34 */

//----------------------------------------------------------------------
//
// TclMakeFileCommandSafe --
//
//	This function hides the unsafe subcommands of the "file" Tcl command
//	ensemble. It must only be called from TclHideUnsafeCommands.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Adds commands to the table of hidden commands.
//
//----------------------------------------------------------------------

func XTclMakeFileCommandSafe(tls *libc.TLS, interp uintptr) int32 { /* tclCmdAH.c:1231:1: */
	bp := tls.Alloc(456)
	defer tls.Free(456)

	var i int32
	// var oldBuf Tcl_DString at bp+24, 216

	// var newBuf Tcl_DString at bp+240, 216

	XTcl_DStringInit(tls, bp+24)
	XTcl_DStringAppend(tls, bp+24, ts+12343, int32(uint64(unsafe.Sizeof([14]int8{}))-uint64(1)))
	XTcl_DStringInit(tls, bp+240)
	XTcl_DStringAppend(tls, bp+240, ts+12357, int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1)))
	for i = 0; unsafeInfo1[i].FcmdName != uintptr(0); i++ {
		if unsafeInfo1[i].Funsafe != 0 {
			var oldName uintptr
			var newName uintptr

			XTcl_DStringSetLength(tls, bp+24, 13)
			oldName = XTcl_DStringAppend(tls, bp+24, unsafeInfo1[i].FcmdName, -1)
			XTcl_DStringSetLength(tls, bp+240, 9)
			newName = XTcl_DStringAppend(tls, bp+240, unsafeInfo1[i].FcmdName, -1)
			if XTclRenameCommand(tls, interp, oldName, ts+11746) != TCL_OK ||
				XTcl_HideCommand(tls, interp, ts+11746, newName) != TCL_OK {
				XTcl_Panic(tls, ts+12367,
					libc.VaList(bp, unsafeInfo1[i].FcmdName,
						XTcl_GetString(tls, XTcl_GetObjResult(tls, interp))))
			}
			XTcl_CreateObjCommand(tls, interp, oldName, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
			}{sBadFileSubcommand})),
				unsafeInfo1[i].FcmdName, uintptr(0))
		}
	}
	XTcl_DStringFree(tls, bp+24)
	XTcl_DStringFree(tls, bp+240)

	// Ugh. The [file] command is now actually safe, but it is assumed by
	// scripts that it is not, which messes up security policies. [Bug
	// 3211758]

	if XTcl_HideCommand(tls, interp, ts+12110, ts+12110) != TCL_OK {
		XTcl_Panic(tls, ts+12401,
			libc.VaList(bp+16, XTcl_GetString(tls, XTcl_GetObjResult(tls, interp))))
	}
	return TCL_OK
}

var unsafeInfo1 = [35]struct {
	FcmdName     uintptr
	Funsafe      int32
	F__ccgo_pad1 [4]byte
}{
	{FcmdName: ts + 12115 /* "atime" */, Funsafe: 1},
	{FcmdName: ts + 12121 /* "attributes" */, Funsafe: 1},
	{FcmdName: ts + 12132 /* "channels" */},
	{FcmdName: ts + 12141 /* "copy" */, Funsafe: 1},
	{FcmdName: ts + 7321 /* "delete" */, Funsafe: 1},
	{FcmdName: ts + 12146 /* "dirname" */, Funsafe: 1},
	{FcmdName: ts + 12154 /* "executable" */, Funsafe: 1},
	{FcmdName: ts + 12165 /* "exists" */, Funsafe: 1},
	{FcmdName: ts + 12172 /* "extension" */, Funsafe: 1},
	{FcmdName: ts + 12182 /* "isdirectory" */, Funsafe: 1},
	{FcmdName: ts + 12194 /* "isfile" */, Funsafe: 1},
	{FcmdName: ts + 5171 /* "join" */},
	{FcmdName: ts + 12201 /* "link" */, Funsafe: 1},
	{FcmdName: ts + 12206 /* "lstat" */, Funsafe: 1},
	{FcmdName: ts + 12212 /* "mtime" */, Funsafe: 1},
	{FcmdName: ts + 12218 /* "mkdir" */, Funsafe: 1},
	{FcmdName: ts + 12224 /* "nativename" */, Funsafe: 1},
	{FcmdName: ts + 12235 /* "normalize" */, Funsafe: 1},
	{FcmdName: ts + 12245 /* "owned" */, Funsafe: 1},
	{FcmdName: ts + 12251 /* "pathtype" */},
	{FcmdName: ts + 12260 /* "readable" */, Funsafe: 1},
	{FcmdName: ts + 12269 /* "readlink" */, Funsafe: 1},
	{FcmdName: ts + 5284 /* "rename" */, Funsafe: 1},
	{FcmdName: ts + 12278 /* "rootname" */, Funsafe: 1},
	{FcmdName: ts + 12287 /* "separator" */},
	{FcmdName: ts + 12297 /* "size" */, Funsafe: 1},
	{FcmdName: ts + 5307 /* "split" */},
	{FcmdName: ts + 12302 /* "stat" */, Funsafe: 1},
	{FcmdName: ts + 11707 /* "system" */},
	{FcmdName: ts + 12307 /* "tail" */, Funsafe: 1},
	{FcmdName: ts + 12312 /* "tempfile" */, Funsafe: 1},
	{FcmdName: ts + 12321 /* "type" */, Funsafe: 1},
	{FcmdName: ts + 12326 /* "volumes" */, Funsafe: 1},
	{FcmdName: ts + 12334 /* "writable" */, Funsafe: 1},
	{},
} /* tclCmdAH.c:1237:7 */

//----------------------------------------------------------------------
//
// BadFileSubcommand --
//
//	Command used to act as a backstop implementation when subcommands of
//	"file" are unsafe (the real implementations of the subcommands are
//	hidden). The clientData is always the full official subcommand name.
//
// Results:
//	A standard Tcl result (always a TCL_ERROR).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sBadFileSubcommand(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1334:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var subcommandName uintptr = clientData

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+12432, libc.VaList(bp, subcommandName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+11874, ts+11879, uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// FileAttrAccessTimeCmd --
//
//	This function is invoked to process the "file atime" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May update the access time on the file, if requested by the user.
//
//----------------------------------------------------------------------

func sFileAttrAccessTimeCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1366:1: */
	bp := tls.Alloc(184)
	defer tls.Free(184)

	// var buf Tcl_StatBuf at bp+16, 144

	// var tval Utimbuf at bp+168, 16

	if objc < 2 || objc > 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12476)
		return TCL_ERROR
	}
	if sGetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{XTcl_FSStat})), bp+16) != TCL_OK {
		return TCL_ERROR
	}

	if objc == 3 {
		// var newTime Tcl_WideInt at bp+160, 8

		if XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+160) != TCL_OK {
			return TCL_ERROR
		}

		(*Utimbuf)(unsafe.Pointer(bp + 168 /* &tval */)).Factime = *(*Tcl_WideInt)(unsafe.Pointer(bp + 160 /* newTime */))
		(*Utimbuf)(unsafe.Pointer(bp + 168 /* &tval */)).Fmodtime = XTcl_GetModificationTimeFromStat(tls, bp+16)

		if XTcl_FSUtime(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+168) != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+12488,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
				}(), XTcl_PosixError(tls, interp))))
			return TCL_ERROR
		}

		// Do another stat to ensure that the we return the new recognized
		// atime - hopefully the same as the one we sent in. However, fs's
		// like FAT don't even know what atime is.

		if sGetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr) int32
		}{XTcl_FSStat})), bp+16) != TCL_OK {
			return TCL_ERROR
		}
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, XTcl_GetAccessTimeFromStat(tls, bp+16)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// FileAttrModifyTimeCmd --
//
//	This function is invoked to process the "file mtime" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May update the modification time on the file, if requested by the
//	user.
//
//----------------------------------------------------------------------

func sFileAttrModifyTimeCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1443:1: */
	bp := tls.Alloc(184)
	defer tls.Free(184)

	// var buf Tcl_StatBuf at bp+16, 144

	// var tval Utimbuf at bp+168, 16

	if objc < 2 || objc > 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12476)
		return TCL_ERROR
	}
	if sGetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{XTcl_FSStat})), bp+16) != TCL_OK {
		return TCL_ERROR
	}
	if objc == 3 {
		// Need separate variable for reading longs from an object on 64-bit
		// platforms. [Bug 698146]

		// var newTime Tcl_WideInt at bp+160, 8

		if XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+160) != TCL_OK {
			return TCL_ERROR
		}

		(*Utimbuf)(unsafe.Pointer(bp + 168 /* &tval */)).Factime = XTcl_GetAccessTimeFromStat(tls, bp+16)
		(*Utimbuf)(unsafe.Pointer(bp + 168 /* &tval */)).Fmodtime = *(*Tcl_WideInt)(unsafe.Pointer(bp + 160 /* newTime */))

		if XTcl_FSUtime(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+168) != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+12532,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
				}(), XTcl_PosixError(tls, interp))))
			return TCL_ERROR
		}

		// Do another stat to ensure that the we return the new recognized
		// mtime - hopefully the same as the one we sent in.

		if sGetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr) int32
		}{XTcl_FSStat})), bp+16) != TCL_OK {
			return TCL_ERROR
		}
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, XTcl_GetModificationTimeFromStat(tls, bp+16)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// FileAttrLinkStatCmd --
//
//	This function is invoked to process the "file lstat" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Writes to an array named by the user.
//
//----------------------------------------------------------------------

func sFileAttrLinkStatCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1522:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	// var buf Tcl_StatBuf at bp, 144

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12582)
		return TCL_ERROR
	}
	if sGetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{XTcl_FSLstat})), bp) != TCL_OK {
		return TCL_ERROR
	}
	return sStoreStatData(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp)
}

//----------------------------------------------------------------------
//
// FileAttrStatCmd --
//
//	This function is invoked to process the "file stat" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Writes to an array named by the user.
//
//----------------------------------------------------------------------

func sFileAttrStatCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1558:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	// var buf Tcl_StatBuf at bp, 144

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12582)
		return TCL_ERROR
	}
	if sGetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{XTcl_FSStat})), bp) != TCL_OK {
		return TCL_ERROR
	}
	return sStoreStatData(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp)
}

//----------------------------------------------------------------------
//
// FileAttrTypeCmd --
//
//	This function is invoked to process the "file type" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFileAttrTypeCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1594:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	// var buf Tcl_StatBuf at bp, 144

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	if sGetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{XTcl_FSLstat})), bp) != TCL_OK {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		sGetTypeFromMode(tls, int32(uint16((*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_mode))), -1))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// FileAttrSizeCmd --
//
//	This function is invoked to process the "file size" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFileAttrSizeCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1632:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	// var buf Tcl_StatBuf at bp, 144

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	if sGetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{XTcl_FSStat})), bp) != TCL_OK {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, (*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_size))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// FileAttrIsDirectoryCmd --
//
//	This function is invoked to process the "file isdirectory" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFileAttrIsDirectoryCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1669:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	// var buf Tcl_StatBuf at bp, 144

	var value int32 = 0

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	if sGetStatBuf(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{XTcl_FSStat})), bp) == TCL_OK {
		value = libc.Bool32((*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000))
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(value != 0)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// FileAttrIsExecutableCmd --
//
//	This function is invoked to process the "file executable" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFileAttrIsExecutableCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1707:1: */
	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	return sCheckAccess(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), X_OK)
}

//----------------------------------------------------------------------
//
// FileAttrIsExistingCmd --
//
//	This function is invoked to process the "file exists" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFileAttrIsExistingCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1738:1: */
	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	return sCheckAccess(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), F_OK)
}

//----------------------------------------------------------------------
//
// FileAttrIsFileCmd --
//
//	This function is invoked to process the "file isfile" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFileAttrIsFileCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1769:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	// var buf Tcl_StatBuf at bp, 144

	var value int32 = 0

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	if sGetStatBuf(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{XTcl_FSStat})), bp) == TCL_OK {
		value = libc.Bool32((*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0100000))
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(value != 0)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// FileAttrIsOwnedCmd --
//
//	This function is invoked to process the "file owned" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFileAttrIsOwnedCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1807:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	// var buf Tcl_StatBuf at bp, 144

	var value int32 = 0

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	if sGetStatBuf(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{XTcl_FSStat})), bp) == TCL_OK {
		value = libc.Bool32(libc.Xgeteuid(tls) == (*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_uid)
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(value != 0)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// FileAttrIsReadableCmd --
//
//	This function is invoked to process the "file readable" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFileAttrIsReadableCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1854:1: */
	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	return sCheckAccess(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), R_OK)
}

//----------------------------------------------------------------------
//
// FileAttrIsWritableCmd --
//
//	This function is invoked to process the "file writable" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFileAttrIsWritableCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1885:1: */
	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	return sCheckAccess(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), W_OK)
}

//----------------------------------------------------------------------
//
// PathDirNameCmd --
//
//	This function is invoked to process the "file dirname" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPathDirNameCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1916:1: */
	var dirPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	dirPtr = XTclPathPart(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), TCL_PATH_DIRNAME)
	if dirPtr == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, dirPtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = dirPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// PathExtensionCmd --
//
//	This function is invoked to process the "file extension" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPathExtensionCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1955:1: */
	var dirPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	dirPtr = XTclPathPart(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), TCL_PATH_EXTENSION)
	if dirPtr == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, dirPtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = dirPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// PathRootNameCmd --
//
//	This function is invoked to process the "file root" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPathRootNameCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:1994:1: */
	var dirPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	dirPtr = XTclPathPart(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), TCL_PATH_ROOT)
	if dirPtr == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, dirPtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = dirPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// PathTailCmd --
//
//	This function is invoked to process the "file tail" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPathTailCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2033:1: */
	var dirPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	dirPtr = XTclPathPart(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), TCL_PATH_TAIL)
	if dirPtr == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, dirPtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = dirPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// PathFilesystemCmd --
//
//	This function is invoked to process the "file system" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPathFilesystemCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2072:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var fsInfo uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	fsInfo = XTcl_FSFileSystemInfo(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if fsInfo == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+12595, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7170, ts+12613,
			XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0)))
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, fsInfo)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// PathJoinCmd --
//
//	This function is invoked to process the "file join" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPathJoinCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2113:1: */
	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12624)
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTclJoinPath(tls, objc-1, objv+uintptr(1)*8, 0))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// PathNativeNameCmd --
//
//	This function is invoked to process the "file nativename" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPathNativeNameCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2145:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	// var ds Tcl_DString at bp, 216

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	if XTcl_TranslateFileName(tls, interp, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}(), bp) == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTclDStringToObj(tls, bp))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// PathNormalizeCmd --
//
//	This function is invoked to process the "file normalize" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPathNormalizeCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2182:1: */
	var fileName uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	fileName = XTcl_FSGetNormalizedPath(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if fileName == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, fileName)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// PathSplitCmd --
//
//	This function is invoked to process the "file split" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPathSplitCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2220:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var res uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	res = XTcl_FSSplitPath(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0))
	if res == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+12640,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7420, ts+12687, ts+12697,
			uintptr(0)))
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, res)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// PathTypeCmd --
//
//	This function is invoked to process the "file pathtype" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPathTypeCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2263:1: */
	var typeName uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	switch XTcl_FSGetPathType(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) {
	case TCL_PATH_ABSOLUTE:
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					typeName = XTclThreadAllocObj(tls)
				} else {
					typeName = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(typeName + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(typeName)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes, ts+12706, uint64(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes + 8)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Flength = int32(uint64(unsafe.Sizeof([9]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(typeName)).FtypePtr = uintptr(0)
			{
			}
		}
		break
	case TCL_PATH_RELATIVE:
		for ok2 := true; ok2; ok2 = 0 != 0 {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					typeName = XTclThreadAllocObj(tls)
				} else {
					typeName = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(typeName + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(typeName)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes, ts+12715, uint64(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes + 8)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Flength = int32(uint64(unsafe.Sizeof([9]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(typeName)).FtypePtr = uintptr(0)
			{
			}
		}
		break
	case TCL_PATH_VOLUME_RELATIVE:
		for ok4 := true; ok4; ok4 = 0 != 0 {
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					typeName = XTclThreadAllocObj(tls)
				} else {
					typeName = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(typeName + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(typeName)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes, ts+12724, uint64(int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(typeName)).Fbytes + 14)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(typeName)).Flength = int32(uint64(unsafe.Sizeof([15]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(typeName)).FtypePtr = uintptr(0)
			{
			}
		}
		break
	default:
		// Should be unreachable
		return TCL_OK
	}
	XTcl_SetObjResult(tls, interp, typeName)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// FilesystemSeparatorCmd --
//
//	This function is invoked to process the "file separator" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFilesystemSeparatorCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2311:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	if objc < 1 || objc > 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12739)
		return TCL_ERROR
	}
	if objc == 1 {
		var separator uintptr = uintptr(0) // lint

		switch XtclPlatform {
		case TCL_PLATFORM_UNIX:
			separator = ts + 5792 /* "/" */
			break
			fallthrough
		case TCL_PLATFORM_WINDOWS:
			separator = ts + 12746 /* "\\" */
			break
		}
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, separator, 1))
	} else {
		var separatorObj uintptr = XTcl_FSPathSeparator(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))

		if separatorObj == uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+12595, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7170, ts+12613,
				XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0)))
			return TCL_ERROR
		}
		XTcl_SetObjResult(tls, interp, separatorObj)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// FilesystemVolumesCmd --
//
//	This function is invoked to process the "file volumes" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFilesystemVolumesCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2366:1: */
	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTcl_FSListVolumes(tls))
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// CheckAccess --
//
//	Utility procedure used by Tcl_FileObjCmd() to query file attributes
//	available through the access() system call.
//
// Results:
//	Always returns TCL_OK. Sets interp's result to boolean true or false
//	depending on whether the file has the specified attribute.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sCheckAccess(tls *libc.TLS, interp uintptr, pathPtr uintptr, mode int32) int32 { /* tclCmdAH.c:2399:1: */
	var value int32

	if XTcl_FSConvertToPathType(tls, interp, pathPtr) != TCL_OK {
		value = 0
	} else {
		value = libc.Bool32(XTcl_FSAccess(tls, pathPtr, mode) == 0)
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(value != 0)))

	return TCL_OK
}

//---------------------------------------------------------------------------
//
// GetStatBuf --
//
//	Utility procedure used by Tcl_FileObjCmd() to query file attributes
//	available through the stat() or lstat() system call.
//
// Results:
//	The return value is TCL_OK if the specified file exists and can be
//	stat'ed, TCL_ERROR otherwise. If TCL_ERROR is returned, an error
//	message is left in interp's result. If TCL_OK is returned, *statPtr is
//	filled with information about the specified file.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sGetStatBuf(tls *libc.TLS, interp uintptr, pathPtr uintptr, statProc uintptr, statPtr uintptr) int32 { /* tclCmdAH.c:2439:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var status int32

	if XTcl_FSConvertToPathType(tls, interp, pathPtr) != TCL_OK {
		return TCL_ERROR
	}

	status = (*struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{statProc})).f(tls, pathPtr, statPtr)

	if status < 0 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+12748,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
					}
					return XTcl_GetString(tls, pathPtr)
				}(), XTcl_PosixError(tls, interp))))
		}
		return TCL_ERROR
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StoreStatData --
//
//	This is a utility procedure that breaks out the fields of a "stat"
//	structure and stores them in textual form into the elements of an
//	associative array.
//
// Results:
//	Returns a standard Tcl return value. If an error occurs then a message
//	is left in interp's result.
//
// Side effects:
//	Elements of the associative array given by "varName" are modified.
//
//----------------------------------------------------------------------

func sStoreStatData(tls *libc.TLS, interp uintptr, varName uintptr, statPtr uintptr) int32 { /* tclCmdAH.c:2486:1: */
	var field uintptr
	var value uintptr
	var mode uint16

	// Assume Tcl_ObjSetVar2() does not keep a copy of the field name!
	//
	// Might be a better idea to call Tcl_SetVar2Ex() instead, except we want
	// to have an object (i.e. possibly cached) array variable name but a
	// string element name, so no API exists. Messy.

	// Watch out porters; the inode is meant to be an *unsigned* value, so the
	// cast might fail when there isn't a real arithmetic 'long long' type...

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12772, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 3)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewLongObj(tls, int64((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_dev))
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	for ok4 := true; ok4; ok4 = 0 != 0 {
		for ok5 := true; ok5; ok5 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12776, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 3)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewWideIntObj(tls, Tcl_WideInt((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_ino))
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok6 := true; ok6; ok6 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	for ok8 := true; ok8; ok8 = 0 != 0 {
		for ok9 := true; ok9; ok9 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12780, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 5)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewLongObj(tls, int64((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_nlink))
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok10 := true; ok10; ok10 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	for ok12 := true; ok12; ok12 = 0 != 0 {
		for ok13 := true; ok13; ok13 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12786, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 3)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewLongObj(tls, int64((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_uid))
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok14 := true; ok14; ok14 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok15 := true; ok15; ok15 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	for ok16 := true; ok16; ok16 = 0 != 0 {
		for ok17 := true; ok17; ok17 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12790, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 3)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewLongObj(tls, int64((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_gid))
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok18 := true; ok18; ok18 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok19 := true; ok19; ok19 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	for ok20 := true; ok20; ok20 = 0 != 0 {
		for ok21 := true; ok21; ok21 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12297, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 4)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewWideIntObj(tls, (*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_size)
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok22 := true; ok22; ok22 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok23 := true; ok23; ok23 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	for ok24 := true; ok24; ok24 = 0 != 0 {
		for ok25 := true; ok25; ok25 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12794, uint64(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 6)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([7]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewWideIntObj(tls, (*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_blocks)
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok26 := true; ok26; ok26 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok27 := true; ok27; ok27 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	for ok28 := true; ok28; ok28 = 0 != 0 {
		for ok29 := true; ok29; ok29 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12801, uint64(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 7)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([8]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewLongObj(tls, (*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_blksize)
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok30 := true; ok30; ok30 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok31 := true; ok31; ok31 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	for ok32 := true; ok32; ok32 = 0 != 0 {
		for ok33 := true; ok33; ok33 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12115, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 5)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewWideIntObj(tls, XTcl_GetAccessTimeFromStat(tls, statPtr))
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok34 := true; ok34; ok34 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok35 := true; ok35; ok35 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	for ok36 := true; ok36; ok36 = 0 != 0 {
		for ok37 := true; ok37; ok37 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12212, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 5)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewWideIntObj(tls, XTcl_GetModificationTimeFromStat(tls, statPtr))
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok38 := true; ok38; ok38 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok39 := true; ok39; ok39 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	for ok40 := true; ok40; ok40 = 0 != 0 {
		for ok41 := true; ok41; ok41 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12809, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 5)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewWideIntObj(tls, XTcl_GetChangeTimeFromStat(tls, statPtr))
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok42 := true; ok42; ok42 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok43 := true; ok43; ok43 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	mode = uint16((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_mode)
	for ok44 := true; ok44; ok44 = 0 != 0 {
		for ok45 := true; ok45; ok45 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12815, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 4)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewIntObj(tls, int32(mode))
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok46 := true; ok46; ok46 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok47 := true; ok47; ok47 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	for ok48 := true; ok48; ok48 = 0 != 0 {
		for ok49 := true; ok49; ok49 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				field = XTclThreadAllocObj(tls)
			} else {
				field = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(field + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes, ts+12321, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).Fbytes + 4)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount++
	value = XTcl_NewStringObj(tls, sGetTypeFromMode(tls, int32(mode)), -1)
	if XTcl_ObjSetVar2(tls, interp, varName, field, value, TCL_LEAVE_ERR_MSG) == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
				for ok50 := true; ok50; ok50 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, field)
					} else {
						*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, field)
			}
		}
		return TCL_ERROR
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(field)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(field)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(field)).Flength = -1
			for ok51 := true; ok51; ok51 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, field)
				} else {
					*(*uintptr)(unsafe.Pointer(field + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = field
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, field)
		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// GetTypeFromMode --
//
//	Given a mode word, returns a string identifying the type of a file.
//
// Results:
//	A static text string giving the file type from mode.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sGetTypeFromMode(tls *libc.TLS, mode int32) uintptr { /* tclCmdAH.c:2558:19: */
	if mode&0170000 == 0100000 {
		return ts + 12110 /* "file" */
	} else if mode&0170000 == 0040000 {
		return ts + 12820 /* "directory" */
	} else if mode&0170000 == 0020000 {
		return ts + 12830 /* "characterSpecial" */
	} else if mode&0170000 == 0060000 {
		return ts + 12847 /* "blockSpecial" */
	} else if mode&0170000 == 0010000 {
		return ts + 12860 /* "fifo" */
	} else if mode&0170000 == 0120000 {
		return ts + 12201 /* "link" */
	} else if mode&0170000 == 0140000 {
		return ts + 5482 /* "socket" */
	}
	return ts + 12865 /* "unknown" */
}

//----------------------------------------------------------------------
//
// Tcl_ForObjCmd --
//
//	This procedure is invoked to process the "for" Tcl command. See the
//	user documentation for details on what it does.
//
//	With the bytecode compiler, this procedure is only called when a
//	command name is computed at runtime, and is "for" or the name to which
//	"for" was renamed: e.g.,
//	"set z for; $z {set i 0} {$i<100} {incr i} {puts $i}"
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
// Notes:
//	This command is split into a lot of pieces so that it can avoid doing
//	reentrant TEBC calls. This makes things rather hard to follow, but
//	here's the plan:
//
//	NR:	---------------_ *	Direct:	Tcl_ForObjCmd -> TclNRForObjCmd
//					|
//				ForSetupCallback
//					|
//	[while] ------------> TclNRForIterCallback <---------.
//					|		     |
//				 ForCondCallback	     |
//					|		     |
//				 ForNextCallback ------------|
//					|		     |
//			       ForPostNextCallback	     |
//					|____________________|
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ForObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2627:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRForObjCmd})), dummy, objc, objv)
}

func XTclNRForObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2637:1: */
	var iPtr uintptr = interp
	var iterPtr uintptr

	if objc != 5 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12873)
		return TCL_ERROR
	}

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr
		{
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if interp == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				_objPtr = XTclThreadAllocObj(tls)
			} else {
				_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		iterPtr = _objPtr
	}
	(*ForIterData)(unsafe.Pointer(iterPtr)).Fcond = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	(*ForIterData)(unsafe.Pointer(iterPtr)).Fbody = *(*uintptr)(unsafe.Pointer(objv + 4*8))
	(*ForIterData)(unsafe.Pointer(iterPtr)).Fnext = *(*uintptr)(unsafe.Pointer(objv + 3*8))
	(*ForIterData)(unsafe.Pointer(iterPtr)).Fmsg = ts + 12897 /* "\n    (\"for\" body..." */
	(*ForIterData)(unsafe.Pointer(iterPtr)).Fword = 4

	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _callbackPtr uintptr
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sForSetupCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = iterPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}

	// TIP #280. Make invoking context available to initial script.

	return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), 0, (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, 1)
}

func sForSetupCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdAH.c:2668:1: */
	var iterPtr uintptr = *(*ClientData)(unsafe.Pointer(data))

	if result != TCL_OK {
		if result == TCL_ERROR {
			XTcl_AddErrorInfo(tls, interp, ts+12923)
		}
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, iterPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(iterPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = iterPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		}
		return result
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _callbackPtr uintptr
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{XTclNRForIterCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = iterPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return TCL_OK
}

func XTclNRForIterCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdAH.c:2687:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var iterPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var boolObj uintptr

	switch result {
	case TCL_OK:
		fallthrough
	case TCL_CONTINUE:
		// We need to reset the result before evaluating the expression.
		// Otherwise, any error message will be appended to the result of the
		// last evaluation.

		XTcl_ResetResult(tls, interp)
		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				boolObj = XTclThreadAllocObj(tls)
			} else {
				boolObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(boolObj + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(boolObj)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr = uintptr(0)
		{
		}

		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _callbackPtr uintptr
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok3 := true; ok3; ok3 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sForCondCallback}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = iterPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = boolObj
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
		return XTcl_NRExprObj(tls, interp, (*ForIterData)(unsafe.Pointer(iterPtr)).Fcond, boolObj)
	case TCL_BREAK:
		result = TCL_OK
		XTcl_ResetResult(tls, interp)
		break
	case TCL_ERROR:
		XTcl_AppendObjToErrorInfo(tls, interp,
			XTcl_ObjPrintf(tls, (*ForIterData)(unsafe.Pointer(iterPtr)).Fmsg, libc.VaList(bp, XTcl_GetErrorLine(tls, interp))))
	}
	for ok4 := true; ok4; ok4 = 0 != 0 {
		for ok5 := true; ok5; ok5 = 0 != 0 {
			var cachePtr uintptr
			if interp == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
			}() {
				XTclThreadFreeObj(tls, iterPtr)
			} else {
				*(*uintptr)(unsafe.Pointer(iterPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = iterPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
			}
		}
	}
	return result
}

func sForCondCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdAH.c:2722:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp
	var iterPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var boolObj uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))
	// var value int32 at bp, 4

	if result != TCL_OK {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = boolObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, iterPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(iterPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = iterPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		}
		return result
	} else if XTcl_GetBooleanFromObj(tls, interp, boolObj, bp) != TCL_OK {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = boolObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok4 := true; ok4; ok4 = 0 != 0 {
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, iterPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(iterPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = iterPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		}
		return TCL_ERROR
	}
	for ok6 := true; ok6; ok6 = 0 != 0 {
		var _objPtr uintptr = boolObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	if *(*int32)(unsafe.Pointer(bp)) != 0 {
		// TIP #280.
		if (*ForIterData)(unsafe.Pointer(iterPtr)).Fnext != 0 {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _callbackPtr uintptr
				for ok8 := true; ok8; ok8 = 0 != 0 {
					var _objPtr uintptr
					{
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						var cachePtr uintptr
						if interp == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							_objPtr = XTclThreadAllocObj(tls)
						} else {
							_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					_callbackPtr = _objPtr
				}
				(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, uintptr, uintptr, int32) int32
				}{sForNextCallback}))
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = iterPtr
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
				(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
				(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
			}
		} else {
			for ok10 := true; ok10; ok10 = 0 != 0 {
				var _callbackPtr uintptr
				for ok11 := true; ok11; ok11 = 0 != 0 {
					var _objPtr uintptr
					{
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var cachePtr uintptr
						if interp == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							_objPtr = XTclThreadAllocObj(tls)
						} else {
							_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					_callbackPtr = _objPtr
				}
				(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, uintptr, uintptr, int32) int32
				}{XTclNRForIterCallback}))
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = iterPtr
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
				(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
				(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
			}
		}
		return XTclNREvalObjEx(tls, interp, (*ForIterData)(unsafe.Pointer(iterPtr)).Fbody, 0, (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr,
			(*ForIterData)(unsafe.Pointer(iterPtr)).Fword)
	}
	for ok13 := true; ok13; ok13 = 0 != 0 {
		for ok14 := true; ok14; ok14 = 0 != 0 {
			var cachePtr uintptr
			if interp == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
			}() {
				XTclThreadFreeObj(tls, iterPtr)
			} else {
				*(*uintptr)(unsafe.Pointer(iterPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = iterPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
			}
		}
	}
	return result
}

func sForNextCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdAH.c:2760:1: */
	var iPtr uintptr = interp
	var iterPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var next uintptr = (*ForIterData)(unsafe.Pointer(iterPtr)).Fnext

	if result == TCL_OK || result == TCL_CONTINUE {
		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sForPostNextCallback}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = iterPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}

		// TIP #280. Make invoking context available to next script.

		return XTclNREvalObjEx(tls, interp, next, 0, (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, 3)
	}

	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _callbackPtr uintptr
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{XTclNRForIterCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = iterPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return result
}

func sForPostNextCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdAH.c:2785:1: */
	var iterPtr uintptr = *(*ClientData)(unsafe.Pointer(data))

	if result != TCL_BREAK && result != TCL_OK {
		if result == TCL_ERROR {
			XTcl_AddErrorInfo(tls, interp, ts+12952)
			for ok := true; ok; ok = 0 != 0 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, iterPtr)
					} else {
						*(*uintptr)(unsafe.Pointer(iterPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = iterPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			}
		}
		return result
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _callbackPtr uintptr
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{XTclNRForIterCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = iterPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_ForeachObjCmd, TclNRForeachCmd, EachloopCmd --
//
//	This object-based procedure is invoked to process the "foreach" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ForeachObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2822:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRForeachCmd})), dummy, objc, objv)
}

func XTclNRForeachCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2832:1: */
	return sEachloopCmd(tls, interp, TCL_EACH_KEEP_NONE, objc, objv)
}

func XTcl_LmapObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2842:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRLmapCmd})), dummy, objc, objv)
}

func XTclNRLmapCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2852:1: */
	return sEachloopCmd(tls, interp, TCL_EACH_COLLECT, objc, objv)
}

func sEachloopCmd(tls *libc.TLS, interp uintptr, collect int32, objc int32, objv uintptr) int32 { /* tclCmdAH.c:2862:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var numLists int32
	var statePtr uintptr
	var i int32
	var j int32
	var result int32
	var cachePtr uintptr
	var _objPtr uintptr
	var _callbackPtr uintptr
	numLists = (objc - 2) / 2

	if !(objc < 4 || objc%2 != 0) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+12982)
	return TCL_ERROR
__1:
	;

	// Manage numList parallel value lists.
	// statePtr->argvList[i] is a value list counted by statePtr->argcList[i];
	// statePtr->varvList[i] is the list of variables associated with the
	//		value list;
	// statePtr->varcList[i] is the number of variables associated with the
	//		value list;
	// statePtr->index[i] is the current pointer into the value list
	//		statePtr->argvList[i].
	//
	// The setting up of all of these pointers is moderately messy, but allows
	// the rest of this code to be simple and for us to use a single memory
	// allocation for better performance.

	statePtr = XTclStackAlloc(tls, interp,
		int32(uint64(unsafe.Sizeof(ForeachState{}))+uint64(3*numLists)*uint64(unsafe.Sizeof(int32(0)))+
			uint64(2*numLists)*(uint64(unsafe.Sizeof(uintptr(0)))+uint64(unsafe.Sizeof(uintptr(0))))))
	libc.Xmemset(tls, statePtr, 0,
		uint64(unsafe.Sizeof(ForeachState{}))+uint64(3*numLists)*uint64(unsafe.Sizeof(int32(0)))+
			uint64(2*numLists)*(uint64(unsafe.Sizeof(uintptr(0)))+uint64(unsafe.Sizeof(uintptr(0)))))
	(*ForeachState)(unsafe.Pointer(statePtr)).FvarvList = statePtr + uintptr(1)*88
	(*ForeachState)(unsafe.Pointer(statePtr)).FargvList = (*ForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(numLists)*8
	(*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList = (*ForeachState)(unsafe.Pointer(statePtr)).FargvList + uintptr(numLists)*8
	(*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList = (*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(numLists)*8
	(*ForeachState)(unsafe.Pointer(statePtr)).Findex = (*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(numLists)*8
	(*ForeachState)(unsafe.Pointer(statePtr)).FvarcList = (*ForeachState)(unsafe.Pointer(statePtr)).Findex + uintptr(numLists)*4
	(*ForeachState)(unsafe.Pointer(statePtr)).FargcList = (*ForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(numLists)*4

	(*ForeachState)(unsafe.Pointer(statePtr)).FnumLists = numLists
	(*ForeachState)(unsafe.Pointer(statePtr)).FbodyPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))
	(*ForeachState)(unsafe.Pointer(statePtr)).FbodyIdx = objc - 1

	if !(collect == TCL_EACH_COLLECT) {
		goto __2
	}
	(*ForeachState)(unsafe.Pointer(statePtr)).FresultList = XTcl_NewListObj(tls, 0, uintptr(0))
	goto __3
__2:
	(*ForeachState)(unsafe.Pointer(statePtr)).FresultList = uintptr(0)
__3:
	;

	// Break up the value lists and variable lists into elements.

	i = 0
__4:
	if !(i < numLists) {
		goto __6
	}
	*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) = XTclListObjCopy(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1+i*2)*8)))
	if !(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) == uintptr(0)) {
		goto __7
	}
	result = TCL_ERROR
	goto done
__7:
	;
	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32)) + 16
		*(*int32)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(i)*4)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)), (*ForeachState)(unsafe.Pointer(statePtr)).FvarcList+uintptr(i)*4, (*ForeachState)(unsafe.Pointer(statePtr)).FvarvList+uintptr(i)*8)
	}
	if !(*(*int32)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(i)*4)) < 1) {
		goto __8
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+13022,
		libc.VaList(bp, func() uintptr {
			if (*ForeachState)(unsafe.Pointer(statePtr)).FresultList != uintptr(0) {
				return ts + 5207 /* "lmap" */
			}
			return ts + 5146 /* "foreach" */
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7420,
		func() uintptr {
			if (*ForeachState)(unsafe.Pointer(statePtr)).FresultList != uintptr(0) {
				return ts + 13042 /* "LMAP" */
			}
			return ts + 13047 /* "FOREACH" */
		}(),
		ts+13055, uintptr(0)))
	result = TCL_ERROR
	goto done
__8:
	;

	*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) = XTclListObjCopy(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2+i*2)*8)))
	if !(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) == uintptr(0)) {
		goto __9
	}
	result = TCL_ERROR
	goto done
__9:
	;
	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FargvList + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) + 32)) + 16
		*(*int32)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FargcList + uintptr(i)*4)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)), (*ForeachState)(unsafe.Pointer(statePtr)).FargcList+uintptr(i)*4, (*ForeachState)(unsafe.Pointer(statePtr)).FargvList+uintptr(i)*8)
	}

	j = *(*int32)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FargcList + uintptr(i)*4)) / *(*int32)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(i)*4))
	if !(*(*int32)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FargcList + uintptr(i)*4))%*(*int32)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(i)*4)) != 0) {
		goto __10
	}
	j++
__10:
	;
	if !(j > (*ForeachState)(unsafe.Pointer(statePtr)).Fmaxj) {
		goto __11
	}
	(*ForeachState)(unsafe.Pointer(statePtr)).Fmaxj = j
__11:
	;
	goto __5
__5:
	i++
	goto __4
	goto __6
__6:
	;

	// If there is any work to do, assign the variables and set things going
	// non-recursively.

	if !((*ForeachState)(unsafe.Pointer(statePtr)).Fmaxj > 0) {
		goto __12
	}
	result = sForeachAssignments(tls, interp, statePtr)
	if !(result == TCL_ERROR) {
		goto __13
	}
	goto done
__13:
	;

__14:
__17:
	;
__20:
	if !(interp == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __23
	}
	_objPtr = XTclThreadAllocObj(tls)
	goto __24
__23:
	_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__24:
	;
	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	_callbackPtr = _objPtr
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sForeachLoopStep}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = statePtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), 0,
		(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr, objc-1)
__12:
	;

	// This cleanup stage is only used when an error occurs during setup or if
	// there is no work to do.

	result = TCL_OK
done:
	sForeachCleanup(tls, interp, statePtr)
	return result
}

// Post-body processing handler.

func sForeachLoopStep(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdAH.c:2991:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var statePtr uintptr
	var cachePtr uintptr
	var _objPtr uintptr
	var _callbackPtr uintptr
	statePtr = *(*ClientData)(unsafe.Pointer(data))

	// Process the result code from this run of the [foreach] body. Note that
	// this switch uses fallthroughs in several places. Maintainer aware!

	switch result {
	case TCL_CONTINUE:
		goto __2
	case TCL_OK:
		goto __3
	case TCL_BREAK:
		goto __4
	case TCL_ERROR:
		goto __5
	default:
		goto __6
	}
	goto __1
__2:
	result = TCL_OK
	goto __1
__3:
	if !((*ForeachState)(unsafe.Pointer(statePtr)).FresultList != uintptr(0)) {
		goto __7
	}
	XTcl_ListObjAppendElement(tls, interp, (*ForeachState)(unsafe.Pointer(statePtr)).FresultList,
		XTcl_GetObjResult(tls, interp))
__7:
	;
	goto __1
__4:
	result = TCL_OK
	goto finish
__5:
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+13064,
		libc.VaList(bp, func() uintptr {
			if (*ForeachState)(unsafe.Pointer(statePtr)).FresultList != uintptr(0) {
				return ts + 5207 /* "lmap" */
			}
			return ts + 5146 /* "foreach" */
		}(),
			XTcl_GetErrorLine(tls, interp))))
__6:
	goto done
__1:
	;

	// Test if there is work still to be done. If so, do the next round of
	// variable assignments, reschedule ourselves and run the body again.

	if !((*ForeachState)(unsafe.Pointer(statePtr)).Fmaxj > libc.PreIncInt32(&(*ForeachState)(unsafe.Pointer(statePtr)).Fj, 1)) {
		goto __8
	}
	result = sForeachAssignments(tls, interp, statePtr)
	if !(result == TCL_ERROR) {
		goto __9
	}
	goto done
__9:
	;

__10:
__13:
	;
__16:
	if !(interp == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __19
	}
	_objPtr = XTclThreadAllocObj(tls)
	goto __20
__19:
	_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__20:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	_callbackPtr = _objPtr
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sForeachLoopStep}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = statePtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
	return XTclNREvalObjEx(tls, interp, (*ForeachState)(unsafe.Pointer(statePtr)).FbodyPtr, 0,
		(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr, (*ForeachState)(unsafe.Pointer(statePtr)).FbodyIdx)
__8:
	;

	// We're done. Tidy up our work space and finish off.

finish:
	if !((*ForeachState)(unsafe.Pointer(statePtr)).FresultList == uintptr(0)) {
		goto __21
	}
	XTcl_ResetResult(tls, interp)
	goto __22
__21:
	XTcl_SetObjResult(tls, interp, (*ForeachState)(unsafe.Pointer(statePtr)).FresultList)
	(*ForeachState)(unsafe.Pointer(statePtr)).FresultList = uintptr(0) // Don't clean it up
__22:
	;

done:
	sForeachCleanup(tls, interp, statePtr)
	return result
}

// Factored out code to do the assignments in [foreach].

func sForeachAssignments(tls *libc.TLS, interp uintptr, statePtr uintptr) int32 { /* tclCmdAH.c:3063:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var i int32
	var v int32
	var k int32
	var valuePtr uintptr
	var varValuePtr uintptr

	for i = 0; i < (*ForeachState)(unsafe.Pointer(statePtr)).FnumLists; i++ {
		for v = 0; v < *(*int32)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(i)*4)); v++ {
			k = libc.PostIncInt32(&*(*int32)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).Findex + uintptr(i)*4)), 1)

			if k < *(*int32)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FargcList + uintptr(i)*4)) {
				valuePtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FargvList + uintptr(i)*8)) + uintptr(k)*8))
			} else {
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						valuePtr = XTclThreadAllocObj(tls)
					} else {
						valuePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(valuePtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount = 0
				(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength = 0
				(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr = uintptr(0)
				{
				}
				// Empty string
			}

			varValuePtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) + uintptr(v)*8)),
				uintptr(0), valuePtr, TCL_LEAVE_ERR_MSG)

			if varValuePtr == uintptr(0) {
				XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
					ts+13089,
					libc.VaList(bp, func() uintptr {
						if (*ForeachState)(unsafe.Pointer(statePtr)).FresultList != uintptr(0) {
							return ts + 5207 /* "lmap" */
						}
						return ts + 5146 /* "foreach" */
					}(),
						func() uintptr {
							if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) + uintptr(v)*8)))).Fbytes != 0 {
								return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) + uintptr(v)*8)))).Fbytes
							}
							return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) + uintptr(v)*8)))
						}())))
				return TCL_ERROR
			}
		}
	}

	return TCL_OK
}

// Factored out code for cleaning up the state of the foreach.

func sForeachCleanup(tls *libc.TLS, interp uintptr, statePtr uintptr) { /* tclCmdAH.c:3101:1: */
	var i int32

	for i = 0; i < (*ForeachState)(unsafe.Pointer(statePtr)).FnumLists; i++ {
		if *(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) != 0 {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))
						} else {
							*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))
				}
			}

		}
		if *(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) != 0 {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).Flength = -1
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))
						} else {
							*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))
				}
			}

		}
	}
	if (*ForeachState)(unsafe.Pointer(statePtr)).FresultList != uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FresultList)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FresultList)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FresultList)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FresultList)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FresultList)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FresultList)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FresultList)).Flength = -1
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, (*ForeachState)(unsafe.Pointer(statePtr)).FresultList)
					} else {
						*(*uintptr)(unsafe.Pointer((*ForeachState)(unsafe.Pointer(statePtr)).FresultList + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*ForeachState)(unsafe.Pointer(statePtr)).FresultList
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, (*ForeachState)(unsafe.Pointer(statePtr)).FresultList)
			}
		}

	}
	XTclStackFree(tls, interp, statePtr)
}

//----------------------------------------------------------------------
//
// Tcl_FormatObjCmd --
//
//	This procedure is invoked to process the "format" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_FormatObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdAH.c:3140:1: */
	var resultPtr uintptr // Where result is stored finally.

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9569)
		return TCL_ERROR
	}

	resultPtr = XTcl_Format(tls, interp, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}(), objc-2, objv+uintptr(2)*8)
	if resultPtr == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// automatically gathered by fwd; do not hand-edit
// =====^!^===== end forwards =====^!^=====

// more C++ voodoo

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The TclRegexp structure encapsulates a compiled regex_t, the flags that
// were used to compile it, and an array of pointers that are used to indicate
// subexpressions after a call to Tcl_RegExpExec. Note that the string and
// objPtr are mutually exclusive. These values are needed by Tcl_RegExpRange
// in order to return pointers into the original string.

type TclRegexp1 = struct {
	Fflags       int32
	F__ccgo_pad1 [4]byte
	Fre          Regex_t
	Fstring      uintptr
	FobjPtr      uintptr
	FglobObjPtr  uintptr
	Fmatches     uintptr
	Fdetails     Rm_detail_t
	FrefCount    int32
	F__ccgo_pad2 [4]byte
} /* tclRegexp.h:27:9 */

// automatically gathered by fwd; do not hand-edit
// =====^!^===== end forwards =====^!^=====

// more C++ voodoo

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The TclRegexp structure encapsulates a compiled regex_t, the flags that
// were used to compile it, and an array of pointers that are used to indicate
// subexpressions after a call to Tcl_RegExpExec. Note that the string and
// objPtr are mutually exclusive. These values are needed by Tcl_RegExpRange
// in order to return pointers into the original string.

type TclRegexp = TclRegexp1 /* tclRegexp.h:42:3 */

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// During execution of the "lsort" command, structures of the following type
// are used to arrange the objects being sorted into a collection of linked
// lists.

type SortElement1 = struct {
	FcollationKey struct{ FstrValuePtr uintptr }
	Fpayload      struct{ FobjPtr uintptr }
	FnextPtr      uintptr
} /* tclCmdIL.c:29:9 */

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// During execution of the "lsort" command, structures of the following type
// are used to arrange the objects being sorted into a collection of linked
// lists.

type SortElement = SortElement1 /* tclCmdIL.c:42:3 */

// These function pointer types are used with the "lsearch" and "lsort"
// commands to facilitate the "-nocase" option.

type SortStrCmpFn_t = uintptr /* tclCmdIL.c:49:13 */
type SortMemCmpFn_t = uintptr /* tclCmdIL.c:50:13 */

// The "lsort" command needs to pass certain information down to the function
// that compares two list elements, and the comparison function needs to pass
// success or failure information back up to the top-level "lsort" command.
// The following structure is used to pass this information.

type SortInfo1 = struct {
	FisIncreasing  int32
	FsortMode      int32
	FcompareCmdPtr uintptr
	Findexv        uintptr
	Findexc        int32
	FsingleIndex   int32
	Funique        int32
	FnumElements   int32
	Finterp        uintptr
	FresultCode    int32
	F__ccgo_pad1   [4]byte
} /* tclCmdIL.c:59:9 */

// The "lsort" command needs to pass certain information down to the function
// that compares two list elements, and the comparison function needs to pass
// success or failure information back up to the top-level "lsort" command.
// The following structure is used to pass this information.

type SortInfo = SortInfo1 /* tclCmdIL.c:82:3 */

// Array of values describing how to implement each standard subcommand of the
// "info" command.

var defaultInfoMap = [25]EnsembleImplMap{
	{Fname: ts + 13126, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13131, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13136, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13145, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13154, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5126, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 11507, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13163, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12165, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13174, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13180, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13190, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13198, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13207, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13213, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13221, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13228, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13235, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13252, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13263, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 3636, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13269, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13288, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13299, Fproc: 0, FcompileProc: 0},
	{},
} /* tclCmdIL.c:155:30 */

//----------------------------------------------------------------------
//
// Tcl_IfObjCmd --
//
//	This procedure is invoked to process the "if" Tcl command. See the
//	user documentation for details on what it does.
//
//	With the bytecode compiler, this procedure is only called when a
//	command name is computed at runtime, and is "if" or the name to which
//	"if" was renamed: e.g., "set z if; $z 1 {puts foo}"
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_IfObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:205:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRIfObjCmd})), dummy, objc, objv)
}

func XTclNRIfObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:215:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var boolObj uintptr

	if objc <= 1 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+13304,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+8360, uintptr(0)))
		return TCL_ERROR
	}

	// At this point, objv[1] refers to the main expression to test. The
	// arguments after the expression must be "then" (optional) and a script
	// to execute if the expression is true.

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			boolObj = XTclThreadAllocObj(tls)
		} else {
			boolObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(boolObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr = uintptr(0)
	{
	}

	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sIfConditionCallback})), uintptr(Intptr_t(objc)),
		objv, uintptr(int64(1)), boolObj)
	return XTcl_NRExprObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), boolObj)
}

func sIfConditionCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdIL.c:244:1: */
	bp := tls.Alloc(92)
	defer tls.Free(92)

	var iPtr uintptr
	var objc int32
	var objv uintptr
	var i int32
	var boolObj uintptr
	// var value int32 at bp+88, 4

	var thenScriptIndex int32
	var clause uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	iPtr = interp
	objc = int32(*(*ClientData)(unsafe.Pointer(data)))
	objv = *(*ClientData)(unsafe.Pointer(data + 1*8))
	i = int32(*(*ClientData)(unsafe.Pointer(data + 2*8)))
	boolObj = *(*ClientData)(unsafe.Pointer(data + 3*8))
	thenScriptIndex = 0

	if !(result != TCL_OK) {
		goto __1
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount, 1) > 1) {
		goto __2
	}
	goto __3
__2:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4
	}

	if !((*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != XtclEmptyStringRep) {
		goto __6
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes)
__6:
	;
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).Flength = -1
__7:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __10
	}
	XTclThreadFreeObj(tls, boolObj)
	goto __11
__10:
	*(*uintptr)(unsafe.Pointer(boolObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = boolObj
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__11:
	;
	goto __8
__8:
	if 0 != 0 {
		goto __7
	}
	goto __9
__9:
	;
	goto __5
__4:
	XTclFreeObj(tls, boolObj)
__5:
	;
__3:
	;

	return result
__1:
	;
	if !(XTcl_GetBooleanFromObj(tls, interp, boolObj, bp+88) != TCL_OK) {
		goto __12
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount, 1) > 1) {
		goto __13
	}
	goto __14
__13:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __15
	}

	if !((*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != XtclEmptyStringRep) {
		goto __17
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes)
__17:
	;
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).Flength = -1
__18:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __21
	}
	XTclThreadFreeObj(tls, boolObj)
	goto __22
__21:
	*(*uintptr)(unsafe.Pointer(boolObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = boolObj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__22:
	;
	goto __19
__19:
	if 0 != 0 {
		goto __18
	}
	goto __20
__20:
	;
	goto __16
__15:
	XTclFreeObj(tls, boolObj)
__16:
	;
__14:
	;

	return TCL_ERROR
__12:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount, 1) > 1) {
		goto __23
	}
	goto __24
__23:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __25
	}

	if !((*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != XtclEmptyStringRep) {
		goto __27
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes)
__27:
	;
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).Flength = -1
__28:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __31
	}
	XTclThreadFreeObj(tls, boolObj)
	goto __32
__31:
	*(*uintptr)(unsafe.Pointer(boolObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = boolObj
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__32:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	goto __26
__25:
	XTclFreeObj(tls, boolObj)
__26:
	;
__24:
	;

__33:
	if !(1 != 0) {
		goto __34
	}
	i++
	if !(i >= objc) {
		goto __35
	}
	goto missingScript
__35:
	;
	clause = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}()
	if !(i < objc && libc.Xstrcmp(tls, clause, ts+13352) == 0) {
		goto __36
	}
	i++
__36:
	;
	if !(i >= objc) {
		goto __37
	}
	goto missingScript
__37:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
		goto __38
	}
	thenScriptIndex = i
	*(*int32)(unsafe.Pointer(bp + 88 /* value */)) = 0
__38:
	;

	// The expression evaluated to false. Skip the command, then see if
	// there is an "else" or "elseif" clause.

	i++
	if !(i >= objc) {
		goto __39
	}
	if !(thenScriptIndex != 0) {
		goto __40
	}
	// TIP #280. Make invoking context available to branch.

	return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(thenScriptIndex)*8)), 0,
		(*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, thenScriptIndex)
__40:
	;
	return TCL_OK
__39:
	;
	clause = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}()
	if !(int32(*(*int8)(unsafe.Pointer(clause))) != 'e' || libc.Xstrcmp(tls, clause, ts+13357) != 0) {
		goto __41
	}
	goto __34
__41:
	;
	i++

	// At this point in the loop, objv and objc refer to an expression to
	// test, either for the main expression or an expression following an
	// "elseif". The arguments after the expression must be "then"
	// (optional) and a script to execute if the expression is true.

	if !(i >= objc) {
		goto __42
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+13304,
		libc.VaList(bp, clause)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+8360, uintptr(0)))
	return TCL_ERROR
__42:
	;
	if !!(thenScriptIndex != 0) {
		goto __43
	}
__44:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __47
	}
	boolObj = XTclThreadAllocObj(tls)
	goto __48
__47:
	boolObj = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(boolObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__48:
	;
	goto __45
__45:
	if 0 != 0 {
		goto __44
	}
	goto __46
__46:
	;
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr = uintptr(0)

	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sIfConditionCallback})), *(*ClientData)(unsafe.Pointer(data)), *(*ClientData)(unsafe.Pointer(data + 1*8)),
		uintptr(Intptr_t(i)), boolObj)
	return XTcl_NRExprObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), boolObj)
__43:
	;
	goto __33
__34:
	;

	// Couldn't find a "then" or "elseif" clause to execute. Check now for an
	// "else" clause. We know that there's at least one more argument when we
	// get here.

	if !(libc.Xstrcmp(tls, clause, ts+13364) == 0) {
		goto __49
	}
	i++
	if !(i >= objc) {
		goto __50
	}
	goto missingScript
__50:
	;
__49:
	;
	if !(i < objc-1) {
		goto __51
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+13369,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+8360, uintptr(0)))
	return TCL_ERROR
__51:
	;
	if !(thenScriptIndex != 0) {
		goto __52
	}
	// TIP #280. Make invoking context available to branch/else.

	return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(thenScriptIndex)*8)), 0,
		(*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, thenScriptIndex)
__52:
	;
	return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), 0, (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, i)

missingScript:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+13431,
		libc.VaList(bp+56, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i-1)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i-1)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i-1)*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+8360, uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_IncrObjCmd --
//
//	This procedure is invoked to process the "incr" Tcl command. See the
//	user documentation for details on what it does.
//
//	With the bytecode compiler, this procedure is only called when a
//	command name is computed at runtime, and is "incr" or the name to
//	which "incr" was renamed: e.g., "set z incr; $z i -1"
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_IncrObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:388:1: */
	var newValuePtr uintptr
	var incrPtr uintptr

	if objc != 2 && objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13479)
		return TCL_ERROR
	}

	if objc == 3 {
		incrPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	} else {
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					incrPtr = XTclThreadAllocObj(tls)
				} else {
					incrPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(incrPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes = uintptr(0)
			*(*int64)(unsafe.Pointer(incrPtr + 32)) = int64(1)
			(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
			{
			}
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount++
	newValuePtr = XTclIncrObjVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0),
		incrPtr, TCL_LEAVE_ERR_MSG)
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = incrPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	if newValuePtr == uintptr(0) {
		return TCL_ERROR
	}

	// Set the interpreter's object result to refer to the variable's new
	// value object.

	XTcl_SetObjResult(tls, interp, newValuePtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclInitInfoCmd --
//
//	This function is called to create the "info" Tcl command. See the user
//	documentation for details on what it does.
//
// Results:
//	Handle for the info command, or NULL on failure.
//
// Side effects:
//	none
//
//----------------------------------------------------------------------

func XTclInitInfoCmd(tls *libc.TLS, interp uintptr) Tcl_Command { /* tclCmdIL.c:442:1: */
	return XTclMakeEnsemble(tls, interp, ts+13499, uintptr(unsafe.Pointer(&defaultInfoMap)))
}

//----------------------------------------------------------------------
//
// InfoArgsCmd --
//
//	Called to implement the "info args" command that returns the argument
//	list for a procedure. Handles the following syntax:
//
//	    info args procName
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoArgsCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:469:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var iPtr uintptr = interp
	var name uintptr
	var procPtr uintptr
	var localPtr uintptr
	var listObjPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13504)
		return TCL_ERROR
	}

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	procPtr = XTclFindProc(tls, iPtr, name)
	if procPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+13513, libc.VaList(bp, name)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+13536, name, uintptr(0)))
		return TCL_ERROR
	}

	// Build a return list containing the arguments.

	listObjPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	for localPtr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr; localPtr != uintptr(0); localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr {
		if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_ARGUMENT != 0 {
			XTcl_ListObjAppendElement(tls, interp, listObjPtr,
				XTcl_NewStringObj(tls, localPtr+40, -1))
		}
	}
	XTcl_SetObjResult(tls, interp, listObjPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// InfoBodyCmd --
//
//	Called to implement the "info body" command that returns the body for
//	a procedure. Handles the following syntax:
//
//	    info body procName
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoBodyCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:532:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var iPtr uintptr = interp
	var name uintptr
	var procPtr uintptr
	var bodyPtr uintptr
	var resultPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13504)
		return TCL_ERROR
	}

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	procPtr = XTclFindProc(tls, iPtr, name)
	if procPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+13513, libc.VaList(bp, name)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+13536, name, uintptr(0)))
		return TCL_ERROR
	}

	// Here we used to return procPtr->bodyPtr, except when the body was
	// bytecompiled - in that case, the return was a copy of the body's string
	// rep. In order to better isolate the implementation details of the
	// compiler/engine subsystem, we now always return a copy of the string
	// rep. It is important to return a copy so that later manipulations of
	// the object do not invalidate the internal rep.

	bodyPtr = (*Proc)(unsafe.Pointer(procPtr)).FbodyPtr
	if (*Tcl_Obj)(unsafe.Pointer(bodyPtr)).Fbytes == uintptr(0) {
		// The string rep might not be valid if the procedure has never been
		// run before. [Bug #545644]

		if !((*Tcl_Obj)(unsafe.Pointer(bodyPtr)).Fbytes != 0) {
			XTcl_GetString(tls, bodyPtr)
		}
	}
	resultPtr = XTcl_NewStringObj(tls, (*Tcl_Obj)(unsafe.Pointer(bodyPtr)).Fbytes, (*Tcl_Obj)(unsafe.Pointer(bodyPtr)).Flength)

	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// InfoCmdCountCmd --
//
//	Called to implement the "info cmdcount" command that returns the
//	number of commands that have been executed. Handles the following
//	syntax:
//
//	    info cmdcount
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoCmdCountCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:603:1: */
	var iPtr uintptr = interp

	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FcmdCount))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// InfoCommandsCmd --
//
//	Called to implement the "info commands" command that returns the list
//	of commands in the interpreter that match an optional pattern. The
//	pattern, if any, consists of an optional sequence of namespace names
//	separated by "::" qualifiers, which is followed by a glob-style
//	pattern that restricts which commands are returned. Handles the
//	following syntax:
//
//	    info commands ?pattern?
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoCommandsCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:645:1: */
	bp := tls.Alloc(148)
	defer tls.Free(148)

	var cmdName uintptr
	var pattern uintptr
	// var simplePattern uintptr at bp+24, 8

	var entryPtr uintptr
	// var search Tcl_HashSearch at bp+32, 24

	// var nsPtr uintptr at bp, 8

	var globalNsPtr uintptr = XTcl_GetGlobalNamespace(tls, interp)
	var currNsPtr uintptr = XTcl_GetCurrentNamespace(tls, interp)
	var listPtr uintptr
	var elemObjPtr uintptr
	var specificNsInPattern int32 = 0 // Init. to avoid compiler warning.
	var cmd Tcl_Command
	var i int32

	// Get the pattern and find the "effective namespace" in which to list
	// commands.

	if objc == 1 {
		*(*uintptr)(unsafe.Pointer(bp + 24 /* simplePattern */)) = uintptr(0)
		*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)) = currNsPtr
		specificNsInPattern = 0
	} else if objc == 2 {
		// From the pattern, get the effective namespace and the simple
		// pattern (no namespace qualifiers or ::'s) at the end. If an error
		// was found while parsing the pattern, return it. Otherwise, if the
		// namespace wasn't found, just leave nsPtr NULL: we will return an
		// empty list since no commands there can be found.

		// var dummy1NsPtr uintptr at bp+8, 8

		// var dummy2NsPtr uintptr at bp+16, 8

		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}()
		XTclGetNamespaceForQualName(tls, interp, pattern, uintptr(0), 0, bp,
			bp+8, bp+16, bp+24)

		if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) { // We successfully found the pattern's ns.
			specificNsInPattern = libc.Bool32(libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), pattern) != 0)
		}
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13546)
		return TCL_ERROR
	}

	// Exit as quickly as possible if we couldn't find the namespace.

	if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
		return TCL_OK
	}

	// Scan through the effective namespace's command table and create a list
	// with all commands that match the pattern. If a specific namespace was
	// requested in the pattern, qualify the command names with the namespace
	// name.

	listPtr = XTcl_NewListObj(tls, 0, uintptr(0))

	if *(*uintptr)(unsafe.Pointer(bp + 24)) != uintptr(0) && libc.Xstrpbrk(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), ts+13556) == uintptr(0) {
		// Special case for when the pattern doesn't include any of glob's
		// special characters. This lets us avoid scans of any hash tables.

		entryPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)) + 160 /* &.cmdTable */)).FfindProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp /* nsPtr */))+160 /* &.cmdTable */, *(*uintptr)(unsafe.Pointer(bp + 24 /* simplePattern */)))
		if entryPtr != uintptr(0) {
			if specificNsInPattern != 0 {
				cmd = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						elemObjPtr = XTclThreadAllocObj(tls)
					} else {
						elemObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(elemObjPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount = 0
				(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = 0
				(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr = uintptr(0)
				{
				}

				XTcl_GetCommandFullName(tls, interp, cmd, elemObjPtr)
			} else {
				cmdName = func() uintptr {
					if (*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+160)).FkeyType == -1 {
						return *(*uintptr)(unsafe.Pointer(entryPtr + 32))
					}
					return entryPtr + 32
				}()
				elemObjPtr = XTcl_NewStringObj(tls, cmdName, -1)
			}
			XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr)
			XTcl_SetObjResult(tls, interp, listPtr)
			return TCL_OK
		}
		if *(*uintptr)(unsafe.Pointer(bp)) != globalNsPtr && !(specificNsInPattern != 0) {
			var tablePtr uintptr = uintptr(0) // Quell warning.

			for i = 0; i < (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)))).FcommandPathLength; i++ {
				var pathNsPtr uintptr = (*NamespacePathEntry)(unsafe.Pointer((*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)))).FcommandPathArray + uintptr(i)*32)).FnsPtr

				if pathNsPtr == uintptr(0) {
					continue
				}
				tablePtr = pathNsPtr + 160
				entryPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FfindProc})).f(tls, tablePtr, *(*uintptr)(unsafe.Pointer(bp + 24 /* simplePattern */)))
				if entryPtr != uintptr(0) {
					break
				}
			}
			if entryPtr == uintptr(0) {
				tablePtr = globalNsPtr + 160
				entryPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FfindProc})).f(tls, tablePtr, *(*uintptr)(unsafe.Pointer(bp + 24 /* simplePattern */)))
			}
			if entryPtr != uintptr(0) {
				cmdName = func() uintptr {
					if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == -1 {
						return *(*uintptr)(unsafe.Pointer(entryPtr + 32))
					}
					return entryPtr + 32
				}()
				XTcl_ListObjAppendElement(tls, interp, listPtr,
					XTcl_NewStringObj(tls, cmdName, -1))
				XTcl_SetObjResult(tls, interp, listPtr)
				return TCL_OK
			}
		}
	} else if (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FcommandPathLength == 0 || specificNsInPattern != 0 {
		// The pattern is non-trivial, but either there is no explicit path or
		// there is an explicit namespace in the pattern. In both cases, the
		// old matching scheme is perfect.

		entryPtr = XTcl_FirstHashEntry(tls, *(*uintptr)(unsafe.Pointer(bp))+160, bp+32)
		for entryPtr != uintptr(0) {
			cmdName = func() uintptr {
				if (*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+160)).FkeyType == -1 {
					return *(*uintptr)(unsafe.Pointer(entryPtr + 32))
				}
				return entryPtr + 32
			}()
			if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) ||
				XTcl_StringMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp + 24))) != 0 {
				if specificNsInPattern != 0 {
					cmd = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							elemObjPtr = XTclThreadAllocObj(tls)
						} else {
							elemObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(elemObjPtr + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount = 0
					(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = 0
					(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr = uintptr(0)
					{
					}

					XTcl_GetCommandFullName(tls, interp, cmd, elemObjPtr)
				} else {
					elemObjPtr = XTcl_NewStringObj(tls, cmdName, -1)
				}
				XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr)
			}
			entryPtr = XTcl_NextHashEntry(tls, bp+32)
		}

		// If the effective namespace isn't the global :: namespace, and a
		// specific namespace wasn't requested in the pattern, then add in all
		// global :: commands that match the simple pattern. Of course, we add
		// in only those commands that aren't hidden by a command in the
		// effective namespace.

		if *(*uintptr)(unsafe.Pointer(bp)) != globalNsPtr && !(specificNsInPattern != 0) {
			entryPtr = XTcl_FirstHashEntry(tls, globalNsPtr+160, bp+32)
			for entryPtr != uintptr(0) {
				cmdName = func() uintptr {
					if (*Tcl_HashTable)(unsafe.Pointer(globalNsPtr+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(globalNsPtr+160)).FkeyType == -1 {
						return *(*uintptr)(unsafe.Pointer(entryPtr + 32))
					}
					return entryPtr + 32
				}()
				if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) ||
					XTcl_StringMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp + 24))) != 0 {
					if (*struct {
						f func(*libc.TLS, uintptr, uintptr) uintptr
					})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 160)).FfindProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp))+160, cmdName) == uintptr(0) {
						XTcl_ListObjAppendElement(tls, interp, listPtr,
							XTcl_NewStringObj(tls, cmdName, -1))
					}
				}
				entryPtr = XTcl_NextHashEntry(tls, bp+32)
			}
		}
	} else {
		// The pattern is non-trivial (can match more than one command name),
		// there is an explicit path, and there is no explicit namespace in
		// the pattern. This means that we have to traverse the path to
		// discover all the commands defined.

		// var addedCommandsTable Tcl_HashTable at bp+56, 88

		// var isNew int32 at bp+144, 4

		var foundGlobal int32 = libc.Bool32(*(*uintptr)(unsafe.Pointer(bp)) == globalNsPtr)

		// We keep a hash of the objects already added to the result list.

		XTcl_InitObjHashTable(tls, bp+56)

		entryPtr = XTcl_FirstHashEntry(tls, *(*uintptr)(unsafe.Pointer(bp))+160, bp+32)
		for entryPtr != uintptr(0) {
			cmdName = func() uintptr {
				if (*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+160)).FkeyType == -1 {
					return *(*uintptr)(unsafe.Pointer(entryPtr + 32))
				}
				return entryPtr + 32
			}()
			if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) ||
				XTcl_StringMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp + 24))) != 0 {
				elemObjPtr = XTcl_NewStringObj(tls, cmdName, -1)
				XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr)
				(*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp + 56 /* &addedCommandsTable */)).FcreateProc})).f(tls, bp+56 /* &addedCommandsTable */, elemObjPtr, bp+144 /* &isNew */)
			}
			entryPtr = XTcl_NextHashEntry(tls, bp+32)
		}

		// Search the path next.

		for i = 0; i < (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)))).FcommandPathLength; i++ {
			var pathNsPtr uintptr = (*NamespacePathEntry)(unsafe.Pointer((*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)))).FcommandPathArray + uintptr(i)*32)).FnsPtr

			if pathNsPtr == uintptr(0) {
				continue
			}
			if pathNsPtr == globalNsPtr {
				foundGlobal = 1
			}
			entryPtr = XTcl_FirstHashEntry(tls, pathNsPtr+160, bp+32)
			for entryPtr != uintptr(0) {
				cmdName = func() uintptr {
					if (*Tcl_HashTable)(unsafe.Pointer(pathNsPtr+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(pathNsPtr+160)).FkeyType == -1 {
						return *(*uintptr)(unsafe.Pointer(entryPtr + 32))
					}
					return entryPtr + 32
				}()
				if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) ||
					XTcl_StringMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp + 24))) != 0 {
					elemObjPtr = XTcl_NewStringObj(tls, cmdName, -1)
					(*struct {
						f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
					})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp + 56 /* &addedCommandsTable */)).FcreateProc})).f(tls, bp+56 /* &addedCommandsTable */, elemObjPtr, bp+144 /* &isNew */)
					if *(*int32)(unsafe.Pointer(bp + 144)) != 0 {
						XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr)
					} else {
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount, 1) > 1 {
						} else {
							if !(int32((*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
								{
								}
								if (*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes != XtclEmptyStringRep {
									XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes)
								}
								(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = -1
								for ok2 := true; ok2; ok2 = 0 != 0 {
									var cachePtr uintptr
									if uintptr(0) == uintptr(0) || func() bool {
										cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
										return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
									}() {
										XTclThreadFreeObj(tls, elemObjPtr)
									} else {
										*(*uintptr)(unsafe.Pointer(elemObjPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
										(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = elemObjPtr
										(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
									}
								}
							} else {
								XTclFreeObj(tls, elemObjPtr)
							}
						}

					}
				}
				entryPtr = XTcl_NextHashEntry(tls, bp+32)
			}
		}

		// If the effective namespace isn't the global :: namespace, and a
		// specific namespace wasn't requested in the pattern, then add in all
		// global :: commands that match the simple pattern. Of course, we add
		// in only those commands that aren't hidden by a command in the
		// effective namespace.

		if !(foundGlobal != 0) {
			entryPtr = XTcl_FirstHashEntry(tls, globalNsPtr+160, bp+32)
			for entryPtr != uintptr(0) {
				cmdName = func() uintptr {
					if (*Tcl_HashTable)(unsafe.Pointer(globalNsPtr+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(globalNsPtr+160)).FkeyType == -1 {
						return *(*uintptr)(unsafe.Pointer(entryPtr + 32))
					}
					return entryPtr + 32
				}()
				if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) ||
					XTcl_StringMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp + 24))) != 0 {
					elemObjPtr = XTcl_NewStringObj(tls, cmdName, -1)
					if (*struct {
						f func(*libc.TLS, uintptr, uintptr) uintptr
					})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp + 56)).FfindProc})).f(tls, bp+56, elemObjPtr) == uintptr(0) {
						XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr)
					} else {
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount, 1) > 1 {
						} else {
							if !(int32((*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
								{
								}
								if (*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes != XtclEmptyStringRep {
									XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes)
								}
								(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = -1
								for ok3 := true; ok3; ok3 = 0 != 0 {
									var cachePtr uintptr
									if uintptr(0) == uintptr(0) || func() bool {
										cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
										return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
									}() {
										XTclThreadFreeObj(tls, elemObjPtr)
									} else {
										*(*uintptr)(unsafe.Pointer(elemObjPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
										(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = elemObjPtr
										(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
									}
								}
							} else {
								XTclFreeObj(tls, elemObjPtr)
							}
						}

					}
				}
				entryPtr = XTcl_NextHashEntry(tls, bp+32)
			}
		}

		XTcl_DeleteHashTable(tls, bp+56)
	}

	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// InfoCompleteCmd --
//
//	Called to implement the "info complete" command that determines
//	whether a string is a complete Tcl command. Handles the following
//	syntax:
//
//	    info complete command
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoCompleteCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:922:1: */
	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13561)
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(XTclObjCommandComplete(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) != 0)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// InfoDefaultCmd --
//
//	Called to implement the "info default" command that returns the
//	default value for a procedure argument. Handles the following syntax:
//
//	    info default procName arg varName
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoDefaultCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:959:1: */
	bp := tls.Alloc(104)
	defer tls.Free(104)

	var iPtr uintptr = interp
	var procName uintptr
	var argName uintptr
	var procPtr uintptr
	var localPtr uintptr
	var valueObjPtr uintptr

	if objc != 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13569)
		return TCL_ERROR
	}

	procName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	argName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()

	procPtr = XTclFindProc(tls, iPtr, procName)
	if procPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+13513, libc.VaList(bp, procName)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+13536, procName,
			uintptr(0)))
		return TCL_ERROR
	}

	for localPtr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr; localPtr != uintptr(0); localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr {
		if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_ARGUMENT != 0 &&
			libc.Xstrcmp(tls, argName, localPtr+40) == 0 {
			if (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr != uintptr(0) {
				valueObjPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), uintptr(0),
					(*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr, TCL_LEAVE_ERR_MSG)
				if valueObjPtr == uintptr(0) {
					return TCL_ERROR
				}
				XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, 1))
			} else {
				var nullObjPtr uintptr

				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						nullObjPtr = XTclThreadAllocObj(tls)
					} else {
						nullObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(nullObjPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(nullObjPtr)).FrefCount = 0
				(*Tcl_Obj)(unsafe.Pointer(nullObjPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(nullObjPtr)).Flength = 0
				(*Tcl_Obj)(unsafe.Pointer(nullObjPtr)).FtypePtr = uintptr(0)
				{
				}

				valueObjPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), uintptr(0),
					nullObjPtr, TCL_LEAVE_ERR_MSG)
				if valueObjPtr == uintptr(0) {
					return TCL_ERROR
				}
				XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, 0))
			}
			return TCL_OK
		}
	}

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+13590,
		libc.VaList(bp+48, procName, argName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+7170, ts+13635, argName, uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// InfoErrorStackCmd --
//
//	Called to implement the "info errorstack" command that returns information
//	about the last error's call stack. Handles the following syntax:
//
//	    info errorstack ?interp?
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoErrorStackCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:1042:1: */
	var target uintptr
	var iPtr uintptr

	if objc != 1 && objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13644)
		return TCL_ERROR
	}

	target = interp
	if objc == 2 {
		target = XTcl_GetSlave(tls, interp, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))))
		if target == uintptr(0) {
			return TCL_ERROR
		}
	}

	iPtr = target
	XTcl_SetObjResult(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FerrorStack)

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclInfoExistsCmd --
//
//	Called to implement the "info exists" command that determines whether
//	a variable exists. Handles the following syntax:
//
//	    info exists varName
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func XTclInfoExistsCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:1091:1: */
	var varName uintptr
	var varPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13653)
		return TCL_ERROR
	}

	varName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	varPtr = XTclVarTraceExists(tls, interp, varName)

	XTcl_SetObjResult(tls, interp,
		XTcl_NewIntObj(tls, libc.Bool32(libc.Bool32(varPtr != 0 && *(*uintptr)(unsafe.Pointer(varPtr + 8)) != 0) != 0)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// InfoFrameCmd --
//	TIP #280
//
//	Called to implement the "info frame" command that returns the location
//	of either the currently executing command, or its caller. Handles the
//	following syntax:
//
//		info frame ?number?
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoFrameCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:1136:1: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	var iPtr uintptr
	// var level int32 at bp+48, 4

	var code int32
	var framePtr uintptr
	var cmdFramePtrPtr uintptr
	var corPtr uintptr
	var topLevel int32
	var runPtr uintptr
	var endPtr uintptr
	iPtr = interp
	code = TCL_OK
	cmdFramePtrPtr = iPtr + 952
	corPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr)).FcorPtr
	topLevel = 0

	if !(objc > 2) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13661)
	return TCL_ERROR
__1:
	;

__2:
	if !(corPtr != 0) {
		goto __3
	}
__4:
	if !(*(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) != 0) {
		goto __5
	}
	topLevel++
	cmdFramePtrPtr = *(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) + 32
	goto __4
__5:
	;
	if !((*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr != 0) {
		goto __6
	}
	*(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr
__6:
	;
	corPtr = (*ExecEnv1)(unsafe.Pointer((*CoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr)).FcorPtr
	goto __2
__3:
	;
	topLevel = topLevel + (*CmdFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)))).Flevel

	if !(topLevel != (*CmdFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr)).Flevel) {
		goto __7
	}
	framePtr = (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr
__8:
	if !(framePtr != 0) {
		goto __9
	}
	(*CmdFrame)(unsafe.Pointer(framePtr)).Flevel = libc.PostDecInt32(&topLevel, 1)
	framePtr = (*CmdFrame)(unsafe.Pointer(framePtr)).FnextPtr
	goto __8
__9:
	;
	if !(topLevel != 0) {
		goto __10
	}
	XTcl_Panic(tls, ts+13670, 0)
__10:
	;
	topLevel = (*CmdFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr)).Flevel
__7:
	;

	if !(objc == 1) {
		goto __11
	}
	// Just "info frame".

	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, topLevel))
	goto done
__11:
	;

	// We've got "info frame level" and must parse the level first.

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 48)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48)
	}() != TCL_OK) {
		goto __12
	}
	code = TCL_ERROR
	goto done
__12:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 48)) > topLevel || *(*int32)(unsafe.Pointer(bp + 48)) <= -topLevel) {
		goto __13
	}
levelError:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+13701, libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+13716,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}(), uintptr(0)))
	code = TCL_ERROR
	goto done
__13:
	;

	// Let us convert to relative so that we know how many levels to go back

	if !(*(*int32)(unsafe.Pointer(bp + 48)) > 0) {
		goto __14
	}
	*(*int32)(unsafe.Pointer(bp + 48 /* level */)) -= topLevel
__14:
	;

	framePtr = (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr
__15:
	if !(libc.PreIncInt32(&*(*int32)(unsafe.Pointer(bp + 48)), 1) <= 0) {
		goto __16
	}
	framePtr = (*CmdFrame)(unsafe.Pointer(framePtr)).FnextPtr
	if !!(framePtr != 0) {
		goto __17
	}
	goto levelError
__17:
	;
	goto __15
__16:
	;

	XTcl_SetObjResult(tls, interp, XTclInfoFrame(tls, interp, framePtr))

done:
	cmdFramePtrPtr = iPtr + 952
	corPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr)).FcorPtr
__18:
	if !(corPtr != 0) {
		goto __19
	}
	endPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr

	if !(endPtr != 0) {
		goto __20
	}
	if !(*(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) == endPtr) {
		goto __21
	}
	*(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) = uintptr(0)
	goto __22
__21:
	runPtr = *(*uintptr)(unsafe.Pointer(cmdFramePtrPtr))

__23:
	if !((*CmdFrame)(unsafe.Pointer(runPtr)).FnextPtr != endPtr) {
		goto __24
	}
	*(*int32)(unsafe.Pointer(runPtr + 4)) -= (*CmdFrame)(unsafe.Pointer(endPtr)).Flevel
	runPtr = (*CmdFrame)(unsafe.Pointer(runPtr)).FnextPtr
	goto __23
__24:
	;
	(*CmdFrame)(unsafe.Pointer(runPtr)).Flevel = 1
	(*CmdFrame)(unsafe.Pointer(runPtr)).FnextPtr = uintptr(0)
__22:
	;
	cmdFramePtrPtr = corPtr + 24 + 16
__20:
	;
	corPtr = (*ExecEnv1)(unsafe.Pointer((*CoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr)).FcorPtr
	goto __18
__19:
	;
	return code
}

//----------------------------------------------------------------------
//
// TclInfoFrame --
//
//	Core of InfoFrameCmd, returns TIP280 dict for a given frame.
//
// Results:
//	Returns TIP280 dict.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclInfoFrame(tls *libc.TLS, interp uintptr, framePtr uintptr) uintptr { /* tclCmdIL.c:1265:9: */
	bp := tls.Alloc(160)
	defer tls.Free(160)

	var iPtr uintptr = interp
	var tmpObj uintptr
	*(*[20]uintptr)(unsafe.Pointer(bp /* lv */)) = [20]uintptr{0: uintptr(0)} // Keep uptodate when more keys are added to
	// the dict.
	var lc int32 = 0
	var procPtr uintptr
	if (*CmdFrame)(unsafe.Pointer(framePtr)).FframePtr != 0 {
		procPtr = (*CallFrame)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(framePtr)).FframePtr)).FprocPtr
	} else {
		procPtr = uintptr(0)
	}
	var needsFree int32 = -1

	// Pull the information and construct the dictionary to return, as list.
	// Regarding use of the CmdFrame fields see tclInt.h, and its definition.

	switch (*CmdFrame)(unsafe.Pointer(framePtr)).Ftype {
	case 0:

		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					tmpObj = XTclThreadAllocObj(tls)
				} else {
					tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+12321, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 4)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
			{
			}
		}
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTcl_NewStringObj(tls, typeString[(*CmdFrame)(unsafe.Pointer(framePtr)).Ftype], -1)
		if (*CmdFrame)(unsafe.Pointer(framePtr)).Fline != 0 {
			for ok2 := true; ok2; ok2 = 0 != 0 {
				for ok3 := true; ok3; ok3 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						tmpObj = XTclThreadAllocObj(tls)
					} else {
						tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
				if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
				} else {
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
					libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+13722, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
					*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 4)) = int8(0)
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
				{
				}
			}
			*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
			*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(framePtr)).Fline)))
		} else {
			for ok4 := true; ok4; ok4 = 0 != 0 {
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						tmpObj = XTclThreadAllocObj(tls)
					} else {
						tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
				if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
				} else {
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
					libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+13722, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
					*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 4)) = int8(0)
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
				{
				}
			}
			*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
			*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTcl_NewIntObj(tls, 1)
		}
		for ok6 := true; ok6; ok6 = 0 != 0 {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					tmpObj = XTclThreadAllocObj(tls)
				} else {
					tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+13727, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 3)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
			{
			}
		}
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTclGetSourceFromFrame(tls, framePtr, 0, uintptr(0))
		break

	case 3:

		for ok8 := true; ok8; ok8 = 0 != 0 {
			for ok9 := true; ok9; ok9 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					tmpObj = XTclThreadAllocObj(tls)
				} else {
					tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+12321, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 4)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
			{
			}
		}
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTcl_NewStringObj(tls, typeString[(*CmdFrame)(unsafe.Pointer(framePtr)).Ftype], -1)
		break

	case 2:
		{
			// Execution of bytecode. Talk to the BC engine to fill out the frame.

			var fPtr uintptr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(CmdFrame{})))

			*(*CmdFrame)(unsafe.Pointer(fPtr)) = *(*CmdFrame)(unsafe.Pointer(framePtr))

			// Note:
			// Type BC => f.data.eval.path	  is not used.
			//	      f.data.tebc.codePtr is used instead.

			XTclGetSrcInfoForPc(tls, fPtr)

			// Now filled: cmd.str.(cmd,len), line
			// Possibly modified: type, path!

			for ok10 := true; ok10; ok10 = 0 != 0 {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						tmpObj = XTclThreadAllocObj(tls)
					} else {
						tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
				if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
				} else {
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
					libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+12321, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
					*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 4)) = int8(0)
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
				{
				}
			}
			*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
			*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTcl_NewStringObj(tls, typeString[(*CmdFrame)(unsafe.Pointer(fPtr)).Ftype], -1)
			if (*CmdFrame)(unsafe.Pointer(fPtr)).Fline != 0 {
				for ok12 := true; ok12; ok12 = 0 != 0 {
					for ok13 := true; ok13; ok13 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							tmpObj = XTclThreadAllocObj(tls)
						} else {
							tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
					if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+13722, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 4)) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
					}
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
					{
					}
				}
				*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
				*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(fPtr)).Fline)))
			}

			if (*CmdFrame)(unsafe.Pointer(fPtr)).Ftype == 4 {
				for ok14 := true; ok14; ok14 = 0 != 0 {
					for ok15 := true; ok15; ok15 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							tmpObj = XTclThreadAllocObj(tls)
						} else {
							tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
					if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+12110, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 4)) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
					}
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
					{
					}
				}
				*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
				*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = *(*uintptr)(unsafe.Pointer(fPtr + 40))

				// Death of reference by TclGetSrcInfoForPc.

				for ok16 := true; ok16; ok16 = 0 != 0 {
					var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(fPtr + 40))
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}

			for ok17 := true; ok17; ok17 = 0 != 0 {
				for ok18 := true; ok18; ok18 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						tmpObj = XTclThreadAllocObj(tls)
					} else {
						tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
				if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
				} else {
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
					libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+13727, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
					*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 3)) = int8(0)
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
				{
				}
			}
			*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
			*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTclGetSourceFromFrame(tls, fPtr, 0, uintptr(0))
			if (*CmdFrame)(unsafe.Pointer(fPtr)).FcmdObj != 0 && (*CmdFrame)(unsafe.Pointer(framePtr)).FcmdObj == uintptr(0) {
				needsFree = lc - 1
			}
			XTclStackFree(tls, interp, fPtr)
			break

		}

	case 4:

		for ok19 := true; ok19; ok19 = 0 != 0 {
			for ok20 := true; ok20; ok20 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					tmpObj = XTclThreadAllocObj(tls)
				} else {
					tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+12321, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 4)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
			{
			}
		}
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTcl_NewStringObj(tls, typeString[(*CmdFrame)(unsafe.Pointer(framePtr)).Ftype], -1)
		for ok21 := true; ok21; ok21 = 0 != 0 {
			for ok22 := true; ok22; ok22 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					tmpObj = XTclThreadAllocObj(tls)
				} else {
					tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+13722, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 4)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
			{
			}
		}
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(framePtr)).Fline)))
		for ok23 := true; ok23; ok23 = 0 != 0 {
			for ok24 := true; ok24; ok24 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					tmpObj = XTclThreadAllocObj(tls)
				} else {
					tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+12110, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 4)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
			{
			}
		}
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = *(*uintptr)(unsafe.Pointer(framePtr + 40))

		// Refcount framePtr->data.eval.path goes up when lv is converted into
		// the result list object.

		for ok25 := true; ok25; ok25 = 0 != 0 {
			for ok26 := true; ok26; ok26 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					tmpObj = XTclThreadAllocObj(tls)
				} else {
					tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+13727, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 3)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
			{
			}
		}
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
		*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTclGetSourceFromFrame(tls, framePtr, 0, uintptr(0))
		break

	case 5:
		XTcl_Panic(tls, ts+13731, 0)
		break
	}

	// 'proc'. Common to all frame types. Conditional on having an associated
	// Procedure CallFrame.

	if procPtr != uintptr(0) {
		var namePtr uintptr = (*Command1)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FcmdPtr)).FhPtr

		if namePtr != 0 {
			var procNameObj uintptr

			// This is a regular command.

			for ok27 := true; ok27; ok27 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					procNameObj = XTclThreadAllocObj(tls)
				} else {
					procNameObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(procNameObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(procNameObj)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(procNameObj)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(procNameObj)).Flength = 0
			(*Tcl_Obj)(unsafe.Pointer(procNameObj)).FtypePtr = uintptr(0)
			{
			}

			XTcl_GetCommandFullName(tls, interp, (*Proc)(unsafe.Pointer(procPtr)).FcmdPtr,
				procNameObj)
			for ok28 := true; ok28; ok28 = 0 != 0 {
				for ok29 := true; ok29; ok29 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						tmpObj = XTclThreadAllocObj(tls)
					} else {
						tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
				if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
				} else {
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
					libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+5272, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
					*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 4)) = int8(0)
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
				{
				}
			}
			*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
			*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = procNameObj
		} else if (*Command1)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FcmdPtr)).FclientData != 0 {
			var efiPtr uintptr = (*Command1)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FcmdPtr)).FclientData
			var i int32

			// This is a non-standard command. Luckily, it's told us how to
			// render extra information about its frame.

			for i = 0; i < (*ExtraFrameInfo)(unsafe.Pointer(efiPtr)).Flength; i++ {
				*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTcl_NewStringObj(tls, (*ExtraFrameInfoField)(unsafe.Pointer(efiPtr+8+uintptr(i)*24)).Fname, -1)
				if (*ExtraFrameInfoField)(unsafe.Pointer(efiPtr+8+uintptr(i)*24)).Fproc != 0 {
					*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = (*struct {
						f func(*libc.TLS, ClientData) uintptr
					})(unsafe.Pointer(&struct{ uintptr }{(*ExtraFrameInfoField)(unsafe.Pointer(efiPtr + 8 /* &.fields */ + uintptr(i)*24)).Fproc})).f(tls, (*ExtraFrameInfoField)(unsafe.Pointer(efiPtr+8 /* &.fields */ +uintptr(i)*24)).FclientData)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = (*ExtraFrameInfoField)(unsafe.Pointer(efiPtr + 8 + uintptr(i)*24)).FclientData
				}
			}
		}
	}

	// 'level'. Common to all frame types. Conditional on having an associated
	// _visible_ CallFrame.

	if (*CmdFrame)(unsafe.Pointer(framePtr)).FframePtr != uintptr(0) && (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr != uintptr(0) {
		var current uintptr = (*CmdFrame)(unsafe.Pointer(framePtr)).FframePtr
		var top uintptr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
		var idx uintptr

		for idx = top; idx != uintptr(0); idx = (*CallFrame)(unsafe.Pointer(idx)).FcallerVarPtr {
			if idx == current {
				var c int32 = (*CallFrame)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(framePtr)).FframePtr)).Flevel
				var t int32 = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Flevel

				for ok30 := true; ok30; ok30 = 0 != 0 {
					for ok31 := true; ok31; ok31 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							tmpObj = XTclThreadAllocObj(tls)
						} else {
							tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
					if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, ts+13207, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + 5)) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
					}
					(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
					{
					}
				}
				*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = tmpObj
				*(*uintptr)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&lc, 1))*8)) = XTcl_NewIntObj(tls, t-c)
				break
			}
		}
	}

	tmpObj = XTcl_NewListObj(tls, lc, bp)
	if needsFree >= 0 {
		for ok32 := true; ok32; ok32 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + uintptr(needsFree)*8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return tmpObj
}

var typeString = [6]uintptr{
	ts + 2409, ts + 2409, ts + 2409, ts + 13773, ts + 5489, ts + 5272,
} /* tclCmdIL.c:1279:23 */

//----------------------------------------------------------------------
//
// InfoFunctionsCmd --
//
//	Called to implement the "info functions" command that returns the list
//	of math functions matching an optional pattern. Handles the following
//	syntax:
//
//	    info functions ?pattern?
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoFunctionsCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:1476:1: */
	var script uintptr
	var code int32

	if objc > 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13546)
		return TCL_ERROR
	}

	script = XTcl_NewStringObj(tls,

		ts+13785, -1)

	if objc == 2 {
		var arg uintptr = XTcl_NewListObj(tls, 1, objv+1*8)

		XTcl_AppendObjToObj(tls, script, arg)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = arg
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	(*Tcl_Obj)(unsafe.Pointer(script)).FrefCount++
	code = XTcl_EvalObjEx(tls, interp, script, 0)

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = script
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	return code
}

//----------------------------------------------------------------------
//
// InfoHostnameCmd --
//
//	Called to implement the "info hostname" command that returns the host
//	name. Handles the following syntax:
//
//	    info hostname
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoHostnameCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:1541:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var name uintptr

	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}

	name = XTcl_GetHostName(tls)
	if name != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, name, -1))
		return TCL_OK
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+14161, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+14194, ts+14203, uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// InfoLevelCmd --
//
//	Called to implement the "info level" command that returns information
//	about the call stack. Handles the following syntax:
//
//	    info level ?number?
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoLevelCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:1587:1: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	var iPtr uintptr
	// var level int32 at bp+48, 4

	var framePtr uintptr
	var rootFramePtr uintptr
	iPtr = interp

	if !(objc == 1) {
		goto __1
	} // Just "info level"
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Flevel))
	return TCL_OK
__1:
	;

	if !(objc == 2) {
		goto __2
	}
	rootFramePtr = (*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 48)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48)
	}() != TCL_OK) {
		goto __3
	}
	return TCL_ERROR
__3:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 48)) <= 0) {
		goto __4
	}
	if !((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr == rootFramePtr) {
		goto __5
	}
	goto levelError
__5:
	;
	*(*int32)(unsafe.Pointer(bp + 48 /* level */)) += (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Flevel
__4:
	;
	framePtr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
__6:
	if !(framePtr != rootFramePtr) {
		goto __8
	}
	if !((*CallFrame)(unsafe.Pointer(framePtr)).Flevel == *(*int32)(unsafe.Pointer(bp + 48))) {
		goto __9
	}
	goto __8
__9:
	;
	goto __7
__7:
	framePtr = (*CallFrame)(unsafe.Pointer(framePtr)).FcallerVarPtr
	goto __6
	goto __8
__8:
	;
	if !(framePtr == rootFramePtr) {
		goto __10
	}
	goto levelError
__10:
	;

	XTcl_SetObjResult(tls, interp,
		XTcl_NewListObj(tls, (*CallFrame)(unsafe.Pointer(framePtr)).Fobjc, (*CallFrame)(unsafe.Pointer(framePtr)).Fobjv))
	return TCL_OK
__2:
	;

	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13661)
	return TCL_ERROR

levelError:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+13701, libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+13716,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}(), uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// InfoLibraryCmd --
//
//	Called to implement the "info library" command that returns the
//	library directory for the Tcl installation. Handles the following
//	syntax:
//
//	    info library
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoLibraryCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:1661:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var libDirName uintptr

	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}

	libDirName = XTcl_GetVar2(tls, interp, ts+14211, uintptr(0), TCL_GLOBAL_ONLY)
	if libDirName != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, libDirName, -1))
		return TCL_OK
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+14223, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7170, ts+14261, ts+14211, uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// InfoLoadedCmd --
//
//	Called to implement the "info loaded" command that returns the
//	packages that have been loaded into an interpreter. Handles the
//	following syntax:
//
//	    info loaded ?interp?
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoLoadedCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:1708:1: */
	var interpName uintptr

	if objc != 1 && objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13644)
		return TCL_ERROR
	}

	if objc == 1 { // Get loaded pkgs in all interpreters.
		interpName = uintptr(0)
	} else { // Get pkgs just in specified interp.
		interpName = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}()
	}
	return XTclGetLoadedPackages(tls, interp, interpName)
}

//----------------------------------------------------------------------
//
// InfoNameOfExecutableCmd --
//
//	Called to implement the "info nameofexecutable" command that returns
//	the name of the binary file running this application. Handles the
//	following syntax:
//
//	    info nameofexecutable
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoNameOfExecutableCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:1751:1: */
	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTclGetObjNameOfExecutable(tls))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// InfoPatchLevelCmd --
//
//	Called to implement the "info patchlevel" command that returns the
//	default value for an argument to a procedure. Handles the following
//	syntax:
//
//	    info patchlevel
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoPatchLevelCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:1787:1: */
	var patchlevel uintptr

	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}

	patchlevel = XTcl_GetVar2(tls, interp, ts+6554, uintptr(0), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
	if patchlevel != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, patchlevel, -1))
		return TCL_OK
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// InfoProcsCmd --
//
//	Called to implement the "info procs" command that returns the list of
//	procedures in the interpreter that match an optional pattern. The
//	pattern, if any, consists of an optional sequence of namespace names
//	separated by "::" qualifiers, which is followed by a glob-style
//	pattern that restricts which commands are returned. Handles the
//	following syntax:
//
//	    info procs ?pattern?
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoProcsCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:1834:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	var cmdName uintptr
	var pattern uintptr
	// var simplePattern uintptr at bp+24, 8

	// var nsPtr uintptr at bp, 8

	var currNsPtr uintptr
	var listPtr uintptr
	var elemObjPtr uintptr
	var specificNsInPattern int32 // Init. to avoid compiler warning.
	var entryPtr uintptr
	// var search Tcl_HashSearch at bp+32, 24

	var cmdPtr uintptr
	var realCmdPtr uintptr
	// From the pattern, get the effective namespace and the simple
	// pattern (no namespace qualifiers or ::'s) at the end. If an error
	// was found while parsing the pattern, return it. Otherwise, if the
	// namespace wasn't found, just leave nsPtr NULL: we will return an
	// empty list since no commands there can be found.

	// var dummy1NsPtr uintptr at bp+8, 8

	// var dummy2NsPtr uintptr at bp+16, 8

	var cachePtr uintptr
	var cachePtr1 uintptr
	currNsPtr = XTcl_GetCurrentNamespace(tls, interp)
	specificNsInPattern = 0

	// Get the pattern and find the "effective namespace" in which to list
	// procs.

	if !(objc == 1) {
		goto __1
	}
	*(*uintptr)(unsafe.Pointer(bp + 24 /* simplePattern */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)) = currNsPtr
	specificNsInPattern = 0
	goto __2
__1:
	if !(objc == 2) {
		goto __3
	}

	pattern = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	XTclGetNamespaceForQualName(tls, interp, pattern, uintptr(0), 0, bp,
		bp+8, bp+16, bp+24)

	if !(*(*uintptr)(unsafe.Pointer(bp)) != uintptr(0)) {
		goto __5
	} // We successfully found the pattern's ns.
	specificNsInPattern = libc.Bool32(libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), pattern) != 0)
__5:
	;
	goto __4
__3:
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13546)
	return TCL_ERROR
__4:
	;
__2:
	;

	if !(*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0)) {
		goto __6
	}
	return TCL_OK
__6:
	;

	// Scan through the effective namespace's command table and create a list
	// with all procs that match the pattern. If a specific namespace was
	// requested in the pattern, qualify the command names with the namespace
	// name.

	listPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	if !(*(*uintptr)(unsafe.Pointer(bp + 24)) != uintptr(0) && libc.Xstrpbrk(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), ts+13556) == uintptr(0)) {
		goto __7
	}
	entryPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)) + 160 /* &.cmdTable */)).FfindProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp /* nsPtr */))+160 /* &.cmdTable */, *(*uintptr)(unsafe.Pointer(bp + 24 /* simplePattern */)))
	if !(entryPtr != uintptr(0)) {
		goto __9
	}
	cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData

	if !!(XTclIsProc(tls, cmdPtr) != 0) {
		goto __10
	}
	realCmdPtr = XTclGetOriginalCommand(tls, cmdPtr)
	if !(realCmdPtr != uintptr(0) && XTclIsProc(tls, realCmdPtr) != 0) {
		goto __12
	}
	goto simpleProcOK
__12:
	;
	goto __11
__10:
simpleProcOK:
	if !(specificNsInPattern != 0) {
		goto __13
	}
__15:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __18
	}
	elemObjPtr = XTclThreadAllocObj(tls)
	goto __19
__18:
	elemObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(elemObjPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__19:
	;
	goto __16
__16:
	if 0 != 0 {
		goto __15
	}
	goto __17
__17:
	;
	(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr = uintptr(0)

	XTcl_GetCommandFullName(tls, interp, cmdPtr,
		elemObjPtr)
	goto __14
__13:
	elemObjPtr = XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* simplePattern */)), -1)
__14:
	;
	XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr)
__11:
	;
__9:
	;
	goto __8
__7:

	entryPtr = XTcl_FirstHashEntry(tls, *(*uintptr)(unsafe.Pointer(bp))+160, bp+32)
__20:
	if !(entryPtr != uintptr(0)) {
		goto __21
	}
	cmdName = func() uintptr {
		if (*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+160)).FkeyType == -1 {
			return *(*uintptr)(unsafe.Pointer(entryPtr + 32))
		}
		return entryPtr + 32
	}()
	if !(*(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) ||
		XTcl_StringMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp + 24))) != 0) {
		goto __22
	}
	cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData

	if !!(XTclIsProc(tls, cmdPtr) != 0) {
		goto __23
	}
	realCmdPtr = XTclGetOriginalCommand(tls, cmdPtr)
	if !(realCmdPtr != uintptr(0) && XTclIsProc(tls, realCmdPtr) != 0) {
		goto __25
	}
	goto procOK
__25:
	;
	goto __24
__23:
procOK:
	if !(specificNsInPattern != 0) {
		goto __26
	}
__28:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __31
	}
	elemObjPtr = XTclThreadAllocObj(tls)
	goto __32
__31:
	elemObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(elemObjPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__32:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr = uintptr(0)

	XTcl_GetCommandFullName(tls, interp, cmdPtr,
		elemObjPtr)
	goto __27
__26:
	elemObjPtr = XTcl_NewStringObj(tls, cmdName, -1)
__27:
	;
	XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr)
__24:
	;
__22:
	;
	entryPtr = XTcl_NextHashEntry(tls, bp+32)
	goto __20
__21:
	;

	// If the effective namespace isn't the global :: namespace, and a
	// specific namespace wasn't requested in the pattern, then add in all
	// global :: procs that match the simple pattern. Of course, we add in
	// only those procs that aren't hidden by a proc in the effective
	// namespace.

__8:
	;

	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// InfoScriptCmd --
//
//	Called to implement the "info script" command that returns the script
//	file that is currently being evaluated. Handles the following syntax:
//
//	    info script ?newName?
//
//	If newName is specified, it will set that as the internal name.
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message. It may change the internal
//	script filename.
//
//----------------------------------------------------------------------

func sInfoScriptCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2021:1: */
	var iPtr uintptr = interp
	if objc != 1 && objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14270)
		return TCL_ERROR
	}

	if objc == 2 {
		if (*Interp)(unsafe.Pointer(iPtr)).FscriptFile != uintptr(0) {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FscriptFile
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		(*Interp)(unsafe.Pointer(iPtr)).FscriptFile = *(*uintptr)(unsafe.Pointer(objv + 1*8))
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FscriptFile)).FrefCount++
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FscriptFile != uintptr(0) {
		XTcl_SetObjResult(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FscriptFile)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// InfoSharedlibCmd --
//
//	Called to implement the "info sharedlibextension" command that returns
//	the file extension used for shared libraries. Handles the following
//	syntax:
//
//	    info sharedlibextension
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoSharedlibCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2068:1: */
	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+2046, -1))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// InfoTclVersionCmd --
//
//	Called to implement the "info tclversion" command that returns the
//	version number for this Tcl library. Handles the following syntax:
//
//	    info tclversion
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func sInfoTclVersionCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2106:1: */
	var version uintptr

	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}

	version = XTcl_GetVar2Ex(tls, interp, ts+6576, uintptr(0),
		TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
	if version != uintptr(0) {
		XTcl_SetObjResult(tls, interp, version)
		return TCL_OK
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_JoinObjCmd --
//
//	This procedure is invoked to process the "join" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_JoinObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2146:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var listLen int32 at bp+8, 4

	var i int32
	var resObjPtr uintptr
	var joinObjPtr uintptr
	// var elemPtrs uintptr at bp, 8

	if objc < 2 || objc > 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14281)
		return TCL_ERROR
	}

	// Make sure the list argument is a list object and get its length and a
	// pointer to its array of element pointers.

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 8)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp)
	}() != TCL_OK {
		return TCL_ERROR
	}

	if objc == 2 {
		joinObjPtr = XTcl_NewStringObj(tls, ts+14299, 1)
	} else {
		joinObjPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	}
	(*Tcl_Obj)(unsafe.Pointer(joinObjPtr)).FrefCount++

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resObjPtr = XTclThreadAllocObj(tls)
		} else {
			resObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resObjPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resObjPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resObjPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resObjPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resObjPtr)).FtypePtr = uintptr(0)
	{
	}

	for i = 0; i < *(*int32)(unsafe.Pointer(bp + 8 /* listLen */)); i++ {
		if i > 0 {

			// NOTE: This code is relying on Tcl_AppendObjToObj() **NOT**
			// to shimmer joinObjPtr.  If it did, then the case where
			// objv[1] and objv[2] are the same value would not be safe.
			// Accessing elemPtrs would crash.

			XTcl_AppendObjToObj(tls, resObjPtr, joinObjPtr)
		}
		XTcl_AppendObjToObj(tls, resObjPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* elemPtrs */)) + uintptr(i)*8)))
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = joinObjPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTcl_SetObjResult(tls, interp, resObjPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_LassignObjCmd --
//
//	This object-based procedure is invoked to process the "lassign" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LassignObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2211:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var listCopyPtr uintptr
	// var listObjv uintptr at bp, 8
	// The contents of the list.
	// var listObjc int32 at bp+8, 4
	// The length of the list.
	var code int32 = TCL_OK

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14301)
		return TCL_ERROR
	}

	listCopyPtr = XTclListObjCopy(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if listCopyPtr == uintptr(0) {
		return TCL_ERROR
	}

	if (*Tcl_Obj)(unsafe.Pointer(listCopyPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(listCopyPtr + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 8)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(listCopyPtr + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), listCopyPtr, bp+8, bp)
	}

	objc = objc - 2
	objv += 8 * uintptr(2)
	for code == TCL_OK && objc > 0 && *(*int32)(unsafe.Pointer(bp + 8)) > 0 {
		if XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&objv, 8))), uintptr(0), *(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp)), 8))),
			TCL_LEAVE_ERR_MSG) == uintptr(0) {
			code = TCL_ERROR
		}
		objc--
		*(*int32)(unsafe.Pointer(bp + 8 /* listObjc */))--
	}

	if code == TCL_OK && objc > 0 {
		var emptyObj uintptr

		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				emptyObj = XTclThreadAllocObj(tls)
			} else {
				emptyObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(emptyObj + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(emptyObj)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(emptyObj)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(emptyObj)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(emptyObj)).FtypePtr = uintptr(0)
		{
		}

		(*Tcl_Obj)(unsafe.Pointer(emptyObj)).FrefCount++
		for code == TCL_OK && libc.PostDecInt32(&objc, 1) > 0 {
			if XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&objv, 8))), uintptr(0), emptyObj,
				TCL_LEAVE_ERR_MSG) == uintptr(0) {
				code = TCL_ERROR
			}
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = emptyObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	if code == TCL_OK && *(*int32)(unsafe.Pointer(bp + 8)) > 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, *(*int32)(unsafe.Pointer(bp + 8 /* listObjc */)), *(*uintptr)(unsafe.Pointer(bp /* listObjv */))))
	}

	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = listCopyPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return code
}

//----------------------------------------------------------------------
//
// Tcl_LindexObjCmd --
//
//	This object-based procedure is invoked to process the "lindex" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LindexObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2285:1: */
	var elemPtr uintptr // Pointer to the element being extracted.

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14320)
		return TCL_ERROR
	}

	// If objc==3, then objv[2] may be either a single index or a list of
	// indices: go to TclLindexList to determine which. If objc>=4, or
	// objc==2, then objv[2 .. objc-2] are all single indices and processed as
	// such in TclLindexFlat.

	if objc == 3 {
		elemPtr = XTclLindexList(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	} else {
		elemPtr = XTclLindexFlat(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), objc-2, objv+uintptr(2)*8)
	}

	// Set the interpreter's object result to the last element extracted.

	if elemPtr == uintptr(0) {
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, elemPtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = elemPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_LinsertObjCmd --
//
//	This object-based procedure is invoked to process the "linsert" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A new Tcl list object formed by inserting zero or more elements into a
//	list.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LinsertObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2344:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var listPtr uintptr
	// var index int32 at bp+4, 4

	// var len int32 at bp, 4

	var result int32

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14337)
		return TCL_ERROR
	}

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()
	if result != TCL_OK {
		return result
	}

	// Get the index. "end" is interpreted to be the index after the last
	// element, such that using it will cause any inserted elements to be
	// appended to the list.

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp)), bp+4)
	}()
	if result != TCL_OK {
		return result
	}
	if *(*int32)(unsafe.Pointer(bp + 4)) > *(*int32)(unsafe.Pointer(bp)) {
		*(*int32)(unsafe.Pointer(bp + 4 /* index */)) = *(*int32)(unsafe.Pointer(bp /* len */))
	}

	// If the list object is unshared we can modify it directly. Otherwise we
	// create a copy to modify: this is "copy on write".

	listPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount > 1 {
		listPtr = XTclListObjCopy(tls, uintptr(0), listPtr)
	}

	if objc == 4 && *(*int32)(unsafe.Pointer(bp + 4)) == *(*int32)(unsafe.Pointer(bp)) {
		// Special case: insert one element at the end of the list.

		XTcl_ListObjAppendElement(tls, uintptr(0), listPtr, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	} else {
		if TCL_OK != XTcl_ListObjReplace(tls, interp, listPtr, *(*int32)(unsafe.Pointer(bp + 4)), 0,
			objc-3, objv+3*8) {
			return TCL_ERROR
		}
	}

	// Set the interpreter's object result.

	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ListObjCmd --
//
//	This procedure is invoked to process the "list" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_ListObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2426:1: */
	// If there are no list elements, the result is an empty object.
	// Otherwise set the interpreter's result object to be a list object.

	if objc > 1 {
		XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, objc-1, objv+1*8))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_LlengthObjCmd --
//
//	This object-based procedure is invoked to process the "llength" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LlengthObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2462:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var listLen int32 at bp, 4

	var result int32

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2810)
		return TCL_ERROR
	}

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()
	if result != TCL_OK {
		return result
	}

	// Set the interpreter's object result to an integer object holding the
	// length.

	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp /* listLen */))))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_LrangeObjCmd --
//
//	This procedure is invoked to process the "lrange" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LrangeObjCmd(tls *libc.TLS, notUsed ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2508:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var elemPtrs uintptr at bp+16, 8

	// var listLen int32 at bp, 4

	// var first int32 at bp+4, 4

	// var last int32 at bp+8, 4

	var result int32

	if objc != 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14362)
		return TCL_ERROR
	}

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()
	if result != TCL_OK {
		return result
	}

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp))-1, bp+4)
	}()
	if result != TCL_OK {
		return result
	}
	if *(*int32)(unsafe.Pointer(bp + 4)) < 0 {
		*(*int32)(unsafe.Pointer(bp + 4 /* first */)) = 0
	}

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*int32)(unsafe.Pointer(bp))-1, bp+8)
	}()
	if result != TCL_OK {
		return result
	}
	if *(*int32)(unsafe.Pointer(bp + 8)) >= *(*int32)(unsafe.Pointer(bp)) {
		*(*int32)(unsafe.Pointer(bp + 8 /* last */)) = *(*int32)(unsafe.Pointer(bp)) - 1
	}

	if *(*int32)(unsafe.Pointer(bp + 4)) > *(*int32)(unsafe.Pointer(bp + 8)) {
		// Returning an empty list is easy.

		return TCL_OK
	}

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 16)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, bp+16)
	}()
	if result != TCL_OK {
		return result
	}

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FrefCount > 1 || (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FrefCount > 1 {
		XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, *(*int32)(unsafe.Pointer(bp + 8))-*(*int32)(unsafe.Pointer(bp + 4))+1,
			*(*uintptr)(unsafe.Pointer(bp + 16))+uintptr(*(*int32)(unsafe.Pointer(bp + 4)))*8))
	} else {
		// In-place is possible.

		if *(*int32)(unsafe.Pointer(bp + 8)) < *(*int32)(unsafe.Pointer(bp))-1 {
			XTcl_ListObjReplace(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*int32)(unsafe.Pointer(bp + 8))+1, *(*int32)(unsafe.Pointer(bp))-1-*(*int32)(unsafe.Pointer(bp + 8)),
				0, uintptr(0))
		}

		// This one is not conditioned on (first > 0) in order to preserve the
		// string-canonizing effect of [lrange 0 end].

		XTcl_ListObjReplace(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), 0, *(*int32)(unsafe.Pointer(bp + 4 /* first */)), 0, uintptr(0))
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_LrepeatObjCmd --
//
//	This procedure is invoked to process the "lrepeat" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LrepeatObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2603:1: */
	bp := tls.Alloc(84)
	defer tls.Free(84)

	// var elementCount int32 at bp+80, 4

	var i int32
	var totalElems int32
	var listPtr uintptr
	var dataArray uintptr = uintptr(0)

	// Check arguments for legality:
	//		lrepeat count ?value ...?

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14378)
		return TCL_ERROR
	}
	if TCL_OK != func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 80)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+80)
	}() {
		return TCL_ERROR
	}
	if *(*int32)(unsafe.Pointer(bp + 80)) < 0 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+14396, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 80 /* elementCount */)))))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7420, ts+14433, ts+14441,
			uintptr(0)))
		return TCL_ERROR
	}

	// Skip forward to the interesting arguments now we've finished parsing.

	objc = objc - 2
	objv += 8 * uintptr(2)

	// Final sanity check. Do not exceed limits on max list length.

	if *(*int32)(unsafe.Pointer(bp + 80)) != 0 && objc > (1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0))))) / *(*int32)(unsafe.Pointer(bp + 80)) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+14448, libc.VaList(bp+48, 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))))))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+3593, ts+14496, uintptr(0)))
		return TCL_ERROR
	}
	totalElems = objc * *(*int32)(unsafe.Pointer(bp + 80))

	// Get an empty list object that is allocated large enough to hold each
	// init value elementCount times.

	listPtr = XTcl_NewListObj(tls, totalElems, uintptr(0))
	if totalElems != 0 {
		var listRepPtr uintptr = *(*uintptr)(unsafe.Pointer(listPtr + 32))

		(*List)(unsafe.Pointer(listRepPtr)).FelemCount = *(*int32)(unsafe.Pointer(bp + 80)) * objc
		dataArray = listRepPtr + 16
	}

	// Set the elements. Note that we handle the common degenerate case of a
	// single value being repeated separately to permit the compiler as much
	// room as possible to optimize a loop that might be run a very large
	// number of times.

	if objc == 1 {
		var tmpPtr uintptr = *(*uintptr)(unsafe.Pointer(objv))

		*(*int32)(unsafe.Pointer(tmpPtr)) += *(*int32)(unsafe.Pointer(bp + 80))
		for i = 0; i < *(*int32)(unsafe.Pointer(bp + 80 /* elementCount */)); i++ {
			*(*uintptr)(unsafe.Pointer(dataArray + uintptr(i)*8)) = tmpPtr
		}
	} else {
		var j int32
		var k int32 = 0

		for i = 0; i < *(*int32)(unsafe.Pointer(bp + 80 /* elementCount */)); i++ {
			for j = 0; j < objc; j++ {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8)))).FrefCount++
				*(*uintptr)(unsafe.Pointer(dataArray + uintptr(libc.PostIncInt32(&k, 1))*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8))
			}
		}
	}

	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_LreplaceObjCmd --
//
//	This object-based procedure is invoked to process the "lreplace" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A new Tcl list object formed by replacing zero or more elements of a
//	list.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LreplaceObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2712:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var listPtr uintptr
	// var first int32 at bp+4, 4

	// var last int32 at bp+8, 4

	// var listLen int32 at bp, 4

	var numToDelete int32
	var result int32

	if objc < 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv,
			ts+14503)
		return TCL_ERROR
	}

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()
	if result != TCL_OK {
		return result
	}

	// Get the first and last indexes. "end" is interpreted to be the index
	// for the last element, such that using it will cause that element to be
	// included for deletion.

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp))-1, bp+4)
	}()
	if result != TCL_OK {
		return result
	}

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*int32)(unsafe.Pointer(bp))-1, bp+8)
	}()
	if result != TCL_OK {
		return result
	}

	if *(*int32)(unsafe.Pointer(bp + 4)) < 0 {
		*(*int32)(unsafe.Pointer(bp + 4 /* first */)) = 0
	}
	if *(*int32)(unsafe.Pointer(bp + 4)) > *(*int32)(unsafe.Pointer(bp)) {
		*(*int32)(unsafe.Pointer(bp + 4 /* first */)) = *(*int32)(unsafe.Pointer(bp /* listLen */))
	}

	if *(*int32)(unsafe.Pointer(bp + 8)) >= *(*int32)(unsafe.Pointer(bp)) {
		*(*int32)(unsafe.Pointer(bp + 8 /* last */)) = *(*int32)(unsafe.Pointer(bp)) - 1
	}
	if *(*int32)(unsafe.Pointer(bp + 4)) <= *(*int32)(unsafe.Pointer(bp + 8)) {
		numToDelete = *(*int32)(unsafe.Pointer(bp + 8)) - *(*int32)(unsafe.Pointer(bp + 4)) + 1
	} else {
		numToDelete = 0
	}

	// If the list object is unshared we can modify it directly, otherwise we
	// create a copy to modify: this is "copy on write".

	listPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount > 1 {
		listPtr = XTclListObjCopy(tls, uintptr(0), listPtr)
	}

	// Note that we call Tcl_ListObjReplace even when numToDelete == 0 and
	// objc == 4. In this case, the list value of listPtr is not changed (no
	// elements are removed or added), but by making the call we are assured
	// we end up with a list in canonical form. Resist any temptation to
	// optimize this case away.

	if TCL_OK != XTcl_ListObjReplace(tls, interp, listPtr, *(*int32)(unsafe.Pointer(bp + 4)), numToDelete,
		objc-4, objv+uintptr(4)*8) {
		return TCL_ERROR
	}

	// Set the interpreter's object result.

	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_LreverseObjCmd --
//
//	This procedure is invoked to process the "lreverse" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LreverseObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2813:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var elemv uintptr at bp, 8

	// var elemc int32 at bp+8, 4

	var i int32
	var j int32

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2810)
		return TCL_ERROR
	}
	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 8)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp)
	}() != TCL_OK {
		return TCL_ERROR
	}

	// If the list is empty, just return it. [Bug 1876793]

	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		return TCL_OK
	}

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FrefCount > 1 ||
		(*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FrefCount > 1 { // Bug 1675044
		var resultObj uintptr
		var dataArray uintptr
		var listRepPtr uintptr

		resultObj = XTcl_NewListObj(tls, *(*int32)(unsafe.Pointer(bp + 8 /* elemc */)), uintptr(0))
		listRepPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
		(*List)(unsafe.Pointer(listRepPtr)).FelemCount = *(*int32)(unsafe.Pointer(bp + 8 /* elemc */))
		dataArray = listRepPtr + 16

		i = 0
		j = *(*int32)(unsafe.Pointer(bp + 8)) - 1
	__1:
		if !(i < *(*int32)(unsafe.Pointer(bp + 8))) {
			goto __3
		}
		{
			*(*uintptr)(unsafe.Pointer(dataArray + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* elemv */)) + uintptr(i)*8))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i)*8)))).FrefCount++

		}
		goto __2
	__2:
		i++
		j--
		goto __1
		goto __3
	__3:
		;

		XTcl_SetObjResult(tls, interp, resultObj)
	} else {

		// Not shared, so swap "in place". This relies on Tcl_LOGE above
		// returning a pointer to the live array of Tcl_Obj values.

		i = 0
		j = *(*int32)(unsafe.Pointer(bp + 8)) - 1
	__4:
		if !(i < j) {
			goto __6
		}
		{
			var tmp uintptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* elemv */)) + uintptr(i)*8))

			*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* elemv */)) + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* elemv */)) + uintptr(j)*8))
			*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* elemv */)) + uintptr(j)*8)) = tmp

		}
		goto __5
	__5:
		i++
		j--
		goto __4
		goto __6
	__6:
		;
		for ok := true; ok; ok = 0 != 0 {
			var _isobjPtr uintptr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
			}
		}
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_LsearchObjCmd --
//
//	This procedure is invoked to process the "lsearch" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LsearchObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:2892:1: */
	bp := tls.Alloc(332)
	defer tls.Free(332)

	var bytes uintptr
	var patternBytes uintptr
	var i int32
	var match int32
	// var index int32 at bp+192, 4

	var result int32
	// var listc int32 at bp+280, 4

	// var length int32 at bp+288, 4

	// var elemLen int32 at bp+328, 4

	var bisect int32
	var dataType int32
	var isIncreasing int32
	var lower int32
	var upper int32
	// var offset int32 at bp+284, 4

	// var patWide Tcl_WideInt at bp+296, 8

	// var objWide Tcl_WideInt at bp+312, 8

	var allMatches int32
	var inlineReturn int32
	var negatedMatch int32
	var returnSubindices int32
	var noCase int32
	// var patDouble float64 at bp+304, 8

	// var objDouble float64 at bp+320, 8

	// var sortInfo SortInfo at bp+208, 56

	var patObj uintptr
	// var listv uintptr at bp+272, 8

	var listPtr uintptr
	var startPtr uintptr
	var itemPtr uintptr
	var strCmpFn SortStrCmpFn_t
	var regexp Tcl_RegExp
	var mode uint32
	var _objPtr uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var _objPtr3 uintptr
	// var encoded int32 at bp+264, 4
	// -index
	// var indices uintptr at bp+200, 8

	var j int32
	var _objPtr4 uintptr
	var _objPtr5 uintptr
	var _objPtr6 uintptr
	var _objPtr7 uintptr
	var _objPtr8 uintptr
	var _objPtr9 uintptr
	var _objPtr10 uintptr
	var _objPtr11 uintptr
	var _objPtr12 uintptr
	var cachePtr uintptr
	var j1 int32
	var cachePtr1 uintptr
	var j2 int32
	result = TCL_OK
	strCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{libc.Xstrcmp}))
	regexp = uintptr(0)

	mode = uint32(1) /* GLOB */
	dataType = 0     /* ASCII */
	isIncreasing = 1
	allMatches = 0
	inlineReturn = 0
	returnSubindices = 0
	negatedMatch = 0
	bisect = 0
	listPtr = uintptr(0)
	startPtr = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 284 /* offset */)) = 0
	noCase = 0
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).FcompareCmdPtr = uintptr(0)
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).FisIncreasing = 1
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).FsortMode = 0
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).Finterp = interp
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).FresultCode = TCL_OK
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).Findexv = uintptr(0)
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).Findexc = 0

	if !(objc < 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14533)
	return TCL_ERROR
__1:
	;

	i = 1
__2:
	if !(i < objc-2) {
		goto __4
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options1)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+192) !=
		TCL_OK) {
		goto __5
	}
	if !(startPtr != uintptr(0)) {
		goto __6
	}
__7:
	_objPtr = startPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __10
	}
	XTclFreeObj(tls, _objPtr)
__10:
	;
	goto __8
__8:
	if 0 != 0 {
		goto __7
	}
	goto __9
__9:
	;
__6:
	;
	result = TCL_ERROR
	goto done
__5:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 192 /* index */))) {
	case uint32(0) /* LSEARCH_ALL */ :
		goto __12
	case uint32(1) /* LSEARCH_ASCII */ :
		goto __13
	case uint32(2) /* LSEARCH_BISECT */ :
		goto __14
	case uint32(3) /* LSEARCH_DECREASING */ :
		goto __15
	case uint32(4) /* LSEARCH_DICTIONARY */ :
		goto __16
	case uint32(5) /* LSEARCH_EXACT */ :
		goto __17
	case uint32(6) /* LSEARCH_GLOB */ :
		goto __18
	case uint32(7) /* LSEARCH_INCREASING */ :
		goto __19
	case uint32(9) /* LSEARCH_INLINE */ :
		goto __20
	case uint32(10) /* LSEARCH_INTEGER */ :
		goto __21
	case uint32(11) /* LSEARCH_NOCASE */ :
		goto __22
	case uint32(12) /* LSEARCH_NOT */ :
		goto __23
	case uint32(13) /* LSEARCH_REAL */ :
		goto __24
	case uint32(14) /* LSEARCH_REGEXP */ :
		goto __25
	case uint32(15) /* LSEARCH_SORTED */ :
		goto __26
	case uint32(17) /* LSEARCH_SUBINDICES */ :
		goto __27
	case uint32(16) /* LSEARCH_START */ :
		goto __28
	case uint32(8) /* LSEARCH_INDEX */ :
		goto __29
	}
	goto __11
__12: // -all
	allMatches = 1
	goto __11
__13: // -ascii
	dataType = 0 /* ASCII */
	goto __11
__14: // -bisect
	mode = uint32(3) /* SORTED */
	bisect = 1
	goto __11
__15: // -decreasing
	isIncreasing = 0
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).FisIncreasing = 0
	goto __11
__16: // -dictionary
	dataType = 1 /* DICTIONARY */
	goto __11
__17: // -increasing
	mode = uint32(0) /* EXACT */
	goto __11
__18: // -glob
	mode = uint32(1) /* GLOB */
	goto __11
__19: // -increasing
	isIncreasing = 1
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).FisIncreasing = 1
	goto __11
__20: // -inline
	inlineReturn = 1
	goto __11
__21: // -integer
	dataType = 2 /* INTEGER */
	goto __11
__22: // -nocase
	strCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{XTclUtfCasecmp}))
	noCase = 1
	goto __11
__23: // -not
	negatedMatch = 1
	goto __11
__24: // -real
	dataType = 3 /* REAL */
	goto __11
__25: // -regexp
	mode = uint32(2) /* REGEXP */
	goto __11
__26: // -sorted
	mode = uint32(3) /* SORTED */
	goto __11
__27: // -subindices
	returnSubindices = 1
	goto __11
__28: // -start
	// If there was a previous -start option, release its saved index
	// because it will either be replaced or there will be an error.

	if !(startPtr != uintptr(0)) {
		goto __30
	}
__31:
	_objPtr1 = startPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __34
	}
	XTclFreeObj(tls, _objPtr1)
__34:
	;
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
__30:
	;
	if !(i > objc-4) {
		goto __35
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+14566, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+13635, ts+14589, uintptr(0)))
	result = TCL_ERROR
	goto done
__35:
	;
	i++
	if !(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) == *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8))) {
		goto __36
	}
	// Take copy to prevent shimmering problems. Note that it does
	// not matter if the index obj is also a component of the list
	// being searched. We only need to copy where the list and the
	// index are one-and-the-same.

	startPtr = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	goto __37
__36:
	startPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	(*Tcl_Obj)(unsafe.Pointer(startPtr)).FrefCount++
__37:
	;
	goto __11
__29:

	if !((*SortInfo)(unsafe.Pointer(bp+208)).Findexc > 1) {
		goto __38
	}
	XTclStackFree(tls, interp, (*SortInfo)(unsafe.Pointer(bp+208 /* &sortInfo */)).Findexv)
__38:
	;
	if !(i > objc-4) {
		goto __39
	}
	if !(startPtr != uintptr(0)) {
		goto __40
	}
__41:
	_objPtr2 = startPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __44
	}
	XTclFreeObj(tls, _objPtr2)
__44:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
__40:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+14597,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+13635, ts+14589, uintptr(0)))
	return TCL_ERROR
__39:
	;

	// Store the extracted indices for processing by sublist
	// extraction. Note that we don't do this using objects because
	// that has shimmering problems.

	i++
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 200)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 208 + 24)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+208+24, bp+200)
	}() != TCL_OK) {
		goto __45
	}
	if !(startPtr != uintptr(0)) {
		goto __46
	}
__47:
	_objPtr3 = startPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __50
	}
	XTclFreeObj(tls, _objPtr3)
__50:
	;
	goto __48
__48:
	if 0 != 0 {
		goto __47
	}
	goto __49
__49:
	;
__46:
	;
	return TCL_ERROR
__45:
	;
	switch (*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).Findexc {
	case 0:
		goto __52
	case 1:
		goto __53
	default:
		goto __54
	}
	goto __51
__52:
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).Findexv = uintptr(0)
	goto __51
__53:
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).Findexv = bp + 208 + 28
	goto __51
__54:
	(*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).Findexv = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64((*SortInfo)(unsafe.Pointer(bp+208)).Findexc)))
__51:
	;

	// Fill the array by parsing each index. We don't know whether
	// their scale is sensible yet, but we at least perform the
	// syntactic check here.

	j = 0
__55:
	if !(j < (*SortInfo)(unsafe.Pointer(bp+208)).Findexc) {
		goto __57
	}
	*(*int32)(unsafe.Pointer(bp + 264 /* encoded */)) = 0
	if !(XTclIndexEncode(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200)) + uintptr(j)*8)), -1,
		0x7fffffff, bp+264) != TCL_OK) {
		goto __58
	}
	result = TCL_ERROR
__58:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 264)) == -1 ||
		*(*int32)(unsafe.Pointer(bp + 264)) == 0x7fffffff) {
		goto __59
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+14644, libc.VaList(bp+64, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* indices */)) + uintptr(j)*8))))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+6915,
		ts+14694, uintptr(0)))
	result = TCL_ERROR
__59:
	;
	if !(result == TCL_ERROR) {
		goto __60
	}
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+14710, libc.VaList(bp+104, j)))
	goto done
__60:
	;
	*(*int32)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+208 /* &sortInfo */)).Findexv + uintptr(j)*4)) = *(*int32)(unsafe.Pointer(bp + 264 /* encoded */))
	goto __56
__56:
	j++
	goto __55
	goto __57
__57:
	;
	goto __11

__11:
	;
	goto __3
__3:
	i++
	goto __2
	goto __4
__4:
	;

	// Subindices only make sense if asked for with -index option set.

	if !(returnSubindices != 0 && (*SortInfo)(unsafe.Pointer(bp+208)).Findexc == 0) {
		goto __61
	}
	if !(startPtr != uintptr(0)) {
		goto __62
	}
__63:
	_objPtr4 = startPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __66
	}
	XTclFreeObj(tls, _objPtr4)
__66:
	;
	goto __64
__64:
	if 0 != 0 {
		goto __63
	}
	goto __65
__65:
	;
__62:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+14746, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+112, ts+3593, ts+7420, ts+14795,
		ts+14803, uintptr(0)))
	return TCL_ERROR
__61:
	;

	if !(bisect != 0 && (allMatches != 0 || negatedMatch != 0)) {
		goto __67
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+14818, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+152, ts+3593, ts+7420, ts+14795,
		ts+14803, uintptr(0)))
	return TCL_ERROR
__67:
	;

	if !(int32(mode) == 2) {
		goto __68
	}
	// We can shimmer regexp/list if listv[i] == pattern, so get the
	// regexp rep before the list rep. First time round, omit the interp
	// and hope that the compilation will succeed. If it fails, we'll
	// recompile in "expensive" mode with a place to put error messages.

	regexp = XTcl_GetRegExpFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)),
		TCL_REG_ADVANCED|TCL_REG_NOSUB|func() int32 {
			if noCase != 0 {
				return TCL_REG_NOCASE
			}
			return 0
		}())
	if !(regexp == uintptr(0)) {
		goto __69
	}
	// Failed to compile the RE. Try again without the TCL_REG_NOSUB
	// flag in case the RE had sub-expressions in it [Bug 1366683]. If
	// this fails, an error message will be left in the interpreter.

	regexp = XTcl_GetRegExpFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)),
		TCL_REG_ADVANCED|func() int32 {
			if noCase != 0 {
				return TCL_REG_NOCASE
			}
			return 0
		}())
__69:
	;

	if !(regexp == uintptr(0)) {
		goto __70
	}
	if !(startPtr != uintptr(0)) {
		goto __71
	}
__72:
	_objPtr5 = startPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __75
	}
	XTclFreeObj(tls, _objPtr5)
__75:
	;
	goto __73
__73:
	if 0 != 0 {
		goto __72
	}
	goto __74
__74:
	;
__71:
	;
	result = TCL_ERROR
	goto done
__70:
	;
__68:
	;

	// Make sure the list argument is a list object and get its length and a
	// pointer to its array of element pointers.

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 272)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 280)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)), bp+280, bp+272)
	}()
	if !(result != TCL_OK) {
		goto __76
	}
	if !(startPtr != uintptr(0)) {
		goto __77
	}
__78:
	_objPtr6 = startPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr6)).FrefCount, 1) <= 1) {
		goto __81
	}
	XTclFreeObj(tls, _objPtr6)
__81:
	;
	goto __79
__79:
	if 0 != 0 {
		goto __78
	}
	goto __80
__80:
	;
__77:
	;
	goto done
__76:
	;

	// Get the user-specified start offset.

	if !(startPtr != 0) {
		goto __82
	}
	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(startPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(startPtr + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(startPtr + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 284)) = int32(*(*int64)(unsafe.Pointer(startPtr + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, startPtr, *(*int32)(unsafe.Pointer(bp + 280))-1, bp+284)
	}()
__83:
	_objPtr7 = startPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr7)).FrefCount, 1) <= 1) {
		goto __86
	}
	XTclFreeObj(tls, _objPtr7)
__86:
	;
	goto __84
__84:
	if 0 != 0 {
		goto __83
	}
	goto __85
__85:
	;
	if !(result != TCL_OK) {
		goto __87
	}
	goto done
__87:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 284)) < 0) {
		goto __88
	}
	*(*int32)(unsafe.Pointer(bp + 284 /* offset */)) = 0
__88:
	;

	// If the search started past the end of the list, we just return a
	// "did not match anything at all" result straight away. [Bug 1374778]

	if !(*(*int32)(unsafe.Pointer(bp + 284)) > *(*int32)(unsafe.Pointer(bp + 280))-1) {
		goto __89
	}
	if !((*SortInfo)(unsafe.Pointer(bp+208)).Findexc > 1) {
		goto __90
	}
	XTclStackFree(tls, interp, (*SortInfo)(unsafe.Pointer(bp+208 /* &sortInfo */)).Findexv)
__90:
	;
	if !(allMatches != 0 || inlineReturn != 0) {
		goto __91
	}
	XTcl_ResetResult(tls, interp)
	goto __92
__91:
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, -1))
__92:
	;
	return TCL_OK
__89:
	;
__82:
	;

	patObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))
	patternBytes = uintptr(0)
	if !(int32(mode) == 0 || int32(mode) == 3) {
		goto __93
	}
	switch uint32(dataType) {
	case uint32(0) /* ASCII */ :
		goto __96
	case uint32(1) /* DICTIONARY */ :
		goto __97
	case uint32(2) /* INTEGER */ :
		goto __98
	case uint32(3) /* REAL */ :
		goto __99
	}
	goto __95
__96:
__97:
	patternBytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(patObj)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 288)) = (*Tcl_Obj)(unsafe.Pointer(patObj)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(patObj)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, patObj, bp+288)
	}()
	goto __95
__98:
	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(patObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp + 296)) = *(*int64)(unsafe.Pointer(patObj + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, interp, patObj, bp+296)
	}()
	if !(result != TCL_OK) {
		goto __100
	}
	goto done
__100:
	;

	// List representation might have been shimmered; restore it. [Bug
	// 1844789]

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 272)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)) + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 280)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)) + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)), bp+280, bp+272)
	}
	goto __95
__99:
	result = XTcl_GetDoubleFromObj(tls, interp, patObj, bp+304)
	if !(result != TCL_OK) {
		goto __101
	}
	goto done
__101:
	;

	// List representation might have been shimmered; restore it. [Bug
	// 1844789]

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 272)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)) + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 280)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)) + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)), bp+280, bp+272)
	}
	goto __95
__95:
	;
	goto __94
__93:
	patternBytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(patObj)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 288)) = (*Tcl_Obj)(unsafe.Pointer(patObj)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(patObj)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, patObj, bp+288)
	}()
__94:
	;

	// Set default index value to -1, indicating failure; if we find the item
	// in the course of our search, index will be set to the correct value.

	*(*int32)(unsafe.Pointer(bp + 192 /* index */)) = -1
	match = 0

	if !(int32(mode) == 3 && !(allMatches != 0) && !(negatedMatch != 0)) {
		goto __102
	}
	// If the data is sorted, we can do a more intelligent search. Note
	// that there is no point in being smart when -all was specified; in
	// that case, we have to look at all items anyway, and there is no
	// sense in doing this when the match sense is inverted.

	lower = *(*int32)(unsafe.Pointer(bp + 284)) - 1
	upper = *(*int32)(unsafe.Pointer(bp + 280 /* listc */))
__104:
	if !(lower+1 != upper && (*SortInfo)(unsafe.Pointer(bp+208)).FresultCode == TCL_OK) {
		goto __105
	}
	i = (lower + upper) / 2
	if !((*SortInfo)(unsafe.Pointer(bp+208)).Findexc != 0) {
		goto __106
	}
	itemPtr = sSelectObjFromSublist(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272 /* listv */)) + uintptr(i)*8)), bp+208)
	if !((*SortInfo)(unsafe.Pointer(bp+208)).FresultCode != TCL_OK) {
		goto __108
	}
	result = (*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).FresultCode
	goto done
__108:
	;
	goto __107
__106:
	itemPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272 /* listv */)) + uintptr(i)*8))
__107:
	;
	switch uint32(dataType) {
	case uint32(0) /* ASCII */ :
		goto __110
	case uint32(1) /* DICTIONARY */ :
		goto __111
	case uint32(2) /* INTEGER */ :
		goto __112
	case uint32(3) /* REAL */ :
		goto __113
	}
	goto __109
__110:
	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes
		}
		return XTcl_GetString(tls, itemPtr)
	}()
	match = (*struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{strCmpFn})).f(tls, patternBytes, bytes)
	goto __109
__111:
	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes
		}
		return XTcl_GetString(tls, itemPtr)
	}()
	match = sDictionaryCompare(tls, patternBytes, bytes)
	goto __109
__112:
	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(itemPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp + 312)) = *(*int64)(unsafe.Pointer(itemPtr + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, interp, itemPtr, bp+312)
	}()
	if !(result != TCL_OK) {
		goto __114
	}
	goto done
__114:
	;
	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 296)) == *(*Tcl_WideInt)(unsafe.Pointer(bp + 312))) {
		goto __115
	}
	match = 0
	goto __116
__115:
	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 296)) < *(*Tcl_WideInt)(unsafe.Pointer(bp + 312))) {
		goto __117
	}
	match = -1
	goto __118
__117:
	match = 1
__118:
	;
__116:
	;
	goto __109
__113:
	result = XTcl_GetDoubleFromObj(tls, interp, itemPtr, bp+320)
	if !(result != TCL_OK) {
		goto __119
	}
	goto done
__119:
	;
	if !(*(*float64)(unsafe.Pointer(bp + 304)) == *(*float64)(unsafe.Pointer(bp + 320))) {
		goto __120
	}
	match = 0
	goto __121
__120:
	if !(*(*float64)(unsafe.Pointer(bp + 304)) < *(*float64)(unsafe.Pointer(bp + 320))) {
		goto __122
	}
	match = -1
	goto __123
__122:
	match = 1
__123:
	;
__121:
	;
	goto __109
__109:
	;
	if !(match == 0) {
		goto __124
	}
	// Normally, binary search is written to stop when it finds a
	// match. If there are duplicates of an element in the list,
	// our first match might not be the first occurrence.
	// Consider: 0 0 0 1 1 1 2 2 2
	//
	// To maintain consistancy with standard lsearch semantics, we
	// must find the leftmost occurrence of the pattern in the
	// list. Thus we don't just stop searching here. This
	// variation means that a search always makes log n
	// comparisons (normal binary search might "get lucky" with an
	// early comparison).
	//
	// In bisect mode though, we want the last of equals.

	*(*int32)(unsafe.Pointer(bp + 192 /* index */)) = i
	if !(bisect != 0) {
		goto __126
	}
	lower = i
	goto __127
__126:
	upper = i
__127:
	;
	goto __125
__124:
	if !(match > 0) {
		goto __128
	}
	if !(isIncreasing != 0) {
		goto __130
	}
	lower = i
	goto __131
__130:
	upper = i
__131:
	;
	goto __129
__128:
	if !(isIncreasing != 0) {
		goto __132
	}
	upper = i
	goto __133
__132:
	lower = i
__133:
	;
__129:
	;
__125:
	;
	goto __104
__105:
	;
	if !(bisect != 0 && *(*int32)(unsafe.Pointer(bp + 192)) < 0) {
		goto __134
	}
	*(*int32)(unsafe.Pointer(bp + 192 /* index */)) = lower
__134:
	;
	goto __103
__102:
	// We need to do a linear search, because (at least one) of:
	//   - our matcher can only tell equal vs. not equal
	//   - our matching sense is negated
	//   - we're building a list of all matched items

	if !(allMatches != 0) {
		goto __135
	}
	listPtr = XTcl_NewListObj(tls, 0, uintptr(0))
__135:
	;
	i = *(*int32)(unsafe.Pointer(bp + 284 /* offset */))
__136:
	if !(i < *(*int32)(unsafe.Pointer(bp + 280))) {
		goto __138
	}
	match = 0
	if !((*SortInfo)(unsafe.Pointer(bp+208)).Findexc != 0) {
		goto __139
	}
	itemPtr = sSelectObjFromSublist(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272 /* listv */)) + uintptr(i)*8)), bp+208)
	if !((*SortInfo)(unsafe.Pointer(bp+208)).FresultCode != TCL_OK) {
		goto __141
	}
	if !(listPtr != uintptr(0)) {
		goto __142
	}
__143:
	_objPtr8 = listPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr8)).FrefCount, 1) <= 1) {
		goto __146
	}
	XTclFreeObj(tls, _objPtr8)
__146:
	;
	goto __144
__144:
	if 0 != 0 {
		goto __143
	}
	goto __145
__145:
	;
__142:
	;
	result = (*SortInfo)(unsafe.Pointer(bp + 208 /* &sortInfo */)).FresultCode
	goto done
__141:
	;
	goto __140
__139:
	itemPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272 /* listv */)) + uintptr(i)*8))
__140:
	;

	switch mode {
	case uint32(3) /* SORTED */ :
		goto __148
	case uint32(0) /* EXACT */ :
		goto __149

	case uint32(1) /* GLOB */ :
		goto __150

	case uint32(2) /* REGEXP */ :
		goto __151
	}
	goto __147
__148:
__149:
	switch uint32(dataType) {
	case uint32(0) /* ASCII */ :
		goto __153

	case uint32(1) /* DICTIONARY */ :
		goto __154

	case uint32(2) /* INTEGER */ :
		goto __155

	case uint32(3) /* REAL */ :
		goto __156
	}
	goto __152
__153:
	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 328)) = (*Tcl_Obj)(unsafe.Pointer(itemPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, itemPtr, bp+328)
	}()
	if !(*(*int32)(unsafe.Pointer(bp + 288)) == *(*int32)(unsafe.Pointer(bp + 328))) {
		goto __157
	}
	// This split allows for more optimal compilation of
	// memcmp/strcasecmp.

	if !(noCase != 0) {
		goto __158
	}
	match = libc.Bool32(XTclUtfCasecmp(tls, bytes, patternBytes) == 0)
	goto __159
__158:
	match = libc.Bool32(libc.Xmemcmp(tls, bytes, patternBytes,
		Size_t(*(*int32)(unsafe.Pointer(bp + 288)))) == 0)
__159:
	;
__157:
	;
	goto __152

__154:
	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes
		}
		return XTcl_GetString(tls, itemPtr)
	}()
	match = libc.Bool32(sDictionaryCompare(tls, bytes, patternBytes) == 0)
	goto __152

__155:
	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(itemPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp + 312)) = *(*int64)(unsafe.Pointer(itemPtr + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, interp, itemPtr, bp+312)
	}()
	if !(result != TCL_OK) {
		goto __160
	}
	if !(listPtr != uintptr(0)) {
		goto __161
	}
__162:
	_objPtr9 = listPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr9)).FrefCount, 1) <= 1) {
		goto __165
	}
	XTclFreeObj(tls, _objPtr9)
__165:
	;
	goto __163
__163:
	if 0 != 0 {
		goto __162
	}
	goto __164
__164:
	;
__161:
	;
	goto done
__160:
	;
	match = libc.Bool32(*(*Tcl_WideInt)(unsafe.Pointer(bp + 312)) == *(*Tcl_WideInt)(unsafe.Pointer(bp + 296)))
	goto __152

__156:
	result = XTcl_GetDoubleFromObj(tls, interp, itemPtr, bp+320)
	if !(result != TCL_OK) {
		goto __166
	}
	if !(listPtr != 0) {
		goto __167
	}
__168:
	_objPtr10 = listPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr10)).FrefCount, 1) <= 1) {
		goto __171
	}
	XTclFreeObj(tls, _objPtr10)
__171:
	;
	goto __169
__169:
	if 0 != 0 {
		goto __168
	}
	goto __170
__170:
	;
__167:
	;
	goto done
__166:
	;
	match = libc.Bool32(*(*float64)(unsafe.Pointer(bp + 320)) == *(*float64)(unsafe.Pointer(bp + 304)))
	goto __152
__152:
	;
	goto __147

__150:
	match = XTcl_StringCaseMatch(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes
		}
		return XTcl_GetString(tls, itemPtr)
	}(),
		patternBytes, noCase)
	goto __147

__151:
	match = XTcl_RegExpExecObj(tls, interp, regexp, itemPtr, 0, 0, 0)
	if !(match < 0) {
		goto __172
	}
__173:
	_objPtr11 = patObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr11)).FrefCount, 1) <= 1) {
		goto __176
	}
	XTclFreeObj(tls, _objPtr11)
__176:
	;
	goto __174
__174:
	if 0 != 0 {
		goto __173
	}
	goto __175
__175:
	;
	if !(listPtr != uintptr(0)) {
		goto __177
	}
__178:
	_objPtr12 = listPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr12)).FrefCount, 1) <= 1) {
		goto __181
	}
	XTclFreeObj(tls, _objPtr12)
__181:
	;
	goto __179
__179:
	if 0 != 0 {
		goto __178
	}
	goto __180
__180:
	;
__177:
	;
	result = TCL_ERROR
	goto done
__172:
	;
	goto __147
__147:
	;

	// Invert match condition for -not.

	if !(negatedMatch != 0) {
		goto __182
	}
	match = libc.BoolInt32(!(match != 0))
__182:
	;
	if !!(match != 0) {
		goto __183
	}
	goto __137
__183:
	;
	if !!(allMatches != 0) {
		goto __184
	}
	*(*int32)(unsafe.Pointer(bp + 192 /* index */)) = i
	goto __138
	goto __185
__184:
	if !(inlineReturn != 0) {
		goto __186
	}
	// Note that these appends are not expected to fail.

	if !(returnSubindices != 0 && (*SortInfo)(unsafe.Pointer(bp+208)).Findexc != 0) {
		goto __188
	}
	itemPtr = sSelectObjFromSublist(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272 /* listv */)) + uintptr(i)*8)), bp+208)
	goto __189
__188:
	itemPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272 /* listv */)) + uintptr(i)*8))
__189:
	;
	XTcl_ListObjAppendElement(tls, interp, listPtr, itemPtr)
	goto __187
__186:
	if !(returnSubindices != 0) {
		goto __190
	}

__192:
	;
__195:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __198
	}
	itemPtr = XTclThreadAllocObj(tls)
	goto __199
__198:
	itemPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(itemPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__199:
	;
	goto __196
__196:
	if 0 != 0 {
		goto __195
	}
	goto __197
__197:
	;
	(*Tcl_Obj)(unsafe.Pointer(itemPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(itemPtr + 32)) = int64(i)
	(*Tcl_Obj)(unsafe.Pointer(itemPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __193
__193:
	if 0 != 0 {
		goto __192
	}
	goto __194
__194:
	;
	j1 = 0
__200:
	if !(j1 < (*SortInfo)(unsafe.Pointer(bp+208)).Findexc) {
		goto __202
	}
	XTcl_ListObjAppendElement(tls, interp, itemPtr, XTcl_NewIntObj(tls,
		XTclIndexDecode(tls, *(*int32)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+208 /* &sortInfo */)).Findexv + uintptr(j1)*4)), *(*int32)(unsafe.Pointer(bp + 280 /* listc */)))))
	goto __201
__201:
	j1++
	goto __200
	goto __202
__202:
	;
	XTcl_ListObjAppendElement(tls, interp, listPtr, itemPtr)
	goto __191
__190:
	XTcl_ListObjAppendElement(tls, interp, listPtr, XTcl_NewIntObj(tls, i))
__191:
	;
__187:
	;
__185:
	;
	goto __137
__137:
	i++
	goto __136
	goto __138
__138:
	;
__103:
	;

	// Return everything or a single value.

	if !(allMatches != 0) {
		goto __203
	}
	XTcl_SetObjResult(tls, interp, listPtr)
	goto __204
__203:
	if !!(inlineReturn != 0) {
		goto __205
	}
	if !(returnSubindices != 0) {
		goto __207
	}

__209:
	;
__212:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __215
	}
	itemPtr = XTclThreadAllocObj(tls)
	goto __216
__215:
	itemPtr = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(itemPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__216:
	;
	goto __213
__213:
	if 0 != 0 {
		goto __212
	}
	goto __214
__214:
	;
	(*Tcl_Obj)(unsafe.Pointer(itemPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(itemPtr + 32)) = int64(*(*int32)(unsafe.Pointer(bp + 192)))
	(*Tcl_Obj)(unsafe.Pointer(itemPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __210
__210:
	if 0 != 0 {
		goto __209
	}
	goto __211
__211:
	;
	j2 = 0
__217:
	if !(j2 < (*SortInfo)(unsafe.Pointer(bp+208)).Findexc) {
		goto __219
	}
	XTcl_ListObjAppendElement(tls, interp, itemPtr, XTcl_NewIntObj(tls,
		XTclIndexDecode(tls, *(*int32)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+208 /* &sortInfo */)).Findexv + uintptr(j2)*4)), *(*int32)(unsafe.Pointer(bp + 280 /* listc */)))))
	goto __218
__218:
	j2++
	goto __217
	goto __219
__219:
	;
	XTcl_SetObjResult(tls, interp, itemPtr)
	goto __208
__207:
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 192 /* index */))))
__208:
	;
	goto __206
__205:
	if !(*(*int32)(unsafe.Pointer(bp + 192)) < 0) {
		goto __220
	}
	// Is this superfluous? The result should be a blank object by
	// default...

	XTcl_SetObjResult(tls, interp, XTcl_NewObj(tls))
	goto __221
__220:
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272 /* listv */)) + uintptr(*(*int32)(unsafe.Pointer(bp + 192 /* index */)))*8)))
__221:
	;
__206:
	;
__204:
	;
	result = TCL_OK

	// Cleanup the index list array.

done:
	if !((*SortInfo)(unsafe.Pointer(bp+208)).Findexc > 1) {
		goto __222
	}
	XTclStackFree(tls, interp, (*SortInfo)(unsafe.Pointer(bp+208 /* &sortInfo */)).Findexv)
__222:
	;
	return result
}

var options1 = [19]uintptr{
	ts + 14862, ts + 14867, ts + 14874, ts + 14882, ts + 14894,
	ts + 14906, ts + 14913, ts + 14919, ts + 14931,
	ts + 14938, ts + 14946, ts + 14955, ts + 14963,
	ts + 14968, ts + 14974, ts + 14982, ts + 14990,
	ts + 14997, uintptr(0),
} /* tclCmdIL.c:2908:23 */

//----------------------------------------------------------------------
//
// Tcl_LsetObjCmd --
//
//	This procedure is invoked to process the "lset" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LsetObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:3561:1: */
	var listPtr uintptr       // Pointer to the list being altered.
	var finalValuePtr uintptr // Value finally assigned to the variable.

	// Check parameter count.

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv,
			ts+15009)
		return TCL_ERROR
	}

	// Look up the list variable's value.

	listPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), TCL_LEAVE_ERR_MSG)
	if listPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Substitute the value in the value. Return either the value or else an
	// unshared copy of it.

	if objc == 4 {
		finalValuePtr = XTclLsetList(tls, interp, listPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	} else {
		finalValuePtr = XTclLsetFlat(tls, interp, listPtr, objc-3, objv+uintptr(2)*8,
			*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))
	}

	// If substitution has failed, bail out.

	if finalValuePtr == uintptr(0) {
		return TCL_ERROR
	}

	// Finally, update the variable so that traces fire.

	listPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), finalValuePtr,
		TCL_LEAVE_ERR_MSG)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = finalValuePtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if listPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Return the new value of the variable as the interpreter result.

	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_LsortObjCmd --
//
//	This procedure is invoked to process the "lsort" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LsortObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdIL.c:3646:1: */
	bp := tls.Alloc(672)
	defer tls.Free(672)

	var i int32
	var j int32
	// var index int32 at bp+296, 4

	var indices int32
	// var length int32 at bp+400, 4

	var nocase int32
	var indexc int32
	var sortMode int32
	var group int32
	// var groupSize int32 at bp+320, 4

	var groupOffset int32
	var idx int32
	var allocatedIndexVector int32
	var resultPtr uintptr
	var cmdPtr uintptr
	// var listObjPtrs uintptr at bp+392, 8

	var listObj uintptr
	var indexPtr uintptr
	var elmArrSize Size_t
	var elementArray uintptr
	var elementPtr uintptr
	// var sortInfo SortInfo at bp+336, 56
	// Information about this sort that needs to
	// be passed to the comparison function.
	// var subList [31]uintptr at bp+408, 248

	// var encoded int32 at bp+316, 4

	var result int32
	// var sortindex int32 at bp+312, 4

	// var indexv uintptr at bp+304, 8

	// var indexv1 uintptr at bp+328, 8

	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var newCommandPtr uintptr
	var newObjPtr uintptr
	// var a Tcl_WideInt at bp+656, 8

	// var a1 float64 at bp+664, 8

	var cachePtr4 uintptr
	var cachePtr5 uintptr
	var listRepPtr uintptr
	var newArray uintptr
	var objPtr uintptr
	var cachePtr6 uintptr
	var cachePtr7 uintptr
	nocase = 0
	sortMode = SORTMODE_ASCII
	allocatedIndexVector = 0
	elementArray = uintptr(0)

	if !(objc < 2) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15043)
	return TCL_ERROR
__1:
	;

	// Parse arguments to set up the mode for the sort.

	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FisIncreasing = 1
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FsortMode = SORTMODE_ASCII
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Findexv = uintptr(0)
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Findexc = 0
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Funique = 0
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Finterp = interp
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_OK
	cmdPtr = uintptr(0)
	indices = 0
	group = 0
	*(*int32)(unsafe.Pointer(bp + 320 /* groupSize */)) = 1
	groupOffset = 0
	indexPtr = uintptr(0)
	i = 1
__2:
	if !(i < objc-1) {
		goto __4
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&switches)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+296) != TCL_OK) {
		goto __5
	}
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__5:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 296 /* index */))) {
	case uint32(0) /* LSORT_ASCII */ :
		goto __7
	case uint32(1) /* LSORT_COMMAND */ :
		goto __8
	case uint32(2) /* LSORT_DECREASING */ :
		goto __9
	case uint32(3) /* LSORT_DICTIONARY */ :
		goto __10
	case uint32(4) /* LSORT_INCREASING */ :
		goto __11
	case uint32(5) /* LSORT_INDEX */ :
		goto __12
	case uint32(7) /* LSORT_INTEGER */ :
		goto __13
	case uint32(8) /* LSORT_NOCASE */ :
		goto __14
	case uint32(9) /* LSORT_REAL */ :
		goto __15
	case uint32(11) /* LSORT_UNIQUE */ :
		goto __16
	case uint32(6) /* LSORT_INDICES */ :
		goto __17
	case uint32(10) /* LSORT_STRIDE */ :
		goto __18
	}
	goto __6
__7:
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FsortMode = SORTMODE_ASCII
	goto __6
__8:
	if !(i == objc-2) {
		goto __19
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+15068, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+13635, ts+14589, uintptr(0)))
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__19:
	;
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FsortMode = SORTMODE_COMMAND
	cmdPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	i++
	goto __6
__9:
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FisIncreasing = 0
	goto __6
__10:
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FsortMode = SORTMODE_DICTIONARY
	goto __6
__11:
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FisIncreasing = 1
	goto __6
__12:

	if !(i == objc-2) {
		goto __20
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+14597,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+13635, ts+14589, uintptr(0)))
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__20:
	;
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 304)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 312)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+312, bp+304)
	}() != TCL_OK) {
		goto __21
	}
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__21:
	;

	// Check each of the indices for syntactic correctness. Note that
	// we do not store the converted values here because we do not
	// know if this is the only -index option yet and so we can't
	// allocate any space; that happens after the scan through all the
	// options is done.

	j = 0
__22:
	if !(j < *(*int32)(unsafe.Pointer(bp + 312))) {
		goto __24
	}
	*(*int32)(unsafe.Pointer(bp + 316 /* encoded */)) = 0
	result = XTclIndexEncode(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 304 /* indexv */)) + uintptr(j)*8)),
		-1, 0x7fffffff, bp+316)

	if !(result == TCL_OK && (*(*int32)(unsafe.Pointer(bp + 316)) == -1 ||
		*(*int32)(unsafe.Pointer(bp + 316)) == 0x7fffffff)) {
		goto __25
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+14644, libc.VaList(bp+64, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 304 /* indexv */)) + uintptr(j)*8))))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+6915,
		ts+14694, uintptr(0)))
	result = TCL_ERROR
__25:
	;
	if !(result == TCL_ERROR) {
		goto __26
	}
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+14710, libc.VaList(bp+104, j)))
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__26:
	;
	goto __23
__23:
	j++
	goto __22
	goto __24
__24:
	;
	indexPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	i++
	goto __6

__13:
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FsortMode = SORTMODE_INTEGER
	goto __6
__14:
	nocase = 1
	goto __6
__15:
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FsortMode = SORTMODE_REAL
	goto __6
__16:
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Funique = 1
	goto __6
__17:
	indices = 1
	goto __6
__18:
	if !(i == objc-2) {
		goto __27
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+15125, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+112, ts+3593, ts+13635, ts+14589, uintptr(0)))
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__27:
	;
	if !(XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+320) != TCL_OK) {
		goto __28
	}
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__28:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 320)) < 2) {
		goto __29
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+15176, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+144, ts+3593, ts+7420, ts+15209,
		ts+15215, uintptr(0)))
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__29:
	;
	group = 1
	i++
	goto __6
__6:
	;
	goto __3
__3:
	i++
	goto __2
	goto __4
__4:
	;
	if !(nocase != 0 && (*SortInfo)(unsafe.Pointer(bp+336)).FsortMode == SORTMODE_ASCII) {
		goto __30
	}
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FsortMode = SORTMODE_ASCII_NC
__30:
	;

	// Now extract the -index list for real, if present. No failures are
	// expected here; the values are all of the right type or convertible to
	// it.

	if !(indexPtr != 0) {
		goto __31
	}

	if (*Tcl_Obj)(unsafe.Pointer(indexPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 328)) = *(*uintptr)(unsafe.Pointer(indexPtr + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 336 + 24)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexPtr + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, interp, indexPtr, bp+336+24, bp+328)
	}
	switch (*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Findexc {
	case 0:
		goto __33
	case 1:
		goto __34
	default:
		goto __35
	}
	goto __32
__33:
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Findexv = uintptr(0)
	goto __32
__34:
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Findexv = bp + 336 + 28
	goto __32
__35:
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Findexv = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64((*SortInfo)(unsafe.Pointer(bp+336)).Findexc)))
	allocatedIndexVector = 1 // Cannot use indexc field, as it
	// might be decreased by 1 later.
__32:
	;
	j = 0
__36:
	if !(j < (*SortInfo)(unsafe.Pointer(bp+336)).Findexc) {
		goto __38
	}
	// Prescreened values, no errors or out of range possible
	XTclIndexEncode(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 328 /* indexv1 */)) + uintptr(j)*8)), 0, 0, (*SortInfo)(unsafe.Pointer(bp+336)).Findexv+uintptr(j)*4)
	goto __37
__37:
	j++
	goto __36
	goto __38
__38:
	;
__31:
	;

	listObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))

	if !((*SortInfo)(unsafe.Pointer(bp+336)).FsortMode == SORTMODE_COMMAND) {
		goto __39
	}

	// When sorting using a command, we are reentrant and therefore might
	// have the representation of the list being sorted shimmered out from
	// underneath our feet. Take a copy (cheap) to prevent this. [Bug
	// 1675116]

	listObj = XTclListObjCopy(tls, interp, listObj)
	if !(listObj == uintptr(0)) {
		goto __40
	}
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__40:
	;

	// The existing command is a list. We want to flatten it, append two
	// dummy arguments on the end, and replace these arguments later.

	newCommandPtr = XTcl_DuplicateObj(tls, cmdPtr)
__41:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __44
	}
	newObjPtr = XTclThreadAllocObj(tls)
	goto __45
__44:
	newObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(newObjPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__45:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
	(*Tcl_Obj)(unsafe.Pointer(newObjPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(newObjPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(newObjPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(newObjPtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(newCommandPtr)).FrefCount++
	if !(XTcl_ListObjAppendElement(tls, interp, newCommandPtr, newObjPtr) !=
		TCL_OK) {
		goto __46
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(newCommandPtr)).FrefCount, 1) > 1) {
		goto __47
	}
	goto __48
__47:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(newCommandPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(newCommandPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __49
	}

	if !((*Tcl_Obj)(unsafe.Pointer(newCommandPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(newCommandPtr)).Fbytes != XtclEmptyStringRep) {
		goto __51
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(newCommandPtr)).Fbytes)
__51:
	;
	(*Tcl_Obj)(unsafe.Pointer(newCommandPtr)).Flength = -1
__52:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __55
	}
	XTclThreadFreeObj(tls, newCommandPtr)
	goto __56
__55:
	*(*uintptr)(unsafe.Pointer(newCommandPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = newCommandPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__56:
	;
	goto __53
__53:
	if 0 != 0 {
		goto __52
	}
	goto __54
__54:
	;
	goto __50
__49:
	XTclFreeObj(tls, newCommandPtr)
__50:
	;
__48:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(listObj)).FrefCount, 1) > 1) {
		goto __57
	}
	goto __58
__57:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(listObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(listObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __59
	}

	if !((*Tcl_Obj)(unsafe.Pointer(listObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(listObj)).Fbytes != XtclEmptyStringRep) {
		goto __61
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(listObj)).Fbytes)
__61:
	;
	(*Tcl_Obj)(unsafe.Pointer(listObj)).Flength = -1
__62:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __65
	}
	XTclThreadFreeObj(tls, listObj)
	goto __66
__65:
	*(*uintptr)(unsafe.Pointer(listObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = listObj
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__66:
	;
	goto __63
__63:
	if 0 != 0 {
		goto __62
	}
	goto __64
__64:
	;
	goto __60
__59:
	XTclFreeObj(tls, listObj)
__60:
	;
__58:
	;

	(*Tcl_Obj)(unsafe.Pointer(newObjPtr)).FrefCount++
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(newObjPtr)).FrefCount, 1) > 1) {
		goto __67
	}
	goto __68
__67:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(newObjPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(newObjPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __69
	}

	if !((*Tcl_Obj)(unsafe.Pointer(newObjPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(newObjPtr)).Fbytes != XtclEmptyStringRep) {
		goto __71
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(newObjPtr)).Fbytes)
__71:
	;
	(*Tcl_Obj)(unsafe.Pointer(newObjPtr)).Flength = -1
__72:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __75
	}
	XTclThreadFreeObj(tls, newObjPtr)
	goto __76
__75:
	*(*uintptr)(unsafe.Pointer(newObjPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = newObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__76:
	;
	goto __73
__73:
	if 0 != 0 {
		goto __72
	}
	goto __74
__74:
	;
	goto __70
__69:
	XTclFreeObj(tls, newObjPtr)
__70:
	;
__68:
	;

	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__46:
	;
	XTcl_ListObjAppendElement(tls, interp, newCommandPtr, XTcl_NewObj(tls))
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FcompareCmdPtr = newCommandPtr
__39:
	;

	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(listObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 392)) = *(*uintptr)(unsafe.Pointer(listObj + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 400)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(listObj + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, listObj, bp+400, bp+392)
	}()
	if !((*SortInfo)(unsafe.Pointer(bp+336)).FresultCode != TCL_OK || *(*int32)(unsafe.Pointer(bp + 400)) <= 0) {
		goto __77
	}
	goto done
__77:
	;

	// Check for sanity when grouping elements of the overall list together
	// because of the -stride option. [TIP #326]

	if !(group != 0) {
		goto __78
	}
	if !(*(*int32)(unsafe.Pointer(bp + 400))%*(*int32)(unsafe.Pointer(bp + 320)) != 0) {
		goto __79
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+15225,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+184, ts+3593, ts+7420, ts+15209, ts+15215,
		uintptr(0)))
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__79:
	;
	*(*int32)(unsafe.Pointer(bp + 400 /* length */)) = *(*int32)(unsafe.Pointer(bp + 400)) / *(*int32)(unsafe.Pointer(bp + 320))
	if !((*SortInfo)(unsafe.Pointer(bp+336)).Findexc > 0) {
		goto __80
	}
	// Use the first value in the list supplied to -index as the
	// offset of the element within each group by which to sort.

	groupOffset = XTclIndexDecode(tls, *(*int32)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Findexv)), *(*int32)(unsafe.Pointer(bp + 320))-1)
	if !(groupOffset < 0 || groupOffset >= *(*int32)(unsafe.Pointer(bp + 320))) {
		goto __81
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+15275, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+224, ts+3593, ts+7420, ts+15209,
		ts+15353, uintptr(0)))
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__81:
	;
	if !((*SortInfo)(unsafe.Pointer(bp+336)).Findexc == 1) {
		goto __82
	}
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Findexc = 0
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Findexv = uintptr(0)
	goto __83
__82:
	(*SortInfo)(unsafe.Pointer(bp+336 /* &sortInfo */)).Findexc--

	// Do not shrink the actual memory block used; that doesn't
	// work with TclStackAlloc-allocated memory. [Bug 2918962]
	//
	// TODO: Consider a pointer increment to replace this
	// array shift.

	i = 0
__84:
	if !(i < (*SortInfo)(unsafe.Pointer(bp+336)).Findexc) {
		goto __86
	}
	*(*int32)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+336 /* &sortInfo */)).Findexv + uintptr(i)*4)) = *(*int32)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+336 /* &sortInfo */)).Findexv + uintptr(i+1)*4))
	goto __85
__85:
	i++
	goto __84
	goto __86
__86:
	;
__83:
	;
__80:
	;
__78:
	;

	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FnumElements = *(*int32)(unsafe.Pointer(bp + 400 /* length */))

	indexc = (*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).Findexc
	sortMode = (*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FsortMode
	if !(sortMode == SORTMODE_ASCII_NC ||
		sortMode == SORTMODE_DICTIONARY) {
		goto __87
	}
	// For this function's purpose all string-based modes are equivalent

	sortMode = SORTMODE_ASCII
__87:
	;

	// Initialize the sublists. After the following loop, subList[i] will
	// contain a sorted sublist of length 2**i. Use one extra subList at the
	// end, always at NULL, to indicate the end of the lists.

	j = 0
__88:
	if !(j <= NUM_LISTS) {
		goto __90
	}
	*(*uintptr)(unsafe.Pointer(bp + 408 + uintptr(j)*8)) = uintptr(0)
	goto __89
__89:
	j++
	goto __88
	goto __90
__90:
	;

	// The following loop creates a SortElement for each list element and
	// begins sorting it into the sublists as it appears.

	elmArrSize = uint64(*(*int32)(unsafe.Pointer(bp + 400))) * uint64(unsafe.Sizeof(SortElement{}))
	if !(elmArrSize <= uint64(MAXCALLOC)) {
		goto __91
	}
	elementArray = XTcl_Alloc(tls, uint32(elmArrSize))
	goto __92
__91:
	elementArray = libc.Xmalloc(tls, elmArrSize)
__92:
	;
	if !!(elementArray != 0) {
		goto __93
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+15362, libc.VaList(bp+264, *(*int32)(unsafe.Pointer(bp + 400 /* length */)))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+272, ts+3593, ts+14496, uintptr(0)))
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__93:
	;

	i = 0
__94:
	if !(i < *(*int32)(unsafe.Pointer(bp + 400))) {
		goto __96
	}
	idx = *(*int32)(unsafe.Pointer(bp + 320))*i + groupOffset
	if !(indexc != 0) {
		goto __97
	}
	// If this is an indexed sort, retrieve the corresponding element
	indexPtr = sSelectObjFromSublist(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 392 /* listObjPtrs */)) + uintptr(idx)*8)), bp+336)
	if !((*SortInfo)(unsafe.Pointer(bp+336)).FresultCode != TCL_OK) {
		goto __99
	}
	goto done
__99:
	;
	goto __98
__97:
	indexPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 392 /* listObjPtrs */)) + uintptr(idx)*8))
__98:
	;

	// Determine the "value" of this object for sorting purposes

	if !(sortMode == SORTMODE_ASCII) {
		goto __100
	}
	*(*uintptr)(unsafe.Pointer(elementArray + uintptr(i)*24)) = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(indexPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(indexPtr)).Fbytes
		}
		return XTcl_GetString(tls, indexPtr)
	}()
	goto __101
__100:
	if !(sortMode == SORTMODE_INTEGER) {
		goto __102
	}

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(indexPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp + 656)) = *(*int64)(unsafe.Pointer(indexPtr + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, (*SortInfo)(unsafe.Pointer(bp+336)).Finterp, indexPtr, bp+656)
	}() != TCL_OK) {
		goto __104
	}
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__104:
	;
	*(*Tcl_WideInt)(unsafe.Pointer(elementArray + uintptr(i)*24)) = *(*Tcl_WideInt)(unsafe.Pointer(bp + 656 /* a */))
	goto __103
__102:
	if !(sortMode == SORTMODE_REAL) {
		goto __105
	}

	if !(XTcl_GetDoubleFromObj(tls, (*SortInfo)(unsafe.Pointer(bp+336)).Finterp, indexPtr,
		bp+664) != TCL_OK) {
		goto __107
	}
	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode = TCL_ERROR
	goto done
__107:
	;
	*(*float64)(unsafe.Pointer(elementArray + uintptr(i)*24)) = *(*float64)(unsafe.Pointer(bp + 664 /* a1 */))
	goto __106
__105:
	*(*uintptr)(unsafe.Pointer(elementArray + uintptr(i)*24)) = indexPtr
__106:
	;
__103:
	;
__101:
	;

	// Determine the representation of this element in the result: either
	// the objPtr itself, or its index in the original list.

	if !(indices != 0 || group != 0) {
		goto __108
	}
	*(*int32)(unsafe.Pointer(elementArray + uintptr(i)*24 + 8)) = idx
	goto __109
__108:
	*(*uintptr)(unsafe.Pointer(elementArray + uintptr(i)*24 + 8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 392 /* listObjPtrs */)) + uintptr(idx)*8))
__109:
	;

	// Merge this element in the pre-existing sublists (and merge together
	// sublists when we have two of the same size).

	(*SortElement)(unsafe.Pointer(elementArray + uintptr(i)*24)).FnextPtr = uintptr(0)
	elementPtr = elementArray + uintptr(i)*24
	j = 0
__110:
	if !(*(*uintptr)(unsafe.Pointer(bp + 408 + uintptr(j)*8)) != 0) {
		goto __112
	}
	elementPtr = sMergeLists(tls, *(*uintptr)(unsafe.Pointer(bp + 408 + uintptr(j)*8)), elementPtr, bp+336)
	*(*uintptr)(unsafe.Pointer(bp + 408 + uintptr(j)*8)) = uintptr(0)
	goto __111
__111:
	j++
	goto __110
	goto __112
__112:
	;
	if !(j >= NUM_LISTS) {
		goto __113
	}
	j = NUM_LISTS - 1
__113:
	;
	*(*uintptr)(unsafe.Pointer(bp + 408 + uintptr(j)*8)) = elementPtr
	goto __95
__95:
	i++
	goto __94
	goto __96
__96:
	;

	// Merge all sublists

	elementPtr = *(*uintptr)(unsafe.Pointer(bp + 408))
	j = 1
__114:
	if !(j < NUM_LISTS) {
		goto __116
	}
	elementPtr = sMergeLists(tls, *(*uintptr)(unsafe.Pointer(bp + 408 + uintptr(j)*8)), elementPtr, bp+336)
	goto __115
__115:
	j++
	goto __114
	goto __116
__116:
	;

	// Now store the sorted elements in the result list.

	if !((*SortInfo)(unsafe.Pointer(bp+336)).FresultCode == TCL_OK) {
		goto __117
	}

	resultPtr = XTcl_NewListObj(tls, (*SortInfo)(unsafe.Pointer(bp+336)).FnumElements**(*int32)(unsafe.Pointer(bp + 320)), uintptr(0))
	listRepPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
	newArray = listRepPtr + 16
	if !(group != 0) {
		goto __118
	}
	i = 0
__120:
	if !(elementPtr != uintptr(0)) {
		goto __122
	}
	idx = *(*int32)(unsafe.Pointer(elementPtr + 8))
	j = 0
__123:
	if !(j < *(*int32)(unsafe.Pointer(bp + 320))) {
		goto __125
	}
	if !(indices != 0) {
		goto __126
	}
__128:
	;
__131:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0
	}()) {
		goto __134
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __135
__134:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects--
__135:
	;
	goto __132
__132:
	if 0 != 0 {
		goto __131
	}
	goto __133
__133:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(idx + j - groupOffset)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __129
__129:
	if 0 != 0 {
		goto __128
	}
	goto __130
__130:
	;
	*(*uintptr)(unsafe.Pointer(newArray + uintptr(libc.PostIncInt32(&i, 1))*8)) = objPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	goto __127
__126:
	objPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 392 /* listObjPtrs */)) + uintptr(idx+j-groupOffset)*8))
	*(*uintptr)(unsafe.Pointer(newArray + uintptr(libc.PostIncInt32(&i, 1))*8)) = objPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
__127:
	;
	goto __124
__124:
	j++
	goto __123
	goto __125
__125:
	;
	goto __121
__121:
	elementPtr = (*SortElement)(unsafe.Pointer(elementPtr)).FnextPtr
	goto __120
	goto __122
__122:
	;
	goto __119
__118:
	if !(indices != 0) {
		goto __136
	}
	i = 0
__138:
	if !(elementPtr != uintptr(0)) {
		goto __140
	}
__141:
	;
__144:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0
	}()) {
		goto __147
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __148
__147:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects--
__148:
	;
	goto __145
__145:
	if 0 != 0 {
		goto __144
	}
	goto __146
__146:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(*(*int32)(unsafe.Pointer(elementPtr + 8)))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __142
__142:
	if 0 != 0 {
		goto __141
	}
	goto __143
__143:
	;
	*(*uintptr)(unsafe.Pointer(newArray + uintptr(libc.PostIncInt32(&i, 1))*8)) = objPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	goto __139
__139:
	elementPtr = (*SortElement)(unsafe.Pointer(elementPtr)).FnextPtr
	goto __138
	goto __140
__140:
	;
	goto __137
__136:
	i = 0
__149:
	if !(elementPtr != uintptr(0)) {
		goto __151
	}
	objPtr = *(*uintptr)(unsafe.Pointer(elementPtr + 8))
	*(*uintptr)(unsafe.Pointer(newArray + uintptr(libc.PostIncInt32(&i, 1))*8)) = objPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	goto __150
__150:
	elementPtr = (*SortElement)(unsafe.Pointer(elementPtr)).FnextPtr
	goto __149
	goto __151
__151:
	;
__137:
	;
__119:
	;
	(*List)(unsafe.Pointer(listRepPtr)).FelemCount = i
	XTcl_SetObjResult(tls, interp, resultPtr)
__117:
	;

done:
	if !(sortMode == SORTMODE_COMMAND) {
		goto __152
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+336)).FcompareCmdPtr)).FrefCount, 1) > 1) {
		goto __153
	}
	goto __154
__153:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+336)).FcompareCmdPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+336)).FcompareCmdPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __155
	}

	if !((*Tcl_Obj)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+336)).FcompareCmdPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+336)).FcompareCmdPtr)).Fbytes != XtclEmptyStringRep) {
		goto __157
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+336)).FcompareCmdPtr)).Fbytes)
__157:
	;
	(*Tcl_Obj)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp + 336)).FcompareCmdPtr)).Flength = -1
__158:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __161
	}
	XTclThreadFreeObj(tls, (*SortInfo)(unsafe.Pointer(bp+336)).FcompareCmdPtr)
	goto __162
__161:
	*(*uintptr)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(bp+336)).FcompareCmdPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = (*SortInfo)(unsafe.Pointer(bp + 336)).FcompareCmdPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++
__162:
	;
	goto __159
__159:
	if 0 != 0 {
		goto __158
	}
	goto __160
__160:
	;
	goto __156
__155:
	XTclFreeObj(tls, (*SortInfo)(unsafe.Pointer(bp+336 /* &sortInfo */)).FcompareCmdPtr)
__156:
	;
__154:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(listObj)).FrefCount, 1) > 1) {
		goto __163
	}
	goto __164
__163:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(listObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(listObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __165
	}

	if !((*Tcl_Obj)(unsafe.Pointer(listObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(listObj)).Fbytes != XtclEmptyStringRep) {
		goto __167
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(listObj)).Fbytes)
__167:
	;
	(*Tcl_Obj)(unsafe.Pointer(listObj)).Flength = -1
__168:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr7 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __171
	}
	XTclThreadFreeObj(tls, listObj)
	goto __172
__171:
	*(*uintptr)(unsafe.Pointer(listObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = listObj
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++
__172:
	;
	goto __169
__169:
	if 0 != 0 {
		goto __168
	}
	goto __170
__170:
	;
	goto __166
__165:
	XTclFreeObj(tls, listObj)
__166:
	;
__164:
	;

	(*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FcompareCmdPtr = uintptr(0)
__152:
	;
	if !(allocatedIndexVector != 0) {
		goto __173
	}
	XTclStackFree(tls, interp, (*SortInfo)(unsafe.Pointer(bp+336 /* &sortInfo */)).Findexv)
__173:
	;
	if !(elementArray != 0) {
		goto __174
	}
	if !(elmArrSize <= uint64(MAXCALLOC)) {
		goto __175
	}
	XTclpFree(tls, elementArray)
	goto __176
__175:
	libc.Xfree(tls, elementArray)
__176:
	;
__174:
	;
	return (*SortInfo)(unsafe.Pointer(bp + 336 /* &sortInfo */)).FresultCode
}

var switches = [13]uintptr{
	ts + 14867, ts + 15408, ts + 14882, ts + 14894, ts + 14919,
	ts + 14931, ts + 15417, ts + 14946, ts + 14955, ts + 14968, ts + 15426,
	ts + 15434, uintptr(0),
} /* tclCmdIL.c:3667:23 */

//----------------------------------------------------------------------
//
// MergeLists -
//
//	This procedure combines two sorted lists of SortElement structures
//	into a single sorted list.
//
// Results:
//	The unified list of SortElement structures.
//
// Side effects:
//	If infoPtr->unique is set then infoPtr->numElements may be updated.
//	Possibly others, if a user-defined comparison command does something
//	weird.
//
// Note:
//	If infoPtr->unique is set, the merge assumes that there are no
//	"repeated" elements in each of the left and right lists. In that case,
//	if any element of the left list is equivalent to one in the right list
//	it is omitted from the merged list.
//
//	This simplified mechanism works because of the special way our
//	MergeSort creates the sublists to be merged and will fail to eliminate
//	all repeats in the general case where they are already present in
//	either the left or right list. A general code would need to skip
//	adjacent initial repeats in the left and right lists before comparing
//	their initial elements, at each step.
//
//----------------------------------------------------------------------

func sMergeLists(tls *libc.TLS, leftPtr uintptr, rightPtr uintptr, infoPtr uintptr) uintptr { /* tclCmdIL.c:4169:20: */
	var headPtr uintptr
	var tailPtr uintptr
	var cmp int32

	if leftPtr == uintptr(0) {
		return rightPtr
	}
	if rightPtr == uintptr(0) {
		return leftPtr
	}
	cmp = sSortCompare(tls, leftPtr, rightPtr, infoPtr)
	if cmp > 0 || cmp == 0 && (*SortInfo)(unsafe.Pointer(infoPtr)).Funique != 0 {
		if cmp == 0 {
			(*SortInfo)(unsafe.Pointer(infoPtr)).FnumElements--
			leftPtr = (*SortElement)(unsafe.Pointer(leftPtr)).FnextPtr
		}
		tailPtr = rightPtr
		rightPtr = (*SortElement)(unsafe.Pointer(rightPtr)).FnextPtr
	} else {
		tailPtr = leftPtr
		leftPtr = (*SortElement)(unsafe.Pointer(leftPtr)).FnextPtr
	}
	headPtr = tailPtr
	if !((*SortInfo)(unsafe.Pointer(infoPtr)).Funique != 0) {
		for leftPtr != uintptr(0) && rightPtr != uintptr(0) {
			cmp = sSortCompare(tls, leftPtr, rightPtr, infoPtr)
			if cmp > 0 {
				(*SortElement)(unsafe.Pointer(tailPtr)).FnextPtr = rightPtr
				tailPtr = rightPtr
				rightPtr = (*SortElement)(unsafe.Pointer(rightPtr)).FnextPtr
			} else {
				(*SortElement)(unsafe.Pointer(tailPtr)).FnextPtr = leftPtr
				tailPtr = leftPtr
				leftPtr = (*SortElement)(unsafe.Pointer(leftPtr)).FnextPtr
			}
		}
	} else {
		for leftPtr != uintptr(0) && rightPtr != uintptr(0) {
			cmp = sSortCompare(tls, leftPtr, rightPtr, infoPtr)
			if cmp >= 0 {
				if cmp == 0 {
					(*SortInfo)(unsafe.Pointer(infoPtr)).FnumElements--
					leftPtr = (*SortElement)(unsafe.Pointer(leftPtr)).FnextPtr
				}
				(*SortElement)(unsafe.Pointer(tailPtr)).FnextPtr = rightPtr
				tailPtr = rightPtr
				rightPtr = (*SortElement)(unsafe.Pointer(rightPtr)).FnextPtr
			} else {
				(*SortElement)(unsafe.Pointer(tailPtr)).FnextPtr = leftPtr
				tailPtr = leftPtr
				leftPtr = (*SortElement)(unsafe.Pointer(leftPtr)).FnextPtr
			}
		}
	}
	if leftPtr != uintptr(0) {
		(*SortElement)(unsafe.Pointer(tailPtr)).FnextPtr = leftPtr
	} else {
		(*SortElement)(unsafe.Pointer(tailPtr)).FnextPtr = rightPtr
	}
	return headPtr
}

//----------------------------------------------------------------------
//
// SortCompare --
//
//	This procedure is invoked by MergeLists to determine the proper
//	ordering between two elements.
//
// Results:
//	A negative results means the the first element comes before the
//	second, and a positive results means that the second element should
//	come first. A result of zero means the two elements are equal and it
//	doesn't matter which comes first.
//
// Side effects:
//	None, unless a user-defined comparison command does something weird.
//
//----------------------------------------------------------------------

func sSortCompare(tls *libc.TLS, elemPtr1 uintptr, elemPtr2 uintptr, infoPtr uintptr) int32 { /* tclCmdIL.c:4258:1: */
	bp := tls.Alloc(76)
	defer tls.Free(76)

	*(*int32)(unsafe.Pointer(bp + 72 /* order */)) = 0

	if (*SortInfo)(unsafe.Pointer(infoPtr)).FsortMode == SORTMODE_ASCII {
		*(*int32)(unsafe.Pointer(bp + 72 /* order */)) = libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(elemPtr1)),
			*(*uintptr)(unsafe.Pointer(elemPtr2)))
	} else if (*SortInfo)(unsafe.Pointer(infoPtr)).FsortMode == SORTMODE_ASCII_NC {
		*(*int32)(unsafe.Pointer(bp + 72 /* order */)) = XTclUtfCasecmp(tls, *(*uintptr)(unsafe.Pointer(elemPtr1)),
			*(*uintptr)(unsafe.Pointer(elemPtr2)))
	} else if (*SortInfo)(unsafe.Pointer(infoPtr)).FsortMode == SORTMODE_DICTIONARY {
		*(*int32)(unsafe.Pointer(bp + 72 /* order */)) = sDictionaryCompare(tls, *(*uintptr)(unsafe.Pointer(elemPtr1)),
			*(*uintptr)(unsafe.Pointer(elemPtr2)))
	} else if (*SortInfo)(unsafe.Pointer(infoPtr)).FsortMode == SORTMODE_INTEGER {
		var a Tcl_WideInt
		var b Tcl_WideInt

		a = *(*Tcl_WideInt)(unsafe.Pointer(elemPtr1))
		b = *(*Tcl_WideInt)(unsafe.Pointer(elemPtr2))
		*(*int32)(unsafe.Pointer(bp + 72 /* order */)) = libc.Bool32(a >= b) - libc.Bool32(a <= b)
	} else if (*SortInfo)(unsafe.Pointer(infoPtr)).FsortMode == SORTMODE_REAL {
		var a float64
		var b float64

		a = *(*float64)(unsafe.Pointer(elemPtr1))
		b = *(*float64)(unsafe.Pointer(elemPtr2))
		*(*int32)(unsafe.Pointer(bp + 72 /* order */)) = libc.Bool32(a >= b) - libc.Bool32(a <= b)
	} else {
		// var objv uintptr at bp+64, 8

		// var paramObjv [2]uintptr at bp+40, 16

		// var objc int32 at bp+56, 4

		var objPtr1 uintptr
		var objPtr2 uintptr

		if (*SortInfo)(unsafe.Pointer(infoPtr)).FresultCode != TCL_OK {
			// Once an error has occurred, skip any future comparisons so as
			// to preserve the error message in sortInterp->result.

			return 0
		}

		objPtr1 = *(*uintptr)(unsafe.Pointer(elemPtr1))
		objPtr2 = *(*uintptr)(unsafe.Pointer(elemPtr2))

		*(*uintptr)(unsafe.Pointer(bp + 40)) = objPtr1
		*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)) = objPtr2

		// We made space in the command list for the two things to compare.
		// Replace them and evaluate the result.

		if (*Tcl_Obj)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			*(*int32)(unsafe.Pointer(bp + 56)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32)))).FelemCount
		} else {
			XTcl_ListObjLength(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, (*SortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr, bp+56)
		}
		XTcl_ListObjReplace(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, (*SortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr, *(*int32)(unsafe.Pointer(bp + 56))-2,
			2, 2, bp+40)
		if (*Tcl_Obj)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			*(*uintptr)(unsafe.Pointer(bp + 64)) = *(*uintptr)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32)) + 16
			*(*int32)(unsafe.Pointer(bp + 56)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32)))).FelemCount
		} else {
			XTcl_ListObjGetElements(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, (*SortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr, bp+56, bp+64)
		}

		(*SortInfo)(unsafe.Pointer(infoPtr)).FresultCode = XTcl_EvalObjv(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, *(*int32)(unsafe.Pointer(bp + 56 /* objc */)), *(*uintptr)(unsafe.Pointer(bp + 64 /* objv */)), 0)

		if (*SortInfo)(unsafe.Pointer(infoPtr)).FresultCode != TCL_OK {
			XTcl_AddErrorInfo(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, ts+15442)
			return 0
		}

		// Parse the result of the command.

		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(XTcl_GetObjResult(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(XTcl_GetObjResult(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(XTcl_GetObjResult(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 72)) = int32(*(*int64)(unsafe.Pointer(XTcl_GetObjResult(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp) + 32)))
					return TCL_OK
				}()
			}
			return XTcl_GetIntFromObj(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, XTcl_GetObjResult(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp), bp+72)
		}() != TCL_OK {
			XTcl_SetObjResult(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, XTcl_NewStringObj(tls,
				ts+15466, -1))
			XTcl_SetErrorCode(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, libc.VaList(bp, ts+3593, ts+7420, ts+15209,
				ts+15511, uintptr(0)))
			(*SortInfo)(unsafe.Pointer(infoPtr)).FresultCode = TCL_ERROR
			return 0
		}
	}
	if !((*SortInfo)(unsafe.Pointer(infoPtr)).FisIncreasing != 0) {
		*(*int32)(unsafe.Pointer(bp + 72 /* order */)) = -*(*int32)(unsafe.Pointer(bp + 72 /* order */))
	}
	return *(*int32)(unsafe.Pointer(bp + 72 /* order */))
}

//----------------------------------------------------------------------
//
// DictionaryCompare
//
//	This function compares two strings as if they were being used in an
//	index or card catalog. The case of alphabetic characters is ignored,
//	except to break ties. Thus "B" comes before "b" but after "a". Also,
//	integers embedded in the strings compare in numerical order. In other
//	words, "x10y" comes after "x9y", not * before it as it would when
//	using strcmp().
//
// Results:
//	A negative result means that the first element comes before the
//	second, and a positive result means that the second element should
//	come first. A result of zero means the two elements are equal and it
//	doesn't matter which comes first.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sDictionaryCompare(tls *libc.TLS, left uintptr, right uintptr) int32 { /* tclCmdIL.c:4371:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	*(*int32)(unsafe.Pointer(bp /* uniLeft */)) = 0
	*(*int32)(unsafe.Pointer(bp + 4 /* uniRight */)) = 0
	var uniLeftLower int32
	var uniRightLower int32
	var diff int32
	var zeros int32
	var secondaryDiff int32 = 0

	for 1 != 0 {
		if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(right)))))*2)))&int32(X_ISdigit) != 0 &&
			int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(left)))))*2)))&int32(X_ISdigit) != 0 { // INTL: digit
			// There are decimal numbers embedded in the two strings. Compare
			// them as numbers, rather than strings. If one number has more
			// leading zeros than the other, the number with more leading
			// zeros sorts later, but only as a secondary choice.

			zeros = 0
			for int32(*(*int8)(unsafe.Pointer(right))) == '0' && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(right + 1)))))*2)))&int32(X_ISdigit) != 0 {
				right++
				zeros--
			}
			for int32(*(*int8)(unsafe.Pointer(left))) == '0' && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(left + 1)))))*2)))&int32(X_ISdigit) != 0 {
				left++
				zeros++
			}
			if secondaryDiff == 0 {
				secondaryDiff = zeros
			}

			// The code below compares the numbers in the two strings without
			// ever converting them to integers. It does this by first
			// comparing the lengths of the numbers and then comparing the
			// digit values.

			diff = 0
			for 1 != 0 {
				if diff == 0 {
					diff = int32(uint8(*(*int8)(unsafe.Pointer(left)))) - int32(uint8(*(*int8)(unsafe.Pointer(right))))
				}
				right++
				left++
				if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(right)))))*2)))&int32(X_ISdigit) != 0) { // INTL: digit
					if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(left)))))*2)))&int32(X_ISdigit) != 0 { // INTL: digit
						return 1
					} else {
						// The two numbers have the same length. See if their
						// values are different.

						if diff != 0 {
							return diff
						}
						break
					}
				} else if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(left)))))*2)))&int32(X_ISdigit) != 0) { // INTL: digit
					return -1
				}
			}
			continue
		}

		// Convert character to Unicode for comparison purposes. If either
		// string is at the terminating null, do a byte-wise comparison and
		// bail out immediately.

		if int32(*(*int8)(unsafe.Pointer(left))) != 0 && int32(*(*int8)(unsafe.Pointer(right))) != 0 {
			left += uintptr(XTclUtfToUCS4(tls, left, bp))
			right += uintptr(XTclUtfToUCS4(tls, right, bp+4))

			// Convert both chars to lower for the comparison, because
			// dictionary sorts are case insensitve. Covert to lower, not
			// upper, so chars between Z and a will sort before A (where most
			// other interesting punctuations occur).

			uniLeftLower = XTclUCS4ToLower(tls, *(*int32)(unsafe.Pointer(bp /* uniLeft */)))
			uniRightLower = XTclUCS4ToLower(tls, *(*int32)(unsafe.Pointer(bp + 4 /* uniRight */)))
		} else {
			diff = int32(uint8(*(*int8)(unsafe.Pointer(left)))) - int32(uint8(*(*int8)(unsafe.Pointer(right))))
			break
		}

		diff = uniLeftLower - uniRightLower
		if diff != 0 {
			return diff
		}
		if secondaryDiff == 0 {
			if XTcl_UniCharIsUpper(tls, *(*int32)(unsafe.Pointer(bp))) != 0 && XTcl_UniCharIsLower(tls, *(*int32)(unsafe.Pointer(bp + 4))) != 0 {
				secondaryDiff = -1
			} else if XTcl_UniCharIsUpper(tls, *(*int32)(unsafe.Pointer(bp + 4))) != 0 &&
				XTcl_UniCharIsLower(tls, *(*int32)(unsafe.Pointer(bp))) != 0 {
				secondaryDiff = 1
			}
		}
	}
	if diff == 0 {
		diff = secondaryDiff
	}
	return diff
}

//----------------------------------------------------------------------
//
// SelectObjFromSublist --
//
//	This procedure is invoked from lsearch and SortCompare. It is used for
//	implementing the -index option, for the lsort and lsearch commands.
//
// Results:
//	Returns NULL if a failure occurs, and sets the result in the infoPtr.
//	Otherwise returns the Tcl_Obj* to the item.
//
// Side effects:
//	None.
//
// Note:
//	No reference counting is done, as the result is only used internally
//	and never passed directly to user code.
//
//----------------------------------------------------------------------

func sSelectObjFromSublist(tls *libc.TLS, objPtr uintptr, infoPtr uintptr) uintptr { /* tclCmdIL.c:4501:16: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var i int32

	// Quick check for case when no "-index" option is there.

	if (*SortInfo)(unsafe.Pointer(infoPtr)).Findexc == 0 {
		return objPtr
	}

	// Iterate over the indices, traversing through the nested sublists as we
	// go.

	for i = 0; i < (*SortInfo)(unsafe.Pointer(infoPtr)).Findexc; i++ {
		// var listLen int32 at bp+56, 4

		var index int32
		// var currentObj uintptr at bp+64, 8

		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 56)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32)))).FelemCount
					return TCL_OK
				}()
			}
			return XTcl_ListObjLength(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, objPtr, bp+56)
		}() != TCL_OK {
			(*SortInfo)(unsafe.Pointer(infoPtr)).FresultCode = TCL_ERROR
			return uintptr(0)
		}

		index = XTclIndexDecode(tls, *(*int32)(unsafe.Pointer((*SortInfo)(unsafe.Pointer(infoPtr)).Findexv + uintptr(i)*4)), *(*int32)(unsafe.Pointer(bp + 56))-1)

		if XTcl_ListObjIndex(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, objPtr, index,
			bp+64) != TCL_OK {
			(*SortInfo)(unsafe.Pointer(infoPtr)).FresultCode = TCL_ERROR
			return uintptr(0)
		}
		if *(*uintptr)(unsafe.Pointer(bp + 64)) == uintptr(0) {
			XTcl_SetObjResult(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, XTcl_ObjPrintf(tls,
				ts+15528,
				libc.VaList(bp, index, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
					}
					return XTcl_GetString(tls, objPtr)
				}())))
			XTcl_SetErrorCode(tls, (*SortInfo)(unsafe.Pointer(infoPtr)).Finterp, libc.VaList(bp+16, ts+3593, ts+7420, ts+15209,
				ts+15565, uintptr(0)))
			(*SortInfo)(unsafe.Pointer(infoPtr)).FresultCode = TCL_ERROR
			return uintptr(0)
		}
		objPtr = *(*uintptr)(unsafe.Pointer(bp + 64 /* currentObj */))
	}
	return objPtr
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// End:

// Default set of characters to trim in [string trim] and friends. This is a
// UTF-8 literal string containing all Unicode space characters [TIP #413]

var XtclDefaultTrimSet =
// ASCII
//     nul (U+0000)
//     next line (U+0085)
//     non-breaking space (U+00a0)
// ogham space mark (U+1680)
// mongolian vowel separator (U+180e)
// en quad (U+2000)
// em quad (U+2001)
// en space (U+2002)
// em space (U+2003)
// three-per-em space (U+2004)
// four-per-em space (U+2005)
// six-per-em space (U+2006)
// figure space (U+2007)
// punctuation space (U+2008)
// thin space (U+2009)
// hair space (U+200a)
// zero width space (U+200b)
// line separator (U+2028)
// paragraph separator (U+2029)
// narrow no-break space (U+202f)
// medium mathematical space (U+205f)
// word joiner (U+2060)
// ideographic space (U+3000)
*(*[76]int8)(unsafe.Pointer(ts + 15577)) /* tclCmdMZ.c:38:12 */

//----------------------------------------------------------------------
//
// Tcl_PwdObjCmd --
//
//	This procedure is invoked to process the "pwd" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_PwdObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:84:1: */
	var retVal uintptr

	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}

	retVal = XTcl_FSGetCwd(tls, interp)
	if retVal == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, retVal)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = retVal
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_RegexpObjCmd --
//
//	This procedure is invoked to process the "regexp" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_RegexpObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:124:1: */
	bp := tls.Alloc(104)
	defer tls.Free(104)

	var i int32
	var indices int32
	var match int32
	var about int32
	// var offset int32 at bp+48, 4

	var all int32
	var doinline int32
	var numMatchesSaved int32
	var cflags int32
	var eflags int32
	var stringLength int32
	var matchLength int32
	var regExpr Tcl_RegExp
	var objPtr uintptr
	var startIndex uintptr
	var resultPtr uintptr
	// var info Tcl_RegExpInfo at bp+56, 32

	var _objPtr uintptr
	// var temp int32 at bp+44, 4

	var name uintptr
	// var index int32 at bp+40, 4

	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var cachePtr uintptr
	var start int32
	var end int32
	// var objs [2]uintptr at bp+88, 16

	var cachePtr1 uintptr
	var _objPtr3 uintptr
	var _objPtr4 uintptr
	var newPtr uintptr
	startIndex = uintptr(0)
	resultPtr = uintptr(0)

	indices = 0
	about = 0
	cflags = TCL_REG_ADVANCED
	*(*int32)(unsafe.Pointer(bp + 48 /* offset */)) = 0
	all = 0
	doinline = 0

	i = 1
__1:
	if !(i < objc) {
		goto __3
	}

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}()
	if !(int32(*(*int8)(unsafe.Pointer(name))) != '-') {
		goto __4
	}
	goto __3
__4:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options2)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp+40) != TCL_OK) {
		goto __5
	}
	goto optionError
__5:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 40 /* index */))) {
	case uint32(0) /* REGEXP_ALL */ :
		goto __7
	case uint32(2) /* REGEXP_INDICES */ :
		goto __8
	case uint32(3) /* REGEXP_INLINE */ :
		goto __9
	case uint32(8) /* REGEXP_NOCASE */ :
		goto __10
	case uint32(1) /* REGEXP_ABOUT */ :
		goto __11
	case uint32(4) /* REGEXP_EXPANDED */ :
		goto __12
	case uint32(5) /* REGEXP_LINE */ :
		goto __13
	case uint32(6) /* REGEXP_LINESTOP */ :
		goto __14
	case uint32(7) /* REGEXP_LINEANCHOR */ :
		goto __15
	case uint32(9) /* REGEXP_START */ :
		goto __16
	case uint32(10) /* REGEXP_LAST */ :
		goto __17
	}
	goto __6
__7:
	all = 1
	goto __6
__8:
	indices = 1
	goto __6
__9:
	doinline = 1
	goto __6
__10:
	cflags = cflags | TCL_REG_NOCASE
	goto __6
__11:
	about = 1
	goto __6
__12:
	cflags = cflags | TCL_REG_EXPANDED
	goto __6
__13:
	cflags = cflags | TCL_REG_NEWLINE
	goto __6
__14:
	cflags = cflags | TCL_REG_NLSTOP
	goto __6
__15:
	cflags = cflags | TCL_REG_NLANCH
	goto __6
__16:
	if !(libc.PreIncInt32(&i, 1) >= objc) {
		goto __18
	}
	goto endOfForLoop
__18:
	;
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 44)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), 0, bp+44)
	}() != TCL_OK) {
		goto __19
	}
	goto optionError
__19:
	;
	if !(startIndex != 0) {
		goto __20
	}
__21:
	_objPtr = startIndex
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __24
	}
	XTclFreeObj(tls, _objPtr)
__24:
	;
	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
__20:
	;
	startIndex = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	(*Tcl_Obj)(unsafe.Pointer(startIndex)).FrefCount++
	goto __6

__17:
	i++
	goto endOfForLoop
__6:
	;
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;

endOfForLoop:
	if !(objc-i < 2-about) {
		goto __25
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+15653)
	goto optionError
__25:
	;
	objc = objc - i
	objv += 8 * uintptr(i)

	// Check if the user requested -inline, but specified match variables; a
	// no-no.

	if !(doinline != 0 && objc-2 != 0) {
		goto __26
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+15707, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+15761,
		ts+15768, uintptr(0)))
	goto optionError
__26:
	;

	// Handle the odd about case separately.

	if !(about != 0) {
		goto __27
	}
	regExpr = XTcl_GetRegExpFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), cflags)
	if !(regExpr == uintptr(0) || XTclRegAbout(tls, interp, regExpr) < 0) {
		goto __28
	}
optionError:
	if !(startIndex != 0) {
		goto __29
	}
__30:
	_objPtr1 = startIndex
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __33
	}
	XTclFreeObj(tls, _objPtr1)
__33:
	;
	goto __31
__31:
	if 0 != 0 {
		goto __30
	}
	goto __32
__32:
	;
__29:
	;
	return TCL_ERROR
__28:
	;
	return TCL_OK
__27:
	;

	// Get the length of the string that we are matching against so we can do
	// the termination test for -all matches. Do this before getting the
	// regexp to avoid shimmering problems.

	objPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	stringLength = XTcl_GetCharLength(tls, objPtr)

	if !(startIndex != 0) {
		goto __34
	}
	if (*Tcl_Obj)(unsafe.Pointer(startIndex)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(startIndex + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(startIndex + 32)) <= int64(0x7fffffff) {
		*(*int32)(unsafe.Pointer(bp + 48)) = int32(*(*int64)(unsafe.Pointer(startIndex + 32)))
	} else {
		XTclGetIntForIndex(tls, uintptr(0), startIndex, stringLength, bp+48)
	}
__35:
	_objPtr2 = startIndex
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __38
	}
	XTclFreeObj(tls, _objPtr2)
__38:
	;
	goto __36
__36:
	if 0 != 0 {
		goto __35
	}
	goto __37
__37:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 48)) < 0) {
		goto __39
	}
	*(*int32)(unsafe.Pointer(bp + 48 /* offset */)) = 0
__39:
	;
__34:
	;

	regExpr = XTcl_GetRegExpFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), cflags)
	if !(regExpr == uintptr(0)) {
		goto __40
	}
	return TCL_ERROR
__40:
	;

	objc = objc - 2
	objv += 8 * uintptr(2)

	if !(doinline != 0) {
		goto __41
	}
	// Save all the subexpressions, as we will return them as a list

	numMatchesSaved = -1
	goto __42
__41:
	// Save only enough subexpressions for matches we want to keep, expect
	// in the case of -all, where we need to keep at least one to know
	// where to move the offset.

	if objc == 0 {
		numMatchesSaved = all
	} else {
		numMatchesSaved = objc
	}
__42:
	;

	// The following loop is to handle multiple matches within the same source
	// string; each iteration handles one match. If "-all" hasn't been
	// specified then the loop body only gets executed once. We terminate the
	// loop when the starting offset is past the end of the string.

__43:
	if !(1 != 0) {
		goto __44
	}
	// Pass either 0 or TCL_REG_NOTBOL in the eflags. Passing
	// TCL_REG_NOTBOL indicates that the character at offset should not be
	// considered the start of the line. If for example the pattern {^} is
	// passed and -start is positive, then the pattern will not match the
	// start of the string unless the previous character is a newline.

	if !(*(*int32)(unsafe.Pointer(bp + 48)) == 0) {
		goto __45
	}
	eflags = 0
	goto __46
__45:
	if !(*(*int32)(unsafe.Pointer(bp + 48)) > stringLength) {
		goto __47
	}
	eflags = TCL_REG_NOTBOL
	goto __48
__47:
	if !(int32(XTcl_GetUniChar(tls, objPtr, *(*int32)(unsafe.Pointer(bp + 48))-1)) == '\n') {
		goto __49
	}
	eflags = 0
	goto __50
__49:
	eflags = TCL_REG_NOTBOL
__50:
	;
__48:
	;
__46:
	;

	match = XTcl_RegExpExecObj(tls, interp, regExpr, objPtr, *(*int32)(unsafe.Pointer(bp + 48 /* offset */)),
		numMatchesSaved, eflags)
	if !(match < 0) {
		goto __51
	}
	return TCL_ERROR
__51:
	;

	if !(match == 0) {
		goto __52
	}
	// We want to set the value of the intepreter result only when
	// this is the first time through the loop.

	if !(all <= 1) {
		goto __53
	}
	// If inlining, the interpreter's object result remains an
	// empty list, otherwise set it to an integer object w/ value
	// 0.

	if !!(doinline != 0) {
		goto __54
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, 0))
__54:
	;
	return TCL_OK
__53:
	;
	goto __44
__52:
	;

	// If additional variable names have been specified, return index
	// information in those variables.

	XTcl_RegExpGetInfo(tls, regExpr, bp+56)
	if !(doinline != 0) {
		goto __55
	}
	// It's the number of substitutions, plus one for the matchVar at
	// index 0

	objc = (*Tcl_RegExpInfo)(unsafe.Pointer(bp+56)).Fnsubs + 1
	if !(all <= 1) {
		goto __56
	}
__57:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __60
	}
	resultPtr = XTclThreadAllocObj(tls)
	goto __61
__60:
	resultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__61:
	;
	goto __58
__58:
	if 0 != 0 {
		goto __57
	}
	goto __59
__59:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = uintptr(0)

__56:
	;
__55:
	;
	i = 0
__62:
	if !(i < objc) {
		goto __64
	}

	if !(indices != 0) {
		goto __65
	}

	// Only adjust the match area if there was a match for that
	// area. (Scriptics Bug 4391/SF Bug #219232)

	if !(i <= (*Tcl_RegExpInfo)(unsafe.Pointer(bp+56)).Fnsubs && (*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+56)).Fmatches+uintptr(i)*16)).Fstart >= int64(0)) {
		goto __67
	}
	start = int32(int64(*(*int32)(unsafe.Pointer(bp + 48))) + (*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+56)).Fmatches+uintptr(i)*16)).Fstart)
	end = int32(int64(*(*int32)(unsafe.Pointer(bp + 48))) + (*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+56)).Fmatches+uintptr(i)*16)).Fend)

	// Adjust index so it refers to the last character in the
	// match instead of the first character after the match.

	if !(end >= *(*int32)(unsafe.Pointer(bp + 48))) {
		goto __69
	}
	end--
__69:
	;
	goto __68
__67:
	start = -1
	end = -1
__68:
	;

	*(*uintptr)(unsafe.Pointer(bp + 88)) = XTcl_NewLongObj(tls, int64(start))
	*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)) = XTcl_NewLongObj(tls, int64(end))

	newPtr = XTcl_NewListObj(tls, 2, bp+88)
	goto __66
__65:
	if !(i <= (*Tcl_RegExpInfo)(unsafe.Pointer(bp+56)).Fnsubs) {
		goto __70
	}
	newPtr = XTcl_GetRange(tls, objPtr,
		int32(int64(*(*int32)(unsafe.Pointer(bp + 48)))+(*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+56)).Fmatches+uintptr(i)*16)).Fstart),
		int32(int64(*(*int32)(unsafe.Pointer(bp + 48)))+(*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+56)).Fmatches+uintptr(i)*16)).Fend-int64(1)))
	goto __71
__70:
	;
__72:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __75
	}
	newPtr = XTclThreadAllocObj(tls)
	goto __76
__75:
	newPtr = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(newPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__76:
	;
	goto __73
__73:
	if 0 != 0 {
		goto __72
	}
	goto __74
__74:
	;
	(*Tcl_Obj)(unsafe.Pointer(newPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(newPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(newPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(newPtr)).FtypePtr = uintptr(0)

__71:
	;
__66:
	;
	if !(doinline != 0) {
		goto __77
	}
	if !(XTcl_ListObjAppendElement(tls, interp, resultPtr, newPtr) !=
		TCL_OK) {
		goto __79
	}
__80:
	_objPtr3 = newPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __83
	}
	XTclFreeObj(tls, _objPtr3)
__83:
	;
	goto __81
__81:
	if 0 != 0 {
		goto __80
	}
	goto __82
__82:
	;
__84:
	_objPtr4 = resultPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __87
	}
	XTclFreeObj(tls, _objPtr4)
__87:
	;
	goto __85
__85:
	if 0 != 0 {
		goto __84
	}
	goto __86
__86:
	;
	return TCL_ERROR
__79:
	;
	goto __78
__77:
	if !(XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(0), newPtr,
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __88
	}
	return TCL_ERROR
__88:
	;
__78:
	;
	goto __63
__63:
	i++
	goto __62
	goto __64
__64:
	;

	if !(all == 0) {
		goto __89
	}
	goto __44
__89:
	;

	// Adjust the offset to the character just after the last one in the
	// matchVar and increment all to count how many times we are making a
	// match. We always increment the offset by at least one to prevent
	// endless looping (as in the case: regexp -all {a*} a). Otherwise,
	// when we match the NULL string at the end of the input string, we
	// will loop indefinately (because the length of the match is 0, so
	// offset never changes).

	matchLength = int32((*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+56)).Fmatches)).Fend - (*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+56)).Fmatches)).Fstart)

	*(*int32)(unsafe.Pointer(bp + 48 /* offset */)) += int32((*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp + 56 /* &info */)).Fmatches)).Fend)

	// A match of length zero could happen for {^} {$} or {.*} and in
	// these cases we always want to bump the index up one.

	if !(matchLength == 0) {
		goto __90
	}
	*(*int32)(unsafe.Pointer(bp + 48 /* offset */))++
__90:
	;
	all++
	if !(*(*int32)(unsafe.Pointer(bp + 48)) >= stringLength) {
		goto __91
	}
	goto __44
__91:
	;
	goto __43
__44:
	;

	// Set the interpreter's object result to an integer object with value 1
	// if -all wasn't specified, otherwise it's all-1 (the number of times
	// through the while - 1).

	if !(doinline != 0) {
		goto __92
	}
	XTcl_SetObjResult(tls, interp, resultPtr)
	goto __93
__92:
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, func() int32 {
		if all != 0 {
			return all - 1
		}
		return 1
	}()))
__93:
	;
	return TCL_OK
}

var options2 = [12]uintptr{
	ts + 14862, ts + 15783, ts + 15417, ts + 14938,
	ts + 15790, ts + 15800, ts + 15806, ts + 15816,
	ts + 14955, ts + 14990, ts + 15828, uintptr(0),
} /* tclCmdMZ.c:135:23 */

//----------------------------------------------------------------------
//
// Tcl_RegsubObjCmd --
//
//	This procedure is invoked to process the "regsub" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_RegsubObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:484:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	var idx int32
	var result int32
	var cflags int32
	var all int32
	// var wlen int32 at bp+16, 4

	// var wsublen int32 at bp+20, 4

	var numMatches int32
	// var offset int32 at bp+8, 4

	var start int32
	var end int32
	var subStart int32
	var subEnd int32
	var match int32
	var regExpr Tcl_RegExp
	// var info Tcl_RegExpInfo at bp+24, 32

	var resultPtr uintptr
	var subPtr uintptr
	var objPtr uintptr
	var startIndex uintptr
	var ch Tcl_UniChar
	var wsrc uintptr
	var wfirstChar uintptr
	var wstring uintptr
	var wsubspec uintptr
	var wend uintptr
	var _objPtr uintptr
	// var temp int32 at bp+4, 4

	var name uintptr
	// var index int32 at bp, 4

	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var stringLength int32
	// This is a simple one pair string map situation. We make use of a
	// slightly modified version of the one pair STR_MAP code.

	// var slen int32 at bp+12, 4

	var nocase int32
	var strCmpFn uintptr
	var p uintptr
	var wsrclc Tcl_UniChar
	var _objPtr3 uintptr
	var _objPtr4 uintptr
	var _objPtr5 uintptr
	startIndex = uintptr(0)

	cflags = TCL_REG_ADVANCED
	all = 0
	*(*int32)(unsafe.Pointer(bp + 8 /* offset */)) = 0
	resultPtr = uintptr(0)

	idx = 1
__1:
	if !(idx < objc) {
		goto __3
	}

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)))
	}()
	if !(int32(*(*int8)(unsafe.Pointer(name))) != '-') {
		goto __4
	}
	goto __3
__4:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)), uintptr(unsafe.Pointer(&options3)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp) != TCL_OK) {
		goto __5
	}
	goto optionError
__5:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp /* index */))) {
	case uint32(0) /* REGSUB_ALL */ :
		goto __7
	case uint32(1) /* REGSUB_NOCASE */ :
		goto __8
	case uint32(2) /* REGSUB_EXPANDED */ :
		goto __9
	case uint32(3) /* REGSUB_LINE */ :
		goto __10
	case uint32(4) /* REGSUB_LINESTOP */ :
		goto __11
	case uint32(5) /* REGSUB_LINEANCHOR */ :
		goto __12
	case uint32(6) /* REGSUB_START */ :
		goto __13
	case uint32(7) /* REGSUB_LAST */ :
		goto __14
	}
	goto __6
__7:
	all = 1
	goto __6
__8:
	cflags = cflags | TCL_REG_NOCASE
	goto __6
__9:
	cflags = cflags | TCL_REG_EXPANDED
	goto __6
__10:
	cflags = cflags | TCL_REG_NEWLINE
	goto __6
__11:
	cflags = cflags | TCL_REG_NLSTOP
	goto __6
__12:
	cflags = cflags | TCL_REG_NLANCH
	goto __6
__13:
	if !(libc.PreIncInt32(&idx, 1) >= objc) {
		goto __15
	}
	goto endOfForLoop
__15:
	;
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)), 0, bp+4)
	}() != TCL_OK) {
		goto __16
	}
	goto optionError
__16:
	;
	if !(startIndex != 0) {
		goto __17
	}
__18:
	_objPtr = startIndex
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __21
	}
	XTclFreeObj(tls, _objPtr)
__21:
	;
	goto __19
__19:
	if 0 != 0 {
		goto __18
	}
	goto __20
__20:
	;
__17:
	;
	startIndex = *(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8))
	(*Tcl_Obj)(unsafe.Pointer(startIndex)).FrefCount++
	goto __6

__14:
	idx++
	goto endOfForLoop
__6:
	;
	goto __2
__2:
	idx++
	goto __1
	goto __3
__3:
	;

endOfForLoop:
	if !(objc-idx < 3 || objc-idx > 4) {
		goto __22
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+15831)
optionError:
	if !(startIndex != 0) {
		goto __23
	}
__24:
	_objPtr1 = startIndex
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __27
	}
	XTclFreeObj(tls, _objPtr1)
__27:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
__23:
	;
	return TCL_ERROR
__22:
	;

	objc = objc - idx
	objv += 8 * uintptr(idx)

	if !(startIndex != 0) {
		goto __28
	}
	stringLength = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))

	if (*Tcl_Obj)(unsafe.Pointer(startIndex)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(startIndex + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(startIndex + 32)) <= int64(0x7fffffff) {
		*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(startIndex + 32)))
	} else {
		XTclGetIntForIndex(tls, uintptr(0), startIndex, stringLength, bp+8)
	}
__29:
	_objPtr2 = startIndex
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __32
	}
	XTclFreeObj(tls, _objPtr2)
__32:
	;
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 8)) < 0) {
		goto __33
	}
	*(*int32)(unsafe.Pointer(bp + 8 /* offset */)) = 0
__33:
	;
__28:
	;

	if !(all != 0 && *(*int32)(unsafe.Pointer(bp + 8)) == 0 &&
		libc.Xstrpbrk(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}(), ts+15874) == uintptr(0) &&
		libc.Xstrpbrk(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
		}(), ts+15877) == uintptr(0)) {
		goto __34
	}

	numMatches = 0
	nocase = cflags & TCL_REG_NOCASE
	if nocase != 0 {
		strCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, uint64) int32
		}{XTcl_UniCharNcasecmp}))
	} else {
		strCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, uint64) int32
		}{XTcl_UniCharNcmp}))
	}

	wsrc = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), bp+12)
	wstring = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16)
	wsubspec = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+20)
	wend = wstring + uintptr(*(*int32)(unsafe.Pointer(bp + 16)))*2 - uintptr(func() int32 {
		if *(*int32)(unsafe.Pointer(bp + 12)) != 0 {
			return *(*int32)(unsafe.Pointer(bp + 12)) - 1
		}
		return 0
	}())*2
	result = TCL_OK

	if !(*(*int32)(unsafe.Pointer(bp + 12)) == 0) {
		goto __35
	}
	// regsub behavior for "" matches between each character. 'string
	// map' skips the "" case.

	if !(wstring < wend) {
		goto __37
	}
	resultPtr = XTcl_NewUnicodeObj(tls, wstring, 0)
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
__38:
	if !(wstring < wend) {
		goto __40
	}
	XTcl_AppendUnicodeToObj(tls, resultPtr, wsubspec, *(*int32)(unsafe.Pointer(bp + 20 /* wsublen */)))
	XTcl_AppendUnicodeToObj(tls, resultPtr, wstring, 1)
	numMatches++
	goto __39
__39:
	wstring += 2
	goto __38
	goto __40
__40:
	;
	*(*int32)(unsafe.Pointer(bp + 16 /* wlen */)) = 0
__37:
	;
	goto __36
__35:
	wsrclc = XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(wsrc))))
	p = libc.AssignUintptr(&wfirstChar, wstring)
__41:
	if !(wstring < wend) {
		goto __43
	}
	if !((int32(*(*Tcl_UniChar)(unsafe.Pointer(wstring))) == int32(*(*Tcl_UniChar)(unsafe.Pointer(wsrc))) || nocase != 0 && int32(XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(wstring))))) == int32(wsrclc)) && (*(*int32)(unsafe.Pointer(bp + 12)) == 1 || (*struct {
		f func(*libc.TLS, uintptr, uintptr, uint64) int32
	})(unsafe.Pointer(&struct{ uintptr }{strCmpFn})).f(tls, wstring, wsrc,
		uint64(*(*int32)(unsafe.Pointer(bp + 12)))) == 0)) {
		goto __44
	}
	if !(numMatches == 0) {
		goto __45
	}
	resultPtr = XTcl_NewUnicodeObj(tls, wstring, 0)
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
__45:
	;
	if !(p != wstring) {
		goto __46
	}
	XTcl_AppendUnicodeToObj(tls, resultPtr, p, int32((int64(wstring)-int64(p))/2))
	p = wstring + uintptr(*(*int32)(unsafe.Pointer(bp + 12)))*2
	goto __47
__46:
	p += 2 * uintptr(*(*int32)(unsafe.Pointer(bp + 12)))
__47:
	;
	wstring = p - uintptr(1)*2

	XTcl_AppendUnicodeToObj(tls, resultPtr, wsubspec, *(*int32)(unsafe.Pointer(bp + 20 /* wsublen */)))
	numMatches++
__44:
	;
	goto __42
__42:
	wstring += 2
	goto __41
	goto __43
__43:
	;
	if !(numMatches != 0) {
		goto __48
	}
	*(*int32)(unsafe.Pointer(bp + 16 /* wlen */)) = int32((int64(wfirstChar+uintptr(*(*int32)(unsafe.Pointer(bp + 16)))*2) - int64(p)) / 2)
	wstring = p
__48:
	;
__36:
	;
	objPtr = uintptr(0)
	subPtr = uintptr(0)
	goto regsubDone
__34:
	;

	regExpr = XTcl_GetRegExpFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), cflags)
	if !(regExpr == uintptr(0)) {
		goto __49
	}
	return TCL_ERROR
__49:
	;

	// Make sure to avoid problems where the objects are shared. This can
	// cause RegExpObj <> UnicodeObj shimmering that causes data corruption.
	// [Bug #461322]

	if !(*(*uintptr)(unsafe.Pointer(objv + 1*8)) == *(*uintptr)(unsafe.Pointer(objv))) {
		goto __50
	}
	objPtr = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	goto __51
__50:
	objPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
__51:
	;
	wstring = XTcl_GetUnicodeFromObj(tls, objPtr, bp+16)
	if !(*(*uintptr)(unsafe.Pointer(objv + 2*8)) == *(*uintptr)(unsafe.Pointer(objv))) {
		goto __52
	}
	subPtr = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	goto __53
__52:
	subPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8))
__53:
	;
	wsubspec = XTcl_GetUnicodeFromObj(tls, subPtr, bp+20)

	result = TCL_OK

	// The following loop is to handle multiple matches within the same source
	// string; each iteration handles one match and its corresponding
	// substitution. If "-all" hasn't been specified then the loop body only
	// gets executed once. We must use 'offset <= wlen' in particular for the
	// case where the regexp pattern can match the empty string - this is
	// useful when doing, say, 'regsub -- ^ $str ...' when $str might be
	// empty.

	numMatches = 0
__54:
	if !(*(*int32)(unsafe.Pointer(bp + 8)) <= *(*int32)(unsafe.Pointer(bp + 16))) {
		goto __56
	}

	// The flags argument is set if string is part of a larger string, so
	// that "^" won't match.

	match = XTcl_RegExpExecObj(tls, interp, regExpr, objPtr, *(*int32)(unsafe.Pointer(bp + 8 /* offset */)),
		10, func() int32 {
			if *(*int32)(unsafe.Pointer(bp + 8)) > 0 && int32(*(*Tcl_UniChar)(unsafe.Pointer(wstring + uintptr(*(*int32)(unsafe.Pointer(bp + 8))-1)*2))) != int32(Tcl_UniChar('\n')) {
				return TCL_REG_NOTBOL
			}
			return 0
		}())

	if !(match < 0) {
		goto __57
	}
	result = TCL_ERROR
	goto done
__57:
	;
	if !(match == 0) {
		goto __58
	}
	goto __56
__58:
	;
	if !(numMatches == 0) {
		goto __59
	}
	resultPtr = XTcl_NewUnicodeObj(tls, wstring, 0)
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
	if !(*(*int32)(unsafe.Pointer(bp + 8)) > 0) {
		goto __60
	}
	// Copy the initial portion of the string in if an offset was
	// specified.

	XTcl_AppendUnicodeToObj(tls, resultPtr, wstring, *(*int32)(unsafe.Pointer(bp + 8 /* offset */)))
__60:
	;
__59:
	;
	numMatches++

	// Copy the portion of the source string before the match to the
	// result variable.

	XTcl_RegExpGetInfo(tls, regExpr, bp+24)
	start = int32((*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp + 24 /* &info */)).Fmatches)).Fstart)
	end = int32((*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp + 24 /* &info */)).Fmatches)).Fend)
	XTcl_AppendUnicodeToObj(tls, resultPtr, wstring+uintptr(*(*int32)(unsafe.Pointer(bp + 8)))*2, start)

	// Append the subSpec argument to the variable, making appropriate
	// substitutions. This code is a bit hairy because of the backslash
	// conventions and because the code saves up ranges of characters in
	// subSpec to reduce the number of calls to Tcl_SetVar.

	wsrc = libc.AssignUintptr(&wfirstChar, wsubspec)
	wend = wsubspec + uintptr(*(*int32)(unsafe.Pointer(bp + 20)))*2
	ch = *(*Tcl_UniChar)(unsafe.Pointer(wsrc))
__61:
	if !(wsrc != wend) {
		goto __63
	}
	if !(int32(ch) == '&') {
		goto __64
	}
	idx = 0
	goto __65
__64:
	if !(int32(ch) == '\\') {
		goto __66
	}
	ch = *(*Tcl_UniChar)(unsafe.Pointer(wsrc + 1*2))
	if !(int32(ch) >= '0' && int32(ch) <= '9') {
		goto __68
	}
	idx = int32(ch) - '0'
	goto __69
__68:
	if !(int32(ch) == '\\' || int32(ch) == '&') {
		goto __70
	}
	*(*Tcl_UniChar)(unsafe.Pointer(wsrc)) = ch
	XTcl_AppendUnicodeToObj(tls, resultPtr, wfirstChar,
		int32((int64(wsrc)-int64(wfirstChar))/2+int64(1)))
	*(*Tcl_UniChar)(unsafe.Pointer(wsrc)) = Tcl_UniChar('\\')
	wfirstChar = wsrc + uintptr(2)*2
	wsrc += 2
	goto __62
	goto __71
__70:
	goto __62
__71:
	;
__69:
	;
	goto __67
__66:
	goto __62
__67:
	;
__65:
	;

	if !(wfirstChar != wsrc) {
		goto __72
	}
	XTcl_AppendUnicodeToObj(tls, resultPtr, wfirstChar,
		int32((int64(wsrc)-int64(wfirstChar))/2))
__72:
	;

	if !(idx <= (*Tcl_RegExpInfo)(unsafe.Pointer(bp+24)).Fnsubs) {
		goto __73
	}
	subStart = int32((*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+24 /* &info */)).Fmatches + uintptr(idx)*16)).Fstart)
	subEnd = int32((*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+24 /* &info */)).Fmatches + uintptr(idx)*16)).Fend)
	if !(subStart >= 0 && subEnd >= 0) {
		goto __74
	}
	XTcl_AppendUnicodeToObj(tls, resultPtr,
		wstring+uintptr(*(*int32)(unsafe.Pointer(bp + 8)))*2+uintptr(subStart)*2, subEnd-subStart)
__74:
	;
__73:
	;

	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(wsrc))) == '\\') {
		goto __75
	}
	wsrc += 2
__75:
	;
	wfirstChar = wsrc + uintptr(1)*2
	goto __62
__62:
	wsrc += 2
	ch = *(*Tcl_UniChar)(unsafe.Pointer(wsrc))
	goto __61
	goto __63
__63:
	;

	if !(wfirstChar != wsrc) {
		goto __76
	}
	XTcl_AppendUnicodeToObj(tls, resultPtr, wfirstChar, int32((int64(wsrc)-int64(wfirstChar))/2))
__76:
	;

	if !(end == 0) {
		goto __77
	}
	// Always consume at least one character of the input string in
	// order to prevent infinite loops.

	if !(*(*int32)(unsafe.Pointer(bp + 8)) < *(*int32)(unsafe.Pointer(bp + 16))) {
		goto __79
	}
	XTcl_AppendUnicodeToObj(tls, resultPtr, wstring+uintptr(*(*int32)(unsafe.Pointer(bp + 8)))*2, 1)
__79:
	;
	*(*int32)(unsafe.Pointer(bp + 8 /* offset */))++
	goto __78
__77:
	*(*int32)(unsafe.Pointer(bp + 8 /* offset */)) += end
	if !(start == end) {
		goto __80
	}
	// We matched an empty string, which means we must go forward
	// one more step so we don't match again at the same spot.

	if !(*(*int32)(unsafe.Pointer(bp + 8)) < *(*int32)(unsafe.Pointer(bp + 16))) {
		goto __81
	}
	XTcl_AppendUnicodeToObj(tls, resultPtr, wstring+uintptr(*(*int32)(unsafe.Pointer(bp + 8)))*2, 1)
__81:
	;
	*(*int32)(unsafe.Pointer(bp + 8 /* offset */))++
__80:
	;
__78:
	;
	if !!(all != 0) {
		goto __82
	}
	goto __56
__82:
	;
	goto __55
__55:
	;
	goto __54
	goto __56
__56:
	;

	// Copy the portion of the source string after the last match to the
	// result variable.

regsubDone:
	if !(numMatches == 0) {
		goto __83
	}
	// On zero matches, just ignore the offset, since it shouldn't matter
	// to us in this case, and the user may have skewed it.

	resultPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
	goto __84
__83:
	if !(*(*int32)(unsafe.Pointer(bp + 8)) < *(*int32)(unsafe.Pointer(bp + 16))) {
		goto __85
	}
	XTcl_AppendUnicodeToObj(tls, resultPtr, wstring+uintptr(*(*int32)(unsafe.Pointer(bp + 8)))*2, *(*int32)(unsafe.Pointer(bp + 16))-*(*int32)(unsafe.Pointer(bp + 8)))
__85:
	;
__84:
	;
	if !(objc == 4) {
		goto __86
	}
	if !(XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), uintptr(0), resultPtr,
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __88
	}
	result = TCL_ERROR
	goto __89
__88:
	// Set the interpreter's object result to an integer object
	// holding the number of matches.

	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, numMatches))
__89:
	;
	goto __87
__86:
	// No varname supplied, so just return the modified string.

	XTcl_SetObjResult(tls, interp, resultPtr)
__87:
	;

done:
	if !(objPtr != 0 && *(*uintptr)(unsafe.Pointer(objv + 1*8)) == *(*uintptr)(unsafe.Pointer(objv))) {
		goto __90
	}
__91:
	_objPtr3 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __94
	}
	XTclFreeObj(tls, _objPtr3)
__94:
	;
	goto __92
__92:
	if 0 != 0 {
		goto __91
	}
	goto __93
__93:
	;
__90:
	;
	if !(subPtr != 0 && *(*uintptr)(unsafe.Pointer(objv + 2*8)) == *(*uintptr)(unsafe.Pointer(objv))) {
		goto __95
	}
__96:
	_objPtr4 = subPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __99
	}
	XTclFreeObj(tls, _objPtr4)
__99:
	;
	goto __97
__97:
	if 0 != 0 {
		goto __96
	}
	goto __98
__98:
	;
__95:
	;
	if !(resultPtr != 0) {
		goto __100
	}
__101:
	_objPtr5 = resultPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __104
	}
	XTclFreeObj(tls, _objPtr5)
__104:
	;
	goto __102
__102:
	if 0 != 0 {
		goto __101
	}
	goto __103
__103:
	;
__100:
	;
	return result
}

var options3 = [9]uintptr{
	ts + 14862, ts + 14955, ts + 15790,
	ts + 15800, ts + 15806, ts + 15816, ts + 14990,
	ts + 15828, uintptr(0),
} /* tclCmdMZ.c:497:23 */

//----------------------------------------------------------------------
//
// Tcl_RenameObjCmd --
//
//	This procedure is invoked to process the "rename" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_RenameObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:892:1: */
	var oldName uintptr
	var newName uintptr

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15892)
		return TCL_ERROR
	}

	oldName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	newName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()
	return XTclRenameCommand(tls, interp, oldName, newName)
}

//----------------------------------------------------------------------
//
// Tcl_ReturnObjCmd --
//
//	This object-based procedure is invoked to process the "return" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_ReturnObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:928:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var code int32 at bp+8, 4

	// var level int32 at bp+12, 4

	// var returnOpts uintptr at bp, 8

	// General syntax: [return ?-option value ...? ?result?]
	// An even number of words means an explicit result argument is present.

	var explicitResult int32 = libc.Bool32(0 == objc%2)
	var numOptionWords int32 = objc - 1 - explicitResult

	if TCL_ERROR == XTclMergeReturnOptions(tls, interp, numOptionWords, objv+uintptr(1)*8,
		bp, bp+8, bp+12) {
		return TCL_ERROR
	}

	*(*int32)(unsafe.Pointer(bp + 8 /* code */)) = XTclProcessReturn(tls, interp, *(*int32)(unsafe.Pointer(bp + 8 /* code */)), *(*int32)(unsafe.Pointer(bp + 12 /* level */)), *(*uintptr)(unsafe.Pointer(bp /* returnOpts */)))
	if explicitResult != 0 {
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))
	}
	return *(*int32)(unsafe.Pointer(bp + 8 /* code */))
}

//----------------------------------------------------------------------
//
// Tcl_SourceObjCmd --
//
//	This procedure is invoked to process the "source" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_SourceObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:975:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRSourceObjCmd})), dummy, objc, objv)
}

func XTclNRSourceObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:985:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var encodingName uintptr = uintptr(0)
	var fileName uintptr

	if objc != 2 && objc != 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15908)
		return TCL_ERROR
	}

	fileName = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))

	if objc == 4 {
		// var index int32 at bp, 4

		if TCL_ERROR == XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&options4)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp) {
			return TCL_ERROR
		}
		encodingName = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}()
	}

	return XTclNREvalFile(tls, interp, fileName, encodingName)
}

var options4 = [2]uintptr{
	ts + 15934, uintptr(0),
} /* tclCmdMZ.c:1002:20 */

//----------------------------------------------------------------------
//
// Tcl_SplitObjCmd --
//
//	This procedure is invoked to process the "split" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_SplitObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:1035:1: */
	bp := tls.Alloc(108)
	defer tls.Free(108)

	*(*Tcl_UniChar)(unsafe.Pointer(bp + 104 /* ch */)) = Tcl_UniChar(0)
	var len int32
	var splitChars uintptr
	var stringPtr uintptr
	var end uintptr
	// var splitCharLen int32 at bp, 4

	// var stringLen int32 at bp+4, 4

	var listPtr uintptr
	var objPtr uintptr

	if objc == 2 {
		splitChars = ts + 15944 /* " \n\t\r" */
		*(*int32)(unsafe.Pointer(bp /* splitCharLen */)) = 4
	} else if objc == 3 {
		splitChars = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp)
		}()
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15949)
		return TCL_ERROR
	}

	stringPtr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 4)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+4)
	}()
	end = stringPtr + uintptr(*(*int32)(unsafe.Pointer(bp + 4)))
	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			listPtr = XTclThreadAllocObj(tls)
		} else {
			listPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr = uintptr(0)
	{
	}

	if *(*int32)(unsafe.Pointer(bp + 4)) == 0 {
		// Do nothing.
	} else if *(*int32)(unsafe.Pointer(bp)) == 0 {
		// var charReuseTable Tcl_HashTable at bp+8, 88

		var hPtr uintptr
		// var isNew int32 at bp+100, 4

		// Handle the special case of splitting on every character.
		//
		// Uses a hash table to ensure that each kind of character has only
		// one Tcl_Obj instance (multiply-referenced) in the final list. This
		// is a *major* win when splitting on a long string (especially in the
		// megabyte range!) - DKF

		XTcl_InitHashTable(tls, bp+8, 1)

		for ; stringPtr < end; stringPtr += uintptr(len) {
			// var ucs4 int32 at bp+96, 4

			len = XTclUtfToUCS4(tls, stringPtr, bp+96)
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp + 8 /* &charReuseTable */)).FcreateProc})).f(tls, bp+8 /* &charReuseTable */, uintptr(Intptr_t(*(*int32)(unsafe.Pointer(bp + 96 /* ucs4 */)))), bp+100 /* &isNew */)
			if *(*int32)(unsafe.Pointer(bp + 100)) != 0 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							objPtr = XTclThreadAllocObj(tls)
						} else {
							objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
					if len == 0 {
						(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(len+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, stringPtr, uint64(len))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(len))) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = len
					}
					(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
					{
					}
				}

				// Don't need to fiddle with refcount...

				(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = objPtr
			} else {
				objPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), listPtr, objPtr)
		}
		XTcl_DeleteHashTable(tls, bp+8)

	} else if *(*int32)(unsafe.Pointer(bp)) == 1 {
		var p uintptr

		// Handle the special case of splitting on a single character. This is
		// only true for the one-char ASCII case, as one unicode char is > 1
		// byte in length.

		for *(*int8)(unsafe.Pointer(stringPtr)) != 0 && libc.AssignUintptr(&p, libc.Xstrchr(tls, stringPtr, int32(*(*int8)(unsafe.Pointer(splitChars))))) != uintptr(0) {
			objPtr = XTcl_NewStringObj(tls, stringPtr, int32((int64(p)-int64(stringPtr))/1))
			XTcl_ListObjAppendElement(tls, uintptr(0), listPtr, objPtr)
			stringPtr = p + uintptr(1)
		}
		for ok3 := true; ok3; ok3 = 0 != 0 {
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					objPtr = XTclThreadAllocObj(tls)
				} else {
					objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
			if (int64(end)-int64(stringPtr))/1 == int64(0) {
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32((int64(end)-int64(stringPtr))/1+int64(1)))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, stringPtr, uint64((int64(end)-int64(stringPtr))/1))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr((int64(end)-int64(stringPtr))/1))) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = int32((int64(end) - int64(stringPtr)) / 1)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
			{
			}
		}
		XTcl_ListObjAppendElement(tls, uintptr(0), listPtr, objPtr)
	} else {
		var element uintptr
		var p uintptr
		var splitEnd uintptr
		var splitLen int32
		*(*Tcl_UniChar)(unsafe.Pointer(bp + 106 /* splitChar */)) = Tcl_UniChar(0)

		// Normal case: split on any of a given set of characters. Discard
		// instances of the split characters.

		splitEnd = splitChars + uintptr(*(*int32)(unsafe.Pointer(bp)))

		for element = stringPtr; stringPtr < end; stringPtr += uintptr(len) {
			len = func() int32 {
				if int32(uint8(*(*int8)(unsafe.Pointer(stringPtr)))) < 0x80 {
					return func() int32 {
						*(*Tcl_UniChar)(unsafe.Pointer(bp + 104)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(stringPtr))))
						return 1
					}()
				}
				return XTcl_UtfToUniChar(tls, stringPtr, bp+104)
			}()
			for p = splitChars; p < splitEnd; p += uintptr(splitLen) {
				splitLen = func() int32 {
					if int32(uint8(*(*int8)(unsafe.Pointer(p)))) < 0x80 {
						return func() int32 {
							*(*Tcl_UniChar)(unsafe.Pointer(bp + 106)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(p))))
							return 1
						}()
					}
					return XTcl_UtfToUniChar(tls, p, bp+106)
				}()
				if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 104))) == int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 106))) {
					for ok5 := true; ok5; ok5 = 0 != 0 {
						for ok6 := true; ok6; ok6 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								objPtr = XTclThreadAllocObj(tls)
							} else {
								objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
						if (int64(stringPtr)-int64(element))/1 == int64(0) {
							(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32((int64(stringPtr)-int64(element))/1+int64(1)))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, element, uint64((int64(stringPtr)-int64(element))/1))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr((int64(stringPtr)-int64(element))/1))) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = int32((int64(stringPtr) - int64(element)) / 1)
						}
						(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
						{
						}
					}
					XTcl_ListObjAppendElement(tls, uintptr(0), listPtr, objPtr)
					element = stringPtr + uintptr(len)
					break
				}
			}
		}

		for ok7 := true; ok7; ok7 = 0 != 0 {
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					objPtr = XTclThreadAllocObj(tls)
				} else {
					objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
			if (int64(stringPtr)-int64(element))/1 == int64(0) {
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32((int64(stringPtr)-int64(element))/1+int64(1)))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, element, uint64((int64(stringPtr)-int64(element))/1))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr((int64(stringPtr)-int64(element))/1))) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = int32((int64(stringPtr) - int64(element)) / 1)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
			{
			}
		}
		XTcl_ListObjAppendElement(tls, uintptr(0), listPtr, objPtr)
	}
	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringFirstCmd --
//
//	This procedure is invoked to process the "string first" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringFirstCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:1170:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var needleStr uintptr
	var haystackStr uintptr
	var match int32
	// var start int32 at bp+8, 4

	// var needleLen int32 at bp, 4

	// var haystackLen int32 at bp+4, 4

	var p uintptr
	var end uintptr

	if !(objc < 3 || objc > 4) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+15969)
	return TCL_ERROR
__1:
	;

	// We are searching haystackStr for the sequence needleStr.

	match = -1
	*(*int32)(unsafe.Pointer(bp + 8 /* start */)) = 0
	*(*int32)(unsafe.Pointer(bp + 4 /* haystackLen */)) = -1

	needleStr = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	haystackStr = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+4)

	if !(objc == 4) {
		goto __2
	}
	// If a startIndex is specified, we will need to fast forward to that
	// point in the string before we think about a match.

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*int32)(unsafe.Pointer(bp + 4))-1, bp+8)
	}() != TCL_OK) {
		goto __3
	}
	return TCL_ERROR
__3:
	;

	// Reread to prevent shimmering problems.

	needleStr = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	haystackStr = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+4)

	if !(*(*int32)(unsafe.Pointer(bp + 8)) >= *(*int32)(unsafe.Pointer(bp + 4))) {
		goto __4
	}
	goto str_first_done
	goto __5
__4:
	if !(*(*int32)(unsafe.Pointer(bp + 8)) > 0) {
		goto __6
	}
	haystackStr += 2 * uintptr(*(*int32)(unsafe.Pointer(bp + 8)))
	*(*int32)(unsafe.Pointer(bp + 4 /* haystackLen */)) -= *(*int32)(unsafe.Pointer(bp + 8 /* start */))
	goto __7
__6:
	if !(*(*int32)(unsafe.Pointer(bp + 8)) < 0) {
		goto __8
	}
	// Invalid start index mapped to string start; Bug #423581

	*(*int32)(unsafe.Pointer(bp + 8 /* start */)) = 0
__8:
	;
__7:
	;
__5:
	;
__2:
	;

	// If the length of the needle is more than the length of the haystack, it
	// cannot be contained in there so we can avoid searching. [Bug 2960021]

	if !(*(*int32)(unsafe.Pointer(bp)) > 0 && *(*int32)(unsafe.Pointer(bp)) <= *(*int32)(unsafe.Pointer(bp + 4))) {
		goto __9
	}

	end = haystackStr + uintptr(*(*int32)(unsafe.Pointer(bp + 4)))*2 - uintptr(*(*int32)(unsafe.Pointer(bp)))*2 + uintptr(1)*2
	p = haystackStr
__10:
	if !(p < end) {
		goto __12
	}
	// Scan forward to find the first character.

	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(p))) == int32(*(*Tcl_UniChar)(unsafe.Pointer(needleStr))) && XTcl_UniCharNcmp(tls, needleStr, p,
		uint64(*(*int32)(unsafe.Pointer(bp)))) == 0) {
		goto __13
	}
	match = int32((int64(p) - int64(haystackStr)) / 2)
	goto __12
__13:
	;
	goto __11
__11:
	p += 2
	goto __10
	goto __12
__12:
	;
__9:
	;

	// Compute the character index of the matching string by counting the
	// number of characters before the match.

	if !(match != -1 && objc == 4) {
		goto __14
	}
	match = match + *(*int32)(unsafe.Pointer(bp + 8))
__14:
	;

str_first_done:
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, match))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringLastCmd --
//
//	This procedure is invoked to process the "string last" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringLastCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:1283:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var needleStr uintptr
	var haystackStr uintptr
	var p uintptr
	var match int32
	// var start int32 at bp+8, 4

	// var needleLen int32 at bp, 4

	// var haystackLen int32 at bp+4, 4

	if !(objc < 3 || objc > 4) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+15969)
	return TCL_ERROR
__1:
	;

	// We are searching haystackString for the sequence needleString.

	match = -1
	*(*int32)(unsafe.Pointer(bp + 8 /* start */)) = 0
	*(*int32)(unsafe.Pointer(bp + 4 /* haystackLen */)) = -1

	needleStr = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	haystackStr = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+4)

	if !(objc == 4) {
		goto __2
	}
	// If a startIndex is specified, we will need to restrict the string
	// range to that char index in the string

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*int32)(unsafe.Pointer(bp + 4))-1, bp+8)
	}() != TCL_OK) {
		goto __4
	}
	return TCL_ERROR
__4:
	;

	// Reread to prevent shimmering problems.

	needleStr = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	haystackStr = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+4)

	if !(*(*int32)(unsafe.Pointer(bp + 8)) < 0) {
		goto __5
	}
	goto str_last_done
	goto __6
__5:
	if !(*(*int32)(unsafe.Pointer(bp + 8)) < *(*int32)(unsafe.Pointer(bp + 4))) {
		goto __7
	}
	p = haystackStr + uintptr(*(*int32)(unsafe.Pointer(bp + 8)))*2 + uintptr(1)*2 - uintptr(*(*int32)(unsafe.Pointer(bp)))*2
	goto __8
__7:
	p = haystackStr + uintptr(*(*int32)(unsafe.Pointer(bp + 4)))*2 - uintptr(*(*int32)(unsafe.Pointer(bp)))*2
__8:
	;
__6:
	;
	goto __3
__2:
	p = haystackStr + uintptr(*(*int32)(unsafe.Pointer(bp + 4)))*2 - uintptr(*(*int32)(unsafe.Pointer(bp)))*2
__3:
	;

	// If the length of the needle is more than the length of the haystack, it
	// cannot be contained in there so we can avoid searching. [Bug 2960021]

	if !(*(*int32)(unsafe.Pointer(bp)) > 0 && *(*int32)(unsafe.Pointer(bp)) <= *(*int32)(unsafe.Pointer(bp + 4))) {
		goto __9
	}
__10:
	if !(p >= haystackStr) {
		goto __12
	}
	// Scan backwards to find the first character.

	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(p))) == int32(*(*Tcl_UniChar)(unsafe.Pointer(needleStr))) && !(libc.Xmemcmp(tls, needleStr, p,
		uint64(unsafe.Sizeof(Tcl_UniChar(0)))*Size_t(*(*int32)(unsafe.Pointer(bp)))) != 0)) {
		goto __13
	}
	match = int32((int64(p) - int64(haystackStr)) / 2)
	goto __12
__13:
	;
	goto __11
__11:
	p -= 2
	goto __10
	goto __12
__12:
	;
__9:
	;

str_last_done:
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, match))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringIndexCmd --
//
//	This procedure is invoked to process the "string index" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringIndexCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:1381:1: */
	bp := tls.Alloc(13)
	defer tls.Free(13)

	var length int32
	// var index int32 at bp, 4

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16010)
		return TCL_ERROR
	}

	// Get the char length to calulate what 'end' means.

	length = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), length-1, bp)
	}() != TCL_OK {
		return TCL_ERROR
	}

	if *(*int32)(unsafe.Pointer(bp)) >= 0 && *(*int32)(unsafe.Pointer(bp)) < length {
		var ch int32 = int32(XTcl_GetUniChar(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*int32)(unsafe.Pointer(bp /* index */))))

		// If we have a ByteArray object, we're careful to generate a new
		// bytearray for a result.

		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes == uintptr(0) {
			*(*uint8)(unsafe.Pointer(bp + 4 /* uch */)) = uint8(ch)

			XTcl_SetObjResult(tls, interp, XTcl_NewByteArrayObj(tls, bp+4, 1))
		} else {
			*(*[8]int8)(unsafe.Pointer(bp + 5 /* buf */)) = *(*[8]int8)(unsafe.Pointer(ts + 9818))

			length = XTclUCS4ToUtf(tls, ch, bp+5)
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, bp+5, length))
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringIsCmd --
//
//	This procedure is invoked to process the "string is" Tcl command. See
//	the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringIsCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:1444:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var string1 uintptr
	var end uintptr
	// var stop uintptr at bp+16, 8

	var chcomp uintptr // The UniChar comparison function.
	// var i int32 at bp+24, 4

	var failat int32
	var result int32
	var strict int32
	// var index int32 at bp, 4

	// var length1 int32 at bp+8, 4

	// var length2 int32 at bp+40, 4

	var objPtr uintptr
	var failVarObj uintptr
	// var w Tcl_WideInt at bp+32, 8

	// var idx2 int32 at bp+4, 4

	var cachePtr uintptr
	var cachePtr1 uintptr
	var tmpStr uintptr
	// Need to figure out where the list parsing failed, which is
	// fairly expensive. This is adapted from the core of
	// SetListFromAny().

	// var elemStart uintptr at bp+48, 8

	// var nextElem uintptr at bp+56, 8

	var lenRemain int32
	// var elemSize int32 at bp+64, 4

	var p uintptr
	// var ucs4 int32 at bp+68, 4
	chcomp = uintptr(0)
	failat = 0
	result = 1
	strict = 0
	failVarObj = uintptr(0)

	if !(objc < 3 || objc > 6) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+16027)
	return TCL_ERROR
__1:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&isClasses)), int32(unsafe.Sizeof(uintptr(0))), ts+16064, 0, bp) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	if !(objc != 3) {
		goto __3
	}
	*(*int32)(unsafe.Pointer(bp + 24 /* i */)) = 2
__4:
	if !(*(*int32)(unsafe.Pointer(bp + 24)) < objc-1) {
		goto __6
	}

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(*(*int32)(unsafe.Pointer(bp + 24)))*8)), uintptr(unsafe.Pointer(&isOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+4) != TCL_OK) {
		goto __7
	}
	return TCL_ERROR
__7:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 4 /* idx2 */))) {
	case uint32(0) /* OPT_STRICT */ :
		goto __9
	case uint32(1) /* OPT_FAILIDX */ :
		goto __10
	}
	goto __8
__9:
	strict = 1
	goto __8
__10:
	if !(*(*int32)(unsafe.Pointer(bp + 24))+1 >= objc-1) {
		goto __11
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv,
		ts+16070)
	return TCL_ERROR
__11:
	;
	failVarObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PreIncInt32(&*(*int32)(unsafe.Pointer(bp + 24 /* i */)), 1))*8))
	goto __8
__8:
	;
	goto __5
__5:
	*(*int32)(unsafe.Pointer(bp + 24 /* i */))++
	goto __4
	goto __6
__6:
	;
__3:
	;

	// We get the objPtr so that we can short-cut for some classes by checking
	// the object type (int and double), but we need the string otherwise,
	// because we don't want any conversion of type occuring (as, for example,
	// Tcl_Get*FromObj would do).

	objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))

	// When entering here, result == 1 and failat == 0.

	switch uint32(*(*int32)(unsafe.Pointer(bp /* index */))) {
	case uint32(0) /* STR_IS_ALNUM */ :
		goto __13
	case uint32(1) /* STR_IS_ALPHA */ :
		goto __14
	case uint32(2) /* STR_IS_ASCII */ :
		goto __15
	case uint32(4) /* STR_IS_BOOL */ :
		goto __16
	case uint32(16) /* STR_IS_TRUE */ :
		goto __17
	case uint32(8) /* STR_IS_FALSE */ :
		goto __18
	case uint32(3) /* STR_IS_CONTROL */ :
		goto __19
	case uint32(5) /* STR_IS_DIGIT */ :
		goto __20
	case uint32(6) /* STR_IS_DOUBLE */ :
		goto __21
	case uint32(9) /* STR_IS_GRAPH */ :
		goto __22
	case uint32(10) /* STR_IS_INT */ :
		goto __23
	case uint32(7) /* STR_IS_ENTIER */ :
		goto __24
	case uint32(18) /* STR_IS_WIDE */ :
		goto __25
	case uint32(11) /* STR_IS_LIST */ :
		goto __26
	case uint32(12) /* STR_IS_LOWER */ :
		goto __27
	case uint32(13) /* STR_IS_PRINT */ :
		goto __28
	case uint32(14) /* STR_IS_PUNCT */ :
		goto __29
	case uint32(15) /* STR_IS_SPACE */ :
		goto __30
	case uint32(17) /* STR_IS_UPPER */ :
		goto __31
	case uint32(19) /* STR_IS_WORD */ :
		goto __32
	case uint32(20) /* STR_IS_XDIGIT */ :
		goto __33
	}
	goto __12
__13:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{XTcl_UniCharIsAlnum}))
	goto __12
__14:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{XTcl_UniCharIsAlpha}))
	goto __12
__15:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{sUniCharIsAscii}))
	goto __12
__16:
__17:
__18:
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclBooleanType)) &&
		TCL_OK != XTclSetBooleanFromAny(tls, uintptr(0), objPtr)) {
		goto __34
	}
	if !(strict != 0) {
		goto __36
	}
	result = 0
	goto __37
__36:
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 8)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp+8)
	}()
	result = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 8)) == 0)
__37:
	;
	goto __35
__34:
	if !(*(*int32)(unsafe.Pointer(bp)) == 16 && *(*int64)(unsafe.Pointer(objPtr + 32)) == int64(0) ||
		*(*int32)(unsafe.Pointer(bp)) == 8 && *(*int64)(unsafe.Pointer(objPtr + 32)) != int64(0)) {
		goto __38
	}
	result = 0
__38:
	;
__35:
	;
	goto __12
__19:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{XTcl_UniCharIsControl}))
	goto __12
__20:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{XTcl_UniCharIsDigit}))
	goto __12
__21:
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) || (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) || (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType))) {
		goto __39
	}
	goto __12
__39:
	;
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 8)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp+8)
	}()
	if !(*(*int32)(unsafe.Pointer(bp + 8)) == 0) {
		goto __40
	}
	if !(strict != 0) {
		goto __41
	}
	result = 0
__41:
	;
	goto str_is_done
__40:
	;
	end = string1 + uintptr(*(*int32)(unsafe.Pointer(bp + 8)))
	if !(XTclParseNumber(tls, uintptr(0), objPtr, uintptr(0), uintptr(0), -1,
		bp+16, 0) != TCL_OK) {
		goto __42
	}
	result = 0
	failat = 0
	goto __43
__42:
	failat = int32((int64(*(*uintptr)(unsafe.Pointer(bp + 16))) - int64(string1)) / 1)
	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) < end) {
		goto __44
	}
	result = 0
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __45
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __46
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__46:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__45:
	;

__44:
	;
__43:
	;
	goto __12

__22:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{XTcl_UniCharIsGraph}))
	goto __12
__23:
	if !(TCL_OK == func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(objPtr + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(objPtr + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 24)) = int32(*(*int64)(unsafe.Pointer(objPtr + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, uintptr(0), objPtr, bp+24)
	}()) {
		goto __47
	}
	goto __12
__47:
	;
	goto failedIntParse
__24:
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) || (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType))) {
		goto __48
	}
	goto __12
__48:
	;
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 8)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp+8)
	}()
	if !(*(*int32)(unsafe.Pointer(bp + 8)) == 0) {
		goto __49
	}
	if !(strict != 0) {
		goto __50
	}
	result = 0
__50:
	;
	goto str_is_done
__49:
	;
	end = string1 + uintptr(*(*int32)(unsafe.Pointer(bp + 8)))
	if !(XTclParseNumber(tls, uintptr(0), objPtr, uintptr(0), uintptr(0), -1,
		bp+16, TCL_PARSE_INTEGER_ONLY) == TCL_OK) {
		goto __51
	}
	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) == end) {
		goto __53
	}
	// Entire string parses as an integer.

	goto __12
	goto __54
__53:
	// Some prefix parsed as an integer, but not the whole string,
	// so return failure index as the point where parsing stopped.
	// Clear out the internal rep, since keeping it would leave
	// *objPtr in an inconsistent state.

	result = 0
	failat = int32((int64(*(*uintptr)(unsafe.Pointer(bp + 16))) - int64(string1)) / 1)
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __55
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __56
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__56:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__55:
	;

__54:
	;
	goto __52
__51:
	// No prefix is a valid integer. Fail at beginning.

	result = 0
	failat = 0
__52:
	;
	goto __12
__25:
	if !(TCL_OK == func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp + 32)) = *(*int64)(unsafe.Pointer(objPtr + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, uintptr(0), objPtr, bp+32)
	}()) {
		goto __57
	}
	goto __12
__57:
	;

failedIntParse:
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 8)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp+8)
	}()
	if !(*(*int32)(unsafe.Pointer(bp + 8)) == 0) {
		goto __58
	}
	if !(strict != 0) {
		goto __59
	}
	result = 0
__59:
	;
	goto str_is_done
__58:
	;
	result = 0
	if !(failVarObj == uintptr(0)) {
		goto __60
	}
	// Don't bother computing the failure point if we're not going to
	// return it.

	goto __12
__60:
	;
	end = string1 + uintptr(*(*int32)(unsafe.Pointer(bp + 8)))
	if !(XTclParseNumber(tls, uintptr(0), objPtr, uintptr(0), uintptr(0), -1,
		bp+16, TCL_PARSE_INTEGER_ONLY) == TCL_OK) {
		goto __61
	}
	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) == end) {
		goto __63
	}
	// Entire string parses as an integer, but rejected by
	// Tcl_Get(Wide)IntFromObj() so we must have overflowed the
	// target type, and our convention is to return failure at
	// index -1 in that situation.

	failat = -1
	goto __64
__63:
	// Some prefix parsed as an integer, but not the whole string,
	// so return failure index as the point where parsing stopped.
	// Clear out the internal rep, since keeping it would leave
	// *objPtr in an inconsistent state.

	failat = int32((int64(*(*uintptr)(unsafe.Pointer(bp + 16))) - int64(string1)) / 1)
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __65
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __66
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__66:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__65:
	;

__64:
	;
	goto __62
__61:
	// No prefix is a valid integer. Fail at beginning.

	failat = 0
__62:
	;
	goto __12
__26:
	// We ignore the strictness here, since empty strings are always
	// well-formed lists.

	if !(TCL_OK == func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 40)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, uintptr(0), objPtr, bp+40)
	}()) {
		goto __67
	}
	goto __12
__67:
	;

	if !(failVarObj != uintptr(0)) {
		goto __68
	}

	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 8)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp+8)
	}()
	end = string1 + uintptr(*(*int32)(unsafe.Pointer(bp + 8)))
	failat = -1
	p = string1
	lenRemain = *(*int32)(unsafe.Pointer(bp + 8 /* length1 */))
__69:
	if !(lenRemain > 0) {
		goto __71
	}
	if !(TCL_ERROR == XTclFindElement(tls, uintptr(0), p, lenRemain,
		bp+48, bp+56, bp+64, uintptr(0))) {
		goto __72
	}

	// This is the simplest way of getting the number of
	// characters parsed. Note that this is not the same as
	// the number of bytes when parsing strings with non-ASCII
	// characters in them.
	//
	// Skip leading spaces first. This is only really an issue
	// if it is the first "element" that has the failure.

__73:
	if !(func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
	}() != 0) {
		goto __74
	}
	p++
	goto __73
__74:
	;
__75:
	;
__78:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __81
	}
	tmpStr = XTclThreadAllocObj(tls)
	goto __82
__81:
	tmpStr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpStr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__82:
	;
	goto __79
__79:
	if 0 != 0 {
		goto __78
	}
	goto __80
__80:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpStr)).FrefCount = 0
	if !((int64(p)-int64(string1))/1 == int64(0)) {
		goto __83
	}
	(*Tcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(tmpStr)).Flength = 0
	goto __84
__83:
	(*Tcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes = XTcl_Alloc(tls, uint32((int64(p)-int64(string1))/1+int64(1)))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes, string1, uint64((int64(p)-int64(string1))/1))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes + uintptr((int64(p)-int64(string1))/1))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(tmpStr)).Flength = int32((int64(p) - int64(string1)) / 1)
__84:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpStr)).FtypePtr = uintptr(0)

	goto __76
__76:
	if 0 != 0 {
		goto __75
	}
	goto __77
__77:
	;
	failat = XTcl_GetCharLength(tls, tmpStr)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpStr)).FrefCount, 1) > 1) {
		goto __85
	}
	goto __86
__85:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tmpStr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpStr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __87
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes != XtclEmptyStringRep) {
		goto __89
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes)
__89:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpStr)).Flength = -1
__90:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __93
	}
	XTclThreadFreeObj(tls, tmpStr)
	goto __94
__93:
	*(*uintptr)(unsafe.Pointer(tmpStr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = tmpStr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__94:
	;
	goto __91
__91:
	if 0 != 0 {
		goto __90
	}
	goto __92
__92:
	;
	goto __88
__87:
	XTclFreeObj(tls, tmpStr)
__88:
	;
__86:
	;

	goto __71
__72:
	;
	goto __70
__70:
	p = *(*uintptr)(unsafe.Pointer(bp + 56 /* nextElem */))
	lenRemain = int32((int64(end) - int64(*(*uintptr)(unsafe.Pointer(bp + 56)))) / 1)
	goto __69
	goto __71
__71:
	;
__68:
	;
	result = 0
	goto __12
__27:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{XTcl_UniCharIsLower}))
	goto __12
__28:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{XTcl_UniCharIsPrint}))
	goto __12
__29:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{XTcl_UniCharIsPunct}))
	goto __12
__30:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{XTcl_UniCharIsSpace}))
	goto __12
__31:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{XTcl_UniCharIsUpper}))
	goto __12
__32:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{XTcl_UniCharIsWordChar}))
	goto __12
__33:
	chcomp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{sUniCharIsHexDigit}))
	goto __12
__12:
	;

	if !(chcomp != uintptr(0)) {
		goto __95
	}
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 8)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp+8)
	}()
	if !(*(*int32)(unsafe.Pointer(bp + 8)) == 0) {
		goto __96
	}
	if !(strict != 0) {
		goto __97
	}
	result = 0
__97:
	;
	goto str_is_done
__96:
	;
	end = string1 + uintptr(*(*int32)(unsafe.Pointer(bp + 8)))
__98:
	if !(string1 < end) {
		goto __100
	}

	*(*int32)(unsafe.Pointer(bp + 40 /* length2 */)) = XTclUtfToUCS4(tls, string1, bp+68)
	if !!((*struct{ f func(*libc.TLS, int32) int32 })(unsafe.Pointer(&struct{ uintptr }{chcomp})).f(tls, *(*int32)(unsafe.Pointer(bp + 68))) != 0) {
		goto __101
	}
	result = 0
	goto __100
__101:
	;
	goto __99
__99:
	string1 += uintptr(*(*int32)(unsafe.Pointer(bp + 40 /* length2 */)))
	failat++
	goto __98
	goto __100
__100:
	;
__95:
	;

	// Only set the failVarObj when we will return 0 and we have indicated a
	// valid fail index (>= 0).

str_is_done:
	if !(result == 0 && failVarObj != uintptr(0) && XTcl_ObjSetVar2(tls, interp, failVarObj, uintptr(0), XTcl_NewIntObj(tls, failat),
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __102
	}
	return TCL_ERROR
__102:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(result != 0)))
	return TCL_OK
}

var isClasses = [22]uintptr{
	ts + 1183, ts + 1189, ts + 1195, ts + 16101,
	ts + 3541, ts + 1213, ts + 5570, ts + 5577,
	ts + 16109, ts + 1219, ts + 5676, ts + 2810,
	ts + 1225, ts + 1231, ts + 1237, ts + 622,
	ts + 16115, ts + 1243, ts + 16120, ts + 16132,
	ts + 1249, uintptr(0),
} /* tclCmdMZ.c:1456:23 */
var isOptions = [3]uintptr{
	ts + 10019, ts + 16141, uintptr(0),
} /* tclCmdMZ.c:1472:23 */

func sUniCharIsAscii(tls *libc.TLS, character int32) int32 { /* tclCmdMZ.c:1807:1: */
	return libc.Bool32(character >= 0 && character < 0x80)
}

func sUniCharIsHexDigit(tls *libc.TLS, character int32) int32 { /* tclCmdMZ.c:1814:1: */
	return libc.Bool32(character >= 0 && character < 0x80 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(character)*2)))&int32(X_ISxdigit) != 0)
}

//----------------------------------------------------------------------
//
// StringMapCmd --
//
//	This procedure is invoked to process the "string map" Tcl command. See
//	the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringMapCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:1839:1: */
	bp := tls.Alloc(152)
	defer tls.Free(152)

	// var length1 int32 at bp+144, 4

	// var length2 int32 at bp+96, 4

	// var mapElemc int32 at bp+100, 4

	var index int32
	var nocase int32
	var mapWithDict int32
	var copySource int32
	// var mapElemv uintptr at bp+136, 8

	var sourceObj uintptr
	var resultPtr uintptr
	var ustring1 uintptr
	var ustring2 uintptr
	var p uintptr
	var end uintptr
	var strCmpFn uintptr
	var string uintptr
	var i int32
	// var done int32 at bp+128, 4

	// var search Tcl_DictSearch at bp+104, 24

	// Special case for one map pair which avoids the extra for loop and
	// extra calls to get Unicode data. The algorithm is otherwise
	// identical to the multi-pair case. This will be >30% faster on
	// larger strings.

	// var mapLen int32 at bp+148, 4

	var mapString uintptr
	var u2lc Tcl_UniChar
	var mapStrings uintptr
	var u2lc1 uintptr
	var mapLens uintptr
	var _objPtr uintptr
	nocase = 0
	mapWithDict = 0
	copySource = 0

	if !(objc < 3 || objc > 4) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16152)
	return TCL_ERROR
__1:
	;

	if !(objc == 4) {
		goto __2
	}
	string = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 96)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+96)
	}()

	if !(*(*int32)(unsafe.Pointer(bp + 96)) > 1 && libc.Xstrncmp(tls, string, ts+14955, uint64(*(*int32)(unsafe.Pointer(bp + 96)))) == 0) {
		goto __3
	}
	nocase = 1
	goto __4
__3:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+16177, libc.VaList(bp, string)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+16210, ts+9944,
		string, uintptr(0)))
	return TCL_ERROR
__4:
	;
__2:
	;

	// This test is tricky, but has to be that way or you get other strange
	// inconsistencies (see test string-10.20 for illustration why!)

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)))).Fbytes == uintptr(0)) {
		goto __5
	}

	// We know the type exactly, so all dict operations will succeed for
	// sure. This shortens this code quite a bit.

	XTcl_DictObjSize(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)), bp+100)
	if !(*(*int32)(unsafe.Pointer(bp + 100)) == 0) {
		goto __7
	}
	// Empty charMap, just return whatever string was given.

	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))
	return TCL_OK
__7:
	;

	*(*int32)(unsafe.Pointer(bp + 100 /* mapElemc */)) *= 2
	mapWithDict = 1

	// Copy the dictionary out into an array; that's the easiest way to
	// adapt this code...

	*(*uintptr)(unsafe.Pointer(bp + 136 /* mapElemv */)) = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 100)))))
	XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)), bp+104, *(*uintptr)(unsafe.Pointer(bp + 136))+uintptr(0)*8,
		*(*uintptr)(unsafe.Pointer(bp + 136))+uintptr(1)*8, bp+128)
	i = 2
__8:
	if !(i < *(*int32)(unsafe.Pointer(bp + 100))) {
		goto __10
	}
	XTcl_DictObjNext(tls, bp+104, *(*uintptr)(unsafe.Pointer(bp + 136))+uintptr(i)*8, *(*uintptr)(unsafe.Pointer(bp + 136))+uintptr(i)*8+uintptr(1)*8, bp+128)
	goto __9
__9:
	i = i + 2
	goto __8
	goto __10
__10:
	;
	XTcl_DictObjDone(tls, bp+104)
	goto __6
__5:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 136)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 100)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)), bp+100, bp+136)
	}() != TCL_OK) {
		goto __11
	}
	return TCL_ERROR
__11:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 100)) == 0) {
		goto __12
	}
	// empty charMap, just return whatever string was given.

	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))
	return TCL_OK
	goto __13
__12:
	if !(*(*int32)(unsafe.Pointer(bp + 100))&1 != 0) {
		goto __14
	}
	// The charMap must be an even number of key/value items.

	XTcl_SetObjResult(tls, interp,
		XTcl_NewStringObj(tls, ts+16216, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+3593, ts+7420, ts+16241,
		ts+16245, uintptr(0)))
	return TCL_ERROR
__14:
	;
__13:
	;
__6:
	;

	// Take a copy of the source string object if it is the same as the map
	// string to cut out nasty sharing crashes. [Bug 1018562]

	if !(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)) == *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))) {
		goto __15
	}
	sourceObj = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))
	copySource = 1
	goto __16
__15:
	sourceObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))
__16:
	;
	ustring1 = XTcl_GetUnicodeFromObj(tls, sourceObj, bp+144)
	if !(*(*int32)(unsafe.Pointer(bp + 144)) == 0) {
		goto __17
	}
	// Empty input string, just stop now.

	goto done
__17:
	;
	end = ustring1 + uintptr(*(*int32)(unsafe.Pointer(bp + 144)))*2

	strCmpFn = func() uintptr {
		if nocase != 0 {
			return *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, uint64) int32
			}{XTcl_UniCharNcasecmp}))
		}
		return *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, uint64) int32
		}{XTcl_UniCharNcmp}))
	}()

	// Force result to be Unicode

	resultPtr = XTcl_NewUnicodeObj(tls, ustring1, 0)

	if !(*(*int32)(unsafe.Pointer(bp + 100)) == 2) {
		goto __18
	}

	ustring2 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136 /* mapElemv */)))), bp+96)
	p = ustring1
	if !(*(*int32)(unsafe.Pointer(bp + 96)) > *(*int32)(unsafe.Pointer(bp + 144)) || *(*int32)(unsafe.Pointer(bp + 96)) == 0) {
		goto __20
	}
	// Match string is either longer than input or empty.

	ustring1 = end
	goto __21
__20:
	mapString = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136 /* mapElemv */)) + 1*8)), bp+148)
	u2lc = func() uint16 {
		if nocase != 0 {
			return XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(ustring2))))
		}
		return uint16(0)
	}()
__22:
	if !(ustring1 < end) {
		goto __24
	}
	if !((int32(*(*Tcl_UniChar)(unsafe.Pointer(ustring1))) == int32(*(*Tcl_UniChar)(unsafe.Pointer(ustring2))) || nocase != 0 && int32(XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(ustring1))))) == int32(u2lc)) && (*(*int32)(unsafe.Pointer(bp + 96)) == 1 || (*struct {
		f func(*libc.TLS, uintptr, uintptr, uint64) int32
	})(unsafe.Pointer(&struct{ uintptr }{strCmpFn})).f(tls, ustring1, ustring2,
		uint64(*(*int32)(unsafe.Pointer(bp + 96)))) == 0)) {
		goto __25
	}
	if !(p != ustring1) {
		goto __26
	}
	XTcl_AppendUnicodeToObj(tls, resultPtr, p, int32((int64(ustring1)-int64(p))/2))
	p = ustring1 + uintptr(*(*int32)(unsafe.Pointer(bp + 96)))*2
	goto __27
__26:
	p += 2 * uintptr(*(*int32)(unsafe.Pointer(bp + 96)))
__27:
	;
	ustring1 = p - uintptr(1)*2

	XTcl_AppendUnicodeToObj(tls, resultPtr, mapString, *(*int32)(unsafe.Pointer(bp + 148 /* mapLen */)))
__25:
	;
	goto __23
__23:
	ustring1 += 2
	goto __22
	goto __24
__24:
	;
__21:
	;
	goto __19
__18:
	u2lc1 = uintptr(0)

	// Precompute pointers to the unicode string and length. This saves us
	// repeated function calls later, significantly speeding up the
	// algorithm. We only need the lowercase first char in the nocase
	// case.

	mapStrings = XTclStackAlloc(tls, interp, int32(uint64(*(*int32)(unsafe.Pointer(bp + 100))*2)*uint64(unsafe.Sizeof(uintptr(0)))))
	mapLens = XTclStackAlloc(tls, interp, int32(uint64(*(*int32)(unsafe.Pointer(bp + 100))*2)*uint64(unsafe.Sizeof(int32(0)))))
	if !(nocase != 0) {
		goto __28
	}
	u2lc1 = XTclStackAlloc(tls, interp, int32(uint64(*(*int32)(unsafe.Pointer(bp + 100)))*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))
__28:
	;
	index = 0
__29:
	if !(index < *(*int32)(unsafe.Pointer(bp + 100))) {
		goto __31
	}
	*(*uintptr)(unsafe.Pointer(mapStrings + uintptr(index)*8)) = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136 /* mapElemv */)) + uintptr(index)*8)),
		mapLens+uintptr(index)*4)
	if !(nocase != 0 && index%2 == 0) {
		goto __32
	}
	*(*Tcl_UniChar)(unsafe.Pointer(u2lc1 + uintptr(index/2)*2)) = XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(mapStrings + uintptr(index)*8))))))
__32:
	;
	goto __30
__30:
	index++
	goto __29
	goto __31
__31:
	;
	p = ustring1
__33:
	if !(ustring1 < end) {
		goto __35
	}
	index = 0
__36:
	if !(index < *(*int32)(unsafe.Pointer(bp + 100))) {
		goto __38
	}
	// Get the key string to match on.

	ustring2 = *(*uintptr)(unsafe.Pointer(mapStrings + uintptr(index)*8))
	*(*int32)(unsafe.Pointer(bp + 96 /* length2 */)) = *(*int32)(unsafe.Pointer(mapLens + uintptr(index)*4))
	if !(*(*int32)(unsafe.Pointer(bp + 96)) > 0 && (int32(*(*Tcl_UniChar)(unsafe.Pointer(ustring1))) == int32(*(*Tcl_UniChar)(unsafe.Pointer(ustring2))) || nocase != 0 && int32(XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(ustring1))))) == int32(*(*Tcl_UniChar)(unsafe.Pointer(u2lc1 + uintptr(index/2)*2)))) && (int64(end)-int64(ustring1))/2 >= int64(*(*int32)(unsafe.Pointer(bp + 96))) && (*(*int32)(unsafe.Pointer(bp + 96)) == 1 || !((*struct {
		f func(*libc.TLS, uintptr, uintptr, uint64) int32
	})(unsafe.Pointer(&struct{ uintptr }{strCmpFn})).f(tls, ustring2, ustring1, uint64(*(*int32)(unsafe.Pointer(bp + 96)))) != 0))) {
		goto __39
	}
	if !(p != ustring1) {
		goto __40
	}
	// Put the skipped chars onto the result first.

	XTcl_AppendUnicodeToObj(tls, resultPtr, p, int32((int64(ustring1)-int64(p))/2))
	p = ustring1 + uintptr(*(*int32)(unsafe.Pointer(bp + 96)))*2
	goto __41
__40:
	p += 2 * uintptr(*(*int32)(unsafe.Pointer(bp + 96)))
__41:
	;

	// Adjust len to be full length of matched string.

	ustring1 = p - uintptr(1)*2

	// Append the map value to the unicode string.

	XTcl_AppendUnicodeToObj(tls, resultPtr,
		*(*uintptr)(unsafe.Pointer(mapStrings + uintptr(index+1)*8)), *(*int32)(unsafe.Pointer(mapLens + uintptr(index+1)*4)))
	goto __38
__39:
	;
	goto __37
__37:
	index = index + 2
	goto __36
	goto __38
__38:
	;
	goto __34
__34:
	ustring1 += 2
	goto __33
	goto __35
__35:
	;
	if !(nocase != 0) {
		goto __42
	}
	XTclStackFree(tls, interp, u2lc1)
__42:
	;
	XTclStackFree(tls, interp, mapLens)
	XTclStackFree(tls, interp, mapStrings)
__19:
	;
	if !(p != ustring1) {
		goto __43
	}
	// Put the rest of the unmapped chars onto result.

	XTcl_AppendUnicodeToObj(tls, resultPtr, p, int32((int64(ustring1)-int64(p))/2))
__43:
	;
	XTcl_SetObjResult(tls, interp, resultPtr)
done:
	if !(mapWithDict != 0) {
		goto __44
	}
	XTclStackFree(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 136 /* mapElemv */)))
__44:
	;
	if !(copySource != 0) {
		goto __45
	}
__46:
	_objPtr = sourceObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __49
	}
	XTclFreeObj(tls, _objPtr)
__49:
	;
	goto __47
__47:
	if 0 != 0 {
		goto __46
	}
	goto __48
__48:
	;
__45:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringMatchCmd --
//
//	This procedure is invoked to process the "string match" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringMatchCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:2109:1: */
	bp := tls.Alloc(60)
	defer tls.Free(60)

	var nocase int32 = 0

	if objc < 3 || objc > 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16256)
		return TCL_ERROR
	}

	if objc == 4 {
		// var length int32 at bp+56, 4

		var string uintptr = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 56)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+56)
		}()

		if *(*int32)(unsafe.Pointer(bp + 56)) > 1 && libc.Xstrncmp(tls, string, ts+14955, uint64(*(*int32)(unsafe.Pointer(bp + 56)))) == 0 {
			nocase = int32(1) << 0
		} else {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+16177, libc.VaList(bp, string)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+16210, ts+9944,
				string, uintptr(0)))
			return TCL_ERROR
		}
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(XTclStringMatchObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8)), nocase) != 0)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringRangeCmd --
//
//	This procedure is invoked to process the "string range" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringRangeCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:2161:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var length int32
	// var first int32 at bp, 4

	// var last int32 at bp+4, 4

	if objc != 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16281)
		return TCL_ERROR
	}

	// Get the length in actual characters; Then reduce it by one because
	// 'end' refers to the last character, not one past it.

	length = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) - 1

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), length, bp)
	}() != TCL_OK || func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), length, bp+4)
	}() != TCL_OK {
		return TCL_ERROR
	}

	if *(*int32)(unsafe.Pointer(bp)) < 0 {
		*(*int32)(unsafe.Pointer(bp /* first */)) = 0
	}
	if *(*int32)(unsafe.Pointer(bp + 4)) >= length {
		*(*int32)(unsafe.Pointer(bp + 4 /* last */)) = length
	}
	if *(*int32)(unsafe.Pointer(bp + 4)) >= *(*int32)(unsafe.Pointer(bp)) {
		XTcl_SetObjResult(tls, interp, XTcl_GetRange(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*int32)(unsafe.Pointer(bp /* first */)), *(*int32)(unsafe.Pointer(bp + 4 /* last */))))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringReptCmd --
//
//	This procedure is invoked to process the "string repeat" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringReptCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:2217:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var string1 uintptr
	var string2 uintptr
	// var count int32 at bp+64, 4

	var index int32
	// var length1 int32 at bp+68, 4

	var length2 int32
	var resultPtr uintptr
	var cachePtr uintptr

	if !(objc != 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16299)
	return TCL_ERROR
__1:
	;

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 64)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+64)
	}() != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	// Check for cases that allow us to skip copying stuff.

	if !(*(*int32)(unsafe.Pointer(bp + 64)) == 1) {
		goto __3
	}
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	goto done
	goto __4
__3:
	if !(*(*int32)(unsafe.Pointer(bp + 64)) < 1) {
		goto __5
	}
	goto done
__5:
	;
__4:
	;
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 68)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+68)
	}()
	if !(*(*int32)(unsafe.Pointer(bp + 68)) <= 0) {
		goto __6
	}
	goto done
__6:
	;

	// Only build up a string that has data. Instead of building it up with
	// repeated appends, we just allocate the necessary space once and copy
	// the string value in.
	//
	// We have to worry about overflow [Bugs 714106, 2561746].
	// At this point we know 1 <= length1 <= INT_MAX and 2 <= count <= INT_MAX.
	// We need to keep 2 <= length2 <= INT_MAX.

	if !(*(*int32)(unsafe.Pointer(bp + 64)) > 0x7fffffff / *(*int32)(unsafe.Pointer(bp + 68))) {
		goto __7
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+16312,
		libc.VaList(bp, 0x7fffffff)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+14496, uintptr(0)))
	return TCL_ERROR
__7:
	;
	length2 = *(*int32)(unsafe.Pointer(bp + 68)) * *(*int32)(unsafe.Pointer(bp + 64))

	// Include space for the NUL.

	string2 = XTclpAlloc(tls, uint32(length2+1))
	if !(string2 == uintptr(0)) {
		goto __8
	}
	// Alloc failed. Note that in this case we try to do an error message
	// since this is a case that's most likely when the alloc is large and
	// that's easy to do with this API. Note that if we fail allocating a
	// short string, this will likely keel over too (and fatally).

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+16363,
		libc.VaList(bp+32, length2+1)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+14496, uintptr(0)))
	return TCL_ERROR
__8:
	;
	index = 0
__9:
	if !(index < *(*int32)(unsafe.Pointer(bp + 64))) {
		goto __11
	}
	libc.Xmemcpy(tls, string2+uintptr(*(*int32)(unsafe.Pointer(bp + 68))*index), string1, uint64(*(*int32)(unsafe.Pointer(bp + 68 /* length1 */))))
	goto __10
__10:
	index++
	goto __9
	goto __11
__11:
	;
	*(*int8)(unsafe.Pointer(string2 + uintptr(length2))) = int8(0)

	// We have to directly assign this instead of using Tcl_SetStringObj (and
	// indirectly TclInitStringRep) because that makes another copy of the
	// data.

__12:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __15
	}
	resultPtr = XTclThreadAllocObj(tls)
	goto __16
__15:
	resultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__16:
	;
	goto __13
__13:
	if 0 != 0 {
		goto __12
	}
	goto __14
__14:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = string2
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = length2
	XTcl_SetObjResult(tls, interp, resultPtr)

done:
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringRplcCmd --
//
//	This procedure is invoked to process the "string replace" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringRplcCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:2329:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var ustring uintptr
	// var first int32 at bp+4, 4

	// var last int32 at bp+8, 4

	// var length int32 at bp, 4

	var end int32

	if objc < 4 || objc > 5 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16419)
		return TCL_ERROR
	}

	ustring = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	end = *(*int32)(unsafe.Pointer(bp)) - 1

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), end, bp+4)
	}() != TCL_OK || func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), end, bp+8)
	}() != TCL_OK {
		return TCL_ERROR
	}

	// The following test screens out most empty substrings as
	// candidates for replacement. When they are detected, no
	// replacement is done, and the result is the original string,
	if *(*int32)(unsafe.Pointer(bp + 8)) < 0 || *(*int32)(unsafe.Pointer(bp + 4)) > end || *(*int32)(unsafe.Pointer(bp + 8)) < *(*int32)(unsafe.Pointer(bp + 4)) { // Range begins after it starts

		// BUT!!! when (end < 0) -- an empty original string -- we can
		// have (first <= end < 0 <= last) and an empty string is permitted
		// to be replaced.
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	} else {
		var resultPtr uintptr

		// We are re-fetching in case the string argument is same value as
		// an index argument, and shimmering cost us our ustring.

		ustring = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
		end = *(*int32)(unsafe.Pointer(bp)) - 1

		if *(*int32)(unsafe.Pointer(bp + 4)) < 0 {
			*(*int32)(unsafe.Pointer(bp + 4 /* first */)) = 0
		}

		resultPtr = XTcl_NewUnicodeObj(tls, ustring, *(*int32)(unsafe.Pointer(bp + 4 /* first */)))
		if objc == 5 {
			XTcl_AppendObjToObj(tls, resultPtr, *(*uintptr)(unsafe.Pointer(objv + 4*8)))
		}
		if *(*int32)(unsafe.Pointer(bp + 8)) < end {
			XTcl_AppendUnicodeToObj(tls, resultPtr, ustring+uintptr(*(*int32)(unsafe.Pointer(bp + 8)))*2+uintptr(1)*2,
				end-*(*int32)(unsafe.Pointer(bp + 8)))
		}
		XTcl_SetObjResult(tls, interp, resultPtr)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringRevCmd --
//
//	This procedure is invoked to process the "string reverse" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringRevCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:2413:1: */
	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16446)
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, XTclStringReverse(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringStartCmd --
//
//	This procedure is invoked to process the "string wordstart" Tcl
//	command. See the user documentation for details on what it does. Note
//	that this command only functions correctly on properly formed Tcl UTF
//	strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringStartCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:2448:1: */
	bp := tls.Alloc(10)
	defer tls.Free(10)

	*(*Tcl_UniChar)(unsafe.Pointer(bp + 8 /* ch */)) = Tcl_UniChar(0)
	var p uintptr
	var string uintptr
	var cur int32
	// var index int32 at bp+4, 4

	// var length int32 at bp, 4

	var numChars int32

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16453)
		return TCL_ERROR
	}

	string = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()
	numChars = XTcl_NumUtfChars(tls, string, *(*int32)(unsafe.Pointer(bp /* length */)))
	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), numChars-1, bp+4)
	}() != TCL_OK {
		return TCL_ERROR
	}
	string = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()
	if *(*int32)(unsafe.Pointer(bp + 4)) >= numChars {
		*(*int32)(unsafe.Pointer(bp + 4 /* index */)) = numChars - 1
	}
	cur = 0
	if *(*int32)(unsafe.Pointer(bp + 4)) > 0 {
		p = XTcl_UtfAtIndex(tls, string, *(*int32)(unsafe.Pointer(bp + 4 /* index */)))

		if int32(uint8(*(*int8)(unsafe.Pointer(p)))) < 0x80 {
			*(*Tcl_UniChar)(unsafe.Pointer(bp + 8)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(p))))
		} else {
			XTcl_UtfToUniChar(tls, p, bp+8)
		}
		for cur = *(*int32)(unsafe.Pointer(bp + 4 /* index */)); cur >= 0; cur-- {
			var delta int32 = 0
			var next uintptr

			if !(XTcl_UniCharIsWordChar(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 8)))) != 0) {
				break
			}

			next = func() uintptr {
				if p < string+uintptr(2) {
					return string
				}
				return func() uintptr {
					if int32(uint8(*(*int8)(unsafe.Pointer(p - uintptr(1))))) < 0x80 {
						return p - uintptr(1)
					}
					return XTcl_UtfPrev(tls, p, string)
				}()
			}()
			for ok := true; ok; ok = next+uintptr(delta) < p {
				next += uintptr(delta)
				delta = func() int32 {
					if int32(uint8(*(*int8)(unsafe.Pointer(next)))) < 0x80 {
						return func() int32 {
							*(*Tcl_UniChar)(unsafe.Pointer(bp + 8)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(next))))
							return 1
						}()
					}
					return XTcl_UtfToUniChar(tls, next, bp+8)
				}()
			}
			p = next
		}
		if cur != *(*int32)(unsafe.Pointer(bp + 4)) {
			cur = cur + 1
		}
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, cur))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringEndCmd --
//
//	This procedure is invoked to process the "string wordend" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringEndCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:2519:1: */
	bp := tls.Alloc(10)
	defer tls.Free(10)

	*(*Tcl_UniChar)(unsafe.Pointer(bp + 8 /* ch */)) = Tcl_UniChar(0)
	var p uintptr
	var end uintptr
	var string uintptr
	var cur int32
	// var index int32 at bp+4, 4

	// var length int32 at bp, 4

	var numChars int32

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16453)
		return TCL_ERROR
	}

	string = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()
	numChars = XTcl_NumUtfChars(tls, string, *(*int32)(unsafe.Pointer(bp /* length */)))
	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), numChars-1, bp+4)
	}() != TCL_OK {
		return TCL_ERROR
	}
	string = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()
	if *(*int32)(unsafe.Pointer(bp + 4)) < 0 {
		*(*int32)(unsafe.Pointer(bp + 4 /* index */)) = 0
	}
	if *(*int32)(unsafe.Pointer(bp + 4)) < numChars {
		p = XTcl_UtfAtIndex(tls, string, *(*int32)(unsafe.Pointer(bp + 4 /* index */)))
		end = string + uintptr(*(*int32)(unsafe.Pointer(bp)))
		for cur = *(*int32)(unsafe.Pointer(bp + 4 /* index */)); p < end; cur++ {
			p += func() uintptr {
				if int32(uint8(*(*int8)(unsafe.Pointer(p)))) < 0x80 {
					return uintptr(func() int32 {
						*(*Tcl_UniChar)(unsafe.Pointer(bp + 8)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(p))))
						return 1
					}())
				}
				return uintptr(XTcl_UtfToUniChar(tls, p, bp+8))
			}()
			if !(XTcl_UniCharIsWordChar(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 8)))) != 0) {
				break
			}
		}
		if cur == *(*int32)(unsafe.Pointer(bp + 4)) {
			cur++
		}
	} else {
		cur = numChars
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, cur))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringEqualCmd --
//
//	This procedure is invoked to process the "string equal" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringEqualCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:2581:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	// Remember to keep code here in some sync with the byte-compiled versions
	// in tclExecute.c (INST_STR_EQ, INST_STR_NEQ and INST_STR_CMP as well as
	// the expr string comparison in INST_EQ/INST_NEQ/INST_LT/...).

	var string2 uintptr
	// var length2 int32 at bp+56, 4

	var i int32
	var match int32
	var nocase int32
	// var reqlength int32 at bp+60, 4
	nocase = 0
	*(*int32)(unsafe.Pointer(bp + 60 /* reqlength */)) = -1

	if !(objc < 3 || objc > 6) {
		goto __1
	}
str_cmp_args:
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+16466)
	return TCL_ERROR
__1:
	;

	i = 1
__2:
	if !(i < objc-2) {
		goto __4
	}
	string2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 56)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+56)
	}()
	if !(*(*int32)(unsafe.Pointer(bp + 56)) > 1 && !(libc.Xstrncmp(tls, string2, ts+14955, uint64(*(*int32)(unsafe.Pointer(bp + 56)))) != 0)) {
		goto __5
	}
	nocase = 1
	goto __6
__5:
	if !(*(*int32)(unsafe.Pointer(bp + 56)) > 1 &&
		!(libc.Xstrncmp(tls, string2, ts+16506, uint64(*(*int32)(unsafe.Pointer(bp + 56)))) != 0)) {
		goto __7
	}
	if !(i+1 >= objc-2) {
		goto __9
	}
	goto str_cmp_args
__9:
	;
	i++
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 60)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+60)
	}() != TCL_OK) {
		goto __10
	}
	return TCL_ERROR
__10:
	;
	goto __8
__7:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+16514,
		libc.VaList(bp, string2)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+16210, ts+9944,
		string2, uintptr(0)))
	return TCL_ERROR
__8:
	;
__6:
	;
	goto __3
__3:
	i++
	goto __2
	goto __4
__4:
	;

	// From now on, we only access the two objects at the end of the argument
	// array.

	objv += 8 * uintptr(objc-2)
	match = XTclStringCmp(tls, *(*uintptr)(unsafe.Pointer(objv)), *(*uintptr)(unsafe.Pointer(objv + 1*8)), 0, nocase, *(*int32)(unsafe.Pointer(bp + 60 /* reqlength */)))
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(func() int32 {
		if match != 0 {
			return 0
		}
		return 1
	}() != 0)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringCmpCmd --
//
//	This procedure is invoked to process the "string compare" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringCmpCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:2656:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// Remember to keep code here in some sync with the byte-compiled versions
	// in tclExecute.c (INST_STR_EQ, INST_STR_NEQ and INST_STR_CMP as well as
	// the expr string comparison in INST_EQ/INST_NEQ/INST_LT/...).

	var match int32
	// var nocase int32 at bp, 4

	// var reqlength int32 at bp+4, 4

	var status int32

	status = XTclStringCmpOpts(tls, interp, objc, objv, bp, bp+4)
	if status != TCL_OK {
		return status
	}

	objv += 8 * uintptr(objc-2)
	match = XTclStringCmp(tls, *(*uintptr)(unsafe.Pointer(objv)), *(*uintptr)(unsafe.Pointer(objv + 1*8)), 0, *(*int32)(unsafe.Pointer(bp /* nocase */)), *(*int32)(unsafe.Pointer(bp + 4 /* reqlength */)))
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, match))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclStringCmp --
//
//	This is the core of Tcl's string comparison. It only handles byte
//	arrays, UNICODE strings and UTF-8 strings correctly.
//
// Results:
//	-1 if value1Ptr is less than value2Ptr, 0 if they are equal, or 1 if
//	value1Ptr is greater.
//
// Side effects:
//	May cause string representations of objects to be allocated.
//
//----------------------------------------------------------------------

func XTclStringCmp(tls *libc.TLS, value1Ptr uintptr, value2Ptr uintptr, checkEq int32, nocase int32, reqlength int32) int32 { /* tclCmdMZ.c:2700:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var s1 uintptr
	var s2 uintptr
	var empty int32
	var length int32
	var match int32
	// var s1len int32 at bp, 4

	// var s2len int32 at bp+4, 4

	var memCmpFn MemCmpFn_t

	if reqlength == 0 || value1Ptr == value2Ptr {
		// Always match at 0 chars or if it is the same obj.
		return 0
	}

	if !(nocase != 0) && ((*Tcl_Obj)(unsafe.Pointer(value1Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(value1Ptr)).Fbytes == uintptr(0)) &&
		((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes == uintptr(0)) {
		// Use binary versions of comparisons since that won't cause undue
		// type conversions and it is much faster. Only do this if we're
		// case-sensitive (which is all that really makes sense with byte
		// arrays anyway, and we have no memcasecmp() for some reason... :^)

		s1 = XTcl_GetByteArrayFromObj(tls, value1Ptr, bp)
		s2 = XTcl_GetByteArrayFromObj(tls, value2Ptr, bp+4)
		memCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, Size_t) int32
		}{libc.Xmemcmp}))
	} else if (*Tcl_Obj)(unsafe.Pointer(value1Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclStringType)) &&
		(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclStringType)) {
		// Do a unicode-specific comparison if both of the args are of String
		// type. If the char length == byte length, we can do a memcmp. In
		// benchmark testing this proved the most efficient check between the
		// unicode and string comparison operations.

		if nocase != 0 {
			s1 = XTcl_GetUnicodeFromObj(tls, value1Ptr, bp)
			s2 = XTcl_GetUnicodeFromObj(tls, value2Ptr, bp+4)
			memCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, uint64) int32
			}{XTcl_UniCharNcasecmp}))
		} else {
			*(*int32)(unsafe.Pointer(bp /* s1len */)) = XTcl_GetCharLength(tls, value1Ptr)
			*(*int32)(unsafe.Pointer(bp + 4 /* s2len */)) = XTcl_GetCharLength(tls, value2Ptr)
			if *(*int32)(unsafe.Pointer(bp)) == (*Tcl_Obj)(unsafe.Pointer(value1Ptr)).Flength &&
				(*Tcl_Obj)(unsafe.Pointer(value1Ptr)).Fbytes != uintptr(0) &&
				*(*int32)(unsafe.Pointer(bp + 4)) == (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength &&
				(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != uintptr(0) {
				s1 = (*Tcl_Obj)(unsafe.Pointer(value1Ptr)).Fbytes
				s2 = (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes
				memCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, uintptr, uintptr, Size_t) int32
				}{libc.Xmemcmp}))
			} else {
				s1 = XTcl_GetUnicode(tls, value1Ptr)
				s2 = XTcl_GetUnicode(tls, value2Ptr)
				if checkEq != 0 {
					memCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
						f func(*libc.TLS, uintptr, uintptr, Size_t) int32
					}{libc.Xmemcmp}))
					*(*int32)(unsafe.Pointer(bp /* s1len */)) *= int32(uint64(unsafe.Sizeof(Tcl_UniChar(0))))
					*(*int32)(unsafe.Pointer(bp + 4 /* s2len */)) *= int32(uint64(unsafe.Sizeof(Tcl_UniChar(0))))
				} else {
					memCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
						f func(*libc.TLS, uintptr, uintptr, uint64) int32
					}{XTcl_UniCharNcmp}))
				}
			}
		}
	} else {
		// Get the string representations, being careful in case we have
		// special empty string objects about.

		empty = XTclCheckEmptyString(tls, value1Ptr)
		if empty > 0 {
			switch XTclCheckEmptyString(tls, value2Ptr) {
			case -1:
				s1 = ts + 2046 /* "" */
				*(*int32)(unsafe.Pointer(bp /* s1len */)) = 0
				s2 = func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 {
						return func() uintptr {
							*(*int32)(unsafe.Pointer(bp + 4)) = (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength
							return (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes
						}()
					}
					return XTcl_GetStringFromObj(tls, value2Ptr, bp+4)
				}()
				break
				fallthrough
			case 0:
				return -1
				fallthrough
			default: // avoid warn: `s2` may be used uninitialized
				return 0
			}
		} else if XTclCheckEmptyString(tls, value2Ptr) > 0 {
			switch empty {
			case -1:
				s2 = ts + 2046 /* "" */
				*(*int32)(unsafe.Pointer(bp + 4 /* s2len */)) = 0
				s1 = func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(value1Ptr)).Fbytes != 0 {
						return func() uintptr {
							*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(value1Ptr)).Flength
							return (*Tcl_Obj)(unsafe.Pointer(value1Ptr)).Fbytes
						}()
					}
					return XTcl_GetStringFromObj(tls, value1Ptr, bp)
				}()
				break
				fallthrough
			case 0:
				return 1
				fallthrough
			default: // avoid warn: `s1` may be used uninitialized
				return 0
			}
		} else {
			s1 = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(value1Ptr)).Fbytes != 0 {
					return func() uintptr {
						*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(value1Ptr)).Flength
						return (*Tcl_Obj)(unsafe.Pointer(value1Ptr)).Fbytes
					}()
				}
				return XTcl_GetStringFromObj(tls, value1Ptr, bp)
			}()
			s2 = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 {
					return func() uintptr {
						*(*int32)(unsafe.Pointer(bp + 4)) = (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength
						return (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes
					}()
				}
				return XTcl_GetStringFromObj(tls, value2Ptr, bp+4)
			}()
		}

		if !(nocase != 0) && checkEq != 0 {
			// When we have equal-length we can check only for (in)equality.
			// We can use memcmp() in all (n)eq cases because we don't need to
			// worry about lexical LE/BE variance.
			memCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, Size_t) int32
			}{libc.Xmemcmp}))
		} else {
			// As a catch-all we will work with UTF-8. We cannot use memcmp()
			// as that is unsafe with any string containing NUL (\xC0\x80 in
			// Tcl's utf rep). We can use the more efficient TclpUtfNcmp2 if
			// we are case-sensitive and no specific length was requested.

			if reqlength < 0 && !(nocase != 0) {
				memCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, uintptr, uintptr, uint64) int32
				}{XTclpUtfNcmp2}))
			} else {
				*(*int32)(unsafe.Pointer(bp /* s1len */)) = XTcl_NumUtfChars(tls, s1, *(*int32)(unsafe.Pointer(bp /* s1len */)))
				*(*int32)(unsafe.Pointer(bp + 4 /* s2len */)) = XTcl_NumUtfChars(tls, s2, *(*int32)(unsafe.Pointer(bp + 4 /* s2len */)))
				memCmpFn = func() uintptr {
					if nocase != 0 {
						return *(*uintptr)(unsafe.Pointer(&struct {
							f func(*libc.TLS, uintptr, uintptr, uint64) int32
						}{XTcl_UtfNcasecmp}))
					}
					return *(*uintptr)(unsafe.Pointer(&struct {
						f func(*libc.TLS, uintptr, uintptr, uint64) int32
					}{XTcl_UtfNcmp}))
				}()
			}
		}
	}

	if *(*int32)(unsafe.Pointer(bp)) < *(*int32)(unsafe.Pointer(bp + 4)) {
		length = *(*int32)(unsafe.Pointer(bp /* s1len */))
	} else {
		length = *(*int32)(unsafe.Pointer(bp + 4 /* s2len */))
	}
	if reqlength > 0 && reqlength < length {
		length = reqlength
	} else if reqlength < 0 {
		// The requested length is negative, so we ignore it by setting it to
		// length + 1 so we correct the match var.

		reqlength = length + 1
	}

	if checkEq != 0 && *(*int32)(unsafe.Pointer(bp)) != *(*int32)(unsafe.Pointer(bp + 4)) {
		match = 1 // This will be reversed below.
	} else {
		// The comparison function should compare up to the minimum byte
		// length only.
		match = (*struct {
			f func(*libc.TLS, uintptr, uintptr, Size_t) int32
		})(unsafe.Pointer(&struct{ uintptr }{memCmpFn})).f(tls, s1, s2, uint64(length))
	}
	if match == 0 && reqlength > length {
		match = *(*int32)(unsafe.Pointer(bp)) - *(*int32)(unsafe.Pointer(bp + 4))
	}
	if match > 0 {
		return 1
	}
	if match < 0 {
		return -1
	}
	return 0
}

func XTclStringCmpOpts(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, nocase uintptr, reqlength uintptr) int32 { /* tclCmdMZ.c:2861:5: */
	bp := tls.Alloc(60)
	defer tls.Free(60)

	var i int32
	// var length int32 at bp+56, 4

	var string uintptr

	*(*int32)(unsafe.Pointer(reqlength)) = -1
	*(*int32)(unsafe.Pointer(nocase)) = 0
	if !(objc < 3 || objc > 6) {
		goto __1
	}
str_cmp_args:
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+16466)
	return TCL_ERROR
__1:
	;

	i = 1
__2:
	if !(i < objc-2) {
		goto __4
	}
	string = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 56)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+56)
	}()
	if !(*(*int32)(unsafe.Pointer(bp + 56)) > 1 && !(libc.Xstrncmp(tls, string, ts+14955, uint64(*(*int32)(unsafe.Pointer(bp + 56)))) != 0)) {
		goto __5
	}
	*(*int32)(unsafe.Pointer(nocase)) = 1
	goto __6
__5:
	if !(*(*int32)(unsafe.Pointer(bp + 56)) > 1 &&
		!(libc.Xstrncmp(tls, string, ts+16506, uint64(*(*int32)(unsafe.Pointer(bp + 56)))) != 0)) {
		goto __7
	}
	if !(i+1 >= objc-2) {
		goto __9
	}
	goto str_cmp_args
__9:
	;
	i++
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(reqlength)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), reqlength)
	}() != TCL_OK) {
		goto __10
	}
	return TCL_ERROR
__10:
	;
	goto __8
__7:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+16514,
		libc.VaList(bp, string)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+16210, ts+9944,
		string, uintptr(0)))
	return TCL_ERROR
__8:
	;
__6:
	;
	goto __3
__3:
	i++
	goto __2
	goto __4
__4:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringCatCmd --
//
//	This procedure is invoked to process the "string cat" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringCatCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:2923:1: */
	var i int32
	var objResultPtr uintptr

	if objc < 2 {
		// If there are no args, the result is an empty object.
		// Just leave the preset empty interp result.
		return TCL_OK
	}
	if objc == 2 {
		// Other trivial case, single arg, just return it.
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		return TCL_OK
	}
	objResultPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if (*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount > 1 {
		objResultPtr = XTcl_DuplicateObj(tls, objResultPtr)
	}
	for i = 2; i < objc; i++ {
		XTcl_AppendObjToObj(tls, objResultPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}
	XTcl_SetObjResult(tls, interp, objResultPtr)

	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringBytesCmd --
//
//	This procedure is invoked to process the "string bytelength" Tcl
//	command. See the user documentation for details on what it does. Note
//	that this command only functions correctly on properly formed Tcl UTF
//	strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringBytesCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:2978:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var length int32 at bp, 4

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16446)
		return TCL_ERROR
	}

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
		*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
		_ = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
	} else {
		XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp /* length */))))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringLenCmd --
//
//	This procedure is invoked to process the "string length" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringLenCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:3015:1: */
	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16446)
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringLowerCmd --
//
//	This procedure is invoked to process the "string tolower" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringLowerCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:3049:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var length1 int32 at bp, 4

	var length2 int32
	var string1 uintptr
	var string2 uintptr

	if objc < 2 || objc > 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16558)
		return TCL_ERROR
	}

	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()

	if objc == 2 {
		var resultPtr uintptr = XTcl_NewStringObj(tls, string1, *(*int32)(unsafe.Pointer(bp /* length1 */)))

		*(*int32)(unsafe.Pointer(bp /* length1 */)) = XTcl_UtfToLower(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes
			}
			return XTcl_GetString(tls, resultPtr)
		}())
		XTcl_SetObjLength(tls, resultPtr, *(*int32)(unsafe.Pointer(bp /* length1 */)))
		XTcl_SetObjResult(tls, interp, resultPtr)
	} else {
		// var first int32 at bp+4, 4

		// var last int32 at bp+8, 4

		var start uintptr
		var end uintptr
		var resultPtr uintptr

		*(*int32)(unsafe.Pointer(bp /* length1 */)) = XTcl_NumUtfChars(tls, string1, *(*int32)(unsafe.Pointer(bp))) - 1
		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp)), bp+4)
		}() != TCL_OK {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp + 4)) < 0 {
			*(*int32)(unsafe.Pointer(bp + 4 /* first */)) = 0
		}
		*(*int32)(unsafe.Pointer(bp + 8 /* last */)) = *(*int32)(unsafe.Pointer(bp + 4 /* first */))

		if objc == 4 && func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*int32)(unsafe.Pointer(bp)), bp+8)
		}() != TCL_OK {
			return TCL_ERROR
		}

		if *(*int32)(unsafe.Pointer(bp + 8)) >= *(*int32)(unsafe.Pointer(bp)) {
			*(*int32)(unsafe.Pointer(bp + 8 /* last */)) = *(*int32)(unsafe.Pointer(bp /* length1 */))
		}
		if *(*int32)(unsafe.Pointer(bp + 8)) < *(*int32)(unsafe.Pointer(bp + 4)) {
			XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			return TCL_OK
		}

		string1 = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
		}()
		start = XTcl_UtfAtIndex(tls, string1, *(*int32)(unsafe.Pointer(bp + 4 /* first */)))
		end = XTcl_UtfAtIndex(tls, start, *(*int32)(unsafe.Pointer(bp + 8))-*(*int32)(unsafe.Pointer(bp + 4))+1)
		resultPtr = XTcl_NewStringObj(tls, string1, int32((int64(end)-int64(string1))/1))
		string2 = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes
			}
			return XTcl_GetString(tls, resultPtr)
		}() + uintptr((int64(start)-int64(string1))/1)

		length2 = XTcl_UtfToLower(tls, string2)
		XTcl_SetObjLength(tls, resultPtr, int32(int64(length2)+(int64(start)-int64(string1))/1))

		XTcl_AppendToObj(tls, resultPtr, end, -1)
		XTcl_SetObjResult(tls, interp, resultPtr)
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringUpperCmd --
//
//	This procedure is invoked to process the "string toupper" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringUpperCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:3134:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var length1 int32 at bp, 4

	var length2 int32
	var string1 uintptr
	var string2 uintptr

	if objc < 2 || objc > 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16558)
		return TCL_ERROR
	}

	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()

	if objc == 2 {
		var resultPtr uintptr = XTcl_NewStringObj(tls, string1, *(*int32)(unsafe.Pointer(bp /* length1 */)))

		*(*int32)(unsafe.Pointer(bp /* length1 */)) = XTcl_UtfToUpper(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes
			}
			return XTcl_GetString(tls, resultPtr)
		}())
		XTcl_SetObjLength(tls, resultPtr, *(*int32)(unsafe.Pointer(bp /* length1 */)))
		XTcl_SetObjResult(tls, interp, resultPtr)
	} else {
		// var first int32 at bp+4, 4

		// var last int32 at bp+8, 4

		var start uintptr
		var end uintptr
		var resultPtr uintptr

		*(*int32)(unsafe.Pointer(bp /* length1 */)) = XTcl_NumUtfChars(tls, string1, *(*int32)(unsafe.Pointer(bp))) - 1
		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp)), bp+4)
		}() != TCL_OK {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp + 4)) < 0 {
			*(*int32)(unsafe.Pointer(bp + 4 /* first */)) = 0
		}
		*(*int32)(unsafe.Pointer(bp + 8 /* last */)) = *(*int32)(unsafe.Pointer(bp + 4 /* first */))

		if objc == 4 && func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*int32)(unsafe.Pointer(bp)), bp+8)
		}() != TCL_OK {
			return TCL_ERROR
		}

		if *(*int32)(unsafe.Pointer(bp + 8)) >= *(*int32)(unsafe.Pointer(bp)) {
			*(*int32)(unsafe.Pointer(bp + 8 /* last */)) = *(*int32)(unsafe.Pointer(bp /* length1 */))
		}
		if *(*int32)(unsafe.Pointer(bp + 8)) < *(*int32)(unsafe.Pointer(bp + 4)) {
			XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			return TCL_OK
		}

		string1 = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
		}()
		start = XTcl_UtfAtIndex(tls, string1, *(*int32)(unsafe.Pointer(bp + 4 /* first */)))
		end = XTcl_UtfAtIndex(tls, start, *(*int32)(unsafe.Pointer(bp + 8))-*(*int32)(unsafe.Pointer(bp + 4))+1)
		resultPtr = XTcl_NewStringObj(tls, string1, int32((int64(end)-int64(string1))/1))
		string2 = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes
			}
			return XTcl_GetString(tls, resultPtr)
		}() + uintptr((int64(start)-int64(string1))/1)

		length2 = XTcl_UtfToUpper(tls, string2)
		XTcl_SetObjLength(tls, resultPtr, int32(int64(length2)+(int64(start)-int64(string1))/1))

		XTcl_AppendToObj(tls, resultPtr, end, -1)
		XTcl_SetObjResult(tls, interp, resultPtr)
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringTitleCmd --
//
//	This procedure is invoked to process the "string totitle" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringTitleCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:3219:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var length1 int32 at bp, 4

	var length2 int32
	var string1 uintptr
	var string2 uintptr

	if objc < 2 || objc > 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16558)
		return TCL_ERROR
	}

	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()

	if objc == 2 {
		var resultPtr uintptr = XTcl_NewStringObj(tls, string1, *(*int32)(unsafe.Pointer(bp /* length1 */)))

		*(*int32)(unsafe.Pointer(bp /* length1 */)) = XTcl_UtfToTitle(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes
			}
			return XTcl_GetString(tls, resultPtr)
		}())
		XTcl_SetObjLength(tls, resultPtr, *(*int32)(unsafe.Pointer(bp /* length1 */)))
		XTcl_SetObjResult(tls, interp, resultPtr)
	} else {
		// var first int32 at bp+4, 4

		// var last int32 at bp+8, 4

		var start uintptr
		var end uintptr
		var resultPtr uintptr

		*(*int32)(unsafe.Pointer(bp /* length1 */)) = XTcl_NumUtfChars(tls, string1, *(*int32)(unsafe.Pointer(bp))) - 1
		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp)), bp+4)
		}() != TCL_OK {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp + 4)) < 0 {
			*(*int32)(unsafe.Pointer(bp + 4 /* first */)) = 0
		}
		*(*int32)(unsafe.Pointer(bp + 8 /* last */)) = *(*int32)(unsafe.Pointer(bp + 4 /* first */))

		if objc == 4 && func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*int32)(unsafe.Pointer(bp)), bp+8)
		}() != TCL_OK {
			return TCL_ERROR
		}

		if *(*int32)(unsafe.Pointer(bp + 8)) >= *(*int32)(unsafe.Pointer(bp)) {
			*(*int32)(unsafe.Pointer(bp + 8 /* last */)) = *(*int32)(unsafe.Pointer(bp /* length1 */))
		}
		if *(*int32)(unsafe.Pointer(bp + 8)) < *(*int32)(unsafe.Pointer(bp + 4)) {
			XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			return TCL_OK
		}

		string1 = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
		}()
		start = XTcl_UtfAtIndex(tls, string1, *(*int32)(unsafe.Pointer(bp + 4 /* first */)))
		end = XTcl_UtfAtIndex(tls, start, *(*int32)(unsafe.Pointer(bp + 8))-*(*int32)(unsafe.Pointer(bp + 4))+1)
		resultPtr = XTcl_NewStringObj(tls, string1, int32((int64(end)-int64(string1))/1))
		string2 = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes
			}
			return XTcl_GetString(tls, resultPtr)
		}() + uintptr((int64(start)-int64(string1))/1)

		length2 = XTcl_UtfToTitle(tls, string2)
		XTcl_SetObjLength(tls, resultPtr, int32(int64(length2)+(int64(start)-int64(string1))/1))

		XTcl_AppendToObj(tls, resultPtr, end, -1)
		XTcl_SetObjResult(tls, interp, resultPtr)
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringTrimCmd --
//
//	This procedure is invoked to process the "string trim" Tcl command.
//	See the user documentation for details on what it does. Note that this
//	command only functions correctly on properly formed Tcl UTF strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringTrimCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:3304:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var string1 uintptr
	var string2 uintptr
	var triml int32
	// var trimr int32 at bp+8, 4

	// var length1 int32 at bp+4, 4

	// var length2 int32 at bp, 4

	if objc == 3 {
		string2 = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp)
		}()
	} else if objc == 2 {
		string2 = uintptr(unsafe.Pointer(&XtclDefaultTrimSet))
		*(*int32)(unsafe.Pointer(bp /* length2 */)) = int32(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet))))
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16580)
		return TCL_ERROR
	}
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 4)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+4)
	}()

	triml = XTclTrim(tls, string1, *(*int32)(unsafe.Pointer(bp + 4 /* length1 */)), string2, *(*int32)(unsafe.Pointer(bp /* length2 */)), bp+8)

	XTcl_SetObjResult(tls, interp,
		XTcl_NewStringObj(tls, string1+uintptr(triml), *(*int32)(unsafe.Pointer(bp + 4))-triml-*(*int32)(unsafe.Pointer(bp + 8))))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringTrimLCmd --
//
//	This procedure is invoked to process the "string trimleft" Tcl
//	command. See the user documentation for details on what it does. Note
//	that this command only functions correctly on properly formed Tcl UTF
//	strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringTrimLCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:3351:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var string1 uintptr
	var string2 uintptr
	var trim int32
	// var length1 int32 at bp+4, 4

	// var length2 int32 at bp, 4

	if objc == 3 {
		string2 = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp)
		}()
	} else if objc == 2 {
		string2 = uintptr(unsafe.Pointer(&XtclDefaultTrimSet))
		*(*int32)(unsafe.Pointer(bp /* length2 */)) = int32(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet))))
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16580)
		return TCL_ERROR
	}
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 4)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+4)
	}()

	trim = XTclTrimLeft(tls, string1, *(*int32)(unsafe.Pointer(bp + 4 /* length1 */)), string2, *(*int32)(unsafe.Pointer(bp /* length2 */)))

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, string1+uintptr(trim), *(*int32)(unsafe.Pointer(bp + 4))-trim))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringTrimRCmd --
//
//	This procedure is invoked to process the "string trimright" Tcl
//	command. See the user documentation for details on what it does. Note
//	that this command only functions correctly on properly formed Tcl UTF
//	strings.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sStringTrimRCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:3397:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var string1 uintptr
	var string2 uintptr
	var trim int32
	// var length1 int32 at bp+4, 4

	// var length2 int32 at bp, 4

	if objc == 3 {
		string2 = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp)
		}()
	} else if objc == 2 {
		string2 = uintptr(unsafe.Pointer(&XtclDefaultTrimSet))
		*(*int32)(unsafe.Pointer(bp /* length2 */)) = int32(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet))))
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16580)
		return TCL_ERROR
	}
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 4)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+4)
	}()

	trim = XTclTrimRight(tls, string1, *(*int32)(unsafe.Pointer(bp + 4 /* length1 */)), string2, *(*int32)(unsafe.Pointer(bp /* length2 */)))

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, string1, *(*int32)(unsafe.Pointer(bp + 4))-trim))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclInitStringCmd --
//
//	This procedure creates the "string" Tcl command. See the user
//	documentation for details on what it does. Note that this command only
//	functions correctly on properly formed Tcl UTF strings.
//
//	Also note that the primary methods here (equal, compare, match, ...)
//	have bytecode equivalents. You will find the code for those in
//	tclExecute.c. The code here will only be used in the non-bc case (like
//	in an 'eval').
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTclInitStringCmd(tls *libc.TLS, interp uintptr) Tcl_Command { /* tclCmdMZ.c:3447:1: */

	return XTclMakeEnsemble(tls, interp, ts+16446, uintptr(unsafe.Pointer(&stringImplMap)))
}

var stringImplMap = [24]EnsembleImplMap{
	{Fname: ts + 16595, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16606, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16610, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16618, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16624, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16630, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16636, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16639, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16644, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16651, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16655, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16661, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16667, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16674, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 3064, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16682, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16690, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16698, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16706, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16711, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16720, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16730, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16738, Fproc: 0, FcompileProc: 0},
	{},
} /* tclCmdMZ.c:3450:34 */

//----------------------------------------------------------------------
//
// Tcl_SubstObjCmd --
//
//	This procedure is invoked to process the "subst" Tcl command. See the
//	user documentation for details on what it does. This command relies on
//	Tcl_SubstObj() for its implementation.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTclSubstOptions(tls *libc.TLS, interp uintptr, numOpts int32, opts uintptr, flagPtr uintptr) int32 { /* tclCmdMZ.c:3499:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var i int32
	var flags int32 = TCL_SUBST_ALL

	for i = 0; i < numOpts; i++ {
		// var optionIndex int32 at bp, 4

		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(opts + uintptr(i)*8)), uintptr(unsafe.Pointer(&substOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp) != TCL_OK {
			return TCL_ERROR
		}
		switch *(*int32)(unsafe.Pointer(bp /* optionIndex */)) {
		case 0 /* SUBST_NOBACKSLASHES */ :
			flags = flags & libc.CplInt32(TCL_SUBST_BACKSLASHES)
			break
		case 1 /* SUBST_NOCOMMANDS */ :
			flags = flags & libc.CplInt32(TCL_SUBST_COMMANDS)
			break
		case 2 /* SUBST_NOVARS */ :
			flags = flags & libc.CplInt32(TCL_SUBST_VARIABLES)
			break
		default:
			XTcl_Panic(tls, ts+16748, 0)
		}
	}
	*(*int32)(unsafe.Pointer(flagPtr)) = flags
	return TCL_OK
}

var substOptions = [4]uintptr{
	ts + 16798, ts + 16813, ts + 16825, uintptr(0),
} /* tclCmdMZ.c:3505:23 */

func XTcl_SubstObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:3539:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRSubstObjCmd})), dummy, objc, objv)
}

func XTclNRSubstObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:3549:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var flags int32 at bp, 4

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv,
			ts+16838)
		return TCL_ERROR
	}

	if XTclSubstOptions(tls, interp, objc-2, objv+uintptr(1)*8, bp) != TCL_OK {
		return TCL_ERROR
	}
	return XTcl_NRSubstObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), *(*int32)(unsafe.Pointer(bp /* flags */)))
}

//----------------------------------------------------------------------
//
// Tcl_SwitchObjCmd --
//
//	This object-based procedure is invoked to process the "switch" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_SwitchObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:3587:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRSwitchObjCmd})), dummy, objc, objv)
}

func XTclNRSwitchObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:3596:1: */
	bp := tls.Alloc(464)
	defer tls.Free(464)
	*(*int32)(unsafe.Pointer(bp + 408)) = objc

	var i int32
	var j int32
	// var index int32 at bp+392, 4

	var mode int32
	var foundmode int32
	var splitObjs int32
	var numMatchesSaved int32
	var noCase int32
	// var patternLength int32 at bp+412, 4

	var pattern uintptr
	var stringObj uintptr
	var indexVarObj uintptr
	var matchVarObj uintptr
	var savedObjv uintptr
	var regExpr Tcl_RegExp
	var iPtr uintptr
	var pc int32
	var bidx int32    // Index of body argument.
	var blist uintptr // List obj which is the body
	var ctxPtr uintptr
	var strCmpFn uintptr
	// var listv uintptr at bp+400, 8

	var cachePtr uintptr
	var cachePtr1 uintptr
	var emptyObj uintptr
	var matched int32
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	// var rangeObjAry [2]uintptr at bp+448, 16

	var substringObj uintptr
	var _objPtr uintptr
	// var info Tcl_RegExpInfo at bp+416, 32

	var matchesObj uintptr
	var indicesObj uintptr
	var bline int32
	// This is either a dynamic code word, when all elements are
	// relative to themselves, or something else less expected and
	// where we have no information. The result is the same in both
	// cases; tell the code to come that it doesn't know where it is,
	// which triggers reversion to the old behavior.

	var k int32
	savedObjv = objv
	regExpr = uintptr(0)
	iPtr = interp
	pc = 0
	bidx = 0
	blist = uintptr(0)
	strCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{libc.Xstrcmp}))

	mode = 0 /* OPT_EXACT */
	foundmode = 0
	indexVarObj = uintptr(0)
	matchVarObj = uintptr(0)
	numMatchesSaved = 0
	noCase = 0
	i = 1
__1:
	if !(i < *(*int32)(unsafe.Pointer(bp + 408))-2) {
		goto __3
	}
	if !(int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}()))) != '-') {
		goto __4
	}
	goto __3
__4:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options5)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+392) != TCL_OK) {
		goto __5
	}
	return TCL_ERROR
__5:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 392 /* index */))) {
	// General options.

	case uint32(6) /* OPT_LAST */ :
		goto __7
	case uint32(4) /* OPT_NOCASE */ :
		goto __8

		// Handle the different switch mode options.

	default:
		goto __9

		// Check for TIP#75 options specifying the variables to write
		// regexp information into.

	case uint32(2) /* OPT_INDEXV */ :
		goto __10
	case uint32(3) /* OPT_MATCHV */ :
		goto __11
	}
	goto __6
	// General options.

__7:
	i++
	goto finishedOptions
__8:
	strCmpFn = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	}{XTclUtfCasecmp}))
	noCase = 1
	goto __6

	// Handle the different switch mode options.

__9:
	if !(foundmode != 0) {
		goto __12
	}
	// Mode already set via -exact, -glob, or -regexp.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+16891,
		libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		}(), options5[mode])))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+7420, ts+16932,
		ts+16939, uintptr(0)))
	return TCL_ERROR
__12:
	;
	foundmode = 1
	mode = *(*int32)(unsafe.Pointer(bp + 392 /* index */))
	goto __6

	// Check for TIP#75 options specifying the variables to write
	// regexp information into.

__10:
	i++
	if !(i >= *(*int32)(unsafe.Pointer(bp + 408))-2) {
		goto __13
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+16949,
		libc.VaList(bp+56, ts+16993)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+7420, ts+16932,
		ts+17003, uintptr(0)))
	return TCL_ERROR
__13:
	;
	indexVarObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	numMatchesSaved = -1
	goto __6
__11:
	i++
	if !(i >= *(*int32)(unsafe.Pointer(bp + 408))-2) {
		goto __14
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+16949,
		libc.VaList(bp+104, ts+17009)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+112, ts+3593, ts+7420, ts+16932,
		ts+17003, uintptr(0)))
	return TCL_ERROR
__14:
	;
	matchVarObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	numMatchesSaved = -1
	goto __6
__6:
	;
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;

finishedOptions:
	if !(*(*int32)(unsafe.Pointer(bp + 408))-i < 2) {
		goto __15
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+17019)
	return TCL_ERROR
__15:
	;
	if !(indexVarObj != uintptr(0) && mode != 5) {
		goto __16
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+17074, libc.VaList(bp+152, ts+16993)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+160, ts+3593, ts+7420, ts+16932,
		ts+17108, uintptr(0)))
	return TCL_ERROR
__16:
	;
	if !(matchVarObj != uintptr(0) && mode != 5) {
		goto __17
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+17074, libc.VaList(bp+200, ts+17009)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+208, ts+3593, ts+7420, ts+16932,
		ts+17108, uintptr(0)))
	return TCL_ERROR
__17:
	;

	stringObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	*(*int32)(unsafe.Pointer(bp + 408 /* objc */)) -= i + 1
	objv += 8 * uintptr(i+1)
	bidx = i + 1 // First after the match string.

	// If all of the pattern/command pairs are lumped into a single argument,
	// split them out again.
	//
	// TIP #280: Determine the lines the words in the list start at, based on
	// the same data for the list word itself. The cmdFramePtr line
	// information is manipulated directly.

	splitObjs = 0
	if !(*(*int32)(unsafe.Pointer(bp + 408)) == 1) {
		goto __18
	}

	blist = *(*uintptr)(unsafe.Pointer(objv))
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 400)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 408)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp+408, bp+400)
	}() != TCL_OK) {
		goto __19
	}
	return TCL_ERROR
__19:
	;

	// Ensure that the list is non-empty.

	if !(*(*int32)(unsafe.Pointer(bp + 408)) < 1) {
		goto __20
	}
	XTcl_WrongNumArgs(tls, interp, 1, savedObjv,
		ts+17124)
	return TCL_ERROR
__20:
	;
	objv = *(*uintptr)(unsafe.Pointer(bp + 400 /* listv */))
	splitObjs = 1
__18:
	;

	// Complain if there is an odd number of words in the list of patterns and
	// bodies.

	if !(*(*int32)(unsafe.Pointer(bp + 408))%2 != 0) {
		goto __21
	}
	XTcl_ResetResult(tls, interp)
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+17181, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+248, ts+3593, ts+7420, ts+16932, ts+17215,
		uintptr(0)))

	// Check if this can be due to a badly placed comment in the switch
	// block.
	//
	// The following is an heuristic to detect the infamous "comment in
	// switch" error: just check if a pattern begins with '#'.

	if !(splitObjs != 0) {
		goto __22
	}
	i = 0
__23:
	if !(i < *(*int32)(unsafe.Pointer(bp + 408))) {
		goto __25
	}
	if !(int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}()))) == '#') {
		goto __26
	}
	XTcl_AppendToObj(tls, XTcl_GetObjResult(tls, interp),

		ts+17222, -1)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+288, ts+3593, ts+7420, ts+16932,
		ts+17215, ts+17330, uintptr(0)))
	goto __25
__26:
	;
	goto __24
__24:
	i = i + 2
	goto __23
	goto __25
__25:
	;
__22:
	;

	return TCL_ERROR
__21:
	;

	// Complain if the last body is a continuation. Note that this check
	// assumes that the list is non-empty!

	if !(libc.Xstrcmp(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(*(*int32)(unsafe.Pointer(bp + 408))-1)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(*(*int32)(unsafe.Pointer(bp + 408))-1)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(*(*int32)(unsafe.Pointer(bp + 408))-1)*8)))
	}(), ts+5772) == 0) {
		goto __27
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+17339,
		libc.VaList(bp+336, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(*(*int32)(unsafe.Pointer(bp + 408))-2)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(*(*int32)(unsafe.Pointer(bp + 408))-2)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(*(*int32)(unsafe.Pointer(bp + 408))-2)*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+344, ts+3593, ts+7420, ts+16932, ts+17215,
		ts+17374, uintptr(0)))
	return TCL_ERROR
__27:
	;

	i = 0
__28:
	if !(i < *(*int32)(unsafe.Pointer(bp + 408))) {
		goto __30
	}
	// See if the pattern matches the string.

	pattern = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 412)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+412)
	}()

	if !(i == *(*int32)(unsafe.Pointer(bp + 408))-2 && int32(*(*int8)(unsafe.Pointer(pattern))) == 'd' &&
		libc.Xstrcmp(tls, pattern, ts+11507) == 0) {
		goto __31
	}
	emptyObj = uintptr(0)

	// If either indexVarObj or matchVarObj are non-NULL, we're in
	// REGEXP mode but have reached the default clause anyway. TIP#75
	// specifies that we set the variables to empty lists (== empty
	// objects) in that case.

	if !(indexVarObj != uintptr(0)) {
		goto __32
	}
__33:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __36
	}
	emptyObj = XTclThreadAllocObj(tls)
	goto __37
__36:
	emptyObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(emptyObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__37:
	;
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
	(*Tcl_Obj)(unsafe.Pointer(emptyObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(emptyObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(emptyObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(emptyObj)).FtypePtr = uintptr(0)

	if !(XTcl_ObjSetVar2(tls, interp, indexVarObj, uintptr(0), emptyObj,
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __38
	}
	return TCL_ERROR
__38:
	;
__32:
	;
	if !(matchVarObj != uintptr(0)) {
		goto __39
	}
	if !(emptyObj == uintptr(0)) {
		goto __40
	}
__41:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __44
	}
	emptyObj = XTclThreadAllocObj(tls)
	goto __45
__44:
	emptyObj = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(emptyObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__45:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
	(*Tcl_Obj)(unsafe.Pointer(emptyObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(emptyObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(emptyObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(emptyObj)).FtypePtr = uintptr(0)

__40:
	;
	if !(XTcl_ObjSetVar2(tls, interp, matchVarObj, uintptr(0), emptyObj,
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __46
	}
	return TCL_ERROR
__46:
	;
__39:
	;
	goto matchFound
__31:
	;

	switch mode {
	case 0 /* OPT_EXACT */ :
		goto __48
	case 1 /* OPT_GLOB */ :
		goto __49
	case 5 /* OPT_REGEXP */ :
		goto __50
	}
	goto __47
__48:
	if !((*struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{strCmpFn})).f(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(stringObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(stringObj)).Fbytes
		}
		return XTcl_GetString(tls, stringObj)
	}(), pattern) == 0) {
		goto __51
	}
	goto matchFound
__51:
	;
	goto __47
__49:
	if !(XTcl_StringCaseMatch(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(stringObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(stringObj)).Fbytes
		}
		return XTcl_GetString(tls, stringObj)
	}(), pattern, noCase) != 0) {
		goto __52
	}
	goto matchFound
__52:
	;
	goto __47
__50:
	regExpr = XTcl_GetRegExpFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)),
		TCL_REG_ADVANCED|func() int32 {
			if noCase != 0 {
				return TCL_REG_NOCASE
			}
			return 0
		}())
	if !(regExpr == uintptr(0)) {
		goto __53
	}
	return TCL_ERROR
	goto __54
__53:
	matched = XTcl_RegExpExecObj(tls, interp, regExpr, stringObj, 0,
		numMatchesSaved, 0)

	if !(matched < 0) {
		goto __55
	}
	return TCL_ERROR
	goto __56
__55:
	if !(matched != 0) {
		goto __57
	}
	goto matchFoundRegexp
__57:
	;
__56:
	;
__54:
	;
	goto __47
__47:
	;
	goto __29
__29:
	i = i + 2
	goto __28
	goto __30
__30:
	;
	return TCL_OK

matchFoundRegexp:
	// We are operating in REGEXP mode and we need to store information about
	// what we matched in some user-nominated arrays. So build the lists of
	// values and indices to write here. [TIP#75]

	if !(numMatchesSaved != 0) {
		goto __58
	}
	indicesObj = uintptr(0)

	XTcl_RegExpGetInfo(tls, regExpr, bp+416)
	if !(matchVarObj != uintptr(0)) {
		goto __59
	}
__61:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __64
	}
	matchesObj = XTclThreadAllocObj(tls)
	goto __65
__64:
	matchesObj = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(matchesObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__65:
	;
	goto __62
__62:
	if 0 != 0 {
		goto __61
	}
	goto __63
__63:
	;
	(*Tcl_Obj)(unsafe.Pointer(matchesObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(matchesObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(matchesObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(matchesObj)).FtypePtr = uintptr(0)

	goto __60
__59:
	matchesObj = uintptr(0)
__60:
	;
	if !(indexVarObj != uintptr(0)) {
		goto __66
	}
__67:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __70
	}
	indicesObj = XTclThreadAllocObj(tls)
	goto __71
__70:
	indicesObj = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(indicesObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__71:
	;
	goto __68
__68:
	if 0 != 0 {
		goto __67
	}
	goto __69
__69:
	;
	(*Tcl_Obj)(unsafe.Pointer(indicesObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(indicesObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(indicesObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(indicesObj)).FtypePtr = uintptr(0)

__66:
	;

	j = 0
__72:
	if !(j <= (*Tcl_RegExpInfo)(unsafe.Pointer(bp+416)).Fnsubs) {
		goto __74
	}
	if !(indexVarObj != uintptr(0)) {
		goto __75
	}

	if !((*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+416)).Fmatches+uintptr(j)*16)).Fend > int64(0)) {
		goto __76
	}
	*(*uintptr)(unsafe.Pointer(bp + 448)) = XTcl_NewLongObj(tls, (*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+416 /* &info */)).Fmatches+uintptr(j)*16)).Fstart)
	*(*uintptr)(unsafe.Pointer(bp + 448 + 1*8)) = XTcl_NewLongObj(tls, (*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+416)).Fmatches+uintptr(j)*16)).Fend-int64(1))
	goto __77
__76:
__78:
	;
__81:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0
	}()) {
		goto __84
	}
	*(*uintptr)(unsafe.Pointer(bp + 448 + 1*8)) = XTclThreadAllocObj(tls)
	goto __85
__84:
	*(*uintptr)(unsafe.Pointer(bp + 448 + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 448 + 1*8)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects--
__85:
	;
	goto __82
__82:
	if 0 != 0 {
		goto __81
	}
	goto __83
__83:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 448 + 1*8)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 448 + 1*8)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 448 + 1*8)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 448 + 1*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __79
__79:
	if 0 != 0 {
		goto __78
	}
	goto __80
__80:
	;
	*(*uintptr)(unsafe.Pointer(bp + 448)) = *(*uintptr)(unsafe.Pointer(bp + 448 + 1*8))
__77:
	;

	// Never fails; the object is always clean at this point.

	XTcl_ListObjAppendElement(tls, uintptr(0), indicesObj,
		XTcl_NewListObj(tls, 2, bp+448))
__75:
	;

	if !(matchVarObj != uintptr(0)) {
		goto __86
	}

	substringObj = XTcl_GetRange(tls, stringObj,
		int32((*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+416 /* &info */)).Fmatches+uintptr(j)*16)).Fstart), int32((*Tcl_RegExpIndices)(unsafe.Pointer((*Tcl_RegExpInfo)(unsafe.Pointer(bp+416)).Fmatches+uintptr(j)*16)).Fend-int64(1)))

	// Never fails; the object is always clean at this point.

	XTcl_ListObjAppendElement(tls, uintptr(0), matchesObj, substringObj)
__86:
	;
	goto __73
__73:
	j++
	goto __72
	goto __74
__74:
	;

	if !(indexVarObj != uintptr(0)) {
		goto __87
	}
	if !(XTcl_ObjSetVar2(tls, interp, indexVarObj, uintptr(0), indicesObj,
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __88
	}
	// Careful! Check to see if we have allocated the list of
	// matched strings; if so (but there was an error assigning
	// the indices list) we have a potential memory leak because
	// the match list has not been written to a variable. Except
	// that we'll clean that up right now.

	if !(matchesObj != uintptr(0)) {
		goto __89
	}
__90:
	_objPtr = matchesObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __93
	}
	XTclFreeObj(tls, _objPtr)
__93:
	;
	goto __91
__91:
	if 0 != 0 {
		goto __90
	}
	goto __92
__92:
	;
__89:
	;
	return TCL_ERROR
__88:
	;
__87:
	;
	if !(matchVarObj != uintptr(0)) {
		goto __94
	}
	if !(XTcl_ObjSetVar2(tls, interp, matchVarObj, uintptr(0), matchesObj,
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __95
	}
	// Unlike above, if indicesObj is non-NULL at this point, it
	// will have been written to a variable already and will hence
	// not be leaked.

	return TCL_ERROR
__95:
	;
__94:
	;
__58:
	;

	// We've got a match. Find a body to execute, skipping bodies that are
	// "-".

matchFound:
	ctxPtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(CmdFrame{})))
	*(*CmdFrame)(unsafe.Pointer(ctxPtr)) = *(*CmdFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr))

	if !(splitObjs != 0) {
		goto __96
	}
	// We have to perform the GetSrc and other type dependent handling of
	// the frame here because we are munging with the line numbers,
	// something the other commands like if, etc. are not doing. Them are
	// fine with simply passing the CmdFrame through and having the
	// special handling done in 'info frame', or the bc compiler

	if !((*CmdFrame)(unsafe.Pointer(ctxPtr)).Ftype == 2) {
		goto __97
	}
	// Type BC => ctxPtr->data.eval.path    is not used.
	//		  ctxPtr->data.tebc.codePtr is used instead.

	XTclGetSrcInfoForPc(tls, ctxPtr)
	pc = 1

	// The line information in the cmdFrame is now a copy we do not
	// own.
__97:
	;

	if !((*CmdFrame)(unsafe.Pointer(ctxPtr)).Ftype == 4 && *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(ctxPtr)).Fline + uintptr(bidx)*4)) >= 0) {
		goto __98
	}
	bline = *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(ctxPtr)).Fline + uintptr(bidx)*4))

	(*CmdFrame)(unsafe.Pointer(ctxPtr)).Fline = XTcl_Alloc(tls, uint32(uint64(*(*int32)(unsafe.Pointer(bp + 408)))*uint64(unsafe.Sizeof(int32(0)))))
	(*CmdFrame)(unsafe.Pointer(ctxPtr)).Fnline = *(*int32)(unsafe.Pointer(bp + 408 /* objc */))
	XTclListLines(tls, blist, bline, *(*int32)(unsafe.Pointer(bp + 408 /* objc */)), (*CmdFrame)(unsafe.Pointer(ctxPtr)).Fline, objv)
	goto __99
__98:

	(*CmdFrame)(unsafe.Pointer(ctxPtr)).Fline = XTcl_Alloc(tls, uint32(uint64(*(*int32)(unsafe.Pointer(bp + 408)))*uint64(unsafe.Sizeof(int32(0)))))
	(*CmdFrame)(unsafe.Pointer(ctxPtr)).Fnline = *(*int32)(unsafe.Pointer(bp + 408 /* objc */))
	k = 0
__100:
	if !(k < *(*int32)(unsafe.Pointer(bp + 408))) {
		goto __102
	}
	*(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(ctxPtr)).Fline + uintptr(k)*4)) = -1
	goto __101
__101:
	k++
	goto __100
	goto __102
__102:
	;
__99:
	;
__96:
	;

	j = i + 1
__103:
	;
	if !(j >= *(*int32)(unsafe.Pointer(bp + 408))) {
		goto __106
	}
	// This shouldn't happen since we've checked that the last body is
	// not a continuation...

	XTcl_Panic(tls, ts+17386, 0)
__106:
	;
	if !(libc.Xstrcmp(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8)))
	}(), ts+5772) != 0) {
		goto __107
	}
	goto __105
__107:
	;
	goto __104
__104:
	j = j + 2
	goto __103
	goto __105
__105:
	;

	// TIP #280: Make invoking context available to switch branch.

	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sSwitchPostProc})), uintptr(Intptr_t(splitObjs)), ctxPtr,
		uintptr(Intptr_t(pc)), pattern)
	return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8)), 0, ctxPtr, func() int32 {
		if splitObjs != 0 {
			return j
		}
		return bidx + j
	}())
}

var options5 = [8]uintptr{
	ts + 14906, ts + 14913, ts + 16993, ts + 17009, ts + 14955, ts + 14974,
	ts + 15828, uintptr(0),
} /* tclCmdMZ.c:3620:23 */

func sSwitchPostProc(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdMZ.c:4057:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// Unpack the preserved data

	var splitObjs int32 = int32(*(*ClientData)(unsafe.Pointer(data)))
	var ctxPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))
	var pc int32 = int32(*(*ClientData)(unsafe.Pointer(data + 2*8)))
	var pattern uintptr = *(*ClientData)(unsafe.Pointer(data + 3*8))
	var patternLength int32 = int32(libc.Xstrlen(tls, pattern))

	// Clean up TIP 280 context information

	if splitObjs != 0 {
		XTclpFree(tls, (*CmdFrame)(unsafe.Pointer(ctxPtr)).Fline)
		if pc != 0 && (*CmdFrame)(unsafe.Pointer(ctxPtr)).Ftype == 4 {
			// Death of SrcInfo reference.

			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(ctxPtr + 40))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
	}

	// Generate an error message if necessary.

	if result == TCL_ERROR {
		var limit int32 = 50
		var overflow int32 = libc.Bool32(patternLength > limit)

		XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
			ts+17436,
			libc.VaList(bp, func() int32 {
				if overflow != 0 {
					return limit
				}
				return patternLength
			}(), pattern,
				func() uintptr {
					if overflow != 0 {
						return ts + 7891 /* "..." */
					}
					return ts + 2046 /* "" */
				}(), XTcl_GetErrorLine(tls, interp))))
	}
	XTclStackFree(tls, interp, ctxPtr)
	return result
}

//----------------------------------------------------------------------
//
// Tcl_ThrowObjCmd --
//
//	This procedure is invoked to process the "throw" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ThrowObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:4121:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var options uintptr
	// var len int32 at bp+40, 4

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17464)
		return TCL_ERROR
	}

	// The type must be a list of at least length 1.

	if XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+40) != TCL_OK {
		return TCL_ERROR
	} else if *(*int32)(unsafe.Pointer(bp + 40)) < 1 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+17477, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+17505, ts+17511,
			uintptr(0)))
		return TCL_ERROR
	}

	// Now prepare the result options dictionary. We use the list API as it is
	// slightly more convenient.

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				options = XTclThreadAllocObj(tls)
			} else {
				options = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(options + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(options)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([32]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(options)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(options)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(options)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([32]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(options)).Fbytes, ts+17524, uint64(int32(uint64(unsafe.Sizeof([32]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(options)).Fbytes + 31)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(options)).Flength = int32(uint64(unsafe.Sizeof([32]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(options)).FtypePtr = uintptr(0)
		{
		}
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), options, *(*uintptr)(unsafe.Pointer(objv + 1*8)))

	// We're ready to go. Fire things into the low-level result machinery.

	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	return XTcl_SetReturnOptions(tls, interp, options)
}

//----------------------------------------------------------------------
//
// Tcl_TimeObjCmd --
//
//	This object-based procedure is invoked to process the "time" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_TimeObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:4183:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var objPtr uintptr
	// var objs [4]uintptr at bp+40, 32

	var i int32
	var result int32
	// var count int32 at bp, 4

	var totalMicroSec float64
	// var start Tcl_Time at bp+8, 16

	// var stop Tcl_Time at bp+24, 16

	if objc == 2 {
		*(*int32)(unsafe.Pointer(bp /* count */)) = 1
	} else if objc == 3 {
		result = func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp)
		}()
		if result != TCL_OK {
			return result
		}
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17556)
		return TCL_ERROR
	}

	objPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	i = *(*int32)(unsafe.Pointer(bp /* count */))
	XTcl_GetTime(tls, bp+8)
	for libc.PostDecInt32(&i, 1) > 0 {
		result = XTclEvalObjEx(tls, interp, objPtr, 0, uintptr(0), 0)
		if result != TCL_OK {
			return result
		}
	}
	XTcl_GetTime(tls, bp+24)
	totalMicroSec = float64((*Tcl_Time)(unsafe.Pointer(bp+24)).Fsec-(*Tcl_Time)(unsafe.Pointer(bp+8)).Fsec)*1.0e6 +
		float64((*Tcl_Time)(unsafe.Pointer(bp+24)).Fusec-(*Tcl_Time)(unsafe.Pointer(bp+8)).Fusec)

	if *(*int32)(unsafe.Pointer(bp)) <= 1 {
		// Use int obj since we know time is not fractional. [Bug 1202178]

		*(*uintptr)(unsafe.Pointer(bp + 40)) = XTcl_NewWideIntObj(tls, func() int64 {
			if *(*int32)(unsafe.Pointer(bp)) <= 0 {
				return int64(0)
			}
			return Tcl_WideInt(totalMicroSec)
		}())
	} else {
		*(*uintptr)(unsafe.Pointer(bp + 40)) = XTcl_NewDoubleObj(tls, totalMicroSec/float64(*(*int32)(unsafe.Pointer(bp))))
	}

	// Construct the result as a list because many programs have always parsed
	// as such (extracting the first element, typically).

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)) = XTclThreadAllocObj(tls)
			} else {
				*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)) + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)))).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)))).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)))).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)))).Fbytes, ts+10828, uint64(int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)))).Fbytes + 12)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)))).Flength = int32(uint64(unsafe.Sizeof([13]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)))).FtypePtr = uintptr(0)
		{
		}
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)) = XTclThreadAllocObj(tls)
			} else {
				*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)) + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)))).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)))).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)))).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)))).Fbytes, ts+17572, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)))).Fbytes + 3)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)))).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)))).FtypePtr = uintptr(0)
		{
		}
	}
	for ok4 := true; ok4; ok4 = 0 != 0 {
		for ok5 := true; ok5; ok5 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				*(*uintptr)(unsafe.Pointer(bp + 40 + 3*8)) = XTclThreadAllocObj(tls)
			} else {
				*(*uintptr)(unsafe.Pointer(bp + 40 + 3*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 3*8)) + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 3*8)))).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 3*8)))).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 3*8)))).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 3*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 3*8)))).Fbytes, ts+17576, uint64(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 3*8)))).Fbytes + 9)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 3*8)))).Flength = int32(uint64(unsafe.Sizeof([10]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 + 3*8)))).FtypePtr = uintptr(0)
		{
		}
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, 4, bp+40))

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_TimeRateObjCmd --
//
//	This object-based procedure is invoked to process the "timerate" Tcl
//	command.
//
//	This is similar to command "time", except the execution limited by
//	given time (in milliseconds) instead of repetition count.
//
// Example:
//	timerate {after 5} 1000; # equivalent to: time {after 5} [expr 1000/5]
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_TimeRateObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:4281:1: */
	bp := tls.Alloc(200)
	defer tls.Free(200)

	// global measure-overhead
	// var overhead float64 at bp+48, 8
	// given measure-overhead
	var objPtr uintptr
	var result int32
	var i int32
	var calibrate uintptr
	var direct uintptr
	var count Tcl_WideUInt // Holds repetition count
	// var maxms Tcl_WideInt at bp+56, 8

	// Maximal running time (in milliseconds)
	var maxcnt Tcl_WideUInt
	// Maximal count of iterations.
	var threshold Tcl_WideUInt // Current threshold for check time (faster
	// repeat count without time check)
	var maxIterTm Tcl_WideUInt // Max time of some iteration as max
	// threshold, additionally avoiding divide to
	// zero (i.e., never < 1)
	var factor uint16 // Factor (4..50) limiting threshold to avoid
	// growth of execution time.
	var start Tcl_WideInt
	var middle Tcl_WideInt
	var stop Tcl_WideInt
	// var now Tcl_Time at bp+120, 16

	var rootPtr uintptr
	var codePtr uintptr
	// var index int32 at bp+40, 4
	// max-count
	// var v Tcl_WideInt at bp+64, 8

	var cachePtr uintptr
	var _objPtr uintptr
	var cachePtr1 uintptr
	var _objPtr1 uintptr
	// var clobjv [6]uintptr at bp+72, 48

	var maxCalTime Tcl_WideInt
	var lastMeasureOverhead float64
	// Estimate the time of overhead (microsecs).

	var curOverhead Tcl_WideUInt
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	var cachePtr6 uintptr
	// var objarr [8]uintptr at bp+136, 64

	var objs uintptr
	var usec Tcl_WideUInt
	var val Tcl_WideUInt
	var digits int32
	*(*float64)(unsafe.Pointer(bp + 48 /* overhead */)) = float64(-1)
	calibrate = uintptr(0)
	direct = uintptr(0)
	count = uint64(0)
	*(*Tcl_WideInt)(unsafe.Pointer(bp + 56 /* maxms */)) = libc.Int64FromUint64(Tcl_WideUInt(int64(Tcl_WideUInt(libc.Uint64(libc.Uint64FromInt32(-1)))>>1)) + uint64(1))
	maxcnt = Tcl_WideUInt(int64(Tcl_WideUInt(libc.Uint64(libc.Uint64FromInt32(-1))) >> 1))
	threshold = uint64(1)
	maxIterTm = uint64(1)
	factor = uint16(50)
	codePtr = uintptr(0)

	i = 1
__1:
	if !(i < objc-1) {
		goto __3
	}

	if !(XTcl_GetIndexFromObjStruct(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options6)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp+40) != TCL_OK) {
		goto __4
	}
	goto __3
__4:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 40)) == 3) {
		goto __5
	}
	i++
	goto __3
__5:
	;
	switch *(*int32)(unsafe.Pointer(bp + 40 /* index */)) {
	case 0 /* TMRT_EV_DIRECT */ :
		goto __7
	case 1 /* TMRT_OVERHEAD */ :
		goto __8
	case 2 /* TMRT_CALIBRATE */ :
		goto __9
	}
	goto __6
__7:
	direct = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	goto __6
__8:
	if !(libc.PreIncInt32(&i, 1) >= objc-1) {
		goto __10
	}
	goto usage
__10:
	;
	if !(XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+48) != TCL_OK) {
		goto __11
	}
	return TCL_ERROR
__11:
	;
	goto __6
__9:
	calibrate = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	goto __6
__6:
	;
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;

	if !(i >= objc || i < objc-3) {
		goto __12
	}
usage:
	XTcl_WrongNumArgs(tls, interp, 1, objv,

		ts+17586)
	return TCL_ERROR
__12:
	;
	objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PostIncInt32(&i, 1))*8))
	if !(i < objc) {
		goto __13
	} // max-time
	result = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PostIncInt32(&i, 1))*8)), bp+56)
	if !(result != TCL_OK) {
		goto __14
	}
	return result
__14:
	;
	if !(i < objc) {
		goto __15
	}

	result = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+64)
	if !(result != TCL_OK) {
		goto __16
	}
	return result
__16:
	;
	if *(*Tcl_WideInt)(unsafe.Pointer(bp + 64)) > int64(0) {
		maxcnt = uint64(*(*Tcl_WideInt)(unsafe.Pointer(bp + 64 /* v */)))
	} else {
		maxcnt = uint64(0)
	}
__15:
	;
__13:
	;

	// If we are doing calibration.

	if !(calibrate != 0) {
		goto __17
	}
	// If no time specified for the calibration.

	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 56)) == libc.Int64FromUint64(Tcl_WideUInt(int64(Tcl_WideUInt(libc.Uint64(libc.Uint64FromInt32(-1)))>>1))+uint64(1))) {
		goto __18
	}
	maxCalTime = int64(5000)
	lastMeasureOverhead = measureOverhead

	*(*uintptr)(unsafe.Pointer(bp + 72)) = *(*uintptr)(unsafe.Pointer(objv))
	i = 1
	if !(direct != 0) {
		goto __19
	}
	*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(libc.PostIncInt32(&i, 1))*8)) = direct
__19:
	;
	*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(libc.PostIncInt32(&i, 1))*8)) = objPtr

	// Reset last measurement overhead.

	measureOverhead = float64(0)

	// Self-call with 100 milliseconds to warm-up, before entering the
	// calibration cycle.

__20:
	;
__23:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __26
	}
	*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)) = XTclThreadAllocObj(tls)
	goto __27
__26:
	*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__27:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)) + 32)) = int64(100)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)))).FrefCount++
	result = XTcl_TimeRateObjCmd(tls, uintptr(0), interp, i+1, bp+72)
__28:
	_objPtr = *(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __31
	}
	XTclFreeObj(tls, _objPtr)
__31:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	if !(result != TCL_OK) {
		goto __32
	}
	return result
__32:
	;

	i--
	*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(libc.PostIncInt32(&i, 1))*8)) = calibrate
	*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(libc.PostIncInt32(&i, 1))*8)) = objPtr

	// Set last measurement overhead to max.

	measureOverhead = float64(libc.Uint64FromInt32(-1))

	// Run the calibration cycle until it is more precise.

	*(*Tcl_WideInt)(unsafe.Pointer(bp + 56 /* maxms */)) = int64(-1000)
__33:
	lastMeasureOverhead = measureOverhead
__36:
	;
__39:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __42
	}
	*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)) = XTclThreadAllocObj(tls)
	goto __43
__42:
	*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__43:
	;
	goto __40
__40:
	if 0 != 0 {
		goto __39
	}
	goto __41
__41:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)) + 32)) = int64(int32(*(*Tcl_WideInt)(unsafe.Pointer(bp + 56))))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __37
__37:
	if 0 != 0 {
		goto __36
	}
	goto __38
__38:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8)))).FrefCount++
	result = XTcl_TimeRateObjCmd(tls, uintptr(0), interp, i+1, bp+72)
__44:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*8))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __47
	}
	XTclFreeObj(tls, _objPtr1)
__47:
	;
	goto __45
__45:
	if 0 != 0 {
		goto __44
	}
	goto __46
__46:
	;
	if !(result != TCL_OK) {
		goto __48
	}
	return result
__48:
	;
	maxCalTime = maxCalTime + *(*Tcl_WideInt)(unsafe.Pointer(bp + 56))

	// Increase maxms for more precise calibration.

	*(*Tcl_WideInt)(unsafe.Pointer(bp + 56 /* maxms */)) -= -*(*Tcl_WideInt)(unsafe.Pointer(bp + 56)) / int64(4)

	// As long as new value more as 0.05% better
	goto __34
__34:
	if (measureOverhead >= lastMeasureOverhead ||
		measureOverhead/lastMeasureOverhead <= 0.9995) &&
		maxCalTime > int64(0) {
		goto __33
	}
	goto __35
__35:
	;

	return result
__18:
	;
	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 56)) == int64(0)) {
		goto __49
	}
	// Reset last measurement overhead

	measureOverhead = float64(0)
	XTcl_SetObjResult(tls, interp, XTcl_NewLongObj(tls, int64(0)))
	return TCL_OK
__49:
	;

	// If time is negative, make current overhead more precise.

	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 56)) > int64(0)) {
		goto __50
	}
	// Set last measurement overhead to max.

	measureOverhead = float64(libc.Uint64FromInt32(-1))
	goto __51
__50:
	*(*Tcl_WideInt)(unsafe.Pointer(bp + 56 /* maxms */)) = -*(*Tcl_WideInt)(unsafe.Pointer(bp + 56 /* maxms */))
__51:
	;
__17:
	;

	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 56)) == libc.Int64FromUint64(Tcl_WideUInt(int64(Tcl_WideUInt(libc.Uint64(libc.Uint64FromInt32(-1)))>>1))+uint64(1))) {
		goto __52
	}
	*(*Tcl_WideInt)(unsafe.Pointer(bp + 56 /* maxms */)) = int64(1000)
__52:
	;
	if !(*(*float64)(unsafe.Pointer(bp + 48)) == float64(-1)) {
		goto __53
	}
	*(*float64)(unsafe.Pointer(bp + 48 /* overhead */)) = measureOverhead
__53:
	;

	// Ensure that resetting of result will not smudge the further
	// measurement.

	XTcl_ResetResult(tls, interp)

	// Compile object if needed.

	if !!(direct != 0) {
		goto __54
	}
	if !(XTclInterpReady(tls, interp) != TCL_OK) {
		goto __55
	}
	return TCL_ERROR
__55:
	;
	codePtr = XTclCompileObj(tls, interp, objPtr, uintptr(0), 0)
	sTclPreserveByteCode(tls, codePtr)
__54:
	;

	// Get start and stop time.

	XTcl_GetTime(tls, bp+120)
	start = (*Tcl_Time)(unsafe.Pointer(bp + 120 /* &now */)).Fsec
	start = start * int64(1000000)
	start = start + (*Tcl_Time)(unsafe.Pointer(bp+120)).Fusec
	middle = start

	// Time to stop execution (in microsecs).

	stop = start + *(*Tcl_WideInt)(unsafe.Pointer(bp + 56))*int64(1000)

	// Start measurement.

	if !(maxcnt > uint64(0)) {
		goto __56
	}
__57:
	if !(1 != 0) {
		goto __58
	}
	// Evaluate a single iteration.

	count++
	if !!(direct != 0) {
		goto __59
	} // precompiled
	rootPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	// Use loop optimized TEBC call (TCL_EVAL_DISCARD_RESULT): it's a part of
	// iteration, this way evaluation will be more similar to a cycle (also
	// avoids extra overhead to set result to interp, etc.)
	*(*int32)(unsafe.Pointer(interp + 324)) |= TCL_EVAL_DISCARD_RESULT
	result = XTclNRExecuteByteCode(tls, interp, codePtr)
	result = XTclNRRunCallbacks(tls, interp, result, rootPtr)
	goto __60
__59: // eval
	result = XTclEvalObjEx(tls, interp, objPtr, 0, uintptr(0), 0)
__60:
	;
	// Allow break and continue from measurement cycle (used for
	// conditional stop and flow control of iterations).

	switch result {
	case TCL_OK:
		goto __62
	case TCL_BREAK:
		goto __63
		// FALLTHRU
	case TCL_CONTINUE:
		goto __64
	default:
		goto __65
	}
	goto __61
__62:
	goto __61
__63:
	// Force stop immediately.
	threshold = uint64(1)
	maxcnt = uint64(0)
	// FALLTHRU
__64:
	result = TCL_OK
	goto __61
__65:
	goto done
__61:
	;

	// Don't check time up to threshold.

	if !(libc.PreDecUint64(&threshold, 1) > uint64(0)) {
		goto __66
	}
	goto __57
__66:
	;

	// Check stop time reached, estimate new threshold.

	XTcl_GetTime(tls, bp+120)
	middle = (*Tcl_Time)(unsafe.Pointer(bp + 120 /* &now */)).Fsec
	middle = middle * int64(1000000)
	middle = middle + (*Tcl_Time)(unsafe.Pointer(bp+120)).Fusec

	if !(middle >= stop || count >= maxcnt) {
		goto __67
	}
	goto __58
__67:
	;

	// Don't calculate threshold by few iterations, because sometimes
	// first iteration(s) can be too fast or slow (cached, delayed
	// clean up, etc).

	if !(count < uint64(10)) {
		goto __68
	}
	threshold = uint64(1)
	goto __57
__68:
	;

	// Average iteration time in microsecs.

	threshold = Tcl_WideUInt(middle-start) / count
	if !(threshold > maxIterTm) {
		goto __69
	}
	maxIterTm = threshold

	// Iterations seem to be longer.

	if !(threshold > maxIterTm*uint64(2)) {
		goto __71
	}
	factor = uint16(int32(factor) * 2)
	if !(int32(factor) > 50) {
		goto __73
	}
	factor = uint16(50)
__73:
	;
	goto __72
__71:
	if !(int32(factor) < 50) {
		goto __74
	}
	factor++
__74:
	;
__72:
	;
	goto __70
__69:
	if !(int32(factor) > 4) {
		goto __75
	}
	// Iterations seem to be shorter.

	if !(threshold < maxIterTm/uint64(2)) {
		goto __76
	}
	factor = uint16(int32(factor) / 2)
	if !(int32(factor) < 4) {
		goto __78
	}
	factor = uint16(4)
__78:
	;
	goto __77
__76:
	factor--
__77:
	;
__75:
	;
__70:
	;

	// As relation between remaining time and time since last check,
	// maximal some % of time (by factor), so avoid growing of the
	// execution time if iterations are not consistent, e.g. was
	// continuously on time).

	threshold = Tcl_WideUInt(stop-middle)/maxIterTm/Tcl_WideUInt(factor) + uint64(1)
	if !(threshold > uint64(100000)) {
		goto __79
	} // fix for too large threshold
	threshold = uint64(100000)
__79:
	;

	// Consider max-count

	if !(threshold > maxcnt-count) {
		goto __80
	}
	threshold = maxcnt - count
__80:
	;
	goto __57
__58:
	;
__56:
	;

	objs = bp + 136 /* objarr */

	// Absolute execution time in microseconds or in wide clicks.
	usec = Tcl_WideUInt(middle - start)

	if !!(count != 0) {
		goto __81
	} // no iterations - avoid divide by zero
	*(*uintptr)(unsafe.Pointer(objs)) = libc.AssignPtrUintptr(objs+2*8, libc.AssignPtrUintptr(objs+4*8, XTcl_NewWideIntObj(tls, int64(0))))
	goto retRes
__81:
	;

	// If not calibrating...

	if !!(calibrate != 0) {
		goto __82
	}
	// Minimize influence of measurement overhead.

	if !(*(*float64)(unsafe.Pointer(bp + 48)) > float64(0)) {
		goto __84
	}
	// Estimate the time of overhead (microsecs).

	curOverhead = libc.Uint64FromFloat64(*(*float64)(unsafe.Pointer(bp + 48)) * float64(count))

	if !(usec > curOverhead) {
		goto __85
	}
	usec = usec - curOverhead
	goto __86
__85:
	usec = uint64(0)
__86:
	;
__84:
	;
	goto __83
__82:
	// Calibration: obtaining new measurement overhead.

	if !(measureOverhead > float64(usec)/float64(count)) {
		goto __87
	}
	measureOverhead = float64(usec) / float64(count)
__87:
	;
	*(*uintptr)(unsafe.Pointer(objs)) = XTcl_NewDoubleObj(tls, measureOverhead)
__88:
	;
__91:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __94
	}
	*(*uintptr)(unsafe.Pointer(objs + 1*8)) = XTclThreadAllocObj(tls)
	goto __95
__94:
	*(*uintptr)(unsafe.Pointer(objs + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__95:
	;
	goto __92
__92:
	if 0 != 0 {
		goto __91
	}
	goto __93
__93:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1)) == 0) {
		goto __96
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Flength = 0
	goto __97
__96:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes, ts+17655, uint64(int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes + 14)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Flength = int32(uint64(unsafe.Sizeof([15]int8{})) - uint64(1))
__97:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).FtypePtr = uintptr(0)

	goto __89
__89:
	if 0 != 0 {
		goto __88
	}
	goto __90
__90:
	; // mics
	objs += 8 * uintptr(2)
__83:
	;

	val = usec / count // microsecs per iteration
	if !(val >= uint64(1000000)) {
		goto __98
	}
	*(*uintptr)(unsafe.Pointer(objs)) = XTcl_NewWideIntObj(tls, int64(val))
	goto __99
__98:
	if !(val < uint64(10)) {
		goto __100
	}
	digits = 6
	goto __101
__100:
	if !(val < uint64(100)) {
		goto __102
	}
	digits = 4
	goto __103
__102:
	if !(val < uint64(1000)) {
		goto __104
	}
	digits = 3
	goto __105
__104:
	if !(val < uint64(10000)) {
		goto __106
	}
	digits = 2
	goto __107
__106:
	digits = 1
__107:
	;
__105:
	;
__103:
	;
__101:
	;
	*(*uintptr)(unsafe.Pointer(objs)) = XTcl_ObjPrintf(tls, ts+17670, libc.VaList(bp, digits, float64(usec)/float64(count)))
__99:
	;

	*(*uintptr)(unsafe.Pointer(objs + 2*8)) = XTcl_NewWideIntObj(tls, int64(count)) // iterations

	// Calculate speed as rate (count) per sec

	if !!(usec != 0) {
		goto __108
	}
	usec++ // Avoid divide by zero.
__108:
	;
	if !(count < uint64(int64(Tcl_WideUInt(libc.Uint64(libc.Uint64FromInt32(-1)))>>1)/int64(1000000))) {
		goto __109
	}
	val = count * uint64(1000000) / usec
	if !(val < uint64(100000)) {
		goto __111
	}
	if !(val < uint64(100)) {
		goto __113
	}
	digits = 3
	goto __114
__113:
	if !(val < uint64(1000)) {
		goto __115
	}
	digits = 2
	goto __116
__115:
	digits = 1
__116:
	;
__114:
	;
	*(*uintptr)(unsafe.Pointer(objs + 4*8)) = XTcl_ObjPrintf(tls, ts+17670,
		libc.VaList(bp+16, digits, float64(count*uint64(1000000))/float64(usec)))
	goto __112
__111:
	*(*uintptr)(unsafe.Pointer(objs + 4*8)) = XTcl_NewWideIntObj(tls, int64(val))
__112:
	;
	goto __110
__109:
	*(*uintptr)(unsafe.Pointer(objs + 4*8)) = XTcl_NewWideIntObj(tls, int64(count/usec*uint64(1000000)))
__110:
	;

retRes:
	// Estimated net execution time (in millisecs).

	if !!(calibrate != 0) {
		goto __117
	}
	if !(usec >= uint64(1)) {
		goto __118
	}
	*(*uintptr)(unsafe.Pointer(objs + 6*8)) = XTcl_ObjPrintf(tls, ts+17675, libc.VaList(bp+32, float64(usec)/float64(1000)))
	goto __119
__118:
	*(*uintptr)(unsafe.Pointer(objs + 6*8)) = XTcl_NewWideIntObj(tls, int64(0))
__119:
	;
__120:
	;
__123:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __126
	}
	*(*uintptr)(unsafe.Pointer(objs + 7*8)) = XTclThreadAllocObj(tls)
	goto __127
__126:
	*(*uintptr)(unsafe.Pointer(objs + 7*8)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__127:
	;
	goto __124
__124:
	if 0 != 0 {
		goto __123
	}
	goto __125
__125:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)) == 0) {
		goto __128
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Flength = 0
	goto __129
__128:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Fbytes, ts+17680, uint64(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Fbytes + 6)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Flength = int32(uint64(unsafe.Sizeof([7]int8{})) - uint64(1))
__129:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).FtypePtr = uintptr(0)

	goto __121
__121:
	if 0 != 0 {
		goto __120
	}
	goto __122
__122:
	;
__117:
	;

	// Construct the result as a list because many programs have always
	// parsed as such (extracting the first element, typically).

__130:
	;
__133:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0
	}()) {
		goto __136
	}
	*(*uintptr)(unsafe.Pointer(objs + 1*8)) = XTclThreadAllocObj(tls)
	goto __137
__136:
	*(*uintptr)(unsafe.Pointer(objs + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects--
__137:
	;
	goto __134
__134:
	if 0 != 0 {
		goto __133
	}
	goto __135
__135:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0) {
		goto __138
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Flength = 0
	goto __139
__138:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes, ts+17687, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes + 5)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
__139:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).FtypePtr = uintptr(0)

	goto __131
__131:
	if 0 != 0 {
		goto __130
	}
	goto __132
__132:
	; // mics/#
__140:
	;
__143:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0
	}()) {
		goto __146
	}
	*(*uintptr)(unsafe.Pointer(objs + 3*8)) = XTclThreadAllocObj(tls)
	goto __147
__146:
	*(*uintptr)(unsafe.Pointer(objs + 3*8)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects--
__147:
	;
	goto __144
__144:
	if 0 != 0 {
		goto __143
	}
	goto __145
__145:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)) == 0) {
		goto __148
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Flength = 0
	goto __149
__148:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Fbytes, ts+17693, uint64(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Fbytes + 1)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Flength = int32(uint64(unsafe.Sizeof([2]int8{})) - uint64(1))
__149:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).FtypePtr = uintptr(0)

	goto __141
__141:
	if 0 != 0 {
		goto __140
	}
	goto __142
__142:
	;
__150:
	;
__153:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0
	}()) {
		goto __156
	}
	*(*uintptr)(unsafe.Pointer(objs + 5*8)) = XTclThreadAllocObj(tls)
	goto __157
__156:
	*(*uintptr)(unsafe.Pointer(objs + 5*8)) = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects--
__157:
	;
	goto __154
__154:
	if 0 != 0 {
		goto __153
	}
	goto __155
__155:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0) {
		goto __158
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Flength = 0
	goto __159
__158:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Fbytes, ts+17695, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Fbytes + 5)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
__159:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).FtypePtr = uintptr(0)

	goto __151
__151:
	if 0 != 0 {
		goto __150
	}
	goto __152
__152:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, 8, bp+136))

done:
	if !(codePtr != uintptr(0)) {
		goto __160
	}
	sTclReleaseByteCode(tls, codePtr)
__160:
	;
	return result
}

var measureOverhead float64 = float64(0) /* tclCmdMZ.c:4287:19 */
var options6 = [5]uintptr{
	ts + 17701, ts + 17709, ts + 17719, ts + 15828, uintptr(0),
} /* tclCmdMZ.c:4309:23 */

//----------------------------------------------------------------------
//
// Tcl_TryObjCmd, TclNRTryObjCmd --
//
//	This procedure is invoked to process the "try" Tcl command. See the
//	user documentation (or TIP #329) for details on what it does.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_TryObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:4824:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRTryObjCmd})), dummy, objc, objv)
}

func XTclNRTryObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:4834:1: */
	bp := tls.Alloc(340)
	defer tls.Free(340)

	var bodyObj uintptr
	var handlersObj uintptr
	var finallyObj uintptr
	var i int32
	var bodyShared int32
	var haveHandlers int32
	// var dummy int32 at bp+336, 4

	// var code int32 at bp+292, 4

	var cachePtr uintptr
	var _objPtr uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var _objPtr3 uintptr
	var _objPtr4 uintptr
	var _objPtr5 uintptr
	var _objPtr6 uintptr
	var _objPtr7 uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	// var type1 int32 at bp+288, 4

	// var info [5]uintptr at bp+296, 40

	var _objPtr8 uintptr
	var _objPtr9 uintptr
	finallyObj = uintptr(0)

	// Parse the arguments. The handlers are passed to subsequent callbacks as
	// a Tcl_Obj list of the 5-tuples like (type, returnCode, errorCodePrefix,
	// bindVariables, script), and the finally script is just passed as it is.

	if !(objc < 2) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+17730)
	return TCL_ERROR
__1:
	;
	bodyObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
__2:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __5
	}
	handlersObj = XTclThreadAllocObj(tls)
	goto __6
__5:
	handlersObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(handlersObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__6:
	;
	goto __3
__3:
	if 0 != 0 {
		goto __2
	}
	goto __4
__4:
	;
	(*Tcl_Obj)(unsafe.Pointer(handlersObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(handlersObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(handlersObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(handlersObj)).FtypePtr = uintptr(0)

	bodyShared = 0
	haveHandlers = 0
	i = 2
__7:
	if !(i < objc) {
		goto __9
	}

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&handlerNames)), int32(unsafe.Sizeof(uintptr(0))), ts+17766, 0, bp+288) != TCL_OK) {
		goto __10
	}
__11:
	_objPtr = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __14
	}
	XTclFreeObj(tls, _objPtr)
__14:
	;
	goto __12
__12:
	if 0 != 0 {
		goto __11
	}
	goto __13
__13:
	;
	return TCL_ERROR
__10:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 288 /* type1 */))) {
	case uint32(0) /* TryFinally */ :
		goto __16

	case uint32(1) /* TryOn */ :
		goto __17

	case uint32(2) /* TryTrap */ :
		goto __18
	}
	goto __15
__16: // finally script
	if !(i < objc-2) {
		goto __19
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+17779, -1))
__21:
	_objPtr1 = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __24
	}
	XTclFreeObj(tls, _objPtr1)
__24:
	;
	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+17807, ts+17811,
		ts+17819, uintptr(0)))
	return TCL_ERROR
	goto __20
__19:
	if !(i == objc-1) {
		goto __25
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+17831, -1))
__26:
	_objPtr2 = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __29
	}
	XTclFreeObj(tls, _objPtr2)
__29:
	;
	goto __27
__27:
	if 0 != 0 {
		goto __26
	}
	goto __28
__28:
	;
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+7420, ts+17807, ts+17811,
		ts+13635, uintptr(0)))
	return TCL_ERROR
__25:
	;
__20:
	;
	finallyObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PreIncInt32(&i, 1))*8))
	goto __15

__17: // on code variableList script
	if !(i > objc-4) {
		goto __30
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+17892, -1))
__31:
	_objPtr3 = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __34
	}
	XTclFreeObj(tls, _objPtr3)
__34:
	;
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+7420, ts+17807, ts+17961,
		ts+13635, uintptr(0)))
	return TCL_ERROR
__30:
	;
	if !(XTclGetCompletionCodeFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)),
		bp+292) != TCL_OK) {
		goto __35
	}
__36:
	_objPtr4 = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __39
	}
	XTclFreeObj(tls, _objPtr4)
__39:
	;
	goto __37
__37:
	if 0 != 0 {
		goto __36
	}
	goto __38
__38:
	;
	return TCL_ERROR
__35:
	;
	*(*uintptr)(unsafe.Pointer(bp + 296 + 2*8)) = uintptr(0)
	goto commonHandler

__18: // trap pattern variableList script
	if !(i > objc-4) {
		goto __40
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+17964,
		-1))
__41:
	_objPtr5 = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __44
	}
	XTclFreeObj(tls, _objPtr5)
__44:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+144, ts+3593, ts+7420, ts+17807, ts+18040,
		ts+13635, uintptr(0)))
	return TCL_ERROR
__40:
	;
	*(*int32)(unsafe.Pointer(bp + 292 /* code */)) = 1
	if !(XTcl_ListObjLength(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+336) != TCL_OK) {
		goto __45
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+18045,
		libc.VaList(bp+192, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))))))
__46:
	_objPtr6 = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr6)).FrefCount, 1) <= 1) {
		goto __49
	}
	XTclFreeObj(tls, _objPtr6)
__49:
	;
	goto __47
__47:
	if 0 != 0 {
		goto __46
	}
	goto __48
__48:
	;
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+200, ts+3593, ts+7420, ts+17807, ts+18040,
		ts+18077, uintptr(0)))
	return TCL_ERROR
__45:
	;
	*(*uintptr)(unsafe.Pointer(bp + 296 + 2*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))

commonHandler:
	if !(XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+2)*8)), bp+336) != TCL_OK) {
		goto __50
	}
__51:
	_objPtr7 = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr7)).FrefCount, 1) <= 1) {
		goto __54
	}
	XTclFreeObj(tls, _objPtr7)
__54:
	;
	goto __52
__52:
	if 0 != 0 {
		goto __51
	}
	goto __53
__53:
	;
	return TCL_ERROR
__50:
	;

	*(*uintptr)(unsafe.Pointer(bp + 296)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) // type
__55:
	;
__58:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __61
	}
	*(*uintptr)(unsafe.Pointer(bp + 296 + 1*8)) = XTclThreadAllocObj(tls)
	goto __62
__61:
	*(*uintptr)(unsafe.Pointer(bp + 296 + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 + 1*8)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__62:
	;
	goto __59
__59:
	if 0 != 0 {
		goto __58
	}
	goto __60
__60:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 + 1*8)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 + 1*8)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 + 1*8)) + 32)) = int64(*(*int32)(unsafe.Pointer(bp + 292)))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 + 1*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __56
__56:
	if 0 != 0 {
		goto __55
	}
	goto __57
__57:
	; // returnCode
	if !(*(*uintptr)(unsafe.Pointer(bp + 296 + 2*8)) == uintptr(0)) {
		goto __63
	} // errorCodePrefix
__64:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __67
	}
	*(*uintptr)(unsafe.Pointer(bp + 296 + 2*8)) = XTclThreadAllocObj(tls)
	goto __68
__67:
	*(*uintptr)(unsafe.Pointer(bp + 296 + 2*8)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 + 2*8)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__68:
	;
	goto __65
__65:
	if 0 != 0 {
		goto __64
	}
	goto __66
__66:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 + 2*8)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 + 2*8)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 + 2*8)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 + 2*8)))).FtypePtr = uintptr(0)

__63:
	;
	*(*uintptr)(unsafe.Pointer(bp + 296 + 3*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+2)*8)) // bindVariables
	*(*uintptr)(unsafe.Pointer(bp + 296 + 4*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+3)*8)) // script

	bodyShared = libc.BoolInt32(!(libc.Xstrcmp(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+3)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+3)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+3)*8)))
	}(), ts+5772) != 0))
	XTcl_ListObjAppendElement(tls, uintptr(0), handlersObj,
		XTcl_NewListObj(tls, 5, bp+296))
	haveHandlers = 1
	i = i + 3
	goto __15
__15:
	;
	goto __8
__8:
	i++
	goto __7
	goto __9
__9:
	;
	if !(bodyShared != 0) {
		goto __69
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+18087, -1))
__70:
	_objPtr8 = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr8)).FrefCount, 1) <= 1) {
		goto __73
	}
	XTclFreeObj(tls, _objPtr8)
__73:
	;
	goto __71
__71:
	if 0 != 0 {
		goto __70
	}
	goto __72
__72:
	;
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+248, ts+3593, ts+7420, ts+17807, ts+18139,
		uintptr(0)))
	return TCL_ERROR
__69:
	;
	if !!(haveHandlers != 0) {
		goto __74
	}
__75:
	_objPtr9 = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr9)).FrefCount, 1) <= 1) {
		goto __78
	}
	XTclFreeObj(tls, _objPtr9)
__78:
	;
	goto __76
__76:
	if 0 != 0 {
		goto __75
	}
	goto __77
__77:
	;
	handlersObj = uintptr(0)
__74:
	;

	// Execute the body.

	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTryPostBody})), handlersObj, finallyObj,
		objv, uintptr(Intptr_t(objc)))
	return XTclNREvalObjEx(tls, interp, bodyObj, 0,
		(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr, 1)
}

var handlerNames = [4]uintptr{
	ts + 18154, ts + 18162, ts + 18165, uintptr(0),
} /* tclCmdMZ.c:4842:23 */

//----------------------------------------------------------------------
//
// During --
//
//	This helper function patches together the updates to the interpreter's
//	return options that are needed when things fail during the processing
//	of a handler or finally script for the [try] command.
//
// Returns:
//	The new option dictionary.
//
//----------------------------------------------------------------------

func sDuring(tls *libc.TLS, interp uintptr, resultCode int32, oldOptions uintptr, errorInfo uintptr) uintptr { /* tclCmdMZ.c:4995:23: */
	var during uintptr
	var options uintptr

	if errorInfo != uintptr(0) {
		XTcl_AppendObjToErrorInfo(tls, interp, errorInfo)
	}
	options = XTcl_GetReturnOptions(tls, interp, resultCode)
	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				during = XTclThreadAllocObj(tls)
			} else {
				during = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(during + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(during)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(during)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(during)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(during)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(during)).Fbytes, ts+18170, uint64(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(during)).Fbytes + 7)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(during)).Flength = int32(uint64(unsafe.Sizeof([8]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(during)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(during)).FrefCount++
	XTcl_DictObjPut(tls, interp, options, during, oldOptions)
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = during
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(options)).FrefCount++
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _objPtr uintptr = oldOptions
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return options
}

//----------------------------------------------------------------------
//
// TryPostBody --
//
//	Callback to handle the outcome of the execution of the body of a 'try'
//	command.
//
//----------------------------------------------------------------------

func sTryPostBody(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdMZ.c:5032:1: */
	bp := tls.Alloc(120)
	defer tls.Free(120)

	var resultObj uintptr
	var options uintptr
	var handlersObj uintptr
	var finallyObj uintptr
	var cmdObj uintptr
	var objv uintptr
	var i int32
	// var dummy int32 at bp+48, 4

	// var code int32 at bp+64, 4

	var objc int32
	// var numHandlers int32 at bp+32, 4

	var _objPtr uintptr
	var cachePtr uintptr
	var _objPtr1 uintptr
	var errorCodeName uintptr
	// var errcode uintptr at bp+72, 8

	// var bits1 uintptr at bp+88, 8

	// var bits2 uintptr at bp+104, 8

	// var len1 int32 at bp+80, 4

	// var len2 int32 at bp+96, 4

	var j int32
	var _objPtr2 uintptr
	var _objPtr3 uintptr
	// var varName uintptr at bp+112, 8

	var _objPtr4 uintptr
	var _objPtr5 uintptr
	var handlerBodyObj uintptr
	var _objPtr6 uintptr
	var found int32
	// var handlers uintptr at bp+40, 8

	// var info uintptr at bp+56, 8

	var _objPtr7 uintptr
	var _objPtr8 uintptr
	*(*int32)(unsafe.Pointer(bp + 32 /* numHandlers */)) = 0

	handlersObj = *(*ClientData)(unsafe.Pointer(data))
	finallyObj = *(*ClientData)(unsafe.Pointer(data + 1*8))
	objv = *(*ClientData)(unsafe.Pointer(data + 2*8))
	objc = int32(*(*ClientData)(unsafe.Pointer(data + 3*8)))

	cmdObj = *(*uintptr)(unsafe.Pointer(objv))

	// Check for limits/rewinding, which override normal trapping behaviour.

	if !((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).Frewind != 0 || XTcl_LimitExceeded(tls, interp) != 0) {
		goto __1
	}
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+13064, libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes
			}
			return XTcl_GetString(tls, cmdObj)
		}(),
			XTcl_GetErrorLine(tls, interp))))
	if !(handlersObj != uintptr(0)) {
		goto __2
	}
__3:
	_objPtr = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __6
	}
	XTclFreeObj(tls, _objPtr)
__6:
	;
	goto __4
__4:
	if 0 != 0 {
		goto __3
	}
	goto __5
__5:
	;
__2:
	;
	return TCL_ERROR
__1:
	;

	// Basic processing of the outcome of the script, including adding of
	// errorinfo trace.

	if !(result == TCL_ERROR) {
		goto __7
	}
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+13064, libc.VaList(bp+16, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes
			}
			return XTcl_GetString(tls, cmdObj)
		}(),
			XTcl_GetErrorLine(tls, interp))))
__7:
	;
	resultObj = XTcl_GetObjResult(tls, interp)
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount++
	options = XTcl_GetReturnOptions(tls, interp, result)
	(*Tcl_Obj)(unsafe.Pointer(options)).FrefCount++
	XTcl_ResetResult(tls, interp)

	// Handle the results.

	if !(handlersObj != uintptr(0)) {
		goto __8
	}
	found = 0

	XTcl_ListObjGetElements(tls, uintptr(0), handlersObj, bp+32, bp+40)
	i = 0
__9:
	if !(i < *(*int32)(unsafe.Pointer(bp + 32))) {
		goto __11
	}

	XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* handlers */)) + uintptr(i)*8)), bp+48, bp+56)
	if !!(found != 0) {
		goto __12
	}
	XTcl_GetIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* info */)) + 1*8)), bp+64)
	if !(*(*int32)(unsafe.Pointer(bp + 64)) != result) {
		goto __13
	}
	goto __10
__13:
	;

	// When processing an error, we must also perform list-prefix
	// matching of the errorcode list. However, if this was an
	// 'on' handler, the list that we are matching against will be
	// empty.

	if !(*(*int32)(unsafe.Pointer(bp + 64)) == TCL_ERROR) {
		goto __14
	}

__15:
	;
__18:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __21
	}
	errorCodeName = XTclThreadAllocObj(tls)
	goto __22
__21:
	errorCodeName = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(errorCodeName + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__22:
	;
	goto __19
__19:
	if 0 != 0 {
		goto __18
	}
	goto __20
__20:
	;
	(*Tcl_Obj)(unsafe.Pointer(errorCodeName)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)) == 0) {
		goto __23
	}
	(*Tcl_Obj)(unsafe.Pointer(errorCodeName)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(errorCodeName)).Flength = 0
	goto __24
__23:
	(*Tcl_Obj)(unsafe.Pointer(errorCodeName)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(errorCodeName)).Fbytes, ts+12045, uint64(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(errorCodeName)).Fbytes + 10)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(errorCodeName)).Flength = int32(uint64(unsafe.Sizeof([11]int8{})) - uint64(1))
__24:
	;
	(*Tcl_Obj)(unsafe.Pointer(errorCodeName)).FtypePtr = uintptr(0)

	goto __16
__16:
	if 0 != 0 {
		goto __15
	}
	goto __17
__17:
	;
	XTcl_DictObjGet(tls, uintptr(0), options, errorCodeName, bp+72)
__25:
	_objPtr1 = errorCodeName
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __28
	}
	XTclFreeObj(tls, _objPtr1)
__28:
	;
	goto __26
__26:
	if 0 != 0 {
		goto __25
	}
	goto __27
__27:
	;
	XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* info */)) + 2*8)), bp+80, bp+88)
	if !(XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 72)), bp+96,
		bp+104) != TCL_OK) {
		goto __29
	}
	goto __10
__29:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 96)) < *(*int32)(unsafe.Pointer(bp + 80))) {
		goto __30
	}
	goto __10
__30:
	;
	j = 0
__31:
	if !(j < *(*int32)(unsafe.Pointer(bp + 80))) {
		goto __33
	}
	if !(libc.Xstrcmp(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)) + uintptr(j)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)) + uintptr(j)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)) + uintptr(j)*8)))
	}(),
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104)) + uintptr(j)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104)) + uintptr(j)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104)) + uintptr(j)*8)))
		}()) != 0) {
		goto __34
	}
	// Really want 'continue outerloop;', but C does
	// not give us that.

	goto didNotMatch
__34:
	;
	goto __32
__32:
	j++
	goto __31
	goto __33
__33:
	;
__14:
	;

	found = 1
__12:
	;

	// Now we need to scan forward over "-" bodies. Note that we've
	// already checked that the last body is not a "-", so this search
	// will terminate successfully.

	if !!(libc.Xstrcmp(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56)) + 4*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56)) + 4*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56)) + 4*8)))
	}(), ts+5772) != 0) {
		goto __35
	}
	goto __10
__35:
	;

	// Bind the variables. We already know this is a list of variable
	// names, but it might be empty.

	XTcl_ResetResult(tls, interp)
	result = TCL_ERROR
	XTcl_ListObjLength(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* info */)) + 3*8)), bp+48)
	if !(*(*int32)(unsafe.Pointer(bp + 48)) > 0) {
		goto __36
	}

	XTcl_ListObjIndex(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* info */)) + 3*8)), 0, bp+112)
	if !(XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 112)), uintptr(0), resultObj,
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __38
	}
__39:
	_objPtr2 = resultObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __42
	}
	XTclFreeObj(tls, _objPtr2)
__42:
	;
	goto __40
__40:
	if 0 != 0 {
		goto __39
	}
	goto __41
__41:
	;
	goto handlerFailed
__38:
	;
__43:
	_objPtr3 = resultObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __46
	}
	XTclFreeObj(tls, _objPtr3)
__46:
	;
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 48)) > 1) {
		goto __47
	}
	XTcl_ListObjIndex(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* info */)) + 3*8)), 1, bp+112)
	if !(XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 112)), uintptr(0), options,
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __48
	}
	goto handlerFailed
__48:
	;
__47:
	;
	goto __37
__36:
	// Dispose of the result to prevent a memleak. [Bug 2910044]

__49:
	_objPtr4 = resultObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __52
	}
	XTclFreeObj(tls, _objPtr4)
__52:
	;
	goto __50
__50:
	if 0 != 0 {
		goto __49
	}
	goto __51
__51:
	;
__37:
	;

	// Evaluate the handler body and process the outcome. Note that we
	// need to keep the kind of handler for debugging purposes, and in
	// any case anything we want from info[] must be extracted right
	// now because the info[] array is about to become invalid. There
	// is very little refcount handling here however, since we know
	// that the objects that we still want to refer to now were input
	// arguments to [try] and so are still on the Tcl value stack.

	handlerBodyObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* info */)) + 4*8))
	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTryPostHandler})), objv, options, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* info */)))),
		uintptr(func() int64 {
			if finallyObj == uintptr(0) {
				return int64(0)
			}
			return int64(objc - 1)
		}()))
__53:
	_objPtr5 = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __56
	}
	XTclFreeObj(tls, _objPtr5)
__56:
	;
	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
	return XTclNREvalObjEx(tls, interp, handlerBodyObj, 0,
		(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr, 4*i+5)

handlerFailed:
	resultObj = XTcl_GetObjResult(tls, interp)
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount++
	options = sDuring(tls, interp, result, options, uintptr(0))
	goto __11

didNotMatch:
	goto __10
	goto __10
__10:
	i++
	goto __9
	goto __11
__11:
	;

	// No handler matched; get rid of the list of handlers.

__57:
	_objPtr6 = handlersObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr6)).FrefCount, 1) <= 1) {
		goto __60
	}
	XTclFreeObj(tls, _objPtr6)
__60:
	;
	goto __58
__58:
	if 0 != 0 {
		goto __57
	}
	goto __59
__59:
	;
__8:
	;

	// Process the finally clause.

	if !(finallyObj != uintptr(0)) {
		goto __61
	}
	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTryPostFinal})), resultObj, options, cmdObj,
		uintptr(0))
	return XTclNREvalObjEx(tls, interp, finallyObj, 0,
		(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr, objc-1)
__61:
	;

	// Install the correct result/options into the interpreter and clean up
	// any temporary storage.

	result = XTcl_SetReturnOptions(tls, interp, options)
__62:
	_objPtr7 = options
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr7)).FrefCount, 1) <= 1) {
		goto __65
	}
	XTclFreeObj(tls, _objPtr7)
__65:
	;
	goto __63
__63:
	if 0 != 0 {
		goto __62
	}
	goto __64
__64:
	;
	XTcl_SetObjResult(tls, interp, resultObj)
__66:
	_objPtr8 = resultObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr8)).FrefCount, 1) <= 1) {
		goto __69
	}
	XTclFreeObj(tls, _objPtr8)
__69:
	;
	goto __67
__67:
	if 0 != 0 {
		goto __66
	}
	goto __68
__68:
	;
	return result
}

//----------------------------------------------------------------------
//
// TryPostHandler --
//
//	Callback to handle the outcome of the execution of a handler of a
//	'try' command.
//
//----------------------------------------------------------------------

func sTryPostHandler(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdMZ.c:5247:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var resultObj uintptr
	var cmdObj uintptr
	var options uintptr
	var handlerKindObj uintptr
	var objv uintptr
	var finallyObj uintptr
	var finallyIndex int32

	objv = *(*ClientData)(unsafe.Pointer(data))
	options = *(*ClientData)(unsafe.Pointer(data + 1*8))
	handlerKindObj = *(*ClientData)(unsafe.Pointer(data + 2*8))
	finallyIndex = int32(*(*ClientData)(unsafe.Pointer(data + 3*8)))

	cmdObj = *(*uintptr)(unsafe.Pointer(objv))
	if finallyIndex != 0 {
		finallyObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(finallyIndex)*8))
	} else {
		finallyObj = uintptr(0)
	}

	// Check for limits/rewinding, which override normal trapping behaviour.

	if (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).Frewind != 0 || XTcl_LimitExceeded(tls, interp) != 0 {
		options = sDuring(tls, interp, result, options, XTcl_ObjPrintf(tls,
			ts+18178,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes
				}
				return XTcl_GetString(tls, cmdObj)
			}(), func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(handlerKindObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(handlerKindObj)).Fbytes
				}
				return XTcl_GetString(tls, handlerKindObj)
			}(),
				XTcl_GetErrorLine(tls, interp))))
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = options
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return TCL_ERROR
	}

	// The handler result completely substitutes for the result of the body.

	resultObj = XTcl_GetObjResult(tls, interp)
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount++
	if result == TCL_ERROR {
		options = sDuring(tls, interp, result, options, XTcl_ObjPrintf(tls,
			ts+18178,
			libc.VaList(bp+24, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes
				}
				return XTcl_GetString(tls, cmdObj)
			}(), func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(handlerKindObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(handlerKindObj)).Fbytes
				}
				return XTcl_GetString(tls, handlerKindObj)
			}(),
				XTcl_GetErrorLine(tls, interp))))
	} else {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = options
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		options = XTcl_GetReturnOptions(tls, interp, result)
		(*Tcl_Obj)(unsafe.Pointer(options)).FrefCount++
	}

	// Process the finally clause if it is present.

	if finallyObj != uintptr(0) {
		var iPtr uintptr = interp

		XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sTryPostFinal})), resultObj, options, cmdObj,
			uintptr(0))

		// The 'finally' script is always the last argument word.
		return XTclNREvalObjEx(tls, interp, finallyObj, 0, (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr,
			finallyIndex)
	}

	// Install the correct result/options into the interpreter and clean up
	// any temporary storage.

	result = XTcl_SetReturnOptions(tls, interp, options)
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = options
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _objPtr uintptr = resultObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// TryPostFinal --
//
//	Callback to handle the outcome of the execution of the finally script
//	of a 'try' command.
//
//----------------------------------------------------------------------

func sTryPostFinal(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclCmdMZ.c:5333:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var resultObj uintptr
	var options uintptr
	var cmdObj uintptr

	resultObj = *(*ClientData)(unsafe.Pointer(data))
	options = *(*ClientData)(unsafe.Pointer(data + 1*8))
	cmdObj = *(*ClientData)(unsafe.Pointer(data + 2*8))

	// If the result wasn't OK, we need to adjust the result options.

	if result != TCL_OK {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = resultObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		resultObj = uintptr(0)
		if result == TCL_ERROR {
			options = sDuring(tls, interp, result, options, XTcl_ObjPrintf(tls,
				ts+18213,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes
					}
					return XTcl_GetString(tls, cmdObj)
				}(), XTcl_GetErrorLine(tls, interp))))
		} else {
			var origOptions uintptr = options

			options = XTcl_GetReturnOptions(tls, interp, result)
			(*Tcl_Obj)(unsafe.Pointer(options)).FrefCount++
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr = origOptions
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
	}

	// Install the correct result/options into the interpreter and clean up
	// any temporary storage.

	result = XTcl_SetReturnOptions(tls, interp, options)
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = options
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if resultObj != uintptr(0) {
		XTcl_SetObjResult(tls, interp, resultObj)
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = resultObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_WhileObjCmd --
//
//	This procedure is invoked to process the "while" Tcl command. See the
//	user documentation for details on what it does.
//
//	With the bytecode compiler, this procedure is only called when a
//	command name is computed at runtime, and is "while" or the name to
//	which "while" was renamed: e.g., "set z while; $z {$i<100} {}"
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_WhileObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:5400:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRWhileObjCmd})), dummy, objc, objv)
}

func XTclNRWhileObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCmdMZ.c:5410:1: */
	var iterPtr uintptr

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18250)
		return TCL_ERROR
	}

	// We reuse [for]'s callback, passing a NULL for the 'next' script.

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr
		{
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if interp == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				_objPtr = XTclThreadAllocObj(tls)
			} else {
				_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		iterPtr = _objPtr
	}
	(*ForIterData)(unsafe.Pointer(iterPtr)).Fcond = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	(*ForIterData)(unsafe.Pointer(iterPtr)).Fbody = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	(*ForIterData)(unsafe.Pointer(iterPtr)).Fnext = uintptr(0)
	(*ForIterData)(unsafe.Pointer(iterPtr)).Fmsg = ts + 18263 /* "\n    (\"while\" bo..." */
	(*ForIterData)(unsafe.Pointer(iterPtr)).Fword = 2

	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _callbackPtr uintptr
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{XTclNRForIterCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = iterPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclListLines --
//
//	???
//
// Results:
//	Filled in array of line numbers?
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclListLines(tls *libc.TLS, listObj uintptr, line int32, n int32, lines uintptr, elems uintptr) { /* tclCmdMZ.c:5456:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)
	*(*int32)(unsafe.Pointer(bp + 16)) = line

	var listStr uintptr = XTcl_GetString(tls, listObj)
	var listHead uintptr = listStr
	var i int32
	var length int32 = int32(libc.Xstrlen(tls, listStr))
	*(*uintptr)(unsafe.Pointer(bp /* element */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 8 /* next */)) = uintptr(0)
	var clLocPtr uintptr = XTclContinuationsGet(tls, listObj)
	*(*uintptr)(unsafe.Pointer(bp + 24 /* clNext */)) = func() uintptr {
		if clLocPtr != 0 {
			return clLocPtr + 4
		}
		return uintptr(0)
	}()

	for i = 0; i < n; i++ {
		XTclFindElement(tls, uintptr(0), listStr, length, bp, bp+8, uintptr(0), uintptr(0))

		XTclAdvanceLines(tls, bp+16, listStr, *(*uintptr)(unsafe.Pointer(bp /* element */)))
		// Leading whitespace
		XTclAdvanceContinuations(tls, bp+16, bp+24, int32((int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(listHead))/1))
		if elems != 0 && *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 {
			XTclContinuationsEnterDerived(tls, *(*uintptr)(unsafe.Pointer(elems + uintptr(i)*8)), int32((int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(listHead))/1), *(*uintptr)(unsafe.Pointer(bp + 24 /* clNext */)))
		}
		*(*int32)(unsafe.Pointer(lines + uintptr(i)*4)) = *(*int32)(unsafe.Pointer(bp + 16 /* line */))
		length = int32(int64(length) - (int64(*(*uintptr)(unsafe.Pointer(bp + 8)))-int64(listStr))/1)
		XTclAdvanceLines(tls, bp+16, *(*uintptr)(unsafe.Pointer(bp /* element */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* next */)))
		// Element
		listStr = *(*uintptr)(unsafe.Pointer(bp + 8 /* next */))

		if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
			// ASSERT i == n
			break
		}
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The structures below define the AuxData types defined in this file.

var foreachInfoType = AuxDataType{
	Fname:            ts + 18291,
	FdupProc:         0, // dupProc
	FfreeProc:        0, // freeProc
	FprintProc:       0, // printProc
	FdisassembleProc: 0, // disassembleProc
} /* tclCompCmds.c:57:26 */

var newForeachInfoType = AuxDataType{
	Fname:            ts + 18303,
	FdupProc:         0, // dupProc
	FfreeProc:        0, // freeProc
	FprintProc:       0, // printProc
	FdisassembleProc: 0, // disassembleProc
} /* tclCompCmds.c:65:26 */

var dictUpdateInfoType = AuxDataType{
	Fname:            ts + 18318,
	FdupProc:         0, // dupProc
	FfreeProc:        0, // freeProc
	FprintProc:       0, // printProc
	FdisassembleProc: 0, // disassembleProc
} /* tclCompCmds.c:73:26 */

//----------------------------------------------------------------------
//
// TclGetAuxDataType --
//
//	This procedure looks up an Auxdata type by name.
//
// Results:
//	If an AuxData type with name matching "typeName" is found, a pointer
//	to its AuxDataType structure is returned; otherwise, NULL is returned.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetAuxDataType(tls *libc.TLS, typeName uintptr) uintptr { /* tclCompCmds.c:98:19: */
	if !(libc.Xstrcmp(tls, typeName, foreachInfoType.Fname) != 0) {
		return uintptr(unsafe.Pointer(&foreachInfoType))
	} else if !(libc.Xstrcmp(tls, typeName, newForeachInfoType.Fname) != 0) {
		return uintptr(unsafe.Pointer(&newForeachInfoType))
	} else if !(libc.Xstrcmp(tls, typeName, dictUpdateInfoType.Fname) != 0) {
		return uintptr(unsafe.Pointer(&dictUpdateInfoType))
	} else if !(libc.Xstrcmp(tls, typeName, XtclJumptableInfoType.Fname) != 0) {
		return uintptr(unsafe.Pointer(&XtclJumptableInfoType))
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// TclCompileAppendCmd --
//
//	Procedure called to compile the "append" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "append" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileAppendCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:133:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var varTokenPtr uintptr
	var valueTokenPtr uintptr
	// var isScalar int32 at bp+4, 4

	// var localIndex int32 at bp, 4

	var numWords int32
	var i int32
	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _delta4 int32
	var _delta5 int32
	var _delta6 int32
	var _delta7 int32
	var _delta8 int32
	var _delta9 int32
	var _objIndexCopy1 int32
	var _delta10 int32
	var _delta11 int32
	var _delta12 int32
	var _delta13 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1

	// TODO: Consider support for compiling expanded args.
	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	if !(numWords == 1) {
		goto __1
	}
	return TCL_ERROR
	goto __2
__1:
	if !(numWords == 2) {
		goto __3
	}
	// append varName == set varName

	return XTclCompileSetCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	goto __4
__3:
	if !(numWords > 3) {
		goto __5
	}
	// APPEND instructions currently only handle one value, but we can
	// handle some multi-value cases by stringing them together.

	goto appendMultiple
__5:
	;
__4:
	;
__2:
	;

	// Decide if we can use a frame slot for the var/array name or if we need
	// to emit code to compute and push the name at runtime. We use a frame
	// slot (entry in the array of local vars) if we are compiling a procedure
	// body and if the name is simple text that does not include namespace
	// qualifiers.

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclPushVarName(tls, interp, varTokenPtr, envPtr, 0, bp, bp+4)

	// We are doing an assignment, otherwise TclCompileSetCmd was called, so
	// push the new value. This will need to be extended to push a value for
	// each argument.

	valueTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __6
	}
__8:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __11
	}
__13:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __16
	}
	XTclExpandCodeArray(tls, envPtr)
__16:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __17
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__17:
	;
__18:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __21
	}
	if !(_delta == -0x7fffffff-1) {
		goto __22
	}
	_delta = 1 - _objIndexCopy
__22:
	;
__23:
	if !(_delta < 0) {
		goto __26
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __27
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__27:
	;
__26:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
__21:
	;
	goto __19
__19:
	if 0 != 0 {
		goto __18
	}
	goto __20
__20:
	;
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
	goto __12
__11:
__28:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __31
	}
	XTclExpandCodeArray(tls, envPtr)
__31:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __32
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__32:
	;
__33:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __36
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __37
	}
	_delta1 = 1 - _objIndexCopy
__37:
	;
__38:
	if !(_delta1 < 0) {
		goto __41
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __42
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__42:
	;
__41:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __39
__39:
	if 0 != 0 {
		goto __38
	}
	goto __40
__40:
	;
__36:
	;
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
__12:
	;
	goto __9
__9:
	if 0 != 0 {
		goto __8
	}
	goto __10
__10:
	;
	goto __7
__6:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
	XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents, envPtr)
__7:
	;

	// Emit instructions to set/get the variable.

	if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
		goto __43
	}
	if !(*(*int32)(unsafe.Pointer(bp)) < 0) {
		goto __45
	}
__47:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __50
	}
	XTclExpandCodeArray(tls, envPtr)
__50:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_APPEND_STK)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __51
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_APPEND_STK == INST_START_CMD {
			return 1
		}
		return 0
	}()
__51:
	;
__52:
	_delta2 = XtclInstructionTable[INST_APPEND_STK].FstackEffect
	if !(_delta2 != 0) {
		goto __55
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __56
	}
	_delta2 = 1 - 0
__56:
	;
__57:
	if !(_delta2 < 0) {
		goto __60
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __61
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__61:
	;
__60:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __58
__58:
	if 0 != 0 {
		goto __57
	}
	goto __59
__59:
	;
__55:
	;
	goto __53
__53:
	if 0 != 0 {
		goto __52
	}
	goto __54
__54:
	;
	goto __48
__48:
	if 0 != 0 {
		goto __47
	}
	goto __49
__49:
	;
	goto __46
__45:
	if !(*(*int32)(unsafe.Pointer(bp)) <= 255) {
		goto __62
	}
__64:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __67
	}
	XTclExpandCodeArray(tls, envPtr)
__67:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_APPEND_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __68
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_APPEND_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__68:
	;
__69:
	_delta3 = XtclInstructionTable[INST_APPEND_SCALAR1].FstackEffect
	if !(_delta3 != 0) {
		goto __72
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __73
	}
	_delta3 = 1 - *(*int32)(unsafe.Pointer(bp))
__73:
	;
__74:
	if !(_delta3 < 0) {
		goto __77
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __78
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__78:
	;
__77:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __75
__75:
	if 0 != 0 {
		goto __74
	}
	goto __76
__76:
	;
__72:
	;
	goto __70
__70:
	if 0 != 0 {
		goto __69
	}
	goto __71
__71:
	;
	goto __65
__65:
	if 0 != 0 {
		goto __64
	}
	goto __66
__66:
	;
	goto __63
__62:
__79:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __82
	}
	XTclExpandCodeArray(tls, envPtr)
__82:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_APPEND_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __83
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_APPEND_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__83:
	;
__84:
	_delta4 = XtclInstructionTable[INST_APPEND_SCALAR4].FstackEffect
	if !(_delta4 != 0) {
		goto __87
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __88
	}
	_delta4 = 1 - *(*int32)(unsafe.Pointer(bp))
__88:
	;
__89:
	if !(_delta4 < 0) {
		goto __92
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __93
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__93:
	;
__92:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __90
__90:
	if 0 != 0 {
		goto __89
	}
	goto __91
__91:
	;
__87:
	;
	goto __85
__85:
	if 0 != 0 {
		goto __84
	}
	goto __86
__86:
	;
	goto __80
__80:
	if 0 != 0 {
		goto __79
	}
	goto __81
__81:
	;
__63:
	;

__46:
	;
	goto __44
__43:
	if !(*(*int32)(unsafe.Pointer(bp)) < 0) {
		goto __94
	}
__96:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __99
	}
	XTclExpandCodeArray(tls, envPtr)
__99:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_APPEND_ARRAY_STK)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __100
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_APPEND_ARRAY_STK == INST_START_CMD {
			return 1
		}
		return 0
	}()
__100:
	;
__101:
	_delta5 = XtclInstructionTable[INST_APPEND_ARRAY_STK].FstackEffect
	if !(_delta5 != 0) {
		goto __104
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __105
	}
	_delta5 = 1 - 0
__105:
	;
__106:
	if !(_delta5 < 0) {
		goto __109
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __110
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__110:
	;
__109:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __107
__107:
	if 0 != 0 {
		goto __106
	}
	goto __108
__108:
	;
__104:
	;
	goto __102
__102:
	if 0 != 0 {
		goto __101
	}
	goto __103
__103:
	;
	goto __97
__97:
	if 0 != 0 {
		goto __96
	}
	goto __98
__98:
	;
	goto __95
__94:
	if !(*(*int32)(unsafe.Pointer(bp)) <= 255) {
		goto __111
	}
__113:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __116
	}
	XTclExpandCodeArray(tls, envPtr)
__116:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_APPEND_ARRAY1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __117
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_APPEND_ARRAY1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__117:
	;
__118:
	_delta6 = XtclInstructionTable[INST_APPEND_ARRAY1].FstackEffect
	if !(_delta6 != 0) {
		goto __121
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __122
	}
	_delta6 = 1 - *(*int32)(unsafe.Pointer(bp))
__122:
	;
__123:
	if !(_delta6 < 0) {
		goto __126
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __127
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__127:
	;
__126:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __124
__124:
	if 0 != 0 {
		goto __123
	}
	goto __125
__125:
	;
__121:
	;
	goto __119
__119:
	if 0 != 0 {
		goto __118
	}
	goto __120
__120:
	;
	goto __114
__114:
	if 0 != 0 {
		goto __113
	}
	goto __115
__115:
	;
	goto __112
__111:
__128:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __131
	}
	XTclExpandCodeArray(tls, envPtr)
__131:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_APPEND_ARRAY4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __132
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_APPEND_ARRAY4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__132:
	;
__133:
	_delta7 = XtclInstructionTable[INST_APPEND_ARRAY4].FstackEffect
	if !(_delta7 != 0) {
		goto __136
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __137
	}
	_delta7 = 1 - *(*int32)(unsafe.Pointer(bp))
__137:
	;
__138:
	if !(_delta7 < 0) {
		goto __141
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __142
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__142:
	;
__141:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __139
__139:
	if 0 != 0 {
		goto __138
	}
	goto __140
__140:
	;
__136:
	;
	goto __134
__134:
	if 0 != 0 {
		goto __133
	}
	goto __135
__135:
	;
	goto __129
__129:
	if 0 != 0 {
		goto __128
	}
	goto __130
__130:
	;
__112:
	;

__95:
	;
__44:
	;

	return TCL_OK

appendMultiple:
	// Can only handle the case where we are appending to a local scalar when
	// there are multiple values to append.  Fortunately, this is common.

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	*(*int32)(unsafe.Pointer(bp /* localIndex */)) = XTclLocalScalarFromToken(tls, varTokenPtr, envPtr)
	if !(*(*int32)(unsafe.Pointer(bp)) < 0) {
		goto __143
	}
	return TCL_ERROR
__143:
	;

	// Definitely appending to a local scalar; generate the words and append
	// them.

	valueTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	i = 2
__144:
	if !(i < numWords) {
		goto __146
	}
	if !((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __147
	}
__149:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy1 <= 255) {
		goto __152
	}
__154:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __157
	}
	XTclExpandCodeArray(tls, envPtr)
__157:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __158
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__158:
	;
__159:
	_delta8 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta8 != 0) {
		goto __162
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __163
	}
	_delta8 = 1 - _objIndexCopy1
__163:
	;
__164:
	if !(_delta8 < 0) {
		goto __167
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __168
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__168:
	;
__167:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __165
__165:
	if 0 != 0 {
		goto __164
	}
	goto __166
__166:
	;
__162:
	;
	goto __160
__160:
	if 0 != 0 {
		goto __159
	}
	goto __161
__161:
	;
	goto __155
__155:
	if 0 != 0 {
		goto __154
	}
	goto __156
__156:
	;
	goto __153
__152:
__169:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __172
	}
	XTclExpandCodeArray(tls, envPtr)
__172:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __173
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__173:
	;
__174:
	_delta9 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta9 != 0) {
		goto __177
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __178
	}
	_delta9 = 1 - _objIndexCopy1
__178:
	;
__179:
	if !(_delta9 < 0) {
		goto __182
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __183
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__183:
	;
__182:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __180
__180:
	if 0 != 0 {
		goto __179
	}
	goto __181
__181:
	;
__177:
	;
	goto __175
__175:
	if 0 != 0 {
		goto __174
	}
	goto __176
__176:
	;
	goto __170
__170:
	if 0 != 0 {
		goto __169
	}
	goto __171
__171:
	;
__153:
	;
	goto __150
__150:
	if 0 != 0 {
		goto __149
	}
	goto __151
__151:
	;
	goto __148
__147:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
	XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents, envPtr)
__148:
	;

	valueTokenPtr = valueTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+1)*24
	goto __145
__145:
	i++
	goto __144
	goto __146
__146:
	;
__184:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __187
	}
	XTclExpandCodeArray(tls, envPtr)
__187:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords-2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords-2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords-2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords - 2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __188
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__188:
	;
__189:
	_delta10 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta10 != 0) {
		goto __192
	}
	if !(_delta10 == -0x7fffffff-1) {
		goto __193
	}
	_delta10 = 1 - (numWords - 2)
__193:
	;
__194:
	if !(_delta10 < 0) {
		goto __197
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __198
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__198:
	;
__197:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta10
	goto __195
__195:
	if 0 != 0 {
		goto __194
	}
	goto __196
__196:
	;
__192:
	;
	goto __190
__190:
	if 0 != 0 {
		goto __189
	}
	goto __191
__191:
	;
	goto __185
__185:
	if 0 != 0 {
		goto __184
	}
	goto __186
__186:
	;
	i = 2
__199:
	if !(i < numWords) {
		goto __201
	}
	if !(*(*int32)(unsafe.Pointer(bp)) <= 255) {
		goto __202
	}
__204:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __207
	}
	XTclExpandCodeArray(tls, envPtr)
__207:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_APPEND_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __208
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_APPEND_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__208:
	;
__209:
	_delta11 = XtclInstructionTable[INST_APPEND_SCALAR1].FstackEffect
	if !(_delta11 != 0) {
		goto __212
	}
	if !(_delta11 == -0x7fffffff-1) {
		goto __213
	}
	_delta11 = 1 - *(*int32)(unsafe.Pointer(bp))
__213:
	;
__214:
	if !(_delta11 < 0) {
		goto __217
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __218
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__218:
	;
__217:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta11
	goto __215
__215:
	if 0 != 0 {
		goto __214
	}
	goto __216
__216:
	;
__212:
	;
	goto __210
__210:
	if 0 != 0 {
		goto __209
	}
	goto __211
__211:
	;
	goto __205
__205:
	if 0 != 0 {
		goto __204
	}
	goto __206
__206:
	;
	goto __203
__202:
__219:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __222
	}
	XTclExpandCodeArray(tls, envPtr)
__222:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_APPEND_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __223
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_APPEND_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__223:
	;
__224:
	_delta12 = XtclInstructionTable[INST_APPEND_SCALAR4].FstackEffect
	if !(_delta12 != 0) {
		goto __227
	}
	if !(_delta12 == -0x7fffffff-1) {
		goto __228
	}
	_delta12 = 1 - *(*int32)(unsafe.Pointer(bp))
__228:
	;
__229:
	if !(_delta12 < 0) {
		goto __232
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __233
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__233:
	;
__232:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta12
	goto __230
__230:
	if 0 != 0 {
		goto __229
	}
	goto __231
__231:
	;
__227:
	;
	goto __225
__225:
	if 0 != 0 {
		goto __224
	}
	goto __226
__226:
	;
	goto __220
__220:
	if 0 != 0 {
		goto __219
	}
	goto __221
__221:
	;
__203:
	;

	if !(libc.PreIncInt32(&i, 1) < numWords) {
		goto __234
	}
__235:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __238
	}
	XTclExpandCodeArray(tls, envPtr)
__238:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __239
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__239:
	;
__240:
	_delta13 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta13 != 0) {
		goto __243
	}
	if !(_delta13 == -0x7fffffff-1) {
		goto __244
	}
	_delta13 = 1 - 0
__244:
	;
__245:
	if !(_delta13 < 0) {
		goto __248
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __249
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__249:
	;
__248:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta13
	goto __246
__246:
	if 0 != 0 {
		goto __245
	}
	goto __247
__247:
	;
__243:
	;
	goto __241
__241:
	if 0 != 0 {
		goto __240
	}
	goto __242
__242:
	;
	goto __236
__236:
	if 0 != 0 {
		goto __235
	}
	goto __237
__237:
	;
__234:
	;
	goto __200
__200:
	;
	goto __199
	goto __201
__201:
	;

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileArray*Cmd --
//
//	Functions called to compile "array" sucommands.
//
// Results:
//	All return TCL_OK for a successful compile, and TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "array" subcommand at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileArrayExistsCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:259:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	// var isScalar int32 at bp+4, 4

	// var localIndex int32 at bp, 4

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclPushVarName(tls, interp, tokenPtr, envPtr, TCL_NO_ELEMENT, bp, bp+4)
	if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
		return TCL_ERROR
	}

	if *(*int32)(unsafe.Pointer(bp)) >= 0 {
		for ok := true; ok; ok = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ARRAY_EXISTS_IMM)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_ARRAY_EXISTS_IMM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_ARRAY_EXISTS_IMM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - *(*int32)(unsafe.Pointer(bp))
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ARRAY_EXISTS_STK)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_ARRAY_EXISTS_STK == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_ARRAY_EXISTS_STK].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileArraySetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:291:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var varTokenPtr uintptr
	var dataTokenPtr uintptr
	// var isScalar int32 at bp+8, 4

	// var localIndex int32 at bp+4, 4

	var code int32
	var isDataLiteral int32
	var isDataValid int32
	var isDataEven int32
	// var len int32 at bp, 4

	var keyVar int32
	var valVar int32
	var infoIndex int32
	var fwd int32
	var offsetBack int32
	var offsetFwd int32
	var literalObj uintptr
	var infoPtr uintptr
	var _delta int32
	var _delta1 int32
	var _delta2 int32
	var _delta3 int32
	var _delta4 int32
	var _delta5 int32
	var _delta6 int32
	var _delta7 int32
	var _delta8 int32
	var _delta9 int32
	var _delta10 int32
	var _objIndexCopy int32
	var _delta11 int32
	var _delta12 int32
	var _objIndexCopy1 int32
	var _delta13 int32
	var _delta14 int32
	var _delta15 int32
	var _delta16 int32
	var _delta17 int32
	var _delta18 int32
	var _delta19 int32
	var _delta20 int32
	var _objIndexCopy2 int32
	var _delta21 int32
	var _delta22 int32
	var _delta23 int32
	var _delta24 int32
	var _objIndexCopy3 int32
	var _delta25 int32
	var _delta26 int32
	var _delta27 int32
	var _delta28 int32
	var _objIndexCopy4 int32
	var _delta29 int32
	var _delta30 int32
	var _objIndexCopy5 int32
	var _delta31 int32
	var _delta32 int32
	var _delta33 int32
	var _delta34 int32
	var _delta35 int32
	var _delta36 int32
	var _delta37 int32
	var _delta38 int32
	var _delta39 int32
	var _delta40 int32
	var _delta41 int32
	var _delta42 int32
	var _delta43 int32
	var _objIndexCopy6 int32
	var _objPtr uintptr
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	code = TCL_OK

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	dataTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	literalObj = XTcl_NewObj(tls)
	isDataLiteral = XTclWordKnownAtCompileTime(tls, dataTokenPtr, literalObj)
	isDataValid = libc.Bool32(isDataLiteral != 0 &&
		XTcl_ListObjLength(tls, uintptr(0), literalObj, bp) == TCL_OK)
	isDataEven = libc.Bool32(isDataValid != 0 && *(*int32)(unsafe.Pointer(bp))&1 == 0)

	// Special case: literal odd-length argument is always an error.

	if !(isDataValid != 0 && !(isDataEven != 0)) {
		goto __2
	}
	// Abandon custom compile and let invocation raise the error
	code = XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	goto done

	//
	//  We used to compile to the bytecode that would throw the error,
	//  but that was wrong because it would not invoke the array trace
	//  on the variable.
	//
	// 	PushStringLiteral(envPtr, "list must have an even number of elements");
	// 	PushStringLiteral(envPtr, "-errorcode {TCL ARGUMENT FORMAT}");
	// 	TclEmitInstInt4(INST_RETURN_IMM, TCL_ERROR,		envPtr);
	// 	TclEmitInt4(		0,				envPtr);
	// 	goto done;
	// 	 *
	//
__2:
	;

	// Except for the special "ensure array" case below, when we're not in
	// a proc, we cannot do a better compile than generic.

	if !((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD || (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr == uintptr(0) && !(isDataEven != 0 && *(*int32)(unsafe.Pointer(bp)) == 0)) {
		goto __3
	}
	code = XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	goto done
__3:
	;

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclPushVarName(tls, interp, varTokenPtr, envPtr, TCL_NO_ELEMENT, bp+4, bp+8)
	if !!(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		goto __4
	}
	code = TCL_ERROR
	goto done
__4:
	;

	// Special case: literal empty value argument is just an "ensure array"
	// operation.

	if !(isDataEven != 0 && *(*int32)(unsafe.Pointer(bp)) == 0) {
		goto __5
	}
	if !(*(*int32)(unsafe.Pointer(bp + 4)) >= 0) {
		goto __6
	}
__8:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __11
	}
	XTclExpandCodeArray(tls, envPtr)
__11:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ARRAY_EXISTS_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __12
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_ARRAY_EXISTS_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__12:
	;
__13:
	_delta = XtclInstructionTable[INST_ARRAY_EXISTS_IMM].FstackEffect
	if !(_delta != 0) {
		goto __16
	}
	if !(_delta == -0x7fffffff-1) {
		goto __17
	}
	_delta = 1 - *(*int32)(unsafe.Pointer(bp + 4))
__17:
	;
__18:
	if !(_delta < 0) {
		goto __21
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __22
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__22:
	;
__21:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __19
__19:
	if 0 != 0 {
		goto __18
	}
	goto __20
__20:
	;
__16:
	;
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
	goto __9
__9:
	if 0 != 0 {
		goto __8
	}
	goto __10
__10:
	;
__23:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __26
	}
	XTclExpandCodeArray(tls, envPtr)
__26:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(7))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __27
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__27:
	;
__28:
	_delta1 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta1 != 0) {
		goto __31
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __32
	}
	_delta1 = 1 - 7
__32:
	;
__33:
	if !(_delta1 < 0) {
		goto __36
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __37
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__37:
	;
__36:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
__31:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
__38:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __41
	}
	XTclExpandCodeArray(tls, envPtr)
__41:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ARRAY_MAKE_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __42
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_ARRAY_MAKE_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__42:
	;
__43:
	_delta2 = XtclInstructionTable[INST_ARRAY_MAKE_IMM].FstackEffect
	if !(_delta2 != 0) {
		goto __46
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __47
	}
	_delta2 = 1 - *(*int32)(unsafe.Pointer(bp + 4))
__47:
	;
__48:
	if !(_delta2 < 0) {
		goto __51
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __52
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__52:
	;
__51:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __49
__49:
	if 0 != 0 {
		goto __48
	}
	goto __50
__50:
	;
__46:
	;
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;
	goto __39
__39:
	if 0 != 0 {
		goto __38
	}
	goto __40
__40:
	;
	goto __7
__6:
__53:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __56
	}
	XTclExpandCodeArray(tls, envPtr)
__56:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __57
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__57:
	;
__58:
	_delta3 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta3 != 0) {
		goto __61
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __62
	}
	_delta3 = 1 - 0
__62:
	;
__63:
	if !(_delta3 < 0) {
		goto __66
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __67
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__67:
	;
__66:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __64
__64:
	if 0 != 0 {
		goto __63
	}
	goto __65
__65:
	;
__61:
	;
	goto __59
__59:
	if 0 != 0 {
		goto __58
	}
	goto __60
__60:
	;
	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
__68:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __71
	}
	XTclExpandCodeArray(tls, envPtr)
__71:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ARRAY_EXISTS_STK)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __72
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_ARRAY_EXISTS_STK == INST_START_CMD {
			return 1
		}
		return 0
	}()
__72:
	;
__73:
	_delta4 = XtclInstructionTable[INST_ARRAY_EXISTS_STK].FstackEffect
	if !(_delta4 != 0) {
		goto __76
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __77
	}
	_delta4 = 1 - 0
__77:
	;
__78:
	if !(_delta4 < 0) {
		goto __81
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __82
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__82:
	;
__81:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __79
__79:
	if 0 != 0 {
		goto __78
	}
	goto __80
__80:
	;
__76:
	;
	goto __74
__74:
	if 0 != 0 {
		goto __73
	}
	goto __75
__75:
	;
	goto __69
__69:
	if 0 != 0 {
		goto __68
	}
	goto __70
__70:
	;
__83:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __86
	}
	XTclExpandCodeArray(tls, envPtr)
__86:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __87
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__87:
	;
__88:
	_delta5 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta5 != 0) {
		goto __91
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __92
	}
	_delta5 = 1 - 5
__92:
	;
__93:
	if !(_delta5 < 0) {
		goto __96
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __97
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__97:
	;
__96:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __94
__94:
	if 0 != 0 {
		goto __93
	}
	goto __95
__95:
	;
__91:
	;
	goto __89
__89:
	if 0 != 0 {
		goto __88
	}
	goto __90
__90:
	;
	goto __84
__84:
	if 0 != 0 {
		goto __83
	}
	goto __85
__85:
	;
__98:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __101
	}
	XTclExpandCodeArray(tls, envPtr)
__101:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ARRAY_MAKE_STK)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __102
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_ARRAY_MAKE_STK == INST_START_CMD {
			return 1
		}
		return 0
	}()
__102:
	;
__103:
	_delta6 = XtclInstructionTable[INST_ARRAY_MAKE_STK].FstackEffect
	if !(_delta6 != 0) {
		goto __106
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __107
	}
	_delta6 = 1 - 0
__107:
	;
__108:
	if !(_delta6 < 0) {
		goto __111
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __112
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__112:
	;
__111:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __109
__109:
	if 0 != 0 {
		goto __108
	}
	goto __110
__110:
	;
__106:
	;
	goto __104
__104:
	if 0 != 0 {
		goto __103
	}
	goto __105
__105:
	;
	goto __99
__99:
	if 0 != 0 {
		goto __98
	}
	goto __100
__100:
	;
__113:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __116
	}
	XTclExpandCodeArray(tls, envPtr)
__116:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __117
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__117:
	;
__118:
	_delta7 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta7 != 0) {
		goto __121
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __122
	}
	_delta7 = 1 - 3
__122:
	;
__123:
	if !(_delta7 < 0) {
		goto __126
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __127
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__127:
	;
__126:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __124
__124:
	if 0 != 0 {
		goto __123
	}
	goto __125
__125:
	;
__121:
	;
	goto __119
__119:
	if 0 != 0 {
		goto __118
	}
	goto __120
__120:
	;
	goto __114
__114:
	if 0 != 0 {
		goto __113
	}
	goto __115
__115:
	;
	// Each branch decrements stack depth, but we only take one.
__128:
	if !(1 < 0) {
		goto __131
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __132
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__132:
	;
__131:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
	goto __129
__129:
	if 0 != 0 {
		goto __128
	}
	goto __130
__130:
	;
__133:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __136
	}
	XTclExpandCodeArray(tls, envPtr)
__136:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __137
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__137:
	;
__138:
	_delta8 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta8 != 0) {
		goto __141
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __142
	}
	_delta8 = 1 - 0
__142:
	;
__143:
	if !(_delta8 < 0) {
		goto __146
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __147
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__147:
	;
__146:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __144
__144:
	if 0 != 0 {
		goto __143
	}
	goto __145
__145:
	;
__141:
	;
	goto __139
__139:
	if 0 != 0 {
		goto __138
	}
	goto __140
__140:
	;
	goto __134
__134:
	if 0 != 0 {
		goto __133
	}
	goto __135
__135:
	;
__7:
	;
__148:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy <= 255) {
		goto __151
	}
__153:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __156
	}
	XTclExpandCodeArray(tls, envPtr)
__156:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __157
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__157:
	;
__158:
	_delta9 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta9 != 0) {
		goto __161
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __162
	}
	_delta9 = 1 - _objIndexCopy
__162:
	;
__163:
	if !(_delta9 < 0) {
		goto __166
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __167
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__167:
	;
__166:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __164
__164:
	if 0 != 0 {
		goto __163
	}
	goto __165
__165:
	;
__161:
	;
	goto __159
__159:
	if 0 != 0 {
		goto __158
	}
	goto __160
__160:
	;
	goto __154
__154:
	if 0 != 0 {
		goto __153
	}
	goto __155
__155:
	;
	goto __152
__151:
__168:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __171
	}
	XTclExpandCodeArray(tls, envPtr)
__171:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __172
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__172:
	;
__173:
	_delta10 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta10 != 0) {
		goto __176
	}
	if !(_delta10 == -0x7fffffff-1) {
		goto __177
	}
	_delta10 = 1 - _objIndexCopy
__177:
	;
__178:
	if !(_delta10 < 0) {
		goto __181
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __182
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__182:
	;
__181:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta10
	goto __179
__179:
	if 0 != 0 {
		goto __178
	}
	goto __180
__180:
	;
__176:
	;
	goto __174
__174:
	if 0 != 0 {
		goto __173
	}
	goto __175
__175:
	;
	goto __169
__169:
	if 0 != 0 {
		goto __168
	}
	goto __170
__170:
	;
__152:
	;
	goto __149
__149:
	if 0 != 0 {
		goto __148
	}
	goto __150
__150:
	;
	goto done
__5:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 4)) < 0) {
		goto __183
	}
	// a non-local variable: upvar from a local one! This consumes the
	// variable name that was left at stacktop.

	*(*int32)(unsafe.Pointer(bp + 4 /* localIndex */)) = XTclFindCompiledLocal(tls, (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Fstart,
		(*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Fsize, 1, envPtr)
__184:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, ts+18333, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy1 <= 255) {
		goto __187
	}
__189:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __192
	}
	XTclExpandCodeArray(tls, envPtr)
__192:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __193
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__193:
	;
__194:
	_delta11 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta11 != 0) {
		goto __197
	}
	if !(_delta11 == -0x7fffffff-1) {
		goto __198
	}
	_delta11 = 1 - _objIndexCopy1
__198:
	;
__199:
	if !(_delta11 < 0) {
		goto __202
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __203
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__203:
	;
__202:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta11
	goto __200
__200:
	if 0 != 0 {
		goto __199
	}
	goto __201
__201:
	;
__197:
	;
	goto __195
__195:
	if 0 != 0 {
		goto __194
	}
	goto __196
__196:
	;
	goto __190
__190:
	if 0 != 0 {
		goto __189
	}
	goto __191
__191:
	;
	goto __188
__187:
__204:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __207
	}
	XTclExpandCodeArray(tls, envPtr)
__207:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __208
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__208:
	;
__209:
	_delta12 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta12 != 0) {
		goto __212
	}
	if !(_delta12 == -0x7fffffff-1) {
		goto __213
	}
	_delta12 = 1 - _objIndexCopy1
__213:
	;
__214:
	if !(_delta12 < 0) {
		goto __217
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __218
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__218:
	;
__217:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta12
	goto __215
__215:
	if 0 != 0 {
		goto __214
	}
	goto __216
__216:
	;
__212:
	;
	goto __210
__210:
	if 0 != 0 {
		goto __209
	}
	goto __211
__211:
	;
	goto __205
__205:
	if 0 != 0 {
		goto __204
	}
	goto __206
__206:
	;
__188:
	;
	goto __185
__185:
	if 0 != 0 {
		goto __184
	}
	goto __186
__186:
	;
__219:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __222
	}
	XTclExpandCodeArray(tls, envPtr)
__222:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __223
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__223:
	;
__224:
	_delta13 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta13 != 0) {
		goto __227
	}
	if !(_delta13 == -0x7fffffff-1) {
		goto __228
	}
	_delta13 = 1 - 2
__228:
	;
__229:
	if !(_delta13 < 0) {
		goto __232
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __233
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__233:
	;
__232:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta13
	goto __230
__230:
	if 0 != 0 {
		goto __229
	}
	goto __231
__231:
	;
__227:
	;
	goto __225
__225:
	if 0 != 0 {
		goto __224
	}
	goto __226
__226:
	;
	goto __220
__220:
	if 0 != 0 {
		goto __219
	}
	goto __221
__221:
	;
__234:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __237
	}
	XTclExpandCodeArray(tls, envPtr)
__237:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UPVAR)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __238
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_UPVAR == INST_START_CMD {
			return 1
		}
		return 0
	}()
__238:
	;
__239:
	_delta14 = XtclInstructionTable[INST_UPVAR].FstackEffect
	if !(_delta14 != 0) {
		goto __242
	}
	if !(_delta14 == -0x7fffffff-1) {
		goto __243
	}
	_delta14 = 1 - *(*int32)(unsafe.Pointer(bp + 4))
__243:
	;
__244:
	if !(_delta14 < 0) {
		goto __247
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __248
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__248:
	;
__247:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta14
	goto __245
__245:
	if 0 != 0 {
		goto __244
	}
	goto __246
__246:
	;
__242:
	;
	goto __240
__240:
	if 0 != 0 {
		goto __239
	}
	goto __241
__241:
	;
	goto __235
__235:
	if 0 != 0 {
		goto __234
	}
	goto __236
__236:
	;
__249:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __252
	}
	XTclExpandCodeArray(tls, envPtr)
__252:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __253
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__253:
	;
__254:
	_delta15 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta15 != 0) {
		goto __257
	}
	if !(_delta15 == -0x7fffffff-1) {
		goto __258
	}
	_delta15 = 1 - 0
__258:
	;
__259:
	if !(_delta15 < 0) {
		goto __262
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __263
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__263:
	;
__262:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta15
	goto __260
__260:
	if 0 != 0 {
		goto __259
	}
	goto __261
__261:
	;
__257:
	;
	goto __255
__255:
	if 0 != 0 {
		goto __254
	}
	goto __256
__256:
	;
	goto __250
__250:
	if 0 != 0 {
		goto __249
	}
	goto __251
__251:
	;
__183:
	;

	// Prepare for the internal foreach.

	keyVar = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
	valVar = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)

	infoPtr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+16))+uint64(unsafe.Sizeof(uintptr(0)))))
	(*ForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists = 1
	*(*uintptr)(unsafe.Pointer(infoPtr + 16)) = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+4))+uint64(2)*uint64(unsafe.Sizeof(int32(0)))))
	(*ForeachVarList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(infoPtr + 16)))).FnumVars = 2
	*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(infoPtr + 16)) + 4)) = keyVar
	*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(infoPtr + 16)) + 4 + 1*4)) = valVar
	infoIndex = XTclCreateAuxData(tls, infoPtr, uintptr(unsafe.Pointer(&newForeachInfoType)), envPtr)

	// Start issuing instructions to write to the array.

__264:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __267
	}
	XTclExpandCodeArray(tls, envPtr)
__267:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ARRAY_EXISTS_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __268
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_ARRAY_EXISTS_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__268:
	;
__269:
	_delta16 = XtclInstructionTable[INST_ARRAY_EXISTS_IMM].FstackEffect
	if !(_delta16 != 0) {
		goto __272
	}
	if !(_delta16 == -0x7fffffff-1) {
		goto __273
	}
	_delta16 = 1 - *(*int32)(unsafe.Pointer(bp + 4))
__273:
	;
__274:
	if !(_delta16 < 0) {
		goto __277
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __278
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__278:
	;
__277:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta16
	goto __275
__275:
	if 0 != 0 {
		goto __274
	}
	goto __276
__276:
	;
__272:
	;
	goto __270
__270:
	if 0 != 0 {
		goto __269
	}
	goto __271
__271:
	;
	goto __265
__265:
	if 0 != 0 {
		goto __264
	}
	goto __266
__266:
	;
__279:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __282
	}
	XTclExpandCodeArray(tls, envPtr)
__282:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(7))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __283
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__283:
	;
__284:
	_delta17 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta17 != 0) {
		goto __287
	}
	if !(_delta17 == -0x7fffffff-1) {
		goto __288
	}
	_delta17 = 1 - 7
__288:
	;
__289:
	if !(_delta17 < 0) {
		goto __292
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __293
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__293:
	;
__292:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta17
	goto __290
__290:
	if 0 != 0 {
		goto __289
	}
	goto __291
__291:
	;
__287:
	;
	goto __285
__285:
	if 0 != 0 {
		goto __284
	}
	goto __286
__286:
	;
	goto __280
__280:
	if 0 != 0 {
		goto __279
	}
	goto __281
__281:
	;
__294:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __297
	}
	XTclExpandCodeArray(tls, envPtr)
__297:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ARRAY_MAKE_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __298
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_ARRAY_MAKE_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__298:
	;
__299:
	_delta18 = XtclInstructionTable[INST_ARRAY_MAKE_IMM].FstackEffect
	if !(_delta18 != 0) {
		goto __302
	}
	if !(_delta18 == -0x7fffffff-1) {
		goto __303
	}
	_delta18 = 1 - *(*int32)(unsafe.Pointer(bp + 4))
__303:
	;
__304:
	if !(_delta18 < 0) {
		goto __307
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __308
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__308:
	;
__307:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta18
	goto __305
__305:
	if 0 != 0 {
		goto __304
	}
	goto __306
__306:
	;
__302:
	;
	goto __300
__300:
	if 0 != 0 {
		goto __299
	}
	goto __301
__301:
	;
	goto __295
__295:
	if 0 != 0 {
		goto __294
	}
	goto __296
__296:
	;

	if !((*Tcl_Token)(unsafe.Pointer(dataTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __309
	}
__311:
	_objIndexCopy2 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(dataTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(dataTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy2 <= 255) {
		goto __314
	}
__316:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __319
	}
	XTclExpandCodeArray(tls, envPtr)
__319:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __320
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__320:
	;
__321:
	_delta19 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta19 != 0) {
		goto __324
	}
	if !(_delta19 == -0x7fffffff-1) {
		goto __325
	}
	_delta19 = 1 - _objIndexCopy2
__325:
	;
__326:
	if !(_delta19 < 0) {
		goto __329
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __330
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__330:
	;
__329:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta19
	goto __327
__327:
	if 0 != 0 {
		goto __326
	}
	goto __328
__328:
	;
__324:
	;
	goto __322
__322:
	if 0 != 0 {
		goto __321
	}
	goto __323
__323:
	;
	goto __317
__317:
	if 0 != 0 {
		goto __316
	}
	goto __318
__318:
	;
	goto __315
__314:
__331:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __334
	}
	XTclExpandCodeArray(tls, envPtr)
__334:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __335
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__335:
	;
__336:
	_delta20 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta20 != 0) {
		goto __339
	}
	if !(_delta20 == -0x7fffffff-1) {
		goto __340
	}
	_delta20 = 1 - _objIndexCopy2
__340:
	;
__341:
	if !(_delta20 < 0) {
		goto __344
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __345
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__345:
	;
__344:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta20
	goto __342
__342:
	if 0 != 0 {
		goto __341
	}
	goto __343
__343:
	;
__339:
	;
	goto __337
__337:
	if 0 != 0 {
		goto __336
	}
	goto __338
__338:
	;
	goto __332
__332:
	if 0 != 0 {
		goto __331
	}
	goto __333
__333:
	;
__315:
	;
	goto __312
__312:
	if 0 != 0 {
		goto __311
	}
	goto __313
__313:
	;
	goto __310
__309:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
	XTclCompileTokens(tls, interp, dataTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(dataTokenPtr)).FnumComponents, envPtr)
__310:
	;

	if !(!(isDataLiteral != 0) || !(isDataValid != 0)) {
		goto __346
	}
	// Only need this safety check if we're handling a non-literal or list
	// containing an invalid literal; with valid list literals, we've
	// already checked (worth it because literals are a very common
	// use-case with [array set]).

__347:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __350
	}
	XTclExpandCodeArray(tls, envPtr)
__350:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __351
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__351:
	;
__352:
	_delta21 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta21 != 0) {
		goto __355
	}
	if !(_delta21 == -0x7fffffff-1) {
		goto __356
	}
	_delta21 = 1 - 0
__356:
	;
__357:
	if !(_delta21 < 0) {
		goto __360
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __361
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__361:
	;
__360:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta21
	goto __358
__358:
	if 0 != 0 {
		goto __357
	}
	goto __359
__359:
	;
__355:
	;
	goto __353
__353:
	if 0 != 0 {
		goto __352
	}
	goto __354
__354:
	;
	goto __348
__348:
	if 0 != 0 {
		goto __347
	}
	goto __349
__349:
	;
__362:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __365
	}
	XTclExpandCodeArray(tls, envPtr)
__365:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_LENGTH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __366
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST_LENGTH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__366:
	;
__367:
	_delta22 = XtclInstructionTable[INST_LIST_LENGTH].FstackEffect
	if !(_delta22 != 0) {
		goto __370
	}
	if !(_delta22 == -0x7fffffff-1) {
		goto __371
	}
	_delta22 = 1 - 0
__371:
	;
__372:
	if !(_delta22 < 0) {
		goto __375
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __376
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__376:
	;
__375:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta22
	goto __373
__373:
	if 0 != 0 {
		goto __372
	}
	goto __374
__374:
	;
__370:
	;
	goto __368
__368:
	if 0 != 0 {
		goto __367
	}
	goto __369
__369:
	;
	goto __363
__363:
	if 0 != 0 {
		goto __362
	}
	goto __364
__364:
	;
__377:
	_objIndexCopy3 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy3 <= 255) {
		goto __380
	}
__382:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __385
	}
	XTclExpandCodeArray(tls, envPtr)
__385:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __386
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__386:
	;
__387:
	_delta23 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta23 != 0) {
		goto __390
	}
	if !(_delta23 == -0x7fffffff-1) {
		goto __391
	}
	_delta23 = 1 - _objIndexCopy3
__391:
	;
__392:
	if !(_delta23 < 0) {
		goto __395
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __396
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__396:
	;
__395:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta23
	goto __393
__393:
	if 0 != 0 {
		goto __392
	}
	goto __394
__394:
	;
__390:
	;
	goto __388
__388:
	if 0 != 0 {
		goto __387
	}
	goto __389
__389:
	;
	goto __383
__383:
	if 0 != 0 {
		goto __382
	}
	goto __384
__384:
	;
	goto __381
__380:
__397:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __400
	}
	XTclExpandCodeArray(tls, envPtr)
__400:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __401
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__401:
	;
__402:
	_delta24 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta24 != 0) {
		goto __405
	}
	if !(_delta24 == -0x7fffffff-1) {
		goto __406
	}
	_delta24 = 1 - _objIndexCopy3
__406:
	;
__407:
	if !(_delta24 < 0) {
		goto __410
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __411
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__411:
	;
__410:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta24
	goto __408
__408:
	if 0 != 0 {
		goto __407
	}
	goto __409
__409:
	;
__405:
	;
	goto __403
__403:
	if 0 != 0 {
		goto __402
	}
	goto __404
__404:
	;
	goto __398
__398:
	if 0 != 0 {
		goto __397
	}
	goto __399
__399:
	;
__381:
	;
	goto __378
__378:
	if 0 != 0 {
		goto __377
	}
	goto __379
__379:
	;
__412:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __415
	}
	XTclExpandCodeArray(tls, envPtr)
__415:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BITAND)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __416
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_BITAND == INST_START_CMD {
			return 1
		}
		return 0
	}()
__416:
	;
__417:
	_delta25 = XtclInstructionTable[INST_BITAND].FstackEffect
	if !(_delta25 != 0) {
		goto __420
	}
	if !(_delta25 == -0x7fffffff-1) {
		goto __421
	}
	_delta25 = 1 - 0
__421:
	;
__422:
	if !(_delta25 < 0) {
		goto __425
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __426
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__426:
	;
__425:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta25
	goto __423
__423:
	if 0 != 0 {
		goto __422
	}
	goto __424
__424:
	;
__420:
	;
	goto __418
__418:
	if 0 != 0 {
		goto __417
	}
	goto __419
__419:
	;
	goto __413
__413:
	if 0 != 0 {
		goto __412
	}
	goto __414
__414:
	;
	offsetFwd = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__427:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __430
	}
	XTclExpandCodeArray(tls, envPtr)
__430:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __431
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_FALSE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__431:
	;
__432:
	_delta26 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
	if !(_delta26 != 0) {
		goto __435
	}
	if !(_delta26 == -0x7fffffff-1) {
		goto __436
	}
	_delta26 = 1 - 0
__436:
	;
__437:
	if !(_delta26 < 0) {
		goto __440
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __441
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__441:
	;
__440:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta26
	goto __438
__438:
	if 0 != 0 {
		goto __437
	}
	goto __439
__439:
	;
__435:
	;
	goto __433
__433:
	if 0 != 0 {
		goto __432
	}
	goto __434
__434:
	;
	goto __428
__428:
	if 0 != 0 {
		goto __427
	}
	goto __429
__429:
	;
__442:
	_objIndexCopy4 = XTclRegisterLiteral(tls, envPtr, ts+18335, int32(uint64(unsafe.Sizeof([42]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy4 <= 255) {
		goto __445
	}
__447:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __450
	}
	XTclExpandCodeArray(tls, envPtr)
__450:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __451
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__451:
	;
__452:
	_delta27 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta27 != 0) {
		goto __455
	}
	if !(_delta27 == -0x7fffffff-1) {
		goto __456
	}
	_delta27 = 1 - _objIndexCopy4
__456:
	;
__457:
	if !(_delta27 < 0) {
		goto __460
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __461
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__461:
	;
__460:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta27
	goto __458
__458:
	if 0 != 0 {
		goto __457
	}
	goto __459
__459:
	;
__455:
	;
	goto __453
__453:
	if 0 != 0 {
		goto __452
	}
	goto __454
__454:
	;
	goto __448
__448:
	if 0 != 0 {
		goto __447
	}
	goto __449
__449:
	;
	goto __446
__445:
__462:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __465
	}
	XTclExpandCodeArray(tls, envPtr)
__465:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __466
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__466:
	;
__467:
	_delta28 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta28 != 0) {
		goto __470
	}
	if !(_delta28 == -0x7fffffff-1) {
		goto __471
	}
	_delta28 = 1 - _objIndexCopy4
__471:
	;
__472:
	if !(_delta28 < 0) {
		goto __475
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __476
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__476:
	;
__475:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta28
	goto __473
__473:
	if 0 != 0 {
		goto __472
	}
	goto __474
__474:
	;
__470:
	;
	goto __468
__468:
	if 0 != 0 {
		goto __467
	}
	goto __469
__469:
	;
	goto __463
__463:
	if 0 != 0 {
		goto __462
	}
	goto __464
__464:
	;
__446:
	;
	goto __443
__443:
	if 0 != 0 {
		goto __442
	}
	goto __444
__444:
	;
__477:
	_objIndexCopy5 = XTclRegisterLiteral(tls, envPtr, ts+18377, int32(uint64(unsafe.Sizeof([33]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy5 <= 255) {
		goto __480
	}
__482:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __485
	}
	XTclExpandCodeArray(tls, envPtr)
__485:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __486
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__486:
	;
__487:
	_delta29 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta29 != 0) {
		goto __490
	}
	if !(_delta29 == -0x7fffffff-1) {
		goto __491
	}
	_delta29 = 1 - _objIndexCopy5
__491:
	;
__492:
	if !(_delta29 < 0) {
		goto __495
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __496
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__496:
	;
__495:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta29
	goto __493
__493:
	if 0 != 0 {
		goto __492
	}
	goto __494
__494:
	;
__490:
	;
	goto __488
__488:
	if 0 != 0 {
		goto __487
	}
	goto __489
__489:
	;
	goto __483
__483:
	if 0 != 0 {
		goto __482
	}
	goto __484
__484:
	;
	goto __481
__480:
__497:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __500
	}
	XTclExpandCodeArray(tls, envPtr)
__500:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __501
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__501:
	;
__502:
	_delta30 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta30 != 0) {
		goto __505
	}
	if !(_delta30 == -0x7fffffff-1) {
		goto __506
	}
	_delta30 = 1 - _objIndexCopy5
__506:
	;
__507:
	if !(_delta30 < 0) {
		goto __510
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __511
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__511:
	;
__510:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta30
	goto __508
__508:
	if 0 != 0 {
		goto __507
	}
	goto __509
__509:
	;
__505:
	;
	goto __503
__503:
	if 0 != 0 {
		goto __502
	}
	goto __504
__504:
	;
	goto __498
__498:
	if 0 != 0 {
		goto __497
	}
	goto __499
__499:
	;
__481:
	;
	goto __478
__478:
	if 0 != 0 {
		goto __477
	}
	goto __479
__479:
	;
__512:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __515
	}
	XTclExpandCodeArray(tls, envPtr)
__515:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_RETURN_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(TCL_ERROR))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __516
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_RETURN_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__516:
	;
__517:
	_delta31 = XtclInstructionTable[INST_RETURN_IMM].FstackEffect
	if !(_delta31 != 0) {
		goto __520
	}
	if !(_delta31 == -0x7fffffff-1) {
		goto __521
	}
	_delta31 = 1 - TCL_ERROR
__521:
	;
__522:
	if !(_delta31 < 0) {
		goto __525
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __526
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__526:
	;
__525:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta31
	goto __523
__523:
	if 0 != 0 {
		goto __522
	}
	goto __524
__524:
	;
__520:
	;
	goto __518
__518:
	if 0 != 0 {
		goto __517
	}
	goto __519
__519:
	;
	goto __513
__513:
	if 0 != 0 {
		goto __512
	}
	goto __514
__514:
	;
__527:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __530
	}
	XTclExpandCodeArray(tls, envPtr)
__530:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	goto __528
__528:
	if 0 != 0 {
		goto __527
	}
	goto __529
__529:
	;
__531:
	if !(-1 < 0) {
		goto __534
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __535
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__535:
	;
__534:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	goto __532
__532:
	if 0 != 0 {
		goto __531
	}
	goto __533
__533:
	;
	fwd = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(offsetFwd))
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(offsetFwd) + uintptr(1))) = uint8(uint32(fwd))
__346:
	;

__536:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __539
	}
	XTclExpandCodeArray(tls, envPtr)
__539:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_FOREACH_START)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __540
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_FOREACH_START == INST_START_CMD {
			return 1
		}
		return 0
	}()
__540:
	;
__541:
	_delta32 = XtclInstructionTable[INST_FOREACH_START].FstackEffect
	if !(_delta32 != 0) {
		goto __544
	}
	if !(_delta32 == -0x7fffffff-1) {
		goto __545
	}
	_delta32 = 1 - infoIndex
__545:
	;
__546:
	if !(_delta32 < 0) {
		goto __549
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __550
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__550:
	;
__549:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta32
	goto __547
__547:
	if 0 != 0 {
		goto __546
	}
	goto __548
__548:
	;
__544:
	;
	goto __542
__542:
	if 0 != 0 {
		goto __541
	}
	goto __543
__543:
	;
	goto __537
__537:
	if 0 != 0 {
		goto __536
	}
	goto __538
__538:
	;
	offsetBack = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	if !(keyVar <= 255) {
		goto __551
	}
__553:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __556
	}
	XTclExpandCodeArray(tls, envPtr)
__556:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __557
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__557:
	;
__558:
	_delta33 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
	if !(_delta33 != 0) {
		goto __561
	}
	if !(_delta33 == -0x7fffffff-1) {
		goto __562
	}
	_delta33 = 1 - keyVar
__562:
	;
__563:
	if !(_delta33 < 0) {
		goto __566
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __567
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__567:
	;
__566:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta33
	goto __564
__564:
	if 0 != 0 {
		goto __563
	}
	goto __565
__565:
	;
__561:
	;
	goto __559
__559:
	if 0 != 0 {
		goto __558
	}
	goto __560
__560:
	;
	goto __554
__554:
	if 0 != 0 {
		goto __553
	}
	goto __555
__555:
	;
	goto __552
__551:
__568:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __571
	}
	XTclExpandCodeArray(tls, envPtr)
__571:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __572
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__572:
	;
__573:
	_delta34 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
	if !(_delta34 != 0) {
		goto __576
	}
	if !(_delta34 == -0x7fffffff-1) {
		goto __577
	}
	_delta34 = 1 - keyVar
__577:
	;
__578:
	if !(_delta34 < 0) {
		goto __581
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __582
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__582:
	;
__581:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta34
	goto __579
__579:
	if 0 != 0 {
		goto __578
	}
	goto __580
__580:
	;
__576:
	;
	goto __574
__574:
	if 0 != 0 {
		goto __573
	}
	goto __575
__575:
	;
	goto __569
__569:
	if 0 != 0 {
		goto __568
	}
	goto __570
__570:
	;
__552:
	;

	if !(valVar <= 255) {
		goto __583
	}
__585:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __588
	}
	XTclExpandCodeArray(tls, envPtr)
__588:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(valVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __589
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__589:
	;
__590:
	_delta35 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
	if !(_delta35 != 0) {
		goto __593
	}
	if !(_delta35 == -0x7fffffff-1) {
		goto __594
	}
	_delta35 = 1 - valVar
__594:
	;
__595:
	if !(_delta35 < 0) {
		goto __598
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __599
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__599:
	;
__598:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta35
	goto __596
__596:
	if 0 != 0 {
		goto __595
	}
	goto __597
__597:
	;
__593:
	;
	goto __591
__591:
	if 0 != 0 {
		goto __590
	}
	goto __592
__592:
	;
	goto __586
__586:
	if 0 != 0 {
		goto __585
	}
	goto __587
__587:
	;
	goto __584
__583:
__600:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __603
	}
	XTclExpandCodeArray(tls, envPtr)
__603:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(valVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(valVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(valVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(valVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __604
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__604:
	;
__605:
	_delta36 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
	if !(_delta36 != 0) {
		goto __608
	}
	if !(_delta36 == -0x7fffffff-1) {
		goto __609
	}
	_delta36 = 1 - valVar
__609:
	;
__610:
	if !(_delta36 < 0) {
		goto __613
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __614
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__614:
	;
__613:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta36
	goto __611
__611:
	if 0 != 0 {
		goto __610
	}
	goto __612
__612:
	;
__608:
	;
	goto __606
__606:
	if 0 != 0 {
		goto __605
	}
	goto __607
__607:
	;
	goto __601
__601:
	if 0 != 0 {
		goto __600
	}
	goto __602
__602:
	;
__584:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 4)) <= 255) {
		goto __615
	}
__617:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __620
	}
	XTclExpandCodeArray(tls, envPtr)
__620:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_ARRAY1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __621
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_ARRAY1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__621:
	;
__622:
	_delta37 = XtclInstructionTable[INST_STORE_ARRAY1].FstackEffect
	if !(_delta37 != 0) {
		goto __625
	}
	if !(_delta37 == -0x7fffffff-1) {
		goto __626
	}
	_delta37 = 1 - *(*int32)(unsafe.Pointer(bp + 4))
__626:
	;
__627:
	if !(_delta37 < 0) {
		goto __630
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __631
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__631:
	;
__630:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta37
	goto __628
__628:
	if 0 != 0 {
		goto __627
	}
	goto __629
__629:
	;
__625:
	;
	goto __623
__623:
	if 0 != 0 {
		goto __622
	}
	goto __624
__624:
	;
	goto __618
__618:
	if 0 != 0 {
		goto __617
	}
	goto __619
__619:
	;
	goto __616
__615:
__632:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __635
	}
	XTclExpandCodeArray(tls, envPtr)
__635:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_ARRAY4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __636
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_ARRAY4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__636:
	;
__637:
	_delta38 = XtclInstructionTable[INST_STORE_ARRAY4].FstackEffect
	if !(_delta38 != 0) {
		goto __640
	}
	if !(_delta38 == -0x7fffffff-1) {
		goto __641
	}
	_delta38 = 1 - *(*int32)(unsafe.Pointer(bp + 4))
__641:
	;
__642:
	if !(_delta38 < 0) {
		goto __645
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __646
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__646:
	;
__645:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta38
	goto __643
__643:
	if 0 != 0 {
		goto __642
	}
	goto __644
__644:
	;
__640:
	;
	goto __638
__638:
	if 0 != 0 {
		goto __637
	}
	goto __639
__639:
	;
	goto __633
__633:
	if 0 != 0 {
		goto __632
	}
	goto __634
__634:
	;
__616:
	;

__647:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __650
	}
	XTclExpandCodeArray(tls, envPtr)
__650:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __651
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__651:
	;
__652:
	_delta39 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta39 != 0) {
		goto __655
	}
	if !(_delta39 == -0x7fffffff-1) {
		goto __656
	}
	_delta39 = 1 - 0
__656:
	;
__657:
	if !(_delta39 < 0) {
		goto __660
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __661
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__661:
	;
__660:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta39
	goto __658
__658:
	if 0 != 0 {
		goto __657
	}
	goto __659
__659:
	;
__655:
	;
	goto __653
__653:
	if 0 != 0 {
		goto __652
	}
	goto __654
__654:
	;
	goto __648
__648:
	if 0 != 0 {
		goto __647
	}
	goto __649
__649:
	;
	(*ForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp = int32(int64(offsetBack) - (int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1) //misuse
__662:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __665
	}
	XTclExpandCodeArray(tls, envPtr)
__665:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_FOREACH_STEP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __666
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_FOREACH_STEP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__666:
	;
__667:
	_delta40 = XtclInstructionTable[INST_FOREACH_STEP].FstackEffect
	if !(_delta40 != 0) {
		goto __670
	}
	if !(_delta40 == -0x7fffffff-1) {
		goto __671
	}
	_delta40 = 1 - 0
__671:
	;
__672:
	if !(_delta40 < 0) {
		goto __675
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __676
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__676:
	;
__675:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta40
	goto __673
__673:
	if 0 != 0 {
		goto __672
	}
	goto __674
__674:
	;
__670:
	;
	goto __668
__668:
	if 0 != 0 {
		goto __667
	}
	goto __669
__669:
	;
	goto __663
__663:
	if 0 != 0 {
		goto __662
	}
	goto __664
__664:
	;
__677:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __680
	}
	XTclExpandCodeArray(tls, envPtr)
__680:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_FOREACH_END)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __681
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_FOREACH_END == INST_START_CMD {
			return 1
		}
		return 0
	}()
__681:
	;
__682:
	_delta41 = XtclInstructionTable[INST_FOREACH_END].FstackEffect
	if !(_delta41 != 0) {
		goto __685
	}
	if !(_delta41 == -0x7fffffff-1) {
		goto __686
	}
	_delta41 = 1 - 0
__686:
	;
__687:
	if !(_delta41 < 0) {
		goto __690
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __691
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__691:
	;
__690:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta41
	goto __688
__688:
	if 0 != 0 {
		goto __687
	}
	goto __689
__689:
	;
__685:
	;
	goto __683
__683:
	if 0 != 0 {
		goto __682
	}
	goto __684
__684:
	;
	goto __678
__678:
	if 0 != 0 {
		goto __677
	}
	goto __679
__679:
	;
__692:
	if !(-3 < 0) {
		goto __695
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __696
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__696:
	;
__695:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += -3
	goto __693
__693:
	if 0 != 0 {
		goto __692
	}
	goto __694
__694:
	;
__697:
	_objIndexCopy6 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy6 <= 255) {
		goto __700
	}
__702:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __705
	}
	XTclExpandCodeArray(tls, envPtr)
__705:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __706
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__706:
	;
__707:
	_delta42 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta42 != 0) {
		goto __710
	}
	if !(_delta42 == -0x7fffffff-1) {
		goto __711
	}
	_delta42 = 1 - _objIndexCopy6
__711:
	;
__712:
	if !(_delta42 < 0) {
		goto __715
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __716
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__716:
	;
__715:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta42
	goto __713
__713:
	if 0 != 0 {
		goto __712
	}
	goto __714
__714:
	;
__710:
	;
	goto __708
__708:
	if 0 != 0 {
		goto __707
	}
	goto __709
__709:
	;
	goto __703
__703:
	if 0 != 0 {
		goto __702
	}
	goto __704
__704:
	;
	goto __701
__700:
__717:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __720
	}
	XTclExpandCodeArray(tls, envPtr)
__720:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __721
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__721:
	;
__722:
	_delta43 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta43 != 0) {
		goto __725
	}
	if !(_delta43 == -0x7fffffff-1) {
		goto __726
	}
	_delta43 = 1 - _objIndexCopy6
__726:
	;
__727:
	if !(_delta43 < 0) {
		goto __730
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __731
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__731:
	;
__730:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta43
	goto __728
__728:
	if 0 != 0 {
		goto __727
	}
	goto __729
__729:
	;
__725:
	;
	goto __723
__723:
	if 0 != 0 {
		goto __722
	}
	goto __724
__724:
	;
	goto __718
__718:
	if 0 != 0 {
		goto __717
	}
	goto __719
__719:
	;
__701:
	;
	goto __698
__698:
	if 0 != 0 {
		goto __697
	}
	goto __699
__699:
	;

done:
__732:
	_objPtr = literalObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __735
	}
	XTclFreeObj(tls, _objPtr)
__735:
	;
	goto __733
__733:
	if 0 != 0 {
		goto __732
	}
	goto __734
__734:
	;
	return code
}

func XTclCompileArrayUnsetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:464:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	// var isScalar int32 at bp+4, 4

	// var localIndex int32 at bp, 4

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclPushVarName(tls, interp, tokenPtr, envPtr, TCL_NO_ELEMENT, bp, bp+4)
	if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
		return TCL_ERROR
	}

	if *(*int32)(unsafe.Pointer(bp)) >= 0 {
		for ok := true; ok; ok = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ARRAY_EXISTS_IMM)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_ARRAY_EXISTS_IMM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_ARRAY_EXISTS_IMM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - *(*int32)(unsafe.Pointer(bp))
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok3 := true; ok3; ok3 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(8))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP_FALSE1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 8
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok6 := true; ok6; ok6 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_UNSET_SCALAR == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 1
					}
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok9 := true; ok9; ok9 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
		}
	} else {
		for ok10 := true; ok10; ok10 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DUP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DUP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok13 := true; ok13; ok13 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ARRAY_EXISTS_STK)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_ARRAY_EXISTS_STK == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok14 := true; ok14; ok14 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_ARRAY_EXISTS_STK].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok15 := true; ok15; ok15 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok16 := true; ok16; ok16 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(6))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP_FALSE1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok17 := true; ok17; ok17 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 6
					}
					for ok18 := true; ok18; ok18 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok19 := true; ok19; ok19 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_STK)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_UNSET_STK == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok20 := true; ok20; ok20 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_UNSET_STK].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 1
					}
					for ok21 := true; ok21; ok21 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok22 := true; ok22; ok22 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(3))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok23 := true; ok23; ok23 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 3
					}
					for ok24 := true; ok24; ok24 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		// Each branch decrements stack depth, but we only take one.
		for ok25 := true; ok25; ok25 = 0 != 0 {
			if 1 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
		}
		for ok26 := true; ok26; ok26 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok27 := true; ok27; ok27 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok28 := true; ok28; ok28 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	for ok29 := true; ok29; ok29 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok30 := true; ok30; ok30 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok31 := true; ok31; ok31 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok32 := true; ok32; ok32 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok33 := true; ok33; ok33 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok34 := true; ok34; ok34 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok35 := true; ok35; ok35 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileBreakCmd --
//
//	Procedure called to compile the "break" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "break" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileBreakCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:524:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var rangePtr uintptr
	// var auxPtr uintptr at bp, 8

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 1 {
		return TCL_ERROR
	}

	// Find the innermost exception range that contains this command.

	rangePtr = XTclGetInnermostExceptionRange(tls, envPtr, TCL_BREAK, bp)
	if rangePtr != 0 && (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype == LOOP_EXCEPTION_RANGE {
		// Found the target! No need for a nasty INST_BREAK here.

		XTclCleanupStackForBreakContinue(tls, envPtr, *(*uintptr)(unsafe.Pointer(bp /* auxPtr */)))
		XTclAddLoopBreakFixup(tls, envPtr, *(*uintptr)(unsafe.Pointer(bp /* auxPtr */)))
	} else {
		// Emit a real break.

		for ok := true; ok; ok = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BREAK)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_BREAK == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_BREAK].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	for ok3 := true; ok3; ok3 = 0 != 0 {
		if 1 < 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
			}
		}
		*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileCatchCmd --
//
//	Procedure called to compile the "catch" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "catch" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileCatchCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:582:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	// var jumpFixup JumpFixup at bp+40, 16

	var cmdTokenPtr uintptr
	var resultNameTokenPtr uintptr
	var optsNameTokenPtr uintptr
	var resultIndex int32
	var optsIndex int32
	var range1 int32
	var dropScript int32 = 0
	var depth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth

	// If syntax does not match what we expect for [catch], do not compile.
	// Let runtime checks determine if syntax has changed.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 2 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 4 {
		return TCL_ERROR
	}

	// If variables were specified and the catch command is at global level
	// (not in a procedure), don't compile it inline: the payoff is too small.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords >= 3 && !((*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr != 0 || (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr)).FvarFramePtr)).FlocalCachePtr != 0) {
		return TCL_ERROR
	}

	// Make sure the variable names, if any, have no substitutions and just
	// refer to local scalars.

	resultIndex = libc.AssignInt32(&optsIndex, -1)
	cmdTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords >= 3 {
		resultNameTokenPtr = cmdTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(cmdTokenPtr)).FnumComponents+1)*24
		resultIndex = XTclLocalScalarFromToken(tls, resultNameTokenPtr, envPtr)
		if resultIndex < 0 {
			return TCL_ERROR
		}

		if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 4 {
			optsNameTokenPtr = resultNameTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(resultNameTokenPtr)).FnumComponents+1)*24
			optsIndex = XTclLocalScalarFromToken(tls, optsNameTokenPtr, envPtr)
			if optsIndex < 0 {
				return TCL_ERROR
			}
		}
	}

	// We will compile the catch command. Declare the exception range that it
	// uses.
	//
	// If the body is a simple word, compile a BEGIN_CATCH instruction,
	// followed by the instructions to eval the body.
	// Otherwise, compile instructions to substitute the body text before
	// starting the catch, then BEGIN_CATCH, and then EVAL_STK to evaluate the
	// substituted body.
	// Care has to be taken to make sure that substitution happens outside the
	// catch range so that errors in the substitution are not caught.
	// [Bug 219184]
	// The reason for duplicating the script is that EVAL_STK would otherwise
	// begin by undeflowing the stack below the mark set by BEGIN_CATCH4.

	range1 = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
	if (*Tcl_Token)(unsafe.Pointer(cmdTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_BEGIN_CATCH4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - range1
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
		(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
				return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
			}
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
		}()
		(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileCmdWord(tls, interp, cmdTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(cmdTokenPtr)).FnumComponents, envPtr)
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, cmdTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(cmdTokenPtr)).FnumComponents, envPtr)

		for ok3 := true; ok3; ok3 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_BEGIN_CATCH4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - range1
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
		(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
				return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
			}
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
		}()
		(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
		for ok6 := true; ok6; ok6 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DUP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DUP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		XTclEmitInvoke(tls, envPtr, INST_EVAL_STK, 0)
		// drop the script
		dropScript = 1
		for ok9 := true; ok9; ok9 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_REVERSE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok10 := true; ok10; ok10 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 2
					}
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok12 := true; ok12; ok12 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok13 := true; ok13; ok13 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok14 := true; ok14; ok14 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))

	// Emit the "no errors" epilogue: push "0" (TCL_OK) as the catch result,
	// and jump around the "error case" code.

	for ok15 := true; ok15; ok15 = 0 != 0 {
		var _dd int32 = depth + 1
		if _dd != (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
			XTcl_Panic(tls, ts+18410, libc.VaList(bp, (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth, _dd))
		}
	}
	for ok16 := true; ok16; ok16 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+18333, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok17 := true; ok17; ok17 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok18 := true; ok18; ok18 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok19 := true; ok19; ok19 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok20 := true; ok20; ok20 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok21 := true; ok21; ok21 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok22 := true; ok22; ok22 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp+40)

	// Emit the "error case" epilogue. Push the interpreter result and the
	// return code.

	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = depth + dropScript

	if dropScript != 0 {
		for ok23 := true; ok23; ok23 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok24 := true; ok24; ok24 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok25 := true; ok25; ok25 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	// Stack at this point is empty
	for ok26 := true; ok26; ok26 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RESULT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok27 := true; ok27; ok27 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok28 := true; ok28; ok28 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok29 := true; ok29; ok29 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_CODE)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RETURN_CODE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok30 := true; ok30; ok30 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_CODE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok31 := true; ok31; ok31 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Stack at this point on both branches: result returnCode

	if XTclFixupForwardJump(tls, envPtr, bp+40, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+40)).FcodeOffset)), 127) != 0 {
		XTcl_Panic(tls, ts+18460,
			libc.VaList(bp+16, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+40)).FcodeOffset))))
	}

	// Push the return options if the caller wants them. This needs to happen
	// before INST_END_CATCH

	if optsIndex != -1 {
		for ok32 := true; ok32; ok32 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok33 := true; ok33; ok33 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok34 := true; ok34; ok34 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	// End the catch

	for ok35 := true; ok35; ok35 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_END_CATCH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok36 := true; ok36; ok36 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok37 := true; ok37; ok37 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Save the result and return options if the caller wants them. This needs
	// to happen after INST_END_CATCH (compile-3.6/7).

	if optsIndex != -1 {
		if optsIndex <= 255 {
			for ok38 := true; ok38; ok38 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optsIndex))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok39 := true; ok39; ok39 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - optsIndex
						}
						for ok40 := true; ok40; ok40 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok41 := true; ok41; ok41 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optsIndex) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optsIndex) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optsIndex) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optsIndex))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok42 := true; ok42; ok42 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - optsIndex
						}
						for ok43 := true; ok43; ok43 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

		for ok44 := true; ok44; ok44 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok45 := true; ok45; ok45 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok46 := true; ok46; ok46 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	// At this point, the top of the stack is inconveniently ordered:
	//		result returnCode
	// Reverse the stack to store the result.

	for ok47 := true; ok47; ok47 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_REVERSE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok48 := true; ok48; ok48 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 2
				}
				for ok49 := true; ok49; ok49 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	if resultIndex != -1 {
		if resultIndex <= 255 {
			for ok50 := true; ok50; ok50 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultIndex))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok51 := true; ok51; ok51 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - resultIndex
						}
						for ok52 := true; ok52; ok52 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok53 := true; ok53; ok53 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultIndex) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultIndex) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultIndex) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultIndex))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok54 := true; ok54; ok54 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - resultIndex
						}
						for ok55 := true; ok55; ok55 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

	}
	for ok56 := true; ok56; ok56 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok57 := true; ok57; ok57 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok58 := true; ok58; ok58 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	for ok59 := true; ok59; ok59 = 0 != 0 {
		var _dd int32 = depth + 1
		if _dd != (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
			XTcl_Panic(tls, ts+18410, libc.VaList(bp+24, (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth, _dd))
		}
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclCompileClockClicksCmd --
//
//	Procedure called to compile the "tcl::clock::clicks" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to run time.
//
// Side effects:
//	Instructions are added to envPtr to execute the "clock clicks"
//	command at runtime.
//
//----------------------------------------------------------------------

func XTclCompileClockClicksCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:765:1: */
	var tokenPtr uintptr

	switch (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords {
	case 1:
		// No args
		for ok := true; ok; ok = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_CLOCK_READ)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_CLOCK_READ == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_CLOCK_READ].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		break
	case 2:
		// -milliseconds or -microseconds
		tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD ||
			(*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize < 4 ||
			(*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize > 13 {
			return TCL_ERROR
		} else if !(libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, ts+11254,
			uint64((*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize)) != 0) {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_CLOCK_READ)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_CLOCK_READ == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok4 := true; ok4; ok4 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_CLOCK_READ].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 1
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			break
		} else if !(libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, ts+11240,
			uint64((*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize)) != 0) {
			for ok6 := true; ok6; ok6 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_CLOCK_READ)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_CLOCK_READ == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok7 := true; ok7; ok7 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_CLOCK_READ].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 2
						}
						for ok8 := true; ok8; ok8 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			break
		} else {
			return TCL_ERROR
		}
		fallthrough
	default:
		return TCL_ERROR
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclCompileClockReadingCmd --
//
//	Procedure called to compile the "tcl::clock::microseconds",
//	"tcl::clock::milliseconds" and "tcl::clock::seconds" commands.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to run time.
//
// Side effects:
//	Instructions are added to envPtr to execute the "clock clicks"
//	command at runtime.
//
// Client data is 1 for microseconds, 2 for milliseconds, 3 for seconds.
//----------------------------------------------------------------------

func XTclCompileClockReadingCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:829:1: */
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 1 {
		return TCL_ERROR
	}

	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_CLOCK_READ)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(int32((*Command)(unsafe.Pointer(cmdPtr)).FobjClientData)))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_CLOCK_READ == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_CLOCK_READ].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - int32((*Command)(unsafe.Pointer(cmdPtr)).FobjClientData)
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileConcatCmd --
//
//	Procedure called to compile the "concat" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "concat" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileConcatCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:865:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var objPtr uintptr
	var listObj uintptr
	var tokenPtr uintptr
	var i int32

	// TODO: Consider compiling expansion case.
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 1 {
		// [concat] without arguments just pushes an empty object.

		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		return TCL_OK
	}

	// Test if all arguments are compile-time known. If they are, we can
	// implement with a simple push.

	listObj = XTcl_NewObj(tls)
	i = 1
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	for ; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		objPtr = XTcl_NewObj(tls)
		if !(XTclWordKnownAtCompileTime(tls, tokenPtr, objPtr) != 0) {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objPtr uintptr = objPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _objPtr uintptr = listObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			listObj = uintptr(0)
			break
		}
		XTcl_ListObjAppendElement(tls, uintptr(0), listObj, objPtr)
	}
	if listObj != uintptr(0) {
		// var objs uintptr at bp+8, 8

		var bytes uintptr
		// var len int32 at bp, 4

		XTcl_ListObjGetElements(tls, uintptr(0), listObj, bp, bp+8)
		objPtr = XTcl_ConcatObj(tls, *(*int32)(unsafe.Pointer(bp /* len */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* objs */)))
		for ok9 := true; ok9; ok9 = 0 != 0 {
			var _objPtr uintptr = listObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		bytes = XTcl_GetStringFromObj(tls, objPtr, bp)
		for ok10 := true; ok10; ok10 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp)), 0)
			if _objIndexCopy <= 255 {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok14 := true; ok14; ok14 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok15 := true; ok15; ok15 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok16 := true; ok16; ok16 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		for ok17 := true; ok17; ok17 = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return TCL_OK
	}

	// General case: runtime concat.

	i = 1
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	for ; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok18 := true; ok18; ok18 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok19 := true; ok19; ok19 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok20 := true; ok20; ok20 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok21 := true; ok21; ok21 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok22 := true; ok22; ok22 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok23 := true; ok23; ok23 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok24 := true; ok24; ok24 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

	}

	for ok25 := true; ok25; ok25 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_CONCAT_STK)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i-1) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i-1) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i-1) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i - 1))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_CONCAT_STK == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok26 := true; ok26; ok26 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_CONCAT_STK].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - (i - 1)
				}
				for ok27 := true; ok27; ok27 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileContinueCmd --
//
//	Procedure called to compile the "continue" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "continue" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileContinueCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:952:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var rangePtr uintptr
	// var auxPtr uintptr at bp, 8

	// There should be no argument after the "continue".

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 1 {
		return TCL_ERROR
	}

	// See if we can find a valid continueOffset (i.e., not -1) in the
	// innermost containing exception range.

	rangePtr = XTclGetInnermostExceptionRange(tls, envPtr, TCL_CONTINUE, bp)
	if rangePtr != 0 && (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype == LOOP_EXCEPTION_RANGE {
		// Found the target! No need for a nasty INST_CONTINUE here.

		XTclCleanupStackForBreakContinue(tls, envPtr, *(*uintptr)(unsafe.Pointer(bp /* auxPtr */)))
		XTclAddLoopContinueFixup(tls, envPtr, *(*uintptr)(unsafe.Pointer(bp /* auxPtr */)))
	} else {
		// Emit a real continue.

		for ok := true; ok; ok = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_CONTINUE)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_CONTINUE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_CONTINUE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	for ok3 := true; ok3; ok3 = 0 != 0 {
		if 1 < 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
			}
		}
		*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileDict*Cmd --
//
//	Functions called to compile "dict" sucommands.
//
// Results:
//	All return TCL_OK for a successful compile, and TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "dict" subcommand at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileDictSetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1015:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var varTokenPtr uintptr
	var i int32
	var dictVarIndex int32

	// There must be at least one argument after the command.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 4 {
		return TCL_ERROR
	}

	// The dictionary variable must be a local scalar that is knowable at
	// compile time; anything else exceeds the complexity of the opcode. So
	// discover what the index is.

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	dictVarIndex = XTclLocalScalarFromToken(tls, varTokenPtr, envPtr)
	if dictVarIndex < 0 {
		return TCL_ERROR
	}

	// Remaining words (key path and value to set) can be handled normally.

	tokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	for i = 2; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}

	// Now emit the instruction to do the dict manipulation.

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_SET)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 3))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DICT_SET == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DICT_SET].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - ((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 3)
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok10 := true; ok10; ok10 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex))
	}
	for ok11 := true; ok11; ok11 = 0 != 0 {
		if -1 < 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
			}
		}
		*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	}
	return TCL_OK
}

func XTclCompileDictIncrCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1068:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var varTokenPtr uintptr
	var keyTokenPtr uintptr
	var dictVarIndex int32
	// var incrAmount int32 at bp, 4

	// There must be at least two arguments after the command.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 4 {
		return TCL_ERROR
	}
	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	keyTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24

	// Parse the increment amount, if present.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 4 {
		var word uintptr
		var numBytes int32
		var code int32
		var incrTokenPtr uintptr
		var intObj uintptr

		incrTokenPtr = keyTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(keyTokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(incrTokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
			return XTclCompileBasic2Or3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
		}
		word = (*Tcl_Token)(unsafe.Pointer(incrTokenPtr + 1*24)).Fstart
		numBytes = (*Tcl_Token)(unsafe.Pointer(incrTokenPtr + 1*24)).Fsize

		intObj = XTcl_NewStringObj(tls, word, numBytes)
		(*Tcl_Obj)(unsafe.Pointer(intObj)).FrefCount++
		code = func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(intObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(intObj + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(intObj + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp)) = int32(*(*int64)(unsafe.Pointer(intObj + 32)))
					return TCL_OK
				}()
			}
			return XTcl_GetIntFromObj(tls, uintptr(0), intObj, bp)
		}()
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(intObj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(intObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(intObj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(intObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(intObj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(intObj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(intObj)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, intObj)
					} else {
						*(*uintptr)(unsafe.Pointer(intObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = intObj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, intObj)
			}
		}

		if code != TCL_OK {
			return XTclCompileBasic2Or3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
		}
	} else {
		*(*int32)(unsafe.Pointer(bp /* incrAmount */)) = 1
	}

	// The dictionary variable must be a local scalar that is knowable at
	// compile time; anything else exceeds the complexity of the opcode. So
	// discover what the index is.

	dictVarIndex = XTclLocalScalarFromToken(tls, varTokenPtr, envPtr)
	if dictVarIndex < 0 {
		return XTclCompileBasic2Or3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	// Emit the key and the code to actually do the increment.

	if (*Tcl_Token)(unsafe.Pointer(keyTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(keyTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(keyTokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok3 := true; ok3; ok3 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok4 := true; ok4; ok4 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok5 := true; ok5; ok5 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok6 := true; ok6; ok6 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok7 := true; ok7; ok7 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
		XTclCompileTokens(tls, interp, keyTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(keyTokenPtr)).FnumComponents, envPtr)
	}

	for ok8 := true; ok8; ok8 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_INCR_IMM)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DICT_INCR_IMM == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok9 := true; ok9; ok9 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DICT_INCR_IMM].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - *(*int32)(unsafe.Pointer(bp))
				}
				for ok10 := true; ok10; ok10 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok11 := true; ok11; ok11 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex))
	}
	return TCL_OK
}

func XTclCompileDictGetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1140:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var i int32

	// There must be at least two arguments after the command (the single-arg
	// case is legal, but too special and magic for us to deal with here).

	// TODO: Consider support for compiling expanded args.
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 {
		return TCL_ERROR
	}
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	// Only compile this because we need INST_DICT_GET anyway.

	for i = 1; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}
	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_GET)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 2))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DICT_GET == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DICT_GET].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - ((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 2)
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok10 := true; ok10; ok10 = 0 != 0 {
		if -1 < 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
			}
		}
		*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	}
	return TCL_OK
}

func XTclCompileDictExistsCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1177:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var i int32

	// There must be at least two arguments after the command (the single-arg
	// case is legal, but too special and magic for us to deal with here).

	// TODO: Consider support for compiling expanded args.
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 {
		return TCL_ERROR
	}
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	// Now we do the code generation.

	for i = 1; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}
	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_EXISTS)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 2))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DICT_EXISTS == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DICT_EXISTS].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - ((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 2)
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok10 := true; ok10; ok10 = 0 != 0 {
		if -1 < 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
			}
		}
		*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	}
	return TCL_OK
}

func XTclCompileDictUnsetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1214:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var i int32
	var dictVarIndex int32

	// There must be at least one argument after the variable name for us to
	// compile to bytecode.

	// TODO: Consider support for compiling expanded args.
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 {
		return TCL_ERROR
	}

	// The dictionary variable must be a local scalar that is knowable at
	// compile time; anything else exceeds the complexity of the opcode. So
	// discover what the index is.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	dictVarIndex = XTclLocalScalarFromToken(tls, tokenPtr, envPtr)
	if dictVarIndex < 0 {
		return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	// Remaining words (the key path) can be handled normally.

	for i = 2; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

	}

	// Now emit the instruction to do the dict manipulation.

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_UNSET)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 2))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DICT_UNSET == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DICT_UNSET].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - ((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 2)
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok10 := true; ok10; ok10 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex))
	}
	return TCL_OK
}

func XTclCompileDictCreateCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1267:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var worker int32   // Temp var for building the value in.
	var tokenPtr uintptr
	var keyObj uintptr
	var valueObj uintptr
	var dictObj uintptr
	var bytes uintptr
	var i int32
	// var len int32 at bp, 4

	var _objPtr uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var _objPtr3 uintptr
	var _objPtr4 uintptr
	var _objPtr5 uintptr
	var _objPtr6 uintptr
	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _objPtr7 uintptr
	var _delta4 int32
	var _delta5 int32
	var _objIndexCopy1 int32
	var _delta6 int32
	var _delta7 int32
	var _delta8 int32
	var _delta9 int32
	var _delta10 int32
	var _objIndexCopy2 int32
	var _delta11 int32
	var _delta12 int32
	var _objIndexCopy3 int32
	var _delta13 int32
	var _delta14 int32
	var _delta15 int32
	var _delta16 int32
	var _delta17 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords&1 == 0) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	// See if we can build the value at compile time...

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	dictObj = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(dictObj)).FrefCount++
	i = 1
__2:
	if !(i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) {
		goto __4
	}
	keyObj = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(keyObj)).FrefCount++
	if !!(XTclWordKnownAtCompileTime(tls, tokenPtr, keyObj) != 0) {
		goto __5
	}
__6:
	_objPtr = keyObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __9
	}
	XTclFreeObj(tls, _objPtr)
__9:
	;
	goto __7
__7:
	if 0 != 0 {
		goto __6
	}
	goto __8
__8:
	;
__10:
	_objPtr1 = dictObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __13
	}
	XTclFreeObj(tls, _objPtr1)
__13:
	;
	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
	goto nonConstant
__5:
	;
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	valueObj = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(valueObj)).FrefCount++
	if !!(XTclWordKnownAtCompileTime(tls, tokenPtr, valueObj) != 0) {
		goto __14
	}
__15:
	_objPtr2 = keyObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __18
	}
	XTclFreeObj(tls, _objPtr2)
__18:
	;
	goto __16
__16:
	if 0 != 0 {
		goto __15
	}
	goto __17
__17:
	;
__19:
	_objPtr3 = valueObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __22
	}
	XTclFreeObj(tls, _objPtr3)
__22:
	;
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
__23:
	_objPtr4 = dictObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __26
	}
	XTclFreeObj(tls, _objPtr4)
__26:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
	goto nonConstant
__14:
	;
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	XTcl_DictObjPut(tls, uintptr(0), dictObj, keyObj, valueObj)
__27:
	_objPtr5 = keyObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __30
	}
	XTclFreeObj(tls, _objPtr5)
__30:
	;
	goto __28
__28:
	if 0 != 0 {
		goto __27
	}
	goto __29
__29:
	;
__31:
	_objPtr6 = valueObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr6)).FrefCount, 1) <= 1) {
		goto __34
	}
	XTclFreeObj(tls, _objPtr6)
__34:
	;
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
	goto __3
__3:
	i = i + 2
	goto __2
	goto __4
__4:
	;

	// We did! Excellent. The "verifyDict" is to do type forcing.

	bytes = XTcl_GetStringFromObj(tls, dictObj, bp)
__35:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp)), 0)
	if !(_objIndexCopy <= 255) {
		goto __38
	}
__40:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __43
	}
	XTclExpandCodeArray(tls, envPtr)
__43:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __44
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__44:
	;
__45:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __48
	}
	if !(_delta == -0x7fffffff-1) {
		goto __49
	}
	_delta = 1 - _objIndexCopy
__49:
	;
__50:
	if !(_delta < 0) {
		goto __53
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __54
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__54:
	;
__53:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __51
__51:
	if 0 != 0 {
		goto __50
	}
	goto __52
__52:
	;
__48:
	;
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
	goto __41
__41:
	if 0 != 0 {
		goto __40
	}
	goto __42
__42:
	;
	goto __39
__38:
__55:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __58
	}
	XTclExpandCodeArray(tls, envPtr)
__58:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __59
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__59:
	;
__60:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __63
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __64
	}
	_delta1 = 1 - _objIndexCopy
__64:
	;
__65:
	if !(_delta1 < 0) {
		goto __68
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __69
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__69:
	;
__68:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __66
__66:
	if 0 != 0 {
		goto __65
	}
	goto __67
__67:
	;
__63:
	;
	goto __61
__61:
	if 0 != 0 {
		goto __60
	}
	goto __62
__62:
	;
	goto __56
__56:
	if 0 != 0 {
		goto __55
	}
	goto __57
__57:
	;
__39:
	;
	goto __36
__36:
	if 0 != 0 {
		goto __35
	}
	goto __37
__37:
	;
__70:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __73
	}
	XTclExpandCodeArray(tls, envPtr)
__73:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __74
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__74:
	;
__75:
	_delta2 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta2 != 0) {
		goto __78
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __79
	}
	_delta2 = 1 - 0
__79:
	;
__80:
	if !(_delta2 < 0) {
		goto __83
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __84
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__84:
	;
__83:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __81
__81:
	if 0 != 0 {
		goto __80
	}
	goto __82
__82:
	;
__78:
	;
	goto __76
__76:
	if 0 != 0 {
		goto __75
	}
	goto __77
__77:
	;
	goto __71
__71:
	if 0 != 0 {
		goto __70
	}
	goto __72
__72:
	;
__85:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __88
	}
	XTclExpandCodeArray(tls, envPtr)
__88:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_VERIFY)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __89
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DICT_VERIFY == INST_START_CMD {
			return 1
		}
		return 0
	}()
__89:
	;
__90:
	_delta3 = XtclInstructionTable[INST_DICT_VERIFY].FstackEffect
	if !(_delta3 != 0) {
		goto __93
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __94
	}
	_delta3 = 1 - 0
__94:
	;
__95:
	if !(_delta3 < 0) {
		goto __98
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __99
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__99:
	;
__98:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __96
__96:
	if 0 != 0 {
		goto __95
	}
	goto __97
__97:
	;
__93:
	;
	goto __91
__91:
	if 0 != 0 {
		goto __90
	}
	goto __92
__92:
	;
	goto __86
__86:
	if 0 != 0 {
		goto __85
	}
	goto __87
__87:
	;
__100:
	_objPtr7 = dictObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr7)).FrefCount, 1) <= 1) {
		goto __103
	}
	XTclFreeObj(tls, _objPtr7)
__103:
	;
	goto __101
__101:
	if 0 != 0 {
		goto __100
	}
	goto __102
__102:
	;
	return TCL_OK

	// Otherwise, we've got to issue runtime code to do the building, which we
	// do by [dict set]ting into an unnamed local variable. This requires that
	// we are in a context with an LVT.

nonConstant:
	worker = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
	if !(worker < 0) {
		goto __104
	}
	return XTclCompileBasicMin0ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
__104:
	;

__105:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy1 <= 255) {
		goto __108
	}
__110:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __113
	}
	XTclExpandCodeArray(tls, envPtr)
__113:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __114
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__114:
	;
__115:
	_delta4 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta4 != 0) {
		goto __118
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __119
	}
	_delta4 = 1 - _objIndexCopy1
__119:
	;
__120:
	if !(_delta4 < 0) {
		goto __123
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __124
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__124:
	;
__123:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __121
__121:
	if 0 != 0 {
		goto __120
	}
	goto __122
__122:
	;
__118:
	;
	goto __116
__116:
	if 0 != 0 {
		goto __115
	}
	goto __117
__117:
	;
	goto __111
__111:
	if 0 != 0 {
		goto __110
	}
	goto __112
__112:
	;
	goto __109
__108:
__125:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __128
	}
	XTclExpandCodeArray(tls, envPtr)
__128:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __129
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__129:
	;
__130:
	_delta5 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta5 != 0) {
		goto __133
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __134
	}
	_delta5 = 1 - _objIndexCopy1
__134:
	;
__135:
	if !(_delta5 < 0) {
		goto __138
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __139
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__139:
	;
__138:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __136
__136:
	if 0 != 0 {
		goto __135
	}
	goto __137
__137:
	;
__133:
	;
	goto __131
__131:
	if 0 != 0 {
		goto __130
	}
	goto __132
__132:
	;
	goto __126
__126:
	if 0 != 0 {
		goto __125
	}
	goto __127
__127:
	;
__109:
	;
	goto __106
__106:
	if 0 != 0 {
		goto __105
	}
	goto __107
__107:
	;
	if !(worker <= 255) {
		goto __140
	}
__142:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __145
	}
	XTclExpandCodeArray(tls, envPtr)
__145:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __146
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__146:
	;
__147:
	_delta6 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta6 != 0) {
		goto __150
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __151
	}
	_delta6 = 1 - worker
__151:
	;
__152:
	if !(_delta6 < 0) {
		goto __155
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __156
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__156:
	;
__155:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __153
__153:
	if 0 != 0 {
		goto __152
	}
	goto __154
__154:
	;
__150:
	;
	goto __148
__148:
	if 0 != 0 {
		goto __147
	}
	goto __149
__149:
	;
	goto __143
__143:
	if 0 != 0 {
		goto __142
	}
	goto __144
__144:
	;
	goto __141
__140:
__157:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __160
	}
	XTclExpandCodeArray(tls, envPtr)
__160:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __161
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__161:
	;
__162:
	_delta7 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta7 != 0) {
		goto __165
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __166
	}
	_delta7 = 1 - worker
__166:
	;
__167:
	if !(_delta7 < 0) {
		goto __170
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __171
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__171:
	;
__170:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __168
__168:
	if 0 != 0 {
		goto __167
	}
	goto __169
__169:
	;
__165:
	;
	goto __163
__163:
	if 0 != 0 {
		goto __162
	}
	goto __164
__164:
	;
	goto __158
__158:
	if 0 != 0 {
		goto __157
	}
	goto __159
__159:
	;
__141:
	;

__172:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __175
	}
	XTclExpandCodeArray(tls, envPtr)
__175:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __176
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__176:
	;
__177:
	_delta8 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta8 != 0) {
		goto __180
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __181
	}
	_delta8 = 1 - 0
__181:
	;
__182:
	if !(_delta8 < 0) {
		goto __185
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __186
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__186:
	;
__185:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __183
__183:
	if 0 != 0 {
		goto __182
	}
	goto __184
__184:
	;
__180:
	;
	goto __178
__178:
	if 0 != 0 {
		goto __177
	}
	goto __179
__179:
	;
	goto __173
__173:
	if 0 != 0 {
		goto __172
	}
	goto __174
__174:
	;
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	i = 1
__187:
	if !(i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) {
		goto __189
	}
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __190
	}
__192:
	_objIndexCopy2 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy2 <= 255) {
		goto __195
	}
__197:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __200
	}
	XTclExpandCodeArray(tls, envPtr)
__200:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __201
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__201:
	;
__202:
	_delta9 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta9 != 0) {
		goto __205
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __206
	}
	_delta9 = 1 - _objIndexCopy2
__206:
	;
__207:
	if !(_delta9 < 0) {
		goto __210
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __211
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__211:
	;
__210:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __208
__208:
	if 0 != 0 {
		goto __207
	}
	goto __209
__209:
	;
__205:
	;
	goto __203
__203:
	if 0 != 0 {
		goto __202
	}
	goto __204
__204:
	;
	goto __198
__198:
	if 0 != 0 {
		goto __197
	}
	goto __199
__199:
	;
	goto __196
__195:
__212:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __215
	}
	XTclExpandCodeArray(tls, envPtr)
__215:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __216
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__216:
	;
__217:
	_delta10 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta10 != 0) {
		goto __220
	}
	if !(_delta10 == -0x7fffffff-1) {
		goto __221
	}
	_delta10 = 1 - _objIndexCopy2
__221:
	;
__222:
	if !(_delta10 < 0) {
		goto __225
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __226
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__226:
	;
__225:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta10
	goto __223
__223:
	if 0 != 0 {
		goto __222
	}
	goto __224
__224:
	;
__220:
	;
	goto __218
__218:
	if 0 != 0 {
		goto __217
	}
	goto __219
__219:
	;
	goto __213
__213:
	if 0 != 0 {
		goto __212
	}
	goto __214
__214:
	;
__196:
	;
	goto __193
__193:
	if 0 != 0 {
		goto __192
	}
	goto __194
__194:
	;
	goto __191
__190:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__191:
	;

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __227
	}
__229:
	_objIndexCopy3 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy3 <= 255) {
		goto __232
	}
__234:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __237
	}
	XTclExpandCodeArray(tls, envPtr)
__237:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __238
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__238:
	;
__239:
	_delta11 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta11 != 0) {
		goto __242
	}
	if !(_delta11 == -0x7fffffff-1) {
		goto __243
	}
	_delta11 = 1 - _objIndexCopy3
__243:
	;
__244:
	if !(_delta11 < 0) {
		goto __247
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __248
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__248:
	;
__247:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta11
	goto __245
__245:
	if 0 != 0 {
		goto __244
	}
	goto __246
__246:
	;
__242:
	;
	goto __240
__240:
	if 0 != 0 {
		goto __239
	}
	goto __241
__241:
	;
	goto __235
__235:
	if 0 != 0 {
		goto __234
	}
	goto __236
__236:
	;
	goto __233
__232:
__249:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __252
	}
	XTclExpandCodeArray(tls, envPtr)
__252:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __253
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__253:
	;
__254:
	_delta12 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta12 != 0) {
		goto __257
	}
	if !(_delta12 == -0x7fffffff-1) {
		goto __258
	}
	_delta12 = 1 - _objIndexCopy3
__258:
	;
__259:
	if !(_delta12 < 0) {
		goto __262
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __263
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__263:
	;
__262:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta12
	goto __260
__260:
	if 0 != 0 {
		goto __259
	}
	goto __261
__261:
	;
__257:
	;
	goto __255
__255:
	if 0 != 0 {
		goto __254
	}
	goto __256
__256:
	;
	goto __250
__250:
	if 0 != 0 {
		goto __249
	}
	goto __251
__251:
	;
__233:
	;
	goto __230
__230:
	if 0 != 0 {
		goto __229
	}
	goto __231
__231:
	;
	goto __228
__227:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i+1)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i+1)*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__228:
	;

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
__264:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __267
	}
	XTclExpandCodeArray(tls, envPtr)
__267:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_SET)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __268
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DICT_SET == INST_START_CMD {
			return 1
		}
		return 0
	}()
__268:
	;
__269:
	_delta13 = XtclInstructionTable[INST_DICT_SET].FstackEffect
	if !(_delta13 != 0) {
		goto __272
	}
	if !(_delta13 == -0x7fffffff-1) {
		goto __273
	}
	_delta13 = 1 - 1
__273:
	;
__274:
	if !(_delta13 < 0) {
		goto __277
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __278
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__278:
	;
__277:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta13
	goto __275
__275:
	if 0 != 0 {
		goto __274
	}
	goto __276
__276:
	;
__272:
	;
	goto __270
__270:
	if 0 != 0 {
		goto __269
	}
	goto __271
__271:
	;
	goto __265
__265:
	if 0 != 0 {
		goto __264
	}
	goto __266
__266:
	;
__279:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __282
	}
	XTclExpandCodeArray(tls, envPtr)
__282:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker))
	goto __280
__280:
	if 0 != 0 {
		goto __279
	}
	goto __281
__281:
	;
__283:
	if !(-1 < 0) {
		goto __286
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __287
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__287:
	;
__286:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	goto __284
__284:
	if 0 != 0 {
		goto __283
	}
	goto __285
__285:
	;
__288:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __291
	}
	XTclExpandCodeArray(tls, envPtr)
__291:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __292
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__292:
	;
__293:
	_delta14 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta14 != 0) {
		goto __296
	}
	if !(_delta14 == -0x7fffffff-1) {
		goto __297
	}
	_delta14 = 1 - 0
__297:
	;
__298:
	if !(_delta14 < 0) {
		goto __301
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __302
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__302:
	;
__301:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta14
	goto __299
__299:
	if 0 != 0 {
		goto __298
	}
	goto __300
__300:
	;
__296:
	;
	goto __294
__294:
	if 0 != 0 {
		goto __293
	}
	goto __295
__295:
	;
	goto __289
__289:
	if 0 != 0 {
		goto __288
	}
	goto __290
__290:
	;
	goto __188
__188:
	i = i + 2
	goto __187
	goto __189
__189:
	;
	if !(worker <= 255) {
		goto __303
	}
__305:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __308
	}
	XTclExpandCodeArray(tls, envPtr)
__308:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __309
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__309:
	;
__310:
	_delta15 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
	if !(_delta15 != 0) {
		goto __313
	}
	if !(_delta15 == -0x7fffffff-1) {
		goto __314
	}
	_delta15 = 1 - worker
__314:
	;
__315:
	if !(_delta15 < 0) {
		goto __318
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __319
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__319:
	;
__318:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta15
	goto __316
__316:
	if 0 != 0 {
		goto __315
	}
	goto __317
__317:
	;
__313:
	;
	goto __311
__311:
	if 0 != 0 {
		goto __310
	}
	goto __312
__312:
	;
	goto __306
__306:
	if 0 != 0 {
		goto __305
	}
	goto __307
__307:
	;
	goto __304
__303:
__320:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __323
	}
	XTclExpandCodeArray(tls, envPtr)
__323:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __324
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__324:
	;
__325:
	_delta16 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
	if !(_delta16 != 0) {
		goto __328
	}
	if !(_delta16 == -0x7fffffff-1) {
		goto __329
	}
	_delta16 = 1 - worker
__329:
	;
__330:
	if !(_delta16 < 0) {
		goto __333
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __334
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__334:
	;
__333:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta16
	goto __331
__331:
	if 0 != 0 {
		goto __330
	}
	goto __332
__332:
	;
__328:
	;
	goto __326
__326:
	if 0 != 0 {
		goto __325
	}
	goto __327
__327:
	;
	goto __321
__321:
	if 0 != 0 {
		goto __320
	}
	goto __322
__322:
	;
__304:
	;

__335:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __338
	}
	XTclExpandCodeArray(tls, envPtr)
__338:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __339
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_UNSET_SCALAR == INST_START_CMD {
			return 1
		}
		return 0
	}()
__339:
	;
__340:
	_delta17 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
	if !(_delta17 != 0) {
		goto __343
	}
	if !(_delta17 == -0x7fffffff-1) {
		goto __344
	}
	_delta17 = 1 - 0
__344:
	;
__345:
	if !(_delta17 < 0) {
		goto __348
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __349
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__349:
	;
__348:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta17
	goto __346
__346:
	if 0 != 0 {
		goto __345
	}
	goto __347
__347:
	;
__343:
	;
	goto __341
__341:
	if 0 != 0 {
		goto __340
	}
	goto __342
__342:
	;
	goto __336
__336:
	if 0 != 0 {
		goto __335
	}
	goto __337
__337:
	;
__350:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __353
	}
	XTclExpandCodeArray(tls, envPtr)
__353:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(worker))
	goto __351
__351:
	if 0 != 0 {
		goto __350
	}
	goto __352
__352:
	;
	return TCL_OK
}

func XTclCompileDictMergeCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1360:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var i int32
	var workerIndex int32
	var infoIndex int32
	var outLoop int32

	// Deal with some special edge cases. Note that in the case with one
	// argument, the only thing to do is to verify the dict-ness.

	// TODO: Consider support for compiling expanded args. (less likely)
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 2 {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		return TCL_OK
	} else if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 2 {
		tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		for ok14 := true; ok14; ok14 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DUP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok15 := true; ok15; ok15 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DUP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok17 := true; ok17; ok17 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_VERIFY)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DICT_VERIFY == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok18 := true; ok18; ok18 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DICT_VERIFY].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		return TCL_OK
	}

	// There's real merging work to do.
	//
	// Allocate some working space. This means we'll only ever compile this
	// command when there's an LVT present.

	workerIndex = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
	if workerIndex < 0 {
		return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}
	infoIndex = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)

	// Get the first dictionary and verify that it is so.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok20 := true; ok20; ok20 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok21 := true; ok21; ok21 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok22 := true; ok22; ok22 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok23 := true; ok23; ok23 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok24 := true; ok24; ok24 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok25 := true; ok25; ok25 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok26 := true; ok26; ok26 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok27 := true; ok27; ok27 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DUP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok28 := true; ok28; ok28 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DUP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok29 := true; ok29; ok29 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok30 := true; ok30; ok30 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_VERIFY)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DICT_VERIFY == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok31 := true; ok31; ok31 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DICT_VERIFY].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok32 := true; ok32; ok32 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	if workerIndex <= 255 {
		for ok33 := true; ok33; ok33 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok34 := true; ok34; ok34 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - workerIndex
					}
					for ok35 := true; ok35; ok35 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok36 := true; ok36; ok36 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok37 := true; ok37; ok37 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - workerIndex
					}
					for ok38 := true; ok38; ok38 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	for ok39 := true; ok39; ok39 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok40 := true; ok40; ok40 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok41 := true; ok41; ok41 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// For each of the remaining dictionaries...

	outLoop = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
	for ok42 := true; ok42; ok42 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(outLoop) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(outLoop) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(outLoop) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(outLoop))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_BEGIN_CATCH4 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok43 := true; ok43; ok43 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - outLoop
				}
				for ok44 := true; ok44; ok44 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(outLoop)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for i = 2; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		// Get the dictionary, and merge its pairs into the first dict (using
		// a small loop).

		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok45 := true; ok45; ok45 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok46 := true; ok46; ok46 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok47 := true; ok47; ok47 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok48 := true; ok48; ok48 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok49 := true; ok49; ok49 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok50 := true; ok50; ok50 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok51 := true; ok51; ok51 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		for ok52 := true; ok52; ok52 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_FIRST)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DICT_FIRST == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok53 := true; ok53; ok53 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DICT_FIRST].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - infoIndex
					}
					for ok54 := true; ok54; ok54 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok55 := true; ok55; ok55 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(24))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP_TRUE1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok56 := true; ok56; ok56 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 24
					}
					for ok57 := true; ok57; ok57 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok58 := true; ok58; ok58 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_REVERSE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok59 := true; ok59; ok59 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 2
					}
					for ok60 := true; ok60; ok60 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok61 := true; ok61; ok61 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_SET)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DICT_SET == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok62 := true; ok62; ok62 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DICT_SET].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 1
					}
					for ok63 := true; ok63; ok63 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok64 := true; ok64; ok64 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex))
		}
		for ok65 := true; ok65; ok65 = 0 != 0 {
			if -1 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
		}
		for ok66 := true; ok66; ok66 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok67 := true; ok67; ok67 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok68 := true; ok68; ok68 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok69 := true; ok69; ok69 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_NEXT)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DICT_NEXT == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok70 := true; ok70; ok70 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DICT_NEXT].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - infoIndex
					}
					for ok71 := true; ok71; ok71 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok72 := true; ok72; ok72 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(libc.Uint32FromInt32(-20))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP_FALSE1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok73 := true; ok73; ok73 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - -20
					}
					for ok74 := true; ok74; ok74 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok75 := true; ok75; ok75 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok76 := true; ok76; ok76 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok77 := true; ok77; ok77 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok78 := true; ok78; ok78 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok79 := true; ok79; ok79 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok80 := true; ok80; ok80 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok81 := true; ok81; ok81 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_UNSET_SCALAR == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok82 := true; ok82; ok82 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok83 := true; ok83; ok83 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok84 := true; ok84; ok84 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
		}
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(outLoop)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(outLoop)*28)).FcodeOffset))
	for ok85 := true; ok85; ok85 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_END_CATCH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok86 := true; ok86; ok86 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok87 := true; ok87; ok87 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Clean up any state left over.

	if workerIndex <= 255 {
		for ok88 := true; ok88; ok88 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LOAD_SCALAR1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok89 := true; ok89; ok89 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - workerIndex
					}
					for ok90 := true; ok90; ok90 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok91 := true; ok91; ok91 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LOAD_SCALAR4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok92 := true; ok92; ok92 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - workerIndex
					}
					for ok93 := true; ok93; ok93 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	for ok94 := true; ok94; ok94 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_UNSET_SCALAR == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok95 := true; ok95; ok95 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok96 := true; ok96; ok96 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok97 := true; ok97; ok97 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex))
	}
	for ok98 := true; ok98; ok98 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(18))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP1 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok99 := true; ok99; ok99 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP1].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 18
				}
				for ok100 := true; ok100; ok100 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// If an exception happens when starting to iterate over the second (and
	// subsequent) dicts. This is strictly not necessary, but it is nice.

	for ok101 := true; ok101; ok101 = 0 != 0 {
		if -1 < 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
			}
		}
		*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	}
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(outLoop)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok102 := true; ok102; ok102 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok103 := true; ok103; ok103 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok104 := true; ok104; ok104 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok105 := true; ok105; ok105 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RESULT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok106 := true; ok106; ok106 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok107 := true; ok107; ok107 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok108 := true; ok108; ok108 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_END_CATCH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok109 := true; ok109; ok109 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok110 := true; ok110; ok110 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok111 := true; ok111; ok111 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_UNSET_SCALAR == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok112 := true; ok112; ok112 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok113 := true; ok113; ok113 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok114 := true; ok114; ok114 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(workerIndex))
	}
	for ok115 := true; ok115; ok115 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_UNSET_SCALAR == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok116 := true; ok116; ok116 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok117 := true; ok117; ok117 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok118 := true; ok118; ok118 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
	}
	for ok119 := true; ok119; ok119 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_RETURN_STK)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_RETURN_STK == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok120 := true; ok120; ok120 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_RETURN_STK].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok121 := true; ok121; ok121 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	return TCL_OK
}

func XTclCompileDictForCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1474:1: */
	return XCompileDictEachCmd(tls, interp, parsePtr, cmdPtr, envPtr,
		TCL_EACH_KEEP_NONE)
}

func XTclCompileDictMapCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1487:1: */
	return XCompileDictEachCmd(tls, interp, parsePtr, cmdPtr, envPtr,
		TCL_EACH_COLLECT)
}

func XCompileDictEachCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr, collect int32) int32 { /* tclCompCmds.c:1500:1: */
	bp := tls.Alloc(232)
	defer tls.Free(232)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var varsTokenPtr uintptr
	var dictTokenPtr uintptr
	var bodyTokenPtr uintptr
	var keyVarIndex int32
	var valueVarIndex int32
	var nameChars int32
	var loopRange int32
	var catchRange int32
	var infoIndex int32
	var jumpDisplacement int32
	var bodyTargetOffset int32
	var emptyTargetOffset int32
	// var numVars int32 at bp+216, 4

	var endTargetOffset int32
	var collectVar int32 = -1 // Index of temp var holding the result
	// dict.
	// var argv uintptr at bp+224, 8

	// var buffer Tcl_DString at bp, 216

	// There must be three arguments after the command.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 4 {
		return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	varsTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	dictTokenPtr = varsTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varsTokenPtr)).FnumComponents+1)*24
	bodyTokenPtr = dictTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(dictTokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(varsTokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD || (*Tcl_Token)(unsafe.Pointer(bodyTokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
		return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	// Create temporary variable to capture return values from loop body when
	// we're collecting results.

	if collect == TCL_EACH_COLLECT {
		collectVar = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
		if collectVar < 0 {
			return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
		}
	}

	// Check we've got a pair of variables and that they are local variables.
	// Then extract their indices in the LVT.

	XTcl_DStringInit(tls, bp)
	XTcl_DStringAppend(tls, bp, (*Tcl_Token)(unsafe.Pointer(varsTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(varsTokenPtr+1*24)).Fsize)
	if XTcl_SplitList(tls, uintptr(0), (*Tcl_DString)(unsafe.Pointer(bp)).Fstring, bp+216,
		bp+224) != TCL_OK {
		XTcl_DStringFree(tls, bp)
		return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}
	XTcl_DStringFree(tls, bp)
	if *(*int32)(unsafe.Pointer(bp + 216)) != 2 {
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 224)))
		return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	nameChars = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* argv */))))))
	keyVarIndex = XTclLocalScalar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* argv */)))), nameChars, envPtr)
	nameChars = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* argv */)) + 1*8))))
	valueVarIndex = XTclLocalScalar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* argv */)) + 1*8)), nameChars, envPtr)
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 224)))

	if keyVarIndex < 0 || valueVarIndex < 0 {
		return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	// Allocate a temporary variable to store the iterator reference. The
	// variable will contain a Tcl_DictSearch reference which will be
	// allocated by INST_DICT_FIRST and disposed when the variable is unset
	// (at which point it should also have been finished with).

	infoIndex = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
	if infoIndex < 0 {
		return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	// Preparation complete; issue instructions. Note that this code issues
	// fixed-sized jumps. That simplifies things a lot!
	//
	// First up, initialize the accumulator dictionary if needed.

	if collect == TCL_EACH_COLLECT {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		if collectVar <= 255 {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok8 := true; ok8; ok8 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - collectVar
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok10 := true; ok10; ok10 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok11 := true; ok11; ok11 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - collectVar
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

		for ok13 := true; ok13; ok13 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok14 := true; ok14; ok14 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok15 := true; ok15; ok15 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	// Get the dictionary and start the iteration. No catching of errors at
	// this point.

	if (*Tcl_Token)(unsafe.Pointer(dictTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok16 := true; ok16; ok16 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(dictTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(dictTokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok17 := true; ok17; ok17 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok18 := true; ok18; ok18 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok19 := true; ok19; ok19 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok20 := true; ok20; ok20 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok21 := true; ok21; ok21 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok22 := true; ok22; ok22 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
		XTclCompileTokens(tls, interp, dictTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(dictTokenPtr)).FnumComponents, envPtr)
	}

	// Now we catch errors from here on so that we can finalize the search
	// started by Tcl_DictObjFirst above.

	catchRange = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
	for ok23 := true; ok23; ok23 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(catchRange) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(catchRange) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(catchRange) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(catchRange))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_BEGIN_CATCH4 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok24 := true; ok24; ok24 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - catchRange
				}
				for ok25 := true; ok25; ok25 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(catchRange)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)

	for ok26 := true; ok26; ok26 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_FIRST)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DICT_FIRST == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok27 := true; ok27; ok27 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DICT_FIRST].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - infoIndex
				}
				for ok28 := true; ok28; ok28 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	emptyTargetOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok29 := true; ok29; ok29 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE4)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP_TRUE4 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok30 := true; ok30; ok30 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP_TRUE4].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok31 := true; ok31; ok31 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Inside the iteration, write the loop variables.

	bodyTargetOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	if keyVarIndex <= 255 {
		for ok32 := true; ok32; ok32 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVarIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok33 := true; ok33; ok33 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - keyVarIndex
					}
					for ok34 := true; ok34; ok34 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok35 := true; ok35; ok35 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVarIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVarIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVarIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVarIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok36 := true; ok36; ok36 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - keyVarIndex
					}
					for ok37 := true; ok37; ok37 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	for ok38 := true; ok38; ok38 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok39 := true; ok39; ok39 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok40 := true; ok40; ok40 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	if valueVarIndex <= 255 {
		for ok41 := true; ok41; ok41 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(valueVarIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok42 := true; ok42; ok42 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - valueVarIndex
					}
					for ok43 := true; ok43; ok43 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok44 := true; ok44; ok44 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(valueVarIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(valueVarIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(valueVarIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(valueVarIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok45 := true; ok45; ok45 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - valueVarIndex
					}
					for ok46 := true; ok46; ok46 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	for ok47 := true; ok47; ok47 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok48 := true; ok48; ok48 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok49 := true; ok49; ok49 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Set up the loop exception targets.

	loopRange = XTclCreateExceptRange(tls, LOOP_EXCEPTION_RANGE, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(loopRange)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)

	// Compile the loop body itself. It should be stack-neutral.

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 3*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 3*8))
	XTclCompileCmdWord(tls, interp, bodyTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(bodyTokenPtr)).FnumComponents, envPtr)
	if collect == TCL_EACH_COLLECT {
		if keyVarIndex <= 255 {
			for ok50 := true; ok50; ok50 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVarIndex))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok51 := true; ok51; ok51 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - keyVarIndex
						}
						for ok52 := true; ok52; ok52 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok53 := true; ok53; ok53 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVarIndex) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVarIndex) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVarIndex) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keyVarIndex))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok54 := true; ok54; ok54 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - keyVarIndex
						}
						for ok55 := true; ok55; ok55 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

		for ok56 := true; ok56; ok56 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_OVER == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok57 := true; ok57; ok57 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 1
					}
					for ok58 := true; ok58; ok58 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok59 := true; ok59; ok59 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_SET)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DICT_SET == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok60 := true; ok60; ok60 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DICT_SET].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 1
					}
					for ok61 := true; ok61; ok61 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok62 := true; ok62; ok62 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar))
		}
		for ok63 := true; ok63; ok63 = 0 != 0 {
			if -1 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
		}
		for ok64 := true; ok64; ok64 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok65 := true; ok65; ok65 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok66 := true; ok66; ok66 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	for ok67 := true; ok67; ok67 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok68 := true; ok68; ok68 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok69 := true; ok69; ok69 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Both exception target ranges (error and loop) end here.

	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(loopRange)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(loopRange)*28)).FcodeOffset))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(catchRange)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(catchRange)*28)).FcodeOffset))

	// Continue (or just normally process) by getting the next pair of items
	// from the dictionary and jumping back to the code to write them into
	// variables if there is another pair.

	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(loopRange)*28)).FcontinueOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok70 := true; ok70; ok70 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_NEXT)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DICT_NEXT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok71 := true; ok71; ok71 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DICT_NEXT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - infoIndex
				}
				for ok72 := true; ok72; ok72 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	jumpDisplacement = int32(int64(bodyTargetOffset) - (int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1)
	for ok73 := true; ok73; ok73 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE4)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(jumpDisplacement) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(jumpDisplacement) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(jumpDisplacement) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(jumpDisplacement))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP_FALSE4 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok74 := true; ok74; ok74 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP_FALSE4].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - jumpDisplacement
				}
				for ok75 := true; ok75; ok75 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	endTargetOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok76 := true; ok76; ok76 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP1 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok77 := true; ok77; ok77 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP1].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok78 := true; ok78; ok78 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Error handler "finally" clause, which force-terminates the iteration
	// and rethrows the error.

	for ok79 := true; ok79; ok79 = 0 != 0 {
		if -1 < 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
			}
		}
		*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	}
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(catchRange)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok80 := true; ok80; ok80 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok81 := true; ok81; ok81 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok82 := true; ok82; ok82 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok83 := true; ok83; ok83 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RESULT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok84 := true; ok84; ok84 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok85 := true; ok85; ok85 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok86 := true; ok86; ok86 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_END_CATCH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok87 := true; ok87; ok87 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok88 := true; ok88; ok88 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok89 := true; ok89; ok89 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_UNSET_SCALAR == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok90 := true; ok90; ok90 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok91 := true; ok91; ok91 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok92 := true; ok92; ok92 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
	}
	if collect == TCL_EACH_COLLECT {
		for ok93 := true; ok93; ok93 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_UNSET_SCALAR == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok94 := true; ok94; ok94 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok95 := true; ok95; ok95 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok96 := true; ok96; ok96 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar))
		}
	}
	for ok97 := true; ok97; ok97 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_RETURN_STK)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_RETURN_STK == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok98 := true; ok98; ok98 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_RETURN_STK].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok99 := true; ok99; ok99 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Otherwise we're done (the jump after the DICT_FIRST points here) and we
	// need to pop the bogus key/value pair (pushed to keep stack calculations
	// easy!) Note that we skip the END_CATCH. [Bug 1382528]

	jumpDisplacement = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(emptyTargetOffset))
	for ok100 := true; ok100; ok100 = 0 != 0 {
		*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(emptyTargetOffset))) = uint8(INST_JUMP_TRUE4)
		for ok101 := true; ok101; ok101 = 0 != 0 {
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(emptyTargetOffset) + uintptr(1))) = uint8(uint32(jumpDisplacement) >> 24)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(emptyTargetOffset) + uintptr(1) + uintptr(1))) = uint8(uint32(jumpDisplacement) >> 16)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(emptyTargetOffset) + uintptr(1) + uintptr(2))) = uint8(uint32(jumpDisplacement) >> 8)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(emptyTargetOffset) + uintptr(1) + uintptr(3))) = uint8(uint32(jumpDisplacement))
		}
	}
	jumpDisplacement = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(endTargetOffset))
	for ok102 := true; ok102; ok102 = 0 != 0 {
		*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(endTargetOffset))) = uint8(INST_JUMP1)
		*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(endTargetOffset) + uintptr(1))) = uint8(uint32(jumpDisplacement))
	}
	for ok103 := true; ok103; ok103 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok104 := true; ok104; ok104 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok105 := true; ok105; ok105 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok106 := true; ok106; ok106 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok107 := true; ok107; ok107 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok108 := true; ok108; ok108 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(loopRange)*28)).FbreakOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	XTclFinalizeLoopExceptionRange(tls, envPtr, loopRange)
	for ok109 := true; ok109; ok109 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_END_CATCH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok110 := true; ok110; ok110 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok111 := true; ok111; ok111 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Final stage of the command (normal case) is that we push an empty
	// object (or push the accumulator as the result object). This is done
	// last to promote peephole optimization when it's dropped immediately.

	for ok112 := true; ok112; ok112 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_UNSET_SCALAR == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok113 := true; ok113; ok113 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok114 := true; ok114; ok114 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok115 := true; ok115; ok115 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
	}
	if collect == TCL_EACH_COLLECT {
		if collectVar <= 255 {
			for ok116 := true; ok116; ok116 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok117 := true; ok117; ok117 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - collectVar
						}
						for ok118 := true; ok118; ok118 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok119 := true; ok119; ok119 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok120 := true; ok120; ok120 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - collectVar
						}
						for ok121 := true; ok121; ok121 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

		for ok122 := true; ok122; ok122 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_UNSET_SCALAR == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok123 := true; ok123; ok123 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok124 := true; ok124; ok124 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok125 := true; ok125; ok125 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(collectVar))
		}
	} else {
		for ok126 := true; ok126; ok126 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok127 := true; ok127; ok127 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok128 := true; ok128; ok128 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok129 := true; ok129; ok129 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok130 := true; ok130; ok130 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok131 := true; ok131; ok131 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok132 := true; ok132; ok132 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileDictUpdateCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1729:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var i int32
	var dictIndex int32
	var numVars int32
	var range1 int32
	var infoIndex int32
	var keyTokenPtrs uintptr
	var dictVarTokenPtr uintptr
	var bodyTokenPtr uintptr
	var tokenPtr uintptr
	var duiPtr uintptr
	// var jumpFixup JumpFixup at bp+8, 16

	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _delta4 int32
	var _delta5 int32
	var _delta6 int32
	var _delta7 int32
	var _delta8 int32
	var _delta9 int32
	var _delta10 int32
	var _delta11 int32
	var _delta12 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1

	// There must be at least one argument after the command.

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 5) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	// Parse the command. Expect the following:
	//   dict update <lit(eral)> <any> <lit> ?<any> <lit> ...? <lit>

	if !(((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1)&1 != 0) {
		goto __2
	}
	return TCL_ERROR
__2:
	;
	numVars = ((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 3) / 2

	// The dictionary variable must be a local scalar that is knowable at
	// compile time; anything else exceeds the complexity of the opcode. So
	// discover what the index is.

	dictVarTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	dictIndex = XTclLocalScalarFromToken(tls, dictVarTokenPtr, envPtr)
	if !(dictIndex < 0) {
		goto __3
	}
	goto issueFallback
__3:
	;

	// Assemble the instruction metadata. This is complex enough that it is
	// represented as auxData; it holds an ordered list of variable indices
	// that are to be used.

	duiPtr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+4))+uint64(unsafe.Sizeof(int32(0)))*uint64(numVars)))
	(*DictUpdateInfo)(unsafe.Pointer(duiPtr)).Flength = numVars
	keyTokenPtrs = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(numVars)))
	tokenPtr = dictVarTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(dictVarTokenPtr)).FnumComponents+1)*24

	i = 0
__4:
	if !(i < numVars) {
		goto __6
	}
	// Put keys to one side for later compilation to bytecode.

	*(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i)*8)) = tokenPtr
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24

	// Stash the index in the auxiliary data (if it is indeed a local
	// scalar that is resolvable at compile-time).

	*(*int32)(unsafe.Pointer(duiPtr + 4 + uintptr(i)*4)) = XTclLocalScalarFromToken(tls, tokenPtr, envPtr)
	if !(*(*int32)(unsafe.Pointer(duiPtr + 4 + uintptr(i)*4)) < 0) {
		goto __7
	}
	goto failedUpdateInfoAssembly
__7:
	;
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	goto __5
__5:
	i++
	goto __4
	goto __6
__6:
	;
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD) {
		goto __8
	}
	goto failedUpdateInfoAssembly
__8:
	;
	bodyTokenPtr = tokenPtr

	// The list of variables to bind is stored in auxiliary data so that it
	// can't be snagged by literal sharing and forced to shimmer dangerously.

	infoIndex = XTclCreateAuxData(tls, duiPtr, uintptr(unsafe.Pointer(&dictUpdateInfoType)), envPtr)

	i = 0
__9:
	if !(i < numVars) {
		goto __11
	}
	if !((*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i)*8)))).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __12
	}
__14:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i)*8))+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i)*8))+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __17
	}
__19:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __22
	}
	XTclExpandCodeArray(tls, envPtr)
__22:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __23
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__23:
	;
__24:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __27
	}
	if !(_delta == -0x7fffffff-1) {
		goto __28
	}
	_delta = 1 - _objIndexCopy
__28:
	;
__29:
	if !(_delta < 0) {
		goto __32
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __33
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__33:
	;
__32:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
__27:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
	goto __18
__17:
__34:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __37
	}
	XTclExpandCodeArray(tls, envPtr)
__37:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __38
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__38:
	;
__39:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __42
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __43
	}
	_delta1 = 1 - _objIndexCopy
__43:
	;
__44:
	if !(_delta1 < 0) {
		goto __47
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __48
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__48:
	;
__47:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __45
__45:
	if 0 != 0 {
		goto __44
	}
	goto __46
__46:
	;
__42:
	;
	goto __40
__40:
	if 0 != 0 {
		goto __39
	}
	goto __41
__41:
	;
	goto __35
__35:
	if 0 != 0 {
		goto __34
	}
	goto __36
__36:
	;
__18:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	goto __13
__12:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(2*i+2)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(2*i+2)*8))
	XTclCompileTokens(tls, interp, *(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i)*8))+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i)*8)))).FnumComponents, envPtr)
__13:
	;

	goto __10
__10:
	i++
	goto __9
	goto __11
__11:
	;
__49:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __52
	}
	XTclExpandCodeArray(tls, envPtr)
__52:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numVars) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numVars) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numVars) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numVars))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __53
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST == INST_START_CMD {
			return 1
		}
		return 0
	}()
__53:
	;
__54:
	_delta2 = XtclInstructionTable[INST_LIST].FstackEffect
	if !(_delta2 != 0) {
		goto __57
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __58
	}
	_delta2 = 1 - numVars
__58:
	;
__59:
	if !(_delta2 < 0) {
		goto __62
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __63
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__63:
	;
__62:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __60
__60:
	if 0 != 0 {
		goto __59
	}
	goto __61
__61:
	;
__57:
	;
	goto __55
__55:
	if 0 != 0 {
		goto __54
	}
	goto __56
__56:
	;
	goto __50
__50:
	if 0 != 0 {
		goto __49
	}
	goto __51
__51:
	;
__64:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __67
	}
	XTclExpandCodeArray(tls, envPtr)
__67:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_UPDATE_START)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __68
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DICT_UPDATE_START == INST_START_CMD {
			return 1
		}
		return 0
	}()
__68:
	;
__69:
	_delta3 = XtclInstructionTable[INST_DICT_UPDATE_START].FstackEffect
	if !(_delta3 != 0) {
		goto __72
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __73
	}
	_delta3 = 1 - dictIndex
__73:
	;
__74:
	if !(_delta3 < 0) {
		goto __77
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __78
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__78:
	;
__77:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __75
__75:
	if 0 != 0 {
		goto __74
	}
	goto __76
__76:
	;
__72:
	;
	goto __70
__70:
	if 0 != 0 {
		goto __69
	}
	goto __71
__71:
	;
	goto __65
__65:
	if 0 != 0 {
		goto __64
	}
	goto __66
__66:
	;
__79:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __82
	}
	XTclExpandCodeArray(tls, envPtr)
__82:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
	goto __80
__80:
	if 0 != 0 {
		goto __79
	}
	goto __81
__81:
	;

	range1 = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
__83:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __86
	}
	XTclExpandCodeArray(tls, envPtr)
__86:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __87
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_BEGIN_CATCH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__87:
	;
__88:
	_delta4 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
	if !(_delta4 != 0) {
		goto __91
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __92
	}
	_delta4 = 1 - range1
__92:
	;
__93:
	if !(_delta4 < 0) {
		goto __96
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __97
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__97:
	;
__96:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __94
__94:
	if 0 != 0 {
		goto __93
	}
	goto __95
__95:
	;
__91:
	;
	goto __89
__89:
	if 0 != 0 {
		goto __88
	}
	goto __90
__90:
	;
	goto __84
__84:
	if 0 != 0 {
		goto __83
	}
	goto __85
__85:
	;

	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1)*8))
	XTclCompileCmdWord(tls, interp, bodyTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(bodyTokenPtr)).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))

	// Normal termination code: the stack has the key list below the result of
	// the body evaluation: swap them and finish the update code.

__98:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __101
	}
	XTclExpandCodeArray(tls, envPtr)
__101:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __102
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_END_CATCH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__102:
	;
__103:
	_delta5 = XtclInstructionTable[INST_END_CATCH].FstackEffect
	if !(_delta5 != 0) {
		goto __106
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __107
	}
	_delta5 = 1 - 0
__107:
	;
__108:
	if !(_delta5 < 0) {
		goto __111
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __112
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__112:
	;
__111:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __109
__109:
	if 0 != 0 {
		goto __108
	}
	goto __110
__110:
	;
__106:
	;
	goto __104
__104:
	if 0 != 0 {
		goto __103
	}
	goto __105
__105:
	;
	goto __99
__99:
	if 0 != 0 {
		goto __98
	}
	goto __100
__100:
	;
__113:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __116
	}
	XTclExpandCodeArray(tls, envPtr)
__116:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __117
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__117:
	;
__118:
	_delta6 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta6 != 0) {
		goto __121
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __122
	}
	_delta6 = 1 - 2
__122:
	;
__123:
	if !(_delta6 < 0) {
		goto __126
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __127
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__127:
	;
__126:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __124
__124:
	if 0 != 0 {
		goto __123
	}
	goto __125
__125:
	;
__121:
	;
	goto __119
__119:
	if 0 != 0 {
		goto __118
	}
	goto __120
__120:
	;
	goto __114
__114:
	if 0 != 0 {
		goto __113
	}
	goto __115
__115:
	;
__128:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __131
	}
	XTclExpandCodeArray(tls, envPtr)
__131:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_UPDATE_END)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __132
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DICT_UPDATE_END == INST_START_CMD {
			return 1
		}
		return 0
	}()
__132:
	;
__133:
	_delta7 = XtclInstructionTable[INST_DICT_UPDATE_END].FstackEffect
	if !(_delta7 != 0) {
		goto __136
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __137
	}
	_delta7 = 1 - dictIndex
__137:
	;
__138:
	if !(_delta7 < 0) {
		goto __141
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __142
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__142:
	;
__141:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __139
__139:
	if 0 != 0 {
		goto __138
	}
	goto __140
__140:
	;
__136:
	;
	goto __134
__134:
	if 0 != 0 {
		goto __133
	}
	goto __135
__135:
	;
	goto __129
__129:
	if 0 != 0 {
		goto __128
	}
	goto __130
__130:
	;
__143:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __146
	}
	XTclExpandCodeArray(tls, envPtr)
__146:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
	goto __144
__144:
	if 0 != 0 {
		goto __143
	}
	goto __145
__145:
	;

	// Jump around the exceptional termination code.

	XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp+8)

	// Termination code for non-ok returns: stash the result and return
	// options in the stack, bring up the key list, finish the update code,
	// and finally return with the catched return data

	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__147:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __150
	}
	XTclExpandCodeArray(tls, envPtr)
__150:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __151
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RESULT == INST_START_CMD {
			return 1
		}
		return 0
	}()
__151:
	;
__152:
	_delta8 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
	if !(_delta8 != 0) {
		goto __155
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __156
	}
	_delta8 = 1 - 0
__156:
	;
__157:
	if !(_delta8 < 0) {
		goto __160
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __161
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__161:
	;
__160:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __158
__158:
	if 0 != 0 {
		goto __157
	}
	goto __159
__159:
	;
__155:
	;
	goto __153
__153:
	if 0 != 0 {
		goto __152
	}
	goto __154
__154:
	;
	goto __148
__148:
	if 0 != 0 {
		goto __147
	}
	goto __149
__149:
	;
__162:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __165
	}
	XTclExpandCodeArray(tls, envPtr)
__165:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __166
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
			return 1
		}
		return 0
	}()
__166:
	;
__167:
	_delta9 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
	if !(_delta9 != 0) {
		goto __170
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __171
	}
	_delta9 = 1 - 0
__171:
	;
__172:
	if !(_delta9 < 0) {
		goto __175
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __176
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__176:
	;
__175:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __173
__173:
	if 0 != 0 {
		goto __172
	}
	goto __174
__174:
	;
__170:
	;
	goto __168
__168:
	if 0 != 0 {
		goto __167
	}
	goto __169
__169:
	;
	goto __163
__163:
	if 0 != 0 {
		goto __162
	}
	goto __164
__164:
	;
__177:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __180
	}
	XTclExpandCodeArray(tls, envPtr)
__180:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __181
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_END_CATCH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__181:
	;
__182:
	_delta10 = XtclInstructionTable[INST_END_CATCH].FstackEffect
	if !(_delta10 != 0) {
		goto __185
	}
	if !(_delta10 == -0x7fffffff-1) {
		goto __186
	}
	_delta10 = 1 - 0
__186:
	;
__187:
	if !(_delta10 < 0) {
		goto __190
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __191
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__191:
	;
__190:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta10
	goto __188
__188:
	if 0 != 0 {
		goto __187
	}
	goto __189
__189:
	;
__185:
	;
	goto __183
__183:
	if 0 != 0 {
		goto __182
	}
	goto __184
__184:
	;
	goto __178
__178:
	if 0 != 0 {
		goto __177
	}
	goto __179
__179:
	;
__192:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __195
	}
	XTclExpandCodeArray(tls, envPtr)
__195:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __196
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__196:
	;
__197:
	_delta11 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta11 != 0) {
		goto __200
	}
	if !(_delta11 == -0x7fffffff-1) {
		goto __201
	}
	_delta11 = 1 - 3
__201:
	;
__202:
	if !(_delta11 < 0) {
		goto __205
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __206
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__206:
	;
__205:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta11
	goto __203
__203:
	if 0 != 0 {
		goto __202
	}
	goto __204
__204:
	;
__200:
	;
	goto __198
__198:
	if 0 != 0 {
		goto __197
	}
	goto __199
__199:
	;
	goto __193
__193:
	if 0 != 0 {
		goto __192
	}
	goto __194
__194:
	;

__207:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __210
	}
	XTclExpandCodeArray(tls, envPtr)
__210:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_UPDATE_END)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictIndex))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __211
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DICT_UPDATE_END == INST_START_CMD {
			return 1
		}
		return 0
	}()
__211:
	;
__212:
	_delta12 = XtclInstructionTable[INST_DICT_UPDATE_END].FstackEffect
	if !(_delta12 != 0) {
		goto __215
	}
	if !(_delta12 == -0x7fffffff-1) {
		goto __216
	}
	_delta12 = 1 - dictIndex
__216:
	;
__217:
	if !(_delta12 < 0) {
		goto __220
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __221
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__221:
	;
__220:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta12
	goto __218
__218:
	if 0 != 0 {
		goto __217
	}
	goto __219
__219:
	;
__215:
	;
	goto __213
__213:
	if 0 != 0 {
		goto __212
	}
	goto __214
__214:
	;
	goto __208
__208:
	if 0 != 0 {
		goto __207
	}
	goto __209
__209:
	;
__222:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __225
	}
	XTclExpandCodeArray(tls, envPtr)
__225:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
	goto __223
__223:
	if 0 != 0 {
		goto __222
	}
	goto __224
__224:
	;
	XTclEmitInvoke(tls, envPtr, INST_RETURN_STK, 0)

	if !(XTclFixupForwardJump(tls, envPtr, bp+8, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+8)).FcodeOffset)), 127) != 0) {
		goto __226
	}
	XTcl_Panic(tls, ts+18501,
		libc.VaList(bp, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+8)).FcodeOffset))))
__226:
	;
	XTclStackFree(tls, interp, keyTokenPtrs)
	return TCL_OK

	// Clean up after a failure to create the DictUpdateInfo structure.

failedUpdateInfoAssembly:
	XTclpFree(tls, duiPtr)
	XTclStackFree(tls, interp, keyTokenPtrs)
issueFallback:
	return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileDictAppendCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1880:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var i int32
	var dictVarIndex int32

	// There must be at least two argument after the command. And we impose an
	// (arbirary) safe limit; anyone exceeding it should stop worrying about
	// speed quite so much. ;-)

	// TODO: Consider support for compiling expanded args.
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 4 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 100 {
		return TCL_ERROR
	}

	// Get the index of the local variable that we will be working with.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	dictVarIndex = XTclLocalScalarFromToken(tls, tokenPtr, envPtr)
	if dictVarIndex < 0 {
		return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	// Produce the string to concatenate onto the dictionary entry.

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	for i = 2; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 4 {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 3))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_CONCAT1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - ((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 3)
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	// Do the concatenation.

	for ok10 := true; ok10; ok10 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_APPEND)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DICT_APPEND == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok11 := true; ok11; ok11 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DICT_APPEND].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - dictVarIndex
				}
				for ok12 := true; ok12; ok12 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileDictLappendCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1935:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var varTokenPtr uintptr
	var keyTokenPtr uintptr
	var valueTokenPtr uintptr
	var dictVarIndex int32

	// There must be three arguments after the command.

	// TODO: Consider support for compiling expanded args.
	// Probably not.  Why is INST_DICT_LAPPEND limited to one value?
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 4 {
		return TCL_ERROR
	}

	// Parse the arguments.

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	keyTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	valueTokenPtr = keyTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(keyTokenPtr)).FnumComponents+1)*24
	dictVarIndex = XTclLocalScalarFromToken(tls, varTokenPtr, envPtr)
	if dictVarIndex < 0 {
		return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	// Issue the implementation.

	if (*Tcl_Token)(unsafe.Pointer(keyTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(keyTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(keyTokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
		XTclCompileTokens(tls, interp, keyTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(keyTokenPtr)).FnumComponents, envPtr)
	}

	if (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok10 := true; ok10; ok10 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 3*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 3*8))
		XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents, envPtr)
	}

	for ok14 := true; ok14; ok14 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_LAPPEND)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVarIndex))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DICT_LAPPEND == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok15 := true; ok15; ok15 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DICT_LAPPEND].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - dictVarIndex
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileDictWithCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:1980:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var i int32
	var range1 int32
	var varNameTmp int32 = -1
	var pathTmp int32 = -1
	var keysTmp int32
	var gotPath int32
	var dictVar int32
	var bodyIsEmpty int32 = 1
	var varTokenPtr uintptr
	var tokenPtr uintptr
	// var jumpFixup JumpFixup at bp+8, 16

	var ptr uintptr
	var end uintptr

	// There must be at least one argument after the command.

	// TODO: Consider support for compiling expanded args.
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 {
		return TCL_ERROR
	}

	// Parse the command (trivially). Expect the following:
	//   dict with <any (varName)> ?<any> ...? <literal>

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	tokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	for i = 3; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
		return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	// Test if the last word is an empty script; if so, we can compile it in
	// all cases, but if it is non-empty we need local variable table entries
	// to hold the temporary variables (used to keep stack usage simple).

	ptr = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart
	end = ptr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize)
	for ; ptr != end; ptr++ {
		if int32(*(*int8)(unsafe.Pointer(ptr))) != ' ' && int32(*(*int8)(unsafe.Pointer(ptr))) != '\t' && int32(*(*int8)(unsafe.Pointer(ptr))) != '\n' && int32(*(*int8)(unsafe.Pointer(ptr))) != '\r' {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr == uintptr(0) {
				return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr,
					envPtr)
			}
			bodyIsEmpty = 0
			break
		}
	}

	// Determine if we're manipulating a dict in a simple local variable.

	gotPath = libc.Bool32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 3)
	dictVar = XTclLocalScalarFromToken(tls, varTokenPtr, envPtr)

	// Special case: an empty body means we definitely have no need to issue
	// try-finally style code or to allocate local variable table entries for
	// storing temporaries. Still need to do both INST_DICT_EXPAND and
	// INST_DICT_RECOMBINE_* though, because we can't determine if we're free
	// of traces.

	if bodyIsEmpty != 0 {
		if dictVar >= 0 {
			if gotPath != 0 {
				// Case: Path into dict in LVT with empty body.

				tokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
				for i = 2; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1; i++ {
					if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
						for ok := true; ok; ok = 0 != 0 {
							var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
							if _objIndexCopy <= 255 {
								for ok1 := true; ok1; ok1 = 0 != 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
										XTclExpandCodeArray(tls, envPtr)
									}
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
											if INST_PUSH1 == INST_START_CMD {
												return 1
											}
											return 0
										}()
									}
									for ok2 := true; ok2; ok2 = 0 != 0 {
										var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
										if _delta != 0 {
											if _delta == -0x7fffffff-1 {
												_delta = 1 - _objIndexCopy
											}
											for ok3 := true; ok3; ok3 = 0 != 0 {
												if _delta < 0 {
													if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
														(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
													}
												}
												*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
											}
										}
									}
								}
							} else {
								for ok4 := true; ok4; ok4 = 0 != 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
										XTclExpandCodeArray(tls, envPtr)
									}
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
											if INST_PUSH4 == INST_START_CMD {
												return 1
											}
											return 0
										}()
									}
									for ok5 := true; ok5; ok5 = 0 != 0 {
										var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
										if _delta != 0 {
											if _delta == -0x7fffffff-1 {
												_delta = 1 - _objIndexCopy
											}
											for ok6 := true; ok6; ok6 = 0 != 0 {
												if _delta < 0 {
													if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
														(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
													}
												}
												*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
											}
										}
									}
								}
							}
						}
					} else {
						(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
						(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
						XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
					}

					tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
				}
				for ok7 := true; ok7; ok7 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 3))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LIST == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok8 := true; ok8; ok8 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - ((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 3)
							}
							for ok9 := true; ok9; ok9 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				if dictVar <= 255 {
					for ok10 := true; ok10; ok10 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_LOAD_SCALAR1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok11 := true; ok11; ok11 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - dictVar
								}
								for ok12 := true; ok12; ok12 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok13 := true; ok13; ok13 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_LOAD_SCALAR4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok14 := true; ok14; ok14 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - dictVar
								}
								for ok15 := true; ok15; ok15 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}

				for ok16 := true; ok16; ok16 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_OVER == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok17 := true; ok17; ok17 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 1
							}
							for ok18 := true; ok18; ok18 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok19 := true; ok19; ok19 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_EXPAND)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_DICT_EXPAND == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok20 := true; ok20; ok20 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_DICT_EXPAND].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok21 := true; ok21; ok21 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok22 := true; ok22; ok22 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_RECOMBINE_IMM)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_DICT_RECOMBINE_IMM == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok23 := true; ok23; ok23 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_DICT_RECOMBINE_IMM].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - dictVar
							}
							for ok24 := true; ok24; ok24 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				// Case: Direct dict in LVT with empty body.

				for ok25 := true; ok25; ok25 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
					if _objIndexCopy <= 255 {
						for ok26 := true; ok26; ok26 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok27 := true; ok27; ok27 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok28 := true; ok28; ok28 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok29 := true; ok29; ok29 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok30 := true; ok30; ok30 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok31 := true; ok31; ok31 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
				if dictVar <= 255 {
					for ok32 := true; ok32; ok32 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_LOAD_SCALAR1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok33 := true; ok33; ok33 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - dictVar
								}
								for ok34 := true; ok34; ok34 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok35 := true; ok35; ok35 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_LOAD_SCALAR4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok36 := true; ok36; ok36 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - dictVar
								}
								for ok37 := true; ok37; ok37 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}

				for ok38 := true; ok38; ok38 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
					if _objIndexCopy <= 255 {
						for ok39 := true; ok39; ok39 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok40 := true; ok40; ok40 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok41 := true; ok41; ok41 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok42 := true; ok42; ok42 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok43 := true; ok43; ok43 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok44 := true; ok44; ok44 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
				for ok45 := true; ok45; ok45 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_EXPAND)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_DICT_EXPAND == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok46 := true; ok46; ok46 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_DICT_EXPAND].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok47 := true; ok47; ok47 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok48 := true; ok48; ok48 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_RECOMBINE_IMM)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_DICT_RECOMBINE_IMM == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok49 := true; ok49; ok49 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_DICT_RECOMBINE_IMM].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - dictVar
							}
							for ok50 := true; ok50; ok50 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		} else {
			if gotPath != 0 {
				// Case: Path into dict in non-simple var with empty body.

				tokenPtr = varTokenPtr
				for i = 1; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1; i++ {
					if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
						for ok51 := true; ok51; ok51 = 0 != 0 {
							var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
							if _objIndexCopy <= 255 {
								for ok52 := true; ok52; ok52 = 0 != 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
										XTclExpandCodeArray(tls, envPtr)
									}
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
											if INST_PUSH1 == INST_START_CMD {
												return 1
											}
											return 0
										}()
									}
									for ok53 := true; ok53; ok53 = 0 != 0 {
										var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
										if _delta != 0 {
											if _delta == -0x7fffffff-1 {
												_delta = 1 - _objIndexCopy
											}
											for ok54 := true; ok54; ok54 = 0 != 0 {
												if _delta < 0 {
													if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
														(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
													}
												}
												*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
											}
										}
									}
								}
							} else {
								for ok55 := true; ok55; ok55 = 0 != 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
										XTclExpandCodeArray(tls, envPtr)
									}
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
											if INST_PUSH4 == INST_START_CMD {
												return 1
											}
											return 0
										}()
									}
									for ok56 := true; ok56; ok56 = 0 != 0 {
										var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
										if _delta != 0 {
											if _delta == -0x7fffffff-1 {
												_delta = 1 - _objIndexCopy
											}
											for ok57 := true; ok57; ok57 = 0 != 0 {
												if _delta < 0 {
													if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
														(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
													}
												}
												*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
											}
										}
									}
								}
							}
						}
					} else {
						(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
						(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
						XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
					}

					tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
				}
				for ok58 := true; ok58; ok58 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 3))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LIST == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok59 := true; ok59; ok59 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - ((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 3)
							}
							for ok60 := true; ok60; ok60 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok61 := true; ok61; ok61 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_OVER == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok62 := true; ok62; ok62 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 1
							}
							for ok63 := true; ok63; ok63 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok64 := true; ok64; ok64 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_STK)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_STK == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok65 := true; ok65; ok65 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_STK].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok66 := true; ok66; ok66 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok67 := true; ok67; ok67 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_OVER == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok68 := true; ok68; ok68 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 1
							}
							for ok69 := true; ok69; ok69 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok70 := true; ok70; ok70 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_EXPAND)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_DICT_EXPAND == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok71 := true; ok71; ok71 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_DICT_EXPAND].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok72 := true; ok72; ok72 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok73 := true; ok73; ok73 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_RECOMBINE_STK)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_DICT_RECOMBINE_STK == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok74 := true; ok74; ok74 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_DICT_RECOMBINE_STK].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok75 := true; ok75; ok75 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				// Case: Direct dict in non-simple var with empty body.

				if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
					for ok76 := true; ok76; ok76 = 0 != 0 {
						var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fsize, 0)
						if _objIndexCopy <= 255 {
							for ok77 := true; ok77; ok77 = 0 != 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
									XTclExpandCodeArray(tls, envPtr)
								}
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
										if INST_PUSH1 == INST_START_CMD {
											return 1
										}
										return 0
									}()
								}
								for ok78 := true; ok78; ok78 = 0 != 0 {
									var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
									if _delta != 0 {
										if _delta == -0x7fffffff-1 {
											_delta = 1 - _objIndexCopy
										}
										for ok79 := true; ok79; ok79 = 0 != 0 {
											if _delta < 0 {
												if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
													(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
												}
											}
											*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
										}
									}
								}
							}
						} else {
							for ok80 := true; ok80; ok80 = 0 != 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
									XTclExpandCodeArray(tls, envPtr)
								}
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
										if INST_PUSH4 == INST_START_CMD {
											return 1
										}
										return 0
									}()
								}
								for ok81 := true; ok81; ok81 = 0 != 0 {
									var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
									if _delta != 0 {
										if _delta == -0x7fffffff-1 {
											_delta = 1 - _objIndexCopy
										}
										for ok82 := true; ok82; ok82 = 0 != 0 {
											if _delta < 0 {
												if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
													(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
												}
											}
											*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
										}
									}
								}
							}
						}
					}
				} else {
					(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
					(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
					XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents, envPtr)
				}

				for ok83 := true; ok83; ok83 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_DUP == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok84 := true; ok84; ok84 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_DUP].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok85 := true; ok85; ok85 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok86 := true; ok86; ok86 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_STK)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_STK == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok87 := true; ok87; ok87 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_STK].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok88 := true; ok88; ok88 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok89 := true; ok89; ok89 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
					if _objIndexCopy <= 255 {
						for ok90 := true; ok90; ok90 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok91 := true; ok91; ok91 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok92 := true; ok92; ok92 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok93 := true; ok93; ok93 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok94 := true; ok94; ok94 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok95 := true; ok95; ok95 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
				for ok96 := true; ok96; ok96 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_EXPAND)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_DICT_EXPAND == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok97 := true; ok97; ok97 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_DICT_EXPAND].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok98 := true; ok98; ok98 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok99 := true; ok99; ok99 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
					if _objIndexCopy <= 255 {
						for ok100 := true; ok100; ok100 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok101 := true; ok101; ok101 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok102 := true; ok102; ok102 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok103 := true; ok103; ok103 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok104 := true; ok104; ok104 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok105 := true; ok105; ok105 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
				for ok106 := true; ok106; ok106 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_REVERSE == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok107 := true; ok107; ok107 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 2
							}
							for ok108 := true; ok108; ok108 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok109 := true; ok109; ok109 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_RECOMBINE_STK)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_DICT_RECOMBINE_STK == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok110 := true; ok110; ok110 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_DICT_RECOMBINE_STK].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok111 := true; ok111; ok111 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		for ok112 := true; ok112; ok112 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok113 := true; ok113; ok113 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok114 := true; ok114; ok114 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok115 := true; ok115; ok115 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok116 := true; ok116; ok116 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok117 := true; ok117; ok117 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok118 := true; ok118; ok118 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		return TCL_OK
	}

	// OK, we have a non-trivial body. This means that the focus is on
	// generating a try-finally structure where the INST_DICT_RECOMBINE_* goes
	// in the 'finally' clause.
	//
	// Start by allocating local (unnamed, untraced) working variables.

	if dictVar == -1 {
		varNameTmp = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
	}
	if gotPath != 0 {
		pathTmp = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
	}
	keysTmp = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)

	// Issue instructions. First, the part to expand the dictionary.

	if dictVar == -1 {
		if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok119 := true; ok119; ok119 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok120 := true; ok120; ok120 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok121 := true; ok121; ok121 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok122 := true; ok122; ok122 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok123 := true; ok123; ok123 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok124 := true; ok124; ok124 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok125 := true; ok125; ok125 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
			XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents, envPtr)
		}

		if varNameTmp <= 255 {
			for ok126 := true; ok126; ok126 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok127 := true; ok127; ok127 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - varNameTmp
						}
						for ok128 := true; ok128; ok128 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok129 := true; ok129; ok129 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok130 := true; ok130; ok130 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - varNameTmp
						}
						for ok131 := true; ok131; ok131 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

	}
	tokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	if gotPath != 0 {
		for i = 2; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1; i++ {
			if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
				for ok132 := true; ok132; ok132 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
					if _objIndexCopy <= 255 {
						for ok133 := true; ok133; ok133 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok134 := true; ok134; ok134 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok135 := true; ok135; ok135 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok136 := true; ok136; ok136 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok137 := true; ok137; ok137 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok138 := true; ok138; ok138 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
			} else {
				(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
				(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
				XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
			}

			tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		}
		for ok139 := true; ok139; ok139 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-3) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 3))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok140 := true; ok140; ok140 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - ((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 3)
					}
					for ok141 := true; ok141; ok141 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		if pathTmp <= 255 {
			for ok142 := true; ok142; ok142 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok143 := true; ok143; ok143 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - pathTmp
						}
						for ok144 := true; ok144; ok144 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok145 := true; ok145; ok145 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok146 := true; ok146; ok146 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - pathTmp
						}
						for ok147 := true; ok147; ok147 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

		for ok148 := true; ok148; ok148 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok149 := true; ok149; ok149 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok150 := true; ok150; ok150 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	if dictVar == -1 {
		for ok151 := true; ok151; ok151 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_STK)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LOAD_STK == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok152 := true; ok152; ok152 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LOAD_STK].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok153 := true; ok153; ok153 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		if dictVar <= 255 {
			for ok154 := true; ok154; ok154 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok155 := true; ok155; ok155 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - dictVar
						}
						for ok156 := true; ok156; ok156 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok157 := true; ok157; ok157 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok158 := true; ok158; ok158 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - dictVar
						}
						for ok159 := true; ok159; ok159 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

	}
	if gotPath != 0 {
		if pathTmp <= 255 {
			for ok160 := true; ok160; ok160 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok161 := true; ok161; ok161 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - pathTmp
						}
						for ok162 := true; ok162; ok162 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok163 := true; ok163; ok163 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok164 := true; ok164; ok164 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - pathTmp
						}
						for ok165 := true; ok165; ok165 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

	} else {
		for ok166 := true; ok166; ok166 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok167 := true; ok167; ok167 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok168 := true; ok168; ok168 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok169 := true; ok169; ok169 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok170 := true; ok170; ok170 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok171 := true; ok171; ok171 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok172 := true; ok172; ok172 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}
	for ok173 := true; ok173; ok173 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_EXPAND)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DICT_EXPAND == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok174 := true; ok174; ok174 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DICT_EXPAND].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok175 := true; ok175; ok175 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	if keysTmp <= 255 {
		for ok176 := true; ok176; ok176 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok177 := true; ok177; ok177 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - keysTmp
					}
					for ok178 := true; ok178; ok178 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok179 := true; ok179; ok179 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok180 := true; ok180; ok180 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - keysTmp
					}
					for ok181 := true; ok181; ok181 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	for ok182 := true; ok182; ok182 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok183 := true; ok183; ok183 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok184 := true; ok184; ok184 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Now the body of the [dict with].

	range1 = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
	for ok185 := true; ok185; ok185 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_BEGIN_CATCH4 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok186 := true; ok186; ok186 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - range1
				}
				for ok187 := true; ok187; ok187 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1)*8))
	XTclCompileCmdWord(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))

	// Now fold the results back into the dictionary in the OK case.

	for ok188 := true; ok188; ok188 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_END_CATCH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok189 := true; ok189; ok189 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok190 := true; ok190; ok190 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	if dictVar == -1 {
		if varNameTmp <= 255 {
			for ok191 := true; ok191; ok191 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok192 := true; ok192; ok192 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - varNameTmp
						}
						for ok193 := true; ok193; ok193 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok194 := true; ok194; ok194 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok195 := true; ok195; ok195 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - varNameTmp
						}
						for ok196 := true; ok196; ok196 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

	}
	if gotPath != 0 {
		if pathTmp <= 255 {
			for ok197 := true; ok197; ok197 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok198 := true; ok198; ok198 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - pathTmp
						}
						for ok199 := true; ok199; ok199 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok200 := true; ok200; ok200 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok201 := true; ok201; ok201 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - pathTmp
						}
						for ok202 := true; ok202; ok202 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

	} else {
		for ok203 := true; ok203; ok203 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok204 := true; ok204; ok204 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok205 := true; ok205; ok205 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok206 := true; ok206; ok206 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok207 := true; ok207; ok207 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok208 := true; ok208; ok208 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok209 := true; ok209; ok209 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}
	if keysTmp <= 255 {
		for ok210 := true; ok210; ok210 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LOAD_SCALAR1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok211 := true; ok211; ok211 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - keysTmp
					}
					for ok212 := true; ok212; ok212 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok213 := true; ok213; ok213 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LOAD_SCALAR4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok214 := true; ok214; ok214 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - keysTmp
					}
					for ok215 := true; ok215; ok215 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	if dictVar == -1 {
		for ok216 := true; ok216; ok216 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_RECOMBINE_STK)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DICT_RECOMBINE_STK == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok217 := true; ok217; ok217 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DICT_RECOMBINE_STK].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok218 := true; ok218; ok218 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok219 := true; ok219; ok219 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_RECOMBINE_IMM)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DICT_RECOMBINE_IMM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok220 := true; ok220; ok220 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DICT_RECOMBINE_IMM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - dictVar
					}
					for ok221 := true; ok221; ok221 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp+8)

	// Now fold the results back into the dictionary in the exception case.

	for ok222 := true; ok222; ok222 = 0 != 0 {
		if -1 < 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
			}
		}
		*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	}
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok223 := true; ok223; ok223 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok224 := true; ok224; ok224 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok225 := true; ok225; ok225 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok226 := true; ok226; ok226 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RESULT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok227 := true; ok227; ok227 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok228 := true; ok228; ok228 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok229 := true; ok229; ok229 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_END_CATCH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok230 := true; ok230; ok230 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok231 := true; ok231; ok231 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	if dictVar == -1 {
		if varNameTmp <= 255 {
			for ok232 := true; ok232; ok232 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok233 := true; ok233; ok233 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - varNameTmp
						}
						for ok234 := true; ok234; ok234 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok235 := true; ok235; ok235 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(varNameTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok236 := true; ok236; ok236 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - varNameTmp
						}
						for ok237 := true; ok237; ok237 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

	}
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 3 {
		if pathTmp <= 255 {
			for ok238 := true; ok238; ok238 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok239 := true; ok239; ok239 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - pathTmp
						}
						for ok240 := true; ok240; ok240 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok241 := true; ok241; ok241 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(pathTmp))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok242 := true; ok242; ok242 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - pathTmp
						}
						for ok243 := true; ok243; ok243 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

	} else {
		for ok244 := true; ok244; ok244 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok245 := true; ok245; ok245 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok246 := true; ok246; ok246 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok247 := true; ok247; ok247 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok248 := true; ok248; ok248 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok249 := true; ok249; ok249 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok250 := true; ok250; ok250 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}
	if keysTmp <= 255 {
		for ok251 := true; ok251; ok251 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LOAD_SCALAR1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok252 := true; ok252; ok252 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - keysTmp
					}
					for ok253 := true; ok253; ok253 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok254 := true; ok254; ok254 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(keysTmp))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LOAD_SCALAR4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok255 := true; ok255; ok255 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - keysTmp
					}
					for ok256 := true; ok256; ok256 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	if dictVar == -1 {
		for ok257 := true; ok257; ok257 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_RECOMBINE_STK)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DICT_RECOMBINE_STK == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok258 := true; ok258; ok258 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DICT_RECOMBINE_STK].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok259 := true; ok259; ok259 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok260 := true; ok260; ok260 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_RECOMBINE_IMM)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(dictVar))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DICT_RECOMBINE_IMM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok261 := true; ok261; ok261 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DICT_RECOMBINE_IMM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - dictVar
					}
					for ok262 := true; ok262; ok262 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	XTclEmitInvoke(tls, envPtr, INST_RETURN_STK, 0)

	// Prepare for the start of the next command.

	if XTclFixupForwardJump(tls, envPtr, bp+8, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+8)).FcodeOffset)), 127) != 0 {
		XTcl_Panic(tls, ts+18501,
			libc.VaList(bp, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+8)).FcodeOffset))))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DupDictUpdateInfo, FreeDictUpdateInfo --
//
//	Functions to duplicate, release and print the aux data created for use
//	with the INST_DICT_UPDATE_START and INST_DICT_UPDATE_END instructions.
//
// Results:
//	DupDictUpdateInfo: a copy of the auxiliary data
//	FreeDictUpdateInfo: none
//	PrintDictUpdateInfo: none
//	DisassembleDictUpdateInfo: none
//
// Side effects:
//	DupDictUpdateInfo: allocates memory
//	FreeDictUpdateInfo: releases memory
//	PrintDictUpdateInfo: none
//	DisassembleDictUpdateInfo: none
//
//----------------------------------------------------------------------

func sDupDictUpdateInfo(tls *libc.TLS, clientData ClientData) ClientData { /* tclCompCmds.c:2254:1: */
	var dui1Ptr uintptr
	var dui2Ptr uintptr
	var len uint32

	dui1Ptr = clientData
	len = uint32(uint64(int32(uintptr(0)+4)) + uint64(unsafe.Sizeof(int32(0)))*uint64((*DictUpdateInfo)(unsafe.Pointer(dui1Ptr)).Flength))
	dui2Ptr = XTcl_Alloc(tls, len)
	libc.Xmemcpy(tls, dui2Ptr, dui1Ptr, uint64(len))
	return dui2Ptr
}

func sFreeDictUpdateInfo(tls *libc.TLS, clientData ClientData) { /* tclCompCmds.c:2268:1: */
	XTclpFree(tls, clientData)
}

func sPrintDictUpdateInfo(tls *libc.TLS, clientData ClientData, appendObj uintptr, codePtr uintptr, pcOffset uint32) { /* tclCompCmds.c:2275:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var duiPtr uintptr = clientData
	var i int32

	for i = 0; i < (*DictUpdateInfo)(unsafe.Pointer(duiPtr)).Flength; i++ {
		if i != 0 {
			XTcl_AppendToObj(tls, appendObj, ts+18549, -1)
		}
		XTcl_AppendPrintfToObj(tls, appendObj, ts+18552, libc.VaList(bp, *(*int32)(unsafe.Pointer(duiPtr + 4 + uintptr(i)*4))))
	}
}

func sDisassembleDictUpdateInfo(tls *libc.TLS, clientData ClientData, dictObj uintptr, codePtr uintptr, pcOffset uint32) { /* tclCompCmds.c:2293:1: */
	var duiPtr uintptr = clientData
	var i int32
	var variables uintptr = XTcl_NewObj(tls)

	for i = 0; i < (*DictUpdateInfo)(unsafe.Pointer(duiPtr)).Flength; i++ {
		XTcl_ListObjAppendElement(tls, uintptr(0), variables,
			XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(duiPtr + 4 + uintptr(i)*4))))
	}
	XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+18558, -1),
		variables)
}

//----------------------------------------------------------------------
//
// TclCompileErrorCmd --
//
//	Procedure called to compile the "error" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "error" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileErrorCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:2330:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	// General syntax: [error message ?errorInfo? ?errorCode?]

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 2 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 4 {
		return TCL_ERROR
	}

	// Handle the message.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	// Construct the options. Note that -code and -level are not here.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 2 {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok10 := true; ok10; ok10 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		for ok14 := true; ok14; ok14 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+12034, int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok15 := true; ok15; ok15 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok17 := true; ok17; ok17 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok18 := true; ok18; ok18 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok20 := true; ok20; ok20 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok21 := true; ok21; ok21 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok22 := true; ok22; ok22 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok23 := true; ok23; ok23 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok24 := true; ok24; ok24 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok25 := true; ok25; ok25 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok26 := true; ok26; ok26 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok27 := true; ok27; ok27 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 3 {
			for ok28 := true; ok28; ok28 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LIST == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok29 := true; ok29; ok29 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 2
						}
						for ok30 := true; ok30; ok30 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok31 := true; ok31; ok31 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+12045, int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)), 0)
				if _objIndexCopy <= 255 {
					for ok32 := true; ok32; ok32 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok33 := true; ok33; ok33 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok34 := true; ok34; ok34 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok35 := true; ok35; ok35 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok36 := true; ok36; ok36 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok37 := true; ok37; ok37 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
			tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
			if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
				for ok38 := true; ok38; ok38 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
					if _objIndexCopy <= 255 {
						for ok39 := true; ok39; ok39 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok40 := true; ok40; ok40 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok41 := true; ok41; ok41 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok42 := true; ok42; ok42 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok43 := true; ok43; ok43 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok44 := true; ok44; ok44 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
			} else {
				(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 3*4))
				(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 3*8))
				XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
			}

			for ok45 := true; ok45; ok45 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(4)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(4)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(4)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(4))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LIST == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok46 := true; ok46; ok46 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 4
						}
						for ok47 := true; ok47; ok47 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}

	// Issue the error via 'returnImm error 0'.

	for ok48 := true; ok48; ok48 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_RETURN_IMM)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(TCL_ERROR))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_RETURN_IMM == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok49 := true; ok49; ok49 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_RETURN_IMM].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - TCL_ERROR
				}
				for ok50 := true; ok50; ok50 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok51 := true; ok51; ok51 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileExprCmd --
//
//	Procedure called to compile the "expr" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "expr" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileExprCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:2404:1: */
	var firstWordPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 1 {
		return TCL_ERROR
	}

	// TIP #280: Use the per-word line information of the current command.

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Floc+uintptr((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fnuloc-1)*24)).Fline + 1*4))

	firstWordPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	XTclCompileExprWords(tls, interp, firstWordPtr, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1, envPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileForCmd --
//
//	Procedure called to compile the "for" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "for" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileForCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:2449:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var startTokenPtr uintptr
	var testTokenPtr uintptr
	var nextTokenPtr uintptr
	var bodyTokenPtr uintptr
	// var jumpEvalCondFixup JumpFixup at bp, 16

	var bodyCodeOffset int32
	var nextCodeOffset int32
	var jumpDist int32
	var bodyRange int32
	var nextRange int32

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 5 {
		return TCL_ERROR
	}

	// If the test expression requires substitutions, don't compile the for
	// command inline. E.g., the expression might cause the loop to never
	// execute or execute forever, as in "for {} "$x > 5" {incr x} {}".

	startTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	testTokenPtr = startTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(startTokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(testTokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
		return TCL_ERROR
	}

	// Bail out also if the body or the next expression require substitutions
	// in order to insure correct behaviour [Bug 219166]

	nextTokenPtr = testTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(testTokenPtr)).FnumComponents+1)*24
	bodyTokenPtr = nextTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(nextTokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(nextTokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD ||
		(*Tcl_Token)(unsafe.Pointer(bodyTokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
		return TCL_ERROR
	}

	// Inline compile the initial command.

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclCompileCmdWord(tls, interp, startTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(startTokenPtr)).FnumComponents, envPtr)
	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Jump to the evaluation of the condition. This code uses the "loop
	// rotation" optimisation (which eliminates one branch from the loop).
	// "for start cond next body" produces then:
	//       start
	//       goto A
	//    B: body                : bodyCodeOffset
	//       next                : nextCodeOffset, continueOffset
	//    A: cond -> result      : testCodeOffset
	//       if (result) goto B

	XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp)

	// Compile the loop body.

	bodyRange = XTclCreateExceptRange(tls, LOOP_EXCEPTION_RANGE, envPtr)
	bodyCodeOffset = func() int32 {
		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
		(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
				return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
			}
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
		}()
		return libc.AssignPtrInt32((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(bodyRange)*28+8, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1))
	}()
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 4*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 4*8))
	XTclCompileCmdWord(tls, interp, bodyTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(bodyTokenPtr)).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(bodyRange)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(bodyRange)*28)).FcodeOffset))
	for ok3 := true; ok3; ok3 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok5 := true; ok5; ok5 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Compile the "next" subcommand. Note that this exception range will not
	// have a continueOffset (other than -1) connected to it; it won't trap
	// TCL_CONTINUE but rather just TCL_BREAK.

	nextRange = XTclCreateExceptRange(tls, LOOP_EXCEPTION_RANGE, envPtr)
	(*ExceptionAux)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(nextRange)*56)).FsupportsContinue = 0
	nextCodeOffset = func() int32 {
		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
		(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
				return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
			}
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
		}()
		return libc.AssignPtrInt32((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(nextRange)*28+8, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1))
	}()
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 3*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 3*8))
	XTclCompileCmdWord(tls, interp, nextTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(nextTokenPtr)).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(nextRange)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(nextRange)*28)).FcodeOffset))
	for ok6 := true; ok6; ok6 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Compile the test expression then emit the conditional jump that
	// terminates the for.

	if XTclFixupForwardJump(tls, envPtr, bp, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp)).FcodeOffset)), 127) != 0 {
		bodyCodeOffset = bodyCodeOffset + 3
		nextCodeOffset = nextCodeOffset + 3
	}

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
	XTclCompileExprWords(tls, interp, testTokenPtr, 1, envPtr)

	jumpDist = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(bodyCodeOffset))
	if jumpDist > 127 {
		for ok9 := true; ok9; ok9 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP_TRUE4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok10 := true; ok10; ok10 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP_TRUE4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - -jumpDist
					}
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok12 := true; ok12; ok12 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP_TRUE1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok13 := true; ok13; ok13 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - -jumpDist
					}
					for ok14 := true; ok14; ok14 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	// Fix the starting points of the exception ranges (may have moved due to
	// jump type modification) and set where the exceptions target.

	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(bodyRange)*28)).FcodeOffset = bodyCodeOffset
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(bodyRange)*28)).FcontinueOffset = nextCodeOffset

	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(nextRange)*28)).FcodeOffset = nextCodeOffset

	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(bodyRange)*28)).FbreakOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(nextRange)*28)).FbreakOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	XTclFinalizeLoopExceptionRange(tls, envPtr, bodyRange)
	XTclFinalizeLoopExceptionRange(tls, envPtr, nextRange)

	// The for command's result is an empty string.

	for ok15 := true; ok15; ok15 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok16 := true; ok16; ok16 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok17 := true; ok17; ok17 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok18 := true; ok18; ok18 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok19 := true; ok19; ok19 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok20 := true; ok20; ok20 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok21 := true; ok21; ok21 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileForeachCmd --
//
//	Procedure called to compile the "foreach" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "foreach" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileForeachCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:2598:1: */
	return sCompileEachloopCmd(tls, interp, parsePtr, cmdPtr, envPtr,
		TCL_EACH_KEEP_NONE)
}

//----------------------------------------------------------------------
//
// TclCompileLmapCmd --
//
//	Procedure called to compile the "lmap" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "lmap" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileLmapCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:2629:1: */
	return sCompileEachloopCmd(tls, interp, parsePtr, cmdPtr, envPtr,
		TCL_EACH_COLLECT)
}

//----------------------------------------------------------------------
//
// CompileEachloopCmd --
//
//	Procedure called to compile the "foreach" and "lmap" commands.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "foreach" command at
//	runtime.
//
//----------------------------------------------------------------------

func sCompileEachloopCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr, collect int32) int32 { /* tclCompCmds.c:2660:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var procPtr uintptr
	var infoPtr uintptr // Points to the structure describing this
	// foreach command. Stored in a AuxData
	// record in the ByteCode.

	var tokenPtr uintptr
	var bodyTokenPtr uintptr
	var jumpBackOffset int32
	var infoIndex int32
	var range1 int32
	var numWords int32
	var numLists int32
	var i int32
	var j int32
	var code int32
	var varListObj uintptr
	// var varNameObj uintptr at bp+8, 8

	var bytes uintptr
	// var numBytes int32 at bp+16, 4

	var varIndex int32
	var varListPtr uintptr
	// var numVars int32 at bp, 4

	var _delta int32
	var _delta1 int32
	var _delta2 int32
	var _objIndexCopy int32
	var _delta3 int32
	var _delta4 int32
	var _delta5 int32
	var _delta6 int32
	var _delta7 int32
	var _delta8 int32
	var _delta9 int32
	var _objIndexCopy1 int32
	var _objPtr uintptr
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	procPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr
	infoPtr = uintptr(0)
	code = TCL_OK
	varListObj = uintptr(0)

	// If the foreach command isn't in a procedure, don't compile it inline:
	// the payoff is too small.

	if !(procPtr == uintptr(0)) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	if !(numWords < 4 || numWords%2 != 0) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	// Bail out if the body requires substitutions in order to insure correct
	// behaviour. [Bug 219166]

	i = 0
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
__3:
	if !(i < numWords-1) {
		goto __5
	}
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	goto __4
__4:
	i++
	goto __3
	goto __5
__5:
	;
	bodyTokenPtr = tokenPtr
	if !((*Tcl_Token)(unsafe.Pointer(bodyTokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD) {
		goto __6
	}
	return TCL_ERROR
__6:
	;

	// Create and initialize the ForeachInfo and ForeachVarList data
	// structures describing this command. Then create a AuxData record
	// pointing to the ForeachInfo structure.

	numLists = (numWords - 2) / 2
	infoPtr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+16))+uint64(numLists)*uint64(unsafe.Sizeof(uintptr(0)))))
	(*ForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists = 0 // Count this up as we go

	// Parse each var list into sequence of var names.  Don't
	// compile the foreach inline if any var name needs substitutions or isn't
	// a scalar, or if any var list needs substitutions.

	varListObj = XTcl_NewObj(tls)
	i = 0
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
__7:
	if !(i < numWords-1) {
		goto __9
	}

	if !(i%2 != 1) {
		goto __10
	}
	goto __8
__10:
	;

	// If the variable list is empty, we can enter an infinite loop when
	// the interpreted version would not.  Take care to ensure this does
	// not happen.  [Bug 1671138]

	if !(!(XTclWordKnownAtCompileTime(tls, tokenPtr, varListObj) != 0) || TCL_OK != XTcl_ListObjLength(tls, uintptr(0), varListObj, bp) || *(*int32)(unsafe.Pointer(bp)) == 0) {
		goto __11
	}
	code = TCL_ERROR
	goto done
__11:
	;

	varListPtr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+4))+uint64(*(*int32)(unsafe.Pointer(bp)))*uint64(unsafe.Sizeof(int32(0)))))
	(*ForeachVarList)(unsafe.Pointer(varListPtr)).FnumVars = *(*int32)(unsafe.Pointer(bp /* numVars */))
	*(*uintptr)(unsafe.Pointer(infoPtr + 16 + uintptr(i/2)*8)) = varListPtr
	(*ForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists++

	j = 0
__12:
	if !(j < *(*int32)(unsafe.Pointer(bp))) {
		goto __14
	}

	XTcl_ListObjIndex(tls, uintptr(0), varListObj, j, bp+8)
	bytes = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* varNameObj */)), bp+16)
	varIndex = XTclLocalScalar(tls, bytes, *(*int32)(unsafe.Pointer(bp + 16 /* numBytes */)), envPtr)
	if !(varIndex < 0) {
		goto __15
	}
	code = TCL_ERROR
	goto done
__15:
	;
	*(*int32)(unsafe.Pointer(varListPtr + 4 + uintptr(j)*4)) = varIndex
	goto __13
__13:
	j++
	goto __12
	goto __14
__14:
	;
	XTcl_SetObjLength(tls, varListObj, 0)
	goto __8
__8:
	i++
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	goto __7
	goto __9
__9:
	;

	// We will compile the foreach command.

	infoIndex = XTclCreateAuxData(tls, infoPtr, uintptr(unsafe.Pointer(&newForeachInfoType)), envPtr)

	// Create the collecting object, unshared.

	if !(collect == TCL_EACH_COLLECT) {
		goto __16
	}
__17:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __20
	}
	XTclExpandCodeArray(tls, envPtr)
__20:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __21
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST == INST_START_CMD {
			return 1
		}
		return 0
	}()
__21:
	;
__22:
	_delta = XtclInstructionTable[INST_LIST].FstackEffect
	if !(_delta != 0) {
		goto __25
	}
	if !(_delta == -0x7fffffff-1) {
		goto __26
	}
	_delta = 1 - 0
__26:
	;
__27:
	if !(_delta < 0) {
		goto __30
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __31
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__31:
	;
__30:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __28
__28:
	if 0 != 0 {
		goto __27
	}
	goto __29
__29:
	;
__25:
	;
	goto __23
__23:
	if 0 != 0 {
		goto __22
	}
	goto __24
__24:
	;
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
__16:
	;

	// Evaluate each value list and leave it on stack.

	i = 0
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
__32:
	if !(i < numWords-1) {
		goto __34
	}
	if !(i%2 == 0 && i > 0) {
		goto __35
	}
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __36
	}
__38:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __41
	}
__43:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __46
	}
	XTclExpandCodeArray(tls, envPtr)
__46:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __47
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__47:
	;
__48:
	_delta1 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta1 != 0) {
		goto __51
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __52
	}
	_delta1 = 1 - _objIndexCopy
__52:
	;
__53:
	if !(_delta1 < 0) {
		goto __56
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __57
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__57:
	;
__56:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
__51:
	;
	goto __49
__49:
	if 0 != 0 {
		goto __48
	}
	goto __50
__50:
	;
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;
	goto __42
__41:
__58:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __61
	}
	XTclExpandCodeArray(tls, envPtr)
__61:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __62
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__62:
	;
__63:
	_delta2 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta2 != 0) {
		goto __66
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __67
	}
	_delta2 = 1 - _objIndexCopy
__67:
	;
__68:
	if !(_delta2 < 0) {
		goto __71
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __72
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__72:
	;
__71:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __69
__69:
	if 0 != 0 {
		goto __68
	}
	goto __70
__70:
	;
__66:
	;
	goto __64
__64:
	if 0 != 0 {
		goto __63
	}
	goto __65
__65:
	;
	goto __59
__59:
	if 0 != 0 {
		goto __58
	}
	goto __60
__60:
	;
__42:
	;
	goto __39
__39:
	if 0 != 0 {
		goto __38
	}
	goto __40
__40:
	;
	goto __37
__36:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__37:
	;

__35:
	;
	goto __33
__33:
	i++
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	goto __32
	goto __34
__34:
	;

__73:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __76
	}
	XTclExpandCodeArray(tls, envPtr)
__76:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_FOREACH_START)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __77
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_FOREACH_START == INST_START_CMD {
			return 1
		}
		return 0
	}()
__77:
	;
__78:
	_delta3 = XtclInstructionTable[INST_FOREACH_START].FstackEffect
	if !(_delta3 != 0) {
		goto __81
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __82
	}
	_delta3 = 1 - infoIndex
__82:
	;
__83:
	if !(_delta3 < 0) {
		goto __86
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __87
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__87:
	;
__86:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __84
__84:
	if 0 != 0 {
		goto __83
	}
	goto __85
__85:
	;
__81:
	;
	goto __79
__79:
	if 0 != 0 {
		goto __78
	}
	goto __80
__80:
	;
	goto __74
__74:
	if 0 != 0 {
		goto __73
	}
	goto __75
__75:
	;

	// Inline compile the loop body.

	range1 = XTclCreateExceptRange(tls, LOOP_EXCEPTION_RANGE, envPtr)

	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(numWords-1)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(numWords-1)*8))
	XTclCompileCmdWord(tls, interp, bodyTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(bodyTokenPtr)).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))

	if !(collect == TCL_EACH_COLLECT) {
		goto __88
	}
__90:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __93
	}
	XTclExpandCodeArray(tls, envPtr)
__93:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LMAP_COLLECT)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __94
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LMAP_COLLECT == INST_START_CMD {
			return 1
		}
		return 0
	}()
__94:
	;
__95:
	_delta4 = XtclInstructionTable[INST_LMAP_COLLECT].FstackEffect
	if !(_delta4 != 0) {
		goto __98
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __99
	}
	_delta4 = 1 - 0
__99:
	;
__100:
	if !(_delta4 < 0) {
		goto __103
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __104
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__104:
	;
__103:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __101
__101:
	if 0 != 0 {
		goto __100
	}
	goto __102
__102:
	;
__98:
	;
	goto __96
__96:
	if 0 != 0 {
		goto __95
	}
	goto __97
__97:
	;
	goto __91
__91:
	if 0 != 0 {
		goto __90
	}
	goto __92
__92:
	;
	goto __89
__88:
__105:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __108
	}
	XTclExpandCodeArray(tls, envPtr)
__108:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __109
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__109:
	;
__110:
	_delta5 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta5 != 0) {
		goto __113
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __114
	}
	_delta5 = 1 - 0
__114:
	;
__115:
	if !(_delta5 < 0) {
		goto __118
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __119
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__119:
	;
__118:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __116
__116:
	if 0 != 0 {
		goto __115
	}
	goto __117
__117:
	;
__113:
	;
	goto __111
__111:
	if 0 != 0 {
		goto __110
	}
	goto __112
__112:
	;
	goto __106
__106:
	if 0 != 0 {
		goto __105
	}
	goto __107
__107:
	;
__89:
	;

	// Bottom of loop code: assign each loop variable and check whether
	// to terminate the loop. Set the loop's break target.

	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcontinueOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__120:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __123
	}
	XTclExpandCodeArray(tls, envPtr)
__123:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_FOREACH_STEP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __124
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_FOREACH_STEP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__124:
	;
__125:
	_delta6 = XtclInstructionTable[INST_FOREACH_STEP].FstackEffect
	if !(_delta6 != 0) {
		goto __128
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __129
	}
	_delta6 = 1 - 0
__129:
	;
__130:
	if !(_delta6 < 0) {
		goto __133
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __134
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__134:
	;
__133:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __131
__131:
	if 0 != 0 {
		goto __130
	}
	goto __132
__132:
	;
__128:
	;
	goto __126
__126:
	if 0 != 0 {
		goto __125
	}
	goto __127
__127:
	;
	goto __121
__121:
	if 0 != 0 {
		goto __120
	}
	goto __122
__122:
	;
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FbreakOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	XTclFinalizeLoopExceptionRange(tls, envPtr, range1)
__135:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __138
	}
	XTclExpandCodeArray(tls, envPtr)
__138:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_FOREACH_END)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __139
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_FOREACH_END == INST_START_CMD {
			return 1
		}
		return 0
	}()
__139:
	;
__140:
	_delta7 = XtclInstructionTable[INST_FOREACH_END].FstackEffect
	if !(_delta7 != 0) {
		goto __143
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __144
	}
	_delta7 = 1 - 0
__144:
	;
__145:
	if !(_delta7 < 0) {
		goto __148
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __149
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__149:
	;
__148:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __146
__146:
	if 0 != 0 {
		goto __145
	}
	goto __147
__147:
	;
__143:
	;
	goto __141
__141:
	if 0 != 0 {
		goto __140
	}
	goto __142
__142:
	;
	goto __136
__136:
	if 0 != 0 {
		goto __135
	}
	goto __137
__137:
	;
__150:
	if !(-(numLists + 2) < 0) {
		goto __153
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __154
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__154:
	;
__153:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += -(numLists + 2)
	goto __151
__151:
	if 0 != 0 {
		goto __150
	}
	goto __152
__152:
	;

	// Set the jumpback distance from INST_FOREACH_STEP to the start of the
	// body's code. Misuse loopCtTemp for storing the jump size.

	jumpBackOffset = (*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcontinueOffset - (*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset
	(*ForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp = -jumpBackOffset

	// The command's result is an empty string if not collecting. If
	// collecting, it is automatically left on stack after FOREACH_END.

	if !(collect != TCL_EACH_COLLECT) {
		goto __155
	}
__156:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy1 <= 255) {
		goto __159
	}
__161:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __164
	}
	XTclExpandCodeArray(tls, envPtr)
__164:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __165
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__165:
	;
__166:
	_delta8 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta8 != 0) {
		goto __169
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __170
	}
	_delta8 = 1 - _objIndexCopy1
__170:
	;
__171:
	if !(_delta8 < 0) {
		goto __174
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __175
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__175:
	;
__174:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __172
__172:
	if 0 != 0 {
		goto __171
	}
	goto __173
__173:
	;
__169:
	;
	goto __167
__167:
	if 0 != 0 {
		goto __166
	}
	goto __168
__168:
	;
	goto __162
__162:
	if 0 != 0 {
		goto __161
	}
	goto __163
__163:
	;
	goto __160
__159:
__176:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __179
	}
	XTclExpandCodeArray(tls, envPtr)
__179:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __180
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__180:
	;
__181:
	_delta9 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta9 != 0) {
		goto __184
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __185
	}
	_delta9 = 1 - _objIndexCopy1
__185:
	;
__186:
	if !(_delta9 < 0) {
		goto __189
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __190
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__190:
	;
__189:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __187
__187:
	if 0 != 0 {
		goto __186
	}
	goto __188
__188:
	;
__184:
	;
	goto __182
__182:
	if 0 != 0 {
		goto __181
	}
	goto __183
__183:
	;
	goto __177
__177:
	if 0 != 0 {
		goto __176
	}
	goto __178
__178:
	;
__160:
	;
	goto __157
__157:
	if 0 != 0 {
		goto __156
	}
	goto __158
__158:
	;
__155:
	;

done:
	if !(code == TCL_ERROR) {
		goto __191
	}
	sFreeForeachInfo(tls, infoPtr)
__191:
	;
__192:
	_objPtr = varListObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __195
	}
	XTclFreeObj(tls, _objPtr)
__195:
	;
	goto __193
__193:
	if 0 != 0 {
		goto __192
	}
	goto __194
__194:
	;
	return code
}

//----------------------------------------------------------------------
//
// DupForeachInfo --
//
//	This procedure duplicates a ForeachInfo structure created as auxiliary
//	data during the compilation of a foreach command.
//
// Results:
//	A pointer to a newly allocated copy of the existing ForeachInfo
//	structure is returned.
//
// Side effects:
//	Storage for the copied ForeachInfo record is allocated. If the
//	original ForeachInfo structure pointed to any ForeachVarList records,
//	these structures are also copied and pointers to them are stored in
//	the new ForeachInfo record.
//
//----------------------------------------------------------------------

func sDupForeachInfo(tls *libc.TLS, clientData ClientData) ClientData { /* tclCompCmds.c:2876:1: */
	var srcPtr uintptr = clientData
	var dupPtr uintptr
	var srcListPtr uintptr
	var dupListPtr uintptr
	var numVars int32
	var i int32
	var j int32
	var numLists int32 = (*ForeachInfo)(unsafe.Pointer(srcPtr)).FnumLists

	dupPtr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+16))+uint64(numLists)*uint64(unsafe.Sizeof(uintptr(0)))))
	(*ForeachInfo)(unsafe.Pointer(dupPtr)).FnumLists = numLists
	(*ForeachInfo)(unsafe.Pointer(dupPtr)).FfirstValueTemp = (*ForeachInfo)(unsafe.Pointer(srcPtr)).FfirstValueTemp
	(*ForeachInfo)(unsafe.Pointer(dupPtr)).FloopCtTemp = (*ForeachInfo)(unsafe.Pointer(srcPtr)).FloopCtTemp

	for i = 0; i < numLists; i++ {
		srcListPtr = *(*uintptr)(unsafe.Pointer(srcPtr + 16 + uintptr(i)*8))
		numVars = (*ForeachVarList)(unsafe.Pointer(srcListPtr)).FnumVars
		dupListPtr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+4))+uint64(numVars)*uint64(unsafe.Sizeof(int32(0)))))
		(*ForeachVarList)(unsafe.Pointer(dupListPtr)).FnumVars = numVars
		for j = 0; j < numVars; j++ {
			*(*int32)(unsafe.Pointer(dupListPtr + 4 + uintptr(j)*4)) = *(*int32)(unsafe.Pointer(srcListPtr + 4 + uintptr(j)*4))
		}
		*(*uintptr)(unsafe.Pointer(dupPtr + 16 + uintptr(i)*8)) = dupListPtr
	}
	return dupPtr
}

//----------------------------------------------------------------------
//
// FreeForeachInfo --
//
//	Procedure to free a ForeachInfo structure created as auxiliary data
//	during the compilation of a foreach command.
//
// Results:
//	None.
//
// Side effects:
//	Storage for the ForeachInfo structure pointed to by the ClientData
//	argument is freed as is any ForeachVarList record pointed to by the
//	ForeachInfo structure.
//
//----------------------------------------------------------------------

func sFreeForeachInfo(tls *libc.TLS, clientData ClientData) { /* tclCompCmds.c:2925:1: */
	var infoPtr uintptr = clientData
	var listPtr uintptr
	var numLists int32 = (*ForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists
	var i int32

	for i = 0; i < numLists; i++ {
		listPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 16 + uintptr(i)*8))
		XTclpFree(tls, listPtr)
	}
	XTclpFree(tls, infoPtr)
}

//----------------------------------------------------------------------
//
// PrintForeachInfo, DisassembleForeachInfo --
//
//	Functions to write a human-readable or script-readablerepresentation
//	of a ForeachInfo structure to a Tcl_Obj for debugging.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPrintForeachInfo(tls *libc.TLS, clientData ClientData, appendObj uintptr, codePtr uintptr, pcOffset uint32) { /* tclCompCmds.c:2959:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var infoPtr uintptr = clientData
	var varsPtr uintptr
	var i int32
	var j int32

	XTcl_AppendToObj(tls, appendObj, ts+18568, -1)

	for i = 0; i < (*ForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists; i++ {
		if i != 0 {
			XTcl_AppendToObj(tls, appendObj, ts+18549, -1)
		}
		XTcl_AppendPrintfToObj(tls, appendObj, ts+18552,
			libc.VaList(bp, uint32((*ForeachInfo)(unsafe.Pointer(infoPtr)).FfirstValueTemp+i)))
	}
	XTcl_AppendPrintfToObj(tls, appendObj, ts+18575,
		libc.VaList(bp+8, uint32((*ForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp)))
	for i = 0; i < (*ForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists; i++ {
		if i != 0 {
			XTcl_AppendToObj(tls, appendObj, ts+18589, -1)
		}
		XTcl_AppendPrintfToObj(tls, appendObj, ts+18591,
			libc.VaList(bp+16, uint32((*ForeachInfo)(unsafe.Pointer(infoPtr)).FfirstValueTemp+i)))
		varsPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 16 + uintptr(i)*8))
		for j = 0; j < (*ForeachVarList)(unsafe.Pointer(varsPtr)).FnumVars; j++ {
			if j != 0 {
				XTcl_AppendToObj(tls, appendObj, ts+18549, -1)
			}
			XTcl_AppendPrintfToObj(tls, appendObj, ts+18552,
				libc.VaList(bp+24, uint32(*(*int32)(unsafe.Pointer(varsPtr + 4 + uintptr(j)*4)))))
		}
		XTcl_AppendToObj(tls, appendObj, ts+18605, -1)
	}
}

func sPrintNewForeachInfo(tls *libc.TLS, clientData ClientData, appendObj uintptr, codePtr uintptr, pcOffset uint32) { /* tclCompCmds.c:2999:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var infoPtr uintptr = clientData
	var varsPtr uintptr
	var i int32
	var j int32

	XTcl_AppendPrintfToObj(tls, appendObj, ts+18607,
		libc.VaList(bp, (*ForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp))
	for i = 0; i < (*ForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists; i++ {
		if i != 0 {
			XTcl_AppendToObj(tls, appendObj, ts+18589, -1)
		}
		XTcl_AppendToObj(tls, appendObj, ts+18629, -1)
		varsPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 16 + uintptr(i)*8))
		for j = 0; j < (*ForeachVarList)(unsafe.Pointer(varsPtr)).FnumVars; j++ {
			if j != 0 {
				XTcl_AppendToObj(tls, appendObj, ts+18589, -1)
			}
			XTcl_AppendPrintfToObj(tls, appendObj, ts+18552,
				libc.VaList(bp+8, uint32(*(*int32)(unsafe.Pointer(varsPtr + 4 + uintptr(j)*4)))))
		}
		XTcl_AppendToObj(tls, appendObj, ts+18605, -1)
	}
}

func sDisassembleForeachInfo(tls *libc.TLS, clientData ClientData, dictObj uintptr, codePtr uintptr, pcOffset uint32) { /* tclCompCmds.c:3029:1: */
	var infoPtr uintptr = clientData
	var varsPtr uintptr
	var i int32
	var j int32
	var objPtr uintptr
	var innerPtr uintptr

	// Data stores.

	objPtr = XTcl_NewObj(tls)
	for i = 0; i < (*ForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists; i++ {
		XTcl_ListObjAppendElement(tls, uintptr(0), objPtr,
			XTcl_NewIntObj(tls, (*ForeachInfo)(unsafe.Pointer(infoPtr)).FfirstValueTemp+i))
	}
	XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+9924, -1), objPtr)

	// Loop counter.

	XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+18631, -1),
		XTcl_NewIntObj(tls, (*ForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp))

	// Assignment targets.

	objPtr = XTcl_NewObj(tls)
	for i = 0; i < (*ForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists; i++ {
		innerPtr = XTcl_NewObj(tls)
		varsPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 16 + uintptr(i)*8))
		for j = 0; j < (*ForeachVarList)(unsafe.Pointer(varsPtr)).FnumVars; j++ {
			XTcl_ListObjAppendElement(tls, uintptr(0), innerPtr,
				XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(varsPtr + 4 + uintptr(j)*4))))
		}
		XTcl_ListObjAppendElement(tls, uintptr(0), objPtr, innerPtr)
	}
	XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+18636, -1), objPtr)
}

func sDisassembleNewForeachInfo(tls *libc.TLS, clientData ClientData, dictObj uintptr, codePtr uintptr, pcOffset uint32) { /* tclCompCmds.c:3076:1: */
	var infoPtr uintptr = clientData
	var varsPtr uintptr
	var i int32
	var j int32
	var objPtr uintptr
	var innerPtr uintptr

	// Jump offset.

	XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+18643, -1),
		XTcl_NewIntObj(tls, (*ForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp))

	// Assignment targets.

	objPtr = XTcl_NewObj(tls)
	for i = 0; i < (*ForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists; i++ {
		innerPtr = XTcl_NewObj(tls)
		varsPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 16 + uintptr(i)*8))
		for j = 0; j < (*ForeachVarList)(unsafe.Pointer(varsPtr)).FnumVars; j++ {
			XTcl_ListObjAppendElement(tls, uintptr(0), innerPtr,
				XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(varsPtr + 4 + uintptr(j)*4))))
		}
		XTcl_ListObjAppendElement(tls, uintptr(0), objPtr, innerPtr)
	}
	XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+18636, -1), objPtr)
}

//----------------------------------------------------------------------
//
// TclCompileFormatCmd --
//
//	Procedure called to compile the "format" command. Handles cases that
//	can be done as constants or simple string concatenation only.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "format" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileFormatCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:3131:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var tokenPtr uintptr
	var objv uintptr
	var formatObj uintptr
	var tmpObj uintptr
	var bytes uintptr
	var start uintptr
	var i int32
	var j int32
	// var len int32 at bp, 4

	var _objPtr uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _objPtr3 uintptr
	var _objPtr4 uintptr
	var _objPtr5 uintptr
	var _objPtr6 uintptr
	var _delta2 int32
	var _delta3 int32
	var _objIndexCopy1 int32
	var _objPtr7 uintptr
	var _delta4 int32
	var _delta5 int32
	var _objIndexCopy2 int32
	var b uintptr
	var _delta6 int32
	var _delta7 int32
	var _objIndexCopy3 int32
	var _objPtr8 uintptr
	var _objPtr9 uintptr
	var _delta8 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr

	// Don't handle any guaranteed-error cases.

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 2) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	// Check if the argument words are all compile-time-known literals; that's
	// a case we can handle by compiling to a constant.

	formatObj = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(formatObj)).FrefCount++
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if !!(XTclWordKnownAtCompileTime(tls, tokenPtr, formatObj) != 0) {
		goto __2
	}
__3:
	_objPtr = formatObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __6
	}
	XTclFreeObj(tls, _objPtr)
__6:
	;
	goto __4
__4:
	if 0 != 0 {
		goto __3
	}
	goto __5
__5:
	;
	return TCL_ERROR
__2:
	;

	objv = XTcl_Alloc(tls, uint32(uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2)*uint64(unsafe.Sizeof(uintptr(0)))))
	i = 0
__7:
	if !(i+2 < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) {
		goto __9
	}
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FrefCount++
	if !!(XTclWordKnownAtCompileTime(tls, tokenPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) != 0) {
		goto __10
	}
	goto checkForStringConcatCase
__10:
	;
	goto __8
__8:
	i++
	goto __7
	goto __9
__9:
	;

	// Everything is a literal, so the result is constant too (or an error if
	// the format is broken). Do the format now.

	tmpObj = XTcl_Format(tls, interp, XTcl_GetString(tls, formatObj),
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2, objv)
__11:
	if !(libc.PreDecInt32(&i, 1) >= 0) {
		goto __13
	}
__14:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __17
	}
	XTclFreeObj(tls, _objPtr1)
__17:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	goto __12
__12:
	;
	goto __11
	goto __13
__13:
	;
	XTclpFree(tls, objv)
__18:
	_objPtr2 = formatObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __21
	}
	XTclFreeObj(tls, _objPtr2)
__21:
	;
	goto __19
__19:
	if 0 != 0 {
		goto __18
	}
	goto __20
__20:
	;
	if !(tmpObj == uintptr(0)) {
		goto __22
	}
	XTclCompileSyntaxError(tls, interp, envPtr)
	return TCL_OK
__22:
	;

	// Not an error, always a constant result, so just push the result as a
	// literal. Job done.

	bytes = XTcl_GetStringFromObj(tls, tmpObj, bp)
__23:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp)), 0)
	if !(_objIndexCopy <= 255) {
		goto __26
	}
__28:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __31
	}
	XTclExpandCodeArray(tls, envPtr)
__31:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __32
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__32:
	;
__33:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __36
	}
	if !(_delta == -0x7fffffff-1) {
		goto __37
	}
	_delta = 1 - _objIndexCopy
__37:
	;
__38:
	if !(_delta < 0) {
		goto __41
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __42
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__42:
	;
__41:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __39
__39:
	if 0 != 0 {
		goto __38
	}
	goto __40
__40:
	;
__36:
	;
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	goto __27
__26:
__43:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __46
	}
	XTclExpandCodeArray(tls, envPtr)
__46:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __47
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__47:
	;
__48:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __51
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __52
	}
	_delta1 = 1 - _objIndexCopy
__52:
	;
__53:
	if !(_delta1 < 0) {
		goto __56
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __57
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__57:
	;
__56:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
__51:
	;
	goto __49
__49:
	if 0 != 0 {
		goto __48
	}
	goto __50
__50:
	;
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;
__27:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
__58:
	_objPtr3 = tmpObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __61
	}
	XTclFreeObj(tls, _objPtr3)
__61:
	;
	goto __59
__59:
	if 0 != 0 {
		goto __58
	}
	goto __60
__60:
	;
	return TCL_OK

checkForStringConcatCase:
	// See if we can generate a sequence of things to concatenate. This
	// requires that all the % sequences be %s or %%, as everything else is
	// sufficiently complex that we don't bother.
	//
	// First, get the state of the system relatively sensible (cleaning up
	// after our attempt to spot a literal).

	;
__62:
	if !(i >= 0) {
		goto __64
	}
__65:
	_objPtr4 = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __68
	}
	XTclFreeObj(tls, _objPtr4)
__68:
	;
	goto __66
__66:
	if 0 != 0 {
		goto __65
	}
	goto __67
__67:
	;
	goto __63
__63:
	i--
	goto __62
	goto __64
__64:
	;
	XTclpFree(tls, objv)
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	i = 0

	// Now scan through and check for non-%s and non-%% substitutions.

	bytes = XTcl_GetString(tls, formatObj)
__69:
	if !(*(*int8)(unsafe.Pointer(bytes)) != 0) {
		goto __71
	}
	if !(int32(*(*int8)(unsafe.Pointer(bytes))) == '%') {
		goto __72
	}
	bytes++
	if !(int32(*(*int8)(unsafe.Pointer(bytes))) == 's') {
		goto __73
	}
	i++
	goto __70
	goto __74
__73:
	if !(int32(*(*int8)(unsafe.Pointer(bytes))) == '%') {
		goto __75
	}
	goto __70
__75:
	;
__74:
	;
__76:
	_objPtr5 = formatObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __79
	}
	XTclFreeObj(tls, _objPtr5)
__79:
	;
	goto __77
__77:
	if 0 != 0 {
		goto __76
	}
	goto __78
__78:
	;
	return TCL_ERROR
__72:
	;
	goto __70
__70:
	bytes++
	goto __69
	goto __71
__71:
	;

	// Check if the number of things to concatenate will fit in a byte.

	if !(i+2 != (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords || i > 125) {
		goto __80
	}
__81:
	_objPtr6 = formatObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr6)).FrefCount, 1) <= 1) {
		goto __84
	}
	XTclFreeObj(tls, _objPtr6)
__84:
	;
	goto __82
__82:
	if 0 != 0 {
		goto __81
	}
	goto __83
__83:
	;
	return TCL_ERROR
__80:
	;

	// Generate the pushes of the things to concatenate, a sequence of
	// literals and compiled tokens (of which at least one is non-literal or
	// we'd have the case in the first half of this function) which we will
	// concatenate.

	i = 0 // The count of things to concat.
	j = 2 // The index into the argument tokens, for
	// TIP#280 handling.
	start = XTcl_GetString(tls, formatObj)
	// The start of the currently-scanned literal
	// in the format string.
	tmpObj = XTcl_NewObj(tls) // The buffer used to accumulate the literal
	// being built.
	bytes = start
__85:
	if !(*(*int8)(unsafe.Pointer(bytes)) != 0) {
		goto __87
	}
	if !(int32(*(*int8)(unsafe.Pointer(bytes))) == '%') {
		goto __88
	}
	XTcl_AppendToObj(tls, tmpObj, start, int32((int64(bytes)-int64(start))/1))
	if !(int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&bytes, 1)))) == '%') {
		goto __89
	}
	XTcl_AppendToObj(tls, tmpObj, ts+5719, 1)
	goto __90
__89:
	b = XTcl_GetStringFromObj(tls, tmpObj, bp)

	// If there is a non-empty literal from the format string,
	// push it and reset.

	if !(*(*int32)(unsafe.Pointer(bp)) > 0) {
		goto __91
	}
__92:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, b, *(*int32)(unsafe.Pointer(bp)), 0)
	if !(_objIndexCopy1 <= 255) {
		goto __95
	}
__97:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __100
	}
	XTclExpandCodeArray(tls, envPtr)
__100:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __101
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__101:
	;
__102:
	_delta2 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta2 != 0) {
		goto __105
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __106
	}
	_delta2 = 1 - _objIndexCopy1
__106:
	;
__107:
	if !(_delta2 < 0) {
		goto __110
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __111
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__111:
	;
__110:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __108
__108:
	if 0 != 0 {
		goto __107
	}
	goto __109
__109:
	;
__105:
	;
	goto __103
__103:
	if 0 != 0 {
		goto __102
	}
	goto __104
__104:
	;
	goto __98
__98:
	if 0 != 0 {
		goto __97
	}
	goto __99
__99:
	;
	goto __96
__95:
__112:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __115
	}
	XTclExpandCodeArray(tls, envPtr)
__115:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __116
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__116:
	;
__117:
	_delta3 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta3 != 0) {
		goto __120
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __121
	}
	_delta3 = 1 - _objIndexCopy1
__121:
	;
__122:
	if !(_delta3 < 0) {
		goto __125
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __126
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__126:
	;
__125:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __123
__123:
	if 0 != 0 {
		goto __122
	}
	goto __124
__124:
	;
__120:
	;
	goto __118
__118:
	if 0 != 0 {
		goto __117
	}
	goto __119
__119:
	;
	goto __113
__113:
	if 0 != 0 {
		goto __112
	}
	goto __114
__114:
	;
__96:
	;
	goto __93
__93:
	if 0 != 0 {
		goto __92
	}
	goto __94
__94:
	;
__127:
	_objPtr7 = tmpObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr7)).FrefCount, 1) <= 1) {
		goto __130
	}
	XTclFreeObj(tls, _objPtr7)
__130:
	;
	goto __128
__128:
	if 0 != 0 {
		goto __127
	}
	goto __129
__129:
	;
	tmpObj = XTcl_NewObj(tls)
	i++
__91:
	;

	// Push the code to produce the string that would be
	// substituted with %s, except we'll be concatenating
	// directly.

	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __131
	}
__133:
	_objIndexCopy2 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy2 <= 255) {
		goto __136
	}
__138:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __141
	}
	XTclExpandCodeArray(tls, envPtr)
__141:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __142
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__142:
	;
__143:
	_delta4 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta4 != 0) {
		goto __146
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __147
	}
	_delta4 = 1 - _objIndexCopy2
__147:
	;
__148:
	if !(_delta4 < 0) {
		goto __151
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __152
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__152:
	;
__151:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __149
__149:
	if 0 != 0 {
		goto __148
	}
	goto __150
__150:
	;
__146:
	;
	goto __144
__144:
	if 0 != 0 {
		goto __143
	}
	goto __145
__145:
	;
	goto __139
__139:
	if 0 != 0 {
		goto __138
	}
	goto __140
__140:
	;
	goto __137
__136:
__153:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __156
	}
	XTclExpandCodeArray(tls, envPtr)
__156:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __157
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__157:
	;
__158:
	_delta5 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta5 != 0) {
		goto __161
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __162
	}
	_delta5 = 1 - _objIndexCopy2
__162:
	;
__163:
	if !(_delta5 < 0) {
		goto __166
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __167
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__167:
	;
__166:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __164
__164:
	if 0 != 0 {
		goto __163
	}
	goto __165
__165:
	;
__161:
	;
	goto __159
__159:
	if 0 != 0 {
		goto __158
	}
	goto __160
__160:
	;
	goto __154
__154:
	if 0 != 0 {
		goto __153
	}
	goto __155
__155:
	;
__137:
	;
	goto __134
__134:
	if 0 != 0 {
		goto __133
	}
	goto __135
__135:
	;
	goto __132
__131:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(j)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(j)*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__132:
	;

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	j++
	i++
__90:
	;
	start = bytes + uintptr(1)
__88:
	;
	goto __86
__86:
	bytes++
	goto __85
	goto __87
__87:
	;

	// Handle the case of a trailing literal.

	XTcl_AppendToObj(tls, tmpObj, start, int32((int64(bytes)-int64(start))/1))
	bytes = XTcl_GetStringFromObj(tls, tmpObj, bp)
	if !(*(*int32)(unsafe.Pointer(bp)) > 0) {
		goto __168
	}
__169:
	_objIndexCopy3 = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp)), 0)
	if !(_objIndexCopy3 <= 255) {
		goto __172
	}
__174:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __177
	}
	XTclExpandCodeArray(tls, envPtr)
__177:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __178
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__178:
	;
__179:
	_delta6 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta6 != 0) {
		goto __182
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __183
	}
	_delta6 = 1 - _objIndexCopy3
__183:
	;
__184:
	if !(_delta6 < 0) {
		goto __187
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __188
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__188:
	;
__187:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __185
__185:
	if 0 != 0 {
		goto __184
	}
	goto __186
__186:
	;
__182:
	;
	goto __180
__180:
	if 0 != 0 {
		goto __179
	}
	goto __181
__181:
	;
	goto __175
__175:
	if 0 != 0 {
		goto __174
	}
	goto __176
__176:
	;
	goto __173
__172:
__189:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __192
	}
	XTclExpandCodeArray(tls, envPtr)
__192:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __193
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__193:
	;
__194:
	_delta7 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta7 != 0) {
		goto __197
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __198
	}
	_delta7 = 1 - _objIndexCopy3
__198:
	;
__199:
	if !(_delta7 < 0) {
		goto __202
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __203
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__203:
	;
__202:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __200
__200:
	if 0 != 0 {
		goto __199
	}
	goto __201
__201:
	;
__197:
	;
	goto __195
__195:
	if 0 != 0 {
		goto __194
	}
	goto __196
__196:
	;
	goto __190
__190:
	if 0 != 0 {
		goto __189
	}
	goto __191
__191:
	;
__173:
	;
	goto __170
__170:
	if 0 != 0 {
		goto __169
	}
	goto __171
__171:
	;
	i++
__168:
	;
__204:
	_objPtr8 = tmpObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr8)).FrefCount, 1) <= 1) {
		goto __207
	}
	XTclFreeObj(tls, _objPtr8)
__207:
	;
	goto __205
__205:
	if 0 != 0 {
		goto __204
	}
	goto __206
__206:
	;
__208:
	_objPtr9 = formatObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr9)).FrefCount, 1) <= 1) {
		goto __211
	}
	XTclFreeObj(tls, _objPtr9)
__211:
	;
	goto __209
__209:
	if 0 != 0 {
		goto __208
	}
	goto __210
__210:
	;

	if !(i > 1) {
		goto __212
	}
	// Do the concatenation, which produces the result.

__213:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __216
	}
	XTclExpandCodeArray(tls, envPtr)
__216:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __217
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_CONCAT1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__217:
	;
__218:
	_delta8 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
	if !(_delta8 != 0) {
		goto __221
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __222
	}
	_delta8 = 1 - i
__222:
	;
__223:
	if !(_delta8 < 0) {
		goto __226
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __227
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__227:
	;
__226:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __224
__224:
	if 0 != 0 {
		goto __223
	}
	goto __225
__225:
	;
__221:
	;
	goto __219
__219:
	if 0 != 0 {
		goto __218
	}
	goto __220
__220:
	;
	goto __214
__214:
	if 0 != 0 {
		goto __213
	}
	goto __215
__215:
	;
__212:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclLocalScalarFromToken --
//
//	Get the index into the table of compiled locals that corresponds
//	to a local scalar variable name.
//
// Results:
// 	Returns the non-negative integer index value into the table of
// 	compiled locals corresponding to a local scalar variable name.
// 	If the arguments passed in do not identify a local scalar variable
// 	then return -1.
//
// Side effects:
//	May add an entery into the table of compiled locals.
//
//----------------------------------------------------------------------

func XTclLocalScalarFromToken(tls *libc.TLS, tokenPtr uintptr, envPtr uintptr) int32 { /* tclCompCmds.c:3342:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var isScalar int32 at bp+4, 4

	// var index int32 at bp, 4

	XTclPushVarName(tls, uintptr(0), tokenPtr, envPtr, TCL_NO_ELEMENT, bp, bp+4)
	if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
		*(*int32)(unsafe.Pointer(bp /* index */)) = -1
	}
	return *(*int32)(unsafe.Pointer(bp /* index */))
}

func XTclLocalScalar(tls *libc.TLS, bytes uintptr, numBytes int32, envPtr uintptr) int32 { /* tclCompCmds.c:3356:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	*(*[2]Tcl_Token)(unsafe.Pointer(bp /* token */)) = [2]Tcl_Token{{Ftype: TCL_TOKEN_SIMPLE_WORD, FnumComponents: 1},
		{Ftype: TCL_TOKEN_TEXT}}

	(*Tcl_Token)(unsafe.Pointer(bp + 1*24)).Fstart = bytes
	(*Tcl_Token)(unsafe.Pointer(bp + 1*24)).Fsize = numBytes
	return XTclLocalScalarFromToken(tls, bp, envPtr)
}

//----------------------------------------------------------------------
//
// TclPushVarName --
//
//	Procedure used in the compiling where pushing a variable name is
//	necessary (append, lappend, set).
//
// Results:
//	The values written to *localIndexPtr and *isScalarPtr signal to
//	the caller what the instructions emitted by this routine will do:
//
//	*isScalarPtr	(*localIndexPtr < 0)
//	1		1	Push the varname on the stack. (Stack +1)
//	1		0	*localIndexPtr is the index of the compiled
//				local for this varname.  No instructions
//				emitted.	(Stack +0)
//	0		1	Push part1 and part2 names of array element
//				on the stack.	(Stack +2)
//	0		0	*localIndexPtr is the index of the compiled
//				local for this array.  Element name is pushed
//				on the stack.	(Stack +1)
//
// Side effects:
//	Instructions are added to envPtr.
//
//----------------------------------------------------------------------

func XTclPushVarName(tls *libc.TLS, interp uintptr, varTokenPtr uintptr, envPtr uintptr, flags int32, localIndexPtr uintptr, isScalarPtr uintptr) { /* tclCompCmds.c:3399:1: */
	var p uintptr
	var last uintptr
	var name uintptr
	var elName uintptr
	var n int32
	var elemTokenPtr uintptr = uintptr(0)
	var nameLen int32
	var elNameLen int32
	var simpleVarName int32
	var localIndex int32
	var elemTokenCount int32 = 0
	var allocedTokens int32 = 0
	var removedParen int32 = 0

	// Decide if we can use a frame slot for the var/array name or if we need
	// to emit code to compute and push the name at runtime. We use a frame
	// slot (entry in the array of local vars) if we are compiling a procedure
	// body and if the name is simple text that does not include namespace
	// qualifiers.

	simpleVarName = 0
	name = libc.AssignUintptr(&elName, uintptr(0))
	nameLen = libc.AssignInt32(&elNameLen, 0)
	localIndex = -1

	if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		// A simple variable name. Divide it up into "name" and "elName"
		// strings. If it is not a local variable, look it up at runtime.

		simpleVarName = 1

		name = (*Tcl_Token)(unsafe.Pointer(varTokenPtr + 1*24)).Fstart
		nameLen = (*Tcl_Token)(unsafe.Pointer(varTokenPtr + 1*24)).Fsize
		if int32(*(*int8)(unsafe.Pointer(name + uintptr(nameLen-1)))) == ')' {
			// last char is ')' => potential array reference.
			last = name + uintptr(nameLen-1)

			if int32(*(*int8)(unsafe.Pointer(last))) == ')' {
				for p = name; p < last; p++ {
					if int32(*(*int8)(unsafe.Pointer(p))) == '(' {
						elName = p + uintptr(1)
						elNameLen = int32((int64(last) - int64(elName)) / 1)
						nameLen = int32((int64(p) - int64(name)) / 1)
						break
					}
				}
			}

			if !(flags&TCL_NO_ELEMENT != 0) && elNameLen != 0 {
				// An array element, the element name is a simple string:
				// assemble the corresponding token.

				elemTokenPtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(Tcl_Token{})))
				allocedTokens = 1
				(*Tcl_Token)(unsafe.Pointer(elemTokenPtr)).Ftype = TCL_TOKEN_TEXT
				(*Tcl_Token)(unsafe.Pointer(elemTokenPtr)).Fstart = elName
				(*Tcl_Token)(unsafe.Pointer(elemTokenPtr)).Fsize = elNameLen
				(*Tcl_Token)(unsafe.Pointer(elemTokenPtr)).FnumComponents = 0
				elemTokenCount = 1
			}
		}
	} else if interp != 0 && libc.AssignInt32(&n, (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents) > 1 &&
		(*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Ftype == TCL_TOKEN_TEXT &&
		(*Tcl_Token)(unsafe.Pointer(varTokenPtr+uintptr(n)*24)).Ftype == TCL_TOKEN_TEXT &&
		int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(varTokenPtr+uintptr(n)*24)).Fstart + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr+uintptr(n)*24)).Fsize) - uintptr(1)))) == ')' {
		// Check for parentheses inside first token.

		simpleVarName = 0
		p = (*Tcl_Token)(unsafe.Pointer(varTokenPtr + 1*24)).Fstart
		last = p + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fsize)
		for ; p < last; p++ {
			if int32(*(*int8)(unsafe.Pointer(p))) == '(' {
				simpleVarName = 1
				break
			}
		}
		if simpleVarName != 0 {
			var remainingLen int32

			// Check the last token: if it is just ')', do not count it.
			// Otherwise, remove the ')' and flag so that it is restored at
			// the end.

			if (*Tcl_Token)(unsafe.Pointer(varTokenPtr+uintptr(n)*24)).Fsize == 1 {
				n--
			} else {
				(*Tcl_Token)(unsafe.Pointer(varTokenPtr+uintptr(n)*24)).Fsize--
				removedParen = n
			}

			name = (*Tcl_Token)(unsafe.Pointer(varTokenPtr + 1*24)).Fstart
			nameLen = int32((int64(p) - int64((*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fstart)) / 1)
			elName = p + uintptr(1)
			remainingLen = int32((int64((*Tcl_Token)(unsafe.Pointer(varTokenPtr+2*24)).Fstart)-int64(p))/1 - int64(1))
			elNameLen = int32((int64((*Tcl_Token)(unsafe.Pointer(varTokenPtr+uintptr(n)*24)).Fstart)-int64(p))/1 + int64((*Tcl_Token)(unsafe.Pointer(varTokenPtr+uintptr(n)*24)).Fsize) - int64(1))

			if !(flags&TCL_NO_ELEMENT != 0) {
				if remainingLen != 0 {
					// Make a first token with the extra characters in the first
					// token.

					elemTokenPtr = XTclStackAlloc(tls, interp, int32(uint64(n)*uint64(unsafe.Sizeof(Tcl_Token{}))))
					allocedTokens = 1
					(*Tcl_Token)(unsafe.Pointer(elemTokenPtr)).Ftype = TCL_TOKEN_TEXT
					(*Tcl_Token)(unsafe.Pointer(elemTokenPtr)).Fstart = elName
					(*Tcl_Token)(unsafe.Pointer(elemTokenPtr)).Fsize = remainingLen
					(*Tcl_Token)(unsafe.Pointer(elemTokenPtr)).FnumComponents = 0
					elemTokenCount = n

					// Copy the remaining tokens.

					libc.Xmemcpy(tls, elemTokenPtr+uintptr(1)*24, varTokenPtr+uintptr(2)*24,
						uint64(n-1)*uint64(unsafe.Sizeof(Tcl_Token{})))
				} else {
					// Use the already available tokens.

					elemTokenPtr = varTokenPtr + 2*24
					elemTokenCount = n - 1
				}
			}
		}
	}

	if simpleVarName != 0 {
		// See whether name has any namespace separators (::'s).

		var hasNsQualifiers int32 = 0

		p = name
		last = p + uintptr(nameLen) - uintptr(1)
		for ; p < last; p++ {
			if int32(*(*int8)(unsafe.Pointer(p))) == ':' && int32(*(*int8)(unsafe.Pointer(p + uintptr(1)))) == ':' {
				hasNsQualifiers = 1
				break
			}
		}

		// Look up the var name's index in the array of local vars in the proc
		// frame. If retrieving the var's value and it doesn't already exist,
		// push its name and look it up at runtime.

		if !(hasNsQualifiers != 0) {
			localIndex = XTclFindCompiledLocal(tls, name, nameLen, 1, envPtr)
			if flags&TCL_NO_LARGE_INDEX != 0 && localIndex > 255 {
				// We'll push the name.

				localIndex = -1
			}
		}
		if interp != 0 && localIndex < 0 {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, name, nameLen, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		}

		// Compile the element script, if any, and only if not inhibited. [Bug
		// 3600328]

		if elName != uintptr(0) && !(flags&TCL_NO_ELEMENT != 0) {
			if elNameLen != 0 {
				XTclCompileTokens(tls, interp, elemTokenPtr, elemTokenCount,
					envPtr)
			} else {
				for ok7 := true; ok7; ok7 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
					if _objIndexCopy <= 255 {
						for ok8 := true; ok8; ok8 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok9 := true; ok9; ok9 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok10 := true; ok10; ok10 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok11 := true; ok11; ok11 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok12 := true; ok12; ok12 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok13 := true; ok13; ok13 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
			}
		}
	} else if interp != 0 {
		// The var name isn't simple: compile and push it.

		XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents, envPtr)

	}

	if removedParen != 0 {
		(*Tcl_Token)(unsafe.Pointer(varTokenPtr+uintptr(removedParen)*24)).Fsize++
	}
	if allocedTokens != 0 {
		XTclStackFree(tls, interp, elemTokenPtr)
	}
	*(*int32)(unsafe.Pointer(localIndexPtr)) = localIndex
	*(*int32)(unsafe.Pointer(isScalarPtr)) = libc.Bool32(elName == uintptr(0))
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------------
//
// TclGetIndexFromToken --
//
//	Parse a token to determine if an index value is known at
//	compile time.
//
// Returns:
//	TCL_OK if parsing succeeded, and TCL_ERROR if it failed.
//
// Side effects:
//	When TCL_OK is returned, the encoded index value is written
//	to *index.
//
//----------------------------------------------------------------------

func XTclGetIndexFromToken(tls *libc.TLS, tokenPtr uintptr, before int32, after int32, indexPtr uintptr) int32 { /* tclCompCmdsGR.c:51:1: */
	var tmpObj uintptr = XTcl_NewObj(tls)
	var result int32 = TCL_ERROR

	if XTclWordKnownAtCompileTime(tls, tokenPtr, tmpObj) != 0 {
		result = XTclIndexEncode(tls, uintptr(0), tmpObj, before, after, indexPtr)
	}
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = tmpObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// TclCompileGlobalCmd --
//
//	Procedure called to compile the "global" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "global" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileGlobalCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:86:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var varTokenPtr uintptr
	var localIndex int32
	var numWords int32
	var i int32

	// TODO: Consider support for compiling expanded args.
	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	if numWords < 2 {
		return TCL_ERROR
	}

	// 'global' has no effect outside of proc bodies; handle that at runtime

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Push the namespace

	for ok := true; ok; ok = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+6847, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok3 := true; ok3; ok3 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok4 := true; ok4; ok4 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok6 := true; ok6; ok6 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}

	// Loop over the variables.

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	i = 1
__1:
	if !(i < numWords) {
		goto __3
	}
	{
		localIndex = sIndexTailVarIfKnown(tls, interp, varTokenPtr, envPtr)

		if localIndex < 0 {
			return TCL_ERROR
		}

		// TODO: Consider what value can pass through the
		// IndexTailVarIfKnown() screen.  Full CompileWord()
		// likely does not apply here.  Push known value instead.
		if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents, envPtr)
		}

		for ok14 := true; ok14; ok14 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_NSUPVAR)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_NSUPVAR == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok15 := true; ok15; ok15 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_NSUPVAR].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - localIndex
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}

	}
	goto __2
__2:
	varTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	i++
	goto __1
	goto __3
__3:
	;

	// Pop the namespace, and set the result to empty

	for ok17 := true; ok17; ok17 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok18 := true; ok18; ok18 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok19 := true; ok19; ok19 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok20 := true; ok20; ok20 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok21 := true; ok21; ok21 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok22 := true; ok22; ok22 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok23 := true; ok23; ok23 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok24 := true; ok24; ok24 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok25 := true; ok25; ok25 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok26 := true; ok26; ok26 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileIfCmd --
//
//	Procedure called to compile the "if" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "if" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileIfCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:165:1: */
	bp := tls.Alloc(380)
	defer tls.Free(380)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	// var jumpFalseFixupArray JumpFixupArray at bp+8, 184

	// Used to fix the ifFalse jump after each
	// test when its target PC is determined.
	// var jumpEndFixupArray JumpFixupArray at bp+192, 184

	// Used to fix the jump after each "then" body
	// to the end of the "if" when that PC is
	// determined.
	var tokenPtr uintptr
	var testTokenPtr uintptr
	var jumpIndex int32 // Avoid compiler warning.
	var jumpFalseDist int32
	var numWords int32
	var wordIdx int32
	var numBytes int32
	var j int32
	var code int32
	var word uintptr
	var realCond int32 // Set to 0 for static conditions:
	// "if 0 {..}"
	// var boolVal int32 at bp+376, 4
	// Value of static condition.
	var compileScripts int32
	var cachePtr uintptr
	// Find out if the condition is a constant.

	var boolObj uintptr
	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	// Adjust the immediately preceeding "ifFalse" jump. We moved it's
	// target (just after this jump) down three bytes.

	var ifFalsePc uintptr
	var opCode uint8
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	jumpIndex = 0
	realCond = 1
	compileScripts = 1

	// Only compile the "if" command if all arguments are simple words, in
	// order to insure correct substitution [Bug 219166]

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	wordIdx = 0
	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords

	wordIdx = 0
__1:
	if !(wordIdx < numWords) {
		goto __3
	}
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD) {
		goto __4
	}
	return TCL_ERROR
__4:
	;
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	goto __2
__2:
	wordIdx++
	goto __1
	goto __3
__3:
	;

	XTclInitJumpFixupArray(tls, bp+8)
	XTclInitJumpFixupArray(tls, bp+192)
	code = TCL_OK

	// Each iteration of this loop compiles one "if expr ?then? body" or
	// "elseif expr ?then? body" clause.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	wordIdx = 0
__5:
	if !(wordIdx < numWords) {
		goto __6
	}
	// Stop looping if the token isn't "if" or "elseif".

	word = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart
	numBytes = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fsize
	if !(tokenPtr == (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr ||
		numBytes == 6 && libc.Xstrncmp(tls, word, ts+13357, uint64(6)) == 0) {
		goto __7
	}
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	wordIdx++
	goto __8
__7:
	goto __6
__8:
	;
	if !(wordIdx >= numWords) {
		goto __9
	}
	code = TCL_ERROR
	goto done
__9:
	;

	// Compile the test expression then emit the conditional jump around
	// the "then" part.

	testTokenPtr = tokenPtr

	if !(realCond != 0) {
		goto __10
	}
	// Find out if the condition is a constant.

	boolObj = XTcl_NewStringObj(tls, (*Tcl_Token)(unsafe.Pointer(testTokenPtr+1*24)).Fstart,
		(*Tcl_Token)(unsafe.Pointer(testTokenPtr+1*24)).Fsize)

	(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount++
	code = XTcl_GetBooleanFromObj(tls, uintptr(0), boolObj, bp+376)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount, 1) > 1) {
		goto __11
	}
	goto __12
__11:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __13
	}

	if !((*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != XtclEmptyStringRep) {
		goto __15
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes)
__15:
	;
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).Flength = -1
__16:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __19
	}
	XTclThreadFreeObj(tls, boolObj)
	goto __20
__19:
	*(*uintptr)(unsafe.Pointer(boolObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = boolObj
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__20:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	goto __14
__13:
	XTclFreeObj(tls, boolObj)
__14:
	;
__12:
	;

	if !(code == TCL_OK) {
		goto __21
	}
	// A static condition.

	realCond = 0
	if !!(*(*int32)(unsafe.Pointer(bp + 376)) != 0) {
		goto __23
	}
	compileScripts = 0
__23:
	;
	goto __22
__21:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(wordIdx)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(wordIdx)*8))
	XTcl_ResetResult(tls, interp)
	XTclCompileExprWords(tls, interp, testTokenPtr, 1, envPtr)
	if !((*JumpFixupArray)(unsafe.Pointer(bp+8)).Fnext >= (*JumpFixupArray)(unsafe.Pointer(bp+8)).Fend) {
		goto __24
	}
	XTclExpandJumpFixupArray(tls, bp+8)
__24:
	;
	jumpIndex = (*JumpFixupArray)(unsafe.Pointer(bp + 8 /* &jumpFalseFixupArray */)).Fnext
	(*JumpFixupArray)(unsafe.Pointer(bp+8 /* &jumpFalseFixupArray */)).Fnext++
	XTclEmitForwardJump(tls, envPtr, TCL_FALSE_JUMP,
		(*JumpFixupArray)(unsafe.Pointer(bp+8)).Ffixup+uintptr(jumpIndex)*16)
__22:
	;
	code = TCL_OK
__10:
	;

	// Skip over the optional "then" before the then clause.

	tokenPtr = testTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(testTokenPtr)).FnumComponents+1)*24
	wordIdx++
	if !(wordIdx >= numWords) {
		goto __25
	}
	code = TCL_ERROR
	goto done
__25:
	;
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __26
	}
	word = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart
	numBytes = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fsize
	if !(numBytes == 4 && libc.Xstrncmp(tls, word, ts+13352, uint64(4)) == 0) {
		goto __27
	}
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	wordIdx++
	if !(wordIdx >= numWords) {
		goto __28
	}
	code = TCL_ERROR
	goto done
__28:
	;
__27:
	;
__26:
	;

	// Compile the "then" command body.

	if !(compileScripts != 0) {
		goto __29
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(wordIdx)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(wordIdx)*8))
	XTclCompileCmdWord(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__29:
	;

	if !(realCond != 0) {
		goto __30
	}
	// Jump to the end of the "if" command. Both jumpFalseFixupArray
	// and jumpEndFixupArray are indexed by "jumpIndex".

	if !((*JumpFixupArray)(unsafe.Pointer(bp+192)).Fnext >= (*JumpFixupArray)(unsafe.Pointer(bp+192)).Fend) {
		goto __32
	}
	XTclExpandJumpFixupArray(tls, bp+192)
__32:
	;
	(*JumpFixupArray)(unsafe.Pointer(bp+192 /* &jumpEndFixupArray */)).Fnext++
	XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP,
		(*JumpFixupArray)(unsafe.Pointer(bp+192)).Ffixup+uintptr(jumpIndex)*16)

	// Fix the target of the jumpFalse after the test. Generate a 4
	// byte jump if the distance is > 120 bytes. This is conservative,
	// and ensures that we won't have to replace this jump if we later
	// also need to replace the proceeding jump to the end of the "if"
	// with a 4 byte jump.

__33:
	if !(-1 < 0) {
		goto __36
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __37
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__37:
	;
__36:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
	if !(XTclFixupForwardJump(tls, envPtr, (*JumpFixupArray)(unsafe.Pointer(bp+8)).Ffixup+uintptr(jumpIndex)*16, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer((*JumpFixupArray)(unsafe.Pointer(bp+8)).Ffixup+uintptr(jumpIndex)*16)).FcodeOffset)), 120) != 0) {
		goto __38
	}
	// Adjust the code offset for the proceeding jump to the end
	// of the "if" command.

	*(*uint32)(unsafe.Pointer((*JumpFixupArray)(unsafe.Pointer(bp+192)).Ffixup + uintptr(jumpIndex)*16 + 4)) += uint32(3)
__38:
	;
	goto __31
__30:
	if !(*(*int32)(unsafe.Pointer(bp + 376)) != 0) {
		goto __39
	}
	// We were processing an "if 1 {...}"; stop compiling scripts.

	compileScripts = 0
	goto __40
__39:
	// We were processing an "if 0 {...}"; reset so that the rest
	// (elseif, else) is compiled correctly.

	realCond = 1
	compileScripts = 1
__40:
	;
__31:
	;

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	wordIdx++
	goto __5
__6:
	;

	// Check for the optional else clause. Do not compile anything if this was
	// an "if 1 {...}" case.

	if !(wordIdx < numWords && (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __41
	}
	// There is an else clause. Skip over the optional "else" word.

	word = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart
	numBytes = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fsize
	if !(numBytes == 4 && libc.Xstrncmp(tls, word, ts+13364, uint64(4)) == 0) {
		goto __43
	}
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	wordIdx++
	if !(wordIdx >= numWords) {
		goto __44
	}
	code = TCL_ERROR
	goto done
__44:
	;
__43:
	;

	if !(compileScripts != 0) {
		goto __45
	}
	// Compile the else command body.

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(wordIdx)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(wordIdx)*8))
	XTclCompileCmdWord(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__45:
	;

	// Make sure there are no words after the else clause.

	wordIdx++
	if !(wordIdx < numWords) {
		goto __46
	}
	code = TCL_ERROR
	goto done
__46:
	;
	goto __42
__41:
	// No else clause: the "if" command's result is an empty string.

	if !(compileScripts != 0) {
		goto __47
	}
__48:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy <= 255) {
		goto __51
	}
__53:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __56
	}
	XTclExpandCodeArray(tls, envPtr)
__56:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __57
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__57:
	;
__58:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __61
	}
	if !(_delta == -0x7fffffff-1) {
		goto __62
	}
	_delta = 1 - _objIndexCopy
__62:
	;
__63:
	if !(_delta < 0) {
		goto __66
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __67
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__67:
	;
__66:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __64
__64:
	if 0 != 0 {
		goto __63
	}
	goto __65
__65:
	;
__61:
	;
	goto __59
__59:
	if 0 != 0 {
		goto __58
	}
	goto __60
__60:
	;
	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
	goto __52
__51:
__68:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __71
	}
	XTclExpandCodeArray(tls, envPtr)
__71:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __72
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__72:
	;
__73:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __76
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __77
	}
	_delta1 = 1 - _objIndexCopy
__77:
	;
__78:
	if !(_delta1 < 0) {
		goto __81
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __82
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__82:
	;
__81:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __79
__79:
	if 0 != 0 {
		goto __78
	}
	goto __80
__80:
	;
__76:
	;
	goto __74
__74:
	if 0 != 0 {
		goto __73
	}
	goto __75
__75:
	;
	goto __69
__69:
	if 0 != 0 {
		goto __68
	}
	goto __70
__70:
	;
__52:
	;
	goto __49
__49:
	if 0 != 0 {
		goto __48
	}
	goto __50
__50:
	;
__47:
	;
__42:
	;

	// Fix the unconditional jumps to the end of the "if" command.

	j = (*JumpFixupArray)(unsafe.Pointer(bp + 192 /* &jumpEndFixupArray */)).Fnext
__83:
	if !(j > 0) {
		goto __85
	}
	jumpIndex = j - 1 // i.e. process the closest jump first.
	if !(XTclFixupForwardJump(tls, envPtr, (*JumpFixupArray)(unsafe.Pointer(bp+192)).Ffixup+uintptr(jumpIndex)*16, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer((*JumpFixupArray)(unsafe.Pointer(bp+192)).Ffixup+uintptr(jumpIndex)*16)).FcodeOffset)), 127) != 0) {
		goto __86
	}
	// Adjust the immediately preceeding "ifFalse" jump. We moved it's
	// target (just after this jump) down three bytes.

	ifFalsePc = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart +
		uintptr((*JumpFixup)(unsafe.Pointer((*JumpFixupArray)(unsafe.Pointer(bp+8)).Ffixup+uintptr(jumpIndex)*16)).FcodeOffset)
	opCode = *(*uint8)(unsafe.Pointer(ifFalsePc))

	if !(int32(opCode) == INST_JUMP_FALSE1) {
		goto __87
	}
	jumpFalseDist = int32(*(*int8)(unsafe.Pointer(ifFalsePc + uintptr(1))))
	jumpFalseDist = jumpFalseDist + 3
	*(*uint8)(unsafe.Pointer(ifFalsePc + uintptr(1))) = uint8(uint32(jumpFalseDist))
	goto __88
__87:
	if !(int32(opCode) == INST_JUMP_FALSE4) {
		goto __89
	}
	jumpFalseDist = int32(uint32(*(*uint8)(unsafe.Pointer(ifFalsePc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(ifFalsePc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(ifFalsePc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(ifFalsePc + uintptr(1) + uintptr(3))))
	jumpFalseDist = jumpFalseDist + 3
__91:
	*(*uint8)(unsafe.Pointer(ifFalsePc + uintptr(1))) = uint8(uint32(jumpFalseDist) >> 24)
	*(*uint8)(unsafe.Pointer(ifFalsePc + uintptr(1) + uintptr(1))) = uint8(uint32(jumpFalseDist) >> 16)
	*(*uint8)(unsafe.Pointer(ifFalsePc + uintptr(1) + uintptr(2))) = uint8(uint32(jumpFalseDist) >> 8)
	*(*uint8)(unsafe.Pointer(ifFalsePc + uintptr(1) + uintptr(3))) = uint8(uint32(jumpFalseDist))
	goto __92
__92:
	if 0 != 0 {
		goto __91
	}
	goto __93
__93:
	;
	goto __90
__89:
	XTcl_Panic(tls, ts+18654, libc.VaList(bp, int32(opCode)))
__90:
	;
__88:
	;
__86:
	;
	goto __84
__84:
	j--
	goto __83
	goto __85
__85:
	;

	// Free the jumpFixupArray array if malloc'ed storage was used.

done:
	XTclFreeJumpFixupArray(tls, bp+8)
	XTclFreeJumpFixupArray(tls, bp+192)
	return code
}

//----------------------------------------------------------------------
//
// TclCompileIncrCmd --
//
//	Procedure called to compile the "incr" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "incr" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileIncrCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:468:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var varTokenPtr uintptr
	var incrTokenPtr uintptr
	// var isScalar int32 at bp+4, 4

	// var localIndex int32 at bp, 4

	var haveImmValue int32
	// var immValue int32 at bp+8, 4

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 && (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclPushVarName(tls, interp, varTokenPtr, envPtr, TCL_NO_LARGE_INDEX, bp, bp+4)

	// If an increment is given, push it, but see first if it's a small
	// integer.

	haveImmValue = 0
	*(*int32)(unsafe.Pointer(bp + 8 /* immValue */)) = 1
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 3 {
		incrTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(incrTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			var word uintptr = (*Tcl_Token)(unsafe.Pointer(incrTokenPtr + 1*24)).Fstart
			var numBytes int32 = (*Tcl_Token)(unsafe.Pointer(incrTokenPtr + 1*24)).Fsize
			var code int32
			var intObj uintptr = XTcl_NewStringObj(tls, word, numBytes)

			(*Tcl_Obj)(unsafe.Pointer(intObj)).FrefCount++
			code = func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(intObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(intObj + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(intObj + 32)) <= int64(uint32(0x7fffffff)*2+1) {
					return func() int32 {
						*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(intObj + 32)))
						return TCL_OK
					}()
				}
				return XTcl_GetIntFromObj(tls, uintptr(0), intObj, bp+8)
			}()
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(intObj)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(intObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(intObj)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(intObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(intObj)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(intObj)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(intObj)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, intObj)
						} else {
							*(*uintptr)(unsafe.Pointer(intObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = intObj
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, intObj)
				}
			}

			if code == TCL_OK && -127 <= *(*int32)(unsafe.Pointer(bp + 8)) && *(*int32)(unsafe.Pointer(bp + 8)) <= 127 {
				haveImmValue = 1
			}
			if !(haveImmValue != 0) {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, word, numBytes, 0)
					if _objIndexCopy <= 255 {
						for ok2 := true; ok2; ok2 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok4 := true; ok4; ok4 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok5 := true; ok5; ok5 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok7 := true; ok7; ok7 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
			XTclCompileTokens(tls, interp, incrTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(incrTokenPtr)).FnumComponents, envPtr)

		}
	} else { // No incr amount given so use 1.
		haveImmValue = 1
	}

	// Emit the instruction to increment the variable.

	if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { // Simple scalar variable.
		if *(*int32)(unsafe.Pointer(bp)) >= 0 {
			if haveImmValue != 0 {
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INCR_SCALAR1_IMM)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_INCR_SCALAR1_IMM == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_INCR_SCALAR1_IMM].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok10 := true; ok10; ok10 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 8))))
				}
			} else {
				for ok12 := true; ok12; ok12 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INCR_SCALAR1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_INCR_SCALAR1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok13 := true; ok13; ok13 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_INCR_SCALAR1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok14 := true; ok14; ok14 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		} else {
			if haveImmValue != 0 {
				for ok15 := true; ok15; ok15 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INCR_STK_IMM)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 8))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_INCR_STK_IMM == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_INCR_STK_IMM].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp + 8))
							}
							for ok17 := true; ok17; ok17 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok18 := true; ok18; ok18 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INCR_STK)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_INCR_STK == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_INCR_STK].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok20 := true; ok20; ok20 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else { // Simple array variable.
		if *(*int32)(unsafe.Pointer(bp)) >= 0 {
			if haveImmValue != 0 {
				for ok21 := true; ok21; ok21 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INCR_ARRAY1_IMM)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_INCR_ARRAY1_IMM == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok22 := true; ok22; ok22 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_INCR_ARRAY1_IMM].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok23 := true; ok23; ok23 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok24 := true; ok24; ok24 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 8))))
				}
			} else {
				for ok25 := true; ok25; ok25 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INCR_ARRAY1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_INCR_ARRAY1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok26 := true; ok26; ok26 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_INCR_ARRAY1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok27 := true; ok27; ok27 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		} else {
			if haveImmValue != 0 {
				for ok28 := true; ok28; ok28 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INCR_ARRAY_STK_IMM)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 8))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_INCR_ARRAY_STK_IMM == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok29 := true; ok29; ok29 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_INCR_ARRAY_STK_IMM].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp + 8))
							}
							for ok30 := true; ok30; ok30 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok31 := true; ok31; ok31 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INCR_ARRAY_STK)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_INCR_ARRAY_STK == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok32 := true; ok32; ok32 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_INCR_ARRAY_STK].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok33 := true; ok33; ok33 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileInfo*Cmd --
//
//	Procedures called to compile "info" subcommands.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "info" subcommand at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileInfoCommandsCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:579:1: */
	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var tokenPtr uintptr
	var objPtr uintptr
	var bytes uintptr
	var _objPtr uintptr
	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _delta4 int32
	var _delta5 int32
	var _delta6 int32
	var _objPtr1 uintptr
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1

	// We require one compile-time known argument for the case we can compile.

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 1) {
		goto __1
	}
	return XTclCompileBasic0ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	goto __2
__1:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2) {
		goto __3
	}
	return TCL_ERROR
__3:
	;
__2:
	;
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	objPtr = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	if !!(XTclWordKnownAtCompileTime(tls, tokenPtr, objPtr) != 0) {
		goto __4
	}
	goto notCompilable
__4:
	;
	bytes = XTcl_GetString(tls, objPtr)

	// We require that the argument start with "::" and not have any of "*\[?"
	// in it. (Theoretically, we should look in only the final component, but
	// the difference is so slight given current naming practices.)

	if !(int32(*(*int8)(unsafe.Pointer(bytes))) != ':' || int32(*(*int8)(unsafe.Pointer(bytes + 1))) != ':' || !(libc.Xstrpbrk(tls, bytes, ts+13556) == uintptr(0))) {
		goto __5
	}
	goto notCompilable
__5:
	;
__6:
	_objPtr = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __9
	}
	XTclFreeObj(tls, _objPtr)
__9:
	;
	goto __7
__7:
	if 0 != 0 {
		goto __6
	}
	goto __8
__8:
	;

	// Confirmed as a literal that will not frighten the horses. Compile. Note
	// that the result needs to be list-ified.

	// TODO: Just push the known value
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __10
	}
__12:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __15
	}
__17:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __20
	}
	XTclExpandCodeArray(tls, envPtr)
__20:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __21
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__21:
	;
__22:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __25
	}
	if !(_delta == -0x7fffffff-1) {
		goto __26
	}
	_delta = 1 - _objIndexCopy
__26:
	;
__27:
	if !(_delta < 0) {
		goto __30
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __31
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__31:
	;
__30:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __28
__28:
	if 0 != 0 {
		goto __27
	}
	goto __29
__29:
	;
__25:
	;
	goto __23
__23:
	if 0 != 0 {
		goto __22
	}
	goto __24
__24:
	;
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
	goto __16
__15:
__32:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __35
	}
	XTclExpandCodeArray(tls, envPtr)
__35:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __36
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__36:
	;
__37:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __40
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __41
	}
	_delta1 = 1 - _objIndexCopy
__41:
	;
__42:
	if !(_delta1 < 0) {
		goto __45
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __46
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__46:
	;
__45:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __43
__43:
	if 0 != 0 {
		goto __42
	}
	goto __44
__44:
	;
__40:
	;
	goto __38
__38:
	if 0 != 0 {
		goto __37
	}
	goto __39
__39:
	;
	goto __33
__33:
	if 0 != 0 {
		goto __32
	}
	goto __34
__34:
	;
__16:
	;
	goto __13
__13:
	if 0 != 0 {
		goto __12
	}
	goto __14
__14:
	;
	goto __11
__10:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__11:
	;

__47:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __50
	}
	XTclExpandCodeArray(tls, envPtr)
__50:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_RESOLVE_COMMAND)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __51
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_RESOLVE_COMMAND == INST_START_CMD {
			return 1
		}
		return 0
	}()
__51:
	;
__52:
	_delta2 = XtclInstructionTable[INST_RESOLVE_COMMAND].FstackEffect
	if !(_delta2 != 0) {
		goto __55
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __56
	}
	_delta2 = 1 - 0
__56:
	;
__57:
	if !(_delta2 < 0) {
		goto __60
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __61
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__61:
	;
__60:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __58
__58:
	if 0 != 0 {
		goto __57
	}
	goto __59
__59:
	;
__55:
	;
	goto __53
__53:
	if 0 != 0 {
		goto __52
	}
	goto __54
__54:
	;
	goto __48
__48:
	if 0 != 0 {
		goto __47
	}
	goto __49
__49:
	;
__62:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __65
	}
	XTclExpandCodeArray(tls, envPtr)
__65:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __66
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__66:
	;
__67:
	_delta3 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta3 != 0) {
		goto __70
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __71
	}
	_delta3 = 1 - 0
__71:
	;
__72:
	if !(_delta3 < 0) {
		goto __75
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __76
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__76:
	;
__75:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __73
__73:
	if 0 != 0 {
		goto __72
	}
	goto __74
__74:
	;
__70:
	;
	goto __68
__68:
	if 0 != 0 {
		goto __67
	}
	goto __69
__69:
	;
	goto __63
__63:
	if 0 != 0 {
		goto __62
	}
	goto __64
__64:
	;
__77:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __80
	}
	XTclExpandCodeArray(tls, envPtr)
__80:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_LEN)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __81
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_LEN == INST_START_CMD {
			return 1
		}
		return 0
	}()
__81:
	;
__82:
	_delta4 = XtclInstructionTable[INST_STR_LEN].FstackEffect
	if !(_delta4 != 0) {
		goto __85
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __86
	}
	_delta4 = 1 - 0
__86:
	;
__87:
	if !(_delta4 < 0) {
		goto __90
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __91
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__91:
	;
__90:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __88
__88:
	if 0 != 0 {
		goto __87
	}
	goto __89
__89:
	;
__85:
	;
	goto __83
__83:
	if 0 != 0 {
		goto __82
	}
	goto __84
__84:
	;
	goto __78
__78:
	if 0 != 0 {
		goto __77
	}
	goto __79
__79:
	;
__92:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __95
	}
	XTclExpandCodeArray(tls, envPtr)
__95:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(7))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __96
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_FALSE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__96:
	;
__97:
	_delta5 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
	if !(_delta5 != 0) {
		goto __100
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __101
	}
	_delta5 = 1 - 7
__101:
	;
__102:
	if !(_delta5 < 0) {
		goto __105
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __106
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__106:
	;
__105:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __103
__103:
	if 0 != 0 {
		goto __102
	}
	goto __104
__104:
	;
__100:
	;
	goto __98
__98:
	if 0 != 0 {
		goto __97
	}
	goto __99
__99:
	;
	goto __93
__93:
	if 0 != 0 {
		goto __92
	}
	goto __94
__94:
	;
__107:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __110
	}
	XTclExpandCodeArray(tls, envPtr)
__110:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __111
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST == INST_START_CMD {
			return 1
		}
		return 0
	}()
__111:
	;
__112:
	_delta6 = XtclInstructionTable[INST_LIST].FstackEffect
	if !(_delta6 != 0) {
		goto __115
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __116
	}
	_delta6 = 1 - 1
__116:
	;
__117:
	if !(_delta6 < 0) {
		goto __120
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __121
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__121:
	;
__120:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __118
__118:
	if 0 != 0 {
		goto __117
	}
	goto __119
__119:
	;
__115:
	;
	goto __113
__113:
	if 0 != 0 {
		goto __112
	}
	goto __114
__114:
	;
	goto __108
__108:
	if 0 != 0 {
		goto __107
	}
	goto __109
__109:
	;
	return TCL_OK

notCompilable:
__122:
	_objPtr1 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __125
	}
	XTclFreeObj(tls, _objPtr1)
__125:
	;
	goto __123
__123:
	if 0 != 0 {
		goto __122
	}
	goto __124
__124:
	;
	return XTclCompileBasic1ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileInfoCoroutineCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:640:1: */
	// Only compile [info coroutine] without arguments.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 1 {
		return TCL_ERROR
	}

	// Not much to do; we compile to a single instruction...

	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_COROUTINE_NAME)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_COROUTINE_NAME == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_COROUTINE_NAME].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileInfoExistsCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:665:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	// var isScalar int32 at bp+4, 4

	// var localIndex int32 at bp, 4

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}

	// Decide if we can use a frame slot for the var/array name or if we need
	// to emit code to compute and push the name at runtime. We use a frame
	// slot (entry in the array of local vars) if we are compiling a procedure
	// body and if the name is simple text that does not include namespace
	// qualifiers.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclPushVarName(tls, interp, tokenPtr, envPtr, 0, bp, bp+4)

	// Emit instruction to check the variable for existence.

	if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
		if *(*int32)(unsafe.Pointer(bp)) < 0 {
			for ok := true; ok; ok = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EXIST_STK)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_EXIST_STK == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_EXIST_STK].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EXIST_SCALAR)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_EXIST_SCALAR == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok4 := true; ok4; ok4 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_EXIST_SCALAR].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - *(*int32)(unsafe.Pointer(bp))
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	} else {
		if *(*int32)(unsafe.Pointer(bp)) < 0 {
			for ok6 := true; ok6; ok6 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EXIST_ARRAY_STK)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_EXIST_ARRAY_STK == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok7 := true; ok7; ok7 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_EXIST_ARRAY_STK].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok8 := true; ok8; ok8 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok9 := true; ok9; ok9 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EXIST_ARRAY)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_EXIST_ARRAY == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok10 := true; ok10; ok10 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_EXIST_ARRAY].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - *(*int32)(unsafe.Pointer(bp))
						}
						for ok11 := true; ok11; ok11 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}

	return TCL_OK
}

func XTclCompileInfoLevelCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:714:1: */
	// Only compile [info level] without arguments or with a single argument.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 1 {
		// Not much to do; we compile to a single instruction...

		for ok := true; ok; ok = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INFO_LEVEL_NUM)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_INFO_LEVEL_NUM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_INFO_LEVEL_NUM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	} else {
		var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
		var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280

		// Compile the argument, then add the instruction to convert it into a
		// list of arguments.

		if (*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr+uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr+uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr+uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok7 := true; ok7; ok7 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok8 := true; ok8; ok8 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok9 := true; ok9; ok9 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
			XTclCompileTokens(tls, interp, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr+uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr+uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24)).FnumComponents, envPtr)
		}

		for ok10 := true; ok10; ok10 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INFO_LEVEL_ARGS)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_INFO_LEVEL_ARGS == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_INFO_LEVEL_ARGS].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileInfoObjectClassCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:749:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_TCLOO_CLASS)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_TCLOO_CLASS == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_TCLOO_CLASS].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileInfoObjectIsACmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:769:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	// We only handle [info object isa object <somevalue>]. The first three
	// words are compressed to a single token by the ensemble compilation
	// engine.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD || (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize < 1 ||
		libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, ts+18716, uint64((*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize)) != 0 {
		return TCL_ERROR
	}
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24

	// Issue the code.

	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_TCLOO_IS_OBJECT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_TCLOO_IS_OBJECT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_TCLOO_IS_OBJECT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileInfoObjectNamespaceCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:805:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_TCLOO_NS)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_TCLOO_NS == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_TCLOO_NS].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileLappendCmd --
//
//	Procedure called to compile the "lappend" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "lappend" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileLappendCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:843:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var varTokenPtr uintptr
	var valueTokenPtr uintptr
	// var isScalar int32 at bp+4, 4

	// var localIndex int32 at bp, 4

	var numWords int32
	var i int32
	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _delta4 int32
	var _delta5 int32
	var _delta6 int32
	var _delta7 int32
	var _delta8 int32
	var _delta9 int32
	var _objIndexCopy1 int32
	var _delta10 int32
	var _delta11 int32
	var _delta12 int32
	var _delta13 int32
	var _delta14 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1

	// TODO: Consider support for compiling expanded args.
	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	if !(numWords < 3) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	if !(numWords != 3 || (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr == uintptr(0)) {
		goto __2
	}
	goto lappendMultiple
__2:
	;

	// Decide if we can use a frame slot for the var/array name or if we
	// need to emit code to compute and push the name at runtime. We use a
	// frame slot (entry in the array of local vars) if we are compiling a
	// procedure body and if the name is simple text that does not include
	// namespace qualifiers.

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclPushVarName(tls, interp, varTokenPtr, envPtr, 0, bp, bp+4)

	// If we are doing an assignment, push the new value. In the no values
	// case, create an empty object.

	if !(numWords > 2) {
		goto __3
	}
	valueTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24

	if !((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __4
	}
__6:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __9
	}
__11:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __14
	}
	XTclExpandCodeArray(tls, envPtr)
__14:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __15
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__15:
	;
__16:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __19
	}
	if !(_delta == -0x7fffffff-1) {
		goto __20
	}
	_delta = 1 - _objIndexCopy
__20:
	;
__21:
	if !(_delta < 0) {
		goto __24
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __25
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__25:
	;
__24:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
__19:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	goto __12
__12:
	if 0 != 0 {
		goto __11
	}
	goto __13
__13:
	;
	goto __10
__9:
__26:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __29
	}
	XTclExpandCodeArray(tls, envPtr)
__29:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __30
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__30:
	;
__31:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __34
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __35
	}
	_delta1 = 1 - _objIndexCopy
__35:
	;
__36:
	if !(_delta1 < 0) {
		goto __39
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __40
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__40:
	;
__39:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __37
__37:
	if 0 != 0 {
		goto __36
	}
	goto __38
__38:
	;
__34:
	;
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
	goto __27
__27:
	if 0 != 0 {
		goto __26
	}
	goto __28
__28:
	;
__10:
	;
	goto __7
__7:
	if 0 != 0 {
		goto __6
	}
	goto __8
__8:
	;
	goto __5
__4:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
	XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents, envPtr)
__5:
	;

__3:
	;

	// Emit instructions to set/get the variable.

	// The *_STK opcodes should be refactored to make better use of existing
	// LOAD/STORE instructions.

	if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
		goto __41
	}
	if !(*(*int32)(unsafe.Pointer(bp)) < 0) {
		goto __43
	}
__45:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __48
	}
	XTclExpandCodeArray(tls, envPtr)
__48:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LAPPEND_STK)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __49
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LAPPEND_STK == INST_START_CMD {
			return 1
		}
		return 0
	}()
__49:
	;
__50:
	_delta2 = XtclInstructionTable[INST_LAPPEND_STK].FstackEffect
	if !(_delta2 != 0) {
		goto __53
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __54
	}
	_delta2 = 1 - 0
__54:
	;
__55:
	if !(_delta2 < 0) {
		goto __58
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __59
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__59:
	;
__58:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __56
__56:
	if 0 != 0 {
		goto __55
	}
	goto __57
__57:
	;
__53:
	;
	goto __51
__51:
	if 0 != 0 {
		goto __50
	}
	goto __52
__52:
	;
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
	goto __44
__43:
	if !(*(*int32)(unsafe.Pointer(bp)) <= 255) {
		goto __60
	}
__62:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __65
	}
	XTclExpandCodeArray(tls, envPtr)
__65:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LAPPEND_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __66
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LAPPEND_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__66:
	;
__67:
	_delta3 = XtclInstructionTable[INST_LAPPEND_SCALAR1].FstackEffect
	if !(_delta3 != 0) {
		goto __70
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __71
	}
	_delta3 = 1 - *(*int32)(unsafe.Pointer(bp))
__71:
	;
__72:
	if !(_delta3 < 0) {
		goto __75
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __76
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__76:
	;
__75:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __73
__73:
	if 0 != 0 {
		goto __72
	}
	goto __74
__74:
	;
__70:
	;
	goto __68
__68:
	if 0 != 0 {
		goto __67
	}
	goto __69
__69:
	;
	goto __63
__63:
	if 0 != 0 {
		goto __62
	}
	goto __64
__64:
	;
	goto __61
__60:
__77:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __80
	}
	XTclExpandCodeArray(tls, envPtr)
__80:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LAPPEND_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __81
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LAPPEND_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__81:
	;
__82:
	_delta4 = XtclInstructionTable[INST_LAPPEND_SCALAR4].FstackEffect
	if !(_delta4 != 0) {
		goto __85
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __86
	}
	_delta4 = 1 - *(*int32)(unsafe.Pointer(bp))
__86:
	;
__87:
	if !(_delta4 < 0) {
		goto __90
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __91
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__91:
	;
__90:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __88
__88:
	if 0 != 0 {
		goto __87
	}
	goto __89
__89:
	;
__85:
	;
	goto __83
__83:
	if 0 != 0 {
		goto __82
	}
	goto __84
__84:
	;
	goto __78
__78:
	if 0 != 0 {
		goto __77
	}
	goto __79
__79:
	;
__61:
	;

__44:
	;
	goto __42
__41:
	if !(*(*int32)(unsafe.Pointer(bp)) < 0) {
		goto __92
	}
__94:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __97
	}
	XTclExpandCodeArray(tls, envPtr)
__97:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LAPPEND_ARRAY_STK)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __98
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LAPPEND_ARRAY_STK == INST_START_CMD {
			return 1
		}
		return 0
	}()
__98:
	;
__99:
	_delta5 = XtclInstructionTable[INST_LAPPEND_ARRAY_STK].FstackEffect
	if !(_delta5 != 0) {
		goto __102
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __103
	}
	_delta5 = 1 - 0
__103:
	;
__104:
	if !(_delta5 < 0) {
		goto __107
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __108
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__108:
	;
__107:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __105
__105:
	if 0 != 0 {
		goto __104
	}
	goto __106
__106:
	;
__102:
	;
	goto __100
__100:
	if 0 != 0 {
		goto __99
	}
	goto __101
__101:
	;
	goto __95
__95:
	if 0 != 0 {
		goto __94
	}
	goto __96
__96:
	;
	goto __93
__92:
	if !(*(*int32)(unsafe.Pointer(bp)) <= 255) {
		goto __109
	}
__111:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __114
	}
	XTclExpandCodeArray(tls, envPtr)
__114:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LAPPEND_ARRAY1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __115
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LAPPEND_ARRAY1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__115:
	;
__116:
	_delta6 = XtclInstructionTable[INST_LAPPEND_ARRAY1].FstackEffect
	if !(_delta6 != 0) {
		goto __119
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __120
	}
	_delta6 = 1 - *(*int32)(unsafe.Pointer(bp))
__120:
	;
__121:
	if !(_delta6 < 0) {
		goto __124
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __125
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__125:
	;
__124:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __122
__122:
	if 0 != 0 {
		goto __121
	}
	goto __123
__123:
	;
__119:
	;
	goto __117
__117:
	if 0 != 0 {
		goto __116
	}
	goto __118
__118:
	;
	goto __112
__112:
	if 0 != 0 {
		goto __111
	}
	goto __113
__113:
	;
	goto __110
__109:
__126:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __129
	}
	XTclExpandCodeArray(tls, envPtr)
__129:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LAPPEND_ARRAY4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __130
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LAPPEND_ARRAY4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__130:
	;
__131:
	_delta7 = XtclInstructionTable[INST_LAPPEND_ARRAY4].FstackEffect
	if !(_delta7 != 0) {
		goto __134
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __135
	}
	_delta7 = 1 - *(*int32)(unsafe.Pointer(bp))
__135:
	;
__136:
	if !(_delta7 < 0) {
		goto __139
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __140
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__140:
	;
__139:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __137
__137:
	if 0 != 0 {
		goto __136
	}
	goto __138
__138:
	;
__134:
	;
	goto __132
__132:
	if 0 != 0 {
		goto __131
	}
	goto __133
__133:
	;
	goto __127
__127:
	if 0 != 0 {
		goto __126
	}
	goto __128
__128:
	;
__110:
	;

__93:
	;
__42:
	;

	return TCL_OK

lappendMultiple:
	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclPushVarName(tls, interp, varTokenPtr, envPtr, 0, bp, bp+4)
	valueTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	i = 2
__141:
	if !(i < numWords) {
		goto __143
	}
	if !((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __144
	}
__146:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy1 <= 255) {
		goto __149
	}
__151:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __154
	}
	XTclExpandCodeArray(tls, envPtr)
__154:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __155
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__155:
	;
__156:
	_delta8 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta8 != 0) {
		goto __159
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __160
	}
	_delta8 = 1 - _objIndexCopy1
__160:
	;
__161:
	if !(_delta8 < 0) {
		goto __164
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __165
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__165:
	;
__164:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __162
__162:
	if 0 != 0 {
		goto __161
	}
	goto __163
__163:
	;
__159:
	;
	goto __157
__157:
	if 0 != 0 {
		goto __156
	}
	goto __158
__158:
	;
	goto __152
__152:
	if 0 != 0 {
		goto __151
	}
	goto __153
__153:
	;
	goto __150
__149:
__166:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __169
	}
	XTclExpandCodeArray(tls, envPtr)
__169:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __170
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__170:
	;
__171:
	_delta9 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta9 != 0) {
		goto __174
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __175
	}
	_delta9 = 1 - _objIndexCopy1
__175:
	;
__176:
	if !(_delta9 < 0) {
		goto __179
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __180
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__180:
	;
__179:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __177
__177:
	if 0 != 0 {
		goto __176
	}
	goto __178
__178:
	;
__174:
	;
	goto __172
__172:
	if 0 != 0 {
		goto __171
	}
	goto __173
__173:
	;
	goto __167
__167:
	if 0 != 0 {
		goto __166
	}
	goto __168
__168:
	;
__150:
	;
	goto __147
__147:
	if 0 != 0 {
		goto __146
	}
	goto __148
__148:
	;
	goto __145
__144:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
	XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents, envPtr)
__145:
	;

	valueTokenPtr = valueTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+1)*24
	goto __142
__142:
	i++
	goto __141
	goto __143
__143:
	;
__181:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __184
	}
	XTclExpandCodeArray(tls, envPtr)
__184:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords-2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords-2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords-2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords - 2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __185
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST == INST_START_CMD {
			return 1
		}
		return 0
	}()
__185:
	;
__186:
	_delta10 = XtclInstructionTable[INST_LIST].FstackEffect
	if !(_delta10 != 0) {
		goto __189
	}
	if !(_delta10 == -0x7fffffff-1) {
		goto __190
	}
	_delta10 = 1 - (numWords - 2)
__190:
	;
__191:
	if !(_delta10 < 0) {
		goto __194
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __195
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__195:
	;
__194:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta10
	goto __192
__192:
	if 0 != 0 {
		goto __191
	}
	goto __193
__193:
	;
__189:
	;
	goto __187
__187:
	if 0 != 0 {
		goto __186
	}
	goto __188
__188:
	;
	goto __182
__182:
	if 0 != 0 {
		goto __181
	}
	goto __183
__183:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
		goto __196
	}
	if !(*(*int32)(unsafe.Pointer(bp)) < 0) {
		goto __198
	}
__200:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __203
	}
	XTclExpandCodeArray(tls, envPtr)
__203:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LAPPEND_LIST_STK)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __204
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LAPPEND_LIST_STK == INST_START_CMD {
			return 1
		}
		return 0
	}()
__204:
	;
__205:
	_delta11 = XtclInstructionTable[INST_LAPPEND_LIST_STK].FstackEffect
	if !(_delta11 != 0) {
		goto __208
	}
	if !(_delta11 == -0x7fffffff-1) {
		goto __209
	}
	_delta11 = 1 - 0
__209:
	;
__210:
	if !(_delta11 < 0) {
		goto __213
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __214
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__214:
	;
__213:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta11
	goto __211
__211:
	if 0 != 0 {
		goto __210
	}
	goto __212
__212:
	;
__208:
	;
	goto __206
__206:
	if 0 != 0 {
		goto __205
	}
	goto __207
__207:
	;
	goto __201
__201:
	if 0 != 0 {
		goto __200
	}
	goto __202
__202:
	;
	goto __199
__198:
__215:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __218
	}
	XTclExpandCodeArray(tls, envPtr)
__218:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LAPPEND_LIST)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __219
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LAPPEND_LIST == INST_START_CMD {
			return 1
		}
		return 0
	}()
__219:
	;
__220:
	_delta12 = XtclInstructionTable[INST_LAPPEND_LIST].FstackEffect
	if !(_delta12 != 0) {
		goto __223
	}
	if !(_delta12 == -0x7fffffff-1) {
		goto __224
	}
	_delta12 = 1 - *(*int32)(unsafe.Pointer(bp))
__224:
	;
__225:
	if !(_delta12 < 0) {
		goto __228
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __229
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__229:
	;
__228:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta12
	goto __226
__226:
	if 0 != 0 {
		goto __225
	}
	goto __227
__227:
	;
__223:
	;
	goto __221
__221:
	if 0 != 0 {
		goto __220
	}
	goto __222
__222:
	;
	goto __216
__216:
	if 0 != 0 {
		goto __215
	}
	goto __217
__217:
	;
__199:
	;
	goto __197
__196:
	if !(*(*int32)(unsafe.Pointer(bp)) < 0) {
		goto __230
	}
__232:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __235
	}
	XTclExpandCodeArray(tls, envPtr)
__235:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LAPPEND_LIST_ARRAY_STK)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __236
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LAPPEND_LIST_ARRAY_STK == INST_START_CMD {
			return 1
		}
		return 0
	}()
__236:
	;
__237:
	_delta13 = XtclInstructionTable[INST_LAPPEND_LIST_ARRAY_STK].FstackEffect
	if !(_delta13 != 0) {
		goto __240
	}
	if !(_delta13 == -0x7fffffff-1) {
		goto __241
	}
	_delta13 = 1 - 0
__241:
	;
__242:
	if !(_delta13 < 0) {
		goto __245
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __246
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__246:
	;
__245:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta13
	goto __243
__243:
	if 0 != 0 {
		goto __242
	}
	goto __244
__244:
	;
__240:
	;
	goto __238
__238:
	if 0 != 0 {
		goto __237
	}
	goto __239
__239:
	;
	goto __233
__233:
	if 0 != 0 {
		goto __232
	}
	goto __234
__234:
	;
	goto __231
__230:
__247:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __250
	}
	XTclExpandCodeArray(tls, envPtr)
__250:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LAPPEND_LIST_ARRAY)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __251
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LAPPEND_LIST_ARRAY == INST_START_CMD {
			return 1
		}
		return 0
	}()
__251:
	;
__252:
	_delta14 = XtclInstructionTable[INST_LAPPEND_LIST_ARRAY].FstackEffect
	if !(_delta14 != 0) {
		goto __255
	}
	if !(_delta14 == -0x7fffffff-1) {
		goto __256
	}
	_delta14 = 1 - *(*int32)(unsafe.Pointer(bp))
__256:
	;
__257:
	if !(_delta14 < 0) {
		goto __260
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __261
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__261:
	;
__260:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta14
	goto __258
__258:
	if 0 != 0 {
		goto __257
	}
	goto __259
__259:
	;
__255:
	;
	goto __253
__253:
	if 0 != 0 {
		goto __252
	}
	goto __254
__254:
	;
	goto __248
__248:
	if 0 != 0 {
		goto __247
	}
	goto __249
__249:
	;
__231:
	;
__197:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileLassignCmd --
//
//	Procedure called to compile the "lassign" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "lassign" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileLassignCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:959:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	// var isScalar int32 at bp+4, 4

	// var localIndex int32 at bp, 4

	var numWords int32
	var idx int32

	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords

	// Check for command syntax error, but we'll punt that to runtime.

	if numWords < 3 {
		return TCL_ERROR
	}

	// Generate code to push list being taken apart by [lassign].

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	// Generate code to assign values from the list to variables.

	for idx = 0; idx < numWords-2; idx++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24

		// Generate the next variable name.

		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(idx+2)*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(idx+2)*8))
		XTclPushVarName(tls, interp, tokenPtr, envPtr, 0, bp, bp+4)

		// Emit instructions to get the idx'th item out of the list value on
		// the stack and assign it to the variable.

		if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
			if *(*int32)(unsafe.Pointer(bp)) >= 0 {
				for ok7 := true; ok7; ok7 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_DUP == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok8 := true; ok8; ok8 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_DUP].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok9 := true; ok9; ok9 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok10 := true; ok10; ok10 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_INDEX_IMM)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LIST_INDEX_IMM == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok11 := true; ok11; ok11 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LIST_INDEX_IMM].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - idx
							}
							for ok12 := true; ok12; ok12 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				if *(*int32)(unsafe.Pointer(bp)) <= 255 {
					for ok13 := true; ok13; ok13 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_STORE_SCALAR1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok14 := true; ok14; ok14 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - *(*int32)(unsafe.Pointer(bp))
								}
								for ok15 := true; ok15; ok15 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok16 := true; ok16; ok16 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_STORE_SCALAR4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok17 := true; ok17; ok17 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - *(*int32)(unsafe.Pointer(bp))
								}
								for ok18 := true; ok18; ok18 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}

				for ok19 := true; ok19; ok19 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_POP == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok20 := true; ok20; ok20 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok21 := true; ok21; ok21 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok22 := true; ok22; ok22 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_OVER == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok23 := true; ok23; ok23 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 1
							}
							for ok24 := true; ok24; ok24 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok25 := true; ok25; ok25 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_INDEX_IMM)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LIST_INDEX_IMM == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok26 := true; ok26; ok26 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LIST_INDEX_IMM].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - idx
							}
							for ok27 := true; ok27; ok27 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok28 := true; ok28; ok28 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_STK)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_STK == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok29 := true; ok29; ok29 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_STK].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok30 := true; ok30; ok30 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok31 := true; ok31; ok31 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_POP == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok32 := true; ok32; ok32 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok33 := true; ok33; ok33 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		} else {
			if *(*int32)(unsafe.Pointer(bp)) >= 0 {
				for ok34 := true; ok34; ok34 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_OVER == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok35 := true; ok35; ok35 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 1
							}
							for ok36 := true; ok36; ok36 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok37 := true; ok37; ok37 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_INDEX_IMM)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LIST_INDEX_IMM == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok38 := true; ok38; ok38 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LIST_INDEX_IMM].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - idx
							}
							for ok39 := true; ok39; ok39 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				if *(*int32)(unsafe.Pointer(bp)) <= 255 {
					for ok40 := true; ok40; ok40 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_ARRAY1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_STORE_ARRAY1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok41 := true; ok41; ok41 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_STORE_ARRAY1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - *(*int32)(unsafe.Pointer(bp))
								}
								for ok42 := true; ok42; ok42 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok43 := true; ok43; ok43 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_ARRAY4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_STORE_ARRAY4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok44 := true; ok44; ok44 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_STORE_ARRAY4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - *(*int32)(unsafe.Pointer(bp))
								}
								for ok45 := true; ok45; ok45 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}

				for ok46 := true; ok46; ok46 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_POP == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok47 := true; ok47; ok47 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok48 := true; ok48; ok48 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok49 := true; ok49; ok49 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_OVER == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok50 := true; ok50; ok50 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 2
							}
							for ok51 := true; ok51; ok51 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok52 := true; ok52; ok52 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_INDEX_IMM)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LIST_INDEX_IMM == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok53 := true; ok53; ok53 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LIST_INDEX_IMM].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - idx
							}
							for ok54 := true; ok54; ok54 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok55 := true; ok55; ok55 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_ARRAY_STK)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_ARRAY_STK == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok56 := true; ok56; ok56 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_ARRAY_STK].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok57 := true; ok57; ok57 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok58 := true; ok58; ok58 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_POP == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok59 := true; ok59; ok59 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok60 := true; ok60; ok60 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}

	// Generate code to leave the rest of the list on the stack.

	for ok61 := true; ok61; ok61 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_RANGE_IMM)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(idx))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_LIST_RANGE_IMM == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok62 := true; ok62; ok62 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_LIST_RANGE_IMM].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - idx
				}
				for ok63 := true; ok63; ok63 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok64 := true; ok64; ok64 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(libc.Uint32FromInt32(-2))
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileLindexCmd --
//
//	Procedure called to compile the "lindex" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "lindex" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileLindexCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1063:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var idxTokenPtr uintptr
	var valTokenPtr uintptr
	var i int32
	// var idx int32 at bp, 4

	var numWords int32
	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _delta4 int32
	var _objIndexCopy1 int32
	var _delta5 int32
	var _delta6 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords

	// Quit if not enough args.

	// TODO: Consider support for compiling expanded args.
	if !(numWords <= 1) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	valTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if !(numWords != 3) {
		goto __2
	}
	goto emitComplexLindex
__2:
	;

	idxTokenPtr = valTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(valTokenPtr)).FnumComponents+1)*24
	if !(XTclGetIndexFromToken(tls, idxTokenPtr, -1, -1,
		bp) == TCL_OK) {
		goto __3
	}
	// The idxTokenPtr parsed as a valid index value and was
	// encoded as expected by INST_LIST_INDEX_IMM.
	//
	// NOTE: that we rely on indexing before a list producing the
	// same result as indexing after a list.

	if !((*Tcl_Token)(unsafe.Pointer(valTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __4
	}
__6:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __9
	}
__11:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __14
	}
	XTclExpandCodeArray(tls, envPtr)
__14:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __15
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__15:
	;
__16:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __19
	}
	if !(_delta == -0x7fffffff-1) {
		goto __20
	}
	_delta = 1 - _objIndexCopy
__20:
	;
__21:
	if !(_delta < 0) {
		goto __24
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __25
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__25:
	;
__24:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
__19:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	goto __12
__12:
	if 0 != 0 {
		goto __11
	}
	goto __13
__13:
	;
	goto __10
__9:
__26:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __29
	}
	XTclExpandCodeArray(tls, envPtr)
__29:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __30
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__30:
	;
__31:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __34
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __35
	}
	_delta1 = 1 - _objIndexCopy
__35:
	;
__36:
	if !(_delta1 < 0) {
		goto __39
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __40
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__40:
	;
__39:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __37
__37:
	if 0 != 0 {
		goto __36
	}
	goto __38
__38:
	;
__34:
	;
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
	goto __27
__27:
	if 0 != 0 {
		goto __26
	}
	goto __28
__28:
	;
__10:
	;
	goto __7
__7:
	if 0 != 0 {
		goto __6
	}
	goto __8
__8:
	;
	goto __5
__4:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclCompileTokens(tls, interp, valTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valTokenPtr)).FnumComponents, envPtr)
__5:
	;

__41:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __44
	}
	XTclExpandCodeArray(tls, envPtr)
__44:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_INDEX_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __45
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST_INDEX_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__45:
	;
__46:
	_delta2 = XtclInstructionTable[INST_LIST_INDEX_IMM].FstackEffect
	if !(_delta2 != 0) {
		goto __49
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __50
	}
	_delta2 = 1 - *(*int32)(unsafe.Pointer(bp))
__50:
	;
__51:
	if !(_delta2 < 0) {
		goto __54
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __55
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__55:
	;
__54:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __52
__52:
	if 0 != 0 {
		goto __51
	}
	goto __53
__53:
	;
__49:
	;
	goto __47
__47:
	if 0 != 0 {
		goto __46
	}
	goto __48
__48:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
	return TCL_OK
__3:
	;

	// If the value was not known at compile time, the conversion failed or
	// the value was negative, we just keep on going with the more complex
	// compilation.

	// Push the operands onto the stack.

emitComplexLindex:
	i = 1
__56:
	if !(i < numWords) {
		goto __58
	}
	if !((*Tcl_Token)(unsafe.Pointer(valTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __59
	}
__61:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy1 <= 255) {
		goto __64
	}
__66:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __69
	}
	XTclExpandCodeArray(tls, envPtr)
__69:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __70
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__70:
	;
__71:
	_delta3 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta3 != 0) {
		goto __74
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __75
	}
	_delta3 = 1 - _objIndexCopy1
__75:
	;
__76:
	if !(_delta3 < 0) {
		goto __79
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __80
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__80:
	;
__79:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __77
__77:
	if 0 != 0 {
		goto __76
	}
	goto __78
__78:
	;
__74:
	;
	goto __72
__72:
	if 0 != 0 {
		goto __71
	}
	goto __73
__73:
	;
	goto __67
__67:
	if 0 != 0 {
		goto __66
	}
	goto __68
__68:
	;
	goto __65
__64:
__81:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __84
	}
	XTclExpandCodeArray(tls, envPtr)
__84:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __85
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__85:
	;
__86:
	_delta4 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta4 != 0) {
		goto __89
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __90
	}
	_delta4 = 1 - _objIndexCopy1
__90:
	;
__91:
	if !(_delta4 < 0) {
		goto __94
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __95
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__95:
	;
__94:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __92
__92:
	if 0 != 0 {
		goto __91
	}
	goto __93
__93:
	;
__89:
	;
	goto __87
__87:
	if 0 != 0 {
		goto __86
	}
	goto __88
__88:
	;
	goto __82
__82:
	if 0 != 0 {
		goto __81
	}
	goto __83
__83:
	;
__65:
	;
	goto __62
__62:
	if 0 != 0 {
		goto __61
	}
	goto __63
__63:
	;
	goto __60
__59:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
	XTclCompileTokens(tls, interp, valTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valTokenPtr)).FnumComponents, envPtr)
__60:
	;

	valTokenPtr = valTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(valTokenPtr)).FnumComponents+1)*24
	goto __57
__57:
	i++
	goto __56
	goto __58
__58:
	;

	// Emit INST_LIST_INDEX if objc==3, or INST_LIST_INDEX_MULTI if there are
	// multiple index args.

	if !(numWords == 3) {
		goto __96
	}
__98:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __101
	}
	XTclExpandCodeArray(tls, envPtr)
__101:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_INDEX)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __102
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST_INDEX == INST_START_CMD {
			return 1
		}
		return 0
	}()
__102:
	;
__103:
	_delta5 = XtclInstructionTable[INST_LIST_INDEX].FstackEffect
	if !(_delta5 != 0) {
		goto __106
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __107
	}
	_delta5 = 1 - 0
__107:
	;
__108:
	if !(_delta5 < 0) {
		goto __111
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __112
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__112:
	;
__111:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __109
__109:
	if 0 != 0 {
		goto __108
	}
	goto __110
__110:
	;
__106:
	;
	goto __104
__104:
	if 0 != 0 {
		goto __103
	}
	goto __105
__105:
	;
	goto __99
__99:
	if 0 != 0 {
		goto __98
	}
	goto __100
__100:
	;
	goto __97
__96:
__113:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __116
	}
	XTclExpandCodeArray(tls, envPtr)
__116:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_INDEX_MULTI)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords-1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords-1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords-1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numWords - 1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __117
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST_INDEX_MULTI == INST_START_CMD {
			return 1
		}
		return 0
	}()
__117:
	;
__118:
	_delta6 = XtclInstructionTable[INST_LIST_INDEX_MULTI].FstackEffect
	if !(_delta6 != 0) {
		goto __121
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __122
	}
	_delta6 = 1 - (numWords - 1)
__122:
	;
__123:
	if !(_delta6 < 0) {
		goto __126
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __127
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__127:
	;
__126:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __124
__124:
	if 0 != 0 {
		goto __123
	}
	goto __125
__125:
	;
__121:
	;
	goto __119
__119:
	if 0 != 0 {
		goto __118
	}
	goto __120
__120:
	;
	goto __114
__114:
	if 0 != 0 {
		goto __113
	}
	goto __115
__115:
	;
__97:
	;

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileListCmd --
//
//	Procedure called to compile the "list" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "list" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileListCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1154:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var valueTokenPtr uintptr
	var i int32
	var numWords int32
	var concat int32
	var build int32
	var listObj uintptr
	var objPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 1 {
		// [list] without arguments just pushes an empty object.

		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		return TCL_OK
	}

	// Test if all arguments are compile-time known. If they are, we can
	// implement with a simple push.

	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	valueTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	listObj = XTcl_NewObj(tls)
	for i = 1; i < numWords && listObj != uintptr(0); i++ {
		objPtr = XTcl_NewObj(tls)
		if XTclWordKnownAtCompileTime(tls, valueTokenPtr, objPtr) != 0 {
			XTcl_ListObjAppendElement(tls, uintptr(0), listObj, objPtr)
		} else {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objPtr uintptr = objPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _objPtr uintptr = listObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			listObj = uintptr(0)
		}
		valueTokenPtr = valueTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+1)*24
	}
	if listObj != uintptr(0) {
		for ok9 := true; ok9; ok9 = 0 != 0 {
			var _objIndexCopy int32 = XTclAddLiteralObj(tls, envPtr, listObj, uintptr(0))
			if _objIndexCopy <= 255 {
				for ok10 := true; ok10; ok10 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok11 := true; ok11; ok11 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok12 := true; ok12; ok12 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok13 := true; ok13; ok13 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok14 := true; ok14; ok14 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok15 := true; ok15; ok15 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		return TCL_OK
	}

	// Push the all values onto the stack.

	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	valueTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	concat = libc.AssignInt32(&build, 0)
	for i = 1; i < numWords; i++ {
		if (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_EXPAND_WORD && build > 0 {
			for ok16 := true; ok16; ok16 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(build) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(build) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(build) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(build))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LIST == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok17 := true; ok17; ok17 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - build
						}
						for ok18 := true; ok18; ok18 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			if concat != 0 {
				for ok19 := true; ok19; ok19 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_CONCAT)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LIST_CONCAT == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok20 := true; ok20; ok20 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LIST_CONCAT].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok21 := true; ok21; ok21 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
			build = 0
			concat = 1
		}
		if (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok22 := true; ok22; ok22 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok23 := true; ok23; ok23 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok24 := true; ok24; ok24 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok25 := true; ok25; ok25 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok26 := true; ok26; ok26 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok27 := true; ok27; ok27 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok28 := true; ok28; ok28 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents, envPtr)
		}

		if (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_EXPAND_WORD {
			if concat != 0 {
				for ok29 := true; ok29; ok29 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_CONCAT)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LIST_CONCAT == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok30 := true; ok30; ok30 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LIST_CONCAT].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok31 := true; ok31; ok31 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				concat = 1
			}
		} else {
			build++
		}
		valueTokenPtr = valueTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+1)*24
	}
	if build > 0 {
		for ok32 := true; ok32; ok32 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(build) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(build) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(build) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(build))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok33 := true; ok33; ok33 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - build
					}
					for ok34 := true; ok34; ok34 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		if concat != 0 {
			for ok35 := true; ok35; ok35 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_CONCAT)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LIST_CONCAT == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok36 := true; ok36; ok36 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LIST_CONCAT].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok37 := true; ok37; ok37 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}

	// If there was just one expanded word, we must ensure that it is a list
	// at this point. We use an [lrange ... 0 end] for this (instead of
	// [llength], as with literals) as we must drop any string representation
	// that might be hanging around.

	if concat != 0 && numWords == 2 {
		for ok38 := true; ok38; ok38 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_RANGE_IMM)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST_RANGE_IMM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok39 := true; ok39; ok39 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST_RANGE_IMM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok40 := true; ok40; ok40 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok41 := true; ok41; ok41 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(libc.Uint32FromInt32(-2))
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileLlengthCmd --
//
//	Procedure called to compile the "llength" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "llength" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileLlengthCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1268:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var varTokenPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}
	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_LENGTH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_LIST_LENGTH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_LIST_LENGTH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileLrangeCmd --
//
//	How to compile the "lrange" command. We only bother because we needed
//	the opcode anyway for "lassign".
//
//----------------------------------------------------------------------

func XTclCompileLrangeCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1301:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var listTokenPtr uintptr
	// var idx1 int32 at bp, 4

	// var idx2 int32 at bp+4, 4

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 4 {
		return TCL_ERROR
	}
	listTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	tokenPtr = listTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(listTokenPtr)).FnumComponents+1)*24
	if XTclGetIndexFromToken(tls, tokenPtr, 0, 0x7fffffff,
		bp) != TCL_OK {
		return TCL_ERROR
	}
	// Token was an index value, and we treat all "first" indices
	// before the list same as the start of the list.

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if XTclGetIndexFromToken(tls, tokenPtr, -1, -2,
		bp+4) != TCL_OK {
		return TCL_ERROR
	}
	// Token was an index value, and we treat all "last" indices
	// after the list same as the end of the list.

	// Issue instructions. It's not safe to skip doing the LIST_RANGE, as
	// we've not proved that the 'list' argument is really a list. Not that it
	// is worth trying to do that given current knowledge.

	if (*Tcl_Token)(unsafe.Pointer(listTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(listTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(listTokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, listTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(listTokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_RANGE_IMM)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_LIST_RANGE_IMM == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_LIST_RANGE_IMM].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - *(*int32)(unsafe.Pointer(bp))
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok10 := true; ok10; ok10 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileLinsertCmd --
//
//	How to compile the "linsert" command. We only bother with the case
//	where the index is constant.
//
//----------------------------------------------------------------------

func XTclCompileLinsertCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1362:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var listTokenPtr uintptr
	// var idx int32 at bp, 4

	var i int32

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 {
		return TCL_ERROR
	}
	listTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	// Parse the index. Will only compile if it is constant and not an
	// _integer_ less than zero (since we reserve negative indices here for
	// end-relative indexing) or an end-based index greater than 'end' itself.

	tokenPtr = listTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(listTokenPtr)).FnumComponents+1)*24

	// NOTE: This command treats all inserts at indices before the list
	// the same as inserts at the start of the list, and all inserts
	// after the list the same as inserts at the end of the list. We
	// make that transformation here so we can use the optimized bytecode
	// as much as possible.
	if XTclGetIndexFromToken(tls, tokenPtr, 0, -2,
		bp) != TCL_OK {
		return TCL_ERROR
	}

	// There are four main cases. If there are no values to insert, this is
	// just a confirm-listiness check. If the index is '0', this is a prepend.
	// If the index is 'end' (== TCL_INDEX_END), this is an append. Otherwise,
	// this is a splice (== split, insert values as list, concat-3).

	if (*Tcl_Token)(unsafe.Pointer(listTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(listTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(listTokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, listTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(listTokenPtr)).FnumComponents, envPtr)
	}

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 3 {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_RANGE_IMM)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST_RANGE_IMM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST_RANGE_IMM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok10 := true; ok10; ok10 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(libc.Uint32FromInt32(-2))
		}
		return TCL_OK
	}

	for i = 3; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok12 := true; ok12; ok12 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok13 := true; ok13; ok13 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok14 := true; ok14; ok14 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok15 := true; ok15; ok15 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok16 := true; ok16; ok16 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok17 := true; ok17; ok17 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

	}
	for ok18 := true; ok18; ok18 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i-3) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i-3) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i-3) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i - 3))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_LIST == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok19 := true; ok19; ok19 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - (i - 3)
				}
				for ok20 := true; ok20; ok20 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	if *(*int32)(unsafe.Pointer(bp)) == 0 {
		for ok21 := true; ok21; ok21 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_REVERSE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok22 := true; ok22; ok22 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 2
					}
					for ok23 := true; ok23; ok23 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok24 := true; ok24; ok24 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_CONCAT)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST_CONCAT == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok25 := true; ok25; ok25 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST_CONCAT].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok26 := true; ok26; ok26 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else if *(*int32)(unsafe.Pointer(bp)) == -2 {
		for ok27 := true; ok27; ok27 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_CONCAT)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST_CONCAT == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok28 := true; ok28; ok28 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST_CONCAT].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok29 := true; ok29; ok29 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		// Here we handle two ranges for idx. First when idx > 0, we
		// want the first half of the split to end at index idx-1 and
		// the second half to start at index idx.
		// Second when idx < TCL_INDEX_END, indicating "end-N" indexing,
		// we want the first half of the split to end at index end-N and
		// the second half to start at index end-N+1. We accomplish this
		// with a pre-adjustment of the end-N value.
		// The root of this is that the commands [lrange] and [linsert]
		// differ in their interpretation of the "end" index.

		if *(*int32)(unsafe.Pointer(bp)) < -2 {
			*(*int32)(unsafe.Pointer(bp /* idx */))++
		}
		for ok30 := true; ok30; ok30 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_OVER == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok31 := true; ok31; ok31 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 1
					}
					for ok32 := true; ok32; ok32 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok33 := true; ok33; ok33 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_RANGE_IMM)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST_RANGE_IMM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok34 := true; ok34; ok34 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST_RANGE_IMM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok35 := true; ok35; ok35 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok36 := true; ok36; ok36 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp)) - 1))
		}
		for ok37 := true; ok37; ok37 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(3))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_REVERSE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok38 := true; ok38; ok38 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 3
					}
					for ok39 := true; ok39; ok39 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok40 := true; ok40; ok40 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_RANGE_IMM)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST_RANGE_IMM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok41 := true; ok41; ok41 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST_RANGE_IMM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - *(*int32)(unsafe.Pointer(bp))
					}
					for ok42 := true; ok42; ok42 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok43 := true; ok43; ok43 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(libc.Uint32FromInt32(-2))
		}
		for ok44 := true; ok44; ok44 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_CONCAT)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST_CONCAT == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok45 := true; ok45; ok45 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST_CONCAT].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok46 := true; ok46; ok46 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok47 := true; ok47; ok47 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_CONCAT)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST_CONCAT == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok48 := true; ok48; ok48 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST_CONCAT].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok49 := true; ok49; ok49 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileLreplaceCmd --
//
//	How to compile the "lreplace" command. We only bother with the case
//	where the indices are constant.
//
//----------------------------------------------------------------------

func XTclCompileLreplaceCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1465:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var listTokenPtr uintptr
	// var idx1 int32 at bp, 4

	// var idx2 int32 at bp+4, 4

	var i int32
	var emptyPrefix int32 = 1
	var suffixStart int32 = 0

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 4 {
		return TCL_ERROR
	}
	listTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	tokenPtr = listTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(listTokenPtr)).FnumComponents+1)*24
	if XTclGetIndexFromToken(tls, tokenPtr, 0, 0x7fffffff,
		bp) != TCL_OK {
		return TCL_ERROR
	}

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if XTclGetIndexFromToken(tls, tokenPtr, -1, -2,
		bp+4) != TCL_OK {
		return TCL_ERROR
	}

	// General structure of the [lreplace] result is
	//		prefix replacement suffix
	// In a few cases we can predict various parts will be empty and
	// take advantage.
	//
	// The proper suffix begins with the greater of indices idx1 or
	// idx2 + 1. If we cannot tell at compile time which is greater,
	// we must defer to direct evaluation.

	if *(*int32)(unsafe.Pointer(bp)) == 0x7fffffff {
		suffixStart = *(*int32)(unsafe.Pointer(bp /* idx1 */))
	} else if *(*int32)(unsafe.Pointer(bp + 4)) == -1 {
		suffixStart = *(*int32)(unsafe.Pointer(bp /* idx1 */))
	} else if *(*int32)(unsafe.Pointer(bp + 4)) == -2 {
		suffixStart = 0x7fffffff
	} else if *(*int32)(unsafe.Pointer(bp + 4)) < -2 && *(*int32)(unsafe.Pointer(bp)) <= -2 ||
		*(*int32)(unsafe.Pointer(bp + 4)) >= 0 && *(*int32)(unsafe.Pointer(bp)) >= 0 {
		if *(*int32)(unsafe.Pointer(bp)) > *(*int32)(unsafe.Pointer(bp + 4))+1 {
			suffixStart = *(*int32)(unsafe.Pointer(bp /* idx1 */))
		} else {
			suffixStart = *(*int32)(unsafe.Pointer(bp + 4)) + 1
		}
	} else {
		return TCL_ERROR
	}

	// All paths start with computing/pushing the original value.
	if (*Tcl_Token)(unsafe.Pointer(listTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(listTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(listTokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, listTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(listTokenPtr)).FnumComponents, envPtr)
	}

	// Push all the replacement values next so any errors raised in
	// creating them get raised first.
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 4 {
		// Push the replacement arguments
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		for i = 4; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
			if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
				for ok7 := true; ok7; ok7 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
					if _objIndexCopy <= 255 {
						for ok8 := true; ok8; ok8 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok9 := true; ok9; ok9 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok10 := true; ok10; ok10 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok11 := true; ok11; ok11 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok12 := true; ok12; ok12 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok13 := true; ok13; ok13 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
			} else {
				(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
				(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
				XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
			}

			tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		}

		// Make a list of them...
		for ok14 := true; ok14; ok14 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i-4) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i-4) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i-4) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i - 4))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok15 := true; ok15; ok15 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - (i - 4)
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}

		emptyPrefix = 0
	}

	if *(*int32)(unsafe.Pointer(bp)) == suffixStart && (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 4 {
		// This is a "no-op". Example: [lreplace {a b c} 2 0]
		// We still do a list operation to get list-verification
		// and canonicalization side effects.
		for ok17 := true; ok17; ok17 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_RANGE_IMM)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST_RANGE_IMM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok18 := true; ok18; ok18 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST_RANGE_IMM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok20 := true; ok20; ok20 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(libc.Uint32FromInt32(-2))
		}
		return TCL_OK
	}

	if *(*int32)(unsafe.Pointer(bp)) != 0 {
		// Prefix may not be empty; generate bytecode to push it
		if emptyPrefix != 0 {
			for ok21 := true; ok21; ok21 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_DUP == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok22 := true; ok22; ok22 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_DUP].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok23 := true; ok23; ok23 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok24 := true; ok24; ok24 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_OVER == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok25 := true; ok25; ok25 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 1
						}
						for ok26 := true; ok26; ok26 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
		for ok27 := true; ok27; ok27 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_RANGE_IMM)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST_RANGE_IMM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok28 := true; ok28; ok28 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST_RANGE_IMM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok29 := true; ok29; ok29 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok30 := true; ok30; ok30 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp)) - 1))
		}
		if !(emptyPrefix != 0) {
			for ok31 := true; ok31; ok31 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_REVERSE == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok32 := true; ok32; ok32 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 2
						}
						for ok33 := true; ok33; ok33 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok34 := true; ok34; ok34 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_CONCAT)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LIST_CONCAT == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok35 := true; ok35; ok35 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LIST_CONCAT].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok36 := true; ok36; ok36 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
		emptyPrefix = 0
	}

	if !(emptyPrefix != 0) {
		for ok37 := true; ok37; ok37 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_REVERSE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok38 := true; ok38; ok38 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 2
					}
					for ok39 := true; ok39; ok39 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	if suffixStart == 0x7fffffff {
		for ok40 := true; ok40; ok40 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok41 := true; ok41; ok41 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok42 := true; ok42; ok42 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		if emptyPrefix != 0 {
			for ok43 := true; ok43; ok43 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
				if _objIndexCopy <= 255 {
					for ok44 := true; ok44; ok44 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok45 := true; ok45; ok45 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok46 := true; ok46; ok46 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok47 := true; ok47; ok47 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok48 := true; ok48; ok48 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok49 := true; ok49; ok49 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		}
	} else {
		// Suffix may not be empty; generate bytecode to push it
		for ok50 := true; ok50; ok50 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_RANGE_IMM)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(suffixStart) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(suffixStart) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(suffixStart) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(suffixStart))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LIST_RANGE_IMM == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok51 := true; ok51; ok51 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LIST_RANGE_IMM].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - suffixStart
					}
					for ok52 := true; ok52; ok52 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok53 := true; ok53; ok53 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(libc.Uint32FromInt32(-2))
		}
		if !(emptyPrefix != 0) {
			for ok54 := true; ok54; ok54 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_CONCAT)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LIST_CONCAT == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok55 := true; ok55; ok55 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LIST_CONCAT].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok56 := true; ok56; ok56 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileLsetCmd --
//
//	Procedure called to compile the "lset" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "lset" command at
//	runtime.
//
// The general template for execution of the "lset" command is:
//	(1) Instructions to push the variable name, unless the variable is
//	    local to the stack frame.
//	(2) If the variable is an array element, instructions to push the
//	    array element name.
//	(3) Instructions to push each of zero or more "index" arguments to the
//	    stack, followed with the "newValue" element.
//	(4) Instructions to duplicate the variable name and/or array element
//	    name onto the top of the stack, if either was pushed at steps (1)
//	    and (2).
//	(5) The appropriate INST_LOAD_* instruction to place the original
//	    value of the list variable at top of stack.
//	(6) At this point, the stack contains:
//		varName? arrayElementName? index1 index2 ... newValue oldList
//	    The compiler emits one of INST_LSET_FLAT or INST_LSET_LIST
//	    according as whether there is exactly one index element (LIST) or
//	    either zero or else two or more (FLAT). This instruction removes
//	    everything from the stack except for the two names and pushes the
//	    new value of the variable.
//	(7) Finally, INST_STORE_* stores the new value in the variable and
//	    cleans up the stack.
//
//----------------------------------------------------------------------

func XTclCompileLsetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1629:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tempDepth int32                                                  // Depth used for emitting one part of the
	// code burst.
	var varTokenPtr uintptr // Pointer to the Tcl_Token representing the
	// parse of the variable name.
	// var localIndex int32 at bp, 4
	// Index of var in local var table.
	// var isScalar int32 at bp+4, 4
	// Flag == 1 if scalar, 0 if array.
	var i int32

	// Check argument count.

	// TODO: Consider support for compiling expanded args.
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 {
		// Fail at run time, not in compilation.

		return TCL_ERROR
	}

	// Decide if we can use a frame slot for the var/array name or if we need
	// to emit code to compute and push the name at runtime. We use a frame
	// slot (entry in the array of local vars) if we are compiling a procedure
	// body and if the name is simple text that does not include namespace
	// qualifiers.

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclPushVarName(tls, interp, varTokenPtr, envPtr, 0, bp, bp+4)

	// Push the "index" args and the new element value.

	for i = 2; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		varTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents, envPtr)
		}

	}

	// Duplicate the variable name if it's been pushed.

	if *(*int32)(unsafe.Pointer(bp)) < 0 {
		if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
			tempDepth = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 2
		} else {
			tempDepth = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 1
		}
		for ok7 := true; ok7; ok7 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tempDepth) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tempDepth) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tempDepth) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tempDepth))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_OVER == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - tempDepth
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	// Duplicate an array index if one's been pushed.

	if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
		if *(*int32)(unsafe.Pointer(bp)) < 0 {
			tempDepth = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 1
		} else {
			tempDepth = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 2
		}
		for ok10 := true; ok10; ok10 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tempDepth) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tempDepth) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tempDepth) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tempDepth))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_OVER == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - tempDepth
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	// Emit code to load the variable's value.

	if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
		if *(*int32)(unsafe.Pointer(bp)) < 0 {
			for ok13 := true; ok13; ok13 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_STK)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_STK == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok14 := true; ok14; ok14 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_STK].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok15 := true; ok15; ok15 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			if *(*int32)(unsafe.Pointer(bp)) <= 255 {
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_SCALAR1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok17 := true; ok17; ok17 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok18 := true; ok18; ok18 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok19 := true; ok19; ok19 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_SCALAR4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok20 := true; ok20; ok20 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok21 := true; ok21; ok21 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}

		}
	} else {
		if *(*int32)(unsafe.Pointer(bp)) < 0 {
			for ok22 := true; ok22; ok22 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_ARRAY_STK)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_ARRAY_STK == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok23 := true; ok23; ok23 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_ARRAY_STK].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok24 := true; ok24; ok24 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			if *(*int32)(unsafe.Pointer(bp)) <= 255 {
				for ok25 := true; ok25; ok25 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_ARRAY1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_ARRAY1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok26 := true; ok26; ok26 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_ARRAY1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok27 := true; ok27; ok27 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok28 := true; ok28; ok28 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_ARRAY4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_ARRAY4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok29 := true; ok29; ok29 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_ARRAY4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok30 := true; ok30; ok30 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}

		}
	}

	// Emit the correct variety of 'lset' instruction.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 4 {
		for ok31 := true; ok31; ok31 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LSET_LIST)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LSET_LIST == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok32 := true; ok32; ok32 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LSET_LIST].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok33 := true; ok33; ok33 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok34 := true; ok34; ok34 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LSET_FLAT)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LSET_FLAT == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok35 := true; ok35; ok35 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LSET_FLAT].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - ((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 1)
					}
					for ok36 := true; ok36; ok36 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	// Emit code to put the value back in the variable.

	if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
		if *(*int32)(unsafe.Pointer(bp)) < 0 {
			for ok37 := true; ok37; ok37 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_STK)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_STK == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok38 := true; ok38; ok38 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_STK].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok39 := true; ok39; ok39 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			if *(*int32)(unsafe.Pointer(bp)) <= 255 {
				for ok40 := true; ok40; ok40 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_SCALAR1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok41 := true; ok41; ok41 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok42 := true; ok42; ok42 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok43 := true; ok43; ok43 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_SCALAR4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok44 := true; ok44; ok44 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok45 := true; ok45; ok45 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}

		}
	} else {
		if *(*int32)(unsafe.Pointer(bp)) < 0 {
			for ok46 := true; ok46; ok46 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_ARRAY_STK)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_ARRAY_STK == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok47 := true; ok47; ok47 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_ARRAY_STK].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok48 := true; ok48; ok48 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			if *(*int32)(unsafe.Pointer(bp)) <= 255 {
				for ok49 := true; ok49; ok49 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_ARRAY1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_ARRAY1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok50 := true; ok50; ok50 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_ARRAY1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok51 := true; ok51; ok51 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok52 := true; ok52; ok52 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_ARRAY4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_ARRAY4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok53 := true; ok53; ok53 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_ARRAY4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(bp))
							}
							for ok54 := true; ok54; ok54 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}

		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileNamespace*Cmd --
//
//	Procedures called to compile the "namespace" command; currently, only
//	the subcommands "namespace current" and "namespace upvar" are compiled
//	to bytecodes, and the latter only inside a procedure(-like) context.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "namespace upvar"
//	command at runtime.
//
//----------------------------------------------------------------------

func XTclCompileNamespaceCurrentCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1776:1: */
	// Only compile [namespace current] without arguments.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 1 {
		return TCL_ERROR
	}

	// Not much to do; we compile to a single instruction...

	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_NS_CURRENT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_NS_CURRENT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_NS_CURRENT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileNamespaceCodeCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1801:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	// The specification of [namespace code] is rather shocking, in that it is
	// supposed to check if the argument is itself the result of [namespace
	// code] and not apply itself in that case. Which is excessively cautious,
	// but what the test suite checks for.

	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD || (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize > 20 &&
		libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, ts+18723, uint64(20)) == 0 {
		// Technically, we could just pass a literal '::namespace inscope '
		// term through, but that's something which really shouldn't be
		// occurring as something that the user writes so we'll just punt it.

		return TCL_ERROR
	}

	// Now we can compile using the same strategy as [namespace code]'s normal
	// implementation does internally. Note that we can't bind the namespace
	// name directly here, because TclOO plays complex games with namespaces;
	// the value needs to be determined at runtime for safety.

	for ok := true; ok; ok = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+18744, int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok3 := true; ok3; ok3 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok4 := true; ok4; ok4 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok6 := true; ok6; ok6 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok7 := true; ok7; ok7 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+18756, int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok8 := true; ok8; ok8 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok10 := true; ok10; ok10 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok11 := true; ok11; ok11 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok12 := true; ok12; ok12 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok13 := true; ok13; ok13 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok14 := true; ok14; ok14 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_NS_CURRENT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_NS_CURRENT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok15 := true; ok15; ok15 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_NS_CURRENT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok17 := true; ok17; ok17 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok18 := true; ok18; ok18 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok20 := true; ok20; ok20 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok21 := true; ok21; ok21 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok22 := true; ok22; ok22 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok23 := true; ok23; ok23 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok24 := true; ok24; ok24 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(4)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(4)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(4)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(4))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_LIST == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok25 := true; ok25; ok25 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 4
				}
				for ok26 := true; ok26; ok26 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileNamespaceOriginCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1851:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ORIGIN_COMMAND)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_ORIGIN_COMMAND == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_ORIGIN_COMMAND].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileNamespaceQualifiersCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1873:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	var off int32

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}

	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+18333, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok8 := true; ok8; ok8 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok10 := true; ok10; ok10 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok11 := true; ok11; ok11 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok12 := true; ok12; ok12 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok13 := true; ok13; ok13 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok14 := true; ok14; ok14 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+6847, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok15 := true; ok15; ok15 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok17 := true; ok17; ok17 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok18 := true; ok18; ok18 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok19 := true; ok19; ok19 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok20 := true; ok20; ok20 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok21 := true; ok21; ok21 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_OVER == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok22 := true; ok22; ok22 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 2
				}
				for ok23 := true; ok23; ok23 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok24 := true; ok24; ok24 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_FIND_LAST)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_FIND_LAST == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok25 := true; ok25; ok25 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_FIND_LAST].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok26 := true; ok26; ok26 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	off = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok27 := true; ok27; ok27 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok28 := true; ok28; ok28 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok29 := true; ok29; ok29 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok30 := true; ok30; ok30 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok31 := true; ok31; ok31 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok32 := true; ok32; ok32 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok33 := true; ok33; ok33 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok34 := true; ok34; ok34 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_SUB)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_SUB == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok35 := true; ok35; ok35 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_SUB].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok36 := true; ok36; ok36 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok37 := true; ok37; ok37 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_OVER == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok38 := true; ok38; ok38 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 2
				}
				for ok39 := true; ok39; ok39 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok40 := true; ok40; ok40 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_OVER == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok41 := true; ok41; ok41 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 1
				}
				for ok42 := true; ok42; ok42 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok43 := true; ok43; ok43 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_INDEX)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_INDEX == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok44 := true; ok44; ok44 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_INDEX].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok45 := true; ok45; ok45 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok46 := true; ok46; ok46 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+18764, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok47 := true; ok47; ok47 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok48 := true; ok48; ok48 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok49 := true; ok49; ok49 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok50 := true; ok50; ok50 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok51 := true; ok51; ok51 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok52 := true; ok52; ok52 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok53 := true; ok53; ok53 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_EQ == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok54 := true; ok54; ok54 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_EQ].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok55 := true; ok55; ok55 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	off = int32(int64(off) - (int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1)
	for ok56 := true; ok56; ok56 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(off))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP_TRUE1 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok57 := true; ok57; ok57 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - off
				}
				for ok58 := true; ok58; ok58 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok59 := true; ok59; ok59 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_RANGE)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_RANGE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok60 := true; ok60; ok60 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_RANGE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok61 := true; ok61; ok61 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileNamespaceTailCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1909:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	// var jumpFixup JumpFixup at bp, 16

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}

	// Take care; only add 2 to found index if the string was actually found.

	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+6847, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok8 := true; ok8; ok8 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok10 := true; ok10; ok10 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok11 := true; ok11; ok11 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok12 := true; ok12; ok12 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok13 := true; ok13; ok13 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok14 := true; ok14; ok14 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_OVER == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok15 := true; ok15; ok15 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 1
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok17 := true; ok17; ok17 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_FIND_LAST)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_FIND_LAST == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok18 := true; ok18; ok18 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_FIND_LAST].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok19 := true; ok19; ok19 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok20 := true; ok20; ok20 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DUP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok21 := true; ok21; ok21 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DUP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok22 := true; ok22; ok22 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok23 := true; ok23; ok23 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+18333, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok24 := true; ok24; ok24 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok25 := true; ok25; ok25 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok26 := true; ok26; ok26 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok27 := true; ok27; ok27 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok28 := true; ok28; ok28 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok29 := true; ok29; ok29 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok30 := true; ok30; ok30 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_GE)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_GE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok31 := true; ok31; ok31 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_GE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok32 := true; ok32; ok32 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	XTclEmitForwardJump(tls, envPtr, TCL_FALSE_JUMP, bp)
	for ok33 := true; ok33; ok33 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+18766, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok34 := true; ok34; ok34 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok35 := true; ok35; ok35 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok36 := true; ok36; ok36 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok37 := true; ok37; ok37 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok38 := true; ok38; ok38 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok39 := true; ok39; ok39 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok40 := true; ok40; ok40 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_ADD)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_ADD == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok41 := true; ok41; ok41 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_ADD].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok42 := true; ok42; ok42 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	XTclFixupForwardJump(tls, envPtr, bp, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp)).FcodeOffset)), 127)
	for ok43 := true; ok43; ok43 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+18768, int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok44 := true; ok44; ok44 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok45 := true; ok45; ok45 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok46 := true; ok46; ok46 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok47 := true; ok47; ok47 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok48 := true; ok48; ok48 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok49 := true; ok49; ok49 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok50 := true; ok50; ok50 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_RANGE)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_RANGE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok51 := true; ok51; ok51 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_RANGE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok52 := true; ok52; ok52 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileNamespaceUpvarCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:1946:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var otherTokenPtr uintptr
	var localTokenPtr uintptr
	var localIndex int32
	var numWords int32
	var i int32

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Only compile [namespace upvar ...]: needs an even number of args, >=4

	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	if numWords%2 != 0 || numWords < 4 {
		return TCL_ERROR
	}

	// Push the namespace

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	// Loop over the (otherVar, thisVar) pairs. If any of the thisVar is not a
	// local variable, return an error so that the non-compiled command will
	// be called at runtime.

	localTokenPtr = tokenPtr
	for i = 2; i < numWords; i = i + 2 {
		otherTokenPtr = localTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(localTokenPtr)).FnumComponents+1)*24
		localTokenPtr = otherTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(otherTokenPtr)).FnumComponents+1)*24

		if (*Tcl_Token)(unsafe.Pointer(otherTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(otherTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(otherTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, otherTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(otherTokenPtr)).FnumComponents, envPtr)
		}

		localIndex = XTclLocalScalarFromToken(tls, localTokenPtr, envPtr)
		if localIndex < 0 {
			return TCL_ERROR
		}
		for ok14 := true; ok14; ok14 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_NSUPVAR)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_NSUPVAR == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok15 := true; ok15; ok15 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_NSUPVAR].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - localIndex
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	// Pop the namespace, and set the result to empty

	for ok17 := true; ok17; ok17 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok18 := true; ok18; ok18 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok19 := true; ok19; ok19 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok20 := true; ok20; ok20 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok21 := true; ok21; ok21 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok22 := true; ok22; ok22 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok23 := true; ok23; ok23 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok24 := true; ok24; ok24 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok25 := true; ok25; ok25 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok26 := true; ok26; ok26 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileNamespaceWhichCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:2007:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var opt uintptr
	var idx int32

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 2 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 3 {
		return TCL_ERROR
	}
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	idx = 1

	// If there's an option, check that it's "-command". We don't handle
	// "-variable" (currently) and anything else is an error.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 3 {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
			return TCL_ERROR
		}
		opt = tokenPtr + uintptr(1)*24
		if (*Tcl_Token)(unsafe.Pointer(opt)).Fsize < 2 || (*Tcl_Token)(unsafe.Pointer(opt)).Fsize > 8 ||
			libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(opt)).Fstart, ts+15408, uint64((*Tcl_Token)(unsafe.Pointer(opt)).Fsize)) != 0 {
			return TCL_ERROR
		}
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		idx++
	}

	// Issue the bytecode.

	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(idx)*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(idx)*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_RESOLVE_COMMAND)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_RESOLVE_COMMAND == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_RESOLVE_COMMAND].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileRegexpCmd --
//
//	Procedure called to compile the "regexp" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "regexp" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileRegexpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:2071:1: */
	bp := tls.Alloc(220)
	defer tls.Free(220)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var varTokenPtr uintptr                                              // Pointer to the Tcl_Token representing the
	// parse of the RE or string.
	var i int32
	var len int32
	var nocase int32
	// var exact int32 at bp+216, 4

	var sawLast int32
	var simple int32
	var str uintptr

	// We are only interested in compiling simple regexp cases. Currently
	// supported compile cases are:
	//   regexp ?-nocase? ?--? staticString $var
	//   regexp ?-nocase? ?--? {^staticString$} $var

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 {
		return TCL_ERROR
	}

	simple = 0
	nocase = 0
	sawLast = 0
	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr

	// We only look for -nocase and -- as options. Everything else gets pushed
	// to runtime execution. This is different than regexp's runtime option
	// handling, but satisfies our stricter needs.

	for i = 1; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2; i++ {
		varTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
			// Not a simple string, so punt to runtime.

			return TCL_ERROR
		}
		str = (*Tcl_Token)(unsafe.Pointer(varTokenPtr + 1*24)).Fstart
		len = (*Tcl_Token)(unsafe.Pointer(varTokenPtr + 1*24)).Fsize
		if len == 2 && int32(*(*int8)(unsafe.Pointer(str))) == '-' && int32(*(*int8)(unsafe.Pointer(str + 1))) == '-' {
			sawLast++
			i++
			break
		} else if len > 1 && libc.Xstrncmp(tls, str, ts+14955, uint64(len)) == 0 {
			nocase = 1
		} else {
			// Not an option we recognize.

			return TCL_ERROR
		}
	}

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-i != 2 {
		// We don't support capturing to variables.

		return TCL_ERROR
	}

	// Get the regexp string. If it is not a simple string or can't be
	// converted to a glob pattern, push the word for the INST_REGEXP.
	// Keep changes here in sync with TclCompileSwitchCmd Switch_Regexp.

	varTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24

	if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		// var ds Tcl_DString at bp, 216

		str = (*Tcl_Token)(unsafe.Pointer(varTokenPtr + 1*24)).Fstart
		len = (*Tcl_Token)(unsafe.Pointer(varTokenPtr + 1*24)).Fsize

		// If it has a '-', it could be an incorrectly formed regexp command.

		if int32(*(*int8)(unsafe.Pointer(str))) == '-' && !(sawLast != 0) {
			return TCL_ERROR
		}

		if len == 0 {
			// The semantics of regexp are always match on re == "".

			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
			return TCL_OK
		}

		// Attempt to convert pattern to glob.  If successful, push the
		// converted pattern as a literal.

		if XTclReToGlob(tls, uintptr(0), (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fstart, len, bp, bp+216, uintptr(0)) ==
			TCL_OK {
			simple = 1
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring, (*Tcl_DString)(unsafe.Pointer(bp)).Flength, 0)
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
			XTcl_DStringFree(tls, bp)
		}
	}

	if !(simple != 0) {
		if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok14 := true; ok14; ok14 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok15 := true; ok15; ok15 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok16 := true; ok16; ok16 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok17 := true; ok17; ok17 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok18 := true; ok18; ok18 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok19 := true; ok19; ok19 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok20 := true; ok20; ok20 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2)*8))
			XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents, envPtr)
		}

	}

	// Push the string arg.

	varTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok21 := true; ok21; ok21 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok22 := true; ok22; ok22 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok23 := true; ok23; ok23 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok24 := true; ok24; ok24 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok25 := true; ok25; ok25 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok26 := true; ok26; ok26 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok27 := true; ok27; ok27 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1)*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1)*8))
		XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents, envPtr)
	}

	if simple != 0 {
		if *(*int32)(unsafe.Pointer(bp + 216)) != 0 && !(nocase != 0) {
			for ok28 := true; ok28; ok28 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STR_EQ == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok29 := true; ok29; ok29 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STR_EQ].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok30 := true; ok30; ok30 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok31 := true; ok31; ok31 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_MATCH)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(nocase))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STR_MATCH == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok32 := true; ok32; ok32 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STR_MATCH].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - nocase
						}
						for ok33 := true; ok33; ok33 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	} else {
		// Pass correct RE compile flags.  We use only Int1 (8-bit), but
		// that handles all the flags we want to pass.
		// Don't use TCL_REG_NOSUB as we may have backrefs.

		var cflags int32 = TCL_REG_ADVANCED | func() int32 {
			if nocase != 0 {
				return TCL_REG_NOCASE
			}
			return 0
		}()

		for ok34 := true; ok34; ok34 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REGEXP)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(cflags))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_REGEXP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok35 := true; ok35; ok35 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_REGEXP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - cflags
					}
					for ok36 := true; ok36; ok36 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileRegsubCmd --
//
//	Procedure called to compile the "regsub" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "regsub" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileRegsubCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:2236:1: */
	bp := tls.Alloc(228)
	defer tls.Free(228)

	// We only compile the case with [regsub -all] where the pattern is both
	// known at compile time and simple (i.e., no RE metacharacters). That is,
	// the pattern must be translatable into a glob like "*foo*" with no other
	// glob metacharacters inside it; there must be some "foo" in there too.
	// The substitution string must also be known at compile time and free of
	// metacharacters ("\digit" and "&"). Finally, there must not be a
	// variable mentioned in the [regsub] to write the result back to (because
	// we can't get the count of substitutions that would be the result in
	// that case). The key is that these are the conditions under which a
	// [string map] could be used instead, in particular a [string map] of the
	// form we can compile to bytecode.
	//
	// In short, we look for:
	//
	//   regsub -all [--] simpleRE string simpleReplacement
	//
	// The only optional part is the "--", and no other options are handled.

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var tokenPtr uintptr
	var stringTokenPtr uintptr
	var patternObj uintptr
	var replacementObj uintptr
	// var pattern Tcl_DString at bp, 216

	var bytes uintptr
	// var len int32 at bp+216, 4

	// var exact int32 at bp+220, 4

	// var quantified int32 at bp+224, 4

	var result int32
	var _objPtr uintptr
	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _objIndexCopy1 int32
	var _delta4 int32
	var _delta5 int32
	var _objIndexCopy2 int32
	var _delta6 int32
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	patternObj = uintptr(0)
	replacementObj = uintptr(0)
	result = TCL_ERROR

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 5 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 6) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	// Parse the "-all", which must be the first argument (other options not
	// supported, non-"-all" substitution we can't compile).

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD || (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize != 4 ||
		libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, ts+14862, uint64(4)) != 0) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	// Get the pattern into patternObj, checking for "--" in the process.

	XTcl_DStringInit(tls, bp)
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	patternObj = XTcl_NewObj(tls)
	if !!(XTclWordKnownAtCompileTime(tls, tokenPtr, patternObj) != 0) {
		goto __3
	}
	goto done
__3:
	;
	if !(int32(*(*int8)(unsafe.Pointer(XTcl_GetString(tls, patternObj)))) == '-') {
		goto __4
	}
	if !(libc.Xstrcmp(tls, XTcl_GetString(tls, patternObj), ts+15828) != 0 ||
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 5) {
		goto __6
	}
	goto done
__6:
	;
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
__7:
	_objPtr = patternObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __10
	}
	XTclFreeObj(tls, _objPtr)
__10:
	;
	goto __8
__8:
	if 0 != 0 {
		goto __7
	}
	goto __9
__9:
	;
	patternObj = XTcl_NewObj(tls)
	if !!(XTclWordKnownAtCompileTime(tls, tokenPtr, patternObj) != 0) {
		goto __11
	}
	goto done
__11:
	;
	goto __5
__4:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 6) {
		goto __12
	}
	goto done
__12:
	;
__5:
	;

	// Identify the code which produces the string to apply the substitution
	// to (stringTokenPtr), and the replacement string (into replacementObj).

	stringTokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	tokenPtr = stringTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents+1)*24
	replacementObj = XTcl_NewObj(tls)
	if !!(XTclWordKnownAtCompileTime(tls, tokenPtr, replacementObj) != 0) {
		goto __13
	}
	goto done
__13:
	;

	// Next, higher-level checks. Is the RE a very simple glob? Is the
	// replacement "simple"?

	bytes = XTcl_GetStringFromObj(tls, patternObj, bp+216)
	if !(XTclReToGlob(tls, uintptr(0), bytes, *(*int32)(unsafe.Pointer(bp + 216)), bp, bp+220, bp+224) !=
		TCL_OK || *(*int32)(unsafe.Pointer(bp + 220)) != 0 || *(*int32)(unsafe.Pointer(bp + 224)) != 0) {
		goto __14
	}
	goto done
__14:
	;
	bytes = (*Tcl_DString)(unsafe.Pointer(bp)).Fstring
	if !(int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bytes, 1)))) != '*') {
		goto __15
	}
	goto done
__15:
	;
__16:
	if !(1 != 0) {
		goto __17
	}
	switch int32(*(*int8)(unsafe.Pointer(bytes))) {
	case '*':
		goto __19
	case 0:
		goto __20
	case '?':
		goto __21
	case '[':
		goto __22
	case '\\':
		goto __23
	}
	goto __18
__19:
	if !(int32(*(*int8)(unsafe.Pointer(bytes + 1))) == 0) {
		goto __24
	}
	// OK, we've proved there are no metacharacters except for the
	// '*' at each end.

	*(*int32)(unsafe.Pointer(bp + 216 /* len */)) = (*Tcl_DString)(unsafe.Pointer(bp)).Flength - 2
	if !(*(*int32)(unsafe.Pointer(bp + 216)) > 0) {
		goto __25
	}
	goto isSimpleGlob
__25:
	;

	// The pattern is "**"! I believe that should be impossible,
	// but we definitely can't handle that at all.
__24:
	;
__20:
__21:
__22:
__23:
	goto done
__18:
	;
	bytes++
	goto __16
__17:
	;
isSimpleGlob:
	bytes = XTcl_GetString(tls, replacementObj)
__26:
	if !(*(*int8)(unsafe.Pointer(bytes)) != 0) {
		goto __28
	}
	switch int32(*(*int8)(unsafe.Pointer(bytes))) {
	case '\\':
		goto __30
	case '&':
		goto __31
	}
	goto __29
__30:
__31:
	goto done
__29:
	;
	goto __27
__27:
	bytes++
	goto __26
	goto __28
__28:
	;

	// Proved the simplicity constraints! Time to issue the code.

	result = TCL_OK
	bytes = (*Tcl_DString)(unsafe.Pointer(bp)).Fstring + uintptr(1)
__32:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp + 216)), 0)
	if !(_objIndexCopy <= 255) {
		goto __35
	}
__37:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __40
	}
	XTclExpandCodeArray(tls, envPtr)
__40:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __41
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__41:
	;
__42:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __45
	}
	if !(_delta == -0x7fffffff-1) {
		goto __46
	}
	_delta = 1 - _objIndexCopy
__46:
	;
__47:
	if !(_delta < 0) {
		goto __50
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __51
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__51:
	;
__50:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __48
__48:
	if 0 != 0 {
		goto __47
	}
	goto __49
__49:
	;
__45:
	;
	goto __43
__43:
	if 0 != 0 {
		goto __42
	}
	goto __44
__44:
	;
	goto __38
__38:
	if 0 != 0 {
		goto __37
	}
	goto __39
__39:
	;
	goto __36
__35:
__52:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __55
	}
	XTclExpandCodeArray(tls, envPtr)
__55:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __56
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__56:
	;
__57:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __60
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __61
	}
	_delta1 = 1 - _objIndexCopy
__61:
	;
__62:
	if !(_delta1 < 0) {
		goto __65
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __66
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__66:
	;
__65:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __63
__63:
	if 0 != 0 {
		goto __62
	}
	goto __64
__64:
	;
__60:
	;
	goto __58
__58:
	if 0 != 0 {
		goto __57
	}
	goto __59
__59:
	;
	goto __53
__53:
	if 0 != 0 {
		goto __52
	}
	goto __54
__54:
	;
__36:
	;
	goto __33
__33:
	if 0 != 0 {
		goto __32
	}
	goto __34
__34:
	;
	bytes = XTcl_GetStringFromObj(tls, replacementObj, bp+216)
__67:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp + 216)), 0)
	if !(_objIndexCopy1 <= 255) {
		goto __70
	}
__72:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __75
	}
	XTclExpandCodeArray(tls, envPtr)
__75:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __76
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__76:
	;
__77:
	_delta2 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta2 != 0) {
		goto __80
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __81
	}
	_delta2 = 1 - _objIndexCopy1
__81:
	;
__82:
	if !(_delta2 < 0) {
		goto __85
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __86
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__86:
	;
__85:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __83
__83:
	if 0 != 0 {
		goto __82
	}
	goto __84
__84:
	;
__80:
	;
	goto __78
__78:
	if 0 != 0 {
		goto __77
	}
	goto __79
__79:
	;
	goto __73
__73:
	if 0 != 0 {
		goto __72
	}
	goto __74
__74:
	;
	goto __71
__70:
__87:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __90
	}
	XTclExpandCodeArray(tls, envPtr)
__90:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __91
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__91:
	;
__92:
	_delta3 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta3 != 0) {
		goto __95
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __96
	}
	_delta3 = 1 - _objIndexCopy1
__96:
	;
__97:
	if !(_delta3 < 0) {
		goto __100
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __101
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__101:
	;
__100:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __98
__98:
	if 0 != 0 {
		goto __97
	}
	goto __99
__99:
	;
__95:
	;
	goto __93
__93:
	if 0 != 0 {
		goto __92
	}
	goto __94
__94:
	;
	goto __88
__88:
	if 0 != 0 {
		goto __87
	}
	goto __89
__89:
	;
__71:
	;
	goto __68
__68:
	if 0 != 0 {
		goto __67
	}
	goto __69
__69:
	;
	if !((*Tcl_Token)(unsafe.Pointer(stringTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __102
	}
__104:
	_objIndexCopy2 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy2 <= 255) {
		goto __107
	}
__109:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __112
	}
	XTclExpandCodeArray(tls, envPtr)
__112:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __113
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__113:
	;
__114:
	_delta4 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta4 != 0) {
		goto __117
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __118
	}
	_delta4 = 1 - _objIndexCopy2
__118:
	;
__119:
	if !(_delta4 < 0) {
		goto __122
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __123
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__123:
	;
__122:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __120
__120:
	if 0 != 0 {
		goto __119
	}
	goto __121
__121:
	;
__117:
	;
	goto __115
__115:
	if 0 != 0 {
		goto __114
	}
	goto __116
__116:
	;
	goto __110
__110:
	if 0 != 0 {
		goto __109
	}
	goto __111
__111:
	;
	goto __108
__107:
__124:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __127
	}
	XTclExpandCodeArray(tls, envPtr)
__127:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __128
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__128:
	;
__129:
	_delta5 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta5 != 0) {
		goto __132
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __133
	}
	_delta5 = 1 - _objIndexCopy2
__133:
	;
__134:
	if !(_delta5 < 0) {
		goto __137
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __138
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__138:
	;
__137:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __135
__135:
	if 0 != 0 {
		goto __134
	}
	goto __136
__136:
	;
__132:
	;
	goto __130
__130:
	if 0 != 0 {
		goto __129
	}
	goto __131
__131:
	;
	goto __125
__125:
	if 0 != 0 {
		goto __124
	}
	goto __126
__126:
	;
__108:
	;
	goto __105
__105:
	if 0 != 0 {
		goto __104
	}
	goto __106
__106:
	;
	goto __103
__102:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-2)*8))
	XTclCompileTokens(tls, interp, stringTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents, envPtr)
__103:
	;

__139:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __142
	}
	XTclExpandCodeArray(tls, envPtr)
__142:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_MAP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __143
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_MAP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__143:
	;
__144:
	_delta6 = XtclInstructionTable[INST_STR_MAP].FstackEffect
	if !(_delta6 != 0) {
		goto __147
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __148
	}
	_delta6 = 1 - 0
__148:
	;
__149:
	if !(_delta6 < 0) {
		goto __152
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __153
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__153:
	;
__152:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __150
__150:
	if 0 != 0 {
		goto __149
	}
	goto __151
__151:
	;
__147:
	;
	goto __145
__145:
	if 0 != 0 {
		goto __144
	}
	goto __146
__146:
	;
	goto __140
__140:
	if 0 != 0 {
		goto __139
	}
	goto __141
__141:
	;

done:
	XTcl_DStringFree(tls, bp)
	if !(patternObj != 0) {
		goto __154
	}
__155:
	_objPtr1 = patternObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __158
	}
	XTclFreeObj(tls, _objPtr1)
__158:
	;
	goto __156
__156:
	if 0 != 0 {
		goto __155
	}
	goto __157
__157:
	;
__154:
	;
	if !(replacementObj != 0) {
		goto __159
	}
__160:
	_objPtr2 = replacementObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __163
	}
	XTclFreeObj(tls, _objPtr2)
__163:
	;
	goto __161
__161:
	if 0 != 0 {
		goto __160
	}
	goto __162
__162:
	;
__159:
	;
	return result
}

//----------------------------------------------------------------------
//
// TclCompileReturnCmd --
//
//	Procedure called to compile the "return" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "return" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileReturnCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:2411:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	// General syntax: [return ?-option value ...? ?result?]
	// An even number of words means an explicit result argument is present.
	// var level int32 at bp+12, 4

	// var code int32 at bp+8, 4

	var objc int32
	// var size int32 at bp+16, 4

	var status int32
	var numWords int32
	var explicitResult int32
	var numOptionWords int32
	// var returnOpts uintptr at bp, 8

	var objv uintptr
	var wordTokenPtr uintptr
	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _objIndexCopy1 int32
	var optsTokenPtr uintptr
	var msgTokenPtr uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr
	var _delta4 int32
	var _delta5 int32
	var _objIndexCopy2 int32
	var _delta6 int32
	var _delta7 int32
	var _objIndexCopy3 int32
	var range1 ExceptionRange
	var _objPtr uintptr
	var _delta8 int32
	// We have default return options and we're in a proc ...

	var index int32
	var enclosingCatch int32
	var _objPtr1 uintptr
	var _delta9 int32
	var _delta10 int32
	var _objIndexCopy4 int32
	var _delta11 int32
	var _delta12 int32
	var _delta13 int32
	var _objIndexCopy5 int32
	var _delta14 int32
	var _delta15 int32
	var _objIndexCopy6 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	status = TCL_OK
	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	explicitResult = libc.Bool32(0 == numWords%2)
	numOptionWords = numWords - 1 - explicitResult
	wordTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	// Check for special case which can always be compiled:
	//	    return -options <opts> <msg>
	// Unlike the normal [return] compilation, this version does everything at
	// runtime so it can handle arbitrary words and not just literals. Note
	// that if INST_RETURN_STK wasn't already needed for something else
	// ('finally' clause processing) this piece of code would not be present.

	if !(numWords == 4 && (*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD &&
		(*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fsize == 8 &&
		libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fstart, ts+18772, uint64(8)) == 0) {
		goto __1
	}
	optsTokenPtr = wordTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents+1)*24
	msgTokenPtr = optsTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(optsTokenPtr)).FnumComponents+1)*24

	if !((*Tcl_Token)(unsafe.Pointer(optsTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __2
	}
__4:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(optsTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(optsTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __7
	}
__9:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __12
	}
	XTclExpandCodeArray(tls, envPtr)
__12:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __13
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__13:
	;
__14:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __17
	}
	if !(_delta == -0x7fffffff-1) {
		goto __18
	}
	_delta = 1 - _objIndexCopy
__18:
	;
__19:
	if !(_delta < 0) {
		goto __22
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __23
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__23:
	;
__22:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
__17:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	goto __10
__10:
	if 0 != 0 {
		goto __9
	}
	goto __11
__11:
	;
	goto __8
__7:
__24:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __27
	}
	XTclExpandCodeArray(tls, envPtr)
__27:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __28
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__28:
	;
__29:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __32
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __33
	}
	_delta1 = 1 - _objIndexCopy
__33:
	;
__34:
	if !(_delta1 < 0) {
		goto __37
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __38
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__38:
	;
__37:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __35
__35:
	if 0 != 0 {
		goto __34
	}
	goto __36
__36:
	;
__32:
	;
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
__8:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;
	goto __3
__2:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
	XTclCompileTokens(tls, interp, optsTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(optsTokenPtr)).FnumComponents, envPtr)
__3:
	;

	if !((*Tcl_Token)(unsafe.Pointer(msgTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __39
	}
__41:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(msgTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(msgTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy1 <= 255) {
		goto __44
	}
__46:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __49
	}
	XTclExpandCodeArray(tls, envPtr)
__49:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __50
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__50:
	;
__51:
	_delta2 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta2 != 0) {
		goto __54
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __55
	}
	_delta2 = 1 - _objIndexCopy1
__55:
	;
__56:
	if !(_delta2 < 0) {
		goto __59
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __60
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__60:
	;
__59:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __57
__57:
	if 0 != 0 {
		goto __56
	}
	goto __58
__58:
	;
__54:
	;
	goto __52
__52:
	if 0 != 0 {
		goto __51
	}
	goto __53
__53:
	;
	goto __47
__47:
	if 0 != 0 {
		goto __46
	}
	goto __48
__48:
	;
	goto __45
__44:
__61:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __64
	}
	XTclExpandCodeArray(tls, envPtr)
__64:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __65
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__65:
	;
__66:
	_delta3 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta3 != 0) {
		goto __69
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __70
	}
	_delta3 = 1 - _objIndexCopy1
__70:
	;
__71:
	if !(_delta3 < 0) {
		goto __74
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __75
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__75:
	;
__74:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __72
__72:
	if 0 != 0 {
		goto __71
	}
	goto __73
__73:
	;
__69:
	;
	goto __67
__67:
	if 0 != 0 {
		goto __66
	}
	goto __68
__68:
	;
	goto __62
__62:
	if 0 != 0 {
		goto __61
	}
	goto __63
__63:
	;
__45:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
	goto __40
__39:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 3*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 3*8))
	XTclCompileTokens(tls, interp, msgTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(msgTokenPtr)).FnumComponents, envPtr)
__40:
	;

	XTclEmitInvoke(tls, envPtr, INST_RETURN_STK, 0)
	return TCL_OK
__1:
	;

	// Allocate some working space.

	objv = XTclStackAlloc(tls, interp, int32(uint64(numOptionWords)*uint64(unsafe.Sizeof(uintptr(0)))))

	// Scan through the return options. If any are unknown at compile time,
	// there is no value in bytecompiling. Save the option values known in an
	// objv array for merging into a return options dictionary.
	//
	// TODO: There is potential for improvement if all option keys are known
	// at compile time and all option values relating to '-code' and '-level'
	// are known at compile time.

	objc = 0
__76:
	if !(objc < numOptionWords) {
		goto __78
	}
	*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FrefCount++
	if !!(XTclWordKnownAtCompileTime(tls, wordTokenPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))) != 0) {
		goto __79
	}
	// Non-literal, so punt to run-time assembly of the dictionary.

__80:
	if !(objc >= 0) {
		goto __82
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FrefCount, 1) > 1) {
		goto __83
	}
	goto __84
__83:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __85
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != XtclEmptyStringRep) {
		goto __87
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes)
__87:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Flength = -1
__88:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __91
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))
	goto __92
__91:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__92:
	;
	goto __89
__89:
	if 0 != 0 {
		goto __88
	}
	goto __90
__90:
	;
	goto __86
__85:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))
__86:
	;
__84:
	;

	goto __81
__81:
	objc--
	goto __80
	goto __82
__82:
	;
	XTclStackFree(tls, interp, objv)
	goto issueRuntimeReturn
__79:
	;
	wordTokenPtr = wordTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents+1)*24
	goto __77
__77:
	objc++
	goto __76
	goto __78
__78:
	;
	status = XTclMergeReturnOptions(tls, interp, objc, objv,
		bp, bp+8, bp+12)
__93:
	if !(libc.PreDecInt32(&objc, 1) >= 0) {
		goto __94
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FrefCount, 1) > 1) {
		goto __95
	}
	goto __96
__95:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __97
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != XtclEmptyStringRep) {
		goto __99
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes)
__99:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Flength = -1
__100:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __103
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))
	goto __104
__103:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__104:
	;
	goto __101
__101:
	if 0 != 0 {
		goto __100
	}
	goto __102
__102:
	;
	goto __98
__97:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))
__98:
	;
__96:
	;

	goto __93
__94:
	;
	XTclStackFree(tls, interp, objv)
	if !(TCL_ERROR == status) {
		goto __105
	}
	// Something was bogus in the return options. Clear the error message,
	// and report back to the compiler that this must be interpreted at
	// runtime.

	XTcl_ResetResult(tls, interp)
	return TCL_ERROR
__105:
	;

	// All options are known at compile time, so we're going to bytecompile.
	// Emit instructions to push the result on the stack.

	if !(explicitResult != 0) {
		goto __106
	}
	if !((*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __108
	}
__110:
	_objIndexCopy2 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy2 <= 255) {
		goto __113
	}
__115:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __118
	}
	XTclExpandCodeArray(tls, envPtr)
__118:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __119
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__119:
	;
__120:
	_delta4 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta4 != 0) {
		goto __123
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __124
	}
	_delta4 = 1 - _objIndexCopy2
__124:
	;
__125:
	if !(_delta4 < 0) {
		goto __128
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __129
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__129:
	;
__128:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __126
__126:
	if 0 != 0 {
		goto __125
	}
	goto __127
__127:
	;
__123:
	;
	goto __121
__121:
	if 0 != 0 {
		goto __120
	}
	goto __122
__122:
	;
	goto __116
__116:
	if 0 != 0 {
		goto __115
	}
	goto __117
__117:
	;
	goto __114
__113:
__130:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __133
	}
	XTclExpandCodeArray(tls, envPtr)
__133:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __134
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__134:
	;
__135:
	_delta5 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta5 != 0) {
		goto __138
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __139
	}
	_delta5 = 1 - _objIndexCopy2
__139:
	;
__140:
	if !(_delta5 < 0) {
		goto __143
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __144
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__144:
	;
__143:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __141
__141:
	if 0 != 0 {
		goto __140
	}
	goto __142
__142:
	;
__138:
	;
	goto __136
__136:
	if 0 != 0 {
		goto __135
	}
	goto __137
__137:
	;
	goto __131
__131:
	if 0 != 0 {
		goto __130
	}
	goto __132
__132:
	;
__114:
	;
	goto __111
__111:
	if 0 != 0 {
		goto __110
	}
	goto __112
__112:
	;
	goto __109
__108:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(numWords-1)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(numWords-1)*8))
	XTclCompileTokens(tls, interp, wordTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents, envPtr)
__109:
	;

	goto __107
__106:
	// No explict result argument, so default result is empty string.

__145:
	_objIndexCopy3 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy3 <= 255) {
		goto __148
	}
__150:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __153
	}
	XTclExpandCodeArray(tls, envPtr)
__153:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __154
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__154:
	;
__155:
	_delta6 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta6 != 0) {
		goto __158
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __159
	}
	_delta6 = 1 - _objIndexCopy3
__159:
	;
__160:
	if !(_delta6 < 0) {
		goto __163
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __164
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__164:
	;
__163:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __161
__161:
	if 0 != 0 {
		goto __160
	}
	goto __162
__162:
	;
__158:
	;
	goto __156
__156:
	if 0 != 0 {
		goto __155
	}
	goto __157
__157:
	;
	goto __151
__151:
	if 0 != 0 {
		goto __150
	}
	goto __152
__152:
	;
	goto __149
__148:
__165:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __168
	}
	XTclExpandCodeArray(tls, envPtr)
__168:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __169
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__169:
	;
__170:
	_delta7 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta7 != 0) {
		goto __173
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __174
	}
	_delta7 = 1 - _objIndexCopy3
__174:
	;
__175:
	if !(_delta7 < 0) {
		goto __178
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __179
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__179:
	;
__178:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __176
__176:
	if 0 != 0 {
		goto __175
	}
	goto __177
__177:
	;
__173:
	;
	goto __171
__171:
	if 0 != 0 {
		goto __170
	}
	goto __172
__172:
	;
	goto __166
__166:
	if 0 != 0 {
		goto __165
	}
	goto __167
__167:
	;
__149:
	;
	goto __146
__146:
	if 0 != 0 {
		goto __145
	}
	goto __147
__147:
	;
__107:
	;

	// Check for optimization: When [return] is in a proc, and there's no
	// enclosing [catch], and there are no return options, then the INST_DONE
	// instruction is equivalent, and may be more efficient.

	if !(numOptionWords == 0 && (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr != uintptr(0)) {
		goto __180
	}
	// We have default return options and we're in a proc ...

	index = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext - 1
	enclosingCatch = 0

__181:
	if !(index >= 0) {
		goto __182
	}
	range1 = *(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(index)*28))

	if !(range1.Ftype == CATCH_EXCEPTION_RANGE &&
		range1.FcatchOffset == -1) {
		goto __183
	}
	enclosingCatch = 1
	goto __182
__183:
	;
	index--
	goto __181
__182:
	;
	if !!(enclosingCatch != 0) {
		goto __184
	}
	// ... and there is no enclosing catch. Issue the maximally
	// efficient exit instruction.

__185:
	_objPtr = *(*uintptr)(unsafe.Pointer(bp))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __188
	}
	XTclFreeObj(tls, _objPtr)
__188:
	;
	goto __186
__186:
	if 0 != 0 {
		goto __185
	}
	goto __187
__187:
	;
__189:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __192
	}
	XTclExpandCodeArray(tls, envPtr)
__192:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DONE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __193
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DONE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__193:
	;
__194:
	_delta8 = XtclInstructionTable[INST_DONE].FstackEffect
	if !(_delta8 != 0) {
		goto __197
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __198
	}
	_delta8 = 1 - 0
__198:
	;
__199:
	if !(_delta8 < 0) {
		goto __202
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __203
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__203:
	;
__202:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __200
__200:
	if 0 != 0 {
		goto __199
	}
	goto __201
__201:
	;
__197:
	;
	goto __195
__195:
	if 0 != 0 {
		goto __194
	}
	goto __196
__196:
	;
	goto __190
__190:
	if 0 != 0 {
		goto __189
	}
	goto __191
__191:
	;
__204:
	if !(1 < 0) {
		goto __207
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __208
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__208:
	;
__207:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
	goto __205
__205:
	if 0 != 0 {
		goto __204
	}
	goto __206
__206:
	;
	return TCL_OK
__184:
	;
__180:
	;

	// Optimize [return -level 0 $x].
	XTcl_DictObjSize(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp /* returnOpts */)), bp+16)
	if !(*(*int32)(unsafe.Pointer(bp + 16)) == 0 && *(*int32)(unsafe.Pointer(bp + 12)) == 0 && *(*int32)(unsafe.Pointer(bp + 8)) == TCL_OK) {
		goto __209
	}
__210:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(bp))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __213
	}
	XTclFreeObj(tls, _objPtr1)
__213:
	;
	goto __211
__211:
	if 0 != 0 {
		goto __210
	}
	goto __212
__212:
	;
	return TCL_OK
__209:
	;

	// Could not use the optimization, so we push the return options dict, and
	// emit the INST_RETURN_IMM instruction with code and level as operands.

	sCompileReturnInternal(tls, envPtr, uint8(INST_RETURN_IMM), *(*int32)(unsafe.Pointer(bp + 8 /* code */)), *(*int32)(unsafe.Pointer(bp + 12 /* level */)), *(*uintptr)(unsafe.Pointer(bp /* returnOpts */)))
	return TCL_OK

issueRuntimeReturn:
	// Assemble the option dictionary (as a list as that's good enough).

	wordTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	objc = 1
__214:
	if !(objc <= numOptionWords) {
		goto __216
	}
	if !((*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __217
	}
__219:
	_objIndexCopy4 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy4 <= 255) {
		goto __222
	}
__224:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __227
	}
	XTclExpandCodeArray(tls, envPtr)
__227:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __228
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__228:
	;
__229:
	_delta9 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta9 != 0) {
		goto __232
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __233
	}
	_delta9 = 1 - _objIndexCopy4
__233:
	;
__234:
	if !(_delta9 < 0) {
		goto __237
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __238
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__238:
	;
__237:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __235
__235:
	if 0 != 0 {
		goto __234
	}
	goto __236
__236:
	;
__232:
	;
	goto __230
__230:
	if 0 != 0 {
		goto __229
	}
	goto __231
__231:
	;
	goto __225
__225:
	if 0 != 0 {
		goto __224
	}
	goto __226
__226:
	;
	goto __223
__222:
__239:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __242
	}
	XTclExpandCodeArray(tls, envPtr)
__242:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __243
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__243:
	;
__244:
	_delta10 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta10 != 0) {
		goto __247
	}
	if !(_delta10 == -0x7fffffff-1) {
		goto __248
	}
	_delta10 = 1 - _objIndexCopy4
__248:
	;
__249:
	if !(_delta10 < 0) {
		goto __252
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __253
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__253:
	;
__252:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta10
	goto __250
__250:
	if 0 != 0 {
		goto __249
	}
	goto __251
__251:
	;
__247:
	;
	goto __245
__245:
	if 0 != 0 {
		goto __244
	}
	goto __246
__246:
	;
	goto __240
__240:
	if 0 != 0 {
		goto __239
	}
	goto __241
__241:
	;
__223:
	;
	goto __220
__220:
	if 0 != 0 {
		goto __219
	}
	goto __221
__221:
	;
	goto __218
__217:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(objc)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(objc)*8))
	XTclCompileTokens(tls, interp, wordTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents, envPtr)
__218:
	;

	wordTokenPtr = wordTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents+1)*24
	goto __215
__215:
	objc++
	goto __214
	goto __216
__216:
	;
__254:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __257
	}
	XTclExpandCodeArray(tls, envPtr)
__257:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numOptionWords) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numOptionWords) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numOptionWords) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numOptionWords))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __258
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST == INST_START_CMD {
			return 1
		}
		return 0
	}()
__258:
	;
__259:
	_delta11 = XtclInstructionTable[INST_LIST].FstackEffect
	if !(_delta11 != 0) {
		goto __262
	}
	if !(_delta11 == -0x7fffffff-1) {
		goto __263
	}
	_delta11 = 1 - numOptionWords
__263:
	;
__264:
	if !(_delta11 < 0) {
		goto __267
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __268
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__268:
	;
__267:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta11
	goto __265
__265:
	if 0 != 0 {
		goto __264
	}
	goto __266
__266:
	;
__262:
	;
	goto __260
__260:
	if 0 != 0 {
		goto __259
	}
	goto __261
__261:
	;
	goto __255
__255:
	if 0 != 0 {
		goto __254
	}
	goto __256
__256:
	;

	// Push the result.

	if !(explicitResult != 0) {
		goto __269
	}
	if !((*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __271
	}
__273:
	_objIndexCopy5 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy5 <= 255) {
		goto __276
	}
__278:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __281
	}
	XTclExpandCodeArray(tls, envPtr)
__281:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __282
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__282:
	;
__283:
	_delta12 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta12 != 0) {
		goto __286
	}
	if !(_delta12 == -0x7fffffff-1) {
		goto __287
	}
	_delta12 = 1 - _objIndexCopy5
__287:
	;
__288:
	if !(_delta12 < 0) {
		goto __291
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __292
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__292:
	;
__291:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta12
	goto __289
__289:
	if 0 != 0 {
		goto __288
	}
	goto __290
__290:
	;
__286:
	;
	goto __284
__284:
	if 0 != 0 {
		goto __283
	}
	goto __285
__285:
	;
	goto __279
__279:
	if 0 != 0 {
		goto __278
	}
	goto __280
__280:
	;
	goto __277
__276:
__293:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __296
	}
	XTclExpandCodeArray(tls, envPtr)
__296:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __297
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__297:
	;
__298:
	_delta13 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta13 != 0) {
		goto __301
	}
	if !(_delta13 == -0x7fffffff-1) {
		goto __302
	}
	_delta13 = 1 - _objIndexCopy5
__302:
	;
__303:
	if !(_delta13 < 0) {
		goto __306
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __307
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__307:
	;
__306:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta13
	goto __304
__304:
	if 0 != 0 {
		goto __303
	}
	goto __305
__305:
	;
__301:
	;
	goto __299
__299:
	if 0 != 0 {
		goto __298
	}
	goto __300
__300:
	;
	goto __294
__294:
	if 0 != 0 {
		goto __293
	}
	goto __295
__295:
	;
__277:
	;
	goto __274
__274:
	if 0 != 0 {
		goto __273
	}
	goto __275
__275:
	;
	goto __272
__271:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(numWords-1)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(numWords-1)*8))
	XTclCompileTokens(tls, interp, wordTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents, envPtr)
__272:
	;

	goto __270
__269:
__308:
	_objIndexCopy6 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy6 <= 255) {
		goto __311
	}
__313:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __316
	}
	XTclExpandCodeArray(tls, envPtr)
__316:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __317
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__317:
	;
__318:
	_delta14 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta14 != 0) {
		goto __321
	}
	if !(_delta14 == -0x7fffffff-1) {
		goto __322
	}
	_delta14 = 1 - _objIndexCopy6
__322:
	;
__323:
	if !(_delta14 < 0) {
		goto __326
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __327
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__327:
	;
__326:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta14
	goto __324
__324:
	if 0 != 0 {
		goto __323
	}
	goto __325
__325:
	;
__321:
	;
	goto __319
__319:
	if 0 != 0 {
		goto __318
	}
	goto __320
__320:
	;
	goto __314
__314:
	if 0 != 0 {
		goto __313
	}
	goto __315
__315:
	;
	goto __312
__311:
__328:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __331
	}
	XTclExpandCodeArray(tls, envPtr)
__331:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __332
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__332:
	;
__333:
	_delta15 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta15 != 0) {
		goto __336
	}
	if !(_delta15 == -0x7fffffff-1) {
		goto __337
	}
	_delta15 = 1 - _objIndexCopy6
__337:
	;
__338:
	if !(_delta15 < 0) {
		goto __341
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __342
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__342:
	;
__341:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta15
	goto __339
__339:
	if 0 != 0 {
		goto __338
	}
	goto __340
__340:
	;
__336:
	;
	goto __334
__334:
	if 0 != 0 {
		goto __333
	}
	goto __335
__335:
	;
	goto __329
__329:
	if 0 != 0 {
		goto __328
	}
	goto __330
__330:
	;
__312:
	;
	goto __309
__309:
	if 0 != 0 {
		goto __308
	}
	goto __310
__310:
	;
__270:
	;

	// Issue the RETURN itself.

	XTclEmitInvoke(tls, envPtr, INST_RETURN_STK, 0)
	return TCL_OK
}

func sCompileReturnInternal(tls *libc.TLS, envPtr uintptr, op uint8, code int32, level int32, returnOpts uintptr) { /* tclCompCmdsGR.c:2599:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if level == 0 && (code == TCL_BREAK || code == TCL_CONTINUE) {
		var rangePtr uintptr
		// var exceptAux uintptr at bp, 8

		rangePtr = XTclGetInnermostExceptionRange(tls, envPtr, code, bp)
		if rangePtr != 0 && (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype == LOOP_EXCEPTION_RANGE {
			XTclCleanupStackForBreakContinue(tls, envPtr, *(*uintptr)(unsafe.Pointer(bp /* exceptAux */)))
			if code == TCL_BREAK {
				XTclAddLoopBreakFixup(tls, envPtr, *(*uintptr)(unsafe.Pointer(bp /* exceptAux */)))
			} else {
				XTclAddLoopContinueFixup(tls, envPtr, *(*uintptr)(unsafe.Pointer(bp /* exceptAux */)))
			}
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = returnOpts
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			return
		}
	}

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objIndexCopy int32 = XTclAddLiteralObj(tls, envPtr, returnOpts, uintptr(0))
		if _objIndexCopy <= 255 {
			for ok2 := true; ok2; ok2 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok3 := true; ok3; ok3 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok4 := true; ok4; ok4 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok5 := true; ok5; ok5 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok6 := true; ok6; ok6 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok7 := true; ok7; ok7 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok8 := true; ok8; ok8 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = op
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(code) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(code) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(code) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(code))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if int32(op) == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok9 := true; ok9; ok9 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[op].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - code
				}
				for ok10 := true; ok10; ok10 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok11 := true; ok11; ok11 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(level) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(level) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(level) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(level))
	}
}

func XTclCompileSyntaxError(tls *libc.TLS, interp uintptr, envPtr uintptr) { /* tclCompCmdsGR.c:2629:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var msg uintptr = XTcl_GetObjResult(tls, interp)
	// var numBytes int32 at bp, 4

	var bytes uintptr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(msg)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, msg, bp)
	}()

	XTclErrorStackResetIf(tls, interp, bytes, *(*int32)(unsafe.Pointer(bp /* numBytes */)))
	for ok := true; ok; ok = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp)), 0)
		if _objIndexCopy <= 255 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok3 := true; ok3; ok3 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok4 := true; ok4; ok4 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok6 := true; ok6; ok6 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	sCompileReturnInternal(tls, envPtr, uint8(INST_SYNTAX), TCL_ERROR, 0,
		XTclNoErrorStack(tls, interp, XTcl_GetReturnOptions(tls, interp, TCL_ERROR)))
	XTcl_ResetResult(tls, interp)
}

//----------------------------------------------------------------------
//
// TclCompileUpvarCmd --
//
//	Procedure called to compile the "upvar" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "upvar" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileUpvarCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:2663:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var otherTokenPtr uintptr
	var localTokenPtr uintptr
	var localIndex int32
	var numWords int32
	var i int32
	var objPtr uintptr

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr == uintptr(0) {
		return TCL_ERROR
	}

	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	if numWords < 3 {
		return TCL_ERROR
	}

	// Push the frame index if it is known at compile time

	objPtr = XTcl_NewObj(tls)
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if XTclWordKnownAtCompileTime(tls, tokenPtr, objPtr) != 0 {
		// var framePtr uintptr at bp, 8

		var newTypePtr uintptr
		var typePtr uintptr = (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr

		// Attempt to convert to a level reference. Note that TclObjGetFrame
		// only changes the obj type when a conversion was successful.

		XTclObjGetFrame(tls, interp, objPtr, bp)
		newTypePtr = (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}

		if newTypePtr != typePtr {
			if numWords%2 != 0 {
				return TCL_ERROR
			}
			// TODO: Push the known value instead?
			if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
					if _objIndexCopy <= 255 {
						for ok2 := true; ok2; ok2 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok4 := true; ok4; ok4 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok5 := true; ok5; ok5 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok7 := true; ok7; ok7 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
			} else {
				(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
				(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
				XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
			}

			otherTokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
			i = 2
		} else {
			if !(numWords%2 != 0) {
				return TCL_ERROR
			}
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
				if _objIndexCopy <= 255 {
					for ok9 := true; ok9; ok9 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok10 := true; ok10; ok10 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok11 := true; ok11; ok11 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok12 := true; ok12; ok12 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok13 := true; ok13; ok13 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok14 := true; ok14; ok14 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
			otherTokenPtr = tokenPtr
			i = 1
		}
	} else {
		for ok15 := true; ok15; ok15 = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return TCL_ERROR
	}

	// Loop over the (otherVar, thisVar) pairs. If any of the thisVar is not a
	// local variable, return an error so that the non-compiled command will
	// be called at runtime.

__1:
	if !(i < numWords) {
		goto __3
	}
	{
		localTokenPtr = otherTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(otherTokenPtr)).FnumComponents+1)*24

		if (*Tcl_Token)(unsafe.Pointer(otherTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok16 := true; ok16; ok16 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(otherTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(otherTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok17 := true; ok17; ok17 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok18 := true; ok18; ok18 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok19 := true; ok19; ok19 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok20 := true; ok20; ok20 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok21 := true; ok21; ok21 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok22 := true; ok22; ok22 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, otherTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(otherTokenPtr)).FnumComponents, envPtr)
		}

		localIndex = XTclLocalScalarFromToken(tls, localTokenPtr, envPtr)
		if localIndex < 0 {
			return TCL_ERROR
		}
		for ok23 := true; ok23; ok23 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UPVAR)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_UPVAR == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok24 := true; ok24; ok24 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_UPVAR].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - localIndex
					}
					for ok25 := true; ok25; ok25 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}

	}
	goto __2
__2:
	i = i + 2
	otherTokenPtr = localTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(localTokenPtr)).FnumComponents+1)*24
	goto __1
	goto __3
__3:
	;

	// Pop the frame index, and set the result to empty

	for ok26 := true; ok26; ok26 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok27 := true; ok27; ok27 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok28 := true; ok28; ok28 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok29 := true; ok29; ok29 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok30 := true; ok30; ok30 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok31 := true; ok31; ok31 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok32 := true; ok32; ok32 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok33 := true; ok33; ok33 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok34 := true; ok34; ok34 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok35 := true; ok35; ok35 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileVariableCmd --
//
//	Procedure called to compile the "variable" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "variable" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileVariableCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:2770:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var varTokenPtr uintptr
	var valueTokenPtr uintptr
	var localIndex int32
	var numWords int32
	var i int32

	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	if numWords < 2 {
		return TCL_ERROR
	}

	// Bail out if not compiling a proc body

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Loop over the (var, value) pairs.

	valueTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	for i = 1; i < numWords; i = i + 2 {
		varTokenPtr = valueTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+1)*24
		valueTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24

		localIndex = sIndexTailVarIfKnown(tls, interp, varTokenPtr, envPtr)

		if localIndex < 0 {
			return TCL_ERROR
		}

		// TODO: Consider what value can pass through the
		// IndexTailVarIfKnown() screen.  Full CompileWord()
		// likely does not apply here.  Push known value instead.
		if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents, envPtr)
		}

		for ok7 := true; ok7; ok7 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_VARIABLE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_VARIABLE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_VARIABLE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - localIndex
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}

		if i+1 < numWords {
			// A value has been given: set the variable, pop the value

			if (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
				for ok10 := true; ok10; ok10 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fsize, 0)
					if _objIndexCopy <= 255 {
						for ok11 := true; ok11; ok11 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok12 := true; ok12; ok12 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok13 := true; ok13; ok13 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok14 := true; ok14; ok14 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok15 := true; ok15; ok15 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok16 := true; ok16; ok16 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
			} else {
				(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i+1)*4))
				(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i+1)*8))
				XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents, envPtr)
			}

			if localIndex <= 255 {
				for ok17 := true; ok17; ok17 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_SCALAR1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok18 := true; ok18; ok18 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - localIndex
							}
							for ok19 := true; ok19; ok19 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok20 := true; ok20; ok20 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localIndex))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_SCALAR4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok21 := true; ok21; ok21 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - localIndex
							}
							for ok22 := true; ok22; ok22 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}

			for ok23 := true; ok23; ok23 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_POP == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok24 := true; ok24; ok24 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok25 := true; ok25; ok25 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}

	// Set the result to empty

	for ok26 := true; ok26; ok26 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok27 := true; ok27; ok27 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok28 := true; ok28; ok28 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok29 := true; ok29; ok29 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok30 := true; ok30; ok30 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok31 := true; ok31; ok31 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok32 := true; ok32; ok32 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// IndexTailVarIfKnown --
//
//	Procedure used in compiling [global] and [variable] commands. It
//	inspects the variable name described by varTokenPtr and, if the tail
//	is known at compile time, defines a corresponding local variable.
//
// Results:
//	Returns the variable's index in the table of compiled locals if the
//	tail is known at compile time, or -1 otherwise.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sIndexTailVarIfKnown(tls *libc.TLS, interp uintptr, varTokenPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:2855:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var tailPtr uintptr
	var tailName uintptr
	var p uintptr
	// var len int32 at bp, 4

	var n int32 = (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents
	var lastTokenPtr uintptr
	var full int32
	var localIndex int32

	// Determine if the tail is (a) known at compile time, and (b) not an
	// array element. Should any of these fail, return an error so that the
	// non-compiled command will be called at runtime.
	//
	// In order for the tail to be known at compile time, the last token in
	// the word has to be constant and contain "::" if it is not the only one.

	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr != 0 || (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr)).FvarFramePtr)).FlocalCachePtr != 0) {
		return -1
	}

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			tailPtr = XTclThreadAllocObj(tls)
		} else {
			tailPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tailPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(tailPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(tailPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(tailPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(tailPtr)).FtypePtr = uintptr(0)
	{
	}

	if XTclWordKnownAtCompileTime(tls, varTokenPtr, tailPtr) != 0 {
		full = 1
		lastTokenPtr = varTokenPtr
	} else {
		full = 0
		lastTokenPtr = varTokenPtr + uintptr(n)*24

		if (*Tcl_Token)(unsafe.Pointer(lastTokenPtr)).Ftype != TCL_TOKEN_TEXT {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr = tailPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			return -1
		}
		XTcl_SetStringObj(tls, tailPtr, (*Tcl_Token)(unsafe.Pointer(lastTokenPtr)).Fstart, (*Tcl_Token)(unsafe.Pointer(lastTokenPtr)).Fsize)
	}

	tailName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(tailPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(tailPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(tailPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, tailPtr, bp)
	}()

	if *(*int32)(unsafe.Pointer(bp)) != 0 {
		if int32(*(*int8)(unsafe.Pointer(tailName + uintptr(*(*int32)(unsafe.Pointer(bp))) - uintptr(1)))) == ')' {
			// Possible array: bail out

			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = tailPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			return -1
		}

		// Get the tail: immediately after the last '::'

		for p = tailName + uintptr(*(*int32)(unsafe.Pointer(bp))) - uintptr(1); p > tailName; p-- {
			if int32(*(*int8)(unsafe.Pointer(p))) == ':' && int32(*(*int8)(unsafe.Pointer(p - uintptr(1)))) == ':' {
				p++
				break
			}
		}
		if !(full != 0) && p == tailName {
			// No :: in the last component.

			for ok3 := true; ok3; ok3 = 0 != 0 {
				var _objPtr uintptr = tailPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			return -1
		}
		*(*int32)(unsafe.Pointer(bp /* len */)) -= int32((int64(p) - int64(tailName)) / 1)
		tailName = p
	}

	localIndex = XTclFindCompiledLocal(tls, tailName, *(*int32)(unsafe.Pointer(bp /* len */)), 1, envPtr)
	for ok4 := true; ok4; ok4 = 0 != 0 {
		var _objPtr uintptr = tailPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return localIndex
}

// ----------------------------------------------------------------------
//
// TclCompileObjectNextCmd, TclCompileObjectSelfCmd --
//
//	Compilations of the TclOO utility commands [next] and [self].
//
// ----------------------------------------------------------------------

func XTclCompileObjectNextCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:2944:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	var i int32

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 255 {
		return TCL_ERROR
	}

	for i = 0; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}
	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_TCLOO_NEXT)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_TCLOO_NEXT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_TCLOO_NEXT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - i
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileObjectNextToCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:2969:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	var i int32

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 2 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 255 {
		return TCL_ERROR
	}

	for i = 0; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}
	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_TCLOO_NEXT_CLASS)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_TCLOO_NEXT_CLASS == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_TCLOO_NEXT_CLASS].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - i
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileObjectSelfCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsGR.c:2994:1: */
	var tokenPtr uintptr
	var subcmd uintptr
	var _delta int32
	var _delta1 int32
	var _delta2 int32
	var _delta3 int32
	// We only handle [self] and [self object] (which is the same operation).
	// These are the only very common operations on [self] for which
	// bytecoding is at all reasonable.

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 1) {
		goto __1
	}
	goto compileSelfObject
	goto __2
__1:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 2) {
		goto __3
	}
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD || (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize == 0) {
		goto __4
	}
	return TCL_ERROR
__4:
	;

	subcmd = tokenPtr + uintptr(1)*24
	if !(libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(subcmd)).Fstart, ts+18716, uint64((*Tcl_Token)(unsafe.Pointer(subcmd)).Fsize)) == 0) {
		goto __5
	}
	goto compileSelfObject
	goto __6
__5:
	if !(libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(subcmd)).Fstart, ts+18781, uint64((*Tcl_Token)(unsafe.Pointer(subcmd)).Fsize)) == 0) {
		goto __7
	}
	goto compileSelfNamespace
__7:
	;
__6:
	;
__3:
	;
__2:
	;

	// Can't compile; handle with runtime call.

	return TCL_ERROR

compileSelfObject:

	// This delegates the entire problem to a single opcode.

__8:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __11
	}
	XTclExpandCodeArray(tls, envPtr)
__11:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_TCLOO_SELF)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __12
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_TCLOO_SELF == INST_START_CMD {
			return 1
		}
		return 0
	}()
__12:
	;
__13:
	_delta = XtclInstructionTable[INST_TCLOO_SELF].FstackEffect
	if !(_delta != 0) {
		goto __16
	}
	if !(_delta == -0x7fffffff-1) {
		goto __17
	}
	_delta = 1 - 0
__17:
	;
__18:
	if !(_delta < 0) {
		goto __21
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __22
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__22:
	;
__21:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __19
__19:
	if 0 != 0 {
		goto __18
	}
	goto __20
__20:
	;
__16:
	;
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
	goto __9
__9:
	if 0 != 0 {
		goto __8
	}
	goto __10
__10:
	;
	return TCL_OK

compileSelfNamespace:

	// This is formally only correct with TclOO methods as they are currently
	// implemented; it assumes that the current namespace is invariably when a
	// TclOO context is present is the object's namespace, and that's
	// technically only something that's a matter of current policy. But it
	// avoids creating another opcode, so that's all good!

__23:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __26
	}
	XTclExpandCodeArray(tls, envPtr)
__26:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_TCLOO_SELF)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __27
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_TCLOO_SELF == INST_START_CMD {
			return 1
		}
		return 0
	}()
__27:
	;
__28:
	_delta1 = XtclInstructionTable[INST_TCLOO_SELF].FstackEffect
	if !(_delta1 != 0) {
		goto __31
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __32
	}
	_delta1 = 1 - 0
__32:
	;
__33:
	if !(_delta1 < 0) {
		goto __36
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __37
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__37:
	;
__36:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
__31:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
__38:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __41
	}
	XTclExpandCodeArray(tls, envPtr)
__41:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __42
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__42:
	;
__43:
	_delta2 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta2 != 0) {
		goto __46
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __47
	}
	_delta2 = 1 - 0
__47:
	;
__48:
	if !(_delta2 < 0) {
		goto __51
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __52
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__52:
	;
__51:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __49
__49:
	if 0 != 0 {
		goto __48
	}
	goto __50
__50:
	;
__46:
	;
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;
	goto __39
__39:
	if 0 != 0 {
		goto __38
	}
	goto __40
__40:
	;
__53:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __56
	}
	XTclExpandCodeArray(tls, envPtr)
__56:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_NS_CURRENT)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __57
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_NS_CURRENT == INST_START_CMD {
			return 1
		}
		return 0
	}()
__57:
	;
__58:
	_delta3 = XtclInstructionTable[INST_NS_CURRENT].FstackEffect
	if !(_delta3 != 0) {
		goto __61
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __62
	}
	_delta3 = 1 - 0
__62:
	;
__63:
	if !(_delta3 < 0) {
		goto __66
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __67
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__67:
	;
__66:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __64
__64:
	if 0 != 0 {
		goto __63
	}
	goto __65
__65:
	;
__61:
	;
	goto __59
__59:
	if 0 != 0 {
		goto __58
	}
	goto __60
__60:
	;
	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The structures below define the AuxData types defined in this file.

var XtclJumptableInfoType = AuxDataType{
	Fname:            ts + 18791,
	FdupProc:         0, // dupProc
	FfreeProc:        0, // freeProc
	FprintProc:       0, // printProc
	FdisassembleProc: 0, // disassembleProc
} /* tclCompCmdsSZ.c:74:19 */

// Shorthand macros for instruction issuing.

//----------------------------------------------------------------------
//
// TclCompileSetCmd --
//
//	Procedure called to compile the "set" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "set" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileSetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:130:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var varTokenPtr uintptr
	var valueTokenPtr uintptr
	var isAssignment int32
	// var isScalar int32 at bp+4, 4

	// var localIndex int32 at bp, 4

	var numWords int32

	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	if numWords != 2 && numWords != 3 {
		return TCL_ERROR
	}
	isAssignment = libc.Bool32(numWords == 3)

	// Decide if we can use a frame slot for the var/array name or if we need
	// to emit code to compute and push the name at runtime. We use a frame
	// slot (entry in the array of local vars) if we are compiling a procedure
	// body and if the name is simple text that does not include namespace
	// qualifiers.

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclPushVarName(tls, interp, varTokenPtr, envPtr, 0, bp, bp+4)

	// If we are doing an assignment, push the new value.

	if isAssignment != 0 {
		valueTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
			XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents, envPtr)
		}

	}

	// Emit instructions to set/get the variable.

	if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
		if *(*int32)(unsafe.Pointer(bp)) < 0 {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = func() uint8 {
					if isAssignment != 0 {
						return uint8(INST_STORE_STK)
					}
					return uint8(INST_LOAD_STK)
				}()
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if func() int32 {
							if isAssignment != 0 {
								return INST_STORE_STK
							}
							return INST_LOAD_STK
						}() == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok8 := true; ok8; ok8 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[func() int32 {
						if isAssignment != 0 {
							return INST_STORE_STK
						}
						return INST_LOAD_STK
					}()].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else if *(*int32)(unsafe.Pointer(bp)) <= 255 {
			for ok10 := true; ok10; ok10 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = func() uint8 {
					if isAssignment != 0 {
						return uint8(INST_STORE_SCALAR1)
					}
					return uint8(INST_LOAD_SCALAR1)
				}()
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if func() int32 {
							if isAssignment != 0 {
								return INST_STORE_SCALAR1
							}
							return INST_LOAD_SCALAR1
						}() == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok11 := true; ok11; ok11 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[func() int32 {
						if isAssignment != 0 {
							return INST_STORE_SCALAR1
						}
						return INST_LOAD_SCALAR1
					}()].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - *(*int32)(unsafe.Pointer(bp))
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok13 := true; ok13; ok13 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = func() uint8 {
					if isAssignment != 0 {
						return uint8(INST_STORE_SCALAR4)
					}
					return uint8(INST_LOAD_SCALAR4)
				}()
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if func() int32 {
							if isAssignment != 0 {
								return INST_STORE_SCALAR4
							}
							return INST_LOAD_SCALAR4
						}() == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok14 := true; ok14; ok14 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[func() int32 {
						if isAssignment != 0 {
							return INST_STORE_SCALAR4
						}
						return INST_LOAD_SCALAR4
					}()].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - *(*int32)(unsafe.Pointer(bp))
						}
						for ok15 := true; ok15; ok15 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	} else {
		if *(*int32)(unsafe.Pointer(bp)) < 0 {
			for ok16 := true; ok16; ok16 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = func() uint8 {
					if isAssignment != 0 {
						return uint8(INST_STORE_ARRAY_STK)
					}
					return uint8(INST_LOAD_ARRAY_STK)
				}()
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if func() int32 {
							if isAssignment != 0 {
								return INST_STORE_ARRAY_STK
							}
							return INST_LOAD_ARRAY_STK
						}() == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok17 := true; ok17; ok17 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[func() int32 {
						if isAssignment != 0 {
							return INST_STORE_ARRAY_STK
						}
						return INST_LOAD_ARRAY_STK
					}()].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok18 := true; ok18; ok18 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else if *(*int32)(unsafe.Pointer(bp)) <= 255 {
			for ok19 := true; ok19; ok19 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = func() uint8 {
					if isAssignment != 0 {
						return uint8(INST_STORE_ARRAY1)
					}
					return uint8(INST_LOAD_ARRAY1)
				}()
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if func() int32 {
							if isAssignment != 0 {
								return INST_STORE_ARRAY1
							}
							return INST_LOAD_ARRAY1
						}() == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok20 := true; ok20; ok20 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[func() int32 {
						if isAssignment != 0 {
							return INST_STORE_ARRAY1
						}
						return INST_LOAD_ARRAY1
					}()].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - *(*int32)(unsafe.Pointer(bp))
						}
						for ok21 := true; ok21; ok21 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok22 := true; ok22; ok22 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = func() uint8 {
					if isAssignment != 0 {
						return uint8(INST_STORE_ARRAY4)
					}
					return uint8(INST_LOAD_ARRAY4)
				}()
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if func() int32 {
							if isAssignment != 0 {
								return INST_STORE_ARRAY4
							}
							return INST_LOAD_ARRAY4
						}() == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok23 := true; ok23; ok23 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[func() int32 {
						if isAssignment != 0 {
							return INST_STORE_ARRAY4
						}
						return INST_LOAD_ARRAY4
					}()].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - *(*int32)(unsafe.Pointer(bp))
						}
						for ok24 := true; ok24; ok24 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileString*Cmd --
//
//	Procedures called to compile various subcommands of the "string"
//	command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "string" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileStringCatCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:224:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var i int32
	var numWords int32 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	var numArgs int32
	var wordTokenPtr uintptr
	var obj uintptr
	var folded uintptr

	// Trivial case, no arg

	if numWords < 2 {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		return TCL_OK
	}

	// General case: issue CONCAT1's (by chunks of 254 if needed), folding
	//        contiguous constants along the way

	numArgs = 0
	folded = uintptr(0)
	wordTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	for i = 1; i < numWords; i++ {
		obj = XTcl_NewObj(tls)
		if XTclWordKnownAtCompileTime(tls, wordTokenPtr, obj) != 0 {
			if folded != 0 {
				XTcl_AppendObjToObj(tls, folded, obj)
				for ok7 := true; ok7; ok7 = 0 != 0 {
					var _objPtr uintptr = obj
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			} else {
				folded = obj
			}
		} else {
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _objPtr uintptr = obj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			if folded != 0 {
				// var len int32 at bp, 4

				var bytes uintptr = XTcl_GetStringFromObj(tls, folded, bp)

				for ok9 := true; ok9; ok9 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp)), 0)
					if _objIndexCopy <= 255 {
						for ok10 := true; ok10; ok10 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok11 := true; ok11; ok11 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok12 := true; ok12; ok12 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok13 := true; ok13; ok13 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok14 := true; ok14; ok14 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok15 := true; ok15; ok15 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					var _objPtr uintptr = folded
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				folded = uintptr(0)
				numArgs++
			}
			if (*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
				for ok17 := true; ok17; ok17 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fsize, 0)
					if _objIndexCopy <= 255 {
						for ok18 := true; ok18; ok18 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok19 := true; ok19; ok19 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok20 := true; ok20; ok20 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok21 := true; ok21; ok21 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok22 := true; ok22; ok22 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok23 := true; ok23; ok23 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
			} else {
				(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
				(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
				XTclCompileTokens(tls, interp, wordTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents, envPtr)
			}

			numArgs++
			if numArgs >= 254 { // 254 to take care of the possible +1 of "folded" above
				for ok24 := true; ok24; ok24 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numArgs))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STR_CONCAT1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok25 := true; ok25; ok25 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - numArgs
							}
							for ok26 := true; ok26; ok26 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				numArgs = 1 // concat pushes 1 obj, the result
			}
		}
		wordTokenPtr = wordTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents+1)*24
	}
	if folded != 0 {
		// var len int32 at bp+4, 4

		var bytes uintptr = XTcl_GetStringFromObj(tls, folded, bp+4)

		for ok27 := true; ok27; ok27 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp + 4)), 0)
			if _objIndexCopy <= 255 {
				for ok28 := true; ok28; ok28 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok29 := true; ok29; ok29 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok30 := true; ok30; ok30 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok31 := true; ok31; ok31 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok32 := true; ok32; ok32 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok33 := true; ok33; ok33 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		for ok34 := true; ok34; ok34 = 0 != 0 {
			var _objPtr uintptr = folded
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		folded = uintptr(0)
		numArgs++
	}
	if numArgs > 1 {
		for ok35 := true; ok35; ok35 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numArgs))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_CONCAT1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok36 := true; ok36; ok36 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - numArgs
					}
					for ok37 := true; ok37; ok37 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	return TCL_OK
}

func XTclCompileStringCmpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:296:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	// We don't support any flags; the bytecode isn't that sophisticated.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}

	// Push the two operands onto the stack and then the test.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok10 := true; ok10; ok10 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok14 := true; ok14; ok14 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CMP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_CMP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok15 := true; ok15; ok15 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_CMP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileStringEqualCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:328:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	// We don't support any flags; the bytecode isn't that sophisticated.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}

	// Push the two operands onto the stack and then the test.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok10 := true; ok10; ok10 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok14 := true; ok14; ok14 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_EQ == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok15 := true; ok15; ok15 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_EQ].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileStringFirstCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:360:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	// We don't support any flags; the bytecode isn't that sophisticated.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}

	// Push the two operands onto the stack and then the test.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok10 := true; ok10; ok10 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok14 := true; ok14; ok14 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_FIND)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_FIND == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok15 := true; ok15; ok15 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_FIND].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileStringLastCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:392:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	// We don't support any flags; the bytecode isn't that sophisticated.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}

	// Push the two operands onto the stack and then the test.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok10 := true; ok10; ok10 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok14 := true; ok14; ok14 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_FIND_LAST)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_FIND_LAST == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok15 := true; ok15; ok15 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_FIND_LAST].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileStringIndexCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:424:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}

	// Push the two operands onto the stack and then the index operation.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok10 := true; ok10; ok10 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok14 := true; ok14; ok14 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_INDEX)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_INDEX == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok15 := true; ok15; ok15 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_INDEX].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileStringIsCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:452:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var tokenPtr uintptr
	// var t int32 at bp, 4

	var range1 int32
	var allowEmpty int32
	var end int32
	var strClassType InstStringClassType
	var isClass uintptr
	var _objPtr uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _delta4 int32
	var _delta5 int32
	var _delta6 int32
	var _delta7 int32
	var _delta8 int32
	var _objIndexCopy1 int32
	var _delta9 int32
	var _delta10 int32
	var _delta11 int32
	var _objIndexCopy2 int32
	var _delta12 int32
	var over int32
	var over2 int32
	var _delta13 int32
	var _delta14 int32
	var _delta15 int32
	var _delta16 int32
	var _objIndexCopy3 int32
	var _delta17 int32
	var _delta18 int32
	var _delta19 int32
	var _delta20 int32
	var _delta21 int32
	var _objIndexCopy4 int32
	var _delta22 int32
	var _delta23 int32
	var _delta24 int32
	var _delta25 int32
	var _delta26 int32
	var _objIndexCopy5 int32
	var _delta27 int32
	var _delta28 int32
	var _delta29 int32
	var _delta30 int32
	var _objIndexCopy6 int32
	var _delta31 int32
	var _delta32 int32
	var _delta33 int32
	var _delta34 int32
	var _delta35 int32
	var _objIndexCopy7 int32
	var _delta36 int32
	var _delta37 int32
	var _delta38 int32
	var _delta39 int32
	var _objIndexCopy8 int32
	var _delta40 int32
	var over1 int32
	var over21 int32
	var _delta41 int32
	var _delta42 int32
	var _delta43 int32
	var _objIndexCopy9 int32
	var _delta44 int32
	var _delta45 int32
	var _delta46 int32
	var _delta47 int32
	var _delta48 int32
	var _delta49 int32
	var _objIndexCopy10 int32
	var _delta50 int32
	var _delta51 int32
	var _delta52 int32
	var _delta53 int32
	var _delta54 int32
	var _delta55 int32
	var _objIndexCopy11 int32
	var _delta56 int32
	var _delta57 int32
	var _delta58 int32
	var _objIndexCopy12 int32
	var satisfied int32
	var isEmpty int32
	var _delta59 int32
	var _delta60 int32
	var _delta61 int32
	var _delta62 int32
	var _delta63 int32
	var _delta64 int32
	var _delta65 int32
	var _objIndexCopy13 int32
	var _delta66 int32
	var _delta67 int32
	var _delta68 int32
	var _delta69 int32
	var testNumType int32
	var _delta70 int32
	var _delta71 int32
	var _delta72 int32
	var _delta73 int32
	var _delta74 int32
	var _objIndexCopy14 int32
	var _delta75 int32
	var _delta76 int32
	var _delta77 int32
	var _objIndexCopy15 int32
	var _delta78 int32
	var _delta79 int32
	var _delta80 int32
	var _objIndexCopy16 int32
	var _delta81 int32
	var _delta82 int32
	var _delta83 int32
	var _delta84 int32
	var _delta85 int32
	var _delta86 int32
	var _delta87 int32
	var _delta88 int32
	var _delta89 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	allowEmpty = 0

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 6) {
		goto __1
	}
	return TCL_ERROR
__1:
	;
	isClass = XTcl_NewObj(tls)
	if !!(XTclWordKnownAtCompileTime(tls, tokenPtr, isClass) != 0) {
		goto __2
	}
__4:
	_objPtr = isClass
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __7
	}
	XTclFreeObj(tls, _objPtr)
__7:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;
	return TCL_ERROR
	goto __3
__2:
	if !(XTcl_GetIndexFromObjStruct(tls, interp, isClass, uintptr(unsafe.Pointer(&isClasses1)), int32(unsafe.Sizeof(uintptr(0))), ts+16064, 0, bp) != TCL_OK) {
		goto __8
	}
__9:
	_objPtr1 = isClass
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __12
	}
	XTclFreeObj(tls, _objPtr1)
__12:
	;
	goto __10
__10:
	if 0 != 0 {
		goto __9
	}
	goto __11
__11:
	;
	XTclCompileSyntaxError(tls, interp, envPtr)
	return TCL_OK
__8:
	;
__3:
	;
__13:
	_objPtr2 = isClass
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __16
	}
	XTclFreeObj(tls, _objPtr2)
__16:
	;
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;

	// Cannot handle the -failindex option at all, and that's the only legal
	// way to have more than 4 arguments.

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 && (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 4) {
		goto __17
	}
	return TCL_ERROR
__17:
	;

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 3) {
		goto __18
	}
	allowEmpty = 1
	goto __19
__18:
	if !!((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD && (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize > 1 && int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart))) == int32(*(*int8)(unsafe.Pointer(ts + 10019))) && libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, ts+10019, uint64((*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize)) == 0) {
		goto __20
	}
	return TCL_ERROR
__20:
	;
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
__19:
	;

	// Compile the code. There are several main classes of check here.
	//	1. Character classes
	//	2. Booleans
	//	3. Integers
	//	4. Floats
	//	5. Lists

	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __21
	}
__23:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __26
	}
__28:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __31
	}
	XTclExpandCodeArray(tls, envPtr)
__31:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __32
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__32:
	;
__33:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __36
	}
	if !(_delta == -0x7fffffff-1) {
		goto __37
	}
	_delta = 1 - _objIndexCopy
__37:
	;
__38:
	if !(_delta < 0) {
		goto __41
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __42
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__42:
	;
__41:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __39
__39:
	if 0 != 0 {
		goto __38
	}
	goto __40
__40:
	;
__36:
	;
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	goto __27
__26:
__43:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __46
	}
	XTclExpandCodeArray(tls, envPtr)
__46:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __47
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__47:
	;
__48:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __51
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __52
	}
	_delta1 = 1 - _objIndexCopy
__52:
	;
__53:
	if !(_delta1 < 0) {
		goto __56
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __57
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__57:
	;
__56:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
__51:
	;
	goto __49
__49:
	if 0 != 0 {
		goto __48
	}
	goto __50
__50:
	;
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;
__27:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
	goto __22
__21:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-1)*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__22:
	;

	switch uint32(*(*int32)(unsafe.Pointer(bp /* t */))) {
	case uint32(0) /* STR_IS_ALNUM */ :
		goto __59
	case uint32(1) /* STR_IS_ALPHA */ :
		goto __60
	case uint32(2) /* STR_IS_ASCII */ :
		goto __61
	case uint32(3) /* STR_IS_CONTROL */ :
		goto __62
	case uint32(5) /* STR_IS_DIGIT */ :
		goto __63
	case uint32(9) /* STR_IS_GRAPH */ :
		goto __64
	case uint32(12) /* STR_IS_LOWER */ :
		goto __65
	case uint32(13) /* STR_IS_PRINT */ :
		goto __66
	case uint32(14) /* STR_IS_PUNCT */ :
		goto __67
	case uint32(15) /* STR_IS_SPACE */ :
		goto __68
	case uint32(17) /* STR_IS_UPPER */ :
		goto __69
	case uint32(19) /* STR_IS_WORD */ :
		goto __70
	case uint32(20) /* STR_IS_XDIGIT */ :
		goto __71

	case uint32(4) /* STR_IS_BOOL */ :
		goto __72
	case uint32(8) /* STR_IS_FALSE */ :
		goto __73
	case uint32(16) /* STR_IS_TRUE */ :
		goto __74

	case uint32(6) /* STR_IS_DOUBLE */ :
		goto __75

	case uint32(10) /* STR_IS_INT */ :
		goto __76
	case uint32(18) /* STR_IS_WIDE */ :
		goto __77
	case uint32(7) /* STR_IS_ENTIER */ :
		goto __78

	case uint32(11) /* STR_IS_LIST */ :
		goto __79
	}
	goto __58
__59:
	strClassType = STR_CLASS_ALNUM
	goto compileStrClass
__60:
	strClassType = STR_CLASS_ALPHA
	goto compileStrClass
__61:
	strClassType = STR_CLASS_ASCII
	goto compileStrClass
__62:
	strClassType = STR_CLASS_CONTROL
	goto compileStrClass
__63:
	strClassType = STR_CLASS_DIGIT
	goto compileStrClass
__64:
	strClassType = STR_CLASS_GRAPH
	goto compileStrClass
__65:
	strClassType = STR_CLASS_LOWER
	goto compileStrClass
__66:
	strClassType = STR_CLASS_PRINT
	goto compileStrClass
__67:
	strClassType = STR_CLASS_PUNCT
	goto compileStrClass
__68:
	strClassType = STR_CLASS_SPACE
	goto compileStrClass
__69:
	strClassType = STR_CLASS_UPPER
	goto compileStrClass
__70:
	strClassType = STR_CLASS_WORD
	goto compileStrClass
__71:
	strClassType = STR_CLASS_XDIGIT
compileStrClass:
	if !(allowEmpty != 0) {
		goto __80
	}
__82:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __85
	}
	XTclExpandCodeArray(tls, envPtr)
__85:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CLASS)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(strClassType)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __86
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_CLASS == INST_START_CMD {
			return 1
		}
		return 0
	}()
__86:
	;
__87:
	_delta2 = XtclInstructionTable[INST_STR_CLASS].FstackEffect
	if !(_delta2 != 0) {
		goto __90
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __91
	}
	_delta2 = int32(InstStringClassType(1) - strClassType)
__91:
	;
__92:
	if !(_delta2 < 0) {
		goto __95
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __96
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__96:
	;
__95:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __93
__93:
	if 0 != 0 {
		goto __92
	}
	goto __94
__94:
	;
__90:
	;
	goto __88
__88:
	if 0 != 0 {
		goto __87
	}
	goto __89
__89:
	;
	goto __83
__83:
	if 0 != 0 {
		goto __82
	}
	goto __84
__84:
	;
	goto __81
__80:

__97:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __100
	}
	XTclExpandCodeArray(tls, envPtr)
__100:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __101
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__101:
	;
__102:
	_delta3 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta3 != 0) {
		goto __105
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __106
	}
	_delta3 = 1 - 0
__106:
	;
__107:
	if !(_delta3 < 0) {
		goto __110
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __111
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__111:
	;
__110:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __108
__108:
	if 0 != 0 {
		goto __107
	}
	goto __109
__109:
	;
__105:
	;
	goto __103
__103:
	if 0 != 0 {
		goto __102
	}
	goto __104
__104:
	;
	goto __98
__98:
	if 0 != 0 {
		goto __97
	}
	goto __99
__99:
	;
__112:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __115
	}
	XTclExpandCodeArray(tls, envPtr)
__115:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CLASS)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(strClassType)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __116
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_CLASS == INST_START_CMD {
			return 1
		}
		return 0
	}()
__116:
	;
__117:
	_delta4 = XtclInstructionTable[INST_STR_CLASS].FstackEffect
	if !(_delta4 != 0) {
		goto __120
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __121
	}
	_delta4 = int32(InstStringClassType(1) - strClassType)
__121:
	;
__122:
	if !(_delta4 < 0) {
		goto __125
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __126
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__126:
	;
__125:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __123
__123:
	if 0 != 0 {
		goto __122
	}
	goto __124
__124:
	;
__120:
	;
	goto __118
__118:
	if 0 != 0 {
		goto __117
	}
	goto __119
__119:
	;
	goto __113
__113:
	if 0 != 0 {
		goto __112
	}
	goto __114
__114:
	;
	over = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__127:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __130
	}
	XTclExpandCodeArray(tls, envPtr)
__130:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __131
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__131:
	;
__132:
	_delta5 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta5 != 0) {
		goto __135
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __136
	}
	_delta5 = 1 - 0
__136:
	;
__137:
	if !(_delta5 < 0) {
		goto __140
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __141
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__141:
	;
__140:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __138
__138:
	if 0 != 0 {
		goto __137
	}
	goto __139
__139:
	;
__135:
	;
	goto __133
__133:
	if 0 != 0 {
		goto __132
	}
	goto __134
__134:
	;
	goto __128
__128:
	if 0 != 0 {
		goto __127
	}
	goto __129
__129:
	;
__142:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __145
	}
	XTclExpandCodeArray(tls, envPtr)
__145:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __146
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__146:
	;
__147:
	_delta6 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta6 != 0) {
		goto __150
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __151
	}
	_delta6 = 1 - 0
__151:
	;
__152:
	if !(_delta6 < 0) {
		goto __155
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __156
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__156:
	;
__155:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __153
__153:
	if 0 != 0 {
		goto __152
	}
	goto __154
__154:
	;
__150:
	;
	goto __148
__148:
	if 0 != 0 {
		goto __147
	}
	goto __149
__149:
	;
	goto __143
__143:
	if 0 != 0 {
		goto __142
	}
	goto __144
__144:
	;
__157:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, ts+18333, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy1 <= 255) {
		goto __160
	}
__162:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __165
	}
	XTclExpandCodeArray(tls, envPtr)
__165:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __166
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__166:
	;
__167:
	_delta7 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta7 != 0) {
		goto __170
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __171
	}
	_delta7 = 1 - _objIndexCopy1
__171:
	;
__172:
	if !(_delta7 < 0) {
		goto __175
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __176
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__176:
	;
__175:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __173
__173:
	if 0 != 0 {
		goto __172
	}
	goto __174
__174:
	;
__170:
	;
	goto __168
__168:
	if 0 != 0 {
		goto __167
	}
	goto __169
__169:
	;
	goto __163
__163:
	if 0 != 0 {
		goto __162
	}
	goto __164
__164:
	;
	goto __161
__160:
__177:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __180
	}
	XTclExpandCodeArray(tls, envPtr)
__180:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __181
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__181:
	;
__182:
	_delta8 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta8 != 0) {
		goto __185
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __186
	}
	_delta8 = 1 - _objIndexCopy1
__186:
	;
__187:
	if !(_delta8 < 0) {
		goto __190
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __191
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__191:
	;
__190:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __188
__188:
	if 0 != 0 {
		goto __187
	}
	goto __189
__189:
	;
__185:
	;
	goto __183
__183:
	if 0 != 0 {
		goto __182
	}
	goto __184
__184:
	;
	goto __178
__178:
	if 0 != 0 {
		goto __177
	}
	goto __179
__179:
	;
__161:
	;
	goto __158
__158:
	if 0 != 0 {
		goto __157
	}
	goto __159
__159:
	;
	over2 = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__192:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __195
	}
	XTclExpandCodeArray(tls, envPtr)
__195:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __196
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__196:
	;
__197:
	_delta9 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta9 != 0) {
		goto __200
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __201
	}
	_delta9 = 1 - 0
__201:
	;
__202:
	if !(_delta9 < 0) {
		goto __205
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __206
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__206:
	;
__205:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __203
__203:
	if 0 != 0 {
		goto __202
	}
	goto __204
__204:
	;
__200:
	;
	goto __198
__198:
	if 0 != 0 {
		goto __197
	}
	goto __199
__199:
	;
	goto __193
__193:
	if 0 != 0 {
		goto __192
	}
	goto __194
__194:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(over) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(over)))
__207:
	_objIndexCopy2 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy2 <= 255) {
		goto __210
	}
__212:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __215
	}
	XTclExpandCodeArray(tls, envPtr)
__215:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __216
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__216:
	;
__217:
	_delta10 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta10 != 0) {
		goto __220
	}
	if !(_delta10 == -0x7fffffff-1) {
		goto __221
	}
	_delta10 = 1 - _objIndexCopy2
__221:
	;
__222:
	if !(_delta10 < 0) {
		goto __225
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __226
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__226:
	;
__225:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta10
	goto __223
__223:
	if 0 != 0 {
		goto __222
	}
	goto __224
__224:
	;
__220:
	;
	goto __218
__218:
	if 0 != 0 {
		goto __217
	}
	goto __219
__219:
	;
	goto __213
__213:
	if 0 != 0 {
		goto __212
	}
	goto __214
__214:
	;
	goto __211
__210:
__227:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __230
	}
	XTclExpandCodeArray(tls, envPtr)
__230:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __231
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__231:
	;
__232:
	_delta11 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta11 != 0) {
		goto __235
	}
	if !(_delta11 == -0x7fffffff-1) {
		goto __236
	}
	_delta11 = 1 - _objIndexCopy2
__236:
	;
__237:
	if !(_delta11 < 0) {
		goto __240
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __241
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__241:
	;
__240:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta11
	goto __238
__238:
	if 0 != 0 {
		goto __237
	}
	goto __239
__239:
	;
__235:
	;
	goto __233
__233:
	if 0 != 0 {
		goto __232
	}
	goto __234
__234:
	;
	goto __228
__228:
	if 0 != 0 {
		goto __227
	}
	goto __229
__229:
	;
__211:
	;
	goto __208
__208:
	if 0 != 0 {
		goto __207
	}
	goto __209
__209:
	;
__242:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __245
	}
	XTclExpandCodeArray(tls, envPtr)
__245:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_NEQ)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __246
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_NEQ == INST_START_CMD {
			return 1
		}
		return 0
	}()
__246:
	;
__247:
	_delta12 = XtclInstructionTable[INST_STR_NEQ].FstackEffect
	if !(_delta12 != 0) {
		goto __250
	}
	if !(_delta12 == -0x7fffffff-1) {
		goto __251
	}
	_delta12 = 1 - 0
__251:
	;
__252:
	if !(_delta12 < 0) {
		goto __255
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __256
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__256:
	;
__255:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta12
	goto __253
__253:
	if 0 != 0 {
		goto __252
	}
	goto __254
__254:
	;
__250:
	;
	goto __248
__248:
	if 0 != 0 {
		goto __247
	}
	goto __249
__249:
	;
	goto __243
__243:
	if 0 != 0 {
		goto __242
	}
	goto __244
__244:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(over2) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(over2)))
__81:
	;
	return TCL_OK

__72:
__73:
__74:
__257:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __260
	}
	XTclExpandCodeArray(tls, envPtr)
__260:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_TRY_CVT_TO_BOOLEAN)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __261
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_TRY_CVT_TO_BOOLEAN == INST_START_CMD {
			return 1
		}
		return 0
	}()
__261:
	;
__262:
	_delta13 = XtclInstructionTable[INST_TRY_CVT_TO_BOOLEAN].FstackEffect
	if !(_delta13 != 0) {
		goto __265
	}
	if !(_delta13 == -0x7fffffff-1) {
		goto __266
	}
	_delta13 = 1 - 0
__266:
	;
__267:
	if !(_delta13 < 0) {
		goto __270
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __271
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__271:
	;
__270:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta13
	goto __268
__268:
	if 0 != 0 {
		goto __267
	}
	goto __269
__269:
	;
__265:
	;
	goto __263
__263:
	if 0 != 0 {
		goto __262
	}
	goto __264
__264:
	;
	goto __258
__258:
	if 0 != 0 {
		goto __257
	}
	goto __259
__259:
	;
	switch *(*int32)(unsafe.Pointer(bp /* t */)) {

	case 4 /* STR_IS_BOOL */ :
		goto __273
	case 16 /* STR_IS_TRUE */ :
		goto __274
	case 8 /* STR_IS_FALSE */ :
		goto __275
	}
	goto __272

__273:
	if !(allowEmpty != 0) {
		goto __276
	}
	over1 = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__278:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __281
	}
	XTclExpandCodeArray(tls, envPtr)
__281:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __282
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__282:
	;
__283:
	_delta14 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta14 != 0) {
		goto __286
	}
	if !(_delta14 == -0x7fffffff-1) {
		goto __287
	}
	_delta14 = 1 - 0
__287:
	;
__288:
	if !(_delta14 < 0) {
		goto __291
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __292
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__292:
	;
__291:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta14
	goto __289
__289:
	if 0 != 0 {
		goto __288
	}
	goto __290
__290:
	;
__286:
	;
	goto __284
__284:
	if 0 != 0 {
		goto __283
	}
	goto __285
__285:
	;
	goto __279
__279:
	if 0 != 0 {
		goto __278
	}
	goto __280
__280:
	;
__293:
	_objIndexCopy3 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy3 <= 255) {
		goto __296
	}
__298:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __301
	}
	XTclExpandCodeArray(tls, envPtr)
__301:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __302
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__302:
	;
__303:
	_delta15 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta15 != 0) {
		goto __306
	}
	if !(_delta15 == -0x7fffffff-1) {
		goto __307
	}
	_delta15 = 1 - _objIndexCopy3
__307:
	;
__308:
	if !(_delta15 < 0) {
		goto __311
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __312
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__312:
	;
__311:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta15
	goto __309
__309:
	if 0 != 0 {
		goto __308
	}
	goto __310
__310:
	;
__306:
	;
	goto __304
__304:
	if 0 != 0 {
		goto __303
	}
	goto __305
__305:
	;
	goto __299
__299:
	if 0 != 0 {
		goto __298
	}
	goto __300
__300:
	;
	goto __297
__296:
__313:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __316
	}
	XTclExpandCodeArray(tls, envPtr)
__316:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __317
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__317:
	;
__318:
	_delta16 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta16 != 0) {
		goto __321
	}
	if !(_delta16 == -0x7fffffff-1) {
		goto __322
	}
	_delta16 = 1 - _objIndexCopy3
__322:
	;
__323:
	if !(_delta16 < 0) {
		goto __326
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __327
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__327:
	;
__326:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta16
	goto __324
__324:
	if 0 != 0 {
		goto __323
	}
	goto __325
__325:
	;
__321:
	;
	goto __319
__319:
	if 0 != 0 {
		goto __318
	}
	goto __320
__320:
	;
	goto __314
__314:
	if 0 != 0 {
		goto __313
	}
	goto __315
__315:
	;
__297:
	;
	goto __294
__294:
	if 0 != 0 {
		goto __293
	}
	goto __295
__295:
	;
__328:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __331
	}
	XTclExpandCodeArray(tls, envPtr)
__331:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __332
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_EQ == INST_START_CMD {
			return 1
		}
		return 0
	}()
__332:
	;
__333:
	_delta17 = XtclInstructionTable[INST_STR_EQ].FstackEffect
	if !(_delta17 != 0) {
		goto __336
	}
	if !(_delta17 == -0x7fffffff-1) {
		goto __337
	}
	_delta17 = 1 - 0
__337:
	;
__338:
	if !(_delta17 < 0) {
		goto __341
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __342
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__342:
	;
__341:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta17
	goto __339
__339:
	if 0 != 0 {
		goto __338
	}
	goto __340
__340:
	;
__336:
	;
	goto __334
__334:
	if 0 != 0 {
		goto __333
	}
	goto __335
__335:
	;
	goto __329
__329:
	if 0 != 0 {
		goto __328
	}
	goto __330
__330:
	;
	over21 = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__343:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __346
	}
	XTclExpandCodeArray(tls, envPtr)
__346:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __347
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__347:
	;
__348:
	_delta18 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta18 != 0) {
		goto __351
	}
	if !(_delta18 == -0x7fffffff-1) {
		goto __352
	}
	_delta18 = 1 - 0
__352:
	;
__353:
	if !(_delta18 < 0) {
		goto __356
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __357
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__357:
	;
__356:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta18
	goto __354
__354:
	if 0 != 0 {
		goto __353
	}
	goto __355
__355:
	;
__351:
	;
	goto __349
__349:
	if 0 != 0 {
		goto __348
	}
	goto __350
__350:
	;
	goto __344
__344:
	if 0 != 0 {
		goto __343
	}
	goto __345
__345:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(over1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(over1)))
__358:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __361
	}
	XTclExpandCodeArray(tls, envPtr)
__361:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __362
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__362:
	;
__363:
	_delta19 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta19 != 0) {
		goto __366
	}
	if !(_delta19 == -0x7fffffff-1) {
		goto __367
	}
	_delta19 = 1 - 0
__367:
	;
__368:
	if !(_delta19 < 0) {
		goto __371
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __372
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__372:
	;
__371:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta19
	goto __369
__369:
	if 0 != 0 {
		goto __368
	}
	goto __370
__370:
	;
__366:
	;
	goto __364
__364:
	if 0 != 0 {
		goto __363
	}
	goto __365
__365:
	;
	goto __359
__359:
	if 0 != 0 {
		goto __358
	}
	goto __360
__360:
	;
__373:
	_objIndexCopy4 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy4 <= 255) {
		goto __376
	}
__378:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __381
	}
	XTclExpandCodeArray(tls, envPtr)
__381:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __382
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__382:
	;
__383:
	_delta20 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta20 != 0) {
		goto __386
	}
	if !(_delta20 == -0x7fffffff-1) {
		goto __387
	}
	_delta20 = 1 - _objIndexCopy4
__387:
	;
__388:
	if !(_delta20 < 0) {
		goto __391
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __392
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__392:
	;
__391:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta20
	goto __389
__389:
	if 0 != 0 {
		goto __388
	}
	goto __390
__390:
	;
__386:
	;
	goto __384
__384:
	if 0 != 0 {
		goto __383
	}
	goto __385
__385:
	;
	goto __379
__379:
	if 0 != 0 {
		goto __378
	}
	goto __380
__380:
	;
	goto __377
__376:
__393:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __396
	}
	XTclExpandCodeArray(tls, envPtr)
__396:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __397
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__397:
	;
__398:
	_delta21 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta21 != 0) {
		goto __401
	}
	if !(_delta21 == -0x7fffffff-1) {
		goto __402
	}
	_delta21 = 1 - _objIndexCopy4
__402:
	;
__403:
	if !(_delta21 < 0) {
		goto __406
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __407
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__407:
	;
__406:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta21
	goto __404
__404:
	if 0 != 0 {
		goto __403
	}
	goto __405
__405:
	;
__401:
	;
	goto __399
__399:
	if 0 != 0 {
		goto __398
	}
	goto __400
__400:
	;
	goto __394
__394:
	if 0 != 0 {
		goto __393
	}
	goto __395
__395:
	;
__377:
	;
	goto __374
__374:
	if 0 != 0 {
		goto __373
	}
	goto __375
__375:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(over21) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(over21)))
	goto __277
__276:
__408:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __411
	}
	XTclExpandCodeArray(tls, envPtr)
__411:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __412
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__412:
	;
__413:
	_delta22 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta22 != 0) {
		goto __416
	}
	if !(_delta22 == -0x7fffffff-1) {
		goto __417
	}
	_delta22 = 1 - 2
__417:
	;
__418:
	if !(_delta22 < 0) {
		goto __421
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __422
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__422:
	;
__421:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta22
	goto __419
__419:
	if 0 != 0 {
		goto __418
	}
	goto __420
__420:
	;
__416:
	;
	goto __414
__414:
	if 0 != 0 {
		goto __413
	}
	goto __415
__415:
	;
	goto __409
__409:
	if 0 != 0 {
		goto __408
	}
	goto __410
__410:
	;
__423:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __426
	}
	XTclExpandCodeArray(tls, envPtr)
__426:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __427
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__427:
	;
__428:
	_delta23 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta23 != 0) {
		goto __431
	}
	if !(_delta23 == -0x7fffffff-1) {
		goto __432
	}
	_delta23 = 1 - 0
__432:
	;
__433:
	if !(_delta23 < 0) {
		goto __436
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __437
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__437:
	;
__436:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta23
	goto __434
__434:
	if 0 != 0 {
		goto __433
	}
	goto __435
__435:
	;
__431:
	;
	goto __429
__429:
	if 0 != 0 {
		goto __428
	}
	goto __430
__430:
	;
	goto __424
__424:
	if 0 != 0 {
		goto __423
	}
	goto __425
__425:
	;
__277:
	;
	return TCL_OK
__274:
	over1 = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__438:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __441
	}
	XTclExpandCodeArray(tls, envPtr)
__441:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __442
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__442:
	;
__443:
	_delta24 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta24 != 0) {
		goto __446
	}
	if !(_delta24 == -0x7fffffff-1) {
		goto __447
	}
	_delta24 = 1 - 0
__447:
	;
__448:
	if !(_delta24 < 0) {
		goto __451
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __452
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__452:
	;
__451:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta24
	goto __449
__449:
	if 0 != 0 {
		goto __448
	}
	goto __450
__450:
	;
__446:
	;
	goto __444
__444:
	if 0 != 0 {
		goto __443
	}
	goto __445
__445:
	;
	goto __439
__439:
	if 0 != 0 {
		goto __438
	}
	goto __440
__440:
	;
	if !(allowEmpty != 0) {
		goto __453
	}
__455:
	_objIndexCopy5 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy5 <= 255) {
		goto __458
	}
__460:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __463
	}
	XTclExpandCodeArray(tls, envPtr)
__463:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __464
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__464:
	;
__465:
	_delta25 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta25 != 0) {
		goto __468
	}
	if !(_delta25 == -0x7fffffff-1) {
		goto __469
	}
	_delta25 = 1 - _objIndexCopy5
__469:
	;
__470:
	if !(_delta25 < 0) {
		goto __473
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __474
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__474:
	;
__473:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta25
	goto __471
__471:
	if 0 != 0 {
		goto __470
	}
	goto __472
__472:
	;
__468:
	;
	goto __466
__466:
	if 0 != 0 {
		goto __465
	}
	goto __467
__467:
	;
	goto __461
__461:
	if 0 != 0 {
		goto __460
	}
	goto __462
__462:
	;
	goto __459
__458:
__475:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __478
	}
	XTclExpandCodeArray(tls, envPtr)
__478:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __479
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__479:
	;
__480:
	_delta26 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta26 != 0) {
		goto __483
	}
	if !(_delta26 == -0x7fffffff-1) {
		goto __484
	}
	_delta26 = 1 - _objIndexCopy5
__484:
	;
__485:
	if !(_delta26 < 0) {
		goto __488
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __489
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__489:
	;
__488:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta26
	goto __486
__486:
	if 0 != 0 {
		goto __485
	}
	goto __487
__487:
	;
__483:
	;
	goto __481
__481:
	if 0 != 0 {
		goto __480
	}
	goto __482
__482:
	;
	goto __476
__476:
	if 0 != 0 {
		goto __475
	}
	goto __477
__477:
	;
__459:
	;
	goto __456
__456:
	if 0 != 0 {
		goto __455
	}
	goto __457
__457:
	;
__490:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __493
	}
	XTclExpandCodeArray(tls, envPtr)
__493:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __494
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_EQ == INST_START_CMD {
			return 1
		}
		return 0
	}()
__494:
	;
__495:
	_delta27 = XtclInstructionTable[INST_STR_EQ].FstackEffect
	if !(_delta27 != 0) {
		goto __498
	}
	if !(_delta27 == -0x7fffffff-1) {
		goto __499
	}
	_delta27 = 1 - 0
__499:
	;
__500:
	if !(_delta27 < 0) {
		goto __503
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __504
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__504:
	;
__503:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta27
	goto __501
__501:
	if 0 != 0 {
		goto __500
	}
	goto __502
__502:
	;
__498:
	;
	goto __496
__496:
	if 0 != 0 {
		goto __495
	}
	goto __497
__497:
	;
	goto __491
__491:
	if 0 != 0 {
		goto __490
	}
	goto __492
__492:
	;
	goto __454
__453:
__505:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __508
	}
	XTclExpandCodeArray(tls, envPtr)
__508:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __509
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__509:
	;
__510:
	_delta28 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta28 != 0) {
		goto __513
	}
	if !(_delta28 == -0x7fffffff-1) {
		goto __514
	}
	_delta28 = 1 - 0
__514:
	;
__515:
	if !(_delta28 < 0) {
		goto __518
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __519
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__519:
	;
__518:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta28
	goto __516
__516:
	if 0 != 0 {
		goto __515
	}
	goto __517
__517:
	;
__513:
	;
	goto __511
__511:
	if 0 != 0 {
		goto __510
	}
	goto __512
__512:
	;
	goto __506
__506:
	if 0 != 0 {
		goto __505
	}
	goto __507
__507:
	;
__520:
	_objIndexCopy6 = XTclRegisterLiteral(tls, envPtr, ts+18333, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy6 <= 255) {
		goto __523
	}
__525:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __528
	}
	XTclExpandCodeArray(tls, envPtr)
__528:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __529
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__529:
	;
__530:
	_delta29 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta29 != 0) {
		goto __533
	}
	if !(_delta29 == -0x7fffffff-1) {
		goto __534
	}
	_delta29 = 1 - _objIndexCopy6
__534:
	;
__535:
	if !(_delta29 < 0) {
		goto __538
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __539
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__539:
	;
__538:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta29
	goto __536
__536:
	if 0 != 0 {
		goto __535
	}
	goto __537
__537:
	;
__533:
	;
	goto __531
__531:
	if 0 != 0 {
		goto __530
	}
	goto __532
__532:
	;
	goto __526
__526:
	if 0 != 0 {
		goto __525
	}
	goto __527
__527:
	;
	goto __524
__523:
__540:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __543
	}
	XTclExpandCodeArray(tls, envPtr)
__543:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __544
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__544:
	;
__545:
	_delta30 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta30 != 0) {
		goto __548
	}
	if !(_delta30 == -0x7fffffff-1) {
		goto __549
	}
	_delta30 = 1 - _objIndexCopy6
__549:
	;
__550:
	if !(_delta30 < 0) {
		goto __553
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __554
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__554:
	;
__553:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta30
	goto __551
__551:
	if 0 != 0 {
		goto __550
	}
	goto __552
__552:
	;
__548:
	;
	goto __546
__546:
	if 0 != 0 {
		goto __545
	}
	goto __547
__547:
	;
	goto __541
__541:
	if 0 != 0 {
		goto __540
	}
	goto __542
__542:
	;
__524:
	;
	goto __521
__521:
	if 0 != 0 {
		goto __520
	}
	goto __522
__522:
	;
__454:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(over1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(over1)))
__555:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __558
	}
	XTclExpandCodeArray(tls, envPtr)
__558:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LNOT)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __559
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LNOT == INST_START_CMD {
			return 1
		}
		return 0
	}()
__559:
	;
__560:
	_delta31 = XtclInstructionTable[INST_LNOT].FstackEffect
	if !(_delta31 != 0) {
		goto __563
	}
	if !(_delta31 == -0x7fffffff-1) {
		goto __564
	}
	_delta31 = 1 - 0
__564:
	;
__565:
	if !(_delta31 < 0) {
		goto __568
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __569
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__569:
	;
__568:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta31
	goto __566
__566:
	if 0 != 0 {
		goto __565
	}
	goto __567
__567:
	;
__563:
	;
	goto __561
__561:
	if 0 != 0 {
		goto __560
	}
	goto __562
__562:
	;
	goto __556
__556:
	if 0 != 0 {
		goto __555
	}
	goto __557
__557:
	;
__570:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __573
	}
	XTclExpandCodeArray(tls, envPtr)
__573:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LNOT)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __574
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LNOT == INST_START_CMD {
			return 1
		}
		return 0
	}()
__574:
	;
__575:
	_delta32 = XtclInstructionTable[INST_LNOT].FstackEffect
	if !(_delta32 != 0) {
		goto __578
	}
	if !(_delta32 == -0x7fffffff-1) {
		goto __579
	}
	_delta32 = 1 - 0
__579:
	;
__580:
	if !(_delta32 < 0) {
		goto __583
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __584
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__584:
	;
__583:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta32
	goto __581
__581:
	if 0 != 0 {
		goto __580
	}
	goto __582
__582:
	;
__578:
	;
	goto __576
__576:
	if 0 != 0 {
		goto __575
	}
	goto __577
__577:
	;
	goto __571
__571:
	if 0 != 0 {
		goto __570
	}
	goto __572
__572:
	;
	return TCL_OK
__275:
	over1 = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__585:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __588
	}
	XTclExpandCodeArray(tls, envPtr)
__588:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __589
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__589:
	;
__590:
	_delta33 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta33 != 0) {
		goto __593
	}
	if !(_delta33 == -0x7fffffff-1) {
		goto __594
	}
	_delta33 = 1 - 0
__594:
	;
__595:
	if !(_delta33 < 0) {
		goto __598
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __599
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__599:
	;
__598:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta33
	goto __596
__596:
	if 0 != 0 {
		goto __595
	}
	goto __597
__597:
	;
__593:
	;
	goto __591
__591:
	if 0 != 0 {
		goto __590
	}
	goto __592
__592:
	;
	goto __586
__586:
	if 0 != 0 {
		goto __585
	}
	goto __587
__587:
	;
	if !(allowEmpty != 0) {
		goto __600
	}
__602:
	_objIndexCopy7 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy7 <= 255) {
		goto __605
	}
__607:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __610
	}
	XTclExpandCodeArray(tls, envPtr)
__610:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __611
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__611:
	;
__612:
	_delta34 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta34 != 0) {
		goto __615
	}
	if !(_delta34 == -0x7fffffff-1) {
		goto __616
	}
	_delta34 = 1 - _objIndexCopy7
__616:
	;
__617:
	if !(_delta34 < 0) {
		goto __620
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __621
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__621:
	;
__620:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta34
	goto __618
__618:
	if 0 != 0 {
		goto __617
	}
	goto __619
__619:
	;
__615:
	;
	goto __613
__613:
	if 0 != 0 {
		goto __612
	}
	goto __614
__614:
	;
	goto __608
__608:
	if 0 != 0 {
		goto __607
	}
	goto __609
__609:
	;
	goto __606
__605:
__622:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __625
	}
	XTclExpandCodeArray(tls, envPtr)
__625:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __626
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__626:
	;
__627:
	_delta35 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta35 != 0) {
		goto __630
	}
	if !(_delta35 == -0x7fffffff-1) {
		goto __631
	}
	_delta35 = 1 - _objIndexCopy7
__631:
	;
__632:
	if !(_delta35 < 0) {
		goto __635
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __636
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__636:
	;
__635:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta35
	goto __633
__633:
	if 0 != 0 {
		goto __632
	}
	goto __634
__634:
	;
__630:
	;
	goto __628
__628:
	if 0 != 0 {
		goto __627
	}
	goto __629
__629:
	;
	goto __623
__623:
	if 0 != 0 {
		goto __622
	}
	goto __624
__624:
	;
__606:
	;
	goto __603
__603:
	if 0 != 0 {
		goto __602
	}
	goto __604
__604:
	;
__637:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __640
	}
	XTclExpandCodeArray(tls, envPtr)
__640:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_NEQ)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __641
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_NEQ == INST_START_CMD {
			return 1
		}
		return 0
	}()
__641:
	;
__642:
	_delta36 = XtclInstructionTable[INST_STR_NEQ].FstackEffect
	if !(_delta36 != 0) {
		goto __645
	}
	if !(_delta36 == -0x7fffffff-1) {
		goto __646
	}
	_delta36 = 1 - 0
__646:
	;
__647:
	if !(_delta36 < 0) {
		goto __650
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __651
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__651:
	;
__650:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta36
	goto __648
__648:
	if 0 != 0 {
		goto __647
	}
	goto __649
__649:
	;
__645:
	;
	goto __643
__643:
	if 0 != 0 {
		goto __642
	}
	goto __644
__644:
	;
	goto __638
__638:
	if 0 != 0 {
		goto __637
	}
	goto __639
__639:
	;
	goto __601
__600:
__652:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __655
	}
	XTclExpandCodeArray(tls, envPtr)
__655:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __656
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__656:
	;
__657:
	_delta37 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta37 != 0) {
		goto __660
	}
	if !(_delta37 == -0x7fffffff-1) {
		goto __661
	}
	_delta37 = 1 - 0
__661:
	;
__662:
	if !(_delta37 < 0) {
		goto __665
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __666
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__666:
	;
__665:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta37
	goto __663
__663:
	if 0 != 0 {
		goto __662
	}
	goto __664
__664:
	;
__660:
	;
	goto __658
__658:
	if 0 != 0 {
		goto __657
	}
	goto __659
__659:
	;
	goto __653
__653:
	if 0 != 0 {
		goto __652
	}
	goto __654
__654:
	;
__667:
	_objIndexCopy8 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy8 <= 255) {
		goto __670
	}
__672:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __675
	}
	XTclExpandCodeArray(tls, envPtr)
__675:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __676
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__676:
	;
__677:
	_delta38 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta38 != 0) {
		goto __680
	}
	if !(_delta38 == -0x7fffffff-1) {
		goto __681
	}
	_delta38 = 1 - _objIndexCopy8
__681:
	;
__682:
	if !(_delta38 < 0) {
		goto __685
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __686
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__686:
	;
__685:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta38
	goto __683
__683:
	if 0 != 0 {
		goto __682
	}
	goto __684
__684:
	;
__680:
	;
	goto __678
__678:
	if 0 != 0 {
		goto __677
	}
	goto __679
__679:
	;
	goto __673
__673:
	if 0 != 0 {
		goto __672
	}
	goto __674
__674:
	;
	goto __671
__670:
__687:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __690
	}
	XTclExpandCodeArray(tls, envPtr)
__690:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __691
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__691:
	;
__692:
	_delta39 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta39 != 0) {
		goto __695
	}
	if !(_delta39 == -0x7fffffff-1) {
		goto __696
	}
	_delta39 = 1 - _objIndexCopy8
__696:
	;
__697:
	if !(_delta39 < 0) {
		goto __700
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __701
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__701:
	;
__700:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta39
	goto __698
__698:
	if 0 != 0 {
		goto __697
	}
	goto __699
__699:
	;
__695:
	;
	goto __693
__693:
	if 0 != 0 {
		goto __692
	}
	goto __694
__694:
	;
	goto __688
__688:
	if 0 != 0 {
		goto __687
	}
	goto __689
__689:
	;
__671:
	;
	goto __668
__668:
	if 0 != 0 {
		goto __667
	}
	goto __669
__669:
	;
__601:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(over1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(over1)))
__702:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __705
	}
	XTclExpandCodeArray(tls, envPtr)
__705:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LNOT)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __706
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LNOT == INST_START_CMD {
			return 1
		}
		return 0
	}()
__706:
	;
__707:
	_delta40 = XtclInstructionTable[INST_LNOT].FstackEffect
	if !(_delta40 != 0) {
		goto __710
	}
	if !(_delta40 == -0x7fffffff-1) {
		goto __711
	}
	_delta40 = 1 - 0
__711:
	;
__712:
	if !(_delta40 < 0) {
		goto __715
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __716
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__716:
	;
__715:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta40
	goto __713
__713:
	if 0 != 0 {
		goto __712
	}
	goto __714
__714:
	;
__710:
	;
	goto __708
__708:
	if 0 != 0 {
		goto __707
	}
	goto __709
__709:
	;
	goto __703
__703:
	if 0 != 0 {
		goto __702
	}
	goto __704
__704:
	;
	return TCL_OK
__272:
	;
	goto __58

__75:

	if !(allowEmpty != 0) {
		goto __717
	}
__719:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __722
	}
	XTclExpandCodeArray(tls, envPtr)
__722:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __723
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__723:
	;
__724:
	_delta41 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta41 != 0) {
		goto __727
	}
	if !(_delta41 == -0x7fffffff-1) {
		goto __728
	}
	_delta41 = 1 - 0
__728:
	;
__729:
	if !(_delta41 < 0) {
		goto __732
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __733
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__733:
	;
__732:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta41
	goto __730
__730:
	if 0 != 0 {
		goto __729
	}
	goto __731
__731:
	;
__727:
	;
	goto __725
__725:
	if 0 != 0 {
		goto __724
	}
	goto __726
__726:
	;
	goto __720
__720:
	if 0 != 0 {
		goto __719
	}
	goto __721
__721:
	;
__734:
	_objIndexCopy9 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy9 <= 255) {
		goto __737
	}
__739:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __742
	}
	XTclExpandCodeArray(tls, envPtr)
__742:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy9))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __743
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__743:
	;
__744:
	_delta42 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta42 != 0) {
		goto __747
	}
	if !(_delta42 == -0x7fffffff-1) {
		goto __748
	}
	_delta42 = 1 - _objIndexCopy9
__748:
	;
__749:
	if !(_delta42 < 0) {
		goto __752
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __753
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__753:
	;
__752:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta42
	goto __750
__750:
	if 0 != 0 {
		goto __749
	}
	goto __751
__751:
	;
__747:
	;
	goto __745
__745:
	if 0 != 0 {
		goto __744
	}
	goto __746
__746:
	;
	goto __740
__740:
	if 0 != 0 {
		goto __739
	}
	goto __741
__741:
	;
	goto __738
__737:
__754:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __757
	}
	XTclExpandCodeArray(tls, envPtr)
__757:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy9) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy9) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy9) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy9))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __758
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__758:
	;
__759:
	_delta43 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta43 != 0) {
		goto __762
	}
	if !(_delta43 == -0x7fffffff-1) {
		goto __763
	}
	_delta43 = 1 - _objIndexCopy9
__763:
	;
__764:
	if !(_delta43 < 0) {
		goto __767
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __768
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__768:
	;
__767:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta43
	goto __765
__765:
	if 0 != 0 {
		goto __764
	}
	goto __766
__766:
	;
__762:
	;
	goto __760
__760:
	if 0 != 0 {
		goto __759
	}
	goto __761
__761:
	;
	goto __755
__755:
	if 0 != 0 {
		goto __754
	}
	goto __756
__756:
	;
__738:
	;
	goto __735
__735:
	if 0 != 0 {
		goto __734
	}
	goto __736
__736:
	;
__769:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __772
	}
	XTclExpandCodeArray(tls, envPtr)
__772:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __773
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_EQ == INST_START_CMD {
			return 1
		}
		return 0
	}()
__773:
	;
__774:
	_delta44 = XtclInstructionTable[INST_STR_EQ].FstackEffect
	if !(_delta44 != 0) {
		goto __777
	}
	if !(_delta44 == -0x7fffffff-1) {
		goto __778
	}
	_delta44 = 1 - 0
__778:
	;
__779:
	if !(_delta44 < 0) {
		goto __782
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __783
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__783:
	;
__782:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta44
	goto __780
__780:
	if 0 != 0 {
		goto __779
	}
	goto __781
__781:
	;
__777:
	;
	goto __775
__775:
	if 0 != 0 {
		goto __774
	}
	goto __776
__776:
	;
	goto __770
__770:
	if 0 != 0 {
		goto __769
	}
	goto __771
__771:
	;
	isEmpty = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__784:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __787
	}
	XTclExpandCodeArray(tls, envPtr)
__787:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __788
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__788:
	;
__789:
	_delta45 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta45 != 0) {
		goto __792
	}
	if !(_delta45 == -0x7fffffff-1) {
		goto __793
	}
	_delta45 = 1 - 0
__793:
	;
__794:
	if !(_delta45 < 0) {
		goto __797
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __798
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__798:
	;
__797:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta45
	goto __795
__795:
	if 0 != 0 {
		goto __794
	}
	goto __796
__796:
	;
__792:
	;
	goto __790
__790:
	if 0 != 0 {
		goto __789
	}
	goto __791
__791:
	;
	goto __785
__785:
	if 0 != 0 {
		goto __784
	}
	goto __786
__786:
	;
__799:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __802
	}
	XTclExpandCodeArray(tls, envPtr)
__802:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_NUM_TYPE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __803
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_NUM_TYPE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__803:
	;
__804:
	_delta46 = XtclInstructionTable[INST_NUM_TYPE].FstackEffect
	if !(_delta46 != 0) {
		goto __807
	}
	if !(_delta46 == -0x7fffffff-1) {
		goto __808
	}
	_delta46 = 1 - 0
__808:
	;
__809:
	if !(_delta46 < 0) {
		goto __812
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __813
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__813:
	;
__812:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta46
	goto __810
__810:
	if 0 != 0 {
		goto __809
	}
	goto __811
__811:
	;
__807:
	;
	goto __805
__805:
	if 0 != 0 {
		goto __804
	}
	goto __806
__806:
	;
	goto __800
__800:
	if 0 != 0 {
		goto __799
	}
	goto __801
__801:
	;
	satisfied = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__814:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __817
	}
	XTclExpandCodeArray(tls, envPtr)
__817:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __818
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__818:
	;
__819:
	_delta47 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta47 != 0) {
		goto __822
	}
	if !(_delta47 == -0x7fffffff-1) {
		goto __823
	}
	_delta47 = 1 - 0
__823:
	;
__824:
	if !(_delta47 < 0) {
		goto __827
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __828
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__828:
	;
__827:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta47
	goto __825
__825:
	if 0 != 0 {
		goto __824
	}
	goto __826
__826:
	;
__822:
	;
	goto __820
__820:
	if 0 != 0 {
		goto __819
	}
	goto __821
__821:
	;
	goto __815
__815:
	if 0 != 0 {
		goto __814
	}
	goto __816
__816:
	;
__829:
	_objIndexCopy10 = XTclRegisterLiteral(tls, envPtr, ts+18333, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy10 <= 255) {
		goto __832
	}
__834:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __837
	}
	XTclExpandCodeArray(tls, envPtr)
__837:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy10))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __838
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__838:
	;
__839:
	_delta48 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta48 != 0) {
		goto __842
	}
	if !(_delta48 == -0x7fffffff-1) {
		goto __843
	}
	_delta48 = 1 - _objIndexCopy10
__843:
	;
__844:
	if !(_delta48 < 0) {
		goto __847
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __848
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__848:
	;
__847:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta48
	goto __845
__845:
	if 0 != 0 {
		goto __844
	}
	goto __846
__846:
	;
__842:
	;
	goto __840
__840:
	if 0 != 0 {
		goto __839
	}
	goto __841
__841:
	;
	goto __835
__835:
	if 0 != 0 {
		goto __834
	}
	goto __836
__836:
	;
	goto __833
__832:
__849:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __852
	}
	XTclExpandCodeArray(tls, envPtr)
__852:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy10) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy10) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy10) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy10))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __853
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__853:
	;
__854:
	_delta49 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta49 != 0) {
		goto __857
	}
	if !(_delta49 == -0x7fffffff-1) {
		goto __858
	}
	_delta49 = 1 - _objIndexCopy10
__858:
	;
__859:
	if !(_delta49 < 0) {
		goto __862
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __863
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__863:
	;
__862:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta49
	goto __860
__860:
	if 0 != 0 {
		goto __859
	}
	goto __861
__861:
	;
__857:
	;
	goto __855
__855:
	if 0 != 0 {
		goto __854
	}
	goto __856
__856:
	;
	goto __850
__850:
	if 0 != 0 {
		goto __849
	}
	goto __851
__851:
	;
__833:
	;
	goto __830
__830:
	if 0 != 0 {
		goto __829
	}
	goto __831
__831:
	;
	end = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__864:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __867
	}
	XTclExpandCodeArray(tls, envPtr)
__867:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __868
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__868:
	;
__869:
	_delta50 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta50 != 0) {
		goto __872
	}
	if !(_delta50 == -0x7fffffff-1) {
		goto __873
	}
	_delta50 = 1 - 0
__873:
	;
__874:
	if !(_delta50 < 0) {
		goto __877
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __878
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__878:
	;
__877:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta50
	goto __875
__875:
	if 0 != 0 {
		goto __874
	}
	goto __876
__876:
	;
__872:
	;
	goto __870
__870:
	if 0 != 0 {
		goto __869
	}
	goto __871
__871:
	;
	goto __865
__865:
	if 0 != 0 {
		goto __864
	}
	goto __866
__866:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(isEmpty) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(isEmpty)))
__879:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __882
	}
	XTclExpandCodeArray(tls, envPtr)
__882:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __883
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__883:
	;
__884:
	_delta51 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta51 != 0) {
		goto __887
	}
	if !(_delta51 == -0x7fffffff-1) {
		goto __888
	}
	_delta51 = 1 - 0
__888:
	;
__889:
	if !(_delta51 < 0) {
		goto __892
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __893
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__893:
	;
__892:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta51
	goto __890
__890:
	if 0 != 0 {
		goto __889
	}
	goto __891
__891:
	;
__887:
	;
	goto __885
__885:
	if 0 != 0 {
		goto __884
	}
	goto __886
__886:
	;
	goto __880
__880:
	if 0 != 0 {
		goto __879
	}
	goto __881
__881:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(satisfied) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(satisfied)))
	goto __718
__717:
__894:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __897
	}
	XTclExpandCodeArray(tls, envPtr)
__897:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_NUM_TYPE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __898
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_NUM_TYPE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__898:
	;
__899:
	_delta52 = XtclInstructionTable[INST_NUM_TYPE].FstackEffect
	if !(_delta52 != 0) {
		goto __902
	}
	if !(_delta52 == -0x7fffffff-1) {
		goto __903
	}
	_delta52 = 1 - 0
__903:
	;
__904:
	if !(_delta52 < 0) {
		goto __907
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __908
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__908:
	;
__907:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta52
	goto __905
__905:
	if 0 != 0 {
		goto __904
	}
	goto __906
__906:
	;
__902:
	;
	goto __900
__900:
	if 0 != 0 {
		goto __899
	}
	goto __901
__901:
	;
	goto __895
__895:
	if 0 != 0 {
		goto __894
	}
	goto __896
__896:
	;
	satisfied = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__909:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __912
	}
	XTclExpandCodeArray(tls, envPtr)
__912:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __913
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__913:
	;
__914:
	_delta53 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta53 != 0) {
		goto __917
	}
	if !(_delta53 == -0x7fffffff-1) {
		goto __918
	}
	_delta53 = 1 - 0
__918:
	;
__919:
	if !(_delta53 < 0) {
		goto __922
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __923
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__923:
	;
__922:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta53
	goto __920
__920:
	if 0 != 0 {
		goto __919
	}
	goto __921
__921:
	;
__917:
	;
	goto __915
__915:
	if 0 != 0 {
		goto __914
	}
	goto __916
__916:
	;
	goto __910
__910:
	if 0 != 0 {
		goto __909
	}
	goto __911
__911:
	;
__924:
	_objIndexCopy11 = XTclRegisterLiteral(tls, envPtr, ts+18333, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy11 <= 255) {
		goto __927
	}
__929:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __932
	}
	XTclExpandCodeArray(tls, envPtr)
__932:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy11))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __933
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__933:
	;
__934:
	_delta54 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta54 != 0) {
		goto __937
	}
	if !(_delta54 == -0x7fffffff-1) {
		goto __938
	}
	_delta54 = 1 - _objIndexCopy11
__938:
	;
__939:
	if !(_delta54 < 0) {
		goto __942
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __943
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__943:
	;
__942:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta54
	goto __940
__940:
	if 0 != 0 {
		goto __939
	}
	goto __941
__941:
	;
__937:
	;
	goto __935
__935:
	if 0 != 0 {
		goto __934
	}
	goto __936
__936:
	;
	goto __930
__930:
	if 0 != 0 {
		goto __929
	}
	goto __931
__931:
	;
	goto __928
__927:
__944:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __947
	}
	XTclExpandCodeArray(tls, envPtr)
__947:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy11) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy11) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy11) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy11))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __948
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__948:
	;
__949:
	_delta55 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta55 != 0) {
		goto __952
	}
	if !(_delta55 == -0x7fffffff-1) {
		goto __953
	}
	_delta55 = 1 - _objIndexCopy11
__953:
	;
__954:
	if !(_delta55 < 0) {
		goto __957
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __958
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__958:
	;
__957:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta55
	goto __955
__955:
	if 0 != 0 {
		goto __954
	}
	goto __956
__956:
	;
__952:
	;
	goto __950
__950:
	if 0 != 0 {
		goto __949
	}
	goto __951
__951:
	;
	goto __945
__945:
	if 0 != 0 {
		goto __944
	}
	goto __946
__946:
	;
__928:
	;
	goto __925
__925:
	if 0 != 0 {
		goto __924
	}
	goto __926
__926:
	;
	end = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__959:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __962
	}
	XTclExpandCodeArray(tls, envPtr)
__962:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __963
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__963:
	;
__964:
	_delta56 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta56 != 0) {
		goto __967
	}
	if !(_delta56 == -0x7fffffff-1) {
		goto __968
	}
	_delta56 = 1 - 0
__968:
	;
__969:
	if !(_delta56 < 0) {
		goto __972
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __973
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__973:
	;
__972:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta56
	goto __970
__970:
	if 0 != 0 {
		goto __969
	}
	goto __971
__971:
	;
__967:
	;
	goto __965
__965:
	if 0 != 0 {
		goto __964
	}
	goto __966
__966:
	;
	goto __960
__960:
	if 0 != 0 {
		goto __959
	}
	goto __961
__961:
	;
__974:
	if !(-1 < 0) {
		goto __977
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __978
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__978:
	;
__977:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	goto __975
__975:
	if 0 != 0 {
		goto __974
	}
	goto __976
__976:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(satisfied) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(satisfied)))
__718:
	;
__979:
	_objIndexCopy12 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy12 <= 255) {
		goto __982
	}
__984:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __987
	}
	XTclExpandCodeArray(tls, envPtr)
__987:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy12))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __988
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__988:
	;
__989:
	_delta57 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta57 != 0) {
		goto __992
	}
	if !(_delta57 == -0x7fffffff-1) {
		goto __993
	}
	_delta57 = 1 - _objIndexCopy12
__993:
	;
__994:
	if !(_delta57 < 0) {
		goto __997
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __998
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__998:
	;
__997:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta57
	goto __995
__995:
	if 0 != 0 {
		goto __994
	}
	goto __996
__996:
	;
__992:
	;
	goto __990
__990:
	if 0 != 0 {
		goto __989
	}
	goto __991
__991:
	;
	goto __985
__985:
	if 0 != 0 {
		goto __984
	}
	goto __986
__986:
	;
	goto __983
__982:
__999:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1002
	}
	XTclExpandCodeArray(tls, envPtr)
__1002:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy12) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy12) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy12) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy12))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1003
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1003:
	;
__1004:
	_delta58 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta58 != 0) {
		goto __1007
	}
	if !(_delta58 == -0x7fffffff-1) {
		goto __1008
	}
	_delta58 = 1 - _objIndexCopy12
__1008:
	;
__1009:
	if !(_delta58 < 0) {
		goto __1012
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1013
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1013:
	;
__1012:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta58
	goto __1010
__1010:
	if 0 != 0 {
		goto __1009
	}
	goto __1011
__1011:
	;
__1007:
	;
	goto __1005
__1005:
	if 0 != 0 {
		goto __1004
	}
	goto __1006
__1006:
	;
	goto __1000
__1000:
	if 0 != 0 {
		goto __999
	}
	goto __1001
__1001:
	;
__983:
	;
	goto __980
__980:
	if 0 != 0 {
		goto __979
	}
	goto __981
__981:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(end) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(end)))
	return TCL_OK

__76:
__77:
__78:
	if !(allowEmpty != 0) {
		goto __1014
	}

__1016:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1019
	}
	XTclExpandCodeArray(tls, envPtr)
__1019:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1020
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1020:
	;
__1021:
	_delta59 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta59 != 0) {
		goto __1024
	}
	if !(_delta59 == -0x7fffffff-1) {
		goto __1025
	}
	_delta59 = 1 - 0
__1025:
	;
__1026:
	if !(_delta59 < 0) {
		goto __1029
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1030
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1030:
	;
__1029:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta59
	goto __1027
__1027:
	if 0 != 0 {
		goto __1026
	}
	goto __1028
__1028:
	;
__1024:
	;
	goto __1022
__1022:
	if 0 != 0 {
		goto __1021
	}
	goto __1023
__1023:
	;
	goto __1017
__1017:
	if 0 != 0 {
		goto __1016
	}
	goto __1018
__1018:
	;
__1031:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1034
	}
	XTclExpandCodeArray(tls, envPtr)
__1034:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_NUM_TYPE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1035
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_NUM_TYPE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1035:
	;
__1036:
	_delta60 = XtclInstructionTable[INST_NUM_TYPE].FstackEffect
	if !(_delta60 != 0) {
		goto __1039
	}
	if !(_delta60 == -0x7fffffff-1) {
		goto __1040
	}
	_delta60 = 1 - 0
__1040:
	;
__1041:
	if !(_delta60 < 0) {
		goto __1044
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1045
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1045:
	;
__1044:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta60
	goto __1042
__1042:
	if 0 != 0 {
		goto __1041
	}
	goto __1043
__1043:
	;
__1039:
	;
	goto __1037
__1037:
	if 0 != 0 {
		goto __1036
	}
	goto __1038
__1038:
	;
	goto __1032
__1032:
	if 0 != 0 {
		goto __1031
	}
	goto __1033
__1033:
	;
__1046:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1049
	}
	XTclExpandCodeArray(tls, envPtr)
__1049:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1050
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1050:
	;
__1051:
	_delta61 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta61 != 0) {
		goto __1054
	}
	if !(_delta61 == -0x7fffffff-1) {
		goto __1055
	}
	_delta61 = 1 - 0
__1055:
	;
__1056:
	if !(_delta61 < 0) {
		goto __1059
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1060
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1060:
	;
__1059:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta61
	goto __1057
__1057:
	if 0 != 0 {
		goto __1056
	}
	goto __1058
__1058:
	;
__1054:
	;
	goto __1052
__1052:
	if 0 != 0 {
		goto __1051
	}
	goto __1053
__1053:
	;
	goto __1047
__1047:
	if 0 != 0 {
		goto __1046
	}
	goto __1048
__1048:
	;
	testNumType = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1061:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1064
	}
	XTclExpandCodeArray(tls, envPtr)
__1064:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1065
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1065:
	;
__1066:
	_delta62 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta62 != 0) {
		goto __1069
	}
	if !(_delta62 == -0x7fffffff-1) {
		goto __1070
	}
	_delta62 = 1 - 0
__1070:
	;
__1071:
	if !(_delta62 < 0) {
		goto __1074
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1075
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1075:
	;
__1074:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta62
	goto __1072
__1072:
	if 0 != 0 {
		goto __1071
	}
	goto __1073
__1073:
	;
__1069:
	;
	goto __1067
__1067:
	if 0 != 0 {
		goto __1066
	}
	goto __1068
__1068:
	;
	goto __1062
__1062:
	if 0 != 0 {
		goto __1061
	}
	goto __1063
__1063:
	;
__1076:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1079
	}
	XTclExpandCodeArray(tls, envPtr)
__1079:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1080
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1080:
	;
__1081:
	_delta63 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta63 != 0) {
		goto __1084
	}
	if !(_delta63 == -0x7fffffff-1) {
		goto __1085
	}
	_delta63 = 1 - 0
__1085:
	;
__1086:
	if !(_delta63 < 0) {
		goto __1089
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1090
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1090:
	;
__1089:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta63
	goto __1087
__1087:
	if 0 != 0 {
		goto __1086
	}
	goto __1088
__1088:
	;
__1084:
	;
	goto __1082
__1082:
	if 0 != 0 {
		goto __1081
	}
	goto __1083
__1083:
	;
	goto __1077
__1077:
	if 0 != 0 {
		goto __1076
	}
	goto __1078
__1078:
	;
__1091:
	_objIndexCopy13 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy13 <= 255) {
		goto __1094
	}
__1096:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1099
	}
	XTclExpandCodeArray(tls, envPtr)
__1099:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy13))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1100
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1100:
	;
__1101:
	_delta64 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta64 != 0) {
		goto __1104
	}
	if !(_delta64 == -0x7fffffff-1) {
		goto __1105
	}
	_delta64 = 1 - _objIndexCopy13
__1105:
	;
__1106:
	if !(_delta64 < 0) {
		goto __1109
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1110
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1110:
	;
__1109:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta64
	goto __1107
__1107:
	if 0 != 0 {
		goto __1106
	}
	goto __1108
__1108:
	;
__1104:
	;
	goto __1102
__1102:
	if 0 != 0 {
		goto __1101
	}
	goto __1103
__1103:
	;
	goto __1097
__1097:
	if 0 != 0 {
		goto __1096
	}
	goto __1098
__1098:
	;
	goto __1095
__1094:
__1111:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1114
	}
	XTclExpandCodeArray(tls, envPtr)
__1114:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy13) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy13) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy13) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy13))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1115
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1115:
	;
__1116:
	_delta65 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta65 != 0) {
		goto __1119
	}
	if !(_delta65 == -0x7fffffff-1) {
		goto __1120
	}
	_delta65 = 1 - _objIndexCopy13
__1120:
	;
__1121:
	if !(_delta65 < 0) {
		goto __1124
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1125
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1125:
	;
__1124:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta65
	goto __1122
__1122:
	if 0 != 0 {
		goto __1121
	}
	goto __1123
__1123:
	;
__1119:
	;
	goto __1117
__1117:
	if 0 != 0 {
		goto __1116
	}
	goto __1118
__1118:
	;
	goto __1112
__1112:
	if 0 != 0 {
		goto __1111
	}
	goto __1113
__1113:
	;
__1095:
	;
	goto __1092
__1092:
	if 0 != 0 {
		goto __1091
	}
	goto __1093
__1093:
	;
__1126:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1129
	}
	XTclExpandCodeArray(tls, envPtr)
__1129:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1130
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_EQ == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1130:
	;
__1131:
	_delta66 = XtclInstructionTable[INST_STR_EQ].FstackEffect
	if !(_delta66 != 0) {
		goto __1134
	}
	if !(_delta66 == -0x7fffffff-1) {
		goto __1135
	}
	_delta66 = 1 - 0
__1135:
	;
__1136:
	if !(_delta66 < 0) {
		goto __1139
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1140
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1140:
	;
__1139:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta66
	goto __1137
__1137:
	if 0 != 0 {
		goto __1136
	}
	goto __1138
__1138:
	;
__1134:
	;
	goto __1132
__1132:
	if 0 != 0 {
		goto __1131
	}
	goto __1133
__1133:
	;
	goto __1127
__1127:
	if 0 != 0 {
		goto __1126
	}
	goto __1128
__1128:
	;
	end = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1141:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1144
	}
	XTclExpandCodeArray(tls, envPtr)
__1144:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1145
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1145:
	;
__1146:
	_delta67 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta67 != 0) {
		goto __1149
	}
	if !(_delta67 == -0x7fffffff-1) {
		goto __1150
	}
	_delta67 = 1 - 0
__1150:
	;
__1151:
	if !(_delta67 < 0) {
		goto __1154
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1155
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1155:
	;
__1154:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta67
	goto __1152
__1152:
	if 0 != 0 {
		goto __1151
	}
	goto __1153
__1153:
	;
__1149:
	;
	goto __1147
__1147:
	if 0 != 0 {
		goto __1146
	}
	goto __1148
__1148:
	;
	goto __1142
__1142:
	if 0 != 0 {
		goto __1141
	}
	goto __1143
__1143:
	;
__1156:
	if !(1 < 0) {
		goto __1159
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1160
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1160:
	;
__1159:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
	goto __1157
__1157:
	if 0 != 0 {
		goto __1156
	}
	goto __1158
__1158:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(testNumType) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(testNumType)))
__1161:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1164
	}
	XTclExpandCodeArray(tls, envPtr)
__1164:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1165
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1165:
	;
__1166:
	_delta68 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta68 != 0) {
		goto __1169
	}
	if !(_delta68 == -0x7fffffff-1) {
		goto __1170
	}
	_delta68 = 1 - 2
__1170:
	;
__1171:
	if !(_delta68 < 0) {
		goto __1174
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1175
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1175:
	;
__1174:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta68
	goto __1172
__1172:
	if 0 != 0 {
		goto __1171
	}
	goto __1173
__1173:
	;
__1169:
	;
	goto __1167
__1167:
	if 0 != 0 {
		goto __1166
	}
	goto __1168
__1168:
	;
	goto __1162
__1162:
	if 0 != 0 {
		goto __1161
	}
	goto __1163
__1163:
	;
__1176:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1179
	}
	XTclExpandCodeArray(tls, envPtr)
__1179:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1180
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1180:
	;
__1181:
	_delta69 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta69 != 0) {
		goto __1184
	}
	if !(_delta69 == -0x7fffffff-1) {
		goto __1185
	}
	_delta69 = 1 - 0
__1185:
	;
__1186:
	if !(_delta69 < 0) {
		goto __1189
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1190
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1190:
	;
__1189:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta69
	goto __1187
__1187:
	if 0 != 0 {
		goto __1186
	}
	goto __1188
__1188:
	;
__1184:
	;
	goto __1182
__1182:
	if 0 != 0 {
		goto __1181
	}
	goto __1183
__1183:
	;
	goto __1177
__1177:
	if 0 != 0 {
		goto __1176
	}
	goto __1178
__1178:
	;
	goto __1015
__1014:
__1191:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1194
	}
	XTclExpandCodeArray(tls, envPtr)
__1194:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_NUM_TYPE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1195
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_NUM_TYPE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1195:
	;
__1196:
	_delta70 = XtclInstructionTable[INST_NUM_TYPE].FstackEffect
	if !(_delta70 != 0) {
		goto __1199
	}
	if !(_delta70 == -0x7fffffff-1) {
		goto __1200
	}
	_delta70 = 1 - 0
__1200:
	;
__1201:
	if !(_delta70 < 0) {
		goto __1204
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1205
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1205:
	;
__1204:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta70
	goto __1202
__1202:
	if 0 != 0 {
		goto __1201
	}
	goto __1203
__1203:
	;
__1199:
	;
	goto __1197
__1197:
	if 0 != 0 {
		goto __1196
	}
	goto __1198
__1198:
	;
	goto __1192
__1192:
	if 0 != 0 {
		goto __1191
	}
	goto __1193
__1193:
	;
__1206:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1209
	}
	XTclExpandCodeArray(tls, envPtr)
__1209:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1210
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1210:
	;
__1211:
	_delta71 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta71 != 0) {
		goto __1214
	}
	if !(_delta71 == -0x7fffffff-1) {
		goto __1215
	}
	_delta71 = 1 - 0
__1215:
	;
__1216:
	if !(_delta71 < 0) {
		goto __1219
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1220
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1220:
	;
__1219:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta71
	goto __1217
__1217:
	if 0 != 0 {
		goto __1216
	}
	goto __1218
__1218:
	;
__1214:
	;
	goto __1212
__1212:
	if 0 != 0 {
		goto __1211
	}
	goto __1213
__1213:
	;
	goto __1207
__1207:
	if 0 != 0 {
		goto __1206
	}
	goto __1208
__1208:
	;
	end = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1221:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1224
	}
	XTclExpandCodeArray(tls, envPtr)
__1224:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1225
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_FALSE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1225:
	;
__1226:
	_delta72 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
	if !(_delta72 != 0) {
		goto __1229
	}
	if !(_delta72 == -0x7fffffff-1) {
		goto __1230
	}
	_delta72 = 1 - 0
__1230:
	;
__1231:
	if !(_delta72 < 0) {
		goto __1234
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1235
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1235:
	;
__1234:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta72
	goto __1232
__1232:
	if 0 != 0 {
		goto __1231
	}
	goto __1233
__1233:
	;
__1229:
	;
	goto __1227
__1227:
	if 0 != 0 {
		goto __1226
	}
	goto __1228
__1228:
	;
	goto __1222
__1222:
	if 0 != 0 {
		goto __1221
	}
	goto __1223
__1223:
	;
__1015:
	;

	switch *(*int32)(unsafe.Pointer(bp /* t */)) {
	case 10 /* STR_IS_INT */ :
		goto __1237
	case 18 /* STR_IS_WIDE */ :
		goto __1238
	case 7 /* STR_IS_ENTIER */ :
		goto __1239
	}
	goto __1236
__1237:
__1240:
	_objIndexCopy14 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy14 <= 255) {
		goto __1243
	}
__1245:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1248
	}
	XTclExpandCodeArray(tls, envPtr)
__1248:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy14))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1249
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1249:
	;
__1250:
	_delta73 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta73 != 0) {
		goto __1253
	}
	if !(_delta73 == -0x7fffffff-1) {
		goto __1254
	}
	_delta73 = 1 - _objIndexCopy14
__1254:
	;
__1255:
	if !(_delta73 < 0) {
		goto __1258
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1259
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1259:
	;
__1258:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta73
	goto __1256
__1256:
	if 0 != 0 {
		goto __1255
	}
	goto __1257
__1257:
	;
__1253:
	;
	goto __1251
__1251:
	if 0 != 0 {
		goto __1250
	}
	goto __1252
__1252:
	;
	goto __1246
__1246:
	if 0 != 0 {
		goto __1245
	}
	goto __1247
__1247:
	;
	goto __1244
__1243:
__1260:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1263
	}
	XTclExpandCodeArray(tls, envPtr)
__1263:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy14) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy14) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy14) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy14))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1264
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1264:
	;
__1265:
	_delta74 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta74 != 0) {
		goto __1268
	}
	if !(_delta74 == -0x7fffffff-1) {
		goto __1269
	}
	_delta74 = 1 - _objIndexCopy14
__1269:
	;
__1270:
	if !(_delta74 < 0) {
		goto __1273
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1274
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1274:
	;
__1273:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta74
	goto __1271
__1271:
	if 0 != 0 {
		goto __1270
	}
	goto __1272
__1272:
	;
__1268:
	;
	goto __1266
__1266:
	if 0 != 0 {
		goto __1265
	}
	goto __1267
__1267:
	;
	goto __1261
__1261:
	if 0 != 0 {
		goto __1260
	}
	goto __1262
__1262:
	;
__1244:
	;
	goto __1241
__1241:
	if 0 != 0 {
		goto __1240
	}
	goto __1242
__1242:
	;
__1275:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1278
	}
	XTclExpandCodeArray(tls, envPtr)
__1278:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EQ)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1279
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_EQ == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1279:
	;
__1280:
	_delta75 = XtclInstructionTable[INST_EQ].FstackEffect
	if !(_delta75 != 0) {
		goto __1283
	}
	if !(_delta75 == -0x7fffffff-1) {
		goto __1284
	}
	_delta75 = 1 - 0
__1284:
	;
__1285:
	if !(_delta75 < 0) {
		goto __1288
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1289
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1289:
	;
__1288:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta75
	goto __1286
__1286:
	if 0 != 0 {
		goto __1285
	}
	goto __1287
__1287:
	;
__1283:
	;
	goto __1281
__1281:
	if 0 != 0 {
		goto __1280
	}
	goto __1282
__1282:
	;
	goto __1276
__1276:
	if 0 != 0 {
		goto __1275
	}
	goto __1277
__1277:
	;
	goto __1236
__1238:
__1290:
	_objIndexCopy15 = XTclRegisterLiteral(tls, envPtr, ts+18766, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy15 <= 255) {
		goto __1293
	}
__1295:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1298
	}
	XTclExpandCodeArray(tls, envPtr)
__1298:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy15))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1299
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1299:
	;
__1300:
	_delta76 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta76 != 0) {
		goto __1303
	}
	if !(_delta76 == -0x7fffffff-1) {
		goto __1304
	}
	_delta76 = 1 - _objIndexCopy15
__1304:
	;
__1305:
	if !(_delta76 < 0) {
		goto __1308
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1309
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1309:
	;
__1308:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta76
	goto __1306
__1306:
	if 0 != 0 {
		goto __1305
	}
	goto __1307
__1307:
	;
__1303:
	;
	goto __1301
__1301:
	if 0 != 0 {
		goto __1300
	}
	goto __1302
__1302:
	;
	goto __1296
__1296:
	if 0 != 0 {
		goto __1295
	}
	goto __1297
__1297:
	;
	goto __1294
__1293:
__1310:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1313
	}
	XTclExpandCodeArray(tls, envPtr)
__1313:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy15) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy15) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy15) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy15))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1314
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1314:
	;
__1315:
	_delta77 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta77 != 0) {
		goto __1318
	}
	if !(_delta77 == -0x7fffffff-1) {
		goto __1319
	}
	_delta77 = 1 - _objIndexCopy15
__1319:
	;
__1320:
	if !(_delta77 < 0) {
		goto __1323
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1324
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1324:
	;
__1323:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta77
	goto __1321
__1321:
	if 0 != 0 {
		goto __1320
	}
	goto __1322
__1322:
	;
__1318:
	;
	goto __1316
__1316:
	if 0 != 0 {
		goto __1315
	}
	goto __1317
__1317:
	;
	goto __1311
__1311:
	if 0 != 0 {
		goto __1310
	}
	goto __1312
__1312:
	;
__1294:
	;
	goto __1291
__1291:
	if 0 != 0 {
		goto __1290
	}
	goto __1292
__1292:
	;
__1325:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1328
	}
	XTclExpandCodeArray(tls, envPtr)
__1328:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1329
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1329:
	;
__1330:
	_delta78 = XtclInstructionTable[INST_LE].FstackEffect
	if !(_delta78 != 0) {
		goto __1333
	}
	if !(_delta78 == -0x7fffffff-1) {
		goto __1334
	}
	_delta78 = 1 - 0
__1334:
	;
__1335:
	if !(_delta78 < 0) {
		goto __1338
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1339
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1339:
	;
__1338:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta78
	goto __1336
__1336:
	if 0 != 0 {
		goto __1335
	}
	goto __1337
__1337:
	;
__1333:
	;
	goto __1331
__1331:
	if 0 != 0 {
		goto __1330
	}
	goto __1332
__1332:
	;
	goto __1326
__1326:
	if 0 != 0 {
		goto __1325
	}
	goto __1327
__1327:
	;
	goto __1236
__1239:
__1340:
	_objIndexCopy16 = XTclRegisterLiteral(tls, envPtr, ts+18805, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy16 <= 255) {
		goto __1343
	}
__1345:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1348
	}
	XTclExpandCodeArray(tls, envPtr)
__1348:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy16))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1349
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1349:
	;
__1350:
	_delta79 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta79 != 0) {
		goto __1353
	}
	if !(_delta79 == -0x7fffffff-1) {
		goto __1354
	}
	_delta79 = 1 - _objIndexCopy16
__1354:
	;
__1355:
	if !(_delta79 < 0) {
		goto __1358
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1359
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1359:
	;
__1358:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta79
	goto __1356
__1356:
	if 0 != 0 {
		goto __1355
	}
	goto __1357
__1357:
	;
__1353:
	;
	goto __1351
__1351:
	if 0 != 0 {
		goto __1350
	}
	goto __1352
__1352:
	;
	goto __1346
__1346:
	if 0 != 0 {
		goto __1345
	}
	goto __1347
__1347:
	;
	goto __1344
__1343:
__1360:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1363
	}
	XTclExpandCodeArray(tls, envPtr)
__1363:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy16) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy16) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy16) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy16))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1364
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1364:
	;
__1365:
	_delta80 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta80 != 0) {
		goto __1368
	}
	if !(_delta80 == -0x7fffffff-1) {
		goto __1369
	}
	_delta80 = 1 - _objIndexCopy16
__1369:
	;
__1370:
	if !(_delta80 < 0) {
		goto __1373
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1374
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1374:
	;
__1373:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta80
	goto __1371
__1371:
	if 0 != 0 {
		goto __1370
	}
	goto __1372
__1372:
	;
__1368:
	;
	goto __1366
__1366:
	if 0 != 0 {
		goto __1365
	}
	goto __1367
__1367:
	;
	goto __1361
__1361:
	if 0 != 0 {
		goto __1360
	}
	goto __1362
__1362:
	;
__1344:
	;
	goto __1341
__1341:
	if 0 != 0 {
		goto __1340
	}
	goto __1342
__1342:
	;
__1375:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1378
	}
	XTclExpandCodeArray(tls, envPtr)
__1378:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1379
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1379:
	;
__1380:
	_delta81 = XtclInstructionTable[INST_LE].FstackEffect
	if !(_delta81 != 0) {
		goto __1383
	}
	if !(_delta81 == -0x7fffffff-1) {
		goto __1384
	}
	_delta81 = 1 - 0
__1384:
	;
__1385:
	if !(_delta81 < 0) {
		goto __1388
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1389
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1389:
	;
__1388:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta81
	goto __1386
__1386:
	if 0 != 0 {
		goto __1385
	}
	goto __1387
__1387:
	;
__1383:
	;
	goto __1381
__1381:
	if 0 != 0 {
		goto __1380
	}
	goto __1382
__1382:
	;
	goto __1376
__1376:
	if 0 != 0 {
		goto __1375
	}
	goto __1377
__1377:
	;
	goto __1236
__1236:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(end) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(end)))
	return TCL_OK

__79:
	range1 = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
__1390:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1393
	}
	XTclExpandCodeArray(tls, envPtr)
__1393:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1394
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_BEGIN_CATCH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1394:
	;
__1395:
	_delta82 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
	if !(_delta82 != 0) {
		goto __1398
	}
	if !(_delta82 == -0x7fffffff-1) {
		goto __1399
	}
	_delta82 = 1 - range1
__1399:
	;
__1400:
	if !(_delta82 < 0) {
		goto __1403
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1404
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1404:
	;
__1403:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta82
	goto __1401
__1401:
	if 0 != 0 {
		goto __1400
	}
	goto __1402
__1402:
	;
__1398:
	;
	goto __1396
__1396:
	if 0 != 0 {
		goto __1395
	}
	goto __1397
__1397:
	;
	goto __1391
__1391:
	if 0 != 0 {
		goto __1390
	}
	goto __1392
__1392:
	;
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1405:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1408
	}
	XTclExpandCodeArray(tls, envPtr)
__1408:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1409
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1409:
	;
__1410:
	_delta83 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta83 != 0) {
		goto __1413
	}
	if !(_delta83 == -0x7fffffff-1) {
		goto __1414
	}
	_delta83 = 1 - 0
__1414:
	;
__1415:
	if !(_delta83 < 0) {
		goto __1418
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1419
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1419:
	;
__1418:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta83
	goto __1416
__1416:
	if 0 != 0 {
		goto __1415
	}
	goto __1417
__1417:
	;
__1413:
	;
	goto __1411
__1411:
	if 0 != 0 {
		goto __1410
	}
	goto __1412
__1412:
	;
	goto __1406
__1406:
	if 0 != 0 {
		goto __1405
	}
	goto __1407
__1407:
	;
__1420:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1423
	}
	XTclExpandCodeArray(tls, envPtr)
__1423:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_LENGTH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1424
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST_LENGTH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1424:
	;
__1425:
	_delta84 = XtclInstructionTable[INST_LIST_LENGTH].FstackEffect
	if !(_delta84 != 0) {
		goto __1428
	}
	if !(_delta84 == -0x7fffffff-1) {
		goto __1429
	}
	_delta84 = 1 - 0
__1429:
	;
__1430:
	if !(_delta84 < 0) {
		goto __1433
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1434
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1434:
	;
__1433:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta84
	goto __1431
__1431:
	if 0 != 0 {
		goto __1430
	}
	goto __1432
__1432:
	;
__1428:
	;
	goto __1426
__1426:
	if 0 != 0 {
		goto __1425
	}
	goto __1427
__1427:
	;
	goto __1421
__1421:
	if 0 != 0 {
		goto __1420
	}
	goto __1422
__1422:
	;
__1435:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1438
	}
	XTclExpandCodeArray(tls, envPtr)
__1438:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1439
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1439:
	;
__1440:
	_delta85 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta85 != 0) {
		goto __1443
	}
	if !(_delta85 == -0x7fffffff-1) {
		goto __1444
	}
	_delta85 = 1 - 0
__1444:
	;
__1445:
	if !(_delta85 < 0) {
		goto __1448
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1449
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1449:
	;
__1448:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta85
	goto __1446
__1446:
	if 0 != 0 {
		goto __1445
	}
	goto __1447
__1447:
	;
__1443:
	;
	goto __1441
__1441:
	if 0 != 0 {
		goto __1440
	}
	goto __1442
__1442:
	;
	goto __1436
__1436:
	if 0 != 0 {
		goto __1435
	}
	goto __1437
__1437:
	;
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1450:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1453
	}
	XTclExpandCodeArray(tls, envPtr)
__1453:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1454
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1454:
	;
__1455:
	_delta86 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta86 != 0) {
		goto __1458
	}
	if !(_delta86 == -0x7fffffff-1) {
		goto __1459
	}
	_delta86 = 1 - 0
__1459:
	;
__1460:
	if !(_delta86 < 0) {
		goto __1463
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1464
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1464:
	;
__1463:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta86
	goto __1461
__1461:
	if 0 != 0 {
		goto __1460
	}
	goto __1462
__1462:
	;
__1458:
	;
	goto __1456
__1456:
	if 0 != 0 {
		goto __1455
	}
	goto __1457
__1457:
	;
	goto __1451
__1451:
	if 0 != 0 {
		goto __1450
	}
	goto __1452
__1452:
	;
__1465:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1468
	}
	XTclExpandCodeArray(tls, envPtr)
__1468:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_CODE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1469
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RETURN_CODE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1469:
	;
__1470:
	_delta87 = XtclInstructionTable[INST_PUSH_RETURN_CODE].FstackEffect
	if !(_delta87 != 0) {
		goto __1473
	}
	if !(_delta87 == -0x7fffffff-1) {
		goto __1474
	}
	_delta87 = 1 - 0
__1474:
	;
__1475:
	if !(_delta87 < 0) {
		goto __1478
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1479
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1479:
	;
__1478:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta87
	goto __1476
__1476:
	if 0 != 0 {
		goto __1475
	}
	goto __1477
__1477:
	;
__1473:
	;
	goto __1471
__1471:
	if 0 != 0 {
		goto __1470
	}
	goto __1472
__1472:
	;
	goto __1466
__1466:
	if 0 != 0 {
		goto __1465
	}
	goto __1467
__1467:
	;
__1480:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1483
	}
	XTclExpandCodeArray(tls, envPtr)
__1483:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1484
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_END_CATCH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1484:
	;
__1485:
	_delta88 = XtclInstructionTable[INST_END_CATCH].FstackEffect
	if !(_delta88 != 0) {
		goto __1488
	}
	if !(_delta88 == -0x7fffffff-1) {
		goto __1489
	}
	_delta88 = 1 - 0
__1489:
	;
__1490:
	if !(_delta88 < 0) {
		goto __1493
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1494
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1494:
	;
__1493:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta88
	goto __1491
__1491:
	if 0 != 0 {
		goto __1490
	}
	goto __1492
__1492:
	;
__1488:
	;
	goto __1486
__1486:
	if 0 != 0 {
		goto __1485
	}
	goto __1487
__1487:
	;
	goto __1481
__1481:
	if 0 != 0 {
		goto __1480
	}
	goto __1482
__1482:
	;
__1495:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1498
	}
	XTclExpandCodeArray(tls, envPtr)
__1498:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LNOT)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1499
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LNOT == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1499:
	;
__1500:
	_delta89 = XtclInstructionTable[INST_LNOT].FstackEffect
	if !(_delta89 != 0) {
		goto __1503
	}
	if !(_delta89 == -0x7fffffff-1) {
		goto __1504
	}
	_delta89 = 1 - 0
__1504:
	;
__1505:
	if !(_delta89 < 0) {
		goto __1508
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1509
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1509:
	;
__1508:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta89
	goto __1506
__1506:
	if 0 != 0 {
		goto __1505
	}
	goto __1507
__1507:
	;
__1503:
	;
	goto __1501
__1501:
	if 0 != 0 {
		goto __1500
	}
	goto __1502
__1502:
	;
	goto __1496
__1496:
	if 0 != 0 {
		goto __1495
	}
	goto __1497
__1497:
	;
	return TCL_OK
__58:
	;

	return XTclCompileBasicMin0ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
}

var isClasses1 = [22]uintptr{
	ts + 1183, ts + 1189, ts + 1195, ts + 16101,
	ts + 3541, ts + 1213, ts + 5570, ts + 5577,
	ts + 16109, ts + 1219, ts + 5676, ts + 2810,
	ts + 1225, ts + 1231, ts + 1237, ts + 622,
	ts + 16115, ts + 1243, ts + 16120, ts + 16132,
	ts + 1249, uintptr(0),
} /* tclCompCmdsSZ.c:462:23 */

func XTclCompileStringMatchCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:731:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var i int32
	var length int32
	var exactMatch int32 = 0
	var nocase int32 = 0
	var str uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 4 {
		return TCL_ERROR
	}
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	// Check if we have a -nocase flag.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 4 {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
			return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
		}
		str = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart
		length = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fsize
		if length <= 1 || libc.Xstrncmp(tls, str, ts+14955, uint64(length)) != 0 {
			// Fail at run time, not in compilation.

			return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
		}
		nocase = 1
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}

	// Push the strings to match against each other.

	for i = 0; i < 2; i++ {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			str = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart
			length = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fsize
			if !(nocase != 0) && i == 0 {
				// Trivial matches can be done by 'string equal'. If -nocase
				// was specified, we can't do this because INST_STR_EQ has no
				// support for nocase.

				var copy uintptr = XTcl_NewStringObj(tls, str, length)

				(*Tcl_Obj)(unsafe.Pointer(copy)).FrefCount++
				exactMatch = libc.Bool32(libc.Xstrpbrk(tls, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(copy)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(copy)).Fbytes
					}
					return XTcl_GetString(tls, copy)
				}(), ts+13556) == uintptr(0))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(copy)).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer(copy)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(copy)).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer(copy)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(copy)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(copy)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer(copy)).Flength = -1
						for ok := true; ok; ok = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, copy)
							} else {
								*(*uintptr)(unsafe.Pointer(copy + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = copy
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, copy)
					}
				}

			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, str, length, 0)
				if _objIndexCopy <= 255 {
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok3 := true; ok3; ok3 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok4 := true; ok4; ok4 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok5 := true; ok5; ok5 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok6 := true; ok6; ok6 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok7 := true; ok7; ok7 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i+1+nocase)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i+1+nocase)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)

		}
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}

	// Push the matcher.

	if exactMatch != 0 {
		for ok8 := true; ok8; ok8 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_EQ == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok9 := true; ok9; ok9 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_EQ].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok10 := true; ok10; ok10 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok11 := true; ok11; ok11 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_MATCH)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(nocase))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_MATCH == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok12 := true; ok12; ok12 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_MATCH].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - nocase
					}
					for ok13 := true; ok13; ok13 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileStringLenCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:812:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr
	var objPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	if XTclWordKnownAtCompileTime(tls, tokenPtr, objPtr) != 0 {
		// Here someone is asking for the length of a static string (or
		// something with backslashes). Just push the actual character (not
		// byte) length.

		// var buf [24]int8 at bp+8, 24

		var len int32 = XTcl_GetCharLength(tls, objPtr)

		len = libc.Xsprintf(tls, bp+8, ts+324, libc.VaList(bp, len))
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, bp+8, len, 0)
			if _objIndexCopy <= 255 {
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok3 := true; ok3; ok3 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok4 := true; ok4; ok4 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok5 := true; ok5; ok5 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok6 := true; ok6; ok6 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok7 := true; ok7; ok7 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)

		for ok8 := true; ok8; ok8 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_LEN)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_LEN == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok9 := true; ok9; ok9 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_LEN].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok10 := true; ok10; ok10 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, objPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, objPtr)
		}
	}

	return TCL_OK
}

func XTclCompileStringMapCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:852:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var mapTokenPtr uintptr
	var stringTokenPtr uintptr
	var mapObj uintptr
	// var objv uintptr at bp+8, 8

	var bytes uintptr
	// var len int32 at bp, 4

	// We only handle the case:
	//
	//    string map {foo bar} $thing
	//
	// That is, a literal two-element list (doesn't need to be brace-quoted,
	// but does need to be compile-time knowable) and any old argument (the
	// thing to map).

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}
	mapTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	stringTokenPtr = mapTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(mapTokenPtr)).FnumComponents+1)*24
	mapObj = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(mapObj)).FrefCount++
	if !(XTclWordKnownAtCompileTime(tls, mapTokenPtr, mapObj) != 0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = mapObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	} else if XTcl_ListObjGetElements(tls, uintptr(0), mapObj, bp, bp+8) != TCL_OK {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = mapObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	} else if *(*int32)(unsafe.Pointer(bp)) != 2 {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = mapObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	// Now issue the opcodes. Note that in the case that we know that the
	// first word is an empty word, we don't issue the map at all. That is the
	// correct semantics for mapping.

	bytes = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* objv */)))), bp)
	if *(*int32)(unsafe.Pointer(bp)) == 0 {
		if (*Tcl_Token)(unsafe.Pointer(stringTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok7 := true; ok7; ok7 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok8 := true; ok8; ok8 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok9 := true; ok9; ok9 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
			XTclCompileTokens(tls, interp, stringTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents, envPtr)
		}

	} else {
		for ok10 := true; ok10; ok10 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp)), 0)
			if _objIndexCopy <= 255 {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok14 := true; ok14; ok14 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok15 := true; ok15; ok15 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok16 := true; ok16; ok16 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		bytes = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* objv */)) + 1*8)), bp)
		for ok17 := true; ok17; ok17 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp)), 0)
			if _objIndexCopy <= 255 {
				for ok18 := true; ok18; ok18 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok20 := true; ok20; ok20 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok21 := true; ok21; ok21 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok22 := true; ok22; ok22 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok23 := true; ok23; ok23 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		if (*Tcl_Token)(unsafe.Pointer(stringTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok24 := true; ok24; ok24 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok25 := true; ok25; ok25 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok26 := true; ok26; ok26 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok27 := true; ok27; ok27 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok28 := true; ok28; ok28 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok29 := true; ok29; ok29 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok30 := true; ok30; ok30 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
			XTclCompileTokens(tls, interp, stringTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents, envPtr)
		}

		for ok31 := true; ok31; ok31 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_MAP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_MAP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok32 := true; ok32; ok32 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_MAP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok33 := true; ok33; ok33 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	for ok34 := true; ok34; ok34 = 0 != 0 {
		var _objPtr uintptr = mapObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return TCL_OK
}

func XTclCompileStringRangeCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:915:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var stringTokenPtr uintptr
	var fromTokenPtr uintptr
	var toTokenPtr uintptr
	// var idx1 int32 at bp, 4

	// var idx2 int32 at bp+4, 4

	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _delta4 int32
	var _objIndexCopy1 int32
	var _delta5 int32
	var _delta6 int32
	var _delta7 int32
	var _objIndexCopy2 int32
	var _delta8 int32
	var _delta9 int32
	var _delta10 int32
	var _objIndexCopy3 int32
	var _delta11 int32
	var _delta12 int32
	var _objIndexCopy4 int32
	var _delta13 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 4) {
		goto __1
	}
	return TCL_ERROR
__1:
	;
	stringTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	fromTokenPtr = stringTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents+1)*24
	toTokenPtr = fromTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(fromTokenPtr)).FnumComponents+1)*24

	// Every path must push the string argument
	if !((*Tcl_Token)(unsafe.Pointer(stringTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __2
	}
__4:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __7
	}
__9:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __12
	}
	XTclExpandCodeArray(tls, envPtr)
__12:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __13
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__13:
	;
__14:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __17
	}
	if !(_delta == -0x7fffffff-1) {
		goto __18
	}
	_delta = 1 - _objIndexCopy
__18:
	;
__19:
	if !(_delta < 0) {
		goto __22
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __23
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__23:
	;
__22:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
__17:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	goto __10
__10:
	if 0 != 0 {
		goto __9
	}
	goto __11
__11:
	;
	goto __8
__7:
__24:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __27
	}
	XTclExpandCodeArray(tls, envPtr)
__27:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __28
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__28:
	;
__29:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __32
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __33
	}
	_delta1 = 1 - _objIndexCopy
__33:
	;
__34:
	if !(_delta1 < 0) {
		goto __37
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __38
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__38:
	;
__37:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __35
__35:
	if 0 != 0 {
		goto __34
	}
	goto __36
__36:
	;
__32:
	;
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
__8:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;
	goto __3
__2:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclCompileTokens(tls, interp, stringTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents, envPtr)
__3:
	;

	// Parse the two indices.

	if !(XTclGetIndexFromToken(tls, fromTokenPtr, 0, 0x7fffffff,
		bp) != TCL_OK) {
		goto __39
	}
	goto nonConstantIndices
__39:
	;
	// Token parsed as an index expression. We treat all indices before
	// the string the same as the start of the string.

	if !(*(*int32)(unsafe.Pointer(bp)) == 0x7fffffff) {
		goto __40
	}
	// [string range $s end+1 $last] must be empty string
__41:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __44
	}
	XTclExpandCodeArray(tls, envPtr)
__44:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __45
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__45:
	;
__46:
	_delta2 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta2 != 0) {
		goto __49
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __50
	}
	_delta2 = 1 - 0
__50:
	;
__51:
	if !(_delta2 < 0) {
		goto __54
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __55
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__55:
	;
__54:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __52
__52:
	if 0 != 0 {
		goto __51
	}
	goto __53
__53:
	;
__49:
	;
	goto __47
__47:
	if 0 != 0 {
		goto __46
	}
	goto __48
__48:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
__56:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy1 <= 255) {
		goto __59
	}
__61:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __64
	}
	XTclExpandCodeArray(tls, envPtr)
__64:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __65
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__65:
	;
__66:
	_delta3 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta3 != 0) {
		goto __69
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __70
	}
	_delta3 = 1 - _objIndexCopy1
__70:
	;
__71:
	if !(_delta3 < 0) {
		goto __74
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __75
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__75:
	;
__74:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __72
__72:
	if 0 != 0 {
		goto __71
	}
	goto __73
__73:
	;
__69:
	;
	goto __67
__67:
	if 0 != 0 {
		goto __66
	}
	goto __68
__68:
	;
	goto __62
__62:
	if 0 != 0 {
		goto __61
	}
	goto __63
__63:
	;
	goto __60
__59:
__76:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __79
	}
	XTclExpandCodeArray(tls, envPtr)
__79:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __80
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__80:
	;
__81:
	_delta4 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta4 != 0) {
		goto __84
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __85
	}
	_delta4 = 1 - _objIndexCopy1
__85:
	;
__86:
	if !(_delta4 < 0) {
		goto __89
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __90
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__90:
	;
__89:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __87
__87:
	if 0 != 0 {
		goto __86
	}
	goto __88
__88:
	;
__84:
	;
	goto __82
__82:
	if 0 != 0 {
		goto __81
	}
	goto __83
__83:
	;
	goto __77
__77:
	if 0 != 0 {
		goto __76
	}
	goto __78
__78:
	;
__60:
	;
	goto __57
__57:
	if 0 != 0 {
		goto __56
	}
	goto __58
__58:
	;
	return TCL_OK
__40:
	;

	if !(XTclGetIndexFromToken(tls, toTokenPtr, -1, -2,
		bp+4) != TCL_OK) {
		goto __91
	}
	goto nonConstantIndices
__91:
	;
	// Token parsed as an index expression. We treat all indices after
	// the string the same as the end of the string.
	if !(*(*int32)(unsafe.Pointer(bp + 4)) == -1) {
		goto __92
	}
	// [string range $s $first -1] must be empty string
__93:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __96
	}
	XTclExpandCodeArray(tls, envPtr)
__96:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __97
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__97:
	;
__98:
	_delta5 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta5 != 0) {
		goto __101
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __102
	}
	_delta5 = 1 - 0
__102:
	;
__103:
	if !(_delta5 < 0) {
		goto __106
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __107
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__107:
	;
__106:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __104
__104:
	if 0 != 0 {
		goto __103
	}
	goto __105
__105:
	;
__101:
	;
	goto __99
__99:
	if 0 != 0 {
		goto __98
	}
	goto __100
__100:
	;
	goto __94
__94:
	if 0 != 0 {
		goto __93
	}
	goto __95
__95:
	;
__108:
	_objIndexCopy2 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy2 <= 255) {
		goto __111
	}
__113:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __116
	}
	XTclExpandCodeArray(tls, envPtr)
__116:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __117
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__117:
	;
__118:
	_delta6 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta6 != 0) {
		goto __121
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __122
	}
	_delta6 = 1 - _objIndexCopy2
__122:
	;
__123:
	if !(_delta6 < 0) {
		goto __126
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __127
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__127:
	;
__126:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __124
__124:
	if 0 != 0 {
		goto __123
	}
	goto __125
__125:
	;
__121:
	;
	goto __119
__119:
	if 0 != 0 {
		goto __118
	}
	goto __120
__120:
	;
	goto __114
__114:
	if 0 != 0 {
		goto __113
	}
	goto __115
__115:
	;
	goto __112
__111:
__128:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __131
	}
	XTclExpandCodeArray(tls, envPtr)
__131:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __132
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__132:
	;
__133:
	_delta7 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta7 != 0) {
		goto __136
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __137
	}
	_delta7 = 1 - _objIndexCopy2
__137:
	;
__138:
	if !(_delta7 < 0) {
		goto __141
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __142
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__142:
	;
__141:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __139
__139:
	if 0 != 0 {
		goto __138
	}
	goto __140
__140:
	;
__136:
	;
	goto __134
__134:
	if 0 != 0 {
		goto __133
	}
	goto __135
__135:
	;
	goto __129
__129:
	if 0 != 0 {
		goto __128
	}
	goto __130
__130:
	;
__112:
	;
	goto __109
__109:
	if 0 != 0 {
		goto __108
	}
	goto __110
__110:
	;
	return TCL_OK
__92:
	;

	// Push the operand onto the stack and then the substring operation.

__143:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __146
	}
	XTclExpandCodeArray(tls, envPtr)
__146:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_RANGE_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __147
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_RANGE_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__147:
	;
__148:
	_delta8 = XtclInstructionTable[INST_STR_RANGE_IMM].FstackEffect
	if !(_delta8 != 0) {
		goto __151
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __152
	}
	_delta8 = 1 - *(*int32)(unsafe.Pointer(bp))
__152:
	;
__153:
	if !(_delta8 < 0) {
		goto __156
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __157
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__157:
	;
__156:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __154
__154:
	if 0 != 0 {
		goto __153
	}
	goto __155
__155:
	;
__151:
	;
	goto __149
__149:
	if 0 != 0 {
		goto __148
	}
	goto __150
__150:
	;
	goto __144
__144:
	if 0 != 0 {
		goto __143
	}
	goto __145
__145:
	;
__158:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __161
	}
	XTclExpandCodeArray(tls, envPtr)
__161:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))))
	goto __159
__159:
	if 0 != 0 {
		goto __158
	}
	goto __160
__160:
	;
	return TCL_OK

	// Push the operands onto the stack and then the substring operation.

nonConstantIndices:
	if !((*Tcl_Token)(unsafe.Pointer(fromTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __162
	}
__164:
	_objIndexCopy3 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(fromTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(fromTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy3 <= 255) {
		goto __167
	}
__169:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __172
	}
	XTclExpandCodeArray(tls, envPtr)
__172:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __173
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__173:
	;
__174:
	_delta9 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta9 != 0) {
		goto __177
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __178
	}
	_delta9 = 1 - _objIndexCopy3
__178:
	;
__179:
	if !(_delta9 < 0) {
		goto __182
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __183
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__183:
	;
__182:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __180
__180:
	if 0 != 0 {
		goto __179
	}
	goto __181
__181:
	;
__177:
	;
	goto __175
__175:
	if 0 != 0 {
		goto __174
	}
	goto __176
__176:
	;
	goto __170
__170:
	if 0 != 0 {
		goto __169
	}
	goto __171
__171:
	;
	goto __168
__167:
__184:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __187
	}
	XTclExpandCodeArray(tls, envPtr)
__187:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __188
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__188:
	;
__189:
	_delta10 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta10 != 0) {
		goto __192
	}
	if !(_delta10 == -0x7fffffff-1) {
		goto __193
	}
	_delta10 = 1 - _objIndexCopy3
__193:
	;
__194:
	if !(_delta10 < 0) {
		goto __197
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __198
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__198:
	;
__197:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta10
	goto __195
__195:
	if 0 != 0 {
		goto __194
	}
	goto __196
__196:
	;
__192:
	;
	goto __190
__190:
	if 0 != 0 {
		goto __189
	}
	goto __191
__191:
	;
	goto __185
__185:
	if 0 != 0 {
		goto __184
	}
	goto __186
__186:
	;
__168:
	;
	goto __165
__165:
	if 0 != 0 {
		goto __164
	}
	goto __166
__166:
	;
	goto __163
__162:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
	XTclCompileTokens(tls, interp, fromTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(fromTokenPtr)).FnumComponents, envPtr)
__163:
	;

	if !((*Tcl_Token)(unsafe.Pointer(toTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __199
	}
__201:
	_objIndexCopy4 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(toTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(toTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy4 <= 255) {
		goto __204
	}
__206:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __209
	}
	XTclExpandCodeArray(tls, envPtr)
__209:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __210
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__210:
	;
__211:
	_delta11 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta11 != 0) {
		goto __214
	}
	if !(_delta11 == -0x7fffffff-1) {
		goto __215
	}
	_delta11 = 1 - _objIndexCopy4
__215:
	;
__216:
	if !(_delta11 < 0) {
		goto __219
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __220
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__220:
	;
__219:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta11
	goto __217
__217:
	if 0 != 0 {
		goto __216
	}
	goto __218
__218:
	;
__214:
	;
	goto __212
__212:
	if 0 != 0 {
		goto __211
	}
	goto __213
__213:
	;
	goto __207
__207:
	if 0 != 0 {
		goto __206
	}
	goto __208
__208:
	;
	goto __205
__204:
__221:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __224
	}
	XTclExpandCodeArray(tls, envPtr)
__224:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __225
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__225:
	;
__226:
	_delta12 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta12 != 0) {
		goto __229
	}
	if !(_delta12 == -0x7fffffff-1) {
		goto __230
	}
	_delta12 = 1 - _objIndexCopy4
__230:
	;
__231:
	if !(_delta12 < 0) {
		goto __234
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __235
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__235:
	;
__234:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta12
	goto __232
__232:
	if 0 != 0 {
		goto __231
	}
	goto __233
__233:
	;
__229:
	;
	goto __227
__227:
	if 0 != 0 {
		goto __226
	}
	goto __228
__228:
	;
	goto __222
__222:
	if 0 != 0 {
		goto __221
	}
	goto __223
__223:
	;
__205:
	;
	goto __202
__202:
	if 0 != 0 {
		goto __201
	}
	goto __203
__203:
	;
	goto __200
__199:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 3*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 3*8))
	XTclCompileTokens(tls, interp, toTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(toTokenPtr)).FnumComponents, envPtr)
__200:
	;

__236:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __239
	}
	XTclExpandCodeArray(tls, envPtr)
__239:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_RANGE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __240
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_RANGE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__240:
	;
__241:
	_delta13 = XtclInstructionTable[INST_STR_RANGE].FstackEffect
	if !(_delta13 != 0) {
		goto __244
	}
	if !(_delta13 == -0x7fffffff-1) {
		goto __245
	}
	_delta13 = 1 - 0
__245:
	;
__246:
	if !(_delta13 < 0) {
		goto __249
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __250
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__250:
	;
__249:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta13
	goto __247
__247:
	if 0 != 0 {
		goto __246
	}
	goto __248
__248:
	;
__244:
	;
	goto __242
__242:
	if 0 != 0 {
		goto __241
	}
	goto __243
__243:
	;
	goto __237
__237:
	if 0 != 0 {
		goto __236
	}
	goto __238
__238:
	;
	return TCL_OK
}

func XTclCompileStringReplaceCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:991:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var tokenPtr uintptr
	var valueTokenPtr uintptr
	// var first int32 at bp, 4

	// var last int32 at bp+4, 4

	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _objIndexCopy1 int32
	var _delta4 int32
	var _delta5 int32
	var _delta6 int32
	var _objIndexCopy2 int32
	var _delta7 int32
	var _delta8 int32
	var _delta9 int32
	var _delta10 int32
	var _delta11 int32
	var _delta12 int32
	var _delta13 int32
	var _objIndexCopy3 int32
	var _delta14 int32
	var _delta15 int32
	var _delta16 int32
	var _delta17 int32
	var _objIndexCopy4 int32
	var _delta18 int32
	var _delta19 int32
	var _delta20 int32
	var _delta21 int32
	var _delta22 int32
	var _delta23 int32
	var _delta24 int32
	var _delta25 int32
	var _delta26 int32
	var _objIndexCopy5 int32
	var _delta27 int32
	var _delta28 int32
	var _objIndexCopy6 int32
	var _delta29 int32
	var _delta30 int32
	var _objIndexCopy7 int32
	var _delta31 int32
	var _delta32 int32
	var _objIndexCopy8 int32
	var _delta33 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 4 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 5) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	// Bytecode to compute/push string argument being replaced
	valueTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __2
	}
__4:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __7
	}
__9:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __12
	}
	XTclExpandCodeArray(tls, envPtr)
__12:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __13
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__13:
	;
__14:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __17
	}
	if !(_delta == -0x7fffffff-1) {
		goto __18
	}
	_delta = 1 - _objIndexCopy
__18:
	;
__19:
	if !(_delta < 0) {
		goto __22
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __23
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__23:
	;
__22:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
__17:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	goto __10
__10:
	if 0 != 0 {
		goto __9
	}
	goto __11
__11:
	;
	goto __8
__7:
__24:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __27
	}
	XTclExpandCodeArray(tls, envPtr)
__27:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __28
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__28:
	;
__29:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __32
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __33
	}
	_delta1 = 1 - _objIndexCopy
__33:
	;
__34:
	if !(_delta1 < 0) {
		goto __37
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __38
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__38:
	;
__37:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __35
__35:
	if 0 != 0 {
		goto __34
	}
	goto __36
__36:
	;
__32:
	;
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
__8:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;
	goto __3
__2:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents, envPtr)
__3:
	;

	// Check for first index known and useful at compile time.
	tokenPtr = valueTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+1)*24
	if !(XTclGetIndexFromToken(tls, tokenPtr, -1, 0x7fffffff,
		bp) != TCL_OK) {
		goto __39
	}
	goto genericReplace
__39:
	;

	// Check for last index known and useful at compile time.
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if !(XTclGetIndexFromToken(tls, tokenPtr, -1, 0x7fffffff,
		bp+4) != TCL_OK) {
		goto __40
	}
	goto genericReplace
__40:
	;

	// [string replace] is an odd bird.  For many arguments it is
	// a conventional substring replacer.  However it also goes out
	// of its way to become a no-op for many cases where it would be
	// replacing an empty substring.  Precisely, it is a no-op when
	//
	//		(last < first)		OR
	//		(last < 0)		OR
	//		(end < first)
	//
	// For some compile-time values we can detect these cases, and
	// compile direct to bytecode implementing the no-op.

	if !(*(*int32)(unsafe.Pointer(bp + 4)) == -1 ||
		*(*int32)(unsafe.Pointer(bp)) == 0x7fffffff ||

		*(*int32)(unsafe.Pointer(bp)) <= -2 && *(*int32)(unsafe.Pointer(bp + 4)) <= -2 &&
			*(*int32)(unsafe.Pointer(bp + 4)) < *(*int32)(unsafe.Pointer(bp)) ||

		*(*int32)(unsafe.Pointer(bp)) >= 0 && *(*int32)(unsafe.Pointer(bp + 4)) >= 0 &&
			*(*int32)(unsafe.Pointer(bp + 4)) < *(*int32)(unsafe.Pointer(bp))) {
		goto __41
	} // Know (last < first)
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 5) {
		goto __42
	}
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __43
	}
__45:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy1 <= 255) {
		goto __48
	}
__50:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __53
	}
	XTclExpandCodeArray(tls, envPtr)
__53:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __54
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__54:
	;
__55:
	_delta2 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta2 != 0) {
		goto __58
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __59
	}
	_delta2 = 1 - _objIndexCopy1
__59:
	;
__60:
	if !(_delta2 < 0) {
		goto __63
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __64
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__64:
	;
__63:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __61
__61:
	if 0 != 0 {
		goto __60
	}
	goto __62
__62:
	;
__58:
	;
	goto __56
__56:
	if 0 != 0 {
		goto __55
	}
	goto __57
__57:
	;
	goto __51
__51:
	if 0 != 0 {
		goto __50
	}
	goto __52
__52:
	;
	goto __49
__48:
__65:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __68
	}
	XTclExpandCodeArray(tls, envPtr)
__68:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __69
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__69:
	;
__70:
	_delta3 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta3 != 0) {
		goto __73
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __74
	}
	_delta3 = 1 - _objIndexCopy1
__74:
	;
__75:
	if !(_delta3 < 0) {
		goto __78
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __79
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__79:
	;
__78:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __76
__76:
	if 0 != 0 {
		goto __75
	}
	goto __77
__77:
	;
__73:
	;
	goto __71
__71:
	if 0 != 0 {
		goto __70
	}
	goto __72
__72:
	;
	goto __66
__66:
	if 0 != 0 {
		goto __65
	}
	goto __67
__67:
	;
__49:
	;
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
	goto __44
__43:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 4*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 4*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__44:
	;

__80:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __83
	}
	XTclExpandCodeArray(tls, envPtr)
__83:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __84
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__84:
	;
__85:
	_delta4 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta4 != 0) {
		goto __88
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __89
	}
	_delta4 = 1 - 0
__89:
	;
__90:
	if !(_delta4 < 0) {
		goto __93
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __94
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__94:
	;
__93:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __91
__91:
	if 0 != 0 {
		goto __90
	}
	goto __92
__92:
	;
__88:
	;
	goto __86
__86:
	if 0 != 0 {
		goto __85
	}
	goto __87
__87:
	;
	goto __81
__81:
	if 0 != 0 {
		goto __80
	}
	goto __82
__82:
	; // Pop newString
__42:
	;
	// Original string argument now on TOS as result
	return TCL_OK
__41:
	;

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 5) {
		goto __95
	}
	// When we have a string replacement, we have to take care about
	// not replacing empty substrings that [string replace] promises
	// not to replace
	//
	// The remaining index values might be suitable for conventional
	// string replacement, but only if they cannot possibly meet the
	// conditions described above at runtime. If there's a chance they
	// might, we would have to emit bytecode to check and at that point
	// we're paying more in bytecode execution time than would make
	// things worthwhile. Trouble is we are very limited in
	// how much we can detect that at compile time. After decoding,
	// we need, first:
	//
	//		(first <= end)
	//
	// The encoded indices (first <= TCL_INDEX END) and
	// (first == TCL_INDEX_BEFORE) always meets this condition, but
	// any other encoded first index has some list for which it fails.
	//
	// We also need, second:
	//
	//		(last >= 0)
	//
	// The encoded indices (last >= TCL_INDEX_START) and
	// (last == TCL_INDEX_AFTER) always meet this condition but any
	// other encoded last index has some list for which it fails.
	//
	// Finally we need, third:
	//
	//		(first <= last)
	//
	// Considered in combination with the constraints we already have,
	// we see that we can proceed when (first == TCL_INDEX_BEFORE)
	// or (last == TCL_INDEX_AFTER). These also permit simplification
	// of the prefix|replace|suffix construction. The other constraints,
	// though, interfere with getting a guarantee that first <= last.

	if !(*(*int32)(unsafe.Pointer(bp)) == -1 && *(*int32)(unsafe.Pointer(bp + 4)) >= 0) {
		goto __97
	}
	// empty prefix
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __98
	}
__100:
	_objIndexCopy2 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy2 <= 255) {
		goto __103
	}
__105:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __108
	}
	XTclExpandCodeArray(tls, envPtr)
__108:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __109
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__109:
	;
__110:
	_delta5 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta5 != 0) {
		goto __113
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __114
	}
	_delta5 = 1 - _objIndexCopy2
__114:
	;
__115:
	if !(_delta5 < 0) {
		goto __118
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __119
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__119:
	;
__118:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __116
__116:
	if 0 != 0 {
		goto __115
	}
	goto __117
__117:
	;
__113:
	;
	goto __111
__111:
	if 0 != 0 {
		goto __110
	}
	goto __112
__112:
	;
	goto __106
__106:
	if 0 != 0 {
		goto __105
	}
	goto __107
__107:
	;
	goto __104
__103:
__120:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __123
	}
	XTclExpandCodeArray(tls, envPtr)
__123:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __124
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__124:
	;
__125:
	_delta6 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta6 != 0) {
		goto __128
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __129
	}
	_delta6 = 1 - _objIndexCopy2
__129:
	;
__130:
	if !(_delta6 < 0) {
		goto __133
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __134
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__134:
	;
__133:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __131
__131:
	if 0 != 0 {
		goto __130
	}
	goto __132
__132:
	;
__128:
	;
	goto __126
__126:
	if 0 != 0 {
		goto __125
	}
	goto __127
__127:
	;
	goto __121
__121:
	if 0 != 0 {
		goto __120
	}
	goto __122
__122:
	;
__104:
	;
	goto __101
__101:
	if 0 != 0 {
		goto __100
	}
	goto __102
__102:
	;
	goto __99
__98:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 4*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 4*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__99:
	;

__135:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __138
	}
	XTclExpandCodeArray(tls, envPtr)
__138:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __139
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__139:
	;
__140:
	_delta7 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta7 != 0) {
		goto __143
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __144
	}
	_delta7 = 1 - 2
__144:
	;
__145:
	if !(_delta7 < 0) {
		goto __148
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __149
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__149:
	;
__148:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __146
__146:
	if 0 != 0 {
		goto __145
	}
	goto __147
__147:
	;
__143:
	;
	goto __141
__141:
	if 0 != 0 {
		goto __140
	}
	goto __142
__142:
	;
	goto __136
__136:
	if 0 != 0 {
		goto __135
	}
	goto __137
__137:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 4)) == 0x7fffffff) {
		goto __150
	}
__152:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __155
	}
	XTclExpandCodeArray(tls, envPtr)
__155:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __156
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__156:
	;
__157:
	_delta8 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta8 != 0) {
		goto __160
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __161
	}
	_delta8 = 1 - 0
__161:
	;
__162:
	if !(_delta8 < 0) {
		goto __165
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __166
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__166:
	;
__165:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __163
__163:
	if 0 != 0 {
		goto __162
	}
	goto __164
__164:
	;
__160:
	;
	goto __158
__158:
	if 0 != 0 {
		goto __157
	}
	goto __159
__159:
	;
	goto __153
__153:
	if 0 != 0 {
		goto __152
	}
	goto __154
__154:
	; // Pop  original
	goto __151
__150:
__167:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __170
	}
	XTclExpandCodeArray(tls, envPtr)
__170:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_RANGE_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))+1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))+1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))+1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4)) + 1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __171
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_RANGE_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__171:
	;
__172:
	_delta9 = XtclInstructionTable[INST_STR_RANGE_IMM].FstackEffect
	if !(_delta9 != 0) {
		goto __175
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __176
	}
	_delta9 = 1 - (*(*int32)(unsafe.Pointer(bp + 4)) + 1)
__176:
	;
__177:
	if !(_delta9 < 0) {
		goto __180
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __181
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__181:
	;
__180:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __178
__178:
	if 0 != 0 {
		goto __177
	}
	goto __179
__179:
	;
__175:
	;
	goto __173
__173:
	if 0 != 0 {
		goto __172
	}
	goto __174
__174:
	;
	goto __168
__168:
	if 0 != 0 {
		goto __167
	}
	goto __169
__169:
	;
__182:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __185
	}
	XTclExpandCodeArray(tls, envPtr)
__185:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(libc.Uint32FromInt32(-2))
	goto __183
__183:
	if 0 != 0 {
		goto __182
	}
	goto __184
__184:
	;
__186:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __189
	}
	XTclExpandCodeArray(tls, envPtr)
__189:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __190
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_CONCAT1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__190:
	;
__191:
	_delta10 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
	if !(_delta10 != 0) {
		goto __194
	}
	if !(_delta10 == -0x7fffffff-1) {
		goto __195
	}
	_delta10 = 1 - 2
__195:
	;
__196:
	if !(_delta10 < 0) {
		goto __199
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __200
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__200:
	;
__199:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta10
	goto __197
__197:
	if 0 != 0 {
		goto __196
	}
	goto __198
__198:
	;
__194:
	;
	goto __192
__192:
	if 0 != 0 {
		goto __191
	}
	goto __193
__193:
	;
	goto __187
__187:
	if 0 != 0 {
		goto __186
	}
	goto __188
__188:
	;
__151:
	;
	return TCL_OK
__97:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 4)) == 0x7fffffff && *(*int32)(unsafe.Pointer(bp)) <= -2) {
		goto __201
	}
__202:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __205
	}
	XTclExpandCodeArray(tls, envPtr)
__205:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_RANGE_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __206
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_RANGE_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__206:
	;
__207:
	_delta11 = XtclInstructionTable[INST_STR_RANGE_IMM].FstackEffect
	if !(_delta11 != 0) {
		goto __210
	}
	if !(_delta11 == -0x7fffffff-1) {
		goto __211
	}
	_delta11 = 1 - 0
__211:
	;
__212:
	if !(_delta11 < 0) {
		goto __215
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __216
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__216:
	;
__215:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta11
	goto __213
__213:
	if 0 != 0 {
		goto __212
	}
	goto __214
__214:
	;
__210:
	;
	goto __208
__208:
	if 0 != 0 {
		goto __207
	}
	goto __209
__209:
	;
	goto __203
__203:
	if 0 != 0 {
		goto __202
	}
	goto __204
__204:
	;
__217:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __220
	}
	XTclExpandCodeArray(tls, envPtr)
__220:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp)) - 1))
	goto __218
__218:
	if 0 != 0 {
		goto __217
	}
	goto __219
__219:
	;
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __221
	}
__223:
	_objIndexCopy3 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy3 <= 255) {
		goto __226
	}
__228:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __231
	}
	XTclExpandCodeArray(tls, envPtr)
__231:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __232
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__232:
	;
__233:
	_delta12 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta12 != 0) {
		goto __236
	}
	if !(_delta12 == -0x7fffffff-1) {
		goto __237
	}
	_delta12 = 1 - _objIndexCopy3
__237:
	;
__238:
	if !(_delta12 < 0) {
		goto __241
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __242
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__242:
	;
__241:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta12
	goto __239
__239:
	if 0 != 0 {
		goto __238
	}
	goto __240
__240:
	;
__236:
	;
	goto __234
__234:
	if 0 != 0 {
		goto __233
	}
	goto __235
__235:
	;
	goto __229
__229:
	if 0 != 0 {
		goto __228
	}
	goto __230
__230:
	;
	goto __227
__226:
__243:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __246
	}
	XTclExpandCodeArray(tls, envPtr)
__246:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __247
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__247:
	;
__248:
	_delta13 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta13 != 0) {
		goto __251
	}
	if !(_delta13 == -0x7fffffff-1) {
		goto __252
	}
	_delta13 = 1 - _objIndexCopy3
__252:
	;
__253:
	if !(_delta13 < 0) {
		goto __256
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __257
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__257:
	;
__256:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta13
	goto __254
__254:
	if 0 != 0 {
		goto __253
	}
	goto __255
__255:
	;
__251:
	;
	goto __249
__249:
	if 0 != 0 {
		goto __248
	}
	goto __250
__250:
	;
	goto __244
__244:
	if 0 != 0 {
		goto __243
	}
	goto __245
__245:
	;
__227:
	;
	goto __224
__224:
	if 0 != 0 {
		goto __223
	}
	goto __225
__225:
	;
	goto __222
__221:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 4*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 4*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__222:
	;

__258:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __261
	}
	XTclExpandCodeArray(tls, envPtr)
__261:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __262
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_CONCAT1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__262:
	;
__263:
	_delta14 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
	if !(_delta14 != 0) {
		goto __266
	}
	if !(_delta14 == -0x7fffffff-1) {
		goto __267
	}
	_delta14 = 1 - 2
__267:
	;
__268:
	if !(_delta14 < 0) {
		goto __271
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __272
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__272:
	;
__271:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta14
	goto __269
__269:
	if 0 != 0 {
		goto __268
	}
	goto __270
__270:
	;
__266:
	;
	goto __264
__264:
	if 0 != 0 {
		goto __263
	}
	goto __265
__265:
	;
	goto __259
__259:
	if 0 != 0 {
		goto __258
	}
	goto __260
__260:
	;
	return TCL_OK
__201:
	;

	// FLOW THROUGH TO genericReplace

	goto __96
__95:
	// When we have no replacement string to worry about, we may
	// have more luck, because the forbidden empty string replacements
	// are harmless when they are replaced by another empty string.

	if !(*(*int32)(unsafe.Pointer(bp)) == -1 || *(*int32)(unsafe.Pointer(bp)) == 0) {
		goto __273
	}
	// empty prefix - build suffix only

	if !(*(*int32)(unsafe.Pointer(bp + 4)) == -2 || *(*int32)(unsafe.Pointer(bp + 4)) == 0x7fffffff) {
		goto __275
	}
	// empty suffix too => empty result
__276:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __279
	}
	XTclExpandCodeArray(tls, envPtr)
__279:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __280
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__280:
	;
__281:
	_delta15 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta15 != 0) {
		goto __284
	}
	if !(_delta15 == -0x7fffffff-1) {
		goto __285
	}
	_delta15 = 1 - 0
__285:
	;
__286:
	if !(_delta15 < 0) {
		goto __289
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __290
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__290:
	;
__289:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta15
	goto __287
__287:
	if 0 != 0 {
		goto __286
	}
	goto __288
__288:
	;
__284:
	;
	goto __282
__282:
	if 0 != 0 {
		goto __281
	}
	goto __283
__283:
	;
	goto __277
__277:
	if 0 != 0 {
		goto __276
	}
	goto __278
__278:
	; // Pop  original
__291:
	_objIndexCopy4 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy4 <= 255) {
		goto __294
	}
__296:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __299
	}
	XTclExpandCodeArray(tls, envPtr)
__299:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __300
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__300:
	;
__301:
	_delta16 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta16 != 0) {
		goto __304
	}
	if !(_delta16 == -0x7fffffff-1) {
		goto __305
	}
	_delta16 = 1 - _objIndexCopy4
__305:
	;
__306:
	if !(_delta16 < 0) {
		goto __309
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __310
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__310:
	;
__309:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta16
	goto __307
__307:
	if 0 != 0 {
		goto __306
	}
	goto __308
__308:
	;
__304:
	;
	goto __302
__302:
	if 0 != 0 {
		goto __301
	}
	goto __303
__303:
	;
	goto __297
__297:
	if 0 != 0 {
		goto __296
	}
	goto __298
__298:
	;
	goto __295
__294:
__311:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __314
	}
	XTclExpandCodeArray(tls, envPtr)
__314:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __315
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__315:
	;
__316:
	_delta17 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta17 != 0) {
		goto __319
	}
	if !(_delta17 == -0x7fffffff-1) {
		goto __320
	}
	_delta17 = 1 - _objIndexCopy4
__320:
	;
__321:
	if !(_delta17 < 0) {
		goto __324
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __325
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__325:
	;
__324:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta17
	goto __322
__322:
	if 0 != 0 {
		goto __321
	}
	goto __323
__323:
	;
__319:
	;
	goto __317
__317:
	if 0 != 0 {
		goto __316
	}
	goto __318
__318:
	;
	goto __312
__312:
	if 0 != 0 {
		goto __311
	}
	goto __313
__313:
	;
__295:
	;
	goto __292
__292:
	if 0 != 0 {
		goto __291
	}
	goto __293
__293:
	;
	return TCL_OK
__275:
	;
__326:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __329
	}
	XTclExpandCodeArray(tls, envPtr)
__329:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_RANGE_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))+1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))+1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))+1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4)) + 1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __330
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_RANGE_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__330:
	;
__331:
	_delta18 = XtclInstructionTable[INST_STR_RANGE_IMM].FstackEffect
	if !(_delta18 != 0) {
		goto __334
	}
	if !(_delta18 == -0x7fffffff-1) {
		goto __335
	}
	_delta18 = 1 - (*(*int32)(unsafe.Pointer(bp + 4)) + 1)
__335:
	;
__336:
	if !(_delta18 < 0) {
		goto __339
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __340
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__340:
	;
__339:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta18
	goto __337
__337:
	if 0 != 0 {
		goto __336
	}
	goto __338
__338:
	;
__334:
	;
	goto __332
__332:
	if 0 != 0 {
		goto __331
	}
	goto __333
__333:
	;
	goto __327
__327:
	if 0 != 0 {
		goto __326
	}
	goto __328
__328:
	;
__341:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __344
	}
	XTclExpandCodeArray(tls, envPtr)
__344:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(libc.Uint32FromInt32(-2))
	goto __342
__342:
	if 0 != 0 {
		goto __341
	}
	goto __343
__343:
	;
	return TCL_OK
	goto __274
__273:
	if !(*(*int32)(unsafe.Pointer(bp + 4)) == -2 || *(*int32)(unsafe.Pointer(bp + 4)) == 0x7fffffff) {
		goto __345
	}
	// empty suffix - build prefix only
__346:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __349
	}
	XTclExpandCodeArray(tls, envPtr)
__349:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_RANGE_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __350
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_RANGE_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__350:
	;
__351:
	_delta19 = XtclInstructionTable[INST_STR_RANGE_IMM].FstackEffect
	if !(_delta19 != 0) {
		goto __354
	}
	if !(_delta19 == -0x7fffffff-1) {
		goto __355
	}
	_delta19 = 1 - 0
__355:
	;
__356:
	if !(_delta19 < 0) {
		goto __359
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __360
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__360:
	;
__359:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta19
	goto __357
__357:
	if 0 != 0 {
		goto __356
	}
	goto __358
__358:
	;
__354:
	;
	goto __352
__352:
	if 0 != 0 {
		goto __351
	}
	goto __353
__353:
	;
	goto __347
__347:
	if 0 != 0 {
		goto __346
	}
	goto __348
__348:
	;
__361:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __364
	}
	XTclExpandCodeArray(tls, envPtr)
__364:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp)) - 1))
	goto __362
__362:
	if 0 != 0 {
		goto __361
	}
	goto __363
__363:
	;
	return TCL_OK
__345:
	;
__365:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __368
	}
	XTclExpandCodeArray(tls, envPtr)
__368:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __369
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__369:
	;
__370:
	_delta20 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta20 != 0) {
		goto __373
	}
	if !(_delta20 == -0x7fffffff-1) {
		goto __374
	}
	_delta20 = 1 - 0
__374:
	;
__375:
	if !(_delta20 < 0) {
		goto __378
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __379
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__379:
	;
__378:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta20
	goto __376
__376:
	if 0 != 0 {
		goto __375
	}
	goto __377
__377:
	;
__373:
	;
	goto __371
__371:
	if 0 != 0 {
		goto __370
	}
	goto __372
__372:
	;
	goto __366
__366:
	if 0 != 0 {
		goto __365
	}
	goto __367
__367:
	;
__380:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __383
	}
	XTclExpandCodeArray(tls, envPtr)
__383:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_RANGE_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __384
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_RANGE_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__384:
	;
__385:
	_delta21 = XtclInstructionTable[INST_STR_RANGE_IMM].FstackEffect
	if !(_delta21 != 0) {
		goto __388
	}
	if !(_delta21 == -0x7fffffff-1) {
		goto __389
	}
	_delta21 = 1 - 0
__389:
	;
__390:
	if !(_delta21 < 0) {
		goto __393
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __394
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__394:
	;
__393:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta21
	goto __391
__391:
	if 0 != 0 {
		goto __390
	}
	goto __392
__392:
	;
__388:
	;
	goto __386
__386:
	if 0 != 0 {
		goto __385
	}
	goto __387
__387:
	;
	goto __381
__381:
	if 0 != 0 {
		goto __380
	}
	goto __382
__382:
	;
__395:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __398
	}
	XTclExpandCodeArray(tls, envPtr)
__398:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp))-1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp)) - 1))
	goto __396
__396:
	if 0 != 0 {
		goto __395
	}
	goto __397
__397:
	;
__399:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __402
	}
	XTclExpandCodeArray(tls, envPtr)
__402:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __403
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__403:
	;
__404:
	_delta22 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta22 != 0) {
		goto __407
	}
	if !(_delta22 == -0x7fffffff-1) {
		goto __408
	}
	_delta22 = 1 - 2
__408:
	;
__409:
	if !(_delta22 < 0) {
		goto __412
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __413
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__413:
	;
__412:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta22
	goto __410
__410:
	if 0 != 0 {
		goto __409
	}
	goto __411
__411:
	;
__407:
	;
	goto __405
__405:
	if 0 != 0 {
		goto __404
	}
	goto __406
__406:
	;
	goto __400
__400:
	if 0 != 0 {
		goto __399
	}
	goto __401
__401:
	;
__414:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __417
	}
	XTclExpandCodeArray(tls, envPtr)
__417:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_RANGE_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))+1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))+1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))+1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4)) + 1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __418
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_RANGE_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__418:
	;
__419:
	_delta23 = XtclInstructionTable[INST_STR_RANGE_IMM].FstackEffect
	if !(_delta23 != 0) {
		goto __422
	}
	if !(_delta23 == -0x7fffffff-1) {
		goto __423
	}
	_delta23 = 1 - (*(*int32)(unsafe.Pointer(bp + 4)) + 1)
__423:
	;
__424:
	if !(_delta23 < 0) {
		goto __427
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __428
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__428:
	;
__427:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta23
	goto __425
__425:
	if 0 != 0 {
		goto __424
	}
	goto __426
__426:
	;
__422:
	;
	goto __420
__420:
	if 0 != 0 {
		goto __419
	}
	goto __421
__421:
	;
	goto __415
__415:
	if 0 != 0 {
		goto __414
	}
	goto __416
__416:
	;
__429:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __432
	}
	XTclExpandCodeArray(tls, envPtr)
__432:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(uint32(libc.Uint32(libc.Uint32FromInt32(-2))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = libc.Uint8FromUint32(libc.Uint32FromInt32(-2))
	goto __430
__430:
	if 0 != 0 {
		goto __429
	}
	goto __431
__431:
	;
__433:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __436
	}
	XTclExpandCodeArray(tls, envPtr)
__436:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __437
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_CONCAT1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__437:
	;
__438:
	_delta24 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
	if !(_delta24 != 0) {
		goto __441
	}
	if !(_delta24 == -0x7fffffff-1) {
		goto __442
	}
	_delta24 = 1 - 2
__442:
	;
__443:
	if !(_delta24 < 0) {
		goto __446
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __447
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__447:
	;
__446:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta24
	goto __444
__444:
	if 0 != 0 {
		goto __443
	}
	goto __445
__445:
	;
__441:
	;
	goto __439
__439:
	if 0 != 0 {
		goto __438
	}
	goto __440
__440:
	;
	goto __434
__434:
	if 0 != 0 {
		goto __433
	}
	goto __435
__435:
	;
	return TCL_OK
__274:
	;
__96:
	;

genericReplace:
	tokenPtr = valueTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __448
	}
__450:
	_objIndexCopy5 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy5 <= 255) {
		goto __453
	}
__455:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __458
	}
	XTclExpandCodeArray(tls, envPtr)
__458:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __459
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__459:
	;
__460:
	_delta25 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta25 != 0) {
		goto __463
	}
	if !(_delta25 == -0x7fffffff-1) {
		goto __464
	}
	_delta25 = 1 - _objIndexCopy5
__464:
	;
__465:
	if !(_delta25 < 0) {
		goto __468
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __469
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__469:
	;
__468:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta25
	goto __466
__466:
	if 0 != 0 {
		goto __465
	}
	goto __467
__467:
	;
__463:
	;
	goto __461
__461:
	if 0 != 0 {
		goto __460
	}
	goto __462
__462:
	;
	goto __456
__456:
	if 0 != 0 {
		goto __455
	}
	goto __457
__457:
	;
	goto __454
__453:
__470:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __473
	}
	XTclExpandCodeArray(tls, envPtr)
__473:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __474
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__474:
	;
__475:
	_delta26 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta26 != 0) {
		goto __478
	}
	if !(_delta26 == -0x7fffffff-1) {
		goto __479
	}
	_delta26 = 1 - _objIndexCopy5
__479:
	;
__480:
	if !(_delta26 < 0) {
		goto __483
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __484
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__484:
	;
__483:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta26
	goto __481
__481:
	if 0 != 0 {
		goto __480
	}
	goto __482
__482:
	;
__478:
	;
	goto __476
__476:
	if 0 != 0 {
		goto __475
	}
	goto __477
__477:
	;
	goto __471
__471:
	if 0 != 0 {
		goto __470
	}
	goto __472
__472:
	;
__454:
	;
	goto __451
__451:
	if 0 != 0 {
		goto __450
	}
	goto __452
__452:
	;
	goto __449
__448:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__449:
	;

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __485
	}
__487:
	_objIndexCopy6 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy6 <= 255) {
		goto __490
	}
__492:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __495
	}
	XTclExpandCodeArray(tls, envPtr)
__495:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __496
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__496:
	;
__497:
	_delta27 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta27 != 0) {
		goto __500
	}
	if !(_delta27 == -0x7fffffff-1) {
		goto __501
	}
	_delta27 = 1 - _objIndexCopy6
__501:
	;
__502:
	if !(_delta27 < 0) {
		goto __505
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __506
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__506:
	;
__505:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta27
	goto __503
__503:
	if 0 != 0 {
		goto __502
	}
	goto __504
__504:
	;
__500:
	;
	goto __498
__498:
	if 0 != 0 {
		goto __497
	}
	goto __499
__499:
	;
	goto __493
__493:
	if 0 != 0 {
		goto __492
	}
	goto __494
__494:
	;
	goto __491
__490:
__507:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __510
	}
	XTclExpandCodeArray(tls, envPtr)
__510:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __511
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__511:
	;
__512:
	_delta28 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta28 != 0) {
		goto __515
	}
	if !(_delta28 == -0x7fffffff-1) {
		goto __516
	}
	_delta28 = 1 - _objIndexCopy6
__516:
	;
__517:
	if !(_delta28 < 0) {
		goto __520
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __521
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__521:
	;
__520:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta28
	goto __518
__518:
	if 0 != 0 {
		goto __517
	}
	goto __519
__519:
	;
__515:
	;
	goto __513
__513:
	if 0 != 0 {
		goto __512
	}
	goto __514
__514:
	;
	goto __508
__508:
	if 0 != 0 {
		goto __507
	}
	goto __509
__509:
	;
__491:
	;
	goto __488
__488:
	if 0 != 0 {
		goto __487
	}
	goto __489
__489:
	;
	goto __486
__485:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 3*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 3*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__486:
	;

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 5) {
		goto __522
	}
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __524
	}
__526:
	_objIndexCopy7 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy7 <= 255) {
		goto __529
	}
__531:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __534
	}
	XTclExpandCodeArray(tls, envPtr)
__534:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __535
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__535:
	;
__536:
	_delta29 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta29 != 0) {
		goto __539
	}
	if !(_delta29 == -0x7fffffff-1) {
		goto __540
	}
	_delta29 = 1 - _objIndexCopy7
__540:
	;
__541:
	if !(_delta29 < 0) {
		goto __544
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __545
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__545:
	;
__544:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta29
	goto __542
__542:
	if 0 != 0 {
		goto __541
	}
	goto __543
__543:
	;
__539:
	;
	goto __537
__537:
	if 0 != 0 {
		goto __536
	}
	goto __538
__538:
	;
	goto __532
__532:
	if 0 != 0 {
		goto __531
	}
	goto __533
__533:
	;
	goto __530
__529:
__546:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __549
	}
	XTclExpandCodeArray(tls, envPtr)
__549:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __550
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__550:
	;
__551:
	_delta30 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta30 != 0) {
		goto __554
	}
	if !(_delta30 == -0x7fffffff-1) {
		goto __555
	}
	_delta30 = 1 - _objIndexCopy7
__555:
	;
__556:
	if !(_delta30 < 0) {
		goto __559
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __560
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__560:
	;
__559:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta30
	goto __557
__557:
	if 0 != 0 {
		goto __556
	}
	goto __558
__558:
	;
__554:
	;
	goto __552
__552:
	if 0 != 0 {
		goto __551
	}
	goto __553
__553:
	;
	goto __547
__547:
	if 0 != 0 {
		goto __546
	}
	goto __548
__548:
	;
__530:
	;
	goto __527
__527:
	if 0 != 0 {
		goto __526
	}
	goto __528
__528:
	;
	goto __525
__524:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 4*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 4*8))
	XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
__525:
	;

	goto __523
__522:
__561:
	_objIndexCopy8 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy8 <= 255) {
		goto __564
	}
__566:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __569
	}
	XTclExpandCodeArray(tls, envPtr)
__569:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __570
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__570:
	;
__571:
	_delta31 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta31 != 0) {
		goto __574
	}
	if !(_delta31 == -0x7fffffff-1) {
		goto __575
	}
	_delta31 = 1 - _objIndexCopy8
__575:
	;
__576:
	if !(_delta31 < 0) {
		goto __579
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __580
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__580:
	;
__579:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta31
	goto __577
__577:
	if 0 != 0 {
		goto __576
	}
	goto __578
__578:
	;
__574:
	;
	goto __572
__572:
	if 0 != 0 {
		goto __571
	}
	goto __573
__573:
	;
	goto __567
__567:
	if 0 != 0 {
		goto __566
	}
	goto __568
__568:
	;
	goto __565
__564:
__581:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __584
	}
	XTclExpandCodeArray(tls, envPtr)
__584:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __585
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__585:
	;
__586:
	_delta32 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta32 != 0) {
		goto __589
	}
	if !(_delta32 == -0x7fffffff-1) {
		goto __590
	}
	_delta32 = 1 - _objIndexCopy8
__590:
	;
__591:
	if !(_delta32 < 0) {
		goto __594
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __595
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__595:
	;
__594:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta32
	goto __592
__592:
	if 0 != 0 {
		goto __591
	}
	goto __593
__593:
	;
__589:
	;
	goto __587
__587:
	if 0 != 0 {
		goto __586
	}
	goto __588
__588:
	;
	goto __582
__582:
	if 0 != 0 {
		goto __581
	}
	goto __583
__583:
	;
__565:
	;
	goto __562
__562:
	if 0 != 0 {
		goto __561
	}
	goto __563
__563:
	;
__523:
	;
__596:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __599
	}
	XTclExpandCodeArray(tls, envPtr)
__599:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_REPLACE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __600
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_REPLACE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__600:
	;
__601:
	_delta33 = XtclInstructionTable[INST_STR_REPLACE].FstackEffect
	if !(_delta33 != 0) {
		goto __604
	}
	if !(_delta33 == -0x7fffffff-1) {
		goto __605
	}
	_delta33 = 1 - 0
__605:
	;
__606:
	if !(_delta33 < 0) {
		goto __609
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __610
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__610:
	;
__609:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta33
	goto __607
__607:
	if 0 != 0 {
		goto __606
	}
	goto __608
__608:
	;
__604:
	;
	goto __602
__602:
	if 0 != 0 {
		goto __601
	}
	goto __603
__603:
	;
	goto __597
__597:
	if 0 != 0 {
		goto __596
	}
	goto __598
__598:
	;
	return TCL_OK
}

func XTclCompileStringTrimLCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:1193:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 && (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 3 {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

	} else {
		for ok14 := true; ok14; ok14 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, uintptr(uintptr(unsafe.Pointer(&XtclDefaultTrimSet))), int32(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)))), 0)
			if _objIndexCopy <= 255 {
				for ok15 := true; ok15; ok15 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok17 := true; ok17; ok17 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok18 := true; ok18; ok18 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok20 := true; ok20; ok20 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}
	for ok21 := true; ok21; ok21 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_TRIM_LEFT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_TRIM_LEFT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok22 := true; ok22; ok22 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_TRIM_LEFT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok23 := true; ok23; ok23 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileStringTrimRCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:1221:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 && (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 3 {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

	} else {
		for ok14 := true; ok14; ok14 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, uintptr(uintptr(unsafe.Pointer(&XtclDefaultTrimSet))), int32(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)))), 0)
			if _objIndexCopy <= 255 {
				for ok15 := true; ok15; ok15 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok17 := true; ok17; ok17 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok18 := true; ok18; ok18 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok20 := true; ok20; ok20 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}
	for ok21 := true; ok21; ok21 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_TRIM_RIGHT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_TRIM_RIGHT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok22 := true; ok22; ok22 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_TRIM_RIGHT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok23 := true; ok23; ok23 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileStringTrimCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:1249:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 && (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 3 {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

	} else {
		for ok14 := true; ok14; ok14 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, uintptr(uintptr(unsafe.Pointer(&XtclDefaultTrimSet))), int32(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)))), 0)
			if _objIndexCopy <= 255 {
				for ok15 := true; ok15; ok15 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok17 := true; ok17; ok17 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok18 := true; ok18; ok18 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok20 := true; ok20; ok20 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}
	for ok21 := true; ok21; ok21 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_TRIM)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_TRIM == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok22 := true; ok22; ok22 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_TRIM].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok23 := true; ok23; ok23 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileStringToUpperCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:1277:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return XTclCompileBasic1To3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_UPPER)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_UPPER == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_UPPER].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileStringToLowerCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:1299:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return XTclCompileBasic1To3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_LOWER)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_LOWER == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_LOWER].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileStringToTitleCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:1321:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return XTclCompileBasic1To3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_TITLE)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_STR_TITLE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_STR_TITLE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

// Support definitions for the [string is] compilation.

func sUniCharIsAscii1(tls *libc.TLS, character int32) int32 { /* tclCompCmdsSZ.c:1347:1: */
	return libc.Bool32(character >= 0 && character < 0x80)
}

func sUniCharIsHexDigit1(tls *libc.TLS, character int32) int32 { /* tclCompCmdsSZ.c:1354:1: */
	return libc.Bool32(character >= 0 && character < 0x80 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(character)*2)))&int32(X_ISxdigit) != 0)
}

var XtclStringClassTable = [14]StringClassDesc{
	{Fname: ts + 1183, Fcomparator: 0},
	{Fname: ts + 1189, Fcomparator: 0},
	{Fname: ts + 1195, Fcomparator: 0},
	{Fname: ts + 16101, Fcomparator: 0},
	{Fname: ts + 1213, Fcomparator: 0},
	{Fname: ts + 1219, Fcomparator: 0},
	{Fname: ts + 1225, Fcomparator: 0},
	{Fname: ts + 1231, Fcomparator: 0},
	{Fname: ts + 1237, Fcomparator: 0},
	{Fname: ts + 622, Fcomparator: 0},
	{Fname: ts + 1243, Fcomparator: 0},
	{Fname: ts + 18807, Fcomparator: 0},
	{Fname: ts + 1249, Fcomparator: 0},
	{},
} /* tclCompCmdsSZ.c:1360:23 */

//----------------------------------------------------------------------
//
// TclCompileSubstCmd --
//
//	Procedure called to compile the "subst" command.
//
// Results:
//	Returns TCL_OK for successful compile, or TCL_ERROR to defer
//	evaluation to runtime (either when it is too complex to get the
//	semantics right, or when we know for sure that it is an error but need
//	the error to happen at the right time).
//
// Side effects:
//	Instructions are added to envPtr to execute the "subst" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileSubstCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:1398:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var numArgs int32
	var numOpts int32
	var objc int32
	// var flags int32 at bp, 4

	var objv uintptr
	var wordTokenPtr uintptr
	var code int32
	var cachePtr uintptr
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	numArgs = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 1
	numOpts = numArgs - 1
	*(*int32)(unsafe.Pointer(bp /* flags */)) = TCL_SUBST_ALL
	wordTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	code = TCL_ERROR

	if !(numArgs == 0) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	objv = XTclStackAlloc(tls, interp /*numArgs*/, int32(uint64(numOpts)*uint64(unsafe.Sizeof(uintptr(0)))))

	objc = 0
__2:
	if !(objc < numOpts) {
		goto __4
	}
	*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FrefCount++
	if !!(XTclWordKnownAtCompileTime(tls, wordTokenPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))) != 0) {
		goto __5
	}
	objc++
	goto cleanup
__5:
	;
	wordTokenPtr = wordTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents+1)*24
	goto __3
__3:
	objc++
	goto __2
	goto __4
__4:
	;

	//
	//     if (TclSubstOptions(NULL, numOpts, objv, &flags) == TCL_OK) {
	// 	toSubst = objv[numOpts];
	// 	Tcl_IncrRefCount(toSubst);
	//     }

	// TODO: Figure out expansion to cover WordKnownAtCompileTime
	//	The difficulty is that WKACT makes a copy, and if TclSubstParse
	//	below parses the copy of the original source string, some deep
	//	parts of the compile machinery get upset.  They want all pointers
	//	stored in Tcl_Tokens to point back to the same original string.
	if !((*Tcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __6
	}
	code = XTclSubstOptions(tls, uintptr(0), numOpts, objv, bp)
__6:
	;

cleanup:
__7:
	if !(libc.PreDecInt32(&objc, 1) >= 0) {
		goto __8
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FrefCount, 1) > 1) {
		goto __9
	}
	goto __10
__9:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __11
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != XtclEmptyStringRep) {
		goto __13
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes)
__13:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Flength = -1
__14:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __17
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))
	goto __18
__17:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__18:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	goto __12
__11:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))
__12:
	;
__10:
	;

	goto __7
__8:
	;
	XTclStackFree(tls, interp, objv)
	if !(code != TCL_OK) {
		goto __19
	}
	return TCL_ERROR
__19:
	;

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(numArgs)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(numArgs)*8))
	XTclSubstCompile(tls, interp, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(wordTokenPtr+1*24)).Fsize,
		*(*int32)(unsafe.Pointer(bp /* flags */)), *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(numArgs)*4)), envPtr)

	//    TclDecrRefCount(toSubst);
	return TCL_OK
}

func XTclSubstCompile(tls *libc.TLS, interp uintptr, bytes uintptr, numBytes int32, flags int32, line int32, envPtr uintptr) { /* tclCompCmdsSZ.c:1465:1: */
	bp := tls.Alloc(768)
	defer tls.Free(768)

	var endTokenPtr uintptr
	var tokenPtr uintptr
	var breakOffset int32 = 0
	var count int32 = 0
	*(*int32)(unsafe.Pointer(bp + 648 /* bline */)) = line
	// var parse Tcl_Parse at bp+64, 576

	*(*Tcl_InterpState)(unsafe.Pointer(bp + 640 /* state */)) = uintptr(0)

	XTclSubstParse(tls, interp, bytes, numBytes, flags, bp+64, bp+640)
	if *(*Tcl_InterpState)(unsafe.Pointer(bp + 640)) != uintptr(0) {
		XTcl_ResetResult(tls, interp)
	}

	// Tricky point! If the first token does not result in a *guaranteed* push
	// of a Tcl_Obj on the stack, we must push an empty object. Otherwise it
	// is possible to get to an INST_STR_CONCAT1 or INST_DONE without enough
	// values on the stack, resulting in a crash. Thanks to Joe Mistachkin for
	// identifying a script that could trigger this case.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(bp + 64 /* &parse */)).FtokenPtr
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_TEXT && (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_BS {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		count++
	}

	for endTokenPtr = tokenPtr + uintptr((*Tcl_Parse)(unsafe.Pointer(bp+64)).FnumTokens)*24; tokenPtr < endTokenPtr; tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24 {
		var length int32
		var literal int32
		var catchRange int32
		var breakJump int32
		*(*[3]int8)(unsafe.Pointer(bp + 652 /* buf */)) = *(*[3]int8)(unsafe.Pointer(ts + 18812))
		// var startFixup JumpFixup at bp+656, 16

		// var okFixup JumpFixup at bp+672, 16

		// var returnFixup JumpFixup at bp+688, 16

		// var breakFixup JumpFixup at bp+704, 16

		// var continueFixup JumpFixup at bp+720, 16

		// var otherFixup JumpFixup at bp+736, 16

		// var endFixup JumpFixup at bp+752, 16

		switch (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype {
		case TCL_TOKEN_TEXT:
			literal = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize /*flags*/, 0)
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = literal
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
			XTclAdvanceLines(tls, bp+648, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart,
				(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize))
			count++
			continue
		case TCL_TOKEN_BS:
			length = XTclParseBackslash(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize,
				uintptr(0), bp+652)
			literal = XTclRegisterLiteral(tls, envPtr, bp+652, length /*flags*/, 0)
			for ok14 := true; ok14; ok14 = 0 != 0 {
				var _objIndexCopy int32 = literal
				if _objIndexCopy <= 255 {
					for ok15 := true; ok15; ok15 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok16 := true; ok16; ok16 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok17 := true; ok17; ok17 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok18 := true; ok18; ok18 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok19 := true; ok19; ok19 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok20 := true; ok20; ok20 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
			count++
			continue
		case TCL_TOKEN_VARIABLE:
			// Check for simple variable access; see if we can only generate
			// TCL_OK or TCL_ERROR from the substituted variable read; if so,
			// there is no need to generate elaborate exception-management
			// code. Note that the first component of TCL_TOKEN_VARIABLE is
			// always TCL_TOKEN_TEXT...

			if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents > 1 {
				var i int32
				var foundCommand int32 = 0

				for i = 2; i <= (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents; i++ {
					if (*Tcl_Token)(unsafe.Pointer(tokenPtr+uintptr(i)*24)).Ftype == TCL_TOKEN_COMMAND {
						foundCommand = 1
						break
					}
				}
				if foundCommand != 0 {
					break
				}
			}

			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer(bp + 648 /* bline */))
			XTclCompileVarSubst(tls, interp, tokenPtr, envPtr)
			*(*int32)(unsafe.Pointer(bp + 648 /* bline */)) = (*CompileEnv)(unsafe.Pointer(envPtr)).Fline
			count++
			continue
		}

		for count > 255 {
			for ok21 := true; ok21; ok21 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(255))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STR_CONCAT1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok22 := true; ok22; ok22 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 255
						}
						for ok23 := true; ok23; ok23 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			count = count - 254
		}
		if count > 1 {
			for ok24 := true; ok24; ok24 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(count))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STR_CONCAT1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok25 := true; ok25; ok25 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - count
						}
						for ok26 := true; ok26; ok26 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			count = 1
		}

		if breakOffset == 0 {
			// Jump to the start (jump over the jump to end)
			XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp+656)

			// Jump to the end (all BREAKs land here)
			breakOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
			for ok27 := true; ok27; ok27 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_JUMP4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok28 := true; ok28; ok28 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_JUMP4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok29 := true; ok29; ok29 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}

			// Start
			if XTclFixupForwardJump(tls, envPtr, bp+656, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+656)).FcodeOffset)), 127) != 0 {
				XTcl_Panic(tls, ts+18815,
					libc.VaList(bp, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+656)).FcodeOffset))))
			}
		}

		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer(bp + 648 /* bline */))
		catchRange = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
		for ok30 := true; ok30; ok30 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(catchRange) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(catchRange) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(catchRange) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(catchRange))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_BEGIN_CATCH4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok31 := true; ok31; ok31 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - catchRange
					}
					for ok32 := true; ok32; ok32 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
		(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
				return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
			}
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
		}()
		(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(catchRange)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)

		switch (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype {
		case TCL_TOKEN_COMMAND:
			XTclCompileScript(tls, interp, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr(1), (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize-2,
				envPtr)
			count++
			break
		case TCL_TOKEN_VARIABLE:
			XTclCompileVarSubst(tls, interp, tokenPtr, envPtr)
			count++
			break
		default:
			XTcl_Panic(tls, ts+18862,
				libc.VaList(bp+8, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype))
		}

		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
		(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(catchRange)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(catchRange)*28)).FcodeOffset))

		// Substitution produced TCL_OK
		for ok33 := true; ok33; ok33 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_END_CATCH == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok34 := true; ok34; ok34 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok35 := true; ok35; ok35 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp+672)
		for ok36 := true; ok36; ok36 = 0 != 0 {
			if -1 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
		}

		// Exceptional return codes processed here
		(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(catchRange)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
		for ok37 := true; ok37; ok37 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok38 := true; ok38; ok38 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok39 := true; ok39; ok39 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok40 := true; ok40; ok40 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_PUSH_RESULT == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok41 := true; ok41; ok41 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok42 := true; ok42; ok42 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok43 := true; ok43; ok43 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_CODE)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_PUSH_RETURN_CODE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok44 := true; ok44; ok44 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_CODE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok45 := true; ok45; ok45 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok46 := true; ok46; ok46 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_END_CATCH == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok47 := true; ok47; ok47 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok48 := true; ok48; ok48 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok49 := true; ok49; ok49 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_RETURN_CODE_BRANCH)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_RETURN_CODE_BRANCH == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok50 := true; ok50; ok50 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_RETURN_CODE_BRANCH].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok51 := true; ok51; ok51 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}

		// ERROR -> reraise it; NB: can't require BREAK/CONTINUE handling
		for ok52 := true; ok52; ok52 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_RETURN_STK)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_RETURN_STK == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok53 := true; ok53; ok53 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_RETURN_STK].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok54 := true; ok54; ok54 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok55 := true; ok55; ok55 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_NOP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_NOP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok56 := true; ok56; ok56 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_NOP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok57 := true; ok57; ok57 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}

		// RETURN
		XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp+688)

		// BREAK
		XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp+704)

		// CONTINUE
		XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp+720)

		// OTHER
		XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp+736)

		for ok58 := true; ok58; ok58 = 0 != 0 {
			if 1 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
		}
		// BREAK destination
		if XTclFixupForwardJump(tls, envPtr, bp+704, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+704)).FcodeOffset)), 127) != 0 {
			XTcl_Panic(tls, ts+18910,
				libc.VaList(bp+16, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+704)).FcodeOffset))))
		}
		for ok59 := true; ok59; ok59 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok60 := true; ok60; ok60 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok61 := true; ok61; ok61 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok62 := true; ok62; ok62 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok63 := true; ok63; ok63 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok64 := true; ok64; ok64 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}

		breakJump = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(breakOffset))
		if breakJump > 127 {
			for ok65 := true; ok65; ok65 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-breakJump) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-breakJump) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-breakJump) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-breakJump))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_JUMP4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok66 := true; ok66; ok66 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_JUMP4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - -breakJump
						}
						for ok67 := true; ok67; ok67 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok68 := true; ok68; ok68 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-breakJump))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_JUMP1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok69 := true; ok69; ok69 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_JUMP1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - -breakJump
						}
						for ok70 := true; ok70; ok70 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

		for ok71 := true; ok71; ok71 = 0 != 0 {
			if 2 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += 2
		}
		// CONTINUE destination
		if XTclFixupForwardJump(tls, envPtr, bp+720, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+720)).FcodeOffset)), 127) != 0 {
			XTcl_Panic(tls, ts+18957,
				libc.VaList(bp+24, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+720)).FcodeOffset))))
		}
		for ok72 := true; ok72; ok72 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok73 := true; ok73; ok73 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok74 := true; ok74; ok74 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok75 := true; ok75; ok75 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok76 := true; ok76; ok76 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok77 := true; ok77; ok77 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp+752)

		for ok78 := true; ok78; ok78 = 0 != 0 {
			if 2 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += 2
		}
		// RETURN + other destination
		if XTclFixupForwardJump(tls, envPtr, bp+688, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+688)).FcodeOffset)), 127) != 0 {
			XTcl_Panic(tls, ts+19007,
				libc.VaList(bp+32, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+688)).FcodeOffset))))
		}
		if XTclFixupForwardJump(tls, envPtr, bp+736, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+736)).FcodeOffset)), 127) != 0 {
			XTcl_Panic(tls, ts+19055,
				libc.VaList(bp+40, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+736)).FcodeOffset))))
		}

		// Pull the result to top of stack, discard options dict.

		for ok79 := true; ok79; ok79 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_REVERSE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok80 := true; ok80; ok80 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 2
					}
					for ok81 := true; ok81; ok81 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok82 := true; ok82; ok82 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok83 := true; ok83; ok83 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok84 := true; ok84; ok84 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}

		// OK destination
		if XTclFixupForwardJump(tls, envPtr, bp+672, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+672)).FcodeOffset)), 127) != 0 {
			XTcl_Panic(tls, ts+19102,
				libc.VaList(bp+48, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+672)).FcodeOffset))))
		}
		if count > 1 {
			for ok85 := true; ok85; ok85 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(count))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STR_CONCAT1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok86 := true; ok86; ok86 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - count
						}
						for ok87 := true; ok87; ok87 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			count = 1
		}

		// CONTINUE jump to here
		if XTclFixupForwardJump(tls, envPtr, bp+752, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+752)).FcodeOffset)), 127) != 0 {
			XTcl_Panic(tls, ts+19146,
				libc.VaList(bp+56, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+752)).FcodeOffset))))
		}
		*(*int32)(unsafe.Pointer(bp + 648 /* bline */)) = (*CompileEnv)(unsafe.Pointer(envPtr)).Fline
	}

	for count > 255 {
		for ok88 := true; ok88; ok88 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(255))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_CONCAT1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok89 := true; ok89; ok89 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 255
					}
					for ok90 := true; ok90; ok90 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		count = count - 254
	}
	if count > 1 {
		for ok91 := true; ok91; ok91 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(count))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_CONCAT1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok92 := true; ok92; ok92 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - count
					}
					for ok93 := true; ok93; ok93 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	XTcl_FreeParse(tls, bp+64)

	if *(*Tcl_InterpState)(unsafe.Pointer(bp + 640)) != uintptr(0) {
		XTcl_RestoreInterpState(tls, interp, *(*Tcl_InterpState)(unsafe.Pointer(bp + 640 /* state */)))
		XTclCompileSyntaxError(tls, interp, envPtr)
		for ok94 := true; ok94; ok94 = 0 != 0 {
			if -1 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
		}
	}

	// Final target of the multi-jump from all BREAKs
	if breakOffset > 0 {
		for ok95 := true; ok95; ok95 = 0 != 0 {
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(breakOffset))) = uint8(INST_JUMP4)
			for ok96 := true; ok96; ok96 = 0 != 0 {
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(breakOffset) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(breakOffset)) >> 24)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(breakOffset) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(breakOffset)) >> 16)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(breakOffset) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(breakOffset)) >> 8)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(breakOffset) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(breakOffset)))
			}
		}
	}
}

//----------------------------------------------------------------------
//
// TclCompileSwitchCmd --
//
//	Procedure called to compile the "switch" command.
//
// Results:
//	Returns TCL_OK for successful compile, or TCL_ERROR to defer
//	evaluation to runtime (either when it is too complex to get the
//	semantics right, or when we know for sure that it is an error but need
//	the error to happen at the right time).
//
// Side effects:
//	Instructions are added to envPtr to execute the "switch" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileSwitchCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:1731:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var mapPtr uintptr
	var eclIndex int32   // TIP #280
	var tokenPtr uintptr // Pointer to tokens in command.
	var numWords int32   // Number of words in command.

	var valueTokenPtr uintptr // Token for the value to switch on.
	var mode uint32
	// What kind of switch are we doing?

	var bodyTokenArray uintptr // Array of real pattern list items.
	var bodyToken uintptr      // Array of pointers to pattern list items.
	var bodyLines uintptr      // Array of line numbers for body list
	// items.
	var bodyContLines uintptr // Array of continuation line info.
	var noCase int32          // Has the -nocase flag been given?
	var foundMode int32       // Have we seen a mode flag yet?
	var i int32
	var valueIndex int32
	var result int32
	// var clNext uintptr at bp+16, 8

	var size uint32
	var chrs uintptr
	var prevBytes uintptr
	// var literal int32 at bp+8, 4

	// var bytes uintptr at bp, 8

	var maxLen int32
	var numBytes int32
	// var bline int32 at bp+12, 4

	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	foundMode = 0
	result = TCL_ERROR
	*(*uintptr)(unsafe.Pointer(bp + 16 /* clNext */)) = (*CompileEnv)(unsafe.Pointer(envPtr)).FclNext

	// Only handle the following versions:
	//   switch         ?--? word {pattern body ...}
	//   switch -exact  ?--? word {pattern body ...}
	//   switch -glob   ?--? word {pattern body ...}
	//   switch -regexp ?--? word {pattern body ...}
	//   switch         --   word simpleWordPattern simpleWordBody ...
	//   switch -exact  --   word simpleWordPattern simpleWordBody ...
	//   switch -glob   --   word simpleWordPattern simpleWordBody ...
	//   switch -regexp --   word simpleWordPattern simpleWordBody ...
	// When the mode is -glob, can also handle a -nocase flag.
	//
	// First off, we don't care how the command's word was generated; we're
	// compiling it anyway! So skip it...

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	valueIndex = 1
	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - 1

	// Check for options.

	noCase = 0
	mode = uint32(0) /* Switch_Exact */
	if !(numWords == 2) {
		goto __1
	}
	// There's just the switch value and the bodies list. In that case, we
	// can skip all option parsing and move on to consider switch values
	// and the body list.

	goto finishedOptionParse
__1:
	;

	// There must be at least one option, --, because without that there is no
	// way to statically avoid the problems you get from strings-to-be-matched
	// that start with a - (the interpreted code falls apart if it encounters
	// them, so we punt if we *might* encounter them as that is the easiest
	// way of emulating the behaviour).

__2:
	if !(numWords >= 3) {
		goto __4
	}
	size = uint32((*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fsize)
	chrs = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart

	// We only process literal options, and we assume that -e, -g and -n
	// are unique prefixes of -exact, -glob and -nocase respectively (true
	// at time of writing). Note that -exact and -glob may only be given
	// at most once or we bail out (error case).

	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD || size < uint32(2)) {
		goto __5
	}
	return TCL_ERROR
__5:
	;

	if !(size <= uint32(6) && !(libc.Xmemcmp(tls, chrs, ts+14906, uint64(size)) != 0)) {
		goto __6
	}
	if !(foundMode != 0) {
		goto __8
	}
	return TCL_ERROR
__8:
	;
	mode = uint32(0) /* Switch_Exact */
	foundMode = 1
	valueIndex++
	goto __3
	goto __7
__6:
	if !(size <= uint32(5) && !(libc.Xmemcmp(tls, chrs, ts+14913, uint64(size)) != 0)) {
		goto __9
	}
	if !(foundMode != 0) {
		goto __11
	}
	return TCL_ERROR
__11:
	;
	mode = uint32(1) /* Switch_Glob */
	foundMode = 1
	valueIndex++
	goto __3
	goto __10
__9:
	if !(size <= uint32(7) && !(libc.Xmemcmp(tls, chrs, ts+14974, uint64(size)) != 0)) {
		goto __12
	}
	if !(foundMode != 0) {
		goto __14
	}
	return TCL_ERROR
__14:
	;
	mode = uint32(2) /* Switch_Regexp */
	foundMode = 1
	valueIndex++
	goto __3
	goto __13
__12:
	if !(size <= uint32(7) && !(libc.Xmemcmp(tls, chrs, ts+14955, uint64(size)) != 0)) {
		goto __15
	}
	noCase = 1
	valueIndex++
	goto __3
	goto __16
__15:
	if !(size == uint32(2) && !(libc.Xmemcmp(tls, chrs, ts+15828, uint64(2)) != 0)) {
		goto __17
	}
	valueIndex++
	goto __4
__17:
	;
__16:
	;
__13:
	;
__10:
	;
__7:
	;

	// The switch command has many flags we cannot compile at all (e.g.
	// all the RE-related ones) which we must have encountered. Either
	// that or we have run off the end. The action here is the same: punt
	// to interpreted version.

	return TCL_ERROR
	goto __3
__3:
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	numWords--
	goto __2
	goto __4
__4:
	;
	if !(numWords < 3) {
		goto __18
	}
	return TCL_ERROR
__18:
	;
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	numWords--
	if !(noCase != 0 && mode == uint32(0)) {
		goto __19
	}
	// Can't compile this case; no opcode for case-insensitive equality!

	return TCL_ERROR
__19:
	;

	// The value to test against is going to always get pushed on the stack.
	// But not yet; we need to verify that the rest of the command is
	// compilable too.

finishedOptionParse:
	valueTokenPtr = tokenPtr
	// For valueIndex, see previous loop.
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	numWords--

	// Build an array of tokens for the matcher terms and script bodies. Note
	// that in the case of the quoted bodies, this is tricky as we cannot use
	// copies of the string from the input token for the generated tokens (it
	// causes a crash during exception handling). When multiple tokens are
	// available at this point, this is pretty easy.

	if !(numWords == 1) {
		goto __20
	} // TIP #280: line of the pattern/action list,
	// and start of list for when tracking the
	// location. This list comes immediately after
	// the value we switch on.

	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD) {
		goto __22
	}
	return TCL_ERROR
__22:
	;
	*(*uintptr)(unsafe.Pointer(bp /* bytes */)) = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart
	numBytes = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fsize

	// Allocate enough space to work in.
	maxLen = XTclMaxListLength(tls, *(*uintptr)(unsafe.Pointer(bp /* bytes */)), numBytes, uintptr(0))
	if !(maxLen < 2) {
		goto __23
	}
	return TCL_ERROR
__23:
	;
	bodyTokenArray = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(Tcl_Token{}))*uint64(maxLen)))
	bodyToken = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(maxLen)))
	bodyLines = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(int32(0)))*uint64(maxLen)))
	bodyContLines = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(maxLen)))

	*(*int32)(unsafe.Pointer(bp + 12 /* bline */)) = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(valueIndex+1)*4))
	numWords = 0

__24:
	if !(numBytes > 0) {
		goto __25
	}
	prevBytes = *(*uintptr)(unsafe.Pointer(bp /* bytes */))

	if !(TCL_OK != XTclFindElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp)), numBytes,
		bodyTokenArray+uintptr(numWords)*24+8, bp,
		bodyTokenArray+uintptr(numWords)*24+16, bp+8) || !(*(*int32)(unsafe.Pointer(bp + 8)) != 0)) {
		goto __26
	}
	goto abort
__26:
	;

	(*Tcl_Token)(unsafe.Pointer(bodyTokenArray + uintptr(numWords)*24)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(bodyTokenArray + uintptr(numWords)*24)).FnumComponents = 0
	*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numWords)*8)) = bodyTokenArray + uintptr(numWords)*24

	// TIP #280: Now determine the line the list element starts on
	// (there is no need to do it earlier, due to the possibility of
	// aborting, see above).

	XTclAdvanceLines(tls, bp+12, prevBytes, (*Tcl_Token)(unsafe.Pointer(bodyTokenArray+uintptr(numWords)*24)).Fstart)
	XTclAdvanceContinuations(tls, bp+12, bp+16,
		int32((int64((*Tcl_Token)(unsafe.Pointer(bodyTokenArray+uintptr(numWords)*24)).Fstart)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1))
	*(*int32)(unsafe.Pointer(bodyLines + uintptr(numWords)*4)) = *(*int32)(unsafe.Pointer(bp + 12 /* bline */))
	*(*uintptr)(unsafe.Pointer(bodyContLines + uintptr(numWords)*8)) = *(*uintptr)(unsafe.Pointer(bp + 16 /* clNext */))
	XTclAdvanceLines(tls, bp+12, (*Tcl_Token)(unsafe.Pointer(bodyTokenArray+uintptr(numWords)*24)).Fstart, *(*uintptr)(unsafe.Pointer(bp /* bytes */)))
	XTclAdvanceContinuations(tls, bp+12, bp+16, int32((int64(*(*uintptr)(unsafe.Pointer(bp)))-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1))

	numBytes = int32(int64(numBytes) - (int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(prevBytes))/1)
	numWords++
	goto __24
__25:
	;
	if !(numWords%2 != 0) {
		goto __27
	}
abort:
	XTclpFree(tls, bodyToken)
	XTclpFree(tls, bodyTokenArray)
	XTclpFree(tls, bodyLines)
	XTclpFree(tls, bodyContLines)
	return TCL_ERROR
__27:
	;
	goto __21
__20:
	if !(numWords%2 != 0 || numWords == 0) {
		goto __28
	}
	// Odd number of words (>1) available, or no words at all available.
	// Both are error cases, so punt and let the interpreted-version
	// generate the error message. Note that the second case probably
	// should get caught earlier, but it's easy to check here again anyway
	// because it'd cause a nasty crash otherwise.

	return TCL_ERROR
	goto __29
__28:
	// Multi-word definition of patterns & actions.

	bodyToken = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(numWords)))
	bodyLines = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(int32(0)))*uint64(numWords)))
	bodyContLines = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(numWords)))
	bodyTokenArray = uintptr(0)
	i = 0
__30:
	if !(i < numWords) {
		goto __32
	}
	// We only handle the very simplest case. Anything more complex is
	// a good reason to go to the interpreted case anyway due to
	// traces, etc.

	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD) {
		goto __33
	}
	goto freeTemporaries
__33:
	;
	*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i)*8)) = tokenPtr + uintptr(1)*24

	// TIP #280: Copy line information from regular cmd info.

	*(*int32)(unsafe.Pointer(bodyLines + uintptr(i)*4)) = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(valueIndex+1+i)*4))
	*(*uintptr)(unsafe.Pointer(bodyContLines + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(valueIndex+1+i)*8))
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	goto __31
__31:
	i++
	goto __30
	goto __32
__32:
	;
__29:
	;
__21:
	;

	// Fall back to interpreted if the last body is a continuation (it's
	// illegal, but this makes the error happen at the right time).

	if !((*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numWords-1)*8)))).Fsize == 1 && int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numWords-1)*8)))).Fstart))) == '-') {
		goto __34
	}
	goto freeTemporaries
__34:
	;

	// Now we commit to generating code; the parsing stage per se is done.
	// Check if we can generate a jump table, since if so that's faster than
	// doing an explicit compare with each body. Note that we're definitely
	// over-conservative with determining whether we can do the jump table,
	// but it handles the most common case well enough.

	// Both methods push the value to match against onto the stack.
	if !((*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __35
	}
__37:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __40
	}
__42:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __45
	}
	XTclExpandCodeArray(tls, envPtr)
__45:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __46
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__46:
	;
__47:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __50
	}
	if !(_delta == -0x7fffffff-1) {
		goto __51
	}
	_delta = 1 - _objIndexCopy
__51:
	;
__52:
	if !(_delta < 0) {
		goto __55
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __56
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__56:
	;
__55:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __53
__53:
	if 0 != 0 {
		goto __52
	}
	goto __54
__54:
	;
__50:
	;
	goto __48
__48:
	if 0 != 0 {
		goto __47
	}
	goto __49
__49:
	;
	goto __43
__43:
	if 0 != 0 {
		goto __42
	}
	goto __44
__44:
	;
	goto __41
__40:
__57:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __60
	}
	XTclExpandCodeArray(tls, envPtr)
__60:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __61
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__61:
	;
__62:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __65
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __66
	}
	_delta1 = 1 - _objIndexCopy
__66:
	;
__67:
	if !(_delta1 < 0) {
		goto __70
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __71
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__71:
	;
__70:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __68
__68:
	if 0 != 0 {
		goto __67
	}
	goto __69
__69:
	;
__65:
	;
	goto __63
__63:
	if 0 != 0 {
		goto __62
	}
	goto __64
__64:
	;
	goto __58
__58:
	if 0 != 0 {
		goto __57
	}
	goto __59
__59:
	;
__41:
	;
	goto __38
__38:
	if 0 != 0 {
		goto __37
	}
	goto __39
__39:
	;
	goto __36
__35:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(valueIndex)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(valueIndex)*8))
	XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents, envPtr)
__36:
	;

	if !(mode == uint32(0)) {
		goto __72
	}
	sIssueSwitchJumpTable(tls, interp, envPtr, valueIndex, numWords, bodyToken,
		bodyLines, bodyContLines)
	goto __73
__72:
	sIssueSwitchChainedTests(tls, interp, envPtr, int32(mode), noCase, valueIndex,
		numWords, bodyToken, bodyLines, bodyContLines)
__73:
	;
	result = TCL_OK

	// Clean up all our temporary space and return.

freeTemporaries:
	XTclpFree(tls, bodyToken)
	XTclpFree(tls, bodyLines)
	XTclpFree(tls, bodyContLines)
	if !(bodyTokenArray != uintptr(0)) {
		goto __74
	}
	XTclpFree(tls, bodyTokenArray)
__74:
	;
	return result
}

//----------------------------------------------------------------------
//
// IssueSwitchChainedTests --
//
//	Generate instructions for a [switch] command that is to be compiled
//	into a sequence of tests. This is the generic handle-everything mode
//	that inherently has performance that is (on average) linear in the
//	number of tests. It is the only mode that can handle -glob and -regexp
//	matches, or anything that is case-insensitive. It does not handle the
//	wild-and-wooly end of regexp matching (i.e., capture of match results)
//	so that's when we spill to the interpreted version.
//
//----------------------------------------------------------------------

func sIssueSwitchChainedTests(tls *libc.TLS, interp uintptr, envPtr uintptr, mode int32, noCase int32, valueIndex int32, numBodyTokens int32, bodyToken uintptr, bodyLines uintptr, bodyContLines uintptr) { /* tclCompCmdsSZ.c:2060:1: */
	bp := tls.Alloc(228)
	defer tls.Free(228)

	var foundDefault int32 // Flag to indicate whether a "default" clause
	// is present.
	var fixupArray uintptr       // Array of forward-jump fixup records.
	var fixupTargetArray uintptr // Array of places for fixups to point at.
	var fixupCount int32         // Number of places to fix up.
	var contFixIndex int32       // Where the first of the jumps due to a group
	// of continuation bodies starts, or -1 if
	// there aren't any.
	var contFixCount int32 // Number of continuation bodies pointing to
	// the current (or next) real body.
	var nextArmFixupIndex int32
	var simple int32
	// var exact int32 at bp+224, 4
	// For extracting the type of regexp.
	var i int32

	// Generate a test for each arm.

	contFixIndex = -1
	contFixCount = 0
	fixupArray = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(JumpFixup{}))*uint64(numBodyTokens)))
	fixupTargetArray = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64(numBodyTokens)))
	libc.Xmemset(tls, fixupTargetArray, 0, uint64(numBodyTokens)*uint64(unsafe.Sizeof(int32(0))))
	fixupCount = 0
	foundDefault = 0
	for i = 0; i < numBodyTokens; i = i + 2 {
		nextArmFixupIndex = -1
		if i != numBodyTokens-2 || (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numBodyTokens-2)*8)))).Fsize != 7 || libc.Xmemcmp(tls, (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numBodyTokens-2)*8)))).Fstart, ts+11507, uint64(7)) != 0 {
			// Generate the test for the arm.

			switch mode {
			case 0 /* Switch_Exact */ :
				for ok := true; ok; ok = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_DUP == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_DUP].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok2 := true; ok2; ok2 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				XTclCompileTokens(tls, interp, *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i)*8)), 1, envPtr)
				for ok3 := true; ok3; ok3 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STR_EQ == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok4 := true; ok4; ok4 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STR_EQ].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok5 := true; ok5; ok5 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				break
				fallthrough
			case 1 /* Switch_Glob */ :
				XTclCompileTokens(tls, interp, *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i)*8)), 1, envPtr)
				for ok6 := true; ok6; ok6 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_OVER == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok7 := true; ok7; ok7 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 1
							}
							for ok8 := true; ok8; ok8 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_MATCH)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(noCase))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STR_MATCH == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok10 := true; ok10; ok10 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STR_MATCH].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - noCase
							}
							for ok11 := true; ok11; ok11 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				break
				fallthrough
			case 2 /* Switch_Regexp */ :
				simple = libc.AssignPtrInt32(bp+224 /* exact */, 0)

				// Keep in sync with TclCompileRegexpCmd.

				if (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i)*8)))).Ftype == TCL_TOKEN_TEXT {
					// var ds Tcl_DString at bp+8, 216

					if (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i)*8)))).Fsize == 0 {
						// The semantics of regexps are that they always match
						// when the RE == "".

						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
							if _objIndexCopy <= 255 {
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
										XTclExpandCodeArray(tls, envPtr)
									}
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
											if INST_PUSH1 == INST_START_CMD {
												return 1
											}
											return 0
										}()
									}
									for ok14 := true; ok14; ok14 = 0 != 0 {
										var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
										if _delta != 0 {
											if _delta == -0x7fffffff-1 {
												_delta = 1 - _objIndexCopy
											}
											for ok15 := true; ok15; ok15 = 0 != 0 {
												if _delta < 0 {
													if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
														(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
													}
												}
												*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
											}
										}
									}
								}
							} else {
								for ok16 := true; ok16; ok16 = 0 != 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
										XTclExpandCodeArray(tls, envPtr)
									}
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
											if INST_PUSH4 == INST_START_CMD {
												return 1
											}
											return 0
										}()
									}
									for ok17 := true; ok17; ok17 = 0 != 0 {
										var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
										if _delta != 0 {
											if _delta == -0x7fffffff-1 {
												_delta = 1 - _objIndexCopy
											}
											for ok18 := true; ok18; ok18 = 0 != 0 {
												if _delta < 0 {
													if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
														(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
													}
												}
												*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
											}
										}
									}
								}
							}
						}
						break
					}

					// Attempt to convert pattern to glob. If successful, push
					// the converted pattern.

					if XTclReToGlob(tls, uintptr(0), (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i)*8)))).Fstart,
						(*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i)*8)))).Fsize, bp+8, bp+224, uintptr(0)) == TCL_OK {
						simple = 1
						for ok19 := true; ok19; ok19 = 0 != 0 {
							var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_DString)(unsafe.Pointer(bp+8)).Fstring, (*Tcl_DString)(unsafe.Pointer(bp+8)).Flength, 0)
							if _objIndexCopy <= 255 {
								for ok20 := true; ok20; ok20 = 0 != 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
										XTclExpandCodeArray(tls, envPtr)
									}
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
											if INST_PUSH1 == INST_START_CMD {
												return 1
											}
											return 0
										}()
									}
									for ok21 := true; ok21; ok21 = 0 != 0 {
										var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
										if _delta != 0 {
											if _delta == -0x7fffffff-1 {
												_delta = 1 - _objIndexCopy
											}
											for ok22 := true; ok22; ok22 = 0 != 0 {
												if _delta < 0 {
													if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
														(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
													}
												}
												*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
											}
										}
									}
								}
							} else {
								for ok23 := true; ok23; ok23 = 0 != 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
										XTclExpandCodeArray(tls, envPtr)
									}
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
									*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
											if INST_PUSH4 == INST_START_CMD {
												return 1
											}
											return 0
										}()
									}
									for ok24 := true; ok24; ok24 = 0 != 0 {
										var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
										if _delta != 0 {
											if _delta == -0x7fffffff-1 {
												_delta = 1 - _objIndexCopy
											}
											for ok25 := true; ok25; ok25 = 0 != 0 {
												if _delta < 0 {
													if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
														(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
													}
												}
												*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
											}
										}
									}
								}
							}
						}
						XTcl_DStringFree(tls, bp+8)
					}
				}
				if !(simple != 0) {
					XTclCompileTokens(tls, interp, *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i)*8)), 1, envPtr)
				}

				for ok26 := true; ok26; ok26 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_OVER == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok27 := true; ok27; ok27 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 1
							}
							for ok28 := true; ok28; ok28 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				if !(simple != 0) {
					// Pass correct RE compile flags. We use only Int1
					// (8-bit), but that handles all the flags we want to
					// pass. Don't use TCL_REG_NOSUB as we may have backrefs
					// or capture vars.

					var cflags int32 = TCL_REG_ADVANCED |
						func() int32 {
							if noCase != 0 {
								return TCL_REG_NOCASE
							}
							return 0
						}()

					for ok29 := true; ok29; ok29 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REGEXP)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(cflags))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_REGEXP == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok30 := true; ok30; ok30 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_REGEXP].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - cflags
								}
								for ok31 := true; ok31; ok31 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else if *(*int32)(unsafe.Pointer(bp + 224)) != 0 && !(noCase != 0) {
					for ok32 := true; ok32; ok32 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_STR_EQ == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok33 := true; ok33; ok33 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_STR_EQ].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - 0
								}
								for ok34 := true; ok34; ok34 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok35 := true; ok35; ok35 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_MATCH)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(noCase))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_STR_MATCH == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok36 := true; ok36; ok36 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_STR_MATCH].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - noCase
								}
								for ok37 := true; ok37; ok37 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
				break
				fallthrough
			default:
				XTcl_Panic(tls, ts+19191, libc.VaList(bp, mode))
			}

			// In a fall-through case, we will jump on _true_ to the place
			// where the body starts (generated later, with guarantee of this
			// ensured earlier; the final body is never a fall-through).

			if (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i+1)*8)))).Fsize == 1 && int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i+1)*8)))).Fstart))) == '-' {
				if contFixIndex == -1 {
					contFixIndex = fixupCount
					contFixCount = 0
				}
				XTclEmitForwardJump(tls, envPtr, TCL_TRUE_JUMP,
					fixupArray+uintptr(contFixIndex+contFixCount)*16)
				fixupCount++
				contFixCount++
				continue
			}

			XTclEmitForwardJump(tls, envPtr, TCL_FALSE_JUMP,
				fixupArray+uintptr(fixupCount)*16)
			nextArmFixupIndex = fixupCount
			fixupCount++
		} else {
			// Got a default clause; set a flag to inhibit the generation of
			// the jump after the body and the cleanup of the intermediate
			// value that we are switching against.
			//
			// Note that default clauses (which are always terminal clauses)
			// cannot be fall-through clauses as well, since the last clause
			// is never a fall-through clause (which we have already
			// verified).

			foundDefault = 1
		}

		// Generate the body for the arm. This is guaranteed not to be a
		// fall-through case, but it might have preceding fall-through cases,
		// so we must process those first.

		if contFixIndex != -1 {
			var j int32

			for j = 0; j < contFixCount; j++ {
				*(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(contFixIndex+j)*4)) = uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
			}
			contFixIndex = -1
		}

		// Now do the actual compilation. Note that we do not use BODY()
		// because we may have synthesized the tokens in a non-standard
		// pattern.

		for ok38 := true; ok38; ok38 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok39 := true; ok39; ok39 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok40 := true; ok40; ok40 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer(bodyLines + uintptr(i+1)*4))         // TIP #280
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer(bodyContLines + uintptr(i+1)*8)) // TIP #280
		XTclCompileCmdWord(tls, interp, *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i+1)*8)), 1, envPtr)

		if !(foundDefault != 0) {
			XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP,
				fixupArray+uintptr(fixupCount)*16)
			fixupCount++
			*(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(nextArmFixupIndex)*4)) = uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
		}
	}

	// Discard the value we are matching against unless we've had a default
	// clause (in which case it will already be gone due to the code at the
	// start of processing an arm, guaranteed) and make the result of the
	// command an empty string.

	if !(foundDefault != 0) {
		for ok41 := true; ok41; ok41 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok42 := true; ok42; ok42 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok43 := true; ok43; ok43 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok44 := true; ok44; ok44 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok45 := true; ok45; ok45 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok46 := true; ok46; ok46 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok47 := true; ok47; ok47 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok48 := true; ok48; ok48 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok49 := true; ok49; ok49 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok50 := true; ok50; ok50 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}

	// Do jump fixups for arms that were executed. First, fill in the jumps of
	// all jumps that don't point elsewhere to point to here.

	for i = 0; i < fixupCount; i++ {
		if *(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(i)*4)) == uint32(0) {
			*(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(i)*4)) = uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
		}
	}

	// Now scan backwards over all the jumps (all of which are forward jumps)
	// doing each one. When we do one and there is a size changes, we must
	// scan back over all the previous ones and see if they need adjusting
	// before proceeding with further jump fixups (the interleaved nature of
	// all the jumps makes this impossible to do without nested loops).

	for i = fixupCount - 1; i >= 0; i-- {
		if XTclFixupForwardJump(tls, envPtr, fixupArray+uintptr(i)*16,
			int32(*(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(i)*4))-(*JumpFixup)(unsafe.Pointer(fixupArray+uintptr(i)*16)).FcodeOffset), 127) != 0 {
			var j int32

			for j = i - 1; j >= 0; j-- {
				if *(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(j)*4)) > (*JumpFixup)(unsafe.Pointer(fixupArray+uintptr(i)*16)).FcodeOffset {
					*(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(j)*4)) += uint32(3)
				}
			}
		}
	}
	XTclStackFree(tls, interp, fixupTargetArray)
	XTclStackFree(tls, interp, fixupArray)
}

//----------------------------------------------------------------------
//
// IssueSwitchJumpTable --
//
//	Generate instructions for a [switch] command that is to be compiled
//	into a jump table. This only handles the case where case-sensitive,
//	exact matching is used, but this is actually the most common case in
//	real code.
//
//----------------------------------------------------------------------

func sIssueSwitchJumpTable(tls *libc.TLS, interp uintptr, envPtr uintptr, valueIndex int32, numBodyTokens int32, bodyToken uintptr, bodyLines uintptr, bodyContLines uintptr) { /* tclCompCmdsSZ.c:2311:1: */
	bp := tls.Alloc(220)
	defer tls.Free(220)

	var jtPtr uintptr
	var infoIndex int32
	// var isNew int32 at bp+216, 4

	var finalFixups uintptr
	var numRealBodies int32 = 0
	var jumpLocation int32
	var mustGenerate int32
	var foundDefault int32
	var jumpToDefault int32
	var i int32
	// var buffer Tcl_DString at bp, 216

	var hPtr uintptr

	// Compile the switch by using a jump table, which is basically a
	// hashtable that maps from literal values to match against to the offset
	// (relative to the INST_JUMP_TABLE instruction) to jump to. The jump
	// table itself is independent of any invokation of the bytecode, and as
	// such is stored in an auxData block.
	//
	// Start by allocating the jump table itself, plus some workspace.

	jtPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(JumptableInfo{})))
	XTcl_InitHashTable(tls, jtPtr, 0)
	infoIndex = XTclCreateAuxData(tls, jtPtr, uintptr(unsafe.Pointer(&XtclJumptableInfoType)), envPtr)
	finalFixups = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64(numBodyTokens/2)))
	foundDefault = 0
	mustGenerate = 1

	// Next, issue the instruction to do the jump, together with what we want
	// to do if things do not work out (jump to either the default clause or
	// the "default" default, which just sets the result to empty). Note that
	// we will come back and rewrite the jump's offset parameter when we know
	// what it should be, and that all jumps we issue are of the wide kind
	// because that makes the code much easier to debug!

	jumpLocation = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TABLE)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(infoIndex))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP_TABLE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP_TABLE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - infoIndex
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	jumpToDefault = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok3 := true; ok3; ok3 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP4 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP4].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok5 := true; ok5; ok5 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	for i = 0; i < numBodyTokens; i = i + 2 {
		// For each arm, we must first work out what to do with the match
		// term.

		if i != numBodyTokens-2 || (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numBodyTokens-2)*8)))).Fsize != 7 || libc.Xmemcmp(tls, (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numBodyTokens-2)*8)))).Fstart, ts+11507, uint64(7)) != 0 {
			// This is not a default clause, so insert the current location as
			// a target in the jump table (assuming it isn't already there,
			// which would indicate that this clause is probably masked by an
			// earlier one). Note that we use a Tcl_DString here simply
			// because the hash API does not let us specify the string length.

			XTcl_DStringInit(tls, bp)
			XTcl_DStringAppend(tls, bp, (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i)*8)))).Fstart, (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i)*8)))).Fsize)
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(jtPtr /* &.hashTable */)).FcreateProc})).f(tls, jtPtr /* &.hashTable */, (*Tcl_DString)(unsafe.Pointer(bp /* &buffer */)).Fstring, bp+216 /* &isNew */)
			if *(*int32)(unsafe.Pointer(bp + 216)) != 0 {
				// First time we've encountered this match clause, so it must
				// point to here.

				(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = ClientData((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(jumpLocation))
			}
			XTcl_DStringFree(tls, bp)
		} else {
			// This is a default clause, so patch up the fallthrough from the
			// INST_JUMP_TABLE instruction to here.

			foundDefault = 1
			*(*int32)(unsafe.Pointer(bp + 216 /* isNew */)) = 1
			for ok6 := true; ok6; ok6 = 0 != 0 {
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(jumpToDefault) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(jumpToDefault)) >> 24)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(jumpToDefault) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(jumpToDefault)) >> 16)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(jumpToDefault) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(jumpToDefault)) >> 8)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(jumpToDefault) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(jumpToDefault)))
			}
		}

		// Now, for each arm we must deal with the body of the clause.
		//
		// If this is a continuation body (never true of a final clause,
		// whether default or not) we're done because the next jump target
		// will also point here, so we advance to the next clause.

		if (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i+1)*8)))).Fsize == 1 && int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i+1)*8)))).Fstart))) == '-' {
			mustGenerate = 1
			continue
		}

		// Also skip this arm if its only match clause is masked. (We could
		// probably be more aggressive about this, but that would be much more
		// difficult to get right.)

		if !(*(*int32)(unsafe.Pointer(bp + 216)) != 0) && !(mustGenerate != 0) {
			continue
		}
		mustGenerate = 0

		// Compile the body of the arm.

		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer(bodyLines + uintptr(i+1)*4))         // TIP #280
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer(bodyContLines + uintptr(i+1)*8)) // TIP #280
		XTclCompileCmdWord(tls, interp, *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i+1)*8)), 1, envPtr)

		// Compile a jump in to the end of the command if this body is
		// anything other than a user-supplied default arm (to either skip
		// over the remaining bodies or the code that generates an empty
		// result).

		if i+2 < numBodyTokens || !(foundDefault != 0) {
			*(*int32)(unsafe.Pointer(finalFixups + uintptr(libc.PostIncInt32(&numRealBodies, 1))*4)) = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)

			// Easier by far to issue this jump as a fixed-width jump, since
			// otherwise we'd need to do a lot more (and more awkward)
			// rewriting when we fixed this all up.

			for ok7 := true; ok7; ok7 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_JUMP4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok8 := true; ok8; ok8 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_JUMP4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok10 := true; ok10; ok10 = 0 != 0 {
				if -1 < 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
					}
				}
				*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
			}
		}
	}

	// We're at the end. If we've not already done so through the processing
	// of a user-supplied default clause, add in a "default" default clause
	// now.

	if !(foundDefault != 0) {
		for ok11 := true; ok11; ok11 = 0 != 0 {
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(jumpToDefault) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(jumpToDefault)) >> 24)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(jumpToDefault) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(jumpToDefault)) >> 16)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(jumpToDefault) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(jumpToDefault)) >> 8)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(jumpToDefault) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(jumpToDefault)))
		}
		for ok12 := true; ok12; ok12 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok13 := true; ok13; ok13 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok14 := true; ok14; ok14 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok15 := true; ok15; ok15 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok17 := true; ok17; ok17 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok18 := true; ok18; ok18 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}

	// No more instructions to be issued; everything that needs to jump to the
	// end of the command is fixed up at this point.

	for i = 0; i < numRealBodies; i++ {
		for ok19 := true; ok19; ok19 = 0 != 0 {
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i)*4))) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i)*4)))) >> 24)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i)*4))) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i)*4)))) >> 16)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i)*4))) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i)*4)))) >> 8)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i)*4))) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i)*4)))))
		}
	}

	// Clean up all our temporary space and return.

	XTclStackFree(tls, interp, finalFixups)
}

//----------------------------------------------------------------------
//
// DupJumptableInfo, FreeJumptableInfo --
//
//	Functions to duplicate, release and print a jump-table created for use
//	with the INST_JUMP_TABLE instruction.
//
// Results:
//	DupJumptableInfo: a copy of the jump-table
//	FreeJumptableInfo: none
//	PrintJumptableInfo: none
//	DisassembleJumptableInfo: none
//
// Side effects:
//	DupJumptableInfo: allocates memory
//	FreeJumptableInfo: releases memory
//	PrintJumptableInfo: none
//	DisassembleJumptableInfo: none
//
//----------------------------------------------------------------------

func sDupJumptableInfo(tls *libc.TLS, clientData ClientData) ClientData { /* tclCompCmdsSZ.c:2507:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var jtPtr uintptr = clientData
	var newJtPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(JumptableInfo{})))
	var hPtr uintptr
	var newHPtr uintptr
	// var search Tcl_HashSearch at bp, 24

	// var isNew int32 at bp+24, 4

	XTcl_InitHashTable(tls, newJtPtr, 0)
	hPtr = XTcl_FirstHashEntry(tls, jtPtr, bp)
	for hPtr != uintptr(0) {
		newHPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(newJtPtr /* &.hashTable */)).FcreateProc})).f(tls, newJtPtr /* &.hashTable */, func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(jtPtr /* &.hashTable */)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(jtPtr /* &.hashTable */)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(hPtr + 32 /* &.key */))
			}
			return hPtr + 32 /* &.key */
		}(), bp+24)
		(*Tcl_HashEntry)(unsafe.Pointer(newHPtr)).FclientData = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	}
	return newJtPtr
}

func sFreeJumptableInfo(tls *libc.TLS, clientData ClientData) { /* tclCompCmdsSZ.c:2527:1: */
	var jtPtr uintptr = clientData

	XTcl_DeleteHashTable(tls, jtPtr)
	XTclpFree(tls, jtPtr)
}

func sPrintJumptableInfo(tls *libc.TLS, clientData ClientData, appendObj uintptr, codePtr uintptr, pcOffset uint32) { /* tclCompCmdsSZ.c:2537:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var jtPtr uintptr = clientData
	var hPtr uintptr
	// var search Tcl_HashSearch at bp+16, 24

	var keyPtr uintptr
	var offset int32
	var i int32 = 0

	hPtr = XTcl_FirstHashEntry(tls, jtPtr, bp+16)
	for ; hPtr != 0; hPtr = XTcl_NextHashEntry(tls, bp+16) {
		keyPtr = func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(jtPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(jtPtr)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(hPtr + 32))
			}
			return hPtr + 32
		}()
		offset = int32((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)

		if libc.PostIncInt32(&i, 1) != 0 {
			XTcl_AppendToObj(tls, appendObj, ts+18549, -1)
			if i%4 == 0 {
				XTcl_AppendToObj(tls, appendObj, ts+19215, -1)
			}
		}
		XTcl_AppendPrintfToObj(tls, appendObj, ts+19219,
			libc.VaList(bp, keyPtr, pcOffset+uint32(offset)))
	}
}

func sDisassembleJumptableInfo(tls *libc.TLS, clientData ClientData, dictObj uintptr, codePtr uintptr, pcOffset uint32) { /* tclCompCmdsSZ.c:2566:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var jtPtr uintptr = clientData
	var mapping uintptr = XTcl_NewObj(tls)
	var hPtr uintptr
	// var search Tcl_HashSearch at bp, 24

	var keyPtr uintptr
	var offset int32

	hPtr = XTcl_FirstHashEntry(tls, jtPtr, bp)
	for ; hPtr != 0; hPtr = XTcl_NextHashEntry(tls, bp) {
		keyPtr = func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(jtPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(jtPtr)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(hPtr + 32))
			}
			return hPtr + 32
		}()
		offset = int32((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
		XTcl_DictObjPut(tls, uintptr(0), mapping, XTcl_NewStringObj(tls, keyPtr, -1),
			XTcl_NewIntObj(tls, offset))
	}
	XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+19231, -1), mapping)
}

//----------------------------------------------------------------------
//
// TclCompileTailcallCmd --
//
//	Procedure called to compile the "tailcall" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "tailcall" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileTailcallCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:2608:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	var i int32

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 2 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 256 ||
		(*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr == uintptr(0) {
		return TCL_ERROR
	}

	// make room for the nsObjPtr
	// TODO: Doesn't this have to be a known value?
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*24)).Fline))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*24)).Fnext))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for i = 1; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

	}
	for ok14 := true; ok14; ok14 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_TAILCALL)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_TAILCALL == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok15 := true; ok15; ok15 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_TAILCALL].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileThrowCmd --
//
//	Procedure called to compile the "throw" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "throw" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileThrowCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:2655:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var numWords int32
	var codeToken uintptr
	var msgToken uintptr
	var objPtr uintptr
	var codeKnown int32
	var codeIsList int32
	var codeIsValid int32
	// var len int32 at bp, 4

	var cachePtr uintptr
	var _delta int32
	var _delta1 int32
	var _objIndexCopy int32
	var _delta2 int32
	var _delta3 int32
	var _objIndexCopy1 int32
	var _delta4 int32
	var _delta5 int32
	var _objIndexCopy2 int32
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var _delta6 int32
	var _delta7 int32
	var _objIndexCopy3 int32
	var errPtr uintptr
	var dictPtr uintptr
	var cachePtr3 uintptr
	var _delta8 int32
	var _delta9 int32
	var _delta10 int32
	var _delta11 int32
	var _delta12 int32
	var _delta13 int32
	var _delta14 int32
	var _delta15 int32
	var _delta16 int32
	var _delta17 int32
	var _delta18 int32
	var _delta19 int32
	var _objIndexCopy4 int32
	var _delta20 int32
	var _delta21 int32
	var _objIndexCopy5 int32
	var _delta22 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords

	if !(numWords != 3) {
		goto __1
	}
	return TCL_ERROR
__1:
	;
	codeToken = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	msgToken = codeToken + uintptr((*Tcl_Token)(unsafe.Pointer(codeToken)).FnumComponents+1)*24

__2:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __5
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __6
__5:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__6:
	;
	goto __3
__3:
	if 0 != 0 {
		goto __2
	}
	goto __4
__4:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++

	codeKnown = XTclWordKnownAtCompileTime(tls, codeToken, objPtr)

	// First we must emit the code to substitute the arguments.  This
	// must come first in case substitution raises errors.
	if !!(codeKnown != 0) {
		goto __7
	}
	if !((*Tcl_Token)(unsafe.Pointer(codeToken)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __8
	}
__10:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(codeToken+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(codeToken+1*24)).Fsize, 0)
	if !(_objIndexCopy <= 255) {
		goto __13
	}
__15:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __18
	}
	XTclExpandCodeArray(tls, envPtr)
__18:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __19
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__19:
	;
__20:
	_delta = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta != 0) {
		goto __23
	}
	if !(_delta == -0x7fffffff-1) {
		goto __24
	}
	_delta = 1 - _objIndexCopy
__24:
	;
__25:
	if !(_delta < 0) {
		goto __28
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __29
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__29:
	;
__28:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __26
__26:
	if 0 != 0 {
		goto __25
	}
	goto __27
__27:
	;
__23:
	;
	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	goto __16
__16:
	if 0 != 0 {
		goto __15
	}
	goto __17
__17:
	;
	goto __14
__13:
__30:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __33
	}
	XTclExpandCodeArray(tls, envPtr)
__33:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __34
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__34:
	;
__35:
	_delta1 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta1 != 0) {
		goto __38
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __39
	}
	_delta1 = 1 - _objIndexCopy
__39:
	;
__40:
	if !(_delta1 < 0) {
		goto __43
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __44
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__44:
	;
__43:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __41
__41:
	if 0 != 0 {
		goto __40
	}
	goto __42
__42:
	;
__38:
	;
	goto __36
__36:
	if 0 != 0 {
		goto __35
	}
	goto __37
__37:
	;
	goto __31
__31:
	if 0 != 0 {
		goto __30
	}
	goto __32
__32:
	;
__14:
	;
	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
	goto __9
__8:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclCompileTokens(tls, interp, codeToken+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(codeToken)).FnumComponents, envPtr)
__9:
	;

__45:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, ts+12045, int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy1 <= 255) {
		goto __48
	}
__50:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __53
	}
	XTclExpandCodeArray(tls, envPtr)
__53:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __54
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__54:
	;
__55:
	_delta2 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta2 != 0) {
		goto __58
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __59
	}
	_delta2 = 1 - _objIndexCopy1
__59:
	;
__60:
	if !(_delta2 < 0) {
		goto __63
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __64
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__64:
	;
__63:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __61
__61:
	if 0 != 0 {
		goto __60
	}
	goto __62
__62:
	;
__58:
	;
	goto __56
__56:
	if 0 != 0 {
		goto __55
	}
	goto __57
__57:
	;
	goto __51
__51:
	if 0 != 0 {
		goto __50
	}
	goto __52
__52:
	;
	goto __49
__48:
__65:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __68
	}
	XTclExpandCodeArray(tls, envPtr)
__68:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __69
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__69:
	;
__70:
	_delta3 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta3 != 0) {
		goto __73
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __74
	}
	_delta3 = 1 - _objIndexCopy1
__74:
	;
__75:
	if !(_delta3 < 0) {
		goto __78
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __79
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__79:
	;
__78:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __76
__76:
	if 0 != 0 {
		goto __75
	}
	goto __77
__77:
	;
__73:
	;
	goto __71
__71:
	if 0 != 0 {
		goto __70
	}
	goto __72
__72:
	;
	goto __66
__66:
	if 0 != 0 {
		goto __65
	}
	goto __67
__67:
	;
__49:
	;
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
__7:
	;
	if !((*Tcl_Token)(unsafe.Pointer(msgToken)).Ftype == TCL_TOKEN_SIMPLE_WORD) {
		goto __80
	}
__82:
	_objIndexCopy2 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(msgToken+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(msgToken+1*24)).Fsize, 0)
	if !(_objIndexCopy2 <= 255) {
		goto __85
	}
__87:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __90
	}
	XTclExpandCodeArray(tls, envPtr)
__90:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __91
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__91:
	;
__92:
	_delta4 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta4 != 0) {
		goto __95
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __96
	}
	_delta4 = 1 - _objIndexCopy2
__96:
	;
__97:
	if !(_delta4 < 0) {
		goto __100
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __101
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__101:
	;
__100:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __98
__98:
	if 0 != 0 {
		goto __97
	}
	goto __99
__99:
	;
__95:
	;
	goto __93
__93:
	if 0 != 0 {
		goto __92
	}
	goto __94
__94:
	;
	goto __88
__88:
	if 0 != 0 {
		goto __87
	}
	goto __89
__89:
	;
	goto __86
__85:
__102:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __105
	}
	XTclExpandCodeArray(tls, envPtr)
__105:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __106
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__106:
	;
__107:
	_delta5 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta5 != 0) {
		goto __110
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __111
	}
	_delta5 = 1 - _objIndexCopy2
__111:
	;
__112:
	if !(_delta5 < 0) {
		goto __115
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __116
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__116:
	;
__115:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __113
__113:
	if 0 != 0 {
		goto __112
	}
	goto __114
__114:
	;
__110:
	;
	goto __108
__108:
	if 0 != 0 {
		goto __107
	}
	goto __109
__109:
	;
	goto __103
__103:
	if 0 != 0 {
		goto __102
	}
	goto __104
__104:
	;
__86:
	;
	goto __83
__83:
	if 0 != 0 {
		goto __82
	}
	goto __84
__84:
	;
	goto __81
__80:
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
	XTclCompileTokens(tls, interp, msgToken+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(msgToken)).FnumComponents, envPtr)
__81:
	;

	codeIsList = libc.Bool32(codeKnown != 0 && TCL_OK == XTcl_ListObjLength(tls, interp, objPtr, bp))
	codeIsValid = libc.Bool32(codeIsList != 0 && *(*int32)(unsafe.Pointer(bp)) != 0)

	if !(codeIsValid != 0) {
		goto __117
	}

__118:
	;
__121:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __124
	}
	errPtr = XTclThreadAllocObj(tls)
	goto __125
__124:
	errPtr = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(errPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__125:
	;
	goto __122
__122:
	if 0 != 0 {
		goto __121
	}
	goto __123
__123:
	;
	(*Tcl_Obj)(unsafe.Pointer(errPtr)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)) == 0) {
		goto __126
	}
	(*Tcl_Obj)(unsafe.Pointer(errPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(errPtr)).Flength = 0
	goto __127
__126:
	(*Tcl_Obj)(unsafe.Pointer(errPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(errPtr)).Fbytes, ts+12045, uint64(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(errPtr)).Fbytes + 10)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(errPtr)).Flength = int32(uint64(unsafe.Sizeof([11]int8{})) - uint64(1))
__127:
	;
	(*Tcl_Obj)(unsafe.Pointer(errPtr)).FtypePtr = uintptr(0)

	goto __119
__119:
	if 0 != 0 {
		goto __118
	}
	goto __120
__120:
	;
__128:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __131
	}
	dictPtr = XTclThreadAllocObj(tls)
	goto __132
__131:
	dictPtr = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__132:
	;
	goto __129
__129:
	if 0 != 0 {
		goto __128
	}
	goto __130
__130:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = uintptr(0)

	XTcl_DictObjPut(tls, uintptr(0), dictPtr, errPtr, objPtr)
__133:
	_objIndexCopy3 = XTclAddLiteralObj(tls, envPtr, dictPtr, uintptr(0))
	if !(_objIndexCopy3 <= 255) {
		goto __136
	}
__138:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __141
	}
	XTclExpandCodeArray(tls, envPtr)
__141:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __142
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__142:
	;
__143:
	_delta6 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta6 != 0) {
		goto __146
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __147
	}
	_delta6 = 1 - _objIndexCopy3
__147:
	;
__148:
	if !(_delta6 < 0) {
		goto __151
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __152
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__152:
	;
__151:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __149
__149:
	if 0 != 0 {
		goto __148
	}
	goto __150
__150:
	;
__146:
	;
	goto __144
__144:
	if 0 != 0 {
		goto __143
	}
	goto __145
__145:
	;
	goto __139
__139:
	if 0 != 0 {
		goto __138
	}
	goto __140
__140:
	;
	goto __137
__136:
__153:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __156
	}
	XTclExpandCodeArray(tls, envPtr)
__156:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __157
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__157:
	;
__158:
	_delta7 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta7 != 0) {
		goto __161
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __162
	}
	_delta7 = 1 - _objIndexCopy3
__162:
	;
__163:
	if !(_delta7 < 0) {
		goto __166
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __167
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__167:
	;
__166:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __164
__164:
	if 0 != 0 {
		goto __163
	}
	goto __165
__165:
	;
__161:
	;
	goto __159
__159:
	if 0 != 0 {
		goto __158
	}
	goto __160
__160:
	;
	goto __154
__154:
	if 0 != 0 {
		goto __153
	}
	goto __155
__155:
	;
__137:
	;
	goto __134
__134:
	if 0 != 0 {
		goto __133
	}
	goto __135
__135:
	;
__117:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __168
	}
	goto __169
__168:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __170
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __172
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__172:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__173:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __176
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __177
__176:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__177:
	;
	goto __174
__174:
	if 0 != 0 {
		goto __173
	}
	goto __175
__175:
	;
	goto __171
__170:
	XTclFreeObj(tls, objPtr)
__171:
	;
__169:
	;

	// Simpler bytecodes when we detect invalid arguments at compile time.
	if !(codeKnown != 0 && !(codeIsValid != 0)) {
		goto __178
	}
__179:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __182
	}
	XTclExpandCodeArray(tls, envPtr)
__182:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __183
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__183:
	;
__184:
	_delta8 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta8 != 0) {
		goto __187
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __188
	}
	_delta8 = 1 - 0
__188:
	;
__189:
	if !(_delta8 < 0) {
		goto __192
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __193
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__193:
	;
__192:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __190
__190:
	if 0 != 0 {
		goto __189
	}
	goto __191
__191:
	;
__187:
	;
	goto __185
__185:
	if 0 != 0 {
		goto __184
	}
	goto __186
__186:
	;
	goto __180
__180:
	if 0 != 0 {
		goto __179
	}
	goto __181
__181:
	;
	if !(codeIsList != 0) {
		goto __194
	}
	// Must be an empty list
	goto issueErrorForEmptyCode
__194:
	;
	XTclCompileSyntaxError(tls, interp, envPtr)
	return TCL_OK
__178:
	;

	if !!(codeKnown != 0) {
		goto __195
	}
	// Argument validity checking has to be done by bytecode at
	// run time.
__196:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __199
	}
	XTclExpandCodeArray(tls, envPtr)
__199:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __200
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__200:
	;
__201:
	_delta9 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta9 != 0) {
		goto __204
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __205
	}
	_delta9 = 1 - 3
__205:
	;
__206:
	if !(_delta9 < 0) {
		goto __209
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __210
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__210:
	;
__209:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __207
__207:
	if 0 != 0 {
		goto __206
	}
	goto __208
__208:
	;
__204:
	;
	goto __202
__202:
	if 0 != 0 {
		goto __201
	}
	goto __203
__203:
	;
	goto __197
__197:
	if 0 != 0 {
		goto __196
	}
	goto __198
__198:
	;
__211:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __214
	}
	XTclExpandCodeArray(tls, envPtr)
__214:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __215
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__215:
	;
__216:
	_delta10 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta10 != 0) {
		goto __219
	}
	if !(_delta10 == -0x7fffffff-1) {
		goto __220
	}
	_delta10 = 1 - 0
__220:
	;
__221:
	if !(_delta10 < 0) {
		goto __224
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __225
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__225:
	;
__224:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta10
	goto __222
__222:
	if 0 != 0 {
		goto __221
	}
	goto __223
__223:
	;
__219:
	;
	goto __217
__217:
	if 0 != 0 {
		goto __216
	}
	goto __218
__218:
	;
	goto __212
__212:
	if 0 != 0 {
		goto __211
	}
	goto __213
__213:
	;
__226:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __229
	}
	XTclExpandCodeArray(tls, envPtr)
__229:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_LENGTH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __230
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST_LENGTH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__230:
	;
__231:
	_delta11 = XtclInstructionTable[INST_LIST_LENGTH].FstackEffect
	if !(_delta11 != 0) {
		goto __234
	}
	if !(_delta11 == -0x7fffffff-1) {
		goto __235
	}
	_delta11 = 1 - 0
__235:
	;
__236:
	if !(_delta11 < 0) {
		goto __239
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __240
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__240:
	;
__239:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta11
	goto __237
__237:
	if 0 != 0 {
		goto __236
	}
	goto __238
__238:
	;
__234:
	;
	goto __232
__232:
	if 0 != 0 {
		goto __231
	}
	goto __233
__233:
	;
	goto __227
__227:
	if 0 != 0 {
		goto __226
	}
	goto __228
__228:
	;
__241:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __244
	}
	XTclExpandCodeArray(tls, envPtr)
__244:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(16))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __245
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_FALSE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__245:
	;
__246:
	_delta12 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
	if !(_delta12 != 0) {
		goto __249
	}
	if !(_delta12 == -0x7fffffff-1) {
		goto __250
	}
	_delta12 = 1 - 16
__250:
	;
__251:
	if !(_delta12 < 0) {
		goto __254
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __255
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__255:
	;
__254:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta12
	goto __252
__252:
	if 0 != 0 {
		goto __251
	}
	goto __253
__253:
	;
__249:
	;
	goto __247
__247:
	if 0 != 0 {
		goto __246
	}
	goto __248
__248:
	;
	goto __242
__242:
	if 0 != 0 {
		goto __241
	}
	goto __243
__243:
	;
__256:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __259
	}
	XTclExpandCodeArray(tls, envPtr)
__259:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __260
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST == INST_START_CMD {
			return 1
		}
		return 0
	}()
__260:
	;
__261:
	_delta13 = XtclInstructionTable[INST_LIST].FstackEffect
	if !(_delta13 != 0) {
		goto __264
	}
	if !(_delta13 == -0x7fffffff-1) {
		goto __265
	}
	_delta13 = 1 - 2
__265:
	;
__266:
	if !(_delta13 < 0) {
		goto __269
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __270
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__270:
	;
__269:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta13
	goto __267
__267:
	if 0 != 0 {
		goto __266
	}
	goto __268
__268:
	;
__264:
	;
	goto __262
__262:
	if 0 != 0 {
		goto __261
	}
	goto __263
__263:
	;
	goto __257
__257:
	if 0 != 0 {
		goto __256
	}
	goto __258
__258:
	;
__271:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __274
	}
	XTclExpandCodeArray(tls, envPtr)
__274:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_RETURN_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(TCL_ERROR))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __275
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_RETURN_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__275:
	;
__276:
	_delta14 = XtclInstructionTable[INST_RETURN_IMM].FstackEffect
	if !(_delta14 != 0) {
		goto __279
	}
	if !(_delta14 == -0x7fffffff-1) {
		goto __280
	}
	_delta14 = 1 - TCL_ERROR
__280:
	;
__281:
	if !(_delta14 < 0) {
		goto __284
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __285
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__285:
	;
__284:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta14
	goto __282
__282:
	if 0 != 0 {
		goto __281
	}
	goto __283
__283:
	;
__279:
	;
	goto __277
__277:
	if 0 != 0 {
		goto __276
	}
	goto __278
__278:
	;
	goto __272
__272:
	if 0 != 0 {
		goto __271
	}
	goto __273
__273:
	;
__286:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __289
	}
	XTclExpandCodeArray(tls, envPtr)
__289:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	goto __287
__287:
	if 0 != 0 {
		goto __286
	}
	goto __288
__288:
	;
__290:
	if !(2 < 0) {
		goto __293
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __294
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__294:
	;
__293:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += 2
	goto __291
__291:
	if 0 != 0 {
		goto __290
	}
	goto __292
__292:
	;
__295:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __298
	}
	XTclExpandCodeArray(tls, envPtr)
__298:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __299
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__299:
	;
__300:
	_delta15 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta15 != 0) {
		goto __303
	}
	if !(_delta15 == -0x7fffffff-1) {
		goto __304
	}
	_delta15 = 1 - 0
__304:
	;
__305:
	if !(_delta15 < 0) {
		goto __308
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __309
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__309:
	;
__308:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta15
	goto __306
__306:
	if 0 != 0 {
		goto __305
	}
	goto __307
__307:
	;
__303:
	;
	goto __301
__301:
	if 0 != 0 {
		goto __300
	}
	goto __302
__302:
	;
	goto __296
__296:
	if 0 != 0 {
		goto __295
	}
	goto __297
__297:
	;
__310:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __313
	}
	XTclExpandCodeArray(tls, envPtr)
__313:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __314
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__314:
	;
__315:
	_delta16 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta16 != 0) {
		goto __318
	}
	if !(_delta16 == -0x7fffffff-1) {
		goto __319
	}
	_delta16 = 1 - 0
__319:
	;
__320:
	if !(_delta16 < 0) {
		goto __323
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __324
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__324:
	;
__323:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta16
	goto __321
__321:
	if 0 != 0 {
		goto __320
	}
	goto __322
__322:
	;
__318:
	;
	goto __316
__316:
	if 0 != 0 {
		goto __315
	}
	goto __317
__317:
	;
	goto __311
__311:
	if 0 != 0 {
		goto __310
	}
	goto __312
__312:
	;
__325:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __328
	}
	XTclExpandCodeArray(tls, envPtr)
__328:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __329
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__329:
	;
__330:
	_delta17 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta17 != 0) {
		goto __333
	}
	if !(_delta17 == -0x7fffffff-1) {
		goto __334
	}
	_delta17 = 1 - 0
__334:
	;
__335:
	if !(_delta17 < 0) {
		goto __338
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __339
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__339:
	;
__338:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta17
	goto __336
__336:
	if 0 != 0 {
		goto __335
	}
	goto __337
__337:
	;
__333:
	;
	goto __331
__331:
	if 0 != 0 {
		goto __330
	}
	goto __332
__332:
	;
	goto __326
__326:
	if 0 != 0 {
		goto __325
	}
	goto __327
__327:
	;
issueErrorForEmptyCode:
__340:
	_objIndexCopy4 = XTclRegisterLiteral(tls, envPtr, ts+17477, int32(uint64(unsafe.Sizeof([28]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy4 <= 255) {
		goto __343
	}
__345:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __348
	}
	XTclExpandCodeArray(tls, envPtr)
__348:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __349
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__349:
	;
__350:
	_delta18 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta18 != 0) {
		goto __353
	}
	if !(_delta18 == -0x7fffffff-1) {
		goto __354
	}
	_delta18 = 1 - _objIndexCopy4
__354:
	;
__355:
	if !(_delta18 < 0) {
		goto __358
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __359
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__359:
	;
__358:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta18
	goto __356
__356:
	if 0 != 0 {
		goto __355
	}
	goto __357
__357:
	;
__353:
	;
	goto __351
__351:
	if 0 != 0 {
		goto __350
	}
	goto __352
__352:
	;
	goto __346
__346:
	if 0 != 0 {
		goto __345
	}
	goto __347
__347:
	;
	goto __344
__343:
__360:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __363
	}
	XTclExpandCodeArray(tls, envPtr)
__363:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __364
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__364:
	;
__365:
	_delta19 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta19 != 0) {
		goto __368
	}
	if !(_delta19 == -0x7fffffff-1) {
		goto __369
	}
	_delta19 = 1 - _objIndexCopy4
__369:
	;
__370:
	if !(_delta19 < 0) {
		goto __373
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __374
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__374:
	;
__373:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta19
	goto __371
__371:
	if 0 != 0 {
		goto __370
	}
	goto __372
__372:
	;
__368:
	;
	goto __366
__366:
	if 0 != 0 {
		goto __365
	}
	goto __367
__367:
	;
	goto __361
__361:
	if 0 != 0 {
		goto __360
	}
	goto __362
__362:
	;
__344:
	;
	goto __341
__341:
	if 0 != 0 {
		goto __340
	}
	goto __342
__342:
	;
__375:
	_objIndexCopy5 = XTclRegisterLiteral(tls, envPtr, ts+19239, int32(uint64(unsafe.Sizeof([46]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy5 <= 255) {
		goto __378
	}
__380:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __383
	}
	XTclExpandCodeArray(tls, envPtr)
__383:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __384
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__384:
	;
__385:
	_delta20 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta20 != 0) {
		goto __388
	}
	if !(_delta20 == -0x7fffffff-1) {
		goto __389
	}
	_delta20 = 1 - _objIndexCopy5
__389:
	;
__390:
	if !(_delta20 < 0) {
		goto __393
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __394
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__394:
	;
__393:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta20
	goto __391
__391:
	if 0 != 0 {
		goto __390
	}
	goto __392
__392:
	;
__388:
	;
	goto __386
__386:
	if 0 != 0 {
		goto __385
	}
	goto __387
__387:
	;
	goto __381
__381:
	if 0 != 0 {
		goto __380
	}
	goto __382
__382:
	;
	goto __379
__378:
__395:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __398
	}
	XTclExpandCodeArray(tls, envPtr)
__398:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __399
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__399:
	;
__400:
	_delta21 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta21 != 0) {
		goto __403
	}
	if !(_delta21 == -0x7fffffff-1) {
		goto __404
	}
	_delta21 = 1 - _objIndexCopy5
__404:
	;
__405:
	if !(_delta21 < 0) {
		goto __408
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __409
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__409:
	;
__408:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta21
	goto __406
__406:
	if 0 != 0 {
		goto __405
	}
	goto __407
__407:
	;
__403:
	;
	goto __401
__401:
	if 0 != 0 {
		goto __400
	}
	goto __402
__402:
	;
	goto __396
__396:
	if 0 != 0 {
		goto __395
	}
	goto __397
__397:
	;
__379:
	;
	goto __376
__376:
	if 0 != 0 {
		goto __375
	}
	goto __377
__377:
	;
__195:
	;
__410:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __413
	}
	XTclExpandCodeArray(tls, envPtr)
__413:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_RETURN_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(TCL_ERROR)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(TCL_ERROR))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __414
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_RETURN_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__414:
	;
__415:
	_delta22 = XtclInstructionTable[INST_RETURN_IMM].FstackEffect
	if !(_delta22 != 0) {
		goto __418
	}
	if !(_delta22 == -0x7fffffff-1) {
		goto __419
	}
	_delta22 = 1 - TCL_ERROR
__419:
	;
__420:
	if !(_delta22 < 0) {
		goto __423
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __424
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__424:
	;
__423:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta22
	goto __421
__421:
	if 0 != 0 {
		goto __420
	}
	goto __422
__422:
	;
__418:
	;
	goto __416
__416:
	if 0 != 0 {
		goto __415
	}
	goto __417
__417:
	;
	goto __411
__411:
	if 0 != 0 {
		goto __410
	}
	goto __412
__412:
	;
__425:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __428
	}
	XTclExpandCodeArray(tls, envPtr)
__428:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	goto __426
__426:
	if 0 != 0 {
		goto __425
	}
	goto __427
__427:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileTryCmd --
//
//	Procedure called to compile the "try" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "try" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileTryCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:2759:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var numWords int32
	var numHandlers int32
	var result int32
	var bodyToken uintptr
	var finallyToken uintptr
	var tokenPtr uintptr
	var handlerTokens uintptr
	var matchClauses uintptr
	var matchCodes uintptr
	var resultVarIndices uintptr
	var optionVarIndices uintptr
	var i int32
	// No handlers or finally; do nothing beyond evaluating the body.

	var mapPtr uintptr
	var eclIndex int32
	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	// var code int32 at bp+4, 4

	var cachePtr6 uintptr
	var cachePtr7 uintptr
	var cachePtr8 uintptr
	var cachePtr9 uintptr
	// var len int32 at bp+16, 4

	var varname uintptr
	var cachePtr10 uintptr
	// var len1 int32 at bp+20, 4

	var varname1 uintptr
	var cachePtr11 uintptr
	var tmpObj uintptr
	// var objv uintptr at bp+8, 8

	// var objc int32 at bp, 4

	var cachePtr12 uintptr
	numWords = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords
	result = TCL_ERROR
	handlerTokens = uintptr(0)
	matchClauses = uintptr(0)
	matchCodes = uintptr(0)
	resultVarIndices = uintptr(0)
	optionVarIndices = uintptr(0)

	if !(numWords < 2) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	bodyToken = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

	if !(numWords == 2) {
		goto __2
	}
	// No handlers or finally; do nothing beyond evaluating the body.

	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclCompileCmdWord(tls, interp, bodyToken+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(bodyToken)).FnumComponents, envPtr)
	return TCL_OK
__2:
	;

	numWords = numWords - 2
	tokenPtr = bodyToken + uintptr((*Tcl_Token)(unsafe.Pointer(bodyToken)).FnumComponents+1)*24

	// Extract information about what handlers there are.

	numHandlers = numWords >> 2
	numWords = numWords - numHandlers*4
	if !(numHandlers > 0) {
		goto __3
	}
	handlerTokens = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(numHandlers)))
	matchClauses = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(numHandlers)))
	libc.Xmemset(tls, matchClauses, 0, uint64(unsafe.Sizeof(uintptr(0)))*uint64(numHandlers))
	matchCodes = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64(numHandlers)))
	resultVarIndices = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64(numHandlers)))
	optionVarIndices = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64(numHandlers)))

	i = 0
__4:
	if !(i < numHandlers) {
		goto __6
	}

	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD) {
		goto __7
	}
	goto failedToCompile
__7:
	;
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize == 4 &&
		!(libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, ts+18165, uint64(4)) != 0)) {
		goto __8
	}
	// Parse the list of errorCode words to match against.

	*(*int32)(unsafe.Pointer(matchCodes + uintptr(i)*4)) = TCL_ERROR
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
__10:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __13
	}
	tmpObj = XTclThreadAllocObj(tls)
	goto __14
__13:
	tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__14:
	;
	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount++
	if !(!(XTclWordKnownAtCompileTime(tls, tokenPtr, tmpObj) != 0) ||
		XTcl_ListObjLength(tls, uintptr(0), tmpObj, bp) != TCL_OK ||
		*(*int32)(unsafe.Pointer(bp)) == 0) {
		goto __15
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount, 1) > 1) {
		goto __16
	}
	goto __17
__16:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __18
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != XtclEmptyStringRep) {
		goto __20
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes)
__20:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = -1
__21:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __24
	}
	XTclThreadFreeObj(tls, tmpObj)
	goto __25
__24:
	*(*uintptr)(unsafe.Pointer(tmpObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = tmpObj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__25:
	;
	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
	goto __19
__18:
	XTclFreeObj(tls, tmpObj)
__19:
	;
__17:
	;

	goto failedToCompile
__15:
	;
	XTcl_ListObjReplace(tls, uintptr(0), tmpObj, 0, 0, 0, uintptr(0))
	*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) = tmpObj
	goto __9
__8:
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize == 2 &&
		!(libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, ts+18162, uint64(2)) != 0)) {
		goto __26
	}

	// Parse the result code to look for.

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
__28:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __31
	}
	tmpObj = XTclThreadAllocObj(tls)
	goto __32
__31:
	tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__32:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount++
	if !!(XTclWordKnownAtCompileTime(tls, tokenPtr, tmpObj) != 0) {
		goto __33
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount, 1) > 1) {
		goto __34
	}
	goto __35
__34:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __36
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != XtclEmptyStringRep) {
		goto __38
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes)
__38:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = -1
__39:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __42
	}
	XTclThreadFreeObj(tls, tmpObj)
	goto __43
__42:
	*(*uintptr)(unsafe.Pointer(tmpObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = tmpObj
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__43:
	;
	goto __40
__40:
	if 0 != 0 {
		goto __39
	}
	goto __41
__41:
	;
	goto __37
__36:
	XTclFreeObj(tls, tmpObj)
__37:
	;
__35:
	;

	goto failedToCompile
__33:
	;
	if !(TCL_ERROR == XTclGetCompletionCodeFromObj(tls, uintptr(0), tmpObj, bp+4)) {
		goto __44
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount, 1) > 1) {
		goto __45
	}
	goto __46
__45:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __47
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != XtclEmptyStringRep) {
		goto __49
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes)
__49:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = -1
__50:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __53
	}
	XTclThreadFreeObj(tls, tmpObj)
	goto __54
__53:
	*(*uintptr)(unsafe.Pointer(tmpObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = tmpObj
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++
__54:
	;
	goto __51
__51:
	if 0 != 0 {
		goto __50
	}
	goto __52
__52:
	;
	goto __48
__47:
	XTclFreeObj(tls, tmpObj)
__48:
	;
__46:
	;

	goto failedToCompile
__44:
	;
	*(*int32)(unsafe.Pointer(matchCodes + uintptr(i)*4)) = *(*int32)(unsafe.Pointer(bp + 4 /* code */))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount, 1) > 1) {
		goto __55
	}
	goto __56
__55:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __57
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != XtclEmptyStringRep) {
		goto __59
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes)
__59:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = -1
__60:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __63
	}
	XTclThreadFreeObj(tls, tmpObj)
	goto __64
__63:
	*(*uintptr)(unsafe.Pointer(tmpObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = tmpObj
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++
__64:
	;
	goto __61
__61:
	if 0 != 0 {
		goto __60
	}
	goto __62
__62:
	;
	goto __58
__57:
	XTclFreeObj(tls, tmpObj)
__58:
	;
__56:
	;

	goto __27
__26:
	goto failedToCompile
__27:
	;
__9:
	;

	// Parse the variable binding.

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
__65:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0
	}()) {
		goto __68
	}
	tmpObj = XTclThreadAllocObj(tls)
	goto __69
__68:
	tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects--
__69:
	;
	goto __66
__66:
	if 0 != 0 {
		goto __65
	}
	goto __67
__67:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount++
	if !!(XTclWordKnownAtCompileTime(tls, tokenPtr, tmpObj) != 0) {
		goto __70
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount, 1) > 1) {
		goto __71
	}
	goto __72
__71:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __73
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != XtclEmptyStringRep) {
		goto __75
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes)
__75:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = -1
__76:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr7 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __79
	}
	XTclThreadFreeObj(tls, tmpObj)
	goto __80
__79:
	*(*uintptr)(unsafe.Pointer(tmpObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = tmpObj
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++
__80:
	;
	goto __77
__77:
	if 0 != 0 {
		goto __76
	}
	goto __78
__78:
	;
	goto __74
__73:
	XTclFreeObj(tls, tmpObj)
__74:
	;
__72:
	;

	goto failedToCompile
__70:
	;
	if !(XTcl_ListObjGetElements(tls, uintptr(0), tmpObj, bp, bp+8) != TCL_OK ||
		*(*int32)(unsafe.Pointer(bp)) > 2) {
		goto __81
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount, 1) > 1) {
		goto __82
	}
	goto __83
__82:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __84
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != XtclEmptyStringRep) {
		goto __86
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes)
__86:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = -1
__87:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr8 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __90
	}
	XTclThreadFreeObj(tls, tmpObj)
	goto __91
__90:
	*(*uintptr)(unsafe.Pointer(tmpObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = tmpObj
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects++
__91:
	;
	goto __88
__88:
	if 0 != 0 {
		goto __87
	}
	goto __89
__89:
	;
	goto __85
__84:
	XTclFreeObj(tls, tmpObj)
__85:
	;
__83:
	;

	goto failedToCompile
__81:
	;
	if !(*(*int32)(unsafe.Pointer(bp)) > 0) {
		goto __92
	}
	varname = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* objv */)))), bp+16)

	*(*int32)(unsafe.Pointer(resultVarIndices + uintptr(i)*4)) = XTclLocalScalar(tls, varname, *(*int32)(unsafe.Pointer(bp + 16 /* len */)), envPtr)
	if !(*(*int32)(unsafe.Pointer(resultVarIndices + uintptr(i)*4)) < 0) {
		goto __94
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount, 1) > 1) {
		goto __95
	}
	goto __96
__95:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __97
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != XtclEmptyStringRep) {
		goto __99
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes)
__99:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = -1
__100:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr9 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __103
	}
	XTclThreadFreeObj(tls, tmpObj)
	goto __104
__103:
	*(*uintptr)(unsafe.Pointer(tmpObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr = tmpObj
	(*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects++
__104:
	;
	goto __101
__101:
	if 0 != 0 {
		goto __100
	}
	goto __102
__102:
	;
	goto __98
__97:
	XTclFreeObj(tls, tmpObj)
__98:
	;
__96:
	;

	goto failedToCompile
__94:
	;
	goto __93
__92:
	*(*int32)(unsafe.Pointer(resultVarIndices + uintptr(i)*4)) = -1
__93:
	;
	if !(*(*int32)(unsafe.Pointer(bp)) == 2) {
		goto __105
	}
	varname1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* objv */)) + 1*8)), bp+20)

	*(*int32)(unsafe.Pointer(optionVarIndices + uintptr(i)*4)) = XTclLocalScalar(tls, varname1, *(*int32)(unsafe.Pointer(bp + 20 /* len1 */)), envPtr)
	if !(*(*int32)(unsafe.Pointer(optionVarIndices + uintptr(i)*4)) < 0) {
		goto __107
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount, 1) > 1) {
		goto __108
	}
	goto __109
__108:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __110
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != XtclEmptyStringRep) {
		goto __112
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes)
__112:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = -1
__113:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr10 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __116
	}
	XTclThreadFreeObj(tls, tmpObj)
	goto __117
__116:
	*(*uintptr)(unsafe.Pointer(tmpObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr = tmpObj
	(*AllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects++
__117:
	;
	goto __114
__114:
	if 0 != 0 {
		goto __113
	}
	goto __115
__115:
	;
	goto __111
__110:
	XTclFreeObj(tls, tmpObj)
__111:
	;
__109:
	;

	goto failedToCompile
__107:
	;
	goto __106
__105:
	*(*int32)(unsafe.Pointer(optionVarIndices + uintptr(i)*4)) = -1
__106:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount, 1) > 1) {
		goto __118
	}
	goto __119
__118:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __120
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != XtclEmptyStringRep) {
		goto __122
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes)
__122:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = -1
__123:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr11 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __126
	}
	XTclThreadFreeObj(tls, tmpObj)
	goto __127
__126:
	*(*uintptr)(unsafe.Pointer(tmpObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr = tmpObj
	(*AllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects++
__127:
	;
	goto __124
__124:
	if 0 != 0 {
		goto __123
	}
	goto __125
__125:
	;
	goto __121
__120:
	XTclFreeObj(tls, tmpObj)
__121:
	;
__119:
	;

	// Extract the body for this handler.

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD) {
		goto __128
	}
	goto failedToCompile
__128:
	;
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize == 1 && int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart))) == '-') {
		goto __129
	}
	*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8)) = uintptr(0)
	goto __130
__129:
	*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8)) = tokenPtr
__130:
	;

	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	goto __5
__5:
	i++
	goto __4
	goto __6
__6:
	;

	if !(*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(numHandlers-1)*8)) == uintptr(0)) {
		goto __131
	}
	goto failedToCompile
__131:
	;
__3:
	;

	// Parse the finally clause

	if !(numWords == 0) {
		goto __132
	}
	finallyToken = uintptr(0)
	goto __133
__132:
	if !(numWords == 2) {
		goto __134
	}
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD || (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize != 7 ||
		libc.Xstrncmp(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, ts+18154, uint64(7)) != 0) {
		goto __136
	}
	goto failedToCompile
__136:
	;
	finallyToken = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	goto __135
__134:
	goto failedToCompile
__135:
	;
__133:
	;

	// Issue the bytecode.

	if !!(finallyToken != 0) {
		goto __137
	}
	result = sIssueTryClausesInstructions(tls, interp, envPtr, bodyToken,
		numHandlers, matchCodes, matchClauses, resultVarIndices,
		optionVarIndices, handlerTokens)
	goto __138
__137:
	if !(numHandlers == 0) {
		goto __139
	}
	result = sIssueTryFinallyInstructions(tls, interp, envPtr, bodyToken,
		finallyToken)
	goto __140
__139:
	result = sIssueTryClausesFinallyInstructions(tls, interp, envPtr, bodyToken,
		numHandlers, matchCodes, matchClauses, resultVarIndices,
		optionVarIndices, handlerTokens, finallyToken)
__140:
	;
__138:
	;

	// Delete any temporary state and finish off.

failedToCompile:
	if !(numHandlers > 0) {
		goto __141
	}
	i = 0
__142:
	if !(i < numHandlers) {
		goto __144
	}
	if !(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) != 0) {
		goto __145
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).FrefCount, 1) > 1) {
		goto __146
	}
	goto __147
__146:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __148
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).Fbytes != XtclEmptyStringRep) {
		goto __150
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).Fbytes)
__150:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).Flength = -1
__151:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr12 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __154
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))
	goto __155
__154:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8))
	(*AllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects++
__155:
	;
	goto __152
__152:
	if 0 != 0 {
		goto __151
	}
	goto __153
__153:
	;
	goto __149
__148:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))
__149:
	;
__147:
	;

__145:
	;
	goto __143
__143:
	i++
	goto __142
	goto __144
__144:
	;
	XTclStackFree(tls, interp, optionVarIndices)
	XTclStackFree(tls, interp, resultVarIndices)
	XTclStackFree(tls, interp, matchCodes)
	XTclStackFree(tls, interp, matchClauses)
	XTclStackFree(tls, interp, handlerTokens)
__141:
	;
	return result
}

//----------------------------------------------------------------------
//
// IssueTryClausesInstructions, IssueTryClausesFinallyInstructions,
// IssueTryFinallyInstructions --
//
//	The code generators for [try]. Split from the parsing engine for
//	reasons of developer sanity, and also split between no-finally,
//	just-finally and with-finally cases because so many of the details of
//	generation vary between the three.
//
//	The macros below make the instruction issuing easier to follow.
//
//----------------------------------------------------------------------

func sIssueTryClausesInstructions(tls *libc.TLS, interp uintptr, envPtr uintptr, bodyToken uintptr, numHandlers int32, matchCodes uintptr, matchClauses uintptr, resultVars uintptr, optionVars uintptr, handlerTokens uintptr) int32 { /* tclCompCmdsSZ.c:2991:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var range1 int32
	var resultVar int32
	var optionsVar int32
	var i int32
	var j int32
	// var len int32 at bp+32, 4

	var forwardsNeedFixing int32 = 0
	var trapZero int32 = 0
	var afterBody int32 = 0
	var addrsToFix uintptr
	var forwardsToFix uintptr
	var notCodeJumpSource int32
	var notECJumpSource int32
	var noError uintptr
	// var buf [24]int8 at bp+8, 24

	resultVar = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
	optionsVar = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
	if resultVar < 0 || optionsVar < 0 {
		return TCL_ERROR
	}

	// Check if we're supposed to trap a normal TCL_OK completion of the body.
	// If not, we can handle that case much more efficiently.

	for i = 0; i < numHandlers; i++ {
		if *(*int32)(unsafe.Pointer(matchCodes + uintptr(i)*4)) == 0 {
			trapZero = 1
			break
		}
	}

	// Compile the body, trapping any error in it so that we can trap on it
	// and/or run a finally clause. Note that there must be at least one
	// on/trap clause; when none is present, this whole function is not called
	// (and it's never called when there's a finally clause).

	range1 = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_BEGIN_CATCH4 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - range1
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclCompileCmdWord(tls, interp, bodyToken+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(bodyToken)).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))
	if !(trapZero != 0) {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_END_CATCH == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		afterBody = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
		for ok6 := true; ok6; ok6 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok9 := true; ok9; ok9 = 0 != 0 {
			if -1 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
		}
	} else {
		for ok10 := true; ok10; ok10 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+18333, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok14 := true; ok14; ok14 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok15 := true; ok15; ok15 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok16 := true; ok16; ok16 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		for ok17 := true; ok17; ok17 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_REVERSE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok18 := true; ok18; ok18 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 2
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok20 := true; ok20; ok20 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(4))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok21 := true; ok21; ok21 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 4
					}
					for ok22 := true; ok22; ok22 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok23 := true; ok23; ok23 = 0 != 0 {
			if -2 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += -2
		}
	}
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok24 := true; ok24; ok24 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_CODE)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RETURN_CODE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok25 := true; ok25; ok25 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_CODE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok26 := true; ok26; ok26 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok27 := true; ok27; ok27 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RESULT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok28 := true; ok28; ok28 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok29 := true; ok29; ok29 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok30 := true; ok30; ok30 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok31 := true; ok31; ok31 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok32 := true; ok32; ok32 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok33 := true; ok33; ok33 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_END_CATCH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok34 := true; ok34; ok34 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok35 := true; ok35; ok35 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	if optionsVar < 256 {
		for ok36 := true; ok36; ok36 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok37 := true; ok37; ok37 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - optionsVar
					}
					for ok38 := true; ok38; ok38 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok39 := true; ok39; ok39 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok40 := true; ok40; ok40 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - optionsVar
					}
					for ok41 := true; ok41; ok41 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	for ok42 := true; ok42; ok42 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok43 := true; ok43; ok43 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok44 := true; ok44; ok44 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	if resultVar < 256 {
		for ok45 := true; ok45; ok45 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok46 := true; ok46; ok46 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - resultVar
					}
					for ok47 := true; ok47; ok47 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok48 := true; ok48; ok48 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STORE_SCALAR4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok49 := true; ok49; ok49 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - resultVar
					}
					for ok50 := true; ok50; ok50 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	for ok51 := true; ok51; ok51 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok52 := true; ok52; ok52 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok53 := true; ok53; ok53 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Now we handle all the registered 'on' and 'trap' handlers in order.
	// For us to be here, there must be at least one handler.
	//
	// Slight overallocation, but reduces size of this function.

	addrsToFix = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64(numHandlers)))
	forwardsToFix = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64(numHandlers)))
	noError = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64(numHandlers)))

	for i = 0; i < numHandlers; i++ {
		*(*int32)(unsafe.Pointer(noError + uintptr(i)*4)) = -1
		libc.Xsprintf(tls, bp+8, ts+324, libc.VaList(bp, *(*int32)(unsafe.Pointer(matchCodes + uintptr(i)*4))))
		for ok54 := true; ok54; ok54 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DUP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok55 := true; ok55; ok55 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DUP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok56 := true; ok56; ok56 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok57 := true; ok57; ok57 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, bp+8, int32(libc.Xstrlen(tls, bp+8)), 0)
			if _objIndexCopy <= 255 {
				for ok58 := true; ok58; ok58 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok59 := true; ok59; ok59 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok60 := true; ok60; ok60 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok61 := true; ok61; ok61 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok62 := true; ok62; ok62 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok63 := true; ok63; ok63 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		for ok64 := true; ok64; ok64 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EQ)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_EQ == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok65 := true; ok65; ok65 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_EQ].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok66 := true; ok66; ok66 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		notCodeJumpSource = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
		for ok67 := true; ok67; ok67 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP_FALSE4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok68 := true; ok68; ok68 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP_FALSE4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok69 := true; ok69; ok69 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		if *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) != 0 {
			var p uintptr
			XTcl_ListObjLength(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)), bp+32)

			// Match the errorcode according to try/trap rules.

			if optionsVar < 256 {
				for ok70 := true; ok70; ok70 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_SCALAR1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok71 := true; ok71; ok71 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - optionsVar
							}
							for ok72 := true; ok72; ok72 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok73 := true; ok73; ok73 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_SCALAR4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok74 := true; ok74; ok74 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - optionsVar
							}
							for ok75 := true; ok75; ok75 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}

			for ok76 := true; ok76; ok76 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+12045, int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)), 0)
				if _objIndexCopy <= 255 {
					for ok77 := true; ok77; ok77 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok78 := true; ok78; ok78 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok79 := true; ok79; ok79 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok80 := true; ok80; ok80 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok81 := true; ok81; ok81 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok82 := true; ok82; ok82 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
			for ok83 := true; ok83; ok83 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_GET)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_DICT_GET == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok84 := true; ok84; ok84 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_DICT_GET].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 1
						}
						for ok85 := true; ok85; ok85 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok86 := true; ok86; ok86 = 0 != 0 {
				if -1 < 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
					}
				}
				*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
			}
			for ok87 := true; ok87; ok87 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_RANGE_IMM)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LIST_RANGE_IMM == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok88 := true; ok88; ok88 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LIST_RANGE_IMM].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok89 := true; ok89; ok89 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok90 := true; ok90; ok90 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 32))-1) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 32))-1) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 32))-1) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 32)) - 1))
			}
			p = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)), bp+32)
			for ok91 := true; ok91; ok91 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, p, *(*int32)(unsafe.Pointer(bp + 32)), 0)
				if _objIndexCopy <= 255 {
					for ok92 := true; ok92; ok92 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok93 := true; ok93; ok93 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok94 := true; ok94; ok94 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok95 := true; ok95; ok95 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok96 := true; ok96; ok96 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok97 := true; ok97; ok97 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
			for ok98 := true; ok98; ok98 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STR_EQ == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok99 := true; ok99; ok99 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STR_EQ].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok100 := true; ok100; ok100 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			notECJumpSource = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
			for ok101 := true; ok101; ok101 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_JUMP_FALSE4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok102 := true; ok102; ok102 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_JUMP_FALSE4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok103 := true; ok103; ok103 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			notECJumpSource = -1 // LINT
		}
		for ok104 := true; ok104; ok104 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok105 := true; ok105; ok105 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok106 := true; ok106; ok106 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}

		// There is no finally clause, so we can avoid wrapping a catch
		// context around the handler. That simplifies what instructions need
		// to be issued a lot since we can let errors just fall through.

		if *(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4)) >= 0 {
			if resultVar < 256 {
				for ok107 := true; ok107; ok107 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_SCALAR1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok108 := true; ok108; ok108 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - resultVar
							}
							for ok109 := true; ok109; ok109 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok110 := true; ok110; ok110 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_SCALAR4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok111 := true; ok111; ok111 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - resultVar
							}
							for ok112 := true; ok112; ok112 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}

			if *(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4)) < 256 {
				for ok113 := true; ok113; ok113 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_SCALAR1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok114 := true; ok114; ok114 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))
							}
							for ok115 := true; ok115; ok115 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok116 := true; ok116; ok116 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_SCALAR4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok117 := true; ok117; ok117 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - *(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))
							}
							for ok118 := true; ok118; ok118 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}

			for ok119 := true; ok119; ok119 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_POP == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok120 := true; ok120; ok120 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok121 := true; ok121; ok121 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			if *(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4)) >= 0 {
				if optionsVar < 256 {
					for ok122 := true; ok122; ok122 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_LOAD_SCALAR1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok123 := true; ok123; ok123 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - optionsVar
								}
								for ok124 := true; ok124; ok124 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok125 := true; ok125; ok125 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_LOAD_SCALAR4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok126 := true; ok126; ok126 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - optionsVar
								}
								for ok127 := true; ok127; ok127 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}

				if *(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4)) < 256 {
					for ok128 := true; ok128; ok128 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_STORE_SCALAR1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok129 := true; ok129; ok129 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - *(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))
								}
								for ok130 := true; ok130; ok130 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok131 := true; ok131; ok131 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_STORE_SCALAR4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok132 := true; ok132; ok132 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - *(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))
								}
								for ok133 := true; ok133; ok133 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}

				for ok134 := true; ok134; ok134 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_POP == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok135 := true; ok135; ok135 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok136 := true; ok136; ok136 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		if !(int32(*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8))) != 0) {
			forwardsNeedFixing = 1
			*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(i)*4)) = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
			for ok137 := true; ok137; ok137 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_JUMP4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok138 := true; ok138; ok138 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_JUMP4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok139 := true; ok139; ok139 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok140 := true; ok140; ok140 = 0 != 0 {
				if 1 < 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
					}
				}
				*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
			}
		} else {
			var dontChangeOptions int32

			*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(i)*4)) = -1
			if forwardsNeedFixing != 0 {
				forwardsNeedFixing = 0
				for j = 0; j < i; j++ {
					if *(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)) == -1 {
						continue
					}
					for ok141 := true; ok141; ok141 = 0 != 0 {
						*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> 24)
						*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> 16)
						*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> 8)
						*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))))
					}
					*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)) = -1
				}
			}
			range1 = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
			for ok142 := true; ok142; ok142 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_BEGIN_CATCH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok143 := true; ok143; ok143 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - range1
						}
						for ok144 := true; ok144; ok144 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
			(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
					return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
				}
				return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
			}()
			(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(5+i*4)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(5+i*4)*8))
			XTclCompileCmdWord(tls, interp, *(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8))+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8)))).FnumComponents, envPtr)
			(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
			(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))
			for ok145 := true; ok145; ok145 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_END_CATCH == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok146 := true; ok146; ok146 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok147 := true; ok147; ok147 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			*(*int32)(unsafe.Pointer(noError + uintptr(i)*4)) = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
			for ok148 := true; ok148; ok148 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_JUMP4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok149 := true; ok149; ok149 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_JUMP4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok150 := true; ok150; ok150 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
			for ok151 := true; ok151; ok151 = 0 != 0 {
				if -1 < 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
					}
				}
				*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
			}
			for ok152 := true; ok152; ok152 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH_RESULT == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok153 := true; ok153; ok153 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok154 := true; ok154; ok154 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok155 := true; ok155; ok155 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok156 := true; ok156; ok156 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok157 := true; ok157; ok157 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok158 := true; ok158; ok158 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_CODE)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH_RETURN_CODE == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok159 := true; ok159; ok159 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_CODE].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok160 := true; ok160; ok160 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok161 := true; ok161; ok161 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_END_CATCH == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok162 := true; ok162; ok162 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok163 := true; ok163; ok163 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok164 := true; ok164; ok164 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
				if _objIndexCopy <= 255 {
					for ok165 := true; ok165; ok165 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok166 := true; ok166; ok166 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok167 := true; ok167; ok167 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok168 := true; ok168; ok168 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok169 := true; ok169; ok169 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok170 := true; ok170; ok170 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
			for ok171 := true; ok171; ok171 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EQ)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_EQ == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok172 := true; ok172; ok172 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_EQ].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok173 := true; ok173; ok173 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			dontChangeOptions = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
			for ok174 := true; ok174; ok174 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_JUMP_FALSE1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok175 := true; ok175; ok175 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok176 := true; ok176; ok176 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			if optionsVar < 256 {
				for ok177 := true; ok177; ok177 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_SCALAR1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok178 := true; ok178; ok178 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - optionsVar
							}
							for ok179 := true; ok179; ok179 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok180 := true; ok180; ok180 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_SCALAR4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok181 := true; ok181; ok181 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - optionsVar
							}
							for ok182 := true; ok182; ok182 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}

			for ok183 := true; ok183; ok183 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_REVERSE == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok184 := true; ok184; ok184 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 2
						}
						for ok185 := true; ok185; ok185 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			if optionsVar < 256 {
				for ok186 := true; ok186; ok186 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_SCALAR1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok187 := true; ok187; ok187 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - optionsVar
							}
							for ok188 := true; ok188; ok188 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok189 := true; ok189; ok189 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_STORE_SCALAR4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok190 := true; ok190; ok190 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - optionsVar
							}
							for ok191 := true; ok191; ok191 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}

			for ok192 := true; ok192; ok192 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_POP == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok193 := true; ok193; ok193 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok194 := true; ok194; ok194 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok195 := true; ok195; ok195 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+18170, int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)), 0)
				if _objIndexCopy <= 255 {
					for ok196 := true; ok196; ok196 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok197 := true; ok197; ok197 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok198 := true; ok198; ok198 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok199 := true; ok199; ok199 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok200 := true; ok200; ok200 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok201 := true; ok201; ok201 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
			for ok202 := true; ok202; ok202 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_REVERSE == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok203 := true; ok203; ok203 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 2
						}
						for ok204 := true; ok204; ok204 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok205 := true; ok205; ok205 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_SET)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_DICT_SET == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok206 := true; ok206; ok206 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_DICT_SET].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 1
						}
						for ok207 := true; ok207; ok207 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			for ok208 := true; ok208; ok208 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
			}
			for ok209 := true; ok209; ok209 = 0 != 0 {
				if -1 < 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
					}
				}
				*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
			}
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(dontChangeOptions) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(dontChangeOptions)))
			for ok210 := true; ok210; ok210 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_REVERSE == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok211 := true; ok211; ok211 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 2
						}
						for ok212 := true; ok212; ok212 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
			XTclEmitInvoke(tls, envPtr, INST_RETURN_STK, 0)
		}

		*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4)) = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
		for ok213 := true; ok213; ok213 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok214 := true; ok214; ok214 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok215 := true; ok215; ok215 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		if *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) != 0 {
			for ok216 := true; ok216; ok216 = 0 != 0 {
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notECJumpSource) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notECJumpSource)) >> 24)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notECJumpSource) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notECJumpSource)) >> 16)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notECJumpSource) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notECJumpSource)) >> 8)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notECJumpSource) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(notECJumpSource)))
			}
		}
		for ok217 := true; ok217; ok217 = 0 != 0 {
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notCodeJumpSource) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notCodeJumpSource)) >> 24)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notCodeJumpSource) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notCodeJumpSource)) >> 16)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notCodeJumpSource) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notCodeJumpSource)) >> 8)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notCodeJumpSource) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(notCodeJumpSource)))
		}
	}

	// Drop the result code since it didn't match any clause, and reissue the
	// exception. Note also that INST_RETURN_STK can proceed to the next
	// instruction.

	for ok218 := true; ok218; ok218 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok219 := true; ok219; ok219 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok220 := true; ok220; ok220 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	if optionsVar < 256 {
		for ok221 := true; ok221; ok221 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LOAD_SCALAR1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok222 := true; ok222; ok222 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - optionsVar
					}
					for ok223 := true; ok223; ok223 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok224 := true; ok224; ok224 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LOAD_SCALAR4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok225 := true; ok225; ok225 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - optionsVar
					}
					for ok226 := true; ok226; ok226 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	if resultVar < 256 {
		for ok227 := true; ok227; ok227 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LOAD_SCALAR1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok228 := true; ok228; ok228 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - resultVar
					}
					for ok229 := true; ok229; ok229 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else {
		for ok230 := true; ok230; ok230 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_LOAD_SCALAR4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok231 := true; ok231; ok231 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - resultVar
					}
					for ok232 := true; ok232; ok232 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	XTclEmitInvoke(tls, envPtr, INST_RETURN_STK, 0)

	// Fix all the jumps from taken clauses to here (which is the end of the
	// [try]).

	if !(trapZero != 0) {
		for ok233 := true; ok233; ok233 = 0 != 0 {
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(afterBody) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(afterBody)) >> 24)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(afterBody) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(afterBody)) >> 16)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(afterBody) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(afterBody)) >> 8)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(afterBody) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(afterBody)))
		}
	}
	for i = 0; i < numHandlers; i++ {
		for ok234 := true; ok234; ok234 = 0 != 0 {
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4))) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4)))) >> 24)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4))) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4)))) >> 16)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4))) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4)))) >> 8)
			*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4))) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4)))))
		}
		if *(*int32)(unsafe.Pointer(noError + uintptr(i)*4)) != -1 {
			for ok235 := true; ok235; ok235 = 0 != 0 {
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(noError + uintptr(i)*4))) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(noError + uintptr(i)*4)))) >> 24)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(noError + uintptr(i)*4))) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(noError + uintptr(i)*4)))) >> 16)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(noError + uintptr(i)*4))) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(noError + uintptr(i)*4)))) >> 8)
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(noError + uintptr(i)*4))) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(*(*int32)(unsafe.Pointer(noError + uintptr(i)*4)))))
			}
		}
	}
	XTclStackFree(tls, interp, noError)
	XTclStackFree(tls, interp, forwardsToFix)
	XTclStackFree(tls, interp, addrsToFix)
	return TCL_OK
}

func sIssueTryClausesFinallyInstructions(tls *libc.TLS, interp uintptr, envPtr uintptr, bodyToken uintptr, numHandlers int32, matchCodes uintptr, matchClauses uintptr, resultVars uintptr, optionVars uintptr, handlerTokens uintptr, finallyToken uintptr) int32 { /* tclCompCmdsSZ.c:3201:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var range1 int32
	var resultVar int32
	var optionsVar int32
	var i int32
	var j int32
	// var len int32 at bp+32, 4

	var forwardsNeedFixing int32
	var trapZero int32
	var afterBody int32
	var finalOK int32
	var finalError int32
	var noFinalError int32
	var addrsToFix uintptr
	var forwardsToFix uintptr
	var notCodeJumpSource int32
	var notECJumpSource int32
	// var buf [24]int8 at bp+8, 24

	var _delta int32
	var _delta1 int32
	var _delta2 int32
	var _delta3 int32
	var _delta4 int32
	var _delta5 int32
	var _delta6 int32
	var _objIndexCopy int32
	var _delta7 int32
	var _delta8 int32
	var _delta9 int32
	var _delta10 int32
	var _delta11 int32
	var _delta12 int32
	var _objIndexCopy1 int32
	var _delta13 int32
	var _delta14 int32
	var _delta15 int32
	var _delta16 int32
	var _delta17 int32
	var _delta18 int32
	var _delta19 int32
	var _delta20 int32
	var _delta21 int32
	var _delta22 int32
	var _delta23 int32
	var _delta24 int32
	var _delta25 int32
	var _delta26 int32
	var _delta27 int32
	var _objIndexCopy2 int32
	var _delta28 int32
	var _delta29 int32
	var _delta30 int32
	var _delta31 int32
	var _delta32 int32
	var _delta33 int32
	var _objIndexCopy3 int32
	var _delta34 int32
	var _delta35 int32
	var _delta36 int32
	var _delta37 int32
	var _objIndexCopy4 int32
	var _delta38 int32
	var _delta39 int32
	var _delta40 int32
	var _delta41 int32
	var _delta42 int32
	var _delta43 int32
	var _delta44 int32
	var _delta45 int32
	var _delta46 int32
	var _delta47 int32
	var _delta48 int32
	var _delta49 int32
	var _delta50 int32
	var _delta51 int32
	var _delta52 int32
	var _delta53 int32
	var _delta54 int32
	var _delta55 int32
	var _delta56 int32
	var _delta57 int32
	var _delta58 int32
	var _objIndexCopy5 int32
	var _delta59 int32
	var _delta60 int32
	var _delta61 int32
	var _delta62 int32
	var _delta63 int32
	var _delta64 int32
	var _delta65 int32
	var _delta66 int32
	var _delta67 int32
	var _delta68 int32
	var _delta69 int32
	var _delta70 int32
	var _objIndexCopy6 int32
	var _delta71 int32
	var _delta72 int32
	var _delta73 int32
	var _delta74 int32
	var _delta75 int32
	var _delta76 int32
	var _objIndexCopy7 int32
	var _delta77 int32
	var _delta78 int32
	var _delta79 int32
	var _delta80 int32
	var _delta81 int32
	var _delta82 int32
	var _delta83 int32
	var _delta84 int32
	var _delta85 int32
	var _delta86 int32
	var noTrapError int32
	var trapError int32
	var p uintptr
	var _delta87 int32
	var _delta88 int32
	var _delta89 int32
	var _delta90 int32
	var _delta91 int32
	var _delta92 int32
	var _delta93 int32
	var _delta94 int32
	var _delta95 int32
	var _delta96 int32
	var _delta97 int32
	var _objIndexCopy8 int32
	var _delta98 int32
	var _delta99 int32
	var _delta100 int32
	var _delta101 int32
	var _delta102 int32
	var _delta103 int32
	var _objIndexCopy9 int32
	var _delta104 int32
	var _delta105 int32
	var _delta106 int32
	var _delta107 int32
	var _delta108 int32
	var _delta109 int32
	var _delta110 int32
	var _delta111 int32
	var _delta112 int32
	var _delta113 int32
	var _delta114 int32
	var _delta115 int32
	var _delta116 int32
	var _delta117 int32
	var _delta118 int32
	var _delta119 int32
	var _delta120 int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	forwardsNeedFixing = 0
	trapZero = 0
	afterBody = 0

	resultVar = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
	optionsVar = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
	if !(resultVar < 0 || optionsVar < 0) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	// Check if we're supposed to trap a normal TCL_OK completion of the body.
	// If not, we can handle that case much more efficiently.

	i = 0
__2:
	if !(i < numHandlers) {
		goto __4
	}
	if !(*(*int32)(unsafe.Pointer(matchCodes + uintptr(i)*4)) == 0) {
		goto __5
	}
	trapZero = 1
	goto __4
__5:
	;
	goto __3
__3:
	i++
	goto __2
	goto __4
__4:
	;

	// Compile the body, trapping any error in it so that we can trap on it
	// (if any trap matches) and run a finally clause.

	range1 = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
__6:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __9
	}
	XTclExpandCodeArray(tls, envPtr)
__9:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __10
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_BEGIN_CATCH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__10:
	;
__11:
	_delta = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
	if !(_delta != 0) {
		goto __14
	}
	if !(_delta == -0x7fffffff-1) {
		goto __15
	}
	_delta = 1 - range1
__15:
	;
__16:
	if !(_delta < 0) {
		goto __19
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __20
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__20:
	;
__19:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
__14:
	;
	goto __12
__12:
	if 0 != 0 {
		goto __11
	}
	goto __13
__13:
	;
	goto __7
__7:
	if 0 != 0 {
		goto __6
	}
	goto __8
__8:
	;
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclCompileCmdWord(tls, interp, bodyToken+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(bodyToken)).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))
	if !!(trapZero != 0) {
		goto __21
	}
__23:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __26
	}
	XTclExpandCodeArray(tls, envPtr)
__26:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __27
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_END_CATCH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__27:
	;
__28:
	_delta1 = XtclInstructionTable[INST_END_CATCH].FstackEffect
	if !(_delta1 != 0) {
		goto __31
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __32
	}
	_delta1 = 1 - 0
__32:
	;
__33:
	if !(_delta1 < 0) {
		goto __36
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __37
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__37:
	;
__36:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
__31:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
	if !(resultVar < 256) {
		goto __38
	}
__40:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __43
	}
	XTclExpandCodeArray(tls, envPtr)
__43:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __44
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__44:
	;
__45:
	_delta2 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta2 != 0) {
		goto __48
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __49
	}
	_delta2 = 1 - resultVar
__49:
	;
__50:
	if !(_delta2 < 0) {
		goto __53
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __54
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__54:
	;
__53:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __51
__51:
	if 0 != 0 {
		goto __50
	}
	goto __52
__52:
	;
__48:
	;
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
	goto __41
__41:
	if 0 != 0 {
		goto __40
	}
	goto __42
__42:
	;
	goto __39
__38:
__55:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __58
	}
	XTclExpandCodeArray(tls, envPtr)
__58:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __59
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__59:
	;
__60:
	_delta3 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta3 != 0) {
		goto __63
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __64
	}
	_delta3 = 1 - resultVar
__64:
	;
__65:
	if !(_delta3 < 0) {
		goto __68
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __69
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__69:
	;
__68:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __66
__66:
	if 0 != 0 {
		goto __65
	}
	goto __67
__67:
	;
__63:
	;
	goto __61
__61:
	if 0 != 0 {
		goto __60
	}
	goto __62
__62:
	;
	goto __56
__56:
	if 0 != 0 {
		goto __55
	}
	goto __57
__57:
	;
__39:
	;

__70:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __73
	}
	XTclExpandCodeArray(tls, envPtr)
__73:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __74
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__74:
	;
__75:
	_delta4 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta4 != 0) {
		goto __78
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __79
	}
	_delta4 = 1 - 0
__79:
	;
__80:
	if !(_delta4 < 0) {
		goto __83
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __84
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__84:
	;
__83:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __81
__81:
	if 0 != 0 {
		goto __80
	}
	goto __82
__82:
	;
__78:
	;
	goto __76
__76:
	if 0 != 0 {
		goto __75
	}
	goto __77
__77:
	;
	goto __71
__71:
	if 0 != 0 {
		goto __70
	}
	goto __72
__72:
	;
__85:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, ts+19285, int32(uint64(unsafe.Sizeof([17]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy <= 255) {
		goto __88
	}
__90:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __93
	}
	XTclExpandCodeArray(tls, envPtr)
__93:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __94
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__94:
	;
__95:
	_delta5 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta5 != 0) {
		goto __98
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __99
	}
	_delta5 = 1 - _objIndexCopy
__99:
	;
__100:
	if !(_delta5 < 0) {
		goto __103
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __104
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__104:
	;
__103:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __101
__101:
	if 0 != 0 {
		goto __100
	}
	goto __102
__102:
	;
__98:
	;
	goto __96
__96:
	if 0 != 0 {
		goto __95
	}
	goto __97
__97:
	;
	goto __91
__91:
	if 0 != 0 {
		goto __90
	}
	goto __92
__92:
	;
	goto __89
__88:
__105:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __108
	}
	XTclExpandCodeArray(tls, envPtr)
__108:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __109
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__109:
	;
__110:
	_delta6 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta6 != 0) {
		goto __113
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __114
	}
	_delta6 = 1 - _objIndexCopy
__114:
	;
__115:
	if !(_delta6 < 0) {
		goto __118
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __119
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__119:
	;
__118:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __116
__116:
	if 0 != 0 {
		goto __115
	}
	goto __117
__117:
	;
__113:
	;
	goto __111
__111:
	if 0 != 0 {
		goto __110
	}
	goto __112
__112:
	;
	goto __106
__106:
	if 0 != 0 {
		goto __105
	}
	goto __107
__107:
	;
__89:
	;
	goto __86
__86:
	if 0 != 0 {
		goto __85
	}
	goto __87
__87:
	;
	if !(optionsVar < 256) {
		goto __120
	}
__122:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __125
	}
	XTclExpandCodeArray(tls, envPtr)
__125:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __126
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__126:
	;
__127:
	_delta7 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta7 != 0) {
		goto __130
	}
	if !(_delta7 == -0x7fffffff-1) {
		goto __131
	}
	_delta7 = 1 - optionsVar
__131:
	;
__132:
	if !(_delta7 < 0) {
		goto __135
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __136
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__136:
	;
__135:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta7
	goto __133
__133:
	if 0 != 0 {
		goto __132
	}
	goto __134
__134:
	;
__130:
	;
	goto __128
__128:
	if 0 != 0 {
		goto __127
	}
	goto __129
__129:
	;
	goto __123
__123:
	if 0 != 0 {
		goto __122
	}
	goto __124
__124:
	;
	goto __121
__120:
__137:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __140
	}
	XTclExpandCodeArray(tls, envPtr)
__140:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __141
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__141:
	;
__142:
	_delta8 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta8 != 0) {
		goto __145
	}
	if !(_delta8 == -0x7fffffff-1) {
		goto __146
	}
	_delta8 = 1 - optionsVar
__146:
	;
__147:
	if !(_delta8 < 0) {
		goto __150
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __151
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__151:
	;
__150:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta8
	goto __148
__148:
	if 0 != 0 {
		goto __147
	}
	goto __149
__149:
	;
__145:
	;
	goto __143
__143:
	if 0 != 0 {
		goto __142
	}
	goto __144
__144:
	;
	goto __138
__138:
	if 0 != 0 {
		goto __137
	}
	goto __139
__139:
	;
__121:
	;

__152:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __155
	}
	XTclExpandCodeArray(tls, envPtr)
__155:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __156
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__156:
	;
__157:
	_delta9 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta9 != 0) {
		goto __160
	}
	if !(_delta9 == -0x7fffffff-1) {
		goto __161
	}
	_delta9 = 1 - 0
__161:
	;
__162:
	if !(_delta9 < 0) {
		goto __165
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __166
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__166:
	;
__165:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta9
	goto __163
__163:
	if 0 != 0 {
		goto __162
	}
	goto __164
__164:
	;
__160:
	;
	goto __158
__158:
	if 0 != 0 {
		goto __157
	}
	goto __159
__159:
	;
	goto __153
__153:
	if 0 != 0 {
		goto __152
	}
	goto __154
__154:
	;
	afterBody = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__167:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __170
	}
	XTclExpandCodeArray(tls, envPtr)
__170:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __171
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__171:
	;
__172:
	_delta10 = XtclInstructionTable[INST_JUMP4].FstackEffect
	if !(_delta10 != 0) {
		goto __175
	}
	if !(_delta10 == -0x7fffffff-1) {
		goto __176
	}
	_delta10 = 1 - 0
__176:
	;
__177:
	if !(_delta10 < 0) {
		goto __180
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __181
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__181:
	;
__180:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta10
	goto __178
__178:
	if 0 != 0 {
		goto __177
	}
	goto __179
__179:
	;
__175:
	;
	goto __173
__173:
	if 0 != 0 {
		goto __172
	}
	goto __174
__174:
	;
	goto __168
__168:
	if 0 != 0 {
		goto __167
	}
	goto __169
__169:
	;
	goto __22
__21:
__182:
	_objIndexCopy1 = XTclRegisterLiteral(tls, envPtr, ts+18333, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy1 <= 255) {
		goto __185
	}
__187:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __190
	}
	XTclExpandCodeArray(tls, envPtr)
__190:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __191
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__191:
	;
__192:
	_delta11 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta11 != 0) {
		goto __195
	}
	if !(_delta11 == -0x7fffffff-1) {
		goto __196
	}
	_delta11 = 1 - _objIndexCopy1
__196:
	;
__197:
	if !(_delta11 < 0) {
		goto __200
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __201
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__201:
	;
__200:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta11
	goto __198
__198:
	if 0 != 0 {
		goto __197
	}
	goto __199
__199:
	;
__195:
	;
	goto __193
__193:
	if 0 != 0 {
		goto __192
	}
	goto __194
__194:
	;
	goto __188
__188:
	if 0 != 0 {
		goto __187
	}
	goto __189
__189:
	;
	goto __186
__185:
__202:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __205
	}
	XTclExpandCodeArray(tls, envPtr)
__205:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __206
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__206:
	;
__207:
	_delta12 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta12 != 0) {
		goto __210
	}
	if !(_delta12 == -0x7fffffff-1) {
		goto __211
	}
	_delta12 = 1 - _objIndexCopy1
__211:
	;
__212:
	if !(_delta12 < 0) {
		goto __215
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __216
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__216:
	;
__215:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta12
	goto __213
__213:
	if 0 != 0 {
		goto __212
	}
	goto __214
__214:
	;
__210:
	;
	goto __208
__208:
	if 0 != 0 {
		goto __207
	}
	goto __209
__209:
	;
	goto __203
__203:
	if 0 != 0 {
		goto __202
	}
	goto __204
__204:
	;
__186:
	;
	goto __183
__183:
	if 0 != 0 {
		goto __182
	}
	goto __184
__184:
	;
__217:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __220
	}
	XTclExpandCodeArray(tls, envPtr)
__220:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __221
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__221:
	;
__222:
	_delta13 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta13 != 0) {
		goto __225
	}
	if !(_delta13 == -0x7fffffff-1) {
		goto __226
	}
	_delta13 = 1 - 2
__226:
	;
__227:
	if !(_delta13 < 0) {
		goto __230
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __231
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__231:
	;
__230:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta13
	goto __228
__228:
	if 0 != 0 {
		goto __227
	}
	goto __229
__229:
	;
__225:
	;
	goto __223
__223:
	if 0 != 0 {
		goto __222
	}
	goto __224
__224:
	;
	goto __218
__218:
	if 0 != 0 {
		goto __217
	}
	goto __219
__219:
	;
__232:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __235
	}
	XTclExpandCodeArray(tls, envPtr)
__235:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __236
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__236:
	;
__237:
	_delta14 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta14 != 0) {
		goto __240
	}
	if !(_delta14 == -0x7fffffff-1) {
		goto __241
	}
	_delta14 = 1 - 4
__241:
	;
__242:
	if !(_delta14 < 0) {
		goto __245
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __246
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__246:
	;
__245:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta14
	goto __243
__243:
	if 0 != 0 {
		goto __242
	}
	goto __244
__244:
	;
__240:
	;
	goto __238
__238:
	if 0 != 0 {
		goto __237
	}
	goto __239
__239:
	;
	goto __233
__233:
	if 0 != 0 {
		goto __232
	}
	goto __234
__234:
	;
__247:
	if !(-2 < 0) {
		goto __250
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __251
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__251:
	;
__250:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += -2
	goto __248
__248:
	if 0 != 0 {
		goto __247
	}
	goto __249
__249:
	;
__22:
	;
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__252:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __255
	}
	XTclExpandCodeArray(tls, envPtr)
__255:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_CODE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __256
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RETURN_CODE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__256:
	;
__257:
	_delta15 = XtclInstructionTable[INST_PUSH_RETURN_CODE].FstackEffect
	if !(_delta15 != 0) {
		goto __260
	}
	if !(_delta15 == -0x7fffffff-1) {
		goto __261
	}
	_delta15 = 1 - 0
__261:
	;
__262:
	if !(_delta15 < 0) {
		goto __265
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __266
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__266:
	;
__265:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta15
	goto __263
__263:
	if 0 != 0 {
		goto __262
	}
	goto __264
__264:
	;
__260:
	;
	goto __258
__258:
	if 0 != 0 {
		goto __257
	}
	goto __259
__259:
	;
	goto __253
__253:
	if 0 != 0 {
		goto __252
	}
	goto __254
__254:
	;
__267:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __270
	}
	XTclExpandCodeArray(tls, envPtr)
__270:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __271
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RESULT == INST_START_CMD {
			return 1
		}
		return 0
	}()
__271:
	;
__272:
	_delta16 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
	if !(_delta16 != 0) {
		goto __275
	}
	if !(_delta16 == -0x7fffffff-1) {
		goto __276
	}
	_delta16 = 1 - 0
__276:
	;
__277:
	if !(_delta16 < 0) {
		goto __280
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __281
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__281:
	;
__280:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta16
	goto __278
__278:
	if 0 != 0 {
		goto __277
	}
	goto __279
__279:
	;
__275:
	;
	goto __273
__273:
	if 0 != 0 {
		goto __272
	}
	goto __274
__274:
	;
	goto __268
__268:
	if 0 != 0 {
		goto __267
	}
	goto __269
__269:
	;
__282:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __285
	}
	XTclExpandCodeArray(tls, envPtr)
__285:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __286
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
			return 1
		}
		return 0
	}()
__286:
	;
__287:
	_delta17 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
	if !(_delta17 != 0) {
		goto __290
	}
	if !(_delta17 == -0x7fffffff-1) {
		goto __291
	}
	_delta17 = 1 - 0
__291:
	;
__292:
	if !(_delta17 < 0) {
		goto __295
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __296
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__296:
	;
__295:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta17
	goto __293
__293:
	if 0 != 0 {
		goto __292
	}
	goto __294
__294:
	;
__290:
	;
	goto __288
__288:
	if 0 != 0 {
		goto __287
	}
	goto __289
__289:
	;
	goto __283
__283:
	if 0 != 0 {
		goto __282
	}
	goto __284
__284:
	;
__297:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __300
	}
	XTclExpandCodeArray(tls, envPtr)
__300:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __301
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_END_CATCH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__301:
	;
__302:
	_delta18 = XtclInstructionTable[INST_END_CATCH].FstackEffect
	if !(_delta18 != 0) {
		goto __305
	}
	if !(_delta18 == -0x7fffffff-1) {
		goto __306
	}
	_delta18 = 1 - 0
__306:
	;
__307:
	if !(_delta18 < 0) {
		goto __310
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __311
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__311:
	;
__310:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta18
	goto __308
__308:
	if 0 != 0 {
		goto __307
	}
	goto __309
__309:
	;
__305:
	;
	goto __303
__303:
	if 0 != 0 {
		goto __302
	}
	goto __304
__304:
	;
	goto __298
__298:
	if 0 != 0 {
		goto __297
	}
	goto __299
__299:
	;
	if !(optionsVar < 256) {
		goto __312
	}
__314:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __317
	}
	XTclExpandCodeArray(tls, envPtr)
__317:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __318
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__318:
	;
__319:
	_delta19 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta19 != 0) {
		goto __322
	}
	if !(_delta19 == -0x7fffffff-1) {
		goto __323
	}
	_delta19 = 1 - optionsVar
__323:
	;
__324:
	if !(_delta19 < 0) {
		goto __327
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __328
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__328:
	;
__327:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta19
	goto __325
__325:
	if 0 != 0 {
		goto __324
	}
	goto __326
__326:
	;
__322:
	;
	goto __320
__320:
	if 0 != 0 {
		goto __319
	}
	goto __321
__321:
	;
	goto __315
__315:
	if 0 != 0 {
		goto __314
	}
	goto __316
__316:
	;
	goto __313
__312:
__329:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __332
	}
	XTclExpandCodeArray(tls, envPtr)
__332:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __333
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__333:
	;
__334:
	_delta20 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta20 != 0) {
		goto __337
	}
	if !(_delta20 == -0x7fffffff-1) {
		goto __338
	}
	_delta20 = 1 - optionsVar
__338:
	;
__339:
	if !(_delta20 < 0) {
		goto __342
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __343
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__343:
	;
__342:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta20
	goto __340
__340:
	if 0 != 0 {
		goto __339
	}
	goto __341
__341:
	;
__337:
	;
	goto __335
__335:
	if 0 != 0 {
		goto __334
	}
	goto __336
__336:
	;
	goto __330
__330:
	if 0 != 0 {
		goto __329
	}
	goto __331
__331:
	;
__313:
	;

__344:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __347
	}
	XTclExpandCodeArray(tls, envPtr)
__347:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __348
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__348:
	;
__349:
	_delta21 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta21 != 0) {
		goto __352
	}
	if !(_delta21 == -0x7fffffff-1) {
		goto __353
	}
	_delta21 = 1 - 0
__353:
	;
__354:
	if !(_delta21 < 0) {
		goto __357
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __358
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__358:
	;
__357:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta21
	goto __355
__355:
	if 0 != 0 {
		goto __354
	}
	goto __356
__356:
	;
__352:
	;
	goto __350
__350:
	if 0 != 0 {
		goto __349
	}
	goto __351
__351:
	;
	goto __345
__345:
	if 0 != 0 {
		goto __344
	}
	goto __346
__346:
	;
	if !(resultVar < 256) {
		goto __359
	}
__361:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __364
	}
	XTclExpandCodeArray(tls, envPtr)
__364:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __365
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__365:
	;
__366:
	_delta22 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta22 != 0) {
		goto __369
	}
	if !(_delta22 == -0x7fffffff-1) {
		goto __370
	}
	_delta22 = 1 - resultVar
__370:
	;
__371:
	if !(_delta22 < 0) {
		goto __374
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __375
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__375:
	;
__374:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta22
	goto __372
__372:
	if 0 != 0 {
		goto __371
	}
	goto __373
__373:
	;
__369:
	;
	goto __367
__367:
	if 0 != 0 {
		goto __366
	}
	goto __368
__368:
	;
	goto __362
__362:
	if 0 != 0 {
		goto __361
	}
	goto __363
__363:
	;
	goto __360
__359:
__376:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __379
	}
	XTclExpandCodeArray(tls, envPtr)
__379:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __380
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__380:
	;
__381:
	_delta23 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta23 != 0) {
		goto __384
	}
	if !(_delta23 == -0x7fffffff-1) {
		goto __385
	}
	_delta23 = 1 - resultVar
__385:
	;
__386:
	if !(_delta23 < 0) {
		goto __389
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __390
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__390:
	;
__389:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta23
	goto __387
__387:
	if 0 != 0 {
		goto __386
	}
	goto __388
__388:
	;
__384:
	;
	goto __382
__382:
	if 0 != 0 {
		goto __381
	}
	goto __383
__383:
	;
	goto __377
__377:
	if 0 != 0 {
		goto __376
	}
	goto __378
__378:
	;
__360:
	;

__391:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __394
	}
	XTclExpandCodeArray(tls, envPtr)
__394:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __395
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__395:
	;
__396:
	_delta24 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta24 != 0) {
		goto __399
	}
	if !(_delta24 == -0x7fffffff-1) {
		goto __400
	}
	_delta24 = 1 - 0
__400:
	;
__401:
	if !(_delta24 < 0) {
		goto __404
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __405
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__405:
	;
__404:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta24
	goto __402
__402:
	if 0 != 0 {
		goto __401
	}
	goto __403
__403:
	;
__399:
	;
	goto __397
__397:
	if 0 != 0 {
		goto __396
	}
	goto __398
__398:
	;
	goto __392
__392:
	if 0 != 0 {
		goto __391
	}
	goto __393
__393:
	;

	// Now we handle all the registered 'on' and 'trap' handlers in order.
	//
	// Slight overallocation, but reduces size of this function.

	addrsToFix = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64(numHandlers)))
	forwardsToFix = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(int32(0)))*uint64(numHandlers)))

	i = 0
__406:
	if !(i < numHandlers) {
		goto __408
	}

	libc.Xsprintf(tls, bp+8, ts+324, libc.VaList(bp, *(*int32)(unsafe.Pointer(matchCodes + uintptr(i)*4))))
__409:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __412
	}
	XTclExpandCodeArray(tls, envPtr)
__412:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DUP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __413
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DUP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__413:
	;
__414:
	_delta25 = XtclInstructionTable[INST_DUP].FstackEffect
	if !(_delta25 != 0) {
		goto __417
	}
	if !(_delta25 == -0x7fffffff-1) {
		goto __418
	}
	_delta25 = 1 - 0
__418:
	;
__419:
	if !(_delta25 < 0) {
		goto __422
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __423
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__423:
	;
__422:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta25
	goto __420
__420:
	if 0 != 0 {
		goto __419
	}
	goto __421
__421:
	;
__417:
	;
	goto __415
__415:
	if 0 != 0 {
		goto __414
	}
	goto __416
__416:
	;
	goto __410
__410:
	if 0 != 0 {
		goto __409
	}
	goto __411
__411:
	;
__424:
	_objIndexCopy2 = XTclRegisterLiteral(tls, envPtr, bp+8, int32(libc.Xstrlen(tls, bp+8)), 0)
	if !(_objIndexCopy2 <= 255) {
		goto __427
	}
__429:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __432
	}
	XTclExpandCodeArray(tls, envPtr)
__432:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __433
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__433:
	;
__434:
	_delta26 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta26 != 0) {
		goto __437
	}
	if !(_delta26 == -0x7fffffff-1) {
		goto __438
	}
	_delta26 = 1 - _objIndexCopy2
__438:
	;
__439:
	if !(_delta26 < 0) {
		goto __442
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __443
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__443:
	;
__442:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta26
	goto __440
__440:
	if 0 != 0 {
		goto __439
	}
	goto __441
__441:
	;
__437:
	;
	goto __435
__435:
	if 0 != 0 {
		goto __434
	}
	goto __436
__436:
	;
	goto __430
__430:
	if 0 != 0 {
		goto __429
	}
	goto __431
__431:
	;
	goto __428
__427:
__444:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __447
	}
	XTclExpandCodeArray(tls, envPtr)
__447:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy2))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __448
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__448:
	;
__449:
	_delta27 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta27 != 0) {
		goto __452
	}
	if !(_delta27 == -0x7fffffff-1) {
		goto __453
	}
	_delta27 = 1 - _objIndexCopy2
__453:
	;
__454:
	if !(_delta27 < 0) {
		goto __457
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __458
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__458:
	;
__457:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta27
	goto __455
__455:
	if 0 != 0 {
		goto __454
	}
	goto __456
__456:
	;
__452:
	;
	goto __450
__450:
	if 0 != 0 {
		goto __449
	}
	goto __451
__451:
	;
	goto __445
__445:
	if 0 != 0 {
		goto __444
	}
	goto __446
__446:
	;
__428:
	;
	goto __425
__425:
	if 0 != 0 {
		goto __424
	}
	goto __426
__426:
	;
__459:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __462
	}
	XTclExpandCodeArray(tls, envPtr)
__462:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EQ)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __463
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_EQ == INST_START_CMD {
			return 1
		}
		return 0
	}()
__463:
	;
__464:
	_delta28 = XtclInstructionTable[INST_EQ].FstackEffect
	if !(_delta28 != 0) {
		goto __467
	}
	if !(_delta28 == -0x7fffffff-1) {
		goto __468
	}
	_delta28 = 1 - 0
__468:
	;
__469:
	if !(_delta28 < 0) {
		goto __472
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __473
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__473:
	;
__472:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta28
	goto __470
__470:
	if 0 != 0 {
		goto __469
	}
	goto __471
__471:
	;
__467:
	;
	goto __465
__465:
	if 0 != 0 {
		goto __464
	}
	goto __466
__466:
	;
	goto __460
__460:
	if 0 != 0 {
		goto __459
	}
	goto __461
__461:
	;
	notCodeJumpSource = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__474:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __477
	}
	XTclExpandCodeArray(tls, envPtr)
__477:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __478
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_FALSE4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__478:
	;
__479:
	_delta29 = XtclInstructionTable[INST_JUMP_FALSE4].FstackEffect
	if !(_delta29 != 0) {
		goto __482
	}
	if !(_delta29 == -0x7fffffff-1) {
		goto __483
	}
	_delta29 = 1 - 0
__483:
	;
__484:
	if !(_delta29 < 0) {
		goto __487
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __488
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__488:
	;
__487:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta29
	goto __485
__485:
	if 0 != 0 {
		goto __484
	}
	goto __486
__486:
	;
__482:
	;
	goto __480
__480:
	if 0 != 0 {
		goto __479
	}
	goto __481
__481:
	;
	goto __475
__475:
	if 0 != 0 {
		goto __474
	}
	goto __476
__476:
	;
	if !(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) != 0) {
		goto __489
	}
	XTcl_ListObjLength(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)), bp+32)

	// Match the errorcode according to try/trap rules.

	if !(optionsVar < 256) {
		goto __491
	}
__493:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __496
	}
	XTclExpandCodeArray(tls, envPtr)
__496:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __497
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__497:
	;
__498:
	_delta30 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
	if !(_delta30 != 0) {
		goto __501
	}
	if !(_delta30 == -0x7fffffff-1) {
		goto __502
	}
	_delta30 = 1 - optionsVar
__502:
	;
__503:
	if !(_delta30 < 0) {
		goto __506
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __507
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__507:
	;
__506:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta30
	goto __504
__504:
	if 0 != 0 {
		goto __503
	}
	goto __505
__505:
	;
__501:
	;
	goto __499
__499:
	if 0 != 0 {
		goto __498
	}
	goto __500
__500:
	;
	goto __494
__494:
	if 0 != 0 {
		goto __493
	}
	goto __495
__495:
	;
	goto __492
__491:
__508:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __511
	}
	XTclExpandCodeArray(tls, envPtr)
__511:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __512
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__512:
	;
__513:
	_delta31 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
	if !(_delta31 != 0) {
		goto __516
	}
	if !(_delta31 == -0x7fffffff-1) {
		goto __517
	}
	_delta31 = 1 - optionsVar
__517:
	;
__518:
	if !(_delta31 < 0) {
		goto __521
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __522
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__522:
	;
__521:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta31
	goto __519
__519:
	if 0 != 0 {
		goto __518
	}
	goto __520
__520:
	;
__516:
	;
	goto __514
__514:
	if 0 != 0 {
		goto __513
	}
	goto __515
__515:
	;
	goto __509
__509:
	if 0 != 0 {
		goto __508
	}
	goto __510
__510:
	;
__492:
	;

__523:
	_objIndexCopy3 = XTclRegisterLiteral(tls, envPtr, ts+12045, int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy3 <= 255) {
		goto __526
	}
__528:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __531
	}
	XTclExpandCodeArray(tls, envPtr)
__531:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __532
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__532:
	;
__533:
	_delta32 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta32 != 0) {
		goto __536
	}
	if !(_delta32 == -0x7fffffff-1) {
		goto __537
	}
	_delta32 = 1 - _objIndexCopy3
__537:
	;
__538:
	if !(_delta32 < 0) {
		goto __541
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __542
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__542:
	;
__541:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta32
	goto __539
__539:
	if 0 != 0 {
		goto __538
	}
	goto __540
__540:
	;
__536:
	;
	goto __534
__534:
	if 0 != 0 {
		goto __533
	}
	goto __535
__535:
	;
	goto __529
__529:
	if 0 != 0 {
		goto __528
	}
	goto __530
__530:
	;
	goto __527
__526:
__543:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __546
	}
	XTclExpandCodeArray(tls, envPtr)
__546:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __547
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__547:
	;
__548:
	_delta33 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta33 != 0) {
		goto __551
	}
	if !(_delta33 == -0x7fffffff-1) {
		goto __552
	}
	_delta33 = 1 - _objIndexCopy3
__552:
	;
__553:
	if !(_delta33 < 0) {
		goto __556
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __557
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__557:
	;
__556:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta33
	goto __554
__554:
	if 0 != 0 {
		goto __553
	}
	goto __555
__555:
	;
__551:
	;
	goto __549
__549:
	if 0 != 0 {
		goto __548
	}
	goto __550
__550:
	;
	goto __544
__544:
	if 0 != 0 {
		goto __543
	}
	goto __545
__545:
	;
__527:
	;
	goto __524
__524:
	if 0 != 0 {
		goto __523
	}
	goto __525
__525:
	;
__558:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __561
	}
	XTclExpandCodeArray(tls, envPtr)
__561:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_GET)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __562
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DICT_GET == INST_START_CMD {
			return 1
		}
		return 0
	}()
__562:
	;
__563:
	_delta34 = XtclInstructionTable[INST_DICT_GET].FstackEffect
	if !(_delta34 != 0) {
		goto __566
	}
	if !(_delta34 == -0x7fffffff-1) {
		goto __567
	}
	_delta34 = 1 - 1
__567:
	;
__568:
	if !(_delta34 < 0) {
		goto __571
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __572
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__572:
	;
__571:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta34
	goto __569
__569:
	if 0 != 0 {
		goto __568
	}
	goto __570
__570:
	;
__566:
	;
	goto __564
__564:
	if 0 != 0 {
		goto __563
	}
	goto __565
__565:
	;
	goto __559
__559:
	if 0 != 0 {
		goto __558
	}
	goto __560
__560:
	;
__573:
	if !(-1 < 0) {
		goto __576
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __577
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__577:
	;
__576:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	goto __574
__574:
	if 0 != 0 {
		goto __573
	}
	goto __575
__575:
	;
__578:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __581
	}
	XTclExpandCodeArray(tls, envPtr)
__581:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_RANGE_IMM)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __582
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LIST_RANGE_IMM == INST_START_CMD {
			return 1
		}
		return 0
	}()
__582:
	;
__583:
	_delta35 = XtclInstructionTable[INST_LIST_RANGE_IMM].FstackEffect
	if !(_delta35 != 0) {
		goto __586
	}
	if !(_delta35 == -0x7fffffff-1) {
		goto __587
	}
	_delta35 = 1 - 0
__587:
	;
__588:
	if !(_delta35 < 0) {
		goto __591
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __592
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__592:
	;
__591:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta35
	goto __589
__589:
	if 0 != 0 {
		goto __588
	}
	goto __590
__590:
	;
__586:
	;
	goto __584
__584:
	if 0 != 0 {
		goto __583
	}
	goto __585
__585:
	;
	goto __579
__579:
	if 0 != 0 {
		goto __578
	}
	goto __580
__580:
	;
__593:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __596
	}
	XTclExpandCodeArray(tls, envPtr)
__596:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 32))-1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 32))-1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 32))-1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 32)) - 1))
	goto __594
__594:
	if 0 != 0 {
		goto __593
	}
	goto __595
__595:
	;
	p = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)), bp+32)
__597:
	_objIndexCopy4 = XTclRegisterLiteral(tls, envPtr, p, *(*int32)(unsafe.Pointer(bp + 32)), 0)
	if !(_objIndexCopy4 <= 255) {
		goto __600
	}
__602:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __605
	}
	XTclExpandCodeArray(tls, envPtr)
__605:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __606
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__606:
	;
__607:
	_delta36 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta36 != 0) {
		goto __610
	}
	if !(_delta36 == -0x7fffffff-1) {
		goto __611
	}
	_delta36 = 1 - _objIndexCopy4
__611:
	;
__612:
	if !(_delta36 < 0) {
		goto __615
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __616
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__616:
	;
__615:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta36
	goto __613
__613:
	if 0 != 0 {
		goto __612
	}
	goto __614
__614:
	;
__610:
	;
	goto __608
__608:
	if 0 != 0 {
		goto __607
	}
	goto __609
__609:
	;
	goto __603
__603:
	if 0 != 0 {
		goto __602
	}
	goto __604
__604:
	;
	goto __601
__600:
__617:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __620
	}
	XTclExpandCodeArray(tls, envPtr)
__620:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy4))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __621
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__621:
	;
__622:
	_delta37 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta37 != 0) {
		goto __625
	}
	if !(_delta37 == -0x7fffffff-1) {
		goto __626
	}
	_delta37 = 1 - _objIndexCopy4
__626:
	;
__627:
	if !(_delta37 < 0) {
		goto __630
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __631
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__631:
	;
__630:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta37
	goto __628
__628:
	if 0 != 0 {
		goto __627
	}
	goto __629
__629:
	;
__625:
	;
	goto __623
__623:
	if 0 != 0 {
		goto __622
	}
	goto __624
__624:
	;
	goto __618
__618:
	if 0 != 0 {
		goto __617
	}
	goto __619
__619:
	;
__601:
	;
	goto __598
__598:
	if 0 != 0 {
		goto __597
	}
	goto __599
__599:
	;
__632:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __635
	}
	XTclExpandCodeArray(tls, envPtr)
__635:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_EQ)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __636
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STR_EQ == INST_START_CMD {
			return 1
		}
		return 0
	}()
__636:
	;
__637:
	_delta38 = XtclInstructionTable[INST_STR_EQ].FstackEffect
	if !(_delta38 != 0) {
		goto __640
	}
	if !(_delta38 == -0x7fffffff-1) {
		goto __641
	}
	_delta38 = 1 - 0
__641:
	;
__642:
	if !(_delta38 < 0) {
		goto __645
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __646
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__646:
	;
__645:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta38
	goto __643
__643:
	if 0 != 0 {
		goto __642
	}
	goto __644
__644:
	;
__640:
	;
	goto __638
__638:
	if 0 != 0 {
		goto __637
	}
	goto __639
__639:
	;
	goto __633
__633:
	if 0 != 0 {
		goto __632
	}
	goto __634
__634:
	;
	notECJumpSource = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__647:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __650
	}
	XTclExpandCodeArray(tls, envPtr)
__650:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __651
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_FALSE4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__651:
	;
__652:
	_delta39 = XtclInstructionTable[INST_JUMP_FALSE4].FstackEffect
	if !(_delta39 != 0) {
		goto __655
	}
	if !(_delta39 == -0x7fffffff-1) {
		goto __656
	}
	_delta39 = 1 - 0
__656:
	;
__657:
	if !(_delta39 < 0) {
		goto __660
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __661
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__661:
	;
__660:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta39
	goto __658
__658:
	if 0 != 0 {
		goto __657
	}
	goto __659
__659:
	;
__655:
	;
	goto __653
__653:
	if 0 != 0 {
		goto __652
	}
	goto __654
__654:
	;
	goto __648
__648:
	if 0 != 0 {
		goto __647
	}
	goto __649
__649:
	;
	goto __490
__489:
	notECJumpSource = -1 // LINT
__490:
	;
__662:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __665
	}
	XTclExpandCodeArray(tls, envPtr)
__665:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __666
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__666:
	;
__667:
	_delta40 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta40 != 0) {
		goto __670
	}
	if !(_delta40 == -0x7fffffff-1) {
		goto __671
	}
	_delta40 = 1 - 0
__671:
	;
__672:
	if !(_delta40 < 0) {
		goto __675
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __676
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__676:
	;
__675:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta40
	goto __673
__673:
	if 0 != 0 {
		goto __672
	}
	goto __674
__674:
	;
__670:
	;
	goto __668
__668:
	if 0 != 0 {
		goto __667
	}
	goto __669
__669:
	;
	goto __663
__663:
	if 0 != 0 {
		goto __662
	}
	goto __664
__664:
	;

	// There is a finally clause, so we need a fairly complex sequence of
	// instructions to deal with an on/trap handler because we must call
	// the finally handler *and* we need to substitute the result from a
	// failed trap for the result from the main script.

	if !(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4)) >= 0 || *(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8)) != 0) {
		goto __677
	}
	range1 = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
__678:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __681
	}
	XTclExpandCodeArray(tls, envPtr)
__681:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __682
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_BEGIN_CATCH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__682:
	;
__683:
	_delta41 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
	if !(_delta41 != 0) {
		goto __686
	}
	if !(_delta41 == -0x7fffffff-1) {
		goto __687
	}
	_delta41 = 1 - range1
__687:
	;
__688:
	if !(_delta41 < 0) {
		goto __691
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __692
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__692:
	;
__691:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta41
	goto __689
__689:
	if 0 != 0 {
		goto __688
	}
	goto __690
__690:
	;
__686:
	;
	goto __684
__684:
	if 0 != 0 {
		goto __683
	}
	goto __685
__685:
	;
	goto __679
__679:
	if 0 != 0 {
		goto __678
	}
	goto __680
__680:
	;
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__677:
	;
	if !(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4)) >= 0) {
		goto __693
	}
	if !(resultVar < 256) {
		goto __695
	}
__697:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __700
	}
	XTclExpandCodeArray(tls, envPtr)
__700:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __701
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__701:
	;
__702:
	_delta42 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
	if !(_delta42 != 0) {
		goto __705
	}
	if !(_delta42 == -0x7fffffff-1) {
		goto __706
	}
	_delta42 = 1 - resultVar
__706:
	;
__707:
	if !(_delta42 < 0) {
		goto __710
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __711
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__711:
	;
__710:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta42
	goto __708
__708:
	if 0 != 0 {
		goto __707
	}
	goto __709
__709:
	;
__705:
	;
	goto __703
__703:
	if 0 != 0 {
		goto __702
	}
	goto __704
__704:
	;
	goto __698
__698:
	if 0 != 0 {
		goto __697
	}
	goto __699
__699:
	;
	goto __696
__695:
__712:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __715
	}
	XTclExpandCodeArray(tls, envPtr)
__715:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __716
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__716:
	;
__717:
	_delta43 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
	if !(_delta43 != 0) {
		goto __720
	}
	if !(_delta43 == -0x7fffffff-1) {
		goto __721
	}
	_delta43 = 1 - resultVar
__721:
	;
__722:
	if !(_delta43 < 0) {
		goto __725
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __726
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__726:
	;
__725:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta43
	goto __723
__723:
	if 0 != 0 {
		goto __722
	}
	goto __724
__724:
	;
__720:
	;
	goto __718
__718:
	if 0 != 0 {
		goto __717
	}
	goto __719
__719:
	;
	goto __713
__713:
	if 0 != 0 {
		goto __712
	}
	goto __714
__714:
	;
__696:
	;

	if !(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4)) < 256) {
		goto __727
	}
__729:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __732
	}
	XTclExpandCodeArray(tls, envPtr)
__732:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __733
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__733:
	;
__734:
	_delta44 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta44 != 0) {
		goto __737
	}
	if !(_delta44 == -0x7fffffff-1) {
		goto __738
	}
	_delta44 = 1 - *(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))
__738:
	;
__739:
	if !(_delta44 < 0) {
		goto __742
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __743
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__743:
	;
__742:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta44
	goto __740
__740:
	if 0 != 0 {
		goto __739
	}
	goto __741
__741:
	;
__737:
	;
	goto __735
__735:
	if 0 != 0 {
		goto __734
	}
	goto __736
__736:
	;
	goto __730
__730:
	if 0 != 0 {
		goto __729
	}
	goto __731
__731:
	;
	goto __728
__727:
__744:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __747
	}
	XTclExpandCodeArray(tls, envPtr)
__747:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __748
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__748:
	;
__749:
	_delta45 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta45 != 0) {
		goto __752
	}
	if !(_delta45 == -0x7fffffff-1) {
		goto __753
	}
	_delta45 = 1 - *(*int32)(unsafe.Pointer(resultVars + uintptr(i)*4))
__753:
	;
__754:
	if !(_delta45 < 0) {
		goto __757
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __758
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__758:
	;
__757:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta45
	goto __755
__755:
	if 0 != 0 {
		goto __754
	}
	goto __756
__756:
	;
__752:
	;
	goto __750
__750:
	if 0 != 0 {
		goto __749
	}
	goto __751
__751:
	;
	goto __745
__745:
	if 0 != 0 {
		goto __744
	}
	goto __746
__746:
	;
__728:
	;

__759:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __762
	}
	XTclExpandCodeArray(tls, envPtr)
__762:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __763
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__763:
	;
__764:
	_delta46 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta46 != 0) {
		goto __767
	}
	if !(_delta46 == -0x7fffffff-1) {
		goto __768
	}
	_delta46 = 1 - 0
__768:
	;
__769:
	if !(_delta46 < 0) {
		goto __772
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __773
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__773:
	;
__772:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta46
	goto __770
__770:
	if 0 != 0 {
		goto __769
	}
	goto __771
__771:
	;
__767:
	;
	goto __765
__765:
	if 0 != 0 {
		goto __764
	}
	goto __766
__766:
	;
	goto __760
__760:
	if 0 != 0 {
		goto __759
	}
	goto __761
__761:
	;
	if !(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4)) >= 0) {
		goto __774
	}
	if !(optionsVar < 256) {
		goto __775
	}
__777:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __780
	}
	XTclExpandCodeArray(tls, envPtr)
__780:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __781
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__781:
	;
__782:
	_delta47 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
	if !(_delta47 != 0) {
		goto __785
	}
	if !(_delta47 == -0x7fffffff-1) {
		goto __786
	}
	_delta47 = 1 - optionsVar
__786:
	;
__787:
	if !(_delta47 < 0) {
		goto __790
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __791
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__791:
	;
__790:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta47
	goto __788
__788:
	if 0 != 0 {
		goto __787
	}
	goto __789
__789:
	;
__785:
	;
	goto __783
__783:
	if 0 != 0 {
		goto __782
	}
	goto __784
__784:
	;
	goto __778
__778:
	if 0 != 0 {
		goto __777
	}
	goto __779
__779:
	;
	goto __776
__775:
__792:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __795
	}
	XTclExpandCodeArray(tls, envPtr)
__795:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __796
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__796:
	;
__797:
	_delta48 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
	if !(_delta48 != 0) {
		goto __800
	}
	if !(_delta48 == -0x7fffffff-1) {
		goto __801
	}
	_delta48 = 1 - optionsVar
__801:
	;
__802:
	if !(_delta48 < 0) {
		goto __805
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __806
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__806:
	;
__805:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta48
	goto __803
__803:
	if 0 != 0 {
		goto __802
	}
	goto __804
__804:
	;
__800:
	;
	goto __798
__798:
	if 0 != 0 {
		goto __797
	}
	goto __799
__799:
	;
	goto __793
__793:
	if 0 != 0 {
		goto __792
	}
	goto __794
__794:
	;
__776:
	;

	if !(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4)) < 256) {
		goto __807
	}
__809:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __812
	}
	XTclExpandCodeArray(tls, envPtr)
__812:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __813
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__813:
	;
__814:
	_delta49 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta49 != 0) {
		goto __817
	}
	if !(_delta49 == -0x7fffffff-1) {
		goto __818
	}
	_delta49 = 1 - *(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))
__818:
	;
__819:
	if !(_delta49 < 0) {
		goto __822
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __823
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__823:
	;
__822:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta49
	goto __820
__820:
	if 0 != 0 {
		goto __819
	}
	goto __821
__821:
	;
__817:
	;
	goto __815
__815:
	if 0 != 0 {
		goto __814
	}
	goto __816
__816:
	;
	goto __810
__810:
	if 0 != 0 {
		goto __809
	}
	goto __811
__811:
	;
	goto __808
__807:
__824:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __827
	}
	XTclExpandCodeArray(tls, envPtr)
__827:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __828
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__828:
	;
__829:
	_delta50 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta50 != 0) {
		goto __832
	}
	if !(_delta50 == -0x7fffffff-1) {
		goto __833
	}
	_delta50 = 1 - *(*int32)(unsafe.Pointer(optionVars + uintptr(i)*4))
__833:
	;
__834:
	if !(_delta50 < 0) {
		goto __837
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __838
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__838:
	;
__837:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta50
	goto __835
__835:
	if 0 != 0 {
		goto __834
	}
	goto __836
__836:
	;
__832:
	;
	goto __830
__830:
	if 0 != 0 {
		goto __829
	}
	goto __831
__831:
	;
	goto __825
__825:
	if 0 != 0 {
		goto __824
	}
	goto __826
__826:
	;
__808:
	;

__839:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __842
	}
	XTclExpandCodeArray(tls, envPtr)
__842:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __843
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__843:
	;
__844:
	_delta51 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta51 != 0) {
		goto __847
	}
	if !(_delta51 == -0x7fffffff-1) {
		goto __848
	}
	_delta51 = 1 - 0
__848:
	;
__849:
	if !(_delta51 < 0) {
		goto __852
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __853
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__853:
	;
__852:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta51
	goto __850
__850:
	if 0 != 0 {
		goto __849
	}
	goto __851
__851:
	;
__847:
	;
	goto __845
__845:
	if 0 != 0 {
		goto __844
	}
	goto __846
__846:
	;
	goto __840
__840:
	if 0 != 0 {
		goto __839
	}
	goto __841
__841:
	;
__774:
	;

	if !!(int32(*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8))) != 0) {
		goto __854
	}
	// No handler. Will not be the last handler (that is a
	// condition that is checked by the caller). Chain to the next
	// one.

	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))
__855:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __858
	}
	XTclExpandCodeArray(tls, envPtr)
__858:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __859
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_END_CATCH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__859:
	;
__860:
	_delta52 = XtclInstructionTable[INST_END_CATCH].FstackEffect
	if !(_delta52 != 0) {
		goto __863
	}
	if !(_delta52 == -0x7fffffff-1) {
		goto __864
	}
	_delta52 = 1 - 0
__864:
	;
__865:
	if !(_delta52 < 0) {
		goto __868
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __869
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__869:
	;
__868:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta52
	goto __866
__866:
	if 0 != 0 {
		goto __865
	}
	goto __867
__867:
	;
__863:
	;
	goto __861
__861:
	if 0 != 0 {
		goto __860
	}
	goto __862
__862:
	;
	goto __856
__856:
	if 0 != 0 {
		goto __855
	}
	goto __857
__857:
	;
	forwardsNeedFixing = 1
	*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(i)*4)) = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__870:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __873
	}
	XTclExpandCodeArray(tls, envPtr)
__873:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __874
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__874:
	;
__875:
	_delta53 = XtclInstructionTable[INST_JUMP4].FstackEffect
	if !(_delta53 != 0) {
		goto __878
	}
	if !(_delta53 == -0x7fffffff-1) {
		goto __879
	}
	_delta53 = 1 - 0
__879:
	;
__880:
	if !(_delta53 < 0) {
		goto __883
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __884
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__884:
	;
__883:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta53
	goto __881
__881:
	if 0 != 0 {
		goto __880
	}
	goto __882
__882:
	;
__878:
	;
	goto __876
__876:
	if 0 != 0 {
		goto __875
	}
	goto __877
__877:
	;
	goto __871
__871:
	if 0 != 0 {
		goto __870
	}
	goto __872
__872:
	;
	goto finishTrapCatchHandling
__854:
	;
	goto __694
__693:
	if !!(int32(*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8))) != 0) {
		goto __885
	}
	// No handler. Will not be the last handler (that condition is
	// checked by the caller). Chain to the next one.

	forwardsNeedFixing = 1
	*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(i)*4)) = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__886:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __889
	}
	XTclExpandCodeArray(tls, envPtr)
__889:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __890
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__890:
	;
__891:
	_delta54 = XtclInstructionTable[INST_JUMP4].FstackEffect
	if !(_delta54 != 0) {
		goto __894
	}
	if !(_delta54 == -0x7fffffff-1) {
		goto __895
	}
	_delta54 = 1 - 0
__895:
	;
__896:
	if !(_delta54 < 0) {
		goto __899
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __900
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__900:
	;
__899:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta54
	goto __897
__897:
	if 0 != 0 {
		goto __896
	}
	goto __898
__898:
	;
__894:
	;
	goto __892
__892:
	if 0 != 0 {
		goto __891
	}
	goto __893
__893:
	;
	goto __887
__887:
	if 0 != 0 {
		goto __886
	}
	goto __888
__888:
	;
	goto endOfThisArm
__885:
	;
__694:
	;

	// Got a handler. Make sure that any pending patch-up actions from
	// previous unprocessed handlers are dealt with now that we know where
	// they are to jump to.

	if !(forwardsNeedFixing != 0) {
		goto __901
	}
	forwardsNeedFixing = 0
__902:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __905
	}
	XTclExpandCodeArray(tls, envPtr)
__905:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(7))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __906
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__906:
	;
__907:
	_delta55 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta55 != 0) {
		goto __910
	}
	if !(_delta55 == -0x7fffffff-1) {
		goto __911
	}
	_delta55 = 1 - 7
__911:
	;
__912:
	if !(_delta55 < 0) {
		goto __915
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __916
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__916:
	;
__915:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta55
	goto __913
__913:
	if 0 != 0 {
		goto __912
	}
	goto __914
__914:
	;
__910:
	;
	goto __908
__908:
	if 0 != 0 {
		goto __907
	}
	goto __909
__909:
	;
	goto __903
__903:
	if 0 != 0 {
		goto __902
	}
	goto __904
__904:
	;
	j = 0
__917:
	if !(j < i) {
		goto __919
	}
	if !(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)) == -1) {
		goto __920
	}
	goto __918
__920:
	;
__921:
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> 24)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> 16)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> 8)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))))
	goto __922
__922:
	if 0 != 0 {
		goto __921
	}
	goto __923
__923:
	;
	*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)) = -1
	goto __918
__918:
	j++
	goto __917
	goto __919
__919:
	;
__924:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __927
	}
	XTclExpandCodeArray(tls, envPtr)
__927:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __928
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_BEGIN_CATCH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__928:
	;
__929:
	_delta56 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
	if !(_delta56 != 0) {
		goto __932
	}
	if !(_delta56 == -0x7fffffff-1) {
		goto __933
	}
	_delta56 = 1 - range1
__933:
	;
__934:
	if !(_delta56 < 0) {
		goto __937
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __938
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__938:
	;
__937:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta56
	goto __935
__935:
	if 0 != 0 {
		goto __934
	}
	goto __936
__936:
	;
__932:
	;
	goto __930
__930:
	if 0 != 0 {
		goto __929
	}
	goto __931
__931:
	;
	goto __925
__925:
	if 0 != 0 {
		goto __924
	}
	goto __926
__926:
	;
__901:
	;
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(5+i*4)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(5+i*4)*8))
	XTclCompileCmdWord(tls, interp, *(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8))+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8)))).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))
__939:
	_objIndexCopy5 = XTclRegisterLiteral(tls, envPtr, ts+18333, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy5 <= 255) {
		goto __942
	}
__944:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __947
	}
	XTclExpandCodeArray(tls, envPtr)
__947:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __948
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__948:
	;
__949:
	_delta57 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta57 != 0) {
		goto __952
	}
	if !(_delta57 == -0x7fffffff-1) {
		goto __953
	}
	_delta57 = 1 - _objIndexCopy5
__953:
	;
__954:
	if !(_delta57 < 0) {
		goto __957
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __958
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__958:
	;
__957:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta57
	goto __955
__955:
	if 0 != 0 {
		goto __954
	}
	goto __956
__956:
	;
__952:
	;
	goto __950
__950:
	if 0 != 0 {
		goto __949
	}
	goto __951
__951:
	;
	goto __945
__945:
	if 0 != 0 {
		goto __944
	}
	goto __946
__946:
	;
	goto __943
__942:
__959:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __962
	}
	XTclExpandCodeArray(tls, envPtr)
__962:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __963
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__963:
	;
__964:
	_delta58 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta58 != 0) {
		goto __967
	}
	if !(_delta58 == -0x7fffffff-1) {
		goto __968
	}
	_delta58 = 1 - _objIndexCopy5
__968:
	;
__969:
	if !(_delta58 < 0) {
		goto __972
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __973
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__973:
	;
__972:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta58
	goto __970
__970:
	if 0 != 0 {
		goto __969
	}
	goto __971
__971:
	;
__967:
	;
	goto __965
__965:
	if 0 != 0 {
		goto __964
	}
	goto __966
__966:
	;
	goto __960
__960:
	if 0 != 0 {
		goto __959
	}
	goto __961
__961:
	;
__943:
	;
	goto __940
__940:
	if 0 != 0 {
		goto __939
	}
	goto __941
__941:
	;
__974:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __977
	}
	XTclExpandCodeArray(tls, envPtr)
__977:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __978
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
			return 1
		}
		return 0
	}()
__978:
	;
__979:
	_delta59 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
	if !(_delta59 != 0) {
		goto __982
	}
	if !(_delta59 == -0x7fffffff-1) {
		goto __983
	}
	_delta59 = 1 - 0
__983:
	;
__984:
	if !(_delta59 < 0) {
		goto __987
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __988
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__988:
	;
__987:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta59
	goto __985
__985:
	if 0 != 0 {
		goto __984
	}
	goto __986
__986:
	;
__982:
	;
	goto __980
__980:
	if 0 != 0 {
		goto __979
	}
	goto __981
__981:
	;
	goto __975
__975:
	if 0 != 0 {
		goto __974
	}
	goto __976
__976:
	;
__989:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __992
	}
	XTclExpandCodeArray(tls, envPtr)
__992:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __993
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__993:
	;
__994:
	_delta60 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta60 != 0) {
		goto __997
	}
	if !(_delta60 == -0x7fffffff-1) {
		goto __998
	}
	_delta60 = 1 - 3
__998:
	;
__999:
	if !(_delta60 < 0) {
		goto __1002
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1003
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1003:
	;
__1002:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta60
	goto __1000
__1000:
	if 0 != 0 {
		goto __999
	}
	goto __1001
__1001:
	;
__997:
	;
	goto __995
__995:
	if 0 != 0 {
		goto __994
	}
	goto __996
__996:
	;
	goto __990
__990:
	if 0 != 0 {
		goto __989
	}
	goto __991
__991:
	;
__1004:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1007
	}
	XTclExpandCodeArray(tls, envPtr)
__1007:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(5))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1008
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1008:
	;
__1009:
	_delta61 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta61 != 0) {
		goto __1012
	}
	if !(_delta61 == -0x7fffffff-1) {
		goto __1013
	}
	_delta61 = 1 - 5
__1013:
	;
__1014:
	if !(_delta61 < 0) {
		goto __1017
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1018
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1018:
	;
__1017:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta61
	goto __1015
__1015:
	if 0 != 0 {
		goto __1014
	}
	goto __1016
__1016:
	;
__1012:
	;
	goto __1010
__1010:
	if 0 != 0 {
		goto __1009
	}
	goto __1011
__1011:
	;
	goto __1005
__1005:
	if 0 != 0 {
		goto __1004
	}
	goto __1006
__1006:
	;
__1019:
	if !(-3 < 0) {
		goto __1022
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1023
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1023:
	;
__1022:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += -3
	goto __1020
__1020:
	if 0 != 0 {
		goto __1019
	}
	goto __1021
__1021:
	;
	*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(i)*4)) = -1

	// Error in handler or setting of variables; replace the stored
	// exception with the new one. Note that we only push this if we have
	// either a body or some variable setting here. Otherwise this code is
	// unreachable.

finishTrapCatchHandling:
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1024:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1027
	}
	XTclExpandCodeArray(tls, envPtr)
__1027:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1028
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1028:
	;
__1029:
	_delta62 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
	if !(_delta62 != 0) {
		goto __1032
	}
	if !(_delta62 == -0x7fffffff-1) {
		goto __1033
	}
	_delta62 = 1 - 0
__1033:
	;
__1034:
	if !(_delta62 < 0) {
		goto __1037
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1038
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1038:
	;
__1037:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta62
	goto __1035
__1035:
	if 0 != 0 {
		goto __1034
	}
	goto __1036
__1036:
	;
__1032:
	;
	goto __1030
__1030:
	if 0 != 0 {
		goto __1029
	}
	goto __1031
__1031:
	;
	goto __1025
__1025:
	if 0 != 0 {
		goto __1024
	}
	goto __1026
__1026:
	;
__1039:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1042
	}
	XTclExpandCodeArray(tls, envPtr)
__1042:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_CODE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1043
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RETURN_CODE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1043:
	;
__1044:
	_delta63 = XtclInstructionTable[INST_PUSH_RETURN_CODE].FstackEffect
	if !(_delta63 != 0) {
		goto __1047
	}
	if !(_delta63 == -0x7fffffff-1) {
		goto __1048
	}
	_delta63 = 1 - 0
__1048:
	;
__1049:
	if !(_delta63 < 0) {
		goto __1052
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1053
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1053:
	;
__1052:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta63
	goto __1050
__1050:
	if 0 != 0 {
		goto __1049
	}
	goto __1051
__1051:
	;
__1047:
	;
	goto __1045
__1045:
	if 0 != 0 {
		goto __1044
	}
	goto __1046
__1046:
	;
	goto __1040
__1040:
	if 0 != 0 {
		goto __1039
	}
	goto __1041
__1041:
	;
__1054:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1057
	}
	XTclExpandCodeArray(tls, envPtr)
__1057:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1058
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RESULT == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1058:
	;
__1059:
	_delta64 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
	if !(_delta64 != 0) {
		goto __1062
	}
	if !(_delta64 == -0x7fffffff-1) {
		goto __1063
	}
	_delta64 = 1 - 0
__1063:
	;
__1064:
	if !(_delta64 < 0) {
		goto __1067
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1068
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1068:
	;
__1067:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta64
	goto __1065
__1065:
	if 0 != 0 {
		goto __1064
	}
	goto __1066
__1066:
	;
__1062:
	;
	goto __1060
__1060:
	if 0 != 0 {
		goto __1059
	}
	goto __1061
__1061:
	;
	goto __1055
__1055:
	if 0 != 0 {
		goto __1054
	}
	goto __1056
__1056:
	;
__1069:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1072
	}
	XTclExpandCodeArray(tls, envPtr)
__1072:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1073
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_END_CATCH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1073:
	;
__1074:
	_delta65 = XtclInstructionTable[INST_END_CATCH].FstackEffect
	if !(_delta65 != 0) {
		goto __1077
	}
	if !(_delta65 == -0x7fffffff-1) {
		goto __1078
	}
	_delta65 = 1 - 0
__1078:
	;
__1079:
	if !(_delta65 < 0) {
		goto __1082
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1083
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1083:
	;
__1082:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta65
	goto __1080
__1080:
	if 0 != 0 {
		goto __1079
	}
	goto __1081
__1081:
	;
__1077:
	;
	goto __1075
__1075:
	if 0 != 0 {
		goto __1074
	}
	goto __1076
__1076:
	;
	goto __1070
__1070:
	if 0 != 0 {
		goto __1069
	}
	goto __1071
__1071:
	;
	if !(resultVar < 256) {
		goto __1084
	}
__1086:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1089
	}
	XTclExpandCodeArray(tls, envPtr)
__1089:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1090
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1090:
	;
__1091:
	_delta66 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta66 != 0) {
		goto __1094
	}
	if !(_delta66 == -0x7fffffff-1) {
		goto __1095
	}
	_delta66 = 1 - resultVar
__1095:
	;
__1096:
	if !(_delta66 < 0) {
		goto __1099
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1100
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1100:
	;
__1099:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta66
	goto __1097
__1097:
	if 0 != 0 {
		goto __1096
	}
	goto __1098
__1098:
	;
__1094:
	;
	goto __1092
__1092:
	if 0 != 0 {
		goto __1091
	}
	goto __1093
__1093:
	;
	goto __1087
__1087:
	if 0 != 0 {
		goto __1086
	}
	goto __1088
__1088:
	;
	goto __1085
__1084:
__1101:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1104
	}
	XTclExpandCodeArray(tls, envPtr)
__1104:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1105
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1105:
	;
__1106:
	_delta67 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta67 != 0) {
		goto __1109
	}
	if !(_delta67 == -0x7fffffff-1) {
		goto __1110
	}
	_delta67 = 1 - resultVar
__1110:
	;
__1111:
	if !(_delta67 < 0) {
		goto __1114
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1115
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1115:
	;
__1114:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta67
	goto __1112
__1112:
	if 0 != 0 {
		goto __1111
	}
	goto __1113
__1113:
	;
__1109:
	;
	goto __1107
__1107:
	if 0 != 0 {
		goto __1106
	}
	goto __1108
__1108:
	;
	goto __1102
__1102:
	if 0 != 0 {
		goto __1101
	}
	goto __1103
__1103:
	;
__1085:
	;

__1116:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1119
	}
	XTclExpandCodeArray(tls, envPtr)
__1119:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1120
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1120:
	;
__1121:
	_delta68 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta68 != 0) {
		goto __1124
	}
	if !(_delta68 == -0x7fffffff-1) {
		goto __1125
	}
	_delta68 = 1 - 0
__1125:
	;
__1126:
	if !(_delta68 < 0) {
		goto __1129
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1130
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1130:
	;
__1129:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta68
	goto __1127
__1127:
	if 0 != 0 {
		goto __1126
	}
	goto __1128
__1128:
	;
__1124:
	;
	goto __1122
__1122:
	if 0 != 0 {
		goto __1121
	}
	goto __1123
__1123:
	;
	goto __1117
__1117:
	if 0 != 0 {
		goto __1116
	}
	goto __1118
__1118:
	;
__1131:
	_objIndexCopy6 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy6 <= 255) {
		goto __1134
	}
__1136:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1139
	}
	XTclExpandCodeArray(tls, envPtr)
__1139:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1140
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1140:
	;
__1141:
	_delta69 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta69 != 0) {
		goto __1144
	}
	if !(_delta69 == -0x7fffffff-1) {
		goto __1145
	}
	_delta69 = 1 - _objIndexCopy6
__1145:
	;
__1146:
	if !(_delta69 < 0) {
		goto __1149
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1150
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1150:
	;
__1149:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta69
	goto __1147
__1147:
	if 0 != 0 {
		goto __1146
	}
	goto __1148
__1148:
	;
__1144:
	;
	goto __1142
__1142:
	if 0 != 0 {
		goto __1141
	}
	goto __1143
__1143:
	;
	goto __1137
__1137:
	if 0 != 0 {
		goto __1136
	}
	goto __1138
__1138:
	;
	goto __1135
__1134:
__1151:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1154
	}
	XTclExpandCodeArray(tls, envPtr)
__1154:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy6))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1155
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1155:
	;
__1156:
	_delta70 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta70 != 0) {
		goto __1159
	}
	if !(_delta70 == -0x7fffffff-1) {
		goto __1160
	}
	_delta70 = 1 - _objIndexCopy6
__1160:
	;
__1161:
	if !(_delta70 < 0) {
		goto __1164
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1165
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1165:
	;
__1164:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta70
	goto __1162
__1162:
	if 0 != 0 {
		goto __1161
	}
	goto __1163
__1163:
	;
__1159:
	;
	goto __1157
__1157:
	if 0 != 0 {
		goto __1156
	}
	goto __1158
__1158:
	;
	goto __1152
__1152:
	if 0 != 0 {
		goto __1151
	}
	goto __1153
__1153:
	;
__1135:
	;
	goto __1132
__1132:
	if 0 != 0 {
		goto __1131
	}
	goto __1133
__1133:
	;
__1166:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1169
	}
	XTclExpandCodeArray(tls, envPtr)
__1169:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EQ)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1170
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_EQ == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1170:
	;
__1171:
	_delta71 = XtclInstructionTable[INST_EQ].FstackEffect
	if !(_delta71 != 0) {
		goto __1174
	}
	if !(_delta71 == -0x7fffffff-1) {
		goto __1175
	}
	_delta71 = 1 - 0
__1175:
	;
__1176:
	if !(_delta71 < 0) {
		goto __1179
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1180
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1180:
	;
__1179:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta71
	goto __1177
__1177:
	if 0 != 0 {
		goto __1176
	}
	goto __1178
__1178:
	;
__1174:
	;
	goto __1172
__1172:
	if 0 != 0 {
		goto __1171
	}
	goto __1173
__1173:
	;
	goto __1167
__1167:
	if 0 != 0 {
		goto __1166
	}
	goto __1168
__1168:
	;
	noTrapError = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1181:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1184
	}
	XTclExpandCodeArray(tls, envPtr)
__1184:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1185
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_FALSE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1185:
	;
__1186:
	_delta72 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
	if !(_delta72 != 0) {
		goto __1189
	}
	if !(_delta72 == -0x7fffffff-1) {
		goto __1190
	}
	_delta72 = 1 - 0
__1190:
	;
__1191:
	if !(_delta72 < 0) {
		goto __1194
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1195
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1195:
	;
__1194:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta72
	goto __1192
__1192:
	if 0 != 0 {
		goto __1191
	}
	goto __1193
__1193:
	;
__1189:
	;
	goto __1187
__1187:
	if 0 != 0 {
		goto __1186
	}
	goto __1188
__1188:
	;
	goto __1182
__1182:
	if 0 != 0 {
		goto __1181
	}
	goto __1183
__1183:
	;
	if !(optionsVar < 256) {
		goto __1196
	}
__1198:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1201
	}
	XTclExpandCodeArray(tls, envPtr)
__1201:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1202
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1202:
	;
__1203:
	_delta73 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
	if !(_delta73 != 0) {
		goto __1206
	}
	if !(_delta73 == -0x7fffffff-1) {
		goto __1207
	}
	_delta73 = 1 - optionsVar
__1207:
	;
__1208:
	if !(_delta73 < 0) {
		goto __1211
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1212
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1212:
	;
__1211:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta73
	goto __1209
__1209:
	if 0 != 0 {
		goto __1208
	}
	goto __1210
__1210:
	;
__1206:
	;
	goto __1204
__1204:
	if 0 != 0 {
		goto __1203
	}
	goto __1205
__1205:
	;
	goto __1199
__1199:
	if 0 != 0 {
		goto __1198
	}
	goto __1200
__1200:
	;
	goto __1197
__1196:
__1213:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1216
	}
	XTclExpandCodeArray(tls, envPtr)
__1216:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1217
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1217:
	;
__1218:
	_delta74 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
	if !(_delta74 != 0) {
		goto __1221
	}
	if !(_delta74 == -0x7fffffff-1) {
		goto __1222
	}
	_delta74 = 1 - optionsVar
__1222:
	;
__1223:
	if !(_delta74 < 0) {
		goto __1226
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1227
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1227:
	;
__1226:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta74
	goto __1224
__1224:
	if 0 != 0 {
		goto __1223
	}
	goto __1225
__1225:
	;
__1221:
	;
	goto __1219
__1219:
	if 0 != 0 {
		goto __1218
	}
	goto __1220
__1220:
	;
	goto __1214
__1214:
	if 0 != 0 {
		goto __1213
	}
	goto __1215
__1215:
	;
__1197:
	;

__1228:
	_objIndexCopy7 = XTclRegisterLiteral(tls, envPtr, ts+18170, int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy7 <= 255) {
		goto __1231
	}
__1233:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1236
	}
	XTclExpandCodeArray(tls, envPtr)
__1236:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1237
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1237:
	;
__1238:
	_delta75 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta75 != 0) {
		goto __1241
	}
	if !(_delta75 == -0x7fffffff-1) {
		goto __1242
	}
	_delta75 = 1 - _objIndexCopy7
__1242:
	;
__1243:
	if !(_delta75 < 0) {
		goto __1246
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1247
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1247:
	;
__1246:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta75
	goto __1244
__1244:
	if 0 != 0 {
		goto __1243
	}
	goto __1245
__1245:
	;
__1241:
	;
	goto __1239
__1239:
	if 0 != 0 {
		goto __1238
	}
	goto __1240
__1240:
	;
	goto __1234
__1234:
	if 0 != 0 {
		goto __1233
	}
	goto __1235
__1235:
	;
	goto __1232
__1231:
__1248:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1251
	}
	XTclExpandCodeArray(tls, envPtr)
__1251:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy7))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1252
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1252:
	;
__1253:
	_delta76 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta76 != 0) {
		goto __1256
	}
	if !(_delta76 == -0x7fffffff-1) {
		goto __1257
	}
	_delta76 = 1 - _objIndexCopy7
__1257:
	;
__1258:
	if !(_delta76 < 0) {
		goto __1261
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1262
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1262:
	;
__1261:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta76
	goto __1259
__1259:
	if 0 != 0 {
		goto __1258
	}
	goto __1260
__1260:
	;
__1256:
	;
	goto __1254
__1254:
	if 0 != 0 {
		goto __1253
	}
	goto __1255
__1255:
	;
	goto __1249
__1249:
	if 0 != 0 {
		goto __1248
	}
	goto __1250
__1250:
	;
__1232:
	;
	goto __1229
__1229:
	if 0 != 0 {
		goto __1228
	}
	goto __1230
__1230:
	;
__1263:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1266
	}
	XTclExpandCodeArray(tls, envPtr)
__1266:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1267
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1267:
	;
__1268:
	_delta77 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta77 != 0) {
		goto __1271
	}
	if !(_delta77 == -0x7fffffff-1) {
		goto __1272
	}
	_delta77 = 1 - 3
__1272:
	;
__1273:
	if !(_delta77 < 0) {
		goto __1276
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1277
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1277:
	;
__1276:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta77
	goto __1274
__1274:
	if 0 != 0 {
		goto __1273
	}
	goto __1275
__1275:
	;
__1271:
	;
	goto __1269
__1269:
	if 0 != 0 {
		goto __1268
	}
	goto __1270
__1270:
	;
	goto __1264
__1264:
	if 0 != 0 {
		goto __1263
	}
	goto __1265
__1265:
	;
	if !(optionsVar < 256) {
		goto __1278
	}
__1280:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1283
	}
	XTclExpandCodeArray(tls, envPtr)
__1283:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1284
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1284:
	;
__1285:
	_delta78 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta78 != 0) {
		goto __1288
	}
	if !(_delta78 == -0x7fffffff-1) {
		goto __1289
	}
	_delta78 = 1 - optionsVar
__1289:
	;
__1290:
	if !(_delta78 < 0) {
		goto __1293
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1294
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1294:
	;
__1293:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta78
	goto __1291
__1291:
	if 0 != 0 {
		goto __1290
	}
	goto __1292
__1292:
	;
__1288:
	;
	goto __1286
__1286:
	if 0 != 0 {
		goto __1285
	}
	goto __1287
__1287:
	;
	goto __1281
__1281:
	if 0 != 0 {
		goto __1280
	}
	goto __1282
__1282:
	;
	goto __1279
__1278:
__1295:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1298
	}
	XTclExpandCodeArray(tls, envPtr)
__1298:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1299
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1299:
	;
__1300:
	_delta79 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta79 != 0) {
		goto __1303
	}
	if !(_delta79 == -0x7fffffff-1) {
		goto __1304
	}
	_delta79 = 1 - optionsVar
__1304:
	;
__1305:
	if !(_delta79 < 0) {
		goto __1308
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1309
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1309:
	;
__1308:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta79
	goto __1306
__1306:
	if 0 != 0 {
		goto __1305
	}
	goto __1307
__1307:
	;
__1303:
	;
	goto __1301
__1301:
	if 0 != 0 {
		goto __1300
	}
	goto __1302
__1302:
	;
	goto __1296
__1296:
	if 0 != 0 {
		goto __1295
	}
	goto __1297
__1297:
	;
__1279:
	;

__1310:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1313
	}
	XTclExpandCodeArray(tls, envPtr)
__1313:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1314
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1314:
	;
__1315:
	_delta80 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta80 != 0) {
		goto __1318
	}
	if !(_delta80 == -0x7fffffff-1) {
		goto __1319
	}
	_delta80 = 1 - 0
__1319:
	;
__1320:
	if !(_delta80 < 0) {
		goto __1323
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1324
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1324:
	;
__1323:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta80
	goto __1321
__1321:
	if 0 != 0 {
		goto __1320
	}
	goto __1322
__1322:
	;
__1318:
	;
	goto __1316
__1316:
	if 0 != 0 {
		goto __1315
	}
	goto __1317
__1317:
	;
	goto __1311
__1311:
	if 0 != 0 {
		goto __1310
	}
	goto __1312
__1312:
	;
__1325:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1328
	}
	XTclExpandCodeArray(tls, envPtr)
__1328:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_SET)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1329
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DICT_SET == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1329:
	;
__1330:
	_delta81 = XtclInstructionTable[INST_DICT_SET].FstackEffect
	if !(_delta81 != 0) {
		goto __1333
	}
	if !(_delta81 == -0x7fffffff-1) {
		goto __1334
	}
	_delta81 = 1 - 1
__1334:
	;
__1335:
	if !(_delta81 < 0) {
		goto __1338
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1339
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1339:
	;
__1338:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta81
	goto __1336
__1336:
	if 0 != 0 {
		goto __1335
	}
	goto __1337
__1337:
	;
__1333:
	;
	goto __1331
__1331:
	if 0 != 0 {
		goto __1330
	}
	goto __1332
__1332:
	;
	goto __1326
__1326:
	if 0 != 0 {
		goto __1325
	}
	goto __1327
__1327:
	;
__1340:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1343
	}
	XTclExpandCodeArray(tls, envPtr)
__1343:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	goto __1341
__1341:
	if 0 != 0 {
		goto __1340
	}
	goto __1342
__1342:
	;
__1344:
	if !(-1 < 0) {
		goto __1347
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1348
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1348:
	;
__1347:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	goto __1345
__1345:
	if 0 != 0 {
		goto __1344
	}
	goto __1346
__1346:
	;
	trapError = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1349:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1352
	}
	XTclExpandCodeArray(tls, envPtr)
__1352:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1353
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1353:
	;
__1354:
	_delta82 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta82 != 0) {
		goto __1357
	}
	if !(_delta82 == -0x7fffffff-1) {
		goto __1358
	}
	_delta82 = 1 - 0
__1358:
	;
__1359:
	if !(_delta82 < 0) {
		goto __1362
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1363
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1363:
	;
__1362:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta82
	goto __1360
__1360:
	if 0 != 0 {
		goto __1359
	}
	goto __1361
__1361:
	;
__1357:
	;
	goto __1355
__1355:
	if 0 != 0 {
		goto __1354
	}
	goto __1356
__1356:
	;
	goto __1350
__1350:
	if 0 != 0 {
		goto __1349
	}
	goto __1351
__1351:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(noTrapError) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(noTrapError)))
	if !(optionsVar < 256) {
		goto __1364
	}
__1366:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1369
	}
	XTclExpandCodeArray(tls, envPtr)
__1369:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1370
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1370:
	;
__1371:
	_delta83 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta83 != 0) {
		goto __1374
	}
	if !(_delta83 == -0x7fffffff-1) {
		goto __1375
	}
	_delta83 = 1 - optionsVar
__1375:
	;
__1376:
	if !(_delta83 < 0) {
		goto __1379
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1380
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1380:
	;
__1379:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta83
	goto __1377
__1377:
	if 0 != 0 {
		goto __1376
	}
	goto __1378
__1378:
	;
__1374:
	;
	goto __1372
__1372:
	if 0 != 0 {
		goto __1371
	}
	goto __1373
__1373:
	;
	goto __1367
__1367:
	if 0 != 0 {
		goto __1366
	}
	goto __1368
__1368:
	;
	goto __1365
__1364:
__1381:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1384
	}
	XTclExpandCodeArray(tls, envPtr)
__1384:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1385
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1385:
	;
__1386:
	_delta84 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta84 != 0) {
		goto __1389
	}
	if !(_delta84 == -0x7fffffff-1) {
		goto __1390
	}
	_delta84 = 1 - optionsVar
__1390:
	;
__1391:
	if !(_delta84 < 0) {
		goto __1394
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1395
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1395:
	;
__1394:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta84
	goto __1392
__1392:
	if 0 != 0 {
		goto __1391
	}
	goto __1393
__1393:
	;
__1389:
	;
	goto __1387
__1387:
	if 0 != 0 {
		goto __1386
	}
	goto __1388
__1388:
	;
	goto __1382
__1382:
	if 0 != 0 {
		goto __1381
	}
	goto __1383
__1383:
	;
__1365:
	;

	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(trapError) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(trapError)))
	// Skip POP at end; can clean up with subsequent POP
	if !(i+1 < numHandlers) {
		goto __1396
	}
__1397:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1400
	}
	XTclExpandCodeArray(tls, envPtr)
__1400:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1401
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1401:
	;
__1402:
	_delta85 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta85 != 0) {
		goto __1405
	}
	if !(_delta85 == -0x7fffffff-1) {
		goto __1406
	}
	_delta85 = 1 - 0
__1406:
	;
__1407:
	if !(_delta85 < 0) {
		goto __1410
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1411
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1411:
	;
__1410:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta85
	goto __1408
__1408:
	if 0 != 0 {
		goto __1407
	}
	goto __1409
__1409:
	;
__1405:
	;
	goto __1403
__1403:
	if 0 != 0 {
		goto __1402
	}
	goto __1404
__1404:
	;
	goto __1398
__1398:
	if 0 != 0 {
		goto __1397
	}
	goto __1399
__1399:
	;
__1396:
	;

endOfThisArm:
	if !(i+1 < numHandlers) {
		goto __1412
	}
	*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4)) = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1413:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1416
	}
	XTclExpandCodeArray(tls, envPtr)
__1416:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1417
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1417:
	;
__1418:
	_delta86 = XtclInstructionTable[INST_JUMP4].FstackEffect
	if !(_delta86 != 0) {
		goto __1421
	}
	if !(_delta86 == -0x7fffffff-1) {
		goto __1422
	}
	_delta86 = 1 - 0
__1422:
	;
__1423:
	if !(_delta86 < 0) {
		goto __1426
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1427
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1427:
	;
__1426:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta86
	goto __1424
__1424:
	if 0 != 0 {
		goto __1423
	}
	goto __1425
__1425:
	;
__1421:
	;
	goto __1419
__1419:
	if 0 != 0 {
		goto __1418
	}
	goto __1420
__1420:
	;
	goto __1414
__1414:
	if 0 != 0 {
		goto __1413
	}
	goto __1415
__1415:
	;
__1428:
	if !(1 < 0) {
		goto __1431
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1432
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1432:
	;
__1431:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
	goto __1429
__1429:
	if 0 != 0 {
		goto __1428
	}
	goto __1430
__1430:
	;
__1412:
	;
	if !(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) != 0) {
		goto __1433
	}
__1434:
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notECJumpSource) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notECJumpSource)) >> 24)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notECJumpSource) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notECJumpSource)) >> 16)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notECJumpSource) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notECJumpSource)) >> 8)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notECJumpSource) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(notECJumpSource)))
	goto __1435
__1435:
	if 0 != 0 {
		goto __1434
	}
	goto __1436
__1436:
	;
__1433:
	;
__1437:
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notCodeJumpSource) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notCodeJumpSource)) >> 24)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notCodeJumpSource) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notCodeJumpSource)) >> 16)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notCodeJumpSource) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(notCodeJumpSource)) >> 8)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(notCodeJumpSource) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(notCodeJumpSource)))
	goto __1438
__1438:
	if 0 != 0 {
		goto __1437
	}
	goto __1439
__1439:
	;
	goto __407
__407:
	i++
	goto __406
	goto __408
__408:
	;

	// Drop the result code, and fix all the jumps from taken clauses - which
	// drop the result code as their first action - to point straight after
	// (i.e., to the start of the finally clause).

__1440:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1443
	}
	XTclExpandCodeArray(tls, envPtr)
__1443:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1444
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1444:
	;
__1445:
	_delta87 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta87 != 0) {
		goto __1448
	}
	if !(_delta87 == -0x7fffffff-1) {
		goto __1449
	}
	_delta87 = 1 - 0
__1449:
	;
__1450:
	if !(_delta87 < 0) {
		goto __1453
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1454
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1454:
	;
__1453:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta87
	goto __1451
__1451:
	if 0 != 0 {
		goto __1450
	}
	goto __1452
__1452:
	;
__1448:
	;
	goto __1446
__1446:
	if 0 != 0 {
		goto __1445
	}
	goto __1447
__1447:
	;
	goto __1441
__1441:
	if 0 != 0 {
		goto __1440
	}
	goto __1442
__1442:
	;
	i = 0
__1455:
	if !(i < numHandlers-1) {
		goto __1457
	}
__1458:
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4))) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4)))) >> 24)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4))) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4)))) >> 16)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4))) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4)))) >> 8)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4))) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i)*4)))))
	goto __1459
__1459:
	if 0 != 0 {
		goto __1458
	}
	goto __1460
__1460:
	;
	goto __1456
__1456:
	i++
	goto __1455
	goto __1457
__1457:
	;
	XTclStackFree(tls, interp, forwardsToFix)
	XTclStackFree(tls, interp, addrsToFix)

	// Process the finally clause (at last!) Note that we do not wrap this in
	// error handlers because we would just rethrow immediately anyway. Then
	// (on normal success) we reissue the exception. Note also that
	// INST_RETURN_STK can proceed to the next instruction; that'll be the
	// next command (or some inter-command manipulation).

	if !!(trapZero != 0) {
		goto __1461
	}
__1462:
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(afterBody) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(afterBody)) >> 24)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(afterBody) + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(afterBody)) >> 16)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(afterBody) + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(afterBody)) >> 8)
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(afterBody) + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(afterBody)))
	goto __1463
__1463:
	if 0 != 0 {
		goto __1462
	}
	goto __1464
__1464:
	;
__1461:
	;
	range1 = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
__1465:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1468
	}
	XTclExpandCodeArray(tls, envPtr)
__1468:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1469
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_BEGIN_CATCH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1469:
	;
__1470:
	_delta88 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
	if !(_delta88 != 0) {
		goto __1473
	}
	if !(_delta88 == -0x7fffffff-1) {
		goto __1474
	}
	_delta88 = 1 - range1
__1474:
	;
__1475:
	if !(_delta88 < 0) {
		goto __1478
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1479
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1479:
	;
__1478:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta88
	goto __1476
__1476:
	if 0 != 0 {
		goto __1475
	}
	goto __1477
__1477:
	;
__1473:
	;
	goto __1471
__1471:
	if 0 != 0 {
		goto __1470
	}
	goto __1472
__1472:
	;
	goto __1466
__1466:
	if 0 != 0 {
		goto __1465
	}
	goto __1467
__1467:
	;
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(3+4*numHandlers)*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(3+4*numHandlers)*8))
	XTclCompileCmdWord(tls, interp, finallyToken+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(finallyToken)).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))
__1480:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1483
	}
	XTclExpandCodeArray(tls, envPtr)
__1483:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1484
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_END_CATCH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1484:
	;
__1485:
	_delta89 = XtclInstructionTable[INST_END_CATCH].FstackEffect
	if !(_delta89 != 0) {
		goto __1488
	}
	if !(_delta89 == -0x7fffffff-1) {
		goto __1489
	}
	_delta89 = 1 - 0
__1489:
	;
__1490:
	if !(_delta89 < 0) {
		goto __1493
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1494
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1494:
	;
__1493:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta89
	goto __1491
__1491:
	if 0 != 0 {
		goto __1490
	}
	goto __1492
__1492:
	;
__1488:
	;
	goto __1486
__1486:
	if 0 != 0 {
		goto __1485
	}
	goto __1487
__1487:
	;
	goto __1481
__1481:
	if 0 != 0 {
		goto __1480
	}
	goto __1482
__1482:
	;
__1495:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1498
	}
	XTclExpandCodeArray(tls, envPtr)
__1498:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1499
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1499:
	;
__1500:
	_delta90 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta90 != 0) {
		goto __1503
	}
	if !(_delta90 == -0x7fffffff-1) {
		goto __1504
	}
	_delta90 = 1 - 0
__1504:
	;
__1505:
	if !(_delta90 < 0) {
		goto __1508
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1509
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1509:
	;
__1508:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta90
	goto __1506
__1506:
	if 0 != 0 {
		goto __1505
	}
	goto __1507
__1507:
	;
__1503:
	;
	goto __1501
__1501:
	if 0 != 0 {
		goto __1500
	}
	goto __1502
__1502:
	;
	goto __1496
__1496:
	if 0 != 0 {
		goto __1495
	}
	goto __1497
__1497:
	;
	finalOK = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1510:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1513
	}
	XTclExpandCodeArray(tls, envPtr)
__1513:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1514
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1514:
	;
__1515:
	_delta91 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta91 != 0) {
		goto __1518
	}
	if !(_delta91 == -0x7fffffff-1) {
		goto __1519
	}
	_delta91 = 1 - 0
__1519:
	;
__1520:
	if !(_delta91 < 0) {
		goto __1523
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1524
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1524:
	;
__1523:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta91
	goto __1521
__1521:
	if 0 != 0 {
		goto __1520
	}
	goto __1522
__1522:
	;
__1518:
	;
	goto __1516
__1516:
	if 0 != 0 {
		goto __1515
	}
	goto __1517
__1517:
	;
	goto __1511
__1511:
	if 0 != 0 {
		goto __1510
	}
	goto __1512
__1512:
	;
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1525:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1528
	}
	XTclExpandCodeArray(tls, envPtr)
__1528:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1529
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RESULT == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1529:
	;
__1530:
	_delta92 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
	if !(_delta92 != 0) {
		goto __1533
	}
	if !(_delta92 == -0x7fffffff-1) {
		goto __1534
	}
	_delta92 = 1 - 0
__1534:
	;
__1535:
	if !(_delta92 < 0) {
		goto __1538
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1539
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1539:
	;
__1538:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta92
	goto __1536
__1536:
	if 0 != 0 {
		goto __1535
	}
	goto __1537
__1537:
	;
__1533:
	;
	goto __1531
__1531:
	if 0 != 0 {
		goto __1530
	}
	goto __1532
__1532:
	;
	goto __1526
__1526:
	if 0 != 0 {
		goto __1525
	}
	goto __1527
__1527:
	;
__1540:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1543
	}
	XTclExpandCodeArray(tls, envPtr)
__1543:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1544
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1544:
	;
__1545:
	_delta93 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
	if !(_delta93 != 0) {
		goto __1548
	}
	if !(_delta93 == -0x7fffffff-1) {
		goto __1549
	}
	_delta93 = 1 - 0
__1549:
	;
__1550:
	if !(_delta93 < 0) {
		goto __1553
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1554
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1554:
	;
__1553:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta93
	goto __1551
__1551:
	if 0 != 0 {
		goto __1550
	}
	goto __1552
__1552:
	;
__1548:
	;
	goto __1546
__1546:
	if 0 != 0 {
		goto __1545
	}
	goto __1547
__1547:
	;
	goto __1541
__1541:
	if 0 != 0 {
		goto __1540
	}
	goto __1542
__1542:
	;
__1555:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1558
	}
	XTclExpandCodeArray(tls, envPtr)
__1558:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_CODE)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1559
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH_RETURN_CODE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1559:
	;
__1560:
	_delta94 = XtclInstructionTable[INST_PUSH_RETURN_CODE].FstackEffect
	if !(_delta94 != 0) {
		goto __1563
	}
	if !(_delta94 == -0x7fffffff-1) {
		goto __1564
	}
	_delta94 = 1 - 0
__1564:
	;
__1565:
	if !(_delta94 < 0) {
		goto __1568
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1569
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1569:
	;
__1568:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta94
	goto __1566
__1566:
	if 0 != 0 {
		goto __1565
	}
	goto __1567
__1567:
	;
__1563:
	;
	goto __1561
__1561:
	if 0 != 0 {
		goto __1560
	}
	goto __1562
__1562:
	;
	goto __1556
__1556:
	if 0 != 0 {
		goto __1555
	}
	goto __1557
__1557:
	;
__1570:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1573
	}
	XTclExpandCodeArray(tls, envPtr)
__1573:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1574
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_END_CATCH == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1574:
	;
__1575:
	_delta95 = XtclInstructionTable[INST_END_CATCH].FstackEffect
	if !(_delta95 != 0) {
		goto __1578
	}
	if !(_delta95 == -0x7fffffff-1) {
		goto __1579
	}
	_delta95 = 1 - 0
__1579:
	;
__1580:
	if !(_delta95 < 0) {
		goto __1583
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1584
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1584:
	;
__1583:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta95
	goto __1581
__1581:
	if 0 != 0 {
		goto __1580
	}
	goto __1582
__1582:
	;
__1578:
	;
	goto __1576
__1576:
	if 0 != 0 {
		goto __1575
	}
	goto __1577
__1577:
	;
	goto __1571
__1571:
	if 0 != 0 {
		goto __1570
	}
	goto __1572
__1572:
	;
__1585:
	_objIndexCopy8 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy8 <= 255) {
		goto __1588
	}
__1590:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1593
	}
	XTclExpandCodeArray(tls, envPtr)
__1593:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1594
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1594:
	;
__1595:
	_delta96 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta96 != 0) {
		goto __1598
	}
	if !(_delta96 == -0x7fffffff-1) {
		goto __1599
	}
	_delta96 = 1 - _objIndexCopy8
__1599:
	;
__1600:
	if !(_delta96 < 0) {
		goto __1603
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1604
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1604:
	;
__1603:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta96
	goto __1601
__1601:
	if 0 != 0 {
		goto __1600
	}
	goto __1602
__1602:
	;
__1598:
	;
	goto __1596
__1596:
	if 0 != 0 {
		goto __1595
	}
	goto __1597
__1597:
	;
	goto __1591
__1591:
	if 0 != 0 {
		goto __1590
	}
	goto __1592
__1592:
	;
	goto __1589
__1588:
__1605:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1608
	}
	XTclExpandCodeArray(tls, envPtr)
__1608:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy8))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1609
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1609:
	;
__1610:
	_delta97 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta97 != 0) {
		goto __1613
	}
	if !(_delta97 == -0x7fffffff-1) {
		goto __1614
	}
	_delta97 = 1 - _objIndexCopy8
__1614:
	;
__1615:
	if !(_delta97 < 0) {
		goto __1618
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1619
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1619:
	;
__1618:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta97
	goto __1616
__1616:
	if 0 != 0 {
		goto __1615
	}
	goto __1617
__1617:
	;
__1613:
	;
	goto __1611
__1611:
	if 0 != 0 {
		goto __1610
	}
	goto __1612
__1612:
	;
	goto __1606
__1606:
	if 0 != 0 {
		goto __1605
	}
	goto __1607
__1607:
	;
__1589:
	;
	goto __1586
__1586:
	if 0 != 0 {
		goto __1585
	}
	goto __1587
__1587:
	;
__1620:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1623
	}
	XTclExpandCodeArray(tls, envPtr)
__1623:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EQ)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1624
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_EQ == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1624:
	;
__1625:
	_delta98 = XtclInstructionTable[INST_EQ].FstackEffect
	if !(_delta98 != 0) {
		goto __1628
	}
	if !(_delta98 == -0x7fffffff-1) {
		goto __1629
	}
	_delta98 = 1 - 0
__1629:
	;
__1630:
	if !(_delta98 < 0) {
		goto __1633
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1634
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1634:
	;
__1633:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta98
	goto __1631
__1631:
	if 0 != 0 {
		goto __1630
	}
	goto __1632
__1632:
	;
__1628:
	;
	goto __1626
__1626:
	if 0 != 0 {
		goto __1625
	}
	goto __1627
__1627:
	;
	goto __1621
__1621:
	if 0 != 0 {
		goto __1620
	}
	goto __1622
__1622:
	;
	noFinalError = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1635:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1638
	}
	XTclExpandCodeArray(tls, envPtr)
__1638:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1639
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_FALSE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1639:
	;
__1640:
	_delta99 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
	if !(_delta99 != 0) {
		goto __1643
	}
	if !(_delta99 == -0x7fffffff-1) {
		goto __1644
	}
	_delta99 = 1 - 0
__1644:
	;
__1645:
	if !(_delta99 < 0) {
		goto __1648
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1649
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1649:
	;
__1648:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta99
	goto __1646
__1646:
	if 0 != 0 {
		goto __1645
	}
	goto __1647
__1647:
	;
__1643:
	;
	goto __1641
__1641:
	if 0 != 0 {
		goto __1640
	}
	goto __1642
__1642:
	;
	goto __1636
__1636:
	if 0 != 0 {
		goto __1635
	}
	goto __1637
__1637:
	;
	if !(optionsVar < 256) {
		goto __1650
	}
__1652:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1655
	}
	XTclExpandCodeArray(tls, envPtr)
__1655:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1656
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1656:
	;
__1657:
	_delta100 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
	if !(_delta100 != 0) {
		goto __1660
	}
	if !(_delta100 == -0x7fffffff-1) {
		goto __1661
	}
	_delta100 = 1 - optionsVar
__1661:
	;
__1662:
	if !(_delta100 < 0) {
		goto __1665
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1666
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1666:
	;
__1665:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta100
	goto __1663
__1663:
	if 0 != 0 {
		goto __1662
	}
	goto __1664
__1664:
	;
__1660:
	;
	goto __1658
__1658:
	if 0 != 0 {
		goto __1657
	}
	goto __1659
__1659:
	;
	goto __1653
__1653:
	if 0 != 0 {
		goto __1652
	}
	goto __1654
__1654:
	;
	goto __1651
__1650:
__1667:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1670
	}
	XTclExpandCodeArray(tls, envPtr)
__1670:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1671
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1671:
	;
__1672:
	_delta101 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
	if !(_delta101 != 0) {
		goto __1675
	}
	if !(_delta101 == -0x7fffffff-1) {
		goto __1676
	}
	_delta101 = 1 - optionsVar
__1676:
	;
__1677:
	if !(_delta101 < 0) {
		goto __1680
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1681
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1681:
	;
__1680:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta101
	goto __1678
__1678:
	if 0 != 0 {
		goto __1677
	}
	goto __1679
__1679:
	;
__1675:
	;
	goto __1673
__1673:
	if 0 != 0 {
		goto __1672
	}
	goto __1674
__1674:
	;
	goto __1668
__1668:
	if 0 != 0 {
		goto __1667
	}
	goto __1669
__1669:
	;
__1651:
	;

__1682:
	_objIndexCopy9 = XTclRegisterLiteral(tls, envPtr, ts+18170, int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy9 <= 255) {
		goto __1685
	}
__1687:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1690
	}
	XTclExpandCodeArray(tls, envPtr)
__1690:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy9))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1691
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1691:
	;
__1692:
	_delta102 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta102 != 0) {
		goto __1695
	}
	if !(_delta102 == -0x7fffffff-1) {
		goto __1696
	}
	_delta102 = 1 - _objIndexCopy9
__1696:
	;
__1697:
	if !(_delta102 < 0) {
		goto __1700
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1701
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1701:
	;
__1700:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta102
	goto __1698
__1698:
	if 0 != 0 {
		goto __1697
	}
	goto __1699
__1699:
	;
__1695:
	;
	goto __1693
__1693:
	if 0 != 0 {
		goto __1692
	}
	goto __1694
__1694:
	;
	goto __1688
__1688:
	if 0 != 0 {
		goto __1687
	}
	goto __1689
__1689:
	;
	goto __1686
__1685:
__1702:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1705
	}
	XTclExpandCodeArray(tls, envPtr)
__1705:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy9) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy9) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy9) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy9))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1706
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1706:
	;
__1707:
	_delta103 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta103 != 0) {
		goto __1710
	}
	if !(_delta103 == -0x7fffffff-1) {
		goto __1711
	}
	_delta103 = 1 - _objIndexCopy9
__1711:
	;
__1712:
	if !(_delta103 < 0) {
		goto __1715
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1716
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1716:
	;
__1715:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta103
	goto __1713
__1713:
	if 0 != 0 {
		goto __1712
	}
	goto __1714
__1714:
	;
__1710:
	;
	goto __1708
__1708:
	if 0 != 0 {
		goto __1707
	}
	goto __1709
__1709:
	;
	goto __1703
__1703:
	if 0 != 0 {
		goto __1702
	}
	goto __1704
__1704:
	;
__1686:
	;
	goto __1683
__1683:
	if 0 != 0 {
		goto __1682
	}
	goto __1684
__1684:
	;
__1717:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1720
	}
	XTclExpandCodeArray(tls, envPtr)
__1720:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(3))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1721
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_REVERSE == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1721:
	;
__1722:
	_delta104 = XtclInstructionTable[INST_REVERSE].FstackEffect
	if !(_delta104 != 0) {
		goto __1725
	}
	if !(_delta104 == -0x7fffffff-1) {
		goto __1726
	}
	_delta104 = 1 - 3
__1726:
	;
__1727:
	if !(_delta104 < 0) {
		goto __1730
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1731
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1731:
	;
__1730:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta104
	goto __1728
__1728:
	if 0 != 0 {
		goto __1727
	}
	goto __1729
__1729:
	;
__1725:
	;
	goto __1723
__1723:
	if 0 != 0 {
		goto __1722
	}
	goto __1724
__1724:
	;
	goto __1718
__1718:
	if 0 != 0 {
		goto __1717
	}
	goto __1719
__1719:
	;
	if !(optionsVar < 256) {
		goto __1732
	}
__1734:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1737
	}
	XTclExpandCodeArray(tls, envPtr)
__1737:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1738
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1738:
	;
__1739:
	_delta105 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta105 != 0) {
		goto __1742
	}
	if !(_delta105 == -0x7fffffff-1) {
		goto __1743
	}
	_delta105 = 1 - optionsVar
__1743:
	;
__1744:
	if !(_delta105 < 0) {
		goto __1747
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1748
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1748:
	;
__1747:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta105
	goto __1745
__1745:
	if 0 != 0 {
		goto __1744
	}
	goto __1746
__1746:
	;
__1742:
	;
	goto __1740
__1740:
	if 0 != 0 {
		goto __1739
	}
	goto __1741
__1741:
	;
	goto __1735
__1735:
	if 0 != 0 {
		goto __1734
	}
	goto __1736
__1736:
	;
	goto __1733
__1732:
__1749:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1752
	}
	XTclExpandCodeArray(tls, envPtr)
__1752:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1753
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1753:
	;
__1754:
	_delta106 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta106 != 0) {
		goto __1757
	}
	if !(_delta106 == -0x7fffffff-1) {
		goto __1758
	}
	_delta106 = 1 - optionsVar
__1758:
	;
__1759:
	if !(_delta106 < 0) {
		goto __1762
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1763
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1763:
	;
__1762:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta106
	goto __1760
__1760:
	if 0 != 0 {
		goto __1759
	}
	goto __1761
__1761:
	;
__1757:
	;
	goto __1755
__1755:
	if 0 != 0 {
		goto __1754
	}
	goto __1756
__1756:
	;
	goto __1750
__1750:
	if 0 != 0 {
		goto __1749
	}
	goto __1751
__1751:
	;
__1733:
	;

__1764:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1767
	}
	XTclExpandCodeArray(tls, envPtr)
__1767:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1768
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1768:
	;
__1769:
	_delta107 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta107 != 0) {
		goto __1772
	}
	if !(_delta107 == -0x7fffffff-1) {
		goto __1773
	}
	_delta107 = 1 - 0
__1773:
	;
__1774:
	if !(_delta107 < 0) {
		goto __1777
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1778
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1778:
	;
__1777:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta107
	goto __1775
__1775:
	if 0 != 0 {
		goto __1774
	}
	goto __1776
__1776:
	;
__1772:
	;
	goto __1770
__1770:
	if 0 != 0 {
		goto __1769
	}
	goto __1771
__1771:
	;
	goto __1765
__1765:
	if 0 != 0 {
		goto __1764
	}
	goto __1766
__1766:
	;
__1779:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1782
	}
	XTclExpandCodeArray(tls, envPtr)
__1782:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DICT_SET)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(1)) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(1))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1783
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_DICT_SET == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1783:
	;
__1784:
	_delta108 = XtclInstructionTable[INST_DICT_SET].FstackEffect
	if !(_delta108 != 0) {
		goto __1787
	}
	if !(_delta108 == -0x7fffffff-1) {
		goto __1788
	}
	_delta108 = 1 - 1
__1788:
	;
__1789:
	if !(_delta108 < 0) {
		goto __1792
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1793
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1793:
	;
__1792:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta108
	goto __1790
__1790:
	if 0 != 0 {
		goto __1789
	}
	goto __1791
__1791:
	;
__1787:
	;
	goto __1785
__1785:
	if 0 != 0 {
		goto __1784
	}
	goto __1786
__1786:
	;
	goto __1780
__1780:
	if 0 != 0 {
		goto __1779
	}
	goto __1781
__1781:
	;
__1794:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1797
	}
	XTclExpandCodeArray(tls, envPtr)
__1797:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	goto __1795
__1795:
	if 0 != 0 {
		goto __1794
	}
	goto __1796
__1796:
	;
__1798:
	if !(-1 < 0) {
		goto __1801
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1802
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1802:
	;
__1801:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	goto __1799
__1799:
	if 0 != 0 {
		goto __1798
	}
	goto __1800
__1800:
	;
__1803:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1806
	}
	XTclExpandCodeArray(tls, envPtr)
__1806:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1807
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1807:
	;
__1808:
	_delta109 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta109 != 0) {
		goto __1811
	}
	if !(_delta109 == -0x7fffffff-1) {
		goto __1812
	}
	_delta109 = 1 - 0
__1812:
	;
__1813:
	if !(_delta109 < 0) {
		goto __1816
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1817
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1817:
	;
__1816:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta109
	goto __1814
__1814:
	if 0 != 0 {
		goto __1813
	}
	goto __1815
__1815:
	;
__1811:
	;
	goto __1809
__1809:
	if 0 != 0 {
		goto __1808
	}
	goto __1810
__1810:
	;
	goto __1804
__1804:
	if 0 != 0 {
		goto __1803
	}
	goto __1805
__1805:
	;
	finalError = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__1818:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1821
	}
	XTclExpandCodeArray(tls, envPtr)
__1821:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1822
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1822:
	;
__1823:
	_delta110 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta110 != 0) {
		goto __1826
	}
	if !(_delta110 == -0x7fffffff-1) {
		goto __1827
	}
	_delta110 = 1 - 0
__1827:
	;
__1828:
	if !(_delta110 < 0) {
		goto __1831
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1832
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1832:
	;
__1831:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta110
	goto __1829
__1829:
	if 0 != 0 {
		goto __1828
	}
	goto __1830
__1830:
	;
__1826:
	;
	goto __1824
__1824:
	if 0 != 0 {
		goto __1823
	}
	goto __1825
__1825:
	;
	goto __1819
__1819:
	if 0 != 0 {
		goto __1818
	}
	goto __1820
__1820:
	;
__1833:
	if !(1 < 0) {
		goto __1836
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1837
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1837:
	;
__1836:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
	goto __1834
__1834:
	if 0 != 0 {
		goto __1833
	}
	goto __1835
__1835:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(noFinalError) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(noFinalError)))
	if !(optionsVar < 256) {
		goto __1838
	}
__1840:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1843
	}
	XTclExpandCodeArray(tls, envPtr)
__1843:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1844
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1844:
	;
__1845:
	_delta111 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta111 != 0) {
		goto __1848
	}
	if !(_delta111 == -0x7fffffff-1) {
		goto __1849
	}
	_delta111 = 1 - optionsVar
__1849:
	;
__1850:
	if !(_delta111 < 0) {
		goto __1853
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1854
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1854:
	;
__1853:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta111
	goto __1851
__1851:
	if 0 != 0 {
		goto __1850
	}
	goto __1852
__1852:
	;
__1848:
	;
	goto __1846
__1846:
	if 0 != 0 {
		goto __1845
	}
	goto __1847
__1847:
	;
	goto __1841
__1841:
	if 0 != 0 {
		goto __1840
	}
	goto __1842
__1842:
	;
	goto __1839
__1838:
__1855:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1858
	}
	XTclExpandCodeArray(tls, envPtr)
__1858:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1859
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1859:
	;
__1860:
	_delta112 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta112 != 0) {
		goto __1863
	}
	if !(_delta112 == -0x7fffffff-1) {
		goto __1864
	}
	_delta112 = 1 - optionsVar
__1864:
	;
__1865:
	if !(_delta112 < 0) {
		goto __1868
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1869
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1869:
	;
__1868:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta112
	goto __1866
__1866:
	if 0 != 0 {
		goto __1865
	}
	goto __1867
__1867:
	;
__1863:
	;
	goto __1861
__1861:
	if 0 != 0 {
		goto __1860
	}
	goto __1862
__1862:
	;
	goto __1856
__1856:
	if 0 != 0 {
		goto __1855
	}
	goto __1857
__1857:
	;
__1839:
	;

__1870:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1873
	}
	XTclExpandCodeArray(tls, envPtr)
__1873:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1874
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1874:
	;
__1875:
	_delta113 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta113 != 0) {
		goto __1878
	}
	if !(_delta113 == -0x7fffffff-1) {
		goto __1879
	}
	_delta113 = 1 - 0
__1879:
	;
__1880:
	if !(_delta113 < 0) {
		goto __1883
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1884
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1884:
	;
__1883:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta113
	goto __1881
__1881:
	if 0 != 0 {
		goto __1880
	}
	goto __1882
__1882:
	;
__1878:
	;
	goto __1876
__1876:
	if 0 != 0 {
		goto __1875
	}
	goto __1877
__1877:
	;
	goto __1871
__1871:
	if 0 != 0 {
		goto __1870
	}
	goto __1872
__1872:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(finalError) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(finalError)))
	if !(resultVar < 256) {
		goto __1885
	}
__1887:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1890
	}
	XTclExpandCodeArray(tls, envPtr)
__1890:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1891
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1891:
	;
__1892:
	_delta114 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
	if !(_delta114 != 0) {
		goto __1895
	}
	if !(_delta114 == -0x7fffffff-1) {
		goto __1896
	}
	_delta114 = 1 - resultVar
__1896:
	;
__1897:
	if !(_delta114 < 0) {
		goto __1900
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1901
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1901:
	;
__1900:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta114
	goto __1898
__1898:
	if 0 != 0 {
		goto __1897
	}
	goto __1899
__1899:
	;
__1895:
	;
	goto __1893
__1893:
	if 0 != 0 {
		goto __1892
	}
	goto __1894
__1894:
	;
	goto __1888
__1888:
	if 0 != 0 {
		goto __1887
	}
	goto __1889
__1889:
	;
	goto __1886
__1885:
__1902:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1905
	}
	XTclExpandCodeArray(tls, envPtr)
__1905:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1906
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_STORE_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1906:
	;
__1907:
	_delta115 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
	if !(_delta115 != 0) {
		goto __1910
	}
	if !(_delta115 == -0x7fffffff-1) {
		goto __1911
	}
	_delta115 = 1 - resultVar
__1911:
	;
__1912:
	if !(_delta115 < 0) {
		goto __1915
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1916
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1916:
	;
__1915:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta115
	goto __1913
__1913:
	if 0 != 0 {
		goto __1912
	}
	goto __1914
__1914:
	;
__1910:
	;
	goto __1908
__1908:
	if 0 != 0 {
		goto __1907
	}
	goto __1909
__1909:
	;
	goto __1903
__1903:
	if 0 != 0 {
		goto __1902
	}
	goto __1904
__1904:
	;
__1886:
	;

__1917:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1920
	}
	XTclExpandCodeArray(tls, envPtr)
__1920:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1921
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1921:
	;
__1922:
	_delta116 = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta116 != 0) {
		goto __1925
	}
	if !(_delta116 == -0x7fffffff-1) {
		goto __1926
	}
	_delta116 = 1 - 0
__1926:
	;
__1927:
	if !(_delta116 < 0) {
		goto __1930
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1931
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1931:
	;
__1930:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta116
	goto __1928
__1928:
	if 0 != 0 {
		goto __1927
	}
	goto __1929
__1929:
	;
__1925:
	;
	goto __1923
__1923:
	if 0 != 0 {
		goto __1922
	}
	goto __1924
__1924:
	;
	goto __1918
__1918:
	if 0 != 0 {
		goto __1917
	}
	goto __1919
__1919:
	;
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(finalOK) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(finalOK)))
	if !(optionsVar < 256) {
		goto __1932
	}
__1934:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1937
	}
	XTclExpandCodeArray(tls, envPtr)
__1937:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1938
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1938:
	;
__1939:
	_delta117 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
	if !(_delta117 != 0) {
		goto __1942
	}
	if !(_delta117 == -0x7fffffff-1) {
		goto __1943
	}
	_delta117 = 1 - optionsVar
__1943:
	;
__1944:
	if !(_delta117 < 0) {
		goto __1947
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1948
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1948:
	;
__1947:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta117
	goto __1945
__1945:
	if 0 != 0 {
		goto __1944
	}
	goto __1946
__1946:
	;
__1942:
	;
	goto __1940
__1940:
	if 0 != 0 {
		goto __1939
	}
	goto __1941
__1941:
	;
	goto __1935
__1935:
	if 0 != 0 {
		goto __1934
	}
	goto __1936
__1936:
	;
	goto __1933
__1932:
__1949:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1952
	}
	XTclExpandCodeArray(tls, envPtr)
__1952:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(optionsVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1953
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1953:
	;
__1954:
	_delta118 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
	if !(_delta118 != 0) {
		goto __1957
	}
	if !(_delta118 == -0x7fffffff-1) {
		goto __1958
	}
	_delta118 = 1 - optionsVar
__1958:
	;
__1959:
	if !(_delta118 < 0) {
		goto __1962
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1963
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1963:
	;
__1962:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta118
	goto __1960
__1960:
	if 0 != 0 {
		goto __1959
	}
	goto __1961
__1961:
	;
__1957:
	;
	goto __1955
__1955:
	if 0 != 0 {
		goto __1954
	}
	goto __1956
__1956:
	;
	goto __1950
__1950:
	if 0 != 0 {
		goto __1949
	}
	goto __1951
__1951:
	;
__1933:
	;

	if !(resultVar < 256) {
		goto __1964
	}
__1966:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1969
	}
	XTclExpandCodeArray(tls, envPtr)
__1969:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1970
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1970:
	;
__1971:
	_delta119 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
	if !(_delta119 != 0) {
		goto __1974
	}
	if !(_delta119 == -0x7fffffff-1) {
		goto __1975
	}
	_delta119 = 1 - resultVar
__1975:
	;
__1976:
	if !(_delta119 < 0) {
		goto __1979
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1980
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1980:
	;
__1979:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta119
	goto __1977
__1977:
	if 0 != 0 {
		goto __1976
	}
	goto __1978
__1978:
	;
__1974:
	;
	goto __1972
__1972:
	if 0 != 0 {
		goto __1971
	}
	goto __1973
__1973:
	;
	goto __1967
__1967:
	if 0 != 0 {
		goto __1966
	}
	goto __1968
__1968:
	;
	goto __1965
__1964:
__1981:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __1984
	}
	XTclExpandCodeArray(tls, envPtr)
__1984:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(resultVar))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __1985
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_LOAD_SCALAR4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__1985:
	;
__1986:
	_delta120 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
	if !(_delta120 != 0) {
		goto __1989
	}
	if !(_delta120 == -0x7fffffff-1) {
		goto __1990
	}
	_delta120 = 1 - resultVar
__1990:
	;
__1991:
	if !(_delta120 < 0) {
		goto __1994
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __1995
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__1995:
	;
__1994:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta120
	goto __1992
__1992:
	if 0 != 0 {
		goto __1991
	}
	goto __1993
__1993:
	;
__1989:
	;
	goto __1987
__1987:
	if 0 != 0 {
		goto __1986
	}
	goto __1988
__1988:
	;
	goto __1982
__1982:
	if 0 != 0 {
		goto __1981
	}
	goto __1983
__1983:
	;
__1965:
	;

	XTclEmitInvoke(tls, envPtr, INST_RETURN_STK, 0)

	return TCL_OK
}

func sIssueTryFinallyInstructions(tls *libc.TLS, interp uintptr, envPtr uintptr, bodyToken uintptr, finallyToken uintptr) int32 { /* tclCompCmdsSZ.c:3493:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var range1 int32
	var jumpOK int32
	var jumpSplice int32

	// Note that this one is simple enough that we can issue it without
	// needing a local variable table, making it a universal compilation.

	range1 = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_BEGIN_CATCH4 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - range1
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclCompileCmdWord(tls, interp, bodyToken+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(bodyToken)).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))
	for ok3 := true; ok3; ok3 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(3))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP1 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP1].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 3
				}
				for ok5 := true; ok5; ok5 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok6 := true; ok6; ok6 = 0 != 0 {
		if -1 < 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
			}
		}
		*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
	}
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RESULT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok10 := true; ok10; ok10 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok11 := true; ok11; ok11 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok12 := true; ok12; ok12 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok13 := true; ok13; ok13 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_END_CATCH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok14 := true; ok14; ok14 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok15 := true; ok15; ok15 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	range1 = XTclCreateExceptRange(tls, CATCH_EXCEPTION_RANGE, envPtr)
	for ok16 := true; ok16; ok16 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BEGIN_CATCH4)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(range1))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_BEGIN_CATCH4 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok17 := true; ok17; ok17 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_BEGIN_CATCH4].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - range1
				}
				for ok18 := true; ok18; ok18 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
		}
		return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	}()
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 3*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 3*8))
	XTclCompileCmdWord(tls, interp, finallyToken+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(finallyToken)).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))
	for ok19 := true; ok19; ok19 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_END_CATCH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok20 := true; ok20; ok20 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok21 := true; ok21; ok21 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok22 := true; ok22; ok22 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok23 := true; ok23; ok23 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok24 := true; ok24; ok24 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	jumpOK = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok25 := true; ok25; ok25 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP1 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok26 := true; ok26; ok26 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP1].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok27 := true; ok27; ok27 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcatchOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok28 := true; ok28; ok28 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RESULT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RESULT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok29 := true; ok29; ok29 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RESULT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok30 := true; ok30; ok30 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok31 := true; ok31; ok31 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_OPTIONS)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RETURN_OPTIONS == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok32 := true; ok32; ok32 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_OPTIONS].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok33 := true; ok33; ok33 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok34 := true; ok34; ok34 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH_RETURN_CODE)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_PUSH_RETURN_CODE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok35 := true; ok35; ok35 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_PUSH_RETURN_CODE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok36 := true; ok36; ok36 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok37 := true; ok37; ok37 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_END_CATCH)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_END_CATCH == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok38 := true; ok38; ok38 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_END_CATCH].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok39 := true; ok39; ok39 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok40 := true; ok40; ok40 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok41 := true; ok41; ok41 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok42 := true; ok42; ok42 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok43 := true; ok43; ok43 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok44 := true; ok44; ok44 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok45 := true; ok45; ok45 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok46 := true; ok46; ok46 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok47 := true; ok47; ok47 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EQ)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_EQ == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok48 := true; ok48; ok48 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_EQ].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok49 := true; ok49; ok49 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	jumpSplice = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok50 := true; ok50; ok50 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP_FALSE1 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok51 := true; ok51; ok51 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok52 := true; ok52; ok52 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok53 := true; ok53; ok53 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+18170, int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok54 := true; ok54; ok54 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok55 := true; ok55; ok55 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok56 := true; ok56; ok56 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok57 := true; ok57; ok57 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok58 := true; ok58; ok58 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok59 := true; ok59; ok59 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok60 := true; ok60; ok60 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_OVER)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(3)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(3))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_OVER == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok61 := true; ok61; ok61 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_OVER].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 3
				}
				for ok62 := true; ok62; ok62 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok63 := true; ok63; ok63 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_LIST == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok64 := true; ok64; ok64 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 2
				}
				for ok65 := true; ok65; ok65 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok66 := true; ok66; ok66 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST_CONCAT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_LIST_CONCAT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok67 := true; ok67; ok67 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_LIST_CONCAT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok68 := true; ok68; ok68 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(jumpSplice) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(jumpSplice)))
	for ok69 := true; ok69; ok69 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(4)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(4)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(4)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(4))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_REVERSE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok70 := true; ok70; ok70 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 4
				}
				for ok71 := true; ok71; ok71 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok72 := true; ok72; ok72 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok73 := true; ok73; ok73 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok74 := true; ok74; ok74 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok75 := true; ok75; ok75 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok76 := true; ok76; ok76 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok77 := true; ok77; ok77 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok78 := true; ok78; ok78 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(7))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP1 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok79 := true; ok79; ok79 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP1].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 7
				}
				for ok80 := true; ok80; ok80 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(jumpOK) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(jumpOK)))
	for ok81 := true; ok81; ok81 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_REVERSE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok82 := true; ok82; ok82 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 2
				}
				for ok83 := true; ok83; ok83 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	XTclEmitInvoke(tls, envPtr, INST_RETURN_STK, 0)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileUnsetCmd --
//
//	Procedure called to compile the "unset" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "unset" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileUnsetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:3569:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var varTokenPtr uintptr
	// var isScalar int32 at bp+8, 4

	// var localIndex int32 at bp+4, 4

	var flags int32 = 1
	var i int32
	var varCount int32 = 0
	var haveFlags int32 = 0

	// TODO: Consider support for compiling expanded args.

	// Verify that all words - except the first non-option one - are known at
	// compile time so that we can handle them without needing to do a nasty
	// push/rotate. [Bug 3970f54c4e]

	i = 1
	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	for ; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		var leadingWord uintptr = XTcl_NewObj(tls)

		varTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
		if !(XTclWordKnownAtCompileTime(tls, varTokenPtr, leadingWord) != 0) {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(leadingWord)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(leadingWord)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(leadingWord)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(leadingWord)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, leadingWord)
						} else {
							*(*uintptr)(unsafe.Pointer(leadingWord + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = leadingWord
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, leadingWord)
				}
			}

			// We can tolerate non-trivial substitutions in the first variable
			// to be unset. If a '--' or '-nocomplain' was present, anything
			// goes in that one place! (All subsequent variable names must be
			// constants since we don't want to have to push them all first.)

			if varCount == 0 {
				if haveFlags != 0 {
					continue
				}

				// In fact, we're OK as long as we're the first argument *and*
				// we provably don't start with a '-'. If that is true, then
				// even if everything else is varying, we still can't be a
				// flag. Otherwise we'll spill to runtime to place a limit on
				// the trickiness.

				if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype == TCL_TOKEN_WORD &&
					(*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Ftype == TCL_TOKEN_TEXT &&
					(*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Fsize > 0 &&
					int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(varTokenPtr + 1*24)).Fstart))) != '-' {
					continue
				}
			}
			return TCL_ERROR
		}
		if varCount == 0 {
			var bytes uintptr
			// var len int32 at bp, 4

			bytes = XTcl_GetStringFromObj(tls, leadingWord, bp)
			if i == 1 && *(*int32)(unsafe.Pointer(bp)) == 11 && !(libc.Xstrncmp(tls, ts+19302, bytes, uint64(11)) != 0) {
				flags = 0
				haveFlags++
			} else if i == 2-flags && *(*int32)(unsafe.Pointer(bp)) == 2 && !(libc.Xstrncmp(tls, ts+15828, bytes, uint64(2)) != 0) {
				haveFlags++
			} else {
				varCount++
			}
		} else {
			varCount++
		}
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(leadingWord)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(leadingWord)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(leadingWord)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(leadingWord)).Flength = -1
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, leadingWord)
					} else {
						*(*uintptr)(unsafe.Pointer(leadingWord + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = leadingWord
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, leadingWord)
			}
		}

	}

	// Issue instructions to unset each of the named variables.

	varTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	for i = 0; i < haveFlags; i++ {
		varTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	}
	for i = 1 + haveFlags; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		// Decide if we can use a frame slot for the var/array name or if we
		// need to emit code to compute and push the name at runtime. We use a
		// frame slot (entry in the array of local vars) if we are compiling a
		// procedure body and if the name is simple text that does not include
		// namespace qualifiers.

		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
		XTclPushVarName(tls, interp, varTokenPtr, envPtr, 0, bp+4, bp+8)

		// Emit instructions to unset the variable.

		if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
			if *(*int32)(unsafe.Pointer(bp + 4)) < 0 {
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_STK)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(flags))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_UNSET_STK == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok3 := true; ok3; ok3 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_UNSET_STK].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - flags
							}
							for ok4 := true; ok4; ok4 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok5 := true; ok5; ok5 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(flags))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_UNSET_SCALAR == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok6 := true; ok6; ok6 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - flags
							}
							for ok7 := true; ok7; ok7 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))))
				}
			}
		} else {
			if *(*int32)(unsafe.Pointer(bp + 4)) < 0 {
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_ARRAY_STK)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(flags))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_UNSET_ARRAY_STK == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok10 := true; ok10; ok10 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_UNSET_ARRAY_STK].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - flags
							}
							for ok11 := true; ok11; ok11 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok12 := true; ok12; ok12 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_ARRAY)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(flags))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_UNSET_ARRAY == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok13 := true; ok13; ok13 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_UNSET_ARRAY].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - flags
							}
							for ok14 := true; ok14; ok14 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok15 := true; ok15; ok15 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(*(*int32)(unsafe.Pointer(bp + 4))))
				}
			}
		}

		varTokenPtr = varTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+1)*24
	}
	for ok16 := true; ok16; ok16 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok17 := true; ok17; ok17 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok18 := true; ok18; ok18 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok19 := true; ok19; ok19 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok20 := true; ok20; ok20 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok21 := true; ok21; ok21 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok22 := true; ok22; ok22 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileWhileCmd --
//
//	Procedure called to compile the "while" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "while" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileWhileCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:3707:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var mapPtr uintptr
	var eclIndex int32 // TIP #280
	var testTokenPtr uintptr
	var bodyTokenPtr uintptr
	// var jumpEvalCondFixup JumpFixup at bp+4, 16

	var testCodeOffset int32
	var bodyCodeOffset int32
	var jumpDist int32
	var range1 int32
	var code int32
	// var boolVal int32 at bp, 4

	var loopMayEnd int32 // This is set to 0 if it is recognized as an
	// infinite loop.
	var boolObj uintptr
	var cachePtr uintptr
	var _delta int32
	var _delta1 int32
	var _delta2 int32
	var _delta3 int32
	var _delta4 int32
	var _delta5 int32
	var _delta6 int32
	var _objIndexCopy int32
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	loopMayEnd = 1

	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	// If the test expression requires substitutions, don't compile the while
	// command inline. E.g., the expression might cause the loop to never
	// execute or execute forever, as in "while "$x < 5" {}".
	//
	// Bail out also if the body expression requires substitutions in order to
	// insure correct behaviour [Bug 219166]

	testTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	bodyTokenPtr = testTokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(testTokenPtr)).FnumComponents+1)*24

	if !((*Tcl_Token)(unsafe.Pointer(testTokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD ||
		(*Tcl_Token)(unsafe.Pointer(bodyTokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	// Find out if the condition is a constant.

	boolObj = XTcl_NewStringObj(tls, (*Tcl_Token)(unsafe.Pointer(testTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(testTokenPtr+1*24)).Fsize)
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount++
	code = XTcl_GetBooleanFromObj(tls, uintptr(0), boolObj, bp)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount, 1) > 1) {
		goto __3
	}
	goto __4
__3:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __5
	}

	if !((*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != XtclEmptyStringRep) {
		goto __7
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes)
__7:
	;
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).Flength = -1
__8:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __11
	}
	XTclThreadFreeObj(tls, boolObj)
	goto __12
__11:
	*(*uintptr)(unsafe.Pointer(boolObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = boolObj
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__12:
	;
	goto __9
__9:
	if 0 != 0 {
		goto __8
	}
	goto __10
__10:
	;
	goto __6
__5:
	XTclFreeObj(tls, boolObj)
__6:
	;
__4:
	;

	if !(code == TCL_OK) {
		goto __13
	}
	if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
		goto __14
	}
	// It is an infinite loop; flag it so that we generate a more
	// efficient body.

	loopMayEnd = 0
	goto __15
__14:
	// This is an empty loop: "while 0 {...}" or such. Compile no
	// bytecodes.

	goto pushResult
__15:
	;
__13:
	;

	// Create a ExceptionRange record for the loop body. This is used to
	// implement break and continue.

	range1 = XTclCreateExceptRange(tls, LOOP_EXCEPTION_RANGE, envPtr)

	// Jump to the evaluation of the condition. This code uses the "loop
	// rotation" optimisation (which eliminates one branch from the loop).
	// "while cond body" produces then:
	//       goto A
	//    B: body                : bodyCodeOffset
	//    A: cond -> result      : testCodeOffset, continueOffset
	//       if (result) goto B
	//
	// The infinite loop "while 1 body" produces:
	//    B: body                : all three offsets here
	//       goto B

	if !(loopMayEnd != 0) {
		goto __16
	}
	XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP,
		bp+4)
	testCodeOffset = 0 // Avoid compiler warning.
	goto __17
__16:
	// Make sure that the first command in the body is preceded by an
	// INST_START_CMD, and hence counted properly. [Bug 1752146]

	*(*int32)(unsafe.Pointer(envPtr + 3564)) &= libc.CplInt32(1)
	testCodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
__17:
	;

	// Compile the loop body.

	bodyCodeOffset = func() int32 {
		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
		(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
				return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
			}
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
		}()
		return libc.AssignPtrInt32((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28+8, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1))
	}()
	if !!(loopMayEnd != 0) {
		goto __18
	}
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcontinueOffset = testCodeOffset
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = bodyCodeOffset
__18:
	;
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
	XTclCompileCmdWord(tls, interp, bodyTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(bodyTokenPtr)).FnumComponents, envPtr)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).FcodeOffset))
__19:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __22
	}
	XTclExpandCodeArray(tls, envPtr)
__22:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __23
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_POP == INST_START_CMD {
			return 1
		}
		return 0
	}()
__23:
	;
__24:
	_delta = XtclInstructionTable[INST_POP].FstackEffect
	if !(_delta != 0) {
		goto __27
	}
	if !(_delta == -0x7fffffff-1) {
		goto __28
	}
	_delta = 1 - 0
__28:
	;
__29:
	if !(_delta < 0) {
		goto __32
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __33
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__33:
	;
__32:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
__27:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;

	// Compile the test expression then emit the conditional jump that
	// terminates the while. We already know it's a simple word.

	if !(loopMayEnd != 0) {
		goto __34
	}
	testCodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	jumpDist = int32(uint32(testCodeOffset) - (*JumpFixup)(unsafe.Pointer(bp+4)).FcodeOffset)
	if !(XTclFixupForwardJump(tls, envPtr, bp+4, jumpDist, 127) != 0) {
		goto __36
	}
	bodyCodeOffset = bodyCodeOffset + 3
	testCodeOffset = testCodeOffset + 3
__36:
	;
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
	XTclCompileExprWords(tls, interp, testTokenPtr, 1, envPtr)

	jumpDist = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(bodyCodeOffset))
	if !(jumpDist > 127) {
		goto __37
	}
__39:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __42
	}
	XTclExpandCodeArray(tls, envPtr)
__42:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __43
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__43:
	;
__44:
	_delta1 = XtclInstructionTable[INST_JUMP_TRUE4].FstackEffect
	if !(_delta1 != 0) {
		goto __47
	}
	if !(_delta1 == -0x7fffffff-1) {
		goto __48
	}
	_delta1 = 1 - -jumpDist
__48:
	;
__49:
	if !(_delta1 < 0) {
		goto __52
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __53
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__53:
	;
__52:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta1
	goto __50
__50:
	if 0 != 0 {
		goto __49
	}
	goto __51
__51:
	;
__47:
	;
	goto __45
__45:
	if 0 != 0 {
		goto __44
	}
	goto __46
__46:
	;
	goto __40
__40:
	if 0 != 0 {
		goto __39
	}
	goto __41
__41:
	;
	goto __38
__37:
__54:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __57
	}
	XTclExpandCodeArray(tls, envPtr)
__57:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __58
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP_TRUE1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__58:
	;
__59:
	_delta2 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
	if !(_delta2 != 0) {
		goto __62
	}
	if !(_delta2 == -0x7fffffff-1) {
		goto __63
	}
	_delta2 = 1 - -jumpDist
__63:
	;
__64:
	if !(_delta2 < 0) {
		goto __67
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __68
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__68:
	;
__67:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta2
	goto __65
__65:
	if 0 != 0 {
		goto __64
	}
	goto __66
__66:
	;
__62:
	;
	goto __60
__60:
	if 0 != 0 {
		goto __59
	}
	goto __61
__61:
	;
	goto __55
__55:
	if 0 != 0 {
		goto __54
	}
	goto __56
__56:
	;
__38:
	;
	goto __35
__34:
	jumpDist = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(bodyCodeOffset))
	if !(jumpDist > 127) {
		goto __69
	}
__71:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __74
	}
	XTclExpandCodeArray(tls, envPtr)
__74:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __75
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__75:
	;
__76:
	_delta3 = XtclInstructionTable[INST_JUMP4].FstackEffect
	if !(_delta3 != 0) {
		goto __79
	}
	if !(_delta3 == -0x7fffffff-1) {
		goto __80
	}
	_delta3 = 1 - -jumpDist
__80:
	;
__81:
	if !(_delta3 < 0) {
		goto __84
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __85
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__85:
	;
__84:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta3
	goto __82
__82:
	if 0 != 0 {
		goto __81
	}
	goto __83
__83:
	;
__79:
	;
	goto __77
__77:
	if 0 != 0 {
		goto __76
	}
	goto __78
__78:
	;
	goto __72
__72:
	if 0 != 0 {
		goto __71
	}
	goto __73
__73:
	;
	goto __70
__69:
__86:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __89
	}
	XTclExpandCodeArray(tls, envPtr)
__89:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(-jumpDist))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __90
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_JUMP1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__90:
	;
__91:
	_delta4 = XtclInstructionTable[INST_JUMP1].FstackEffect
	if !(_delta4 != 0) {
		goto __94
	}
	if !(_delta4 == -0x7fffffff-1) {
		goto __95
	}
	_delta4 = 1 - -jumpDist
__95:
	;
__96:
	if !(_delta4 < 0) {
		goto __99
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __100
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__100:
	;
__99:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta4
	goto __97
__97:
	if 0 != 0 {
		goto __96
	}
	goto __98
__98:
	;
__94:
	;
	goto __92
__92:
	if 0 != 0 {
		goto __91
	}
	goto __93
__93:
	;
	goto __87
__87:
	if 0 != 0 {
		goto __86
	}
	goto __88
__88:
	;
__70:
	;
__35:
	;

	// Set the loop's body, continue and break offsets.

	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcontinueOffset = testCodeOffset
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FcodeOffset = bodyCodeOffset
	(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28)).FbreakOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	XTclFinalizeLoopExceptionRange(tls, envPtr, range1)

	// The while command's result is an empty string.

pushResult:
__101:
	_objIndexCopy = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
	if !(_objIndexCopy <= 255) {
		goto __104
	}
__106:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __109
	}
	XTclExpandCodeArray(tls, envPtr)
__109:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __110
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH1 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__110:
	;
__111:
	_delta5 = XtclInstructionTable[INST_PUSH1].FstackEffect
	if !(_delta5 != 0) {
		goto __114
	}
	if !(_delta5 == -0x7fffffff-1) {
		goto __115
	}
	_delta5 = 1 - _objIndexCopy
__115:
	;
__116:
	if !(_delta5 < 0) {
		goto __119
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __120
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__120:
	;
__119:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta5
	goto __117
__117:
	if 0 != 0 {
		goto __116
	}
	goto __118
__118:
	;
__114:
	;
	goto __112
__112:
	if 0 != 0 {
		goto __111
	}
	goto __113
__113:
	;
	goto __107
__107:
	if 0 != 0 {
		goto __106
	}
	goto __108
__108:
	;
	goto __105
__104:
__121:
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) {
		goto __124
	}
	XTclExpandCodeArray(tls, envPtr)
__124:
	;
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2) {
		goto __125
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
		if INST_PUSH4 == INST_START_CMD {
			return 1
		}
		return 0
	}()
__125:
	;
__126:
	_delta6 = XtclInstructionTable[INST_PUSH4].FstackEffect
	if !(_delta6 != 0) {
		goto __129
	}
	if !(_delta6 == -0x7fffffff-1) {
		goto __130
	}
	_delta6 = 1 - _objIndexCopy
__130:
	;
__131:
	if !(_delta6 < 0) {
		goto __134
	}
	if !((*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) {
		goto __135
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
__135:
	;
__134:
	;
	*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta6
	goto __132
__132:
	if 0 != 0 {
		goto __131
	}
	goto __133
__133:
	;
__129:
	;
	goto __127
__127:
	if 0 != 0 {
		goto __126
	}
	goto __128
__128:
	;
	goto __122
__122:
	if 0 != 0 {
		goto __121
	}
	goto __123
__123:
	;
__105:
	;
	goto __102
__102:
	if 0 != 0 {
		goto __101
	}
	goto __103
__103:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileYieldCmd --
//
//	Procedure called to compile the "yield" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "yield" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileYieldCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:3885:1: */
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 1 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 2 {
		return TCL_ERROR
	}

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 1 {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
		var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
		var valueTokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24

		if (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
			XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents, envPtr)
		}

	}
	for ok14 := true; ok14; ok14 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_YIELD)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_YIELD == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok15 := true; ok15; ok15 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_YIELD].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompileYieldToCmd --
//
//	Procedure called to compile the "yieldto" command.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the "yieldto" command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileYieldToCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:3928:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	var i int32

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 2 {
		return TCL_ERROR
	}

	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_NS_CURRENT)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_NS_CURRENT == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_NS_CURRENT].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for i = 1; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok7 := true; ok7; ok7 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok8 := true; ok8; ok8 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok9 := true; ok9; ok9 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}
	for ok10 := true; ok10; ok10 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LIST)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(i))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_LIST == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok11 := true; ok11; ok11 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_LIST].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - i
				}
				for ok12 := true; ok12; ok12 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for ok13 := true; ok13; ok13 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_YIELD_TO_INVOKE)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_YIELD_TO_INVOKE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok14 := true; ok14; ok14 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_YIELD_TO_INVOKE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok15 := true; ok15; ok15 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// CompileUnaryOpCmd --
//
//	Utility routine to compile the unary operator commands.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the compiled command at
//	runtime.
//
//----------------------------------------------------------------------

func sCompileUnaryOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, instruction int32, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:3973:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(instruction)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if instruction == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[instruction].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok9 := true; ok9; ok9 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// CompileAssociativeBinaryOpCmd --
//
//	Utility routine to compile the binary operator commands that accept an
//	arbitrary number of arguments, and that are associative operations.
//	Because of the associativity, we may combine operations from right to
//	left, saving us any effort of re-ordering the arguments on the stack
//	after substitutions are completed.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the compiled command at
//	runtime.
//
//----------------------------------------------------------------------

func sCompileAssociativeBinaryOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, identity uintptr, instruction int32, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4014:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	var words int32

	// TODO: Consider support for compiling expanded args.
	for words = 1; words < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; words++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(words)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(words)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

	}
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords <= 2 {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, identity, -1, 0)
			if _objIndexCopy <= 255 {
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok10 := true; ok10; ok10 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		words++
	}
	if words > 3 {
		// Reverse order of arguments to get precise agreement with [expr] in
		// calcuations, including roundoff errors.

		for ok14 := true; ok14; ok14 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words-1) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words-1) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words-1) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words - 1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_REVERSE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok15 := true; ok15; ok15 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - (words - 1)
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	for libc.PreDecInt32(&words, 1) > 1 {
		for ok17 := true; ok17; ok17 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(instruction)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if instruction == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok18 := true; ok18; ok18 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[instruction].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// CompileStrictlyBinaryOpCmd --
//
//	Utility routine to compile the binary operator commands, that strictly
//	accept exactly two arguments.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the compiled command at
//	runtime.
//
//----------------------------------------------------------------------

func sCompileStrictlyBinaryOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, instruction int32, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4068:1: */
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}
	return sCompileAssociativeBinaryOpCmd(tls, interp, parsePtr,
		uintptr(0), instruction, envPtr)
}

//----------------------------------------------------------------------
//
// CompileComparisonOpCmd --
//
//	Utility routine to compile the n-ary comparison operator commands.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the compiled command at
//	runtime.
//
//----------------------------------------------------------------------

func sCompileComparisonOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, instruction int32, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4100:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr

	// TODO: Consider support for compiling expanded args.
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 3 {
		tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok14 := true; ok14; ok14 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok15 := true; ok15; ok15 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok16 := true; ok16; ok16 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok17 := true; ok17; ok17 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok18 := true; ok18; ok18 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok19 := true; ok19; ok19 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok20 := true; ok20; ok20 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		for ok21 := true; ok21; ok21 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(instruction)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if instruction == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok22 := true; ok22; ok22 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[instruction].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok23 := true; ok23; ok23 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	} else if (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr == uintptr(0) {
		// No local variable space!

		return TCL_ERROR
	} else {
		var tmpIndex int32 = XTclFindCompiledLocal(tls, uintptr(0), 0, 1, envPtr)
		var words int32

		tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok24 := true; ok24; ok24 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok25 := true; ok25; ok25 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok26 := true; ok26; ok26 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok27 := true; ok27; ok27 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok28 := true; ok28; ok28 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok29 := true; ok29; ok29 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok30 := true; ok30; ok30 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 1*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 1*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok31 := true; ok31; ok31 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok32 := true; ok32; ok32 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok33 := true; ok33; ok33 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok34 := true; ok34; ok34 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok35 := true; ok35; ok35 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok36 := true; ok36; ok36 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok37 := true; ok37; ok37 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + 2*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + 2*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

		if tmpIndex < 256 {
			for ok38 := true; ok38; ok38 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok39 := true; ok39; ok39 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - tmpIndex
						}
						for ok40 := true; ok40; ok40 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok41 := true; ok41; ok41 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_STORE_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok42 := true; ok42; ok42 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - tmpIndex
						}
						for ok43 := true; ok43; ok43 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

		for ok44 := true; ok44; ok44 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(instruction)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if instruction == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok45 := true; ok45; ok45 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[instruction].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok46 := true; ok46; ok46 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for words = 3; words < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; {
			if tmpIndex < 256 {
				for ok47 := true; ok47; ok47 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_SCALAR1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok48 := true; ok48; ok48 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - tmpIndex
							}
							for ok49 := true; ok49; ok49 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok50 := true; ok50; ok50 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_LOAD_SCALAR4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok51 := true; ok51; ok51 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - tmpIndex
							}
							for ok52 := true; ok52; ok52 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}

			tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
			if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
				for ok53 := true; ok53; ok53 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
					if _objIndexCopy <= 255 {
						for ok54 := true; ok54; ok54 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok55 := true; ok55; ok55 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok56 := true; ok56; ok56 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok57 := true; ok57; ok57 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok58 := true; ok58; ok58 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok59 := true; ok59; ok59 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
			} else {
				(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(words)*4))
				(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(words)*8))
				XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
			}

			if libc.PreIncInt32(&words, 1) < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords {
				if tmpIndex < 256 {
					for ok60 := true; ok60; ok60 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_STORE_SCALAR1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok61 := true; ok61; ok61 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - tmpIndex
								}
								for ok62 := true; ok62; ok62 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok63 := true; ok63; ok63 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STORE_SCALAR4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_STORE_SCALAR4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok64 := true; ok64; ok64 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_STORE_SCALAR4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - tmpIndex
								}
								for ok65 := true; ok65; ok65 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}

			}
			for ok66 := true; ok66; ok66 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(instruction)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if instruction == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok67 := true; ok67; ok67 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[instruction].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok68 := true; ok68; ok68 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
		for ; words > 3; words-- {
			for ok69 := true; ok69; ok69 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_BITAND)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_BITAND == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok70 := true; ok70; ok70 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_BITAND].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok71 := true; ok71; ok71 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}

		// Drop the value from the temp variable; retaining that reference
		// might be expensive elsewhere.

		for ok72 := true; ok72; ok72 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UNSET_SCALAR)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_UNSET_SCALAR == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok73 := true; ok73; ok73 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_UNSET_SCALAR].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok74 := true; ok74; ok74 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok75 := true; ok75; ok75 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(tmpIndex))
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCompile*OpCmd --
//
//	Procedures called to compile the corresponding "::tcl::mathop::*"
//	commands. These are all wrappers around the utility operator command
//	compiler functions, except for the compilers for subtraction and
//	division, which are special.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the compiled command at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileInvertOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4179:1: */
	return sCompileUnaryOpCmd(tls, interp, parsePtr, INST_BITNOT, envPtr)
}

func XTclCompileNotOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4190:1: */
	return sCompileUnaryOpCmd(tls, interp, parsePtr, INST_LNOT, envPtr)
}

func XTclCompileAddOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4201:1: */
	return sCompileAssociativeBinaryOpCmd(tls, interp, parsePtr, ts+18333, INST_ADD,
		envPtr)
}

func XTclCompileMulOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4213:1: */
	return sCompileAssociativeBinaryOpCmd(tls, interp, parsePtr, ts+6615, INST_MULT,
		envPtr)
}

func XTclCompileAndOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4225:1: */
	return sCompileAssociativeBinaryOpCmd(tls, interp, parsePtr, ts+19314, INST_BITAND,
		envPtr)
}

func XTclCompileOrOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4237:1: */
	return sCompileAssociativeBinaryOpCmd(tls, interp, parsePtr, ts+18333, INST_BITOR,
		envPtr)
}

func XTclCompileXorOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4249:1: */
	return sCompileAssociativeBinaryOpCmd(tls, interp, parsePtr, ts+18333, INST_BITXOR,
		envPtr)
}

func XTclCompilePowOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4261:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	var words int32

	// This one has its own implementation because the ** operator is the only
	// one with right associativity.

	for words = 1; words < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; words++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(words)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(words)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

	}
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords <= 2 {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+6615, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok8 := true; ok8; ok8 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok10 := true; ok10; ok10 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		words++
	}
	for libc.PreDecInt32(&words, 1) > 1 {
		for ok14 := true; ok14; ok14 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EXPON)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_EXPON == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok15 := true; ok15; ok15 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_EXPON].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileLshiftOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4292:1: */
	return sCompileStrictlyBinaryOpCmd(tls, interp, parsePtr, INST_LSHIFT, envPtr)
}

func XTclCompileRshiftOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4303:1: */
	return sCompileStrictlyBinaryOpCmd(tls, interp, parsePtr, INST_RSHIFT, envPtr)
}

func XTclCompileModOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4314:1: */
	return sCompileStrictlyBinaryOpCmd(tls, interp, parsePtr, INST_MOD, envPtr)
}

func XTclCompileNeqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4325:1: */
	return sCompileStrictlyBinaryOpCmd(tls, interp, parsePtr, INST_NEQ, envPtr)
}

func XTclCompileStrneqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4336:1: */
	return sCompileStrictlyBinaryOpCmd(tls, interp, parsePtr, INST_STR_NEQ, envPtr)
}

func XTclCompileInOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4347:1: */
	return sCompileStrictlyBinaryOpCmd(tls, interp, parsePtr, INST_LIST_IN, envPtr)
}

func XTclCompileNiOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4358:1: */
	return sCompileStrictlyBinaryOpCmd(tls, interp, parsePtr, INST_LIST_NOT_IN,
		envPtr)
}

func XTclCompileLessOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4370:1: */
	return sCompileComparisonOpCmd(tls, interp, parsePtr, INST_LT, envPtr)
}

func XTclCompileLeqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4381:1: */
	return sCompileComparisonOpCmd(tls, interp, parsePtr, INST_LE, envPtr)
}

func XTclCompileGreaterOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4392:1: */
	return sCompileComparisonOpCmd(tls, interp, parsePtr, INST_GT, envPtr)
}

func XTclCompileGeqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4403:1: */
	return sCompileComparisonOpCmd(tls, interp, parsePtr, INST_GE, envPtr)
}

func XTclCompileEqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4414:1: */
	return sCompileComparisonOpCmd(tls, interp, parsePtr, INST_EQ, envPtr)
}

func XTclCompileStreqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4425:1: */
	return sCompileComparisonOpCmd(tls, interp, parsePtr, INST_STR_EQ, envPtr)
}

func XTclCompileMinusOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4436:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	var words int32

	// TODO: Consider support for compiling expanded args.
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 1 {
		// Fallback to direct eval to report syntax error.

		return TCL_ERROR
	}
	for words = 1; words < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; words++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(words)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(words)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

	}
	if words == 2 {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_UMINUS)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_UMINUS == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_UMINUS].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		return TCL_OK
	}
	if words == 3 {
		for ok10 := true; ok10; ok10 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_SUB)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_SUB == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_SUB].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		return TCL_OK
	}

	// Reverse order of arguments to get precise agreement with [expr] in
	// calcuations, including roundoff errors.

	for ok13 := true; ok13; ok13 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words-1) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words-1) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words-1) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words - 1))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_REVERSE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok14 := true; ok14; ok14 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - (words - 1)
				}
				for ok15 := true; ok15; ok15 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for libc.PreDecInt32(&words, 1) > 1 {
		for ok16 := true; ok16; ok16 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_REVERSE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok17 := true; ok17; ok17 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 2
					}
					for ok18 := true; ok18; ok18 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok19 := true; ok19; ok19 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_SUB)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_SUB == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok20 := true; ok20; ok20 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_SUB].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok21 := true; ok21; ok21 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	return TCL_OK
}

func XTclCompileDivOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompCmdsSZ.c:4482:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1 // TIP #280
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	var words int32

	// TODO: Consider support for compiling expanded args.
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 1 {
		// Fallback to direct eval to report syntax error.

		return TCL_ERROR
	}
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 2 {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+19317, int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}
	for words = 1; words < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; words++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, 0)
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(words)*4))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(words)*8))
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)
		}

	}
	if words <= 3 {
		for ok14 := true; ok14; ok14 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DIV)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DIV == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok15 := true; ok15; ok15 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DIV].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		return TCL_OK
	}

	// Reverse order of arguments to get precise agreement with [expr] in
	// calcuations, including roundoff errors.

	for ok17 := true; ok17; ok17 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words-1) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words-1) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words-1) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(words - 1))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_REVERSE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok18 := true; ok18; ok18 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - (words - 1)
				}
				for ok19 := true; ok19; ok19 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	for libc.PreDecInt32(&words, 1) > 1 {
		for ok20 := true; ok20; ok20 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_REVERSE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(2)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(2))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_REVERSE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok21 := true; ok21; ok21 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_REVERSE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 2
					}
					for ok22 := true; ok22; ok22 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok23 := true; ok23; ok23 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DIV)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_DIV == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok24 := true; ok24; ok24 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DIV].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok25 := true; ok25; ok25 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------
// Macros and flag values used by Tcl bytecode compilation and execution
// modules inside the Tcl core but not used outside.
//----------------------------------------------------------------

// Simplified form to access AuxData.
//
// ClientData TclFetchAuxData(CompileEng *envPtr, int index);

// Form of TclRegisterLiteral with flags == 0. In that case, it is safe to
// cast away constness, and it is cleanest to do that here, all in one place.
//
// int TclRegisterNewLiteral(CompileEnv *envPtr, const char *bytes,
//			     int length);

// Form of TclRegisterLiteral with flags == LITERAL_CMD_NAME. In that case, it
// is safe to cast away constness, and it is cleanest to do that here, all in
// one place.
//
// int TclRegisterNewNSLiteral(CompileEnv *envPtr, const char *bytes,
//			       int length);

// Macro used to manually adjust the stack requirements; used in cases where
// the stack effect cannot be computed from the opcode and its operands, but
// is still known at compile time.
//
// void TclAdjustStackDepth(int delta, CompileEnv *envPtr);

// Macro used to update the stack requirements. It is called by the macros
// TclEmitOpCode, TclEmitInst1 and TclEmitInst4.
// Remark that the very last instruction of a bytecode always reduces the
// stack level: INST_DONE or INST_POP, so that the maxStackdepth is always
// updated.
//
// void TclUpdateStackReqs(unsigned char op, int i, CompileEnv *envPtr);

// Macros used to update the flag that indicates if we are at the start of a
// command, based on whether the opcode is INST_START_COMMAND.
//
// void TclUpdateAtCmdStart(unsigned char op, CompileEnv *envPtr);

// Macro to emit an opcode byte into a CompileEnv's code array. The ANSI C
// "prototype" for this macro is:
//
// void TclEmitOpcode(unsigned char op, CompileEnv *envPtr);

// Macros to emit an integer operand. The ANSI C "prototype" for these macros
// are:
//
// void TclEmitInt1(int i, CompileEnv *envPtr);
// void TclEmitInt4(int i, CompileEnv *envPtr);

// Macros to emit an instruction with signed or unsigned integer operands.
// Four byte integers are stored in "big-endian" order with the high order
// byte stored at the lowest address. The ANSI C "prototypes" for these macros
// are:
//
// void TclEmitInstInt1(unsigned char op, int i, CompileEnv *envPtr);
// void TclEmitInstInt4(unsigned char op, int i, CompileEnv *envPtr);

// Macro to push a Tcl object onto the Tcl evaluation stack. It emits the
// object's one or four byte array index into the CompileEnv's code array.
// These support, respectively, a maximum of 256 (2**8) and 2**32 objects in a
// CompileEnv. The ANSI C "prototype" for this macro is:
//
// void	TclEmitPush(int objIndex, CompileEnv *envPtr);

// Macros to update a (signed or unsigned) integer starting at a pointer. The
// two variants depend on the number of bytes. The ANSI C "prototypes" for
// these macros are:
//
// void TclStoreInt1AtPtr(int i, unsigned char *p);
// void TclStoreInt4AtPtr(int i, unsigned char *p);

// Macros to update instructions at a particular pc with a new op code and a
// (signed or unsigned) int operand. The ANSI C "prototypes" for these macros
// are:
//
// void TclUpdateInstInt1AtPc(unsigned char op, int i, unsigned char *pc);
// void TclUpdateInstInt4AtPc(unsigned char op, int i, unsigned char *pc);

// Macro to fix up a forward jump to point to the current code-generation
// position in the bytecode being created (the most common case). The ANSI C
// "prototypes" for this macro is:
//
// int TclFixupForwardJumpToHere(CompileEnv *envPtr, JumpFixup *fixupPtr,
//				 int threshold);

// Macros to get a signed integer (GET_INT{1,2}) or an unsigned int
// (GET_UINT{1,2}) from a pointer. There are two variants for each return type
// that depend on the number of bytes fetched. The ANSI C "prototypes" for
// these macros are:
//
// int TclGetInt1AtPtr(unsigned char *p);
// int TclGetInt4AtPtr(unsigned char *p);
// unsigned int TclGetUInt1AtPtr(unsigned char *p);
// unsigned int TclGetUInt4AtPtr(unsigned char *p);

// The TclGetInt1AtPtr macro is tricky because we want to do sign extension on
// the 1-byte value. Unfortunately the "char" type isn't signed on all
// platforms so sign-extension doesn't always happen automatically. Sometimes
// we can explicitly declare the pointer to be signed, but other times we have
// to explicitly sign-extend the value in software.

// Macros used to compute the minimum and maximum of two integers. The ANSI C
// "prototypes" for these macros are:
//
// int TclMin(int i, int j);
// int TclMax(int i, int j);

// Convenience macros for use when compiling bodies of commands. The ANSI C
// "prototype" for these macros are:
//
// static void		BODY(Tcl_Token *tokenPtr, int word);

// Convenience macro for use when compiling tokens to be pushed. The ANSI C
// "prototype" for this macro is:
//
// static void		CompileTokens(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp);

// Convenience macros for use when pushing literals. The ANSI C "prototype" for
// these macros are:
//
// static void		PushLiteral(CompileEnv *envPtr,
//			    const char *string, int length);
// static void		PushStringLiteral(CompileEnv *envPtr,
//			    const char *string);

// Macro to advance to the next token; it is more mnemonic than the address
// arithmetic that it replaces. The ANSI C "prototype" for this macro is:
//
// static Tcl_Token *	TokenAfter(Tcl_Token *tokenPtr);

// Macro to get the offset to the next instruction to be issued. The ANSI C
// "prototype" for this macro is:
//
// static int	CurrentOffset(CompileEnv *envPtr);

// Note: the exceptDepth is a bit of a misnomer: TEBC only needs the
// maximal depth of nested CATCH ranges in order to alloc runtime
// memory. These macros should compute precisely that? OTOH, the nesting depth
// of LOOP ranges is an interesting datum for debugging purposes, and that is
// what we compute now.
//
// static int	ExceptionRangeStarts(CompileEnv *envPtr, int index);
// static void	ExceptionRangeEnds(CompileEnv *envPtr, int index);
// static void	ExceptionRangeTarget(CompileEnv *envPtr, int index, LABEL);

// Check if there is an LVT for compiled locals

// Macros for making it easier to deal with tokens and DStrings.

// Macro that encapsulates an efficiency trick that avoids a function call for
// the simplest of compiles. The ANSI C "prototype" for this macro is:
//
// static void		CompileWord(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp, int word);

// TIP #280: Remember the per-word line information of the current command. An
// index is used instead of a pointer as recursive compilation may reallocate,
// i.e. move, the array. This is also the reason to save the nuloc now, it may
// change during the course of the function.
//
// Macro to encapsulate the variable definition and setup.

// Often want to issue one of two versions of an instruction based on whether
// the argument will fit in a single byte or not. This makes it much clearer.

// How to get an anonymous local variable (used for holding temporary values
// off the stack) or a local simple scalar.

// Flags bits used by TclPushVarName.

// DTrace probe macros (NOPs if DTrace support is not enabled).

// Define the following macros to enable debug logging of the DTrace proc,
// cmd, and inst probes. Note that this does _not_ require a platform with
// DTrace, it simply logs all probe output to /tmp/tclDTraceDebug-[pid].log.
//
// If the second macro is defined, logging to file starts immediately,
// otherwise only after the first call to [tcl::dtrace]. Note that the debug
// probe data is always computed, even when it is not logged to file.
//
// Defining the third macro enables debug logging of inst probes (disabled
// by default due to the significant performance impact).

//
// #define TCL_DTRACE_DEBUG 1
// #define TCL_DTRACE_DEBUG_LOG_ENABLED 1
// #define TCL_DTRACE_DEBUG_INST_PROBES 1

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Expression parsing takes place in the routine ParseExpr(). It takes a
// string as input, parses that string, and generates a representation of the
// expression in the form of a tree of operators, a list of literals, a list
// of function names, and an array of Tcl_Token's within a Tcl_Parse struct.
// The tree is composed of OpNodes.

type OpNode1 = struct {
	Fleft       int32
	Fright      int32
	Fp          struct{ Fparent int32 }
	Flexeme     uint8
	Fprecedence uint8
	Fmark       uint8
	Fconstant   uint8
} /* tclCompExpr.c:25:9 */

//----------------------------------------------------------------
// Macros and flag values used by Tcl bytecode compilation and execution
// modules inside the Tcl core but not used outside.
//----------------------------------------------------------------

// Simplified form to access AuxData.
//
// ClientData TclFetchAuxData(CompileEng *envPtr, int index);

// Form of TclRegisterLiteral with flags == 0. In that case, it is safe to
// cast away constness, and it is cleanest to do that here, all in one place.
//
// int TclRegisterNewLiteral(CompileEnv *envPtr, const char *bytes,
//			     int length);

// Form of TclRegisterLiteral with flags == LITERAL_CMD_NAME. In that case, it
// is safe to cast away constness, and it is cleanest to do that here, all in
// one place.
//
// int TclRegisterNewNSLiteral(CompileEnv *envPtr, const char *bytes,
//			       int length);

// Macro used to manually adjust the stack requirements; used in cases where
// the stack effect cannot be computed from the opcode and its operands, but
// is still known at compile time.
//
// void TclAdjustStackDepth(int delta, CompileEnv *envPtr);

// Macro used to update the stack requirements. It is called by the macros
// TclEmitOpCode, TclEmitInst1 and TclEmitInst4.
// Remark that the very last instruction of a bytecode always reduces the
// stack level: INST_DONE or INST_POP, so that the maxStackdepth is always
// updated.
//
// void TclUpdateStackReqs(unsigned char op, int i, CompileEnv *envPtr);

// Macros used to update the flag that indicates if we are at the start of a
// command, based on whether the opcode is INST_START_COMMAND.
//
// void TclUpdateAtCmdStart(unsigned char op, CompileEnv *envPtr);

// Macro to emit an opcode byte into a CompileEnv's code array. The ANSI C
// "prototype" for this macro is:
//
// void TclEmitOpcode(unsigned char op, CompileEnv *envPtr);

// Macros to emit an integer operand. The ANSI C "prototype" for these macros
// are:
//
// void TclEmitInt1(int i, CompileEnv *envPtr);
// void TclEmitInt4(int i, CompileEnv *envPtr);

// Macros to emit an instruction with signed or unsigned integer operands.
// Four byte integers are stored in "big-endian" order with the high order
// byte stored at the lowest address. The ANSI C "prototypes" for these macros
// are:
//
// void TclEmitInstInt1(unsigned char op, int i, CompileEnv *envPtr);
// void TclEmitInstInt4(unsigned char op, int i, CompileEnv *envPtr);

// Macro to push a Tcl object onto the Tcl evaluation stack. It emits the
// object's one or four byte array index into the CompileEnv's code array.
// These support, respectively, a maximum of 256 (2**8) and 2**32 objects in a
// CompileEnv. The ANSI C "prototype" for this macro is:
//
// void	TclEmitPush(int objIndex, CompileEnv *envPtr);

// Macros to update a (signed or unsigned) integer starting at a pointer. The
// two variants depend on the number of bytes. The ANSI C "prototypes" for
// these macros are:
//
// void TclStoreInt1AtPtr(int i, unsigned char *p);
// void TclStoreInt4AtPtr(int i, unsigned char *p);

// Macros to update instructions at a particular pc with a new op code and a
// (signed or unsigned) int operand. The ANSI C "prototypes" for these macros
// are:
//
// void TclUpdateInstInt1AtPc(unsigned char op, int i, unsigned char *pc);
// void TclUpdateInstInt4AtPc(unsigned char op, int i, unsigned char *pc);

// Macro to fix up a forward jump to point to the current code-generation
// position in the bytecode being created (the most common case). The ANSI C
// "prototypes" for this macro is:
//
// int TclFixupForwardJumpToHere(CompileEnv *envPtr, JumpFixup *fixupPtr,
//				 int threshold);

// Macros to get a signed integer (GET_INT{1,2}) or an unsigned int
// (GET_UINT{1,2}) from a pointer. There are two variants for each return type
// that depend on the number of bytes fetched. The ANSI C "prototypes" for
// these macros are:
//
// int TclGetInt1AtPtr(unsigned char *p);
// int TclGetInt4AtPtr(unsigned char *p);
// unsigned int TclGetUInt1AtPtr(unsigned char *p);
// unsigned int TclGetUInt4AtPtr(unsigned char *p);

// The TclGetInt1AtPtr macro is tricky because we want to do sign extension on
// the 1-byte value. Unfortunately the "char" type isn't signed on all
// platforms so sign-extension doesn't always happen automatically. Sometimes
// we can explicitly declare the pointer to be signed, but other times we have
// to explicitly sign-extend the value in software.

// Macros used to compute the minimum and maximum of two integers. The ANSI C
// "prototypes" for these macros are:
//
// int TclMin(int i, int j);
// int TclMax(int i, int j);

// Convenience macros for use when compiling bodies of commands. The ANSI C
// "prototype" for these macros are:
//
// static void		BODY(Tcl_Token *tokenPtr, int word);

// Convenience macro for use when compiling tokens to be pushed. The ANSI C
// "prototype" for this macro is:
//
// static void		CompileTokens(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp);

// Convenience macros for use when pushing literals. The ANSI C "prototype" for
// these macros are:
//
// static void		PushLiteral(CompileEnv *envPtr,
//			    const char *string, int length);
// static void		PushStringLiteral(CompileEnv *envPtr,
//			    const char *string);

// Macro to advance to the next token; it is more mnemonic than the address
// arithmetic that it replaces. The ANSI C "prototype" for this macro is:
//
// static Tcl_Token *	TokenAfter(Tcl_Token *tokenPtr);

// Macro to get the offset to the next instruction to be issued. The ANSI C
// "prototype" for this macro is:
//
// static int	CurrentOffset(CompileEnv *envPtr);

// Note: the exceptDepth is a bit of a misnomer: TEBC only needs the
// maximal depth of nested CATCH ranges in order to alloc runtime
// memory. These macros should compute precisely that? OTOH, the nesting depth
// of LOOP ranges is an interesting datum for debugging purposes, and that is
// what we compute now.
//
// static int	ExceptionRangeStarts(CompileEnv *envPtr, int index);
// static void	ExceptionRangeEnds(CompileEnv *envPtr, int index);
// static void	ExceptionRangeTarget(CompileEnv *envPtr, int index, LABEL);

// Check if there is an LVT for compiled locals

// Macros for making it easier to deal with tokens and DStrings.

// Macro that encapsulates an efficiency trick that avoids a function call for
// the simplest of compiles. The ANSI C "prototype" for this macro is:
//
// static void		CompileWord(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp, int word);

// TIP #280: Remember the per-word line information of the current command. An
// index is used instead of a pointer as recursive compilation may reallocate,
// i.e. move, the array. This is also the reason to save the nuloc now, it may
// change during the course of the function.
//
// Macro to encapsulate the variable definition and setup.

// Often want to issue one of two versions of an instruction based on whether
// the argument will fit in a single byte or not. This makes it much clearer.

// How to get an anonymous local variable (used for holding temporary values
// off the stack) or a local simple scalar.

// Flags bits used by TclPushVarName.

// DTrace probe macros (NOPs if DTrace support is not enabled).

// Define the following macros to enable debug logging of the DTrace proc,
// cmd, and inst probes. Note that this does _not_ require a platform with
// DTrace, it simply logs all probe output to /tmp/tclDTraceDebug-[pid].log.
//
// If the second macro is defined, logging to file starts immediately,
// otherwise only after the first call to [tcl::dtrace]. Note that the debug
// probe data is always computed, even when it is not logged to file.
//
// Defining the third macro enables debug logging of inst probes (disabled
// by default due to the significant performance impact).

//
// #define TCL_DTRACE_DEBUG 1
// #define TCL_DTRACE_DEBUG_LOG_ENABLED 1
// #define TCL_DTRACE_DEBUG_INST_PROBES 1

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Expression parsing takes place in the routine ParseExpr(). It takes a
// string as input, parses that string, and generates a representation of the
// expression in the form of a tree of operators, a list of literals, a list
// of function names, and an array of Tcl_Token's within a Tcl_Parse struct.
// The tree is composed of OpNodes.

type OpNode = OpNode1 /* tclCompExpr.c:36:3 */

// Here the same information contained in the comments above is stored in
// inverted form, so that given a lexeme, one can quickly look up its
// precedence value.

var prec = [136]uint8{
	// Non-operator lexemes
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0),
	// Binary operator lexemes
	PREC_ADD,         // BINARY_PLUS
	PREC_ADD,         // BINARY_MINUS
	PREC_COMMA,       // COMMA
	PREC_MULT,        // MULT
	PREC_MULT,        // DIVIDE
	PREC_MULT,        // MOD
	PREC_COMPARE,     // LESS
	PREC_COMPARE,     // GREATER
	PREC_BIT_AND,     // BIT_AND
	PREC_BIT_XOR,     // BIT_XOR
	PREC_BIT_OR,      // BIT_OR
	PREC_CONDITIONAL, // QUESTION
	PREC_CONDITIONAL, // COLON
	PREC_SHIFT,       // LEFT_SHIFT
	PREC_SHIFT,       // RIGHT_SHIFT
	PREC_COMPARE,     // LEQ
	PREC_COMPARE,     // GEQ
	PREC_EQUAL,       // EQUAL
	PREC_EQUAL,       // NEQ
	PREC_AND,         // AND
	PREC_OR,          // OR
	PREC_EQUAL,       // STREQ
	PREC_EQUAL,       // STRNEQ
	PREC_EXPON,       // EXPON
	PREC_EQUAL,       // IN_LIST
	PREC_EQUAL,       // NOT_IN_LIST
	PREC_CLOSE_PAREN, // CLOSE_PAREN
	PREC_END,         // END
	// Expansion room for more binary operators
	uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0),
	// Unary operator lexemes
	PREC_UNARY,      // UNARY_PLUS
	PREC_UNARY,      // UNARY_MINUS
	PREC_UNARY,      // FUNCTION
	PREC_START,      // START
	PREC_OPEN_PAREN, // OPEN_PAREN
	PREC_UNARY,      // NOT
	PREC_UNARY,      // BIT_NOT
} /* tclCompExpr.c:328:28 */

// A table mapping lexemes to bytecode instructions, used by CompileExprTree().

var instruction = [136]uint8{
	// Non-operator lexemes
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0),
	// Binary operator lexemes
	uint8(INST_ADD),         // BINARY_PLUS
	uint8(INST_SUB),         // BINARY_MINUS
	uint8(0),                // COMMA
	uint8(INST_MULT),        // MULT
	uint8(INST_DIV),         // DIVIDE
	uint8(INST_MOD),         // MOD
	uint8(INST_LT),          // LESS
	uint8(INST_GT),          // GREATER
	uint8(INST_BITAND),      // BIT_AND
	uint8(INST_BITXOR),      // BIT_XOR
	uint8(INST_BITOR),       // BIT_OR
	uint8(0),                // QUESTION
	uint8(0),                // COLON
	uint8(INST_LSHIFT),      // LEFT_SHIFT
	uint8(INST_RSHIFT),      // RIGHT_SHIFT
	uint8(INST_LE),          // LEQ
	uint8(INST_GE),          // GEQ
	uint8(INST_EQ),          // EQUAL
	uint8(INST_NEQ),         // NEQ
	uint8(0),                // AND
	uint8(0),                // OR
	uint8(INST_STR_EQ),      // STREQ
	uint8(INST_STR_NEQ),     // STRNEQ
	uint8(INST_EXPON),       // EXPON
	uint8(INST_LIST_IN),     // IN_LIST
	uint8(INST_LIST_NOT_IN), // NOT_IN_LIST
	uint8(0),                // CLOSE_PAREN
	uint8(0),                // END
	// Expansion room for more binary operators
	uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0),
	// Unary operator lexemes
	uint8(INST_UPLUS),  // UNARY_PLUS
	uint8(INST_UMINUS), // UNARY_MINUS
	uint8(0),           // FUNCTION
	uint8(0),           // START
	uint8(0),           // OPEN_PAREN
	uint8(INST_LNOT),   // NOT
	uint8(INST_BITNOT), // BIT_NOT
} /* tclCompExpr.c:383:28 */

// A table mapping a byte value to the corresponding lexeme for use by
// ParseLexeme().

var sLexeme = [128]uint8{
	uint8(INVALID) /* NUL */, uint8(INVALID), /* SOH */
	uint8(INVALID) /* STX */, uint8(INVALID), /* ETX */
	uint8(INVALID) /* EOT */, uint8(INVALID), /* ENQ */
	uint8(INVALID) /* ACK */, uint8(INVALID), /* BEL */
	uint8(INVALID) /* BS */, uint8(INVALID), /* HT */
	uint8(INVALID) /* LF */, uint8(INVALID), /* VT */
	uint8(INVALID) /* FF */, uint8(INVALID), /* CR */
	uint8(INVALID) /* SO */, uint8(INVALID), /* SI */
	uint8(INVALID) /* DLE */, uint8(INVALID), /* DC1 */
	uint8(INVALID) /* DC2 */, uint8(INVALID), /* DC3 */
	uint8(INVALID) /* DC4 */, uint8(INVALID), /* NAK */
	uint8(INVALID) /* SYN */, uint8(INVALID), /* ETB */
	uint8(INVALID) /* CAN */, uint8(INVALID), /* EM */
	uint8(INVALID) /* SUB */, uint8(INVALID), /* ESC */
	uint8(INVALID) /* FS */, uint8(INVALID), /* GS */
	uint8(INVALID) /* RS */, uint8(INVALID), /* US */
	uint8(INVALID) /* SPACE */, uint8(0), /* ! or != */
	uint8(LEAF | 6), uint8(INVALID), /* # */
	uint8(LEAF | 5), uint8(BINARY | 6),
	uint8(0) /* & or && */, uint8(INVALID), /* ' */
	uint8(UNARY | 5), uint8(BINARY | 27),
	uint8(0) /* * or ** */, uint8(PLUS), /* + */
	uint8(BINARY | 3), uint8(MINUS), /* - */
	uint8(0) /* . */, uint8(BINARY | 5),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0-9
	uint8(BINARY | 13), uint8(INVALID), /* ; */
	uint8(0),                           /* < or << or <= */
	uint8(0),                           /* == or INVALID */
	uint8(0),                           /* > or >> or >= */
	uint8(BINARY | 12), uint8(INVALID), /* @ */
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // A-M
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // N-Z
	uint8(LEAF | 2), uint8(INVALID), /* \ */
	uint8(INVALID) /* ] */, uint8(BINARY | 10),
	uint8(INVALID) /* _ */, uint8(INVALID), /* ` */
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // a-m
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // n-z
	uint8(LEAF | 4), uint8(0), /* | or || */
	uint8(INVALID) /* } */, uint8(UNARY | 7),
	uint8(INVALID), // DEL
} /* tclCompExpr.c:439:28 */

// The JumpList struct is used to create a stack of data needed for the
// TclEmitForwardJump() and TclFixupForwardJump() calls that are performed
// when compiling the short-circuiting operators QUESTION/COLON, AND, and OR.
// Keeping a stack permits the CompileExprTree() routine to be non-recursive.

type JumpList1 = struct {
	Fjump JumpFixup
	Fnext uintptr
} /* tclCompExpr.c:489:9 */

// The JumpList struct is used to create a stack of data needed for the
// TclEmitForwardJump() and TclFixupForwardJump() calls that are performed
// when compiling the short-circuiting operators QUESTION/COLON, AND, and OR.
// Keeping a stack permits the CompileExprTree() routine to be non-recursive.

type JumpList = JumpList1 /* tclCompExpr.c:494:3 */

//----------------------------------------------------------------------
//
// ParseExpr --
//
//	Given a string, the numBytes bytes starting at start, this function
//	parses it as a Tcl expression and constructs a tree representing the
//	structure of the expression. The caller must pass in empty lists as
//	the funcList and litList arguments. The elements of the parsed
//	expression are returned to the caller as that tree, a list of literal
//	values, a list of function names, and in Tcl_Tokens added to a
//	Tcl_Parse struct passed in by the caller.
//
// Results:
//	If the string is successfully parsed as a valid Tcl expression, TCL_OK
//	is returned, and data about the expression structure is written to the
//	last four arguments. If the string cannot be parsed as a valid Tcl
//	expression, TCL_ERROR is returned, and if interp is non-NULL, an error
//	message is written to interp.
//
// Side effects:
//	Memory will be allocated. If TCL_OK is returned, the caller must clean
//	up the returned data structures. The (OpNode *) value written to
//	opTreePtr should be passed to ckfree() and the parsePtr argument
//	should be passed to Tcl_FreeParse(). The elements appended to the
//	litList and funcList will automatically be freed whenever the refcount
//	on those lists indicates they can be freed.
//
//----------------------------------------------------------------------

func sParseExpr(tls *libc.TLS, interp uintptr, start uintptr, numBytes int32, opTreePtr uintptr, litList uintptr, funcList uintptr, parsePtr uintptr, parseOnly int32) int32 { /* tclCompExpr.c:548:1: */
	bp := tls.Alloc(384)
	defer tls.Free(384)

	var nodes uintptr // Pointer to the OpNode storage array where
	// we build the parse tree.
	var nodesAvailable uint32 // Initial size of the storage array. This
	// value establishes a minimum tree memory
	// cost of only about 1 kibyte, and is large
	// enough for most expressions to parse with
	// no need for array growth and
	// reallocation.
	var nodesUsed uint32 // Number of OpNodes filled.
	var scanned int32    // Capture number of byte scanned by parsing
	// routines.
	var lastParsed int32 // Stores info about what the lexeme parsed
	// the previous pass through the parsing loop
	// was. If it was an operator, lastParsed is
	// the index of the OpNode for that operator.
	// If it was not an operator, lastParsed holds
	// an OperandTypes value encoding what we need
	// to know about it.
	var incomplete int32 // Index of the most recent incomplete tree in
	// the OpNode array. Heads a stack of
	// incomplete trees linked by p.prev.
	var complete int32 // "Index" of the complete tree (that is, a
	// complete subexpression) determined at the
	// moment. OT_EMPTY is a nonsense value used
	// only to silence compiler warnings. During a
	// parse, complete will always hold an index
	// or an OperandTypes value pointing to an
	// actual leaf at the time the complete tree
	// is needed.

	// These variables control generation of the error message.

	var msg uintptr  // The error message.
	var post uintptr // In a few cases, an additional postscript
	// for the error message, supplying more
	// information after the error msg and
	// location have been reported.
	var errCode uintptr // The detail word of the errorCode list, or
	// NULL to indicate that no changes to the
	// errorCode are to be done.
	var subErrCode uintptr
	// Extra information for use in generating the
	// errorCode.
	var mark uintptr // In the portion of the complete error
	// message where the error location is
	// reported, this "mark" substring is inserted
	// into the string being parsed to aid in
	// pinpointing the location of the syntax
	// error in the expression.
	var insertMark int32 // A boolean controlling whether the "mark"
	// should be inserted.
	var limit int32
	var cachePtr uintptr
	var cachePtr1 uintptr
	var size uint32
	var newPtr uintptr
	var _objPtr uintptr
	// var stop uintptr at bp+368, 8

	// var b int32 at bp+360, 4

	var _objPtr1 uintptr
	var allocated int32
	var oldPtr uintptr
	var newPtr1 uintptr
	var _needed int32
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var nestedPtr uintptr
	var _objPtr2 uintptr
	// Each LEAF results in either a literal getting appended to the
	// litList, or a sequence of Tcl_Tokens representing a Tcl word
	// getting appended to the parsePtr->tokens. No OpNode is filled
	// for this lexeme.

	var tokenPtr uintptr
	// var end uintptr at bp+376, 8

	var wordIndex int32
	var code int32
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	var cachePtr6 uintptr
	var cachePtr7 uintptr
	var cachePtr8 uintptr
	var cachePtr9 uintptr
	var cachePtr10 uintptr
	var cachePtr11 uintptr
	var incompletePtr uintptr
	var precedence uint8
	var nodePtr uintptr // Points to the OpNode we may fill this pass
	// through the loop.
	// var lexeme uint8 at bp+344, 1
	// The lexeme we parse this iteration.
	// var literal uintptr at bp+352, 8

	var _objPtr3 uintptr
	var _objPtr4 uintptr
	nodes = uintptr(0)
	nodesAvailable = uint32(64)
	nodesUsed = uint32(0)
	scanned = 0
	complete = OT_EMPTY
	msg = uintptr(0)
	post = uintptr(0)
	errCode = uintptr(0)
	subErrCode = uintptr(0)
	mark = ts + 19321 /* "_@_" */
	insertMark = 0
	limit = 25 // Portions of the error message are
	// constructed out of substrings of the
	// original expression. In order to keep the
	// error message readable, we impose this
	// limit on the substring size we extract.

	XTclParseInit(tls, interp, start, numBytes, parsePtr)

	nodes = XTclpAlloc(tls, uint32(uint64(nodesAvailable)*uint64(unsafe.Sizeof(OpNode{}))))
	if !(nodes == uintptr(0)) {
		goto __1
	}
__2:
	;
__5:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __8
	}
	msg = XTclThreadAllocObj(tls)
	goto __9
__8:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__9:
	;
	goto __6
__6:
	if 0 != 0 {
		goto __5
	}
	goto __7
__7:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([38]int8{}))-uint64(1)) == 0) {
		goto __10
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __11
__10:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([38]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19325, uint64(int32(uint64(unsafe.Sizeof([38]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 37)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([38]int8{})) - uint64(1))
__11:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __3
__3:
	if 0 != 0 {
		goto __2
	}
	goto __4
__4:
	;
	errCode = ts + 19363 /* "NOMEM" */
	goto error
__1:
	;

	// Initialize the parse tree with the special "START" node.

	(*OpNode)(unsafe.Pointer(nodes)).Flexeme = uint8(UNARY | 4)
	(*OpNode)(unsafe.Pointer(nodes)).Fprecedence = prec[UNARY|4]
	(*OpNode)(unsafe.Pointer(nodes)).Fmark = MARK_RIGHT
	(*OpNode)(unsafe.Pointer(nodes)).Fconstant = uint8(1)
	incomplete = libc.AssignInt32(&lastParsed, int32(nodesUsed))
	nodesUsed++

	// Main parsing loop parses one lexeme per iteration. We exit the loop
	// only when there's a syntax error with a "goto error" which takes us to
	// the error handling code following the loop, or when we've successfully
	// completed the parse and we return to the caller.

__12:
	if !(1 != 0) {
		goto __13
	} // Filled by the ParseLexeme() call when a
	// literal is parsed that has a Tcl_Obj rep
	// worth preserving.

	// Each pass through this loop adds up to one more OpNode. Allocate
	// space for one if required.

	if !(nodesUsed >= nodesAvailable) {
		goto __14
	}
	size = nodesUsed * uint32(2)
	newPtr = uintptr(0)

__15:
	if !(uint64(size) <= uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(OpNode{}))) {
		goto __18
	}
	newPtr = XTclpRealloc(tls, nodes, uint32(uint64(size)*uint64(unsafe.Sizeof(OpNode{}))))
__18:
	;
	goto __16
__16:
	if newPtr == uintptr(0) &&
		libc.AssignSubUint32(&size, (size-nodesUsed)/uint32(2)) > nodesUsed {
		goto __15
	}
	goto __17
__17:
	;
	if !(newPtr == uintptr(0)) {
		goto __19
	}
__20:
	;
__23:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __26
	}
	msg = XTclThreadAllocObj(tls)
	goto __27
__26:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__27:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([38]int8{}))-uint64(1)) == 0) {
		goto __28
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __29
__28:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([38]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19325, uint64(int32(uint64(unsafe.Sizeof([38]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 37)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([38]int8{})) - uint64(1))
__29:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	errCode = ts + 19363 /* "NOMEM" */
	goto error
__19:
	;
	nodesAvailable = size
	nodes = newPtr
__14:
	;
	nodePtr = nodes + uintptr(nodesUsed)*16

	// Skip white space between lexemes.

	scanned = XTclParseAllWhiteSpace(tls, start, numBytes)
	start += uintptr(scanned)
	numBytes = numBytes - scanned

	scanned = sParseLexeme(tls, start, numBytes, bp+344, bp+352)

	// Use context to categorize the lexemes that are ambiguous.

	if !(NODE_TYPE&int32(*(*uint8)(unsafe.Pointer(bp + 344))) == 0) {
		goto __30
	}

	switch int32(*(*uint8)(unsafe.Pointer(bp + 344 /* lexeme */))) {
	case INVALID:
		goto __32
	case INCOMPLETE:
		goto __33
	case BAREWORD:
		goto __34
	case PLUS:
		goto __35
	case MINUS:
		goto __36
	}
	goto __31
__32:
	msg = XTcl_ObjPrintf(tls, ts+19369,
		libc.VaList(bp, scanned, start))
	errCode = ts + 19394 /* "BADCHAR" */
	goto error
__33:
	msg = XTcl_ObjPrintf(tls, ts+19402,
		libc.VaList(bp+16, scanned, start))
	errCode = ts + 19429 /* "PARTOP" */
	goto error
__34:

	// Most barewords in an expression are a syntax error. The
	// exceptions are that when a bareword is followed by an open
	// paren, it might be a function call, and when the bareword
	// is a legal literal boolean value, we accept that as well.

	if !(int32(*(*int8)(unsafe.Pointer(start + uintptr(scanned+XTclParseAllWhiteSpace(tls,
		start+uintptr(scanned), numBytes-scanned))))) == '(') {
		goto __37
	}
	*(*uint8)(unsafe.Pointer(bp + 344 /* lexeme */)) = uint8(UNARY | BAREWORD)

	// When we compile the expression we'll need the function
	// name, and there's no place in the parse tree to store
	// it, so we keep a separate list of all the function
	// names we've parsed in the order we found them.

	XTcl_ListObjAppendElement(tls, uintptr(0), funcList, *(*uintptr)(unsafe.Pointer(bp + 352 /* literal */)))
	goto __38
__37:
	if !(XTcl_GetBooleanFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 352)), bp+360) == TCL_OK) {
		goto __39
	}
	*(*uint8)(unsafe.Pointer(bp + 344 /* lexeme */)) = uint8(LEAF | BAREWORD)
	goto __40
__39:
__41:
	_objPtr = *(*uintptr)(unsafe.Pointer(bp + 352))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __44
	}
	XTclFreeObj(tls, _objPtr)
__44:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
	msg = XTcl_ObjPrintf(tls, ts+19436,
		libc.VaList(bp+32, func() int32 {
			if scanned < limit {
				return scanned
			}
			return limit - 3
		}(), start,
			func() uintptr {
				if scanned < limit {
					return ts + 2046 /* "" */
				}
				return ts + 7891 /* "..." */
			}()))
	post = XTcl_ObjPrintf(tls,
		ts+19462,
		libc.VaList(bp+56, func() int32 {
			if scanned < limit {
				return scanned
			}
			return limit - 3
		}(),
			start, func() uintptr {
				if scanned < limit {
					return ts + 2046 /* "" */
				}
				return ts + 7891 /* "..." */
			}(),
			func() int32 {
				if scanned < limit {
					return scanned
				}
				return limit - 3
			}(),
			start, func() uintptr {
				if scanned < limit {
					return ts + 2046 /* "" */
				}
				return ts + 7891 /* "..." */
			}()))
	XTcl_AppendPrintfToObj(tls, post, ts+19496,
		libc.VaList(bp+104, func() int32 {
			if scanned < limit {
				return scanned
			}
			return limit - 3
		}(),
			start, func() uintptr {
				if scanned < limit {
					return ts + 2046 /* "" */
				}
				return ts + 7891 /* "..." */
			}()))
	errCode = ts + 19521 /* "BAREWORD" */
	if !(int32(*(*int8)(unsafe.Pointer(start))) == '0') {
		goto __45
	}
	XTclParseNumber(tls, uintptr(0), uintptr(0), uintptr(0), start, scanned,
		bp+368, TCL_PARSE_NO_WHITESPACE)

	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 368)))))))*2)))&int32(X_ISdigit) != 0 || *(*uintptr)(unsafe.Pointer(bp + 368)) == start+uintptr(1)) {
		goto __46
	}
	switch int32(*(*int8)(unsafe.Pointer(start + 1))) {
	case 'b':
		goto __48
	case 'o':
		goto __49
	default:
		goto __50
	}
	goto __47
__48:
	XTcl_AppendToObj(tls, post,
		ts+19530, -1)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_BAD_NUMBER
	errCode = ts + 19556   /* "BADNUMBER" */
	subErrCode = ts + 9997 /* "BINARY" */
	goto __47
__49:
	XTcl_AppendToObj(tls, post,
		ts+19566, -1)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_BAD_NUMBER
	errCode = ts + 19556    /* "BADNUMBER" */
	subErrCode = ts + 19591 /* "OCTAL" */
	goto __47
__50:
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(start + 1)))))*2)))&int32(X_ISdigit) != 0) {
		goto __51
	}
	XTcl_AppendToObj(tls, post,
		ts+19566, -1)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_BAD_NUMBER
	errCode = ts + 19556    /* "BADNUMBER" */
	subErrCode = ts + 19591 /* "OCTAL" */
__51:
	;
	goto __47
__47:
	;
__46:
	;
__45:
	;
	goto error
__40:
	;
__38:
	;
	goto __31
__35:
__36:
	if !(lastParsed >= 0) {
		goto __52
	}
	// A "+" or "-" coming just after another operator must be
	// interpreted as a unary operator.

	*(*uint8)(unsafe.Pointer(bp + 344 /* lexeme */)) |= uint8(UNARY)
	goto __53
__52:
	*(*uint8)(unsafe.Pointer(bp + 344 /* lexeme */)) |= uint8(BINARY)
__53:
	;
__31:
	;
__30:
	; // Uncategorized lexemes

	// Handle lexeme based on its category.

	switch NODE_TYPE & int32(*(*uint8)(unsafe.Pointer(bp + 344))) {
	case LEAF:
		goto __55 // case LEAF

	case UNARY:
		goto __56

	case BINARY:
		goto __57
	}
	goto __54
__55:
	*(*uintptr)(unsafe.Pointer(bp + 376 /* end */)) = start
	code = TCL_OK

	// A leaf operand appearing just after something that's not an
	// operator is a syntax error.

	if !(lastParsed < 0) {
		goto __58
	}
	msg = XTcl_ObjPrintf(tls, ts+19597, libc.VaList(bp+128, mark))
	errCode = ts + 14589 /* "MISSING" */
	scanned = 0
	insertMark = 1

	// Free any literal to avoid a memleak.

	if !(int32(*(*uint8)(unsafe.Pointer(bp + 344))) == LEAF|1 || int32(*(*uint8)(unsafe.Pointer(bp + 344))) == LEAF|BAREWORD) {
		goto __59
	}
__60:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 352))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __63
	}
	XTclFreeObj(tls, _objPtr1)
__63:
	;
	goto __61
__61:
	if 0 != 0 {
		goto __60
	}
	goto __62
__62:
	;
__59:
	;
	goto error
__58:
	;

	switch int32(*(*uint8)(unsafe.Pointer(bp + 344 /* lexeme */))) {
	case LEAF | 1:
		goto __65
	case LEAF | BAREWORD:
		goto __66

	default:
		goto __67
	}
	goto __64
__65:
__66:
	// TODO: Consider using a dict or hash to collapse all
	// duplicate literals into a single representative value.
	// (Like what is done with [split $s {}]).
	// Pro:	~75% memory saving on expressions like
	//	{1+1+1+1+1+.....+1} (Convert "pointer + Tcl_Obj" cost
	//	to "pointer" cost only)
	// Con:	Cost of the dict store/retrieve on every literal in
	//	every expression when expressions like the above tend
	//	to be uncommon.
	//	The memory savings is temporary; Compiling to bytecode
	//	will collapse things as literals are registered
	//	anyway, so the savings applies only to the time
	//	between parsing and compiling. Possibly important due
	//	to high-water mark nature of memory allocation.

	XTcl_ListObjAppendElement(tls, uintptr(0), litList, *(*uintptr)(unsafe.Pointer(bp + 352 /* literal */)))
	complete = libc.AssignInt32(&lastParsed, OT_LITERAL)
	start += uintptr(scanned)
	numBytes = numBytes - scanned
	goto __12

__67:
	goto __64
__64:
	;

	// Remaining LEAF cases may involve filling Tcl_Tokens, so make
	// room for at least 2 more tokens.

__68:
	_needed = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + 2
	if !(_needed > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __71
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp+136, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__71:
	;
	if !(_needed > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __72
	}
	allocated = 2 * _needed
	oldPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr == parsePtr+96) {
		goto __73
	}
	oldPtr = uintptr(0)
__73:
	;
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __74
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__74:
	;
	newPtr1 = XTclpRealloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr1 == uintptr(0)) {
		goto __75
	}
	allocated = int32(uint64(_needed+2) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __76
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__76:
	;
	newPtr1 = XTcl_Realloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__75:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated
	if !(oldPtr == uintptr(0)) {
		goto __77
	}
	libc.Xmemcpy(tls, newPtr1, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__77:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr1
__72:
	;
	goto __69
__69:
	if 0 != 0 {
		goto __68
	}
	goto __70
__70:
	;
	wordIndex = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(wordIndex)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_WORD
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = start
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++

	switch int32(*(*uint8)(unsafe.Pointer(bp + 344 /* lexeme */))) {
	case LEAF | 6:
		goto __79

	case LEAF | 4:
		goto __80

	case LEAF | 5:
		goto __81

	case LEAF | 2:
		goto __82
	}
	goto __78
__79:
	code = XTcl_ParseQuotedString(tls, uintptr(0), start, numBytes,
		parsePtr, 1, bp+376)
	scanned = int32((int64(*(*uintptr)(unsafe.Pointer(bp + 376))) - int64(start)) / 1)
	goto __78

__80:
	code = XTcl_ParseBraces(tls, uintptr(0), start, numBytes,
		parsePtr, 1, bp+376)
	scanned = int32((int64(*(*uintptr)(unsafe.Pointer(bp + 376))) - int64(start)) / 1)
	goto __78

__81:
	code = XTcl_ParseVarName(tls, uintptr(0), start, numBytes, parsePtr, 1)

	// Handle the quirk that Tcl_ParseVarName reports a successful
	// parse even when it gets only a "$" with no variable name.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(wordIndex)*24 + uintptr(1)*24
	if !(code == TCL_OK && (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_VARIABLE) {
		goto __83
	}
__84:
	;
__87:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __90
	}
	msg = XTclThreadAllocObj(tls)
	goto __91
__90:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__91:
	;
	goto __88
__88:
	if 0 != 0 {
		goto __87
	}
	goto __89
__89:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1)) == 0) {
		goto __92
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __93
__92:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19666, uint64(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 21)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([22]int8{})) - uint64(1))
__93:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __85
__85:
	if 0 != 0 {
		goto __84
	}
	goto __86
__86:
	;
	errCode = ts + 19394 /* "BADCHAR" */
	goto error
__83:
	;
	scanned = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize
	goto __78

__82:
	nestedPtr =
		XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(Tcl_Parse{})))

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_COMMAND
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = start
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0

	*(*uintptr)(unsafe.Pointer(bp + 376 /* end */)) = start + uintptr(numBytes)
	start++
__94:
	if !(1 != 0) {
		goto __95
	}
	code = XTcl_ParseCommand(tls, interp, start, int32((int64(*(*uintptr)(unsafe.Pointer(bp + 376)))-int64(start))/1), 1,
		nestedPtr)
	if !(code != TCL_OK) {
		goto __96
	}
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).FerrorType
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fincomplete
	goto __95
__96:
	;
	start = (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).FcommandStart + uintptr((*Tcl_Parse)(unsafe.Pointer(nestedPtr)).FcommandSize)
	XTcl_FreeParse(tls, nestedPtr)
	if !((*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm < *(*uintptr)(unsafe.Pointer(bp + 376)) && int32(*(*int8)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm))) == ']' &&
		!((*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fincomplete != 0)) {
		goto __97
	}
	goto __95
__97:
	;

	if !(start == *(*uintptr)(unsafe.Pointer(bp + 376))) {
		goto __98
	}
__99:
	;
__102:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __105
	}
	msg = XTclThreadAllocObj(tls)
	goto __106
__105:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__106:
	;
	goto __103
__103:
	if 0 != 0 {
		goto __102
	}
	goto __104
__104:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1)) == 0) {
		goto __107
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __108
__107:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19688, uint64(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 21)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([22]int8{})) - uint64(1))
__108:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __100
__100:
	if 0 != 0 {
		goto __99
	}
	goto __101
__101:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_MISSING_BRACKET
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = 1
	code = TCL_ERROR
	errCode = ts + 16245 /* "UNBALANCED" */
	goto __95
__98:
	;
	goto __94
__95:
	;
	XTclStackFree(tls, interp, nestedPtr)
	*(*uintptr)(unsafe.Pointer(bp + 376 /* end */)) = start
	start = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart
	scanned = int32((int64(*(*uintptr)(unsafe.Pointer(bp + 376))) - int64(start)) / 1)
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = scanned
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	goto __78
	// SCRIPT case
__78:
	;
	if !(code != TCL_OK) {
		goto __109
	}
	// Here we handle all the syntax errors generated by the
	// Tcl_Token generating parsing routines called in the switch
	// just above. If the value of parsePtr->incomplete is 1, then
	// the error was an unbalanced '[', '(', '{', or '"' and
	// parsePtr->term is pointing to that unbalanced character. If
	// the value of parsePtr->incomplete is 0, then the error is
	// one of lacking whitespace following a quoted word, for
	// example: expr {[an error {foo}bar]}, and parsePtr->term
	// points to where the whitespace is missing. We reset our
	// values of start and scanned so that when our error message
	// is constructed, the location of the syntax error is sure to
	// appear in it, even if the quoted expression is truncated.

	start = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm
	scanned = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete != 0) {
		goto __110
	}
	errCode = ts + 16245 /* "UNBALANCED" */
__110:
	;
	goto error
__109:
	;

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(wordIndex)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = scanned
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens - wordIndex - 1
	if !(!(parseOnly != 0) && (int32(*(*uint8)(unsafe.Pointer(bp + 344))) == LEAF|6 || int32(*(*uint8)(unsafe.Pointer(bp + 344))) == LEAF|4)) {
		goto __111
	}
	// When this expression is destined to be compiled, and a
	// braced or quoted word within an expression is known at
	// compile time (no runtime substitutions in it), we can store
	// it as a literal rather than in its tokenized form. This is
	// an advantage since the compiled bytecode is going to need
	// the argument in Tcl_Obj form eventually, so it's just as
	// well to get there now. Another advantage is that with this
	// conversion, larger constant expressions might be grown and
	// optimized.
	//
	// On the contrary, if the end goal of this parse is to fill a
	// Tcl_Parse for a caller of Tcl_ParseExpr(), then it's
	// wasteful to convert to a literal only to convert back again
	// later.

	*(*uintptr)(unsafe.Pointer(bp + 352 /* literal */)) = XTcl_NewObj(tls)
	if !(XTclWordKnownAtCompileTime(tls, tokenPtr, *(*uintptr)(unsafe.Pointer(bp + 352))) != 0) {
		goto __112
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), litList, *(*uintptr)(unsafe.Pointer(bp + 352 /* literal */)))
	complete = libc.AssignInt32(&lastParsed, OT_LITERAL)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens = wordIndex
	goto __54
__112:
	;
__113:
	_objPtr2 = *(*uintptr)(unsafe.Pointer(bp + 352))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __116
	}
	XTclFreeObj(tls, _objPtr2)
__116:
	;
	goto __114
__114:
	if 0 != 0 {
		goto __113
	}
	goto __115
__115:
	;
__111:
	;
	complete = libc.AssignInt32(&lastParsed, OT_TOKENS)
	goto __54
	// case LEAF

__56:

	// A unary operator appearing just after something that's not an
	// operator is a syntax error -- something trying to be the left
	// operand of an operator that doesn't take one.

	if !(lastParsed < 0) {
		goto __117
	}
	msg = XTcl_ObjPrintf(tls, ts+19597, libc.VaList(bp+144, mark))
	scanned = 0
	insertMark = 1
	errCode = ts + 14589 /* "MISSING" */
	goto error
__117:
	;

	// Create an OpNode for the unary operator.

	(*OpNode)(unsafe.Pointer(nodePtr)).Flexeme = *(*uint8)(unsafe.Pointer(bp + 344 /* lexeme */))
	(*OpNode)(unsafe.Pointer(nodePtr)).Fprecedence = prec[*(*uint8)(unsafe.Pointer(bp + 344 /* lexeme */))]
	(*OpNode)(unsafe.Pointer(nodePtr)).Fmark = MARK_RIGHT

	// A FUNCTION cannot be a constant expression, because Tcl allows
	// functions to return variable results with the same arguments;
	// for example, rand(). Other unary operators can root a constant
	// expression, so long as the argument is a constant expression.

	(*OpNode)(unsafe.Pointer(nodePtr)).Fconstant = uint8(libc.Bool32(int32(*(*uint8)(unsafe.Pointer(bp + 344))) != UNARY|BAREWORD))

	// This unary operator is a new incomplete tree, so push it onto
	// our stack of incomplete trees. Also remember it as the last
	// lexeme we parsed.

	*(*int32)(unsafe.Pointer(nodePtr + 8)) = incomplete
	incomplete = libc.AssignInt32(&lastParsed, int32(nodesUsed))
	nodesUsed++
	goto __54

__57:
	precedence = prec[*(*uint8)(unsafe.Pointer(bp + 344 /* lexeme */))]

	// A binary operator appearing just after another operator is a
	// syntax error -- one of the two operators is missing an operand.

	if !(lastParsed >= 0) {
		goto __118
	}
	if !(int32(*(*uint8)(unsafe.Pointer(bp + 344))) == BINARY|27 &&
		int32((*OpNode)(unsafe.Pointer(nodePtr+libc.UintptrFromInt32(-1)*16)).Flexeme) == UNARY|5) {
		goto __119
	}
	if !(int32((*OpNode)(unsafe.Pointer(nodePtr+libc.UintptrFromInt32(-2)*16)).Flexeme) == UNARY|BAREWORD) {
		goto __120
	}
	// Normally, "()" is a syntax error, but as a special
	// case accept it as an argument list for a function.
	// Treat this as a special LEAF lexeme, and restart
	// the parsing loop with zero characters scanned. We
	// will parse the ")" again the next time through, but
	// with the OT_EMPTY leaf as the subexpression between
	// the parens.

	scanned = 0
	complete = libc.AssignInt32(&lastParsed, OT_EMPTY)
	goto __54
__120:
	;
	msg = XTcl_ObjPrintf(tls, ts+19710, libc.VaList(bp+152, mark))
	scanned = 0
	insertMark = 1
	errCode = ts + 19736 /* "EMPTY" */
	goto error
__119:
	;

	if !(int32((*OpNode)(unsafe.Pointer(nodePtr+libc.UintptrFromInt32(-1)*16)).Fprecedence) > int32(precedence)) {
		goto __121
	}
	if !(int32((*OpNode)(unsafe.Pointer(nodePtr+libc.UintptrFromInt32(-1)*16)).Flexeme) == UNARY|5) {
		goto __123
	}
__125:
	;
__128:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0
	}()) {
		goto __131
	}
	msg = XTclThreadAllocObj(tls)
	goto __132
__131:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects--
__132:
	;
	goto __129
__129:
	if 0 != 0 {
		goto __128
	}
	goto __130
__130:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1)) == 0) {
		goto __133
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __134
__133:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19742, uint64(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 21)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([22]int8{})) - uint64(1))
__134:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __126
__126:
	if 0 != 0 {
		goto __125
	}
	goto __127
__127:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_MISSING_PAREN
	errCode = ts + 16245 /* "UNBALANCED" */
	goto __124
__123:
	if !(int32((*OpNode)(unsafe.Pointer(nodePtr+libc.UintptrFromInt32(-1)*16)).Flexeme) == BINARY|3) {
		goto __135
	}
	msg = XTcl_ObjPrintf(tls,
		ts+19764, libc.VaList(bp+160, mark))
	scanned = 0
	insertMark = 1
	errCode = ts + 14589 /* "MISSING" */
	goto __136
__135:
	if !(int32((*OpNode)(unsafe.Pointer(nodePtr+libc.UintptrFromInt32(-1)*16)).Flexeme) == UNARY|4) {
		goto __137
	}
__138:
	;
__141:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0
	}()) {
		goto __144
	}
	msg = XTclThreadAllocObj(tls)
	goto __145
__144:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects--
__145:
	;
	goto __142
__142:
	if 0 != 0 {
		goto __141
	}
	goto __143
__143:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([17]int8{}))-uint64(1)) == 0) {
		goto __146
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __147
__146:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([17]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19796, uint64(int32(uint64(unsafe.Sizeof([17]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 16)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([17]int8{})) - uint64(1))
__147:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __139
__139:
	if 0 != 0 {
		goto __138
	}
	goto __140
__140:
	;
	errCode = ts + 19736 /* "EMPTY" */
__137:
	;
__136:
	;
__124:
	;
	goto __122
__121:
	if !(int32(*(*uint8)(unsafe.Pointer(bp + 344))) == BINARY|27) {
		goto __148
	}
__150:
	;
__153:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0
	}()) {
		goto __156
	}
	msg = XTclThreadAllocObj(tls)
	goto __157
__156:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects--
__157:
	;
	goto __154
__154:
	if 0 != 0 {
		goto __153
	}
	goto __155
__155:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1)) == 0) {
		goto __158
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __159
__158:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19813, uint64(int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 22)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([23]int8{})) - uint64(1))
__159:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __151
__151:
	if 0 != 0 {
		goto __150
	}
	goto __152
__152:
	;
	errCode = ts + 16245 /* "UNBALANCED" */
	goto __149
__148:
	if !(int32(*(*uint8)(unsafe.Pointer(bp + 344))) == BINARY|3 &&
		int32((*OpNode)(unsafe.Pointer(nodePtr+libc.UintptrFromInt32(-1)*16)).Flexeme) == UNARY|5 &&
		int32((*OpNode)(unsafe.Pointer(nodePtr+libc.UintptrFromInt32(-2)*16)).Flexeme) == UNARY|BAREWORD) {
		goto __160
	}
	msg = XTcl_ObjPrintf(tls, ts+19764,
		libc.VaList(bp+168, mark))
	scanned = 0
	insertMark = 1
	errCode = ts + 16245 /* "UNBALANCED" */
__160:
	;
__149:
	;
__122:
	;
	if !(msg == uintptr(0)) {
		goto __161
	}
	msg = XTcl_ObjPrintf(tls, ts+19836, libc.VaList(bp+176, mark))
	scanned = 0
	insertMark = 1
	errCode = ts + 14589 /* "MISSING" */
__161:
	;
	goto error
__118:
	;

	// Here is where the tree comes together. At this point, we have a
	// stack of incomplete trees corresponding to substrings that are
	// incomplete expressions, followed by a complete tree
	// corresponding to a substring that is itself a complete
	// expression, followed by the binary operator we have just
	// parsed. The incomplete trees can each be completed by adding a
	// right operand.
	//
	// To illustrate with an example, when we parse the expression
	// "1+2*3-4" and we reach this point having just parsed the "-"
	// operator, we have these incomplete trees: START, "1+", and
	// "2*". Next we have the complete subexpression "3". Last is the
	// "-" we've just parsed.
	//
	// The next step is to join our complete tree to an operator. The
	// choice is governed by the precedence and associativity of the
	// competing operators. If we connect it as the right operand of
	// our most recent incomplete tree, we get a new complete tree,
	// and we can repeat the process. The while loop following repeats
	// this until precedence indicates it is time to join the complete
	// tree as the left operand of the just parsed binary operator.
	//
	// Continuing the example, the first pass through the loop will
	// join "3" to "2*"; the next pass will join "2*3" to "1+". Then
	// we'll exit the loop and join "1+2*3" to "-". When we return to
	// parse another lexeme, our stack of incomplete trees is START
	// and "1+2*3-".

__162:
	if !(1 != 0) {
		goto __163
	}
	incompletePtr = nodes + uintptr(incomplete)*16

	if !(int32((*OpNode)(unsafe.Pointer(incompletePtr)).Fprecedence) < int32(precedence)) {
		goto __164
	}
	goto __163
__164:
	;

	if !(int32((*OpNode)(unsafe.Pointer(incompletePtr)).Fprecedence) == int32(precedence)) {
		goto __165
	}
	// Right association rules for exponentiation.

	if !(int32(*(*uint8)(unsafe.Pointer(bp + 344))) == BINARY|24) {
		goto __166
	}
	goto __163
__166:
	;

	// Special association rules for the conditional
	// operators. The "?" and ":" operators have equal
	// precedence, but must be linked up in sensible pairs.

	if !(int32((*OpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == BINARY|12 &&
		(complete < 0 ||
			int32((*OpNode)(unsafe.Pointer(nodes+uintptr(complete)*16)).Flexeme) != BINARY|13)) {
		goto __167
	}
	goto __163
__167:
	;
	if !(int32((*OpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == BINARY|13 &&
		int32(*(*uint8)(unsafe.Pointer(bp + 344))) == BINARY|12) {
		goto __168
	}
	goto __163
__168:
	;
__165:
	;

	// Some special syntax checks...

	// Parens must balance
	if !(int32((*OpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == UNARY|5 &&
		int32(*(*uint8)(unsafe.Pointer(bp + 344))) != BINARY|27) {
		goto __169
	}
__170:
	;
__173:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr7 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == 0
	}()) {
		goto __176
	}
	msg = XTclThreadAllocObj(tls)
	goto __177
__176:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects--
__177:
	;
	goto __174
__174:
	if 0 != 0 {
		goto __173
	}
	goto __175
__175:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1)) == 0) {
		goto __178
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __179
__178:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19742, uint64(int32(uint64(unsafe.Sizeof([22]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 21)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([22]int8{})) - uint64(1))
__179:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __171
__171:
	if 0 != 0 {
		goto __170
	}
	goto __172
__172:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_MISSING_PAREN
	errCode = ts + 16245 /* "UNBALANCED" */
	goto error
__169:
	;

	// Right operand of "?" must be ":"
	if !(int32((*OpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == BINARY|12 &&
		(complete < 0 ||
			int32((*OpNode)(unsafe.Pointer(nodes+uintptr(complete)*16)).Flexeme) != BINARY|13)) {
		goto __180
	}
	msg = XTcl_ObjPrintf(tls, ts+19858, libc.VaList(bp+184, mark))
	scanned = 0
	insertMark = 1
	errCode = ts + 14589 /* "MISSING" */
	goto error
__180:
	;

	// Operator ":" may only be right operand of "?"
	if !(complete >= 0 &&
		int32((*OpNode)(unsafe.Pointer(nodes+uintptr(complete)*16)).Flexeme) == BINARY|13 &&
		int32((*OpNode)(unsafe.Pointer(incompletePtr)).Flexeme) != BINARY|12) {
		goto __181
	}
__182:
	;
__185:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr8 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == 0
	}()) {
		goto __188
	}
	msg = XTclThreadAllocObj(tls)
	goto __189
__188:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects--
__189:
	;
	goto __186
__186:
	if 0 != 0 {
		goto __185
	}
	goto __187
__187:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([46]int8{}))-uint64(1)) == 0) {
		goto __190
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __191
__190:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([46]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19885, uint64(int32(uint64(unsafe.Sizeof([46]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 45)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([46]int8{})) - uint64(1))
__191:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __183
__183:
	if 0 != 0 {
		goto __182
	}
	goto __184
__184:
	;
	errCode = ts + 19931 /* "SURPRISE" */
	goto error
__181:
	;

	// Attach complete tree as right operand of most recent
	// incomplete tree.

	(*OpNode)(unsafe.Pointer(incompletePtr)).Fright = complete
	if !(complete >= 0) {
		goto __192
	}
	*(*int32)(unsafe.Pointer(nodes + uintptr(complete)*16 + 8)) = incomplete
	(*OpNode)(unsafe.Pointer(incompletePtr)).Fconstant = uint8(libc.Bool32((*OpNode)(unsafe.Pointer(incompletePtr)).Fconstant != 0 &&
		(*OpNode)(unsafe.Pointer(nodes+uintptr(complete)*16)).Fconstant != 0))
	goto __193
__192:
	(*OpNode)(unsafe.Pointer(incompletePtr)).Fconstant = uint8(libc.Bool32((*OpNode)(unsafe.Pointer(incompletePtr)).Fconstant != 0 &&
		complete == OT_LITERAL))
__193:
	;

	// The QUESTION/COLON and FUNCTION/OPEN_PAREN combinations
	// each make up a single operator. Force them to agree whether
	// they have a constant expression.

	if !(int32((*OpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == BINARY|12 ||
		int32((*OpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == UNARY|BAREWORD) {
		goto __194
	}
	(*OpNode)(unsafe.Pointer(nodes + uintptr(complete)*16)).Fconstant = (*OpNode)(unsafe.Pointer(incompletePtr)).Fconstant
__194:
	;

	if !(int32((*OpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == UNARY|4) {
		goto __195
	}
	// Completing the START tree indicates we're done.
	// Transfer the parse tree to the caller and return.

	*(*uintptr)(unsafe.Pointer(opTreePtr)) = nodes
	return TCL_OK
__195:
	;

	// With a right operand attached, last incomplete tree has
	// become the complete tree. Pop it from the incomplete tree
	// stack.

	complete = incomplete
	incomplete = *(*int32)(unsafe.Pointer(incompletePtr + 8))

	// CLOSE_PAREN can only close one OPEN_PAREN.
	if !(int32((*OpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == UNARY|5) {
		goto __196
	}
	goto __163
__196:
	;
	goto __162
__163:
	;

	// More syntax checks...

	// Parens must balance.
	if !(int32(*(*uint8)(unsafe.Pointer(bp + 344))) == BINARY|27) {
		goto __197
	}
	if !(int32((*OpNode)(unsafe.Pointer(incompletePtr)).Flexeme) != UNARY|5) {
		goto __198
	}
__199:
	;
__202:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr9 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects == 0
	}()) {
		goto __205
	}
	msg = XTclThreadAllocObj(tls)
	goto __206
__205:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects--
__206:
	;
	goto __203
__203:
	if 0 != 0 {
		goto __202
	}
	goto __204
__204:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1)) == 0) {
		goto __207
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __208
__207:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19813, uint64(int32(uint64(unsafe.Sizeof([23]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 22)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([23]int8{})) - uint64(1))
__208:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __200
__200:
	if 0 != 0 {
		goto __199
	}
	goto __201
__201:
	;
	errCode = ts + 16245 /* "UNBALANCED" */
	goto error
__198:
	;
__197:
	;

	// Commas must appear only in function argument lists.
	if !(int32(*(*uint8)(unsafe.Pointer(bp + 344))) == BINARY|3) {
		goto __209
	}
	if !(int32((*OpNode)(unsafe.Pointer(incompletePtr)).Flexeme) != UNARY|5 ||
		int32((*OpNode)(unsafe.Pointer(incompletePtr+libc.UintptrFromInt32(-1)*16)).Flexeme) != UNARY|BAREWORD) {
		goto __210
	}
__211:
	;
__214:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr10 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects == 0
	}()) {
		goto __217
	}
	msg = XTclThreadAllocObj(tls)
	goto __218
__217:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects--
__218:
	;
	goto __215
__215:
	if 0 != 0 {
		goto __214
	}
	goto __216
__216:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([46]int8{}))-uint64(1)) == 0) {
		goto __219
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __220
__219:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([46]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19940, uint64(int32(uint64(unsafe.Sizeof([46]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 45)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([46]int8{})) - uint64(1))
__220:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __212
__212:
	if 0 != 0 {
		goto __211
	}
	goto __213
__213:
	;
	errCode = ts + 19931 /* "SURPRISE" */
	goto error
__210:
	;
__209:
	;

	// Operator ":" may only be right operand of "?"
	if !(complete >= 0 && int32((*OpNode)(unsafe.Pointer(nodes+uintptr(complete)*16)).Flexeme) == BINARY|13) {
		goto __221
	}
__222:
	;
__225:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr11 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects == 0
	}()) {
		goto __228
	}
	msg = XTclThreadAllocObj(tls)
	goto __229
__228:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects--
__229:
	;
	goto __226
__226:
	if 0 != 0 {
		goto __225
	}
	goto __227
__227:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([46]int8{}))-uint64(1)) == 0) {
		goto __230
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __231
__230:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([46]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+19885, uint64(int32(uint64(unsafe.Sizeof([46]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 45)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([46]int8{})) - uint64(1))
__231:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __223
__223:
	if 0 != 0 {
		goto __222
	}
	goto __224
__224:
	;
	errCode = ts + 19931 /* "SURPRISE" */
	goto error
__221:
	;

	// Create no node for a CLOSE_PAREN lexeme.

	if !(int32(*(*uint8)(unsafe.Pointer(bp + 344))) == BINARY|27) {
		goto __232
	}
	goto __54
__232:
	;

	// Link complete tree as left operand of new node.

	(*OpNode)(unsafe.Pointer(nodePtr)).Flexeme = *(*uint8)(unsafe.Pointer(bp + 344 /* lexeme */))
	(*OpNode)(unsafe.Pointer(nodePtr)).Fprecedence = precedence
	(*OpNode)(unsafe.Pointer(nodePtr)).Fmark = MARK_LEFT
	(*OpNode)(unsafe.Pointer(nodePtr)).Fleft = complete

	// The COMMA operator cannot be optimized, since the function
	// needs all of its arguments, and optimization would reduce the
	// number. Other binary operators root constant expressions when
	// both arguments are constant expressions.

	(*OpNode)(unsafe.Pointer(nodePtr)).Fconstant = uint8(libc.Bool32(int32(*(*uint8)(unsafe.Pointer(bp + 344))) != BINARY|3))

	if !(complete >= 0) {
		goto __233
	}
	*(*int32)(unsafe.Pointer(nodes + uintptr(complete)*16 + 8)) = int32(nodesUsed)
	(*OpNode)(unsafe.Pointer(nodePtr)).Fconstant = uint8(libc.Bool32((*OpNode)(unsafe.Pointer(nodePtr)).Fconstant != 0 &&
		(*OpNode)(unsafe.Pointer(nodes+uintptr(complete)*16)).Fconstant != 0))
	goto __234
__233:
	(*OpNode)(unsafe.Pointer(nodePtr)).Fconstant = uint8(libc.Bool32((*OpNode)(unsafe.Pointer(nodePtr)).Fconstant != 0 &&
		complete == OT_LITERAL))
__234:
	;

	// With a left operand attached and a right operand missing, the
	// just-parsed binary operator is root of a new incomplete tree.
	// Push it onto the stack of incomplete trees.

	*(*int32)(unsafe.Pointer(nodePtr + 8)) = incomplete
	incomplete = libc.AssignInt32(&lastParsed, int32(nodesUsed))
	nodesUsed++
	goto __54
	// case BINARY
__54:
	; // lexeme handler

	// Advance past the just-parsed lexeme
	start += uintptr(scanned)
	numBytes = numBytes - scanned
	goto __12
__13:
	; // main parsing loop

	// We only get here if there's been an error. Any errors that didn't get a
	// suitable parsePtr->errorType, get recorded as syntax errors.

error:
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType == TCL_PARSE_SUCCESS) {
		goto __235
	}
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_SYNTAX
__235:
	;

	// Free any partial parse tree we've built.

	if !(nodes != uintptr(0)) {
		goto __236
	}
	XTclpFree(tls, nodes)
__236:
	;

	if !(interp == uintptr(0)) {
		goto __237
	}
	// Nowhere to report an error message, so just free it.

	if !(msg != 0) {
		goto __239
	}
__240:
	_objPtr3 = msg
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __243
	}
	XTclFreeObj(tls, _objPtr3)
__243:
	;
	goto __241
__241:
	if 0 != 0 {
		goto __240
	}
	goto __242
__242:
	;
__239:
	;
	goto __238
__237:
	// Construct the complete error message. Start with the simple error
	// message, pulled from the interp result if necessary...

	if !(msg == uintptr(0)) {
		goto __244
	}
	msg = XTcl_GetObjResult(tls, interp)
__244:
	;

	// Add a detailed quote from the bad expression, displaying and
	// sometimes marking the precise location of the syntax error.

	XTcl_AppendPrintfToObj(tls, msg, ts+19986,
		libc.VaList(bp+192, func() uintptr {
			if start-uintptr(limit) < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fstring {
				return ts + 2046 /* "" */
			}
			return ts + 7891 /* "..." */
		}(),
			func() int32 {
				if start-uintptr(limit) < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fstring {
					return int32((int64(start) - int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fstring)) / 1)
				}
				return limit - 3
			}(),
			func() uintptr {
				if start-uintptr(limit) < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fstring {
					return (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fstring
				}
				return start - uintptr(limit) + uintptr(3)
			}(),
			func() int32 {
				if scanned < limit {
					return scanned
				}
				return limit - 3
			}(), start,
			func() uintptr {
				if scanned < limit {
					return ts + 2046 /* "" */
				}
				return ts + 7891 /* "..." */
			}(), func() uintptr {
				if insertMark != 0 {
					return mark
				}
				return ts + 2046 /* "" */
			}(),
			func() int32 {
				if start+uintptr(scanned)+uintptr(limit) > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend {
					return int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend)-int64(start))/1) - scanned
				}
				return limit - 3
			}(),
			start+uintptr(scanned),
			func() uintptr {
				if start+uintptr(scanned)+uintptr(limit) > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend {
					return ts + 2046 /* "" */
				}
				return ts + 7891 /* "..." */
			}()))

	// Next, append any postscript message.

	if !(post != uintptr(0)) {
		goto __245
	}
	XTcl_AppendToObj(tls, msg, ts+20024, -1)
	XTcl_AppendObjToObj(tls, msg, post)
__246:
	_objPtr4 = post
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __249
	}
	XTclFreeObj(tls, _objPtr4)
__249:
	;
	goto __247
__247:
	if 0 != 0 {
		goto __246
	}
	goto __248
__248:
	;
__245:
	;
	XTcl_SetObjResult(tls, interp, msg)

	// Finally, place context information in the errorInfo.

	numBytes = int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend) - int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fstring)) / 1)
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+20027,
		libc.VaList(bp+272, func() int32 {
			if numBytes < limit {
				return numBytes
			}
			return limit - 3
		}(),
			(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fstring, func() uintptr {
				if numBytes < limit {
					return ts + 2046 /* "" */
				}
				return ts + 7891 /* "..." */
			}())))
	if !(errCode != 0) {
		goto __250
	}
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+296, ts+3593, ts+20062, ts+20068, errCode,
		subErrCode, uintptr(0)))
__250:
	;
__238:
	;

	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// ConvertTreeToTokens --
//
//	Given a string, the numBytes bytes starting at start, and an OpNode
//	tree and Tcl_Token array created by passing that same string to
//	ParseExpr(), this function writes into *parsePtr the sequence of
//	Tcl_Tokens needed so to satisfy the historical interface provided by
//	Tcl_ParseExpr(). Note that this routine exists only for the sake of
//	the public Tcl_ParseExpr() routine. It is not used by Tcl itself at
//	all.
//
// Results:
//	None.
//
// Side effects:
//	The Tcl_Parse *parsePtr is filled with Tcl_Tokens representing the
//	parsed expression.
//
//----------------------------------------------------------------------

func sConvertTreeToTokens(tls *libc.TLS, start uintptr, numBytes int32, nodes uintptr, tokenPtr uintptr, parsePtr uintptr) { /* tclCompExpr.c:1472:1: */
	bp := tls.Alloc(33)
	defer tls.Free(33)

	var subExprTokenIdx int32
	var nodePtr uintptr
	var next int32
	var allocated int32
	var oldPtr uintptr
	var newPtr uintptr
	var _needed int32
	var allocated1 int32
	var oldPtr1 uintptr
	var newPtr1 uintptr
	var _needed1 int32
	var allocated2 int32
	var oldPtr2 uintptr
	var newPtr2 uintptr
	var _needed2 int32
	// tokenPtr points to a token sequence that came from parsing a
	// Tcl word. A Tcl word is made up of a sequence of one or more
	// elements. When the word is only a single element, it's been the
	// historical practice to replace the TCL_TOKEN_WORD token
	// directly with a TCL_TOKEN_SUB_EXPR token. However, when the
	// word has multiple elements, a TCL_TOKEN_WORD token is kept as a
	// grouping device so that TCL_TOKEN_SUB_EXPR always has only one
	// element. Wise or not, these are the rules the Tcl expr parser
	// has followed, and for the sake of those few callers of
	// Tcl_ParseExpr() we do not change them now. Internally, we can
	// do better.

	var toCopy int32
	var allocated3 int32
	var oldPtr3 uintptr
	var newPtr3 uintptr
	var _needed3 int32
	var subExprTokenPtr uintptr
	var scanned int32
	var parentIdx int32
	// var lexeme uint8 at bp+32, 1
	subExprTokenIdx = 0
	nodePtr = nodes
	next = (*OpNode)(unsafe.Pointer(nodePtr)).Fright

__1:
	if !(1 != 0) {
		goto __2
	}

	// Advance the mark so the next exit from this node won't retrace
	// steps over ground already covered.

	(*OpNode)(unsafe.Pointer(nodePtr)).Fmark++

	// Handle next child node or leaf.

	switch next {
	case OT_EMPTY:
		goto __4

	case OT_LITERAL:
		goto __5

	case OT_TOKENS:
		goto __6

	default:
		goto __7
	}
	goto __3
__4:

	// No tokens and no characters for the OT_EMPTY leaf.
	goto __3

__5:

	// Skip any white space that comes before the literal.

	scanned = XTclParseAllWhiteSpace(tls, start, numBytes)
	start += uintptr(scanned)
	numBytes = numBytes - scanned

	// Reparse the literal to get pointers into source string.

	scanned = sParseLexeme(tls, start, numBytes, bp+32, uintptr(0))

__8:
	_needed = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + 2
	if !(_needed > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __11
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__11:
	;
	if !(_needed > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __12
	}
	allocated = 2 * _needed
	oldPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr == parsePtr+96) {
		goto __13
	}
	oldPtr = uintptr(0)
__13:
	;
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __14
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__14:
	;
	newPtr = XTclpRealloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr == uintptr(0)) {
		goto __15
	}
	allocated = int32(uint64(_needed+2) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __16
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__16:
	;
	newPtr = XTcl_Realloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__15:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated
	if !(oldPtr == uintptr(0)) {
		goto __17
	}
	libc.Xmemcpy(tls, newPtr, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__17:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr
__12:
	;
	goto __9
__9:
	if 0 != 0 {
		goto __8
	}
	goto __10
__10:
	;
	subExprTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*24
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).Ftype = TCL_TOKEN_SUB_EXPR
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).Fstart = start
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).Fsize = scanned
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).FnumComponents = 1
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*24)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*24)).Fstart = start
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*24)).Fsize = scanned
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*24)).FnumComponents = 0

	*(*int32)(unsafe.Pointer(parsePtr + 40)) += 2
	start += uintptr(scanned)
	numBytes = numBytes - scanned
	goto __3

__6:
	// tokenPtr points to a token sequence that came from parsing a
	// Tcl word. A Tcl word is made up of a sequence of one or more
	// elements. When the word is only a single element, it's been the
	// historical practice to replace the TCL_TOKEN_WORD token
	// directly with a TCL_TOKEN_SUB_EXPR token. However, when the
	// word has multiple elements, a TCL_TOKEN_WORD token is kept as a
	// grouping device so that TCL_TOKEN_SUB_EXPR always has only one
	// element. Wise or not, these are the rules the Tcl expr parser
	// has followed, and for the sake of those few callers of
	// Tcl_ParseExpr() we do not change them now. Internally, we can
	// do better.

	toCopy = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents + 1

	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents == (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).FnumComponents+1) {
		goto __18
	}
	// Single element word. Copy tokens and convert the leading
	// token to TCL_TOKEN_SUB_EXPR.

__20:
	_needed1 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + toCopy
	if !(_needed1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __23
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp+8, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__23:
	;
	if !(_needed1 > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __24
	}
	allocated1 = 2 * _needed1
	oldPtr1 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr1 == parsePtr+96) {
		goto __25
	}
	oldPtr1 = uintptr(0)
__25:
	;
	if !(allocated1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __26
	}
	allocated1 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__26:
	;
	newPtr1 = XTclpRealloc(tls, oldPtr1, uint32(uint64(allocated1)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr1 == uintptr(0)) {
		goto __27
	}
	allocated1 = int32(uint64(_needed1+toCopy) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __28
	}
	allocated1 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__28:
	;
	newPtr1 = XTcl_Realloc(tls, oldPtr1, uint32(uint64(allocated1)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__27:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated1
	if !(oldPtr1 == uintptr(0)) {
		goto __29
	}
	libc.Xmemcpy(tls, newPtr1, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__29:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr1
__24:
	;
	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	subExprTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*24
	libc.Xmemcpy(tls, subExprTokenPtr, tokenPtr,
		Size_t(toCopy)*Size_t(unsafe.Sizeof(Tcl_Token{})))
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).Ftype = TCL_TOKEN_SUB_EXPR
	*(*int32)(unsafe.Pointer(parsePtr + 40)) += toCopy
	goto __19
__18:
	// Multiple element word. Create a TCL_TOKEN_SUB_EXPR token to
	// lead, with fields initialized from the leading token, then
	// copy entire set of word tokens.

__30:
	_needed2 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + (toCopy + 1)
	if !(_needed2 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __33
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp+16, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__33:
	;
	if !(_needed2 > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __34
	}
	allocated2 = 2 * _needed2
	oldPtr2 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr2 == parsePtr+96) {
		goto __35
	}
	oldPtr2 = uintptr(0)
__35:
	;
	if !(allocated2 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __36
	}
	allocated2 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__36:
	;
	newPtr2 = XTclpRealloc(tls, oldPtr2, uint32(uint64(allocated2)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr2 == uintptr(0)) {
		goto __37
	}
	allocated2 = int32(uint64(_needed2+(toCopy+1)) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated2 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __38
	}
	allocated2 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__38:
	;
	newPtr2 = XTcl_Realloc(tls, oldPtr2, uint32(uint64(allocated2)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__37:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated2
	if !(oldPtr2 == uintptr(0)) {
		goto __39
	}
	libc.Xmemcpy(tls, newPtr2, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__39:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr2
__34:
	;
	goto __31
__31:
	if 0 != 0 {
		goto __30
	}
	goto __32
__32:
	;
	subExprTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*24
	*(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)) = *(*Tcl_Token)(unsafe.Pointer(tokenPtr))
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).Ftype = TCL_TOKEN_SUB_EXPR
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).FnumComponents++
	subExprTokenPtr += 24
	libc.Xmemcpy(tls, subExprTokenPtr, tokenPtr,
		Size_t(toCopy)*Size_t(unsafe.Sizeof(Tcl_Token{})))
	*(*int32)(unsafe.Pointer(parsePtr + 40)) += toCopy + 1
__19:
	;

	scanned = int32((int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize)) - int64(start)) / 1)
	start += uintptr(scanned)
	numBytes = numBytes - scanned
	tokenPtr += 24 * uintptr(toCopy)
	goto __3

__7:

	// Advance to the child node, which is an operator.

	nodePtr = nodes + uintptr(next)*16

	// Skip any white space that comes before the subexpression.

	scanned = XTclParseAllWhiteSpace(tls, start, numBytes)
	start += uintptr(scanned)
	numBytes = numBytes - scanned

	// Generate tokens for the operator / subexpression...

	switch int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) {
	case UNARY | 5:
		goto __41
	case BINARY | 3:
		goto __42
	case BINARY | 13:
		goto __43

	default:
		goto __44
	}
	goto __40
__41:
__42:
__43:

	// Historical practice has been to have no Tcl_Tokens for
	// these operators.

	goto __40

__44:

	// Remember the index of the last subexpression we were
	// working on -- that of our parent. We'll stack it later.

	parentIdx = subExprTokenIdx

	// Verify space for the two leading Tcl_Tokens representing
	// the subexpression rooted by this operator. The first
	// Tcl_Token will be of type TCL_TOKEN_SUB_EXPR; the second of
	// type TCL_TOKEN_OPERATOR.

__45:
	_needed3 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + 2
	if !(_needed3 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __48
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp+24, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__48:
	;
	if !(_needed3 > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __49
	}
	allocated3 = 2 * _needed3
	oldPtr3 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr3 == parsePtr+96) {
		goto __50
	}
	oldPtr3 = uintptr(0)
__50:
	;
	if !(allocated3 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __51
	}
	allocated3 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__51:
	;
	newPtr3 = XTclpRealloc(tls, oldPtr3, uint32(uint64(allocated3)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr3 == uintptr(0)) {
		goto __52
	}
	allocated3 = int32(uint64(_needed3+2) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated3 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __53
	}
	allocated3 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__53:
	;
	newPtr3 = XTcl_Realloc(tls, oldPtr3, uint32(uint64(allocated3)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__52:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated3
	if !(oldPtr3 == uintptr(0)) {
		goto __54
	}
	libc.Xmemcpy(tls, newPtr3, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__54:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr3
__49:
	;
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
	subExprTokenIdx = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens
	subExprTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(subExprTokenIdx)*24
	*(*int32)(unsafe.Pointer(parsePtr + 40)) += 2
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).Ftype = TCL_TOKEN_SUB_EXPR
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*24)).Ftype = TCL_TOKEN_OPERATOR

	// Our current position scanning the string is the starting
	// point for this subexpression.

	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).Fstart = start

	// Eventually, we know that the numComponents field of the
	// Tcl_Token of type TCL_TOKEN_OPERATOR will be 0. This means
	// we can make other use of this field for now to track the
	// stack of subexpressions we have pending.

	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*24)).FnumComponents = parentIdx
	goto __40

__40:
	;
	goto __3
__3:
	;

	// Determine which way to exit the node on this pass.
router:
	switch int32((*OpNode)(unsafe.Pointer(nodePtr)).Fmark) {
	case MARK_LEFT:
		goto __56

	case MARK_RIGHT:
		goto __57

	case MARK_PARENT:
		goto __58
	}
	goto __55
__56:
	next = (*OpNode)(unsafe.Pointer(nodePtr)).Fleft
	goto __55

__57:
	next = (*OpNode)(unsafe.Pointer(nodePtr)).Fright

	// Skip any white space that comes before the operator.

	scanned = XTclParseAllWhiteSpace(tls, start, numBytes)
	start += uintptr(scanned)
	numBytes = numBytes - scanned

	// Here we scan from the string the operator corresponding to
	// nodePtr->lexeme.

	scanned = sParseLexeme(tls, start, numBytes, bp+32, uintptr(0))

	switch int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) {
	case UNARY | 5:
		goto __60
	case BINARY | 3:
		goto __61
	case BINARY | 13:
		goto __62

	default:
		goto __63
	}
	goto __59
__60:
__61:
__62:

	// No tokens for these lexemes -> nothing to do.

	goto __59

__63:

	// Record in the TCL_TOKEN_OPERATOR token the pointers into
	// the string marking where the operator is.

	subExprTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(subExprTokenIdx)*24
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*24)).Fstart = start
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*24)).Fsize = scanned
	goto __59
__59:
	;

	start += uintptr(scanned)
	numBytes = numBytes - scanned
	goto __55

__58:
	switch int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) {
	case UNARY | 4:
		goto __65

	case BINARY | 3:
		goto __66
	case BINARY | 13:
		goto __67

	case UNARY | 5:
		goto __68

	default:
		goto __69
	}
	goto __64
__65:

	// When we get back to the START node, we're done.
	return

__66:
__67:

	// No tokens for these lexemes -> nothing to do.
	goto __64

__68:

	// Skip past matching close paren.

	scanned = XTclParseAllWhiteSpace(tls, start, numBytes)
	start += uintptr(scanned)
	numBytes = numBytes - scanned
	scanned = sParseLexeme(tls, start, numBytes, bp+32, uintptr(0))
	start += uintptr(scanned)
	numBytes = numBytes - scanned
	goto __64

__69:

	// Before we leave this node/operator/subexpression for the
	// last time, finish up its tokens....
	//
	// Our current position scanning the string is where the
	// substring for the subexpression ends.

	subExprTokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(subExprTokenIdx)*24
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).Fsize = int32((int64(start) - int64((*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).Fstart)) / 1)

	// All the Tcl_Tokens allocated and filled belong to
	// this subexpresion. The first token is the leading
	// TCL_TOKEN_SUB_EXPR token, and all the rest (one fewer)
	// are its components.

	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr)).FnumComponents = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens - subExprTokenIdx - 1

	// Finally, as we return up the tree to our parent, pop the
	// parent subexpression off our subexpression stack, and
	// fill in the zero numComponents for the operator Tcl_Token.

	parentIdx = (*Tcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*24)).FnumComponents
	(*Tcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*24)).FnumComponents = 0
	subExprTokenIdx = parentIdx
	goto __64
__64:
	;

	// Since we're returning to parent, skip child handling code.

	nodePtr = nodes + uintptr(*(*int32)(unsafe.Pointer(nodePtr + 8)))*16
	goto router
__55:
	;
	goto __1
__2:
}

//----------------------------------------------------------------------
//
// Tcl_ParseExpr --
//
//	Given a string, the numBytes bytes starting at start, this function
//	parses it as a Tcl expression and stores information about the
//	structure of the expression in the Tcl_Parse struct indicated by the
//	caller.
//
// Results:
//	If the string is successfully parsed as a valid Tcl expression, TCL_OK
//	is returned, and data about the expression structure is written to
//	*parsePtr. If the string cannot be parsed as a valid Tcl expression,
//	TCL_ERROR is returned, and if interp is non-NULL, an error message is
//	written to interp.
//
// Side effects:
//	If there is insufficient space in parsePtr to hold all the information
//	about the expression, then additional space is malloc-ed. If the
//	function returns TCL_OK then the caller must eventually invoke
//	Tcl_FreeParse to release any additional space that was allocated.
//
//----------------------------------------------------------------------

func XTcl_ParseExpr(tls *libc.TLS, interp uintptr, start uintptr, numBytes int32, parsePtr uintptr) int32 { /* tclCompExpr.c:1819:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var code int32
	*(*uintptr)(unsafe.Pointer(bp /* opTree */)) = uintptr(0) // Will point to the tree of operators.
	var litList uintptr = XTcl_NewObj(tls)                    // List to hold the literals.
	var funcList uintptr = XTcl_NewObj(tls)                   // List to hold the functon names.
	var exprParsePtr uintptr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(Tcl_Parse{})))
	// Holds the Tcl_Tokens of substitutions.

	if numBytes < 0 {
		numBytes = func() int32 {
			if start != 0 {
				return int32(libc.Xstrlen(tls, start))
			}
			return 0
		}()
	}

	code = sParseExpr(tls, interp, start, numBytes, bp, litList, funcList,
		exprParsePtr, 1)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = funcList
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = litList
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	XTclParseInit(tls, interp, start, numBytes, parsePtr)
	if code == TCL_OK {
		sConvertTreeToTokens(tls, start, numBytes,
			*(*uintptr)(unsafe.Pointer(bp /* opTree */)), (*Tcl_Parse)(unsafe.Pointer(exprParsePtr)).FtokenPtr, parsePtr)
	} else {
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = (*Tcl_Parse)(unsafe.Pointer(exprParsePtr)).Fterm
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = (*Tcl_Parse)(unsafe.Pointer(exprParsePtr)).FerrorType
	}

	XTcl_FreeParse(tls, exprParsePtr)
	XTclStackFree(tls, interp, exprParsePtr)
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp)))
	return code
}

//----------------------------------------------------------------------
//
// ParseLexeme --
//
//	Parse a single lexeme from the start of a string, scanning no more
//	than numBytes bytes.
//
// Results:
//	Returns the number of bytes scanned to produce the lexeme.
//
// Side effects:
//	Code identifying lexeme parsed is writen to *lexemePtr.
//
//----------------------------------------------------------------------

func sParseLexeme(tls *libc.TLS, start uintptr, numBytes int32, lexemePtr uintptr, literalPtr uintptr) int32 { /* tclCompExpr.c:1878:1: */
	bp := tls.Alloc(15)
	defer tls.Free(15)

	// var end uintptr at bp, 8

	var scanned int32
	// var ch Tcl_UniChar at bp+10, 2

	var literal uintptr
	var byte uint8
	var _objPtr uintptr
	var p uintptr
	// var lexeme uint8 at bp+8, 1

	// var utfBytes [3]int8 at bp+12, 3

	var _objPtr1 uintptr
	var _objPtr2 uintptr
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 10 /* ch */)) = Tcl_UniChar(0)
	literal = uintptr(0)

	if !(numBytes == 0) {
		goto __1
	}
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 28)
	return 0
__1:
	;
	byte = uint8(*(*int8)(unsafe.Pointer(start)))
	if !(uint64(byte) < uint64(unsafe.Sizeof(sLexeme)) && int32(sLexeme[byte]) != 0) {
		goto __2
	}
	*(*uint8)(unsafe.Pointer(lexemePtr)) = sLexeme[byte]
	return 1
__2:
	;
	switch int32(byte) {
	case '*':
		goto __4

	case '=':
		goto __5

	case '!':
		goto __6

	case '&':
		goto __7

	case '|':
		goto __8

	case '<':
		goto __9

	case '>':
		goto __10

	case 'i':
		goto __11

	case 'e':
		goto __12

	case 'n':
		goto __13
	}
	goto __3
__4:
	if !(numBytes > 1 && int32(*(*int8)(unsafe.Pointer(start + 1))) == '*') {
		goto __14
	}
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 24)
	return 2
__14:
	;
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 4)
	return 1

__5:
	if !(numBytes > 1 && int32(*(*int8)(unsafe.Pointer(start + 1))) == '=') {
		goto __15
	}
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 18)
	return 2
__15:
	;
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(INCOMPLETE)
	return 1

__6:
	if !(numBytes > 1 && int32(*(*int8)(unsafe.Pointer(start + 1))) == '=') {
		goto __16
	}
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 19)
	return 2
__16:
	;
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(UNARY | 6)
	return 1

__7:
	if !(numBytes > 1 && int32(*(*int8)(unsafe.Pointer(start + 1))) == '&') {
		goto __17
	}
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 20)
	return 2
__17:
	;
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 9)
	return 1

__8:
	if !(numBytes > 1 && int32(*(*int8)(unsafe.Pointer(start + 1))) == '|') {
		goto __18
	}
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 21)
	return 2
__18:
	;
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 11)
	return 1

__9:
	if !(numBytes > 1) {
		goto __19
	}
	switch int32(*(*int8)(unsafe.Pointer(start + 1))) {
	case '<':
		goto __21
	case '=':
		goto __22
	}
	goto __20
__21:
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 14)
	return 2
__22:
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 16)
	return 2
__20:
	;
__19:
	;
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 7)
	return 1

__10:
	if !(numBytes > 1) {
		goto __23
	}
	switch int32(*(*int8)(unsafe.Pointer(start + 1))) {
	case '>':
		goto __25
	case '=':
		goto __26
	}
	goto __24
__25:
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 15)
	return 2
__26:
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 17)
	return 2
__24:
	;
__23:
	;
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 8)
	return 1

__11:
	if !(numBytes > 1 && int32(*(*int8)(unsafe.Pointer(start + 1))) == 'n' &&
		(numBytes == 2 || int32(*(*int8)(unsafe.Pointer(start + 2)))&0x80 != 0 || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(start + 2)))))*2)))&int32(X_ISalpha) != 0))) {
		goto __27
	}
	// Must make this check so we can tell the difference between the
	// "in" operator and the "int" function name and the "infinity"
	// numeric value.

	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 25)
	return 2
__27:
	;
	goto __3

__12:
	if !(numBytes > 1 && int32(*(*int8)(unsafe.Pointer(start + 1))) == 'q' &&
		(numBytes == 2 || int32(*(*int8)(unsafe.Pointer(start + 2)))&0x80 != 0 || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(start + 2)))))*2)))&int32(X_ISalpha) != 0))) {
		goto __28
	}
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 22)
	return 2
__28:
	;
	goto __3

__13:
	if !(numBytes > 1 &&
		(numBytes == 2 || int32(*(*int8)(unsafe.Pointer(start + 2)))&0x80 != 0 || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(start + 2)))))*2)))&int32(X_ISalpha) != 0))) {
		goto __29
	}
	switch int32(*(*int8)(unsafe.Pointer(start + 1))) {
	case 'e':
		goto __31
	case 'i':
		goto __32
	}
	goto __30
__31:
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 23)
	return 2
__32:
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BINARY | 26)
	return 2
__30:
	;
__29:
	;
__3:
	;

	literal = XTcl_NewObj(tls)
	if !(XTclParseNumber(tls, uintptr(0), literal, uintptr(0), start, numBytes, bp,
		TCL_PARSE_NO_WHITESPACE) == TCL_OK) {
		goto __33
	}
	if !(*(*uintptr)(unsafe.Pointer(bp)) < start+uintptr(numBytes) && !(XTclIsBareword(tls, int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))) != 0)) {
		goto __34
	}

number:
	if !((int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start))/1 == int64(0)) {
		goto __36
	}
	(*Tcl_Obj)(unsafe.Pointer(literal)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(literal)).Flength = 0
	goto __37
__36:
	(*Tcl_Obj)(unsafe.Pointer(literal)).Fbytes = XTcl_Alloc(tls, uint32((int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start))/1+int64(1)))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(literal)).Fbytes, start, uint64((int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start))/1))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(literal)).Fbytes + uintptr((int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start))/1))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(literal)).Flength = int32((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(start)) / 1)
__37:
	;

	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(LEAF | 1)
	if !(literalPtr != 0) {
		goto __38
	}
	*(*uintptr)(unsafe.Pointer(literalPtr)) = literal
	goto __39
__38:
__40:
	_objPtr = literal
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __43
	}
	XTclFreeObj(tls, _objPtr)
__43:
	;
	goto __41
__41:
	if 0 != 0 {
		goto __40
	}
	goto __42
__42:
	;
__39:
	;
	return int32((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(start)) / 1)
	goto __35
__34:

	// We have a number followed directly by bareword characters
	// (alpha, digit, underscore).  Is this a number followed by
	// bareword syntax error?  Or should we join into one bareword?
	// Example: Inf + luence + () becomes a valid function call.
	// [Bug 3401704]
	if !((*Tcl_Obj)(unsafe.Pointer(literal)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType))) {
		goto __44
	}
	p = start

__45:
	if !(p < *(*uintptr)(unsafe.Pointer(bp))) {
		goto __46
	}
	if !!(XTclIsBareword(tls, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))))) != 0) {
		goto __47
	}
	// The number has non-bareword characters, so we
	// must treat it as a number.
	goto number
__47:
	;
	goto __45
__46:
	;
__44:
	;
	sParseLexeme(tls, *(*uintptr)(unsafe.Pointer(bp /* end */)), int32(int64(numBytes)-(int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start))/1), bp+8, uintptr(0))
	if !(NODE_TYPE&int32(*(*uint8)(unsafe.Pointer(bp + 8))) == BINARY) {
		goto __48
	}
	// The bareword characters following the number take the
	// form of an operator (eq, ne, in, ni, ...) so we treat
	// as number + operator.
	goto number
__48:
	;

	// Otherwise, fall through and parse the whole as a bareword.
__35:
	;
__33:
	;

	// We reject leading underscores in bareword.  No sensible reason why.
	// Might be inspired by reserved identifier rules in C, which of course
	// have no direct relevance here.

	if !(!(XTclIsBareword(tls, int32(*(*int8)(unsafe.Pointer(start)))) != 0) || int32(*(*int8)(unsafe.Pointer(start))) == '_') {
		goto __49
	}
	if !(XTcl_UtfCharComplete(tls, start, numBytes) != 0) {
		goto __50
	}
	scanned = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(start)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 10)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(start))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, start, bp+10)
	}()
	goto __51
__50:

	libc.Xmemcpy(tls, bp+12, start, uint64(numBytes))
	*(*int8)(unsafe.Pointer(bp + 12 + uintptr(numBytes))) = int8(0)
	scanned = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(bp + 12)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 10)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(bp + 12))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, bp+12, bp+10)
	}()
__51:
	;
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(INVALID)
__52:
	_objPtr1 = literal
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __55
	}
	XTclFreeObj(tls, _objPtr1)
__55:
	;
	goto __53
__53:
	if 0 != 0 {
		goto __52
	}
	goto __54
__54:
	;
	return scanned
__49:
	;
	*(*uintptr)(unsafe.Pointer(bp /* end */)) = start
__56:
	if !(numBytes != 0 && XTclIsBareword(tls, int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))) != 0) {
		goto __57
	}
	*(*uintptr)(unsafe.Pointer(bp /* end */)) += uintptr(1)
	numBytes = numBytes - 1
	goto __56
__57:
	;
	*(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BAREWORD)
	if !(literalPtr != 0) {
		goto __58
	}
	XTcl_SetStringObj(tls, literal, start, int32((int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start))/1))
	*(*uintptr)(unsafe.Pointer(literalPtr)) = literal
	goto __59
__58:
__60:
	_objPtr2 = literal
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __63
	}
	XTclFreeObj(tls, _objPtr2)
__63:
	;
	goto __61
__61:
	if 0 != 0 {
		goto __60
	}
	goto __62
__62:
	;
__59:
	;
	return int32((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(start)) / 1)
}

//----------------------------------------------------------------------
//
// TclCompileExpr --
//
//	This procedure compiles a string containing a Tcl expression into Tcl
//	bytecodes.
//
// Results:
//	None.
//
// Side effects:
//	Adds instructions to envPtr to evaluate the expression at runtime.
//
//----------------------------------------------------------------------

func XTclCompileExpr(tls *libc.TLS, interp uintptr, script uintptr, numBytes int32, envPtr uintptr, optimize int32) { /* tclCompExpr.c:2112:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	*(*uintptr)(unsafe.Pointer(bp /* opTree */)) = uintptr(0) // Will point to the tree of operators
	var litList uintptr = XTcl_NewObj(tls)                    // List to hold the literals
	var funcList uintptr = XTcl_NewObj(tls)                   // List to hold the functon names
	var parsePtr uintptr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(Tcl_Parse{})))
	// Holds the Tcl_Tokens of substitutions

	var code int32 = sParseExpr(tls, interp, script, numBytes, bp, litList,
		funcList, parsePtr, 0)

	if code == TCL_OK {
		// Valid parse; compile the tree.

		// var objc int32 at bp+16, 4

		// var litObjv uintptr at bp+8, 8

		// var funcObjv uintptr at bp+24, 8

		// TIP #280 : Track Lines within the expression
		XTclAdvanceLines(tls, envPtr+3560, script,
			script+uintptr(XTclParseAllWhiteSpace(tls, script, numBytes)))

		if (*Tcl_Obj)(unsafe.Pointer(litList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			*(*uintptr)(unsafe.Pointer(bp + 8)) = *(*uintptr)(unsafe.Pointer(litList + 32)) + 16
			*(*int32)(unsafe.Pointer(bp + 16)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(litList + 32)))).FelemCount
		} else {
			XTcl_ListObjGetElements(tls, uintptr(0), litList, bp+16, bp+8)
		}
		if (*Tcl_Obj)(unsafe.Pointer(funcList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			*(*uintptr)(unsafe.Pointer(bp + 24)) = *(*uintptr)(unsafe.Pointer(funcList + 32)) + 16
			*(*int32)(unsafe.Pointer(bp + 16)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(funcList + 32)))).FelemCount
		} else {
			XTcl_ListObjGetElements(tls, uintptr(0), funcList, bp+16, bp+24)
		}
		sCompileExprTree(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* opTree */)), 0, bp+8, *(*uintptr)(unsafe.Pointer(bp + 24 /* funcObjv */)),
			(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, envPtr, optimize)
	} else {
		XTclCompileSyntaxError(tls, interp, envPtr)
	}

	XTcl_FreeParse(tls, parsePtr)
	XTclStackFree(tls, interp, parsePtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = funcList
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = litList
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp)))
}

//----------------------------------------------------------------------
//
// ExecConstantExprTree --
//	Compiles and executes bytecode for the subexpression tree at index
//	in the nodes array.  This subexpression must be constant, made up
//	of only constant operators (not functions) and literals.
//
// Results:
//	A standard Tcl return code and result left in interp.
//
// Side effects:
//	Consumes subtree of nodes rooted at index.  Advances the pointer
//	*litObjvPtr.
//
//----------------------------------------------------------------------

func sExecConstantExprTree(tls *libc.TLS, interp uintptr, nodes uintptr, index int32, litObjvPtr uintptr) int32 { /* tclCompExpr.c:2175:1: */
	var envPtr uintptr
	var byteCodePtr uintptr
	var code int32
	var byteCodeObj uintptr = XTcl_NewObj(tls)
	var rootPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr

	// Note we are compiling an expression with literal arguments. This means
	// there can be no [info frame] calls when we execute the resulting
	// bytecode, so there's no need to tend to TIP 280 issues.

	envPtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(CompileEnv{})))
	XTclInitCompileEnv(tls, interp, envPtr, uintptr(0), 0, uintptr(0), 0)
	sCompileExprTree(tls, interp, nodes, index, litObjvPtr, uintptr(0), uintptr(0), envPtr,
		0)
	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_DONE)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_DONE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DONE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(byteCodeObj)).FrefCount++
	XTclInitByteCodeObj(tls, byteCodeObj, envPtr)
	XTclFreeCompileEnv(tls, envPtr)
	XTclStackFree(tls, interp, envPtr)
	byteCodePtr = *(*uintptr)(unsafe.Pointer(byteCodeObj + 32))
	XTclNRExecuteByteCode(tls, interp, byteCodePtr)
	code = XTclNRRunCallbacks(tls, interp, TCL_OK, rootPtr)
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _objPtr uintptr = byteCodeObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return code
}

//----------------------------------------------------------------------
//
// CompileExprTree --
//
//	Compiles and writes to envPtr instructions for the subexpression tree
//	at index in the nodes array. (*litObjvPtr) must point to the proper
//	location in a corresponding literals list. Likewise, when non-NULL,
//	funcObjv and tokenPtr must point into matching arrays of function
//	names and Tcl_Token's derived from earlier call to ParseExpr(). When
//	optimize is true, any constant subexpressions will be precomputed.
//
// Results:
//	None.
//
// Side effects:
//	Adds instructions to envPtr to evaluate the expression at runtime.
//	Consumes subtree of nodes rooted at index. Advances the pointer
//	*litObjvPtr.
//
//----------------------------------------------------------------------

func sCompileExprTree(tls *libc.TLS, interp uintptr, nodes uintptr, index int32, litObjvPtr uintptr, funcObjv uintptr, tokenPtr uintptr, envPtr uintptr, optimize int32) { /* tclCompExpr.c:2233:1: */
	bp := tls.Alloc(240)
	defer tls.Free(240)

	var nodePtr uintptr = nodes + uintptr(index)*16
	var rootPtr uintptr = nodePtr
	var numWords int32 = 0
	var jumpPtr uintptr = uintptr(0)
	var convert int32 = 1

	for 1 != 0 {
		var next int32
		var freePtr uintptr
		var newJump uintptr

		if int32((*OpNode)(unsafe.Pointer(nodePtr)).Fmark) == MARK_LEFT {
			next = (*OpNode)(unsafe.Pointer(nodePtr)).Fleft

			if int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) == BINARY|12 {
				convert = 1
			}
		} else if int32((*OpNode)(unsafe.Pointer(nodePtr)).Fmark) == MARK_RIGHT {
			next = (*OpNode)(unsafe.Pointer(nodePtr)).Fright

			switch int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) {
			case UNARY | BAREWORD:
				{
					// var cmdName Tcl_DString at bp+16, 216

					var p uintptr
					// var length int32 at bp+232, 4

					XTcl_DStringInit(tls, bp+16)
					XTcl_DStringAppend(tls, bp+16, ts+7503, int32(uint64(unsafe.Sizeof([16]int8{}))-uint64(1)))
					p = func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(funcObjv)))).Fbytes != 0 {
							return func() uintptr {
								*(*int32)(unsafe.Pointer(bp + 232)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(funcObjv)))).Flength
								return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(funcObjv)))).Fbytes
							}()
						}
						return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(funcObjv)), bp+232)
					}()
					funcObjv += 8
					XTcl_DStringAppend(tls, bp+16, p, *(*int32)(unsafe.Pointer(bp + 232 /* length */)))
					for ok := true; ok; ok = 0 != 0 {
						var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_DString)(unsafe.Pointer(bp+16)).Fstring, (*Tcl_DString)(unsafe.Pointer(bp+16)).Flength, LITERAL_CMD_NAME)
						if _objIndexCopy <= 255 {
							for ok1 := true; ok1; ok1 = 0 != 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
									XTclExpandCodeArray(tls, envPtr)
								}
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
										if INST_PUSH1 == INST_START_CMD {
											return 1
										}
										return 0
									}()
								}
								for ok2 := true; ok2; ok2 = 0 != 0 {
									var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
									if _delta != 0 {
										if _delta == -0x7fffffff-1 {
											_delta = 1 - _objIndexCopy
										}
										for ok3 := true; ok3; ok3 = 0 != 0 {
											if _delta < 0 {
												if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
													(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
												}
											}
											*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
										}
									}
								}
							}
						} else {
							for ok4 := true; ok4; ok4 = 0 != 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
									XTclExpandCodeArray(tls, envPtr)
								}
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
										if INST_PUSH4 == INST_START_CMD {
											return 1
										}
										return 0
									}()
								}
								for ok5 := true; ok5; ok5 = 0 != 0 {
									var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
									if _delta != 0 {
										if _delta == -0x7fffffff-1 {
											_delta = 1 - _objIndexCopy
										}
										for ok6 := true; ok6; ok6 = 0 != 0 {
											if _delta < 0 {
												if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
													(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
												}
											}
											*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
										}
									}
								}
							}
						}
					}
					XTcl_DStringFree(tls, bp+16)

					// Start a count of the number of words in this function
					// command invocation. In case there's already a count in
					// progress (nested functions), save it in our unused "left"
					// field for restoring later.

					(*OpNode)(unsafe.Pointer(nodePtr)).Fleft = numWords
					numWords = 2 // Command plus one argument
					break

				}
				fallthrough
			case BINARY | 12:
				newJump = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(JumpList{})))
				(*JumpList)(unsafe.Pointer(newJump)).Fnext = jumpPtr
				jumpPtr = newJump
				XTclEmitForwardJump(tls, envPtr, TCL_FALSE_JUMP, jumpPtr)
				break
				fallthrough
			case BINARY | 13:
				newJump = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(JumpList{})))
				(*JumpList)(unsafe.Pointer(newJump)).Fnext = jumpPtr
				jumpPtr = newJump
				XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP,
					jumpPtr)
				for ok7 := true; ok7; ok7 = 0 != 0 {
					if -1 < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
				}
				if convert != 0 {
					(*JumpList)(unsafe.Pointer(jumpPtr)).Fjump.FjumpType = TCL_TRUE_JUMP
				}
				convert = 1
				break
				fallthrough
			case BINARY | 20:
				fallthrough
			case BINARY | 21:
				newJump = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(JumpList{})))
				(*JumpList)(unsafe.Pointer(newJump)).Fnext = jumpPtr
				jumpPtr = newJump
				XTclEmitForwardJump(tls, envPtr, func() uint32 {
					if int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) == BINARY|20 {
						return TCL_FALSE_JUMP
					}
					return TCL_TRUE_JUMP
				}(), jumpPtr /* &.jump */)
				break
			}
		} else {
			var pc1 int32
			var pc2 int32
			var target int32

			switch int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) {
			case UNARY | 4:
				fallthrough
			case BINARY | 12:
				if convert != 0 && nodePtr == rootPtr {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_TRY_CVT_TO_NUMERIC)
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_TRY_CVT_TO_NUMERIC == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_TRY_CVT_TO_NUMERIC].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - 0
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
				break
				fallthrough
			case UNARY | 5:

				// do nothing
				break
				fallthrough
			case UNARY | BAREWORD:

				if numWords < 255 {
					XTclEmitInvoke(tls, envPtr, INST_INVOKE_STK1, libc.VaList(bp, numWords))
				} else {
					XTclEmitInvoke(tls, envPtr, INST_INVOKE_STK4, libc.VaList(bp+8, numWords))
				}

				// Restore any saved numWords value.

				numWords = (*OpNode)(unsafe.Pointer(nodePtr)).Fleft
				convert = 1
				break
				fallthrough
			case BINARY | 3:

				numWords++
				break
				fallthrough
			case BINARY | 13:

				if (*JumpList)(unsafe.Pointer(jumpPtr)).Fjump.FjumpType == TCL_TRUE_JUMP {
					(*JumpList)(unsafe.Pointer(jumpPtr)).Fjump.FjumpType = TCL_UNCONDITIONAL_JUMP
					convert = 1
				}
				target = int32((*JumpList)(unsafe.Pointer(jumpPtr)).Fjump.FcodeOffset + uint32(2))
				if XTclFixupForwardJump(tls, envPtr, jumpPtr, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(jumpPtr)).FcodeOffset)), 127) != 0 {
					target = target + 3
				}
				freePtr = jumpPtr
				jumpPtr = (*JumpList)(unsafe.Pointer(jumpPtr)).Fnext
				XTclStackFree(tls, interp, freePtr)
				XTclFixupForwardJump(tls, envPtr, jumpPtr,
					int32(uint32(target)-(*JumpList)(unsafe.Pointer(jumpPtr)).Fjump.FcodeOffset), 127)

				freePtr = jumpPtr
				jumpPtr = (*JumpList)(unsafe.Pointer(jumpPtr)).Fnext
				XTclStackFree(tls, interp, freePtr)
				break
				fallthrough
			case BINARY | 20:
				fallthrough
			case BINARY | 21:

				pc1 = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
				for ok11 := true; ok11; ok11 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = func() uint8 {
						if int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) == BINARY|20 {
							return uint8(INST_JUMP_FALSE1)
						}
						return uint8(INST_JUMP_TRUE1)
					}()
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if func() int32 {
								if int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) == BINARY|20 {
									return INST_JUMP_FALSE1
								}
								return INST_JUMP_TRUE1
							}() == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[func() int32 {
							if int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) == BINARY|20 {
								return INST_JUMP_FALSE1
							}
							return INST_JUMP_TRUE1
						}()].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok13 := true; ok13; ok13 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok14 := true; ok14; ok14 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, func() uintptr {
						if int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) == BINARY|20 {
							return ts + 6615
						}
						return ts + 18333
					}(), 1, 0)
					if _objIndexCopy <= 255 {
						for ok15 := true; ok15; ok15 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok16 := true; ok16; ok16 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok17 := true; ok17; ok17 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok18 := true; ok18; ok18 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok19 := true; ok19; ok19 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok20 := true; ok20; ok20 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
				pc2 = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
				for ok21 := true; ok21; ok21 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_JUMP1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok22 := true; ok22; ok22 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_JUMP1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok23 := true; ok23; ok23 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				for ok24 := true; ok24; ok24 = 0 != 0 {
					if -1 < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
				}
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(pc1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(pc1)))
				if XTclFixupForwardJump(tls, envPtr, jumpPtr, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(jumpPtr)).FcodeOffset)), 127) != 0 {
					pc2 = pc2 + 3
				}
				for ok25 := true; ok25; ok25 = 0 != 0 {
					var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, func() uintptr {
						if int32((*OpNode)(unsafe.Pointer(nodePtr)).Flexeme) == BINARY|20 {
							return ts + 18333
						}
						return ts + 6615
					}(), 1, 0)
					if _objIndexCopy <= 255 {
						for ok26 := true; ok26; ok26 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok27 := true; ok27; ok27 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok28 := true; ok28; ok28 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok29 := true; ok29; ok29 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok30 := true; ok30; ok30 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok31 := true; ok31; ok31 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
				*(*uint8)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(pc2) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64(pc2)))
				convert = 0
				freePtr = jumpPtr
				jumpPtr = (*JumpList)(unsafe.Pointer(jumpPtr)).Fnext
				XTclStackFree(tls, interp, freePtr)
				break
				fallthrough
			default:
				for ok32 := true; ok32; ok32 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = instruction[(*OpNode)(unsafe.Pointer(nodePtr)).Flexeme]
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if int32(instruction[(*OpNode)(unsafe.Pointer(nodePtr)).Flexeme]) == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok33 := true; ok33; ok33 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[instruction[(*OpNode)(unsafe.Pointer(nodePtr)).Flexeme]].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - 0
							}
							for ok34 := true; ok34; ok34 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
				convert = 0
				break
			}
			if nodePtr == rootPtr {
				// We're done

				return
			}
			nodePtr = nodes + uintptr(*(*int32)(unsafe.Pointer(nodePtr + 8)))*16
			continue
		}

		(*OpNode)(unsafe.Pointer(nodePtr)).Fmark++
		switch next {
		case OT_EMPTY:
			numWords = 1 // No arguments, so just the command
			break
		case OT_LITERAL:
			{
				var litObjv uintptr = *(*uintptr)(unsafe.Pointer(litObjvPtr))
				var literal uintptr = *(*uintptr)(unsafe.Pointer(litObjv))

				if optimize != 0 {
					// var length int32 at bp+236, 4

					var bytes uintptr = func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(literal)).Fbytes != 0 {
							return func() uintptr {
								*(*int32)(unsafe.Pointer(bp + 236)) = (*Tcl_Obj)(unsafe.Pointer(literal)).Flength
								return (*Tcl_Obj)(unsafe.Pointer(literal)).Fbytes
							}()
						}
						return XTcl_GetStringFromObj(tls, literal, bp+236)
					}()
					var idx int32 = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp + 236 /* length */)) /*flags*/, 0)
					var objPtr uintptr = XTclFetchLiteral(tls, envPtr, uint32(idx))

					if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(literal)).FtypePtr != uintptr(0) {
						// Would like to do this:
						//
						// lePtr->objPtr = literal;
						// Tcl_IncrRefCount(literal);
						// Tcl_DecrRefCount(objPtr);
						//
						// However, the design of the "global" and "local"
						// LiteralTable does not permit the value of lePtr->objPtr
						// to change. So rather than replace lePtr->objPtr, we do
						// surgery to transfer our desired internalrep into it.

						(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = (*Tcl_Obj)(unsafe.Pointer(literal)).FtypePtr
						(*Tcl_Obj)(unsafe.Pointer(objPtr)).FinternalRep = (*Tcl_Obj)(unsafe.Pointer(literal)).FinternalRep
						(*Tcl_Obj)(unsafe.Pointer(literal)).FtypePtr = uintptr(0)
					}
					for ok35 := true; ok35; ok35 = 0 != 0 {
						var _objIndexCopy int32 = idx
						if _objIndexCopy <= 255 {
							for ok36 := true; ok36; ok36 = 0 != 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
									XTclExpandCodeArray(tls, envPtr)
								}
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
										if INST_PUSH1 == INST_START_CMD {
											return 1
										}
										return 0
									}()
								}
								for ok37 := true; ok37; ok37 = 0 != 0 {
									var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
									if _delta != 0 {
										if _delta == -0x7fffffff-1 {
											_delta = 1 - _objIndexCopy
										}
										for ok38 := true; ok38; ok38 = 0 != 0 {
											if _delta < 0 {
												if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
													(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
												}
											}
											*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
										}
									}
								}
							}
						} else {
							for ok39 := true; ok39; ok39 = 0 != 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
									XTclExpandCodeArray(tls, envPtr)
								}
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
										if INST_PUSH4 == INST_START_CMD {
											return 1
										}
										return 0
									}()
								}
								for ok40 := true; ok40; ok40 = 0 != 0 {
									var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
									if _delta != 0 {
										if _delta == -0x7fffffff-1 {
											_delta = 1 - _objIndexCopy
										}
										for ok41 := true; ok41; ok41 = 0 != 0 {
											if _delta < 0 {
												if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
													(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
												}
											}
											*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
										}
									}
								}
							}
						}
					}
				} else {
					// When optimize==0, we know the expression is a one-off and
					// there's nothing to be gained from sharing literals when
					// they won't live long, and the copies we have already have
					// an appropriate internalrep. In this case, skip literal
					// registration that would enable sharing, and use the routine
					// that preserves internalreps.

					for ok42 := true; ok42; ok42 = 0 != 0 {
						var _objIndexCopy int32 = XTclAddLiteralObj(tls, envPtr, literal, uintptr(0))
						if _objIndexCopy <= 255 {
							for ok43 := true; ok43; ok43 = 0 != 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
									XTclExpandCodeArray(tls, envPtr)
								}
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
										if INST_PUSH1 == INST_START_CMD {
											return 1
										}
										return 0
									}()
								}
								for ok44 := true; ok44; ok44 = 0 != 0 {
									var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
									if _delta != 0 {
										if _delta == -0x7fffffff-1 {
											_delta = 1 - _objIndexCopy
										}
										for ok45 := true; ok45; ok45 = 0 != 0 {
											if _delta < 0 {
												if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
													(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
												}
											}
											*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
										}
									}
								}
							}
						} else {
							for ok46 := true; ok46; ok46 = 0 != 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
									XTclExpandCodeArray(tls, envPtr)
								}
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
										if INST_PUSH4 == INST_START_CMD {
											return 1
										}
										return 0
									}()
								}
								for ok47 := true; ok47; ok47 = 0 != 0 {
									var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
									if _delta != 0 {
										if _delta == -0x7fffffff-1 {
											_delta = 1 - _objIndexCopy
										}
										for ok48 := true; ok48; ok48 = 0 != 0 {
											if _delta < 0 {
												if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
													(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
												}
											}
											*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
										}
									}
								}
							}
						}
					}
				}
				*(*uintptr)(unsafe.Pointer(litObjvPtr)) += 8
				break

			}
		case OT_TOKENS:
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)

			tokenPtr += 24 * uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)
			break
		default:
			if optimize != 0 && (*OpNode)(unsafe.Pointer(nodes+uintptr(next)*16)).Fconstant != 0 {
				var save Tcl_InterpState = XTcl_SaveInterpState(tls, interp, TCL_OK)

				if sExecConstantExprTree(tls, interp, nodes, next, litObjvPtr) ==
					TCL_OK {
					var idx int32
					var objPtr uintptr = XTcl_GetObjResult(tls, interp)

					// Don't generate a string rep, but if we have one
					// already, then use it to share via the literal table.

					if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
						var tableValue uintptr

						idx = XTclRegisterLiteral(tls, envPtr, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength /*flags*/, 0)
						tableValue = XTclFetchLiteral(tls, envPtr, uint32(idx))
						if (*Tcl_Obj)(unsafe.Pointer(tableValue)).FtypePtr == uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
							// Same internalrep surgery as for OT_LITERAL.

							(*Tcl_Obj)(unsafe.Pointer(tableValue)).FtypePtr = (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr
							(*Tcl_Obj)(unsafe.Pointer(tableValue)).FinternalRep = (*Tcl_Obj)(unsafe.Pointer(objPtr)).FinternalRep
							(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
						}
					} else {
						idx = XTclAddLiteralObj(tls, envPtr, objPtr, uintptr(0))
					}
					for ok49 := true; ok49; ok49 = 0 != 0 {
						var _objIndexCopy int32 = idx
						if _objIndexCopy <= 255 {
							for ok50 := true; ok50; ok50 = 0 != 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
									XTclExpandCodeArray(tls, envPtr)
								}
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
										if INST_PUSH1 == INST_START_CMD {
											return 1
										}
										return 0
									}()
								}
								for ok51 := true; ok51; ok51 = 0 != 0 {
									var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
									if _delta != 0 {
										if _delta == -0x7fffffff-1 {
											_delta = 1 - _objIndexCopy
										}
										for ok52 := true; ok52; ok52 = 0 != 0 {
											if _delta < 0 {
												if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
													(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
												}
											}
											*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
										}
									}
								}
							}
						} else {
							for ok53 := true; ok53; ok53 = 0 != 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
									XTclExpandCodeArray(tls, envPtr)
								}
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
								*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
										if INST_PUSH4 == INST_START_CMD {
											return 1
										}
										return 0
									}()
								}
								for ok54 := true; ok54; ok54 = 0 != 0 {
									var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
									if _delta != 0 {
										if _delta == -0x7fffffff-1 {
											_delta = 1 - _objIndexCopy
										}
										for ok55 := true; ok55; ok55 = 0 != 0 {
											if _delta < 0 {
												if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
													(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
												}
											}
											*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
										}
									}
								}
							}
						}
					}
				} else {
					XTclCompileSyntaxError(tls, interp, envPtr)
				}
				XTcl_RestoreInterpState(tls, interp, save)
				convert = 0
			} else {
				nodePtr = nodes + uintptr(next)*16
			}
		}
	}
}

//----------------------------------------------------------------------
//
// TclSingleOpCmd --
//
//	Implements the commands: ~, !, <<, >>, %, !=, ne, in, ni
//	in the ::tcl::mathop namespace.  These commands have no
//	extension to arbitrary arguments; they accept only exactly one
//	or exactly two arguments as suitable for the operator.
//
// Results:
//	A standard Tcl return code and result left in interp.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclSingleOpCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCompExpr.c:2534:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var occdPtr uintptr = clientData
	// var lexeme uint8 at bp, 1

	// var nodes [2]OpNode at bp+4, 32

	*(*uintptr)(unsafe.Pointer(bp + 40 /* litObjv */)) = objv + uintptr(1)*8

	if objc != 1+*(*int32)(unsafe.Pointer(occdPtr + 16)) {
		XTcl_WrongNumArgs(tls, interp, 1, objv, (*TclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fexpected)
		return TCL_ERROR
	}

	sParseLexeme(tls, (*TclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop, int32(libc.Xstrlen(tls, (*TclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop)), bp, uintptr(0))
	(*OpNode)(unsafe.Pointer(bp + 4)).Flexeme = uint8(UNARY | 4)
	(*OpNode)(unsafe.Pointer(bp + 4)).Fmark = MARK_RIGHT
	(*OpNode)(unsafe.Pointer(bp + 4)).Fright = 1
	(*OpNode)(unsafe.Pointer(bp + 4 + 1*16)).Flexeme = *(*uint8)(unsafe.Pointer(bp /* lexeme */))
	if objc == 2 {
		(*OpNode)(unsafe.Pointer(bp + 4 + 1*16)).Fmark = MARK_RIGHT
	} else {
		(*OpNode)(unsafe.Pointer(bp + 4 + 1*16)).Fmark = MARK_LEFT
		(*OpNode)(unsafe.Pointer(bp + 4 + 1*16)).Fleft = OT_LITERAL
	}
	(*OpNode)(unsafe.Pointer(bp + 4 + 1*16)).Fright = OT_LITERAL
	*(*int32)(unsafe.Pointer(bp + 4 + 1*16 + 8)) = 0

	return sExecConstantExprTree(tls, interp, bp+4, 0, bp+40)
}

//----------------------------------------------------------------------
//
// TclSortingOpCmd --
//	Implements the commands:
//		<, <=, >, >=, ==, eq
//	in the ::tcl::mathop namespace. These commands are defined for
//	arbitrary number of arguments by computing the AND of the base
//	operator applied to all neighbor argument pairs.
//
// Results:
//	A standard Tcl return code and result left in interp.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclSortingOpCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCompExpr.c:2587:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var code int32 = TCL_OK

	if objc < 3 {
		XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(1 != 0)))
	} else {
		var occdPtr uintptr = clientData
		var litObjv uintptr = XTclStackAlloc(tls, interp,
			int32(uint64(2*(objc-2))*uint64(unsafe.Sizeof(uintptr(0)))))
		var nodes uintptr = XTclStackAlloc(tls, interp, int32(uint64(2*(objc-2))*uint64(unsafe.Sizeof(OpNode{}))))
		// var lexeme uint8 at bp, 1

		var i int32
		var lastAnd int32 = 1
		*(*uintptr)(unsafe.Pointer(bp + 8 /* litObjPtrPtr */)) = litObjv

		sParseLexeme(tls, (*TclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop, int32(libc.Xstrlen(tls, (*TclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop)), bp, uintptr(0))

		*(*uintptr)(unsafe.Pointer(litObjv)) = *(*uintptr)(unsafe.Pointer(objv + 1*8))
		(*OpNode)(unsafe.Pointer(nodes)).Flexeme = uint8(UNARY | 4)
		(*OpNode)(unsafe.Pointer(nodes)).Fmark = MARK_RIGHT
		for i = 2; i < objc-1; i++ {
			*(*uintptr)(unsafe.Pointer(litObjv + uintptr(2*(i-1)-1)*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
			(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(i-1)-1)*16)).Flexeme = *(*uint8)(unsafe.Pointer(bp /* lexeme */))
			(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(i-1)-1)*16)).Fmark = MARK_LEFT
			(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(i-1)-1)*16)).Fleft = OT_LITERAL
			(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(i-1)-1)*16)).Fright = OT_LITERAL

			*(*uintptr)(unsafe.Pointer(litObjv + uintptr(2*(i-1))*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
			(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(i-1))*16)).Flexeme = uint8(BINARY | 20)
			(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(i-1))*16)).Fmark = MARK_LEFT
			(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(i-1))*16)).Fleft = lastAnd
			*(*int32)(unsafe.Pointer(nodes + uintptr(lastAnd)*16 + 8)) = 2 * (i - 1)

			(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(i-1))*16)).Fright = 2*(i-1) + 1
			*(*int32)(unsafe.Pointer(nodes + uintptr(2*(i-1)+1)*16 + 8)) = 2 * (i - 1)

			lastAnd = 2 * (i - 1)
		}
		*(*uintptr)(unsafe.Pointer(litObjv + uintptr(2*(objc-2)-1)*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))

		(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(objc-2)-1)*16)).Flexeme = *(*uint8)(unsafe.Pointer(bp /* lexeme */))
		(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(objc-2)-1)*16)).Fmark = MARK_LEFT
		(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(objc-2)-1)*16)).Fleft = OT_LITERAL
		(*OpNode)(unsafe.Pointer(nodes + uintptr(2*(objc-2)-1)*16)).Fright = OT_LITERAL

		(*OpNode)(unsafe.Pointer(nodes)).Fright = lastAnd
		*(*int32)(unsafe.Pointer(nodes + uintptr(lastAnd)*16 + 8)) = 0

		code = sExecConstantExprTree(tls, interp, nodes, 0, bp+8)

		XTclStackFree(tls, interp, nodes)
		XTclStackFree(tls, interp, litObjv)
	}
	return code
}

//----------------------------------------------------------------------
//
// TclVariadicOpCmd --
//	Implements the commands: +, *, &, |, ^, **
//	in the ::tcl::mathop namespace. These commands are defined for
//	arbitrary number of arguments by repeatedly applying the base
//	operator with suitable associative rules. When fewer than two
//	arguments are provided, suitable identity values are returned.
//
// Results:
//	A standard Tcl return code and result left in interp.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclVariadicOpCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCompExpr.c:2667:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var occdPtr uintptr = clientData
	// var lexeme uint8 at bp, 1

	var code int32

	if objc < 2 {
		XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(occdPtr + 16))))
		return TCL_OK
	}

	sParseLexeme(tls, (*TclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop, int32(libc.Xstrlen(tls, (*TclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop)), bp, uintptr(0))
	*(*uint8)(unsafe.Pointer(bp /* lexeme */)) |= uint8(BINARY)

	if objc == 2 {
		// var litObjv [2]uintptr at bp+8, 16

		// var nodes [2]OpNode at bp+24, 32

		var decrMe int32 = 0
		*(*uintptr)(unsafe.Pointer(bp + 56 /* litObjPtrPtr */)) = bp + 8 /* litObjv */

		if int32(*(*uint8)(unsafe.Pointer(bp))) == BINARY|24 {
			for ok := true; ok; ok = 0 != 0 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						*(*uintptr)(unsafe.Pointer(bp + 8 + 1*8)) = XTclThreadAllocObj(tls)
					} else {
						*(*uintptr)(unsafe.Pointer(bp + 8 + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 + 1*8)) + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 + 1*8)))).FrefCount = 0
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 + 1*8)))).Fbytes = uintptr(0)
				*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 + 1*8)) + 32)) = int64(*(*int32)(unsafe.Pointer(occdPtr + 16)))
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 + 1*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
				{
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 + 1*8)))).FrefCount++
			decrMe = 1
			*(*uintptr)(unsafe.Pointer(bp + 8)) = *(*uintptr)(unsafe.Pointer(objv + 1*8))
			(*OpNode)(unsafe.Pointer(bp + 24)).Flexeme = uint8(UNARY | 4)
			(*OpNode)(unsafe.Pointer(bp + 24)).Fmark = MARK_RIGHT
			(*OpNode)(unsafe.Pointer(bp + 24)).Fright = 1
			(*OpNode)(unsafe.Pointer(bp + 24 + 1*16)).Flexeme = *(*uint8)(unsafe.Pointer(bp /* lexeme */))
			(*OpNode)(unsafe.Pointer(bp + 24 + 1*16)).Fmark = MARK_LEFT
			(*OpNode)(unsafe.Pointer(bp + 24 + 1*16)).Fleft = OT_LITERAL
			(*OpNode)(unsafe.Pointer(bp + 24 + 1*16)).Fright = OT_LITERAL
			*(*int32)(unsafe.Pointer(bp + 24 + 1*16 + 8)) = 0
		} else {
			if int32(*(*uint8)(unsafe.Pointer(bp))) == BINARY|5 {
				*(*uintptr)(unsafe.Pointer(bp + 8)) = XTcl_NewDoubleObj(tls, 1.0)
			} else {
				for ok2 := true; ok2; ok2 = 0 != 0 {
					for ok3 := true; ok3; ok3 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							*(*uintptr)(unsafe.Pointer(bp + 8)) = XTclThreadAllocObj(tls)
						} else {
							*(*uintptr)(unsafe.Pointer(bp + 8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount = 0
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes = uintptr(0)
					*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32)) = int64(*(*int32)(unsafe.Pointer(occdPtr + 16)))
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
					{
					}
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++
			*(*uintptr)(unsafe.Pointer(bp + 8 + 1*8)) = *(*uintptr)(unsafe.Pointer(objv + 1*8))
			(*OpNode)(unsafe.Pointer(bp + 24)).Flexeme = uint8(UNARY | 4)
			(*OpNode)(unsafe.Pointer(bp + 24)).Fmark = MARK_RIGHT
			(*OpNode)(unsafe.Pointer(bp + 24)).Fright = 1
			(*OpNode)(unsafe.Pointer(bp + 24 + 1*16)).Flexeme = *(*uint8)(unsafe.Pointer(bp /* lexeme */))
			(*OpNode)(unsafe.Pointer(bp + 24 + 1*16)).Fmark = MARK_LEFT
			(*OpNode)(unsafe.Pointer(bp + 24 + 1*16)).Fleft = OT_LITERAL
			(*OpNode)(unsafe.Pointer(bp + 24 + 1*16)).Fright = OT_LITERAL
			*(*int32)(unsafe.Pointer(bp + 24 + 1*16 + 8)) = 0
		}

		code = sExecConstantExprTree(tls, interp, bp+24, 0, bp+56)

		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 8 + uintptr(decrMe)*8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return code
	} else {
		*(*uintptr)(unsafe.Pointer(bp + 64 /* litObjv */)) = objv + uintptr(1)*8
		var nodes uintptr = XTclStackAlloc(tls, interp, int32(uint64(objc-1)*uint64(unsafe.Sizeof(OpNode{}))))
		var i int32
		var lastOp int32 = OT_LITERAL

		(*OpNode)(unsafe.Pointer(nodes)).Flexeme = uint8(UNARY | 4)
		(*OpNode)(unsafe.Pointer(nodes)).Fmark = MARK_RIGHT
		if int32(*(*uint8)(unsafe.Pointer(bp))) == BINARY|24 {
			for i = objc - 2; i > 0; i-- {
				(*OpNode)(unsafe.Pointer(nodes + uintptr(i)*16)).Flexeme = *(*uint8)(unsafe.Pointer(bp /* lexeme */))
				(*OpNode)(unsafe.Pointer(nodes + uintptr(i)*16)).Fmark = MARK_LEFT
				(*OpNode)(unsafe.Pointer(nodes + uintptr(i)*16)).Fleft = OT_LITERAL
				(*OpNode)(unsafe.Pointer(nodes + uintptr(i)*16)).Fright = lastOp
				if lastOp >= 0 {
					*(*int32)(unsafe.Pointer(nodes + uintptr(lastOp)*16 + 8)) = i
				}
				lastOp = i
			}
		} else {
			for i = 1; i < objc-1; i++ {
				(*OpNode)(unsafe.Pointer(nodes + uintptr(i)*16)).Flexeme = *(*uint8)(unsafe.Pointer(bp /* lexeme */))
				(*OpNode)(unsafe.Pointer(nodes + uintptr(i)*16)).Fmark = MARK_LEFT
				(*OpNode)(unsafe.Pointer(nodes + uintptr(i)*16)).Fleft = lastOp
				if lastOp >= 0 {
					*(*int32)(unsafe.Pointer(nodes + uintptr(lastOp)*16 + 8)) = i
				}
				(*OpNode)(unsafe.Pointer(nodes + uintptr(i)*16)).Fright = OT_LITERAL
				lastOp = i
			}
		}
		(*OpNode)(unsafe.Pointer(nodes)).Fright = lastOp
		*(*int32)(unsafe.Pointer(nodes + uintptr(lastOp)*16 + 8)) = 0

		code = sExecConstantExprTree(tls, interp, nodes, 0, bp+64)

		XTclStackFree(tls, interp, nodes)
		return code
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// TclNoIdentOpCmd --
//	Implements the commands: -, /
//	in the ::tcl::mathop namespace. These commands are defined for
//	arbitrary non-zero number of arguments by repeatedly applying the base
//	operator with suitable associative rules. When no arguments are
//	provided, an error is raised.
//
// Results:
//	A standard Tcl return code and result left in interp.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclNoIdentOpCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclCompExpr.c:2786:1: */
	var occdPtr uintptr = clientData

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, (*TclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fexpected)
		return TCL_ERROR
	}
	return XTclVariadicOpCmd(tls, clientData, interp, objc, objv)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------
// Macros and flag values used by Tcl bytecode compilation and execution
// modules inside the Tcl core but not used outside.
//----------------------------------------------------------------

// Simplified form to access AuxData.
//
// ClientData TclFetchAuxData(CompileEng *envPtr, int index);

// Form of TclRegisterLiteral with flags == 0. In that case, it is safe to
// cast away constness, and it is cleanest to do that here, all in one place.
//
// int TclRegisterNewLiteral(CompileEnv *envPtr, const char *bytes,
//			     int length);

// Form of TclRegisterLiteral with flags == LITERAL_CMD_NAME. In that case, it
// is safe to cast away constness, and it is cleanest to do that here, all in
// one place.
//
// int TclRegisterNewNSLiteral(CompileEnv *envPtr, const char *bytes,
//			       int length);

// Macro used to manually adjust the stack requirements; used in cases where
// the stack effect cannot be computed from the opcode and its operands, but
// is still known at compile time.
//
// void TclAdjustStackDepth(int delta, CompileEnv *envPtr);

// Macro used to update the stack requirements. It is called by the macros
// TclEmitOpCode, TclEmitInst1 and TclEmitInst4.
// Remark that the very last instruction of a bytecode always reduces the
// stack level: INST_DONE or INST_POP, so that the maxStackdepth is always
// updated.
//
// void TclUpdateStackReqs(unsigned char op, int i, CompileEnv *envPtr);

// Macros used to update the flag that indicates if we are at the start of a
// command, based on whether the opcode is INST_START_COMMAND.
//
// void TclUpdateAtCmdStart(unsigned char op, CompileEnv *envPtr);

// Macro to emit an opcode byte into a CompileEnv's code array. The ANSI C
// "prototype" for this macro is:
//
// void TclEmitOpcode(unsigned char op, CompileEnv *envPtr);

// Macros to emit an integer operand. The ANSI C "prototype" for these macros
// are:
//
// void TclEmitInt1(int i, CompileEnv *envPtr);
// void TclEmitInt4(int i, CompileEnv *envPtr);

// Macros to emit an instruction with signed or unsigned integer operands.
// Four byte integers are stored in "big-endian" order with the high order
// byte stored at the lowest address. The ANSI C "prototypes" for these macros
// are:
//
// void TclEmitInstInt1(unsigned char op, int i, CompileEnv *envPtr);
// void TclEmitInstInt4(unsigned char op, int i, CompileEnv *envPtr);

// Macro to push a Tcl object onto the Tcl evaluation stack. It emits the
// object's one or four byte array index into the CompileEnv's code array.
// These support, respectively, a maximum of 256 (2**8) and 2**32 objects in a
// CompileEnv. The ANSI C "prototype" for this macro is:
//
// void	TclEmitPush(int objIndex, CompileEnv *envPtr);

// Macros to update a (signed or unsigned) integer starting at a pointer. The
// two variants depend on the number of bytes. The ANSI C "prototypes" for
// these macros are:
//
// void TclStoreInt1AtPtr(int i, unsigned char *p);
// void TclStoreInt4AtPtr(int i, unsigned char *p);

// Macros to update instructions at a particular pc with a new op code and a
// (signed or unsigned) int operand. The ANSI C "prototypes" for these macros
// are:
//
// void TclUpdateInstInt1AtPc(unsigned char op, int i, unsigned char *pc);
// void TclUpdateInstInt4AtPc(unsigned char op, int i, unsigned char *pc);

// Macro to fix up a forward jump to point to the current code-generation
// position in the bytecode being created (the most common case). The ANSI C
// "prototypes" for this macro is:
//
// int TclFixupForwardJumpToHere(CompileEnv *envPtr, JumpFixup *fixupPtr,
//				 int threshold);

// Macros to get a signed integer (GET_INT{1,2}) or an unsigned int
// (GET_UINT{1,2}) from a pointer. There are two variants for each return type
// that depend on the number of bytes fetched. The ANSI C "prototypes" for
// these macros are:
//
// int TclGetInt1AtPtr(unsigned char *p);
// int TclGetInt4AtPtr(unsigned char *p);
// unsigned int TclGetUInt1AtPtr(unsigned char *p);
// unsigned int TclGetUInt4AtPtr(unsigned char *p);

// The TclGetInt1AtPtr macro is tricky because we want to do sign extension on
// the 1-byte value. Unfortunately the "char" type isn't signed on all
// platforms so sign-extension doesn't always happen automatically. Sometimes
// we can explicitly declare the pointer to be signed, but other times we have
// to explicitly sign-extend the value in software.

// Macros used to compute the minimum and maximum of two integers. The ANSI C
// "prototypes" for these macros are:
//
// int TclMin(int i, int j);
// int TclMax(int i, int j);

// Convenience macros for use when compiling bodies of commands. The ANSI C
// "prototype" for these macros are:
//
// static void		BODY(Tcl_Token *tokenPtr, int word);

// Convenience macro for use when compiling tokens to be pushed. The ANSI C
// "prototype" for this macro is:
//
// static void		CompileTokens(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp);

// Convenience macros for use when pushing literals. The ANSI C "prototype" for
// these macros are:
//
// static void		PushLiteral(CompileEnv *envPtr,
//			    const char *string, int length);
// static void		PushStringLiteral(CompileEnv *envPtr,
//			    const char *string);

// Macro to advance to the next token; it is more mnemonic than the address
// arithmetic that it replaces. The ANSI C "prototype" for this macro is:
//
// static Tcl_Token *	TokenAfter(Tcl_Token *tokenPtr);

// Macro to get the offset to the next instruction to be issued. The ANSI C
// "prototype" for this macro is:
//
// static int	CurrentOffset(CompileEnv *envPtr);

// Note: the exceptDepth is a bit of a misnomer: TEBC only needs the
// maximal depth of nested CATCH ranges in order to alloc runtime
// memory. These macros should compute precisely that? OTOH, the nesting depth
// of LOOP ranges is an interesting datum for debugging purposes, and that is
// what we compute now.
//
// static int	ExceptionRangeStarts(CompileEnv *envPtr, int index);
// static void	ExceptionRangeEnds(CompileEnv *envPtr, int index);
// static void	ExceptionRangeTarget(CompileEnv *envPtr, int index, LABEL);

// Check if there is an LVT for compiled locals

// Macros for making it easier to deal with tokens and DStrings.

// Macro that encapsulates an efficiency trick that avoids a function call for
// the simplest of compiles. The ANSI C "prototype" for this macro is:
//
// static void		CompileWord(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp, int word);

// TIP #280: Remember the per-word line information of the current command. An
// index is used instead of a pointer as recursive compilation may reallocate,
// i.e. move, the array. This is also the reason to save the nuloc now, it may
// change during the course of the function.
//
// Macro to encapsulate the variable definition and setup.

// Often want to issue one of two versions of an instruction based on whether
// the argument will fit in a single byte or not. This makes it much clearer.

// How to get an anonymous local variable (used for holding temporary values
// off the stack) or a local simple scalar.

// Flags bits used by TclPushVarName.

// DTrace probe macros (NOPs if DTrace support is not enabled).

// Define the following macros to enable debug logging of the DTrace proc,
// cmd, and inst probes. Note that this does _not_ require a platform with
// DTrace, it simply logs all probe output to /tmp/tclDTraceDebug-[pid].log.
//
// If the second macro is defined, logging to file starts immediately,
// otherwise only after the first call to [tcl::dtrace]. Note that the debug
// probe data is always computed, even when it is not logged to file.
//
// Defining the third macro enables debug logging of inst probes (disabled
// by default due to the significant performance impact).

//
// #define TCL_DTRACE_DEBUG 1
// #define TCL_DTRACE_DEBUG_LOG_ENABLED 1
// #define TCL_DTRACE_DEBUG_INST_PROBES 1

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.2 Diagnostics	<assert.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// void assert (int expression);
//
//    If NDEBUG is defined, do nothing.
//    If not, and EXPRESSION is zero, print an error message and abort.

// void assert_perror (int errnum);
//
//    If NDEBUG is defined, do nothing.  If not, and ERRNUM is not zero, print an
//    error message with the error text for ERRNUM and abort.
//    (This is a GNU extension.)

// Variable that controls whether compilation tracing is enabled and, if so,
// what level of tracing is desired:
//    0: no compilation tracing
//    1: summarize compilation of top level cmds and proc bodies
//    2: display all instructions of each ByteCode compiled
// This variable is linked to the Tcl variable "tcl_traceCompile".

// A table describing the Tcl bytecode instructions. Entries in this table
// must correspond to the instruction opcode definitions in tclCompile.h. The
// names "op1" and "op4" refer to an instruction's one or four byte first
// operand. Similarly, "stktop" and "stknext" refer to the topmost and next to
// topmost stack elements.
//
// Note that the load, store, and incr instructions do not distinguish local
// from global variables; the bytecode interpreter at runtime uses the
// existence of a procedure call frame to distinguish these.

var XtclInstructionTable = [191]InstructionDesc{
	// Name	      Bytes stackEffect #Opnds  Operand types
	{Fname: ts + 20073, FnumBytes: 1, FstackEffect: -1},
	// Finish ByteCode execution and return stktop (top stack item)
	{Fname: ts + 20078, FnumBytes: 2, FstackEffect: +1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LIT1}},
	// Push object at ByteCode objArray[op1]
	{Fname: ts + 20084, FnumBytes: 5, FstackEffect: +1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LIT4}},
	// Push object at ByteCode objArray[op4]
	{Fname: ts + 3001, FnumBytes: 1, FstackEffect: -1},
	// Pop the topmost stack object
	{Fname: ts + 2393, FnumBytes: 1, FstackEffect: +1},
	// Duplicate the topmost stack object and push the result
	{Fname: ts + 3165, FnumBytes: 2, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT1}},
	// Concatenate the top op1 items and push result
	{Fname: ts + 20090, FnumBytes: 2, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT1}},
	// Invoke command named objv[0]; <objc,objv> = <op1,top op1>
	{Fname: ts + 20101, FnumBytes: 5, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT4}},
	// Invoke command named objv[0]; <objc,objv> = <op4,top op4>
	{Fname: ts + 2414, FnumBytes: 1},
	// Evaluate command in stktop using Tcl_EvalObj.
	{Fname: ts + 2473, FnumBytes: 1},
	// Execute expression in stktop using Tcl_ExprStringObj.

	{Fname: ts + 20112, FnumBytes: 2, FstackEffect: 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT1}},
	// Load scalar variable at index op1 <= 255 in call frame
	{Fname: ts + 20124, FnumBytes: 5, FstackEffect: 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Load scalar variable at index op1 >= 256 in call frame
	{Fname: ts + 20136, FnumBytes: 1},
	// Load scalar variable; scalar's name is stktop
	{Fname: ts + 20150, FnumBytes: 2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT1}},
	// Load array element; array at slot op1<=255, element is stktop
	{Fname: ts + 20161, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Load array element; array at slot op1 > 255, element is stktop
	{Fname: ts + 2892, FnumBytes: 1, FstackEffect: -1},
	// Load array element; element is stktop, array name is stknext
	{Fname: ts + 2905, FnumBytes: 1},
	// Load general variable; unparsed variable name is stktop
	{Fname: ts + 20172, FnumBytes: 2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT1}},
	// Store scalar variable at op1<=255 in frame; value is stktop
	{Fname: ts + 20185, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Store scalar variable at op1 > 255 in frame; value is stktop
	{Fname: ts + 20198, FnumBytes: 1, FstackEffect: -1},
	// Store scalar; value is stktop, scalar name is stknext
	{Fname: ts + 20213, FnumBytes: 2, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT1}},
	// Store array element; array at op1<=255, value is top then elem
	{Fname: ts + 20225, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Store array element; array at op1>=256, value is top then elem
	{Fname: ts + 3096, FnumBytes: 1, FstackEffect: -2},
	// Store array element; value is stktop, then elem, array names
	{Fname: ts + 3110, FnumBytes: 1, FstackEffect: -1},
	// Store general variable; value is stktop, then unparsed name

	{Fname: ts + 20237, FnumBytes: 2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT1}},
	// Incr scalar at index op1<=255 in frame; incr amount is stktop
	{Fname: ts + 20249, FnumBytes: 1, FstackEffect: -1},
	// Incr scalar; incr amount is stktop, scalar's name is stknext
	{Fname: ts + 20263, FnumBytes: 2, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT1}},
	// Incr array elem; arr at slot op1<=255, amount is top then elem
	{Fname: ts + 2515, FnumBytes: 1, FstackEffect: -2},
	// Incr array element; amount is top then elem then array names
	{Fname: ts + 2552, FnumBytes: 1, FstackEffect: -1},
	// Incr general variable; amount is stktop then unparsed var name
	{Fname: ts + 20274, FnumBytes: 3, FstackEffect: +1, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_LVT1, OPERAND_INT1}},
	// Incr scalar at slot op1 <= 255; amount is 2nd operand byte
	{Fname: ts + 20289, FnumBytes: 2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_INT1}},
	// Incr scalar; scalar name is stktop; incr amount is op1
	{Fname: ts + 20306, FnumBytes: 3, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_LVT1, OPERAND_INT1}},
	// Incr array elem; array at slot op1 <= 255, elem is stktop,
	// amount is 2nd operand byte
	{Fname: ts + 2528, FnumBytes: 2, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_INT1}},
	// Incr array element; elem is top then array name, amount is op1
	{Fname: ts + 2560, FnumBytes: 2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_INT1}},
	// Incr general variable; unparsed name is top, amount is op1

	{Fname: ts + 20320, FnumBytes: 2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_OFFSET1}},
	// Jump relative to (pc + op1)
	{Fname: ts + 2616, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_OFFSET4}},
	// Jump relative to (pc + op4)
	{Fname: ts + 20326, FnumBytes: 2, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_OFFSET1}},
	// Jump relative to (pc + op1) if stktop expr object is true
	{Fname: ts + 2662, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_OFFSET4}},
	// Jump relative to (pc + op4) if stktop expr object is true
	{Fname: ts + 20336, FnumBytes: 2, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_OFFSET1}},
	// Jump relative to (pc + op1) if stktop expr object is false
	{Fname: ts + 2632, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_OFFSET4}},
	// Jump relative to (pc + op4) if stktop expr object is false

	{Fname: ts + 2913, FnumBytes: 1, FstackEffect: -1},
	// Logical or:	push (stknext || stktop)
	{Fname: ts + 2678, FnumBytes: 1, FstackEffect: -1},
	// Logical and:	push (stknext && stktop)
	{Fname: ts + 2206, FnumBytes: 1, FstackEffect: -1},
	// Bitwise or:	push (stknext | stktop)
	{Fname: ts + 2212, FnumBytes: 1, FstackEffect: -1},
	// Bitwise xor	push (stknext ^ stktop)
	{Fname: ts + 2192, FnumBytes: 1, FstackEffect: -1},
	// Bitwise and:	push (stknext & stktop)
	{Fname: ts + 2406, FnumBytes: 1, FstackEffect: -1},
	// Equal:	push (stknext == stktop)
	{Fname: ts + 2954, FnumBytes: 1, FstackEffect: -1},
	// Not equal:	push (stknext != stktop)
	{Fname: ts + 2942, FnumBytes: 1, FstackEffect: -1},
	// Less:	push (stknext < stktop)
	{Fname: ts + 2484, FnumBytes: 1, FstackEffect: -1},
	// Greater:	push (stknext > stktop)
	{Fname: ts + 2795, FnumBytes: 1, FstackEffect: -1},
	// Less or equal: push (stknext <= stktop)
	{Fname: ts + 2481, FnumBytes: 1, FstackEffect: -1},
	// Greater or equal: push (stknext >= stktop)
	{Fname: ts + 2935, FnumBytes: 1, FstackEffect: -1},
	// Left shift:	push (stknext << stktop)
	{Fname: ts + 3072, FnumBytes: 1, FstackEffect: -1},
	// Right shift:	push (stknext >> stktop)
	{Fname: ts + 2077, FnumBytes: 1, FstackEffect: -1},
	// Add:		push (stknext + stktop)
	{Fname: ts + 3287, FnumBytes: 1, FstackEffect: -1},
	// Sub:		push (stkext - stktop)
	{Fname: ts + 2949, FnumBytes: 1, FstackEffect: -1},
	// Multiply:	push (stknext * stktop)
	{Fname: ts + 2389, FnumBytes: 1, FstackEffect: -1},
	// Divide:	push (stknext / stktop)
	{Fname: ts + 2945, FnumBytes: 1, FstackEffect: -1},
	// Mod:		push (stknext % stktop)
	{Fname: ts + 3420, FnumBytes: 1},
	// Unary plus:	push +stktop
	{Fname: ts + 3373, FnumBytes: 1},
	// Unary minus:	push -stktop
	{Fname: ts + 2199, FnumBytes: 1},
	// Bitwise not:	push ~stktop
	{Fname: ts + 2962, FnumBytes: 1},
	// Logical not:	push !stktop
	{Fname: ts + 20347, FnumBytes: 2, FstackEffect: 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT1}},
	// Call builtin math function with index op1; any args are on stk
	{Fname: ts + 20364, FnumBytes: 2, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT1}},
	// Call non-builtin func objv[0]; <objc,objv>=<op1,top op1>
	{Fname: ts + 3357, FnumBytes: 1},
	// Try converting stktop to first int then double if possible.

	{Fname: ts + 5100, FnumBytes: 1},
	// Abort closest enclosing loop; if none, return TCL_BREAK code.
	{Fname: ts + 5117, FnumBytes: 1},
	// Skip to next iteration of closest enclosing loop; if none, return
	// TCL_CONTINUE code.

	{Fname: ts + 20374, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_AUX4}},
	// Initialize execution of a foreach loop. Operand is aux data index
	// of the ForeachInfo structure for the foreach command.
	{Fname: ts + 20389, FnumBytes: 5, FstackEffect: +1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_AUX4}},
	// "Step" or begin next iteration of foreach loop. Push 0 if to
	// terminate loop, else push 1.

	{Fname: ts + 20403, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT4}},
	// Record start of catch with the operand's exception index. Push the
	// current stack depth onto a special catch stack.
	{Fname: ts + 2397, FnumBytes: 1},
	// End of last catch. Pop the bytecode interpreter's catch stack.
	{Fname: ts + 3035, FnumBytes: 1, FstackEffect: +1},
	// Push the interpreter's object result onto the stack.
	{Fname: ts + 3005, FnumBytes: 1, FstackEffect: +1},
	// Push interpreter's return code (e.g. TCL_OK or TCL_ERROR) as a new
	// object onto the stack.

	{Fname: ts + 3172, FnumBytes: 1, FstackEffect: -1},
	// Str Equal:	push (stknext eq stktop)
	{Fname: ts + 3218, FnumBytes: 1, FstackEffect: -1},
	// Str !Equal:	push (stknext neq stktop)
	{Fname: ts + 3158, FnumBytes: 1, FstackEffect: -1},
	// Str Compare:	push (stknext cmp stktop)
	{Fname: ts + 3195, FnumBytes: 1},
	// Str Length:	push (strlen stktop)
	{Fname: ts + 3186, FnumBytes: 1, FstackEffect: -1},
	// Str Index:	push (strindex stknext stktop)
	{Fname: ts + 3209, FnumBytes: 2, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_INT1}},
	// Str Match:	push (strmatch stknext stktop) opnd == nocase

	{Fname: ts + 2810, FnumBytes: 5, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT4}},
	// List:	push (stk1 stk2 ... stktop)
	{Fname: ts + 2833, FnumBytes: 1, FstackEffect: -1},
	// List Index:	push (listindex stknext stktop)
	{Fname: ts + 2856, FnumBytes: 1},
	// List Len:	push (listlength stktop)

	{Fname: ts + 20415, FnumBytes: 2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT1}},
	// Append scalar variable at op1<=255 in frame; value is stktop
	{Fname: ts + 20429, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Append scalar variable at op1 > 255 in frame; value is stktop
	{Fname: ts + 20443, FnumBytes: 2, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT1}},
	// Append array element; array at op1<=255, value is top then elem
	{Fname: ts + 20456, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Append array element; array at op1>=256, value is top then elem
	{Fname: ts + 2100, FnumBytes: 1, FstackEffect: -2},
	// Append array element; value is stktop, then elem, array names
	{Fname: ts + 2115, FnumBytes: 1, FstackEffect: -1},
	// Append general variable; value is stktop, then unparsed name
	{Fname: ts + 20469, FnumBytes: 2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT1}},
	// Lappend scalar variable at op1<=255 in frame; value is stktop
	{Fname: ts + 20484, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Lappend scalar variable at op1 > 255 in frame; value is stktop
	{Fname: ts + 20499, FnumBytes: 2, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT1}},
	// Lappend array element; array at op1<=255, value is top then elem
	{Fname: ts + 20513, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Lappend array element; array at op1>=256, value is top then elem
	{Fname: ts + 2704, FnumBytes: 1, FstackEffect: -2},
	// Lappend array element; value is stktop, then elem, array names
	{Fname: ts + 2784, FnumBytes: 1, FstackEffect: -1},
	// Lappend general variable; value is stktop, then unparsed name

	{Fname: ts + 2798, FnumBytes: 5, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT4}},
	// Lindex with generalized args, operand is number of stacked objs
	// used: (operand-1) entries from stktop are the indices; then list to
	// process.
	{Fname: ts + 2996, FnumBytes: 5, FstackEffect: +1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT4}},
	// Duplicate the arg-th element from top of stack (TOS=0)
	{Fname: ts + 2926, FnumBytes: 1, FstackEffect: -2},
	// Four-arg version of 'lset'. stktop is old value; next is new
	// element value, next is the index list; pushes new value
	{Fname: ts + 2917, FnumBytes: 5, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT4}},
	// Three- or >=5-arg version of 'lset', operand is number of stacked
	// objs: stktop is old value, next is new element value, next come
	// (operand-2) indices; pushes the new value.

	{Fname: ts + 20527, FnumBytes: 9, FstackEffect: -1, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_INT4, OPERAND_UINT4}},
	// Compiled [return], code, level are operands; options and result
	// are on the stack.
	{Fname: ts + 2462, FnumBytes: 1, FstackEffect: -1},
	// Binary exponentiation operator: push (stknext ** stktop)

	// NOTE: the stack effects of expandStkTop and invokeExpanded are wrong -
	// but it cannot be done right at compile time, the stack effect is only
	// known at run time. The value for invokeExpanded is estimated better at
	// compile time.
	// See the comments further down in this file, where INST_INVOKE_EXPANDED
	// is emitted.
	{Fname: ts + 20537, FnumBytes: 1},
	// Start of command with {*} (expanded) arguments
	{Fname: ts + 20549, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT4}},
	// Expand the list at stacktop: push its elements on the stack
	{Fname: ts + 20562, FnumBytes: 1},
	// Invoke the command marked by the last 'expandStart'

	{Fname: ts + 2843, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_IDX4}},
	// List Index:	push (lindex stktop op4)
	{Fname: ts + 20577, FnumBytes: 9, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_IDX4, OPERAND_IDX4}},
	// List Range:	push (lrange stktop op4 op4)
	{Fname: ts + 20590, FnumBytes: 9, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_OFFSET4, OPERAND_UINT4}},
	// Start of bytecoded command: op is the length of the cmd's code, op2
	// is number of commands here

	{Fname: ts + 2826, FnumBytes: 1, FstackEffect: -1},
	// List containment: push [lsearch stktop stknext]>=0)
	{Fname: ts + 2867, FnumBytes: 1, FstackEffect: -1},
	// List negated containment: push [lsearch stktop stknext]<0)

	{Fname: ts + 3020, FnumBytes: 1, FstackEffect: +1},
	// Push the interpreter's return option dictionary as an object on the
	// stack.
	{Fname: ts + 20603, FnumBytes: 1, FstackEffect: -1},
	// Compiled [return]; options and result are on the stack, code and
	// level are in the options.

	{Fname: ts + 2305, FnumBytes: 5, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT4}},
	// The top op4 words (min 1) are a key path into the dictionary just
	// below the keys on the stack, and all those values are replaced by
	// the value read out of that key-path (like [dict get]).
	// Stack:  ... dict key1 ... keyN => ... value
	{Fname: ts + 2371, FnumBytes: 9, FstackEffect: -0x7fffffff - 1, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_UINT4, OPERAND_LVT4}},
	// Update a dictionary value such that the keys are a path pointing to
	// the value. op4#1 = numKeys, op4#2 = LVTindex
	// Stack:  ... key1 ... keyN value => ... newDict
	{Fname: ts + 2379, FnumBytes: 9, FstackEffect: -0x7fffffff - 1, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_UINT4, OPERAND_LVT4}},
	// Update a dictionary value such that the keys are not a path pointing
	// to any value. op4#1 = numKeys, op4#2 = LVTindex
	// Stack:  ... key1 ... keyN => ... newDict
	{Fname: ts + 2313, FnumBytes: 9, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_INT4, OPERAND_LVT4}},
	// Update a dictionary value such that the value pointed to by key is
	// incremented by some value (or set to it if the key isn't in the
	// dictionary at all). op4#1 = incrAmount, op4#2 = LVTindex
	// Stack:  ... key => ... newDict
	{Fname: ts + 2272, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Update a dictionary value such that the value pointed to by key has
	// some value string-concatenated onto it. op4 = LVTindex
	// Stack:  ... key valueToAppend => ... newDict
	{Fname: ts + 2325, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Update a dictionary value such that the value pointed to by key has
	// some value list-appended onto it. op4 = LVTindex
	// Stack:  ... key valueToAppend => ... newDict
	{Fname: ts + 20613, FnumBytes: 5, FstackEffect: +2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Begin iterating over the dictionary, using the local scalar
	// indicated by op4 to hold the iterator state. The local scalar
	// should not refer to a named variable as the value is not wholly
	// managed correctly.
	// Stack:  ... dict => ... value key doneBool
	{Fname: ts + 20623, FnumBytes: 5, FstackEffect: +3, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Get the next iteration from the iterator in op4's local scalar.
	// Stack:  ... => ... value key doneBool
	{Fname: ts + 20632, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Terminate the iterator in op4's local scalar. Use unsetScalar
	// instead (with 0 for flags).
	{Fname: ts + 20641, FnumBytes: 9, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_LVT4, OPERAND_AUX4}},
	// Create the variables (described in the aux data referred to by the
	// second immediate argument) to mirror the state of the dictionary in
	// the variable referred to by the first immediate argument. The list
	// of keys (top of the stack, not popped) must be the same length as
	// the list of variables.
	// Stack:  ... keyList => ... keyList
	{Fname: ts + 20657, FnumBytes: 9, FstackEffect: -1, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_LVT4, OPERAND_AUX4}},
	// Reflect the state of local variables (described in the aux data
	// referred to by the second immediate argument) back to the state of
	// the dictionary in the variable referred to by the first immediate
	// argument. The list of keys (popped from the stack) must be the same
	// length as the list of variables.
	// Stack:  ... keyList => ...
	{Fname: ts + 2643, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_AUX4}},
	// Jump according to the jump-table (in AuxData as indicated by the
	// operand) and the argument popped from the list. Always executes the
	// next instruction if no match against the table's entries was found.
	// Stack:  ... value => ...
	// Note that the jump table contains offsets relative to the PC when
	// it points to this instruction; the code is relocatable.
	{Fname: ts + 3426, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// finds level and otherName in stack, links to local variable at
	// index op1. Leaves the level on stack.
	{Fname: ts + 2966, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// finds namespace and otherName in stack, links to local variable at
	// index op1. Leaves the namespace on stack.
	{Fname: ts + 3432, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// finds namespace and otherName in stack, links to local variable at
	// index op1. Leaves the namespace on stack.
	{Fname: ts + 20671, FnumBytes: 9, FstackEffect: -1, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_INT4, OPERAND_UINT4}},
	// Compiled bytecodes to signal syntax error. Equivalent to returnImm
	// except for the ERR_ALREADY_LOGGED flag in the interpreter.
	{Fname: ts + 3064, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT4}},
	// Reverse the order of the arg elements at the top of stack

	{Fname: ts + 3046, FnumBytes: 2, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_INT1}},
	// Regexp:	push (regexp stknext stktop) opnd == nocase

	{Fname: ts + 20678, FnumBytes: 5, FstackEffect: 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Test if scalar variable at index op1 in call frame exists
	{Fname: ts + 2428, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Test if array element exists; array at slot op1, element is
	// stktop
	{Fname: ts + 2439, FnumBytes: 1, FstackEffect: -1},
	// Test if array element exists; element is stktop, array name is
	// stknext
	{Fname: ts + 2453, FnumBytes: 1},
	// Test if general variable exists; unparsed variable name is stktop

	{Fname: ts + 2958, FnumBytes: 1},
	// Do nothing
	{Fname: ts + 20690, FnumBytes: 1, FstackEffect: -1},
	// Jump to next instruction based on the return code on top of stack
	// ERROR: +1;	RETURN: +3;	BREAK: +5;	CONTINUE: +7;
	// Other non-OK: +9

	{Fname: ts + 20707, FnumBytes: 6, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_UINT1, OPERAND_LVT4}},
	// Make scalar variable at index op2 in call frame cease to exist;
	// op1 is 1 for errors on problems, 0 otherwise
	{Fname: ts + 3386, FnumBytes: 6, FstackEffect: -1, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_UINT1, OPERAND_LVT4}},
	// Make array element cease to exist; array at slot op2, element is
	// stktop; op1 is 1 for errors on problems, 0 otherwise
	{Fname: ts + 3397, FnumBytes: 2, FstackEffect: -2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT1}},
	// Make array element cease to exist; element is stktop, array name is
	// stknext; op1 is 1 for errors on problems, 0 otherwise
	{Fname: ts + 3411, FnumBytes: 2, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT1}},
	// Make general variable cease to exist; unparsed variable name is
	// stktop; op1 is 1 for errors on problems, 0 otherwise

	{Fname: ts + 2294, FnumBytes: 1, FstackEffect: -1},
	// Probe into a dict and extract it (or a subdict of it) into
	// variables with matched names. Produces list of keys bound as
	// result. Part of [dict with].
	// Stack:  ... dict path => ... keyList
	{Fname: ts + 2337, FnumBytes: 1, FstackEffect: -3},
	// Map variable contents back into a dictionary in a variable. Part of
	// [dict with].
	// Stack:  ... dictVarName path keyList => ...
	{Fname: ts + 2354, FnumBytes: 5, FstackEffect: -2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Map variable contents back into a dictionary in the local variable
	// indicated by the LVT index. Part of [dict with].
	// Stack:  ... path keyList => ...
	{Fname: ts + 2283, FnumBytes: 5, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT4}},
	// The top op4 words (min 1) are a key path into the dictionary just
	// below the keys on the stack, and all those values are replaced by a
	// boolean indicating whether it is possible to read out a value from
	// that key-path (like [dict exists]).
	// Stack:  ... dict key1 ... keyN => ... boolean
	{Fname: ts + 3441, FnumBytes: 1, FstackEffect: -1},
	// Verifies that the word on the top of the stack is a dictionary,
	// popping it if it is and throwing an error if it is not.
	// Stack:  ... value => ...

	{Fname: ts + 3202, FnumBytes: 1, FstackEffect: -2},
	// Simplified version of [string map] that only applies one change
	// string, and only case-sensitively.
	// Stack:  ... from to string => ... changedString
	{Fname: ts + 3178, FnumBytes: 1, FstackEffect: -1},
	// Find the first index of a needle string in a haystack string,
	// producing the index (integer) or -1 if nothing found.
	// Stack:  ... needle haystack => ... index
	{Fname: ts + 3245, FnumBytes: 1, FstackEffect: -1},
	// Find the last index of a needle string in a haystack string,
	// producing the index (integer) or -1 if nothing found.
	// Stack:  ... needle haystack => ... index
	{Fname: ts + 20719, FnumBytes: 9, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_IDX4, OPERAND_IDX4}},
	// String Range: push (string range stktop op4 op4)
	{Fname: ts + 3225, FnumBytes: 1, FstackEffect: -2},
	// String Range with non-constant arguments.
	// Stack:  ... string idxA idxB => ... substring

	{Fname: ts + 3452, FnumBytes: 1},
	// Makes the current coroutine yield the value at the top of the
	// stack, and places the response back on top of the stack when it
	// resumes.
	// Stack:  ... valueToYield => ... resumeValue
	{Fname: ts + 2246, FnumBytes: 1, FstackEffect: +1},
	// Push the name of the interpreter's current coroutine as an object
	// on the stack.
	{Fname: ts + 5326, FnumBytes: 2, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT1}},
	// Do a tailcall with the opnd items on the stack as the thing to
	// tailcall to; opnd must be greater than 0 for the semantics to work
	// right.

	{Fname: ts + 2255, FnumBytes: 1, FstackEffect: +1},
	// Push the name of the interpreter's current namespace as an object
	// on the stack.
	{Fname: ts + 2585, FnumBytes: 1, FstackEffect: +1},
	// Push the stack depth (i.e., [info level]) of the interpreter as an
	// object on the stack.
	{Fname: ts + 2571, FnumBytes: 1},
	// Push the argument words to a stack depth (i.e., [info level <n>])
	// of the interpreter as an object on the stack.
	// Stack:  ... depth => ... argList
	{Fname: ts + 3053, FnumBytes: 1},
	// Resolves the command named on the top of the stack to its fully
	// qualified version, or produces the empty string if no such command
	// exists. Never generates errors.
	// Stack:  ... cmdName => ... fullCmdName

	{Fname: ts + 3331, FnumBytes: 1, FstackEffect: +1},
	// Push the identity of the current TclOO object (i.e., the name of
	// its current public access command) on the stack.
	{Fname: ts + 3291, FnumBytes: 1},
	// Push the class of the TclOO object named at the top of the stack
	// onto the stack.
	// Stack:  ... object => ... class
	{Fname: ts + 3316, FnumBytes: 1},
	// Push the namespace of the TclOO object named at the top of the
	// stack onto the stack.
	// Stack:  ... object => ... namespace
	{Fname: ts + 3302, FnumBytes: 1},
	// Push whether the value named at the top of the stack is a TclOO
	// object (i.e., a boolean). Can corrupt the interpreter result
	// despite not throwing, so not safe for use in a post-exception
	// context.
	// Stack:  ... value => ... boolean

	{Fname: ts + 2140, FnumBytes: 1},
	// Looks up the element on the top of the stack and tests whether it
	// is an array. Pushes a boolean describing whether this is the
	// case. Also runs the whole-array trace on the named variable, so can
	// throw anything.
	// Stack:  ... varName => ... boolean
	{Fname: ts + 2125, FnumBytes: 5, FstackEffect: +1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Looks up the variable indexed by opnd and tests whether it is an
	// array. Pushes a boolean describing whether this is the case. Also
	// runs the whole-array trace on the named variable, so can throw
	// anything.
	// Stack:  ... => ... boolean
	{Fname: ts + 2168, FnumBytes: 1, FstackEffect: -1},
	// Forces the element on the top of the stack to be the name of an
	// array.
	// Stack:  ... varName => ...
	{Fname: ts + 2155, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Forces the variable indexed by opnd to be an array. Does not touch
	// the stack.

	{Fname: ts + 20731, FnumBytes: 6, FstackEffect: -0x7fffffff - 1, FnumOperands: 2, FopTypes: [2]InstOperandType{OPERAND_UINT4, OPERAND_UINT1}},
	// Invoke command named objv[0], replacing the first two words with
	// the word at the top of the stack;
	// <objc,objv> = <op4,top op4 after popping 1>

	{Fname: ts + 2815, FnumBytes: 1, FstackEffect: -1},
	// Concatenates the two lists at the top of the stack into a single
	// list and pushes that resulting list onto the stack.
	// Stack: ... list1 list2 => ... [lconcat list1 list2]

	{Fname: ts + 20745, FnumBytes: 1},
	// Drops an element from the auxiliary stack, popping stack elements
	// until the matching stack depth is reached.

	// New foreach implementation
	{Fname: ts + 20756, FnumBytes: 5, FstackEffect: +2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_AUX4}},
	// Initialize execution of a foreach loop. Operand is aux data index
	// of the ForeachInfo structure for the foreach command. It pushes 2
	// elements which hold runtime params for foreach_step, they are later
	// dropped by foreach_end together with the value lists. NOTE that the
	// iterator-tracker and info reference must not be passed to bytecodes
	// that handle normal Tcl values. NOTE that this instruction jumps to
	// the foreach_step instruction paired with it; the stack info below
	// is only nominal.
	// Stack: ... listObjs... => ... listObjs... iterTracker info
	{Fname: ts + 20770, FnumBytes: 1},
	// "Step" or begin next iteration of foreach loop. Assigns to foreach
	// iteration variables. May jump to straight after the foreach_start
	// that pushed the iterTracker and info values. MUST be followed
	// immediately by a foreach_end.
	// Stack: ... listObjs... iterTracker info =>
	//				... listObjs... iterTracker info
	{Fname: ts + 20783, FnumBytes: 1},
	// Clean up a foreach loop by dropping the info value, the tracker
	// value and the lists that were being iterated over.
	// Stack: ... listObjs... iterTracker info => ...
	{Fname: ts + 20795, FnumBytes: 1, FstackEffect: -1},
	// Appends the value at the top of the stack to the list located on
	// the stack the "other side" of the foreach-related values.
	// Stack: ... collector listObjs... iterTracker info value =>
	//			... collector listObjs... iterTracker info

	{Fname: ts + 3254, FnumBytes: 1, FstackEffect: -1},
	// [string trim] core: removes the characters (designated by the value
	// at the top of the stack) from both ends of the string and pushes
	// the resulting string.
	// Stack: ... string charset => ... trimmedString
	{Fname: ts + 3262, FnumBytes: 1, FstackEffect: -1},
	// [string trimleft] core: removes the characters (designated by the
	// value at the top of the stack) from the left of the string and
	// pushes the resulting string.
	// Stack: ... string charset => ... trimmedString
	{Fname: ts + 3274, FnumBytes: 1, FstackEffect: -1},
	// [string trimright] core: removes the characters (designated by the
	// value at the top of the stack) from the right of the string and
	// pushes the resulting string.
	// Stack: ... string charset => ... trimmedString

	{Fname: ts + 2236, FnumBytes: 5, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT4}},
	// Wrapper round Tcl_ConcatObj(), used for [concat] and [eval]. opnd
	// is number of values to concatenate.
	// Operation:	push concat(stk1 stk2 ... stktop)

	{Fname: ts + 3145, FnumBytes: 1},
	// [string toupper] core: converts whole string to upper case using
	// the default (extended "C" locale) rules.
	// Stack: ... string => ... newString
	{Fname: ts + 3119, FnumBytes: 1},
	// [string tolower] core: converts whole string to upper case using
	// the default (extended "C" locale) rules.
	// Stack: ... string => ... newString
	{Fname: ts + 3132, FnumBytes: 1},
	// [string totitle] core: converts whole string to upper case using
	// the default (extended "C" locale) rules.
	// Stack: ... string => ... newString
	{Fname: ts + 3234, FnumBytes: 1, FstackEffect: -3},
	// [string replace] core: replaces a non-empty range of one string
	// with the contents of another.
	// Stack: ... string fromIdx toIdx replacement => ... newString

	{Fname: ts + 2986, FnumBytes: 1},
	// Reports which command was the origin (via namespace import chain)
	// of the command named on the top of the stack.
	// Stack:  ... cmdName => ... fullOriginalCmdName

	{Fname: ts + 20808, FnumBytes: 2, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT1}},
	// Call the next item on the TclOO call chain, passing opnd arguments
	// (min 1, max 255, *includes* "next").  The result of the invoked
	// method implementation will be pushed on the stack in place of the
	// arguments (similar to invokeStk).
	// Stack:  ... "next" arg2 arg3 -- argN => ... result
	{Fname: ts + 20818, FnumBytes: 2, FstackEffect: -0x7fffffff - 1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT1}},
	// Call the following item on the TclOO call chain defined by class
	// className, passing opnd arguments (min 2, max 255, *includes*
	// "nextto" and the class name). The result of the invoked method
	// implementation will be pushed on the stack in place of the
	// arguments (similar to invokeStk).
	// Stack:  ... "nextto" className arg3 arg4 -- argN => ... result

	{Fname: ts + 20833, FnumBytes: 1},
	// Makes the current coroutine yield the value at the top of the
	// stack, invoking the given command/args with resolution in the given
	// namespace (all packed into a list), and places the list of values
	// that are the response back on top of the stack when it resumes.
	// Stack:  ... [list ns cmd arg1 ... argN] => ... resumeList

	{Fname: ts + 2974, FnumBytes: 1},
	// Pushes the numeric type code of the word at the top of the stack.
	// Stack:  ... value => ... typeCode
	{Fname: ts + 3341, FnumBytes: 1, FstackEffect: +1},
	// Try converting stktop to boolean if possible. No errors.
	// Stack:  ... value => ... value isStrictBool
	{Fname: ts + 20847, FnumBytes: 2, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_SCLS1}},
	// See if all the characters of the given string are a member of the
	// specified (by opnd) character class. Note that an empty string will
	// satisfy the class check (standard definition of "all").
	// Stack:  ... stringValue => ... boolean

	{Fname: ts + 2720, FnumBytes: 5, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Lappend list to scalar variable at op4 in frame.
	// Stack:  ... list => ... listVarContents
	{Fname: ts + 2732, FnumBytes: 5, FstackEffect: -1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_LVT4}},
	// Lappend list to array element; array at op4.
	// Stack:  ... elem list => ... listVarContents
	{Fname: ts + 2749, FnumBytes: 1, FstackEffect: -2},
	// Lappend list to array element.
	// Stack:  ... arrayName elem list => ... listVarContents
	{Fname: ts + 2769, FnumBytes: 1, FstackEffect: -1},
	// Lappend list to general variable.
	// Stack:  ... varName list => ... listVarContents

	{Fname: ts + 2219, FnumBytes: 2, FstackEffect: +1, FnumOperands: 1, FopTypes: [2]InstOperandType{0: OPERAND_UINT1}},
	// Read clock out to the stack. Operand is which clock to read
	// 0=clicks, 1=microseconds, 2=milliseconds, 3=seconds.
	// Stack: ... => ... time

	{}} /* tclCompile.c:45:23 */

// The structure below defines the bytecode Tcl object type by means of
// procedures that can be invoked by generic object code.

var XtclByteCodeType = Tcl_ObjType{
	Fname:           ts + 20856,
	FfreeIntRepProc: 0, // freeIntRepProc
	FdupIntRepProc:  0, // updateStringProc
	FsetFromAnyProc: 0, // setFromAnyProc
} /* tclCompile.c:706:19 */

// The structure below defines a bytecode Tcl object type to hold the
// compiled bytecode for the [subst]itution of Tcl values.

var substCodeType = Tcl_ObjType{
	Fname:           ts + 20865,
	FfreeIntRepProc: 0, // freeIntRepProc
	FdupIntRepProc:  0, // setFromAnyProc
} /* tclCompile.c:719:26 */

// Helper macros.

//----------------------------------------------------------------------
//
// TclSetByteCodeFromAny --
//
//	Part of the bytecode Tcl object type implementation. Attempts to
//	generate an byte code internal form for the Tcl object "objPtr" by
//	compiling its string representation. This function also takes a hook
//	procedure that will be invoked to perform any needed post processing
//	on the compilation results before generating byte codes. interp is
//	compilation context and may not be NULL.
//
// Results:
//	The return value is a standard Tcl object result. If an error occurs
//	during compilation, an error message is left in the interpreter's
//	result.
//
// Side effects:
//	Frees the old internal representation. If no error occurs, then the
//	compiled code is stored as "objPtr"s bytecode representation. Also, if
//	debugging, initializes the "tcl_traceCompile" Tcl variable used to
//	trace compilations.
//
//----------------------------------------------------------------------

func XTclSetByteCodeFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr, hookProc uintptr, clientData ClientData) int32 { /* tclCompile.c:761:1: */
	bp := tls.Alloc(3592)
	defer tls.Free(3592)

	var iPtr uintptr = interp
	// var compEnv CompileEnv at bp+8, 3584
	// Compilation environment structure allocated
	// in frame.
	// var length int32 at bp, 4

	var result int32 = TCL_OK
	var stringPtr uintptr
	var procPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FcompiledProcPtr
	var clLocPtr uintptr

	stringPtr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp)
	}()

	// TIP #280: Pick up the CmdFrame in which the BC compiler was invoked and
	// use to initialize the tracking in the compiler. This information was
	// stored by TclCompEvalObj and ProcCompileProc.

	XTclInitCompileEnv(tls, interp, bp+8, stringPtr, *(*int32)(unsafe.Pointer(bp /* length */)),
		(*Interp)(unsafe.Pointer(iPtr)).FinvokeCmdFramePtr, (*Interp)(unsafe.Pointer(iPtr)).FinvokeWord)

	// Now we check if we have data about invisible continuation lines for the
	// script, and make it available to the compile environment, if so.
	//
	// It is not clear if the script Tcl_Obj* can be free'd while the compiler
	// is using it, leading to the release of the associated ContLineLoc
	// structure as well. To ensure that the latter doesn't happen we set a
	// lock on it. We release this lock in the function TclFreeCompileEnv(),
	// found in this file. The "lineCLPtr" hashtable is managed in the file
	// "tclObj.c".

	clLocPtr = XTclContinuationsGet(tls, objPtr)
	if clLocPtr != 0 {
		(*CompileEnv)(unsafe.Pointer(bp + 8 /* &compEnv */)).FclNext = clLocPtr + 4
	}

	XTclCompileScript(tls, interp, stringPtr, *(*int32)(unsafe.Pointer(bp /* length */)), bp+8)

	// Successful compilation. Add a "done" instruction at the end.

	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext == (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeEnd {
			XTclExpandCodeArray(tls, bp+8)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(INST_DONE)
		if (*CompileEnv)(unsafe.Pointer(bp+8)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(bp + 8)).FatCmdStart = func() int32 {
				if INST_DONE == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_DONE].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(bp+8)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(bp+8)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(bp + 8)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(bp + 8)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(bp + 8 + 48)) += _delta
				}
			}
		}
	}

	// Check for optimizations!
	//
	// Test if the generated code is free of most hazards; if so, recompile
	// but with generation of INST_START_CMD disabled. This produces somewhat
	// faster code in some cases, and more compact code in more.

	if XTcl_GetMaster(tls, interp) == uintptr(0) && !(XTcl_LimitTypeEnabled(tls, interp, TCL_LIMIT_COMMANDS|TCL_LIMIT_TIME) != 0) &&
		sIsCompactibleCompileEnv(tls, interp, bp+8) != 0 {
		XTclFreeCompileEnv(tls, bp+8)
		(*Interp)(unsafe.Pointer(iPtr)).FcompiledProcPtr = procPtr
		XTclInitCompileEnv(tls, interp, bp+8, stringPtr, *(*int32)(unsafe.Pointer(bp /* length */)),
			(*Interp)(unsafe.Pointer(iPtr)).FinvokeCmdFramePtr, (*Interp)(unsafe.Pointer(iPtr)).FinvokeWord)
		if clLocPtr != 0 {
			(*CompileEnv)(unsafe.Pointer(bp + 8 /* &compEnv */)).FclNext = clLocPtr + 4
		}
		(*CompileEnv)(unsafe.Pointer(bp + 8 /* &compEnv */)).FatCmdStart = 2 // The disabling magic.
		XTclCompileScript(tls, interp, stringPtr, *(*int32)(unsafe.Pointer(bp /* length */)), bp+8)

		for ok3 := true; ok3; ok3 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext == (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeEnd {
				XTclExpandCodeArray(tls, bp+8)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(INST_DONE)
			if (*CompileEnv)(unsafe.Pointer(bp+8)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(bp + 8)).FatCmdStart = func() int32 {
					if INST_DONE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DONE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(bp+8)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(bp+8)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(bp + 8)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(bp + 8)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(bp + 8 + 48)) += _delta
					}
				}
			}
		}

	}

	// Apply some peephole optimizations that can cross specific/generic
	// instruction generator boundaries.

	if *(*uintptr)(unsafe.Pointer(iPtr + 64)) != 0 {
		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(iPtr + 64 /* &.extra */))})).f(tls, bp+8 /* &compEnv */)
	}

	// Invoke the compilation hook procedure if one exists.

	if hookProc != 0 {
		result = (*struct {
			f func(*libc.TLS, uintptr, uintptr, ClientData) int32
		})(unsafe.Pointer(&struct{ uintptr }{hookProc})).f(tls, interp, bp+8 /* &compEnv */, clientData)
	}

	// Change the object into a ByteCode object. Ownership of the literal
	// objects and aux data items is given to the ByteCode object.

	if result == TCL_OK {
		XTclInitByteCodeObj(tls, objPtr, bp+8)
	}

	XTclFreeCompileEnv(tls, bp+8)
	return result
}

//-----------------------------------------------------------------------
//
// SetByteCodeFromAny --
//
//	Part of the bytecode Tcl object type implementation. Attempts to
//	generate an byte code internal form for the Tcl object "objPtr" by
//	compiling its string representation.
//
// Results:
//	The return value is a standard Tcl object result. If an error occurs
//	during compilation, an error message is left in the interpreter's
//	result unless "interp" is NULL.
//
// Side effects:
//	Frees the old internal representation. If no error occurs, then the
//	compiled code is stored as "objPtr"s bytecode representation. Also, if
//	debugging, initializes the "tcl_traceCompile" Tcl variable used to
//	trace compilations.
//
//----------------------------------------------------------------------

func sSetByteCodeFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclCompile.c:911:1: */
	if interp == uintptr(0) {
		return TCL_ERROR
	}
	return XTclSetByteCodeFromAny(tls, interp, objPtr, uintptr(0), uintptr(0))
}

//----------------------------------------------------------------------
//
// DupByteCodeInternalRep --
//
//	Part of the bytecode Tcl object type implementation. However, it does
//	not copy the internal representation of a bytecode Tcl_Obj, but
//	instead leaves the new object untyped (with a NULL type pointer).
//	Code will be compiled for the new object only if necessary.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sDupByteCodeInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclCompile.c:942:1: */
	return
}

//----------------------------------------------------------------------
//
// FreeByteCodeInternalRep --
//
//	Part of the bytecode Tcl object type implementation. Frees the storage
//	associated with a bytecode object's internal representation unless its
//	code is actively being executed.
//
// Results:
//	None.
//
// Side effects:
//	The bytecode object's internal rep is marked invalid and its code gets
//	freed unless the code is actively being executed. In that case the
//	cleanup is delayed until the last execution of the code completes.
//
//----------------------------------------------------------------------

func sFreeByteCodeInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclCompile.c:970:1: */
	var codePtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	if libc.PostDecInt32(&(*ByteCode)(unsafe.Pointer(codePtr)).FrefCount, 1) <= 1 {
		XTclCleanupByteCode(tls, codePtr)
	}
}

//----------------------------------------------------------------------
//
// TclCleanupByteCode --
//
//	This procedure does all the real work of freeing up a bytecode
//	object's ByteCode structure. It's called only when the structure's
//	reference count becomes zero.
//
// Results:
//	None.
//
// Side effects:
//	Frees objPtr's bytecode internal representation and sets its type NULL
//	Also releases its literals and frees its auxiliary data items.
//
//----------------------------------------------------------------------

func XTclCleanupByteCode(tls *libc.TLS, codePtr uintptr) { /* tclCompile.c:1001:1: */
	var interp uintptr = *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle))
	var iPtr uintptr = interp
	var numLitObjects int32 = (*ByteCode)(unsafe.Pointer(codePtr)).FnumLitObjects
	var numAuxDataItems int32 = (*ByteCode)(unsafe.Pointer(codePtr)).FnumAuxDataItems
	var objArrayPtr uintptr
	var objPtr uintptr
	var auxDataPtr uintptr
	var i int32

	// A single heap object holds the ByteCode structure and its code, object,
	// command location, and auxiliary data arrays. This means we only need to
	// 1) decrement the ref counts of the LiteralEntry's in its literal array,
	// 2) call the free procs for the auxiliary data items, 3) free the
	// localCache if it is unused, and finally 4) free the ByteCode
	// structure's heap object.
	//
	// The case for TCL_BYTECODE_PRECOMPILED (precompiled ByteCodes, like
	// those generated from tbcload) is special, as they doesn't make use of
	// the global literal table. They instead maintain private references to
	// their literals which must be decremented.
	//
	// In order to insure a proper and efficient cleanup of the literal array
	// when it contains non-shared literals [Bug 983660], we also distinguish
	// the case of an interpreter being deleted (signaled by interp == NULL).
	// Also, as the interp deletion will remove the global literal table
	// anyway, we avoid the extra cost of updating it for each literal being
	// released.

	if (*ByteCode)(unsafe.Pointer(codePtr)).Fflags&uint32(TCL_BYTECODE_PRECOMPILED) != 0 {

		objArrayPtr = (*ByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr
		for i = 0; i < numLitObjects; i++ {
			objPtr = *(*uintptr)(unsafe.Pointer(objArrayPtr))
			if objPtr != 0 {
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = objPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
			objArrayPtr += 8
		}
		(*ByteCode)(unsafe.Pointer(codePtr)).FnumLitObjects = 0
	} else {
		objArrayPtr = (*ByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr
		for libc.PostDecInt32(&numLitObjects, 1) != 0 {
			// TclReleaseLiteral calls Tcl_DecrRefCount() for us
			XTclReleaseLiteral(tls, interp, *(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&objArrayPtr, 8))))
		}
	}

	auxDataPtr = (*ByteCode)(unsafe.Pointer(codePtr)).FauxDataArrayPtr
	for i = 0; i < numAuxDataItems; i++ {
		if (*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxDataPtr)).Ftype)).FfreeProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxDataPtr)).Ftype)).FfreeProc})).f(tls, (*AuxData)(unsafe.Pointer(auxDataPtr)).FclientData)
		}
		auxDataPtr += 16
	}

	// TIP #280. Release the location data associated with this byte code
	// structure, if any. NOTE: The interp we belong to may be gone already,
	// and the data with it.
	//
	// See also tclBasic.c, DeleteInterpProc

	if iPtr != 0 {
		var hePtr uintptr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr, codePtr)

		if hePtr != 0 {
			sReleaseCmdWordData(tls, (*Tcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData)
			XTcl_DeleteHashEntry(tls, hePtr)
		}
	}

	if (*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr != 0 && libc.PreDecInt32(&(*LocalCache)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr)).FrefCount, 1) == 0 {
		XTclFreeLocalCache(tls, interp, (*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr)
	}

	XTclHandleRelease(tls, (*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)
	XTclpFree(tls, codePtr)
}

// ---------------------------------------------------------------------
//
// IsCompactibleCompileEnv --
//
//	Checks to see if we may apply some basic compaction optimizations to a
//	piece of bytecode. Idempotent.
//
// ---------------------------------------------------------------------

func sIsCompactibleCompileEnv(tls *libc.TLS, interp uintptr, envPtr uintptr) int32 { /* tclCompile.c:1135:1: */
	var pc uintptr
	var size int32

	// Special: procedures in the '::tcl' namespace (or its children) are
	// considered to be well-behaved and so can have compaction applied even
	// if it would otherwise be invalid.

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr != uintptr(0) && (*Proc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr)).FcmdPtr != uintptr(0) &&
		(*Command1)(unsafe.Pointer((*Proc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr)).FcmdPtr)).FnsPtr != uintptr(0) {
		var nsPtr uintptr = (*Command1)(unsafe.Pointer((*Proc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr)).FcmdPtr)).FnsPtr

		if libc.Xstrcmp(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FfullName, ts+20875) == 0 ||
			libc.Xstrncmp(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FfullName, ts+20881, uint64(7)) == 0 {
			return 1
		}
	}

	// Go through and ensure that no operation involved can cause a desired
	// change of bytecode sequence during running. This comes down to ensuring
	// that there are no mapped variables (due to traces) or calls to external
	// commands (traces, [uplevel] trickery). This is actually a very
	// conservative check; it turns down a lot of code that is OK in practice.

	for pc = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart; pc < (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext; pc += uintptr(size) {
		switch int32(*(*uint8)(unsafe.Pointer(pc))) {
		// Invokes
		case INST_INVOKE_STK1:
			fallthrough
		case INST_INVOKE_STK4:
			fallthrough
		case INST_INVOKE_EXPANDED:
			fallthrough
		case INST_INVOKE_REPLACE:
			return 0
			// Runtime evals
		case INST_EVAL_STK:
			fallthrough
		case INST_EXPR_STK:
			fallthrough
		case INST_YIELD:
			return 0
			// Upvars
		case INST_UPVAR:
			fallthrough
		case INST_NSUPVAR:
			fallthrough
		case INST_VARIABLE:
			return 0
		default:
			size = XtclInstructionTable[*(*uint8)(unsafe.Pointer(pc))].FnumBytes

			break
		}
	}

	return 1
}

//----------------------------------------------------------------------
//
// Tcl_SubstObj --
//
//	This function performs the substitutions specified on the given string
//	as described in the user documentation for the "subst" Tcl command.
//
// Results:
//	A Tcl_Obj* containing the substituted string, or NULL to indicate that
//	an error occurred.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_SubstObj(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32) uintptr { /* tclCompile.c:1212:9: */
	var rootPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr

	if XTclNRRunCallbacks(tls, interp, XTcl_NRSubstObj(tls, interp, objPtr, flags),
		rootPtr) != TCL_OK {
		return uintptr(0)
	}
	return XTcl_GetObjResult(tls, interp)
}

//----------------------------------------------------------------------
//
// Tcl_NRSubstObj --
//
//	Request substitution of a Tcl value by the NR stack.
//
// Results:
//	Returns TCL_OK.
//
// Side effects:
//	Compiles objPtr into bytecode that performs the substitutions as
//	governed by flags and places callbacks on the NR stack to execute
//	the bytecode and store the result in the interp.
//
//----------------------------------------------------------------------

func XTcl_NRSubstObj(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32) int32 { /* tclCompile.c:1246:1: */
	var codePtr uintptr = sCompileSubstObj(tls, interp, objPtr, flags)

	// TODO: Confirm we do not need this.
	// Tcl_ResetResult(interp);
	return XTclNRExecuteByteCode(tls, interp, codePtr)
}

//----------------------------------------------------------------------
//
// CompileSubstObj --
//
//	Compile a Tcl value into ByteCode implementing its substitution, as
//	governed by flags.
//
// Results:
//	A (ByteCode *) is returned pointing to the resulting ByteCode.
//	The caller must manage its refCount and arrange for a call to
//	TclCleanupByteCode() when the last reference disappears.
//
// Side effects:
//	The Tcl_ObjType of objPtr is changed to the "substcode" type, and the
//	ByteCode and governing flags value are kept in the internal rep for
//	faster operations the next time CompileSubstObj is called on the same
//	value.
//
//----------------------------------------------------------------------

func sCompileSubstObj(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32) uintptr { /* tclCompile.c:1280:17: */
	bp := tls.Alloc(3592)
	defer tls.Free(3592)

	var iPtr uintptr = interp
	var codePtr uintptr = uintptr(0)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&substCodeType)) {
		var nsPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr

		codePtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		if flags != int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) ||
			*(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) != iPtr ||
			(*ByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch != (*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch ||
			(*ByteCode)(unsafe.Pointer(codePtr)).FnsPtr != nsPtr ||
			(*ByteCode)(unsafe.Pointer(codePtr)).FnsEpoch != (*Namespace)(unsafe.Pointer(nsPtr)).FresolverEpoch ||
			(*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr != (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr {
			sFreeSubstCodeInternalRep(tls, objPtr)
		}
	}
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&substCodeType)) {
		// var compEnv CompileEnv at bp+8, 3584

		// var numBytes int32 at bp, 4

		var bytes uintptr = XTcl_GetStringFromObj(tls, objPtr, bp)

		// TODO: Check for more TIP 280
		XTclInitCompileEnv(tls, interp, bp+8, bytes, *(*int32)(unsafe.Pointer(bp /* numBytes */)), uintptr(0), 0)

		XTclSubstCompile(tls, interp, bytes, *(*int32)(unsafe.Pointer(bp /* numBytes */)), flags, 1, bp+8)

		for ok := true; ok; ok = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext == (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeEnd {
				XTclExpandCodeArray(tls, bp+8)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(INST_DONE)
			if (*CompileEnv)(unsafe.Pointer(bp+8)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(bp + 8)).FatCmdStart = func() int32 {
					if INST_DONE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DONE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(bp+8)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(bp+8)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(bp + 8)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(bp + 8)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(bp + 8 + 48)) += _delta
					}
				}
			}
		}
		XTclInitByteCodeObj(tls, objPtr, bp+8)
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&substCodeType))
		XTclFreeCompileEnv(tls, bp+8)

		codePtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = codePtr
		*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr(Intptr_t(flags))
		if (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr != 0 {
			(*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr
			(*LocalCache)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr)).FrefCount++
		}
	}
	return codePtr
}

//----------------------------------------------------------------------
//
// FreeSubstCodeInternalRep --
//
//	Part of the substcode Tcl object type implementation. Frees the
//	storage associated with a substcode object's internal representation
//	unless its code is actively being executed.
//
// Results:
//	None.
//
// Side effects:
//	The substcode object's internal rep is marked invalid and its code
//	gets freed unless the code is actively being executed. In that case
//	the cleanup is delayed until the last execution of the code completes.
//
//----------------------------------------------------------------------

func sFreeSubstCodeInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclCompile.c:1356:1: */
	var codePtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	if libc.PostDecInt32(&(*ByteCode)(unsafe.Pointer(codePtr)).FrefCount, 1) <= 1 {
		XTclCleanupByteCode(tls, codePtr)
	}
}

func sReleaseCmdWordData(tls *libc.TLS, eclPtr uintptr) { /* tclCompile.c:1368:1: */
	var i int32

	if (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Ftype == 4 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fpath
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	for i = 0; i < (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc; i++ {
		XTclpFree(tls, (*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc+uintptr(i)*24)).Fline)
	}

	if (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc != uintptr(0) {
		XTclpFree(tls, (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc)
	}

	XTclpFree(tls, eclPtr)
}

//----------------------------------------------------------------------
//
// TclInitCompileEnv --
//
//	Initializes a CompileEnv compilation environment structure for the
//	compilation of a string in an interpreter.
//
// Results:
//	None.
//
// Side effects:
//	The CompileEnv structure is initialized.
//
//----------------------------------------------------------------------

func XTclInitCompileEnv(tls *libc.TLS, interp uintptr, envPtr uintptr, stringPtr uintptr, numBytes int32, invoker uintptr, word int32) { /* tclCompile.c:1405:1: */
	var iPtr uintptr = interp

	(*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr = iPtr
	(*CompileEnv)(unsafe.Pointer(envPtr)).Fsource = stringPtr
	(*CompileEnv)(unsafe.Pointer(envPtr)).FnumSrcBytes = numBytes
	(*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr = (*Interp)(unsafe.Pointer(iPtr)).FcompiledProcPtr
	(*Interp)(unsafe.Pointer(iPtr)).FcompiledProcPtr = uintptr(0)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands = 0
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth = 0
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = 0
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = 0
	(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = 0
	XTclInitLiteralTable(tls, envPtr+56)

	(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart = envPtr + 236 /* &.staticCodeSpace */
	(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart
	(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(COMPILEENV_INIT_CODE_BYTES)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedCodeArray = 0

	(*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr = envPtr + 488 /* &.staticLiteralSpace */
	(*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext = 0
	(*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayEnd = COMPILEENV_INIT_NUM_OBJECTS
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedLiteralArray = 0

	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr = envPtr + 2408    /* &.staticExceptArraySpace */
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr = envPtr + 2552 /* &.staticExAuxArraySpace */
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext = 0
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayEnd = COMPILEENV_INIT_EXCEPT_RANGES
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedExceptArray = 0

	(*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr = envPtr + 2832 /* &.staticCmdMapSpace */
	(*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapEnd = COMPILEENV_INIT_CMD_MAP_SIZE
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedCmdMap = 0
	(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = 1
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexpandCount = 0

	// TIP #280: Set up the extended command location information, based on
	// the context invoking the byte code compiler. This structure is used to
	// keep the per-word line information for all compiled commands.
	//
	// See also tclBasic.c, TclEvalObjEx, for the equivalent code in the
	// non-compiling evaluator

	(*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ExtCmdLoc{})))
	(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Floc = uintptr(0)
	(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fnloc = 0
	(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fnuloc = 0
	(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = uintptr(0)

	if invoker == uintptr(0) {
		// Initialize the compiler for relative counting in case of a
		// dynamic context.

		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = 1
		if (*Interp)(unsafe.Pointer(iPtr)).FevalFlags&TCL_EVAL_FILE != 0 {
			*(*int32)(unsafe.Pointer(iPtr + 324)) &= libc.CplInt32(TCL_EVAL_FILE)
			(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Ftype = 4

			if (*Interp)(unsafe.Pointer(iPtr)).FscriptFile != 0 {
				// Normalization here, to have the correct pwd. Should have
				// negligible impact on performance, as the norm should have
				// been done already by the 'source' invoking us, and it
				// caches the result.

				var norm uintptr = XTcl_FSGetNormalizedPath(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FscriptFile)

				if norm == uintptr(0) {
					// Error message in the interp result. No place to put it.
					// And no place to serve the error itself to either. Fake
					// a path, empty string.

					for ok := true; ok; ok = 0 != 0 {
						for ok1 := true; ok1; ok1 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = XTclThreadAllocObj(tls)
							} else {
								(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes, ts+2046, uint64(int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Flength = int32(uint64(unsafe.Sizeof([1]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FtypePtr = uintptr(0)
						{
						}
					}
				} else {
					(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = norm
				}
			} else {
				for ok2 := true; ok2; ok2 = 0 != 0 {
					for ok3 := true; ok3; ok3 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = XTclThreadAllocObj(tls)
						} else {
							(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FrefCount = 0
					if int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)) == 0 {
						(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1))+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes, ts+2046, uint64(int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1))))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes)) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Flength = int32(uint64(unsafe.Sizeof([1]int8{})) - uint64(1))
					}
					(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FtypePtr = uintptr(0)
					{
					}
				}
			}

			(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FrefCount++
		} else {
			(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Ftype = func() int32 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr != 0 {
					return 5
				}
				return 2
			}()
		}
	} else {
		// Initialize the compiler using the context, making counting absolute
		// to that context. Note that the context can be byte code execution.
		// In that case we have to fill out the missing pieces (line, path,
		// ...) which may make change the type as well.

		var ctxPtr uintptr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(CmdFrame{})))
		var pc int32 = 0

		*(*CmdFrame)(unsafe.Pointer(ctxPtr)) = *(*CmdFrame)(unsafe.Pointer(invoker))
		if (*CmdFrame)(unsafe.Pointer(invoker)).Ftype == 2 {
			// Note: Type BC => ctx.data.eval.path    is not used.
			//			ctx.data.tebc.codePtr is used instead.

			XTclGetSrcInfoForPc(tls, ctxPtr)
			pc = 1
		}

		if (*CmdFrame)(unsafe.Pointer(ctxPtr)).Fnline <= word || *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(ctxPtr)).Fline + uintptr(word)*4)) < 0 {
			// Word is not a literal, relative counting.

			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = 1
			(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Ftype = func() int32 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr != 0 {
					return 5
				}
				return 2
			}()

			if pc != 0 && (*CmdFrame)(unsafe.Pointer(ctxPtr)).Ftype == 4 {
				// The reference made by 'TclGetSrcInfoForPc' is dead.

				for ok4 := true; ok4; ok4 = 0 != 0 {
					var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(ctxPtr + 40))
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
		} else {
			(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(ctxPtr)).Fline + uintptr(word)*4))
			(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Ftype = (*CmdFrame)(unsafe.Pointer(ctxPtr)).Ftype

			if (*CmdFrame)(unsafe.Pointer(ctxPtr)).Ftype == 4 {
				(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = *(*uintptr)(unsafe.Pointer(ctxPtr + 40))

				if pc != 0 {
					// The reference 'TclGetSrcInfoForPc' made is transfered.

					*(*uintptr)(unsafe.Pointer(ctxPtr + 40)) = uintptr(0)
				} else {
					// We have a new reference here.

					(*Tcl_Obj)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FrefCount++
				}
			}
		}

		XTclStackFree(tls, interp, ctxPtr)
	}

	(*ExtCmdLoc)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fstart = (*CompileEnv)(unsafe.Pointer(envPtr)).Fline

	// Initialize the data about invisible continuation lines as empty, i.e.
	// not used. The caller (TclSetByteCodeFromAny) will set this up, if such
	// data is available.

	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = uintptr(0)

	(*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr = envPtr + 3472 /* &.staticAuxDataArraySpace */
	(*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext = 0
	(*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayEnd = COMPILEENV_INIT_AUX_DATA_SIZE
	(*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedAuxDataArray = 0
}

//----------------------------------------------------------------------
//
// TclFreeCompileEnv --
//
//	Free the storage allocated in a CompileEnv compilation environment
//	structure.
//
// Results:
//	None.
//
// Side effects:
//	Allocated storage in the CompileEnv structure is freed. Note that its
//	local literal table is not deleted and its literal objects are not
//	released. In addition, storage referenced by its auxiliary data items
//	is not freed. This is done so that, when compilation is successful,
//	"ownership" of these objects and aux data items is handed over to the
//	corresponding ByteCode structure.
//
//----------------------------------------------------------------------

func XTclFreeCompileEnv(tls *libc.TLS, envPtr uintptr) { /* tclCompile.c:1614:1: */
	if (*CompileEnv)(unsafe.Pointer(envPtr)).FlocalLitTable.Fbuckets != envPtr+56+8 {
		XTclpFree(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FlocalLitTable.Fbuckets)
		(*CompileEnv)(unsafe.Pointer(envPtr)).FlocalLitTable.Fbuckets = envPtr + 56 + 8
	}
	if (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr != 0 {
		// We never converted to Bytecode, so free the things we would
		// have transferred to it.

		var i int32
		var entryPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr
		var auxDataPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr

		for i = 0; i < (*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext; i++ {
			XTclReleaseLiteral(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr, (*LiteralEntry)(unsafe.Pointer(entryPtr)).FobjPtr)
			entryPtr += 32
		}

		for i = 0; i < (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext; i++ {
			if (*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxDataPtr)).Ftype)).FfreeProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxDataPtr)).Ftype)).FfreeProc})).f(tls, (*AuxData)(unsafe.Pointer(auxDataPtr)).FclientData)
			}
			auxDataPtr += 16
		}
	}
	if (*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedCodeArray != 0 {
		XTclpFree(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)
	}
	if (*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedLiteralArray != 0 {
		XTclpFree(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr)
	}
	if (*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedExceptArray != 0 {
		XTclpFree(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr)
		XTclpFree(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr)
	}
	if (*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedCmdMap != 0 {
		XTclpFree(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr)
	}
	if (*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedAuxDataArray != 0 {
		XTclpFree(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr)
	}
	if (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr != 0 {
		sReleaseCmdWordData(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)
		(*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr = uintptr(0)
	}
}

//----------------------------------------------------------------------
//
// TclWordKnownAtCompileTime --
//
//	Test whether the value of a token is completely known at compile time.
//
// Results:
//	Returns true if the tokenPtr argument points to a word value that is
//	completely known at compile time. Generally, values that are known at
//	compile time can be compiled to their values, while values that cannot
//	be known until substitution at runtime must be compiled to bytecode
//	instructions that perform that substitution. For several commands,
//	whether or not arguments are known at compile time determine whether
//	it is worthwhile to compile at all.
//
// Side effects:
//	When returning true, appends the known value of the word to the
//	unshared Tcl_Obj (*valuePtr), unless valuePtr is NULL.
//
//----------------------------------------------------------------------

func XTclWordKnownAtCompileTime(tls *libc.TLS, tokenPtr uintptr, valuePtr uintptr) int32 { /* tclCompile.c:1693:1: */
	bp := tls.Alloc(3)
	defer tls.Free(3)

	var numComponents int32 = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents
	var tempPtr uintptr = uintptr(0)

	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		if valuePtr != uintptr(0) {
			XTcl_AppendToObj(tls, valuePtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize)
		}
		return 1
	}
	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_WORD {
		return 0
	}
	tokenPtr += 24
	if valuePtr != uintptr(0) {
		tempPtr = XTcl_NewObj(tls)
		(*Tcl_Obj)(unsafe.Pointer(tempPtr)).FrefCount++
	}
	for libc.PostDecInt32(&numComponents, 1) != 0 {
		switch (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype {
		case TCL_TOKEN_TEXT:
			if tempPtr != uintptr(0) {
				XTcl_AppendToObj(tls, tempPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize)
			}
			break

		case TCL_TOKEN_BS:
			if tempPtr != uintptr(0) {
				*(*[3]int8)(unsafe.Pointer(bp /* utfBuf */)) = *(*[3]int8)(unsafe.Pointer(ts + 18812))
				var length int32 = XTclParseBackslash(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart,
					(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, uintptr(0), bp)

				XTcl_AppendToObj(tls, tempPtr, bp, length)
			}
			break

		default:
			if tempPtr != uintptr(0) {
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = tempPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
			return 0
		}
		tokenPtr += 24
	}
	if valuePtr != uintptr(0) {
		XTcl_AppendObjToObj(tls, valuePtr, tempPtr)
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = tempPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return 1
}

//----------------------------------------------------------------------
//
// TclCompileScript --
//
//	Compile a Tcl script in a string.
//
// Results:
//	The return value is TCL_OK on a successful compilation and TCL_ERROR
//	on failure. If TCL_ERROR is returned, then the interpreter's result
//	contains an error message.
//
// Side effects:
//	Adds instructions to envPtr to evaluate the script at runtime.
//
//----------------------------------------------------------------------

func sExpandRequested(tls *libc.TLS, tokenPtr uintptr, numWords int32) int32 { /* tclCompile.c:1768:1: */
	// Determine whether any words of the command require expansion
	for libc.PostDecInt32(&numWords, 1) != 0 {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_EXPAND_WORD {
			return 1
		}
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}
	return 0
}

func sCompileCmdLiteral(tls *libc.TLS, interp uintptr, cmdObj uintptr, envPtr uintptr) { /* tclCompile.c:1783:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var numBytes int32 at bp, 4

	var bytes uintptr
	var cmdPtr uintptr
	var cmdLitIdx int32
	var extraLiteralFlags int32 = LITERAL_CMD_NAME

	cmdPtr = XTcl_GetCommandFromObj(tls, interp, cmdObj)
	if cmdPtr != uintptr(0) && (*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_VIA_RESOLVER != 0 {
		extraLiteralFlags = extraLiteralFlags | LITERAL_UNSHARED
	}

	bytes = XTcl_GetStringFromObj(tls, cmdObj, bp)
	cmdLitIdx = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp /* numBytes */)), extraLiteralFlags)

	if cmdPtr != 0 {
		XTclSetCmdNameObj(tls, interp, XTclFetchLiteral(tls, envPtr, uint32(cmdLitIdx)), cmdPtr)
	}
	for ok := true; ok; ok = 0 != 0 {
		var _objIndexCopy int32 = cmdLitIdx
		if _objIndexCopy <= 255 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok3 := true; ok3; ok3 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok4 := true; ok4; ok4 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok6 := true; ok6; ok6 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
}

func XTclCompileInvocation(tls *libc.TLS, interp uintptr, tokenPtr uintptr, cmdObj uintptr, numWords int32, envPtr uintptr) { /* tclCompile.c:1808:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	var wordIdx int32 = 0
	var depth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth

	if cmdObj != 0 {
		sCompileCmdLiteral(tls, interp, cmdObj, envPtr)
		wordIdx = 1
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}

__1:
	if !(wordIdx < numWords) {
		goto __3
	}
	{
		var objIdx int32

		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(wordIdx)*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(wordIdx)*8))

		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)

			goto __2
		}

		objIdx = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize /*flags*/, 0)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FclNext != 0 {
			XTclContinuationsEnterDerived(tls, XTclFetchLiteral(tls, envPtr, uint32(objIdx)),
				int32((int64((*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1), (*CompileEnv)(unsafe.Pointer(envPtr)).FclNext)
		}
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = objIdx
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}

	}
	goto __2
__2:
	wordIdx++
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	goto __1
	goto __3
__3:
	;

	if wordIdx <= 255 {
		XTclEmitInvoke(tls, envPtr, INST_INVOKE_STK1, libc.VaList(bp, wordIdx))
	} else {
		XTclEmitInvoke(tls, envPtr, INST_INVOKE_STK4, libc.VaList(bp+8, wordIdx))
	}
	for ok7 := true; ok7; ok7 = 0 != 0 {
		var _dd int32 = depth + 1
		if _dd != (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
			XTcl_Panic(tls, ts+18410, libc.VaList(bp+16, (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth, _dd))
		}
	}
}

func sCompileExpanded(tls *libc.TLS, interp uintptr, tokenPtr uintptr, cmdObj uintptr, numWords int32, envPtr uintptr) { /* tclCompile.c:1852:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	var wordIdx int32 = 0
	var depth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth

	sStartExpanding(tls, envPtr)
	if cmdObj != 0 {
		sCompileCmdLiteral(tls, interp, cmdObj, envPtr)
		wordIdx = 1
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	}

__1:
	if !(wordIdx < numWords) {
		goto __3
	}
	{
		var objIdx int32

		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(wordIdx)*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(wordIdx)*8))

		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)

			if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_EXPAND_WORD {
				for ok := true; ok; ok = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EXPAND_STKTOP)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32((*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_EXPAND_STKTOP == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_EXPAND_STKTOP].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
							for ok2 := true; ok2; ok2 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
			goto __2
		}

		objIdx = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize /*flags*/, 0)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FclNext != 0 {
			XTclContinuationsEnterDerived(tls, XTclFetchLiteral(tls, envPtr, uint32(objIdx)),
				int32((int64((*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1), (*CompileEnv)(unsafe.Pointer(envPtr)).FclNext)
		}
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objIndexCopy int32 = objIdx
			if _objIndexCopy <= 255 {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok7 := true; ok7; ok7 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok8 := true; ok8; ok8 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok9 := true; ok9; ok9 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}

	}
	goto __2
__2:
	wordIdx++
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	goto __1
	goto __3
__3:
	;

	// The stack depth during argument expansion can only be managed at
	// runtime, as the number of elements in the expanded lists is not known
	// at compile time. We adjust here the stack depth estimate so that it is
	// correct after the command with expanded arguments returns.
	//
	// The end effect of this command's invocation is that all the words of
	// the command are popped from the stack, and the result is pushed: the
	// stack top changes by (1-wordIdx).
	//
	// Note that the estimates are not correct while the command is being
	// prepared and run, INST_EXPAND_STKTOP is not stack-neutral in general.

	XTclEmitInvoke(tls, envPtr, INST_INVOKE_EXPANDED, libc.VaList(bp, wordIdx))
	for ok10 := true; ok10; ok10 = 0 != 0 {
		var _dd int32 = depth + 1
		if _dd != (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
			XTcl_Panic(tls, ts+18410, libc.VaList(bp+8, (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth, _dd))
		}
	}
}

func sCompileCmdCompileProc(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompile.c:1912:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	var unwind int32 = 0
	var incrOffset int32 = -1
	var depth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth

	// Emit of the INST_START_CMD instruction is controlled by the value of
	// envPtr->atCmdStart:
	//
	// atCmdStart == 2	: We are not using the INST_START_CMD instruction.
	// atCmdStart == 1	: INST_START_CMD was the last instruction emitted.
	//			: We do not need to emit another.  Instead we
	//			: increment the number of cmds started at it (except
	//			: for the special case at the start of a script.)
	// atCmdStart == 0	: The last instruction was something else.  We need
	//			: to emit INST_START_CMD here.

	switch (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart {
	case 0:
		unwind = XtclInstructionTable[INST_START_CMD].FnumBytes
		for ok := true; ok; ok = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_START_CMD)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_START_CMD == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_START_CMD].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		incrOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
		for ok3 := true; ok3; ok3 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		}
		break
	case 1:
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart {
			incrOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext-uintptr(4)) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
		}
		break
	case 2:
		// Nothing to do

	}

	if TCL_OK == XTclAttemptCompileProc(tls, interp, parsePtr, 1, cmdPtr, envPtr) {
		if incrOffset >= 0 {
			// We successfully compiled a command.  Increment the number of
			// commands that start at the currently active INST_START_CMD.

			var incrPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(incrOffset)
			var startPtr uintptr = incrPtr - uintptr(5)

			for ok4 := true; ok4; ok4 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(incrPtr)) = uint8((uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr)))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(3)))) + uint32(1)) >> 24)
				*(*uint8)(unsafe.Pointer(incrPtr + uintptr(1))) = uint8((uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr)))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(3)))) + uint32(1)) >> 16)
				*(*uint8)(unsafe.Pointer(incrPtr + uintptr(2))) = uint8((uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr)))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(3)))) + uint32(1)) >> 8)
				*(*uint8)(unsafe.Pointer(incrPtr + uintptr(3))) = uint8(uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr)))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(incrPtr + uintptr(3)))) + uint32(1))
			}

			if unwind != 0 {
				// We started the INST_START_CMD.  Record the code length.
				for ok5 := true; ok5; ok5 = 0 != 0 {
					*(*uint8)(unsafe.Pointer(startPtr + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64(startPtr))/1) >> 24)
					*(*uint8)(unsafe.Pointer(startPtr + uintptr(1) + uintptr(1))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64(startPtr))/1) >> 16)
					*(*uint8)(unsafe.Pointer(startPtr + uintptr(1) + uintptr(2))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64(startPtr))/1) >> 8)
					*(*uint8)(unsafe.Pointer(startPtr + uintptr(1) + uintptr(3))) = uint8(uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64(startPtr)) / 1))
				}
			}
		}
		for ok6 := true; ok6; ok6 = 0 != 0 {
			var _dd int32 = depth + 1
			if _dd != (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
				XTcl_Panic(tls, ts+18410, libc.VaList(bp, (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth, _dd))
			}
		}
		return TCL_OK
	}

	*(*uintptr)(unsafe.Pointer(envPtr + 120)) -= uintptr(unwind) // Unwind INST_START_CMD

	// Throw out any line information generated by the failed compile attempt.

	for (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc-1 > eclIndex {
		(*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc--
		XTclpFree(tls, (*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc)*24)).Fline)
		(*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc)*24)).Fline = uintptr(0)
	}

	// Reset the index of next command.  Toss out any from failed nested
	// partial compiles.

	(*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc
	return TCL_ERROR
}

func sCompileCommandTokens(tls *libc.TLS, interp uintptr, parsePtr uintptr, envPtr uintptr) int32 { /* tclCompile.c:1994:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var iPtr uintptr = interp
	var tokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	var eclPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var cmdObj uintptr = XTcl_NewObj(tls)
	var cmdPtr uintptr = uintptr(0)
	var code int32 = TCL_ERROR
	var cmdKnown int32
	var expand int32 = -1
	// var wlines uintptr at bp+16, 8

	var wlineat int32
	var cmdLine int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).Fline
	var clNext uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FclNext
	var cmdIdx int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands
	var startCodeOffset int32 = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	var depth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth

	// Pre-Compile

	(*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands++
	sEnterCmdStartData(tls, envPtr, cmdIdx,
		int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1), startCodeOffset)

	// TIP #280. Scan the words and compute the extended location information.
	// The map first contain full per-word line information for use by the
	// compiler. This is later replaced by a reduced form which signals
	// non-literal words, stored in 'wlines'.

	sEnterCmdWordData(tls, eclPtr, int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1),
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart,
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords, cmdLine,
		clNext, bp+16, envPtr)
	wlineat = (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc - 1

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(wlineat)*24)).Fline))
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(wlineat)*24)).Fnext))

	// Do we know the command word?
	(*Tcl_Obj)(unsafe.Pointer(cmdObj)).FrefCount++
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	cmdKnown = XTclWordKnownAtCompileTime(tls, tokenPtr, cmdObj)

	// Is this a command we should (try to) compile with a compileProc ?
	if cmdKnown != 0 && !((*Interp)(unsafe.Pointer(iPtr)).Fflags&DONT_COMPILE_CMDS_INLINE != 0) {
		cmdPtr = XTcl_GetCommandFromObj(tls, interp, cmdObj)
		if cmdPtr != 0 {
			// Found a command.  Test the ways we can be told not to attempt
			// to compile it.
			if (*Command)(unsafe.Pointer(cmdPtr)).FcompileProc == uintptr(0) ||
				(*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).Fflags&NS_SUPPRESS_COMPILATION != 0 ||
				(*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_HAS_EXEC_TRACES != 0 {
				cmdPtr = uintptr(0)
			}
		}
		if cmdPtr != 0 && !((*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_COMPILES_EXPANDED != 0) {
			expand = sExpandRequested(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)
			if expand != 0 {
				// We need to expand, but compileProc cannot.
				cmdPtr = uintptr(0)
			}
		}
	}

	// If cmdPtr != NULL, we will try to call cmdPtr->compileProc
	if cmdPtr != 0 {
		code = sCompileCmdCompileProc(tls, interp, parsePtr, cmdPtr, envPtr)
	}

	if code == TCL_ERROR {
		if expand < 0 {
			expand = sExpandRequested(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)
		}

		if expand != 0 {
			sCompileExpanded(tls, interp, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr,
				func() uintptr {
					if cmdKnown != 0 {
						return cmdObj
					}
					return uintptr(0)
				}(), (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords, envPtr)
		} else {
			XTclCompileInvocation(tls, interp, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr,
				func() uintptr {
					if cmdKnown != 0 {
						return cmdObj
					}
					return uintptr(0)
				}(), (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords, envPtr)
		}
	}

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = cmdObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	for ok1 := true; ok1; ok1 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_POP == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok3 := true; ok3; ok3 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
	sEnterCmdExtentData(tls, envPtr, cmdIdx,
		int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm)-int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart))/1),
		int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64(startCodeOffset)))

	// TIP #280: Free full form of per-word line data and insert the reduced
	// form now

	(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = cmdLine
	(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = clNext
	XTclpFree(tls, (*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc+uintptr(wlineat)*24)).Fline)
	XTclpFree(tls, (*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc+uintptr(wlineat)*24)).Fnext)
	(*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(wlineat)*24)).Fline = *(*uintptr)(unsafe.Pointer(bp + 16 /* wlines */))
	(*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(wlineat)*24)).Fnext = uintptr(0)

	for ok4 := true; ok4; ok4 = 0 != 0 {
		var _dd int32 = depth
		if _dd != (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
			XTcl_Panic(tls, ts+18410, libc.VaList(bp, (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth, _dd))
		}
	}
	return cmdIdx
}

func XTclCompileScript(tls *libc.TLS, interp uintptr, script uintptr, numBytes int32, envPtr uintptr) { /* tclCompile.c:2108:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var lastCmdIdx int32 = -1 // Index into envPtr->cmdMapPtr of the last
	// command this routine compiles into bytecode.
	// Initial value of -1 indicates this routine
	// has not yet generated any bytecode.
	var p uintptr = script // Where we are in our compile.
	var depth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
	var iPtr uintptr = interp

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr == uintptr(0) {
		XTcl_Panic(tls, ts+20889, 0)
	}
	// Check depth to avoid overflow of the C execution stack by too many
	// nested calls of TclCompileScript (considering interp recursionlimit).
	// Factor 5/4 (1.25) is used to avoid too mistaken limit recognition
	// during "mixed" evaluation and compilation process (nested eval+compile)
	// and is good enough for default recursionlimit (1000).
	if (*Interp)(unsafe.Pointer(iPtr)).FnumLevels/5 > (*Interp)(unsafe.Pointer(iPtr)).FmaxNestingDepth/4 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+20943, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7670, ts+7676, uintptr(0)))
		XTclCompileSyntaxError(tls, interp, envPtr)
		return
	}

	// Each iteration compiles one command from the script.

	if numBytes > 0 {
		// Don't use system stack (size of Tcl_Parse is ca. 400 bytes), so
		// many nested compilations (body enclosed in body) can cause abnormal
		// program termination with a stack overflow exception, bug [fec0c17d39].
		var parsePtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_Parse{})))

		for ok := true; ok; ok = numBytes > 0 {
			var next uintptr

			if TCL_OK != XTcl_ParseCommand(tls, interp, p, numBytes, 0, parsePtr) {
				// Compile bytecodes to report the parsePtr error at runtime.

				XTcl_LogCommandInfo(tls, interp, script, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart,
					int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm+uintptr(1))-int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart))/1))
				XTclCompileSyntaxError(tls, interp, envPtr)
				XTclpFree(tls, parsePtr)
				return
			}

			// TIP #280: Count newlines before the command start.
			// (See test info-30.33).

			XTclAdvanceLines(tls, envPtr+3560, p, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)
			XTclAdvanceContinuations(tls, envPtr+3560, envPtr+3576,
				int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1))

			// Advance parser to the next command in the script.

			next = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize)
			numBytes = int32(int64(numBytes) - (int64(next)-int64(p))/1)
			p = next

			if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 0 {
				// The "command" parsed has no words.  In this case we can skip
				// the rest of the loop body.  With no words, clearly
				// CompileCommandTokens() has nothing to do.  Since the parser
				// aggressively sucks up leading comment and white space,
				// including newlines, parsePtr->commandStart must be pointing at
				// either the end of script, or a command-terminating semi-colon.
				// In either case, the TclAdvance*() calls have nothing to do.
				// Finally, when no words are parsed, no tokens have been
				// allocated at parsePtr->tokenPtr so there's also nothing for
				// Tcl_FreeParse() to do.
				//
				// The advantage of this shortcut is that CompileCommandTokens()
				// can be written with an assumption that parsePtr->numWords > 0, with
				// the implication the CCT() always generates bytecode.
				continue
			}

			// Avoid stack exhaustion by too many nested calls of TclCompileScript
			// (considering interp recursionlimit).
			(*Interp)(unsafe.Pointer(iPtr)).FnumLevels++

			lastCmdIdx = sCompileCommandTokens(tls, interp, parsePtr, envPtr)

			(*Interp)(unsafe.Pointer(iPtr)).FnumLevels--

			// TIP #280: Track lines in the just compiled command.

			XTclAdvanceLines(tls, envPtr+3560, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, p)
			XTclAdvanceContinuations(tls, envPtr+3560, envPtr+3576,
				int32((int64(p)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1))
			XTcl_FreeParse(tls, parsePtr)
		}

		XTclpFree(tls, parsePtr)
	}

	if lastCmdIdx == -1 {
		// Compiling the script yielded no bytecode.  The script must be all
		// whitespace, comments, and empty commands.  Such scripts are defined
		// to successfully produce the empty string result, so we emit the
		// simple bytecode that makes that happen.

		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok3 := true; ok3; ok3 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok4 := true; ok4; ok4 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok5 := true; ok5; ok5 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok6 := true; ok6; ok6 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok7 := true; ok7; ok7 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	} else {
		// We compiled at least one command to bytecode.  The routine
		// CompileCommandTokens() follows the bytecode of each compiled
		// command with an INST_POP, so that stack balance is maintained when
		// several commands are in sequence.  (The result of each command is
		// thrown away before moving on to the next command).  For the last
		// command compiled, we need to undo that INST_POP so that the result
		// of the last command becomes the result of the script.  The code
		// here removes that trailing INST_POP.

		(*CmdLocation)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr+uintptr(lastCmdIdx)*16)).FnumCodeBytes--
		(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext--
		(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth++
	}
	for ok8 := true; ok8; ok8 = 0 != 0 {
		var _dd int32 = depth + 1
		if _dd != (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
			XTcl_Panic(tls, ts+18410, libc.VaList(bp+32, (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth, _dd))
		}
	}
}

//----------------------------------------------------------------------
//
// TclCompileTokens --
//
//	Given an array of tokens parsed from a Tcl command (e.g., the tokens
//	that make up a word) this procedure emits instructions to evaluate the
//	tokens and concatenate their values to form a single result value on
//	the interpreter's runtime evaluation stack.
//
// Results:
//	The return value is a standard Tcl result. If an error occurs, an
//	error message is left in the interpreter's result.
//
// Side effects:
//	Instructions are added to envPtr to push and evaluate the tokens at
//	runtime.
//
//----------------------------------------------------------------------

func XTclCompileVarSubst(tls *libc.TLS, interp uintptr, tokenPtr uintptr, envPtr uintptr) { /* tclCompile.c:2294:1: */
	var p uintptr
	var name uintptr = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart
	var nameBytes int32 = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fsize
	var i int32
	var localVar int32
	var localVarName int32 = 1

	// Determine how the variable name should be handled: if it contains any
	// namespace qualifiers it is not a local variable (localVarName=-1); if
	// it looks like an array element and the token has a single component, it
	// should not be created here [Bug 569438] (localVarName=0); otherwise,
	// the local variable can safely be created (localVarName=1).

	i = 0
	p = name
__1:
	if !(i < nameBytes) {
		goto __3
	}
	{
		if int32(*(*int8)(unsafe.Pointer(p))) == ':' && i < nameBytes-1 && int32(*(*int8)(unsafe.Pointer(p + uintptr(1)))) == ':' {
			localVarName = -1
			goto __3
		} else if int32(*(*int8)(unsafe.Pointer(p))) == '(' &&
			(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents == 1 &&
			int32(*(*int8)(unsafe.Pointer(name + uintptr(nameBytes) - uintptr(1)))) == ')' {
			localVarName = 0
			goto __3
		}

	}
	goto __2
__2:
	i++
	p++
	goto __1
	goto __3
__3:
	;

	// Either push the variable's name, or find its index in the array
	// of local variables in a procedure frame.

	localVar = -1
	if localVarName != -1 {
		localVar = XTclFindCompiledLocal(tls, name, nameBytes, localVarName, envPtr)
	}
	if localVar < 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, name, nameBytes, 0)
			if _objIndexCopy <= 255 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok3 := true; ok3; ok3 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok6 := true; ok6; ok6 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}

	// Emit instructions to load the variable.

	XTclAdvanceLines(tls, envPtr+3560, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart,
		(*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart+uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize))

	if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents == 1 {
		if localVar < 0 {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_STK)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_STK == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok8 := true; ok8; ok8 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_STK].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else if localVar <= 255 {
			for ok10 := true; ok10; ok10 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok11 := true; ok11; ok11 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - localVar
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok13 := true; ok13; ok13 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_SCALAR4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_SCALAR4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok14 := true; ok14; ok14 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_SCALAR4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - localVar
						}
						for ok15 := true; ok15; ok15 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	} else {
		XTclCompileTokens(tls, interp, tokenPtr+uintptr(2)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents-1, envPtr)
		if localVar < 0 {
			for ok16 := true; ok16; ok16 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_ARRAY_STK)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_ARRAY_STK == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok17 := true; ok17; ok17 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_ARRAY_STK].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok18 := true; ok18; ok18 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else if localVar <= 255 {
			for ok19 := true; ok19; ok19 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_ARRAY1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_ARRAY1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok20 := true; ok20; ok20 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_ARRAY1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - localVar
						}
						for ok21 := true; ok21; ok21 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok22 := true; ok22; ok22 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_LOAD_ARRAY4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(localVar))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_LOAD_ARRAY4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok23 := true; ok23; ok23 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_LOAD_ARRAY4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - localVar
						}
						for ok24 := true; ok24; ok24 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
}

func XTclCompileTokens(tls *libc.TLS, interp uintptr, tokenPtr uintptr, count int32, envPtr uintptr) { /* tclCompile.c:2364:1: */
	bp := tls.Alloc(259)
	defer tls.Free(259)

	// var textBuffer Tcl_DString at bp+40, 216
	// Holds concatenated chars from adjacent
	// TCL_TOKEN_TEXT, TCL_TOKEN_BS tokens.
	*(*[3]int8)(unsafe.Pointer(bp + 256 /* buffer */)) = *(*[3]int8)(unsafe.Pointer(ts + 18812))
	var i int32
	var numObjsToConcat int32
	var length int32
	var adjust int32
	var entryCodeNext uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext
	var isLiteral int32
	var maxNumCL int32
	var numCL int32
	var clPosition uintptr = uintptr(0)
	var depth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth

	// For the handling of continuation lines in literals we first check if
	// this is actually a literal. For if not we can forego the additional
	// processing. Otherwise we pre-allocate a small table to store the
	// locations of all continuation lines we find in this literal, if any.
	// The table is extended if needed.
	//
	// Note: Different to the equivalent code in function 'TclSubstTokens()'
	// (see file "tclParse.c") we do not seem to need the 'adjust' variable.
	// We also do not seem to need code which merges continuation line
	// information of multiple words which concat'd at runtime. Either that or
	// I have not managed to find a test case for these two possibilities yet.
	// It might be a difference between compile- versus run-time processing.

	numCL = 0
	maxNumCL = 0
	isLiteral = 1
	for i = 0; i < count; i++ {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr+uintptr(i)*24)).Ftype != TCL_TOKEN_TEXT &&
			(*Tcl_Token)(unsafe.Pointer(tokenPtr+uintptr(i)*24)).Ftype != TCL_TOKEN_BS {
			isLiteral = 0
			break
		}
	}

	if isLiteral != 0 {
		maxNumCL = NUM_STATIC_POS
		clPosition = XTcl_Alloc(tls, uint32(uint64(maxNumCL)*uint64(unsafe.Sizeof(int32(0)))))
	}

	adjust = 0
	XTcl_DStringInit(tls, bp+40)
	numObjsToConcat = 0
__1:
	if !(count > 0) {
		goto __3
	}
	{
		switch (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype {
		case TCL_TOKEN_TEXT:
			XTcl_DStringAppend(tls, bp+40, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize)
			XTclAdvanceLines(tls, envPtr+3560, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart,
				(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize))
			break

		case TCL_TOKEN_BS:
			length = XTclParseBackslash(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize,
				uintptr(0), bp+256)
			XTcl_DStringAppend(tls, bp+40, bp+256, length)

			// If the backslash sequence we found is in a literal, and
			// represented a continuation line, we compute and store its
			// location (as char offset to the beginning of the _result_
			// script). We may have to extend the table of locations.
			//
			// Note that the continuation line information is relevant even if
			// the word we are processing is not a literal, as it can affect
			// nested commands. See the branch for TCL_TOKEN_COMMAND below,
			// where the adjustment we are tracking here is taken into
			// account. The good thing is that we do not need a table of
			// everything, just the number of lines we have to add as
			// correction.

			if length == 1 && int32(*(*int8)(unsafe.Pointer(bp + 256))) == ' ' && int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart + 1))) == '\n' {
				if isLiteral != 0 {
					var clPos int32 = (*Tcl_DString)(unsafe.Pointer(bp + 40)).Flength

					if numCL >= maxNumCL {
						maxNumCL = maxNumCL * 2
						clPosition = XTcl_Realloc(tls, clPosition, uint32(uint64(maxNumCL)*uint64(unsafe.Sizeof(int32(0)))))
					}
					*(*int32)(unsafe.Pointer(clPosition + uintptr(numCL)*4)) = clPos
					numCL++
				}
				adjust++
			}
			break

		case TCL_TOKEN_COMMAND:
			// Push any accumulated chars appearing before the command.

			if (*Tcl_DString)(unsafe.Pointer(bp+40)).Flength > 0 {
				var literal int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_DString)(unsafe.Pointer(bp+40)).Fstring, (*Tcl_DString)(unsafe.Pointer(bp+40)).Flength, 0)

				for ok := true; ok; ok = 0 != 0 {
					var _objIndexCopy int32 = literal
					if _objIndexCopy <= 255 {
						for ok1 := true; ok1; ok1 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok2 := true; ok2; ok2 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok3 := true; ok3; ok3 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok4 := true; ok4; ok4 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok5 := true; ok5; ok5 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok6 := true; ok6; ok6 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
				numObjsToConcat++
				XTcl_DStringFree(tls, bp+40)

				if numCL != 0 {
					XTclContinuationsEnter(tls, XTclFetchLiteral(tls, envPtr, uint32(literal)),
						numCL, clPosition)
				}
				numCL = 0
			}

			*(*int32)(unsafe.Pointer(envPtr + 3560)) += adjust
			XTclCompileScript(tls, interp, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr(1),
				(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize-2, envPtr)
			*(*int32)(unsafe.Pointer(envPtr + 3560)) -= adjust
			numObjsToConcat++
			break

		case TCL_TOKEN_VARIABLE:
			// Push any accumulated chars appearing before the $<var>.

			if (*Tcl_DString)(unsafe.Pointer(bp+40)).Flength > 0 {
				var literal int32

				literal = XTclRegisterLiteral(tls, envPtr, (*Tcl_DString)(unsafe.Pointer(bp+40)).Fstring, (*Tcl_DString)(unsafe.Pointer(bp+40)).Flength, 0)
				for ok7 := true; ok7; ok7 = 0 != 0 {
					var _objIndexCopy int32 = literal
					if _objIndexCopy <= 255 {
						for ok8 := true; ok8; ok8 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH1 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok9 := true; ok9; ok9 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok10 := true; ok10; ok10 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					} else {
						for ok11 := true; ok11; ok11 = 0 != 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
								XTclExpandCodeArray(tls, envPtr)
							}
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
							*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
									if INST_PUSH4 == INST_START_CMD {
										return 1
									}
									return 0
								}()
							}
							for ok12 := true; ok12; ok12 = 0 != 0 {
								var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
								if _delta != 0 {
									if _delta == -0x7fffffff-1 {
										_delta = 1 - _objIndexCopy
									}
									for ok13 := true; ok13; ok13 = 0 != 0 {
										if _delta < 0 {
											if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
												(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
											}
										}
										*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
									}
								}
							}
						}
					}
				}
				numObjsToConcat++
				XTcl_DStringFree(tls, bp+40)
			}

			XTclCompileVarSubst(tls, interp, tokenPtr, envPtr)
			numObjsToConcat++
			count = count - (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents
			tokenPtr += 24 * uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents)
			break

		default:
			XTcl_Panic(tls, ts+20989,
				libc.VaList(bp, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart))
		}

	}
	goto __2
__2:
	count--
	tokenPtr += 24
	goto __1
	goto __3
__3:
	;

	// Push any accumulated characters appearing at the end.

	if (*Tcl_DString)(unsafe.Pointer(bp+40)).Flength > 0 {
		var literal int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_DString)(unsafe.Pointer(bp+40)).Fstring, (*Tcl_DString)(unsafe.Pointer(bp+40)).Flength, 0)

		for ok14 := true; ok14; ok14 = 0 != 0 {
			var _objIndexCopy int32 = literal
			if _objIndexCopy <= 255 {
				for ok15 := true; ok15; ok15 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok16 := true; ok16; ok16 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok17 := true; ok17; ok17 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok18 := true; ok18; ok18 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok19 := true; ok19; ok19 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok20 := true; ok20; ok20 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
		numObjsToConcat++
		if numCL != 0 {
			XTclContinuationsEnter(tls, XTclFetchLiteral(tls, envPtr, uint32(literal)),
				numCL, clPosition)
		}
		numCL = 0
	}

	// If necessary, concatenate the parts of the word.

	for numObjsToConcat > 255 {
		for ok21 := true; ok21; ok21 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(255))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_CONCAT1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok22 := true; ok22; ok22 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 255
					}
					for ok23 := true; ok23; ok23 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		numObjsToConcat = numObjsToConcat - 254 // concat pushes 1 obj, the result
	}
	if numObjsToConcat > 1 {
		for ok24 := true; ok24; ok24 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(numObjsToConcat))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_CONCAT1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok25 := true; ok25; ok25 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - numObjsToConcat
					}
					for ok26 := true; ok26; ok26 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}

	// If the tokens yielded no instructions, push an empty string.

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == entryCodeNext {
		for ok27 := true; ok27; ok27 = 0 != 0 {
			var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
			if _objIndexCopy <= 255 {
				for ok28 := true; ok28; ok28 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH1 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok29 := true; ok29; ok29 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok30 := true; ok30; ok30 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			} else {
				for ok31 := true; ok31; ok31 = 0 != 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
						XTclExpandCodeArray(tls, envPtr)
					}
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
					*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
							if INST_PUSH4 == INST_START_CMD {
								return 1
							}
							return 0
						}()
					}
					for ok32 := true; ok32; ok32 = 0 != 0 {
						var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
						if _delta != 0 {
							if _delta == -0x7fffffff-1 {
								_delta = 1 - _objIndexCopy
							}
							for ok33 := true; ok33; ok33 = 0 != 0 {
								if _delta < 0 {
									if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
										(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
									}
								}
								*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
							}
						}
					}
				}
			}
		}
	}
	XTcl_DStringFree(tls, bp+40)

	// Release the temp table we used to collect the locations of continuation
	// lines, if any.

	if maxNumCL != 0 {
		XTclpFree(tls, clPosition)
	}
	for ok34 := true; ok34; ok34 = 0 != 0 {
		var _dd int32 = depth + 1
		if _dd != (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
			XTcl_Panic(tls, ts+18410, libc.VaList(bp+24, (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth, _dd))
		}
	}
}

//----------------------------------------------------------------------
//
// TclCompileCmdWord --
//
//	Given an array of parse tokens for a word containing one or more Tcl
//	commands, emit inline instructions to execute them. This procedure
//	differs from TclCompileTokens in that a simple word such as a loop
//	body enclosed in braces is not just pushed as a string, but is itself
//	parsed into tokens and compiled.
//
// Results:
//	The return value is a standard Tcl result. If an error occurs, an
//	error message is left in the interpreter's result.
//
// Side effects:
//	Instructions are added to envPtr to execute the tokens at runtime.
//
//----------------------------------------------------------------------

func XTclCompileCmdWord(tls *libc.TLS, interp uintptr, tokenPtr uintptr, count int32, envPtr uintptr) { /* tclCompile.c:2583:1: */
	if count == 1 && (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_TEXT {
		// Handle the common case: if there is a single text token, compile it
		// into an inline sequence of instructions.

		XTclCompileScript(tls, interp, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, envPtr)
	} else {
		// Multiple tokens or the single token involves substitutions. Emit
		// instructions to invoke the eval command procedure at runtime on the
		// result of evaluating the tokens.

		XTclCompileTokens(tls, interp, tokenPtr, count, envPtr)
		XTclEmitInvoke(tls, envPtr, INST_EVAL_STK, 0)
	}
}

//----------------------------------------------------------------------
//
// TclCompileExprWords --
//
//	Given an array of parse tokens representing one or more words that
//	contain a Tcl expression, emit inline instructions to execute the
//	expression. This procedure differs from TclCompileExpr in that it
//	supports Tcl's two-level substitution semantics for expressions that
//	appear as command words.
//
// Results:
//	The return value is a standard Tcl result. If an error occurs, an
//	error message is left in the interpreter's result.
//
// Side effects:
//	Instructions are added to envPtr to execute the expression.
//
//----------------------------------------------------------------------

func XTclCompileExprWords(tls *libc.TLS, interp uintptr, tokenPtr uintptr, numWords int32, envPtr uintptr) { /* tclCompile.c:2632:1: */
	var wordPtr uintptr
	var i int32
	var concatItems int32

	// If the expression is a single word that doesn't require substitutions,
	// just compile its string into inline instructions.

	if numWords == 1 && (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
		XTclCompileExpr(tls, interp, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize, envPtr, 1)
		return
	}

	// Emit code to call the expr command proc at runtime. Concatenate the
	// (already substituted once) expr tokens with a space between each.

	wordPtr = tokenPtr
	for i = 0; i < numWords; i++ {
		XTclCompileTokens(tls, interp, wordPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(wordPtr)).FnumComponents, envPtr)

		if i < numWords-1 {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+14299, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)), 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		}
		wordPtr += 24 * uintptr((*Tcl_Token)(unsafe.Pointer(wordPtr)).FnumComponents+1)
	}
	concatItems = 2*numWords - 1
	for concatItems > 255 {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(255))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_CONCAT1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 255
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		concatItems = concatItems - 254
	}
	if concatItems > 1 {
		for ok10 := true; ok10; ok10 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_STR_CONCAT1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(concatItems))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_STR_CONCAT1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_STR_CONCAT1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - concatItems
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	for ok13 := true; ok13; ok13 = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EXPR_STK)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_EXPR_STK == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok14 := true; ok14; ok14 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_EXPR_STK].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok15 := true; ok15; ok15 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
}

//----------------------------------------------------------------------
//
// TclCompileNoOp --
//
//	Function called to compile no-op's
//
// Results:
//	The return value is TCL_OK, indicating successful compilation.
//
// Side effects:
//	Instructions are added to envPtr to execute a no-op at runtime. No
//	result is pushed onto the stack: the compiler has to take care of this
//	itself if the last compiled command is a NoOp.
//
//----------------------------------------------------------------------

func XTclCompileNoOp(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclCompile.c:2698:1: */
	var tokenPtr uintptr
	var i int32

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	for i = 1; i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords; i++ {
		tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents)*24 + uintptr(1)*24

		if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD {
			XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, envPtr)

			for ok := true; ok; ok = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_POP == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, ts+2046, int32(uint64(unsafe.Sizeof([1]int8{}))-uint64(1)), 0)
		if _objIndexCopy <= 255 {
			for ok4 := true; ok4; ok4 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok6 := true; ok6; ok6 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok8 := true; ok8; ok8 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclInitByteCodeObj --
//
//	Create a ByteCode structure and initialize it from a CompileEnv
//	compilation environment structure. The ByteCode structure is smaller
//	and contains just that information needed to execute the bytecode
//	instructions resulting from compiling a Tcl script. The resulting
//	structure is placed in the specified object.
//
// Results:
//	A newly constructed ByteCode object is stored in the internal
//	representation of the objPtr.
//
// Side effects:
//	A single heap object is allocated to hold the new ByteCode structure
//	and its code, object, command location, and aux data arrays. Note that
//	"ownership" (i.e., the pointers to) the Tcl objects and aux data items
//	will be handed over to the new ByteCode structure from the CompileEnv
//	structure.
//
//----------------------------------------------------------------------

func XTclInitByteCodeObj(tls *libc.TLS, objPtr uintptr, envPtr uintptr) { /* tclCompile.c:2748:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var codePtr uintptr
	var codeBytes Size_t
	var objArrayBytes Size_t
	var exceptArrayBytes Size_t
	var cmdLocBytes Size_t
	var auxDataArrayBytes Size_t
	var structureSize Size_t
	var p uintptr
	var numLitObjects int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext
	var namespacePtr uintptr
	var i int32
	// var isNew int32 at bp+4, 4

	var iPtr uintptr

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr == uintptr(0) {
		XTcl_Panic(tls, ts+21041, 0)
	}

	iPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr

	codeBytes = Size_t((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	objArrayBytes = uint64((*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext) * uint64(unsafe.Sizeof(uintptr(0)))
	exceptArrayBytes = uint64((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext) * uint64(unsafe.Sizeof(ExceptionRange{}))
	auxDataArrayBytes = uint64((*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext) * uint64(unsafe.Sizeof(AuxData{}))
	cmdLocBytes = Size_t(sGetCmdLocEncodingSize(tls, envPtr))

	// Compute the total number of bytes needed for this bytecode.

	structureSize = Size_t(unsafe.Sizeof(ByteCode{}))
	structureSize = structureSize + Size_t((int32(codeBytes)+7)&libc.CplInt32(7))        // align object array
	structureSize = structureSize + Size_t((int32(objArrayBytes)+7)&libc.CplInt32(7))    // align exc range arr
	structureSize = structureSize + Size_t((int32(exceptArrayBytes)+7)&libc.CplInt32(7)) // align AuxData array
	structureSize = structureSize + auxDataArrayBytes
	structureSize = structureSize + cmdLocBytes

	if (*Interp)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr)).FvarFramePtr != uintptr(0) {
		namespacePtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr)).FvarFramePtr)).FnsPtr
	} else {
		namespacePtr = (*Interp)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr)).FglobalNsPtr
	}

	p = XTcl_Alloc(tls, uint32(structureSize))
	codePtr = p
	(*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle = XTclHandlePreserve(tls, (*Interp)(unsafe.Pointer(iPtr)).Fhandle)
	(*ByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch = (*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch
	(*ByteCode)(unsafe.Pointer(codePtr)).FnsPtr = namespacePtr
	(*ByteCode)(unsafe.Pointer(codePtr)).FnsEpoch = (*Namespace)(unsafe.Pointer(namespacePtr)).FresolverEpoch
	(*ByteCode)(unsafe.Pointer(codePtr)).FrefCount = 1
	if (*Namespace)(unsafe.Pointer(namespacePtr)).FcompiledVarResProc != 0 || (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr != 0 {
		(*ByteCode)(unsafe.Pointer(codePtr)).Fflags = uint32(TCL_BYTECODE_RESOLVE_VARS)
	} else {
		(*ByteCode)(unsafe.Pointer(codePtr)).Fflags = uint32(0)
	}
	(*ByteCode)(unsafe.Pointer(codePtr)).Fsource = (*CompileEnv)(unsafe.Pointer(envPtr)).Fsource
	(*ByteCode)(unsafe.Pointer(codePtr)).FprocPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr

	(*ByteCode)(unsafe.Pointer(codePtr)).FnumCommands = (*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands
	(*ByteCode)(unsafe.Pointer(codePtr)).FnumSrcBytes = (*CompileEnv)(unsafe.Pointer(envPtr)).FnumSrcBytes
	(*ByteCode)(unsafe.Pointer(codePtr)).FnumCodeBytes = int32(codeBytes)
	(*ByteCode)(unsafe.Pointer(codePtr)).FnumLitObjects = numLitObjects
	(*ByteCode)(unsafe.Pointer(codePtr)).FnumExceptRanges = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext
	(*ByteCode)(unsafe.Pointer(codePtr)).FnumAuxDataItems = (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext
	(*ByteCode)(unsafe.Pointer(codePtr)).FnumCmdLocBytes = int32(cmdLocBytes)
	(*ByteCode)(unsafe.Pointer(codePtr)).FmaxExceptDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
	(*ByteCode)(unsafe.Pointer(codePtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth

	p += uintptr(unsafe.Sizeof(ByteCode{}))
	(*ByteCode)(unsafe.Pointer(codePtr)).FcodeStart = p
	libc.Xmemcpy(tls, p, (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart, codeBytes)

	p += uintptr((int32(codeBytes) + 7) & libc.CplInt32(7)) // align object array
	(*ByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr = p
	for i = 0; i < numLitObjects; i++ {
		var fetched uintptr = XTclFetchLiteral(tls, envPtr, uint32(i))

		if objPtr == fetched {
			// Prevent circular reference where the bytecode internalrep of
			// a value contains a literal which is that same value.
			// If this is allowed to happen, refcount decrements may not
			// reach zero, and memory may leak.  Bugs 467523, 3357771
			//
			// NOTE:  [Bugs 3392070, 3389764] We make a copy based completely
			// on the string value, and do not call Tcl_DuplicateObj() so we
			// can be sure we do not have any lingering cycles hiding in
			// the internalrep.
			// var numBytes int32 at bp, 4

			var bytes uintptr = XTcl_GetStringFromObj(tls, objPtr, bp)

			*(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(i)*8)) = XTcl_NewStringObj(tls, bytes, *(*int32)(unsafe.Pointer(bp /* numBytes */)))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(i)*8)))).FrefCount++
			XTclReleaseLiteral(tls, iPtr, objPtr)
		} else {
			*(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(i)*8)) = fetched
		}
	}

	p += uintptr((int32(objArrayBytes) + 7) & libc.CplInt32(7)) // align exception range array
	if exceptArrayBytes > uint64(0) {
		(*ByteCode)(unsafe.Pointer(codePtr)).FexceptArrayPtr = p
		libc.Xmemcpy(tls, p, (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr, exceptArrayBytes)
	} else {
		(*ByteCode)(unsafe.Pointer(codePtr)).FexceptArrayPtr = uintptr(0)
	}

	p += uintptr((int32(exceptArrayBytes) + 7) & libc.CplInt32(7)) // align AuxData array
	if auxDataArrayBytes > uint64(0) {
		(*ByteCode)(unsafe.Pointer(codePtr)).FauxDataArrayPtr = p
		libc.Xmemcpy(tls, p, (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr, auxDataArrayBytes)
	} else {
		(*ByteCode)(unsafe.Pointer(codePtr)).FauxDataArrayPtr = uintptr(0)
	}

	p += uintptr(auxDataArrayBytes)
	sEncodeCmdLocMap(tls, envPtr, codePtr, p)

	// Record various compilation-related statistics about the new ByteCode
	// structure. Don't include overhead for statistics-related fields.

	// Free the old internal rep then convert the object to a bytecode object
	// by making its internal rep point to the just compiled ByteCode.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	}

	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = codePtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclByteCodeType))

	// TIP #280. Associate the extended per-word line information with the
	// byte code object (internal rep), for use with the bc compiler.

	(*Tcl_HashEntry)(unsafe.Pointer((*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr)).FcreateProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr, codePtr, bp+4))).FclientData = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	(*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr = uintptr(0)

	// We've used up the CompileEnv.  Mark as uninitialized.
	(*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr = uintptr(0)

	(*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// TclFindCompiledLocal --
//
//	This procedure is called at compile time to look up and optionally
//	allocate an entry ("slot") for a variable in a procedure's array of
//	local variables. If the variable's name is NULL, a new temporary
//	variable is always created. (Such temporary variables can only be
//	referenced using their slot index.)
//
// Results:
//	If create is 0 and the name is non-NULL, then if the variable is
//	found, the index of its entry in the procedure's array of local
//	variables is returned; otherwise -1 is returned. If name is NULL, the
//	index of a new temporary variable is returned. Finally, if create is 1
//	and name is non-NULL, the index of a new entry is returned.
//
// Side effects:
//	Creates and registers a new local variable if create is 1 and the
//	variable is unknown, or if the name is NULL.
//
//----------------------------------------------------------------------

func XTclFindCompiledLocal(tls *libc.TLS, name uintptr, nameBytes int32, create int32, envPtr uintptr) int32 { /* tclCompile.c:2942:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var localPtr uintptr
	var localVar int32 = -1
	var i int32
	var procPtr uintptr

	// If not creating a temporary, does a local variable of the specified
	// name already exist?

	procPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FprocPtr

	if procPtr == uintptr(0) {
		// Compiling a non-body script: give it read access to the LVT in the
		// current localCache

		var cachePtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr)).FvarFramePtr)).FlocalCachePtr
		var localName uintptr
		var varNamePtr uintptr
		// var len int32 at bp, 4

		if !(cachePtr != 0) || !(name != 0) {
			return -1
		}

		varNamePtr = cachePtr + 8
		i = 0
	__1:
		if !(i < (*LocalCache)(unsafe.Pointer(cachePtr)).FnumVars) {
			goto __3
		}
		{
			if *(*uintptr)(unsafe.Pointer(varNamePtr)) != 0 {
				localName = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(varNamePtr)), bp)
				if *(*int32)(unsafe.Pointer(bp)) == nameBytes && !(libc.Xstrncmp(tls, name, localName, uint64(*(*int32)(unsafe.Pointer(bp)))) != 0) {
					return i
				}
			}

		}
		goto __2
	__2:
		varNamePtr += 8
		i++
		goto __1
		goto __3
	__3:
		;
		return -1
	}

	if name != uintptr(0) {
		var localCt int32 = (*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals

		localPtr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr
		for i = 0; i < localCt; i++ {
			if !((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_TEMPORARY != 0) {
				var localName uintptr = localPtr + 40 /* &.name */

				if nameBytes == (*CompiledLocal)(unsafe.Pointer(localPtr)).FnameLength && libc.Xstrncmp(tls, name, localName, uint64(nameBytes)) == 0 {
					return i
				}
			}
			localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr
		}
	}

	// Create a new variable if appropriate.

	if create != 0 || name == uintptr(0) {
		localVar = (*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals
		localPtr = XTcl_Alloc(tls, uint32(int32(uintptr(0)+40)+nameBytes+1))
		if (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr == uintptr(0) {
			(*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr = libc.AssignPtrUintptr(procPtr+48, localPtr)
		} else {
			(*CompiledLocal)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FlastLocalPtr)).FnextPtr = localPtr
			(*Proc)(unsafe.Pointer(procPtr)).FlastLocalPtr = localPtr
		}
		(*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr = uintptr(0)
		(*CompiledLocal)(unsafe.Pointer(localPtr)).FnameLength = nameBytes
		(*CompiledLocal)(unsafe.Pointer(localPtr)).FframeIndex = localVar
		(*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags = 0
		if name == uintptr(0) {
			*(*int32)(unsafe.Pointer(localPtr + 16)) |= VAR_TEMPORARY
		}
		(*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr = uintptr(0)
		(*CompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo = uintptr(0)

		if name != uintptr(0) {
			libc.Xmemcpy(tls, localPtr+40, name, uint64(nameBytes))
		}
		*(*int8)(unsafe.Pointer(localPtr + 40 + uintptr(nameBytes))) = int8(0)
		(*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals++
	}
	return localVar
}

//----------------------------------------------------------------------
//
// TclExpandCodeArray --
//
//	Procedure that uses malloc to allocate more storage for a CompileEnv's
//	code array.
//
// Results:
//	None.
//
// Side effects:
//	The byte code array in *envPtr is reallocated to a new array of double
//	the size, and if envPtr->mallocedCodeArray is non-zero the old array
//	is freed. Byte codes are copied from the old array to the new one.
//
//----------------------------------------------------------------------

func XTclExpandCodeArray(tls *libc.TLS, envArgPtr uintptr) { /* tclCompile.c:3059:1: */
	var envPtr uintptr = envArgPtr
	// The CompileEnv containing the code array to
	// be doubled in size.

	// envPtr->codeNext is equal to envPtr->codeEnd. The currently defined
	// code bytes are stored between envPtr->codeStart and envPtr->codeNext-1
	// [inclusive].

	var currBytes Size_t = Size_t((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	var newBytes Size_t = Size_t(int64(2) * ((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1))

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedCodeArray != 0 {
		(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart = XTcl_Realloc(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart, uint32(newBytes))
	} else {
		// envPtr->codeStart isn't a ckalloc'd pointer, so we must code a
		// ckrealloc equivalent for ourselves.

		var newPtr uintptr = XTcl_Alloc(tls, uint32(newBytes))

		libc.Xmemcpy(tls, newPtr, (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart, currBytes)
		(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart = newPtr
		(*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedCodeArray = 1
	}

	(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(currBytes)
	(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(newBytes)
}

//----------------------------------------------------------------------
//
// EnterCmdStartData --
//
//	Registers the starting source and bytecode location of a command. This
//	information is used at runtime to map between instruction pc and
//	source locations.
//
// Results:
//	None.
//
// Side effects:
//	Inserts source and code location information into the compilation
//	environment envPtr for the command at index cmdIndex. The compilation
//	environment's CmdLocation array is grown if necessary.
//
//----------------------------------------------------------------------

func sEnterCmdStartData(tls *libc.TLS, envPtr uintptr, cmdIndex int32, srcOffset int32, codeOffset int32) { /* tclCompile.c:3116:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var cmdLocPtr uintptr

	if cmdIndex < 0 || cmdIndex >= (*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands {
		XTcl_Panic(tls, ts+21097, libc.VaList(bp, cmdIndex))
	}

	if cmdIndex >= (*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapEnd {
		// Expand the command location array by allocating more storage from
		// the heap. The currently allocated CmdLocation entries are stored
		// from cmdMapPtr[0] up to cmdMapPtr[envPtr->cmdMapEnd] (inclusive).

		var currElems Size_t = Size_t((*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapEnd)
		var newElems Size_t = uint64(2) * currElems
		var currBytes Size_t = currElems * Size_t(unsafe.Sizeof(CmdLocation{}))
		var newBytes Size_t = newElems * Size_t(unsafe.Sizeof(CmdLocation{}))

		if (*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedCmdMap != 0 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr = XTcl_Realloc(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr, uint32(newBytes))
		} else {
			// envPtr->cmdMapPtr isn't a ckalloc'd pointer, so we must code a
			// ckrealloc equivalent for ourselves.

			var newPtr uintptr = XTcl_Alloc(tls, uint32(newBytes))

			libc.Xmemcpy(tls, newPtr, (*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr, currBytes)
			(*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr = newPtr
			(*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedCmdMap = 1
		}
		(*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapEnd = int32(newElems)
	}

	if cmdIndex > 0 {
		if codeOffset < (*CmdLocation)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr+uintptr(cmdIndex-1)*16)).FcodeOffset {
			XTcl_Panic(tls, ts+21137, 0)
		}
	}

	cmdLocPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr + uintptr(cmdIndex)*16
	(*CmdLocation)(unsafe.Pointer(cmdLocPtr)).FcodeOffset = codeOffset
	(*CmdLocation)(unsafe.Pointer(cmdLocPtr)).FsrcOffset = srcOffset
	(*CmdLocation)(unsafe.Pointer(cmdLocPtr)).FnumSrcBytes = -1
	(*CmdLocation)(unsafe.Pointer(cmdLocPtr)).FnumCodeBytes = -1
}

//----------------------------------------------------------------------
//
// EnterCmdExtentData --
//
//	Registers the source and bytecode length for a command. This
//	information is used at runtime to map between instruction pc and
//	source locations.
//
// Results:
//	None.
//
// Side effects:
//	Inserts source and code length information into the compilation
//	environment envPtr for the command at index cmdIndex. Starting source
//	and bytecode information for the command must already have been
//	registered.
//
//----------------------------------------------------------------------

func sEnterCmdExtentData(tls *libc.TLS, envPtr uintptr, cmdIndex int32, numSrcBytes int32, numCodeBytes int32) { /* tclCompile.c:3195:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var cmdLocPtr uintptr

	if cmdIndex < 0 || cmdIndex >= (*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands {
		XTcl_Panic(tls, ts+21190, libc.VaList(bp, cmdIndex))
	}

	if cmdIndex > (*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapEnd {
		XTcl_Panic(tls, ts+21231,
			libc.VaList(bp+8, cmdIndex))
	}

	cmdLocPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr + uintptr(cmdIndex)*16
	(*CmdLocation)(unsafe.Pointer(cmdLocPtr)).FnumSrcBytes = numSrcBytes
	(*CmdLocation)(unsafe.Pointer(cmdLocPtr)).FnumCodeBytes = numCodeBytes
}

//----------------------------------------------------------------------
// TIP #280
//
// EnterCmdWordData --
//
//	Registers the lines for the words of a command. This information is
//	used at runtime by 'info frame'.
//
// Results:
//	None.
//
// Side effects:
//	Inserts word location information into the compilation environment
//	envPtr for the command at index cmdIndex. The compilation
//	environment's ExtCmdLoc.ECL array is grown if necessary.
//
//----------------------------------------------------------------------

func sEnterCmdWordData(tls *libc.TLS, eclPtr uintptr, srcOffset int32, tokenPtr uintptr, cmd uintptr, len int32, numWords int32, line int32, clNext uintptr, wlines uintptr, envPtr uintptr) { /* tclCompile.c:3241:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var ePtr uintptr
	var last uintptr
	var wordIdx int32
	// var wordLine int32 at bp, 4

	var wwlines uintptr
	// var wordNext uintptr at bp+8, 8

	if (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc >= (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnloc {
		// Expand the ECL array by allocating more storage from the heap. The
		// currently allocated ECL entries are stored from eclPtr->loc[0] up
		// to eclPtr->loc[eclPtr->nuloc-1] (inclusive).

		var currElems Size_t = Size_t((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnloc)
		var newElems Size_t = func() uint64 {
			if currElems != 0 {
				return uint64(2) * currElems
			}
			return uint64(1)
		}()
		var newBytes Size_t = newElems * Size_t(unsafe.Sizeof(ECL{}))

		(*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc = XTcl_Realloc(tls, (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc, uint32(newBytes))
		(*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnloc = int32(newElems)
	}

	ePtr = (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc)*24
	(*ECL)(unsafe.Pointer(ePtr)).FsrcOffset = srcOffset
	(*ECL)(unsafe.Pointer(ePtr)).Fline = XTcl_Alloc(tls, uint32(uint64(numWords)*uint64(unsafe.Sizeof(int32(0)))))
	(*ECL)(unsafe.Pointer(ePtr)).Fnext = XTcl_Alloc(tls, uint32(uint64(numWords)*uint64(unsafe.Sizeof(uintptr(0)))))
	(*ECL)(unsafe.Pointer(ePtr)).Fnline = numWords
	wwlines = XTcl_Alloc(tls, uint32(uint64(numWords)*uint64(unsafe.Sizeof(int32(0)))))

	last = cmd
	*(*int32)(unsafe.Pointer(bp /* wordLine */)) = line
	*(*uintptr)(unsafe.Pointer(bp + 8 /* wordNext */)) = clNext
	wordIdx = 0
__1:
	if !(wordIdx < numWords) {
		goto __3
	}
	{
		XTclAdvanceLines(tls, bp, last, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)
		XTclAdvanceContinuations(tls, bp, bp+8,
			int32((int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1))
		// See Ticket 4b61afd660
		*(*int32)(unsafe.Pointer(wwlines + uintptr(wordIdx)*4)) = func() int32 {
			if wordIdx == 0 || XTclWordKnownAtCompileTime(tls, tokenPtr, uintptr(0)) != 0 {
				return *(*int32)(unsafe.Pointer(bp /* wordLine */))
			}
			return -1
		}()
		*(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer(ePtr)).Fline + uintptr(wordIdx)*4)) = *(*int32)(unsafe.Pointer(bp /* wordLine */))
		*(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer(ePtr)).Fnext + uintptr(wordIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp + 8 /* wordNext */))
		last = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart

	}
	goto __2
__2:
	wordIdx++
	tokenPtr += 24 * uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)
	goto __1
	goto __3
__3:
	;

	*(*uintptr)(unsafe.Pointer(wlines)) = wwlines
	(*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc++
}

//----------------------------------------------------------------------
//
// TclCreateExceptRange --
//
//	Procedure that allocates and initializes a new ExceptionRange
//	structure of the specified kind in a CompileEnv.
//
// Results:
//	Returns the index for the newly created ExceptionRange.
//
// Side effects:
//	If there is not enough room in the CompileEnv's ExceptionRange array,
//	the array in expanded: a new array of double the size is allocated, if
//	envPtr->mallocedExceptArray is non-zero the old array is freed, and
//	ExceptionRange entries are copied from the old array to the new one.
//
//----------------------------------------------------------------------

func XTclCreateExceptRange(tls *libc.TLS, type1 ExceptionRangeType, envPtr uintptr) int32 { /* tclCompile.c:3323:1: */
	var rangePtr uintptr
	var auxPtr uintptr
	var index int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext

	if index >= (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayEnd {
		// Expand the ExceptionRange array. The currently allocated entries
		// are stored between elements 0 and (envPtr->exceptArrayNext - 1)
		// [inclusive].

		var currBytes Size_t = uint64((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext) * uint64(unsafe.Sizeof(ExceptionRange{}))
		var currBytes2 Size_t = uint64((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext) * uint64(unsafe.Sizeof(ExceptionAux{}))
		var newElems int32 = 2 * (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayEnd
		var newBytes Size_t = uint64(newElems) * uint64(unsafe.Sizeof(ExceptionRange{}))
		var newBytes2 Size_t = uint64(newElems) * uint64(unsafe.Sizeof(ExceptionAux{}))

		if (*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedExceptArray != 0 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr = XTcl_Realloc(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr, uint32(newBytes))
			(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr = XTcl_Realloc(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr, uint32(newBytes2))
		} else {
			// envPtr->exceptArrayPtr isn't a ckalloc'd pointer, so we must
			// code a ckrealloc equivalent for ourselves.

			var newPtr uintptr = XTcl_Alloc(tls, uint32(newBytes))
			var newPtr2 uintptr = XTcl_Alloc(tls, uint32(newBytes2))

			libc.Xmemcpy(tls, newPtr, (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr, currBytes)
			libc.Xmemcpy(tls, newPtr2, (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr, currBytes2)
			(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr = newPtr
			(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr = newPtr2
			(*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedExceptArray = 1
		}
		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayEnd = newElems
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext++

	rangePtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(index)*28
	(*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype = type1
	(*ExceptionRange)(unsafe.Pointer(rangePtr)).FnestingLevel = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
	(*ExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset = -1
	(*ExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes = -1
	(*ExceptionRange)(unsafe.Pointer(rangePtr)).FbreakOffset = -1
	(*ExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset = -1
	(*ExceptionRange)(unsafe.Pointer(rangePtr)).FcatchOffset = -1
	auxPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(index)*56
	(*ExceptionAux)(unsafe.Pointer(auxPtr)).FsupportsContinue = 1
	(*ExceptionAux)(unsafe.Pointer(auxPtr)).FstackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
	(*ExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTarget = (*CompileEnv)(unsafe.Pointer(envPtr)).FexpandCount
	(*ExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTargetDepth = -1
	(*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets = 0
	(*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets = uintptr(0)
	(*ExceptionAux)(unsafe.Pointer(auxPtr)).FallocBreakTargets = 0
	(*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets = 0
	(*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets = uintptr(0)
	(*ExceptionAux)(unsafe.Pointer(auxPtr)).FallocContinueTargets = 0
	return index
}

// ---------------------------------------------------------------------
//
// TclGetInnermostExceptionRange --
//
//	Returns the innermost exception range that covers the current code
//	creation point, and (optionally) the stack depth that is expected at
//	that point. Relies on the fact that the range has a numCodeBytes = -1
//	when it is being populated and that inner ranges come after outer
//	ranges.
//
// ---------------------------------------------------------------------

func XTclGetInnermostExceptionRange(tls *libc.TLS, envPtr uintptr, returnCode int32, auxPtrPtr uintptr) uintptr { /* tclCompile.c:3406:16: */
	var i int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext
	var rangePtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(i)*28

	for i > 0 {
		rangePtr -= 28
		i--

		if (int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 >= int64((*ExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset) && ((*ExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes == -1 || (int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 < int64((*ExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset+(*ExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes)) && (returnCode != TCL_CONTINUE || (*ExceptionAux)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr+uintptr(i)*56)).FsupportsContinue != 0) {

			if auxPtrPtr != 0 {
				*(*uintptr)(unsafe.Pointer(auxPtrPtr)) = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(i)*56
			}
			return rangePtr
		}
	}
	return uintptr(0)
}

// ---------------------------------------------------------------------
//
// TclAddLoopBreakFixup, TclAddLoopContinueFixup --
//
//	Adds a place that wants to break/continue to the loop exception range
//	tracking that will be fixed up once the loop can be finalized. These
//	functions will generate an INST_JUMP4 that will be fixed up during the
//	loop finalization.
//
// ---------------------------------------------------------------------

func XTclAddLoopBreakFixup(tls *libc.TLS, envPtr uintptr, auxPtr uintptr) { /* tclCompile.c:3447:1: */
	var range1 int32 = int32((int64(auxPtr) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr)) / 56)

	if (*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).Ftype != LOOP_EXCEPTION_RANGE {
		XTcl_Panic(tls, ts+21285, 0)
	}

	if libc.PreIncInt32(&(*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets, 1) > (*ExceptionAux)(unsafe.Pointer(auxPtr)).FallocBreakTargets {
		*(*int32)(unsafe.Pointer(auxPtr + 32)) *= 2
		*(*int32)(unsafe.Pointer(auxPtr + 32)) += 2
		if (*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets != 0 {
			(*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets = XTcl_Realloc(tls, (*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets, uint32(uint64(unsafe.Sizeof(int32(0)))*uint64((*ExceptionAux)(unsafe.Pointer(auxPtr)).FallocBreakTargets)))
		} else {
			(*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(int32(0)))*uint64((*ExceptionAux)(unsafe.Pointer(auxPtr)).FallocBreakTargets)))
		}
	}
	*(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr((*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets-1)*4)) = uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP4 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP4].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
}

func XTclAddLoopContinueFixup(tls *libc.TLS, envPtr uintptr, auxPtr uintptr) { /* tclCompile.c:3473:1: */
	var range1 int32 = int32((int64(auxPtr) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr)) / 56)

	if (*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(range1)*28)).Ftype != LOOP_EXCEPTION_RANGE {
		XTcl_Panic(tls, ts+21337, 0)
	}

	if libc.PreIncInt32(&(*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets, 1) > (*ExceptionAux)(unsafe.Pointer(auxPtr)).FallocContinueTargets {
		*(*int32)(unsafe.Pointer(auxPtr + 48)) *= 2
		*(*int32)(unsafe.Pointer(auxPtr + 48)) += 2
		if (*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets != 0 {
			(*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets = XTcl_Realloc(tls, (*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets, uint32(uint64(unsafe.Sizeof(int32(0)))*uint64((*ExceptionAux)(unsafe.Pointer(auxPtr)).FallocContinueTargets)))
		} else {
			(*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(int32(0)))*uint64((*ExceptionAux)(unsafe.Pointer(auxPtr)).FallocContinueTargets)))
		}
	}
	*(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr((*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets-1)*4)) = uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP4)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 24)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 16)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(uint32(0)) >> 8)
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_JUMP4 == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_JUMP4].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}
}

// ---------------------------------------------------------------------
//
// TclCleanupStackForBreakContinue --
//
//	Ditch the extra elements from the auxiliary stack and the main stack.
//	How to do this exactly depends on whether there are any elements on
//	the auxiliary stack to pop.
//
// ---------------------------------------------------------------------

func XTclCleanupStackForBreakContinue(tls *libc.TLS, envPtr uintptr, auxPtr uintptr) { /* tclCompile.c:3512:1: */
	var savedStackDepth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
	var toPop int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FexpandCount - (*ExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTarget

	if toPop > 0 {
		for libc.PostDecInt32(&toPop, 1) > 0 {
			for ok := true; ok; ok = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EXPAND_DROP)
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_EXPAND_DROP == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_EXPAND_DROP].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - 0
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
		for ok3 := true; ok3; ok3 = 0 != 0 {
			if (*ExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTargetDepth-(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += (*ExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTargetDepth - (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
		}
		(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = (*ExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTargetDepth
	}
	toPop = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth - (*ExceptionAux)(unsafe.Pointer(auxPtr)).FstackDepth
	for libc.PostDecInt32(&toPop, 1) > 0 {
		for ok4 := true; ok4; ok4 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_POP)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_POP == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_POP].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok6 := true; ok6; ok6 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = savedStackDepth
}

// ---------------------------------------------------------------------
//
// StartExpanding --
//
//	Pushes an INST_EXPAND_START and does some additional housekeeping so
//	that the [break] and [continue] compilers can use an exception-free
//	issue to discard it.
//
// ---------------------------------------------------------------------

func sStartExpanding(tls *libc.TLS, envPtr uintptr) { /* tclCompile.c:3547:1: */
	var i int32

	for ok := true; ok; ok = 0 != 0 {
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
			XTclExpandCodeArray(tls, envPtr)
		}
		*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EXPAND_START)
		if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
				if INST_EXPAND_START == INST_START_CMD {
					return 1
				}
				return 0
			}()
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _delta int32 = XtclInstructionTable[INST_EXPAND_START].FstackEffect
			if _delta != 0 {
				if _delta == -0x7fffffff-1 {
					_delta = 1 - 0
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					if _delta < 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
						}
					}
					*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
				}
			}
		}
	}

	// Update inner exception ranges with information about the environment
	// where this expansion started.

	for i = 0; i < (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext; i++ {
		var rangePtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(i)*28
		var auxPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(i)*56

		// Ignore loops unless they're still being built.

		if int64((*ExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset) > (int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 {
			continue
		}
		if (*ExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes != -1 {
			continue
		}

		// Adequate condition: further out loops and further in exceptions
		// don't actually need this information.

		if (*ExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTarget == (*CompileEnv)(unsafe.Pointer(envPtr)).FexpandCount {
			(*ExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTargetDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
		}
	}

	// There's now one more expansion being processed on the auxiliary stack.

	(*CompileEnv)(unsafe.Pointer(envPtr)).FexpandCount++
}

// ---------------------------------------------------------------------
//
// TclFinalizeLoopExceptionRange --
//
//	Finalizes a loop exception range, binding the registered [break] and
//	[continue] implementations so that they jump to the correct place.
//	Note that this must only be called after *all* the exception range
//	target offsets have been set.
//
// ---------------------------------------------------------------------

func XTclFinalizeLoopExceptionRange(tls *libc.TLS, envPtr uintptr, range1 int32) { /* tclCompile.c:3605:1: */
	var rangePtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*28
	var auxPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(range1)*56
	var i int32
	var offset int32
	var site uintptr

	if (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype != LOOP_EXCEPTION_RANGE {
		XTcl_Panic(tls, ts+21392, 0)
	}

	// Do the jump fixups. Note that these are always issued as INST_JUMP4 so
	// there is no need to fuss around with updating code offsets.

	for i = 0; i < (*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets; i++ {
		site = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr(i)*4)))
		offset = int32(uint32((*ExceptionRange)(unsafe.Pointer(rangePtr)).FbreakOffset) - *(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr(i)*4)))
		for ok := true; ok; ok = 0 != 0 {
			*(*uint8)(unsafe.Pointer(site)) = uint8(INST_JUMP4)
			for ok1 := true; ok1; ok1 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(site + uintptr(1))) = uint8(uint32(offset) >> 24)
				*(*uint8)(unsafe.Pointer(site + uintptr(1) + uintptr(1))) = uint8(uint32(offset) >> 16)
				*(*uint8)(unsafe.Pointer(site + uintptr(1) + uintptr(2))) = uint8(uint32(offset) >> 8)
				*(*uint8)(unsafe.Pointer(site + uintptr(1) + uintptr(3))) = uint8(uint32(offset))
			}
		}
	}
	for i = 0; i < (*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets; i++ {
		site = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr(i)*4)))
		if (*ExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset == -1 {
			var j int32

			// WTF? Can't bind, so revert to an INST_CONTINUE. Not enough
			// space to do anything else.

			*(*uint8)(unsafe.Pointer(site)) = uint8(INST_CONTINUE)
			for j = 0; j < 4; j++ {
				*(*uint8)(unsafe.Pointer(libc.PreIncUintptr(&site, 1))) = uint8(INST_NOP)
			}
		} else {
			offset = int32(uint32((*ExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset) - *(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr(i)*4)))
			for ok2 := true; ok2; ok2 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(site)) = uint8(INST_JUMP4)
				for ok3 := true; ok3; ok3 = 0 != 0 {
					*(*uint8)(unsafe.Pointer(site + uintptr(1))) = uint8(uint32(offset) >> 24)
					*(*uint8)(unsafe.Pointer(site + uintptr(1) + uintptr(1))) = uint8(uint32(offset) >> 16)
					*(*uint8)(unsafe.Pointer(site + uintptr(1) + uintptr(2))) = uint8(uint32(offset) >> 8)
					*(*uint8)(unsafe.Pointer(site + uintptr(1) + uintptr(3))) = uint8(uint32(offset))
				}
			}
		}
	}

	// Drop the arrays we were holding the only reference to.

	if (*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets != 0 {
		XTclpFree(tls, (*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets)
		(*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets = uintptr(0)
		(*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets = 0
	}
	if (*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets != 0 {
		XTclpFree(tls, (*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets)
		(*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets = uintptr(0)
		(*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets = 0
	}
}

//----------------------------------------------------------------------
//
// TclCreateAuxData --
//
//	Procedure that allocates and initializes a new AuxData structure in a
//	CompileEnv's array of compilation auxiliary data records. These
//	AuxData records hold information created during compilation by
//	CompileProcs and used by instructions during execution.
//
// Results:
//	Returns the index for the newly created AuxData structure.
//
// Side effects:
//	If there is not enough room in the CompileEnv's AuxData array, the
//	AuxData array in expanded: a new array of double the size is
//	allocated, if envPtr->mallocedAuxDataArray is non-zero the old array
//	is freed, and AuxData entries are copied from the old array to the new
//	one.
//
//----------------------------------------------------------------------

func XTclCreateAuxData(tls *libc.TLS, clientData ClientData, typePtr uintptr, envPtr uintptr) int32 { /* tclCompile.c:3688:1: */
	var index int32 // Index for the new AuxData structure.
	var auxDataPtr uintptr
	// Points to the new AuxData structure

	index = (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext
	if index >= (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayEnd {
		// Expand the AuxData array. The currently allocated entries are
		// stored between elements 0 and (envPtr->auxDataArrayNext - 1)
		// [inclusive].

		var currBytes Size_t = uint64((*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext) * uint64(unsafe.Sizeof(AuxData{}))
		var newElems int32 = 2 * (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayEnd
		var newBytes Size_t = uint64(newElems) * uint64(unsafe.Sizeof(AuxData{}))

		if (*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedAuxDataArray != 0 {
			(*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr = XTcl_Realloc(tls, (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr, uint32(newBytes))
		} else {
			// envPtr->auxDataArrayPtr isn't a ckalloc'd pointer, so we must
			// code a ckrealloc equivalent for ourselves.

			var newPtr uintptr = XTcl_Alloc(tls, uint32(newBytes))

			libc.Xmemcpy(tls, newPtr, (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr, currBytes)
			(*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr = newPtr
			(*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedAuxDataArray = 1
		}
		(*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayEnd = newElems
	}
	(*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext++

	auxDataPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr + uintptr(index)*16
	(*AuxData)(unsafe.Pointer(auxDataPtr)).FclientData = clientData
	(*AuxData)(unsafe.Pointer(auxDataPtr)).Ftype = typePtr
	return index
}

//----------------------------------------------------------------------
//
// TclInitJumpFixupArray --
//
//	Initializes a JumpFixupArray structure to hold some number of jump
//	fixup entries.
//
// Results:
//	None.
//
// Side effects:
//	The JumpFixupArray structure is initialized.
//
//----------------------------------------------------------------------

func XTclInitJumpFixupArray(tls *libc.TLS, fixupArrayPtr uintptr) { /* tclCompile.c:3755:1: */
	(*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup = fixupArrayPtr + 20 /* &.staticFixupSpace */
	(*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Fnext = 0
	(*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Fend = JUMPFIXUP_INIT_ENTRIES - 1
	(*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).FmallocedArray = 0
}

//----------------------------------------------------------------------
//
// TclExpandJumpFixupArray --
//
//	Procedure that uses malloc to allocate more storage for a jump fixup
//	array.
//
// Results:
//	None.
//
// Side effects:
//	The jump fixup array in *fixupArrayPtr is reallocated to a new array
//	of double the size, and if fixupArrayPtr->mallocedArray is non-zero
//	the old array is freed. Jump fixup structures are copied from the old
//	array to the new one.
//
//----------------------------------------------------------------------

func XTclExpandJumpFixupArray(tls *libc.TLS, fixupArrayPtr uintptr) { /* tclCompile.c:3787:1: */
	// The currently allocated jump fixup entries are stored from fixup[0] up
	// to fixup[fixupArrayPtr->fixupNext] (*not* inclusive). We assume
	// fixupArrayPtr->fixupNext is equal to fixupArrayPtr->fixupEnd.

	var currBytes Size_t = uint64((*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Fnext) * uint64(unsafe.Sizeof(JumpFixup{}))
	var newElems int32 = 2 * ((*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Fend + 1)
	var newBytes Size_t = uint64(newElems) * uint64(unsafe.Sizeof(JumpFixup{}))

	if (*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).FmallocedArray != 0 {
		(*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup = XTcl_Realloc(tls, (*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup, uint32(newBytes))
	} else {
		// fixupArrayPtr->fixup isn't a ckalloc'd pointer, so we must code a
		// ckrealloc equivalent for ourselves.

		var newPtr uintptr = XTcl_Alloc(tls, uint32(newBytes))

		libc.Xmemcpy(tls, newPtr, (*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup, currBytes)
		(*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup = newPtr
		(*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).FmallocedArray = 1
	}
	(*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Fend = newElems
}

//----------------------------------------------------------------------
//
// TclFreeJumpFixupArray --
//
//	Free any storage allocated in a jump fixup array structure.
//
// Results:
//	None.
//
// Side effects:
//	Allocated storage in the JumpFixupArray structure is freed.
//
//----------------------------------------------------------------------

func XTclFreeJumpFixupArray(tls *libc.TLS, fixupArrayPtr uintptr) { /* tclCompile.c:3836:1: */
	if (*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).FmallocedArray != 0 {
		XTclpFree(tls, (*JumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup)
	}
}

//----------------------------------------------------------------------
//
// TclEmitForwardJump --
//
//	Procedure to emit a two-byte forward jump of kind "jumpType". Since
//	the jump may later have to be grown to five bytes if the jump target
//	is more than, say, 127 bytes away, this procedure also initializes a
//	JumpFixup record with information about the jump.
//
// Results:
//	None.
//
// Side effects:
//	The JumpFixup record pointed to by "jumpFixupPtr" is initialized with
//	information needed later if the jump is to be grown. Also, a two byte
//	jump of the designated type is emitted at the current point in the
//	bytecode stream.
//
//----------------------------------------------------------------------

func XTclEmitForwardJump(tls *libc.TLS, envPtr uintptr, jumpType TclJumpType, jumpFixupPtr uintptr) { /* tclCompile.c:3869:1: */
	// Initialize the JumpFixup structure:
	//    - codeOffset is offset of first byte of jump below
	//    - cmdIndex is index of the command after the current one
	//    - exceptIndex is the index of the first ExceptionRange after the
	//	    current one.

	(*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FjumpType = jumpType
	(*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcodeOffset = uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	(*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcmdIndex = (*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands
	(*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FexceptIndex = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext

	switch jumpType {
	case TCL_UNCONDITIONAL_JUMP:
		for ok := true; ok; ok = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		break
	case TCL_TRUE_JUMP:
		for ok3 := true; ok3; ok3 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_TRUE1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP_TRUE1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP_TRUE1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		break
	default:
		for ok6 := true; ok6; ok6 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_JUMP_FALSE1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(0))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_JUMP_FALSE1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_JUMP_FALSE1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		break
	}
}

//----------------------------------------------------------------------
//
// TclFixupForwardJump --
//
//	Procedure that updates a previously-emitted forward jump to jump a
//	specified number of bytes, "jumpDist". If necessary, the jump is grown
//	from two to five bytes; this is done if the jump distance is greater
//	than "distThreshold" (normally 127 bytes). The jump is described by a
//	JumpFixup record previously initialized by TclEmitForwardJump.
//
// Results:
//	1 if the jump was grown and subsequent instructions had to be moved;
//	otherwise 0. This result is returned to allow callers to update any
//	additional code offsets they may hold.
//
// Side effects:
//	The jump may be grown and subsequent instructions moved. If this
//	happens, the code offsets for any commands and any ExceptionRange
//	records between the jump and the current code address will be updated
//	to reflect the moved code. Also, the bytecode instruction array in the
//	CompileEnv structure may be grown and reallocated.
//
//----------------------------------------------------------------------

func XTclFixupForwardJump(tls *libc.TLS, envPtr uintptr, jumpFixupPtr uintptr, jumpDist int32, distThreshold int32) int32 { /* tclCompile.c:3931:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var jumpPc uintptr
	var p uintptr
	var firstCmd int32
	var lastCmd int32
	var firstRange int32
	var lastRange int32
	var k int32
	var numBytes uint32

	if jumpDist <= distThreshold {
		jumpPc = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcodeOffset)
		switch (*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FjumpType {
		case TCL_UNCONDITIONAL_JUMP:
			for ok := true; ok; ok = 0 != 0 {
				*(*uint8)(unsafe.Pointer(jumpPc)) = uint8(INST_JUMP1)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1))) = uint8(uint32(jumpDist))
			}
			break
			fallthrough
		case TCL_TRUE_JUMP:
			for ok1 := true; ok1; ok1 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(jumpPc)) = uint8(INST_JUMP_TRUE1)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1))) = uint8(uint32(jumpDist))
			}
			break
			fallthrough
		default:
			for ok2 := true; ok2; ok2 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(jumpPc)) = uint8(INST_JUMP_FALSE1)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1))) = uint8(uint32(jumpDist))
			}
			break
		}
		return 0
	}

	// We must grow the jump then move subsequent instructions down. Note that
	// if we expand the space for generated instructions, code addresses might
	// change; be careful about updating any of these addresses held in
	// variables.

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(3) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
		XTclExpandCodeArray(tls, envPtr)
	}
	jumpPc = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcodeOffset)
	numBytes = uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64(jumpPc))/1 - int64(2))
	p = jumpPc + uintptr(2)
	libc.Xmemmove(tls, p+uintptr(3), p, uint64(numBytes))

	*(*uintptr)(unsafe.Pointer(envPtr + 120)) += uintptr(3)
	jumpDist = jumpDist + 3
	switch (*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FjumpType {
	case TCL_UNCONDITIONAL_JUMP:
		for ok3 := true; ok3; ok3 = 0 != 0 {
			*(*uint8)(unsafe.Pointer(jumpPc)) = uint8(INST_JUMP4)
			for ok4 := true; ok4; ok4 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1))) = uint8(uint32(jumpDist) >> 24)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1) + uintptr(1))) = uint8(uint32(jumpDist) >> 16)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1) + uintptr(2))) = uint8(uint32(jumpDist) >> 8)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1) + uintptr(3))) = uint8(uint32(jumpDist))
			}
		}
		break
	case TCL_TRUE_JUMP:
		for ok5 := true; ok5; ok5 = 0 != 0 {
			*(*uint8)(unsafe.Pointer(jumpPc)) = uint8(INST_JUMP_TRUE4)
			for ok6 := true; ok6; ok6 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1))) = uint8(uint32(jumpDist) >> 24)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1) + uintptr(1))) = uint8(uint32(jumpDist) >> 16)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1) + uintptr(2))) = uint8(uint32(jumpDist) >> 8)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1) + uintptr(3))) = uint8(uint32(jumpDist))
			}
		}
		break
	default:
		for ok7 := true; ok7; ok7 = 0 != 0 {
			*(*uint8)(unsafe.Pointer(jumpPc)) = uint8(INST_JUMP_FALSE4)
			for ok8 := true; ok8; ok8 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1))) = uint8(uint32(jumpDist) >> 24)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1) + uintptr(1))) = uint8(uint32(jumpDist) >> 16)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1) + uintptr(2))) = uint8(uint32(jumpDist) >> 8)
				*(*uint8)(unsafe.Pointer(jumpPc + uintptr(1) + uintptr(3))) = uint8(uint32(jumpDist))
			}
		}
		break
	}

	// Adjust the code offsets for any commands and any ExceptionRange records
	// between the jump and the current code address.

	firstCmd = (*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcmdIndex
	lastCmd = (*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands - 1
	if firstCmd < lastCmd {
		for k = firstCmd; k <= lastCmd; k++ {
			*(*int32)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr + uintptr(k)*16)) += 3
		}
	}

	firstRange = (*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FexceptIndex
	lastRange = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext - 1
	for k = firstRange; k <= lastRange; k++ {
		var rangePtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(k)*28

		*(*int32)(unsafe.Pointer(rangePtr + 8)) += 3
		switch (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype {
		case LOOP_EXCEPTION_RANGE:
			*(*int32)(unsafe.Pointer(rangePtr + 16)) += 3
			if (*ExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset != -1 {
				*(*int32)(unsafe.Pointer(rangePtr + 20)) += 3
			}
			break
		case CATCH_EXCEPTION_RANGE:
			*(*int32)(unsafe.Pointer(rangePtr + 24)) += 3
			break
		default:
			XTcl_Panic(tls, ts+21434,
				libc.VaList(bp, (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype))
		}
	}

	for k = 0; k < (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext; k++ {
		var auxPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(k)*56
		var i int32

		for i = 0; i < (*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets; i++ {
			if (*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcodeOffset < *(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr(i)*4)) {
				*(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr(i)*4)) += uint32(3)
			}
		}
		for i = 0; i < (*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets; i++ {
			if (*JumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcodeOffset < *(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr(i)*4)) {
				*(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr(i)*4)) += uint32(3)
			}
		}
	}

	return 1 // the jump was grown
}

//----------------------------------------------------------------------
//
// TclEmitInvoke --
//
//	Emit one of the invoke-related instructions, wrapping it if necessary
//	in code that ensures that any break or continue operation passing
//	through it gets the stack unwinding correct, converting it into an
//	internal jump if in an appropriate context.
//
// Results:
//	None
//
// Side effects:
//	Issues the jump with all correct stack management. May create another
//	loop exception range; pointers to ExceptionRange and ExceptionAux
//	structures should not be held across this call.
//
//----------------------------------------------------------------------

func XTclEmitInvoke(tls *libc.TLS, envPtr uintptr, opcode int32, va uintptr) { /* tclCompile.c:4065:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var argList Va_list
	_ = argList
	var rangePtr uintptr
	// var auxBreakPtr uintptr at bp+24, 8

	// var auxContinuePtr uintptr at bp+16, 8

	var arg1 int32
	var arg2 int32
	var wordCount int32 = 0
	var expandCount int32 = 0
	var loopRange int32 = 0
	var breakRange int32 = 0
	var continueRange int32 = 0
	var cleanup int32
	var depth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth

	// Parse the arguments.

	argList = va
	switch opcode {
	case INST_INVOKE_STK1:
		wordCount = libc.AssignInt32(&arg1, libc.AssignInt32(&cleanup, int32(libc.VaInt32(&argList))))
		arg2 = 0
		break
	case INST_INVOKE_STK4:
		wordCount = libc.AssignInt32(&arg1, libc.AssignInt32(&cleanup, int32(libc.VaInt32(&argList))))
		arg2 = 0
		break
	case INST_INVOKE_REPLACE:
		arg1 = int32(libc.VaInt32(&argList))
		arg2 = int32(libc.VaInt32(&argList))
		wordCount = arg1 + arg2 - 1
		cleanup = arg1 + 1
		break
	default:
		XTcl_Panic(tls, ts+21482, 0)
		fallthrough
	case INST_EVAL_STK:
		wordCount = libc.AssignInt32(&cleanup, 1)
		arg1 = libc.AssignInt32(&arg2, 0)
		break
	case INST_RETURN_STK:
		wordCount = libc.AssignInt32(&cleanup, 2)
		arg1 = libc.AssignInt32(&arg2, 0)
		break
	case INST_INVOKE_EXPANDED:
		wordCount = libc.AssignInt32(&arg1, libc.AssignInt32(&cleanup, int32(libc.VaInt32(&argList))))
		arg2 = 0
		expandCount = 1
		break
	}
	_ = argList

	// Determine if we need to handle break and continue exceptions with a
	// special handling exception range (so that we can correctly unwind the
	// stack).
	//
	// These must be done separately; they can be different (especially for
	// calls from inside a [for] increment clause).

	rangePtr = XTclGetInnermostExceptionRange(tls, envPtr, TCL_CONTINUE,
		bp+16)
	if rangePtr == uintptr(0) || (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype != LOOP_EXCEPTION_RANGE {
		*(*uintptr)(unsafe.Pointer(bp + 16 /* auxContinuePtr */)) = uintptr(0)
	} else if (*ExceptionAux)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FstackDepth == (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth-wordCount &&
		(*ExceptionAux)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FexpandTarget == (*CompileEnv)(unsafe.Pointer(envPtr)).FexpandCount-expandCount {
		*(*uintptr)(unsafe.Pointer(bp + 16 /* auxContinuePtr */)) = uintptr(0)
	} else {
		continueRange = int32((int64(*(*uintptr)(unsafe.Pointer(bp + 16))) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr)) / 56)
	}

	rangePtr = XTclGetInnermostExceptionRange(tls, envPtr, TCL_BREAK, bp+24)
	if rangePtr == uintptr(0) || (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype != LOOP_EXCEPTION_RANGE {
		*(*uintptr)(unsafe.Pointer(bp + 24 /* auxBreakPtr */)) = uintptr(0)
	} else if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) &&
		(*ExceptionAux)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FstackDepth == (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth-wordCount &&
		(*ExceptionAux)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FexpandTarget == (*CompileEnv)(unsafe.Pointer(envPtr)).FexpandCount-expandCount {
		*(*uintptr)(unsafe.Pointer(bp + 24 /* auxBreakPtr */)) = uintptr(0)
	} else {
		breakRange = int32((int64(*(*uintptr)(unsafe.Pointer(bp + 24))) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr)) / 56)
	}

	if *(*uintptr)(unsafe.Pointer(bp + 24)) != uintptr(0) || *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0) {
		loopRange = XTclCreateExceptRange(tls, LOOP_EXCEPTION_RANGE, envPtr)
		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth++
		(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = func() int32 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth > (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth {
				return (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth
			}
			return (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth
		}()
		(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(loopRange)*28)).FcodeOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	}

	// Issue the invoke itself.

	switch opcode {
	case INST_INVOKE_STK1:
		for ok := true; ok; ok = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INVOKE_STK1)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(arg1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_INVOKE_STK1 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_INVOKE_STK1].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - arg1
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		break
	case INST_INVOKE_STK4:
		for ok3 := true; ok3; ok3 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INVOKE_STK4)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(arg1) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(arg1) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(arg1) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(arg1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_INVOKE_STK4 == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_INVOKE_STK4].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - arg1
					}
					for ok5 := true; ok5; ok5 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		break
	case INST_INVOKE_EXPANDED:
		for ok6 := true; ok6; ok6 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INVOKE_EXPANDED)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_INVOKE_EXPANDED == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_INVOKE_EXPANDED].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		(*CompileEnv)(unsafe.Pointer(envPtr)).FexpandCount--
		for ok9 := true; ok9; ok9 = 0 != 0 {
			if 1-arg1 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += 1 - arg1
		}
		break
	case INST_EVAL_STK:
		for ok10 := true; ok10; ok10 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_EVAL_STK)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_EVAL_STK == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_EVAL_STK].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok12 := true; ok12; ok12 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		break
	case INST_RETURN_STK:
		for ok13 := true; ok13; ok13 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_RETURN_STK)
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_RETURN_STK == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok14 := true; ok14; ok14 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_RETURN_STK].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok15 := true; ok15; ok15 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		break
	case INST_INVOKE_REPLACE:
		for ok16 := true; ok16; ok16 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_INVOKE_REPLACE)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(arg1) >> 24)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(arg1) >> 16)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(arg1) >> 8)
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(arg1))
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
					if INST_INVOKE_REPLACE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok17 := true; ok17; ok17 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_INVOKE_REPLACE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - arg1
					}
					for ok18 := true; ok18; ok18 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
					}
				}
			}
		}
		for ok19 := true; ok19; ok19 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
				XTclExpandCodeArray(tls, envPtr)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(arg2))
		}
		for ok20 := true; ok20; ok20 = 0 != 0 {
			if -1 < 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
				}
			}
			*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
		} // Correction to stack depth calcs
		break
	}

	// If we're generating a special wrapper exception range, we need to
	// finish that up now.

	if *(*uintptr)(unsafe.Pointer(bp + 24)) != uintptr(0) || *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0) {
		var savedStackDepth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
		var savedExpandCount int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FexpandCount
		// var nonTrapFixup JumpFixup at bp+32, 16

		if *(*uintptr)(unsafe.Pointer(bp + 24)) != uintptr(0) {
			*(*uintptr)(unsafe.Pointer(bp + 24 /* auxBreakPtr */)) = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(breakRange)*56
		}
		if *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0) {
			*(*uintptr)(unsafe.Pointer(bp + 16 /* auxContinuePtr */)) = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(continueRange)*56
		}

		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth--
		(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(loopRange)*28)).FnumCodeBytes = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1 - int64((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(loopRange)*28)).FcodeOffset))
		XTclEmitForwardJump(tls, envPtr, TCL_UNCONDITIONAL_JUMP, bp+32)

		// Careful! When generating these stack unwinding sequences, the depth
		// of stack in the cases where they are taken is not the same as if
		// the exception is not taken.

		if *(*uintptr)(unsafe.Pointer(bp + 24)) != uintptr(0) {
			for ok21 := true; ok21; ok21 = 0 != 0 {
				if -1 < 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
					}
				}
				*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
			}

			(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(loopRange)*28)).FbreakOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
			XTclCleanupStackForBreakContinue(tls, envPtr, *(*uintptr)(unsafe.Pointer(bp + 24 /* auxBreakPtr */)))
			XTclAddLoopBreakFixup(tls, envPtr, *(*uintptr)(unsafe.Pointer(bp + 24 /* auxBreakPtr */)))
			for ok22 := true; ok22; ok22 = 0 != 0 {
				if 1 < 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
					}
				}
				*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
			}

			(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = savedStackDepth
			(*CompileEnv)(unsafe.Pointer(envPtr)).FexpandCount = savedExpandCount
		}

		if *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0) {
			for ok23 := true; ok23; ok23 = 0 != 0 {
				if -1 < 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
					}
				}
				*(*int32)(unsafe.Pointer(envPtr + 48)) += -1
			}

			(*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(loopRange)*28)).FcontinueOffset = int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
			XTclCleanupStackForBreakContinue(tls, envPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* auxContinuePtr */)))
			XTclAddLoopContinueFixup(tls, envPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* auxContinuePtr */)))
			for ok24 := true; ok24; ok24 = 0 != 0 {
				if 1 < 0 {
					if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
						(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
					}
				}
				*(*int32)(unsafe.Pointer(envPtr + 48)) += 1
			}

			(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = savedStackDepth
			(*CompileEnv)(unsafe.Pointer(envPtr)).FexpandCount = savedExpandCount
		}

		XTclFinalizeLoopExceptionRange(tls, envPtr, loopRange)
		XTclFixupForwardJump(tls, envPtr, bp+32, int32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))/1-int64((*JumpFixup)(unsafe.Pointer(bp+32)).FcodeOffset)), 127)
	}
	for ok25 := true; ok25; ok25 = 0 != 0 {
		var _dd int32 = depth + 1 - cleanup
		if _dd != (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
			XTcl_Panic(tls, ts+18410, libc.VaList(bp, (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth, _dd))
		}
	}
}

//----------------------------------------------------------------------
//
// TclGetInstructionTable --
//
//	Returns a pointer to the table describing Tcl bytecode instructions.
//	This procedure is defined so that clients can access the pointer from
//	outside the TCL DLLs.
//
// Results:
//	Returns a pointer to the global instruction table, same as the
//	expression (&tclInstructionTable[0]).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetInstructionTable(tls *libc.TLS) uintptr { /* tclCompile.c:4255:12: */
	return uintptr(unsafe.Pointer(&XtclInstructionTable))
}

//----------------------------------------------------------------------
//
// GetCmdLocEncodingSize --
//
//	Computes the total number of bytes needed to encode the command
//	location information for some compiled code.
//
// Results:
//	The byte count needed to encode the compiled location information.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sGetCmdLocEncodingSize(tls *libc.TLS, envPtr uintptr) int32 { /* tclCompile.c:4279:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr
	var numCmds int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands
	var codeDelta int32
	var codeLen int32
	var srcDelta int32
	var srcLen int32
	var codeDeltaNext int32
	var codeLengthNext int32
	var srcDeltaNext int32
	var srcLengthNext int32
	// The offsets in their respective byte
	// sequences where the next encoded offset or
	// length should go.
	var prevCodeOffset int32
	var prevSrcOffset int32
	var i int32

	codeDeltaNext = libc.AssignInt32(&codeLengthNext, libc.AssignInt32(&srcDeltaNext, libc.AssignInt32(&srcLengthNext, 0)))
	prevCodeOffset = libc.AssignInt32(&prevSrcOffset, 0)
	for i = 0; i < numCmds; i++ {
		codeDelta = (*CmdLocation)(unsafe.Pointer(mapPtr+uintptr(i)*16)).FcodeOffset - prevCodeOffset
		if codeDelta < 0 {
			XTcl_Panic(tls, ts+21500, 0)
		} else if codeDelta <= 127 {
			codeDeltaNext++
		} else {
			codeDeltaNext = codeDeltaNext + 5 // 1 byte for 0xFF, 4 for positive delta
		}
		prevCodeOffset = (*CmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*16)).FcodeOffset

		codeLen = (*CmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*16)).FnumCodeBytes
		if codeLen < 0 {
			XTcl_Panic(tls, ts+21539, 0)
		} else if codeLen <= 127 {
			codeLengthNext++
		} else {
			codeLengthNext = codeLengthNext + 5 // 1 byte for 0xFF, 4 for length
		}

		srcDelta = (*CmdLocation)(unsafe.Pointer(mapPtr+uintptr(i)*16)).FsrcOffset - prevSrcOffset
		if -127 <= srcDelta && srcDelta <= 127 && srcDelta != -1 {
			srcDeltaNext++
		} else {
			srcDeltaNext = srcDeltaNext + 5 // 1 byte for 0xFF, 4 for delta
		}
		prevSrcOffset = (*CmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*16)).FsrcOffset

		srcLen = (*CmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*16)).FnumSrcBytes
		if srcLen < 0 {
			XTcl_Panic(tls, ts+21578, 0)
		} else if srcLen <= 127 {
			srcLengthNext++
		} else {
			srcLengthNext = srcLengthNext + 5 // 1 byte for 0xFF, 4 for length
		}
	}

	return codeDeltaNext + codeLengthNext + srcDeltaNext + srcLengthNext
}

//----------------------------------------------------------------------
//
// EncodeCmdLocMap --
//
//	Encode the command location information for some compiled code into a
//	ByteCode structure. The encoded command location map is stored as
//	three adjacent byte sequences.
//
// Results:
//	Pointer to the first byte after the encoded command location
//	information.
//
// Side effects:
//	The encoded information is stored into the block of memory headed by
//	codePtr. Also records pointers to the start of the four byte sequences
//	in fields in codePtr's ByteCode header structure.
//
//----------------------------------------------------------------------

func sEncodeCmdLocMap(tls *libc.TLS, envPtr uintptr, codePtr uintptr, startPtr uintptr) uintptr { /* tclCompile.c:4357:22: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr
	var numCmds int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands
	var p uintptr = startPtr
	var codeDelta int32
	var codeLen int32
	var srcDelta int32
	var srcLen int32
	var prevOffset int32
	var i int32

	// Encode the code offset for each command as a sequence of deltas.

	(*ByteCode)(unsafe.Pointer(codePtr)).FcodeDeltaStart = p
	prevOffset = 0
	for i = 0; i < numCmds; i++ {
		codeDelta = (*CmdLocation)(unsafe.Pointer(mapPtr+uintptr(i)*16)).FcodeOffset - prevOffset
		if codeDelta < 0 {
			XTcl_Panic(tls, ts+21619, 0)
		} else if codeDelta <= 127 {
			*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(codeDelta))
			p++
		} else {
			*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(0xFF))
			p++
			for ok := true; ok; ok = 0 != 0 {
				*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(codeDelta) >> 24)
				*(*uint8)(unsafe.Pointer(p + uintptr(1))) = uint8(uint32(codeDelta) >> 16)
				*(*uint8)(unsafe.Pointer(p + uintptr(2))) = uint8(uint32(codeDelta) >> 8)
				*(*uint8)(unsafe.Pointer(p + uintptr(3))) = uint8(uint32(codeDelta))
			}
			p += uintptr(4)
		}
		prevOffset = (*CmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*16)).FcodeOffset
	}

	// Encode the code length for each command.

	(*ByteCode)(unsafe.Pointer(codePtr)).FcodeLengthStart = p
	for i = 0; i < numCmds; i++ {
		codeLen = (*CmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*16)).FnumCodeBytes
		if codeLen < 0 {
			XTcl_Panic(tls, ts+21652, 0)
		} else if codeLen <= 127 {
			*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(codeLen))
			p++
		} else {
			*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(0xFF))
			p++
			for ok1 := true; ok1; ok1 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(codeLen) >> 24)
				*(*uint8)(unsafe.Pointer(p + uintptr(1))) = uint8(uint32(codeLen) >> 16)
				*(*uint8)(unsafe.Pointer(p + uintptr(2))) = uint8(uint32(codeLen) >> 8)
				*(*uint8)(unsafe.Pointer(p + uintptr(3))) = uint8(uint32(codeLen))
			}
			p += uintptr(4)
		}
	}

	// Encode the source offset for each command as a sequence of deltas.

	(*ByteCode)(unsafe.Pointer(codePtr)).FsrcDeltaStart = p
	prevOffset = 0
	for i = 0; i < numCmds; i++ {
		srcDelta = (*CmdLocation)(unsafe.Pointer(mapPtr+uintptr(i)*16)).FsrcOffset - prevOffset
		if -127 <= srcDelta && srcDelta <= 127 && srcDelta != -1 {
			*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(srcDelta))
			p++
		} else {
			*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(0xFF))
			p++
			for ok2 := true; ok2; ok2 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(srcDelta) >> 24)
				*(*uint8)(unsafe.Pointer(p + uintptr(1))) = uint8(uint32(srcDelta) >> 16)
				*(*uint8)(unsafe.Pointer(p + uintptr(2))) = uint8(uint32(srcDelta) >> 8)
				*(*uint8)(unsafe.Pointer(p + uintptr(3))) = uint8(uint32(srcDelta))
			}
			p += uintptr(4)
		}
		prevOffset = (*CmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*16)).FsrcOffset
	}

	// Encode the source length for each command.

	(*ByteCode)(unsafe.Pointer(codePtr)).FsrcLengthStart = p
	for i = 0; i < numCmds; i++ {
		srcLen = (*CmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*16)).FnumSrcBytes
		if srcLen < 0 {
			XTcl_Panic(tls, ts+21685, 0)
		} else if srcLen <= 127 {
			*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(srcLen))
			p++
		} else {
			*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(0xFF))
			p++
			for ok3 := true; ok3; ok3 = 0 != 0 {
				*(*uint8)(unsafe.Pointer(p)) = uint8(uint32(srcLen) >> 24)
				*(*uint8)(unsafe.Pointer(p + uintptr(1))) = uint8(uint32(srcLen) >> 16)
				*(*uint8)(unsafe.Pointer(p + uintptr(2))) = uint8(uint32(srcLen) >> 8)
				*(*uint8)(unsafe.Pointer(p + uintptr(3))) = uint8(uint32(srcLen))
			}
			p += uintptr(4)
		}
	}

	return p
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Internal structure to hold embedded configuration information.
//
// Our structure is a two-level dictionary associated with the 'interp'. The
// first level is keyed with the package name and maps to the dictionary for
// that package. The package dictionary is keyed with metadata keys and maps
// to the metadata value for that key. This is package specific. The metadata
// values are in UTF-8, converted from the external representation given to us
// by the caller.

// A ClientData struct for the QueryConfig command.  Store the three bits
// of data we need; the package name for which we store a config dict,
// the (Tcl_Interp *) in which it is stored, and the encoding.

type QCCD1 = struct {
	Fpkg      uintptr
	Finterp   uintptr
	Fencoding uintptr
} /* tclConfig.c:34:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Internal structure to hold embedded configuration information.
//
// Our structure is a two-level dictionary associated with the 'interp'. The
// first level is keyed with the package name and maps to the dictionary for
// that package. The package dictionary is keyed with metadata keys and maps
// to the metadata value for that key. This is package specific. The metadata
// values are in UTF-8, converted from the external representation given to us
// by the caller.

// A ClientData struct for the QueryConfig command.  Store the three bits
// of data we need; the package name for which we store a config dict,
// the (Tcl_Interp *) in which it is stored, and the encoding.

type QCCD = QCCD1 /* tclConfig.c:38:3 */

//----------------------------------------------------------------------
//
// Tcl_RegisterConfig --
//
//	See TIP#59 for details on what this function does.
//
// Results:
//	None.
//
// Side effects:
//	Creates namespace and cfg query command in it as per TIP #59.
//
//----------------------------------------------------------------------

func XTcl_RegisterConfig(tls *libc.TLS, interp uintptr, pkgName uintptr, configuration uintptr, valEncoding uintptr) { /* tclConfig.c:69:1: */
	bp := tls.Alloc(264)
	defer tls.Free(264)

	var pDB uintptr
	// var pkgDict uintptr at bp+40, 8

	// var cmdName Tcl_DString at bp+48, 216

	var cfg uintptr
	var cdPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(QCCD{})))

	(*QCCD)(unsafe.Pointer(cdPtr)).Finterp = interp
	if valEncoding != 0 {
		(*QCCD)(unsafe.Pointer(cdPtr)).Fencoding = XTcl_Alloc(tls, uint32(libc.Xstrlen(tls, valEncoding)+uint64(1)))
		libc.Xstrcpy(tls, (*QCCD)(unsafe.Pointer(cdPtr)).Fencoding, valEncoding)
	} else {
		(*QCCD)(unsafe.Pointer(cdPtr)).Fencoding = uintptr(0)
	}
	(*QCCD)(unsafe.Pointer(cdPtr)).Fpkg = XTcl_NewStringObj(tls, pkgName, -1)

	// Phase I: Adding the provided information to the internal database of
	// package meta data.
	//
	// Phase II: Create a command for querying this database, specific to the
	// package registering its configuration. This is the approved interface
	// in TIP 59. In the future a more general interface should be done, as
	// follow-up to TIP 59. Simply because our database is now general across
	// packages, and not a structure tied to one package.
	//
	// Note, the created command will have a reference through its clientdata.

	(*Tcl_Obj)(unsafe.Pointer((*QCCD)(unsafe.Pointer(cdPtr)).Fpkg)).FrefCount++

	// For venc == NULL aka bogus encoding we skip the step setting up the
	// dictionaries visible at Tcl level. I.e. they are not filled

	pDB = sGetConfigDict(tls, interp)

	// Retrieve package specific configuration...

	if XTcl_DictObjGet(tls, interp, pDB, (*QCCD)(unsafe.Pointer(cdPtr)).Fpkg, bp+40) != TCL_OK ||
		*(*uintptr)(unsafe.Pointer(bp + 40)) == uintptr(0) {
		*(*uintptr)(unsafe.Pointer(bp + 40 /* pkgDict */)) = XTcl_NewDictObj(tls)
	} else if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FrefCount > 1 {
		*(*uintptr)(unsafe.Pointer(bp + 40 /* pkgDict */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pkgDict */)))
	}

	// Extend the package configuration...
	// We cannot assume that the encodings are initialized, therefore
	// store the value as-is in a byte array. See Bug [9b2e636361].

	for cfg = configuration; (*Tcl_Config)(unsafe.Pointer(cfg)).Fkey != uintptr(0) && int32(*(*int8)(unsafe.Pointer((*Tcl_Config)(unsafe.Pointer(cfg)).Fkey))) != 0; cfg += 16 {
		XTcl_DictObjPut(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 40 /* pkgDict */)), XTcl_NewStringObj(tls, (*Tcl_Config)(unsafe.Pointer(cfg)).Fkey, -1),
			XTcl_NewByteArrayObj(tls, (*Tcl_Config)(unsafe.Pointer(cfg)).Fvalue, int32(libc.Xstrlen(tls, (*Tcl_Config)(unsafe.Pointer(cfg)).Fvalue))))
	}

	// Write the changes back into the overall database.

	XTcl_DictObjPut(tls, interp, pDB, (*QCCD)(unsafe.Pointer(cdPtr)).Fpkg, *(*uintptr)(unsafe.Pointer(bp + 40 /* pkgDict */)))

	// Now create the interface command for retrieval of the package
	// information.

	XTcl_DStringInit(tls, bp+48)
	XTcl_DStringAppend(tls, bp+48, ts+6847, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
	XTcl_DStringAppend(tls, bp+48, pkgName, -1)

	// The incomplete command name is the name of the namespace to place it
	// in.

	if XTcl_FindNamespace(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp+48)).Fstring, uintptr(0),
		TCL_GLOBAL_ONLY) == uintptr(0) {
		if XTcl_CreateNamespace(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp+48)).Fstring,
			uintptr(0), uintptr(0)) == uintptr(0) {
			XTcl_Panic(tls, ts+21720,
				libc.VaList(bp, XTcl_GetStringResult(tls, interp), ts+21731,
					ts+21750))
		}
	}

	XTcl_DStringAppend(tls, bp+48, ts+21804, int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1)))

	if XTcl_CreateObjCommand(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp+48)).Fstring,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sQueryConfigObjCmd})), cdPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sQueryConfigDelete}))) == uintptr(0) {
		XTcl_Panic(tls, ts+21816, libc.VaList(bp+24, ts+21731,
			ts+21823))
	}

	XTcl_DStringFree(tls, bp+48)
}

//----------------------------------------------------------------------
//
// QueryConfigObjCmd --
//
//	Implementation of "::<package>::pkgconfig", the command to query
//	configuration information embedded into a binary library.
//
// Results:
//	A standard tcl result.
//
// Side effects:
//	See the manual for what this command does.
//
//----------------------------------------------------------------------

func sQueryConfigObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclConfig.c:196:1: */
	bp := tls.Alloc(388)
	defer tls.Free(388)

	var cdPtr uintptr = clientData
	var pkgName uintptr = (*QCCD)(unsafe.Pointer(cdPtr)).Fpkg
	var pDB uintptr
	// var pkgDict uintptr at bp+112, 8

	// var val uintptr at bp+120, 8

	var listPtr uintptr
	// var n int32 at bp+128, 4

	// var index int32 at bp+104, 4

	// var conv Tcl_DString at bp+136, 216

	var venc Tcl_Encoding = uintptr(0)
	var value uintptr

	if objc < 2 || objc > 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+21880)
		return TCL_ERROR
	}
	if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&subcmdStrings)), int32(unsafe.Sizeof(uintptr(0))), ts+21897, 0, bp+104) != TCL_OK {
		return TCL_ERROR
	}

	pDB = sGetConfigDict(tls, interp)
	if XTcl_DictObjGet(tls, interp, pDB, pkgName, bp+112) != TCL_OK ||
		*(*uintptr)(unsafe.Pointer(bp + 112)) == uintptr(0) {
		// Maybe a Tcl_Panic is better, because the package data has to be
		// present.

		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+21908, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+21926, ts+21932,
			XTcl_GetString(tls, pkgName), uintptr(0)))
		return TCL_ERROR
	}

	switch uint32(*(*int32)(unsafe.Pointer(bp + 104 /* index */))) {
	case uint32(0) /* CFG_GET */ :
		if objc != 3 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, ts+21944)
			return TCL_ERROR
		}

		if XTcl_DictObjGet(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 112)), *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+120) != TCL_OK ||
			*(*uintptr)(unsafe.Pointer(bp + 120)) == uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+21948, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7170, ts+21962,
				XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), uintptr(0)))
			return TCL_ERROR
		}

		if (*QCCD)(unsafe.Pointer(cdPtr)).Fencoding != 0 {
			venc = XTcl_GetEncoding(tls, interp, (*QCCD)(unsafe.Pointer(cdPtr)).Fencoding)
			if !(venc != 0) {
				return TCL_ERROR
			}
		}
		// Value is stored as-is in a byte array, see Bug [9b2e636361],
		// so we have to decode it first.
		value = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 120 /* val */)), bp+128)
		value = XTcl_ExternalToUtfDString(tls, venc, value, *(*int32)(unsafe.Pointer(bp + 128 /* n */)), bp+136)
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, value,
			(*Tcl_DString)(unsafe.Pointer(bp+136)).Flength))
		XTcl_DStringFree(tls, bp+136)
		return TCL_OK

	case uint32(1) /* CFG_LIST */ :
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}

		XTcl_DictObjSize(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 112 /* pkgDict */)), bp+128)
		listPtr = XTcl_NewListObj(tls, *(*int32)(unsafe.Pointer(bp + 128 /* n */)), uintptr(0))

		if !(listPtr != 0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+21969, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, ts+3593, ts+14496, uintptr(0)))
			return TCL_ERROR
		}

		if *(*int32)(unsafe.Pointer(bp + 128)) != 0 {
			// var s Tcl_DictSearch at bp+352, 24

			// var key uintptr at bp+376, 8

			// var done int32 at bp+384, 4

			for XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 112 /* pkgDict */)), bp+352, bp+376, uintptr(0), bp+384); !(*(*int32)(unsafe.Pointer(bp + 384 /* done */)) != 0); XTcl_DictObjNext(tls, bp+352 /* &s */, bp+376 /* &key */, uintptr(0), bp+384 /* &done */) {
				XTcl_ListObjAppendElement(tls, uintptr(0), listPtr, *(*uintptr)(unsafe.Pointer(bp + 376 /* key */)))
			}
		}

		XTcl_SetObjResult(tls, interp, listPtr)
		return TCL_OK

	default:
		XTcl_Panic(tls, ts+22004, 0)
		break
	}
	return TCL_ERROR
}

var subcmdStrings = [3]uintptr{
	ts + 22076, ts + 2810, uintptr(0),
} /* tclConfig.c:206:23 */

//-------------------------------------------------------------------------
//
// QueryConfigDelete --
//
//	Command delete function. Cleans up after the configuration query
//	command when it is deleted by the user or during finalization.
//
// Results:
//	None.
//
// Side effects:
//	Deallocates all non-transient memory allocated by Tcl_RegisterConfig.
//
//-------------------------------------------------------------------------

func sQueryConfigDelete(tls *libc.TLS, clientData ClientData) { /* tclConfig.c:326:1: */
	var cdPtr uintptr = clientData
	var pkgName uintptr = (*QCCD)(unsafe.Pointer(cdPtr)).Fpkg
	var pDB uintptr = sGetConfigDict(tls, (*QCCD)(unsafe.Pointer(cdPtr)).Finterp)

	XTcl_DictObjRemove(tls, uintptr(0), pDB, pkgName)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = pkgName
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if (*QCCD)(unsafe.Pointer(cdPtr)).Fencoding != 0 {
		XTclpFree(tls, (*QCCD)(unsafe.Pointer(cdPtr)).Fencoding)
	}
	XTclpFree(tls, cdPtr)
}

//-------------------------------------------------------------------------
//
// GetConfigDict --
//
//	Retrieve the package metadata database from the interpreter.
//	Initializes it, if not present yet.
//
// Results:
//	A Tcl_Obj reference
//
// Side effects:
//	May allocate a Tcl_Obj.
//
//-------------------------------------------------------------------------

func sGetConfigDict(tls *libc.TLS, interp uintptr) uintptr { /* tclConfig.c:358:16: */
	var pDB uintptr = XTcl_GetAssocData(tls, interp, ts+22080, uintptr(0))

	if pDB == uintptr(0) {
		pDB = XTcl_NewDictObj(tls)
		(*Tcl_Obj)(unsafe.Pointer(pDB)).FrefCount++
		XTcl_SetAssocData(tls, interp, ts+22080, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr)
		}{sConfigDictDeleteProc})), pDB)
	}

	return pDB
}

//----------------------------------------------------------------------
//
// ConfigDictDeleteProc --
//
//	This function is associated with the "Package About dict" assoc data
//	for an interpreter; it is invoked when the interpreter is deleted in
//	order to free the information associated with any pending error
//	reports.
//
// Results:
//	None.
//
// Side effects:
//	The package metadata database is freed.
//
//----------------------------------------------------------------------

func sConfigDictDeleteProc(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclConfig.c:393:1: */
	var pDB uintptr = clientData

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = pDB
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Bison generates several labels that happen to be unused. MS Visual C++
// doesn't like that, and complains. Tell it to shut up.

// Meridian: am, pm, or 24-hour style.

type MERIDIAN = uint32 /* tclDate.c:103:3 */

// yyparse will accept a 'struct DateInfo' as its parameter; that's where the
// parsed fields will be returned.

type DateInfo1 = struct {
	Fmessages             uintptr
	Fseparatrix           uintptr
	FdateYear             Time_t
	FdateMonth            Time_t
	FdateDay              Time_t
	FdateHaveDate         int32
	F__ccgo_pad1          [4]byte
	FdateHour             Time_t
	FdateMinutes          Time_t
	FdateSeconds          Time_t
	FdateMeridian         MERIDIAN
	FdateHaveTime         int32
	FdateTimezone         Time_t
	FdateDSTmode          int32
	FdateHaveZone         int32
	FdateRelMonth         Time_t
	FdateRelDay           Time_t
	FdateRelSeconds       Time_t
	FdateHaveRel          int32
	F__ccgo_pad2          [4]byte
	FdateMonthOrdinal     Time_t
	FdateHaveOrdinalMonth int32
	F__ccgo_pad3          [4]byte
	FdateDayOrdinal       Time_t
	FdateDayNumber        Time_t
	FdateHaveDay          int32
	F__ccgo_pad4          [4]byte
	FdateStart            uintptr
	FdateInput            uintptr
	FdateRelPointer       uintptr
	FdateDigitCount       int32
	F__ccgo_pad5          [4]byte
} /* tclDate.c:110:9 */

// yyparse will accept a 'struct DateInfo' as its parameter; that's where the
// parsed fields will be returned.

type DateInfo = DateInfo1 /* tclDate.c:147:3 */

// The offset of tm_year of struct tm returned by localtime, gmtime, etc.
// Posix requires 1900.

// An entry in the lexical lookup table.

type X_TABLE = struct {
	Fname        uintptr
	Ftype        int32
	F__ccgo_pad1 [4]byte
	Fvalue       Time_t
} /* tclDate.c:196:9 */

// The offset of tm_year of struct tm returned by localtime, gmtime, etc.
// Posix requires 1900.

// An entry in the lexical lookup table.

type TABLE = X_TABLE /* tclDate.c:200:3 */

// Daylight-savings mode: on, off, or not yet known.

type DSTMODE = uint32 /* tclDate.c:208:3 */

// Value type.

type YYSTYPE1 = struct{ FNumber Time_t } /* tclDate.c:266:1 */

type YYSTYPE = YYSTYPE1 /* tclDate.c:276:23 */

// Location type.
type YYLTYPE1 = struct {
	Ffirst_line   int32
	Ffirst_column int32
	Flast_line    int32
	Flast_column  int32
} /* tclDate.c:283:9 */

// Location type.
type YYLTYPE = YYLTYPE1 /* tclDate.c:283:24 */

type Yytype_uint8 = uint8 /* tclDate.c:328:23 */

type Yytype_int8 = int8 /* tclDate.c:334:21 */

type Yytype_uint16 = uint16 /* tclDate.c:340:24 */

type Yytype_int16 = int16 /* tclDate.c:346:15 */

// Suppress unused-variable warnings by "using" E.

// Suppress an incorrect diagnostic about yylval being uninitialized.

// The parser invokes alloca or malloc; define the necessary symbols.

// A type that is properly aligned for any stack member.
type Yyalloc = struct {
	F__ccgo_pad1 [0]uint64
	Fyyss_alloc  Yytype_int16
	F__ccgo_pad2 [14]byte
} /* tclDate.c:504:1 */

// The size of the maximum gap between one aligned stack and the next.

// The size of an array large to enough to hold all stacks, each with
//    N elements.

// Relocate STACK from its old location to the new one.  The
//    local variables YYSIZE and YYSTACKSIZE give the old and new number of
//    elements in the stack, and YYPTR gives the new location of the
//    stack.  Advance YYPTR to a properly aligned location for the next
//    stack.

// Copy COUNT objects from SRC to DST.  The source and destination do
//    not overlap.

// YYFINAL -- State number of the termination state.
// YYLAST -- Last index in YYTABLE.

// YYNTOKENS -- Number of terminals.
// YYNNTS -- Number of nonterminals.
// YYNRULES -- Number of rules.
// YYNSTATES -- Number of states.

// YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
//    by yylex, with out-of-bounds checking.

// YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
//    as returned by yylex, without out-of-bounds checking.
var yytranslate = [275]Yytype_uint8{
	Yytype_uint8(0), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(25), Yytype_uint8(21), Yytype_uint8(23), Yytype_uint8(24), Yytype_uint8(22), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(20), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2),
	Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(1), Yytype_uint8(2), Yytype_uint8(3), Yytype_uint8(4),
	Yytype_uint8(5), Yytype_uint8(6), Yytype_uint8(7), Yytype_uint8(8), Yytype_uint8(9), Yytype_uint8(10), Yytype_uint8(11), Yytype_uint8(12), Yytype_uint8(13), Yytype_uint8(14),
	Yytype_uint8(15), Yytype_uint8(16), Yytype_uint8(17), Yytype_uint8(18), Yytype_uint8(19),
} /* tclDate.c:584:27 */

// YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
//      STATE-NUM.
var yypact = [85]Yytype_int8{
	int8(-18), int8(2), int8(-18), int8(-17), int8(-18), int8(-4), int8(-18), int8(10), int8(-18), int8(22),
	int8(8), int8(-18), int8(18), int8(-18), int8(39), int8(-18), int8(-18), int8(-18), int8(-18), int8(-18),
	int8(-18), int8(-18), int8(-18), int8(-18), int8(-18), int8(-18), int8(25), int8(21), int8(-18), int8(-18),
	int8(-18), int8(16), int8(14), int8(-18), int8(-18), int8(28), int8(36), int8(41), int8(-5), int8(-18),
	int8(-18), int8(5), int8(-18), int8(-18), int8(-18), int8(47), int8(-18), int8(-18), int8(42), int8(46),
	int8(48), int8(-18), int8(-6), int8(40), int8(43), int8(44), int8(49), int8(-18), int8(-18), int8(-18),
	int8(-18), int8(-18), int8(-18), int8(-18), int8(-18), int8(50), int8(-18), int8(51), int8(55), int8(57),
	int8(58), int8(65), int8(-18), int8(-18), int8(59), int8(54), int8(-18), int8(62), int8(63), int8(60),
	int8(-18), int8(64), int8(61), int8(66), int8(-18),
} /* tclDate.c:667:26 */

// YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
//      Performed when YYTABLE does not specify something else to do.  Zero
//      means the default is an error.
var yydefact = [85]Yytype_uint8{
	Yytype_uint8(2), Yytype_uint8(0), Yytype_uint8(1), Yytype_uint8(20), Yytype_uint8(18), Yytype_uint8(0), Yytype_uint8(53), Yytype_uint8(0), Yytype_uint8(51), Yytype_uint8(54),
	Yytype_uint8(17), Yytype_uint8(33), Yytype_uint8(27), Yytype_uint8(52), Yytype_uint8(0), Yytype_uint8(49), Yytype_uint8(50), Yytype_uint8(3), Yytype_uint8(4), Yytype_uint8(5),
	Yytype_uint8(8), Yytype_uint8(6), Yytype_uint8(7), Yytype_uint8(10), Yytype_uint8(11), Yytype_uint8(9), Yytype_uint8(43), Yytype_uint8(0), Yytype_uint8(48), Yytype_uint8(12),
	Yytype_uint8(21), Yytype_uint8(30), Yytype_uint8(0), Yytype_uint8(22), Yytype_uint8(13), Yytype_uint8(32), Yytype_uint8(0), Yytype_uint8(0), Yytype_uint8(0), Yytype_uint8(45),
	Yytype_uint8(16), Yytype_uint8(0), Yytype_uint8(40), Yytype_uint8(24), Yytype_uint8(35), Yytype_uint8(0), Yytype_uint8(46), Yytype_uint8(42), Yytype_uint8(19), Yytype_uint8(0),
	Yytype_uint8(0), Yytype_uint8(34), Yytype_uint8(55), Yytype_uint8(25), Yytype_uint8(0), Yytype_uint8(0), Yytype_uint8(0), Yytype_uint8(38), Yytype_uint8(36), Yytype_uint8(47),
	Yytype_uint8(23), Yytype_uint8(44), Yytype_uint8(31), Yytype_uint8(41), Yytype_uint8(56), Yytype_uint8(0), Yytype_uint8(14), Yytype_uint8(0), Yytype_uint8(0), Yytype_uint8(0),
	Yytype_uint8(0), Yytype_uint8(55), Yytype_uint8(26), Yytype_uint8(28), Yytype_uint8(29), Yytype_uint8(0), Yytype_uint8(15), Yytype_uint8(0), Yytype_uint8(0), Yytype_uint8(0),
	Yytype_uint8(39), Yytype_uint8(0), Yytype_uint8(0), Yytype_uint8(0), Yytype_uint8(37),
} /* tclDate.c:683:27 */

// YYPGOTO[NTERM-NUM].
var yypgoto = [16]Yytype_int8{
	int8(-18), int8(-18), int8(-18), int8(-18), int8(-18), int8(-18), int8(-18), int8(-18), int8(-18), int8(-18),
	int8(-18), int8(-18), int8(-18), int8(-9), int8(-18), int8(7),
} /* tclDate.c:697:26 */

// YYDEFGOTO[NTERM-NUM].
var yydefgoto = [16]Yytype_int8{
	int8(-1), int8(1), int8(17), int8(18), int8(19), int8(20), int8(21), int8(22), int8(23), int8(24),
	int8(25), int8(26), int8(27), int8(28), int8(29), int8(66),
} /* tclDate.c:704:26 */

// YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
//      positive, shift that token.  If negative, reduce the rule whose
//      number is the opposite.  If YYTABLE_NINF, syntax error.
var yytable = [82]Yytype_uint8{
	Yytype_uint8(39), Yytype_uint8(64), Yytype_uint8(2), Yytype_uint8(54), Yytype_uint8(30), Yytype_uint8(46), Yytype_uint8(3), Yytype_uint8(4), Yytype_uint8(55), Yytype_uint8(31),
	Yytype_uint8(5), Yytype_uint8(6), Yytype_uint8(7), Yytype_uint8(8), Yytype_uint8(65), Yytype_uint8(9), Yytype_uint8(10), Yytype_uint8(11), Yytype_uint8(56), Yytype_uint8(12),
	Yytype_uint8(13), Yytype_uint8(14), Yytype_uint8(57), Yytype_uint8(32), Yytype_uint8(40), Yytype_uint8(15), Yytype_uint8(33), Yytype_uint8(16), Yytype_uint8(47), Yytype_uint8(34),
	Yytype_uint8(35), Yytype_uint8(6), Yytype_uint8(41), Yytype_uint8(8), Yytype_uint8(48), Yytype_uint8(42), Yytype_uint8(59), Yytype_uint8(49), Yytype_uint8(50), Yytype_uint8(61),
	Yytype_uint8(13), Yytype_uint8(51), Yytype_uint8(36), Yytype_uint8(43), Yytype_uint8(37), Yytype_uint8(38), Yytype_uint8(60), Yytype_uint8(44), Yytype_uint8(6), Yytype_uint8(52),
	Yytype_uint8(8), Yytype_uint8(6), Yytype_uint8(45), Yytype_uint8(8), Yytype_uint8(53), Yytype_uint8(58), Yytype_uint8(6), Yytype_uint8(13), Yytype_uint8(8), Yytype_uint8(62),
	Yytype_uint8(13), Yytype_uint8(63), Yytype_uint8(67), Yytype_uint8(71), Yytype_uint8(72), Yytype_uint8(13), Yytype_uint8(68), Yytype_uint8(69), Yytype_uint8(73), Yytype_uint8(70),
	Yytype_uint8(74), Yytype_uint8(75), Yytype_uint8(64), Yytype_uint8(77), Yytype_uint8(78), Yytype_uint8(79), Yytype_uint8(80), Yytype_uint8(82), Yytype_uint8(76), Yytype_uint8(84),
	Yytype_uint8(81), Yytype_uint8(83),
} /* tclDate.c:713:27 */

var yycheck = [82]Yytype_uint8{
	Yytype_uint8(9), Yytype_uint8(7), Yytype_uint8(0), Yytype_uint8(8), Yytype_uint8(21), Yytype_uint8(14), Yytype_uint8(4), Yytype_uint8(5), Yytype_uint8(13), Yytype_uint8(13),
	Yytype_uint8(8), Yytype_uint8(9), Yytype_uint8(10), Yytype_uint8(11), Yytype_uint8(20), Yytype_uint8(13), Yytype_uint8(14), Yytype_uint8(15), Yytype_uint8(13), Yytype_uint8(17),
	Yytype_uint8(18), Yytype_uint8(19), Yytype_uint8(17), Yytype_uint8(13), Yytype_uint8(16), Yytype_uint8(23), Yytype_uint8(4), Yytype_uint8(25), Yytype_uint8(3), Yytype_uint8(7),
	Yytype_uint8(8), Yytype_uint8(9), Yytype_uint8(14), Yytype_uint8(11), Yytype_uint8(13), Yytype_uint8(17), Yytype_uint8(45), Yytype_uint8(21), Yytype_uint8(24), Yytype_uint8(48),
	Yytype_uint8(18), Yytype_uint8(13), Yytype_uint8(20), Yytype_uint8(4), Yytype_uint8(22), Yytype_uint8(23), Yytype_uint8(4), Yytype_uint8(8), Yytype_uint8(9), Yytype_uint8(13),
	Yytype_uint8(11), Yytype_uint8(9), Yytype_uint8(13), Yytype_uint8(11), Yytype_uint8(13), Yytype_uint8(8), Yytype_uint8(9), Yytype_uint8(18), Yytype_uint8(11), Yytype_uint8(13),
	Yytype_uint8(18), Yytype_uint8(13), Yytype_uint8(22), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(18), Yytype_uint8(23), Yytype_uint8(23), Yytype_uint8(13), Yytype_uint8(20),
	Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(7), Yytype_uint8(14), Yytype_uint8(20), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(71), Yytype_uint8(13),
	Yytype_uint8(20), Yytype_uint8(20),
} /* tclDate.c:726:27 */

// YYSTOS[STATE-NUM] -- The (internal number of the) accessing
//      symbol of state STATE-NUM.
var yystos = [85]Yytype_uint8{
	Yytype_uint8(0), Yytype_uint8(27), Yytype_uint8(0), Yytype_uint8(4), Yytype_uint8(5), Yytype_uint8(8), Yytype_uint8(9), Yytype_uint8(10), Yytype_uint8(11), Yytype_uint8(13),
	Yytype_uint8(14), Yytype_uint8(15), Yytype_uint8(17), Yytype_uint8(18), Yytype_uint8(19), Yytype_uint8(23), Yytype_uint8(25), Yytype_uint8(28), Yytype_uint8(29), Yytype_uint8(30),
	Yytype_uint8(31), Yytype_uint8(32), Yytype_uint8(33), Yytype_uint8(34), Yytype_uint8(35), Yytype_uint8(36), Yytype_uint8(37), Yytype_uint8(38), Yytype_uint8(39), Yytype_uint8(40),
	Yytype_uint8(21), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(4), Yytype_uint8(7), Yytype_uint8(8), Yytype_uint8(20), Yytype_uint8(22), Yytype_uint8(23), Yytype_uint8(39),
	Yytype_uint8(16), Yytype_uint8(14), Yytype_uint8(17), Yytype_uint8(4), Yytype_uint8(8), Yytype_uint8(13), Yytype_uint8(39), Yytype_uint8(3), Yytype_uint8(13), Yytype_uint8(21),
	Yytype_uint8(24), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(8), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(17), Yytype_uint8(8), Yytype_uint8(39),
	Yytype_uint8(4), Yytype_uint8(39), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(7), Yytype_uint8(20), Yytype_uint8(41), Yytype_uint8(22), Yytype_uint8(23), Yytype_uint8(23),
	Yytype_uint8(20), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(13), Yytype_uint8(41), Yytype_uint8(14), Yytype_uint8(20), Yytype_uint8(13),
	Yytype_uint8(13), Yytype_uint8(20), Yytype_uint8(13), Yytype_uint8(20), Yytype_uint8(13),
} /* tclDate.c:741:27 */

// YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
var yyr1 = [57]Yytype_uint8{
	Yytype_uint8(0), Yytype_uint8(26), Yytype_uint8(27), Yytype_uint8(27), Yytype_uint8(28), Yytype_uint8(28), Yytype_uint8(28), Yytype_uint8(28), Yytype_uint8(28), Yytype_uint8(28),
	Yytype_uint8(28), Yytype_uint8(28), Yytype_uint8(28), Yytype_uint8(29), Yytype_uint8(29), Yytype_uint8(29), Yytype_uint8(30), Yytype_uint8(30), Yytype_uint8(30), Yytype_uint8(30),
	Yytype_uint8(31), Yytype_uint8(31), Yytype_uint8(31), Yytype_uint8(31), Yytype_uint8(31), Yytype_uint8(32), Yytype_uint8(32), Yytype_uint8(32), Yytype_uint8(32), Yytype_uint8(32),
	Yytype_uint8(32), Yytype_uint8(32), Yytype_uint8(32), Yytype_uint8(32), Yytype_uint8(32), Yytype_uint8(33), Yytype_uint8(33), Yytype_uint8(34), Yytype_uint8(34), Yytype_uint8(34),
	Yytype_uint8(34), Yytype_uint8(35), Yytype_uint8(36), Yytype_uint8(36), Yytype_uint8(37), Yytype_uint8(37), Yytype_uint8(37), Yytype_uint8(37), Yytype_uint8(37), Yytype_uint8(38),
	Yytype_uint8(38), Yytype_uint8(39), Yytype_uint8(39), Yytype_uint8(39), Yytype_uint8(40), Yytype_uint8(41), Yytype_uint8(41),
} /* tclDate.c:755:27 */

// YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
var yyr2 = [57]Yytype_uint8{
	Yytype_uint8(0), Yytype_uint8(2), Yytype_uint8(0), Yytype_uint8(2), Yytype_uint8(1), Yytype_uint8(1), Yytype_uint8(1), Yytype_uint8(1), Yytype_uint8(1), Yytype_uint8(1),
	Yytype_uint8(1), Yytype_uint8(1), Yytype_uint8(1), Yytype_uint8(2), Yytype_uint8(4), Yytype_uint8(6), Yytype_uint8(2), Yytype_uint8(1), Yytype_uint8(1), Yytype_uint8(2),
	Yytype_uint8(1), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(3), Yytype_uint8(2), Yytype_uint8(3), Yytype_uint8(5), Yytype_uint8(1), Yytype_uint8(5), Yytype_uint8(5),
	Yytype_uint8(2), Yytype_uint8(4), Yytype_uint8(2), Yytype_uint8(1), Yytype_uint8(3), Yytype_uint8(2), Yytype_uint8(3), Yytype_uint8(11), Yytype_uint8(3), Yytype_uint8(7),
	Yytype_uint8(2), Yytype_uint8(4), Yytype_uint8(2), Yytype_uint8(1), Yytype_uint8(3), Yytype_uint8(2), Yytype_uint8(2), Yytype_uint8(3), Yytype_uint8(1), Yytype_uint8(1),
	Yytype_uint8(1), Yytype_uint8(1), Yytype_uint8(1), Yytype_uint8(1), Yytype_uint8(1), Yytype_uint8(0), Yytype_uint8(1),
} /* tclDate.c:766:27 */

// Error token number

// YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
//    If N is 0, then set CURRENT to the empty location which ends
//    the previous symbol: RHS[0] (always defined).

// Enable debugging if requested.

// YYINITDEPTH -- initial size of the parser's stacks.

// YYMAXDEPTH -- maximum size the stacks can grow to (effective only
//    if the built-in stack extension method is used).
//
//    Do not make this value too large; the results are undefined if
//    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
//    evaluated with infinite-precision integer arithmetic.

//-----------------------------------------------.
// | Release the memory associated to this symbol.  |
// `-----------------------------------------------

func yydestruct(tls *libc.TLS, yymsg uintptr, yytype int32, yyvaluep uintptr, yylocationp uintptr, info uintptr) { /* tclDate.c:1256:1: */
	_ = yyvaluep
	_ = yylocationp
	_ = info
	if !(yymsg != 0) {
		yymsg = ts + 22100 /* "Deleting" */
	}

	_ = yytype
}

//----------.
// | yyparse.  |
// `----------

func XTclDateparse(tls *libc.TLS, info uintptr) int32 { /* tclDate.c:1278:1: */
	bp := tls.Alloc(5296)
	defer tls.Free(5296)

	// The lookahead symbol.
	var yychar int32

	// The semantic value of the lookahead symbol.
	// Default value used for initialization, for pacifying older GCCs
	//    or non-GCC compilers.

	// var yylval YYSTYPE at bp+5200, 8

	// var yylloc YYLTYPE at bp+5208, 16

	// Number of syntax errors so far.
	var TclDatenerrs int32
	var yystate int32
	// Number of tokens to shift before error messages enabled.
	var yyerrstatus int32

	// The stacks and their tools:
	//        'yyss': related to states.
	//        'yyvs': related to semantic values.
	//        'yyls': related to locations.
	//
	//        Refer to the stacks through separate pointers, to allow yyoverflow
	//        to reallocate them elsewhere.

	// The state stack.
	// var yyssa [200]Yytype_int16 at bp, 400

	var yyss uintptr
	var yyssp uintptr

	// The semantic value stack.
	// var yyvsa [200]YYSTYPE at bp+400, 1600

	var yyvs uintptr
	var yyvsp uintptr

	// The location stack.
	// var yylsa [200]YYLTYPE at bp+2000, 3200

	var yyls uintptr
	var yylsp uintptr

	// The locations where the error started and ended.
	// var yyerror_range [3]YYLTYPE at bp+5240, 48

	var yystacksize uint64
	var yyn int32
	var yyresult int32
	// Lookahead token as an internal (translated) token number.
	var yytoken int32
	// The variables used to return semantic value and location from the
	//      action routines.
	// var yyval YYSTYPE at bp+5288, 8

	// var yyloc YYLTYPE at bp+5224, 16

	// The number of symbols on the RHS of the reduced rule.
	//      Keep to zero when no symbol should be popped.
	var yylen int32
	var yynewbytes uint64
	var yynewbytes1 uint64
	var yynewbytes2 uint64
	var yyss1 uintptr
	var yyptr uintptr
	// Get the current used size of the three stacks, in elements.
	var yysize uint64
	*(*YYLTYPE)(unsafe.Pointer(bp + 5208 /* yylloc */)) = yyloc_default
	yytoken = 0
	yylen = 0

	yyssp = libc.AssignUintptr(&yyss, bp)
	yyvsp = libc.AssignUintptr(&yyvs, bp+400)
	yylsp = libc.AssignUintptr(&yyls, bp+2000)
	yystacksize = uint64(YYINITDEPTH)

	yystate = 0
	yyerrstatus = 0
	TclDatenerrs = 0
	yychar = -2 // Cause a token to be read.
	*(*YYLTYPE)(unsafe.Pointer(yylsp)) = *(*YYLTYPE)(unsafe.Pointer(bp + 5208 /* yylloc */))
	goto yysetstate

	//------------------------------------------------------------.
	// | yynewstate -- Push a new state, which is found in yystate.  |
	// `------------------------------------------------------------
yynewstate:
	// In all cases, when you get here, the value and location stacks
	//      have just been pushed.  So pushing a state here evens the stacks.
	yyssp += 2

yysetstate:
	*(*Yytype_int16)(unsafe.Pointer(yyssp)) = Yytype_int16(yystate)

	if !(yyss+uintptr(yystacksize)*2-uintptr(1)*2 <= yyssp) {
		goto __1
	}

	// Get the current used size of the three stacks, in elements.
	yysize = uint64((int64(yyssp)-int64(yyss))/2 + int64(1))

	// Extend the stack our own way.
	if !(uint64(YYMAXDEPTH) <= yystacksize) {
		goto __2
	}
	goto yyexhaustedlab
__2:
	;
	yystacksize = yystacksize * uint64(2)
	if !(uint64(YYMAXDEPTH) < yystacksize) {
		goto __3
	}
	yystacksize = uint64(YYMAXDEPTH)
__3:
	;

	yyss1 = yyss
	yyptr =
		XTcl_Alloc(tls, uint32(yystacksize*(uint64(unsafe.Sizeof(Yytype_int16(0)))+uint64(unsafe.Sizeof(YYSTYPE{}))+uint64(unsafe.Sizeof(YYLTYPE{})))+uint64(2)*(uint64(unsafe.Sizeof(Yyalloc{}))-uint64(1))))
	if !!(yyptr != 0) {
		goto __4
	}
	goto yyexhaustedlab
__4:
	;
__5:
	libc.X__builtin_memcpy(tls, yyptr, yyss, yysize*uint64(unsafe.Sizeof(Yytype_int16(0))))
	yyss = yyptr
	yynewbytes = yystacksize*uint64(unsafe.Sizeof(Yytype_int16(0))) + (uint64(unsafe.Sizeof(Yyalloc{})) - uint64(1))
	yyptr += 16 * uintptr(yynewbytes/uint64(unsafe.Sizeof(Yyalloc{})))
	goto __6
__6:
	if 0 != 0 {
		goto __5
	}
	goto __7
__7:
	;
__8:
	libc.X__builtin_memcpy(tls, yyptr, yyvs, yysize*uint64(unsafe.Sizeof(YYSTYPE{})))
	yyvs = yyptr
	yynewbytes1 = yystacksize*uint64(unsafe.Sizeof(YYSTYPE{})) + (uint64(unsafe.Sizeof(Yyalloc{})) - uint64(1))
	yyptr += 16 * uintptr(yynewbytes1/uint64(unsafe.Sizeof(Yyalloc{})))
	goto __9
__9:
	if 0 != 0 {
		goto __8
	}
	goto __10
__10:
	;
__11:
	libc.X__builtin_memcpy(tls, yyptr, yyls, yysize*uint64(unsafe.Sizeof(YYLTYPE{})))
	yyls = yyptr
	yynewbytes2 = yystacksize*uint64(unsafe.Sizeof(YYLTYPE{})) + (uint64(unsafe.Sizeof(Yyalloc{})) - uint64(1))
	yyptr += 16 * uintptr(yynewbytes2/uint64(unsafe.Sizeof(Yyalloc{})))
	goto __12
__12:
	if 0 != 0 {
		goto __11
	}
	goto __13
__13:
	;
	if !(yyss1 != bp) {
		goto __14
	}
	XTclpFree(tls, yyss1)
__14:
	;

	yyssp = yyss + uintptr(yysize)*2 - uintptr(1)*2
	yyvsp = yyvs + uintptr(yysize)*8 - uintptr(1)*8
	yylsp = yyls + uintptr(yysize)*16 - uintptr(1)*16

	if !(yyss+uintptr(yystacksize)*2-uintptr(1)*2 <= yyssp) {
		goto __15
	}
	goto yyabortlab
__15:
	;
__1:
	;

	if !(yystate == YYFINAL) {
		goto __16
	}
	goto yyacceptlab
__16:
	;

	goto yybackup

	//-----------.
	// | yybackup.  |
	// `-----------
yybackup:

	// Do appropriate processing given the current state.  Read a
	//      lookahead token if we need one and don't already have one.

	// First try to decide what to do without reference to lookahead token.
	yyn = int32(yypact[yystate])
	if !!!(yyn == -18) {
		goto __17
	}
	goto yydefault
__17:
	;

	// Not known => get a lookahead token if don't already have one.

	// YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.
	if !(yychar == -2) {
		goto __18
	}

	yychar = sTclDatelex(tls, bp+5200, bp+5208, info)
__18:
	;

	if !(yychar <= YYEOF) {
		goto __19
	}

	yychar = libc.AssignInt32(&yytoken, YYEOF)

	goto __20
__19:

	yytoken = func() int32 {
		if uint32(yychar) <= uint32(YYMAXUTOK) {
			return int32(yytranslate[yychar])
		}
		return YYUNDEFTOK
	}()

__20:
	;

	// If the proper action on seeing token YYTOKEN is to reduce or to
	//      detect an error, take that action.
	yyn = yyn + yytoken
	if !(yyn < 0 || YYLAST < yyn || int32(yycheck[yyn]) != yytoken) {
		goto __21
	}
	goto yydefault
__21:
	;
	yyn = int32(yytable[yyn])
	if !(yyn <= 0) {
		goto __22
	}

	if !(0 != 0) {
		goto __23
	}
	goto yyerrlab
__23:
	;
	yyn = -yyn
	goto yyreduce
__22:
	;

	// Count tokens shifted since error; after three, turn off error
	//      status.
	if !(yyerrstatus != 0) {
		goto __24
	}
	yyerrstatus--
__24:
	;

	// Shift the lookahead token.

	// Discard the shifted token.
	yychar = -2

	yystate = yyn
	*(*YYSTYPE)(unsafe.Pointer(libc.PreIncUintptr(&yyvsp, 8))) = *(*YYSTYPE)(unsafe.Pointer(bp + 5200 /* yylval */))
	*(*YYLTYPE)(unsafe.Pointer(libc.PreIncUintptr(&yylsp, 16))) = *(*YYLTYPE)(unsafe.Pointer(bp + 5208 /* yylloc */))
	goto yynewstate

	//-----------------------------------------------------------.
	// | yydefault -- do the default action for the current state.  |
	// `-----------------------------------------------------------
yydefault:
	yyn = int32(yydefact[yystate])
	if !(yyn == 0) {
		goto __25
	}
	goto yyerrlab
__25:
	;
	goto yyreduce

	//-----------------------------.
	// | yyreduce -- Do a reduction.  |
	// `-----------------------------
yyreduce:
	// yyn is the number of a rule to reduce with.
	yylen = int32(yyr2[yyn])

	// If YYLEN is nonzero, implement the default value of the action:
	//      '$$ = $1'.
	//
	//      Otherwise, the following line sets YYVAL to garbage.
	//      This behavior is undocumented and Bison
	//      users should not rely upon it.  Assigning to YYVAL
	//      unconditionally makes the parser a bit smaller, and it avoids a
	//      GCC warning that YYVAL may be used uninitialized.
	*(*YYSTYPE)(unsafe.Pointer(bp + 5288 /* yyval */)) = *(*YYSTYPE)(unsafe.Pointer(yyvsp + uintptr(1-yylen)*8))

	// Default location.
__26:
	if !(yylen != 0) {
		goto __29
	}
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Ffirst_line = (*YYLTYPE)(unsafe.Pointer(yylsp - uintptr(yylen)*16 + 1*16)).Ffirst_line
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Ffirst_column = (*YYLTYPE)(unsafe.Pointer(yylsp - uintptr(yylen)*16 + 1*16)).Ffirst_column
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Flast_line = (*YYLTYPE)(unsafe.Pointer(yylsp - uintptr(yylen)*16 + uintptr(yylen)*16)).Flast_line
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Flast_column = (*YYLTYPE)(unsafe.Pointer(yylsp - uintptr(yylen)*16 + uintptr(yylen)*16)).Flast_column
	goto __30
__29:
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Ffirst_line = libc.AssignPtrInt32(bp+5224+8, (*YYLTYPE)(unsafe.Pointer(yylsp-uintptr(yylen)*16)).Flast_line)
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Ffirst_column = libc.AssignPtrInt32(bp+5224+12, (*YYLTYPE)(unsafe.Pointer(yylsp-uintptr(yylen)*16)).Flast_column)
__30:
	;
	goto __27
__27:
	if 0 != 0 {
		goto __26
	}
	goto __28
__28:
	;
	*(*YYLTYPE)(unsafe.Pointer(bp + 5240 + 1*16)) = *(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* yyloc */))

	switch yyn {
	case 4:
		goto __32

	case 5:
		goto __33

	case 6:
		goto __34

	case 7:
		goto __35

	case 8:
		goto __36

	case 9:
		goto __37

	case 10:
		goto __38

	case 11:
		goto __39

	case 13:
		goto __40

	case 14:
		goto __41

	case 15:
		goto __42

	case 16:
		goto __43

	case 17:
		goto __44

	case 18:
		goto __45

	case 19:
		goto __46

	case 20:
		goto __47

	case 21:
		goto __48

	case 22:
		goto __49

	case 23:
		goto __50

	case 24:
		goto __51

	case 25:
		goto __52

	case 26:
		goto __53

	case 27:
		goto __54

	case 28:
		goto __55

	case 29:
		goto __56

	case 30:
		goto __57

	case 31:
		goto __58

	case 32:
		goto __59

	case 33:
		goto __60

	case 34:
		goto __61

	case 35:
		goto __62

	case 36:
		goto __63

	case 37:
		goto __64

	case 38:
		goto __65

	case 39:
		goto __66

	case 40:
		goto __67

	case 41:
		goto __68

	case 42:
		goto __69

	case 44:
		goto __70

	case 45:
		goto __71

	case 46:
		goto __72

	case 47:
		goto __73

	case 48:
		goto __74

	case 49:
		goto __75

	case 50:
		goto __76

	case 51:
		goto __77

	case 52:
		goto __78

	case 53:
		goto __79

	case 54:
		goto __80

	case 55:
		goto __81

	case 56:
		goto __82

	default:
		goto __83
	}
	goto __31

__32:

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveTime++

	goto __31

__33:

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveZone++

	goto __31

__34:

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveDate++

	goto __31

__35:

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveOrdinalMonth++

	goto __31

__36:

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveDay++

	goto __31

__37:

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveRel++

	goto __31

__38:

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveTime++
	(*DateInfo)(unsafe.Pointer(info)).FdateHaveDate++

	goto __31

__39:

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveTime++
	(*DateInfo)(unsafe.Pointer(info)).FdateHaveDate++
	(*DateInfo)(unsafe.Pointer(info)).FdateHaveRel++

	goto __31

__40:

	(*DateInfo)(unsafe.Pointer(info)).FdateHour = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateMinutes = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateSeconds = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateMeridian = MERIDIAN(*(*uint32)(unsafe.Pointer(yyvsp)))

	goto __31

__41:

	(*DateInfo)(unsafe.Pointer(info)).FdateHour = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-3)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateMinutes = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateSeconds = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateMeridian = MERIDIAN(*(*uint32)(unsafe.Pointer(yyvsp)))

	goto __31

__42:

	(*DateInfo)(unsafe.Pointer(info)).FdateHour = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-5)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateMinutes = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-3)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateSeconds = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateMeridian = MERIDIAN(*(*uint32)(unsafe.Pointer(yyvsp)))

	goto __31

__43:

	(*DateInfo)(unsafe.Pointer(info)).FdateTimezone = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8))
	if !((*DateInfo)(unsafe.Pointer(info)).FdateTimezone > Time_t(60*12)) {
		goto __84
	}
	*(*Time_t)(unsafe.Pointer(info + 80)) -= Time_t(60 * 100)
__84:
	;
	(*DateInfo)(unsafe.Pointer(info)).FdateDSTmode = DSTon

	goto __31

__44:

	(*DateInfo)(unsafe.Pointer(info)).FdateTimezone = *(*Time_t)(unsafe.Pointer(yyvsp))
	if !((*DateInfo)(unsafe.Pointer(info)).FdateTimezone > Time_t(60*12)) {
		goto __85
	}
	*(*Time_t)(unsafe.Pointer(info + 80)) -= Time_t(60 * 100)
__85:
	;
	(*DateInfo)(unsafe.Pointer(info)).FdateDSTmode = DSToff

	goto __31

__45:

	(*DateInfo)(unsafe.Pointer(info)).FdateTimezone = *(*Time_t)(unsafe.Pointer(yyvsp))
	(*DateInfo)(unsafe.Pointer(info)).FdateDSTmode = DSTon

	goto __31

__46:

	(*DateInfo)(unsafe.Pointer(info)).FdateTimezone = -*(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8)) * (*(*Time_t)(unsafe.Pointer(yyvsp))%int64(100) + *(*Time_t)(unsafe.Pointer(yyvsp))/int64(100)*int64(60))
	(*DateInfo)(unsafe.Pointer(info)).FdateDSTmode = DSToff

	goto __31

__47:

	(*DateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = int64(1)
	(*DateInfo)(unsafe.Pointer(info)).FdateDayNumber = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__48:

	(*DateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = int64(1)
	(*DateInfo)(unsafe.Pointer(info)).FdateDayNumber = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8))

	goto __31

__49:

	(*DateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateDayNumber = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__50:

	(*DateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8)) * *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateDayNumber = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__51:

	(*DateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = int64(2)
	(*DateInfo)(unsafe.Pointer(info)).FdateDayNumber = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__52:

	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__53:

	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-4)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__54:

	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp)) / int64(10000)
	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp)) % int64(10000) / int64(100)
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp)) % int64(100)

	goto __31

__55:

	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-4)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__56:

	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp))
	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-4)*8))

	goto __31

__57:

	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__58:

	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-3)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__59:

	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp))
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8))

	goto __31

__60:

	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = int64(1)
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = int64(1)
	(*DateInfo)(unsafe.Pointer(info)).FdateYear = int64(EPOCH)

	goto __31

__61:

	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__62:

	(*DateInfo)(unsafe.Pointer(info)).FdateMonthOrdinal = int64(1)
	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__63:

	(*DateInfo)(unsafe.Pointer(info)).FdateMonthOrdinal = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__64:

	if !(*(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-5)*8)) != int64(60*7+60*100)) {
		goto __86
	}
	goto yyabortlab
__86:
	;
	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-10)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-8)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-6)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateHour = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-4)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateMinutes = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateSeconds = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__65:

	if !(*(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8)) != int64(60*7+60*100)) {
		goto __87
	}
	goto yyabortlab
__87:
	;
	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8)) / int64(10000)
	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8)) % int64(10000) / int64(100)
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8)) % int64(100)
	(*DateInfo)(unsafe.Pointer(info)).FdateHour = *(*Time_t)(unsafe.Pointer(yyvsp)) / int64(10000)
	(*DateInfo)(unsafe.Pointer(info)).FdateMinutes = *(*Time_t)(unsafe.Pointer(yyvsp)) % int64(10000) / int64(100)
	(*DateInfo)(unsafe.Pointer(info)).FdateSeconds = *(*Time_t)(unsafe.Pointer(yyvsp)) % int64(100)

	goto __31

__66:

	if !(*(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-5)*8)) != int64(60*7+60*100)) {
		goto __88
	}
	goto yyabortlab
__88:
	;
	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-6)*8)) / int64(10000)
	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-6)*8)) % int64(10000) / int64(100)
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-6)*8)) % int64(100)
	(*DateInfo)(unsafe.Pointer(info)).FdateHour = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-4)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateMinutes = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8))
	(*DateInfo)(unsafe.Pointer(info)).FdateSeconds = *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__67:

	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8)) / int64(10000)
	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8)) % int64(10000) / int64(100)
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8)) % int64(100)
	(*DateInfo)(unsafe.Pointer(info)).FdateHour = *(*Time_t)(unsafe.Pointer(yyvsp)) / int64(10000)
	(*DateInfo)(unsafe.Pointer(info)).FdateMinutes = *(*Time_t)(unsafe.Pointer(yyvsp)) % int64(10000) / int64(100)
	(*DateInfo)(unsafe.Pointer(info)).FdateSeconds = *(*Time_t)(unsafe.Pointer(yyvsp)) % int64(100)

	goto __31

__68:

	// Offset computed year by -377 so that the returned years will be
	// in a range accessible with a 32 bit clock seconds value.

	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8))/int64(1000) + int64(2323) - int64(377)
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = int64(1)
	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = int64(1)
	*(*Time_t)(unsafe.Pointer(info + 104)) += *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8)) % int64(1000) * Time_t(365+libc.Bool32((*DateInfo)(unsafe.Pointer(info)).FdateYear%int64(4) == int64(0) && ((*DateInfo)(unsafe.Pointer(info)).FdateYear%int64(100) != int64(0) || (*DateInfo)(unsafe.Pointer(info)).FdateYear%int64(400) == int64(0)))) / int64(1000)
	*(*Time_t)(unsafe.Pointer(info + 112)) += *(*Time_t)(unsafe.Pointer(yyvsp)) * int64(144) * int64(60)

	goto __31

__69:

	*(*Time_t)(unsafe.Pointer(info + 112)) *= int64(-1)
	*(*Time_t)(unsafe.Pointer(info + 96)) *= int64(-1)
	*(*Time_t)(unsafe.Pointer(info + 104)) *= int64(-1)

	goto __31

__70:

	*(*Time_t)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(info)).FdateRelPointer)) += *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-2)*8)) * *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8)) * *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__71:

	*(*Time_t)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(info)).FdateRelPointer)) += *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8)) * *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__72:

	*(*Time_t)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(info)).FdateRelPointer)) += *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__73:

	*(*Time_t)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(info)).FdateRelPointer)) += *(*Time_t)(unsafe.Pointer(yyvsp + libc.UintptrFromInt32(-1)*8)) * *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__74:

	*(*Time_t)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(info)).FdateRelPointer)) += *(*Time_t)(unsafe.Pointer(yyvsp))

	goto __31

__75:

	*(*Time_t)(unsafe.Pointer(bp + 5288)) = int64(-1)

	goto __31

__76:

	*(*Time_t)(unsafe.Pointer(bp + 5288)) = int64(1)

	goto __31

__77:

	*(*Time_t)(unsafe.Pointer(bp + 5288)) = *(*Time_t)(unsafe.Pointer(yyvsp))
	(*DateInfo)(unsafe.Pointer(info)).FdateRelPointer = info + 112

	goto __31

__78:

	*(*Time_t)(unsafe.Pointer(bp + 5288)) = *(*Time_t)(unsafe.Pointer(yyvsp))
	(*DateInfo)(unsafe.Pointer(info)).FdateRelPointer = info + 104

	goto __31

__79:

	*(*Time_t)(unsafe.Pointer(bp + 5288)) = *(*Time_t)(unsafe.Pointer(yyvsp))
	(*DateInfo)(unsafe.Pointer(info)).FdateRelPointer = info + 96

	goto __31

__80:

	if !((*DateInfo)(unsafe.Pointer(info)).FdateHaveTime != 0 && (*DateInfo)(unsafe.Pointer(info)).FdateHaveDate != 0 && !((*DateInfo)(unsafe.Pointer(info)).FdateHaveRel != 0)) {
		goto __89
	}
	(*DateInfo)(unsafe.Pointer(info)).FdateYear = *(*Time_t)(unsafe.Pointer(yyvsp))
	goto __90
__89:
	(*DateInfo)(unsafe.Pointer(info)).FdateHaveTime++
	if !((*DateInfo)(unsafe.Pointer(info)).FdateDigitCount <= 2) {
		goto __91
	}
	(*DateInfo)(unsafe.Pointer(info)).FdateHour = *(*Time_t)(unsafe.Pointer(yyvsp))
	(*DateInfo)(unsafe.Pointer(info)).FdateMinutes = int64(0)
	goto __92
__91:
	(*DateInfo)(unsafe.Pointer(info)).FdateHour = *(*Time_t)(unsafe.Pointer(yyvsp)) / int64(100)
	(*DateInfo)(unsafe.Pointer(info)).FdateMinutes = *(*Time_t)(unsafe.Pointer(yyvsp)) % int64(100)
__92:
	;
	(*DateInfo)(unsafe.Pointer(info)).FdateSeconds = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateMeridian = MER24
__90:
	;

	goto __31

__81:

	*(*uint32)(unsafe.Pointer(bp + 5288)) = MER24

	goto __31

__82:

	*(*uint32)(unsafe.Pointer(bp + 5288)) = *(*uint32)(unsafe.Pointer(yyvsp))

	goto __31

__83:
	goto __31
__31:
	;
	// User semantic actions sometimes alter yychar, and that requires
	//      that yytoken be updated with the new translation.  We take the
	//      approach of translating immediately before every use of yytoken.
	//      One alternative is translating here after every semantic action,
	//      but that translation would be missed if the semantic action invokes
	//      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
	//      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
	//      incorrect destructor might then be invoked immediately.  In the
	//      case of YYERROR or YYBACKUP, subsequent parser actions might lead
	//      to an incorrect destructor call or verbose syntax error message
	//      before the lookahead is translated.

	yyvsp -= 8 * uintptr(yylen)
	yyssp -= 2 * uintptr(yylen)
	yylsp -= 16 * uintptr(yylen)
	yylen = 0

	*(*YYSTYPE)(unsafe.Pointer(libc.PreIncUintptr(&yyvsp, 8))) = *(*YYSTYPE)(unsafe.Pointer(bp + 5288 /* yyval */))
	*(*YYLTYPE)(unsafe.Pointer(libc.PreIncUintptr(&yylsp, 16))) = *(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* yyloc */))

	// Now 'shift' the result of the reduction.  Determine what state
	//      that goes to, based on the state we popped back to and the rule
	//      number reduced by.

	yyn = int32(yyr1[yyn])

	yystate = int32(yypgoto[yyn-YYNTOKENS]) + int32(*(*Yytype_int16)(unsafe.Pointer(yyssp)))
	if !(0 <= yystate && yystate <= YYLAST && int32(yycheck[yystate]) == int32(*(*Yytype_int16)(unsafe.Pointer(yyssp)))) {
		goto __93
	}
	yystate = int32(yytable[yystate])
	goto __94
__93:
	yystate = int32(yydefgoto[yyn-YYNTOKENS])
__94:
	;

	goto yynewstate

	//--------------------------------------.
	// | yyerrlab -- here on detecting error.  |
	// `--------------------------------------
yyerrlab:
	// Make sure we have latest lookahead translation.  See comments at
	//      user semantic actions for why this is necessary.
	if yychar == -2 {
		yytoken = -2
	} else {
		yytoken = func() int32 {
			if uint32(yychar) <= uint32(YYMAXUTOK) {
				return int32(yytranslate[yychar])
			}
			return YYUNDEFTOK
		}()
	}

	// If not already recovering from an error, report this error.
	if !!(yyerrstatus != 0) {
		goto __95
	}

	TclDatenerrs++
	sTclDateerror(tls, bp+5208, info, ts+22109)
__95:
	;

	*(*YYLTYPE)(unsafe.Pointer(bp + 5240 + 1*16)) = *(*YYLTYPE)(unsafe.Pointer(bp + 5208 /* yylloc */))

	if !(yyerrstatus == 3) {
		goto __96
	}

	// If just tried and failed to reuse lookahead token after an
	//          error, discard it.

	if !(yychar <= YYEOF) {
		goto __97
	}

	// Return failure if at end of input.
	if !(yychar == YYEOF) {
		goto __99
	}
	goto yyabortlab
__99:
	;
	goto __98
__97:

	yydestruct(tls, ts+22122,
		yytoken, bp+5200, bp+5208, info)
	yychar = -2
__98:
	;
__96:
	;

	// Else will try to reuse lookahead token after shifting the error
	//      token.
	goto yyerrlab1

	//---------------------------------------------------.
	// | yyerrorlab -- error raised explicitly by YYERROR.  |
	// `---------------------------------------------------
yyerrorlab:

	// Pacify compilers like GCC when the user code never invokes
	//      YYERROR and the label yyerrorlab therefore never appears in user
	//      code.
	if !(0 != 0) {
		goto __100
	}
	goto yyerrorlab
__100:
	;

	// Do not reclaim the symbols of the rule whose action triggered
	//      this YYERROR.
	yyvsp -= 8 * uintptr(yylen)
	yyssp -= 2 * uintptr(yylen)
	yylsp -= 16 * uintptr(yylen)
	yylen = 0

	yystate = int32(*(*Yytype_int16)(unsafe.Pointer(yyssp)))
	goto yyerrlab1

	//-------------------------------------------------------------.
	// | yyerrlab1 -- common code for both syntax error and YYERROR.  |
	// `-------------------------------------------------------------
yyerrlab1:
	yyerrstatus = 3 // Each real token shifted decrements this.

__101:

	yyn = int32(yypact[yystate])
	if !!!!(yyn == -18) {
		goto __104
	}

	yyn = yyn + YYTERROR
	if !(0 <= yyn && yyn <= YYLAST && int32(yycheck[yyn]) == YYTERROR) {
		goto __105
	}

	yyn = int32(yytable[yyn])
	if !(0 < yyn) {
		goto __106
	}
	goto __103
__106:
	;
__105:
	;
__104:
	;

	// Pop the current state because it cannot handle the error token.
	if !(yyssp == yyss) {
		goto __107
	}
	goto yyabortlab
__107:
	;

	*(*YYLTYPE)(unsafe.Pointer(bp + 5240 + 1*16)) = *(*YYLTYPE)(unsafe.Pointer(yylsp))
	yydestruct(tls, ts+22140,
		int32(yystos[yystate]), yyvsp, yylsp, info)
	yyvsp -= 8 * uintptr(1)
	yyssp -= 2 * uintptr(1)
	yylsp -= 16 * uintptr(1)
	yystate = int32(*(*Yytype_int16)(unsafe.Pointer(yyssp)))

	goto __102
__102:
	goto __101
	goto __103
__103:
	;

	*(*YYSTYPE)(unsafe.Pointer(libc.PreIncUintptr(&yyvsp, 8))) = *(*YYSTYPE)(unsafe.Pointer(bp + 5200 /* yylval */))

	*(*YYLTYPE)(unsafe.Pointer(bp + 5240 + 2*16)) = *(*YYLTYPE)(unsafe.Pointer(bp + 5208 /* yylloc */))
	// Using YYLLOC is tempting, but would change the location of
	//      the lookahead.  YYLOC is available though.
__108:
	if !(2 != 0) {
		goto __111
	}
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Ffirst_line = (*YYLTYPE)(unsafe.Pointer(bp + 5240 + 1*16)).Ffirst_line
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Ffirst_column = (*YYLTYPE)(unsafe.Pointer(bp + 5240 + 1*16)).Ffirst_column
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Flast_line = (*YYLTYPE)(unsafe.Pointer(bp + 5240 + 2*16)).Flast_line
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Flast_column = (*YYLTYPE)(unsafe.Pointer(bp + 5240 + 2*16)).Flast_column
	goto __112
__111:
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Ffirst_line = libc.AssignPtrInt32(bp+5224+8, (*YYLTYPE)(unsafe.Pointer(bp+5240)).Flast_line)
	(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* &yyloc */)).Ffirst_column = libc.AssignPtrInt32(bp+5224+12, (*YYLTYPE)(unsafe.Pointer(bp+5240)).Flast_column)
__112:
	;
	goto __109
__109:
	if 0 != 0 {
		goto __108
	}
	goto __110
__110:
	;
	*(*YYLTYPE)(unsafe.Pointer(libc.PreIncUintptr(&yylsp, 16))) = *(*YYLTYPE)(unsafe.Pointer(bp + 5224 /* yyloc */))

	// Shift the error token.

	yystate = yyn
	goto yynewstate

	//-------------------------------------.
	// | yyacceptlab -- YYACCEPT comes here.  |
	// `-------------------------------------
yyacceptlab:
	yyresult = 0
	goto yyreturn

	//-----------------------------------.
	// | yyabortlab -- YYABORT comes here.  |
	// `-----------------------------------
yyabortlab:
	yyresult = 1
	goto yyreturn

	//-------------------------------------------------.
	// | yyexhaustedlab -- memory exhaustion comes here.  |
	// `-------------------------------------------------
yyexhaustedlab:
	sTclDateerror(tls, bp+5208, info, ts+22155)
	yyresult = 2
	// Fall through.

yyreturn:
	if !(yychar != -2) {
		goto __113
	}

	// Make sure we have latest lookahead translation.  See comments at
	//          user semantic actions for why this is necessary.
	yytoken = func() int32 {
		if uint32(yychar) <= uint32(YYMAXUTOK) {
			return int32(yytranslate[yychar])
		}
		return YYUNDEFTOK
	}()
	yydestruct(tls, ts+22172,
		yytoken, bp+5200, bp+5208, info)
__113:
	;
	// Do not reclaim the symbols of the rule whose action triggered
	//      this YYABORT or YYACCEPT.
	yyvsp -= 8 * uintptr(yylen)
	yyssp -= 2 * uintptr(yylen)
	yylsp -= 16 * uintptr(yylen)

__114:
	if !(yyssp != yyss) {
		goto __115
	}

	yydestruct(tls, ts+22202,
		int32(yystos[*(*Yytype_int16)(unsafe.Pointer(yyssp))]), yyvsp, yylsp, info)
	yyvsp -= 8 * uintptr(1)
	yyssp -= 2 * uintptr(1)
	yylsp -= 16 * uintptr(1)
	goto __114
__115:
	;
	if !(yyss != bp) {
		goto __116
	}
	XTclpFree(tls, yyss)
__116:
	;
	return yyresult
}

var yyloc_default = YYLTYPE{Ffirst_line: 1, Ffirst_column: 1, Flast_line: 1, Flast_column: 1} /* tclDate.c:1291:16 */

// Month and day table.

var sMonthDayTable = [25]TABLE{
	{Fname: ts + 22219, Ftype: TMONTH, Fvalue: int64(1)},
	{Fname: ts + 22227, Ftype: TMONTH, Fvalue: int64(2)},
	{Fname: ts + 22236, Ftype: TMONTH, Fvalue: int64(3)},
	{Fname: ts + 22242, Ftype: TMONTH, Fvalue: int64(4)},
	{Fname: ts + 22248, Ftype: TMONTH, Fvalue: int64(5)},
	{Fname: ts + 22252, Ftype: TMONTH, Fvalue: int64(6)},
	{Fname: ts + 22257, Ftype: TMONTH, Fvalue: int64(7)},
	{Fname: ts + 22262, Ftype: TMONTH, Fvalue: int64(8)},
	{Fname: ts + 22269, Ftype: TMONTH, Fvalue: int64(9)},
	{Fname: ts + 22279, Ftype: TMONTH, Fvalue: int64(9)},
	{Fname: ts + 22284, Ftype: TMONTH, Fvalue: int64(10)},
	{Fname: ts + 22292, Ftype: TMONTH, Fvalue: int64(11)},
	{Fname: ts + 22301, Ftype: TMONTH, Fvalue: int64(12)},
	{Fname: ts + 22310, Ftype: TDAY},
	{Fname: ts + 22317, Ftype: TDAY, Fvalue: int64(1)},
	{Fname: ts + 22324, Ftype: TDAY, Fvalue: int64(2)},
	{Fname: ts + 22332, Ftype: TDAY, Fvalue: int64(2)},
	{Fname: ts + 22337, Ftype: TDAY, Fvalue: int64(3)},
	{Fname: ts + 22347, Ftype: TDAY, Fvalue: int64(3)},
	{Fname: ts + 22354, Ftype: TDAY, Fvalue: int64(4)},
	{Fname: ts + 22363, Ftype: TDAY, Fvalue: int64(4)},
	{Fname: ts + 22368, Ftype: TDAY, Fvalue: int64(4)},
	{Fname: ts + 22374, Ftype: TDAY, Fvalue: int64(5)},
	{Fname: ts + 22381, Ftype: TDAY, Fvalue: int64(6)},
	{},
} /* tclDate.c:2293:20 */

// Time units table.

var sUnitsTable = [11]TABLE{
	{Fname: ts + 10669, Ftype: TMONTH_UNIT, Fvalue: int64(12)},
	{Fname: ts + 10639, Ftype: TMONTH_UNIT, Fvalue: int64(1)},
	{Fname: ts + 22390, Ftype: TDAY_UNIT, Fvalue: int64(14)},
	{Fname: ts + 22400, Ftype: TDAY_UNIT, Fvalue: int64(7)},
	{Fname: ts + 22405, Ftype: TDAY_UNIT, Fvalue: int64(1)},
	{Fname: ts + 22409, Ftype: TSEC_UNIT, Fvalue: int64(60 * 60)},
	{Fname: ts + 22414, Ftype: TSEC_UNIT, Fvalue: int64(60)},
	{Fname: ts + 22421, Ftype: TSEC_UNIT, Fvalue: int64(60)},
	{Fname: ts + 22425, Ftype: TSEC_UNIT, Fvalue: int64(1)},
	{Fname: ts + 22432, Ftype: TSEC_UNIT, Fvalue: int64(1)},
	{},
} /* tclDate.c:2325:20 */

// Assorted relative-time words.

var sOtherTable = [11]TABLE{
	{Fname: ts + 22436, Ftype: TDAY_UNIT, Fvalue: int64(1)},
	{Fname: ts + 22445, Ftype: TDAY_UNIT, Fvalue: int64(-1)},
	{Fname: ts + 22455, Ftype: TDAY_UNIT},
	{Fname: ts + 22461, Ftype: TSEC_UNIT},
	{Fname: ts + 16639, Ftype: TUNUMBER, Fvalue: int64(-1)},
	{Fname: ts + 22465, Ftype: TSEC_UNIT},
	{Fname: ts + 22470, Ftype: TNEXT, Fvalue: int64(1)},
	{Fname: ts + 22475, Ftype: TAGO, Fvalue: int64(1)},
	{Fname: ts + 22479, Ftype: TEPOCH},
	{Fname: ts + 22485, Ftype: TSTARDATE},
	{},
} /* tclDate.c:2343:20 */

// The timezone table. (Note: This table was modified to not use any floating
// point constants to work around an SGI compiler bug).

var sTimezoneTable = [64]TABLE{
	{Fname: ts + 22494, Ftype: TZONE}, // Greenwich Mean
	{Fname: ts + 22498, Ftype: TZONE}, // Universal (Coordinated)
	{Fname: ts + 22501, Ftype: TZONE},
	{Fname: ts + 22505, Ftype: TZONE},    // Universal Coordinated Time
	{Fname: ts + 22509, Ftype: TZONE},    // Western European
	{Fname: ts + 22513, Ftype: TDAYZONE}, // British Summer
	{Fname: ts + 22517, Ftype: TZONE, Fvalue: Time_t(60 * 1)},
	{Fname: ts + 22521, Ftype: TZONE, Fvalue: Time_t(60 * 2)},
	{Fname: ts + 22524, Ftype: TZONE, Fvalue: Time_t(60 * 7 / 2)},
	{Fname: ts + 22528, Ftype: TZONE, Fvalue: Time_t(60 * 7 / 2)},
	{Fname: ts + 22532, Ftype: TDAYZONE, Fvalue: Time_t(60 * 7 / 2)},
	{Fname: ts + 22536, Ftype: TZONE, Fvalue: Time_t(60 * 4)},
	{Fname: ts + 22540, Ftype: TDAYZONE, Fvalue: Time_t(60 * 4)},
	{Fname: ts + 22544, Ftype: TZONE, Fvalue: Time_t(60 * 5)},
	{Fname: ts + 22548, Ftype: TDAYZONE, Fvalue: Time_t(60 * 5)},
	{Fname: ts + 22552, Ftype: TZONE, Fvalue: Time_t(60 * 6)},
	{Fname: ts + 22556, Ftype: TDAYZONE, Fvalue: Time_t(60 * 6)},
	{Fname: ts + 22560, Ftype: TZONE, Fvalue: Time_t(60 * 7)},
	{Fname: ts + 22564, Ftype: TDAYZONE, Fvalue: Time_t(60 * 7)},
	{Fname: ts + 22568, Ftype: TZONE, Fvalue: Time_t(60 * 8)},
	{Fname: ts + 22572, Ftype: TDAYZONE, Fvalue: Time_t(60 * 8)},
	{Fname: ts + 22576, Ftype: TZONE, Fvalue: Time_t(60 * 9)},
	{Fname: ts + 22580, Ftype: TDAYZONE, Fvalue: Time_t(60 * 9)},
	{Fname: ts + 22584, Ftype: TZONE, Fvalue: Time_t(60 * 10)},
	{Fname: ts + 22588, Ftype: TDAYZONE, Fvalue: Time_t(60 * 10)},
	{Fname: ts + 16606, Ftype: TZONE, Fvalue: Time_t(60 * 10)},
	{Fname: ts + 22592, Ftype: TZONE, Fvalue: Time_t(60 * 10)},
	{Fname: ts + 22597, Ftype: TZONE, Fvalue: Time_t(60 * 11)},
	{Fname: ts + 22600, Ftype: TZONE, Fvalue: Time_t(60 * 12)},
	{Fname: ts + 22605, Ftype: TZONE, Fvalue: int64(-(60 * 1))},
	{Fname: ts + 22609, Ftype: TDAYZONE, Fvalue: int64(-(60 * 1))},
	{Fname: ts + 22614, Ftype: TZONE, Fvalue: int64(-(60 * 1))},
	{Fname: ts + 22618, Ftype: TZONE, Fvalue: int64(-(60 * 1))},
	{Fname: ts + 22623, Ftype: TDAYZONE, Fvalue: int64(-(60 * 1))},
	{Fname: ts + 22628, Ftype: TZONE, Fvalue: int64(-(60 * 1))},
	{Fname: ts + 22632, Ftype: TDAYZONE, Fvalue: int64(-(60 * 1))},
	{Fname: ts + 22636, Ftype: TZONE, Fvalue: int64(-(60 * 1))},
	{Fname: ts + 22640, Ftype: TDAYZONE, Fvalue: int64(-(60 * 1))},
	{Fname: ts + 22644, Ftype: TZONE, Fvalue: int64(-(60 * 2))},
	{Fname: ts + 22648, Ftype: TZONE, Fvalue: int64(-(60 * 3))},
	{Fname: ts + 22651, Ftype: TZONE, Fvalue: int64(-(60 * 7 / 2))},
	{Fname: ts + 22654, Ftype: TZONE, Fvalue: int64(-(60 * 4))},
	{Fname: ts + 22658, Ftype: TZONE, Fvalue: int64(-(60 * 5))},
	{Fname: ts + 22662, Ftype: TZONE, Fvalue: int64(-(60 * 11 / 2))},
	{Fname: ts + 22666, Ftype: TZONE, Fvalue: int64(-(60 * 6))},
	{Fname: ts + 22670, Ftype: TZONE, Fvalue: int64(-(60 * 7))},
	{Fname: ts + 22675, Ftype: TDAYZONE, Fvalue: int64(-(60 * 7))},
	{Fname: ts + 22680, Ftype: TZONE, Fvalue: int64(-(60 * 15 / 2))},
	{Fname: ts + 22683, Ftype: TZONE, Fvalue: int64(-(60 * 8))},
	{Fname: ts + 22687, Ftype: TZONE, Fvalue: int64(-(60 * 9))},
	{Fname: ts + 22691, Ftype: TDAYZONE, Fvalue: int64(-(60 * 9))},
	{Fname: ts + 22695, Ftype: TZONE, Fvalue: int64(-(60 * 9))},
	{Fname: ts + 22699, Ftype: TDAYZONE, Fvalue: int64(-(60 * 9))},
	{Fname: ts + 22703, Ftype: TZONE, Fvalue: int64(-(60 * 19 / 2))},
	{Fname: ts + 22708, Ftype: TDAYZONE, Fvalue: int64(-(60 * 19 / 2))},
	{Fname: ts + 22713, Ftype: TZONE, Fvalue: int64(-(60 * 10))},
	{Fname: ts + 22718, Ftype: TDAYZONE, Fvalue: int64(-(60 * 10))},
	{Fname: ts + 22723, Ftype: TZONE, Fvalue: int64(-(60 * 10))},
	{Fname: ts + 22727, Ftype: TZONE, Fvalue: int64(-(60 * 12))},
	{Fname: ts + 22731, Ftype: TZONE, Fvalue: int64(-(60 * 12))},
	{Fname: ts + 22736, Ftype: TDAYZONE, Fvalue: int64(-(60 * 12))},
	{Fname: ts + 22741, Ftype: TZONE, Fvalue: int64(-(60 * 12))},
	// ADDED BY Marco Nijdam
	{Fname: ts + 22746, Ftype: TDST}, // DST on (hour is ignored)
	// End ADDED
	{},
} /* tclDate.c:2376:20 */

// Military timezone table.

var sMilitaryTable = [26]TABLE{
	{Fname: ts + 22750, Ftype: TZONE, Fvalue: int64(-(60 * 1) + 60*100)},
	{Fname: ts + 22752, Ftype: TZONE, Fvalue: int64(-(60 * 2) + 60*100)},
	{Fname: ts + 22754, Ftype: TZONE, Fvalue: int64(-(60 * 3) + 60*100)},
	{Fname: ts + 22756, Ftype: TZONE, Fvalue: int64(-(60 * 4) + 60*100)},
	{Fname: ts + 22758, Ftype: TZONE, Fvalue: int64(-(60 * 5) + 60*100)},
	{Fname: ts + 22760, Ftype: TZONE, Fvalue: int64(-(60 * 6) + 60*100)},
	{Fname: ts + 22762, Ftype: TZONE, Fvalue: int64(-(60 * 7) + 60*100)},
	{Fname: ts + 22764, Ftype: TZONE, Fvalue: int64(-(60 * 8) + 60*100)},
	{Fname: ts + 22766, Ftype: TZONE, Fvalue: int64(-(60 * 9) + 60*100)},
	{Fname: ts + 22768, Ftype: TZONE, Fvalue: int64(-(60 * 10) + 60*100)},
	{Fname: ts + 22770, Ftype: TZONE, Fvalue: int64(-(60 * 11) + 60*100)},
	{Fname: ts + 22772, Ftype: TZONE, Fvalue: int64(-(60 * 12) + 60*100)},
	{Fname: ts + 22774, Ftype: TZONE, Fvalue: int64(60*1 + 60*100)},
	{Fname: ts + 22776, Ftype: TZONE, Fvalue: int64(60*2 + 60*100)},
	{Fname: ts + 22778, Ftype: TZONE, Fvalue: int64(60*3 + 60*100)},
	{Fname: ts + 22780, Ftype: TZONE, Fvalue: int64(60*4 + 60*100)},
	{Fname: ts + 22782, Ftype: TZONE, Fvalue: int64(60*5 + 60*100)},
	{Fname: ts + 22784, Ftype: TZONE, Fvalue: int64(60*6 + 60*100)},
	{Fname: ts + 22786, Ftype: TZONE, Fvalue: int64(60*7 + 60*100)},
	{Fname: ts + 22788, Ftype: TZONE, Fvalue: int64(60*8 + 60*100)},
	{Fname: ts + 22790, Ftype: TZONE, Fvalue: int64(60*9 + 60*100)},
	{Fname: ts + 22792, Ftype: TZONE, Fvalue: int64(60*10 + 60*100)},
	{Fname: ts + 22794, Ftype: TZONE, Fvalue: int64(60*11 + 60*100)},
	{Fname: ts + 22796, Ftype: TZONE, Fvalue: int64(60*12 + 60*100)},
	{Fname: ts + 22798, Ftype: TZONE, Fvalue: int64(60*0 + 60*100)},
	{},
} /* tclDate.c:2461:20 */

// Dump error messages in the bit bucket.

func sTclDateerror(tls *libc.TLS, location uintptr, infoPtr uintptr, s uintptr) { /* tclDate.c:2495:1: */
	var t uintptr
	XTcl_AppendToObj(tls, (*DateInfo)(unsafe.Pointer(infoPtr)).Fmessages, (*DateInfo)(unsafe.Pointer(infoPtr)).Fseparatrix, -1)
	XTcl_AppendToObj(tls, (*DateInfo)(unsafe.Pointer(infoPtr)).Fmessages, s, -1)
	XTcl_AppendToObj(tls, (*DateInfo)(unsafe.Pointer(infoPtr)).Fmessages, ts+22800, -1)
	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				t = XTclThreadAllocObj(tls)
			} else {
				t = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(t + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(t)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(t)).Fbytes = uintptr(0)
		*(*int64)(unsafe.Pointer(t + 32)) = int64((*YYLTYPE)(unsafe.Pointer(location)).Ffirst_column)
		(*Tcl_Obj)(unsafe.Pointer(t)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(t)).FrefCount++
	XTcl_AppendObjToObj(tls, (*DateInfo)(unsafe.Pointer(infoPtr)).Fmessages, t)
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = t
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTcl_AppendToObj(tls, (*DateInfo)(unsafe.Pointer(infoPtr)).Fmessages, ts+5772, -1)
	for ok3 := true; ok3; ok3 = 0 != 0 {
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				t = XTclThreadAllocObj(tls)
			} else {
				t = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(t + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(t)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(t)).Fbytes = uintptr(0)
		*(*int64)(unsafe.Pointer(t + 32)) = int64((*YYLTYPE)(unsafe.Pointer(location)).Flast_column)
		(*Tcl_Obj)(unsafe.Pointer(t)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(t)).FrefCount++
	XTcl_AppendObjToObj(tls, (*DateInfo)(unsafe.Pointer(infoPtr)).Fmessages, t)
	for ok5 := true; ok5; ok5 = 0 != 0 {
		var _objPtr uintptr = t
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTcl_AppendToObj(tls, (*DateInfo)(unsafe.Pointer(infoPtr)).Fmessages, ts+3493, -1)
	(*DateInfo)(unsafe.Pointer(infoPtr)).Fseparatrix = ts + 350 /* "\n" */
}

func sToSeconds(tls *libc.TLS, Hours Time_t, Minutes Time_t, Seconds Time_t, Meridian MERIDIAN) Time_t { /* tclDate.c:2518:1: */
	if Minutes < int64(0) || Minutes > int64(59) || Seconds < int64(0) || Seconds > int64(59) {
		return int64(-1)
	}
	switch Meridian {
	case MER24:
		if Hours < int64(0) || Hours > int64(23) {
			return int64(-1)
		}
		return (Hours*60+Minutes)*60 + Seconds
	case MERam:
		if Hours < int64(1) || Hours > int64(12) {
			return int64(-1)
		}
		return (Hours%int64(12)*60+Minutes)*60 + Seconds
	case MERpm:
		if Hours < int64(1) || Hours > int64(12) {
			return int64(-1)
		}
		return ((Hours%int64(12)+int64(12))*60+Minutes)*60 + Seconds
	}
	return int64(-1) // Should never be reached
}

func sLookupWord(tls *libc.TLS, yylvalPtr uintptr, buff uintptr) int32 { /* tclDate.c:2548:1: */
	var p uintptr
	var q uintptr
	var tp uintptr
	var i int32
	var abbrev int32

	// Make it lowercase.

	XTcl_UtfToLower(tls, buff)

	if libc.Xstrcmp(tls, buff, ts+22814) == 0 || libc.Xstrcmp(tls, buff, ts+22817) == 0 {
		*(*uint32)(unsafe.Pointer(yylvalPtr)) = MERam
		return TMERIDIAN
	}
	if libc.Xstrcmp(tls, buff, ts+22822) == 0 || libc.Xstrcmp(tls, buff, ts+22825) == 0 {
		*(*uint32)(unsafe.Pointer(yylvalPtr)) = MERpm
		return TMERIDIAN
	}

	// See if we have an abbreviation for a month.

	if libc.Xstrlen(tls, buff) == uint64(3) {
		abbrev = 1
	} else if libc.Xstrlen(tls, buff) == uint64(4) && int32(*(*int8)(unsafe.Pointer(buff + 3))) == '.' {
		abbrev = 1
		*(*int8)(unsafe.Pointer(buff + 3)) = int8(0)
	} else {
		abbrev = 0
	}

	for tp = uintptr(unsafe.Pointer(&sMonthDayTable)); (*TABLE)(unsafe.Pointer(tp)).Fname != 0; tp += 24 {
		if abbrev != 0 {
			if libc.Xstrncmp(tls, buff, (*TABLE)(unsafe.Pointer(tp)).Fname, uint64(3)) == 0 {
				*(*Time_t)(unsafe.Pointer(yylvalPtr)) = (*TABLE)(unsafe.Pointer(tp)).Fvalue
				return (*TABLE)(unsafe.Pointer(tp)).Ftype
			}
		} else if libc.Xstrcmp(tls, buff, (*TABLE)(unsafe.Pointer(tp)).Fname) == 0 {
			*(*Time_t)(unsafe.Pointer(yylvalPtr)) = (*TABLE)(unsafe.Pointer(tp)).Fvalue
			return (*TABLE)(unsafe.Pointer(tp)).Ftype
		}
	}

	for tp = uintptr(unsafe.Pointer(&sTimezoneTable)); (*TABLE)(unsafe.Pointer(tp)).Fname != 0; tp += 24 {
		if libc.Xstrcmp(tls, buff, (*TABLE)(unsafe.Pointer(tp)).Fname) == 0 {
			*(*Time_t)(unsafe.Pointer(yylvalPtr)) = (*TABLE)(unsafe.Pointer(tp)).Fvalue
			return (*TABLE)(unsafe.Pointer(tp)).Ftype
		}
	}

	for tp = uintptr(unsafe.Pointer(&sUnitsTable)); (*TABLE)(unsafe.Pointer(tp)).Fname != 0; tp += 24 {
		if libc.Xstrcmp(tls, buff, (*TABLE)(unsafe.Pointer(tp)).Fname) == 0 {
			*(*Time_t)(unsafe.Pointer(yylvalPtr)) = (*TABLE)(unsafe.Pointer(tp)).Fvalue
			return (*TABLE)(unsafe.Pointer(tp)).Ftype
		}
	}

	// Strip off any plural and try the units table again.

	i = int32(libc.Xstrlen(tls, buff) - uint64(1))
	if i > 0 && int32(*(*int8)(unsafe.Pointer(buff + uintptr(i)))) == 's' {
		*(*int8)(unsafe.Pointer(buff + uintptr(i))) = int8(0)
		for tp = uintptr(unsafe.Pointer(&sUnitsTable)); (*TABLE)(unsafe.Pointer(tp)).Fname != 0; tp += 24 {
			if libc.Xstrcmp(tls, buff, (*TABLE)(unsafe.Pointer(tp)).Fname) == 0 {
				*(*Time_t)(unsafe.Pointer(yylvalPtr)) = (*TABLE)(unsafe.Pointer(tp)).Fvalue
				return (*TABLE)(unsafe.Pointer(tp)).Ftype
			}
		}
	}

	for tp = uintptr(unsafe.Pointer(&sOtherTable)); (*TABLE)(unsafe.Pointer(tp)).Fname != 0; tp += 24 {
		if libc.Xstrcmp(tls, buff, (*TABLE)(unsafe.Pointer(tp)).Fname) == 0 {
			*(*Time_t)(unsafe.Pointer(yylvalPtr)) = (*TABLE)(unsafe.Pointer(tp)).Fvalue
			return (*TABLE)(unsafe.Pointer(tp)).Ftype
		}
	}

	// Military timezones.

	if int32(*(*int8)(unsafe.Pointer(buff + 1))) == 0 && !(int32(*(*int8)(unsafe.Pointer(buff)))&0x80 != 0) &&
		int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(buff)))))*2)))&int32(X_ISalpha) != 0 { // INTL: ISO only
		for tp = uintptr(unsafe.Pointer(&sMilitaryTable)); (*TABLE)(unsafe.Pointer(tp)).Fname != 0; tp += 24 {
			if libc.Xstrcmp(tls, buff, (*TABLE)(unsafe.Pointer(tp)).Fname) == 0 {
				*(*Time_t)(unsafe.Pointer(yylvalPtr)) = (*TABLE)(unsafe.Pointer(tp)).Fvalue
				return (*TABLE)(unsafe.Pointer(tp)).Ftype
			}
		}
	}

	// Drop out any periods and try the timezone table again.

	i = 0
	p = libc.AssignUintptr(&q, buff)
	for ; *(*int8)(unsafe.Pointer(q)) != 0; q++ {
		if int32(*(*int8)(unsafe.Pointer(q))) != '.' {
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = *(*int8)(unsafe.Pointer(q))
		} else {
			i++
		}
	}
	*(*int8)(unsafe.Pointer(p)) = int8(0)
	if i != 0 {
		for tp = uintptr(unsafe.Pointer(&sTimezoneTable)); (*TABLE)(unsafe.Pointer(tp)).Fname != 0; tp += 24 {
			if libc.Xstrcmp(tls, buff, (*TABLE)(unsafe.Pointer(tp)).Fname) == 0 {
				*(*Time_t)(unsafe.Pointer(yylvalPtr)) = (*TABLE)(unsafe.Pointer(tp)).Fvalue
				return (*TABLE)(unsafe.Pointer(tp)).Ftype
			}
		}
	}

	return TID
}

func sTclDatelex(tls *libc.TLS, yylvalPtr uintptr, location uintptr, info uintptr) int32 { /* tclDate.c:2672:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var c int8
	var p uintptr
	// var buff [20]int8 at bp, 20

	var Count int32

	(*YYLTYPE)(unsafe.Pointer(location)).Ffirst_column = int32((int64((*DateInfo)(unsafe.Pointer(info)).FdateInput) - int64((*DateInfo)(unsafe.Pointer(info)).FdateStart)) / 1)
	for {
		for func() int32 {
			if int32(*(*int8)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(info)).FdateInput))) > 0x20 {
				return 0
			}
			return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(info)).FdateInput))))
		}() != 0 {
			(*DateInfo)(unsafe.Pointer(info)).FdateInput++
		}

		if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(info)).FdateInput))))))*2)))&int32(X_ISdigit) != 0 { // INTL: digit
			// Convert the string into a number; count the number of digits.

			Count = 0
			for *(*Time_t)(unsafe.Pointer(yylvalPtr)) = int64(0); int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&(*DateInfo)(unsafe.Pointer(info)).FdateInput, 1)))))))*2)))&int32(X_ISdigit) != 0; { // INTL: digit
				*(*Time_t)(unsafe.Pointer(yylvalPtr)) = int64(10)**(*Time_t)(unsafe.Pointer(yylvalPtr)) + Time_t(c) - int64('0')
				Count++
			}
			(*DateInfo)(unsafe.Pointer(info)).FdateInput--
			(*DateInfo)(unsafe.Pointer(info)).FdateDigitCount = Count

			// A number with 6 or more digits is considered an ISO 8601 base.

			if Count >= 6 {
				(*YYLTYPE)(unsafe.Pointer(location)).Flast_column = int32((int64((*DateInfo)(unsafe.Pointer(info)).FdateInput)-int64((*DateInfo)(unsafe.Pointer(info)).FdateStart))/1 - int64(1))
				return TISOBASE
			} else {
				(*YYLTYPE)(unsafe.Pointer(location)).Flast_column = int32((int64((*DateInfo)(unsafe.Pointer(info)).FdateInput)-int64((*DateInfo)(unsafe.Pointer(info)).FdateStart))/1 - int64(1))
				return TUNUMBER
			}
		}
		if !(int32(c)&0x80 != 0) && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(X_ISalpha) != 0 { // INTL: ISO only.
			for p = bp; /* &buff[0] */ int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&(*DateInfo)(unsafe.Pointer(info)).FdateInput, 1)))))))*2)))&int32(X_ISalpha) != 0 || // INTL: ISO only.
				int32(c) == '.'; {
				if p < bp+19 {
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = c
				}
			}
			*(*int8)(unsafe.Pointer(p)) = int8(0)
			(*DateInfo)(unsafe.Pointer(info)).FdateInput--
			(*YYLTYPE)(unsafe.Pointer(location)).Flast_column = int32((int64((*DateInfo)(unsafe.Pointer(info)).FdateInput)-int64((*DateInfo)(unsafe.Pointer(info)).FdateStart))/1 - int64(1))
			return sLookupWord(tls, yylvalPtr, bp)
		}
		if int32(c) != '(' {
			(*YYLTYPE)(unsafe.Pointer(location)).Flast_column = int32((int64((*DateInfo)(unsafe.Pointer(info)).FdateInput) - int64((*DateInfo)(unsafe.Pointer(info)).FdateStart)) / 1)
			return int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&(*DateInfo)(unsafe.Pointer(info)).FdateInput, 1))))
		}
		Count = 0
		for ok := true; ok; ok = Count > 0 {
			c = *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&(*DateInfo)(unsafe.Pointer(info)).FdateInput, 1)))
			if int32(c) == 0 {
				(*YYLTYPE)(unsafe.Pointer(location)).Flast_column = int32((int64((*DateInfo)(unsafe.Pointer(info)).FdateInput)-int64((*DateInfo)(unsafe.Pointer(info)).FdateStart))/1 - int64(1))
				return int32(c)
			} else if int32(c) == '(' {
				Count++
			} else if int32(c) == ')' {
				Count--
			}
		}
	}
	return int32(0)
}

func XTclClockOldscanObjCmd(tls *libc.TLS, dummy uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* tclDate.c:2746:1: */
	bp := tls.Alloc(500)
	defer tls.Free(500)

	var result uintptr
	var resultElement uintptr
	// var yr int32 at bp+488, 4

	// var mo int32 at bp+492, 4

	// var da int32 at bp+496, 4

	// var dateInfo DateInfo at bp+288, 200

	var info uintptr = bp + 288 /* &dateInfo */
	var status int32
	_ = dummy

	if objc != 5 {
		XTcl_WrongNumArgs(tls, interp, 1, objv,
			ts+22830)
		return TCL_ERROR
	}

	(*DateInfo)(unsafe.Pointer(info)).FdateInput = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	(*DateInfo)(unsafe.Pointer(bp + 288 /* &dateInfo */)).FdateStart = (*DateInfo)(unsafe.Pointer(info)).FdateInput

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveDate = 0
	if XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+488) != TCL_OK ||
		XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+492) != TCL_OK ||
		XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 4*8)), bp+496) != TCL_OK {
		return TCL_ERROR
	}
	(*DateInfo)(unsafe.Pointer(info)).FdateYear = Time_t(*(*int32)(unsafe.Pointer(bp + 488 /* yr */)))
	(*DateInfo)(unsafe.Pointer(info)).FdateMonth = Time_t(*(*int32)(unsafe.Pointer(bp + 492 /* mo */)))
	(*DateInfo)(unsafe.Pointer(info)).FdateDay = Time_t(*(*int32)(unsafe.Pointer(bp + 496 /* da */)))

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveTime = 0
	(*DateInfo)(unsafe.Pointer(info)).FdateHour = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateMinutes = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateSeconds = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateMeridian = MER24

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveZone = 0
	(*DateInfo)(unsafe.Pointer(info)).FdateTimezone = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateDSTmode = DSTmaybe

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveOrdinalMonth = 0
	(*DateInfo)(unsafe.Pointer(info)).FdateMonthOrdinal = int64(0)

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveDay = 0
	(*DateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateDayNumber = int64(0)

	(*DateInfo)(unsafe.Pointer(info)).FdateHaveRel = 0
	(*DateInfo)(unsafe.Pointer(info)).FdateRelMonth = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateRelDay = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateRelSeconds = int64(0)
	(*DateInfo)(unsafe.Pointer(info)).FdateRelPointer = uintptr(0)

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			(*DateInfo)(unsafe.Pointer(bp + 288)).Fmessages = XTclThreadAllocObj(tls)
		} else {
			(*DateInfo)(unsafe.Pointer(bp + 288)).Fmessages = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(bp+288)).Fmessages + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(bp + 288)).Fmessages)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(bp + 288)).Fmessages)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(bp + 288)).Fmessages)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(bp + 288)).Fmessages)).FtypePtr = uintptr(0)
	{
	}

	(*DateInfo)(unsafe.Pointer(bp + 288 /* &dateInfo */)).Fseparatrix = ts + 2046 /* "" */
	(*Tcl_Obj)(unsafe.Pointer((*DateInfo)(unsafe.Pointer(bp+288)).Fmessages)).FrefCount++

	status = XTclDateparse(tls, bp+288)
	if status == 1 {
		XTcl_SetObjResult(tls, interp, (*DateInfo)(unsafe.Pointer(bp+288 /* &dateInfo */)).Fmessages)
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*DateInfo)(unsafe.Pointer(bp + 288)).Fmessages
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+6915, ts+22871, ts+20062, uintptr(0)))
		return TCL_ERROR
	} else if status == 2 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+22155, -1))
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = (*DateInfo)(unsafe.Pointer(bp + 288)).Fmessages
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+14496, uintptr(0)))
		return TCL_ERROR
	} else if status != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

			ts+22876, -1))
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = (*DateInfo)(unsafe.Pointer(bp + 288)).Fmessages
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+22960, uintptr(0)))
		return TCL_ERROR
	}
	for ok4 := true; ok4; ok4 = 0 != 0 {
		var _objPtr uintptr = (*DateInfo)(unsafe.Pointer(bp + 288)).Fmessages
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	if (*DateInfo)(unsafe.Pointer(info)).FdateHaveDate > 1 {
		XTcl_SetObjResult(tls, interp,
			XTcl_NewStringObj(tls, ts+22964, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, ts+3593, ts+6915, ts+22871, ts+22993, uintptr(0)))
		return TCL_ERROR
	}
	if (*DateInfo)(unsafe.Pointer(info)).FdateHaveTime > 1 {
		XTcl_SetObjResult(tls, interp,
			XTcl_NewStringObj(tls, ts+23002, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+128, ts+3593, ts+6915, ts+22871, ts+22993, uintptr(0)))
		return TCL_ERROR
	}
	if (*DateInfo)(unsafe.Pointer(info)).FdateHaveZone > 1 {
		XTcl_SetObjResult(tls, interp,
			XTcl_NewStringObj(tls, ts+23038, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+168, ts+3593, ts+6915, ts+22871, ts+22993, uintptr(0)))
		return TCL_ERROR
	}
	if (*DateInfo)(unsafe.Pointer(info)).FdateHaveDay > 1 {
		XTcl_SetObjResult(tls, interp,
			XTcl_NewStringObj(tls, ts+23072, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+208, ts+3593, ts+6915, ts+22871, ts+22993, uintptr(0)))
		return TCL_ERROR
	}
	if (*DateInfo)(unsafe.Pointer(info)).FdateHaveOrdinalMonth > 1 {
		XTcl_SetObjResult(tls, interp,
			XTcl_NewStringObj(tls, ts+23104, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+248, ts+3593, ts+6915, ts+22871, ts+22993, uintptr(0)))
		return TCL_ERROR
	}

	for ok5 := true; ok5; ok5 = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			result = XTclThreadAllocObj(tls)
		} else {
			result = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(result + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(result)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(result)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(result)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(result)).FtypePtr = uintptr(0)
	{
	}

	for ok6 := true; ok6; ok6 = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultElement = XTclThreadAllocObj(tls)
		} else {
			resultElement = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultElement + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).FtypePtr = uintptr(0)
	{
	}

	if (*DateInfo)(unsafe.Pointer(info)).FdateHaveDate != 0 {
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, int32((*DateInfo)(unsafe.Pointer(info)).FdateYear)))
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, int32((*DateInfo)(unsafe.Pointer(info)).FdateMonth)))
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, int32((*DateInfo)(unsafe.Pointer(info)).FdateDay)))
	}
	XTcl_ListObjAppendElement(tls, interp, result, resultElement)

	if (*DateInfo)(unsafe.Pointer(info)).FdateHaveTime != 0 {
		XTcl_ListObjAppendElement(tls, interp, result, XTcl_NewIntObj(tls, int32(sToSeconds(tls, (*DateInfo)(unsafe.Pointer(info)).FdateHour, (*DateInfo)(unsafe.Pointer(info)).FdateMinutes, (*DateInfo)(unsafe.Pointer(info)).FdateSeconds, (*DateInfo)(unsafe.Pointer(info)).FdateMeridian))))
	} else {
		XTcl_ListObjAppendElement(tls, interp, result, XTcl_NewObj(tls))
	}

	for ok7 := true; ok7; ok7 = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultElement = XTclThreadAllocObj(tls)
		} else {
			resultElement = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultElement + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).FtypePtr = uintptr(0)
	{
	}

	if (*DateInfo)(unsafe.Pointer(info)).FdateHaveZone != 0 {
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, int32(-(*DateInfo)(unsafe.Pointer(info)).FdateTimezone)))
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, 1-(*DateInfo)(unsafe.Pointer(info)).FdateDSTmode))
	}
	XTcl_ListObjAppendElement(tls, interp, result, resultElement)

	for ok8 := true; ok8; ok8 = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultElement = XTclThreadAllocObj(tls)
		} else {
			resultElement = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultElement + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).FtypePtr = uintptr(0)
	{
	}

	if (*DateInfo)(unsafe.Pointer(info)).FdateHaveRel != 0 {
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, int32((*DateInfo)(unsafe.Pointer(info)).FdateRelMonth)))
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, int32((*DateInfo)(unsafe.Pointer(info)).FdateRelDay)))
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, int32((*DateInfo)(unsafe.Pointer(info)).FdateRelSeconds)))
	}
	XTcl_ListObjAppendElement(tls, interp, result, resultElement)

	for ok9 := true; ok9; ok9 = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultElement = XTclThreadAllocObj(tls)
		} else {
			resultElement = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultElement + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).FtypePtr = uintptr(0)
	{
	}

	if (*DateInfo)(unsafe.Pointer(info)).FdateHaveDay != 0 && !((*DateInfo)(unsafe.Pointer(info)).FdateHaveDate != 0) {
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, int32((*DateInfo)(unsafe.Pointer(info)).FdateDayOrdinal)))
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, int32((*DateInfo)(unsafe.Pointer(info)).FdateDayNumber)))
	}
	XTcl_ListObjAppendElement(tls, interp, result, resultElement)

	for ok10 := true; ok10; ok10 = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultElement = XTclThreadAllocObj(tls)
		} else {
			resultElement = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultElement + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultElement)).FtypePtr = uintptr(0)
	{
	}

	if (*DateInfo)(unsafe.Pointer(info)).FdateHaveOrdinalMonth != 0 {
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, int32((*DateInfo)(unsafe.Pointer(info)).FdateMonthOrdinal)))
		XTcl_ListObjAppendElement(tls, interp, resultElement,
			XTcl_NewIntObj(tls, int32((*DateInfo)(unsafe.Pointer(info)).FdateMonth)))
	}
	XTcl_ListObjAppendElement(tls, interp, result, resultElement)

	XTcl_SetObjResult(tls, interp, result)
	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// tclInt.h --
//
//	Declarations of things used internally by the Tcl interpreter.
//
// Copyright (c) 1987-1993 The Regents of the University of California.
// Copyright (c) 1993-1997 Lucent Technologies.
// Copyright (c) 1994-1998 Sun Microsystems, Inc.
// Copyright (c) 1998-1999 by Scriptics Corporation.
// Copyright (c) 2001, 2002 by Kevin B. Kenny.  All rights reserved.
// Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
// Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
// Copyright (c) 2008 by Miguel Sofer. All rights reserved.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// Forward declaration.
type Dict1 = struct {
	Ftable          Tcl_HashTable
	FentryChainHead uintptr
	FentryChainTail uintptr
	Fepoch          int32
	F__ccgo_pad1    [4]byte
	FrefCount       Size_t
	Fchain          uintptr
} /* tclDictObj.c:19:1 */

// Table of dict subcommand names and implementations.

var implementationMap = [21]EnsembleImplMap{
	{Fname: ts + 2081, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 23142, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12165, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 23149, Fproc: 0},
	{Fname: ts + 5142, FcompileProc: 0, FnreProc: 0},
	{Fname: ts + 22076, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 2487, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13499, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 23156, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 2683, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16651, FcompileProc: 0, FnreProc: 0},
	{Fname: ts + 23161, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 23167, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16674, Fproc: 0},
	{Fname: ts + 5303, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12297, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 3380, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5513, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 23174, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 23181, Fproc: 0, FcompileProc: 0},
	{},
} /* tclDictObj.c:84:30 */

// Internal representation of the entries in the hash table that backs a
// dictionary.

type ChainEntry1 = struct {
	Fentry   Tcl_HashEntry
	FprevPtr uintptr
	FnextPtr uintptr
} /* tclDictObj.c:19:1 */

// Internal representation of the entries in the hash table that backs a
// dictionary.

type ChainEntry = ChainEntry1 /* tclDictObj.c:117:3 */

// Internal representation of a dictionary.
//
// The internal representation of a dictionary object is a hash table (with
// Tcl_Objs for both keys and values), a reference count and epoch number for
// detecting concurrent modifications of the dictionary, and a pointer to the
// parent object (used when invalidating string reps of pathed dictionary
// trees) which is NULL in normal use. The fact that hash tables know (with
// appropriate initialisation) already about objects makes key management /so/
// much easier!
//
// Reference counts are used to enable safe iteration across hashes while
// allowing the type of the containing object to be modified.

type Dict = Dict1 /* tclDictObj.c:149:3 */

// Accessor macro for converting between a Tcl_Obj* and a Dict. Note that this
// must be assignable as well as readable.

// The structure below defines the dictionary object type by means of
// functions that can be invoked by generic object code.

var XtclDictType = Tcl_ObjType{
	Fname:             ts + 23186,
	FfreeIntRepProc:   0, // freeIntRepProc
	FdupIntRepProc:    0, // dupIntRepProc
	FupdateStringProc: 0, // updateStringProc
	FsetFromAnyProc:   0, // setFromAnyProc
} /* tclDictObj.c:163:19 */

// The type of the specially adapted version of the Tcl_Obj*-containing hash
// table defined in the tclObj.c code. This version differs in that it
// allocates a bit more space in each hash entry in order to hold the pointers
// used to keep the hash entries in a linked list.
//
// Note that this type of hash table is *only* suitable for direct use in
// *this* file. Everything else should use the dict iterator API.

var chainHashType = Tcl_HashKeyType{
	Fversion:         TCL_HASH_KEY_TYPE_VERSION,
	FhashKeyProc:     0,
	FcompareKeysProc: 0,
	FallocEntryProc:  0,
	FfreeEntryProc:   0,
} /* tclDictObj.c:181:30 */

// Structure used in implementation of 'dict map' to hold the state that gets
// passed between parts of the implementation.

type DictMapStorage = struct {
	FkeyVarObj      uintptr
	FvalueVarObj    uintptr
	Fsearch         Tcl_DictSearch
	FscriptObj      uintptr
	FaccumulatorObj uintptr
} /* tclDictObj.c:205:3 */

//**** START OF FUNCTIONS IMPLEMENTING DICT CORE API ****

//----------------------------------------------------------------------
//
// AllocChainEntry --
//
//	Allocate space for a Tcl_HashEntry containing the Tcl_Obj * key, and
//	which has a bit of extra space afterwards for storing pointers to the
//	rest of the chain of entries (the extra pointers are left NULL).
//
// Results:
//	The return value is a pointer to the created entry.
//
// Side effects:
//	Increments the reference count on the object.
//
//----------------------------------------------------------------------

func sAllocChainEntry(tls *libc.TLS, tablePtr uintptr, keyPtr uintptr) uintptr { /* tclDictObj.c:227:22: */
	var objPtr uintptr = keyPtr
	var cPtr uintptr

	cPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ChainEntry{})))
	*(*uintptr)(unsafe.Pointer(cPtr + 32)) = objPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	(*ChainEntry)(unsafe.Pointer(cPtr)).Fentry.FclientData = uintptr(0)
	(*ChainEntry)(unsafe.Pointer(cPtr)).FprevPtr = libc.AssignPtrUintptr(cPtr+48, uintptr(0))

	return cPtr
}

// Helper functions that disguise most of the details relating to how the
// linked list of hash entries is managed. In particular, these manage the
// creation of the table and initializing of the chain, the deletion of the
// table and chain, the adding of an entry to the chain, and the removal of an
// entry from the chain.

func sInitChainTable(tls *libc.TLS, dict uintptr) { /* tclDictObj.c:253:1: */
	XTcl_InitCustomHashTable(tls, dict, -1,
		uintptr(unsafe.Pointer(&chainHashType)))
	(*Dict)(unsafe.Pointer(dict)).FentryChainHead = libc.AssignPtrUintptr(dict+96, uintptr(0))
}

func sDeleteChainTable(tls *libc.TLS, dict uintptr) { /* tclDictObj.c:262:1: */
	var cPtr uintptr

	for cPtr = (*Dict)(unsafe.Pointer(dict)).FentryChainHead; cPtr != uintptr(0); cPtr = (*ChainEntry)(unsafe.Pointer(cPtr)).FnextPtr {
		var valuePtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, valuePtr)
					} else {
						*(*uintptr)(unsafe.Pointer(valuePtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = valuePtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, valuePtr)
			}
		}

	}
	XTcl_DeleteHashTable(tls, dict)
}

func sCreateChainEntry(tls *libc.TLS, dict uintptr, keyPtr uintptr, newPtr uintptr) uintptr { /* tclDictObj.c:275:29: */
	var cPtr uintptr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(dict /* &.table */)).FcreateProc})).f(tls, dict /* &.table */, keyPtr, newPtr)

	// If this is a new entry in the hash table, stitch it into the chain.

	if *(*int32)(unsafe.Pointer(newPtr)) != 0 {
		(*ChainEntry)(unsafe.Pointer(cPtr)).FnextPtr = uintptr(0)
		if (*Dict)(unsafe.Pointer(dict)).FentryChainHead == uintptr(0) {
			(*ChainEntry)(unsafe.Pointer(cPtr)).FprevPtr = uintptr(0)
			(*Dict)(unsafe.Pointer(dict)).FentryChainHead = cPtr
			(*Dict)(unsafe.Pointer(dict)).FentryChainTail = cPtr
		} else {
			(*ChainEntry)(unsafe.Pointer(cPtr)).FprevPtr = (*Dict)(unsafe.Pointer(dict)).FentryChainTail
			(*ChainEntry)(unsafe.Pointer((*Dict)(unsafe.Pointer(dict)).FentryChainTail)).FnextPtr = cPtr
			(*Dict)(unsafe.Pointer(dict)).FentryChainTail = cPtr
		}
	}

	return cPtr
}

func sDeleteChainEntry(tls *libc.TLS, dict uintptr, keyPtr uintptr) int32 { /* tclDictObj.c:305:1: */
	var cPtr uintptr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(dict /* &.table */)).FfindProc})).f(tls, dict /* &.table */, keyPtr)

	if cPtr == uintptr(0) {
		return 0
	} else {
		var valuePtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, valuePtr)
					} else {
						*(*uintptr)(unsafe.Pointer(valuePtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = valuePtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, valuePtr)
			}
		}

	}

	// Unstitch from the chain.

	if (*ChainEntry)(unsafe.Pointer(cPtr)).FnextPtr != 0 {
		(*ChainEntry1)(unsafe.Pointer((*ChainEntry)(unsafe.Pointer(cPtr)).FnextPtr)).FprevPtr = (*ChainEntry)(unsafe.Pointer(cPtr)).FprevPtr
	} else {
		(*Dict)(unsafe.Pointer(dict)).FentryChainTail = (*ChainEntry)(unsafe.Pointer(cPtr)).FprevPtr
	}
	if (*ChainEntry)(unsafe.Pointer(cPtr)).FprevPtr != 0 {
		(*ChainEntry1)(unsafe.Pointer((*ChainEntry)(unsafe.Pointer(cPtr)).FprevPtr)).FnextPtr = (*ChainEntry)(unsafe.Pointer(cPtr)).FnextPtr
	} else {
		(*Dict)(unsafe.Pointer(dict)).FentryChainHead = (*ChainEntry)(unsafe.Pointer(cPtr)).FnextPtr
	}

	XTcl_DeleteHashEntry(tls, cPtr)
	return 1
}

//----------------------------------------------------------------------
//
// DupDictInternalRep --
//
//	Initialize the internal representation of a dictionary Tcl_Obj to a
//	copy of the internal representation of an existing dictionary object.
//
// Results:
//	None.
//
// Side effects:
//	"srcPtr"s dictionary internal rep pointer should not be NULL and we
//	assume it is not NULL. We set "copyPtr"s internal rep to a pointer to
//	a newly allocated dictionary rep that, in turn, points to "srcPtr"s
//	key and value objects. Those objects are not actually copied but are
//	shared between "srcPtr" and "copyPtr". The ref count of each key and
//	value object is incremented.
//
//----------------------------------------------------------------------

func sDupDictInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclDictObj.c:362:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var oldDict uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))
	var newDict uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Dict{})))
	var cPtr uintptr

	// Copy values across from the old hash table.

	sInitChainTable(tls, newDict)
	for cPtr = (*Dict)(unsafe.Pointer(oldDict)).FentryChainHead; cPtr != uintptr(0); cPtr = (*ChainEntry)(unsafe.Pointer(cPtr)).FnextPtr {
		var key uintptr = func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(oldDict)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(oldDict)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(cPtr + 32))
			}
			return cPtr + 32
		}()
		var valuePtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData
		// var n int32 at bp, 4

		var hPtr uintptr = sCreateChainEntry(tls, newDict, key, bp)

		// Fill in the contents.

		(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = valuePtr
		(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++
	}

	// Initialise other fields.

	(*Dict)(unsafe.Pointer(newDict)).Fepoch = 0
	(*Dict)(unsafe.Pointer(newDict)).Fchain = uintptr(0)
	(*Dict)(unsafe.Pointer(newDict)).FrefCount = uint64(1)

	// Store in the object.

	*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = newDict
	*(*uintptr)(unsafe.Pointer(copyPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclDictType))
}

//----------------------------------------------------------------------
//
// FreeDictInternalRep --
//
//	Deallocate the storage associated with a dictionary object's internal
//	representation.
//
// Results:
//	None
//
// Side effects:
//	Frees the memory holding the dictionary's internal hash table unless
//	it is locked by an iteration going over it.
//
//----------------------------------------------------------------------

func sFreeDictInternalRep(tls *libc.TLS, dictPtr uintptr) { /* tclDictObj.c:425:1: */
	var dict uintptr = *(*uintptr)(unsafe.Pointer(dictPtr + 32))

	if libc.PostDecUint64(&(*Dict)(unsafe.Pointer(dict)).FrefCount, 1) <= uint64(1) {
		sDeleteDict(tls, dict)
	}
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// DeleteDict --
//
//	Delete the structure that is used to implement a dictionary's internal
//	representation. Called when either the dictionary object loses its
//	internal representation or when the last iteration over the dictionary
//	completes.
//
// Results:
//	None
//
// Side effects:
//	Decrements the reference count of all key and value objects in the
//	dictionary, which may free them.
//
//----------------------------------------------------------------------

func sDeleteDict(tls *libc.TLS, dict uintptr) { /* tclDictObj.c:457:1: */
	sDeleteChainTable(tls, dict)
	XTclpFree(tls, dict)
}

//----------------------------------------------------------------------
//
// UpdateStringOfDict --
//
//	Update the string representation for a dictionary object. Note: This
//	function does not invalidate an existing old string rep so storage
//	will be lost if this has not already been done. This code is based on
//	UpdateStringOfList in tclListObj.c
//
// Results:
//	None.
//
// Side effects:
//	The object's string is set to a valid string that results from the
//	dict-to-string conversion. This string will be empty if the dictionary
//	has no key/value pairs. The dictionary internal representation should
//	not be NULL and we assume it is not NULL.
//
//----------------------------------------------------------------------

func sUpdateStringOfDict(tls *libc.TLS, dictPtr uintptr) { /* tclDictObj.c:487:1: */
	bp := tls.Alloc(92)
	defer tls.Free(92)

	// var localFlags [64]int8 at bp+24, 64

	var flagPtr uintptr = uintptr(0)
	var dict uintptr = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	var cPtr uintptr
	var keyPtr uintptr
	var valuePtr uintptr
	var i int32
	// var length int32 at bp+88, 4

	var bytesNeeded int32 = 0
	var elem uintptr
	var dst uintptr

	// This field is the most useful one in the whole hash structure, and it
	// is not exposed by any API function...

	var numElems int32 = (*Dict)(unsafe.Pointer(dict)).Ftable.FnumEntries * 2

	// Handle empty list case first, simplifies what follows
	if numElems == 0 {
		(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = 0
		return
	}

	// Pass 1: estimate space, gather flags.

	if numElems <= LOCAL_SIZE {
		flagPtr = bp + 24 /* &localFlags[0] */
	} else {
		flagPtr = XTcl_Alloc(tls, uint32(numElems))
	}
	i = 0
	cPtr = (*Dict)(unsafe.Pointer(dict)).FentryChainHead
__1:
	if !(i < numElems) {
		goto __3
	}
	{
		// Assume that cPtr is never NULL since we know the number of array
		// elements already.

		*(*int8)(unsafe.Pointer(flagPtr + uintptr(i))) = func() int8 {
			if i != 0 {
				return int8(TCL_DONT_QUOTE_HASH)
			}
			return int8(0)
		}()
		keyPtr = func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(dict)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(dict)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(cPtr + 32))
			}
			return cPtr + 32
		}()
		elem = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 88)) = (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, keyPtr, bp+88)
		}()
		bytesNeeded = bytesNeeded + XTclScanElement(tls, elem, *(*int32)(unsafe.Pointer(bp + 88)), flagPtr+uintptr(i))
		if bytesNeeded < 0 {
			XTcl_Panic(tls, ts+9405, libc.VaList(bp, 0x7fffffff))
		}

		*(*int8)(unsafe.Pointer(flagPtr + uintptr(i+1))) = int8(TCL_DONT_QUOTE_HASH)
		valuePtr = (*Tcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData
		elem = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 88)) = (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, valuePtr, bp+88)
		}()
		bytesNeeded = bytesNeeded + XTclScanElement(tls, elem, *(*int32)(unsafe.Pointer(bp + 88)), flagPtr+uintptr(i)+uintptr(1))
		if bytesNeeded < 0 {
			XTcl_Panic(tls, ts+9405, libc.VaList(bp+8, 0x7fffffff))
		}

	}
	goto __2
__2:
	i = i + 2
	cPtr = (*ChainEntry)(unsafe.Pointer(cPtr)).FnextPtr
	goto __1
	goto __3
__3:
	;
	if bytesNeeded > 0x7fffffff-numElems+1 {
		XTcl_Panic(tls, ts+9405, libc.VaList(bp+16, 0x7fffffff))
	}
	bytesNeeded = bytesNeeded + numElems

	// Pass 2: copy into string rep buffer.

	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = bytesNeeded - 1
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = XTcl_Alloc(tls, uint32(bytesNeeded))
	dst = (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes
	i = 0
	cPtr = (*Dict)(unsafe.Pointer(dict)).FentryChainHead
__4:
	if !(i < numElems) {
		goto __6
	}
	{
		*(*int8)(unsafe.Pointer(flagPtr + uintptr(i))) |= int8(func() int32 {
			if i != 0 {
				return TCL_DONT_QUOTE_HASH
			}
			return 0
		}())
		keyPtr = func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(dict)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(dict)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(cPtr + 32))
			}
			return cPtr + 32
		}()
		elem = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 88)) = (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, keyPtr, bp+88)
		}()
		dst += uintptr(XTclConvertElement(tls, elem, *(*int32)(unsafe.Pointer(bp + 88 /* length */)), dst, int32(*(*int8)(unsafe.Pointer(flagPtr + uintptr(i))))))
		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(' ')

		*(*int8)(unsafe.Pointer(flagPtr + uintptr(i+1))) |= int8(TCL_DONT_QUOTE_HASH)
		valuePtr = (*Tcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData
		elem = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 88)) = (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, valuePtr, bp+88)
		}()
		dst += uintptr(XTclConvertElement(tls, elem, *(*int32)(unsafe.Pointer(bp + 88 /* length */)), dst, int32(*(*int8)(unsafe.Pointer(flagPtr + uintptr(i+1))))))
		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(' ')

	}
	goto __5
__5:
	i = i + 2
	cPtr = (*ChainEntry)(unsafe.Pointer(cPtr)).FnextPtr
	goto __4
	goto __6
__6:
	;
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes + uintptr((*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength))) = int8(0)

	if flagPtr != bp+24 {
		XTclpFree(tls, flagPtr)
	}
}

//----------------------------------------------------------------------
//
// SetDictFromAny --
//
//	Convert a non-dictionary object into a dictionary object. This code is
//	very closely related to SetListFromAny in tclListObj.c but does not
//	actually guarantee that a dictionary object will have a string rep (as
//	conversions from lists are handled with a special case.)
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	If the string can be converted, it loses any old internal
//	representation that it had and gains a dictionary's internalRep.
//
//----------------------------------------------------------------------

func sSetDictFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclDictObj.c:597:1: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	var hPtr uintptr
	// var isNew int32 at bp+44, 4

	var dict uintptr
	var cachePtr uintptr
	var discardedValue uintptr
	// var objc int32 at bp+40, 4

	var i int32
	// var objv uintptr at bp+32, 8

	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	var cachePtr6 uintptr
	var cachePtr7 uintptr
	var discardedValue1 uintptr
	var keyPtr uintptr
	var valuePtr uintptr
	// var elemStart uintptr at bp+56, 8

	// var elemSize int32 at bp+72, 4

	// var literal int32 at bp+76, 4

	// var length int32 at bp+48, 4

	// var nextElem uintptr at bp+64, 8

	var limit uintptr
	dict = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Dict{})))

	sInitChainTable(tls, dict)

	// Since lists and dictionaries have very closely-related string
	// representations (i.e. the same parsing code) we can safely special-case
	// the conversion from lists to dictionaries.

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType))) {
		goto __1
	}

	// Cannot fail, we already know the Tcl_ObjType is "list".
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 32)) = *(*uintptr)(unsafe.Pointer(objPtr + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 40)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), objPtr, bp+40, bp+32)
	}
	if !(*(*int32)(unsafe.Pointer(bp + 40))&1 != 0) {
		goto __3
	}
	goto missingValue
__3:
	;

	i = 0
__4:
	if !(i < *(*int32)(unsafe.Pointer(bp + 40))) {
		goto __6
	}

	// Store key and value in the hash table we're building.
	hPtr = sCreateChainEntry(tls, dict, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* objv */)) + uintptr(i)*8)), bp+44)
	if !!(*(*int32)(unsafe.Pointer(bp + 44)) != 0) {
		goto __7
	}
	discardedValue = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

	// Not really a well-formed dictionary as there are duplicate
	// keys, so better get the string rep here so that we can
	// convert back.

	XTcl_GetString(tls, objPtr)

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(discardedValue)).FrefCount, 1) > 1) {
		goto __8
	}
	goto __9
__8:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(discardedValue)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(discardedValue)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __10
	}

	if !((*Tcl_Obj)(unsafe.Pointer(discardedValue)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(discardedValue)).Fbytes != XtclEmptyStringRep) {
		goto __12
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(discardedValue)).Fbytes)
__12:
	;
	(*Tcl_Obj)(unsafe.Pointer(discardedValue)).Flength = -1
__13:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __16
	}
	XTclThreadFreeObj(tls, discardedValue)
	goto __17
__16:
	*(*uintptr)(unsafe.Pointer(discardedValue + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = discardedValue
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__17:
	;
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
	goto __11
__10:
	XTclFreeObj(tls, discardedValue)
__11:
	;
__9:
	;

__7:
	;
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(i+1)*8))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(i+1)*8)))).FrefCount++ // Since hash now holds ref to it
	goto __5
__5:
	i = i + 2
	goto __4
	goto __6
__6:
	;
	goto __2
__1:
	*(*uintptr)(unsafe.Pointer(bp + 64 /* nextElem */)) = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 48)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp+48)
	}()
	limit = *(*uintptr)(unsafe.Pointer(bp + 64)) + uintptr(*(*int32)(unsafe.Pointer(bp + 48)))

__18:
	if !(*(*uintptr)(unsafe.Pointer(bp + 64)) < limit) {
		goto __19
	}

	if !(XTclFindDictElement(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 64)), int32((int64(limit)-int64(*(*uintptr)(unsafe.Pointer(bp + 64))))/1),
		bp+56, bp+64, bp+72, bp+76) != TCL_OK) {
		goto __20
	}
	goto errorInFindDictElement
__20:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 56)) == limit) {
		goto __21
	}
	goto __19
__21:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 64)) == limit) {
		goto __22
	}
	goto missingValue
__22:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 76)) != 0) {
		goto __23
	}
__25:
	;
__28:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __31
	}
	keyPtr = XTclThreadAllocObj(tls)
	goto __32
__31:
	keyPtr = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(keyPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__32:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount = 0
	if !(*(*int32)(unsafe.Pointer(bp + 72)) == 0) {
		goto __33
	}
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = 0
	goto __34
__33:
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 72))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes, *(*uintptr)(unsafe.Pointer(bp + 56)), uint64(*(*int32)(unsafe.Pointer(bp + 72))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes + uintptr(*(*int32)(unsafe.Pointer(bp + 72))))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = *(*int32)(unsafe.Pointer(bp + 72))
__34:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr = uintptr(0)

	goto __26
__26:
	if 0 != 0 {
		goto __25
	}
	goto __27
__27:
	;
	goto __24
__23:
	// Avoid double copy
	;
__35:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __38
	}
	keyPtr = XTclThreadAllocObj(tls)
	goto __39
__38:
	keyPtr = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(keyPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__39:
	;
	goto __36
__36:
	if 0 != 0 {
		goto __35
	}
	goto __37
__37:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 72)))+uint32(1))
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = XTclCopyAndCollapse(tls, *(*int32)(unsafe.Pointer(bp + 72 /* elemSize */)), *(*uintptr)(unsafe.Pointer(bp + 56 /* elemStart */)),
		(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes)
__24:
	;

	if !(XTclFindDictElement(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 64)), int32((int64(limit)-int64(*(*uintptr)(unsafe.Pointer(bp + 64))))/1),
		bp+56, bp+64, bp+72, bp+76) != TCL_OK) {
		goto __40
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount, 1) > 1) {
		goto __41
	}
	goto __42
__41:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __43
	}

	if !((*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != XtclEmptyStringRep) {
		goto __45
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes)
__45:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = -1
__46:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __49
	}
	XTclThreadFreeObj(tls, keyPtr)
	goto __50
__49:
	*(*uintptr)(unsafe.Pointer(keyPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = keyPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__50:
	;
	goto __47
__47:
	if 0 != 0 {
		goto __46
	}
	goto __48
__48:
	;
	goto __44
__43:
	XTclFreeObj(tls, keyPtr)
__44:
	;
__42:
	;

	goto errorInFindDictElement
__40:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 76)) != 0) {
		goto __51
	}
__53:
	;
__56:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0
	}()) {
		goto __59
	}
	valuePtr = XTclThreadAllocObj(tls)
	goto __60
__59:
	valuePtr = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(valuePtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects--
__60:
	;
	goto __57
__57:
	if 0 != 0 {
		goto __56
	}
	goto __58
__58:
	;
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount = 0
	if !(*(*int32)(unsafe.Pointer(bp + 72)) == 0) {
		goto __61
	}
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength = 0
	goto __62
__61:
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 72))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes, *(*uintptr)(unsafe.Pointer(bp + 56)), uint64(*(*int32)(unsafe.Pointer(bp + 72))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes + uintptr(*(*int32)(unsafe.Pointer(bp + 72))))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength = *(*int32)(unsafe.Pointer(bp + 72))
__62:
	;
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr = uintptr(0)

	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
	goto __52
__51:
	// Avoid double copy
	;
__63:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0
	}()) {
		goto __66
	}
	valuePtr = XTclThreadAllocObj(tls)
	goto __67
__66:
	valuePtr = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(valuePtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects--
__67:
	;
	goto __64
__64:
	if 0 != 0 {
		goto __63
	}
	goto __65
__65:
	;
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 72)))+uint32(1))
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength = XTclCopyAndCollapse(tls, *(*int32)(unsafe.Pointer(bp + 72 /* elemSize */)), *(*uintptr)(unsafe.Pointer(bp + 56 /* elemStart */)),
		(*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes)
__52:
	;

	// Store key and value in the hash table we're building.
	hPtr = sCreateChainEntry(tls, dict, keyPtr, bp+44)
	if !!(*(*int32)(unsafe.Pointer(bp + 44)) != 0) {
		goto __68
	}
	discardedValue1 = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount, 1) > 1) {
		goto __69
	}
	goto __70
__69:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __71
	}

	if !((*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != XtclEmptyStringRep) {
		goto __73
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes)
__73:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = -1
__74:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __77
	}
	XTclThreadFreeObj(tls, keyPtr)
	goto __78
__77:
	*(*uintptr)(unsafe.Pointer(keyPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = keyPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++
__78:
	;
	goto __75
__75:
	if 0 != 0 {
		goto __74
	}
	goto __76
__76:
	;
	goto __72
__71:
	XTclFreeObj(tls, keyPtr)
__72:
	;
__70:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(discardedValue1)).FrefCount, 1) > 1) {
		goto __79
	}
	goto __80
__79:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(discardedValue1)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(discardedValue1)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __81
	}

	if !((*Tcl_Obj)(unsafe.Pointer(discardedValue1)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(discardedValue1)).Fbytes != XtclEmptyStringRep) {
		goto __83
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(discardedValue1)).Fbytes)
__83:
	;
	(*Tcl_Obj)(unsafe.Pointer(discardedValue1)).Flength = -1
__84:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr7 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __87
	}
	XTclThreadFreeObj(tls, discardedValue1)
	goto __88
__87:
	*(*uintptr)(unsafe.Pointer(discardedValue1 + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = discardedValue1
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++
__88:
	;
	goto __85
__85:
	if 0 != 0 {
		goto __84
	}
	goto __86
__86:
	;
	goto __82
__81:
	XTclFreeObj(tls, discardedValue1)
__82:
	;
__80:
	;

__68:
	;
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = valuePtr
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++ // since hash now holds ref to it
	goto __18
__19:
	;
__2:
	;

	// Free the old internalRep before setting the new one. We do this as late
	// as possible to allow the conversion code, in particular
	// Tcl_GetStringFromObj, to use that old internalRep.

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __89
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __90
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__90:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__89:
	;

	(*Dict)(unsafe.Pointer(dict)).Fepoch = 0
	(*Dict)(unsafe.Pointer(dict)).Fchain = uintptr(0)
	(*Dict)(unsafe.Pointer(dict)).FrefCount = uint64(1)
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = dict
	*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclDictType))
	return TCL_OK

missingValue:
	if !(interp != uintptr(0)) {
		goto __91
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+23191, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+6915, ts+23220, uintptr(0)))
__91:
	;
errorInFindDictElement:
	sDeleteChainTable(tls, dict)
	XTclpFree(tls, dict)
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclTraceDictPath --
//
//	Trace through a tree of dictionaries using the array of keys given. If
//	the flags argument has the DICT_PATH_UPDATE flag is set, a
//	backward-pointing chain of dictionaries is also built (in the Dict's
//	chain field) and the chained dictionaries are made into unshared
//	dictionaries (if they aren't already.)
//
// Results:
//	The object at the end of the path, or NULL if there was an error. Note
//	that this it is an error for an intermediate dictionary on the path to
//	not exist. If the flags argument has the DICT_PATH_EXISTS set, a
//	non-existent path gives a DICT_PATH_NON_EXISTENT result.
//
// Side effects:
//	If the flags argument is zero or DICT_PATH_EXISTS, there are no side
//	effects (other than potential conversion of objects to dictionaries.)
//	If the flags argument is DICT_PATH_UPDATE, the following additional
//	side effects occur. Shared dictionaries along the path are converted
//	into unshared objects, and a backward-pointing chain is built using
//	the chain fields of the dictionaries (for easy invalidation of string
//	representations using InvalidateDictChain). If the flags argument has
//	the DICT_PATH_CREATE bits set (and not the DICT_PATH_EXISTS bit),
//	non-existant keys will be inserted with a value of an empty
//	dictionary, resulting in the path being built.
//
//----------------------------------------------------------------------

func XTclTraceDictPath(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyc int32, keyv uintptr, flags int32) uintptr { /* tclDictObj.c:762:9: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	var dict uintptr
	var newDict uintptr
	var i int32

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
		sSetDictFromAny(tls, interp, dictPtr) != TCL_OK {
		return uintptr(0)
	}
	dict = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	if flags&DICT_PATH_UPDATE != 0 {
		(*Dict)(unsafe.Pointer(dict)).Fchain = uintptr(0)
	}

	for i = 0; i < keyc; i++ {
		var hPtr uintptr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(dict /* &.table */)).FfindProc})).f(tls, dict /* &.table */, *(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)))
		var tmpObj uintptr

		if hPtr == uintptr(0) {
			// var isNew int32 at bp+48, 4
			// Dummy

			if flags&DICT_PATH_EXISTS != 0 {
				return uintptr(1)
			}
			if flags&DICT_PATH_CREATE != DICT_PATH_CREATE {
				if interp != uintptr(0) {
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
						ts+23231,
						libc.VaList(bp, func() uintptr {
							if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)))).Fbytes != 0 {
								return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)))).Fbytes
							}
							return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)))
						}())))
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+23264,
						func() uintptr {
							if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)))).Fbytes != 0 {
								return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)))).Fbytes
							}
							return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)))
						}(), uintptr(0)))
				}
				return uintptr(0)
			}

			// The next line should always set isNew to 1.

			hPtr = sCreateChainEntry(tls, dict, *(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)), bp+48)
			tmpObj = XTcl_NewDictObj(tls)
			(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount++
			(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = tmpObj
		} else {
			tmpObj = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
			if (*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
				sSetDictFromAny(tls, interp, tmpObj) != TCL_OK {
				return uintptr(0)
			}
		}

		newDict = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
		if flags&DICT_PATH_UPDATE != 0 {
			if (*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount > 1 {
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = -1
						for ok := true; ok; ok = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, tmpObj)
							} else {
								*(*uintptr)(unsafe.Pointer(tmpObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = tmpObj
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, tmpObj)
					}
				}

				tmpObj = XTcl_DuplicateObj(tls, tmpObj)
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount++
				(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = tmpObj
				(*Dict)(unsafe.Pointer(dict)).Fepoch++
				newDict = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
			}

			(*Dict)(unsafe.Pointer(newDict)).Fchain = dictPtr
		}
		dict = newDict
		dictPtr = tmpObj
	}
	return dictPtr
}

//----------------------------------------------------------------------
//
// InvalidateDictChain --
//
//	Go through a dictionary chain (built by an updating invokation of
//	TclTraceDictPath) and invalidate the string representations of all the
//	dictionaries on the chain.
//
// Results:
//	None
//
// Side effects:
//	String reps are invalidated and epoch counters (for detecting illegal
//	concurrent modifications) are updated through the chain of updated
//	dictionaries.
//
//----------------------------------------------------------------------

func sInvalidateDictChain(tls *libc.TLS, dictObj uintptr) { /* tclDictObj.c:859:1: */
	var dict uintptr = *(*uintptr)(unsafe.Pointer(dictObj + 32))

	for ok := true; ok; ok = dict != uintptr(0) {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _isobjPtr uintptr = dictObj
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
			}
		}
		(*Dict)(unsafe.Pointer(dict)).Fepoch++
		dictObj = (*Dict)(unsafe.Pointer(dict)).Fchain
		if dictObj == uintptr(0) {
			break
		}
		(*Dict)(unsafe.Pointer(dict)).Fchain = uintptr(0)
		dict = *(*uintptr)(unsafe.Pointer(dictObj + 32))
	}
}

//----------------------------------------------------------------------
//
// Tcl_DictObjPut --
//
//	Add a key,value pair to a dictionary, or update the value for a key if
//	that key already has a mapping in the dictionary.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	The object pointed to by dictPtr is converted to a dictionary if it is
//	not already one, and any string representation that it has is
//	invalidated.
//
//----------------------------------------------------------------------

func XTcl_DictObjPut(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyPtr uintptr, valuePtr uintptr) int32 { /* tclDictObj.c:896:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var dict uintptr
	var hPtr uintptr
	// var isNew int32 at bp+8, 4

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+23269))
	}

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
		sSetDictFromAny(tls, interp, dictPtr) != TCL_OK {
		return TCL_ERROR
	}

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _isobjPtr uintptr = dictPtr
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
			}
		}
	}
	dict = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	hPtr = sCreateChainEntry(tls, dict, keyPtr, bp+8)
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++
	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		var oldValuePtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Flength = -1
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, oldValuePtr)
					} else {
						*(*uintptr)(unsafe.Pointer(oldValuePtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldValuePtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, oldValuePtr)
			}
		}

	}
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = valuePtr
	(*Dict)(unsafe.Pointer(dict)).Fepoch++
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_DictObjGet --
//
//	Given a key, get its value from the dictionary (or NULL if key is not
//	found in dictionary.)
//
// Results:
//	A standard Tcl result. The variable pointed to by valuePtrPtr is
//	updated with the value for the key. Note that it is not an error for
//	the key to have no mapping in the dictionary.
//
// Side effects:
//	The object pointed to by dictPtr is converted to a dictionary if it is
//	not already one.
//
//----------------------------------------------------------------------

func XTcl_DictObjGet(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyPtr uintptr, valuePtrPtr uintptr) int32 { /* tclDictObj.c:952:1: */
	var dict uintptr
	var hPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
		sSetDictFromAny(tls, interp, dictPtr) != TCL_OK {
		*(*uintptr)(unsafe.Pointer(valuePtrPtr)) = uintptr(0)
		return TCL_ERROR
	}

	dict = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(dict /* &.table */)).FfindProc})).f(tls, dict /* &.table */, keyPtr)
	if hPtr == uintptr(0) {
		*(*uintptr)(unsafe.Pointer(valuePtrPtr)) = uintptr(0)
	} else {
		*(*uintptr)(unsafe.Pointer(valuePtrPtr)) = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_DictObjRemove --
//
//	Remove the key,value pair with the given key from the dictionary; the
//	key does not need to be present in the dictionary.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	The object pointed to by dictPtr is converted to a dictionary if it is
//	not already one, and any string representation that it has is
//	invalidated.
//
//----------------------------------------------------------------------

func XTcl_DictObjRemove(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyPtr uintptr) int32 { /* tclDictObj.c:997:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var dict uintptr

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+23284))
	}

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
		sSetDictFromAny(tls, interp, dictPtr) != TCL_OK {
		return TCL_ERROR
	}

	dict = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	if sDeleteChainEntry(tls, dict, keyPtr) != 0 {
		if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(0) {
			for ok := true; ok; ok = 0 != 0 {
				var _isobjPtr uintptr = dictPtr
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
					if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
				}
			}
		}
		(*Dict)(unsafe.Pointer(dict)).Fepoch++
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_DictObjSize --
//
//	How many key,value pairs are there in the dictionary?
//
// Results:
//	A standard Tcl result. Updates the variable pointed to by sizePtr with
//	the number of key,value pairs in the dictionary.
//
// Side effects:
//	The dictPtr object is converted to a dictionary type if it is not a
//	dictionary already.
//
//----------------------------------------------------------------------

func XTcl_DictObjSize(tls *libc.TLS, interp uintptr, dictPtr uintptr, sizePtr uintptr) int32 { /* tclDictObj.c:1042:1: */
	var dict uintptr

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
		sSetDictFromAny(tls, interp, dictPtr) != TCL_OK {
		return TCL_ERROR
	}

	dict = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	*(*int32)(unsafe.Pointer(sizePtr)) = (*Dict)(unsafe.Pointer(dict)).Ftable.FnumEntries
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_DictObjFirst --
//
//	Start a traversal of the dictionary. Caller must supply the search
//	context, pointers for returning key and value, and a pointer to allow
//	indication of whether the dictionary has been traversed (i.e. the
//	dictionary is empty). The order of traversal is undefined.
//
// Results:
//	A standard Tcl result. Updates the variables pointed to by keyPtrPtr,
//	valuePtrPtr and donePtr. Either of keyPtrPtr and valuePtrPtr may be
//	NULL, in which case the key/value is not made available to the caller.
//
// Side effects:
//	The dictPtr object is converted to a dictionary type if it is not a
//	dictionary already. The search context is initialised if the search
//	has not finished. The dictionary's internal rep is Tcl_Preserve()d if
//	the dictionary has at least one element.
//
//----------------------------------------------------------------------

func XTcl_DictObjFirst(tls *libc.TLS, interp uintptr, dictPtr uintptr, searchPtr uintptr, keyPtrPtr uintptr, valuePtrPtr uintptr, donePtr uintptr) int32 { /* tclDictObj.c:1084:1: */
	var dict uintptr
	var cPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
		sSetDictFromAny(tls, interp, dictPtr) != TCL_OK {
		return TCL_ERROR
	}

	dict = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	cPtr = (*Dict)(unsafe.Pointer(dict)).FentryChainHead
	if cPtr == uintptr(0) {
		(*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch = -1
		*(*int32)(unsafe.Pointer(donePtr)) = 1
	} else {
		*(*int32)(unsafe.Pointer(donePtr)) = 0
		(*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).FdictionaryPtr = dict
		(*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch = (*Dict)(unsafe.Pointer(dict)).Fepoch
		(*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).Fnext = (*ChainEntry)(unsafe.Pointer(cPtr)).FnextPtr
		(*Dict)(unsafe.Pointer(dict)).FrefCount++
		if keyPtrPtr != uintptr(0) {
			*(*uintptr)(unsafe.Pointer(keyPtrPtr)) = func() uintptr {
				if (*Tcl_HashTable)(unsafe.Pointer(dict)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(dict)).FkeyType == -1 {
					return *(*uintptr)(unsafe.Pointer(cPtr + 32))
				}
				return cPtr + 32
			}()
		}
		if valuePtrPtr != uintptr(0) {
			*(*uintptr)(unsafe.Pointer(valuePtrPtr)) = (*Tcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_DictObjNext --
//
//	Continue a traversal of a dictionary previously started with
//	Tcl_DictObjFirst. This function is safe against concurrent
//	modification of the underlying object (including type shimmering),
//	treating such situations as if the search has terminated, though it is
//	up to the caller to ensure that the object itself is not disposed
//	until the search has finished. It is _not_ safe against modifications
//	from other threads.
//
// Results:
//	Updates the variables pointed to by keyPtrPtr, valuePtrPtr and
//	donePtr. Either of keyPtrPtr and valuePtrPtr may be NULL, in which
//	case the key/value is not made available to the caller.
//
// Side effects:
//	Removes a reference to the dictionary's internal rep if the search
//	terminates.
//
//----------------------------------------------------------------------

func XTcl_DictObjNext(tls *libc.TLS, searchPtr uintptr, keyPtrPtr uintptr, valuePtrPtr uintptr, donePtr uintptr) { /* tclDictObj.c:1153:1: */
	var cPtr uintptr

	// If the searh is done; we do no work.

	if (*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch == -1 {
		*(*int32)(unsafe.Pointer(donePtr)) = 1
		return
	}

	// Bail out if the dictionary has had any elements added, modified or
	// removed. This *shouldn't* happen, but...

	if (*Dict)(unsafe.Pointer((*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).FdictionaryPtr)).Fepoch != (*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch {
		XTcl_Panic(tls, ts+23302, 0)
	}

	cPtr = (*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).Fnext
	if cPtr == uintptr(0) {
		XTcl_DictObjDone(tls, searchPtr)
		*(*int32)(unsafe.Pointer(donePtr)) = 1
		return
	}

	(*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).Fnext = (*ChainEntry)(unsafe.Pointer(cPtr)).FnextPtr
	*(*int32)(unsafe.Pointer(donePtr)) = 0
	if keyPtrPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(keyPtrPtr)) = func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer((*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).FdictionaryPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).FdictionaryPtr)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(cPtr + 32))
			}
			return cPtr + 32
		}()
	}
	if valuePtrPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(valuePtrPtr)) = (*Tcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData
	}
}

//----------------------------------------------------------------------
//
// Tcl_DictObjDone --
//
//	Call this if you want to stop a search before you reach the end of the
//	dictionary (e.g. because of abnormal termination of the search). It
//	need not be used if the search reaches its natural end (i.e. if either
//	Tcl_DictObjFirst or Tcl_DictObjNext sets its donePtr variable to 1).
//
// Results:
//	None.
//
// Side effects:
//	Removes a reference to the dictionary's internal rep.
//
//----------------------------------------------------------------------

func XTcl_DictObjDone(tls *libc.TLS, searchPtr uintptr) { /* tclDictObj.c:1222:1: */
	var dict uintptr

	if (*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch != -1 {
		(*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch = -1
		dict = (*Tcl_DictSearch)(unsafe.Pointer(searchPtr)).FdictionaryPtr
		if libc.PostDecUint64(&(*Dict)(unsafe.Pointer(dict)).FrefCount, 1) <= uint64(1) {
			sDeleteDict(tls, dict)
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_DictObjPutKeyList --
//
//	Add a key...key,value pair to a dictionary tree. The main dictionary
//	value must not be shared, though sub-dictionaries may be. All
//	intermediate dictionaries on the path must exist.
//
// Results:
//	A standard Tcl result. Note that in the error case, a message is left
//	in interp unless that is NULL.
//
// Side effects:
//	If the dictionary and any of its sub-dictionaries on the path have
//	string representations, these are invalidated.
//
//----------------------------------------------------------------------

func XTcl_DictObjPutKeyList(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyc int32, keyv uintptr, valuePtr uintptr) int32 { /* tclDictObj.c:1257:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var dict uintptr
	var hPtr uintptr
	// var isNew int32 at bp+16, 4

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+23348))
	}
	if keyc < 1 {
		XTcl_Panic(tls, ts+23370, libc.VaList(bp+8, ts+23348))
	}

	dictPtr = XTclTraceDictPath(tls, interp, dictPtr, keyc-1, keyv, DICT_PATH_CREATE)
	if dictPtr == uintptr(0) {
		return TCL_ERROR
	}

	dict = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	hPtr = sCreateChainEntry(tls, dict, *(*uintptr)(unsafe.Pointer(keyv + uintptr(keyc-1)*8)), bp+16)
	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++
	if !(*(*int32)(unsafe.Pointer(bp + 16)) != 0) {
		var oldValuePtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, oldValuePtr)
					} else {
						*(*uintptr)(unsafe.Pointer(oldValuePtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldValuePtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, oldValuePtr)
			}
		}

	}
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = valuePtr
	sInvalidateDictChain(tls, dictPtr)

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_DictObjRemoveKeyList --
//
//	Remove a key...key,value pair from a dictionary tree (the value
//	removed is implicit in the key path). The main dictionary value must
//	not be shared, though sub-dictionaries may be. It is not an error if
//	there is no value associated with the given key list, but all
//	intermediate dictionaries on the key path must exist.
//
// Results:
//	A standard Tcl result. Note that in the error case, a message is left
//	in interp unless that is NULL.
//
// Side effects:
//	If the dictionary and any of its sub-dictionaries on the key path have
//	string representations, these are invalidated.
//
//----------------------------------------------------------------------

func XTcl_DictObjRemoveKeyList(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyc int32, keyv uintptr) int32 { /* tclDictObj.c:1317:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var dict uintptr

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+23400))
	}
	if keyc < 1 {
		XTcl_Panic(tls, ts+23370, libc.VaList(bp+8, ts+23400))
	}

	dictPtr = XTclTraceDictPath(tls, interp, dictPtr, keyc-1, keyv, DICT_PATH_UPDATE)
	if dictPtr == uintptr(0) {
		return TCL_ERROR
	}

	dict = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	sDeleteChainEntry(tls, dict, *(*uintptr)(unsafe.Pointer(keyv + uintptr(keyc-1)*8)))
	sInvalidateDictChain(tls, dictPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_NewDictObj --
//
//	This function is normally called when not debugging: i.e., when
//	TCL_MEM_DEBUG is not defined. It creates a new dict object without any
//	content.
//
//	When TCL_MEM_DEBUG is defined, this function just returns the result
//	of calling the debugging version Tcl_DbNewDictObj.
//
// Results:
//	A new dict object is returned; it has no keys defined in it. The new
//	object's string representation is left NULL, and the ref count of the
//	object is 0.
//
// Side Effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_NewDictObj(tls *libc.TLS) uintptr { /* tclDictObj.c:1366:9: */
	var dictPtr uintptr
	var dict uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			dictPtr = XTclThreadAllocObj(tls)
		} else {
			dictPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = uintptr(0)
	{
	}

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _isobjPtr uintptr = dictPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	dict = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Dict{})))
	sInitChainTable(tls, dict)
	(*Dict)(unsafe.Pointer(dict)).Fepoch = 0
	(*Dict)(unsafe.Pointer(dict)).Fchain = uintptr(0)
	(*Dict)(unsafe.Pointer(dict)).FrefCount = uint64(1)
	*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = dict
	*(*uintptr)(unsafe.Pointer(dictPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclDictType))
	return dictPtr
}

//----------------------------------------------------------------------
//
// Tcl_DbNewDictObj --
//
//	This function is normally called when debugging: i.e., when
//	TCL_MEM_DEBUG is defined. It creates new dict objects. It is the same
//	as the Tcl_NewDictObj function above except that it calls
//	Tcl_DbCkalloc directly with the file name and line number from its
//	caller. This simplifies debugging since then the [memory active]
//	command will report the correct file name and line number when
//	reporting objects that haven't been freed.
//
//	When TCL_MEM_DEBUG is not defined, this function just returns the
//	result of calling Tcl_NewDictObj.
//
// Results:
//	A new dict object is returned; it has no keys defined in it. The new
//	object's string representation is left NULL, and the ref count of the
//	object is 0.
//
// Side Effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_DbNewDictObj(tls *libc.TLS, file uintptr, line int32) uintptr { /* tclDictObj.c:1417:9: */
	return XTcl_NewDictObj(tls)
}

//**** START OF FUNCTIONS IMPLEMENTING TCL COMMANDS ****

//----------------------------------------------------------------------
//
// DictCreateCmd --
//
//	This function implements the "dict create" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictCreateCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:1463:1: */
	var dictObj uintptr
	var i int32

	// Must have an even number of arguments; note that number of preceding
	// arguments (i.e. "dict create" is also even, which makes this much
	// easier.)

	if objc&1 == 0 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23425)
		return TCL_ERROR
	}

	dictObj = XTcl_NewDictObj(tls)
	for i = 1; i < objc; i = i + 2 {
		// The next command is assumed to never fail...
		XTcl_DictObjPut(tls, uintptr(0), dictObj, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))
	}
	XTcl_SetObjResult(tls, interp, dictObj)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictGetCmd --
//
//	This function implements the "dict get" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictGetCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:1513:1: */
	bp := tls.Alloc(92)
	defer tls.Free(92)

	var dictPtr uintptr
	*(*uintptr)(unsafe.Pointer(bp + 80 /* valuePtr */)) = uintptr(0)
	var result int32

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23441)
		return TCL_ERROR
	}

	// Test for the special case of no keys, which returns a *list* of all
	// key,value pairs. We produce a copy here because that makes subsequent
	// list handling more efficient.

	if objc == 2 {
		*(*uintptr)(unsafe.Pointer(bp + 72 /* keyPtr */)) = uintptr(0)
		var listPtr uintptr
		// var search Tcl_DictSearch at bp+48, 24

		// var done int32 at bp+88, 4

		result = XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48,
			bp+72, bp+80, bp+88)
		if result != TCL_OK {
			return result
		}
		listPtr = XTcl_NewListObj(tls, 0, uintptr(0))
		for !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
			// Assume these won't fail as we have complete control over the
			// types of things here.

			XTcl_ListObjAppendElement(tls, interp, listPtr, *(*uintptr)(unsafe.Pointer(bp + 72 /* keyPtr */)))
			XTcl_ListObjAppendElement(tls, interp, listPtr, *(*uintptr)(unsafe.Pointer(bp + 80 /* valuePtr */)))

			XTcl_DictObjNext(tls, bp+48, bp+72, bp+80, bp+88)
		}
		XTcl_SetObjResult(tls, interp, listPtr)
		return TCL_OK
	}

	// Loop through the list of keys, looking up the key at the current index
	// in the current dictionary each time. Once we've done the lookup, we set
	// the current dictionary to be the value we looked up (in case the value
	// was not the last one and we are going through a chain of searches.)
	// Note that this loop always executes at least once.

	dictPtr = XTclTraceDictPath(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), objc-3, objv+uintptr(2)*8, DICT_PATH_READ)
	if dictPtr == uintptr(0) {
		return TCL_ERROR
	}
	result = XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), bp+80)
	if result != TCL_OK {
		return result
	}
	if *(*uintptr)(unsafe.Pointer(bp + 80)) == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+23231,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+23264,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))
			}(), uintptr(0)))
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 80 /* valuePtr */)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictReplaceCmd --
//
//	This function implements the "dict replace" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictReplaceCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:1606:1: */
	var dictPtr uintptr
	var i int32

	if objc < 2 || objc&1 != 0 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23462)
		return TCL_ERROR
	}

	dictPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
		sSetDictFromAny(tls, interp, dictPtr) != TCL_OK {
		return TCL_ERROR
	}
	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		dictPtr = XTcl_DuplicateObj(tls, dictPtr)
	}
	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _isobjPtr uintptr = dictPtr
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
			}
		}
	}
	for i = 2; i < objc; i = i + 2 {
		XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))
	}
	XTcl_SetObjResult(tls, interp, dictPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictRemoveCmd --
//
//	This function implements the "dict remove" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictRemoveCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:1657:1: */
	var dictPtr uintptr
	var i int32

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23441)
		return TCL_ERROR
	}

	dictPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
		sSetDictFromAny(tls, interp, dictPtr) != TCL_OK {
		return TCL_ERROR
	}
	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		dictPtr = XTcl_DuplicateObj(tls, dictPtr)
	}
	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _isobjPtr uintptr = dictPtr
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
			}
		}
	}
	for i = 2; i < objc; i++ {
		XTcl_DictObjRemove(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}
	XTcl_SetObjResult(tls, interp, dictPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictMergeCmd --
//
//	This function implements the "dict merge" Tcl command. See the user
//	documentation for details on what it does, and TIP#163 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictMergeCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:1708:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var targetObj uintptr
	*(*uintptr)(unsafe.Pointer(bp + 24 /* keyObj */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 32 /* valueObj */)) = uintptr(0)
	var allocatedDict int32 = 0
	var i int32
	// var done int32 at bp+40, 4

	// var search Tcl_DictSearch at bp, 24

	if objc == 1 {
		// No dictionary arguments; return default (empty value).

		return TCL_OK
	}

	// Make sure first argument is a dictionary.

	targetObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if (*Tcl_Obj)(unsafe.Pointer(targetObj)).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
		sSetDictFromAny(tls, interp, targetObj) != TCL_OK {
		return TCL_ERROR
	}

	if objc == 2 {
		// Single argument, return it.

		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		return TCL_OK
	}

	// Normal behaviour: combining two (or more) dictionaries.

	if (*Tcl_Obj)(unsafe.Pointer(targetObj)).FrefCount > 1 {
		targetObj = XTcl_DuplicateObj(tls, targetObj)
		allocatedDict = 1
	}
	for i = 2; i < objc; i++ {
		if XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp, bp+24, bp+32,
			bp+40) != TCL_OK {
			if allocatedDict != 0 {
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(targetObj)).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer(targetObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(targetObj)).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer(targetObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(targetObj)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(targetObj)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer(targetObj)).Flength = -1
						for ok := true; ok; ok = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, targetObj)
							} else {
								*(*uintptr)(unsafe.Pointer(targetObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = targetObj
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, targetObj)
					}
				}

			}
			return TCL_ERROR
		}
		for !(*(*int32)(unsafe.Pointer(bp + 40)) != 0) {
			// Next line can't fail; already know we have a dictionary in
			// targetObj.

			XTcl_DictObjPut(tls, uintptr(0), targetObj, *(*uintptr)(unsafe.Pointer(bp + 24 /* keyObj */)), *(*uintptr)(unsafe.Pointer(bp + 32 /* valueObj */)))
			XTcl_DictObjNext(tls, bp, bp+24, bp+32, bp+40)
		}
		XTcl_DictObjDone(tls, bp)
	}
	XTcl_SetObjResult(tls, interp, targetObj)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictKeysCmd --
//
//	This function implements the "dict keys" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictKeysCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:1796:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var listPtr uintptr
	var pattern uintptr = uintptr(0)

	if objc != 2 && objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23489)
		return TCL_ERROR
	}

	// A direct check that we have a dictionary. We don't start the iteration
	// yet because that might allocate memory or set locks that we do not
	// need. [Bug 1705778, leak K04]

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
		sSetDictFromAny(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) != TCL_OK {
		return TCL_ERROR
	}

	if objc == 3 {
		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}()
	}
	listPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	if pattern != uintptr(0) && libc.Xstrpbrk(tls, pattern, ts+13556) == uintptr(0) {
		*(*uintptr)(unsafe.Pointer(bp /* valuePtr */)) = uintptr(0)

		XTcl_DictObjGet(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp)
		if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			XTcl_ListObjAppendElement(tls, uintptr(0), listPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}
	} else {
		// var search Tcl_DictSearch at bp+8, 24

		*(*uintptr)(unsafe.Pointer(bp + 32 /* keyPtr */)) = uintptr(0)
		*(*int32)(unsafe.Pointer(bp + 40 /* done */)) = 0

		// At this point, we know we have a dictionary (or at least something
		// that can be represented; it could theoretically have shimmered away
		// when the pattern was fetched, but that shouldn't be damaging) so we
		// can start the iteration process without checking for failures.

		XTcl_DictObjFirst(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp+32, uintptr(0), bp+40)
		for ; !(*(*int32)(unsafe.Pointer(bp + 40)) != 0); XTcl_DictObjNext(tls, bp+8, bp+32, uintptr(0), bp+40) {
			if !(pattern != 0) || XTcl_StringMatch(tls, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 32)))
			}(), pattern) != 0 {
				XTcl_ListObjAppendElement(tls, uintptr(0), listPtr, *(*uintptr)(unsafe.Pointer(bp + 32 /* keyPtr */)))
			}
		}
		XTcl_DictObjDone(tls, bp+8)
	}

	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictValuesCmd --
//
//	This function implements the "dict values" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictValuesCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:1876:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	*(*uintptr)(unsafe.Pointer(bp + 24 /* valuePtr */)) = uintptr(0)
	var listPtr uintptr
	// var search Tcl_DictSearch at bp, 24

	// var done int32 at bp+32, 4

	var pattern uintptr

	if objc != 2 && objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23489)
		return TCL_ERROR
	}

	if XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, uintptr(0), bp+24,
		bp+32) != TCL_OK {
		return TCL_ERROR
	}
	if objc == 3 {
		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}()
	} else {
		pattern = uintptr(0)
	}
	listPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	for ; !(*(*int32)(unsafe.Pointer(bp + 32)) != 0); XTcl_DictObjNext(tls, bp, uintptr(0), bp+24, bp+32) {
		if pattern == uintptr(0) || XTcl_StringMatch(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
		}(), pattern) != 0 {
			// Assume this operation always succeeds.

			XTcl_ListObjAppendElement(tls, interp, listPtr, *(*uintptr)(unsafe.Pointer(bp + 24 /* valuePtr */)))
		}
	}
	XTcl_DictObjDone(tls, bp)

	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictSizeCmd --
//
//	This function implements the "dict size" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictSizeCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:1936:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var result int32
	// var size int32 at bp, 4

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23510)
		return TCL_ERROR
	}
	result = XTcl_DictObjSize(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	if result == TCL_OK {
		XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp /* size */))))
	}
	return result
}

//----------------------------------------------------------------------
//
// DictExistsCmd --
//
//	This function implements the "dict exists" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictExistsCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:1974:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var dictPtr uintptr
	// var valuePtr uintptr at bp, 8

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23521)
		return TCL_ERROR
	}

	dictPtr = XTclTraceDictPath(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), objc-3, objv+uintptr(2)*8,
		DICT_PATH_EXISTS)
	if dictPtr == uintptr(0) || dictPtr == uintptr(1) ||
		XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)),
			bp) != TCL_OK {
		XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(0 != 0)))
	} else {
		XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(libc.Bool32(*(*uintptr)(unsafe.Pointer(bp)) != uintptr(0)) != 0)))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictInfoCmd --
//
//	This function implements the "dict info" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictInfoCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:2018:1: */
	var dictPtr uintptr
	var dict uintptr
	var statsStr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23510)
		return TCL_ERROR
	}

	dictPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclDictType)) &&
		sSetDictFromAny(tls, interp, dictPtr) != TCL_OK {
		return TCL_ERROR
	}
	dict = *(*uintptr)(unsafe.Pointer(dictPtr + 32))

	statsStr = XTcl_HashStats(tls, dict)
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, statsStr, -1))
	XTclpFree(tls, statsStr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictIncrCmd --
//
//	This function implements the "dict incr" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictIncrCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:2065:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var code int32 = TCL_OK
	var dictPtr uintptr
	*(*uintptr)(unsafe.Pointer(bp /* valuePtr */)) = uintptr(0)

	if objc < 3 || objc > 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23546)
		return TCL_ERROR
	}

	dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), 0)
	if dictPtr == uintptr(0) {
		// Variable didn't yet exist. Create new dictionary value.

		dictPtr = XTcl_NewDictObj(tls)
	} else if XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp) != TCL_OK {
		// Variable contents are not a dict, report error.

		return TCL_ERROR
	}
	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		// A little internals surgery to avoid copying a string rep that will
		// soon be no good.

		var saved uintptr = (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes
		var oldPtr uintptr = dictPtr

		(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = uintptr(0)
		dictPtr = XTcl_DuplicateObj(tls, dictPtr)
		(*Tcl_Obj)(unsafe.Pointer(oldPtr)).Fbytes = saved
	}
	if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
		// Key not in dictionary. Create new key with increment as value.

		if objc == 4 {
			// Verify increment is an integer.

			// var increment Mp_int at bp+8, 24

			code = XTcl_GetBignumFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+8)
			if code != TCL_OK {
				XTcl_AddErrorInfo(tls, interp, ts+23574)
			} else {
				// Remember to dispose with the bignum as we're not actually
				// using it directly. [Bug 2874678]

				XTclBN_mp_clear(tls, bp+8)
				XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(objv + 3*8)))
			}
		} else {
			XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), XTcl_NewIntObj(tls, 1))
		}
	} else {
		// Key in dictionary. Increment its value with minimum dup.

		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount > 1 {
			*(*uintptr)(unsafe.Pointer(bp /* valuePtr */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp /* valuePtr */)))
			XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(bp /* valuePtr */)))
		}
		if objc == 4 {
			code = XTclIncrObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* valuePtr */)), *(*uintptr)(unsafe.Pointer(objv + 3*8)))
		} else {
			var incrPtr uintptr

			for ok := true; ok; ok = 0 != 0 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						incrPtr = XTclThreadAllocObj(tls)
					} else {
						incrPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(incrPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount = 0
				(*Tcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes = uintptr(0)
				*(*int64)(unsafe.Pointer(incrPtr + 32)) = int64(1)
				(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
				{
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount++
			code = XTclIncrObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* valuePtr */)), incrPtr)
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(incrPtr)).Flength = -1
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, incrPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(incrPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = incrPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, incrPtr)
				}
			}

		}
	}
	if code == TCL_OK {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _isobjPtr uintptr = dictPtr
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
			}
		}
		*(*uintptr)(unsafe.Pointer(bp /* valuePtr */)) = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0),
			dictPtr, TCL_LEAVE_ERR_MSG)
		if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
			code = TCL_ERROR
		} else {
			XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* valuePtr */)))
		}
	} else if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount == 0 {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
				for ok4 := true; ok4; ok4 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, dictPtr)
					} else {
						*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, dictPtr)
			}
		}

	}
	return code
}

//----------------------------------------------------------------------
//
// DictLappendCmd --
//
//	This function implements the "dict lappend" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictLappendCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:2187:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var dictPtr uintptr
	// var valuePtr uintptr at bp, 8

	var resultPtr uintptr
	var i int32
	var allocatedDict int32 = 0
	var allocatedValue int32 = 0

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23599)
		return TCL_ERROR
	}

	dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), 0)
	if dictPtr == uintptr(0) {
		allocatedDict = 1
		dictPtr = XTcl_NewDictObj(tls)
	} else if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		allocatedDict = 1
		dictPtr = XTcl_DuplicateObj(tls, dictPtr)
	}

	if XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp) != TCL_OK {
		if allocatedDict != 0 {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, dictPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, dictPtr)
				}
			}

		}
		return TCL_ERROR
	}

	if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
		*(*uintptr)(unsafe.Pointer(bp /* valuePtr */)) = XTcl_NewListObj(tls, objc-3, objv+uintptr(3)*8)
		allocatedValue = 1
	} else {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount > 1 {
			allocatedValue = 1
			*(*uintptr)(unsafe.Pointer(bp /* valuePtr */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp /* valuePtr */)))
		}

		for i = 3; i < objc; i++ {
			if XTcl_ListObjAppendElement(tls, interp, *(*uintptr)(unsafe.Pointer(bp)),
				*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) != TCL_OK {
				if allocatedValue != 0 {
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount, 1) > 1 {
					} else {
						if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr)).FfreeIntRepProc) != 0) {
							{
							}
							if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != XtclEmptyStringRep {
								XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes)
							}
							(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = -1
							for ok1 := true; ok1; ok1 = 0 != 0 {
								var cachePtr uintptr
								if uintptr(0) == uintptr(0) || func() bool {
									cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
									return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
								}() {
									XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp)))
								} else {
									*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
									(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp))
									(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
								}
							}
						} else {
							XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp /* valuePtr */)))
						}
					}

				}
				if allocatedDict != 0 {
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
					} else {
						if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
							{
							}
							if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
								XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
							}
							(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
							for ok2 := true; ok2; ok2 = 0 != 0 {
								var cachePtr uintptr
								if uintptr(0) == uintptr(0) || func() bool {
									cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
									return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
								}() {
									XTclThreadFreeObj(tls, dictPtr)
								} else {
									*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
									(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
									(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
								}
							}
						} else {
							XTclFreeObj(tls, dictPtr)
						}
					}

				}
				return TCL_ERROR
			}
		}
	}

	if allocatedValue != 0 {
		XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(bp /* valuePtr */)))
	} else if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(0) {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _isobjPtr uintptr = dictPtr
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
			}
		}
	}

	resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), dictPtr,
		TCL_LEAVE_ERR_MSG)
	if resultPtr == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictAppendCmd --
//
//	This function implements the "dict append" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictAppendCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:2274:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var dictPtr uintptr
	// var valuePtr uintptr at bp, 8

	var resultPtr uintptr
	var i int32
	var allocatedDict int32 = 0

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23599)
		return TCL_ERROR
	}

	dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), 0)
	if dictPtr == uintptr(0) {
		allocatedDict = 1
		dictPtr = XTcl_NewDictObj(tls)
	} else if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		allocatedDict = 1
		dictPtr = XTcl_DuplicateObj(tls, dictPtr)
	}

	if XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp) != TCL_OK {
		if allocatedDict != 0 {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, dictPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, dictPtr)
				}
			}

		}
		return TCL_ERROR
	}

	if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				*(*uintptr)(unsafe.Pointer(bp)) = XTclThreadAllocObj(tls)
			} else {
				*(*uintptr)(unsafe.Pointer(bp)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr = uintptr(0)
		{
		}

	} else if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount > 1 {
		*(*uintptr)(unsafe.Pointer(bp /* valuePtr */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp /* valuePtr */)))
	}

	for i = 3; i < objc; i++ {
		XTcl_AppendObjToObj(tls, *(*uintptr)(unsafe.Pointer(bp /* valuePtr */)), *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}

	XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(bp /* valuePtr */)))

	resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), dictPtr,
		TCL_LEAVE_ERR_MSG)
	if resultPtr == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictForNRCmd --
//
//	These functions implement the "dict for" Tcl command.  See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictForNRCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:2344:1: */
	bp := tls.Alloc(76)
	defer tls.Free(76)

	var iPtr uintptr
	var scriptObj uintptr
	var keyVarObj uintptr
	var valueVarObj uintptr
	// var varv uintptr at bp+40, 8

	// var keyObj uintptr at bp+56, 8

	// var valueObj uintptr at bp+64, 8

	var searchPtr uintptr
	// var varc int32 at bp+48, 4

	// var done int32 at bp+72, 4

	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var _objPtr uintptr
	var _callbackPtr uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	iPtr = interp

	if !(objc != 4) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+23627)
	return TCL_ERROR
__1:
	;

	// Parse arguments.

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 48)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48, bp+40)
	}() != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 48)) != 2) {
		goto __3
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+23671, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+23708, ts+23186, ts+5142, uintptr(0)))
	return TCL_ERROR
__3:
	;
	searchPtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(Tcl_DictSearch{})))
	if !(XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), searchPtr, bp+56, bp+64,
		bp+72) != TCL_OK) {
		goto __4
	}
	XTclStackFree(tls, interp, searchPtr)
	return TCL_ERROR
__4:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 72)) != 0) {
		goto __5
	}
	XTclStackFree(tls, interp, searchPtr)
	return TCL_OK
__5:
	;
	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 48)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48, bp+40)
	}
	keyVarObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* varv */))))
	valueVarObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* varv */)) + 1*8))
	scriptObj = *(*uintptr)(unsafe.Pointer(objv + 3*8))

	// Make sure that these objects (which we need throughout the body of the
	// loop) don't vanish. Note that the dictionary internal rep is locked
	// internally so that updates, shimmering, etc are not a problem.

	(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(scriptObj)).FrefCount++

	// Stop the value from getting hit in any way by any traces on the key
	// variable.

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FrefCount++
	if !(XTcl_ObjSetVar2(tls, interp, keyVarObj, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 56)),
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __6
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FrefCount, 1) > 1) {
		goto __7
	}
	goto __8
__7:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __9
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != XtclEmptyStringRep) {
		goto __11
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes)
__11:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Flength = -1
__12:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __15
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
	goto __16
__15:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 64))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__16:
	;
	goto __13
__13:
	if 0 != 0 {
		goto __12
	}
	goto __14
__14:
	;
	goto __10
__9:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* valueObj */)))
__10:
	;
__8:
	;

	goto error
__6:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FrefCount, 1) > 1) {
		goto __17
	}
	goto __18
__17:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __19
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != XtclEmptyStringRep) {
		goto __21
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes)
__21:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Flength = -1
__22:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __25
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
	goto __26
__25:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 64))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__26:
	;
	goto __23
__23:
	if 0 != 0 {
		goto __22
	}
	goto __24
__24:
	;
	goto __20
__19:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* valueObj */)))
__20:
	;
__18:
	;

	if !(XTcl_ObjSetVar2(tls, interp, valueVarObj, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 64)),
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __27
	}
	goto error
__27:
	;

	// Run the script.

__28:
__31:
	;
__34:
	if !(interp == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __37
	}
	_objPtr = XTclThreadAllocObj(tls)
	goto __38
__37:
	_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__38:
	;
	goto __35
__35:
	if 0 != 0 {
		goto __34
	}
	goto __36
__36:
	;
	_callbackPtr = _objPtr
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sDictForLoopCallback}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = searchPtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = keyVarObj
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = valueVarObj
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = scriptObj
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	return XTclNREvalObjEx(tls, interp, scriptObj, 0, (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, 3)

	// For unwinding everything on error.

error:
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FrefCount, 1) > 1) {
		goto __39
	}
	goto __40
__39:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __41
	}

	if !((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __43
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes)
__43:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Flength = -1
__44:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __47
	}
	XTclThreadFreeObj(tls, keyVarObj)
	goto __48
__47:
	*(*uintptr)(unsafe.Pointer(keyVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = keyVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__48:
	;
	goto __45
__45:
	if 0 != 0 {
		goto __44
	}
	goto __46
__46:
	;
	goto __42
__41:
	XTclFreeObj(tls, keyVarObj)
__42:
	;
__40:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FrefCount, 1) > 1) {
		goto __49
	}
	goto __50
__49:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __51
	}

	if !((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __53
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes)
__53:
	;
	(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Flength = -1
__54:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __57
	}
	XTclThreadFreeObj(tls, valueVarObj)
	goto __58
__57:
	*(*uintptr)(unsafe.Pointer(valueVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = valueVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++
__58:
	;
	goto __55
__55:
	if 0 != 0 {
		goto __54
	}
	goto __56
__56:
	;
	goto __52
__51:
	XTclFreeObj(tls, valueVarObj)
__52:
	;
__50:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(scriptObj)).FrefCount, 1) > 1) {
		goto __59
	}
	goto __60
__59:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __61
	}

	if !((*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != XtclEmptyStringRep) {
		goto __63
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes)
__63:
	;
	(*Tcl_Obj)(unsafe.Pointer(scriptObj)).Flength = -1
__64:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __67
	}
	XTclThreadFreeObj(tls, scriptObj)
	goto __68
__67:
	*(*uintptr)(unsafe.Pointer(scriptObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = scriptObj
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++
__68:
	;
	goto __65
__65:
	if 0 != 0 {
		goto __64
	}
	goto __66
__66:
	;
	goto __62
__61:
	XTclFreeObj(tls, scriptObj)
__62:
	;
__60:
	;

	XTcl_DictObjDone(tls, searchPtr)
	XTclStackFree(tls, interp, searchPtr)
	return TCL_ERROR
}

func sDictForLoopCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclDictObj.c:2439:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var iPtr uintptr
	var searchPtr uintptr
	var keyVarObj uintptr
	var valueVarObj uintptr
	var scriptObj uintptr
	// var keyObj uintptr at bp+8, 8

	// var valueObj uintptr at bp+16, 8

	// var done int32 at bp+24, 4

	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var _objPtr uintptr
	var _callbackPtr uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	iPtr = interp
	searchPtr = *(*ClientData)(unsafe.Pointer(data))
	keyVarObj = *(*ClientData)(unsafe.Pointer(data + 1*8))
	valueVarObj = *(*ClientData)(unsafe.Pointer(data + 2*8))
	scriptObj = *(*ClientData)(unsafe.Pointer(data + 3*8))

	// Process the result from the previous execution of the script body.

	if !(result == TCL_CONTINUE) {
		goto __1
	}
	result = TCL_OK
	goto __2
__1:
	if !(result != TCL_OK) {
		goto __3
	}
	if !(result == TCL_BREAK) {
		goto __4
	}
	XTcl_ResetResult(tls, interp)
	result = TCL_OK
	goto __5
__4:
	if !(result == TCL_ERROR) {
		goto __6
	}
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+23715,
		libc.VaList(bp, XTcl_GetErrorLine(tls, interp))))
__6:
	;
__5:
	;
	goto done
__3:
	;
__2:
	;

	// Get the next mapping from the dictionary.

	XTcl_DictObjNext(tls, searchPtr, bp+8, bp+16, bp+24)
	if !(*(*int32)(unsafe.Pointer(bp + 24)) != 0) {
		goto __7
	}
	XTcl_ResetResult(tls, interp)
	goto done
__7:
	;

	// Stop the value from getting hit in any way by any traces on the key
	// variable.

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++
	if !(XTcl_ObjSetVar2(tls, interp, keyVarObj, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 8)),
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __8
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount, 1) > 1) {
		goto __9
	}
	goto __10
__9:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __11
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != XtclEmptyStringRep) {
		goto __13
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes)
__13:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = -1
__14:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __17
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
	goto __18
__17:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__18:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	goto __12
__11:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* valueObj */)))
__12:
	;
__10:
	;

	result = TCL_ERROR
	goto done
__8:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount, 1) > 1) {
		goto __19
	}
	goto __20
__19:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __21
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != XtclEmptyStringRep) {
		goto __23
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes)
__23:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = -1
__24:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __27
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
	goto __28
__27:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__28:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
	goto __22
__21:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* valueObj */)))
__22:
	;
__20:
	;

	if !(XTcl_ObjSetVar2(tls, interp, valueVarObj, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 16)),
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __29
	}
	result = TCL_ERROR
	goto done
__29:
	;

	// Run the script.

__30:
__33:
	;
__36:
	if !(interp == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __39
	}
	_objPtr = XTclThreadAllocObj(tls)
	goto __40
__39:
	_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__40:
	;
	goto __37
__37:
	if 0 != 0 {
		goto __36
	}
	goto __38
__38:
	;
	_callbackPtr = _objPtr
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sDictForLoopCallback}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = searchPtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = keyVarObj
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = valueVarObj
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = scriptObj
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __31
__31:
	if 0 != 0 {
		goto __30
	}
	goto __32
__32:
	;
	return XTclNREvalObjEx(tls, interp, scriptObj, 0, (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, 3)

	// For unwinding everything once the iterating is done.

done:
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FrefCount, 1) > 1) {
		goto __41
	}
	goto __42
__41:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __43
	}

	if !((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __45
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes)
__45:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Flength = -1
__46:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __49
	}
	XTclThreadFreeObj(tls, keyVarObj)
	goto __50
__49:
	*(*uintptr)(unsafe.Pointer(keyVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = keyVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__50:
	;
	goto __47
__47:
	if 0 != 0 {
		goto __46
	}
	goto __48
__48:
	;
	goto __44
__43:
	XTclFreeObj(tls, keyVarObj)
__44:
	;
__42:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FrefCount, 1) > 1) {
		goto __51
	}
	goto __52
__51:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __53
	}

	if !((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __55
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes)
__55:
	;
	(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Flength = -1
__56:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __59
	}
	XTclThreadFreeObj(tls, valueVarObj)
	goto __60
__59:
	*(*uintptr)(unsafe.Pointer(valueVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = valueVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++
__60:
	;
	goto __57
__57:
	if 0 != 0 {
		goto __56
	}
	goto __58
__58:
	;
	goto __54
__53:
	XTclFreeObj(tls, valueVarObj)
__54:
	;
__52:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(scriptObj)).FrefCount, 1) > 1) {
		goto __61
	}
	goto __62
__61:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __63
	}

	if !((*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != XtclEmptyStringRep) {
		goto __65
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes)
__65:
	;
	(*Tcl_Obj)(unsafe.Pointer(scriptObj)).Flength = -1
__66:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __69
	}
	XTclThreadFreeObj(tls, scriptObj)
	goto __70
__69:
	*(*uintptr)(unsafe.Pointer(scriptObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = scriptObj
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++
__70:
	;
	goto __67
__67:
	if 0 != 0 {
		goto __66
	}
	goto __68
__68:
	;
	goto __64
__63:
	XTclFreeObj(tls, scriptObj)
__64:
	;
__62:
	;

	XTcl_DictObjDone(tls, searchPtr)
	XTclStackFree(tls, interp, searchPtr)
	return result
}

//----------------------------------------------------------------------
//
// DictMapNRCmd --
//
//	These functions implement the "dict map" Tcl command.  See the user
//	documentation for details on what it does, and TIP#405 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictMapNRCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:2539:1: */
	bp := tls.Alloc(76)
	defer tls.Free(76)

	var iPtr uintptr
	// var varv uintptr at bp+40, 8

	// var keyObj uintptr at bp+56, 8

	// var valueObj uintptr at bp+64, 8

	var storagePtr uintptr
	// var varc int32 at bp+48, 4

	// var done int32 at bp+72, 4

	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var _objPtr uintptr
	var _callbackPtr uintptr
	var cachePtr5 uintptr
	var cachePtr6 uintptr
	var cachePtr7 uintptr
	var cachePtr8 uintptr
	iPtr = interp

	if !(objc != 4) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+23627)
	return TCL_ERROR
__1:
	;

	// Parse arguments.

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 48)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48, bp+40)
	}() != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 48)) != 2) {
		goto __3
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+23671, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+23708, ts+23186, ts+16651, uintptr(0)))
	return TCL_ERROR
__3:
	;
	storagePtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(DictMapStorage{})))
	if !(XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), storagePtr+16, bp+56,
		bp+64, bp+72) != TCL_OK) {
		goto __4
	}
	XTclStackFree(tls, interp, storagePtr)
	return TCL_ERROR
__4:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 72)) != 0) {
		goto __5
	}
	// Note that this exit leaves an empty value in the result (due to
	// command calling conventions) but that is OK since an empty value is
	// an empty dictionary.

	XTclStackFree(tls, interp, storagePtr)
	return TCL_OK
__5:
	;
__6:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __9
	}
	(*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj = XTclThreadAllocObj(tls)
	goto __10
__9:
	(*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__10:
	;
	goto __7
__7:
	if 0 != 0 {
		goto __6
	}
	goto __8
__8:
	;
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FtypePtr = uintptr(0)

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 48)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48, bp+40)
	}
	(*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* varv */))))
	(*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* varv */)) + 1*8))
	(*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj = *(*uintptr)(unsafe.Pointer(objv + 3*8))

	// Make sure that these objects (which we need throughout the body of the
	// loop) don't vanish. Note that the dictionary internal rep is locked
	// internally so that updates, shimmering, etc are not a problem.

	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FrefCount++

	// Stop the value from getting hit in any way by any traces on the key
	// variable.

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FrefCount++
	if !(XTcl_ObjSetVar2(tls, interp, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 56)),
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __11
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FrefCount, 1) > 1) {
		goto __12
	}
	goto __13
__12:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __14
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != XtclEmptyStringRep) {
		goto __16
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes)
__16:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Flength = -1
__17:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __20
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
	goto __21
__20:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 64))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__21:
	;
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
	goto __15
__14:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* valueObj */)))
__15:
	;
__13:
	;

	goto error
__11:
	;
	if !(XTcl_ObjSetVar2(tls, interp, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 64)),
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __22
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FrefCount, 1) > 1) {
		goto __23
	}
	goto __24
__23:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __25
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != XtclEmptyStringRep) {
		goto __27
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes)
__27:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Flength = -1
__28:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __31
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
	goto __32
__31:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 64))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__32:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	goto __26
__25:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* valueObj */)))
__26:
	;
__24:
	;

	goto error
__22:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FrefCount, 1) > 1) {
		goto __33
	}
	goto __34
__33:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __35
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != XtclEmptyStringRep) {
		goto __37
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes)
__37:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Flength = -1
__38:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __41
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
	goto __42
__41:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 64))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__42:
	;
	goto __39
__39:
	if 0 != 0 {
		goto __38
	}
	goto __40
__40:
	;
	goto __36
__35:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* valueObj */)))
__36:
	;
__34:
	;

	// Run the script.

__43:
__46:
	;
__49:
	if !(interp == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0
	}()) {
		goto __52
	}
	_objPtr = XTclThreadAllocObj(tls)
	goto __53
__52:
	_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects--
__53:
	;
	goto __50
__50:
	if 0 != 0 {
		goto __49
	}
	goto __51
__51:
	;
	_callbackPtr = _objPtr
	goto __47
__47:
	if 0 != 0 {
		goto __46
	}
	goto __48
__48:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sDictMapLoopCallback}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = storagePtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;
	return XTclNREvalObjEx(tls, interp, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj, 0,
		(*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, 3)

	// For unwinding everything on error.

error:
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FrefCount, 1) > 1) {
		goto __54
	}
	goto __55
__54:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __56
	}

	if !((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __58
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes)
__58:
	;
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Flength = -1
__59:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __62
	}
	XTclThreadFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)
	goto __63
__62:
	*(*uintptr)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = (*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++
__63:
	;
	goto __60
__60:
	if 0 != 0 {
		goto __59
	}
	goto __61
__61:
	;
	goto __57
__56:
	XTclFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)
__57:
	;
__55:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FrefCount, 1) > 1) {
		goto __64
	}
	goto __65
__64:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __66
	}

	if !((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __68
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes)
__68:
	;
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Flength = -1
__69:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __72
	}
	XTclThreadFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)
	goto __73
__72:
	*(*uintptr)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = (*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++
__73:
	;
	goto __70
__70:
	if 0 != 0 {
		goto __69
	}
	goto __71
__71:
	;
	goto __67
__66:
	XTclFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)
__67:
	;
__65:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FrefCount, 1) > 1) {
		goto __74
	}
	goto __75
__74:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __76
	}

	if !((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes != XtclEmptyStringRep) {
		goto __78
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes)
__78:
	;
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Flength = -1
__79:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr7 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __82
	}
	XTclThreadFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)
	goto __83
__82:
	*(*uintptr)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = (*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++
__83:
	;
	goto __80
__80:
	if 0 != 0 {
		goto __79
	}
	goto __81
__81:
	;
	goto __77
__76:
	XTclFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)
__77:
	;
__75:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FrefCount, 1) > 1) {
		goto __84
	}
	goto __85
__84:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __86
	}

	if !((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes != XtclEmptyStringRep) {
		goto __88
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes)
__88:
	;
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Flength = -1
__89:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr8 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __92
	}
	XTclThreadFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)
	goto __93
__92:
	*(*uintptr)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = (*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects++
__93:
	;
	goto __90
__90:
	if 0 != 0 {
		goto __89
	}
	goto __91
__91:
	;
	goto __87
__86:
	XTclFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)
__87:
	;
__85:
	;

	XTcl_DictObjDone(tls, storagePtr+16)
	XTclStackFree(tls, interp, storagePtr)
	return TCL_ERROR
}

func sDictMapLoopCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclDictObj.c:2643:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var iPtr uintptr
	var storagePtr uintptr
	// var keyObj uintptr at bp+8, 8

	// var valueObj uintptr at bp+16, 8

	// var done int32 at bp+24, 4

	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var _objPtr uintptr
	var _callbackPtr uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	var cachePtr6 uintptr
	var cachePtr7 uintptr
	iPtr = interp
	storagePtr = *(*ClientData)(unsafe.Pointer(data))

	// Process the result from the previous execution of the script body.

	if !(result == TCL_CONTINUE) {
		goto __1
	}
	result = TCL_OK
	goto __2
__1:
	if !(result != TCL_OK) {
		goto __3
	}
	if !(result == TCL_BREAK) {
		goto __5
	}
	XTcl_ResetResult(tls, interp)
	result = TCL_OK
	goto __6
__5:
	if !(result == TCL_ERROR) {
		goto __7
	}
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+23746,
		libc.VaList(bp, XTcl_GetErrorLine(tls, interp))))
__7:
	;
__6:
	;
	goto done
	goto __4
__3:
	*(*uintptr)(unsafe.Pointer(bp + 8 /* keyObj */)) = XTcl_ObjGetVar2(tls, interp, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj, uintptr(0),
		TCL_LEAVE_ERR_MSG)
	if !(*(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0)) {
		goto __8
	}
	result = TCL_ERROR
	goto done
__8:
	;
	XTcl_DictObjPut(tls, uintptr(0), (*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj, *(*uintptr)(unsafe.Pointer(bp + 8 /* keyObj */)),
		XTcl_GetObjResult(tls, interp))
__4:
	;
__2:
	;

	// Get the next mapping from the dictionary.

	XTcl_DictObjNext(tls, storagePtr+16, bp+8, bp+16, bp+24)
	if !(*(*int32)(unsafe.Pointer(bp + 24)) != 0) {
		goto __9
	}
	XTcl_SetObjResult(tls, interp, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)
	goto done
__9:
	;

	// Stop the value from getting hit in any way by any traces on the key
	// variable.

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++
	if !(XTcl_ObjSetVar2(tls, interp, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 8)),
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __10
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount, 1) > 1) {
		goto __11
	}
	goto __12
__11:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __13
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != XtclEmptyStringRep) {
		goto __15
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes)
__15:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = -1
__16:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __19
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
	goto __20
__19:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__20:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	goto __14
__13:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* valueObj */)))
__14:
	;
__12:
	;

	result = TCL_ERROR
	goto done
__10:
	;
	if !(XTcl_ObjSetVar2(tls, interp, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 16)),
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __21
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount, 1) > 1) {
		goto __22
	}
	goto __23
__22:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __24
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != XtclEmptyStringRep) {
		goto __26
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes)
__26:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = -1
__27:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __30
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
	goto __31
__30:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__31:
	;
	goto __28
__28:
	if 0 != 0 {
		goto __27
	}
	goto __29
__29:
	;
	goto __25
__24:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* valueObj */)))
__25:
	;
__23:
	;

	result = TCL_ERROR
	goto done
__21:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount, 1) > 1) {
		goto __32
	}
	goto __33
__32:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __34
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != XtclEmptyStringRep) {
		goto __36
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes)
__36:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = -1
__37:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __40
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
	goto __41
__40:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__41:
	;
	goto __38
__38:
	if 0 != 0 {
		goto __37
	}
	goto __39
__39:
	;
	goto __35
__34:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* valueObj */)))
__35:
	;
__33:
	;

	// Run the script.

__42:
__45:
	;
__48:
	if !(interp == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __51
	}
	_objPtr = XTclThreadAllocObj(tls)
	goto __52
__51:
	_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__52:
	;
	goto __49
__49:
	if 0 != 0 {
		goto __48
	}
	goto __50
__50:
	;
	_callbackPtr = _objPtr
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sDictMapLoopCallback}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = storagePtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __43
__43:
	if 0 != 0 {
		goto __42
	}
	goto __44
__44:
	;
	return XTclNREvalObjEx(tls, interp, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj, 0,
		(*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, 3)

	// For unwinding everything once the iterating is done.

done:
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FrefCount, 1) > 1) {
		goto __53
	}
	goto __54
__53:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __55
	}

	if !((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __57
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes)
__57:
	;
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Flength = -1
__58:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __61
	}
	XTclThreadFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)
	goto __62
__61:
	*(*uintptr)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++
__62:
	;
	goto __59
__59:
	if 0 != 0 {
		goto __58
	}
	goto __60
__60:
	;
	goto __56
__55:
	XTclFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)
__56:
	;
__54:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FrefCount, 1) > 1) {
		goto __63
	}
	goto __64
__63:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __65
	}

	if !((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __67
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes)
__67:
	;
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Flength = -1
__68:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __71
	}
	XTclThreadFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)
	goto __72
__71:
	*(*uintptr)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = (*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++
__72:
	;
	goto __69
__69:
	if 0 != 0 {
		goto __68
	}
	goto __70
__70:
	;
	goto __66
__65:
	XTclFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)
__66:
	;
__64:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FrefCount, 1) > 1) {
		goto __73
	}
	goto __74
__73:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __75
	}

	if !((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes != XtclEmptyStringRep) {
		goto __77
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes)
__77:
	;
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Flength = -1
__78:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __81
	}
	XTclThreadFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)
	goto __82
__81:
	*(*uintptr)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = (*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++
__82:
	;
	goto __79
__79:
	if 0 != 0 {
		goto __78
	}
	goto __80
__80:
	;
	goto __76
__75:
	XTclFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)
__76:
	;
__74:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FrefCount, 1) > 1) {
		goto __83
	}
	goto __84
__83:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __85
	}

	if !((*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes != XtclEmptyStringRep) {
		goto __87
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes)
__87:
	;
	(*Tcl_Obj)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Flength = -1
__88:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr7 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __91
	}
	XTclThreadFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)
	goto __92
__91:
	*(*uintptr)(unsafe.Pointer((*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = (*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++
__92:
	;
	goto __89
__89:
	if 0 != 0 {
		goto __88
	}
	goto __90
__90:
	;
	goto __86
__85:
	XTclFreeObj(tls, (*DictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)
__86:
	;
__84:
	;

	XTcl_DictObjDone(tls, storagePtr+16)
	XTclStackFree(tls, interp, storagePtr)
	return result
}

//----------------------------------------------------------------------
//
// DictSetCmd --
//
//	This function implements the "dict set" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictSetCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:2751:1: */
	var dictPtr uintptr
	var resultPtr uintptr
	var result int32
	var allocatedDict int32 = 0

	if objc < 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23777)
		return TCL_ERROR
	}

	dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), 0)
	if dictPtr == uintptr(0) {
		allocatedDict = 1
		dictPtr = XTcl_NewDictObj(tls)
	} else if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		allocatedDict = 1
		dictPtr = XTcl_DuplicateObj(tls, dictPtr)
	}

	result = XTcl_DictObjPutKeyList(tls, interp, dictPtr, objc-3, objv+uintptr(2)*8,
		*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))
	if result != TCL_OK {
		if allocatedDict != 0 {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, dictPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, dictPtr)
				}
			}

		}
		return TCL_ERROR
	}

	resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), dictPtr,
		TCL_LEAVE_ERR_MSG)
	if resultPtr == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictUnsetCmd --
//
//	This function implements the "dict unset" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictUnsetCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:2811:1: */
	var dictPtr uintptr
	var resultPtr uintptr
	var result int32
	var allocatedDict int32 = 0

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23809)
		return TCL_ERROR
	}

	dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), 0)
	if dictPtr == uintptr(0) {
		allocatedDict = 1
		dictPtr = XTcl_NewDictObj(tls)
	} else if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		allocatedDict = 1
		dictPtr = XTcl_DuplicateObj(tls, dictPtr)
	}

	result = XTcl_DictObjRemoveKeyList(tls, interp, dictPtr, objc-2, objv+uintptr(2)*8)
	if result != TCL_OK {
		if allocatedDict != 0 {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, dictPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, dictPtr)
				}
			}

		}
		return TCL_ERROR
	}

	resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), dictPtr,
		TCL_LEAVE_ERR_MSG)
	if resultPtr == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DictFilterCmd --
//
//	This function implements the "dict filter" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictFilterCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:2870:1: */
	bp := tls.Alloc(120)
	defer tls.Free(120)

	var iPtr uintptr
	var scriptObj uintptr
	var keyVarObj uintptr
	var valueVarObj uintptr
	// var varv uintptr at bp+104, 8

	// var keyObj uintptr at bp+80, 8

	// var valueObj uintptr at bp+88, 8

	var resultObj uintptr
	var boolObj uintptr
	// var search Tcl_DictSearch at bp+56, 24

	// var index int32 at bp+48, 4

	// var varc int32 at bp+112, 4

	// var done int32 at bp+96, 4

	var result int32
	// var satisfied int32 at bp+116, 4

	var pattern uintptr
	var i int32
	var i1 int32
	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	var cachePtr6 uintptr
	var cachePtr7 uintptr
	var cachePtr8 uintptr
	var cachePtr9 uintptr
	var cachePtr10 uintptr
	var cachePtr11 uintptr
	var cachePtr12 uintptr
	var cachePtr13 uintptr
	var cachePtr14 uintptr
	var cachePtr15 uintptr
	var cachePtr16 uintptr
	iPtr = interp
	*(*uintptr)(unsafe.Pointer(bp + 80 /* keyObj */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 88 /* valueObj */)) = uintptr(0)

	if !(objc < 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23835)
	return TCL_ERROR
__1:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&filters)), int32(unsafe.Sizeof(uintptr(0))), ts+23867, 0, bp+48) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	switch uint32(*(*int32)(unsafe.Pointer(bp + 48 /* index */))) {
	case uint32(0) /* FILTER_KEYS */ :
		goto __4

	case uint32(2) /* FILTER_VALUES */ :
		goto __5

	case uint32(1) /* FILTER_SCRIPT */ :
		goto __6
	}
	goto __3
__4:
	// Create a dictionary whose keys all match a certain pattern.

	if !(XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+56,
		bp+80, bp+88, bp+96) != TCL_OK) {
		goto __7
	}
	return TCL_ERROR
__7:
	;
	if !(objc == 3) {
		goto __8
	}
	// Nothing to match, so return nothing (== empty dictionary).

	XTcl_DictObjDone(tls, bp+56)
	return TCL_OK
	goto __9
__8:
	if !(objc == 4) {
		goto __10
	}
	pattern = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}()
	resultObj = XTcl_NewDictObj(tls)
	if !(libc.Xstrpbrk(tls, pattern, ts+13556) == uintptr(0)) {
		goto __12
	}
	// Must release the search lock here to prevent a memory leak
	// since we are not exhausing the search. [Bug 1705778, leak
	// K05]

	XTcl_DictObjDone(tls, bp+56)
	XTcl_DictObjGet(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+88)
	if !(*(*uintptr)(unsafe.Pointer(bp + 88)) != uintptr(0)) {
		goto __14
	}
	XTcl_DictObjPut(tls, uintptr(0), resultObj, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*uintptr)(unsafe.Pointer(bp + 88 /* valueObj */)))
__14:
	;
	goto __13
__12:
__15:
	if !!(*(*int32)(unsafe.Pointer(bp + 96)) != 0) {
		goto __16
	}
	if !(XTcl_StringMatch(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 80)))
	}(), pattern) != 0) {
		goto __17
	}
	XTcl_DictObjPut(tls, uintptr(0), resultObj, *(*uintptr)(unsafe.Pointer(bp + 80 /* keyObj */)), *(*uintptr)(unsafe.Pointer(bp + 88 /* valueObj */)))
__17:
	;
	XTcl_DictObjNext(tls, bp+56, bp+80, bp+88, bp+96)
	goto __15
__16:
	;
__13:
	;
	goto __11
__10:
	// Can't optimize this match for trivial globbing: would disturb
	// order.

	resultObj = XTcl_NewDictObj(tls)
__18:
	if !!(*(*int32)(unsafe.Pointer(bp + 96)) != 0) {
		goto __19
	}

	i = 3
__20:
	if !(i < objc) {
		goto __22
	}
	pattern = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}()
	if !(XTcl_StringMatch(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 80)))
	}(), pattern) != 0) {
		goto __23
	}
	XTcl_DictObjPut(tls, uintptr(0), resultObj, *(*uintptr)(unsafe.Pointer(bp + 80 /* keyObj */)), *(*uintptr)(unsafe.Pointer(bp + 88 /* valueObj */)))
	goto __22 // stop inner loop
__23:
	;
	goto __21
__21:
	i++
	goto __20
	goto __22
__22:
	;
	XTcl_DictObjNext(tls, bp+56, bp+80, bp+88, bp+96)
	goto __18
__19:
	;
__11:
	;
__9:
	;
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK

__5:
	// Create a dictionary whose values all match a certain pattern.

	if !(XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+56,
		bp+80, bp+88, bp+96) != TCL_OK) {
		goto __24
	}
	return TCL_ERROR
__24:
	;
	resultObj = XTcl_NewDictObj(tls)
__25:
	if !!(*(*int32)(unsafe.Pointer(bp + 96)) != 0) {
		goto __26
	}

	i1 = 3
__27:
	if !(i1 < objc) {
		goto __29
	}
	pattern = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)))
	}()
	if !(XTcl_StringMatch(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 88)))
	}(), pattern) != 0) {
		goto __30
	}
	XTcl_DictObjPut(tls, uintptr(0), resultObj, *(*uintptr)(unsafe.Pointer(bp + 80 /* keyObj */)), *(*uintptr)(unsafe.Pointer(bp + 88 /* valueObj */)))
	goto __29 // stop inner loop
__30:
	;
	goto __28
__28:
	i1++
	goto __27
	goto __29
__29:
	;
	XTcl_DictObjNext(tls, bp+56, bp+80, bp+88, bp+96)
	goto __25
__26:
	;
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK

__6:
	if !(objc != 5) {
		goto __31
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+23878)
	return TCL_ERROR
__31:
	;

	// Create a dictionary whose key,value pairs all satisfy a script
	// (i.e. get a true boolean result from its evaluation). Massive
	// copying from the "dict for" implementation has occurred!

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 104)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 112)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+112, bp+104)
	}() != TCL_OK) {
		goto __32
	}
	return TCL_ERROR
__32:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 112)) != 2) {
		goto __33
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+23671, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+23708, ts+23186, ts+23149, uintptr(0)))
	return TCL_ERROR
__33:
	;
	keyVarObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104 /* varv */))))
	valueVarObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104 /* varv */)) + 1*8))
	scriptObj = *(*uintptr)(unsafe.Pointer(objv + 4*8))

	// Make sure that these objects (which we need throughout the body of
	// the loop) don't vanish. Note that the dictionary internal rep is
	// locked internally so that updates, shimmering, etc are not a
	// problem.

	(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(scriptObj)).FrefCount++

	result = XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)),
		bp+56, bp+80, bp+88, bp+96)
	if !(result != TCL_OK) {
		goto __34
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FrefCount, 1) > 1) {
		goto __35
	}
	goto __36
__35:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __37
	}

	if !((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __39
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes)
__39:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Flength = -1
__40:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __43
	}
	XTclThreadFreeObj(tls, keyVarObj)
	goto __44
__43:
	*(*uintptr)(unsafe.Pointer(keyVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = keyVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__44:
	;
	goto __41
__41:
	if 0 != 0 {
		goto __40
	}
	goto __42
__42:
	;
	goto __38
__37:
	XTclFreeObj(tls, keyVarObj)
__38:
	;
__36:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FrefCount, 1) > 1) {
		goto __45
	}
	goto __46
__45:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __47
	}

	if !((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __49
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes)
__49:
	;
	(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Flength = -1
__50:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __53
	}
	XTclThreadFreeObj(tls, valueVarObj)
	goto __54
__53:
	*(*uintptr)(unsafe.Pointer(valueVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = valueVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__54:
	;
	goto __51
__51:
	if 0 != 0 {
		goto __50
	}
	goto __52
__52:
	;
	goto __48
__47:
	XTclFreeObj(tls, valueVarObj)
__48:
	;
__46:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(scriptObj)).FrefCount, 1) > 1) {
		goto __55
	}
	goto __56
__55:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __57
	}

	if !((*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != XtclEmptyStringRep) {
		goto __59
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes)
__59:
	;
	(*Tcl_Obj)(unsafe.Pointer(scriptObj)).Flength = -1
__60:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __63
	}
	XTclThreadFreeObj(tls, scriptObj)
	goto __64
__63:
	*(*uintptr)(unsafe.Pointer(scriptObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = scriptObj
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__64:
	;
	goto __61
__61:
	if 0 != 0 {
		goto __60
	}
	goto __62
__62:
	;
	goto __58
__57:
	XTclFreeObj(tls, scriptObj)
__58:
	;
__56:
	;

	return TCL_ERROR
__34:
	;

	resultObj = XTcl_NewDictObj(tls)

__65:
	if !!(*(*int32)(unsafe.Pointer(bp + 96)) != 0) {
		goto __66
	}
	// Stop the value from getting hit in any way by any traces on the
	// key variable.

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).FrefCount++
	if !(XTcl_ObjSetVar2(tls, interp, keyVarObj, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 80)),
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __67
	}
	XTcl_AddErrorInfo(tls, interp,
		ts+23935)
	result = TCL_ERROR
	goto abnormalResult
__67:
	;
	if !(XTcl_ObjSetVar2(tls, interp, valueVarObj, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 88)),
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __68
	}
	XTcl_AddErrorInfo(tls, interp,
		ts+23983)
	result = TCL_ERROR
	goto abnormalResult
__68:
	;

	// TIP #280. Make invoking context available to loop body.

	result = XTclEvalObjEx(tls, interp, scriptObj, 0, (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, 4)
	switch result {
	case TCL_OK:
		goto __70
	case TCL_BREAK:
		goto __71
	// FALLTHRU
	case TCL_CONTINUE:
		goto __72
	case TCL_ERROR:
		goto __73
	default:
		goto __74
	}
	goto __69
__70:
	boolObj = XTcl_GetObjResult(tls, interp)
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount++
	XTcl_ResetResult(tls, interp)
	if !(XTcl_GetBooleanFromObj(tls, interp, boolObj,
		bp+116) != TCL_OK) {
		goto __75
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount, 1) > 1) {
		goto __76
	}
	goto __77
__76:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __78
	}

	if !((*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != XtclEmptyStringRep) {
		goto __80
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes)
__80:
	;
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).Flength = -1
__81:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __84
	}
	XTclThreadFreeObj(tls, boolObj)
	goto __85
__84:
	*(*uintptr)(unsafe.Pointer(boolObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = boolObj
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__85:
	;
	goto __82
__82:
	if 0 != 0 {
		goto __81
	}
	goto __83
__83:
	;
	goto __79
__78:
	XTclFreeObj(tls, boolObj)
__79:
	;
__77:
	;

	result = TCL_ERROR
	goto abnormalResult
__75:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(boolObj)).FrefCount, 1) > 1) {
		goto __86
	}
	goto __87
__86:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __88
	}

	if !((*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != XtclEmptyStringRep) {
		goto __90
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(boolObj)).Fbytes)
__90:
	;
	(*Tcl_Obj)(unsafe.Pointer(boolObj)).Flength = -1
__91:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __94
	}
	XTclThreadFreeObj(tls, boolObj)
	goto __95
__94:
	*(*uintptr)(unsafe.Pointer(boolObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = boolObj
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++
__95:
	;
	goto __92
__92:
	if 0 != 0 {
		goto __91
	}
	goto __93
__93:
	;
	goto __89
__88:
	XTclFreeObj(tls, boolObj)
__89:
	;
__87:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 116)) != 0) {
		goto __96
	}
	XTcl_DictObjPut(tls, uintptr(0), resultObj, *(*uintptr)(unsafe.Pointer(bp + 80 /* keyObj */)), *(*uintptr)(unsafe.Pointer(bp + 88 /* valueObj */)))
__96:
	;
	goto __69
__71:
	// Force loop termination by calling Tcl_DictObjDone; this
	// makes the next Tcl_DictObjNext say there is nothing more to
	// do.

	XTcl_ResetResult(tls, interp)
	XTcl_DictObjDone(tls, bp+56)
	// FALLTHRU
__72:
	result = TCL_OK
	goto __69
__73:
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+24033,
		libc.VaList(bp+40, XTcl_GetErrorLine(tls, interp))))
__74:
	goto abnormalResult
__69:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).FrefCount, 1) > 1) {
		goto __97
	}
	goto __98
__97:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __99
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Fbytes != XtclEmptyStringRep) {
		goto __101
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Fbytes)
__101:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Flength = -1
__102:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __105
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 80)))
	goto __106
__105:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 80))
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++
__106:
	;
	goto __103
__103:
	if 0 != 0 {
		goto __102
	}
	goto __104
__104:
	;
	goto __100
__99:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* keyObj */)))
__100:
	;
__98:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).FrefCount, 1) > 1) {
		goto __107
	}
	goto __108
__107:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __109
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes != XtclEmptyStringRep) {
		goto __111
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes)
__111:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Flength = -1
__112:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __115
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 88)))
	goto __116
__115:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 88))
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++
__116:
	;
	goto __113
__113:
	if 0 != 0 {
		goto __112
	}
	goto __114
__114:
	;
	goto __110
__109:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 88 /* valueObj */)))
__110:
	;
__108:
	;

	XTcl_DictObjNext(tls, bp+56, bp+80, bp+88, bp+96)
	goto __65
__66:
	;

	// Stop holding a reference to these objects.

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FrefCount, 1) > 1) {
		goto __117
	}
	goto __118
__117:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __119
	}

	if !((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __121
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes)
__121:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Flength = -1
__122:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr7 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __125
	}
	XTclThreadFreeObj(tls, keyVarObj)
	goto __126
__125:
	*(*uintptr)(unsafe.Pointer(keyVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = keyVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++
__126:
	;
	goto __123
__123:
	if 0 != 0 {
		goto __122
	}
	goto __124
__124:
	;
	goto __120
__119:
	XTclFreeObj(tls, keyVarObj)
__120:
	;
__118:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FrefCount, 1) > 1) {
		goto __127
	}
	goto __128
__127:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __129
	}

	if !((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __131
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes)
__131:
	;
	(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Flength = -1
__132:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr8 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __135
	}
	XTclThreadFreeObj(tls, valueVarObj)
	goto __136
__135:
	*(*uintptr)(unsafe.Pointer(valueVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = valueVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects++
__136:
	;
	goto __133
__133:
	if 0 != 0 {
		goto __132
	}
	goto __134
__134:
	;
	goto __130
__129:
	XTclFreeObj(tls, valueVarObj)
__130:
	;
__128:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(scriptObj)).FrefCount, 1) > 1) {
		goto __137
	}
	goto __138
__137:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __139
	}

	if !((*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != XtclEmptyStringRep) {
		goto __141
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes)
__141:
	;
	(*Tcl_Obj)(unsafe.Pointer(scriptObj)).Flength = -1
__142:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr9 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __145
	}
	XTclThreadFreeObj(tls, scriptObj)
	goto __146
__145:
	*(*uintptr)(unsafe.Pointer(scriptObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr = scriptObj
	(*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects++
__146:
	;
	goto __143
__143:
	if 0 != 0 {
		goto __142
	}
	goto __144
__144:
	;
	goto __140
__139:
	XTclFreeObj(tls, scriptObj)
__140:
	;
__138:
	;

	XTcl_DictObjDone(tls, bp+56)

	if !(result == TCL_OK) {
		goto __147
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	goto __148
__147:
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount, 1) > 1) {
		goto __149
	}
	goto __150
__149:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __151
	}

	if !((*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != XtclEmptyStringRep) {
		goto __153
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes)
__153:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = -1
__154:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr10 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __157
	}
	XTclThreadFreeObj(tls, resultObj)
	goto __158
__157:
	*(*uintptr)(unsafe.Pointer(resultObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr = resultObj
	(*AllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects++
__158:
	;
	goto __155
__155:
	if 0 != 0 {
		goto __154
	}
	goto __156
__156:
	;
	goto __152
__151:
	XTclFreeObj(tls, resultObj)
__152:
	;
__150:
	;

__148:
	;
	return result

abnormalResult:
	XTcl_DictObjDone(tls, bp+56)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).FrefCount, 1) > 1) {
		goto __159
	}
	goto __160
__159:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __161
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Fbytes != XtclEmptyStringRep) {
		goto __163
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Fbytes)
__163:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))).Flength = -1
__164:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr11 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __167
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 80)))
	goto __168
__167:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 80))
	(*AllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects++
__168:
	;
	goto __165
__165:
	if 0 != 0 {
		goto __164
	}
	goto __166
__166:
	;
	goto __162
__161:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* keyObj */)))
__162:
	;
__160:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).FrefCount, 1) > 1) {
		goto __169
	}
	goto __170
__169:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __171
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes != XtclEmptyStringRep) {
		goto __173
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes)
__173:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Flength = -1
__174:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr12 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __177
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 88)))
	goto __178
__177:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 88))
	(*AllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects++
__178:
	;
	goto __175
__175:
	if 0 != 0 {
		goto __174
	}
	goto __176
__176:
	;
	goto __172
__171:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 88 /* valueObj */)))
__172:
	;
__170:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FrefCount, 1) > 1) {
		goto __179
	}
	goto __180
__179:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __181
	}

	if !((*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __183
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes)
__183:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyVarObj)).Flength = -1
__184:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr13 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __187
	}
	XTclThreadFreeObj(tls, keyVarObj)
	goto __188
__187:
	*(*uintptr)(unsafe.Pointer(keyVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr13)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr13)).FfirstObjPtr = keyVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects++
__188:
	;
	goto __185
__185:
	if 0 != 0 {
		goto __184
	}
	goto __186
__186:
	;
	goto __182
__181:
	XTclFreeObj(tls, keyVarObj)
__182:
	;
__180:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FrefCount, 1) > 1) {
		goto __189
	}
	goto __190
__189:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __191
	}

	if !((*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != XtclEmptyStringRep) {
		goto __193
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes)
__193:
	;
	(*Tcl_Obj)(unsafe.Pointer(valueVarObj)).Flength = -1
__194:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr14 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __197
	}
	XTclThreadFreeObj(tls, valueVarObj)
	goto __198
__197:
	*(*uintptr)(unsafe.Pointer(valueVarObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr14)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr14)).FfirstObjPtr = valueVarObj
	(*AllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects++
__198:
	;
	goto __195
__195:
	if 0 != 0 {
		goto __194
	}
	goto __196
__196:
	;
	goto __192
__191:
	XTclFreeObj(tls, valueVarObj)
__192:
	;
__190:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(scriptObj)).FrefCount, 1) > 1) {
		goto __199
	}
	goto __200
__199:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __201
	}

	if !((*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != XtclEmptyStringRep) {
		goto __203
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes)
__203:
	;
	(*Tcl_Obj)(unsafe.Pointer(scriptObj)).Flength = -1
__204:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr15 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __207
	}
	XTclThreadFreeObj(tls, scriptObj)
	goto __208
__207:
	*(*uintptr)(unsafe.Pointer(scriptObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr15)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr15)).FfirstObjPtr = scriptObj
	(*AllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects++
__208:
	;
	goto __205
__205:
	if 0 != 0 {
		goto __204
	}
	goto __206
__206:
	;
	goto __202
__201:
	XTclFreeObj(tls, scriptObj)
__202:
	;
__200:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount, 1) > 1) {
		goto __209
	}
	goto __210
__209:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __211
	}

	if !((*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != XtclEmptyStringRep) {
		goto __213
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes)
__213:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = -1
__214:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr16 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr16)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr16)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __217
	}
	XTclThreadFreeObj(tls, resultObj)
	goto __218
__217:
	*(*uintptr)(unsafe.Pointer(resultObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr16)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr16)).FfirstObjPtr = resultObj
	(*AllocCache)(unsafe.Pointer(cachePtr16)).FnumObjects++
__218:
	;
	goto __215
__215:
	if 0 != 0 {
		goto __214
	}
	goto __216
__216:
	;
	goto __212
__211:
	XTclFreeObj(tls, resultObj)
__212:
	;
__210:
	;

	return result
__3:
	;
	XTcl_Panic(tls, ts+9901, 0)
	// Control never reaches this point.
	return TCL_ERROR
}

var filters = [4]uintptr{
	ts + 21944, ts + 3636, ts + 3535, uintptr(0),
} /* tclDictObj.c:2877:23 */

//----------------------------------------------------------------------
//
// DictUpdateCmd --
//
//	This function implements the "dict update" Tcl command. See the user
//	documentation for details on what it does, and TIP#212 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictUpdateCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:3155:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var iPtr uintptr = interp
	var dictPtr uintptr
	// var objPtr uintptr at bp+8, 8

	var i int32
	// var dummy int32 at bp, 4

	if objc < 5 || !(objc&1 != 0) {
		XTcl_WrongNumArgs(tls, interp, 1, objv,
			ts+24069)
		return TCL_ERROR
	}

	dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), TCL_LEAVE_ERR_MSG)
	if dictPtr == uintptr(0) {
		return TCL_ERROR
	}
	if XTcl_DictObjSize(tls, interp, dictPtr, bp) != TCL_OK {
		return TCL_ERROR
	}
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount++
	for i = 2; i+2 < objc; i = i + 2 {
		if XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+8) != TCL_OK {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, dictPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, dictPtr)
				}
			}

			return TCL_ERROR
		}
		if *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) {
			// ???
			XTcl_UnsetVar2(tls, interp, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))), uintptr(0), 0)
		} else if XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 8)),
			TCL_LEAVE_ERR_MSG) == uintptr(0) {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, dictPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, dictPtr)
				}
			}

			return TCL_ERROR
		}
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, dictPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, dictPtr)
		}
	}

	// Execute the body after setting up the NRE handler to process the
	// results.

	*(*uintptr)(unsafe.Pointer(bp + 8 /* objPtr */)) = XTcl_NewListObj(tls, objc-3, objv+uintptr(2)*8)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FrefCount++
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _callbackPtr uintptr
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sFinalizeDictUpdate}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = *(*uintptr)(unsafe.Pointer(objv + 1*8))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = *(*uintptr)(unsafe.Pointer(bp + 8))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}

	return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), 0, (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, objc-1)
}

func sFinalizeDictUpdate(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclDictObj.c:3209:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var dictPtr uintptr
	var objPtr uintptr
	// var objv uintptr at bp+8, 8

	var state Tcl_InterpState
	var i int32
	// var objc int32 at bp, 4

	var varName uintptr = *(*ClientData)(unsafe.Pointer(data))
	var argsObj uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))

	// ErrorInfo handling.

	if result == TCL_ERROR {
		XTcl_AddErrorInfo(tls, interp, ts+24118)
	}

	// If the dictionary variable doesn't exist, drop everything silently.

	dictPtr = XTcl_ObjGetVar2(tls, interp, varName, uintptr(0), 0)
	if dictPtr == uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(varName)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(varName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(varName)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(varName)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, varName)
					} else {
						*(*uintptr)(unsafe.Pointer(varName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = varName
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, varName)
			}
		}

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(argsObj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(argsObj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(argsObj)).Flength = -1
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, argsObj)
					} else {
						*(*uintptr)(unsafe.Pointer(argsObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = argsObj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, argsObj)
			}
		}

		return result
	}

	// Double-check that it is still a dictionary.

	state = XTcl_SaveInterpState(tls, interp, result)
	if XTcl_DictObjSize(tls, interp, dictPtr, bp) != TCL_OK {
		XTcl_DiscardInterpState(tls, state)
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(varName)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(varName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(varName)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(varName)).Flength = -1
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, varName)
					} else {
						*(*uintptr)(unsafe.Pointer(varName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = varName
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, varName)
			}
		}

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(argsObj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(argsObj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(argsObj)).Flength = -1
				for ok3 := true; ok3; ok3 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, argsObj)
					} else {
						*(*uintptr)(unsafe.Pointer(argsObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = argsObj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, argsObj)
			}
		}

		return TCL_ERROR
	}

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		dictPtr = XTcl_DuplicateObj(tls, dictPtr)
	}

	// Write back the values from the variables, treating failure to read as
	// an instruction to remove the key.

	XTcl_ListObjGetElements(tls, uintptr(0), argsObj, bp, bp+8)
	for i = 0; i < *(*int32)(unsafe.Pointer(bp /* objc */)); i = i + 2 {
		objPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* objv */)) + uintptr(i+1)*8)), uintptr(0), 0)
		if objPtr == uintptr(0) {
			XTcl_DictObjRemove(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* objv */)) + uintptr(i)*8)))
		} else if objPtr == dictPtr {
			// Someone is messing us around, trying to build a recursive
			// structure. [Bug 1786481]

			XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* objv */)) + uintptr(i)*8)), XTcl_DuplicateObj(tls, objPtr))
		} else {
			// Shouldn't fail
			XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* objv */)) + uintptr(i)*8)), objPtr)
		}
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(argsObj)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(argsObj)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(argsObj)).Flength = -1
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, argsObj)
				} else {
					*(*uintptr)(unsafe.Pointer(argsObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = argsObj
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, argsObj)
		}
	}

	// Write the dictionary back to its variable.

	if XTcl_ObjSetVar2(tls, interp, varName, uintptr(0), dictPtr,
		TCL_LEAVE_ERR_MSG) == uintptr(0) {
		XTcl_DiscardInterpState(tls, state)
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(varName)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(varName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(varName)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(varName)).Flength = -1
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, varName)
					} else {
						*(*uintptr)(unsafe.Pointer(varName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = varName
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, varName)
			}
		}

		return TCL_ERROR
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(varName)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(varName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(varName)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(varName)).Flength = -1
			for ok6 := true; ok6; ok6 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, varName)
				} else {
					*(*uintptr)(unsafe.Pointer(varName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = varName
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, varName)
		}
	}

	return XTcl_RestoreInterpState(tls, interp, state)
}

//----------------------------------------------------------------------
//
// DictWithCmd --
//
//	This function implements the "dict with" Tcl command. See the user
//	documentation for details on what it does, and TIP#212 for the formal
//	specification.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sDictWithCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDictObj.c:3313:1: */
	var iPtr uintptr = interp
	var dictPtr uintptr
	var keysPtr uintptr
	var pathPtr uintptr

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+24147)
		return TCL_ERROR
	}

	// Get the dictionary to open out.

	dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), TCL_LEAVE_ERR_MSG)
	if dictPtr == uintptr(0) {
		return TCL_ERROR
	}

	keysPtr = XTclDictWithInit(tls, interp, dictPtr, objc-3, objv+uintptr(2)*8)
	if keysPtr == uintptr(0) {
		return TCL_ERROR
	}
	(*Tcl_Obj)(unsafe.Pointer(keysPtr)).FrefCount++

	// Execute the body, while making the invoking context available to the
	// loop body (TIP#280) and postponing the cleanup until later (NRE).

	pathPtr = uintptr(0)
	if objc > 3 {
		pathPtr = XTcl_NewListObj(tls, objc-3, objv+uintptr(2)*8)
		(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount++
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FrefCount++
	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sFinalizeDictWith}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = *(*uintptr)(unsafe.Pointer(objv + 1*8))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = keysPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = pathPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}

	return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), 0, (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr, objc-1)
}

func sFinalizeDictWith(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclDictObj.c:3360:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var pathv uintptr at bp+8, 8

	// var pathc int32 at bp, 4

	var state Tcl_InterpState
	var varName uintptr = *(*ClientData)(unsafe.Pointer(data))
	var keysPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))
	var pathPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))
	var varPtr uintptr
	// var arrayPtr uintptr at bp+16, 8

	if result == TCL_ERROR {
		XTcl_AddErrorInfo(tls, interp, ts+24176)
	}

	// Save the result state; TDWF doesn't guarantee to not modify that on
	// TCL_OK result.

	state = XTcl_SaveInterpState(tls, interp, result)
	if pathPtr != uintptr(0) {
		XTcl_ListObjGetElements(tls, uintptr(0), pathPtr, bp, bp+8)
	} else {
		*(*int32)(unsafe.Pointer(bp /* pathc */)) = 0
		*(*uintptr)(unsafe.Pointer(bp + 8 /* pathv */)) = uintptr(0)
	}

	// Pack from local variables back into the dictionary.

	varPtr = XTclObjLookupVarEx(tls, interp, varName, uintptr(0), TCL_LEAVE_ERR_MSG, ts+5303,
		/*createPart1*/ 1 /*createPart2*/, 1, bp+16)
	if varPtr == uintptr(0) {
		result = TCL_ERROR
	} else {
		result = XTclDictWithFinish(tls, interp, varPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* arrayPtr */)), varName, uintptr(0), -1,
			*(*int32)(unsafe.Pointer(bp /* pathc */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* pathv */)), keysPtr)
	}

	// Tidy up and return the real result (unless we had an error).

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(varName)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(varName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(varName)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(varName)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(varName)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, varName)
				} else {
					*(*uintptr)(unsafe.Pointer(varName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = varName
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, varName)
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keysPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(keysPtr)).Flength = -1
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, keysPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(keysPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = keysPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, keysPtr)
		}
	}

	if pathPtr != uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(pathPtr)).Flength = -1
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, pathPtr)
					} else {
						*(*uintptr)(unsafe.Pointer(pathPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = pathPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, pathPtr)
			}
		}

	}
	if result != TCL_OK {
		XTcl_DiscardInterpState(tls, state)
		return TCL_ERROR
	}
	return XTcl_RestoreInterpState(tls, interp, state)
}

//----------------------------------------------------------------------
//
// TclDictWithInit --
//
//	Part of the core of [dict with]. Pokes into a dictionary and converts
//	the mappings there into assignments to (presumably) local variables.
//	Returns a list of all the names that were mapped so that removal of
//	either the variable or the dictionary entry won't surprise us when we
//	come to stuffing everything back.
//
// Result:
//	List of mapped names, or NULL if there was an error.
//
// Side effects:
//	Assigns to variables, so potentially legion due to traces.
//
//----------------------------------------------------------------------

func XTclDictWithInit(tls *libc.TLS, interp uintptr, dictPtr uintptr, pathc int32, pathv uintptr) uintptr { /* tclDictObj.c:3439:9: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	// var s Tcl_DictSearch at bp, 24

	// var keyPtr uintptr at bp+24, 8

	// var valPtr uintptr at bp+32, 8

	var keysPtr uintptr
	// var done int32 at bp+40, 4

	if pathc > 0 {
		dictPtr = XTclTraceDictPath(tls, interp, dictPtr, pathc, pathv,
			DICT_PATH_READ)
		if dictPtr == uintptr(0) {
			return uintptr(0)
		}
	}

	// Go over the list of keys and write each corresponding value to a
	// variable in the current context with the same name. Also keep a copy of
	// the keys so we can write back properly later on even if the dictionary
	// has been structurally modified.

	if XTcl_DictObjFirst(tls, interp, dictPtr, bp, bp+24, bp+32,
		bp+40) != TCL_OK {
		return uintptr(0)
	}

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			keysPtr = XTclThreadAllocObj(tls)
		} else {
			keysPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(keysPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(keysPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(keysPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr = uintptr(0)
	{
	}

	for ; !(*(*int32)(unsafe.Pointer(bp + 40)) != 0); XTcl_DictObjNext(tls, bp, bp+24, bp+32, bp+40) {
		XTcl_ListObjAppendElement(tls, uintptr(0), keysPtr, *(*uintptr)(unsafe.Pointer(bp + 24 /* keyPtr */)))
		if XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 24)), uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 32)),
			TCL_LEAVE_ERR_MSG) == uintptr(0) {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keysPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(keysPtr)).Flength = -1
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, keysPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(keysPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = keysPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, keysPtr)
				}
			}

			XTcl_DictObjDone(tls, bp)
			return uintptr(0)
		}
	}

	return keysPtr
}

//----------------------------------------------------------------------
//
// TclDictWithFinish --
//
//	Part of the core of [dict with]. Reassembles the piece of the dict (in
//	varName, location given by pathc/pathv) from the variables named in
//	the keysPtr argument. NB, does not try to preserve errors or manage
//	argument lifetimes.
//
// Result:
//	TCL_OK if we succeeded, or TCL_ERROR if we failed.
//
// Side effects:
//	Assigns to a variable, so potentially legion due to traces. Updates
//	the dictionary in the named variable.
//
//----------------------------------------------------------------------

func XTclDictWithFinish(tls *libc.TLS, interp uintptr, varPtr uintptr, arrayPtr uintptr, part1Ptr uintptr, part2Ptr uintptr, index int32, pathc int32, pathv uintptr, keysPtr uintptr) int32 { /* tclDictObj.c:3506:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var dictPtr uintptr
	var leafPtr uintptr
	var valPtr uintptr
	// var i int32 at bp, 4

	var allocdict int32
	// var keyc int32 at bp+16, 4

	// var keyv uintptr at bp+8, 8

	// If the dictionary variable doesn't exist, drop everything silently.

	dictPtr = XTclPtrGetVarIdx(tls, interp, varPtr, arrayPtr, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, index)
	if dictPtr == uintptr(0) {
		return TCL_OK
	}

	// Double-check that it is still a dictionary.

	if XTcl_DictObjSize(tls, interp, dictPtr, bp) != TCL_OK {
		return TCL_ERROR
	}

	if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1 {
		dictPtr = XTcl_DuplicateObj(tls, dictPtr)
		allocdict = 1
	} else {
		allocdict = 0
	}

	if pathc > 0 {
		// Want to get to the dictionary which we will update; need to do
		// prepare-for-update de-sharing along the path *but* avoid generating
		// an error on a non-existant path (we'll treat that the same as a
		// non-existant variable. Luckily, the de-sharing operation isn't
		// deeply damaging if we don't go on to update; it's just less than
		// perfectly efficient (but no memory should be leaked).

		leafPtr = XTclTraceDictPath(tls, interp, dictPtr, pathc, pathv,
			DICT_PATH_EXISTS|DICT_PATH_UPDATE)
		if leafPtr == uintptr(0) {
			if allocdict != 0 {
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
						for ok := true; ok; ok = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, dictPtr)
							} else {
								*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, dictPtr)
					}
				}

			}
			return TCL_ERROR
		}
		if leafPtr == uintptr(1) {
			if allocdict != 0 {
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
						for ok1 := true; ok1; ok1 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, dictPtr)
							} else {
								*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, dictPtr)
					}
				}

			}
			return TCL_OK
		}
	} else {
		leafPtr = dictPtr
	}

	// Now process our updates on the leaf dictionary.

	if (*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 8)) = *(*uintptr)(unsafe.Pointer(keysPtr + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 16)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keysPtr + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), keysPtr, bp+16, bp+8)
	}
	for *(*int32)(unsafe.Pointer(bp /* i */)) = 0; *(*int32)(unsafe.Pointer(bp /* i */)) < *(*int32)(unsafe.Pointer(bp + 16 /* keyc */)); *(*int32)(unsafe.Pointer(bp /* i */))++ {
		valPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* keyv */)) + uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*8)), uintptr(0), 0)
		if valPtr == uintptr(0) {
			XTcl_DictObjRemove(tls, uintptr(0), leafPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* keyv */)) + uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*8)))
		} else if leafPtr == valPtr {
			// Someone is messing us around, trying to build a recursive
			// structure. [Bug 1786481]

			XTcl_DictObjPut(tls, uintptr(0), leafPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* keyv */)) + uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*8)), XTcl_DuplicateObj(tls, valPtr))
		} else {
			XTcl_DictObjPut(tls, uintptr(0), leafPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* keyv */)) + uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*8)), valPtr)
		}
	}

	// Ensure that none of the dictionaries in the chain still have a string
	// rep.

	if pathc > 0 {
		sInvalidateDictChain(tls, leafPtr)
	}

	// Write back the outermost dictionary to the variable.

	if XTclPtrSetVarIdx(tls, interp, varPtr, arrayPtr, part1Ptr, part2Ptr,
		dictPtr, TCL_LEAVE_ERR_MSG, index) == uintptr(0) {
		if allocdict != 0 {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, dictPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, dictPtr)
				}
			}

		}
		return TCL_ERROR
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclInitDictCmd --
//
//	This function is create the "dict" Tcl command. See the user
//	documentation for details on what it does, and TIP#111 for the formal
//	specification.
//
// Results:
//	A Tcl command handle.
//
// Side effects:
//	May advance compilation epoch.
//
//----------------------------------------------------------------------

func XTclInitDictCmd(tls *libc.TLS, interp uintptr) Tcl_Command { /* tclDictObj.c:3649:1: */
	return XTclMakeEnsemble(tls, interp, ts+23186, uintptr(unsafe.Pointer(&implementationMap)))
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The structure below defines an instruction name Tcl object to allow
// reporting of inner contexts in errorstack without string allocation.

var tclInstNameType = Tcl_ObjType{
	Fname:             ts + 24203,
	FupdateStringProc: 0, // setFromAnyProc
} /* tclDisassemble.c:41:26 */

// How to get the bytecode out of a Tcl_Obj.

//----------------------------------------------------------------------
//
// GetLocationInformation --
//
//	This procedure looks up the information about where a procedure was
//	originally declared.
//
// Results:
//	Writes to the variables pointed at by fileObjPtr and linePtr.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sGetLocationInformation(tls *libc.TLS, procPtr uintptr, fileObjPtr uintptr, linePtr uintptr) { /* tclDisassemble.c:74:1: */
	var cfPtr uintptr = XTclGetCmdFrameForProcedure(tls, procPtr)

	*(*uintptr)(unsafe.Pointer(fileObjPtr)) = uintptr(0)
	*(*int32)(unsafe.Pointer(linePtr)) = -1
	if cfPtr == uintptr(0) {
		return
	}

	// Get the source location data out of the CmdFrame.

	*(*int32)(unsafe.Pointer(linePtr)) = *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(cfPtr)).Fline))
	if (*CmdFrame)(unsafe.Pointer(cfPtr)).Ftype == 4 {
		*(*uintptr)(unsafe.Pointer(fileObjPtr)) = *(*uintptr)(unsafe.Pointer(cfPtr + 40))
	}
}

//----------------------------------------------------------------------
//
// DisassembleByteCodeObj --
//
//	Given an object which is of bytecode type, return a disassembled
//	version of the bytecode (in a new refcount 0 object). No guarantees
//	are made about the details of the contents of the result.
//
//----------------------------------------------------------------------

func sDisassembleByteCodeObj(tls *libc.TLS, interp uintptr, objPtr uintptr) uintptr { /* tclDisassemble.c:243:16: */
	bp := tls.Alloc(436)
	defer tls.Free(436)

	var codePtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	var codeStart uintptr
	var codeLimit uintptr
	var pc uintptr
	var codeDeltaNext uintptr
	var codeLengthNext uintptr
	var srcDeltaNext uintptr
	var srcLengthNext uintptr
	var codeOffset int32
	var codeLen int32
	var srcOffset int32
	var srcLen int32
	var numCmds int32
	var delta int32
	var i int32
	// var line int32 at bp+432, 4

	var iPtr uintptr = *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle))
	var bufferObj uintptr
	// var fileObj uintptr at bp+424, 8

	// var ptrBuf1 [20]int8 at bp+384, 20

	// var ptrBuf2 [20]int8 at bp+404, 20

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			bufferObj = XTclThreadAllocObj(tls)
		} else {
			bufferObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bufferObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(bufferObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(bufferObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(bufferObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(bufferObj)).FtypePtr = uintptr(0)
	{
	}

	if (*ByteCode)(unsafe.Pointer(codePtr)).FrefCount <= 0 {
		return bufferObj // Already freed.
	}

	codeStart = (*ByteCode)(unsafe.Pointer(codePtr)).FcodeStart
	codeLimit = codeStart + uintptr((*ByteCode)(unsafe.Pointer(codePtr)).FnumCodeBytes)
	numCmds = (*ByteCode)(unsafe.Pointer(codePtr)).FnumCommands

	// Print header lines describing the ByteCode.

	libc.Xsprintf(tls, bp+384, ts+359, libc.VaList(bp, codePtr))
	libc.Xsprintf(tls, bp+404, ts+359, libc.VaList(bp+8, iPtr))
	XTcl_AppendPrintfToObj(tls, bufferObj,
		ts+24212,
		libc.VaList(bp+16, bp+384, (*ByteCode)(unsafe.Pointer(codePtr)).FrefCount, (*ByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch, bp+404,
			(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch))
	XTcl_AppendToObj(tls, bufferObj, ts+24271, -1)
	sPrintSourceToObj(tls, bufferObj, (*ByteCode)(unsafe.Pointer(codePtr)).Fsource,
		func() int32 {
			if (*ByteCode)(unsafe.Pointer(codePtr)).FnumSrcBytes < 55 {
				return (*ByteCode)(unsafe.Pointer(codePtr)).FnumSrcBytes
			}
			return 55
		}())
	sGetLocationInformation(tls, (*ByteCode)(unsafe.Pointer(codePtr)).FprocPtr, bp+424, bp+432)
	if *(*int32)(unsafe.Pointer(bp + 432)) > -1 && *(*uintptr)(unsafe.Pointer(bp + 424)) != uintptr(0) {
		XTcl_AppendPrintfToObj(tls, bufferObj, ts+24281,
			libc.VaList(bp+56, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 424 /* fileObj */))), *(*int32)(unsafe.Pointer(bp + 432 /* line */))))
	}
	XTcl_AppendPrintfToObj(tls, bufferObj,
		ts+24302,
		libc.VaList(bp+72, numCmds, (*ByteCode)(unsafe.Pointer(codePtr)).FnumSrcBytes, (*ByteCode)(unsafe.Pointer(codePtr)).FnumCodeBytes,
			(*ByteCode)(unsafe.Pointer(codePtr)).FnumLitObjects, (*ByteCode)(unsafe.Pointer(codePtr)).FnumAuxDataItems,
			(*ByteCode)(unsafe.Pointer(codePtr)).FmaxStackDepth,
			0.0))

	// If the ByteCode is the compiled body of a Tcl procedure, print
	// information about that procedure. Note that we don't know the
	// procedure's name since ByteCode's can be shared among procedures.

	if (*ByteCode)(unsafe.Pointer(codePtr)).FprocPtr != uintptr(0) {
		var procPtr uintptr = (*ByteCode)(unsafe.Pointer(codePtr)).FprocPtr
		var numCompiledLocals int32 = (*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals

		libc.Xsprintf(tls, bp+384, ts+359, libc.VaList(bp+128, procPtr))
		XTcl_AppendPrintfToObj(tls, bufferObj,
			ts+24379,
			libc.VaList(bp+136, bp+384, (*Proc)(unsafe.Pointer(procPtr)).FrefCount, (*Proc)(unsafe.Pointer(procPtr)).FnumArgs,
				numCompiledLocals))
		if numCompiledLocals > 0 {
			var localPtr uintptr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr

			for i = 0; i < numCompiledLocals; i++ {
				XTcl_AppendPrintfToObj(tls, bufferObj,
					ts+24431, libc.VaList(bp+168, i,
						func() uintptr {
							if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&(VAR_ARRAY|VAR_LINK) != 0 {
								return ts + 2046 /* "" */
							}
							return ts + 24457 /* ", scalar" */
						}(),
						func() uintptr {
							if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_ARRAY != 0 {
								return ts + 24466 /* ", array" */
							}
							return ts + 2046 /* "" */
						}(),
						func() uintptr {
							if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_LINK != 0 {
								return ts + 24474 /* ", link" */
							}
							return ts + 2046 /* "" */
						}(),
						func() uintptr {
							if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_ARGUMENT != 0 {
								return ts + 24481 /* ", arg" */
							}
							return ts + 2046 /* "" */
						}(),
						func() uintptr {
							if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_TEMPORARY != 0 {
								return ts + 24487 /* ", temp" */
							}
							return ts + 2046 /* "" */
						}(),
						func() uintptr {
							if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_RESOLVED != 0 {
								return ts + 24494 /* ", resolved" */
							}
							return ts + 2046 /* "" */
						}()))
				if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_TEMPORARY != 0 {
					XTcl_AppendToObj(tls, bufferObj, ts+350, -1)
				} else {
					XTcl_AppendPrintfToObj(tls, bufferObj, ts+24505,
						libc.VaList(bp+224, localPtr+40))
				}
				localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr
			}
		}
	}

	// Print the ExceptionRange array.

	if (*ByteCode)(unsafe.Pointer(codePtr)).FnumExceptRanges > 0 {
		XTcl_AppendPrintfToObj(tls, bufferObj, ts+24513,
			libc.VaList(bp+232, (*ByteCode)(unsafe.Pointer(codePtr)).FnumExceptRanges, (*ByteCode)(unsafe.Pointer(codePtr)).FmaxExceptDepth))
		for i = 0; i < (*ByteCode)(unsafe.Pointer(codePtr)).FnumExceptRanges; i++ {
			var rangePtr uintptr = (*ByteCode)(unsafe.Pointer(codePtr)).FexceptArrayPtr + uintptr(i)*28

			XTcl_AppendPrintfToObj(tls, bufferObj,
				ts+24547,
				libc.VaList(bp+248, i, (*ExceptionRange)(unsafe.Pointer(rangePtr)).FnestingLevel,
					func() uintptr {
						if (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype == LOOP_EXCEPTION_RANGE {
							return ts + 18631 /* "loop" */
						}
						return ts + 5111 /* "catch" */
					}(),
					(*ExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset,
					(*ExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset+(*ExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes-1))
			switch (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype {
			case LOOP_EXCEPTION_RANGE:
				XTcl_AppendPrintfToObj(tls, bufferObj, ts+24582,
					libc.VaList(bp+288, (*ExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset, (*ExceptionRange)(unsafe.Pointer(rangePtr)).FbreakOffset))
				break
				fallthrough
			case CATCH_EXCEPTION_RANGE:
				XTcl_AppendPrintfToObj(tls, bufferObj, ts+24605,
					libc.VaList(bp+304, (*ExceptionRange)(unsafe.Pointer(rangePtr)).FcatchOffset))
				break
				fallthrough
			default:
				XTcl_Panic(tls, ts+24615,
					libc.VaList(bp+312, (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype))
			}
		}
	}

	// If there were no commands (e.g., an expression or an empty string was
	// compiled), just print all instructions and return.

	if numCmds == 0 {
		pc = codeStart
		for pc < codeLimit {
			XTcl_AppendToObj(tls, bufferObj, ts+24666, -1)
			pc += uintptr(sFormatInstruction(tls, codePtr, pc, bufferObj))
		}
		return bufferObj
	}

	// Print table showing the code offset, source offset, and source length
	// for each command. These are encoded as a sequence of bytes.

	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24671, libc.VaList(bp+320, numCmds))
	codeDeltaNext = (*ByteCode)(unsafe.Pointer(codePtr)).FcodeDeltaStart
	codeLengthNext = (*ByteCode)(unsafe.Pointer(codePtr)).FcodeLengthStart
	srcDeltaNext = (*ByteCode)(unsafe.Pointer(codePtr)).FsrcDeltaStart
	srcLengthNext = (*ByteCode)(unsafe.Pointer(codePtr)).FsrcLengthStart
	codeOffset = libc.AssignInt32(&srcOffset, 0)
	for i = 0; i < numCmds; i++ {
		if uint32(*(*uint8)(unsafe.Pointer(codeDeltaNext))) == uint32(0xFF) {
			codeDeltaNext++
			delta = int32(uint32(*(*uint8)(unsafe.Pointer(codeDeltaNext)))<<24) | int32(*(*uint8)(unsafe.Pointer(codeDeltaNext + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(codeDeltaNext + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(codeDeltaNext + uintptr(3))))
			codeDeltaNext += uintptr(4)
		} else {
			delta = int32(*(*int8)(unsafe.Pointer(codeDeltaNext)))
			codeDeltaNext++
		}
		codeOffset = codeOffset + delta

		if uint32(*(*uint8)(unsafe.Pointer(codeLengthNext))) == uint32(0xFF) {
			codeLengthNext++
			codeLen = int32(uint32(*(*uint8)(unsafe.Pointer(codeLengthNext)))<<24) | int32(*(*uint8)(unsafe.Pointer(codeLengthNext + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(codeLengthNext + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(codeLengthNext + uintptr(3))))
			codeLengthNext += uintptr(4)
		} else {
			codeLen = int32(*(*int8)(unsafe.Pointer(codeLengthNext)))
			codeLengthNext++
		}

		if uint32(*(*uint8)(unsafe.Pointer(srcDeltaNext))) == uint32(0xFF) {
			srcDeltaNext++
			delta = int32(uint32(*(*uint8)(unsafe.Pointer(srcDeltaNext)))<<24) | int32(*(*uint8)(unsafe.Pointer(srcDeltaNext + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(srcDeltaNext + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(srcDeltaNext + uintptr(3))))
			srcDeltaNext += uintptr(4)
		} else {
			delta = int32(*(*int8)(unsafe.Pointer(srcDeltaNext)))
			srcDeltaNext++
		}
		srcOffset = srcOffset + delta

		if uint32(*(*uint8)(unsafe.Pointer(srcLengthNext))) == uint32(0xFF) {
			srcLengthNext++
			srcLen = int32(uint32(*(*uint8)(unsafe.Pointer(srcLengthNext)))<<24) | int32(*(*uint8)(unsafe.Pointer(srcLengthNext + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(srcLengthNext + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(srcLengthNext + uintptr(3))))
			srcLengthNext += uintptr(4)
		} else {
			srcLen = int32(*(*int8)(unsafe.Pointer(srcLengthNext)))
			srcLengthNext++
		}

		XTcl_AppendPrintfToObj(tls, bufferObj, ts+24686,
			libc.VaList(bp+328, func() uintptr {
				if i%2 != 0 {
					return ts + 24713 /* "     " */
				}
				return ts + 24719 /* "\n   " */
			}(),
				i+1, codeOffset, codeOffset+codeLen-1,
				srcOffset, srcOffset+srcLen-1))
	}
	if numCmds > 0 {
		XTcl_AppendToObj(tls, bufferObj, ts+350, -1)
	}

	// Print each instruction. If the instruction corresponds to the start of
	// a command, print the command's source. Note that we don't need the code
	// length here.

	codeDeltaNext = (*ByteCode)(unsafe.Pointer(codePtr)).FcodeDeltaStart
	srcDeltaNext = (*ByteCode)(unsafe.Pointer(codePtr)).FsrcDeltaStart
	srcLengthNext = (*ByteCode)(unsafe.Pointer(codePtr)).FsrcLengthStart
	codeOffset = libc.AssignInt32(&srcOffset, 0)
	pc = codeStart
	for i = 0; i < numCmds; i++ {
		if uint32(*(*uint8)(unsafe.Pointer(codeDeltaNext))) == uint32(0xFF) {
			codeDeltaNext++
			delta = int32(uint32(*(*uint8)(unsafe.Pointer(codeDeltaNext)))<<24) | int32(*(*uint8)(unsafe.Pointer(codeDeltaNext + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(codeDeltaNext + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(codeDeltaNext + uintptr(3))))
			codeDeltaNext += uintptr(4)
		} else {
			delta = int32(*(*int8)(unsafe.Pointer(codeDeltaNext)))
			codeDeltaNext++
		}
		codeOffset = codeOffset + delta

		if uint32(*(*uint8)(unsafe.Pointer(srcDeltaNext))) == uint32(0xFF) {
			srcDeltaNext++
			delta = int32(uint32(*(*uint8)(unsafe.Pointer(srcDeltaNext)))<<24) | int32(*(*uint8)(unsafe.Pointer(srcDeltaNext + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(srcDeltaNext + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(srcDeltaNext + uintptr(3))))
			srcDeltaNext += uintptr(4)
		} else {
			delta = int32(*(*int8)(unsafe.Pointer(srcDeltaNext)))
			srcDeltaNext++
		}
		srcOffset = srcOffset + delta

		if uint32(*(*uint8)(unsafe.Pointer(srcLengthNext))) == uint32(0xFF) {
			srcLengthNext++
			srcLen = int32(uint32(*(*uint8)(unsafe.Pointer(srcLengthNext)))<<24) | int32(*(*uint8)(unsafe.Pointer(srcLengthNext + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(srcLengthNext + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(srcLengthNext + uintptr(3))))
			srcLengthNext += uintptr(4)
		} else {
			srcLen = int32(*(*int8)(unsafe.Pointer(srcLengthNext)))
			srcLengthNext++
		}

		// Print instructions before command i.

		for (int64(pc)-int64(codeStart))/1 < int64(codeOffset) {
			XTcl_AppendToObj(tls, bufferObj, ts+24666, -1)
			pc += uintptr(sFormatInstruction(tls, codePtr, pc, bufferObj))
		}

		XTcl_AppendPrintfToObj(tls, bufferObj, ts+24724, libc.VaList(bp+376, i+1))
		sPrintSourceToObj(tls, bufferObj, (*ByteCode)(unsafe.Pointer(codePtr)).Fsource+uintptr(srcOffset),
			func() int32 {
				if srcLen < 55 {
					return srcLen
				}
				return 55
			}())
		XTcl_AppendToObj(tls, bufferObj, ts+350, -1)
	}
	if pc < codeLimit {
		// Print instructions after the last command.

		for pc < codeLimit {
			XTcl_AppendToObj(tls, bufferObj, ts+24666, -1)
			pc += uintptr(sFormatInstruction(tls, codePtr, pc, bufferObj))
		}
	}
	return bufferObj
}

//----------------------------------------------------------------------
//
// FormatInstruction --
//
//	Appends a representation of a bytecode instruction to a Tcl_Obj.
//
//----------------------------------------------------------------------

func sFormatInstruction(tls *libc.TLS, codePtr uintptr, pc uintptr, bufferObj uintptr) int32 { /* tclDisassemble.c:529:1: */
	bp := tls.Alloc(316)
	defer tls.Free(316)

	var procPtr uintptr
	var opCode uint8
	var instDesc uintptr
	var codeStart uintptr
	var pcOffset uint32
	var opnd int32
	var i int32
	var j int32
	var numBytes int32
	var localCt int32
	var localPtr uintptr
	// var suffixBuffer [128]int8 at bp+184, 128
	// Additional info to print after main opcode
	// and immediates.
	var suffixSrc uintptr
	var suffixObj uintptr
	var auxPtr uintptr
	var bytes uintptr
	// var length int32 at bp+312, 4
	procPtr = (*ByteCode)(unsafe.Pointer(codePtr)).FprocPtr
	opCode = *(*uint8)(unsafe.Pointer(pc))
	instDesc = uintptr(unsafe.Pointer(&XtclInstructionTable)) + uintptr(opCode)*32
	codeStart = (*ByteCode)(unsafe.Pointer(codePtr)).FcodeStart
	pcOffset = uint32((int64(pc) - int64(codeStart)) / 1)
	opnd = 0
	numBytes = 1
	if procPtr != 0 {
		localCt = (*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals
	} else {
		localCt = 0
	}
	if procPtr != 0 {
		localPtr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr
	} else {
		localPtr = uintptr(0)
	}
	suffixSrc = uintptr(0)
	suffixObj = uintptr(0)
	auxPtr = uintptr(0)

	*(*int8)(unsafe.Pointer(bp + 184)) = int8(0)
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24739, libc.VaList(bp, pcOffset, (*InstructionDesc)(unsafe.Pointer(instDesc)).Fname))
	i = 0
__1:
	if !(i < (*InstructionDesc)(unsafe.Pointer(instDesc)).FnumOperands) {
		goto __3
	}
	switch *(*InstOperandType)(unsafe.Pointer(instDesc + 20 + uintptr(i)*4)) {
	case OPERAND_INT1:
		goto __5
	case OPERAND_INT4:
		goto __6
	case OPERAND_UINT1:
		goto __7
	case OPERAND_UINT4:
		goto __8
	case OPERAND_OFFSET1:
		goto __9
	case OPERAND_OFFSET4:
		goto __10
	case OPERAND_LIT1:
		goto __11
	case OPERAND_LIT4:
		goto __12
	case OPERAND_AUX4:
		goto __13
	case OPERAND_IDX4:
		goto __14
	case OPERAND_LVT1:
		goto __15
	case OPERAND_LVT4:
		goto __16
	case OPERAND_SCLS1:
		goto __17
	case OPERAND_NONE:
		goto __18
	default:
		goto __19
	}
	goto __4
__5:
	opnd = int32(*(*int8)(unsafe.Pointer(pc + uintptr(numBytes))))
	numBytes++
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24748, libc.VaList(bp+16, opnd))
	goto __4
__6:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(3))))
	numBytes = numBytes + 4
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24748, libc.VaList(bp+24, opnd))
	goto __4
__7:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes)))))
	numBytes++
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24753, libc.VaList(bp+32, uint32(opnd)))
	goto __4
__8:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(3)))))
	numBytes = numBytes + 4
	if !(int32(opCode) == INST_START_CMD) {
		goto __20
	}
	libc.Xsprintf(tls, bp+184+uintptr(libc.Xstrlen(tls, bp+184)),
		ts+24757, libc.VaList(bp+40, opnd))
__20:
	;
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24753, libc.VaList(bp+48, uint32(opnd)))
	goto __4
__9:
	opnd = int32(*(*int8)(unsafe.Pointer(pc + uintptr(numBytes))))
	numBytes++
	libc.Xsprintf(tls, bp+184, ts+24778, libc.VaList(bp+56, pcOffset+uint32(opnd)))
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24748, libc.VaList(bp+64, opnd))
	goto __4
__10:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(3))))
	numBytes = numBytes + 4
	if !(int32(opCode) == INST_START_CMD) {
		goto __21
	}
	libc.Xsprintf(tls, bp+184, ts+24784, libc.VaList(bp+72, pcOffset+uint32(opnd)))
	goto __22
__21:
	libc.Xsprintf(tls, bp+184, ts+24778, libc.VaList(bp+80, pcOffset+uint32(opnd)))
__22:
	;
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24748, libc.VaList(bp+88, opnd))
	goto __4
__11:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes)))))
	numBytes++
	suffixObj = *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(opnd)*8))
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24753, libc.VaList(bp+96, uint32(opnd)))
	goto __4
__12:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(3)))))
	numBytes = numBytes + 4
	suffixObj = *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(opnd)*8))
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24753, libc.VaList(bp+104, uint32(opnd)))
	goto __4
__13:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(3)))))
	numBytes = numBytes + 4
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24753, libc.VaList(bp+112, uint32(opnd)))
	auxPtr = (*ByteCode)(unsafe.Pointer(codePtr)).FauxDataArrayPtr + uintptr(opnd)*16
	goto __4
__14:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(3))))
	numBytes = numBytes + 4
	if !(opnd >= -1) {
		goto __23
	}
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24802, libc.VaList(bp+120, opnd))
	goto __24
__23:
	if !(opnd == -2) {
		goto __25
	}
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24806, 0)
	goto __26
__25:
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24811, libc.VaList(bp+128, -2-opnd))
__26:
	;
__24:
	;
	goto __4
__15:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes)))))
	numBytes++
	goto printLVTindex
__16:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes) + uintptr(3)))))
	numBytes = numBytes + 4
printLVTindex:
	if !(localPtr != uintptr(0)) {
		goto __27
	}
	if !(opnd >= localCt) {
		goto __28
	}
	XTcl_Panic(tls, ts+24819,
		libc.VaList(bp+136, uint32(opnd), localCt))
__28:
	;
	j = 0
__29:
	if !(j < opnd) {
		goto __31
	}
	localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr
	goto __30
__30:
	j++
	goto __29
	goto __31
__31:
	;
	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_TEMPORARY != 0) {
		goto __32
	}
	libc.Xsprintf(tls, bp+184, ts+24873, libc.VaList(bp+152, uint32(opnd)))
	goto __33
__32:
	libc.Xsprintf(tls, bp+184, ts+24885, 0)
	suffixSrc = localPtr + 40 /* &.name */
__33:
	;
__27:
	;
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24890, libc.VaList(bp+160, uint32(opnd)))
	goto __4
__17:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes)))))
	numBytes++
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24897,
		libc.VaList(bp+168, XtclStringClassTable[opnd].Fname))
	goto __4
__18:
__19:
	goto __4
__4:
	;
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;
	if !(suffixObj != 0) {
		goto __34
	}

	XTcl_AppendToObj(tls, bufferObj, ts+24901, -1)
	bytes = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(opnd)*8)), bp+312)
	sPrintSourceToObj(tls, bufferObj, bytes, func() int32 {
		if *(*int32)(unsafe.Pointer(bp + 312)) < 40 {
			return *(*int32)(unsafe.Pointer(bp + 312))
		}
		return 40
	}())
	goto __35
__34:
	if !(*(*int8)(unsafe.Pointer(bp + 184)) != 0) {
		goto __36
	}
	XTcl_AppendPrintfToObj(tls, bufferObj, ts+24905, libc.VaList(bp+176, bp+184))
	if !(suffixSrc != 0) {
		goto __37
	}
	sPrintSourceToObj(tls, bufferObj, suffixSrc, 40)
__37:
	;
__36:
	;
__35:
	;
	XTcl_AppendToObj(tls, bufferObj, ts+350, -1)
	if !(auxPtr != 0 && (*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxPtr)).Ftype)).FprintProc != 0) {
		goto __38
	}
	XTcl_AppendToObj(tls, bufferObj, ts+24911, -1)
	(*struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uint32)
	})(unsafe.Pointer(&struct{ uintptr }{(*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxPtr)).Ftype)).FprintProc})).f(tls, (*AuxData)(unsafe.Pointer(auxPtr)).FclientData, bufferObj, codePtr,
		pcOffset)
	XTcl_AppendToObj(tls, bufferObj, ts+24915, -1)
__38:
	;
	return numBytes
}

//----------------------------------------------------------------------
//
// TclGetInnerContext --
//
//	If possible, returns a list capturing the inner context. Otherwise
//	return NULL.
//
//----------------------------------------------------------------------

func XTclGetInnerContext(tls *libc.TLS, interp uintptr, pc uintptr, tosPtr uintptr) uintptr { /* tclDisassemble.c:680:9: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var objc int32 = 0
	var off int32 = 0
	var result uintptr
	var iPtr uintptr = interp

	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_STR_LEN:
		fallthrough
	case INST_LNOT:
		fallthrough
	case INST_BITNOT:
		fallthrough
	case INST_UMINUS:
		fallthrough
	case INST_UPLUS:
		fallthrough
	case INST_TRY_CVT_TO_NUMERIC:
		fallthrough
	case INST_EXPAND_STKTOP:
		fallthrough
	case INST_EXPR_STK:
		objc = 1
		break

	case INST_LIST_IN:
		fallthrough
	case INST_LIST_NOT_IN:
		fallthrough // Basic list containment operators.
	case INST_STR_EQ:
		fallthrough
	case INST_STR_NEQ:
		fallthrough // String (in)equality check
	case INST_STR_CMP:
		fallthrough // String compare.
	case INST_STR_INDEX:
		fallthrough
	case INST_STR_MATCH:
		fallthrough
	case INST_REGEXP:
		fallthrough
	case INST_EQ:
		fallthrough
	case INST_NEQ:
		fallthrough
	case INST_LT:
		fallthrough
	case INST_GT:
		fallthrough
	case INST_LE:
		fallthrough
	case INST_GE:
		fallthrough
	case INST_MOD:
		fallthrough
	case INST_LSHIFT:
		fallthrough
	case INST_RSHIFT:
		fallthrough
	case INST_BITOR:
		fallthrough
	case INST_BITXOR:
		fallthrough
	case INST_BITAND:
		fallthrough
	case INST_EXPON:
		fallthrough
	case INST_ADD:
		fallthrough
	case INST_SUB:
		fallthrough
	case INST_DIV:
		fallthrough
	case INST_MULT:
		objc = 2
		break

	case INST_RETURN_STK:
		// early pop. TODO: dig out opt dict too :/
		objc = 1
		break

	case INST_SYNTAX:
		fallthrough
	case INST_RETURN_IMM:
		objc = 2
		break

	case INST_INVOKE_STK4:
		objc = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		break

	case INST_INVOKE_STK1:
		objc = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
		break
	}

	result = (*Interp)(unsafe.Pointer(iPtr)).FinnerContext
	if (*Tcl_Obj)(unsafe.Pointer(result)).FrefCount > 1 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = result
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Interp)(unsafe.Pointer(iPtr)).FinnerContext = libc.AssignUintptr(&result, XTcl_NewListObj(tls, objc+1, uintptr(0)))
		(*Tcl_Obj)(unsafe.Pointer(result)).FrefCount++
	} else {
		// var len int32 at bp+8, 4

		// Reset while keeping the list internalrep as much as possible.

		XTcl_ListObjLength(tls, interp, result, bp+8)
		XTcl_ListObjReplace(tls, interp, result, 0, *(*int32)(unsafe.Pointer(bp + 8 /* len */)), 0, uintptr(0))
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), result, XTclNewInstNameObj(tls, *(*uint8)(unsafe.Pointer(pc))))

	for ; objc > 0; objc-- {
		var objPtr uintptr

		objPtr = *(*uintptr)(unsafe.Pointer(tosPtr + uintptr(1-objc+off)*8))
		if !(objPtr != 0) {
			XTcl_Panic(tls, ts+24918, 0)
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount <= 0 {
			XTcl_Panic(tls, ts+24965,
				libc.VaList(bp, objPtr))
		}
		XTcl_ListObjAppendElement(tls, uintptr(0), result, objPtr)
	}

	return result
}

//----------------------------------------------------------------------
//
// TclNewInstNameObj --
//
//	Creates a new InstName Tcl_Obj based on the given instruction
//
//----------------------------------------------------------------------

func XTclNewInstNameObj(tls *libc.TLS, inst uint8) uintptr { /* tclDisassemble.c:797:9: */
	var objPtr uintptr = XTcl_NewObj(tls)

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&tclInstNameType))
	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(inst)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)

	return objPtr
}

//----------------------------------------------------------------------
//
// UpdateStringOfInstName --
//
//	Update the string representation for an instruction name object.
//
//----------------------------------------------------------------------

func sUpdateStringOfInstName(tls *libc.TLS, objPtr uintptr) { /* tclDisassemble.c:821:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var inst int32 = int32(*(*int64)(unsafe.Pointer(objPtr + 32)))
	var s uintptr
	// var buf [20]int8 at bp+8, 20

	var len int32

	if inst < 0 || inst > LAST_INST_OPCODE {
		libc.Xsprintf(tls, bp+8, ts+25016, libc.VaList(bp, inst))
		s = bp + 8 /* &buf[0] */
	} else {
		s = XtclInstructionTable[*(*int64)(unsafe.Pointer(objPtr + 32))].Fname
	}
	len = int32(libc.Xstrlen(tls, s))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(len+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, s, uint64(len+1))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = len
}

//----------------------------------------------------------------------
//
// PrintSourceToObj --
//
//	Appends a quoted representation of a string to a Tcl_Obj.
//
//----------------------------------------------------------------------

func sPrintSourceToObj(tls *libc.TLS, appendObj uintptr, stringPtr uintptr, maxChars int32) { /* tclDisassemble.c:851:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var p uintptr
	var i int32 = 0
	var len int32

	if stringPtr == uintptr(0) {
		XTcl_AppendToObj(tls, appendObj, ts+25024, -1)
		return
	}

	XTcl_AppendToObj(tls, appendObj, ts+25027, -1)
	p = stringPtr
	for ; int32(*(*int8)(unsafe.Pointer(p))) != 0 && i < maxChars; p += uintptr(len) {
		// var ucs4 int32 at bp+24, 4

		len = XTclUtfToUCS4(tls, p, bp+24)
		switch *(*int32)(unsafe.Pointer(bp + 24 /* ucs4 */)) {
		case '"':
			XTcl_AppendToObj(tls, appendObj, ts+25029, -1)
			i = i + 2
			continue
		case '\f':
			XTcl_AppendToObj(tls, appendObj, ts+25032, -1)
			i = i + 2
			continue
		case '\n':
			XTcl_AppendToObj(tls, appendObj, ts+25035, -1)
			i = i + 2
			continue
		case '\r':
			XTcl_AppendToObj(tls, appendObj, ts+25038, -1)
			i = i + 2
			continue
		case '\t':
			XTcl_AppendToObj(tls, appendObj, ts+25041, -1)
			i = i + 2
			continue
		case '\v':
			XTcl_AppendToObj(tls, appendObj, ts+25044, -1)
			i = i + 2
			continue
		default:
			if *(*int32)(unsafe.Pointer(bp + 24)) > 0xFFFF {
				XTcl_AppendPrintfToObj(tls, appendObj, ts+25047, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 24 /* ucs4 */))))
				i = i + 10
			} else if *(*int32)(unsafe.Pointer(bp + 24)) < 0x20 || *(*int32)(unsafe.Pointer(bp + 24)) >= 0x7F {
				XTcl_AppendPrintfToObj(tls, appendObj, ts+25054, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(bp + 24 /* ucs4 */))))
				i = i + 6
			} else {
				XTcl_AppendPrintfToObj(tls, appendObj, ts+25061, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(bp + 24 /* ucs4 */))))
				i++
			}
			continue
		}
	}
	if int32(*(*int8)(unsafe.Pointer(p))) != 0 {
		XTcl_AppendToObj(tls, appendObj, ts+7891, -1)
	}
	XTcl_AppendToObj(tls, appendObj, ts+25027, -1)
}

//----------------------------------------------------------------------
//
// DisassembleByteCodeAsDicts --
//
//	Given an object which is of bytecode type, return a disassembled
//	version of the bytecode (in a new refcount 0 object) in a dictionary.
//	No guarantees are made about the details of the contents of the
//	result, but it is intended to be more readable than the old output
//	format.
//
//----------------------------------------------------------------------

func sDisassembleByteCodeAsDicts(tls *libc.TLS, interp uintptr, objPtr uintptr) uintptr { /* tclDisassemble.c:929:16: */
	bp := tls.Alloc(180)
	defer tls.Free(180)

	var codePtr uintptr
	var description uintptr
	var literals uintptr
	var variables uintptr
	var instructions uintptr
	var inst uintptr
	var aux uintptr
	var exn uintptr
	var commands uintptr
	// var file uintptr at bp+168, 8

	var pc uintptr
	var opnd uintptr
	var codeOffPtr uintptr
	var codeLenPtr uintptr
	var srcOffPtr uintptr
	var srcLenPtr uintptr
	var codeOffset int32
	var codeLength int32
	var sourceOffset int32
	var sourceLength int32
	var i int32
	var val int32
	// var line int32 at bp+176, 4

	// var descriptor [2]uintptr at bp+152, 16

	var localCount int32
	var localPtr uintptr
	var instDesc uintptr
	var address int32
	var desc uintptr
	var desc1 uintptr
	var auxData uintptr
	var auxDesc uintptr
	var rangePtr uintptr
	var cmd uintptr
	codePtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	// Get the literals from the bytecode.

	literals = XTcl_NewObj(tls)
	i = 0
__1:
	if !(i < (*ByteCode)(unsafe.Pointer(codePtr)).FnumLitObjects) {
		goto __3
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), literals, *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(i)*8)))
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;

	// Get the variables from the bytecode.

	variables = XTcl_NewObj(tls)
	if !((*ByteCode)(unsafe.Pointer(codePtr)).FprocPtr != 0) {
		goto __4
	}
	localCount = (*Proc)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FprocPtr)).FnumCompiledLocals
	localPtr = (*Proc)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FprocPtr)).FfirstLocalPtr

	i = 0
__5:
	if !(i < localCount) {
		goto __7
	}

	*(*uintptr)(unsafe.Pointer(bp + 152)) = XTcl_NewObj(tls)
	if !!((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&(VAR_ARRAY|VAR_LINK) != 0) {
		goto __8
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 152)),
		XTcl_NewStringObj(tls, ts+25064, -1))
__8:
	;
	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_ARRAY != 0) {
		goto __9
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 152)),
		XTcl_NewStringObj(tls, ts+25071, -1))
__9:
	;
	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_LINK != 0) {
		goto __10
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 152)),
		XTcl_NewStringObj(tls, ts+12201, -1))
__10:
	;
	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_ARGUMENT != 0) {
		goto __11
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 152)),
		XTcl_NewStringObj(tls, ts+25077, -1))
__11:
	;
	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_TEMPORARY != 0) {
		goto __12
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 152)),
		XTcl_NewStringObj(tls, ts+25081, -1))
__12:
	;
	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_RESOLVED != 0) {
		goto __13
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 152)),
		XTcl_NewStringObj(tls, ts+25086, -1))
__13:
	;
	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_TEMPORARY != 0) {
		goto __14
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), variables,
		XTcl_NewListObj(tls, 1, bp+152))
	goto __15
__14:
	*(*uintptr)(unsafe.Pointer(bp + 152 + 1*8)) = XTcl_NewStringObj(tls, localPtr+40, -1)
	XTcl_ListObjAppendElement(tls, uintptr(0), variables,
		XTcl_NewListObj(tls, 2, bp+152))
__15:
	;
	goto __6
__6:
	i++
	localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr
	goto __5
	goto __7
__7:
	;
__4:
	;

	// Get the instructions from the bytecode.

	instructions = XTcl_NewObj(tls)
	pc = (*ByteCode)(unsafe.Pointer(codePtr)).FcodeStart
__16:
	if !(pc < (*ByteCode)(unsafe.Pointer(codePtr)).FcodeStart+uintptr((*ByteCode)(unsafe.Pointer(codePtr)).FnumCodeBytes)) {
		goto __18
	}
	instDesc = uintptr(unsafe.Pointer(&XtclInstructionTable)) + uintptr(*(*uint8)(unsafe.Pointer(pc)))*32
	address = int32((int64(pc) - int64((*ByteCode)(unsafe.Pointer(codePtr)).FcodeStart)) / 1)

	inst = XTcl_NewObj(tls)
	XTcl_ListObjAppendElement(tls, uintptr(0), inst, XTcl_NewStringObj(tls,
		(*InstructionDesc)(unsafe.Pointer(instDesc)).Fname, -1))
	opnd = pc + uintptr(1)
	i = 0
__19:
	if !(i < (*InstructionDesc)(unsafe.Pointer(instDesc)).FnumOperands) {
		goto __21
	}
	switch *(*InstOperandType)(unsafe.Pointer(instDesc + 20 + uintptr(i)*4)) {
	case OPERAND_INT1:
		goto __23
	case OPERAND_UINT1:
		goto __24
	case OPERAND_INT4:
		goto __25
	case OPERAND_UINT4:
		goto __26

	case OPERAND_OFFSET1:
		goto __27
	case OPERAND_OFFSET4:
		goto __28

	case OPERAND_LIT1:
		goto __29
	case OPERAND_LIT4:
		goto __30

	case OPERAND_LVT1:
		goto __31
	case OPERAND_LVT4:
		goto __32
	case OPERAND_IDX4:
		goto __33
	case OPERAND_AUX4:
		goto __34
	case OPERAND_SCLS1:
		goto __35
	case OPERAND_NONE:
		goto __36
	}
	goto __22
__23:
	val = int32(*(*int8)(unsafe.Pointer(opnd)))
	opnd += uintptr(1)
	goto formatNumber
__24:
	val = int32(uint32(*(*uint8)(unsafe.Pointer(opnd))))
	opnd += uintptr(1)
	goto formatNumber
__25:
	val = int32(uint32(*(*uint8)(unsafe.Pointer(opnd)))<<24) | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(3))))
	opnd += uintptr(4)
	goto formatNumber
__26:
	val = int32(uint32(int32(*(*uint8)(unsafe.Pointer(opnd)))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(opnd + uintptr(3)))))
	opnd += uintptr(4)
formatNumber:
	XTcl_ListObjAppendElement(tls, uintptr(0), inst, XTcl_NewIntObj(tls, val))
	goto __22

__27:
	val = int32(*(*int8)(unsafe.Pointer(opnd)))
	opnd += uintptr(1)
	goto formatAddress
__28:
	val = int32(uint32(*(*uint8)(unsafe.Pointer(opnd)))<<24) | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(3))))
	opnd += uintptr(4)
formatAddress:
	XTcl_ListObjAppendElement(tls, uintptr(0), inst, XTcl_ObjPrintf(tls,
		ts+25095, libc.VaList(bp, address+val)))
	goto __22

__29:
	val = int32(uint32(*(*uint8)(unsafe.Pointer(opnd))))
	opnd += uintptr(1)
	goto formatLiteral
__30:
	val = int32(uint32(int32(*(*uint8)(unsafe.Pointer(opnd)))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(opnd + uintptr(3)))))
	opnd += uintptr(4)
formatLiteral:
	XTcl_ListObjAppendElement(tls, uintptr(0), inst, XTcl_ObjPrintf(tls,
		ts+25101, libc.VaList(bp+8, val)))
	goto __22

__31:
	val = int32(uint32(*(*uint8)(unsafe.Pointer(opnd))))
	opnd += uintptr(1)
	goto formatVariable
__32:
	val = int32(uint32(int32(*(*uint8)(unsafe.Pointer(opnd)))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(opnd + uintptr(3)))))
	opnd += uintptr(4)
formatVariable:
	XTcl_ListObjAppendElement(tls, uintptr(0), inst, XTcl_ObjPrintf(tls,
		ts+25105, libc.VaList(bp+16, val)))
	goto __22
__33:
	val = int32(uint32(*(*uint8)(unsafe.Pointer(opnd)))<<24) | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(3))))
	opnd += uintptr(4)
	if !(val >= -1) {
		goto __37
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), inst, XTcl_ObjPrintf(tls,
		ts+25110, libc.VaList(bp+24, val)))
	goto __38
__37:
	if !(val == -2) {
		goto __39
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), inst, XTcl_NewStringObj(tls,
		ts+25114, -1))
	goto __40
__39:
	XTcl_ListObjAppendElement(tls, uintptr(0), inst, XTcl_ObjPrintf(tls,
		ts+25119, libc.VaList(bp+32, -2-val)))
__40:
	;
__38:
	;
	goto __22
__34:
	val = int32(uint32(*(*uint8)(unsafe.Pointer(opnd)))<<24) | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(opnd + uintptr(3))))
	opnd += uintptr(4)
	XTcl_ListObjAppendElement(tls, uintptr(0), inst, XTcl_ObjPrintf(tls,
		ts+25127, libc.VaList(bp+40, val)))
	goto __22
__35:
	val = int32(uint32(*(*uint8)(unsafe.Pointer(opnd))))
	opnd++
	XTcl_ListObjAppendElement(tls, uintptr(0), inst, XTcl_ObjPrintf(tls,
		ts+25131, libc.VaList(bp+48, XtclStringClassTable[val].Fname)))
	goto __22
__36:
	XTcl_Panic(tls, ts+25135, libc.VaList(bp+56, int32(*(*uint8)(unsafe.Pointer(pc)))))
__22:
	;
	goto __20
__20:
	i++
	goto __19
	goto __21
__21:
	;
	XTcl_DictObjPut(tls, uintptr(0), instructions, XTcl_NewIntObj(tls, address), inst)
	pc += uintptr((*InstructionDesc)(unsafe.Pointer(instDesc)).FnumBytes)
	goto __17
__17:
	;
	goto __16
	goto __18
__18:
	;

	// Get the auxiliary data from the bytecode.

	aux = XTcl_NewObj(tls)
	i = 0
__41:
	if !(i < (*ByteCode)(unsafe.Pointer(codePtr)).FnumAuxDataItems) {
		goto __43
	}
	auxData = (*ByteCode)(unsafe.Pointer(codePtr)).FauxDataArrayPtr + uintptr(i)*16
	auxDesc = XTcl_NewStringObj(tls, (*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxData)).Ftype)).Fname, -1)

	if !((*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxData)).Ftype)).FdisassembleProc != 0) {
		goto __44
	}
	desc = XTcl_NewObj(tls)

	XTcl_DictObjPut(tls, uintptr(0), desc, XTcl_NewStringObj(tls, ts+3660, -1), auxDesc)
	auxDesc = desc
	(*struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uint32)
	})(unsafe.Pointer(&struct{ uintptr }{(*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxData)).Ftype)).FdisassembleProc})).f(tls, (*AuxData)(unsafe.Pointer(auxData)).FclientData, auxDesc,
		codePtr, uint32(0))
	goto __45
__44:
	if !((*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxData)).Ftype)).FprintProc != 0) {
		goto __46
	}
	desc1 = XTcl_NewObj(tls)

	(*struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uint32)
	})(unsafe.Pointer(&struct{ uintptr }{(*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxData)).Ftype)).FprintProc})).f(tls, (*AuxData)(unsafe.Pointer(auxData)).FclientData, desc1, codePtr, uint32(0))
	XTcl_ListObjAppendElement(tls, uintptr(0), auxDesc, desc1)
__46:
	;
__45:
	;
	XTcl_ListObjAppendElement(tls, uintptr(0), aux, auxDesc)
	goto __42
__42:
	i++
	goto __41
	goto __43
__43:
	;

	// Get the exception ranges from the bytecode.

	exn = XTcl_NewObj(tls)
	i = 0
__47:
	if !(i < (*ByteCode)(unsafe.Pointer(codePtr)).FnumExceptRanges) {
		goto __49
	}
	rangePtr = (*ByteCode)(unsafe.Pointer(codePtr)).FexceptArrayPtr + uintptr(i)*28

	switch (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype {
	case LOOP_EXCEPTION_RANGE:
		goto __51
	case CATCH_EXCEPTION_RANGE:
		goto __52
	}
	goto __50
__51:
	XTcl_ListObjAppendElement(tls, uintptr(0), exn, XTcl_ObjPrintf(tls,
		ts+25179,
		libc.VaList(bp+64, ts+18631, (*ExceptionRange)(unsafe.Pointer(rangePtr)).FnestingLevel, (*ExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset,
			(*ExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset+(*ExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes-1,
			(*ExceptionRange)(unsafe.Pointer(rangePtr)).FbreakOffset, (*ExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset)))
	goto __50
__52:
	XTcl_ListObjAppendElement(tls, uintptr(0), exn, XTcl_ObjPrintf(tls,
		ts+25231,
		libc.VaList(bp+112, ts+5111, (*ExceptionRange)(unsafe.Pointer(rangePtr)).FnestingLevel, (*ExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset,
			(*ExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset+(*ExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes-1,
			(*ExceptionRange)(unsafe.Pointer(rangePtr)).FcatchOffset)))
	goto __50
__50:
	;
	goto __48
__48:
	i++
	goto __47
	goto __49
__49:
	;

	// Get the command information from the bytecode.
	//
	// The way these are encoded in the bytecode is non-trivial; the Decode
	// macro (which updates its argument and returns the next decoded value)
	// handles this so that the rest of the code does not.

	commands = XTcl_NewObj(tls)
	codeOffPtr = (*ByteCode)(unsafe.Pointer(codePtr)).FcodeDeltaStart
	codeLenPtr = (*ByteCode)(unsafe.Pointer(codePtr)).FcodeLengthStart
	srcOffPtr = (*ByteCode)(unsafe.Pointer(codePtr)).FsrcDeltaStart
	srcLenPtr = (*ByteCode)(unsafe.Pointer(codePtr)).FsrcLengthStart
	codeOffset = libc.AssignInt32(&sourceOffset, 0)
	i = 0
__53:
	if !(i < (*ByteCode)(unsafe.Pointer(codePtr)).FnumCommands) {
		goto __55
	}

	codeOffset = codeOffset + func() int32 {
		if uint32(*(*uint8)(unsafe.Pointer(codeOffPtr))) == uint32(0xFF) {
			return func() int32 {
				codeOffPtr += uintptr(5)
				return int32(uint32(*(*uint8)(unsafe.Pointer(codeOffPtr - uintptr(4))))<<24) | int32(*(*uint8)(unsafe.Pointer(codeOffPtr - uintptr(4) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(codeOffPtr - uintptr(4) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(codeOffPtr - uintptr(4) + uintptr(3))))
			}()
		}
		return func() int32 {
			codeOffPtr += uintptr(1)
			return int32(*(*int8)(unsafe.Pointer(codeOffPtr - uintptr(1))))
		}()
	}()
	codeLength = func() int32 {
		if uint32(*(*uint8)(unsafe.Pointer(codeLenPtr))) == uint32(0xFF) {
			return func() int32 {
				codeLenPtr += uintptr(5)
				return int32(uint32(*(*uint8)(unsafe.Pointer(codeLenPtr - uintptr(4))))<<24) | int32(*(*uint8)(unsafe.Pointer(codeLenPtr - uintptr(4) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(codeLenPtr - uintptr(4) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(codeLenPtr - uintptr(4) + uintptr(3))))
			}()
		}
		return func() int32 {
			codeLenPtr += uintptr(1)
			return int32(*(*int8)(unsafe.Pointer(codeLenPtr - uintptr(1))))
		}()
	}()
	sourceOffset = sourceOffset + func() int32 {
		if uint32(*(*uint8)(unsafe.Pointer(srcOffPtr))) == uint32(0xFF) {
			return func() int32 {
				srcOffPtr += uintptr(5)
				return int32(uint32(*(*uint8)(unsafe.Pointer(srcOffPtr - uintptr(4))))<<24) | int32(*(*uint8)(unsafe.Pointer(srcOffPtr - uintptr(4) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(srcOffPtr - uintptr(4) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(srcOffPtr - uintptr(4) + uintptr(3))))
			}()
		}
		return func() int32 { srcOffPtr += uintptr(1); return int32(*(*int8)(unsafe.Pointer(srcOffPtr - uintptr(1)))) }()
	}()
	sourceLength = func() int32 {
		if uint32(*(*uint8)(unsafe.Pointer(srcLenPtr))) == uint32(0xFF) {
			return func() int32 {
				srcLenPtr += uintptr(5)
				return int32(uint32(*(*uint8)(unsafe.Pointer(srcLenPtr - uintptr(4))))<<24) | int32(*(*uint8)(unsafe.Pointer(srcLenPtr - uintptr(4) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(srcLenPtr - uintptr(4) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(srcLenPtr - uintptr(4) + uintptr(3))))
			}()
		}
		return func() int32 { srcLenPtr += uintptr(1); return int32(*(*int8)(unsafe.Pointer(srcLenPtr - uintptr(1)))) }()
	}()
	cmd = XTcl_NewObj(tls)
	XTcl_DictObjPut(tls, uintptr(0), cmd, XTcl_NewStringObj(tls, ts+25271, -1),
		XTcl_NewIntObj(tls, codeOffset))
	XTcl_DictObjPut(tls, uintptr(0), cmd, XTcl_NewStringObj(tls, ts+25280, -1),
		XTcl_NewIntObj(tls, codeOffset+codeLength-1))

	// Convert byte offsets to character offsets; important if multibyte
	// characters are present in the source!

	XTcl_DictObjPut(tls, uintptr(0), cmd, XTcl_NewStringObj(tls, ts+25287, -1),
		XTcl_NewIntObj(tls, XTcl_NumUtfChars(tls, (*ByteCode)(unsafe.Pointer(codePtr)).Fsource,
			sourceOffset)))
	XTcl_DictObjPut(tls, uintptr(0), cmd, XTcl_NewStringObj(tls, ts+25298, -1),
		XTcl_NewIntObj(tls, XTcl_NumUtfChars(tls, (*ByteCode)(unsafe.Pointer(codePtr)).Fsource,
			sourceOffset+sourceLength-1)))
	XTcl_DictObjPut(tls, uintptr(0), cmd, XTcl_NewStringObj(tls, ts+3636, -1),
		XTcl_NewStringObj(tls, (*ByteCode)(unsafe.Pointer(codePtr)).Fsource+uintptr(sourceOffset), sourceLength))
	XTcl_ListObjAppendElement(tls, uintptr(0), commands, cmd)
	goto __54
__54:
	i++
	goto __53
	goto __55
__55:
	;

	// Get the source file and line number information from the CmdFrame
	// system if it is available.

	sGetLocationInformation(tls, (*ByteCode)(unsafe.Pointer(codePtr)).FprocPtr, bp+168, bp+176)

	// Build the overall result.

	description = XTcl_NewObj(tls)
	XTcl_DictObjPut(tls, uintptr(0), description, XTcl_NewStringObj(tls, ts+25307, -1),
		literals)
	XTcl_DictObjPut(tls, uintptr(0), description, XTcl_NewStringObj(tls, ts+18558, -1),
		variables)
	XTcl_DictObjPut(tls, uintptr(0), description, XTcl_NewStringObj(tls, ts+25316, -1), exn)
	XTcl_DictObjPut(tls, uintptr(0), description, XTcl_NewStringObj(tls, ts+25326, -1),
		instructions)
	XTcl_DictObjPut(tls, uintptr(0), description, XTcl_NewStringObj(tls, ts+25339, -1), aux)
	XTcl_DictObjPut(tls, uintptr(0), description, XTcl_NewStringObj(tls, ts+13145, -1),
		commands)
	XTcl_DictObjPut(tls, uintptr(0), description, XTcl_NewStringObj(tls, ts+3636, -1),
		XTcl_NewStringObj(tls, (*ByteCode)(unsafe.Pointer(codePtr)).Fsource, (*ByteCode)(unsafe.Pointer(codePtr)).FnumSrcBytes))
	XTcl_DictObjPut(tls, uintptr(0), description, XTcl_NewStringObj(tls, ts+18781, -1),
		XTcl_NewStringObj(tls, (*Namespace)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FnsPtr)).FfullName, -1))
	XTcl_DictObjPut(tls, uintptr(0), description, XTcl_NewStringObj(tls, ts+25349, -1),
		XTcl_NewIntObj(tls, (*ByteCode)(unsafe.Pointer(codePtr)).FmaxStackDepth))
	XTcl_DictObjPut(tls, uintptr(0), description, XTcl_NewStringObj(tls, ts+25360, -1),
		XTcl_NewIntObj(tls, (*ByteCode)(unsafe.Pointer(codePtr)).FmaxExceptDepth))
	if !(*(*int32)(unsafe.Pointer(bp + 176)) > -1) {
		goto __56
	}
	XTcl_DictObjPut(tls, uintptr(0), description,
		XTcl_NewStringObj(tls, ts+25372, -1),
		XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 176 /* line */))))
__56:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 168)) != 0) {
		goto __57
	}
	XTcl_DictObjPut(tls, uintptr(0), description,
		XTcl_NewStringObj(tls, ts+25390, -1), *(*uintptr)(unsafe.Pointer(bp + 168 /* file */)))
__57:
	;
	return description
}

//----------------------------------------------------------------------
//
// Tcl_DisassembleObjCmd --
//
//	Implementation of the "::tcl::unsupported::disassemble" command. This
//	command is not documented, but will disassemble procedures, lambda
//	terms and general scripts. Note that will compile terms if necessary
//	in order to disassemble them.
//
//----------------------------------------------------------------------

func XTcl_DisassembleObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclDisassemble.c:1259:1: */
	bp := tls.Alloc(960)
	defer tls.Free(960)

	// var idx int32 at bp+496, 4

	var result int32
	var codeObjPtr uintptr
	var procPtr uintptr
	var hPtr uintptr
	var oPtr uintptr
	var methodPtr uintptr
	// var cmd Command at bp+504, 112

	var nsObjPtr uintptr
	// var nsPtr uintptr at bp+616, 8

	// var cmd1 Command at bp+624, 112

	// var cmd2 Command at bp+736, 112

	// var cmd3 Command at bp+848, 112
	codeObjPtr = uintptr(0)
	procPtr = uintptr(0)

	if !(objc < 2) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25401)
	return TCL_ERROR
__1:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&types1)), int32(unsafe.Sizeof(uintptr(0))), ts+12321, 0, bp+496) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	switch uint32(*(*int32)(unsafe.Pointer(bp + 496 /* idx */))) {
	case uint32(2) /* DISAS_LAMBDA */ :
		goto __4
	case uint32(5) /* DISAS_PROC */ :
		goto __5
	case uint32(6) /* DISAS_SCRIPT */ :
		goto __6

	case uint32(0) /* DISAS_CLASS_CONSTRUCTOR */ :
		goto __7

	case uint32(1) /* DISAS_CLASS_DESTRUCTOR */ :
		goto __8

	case uint32(3) /* DISAS_CLASS_METHOD */ :
		goto __9
	case uint32(4) /* DISAS_OBJECT_METHOD */ :
		goto __10
	default:
		goto __11
	}
	goto __3
__4:

	// Compile (if uncompiled) and disassemble a lambda term.
	//
	// WARNING! Pokes inside the lambda objtype.

	if !(objc != 3) {
		goto __12
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+25410)
	return TCL_ERROR
__12:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclLambdaType))) {
		goto __13
	}
	procPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32))
__13:
	;
	if !(procPtr == uintptr(0) || (*Proc)(unsafe.Pointer(procPtr)).FiPtr != interp) {
		goto __14
	}
	result = (*struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{XtclLambdaType.FsetFromAnyProc})).f(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(result != TCL_OK) {
		goto __15
	}
	return result
__15:
	;
	procPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32))
__14:
	;

	libc.Xmemset(tls, bp+504, 0, uint64(unsafe.Sizeof(Command{})))
	nsObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32 + 8 /* &.ptr2 */))
	result = XTclGetNamespaceFromObj(tls, interp, nsObjPtr, bp+616)
	if !(result != TCL_OK) {
		goto __16
	}
	return result
__16:
	;
	(*Command)(unsafe.Pointer(bp + 504 /* &cmd */)).FnsPtr = *(*uintptr)(unsafe.Pointer(bp + 616 /* nsPtr */))
	(*Proc)(unsafe.Pointer(procPtr)).FcmdPtr = bp + 504 /* &cmd */
	result = XTclPushProcCallFrame(tls, procPtr, interp, objc, objv, 1)
	if !(result != TCL_OK) {
		goto __17
	}
	return result
__17:
	;
	XTclPopStackFrame(tls, interp)
	codeObjPtr = (*Proc)(unsafe.Pointer(procPtr)).FbodyPtr
	goto __3

__5:
	if !(objc != 3) {
		goto __18
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+25421)
	return TCL_ERROR
__18:
	;

	procPtr = XTclFindProc(tls, interp, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}())
	if !(procPtr == uintptr(0)) {
		goto __19
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+13513, libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+25430,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}(), uintptr(0)))
	return TCL_ERROR
__19:
	;

	// Compile (if uncompiled) and disassemble a procedure.

	result = XTclPushProcCallFrame(tls, procPtr, interp, 2, objv+uintptr(1)*8, 1)
	if !(result != TCL_OK) {
		goto __20
	}
	return result
__20:
	;
	XTclPopStackFrame(tls, interp)
	codeObjPtr = (*Proc)(unsafe.Pointer(procPtr)).FbodyPtr
	goto __3
__6:
	// Compile and disassemble a script.

	if !(objc != 3) {
		goto __21
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+3636)
	return TCL_ERROR
__21:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr != uintptr(unsafe.Pointer(&XtclByteCodeType)) &&
		XTclSetByteCodeFromAny(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(0), uintptr(0)) != TCL_OK) {
		goto __22
	}
	return TCL_ERROR
__22:
	;
	codeObjPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	goto __3

__7:
	if !(objc != 3) {
		goto __23
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+25435)
	return TCL_ERROR
__23:
	;

	// Look up the body of a constructor.

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(oPtr == uintptr(0)) {
		goto __24
	}
	return TCL_ERROR
__24:
	;
	if !((*Object)(unsafe.Pointer(oPtr)).FclassPtr == uintptr(0)) {
		goto __25
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+25445, libc.VaList(bp+48, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+3593, ts+7170, ts+25465,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}(), uintptr(0)))
	return TCL_ERROR
__25:
	;

	methodPtr = (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).FconstructorPtr
	if !(methodPtr == uintptr(0)) {
		goto __26
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+25471,
		libc.VaList(bp+96, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+104, ts+3593, ts+7420, ts+25503,
		ts+25515, uintptr(0)))
	return TCL_ERROR
__26:
	;
	procPtr = XTclOOGetProcFromMethod(tls, methodPtr)
	if !(procPtr == uintptr(0)) {
		goto __27
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+25526, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+144, ts+3593, ts+7420, ts+25503,
		ts+25574, uintptr(0)))
	return TCL_ERROR
__27:
	;

	// Compile if necessary.

	if !((*Tcl_Obj)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FbodyPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclByteCodeType))) {
		goto __28
	}

	// Yes, this is ugly, but we need to pass the namespace in to the
	// compiler in two places.

	(*Command)(unsafe.Pointer(bp + 624 /* &cmd1 */)).FnsPtr = (*Object)(unsafe.Pointer(oPtr)).FnamespacePtr
	(*Proc)(unsafe.Pointer(procPtr)).FcmdPtr = bp + 624 /* &cmd1 */
	result = XTclProcCompileProc(tls, interp, procPtr, (*Proc)(unsafe.Pointer(procPtr)).FbodyPtr,
		(*Object)(unsafe.Pointer(oPtr)).FnamespacePtr, ts+25585,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())
	(*Proc)(unsafe.Pointer(procPtr)).FcmdPtr = uintptr(0)
	if !(result != TCL_OK) {
		goto __29
	}
	return result
__29:
	;
__28:
	;
	codeObjPtr = (*Proc)(unsafe.Pointer(procPtr)).FbodyPtr
	goto __3

__8:
	if !(objc != 3) {
		goto __30
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+25435)
	return TCL_ERROR
__30:
	;

	// Look up the body of a destructor.

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(oPtr == uintptr(0)) {
		goto __31
	}
	return TCL_ERROR
__31:
	;
	if !((*Object)(unsafe.Pointer(oPtr)).FclassPtr == uintptr(0)) {
		goto __32
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+25445, libc.VaList(bp+184, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+192, ts+3593, ts+7170, ts+25465,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}(), uintptr(0)))
	return TCL_ERROR
__32:
	;

	methodPtr = (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).FdestructorPtr
	if !(methodPtr == uintptr(0)) {
		goto __33
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+25605,
		libc.VaList(bp+232, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+240, ts+3593, ts+7420, ts+25503,
		ts+25636, uintptr(0)))
	return TCL_ERROR
__33:
	;
	procPtr = XTclOOGetProcFromMethod(tls, methodPtr)
	if !(procPtr == uintptr(0)) {
		goto __34
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+25646, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+280, ts+3593, ts+7420, ts+25503,
		ts+25574, uintptr(0)))
	return TCL_ERROR
__34:
	;

	// Compile if necessary.

	if !((*Tcl_Obj)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FbodyPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclByteCodeType))) {
		goto __35
	}

	// Yes, this is ugly, but we need to pass the namespace in to the
	// compiler in two places.

	(*Command)(unsafe.Pointer(bp + 736 /* &cmd2 */)).FnsPtr = (*Object)(unsafe.Pointer(oPtr)).FnamespacePtr
	(*Proc)(unsafe.Pointer(procPtr)).FcmdPtr = bp + 736 /* &cmd2 */
	result = XTclProcCompileProc(tls, interp, procPtr, (*Proc)(unsafe.Pointer(procPtr)).FbodyPtr,
		(*Object)(unsafe.Pointer(oPtr)).FnamespacePtr, ts+25693,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())
	(*Proc)(unsafe.Pointer(procPtr)).FcmdPtr = uintptr(0)
	if !(result != TCL_OK) {
		goto __36
	}
	return result
__36:
	;
__35:
	;
	codeObjPtr = (*Proc)(unsafe.Pointer(procPtr)).FbodyPtr
	goto __3

__9:
	if !(objc != 4) {
		goto __37
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+25712)
	return TCL_ERROR
__37:
	;

	// Look up the body of a class method.

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(oPtr == uintptr(0)) {
		goto __38
	}
	return TCL_ERROR
__38:
	;
	if !((*Object)(unsafe.Pointer(oPtr)).FclassPtr == uintptr(0)) {
		goto __39
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+25445, libc.VaList(bp+320, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+328, ts+3593, ts+7170, ts+25465,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}(), uintptr(0)))
	return TCL_ERROR
__39:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr + 112 /* &.classMethods */)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr+112 /* &.classMethods */, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	goto methodBody
__10:
	if !(objc != 4) {
		goto __40
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+25733)
	return TCL_ERROR
__40:
	;

	// Look up the body of an instance method.

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(oPtr == uintptr(0)) {
		goto __41
	}
	return TCL_ERROR
__41:
	;
	if !((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr == uintptr(0)) {
		goto __42
	}
	goto unknownMethod
__42:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, *(*uintptr)(unsafe.Pointer(objv + 3*8)))

	// Compile (if necessary) and disassemble a method body.

methodBody:
	if !(hPtr == uintptr(0)) {
		goto __43
	}
unknownMethod:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+25755, libc.VaList(bp+368, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+376, ts+3593, ts+7170, ts+25775,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
		}(), uintptr(0)))
	return TCL_ERROR
__43:
	;
	procPtr = XTclOOGetProcFromMethod(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	if !(procPtr == uintptr(0)) {
		goto __44
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+25782, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+416, ts+3593, ts+7420, ts+25503,
		ts+25574, uintptr(0)))
	return TCL_ERROR
__44:
	;
	if !((*Tcl_Obj)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FbodyPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclByteCodeType))) {
		goto __45
	}

	// Yes, this is ugly, but we need to pass the namespace in to the
	// compiler in two places.

	(*Command)(unsafe.Pointer(bp + 848 /* &cmd3 */)).FnsPtr = (*Object)(unsafe.Pointer(oPtr)).FnamespacePtr
	(*Proc)(unsafe.Pointer(procPtr)).FcmdPtr = bp + 848 /* &cmd3 */
	result = XTclProcCompileProc(tls, interp, procPtr, (*Proc)(unsafe.Pointer(procPtr)).FbodyPtr,
		(*Object)(unsafe.Pointer(oPtr)).FnamespacePtr, ts+25825,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
		}())
	(*Proc)(unsafe.Pointer(procPtr)).FcmdPtr = uintptr(0)
	if !(result != TCL_OK) {
		goto __46
	}
	return result
__46:
	;
__45:
	;
	codeObjPtr = (*Proc)(unsafe.Pointer(procPtr)).FbodyPtr
	goto __3
__11:
	;
__3:
	;

	// Do the actual disassembly.

	if !((*ByteCode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(codeObjPtr + 32)))).Fflags&uint32(TCL_BYTECODE_PRECOMPILED) != 0) {
		goto __47
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+25840, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+456, ts+3593, ts+7420, ts+25503,
		ts+25878, uintptr(0)))
	return TCL_ERROR
__47:
	;
	if !(int32(clientData) != 0) {
		goto __48
	}
	XTcl_SetObjResult(tls, interp,
		sDisassembleByteCodeAsDicts(tls, interp, codeObjPtr))
	goto __49
__48:
	XTcl_SetObjResult(tls, interp,
		sDisassembleByteCodeObj(tls, interp, codeObjPtr))
__49:
	;
	return TCL_OK
}

var types1 = [8]uintptr{
	ts + 25887, ts + 25899,
	ts + 25910, ts + 25917, ts + 25924, ts + 5272, ts + 3636, uintptr(0),
} /* tclDisassemble.c:1265:23 */

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// End:

// The following data structure represents an encoding, which describes how to
// convert between various character sets and UTF-8.

type Encoding = struct {
	Fname        uintptr
	FtoUtfProc   uintptr
	FfromUtfProc uintptr
	FfreeProc    uintptr
	FnullSize    int32
	F__ccgo_pad1 [4]byte
	FclientData  ClientData
	FlengthProc  uintptr
	FrefCount    int32
	F__ccgo_pad2 [4]byte
	FhPtr        uintptr
} /* tclEncoding.c:51:3 */

// The following structure is the clientData for a dynamically-loaded,
// table-driven encoding created by LoadTableEncoding(). It maps between
// Unicode and a single-byte, double-byte, or multibyte (1 or 2 bytes only)
// encoding.

type TableEncodingData = struct {
	Ffallback    int32
	FprefixBytes [256]int8
	F__ccgo_pad1 [4]byte
	FtoUnicode   uintptr
	FfromUnicode uintptr
} /* tclEncoding.c:83:3 */

// Each of the following structures is the clientData for a dynamically-loaded
// escape-driven encoding that is itself comprised of other simpler encodings.
// An example is "iso-2022-jp", which uses escape sequences to switch between
// ascii, jis0208, jis0212, gb2312, and ksc5601. Note that "escape-driven"
// does not necessarily mean that the ESCAPE character is the character used
// for switching character sets.

type EscapeSubTable = struct {
	FsequenceLen uint32
	Fsequence    [16]int8
	Fname        [32]int8
	F__ccgo_pad1 [4]byte
	FencodingPtr uintptr
} /* tclEncoding.c:101:3 */

type EscapeEncodingData = struct {
	F__ccgo_pad1  [0]uint64
	Ffallback     int32
	FinitLen      uint32
	Finit         [16]int8
	FfinalLen     uint32
	Ffinal        [16]int8
	FprefixBytes  [256]int8
	FnumSubTables int32
}                                                     /* tclEncoding.c:123:3 */
var encodingSearchPath = ProcessGlobalValue{Fproc: 0} /* tclEncoding.c:141:27 */

// A map from encoding names to the directories in which their data files have
// been seen. The string value of the map is shared by all threads. Access to
// the shared string is governed by a mutex lock.

var encodingFileMap = ProcessGlobalValue{} /* tclEncoding.c:151:27 */

// A list of directories making up the "library path". Historically this
// search path has served many uses, but the only one remaining is a base for
// the encodingSearchPath above. If the application does not explicitly set
// the encodingSearchPath, then it is initialized by appending /encoding
// to each directory in this "libraryPath".

var libraryPath = ProcessGlobalValue{Fproc: 0} /* tclEncoding.c:163:27 */

var encodingsInitialized int32 = 0 /* tclEncoding.c:167:12 */

// Hash table that keeps track of all loaded Encodings. Keys are the string
// names that represent the encoding, values are (Encoding *).

var encodingTable Tcl_HashTable /* tclEncoding.c:174:22: */
var encodingMutex Tcl_Mutex     /* tclEncoding.c:175:1: */

// The following are used to hold the default and current system encodings.
// If NULL is passed to one of the conversion routines, the current setting of
// the system encoding is used to perform the conversion.

var defaultEncoding Tcl_Encoding = uintptr(0)      /* tclEncoding.c:183:21 */
var systemEncoding Tcl_Encoding = uintptr(0)       /* tclEncoding.c:184:21 */
var XtclIdentityEncoding Tcl_Encoding = uintptr(0) /* tclEncoding.c:185:14 */

// The following variable is used in the sparse matrix code for a
// TableEncoding to represent a page in the table that has no entries.

var emptyPage [256]uint16 /* tclEncoding.c:192:23: */

// A Tcl_ObjType for holding a cached Tcl_Encoding in the twoPtrValue.ptr1 field
// of the internalrep. This should help the lifetime of encodings be more useful.
// See concerns raised in [Bug 1077262].

var encodingType = Tcl_ObjType{
	Fname: ts + 11665, FfreeIntRepProc: 0, FdupIntRepProc: 0,
} /* tclEncoding.c:269:26 */

//----------------------------------------------------------------------
//
// Tcl_GetEncodingFromObj --
//
//	Writes to (*encodingPtr) the Tcl_Encoding value of (*objPtr), if
//	possible, and returns TCL_OK. If no such encoding exists, TCL_ERROR is
//	returned, and if interp is non-NULL, an error message is written
//	there.
//
// Results:
//	Standard Tcl return code.
//
// Side effects:
//	Caches the Tcl_Encoding value as the internal rep of (*objPtr).
//
//----------------------------------------------------------------------

func XTcl_GetEncodingFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, encodingPtr uintptr) int32 { /* tclEncoding.c:293:1: */
	var name uintptr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&encodingType)) {
		var encoding Tcl_Encoding = XTcl_GetEncoding(tls, interp, name)

		if encoding == uintptr(0) {
			return TCL_ERROR
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		}

		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = encoding
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&encodingType))
	}
	*(*Tcl_Encoding)(unsafe.Pointer(encodingPtr)) = XTcl_GetEncoding(tls, uintptr(0), name)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// FreeEncodingInternalRep --
//
//	The Tcl_FreeInternalRepProc for the "encoding" Tcl_ObjType.
//
//----------------------------------------------------------------------

func sFreeEncodingInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclEncoding.c:325:1: */
	XTcl_FreeEncoding(tls, *(*uintptr)(unsafe.Pointer(objPtr + 32)))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// DupEncodingInternalRep --
//
//	The Tcl_DupInternalRepProc for the "encoding" Tcl_ObjType.
//
//----------------------------------------------------------------------

func sDupEncodingInternalRep(tls *libc.TLS, srcPtr uintptr, dupPtr uintptr) { /* tclEncoding.c:343:1: */
	*(*uintptr)(unsafe.Pointer(dupPtr + 32)) = XTcl_GetEncoding(tls, uintptr(0), (*Tcl_Obj)(unsafe.Pointer(srcPtr)).Fbytes)
}

//----------------------------------------------------------------------
//
// Tcl_GetEncodingSearchPath --
//
//	Keeps the per-thread copy of the encoding search path current with
//	changes to the global copy.
//
// Results:
//	Returns a "list" (Tcl_Obj *) that contains the encoding search path.
//
//----------------------------------------------------------------------

func XTcl_GetEncodingSearchPath(tls *libc.TLS) uintptr { /* tclEncoding.c:364:9: */
	return XTclGetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&encodingSearchPath)))
}

//----------------------------------------------------------------------
//
// Tcl_SetEncodingSearchPath --
//
//	Keeps the per-thread copy of the encoding search path current with
//	changes to the global copy.
//
//----------------------------------------------------------------------

func XTcl_SetEncodingSearchPath(tls *libc.TLS, searchPath uintptr) int32 { /* tclEncoding.c:382:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var dummy int32 at bp, 4

	if TCL_ERROR == XTcl_ListObjLength(tls, uintptr(0), searchPath, bp) {
		return TCL_ERROR
	}
	XTclSetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&encodingSearchPath)), searchPath, uintptr(0))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclGetLibraryPath --
//
//	Keeps the per-thread copy of the library path current with changes to
//	the global copy.
//
// Results:
//	Returns a "list" (Tcl_Obj *) that contains the library path.
//
//----------------------------------------------------------------------

func XTclGetLibraryPath(tls *libc.TLS) uintptr { /* tclEncoding.c:408:9: */
	return XTclGetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&libraryPath)))
}

//----------------------------------------------------------------------
//
// TclSetLibraryPath --
//
//	Keeps the per-thread copy of the library path current with changes to
//	the global copy.
//
//	Since the result of this routine is void, if searchPath is not a valid
//	list this routine silently does nothing.
//
//----------------------------------------------------------------------

func XTclSetLibraryPath(tls *libc.TLS, path uintptr) { /* tclEncoding.c:429:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var dummy int32 at bp, 4

	if TCL_ERROR == XTcl_ListObjLength(tls, uintptr(0), path, bp) {
		return
	}
	XTclSetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&libraryPath)), path, uintptr(0))
}

//---------------------------------------------------------------------------
//
// FillEncodingFileMap --
//
//	Called to update the encoding file map with the current value
//	of the encoding search path.
//
//	Finds *.end files in the directories on the encoding search path and
//	stores the found pathnames in a map associated with the encoding name.
//
//	If $dir is on the encoding search path and the file $dir/foo.enc is
//	found, stores a "foo" -> $dir entry in the map.  if the "foo" encoding
//	is needed later, the $dir/foo.enc name can be quickly constructed in
//	order to read the encoding data.
//
// Results:
//	None.
//
// Side effects:
//	Entries are added to the encoding file map.
//
//---------------------------------------------------------------------------

func sFillEncodingFileMap(tls *libc.TLS) { /* tclEncoding.c:466:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	var i int32
	*(*int32)(unsafe.Pointer(bp /* numDirs */)) = 0
	var map1 uintptr
	var searchPath uintptr

	searchPath = XTcl_GetEncodingSearchPath(tls)
	(*Tcl_Obj)(unsafe.Pointer(searchPath)).FrefCount++
	XTcl_ListObjLength(tls, uintptr(0), searchPath, bp)
	map1 = XTcl_NewDictObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(map1)).FrefCount++

	for i = *(*int32)(unsafe.Pointer(bp)) - 1; i >= 0; i-- {
		// Iterate backwards through the search path so as we overwrite
		// entries found, we favor files earlier on the search path.

		var j int32
		// var numFiles int32 at bp+40, 4

		// var directory uintptr at bp+8, 8

		var matchFileList uintptr = XTcl_NewObj(tls)
		// var filev uintptr at bp+48, 8

		*(*Tcl_GlobTypeData)(unsafe.Pointer(bp + 16 /* readableFiles */)) = Tcl_GlobTypeData{
			Ftype: int32(1) << 4, Fperm: int32(1) << 2,
		}

		XTcl_ListObjIndex(tls, uintptr(0), searchPath, i, bp+8)
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++
		(*Tcl_Obj)(unsafe.Pointer(matchFileList)).FrefCount++
		XTcl_FSMatchInDirectory(tls, uintptr(0), matchFileList, *(*uintptr)(unsafe.Pointer(bp + 8 /* directory */)), ts+25934,
			bp+16)

		XTcl_ListObjGetElements(tls, uintptr(0), matchFileList, bp+40, bp+48)
		for j = 0; j < *(*int32)(unsafe.Pointer(bp + 40 /* numFiles */)); j++ {
			var encodingName uintptr
			var fileObj uintptr

			fileObj = XTclPathPart(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* filev */)) + uintptr(j)*8)), TCL_PATH_TAIL)
			encodingName = XTclPathPart(tls, uintptr(0), fileObj, TCL_PATH_ROOT)
			XTcl_DictObjPut(tls, uintptr(0), map1, encodingName, *(*uintptr)(unsafe.Pointer(bp + 8 /* directory */)))
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = fileObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr = encodingName
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = matchFileList
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	for ok4 := true; ok4; ok4 = 0 != 0 {
		var _objPtr uintptr = searchPath
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTclSetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&encodingFileMap)), map1, uintptr(0))
	for ok5 := true; ok5; ok5 = 0 != 0 {
		var _objPtr uintptr = map1
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
}

//---------------------------------------------------------------------------
//
// TclInitEncodingSubsystem --
//
//	Initialize all resources used by this subsystem on a per-process
//	basis.
//
// Results:
//	None.
//
// Side effects:
//	Depends on the memory, object, and IO subsystems.
//
//---------------------------------------------------------------------------

func XTclInitEncodingSubsystem(tls *libc.TLS) { /* tclEncoding.c:532:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	// var type1 Tcl_EncodingType at bp+8, 48

	var dataPtr uintptr
	var size uint32
	var i uint16
	// var isLe struct {F__ccgo_pad1 [0]uint16;Fc int8;F__ccgo_pad2 [1]byte;} at bp, 2

	if encodingsInitialized != 0 {
		return
	}

	*(*int16)(unsafe.Pointer(bp)) = int16(1)
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
	XTcl_InitHashTable(tls, uintptr(unsafe.Pointer(&encodingTable)), 0)
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&encodingMutex)))

	// Create a few initial encodings.  UTF-8 to UTF-8 translation is not a
	// no-op because it turns a stream of improperly formed UTF-8 into a
	// properly formed stream.

	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FencodingName = ts + 25940 /* "identity" */
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FtoUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sBinaryProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FfromUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sBinaryProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FfreeProc = uintptr(0)
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FnullSize = 1
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FclientData = uintptr(0)
	XtclIdentityEncoding = XTcl_CreateEncoding(tls, bp+8)

	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FencodingName = ts + 25949 /* "utf-8" */
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FtoUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sUtfExtToUtfIntProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FfromUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sUtfIntToUtfExtProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FfreeProc = uintptr(0)
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FnullSize = 1
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FclientData = uintptr(0)
	XTcl_CreateEncoding(tls, bp+8)

	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FencodingName = ts + 25955 /* "unicode" */
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FtoUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sUnicodeToUtfProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FfromUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sUtfToUnicodeProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FfreeProc = uintptr(0)
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FnullSize = 2
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FclientData = uintptr(Intptr_t(*(*int8)(unsafe.Pointer(bp))))
	XTcl_CreateEncoding(tls, bp+8)

	// Need the iso8859-1 encoding in order to process binary data, so force
	// it to always be embedded. Note that this encoding *must* be a proper
	// table encoding or some of the escape encodings crash! Hence the ugly
	// code to duplicate the structure of a table encoding here.

	dataPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TableEncodingData{})))
	libc.Xmemset(tls, dataPtr, 0, uint64(unsafe.Sizeof(TableEncodingData{})))
	(*TableEncodingData)(unsafe.Pointer(dataPtr)).Ffallback = '?'

	size = uint32(uint64(256) * (uint64(unsafe.Sizeof(uintptr(0))) + uint64(unsafe.Sizeof(uint16(0)))))
	(*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode = XTcl_Alloc(tls, size)
	libc.Xmemset(tls, (*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode, 0, uint64(size))
	(*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode = XTcl_Alloc(tls, size)
	libc.Xmemset(tls, (*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode, 0, uint64(size))

	*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode)) = (*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(256)*8
	*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode)) = (*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + uintptr(256)*8
	for i = uint16(1); int32(i) < 256; i++ {
		*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(i)*8)) = uintptr(unsafe.Pointer(&emptyPage))
		*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + uintptr(i)*8)) = uintptr(unsafe.Pointer(&emptyPage))
	}

	for i = uint16(0); int32(i) < 256; i++ {
		*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode)) + uintptr(i)*2)) = i
		*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode)) + uintptr(i)*2)) = i
	}

	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FencodingName = ts + 25963 /* "iso8859-1" */
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FtoUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sIso88591ToUtfProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FfromUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sIso88591FromUtfProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FfreeProc = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sTableFreeProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FnullSize = 1
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 8 /* &type1 */)).FclientData = dataPtr
	defaultEncoding = XTcl_CreateEncoding(tls, bp+8)
	systemEncoding = XTcl_GetEncoding(tls, uintptr(0), (*Tcl_EncodingType)(unsafe.Pointer(bp+8 /* &type1 */)).FencodingName)

	encodingsInitialized = 1
}

//----------------------------------------------------------------------
//
// TclFinalizeEncodingSubsystem --
//
//	Release the state associated with the encoding subsystem.
//
// Results:
//	None.
//
// Side effects:
//	Frees all of the encodings.
//
//----------------------------------------------------------------------

func XTclFinalizeEncodingSubsystem(tls *libc.TLS) { /* tclEncoding.c:640:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var search Tcl_HashSearch at bp, 24

	var hPtr uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
	encodingsInitialized = 0
	sFreeEncoding(tls, systemEncoding)
	systemEncoding = uintptr(0)
	defaultEncoding = uintptr(0)
	sFreeEncoding(tls, XtclIdentityEncoding)
	XtclIdentityEncoding = uintptr(0)

	hPtr = XTcl_FirstHashEntry(tls, uintptr(unsafe.Pointer(&encodingTable)), bp)
	for hPtr != uintptr(0) {
		// Call FreeEncoding instead of doing it directly to handle refcounts
		// like escape encodings use. [Bug 524674] Make sure to call
		// Tcl_FirstHashEntry repeatedly so that all encodings are eventually
		// cleaned up.

		sFreeEncoding(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
		hPtr = XTcl_FirstHashEntry(tls, uintptr(unsafe.Pointer(&encodingTable)), bp)
	}

	XTcl_DeleteHashTable(tls, uintptr(unsafe.Pointer(&encodingTable)))
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
}

//-------------------------------------------------------------------------
//
// Tcl_GetDefaultEncodingDir --
//
//	Legacy public interface to retrieve first directory in the encoding
//	searchPath.
//
// Results:
//	The directory pathname, as a string, or NULL for an empty encoding
//	search path.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func XTcl_GetDefaultEncodingDir(tls *libc.TLS) uintptr { /* tclEncoding.c:688:12: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var numDirs int32 at bp, 4

	// var first uintptr at bp+8, 8

	var searchPath uintptr = XTcl_GetEncodingSearchPath(tls)

	XTcl_ListObjLength(tls, uintptr(0), searchPath, bp)
	if *(*int32)(unsafe.Pointer(bp)) == 0 {
		return uintptr(0)
	}
	XTcl_ListObjIndex(tls, uintptr(0), searchPath, 0, bp+8)

	return func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
	}()
}

//-------------------------------------------------------------------------
//
// Tcl_SetDefaultEncodingDir --
//
//	Legacy public interface to set the first directory in the encoding
//	search path.
//
// Results:
//	None.
//
// Side effects:
//	Modifies the encoding search path.
//
//-------------------------------------------------------------------------

func XTcl_SetDefaultEncodingDir(tls *libc.TLS, path uintptr) { /* tclEncoding.c:721:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var searchPath uintptr = XTcl_GetEncodingSearchPath(tls)
	*(*uintptr)(unsafe.Pointer(bp /* directory */)) = XTcl_NewStringObj(tls, path, -1)

	searchPath = XTcl_DuplicateObj(tls, searchPath)
	XTcl_ListObjReplace(tls, uintptr(0), searchPath, 0, 0, 1, bp)
	XTcl_SetEncodingSearchPath(tls, searchPath)
}

//-------------------------------------------------------------------------
//
// Tcl_GetEncoding --
//
//	Given the name of a encoding, find the corresponding Tcl_Encoding
//	token. If the encoding did not already exist, Tcl attempts to
//	dynamically load an encoding by that name.
//
// Results:
//	Returns a token that represents the encoding. If the name didn't refer
//	to any known or loadable encoding, NULL is returned. If NULL was
//	returned, an error message is left in interp's result object, unless
//	interp was NULL.
//
// Side effects:
//	LoadEncodingFile is called if necessary.
//
//-------------------------------------------------------------------------

func XTcl_GetEncoding(tls *libc.TLS, interp uintptr, name uintptr) Tcl_Encoding { /* tclEncoding.c:754:1: */
	var hPtr uintptr
	var encodingPtr uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
	if name == uintptr(0) {
		encodingPtr = systemEncoding
		(*Encoding)(unsafe.Pointer(encodingPtr)).FrefCount++
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
		return systemEncoding
	}

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingTable)))).FfindProc})).f(tls, uintptr(unsafe.Pointer(&encodingTable)), name)
	if hPtr != uintptr(0) {
		encodingPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		(*Encoding)(unsafe.Pointer(encodingPtr)).FrefCount++
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
		return encodingPtr
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&encodingMutex)))

	return sLoadEncodingFile(tls, interp, name)
}

//---------------------------------------------------------------------------
//
// Tcl_FreeEncoding --
//
//	Releases an encoding allocated by Tcl_CreateEncoding() or
//	Tcl_GetEncoding().
//
// Results:
//	None.
//
// Side effects:
//	The reference count associated with the encoding is decremented and
//	the encoding is deleted if nothing is using it anymore.
//
//---------------------------------------------------------------------------

func XTcl_FreeEncoding(tls *libc.TLS, encoding Tcl_Encoding) { /* tclEncoding.c:800:1: */
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
	sFreeEncoding(tls, encoding)
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
}

//----------------------------------------------------------------------
//
// FreeEncoding --
//
//	Decrements the reference count of an encoding.  The caller must hold
//	encodingMutes.
//
// Results:
//	None.
//
// Side effects:
//	Releases the resource for an encoding if it is now unused.
//	The reference count associated with the encoding is decremented and
//	the encoding may be deleted if nothing is using it anymore.
//
//----------------------------------------------------------------------

func sFreeEncoding(tls *libc.TLS, encoding Tcl_Encoding) { /* tclEncoding.c:828:1: */
	var encodingPtr uintptr = encoding

	if encodingPtr == uintptr(0) {
		return
	}
	if (*Encoding)(unsafe.Pointer(encodingPtr)).FrefCount <= 0 {
		XTcl_Panic(tls, ts+25973, 0)
	}
	if libc.PostDecInt32(&(*Encoding)(unsafe.Pointer(encodingPtr)).FrefCount, 1) <= 1 {
		if (*Encoding)(unsafe.Pointer(encodingPtr)).FfreeProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Encoding)(unsafe.Pointer(encodingPtr)).FfreeProc})).f(tls, (*Encoding)(unsafe.Pointer(encodingPtr)).FclientData)
		}
		if (*Encoding)(unsafe.Pointer(encodingPtr)).FhPtr != uintptr(0) {
			XTcl_DeleteHashEntry(tls, (*Encoding)(unsafe.Pointer(encodingPtr)).FhPtr)
		}
		if (*Encoding)(unsafe.Pointer(encodingPtr)).Fname != 0 {
			XTclpFree(tls, (*Encoding)(unsafe.Pointer(encodingPtr)).Fname)
		}
		XTclpFree(tls, encodingPtr)
	}
}

//-------------------------------------------------------------------------
//
// Tcl_GetEncodingName --
//
//	Given an encoding, return the name that was used to constuct the
//	encoding.
//
// Results:
//	The name of the encoding.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_GetEncodingName(tls *libc.TLS, encoding Tcl_Encoding) uintptr { /* tclEncoding.c:870:12: */
	if encoding == uintptr(0) {
		encoding = systemEncoding
	}

	return (*Encoding)(unsafe.Pointer(encoding)).Fname
}

//-------------------------------------------------------------------------
//
// Tcl_GetEncodingNames --
//
//	Get the list of all known encodings, including the ones stored as
//	files on disk in the encoding path.
//
// Results:
//	Modifies interp's result object to hold a list of all the available
//	encodings.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func XTcl_GetEncodingNames(tls *libc.TLS, interp uintptr) { /* tclEncoding.c:900:1: */
	bp := tls.Alloc(156)
	defer tls.Free(156)

	// var table Tcl_HashTable at bp, 88

	// var search Tcl_HashSearch at bp+88, 24

	var hPtr uintptr
	var map1 uintptr
	// var name uintptr at bp+144, 8

	var result uintptr = XTcl_NewObj(tls)
	// var mapSearch Tcl_DictSearch at bp+120, 24

	// var dummy int32 at bp+112, 4

	*(*int32)(unsafe.Pointer(bp + 152 /* done */)) = 0

	XTcl_InitObjHashTable(tls, bp)

	// Copy encoding names from loaded encoding table to table.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
	for hPtr = XTcl_FirstHashEntry(tls, uintptr(unsafe.Pointer(&encodingTable)), bp+88); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp+88) {
		var encodingPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		(*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &table */)).FcreateProc})).f(tls, bp /* &table */, XTcl_NewStringObj(tls, (*Encoding)(unsafe.Pointer(encodingPtr)).Fname, -1), bp+112 /* &dummy */)
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&encodingMutex)))

	sFillEncodingFileMap(tls)
	map1 = XTclGetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&encodingFileMap)))

	// Copy encoding names from encoding file map to table.

	XTcl_DictObjFirst(tls, uintptr(0), map1, bp+120, bp+144, uintptr(0), bp+152)
	for ; !(*(*int32)(unsafe.Pointer(bp + 152)) != 0); XTcl_DictObjNext(tls, bp+120, bp+144, uintptr(0), bp+152) {
		(*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &table */)).FcreateProc})).f(tls, bp /* &table */, *(*uintptr)(unsafe.Pointer(bp + 144 /* name */)), bp+112 /* &dummy */)
	}

	// Pull all encoding names from table into the result list.

	for hPtr = XTcl_FirstHashEntry(tls, bp, bp+88); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp+88) {
		XTcl_ListObjAppendElement(tls, uintptr(0), result,
			func() uintptr {
				if (*Tcl_HashTable)(unsafe.Pointer(bp)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(bp)).FkeyType == -1 {
					return *(*uintptr)(unsafe.Pointer(hPtr + 32))
				}
				return hPtr + 32
			}())
	}
	XTcl_SetObjResult(tls, interp, result)
	XTcl_DeleteHashTable(tls, bp)
}

//------------------------------------------------------------------------
//
// Tcl_SetSystemEncoding --
//
//	Sets the default encoding that should be used whenever the user passes
//	a NULL value in to one of the conversion routines. If the supplied
//	name is NULL, the system encoding is reset to the default system
//	encoding.
//
// Results:
//	The return value is TCL_OK if the system encoding was successfully set
//	to the encoding specified by name, TCL_ERROR otherwise. If TCL_ERROR
//	is returned, an error message is left in interp's result object,
//	unless interp was NULL.
//
// Side effects:
//	The reference count of the new system encoding is incremented. The
//	reference count of the old system encoding is decremented and it may
//	be freed. All VFS cached information is invalidated.
//
//------------------------------------------------------------------------

func XTcl_SetSystemEncoding(tls *libc.TLS, interp uintptr, name uintptr) int32 { /* tclEncoding.c:976:1: */
	var encoding Tcl_Encoding
	var encodingPtr uintptr

	if !(name != 0) || !(int32(*(*int8)(unsafe.Pointer(name))) != 0) {
		XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
		encoding = defaultEncoding
		encodingPtr = encoding
		(*Encoding)(unsafe.Pointer(encodingPtr)).FrefCount++
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
	} else {
		encoding = XTcl_GetEncoding(tls, interp, name)
		if encoding == uintptr(0) {
			return TCL_ERROR
		}
	}

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
	sFreeEncoding(tls, systemEncoding)
	systemEncoding = encoding
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
	XTcl_FSMountsChanged(tls, uintptr(0))

	return TCL_OK
}

//---------------------------------------------------------------------------
//
// Tcl_CreateEncoding --
//
//	Defines a new encoding, along with the functions that are used to
//	convert to and from Unicode.
//
// Results:
//	Returns a token that represents the encoding. If an encoding with the
//	same name already existed, the old encoding token remains valid and
//	continues to behave as it used to, and is eventually garbage collected
//	when the last reference to it goes away. Any subsequent calls to
//	Tcl_GetEncoding with the specified name retrieve the most recent
//	encoding token.
//
// Side effects:
//	A new record having the name of the encoding is entered into a table of
//	encodings visible to all interpreters.  For each call to this function,
//	there should eventually be a call to Tcl_FreeEncoding, which cleans
//	deletes the record in the table when an encoding is no longer needed.
//
//---------------------------------------------------------------------------

func XTcl_CreateEncoding(tls *libc.TLS, typePtr uintptr) Tcl_Encoding { /* tclEncoding.c:1032:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var hPtr uintptr
	// var isNew int32 at bp, 4

	var encodingPtr uintptr
	var name uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&encodingMutex)))
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingTable)))).FcreateProc})).f(tls, uintptr(unsafe.Pointer(&encodingTable)), (*Tcl_EncodingType)(unsafe.Pointer(typePtr)).FencodingName, bp /* &isNew */)
	if *(*int32)(unsafe.Pointer(bp)) == 0 {
		// Remove old encoding from hash table, but don't delete it until last
		// reference goes away.

		encodingPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		(*Encoding)(unsafe.Pointer(encodingPtr)).FhPtr = uintptr(0)
	}

	name = XTcl_Alloc(tls, uint32(libc.Xstrlen(tls, (*Tcl_EncodingType)(unsafe.Pointer(typePtr)).FencodingName)+uint64(1)))

	encodingPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Encoding{})))
	(*Encoding)(unsafe.Pointer(encodingPtr)).Fname = libc.Xstrcpy(tls, name, (*Tcl_EncodingType)(unsafe.Pointer(typePtr)).FencodingName)
	(*Encoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc = (*Tcl_EncodingType)(unsafe.Pointer(typePtr)).FtoUtfProc
	(*Encoding)(unsafe.Pointer(encodingPtr)).FfromUtfProc = (*Tcl_EncodingType)(unsafe.Pointer(typePtr)).FfromUtfProc
	(*Encoding)(unsafe.Pointer(encodingPtr)).FfreeProc = (*Tcl_EncodingType)(unsafe.Pointer(typePtr)).FfreeProc
	(*Encoding)(unsafe.Pointer(encodingPtr)).FnullSize = (*Tcl_EncodingType)(unsafe.Pointer(typePtr)).FnullSize
	(*Encoding)(unsafe.Pointer(encodingPtr)).FclientData = (*Tcl_EncodingType)(unsafe.Pointer(typePtr)).FclientData
	if (*Tcl_EncodingType)(unsafe.Pointer(typePtr)).FnullSize == 1 {
		(*Encoding)(unsafe.Pointer(encodingPtr)).FlengthProc = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr) Size_t
		}{libc.Xstrlen}))
	} else {
		(*Encoding)(unsafe.Pointer(encodingPtr)).FlengthProc = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr) Size_t
		}{unilen}))
	}
	(*Encoding)(unsafe.Pointer(encodingPtr)).FrefCount = 1
	(*Encoding)(unsafe.Pointer(encodingPtr)).FhPtr = hPtr
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = encodingPtr

	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&encodingMutex)))

	return encodingPtr
}

//-------------------------------------------------------------------------
//
// Tcl_ExternalToUtfDString --
//
//	Convert a source buffer from the specified encoding into UTF-8. If any
//	of the bytes in the source buffer are invalid or cannot be represented
//	in the target encoding, a default fallback character will be
//	substituted.
//
// Results:
//	The converted bytes are stored in the DString, which is then NULL
//	terminated. The return value is a pointer to the value stored in the
//	DString.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func XTcl_ExternalToUtfDString(tls *libc.TLS, encoding Tcl_Encoding, src uintptr, srcLen int32, dstPtr uintptr) uintptr { /* tclEncoding.c:1097:6: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var dst uintptr
	// var state Tcl_EncodingState at bp, 8

	var encodingPtr uintptr
	var flags int32
	var dstLen int32
	var result int32
	var soFar int32
	// var srcRead int32 at bp+8, 4

	// var dstWrote int32 at bp+12, 4

	// var dstChars int32 at bp+16, 4

	XTcl_DStringInit(tls, dstPtr)
	dst = (*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring
	dstLen = (*Tcl_DString)(unsafe.Pointer(dstPtr)).FspaceAvl - 1

	if encoding == uintptr(0) {
		encoding = systemEncoding
	}
	encodingPtr = encoding

	if src == uintptr(0) {
		srcLen = 0
	} else if srcLen < 0 {
		srcLen = int32((*struct {
			f func(*libc.TLS, uintptr) Size_t
		})(unsafe.Pointer(&struct{ uintptr }{(*Encoding)(unsafe.Pointer(encodingPtr)).FlengthProc})).f(tls, src))
	}

	flags = TCL_ENCODING_START | TCL_ENCODING_END

	for 1 != 0 {
		result = (*struct {
			f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Encoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc})).f(tls, (*Encoding)(unsafe.Pointer(encodingPtr)).FclientData, src, srcLen,
			flags, bp, dst, dstLen, bp+8, bp+12, bp+16)
		soFar = int32((int64(dst+uintptr(*(*int32)(unsafe.Pointer(bp + 12)))) - int64((*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring)) / 1)

		if result != -4 {
			XTcl_DStringSetLength(tls, dstPtr, soFar)
			return (*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring
		}

		flags = flags & libc.CplInt32(TCL_ENCODING_START)
		src += uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* srcRead */)))
		srcLen = srcLen - *(*int32)(unsafe.Pointer(bp + 8))
		if (*Tcl_DString)(unsafe.Pointer(dstPtr)).Flength == 0 {
			XTcl_DStringSetLength(tls, dstPtr, dstLen)
		}
		XTcl_DStringSetLength(tls, dstPtr, 2*(*Tcl_DString)(unsafe.Pointer(dstPtr)).Flength+1)
		dst = (*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring + uintptr(soFar)
		dstLen = (*Tcl_DString)(unsafe.Pointer(dstPtr)).Flength - soFar - 1
	}
	return uintptr(0)
}

//-------------------------------------------------------------------------
//
// Tcl_ExternalToUtf --
//
//	Convert a source buffer from the specified encoding into UTF-8.
//
// Results:
//	The return value is one of TCL_OK, TCL_CONVERT_MULTIBYTE,
//	TCL_CONVERT_SYNTAX, TCL_CONVERT_UNKNOWN, or TCL_CONVERT_NOSPACE, as
//	documented in tcl.h.
//
// Side effects:
//	The converted bytes are stored in the output buffer.
//
//-------------------------------------------------------------------------

func XTcl_ExternalToUtf(tls *libc.TLS, interp uintptr, encoding Tcl_Encoding, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:1170:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var encodingPtr uintptr
	var result int32
	// var srcRead int32 at bp+8, 4

	// var dstWrote int32 at bp+12, 4

	*(*int32)(unsafe.Pointer(bp + 16 /* dstChars */)) = 0
	var noTerminate int32 = flags & TCL_ENCODING_NO_TERMINATE
	var charLimited int32 = libc.Bool32(flags&TCL_ENCODING_CHAR_LIMIT != 0 && dstCharsPtr != 0)
	var maxChars int32 = 0x7fffffff
	// var state Tcl_EncodingState at bp, 8

	if encoding == uintptr(0) {
		encoding = systemEncoding
	}
	encodingPtr = encoding

	if src == uintptr(0) {
		srcLen = 0
	} else if srcLen < 0 {
		srcLen = int32((*struct {
			f func(*libc.TLS, uintptr) Size_t
		})(unsafe.Pointer(&struct{ uintptr }{(*Encoding)(unsafe.Pointer(encodingPtr)).FlengthProc})).f(tls, src))
	}
	if statePtr == uintptr(0) {
		flags = flags | (TCL_ENCODING_START | TCL_ENCODING_END)
		statePtr = bp /* &state */
	}
	if srcReadPtr == uintptr(0) {
		srcReadPtr = bp + 8 /* &srcRead */
	}
	if dstWrotePtr == uintptr(0) {
		dstWrotePtr = bp + 12 /* &dstWrote */
	}
	if dstCharsPtr == uintptr(0) {
		dstCharsPtr = bp + 16 /* &dstChars */
		flags = flags & libc.CplInt32(TCL_ENCODING_CHAR_LIMIT)
	} else if charLimited != 0 {
		maxChars = *(*int32)(unsafe.Pointer(dstCharsPtr))
	}

	if !(noTerminate != 0) {
		// If there are any null characters in the middle of the buffer,
		// they will converted to the UTF-8 null character (\xC080). To get
		// the actual \0 at the end of the destination buffer, we need to
		// append it manually.  First make room for it...

		dstLen--
	}
	for ok := true; ok; ok = 1 != 0 {
		var savedState Tcl_EncodingState = *(*Tcl_EncodingState)(unsafe.Pointer(statePtr))

		result = (*struct {
			f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Encoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc})).f(tls, (*Encoding)(unsafe.Pointer(encodingPtr)).FclientData, src, srcLen,
			flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr,
			dstCharsPtr)
		if *(*int32)(unsafe.Pointer(dstCharsPtr)) <= maxChars {
			break
		}
		dstLen = int32((int64(XTcl_UtfAtIndex(tls, dst, maxChars))-int64(dst))/1 + int64(TCL_UTF_MAX-1))
		*(*Tcl_EncodingState)(unsafe.Pointer(statePtr)) = savedState
	}
	if !(noTerminate != 0) {
		// ...and then append it

		*(*int8)(unsafe.Pointer(dst + uintptr(*(*int32)(unsafe.Pointer(dstWrotePtr))))) = int8(0)
	}

	return result
}

//-------------------------------------------------------------------------
//
// Tcl_UtfToExternalDString --
//
//	Convert a source buffer from UTF-8 to the specified encoding. If any
//	of the bytes in the source buffer are invalid or cannot be represented
//	in the target encoding, a default fallback character is substituted.
//
// Results:
//	The converted bytes are stored in the DString, which is then NULL
//	terminated in an encoding-specific manner. The return value is a
//	pointer to the value stored in the DString.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func XTcl_UtfToExternalDString(tls *libc.TLS, encoding Tcl_Encoding, src uintptr, srcLen int32, dstPtr uintptr) uintptr { /* tclEncoding.c:1284:6: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var dst uintptr
	// var state Tcl_EncodingState at bp, 8

	var encodingPtr uintptr
	var flags int32
	var dstLen int32
	var result int32
	var soFar int32
	// var srcRead int32 at bp+8, 4

	// var dstWrote int32 at bp+12, 4

	// var dstChars int32 at bp+16, 4

	XTcl_DStringInit(tls, dstPtr)
	dst = (*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring
	dstLen = (*Tcl_DString)(unsafe.Pointer(dstPtr)).FspaceAvl - 1

	if encoding == uintptr(0) {
		encoding = systemEncoding
	}
	encodingPtr = encoding

	if src == uintptr(0) {
		srcLen = 0
	} else if srcLen < 0 {
		srcLen = int32(libc.Xstrlen(tls, src))
	}
	flags = TCL_ENCODING_START | TCL_ENCODING_END
	for 1 != 0 {
		result = (*struct {
			f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Encoding)(unsafe.Pointer(encodingPtr)).FfromUtfProc})).f(tls, (*Encoding)(unsafe.Pointer(encodingPtr)).FclientData, src,
			srcLen, flags, bp, dst, dstLen, bp+8, bp+12,
			bp+16)
		soFar = int32((int64(dst+uintptr(*(*int32)(unsafe.Pointer(bp + 12)))) - int64((*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring)) / 1)

		if result != -4 {
			if (*Encoding)(unsafe.Pointer(encodingPtr)).FnullSize == 2 {
				XTcl_DStringSetLength(tls, dstPtr, soFar+1)
			}
			XTcl_DStringSetLength(tls, dstPtr, soFar)
			return (*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring
		}

		flags = flags & libc.CplInt32(TCL_ENCODING_START)
		src += uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* srcRead */)))
		srcLen = srcLen - *(*int32)(unsafe.Pointer(bp + 8))
		if (*Tcl_DString)(unsafe.Pointer(dstPtr)).Flength == 0 {
			XTcl_DStringSetLength(tls, dstPtr, dstLen)
		}
		XTcl_DStringSetLength(tls, dstPtr, 2*(*Tcl_DString)(unsafe.Pointer(dstPtr)).Flength+1)
		dst = (*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring + uintptr(soFar)
		dstLen = (*Tcl_DString)(unsafe.Pointer(dstPtr)).Flength - soFar - 1
	}
	return uintptr(0)
}

//-------------------------------------------------------------------------
//
// Tcl_UtfToExternal --
//
//	Convert a buffer from UTF-8 into the specified encoding.
//
// Results:
//	The return value is one of TCL_OK, TCL_CONVERT_MULTIBYTE,
//	TCL_CONVERT_SYNTAX, TCL_CONVERT_UNKNOWN, or TCL_CONVERT_NOSPACE, as
//	documented in tcl.h.
//
// Side effects:
//	The converted bytes are stored in the output buffer.
//
//-------------------------------------------------------------------------

func XTcl_UtfToExternal(tls *libc.TLS, interp uintptr, encoding Tcl_Encoding, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:1359:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var encodingPtr uintptr
	var result int32
	// var srcRead int32 at bp+8, 4

	// var dstWrote int32 at bp+12, 4

	// var dstChars int32 at bp+16, 4

	// var state Tcl_EncodingState at bp, 8

	if encoding == uintptr(0) {
		encoding = systemEncoding
	}
	encodingPtr = encoding

	if src == uintptr(0) {
		srcLen = 0
	} else if srcLen < 0 {
		srcLen = int32(libc.Xstrlen(tls, src))
	}
	if statePtr == uintptr(0) {
		flags = flags | (TCL_ENCODING_START | TCL_ENCODING_END)
		statePtr = bp /* &state */
	}
	if srcReadPtr == uintptr(0) {
		srcReadPtr = bp + 8 /* &srcRead */
	}
	if dstWrotePtr == uintptr(0) {
		dstWrotePtr = bp + 12 /* &dstWrote */
	}
	if dstCharsPtr == uintptr(0) {
		dstCharsPtr = bp + 16 /* &dstChars */
	}

	dstLen = dstLen - (*Encoding)(unsafe.Pointer(encodingPtr)).FnullSize
	result = (*struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Encoding)(unsafe.Pointer(encodingPtr)).FfromUtfProc})).f(tls, (*Encoding)(unsafe.Pointer(encodingPtr)).FclientData, src, srcLen,
		flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr,
		dstCharsPtr)
	if (*Encoding)(unsafe.Pointer(encodingPtr)).FnullSize == 2 {
		*(*int8)(unsafe.Pointer(dst + uintptr(*(*int32)(unsafe.Pointer(dstWrotePtr))+1))) = int8(0)
	}
	*(*int8)(unsafe.Pointer(dst + uintptr(*(*int32)(unsafe.Pointer(dstWrotePtr))))) = int8(0)

	return result
}

//---------------------------------------------------------------------------
//
// Tcl_FindExecutable --
//
//	This function computes the absolute path name of the current
//	application, given its argv[0] value.
//
// Results:
//	None.
//
// Side effects:
//	The absolute pathname for the application is computed and stored to be
//	returned later by [info nameofexecutable].
//
//---------------------------------------------------------------------------
func XTcl_FindExecutable(tls *libc.TLS, argv0 uintptr) { /* tclEncoding.c:1447:1: */
	XTclInitSubsystems(tls)
	XTclpSetInitialEncodings(tls)
	XTclpFindExecutable(tls, argv0)
}

//---------------------------------------------------------------------------
//
// OpenEncodingFileChannel --
//
//	Open the file believed to hold data for the encoding, "name".
//
// Results:
//	Returns the readable Tcl_Channel from opening the file, or NULL if the
//	file could not be successfully opened. If NULL was returned, an error
//	message is left in interp's result object, unless interp was NULL.
//
// Side effects:
//	Channel may be opened. Information about the filesystem may be cached
//	to speed later calls.
//
//---------------------------------------------------------------------------

func sOpenEncodingFileChannel(tls *libc.TLS, interp uintptr, name uintptr) Tcl_Channel { /* tclEncoding.c:1476:1: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	var nameObj uintptr = XTcl_NewStringObj(tls, name, -1)
	*(*uintptr)(unsafe.Pointer(bp + 72 /* fileNameObj */)) = XTcl_DuplicateObj(tls, nameObj)
	var searchPath uintptr = XTcl_DuplicateObj(tls, XTcl_GetEncodingSearchPath(tls))
	var map1 uintptr = XTclGetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&encodingFileMap)))
	// var dir uintptr at bp+56, 8

	var path uintptr
	*(*uintptr)(unsafe.Pointer(bp + 64 /* directory */)) = uintptr(0)
	var chan1 Tcl_Channel = uintptr(0)
	var i int32
	// var numDirs int32 at bp+48, 4

	XTcl_ListObjGetElements(tls, uintptr(0), searchPath, bp+48, bp+56)
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).FrefCount++
	XTcl_AppendToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* fileNameObj */)), ts+26008, -1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FrefCount++
	XTcl_DictObjGet(tls, uintptr(0), map1, nameObj, bp+64)

	// Check that any cached directory is still on the encoding search path.

	if uintptr(0) != *(*uintptr)(unsafe.Pointer(bp + 64)) {
		var verified int32 = 0

		for i = 0; i < *(*int32)(unsafe.Pointer(bp + 48 /* numDirs */)) && !(verified != 0); i++ {
			if *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56)) + uintptr(i)*8)) == *(*uintptr)(unsafe.Pointer(bp + 64)) {
				verified = 1
			}
		}
		if !(verified != 0) {
			var dirString uintptr = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
			}()

			for i = 0; i < *(*int32)(unsafe.Pointer(bp + 48 /* numDirs */)) && !(verified != 0); i++ {
				if libc.Xstrcmp(tls, dirString, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56)) + uintptr(i)*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56)) + uintptr(i)*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56)) + uintptr(i)*8)))
				}()) == 0 {
					verified = 1
				}
			}
		}
		if !(verified != 0) {
			// Directory no longer on the search path. Remove from cache.

			map1 = XTcl_DuplicateObj(tls, map1)
			XTcl_DictObjRemove(tls, uintptr(0), map1, nameObj)
			XTclSetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&encodingFileMap)), map1, uintptr(0))
			*(*uintptr)(unsafe.Pointer(bp + 64 /* directory */)) = uintptr(0)
		}
	}

	if uintptr(0) != *(*uintptr)(unsafe.Pointer(bp + 64)) {
		// Got a directory from the cache. Try to use it first.

		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FrefCount++
		path = XTcl_FSJoinToPath(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* directory */)), 1, bp+72)
		(*Tcl_Obj)(unsafe.Pointer(path)).FrefCount++
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 64))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		chan1 = XTcl_FSOpenFileChannel(tls, uintptr(0), path, ts+22782, 0)
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = path
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	// Scan the search path until we find it.

	for i = 0; i < *(*int32)(unsafe.Pointer(bp + 48 /* numDirs */)) && chan1 == uintptr(0); i++ {
		path = XTcl_FSJoinToPath(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* dir */)) + uintptr(i)*8)), 1, bp+72)
		(*Tcl_Obj)(unsafe.Pointer(path)).FrefCount++
		chan1 = XTcl_FSOpenFileChannel(tls, uintptr(0), path, ts+22782, 0)
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = path
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		if chan1 != uintptr(0) {
			// Save directory in the cache.

			map1 = XTcl_DuplicateObj(tls, XTclGetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&encodingFileMap))))
			XTcl_DictObjPut(tls, uintptr(0), map1, nameObj, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* dir */)) + uintptr(i)*8)))
			XTclSetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&encodingFileMap)), map1, uintptr(0))
		}
	}

	if uintptr(0) == chan1 && interp != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+26013, libc.VaList(bp, name)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+11953, name, uintptr(0)))
	}
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 72))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok4 := true; ok4; ok4 = 0 != 0 {
		var _objPtr uintptr = nameObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok5 := true; ok5; ok5 = 0 != 0 {
		var _objPtr uintptr = searchPath
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	return chan1
}

//---------------------------------------------------------------------------
//
// LoadEncodingFile --
//
//	Read a file that describes an encoding and create a new Encoding from
//	the data.
//
// Results:
//	The return value is the newly loaded Tcl_Encoding or NULL if the file
//	didn't exist or could not be processed. If NULL is returned and interp
//	is not NULL, an error message is left in interp's result object.
//
// Side effects:
//	A corresponding encoding file might be read from persistent storage, in
//	which case LoadTableEncoding is called.
//
//---------------------------------------------------------------------------

func sLoadEncodingFile(tls *libc.TLS, interp uintptr, name uintptr) Tcl_Encoding { /* tclEncoding.c:1594:1: */
	bp := tls.Alloc(264)
	defer tls.Free(264)

	var chan1 Tcl_Channel = uintptr(0)
	var encoding Tcl_Encoding = uintptr(0)
	var ch int32

	chan1 = sOpenEncodingFileChannel(tls, interp, name)
	if chan1 == uintptr(0) {
		return uintptr(0)
	}

	XTcl_SetChannelOption(tls, uintptr(0), chan1, ts+15934, ts+25949)

	for 1 != 0 {
		// var ds Tcl_DString at bp+48, 216

		XTcl_DStringInit(tls, bp+48)
		XTcl_Gets(tls, chan1, bp+48)
		ch = int32(*(*int8)(unsafe.Pointer((*Tcl_DString)(unsafe.Pointer(bp + 48)).Fstring)))
		XTcl_DStringFree(tls, bp+48)
		if ch != '#' {
			break
		}
	}

	switch ch {
	case 'S':
		encoding = sLoadTableEncoding(tls, name, ENCODING_SINGLEBYTE, chan1)
		break
	case 'D':
		encoding = sLoadTableEncoding(tls, name, ENCODING_DOUBLEBYTE, chan1)
		break
	case 'M':
		encoding = sLoadTableEncoding(tls, name, ENCODING_MULTIBYTE, chan1)
		break
	case 'E':
		encoding = sLoadEscapeEncoding(tls, name, chan1)
		break
	}
	if encoding == uintptr(0) && interp != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+26035, libc.VaList(bp, name)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+11953, name, uintptr(0)))
	}
	XTcl_Close(tls, uintptr(0), chan1)

	return encoding
}

//-------------------------------------------------------------------------
//
// LoadTableEncoding --
//
//	Helper function for LoadEncodingFile().  Creates a Tcl_EncodingType
//	structure along with its corresponding TableEncodingData structure, and
//	passes it to Tcl_Createncoding.
//
//	The file contains binary data but begins with a marker to indicate
//	byte-ordering so a single binary file can be read on big or
//	little-endian systems.
//
// Results:
//	Returns the new Tcl_Encoding,  or NULL if it could could
//	not be created because the file contained invalid data.
//
// Side effects:
//	See Tcl_CreateEncoding().
//
//-------------------------------------------------------------------------

func sLoadTableEncoding(tls *libc.TLS, name uintptr, type1 int32, chan1 Tcl_Channel) Tcl_Encoding { /* tclEncoding.c:1670:1: */
	bp := tls.Alloc(528)
	defer tls.Free(528)

	// var lineString Tcl_DString at bp, 216

	var objPtr uintptr
	// var line uintptr at bp+216, 8

	var i int32
	var hi int32
	var lo int32
	var numPages int32
	var symbol int32
	var fallback int32
	var len int32
	// var used [256]uint8 at bp+224, 256

	var size uint32
	var dataPtr uintptr
	var pageMemPtr uintptr
	var page uintptr
	// var encType Tcl_EncodingType at bp+480, 48

	var cachePtr uintptr
	var ch int32
	var p uintptr
	var expected int32
	var cachePtr1 uintptr
	var ch1 int32
	var p1 uintptr
	var to int32
	var from int32

	XTcl_DStringInit(tls, bp)
	if !(XTcl_Gets(tls, chan1, bp) == -1) {
		goto __1
	}
	return uintptr(0)
__1:
	;
	*(*uintptr)(unsafe.Pointer(bp + 216 /* line */)) = (*Tcl_DString)(unsafe.Pointer(bp)).Fstring

	fallback = int32(libc.Xstrtol(tls, *(*uintptr)(unsafe.Pointer(bp + 216 /* line */)), bp+216, 16))
	symbol = int32(libc.Xstrtol(tls, *(*uintptr)(unsafe.Pointer(bp + 216 /* line */)), bp+216, 10))
	numPages = int32(libc.Xstrtol(tls, *(*uintptr)(unsafe.Pointer(bp + 216 /* line */)), bp+216, 10))
	XTcl_DStringFree(tls, bp)

	if !(numPages < 0) {
		goto __2
	}
	numPages = 0
	goto __3
__2:
	if !(numPages > 256) {
		goto __4
	}
	numPages = 256
__4:
	;
__3:
	;

	libc.Xmemset(tls, bp+224, 0, uint64(unsafe.Sizeof([256]uint8{})))

	dataPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TableEncodingData{})))
	libc.Xmemset(tls, dataPtr, 0, uint64(unsafe.Sizeof(TableEncodingData{})))

	(*TableEncodingData)(unsafe.Pointer(dataPtr)).Ffallback = fallback

	// Read the table that maps characters to Unicode. Performs a single
	// malloc to get the memory for the array and all the pages needed by the
	// array.

	size = uint32(uint64(256)*uint64(unsafe.Sizeof(uintptr(0))) + uint64(numPages)*(uint64(256)*uint64(unsafe.Sizeof(uint16(0)))))
	(*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode = XTcl_Alloc(tls, size)
	libc.Xmemset(tls, (*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode, 0, uint64(size))
	pageMemPtr = (*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(256)*8

__5:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __8
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __9
__8:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__9:
	;
	goto __6
__6:
	if 0 != 0 {
		goto __5
	}
	goto __7
__7:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	i = 0
__10:
	if !(i < numPages) {
		goto __12
	}
	expected = 3 + 16*(16*4+1)

	if !(XTcl_ReadChars(tls, chan1, objPtr, expected, 0) != expected) {
		goto __13
	}
	return uintptr(0)
__13:
	;
	p = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()
	hi = int32(staticHex[uint8(*(*int8)(unsafe.Pointer(p)))])<<4 + int32(staticHex[uint8(*(*int8)(unsafe.Pointer(p + 1)))])
	*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(hi)*8)) = pageMemPtr
	p += uintptr(2)
	lo = 0
__14:
	if !(lo < 256) {
		goto __16
	}
	if !(lo&0x0F == 0) {
		goto __17
	}
	p++
__17:
	;
	ch = int32(staticHex[uint8(*(*int8)(unsafe.Pointer(p)))])<<12 + int32(staticHex[uint8(*(*int8)(unsafe.Pointer(p + 1)))])<<8 +
		int32(staticHex[uint8(*(*int8)(unsafe.Pointer(p + 2)))])<<4 + int32(staticHex[uint8(*(*int8)(unsafe.Pointer(p + 3)))])
	if !(ch != 0) {
		goto __18
	}
	*(*uint8)(unsafe.Pointer(bp + 224 + uintptr(ch>>8))) = uint8(1)
__18:
	;
	*(*uint16)(unsafe.Pointer(pageMemPtr)) = uint16(ch)
	pageMemPtr += 2
	p += uintptr(4)
	goto __15
__15:
	lo++
	goto __14
	goto __16
__16:
	;
	goto __11
__11:
	i++
	goto __10
	goto __12
__12:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __19
	}
	goto __20
__19:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __21
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __23
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__23:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__24:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __27
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __28
__27:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__28:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
	goto __22
__21:
	XTclFreeObj(tls, objPtr)
__22:
	;
__20:
	;

	if !(type1 == ENCODING_DOUBLEBYTE) {
		goto __29
	}
	libc.Xmemset(tls, dataPtr+4, 1, uint64(unsafe.Sizeof([256]int8{})))
	goto __30
__29:
	hi = 1
__31:
	if !(hi < 256) {
		goto __33
	}
	if !(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(hi)*8)) != uintptr(0)) {
		goto __34
	}
	*(*int8)(unsafe.Pointer(dataPtr + 4 + uintptr(hi))) = int8(1)
__34:
	;
	goto __32
__32:
	hi++
	goto __31
	goto __33
__33:
	;
__30:
	;

	// Invert the toUnicode array to produce the fromUnicode array. Performs a
	// single malloc to get the memory for the array and all the pages needed
	// by the array. While reading in the toUnicode array remember what
	// pages are needed for the fromUnicode array.

	if !(symbol != 0) {
		goto __35
	}
	*(*uint8)(unsafe.Pointer(bp + 224)) = uint8(1)
__35:
	;
	numPages = 0
	hi = 0
__36:
	if !(hi < 256) {
		goto __38
	}
	if !(*(*uint8)(unsafe.Pointer(bp + 224 + uintptr(hi))) != 0) {
		goto __39
	}
	numPages++
__39:
	;
	goto __37
__37:
	hi++
	goto __36
	goto __38
__38:
	;
	size = uint32(uint64(256)*uint64(unsafe.Sizeof(uintptr(0))) + uint64(numPages)*(uint64(256)*uint64(unsafe.Sizeof(uint16(0)))))
	(*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode = XTcl_Alloc(tls, size)
	libc.Xmemset(tls, (*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode, 0, uint64(size))
	pageMemPtr = (*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + uintptr(256)*8

	hi = 0
__40:
	if !(hi < 256) {
		goto __42
	}
	if !(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(hi)*8)) == uintptr(0)) {
		goto __43
	}
	*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(hi)*8)) = uintptr(unsafe.Pointer(&emptyPage))
	goto __41
__43:
	;
	lo = 0
__44:
	if !(lo < 256) {
		goto __46
	}
	ch1 = int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(hi)*8)) + uintptr(lo)*2)))

	if !(ch1 != 0) {
		goto __47
	}
	page = *(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + uintptr(ch1>>8)*8))
	if !(page == uintptr(0)) {
		goto __48
	}
	page = pageMemPtr
	pageMemPtr += 2 * uintptr(256)
	*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + uintptr(ch1>>8)*8)) = page
__48:
	;
	*(*uint16)(unsafe.Pointer(page + uintptr(ch1&0xFF)*2)) = uint16(hi<<8 + lo)
__47:
	;
	goto __45
__45:
	lo++
	goto __44
	goto __46
__46:
	;
	goto __41
__41:
	hi++
	goto __40
	goto __42
__42:
	;
	if !(type1 == ENCODING_MULTIBYTE) {
		goto __49
	}
	// If multibyte encodings don't have a backslash character, define
	// one. Otherwise, on Windows, native file names don't work because
	// the backslash in the file name maps to the unknown character
	// (question mark) when converting from UTF-8 to external encoding.

	if !(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode)) != uintptr(0)) {
		goto __50
	}
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode)) + 92*2))) == 0) {
		goto __51
	}
	*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode)) + 92*2)) = uint16('\\')
__51:
	;
__50:
	;
__49:
	;
	if !(symbol != 0) {
		goto __52
	}
	// Make a special symbol encoding that maps each symbol character from
	// its Unicode code point down into page 0, and also ensure that each
	// characters on page 0 maps to itself so that a symbol font can be
	// used to display a simple string like "abcd" and have alpha, beta,
	// chi, delta show up, rather than have "unknown" chars show up because
	// strictly speaking the symbol font doesn't have glyphs for those low
	// ASCII chars.

	page = *(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode))
	if !(page == uintptr(0)) {
		goto __53
	}
	page = pageMemPtr
	*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode)) = page
__53:
	;
	lo = 0
__54:
	if !(lo < 256) {
		goto __56
	}
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode)) + uintptr(lo)*2))) != 0) {
		goto __57
	}
	*(*uint16)(unsafe.Pointer(page + uintptr(lo)*2)) = uint16(lo)
__57:
	;
	goto __55
__55:
	lo++
	goto __54
	goto __56
__56:
	;
__52:
	;
	hi = 0
__58:
	if !(hi < 256) {
		goto __60
	}
	if !(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + uintptr(hi)*8)) == uintptr(0)) {
		goto __61
	}
	*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + uintptr(hi)*8)) = uintptr(unsafe.Pointer(&emptyPage))
__61:
	;
	goto __59
__59:
	hi++
	goto __58
	goto __60
__60:
	;

	// For trailing 'R'everse encoding, see [Patch 689341]

	XTcl_DStringInit(tls, bp)

	// Skip leading empty lines.

__62:
	if !(libc.AssignInt32(&len, XTcl_Gets(tls, chan1, bp)) == 0) {
		goto __63
	}
	// empty body
	goto __62
__63:
	;
	if !(len < 0) {
		goto __64
	}
	goto doneParse
__64:
	;

	// Require that it starts with an 'R'.

	*(*uintptr)(unsafe.Pointer(bp + 216 /* line */)) = (*Tcl_DString)(unsafe.Pointer(bp)).Fstring
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216))))) != 'R') {
		goto __65
	}
	goto doneParse
__65:
	;

	// Read lines until EOF.

	XTcl_DStringSetLength(tls, bp, 0)
__66:
	if !(libc.AssignInt32(&len, XTcl_Gets(tls, chan1, bp)) >= 0) {
		goto __68
	}

	// Skip short lines.

	if !(len < 5) {
		goto __69
	}
	goto __67
__69:
	;

	// Parse the line as a sequence of hex digits.

	p1 = (*Tcl_DString)(unsafe.Pointer(bp)).Fstring
	to = int32(staticHex[*(*uint8)(unsafe.Pointer(p1))])<<12 + int32(staticHex[*(*uint8)(unsafe.Pointer(p1 + 1))])<<8 +
		int32(staticHex[*(*uint8)(unsafe.Pointer(p1 + 2))])<<4 + int32(staticHex[*(*uint8)(unsafe.Pointer(p1 + 3))])
	if !(to == 0) {
		goto __70
	}
	goto __67
__70:
	;
	p1 += uintptr(5)
	len = len - 5
__71:
	if !(len >= 0 && *(*uint8)(unsafe.Pointer(p1)) != 0) {
		goto __73
	}
	from = int32(staticHex[*(*uint8)(unsafe.Pointer(p1))])<<12 + int32(staticHex[*(*uint8)(unsafe.Pointer(p1 + 1))])<<8 +
		int32(staticHex[*(*uint8)(unsafe.Pointer(p1 + 2))])<<4 + int32(staticHex[*(*uint8)(unsafe.Pointer(p1 + 3))])
	if !(from == 0) {
		goto __74
	}
	goto __72
__74:
	;
	*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + uintptr(from>>8)*8)) + uintptr(from&0xFF)*2)) = uint16(to)
	goto __72
__72:
	p1 += uintptr(5)
	len = len - 5
	goto __71
	goto __73
__73:
	;
	goto __67
__67:
	XTcl_DStringSetLength(tls, bp, 0)
	goto __66
	goto __68
__68:
	;
doneParse:
	XTcl_DStringFree(tls, bp)

	// Package everything into an encoding structure.

	(*Tcl_EncodingType)(unsafe.Pointer(bp + 480 /* &encType */)).FencodingName = name
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 480 /* &encType */)).FtoUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sTableToUtfProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 480 /* &encType */)).FfromUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sTableFromUtfProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 480 /* &encType */)).FfreeProc = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sTableFreeProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 480 /* &encType */)).FnullSize = func() int32 {
		if type1 == ENCODING_DOUBLEBYTE {
			return 2
		}
		return 1
	}()
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 480 /* &encType */)).FclientData = dataPtr

	return XTcl_CreateEncoding(tls, bp+480)
}

var staticHex = [256]int8{
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), //   0 ...  15
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), //  16 ...  31
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), //  32 ...  47
	int8(0), int8(1), int8(2), int8(3), int8(4), int8(5), int8(6), int8(7), int8(8), int8(9), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), //  48 ...  63
	int8(0), int8(10), int8(11), int8(12), int8(13), int8(14), int8(15), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), //  64 ...  79
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), //  80 ...  95
	int8(0), int8(10), int8(11), int8(12), int8(13), int8(14), int8(15), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), //  96 ... 111
	int8(0), int8(1), int8(2), int8(3), int8(4), int8(5), int8(6), int8(7), int8(8), int8(9), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), // 112 ... 127
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), // 128 ... 143
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), // 144 ... 159
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), // 160 ... 175
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), // 176 ... 191
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), // 192 ... 207
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), // 208 ... 223
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), // 224 ... 239
	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), // 240 ... 255
} /* tclEncoding.c:1690:23 */

//-------------------------------------------------------------------------
//
// LoadEscapeEncoding --
//
//	Helper function for LoadEncodingTable(). Loads a state machine that
//	converts between Unicode and some other encoding.
//
//	File contains text data that describes the escape sequences that are
//	used to choose an encoding and the associated names for the
//	sub-encodings.
//
// Results:
//	The return value is the new encoding, or NULL if the encoding could
//	not be created (because the file contained invalid data).
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sLoadEscapeEncoding(tls *libc.TLS, name uintptr, chan1 Tcl_Channel) Tcl_Encoding { /* tclEncoding.c:1972:1: */
	bp := tls.Alloc(592)
	defer tls.Free(592)

	var i int32
	var size uint32
	// var escapeData Tcl_DString at bp+32, 216

	// var init1 [16]int8 at bp, 16

	// var final [16]int8 at bp+16, 16

	var dataPtr uintptr
	// var type1 Tcl_EncodingType at bp+544, 48

	*(*int8)(unsafe.Pointer(bp)) = int8(0)
	*(*int8)(unsafe.Pointer(bp + 16)) = int8(0)
	XTcl_DStringInit(tls, bp+32)

	for 1 != 0 {
		// var argc int32 at bp+464, 4

		// var argv uintptr at bp+472, 8

		var line uintptr
		// var lineString Tcl_DString at bp+248, 216

		XTcl_DStringInit(tls, bp+248)
		if XTcl_Gets(tls, chan1, bp+248) < 0 {
			break
		}
		line = (*Tcl_DString)(unsafe.Pointer(bp + 248)).Fstring
		if XTcl_SplitList(tls, uintptr(0), line, bp+464, bp+472) != TCL_OK {
			XTcl_DStringFree(tls, bp+248)
			continue
		}
		if *(*int32)(unsafe.Pointer(bp + 464)) >= 2 {
			if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 472)))), ts+3660) == 0 {
				// do nothing
			} else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 472)))), ts+26062) == 0 {
				libc.Xstrncpy(tls, bp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 472 /* argv */)) + 1*8)), uint64(unsafe.Sizeof([16]int8{})))
				*(*int8)(unsafe.Pointer(bp + 15)) = int8(0)
			} else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 472)))), ts+26067) == 0 {
				libc.Xstrncpy(tls, bp+16, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 472 /* argv */)) + 1*8)), uint64(unsafe.Sizeof([16]int8{})))
				*(*int8)(unsafe.Pointer(bp + 16 + 15)) = int8(0)
			} else {
				// var est EscapeSubTable at bp+480, 64

				var e uintptr

				libc.Xstrncpy(tls, bp+480+4, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 472 /* argv */)) + 1*8)), uint64(unsafe.Sizeof([16]int8{})))
				*(*int8)(unsafe.Pointer(bp + 480 + 4 + 15)) = int8(0)
				(*EscapeSubTable)(unsafe.Pointer(bp + 480 /* &est */)).FsequenceLen = uint32(libc.Xstrlen(tls, bp+480+4))

				libc.Xstrncpy(tls, bp+480+20, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 472 /* argv */)))), uint64(unsafe.Sizeof([32]int8{})))
				*(*int8)(unsafe.Pointer(bp + 480 + 20 + 31)) = int8(0)

				// To avoid infinite recursion in [encoding system iso2022-*]

				e = XTcl_GetEncoding(tls, uintptr(0), bp+480+20)
				if e != uintptr(0) && (*Encoding)(unsafe.Pointer(e)).FtoUtfProc != *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
				}{sTableToUtfProc})) &&
					(*Encoding)(unsafe.Pointer(e)).FtoUtfProc != *(*uintptr)(unsafe.Pointer(&struct {
						f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
					}{sIso88591ToUtfProc})) {
					XTcl_FreeEncoding(tls, e)
					e = uintptr(0)
				}
				(*EscapeSubTable)(unsafe.Pointer(bp + 480 /* &est */)).FencodingPtr = e
				XTcl_DStringAppend(tls, bp+32, bp+480, int32(unsafe.Sizeof(EscapeSubTable{})))
			}
		}
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 472)))
		XTcl_DStringFree(tls, bp+248)
	}

	size = uint32(int32(uintptr(0)+304) +
		(*Tcl_DString)(unsafe.Pointer(bp+32)).Flength)
	dataPtr = XTcl_Alloc(tls, size)
	(*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen = uint32(libc.Xstrlen(tls, bp))
	libc.Xmemcpy(tls, dataPtr+8, bp, uint64((*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen+uint32(1)))
	(*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen = uint32(libc.Xstrlen(tls, bp+16))
	libc.Xmemcpy(tls, dataPtr+28, bp+16, uint64((*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen+uint32(1)))
	(*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables = int32(uint64((*Tcl_DString)(unsafe.Pointer(bp+32)).Flength) / uint64(unsafe.Sizeof(EscapeSubTable{})))
	libc.Xmemcpy(tls, dataPtr+304, (*Tcl_DString)(unsafe.Pointer(bp+32)).Fstring,
		uint64((*Tcl_DString)(unsafe.Pointer(bp+32)).Flength))
	XTcl_DStringFree(tls, bp+32)

	libc.Xmemset(tls, dataPtr+44, 0, uint64(unsafe.Sizeof([256]int8{})))
	for i = 0; i < (*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables; i++ {
		*(*int8)(unsafe.Pointer(dataPtr + 44 + uintptr(uint8(*(*int8)(unsafe.Pointer(dataPtr + 304 + uintptr(i)*64 + 4)))))) = int8(1)
	}
	if int32(*(*int8)(unsafe.Pointer(dataPtr + 8))) != 0 {
		*(*int8)(unsafe.Pointer(dataPtr + 44 + uintptr(uint8(*(*int8)(unsafe.Pointer(dataPtr + 8)))))) = int8(1)
	}
	if int32(*(*int8)(unsafe.Pointer(dataPtr + 28))) != 0 {
		*(*int8)(unsafe.Pointer(dataPtr + 44 + uintptr(uint8(*(*int8)(unsafe.Pointer(dataPtr + 28)))))) = int8(1)
	}

	// Package everything into an encoding structure.

	(*Tcl_EncodingType)(unsafe.Pointer(bp + 544 /* &type1 */)).FencodingName = name
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 544 /* &type1 */)).FtoUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sEscapeToUtfProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 544 /* &type1 */)).FfromUtfProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
	}{sEscapeFromUtfProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 544 /* &type1 */)).FfreeProc = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sEscapeFreeProc}))
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 544 /* &type1 */)).FnullSize = 1
	(*Tcl_EncodingType)(unsafe.Pointer(bp + 544 /* &type1 */)).FclientData = dataPtr

	return XTcl_CreateEncoding(tls, bp+544)
}

//-------------------------------------------------------------------------
//
// BinaryProc --
//
//	The default conversion when no other conversion is specified. No
//	translation is done; source bytes are copied directly to destination
//	bytes.
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sBinaryProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:2097:1: */
	var result int32

	result = TCL_OK
	dstLen = dstLen - (TCL_UTF_MAX - 1)
	if dstLen < 0 {
		dstLen = 0
	}
	if flags&TCL_ENCODING_CHAR_LIMIT != 0 && srcLen > *(*int32)(unsafe.Pointer(dstCharsPtr)) {
		srcLen = *(*int32)(unsafe.Pointer(dstCharsPtr))
	}
	if srcLen > dstLen {
		srcLen = dstLen
		result = -4
	}

	*(*int32)(unsafe.Pointer(srcReadPtr)) = srcLen
	*(*int32)(unsafe.Pointer(dstWrotePtr)) = srcLen
	*(*int32)(unsafe.Pointer(dstCharsPtr)) = srcLen
	libc.Xmemcpy(tls, dst, src, uint64(srcLen))
	return result
}

//-------------------------------------------------------------------------
//
// UtfIntToUtfExtProc --
//
//	Convert from UTF-8 to UTF-8. While converting null-bytes from the
//	Tcl's internal representation (0xC0, 0x80) to the official
//	representation (0x00). See UtfToUtfProc for details.
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sUtfIntToUtfExtProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:2161:1: */
	return sUtfToUtfProc(tls, clientData, src, srcLen, flags, statePtr, dst, dstLen,
		srcReadPtr, dstWrotePtr, dstCharsPtr, 1)
}

//-------------------------------------------------------------------------
//
// UtfExtToUtfIntProc --
//
//	Convert from UTF-8 to UTF-8 while converting null-bytes from the
//	official representation (0x00) to Tcl's internal representation (0xC0,
//	0x80). See UtfToUtfProc for details.
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sUtfExtToUtfIntProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:2210:1: */
	return sUtfToUtfProc(tls, clientData, src, srcLen, flags, statePtr, dst, dstLen,
		srcReadPtr, dstWrotePtr, dstCharsPtr, 0)
}

//-------------------------------------------------------------------------
//
// UtfToUtfProc --
//
//	Convert from UTF-8 to UTF-8. Note that the UTF-8 to UTF-8 translation
//	is not a no-op, because it will turn a stream of improperly formed
//	UTF-8 into a properly formed stream.
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sUtfToUtfProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr, pureNullMode int32) int32 { /* tclEncoding.c:2259:1: */
	bp := tls.Alloc(2)
	defer tls.Free(2)

	var srcStart uintptr
	var srcEnd uintptr
	var srcClose uintptr
	var dstStart uintptr
	var dstEnd uintptr
	var result int32
	var numChars int32
	var charLimit int32 = 0x7fffffff
	var chPtr uintptr = statePtr

	if flags&TCL_ENCODING_START != 0 {
		*(*Tcl_EncodingState)(unsafe.Pointer(statePtr)) = uintptr(0)
	}
	result = TCL_OK

	srcStart = src
	srcEnd = src + uintptr(srcLen)
	srcClose = srcEnd
	if flags&TCL_ENCODING_END == 0 {
		srcClose -= uintptr(6)
	}
	if flags&TCL_ENCODING_CHAR_LIMIT != 0 {
		charLimit = *(*int32)(unsafe.Pointer(dstCharsPtr))
	}

	dstStart = dst
	dstEnd = dst + uintptr(dstLen) - uintptr(func() int32 {
		if pureNullMode == 1 {
			return 4
		}
		return TCL_UTF_MAX
	}())

	for numChars = 0; src < srcEnd && numChars <= charLimit; numChars++ {
		if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int32((int64(srcEnd)-int64(src))/1)) != 0) {
			// If there is more string to follow, this will ensure that the
			// last UTF-8 character in the source buffer hasn't been cut off.

			result = -1
			break
		}
		if dst > dstEnd {
			result = -4
			break
		}
		if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 && !(int32(uint8(*(*int8)(unsafe.Pointer(src)))) == 0 && pureNullMode == 0) {
			// Copy 7bit characters, but skip null-bytes when we are in input
			// mode, so that they get converted to 0xC080.

			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&src, 1)))
			*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(0) // reset surrogate handling
		} else if int32(uint8(*(*int8)(unsafe.Pointer(src)))) == 0xC0 && src+uintptr(1) < srcEnd &&
			int32(uint8(*(*int8)(unsafe.Pointer(src + 1)))) == 0x80 && pureNullMode == 1 {
			// Convert 0xC080 to real nulls when we are in output mode.

			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(0)
			*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(0) // reset surrogate handling
			src += uintptr(2)
		} else if !(XTcl_UtfCharComplete(tls, src, int32((int64(srcEnd)-int64(src))/1)) != 0) {
			// Always check before using TclUtfToUniChar. Not doing can so
			// cause it run beyond the end of the buffer! If we happen such an
			// incomplete char its bytes are made to represent themselves
			// unless the user has explicitly asked to be told.

			if flags&TCL_ENCODING_STOPONERROR != 0 && pureNullMode == 0 {
				result = -1
				break
			}
			*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
			src += uintptr(1)
			dst += uintptr(XTcl_UniCharToUtf(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr))), dst))
		} else {
			var len Size_t = func() uint64 {
				if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 {
					return uint64(func() int32 {
						*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
						return 1
					}())
				}
				return uint64(XTcl_UtfToUniChar(tls, src, chPtr))
			}()
			if len < uint64(2) && int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr))) != 0 && flags&TCL_ENCODING_STOPONERROR != 0 &&
				int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr)))&libc.CplInt32(0x7FF) != 0xD800 && pureNullMode == 0 {
				result = -2
				break
			}
			src += uintptr(len)
			if int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr)))&libc.CplInt32(0x7FF) == 0xD800 {
				// var low Tcl_UniChar at bp, 2

				// A surrogate character is detected, handle especially
				if len < uint64(3) && int32(*(*int8)(unsafe.Pointer(src + uintptr(uint64(3)-len))))&0xC0 != 0x80 {
					// It's invalid. See [ed29806ba]
					*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src + libc.UintptrFromInt32(-1)))))
					dst += uintptr(XTcl_UniCharToUtf(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr))), dst))
					continue
				}
				*(*Tcl_UniChar)(unsafe.Pointer(bp /* low */)) = *(*Tcl_UniChar)(unsafe.Pointer(chPtr))
				if src <= srcEnd-uintptr(3) {
					len = uint64(XTcl_UtfToUniChar(tls, src, bp))
				} else {
					len = uint64(0)
				}
				if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp)))&libc.CplInt32(0x3FF) != 0xDC00 || int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr)))&0x400 != 0 {
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8((int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr)))>>12 | 0xE0) & 0xEF)
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8((int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr)))>>6 | 0x80) & 0xBF)
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8((int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr))) | 0x80) & 0xBF)
					*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(0) // reset surrogate handling
					continue
				} else if TCL_UTF_MAX > 3 || pureNullMode == 1 {
					var full int32 = int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr)))&0x3FF<<10 | int32(*(*Tcl_UniChar)(unsafe.Pointer(bp)))&0x3FF + 0x10000
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8((full>>18 | 0xF0) & 0xF7)
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8((full>>12 | 0x80) & 0xBF)
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8((full>>6 | 0x80) & 0xBF)
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8((full | 0x80) & 0xBF)
					*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(0) // reset surrogate handling
					src += uintptr(len)
					continue
				}
			}
			dst += uintptr(XTcl_UniCharToUtf(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr))), dst))
		}
	}

	*(*int32)(unsafe.Pointer(srcReadPtr)) = int32((int64(src) - int64(srcStart)) / 1)
	*(*int32)(unsafe.Pointer(dstWrotePtr)) = int32((int64(dst) - int64(dstStart)) / 1)
	*(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars
	return result
}

//-------------------------------------------------------------------------
//
// UnicodeToUtfProc --
//
//	Convert from UTF-16 to UTF-8.
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sUnicodeToUtfProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:2422:1: */
	var srcStart uintptr
	var srcEnd uintptr
	var dstEnd uintptr
	var dstStart uintptr
	var result int32
	var numChars int32
	var charLimit int32 = 0x7fffffff
	var ch uint16

	if flags&TCL_ENCODING_CHAR_LIMIT != 0 {
		charLimit = *(*int32)(unsafe.Pointer(dstCharsPtr))
	}
	result = TCL_OK

	// check alignment with utf-16 (2 == sizeof(UTF-16))
	if srcLen%2 != 0 {
		result = -1
		srcLen--
	}

	// If last code point is a high surrogate, we cannot handle that yet.

	if srcLen >= 2 && int32(*(*int8)(unsafe.Pointer(src + uintptr(srcLen-func() int32 {
		if clientData != 0 {
			return 1
		}
		return 2
	}()))))&0xFC == 0xD8 {
		result = -1
		srcLen = srcLen - 2
	}

	srcStart = src
	srcEnd = src + uintptr(srcLen)

	dstStart = dst
	dstEnd = dst + uintptr(dstLen) - uintptr(TCL_UTF_MAX)

	for numChars = 0; src < srcEnd && numChars <= charLimit; numChars++ {
		if dst > dstEnd {
			result = -4
			break
		}

		if clientData != 0 {
			ch = uint16(int32(*(*int8)(unsafe.Pointer(src + 1)))&0xFF<<8 | int32(*(*int8)(unsafe.Pointer(src)))&0xFF)
		} else {
			ch = uint16(int32(*(*int8)(unsafe.Pointer(src)))&0xFF<<8 | int32(*(*int8)(unsafe.Pointer(src + 1)))&0xFF)
		}

		// Special case for 1-byte utf chars for speed. Make sure we work with
		// unsigned short-size data.

		if ch != 0 && int32(ch) < 0x80 {
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(int32(ch) & 0xFF)
		} else {
			dst += uintptr(XTcl_UniCharToUtf(tls, int32(ch), dst))
		}
		src += uintptr(unsafe.Sizeof(uint16(0)))
	}

	*(*int32)(unsafe.Pointer(srcReadPtr)) = int32((int64(src) - int64(srcStart)) / 1)
	*(*int32)(unsafe.Pointer(dstWrotePtr)) = int32((int64(dst) - int64(dstStart)) / 1)
	*(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars
	return result
}

//-------------------------------------------------------------------------
//
// UtfToUnicodeProc --
//
//	Convert from UTF-8 to UTF-16.
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sUtfToUnicodeProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:2528:1: */
	var srcStart uintptr
	var srcEnd uintptr
	var srcClose uintptr
	var dstStart uintptr
	var dstEnd uintptr
	var result int32
	var numChars int32
	var chPtr uintptr = statePtr

	if flags&TCL_ENCODING_START != 0 {
		*(*Tcl_EncodingState)(unsafe.Pointer(statePtr)) = uintptr(0)
	}
	srcStart = src
	srcEnd = src + uintptr(srcLen)
	srcClose = srcEnd
	if flags&TCL_ENCODING_END == 0 {
		srcClose -= uintptr(TCL_UTF_MAX)
	}

	dstStart = dst
	dstEnd = dst + uintptr(dstLen) - uintptr(uint64(unsafe.Sizeof(Tcl_UniChar(0))))

	result = TCL_OK
	for numChars = 0; src < srcEnd; numChars++ {
		if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int32((int64(srcEnd)-int64(src))/1)) != 0) {
			// If there is more string to follow, this will ensure that the
			// last UTF-8 character in the source buffer hasn't been cut off.

			result = -1
			break
		}
		if dst > dstEnd {
			result = -4
			break
		}
		src += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, src, chPtr))
		}()

		if clientData != 0 {
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr))) & 0xFF)
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr))) >> 8)
		} else {
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr))) >> 8)
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr))) & 0xFF)
		}
	}
	*(*int32)(unsafe.Pointer(srcReadPtr)) = int32((int64(src) - int64(srcStart)) / 1)
	*(*int32)(unsafe.Pointer(dstWrotePtr)) = int32((int64(dst) - int64(dstStart)) / 1)
	*(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars
	return result
}

//-------------------------------------------------------------------------
//
// TableToUtfProc --
//
//	Convert from the encoding specified by the TableEncodingData into
//	UTF-8.
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sTableToUtfProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:2644:1: */
	var srcStart uintptr
	var srcEnd uintptr
	var dstEnd uintptr
	var dstStart uintptr
	var prefixBytes uintptr
	var result int32
	var byte int32
	var numChars int32
	var charLimit int32 = 0x7fffffff
	var ch Tcl_UniChar = Tcl_UniChar(0)
	var toUnicode uintptr
	var pageZero uintptr
	var dataPtr uintptr = clientData

	if flags&TCL_ENCODING_CHAR_LIMIT != 0 {
		charLimit = *(*int32)(unsafe.Pointer(dstCharsPtr))
	}
	srcStart = src
	srcEnd = src + uintptr(srcLen)

	dstStart = dst
	dstEnd = dst + uintptr(dstLen) - uintptr(TCL_UTF_MAX)

	toUnicode = (*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode
	prefixBytes = dataPtr + 4 /* &.prefixBytes */
	pageZero = *(*uintptr)(unsafe.Pointer(toUnicode))

	result = TCL_OK
	for numChars = 0; src < srcEnd && numChars <= charLimit; numChars++ {
		if dst > dstEnd {
			result = -4
			break
		}
		byte = int32(*(*uint8)(unsafe.Pointer(src)))
		if *(*int8)(unsafe.Pointer(prefixBytes + uintptr(byte))) != 0 {
			src++
			if src >= srcEnd {
				src--
				result = -1
				break
			}
			ch = *(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(toUnicode + uintptr(byte)*8)) + uintptr(*(*uint8)(unsafe.Pointer(src)))*2))
		} else {
			ch = *(*uint16)(unsafe.Pointer(pageZero + uintptr(byte)*2))
		}
		if int32(ch) == 0 && byte != 0 {
			if flags&TCL_ENCODING_STOPONERROR != 0 {
				result = -2
				break
			}
			if *(*int8)(unsafe.Pointer(prefixBytes + uintptr(byte))) != 0 {
				src--
			}
			ch = Tcl_UniChar(byte)
		}

		// Special case for 1-byte utf chars for speed.

		if ch != 0 && int32(ch) < 0x80 {
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(ch)
		} else {
			dst += uintptr(XTcl_UniCharToUtf(tls, int32(ch), dst))
		}
		src++
	}

	*(*int32)(unsafe.Pointer(srcReadPtr)) = int32((int64(src) - int64(srcStart)) / 1)
	*(*int32)(unsafe.Pointer(dstWrotePtr)) = int32((int64(dst) - int64(dstStart)) / 1)
	*(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars
	return result
}

//-------------------------------------------------------------------------
//
// TableFromUtfProc --
//
//	Convert from UTF-8 into the encoding specified by the
//	TableEncodingData.
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sTableFromUtfProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:2757:1: */
	bp := tls.Alloc(2)
	defer tls.Free(2)

	var srcStart uintptr
	var srcEnd uintptr
	var srcClose uintptr
	var dstStart uintptr
	var dstEnd uintptr
	var prefixBytes uintptr
	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)) = Tcl_UniChar(0)
	var result int32
	var len int32
	var word int32
	var numChars int32
	var dataPtr uintptr = clientData
	var fromUnicode uintptr

	result = TCL_OK

	prefixBytes = dataPtr + 4 /* &.prefixBytes */
	fromUnicode = (*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode

	srcStart = src
	srcEnd = src + uintptr(srcLen)
	srcClose = srcEnd
	if flags&TCL_ENCODING_END == 0 {
		srcClose -= uintptr(TCL_UTF_MAX)
	}

	dstStart = dst
	dstEnd = dst + uintptr(dstLen) - uintptr(1)

	for numChars = 0; src < srcEnd; numChars++ {
		if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int32((int64(srcEnd)-int64(src))/1)) != 0) {
			// If there is more string to follow, this will ensure that the
			// last UTF-8 character in the source buffer hasn't been cut off.

			result = -1
			break
		}
		len = func() int32 {
			if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 {
				return func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
					return 1
				}()
			}
			return XTcl_UtfToUniChar(tls, src, bp)
		}()

		word = int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromUnicode + uintptr(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp)))>>8)*8)) + uintptr(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp)))&0xFF)*2)))

		if word == 0 && int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) != 0 {
			if flags&TCL_ENCODING_STOPONERROR != 0 {
				result = -3
				break
			}
			word = (*TableEncodingData)(unsafe.Pointer(dataPtr)).Ffallback
		}
		if int32(*(*int8)(unsafe.Pointer(prefixBytes + uintptr(word>>8)))) != 0 {
			if dst+uintptr(1) > dstEnd {
				result = -4
				break
			}
			*(*int8)(unsafe.Pointer(dst)) = int8(word >> 8)
			*(*int8)(unsafe.Pointer(dst + 1)) = int8(word)
			dst += uintptr(2)
		} else {
			if dst > dstEnd {
				result = -4
				break
			}
			*(*int8)(unsafe.Pointer(dst)) = int8(word)
			dst++
		}
		src += uintptr(len)
	}

	*(*int32)(unsafe.Pointer(srcReadPtr)) = int32((int64(src) - int64(srcStart)) / 1)
	*(*int32)(unsafe.Pointer(dstWrotePtr)) = int32((int64(dst) - int64(dstStart)) / 1)
	*(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars
	return result
}

//-------------------------------------------------------------------------
//
// Iso88591ToUtfProc --
//
//	Convert from the "iso8859-1" encoding into UTF-8.
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sIso88591ToUtfProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:2879:1: */
	var srcStart uintptr
	var srcEnd uintptr
	var dstEnd uintptr
	var dstStart uintptr
	var result int32
	var numChars int32
	var charLimit int32 = 0x7fffffff

	if flags&TCL_ENCODING_CHAR_LIMIT != 0 {
		charLimit = *(*int32)(unsafe.Pointer(dstCharsPtr))
	}
	srcStart = src
	srcEnd = src + uintptr(srcLen)

	dstStart = dst
	dstEnd = dst + uintptr(dstLen) - uintptr(TCL_UTF_MAX)

	result = TCL_OK
	for numChars = 0; src < srcEnd && numChars <= charLimit; numChars++ {
		var ch Tcl_UniChar = Tcl_UniChar(0)

		if dst > dstEnd {
			result = -4
			break
		}
		ch = Tcl_UniChar(*(*uint8)(unsafe.Pointer(src)))

		// Special case for 1-byte utf chars for speed.

		if ch != 0 && int32(ch) < 0x80 {
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(ch)
		} else {
			dst += uintptr(XTcl_UniCharToUtf(tls, int32(ch), dst))
		}
		src++
	}

	*(*int32)(unsafe.Pointer(srcReadPtr)) = int32((int64(src) - int64(srcStart)) / 1)
	*(*int32)(unsafe.Pointer(dstWrotePtr)) = int32((int64(dst) - int64(dstStart)) / 1)
	*(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars
	return result
}

//-------------------------------------------------------------------------
//
// Iso88591FromUtfProc --
//
//	Convert from UTF-8 into the encoding "iso8859-1".
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sIso88591FromUtfProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:2963:1: */
	bp := tls.Alloc(2)
	defer tls.Free(2)

	var srcStart uintptr
	var srcEnd uintptr
	var srcClose uintptr
	var dstStart uintptr
	var dstEnd uintptr
	var result int32 = TCL_OK
	var numChars int32
	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)) = Tcl_UniChar(0)

	srcStart = src
	srcEnd = src + uintptr(srcLen)
	srcClose = srcEnd
	if flags&TCL_ENCODING_END == 0 {
		srcClose -= uintptr(TCL_UTF_MAX)
	}

	dstStart = dst
	dstEnd = dst + uintptr(dstLen) - uintptr(1)

	for numChars = 0; src < srcEnd; numChars++ {
		var len int32

		if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int32((int64(srcEnd)-int64(src))/1)) != 0) {
			// If there is more string to follow, this will ensure that the
			// last UTF-8 character in the source buffer hasn't been cut off.

			result = -1
			break
		}
		len = func() int32 {
			if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 {
				return func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
					return 1
				}()
			}
			return XTcl_UtfToUniChar(tls, src, bp)
		}()

		// Check for illegal characters.

		if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) > 0xFF {
			if flags&TCL_ENCODING_STOPONERROR != 0 {
				result = -3
				break
			}
			// Plunge on, using '?' as a fallback character.

			*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)) = Tcl_UniChar('?')
		}

		if dst > dstEnd {
			result = -4
			break
		}
		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)))
		src += uintptr(len)
	}

	*(*int32)(unsafe.Pointer(srcReadPtr)) = int32((int64(src) - int64(srcStart)) / 1)
	*(*int32)(unsafe.Pointer(dstWrotePtr)) = int32((int64(dst) - int64(dstStart)) / 1)
	*(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars
	return result
}

//---------------------------------------------------------------------------
//
// TableFreeProc --
//
//	This function is invoked when an encoding is deleted. It deletes the
//	memory used by the TableEncodingData.
//
// Results:
//	None.
//
// Side effects:
//	Memory freed.
//
//---------------------------------------------------------------------------

func sTableFreeProc(tls *libc.TLS, clientData ClientData) { /* tclEncoding.c:3075:1: */
	var dataPtr uintptr = clientData

	// Make sure we aren't freeing twice on shutdown. [Bug 219314]

	XTclpFree(tls, (*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode)
	(*TableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode = uintptr(0)
	XTclpFree(tls, (*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode)
	(*TableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode = uintptr(0)
	XTclpFree(tls, dataPtr)
}

//-------------------------------------------------------------------------
//
// EscapeToUtfProc --
//
//	Convert from the encoding specified by the EscapeEncodingData into
//	UTF-8.
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sEscapeToUtfProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:3110:1: */
	var dataPtr uintptr = clientData
	var prefixBytes uintptr
	var tablePrefixBytes uintptr
	var srcStart uintptr
	var srcEnd uintptr
	var tableToUnicode uintptr
	var encodingPtr uintptr
	var state int32
	var result int32
	var numChars int32
	var charLimit int32 = 0x7fffffff
	var dstStart uintptr
	var dstEnd uintptr

	if flags&TCL_ENCODING_CHAR_LIMIT != 0 {
		charLimit = *(*int32)(unsafe.Pointer(dstCharsPtr))
	}
	result = TCL_OK
	tablePrefixBytes = uintptr(0)
	tableToUnicode = uintptr(0)
	prefixBytes = dataPtr + 44 /* &.prefixBytes */
	encodingPtr = uintptr(0)

	srcStart = src
	srcEnd = src + uintptr(srcLen)

	dstStart = dst
	dstEnd = dst + uintptr(dstLen) - uintptr(TCL_UTF_MAX)

	state = int32(*(*Tcl_EncodingState)(unsafe.Pointer(statePtr)))
	if flags&TCL_ENCODING_START != 0 {
		state = 0
	}

	for numChars = 0; src < srcEnd && numChars <= charLimit; {
		var byte int32
		var hi int32
		var lo int32
		var ch int32

		if dst > dstEnd {
			result = -4
			break
		}
		byte = int32(*(*uint8)(unsafe.Pointer(src)))
		if *(*int8)(unsafe.Pointer(prefixBytes + uintptr(byte))) != 0 {
			var left uint32
			var len uint32
			var longest uint32
			var checked int32
			var i int32
			var subTablePtr uintptr

			// Saw the beginning of an escape sequence.

			left = uint32((int64(srcEnd) - int64(src)) / 1)
			len = (*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen
			longest = len
			checked = 0

			if len <= left {
				checked++
				if len > uint32(0) && libc.Xmemcmp(tls, src, dataPtr+8, uint64(len)) == 0 {
					// If we see initialization string, skip it, even if we're
					// not at the beginning of the buffer.

					src += uintptr(len)
					continue
				}
			}

			len = (*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen
			if len > longest {
				longest = len
			}

			if len <= left {
				checked++
				if len > uint32(0) && libc.Xmemcmp(tls, src, dataPtr+28, uint64(len)) == 0 {
					// If we see finalization string, skip it, even if we're
					// not at the end of the buffer.

					src += uintptr(len)
					continue
				}
			}

			subTablePtr = dataPtr + 304 /* &.subTables */
			for i = 0; i < (*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables; i++ {
				len = (*EscapeSubTable)(unsafe.Pointer(subTablePtr)).FsequenceLen
				if len > longest {
					longest = len
				}
				if len <= left {
					checked++
					if len > uint32(0) && libc.Xmemcmp(tls, src, subTablePtr+4, uint64(len)) == 0 {
						state = i
						encodingPtr = uintptr(0)
						subTablePtr = uintptr(0)
						src += uintptr(len)
						break
					}
				}
				subTablePtr += 64
			}

			if subTablePtr == uintptr(0) {
				// A match was found, the escape sequence was consumed, and
				// the state was updated.

				continue
			}

			// We have a split-up or unrecognized escape sequence. If we
			// checked all the sequences, then it's a syntax error, otherwise
			// we need more bytes to determine a match.

			if checked == (*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables+2 ||
				flags&TCL_ENCODING_END != 0 {
				if flags&TCL_ENCODING_STOPONERROR == 0 {
					// Skip the unknown escape sequence.

					src += uintptr(longest)
					continue
				}
				result = -2
			} else {
				result = -1
			}
			break
		}

		if encodingPtr == uintptr(0) {
			var tableDataPtr uintptr

			encodingPtr = sGetTableEncoding(tls, dataPtr, state)
			tableDataPtr = (*Encoding)(unsafe.Pointer(encodingPtr)).FclientData
			tablePrefixBytes = tableDataPtr + 4 /* &.prefixBytes */
			tableToUnicode = (*TableEncodingData)(unsafe.Pointer(tableDataPtr)).FtoUnicode
		}

		if *(*int8)(unsafe.Pointer(tablePrefixBytes + uintptr(byte))) != 0 {
			src++
			if src >= srcEnd {
				src--
				result = -1
				break
			}
			hi = byte
			lo = int32(*(*uint8)(unsafe.Pointer(src)))
		} else {
			hi = 0
			lo = byte
		}

		ch = int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tableToUnicode + uintptr(hi)*8)) + uintptr(lo)*2)))
		dst += uintptr(XTcl_UniCharToUtf(tls, ch, dst))
		src++
		numChars++
	}

	*(*Tcl_EncodingState)(unsafe.Pointer(statePtr)) = uintptr(Intptr_t(state))
	*(*int32)(unsafe.Pointer(srcReadPtr)) = int32((int64(src) - int64(srcStart)) / 1)
	*(*int32)(unsafe.Pointer(dstWrotePtr)) = int32((int64(dst) - int64(dstStart)) / 1)
	*(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars
	return result
}

//-------------------------------------------------------------------------
//
// EscapeFromUtfProc --
//
//	Convert from UTF-8 into the encoding specified by the
//	EscapeEncodingData.
//
// Results:
//	Returns TCL_OK if conversion was successful.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func sEscapeFromUtfProc(tls *libc.TLS, clientData ClientData, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) int32 { /* tclEncoding.c:3324:1: */
	bp := tls.Alloc(2)
	defer tls.Free(2)

	var dataPtr uintptr = clientData
	var encodingPtr uintptr
	var srcStart uintptr
	var srcEnd uintptr
	var srcClose uintptr
	var dstStart uintptr
	var dstEnd uintptr
	var state int32
	var result int32
	var numChars int32
	var tableDataPtr uintptr
	var tablePrefixBytes uintptr
	var tableFromUnicode uintptr
	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)) = Tcl_UniChar(0)

	result = TCL_OK

	srcStart = src
	srcEnd = src + uintptr(srcLen)
	srcClose = srcEnd
	if flags&TCL_ENCODING_END == 0 {
		srcClose -= uintptr(TCL_UTF_MAX)
	}

	dstStart = dst
	dstEnd = dst + uintptr(dstLen) - uintptr(1)

	// RFC 1468 states that the text starts in ASCII, and switches to Japanese
	// characters, and that the text must end in ASCII. [Patch 474358]

	if flags&TCL_ENCODING_START != 0 {
		state = 0
		if dst+uintptr((*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen) > dstEnd {
			*(*int32)(unsafe.Pointer(srcReadPtr)) = 0
			*(*int32)(unsafe.Pointer(dstWrotePtr)) = 0
			return -4
		}
		libc.Xmemcpy(tls, dst, dataPtr+8, uint64((*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen))
		dst += uintptr((*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen)
	} else {
		state = int32(*(*Tcl_EncodingState)(unsafe.Pointer(statePtr)))
	}

	encodingPtr = sGetTableEncoding(tls, dataPtr, state)
	tableDataPtr = (*Encoding)(unsafe.Pointer(encodingPtr)).FclientData
	tablePrefixBytes = tableDataPtr + 4 /* &.prefixBytes */
	tableFromUnicode = (*TableEncodingData)(unsafe.Pointer(tableDataPtr)).FfromUnicode

	for numChars = 0; src < srcEnd; numChars++ {
		var len uint32
		var word int32

		if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int32((int64(srcEnd)-int64(src))/1)) != 0) {
			// If there is more string to follow, this will ensure that the
			// last UTF-8 character in the source buffer hasn't been cut off.

			result = -1
			break
		}
		len = func() uint32 {
			if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 {
				return uint32(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
					return 1
				}())
			}
			return uint32(XTcl_UtfToUniChar(tls, src, bp))
		}()
		word = int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tableFromUnicode + uintptr(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp)))>>8)*8)) + uintptr(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp)))&0xFF)*2)))

		if word == 0 && int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) != 0 {
			var oldState int32
			var subTablePtr uintptr

			oldState = state
			for state = 0; state < (*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables; state++ {
				encodingPtr = sGetTableEncoding(tls, dataPtr, state)
				tableDataPtr = (*Encoding)(unsafe.Pointer(encodingPtr)).FclientData
				word = int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TableEncodingData)(unsafe.Pointer(tableDataPtr)).FfromUnicode + uintptr(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp)))>>8)*8)) + uintptr(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp)))&0xFF)*2)))
				if word != 0 {
					break
				}
			}

			if word == 0 {
				state = oldState
				if flags&TCL_ENCODING_STOPONERROR != 0 {
					result = -3
					break
				}
				encodingPtr = sGetTableEncoding(tls, dataPtr, state)
				tableDataPtr = (*Encoding)(unsafe.Pointer(encodingPtr)).FclientData
				word = (*TableEncodingData)(unsafe.Pointer(tableDataPtr)).Ffallback
			}

			tablePrefixBytes = tableDataPtr + 4 /* &.prefixBytes */
			tableFromUnicode = (*TableEncodingData)(unsafe.Pointer(tableDataPtr)).FfromUnicode

			// The state variable has the value of oldState when word is 0.
			// In this case, the escape sequence should not be copied to dst
			// because the current character set is not changed.

			if state != oldState {
				subTablePtr = dataPtr + 304 + uintptr(state)*64
				if dst+uintptr((*EscapeSubTable)(unsafe.Pointer(subTablePtr)).FsequenceLen) > dstEnd {
					// If there is no space to write the escape sequence, the
					// state variable must be changed to the value of oldState
					// variable because this escape sequence must be written
					// in the next conversion.

					state = oldState
					result = -4
					break
				}
				libc.Xmemcpy(tls, dst, subTablePtr+4,
					uint64((*EscapeSubTable)(unsafe.Pointer(subTablePtr)).FsequenceLen))
				dst += uintptr((*EscapeSubTable)(unsafe.Pointer(subTablePtr)).FsequenceLen)
			}
		}

		if int32(*(*int8)(unsafe.Pointer(tablePrefixBytes + uintptr(word>>8)))) != 0 {
			if dst+uintptr(1) > dstEnd {
				result = -4
				break
			}
			*(*int8)(unsafe.Pointer(dst)) = int8(word >> 8)
			*(*int8)(unsafe.Pointer(dst + 1)) = int8(word)
			dst += uintptr(2)
		} else {
			if dst > dstEnd {
				result = -4
				break
			}
			*(*int8)(unsafe.Pointer(dst)) = int8(word)
			dst++
		}
		src += uintptr(len)
	}

	if result == TCL_OK && flags&TCL_ENCODING_END != 0 {
		var len uint32 = (*EscapeSubTable)(unsafe.Pointer(dataPtr + 304)).FsequenceLen

		// Certain encodings like iso2022-jp need to write an escape sequence
		// after all characters have been converted. This logic checks that
		// enough room is available in the buffer for the escape bytes. The
		// TCL_ENCODING_END flag is cleared after a final escape sequence has
		// been added to the buffer so that another call to this method does
		// not attempt to append escape bytes a second time.

		if dst+uintptr((*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen)+uintptr(func() uint32 {
			if state != 0 {
				return len
			}
			return uint32(0)
		}()) > dstEnd {
			result = -4
		} else {
			if state != 0 {
				libc.Xmemcpy(tls, dst, dataPtr+304+4, uint64(len))
				dst += uintptr(len)
			}
			libc.Xmemcpy(tls, dst, dataPtr+28, uint64((*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen))
			dst += uintptr((*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen)
			state = state & libc.CplInt32(TCL_ENCODING_END)
		}
	}

	*(*Tcl_EncodingState)(unsafe.Pointer(statePtr)) = uintptr(Intptr_t(state))
	*(*int32)(unsafe.Pointer(srcReadPtr)) = int32((int64(src) - int64(srcStart)) / 1)
	*(*int32)(unsafe.Pointer(dstWrotePtr)) = int32((int64(dst) - int64(dstStart)) / 1)
	*(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars
	return result
}

//---------------------------------------------------------------------------
//
// EscapeFreeProc --
//
//	Frees resources used by the encoding.
//
// Results:
//	None.
//
// Side effects:
//	Memory is freed.
//
//---------------------------------------------------------------------------

func sEscapeFreeProc(tls *libc.TLS, clientData ClientData) { /* tclEncoding.c:3536:1: */
	var dataPtr uintptr = clientData
	var subTablePtr uintptr
	var i int32

	if dataPtr == uintptr(0) {
		return
	}

	// The subTables should be freed recursively in normal operation but not
	// during TclFinalizeEncodingSubsystem because they are also present as a
	// weak reference in the toplevel encodingTable (i.e., they don't have a
	// +1 refcount for this), and unpredictable nuking order could remove them
	// from under the following loop's feet. [Bug 2891556]
	//
	// The encodingsInitialized flag, being reset on entry to TFES, can serve
	// as a "not in finalization" test.

	if encodingsInitialized != 0 {
		subTablePtr = dataPtr + 304 /* &.subTables */
		for i = 0; i < (*EscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables; i++ {
			sFreeEncoding(tls, (*EscapeSubTable)(unsafe.Pointer(subTablePtr)).FencodingPtr)
			(*EscapeSubTable)(unsafe.Pointer(subTablePtr)).FencodingPtr = uintptr(0)
			subTablePtr += 64
		}
	}
	XTclpFree(tls, dataPtr)
}

//---------------------------------------------------------------------------
//
// GetTableEncoding --
//
//	Helper function for the EscapeEncodingData conversions. Gets the
//	encoding (of type TextEncodingData) that represents the specified
//	state.
//
// Results:
//	The return value is the encoding.
//
// Side effects:
//	If the encoding that represents the specified state has not already
//	been used by this EscapeEncoding, it will be loaded and cached in the
//	dataPtr.
//
//---------------------------------------------------------------------------

func sGetTableEncoding(tls *libc.TLS, dataPtr uintptr, state int32) uintptr { /* tclEncoding.c:3590:17: */
	var subTablePtr uintptr = dataPtr + 304 + uintptr(state)*64
	var encodingPtr uintptr = (*EscapeSubTable)(unsafe.Pointer(subTablePtr)).FencodingPtr

	if encodingPtr == uintptr(0) {
		encodingPtr = XTcl_GetEncoding(tls, uintptr(0), subTablePtr+20)
		if encodingPtr == uintptr(0) ||
			(*Encoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc != *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
			}{sTableToUtfProc})) &&
				(*Encoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc != *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
				}{sIso88591ToUtfProc})) {
			XTcl_Panic(tls, ts+26073, 0)
		}
		(*EscapeSubTable)(unsafe.Pointer(subTablePtr)).FencodingPtr = encodingPtr
	}

	return encodingPtr
}

//---------------------------------------------------------------------------
//
// unilen --
//
//	A helper function for the Tcl_ExternalToUtf functions. This function
//	is similar to strlen for double-byte characters: it returns the number
//	of bytes in a 0x0000 terminated string.
//
// Results:
//	As above.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func unilen(tls *libc.TLS, src uintptr) Size_t { /* tclEncoding.c:3630:1: */
	var p uintptr

	p = src
	for int32(*(*uint16)(unsafe.Pointer(p))) != 0x0000 {
		p += 2
	}
	return Size_t((int64(p) - int64(src)) / 1)
}

//-------------------------------------------------------------------------
//
// InitializeEncodingSearchPath	--
//
//	This is the fallback routine that sets the default value of the
//	encoding search path if the application has not set one via a call to
//	Tcl_SetEncodingSearchPath() by the first time the search path is needed
//	to load encoding data.
//
//	The default encoding search path is produced by taking each directory
//	in the library path, appending a subdirectory named "encoding", and if
//	the resulting directory exists, adding it to the encoding search path.
//
// Results:
//	None.
//
// Side effects:
//	Sets the encoding search path to an initial value.
//
//-------------------------------------------------------------------------

func sInitializeEncodingSearchPath(tls *libc.TLS, valuePtr uintptr, lengthPtr uintptr, encodingPtr uintptr) { /* tclEncoding.c:3666:1: */
	bp := tls.Alloc(172)
	defer tls.Free(172)

	var bytes uintptr
	var i int32
	// var numDirs int32 at bp, 4

	// var numBytes int32 at bp+168, 4

	var libPathObj uintptr
	// var encodingObj uintptr at bp+16, 8

	var searchPathObj uintptr

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				*(*uintptr)(unsafe.Pointer(bp + 16)) = XTclThreadAllocObj(tls)
			} else {
				*(*uintptr)(unsafe.Pointer(bp + 16)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes, ts+11665, uint64(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes + 8)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = int32(uint64(unsafe.Sizeof([9]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr = uintptr(0)
		{
		}
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			searchPathObj = XTclThreadAllocObj(tls)
		} else {
			searchPathObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(searchPathObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(searchPathObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(searchPathObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(searchPathObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(searchPathObj)).FtypePtr = uintptr(0)
	{
	}

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(searchPathObj)).FrefCount++
	libPathObj = XTclGetLibraryPath(tls)
	(*Tcl_Obj)(unsafe.Pointer(libPathObj)).FrefCount++
	XTcl_ListObjLength(tls, uintptr(0), libPathObj, bp)

	for i = 0; i < *(*int32)(unsafe.Pointer(bp /* numDirs */)); i++ {
		// var directoryObj uintptr at bp+8, 8

		var pathObj uintptr
		// var stat Tcl_StatBuf at bp+24, 144

		XTcl_ListObjIndex(tls, uintptr(0), libPathObj, i, bp+8)
		pathObj = XTcl_FSJoinToPath(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* directoryObj */)), 1, bp+16)
		(*Tcl_Obj)(unsafe.Pointer(pathObj)).FrefCount++
		if 0 == XTcl_FSStat(tls, pathObj, bp+24) && (*Tcl_StatBuf)(unsafe.Pointer(bp+24)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000) {
			XTcl_ListObjAppendElement(tls, uintptr(0), searchPathObj, pathObj)
		}
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = pathObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	for ok4 := true; ok4; ok4 = 0 != 0 {
		var _objPtr uintptr = libPathObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok5 := true; ok5; ok5 = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 16))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	*(*Tcl_Encoding)(unsafe.Pointer(encodingPtr)) = libraryPath.Fencoding
	if *(*Tcl_Encoding)(unsafe.Pointer(encodingPtr)) != 0 {
		(*Encoding)(unsafe.Pointer(*(*Tcl_Encoding)(unsafe.Pointer(encodingPtr)))).FrefCount++
	}
	bytes = XTcl_GetStringFromObj(tls, searchPathObj, bp+168)

	*(*int32)(unsafe.Pointer(lengthPtr)) = *(*int32)(unsafe.Pointer(bp + 168 /* numBytes */))
	*(*uintptr)(unsafe.Pointer(valuePtr)) = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 168))+1))
	libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(valuePtr)), bytes, uint64(*(*int32)(unsafe.Pointer(bp + 168))+1))
	for ok6 := true; ok6; ok6 = 0 != 0 {
		var _objPtr uintptr = searchPathObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The lists of subcommands and options for the [namespace ensemble] command.

var ensembleSubcommands = [4]uintptr{
	ts + 26108, ts + 23142, ts + 12165, uintptr(0),
} /* tclEnsemble.c:50:19 */

var ensembleCreateOptions = [7]uintptr{
	ts + 15408, ts + 26118, ts + 26123, ts + 26135, ts + 26145,
	ts + 26158, uintptr(0),
} /* tclEnsemble.c:57:19 */

var ensembleConfigOptions = [7]uintptr{
	ts + 26118, ts + 26167, ts + 26123, ts + 26135, ts + 26145,
	ts + 26158, uintptr(0),
} /* tclEnsemble.c:65:19 */

// This structure defines a Tcl object type that contains a reference to an
// ensemble subcommand (e.g. the "length" in [string length ab]). It is used
// to cache the mapping between the subcommand itself and the real command
// that implements it.

var ensembleCmdType = Tcl_ObjType{
	Fname:           ts + 26178,
	FfreeIntRepProc: 0, // freeIntRepProc
	FdupIntRepProc:  0, // setFromAnyProc
} /* tclEnsemble.c:81:26 */

// The internal rep for caching ensemble subcommand lookups and
// spell corrections.

type EnsembleCmdRep = struct {
	Fepoch       int32
	F__ccgo_pad1 [4]byte
	Ftoken       uintptr
	Ffix         uintptr
	FhPtr        uintptr
} /* tclEnsemble.c:103:3 */

func sNewNsObj(tls *libc.TLS, namespacePtr uintptr) uintptr { /* tclEnsemble.c:106:23: */
	var nsPtr uintptr = namespacePtr

	if namespacePtr == (*Interp)(unsafe.Pointer((*Namespace)(unsafe.Pointer(nsPtr)).Finterp)).FglobalNsPtr {
		return XTcl_NewStringObj(tls, ts+6847, 2)
	} else {
		return XTcl_NewStringObj(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FfullName, -1)
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// TclNamespaceEnsembleCmd --
//
//	Invoked to implement the "namespace ensemble" command that creates and
//	manipulates ensembles built on top of namespaces. Handles the
//	following syntax:
//
//	    namespace ensemble name ?dictionary?
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Creates the ensemble for the namespace if one did not previously
//	exist. Alternatively, alters the way that the ensemble's subcommand =>
//	implementation prefix is configured.
//
//----------------------------------------------------------------------

func XTclNamespaceEnsembleCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclEnsemble.c:142:1: */
	bp := tls.Alloc(380)
	defer tls.Free(380)

	// var namespacePtr uintptr at bp+280, 8

	var nsPtr uintptr
	var cxtPtr uintptr
	// var foundNsPtr uintptr at bp+240, 8

	// var altFoundNsPtr uintptr at bp+248, 8

	// var actualCxtPtr uintptr at bp+256, 8

	var token Tcl_Command
	// var search Tcl_DictSearch at bp+168, 24

	// var listObj uintptr at bp+200, 8

	// var simpleName uintptr at bp+264, 8

	// var index int32 at bp+160, 4

	// var done int32 at bp+208, 4

	var _objPtr uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var _objPtr3 uintptr
	var _objPtr4 uintptr
	var _objPtr5 uintptr
	var _objPtr6 uintptr
	var _objPtr7 uintptr
	var newList uintptr
	// var newCmd uintptr at bp+224, 8

	// var listv uintptr at bp+216, 8

	var cmd uintptr
	var _objPtr8 uintptr
	var patchedDict uintptr
	// var subcmdWordsObj uintptr at bp+192, 8

	var _objPtr9 uintptr
	var _objPtr10 uintptr
	var name uintptr
	// var len int32 at bp+164, 4

	var allocatedMapFlag int32
	// Defaults
	var subcmdObj uintptr
	var mapObj uintptr
	// var permitPrefix int32 at bp+232, 4

	var unknownObj uintptr
	var paramObj uintptr
	// var flags int32 at bp+288, 4

	// var resultObj uintptr at bp+272, 8

	var cachePtr uintptr
	// Produce list of all information.

	var resultObj1 uintptr
	// var tmpObj uintptr at bp+296, 8
	// silence gcc 4 warning
	// var flags1 int32 at bp+304, 4

	var _objPtr11 uintptr
	var _objPtr12 uintptr
	var _objPtr13 uintptr
	var newList1 uintptr
	// var newCmd1 uintptr at bp+368, 8

	var _objPtr14 uintptr
	var patchedDict1 uintptr
	// var subcmdWordsObj1 uintptr at bp+352, 8

	// var listv1 uintptr at bp+360, 8

	var cmd1 uintptr
	// var len1 int32 at bp+348, 4

	var allocatedMapFlag1 int32
	// var subcmdObj1 uintptr at bp+312, 8

	// var mapObj1 uintptr at bp+320, 8

	// var paramObj1 uintptr at bp+328, 8

	// var unknownObj1 uintptr at bp+336, 8
	// Defaults, silence gcc 4 warnings
	// var permitPrefix1 int32 at bp+376, 4

	// var flags2 int32 at bp+344, 4
	nsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr

	if !(nsPtr == uintptr(0) || (*Namespace)(unsafe.Pointer(nsPtr)).Fflags&NS_DYING != 0) {
		goto __1
	}
	if !!(XTcl_InterpDeleted(tls, interp) != 0) {
		goto __2
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+26194,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26253, uintptr(0)))
__2:
	;
	return TCL_ERROR
__1:
	;

	if !(objc < 2) {
		goto __3
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+26258)
	return TCL_ERROR
__3:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&ensembleSubcommands)), int32(unsafe.Sizeof(uintptr(0))), ts+21897, 0, bp+160) != TCL_OK) {
		goto __4
	}
	return TCL_ERROR
__4:
	;

	switch uint32(*(*int32)(unsafe.Pointer(bp + 160 /* index */))) {
	case ENS_CREATE:
		goto __6

	case ENS_EXISTS:
		goto __7

	case ENS_CONFIG:
		goto __8

	default:
		goto __9
	}
	goto __5
__6:
	allocatedMapFlag = 0
	// Defaults
	subcmdObj = uintptr(0)
	mapObj = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 232 /* permitPrefix */)) = 1
	unknownObj = uintptr(0)
	paramObj = uintptr(0)

	// Check that we've got option-value pairs... [Bug 1558654]

	if !(objc&1 != 0) {
		goto __10
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+26279)
	return TCL_ERROR
__10:
	;
	objv += 8 * uintptr(2)
	objc = objc - 2

	name = (*Namespace)(unsafe.Pointer(nsPtr)).Fname
	cxtPtr = (*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr

	// Parse the option list, applying type checks as we go. Note that we
	// are not incrementing any reference counts in the objects at this
	// stage, so the presence of an option multiple times won't cause any
	// memory leaks.

__11:
	if !(objc > 1) {
		goto __13
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), uintptr(unsafe.Pointer(&ensembleCreateOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+160) != TCL_OK) {
		goto __14
	}
	if !(allocatedMapFlag != 0) {
		goto __15
	}
__16:
	_objPtr = mapObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __19
	}
	XTclFreeObj(tls, _objPtr)
__19:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
__15:
	;
	return TCL_ERROR
__14:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 160 /* index */))) {
	case CRT_CMD:
		goto __21
	case CRT_SUBCMDS:
		goto __22
	case CRT_PARAM:
		goto __23
	case CRT_MAP:
		goto __24
	case CRT_PREFIX:
		goto __25
	case CRT_UNKNOWN:
		goto __26
	}
	goto __20
__21:
	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	cxtPtr = nsPtr
	goto __12
__22:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 164)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+164)
	}() != TCL_OK) {
		goto __27
	}
	if !(allocatedMapFlag != 0) {
		goto __28
	}
__29:
	_objPtr1 = mapObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __32
	}
	XTclFreeObj(tls, _objPtr1)
__32:
	;
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
__28:
	;
	return TCL_ERROR
__27:
	;
	subcmdObj = func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 164)) > 0 {
			return *(*uintptr)(unsafe.Pointer(objv + 1*8))
		}
		return uintptr(0)
	}()
	goto __12
__23:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 164)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+164)
	}() != TCL_OK) {
		goto __33
	}
	if !(allocatedMapFlag != 0) {
		goto __34
	}
__35:
	_objPtr2 = mapObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __38
	}
	XTclFreeObj(tls, _objPtr2)
__38:
	;
	goto __36
__36:
	if 0 != 0 {
		goto __35
	}
	goto __37
__37:
	;
__34:
	;
	return TCL_ERROR
__33:
	;
	paramObj = func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 164)) > 0 {
			return *(*uintptr)(unsafe.Pointer(objv + 1*8))
		}
		return uintptr(0)
	}()
	goto __12
__24:
	patchedDict = uintptr(0)

	// Verify that the map is sensible.

	if !(XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+168,
		bp+192, bp+200, bp+208) != TCL_OK) {
		goto __39
	}
	if !(allocatedMapFlag != 0) {
		goto __40
	}
__41:
	_objPtr3 = mapObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __44
	}
	XTclFreeObj(tls, _objPtr3)
__44:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
__40:
	;
	return TCL_ERROR
__39:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 208)) != 0) {
		goto __45
	}
	mapObj = uintptr(0)
	goto __12
__45:
	;
__46:

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 216)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 164)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 200)), bp+164, bp+216)
	}() != TCL_OK) {
		goto __49
	}
	XTcl_DictObjDone(tls, bp+168)
	if !(patchedDict != 0) {
		goto __50
	}
__51:
	_objPtr4 = patchedDict
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __54
	}
	XTclFreeObj(tls, _objPtr4)
__54:
	;
	goto __52
__52:
	if 0 != 0 {
		goto __51
	}
	goto __53
__53:
	;
__50:
	;
	if !(allocatedMapFlag != 0) {
		goto __55
	}
__56:
	_objPtr5 = mapObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __59
	}
	XTclFreeObj(tls, _objPtr5)
__59:
	;
	goto __57
__57:
	if 0 != 0 {
		goto __56
	}
	goto __58
__58:
	;
__55:
	;
	return TCL_ERROR
__49:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 164)) < 1) {
		goto __60
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+26298, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+26244,
		ts+26358, uintptr(0)))
	XTcl_DictObjDone(tls, bp+168)
	if !(patchedDict != 0) {
		goto __61
	}
__62:
	_objPtr6 = patchedDict
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr6)).FrefCount, 1) <= 1) {
		goto __65
	}
	XTclFreeObj(tls, _objPtr6)
__65:
	;
	goto __63
__63:
	if 0 != 0 {
		goto __62
	}
	goto __64
__64:
	;
__61:
	;
	if !(allocatedMapFlag != 0) {
		goto __66
	}
__67:
	_objPtr7 = mapObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr7)).FrefCount, 1) <= 1) {
		goto __70
	}
	XTclFreeObj(tls, _objPtr7)
__70:
	;
	goto __68
__68:
	if 0 != 0 {
		goto __67
	}
	goto __69
__69:
	;
__66:
	;
	return TCL_ERROR
__60:
	;
	cmd = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))))
	}()
	if !!(int32(*(*int8)(unsafe.Pointer(cmd))) == ':' && int32(*(*int8)(unsafe.Pointer(cmd + 1))) == ':') {
		goto __71
	}
	newList = XTcl_NewListObj(tls, *(*int32)(unsafe.Pointer(bp + 164 /* len */)), *(*uintptr)(unsafe.Pointer(bp + 216 /* listv */)))
	*(*uintptr)(unsafe.Pointer(bp + 224 /* newCmd */)) = sNewNsObj(tls, nsPtr)

	if !((*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr != 0) {
		goto __72
	}
	XTcl_AppendStringsToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 224 /* newCmd */)), libc.VaList(bp+64, ts+6847, uintptr(0)))
__72:
	;
	XTcl_AppendObjToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 224 /* newCmd */)), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 /* listv */)))))
	XTcl_ListObjReplace(tls, uintptr(0), newList, 0, 1, 1, bp+224)
	if !(patchedDict == uintptr(0)) {
		goto __73
	}
	patchedDict = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
__73:
	;
	XTcl_DictObjPut(tls, uintptr(0), patchedDict, *(*uintptr)(unsafe.Pointer(bp + 192 /* subcmdWordsObj */)),
		newList)
__71:
	;
	XTcl_DictObjNext(tls, bp+168, bp+192, bp+200, bp+208)
	goto __47
__47:
	if !(*(*int32)(unsafe.Pointer(bp + 208)) != 0) {
		goto __46
	}
	goto __48
__48:
	;

	if !(allocatedMapFlag != 0) {
		goto __74
	}
__75:
	_objPtr8 = mapObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr8)).FrefCount, 1) <= 1) {
		goto __78
	}
	XTclFreeObj(tls, _objPtr8)
__78:
	;
	goto __76
__76:
	if 0 != 0 {
		goto __75
	}
	goto __77
__77:
	;
__74:
	;
	mapObj = func() uintptr {
		if patchedDict != 0 {
			return patchedDict
		}
		return *(*uintptr)(unsafe.Pointer(objv + 1*8))
	}()
	if !(patchedDict != 0) {
		goto __79
	}
	allocatedMapFlag = 1
__79:
	;
	goto __12

__25:
	if !(XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)),
		bp+232) != TCL_OK) {
		goto __80
	}
	if !(allocatedMapFlag != 0) {
		goto __81
	}
__82:
	_objPtr9 = mapObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr9)).FrefCount, 1) <= 1) {
		goto __85
	}
	XTclFreeObj(tls, _objPtr9)
__85:
	;
	goto __83
__83:
	if 0 != 0 {
		goto __82
	}
	goto __84
__84:
	;
__81:
	;
	return TCL_ERROR
__80:
	;
	goto __12
__26:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 164)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+164)
	}() != TCL_OK) {
		goto __86
	}
	if !(allocatedMapFlag != 0) {
		goto __87
	}
__88:
	_objPtr10 = mapObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr10)).FrefCount, 1) <= 1) {
		goto __91
	}
	XTclFreeObj(tls, _objPtr10)
__91:
	;
	goto __89
__89:
	if 0 != 0 {
		goto __88
	}
	goto __90
__90:
	;
__87:
	;
	return TCL_ERROR
__86:
	;
	unknownObj = func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 164)) > 0 {
			return *(*uintptr)(unsafe.Pointer(objv + 1*8))
		}
		return uintptr(0)
	}()
	goto __12
__20:
	;
	goto __12
__12:
	objc = objc - 2
	objv += 8 * uintptr(2)
	goto __11
	goto __13
__13:
	;

	XTclGetNamespaceForQualName(tls, interp, name, cxtPtr,
		TCL_CREATE_NS_IF_UNKNOWN, bp+240, bp+248, bp+256,
		bp+264)

	// Create the ensemble. Note that this might delete another ensemble
	// linked to the same namespace, so we must be careful. However, we
	// should be OK because we only link the namespace into the list once
	// we've created it (and after any deletions have occurred.)

	token = XTclCreateEnsembleInNs(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 264 /* simpleName */)),
		*(*uintptr)(unsafe.Pointer(bp + 240 /* foundNsPtr */)), nsPtr,
		func() int32 {
			if *(*int32)(unsafe.Pointer(bp + 232)) != 0 {
				return TCL_ENSEMBLE_PREFIX
			}
			return 0
		}())
	XTcl_SetEnsembleSubcommandList(tls, interp, token, subcmdObj)
	XTcl_SetEnsembleMappingDict(tls, interp, token, mapObj)
	XTcl_SetEnsembleUnknownHandler(tls, interp, token, unknownObj)
	XTcl_SetEnsembleParameterList(tls, interp, token, paramObj)

	// Tricky! Must ensure that the result is not shared (command delete
	// traces could have corrupted the pristine object that we started
	// with). [Snit test rename-1.5]

	XTcl_ResetResult(tls, interp)
	XTcl_GetCommandFullName(tls, interp, token, XTcl_GetObjResult(tls, interp))
	return TCL_OK

__7:
	if !(objc != 3) {
		goto __92
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+26371)
	return TCL_ERROR
__92:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(libc.Bool32(XTcl_FindEnsemble(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), 0) != uintptr(0)) != 0)))
	return TCL_OK

__8:
	if !(objc < 3 || objc != 4 && !(objc&1 != 0)) {
		goto __93
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv,
		ts+26379)
	return TCL_ERROR
__93:
	;
	token = XTcl_FindEnsemble(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), TCL_LEAVE_ERR_MSG)
	if !(token == uintptr(0)) {
		goto __94
	}
	return TCL_ERROR
__94:
	;

	if !(objc == 4) {
		goto __95
	}
	*(*uintptr)(unsafe.Pointer(bp + 272 /* resultObj */)) = uintptr(0) // silence gcc 4 warning

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), uintptr(unsafe.Pointer(&ensembleConfigOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+160) != TCL_OK) {
		goto __97
	}
	return TCL_ERROR
__97:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 160 /* index */))) {
	case CONF_SUBCMDS:
		goto __99
	case CONF_PARAM:
		goto __100
	case CONF_MAP:
		goto __101
	case CONF_NAMESPACE:
		goto __102
	case CONF_PREFIX:
		goto __103
	case CONF_UNKNOWN:
		goto __104
	}
	goto __98
__99:
	XTcl_GetEnsembleSubcommandList(tls, uintptr(0), token, bp+272)
	if !(*(*uintptr)(unsafe.Pointer(bp + 272)) != uintptr(0)) {
		goto __105
	}
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 272 /* resultObj */)))
__105:
	;
	goto __98
__100:
	XTcl_GetEnsembleParameterList(tls, uintptr(0), token, bp+272)
	if !(*(*uintptr)(unsafe.Pointer(bp + 272)) != uintptr(0)) {
		goto __106
	}
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 272 /* resultObj */)))
__106:
	;
	goto __98
__101:
	XTcl_GetEnsembleMappingDict(tls, uintptr(0), token, bp+272)
	if !(*(*uintptr)(unsafe.Pointer(bp + 272)) != uintptr(0)) {
		goto __107
	}
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 272 /* resultObj */)))
__107:
	;
	goto __98
__102:
	*(*uintptr)(unsafe.Pointer(bp + 280 /* namespacePtr */)) = uintptr(0) // silence gcc 4 warning
	XTcl_GetEnsembleNamespace(tls, uintptr(0), token, bp+280)
	XTcl_SetObjResult(tls, interp, sNewNsObj(tls, *(*uintptr)(unsafe.Pointer(bp + 280 /* namespacePtr */))))
	goto __98
__103:
	*(*int32)(unsafe.Pointer(bp + 288 /* flags */)) = 0 // silence gcc 4 warning

	XTcl_GetEnsembleFlags(tls, uintptr(0), token, bp+288)
	XTcl_SetObjResult(tls, interp,
		XTcl_NewIntObj(tls, libc.Bool32(*(*int32)(unsafe.Pointer(bp + 288))&TCL_ENSEMBLE_PREFIX != 0)))
	goto __98

__104:
	XTcl_GetEnsembleUnknownHandler(tls, uintptr(0), token, bp+272)
	if !(*(*uintptr)(unsafe.Pointer(bp + 272)) != uintptr(0)) {
		goto __108
	}
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 272 /* resultObj */)))
__108:
	;
	goto __98
__98:
	;
	goto __96
__95:
	if !(objc == 3) {
		goto __109
	}
	*(*uintptr)(unsafe.Pointer(bp + 296 /* tmpObj */)) = uintptr(0) // silence gcc 4 warning
	*(*int32)(unsafe.Pointer(bp + 304 /* flags1 */)) = 0            // silence gcc 4 warning

__111:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __114
	}
	resultObj1 = XTclThreadAllocObj(tls)
	goto __115
__114:
	resultObj1 = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj1 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__115:
	;
	goto __112
__112:
	if 0 != 0 {
		goto __111
	}
	goto __113
__113:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj1)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj1)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultObj1)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj1)).FtypePtr = uintptr(0)

	// -map option
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		XTcl_NewStringObj(tls, ensembleConfigOptions[CONF_MAP], -1))
	XTcl_GetEnsembleMappingDict(tls, uintptr(0), token, bp+296)
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		func() uintptr {
			if *(*uintptr)(unsafe.Pointer(bp + 296)) != uintptr(0) {
				return *(*uintptr)(unsafe.Pointer(bp + 296 /* tmpObj */))
			}
			return XTcl_NewObj(tls)
		}())

	// -namespace option
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		XTcl_NewStringObj(tls, ensembleConfigOptions[CONF_NAMESPACE],
			-1))
	*(*uintptr)(unsafe.Pointer(bp + 280 /* namespacePtr */)) = uintptr(0) // silence gcc 4 warning
	XTcl_GetEnsembleNamespace(tls, uintptr(0), token, bp+280)
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1, sNewNsObj(tls, *(*uintptr)(unsafe.Pointer(bp + 280 /* namespacePtr */))))

	// -parameters option
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		XTcl_NewStringObj(tls, ensembleConfigOptions[CONF_PARAM], -1))
	XTcl_GetEnsembleParameterList(tls, uintptr(0), token, bp+296)
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		func() uintptr {
			if *(*uintptr)(unsafe.Pointer(bp + 296)) != uintptr(0) {
				return *(*uintptr)(unsafe.Pointer(bp + 296 /* tmpObj */))
			}
			return XTcl_NewObj(tls)
		}())

	// -prefix option
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		XTcl_NewStringObj(tls, ensembleConfigOptions[CONF_PREFIX], -1))
	XTcl_GetEnsembleFlags(tls, uintptr(0), token, bp+304)
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		XTcl_NewIntObj(tls, libc.Bool32(*(*int32)(unsafe.Pointer(bp + 304))&TCL_ENSEMBLE_PREFIX != 0)))

	// -subcommands option
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		XTcl_NewStringObj(tls, ensembleConfigOptions[CONF_SUBCMDS], -1))
	XTcl_GetEnsembleSubcommandList(tls, uintptr(0), token, bp+296)
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		func() uintptr {
			if *(*uintptr)(unsafe.Pointer(bp + 296)) != uintptr(0) {
				return *(*uintptr)(unsafe.Pointer(bp + 296 /* tmpObj */))
			}
			return XTcl_NewObj(tls)
		}())

	// -unknown option
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		XTcl_NewStringObj(tls, ensembleConfigOptions[CONF_UNKNOWN], -1))
	XTcl_GetEnsembleUnknownHandler(tls, uintptr(0), token, bp+296)
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		func() uintptr {
			if *(*uintptr)(unsafe.Pointer(bp + 296)) != uintptr(0) {
				return *(*uintptr)(unsafe.Pointer(bp + 296 /* tmpObj */))
			}
			return XTcl_NewObj(tls)
		}())

	XTcl_SetObjResult(tls, interp, resultObj1)
	goto __110
__109:
	allocatedMapFlag1 = 0
	*(*uintptr)(unsafe.Pointer(bp + 312 /* subcmdObj1 */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 320 /* mapObj1 */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 328 /* paramObj1 */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 336 /* unknownObj1 */)) = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 344 /* flags2 */)) = 0 // silence gcc 4 warning

	XTcl_GetEnsembleSubcommandList(tls, uintptr(0), token, bp+312)
	XTcl_GetEnsembleMappingDict(tls, uintptr(0), token, bp+320)
	XTcl_GetEnsembleParameterList(tls, uintptr(0), token, bp+328)
	XTcl_GetEnsembleUnknownHandler(tls, uintptr(0), token, bp+336)
	XTcl_GetEnsembleFlags(tls, uintptr(0), token, bp+344)
	*(*int32)(unsafe.Pointer(bp + 376 /* permitPrefix1 */)) = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 344))&TCL_ENSEMBLE_PREFIX != 0)

	objv += 8 * uintptr(3)
	objc = objc - 3

	// Parse the option list, applying type checks as we go. Note that
	// we are not incrementing any reference counts in the objects at
	// this stage, so the presence of an option multiple times won't
	// cause any memory leaks.

__116:
	if !(objc > 0) {
		goto __118
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), uintptr(unsafe.Pointer(&ensembleConfigOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+160) != TCL_OK) {
		goto __119
	}
freeMapAndError:
	if !(allocatedMapFlag1 != 0) {
		goto __120
	}
__121:
	_objPtr11 = *(*uintptr)(unsafe.Pointer(bp + 320))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr11)).FrefCount, 1) <= 1) {
		goto __124
	}
	XTclFreeObj(tls, _objPtr11)
__124:
	;
	goto __122
__122:
	if 0 != 0 {
		goto __121
	}
	goto __123
__123:
	;
__120:
	;
	return TCL_ERROR
__119:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 160 /* index */))) {
	case CONF_SUBCMDS:
		goto __126
	case CONF_PARAM:
		goto __127
	case CONF_MAP:
		goto __128
	case CONF_NAMESPACE:
		goto __129
	case CONF_PREFIX:
		goto __130
	case CONF_UNKNOWN:
		goto __131
	}
	goto __125
__126:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 348)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+348)
	}() != TCL_OK) {
		goto __132
	}
	goto freeMapAndError
__132:
	;
	*(*uintptr)(unsafe.Pointer(bp + 312 /* subcmdObj1 */)) = func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 348)) > 0 {
			return *(*uintptr)(unsafe.Pointer(objv + 1*8))
		}
		return uintptr(0)
	}()
	goto __117
__127:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 348)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+348)
	}() != TCL_OK) {
		goto __133
	}
	goto freeMapAndError
__133:
	;
	*(*uintptr)(unsafe.Pointer(bp + 328 /* paramObj1 */)) = func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 348)) > 0 {
			return *(*uintptr)(unsafe.Pointer(objv + 1*8))
		}
		return uintptr(0)
	}()
	goto __117
__128:
	patchedDict1 = uintptr(0)

	// Verify that the map is sensible.

	if !(XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+168,
		bp+352, bp+200, bp+208) != TCL_OK) {
		goto __134
	}
	goto freeMapAndError
__134:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 208)) != 0) {
		goto __135
	}
	*(*uintptr)(unsafe.Pointer(bp + 320 /* mapObj1 */)) = uintptr(0)
	goto __117
__135:
	;
__136:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 360)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 348)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 200)), bp+348, bp+360)
	}() != TCL_OK) {
		goto __139
	}
	XTcl_DictObjDone(tls, bp+168)
	if !(patchedDict1 != 0) {
		goto __140
	}
__141:
	_objPtr12 = patchedDict1
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr12)).FrefCount, 1) <= 1) {
		goto __144
	}
	XTclFreeObj(tls, _objPtr12)
__144:
	;
	goto __142
__142:
	if 0 != 0 {
		goto __141
	}
	goto __143
__143:
	;
__140:
	;
	goto freeMapAndError
__139:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 348)) < 1) {
		goto __145
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+26298, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, ts+3593, ts+26244,
		ts+26358, uintptr(0)))
	XTcl_DictObjDone(tls, bp+168)
	if !(patchedDict1 != 0) {
		goto __146
	}
__147:
	_objPtr13 = patchedDict1
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr13)).FrefCount, 1) <= 1) {
		goto __150
	}
	XTclFreeObj(tls, _objPtr13)
__150:
	;
	goto __148
__148:
	if 0 != 0 {
		goto __147
	}
	goto __149
__149:
	;
__146:
	;
	goto freeMapAndError
__145:
	;
	cmd1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))))
	}()
	if !!(int32(*(*int8)(unsafe.Pointer(cmd1))) == ':' && int32(*(*int8)(unsafe.Pointer(cmd1 + 1))) == ':') {
		goto __151
	}
	newList1 = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* listObj */)))
	*(*uintptr)(unsafe.Pointer(bp + 368 /* newCmd1 */)) = sNewNsObj(tls, nsPtr)

	if !((*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr != 0) {
		goto __152
	}
	XTcl_AppendStringsToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 368 /* newCmd1 */)), libc.VaList(bp+112, ts+6847, uintptr(0)))
__152:
	;
	XTcl_AppendObjToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 368 /* newCmd1 */)), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360 /* listv1 */)))))
	XTcl_ListObjReplace(tls, uintptr(0), newList1, 0, 1, 1, bp+368)
	if !(patchedDict1 == uintptr(0)) {
		goto __153
	}
	patchedDict1 = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
__153:
	;
	XTcl_DictObjPut(tls, uintptr(0), patchedDict1, *(*uintptr)(unsafe.Pointer(bp + 352 /* subcmdWordsObj1 */)),
		newList1)
__151:
	;
	XTcl_DictObjNext(tls, bp+168, bp+352, bp+200,
		bp+208)
	goto __137
__137:
	if !(*(*int32)(unsafe.Pointer(bp + 208)) != 0) {
		goto __136
	}
	goto __138
__138:
	;
	if !(allocatedMapFlag1 != 0) {
		goto __154
	}
__155:
	_objPtr14 = *(*uintptr)(unsafe.Pointer(bp + 320))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr14)).FrefCount, 1) <= 1) {
		goto __158
	}
	XTclFreeObj(tls, _objPtr14)
__158:
	;
	goto __156
__156:
	if 0 != 0 {
		goto __155
	}
	goto __157
__157:
	;
__154:
	;
	*(*uintptr)(unsafe.Pointer(bp + 320 /* mapObj1 */)) = func() uintptr {
		if patchedDict1 != 0 {
			return patchedDict1
		}
		return *(*uintptr)(unsafe.Pointer(objv + 1*8))
	}()
	if !(patchedDict1 != 0) {
		goto __159
	}
	allocatedMapFlag1 = 1
__159:
	;
	goto __117

__129:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+26417, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+128, ts+3593, ts+26244, ts+26448,
		uintptr(0)))
	goto freeMapAndError
__130:
	if !(XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)),
		bp+376) != TCL_OK) {
		goto __160
	}
	goto freeMapAndError
__160:
	;
	goto __117
__131:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 348)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+348)
	}() != TCL_OK) {
		goto __161
	}
	goto freeMapAndError
__161:
	;
	*(*uintptr)(unsafe.Pointer(bp + 336 /* unknownObj1 */)) = func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 348)) > 0 {
			return *(*uintptr)(unsafe.Pointer(objv + 1*8))
		}
		return uintptr(0)
	}()
	goto __117
__125:
	;
	goto __117
__117:
	objc = objc - 2
	objv += 8 * uintptr(2)
	goto __116
	goto __118
__118:
	;

	// Update the namespace now that we've finished the parsing stage.

	*(*int32)(unsafe.Pointer(bp + 344 /* flags2 */)) = func() int32 {
		if *(*int32)(unsafe.Pointer(bp + 376)) != 0 {
			return *(*int32)(unsafe.Pointer(bp + 344)) | TCL_ENSEMBLE_PREFIX
		}
		return *(*int32)(unsafe.Pointer(bp + 344)) & libc.CplInt32(TCL_ENSEMBLE_PREFIX)
	}()
	XTcl_SetEnsembleSubcommandList(tls, interp, token, *(*uintptr)(unsafe.Pointer(bp + 312 /* subcmdObj1 */)))
	XTcl_SetEnsembleMappingDict(tls, interp, token, *(*uintptr)(unsafe.Pointer(bp + 320 /* mapObj1 */)))
	XTcl_SetEnsembleParameterList(tls, interp, token, *(*uintptr)(unsafe.Pointer(bp + 328 /* paramObj1 */)))
	XTcl_SetEnsembleUnknownHandler(tls, interp, token, *(*uintptr)(unsafe.Pointer(bp + 336 /* unknownObj1 */)))
	XTcl_SetEnsembleFlags(tls, interp, token, *(*int32)(unsafe.Pointer(bp + 344 /* flags2 */)))
__110:
	;
__96:
	;
	return TCL_OK

__9:
	XTcl_Panic(tls, ts+26458, 0)
__5:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCreateEnsembleInNs --
//
//	Like Tcl_CreateEnsemble, but additionally accepts as an argument the
//	name of the namespace to create the command in.
//
//----------------------------------------------------------------------

func XTclCreateEnsembleInNs(tls *libc.TLS, interp uintptr, name uintptr, nameNsPtr uintptr, ensembleNsPtr uintptr, flags int32) Tcl_Command { /* tclEnsemble.c:651:1: */
	var nsPtr uintptr = ensembleNsPtr
	var ensemblePtr uintptr
	var token Tcl_Command

	ensemblePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(EnsembleConfig{})))
	token = XTclNRCreateCommandInNs(tls, interp, name,
		nameNsPtr, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sNsEnsembleImplementationCmd})),
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sNsEnsembleImplementationCmdNR})), ensemblePtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteEnsembleConfig})))
	if token == uintptr(0) {
		XTclpFree(tls, ensemblePtr)
		return uintptr(0)
	}

	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr = nsPtr
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fepoch = 0
	XTcl_InitHashTable(tls, ensemblePtr+32, 0)
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr = uintptr(0)
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList = uintptr(0)
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict = uintptr(0)
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags = flags
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters = 0
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList = uintptr(0)
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler = uintptr(0)
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken = token
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fnext = (*Namespace)(unsafe.Pointer(nsPtr)).Fensembles
	(*Namespace)(unsafe.Pointer(nsPtr)).Fensembles = ensemblePtr

	// Trigger an eventual recomputation of the ensemble command set. Note
	// that this is slightly tricky, as it means that we are not actually
	// counting the number of namespace export actions, but it is the simplest
	// way to go!

	(*Namespace)(unsafe.Pointer(nsPtr)).FexportLookupEpoch++

	if flags&ENSEMBLE_COMPILE != 0 {
		(*Command)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken)).FcompileProc = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
		}{XTclCompileEnsemble}))
	}

	return (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken

}

//----------------------------------------------------------------------
//
// Tcl_CreateEnsemble
//
//	Create a simple ensemble attached to the given namespace.
//
//	Deprecated by TclCreateEnsembleInNs.
//
// Value
//
//	The token for the command created.
//
// Effect
//	The ensemble is created and marked for compilation.
//
//
//----------------------------------------------------------------------

func XTcl_CreateEnsemble(tls *libc.TLS, interp uintptr, name uintptr, namespacePtr uintptr, flags int32) Tcl_Command { /* tclEnsemble.c:729:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var nsPtr uintptr = namespacePtr
	// var foundNsPtr uintptr at bp, 8

	// var altNsPtr uintptr at bp+8, 8

	// var actualNsPtr uintptr at bp+16, 8

	// var simpleName uintptr at bp+24, 8

	if nsPtr == uintptr(0) {
		nsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	}

	XTclGetNamespaceForQualName(tls, interp, name, nsPtr, TCL_CREATE_NS_IF_UNKNOWN,
		bp, bp+8, bp+16, bp+24)
	return XTclCreateEnsembleInNs(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 24 /* simpleName */)),
		*(*uintptr)(unsafe.Pointer(bp /* foundNsPtr */)), nsPtr, flags)
}

//----------------------------------------------------------------------
//
// Tcl_SetEnsembleSubcommandList --
//
//	Set the subcommand list for a particular ensemble.
//
// Results:
//	Tcl result code (error if command token does not indicate an ensemble
//	or the subcommand list - if non-NULL - is not a list).
//
// Side effects:
//	The ensemble is updated and marked for recompilation.
//
//----------------------------------------------------------------------

func XTcl_SetEnsembleSubcommandList(tls *libc.TLS, interp uintptr, token Tcl_Command, subcmdList uintptr) int32 { /* tclEnsemble.c:768:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var cmdPtr uintptr = token
	var ensemblePtr uintptr
	var oldList uintptr

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+26486, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26513, uintptr(0)))
		return TCL_ERROR
	}
	if subcmdList != uintptr(0) {
		// var length int32 at bp+32, 4

		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(subcmdList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 32)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(subcmdList + 32)))).FelemCount
					return TCL_OK
				}()
			}
			return XTcl_ListObjLength(tls, interp, subcmdList, bp+32)
		}() != TCL_OK {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp + 32)) < 1 {
			subcmdList = uintptr(0)
		}
	}

	ensemblePtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	oldList = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList = subcmdList
	if subcmdList != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer(subcmdList)).FrefCount++
	}
	if oldList != uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldList)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(oldList)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldList)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(oldList)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldList)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldList)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(oldList)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, oldList)
					} else {
						*(*uintptr)(unsafe.Pointer(oldList + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldList
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, oldList)
			}
		}

	}

	// Trigger an eventual recomputation of the ensemble command set. Note
	// that this is slightly tricky, as it means that we are not actually
	// counting the number of namespace export actions, but it is the simplest
	// way to go!

	(*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch++

	// Special hack to make compiling of [info exists] work when the
	// dictionary is modified.

	if (*Command)(unsafe.Pointer(cmdPtr)).FcompileProc != uintptr(0) {
		(*Interp)(unsafe.Pointer(interp)).FcompileEpoch++
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_SetEnsembleParameterList --
//
//	Set the parameter list for a particular ensemble.
//
// Results:
//	Tcl result code (error if command token does not indicate an ensemble
//	or the parameter list - if non-NULL - is not a list).
//
// Side effects:
//	The ensemble is updated and marked for recompilation.
//
//----------------------------------------------------------------------

func XTcl_SetEnsembleParameterList(tls *libc.TLS, interp uintptr, token Tcl_Command, paramList uintptr) int32 { /* tclEnsemble.c:843:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var cmdPtr uintptr = token
	var ensemblePtr uintptr
	var oldList uintptr
	// var length int32 at bp+32, 4

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+26486, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26513, uintptr(0)))
		return TCL_ERROR
	}
	if paramList == uintptr(0) {
		*(*int32)(unsafe.Pointer(bp + 32 /* length */)) = 0
	} else {
		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(paramList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 32)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(paramList + 32)))).FelemCount
					return TCL_OK
				}()
			}
			return XTcl_ListObjLength(tls, interp, paramList, bp+32)
		}() != TCL_OK {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp + 32)) < 1 {
			paramList = uintptr(0)
		}
	}

	ensemblePtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	oldList = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList = paramList
	if paramList != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer(paramList)).FrefCount++
	}
	if oldList != uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldList)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(oldList)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldList)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(oldList)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldList)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldList)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(oldList)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, oldList)
					} else {
						*(*uintptr)(unsafe.Pointer(oldList + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldList
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, oldList)
			}
		}

	}
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters = *(*int32)(unsafe.Pointer(bp + 32 /* length */))

	// Trigger an eventual recomputation of the ensemble command set. Note
	// that this is slightly tricky, as it means that we are not actually
	// counting the number of namespace export actions, but it is the simplest
	// way to go!

	(*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch++

	// Special hack to make compiling of [info exists] work when the
	// dictionary is modified.

	if (*Command)(unsafe.Pointer(cmdPtr)).FcompileProc != uintptr(0) {
		(*Interp)(unsafe.Pointer(interp)).FcompileEpoch++
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_SetEnsembleMappingDict --
//
//	Set the mapping dictionary for a particular ensemble.
//
// Results:
//	Tcl result code (error if command token does not indicate an ensemble
//	or the mapping - if non-NULL - is not a dict).
//
// Side effects:
//	The ensemble is updated and marked for recompilation.
//
//----------------------------------------------------------------------

func XTcl_SetEnsembleMappingDict(tls *libc.TLS, interp uintptr, token Tcl_Command, mapDict uintptr) int32 { /* tclEnsemble.c:920:1: */
	bp := tls.Alloc(120)
	defer tls.Free(120)

	var cmdPtr uintptr = token
	var ensemblePtr uintptr
	var oldDict uintptr

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+26486, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26513, uintptr(0)))
		return TCL_ERROR
	}
	if mapDict != uintptr(0) {
		// var size int32 at bp+64, 4

		// var done int32 at bp+104, 4

		// var search Tcl_DictSearch at bp+72, 24

		// var valuePtr uintptr at bp+96, 8

		if XTcl_DictObjSize(tls, interp, mapDict, bp+64) != TCL_OK {
			return TCL_ERROR
		}

		for XTcl_DictObjFirst(tls, uintptr(0), mapDict, bp+72, uintptr(0), bp+96, bp+104); !(*(*int32)(unsafe.Pointer(bp + 104 /* done */)) != 0); XTcl_DictObjNext(tls, bp+72 /* &search */, uintptr(0), bp+96 /* &valuePtr */, bp+104 /* &done */) {
			// var cmdObjPtr uintptr at bp+112, 8

			var bytes uintptr

			if XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 96)), 0, bp+112) != TCL_OK {
				XTcl_DictObjDone(tls, bp+72)
				return TCL_ERROR
			}
			bytes = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 112)))
			}()
			if int32(*(*int8)(unsafe.Pointer(bytes))) != ':' || int32(*(*int8)(unsafe.Pointer(bytes + 1))) != ':' {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+26526,
					-1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+26244,
					ts+26575, uintptr(0)))
				XTcl_DictObjDone(tls, bp+72)
				return TCL_ERROR
			}
		}

		if *(*int32)(unsafe.Pointer(bp + 64)) < 1 {
			mapDict = uintptr(0)
		}
	}

	ensemblePtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	oldDict = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict = mapDict
	if mapDict != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer(mapDict)).FrefCount++
	}
	if oldDict != uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldDict)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(oldDict)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldDict)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(oldDict)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldDict)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldDict)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(oldDict)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, oldDict)
					} else {
						*(*uintptr)(unsafe.Pointer(oldDict + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldDict
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, oldDict)
			}
		}

	}

	// Trigger an eventual recomputation of the ensemble command set. Note
	// that this is slightly tricky, as it means that we are not actually
	// counting the number of namespace export actions, but it is the simplest
	// way to go!

	(*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch++

	// Special hack to make compiling of [info exists] work when the
	// dictionary is modified.

	if (*Command)(unsafe.Pointer(cmdPtr)).FcompileProc != uintptr(0) {
		(*Interp)(unsafe.Pointer(interp)).FcompileEpoch++
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_SetEnsembleUnknownHandler --
//
//	Set the unknown handler for a particular ensemble.
//
// Results:
//	Tcl result code (error if command token does not indicate an ensemble
//	or the unknown handler - if non-NULL - is not a list).
//
// Side effects:
//	The ensemble is updated and marked for recompilation.
//
//----------------------------------------------------------------------

func XTcl_SetEnsembleUnknownHandler(tls *libc.TLS, interp uintptr, token Tcl_Command, unknownList uintptr) int32 { /* tclEnsemble.c:1019:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var cmdPtr uintptr = token
	var ensemblePtr uintptr
	var oldList uintptr

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+26486, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26513, uintptr(0)))
		return TCL_ERROR
	}
	if unknownList != uintptr(0) {
		// var length int32 at bp+32, 4

		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(unknownList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 32)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(unknownList + 32)))).FelemCount
					return TCL_OK
				}()
			}
			return XTcl_ListObjLength(tls, interp, unknownList, bp+32)
		}() != TCL_OK {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp + 32)) < 1 {
			unknownList = uintptr(0)
		}
	}

	ensemblePtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	oldList = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler = unknownList
	if unknownList != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer(unknownList)).FrefCount++
	}
	if oldList != uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldList)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(oldList)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldList)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(oldList)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldList)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldList)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(oldList)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, oldList)
					} else {
						*(*uintptr)(unsafe.Pointer(oldList + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldList
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, oldList)
			}
		}

	}

	// Trigger an eventual recomputation of the ensemble command set. Note
	// that this is slightly tricky, as it means that we are not actually
	// counting the number of namespace export actions, but it is the simplest
	// way to go!

	(*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch++

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_SetEnsembleFlags --
//
//	Set the flags for a particular ensemble.
//
// Results:
//	Tcl result code (error if command token does not indicate an
//	ensemble).
//
// Side effects:
//	The ensemble is updated and marked for recompilation.
//
//----------------------------------------------------------------------

func XTcl_SetEnsembleFlags(tls *libc.TLS, interp uintptr, token Tcl_Command, flags int32) int32 { /* tclEnsemble.c:1085:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var cmdPtr uintptr = token
	var ensemblePtr uintptr
	var wasCompiled int32

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+26486, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26513, uintptr(0)))
		return TCL_ERROR
	}

	ensemblePtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	wasCompiled = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags & ENSEMBLE_COMPILE

	// This API refuses to set the ENSEMBLE_DEAD flag...

	*(*int32)(unsafe.Pointer(ensemblePtr + 128)) &= ENSEMBLE_DEAD
	*(*int32)(unsafe.Pointer(ensemblePtr + 128)) |= flags & libc.CplInt32(ENSEMBLE_DEAD)

	// Trigger an eventual recomputation of the ensemble command set. Note
	// that this is slightly tricky, as it means that we are not actually
	// counting the number of namespace export actions, but it is the simplest
	// way to go!

	(*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch++

	// If the ENSEMBLE_COMPILE flag status was changed, install or remove the
	// compiler function and bump the interpreter's compilation epoch so that
	// bytecode gets regenerated.

	if flags&ENSEMBLE_COMPILE != 0 {
		if !(wasCompiled != 0) {
			(*Command)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken)).FcompileProc = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
			}{XTclCompileEnsemble}))
			(*Interp)(unsafe.Pointer(interp)).FcompileEpoch++
		}
	} else {
		if wasCompiled != 0 {
			(*Command)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken)).FcompileProc = uintptr(0)
			(*Interp)(unsafe.Pointer(interp)).FcompileEpoch++
		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetEnsembleSubcommandList --
//
//	Get the list of subcommands associated with a particular ensemble.
//
// Results:
//	Tcl result code (error if command token does not indicate an
//	ensemble). The list of subcommands is returned by updating the
//	variable pointed to by the last parameter (NULL if this is to be
//	derived from the mapping dictionary or the associated namespace's
//	exported commands).
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func XTcl_GetEnsembleSubcommandList(tls *libc.TLS, interp uintptr, token Tcl_Command, subcmdListPtr uintptr) int32 { /* tclEnsemble.c:1162:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var cmdPtr uintptr = token
	var ensemblePtr uintptr

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+26486, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26513, uintptr(0)))
		}
		return TCL_ERROR
	}

	ensemblePtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	*(*uintptr)(unsafe.Pointer(subcmdListPtr)) = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetEnsembleParameterList --
//
//	Get the list of parameters associated with a particular ensemble.
//
// Results:
//	Tcl result code (error if command token does not indicate an
//	ensemble). The list of parameters is returned by updating the
//	variable pointed to by the last parameter (NULL if there are
//	no parameters).
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func XTcl_GetEnsembleParameterList(tls *libc.TLS, interp uintptr, token Tcl_Command, paramListPtr uintptr) int32 { /* tclEnsemble.c:1204:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var cmdPtr uintptr = token
	var ensemblePtr uintptr

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+26486, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26513, uintptr(0)))
		}
		return TCL_ERROR
	}

	ensemblePtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	*(*uintptr)(unsafe.Pointer(paramListPtr)) = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetEnsembleMappingDict --
//
//	Get the command mapping dictionary associated with a particular
//	ensemble.
//
// Results:
//	Tcl result code (error if command token does not indicate an
//	ensemble). The mapping dict is returned by updating the variable
//	pointed to by the last parameter (NULL if none is installed).
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func XTcl_GetEnsembleMappingDict(tls *libc.TLS, interp uintptr, token Tcl_Command, mapDictPtr uintptr) int32 { /* tclEnsemble.c:1246:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var cmdPtr uintptr = token
	var ensemblePtr uintptr

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+26486, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26513, uintptr(0)))
		}
		return TCL_ERROR
	}

	ensemblePtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	*(*uintptr)(unsafe.Pointer(mapDictPtr)) = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetEnsembleUnknownHandler --
//
//	Get the unknown handler associated with a particular ensemble.
//
// Results:
//	Tcl result code (error if command token does not indicate an
//	ensemble). The unknown handler is returned by updating the variable
//	pointed to by the last parameter (NULL if no handler is installed).
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func XTcl_GetEnsembleUnknownHandler(tls *libc.TLS, interp uintptr, token Tcl_Command, unknownListPtr uintptr) int32 { /* tclEnsemble.c:1287:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var cmdPtr uintptr = token
	var ensemblePtr uintptr

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+26486, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26513, uintptr(0)))
		}
		return TCL_ERROR
	}

	ensemblePtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	*(*uintptr)(unsafe.Pointer(unknownListPtr)) = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetEnsembleFlags --
//
//	Get the flags for a particular ensemble.
//
// Results:
//	Tcl result code (error if command token does not indicate an
//	ensemble). The flags are returned by updating the variable pointed to
//	by the last parameter.
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func XTcl_GetEnsembleFlags(tls *libc.TLS, interp uintptr, token Tcl_Command, flagsPtr uintptr) int32 { /* tclEnsemble.c:1328:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var cmdPtr uintptr = token
	var ensemblePtr uintptr

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+26486, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26513, uintptr(0)))
		}
		return TCL_ERROR
	}

	ensemblePtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	*(*int32)(unsafe.Pointer(flagsPtr)) = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetEnsembleNamespace --
//
//	Get the namespace associated with a particular ensemble.
//
// Results:
//	Tcl result code (error if command token does not indicate an
//	ensemble). Namespace is returned by updating the variable pointed to
//	by the last parameter.
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func XTcl_GetEnsembleNamespace(tls *libc.TLS, interp uintptr, token Tcl_Command, namespacePtrPtr uintptr) int32 { /* tclEnsemble.c:1369:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var cmdPtr uintptr = token
	var ensemblePtr uintptr

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+26486, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26513, uintptr(0)))
		}
		return TCL_ERROR
	}

	ensemblePtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	*(*uintptr)(unsafe.Pointer(namespacePtrPtr)) = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_FindEnsemble --
//
//	Given a command name, get the ensemble token for it, allowing for
//	[namespace import]s. [Bug 1017022]
//
// Results:
//	The token for the ensemble command with the given name, or NULL if the
//	command either does not exist or is not an ensemble (when an error
//	message will be written into the interp if thats non-NULL).
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func XTcl_FindEnsemble(tls *libc.TLS, interp uintptr, cmdNameObj uintptr, flags int32) Tcl_Command { /* tclEnsemble.c:1411:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var cmdPtr uintptr

	cmdPtr = XTcl_FindCommand(tls, interp, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes
		}
		return XTcl_GetString(tls, cmdNameObj)
	}(), uintptr(0), flags)
	if cmdPtr == uintptr(0) {
		return uintptr(0)
	}

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		// Reuse existing infrastructure for following import link chains
		// rather than duplicating it.

		cmdPtr = XTclGetOriginalCommand(tls, cmdPtr)

		if cmdPtr == uintptr(0) || (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sNsEnsembleImplementationCmd})) {
			if flags&TCL_LEAVE_ERR_MSG != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+26594,
					libc.VaList(bp, func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes
						}
						return XTcl_GetString(tls, cmdNameObj)
					}())))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+26244,
					func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes
						}
						return XTcl_GetString(tls, cmdNameObj)
					}(), uintptr(0)))
			}
			return uintptr(0)
		}
	}

	return cmdPtr
}

//----------------------------------------------------------------------
//
// Tcl_IsEnsemble --
//
//	Simple test for ensemble-hood that takes into account imported
//	ensemble commands as well.
//
// Results:
//	Boolean value
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func XTcl_IsEnsemble(tls *libc.TLS, token Tcl_Command) int32 { /* tclEnsemble.c:1468:1: */
	var cmdPtr uintptr = token

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc == *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		return 1
	}
	cmdPtr = XTclGetOriginalCommand(tls, cmdPtr)
	if cmdPtr == uintptr(0) || (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmd})) {
		return 0
	}
	return 1
}

//----------------------------------------------------------------------
//
// TclMakeEnsemble --
//
//	Create an ensemble from a table of implementation commands. The
//	ensemble will be subject to (limited) compilation if any of the
//	implementation commands are compilable.
//
//	The 'name' parameter may be a single command name or a list if
//	creating an ensemble subcommand (see the binary implementation).
//
//	Currently, the TCL_ENSEMBLE_PREFIX ensemble flag is only used on
//	top-level ensemble commands.
//
// Results:
//	Handle for the new ensemble, or NULL on failure.
//
// Side effects:
//	May advance the bytecode compilation epoch.
//
//----------------------------------------------------------------------

func XTclMakeEnsemble(tls *libc.TLS, interp uintptr, name uintptr, map1 uintptr) Tcl_Command { /* tclEnsemble.c:1508:1: */
	bp := tls.Alloc(472)
	defer tls.Free(472)

	var ensemble Tcl_Command
	var ns uintptr
	// var buf Tcl_DString at bp+24, 216

	// var hiddenBuf Tcl_DString at bp+240, 216

	*(*uintptr)(unsafe.Pointer(bp + 464 /* nameParts */)) = uintptr(0)
	var cmdName uintptr = uintptr(0)
	var i int32
	*(*int32)(unsafe.Pointer(bp + 456 /* nameCount */)) = 0
	var ensembleFlags int32 = 0
	var hiddenLen int32

	// Construct the path for the ensemble namespace and create it.

	XTcl_DStringInit(tls, bp+24)
	XTcl_DStringInit(tls, bp+240)
	XTcl_DStringAppend(tls, bp+240, ts+26626, int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)))
	XTcl_DStringAppend(tls, bp+240, name, -1)
	XTcl_DStringAppend(tls, bp+240, ts+18764, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
	hiddenLen = (*Tcl_DString)(unsafe.Pointer(bp + 240)).Flength
	if int32(*(*int8)(unsafe.Pointer(name))) == ':' && int32(*(*int8)(unsafe.Pointer(name + 1))) == ':' {
		// An absolute name, so use it directly.

		cmdName = name
		XTcl_DStringAppend(tls, bp+24, name, -1)
		ensembleFlags = TCL_ENSEMBLE_PREFIX
	} else {
		// Not an absolute name, so do munging of it. Note that this treats a
		// multi-word list differently to a single word.

		XTcl_DStringAppend(tls, bp+24, ts+20875, int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)))

		if XTcl_SplitList(tls, uintptr(0), name, bp+456, bp+464) != TCL_OK {
			XTcl_Panic(tls, ts+26631, libc.VaList(bp, name))
		}

		for i = 0; i < *(*int32)(unsafe.Pointer(bp + 456 /* nameCount */)); i++ {
			XTcl_DStringAppend(tls, bp+24, ts+6847, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
			XTcl_DStringAppend(tls, bp+24, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 464 /* nameParts */)) + uintptr(i)*8)), -1)
		}
	}

	ns = XTcl_FindNamespace(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp+24)).Fstring, uintptr(0),
		TCL_CREATE_NS_IF_UNKNOWN)
	if !(ns != 0) {
		XTcl_Panic(tls, ts+26658,
			libc.VaList(bp+8, (*Tcl_DString)(unsafe.Pointer(bp+24)).Fstring))
	}

	// Create the named ensemble in the correct namespace

	if cmdName == uintptr(0) {
		if *(*int32)(unsafe.Pointer(bp + 456)) == 1 {
			ensembleFlags = TCL_ENSEMBLE_PREFIX
			cmdName = (*Tcl_DString)(unsafe.Pointer(bp+24)).Fstring + uintptr(5)
		} else {
			ns = (*Tcl_Namespace)(unsafe.Pointer(ns)).FparentPtr
			cmdName = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 464 /* nameParts */)) + uintptr(*(*int32)(unsafe.Pointer(bp + 456))-1)*8))
		}
	}

	// Switch on compilation always for core ensembles now that we can do
	// nice bytecode things with them.  Do it now.  Waiting until later will
	// just cause pointless epoch bumps.

	ensembleFlags = ensembleFlags | ENSEMBLE_COMPILE
	ensemble = XTcl_CreateEnsemble(tls, interp, cmdName, ns, ensembleFlags)

	// Create the ensemble mapping dictionary and the ensemble command procs.

	if ensemble != uintptr(0) {
		var mapDict uintptr
		var fromObj uintptr
		var toObj uintptr
		var cmdPtr uintptr

		XTcl_DStringAppend(tls, bp+24, ts+6847, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				mapDict = XTclThreadAllocObj(tls)
			} else {
				mapDict = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(mapDict + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(mapDict)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(mapDict)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(mapDict)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(mapDict)).FtypePtr = uintptr(0)
		{
		}

		for i = 0; (*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).Fname != uintptr(0); i++ {
			fromObj = XTcl_NewStringObj(tls, (*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).Fname, -1)
			for ok1 := true; ok1; ok1 = 0 != 0 {
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						toObj = XTclThreadAllocObj(tls)
					} else {
						toObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(toObj + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(toObj)).FrefCount = 0
				if (*Tcl_DString)(unsafe.Pointer(bp+24)).Flength == 0 {
					(*Tcl_Obj)(unsafe.Pointer(toObj)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(toObj)).Flength = 0
				} else {
					(*Tcl_Obj)(unsafe.Pointer(toObj)).Fbytes = XTcl_Alloc(tls, uint32((*Tcl_DString)(unsafe.Pointer(bp+24)).Flength+1))
					libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(toObj)).Fbytes, (*Tcl_DString)(unsafe.Pointer(bp+24)).Fstring, uint64((*Tcl_DString)(unsafe.Pointer(bp+24)).Flength))
					*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(toObj)).Fbytes + uintptr((*Tcl_DString)(unsafe.Pointer(bp+24)).Flength))) = int8(0)
					(*Tcl_Obj)(unsafe.Pointer(toObj)).Flength = (*Tcl_DString)(unsafe.Pointer(bp + 24)).Flength
				}
				(*Tcl_Obj)(unsafe.Pointer(toObj)).FtypePtr = uintptr(0)
				{
				}
			}
			XTcl_AppendToObj(tls, toObj, (*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).Fname, -1)
			XTcl_DictObjPut(tls, uintptr(0), mapDict, fromObj, toObj)

			if (*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).Fproc != 0 || (*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).FnreProc != 0 {
				// If the command is unsafe, hide it when we're in a safe
				// interpreter. The code to do this is really hokey! It also
				// doesn't work properly yet; this function is always
				// currently called before the safe-interp flag is set so the
				// Tcl_IsSafe check fails.

				if (*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).Funsafe != 0 && XTcl_IsSafe(tls, interp) != 0 {
					cmdPtr = XTcl_NRCreateCommand(tls, interp, ts+11746, (*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).Fproc,
						(*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).FnreProc, (*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).FclientData, uintptr(0))
					XTcl_DStringSetLength(tls, bp+240, hiddenLen)
					if XTcl_HideCommand(tls, interp, ts+11746,
						XTcl_DStringAppend(tls, bp+240, (*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).Fname, -1)) != 0 {
						XTcl_Panic(tls, ts+6617, libc.VaList(bp+16, XTcl_GetString(tls, XTcl_GetObjResult(tls, interp))))
					}
				} else {
					// Not hidden, so just create it. Yay!

					cmdPtr = XTcl_NRCreateCommand(tls, interp, func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(toObj)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(toObj)).Fbytes
						}
						return XTcl_GetString(tls, toObj)
					}(),
						(*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).Fproc, (*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).FnreProc, (*EnsembleImplMap)(unsafe.Pointer(map1+uintptr(i)*48)).FclientData,
						uintptr(0))
				}
				(*Command)(unsafe.Pointer(cmdPtr)).FcompileProc = (*EnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48)).FcompileProc
			}
		}
		XTcl_SetEnsembleMappingDict(tls, interp, ensemble, mapDict)
	}

	XTcl_DStringFree(tls, bp+24)
	XTcl_DStringFree(tls, bp+240)
	if *(*uintptr)(unsafe.Pointer(bp + 464)) != uintptr(0) {
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 464)))
	}
	return ensemble
}

//----------------------------------------------------------------------
//
// NsEnsembleImplementationCmd --
//
//	Implements an ensemble of commands (being those exported by a
//	namespace other than the global namespace) as a command with the same
//	(short) name as the namespace in the parent namespace.
//
// Results:
//	A standard Tcl result code. Will be TCL_ERROR if the command is not an
//	unambiguous prefix of any command exported by the ensemble's
//	namespace.
//
// Side effects:
//	Depends on the command within the namespace that gets executed. If the
//	ensemble itself returns TCL_ERROR, a descriptive error message will be
//	placed in the interpreter's result.
//
//----------------------------------------------------------------------

func sNsEnsembleImplementationCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclEnsemble.c:1668:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNsEnsembleImplementationCmdNR})),
		clientData, objc, objv)
}

func sNsEnsembleImplementationCmdNR(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclEnsemble.c:1679:1: */
	bp := tls.Alloc(368)
	defer tls.Free(368)

	var ensemblePtr uintptr
	// The ensemble itself.
	// var prefixObj uintptr at bp+360, 8
	// An object containing the prefix words of
	// the command that implements the
	// subcommand.
	var hPtr uintptr // Used for efficient lookup of fully
	// specified but not yet cached command
	// names.
	var reparseCount int32 // Number of reparses.
	var errorObj uintptr   // Used for building error messages.
	var subObj uintptr
	var subIdx int32
	// We don't have a subcommand argument. Make error message.

	// var buf Tcl_DString at bp+120, 216

	var ensembleCmd uintptr
	var cmp int32
	// If we've not already confirmed the command with the hash as part of
	// building our export table, we need to scan the sorted array for
	// matches.

	var subcmdName uintptr // Name of the subcommand, or unique prefix of
	// it (will be an error for a non-unique
	// prefix).
	var fullName uintptr // Full name of the subcommand.
	// var stringLength int32 at bp+336, 4

	var i int32
	var tableLength int32
	var fix uintptr
	var cachePtr uintptr
	var _objPtr uintptr
	var _callbackPtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var _objPtr1 uintptr
	var _callbackPtr1 uintptr
	var copyPtr uintptr // The actual list of words to dispatch to.
	// Will be freed by the dispatch engine.
	// var copyObjv uintptr at bp+352, 8

	// var copyObjc int32 at bp+344, 4

	// var prefixObjc int32 at bp+340, 4

	var i1 int32
	ensemblePtr = clientData
	reparseCount = 0

	// Must recheck objc, since numParameters might have changed. Cf. test
	// namespace-53.9.

restartEnsembleParse:
	subIdx = 1 + (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters
	if !(objc < subIdx+1) {
		goto __1
	} // Message being built

	XTcl_DStringInit(tls, bp+120)
	if !((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList != 0) {
		goto __2
	}
	XTcl_DStringAppend(tls, bp+120,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList)).Fbytes
			}
			return XTcl_GetString(tls, (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList)
		}(), -1)
	XTcl_DStringAppend(tls, bp+120, ts+14299, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
__2:
	;
	XTcl_DStringAppend(tls, bp+120, ts+26258, int32(uint64(unsafe.Sizeof([21]int8{}))-uint64(1)))
	XTcl_WrongNumArgs(tls, interp, 1, objv, (*Tcl_DString)(unsafe.Pointer(bp+120)).Fstring)
	XTcl_DStringFree(tls, bp+120)

	return TCL_ERROR
__1:
	;

	if !((*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).Fflags&NS_DYING != 0) {
		goto __3
	}
	// Don't know how we got here, but make things give up quickly.

	if !!(XTcl_InterpDeleted(tls, interp) != 0) {
		goto __4
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+26697, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26253, uintptr(0)))
__4:
	;
	return TCL_ERROR
__3:
	;

	// Determine if the table of subcommands is right. If so, we can just look
	// up in there and go straight to dispatch.

	subObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(subIdx)*8))

	if !((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fepoch == (*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch) {
		goto __5
	}
	// Table of subcommands is still valid; therefore there might be a
	// valid cache of discovered information which we can reuse. Do the
	// check here, and if we're still valid, we can jump straight to the
	// part where we do the invocation of the subcommand.

	if !((*Tcl_Obj)(unsafe.Pointer(subObj)).FtypePtr == uintptr(unsafe.Pointer(&ensembleCmdType))) {
		goto __7
	}
	ensembleCmd = *(*uintptr)(unsafe.Pointer(subObj + 32))

	if !((*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Fepoch == (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fepoch && (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken == (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken) {
		goto __8
	}
	*(*uintptr)(unsafe.Pointer(bp + 360 /* prefixObj */)) = (*Tcl_HashEntry)(unsafe.Pointer((*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).FhPtr)).FclientData
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))).FrefCount++
	if !((*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix != 0) {
		goto __9
	}
	XTclSpellFix(tls, interp, objv, objc, subIdx, subObj, (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix)
__9:
	;
	goto runResultingSubcommand
__8:
	;
__7:
	;
	goto __6
__5:
	sBuildEnsembleConfig(tls, ensemblePtr)
	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fepoch = (*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch
__6:
	;

	// Look in the hashtable for the subcommand name; this is the fastest way
	// of all if there is no cache in operation.

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(ensemblePtr + 32 /* &.subcommandTable */)).FfindProc})).f(tls, ensemblePtr+32 /* &.subcommandTable */, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(subObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(subObj)).Fbytes
		}
		return XTcl_GetString(tls, subObj)
	}())
	if !(hPtr != uintptr(0)) {
		goto __10
	}

	// Cache for later in the subcommand object.

	sMakeCachedEnsembleCommand(tls, subObj, ensemblePtr, hPtr, uintptr(0))
	goto __11
__10:
	if !!((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags&TCL_ENSEMBLE_PREFIX != 0) {
		goto __12
	}
	// Could not map, no prefixing, go to unknown/error handling.

	goto unknownOrAmbiguousSubcommand
	goto __13
__12: // Name of the subcommand, or unique prefix of
	// it (will be an error for a non-unique
	// prefix).
	fullName = uintptr(0)
	tableLength = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandTable.FnumEntries

	subcmdName = XTcl_GetStringFromObj(tls, subObj, bp+336)
	i = 0
__14:
	if !(i < tableLength) {
		goto __16
	}
	cmp = libc.Xstrncmp(tls, subcmdName,
		*(*uintptr)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(i)*8)),
		uint64(uint32(*(*int32)(unsafe.Pointer(bp + 336 /* stringLength */)))))

	if !(cmp == 0) {
		goto __17
	}
	if !(fullName != uintptr(0)) {
		goto __19
	}
	// Since there's never the exact-match case to worry about
	// (hash search filters this), getting here indicates that
	// our subcommand is an ambiguous prefix of (at least) two
	// exported subcommands, which is an error case.

	goto unknownOrAmbiguousSubcommand
__19:
	;
	fullName = *(*uintptr)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(i)*8))
	goto __18
__17:
	if !(cmp < 0) {
		goto __20
	}
	// Because we are searching a sorted table, we can now stop
	// searching because we have gone past anything that could
	// possibly match.

	goto __16
__20:
	;
__18:
	;
	goto __15
__15:
	i++
	goto __14
	goto __16
__16:
	;
	if !(fullName == uintptr(0)) {
		goto __21
	}
	// The subcommand is not a prefix of anything, so bail out!

	goto unknownOrAmbiguousSubcommand
__21:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(ensemblePtr + 32 /* &.subcommandTable */)).FfindProc})).f(tls, ensemblePtr+32 /* &.subcommandTable */, fullName)
	if !(hPtr == uintptr(0)) {
		goto __22
	}
	XTcl_Panic(tls, ts+26738,
		libc.VaList(bp+32, fullName))
__22:
	;

	// Record the spelling correction for usage message.

	fix = XTcl_NewStringObj(tls, fullName, -1)

	// Cache for later in the subcommand object.

	sMakeCachedEnsembleCommand(tls, subObj, ensemblePtr, hPtr, fix)
	XTclSpellFix(tls, interp, objv, objc, subIdx, subObj, fix)
__13:
	;
__11:
	;

	*(*uintptr)(unsafe.Pointer(bp + 360 /* prefixObj */)) = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))).FrefCount++
runResultingSubcommand:

	/*
	 * Do the real work of execution of the subcommand by building an array of
	 * objects (note that this is potentially not the same length as the
	 * number of arguments to this ensemble command), populating it and then
	 * feeding it back through the main command-lookup engine. In theory, we
	 * could look up the command in the namespace ourselves, as we already
	 * have the namespace in which it is guaranteed to exist,
	 *
	 *   ((Q: That's not true if the -map option is used, is it?))
	 *
	 * but we don't do that (the cacheing of the command object used should
	 * help with that.)
	 */

	XTcl_ListObjLength(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 360 /* prefixObj */)), bp+340)

	if !(objc == 2) {
		goto __23
	}
	copyPtr = XTclListObjCopy(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 360 /* prefixObj */)))
	goto __24
__23:
	copyPtr = XTcl_NewListObj(tls, objc-2+*(*int32)(unsafe.Pointer(bp + 340)), uintptr(0))
	XTcl_ListObjAppendList(tls, uintptr(0), copyPtr, *(*uintptr)(unsafe.Pointer(bp + 360 /* prefixObj */)))
	XTcl_ListObjReplace(tls, uintptr(0), copyPtr, 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))), 0,
		(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters, objv+uintptr(1)*8)
	XTcl_ListObjReplace(tls, uintptr(0), copyPtr, 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))), 0,
		objc-2-(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters,
		objv+uintptr(2)*8+uintptr((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters)*8)
__24:
	;
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FrefCount++
__25:
__28:
	;
__31:
	if !(interp == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __34
	}
	_objPtr = XTclThreadAllocObj(tls)
	goto __35
__34:
	_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__35:
	;
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
	_callbackPtr = _objPtr
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{XTclNRReleaseValues}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = copyPtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __26
__26:
	if 0 != 0 {
		goto __25
	}
	goto __27
__27:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))).FrefCount, 1) > 1) {
		goto __36
	}
	goto __37
__36:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __38
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))).Fbytes != XtclEmptyStringRep) {
		goto __40
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))).Fbytes)
__40:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))).Flength = -1
__41:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __44
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 360)))
	goto __45
__44:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 360))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__45:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
	goto __39
__38:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 360 /* prefixObj */)))
__39:
	;
__37:
	;

	// Record what arguments the script sent in so that things like
	// Tcl_WrongNumArgs can give the correct error message. Parameters
	// count both as inserted and removed arguments.

	if !(XTclInitRewriteEnsemble(tls, interp, 2+(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters,
		*(*int32)(unsafe.Pointer(bp + 340))+(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters, objv) != 0) {
		goto __46
	}
__47:
__50:
	;
__53:
	if !(interp == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __56
	}
	_objPtr1 = XTclThreadAllocObj(tls)
	goto __57
__56:
	_objPtr1 = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr1 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__57:
	;
	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
	_callbackPtr1 = _objPtr1
	goto __51
__51:
	if 0 != 0 {
		goto __50
	}
	goto __52
__52:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr1)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{XTclClearRootEnsemble}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8 + 1*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr1)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr1
	goto __48
__48:
	if 0 != 0 {
		goto __47
	}
	goto __49
__49:
	;
__46:
	;

	// Hand off to the target command.

	XTclSkipTailcall(tls, interp)
	XTcl_ListObjGetElements(tls, uintptr(0), copyPtr, bp+344, bp+352)
	(*Interp)(unsafe.Pointer(interp)).FlookupNsPtr = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr
	return XTclNREvalObjv(tls, interp, *(*int32)(unsafe.Pointer(bp + 344 /* copyObjc */)), *(*uintptr)(unsafe.Pointer(bp + 352 /* copyObjv */)), TCL_EVAL_INVOKE, uintptr(0))

unknownOrAmbiguousSubcommand:
	// Have not been able to match the subcommand asked for with a real
	// subcommand that we export. See whether a handler has been registered
	// for dealing with this situation. Will only call (at most) once for any
	// particular ensemble invocation.

	if !((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler != uintptr(0) && libc.PostIncInt32(&reparseCount, 1) < 1) {
		goto __58
	}
	switch sEnsembleUnknownCallback(tls, interp, ensemblePtr, objc, objv,
		bp+360) {
	case TCL_OK:
		goto __60
	case TCL_ERROR:
		goto __61
	case TCL_CONTINUE:
		goto __62
	}
	goto __59
__60:
	goto runResultingSubcommand
__61:
	return TCL_ERROR
__62:
	goto restartEnsembleParse
__59:
	;
__58:
	;

	// We cannot determine what subcommand to hand off to, so generate a
	// (standard) failure message. Note the one odd case compared with
	// standard ensemble-like command, which is where a namespace has no
	// exported commands at all...

	XTcl_ResetResult(tls, interp)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7170, ts+11879,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(subObj)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(subObj)).Fbytes
			}
			return XTcl_GetString(tls, subObj)
		}(), uintptr(0)))
	if !((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandTable.FnumEntries == 0) {
		goto __63
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+26793, libc.VaList(bp+80, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(subObj)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(subObj)).Fbytes
			}
			return XTcl_GetString(tls, subObj)
		}(),
			(*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FfullName)))
	return TCL_ERROR
__63:
	;
	errorObj = XTcl_ObjPrintf(tls, ts+26860,
		libc.VaList(bp+96, func() uintptr {
			if (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags&TCL_ENSEMBLE_PREFIX != 0 {
				return ts + 26896 /* " or ambiguous" */
			}
			return ts + 2046 /* "" */
		}(),
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(subObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(subObj)).Fbytes
				}
				return XTcl_GetString(tls, subObj)
			}()))
	if !((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandTable.FnumEntries == 1) {
		goto __64
	}
	XTcl_AppendToObj(tls, errorObj, *(*uintptr)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr)), -1)
	goto __65
__64:

	i1 = 0
__66:
	if !(i1 < (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandTable.FnumEntries-1) {
		goto __68
	}
	XTcl_AppendToObj(tls, errorObj, *(*uintptr)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(i1)*8)), -1)
	XTcl_AppendToObj(tls, errorObj, ts+18549, 2)
	goto __67
__67:
	i1++
	goto __66
	goto __68
__68:
	;
	XTcl_AppendPrintfToObj(tls, errorObj, ts+26910,
		libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(i1)*8))))
__65:
	;
	XTcl_SetObjResult(tls, interp, errorObj)
	return TCL_ERROR
}

func XTclClearRootEnsemble(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclEnsemble.c:1981:1: */
	XTclResetRewriteEnsemble(tls, interp, 1)
	return result
}

//----------------------------------------------------------------------
//
// TclInitRewriteEnsemble --
//
//	Applies a rewrite of arguments so that an ensemble subcommand will
//	report error messages correctly for the overall command.
//
// Results:
//	Whether this is the first rewrite applied, a value which must be
//	passed to TclResetRewriteEnsemble when undoing this command's
//	behaviour.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclInitRewriteEnsemble(tls *libc.TLS, interp uintptr, numRemoved int32, numInserted int32, objv uintptr) int32 { /* tclEnsemble.c:2010:1: */
	var iPtr uintptr = interp

	var isRootEnsemble int32 = libc.Bool32((*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs == uintptr(0))

	if isRootEnsemble != 0 {
		(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs = objv
		(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs = numRemoved
		(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs = numInserted
	} else {
		var numIns int32 = (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs

		if numIns < numRemoved {
			*(*int32)(unsafe.Pointer(iPtr + 928 + 8)) += numRemoved - numIns
			(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs = numInserted
		} else {
			*(*int32)(unsafe.Pointer(iPtr + 928 + 12)) += numInserted - numRemoved
		}
	}
	return isRootEnsemble
}

//----------------------------------------------------------------------
//
// TclResetRewriteEnsemble --
//
//	Removes any rewrites applied to support proper reporting of error
//	messages used in ensembles. Should be paired with
//	TclInitRewriteEnsemble.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclResetRewriteEnsemble(tls *libc.TLS, interp uintptr, isRootEnsemble int32) { /* tclEnsemble.c:2056:1: */
	var iPtr uintptr = interp

	if isRootEnsemble != 0 {
		(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs = uintptr(0)
		(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs = 0
		(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs = 0
	}
}

//----------------------------------------------------------------------
//
// TclSpellFix --
//
//	Record a spelling correction that needs making in the generation of
//	the WrongNumArgs usage message.
//
// Results:
//	None.
//
// Side effects:
//	Can create an alternative ensemble rewrite structure.
//
//----------------------------------------------------------------------

func sFreeER(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclEnsemble.c:2087:1: */
	var tmp uintptr = *(*ClientData)(unsafe.Pointer(data))
	var store uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))

	XTclpFree(tls, store)
	XTclpFree(tls, tmp)
	return result
}

func XTclSpellFix(tls *libc.TLS, interp uintptr, objv uintptr, objc int32, badIdx int32, bad uintptr, fix uintptr) { /* tclEnsemble.c:2101:1: */
	var iPtr uintptr = interp
	var search uintptr
	var store uintptr
	var idx int32
	var size int32

	if (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs == uintptr(0) {
		(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs = objv
		(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs = 0
		(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs = 0
	}

	// Compute the valid length of the ensemble root.

	size = (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs + objc -
		(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs

	search = (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs
	if *(*uintptr)(unsafe.Pointer(search)) == uintptr(0) {
		// Awful casting abuse here!

		search = *(*uintptr)(unsafe.Pointer(search + 1*8))
	}

	if badIdx < (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs {
		// Misspelled value was inserted. We cannot directly jump to the bad
		// value, but have to search.

		idx = 1
		for idx < size {
			if *(*uintptr)(unsafe.Pointer(search + uintptr(idx)*8)) == bad {
				break
			}
			idx++
		}
		if idx == size {
			return
		}
	} else {
		// Jump to the misspelled value.

		idx = (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs + badIdx -
			(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs

		// Verify
		if *(*uintptr)(unsafe.Pointer(search + uintptr(idx)*8)) != bad {
			XTcl_Panic(tls, ts+26916, 0)
		}
	}

	search = (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs
	if *(*uintptr)(unsafe.Pointer(search)) == uintptr(0) {
		store = *(*uintptr)(unsafe.Pointer(search + 2*8))
	} else {
		var tmp uintptr = XTcl_Alloc(tls, uint32(uint64(3)*uint64(unsafe.Sizeof(uintptr(0)))))

		store = XTcl_Alloc(tls, uint32(uint64(size)*uint64(unsafe.Sizeof(uintptr(0)))))
		libc.Xmemcpy(tls, store, (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs,
			uint64(size)*uint64(unsafe.Sizeof(uintptr(0))))

		// Awful casting abuse here! Note that the NULL in the first element
		// indicates that the initial objects are a raw array in the second
		// element and the rewritten ones are a raw array in the third.

		*(*uintptr)(unsafe.Pointer(tmp)) = uintptr(0)
		*(*uintptr)(unsafe.Pointer(tmp + 1*8)) = (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs
		*(*uintptr)(unsafe.Pointer(tmp + 2*8)) = store
		(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs = tmp

		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sFreeER}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = tmp
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = store
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	}

	*(*uintptr)(unsafe.Pointer(store + uintptr(idx)*8)) = fix
	(*Tcl_Obj)(unsafe.Pointer(fix)).FrefCount++
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _callbackPtr uintptr
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{XTclNRReleaseValues}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = fix
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
}

func XTclEnsembleGetRewriteValues(tls *libc.TLS, interp uintptr) uintptr { /* tclEnsemble.c:2196:9: */
	var iPtr uintptr = interp
	var origObjv uintptr = (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs
	if *(*uintptr)(unsafe.Pointer(origObjv)) == uintptr(0) {
		origObjv = *(*uintptr)(unsafe.Pointer(origObjv + 2*8))
	}
	return origObjv
}

//----------------------------------------------------------------------
//
// TclFetchEnsembleRoot --
//
//	Returns the root of ensemble rewriting, if any.
//	If no root exists, returns objv instead.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFetchEnsembleRoot(tls *libc.TLS, interp uintptr, objv uintptr, objc int32, objcPtr uintptr) uintptr { /* tclEnsemble.c:2225:9: */
	var sourceObjs uintptr
	var iPtr uintptr = interp

	if (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs != 0 {
		*(*int32)(unsafe.Pointer(objcPtr)) = objc + (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs -
			(*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs
		if *(*uintptr)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs)) == uintptr(0) {
			sourceObjs = *(*uintptr)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs + 1*8))
		} else {
			sourceObjs = (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs
		}
		return sourceObjs
	}
	*(*int32)(unsafe.Pointer(objcPtr)) = objc
	return objv
}

// ----------------------------------------------------------------------
//
// EnsmebleUnknownCallback --
//
//	Helper for the ensemble engine that handles the procesing of unknown
//	callbacks. See the user documentation of the ensemble unknown handler
//	for details; this function is only ever called when such a function is
//	defined, and is only ever called once per ensemble dispatch (i.e. if a
//	reparse still fails, this isn't called again).
//
// Results:
//	TCL_OK -	*prefixObjPtr contains the command words to dispatch
//			to.
//	TCL_CONTINUE -	Need to reparse (*prefixObjPtr is invalid).
//	TCL_ERROR -	Something went wrong! Error message in interpreter.
//
// Side effects:
//	Calls the Tcl interpreter, so arbitrary.
//
// ----------------------------------------------------------------------

func sEnsembleUnknownCallback(tls *libc.TLS, interp uintptr, ensemblePtr uintptr, objc int32, objv uintptr, prefixObjPtr uintptr) int32 { /* tclEnsemble.c:2273:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	// var paramc int32 at bp+80, 4

	var i int32
	var result int32
	// var prefixObjc int32 at bp+84, 4

	// var paramv uintptr at bp+72, 8

	var unknownCmd uintptr
	var ensObj uintptr

	// Create the unknown command callback to determine what to do.

	unknownCmd = XTcl_DuplicateObj(tls, (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler)
	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			ensObj = XTclThreadAllocObj(tls)
		} else {
			ensObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(ensObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(ensObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(ensObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(ensObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(ensObj)).FtypePtr = uintptr(0)
	{
	}

	XTcl_GetCommandFullName(tls, interp, (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken, ensObj)
	XTcl_ListObjAppendElement(tls, uintptr(0), unknownCmd, ensObj)
	for i = 1; i < objc; i++ {
		XTcl_ListObjAppendElement(tls, uintptr(0), unknownCmd, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}
	if (*Tcl_Obj)(unsafe.Pointer(unknownCmd)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 72)) = *(*uintptr)(unsafe.Pointer(unknownCmd + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 80)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(unknownCmd + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), unknownCmd, bp+80, bp+72)
	}
	(*Tcl_Obj)(unsafe.Pointer(unknownCmd)).FrefCount++

	// Now call the unknown handler. (We don't bother NRE-enabling this; deep
	// recursing through unknown handlers is horribly perverse.) Note that it
	// is always an error for an unknown handler to delete its ensemble; don't
	// do that!

	XTcl_Preserve(tls, ensemblePtr)
	XTclSkipTailcall(tls, interp)
	result = XTcl_EvalObjv(tls, interp, *(*int32)(unsafe.Pointer(bp + 80 /* paramc */)), *(*uintptr)(unsafe.Pointer(bp + 72 /* paramv */)), 0)
	if result == TCL_OK && (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags&ENSEMBLE_DEAD != 0 {
		if !(XTcl_InterpDeleted(tls, interp) != 0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+26944, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+26244, ts+26992,
				uintptr(0)))
		}
		result = TCL_ERROR
	}
	XTcl_Release(tls, ensemblePtr)

	// If we succeeded, we should either have a list of words that form the
	// command to be executed, or an empty list. In the empty-list case, the
	// ensemble is believed to be updated so we should ask the ensemble engine
	// to reparse the original command.

	if result == TCL_OK {
		*(*uintptr)(unsafe.Pointer(prefixObjPtr)) = XTcl_GetObjResult(tls, interp)
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FrefCount++
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(unknownCmd)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(unknownCmd)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(unknownCmd)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(unknownCmd)).Flength = -1
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, unknownCmd)
					} else {
						*(*uintptr)(unsafe.Pointer(unknownCmd + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = unknownCmd
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, unknownCmd)
			}
		}

		XTcl_ResetResult(tls, interp)

		// Namespace is still there. Check if the result is a valid list. If
		// it is, and it is non-empty, that list is what we are using as our
		// replacement.

		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 84)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)) + 32)))).FelemCount
					return TCL_OK
				}()
			}
			return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(prefixObjPtr)), bp+84)
		}() != TCL_OK {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Flength = -1
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(prefixObjPtr)))
						} else {
							*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(prefixObjPtr))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(prefixObjPtr)))
				}
			}

			XTcl_AddErrorInfo(tls, interp,
				ts+27008)
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp + 84)) > 0 {
			return TCL_OK
		}

		// Namespace alive & empty result => reparse.

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Flength = -1
				for ok3 := true; ok3; ok3 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(prefixObjPtr)))
					} else {
						*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(prefixObjPtr))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(prefixObjPtr)))
			}
		}

		return TCL_CONTINUE
	}

	// Oh no! An exceptional result. Convert to an error.

	if !(XTcl_InterpDeleted(tls, interp) != 0) {
		if result != TCL_ERROR {
			XTcl_ResetResult(tls, interp)
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+27073, -1))
			switch result {
			case TCL_RETURN:
				XTcl_AppendToObj(tls, XTcl_GetObjResult(tls, interp), ts+5291, -1)
				break
				fallthrough
			case TCL_BREAK:
				XTcl_AppendToObj(tls, XTcl_GetObjResult(tls, interp), ts+5100, -1)
				break
				fallthrough
			case TCL_CONTINUE:
				XTcl_AppendToObj(tls, XTcl_GetObjResult(tls, interp), ts+5117, -1)
				break
				fallthrough
			default:
				XTcl_AppendPrintfToObj(tls, XTcl_GetObjResult(tls, interp), ts+324, libc.VaList(bp+32, result))
			}
			XTcl_AddErrorInfo(tls, interp,
				ts+27120)
			XTcl_AppendObjToErrorInfo(tls, interp, unknownCmd)
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+26244, ts+27173,
				uintptr(0)))
		} else {
			XTcl_AddErrorInfo(tls, interp,
				ts+27188)
		}
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(unknownCmd)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(unknownCmd)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(unknownCmd)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(unknownCmd)).Flength = -1
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, unknownCmd)
				} else {
					*(*uintptr)(unsafe.Pointer(unknownCmd + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = unknownCmd
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, unknownCmd)
		}
	}

	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// MakeCachedEnsembleCommand --
//
//	Cache what we've computed so far; it's not nice to repeatedly copy
//	strings about. Note that to do this, we start by deleting any old
//	representation that there was (though if it was an out of date
//	ensemble rep, we can skip some of the deallocation process.)
//
// Results:
//	None
//
// Side effects:
//	Alters the internal representation of the first object parameter.
//
//----------------------------------------------------------------------

func sMakeCachedEnsembleCommand(tls *libc.TLS, objPtr uintptr, ensemblePtr uintptr, hPtr uintptr, fix uintptr) { /* tclEnsemble.c:2411:1: */
	var ensembleCmd uintptr

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&ensembleCmdType)) {
		ensembleCmd = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		if libc.PostDecInt32(&(*Command)(unsafe.Pointer((*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken)).FrefCount, 1) <= 1 {
			XTclpFree(tls, (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken)
		}

		if (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix != 0 {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
	} else {
		// Kill the old internal rep, and replace it with a brand new one of
		// our own.

		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		}

		ensembleCmd = XTcl_Alloc(tls, uint32(unsafe.Sizeof(EnsembleCmdRep{})))
		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = ensembleCmd
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&ensembleCmdType))
	}

	// Populate the internal rep.

	(*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Fepoch = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fepoch
	(*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken
	(*Command)(unsafe.Pointer((*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken)).FrefCount++
	if fix != 0 {
		(*Tcl_Obj)(unsafe.Pointer(fix)).FrefCount++
	}
	(*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix = fix
	(*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).FhPtr = hPtr
}

//----------------------------------------------------------------------
//
// DeleteEnsembleConfig --
//
//	Destroys the data structure used to represent an ensemble. This is
//	called when the ensemble's command is deleted (which happens
//	automatically if the ensemble's namespace is deleted.) Maintainers
//	should note that ensembles should be deleted by deleting their
//	commands.
//
// Results:
//	None.
//
// Side effects:
//	Memory is (eventually) deallocated.
//
//----------------------------------------------------------------------

func sClearTable(tls *libc.TLS, ensemblePtr uintptr) { /* tclEnsemble.c:2472:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var hash uintptr = ensemblePtr + 32

	if (*Tcl_HashTable)(unsafe.Pointer(hash)).FnumEntries != 0 {
		// var search Tcl_HashSearch at bp, 24

		var hPtr uintptr = XTcl_FirstHashEntry(tls, hash, bp)

		for hPtr != uintptr(0) {
			var prefixObj uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = prefixObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			hPtr = XTcl_NextHashEntry(tls, bp)
		}
		XTclpFree(tls, (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr)
	}
	XTcl_DeleteHashTable(tls, hash)
}

func sDeleteEnsembleConfig(tls *libc.TLS, clientData ClientData) { /* tclEnsemble.c:2492:1: */
	var ensemblePtr uintptr = clientData
	var nsPtr uintptr = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr

	// Unlink from the ensemble chain if it has not been marked as having been
	// done already.

	if (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fnext != ensemblePtr {
		var ensPtr uintptr = (*Namespace)(unsafe.Pointer(nsPtr)).Fensembles

		if ensPtr == ensemblePtr {
			(*Namespace)(unsafe.Pointer(nsPtr)).Fensembles = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fnext
		} else {
			for ensPtr != uintptr(0) {
				if (*EnsembleConfig)(unsafe.Pointer(ensPtr)).Fnext == ensemblePtr {
					(*EnsembleConfig)(unsafe.Pointer(ensPtr)).Fnext = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fnext
					break
				}
				ensPtr = (*EnsembleConfig)(unsafe.Pointer(ensPtr)).Fnext
			}
		}
	}

	// Mark the namespace as dead so code that uses Tcl_Preserve() can tell
	// whether disaster happened anyway.

	*(*int32)(unsafe.Pointer(ensemblePtr + 128)) |= ENSEMBLE_DEAD

	// Kill the pointer-containing fields.

	sClearTable(tls, ensemblePtr)
	if (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList != uintptr(0) {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict != uintptr(0) {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler != uintptr(0) {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	// Arrange for the structure to be reclaimed. Note that this is complex
	// because we have to make sure that we can react sensibly when an
	// ensemble is deleted during the process of initialising the ensemble
	// (especially the unknown callback.)

	XTcl_EventuallyFree(tls, ensemblePtr, uintptr(3))
}

//----------------------------------------------------------------------
//
// BuildEnsembleConfig --
//
//	Create the internal data structures that describe how an ensemble
//	looks, being a hash mapping from the simple command name to the Tcl list
//	that describes the implementation prefix words, and a sorted array of
//	the names to allow for reasonably efficient unambiguous prefix handling.
//
// Results:
//	None.
//
// Side effects:
//	Reallocates and rebuilds the hash table and array stored at the
//	ensemblePtr argument. For large ensembles or large namespaces, this is
//	a potentially expensive operation.
//
//----------------------------------------------------------------------

func sBuildEnsembleConfig(tls *libc.TLS, ensemblePtr uintptr) { /* tclEnsemble.c:2576:1: */
	bp := tls.Alloc(152)
	defer tls.Free(152)

	// var search Tcl_HashSearch at bp+120, 24
	// Used for scanning the set of commands in
	// the namespace that backs up this
	// ensemble.
	var i int32
	var j int32
	// var isNew int32 at bp+48, 4

	var hash uintptr = ensemblePtr + 32
	var hPtr uintptr
	var mapDict uintptr = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict
	var subList uintptr = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList

	sClearTable(tls, ensemblePtr)
	XTcl_InitHashTable(tls, hash, 0)

	if subList != 0 {
		// var subc int32 at bp+32, 4

		// var subv uintptr at bp+40, 8

		// var target uintptr at bp+64, 8

		// var cmdObj uintptr at bp+56, 8

		var cmdPrefixObj uintptr
		var name uintptr

		// There is a list of exactly what subcommands go in the table.
		// Must determine the target for each.

		XTcl_ListObjGetElements(tls, uintptr(0), subList, bp+32, bp+40)
		if subList == mapDict {
			// Strange case where explicit list of subcommands is same value
			// as the dict mapping to targets.

			for i = 0; i < *(*int32)(unsafe.Pointer(bp + 32 /* subc */)); i = i + 2 {
				name = func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)))
				}()
				hPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hash)).FcreateProc})).f(tls, hash, name, bp+48 /* &isNew */)
				if !(*(*int32)(unsafe.Pointer(bp + 48)) != 0) {
					*(*uintptr)(unsafe.Pointer(bp + 56 /* cmdObj */)) = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					for ok := true; ok; ok = 0 != 0 {
						var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 56))
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
				}
				(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i+1)*8))
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i+1)*8)))).FrefCount++

				name = func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i+1)*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i+1)*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i+1)*8)))
				}()
				hPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hash)).FcreateProc})).f(tls, hash, name, bp+48 /* &isNew */)
				if *(*int32)(unsafe.Pointer(bp + 48)) != 0 {
					*(*uintptr)(unsafe.Pointer(bp + 56 /* cmdObj */)) = XTcl_NewStringObj(tls, name, -1)
					cmdPrefixObj = XTcl_NewListObj(tls, 1, bp+56)
					(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPrefixObj
					(*Tcl_Obj)(unsafe.Pointer(cmdPrefixObj)).FrefCount++
				}
			}
		} else {
			// Usual case where we can freely act on the list and dict.

			for i = 0; i < *(*int32)(unsafe.Pointer(bp + 32 /* subc */)); i++ {
				name = func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)))
				}()
				hPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hash)).FcreateProc})).f(tls, hash, name, bp+48 /* &isNew */)
				if !(*(*int32)(unsafe.Pointer(bp + 48)) != 0) {
					continue
				}

				// Lookup target in the dictionary
				if mapDict != 0 {
					XTcl_DictObjGet(tls, uintptr(0), mapDict, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* subv */)) + uintptr(i)*8)), bp+64)
					if *(*uintptr)(unsafe.Pointer(bp + 64)) != 0 {
						(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = *(*uintptr)(unsafe.Pointer(bp + 64))
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FrefCount++
						continue
					}
				}

				// target was not in the dictionary so map onto the namespace.
				// Note in this case that we do not guarantee that the
				// command is actually there; that is the programmer's
				// responsibility (or [::unknown] of course).
				*(*uintptr)(unsafe.Pointer(bp + 56 /* cmdObj */)) = XTcl_NewStringObj(tls, name, -1)
				cmdPrefixObj = XTcl_NewListObj(tls, 1, bp+56)
				(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPrefixObj
				(*Tcl_Obj)(unsafe.Pointer(cmdPrefixObj)).FrefCount++
			}
		}
	} else if mapDict != 0 {
		// No subcmd list, but we do have a mapping dictionary so we should
		// use the keys of that. Convert the dictionary's contents into the
		// form required for the ensemble's internal hashtable.

		// var dictSearch Tcl_DictSearch at bp+72, 24

		// var keyObj uintptr at bp+96, 8

		// var valueObj uintptr at bp+104, 8

		// var done int32 at bp+112, 4

		XTcl_DictObjFirst(tls, uintptr(0), (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict, bp+72,
			bp+96, bp+104, bp+112)
		for !(*(*int32)(unsafe.Pointer(bp + 112)) != 0) {
			var name uintptr = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 96)))
			}()

			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hash)).FcreateProc})).f(tls, hash, name, bp+48 /* &isNew */)
			(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = *(*uintptr)(unsafe.Pointer(bp + 104))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104)))).FrefCount++
			XTcl_DictObjNext(tls, bp+72, bp+96, bp+104, bp+112)
		}
	} else {
		// Discover what commands are actually exported by the namespace.
		// What we have is an array of patterns and a hash table whose keys
		// are the command names exported by the namespace (the contents do
		// not matter here.) We must find out what commands are actually
		// exported by filtering each command in the namespace against each of
		// the patterns in the export list. Note that we use an intermediate
		// hash table to make memory management easier, and because that makes
		// exact matching far easier too.
		//
		// Suggestion for future enhancement: compute the unique prefixes and
		// place them in the hash too, which should make for even faster
		// matching.

		hPtr = XTcl_FirstHashEntry(tls, (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr+160, bp+120)
		for ; hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp+120) {
			var nsCmdName uintptr = // Name of command in namespace.
			func() uintptr {
				if (*Tcl_HashTable)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr+160)).FkeyType == -1 {
					return *(*uintptr)(unsafe.Pointer(hPtr + 32))
				}
				return hPtr + 32
			}()

			for i = 0; i < (*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FnumExportPatterns; i++ {
				if XTcl_StringMatch(tls, nsCmdName,
					*(*uintptr)(unsafe.Pointer((*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportArrayPtr + uintptr(i)*8))) != 0 {
					hPtr = (*struct {
						f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
					})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hash)).FcreateProc})).f(tls, hash, nsCmdName, bp+48 /* &isNew */)

					// Remember, hash entries have a full reference to the
					// substituted part of the command (as a list) as their
					// content!

					if *(*int32)(unsafe.Pointer(bp + 48)) != 0 {
						// var cmdObj uintptr at bp+144, 8

						var cmdPrefixObj uintptr

						for ok1 := true; ok1; ok1 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								*(*uintptr)(unsafe.Pointer(bp + 144)) = XTclThreadAllocObj(tls)
							} else {
								*(*uintptr)(unsafe.Pointer(bp + 144)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 144)) + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 144)))).FrefCount = 0
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 144)))).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 144)))).Flength = 0
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 144)))).FtypePtr = uintptr(0)
						{
						}

						XTcl_AppendStringsToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 144 /* cmdObj */)),
							libc.VaList(bp, (*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FfullName,
								func() uintptr {
									if (*Namespace)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FparentPtr != 0 {
										return ts + 6847 /* "::" */
									}
									return ts + 2046 /* "" */
								}(),
								nsCmdName, uintptr(0)))
						cmdPrefixObj = XTcl_NewListObj(tls, 1, bp+144)
						(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPrefixObj
						(*Tcl_Obj)(unsafe.Pointer(cmdPrefixObj)).FrefCount++
					}
					break
				}
			}
		}
	}

	if (*Tcl_HashTable)(unsafe.Pointer(hash)).FnumEntries == 0 {
		(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr = uintptr(0)
		return
	}

	// Create a sorted array of all subcommands in the ensemble; hash tables
	// are all very well for a quick look for an exact match, but they can't
	// determine things like whether a string is a prefix of another (not
	// without lots of preparation anyway) and they're no good for when we're
	// generating the error message either.
	//
	// We do this by filling an array with the names (we use the hash keys
	// directly to save a copy, since any time we change the array we change
	// the hash too, and vice versa) and running quicksort over the array.

	(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Tcl_HashTable)(unsafe.Pointer(hash)).FnumEntries)))

	// Fill array from both ends as this makes us less likely to end up with
	// performance problems in qsort(), which is good. Note that doing this
	// makes this code much more opaque, but the naive alternatve:
	//
	// for (hPtr=Tcl_FirstHashEntry(hash,&search),i=0 ;
	//	       hPtr!=NULL ; hPtr=Tcl_NextHashEntry(&search),i++) {
	//     ensemblePtr->subcommandArrayPtr[i] = Tcl_GetHashKey(hash, &hPtr);
	// }
	//
	// can produce long runs of precisely ordered table entries when the
	// commands in the namespace are declared in a sorted fashion (an ordering
	// some people like) and the hashing functions (or the command names
	// themselves) are fairly unfortunate. By filling from both ends, it
	// requires active malice (and probably a debugger) to get qsort() to have
	// awful runtime behaviour.

	i = 0
	j = (*Tcl_HashTable)(unsafe.Pointer(hash)).FnumEntries
	hPtr = XTcl_FirstHashEntry(tls, hash, bp+120)
	for hPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(libc.PostIncInt32(&i, 1))*8)) = func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(hash)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(hash)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(hPtr + 32))
			}
			return hPtr + 32
		}()
		hPtr = XTcl_NextHashEntry(tls, bp+120)
		if hPtr == uintptr(0) {
			break
		}
		*(*uintptr)(unsafe.Pointer((*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(libc.PreDecInt32(&j, 1))*8)) = func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(hash)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(hash)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(hPtr + 32))
			}
			return hPtr + 32
		}()
		hPtr = XTcl_NextHashEntry(tls, bp+120)
	}
	if (*Tcl_HashTable)(unsafe.Pointer(hash)).FnumEntries > 1 {
		libc.Xqsort(tls, (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr, uint64(uint32((*Tcl_HashTable)(unsafe.Pointer(hash)).FnumEntries)),
			uint64(unsafe.Sizeof(uintptr(0))), *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr) int32
			}{sNsEnsembleStringOrder})))
	}
}

//----------------------------------------------------------------------
//
// NsEnsembleStringOrder --
//
//	Helper function to compare two pointers to two strings for use with
//	qsort().
//
// Results:
//	-1 if the first string is smaller, 1 if the second string is smaller,
//	and 0 if they are equal.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sNsEnsembleStringOrder(tls *libc.TLS, strPtr1 uintptr, strPtr2 uintptr) int32 { /* tclEnsemble.c:2805:1: */
	return libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(strPtr1)), *(*uintptr)(unsafe.Pointer(strPtr2)))
}

//----------------------------------------------------------------------
//
// FreeEnsembleCmdRep --
//
//	Destroys the internal representation of a Tcl_Obj that has been
//	holding information about a command in an ensemble.
//
// Results:
//	None.
//
// Side effects:
//	Memory is deallocated. If this held the last reference to a
//	namespace's main structure, that main structure will also be
//	destroyed.
//
//----------------------------------------------------------------------

func sFreeEnsembleCmdRep(tls *libc.TLS, objPtr uintptr) { /* tclEnsemble.c:2832:1: */
	var ensembleCmd uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if libc.PostDecInt32(&(*Command)(unsafe.Pointer((*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken)).FrefCount, 1) <= 1 {
		XTclpFree(tls, (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken)
	}

	if (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	XTclpFree(tls, ensembleCmd)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// DupEnsembleCmdRep --
//
//	Makes one Tcl_Obj into a copy of another that is a subcommand of an
//	ensemble.
//
// Results:
//	None.
//
// Side effects:
//	Memory is allocated, and the namespace that the ensemble is built on
//	top of gains another reference.
//
//----------------------------------------------------------------------

func sDupEnsembleCmdRep(tls *libc.TLS, objPtr uintptr, copyPtr uintptr) { /* tclEnsemble.c:2864:1: */
	var ensembleCmd uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	var ensembleCopy uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(EnsembleCmdRep{})))

	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&ensembleCmdType))
	*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = ensembleCopy
	(*EnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Fepoch = (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Fepoch
	(*EnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Ftoken = (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken
	(*Command)(unsafe.Pointer((*EnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Ftoken)).FrefCount++
	(*EnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Ffix = (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix
	if (*EnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Ffix != 0 {
		(*Tcl_Obj)(unsafe.Pointer((*EnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Ffix)).FrefCount++
	}
	(*EnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).FhPtr = (*EnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).FhPtr
}

//----------------------------------------------------------------------
//
// TclCompileEnsemble --
//
//	Procedure called to compile an ensemble command. Note that most
//	ensembles are not compiled, since modifying a compiled ensemble causes
//	a invalidation of all existing bytecode (expensive!) which is not
//	normally warranted.
//
// Results:
//	Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
//	evaluation to runtime.
//
// Side effects:
//	Instructions are added to envPtr to execute the subcommands of the
//	ensemble at runtime if a compile-time mapping is possible.
//
//----------------------------------------------------------------------

func XTclCompileEnsemble(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:2905:1: */
	bp := tls.Alloc(92)
	defer tls.Free(92)

	var mapPtr uintptr
	var eclIndex int32
	var tokenPtr uintptr
	// var mapObj uintptr at bp, 8

	// var subcmdObj uintptr at bp+72, 8

	// var targetCmdObj uintptr at bp+40, 8

	// var listObj uintptr at bp+8, 8

	// var elems uintptr at bp+24, 8

	var replaced uintptr
	var replacement uintptr
	var ensemble Tcl_Command
	var oldCmdPtr uintptr
	var newCmdPtr uintptr
	// var len int32 at bp+20, 4

	var result int32
	// var flags int32 at bp+16, 4

	var i int32
	var depth int32
	var invokeAnyway int32
	var ourResult int32
	var numBytes uint32
	var word uintptr
	// var sclen int32 at bp+32, 4

	var str uintptr
	var matchObj uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr
	// var s Tcl_DictSearch at bp+48, 24

	// var done int32 at bp+88, 4

	var matched int32
	// var tmpObj uintptr at bp+80, 8

	var cachePtr2 uintptr
	var _objPtr uintptr
	mapPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	eclIndex = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	replaced = XTcl_NewObj(tls)
	ensemble = cmdPtr
	oldCmdPtr = cmdPtr
	*(*int32)(unsafe.Pointer(bp + 16 /* flags */)) = 0
	depth = 1
	invokeAnyway = 0
	ourResult = TCL_ERROR

	(*Tcl_Obj)(unsafe.Pointer(replaced)).FrefCount++
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < depth+1) {
		goto __1
	}
	goto failed
__1:
	;
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD) {
		goto __2
	}
	// Too hard.

	goto failed
__2:
	;

	// This is where we return to if we are parsing multiple nested compiled
	// ensembles. [info object] is such a beast.

checkNextWord:
	word = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart
	numBytes = uint32((*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fsize)

	// There's a sporting chance we'll be able to compile this. But now we
	// must check properly. To do that, check that we're compiling an ensemble
	// that has a compilable command as its appropriate subcommand.

	if !(XTcl_GetEnsembleMappingDict(tls, uintptr(0), ensemble, bp) != TCL_OK ||
		*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0)) {
		goto __3
	}
	// Either not an ensemble or a mapping isn't installed. Crud. Too hard
	// to proceed.

	goto failed
__3:
	;

	// Also refuse to compile anything that uses a formal parameter list for
	// now, on the grounds that it is too complex.

	if !(XTcl_GetEnsembleParameterList(tls, uintptr(0), ensemble, bp+8) != TCL_OK ||
		*(*uintptr)(unsafe.Pointer(bp + 8)) != uintptr(0)) {
		goto __4
	}
	// Figuring out how to compile this has become too much. Bail out.

	goto failed
__4:
	;

	// Next, get the flags. We need them on several code paths so that we can
	// know whether we're to do prefix matching.

	XTcl_GetEnsembleFlags(tls, uintptr(0), ensemble, bp+16)

	// Check to see if there's also a subcommand list; must check to see if
	// the subcommand we are calling is in that list if it exists, since that
	// list filters the entries in the map.

	XTcl_GetEnsembleSubcommandList(tls, uintptr(0), ensemble, bp+8)
	if !(*(*uintptr)(unsafe.Pointer(bp + 8)) != uintptr(0)) {
		goto __5
	}
	matchObj = uintptr(0)

	if !(XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 8)), bp+20, bp+24) != TCL_OK) {
		goto __7
	}
	goto failed
__7:
	;
	i = 0
__8:
	if !(i < *(*int32)(unsafe.Pointer(bp + 20))) {
		goto __10
	}
	str = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* elems */)) + uintptr(i)*8)), bp+32)
	if !(*(*int32)(unsafe.Pointer(bp + 32)) == int32(numBytes) && !(libc.Xmemcmp(tls, word, str, uint64(numBytes)) != 0)) {
		goto __11
	}
	// Exact match! Excellent!

	result = XTcl_DictObjGet(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp /* mapObj */)), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* elems */)) + uintptr(i)*8)), bp+40)
	if !(result != TCL_OK || *(*uintptr)(unsafe.Pointer(bp + 40)) == uintptr(0)) {
		goto __12
	}
	goto failed
__12:
	;
	replacement = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* elems */)) + uintptr(i)*8))
	goto doneMapLookup
__11:
	;

	// Check to see if we've got a prefix match. A single prefix match
	// is fine, and allows us to refine our dictionary lookup, but
	// multiple prefix matches is a Bad Thing and will prevent us from
	// making progress. Note that we cannot do the lookup immediately
	// in the prefix case; might be another entry later in the list
	// that causes things to fail.

	if !(*(*int32)(unsafe.Pointer(bp + 16))&TCL_ENSEMBLE_PREFIX != 0 &&
		libc.Xstrncmp(tls, word, str, uint64(numBytes)) == 0) {
		goto __13
	}
	if !(matchObj != uintptr(0)) {
		goto __14
	}
	goto failed
__14:
	;
	matchObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* elems */)) + uintptr(i)*8))
__13:
	;
	goto __9
__9:
	i++
	goto __8
	goto __10
__10:
	;
	if !(matchObj == uintptr(0)) {
		goto __15
	}
	goto failed
__15:
	;
	result = XTcl_DictObjGet(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp /* mapObj */)), matchObj, bp+40)
	if !(result != TCL_OK || *(*uintptr)(unsafe.Pointer(bp + 40)) == uintptr(0)) {
		goto __16
	}
	goto failed
__16:
	;
	replacement = matchObj
	goto __6
__5:

	// No map, so check the dictionary directly.

__17:
	;
__20:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __23
	}
	*(*uintptr)(unsafe.Pointer(bp + 72)) = XTclThreadAllocObj(tls)
	goto __24
__23:
	*(*uintptr)(unsafe.Pointer(bp + 72)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__24:
	;
	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FrefCount = 0
	if !(int32(numBytes) == 0) {
		goto __25
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Flength = 0
	goto __26
__25:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes = XTcl_Alloc(tls, uint32(int32(numBytes)+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes, word, uint64(int32(numBytes)))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes + uintptr(int32(numBytes)))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Flength = int32(numBytes)
__26:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FtypePtr = uintptr(0)

	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
	result = XTcl_DictObjGet(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp /* mapObj */)), *(*uintptr)(unsafe.Pointer(bp + 72 /* subcmdObj */)), bp+40)
	if !(result == TCL_OK && *(*uintptr)(unsafe.Pointer(bp + 40)) != uintptr(0)) {
		goto __27
	}
	// Got it. Skip the fiddling around with prefixes.

	replacement = *(*uintptr)(unsafe.Pointer(bp + 72 /* subcmdObj */))
	goto doneMapLookup
__27:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FrefCount, 1) > 1) {
		goto __28
	}
	goto __29
__28:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __30
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes != XtclEmptyStringRep) {
		goto __32
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes)
__32:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Flength = -1
__33:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __36
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 72)))
	goto __37
__36:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 72))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__37:
	;
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
	goto __31
__30:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* subcmdObj */)))
__31:
	;
__29:
	;

	// We've not literally got a valid subcommand. But maybe we have a
	// prefix. Check if prefix matches are allowed.

	if !!(*(*int32)(unsafe.Pointer(bp + 16))&TCL_ENSEMBLE_PREFIX != 0) {
		goto __38
	}
	goto failed
__38:
	;

	// Iterate over the keys in the dictionary, checking to see if we're a
	// prefix.

	XTcl_DictObjFirst(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp /* mapObj */)), bp+48, bp+72, bp+80, bp+88)
	matched = 0
	replacement = uintptr(0) // Silence, fool compiler!
__39:
	if !!(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
		goto __40
	}
	if !(libc.Xstrncmp(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 72)))
	}(), word, uint64(numBytes)) == 0) {
		goto __41
	}
	if !(libc.PostIncInt32(&matched, 1) != 0) {
		goto __42
	}
	// Must have matched twice! Not unique, so no point
	// looking further.

	goto __40
__42:
	;
	replacement = *(*uintptr)(unsafe.Pointer(bp + 72 /* subcmdObj */))
	*(*uintptr)(unsafe.Pointer(bp + 40 /* targetCmdObj */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* tmpObj */))
__41:
	;
	XTcl_DictObjNext(tls, bp+48, bp+72, bp+80, bp+88)
	goto __39
__40:
	;
	XTcl_DictObjDone(tls, bp+48)

	// If we have anything other than a single match, we've failed the
	// unique prefix check.

	if !(matched != 1) {
		goto __43
	}
	invokeAnyway = 1
	goto failed
__43:
	;
__6:
	;

	// OK, we definitely map to something. But what?
	//
	// The command we map to is the first word out of the map element. Note
	// that we also reject dealing with multi-element rewrites if we are in a
	// safe interpreter, as there is otherwise a (highly gnarly!) way to make
	// Tcl crash open to exploit.

doneMapLookup:
	XTcl_ListObjAppendElement(tls, uintptr(0), replaced, replacement)
	if !(XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 40)), bp+20, bp+24) != TCL_OK) {
		goto __44
	}
	goto failed
	goto __45
__44:
	if !(*(*int32)(unsafe.Pointer(bp + 20)) != 1) {
		goto __46
	}
	// Note that at this point we know we can't issue any special
	// instruction sequence as the mapping isn't one that we support at
	// the compiled level.

	goto cleanup
__46:
	;
__45:
	;
	*(*uintptr)(unsafe.Pointer(bp + 40 /* targetCmdObj */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* elems */))))

	oldCmdPtr = cmdPtr
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FrefCount++
	newCmdPtr = XTcl_GetCommandFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 40 /* targetCmdObj */)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FrefCount, 1) > 1) {
		goto __47
	}
	goto __48
__47:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __49
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).Fbytes != XtclEmptyStringRep) {
		goto __51
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).Fbytes)
__51:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).Flength = -1
__52:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __55
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40)))
	goto __56
__55:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 40))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__56:
	;
	goto __53
__53:
	if 0 != 0 {
		goto __52
	}
	goto __54
__54:
	;
	goto __50
__49:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* targetCmdObj */)))
__50:
	;
__48:
	;

	if !(newCmdPtr == uintptr(0) || XTcl_IsSafe(tls, interp) != 0 ||
		(*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(newCmdPtr)).FnsPtr)).Fflags&NS_SUPPRESS_COMPILATION != 0 ||
		(*Command)(unsafe.Pointer(newCmdPtr)).Fflags&CMD_HAS_EXEC_TRACES != 0 ||
		(*Interp)(unsafe.Pointer(interp)).Fflags&DONT_COMPILE_CMDS_INLINE != 0) {
		goto __57
	}
	// Maps to an undefined command or a command without a compiler.
	// Cannot compile.

	goto cleanup
__57:
	;
	cmdPtr = newCmdPtr
	depth++

	// See whether we have a nested ensemble. If we do, we can go round the
	// mulberry bush again, consuming the next word.

	if !((*Command)(unsafe.Pointer(cmdPtr)).FcompileProc == *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
	}{XTclCompileEnsemble}))) {
		goto __58
	}
	tokenPtr = tokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+1)*24
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < depth+1 ||
		(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype != TCL_TOKEN_SIMPLE_WORD) {
		goto __59
	}
	// Too hard because the user has done something unpleasant like
	// omitting the sub-ensemble's command name or used a non-constant
	// name for a sub-ensemble's command name; we respond by bailing
	// out completely (this is a rare case). [Bug 6d2f249a01]

	goto cleanup
__59:
	;
	ensemble = cmdPtr
	goto checkNextWord
__58:
	;

	// Now we've done the mapping process, can now actually try to compile.
	// If there is a subcommand compiler and that successfully produces code,
	// we'll use that. Otherwise, we fall back to generating opcodes to do the
	// invoke at runtime.

	invokeAnyway = 1
	if !(TCL_OK == XTclAttemptCompileProc(tls, interp, parsePtr, depth, cmdPtr,
		envPtr)) {
		goto __60
	}
	ourResult = TCL_OK
	goto cleanup
__60:
	;

	// Throw out any line information generated by the failed compile attempt.

__61:
	if !((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc-1 > eclIndex) {
		goto __62
	}
	(*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc--
	XTclpFree(tls, (*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc)*24)).Fline)
	(*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc)*24)).Fline = uintptr(0)
	goto __61
__62:
	;

	// Reset the index of next command.  Toss out any from failed nested
	// partial compiles.

	(*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc

	// Failed to do a full compile for some reason. Try to do a direct invoke
	// instead of going through the ensemble lookup process again.

failed:
	if !(depth < 250) {
		goto __63
	}
	if !(depth > 1) {
		goto __64
	}
	if !!(invokeAnyway != 0) {
		goto __65
	}
	cmdPtr = oldCmdPtr
	depth--
__65:
	;
__64:
	;
	// The length of the "replaced" list must be depth-1.  Trim back
	// any extra elements that might have been appended by failing
	// pathways above.
	XTcl_ListObjReplace(tls, uintptr(0), replaced, depth-1, 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))), 0, uintptr(0))

	// TODO: Reconsider whether we ought to call CompileToInvokedCommand()
	// when depth==1.  In that case we are choosing to emit the
	// INST_INVOKE_REPLACE bytecode when there is in fact no replacing
	// to be done.  It would be equally functional and presumably more
	// performant to fall through to cleanup below, return TCL_ERROR,
	// and let the compiler harness emit the INST_INVOKE_STK
	// implementation for us.

	sCompileToInvokedCommand(tls, interp, parsePtr, replaced, cmdPtr, envPtr)
	ourResult = TCL_OK
__63:
	;

	// Release the memory we allocated. If we've got here, we've either done
	// something useful or we're in a case that we can't compile at all and
	// we're just giving up.

cleanup:
__66:
	_objPtr = replaced
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __69
	}
	XTclFreeObj(tls, _objPtr)
__69:
	;
	goto __67
__67:
	if 0 != 0 {
		goto __66
	}
	goto __68
__68:
	;
	return ourResult
}

func XTclAttemptCompileProc(tls *libc.TLS, interp uintptr, parsePtr uintptr, depth int32, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3244:1: */
	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	var result int32
	var i int32
	var saveTokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	var savedStackDepth int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
	var savedCodeNext uint32 = uint32((int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) / 1)
	var savedAuxDataArrayNext int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext
	var savedExceptArrayNext int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext

	if (*Command)(unsafe.Pointer(cmdPtr)).FcompileProc == uintptr(0) {
		return TCL_ERROR
	}

	// Advance parsePtr->tokenPtr so that it points at the last subcommand.
	// This will be wrong, but it will not matter, and it will put the
	// tokens for the arguments in the right place without the needed to
	// allocate a synthetic Tcl_Parse struct, or copy tokens around.

	for i = 0; i < depth-1; i++ {
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+1)*24
	}
	*(*int32)(unsafe.Pointer(parsePtr + 28)) -= depth - 1

	// Shift the line information arrays to account for different word
	// index values.

	*(*uintptr)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*24 + 8)) += uintptr(depth-1) * 4
	*(*uintptr)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*24 + 16)) += uintptr(depth-1) * 8

	// Hand off compilation to the subcommand compiler. At last!

	result = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Command)(unsafe.Pointer(cmdPtr)).FcompileProc})).f(tls, interp, parsePtr, cmdPtr, envPtr)

	// Undo the shift.

	*(*uintptr)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*24 + 8)) -= uintptr(depth-1) * 4
	*(*uintptr)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*24 + 16)) -= uintptr(depth-1) * 8

	*(*int32)(unsafe.Pointer(parsePtr + 28)) += depth - 1
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = saveTokenPtr

	// If our target failed to compile, revert any data from failed partial
	// compiles.  Note that envPtr->numCommands need not be checked because
	// we avoid compiling subcommands that recursively call TclCompileScript().

	if result != TCL_OK {
		var auxPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr

		for i = 0; i < savedExceptArrayNext; i++ {
			for (*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets > 0 &&
				*(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr((*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets-1)*4)) >=
					savedCodeNext {
				(*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets--
			}
			for (*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets > 0 &&
				*(*uint32)(unsafe.Pointer((*ExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr((*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets-1)*4)) >=
					savedCodeNext {
				(*ExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets--
			}
			auxPtr += 56
		}
		(*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext = savedExceptArrayNext

		if savedAuxDataArrayNext != (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext {
			var auxDataPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr
			var auxDataEnd uintptr = auxDataPtr

			auxDataPtr += 16 * uintptr(savedAuxDataArrayNext)
			auxDataEnd += 16 * uintptr((*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext)

			for auxDataPtr < auxDataEnd {
				if (*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxDataPtr)).Ftype)).FfreeProc != uintptr(0) {
					(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*AuxDataType)(unsafe.Pointer((*AuxData)(unsafe.Pointer(auxDataPtr)).Ftype)).FfreeProc})).f(tls, (*AuxData)(unsafe.Pointer(auxDataPtr)).FclientData)
				}
				auxDataPtr += 16
			}
			(*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext = savedAuxDataArrayNext
		}
		(*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = savedStackDepth
		(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(savedCodeNext)
	}

	return result
}

// How to compile a subcommand to a _replacing_ invoke of its implementation
// command.

func sCompileToInvokedCommand(tls *libc.TLS, interp uintptr, parsePtr uintptr, replacements uintptr, cmdPtr uintptr, envPtr uintptr) { /* tclEnsemble.c:3377:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var mapPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr
	var eclIndex int32 = (*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - 1
	var tokPtr uintptr
	var objPtr uintptr
	// var words uintptr at bp+24, 8

	var bytes uintptr
	// var length int32 at bp+32, 4

	var i int32
	// var numWords int32 at bp+16, 4

	var cmdLit int32
	var extraLiteralFlags int32 = LITERAL_CMD_NAME

	// Push the words of the command. Take care; the command words may be
	// scripts that have backslashes in them, and [info frame 0] can see the
	// difference. Hence the call to TclContinuationsEnterDerived...

	XTcl_ListObjGetElements(tls, uintptr(0), replacements, bp+16, bp+24)
	i = 0
	tokPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
__1:
	if !(i < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) {
		goto __3
	}
	{
		if i > 0 && i < *(*int32)(unsafe.Pointer(bp + 16))+1 {
			bytes = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* words */)) + uintptr(i-1)*8)), bp+32)
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp + 32)), 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
			goto __2
		}

		(*CompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*int32)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fline + uintptr(i)*4))
		(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc+uintptr(eclIndex)*24)).Fnext + uintptr(i)*8))
		if (*Tcl_Token)(unsafe.Pointer(tokPtr)).Ftype == TCL_TOKEN_SIMPLE_WORD {
			var literal int32 = XTclRegisterLiteral(tls, envPtr, (*Tcl_Token)(unsafe.Pointer(tokPtr+1*24)).Fstart, (*Tcl_Token)(unsafe.Pointer(tokPtr+1*24)).Fsize /*flags*/, 0)

			if (*CompileEnv)(unsafe.Pointer(envPtr)).FclNext != 0 {
				XTclContinuationsEnterDerived(tls,
					XTclFetchLiteral(tls, envPtr, uint32(literal)),
					int32((int64((*Tcl_Token)(unsafe.Pointer(tokPtr+1*24)).Fstart)-int64((*CompileEnv)(unsafe.Pointer(envPtr)).Fsource))/1),
					(*CompileEnv)(unsafe.Pointer(envPtr)).FclNext)
			}
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objIndexCopy int32 = literal
				if _objIndexCopy <= 255 {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok9 := true; ok9; ok9 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok10 := true; ok10; ok10 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok11 := true; ok11; ok11 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
							XTclExpandCodeArray(tls, envPtr)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok12 := true; ok12; ok12 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok13 := true; ok13; ok13 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
								}
							}
						}
					}
				}
			}
		} else {
			XTclCompileTokens(tls, interp, tokPtr+uintptr(1)*24, (*Tcl_Token)(unsafe.Pointer(tokPtr)).FnumComponents, envPtr)

		}

	}
	goto __2
__2:
	i++
	tokPtr = tokPtr + uintptr((*Tcl_Token)(unsafe.Pointer(tokPtr)).FnumComponents+1)*24
	goto __1
	goto __3
__3:
	;

	// Push the name of the command we're actually dispatching to as part of
	// the implementation.

	objPtr = XTcl_NewObj(tls)
	XTcl_GetCommandFullName(tls, interp, cmdPtr, objPtr)
	bytes = XTcl_GetStringFromObj(tls, objPtr, bp+32)
	if cmdPtr != uintptr(0) && (*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_VIA_RESOLVER != 0 {
		extraLiteralFlags = extraLiteralFlags | LITERAL_UNSHARED
	}
	cmdLit = XTclRegisterLiteral(tls, envPtr, bytes, *(*int32)(unsafe.Pointer(bp + 32 /* length */)), extraLiteralFlags)
	XTclSetCmdNameObj(tls, interp, XTclFetchLiteral(tls, envPtr, uint32(cmdLit)), cmdPtr)
	for ok14 := true; ok14; ok14 = 0 != 0 {
		var _objIndexCopy int32 = cmdLit
		if _objIndexCopy <= 255 {
			for ok15 := true; ok15; ok15 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH1)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH1 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok16 := true; ok16; ok16 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok17 := true; ok17; ok17 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		} else {
			for ok18 := true; ok18; ok18 = 0 != 0 {
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd {
					XTclExpandCodeArray(tls, envPtr)
				}
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(INST_PUSH4)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
				*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
				if (*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < 2 {
					(*CompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = func() int32 {
						if INST_PUSH4 == INST_START_CMD {
							return 1
						}
						return 0
					}()
				}
				for ok19 := true; ok19; ok19 = 0 != 0 {
					var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
					if _delta != 0 {
						if _delta == -0x7fffffff-1 {
							_delta = 1 - _objIndexCopy
						}
						for ok20 := true; ok20; ok20 = 0 != 0 {
							if _delta < 0 {
								if (*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth {
									(*CompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth
								}
							}
							*(*int32)(unsafe.Pointer(envPtr + 48)) += _delta
						}
					}
				}
			}
		}
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
			for ok21 := true; ok21; ok21 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, objPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, objPtr)
		}
	}

	// Do the replacing dispatch.

	XTclEmitInvoke(tls, envPtr, INST_INVOKE_REPLACE, libc.VaList(bp, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords, *(*int32)(unsafe.Pointer(bp + 16))+1))
}

// Helpers that do issuing of instructions for commands that "don't have
// compilers" (well, they do; these). They all work by just generating base
// code to invoke the command; they're intended for ensemble subcommands so
// that the costs of INST_INVOKE_REPLACE can be avoided where we can work out
// that they're not needed.
//
// Note that these are NOT suitable for commands where there's an argument
// that is a script, as an [info level] or [info frame] in the inner context
// can see the difference.

func sCompileBasicNArgCommand(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3458:1: */
	var objPtr uintptr = XTcl_NewObj(tls)

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	XTcl_GetCommandFullName(tls, interp, cmdPtr, objPtr)
	XTclCompileInvocation(tls, interp, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, objPtr,
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords, envPtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = objPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return TCL_OK
}

func XTclCompileBasic0ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3477:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 1 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileBasic1ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3499:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileBasic2ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3521:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileBasic3ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3543:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 4 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileBasic0Or1ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3565:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 1 && (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileBasic1Or2ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3587:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 2 && (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileBasic2Or3ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3609:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 3 && (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != 4 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileBasic0To2ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3631:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 1 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 3 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileBasic1To3ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3653:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 2 || (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 4 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileBasicMin0ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3675:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 1 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileBasicMin1ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3697:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 2 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

func XTclCompileBasicMin2ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) int32 { /* tclEnsemble.c:3719:1: */
	// Verify that the number of arguments is correct; that's the only case
	// that we know will avoid the call to Tcl_WrongNumArgs() at invoke time,
	// which is the only code that sees the shenanigans of ensemble dispatch.

	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < 3 {
		return TCL_ERROR
	}

	return sCompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

var envMutex Tcl_Mutex /* tclEnv.c:18:1: */ // To serialize access to environ.

// MODULE_SCOPE
var XTclEnvEpoch Size_t = uint64(0) /* tclEnv.c:41:8 */ // Epoch of the tcl environment
// (if changed with tcl-env).

var env struct {
	FcacheSize      int32
	F__ccgo_pad1    [4]byte
	Fcache          uintptr
	FourEnviron     uintptr
	FourEnvironSize int32
	F__ccgo_pad2    [4]byte
} /* tclEnv.c:59:3: */

//----------------------------------------------------------------------
//
// TclSetupEnv --
//
//	This function is invoked for an interpreter to make environment
//	variables accessible from that interpreter via the "env" associative
//	array.
//
// Results:
//	None.
//
// Side effects:
//	The interpreter is added to a list of interpreters managed by us, so
//	that its view of envariables can be kept consistent with the view in
//	other interpreters. If this is the first call to TclSetupEnv, then
//	additional initialization happens, such as copying the environment to
//	dynamically-allocated space for ease of management.
//
//----------------------------------------------------------------------

func XTclSetupEnv(tls *libc.TLS, interp uintptr) { /* tclEnv.c:96:1: */
	bp := tls.Alloc(336)
	defer tls.Free(336)

	var varPtr uintptr
	// var arrayPtr uintptr at bp+88, 8

	var varNamePtr uintptr
	// var envString Tcl_DString at bp+96, 216

	// var namesHash Tcl_HashTable at bp, 88

	var hPtr uintptr
	// var search Tcl_HashSearch at bp+312, 24

	// Synchronize the values in the environ array with the contents of the
	// Tcl "env" variable. To do this:
	//    1) Remove the trace that fires when the "env" var is updated.
	//    2) Find the existing contents of the "env", storing in a hash table.
	//    3) Create/update elements for each environ variable, removing
	//	     elements from the hash table as we go.
	//    4) Remove the elements for each remaining entry in the hash table,
	//	     which must have existed before yet have no analog in the environ
	//	     variable.
	//    5) Add a trace that synchronizes the "env" array.

	XTcl_UntraceVar2(tls, interp, ts+27231, uintptr(0),
		TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS|TCL_TRACE_READS|TCL_TRACE_ARRAY, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sEnvTraceProc})), uintptr(0))

	// Find out what elements are currently in the global env array.

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				varNamePtr = XTclThreadAllocObj(tls)
			} else {
				varNamePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(varNamePtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes, ts+27231, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes + 3)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).FrefCount++
	XTcl_InitObjHashTable(tls, bp)
	varPtr = XTclObjLookupVarEx(tls, interp, varNamePtr, uintptr(0), TCL_GLOBAL_ONLY,
		/*msg*/ uintptr(0) /*createPart1*/, 0 /*createPart2*/, 0, bp+88)
	XTclFindArrayPtrElements(tls, varPtr, bp)

	// Go through the environment array and transfer its values into Tcl. At
	// the same time, remove those elements we add/update from the hash table
	// of existing elements, so that after this part processes, that table
	// will hold just the parts to remove.

	if *(*uintptr)(unsafe.Pointer(libc.Xenviron)) != uintptr(0) {
		var i int32

		XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&envMutex)))
		for i = 0; *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(i)*8)) != uintptr(0); i++ {
			var obj1 uintptr
			var obj2 uintptr
			var p1 uintptr
			var p2 uintptr

			p1 = XTcl_ExternalToUtfDString(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(i)*8)), -1, bp+96)
			p2 = libc.Xstrchr(tls, p1, '=')
			if p2 == uintptr(0) {
				// This condition seem to happen occasionally under some
				// versions of Solaris, or when encoding accidents swallow the
				// '='; ignore the entry.

				XTcl_DStringFree(tls, bp+96)
				continue
			}
			p2++
			*(*int8)(unsafe.Pointer(p2 + libc.UintptrFromInt32(-1))) = int8(0)
			obj1 = XTcl_NewStringObj(tls, p1, -1)
			obj2 = XTcl_NewStringObj(tls, p2, -1)
			XTcl_DStringFree(tls, bp+96)

			(*Tcl_Obj)(unsafe.Pointer(obj1)).FrefCount++
			(*Tcl_Obj)(unsafe.Pointer(obj2)).FrefCount++
			XTcl_ObjSetVar2(tls, interp, varNamePtr, obj1, obj2, TCL_GLOBAL_ONLY)
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &namesHash */)).FfindProc})).f(tls, bp /* &namesHash */, obj1)
			if hPtr != uintptr(0) {
				XTcl_DeleteHashEntry(tls, hPtr)
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = obj1
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var _objPtr uintptr = obj2
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&envMutex)))
	}

	// Delete those elements that existed in the array but which had no
	// counterparts in the environment array.

	for hPtr = XTcl_FirstHashEntry(tls, bp, bp+312); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp+312) {
		var elemName uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		XTclObjUnsetVar2(tls, interp, varNamePtr, elemName, TCL_GLOBAL_ONLY)
	}
	XTcl_DeleteHashTable(tls, bp)
	for ok4 := true; ok4; ok4 = 0 != 0 {
		var _objPtr uintptr = varNamePtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	// Re-establish the trace.

	XTcl_TraceVar2(tls, interp, ts+27231, uintptr(0),
		TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS|TCL_TRACE_READS|TCL_TRACE_ARRAY, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sEnvTraceProc})), uintptr(0))
}

//----------------------------------------------------------------------
//
// TclSetEnv --
//
//	Set an environment variable, replacing an existing value or creating a
//	new variable if there doesn't exist a variable by the given name. This
//	function is intended to be a stand-in for the UNIX "setenv" function
//	so that applications using that function will interface properly to
//	Tcl. To make it a stand-in, the Makefile must define "TclSetEnv" to
//	"setenv".
//
// Results:
//	None.
//
// Side effects:
//	The environ array gets updated.
//
//----------------------------------------------------------------------

func XTclSetEnv(tls *libc.TLS, name uintptr, value uintptr) { /* tclEnv.c:250:1: */
	bp := tls.Alloc(224)
	defer tls.Free(224)

	// var envString Tcl_DString at bp+8, 216

	var nameLength uint32
	var valueLength uint32
	var index int32
	// var length int32 at bp, 4

	var p uintptr
	var oldValue uintptr
	var p2 uintptr

	// Figure out where the entry is going to go. If the name doesn't already
	// exist, enlarge the array if necessary to make room. If the name exists,
	// free its old entry.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&envMutex)))
	index = XTclpFindVariable(tls, name, bp)

	if index == -1 {
		// We need to handle the case where the environment may be changed
		// outside our control. ourEnvironSize is only valid if the current
		// environment is the one we allocated. [Bug 979640]

		if env.FourEnviron != libc.Xenviron || *(*int32)(unsafe.Pointer(bp))+2 > env.FourEnvironSize {
			var newEnviron uintptr = XTcl_Alloc(tls, uint32(uint64(*(*int32)(unsafe.Pointer(bp))+5)*uint64(unsafe.Sizeof(uintptr(0)))))

			libc.Xmemcpy(tls, newEnviron, libc.Xenviron, uint64(*(*int32)(unsafe.Pointer(bp)))*uint64(unsafe.Sizeof(uintptr(0))))
			if env.FourEnvironSize != 0 && env.FourEnviron != uintptr(0) {
				XTclpFree(tls, env.FourEnviron)
			}
			libc.Xenviron = libc.AssignPtrUintptr(uintptr(unsafe.Pointer(&env))+16, newEnviron)
			env.FourEnvironSize = *(*int32)(unsafe.Pointer(bp)) + 5
		}
		index = *(*int32)(unsafe.Pointer(bp /* length */))
		*(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index+1)*8)) = uintptr(0)
		oldValue = uintptr(0)
		nameLength = uint32(libc.Xstrlen(tls, name))
	} else {
		var oldEnv uintptr

		// Compare the new value to the existing value. If they're the same
		// then quit immediately (e.g. don't rewrite the value or propagate it
		// to other interpreters). Otherwise, when there are N interpreters
		// there will be N! propagations of the same value among the
		// interpreters.

		oldEnv = XTcl_ExternalToUtfDString(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8)), -1, bp+8)
		if libc.Xstrcmp(tls, value, oldEnv+uintptr(*(*int32)(unsafe.Pointer(bp))+1)) == 0 {
			XTcl_DStringFree(tls, bp+8)
			XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&envMutex)))
			return
		}
		XTcl_DStringFree(tls, bp+8)

		oldValue = *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8))
		nameLength = uint32(*(*int32)(unsafe.Pointer(bp /* length */)))
	}

	// Create a new entry. Build a complete UTF string that contains a
	// "name=value" pattern. Then convert the string to the native encoding,
	// and set the environ array value.

	valueLength = uint32(libc.Xstrlen(tls, value))
	p = XTcl_Alloc(tls, nameLength+valueLength+uint32(2))
	libc.Xmemcpy(tls, p, name, uint64(nameLength))
	*(*int8)(unsafe.Pointer(p + uintptr(nameLength))) = int8('=')
	libc.Xmemcpy(tls, p+uintptr(nameLength)+uintptr(1), value, uint64(valueLength+uint32(1)))
	p2 = XTcl_UtfToExternalDString(tls, uintptr(0), p, -1, bp+8)

	// Copy the native string to heap memory.

	p = XTcl_Realloc(tls, p, uint32(uint64((*Tcl_DString)(unsafe.Pointer(bp+8)).Flength)+uint64(unsafe.Sizeof(int8(0)))))
	libc.Xmemcpy(tls, p, p2, uint64((*Tcl_DString)(unsafe.Pointer(bp+8)).Flength)+uint64(unsafe.Sizeof(int8(0))))
	XTcl_DStringFree(tls, bp+8)

	*(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8)) = p

	// Watch out for versions of putenv that copy the string (e.g. VC++). In
	// this case we need to free the string immediately. Otherwise update the
	// string in the cache.

	if index != -1 && *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8)) == p {
		sReplaceString(tls, oldValue, p)
	}

	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&envMutex)))

	if !(libc.Xstrcmp(tls, name, ts+27235) != 0) {
		// If the user's home directory has changed, we must invalidate the
		// filesystem cache, because '~' expansions will now be incorrect.

		XTcl_FSMountsChanged(tls, uintptr(0))
	}
}

//----------------------------------------------------------------------
//
// Tcl_PutEnv --
//
//	Set an environment variable. Similar to setenv except that the
//	information is passed in a single string of the form NAME=value,
//	rather than as separate name strings. This function is intended to be
//	a stand-in for the UNIX "putenv" function so that applications using
//	that function will interface properly to Tcl. To make it a stand-in,
//	the Makefile will define "Tcl_PutEnv" to "putenv".
//
// Results:
//	None.
//
// Side effects:
//	The environ array gets updated, as do all of the interpreters that we
//	manage.
//
//----------------------------------------------------------------------

func XTcl_PutEnv(tls *libc.TLS, assignment uintptr) int32 { /* tclEnv.c:401:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	// var nameString Tcl_DString at bp, 216

	var name uintptr
	var value uintptr

	if assignment == uintptr(0) {
		return 0
	}

	// First convert the native string to UTF. Then separate the string into
	// name and value parts, and call TclSetEnv to do all of the real work.

	name = XTcl_ExternalToUtfDString(tls, uintptr(0), assignment, -1, bp)
	value = libc.Xstrchr(tls, name, '=')

	if value != uintptr(0) && value != name {
		*(*int8)(unsafe.Pointer(value)) = int8(0)
		XTclSetEnv(tls, name, value+uintptr(1))
	}
	XTclEnvEpoch++

	XTcl_DStringFree(tls, bp)
	return 0
}

//----------------------------------------------------------------------
//
// TclUnsetEnv --
//
//	Remove an environment variable, updating the "env" arrays in all
//	interpreters managed by us. This function is intended to replace the
//	UNIX "unsetenv" function (but to do this the Makefile must be modified
//	to redefine "TclUnsetEnv" to "unsetenv".
//
// Results:
//	None.
//
// Side effects:
//	Interpreters are updated, as is environ.
//
//----------------------------------------------------------------------

func XTclUnsetEnv(tls *libc.TLS, name uintptr) { /* tclEnv.c:461:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var oldValue uintptr
	// var length int32 at bp, 4

	var index int32
	var envPtr uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&envMutex)))
	index = XTclpFindVariable(tls, name, bp)

	// First make sure that the environment variable exists to avoid doing
	// needless work and to avoid recursion on the unset.

	if index == -1 {
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&envMutex)))
		return
	}

	// Remember the old value so we can free it if Tcl created the string.

	oldValue = *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8))

	// Update the system environment. This must be done before we update the
	// interpreters or we will recurse.

	for envPtr = libc.Xenviron + uintptr(index)*8 + uintptr(1)*8; ; envPtr += 8 {
		*(*uintptr)(unsafe.Pointer(envPtr + libc.UintptrFromInt32(-1)*8)) = *(*uintptr)(unsafe.Pointer(envPtr))
		if *(*uintptr)(unsafe.Pointer(envPtr)) == uintptr(0) {
			break
		}
	}
	sReplaceString(tls, oldValue, uintptr(0))

	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&envMutex)))
}

//---------------------------------------------------------------------------
//
// TclGetEnv --
//
//	Retrieve the value of an environment variable.
//
// Results:
//	The result is a pointer to a string specifying the value of the
//	environment variable, or NULL if that environment variable does not
//	exist. Storage for the result string is allocated in valuePtr; the
//	caller must call Tcl_DStringFree() when the result is no longer
//	needed.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetEnv(tls *libc.TLS, name uintptr, valuePtr uintptr) uintptr { /* tclEnv.c:573:12: */
	bp := tls.Alloc(224)
	defer tls.Free(224)

	// var length int32 at bp, 4

	var index int32
	var result uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&envMutex)))
	index = XTclpFindVariable(tls, name, bp)
	result = uintptr(0)
	if index != -1 {
		// var envStr Tcl_DString at bp+8, 216

		result = XTcl_ExternalToUtfDString(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8)), -1, bp+8)
		result += uintptr(*(*int32)(unsafe.Pointer(bp /* length */)))
		if int32(*(*int8)(unsafe.Pointer(result))) == '=' {
			result++
			XTcl_DStringInit(tls, valuePtr)
			XTcl_DStringAppend(tls, valuePtr, result, -1)
			result = (*Tcl_DString)(unsafe.Pointer(valuePtr)).Fstring
		} else {
			result = uintptr(0)
		}
		XTcl_DStringFree(tls, bp+8)
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&envMutex)))
	return result
}

//----------------------------------------------------------------------
//
// EnvTraceProc --
//
//	This function is invoked whenever an environment variable is read,
//	modified or deleted. It propagates the change to the global "environ"
//	array.
//
// Results:
//	Returns NULL to indicate success, or an error-message if the array
//	element being handled doesn't exist.
//
// Side effects:
//	Environment variable changes get propagated. If the whole "env" array
//	is deleted, then we stop managing things for this interpreter (usually
//	this happens because the whole interpreter is being deleted).
//
//----------------------------------------------------------------------

// ARGSUSED
func sEnvTraceProc(tls *libc.TLS, clientData ClientData, interp uintptr, name1 uintptr, name2 uintptr, flags int32) uintptr { /* tclEnv.c:628:13: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	// For array traces, let TclSetupEnv do all the work.

	if flags&TCL_TRACE_ARRAY != 0 {
		XTclSetupEnv(tls, interp)
		XTclEnvEpoch++
		return uintptr(0)
	}

	// If name2 is NULL, then return and do nothing.

	if name2 == uintptr(0) {
		return uintptr(0)
	}

	// If a value is being set, call TclSetEnv to do all of the work.

	if flags&TCL_TRACE_WRITES != 0 {
		var value uintptr

		value = XTcl_GetVar2(tls, interp, ts+27231, name2, TCL_GLOBAL_ONLY)
		XTclSetEnv(tls, name2, value)
		XTclEnvEpoch++
	}

	// If a value is being read, call TclGetEnv to do all of the work.

	if flags&TCL_TRACE_READS != 0 {
		// var valueString Tcl_DString at bp, 216

		var value uintptr = XTclGetEnv(tls, name2, bp)

		if value == uintptr(0) {
			return ts + 27240 /* "no such variable" */
		}
		XTcl_SetVar2(tls, interp, name1, name2, value, 0)
		XTcl_DStringFree(tls, bp)
	}

	// For unset traces, let TclUnsetEnv do all the work.

	if flags&TCL_TRACE_UNSETS != 0 {
		XTclUnsetEnv(tls, name2)
		XTclEnvEpoch++
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// ReplaceString --
//
//	Replace one string with another in the environment variable cache. The
//	cache keeps track of all of the environment variables that Tcl has
//	modified so they can be freed later.
//
// Results:
//	None.
//
// Side effects:
//	May free the old string.
//
//----------------------------------------------------------------------

func sReplaceString(tls *libc.TLS, oldStr uintptr, newStr uintptr) { /* tclEnv.c:713:1: */
	var i int32

	// Check to see if the old value was allocated by Tcl. If so, it needs to
	// be deallocated to avoid memory leaks. Note that this algorithm is O(n),
	// not O(1). This will result in n-squared behavior if lots of environment
	// changes are being made.

	for i = 0; i < env.FcacheSize; i++ {
		if *(*uintptr)(unsafe.Pointer(env.Fcache + uintptr(i)*8)) == oldStr || *(*uintptr)(unsafe.Pointer(env.Fcache + uintptr(i)*8)) == uintptr(0) {
			break
		}
	}
	if i < env.FcacheSize {
		// Replace or delete the old value.

		if *(*uintptr)(unsafe.Pointer(env.Fcache + uintptr(i)*8)) != 0 {
			XTclpFree(tls, *(*uintptr)(unsafe.Pointer(env.Fcache + uintptr(i)*8)))
		}

		if newStr != 0 {
			*(*uintptr)(unsafe.Pointer(env.Fcache + uintptr(i)*8)) = newStr
		} else {
			for ; i < env.FcacheSize-1; i++ {
				*(*uintptr)(unsafe.Pointer(env.Fcache + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(env.Fcache + uintptr(i+1)*8))
			}
			*(*uintptr)(unsafe.Pointer(env.Fcache + uintptr(env.FcacheSize-1)*8)) = uintptr(0)
		}
	} else {
		// We need to grow the cache in order to hold the new string.

		var growth int32 = 5

		env.Fcache = XTcl_Realloc(tls, env.Fcache, uint32(uint64(env.FcacheSize+growth)*uint64(unsafe.Sizeof(uintptr(0)))))
		*(*uintptr)(unsafe.Pointer(env.Fcache + uintptr(env.FcacheSize)*8)) = newStr
		libc.Xmemset(tls, env.Fcache+uintptr(env.FcacheSize)*8+uintptr(1)*8, 0,
			Size_t(growth-1)*Size_t(unsafe.Sizeof(uintptr(0))))
		*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&env)))) += growth
	}
}

//----------------------------------------------------------------------
//
// TclFinalizeEnvironment --
//
//	This function releases any storage allocated by this module that isn't
//	still in use by the global environment. Any strings that are still in
//	the environment will be leaked.
//
// Results:
//	None.
//
// Side effects:
//	May deallocate storage.
//
//----------------------------------------------------------------------

func XTclFinalizeEnvironment(tls *libc.TLS) { /* tclEnv.c:783:1: */
	// For now we just deallocate the cache array and none of the environment
	// strings. This may leak more memory that strictly necessary, since some
	// of the strings may no longer be in the environment. However,
	// determining which ones are ok to delete is n-squared, and is pretty
	// unlikely, so we don't bother.  However, in the case of DPURIFY, just
	// free all strings in the cache.

	if env.Fcache != 0 {
		XTclpFree(tls, env.Fcache)
		env.Fcache = uintptr(0)
		env.FcacheSize = 0
		if env.FourEnviron != uintptr(0) {
			XTclpFree(tls, env.FourEnviron)
			env.FourEnviron = uintptr(0)
		}
		env.FourEnvironSize = 0
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The data structure below is used to report background errors. One such
// structure is allocated for each error; it holds information about the
// interpreter and the error until an idle handler command can be invoked.

type BgError1 = struct {
	FerrorMsg   uintptr
	FreturnOpts uintptr
	FnextPtr    uintptr
} /* tclEvent.c:24:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The data structure below is used to report background errors. One such
// structure is allocated for each error; it holds information about the
// interpreter and the error until an idle handler command can be invoked.

type BgError = BgError1 /* tclEvent.c:32:3 */

// One of the structures below is associated with the "tclBgError" assoc data
// for each interpreter. It keeps track of the head and tail of the list of
// pending background errors for the interpreter.

type ErrAssocData1 = struct {
	Finterp     uintptr
	FcmdPrefix  uintptr
	FfirstBgPtr uintptr
	FlastBgPtr  uintptr
} /* tclEvent.c:40:9 */

// One of the structures below is associated with the "tclBgError" assoc data
// for each interpreter. It keeps track of the head and tail of the list of
// pending background errors for the interpreter.

type ErrAssocData = ErrAssocData1 /* tclEvent.c:49:3 */

// For each exit handler created with a call to Tcl_Create(Late)ExitHandler
// there is a structure of the following type:

type ExitHandler1 = struct {
	Fproc       uintptr
	FclientData ClientData
	FnextPtr    uintptr
} /* tclEvent.c:56:9 */

// For each exit handler created with a call to Tcl_Create(Late)ExitHandler
// there is a structure of the following type:

type ExitHandler = ExitHandler1 /* tclEvent.c:61:3 */

// There is both per-process and per-thread exit handlers. The first list is
// controlled by a mutex. The other is in thread local storage.

var firstExitPtr uintptr = uintptr(0) /* tclEvent.c:68:20 */
// First in list of all exit handlers for
// application.
var firstLateExitPtr uintptr = uintptr(0) /* tclEvent.c:71:20 */
// First in list of all late exit handlers for
// application.
var exitMutex Tcl_Mutex /* tclEvent.c:74:1: */

// This variable is set to 1 when Tcl_Exit is called. The variable is checked
// by TclInExit() to allow different behavior for exit-time processing, e.g.,
// in closing of files and pipes.

var inExit int32 = 0 /* tclEvent.c:82:12 */

var subsystemsInitialized int32 = 0 /* tclEvent.c:84:12 */

// This variable contains the application wide exit handler. It will be called
// by Tcl_Exit instead of the C-runtime exit if this variable is set to a
// non-NULL value.

var appExitPtr uintptr = uintptr(0) /* tclEvent.c:92:35 */

type ThreadSpecificData1 = struct {
	FfirstExitPtr uintptr
	FinExit       int32
	F__ccgo_pad1  [4]byte
}                              /* tclEvent.c:100:3 */
var dataKey1 Tcl_ThreadDataKey /* tclEvent.c:101:26: */

type ThreadClientData = struct {
	Fproc       uintptr
	FclientData ClientData
} /* tclEvent.c:107:3 */

//----------------------------------------------------------------------
//
// Tcl_BackgroundError --
//
//	This function is invoked to handle errors that occur in Tcl commands
//	that are invoked in "background" (e.g. from event or timer bindings).
//
// Results:
//	None.
//
// Side effects:
//	A handler command is invoked later as an idle handler to process the
//	error, passing it the interp result and return options.
//
//----------------------------------------------------------------------

func XTcl_BackgroundError(tls *libc.TLS, interp uintptr) { /* tclEvent.c:143:1: */
	XTcl_BackgroundException(tls, interp, TCL_ERROR)
}

func XTcl_BackgroundException(tls *libc.TLS, interp uintptr, code int32) { /* tclEvent.c:151:1: */
	var errPtr uintptr
	var assocPtr uintptr

	if code == TCL_OK {
		return
	}

	errPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(BgError{})))
	(*BgError)(unsafe.Pointer(errPtr)).FerrorMsg = XTcl_GetObjResult(tls, interp)
	(*Tcl_Obj)(unsafe.Pointer((*BgError)(unsafe.Pointer(errPtr)).FerrorMsg)).FrefCount++
	(*BgError)(unsafe.Pointer(errPtr)).FreturnOpts = XTcl_GetReturnOptions(tls, interp, code)
	(*Tcl_Obj)(unsafe.Pointer((*BgError)(unsafe.Pointer(errPtr)).FreturnOpts)).FrefCount++
	(*BgError)(unsafe.Pointer(errPtr)).FnextPtr = uintptr(0)

	XTclGetBgErrorHandler(tls, interp)
	assocPtr = XTcl_GetAssocData(tls, interp, ts+27257, uintptr(0))
	if (*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr == uintptr(0) {
		(*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr = errPtr
		XTcl_DoWhenIdle(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sHandleBgErrors})), assocPtr)
	} else {
		(*BgError)(unsafe.Pointer((*ErrAssocData)(unsafe.Pointer(assocPtr)).FlastBgPtr)).FnextPtr = errPtr
	}
	(*ErrAssocData)(unsafe.Pointer(assocPtr)).FlastBgPtr = errPtr
	XTcl_ResetResult(tls, interp)
}

//----------------------------------------------------------------------
//
// HandleBgErrors --
//
//	This function is invoked as an idle handler to process all of the
//	accumulated background errors.
//
// Results:
//	None.
//
// Side effects:
//	Depends on what actions the handler command takes for the errors.
//
//----------------------------------------------------------------------

func sHandleBgErrors(tls *libc.TLS, clientData ClientData) { /* tclEvent.c:200:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var assocPtr uintptr = clientData
	var interp uintptr = (*ErrAssocData)(unsafe.Pointer(assocPtr)).Finterp
	var errPtr uintptr

	// Not bothering to save/restore the interp state. Assume that any code
	// that has interp state it needs to keep will make its own
	// Tcl_SaveInterpState call before calling something like Tcl_DoOneEvent()
	// that could lead us here.

	XTcl_Preserve(tls, assocPtr)
	XTcl_Preserve(tls, interp)
	for (*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr != uintptr(0) {
		var code int32
		// var prefixObjc int32 at bp, 4

		// var prefixObjv uintptr at bp+8, 8

		var tempObjv uintptr

		// Note we copy the handler command prefix each pass through, so we do
		// support one handler setting another handler.

		var copyObj uintptr = XTclListObjCopy(tls, uintptr(0), (*ErrAssocData)(unsafe.Pointer(assocPtr)).FcmdPrefix)

		errPtr = (*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr

		XTcl_ListObjGetElements(tls, uintptr(0), copyObj, bp, bp+8)
		tempObjv = XTcl_Alloc(tls, uint32(uint64(*(*int32)(unsafe.Pointer(bp))+2)*uint64(unsafe.Sizeof(uintptr(0)))))
		libc.Xmemcpy(tls, tempObjv, *(*uintptr)(unsafe.Pointer(bp + 8 /* prefixObjv */)), uint64(*(*int32)(unsafe.Pointer(bp)))*uint64(unsafe.Sizeof(uintptr(0))))
		*(*uintptr)(unsafe.Pointer(tempObjv + uintptr(*(*int32)(unsafe.Pointer(bp /* prefixObjc */)))*8)) = (*BgError)(unsafe.Pointer(errPtr)).FerrorMsg
		*(*uintptr)(unsafe.Pointer(tempObjv + uintptr(*(*int32)(unsafe.Pointer(bp))+1)*8)) = (*BgError)(unsafe.Pointer(errPtr)).FreturnOpts
		XTcl_AllowExceptions(tls, interp)
		code = XTcl_EvalObjv(tls, interp, *(*int32)(unsafe.Pointer(bp))+2, tempObjv, TCL_EVAL_GLOBAL)

		// Discard the command and the information about the error report.

		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = copyObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*BgError)(unsafe.Pointer(errPtr)).FerrorMsg
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = (*BgError)(unsafe.Pointer(errPtr)).FreturnOpts
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr = (*BgError)(unsafe.Pointer(errPtr)).FnextPtr
		XTclpFree(tls, errPtr)
		XTclpFree(tls, tempObjv)

		if code == TCL_BREAK {
			// Break means cancel any remaining error reports for this
			// interpreter.

			for (*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr != uintptr(0) {
				errPtr = (*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr
				(*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr = (*BgError)(unsafe.Pointer(errPtr)).FnextPtr
				for ok3 := true; ok3; ok3 = 0 != 0 {
					var _objPtr uintptr = (*BgError)(unsafe.Pointer(errPtr)).FerrorMsg
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				for ok4 := true; ok4; ok4 = 0 != 0 {
					var _objPtr uintptr = (*BgError)(unsafe.Pointer(errPtr)).FreturnOpts
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				XTclpFree(tls, errPtr)
			}
		} else if code == TCL_ERROR && !(XTcl_IsSafe(tls, interp) != 0) {
			var errChannel Tcl_Channel = XTcl_GetStdChannel(tls, int32(1)<<3)

			if errChannel != uintptr(0) {
				var options uintptr = XTcl_GetReturnOptions(tls, interp, code)
				var keyPtr uintptr
				*(*uintptr)(unsafe.Pointer(bp + 16 /* valuePtr */)) = uintptr(0)

				for ok5 := true; ok5; ok5 = 0 != 0 {
					for ok6 := true; ok6; ok6 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							keyPtr = XTclThreadAllocObj(tls)
						} else {
							keyPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(keyPtr + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount = 0
					if int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)) == 0 {
						(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes, ts+12034, uint64(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes + 10)) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = int32(uint64(unsafe.Sizeof([11]int8{})) - uint64(1))
					}
					(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr = uintptr(0)
					{
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount++
				XTcl_DictObjGet(tls, uintptr(0), options, keyPtr, bp+16)
				for ok7 := true; ok7; ok7 = 0 != 0 {
					var _objPtr uintptr = keyPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}

				XTcl_WriteChars(tls, errChannel,
					ts+27268, -1)
				if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
					XTcl_WriteObj(tls, errChannel, *(*uintptr)(unsafe.Pointer(bp + 16 /* valuePtr */)))
				} else {
					XTcl_WriteObj(tls, errChannel, XTcl_GetObjResult(tls, interp))
				}
				XTcl_WriteChars(tls, errChannel, ts+350, 1)
				XTcl_Flush(tls, errChannel)
				for ok8 := true; ok8; ok8 = 0 != 0 {
					var _objPtr uintptr = options
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
		}
	}
	(*ErrAssocData)(unsafe.Pointer(assocPtr)).FlastBgPtr = uintptr(0)
	XTcl_Release(tls, interp)
	XTcl_Release(tls, assocPtr)
}

//----------------------------------------------------------------------
//
// TclDefaultBgErrorHandlerObjCmd --
//
//	This function is invoked to process the "::tcl::Bgerror" Tcl command.
//	It is the default handler command registered with [interp bgerror] for
//	the sake of compatibility with older Tcl releases.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	Depends on what actions the "bgerror" command takes for the errors.
//
//----------------------------------------------------------------------

func XTclDefaultBgErrorHandlerObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclEvent.c:310:1: */
	bp := tls.Alloc(104)
	defer tls.Free(104)

	var keyPtr uintptr
	// var valuePtr uintptr at bp+72, 8

	// var tempObjv [2]uintptr at bp+88, 16

	var result int32
	// var code int32 at bp+84, 4

	// var level int32 at bp+80, 4

	var saved Tcl_InterpState

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27304)
		return TCL_ERROR
	}

	// Check for a valid return options dictionary.

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				keyPtr = XTclThreadAllocObj(tls)
			} else {
				keyPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(keyPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes, ts+27316, uint64(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes + 6)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = int32(uint64(unsafe.Sizeof([7]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount++
	result = XTcl_DictObjGet(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 2*8)), keyPtr, bp+72)
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = keyPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if result != TCL_OK || *(*uintptr)(unsafe.Pointer(bp + 72)) == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+27323, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+13635, ts+14589, uintptr(0)))
		return TCL_ERROR
	}
	if XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 72)), bp+80) == TCL_ERROR {
		return TCL_ERROR
	}
	for ok3 := true; ok3; ok3 = 0 != 0 {
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				keyPtr = XTclThreadAllocObj(tls)
			} else {
				keyPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(keyPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes, ts+27354, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes + 5)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount++
	result = XTcl_DictObjGet(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 2*8)), keyPtr, bp+72)
	for ok5 := true; ok5; ok5 = 0 != 0 {
		var _objPtr uintptr = keyPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if result != TCL_OK || *(*uintptr)(unsafe.Pointer(bp + 72)) == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+27360, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+13635, ts+14589, uintptr(0)))
		return TCL_ERROR
	}
	if XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 72)), bp+84) == TCL_ERROR {
		return TCL_ERROR
	}

	if *(*int32)(unsafe.Pointer(bp + 80)) != 0 {
		// We're handling a TCL_RETURN exception.

		*(*int32)(unsafe.Pointer(bp + 84 /* code */)) = TCL_RETURN
	}
	if *(*int32)(unsafe.Pointer(bp + 84)) == TCL_OK {
		// Somehow we got to exception handling with no exception. (Pass
		// TCL_OK to Tcl_BackgroundException()?) Just return without doing
		// anything.

		return TCL_OK
	}

	// Construct the bgerror command.

	for ok6 := true; ok6; ok6 = 0 != 0 {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				*(*uintptr)(unsafe.Pointer(bp + 88)) = XTclThreadAllocObj(tls)
			} else {
				*(*uintptr)(unsafe.Pointer(bp + 88)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)) + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes, ts+27390, uint64(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes + 7)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Flength = int32(uint64(unsafe.Sizeof([8]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).FrefCount++

	// Determine error message argument.  Check the return options in case
	// a non-error exception brought us here.

	switch *(*int32)(unsafe.Pointer(bp + 84 /* code */)) {
	case TCL_ERROR:
		*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)) = *(*uintptr)(unsafe.Pointer(objv + 1*8))
		break
	case TCL_BREAK:
		for ok8 := true; ok8; ok8 = 0 != 0 {
			for ok9 := true; ok9; ok9 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([34]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([34]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Fbytes, ts+7983, uint64(int32(uint64(unsafe.Sizeof([34]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Fbytes + 33)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Flength = int32(uint64(unsafe.Sizeof([34]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		break
	case TCL_CONTINUE:
		for ok10 := true; ok10; ok10 = 0 != 0 {
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([37]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([37]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Fbytes, ts+8017, uint64(int32(uint64(unsafe.Sizeof([37]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Fbytes + 36)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).Flength = int32(uint64(unsafe.Sizeof([37]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		break
	default:
		*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)) = XTcl_ObjPrintf(tls, ts+8054, libc.VaList(bp+64, *(*int32)(unsafe.Pointer(bp + 84 /* code */))))
		break
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))).FrefCount++

	if *(*int32)(unsafe.Pointer(bp + 84)) != TCL_ERROR {
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))
	}

	for ok12 := true; ok12; ok12 = 0 != 0 {
		for ok13 := true; ok13; ok13 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				keyPtr = XTclThreadAllocObj(tls)
			} else {
				keyPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(keyPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes, ts+12045, uint64(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes + 10)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = int32(uint64(unsafe.Sizeof([11]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount++
	result = XTcl_DictObjGet(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 2*8)), keyPtr, bp+72)
	for ok14 := true; ok14; ok14 = 0 != 0 {
		var _objPtr uintptr = keyPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if result == TCL_OK && *(*uintptr)(unsafe.Pointer(bp + 72)) != uintptr(0) {
		XTcl_SetObjErrorCode(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 72 /* valuePtr */)))
	}

	for ok15 := true; ok15; ok15 = 0 != 0 {
		for ok16 := true; ok16; ok16 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				keyPtr = XTclThreadAllocObj(tls)
			} else {
				keyPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(keyPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes, ts+12034, uint64(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes + 10)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = int32(uint64(unsafe.Sizeof([11]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount++
	result = XTcl_DictObjGet(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 2*8)), keyPtr, bp+72)
	for ok17 := true; ok17; ok17 = 0 != 0 {
		var _objPtr uintptr = keyPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if result == TCL_OK && *(*uintptr)(unsafe.Pointer(bp + 72)) != uintptr(0) {
		XTcl_AppendObjToErrorInfo(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 72 /* valuePtr */)))
	}

	if *(*int32)(unsafe.Pointer(bp + 84)) == TCL_ERROR {
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))
	}

	// Save interpreter state so we can restore it if multiple handler
	// attempts are needed.

	saved = XTcl_SaveInterpState(tls, interp, *(*int32)(unsafe.Pointer(bp + 84 /* code */)))

	// Invoke the bgerror command.

	XTcl_AllowExceptions(tls, interp)
	*(*int32)(unsafe.Pointer(bp + 84 /* code */)) = XTcl_EvalObjv(tls, interp, 2, bp+88, TCL_EVAL_GLOBAL)
	if *(*int32)(unsafe.Pointer(bp + 84)) == TCL_ERROR {
		// If the interpreter is safe, we look for a hidden command named
		// "bgerror" and call that with the error information. Otherwise,
		// simply ignore the error. The rationale is that this could be an
		// error caused by a malicious applet trying to cause an infinite
		// barrage of error messages. The hidden "bgerror" command can be used
		// by a security policy to interpose on such attacks and e.g. kill the
		// applet after a few attempts.

		if XTcl_IsSafe(tls, interp) != 0 {
			XTcl_RestoreInterpState(tls, interp, saved)
			XTclObjInvoke(tls, interp, 2, bp+88, int32(1)<<0)
		} else {
			var errChannel Tcl_Channel = XTcl_GetStdChannel(tls, int32(1)<<3)

			if errChannel != uintptr(0) {
				var resultPtr uintptr = XTcl_GetObjResult(tls, interp)

				(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
				if XTcl_FindCommand(tls, interp, ts+27390, uintptr(0),
					TCL_GLOBAL_ONLY) == uintptr(0) {
					XTcl_RestoreInterpState(tls, interp, saved)
					XTcl_WriteObj(tls, errChannel, XTcl_GetVar2Ex(tls, interp,
						ts+27398, uintptr(0), TCL_GLOBAL_ONLY))
					XTcl_WriteChars(tls, errChannel, ts+350, -1)
				} else {
					XTcl_DiscardInterpState(tls, saved)
					XTcl_WriteChars(tls, errChannel,
						ts+27408, -1)
					XTcl_WriteChars(tls, errChannel, ts+27452, -1)
					XTcl_WriteObj(tls, errChannel, *(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)))
					XTcl_WriteChars(tls, errChannel, ts+350, -1)
					XTcl_WriteChars(tls, errChannel, ts+27473, -1)
					XTcl_WriteObj(tls, errChannel, resultPtr)
					XTcl_WriteChars(tls, errChannel, ts+350, -1)
				}
				for ok18 := true; ok18; ok18 = 0 != 0 {
					var _objPtr uintptr = resultPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				XTcl_Flush(tls, errChannel)
			} else {
				XTcl_DiscardInterpState(tls, saved)
			}
		}
		*(*int32)(unsafe.Pointer(bp + 84 /* code */)) = TCL_OK
	} else {
		XTcl_DiscardInterpState(tls, saved)
	}

	for ok19 := true; ok19; ok19 = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 88))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok20 := true; ok20; ok20 = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 88 + 1*8))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTcl_ResetResult(tls, interp)
	return *(*int32)(unsafe.Pointer(bp + 84 /* code */))
}

//----------------------------------------------------------------------
//
// TclSetBgErrorHandler --
//
//	This function sets the command prefix to be used to handle background
//	errors in interp.
//
// Results:
//	None.
//
// Side effects:
//	Error handler is registered.
//
//----------------------------------------------------------------------

func XTclSetBgErrorHandler(tls *libc.TLS, interp uintptr, cmdPrefix uintptr) { /* tclEvent.c:514:1: */
	var assocPtr uintptr = XTcl_GetAssocData(tls, interp, ts+27257, uintptr(0))

	if cmdPrefix == uintptr(0) {
		XTcl_Panic(tls, ts+27496, 0)
	}
	if assocPtr == uintptr(0) {
		// First access: initialize.

		assocPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ErrAssocData{})))
		(*ErrAssocData)(unsafe.Pointer(assocPtr)).Finterp = interp
		(*ErrAssocData)(unsafe.Pointer(assocPtr)).FcmdPrefix = uintptr(0)
		(*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr = uintptr(0)
		(*ErrAssocData)(unsafe.Pointer(assocPtr)).FlastBgPtr = uintptr(0)
		XTcl_SetAssocData(tls, interp, ts+27257, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr)
		}{sBgErrorDeleteProc})), assocPtr)
	}
	if (*ErrAssocData)(unsafe.Pointer(assocPtr)).FcmdPrefix != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*ErrAssocData)(unsafe.Pointer(assocPtr)).FcmdPrefix
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	(*ErrAssocData)(unsafe.Pointer(assocPtr)).FcmdPrefix = cmdPrefix
	(*Tcl_Obj)(unsafe.Pointer((*ErrAssocData)(unsafe.Pointer(assocPtr)).FcmdPrefix)).FrefCount++
}

//----------------------------------------------------------------------
//
// TclGetBgErrorHandler --
//
//	This function retrieves the command prefix currently used to handle
//	background errors in interp.
//
// Results:
//	A (Tcl_Obj *) to a list of words (command prefix).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetBgErrorHandler(tls *libc.TLS, interp uintptr) uintptr { /* tclEvent.c:559:9: */
	var assocPtr uintptr = XTcl_GetAssocData(tls, interp, ts+27257, uintptr(0))

	if assocPtr == uintptr(0) {
		var bgerrorObj uintptr

		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					bgerrorObj = XTclThreadAllocObj(tls)
				} else {
					bgerrorObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bgerrorObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(bgerrorObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(bgerrorObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(bgerrorObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(bgerrorObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(bgerrorObj)).Fbytes, ts+6057, uint64(int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bgerrorObj)).Fbytes + 14)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(bgerrorObj)).Flength = int32(uint64(unsafe.Sizeof([15]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(bgerrorObj)).FtypePtr = uintptr(0)
			{
			}
		}
		XTclSetBgErrorHandler(tls, interp, bgerrorObj)
		assocPtr = XTcl_GetAssocData(tls, interp, ts+27257, uintptr(0))
	}
	return (*ErrAssocData)(unsafe.Pointer(assocPtr)).FcmdPrefix
}

//----------------------------------------------------------------------
//
// BgErrorDeleteProc --
//
//	This function is associated with the "tclBgError" assoc data for an
//	interpreter; it is invoked when the interpreter is deleted in order to
//	free the information assoicated with any pending error reports.
//
// Results:
//	None.
//
// Side effects:
//	Background error information is freed: if there were any pending error
//	reports, they are canceled.
//
//----------------------------------------------------------------------

func sBgErrorDeleteProc(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclEvent.c:595:1: */
	var assocPtr uintptr = clientData
	var errPtr uintptr

	for (*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr != uintptr(0) {
		errPtr = (*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr
		(*ErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr = (*BgError)(unsafe.Pointer(errPtr)).FnextPtr
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*BgError)(unsafe.Pointer(errPtr)).FerrorMsg
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*BgError)(unsafe.Pointer(errPtr)).FreturnOpts
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		XTclpFree(tls, errPtr)
	}
	XTcl_CancelIdleCall(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sHandleBgErrors})), assocPtr)
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = (*ErrAssocData)(unsafe.Pointer(assocPtr)).FcmdPrefix
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTcl_EventuallyFree(tls, assocPtr, uintptr(3))
}

//----------------------------------------------------------------------
//
// Tcl_CreateExitHandler --
//
//	Arrange for a given function to be invoked just before the application
//	exits.
//
// Results:
//	None.
//
// Side effects:
//	Proc will be invoked with clientData as argument when the application
//	exits.
//
//----------------------------------------------------------------------

func XTcl_CreateExitHandler(tls *libc.TLS, proc uintptr, clientData ClientData) { /* tclEvent.c:633:1: */
	var exitPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ExitHandler{})))

	(*ExitHandler)(unsafe.Pointer(exitPtr)).Fproc = proc
	(*ExitHandler)(unsafe.Pointer(exitPtr)).FclientData = clientData
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	(*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr = firstExitPtr
	firstExitPtr = exitPtr
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&exitMutex)))
}

//----------------------------------------------------------------------
//
// TclCreateLateExitHandler --
//
//	Arrange for a given function to be invoked after all pre-thread
//	cleanups.
//
// Results:
//	None.
//
// Side effects:
//	Proc will be invoked with clientData as argument when the application
//	exits.
//
//----------------------------------------------------------------------

func XTclCreateLateExitHandler(tls *libc.TLS, proc uintptr, clientData ClientData) { /* tclEvent.c:666:1: */
	var exitPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ExitHandler{})))

	(*ExitHandler)(unsafe.Pointer(exitPtr)).Fproc = proc
	(*ExitHandler)(unsafe.Pointer(exitPtr)).FclientData = clientData
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	(*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr = firstLateExitPtr
	firstLateExitPtr = exitPtr
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&exitMutex)))
}

//----------------------------------------------------------------------
//
// Tcl_DeleteExitHandler --
//
//	This function cancels an existing exit handler matching proc and
//	clientData, if such a handler exits.
//
// Results:
//	None.
//
// Side effects:
//	If there is an exit handler corresponding to proc and clientData then
//	it is canceled; if no such handler exists then nothing happens.
//
//----------------------------------------------------------------------

func XTcl_DeleteExitHandler(tls *libc.TLS, proc uintptr, clientData ClientData) { /* tclEvent.c:699:1: */
	var exitPtr uintptr
	var prevPtr uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	prevPtr = uintptr(0)
	exitPtr = firstExitPtr
__1:
	if !(exitPtr != uintptr(0)) {
		goto __3
	}
	{
		if (*ExitHandler)(unsafe.Pointer(exitPtr)).Fproc == proc &&
			(*ExitHandler)(unsafe.Pointer(exitPtr)).FclientData == clientData {
			if prevPtr == uintptr(0) {
				firstExitPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
			} else {
				(*ExitHandler)(unsafe.Pointer(prevPtr)).FnextPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
			}
			XTclpFree(tls, exitPtr)
			goto __3
		}

	}
	goto __2
__2:
	prevPtr = exitPtr
	exitPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
	goto __1
	goto __3
__3:
	;
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	return
}

//----------------------------------------------------------------------
//
// TclDeleteLateExitHandler --
//
//	This function cancels an existing late exit handler matching proc and
//	clientData, if such a handler exits.
//
// Results:
//	None.
//
// Side effects:
//	If there is a late exit handler corresponding to proc and clientData
//	then it is canceled; if no such handler exists then nothing happens.
//
//----------------------------------------------------------------------

func XTclDeleteLateExitHandler(tls *libc.TLS, proc uintptr, clientData ClientData) { /* tclEvent.c:742:1: */
	var exitPtr uintptr
	var prevPtr uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	prevPtr = uintptr(0)
	exitPtr = firstLateExitPtr
__1:
	if !(exitPtr != uintptr(0)) {
		goto __3
	}
	{
		if (*ExitHandler)(unsafe.Pointer(exitPtr)).Fproc == proc &&
			(*ExitHandler)(unsafe.Pointer(exitPtr)).FclientData == clientData {
			if prevPtr == uintptr(0) {
				firstLateExitPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
			} else {
				(*ExitHandler)(unsafe.Pointer(prevPtr)).FnextPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
			}
			XTclpFree(tls, exitPtr)
			goto __3
		}

	}
	goto __2
__2:
	prevPtr = exitPtr
	exitPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
	goto __1
	goto __3
__3:
	;
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	return
}

//----------------------------------------------------------------------
//
// Tcl_CreateThreadExitHandler --
//
//	Arrange for a given function to be invoked just before the current
//	thread exits.
//
// Results:
//	None.
//
// Side effects:
//	Proc will be invoked with clientData as argument when the application
//	exits.
//
//----------------------------------------------------------------------

func XTcl_CreateThreadExitHandler(tls *libc.TLS, proc uintptr, clientData ClientData) { /* tclEvent.c:785:1: */
	var exitPtr uintptr
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey1)), int32(unsafe.Sizeof(ThreadSpecificData1{})))

	exitPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ExitHandler{})))
	(*ExitHandler)(unsafe.Pointer(exitPtr)).Fproc = proc
	(*ExitHandler)(unsafe.Pointer(exitPtr)).FclientData = clientData
	(*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr = (*ThreadSpecificData1)(unsafe.Pointer(tsdPtr)).FfirstExitPtr
	(*ThreadSpecificData1)(unsafe.Pointer(tsdPtr)).FfirstExitPtr = exitPtr
}

//----------------------------------------------------------------------
//
// Tcl_DeleteThreadExitHandler --
//
//	This function cancels an existing exit handler matching proc and
//	clientData, if such a handler exits.
//
// Results:
//	None.
//
// Side effects:
//	If there is an exit handler corresponding to proc and clientData then
//	it is canceled; if no such handler exists then nothing happens.
//
//----------------------------------------------------------------------

func XTcl_DeleteThreadExitHandler(tls *libc.TLS, proc uintptr, clientData ClientData) { /* tclEvent.c:818:1: */
	var exitPtr uintptr
	var prevPtr uintptr
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey1)), int32(unsafe.Sizeof(ThreadSpecificData1{})))

	prevPtr = uintptr(0)
	exitPtr = (*ThreadSpecificData1)(unsafe.Pointer(tsdPtr)).FfirstExitPtr
__1:
	if !(exitPtr != uintptr(0)) {
		goto __3
	}
	{
		if (*ExitHandler)(unsafe.Pointer(exitPtr)).Fproc == proc &&
			(*ExitHandler)(unsafe.Pointer(exitPtr)).FclientData == clientData {
			if prevPtr == uintptr(0) {
				(*ThreadSpecificData1)(unsafe.Pointer(tsdPtr)).FfirstExitPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
			} else {
				(*ExitHandler)(unsafe.Pointer(prevPtr)).FnextPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
			}
			XTclpFree(tls, exitPtr)
			return
		}

	}
	goto __2
__2:
	prevPtr = exitPtr
	exitPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
	goto __1
	goto __3
__3:
}

//----------------------------------------------------------------------
//
// Tcl_SetExitProc --
//
//	This function sets the application wide exit handler that will be
//	called by Tcl_Exit in place of the C-runtime exit. If the application
//	wide exit handler is NULL, the C-runtime exit will be used instead.
//
// Results:
//	The previously set application wide exit handler.
//
// Side effects:
//	Sets the application wide exit handler to the specified value.
//
//----------------------------------------------------------------------

func XTcl_SetExitProc(tls *libc.TLS, proc uintptr) uintptr { /* tclEvent.c:858:14: */
	var prevExitProc uintptr

	// Swap the old exit proc for the new one, saving the old one for our
	// return value.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	prevExitProc = appExitPtr
	appExitPtr = proc
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&exitMutex)))

	return prevExitProc
}

//----------------------------------------------------------------------
//
// InvokeExitHandlers --
//
//      Call the registered exit handlers.
//
// Results:
//	None.
//
// Side effects:
//	The exit handlers are invoked, and the ExitHandler struct is
//      freed.
//
//----------------------------------------------------------------------
func sInvokeExitHandlers(tls *libc.TLS) { /* tclEvent.c:895:1: */
	var exitPtr uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	inExit = 1

	for exitPtr = firstExitPtr; exitPtr != uintptr(0); exitPtr = firstExitPtr {
		// Be careful to remove the handler from the list before invoking its
		// callback. This protects us against double-freeing if the callback
		// should call Tcl_DeleteExitHandler on itself.

		firstExitPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&exitMutex)))
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*ExitHandler)(unsafe.Pointer(exitPtr)).Fproc})).f(tls, (*ExitHandler)(unsafe.Pointer(exitPtr)).FclientData)
		XTclpFree(tls, exitPtr)
		XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	}
	firstExitPtr = uintptr(0)
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&exitMutex)))
}

//----------------------------------------------------------------------
//
// Tcl_Exit --
//
//	This function is called to terminate the application.
//
// Results:
//	None.
//
// Side effects:
//	All existing exit handlers are invoked, then the application ends.
//
//----------------------------------------------------------------------

func XTcl_Exit(tls *libc.TLS, status int32) { /* tclEvent.c:937:1: */
	var currentAppExitPtr uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	currentAppExitPtr = appExitPtr
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&exitMutex)))

	// Warning: this function SHOULD NOT return, as there is code that depends
	// on Tcl_Exit never returning. In fact, we will Tcl_Panic if anyone
	// returns, so critical is this dependcy.
	//
	// If subsystems are not (yet) initialized, proper Tcl-finalization is
	// impossible, so fallback to system exit, see bug-[f8a33ce3db5d8cc2].

	if currentAppExitPtr != 0 {

		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{currentAppExitPtr})).f(tls, uintptr(Intptr_t(status)))

	} else if subsystemsInitialized != 0 {

		if XTclFullFinalizationRequested(tls) != 0 {

			// Thorough finalization for Valgrind et al.

			XTcl_Finalize(tls)

		} else {

			// Fast and deterministic exit (default behavior)

			sInvokeExitHandlers(tls)

			// Ensure the thread-specific data is initialised as it is used in
			// Tcl_FinalizeThread()

			XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey1)), int32(unsafe.Sizeof(ThreadSpecificData1{})))

			// Now finalize the calling thread only (others are not safely
			// reachable).  Among other things, this triggers a flush of the
			// Tcl_Channels that may have data enqueued.

			XFinalizeThread(tls /* quick */, 1)
		}
	}

	libc.Xexit(tls, status)
	XTcl_Panic(tls, ts+27542, 0)
}

//-------------------------------------------------------------------------
//
// TclInitSubsystems --
//
//	Initialize various subsytems in Tcl. This should be called the first
//	time an interp is created, or before any of the subsystems are used.
//	This function ensures an order for the initialization of subsystems:
//
//	1. that cannot be initialized in lazy order because they are mutually
//	dependent.
//
//	2. so that they can be finalized in a known order w/o causing the
//	subsequent re-initialization of a subsystem in the act of shutting
//	down another.
//
// Results:
//	None.
//
// Side effects:
//	Varied, see the respective initialization routines.
//
//-------------------------------------------------------------------------

func XTclInitSubsystems(tls *libc.TLS) { /* tclEvent.c:1025:1: */
	if inExit != 0 {
		XTcl_Panic(tls, ts+27558, 0)
	}

	if subsystemsInitialized == 0 {
		// Double check inside the mutex. There are definitly calls back into
		// this routine from some of the functions below.

		XTclpInitLock(tls)
		if subsystemsInitialized == 0 {

			// Initialize locks used by the memory allocators before anything
			// interesting happens so we can use the allocators in the
			// implementation of self-initializing locks.

			XTclInitThreadStorage(tls) // Creates hash table for
			// thread local storage

			XTclpInitPlatform(tls)        // Creates signal handler(s)
			XTclInitDoubleConversion(tls) // Initializes constants for
			// converting to/from double.
			XTclInitObjSubsystem(tls) // Register obj types, create
			// mutexes.
			XTclInitIOSubsystem(tls)        // Inits a tsd key (noop).
			XTclInitEncodingSubsystem(tls)  // Process wide encoding init.
			XTclInitNamespaceSubsystem(tls) // Register ns obj type (mutexed).
			subsystemsInitialized = 1
		}
		XTclpInitUnlock(tls)
	}
	XTclInitNotifier(tls)
}

//----------------------------------------------------------------------
//
// Tcl_Finalize --
//
//	Shut down Tcl. First calls registered exit handlers, then carefully
//	shuts down various subsystems.  Should be invoked by user before the
//	Tcl shared library is being unloaded in an embedded context.
//
// Results:
//	None.
//
// Side effects:
//	Varied, see the respective finalization routines.
//
//----------------------------------------------------------------------

func XTcl_Finalize(tls *libc.TLS) { /* tclEvent.c:1089:1: */
	var exitPtr uintptr

	// Invoke exit handlers first.

	sInvokeExitHandlers(tls)

	XTclpInitLock(tls)
	if !(subsystemsInitialized == 0) {
		goto __1
	}
	goto alreadyFinalized
__1:
	;
	subsystemsInitialized = 0

	// Ensure the thread-specific data is initialised as it is used in
	// Tcl_FinalizeThread()

	XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey1)), int32(unsafe.Sizeof(ThreadSpecificData1{})))

	// Clean up after the current thread now, after exit handlers. In
	// particular, the testexithandler command sets up something that writes
	// to standard output, which gets closed. Note that there is no
	// thread-local storage or IO subsystem after this call.

	XTcl_FinalizeThread(tls)

	// Now invoke late (process-wide) exit handlers.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	exitPtr = firstLateExitPtr
__2:
	if !(exitPtr != uintptr(0)) {
		goto __4
	}
	// Be careful to remove the handler from the list before invoking its
	// callback. This protects us against double-freeing if the callback
	// should call Tcl_DeleteLateExitHandler on itself.

	firstLateExitPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*ExitHandler)(unsafe.Pointer(exitPtr)).Fproc})).f(tls, (*ExitHandler)(unsafe.Pointer(exitPtr)).FclientData)
	XTclpFree(tls, exitPtr)
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&exitMutex)))
	goto __3
__3:
	exitPtr = firstLateExitPtr
	goto __2
	goto __4
__4:
	;
	firstLateExitPtr = uintptr(0)
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&exitMutex)))

	// Now finalize the Tcl execution environment. Note that this must be done
	// after the exit handlers, because there are order dependencies.

	XTclFinalizeEvaluation(tls)
	XTclFinalizeExecution(tls)
	XTclFinalizeEnvironment(tls)

	// Finalizing the filesystem must come after anything which might
	// conceivably interact with the 'Tcl_FS' API.

	XTclFinalizeFilesystem(tls)

	// Undo all Tcl_ObjType registrations, and reset the global list of free
	// Tcl_Obj's. After this returns, no more Tcl_Obj's should be allocated or
	// freed.
	//
	// Note in particular that TclFinalizeObjects() must follow
	// TclFinalizeFilesystem() because TclFinalizeFilesystem free's the
	// Tcl_Obj that holds the path of the current working directory.

	XTclFinalizeObjects(tls)

	// We must be sure the encoding finalization doesn't need to examine the
	// filesystem in any way. Since it only needs to clean up internal data
	// structures, this is fine.

	XTclFinalizeEncodingSubsystem(tls)

	// Repeat finalization of the thread local storage once more. Although
	// this step is already done by the Tcl_FinalizeThread call above, series
	// of events happening afterwards may re-initialize TSD slots. Those need
	// to be finalized again, otherwise we're leaking memory chunks. Very
	// important to note is that things happening afterwards should not
	// reference anything which may re-initialize TSD's. This includes freeing
	// Tcl_Objs's, among other things.
	//
	// This fixes the Tcl Bug #990552.

	XTclFinalizeThreadData(tls /* quick */, 0)

	// Now we can free constants for conversions to/from double.

	XTclFinalizeDoubleConversion(tls)

	// There have been several bugs in the past that cause exit handlers to be
	// established during Tcl_Finalize processing. Such exit handlers leave
	// malloc'ed memory, and Tcl_FinalizeMemorySubsystem or
	// Tcl_FinalizeThreadAlloc will result in a corrupted heap. The result can
	// be a mysterious crash on process exit. Check here that nobody's done
	// this.

	if !(firstExitPtr != uintptr(0)) {
		goto __5
	}
	XTcl_Panic(tls, ts+27597, 0)
__5:
	;

	XTclFinalizePreserve(tls)

	// Free synchronization objects. There really should only be one thread
	// alive at this moment.

	XTclFinalizeSynchronization(tls)

	// Close down the thread-specific object allocator.

	XTclFinalizeThreadAlloc(tls)

	// We defer unloading of packages until very late to avoid memory access
	// issues. Both exit callbacks and synchronization variables may be stored
	// in packages.
	//
	// Note that TclFinalizeLoad unloads packages in the reverse of the order
	// they were loaded in (i.e. last to be loaded is the first to be
	// unloaded). This can be important for correct unloading when
	// dependencies exist.
	//
	// Once load has been finalized, we will have deleted any temporary copies
	// of shared libraries and can therefore reset the filesystem to its
	// original state.

	XTclFinalizeLoad(tls)
	XTclResetFilesystem(tls)

	// At this point, there should no longer be any ckalloc'ed memory.

	XTclFinalizeMemorySubsystem(tls)

alreadyFinalized:
	XTclFinalizeLock(tls)
}

//----------------------------------------------------------------------
//
// Tcl_FinalizeThread --
//
//	Runs the exit handlers to allow Tcl to clean up its state about a
//	particular thread.
//
// Results:
//	None.
//
// Side effects:
//	Varied, see the respective finalization routines.
//
//----------------------------------------------------------------------

func XTcl_FinalizeThread(tls *libc.TLS) { /* tclEvent.c:1275:1: */
	XFinalizeThread(tls /* quick */, 0)
}

func XFinalizeThread(tls *libc.TLS, quick int32) { /* tclEvent.c:1281:1: */
	var exitPtr uintptr
	var tsdPtr uintptr

	// We use TclThreadDataKeyGet here, rather than Tcl_GetThreadData, because
	// we don't want to initialize the data block if it hasn't been
	// initialized already.

	tsdPtr = XTclThreadDataKeyGet(tls, uintptr(unsafe.Pointer(&dataKey1)))
	if tsdPtr != uintptr(0) {
		(*ThreadSpecificData1)(unsafe.Pointer(tsdPtr)).FinExit = 1

		for exitPtr = (*ThreadSpecificData1)(unsafe.Pointer(tsdPtr)).FfirstExitPtr; exitPtr != uintptr(0); exitPtr = (*ThreadSpecificData1)(unsafe.Pointer(tsdPtr)).FfirstExitPtr {
			// Be careful to remove the handler from the list before invoking
			// its callback. This protects us against double-freeing if the
			// callback should call Tcl_DeleteThreadExitHandler on itself.

			(*ThreadSpecificData1)(unsafe.Pointer(tsdPtr)).FfirstExitPtr = (*ExitHandler)(unsafe.Pointer(exitPtr)).FnextPtr
			(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*ExitHandler)(unsafe.Pointer(exitPtr)).Fproc})).f(tls, (*ExitHandler)(unsafe.Pointer(exitPtr)).FclientData)
			XTclpFree(tls, exitPtr)
		}
		XTclFinalizeIOSubsystem(tls)
		XTclFinalizeNotifier(tls)
		XTclFinalizeAsync(tls)
		XTclFinalizeThreadObjects(tls)
	}

	// Blow away all thread local storage blocks.
	//
	// Note that Tcl API allows creation of threads which do not use any Tcl
	// interp or other Tcl subsytems. Those threads might, however, use thread
	// local storage, so we must unconditionally finalize it.
	//
	// Fix [Bug #571002]
	XTclFinalizeThreadData(tls, quick)
}

//----------------------------------------------------------------------
//
// TclInExit --
//
//	Determines if we are in the middle of exit-time cleanup.
//
// Results:
//	If we are in the middle of exiting, 1, otherwise 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclInExit(tls *libc.TLS) int32 { /* tclEvent.c:1344:1: */
	return inExit
}

//----------------------------------------------------------------------
//
// TclInThreadExit --
//
//	Determines if we are in the middle of thread exit-time cleanup.
//
// Results:
//	If we are in the middle of exiting this thread, 1, otherwise 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclInThreadExit(tls *libc.TLS) int32 { /* tclEvent.c:1366:1: */
	var tsdPtr uintptr = XTclThreadDataKeyGet(tls, uintptr(unsafe.Pointer(&dataKey1)))

	if tsdPtr == uintptr(0) {
		return 0
	}
	return (*ThreadSpecificData1)(unsafe.Pointer(tsdPtr)).FinExit
}

//----------------------------------------------------------------------
//
// Tcl_VwaitObjCmd --
//
//	This function is invoked to process the "vwait" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_VwaitObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclEvent.c:1395:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	// var done int32 at bp+40, 4

	var foundEvent int32
	var nameString uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}
	nameString = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if XTcl_TraceVar2(tls, interp, nameString, uintptr(0),
		TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sVwaitVarProc})), bp+40) != TCL_OK {
		return TCL_ERROR
	}

	*(*int32)(unsafe.Pointer(bp + 40 /* done */)) = 0
	foundEvent = 1
	for !(*(*int32)(unsafe.Pointer(bp + 40)) != 0) && foundEvent != 0 {
		foundEvent = XTcl_DoOneEvent(tls, libc.CplInt32(int32(1)<<1))
		if XTcl_Canceled(tls, interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR {
			break
		}
		if XTcl_LimitExceeded(tls, interp) != 0 {
			XTcl_ResetResult(tls, interp)
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+27644, -1))
			break
		}
	}
	XTcl_UntraceVar2(tls, interp, nameString, uintptr(0),
		TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sVwaitVarProc})), bp+40 /* &done */)

	if !(foundEvent != 0) {
		XTcl_ResetResult(tls, interp)
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+27659,
			libc.VaList(bp, nameString)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+27708, ts+27714, uintptr(0)))
		return TCL_ERROR
	}
	if !(*(*int32)(unsafe.Pointer(bp + 40)) != 0) {
		// The interpreter's result was already set to the right error message
		// prior to exiting the loop above.

		return TCL_ERROR
	}

	// Clear out the interpreter's result, since it may have been set by event
	// handlers.

	XTcl_ResetResult(tls, interp)
	return TCL_OK
}

// ARGSUSED
func sVwaitVarProc(tls *libc.TLS, clientData ClientData, interp uintptr, name1 uintptr, name2 uintptr, flags int32) uintptr { /* tclEvent.c:1458:13: */
	var donePtr uintptr = clientData

	*(*int32)(unsafe.Pointer(donePtr)) = 1
	XTcl_UntraceVar2(tls, interp, name1, uintptr(0), TCL_TRACE_WRITES|TCL_TRACE_UNSETS, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
	}{sVwaitVarProc})), clientData)
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_UpdateObjCmd --
//
//	This function is invoked to process the "update" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_UpdateObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclEvent.c:1493:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var optionIndex int32 at bp, 4

	var flags int32 = 0

	if objc == 1 {
		flags = libc.CplInt32(int32(1)<<1) | int32(1)<<1
	} else if objc == 2 {
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&updateOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp) != TCL_OK {
			return TCL_ERROR
		}
		switch uint32(*(*int32)(unsafe.Pointer(bp /* optionIndex */))) {
		case uint32(0) /* OPT_IDLETASKS */ :
			flags = int32(1)<<2 | int32(1)<<5 | int32(1)<<1
			break
			fallthrough
		default:
			XTcl_Panic(tls, ts+27725, 0)
		}
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27777)
		return TCL_ERROR
	}

	for XTcl_DoOneEvent(tls, flags) != 0 {
		if XTcl_Canceled(tls, interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR {
			return TCL_ERROR
		}
		if XTcl_LimitExceeded(tls, interp) != 0 {
			XTcl_ResetResult(tls, interp)
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+27644, -1))
			return TCL_ERROR
		}
	}

	// Must clear the interpreter's result because event handlers could have
	// executed commands.

	XTcl_ResetResult(tls, interp)
	return TCL_OK
}

var updateOptions = [2]uintptr{ts + 27789, uintptr(0)} /* tclEvent.c:1501:23 */

//----------------------------------------------------------------------
//
// NewThreadProc --
//
//	Bootstrap function of a new Tcl thread.
//
// Results:
//	None.
//
// Side Effects:
//	Initializes Tcl notifier for the current thread.
//
//----------------------------------------------------------------------

func sNewThreadProc(tls *libc.TLS, clientData ClientData) { /* tclEvent.c:1561:1: */
	var cdPtr uintptr = clientData
	var threadClientData ClientData
	var threadProc uintptr

	threadProc = (*ThreadClientData)(unsafe.Pointer(cdPtr)).Fproc
	threadClientData = (*ThreadClientData)(unsafe.Pointer(cdPtr)).FclientData
	XTclpFree(tls, clientData) // Allocated in Tcl_CreateThread()

	(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{threadProc})).f(tls, threadClientData)

}

//----------------------------------------------------------------------
//
// Tcl_CreateThread --
//
//	This function creates a new thread. This actually belongs to the
//	tclThread.c file but since we use some private data structures local
//	to this file, it is placed here.
//
// Results:
//	TCL_OK if the thread could be created. The thread ID is returned in a
//	parameter.
//
// Side effects:
//	A new thread is created.
//
//----------------------------------------------------------------------

func XTcl_CreateThread(tls *libc.TLS, idPtr uintptr, proc uintptr, clientData ClientData, stackSize int32, flags int32) int32 { /* tclEvent.c:1598:1: */
	var cdPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ThreadClientData{})))
	var result int32

	(*ThreadClientData)(unsafe.Pointer(cdPtr)).Fproc = proc
	(*ThreadClientData)(unsafe.Pointer(cdPtr)).FclientData = clientData
	result = XTclpThreadCreate(tls, idPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sNewThreadProc})), cdPtr, stackSize, flags)
	if result != TCL_OK {
		XTclpFree(tls, cdPtr)
	}
	return result
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// GCC bug 66462 means we cannot use the math builtins with -fsignaling-nan,
//    so disable builtins if this is enabled.  When fixed in a newer GCC,
//    the __SUPPORT_SNAN__ check may be skipped for those versions.

// Return number of classification appropriate for X.
// The check for __cplusplus allows the use of the builtin, even
// 	when optimization for size is on.  This is provided for
// 	libstdc++, only to let its configure test work when it is built
// 	with -Os.  No further use of this definition of fpclassify is
// 	expected in C++ mode, since libstdc++ provides its own version
// 	of fpclassify in cmath (which undefines fpclassify).

// Return nonzero value if sign of X is negative.

// Return nonzero value if X is not +-Inf or NaN.

// Return nonzero value if X is neither zero, subnormal, Inf, nor NaN.

// Return nonzero value if X is a NaN.  We could use `fpclassify' but
//    we already have this functions `__isnan' and it is faster.

// Return nonzero value if X is positive or negative infinity.

// Bitmasks for the math_errhandling macro.

// By default all math functions support both errno and exception handling
//    (except for soft floating point implementations which may only support
//    errno handling).  If errno handling is disabled, exceptions are still
//    supported by GLIBC.  Set math_errhandling to 0 with -ffast-math (this is
//    nonconforming but it is more useful than leaving it undefined).

// Some useful constants.

// The above constants are not adequate for computation using `long double's.
//    Therefore we provide as an extension constants with similar names as a
//    GNU extension.  Provide enough digits for the 128-bit IEEE quad.

// When compiling in strict ISO C compatible mode we must not use the
//    inline functions since they, among other things, do not set the
//    `errno' variable correctly.

// ISO C99 defines some macros to compare number while taking care for
//    unordered numbers.  Many FPUs provide special instructions to support
//    these operations.  Generic support in GCC for these as builtins went
//    in 2.97, but not all cpus added their patterns until 3.1.  Therefore
//    we enable the builtins from 3.1 onwards and use a generic implementation
//    othwerwise.

// Get machine-dependent inline versions (if there are any).

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.2 Diagnostics	<assert.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// void assert (int expression);
//
//    If NDEBUG is defined, do nothing.
//    If not, and EXPRESSION is zero, print an error message and abort.

// void assert_perror (int errnum);
//
//    If NDEBUG is defined, do nothing.  If not, and ERRNUM is not zero, print an
//    error message with the error text for ERRNUM and abort.
//    (This is a GNU extension.)

// Hack to determine whether we may expect IEEE floating point. The hack is
// formally incorrect in that non-IEEE platforms might have the same precision
// and range, but VAX, IBM, and Cray do not; are there any other floating
// point units that we might care about?

// A mask (should be 2**n-1) that is used to work out when the bytecode engine
// should call Tcl_AsyncReady() to see whether there is a signal that needs
// handling.

// Boolean flag indicating whether the Tcl bytecode interpreter has been
// initialized.

var execInitialized int32 = 0 /* tclExecute.c:51:12 */
var execMutex Tcl_Mutex       /* tclExecute.c:52:1: */

var cachedInExit int32 = 0 /* tclExecute.c:54:12 */

// Mapping from expression instruction opcodes to strings; used for error
// messages. Note that these entries must match the order and number of the
// expression opcodes (e.g., INST_LOR) in tclCompile.h.
//
// Does not include the string for INST_EXPON (and beyond), as that is
// disjoint for backward-compatability reasons.

var operatorStrings = [22]uintptr{
	ts + 27799, ts + 27802, ts + 5692, ts + 5694, ts + 5690, ts + 5804, ts + 5737, ts + 5794, ts + 5799, ts + 5796, ts + 5801, ts + 5699, ts + 5716,
	ts + 5686, ts + 5772, ts + 5688, ts + 5792, ts + 5719, ts + 5686, ts + 5772, ts + 5674, ts + 5684,
} /* tclExecute.c:79:19 */

// Mapping from Tcl result codes to strings; used for error and debugging
// messages.

// These are used by evalstats to monitor object usage in Tcl.

// Support pre-8.5 bytecodes unless specifically requested otherwise.

// We need to know the tclBuiltinFuncTable to support translation of pre-8.5
// math functions to the namespace-based ::tcl::mathfunc::op in 8.5+.

type BuiltinFunc = struct {
	Fname        uintptr
	FnumArgs     int32
	F__ccgo_pad1 [4]byte
} /* tclExecute.c:122:3 */

// Table describing the built-in math functions. Entries in this table are
// indexed by the values of the INST_CALL_BUILTIN_FUNC instruction's
// operand byte.

var tclBuiltinFuncTable = [27]BuiltinFunc{
	{Fname: ts + 5530, FnumArgs: 1},
	{Fname: ts + 5535, FnumArgs: 1},
	{Fname: ts + 5540, FnumArgs: 1},
	{Fname: ts + 5545, FnumArgs: 2},
	{Fname: ts + 5556, FnumArgs: 1},
	{Fname: ts + 5561, FnumArgs: 1},
	{Fname: ts + 5565, FnumArgs: 1},
	{Fname: ts + 5584, FnumArgs: 1},
	{Fname: ts + 5588, FnumArgs: 1},
	{Fname: ts + 5594, FnumArgs: 2},
	{Fname: ts + 5599, FnumArgs: 2},
	{Fname: ts + 5615, FnumArgs: 1},
	{Fname: ts + 5619, FnumArgs: 1},
	{Fname: ts + 5625, FnumArgs: 2},
	{Fname: ts + 5640, FnumArgs: 1},
	{Fname: ts + 5644, FnumArgs: 1},
	{Fname: ts + 5649, FnumArgs: 1},
	{Fname: ts + 5660, FnumArgs: 1},
	{Fname: ts + 5664, FnumArgs: 1},
	{Fname: ts + 5526, FnumArgs: 1},
	{Fname: ts + 5570, FnumArgs: 1},
	{Fname: ts + 5605, FnumArgs: 1},
	{Fname: ts + 5629},
	{Fname: ts + 5634, FnumArgs: 1},
	{Fname: ts + 5654, FnumArgs: 1},
	{Fname: ts + 5669, FnumArgs: 1},
	{},
} /* tclExecute.c:130:26 */

// NR_TEBC
// Helpers for NR - non-recursive calls to TEBC
// Minimal data required to fully reconstruct the execution state.

type TEBCdata1 = struct {
	FcodePtr    uintptr
	FcatchTop   uintptr
	FauxObjList uintptr
	FcmdFrame   CmdFrame
	Fstack      [1]uintptr
} /* tclExecute.c:169:9 */

// NR_TEBC
// Helpers for NR - non-recursive calls to TEBC
// Minimal data required to fully reconstruct the execution state.

type TEBCdata = TEBCdata1 /* tclExecute.c:179:3 */

// These variable-access macros have to coincide with those in tclVar.c

func sVarHashCreateVar(tls *libc.TLS, tablePtr uintptr, key uintptr, newPtr uintptr) uintptr { /* tclExecute.c:216:19: */
	var hPtr uintptr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr /* &.table */)).FcreateProc})).f(tls, tablePtr /* &.table */, key, newPtr)

	if !(hPtr != 0) {
		return uintptr(0)
	}
	return hPtr - uintptr(int32(uintptr(0)+24))
}

// The new macro for ending an instruction; note that a reasonable C-optimiser
// will resolve all branches at compile time. (result) is always a constant;
// the macro NEXT_INST_F handles constant (nCleanup), NEXT_INST_V is resolved
// at runtime for variable (nCleanup).
//
// ARGUMENTS:
//    pcAdjustment: how much to increment pc
//    nCleanup: how many objects to remove from the stack
//    resultHandling: 0 indicates no object should be pushed on the stack;
//	otherwise, push objResultPtr. If (result < 0), objResultPtr already
//	has the correct reference count.
//
// We use the new compile-time assertions to check that nCleanup is constant
// and within range.

// Verify the stack depth, only when no expansion is in progress

// Macros used to cache often-referenced Tcl evaluation stack information
// in local variables. Note that a DECACHE_STACK_INFO()-CACHE_STACK_INFO()
// pair must surround any call inside TclNRExecuteByteCode (and a few other
// procedures that use this scheme) that could result in a recursive call
// to TclNRExecuteByteCode.

// Macros used to access items on the Tcl evaluation stack. PUSH_OBJECT
// increments the object's ref count since it makes the stack have another
// reference pointing to the object. However, POP_OBJECT does not decrement
// the ref count. This is because the stack may hold the only reference to the
// object, so the object would be destroyed if its ref count were decremented
// before the caller had a chance to, e.g., store it in a variable. It is the
// caller's responsibility to decrement the ref count when it is finished with
// an object.
//
// WARNING! It is essential that objPtr only appear once in the PUSH_OBJECT
// macro. The actual parameter might be an expression with side effects, and
// this ensures that it will be executed only once.

// Macros used to trace instruction execution. The macros TRACE,
// TRACE_WITH_OBJ, and O2S are only used inside TclNRExecuteByteCode. O2S is
// only used in TRACE* calls to get a string from an object.

// DTrace instruction probe macros.

// Macro used in this file to save a function call for common uses of
// TclGetNumberFromObj(). The ANSI C "prototype" is:
//
// MODULE_SCOPE int GetNumberFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
//			ClientData *ptrPtr, int *tPtr);

// Macro used in this file to save a function call for common uses of
// Tcl_GetBooleanFromObj(). The ANSI C "prototype" is:
//
// MODULE_SCOPE int TclGetBooleanFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
//			int *boolPtr);

// Macro used to make the check for type overflow more mnemonic. This works by
// comparing sign bits; the rest of the word is irrelevant. The ANSI C
// "prototype" (where inttype_t is any integer type) is:
//
// MODULE_SCOPE int Overflowing(inttype_t a, inttype_t b, inttype_t sum);
//
// Check first the condition most likely to fail in usual code (at least for
// usage in [incr]: do the first summand and the sum have != signs?

// Macro for checking whether the type is NaN, used when we're thinking about
// throwing an error for supplying a non-number number.

// Auxiliary tables used to compute powers of small integers.

// Maximum base that, when raised to powers 2, 3, ..., 16, fits in a
// Tcl_WideInt.

var sMaxBase64 = [15]Tcl_WideInt{
	int64(46340)*int64(65536) + int64(62259),
	int64(2097151), int64(55108), int64(6208),
	int64(1448), int64(511), int64(234), int64(127),
	int64(78), int64(52), int64(38), int64(28),
	int64(22), int64(18), int64(15),
}                                                                                                     /* tclExecute.c:628:26 */
var sMaxBase64Size Size_t = uint64(unsafe.Sizeof(sMaxBase64)) / uint64(unsafe.Sizeof(Tcl_WideInt(0))) /* tclExecute.c:635:21 */

// Table giving 3, 4, ..., 13 raised to powers greater than 16 when the
// results fit in a 64-bit signed integer.

var sExp64Index = [12]uint16{
	uint16(0), uint16(23), uint16(38), uint16(49), uint16(57), uint16(63), uint16(67), uint16(70), uint16(72), uint16(74), uint16(75), uint16(76),
}                                                                                                  /* tclExecute.c:642:29 */
var sExp64IndexSize Size_t = uint64(unsafe.Sizeof(sExp64Index)) / uint64(unsafe.Sizeof(uint16(0))) /* tclExecute.c:645:21 */
var sExp64Value = [76]Tcl_WideInt{
	int64(243) * int64(243) * int64(243) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(3) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(3) * int64(3) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3) * int64(3),
	int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(243) * int64(3) * int64(3) * int64(3) * int64(3),
	int64(1024) * int64(1024) * int64(1024) * int64(4) * int64(4),
	int64(1024) * int64(1024) * int64(1024) * int64(4) * int64(4) * int64(4),
	int64(1024) * int64(1024) * int64(1024) * int64(4) * int64(4) * int64(4) * int64(4),
	int64(1024) * int64(1024) * int64(1024) * int64(1024),
	int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(4),
	int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(4) * int64(4),
	int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(4) * int64(4) * int64(4),
	int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(4) * int64(4) * int64(4) * int64(4),
	int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(1024),
	int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(4),
	int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(4) * int64(4),
	int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(4) * int64(4) * int64(4),
	int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(4) * int64(4) * int64(4) * int64(4),
	int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(1024),
	int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(1024) * int64(4),
	int64(3125) * int64(3125) * int64(3125) * int64(5) * int64(5),
	int64(3125) * int64(3125) * int64(3125) * int64(5) * int64(5) * int64(5),
	int64(3125) * int64(3125) * int64(3125) * int64(5) * int64(5) * int64(5) * int64(5),
	int64(3125) * int64(3125) * int64(3125) * int64(3125),
	int64(3125) * int64(3125) * int64(3125) * int64(3125) * int64(5),
	int64(3125) * int64(3125) * int64(3125) * int64(3125) * int64(5) * int64(5),
	int64(3125) * int64(3125) * int64(3125) * int64(3125) * int64(5) * int64(5) * int64(5),
	int64(3125) * int64(3125) * int64(3125) * int64(3125) * int64(5) * int64(5) * int64(5) * int64(5),
	int64(3125) * int64(3125) * int64(3125) * int64(3125) * int64(3125),
	int64(3125) * int64(3125) * int64(3125) * int64(3125) * int64(3125) * int64(5),
	int64(3125) * int64(3125) * int64(3125) * int64(3125) * int64(3125) * int64(5) * int64(5),
	int64(7776) * int64(7776) * int64(7776) * int64(6) * int64(6),
	int64(7776) * int64(7776) * int64(7776) * int64(6) * int64(6) * int64(6),
	int64(7776) * int64(7776) * int64(7776) * int64(6) * int64(6) * int64(6) * int64(6),
	int64(7776) * int64(7776) * int64(7776) * int64(7776),
	int64(7776) * int64(7776) * int64(7776) * int64(7776) * int64(6),
	int64(7776) * int64(7776) * int64(7776) * int64(7776) * int64(6) * int64(6),
	int64(7776) * int64(7776) * int64(7776) * int64(7776) * int64(6) * int64(6) * int64(6),
	int64(7776) * int64(7776) * int64(7776) * int64(7776) * int64(6) * int64(6) * int64(6) * int64(6),
	int64(16807) * int64(16807) * int64(16807) * int64(7) * int64(7),
	int64(16807) * int64(16807) * int64(16807) * int64(7) * int64(7) * int64(7),
	int64(16807) * int64(16807) * int64(16807) * int64(7) * int64(7) * int64(7) * int64(7),
	int64(16807) * int64(16807) * int64(16807) * int64(16807),
	int64(16807) * int64(16807) * int64(16807) * int64(16807) * int64(7),
	int64(16807) * int64(16807) * int64(16807) * int64(16807) * int64(7) * int64(7),
	int64(32768) * int64(32768) * int64(32768) * int64(8) * int64(8),
	int64(32768) * int64(32768) * int64(32768) * int64(8) * int64(8) * int64(8),
	int64(32768) * int64(32768) * int64(32768) * int64(8) * int64(8) * int64(8) * int64(8),
	int64(32768) * int64(32768) * int64(32768) * int64(32768),
	int64(59049) * int64(59049) * int64(59049) * int64(9) * int64(9),
	int64(59049) * int64(59049) * int64(59049) * int64(9) * int64(9) * int64(9),
	int64(59049) * int64(59049) * int64(59049) * int64(9) * int64(9) * int64(9) * int64(9),
	int64(100000) * int64(100000) * int64(100000) * int64(10) * int64(10),
	int64(100000) * int64(100000) * int64(100000) * int64(10) * int64(10) * int64(10),
	int64(161051) * int64(161051) * int64(161051) * int64(11) * int64(11),
	int64(161051) * int64(161051) * int64(161051) * int64(11) * int64(11) * int64(11),
	int64(248832) * int64(248832) * int64(248832) * int64(12) * int64(12),
	int64(371293) * int64(371293) * int64(371293) * int64(13) * int64(13),
}                                                                                                       /* tclExecute.c:647:26 */
var sExp64ValueSize Size_t = uint64(unsafe.Sizeof(sExp64Value)) / uint64(unsafe.Sizeof(Tcl_WideInt(0))) /* tclExecute.c:725:21 */

// The structure below defines a bytecode Tcl object type to hold the
// compiled bytecode for Tcl expressions.

var exprCodeType = Tcl_ObjType{
	Fname:           ts + 27805,
	FfreeIntRepProc: 0, // freeIntRepProc
	FdupIntRepProc:  0, // setFromAnyProc
} /* tclExecute.c:791:26 */

// Custom object type only used in this file; values of its type should never
// be seen by user scripts.

var dictIteratorType = Tcl_ObjType{
	Fname:           ts + 27814,
	FfreeIntRepProc: 0,
} /* tclExecute.c:804:26 */

//----------------------------------------------------------------------
//
// ReleaseDictIterator --
//
//	This takes apart a dictionary iterator that is stored in the given Tcl
//	object.
//
// Results:
//	None.
//
// Side effects:
//	Deallocates memory, marks the object as being untyped.
//
//----------------------------------------------------------------------

func sReleaseDictIterator(tls *libc.TLS, objPtr uintptr) { /* tclExecute.c:828:1: */
	var searchPtr uintptr
	var dictPtr uintptr

	// First kill the search, and then release the reference to the dictionary
	// that we were holding.

	searchPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	XTcl_DictObjDone(tls, searchPtr)
	XTclpFree(tls, searchPtr)

	dictPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */))
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, dictPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, dictPtr)
		}
	}

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// InitByteCodeExecution --
//
//	This procedure is called once to initialize the Tcl bytecode
//	interpreter.
//
// Results:
//	None.
//
// Side effects:
//	This procedure initializes the array of instruction names. If
//	compiling with the TCL_COMPILE_STATS flag, it initializes the array
//	that counts the executions of each instruction and it creates the
//	"evalstats" command. It also establishes the link between the Tcl
//	"tcl_traceExec" and C "tclTraceExec" variables.
//
//----------------------------------------------------------------------

func sInitByteCodeExecution(tls *libc.TLS, interp uintptr) { /* tclExecute.c:871:1: */
}

//----------------------------------------------------------------------
//
// TclCreateExecEnv --
//
//	This procedure creates a new execution environment for Tcl bytecode
//	execution. An ExecEnv points to a Tcl evaluation stack. An ExecEnv is
//	typically created once for each Tcl interpreter (Interp structure) and
//	recursively passed to TclNRExecuteByteCode to execute ByteCode sequences
//	for nested commands.
//
// Results:
//	A newly allocated ExecEnv is returned. This points to an empty
//	evaluation stack of the standard initial size.
//
// Side effects:
//	The bytecode interpreter is also initialized here, as this procedure
//	will be called before any call to TclNRExecuteByteCode.
//
//----------------------------------------------------------------------

func XTclCreateExecEnv(tls *libc.TLS, interp uintptr, size int32) uintptr { /* tclExecute.c:909:9: */
	var eePtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ExecEnv{})))
	var esPtr uintptr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+40))+uint64(size)*uint64(unsafe.Sizeof(uintptr(0)))))

	(*ExecEnv)(unsafe.Pointer(eePtr)).FexecStackPtr = esPtr
	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				*(*uintptr)(unsafe.Pointer(eePtr + 8)) = XTclThreadAllocObj(tls)
			} else {
				*(*uintptr)(unsafe.Pointer(eePtr + 8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)) + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)))).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)))).Fbytes = uintptr(0)
		*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)) + 32)) = int64(libc.Bool32(0 != 0))
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)))).FrefCount++
	for ok2 := true; ok2; ok2 = 0 != 0 {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)) = XTclThreadAllocObj(tls)
			} else {
				*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)) + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))).Fbytes = uintptr(0)
		*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)) + 32)) = int64(libc.Bool32(1 != 0))
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))).FrefCount++
	(*ExecEnv)(unsafe.Pointer(eePtr)).Finterp = interp
	(*ExecEnv)(unsafe.Pointer(eePtr)).FcallbackPtr = uintptr(0)
	(*ExecEnv)(unsafe.Pointer(eePtr)).FcorPtr = uintptr(0)
	(*ExecEnv)(unsafe.Pointer(eePtr)).Frewind = 0

	(*ExecStack)(unsafe.Pointer(esPtr)).FprevPtr = uintptr(0)
	(*ExecStack)(unsafe.Pointer(esPtr)).FnextPtr = uintptr(0)
	(*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr = uintptr(0)
	(*ExecStack)(unsafe.Pointer(esPtr)).FendPtr = esPtr + 40 + uintptr(size-1)*8
	(*ExecStack)(unsafe.Pointer(esPtr)).FtosPtr = esPtr + 40 - uintptr(1)*8

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&execMutex)))
	if !(execInitialized != 0) {
		sInitByteCodeExecution(tls, interp)
		execInitialized = 1
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&execMutex)))

	return eePtr
}

//----------------------------------------------------------------------
//
// TclDeleteExecEnv --
//
//	Frees the storage for an ExecEnv.
//
// Results:
//	None.
//
// Side effects:
//	Storage for an ExecEnv and its contained storage (e.g. the evaluation
//	stack) is freed.
//
//----------------------------------------------------------------------

func sDeleteExecStack(tls *libc.TLS, esPtr uintptr) { /* tclExecute.c:964:1: */
	if (*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr != 0 && !(cachedInExit != 0) {
		XTcl_Panic(tls, ts+27827, 0)
	}

	if (*ExecStack)(unsafe.Pointer(esPtr)).FprevPtr != 0 {
		(*ExecStack1)(unsafe.Pointer((*ExecStack)(unsafe.Pointer(esPtr)).FprevPtr)).FnextPtr = (*ExecStack)(unsafe.Pointer(esPtr)).FnextPtr
	}
	if (*ExecStack)(unsafe.Pointer(esPtr)).FnextPtr != 0 {
		(*ExecStack1)(unsafe.Pointer((*ExecStack)(unsafe.Pointer(esPtr)).FnextPtr)).FprevPtr = (*ExecStack)(unsafe.Pointer(esPtr)).FprevPtr
	}
	XTclpFree(tls, esPtr)
}

func XTclDeleteExecEnv(tls *libc.TLS, eePtr uintptr) { /* tclExecute.c:981:1: */
	var esPtr uintptr = (*ExecEnv)(unsafe.Pointer(eePtr)).FexecStackPtr
	var tmpPtr uintptr

	cachedInExit = XTclInExit(tls)

	// Delete all stacks in this exec env.

	for (*ExecStack)(unsafe.Pointer(esPtr)).FnextPtr != 0 {
		esPtr = (*ExecStack)(unsafe.Pointer(esPtr)).FnextPtr
	}
	for esPtr != 0 {
		tmpPtr = esPtr
		esPtr = (*ExecStack)(unsafe.Pointer(tmpPtr)).FprevPtr
		sDeleteExecStack(tls, tmpPtr)
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)))).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)))).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)))).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)))).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)))).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(eePtr + 8)))
				} else {
					*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(eePtr + 8))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(eePtr + 8)))
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))).Flength = -1
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))
				} else {
					*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(eePtr + 8 + 1*8)))
		}
	}

	if (*ExecEnv)(unsafe.Pointer(eePtr)).FcallbackPtr != 0 && !(cachedInExit != 0) {
		XTcl_Panic(tls, ts+27870, 0)
	}
	if (*ExecEnv)(unsafe.Pointer(eePtr)).FcorPtr != 0 && !(cachedInExit != 0) {
		XTcl_Panic(tls, ts+27916, 0)
	}
	XTclpFree(tls, eePtr)
}

//----------------------------------------------------------------------
//
// TclFinalizeExecution --
//
//	Finalizes the execution environment setup so that it can be later
//	reinitialized.
//
// Results:
//	None.
//
// Side effects:
//	After this call, the next time TclCreateExecEnv will be called it will
//	call InitByteCodeExecution.
//
//----------------------------------------------------------------------

func XTclFinalizeExecution(tls *libc.TLS) { /* tclExecute.c:1031:1: */
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&execMutex)))
	execInitialized = 0
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&execMutex)))
}

// Auxiliary code to insure that GrowEvaluationStack always returns correctly
// aligned memory.
//
// WALLOCALIGN represents the alignment reqs in words, just as TCL_ALLOCALIGN
// represents the reqs in bytes. This assumes that TCL_ALLOCALIGN is a
// multiple of the wordsize 'sizeof(Tcl_Obj *)'.

// wordSkip computes how many words have to be skipped until the next aligned
// word. Note that we are only interested in the low order bits of ptr, so
// that any possible information loss in PTR2INT is of no consequence.

func wordSkip(tls *libc.TLS, ptr uintptr) int32 { /* tclExecute.c:1057:1: */
	var mask int32 = int32(uint64(2)*uint64(unsafe.Sizeof(uintptr(0))) - uint64(1))
	var base int32 = int32(ptr) & mask
	return int32((uint64(2)*uint64(unsafe.Sizeof(uintptr(0))) - uint64(base)) / uint64(unsafe.Sizeof(uintptr(0))))
}

// Given a marker, compute where the following aligned memory starts.

//----------------------------------------------------------------------
//
// GrowEvaluationStack --
//
//	This procedure grows a Tcl evaluation stack stored in an ExecEnv,
//	copying over the words since the last mark if so requested. A mark is
//	set at the beginning of the new area when no copying is requested.
//
// Results:
//	Returns a pointer to the first usable word in the (possibly) grown
//	stack.
//
// Side effects:
//	The size of the evaluation stack may be grown, a marker is set
//
//----------------------------------------------------------------------

func sGrowEvaluationStack(tls *libc.TLS, eePtr uintptr, growth int32, move int32) uintptr { /* tclExecute.c:1091:16: */
	var esPtr uintptr
	var oldPtr uintptr
	var newBytes int32
	var newElems int32
	var currElems int32
	var needed int32
	var markerPtr uintptr
	var memStart uintptr
	var moveWords int32
	var tmpMarkerPtr uintptr
	var offset int32
	esPtr = (*ExecEnv)(unsafe.Pointer(eePtr)).FexecStackPtr
	oldPtr = uintptr(0)
	needed = int32(int64(growth) - (int64((*ExecStack)(unsafe.Pointer(esPtr)).FendPtr)-int64((*ExecStack)(unsafe.Pointer(esPtr)).FtosPtr))/8)
	markerPtr = (*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr
	moveWords = 0

	if !(move != 0) {
		goto __1
	}
	if !!(markerPtr != 0) {
		goto __3
	}
	XTcl_Panic(tls, ts+27957, 0)
__3:
	;
	if !(needed <= 0) {
		goto __4
	}
	return markerPtr + uintptr(wordSkip(tls, markerPtr))*8
__4:
	;
	goto __2
__1:
	tmpMarkerPtr = (*ExecStack)(unsafe.Pointer(esPtr)).FtosPtr + uintptr(1)*8
	offset = wordSkip(tls, tmpMarkerPtr)

	if !(needed+offset < 0) {
		goto __5
	}
	// Put a marker pointing to the previous marker in this stack, and
	// store it in esPtr as the current marker. Return a pointer to
	// the start of aligned memory.

	(*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr = tmpMarkerPtr
	memStart = tmpMarkerPtr + uintptr(offset)*8
	(*ExecStack)(unsafe.Pointer(esPtr)).FtosPtr = memStart - uintptr(1)*8
	*(*uintptr)(unsafe.Pointer((*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr)) = markerPtr
	return memStart
__5:
	;
__2:
	;

	// Reset move to hold the number of words to be moved to new stack (if
	// any) and growth to hold the complete stack requirements: add one for
	// the marker, (WALLOCALIGN-1) for the maximal possible offset.

	if !(move != 0) {
		goto __6
	}
	moveWords = int32((int64((*ExecStack)(unsafe.Pointer(esPtr)).FtosPtr)-int64(markerPtr+uintptr(wordSkip(tls, markerPtr))*8))/8 + int64(1))
__6:
	;
	needed = int32(uint64(growth+moveWords) + uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(uintptr(0))))

	// Check if there is enough room in the next stack (if there is one, it
	// should be both empty and the last one!)

	if !((*ExecStack)(unsafe.Pointer(esPtr)).FnextPtr != 0) {
		goto __7
	}
	oldPtr = esPtr
	esPtr = (*ExecStack)(unsafe.Pointer(oldPtr)).FnextPtr
	currElems = int32((int64((*ExecStack)(unsafe.Pointer(esPtr)).FendPtr) - int64(esPtr+40-uintptr(1)*8)) / 8)
	if !((*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr != 0 || (*ExecStack)(unsafe.Pointer(esPtr)).FtosPtr != esPtr+40-uintptr(1)*8) {
		goto __9
	}
	XTcl_Panic(tls, ts+28000, 0)
__9:
	;
	if !((*ExecStack)(unsafe.Pointer(esPtr)).FnextPtr != 0) {
		goto __10
	}
	XTcl_Panic(tls, ts+28037, 0)
__10:
	;
	if !(needed <= currElems) {
		goto __11
	}
	goto newStackReady
__11:
	;
	sDeleteExecStack(tls, esPtr)
	esPtr = oldPtr
	goto __8
__7:
	currElems = int32((int64((*ExecStack)(unsafe.Pointer(esPtr)).FendPtr) - int64(esPtr+40-uintptr(1)*8)) / 8)
__8:
	;

	// We need to allocate a new stack! It needs to store 'growth' words,
	// including the elements to be copied over and the new marker.

	newElems = 2 * currElems
__12:
	if !(needed > newElems) {
		goto __13
	}
	newElems = newElems * 2
	goto __12
__13:
	;

	newBytes = int32(uint64(int32(uintptr(0)+40)) + uint64(newElems)*uint64(unsafe.Sizeof(uintptr(0))))

	oldPtr = esPtr
	esPtr = XTcl_Alloc(tls, uint32(newBytes))

	(*ExecStack)(unsafe.Pointer(oldPtr)).FnextPtr = esPtr
	(*ExecStack)(unsafe.Pointer(esPtr)).FprevPtr = oldPtr
	(*ExecStack)(unsafe.Pointer(esPtr)).FnextPtr = uintptr(0)
	(*ExecStack)(unsafe.Pointer(esPtr)).FendPtr = esPtr + 40 + uintptr(newElems-1)*8

newStackReady:
	(*ExecEnv)(unsafe.Pointer(eePtr)).FexecStackPtr = esPtr

	// Store a NULL marker at the beginning of the stack, to indicate that
	// this is the first marker in this stack and that rewinding to here
	// should actually be a return to the previous stack.

	*(*uintptr)(unsafe.Pointer(esPtr + 40)) = uintptr(0)
	(*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr = esPtr + 40
	memStart = (*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr + uintptr(wordSkip(tls, (*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr))*8
	(*ExecStack)(unsafe.Pointer(esPtr)).FtosPtr = memStart - uintptr(1)*8

	if !(move != 0) {
		goto __14
	}
	libc.Xmemcpy(tls, memStart, markerPtr+uintptr(wordSkip(tls, markerPtr))*8, uint64(moveWords)*uint64(unsafe.Sizeof(uintptr(0))))
	*(*uintptr)(unsafe.Pointer(esPtr + 32)) += uintptr(moveWords) * 8
	(*ExecStack)(unsafe.Pointer(oldPtr)).FmarkerPtr = *(*uintptr)(unsafe.Pointer(markerPtr))
	(*ExecStack)(unsafe.Pointer(oldPtr)).FtosPtr = markerPtr - uintptr(1)*8
__14:
	;

	// Free the old stack if it is now unused.

	if !!(int32((*ExecStack)(unsafe.Pointer(oldPtr)).FmarkerPtr) != 0) {
		goto __15
	}
	sDeleteExecStack(tls, oldPtr)
__15:
	;

	return memStart
}

//--------------------------------------------------------------
//
// TclStackAlloc, TclStackRealloc, TclStackFree --
//
//	Allocate memory from the execution stack; it has to be returned later
//	with a call to TclStackFree.
//
// Results:
//	A pointer to the first byte allocated, or panics if the allocation did
//	not succeed.
//
// Side effects:
//	The execution stack may be grown.
//
//--------------------------------------------------------------

func sStackAllocWords(tls *libc.TLS, interp uintptr, numWords int32) uintptr { /* tclExecute.c:1243:16: */
	// Note that GrowEvaluationStack sets a marker in the stack. This marker
	// is read when rewinding, e.g., by TclStackFree.

	var iPtr uintptr = interp
	var eePtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr
	var resPtr uintptr = sGrowEvaluationStack(tls, eePtr, numWords, 0)

	*(*uintptr)(unsafe.Pointer((*ExecEnv)(unsafe.Pointer(eePtr)).FexecStackPtr + 32)) += uintptr(numWords) * 8
	return resPtr
}

func sStackReallocWords(tls *libc.TLS, interp uintptr, numWords int32) uintptr { /* tclExecute.c:1261:16: */
	var iPtr uintptr = interp
	var eePtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr
	var resPtr uintptr = sGrowEvaluationStack(tls, eePtr, numWords, 1)

	*(*uintptr)(unsafe.Pointer((*ExecEnv)(unsafe.Pointer(eePtr)).FexecStackPtr + 32)) += uintptr(numWords) * 8
	return resPtr
}

func XTclStackFree(tls *libc.TLS, interp uintptr, freePtr uintptr) { /* tclExecute.c:1275:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var iPtr uintptr = interp
	var eePtr uintptr
	var esPtr uintptr
	var markerPtr uintptr
	var marker uintptr

	if iPtr == uintptr(0) || (*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr == uintptr(0) {
		XTclpFree(tls, freePtr)
		return
	}

	// Rewind the stack to the previous marker position. The current marker,
	// as set in the last call to GrowEvaluationStack, contains a pointer to
	// the previous marker.

	eePtr = (*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr
	esPtr = (*ExecEnv)(unsafe.Pointer(eePtr)).FexecStackPtr
	markerPtr = (*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr
	marker = *(*uintptr)(unsafe.Pointer(markerPtr))

	if freePtr != uintptr(0) && markerPtr+uintptr(wordSkip(tls, markerPtr))*8 != freePtr {
		XTcl_Panic(tls, ts+28076,
			libc.VaList(bp, freePtr, markerPtr+uintptr(wordSkip(tls, markerPtr))*8))
	}

	(*ExecStack)(unsafe.Pointer(esPtr)).FtosPtr = markerPtr - uintptr(1)*8
	(*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr = marker
	if marker != 0 {
		return
	}

	// Return to previous active stack. Note that repeated expansions or
	// reallocs could have generated several unused intervening stacks: free
	// them too.

	for (*ExecStack)(unsafe.Pointer(esPtr)).FnextPtr != 0 {
		esPtr = (*ExecStack)(unsafe.Pointer(esPtr)).FnextPtr
	}
	(*ExecStack)(unsafe.Pointer(esPtr)).FtosPtr = esPtr + 40 - uintptr(1)*8
	for (*ExecStack)(unsafe.Pointer(esPtr)).FprevPtr != 0 {
		var tmpPtr uintptr = (*ExecStack)(unsafe.Pointer(esPtr)).FprevPtr
		if (*ExecStack)(unsafe.Pointer(tmpPtr)).FtosPtr == tmpPtr+40-uintptr(1)*8 {
			sDeleteExecStack(tls, tmpPtr)
		} else {
			break
		}
	}
	if (*ExecStack)(unsafe.Pointer(esPtr)).FprevPtr != 0 {
		(*ExecEnv)(unsafe.Pointer(eePtr)).FexecStackPtr = (*ExecStack)(unsafe.Pointer(esPtr)).FprevPtr
	} else {
		(*ExecEnv)(unsafe.Pointer(eePtr)).FexecStackPtr = esPtr
	}
}

func XTclStackAlloc(tls *libc.TLS, interp uintptr, numBytes int32) uintptr { /* tclExecute.c:1340:6: */
	var iPtr uintptr = interp
	var numWords int32

	if iPtr == uintptr(0) || (*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr == uintptr(0) {
		return XTcl_Alloc(tls, uint32(numBytes))
	}
	numWords = int32((uint64(numBytes) + (uint64(unsafe.Sizeof(uintptr(0))) - uint64(1))) / uint64(unsafe.Sizeof(uintptr(0))))
	return sStackAllocWords(tls, interp, numWords)
}

func XTclStackRealloc(tls *libc.TLS, interp uintptr, ptr uintptr, numBytes int32) uintptr { /* tclExecute.c:1355:6: */
	var iPtr uintptr = interp
	var eePtr uintptr
	var esPtr uintptr
	var markerPtr uintptr
	var numWords int32

	if iPtr == uintptr(0) || (*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr == uintptr(0) {
		return XTcl_Realloc(tls, ptr, uint32(numBytes))
	}

	eePtr = (*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr
	esPtr = (*ExecEnv)(unsafe.Pointer(eePtr)).FexecStackPtr
	markerPtr = (*ExecStack)(unsafe.Pointer(esPtr)).FmarkerPtr

	if markerPtr+uintptr(wordSkip(tls, markerPtr))*8 != ptr {
		XTcl_Panic(tls, ts+28142, 0)
	}

	numWords = int32((uint64(numBytes) + (uint64(unsafe.Sizeof(uintptr(0))) - uint64(1))) / uint64(unsafe.Sizeof(uintptr(0))))
	return sStackReallocWords(tls, interp, numWords)
}

//--------------------------------------------------------------
//
// Tcl_ExprObj --
//
//	Evaluate an expression in a Tcl_Obj.
//
// Results:
//	A standard Tcl object result. If the result is other than TCL_OK, then
//	the interpreter's result contains an error message. If the result is
//	TCL_OK, then a pointer to the expression's result value object is
//	stored in resultPtrPtr. In that case, the object's ref count is
//	incremented to reflect the reference returned to the caller; the
//	caller is then responsible for the resulting object and must, for
//	example, decrement the ref count when it is finished with the object.
//
// Side effects:
//	Any side effects caused by subcommands in the expression, if any. The
//	interpreter result is not modified unless there is an error.
//
//--------------------------------------------------------------

func XTcl_ExprObj(tls *libc.TLS, interp uintptr, objPtr uintptr, resultPtrPtr uintptr) int32 { /* tclExecute.c:1407:1: */
	var rootPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	var resultPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultPtr = XTclThreadAllocObj(tls)
		} else {
			resultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = uintptr(0)
	{
	}

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _callbackPtr uintptr
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sCopyCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = resultPtrPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = resultPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	XTcl_NRExprObj(tls, interp, objPtr, resultPtr)
	return XTclNRRunCallbacks(tls, interp, TCL_OK, rootPtr)
}

func sCopyCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclExecute.c:1426:1: */
	var resultPtrPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var resultPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))

	if result == TCL_OK {
		*(*uintptr)(unsafe.Pointer(resultPtrPtr)) = resultPtr
		(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
	} else {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = resultPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return result
}

//--------------------------------------------------------------
//
// Tcl_NRExprObj --
//
//	Request evaluation of the expression in a Tcl_Obj by the NR stack.
//
// Results:
//	Returns TCL_OK.
//
// Side effects:
//	Compiles objPtr as a Tcl expression and places callbacks on the
//	NR stack to execute the bytecode and store the result in resultPtr.
//	If bytecode execution raises an exception, nothing is written
//	to resultPtr, and the exceptional return code flows up the NR
//	stack.  If the exception is TCL_ERROR, an error message is left
//	in the interp result and the interp's return options dictionary
//	holds additional error information too.  Execution of the bytecode
//	may have other side effects, depending on the expression.
//
//--------------------------------------------------------------

func XTcl_NRExprObj(tls *libc.TLS, interp uintptr, objPtr uintptr, resultPtr uintptr) int32 { /* tclExecute.c:1467:1: */
	var codePtr uintptr
	var state Tcl_InterpState = XTcl_SaveInterpState(tls, interp, TCL_OK)

	XTcl_ResetResult(tls, interp)
	codePtr = sCompileExprObj(tls, interp, objPtr)

	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sExprObjCallback})), state, resultPtr,
		uintptr(0), uintptr(0))
	return XTclNRExecuteByteCode(tls, interp, codePtr)
}

func sExprObjCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclExecute.c:1484:1: */
	var state Tcl_InterpState = *(*ClientData)(unsafe.Pointer(data))
	var resultPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))

	if result == TCL_OK {
		XTclSetDuplicateObj(tls, resultPtr, XTcl_GetObjResult(tls, interp))
		XTcl_RestoreInterpState(tls, interp, state)
	} else {
		XTcl_DiscardInterpState(tls, state)
	}
	return result
}

//----------------------------------------------------------------------
//
// CompileExprObj --
//	Compile a Tcl expression value into ByteCode.
//
// Results:
//	A (ByteCode *) is returned pointing to the resulting ByteCode.
//	The caller must manage its refCount and arrange for a call to
//	TclCleanupByteCode() when the last reference disappears.
//
// Side effects:
//	The Tcl_ObjType of objPtr is changed to the "bytecode" type,
//	and the ByteCode is kept in the internal rep (along with context
//	data for checking validity) for faster operations the next time
//	CompileExprObj is called on the same value.
//
//----------------------------------------------------------------------

func sCompileExprObj(tls *libc.TLS, interp uintptr, objPtr uintptr) uintptr { /* tclExecute.c:1521:17: */
	bp := tls.Alloc(3592)
	defer tls.Free(3592)

	var iPtr uintptr = interp
	// var compEnv CompileEnv at bp+8, 3584
	// Compilation environment structure allocated
	// in frame.
	var codePtr uintptr = uintptr(0)
	// Tcl Internal type of bytecode. Initialized
	// to avoid compiler warning.

	// Get the expression ByteCode from the object. If it exists, make sure it
	// is valid in the current context.
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&exprCodeType)) {
		var namespacePtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr

		codePtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		if *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) != iPtr ||
			(*ByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch != (*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch ||
			(*ByteCode)(unsafe.Pointer(codePtr)).FnsPtr != namespacePtr ||
			(*ByteCode)(unsafe.Pointer(codePtr)).FnsEpoch != (*Namespace)(unsafe.Pointer(namespacePtr)).FresolverEpoch ||
			(*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr != (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr {
			sFreeExprCodeInternalRep(tls, objPtr)
		}
	}
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&exprCodeType)) {
		// TIP #280: No invoker (yet) - Expression compilation.

		// var length int32 at bp, 4

		var string uintptr = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, objPtr, bp)
		}()

		XTclInitCompileEnv(tls, interp, bp+8, string, *(*int32)(unsafe.Pointer(bp /* length */)), uintptr(0), 0)
		XTclCompileExpr(tls, interp, string, *(*int32)(unsafe.Pointer(bp /* length */)), bp+8, 0)

		// Successful compilation. If the expression yielded no instructions,
		// push an zero object as the expression's result.

		if (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext == (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeStart {
			for ok := true; ok; ok = 0 != 0 {
				var _objIndexCopy int32 = XTclRegisterLiteral(tls, bp+8, ts+18333, 1, 0)
				if _objIndexCopy <= 255 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext+uintptr(2) > (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeEnd {
							XTclExpandCodeArray(tls, bp+8)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(INST_PUSH1)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(bp+8)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(bp + 8)).FatCmdStart = func() int32 {
								if INST_PUSH1 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH1].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok3 := true; ok3; ok3 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(bp+8)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(bp+8)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(bp + 8)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(bp + 8)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(bp + 8 + 48)) += _delta
								}
							}
						}
					}
				} else {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						if (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext+uintptr(5) > (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeEnd {
							XTclExpandCodeArray(tls, bp+8)
						}
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(INST_PUSH4)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 24)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 16)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy) >> 8)
						*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(uint32(_objIndexCopy))
						if (*CompileEnv)(unsafe.Pointer(bp+8)).FatCmdStart < 2 {
							(*CompileEnv)(unsafe.Pointer(bp + 8)).FatCmdStart = func() int32 {
								if INST_PUSH4 == INST_START_CMD {
									return 1
								}
								return 0
							}()
						}
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var _delta int32 = XtclInstructionTable[INST_PUSH4].FstackEffect
							if _delta != 0 {
								if _delta == -0x7fffffff-1 {
									_delta = 1 - _objIndexCopy
								}
								for ok6 := true; ok6; ok6 = 0 != 0 {
									if _delta < 0 {
										if (*CompileEnv)(unsafe.Pointer(bp+8)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(bp+8)).FcurrStackDepth {
											(*CompileEnv)(unsafe.Pointer(bp + 8)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(bp + 8)).FcurrStackDepth
										}
									}
									*(*int32)(unsafe.Pointer(bp + 8 + 48)) += _delta
								}
							}
						}
					}
				}
			}
		}

		// Add a "done" instruction as the last instruction and change the
		// object into a ByteCode object. Ownership of the literal objects and
		// aux data items is given to the ByteCode object.

		for ok7 := true; ok7; ok7 = 0 != 0 {
			if (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext == (*CompileEnv)(unsafe.Pointer(bp+8)).FcodeEnd {
				XTclExpandCodeArray(tls, bp+8)
			}
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*CompileEnv)(unsafe.Pointer(bp+8)).FcodeNext, 1))) = uint8(INST_DONE)
			if (*CompileEnv)(unsafe.Pointer(bp+8)).FatCmdStart < 2 {
				(*CompileEnv)(unsafe.Pointer(bp + 8)).FatCmdStart = func() int32 {
					if INST_DONE == INST_START_CMD {
						return 1
					}
					return 0
				}()
			}
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _delta int32 = XtclInstructionTable[INST_DONE].FstackEffect
				if _delta != 0 {
					if _delta == -0x7fffffff-1 {
						_delta = 1 - 0
					}
					for ok9 := true; ok9; ok9 = 0 != 0 {
						if _delta < 0 {
							if (*CompileEnv)(unsafe.Pointer(bp+8)).FmaxStackDepth < (*CompileEnv)(unsafe.Pointer(bp+8)).FcurrStackDepth {
								(*CompileEnv)(unsafe.Pointer(bp + 8)).FmaxStackDepth = (*CompileEnv)(unsafe.Pointer(bp + 8)).FcurrStackDepth
							}
						}
						*(*int32)(unsafe.Pointer(bp + 8 + 48)) += _delta
					}
				}
			}
		}
		XTclInitByteCodeObj(tls, objPtr, bp+8)
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&exprCodeType))
		XTclFreeCompileEnv(tls, bp+8)
		codePtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		if (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr != 0 {
			(*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr
			(*LocalCache)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr)).FrefCount++
		}
	}
	return codePtr
}

//----------------------------------------------------------------------
//
// DupExprCodeInternalRep --
//
//	Part of the Tcl object type implementation for Tcl expression
//	bytecode. We do not copy the bytecode internalrep. Instead, we return
//	without setting copyPtr->typePtr, so the copy is a plain string copy
//	of the expression value, and if it is to be used as a compiled
//	expression, it will just need a recompile.
//
//	This makes sense, because with Tcl's copy-on-write practices, the
//	usual (only?) time Tcl_DuplicateObj() will be called is when the copy
//	is about to be modified, which would invalidate any copied bytecode
//	anyway. The only reason it might make sense to copy the bytecode is if
//	we had some modifying routines that operated directly on the internalrep,
//	like we do for lists and dicts.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sDupExprCodeInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclExecute.c:1623:1: */
	return
}

//----------------------------------------------------------------------
//
// FreeExprCodeInternalRep --
//
//	Part of the Tcl object type implementation for Tcl expression
//	bytecode. Frees the storage allocated to hold the internal rep, unless
//	ref counts indicate bytecode execution is still in progress.
//
// Results:
//	None.
//
// Side effects:
//	May free allocated memory. Leaves objPtr untyped.
//
//----------------------------------------------------------------------

func sFreeExprCodeInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclExecute.c:1649:1: */
	var codePtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	if libc.PostDecInt32(&(*ByteCode)(unsafe.Pointer(codePtr)).FrefCount, 1) <= 1 {
		XTclCleanupByteCode(tls, codePtr)
	}
}

//----------------------------------------------------------------------
//
// TclCompileObj --
//
//	This procedure compiles the script contained in a Tcl_Obj.
//
// Results:
//	A pointer to the corresponding ByteCode, never NULL.
//
// Side effects:
//	The object is shimmered to bytecode type.
//
//----------------------------------------------------------------------

func XTclCompileObj(tls *libc.TLS, interp uintptr, objPtr uintptr, invoker uintptr, word int32) uintptr { /* tclExecute.c:1676:10: */
	var iPtr uintptr
	var codePtr uintptr // Tcl Internal type of bytecode.
	var namespacePtr uintptr
	var _objPtr uintptr
	var hePtr uintptr
	var eclPtr uintptr
	var ctxCopyPtr uintptr
	var redo int32
	iPtr = interp
	namespacePtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr

	// If the object is not already of tclByteCodeType, compile it (and reset
	// the compilation flags in the interpreter; this should be done after any
	// compilation). Otherwise, check that it is "fresh" enough.

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteCodeType))) {
		goto __1
	}
	// Make sure the Bytecode hasn't been invalidated by, e.g., someone
	// redefining a command with a compile procedure (this might make the
	// compiled code wrong). The object needs to be recompiled if it was
	// compiled in/for a different interpreter, or for a different
	// namespace, or for the same namespace but with different name
	// resolution rules. Precompiled objects, however, are immutable and
	// therefore they are not recompiled, even if the epoch has changed.
	//
	// To be pedantically correct, we should also check that the
	// originating procPtr is the same as the current context procPtr
	// (assuming one exists at all - none for global level). This code is
	// #def'ed out because [info body] was changed to never return a
	// bytecode type object, which should obviate us from the extra checks
	// here.

	codePtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	if !(*(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) != iPtr ||
		(*ByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch != (*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch ||
		(*ByteCode)(unsafe.Pointer(codePtr)).FnsPtr != namespacePtr ||
		(*ByteCode)(unsafe.Pointer(codePtr)).FnsEpoch != (*Namespace)(unsafe.Pointer(namespacePtr)).FresolverEpoch) {
		goto __2
	}
	if !!((*ByteCode)(unsafe.Pointer(codePtr)).Fflags&uint32(TCL_BYTECODE_PRECOMPILED) != 0) {
		goto __3
	}
	goto recompileObj
__3:
	;
	if !(*(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) != iPtr) {
		goto __4
	}
	XTcl_Panic(tls, ts+28196, 0)
__4:
	;
	(*ByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch = (*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch
__2:
	;

	// Check that any compiled locals do refer to the current proc
	// environment! If not, recompile.

	if !(!((*ByteCode)(unsafe.Pointer(codePtr)).Fflags&uint32(TCL_BYTECODE_PRECOMPILED) != 0) && (*ByteCode)(unsafe.Pointer(codePtr)).FprocPtr == uintptr(0) && (*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr != (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr) {
		goto __5
	}
	goto recompileObj
__5:
	;

	// #280.
	// Literal sharing fix. This part of the fix is not required by 8.4
	// nor 8.5, because they eval-direct any literals, so just saving the
	// argument locations per command in bytecode is enough, embedded
	// 'eval' commands, etc. get the correct information.
	//
	// But in 8.6 all the embedded script are compiled, and the resulting
	// bytecode stored in the literal. Now the shared literal has bytecode
	// with location data for _one_ particular location this literal is
	// found at. If we get executed from a different location the bytecode
	// has to be recompiled to get the correct locations. Not doing this
	// will execute the saved bytecode with data for a different location,
	// causing 'info frame' to point to the wrong place in the sources.
	//
	// Future optimizations ...
	// (1) Save the location data (ExtCmdLoc) keyed by start line. In that
	//     case we recompile once per location of the literal, but not
	//     continously, because the moment we have all locations we do not
	//     need to recompile any longer.
	//
	// (2) Alternative: Do not recompile, tell the execution engine the
	//     offset between saved starting line and actual one. Then modify
	//     the users to adjust the locations they have by this offset.
	//
	// (3) Alternative 2: Do not fully recompile, adjust just the location
	//     information.

	if !(invoker == uintptr(0)) {
		goto __6
	}
	return codePtr
	goto __7
__6:
	hePtr =
		(*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr, codePtr)

	if !!(hePtr != 0) {
		goto __8
	}
	return codePtr
__8:
	;

	eclPtr = (*Tcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData
	redo = 0
	ctxCopyPtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(CmdFrame{})))
	*(*CmdFrame)(unsafe.Pointer(ctxCopyPtr)) = *(*CmdFrame)(unsafe.Pointer(invoker))

	if !((*CmdFrame)(unsafe.Pointer(invoker)).Ftype == 2) {
		goto __9
	}
	// Note: Type BC => ctx.data.eval.path    is not used.
	//		    ctx.data.tebc.codePtr used instead

	XTclGetSrcInfoForPc(tls, ctxCopyPtr)
	if !((*CmdFrame)(unsafe.Pointer(ctxCopyPtr)).Ftype == 4) {
		goto __10
	}
	// The reference made by 'TclGetSrcInfoForPc' is dead.

__11:
	_objPtr = *(*uintptr)(unsafe.Pointer(ctxCopyPtr + 40))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __14
	}
	XTclFreeObj(tls, _objPtr)
__14:
	;
	goto __12
__12:
	if 0 != 0 {
		goto __11
	}
	goto __13
__13:
	;
	*(*uintptr)(unsafe.Pointer(ctxCopyPtr + 40)) = uintptr(0)
__10:
	;
__9:
	;

	if !(word < (*CmdFrame)(unsafe.Pointer(ctxCopyPtr)).Fnline) {
		goto __15
	}
	// Note: We do not care if the line[word] is -1. This is a
	// difference and requires a recompile (location changed from
	// absolute to relative, literal is used fixed and through
	// variable)
	//
	// Example:
	// test info-32.0 using literal of info-24.8
	//     (dict with ... vs           set body ...).

	redo = libc.Bool32((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Ftype == 4 &&
		(*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fstart != *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(ctxCopyPtr)).Fline + uintptr(word)*4)) ||
		(*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Ftype == 2 &&
			(*CmdFrame)(unsafe.Pointer(ctxCopyPtr)).Ftype == 4)
__15:
	;

	XTclStackFree(tls, interp, ctxCopyPtr)
	if !!(redo != 0) {
		goto __16
	}
	return codePtr
__16:
	;
__7:
	;
__1:
	;

recompileObj:
	(*Interp)(unsafe.Pointer(iPtr)).FerrorLine = 1

	// TIP #280. Remember the invoker for a moment in the interpreter
	// structures so that the byte code compiler can pick it up when
	// initializing the compilation environment, i.e. the extended location
	// information.

	(*Interp)(unsafe.Pointer(iPtr)).FinvokeCmdFramePtr = invoker
	(*Interp)(unsafe.Pointer(iPtr)).FinvokeWord = word
	XTclSetByteCodeFromAny(tls, interp, objPtr, uintptr(0), uintptr(0))
	(*Interp)(unsafe.Pointer(iPtr)).FinvokeCmdFramePtr = uintptr(0)
	codePtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	if !((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr != 0) {
		goto __17
	}
	(*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr
	(*LocalCache)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr)).FrefCount++
__17:
	;
	return codePtr
}

//----------------------------------------------------------------------
//
// TclIncrObj --
//
//	Increment an integeral value in a Tcl_Obj by an integeral value held
//	in another Tcl_Obj. Caller is responsible for making sure we can
//	update the first object.
//
// Results:
//	TCL_ERROR if either object is non-integer, and TCL_OK otherwise. On
//	error, an error message is left in the interpreter (if it is not NULL,
//	of course).
//
// Side effects:
//	valuePtr gets the new incrmented value.
//
//----------------------------------------------------------------------

func XTclIncrObj(tls *libc.TLS, interp uintptr, valuePtr uintptr, incrPtr uintptr) int32 { /* tclExecute.c:1868:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	// var ptr1 ClientData at bp+16, 8

	// var ptr2 ClientData at bp+32, 8

	// var type1 int32 at bp+8, 4

	// var type2 int32 at bp+24, 4

	// var value Mp_int at bp+40, 24

	// var incr Mp_int at bp+64, 24

	if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+28240))
	}

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 8)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 16)) = valuePtr + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(valuePtr + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 8)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 8)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 16)) = valuePtr + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 8)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), valuePtr, bp+16, bp+8)
			}()
		}()
	}() != TCL_OK {
		// Produce error message (reparse?!)

		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(valuePtr + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(valuePtr + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(valuePtr + 32)))
					return TCL_OK
				}()
			}
			return XTcl_GetIntFromObj(tls, interp, valuePtr, bp+8)
		}()
	}
	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 24)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 32)) = incrPtr + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(incrPtr + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 24)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 24)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 32)) = incrPtr + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(incrPtr)).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 24)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), incrPtr, bp+32, bp+24)
			}()
		}()
	}() != TCL_OK {
		// Produce error message (reparse?!)

		if (*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(incrPtr + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(incrPtr + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(incrPtr + 32)))
		} else {
			XTcl_GetIntFromObj(tls, interp, incrPtr, bp+8)
		}
		XTcl_AddErrorInfo(tls, interp, ts+23574)
		return TCL_ERROR
	}

	if *(*int32)(unsafe.Pointer(bp + 8)) == TCL_NUMBER_LONG && *(*int32)(unsafe.Pointer(bp + 24)) == TCL_NUMBER_LONG {
		var augend int64 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 16))))
		var addend int64 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 32))))
		var sum int64 = augend + addend

		// Overflow when (augend and sum have different sign) and (augend and
		// addend have the same sign). This is encapsulated in the Overflowing
		// macro.

		if !(augend^sum < int64(0) && augend^addend >= int64(0)) {
			for ok := true; ok; ok = 0 != 0 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _isobjPtr uintptr = valuePtr
					if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
						if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
					}
				}
				if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr != uintptr(0) {
					if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
						(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr)).FfreeIntRepProc})).f(tls, valuePtr)
					}
					(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr = uintptr(0)
				}
				*(*int64)(unsafe.Pointer(valuePtr + 32)) = sum
				(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
			}
			return TCL_OK
		}
	}

	if *(*int32)(unsafe.Pointer(bp + 8)) == TCL_NUMBER_DOUBLE || *(*int32)(unsafe.Pointer(bp + 8)) == TCL_NUMBER_NAN {
		// Produce error message (reparse?!)

		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(valuePtr + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(valuePtr + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(valuePtr + 32)))
					return TCL_OK
				}()
			}
			return XTcl_GetIntFromObj(tls, interp, valuePtr, bp+8)
		}()
	}
	if *(*int32)(unsafe.Pointer(bp + 24)) == TCL_NUMBER_DOUBLE || *(*int32)(unsafe.Pointer(bp + 24)) == TCL_NUMBER_NAN {
		// Produce error message (reparse?!)

		if (*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(incrPtr + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(incrPtr + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			*(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*int64)(unsafe.Pointer(incrPtr + 32)))
		} else {
			XTcl_GetIntFromObj(tls, interp, incrPtr, bp+8)
		}
		XTcl_AddErrorInfo(tls, interp, ts+23574)
		return TCL_ERROR
	}

	XTcl_TakeBignumFromObj(tls, interp, valuePtr, bp+40)
	XTcl_GetBignumFromObj(tls, interp, incrPtr, bp+64)
	XTclBN_mp_add(tls, bp+40, bp+64, bp+40)
	XTclBN_mp_clear(tls, bp+64)
	XTcl_SetBignumObj(tls, valuePtr, bp+40)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ArgumentBCEnter --
//
//	This is a helper for TclNRExecuteByteCode/TEBCresume that encapsulates
//	a code sequence that is fairly common in the code but *not* commonly
//	called.
//
// Results:
//	None
//
// Side effects:
//	May register information about the bytecode in the command frame.
//
//----------------------------------------------------------------------

func sArgumentBCEnter(tls *libc.TLS, interp uintptr, codePtr uintptr, tdPtr uintptr, pc uintptr, objc int32, objv uintptr) { /* tclExecute.c:1992:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var cmd int32 at bp, 4

	if sGetSrcInfoForPc(tls, pc, codePtr, uintptr(0), uintptr(0), bp) != 0 {
		XTclArgumentBCEnter(tls, interp, objv, objc, codePtr, tdPtr+24, *(*int32)(unsafe.Pointer(bp /* cmd */)),
			int32((int64(pc)-int64((*ByteCode)(unsafe.Pointer(codePtr)).FcodeStart))/1))
	}
}

//----------------------------------------------------------------------
//
// TclNRExecuteByteCode --
//
//	This procedure executes the instructions of a ByteCode structure. It
//	returns when a "done" instruction is executed or an error occurs.
//
// Results:
//	The return value is one of the return codes defined in tcl.h (such as
//	TCL_OK), and interp->objResultPtr refers to a Tcl object that either
//	contains the result of executing the code or an error message.
//
// Side effects:
//	Almost certainly, depending on the ByteCode's instructions.
//
//----------------------------------------------------------------------

func XTclNRExecuteByteCode(tls *libc.TLS, interp uintptr, codePtr uintptr) int32 { /* tclExecute.c:2032:1: */
	var iPtr uintptr = interp
	var TD uintptr
	var size int32 = int32(uint64(unsafe.Sizeof(TEBCdata{})) - uint64(1) +
		uint64((*ByteCode)(unsafe.Pointer(codePtr)).FmaxStackDepth+(*ByteCode)(unsafe.Pointer(codePtr)).FmaxExceptDepth)*
			uint64(unsafe.Sizeof(uintptr(0))))
	var numWords int32 = int32((uint64(size) + uint64(unsafe.Sizeof(uintptr(0))) - uint64(1)) / uint64(unsafe.Sizeof(uintptr(0))))

	(*ByteCode)(unsafe.Pointer(codePtr)).FrefCount++

	// Reserve the stack, setup the TEBCdataPtr (TD) and CallFrame
	//
	// The execution uses a unified stack: first a TEBCdata, immediately
	// above it a CmdFrame, then the catch stack, then the execution stack.
	//
	// Make sure the catch stack is large enough to hold the maximum number of
	// catch commands that could ever be executing at the same time (this will
	// be no more than the exception range array's depth). Make sure the
	// execution stack is large enough to execute this ByteCode.

	TD = sGrowEvaluationStack(tls, (*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr, numWords, 0)
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = TD + 112 - uintptr(1)*8 + uintptr((*ByteCode)(unsafe.Pointer(codePtr)).FmaxExceptDepth)*8

	(*TEBCdata)(unsafe.Pointer(TD)).FcodePtr = codePtr
	(*TEBCdata)(unsafe.Pointer(TD)).FcatchTop = TD + 112 - uintptr(1)*8
	(*TEBCdata)(unsafe.Pointer(TD)).FauxObjList = uintptr(0)

	// TIP #280: Initialize the frame. Do not push it yet: it will be pushed
	// every time that we call out from this TD, popped when we return to it.

	(*CmdFrame)(unsafe.Pointer(TD + 24)).Ftype = func() int32 {
		if (*ByteCode)(unsafe.Pointer(codePtr)).Fflags&uint32(TCL_BYTECODE_PRECOMPILED) != 0 {
			return 3
		}
		return 2
	}()
	(*CmdFrame)(unsafe.Pointer(TD + 24)).Flevel = func() int32 {
		if (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr != 0 {
			return (*CmdFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr)).Flevel + 1
		}
		return 1
	}()
	(*CmdFrame)(unsafe.Pointer(TD + 24)).FframePtr = (*Interp)(unsafe.Pointer(iPtr)).FframePtr
	(*CmdFrame)(unsafe.Pointer(TD + 24)).FnextPtr = (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr
	(*CmdFrame)(unsafe.Pointer(TD + 24)).Fnline = 0
	(*CmdFrame)(unsafe.Pointer(TD + 24)).Fline = uintptr(0)
	(*CmdFrame)(unsafe.Pointer(TD + 24)).Flitarg = uintptr(0)
	*(*uintptr)(unsafe.Pointer(TD + 24 + 40)) = codePtr
	*(*uintptr)(unsafe.Pointer(TD + 24 + 40 + 8 /* &.pc */)) = uintptr(0)
	(*CmdFrame)(unsafe.Pointer(TD + 24)).FcmdObj = uintptr(0)
	(*CmdFrame)(unsafe.Pointer(TD + 24)).Fcmd = uintptr(0)
	(*CmdFrame)(unsafe.Pointer(TD + 24)).Flen = 0

	// Test namespace-50.9 demonstrates the need for this call.
	// Use a --enable-symbols=mem bug to see.

	XTclResetRewriteEnsemble(tls, interp, 1)

	// Push the callback for bytecode execution

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sTEBCresume}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = TD
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(int64(0))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(Intptr_t((*Interp)(unsafe.Pointer(iPtr)).FevalFlags))
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}

	// Reset discard result flag - because it is applicable for this call only,
	// and should not affect all the nested invocations may return result.
	*(*int32)(unsafe.Pointer(iPtr + 324)) &= libc.CplInt32(TCL_EVAL_DISCARD_RESULT)

	return TCL_OK
}

func sTEBCresume(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclExecute.c:2111:1: */
	bp := tls.Alloc(992)
	defer tls.Free(992)

	// Compiler cast directive - not a real variable.
	//	   Interp *iPtr = (Interp *) interp;

	// Check just the read-traced/write-traced bit of a variable.

	// Bottom of allocated stack holds the NR data

	// Constants: variables that do not change during the execution, used
	// sporadically: no special need for speed.

	var instructionCount int32 // Counter that is used to work out when to
	// call Tcl_AsyncReady()
	var curInstName uintptr
	var compiledLocals uintptr
	var constants uintptr

	// These macros are just meant to save some global variables that are not
	// used too frequently

	var TD uintptr

	// Globals: variables that store state, must remain valid at all times.

	var tosPtr uintptr // Cached pointer to top of evaluation
	// stack.
	var pc uintptr
	// The current program counter.
	var inst uint8 // The currently running instruction

	// Transfer variables - needed only between opcodes, but not while
	// executing an instruction.

	var cleanup int32
	// var objResultPtr uintptr at bp+936, 8

	var checkInterp int32 // Indicates when a check of interp readyness
	// is necessary. Set by CACHE_STACK_INFO()

	// Locals - variables that are used within opcodes or bounded sections of
	// the file (jumps between opcodes within a family).
	// NOTE: These are now mostly defined locally where needed.

	var objPtr uintptr
	// var valuePtr uintptr at bp+944, 8

	var value2Ptr uintptr
	var part1Ptr uintptr
	var part2Ptr uintptr
	var tmpPtr uintptr
	// var objv uintptr at bp+712, 8

	// var objc int32 at bp+720, 4

	var opnd int32
	// var length int32 at bp+704, 4

	var pcAdjustment int32
	// var varPtr uintptr at bp+760, 8

	// var arrayPtr uintptr at bp+728, 8

	var cachePtr uintptr
	var cachePtr1 uintptr
	var _objPtr uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	var cachePtr6 uintptr
	var cachePtr7 uintptr
	var cachePtr8 uintptr
	var cachePtr9 uintptr
	var code int32
	var level int32
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var _objPtr3 uintptr
	var cachePtr10 uintptr
	var _objPtr4 uintptr
	var _callbackPtr uintptr
	var cachePtr11 uintptr
	var _objPtr5 uintptr
	var _callbackPtr1 uintptr
	var corPtr uintptr
	var yieldParameter int32
	var _objPtr6 uintptr
	var listPtr uintptr
	var nsObjPtr uintptr
	var cachePtr12 uintptr
	var cachePtr13 uintptr
	var a uintptr
	var b uintptr
	var cachePtr14 uintptr
	var cachePtr15 uintptr
	var appendLen int32
	var bytes uintptr
	var p uintptr
	var currPtr uintptr
	var onlyb int32
	var cachePtr16 uintptr
	var _objPtr7 uintptr
	var _objPtr8 uintptr
	var i int32
	var moved Ptrdiff_t
	var cachePtr17 uintptr
	var _objPtr9 uintptr
	var _callbackPtr2 uintptr
	var newCodePtr uintptr
	var cachePtr18 uintptr
	var _objPtr10 uintptr
	var _callbackPtr3 uintptr
	var _objPtr11 uintptr
	var cachePtr19 uintptr
	var cachePtr20 uintptr
	var _objPtr12 uintptr
	var _callbackPtr4 uintptr
	var cachePtr21 uintptr
	var _objPtr13 uintptr
	var _objPtr14 uintptr
	var _objPtr15 uintptr
	var numArgs int32
	var tmpPtr1 uintptr
	var tmpPtr2 uintptr
	var cachePtr22 uintptr
	var _objPtr16 uintptr
	var _objPtr17 uintptr
	var copyPtr uintptr
	var cachePtr23 uintptr
	var _objPtr18 uintptr
	var _callbackPtr5 uintptr
	var cachePtr24 uintptr
	var _objPtr19 uintptr
	var _callbackPtr6 uintptr
	var cachePtr25 uintptr
	var _objPtr20 uintptr
	var _callbackPtr7 uintptr
	var _objPtr21 uintptr
	var cachePtr26 uintptr
	var cachePtr27 uintptr
	var newValue uintptr
	var cachePtr28 uintptr
	var cachePtr29 uintptr
	var createdNewObj int32
	var valueToAssign uintptr
	var storeFlags int32
	// var len int32 at bp+736, 4

	var cachePtr30 uintptr
	var _objPtr22 uintptr
	var cachePtr31 uintptr
	var _objPtr23 uintptr
	var cachePtr32 uintptr
	var _isobjPtr uintptr
	var augend int64
	var sum int64
	var cachePtr33 uintptr
	var _objPtr24 uintptr
	var _objPtr25 uintptr
	// var ptr ClientData at bp+744, 8

	// var type1 int32 at bp+740, 4

	var cachePtr34 uintptr
	var _objPtr26 uintptr
	var _objPtr27 uintptr
	var _objPtr28 uintptr
	var incrPtr uintptr
	var increment int64
	var cachePtr35 uintptr
	var found int32
	var cachePtr36 uintptr
	var cachePtr37 uintptr
	var cachePtr38 uintptr
	var flags int32
	// Then it is a defined link.

	var linkPtr uintptr
	var otherPtr uintptr
	// var framePtr uintptr at bp+752, 8

	var savedFramePtr uintptr
	// var nsPtr uintptr at bp+768, 8

	var savedNsPtr uintptr
	// var jmpOffset [2]int32 at bp+776, 8

	// var b1 int32 at bp+784, 4

	var jumpOffset int32
	var hPtr uintptr
	var jtPtr uintptr
	// Operands must be boolean or numeric. No int->double conversions are
	// performed.

	// var i1 int32 at bp+788, 4

	// var i2 int32 at bp+792, 4

	var iResult int32
	var cachePtr39 uintptr
	var cachePtr40 uintptr
	var currNsPtr uintptr
	var cachePtr41 uintptr
	var corPtr1 uintptr
	var cachePtr42 uintptr
	// var level1 int32 at bp+796, 4

	var framePtr1 uintptr
	var rootFramePtr uintptr
	var cachePtr43 uintptr
	var cachePtr44 uintptr
	var cmd Tcl_Command
	var origCmd Tcl_Command
	var classPtr uintptr
	var miPtr uintptr
	var i3 int32
	var methodType uintptr
	// We're at the end of the chain; generate an error message unless
	// the interpreter is being torn down, in which case we might be
	// getting here because of methods/destructors doing a [next] (or
	// equivalent) unexpectedly.

	var methodType1 uintptr
	var cachePtr45 uintptr
	var _objPtr29 uintptr
	var _callbackPtr8 uintptr
	var cachePtr46 uintptr
	var _objPtr30 uintptr
	var _callbackPtr9 uintptr
	var cachePtr47 uintptr
	var _objPtr31 uintptr
	var _callbackPtr10 uintptr
	var mPtr uintptr
	var cachePtr48 uintptr
	var oPtr uintptr
	var framePtr2 uintptr
	var contextPtr uintptr
	var skip int32
	var newDepth int32
	var cachePtr49 uintptr
	var cachePtr50 uintptr
	var cachePtr51 uintptr
	var _objPtr32 uintptr
	var _objPtr33 uintptr
	var cachePtr52 uintptr
	var i4 int32
	// var o uintptr at bp+808, 8

	var cachePtr53 uintptr
	var cachePtr54 uintptr
	var checkEq int32
	var cachePtr55 uintptr
	var cachePtr56 uintptr
	var cachePtr57 uintptr
	var cachePtr58 uintptr
	var cachePtr59 uintptr
	var cachePtr60 uintptr
	// var buf [8]int8 at bp+820, 8

	var ch int32
	var cachePtr61 uintptr
	var cachePtr62 uintptr
	var cachePtr63 uintptr
	var cachePtr64 uintptr
	var cachePtr65 uintptr
	var cachePtr66 uintptr
	var cachePtr67 uintptr
	var cachePtr68 uintptr
	var bytes1 uintptr
	var bytes2 uintptr
	var cachePtr69 uintptr
	var cachePtr70 uintptr
	var cachePtr71 uintptr
	var cachePtr72 uintptr
	// var ch1 int32 at bp+844, 4

	var cachePtr73 uintptr
	var ustring1 uintptr
	var ustring2 uintptr
	var ustring3 uintptr
	var end uintptr
	var p1 uintptr
	// var length3 int32 at bp+840, 4

	var endIdx int32
	var value3Ptr uintptr
	var ustring11 uintptr
	var ustring21 uintptr
	var bytes11 uintptr
	var bytes21 uintptr
	var cachePtr74 uintptr
	var string1 uintptr
	var string2 uintptr
	var trim1 int32
	// var trim2 int32 at bp+848, 4

	var regExpr Tcl_RegExp
	var cachePtr75 uintptr
	// var index int32 at bp+800, 4

	var numIndices int32
	// var fromIdx int32 at bp+828, 4

	// var toIdx int32 at bp+832, 4

	var nocase int32
	var match int32
	// var length2 int32 at bp+836, 4

	var cflags int32
	// var s1len int32 at bp+804, 4

	// var s2len int32 at bp+816, 4

	var s1 uintptr
	var s2 uintptr
	// value is between LONG_MIN and LONG_MAX
	// [string is integer] is -UINT_MAX to UINT_MAX range
	// var i5 int32 at bp+864, 4

	// value is an integer outside the WIDE_MIN to WIDE_MAX range
	// [string is wideinteger] is -UWIDE_MAX to UWIDE_MAX range
	// var w Tcl_WideInt at bp+872, 8

	var cachePtr76 uintptr
	var cachePtr77 uintptr
	var iResult1 int32
	var compare int32
	var cachePtr78 uintptr
	var shift int32
	var cachePtr79 uintptr
	var _isobjPtr1 uintptr
	var w1 Tcl_WideInt
	var w2 Tcl_WideInt
	var wResult Tcl_WideInt
	// var b2 int32 at bp+896, 4

	var cachePtr80 uintptr
	var _isobjPtr2 uintptr
	var cachePtr81 uintptr
	var _isobjPtr3 uintptr
	// Here we do some surgery within the Tcl_Obj internals. We want
	// to copy the internalrep, but not the string, so we temporarily hide
	// the string so we do not copy it.

	var savedString uintptr
	var _isobjPtr4 uintptr
	// var ptr1 ClientData at bp+856, 8

	// var ptr2 ClientData at bp+888, 8

	// var type11 int32 at bp+852, 4

	// var type2 int32 at bp+880, 4

	var l1 int64
	var l2 int64
	var lResult int64
	var res int32
	var cachePtr82 uintptr
	var _isobjPtr5 uintptr
	var _isobjPtr6 uintptr
	var cachePtr83 uintptr
	var cachePtr84 uintptr
	var cachePtr85 uintptr
	var cachePtr86 uintptr
	var infoPtr uintptr
	var iterVarPtr uintptr
	var listVarPtr uintptr
	var oldValuePtr uintptr
	var listPtr1 uintptr
	// var elements uintptr at bp+904, 8

	var varListPtr uintptr
	var numLists int32
	var iterNum int32
	var listTmpIndex int32
	// var listLen int32 at bp+900, 4

	var numVars int32
	var varIndex int32
	var valIndex int32
	var continueLoop int32
	var j int32
	var iterTmpIndex int32
	var i6 int64
	var _objPtr34 uintptr
	var cachePtr87 uintptr
	var cachePtr88 uintptr
	var cachePtr89 uintptr
	var cachePtr90 uintptr
	var infoPtr1 uintptr
	var listPtr2 uintptr
	// var elements1 uintptr at bp+920, 8

	var varListPtr1 uintptr
	var numLists1 int32
	var iterMax int32
	// var listLen1 int32 at bp+912, 4

	var numVars1 int32
	var iterTmp int32
	var iterNum1 int32
	var listTmpDepth int32
	var varIndex1 int32
	var valIndex1 int32
	var j1 int32
	var i7 int64
	var cachePtr91 uintptr
	var cachePtr92 uintptr
	// var code1 int32 at bp+928, 4

	var cachePtr93 uintptr
	var interp2 uintptr
	var found1 int32
	var cachePtr94 uintptr
	var cachePtr95 uintptr
	var _isobjPtr7 uintptr
	var cachePtr96 uintptr
	var cachePtr97 uintptr
	var cachePtr98 uintptr
	var cachePtr99 uintptr
	var cachePtr100 uintptr
	var cachePtr101 uintptr
	var _isobjPtr8 uintptr
	var cachePtr102 uintptr
	var cachePtr103 uintptr
	var cachePtr104 uintptr
	var _isobjPtr9 uintptr
	var cachePtr105 uintptr
	var cachePtr106 uintptr
	var _objPtr35 uintptr
	var cachePtr107 uintptr
	var cachePtr108 uintptr
	var cachePtr109 uintptr
	var cachePtr110 uintptr
	var _objPtr36 uintptr
	var _objPtr37 uintptr
	var cachePtr111 uintptr
	var _isobjPtr10 uintptr
	var var2Ptr uintptr
	var cachePtr112 uintptr
	var cachePtr113 uintptr
	var cachePtr114 uintptr
	var cachePtr115 uintptr
	var cachePtr116 uintptr
	var opnd2 int32
	var allocateDict int32
	// var done int32 at bp+932, 4

	var i8 int32
	var allocdict int32
	var dictPtr uintptr
	var statePtr uintptr
	// var keyPtr uintptr at bp+952, 8

	var listPtr3 uintptr
	var varNamePtr uintptr
	var keysPtr uintptr
	var emptyPtr uintptr
	// var keyPtrPtr uintptr at bp+960, 8

	var searchPtr uintptr
	var duiPtr uintptr // Read the wall clock
	var wval Tcl_WideInt
	// var now Tcl_Time at bp+968, 16

	var cachePtr117 uintptr
	// var pcBeg uintptr at bp+984, 8

	var _objPtr38 uintptr
	var cachePtr118 uintptr
	var _objPtr39 uintptr
	var _objPtr40 uintptr
	var rangePtr uintptr
	// Points to closest loop or catch exception
	// range enclosing the pc. Used by various
	// instructions and processCatch to process
	// break, continue, and errors.
	var bytes3 uintptr
	var bytes4 uintptr
	instructionCount = 0
	compiledLocals = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FcompiledLocals
	constants = (*Interp)(unsafe.Pointer(interp)).FexecEnvPtr + 8
	TD = *(*ClientData)(unsafe.Pointer(data))
	pc = *(*ClientData)(unsafe.Pointer(data + 1*8))
	cleanup = int32(*(*ClientData)(unsafe.Pointer(data + 2*8)))
	checkInterp = 0
	*(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)) = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 720 /* objc */)) = 0

__1:
	tosPtr = (*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr
	goto __2
__2:
	if 0 != 0 {
		goto __1
	}
	goto __3
__3:
	;

	if !!(pc != 0) {
		goto __4
	}
	// bytecode is starting from scratch
	pc = (*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FcodeStart

	// Reset the interp's result to avoid possible duplications of large
	// objects [3c6e47363e], [781585], [804681], This can happen by start
	// also in nested compiled blocks (enclosed in parent cycle).
	// See else branch below for opposite handling by continuation/resume.

	objPtr = (*Interp)(unsafe.Pointer(interp)).FobjResultPtr
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1) {
		goto __6
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __7
	}
	goto __8
__7:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __9
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __11
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__11:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__12:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __15
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __16
__15:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__16:
	;
	goto __13
__13:
	if 0 != 0 {
		goto __12
	}
	goto __14
__14:
	;
	goto __10
__9:
	XTclFreeObj(tls, objPtr)
__10:
	;
__8:
	;

__17:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __20
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __21
__20:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__21:
	;
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	(*Interp)(unsafe.Pointer(interp)).FobjResultPtr = objPtr
__6:
	;

	goto cleanup0
	goto __5
__4:
	// resume from invocation
	checkInterp = 1

	if !((*CmdFrame)(unsafe.Pointer(TD+24)).FcmdObj != 0) {
		goto __22
	}
__23:
	_objPtr = (*CmdFrame)(unsafe.Pointer(TD + 24)).FcmdObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __26
	}
	XTclFreeObj(tls, _objPtr)
__26:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
	(*CmdFrame)(unsafe.Pointer(TD + 24)).FcmdObj = uintptr(0)
	(*CmdFrame)(unsafe.Pointer(TD + 24)).Fcmd = uintptr(0)
__22:
	;
	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = (*CmdFrame)(unsafe.Pointer(TD + 24)).FnextPtr
	if !((*Interp)(unsafe.Pointer(interp)).Fflags&INTERP_DEBUG_FRAME != 0) {
		goto __27
	}
	XTclArgumentBCRelease(tls, interp, TD+24)
__27:
	;
	if !((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).Frewind != 0) {
		goto __28
	}
	result = TCL_ERROR
	goto abnormalReturn
__28:
	;
	if !((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).Fflags&uint32(TCL_BYTECODE_RECOMPILE) != 0) {
		goto __29
	}
	*(*uint32)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr + 32)) &= libc.Uint32FromInt32(libc.CplInt32(TCL_BYTECODE_RECOMPILE))
	checkInterp = 1
	*(*int32)(unsafe.Pointer(interp + 424)) |= ERR_ALREADY_LOGGED
__29:
	;

	if !(result != TCL_OK) {
		goto __30
	}
	pc--
	goto processExceptionReturn
__30:
	;

	// Push the call's object result and continue execution with the next
	// instruction.

	// Obtain and reset interp's result to avoid possible duplications of
	// objects [Bug 781585]. We do not call Tcl_ResetResult to avoid any
	// side effects caused by the resetting of errorInfo and errorCode
	// [Bug 804681], which are not needed here. We chose instead to
	// manipulate the interp's object result directly.
	//
	// Note that the result object is now in objResultPtr, it keeps the
	// refCount it had in its role of iPtr->objResultPtr.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_GetObjResult(tls, interp)
__31:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __34
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __35
__34:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__35:
	;
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	(*Interp)(unsafe.Pointer(interp)).FobjResultPtr = objPtr
	if !(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_POP) {
		goto __36
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount, 1) > 1) {
		goto __37
	}
	goto __38
__37:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __39
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes != XtclEmptyStringRep) {
		goto __41
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes)
__41:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = -1
__42:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __45
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936)))
	goto __46
__45:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 936))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__46:
	;
	goto __43
__43:
	if 0 != 0 {
		goto __42
	}
	goto __44
__44:
	;
	goto __40
__39:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))
__40:
	;
__38:
	;

__47:
	pc += uintptr(1)
	cleanup = cleanup
	if !(0 != 0) {
		goto __50
	}
	if !(0 > 0) {
		goto __52
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__52:
	;
	goto cleanupV_pushObjResultPtr
	goto __51
__50:
	goto cleanupV
__51:
	;
	goto __48
__48:
	if 0 != 0 {
		goto __47
	}
	goto __49
__49:
	;
__36:
	;
__53:
	pc += uintptr(0)
	cleanup = cleanup
	if !(-1 != 0) {
		goto __56
	}
	if !(-1 > 0) {
		goto __58
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__58:
	;
	goto cleanupV_pushObjResultPtr
	goto __57
__56:
	goto cleanupV
__57:
	;
	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
__5:
	;

	// Targets for standard instruction endings; unrolled for speed in the
	// most frequent cases (instructions that consume up to two stack
	// elements).
	//
	// This used to be a "for(;;)" loop, with each instruction doing its own
	// cleanup.

cleanupV_pushObjResultPtr:
	switch cleanup {
	case 0:
		goto __60
	default:
		goto __61
		// FALLTHRU
	case 2:
		goto __62
		// FALLTHRU
	case 1:
		goto __63
	}
	goto __59
__60:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936))
	goto cleanup0
__61:
	cleanup = cleanup - 2
__64:
	if !(libc.PostDecInt32(&cleanup, 1) != 0) {
		goto __65
	}
	objPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __66
	}
	goto __67
__66:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __68
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __70
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__70:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__71:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __74
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __75
__74:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++
__75:
	;
	goto __72
__72:
	if 0 != 0 {
		goto __71
	}
	goto __73
__73:
	;
	goto __69
__68:
	XTclFreeObj(tls, objPtr)
__69:
	;
__67:
	;

	goto __64
__65:
	;
	// FALLTHRU
__62:
cleanup2_pushObjResultPtr:
	objPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __76
	}
	goto __77
__76:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __78
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __80
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__80:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__81:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __84
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __85
__84:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++
__85:
	;
	goto __82
__82:
	if 0 != 0 {
		goto __81
	}
	goto __83
__83:
	;
	goto __79
__78:
	XTclFreeObj(tls, objPtr)
__79:
	;
__77:
	;

	// FALLTHRU
__63:
cleanup1_pushObjResultPtr:
	objPtr = *(*uintptr)(unsafe.Pointer(tosPtr))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __86
	}
	goto __87
__86:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __88
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __90
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__90:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__91:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __94
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __95
__94:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++
__95:
	;
	goto __92
__92:
	if 0 != 0 {
		goto __91
	}
	goto __93
__93:
	;
	goto __89
__88:
	XTclFreeObj(tls, objPtr)
__89:
	;
__87:
	;

__59:
	;
	*(*uintptr)(unsafe.Pointer(tosPtr)) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
	goto cleanup0

cleanupV:
	switch cleanup {
	default:
		goto __97
		// FALLTHRU
	case 2:
		goto __98
		// FALLTHRU
	case 1:
		goto __99
		// FALLTHRU
	case 0:
		goto __100
	}
	goto __96
__97:
	cleanup = cleanup - 2
__101:
	if !(libc.PostDecInt32(&cleanup, 1) != 0) {
		goto __102
	}
	objPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __103
	}
	goto __104
__103:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __105
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __107
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__107:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__108:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr7 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __111
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __112
__111:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++
__112:
	;
	goto __109
__109:
	if 0 != 0 {
		goto __108
	}
	goto __110
__110:
	;
	goto __106
__105:
	XTclFreeObj(tls, objPtr)
__106:
	;
__104:
	;

	goto __101
__102:
	;
	// FALLTHRU
__98:
cleanup2:
	objPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __113
	}
	goto __114
__113:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __115
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __117
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__117:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__118:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr8 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __121
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __122
__121:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects++
__122:
	;
	goto __119
__119:
	if 0 != 0 {
		goto __118
	}
	goto __120
__120:
	;
	goto __116
__115:
	XTclFreeObj(tls, objPtr)
__116:
	;
__114:
	;

	// FALLTHRU
__99:
cleanup1:
	objPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __123
	}
	goto __124
__123:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __125
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __127
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__127:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__128:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr9 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __131
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __132
__131:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects++
__132:
	;
	goto __129
__129:
	if 0 != 0 {
		goto __128
	}
	goto __130
__130:
	;
	goto __126
__125:
	XTclFreeObj(tls, objPtr)
__126:
	;
__124:
	;

	// FALLTHRU
__100:
	// We really want to do nothing now, but this is needed for some
	// compilers (SunPro CC).

	goto __96
__96:
	;
cleanup0:

	// Check for asynchronous handlers [Bug 746722]; we do the check every
	// ASYNC_CHECK_COUNT_MASK instruction, of the form (2**n-1).

	if !(libc.PostIncInt32(&instructionCount, 1)&ASYNC_CHECK_COUNT_MASK == 0) {
		goto __133
	}
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	if !(*(*int32)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FasyncReadyPtr)) != 0) {
		goto __134
	}
	result = XTcl_AsyncInvoke(tls, interp, result)
	if !(result == TCL_ERROR) {
		goto __135
	}
	checkInterp = 1
	goto gotError
__135:
	;
__134:
	;

	if !((*Interp)(unsafe.Pointer(interp)).Fflags&CANCELED != 0 || (*Interp)(unsafe.Pointer(interp)).Fflags&TCL_CANCEL_UNWIND != 0) {
		goto __136
	}
	if !(XTcl_Canceled(tls, interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) {
		goto __137
	}
	checkInterp = 1
	goto gotError
__137:
	;
__136:
	;

	if !(func() int32 {
		if (*Interp)(unsafe.Pointer(interp)).Flimit.Factive == 0 {
			return 0
		}
		return func() int32 {
			(*Interp)(unsafe.Pointer(interp)).Flimit.FgranularityTicker++
			return func() int32 {
				if (*Interp)(unsafe.Pointer(interp)).Flimit.Factive&TCL_LIMIT_COMMANDS != 0 && ((*Interp)(unsafe.Pointer(interp)).Flimit.FcmdGranularity == 1 || (*Interp)(unsafe.Pointer(interp)).Flimit.FgranularityTicker%(*Interp)(unsafe.Pointer(interp)).Flimit.FcmdGranularity == 0) {
					return 1
				}
				return func() int32 {
					if (*Interp)(unsafe.Pointer(interp)).Flimit.Factive&TCL_LIMIT_TIME != 0 && ((*Interp)(unsafe.Pointer(interp)).Flimit.FtimeGranularity == 1 || (*Interp)(unsafe.Pointer(interp)).Flimit.FgranularityTicker%(*Interp)(unsafe.Pointer(interp)).Flimit.FtimeGranularity == 0) {
						return 1
					}
					return 0
				}()
			}()
		}()
	}() != 0) {
		goto __138
	}
	if !(XTcl_LimitCheck(tls, interp) == TCL_ERROR) {
		goto __139
	}
	checkInterp = 1
	goto gotError
__139:
	;
__138:
	;
	checkInterp = 1
__133:
	;

	// These two instructions account for 26% of all instructions (according
	// to measurements on tclbench by Ben Vitale
	// [http://www.cs.toronto.edu/syslab/pubs/tcl2005-vitale-zaleski.pdf]
	// Resolving them before the switch reduces the cost of branch
	// mispredictions, seems to improve runtime by 5% to 15%, and (amazingly!)
	// reduces total obj size.

	inst = *(*uint8)(unsafe.Pointer(pc))

peepholeStart:

__140:
	if !(0 != 0) {
		goto __143
	}
	if !(curInstName != 0) {
		goto __145
	}

__145:
	;
	curInstName = XtclInstructionTable[*(*uint8)(unsafe.Pointer(pc))].Fname
	if !(0 != 0) {
		goto __146
	}

__146:
	;
	goto __144
__143:
	if !(0 != 0) {
		goto __147
	}

__147:
	;
__144:
	;
	goto __141
__141:
	if 0 != 0 {
		goto __140
	}
	goto __142
__142:
	;

	if !(int32(inst) == INST_LOAD_SCALAR1) {
		goto __148
	}
	goto instLoadScalar1
	goto __149
__148:
	if !(int32(inst) == INST_PUSH1) {
		goto __150
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FobjArrayPtr + uintptr(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))*8))))).FrefCount++

	inst = *(*uint8)(unsafe.Pointer(libc.AssignAddUintptr(&pc, uintptr(2))))
	goto peepholeStart
	goto __151
__150:
	if !(int32(inst) == INST_START_CMD) {
		goto __152
	}
	// Peephole: do not run INST_START_CMD, just skip it

	*(*int32)(unsafe.Pointer(interp + 320)) += int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(3)))))
	if !(checkInterp != 0) {
		goto __154
	}
	if !(((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FcompileEpoch != (*Interp)(unsafe.Pointer(interp)).FcompileEpoch || (*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FnsEpoch != (*Namespace)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr)).FresolverEpoch) && !((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).Fflags&uint32(TCL_BYTECODE_PRECOMPILED) != 0)) {
		goto __155
	}
	goto instStartCmdFailed
__155:
	;
	checkInterp = 0
__154:
	;
	inst = *(*uint8)(unsafe.Pointer(libc.AssignAddUintptr(&pc, uintptr(9))))
	goto peepholeStart
	goto __153
__152:
	if !(int32(inst) == INST_NOP) {
		goto __156
	}
__157:
	if !(int32(inst) == INST_NOP) {
		goto __158
	}

	inst = *(*uint8)(unsafe.Pointer(libc.PreIncUintptr(&pc, 1)))
	goto __157
__158:
	;
	goto peepholeStart
__156:
	;
__153:
	;
__151:
	;
__149:
	;

	switch int32(inst) {
	case INST_SYNTAX:
		goto __160
	case INST_RETURN_IMM:
		goto __161

	case INST_RETURN_STK:
		goto __162

	case INST_YIELD:
		goto __163

	case INST_YIELD_TO_INVOKE:
		goto __164

	case INST_TAILCALL:
		goto __165

	case INST_DONE:
		goto __166

	case INST_PUSH4:
		goto __167

	case INST_POP:
		goto __168

	case INST_DUP:
		goto __169

	case INST_OVER:
		goto __170

	case INST_REVERSE:
		goto __171

	case INST_STR_CONCAT1:
		goto __172

	case INST_CONCAT_STK:
		goto __173

	case INST_EXPAND_START:
		goto __174

	case INST_EXPAND_DROP:
		goto __175

	case INST_EXPAND_STKTOP:
		goto __176

	case INST_EXPR_STK:
		goto __177

		// INVOCATION BLOCK

	case INST_EVAL_STK:
		goto __178

	case INST_INVOKE_EXPANDED:
		goto __179

	case INST_INVOKE_STK4:
		goto __180

	case INST_INVOKE_STK1:
		goto __181

	case INST_CALL_BUILTIN_FUNC1:
		goto __182

	case INST_CALL_FUNC1:
		goto __183

	case INST_INVOKE_REPLACE:
		goto __184

	// -----------------------------------------------------------------
	//	   Start of INST_LOAD instructions.
	//
	// WARNING: more 'goto' here than your doctor recommended! The different
	// instructions set the value of some variables and then jump to some
	// common execution code.

	case INST_LOAD_SCALAR1:
		goto __185

	case INST_LOAD_SCALAR4:
		goto __186

	case INST_LOAD_ARRAY4:
		goto __187

	case INST_LOAD_ARRAY1:
		goto __188

	case INST_LOAD_ARRAY_STK:
		goto __189

	case INST_LOAD_STK:
		goto __190
	case INST_LOAD_SCALAR_STK:
		goto __191

	case INST_STORE_ARRAY4:
		goto __192

	case INST_STORE_ARRAY1:
		goto __193

	case INST_STORE_SCALAR4:
		goto __194

	case INST_STORE_SCALAR1:
		goto __195

	case INST_LAPPEND_STK:
		goto __196

	case INST_LAPPEND_ARRAY_STK:
		goto __197

	case INST_APPEND_STK:
		goto __198

	case INST_APPEND_ARRAY_STK:
		goto __199

	case INST_STORE_ARRAY_STK:
		goto __200

	case INST_STORE_STK:
		goto __201
	case INST_STORE_SCALAR_STK:
		goto __202

	case INST_LAPPEND_ARRAY4:
		goto __203

	case INST_LAPPEND_ARRAY1:
		goto __204

	case INST_APPEND_ARRAY4:
		goto __205

	case INST_APPEND_ARRAY1:
		goto __206

	case INST_LAPPEND_SCALAR4:
		goto __207

	case INST_LAPPEND_SCALAR1:
		goto __208

	case INST_APPEND_SCALAR4:
		goto __209

	case INST_APPEND_SCALAR1:
		goto __210

	case INST_LAPPEND_LIST:
		goto __211

	case INST_LAPPEND_LIST_ARRAY:
		goto __212

	case INST_LAPPEND_LIST_ARRAY_STK:
		goto __213

	case INST_LAPPEND_LIST_STK:
		goto __214

	case INST_INCR_SCALAR1:
		goto __215
	case INST_INCR_ARRAY1:
		goto __216
	case INST_INCR_ARRAY_STK:
		goto __217
	case INST_INCR_SCALAR_STK:
		goto __218
	case INST_INCR_STK:
		goto __219

	case INST_INCR_ARRAY_STK_IMM:
		goto __220
	case INST_INCR_SCALAR_STK_IMM:
		goto __221
	case INST_INCR_STK_IMM:
		goto __222

	case INST_INCR_ARRAY1_IMM:
		goto __223

	case INST_INCR_SCALAR1_IMM:
		goto __224

	//	   End of INST_INCR instructions.
	// -----------------------------------------------------------------
	//	   Start of INST_EXIST instructions.

	case INST_EXIST_SCALAR:
		goto __225

	case INST_EXIST_ARRAY:
		goto __226

	case INST_EXIST_ARRAY_STK:
		goto __227

	case INST_EXIST_STK:
		goto __228

	case INST_UNSET_SCALAR:
		goto __229

	case INST_UNSET_ARRAY:
		goto __230

	case INST_UNSET_ARRAY_STK:
		goto __231

	case INST_UNSET_STK:
		goto __232

		// This is really an unset operation these days. Do not issue.

	case INST_DICT_DONE:
		goto __233

	//	   End of INST_UNSET instructions.
	// -----------------------------------------------------------------
	//	   Start of INST_ARRAY instructions.

	case INST_ARRAY_EXISTS_IMM:
		goto __234
	case INST_ARRAY_EXISTS_STK:
		goto __235

	case INST_ARRAY_MAKE_IMM:
		goto __236
	case INST_ARRAY_MAKE_STK:
		goto __237

	case INST_UPVAR:
		goto __238

	case INST_NSUPVAR:
		goto __239

	case INST_VARIABLE:
		goto __240

	//	   End of variable linking instructions.
	// -----------------------------------------------------------------

	case INST_JUMP1:
		goto __241

	case INST_JUMP4:
		goto __242

		// TODO: consider rewrite so we don't compute the offset we're not
		// going to take.
	case INST_JUMP_FALSE4:
		goto __243

	case INST_JUMP_TRUE4:
		goto __244

	case INST_JUMP_FALSE1:
		goto __245

	case INST_JUMP_TRUE1:
		goto __246

	case INST_JUMP_TABLE:
		goto __247

	// These two instructions are now redundant: the complete logic of the LOR
	// and LAND is now handled by the expression compiler.

	case INST_LOR:
		goto __248
	case INST_LAND:
		goto __249

	// -----------------------------------------------------------------
	//	   Start of general introspector instructions.

	case INST_NS_CURRENT:
		goto __250
	case INST_COROUTINE_NAME:
		goto __251
	case INST_INFO_LEVEL_NUM:
		goto __252
	case INST_INFO_LEVEL_ARGS:
		goto __253

	case INST_RESOLVE_COMMAND:
		goto __254

	case INST_ORIGIN_COMMAND:
		goto __255

	case INST_TCLOO_SELF:
		goto __256

	case INST_TCLOO_NEXT_CLASS:
		goto __257

	case INST_TCLOO_NEXT:
		goto __258

	case INST_TCLOO_IS_OBJECT:
		goto __259
	case INST_TCLOO_CLASS:
		goto __260
	case INST_TCLOO_NS:
		goto __261

	case INST_LIST:
		goto __262

	case INST_LIST_LENGTH:
		goto __263

	case INST_LIST_INDEX:
		goto __264 // Already has the correct refCount

	case INST_LIST_INDEX_IMM:
		goto __265

	case INST_LIST_INDEX_MULTI:
		goto __266

	case INST_LSET_FLAT:
		goto __267

	case INST_LSET_LIST:
		goto __268

	case INST_LIST_RANGE_IMM:
		goto __269

	case INST_LIST_IN:
		goto __270
	case INST_LIST_NOT_IN:
		goto __271

	case INST_LIST_CONCAT:
		goto __272

	//	   End of INST_LIST and related instructions.
	// -----------------------------------------------------------------
	//	   Start of string-related instructions.

	case INST_STR_EQ:
		goto __273
	case INST_STR_NEQ:
		goto __274 // String (in)equality check
	case INST_STR_CMP:
		goto __275

	case INST_STR_LEN:
		goto __276

	case INST_STR_UPPER:
		goto __277
	case INST_STR_LOWER:
		goto __278
	case INST_STR_TITLE:
		goto __279

	case INST_STR_INDEX:
		goto __280

	case INST_STR_RANGE:
		goto __281

	case INST_STR_RANGE_IMM:
		goto __282

	case INST_STR_REPLACE:
		goto __283

	case INST_STR_MAP:
		goto __284

	case INST_STR_FIND:
		goto __285

	case INST_STR_FIND_LAST:
		goto __286

	case INST_STR_CLASS:
		goto __287

	case INST_STR_MATCH:
		goto __288

	case INST_STR_TRIM_LEFT:
		goto __289
	case INST_STR_TRIM_RIGHT:
		goto __290
	case INST_STR_TRIM:
		goto __291

	case INST_REGEXP:
		goto __292

	case INST_NUM_TYPE:
		goto __293

	case INST_EQ:
		goto __294
	case INST_NEQ:
		goto __295
	case INST_LT:
		goto __296
	case INST_GT:
		goto __297
	case INST_LE:
		goto __298
	case INST_GE:
		goto __299

	case INST_MOD:
		goto __300
	case INST_LSHIFT:
		goto __301
	case INST_RSHIFT:
		goto __302
	case INST_BITOR:
		goto __303
	case INST_BITXOR:
		goto __304
	case INST_BITAND:
		goto __305

	case INST_EXPON:
		goto __306
	case INST_ADD:
		goto __307
	case INST_SUB:
		goto __308
	case INST_DIV:
		goto __309
	case INST_MULT:
		goto __310

	case INST_LNOT:
		goto __311

	case INST_BITNOT:
		goto __312

	case INST_UMINUS:
		goto __313

	case INST_UPLUS:
		goto __314
	case INST_TRY_CVT_TO_NUMERIC:
		goto __315

	//	   End of numeric operator instructions.
	// -----------------------------------------------------------------

	case INST_TRY_CVT_TO_BOOLEAN:
		goto __316

	case INST_BREAK:
		goto __317

	case INST_CONTINUE:
		goto __318

	case INST_FOREACH_START4:
		goto __319

	case INST_FOREACH_STEP4:
		goto __320

	case INST_FOREACH_START:
		goto __321

	case INST_FOREACH_STEP:
		goto __322

	case INST_FOREACH_END:
		goto __323

	case INST_LMAP_COLLECT:
		goto __324

	case INST_BEGIN_CATCH4:
		goto __325

	case INST_END_CATCH:
		goto __326

	case INST_PUSH_RESULT:
		goto __327

	case INST_PUSH_RETURN_CODE:
		goto __328

	case INST_PUSH_RETURN_OPTIONS:
		goto __329

	case INST_RETURN_CODE_BRANCH:
		goto __330

	case INST_DICT_VERIFY:
		goto __331

	case INST_DICT_GET:
		goto __332
	case INST_DICT_EXISTS:
		goto __333

	case INST_DICT_SET:
		goto __334
	case INST_DICT_UNSET:
		goto __335
	case INST_DICT_INCR_IMM:
		goto __336

	case INST_DICT_APPEND:
		goto __337
	case INST_DICT_LAPPEND:
		goto __338

	case INST_DICT_FIRST:
		goto __339

	case INST_DICT_NEXT:
		goto __340

	case INST_DICT_UPDATE_START:
		goto __341

	case INST_DICT_UPDATE_END:
		goto __342

	case INST_DICT_EXPAND:
		goto __343

	case INST_DICT_RECOMBINE_STK:
		goto __344

	case INST_DICT_RECOMBINE_IMM:
		goto __345

	//	   End of dictionary-related instructions.
	// -----------------------------------------------------------------

	case INST_CLOCK_READ:
		goto __346

	default:
		goto __347
	}
	goto __159
__160:
__161:
	code = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3))))
	level = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(3)))))

	// OBJ_AT_TOS is returnOpts, OBJ_UNDER_TOS is resultObjPtr.

	result = XTclProcessReturn(tls, interp, code, level, *(*uintptr)(unsafe.Pointer(tosPtr)))
	if !(result == TCL_OK) {
		goto __348
	}

__349:
	;
	if !(1 == 0) {
		goto __352
	}
	if !(0 != 0) {
		goto __354
	}
	if !(0 > 0) {
		goto __355
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __356
__355:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__356:
	;
__354:
	;
	pc += uintptr(9)
	goto cleanup0
	goto __353
__352:
	if !(0 != 0) {
		goto __357
	}
	if !(0 > 0) {
		goto __359
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__359:
	;
	pc += uintptr(9)
	switch 1 {
	case 1:
		goto __361
	case 2:
		goto __362
	case 0:
		goto __363
	}
	goto __360
__361:
	goto cleanup1_pushObjResultPtr
__362:
	goto cleanup2_pushObjResultPtr
__363:
	goto __360
__360:
	;
	goto __358
__357:
	pc += uintptr(9)
	switch 1 {
	case 1:
		goto __365
	case 2:
		goto __366
	case 0:
		goto __367
	}
	goto __364
__365:
	goto cleanup1
__366:
	goto cleanup2
__367:
	goto __364
__364:
	;
__358:
	;
__353:
	;
	goto __350
__350:
	if 0 != 0 {
		goto __349
	}
	goto __351
__351:
	;
__348:
	;
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)))
	if !(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_SYNTAX) {
		goto __368
	}
	*(*int32)(unsafe.Pointer(interp + 424)) &= libc.CplInt32(ERR_ALREADY_LOGGED)
__368:
	;
	cleanup = 2

	goto processExceptionReturn

__162:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	result = XTcl_SetReturnOptions(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)))
	if !(result == TCL_OK) {
		goto __369
	}
__371:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(tosPtr))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __374
	}
	XTclFreeObj(tls, _objPtr1)
__374:
	;
	goto __372
__372:
	if 0 != 0 {
		goto __371
	}
	goto __373
__373:
	;
	*(*uintptr)(unsafe.Pointer(tosPtr)) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))

__375:
	;
	if !(0 == 0) {
		goto __378
	}
	if !(0 != 0) {
		goto __380
	}
	if !(0 > 0) {
		goto __381
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __382
__381:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__382:
	;
__380:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __379
__378:
	if !(0 != 0) {
		goto __383
	}
	if !(0 > 0) {
		goto __385
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__385:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __387
	case 2:
		goto __388
	case 0:
		goto __389
	}
	goto __386
__387:
	goto cleanup1_pushObjResultPtr
__388:
	goto cleanup2_pushObjResultPtr
__389:
	goto __386
__386:
	;
	goto __384
__383:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __391
	case 2:
		goto __392
	case 0:
		goto __393
	}
	goto __390
__391:
	goto cleanup1
__392:
	goto cleanup2
__393:
	goto __390
__390:
	;
__384:
	;
__379:
	;
	goto __376
__376:
	if 0 != 0 {
		goto __375
	}
	goto __377
__377:
	;
	goto __370
__369:
	if !(result == TCL_ERROR) {
		goto __394
	}
	// BEWARE! Must do this in this order, because an error in the
	// option dictionary overrides the result (and can be verified by
	// test).

	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))
	XTcl_SetReturnOptions(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)))
__396:
	_objPtr2 = *(*uintptr)(unsafe.Pointer(tosPtr))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __399
	}
	XTclFreeObj(tls, _objPtr2)
__399:
	;
	goto __397
__397:
	if 0 != 0 {
		goto __396
	}
	goto __398
__398:
	;
	*(*uintptr)(unsafe.Pointer(tosPtr)) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
	goto __395
__394:
__400:
	_objPtr3 = *(*uintptr)(unsafe.Pointer(tosPtr))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __403
	}
	XTclFreeObj(tls, _objPtr3)
__403:
	;
	goto __401
__401:
	if 0 != 0 {
		goto __400
	}
	goto __402
__402:
	;
	*(*uintptr)(unsafe.Pointer(tosPtr)) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))
__395:
	;
__370:
	;
	cleanup = 1

	goto processExceptionReturn

__163:
	corPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcorPtr

	if !!(corPtr != 0) {
		goto __404
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+8583, -1))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+8623, ts+8633,
		uintptr(0)))
	checkInterp = 1
	goto gotError
__404:
	;

	yieldParameter = 0
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)))
	goto doYield

__164:
	corPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcorPtr
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	if !!(corPtr != 0) {
		goto __405
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+8665, -1))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+8623, ts+8633,
		uintptr(0)))
	checkInterp = 1
	goto gotError
__405:
	;
	if !((*Namespace)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr)).Fflags&NS_DYING != 0) {
		goto __406
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+8707, -1))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+8623, ts+8743,
		uintptr(0)))
	checkInterp = 1
	goto gotError
__406:
	;

	// Install a tailcall record in the caller and continue with the
	// yield. The yield is switched into multi-return mode (via the
	// 'yieldParameter').

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount++
	(*Interp)(unsafe.Pointer(interp)).FexecEnvPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr
	XTclSetTailcall(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	(*Interp)(unsafe.Pointer(interp)).FexecEnvPtr = (*CoroutineData)(unsafe.Pointer(corPtr)).FeePtr
	yieldParameter = int32(uintptr(0)) + 1 //==CORO_ACTIVATE_YIELDM

doYield:
	// TIP #280: Record the last piece of info needed by
	// 'TclGetSrcInfoForPc', and push the frame.

	*(*uintptr)(unsafe.Pointer(TD + 24 + 40 + 8 /* &.pc */)) = pc
	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = TD + 24

	if !((*Interp)(unsafe.Pointer(interp)).Fflags&INTERP_DEBUG_FRAME != 0) {
		goto __407
	}
	sArgumentBCEnter(tls, interp, (*TEBCdata)(unsafe.Pointer(TD)).FcodePtr, TD, pc, *(*int32)(unsafe.Pointer(bp + 720 /* objc */)), *(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)))
__407:
	;

	pc++
	cleanup = 1
__408:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
__411:
__414:
	;
__417:
	if !(interp == uintptr(0) || func() bool {
		cachePtr10 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects == 0
	}()) {
		goto __420
	}
	_objPtr4 = XTclThreadAllocObj(tls)
	goto __421
__420:
	_objPtr4 = (*AllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr4 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects--
__421:
	;
	goto __418
__418:
	if 0 != 0 {
		goto __417
	}
	goto __419
__419:
	;
	_callbackPtr = _objPtr4
	goto __415
__415:
	if 0 != 0 {
		goto __414
	}
	goto __416
__416:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTEBCresume}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = TD
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = pc
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(Intptr_t(cleanup))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __412
__412:
	if 0 != 0 {
		goto __411
	}
	goto __413
__413:
	;
	goto __409
__409:
	if 0 != 0 {
		goto __408
	}
	goto __410
__410:
	;
__422:
__425:
	;
__428:
	if !(interp == uintptr(0) || func() bool {
		cachePtr11 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects == 0
	}()) {
		goto __431
	}
	_objPtr5 = XTclThreadAllocObj(tls)
	goto __432
__431:
	_objPtr5 = (*AllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr5 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects--
__432:
	;
	goto __429
__429:
	if 0 != 0 {
		goto __428
	}
	goto __430
__430:
	;
	_callbackPtr1 = _objPtr5
	goto __426
__426:
	if 0 != 0 {
		goto __425
	}
	goto __427
__427:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr1)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{XTclNRCoroutineActivateCallback}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8)) = corPtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8 + 1*8)) = uintptr(Intptr_t(yieldParameter))
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr1 + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr1)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr1
	goto __423
__423:
	if 0 != 0 {
		goto __422
	}
	goto __424
__424:
	;
	return TCL_OK

__165:

	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))

	if !!((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FisProcCallFrame&1 != 0) {
		goto __433
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+28251, -1))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+8513, ts+8522, uintptr(0)))
	checkInterp = 1
	goto gotError
__433:
	;

	// Push the evaluation of the called command into the NR callback
	// stack.

	listPtr = XTcl_NewListObj(tls, opnd, tosPtr-uintptr(opnd-1)*8)
	nsObjPtr = XTcl_NewStringObj(tls, (*Namespace)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr)).FfullName, -1)
	XTclListObjSetElement(tls, interp, listPtr, 0, nsObjPtr)
	if !((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FtailcallPtr != 0) {
		goto __434
	}
__435:
	_objPtr6 = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FtailcallPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr6)).FrefCount, 1) <= 1) {
		goto __438
	}
	XTclFreeObj(tls, _objPtr6)
__438:
	;
	goto __436
__436:
	if 0 != 0 {
		goto __435
	}
	goto __437
__437:
	;
__434:
	;
	(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FtailcallPtr = listPtr

	result = TCL_RETURN
	cleanup = opnd
	goto processExceptionReturn

__166:
	if !(tosPtr > TD+112-uintptr(1)*8+uintptr((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FmaxExceptDepth)*8) {
		goto __439
	}

	if !(int32(*(*ClientData)(unsafe.Pointer(data + 3*8)))&TCL_EVAL_DISCARD_RESULT != 0 && result == TCL_OK) {
		goto __440
	}
	// simulate pop & fast done (like it does continue in loop)

	objPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __441
	}
	goto __442
__441:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __443
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __445
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__445:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__446:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr12 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __449
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __450
__449:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects++
__450:
	;
	goto __447
__447:
	if 0 != 0 {
		goto __446
	}
	goto __448
__448:
	;
	goto __444
__443:
	XTclFreeObj(tls, objPtr)
__444:
	;
__442:
	;

	goto abnormalReturn
__440:
	;
	// Set the interpreter's object result to point to the topmost
	// object from the stack, and check for a possible [catch]. The
	// stackTop's level and refCount will be handled by "processCatch"
	// or "abnormalReturn".

	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)))
	goto checkForCatch
__439:
	;
	_ = *(*byte)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	goto abnormalReturn

__167:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FobjArrayPtr + uintptr(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24)|uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16)|uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8)|uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))*8))

__451:
	;
	if !(0 == 0) {
		goto __454
	}
	if !(1 != 0) {
		goto __456
	}
	if !(1 > 0) {
		goto __457
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __458
__457:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__458:
	;
__456:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __455
__454:
	if !(1 != 0) {
		goto __459
	}
	if !(1 > 0) {
		goto __461
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__461:
	;
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __463
	case 2:
		goto __464
	case 0:
		goto __465
	}
	goto __462
__463:
	goto cleanup1_pushObjResultPtr
__464:
	goto cleanup2_pushObjResultPtr
__465:
	goto __462
__462:
	;
	goto __460
__459:
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __467
	case 2:
		goto __468
	case 0:
		goto __469
	}
	goto __466
__467:
	goto cleanup1
__468:
	goto cleanup2
__469:
	goto __466
__466:
	;
__460:
	;
__455:
	;
	goto __452
__452:
	if 0 != 0 {
		goto __451
	}
	goto __453
__453:
	;
	goto __159

__168:
	;
	objPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __470
	}
	goto __471
__470:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __472
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __474
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__474:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__475:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr13 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __478
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __479
__478:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr13)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr13)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects++
__479:
	;
	goto __476
__476:
	if 0 != 0 {
		goto __475
	}
	goto __477
__477:
	;
	goto __473
__472:
	XTclFreeObj(tls, objPtr)
__473:
	;
__471:
	;

__480:
	;
	if !(0 == 0) {
		goto __483
	}
	if !(0 != 0) {
		goto __485
	}
	if !(0 > 0) {
		goto __486
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __487
__486:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__487:
	;
__485:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __484
__483:
	if !(0 != 0) {
		goto __488
	}
	if !(0 > 0) {
		goto __490
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__490:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __492
	case 2:
		goto __493
	case 0:
		goto __494
	}
	goto __491
__492:
	goto cleanup1_pushObjResultPtr
__493:
	goto cleanup2_pushObjResultPtr
__494:
	goto __491
__491:
	;
	goto __489
__488:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __496
	case 2:
		goto __497
	case 0:
		goto __498
	}
	goto __495
__496:
	goto cleanup1
__497:
	goto cleanup2
__498:
	goto __495
__495:
	;
__489:
	;
__484:
	;
	goto __481
__481:
	if 0 != 0 {
		goto __480
	}
	goto __482
__482:
	;
	goto __159

__169:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))

__499:
	;
	if !(0 == 0) {
		goto __502
	}
	if !(1 != 0) {
		goto __504
	}
	if !(1 > 0) {
		goto __505
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __506
__505:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__506:
	;
__504:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __503
__502:
	if !(1 != 0) {
		goto __507
	}
	if !(1 > 0) {
		goto __509
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__509:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __511
	case 2:
		goto __512
	case 0:
		goto __513
	}
	goto __510
__511:
	goto cleanup1_pushObjResultPtr
__512:
	goto cleanup2_pushObjResultPtr
__513:
	goto __510
__510:
	;
	goto __508
__507:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __515
	case 2:
		goto __516
	case 0:
		goto __517
	}
	goto __514
__515:
	goto cleanup1
__516:
	goto cleanup2
__517:
	goto __514
__514:
	;
__508:
	;
__503:
	;
	goto __500
__500:
	if 0 != 0 {
		goto __499
	}
	goto __501
__501:
	;
	goto __159

__170:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(opnd)*8))

__518:
	;
	if !(0 == 0) {
		goto __521
	}
	if !(1 != 0) {
		goto __523
	}
	if !(1 > 0) {
		goto __524
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __525
__524:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__525:
	;
__523:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __522
__521:
	if !(1 != 0) {
		goto __526
	}
	if !(1 > 0) {
		goto __528
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__528:
	;
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __530
	case 2:
		goto __531
	case 0:
		goto __532
	}
	goto __529
__530:
	goto cleanup1_pushObjResultPtr
__531:
	goto cleanup2_pushObjResultPtr
__532:
	goto __529
__529:
	;
	goto __527
__526:
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __534
	case 2:
		goto __535
	case 0:
		goto __536
	}
	goto __533
__534:
	goto cleanup1
__535:
	goto cleanup2
__536:
	goto __533
__533:
	;
__527:
	;
__522:
	;
	goto __519
__519:
	if 0 != 0 {
		goto __518
	}
	goto __520
__520:
	;
	goto __159

__171:

	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	a = tosPtr - uintptr(opnd-1)*8
	b = tosPtr
__537:
	if !(a < b) {
		goto __538
	}
	tmpPtr = *(*uintptr)(unsafe.Pointer(a))
	*(*uintptr)(unsafe.Pointer(a)) = *(*uintptr)(unsafe.Pointer(b))
	*(*uintptr)(unsafe.Pointer(b)) = tmpPtr
	a += 8
	b -= 8
	goto __537
__538:
	;

__539:
	;
	if !(0 == 0) {
		goto __542
	}
	if !(0 != 0) {
		goto __544
	}
	if !(0 > 0) {
		goto __545
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __546
__545:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__546:
	;
__544:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __543
__542:
	if !(0 != 0) {
		goto __547
	}
	if !(0 > 0) {
		goto __549
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__549:
	;
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __551
	case 2:
		goto __552
	case 0:
		goto __553
	}
	goto __550
__551:
	goto cleanup1_pushObjResultPtr
__552:
	goto cleanup2_pushObjResultPtr
__553:
	goto __550
__550:
	;
	goto __548
__547:
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __555
	case 2:
		goto __556
	case 0:
		goto __557
	}
	goto __554
__555:
	goto cleanup1
__556:
	goto cleanup2
__557:
	goto __554
__554:
	;
__548:
	;
__543:
	;
	goto __540
__540:
	if 0 != 0 {
		goto __539
	}
	goto __541
__541:
	;

	goto __159

__172:
	appendLen = 0
	onlyb = 1

	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))

	// Detect only-bytearray-or-null case.

	currPtr = tosPtr - uintptr(opnd-1)*8
__558:
	if !(currPtr <= tosPtr) {
		goto __560
	}
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).FtypePtr != uintptr(unsafe.Pointer(&XtclByteArrayType)) &&
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).Fbytes != XtclEmptyStringRep) {
		goto __561
	}
	onlyb = 0
	goto __560
	goto __562
__561:
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).Fbytes != uintptr(0)) {
		goto __563
	}
	onlyb = 0
	goto __560
__563:
	;
__562:
	;
	goto __559
__559:
	currPtr += 8
	goto __558
	goto __560
__560:
	;

	// Compute the length to be appended.

	if !(onlyb != 0) {
		goto __564
	}
	currPtr = tosPtr - uintptr(opnd-2)*8
__566:
	if !(appendLen >= 0 && currPtr <= tosPtr) {
		goto __568
	}
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).Fbytes != XtclEmptyStringRep) {
		goto __569
	}
	XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(currPtr)), bp+704)
	appendLen = appendLen + *(*int32)(unsafe.Pointer(bp + 704))
__569:
	;
	goto __567
__567:
	currPtr += 8
	goto __566
	goto __568
__568:
	;
	goto __565
__564:
	currPtr = tosPtr - uintptr(opnd-2)*8
__570:
	if !(appendLen >= 0 && currPtr <= tosPtr) {
		goto __572
	}
	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 704)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(currPtr)), bp+704)
	}()
	if !(bytes != uintptr(0)) {
		goto __573
	}
	appendLen = appendLen + *(*int32)(unsafe.Pointer(bp + 704))
__573:
	;
	goto __571
__571:
	currPtr += 8
	goto __570
	goto __572
__572:
	;
__565:
	;

	if !(appendLen < 0) {
		goto __574
	}
	// TODO: convert panic to error ?
	XTcl_Panic(tls, ts+9405, libc.VaList(bp+128, 0x7fffffff))
__574:
	;

	// If nothing is to be appended, just return the first object by
	// dropping all the others from the stack; this saves both the
	// computation and copy of the string rep of the first object,
	// enabling the fast '$x[set x {}]' idiom for 'K $x [set x {}]'.

	if !(appendLen == 0) {
		goto __575
	}

__576:
	pc += uintptr(2)
	cleanup = opnd - 1
	if !(0 != 0) {
		goto __579
	}
	if !(0 > 0) {
		goto __581
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__581:
	;
	goto cleanupV_pushObjResultPtr
	goto __580
__579:
	goto cleanupV
__580:
	;
	goto __577
__577:
	if 0 != 0 {
		goto __576
	}
	goto __578
__578:
	;
__575:
	;

	// If the first object is shared, we need a new obj for the result;
	// otherwise, we can reuse the first object. In any case, make sure it
	// has enough room to accomodate all the concatenated bytes. Note that
	// if it is unshared its bytes are copied by ckrealloc, so that we set
	// the loop parameters to avoid copying them again: p points to the
	// end of the already copied bytes, currPtr to the second object.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(opnd-1)*8))
	if !!(onlyb != 0) {
		goto __582
	}
	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 704)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936)), bp+704)
	}()
	if !(*(*int32)(unsafe.Pointer(bp + 704))+appendLen < 0) {
		goto __584
	}
	// TODO: convert panic to error ?
	XTcl_Panic(tls, ts+9405,
		libc.VaList(bp+136, 0x7fffffff))
__584:
	;
	if !(bytes != XtclEmptyStringRep && !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount > 1)) {
		goto __585
	}
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr != uintptr(0)) {
		goto __587
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __588
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))).FtypePtr)).FfreeIntRepProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))
__588:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))).FtypePtr = uintptr(0)
__587:
	;

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))).Fbytes = XTcl_Realloc(tls, bytes, uint32(*(*int32)(unsafe.Pointer(bp + 704))+appendLen+1))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))).Flength = *(*int32)(unsafe.Pointer(bp + 704)) + appendLen
	p = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 936)))
	}() + uintptr(*(*int32)(unsafe.Pointer(bp + 704)))
	currPtr = tosPtr - uintptr(opnd-2)*8
	goto __586
__585:

	p = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 704))+appendLen+1))
__589:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr14 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects == 0
	}()) {
		goto __592
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __593
__592:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr14)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr14)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects--
__593:
	;
	goto __590
__590:
	if 0 != 0 {
		goto __589
	}
	goto __591
__591:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))).Fbytes = p
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))).Flength = *(*int32)(unsafe.Pointer(bp + 704)) + appendLen
	currPtr = tosPtr - uintptr(opnd-1)*8
__586:
	;

	// Append the remaining characters.

__594:
	if !(currPtr <= tosPtr) {
		goto __596
	}
	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 704)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(currPtr)), bp+704)
	}()
	if !(bytes != uintptr(0)) {
		goto __597
	}
	libc.Xmemcpy(tls, p, bytes, uint64(*(*int32)(unsafe.Pointer(bp + 704 /* length */))))
	p += uintptr(*(*int32)(unsafe.Pointer(bp + 704 /* length */)))
__597:
	;
	goto __595
__595:
	currPtr += 8
	goto __594
	goto __596
__596:
	;
	*(*int8)(unsafe.Pointer(p)) = int8(0)
	goto __583
__582:
	bytes = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)), bp+704)
	if !(*(*int32)(unsafe.Pointer(bp + 704))+appendLen < 0) {
		goto __598
	}
	// TODO: convert panic to error ?
	XTcl_Panic(tls, ts+9405,
		libc.VaList(bp+144, 0x7fffffff))
__598:
	;
	if !!((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount > 1) {
		goto __599
	}
	bytes = XTcl_SetByteArrayLength(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)),
		*(*int32)(unsafe.Pointer(bp + 704))+appendLen)
	p = bytes + uintptr(*(*int32)(unsafe.Pointer(bp + 704)))
	currPtr = tosPtr - uintptr(opnd-2)*8
	goto __600
__599:
	;
__601:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr15 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects == 0
	}()) {
		goto __604
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __605
__604:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr15)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr15)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects--
__605:
	;
	goto __602
__602:
	if 0 != 0 {
		goto __601
	}
	goto __603
__603:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	bytes = XTcl_SetByteArrayLength(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)),
		*(*int32)(unsafe.Pointer(bp + 704))+appendLen)
	p = bytes
	currPtr = tosPtr - uintptr(opnd-1)*8
__600:
	;

	// Append the remaining characters.

__606:
	if !(currPtr <= tosPtr) {
		goto __608
	}
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(currPtr)))).Fbytes != XtclEmptyStringRep) {
		goto __609
	}
	bytes = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(currPtr)), bp+704)
	libc.Xmemcpy(tls, p, bytes, uint64(*(*int32)(unsafe.Pointer(bp + 704 /* length */))))
	p += uintptr(*(*int32)(unsafe.Pointer(bp + 704 /* length */)))
__609:
	;
	goto __607
__607:
	currPtr += 8
	goto __606
	goto __608
__608:
	;
__583:
	;

__610:
	pc += uintptr(2)
	cleanup = opnd
	if !(1 != 0) {
		goto __613
	}
	if !(1 > 0) {
		goto __615
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__615:
	;
	goto cleanupV_pushObjResultPtr
	goto __614
__613:
	goto cleanupV
__614:
	;
	goto __611
__611:
	if 0 != 0 {
		goto __610
	}
	goto __612
__612:
	;

__173:
	// Pop the opnd (objc) top stack elements, run through Tcl_ConcatObj,
	// and then decrement their ref counts.

	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_ConcatObj(tls, opnd, tosPtr-uintptr(opnd-1)*8)

__616:
	pc += uintptr(5)
	cleanup = opnd
	if !(1 != 0) {
		goto __619
	}
	if !(1 > 0) {
		goto __621
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__621:
	;
	goto cleanupV_pushObjResultPtr
	goto __620
__619:
	goto cleanupV
__620:
	;
	goto __617
__617:
	if 0 != 0 {
		goto __616
	}
	goto __618
__618:
	;

__174:
	// Push an element to the auxObjList. This records the current
	// stack depth - i.e., the point in the stack where the expanded
	// command starts.
	//
	// Use a Tcl_Obj as linked list element; slight mem waste, but faster
	// allocation than ckalloc. This also abuses the Tcl_Obj structure, as
	// we do not define a special tclObjType for it. It is not dangerous
	// as the obj is never passed anywhere, so that all manipulations are
	// performed here and in INST_INVOKE_EXPANDED (in case of an expansion
	// error, also in INST_EXPAND_STKTOP).

	;
__622:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr16 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr16)).FnumObjects == 0
	}()) {
		goto __625
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __626
__625:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr16)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr16)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr16)).FnumObjects--
__626:
	;
	goto __623
__623:
	if 0 != 0 {
		goto __622
	}
	goto __624
__624:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)

	*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr((int64(tosPtr) - int64(TD+112-uintptr(1)*8+uintptr((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FmaxExceptDepth)*8)) / 8)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
__627:
	if !((*TEBCdata)(unsafe.Pointer(TD)).FauxObjList != 0) {
		goto __630
	}
	*(*int32)(unsafe.Pointer(objPtr + 16)) += (*Tcl_Obj)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FauxObjList)).Flength
__630:
	;
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*TEBCdata)(unsafe.Pointer(TD)).FauxObjList
	(*TEBCdata)(unsafe.Pointer(TD)).FauxObjList = objPtr
	goto __628
__628:
	if 0 != 0 {
		goto __627
	}
	goto __629
__629:
	;

__631:
	;
	if !(0 == 0) {
		goto __634
	}
	if !(0 != 0) {
		goto __636
	}
	if !(0 > 0) {
		goto __637
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __638
__637:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__638:
	;
__636:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __635
__634:
	if !(0 != 0) {
		goto __639
	}
	if !(0 > 0) {
		goto __641
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__641:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __643
	case 2:
		goto __644
	case 0:
		goto __645
	}
	goto __642
__643:
	goto cleanup1_pushObjResultPtr
__644:
	goto cleanup2_pushObjResultPtr
__645:
	goto __642
__642:
	;
	goto __640
__639:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __647
	case 2:
		goto __648
	case 0:
		goto __649
	}
	goto __646
__647:
	goto cleanup1
__648:
	goto cleanup2
__649:
	goto __646
__646:
	;
__640:
	;
__635:
	;
	goto __632
__632:
	if 0 != 0 {
		goto __631
	}
	goto __633
__633:
	;
	goto __159

__175:
	// Drops an element of the auxObjList, popping stack elements to
	// restore the stack to the state before the point where the aux
	// element was created.

	;
	*(*int32)(unsafe.Pointer(bp + 720 /* objc */)) = int32((int64(tosPtr)-int64(TD+112-uintptr(1)*8+uintptr((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FmaxExceptDepth)*8))/8 - Ptrdiff_t(int32(*(*uintptr)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FauxObjList + 32 + 8)))))
__650:
	tmpPtr = (*TEBCdata)(unsafe.Pointer(TD)).FauxObjList
	(*TEBCdata)(unsafe.Pointer(TD)).FauxObjList = *(*uintptr)(unsafe.Pointer(tmpPtr + 32))
__653:
	_objPtr7 = tmpPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr7)).FrefCount, 1) <= 1) {
		goto __656
	}
	XTclFreeObj(tls, _objPtr7)
__656:
	;
	goto __654
__654:
	if 0 != 0 {
		goto __653
	}
	goto __655
__655:
	;
	goto __651
__651:
	if 0 != 0 {
		goto __650
	}
	goto __652
__652:
	;

__657:
	pc += uintptr(1)
	cleanup = *(*int32)(unsafe.Pointer(bp + 720))
	if !(0 != 0) {
		goto __660
	}
	if !(0 > 0) {
		goto __662
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__662:
	;
	goto cleanupV_pushObjResultPtr
	goto __661
__660:
	goto cleanupV
__661:
	;
	goto __658
__658:
	if 0 != 0 {
		goto __657
	}
	goto __659
__659:
	;

__176:

	// Make sure that the element at stackTop is a list; if not, just
	// leave with an error. Note that the element from the expand list
	// will be removed at checkForCatch.

	objPtr = *(*uintptr)(unsafe.Pointer(tosPtr))

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 712)) = *(*uintptr)(unsafe.Pointer(objPtr + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 720)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, objPtr, bp+720, bp+712)
	}() != TCL_OK) {
		goto __663
	}

	goto gotError
__663:
	;
	_ = *(*byte)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))

	// Make sure there is enough room in the stack to expand this list
	// *and* process the rest of the command (at least up to the next
	// argument expansion or command end). The operand is the current
	// stack depth, as seen by the compiler.

	*(*int32)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FauxObjList + 16)) += *(*int32)(unsafe.Pointer(bp + 720)) - 1
	if !(*(*int32)(unsafe.Pointer(bp + 720)) > 1 && (*Tcl_Obj)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FauxObjList)).Flength > 0) {
		goto __664
	}
	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = int32(Ptrdiff_t((*Tcl_Obj)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FauxObjList)).Flength+
		(*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FmaxStackDepth) -
		(int64(tosPtr)-int64(TD+112-uintptr(1)*8+uintptr((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FmaxExceptDepth)*8))/8) // Relative to where we are
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	moved = (int64(sGrowEvaluationStack(tls, (*Interp)(unsafe.Pointer(interp)).FexecEnvPtr, *(*int32)(unsafe.Pointer(bp + 704)), 1)) -
		int64(TD)) / 8
	if !(moved != 0) {
		goto __665
	}
	// Change the global data to point to the new stack: move the
	// TEBCdataPtr TD, recompute the position of every other
	// stack-allocated parameter, update the stack pointers.

	TD = TD + uintptr(moved)*8

	*(*uintptr)(unsafe.Pointer(TD + 8)) += uintptr(moved) * 8
	tosPtr += 8 * uintptr(moved)
__665:
	;
__664:
	;

	// Expand the list at stacktop onto the stack; free the list. Knowing
	// that it has a freeIntRepProc we use Tcl_DecrRefCount().

	i = 0
__666:
	if !(i < *(*int32)(unsafe.Pointer(bp + 720))) {
		goto __668
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 712)) + uintptr(i)*8))))).FrefCount++
	goto __667
__667:
	i++
	goto __666
	goto __668
__668:
	;

__669:
	_objPtr8 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr8)).FrefCount, 1) <= 1) {
		goto __672
	}
	XTclFreeObj(tls, _objPtr8)
__672:
	;
	goto __670
__670:
	if 0 != 0 {
		goto __669
	}
	goto __671
__671:
	;
__673:
	;
	if !(0 == 0) {
		goto __676
	}
	if !(0 != 0) {
		goto __678
	}
	if !(0 > 0) {
		goto __679
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __680
__679:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__680:
	;
__678:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __677
__676:
	if !(0 != 0) {
		goto __681
	}
	if !(0 > 0) {
		goto __683
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__683:
	;
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __685
	case 2:
		goto __686
	case 0:
		goto __687
	}
	goto __684
__685:
	goto cleanup1_pushObjResultPtr
__686:
	goto cleanup2_pushObjResultPtr
__687:
	goto __684
__684:
	;
	goto __682
__681:
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __689
	case 2:
		goto __690
	case 0:
		goto __691
	}
	goto __688
__689:
	goto cleanup1
__690:
	goto cleanup2
__691:
	goto __688
__688:
	;
__682:
	;
__677:
	;
	goto __674
__674:
	if 0 != 0 {
		goto __673
	}
	goto __675
__675:
	;

	goto __159

__177:

	*(*uintptr)(unsafe.Pointer(TD + 24 + 40 + 8 /* &.pc */)) = pc
	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = TD + 24
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	newCodePtr = sCompileExprObj(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)))
	checkInterp = 1
	cleanup = 1
	pc++
__692:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
__695:
__698:
	;
__701:
	if !(interp == uintptr(0) || func() bool {
		cachePtr17 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr17)).FnumObjects == 0
	}()) {
		goto __704
	}
	_objPtr9 = XTclThreadAllocObj(tls)
	goto __705
__704:
	_objPtr9 = (*AllocCache)(unsafe.Pointer(cachePtr17)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr17)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr9 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr17)).FnumObjects--
__705:
	;
	goto __702
__702:
	if 0 != 0 {
		goto __701
	}
	goto __703
__703:
	;
	_callbackPtr2 = _objPtr9
	goto __699
__699:
	if 0 != 0 {
		goto __698
	}
	goto __700
__700:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr2)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTEBCresume}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr2 + 8)) = TD
	*(*ClientData)(unsafe.Pointer(_callbackPtr2 + 8 + 1*8)) = pc
	*(*ClientData)(unsafe.Pointer(_callbackPtr2 + 8 + 2*8)) = uintptr(Intptr_t(cleanup))
	*(*ClientData)(unsafe.Pointer(_callbackPtr2 + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr2)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr2
	goto __696
__696:
	if 0 != 0 {
		goto __695
	}
	goto __697
__697:
	;
	goto __693
__693:
	if 0 != 0 {
		goto __692
	}
	goto __694
__694:
	;
	return XTclNRExecuteByteCode(tls, interp, newCodePtr)

	// INVOCATION BLOCK

__178:
instEvalStk:
	*(*uintptr)(unsafe.Pointer(TD + 24 + 40 + 8 /* &.pc */)) = pc
	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = TD + 24

	cleanup = 1
	pc += uintptr(1)
	// yield next instruction
__706:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
__709:
__712:
	;
__715:
	if !(interp == uintptr(0) || func() bool {
		cachePtr18 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr18)).FnumObjects == 0
	}()) {
		goto __718
	}
	_objPtr10 = XTclThreadAllocObj(tls)
	goto __719
__718:
	_objPtr10 = (*AllocCache)(unsafe.Pointer(cachePtr18)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr18)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr10 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr18)).FnumObjects--
__719:
	;
	goto __716
__716:
	if 0 != 0 {
		goto __715
	}
	goto __717
__717:
	;
	_callbackPtr3 = _objPtr10
	goto __713
__713:
	if 0 != 0 {
		goto __712
	}
	goto __714
__714:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr3)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTEBCresume}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr3 + 8)) = TD
	*(*ClientData)(unsafe.Pointer(_callbackPtr3 + 8 + 1*8)) = pc
	*(*ClientData)(unsafe.Pointer(_callbackPtr3 + 8 + 2*8)) = uintptr(Intptr_t(cleanup))
	*(*ClientData)(unsafe.Pointer(_callbackPtr3 + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr3)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr3
	goto __710
__710:
	if 0 != 0 {
		goto __709
	}
	goto __711
__711:
	;
	goto __707
__707:
	if 0 != 0 {
		goto __706
	}
	goto __708
__708:
	;
	// add TEBCResume for object at top of stack
	return XTclNRExecuteByteCode(tls, interp,
		XTclCompileObj(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)), uintptr(0), 0))

__179:
	;
	*(*int32)(unsafe.Pointer(bp + 720 /* objc */)) = int32((int64(tosPtr)-int64(TD+112-uintptr(1)*8+uintptr((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FmaxExceptDepth)*8))/8 - Ptrdiff_t(int32(*(*uintptr)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FauxObjList + 32 + 8)))))
__720:
	tmpPtr = (*TEBCdata)(unsafe.Pointer(TD)).FauxObjList
	(*TEBCdata)(unsafe.Pointer(TD)).FauxObjList = *(*uintptr)(unsafe.Pointer(tmpPtr + 32))
__723:
	_objPtr11 = tmpPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr11)).FrefCount, 1) <= 1) {
		goto __726
	}
	XTclFreeObj(tls, _objPtr11)
__726:
	;
	goto __724
__724:
	if 0 != 0 {
		goto __723
	}
	goto __725
__725:
	;
	goto __721
__721:
	if 0 != 0 {
		goto __720
	}
	goto __722
__722:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 720)) != 0) {
		goto __727
	}
	pcAdjustment = 1
	goto doInvocation
__727:
	;

	// Nothing was expanded, return {}.

__728:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr19 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr19)).FnumObjects == 0
	}()) {
		goto __731
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __732
__731:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr19)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr19)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr19)).FnumObjects--
__732:
	;
	goto __729
__729:
	if 0 != 0 {
		goto __728
	}
	goto __730
__730:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

__733:
	;
	if !(0 == 0) {
		goto __736
	}
	if !(1 != 0) {
		goto __738
	}
	if !(1 > 0) {
		goto __739
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __740
__739:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__740:
	;
__738:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __737
__736:
	if !(1 != 0) {
		goto __741
	}
	if !(1 > 0) {
		goto __743
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__743:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __745
	case 2:
		goto __746
	case 0:
		goto __747
	}
	goto __744
__745:
	goto cleanup1_pushObjResultPtr
__746:
	goto cleanup2_pushObjResultPtr
__747:
	goto __744
__744:
	;
	goto __742
__741:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __749
	case 2:
		goto __750
	case 0:
		goto __751
	}
	goto __748
__749:
	goto cleanup1
__750:
	goto cleanup2
__751:
	goto __748
__748:
	;
__742:
	;
__737:
	;
	goto __734
__734:
	if 0 != 0 {
		goto __733
	}
	goto __735
__735:
	;
	goto __159

__180:
	*(*int32)(unsafe.Pointer(bp + 720 /* objc */)) = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	pcAdjustment = 5
	goto doInvocation

__181:
	*(*int32)(unsafe.Pointer(bp + 720 /* objc */)) = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	pcAdjustment = 2

doInvocation:
	*(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)) = tosPtr - uintptr(*(*int32)(unsafe.Pointer(bp + 720))-1)*8
	cleanup = *(*int32)(unsafe.Pointer(bp + 720 /* objc */))

	// Finally, let TclEvalObjv handle the command.
	//
	// TIP #280: Record the last piece of info needed by
	// 'TclGetSrcInfoForPc', and push the frame.

	*(*uintptr)(unsafe.Pointer(TD + 24 + 40 + 8 /* &.pc */)) = pc
	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = TD + 24

	if !((*Interp)(unsafe.Pointer(interp)).Fflags&INTERP_DEBUG_FRAME != 0) {
		goto __752
	}
	sArgumentBCEnter(tls, interp, (*TEBCdata)(unsafe.Pointer(TD)).FcodePtr, TD, pc, *(*int32)(unsafe.Pointer(bp + 720 /* objc */)), *(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)))
__752:
	;

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr

	pc += uintptr(pcAdjustment)
__753:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
__756:
__759:
	;
__762:
	if !(interp == uintptr(0) || func() bool {
		cachePtr20 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr20)).FnumObjects == 0
	}()) {
		goto __765
	}
	_objPtr12 = XTclThreadAllocObj(tls)
	goto __766
__765:
	_objPtr12 = (*AllocCache)(unsafe.Pointer(cachePtr20)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr20)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr12 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr20)).FnumObjects--
__766:
	;
	goto __763
__763:
	if 0 != 0 {
		goto __762
	}
	goto __764
__764:
	;
	_callbackPtr4 = _objPtr12
	goto __760
__760:
	if 0 != 0 {
		goto __759
	}
	goto __761
__761:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr4)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTEBCresume}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr4 + 8)) = TD
	*(*ClientData)(unsafe.Pointer(_callbackPtr4 + 8 + 1*8)) = pc
	*(*ClientData)(unsafe.Pointer(_callbackPtr4 + 8 + 2*8)) = uintptr(Intptr_t(cleanup))
	*(*ClientData)(unsafe.Pointer(_callbackPtr4 + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr4)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr4
	goto __757
__757:
	if 0 != 0 {
		goto __756
	}
	goto __758
__758:
	;
	goto __754
__754:
	if 0 != 0 {
		goto __753
	}
	goto __755
__755:
	;
	return XTclNREvalObjv(tls, interp, *(*int32)(unsafe.Pointer(bp + 720 /* objc */)), *(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)),
		TCL_EVAL_NOERR|TCL_EVAL_SOURCE_IN_FRAME, uintptr(0))

__182:
	// Call one of the built-in pre-8.5 Tcl math functions. This
	// translates to INST_INVOKE_STK1 with the first argument of
	// ::tcl::mathfunc::$objv[0]. We need to insert the named math
	// function into the stack.

	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	if !(opnd < 0 || opnd > LAST_BUILTIN_FUNC) {
		goto __767
	}

	XTcl_Panic(tls, ts+28301, libc.VaList(bp+152, opnd))
__767:
	;

__768:
	;
__771:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr21 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr21)).FnumObjects == 0
	}()) {
		goto __774
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __775
__774:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr21)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr21)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr21)).FnumObjects--
__775:
	;
	goto __772
__772:
	if 0 != 0 {
		goto __771
	}
	goto __773
__773:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([18]int8{}))-uint64(1)) == 0) {
		goto __776
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	goto __777
__776:
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([18]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, ts+6357, uint64(int32(uint64(unsafe.Sizeof([18]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + 17)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = int32(uint64(unsafe.Sizeof([18]int8{})) - uint64(1))
__777:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)

	goto __769
__769:
	if 0 != 0 {
		goto __768
	}
	goto __770
__770:
	;
	XTcl_AppendToObj(tls, objPtr, tclBuiltinFuncTable[opnd].Fname, -1)

	/*
	 * Only 0, 1 or 2 args.
	 */

	numArgs = tclBuiltinFuncTable[opnd].FnumArgs

	if !(numArgs == 0) {
		goto __778
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), objPtr))).FrefCount++
	goto __779
__778:
	if !(numArgs == 1) {
		goto __780
	}
	tmpPtr1 = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), objPtr))).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), tmpPtr1))).FrefCount++
__782:
	_objPtr13 = tmpPtr1
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr13)).FrefCount, 1) <= 1) {
		goto __785
	}
	XTclFreeObj(tls, _objPtr13)
__785:
	;
	goto __783
__783:
	if 0 != 0 {
		goto __782
	}
	goto __784
__784:
	;
	goto __781
__780:
	tmpPtr2 = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	tmpPtr1 = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), objPtr))).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), tmpPtr1))).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), tmpPtr2))).FrefCount++
__786:
	_objPtr14 = tmpPtr1
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr14)).FrefCount, 1) <= 1) {
		goto __789
	}
	XTclFreeObj(tls, _objPtr14)
__789:
	;
	goto __787
__787:
	if 0 != 0 {
		goto __786
	}
	goto __788
__788:
	;
__790:
	_objPtr15 = tmpPtr2
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr15)).FrefCount, 1) <= 1) {
		goto __793
	}
	XTclFreeObj(tls, _objPtr15)
__793:
	;
	goto __791
__791:
	if 0 != 0 {
		goto __790
	}
	goto __792
__792:
	;
__781:
	;
__779:
	;
	*(*int32)(unsafe.Pointer(bp + 720 /* objc */)) = numArgs + 1

	pcAdjustment = 2
	goto doInvocation

__183:
	// Call a non-builtin Tcl math function previously registered by a
	// call to Tcl_CreateMathFunc pre-8.5. This is essentially
	// INST_INVOKE_STK1 converting the first arg to
	// ::tcl::mathfunc::$objv[0].

	*(*int32)(unsafe.Pointer(bp + 720 /* objc */)) = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))) // Number of arguments. The function
	// name is the 0-th argument.

	objPtr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(*(*int32)(unsafe.Pointer(bp + 720))-1)*8))
__794:
	;
__797:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr22 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr22)).FnumObjects == 0
	}()) {
		goto __800
	}
	tmpPtr = XTclThreadAllocObj(tls)
	goto __801
__800:
	tmpPtr = (*AllocCache)(unsafe.Pointer(cachePtr22)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr22)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr22)).FnumObjects--
__801:
	;
	goto __798
__798:
	if 0 != 0 {
		goto __797
	}
	goto __799
__799:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([18]int8{}))-uint64(1)) == 0) {
		goto __802
	}
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).Flength = 0
	goto __803
__802:
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([18]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(tmpPtr)).Fbytes, ts+6357, uint64(int32(uint64(unsafe.Sizeof([18]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpPtr)).Fbytes + 17)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).Flength = int32(uint64(unsafe.Sizeof([18]int8{})) - uint64(1))
__803:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).FtypePtr = uintptr(0)

	goto __795
__795:
	if 0 != 0 {
		goto __794
	}
	goto __796
__796:
	;
	XTcl_AppendObjToObj(tls, tmpPtr, objPtr)
__804:
	_objPtr16 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr16)).FrefCount, 1) <= 1) {
		goto __807
	}
	XTclFreeObj(tls, _objPtr16)
__807:
	;
	goto __805
__805:
	if 0 != 0 {
		goto __804
	}
	goto __806
__806:
	;

	// Variation of PUSH_OBJECT.

	*(*uintptr)(unsafe.Pointer(tosPtr - uintptr(*(*int32)(unsafe.Pointer(bp + 720))-1)*8)) = tmpPtr
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).FrefCount++

	pcAdjustment = 2
	goto doInvocation

__184:
	*(*int32)(unsafe.Pointer(bp + 720 /* objc */)) = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(5)))))
	objPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	*(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)) = tosPtr - uintptr(*(*int32)(unsafe.Pointer(bp + 720))-1)*8
	cleanup = *(*int32)(unsafe.Pointer(bp + 720 /* objc */))

	*(*uintptr)(unsafe.Pointer(TD + 24 + 40 + 8 /* &.pc */)) = pc
	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = TD + 24
	if !((*Interp)(unsafe.Pointer(interp)).Fflags&INTERP_DEBUG_FRAME != 0) {
		goto __808
	}
	sArgumentBCEnter(tls, interp, (*TEBCdata)(unsafe.Pointer(TD)).FcodePtr, TD, pc, *(*int32)(unsafe.Pointer(bp + 720 /* objc */)), *(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)))
__808:
	;

	XTclInitRewriteEnsemble(tls, interp, opnd, 1, *(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)))

	copyPtr = XTcl_NewListObj(tls, *(*int32)(unsafe.Pointer(bp + 720))-opnd+1, uintptr(0))

	XTcl_ListObjAppendElement(tls, uintptr(0), copyPtr, objPtr)
	XTcl_ListObjReplace(tls, uintptr(0), copyPtr, 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))), 0,
		*(*int32)(unsafe.Pointer(bp + 720))-opnd, *(*uintptr)(unsafe.Pointer(bp + 712))+uintptr(opnd)*8)
__809:
	_objPtr17 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr17)).FrefCount, 1) <= 1) {
		goto __812
	}
	XTclFreeObj(tls, _objPtr17)
__812:
	;
	goto __810
__810:
	if 0 != 0 {
		goto __809
	}
	goto __811
__811:
	;
	objPtr = copyPtr

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	pc += uintptr(6)
__813:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
__816:
__819:
	;
__822:
	if !(interp == uintptr(0) || func() bool {
		cachePtr23 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr23)).FnumObjects == 0
	}()) {
		goto __825
	}
	_objPtr18 = XTclThreadAllocObj(tls)
	goto __826
__825:
	_objPtr18 = (*AllocCache)(unsafe.Pointer(cachePtr23)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr23)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr18 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr23)).FnumObjects--
__826:
	;
	goto __823
__823:
	if 0 != 0 {
		goto __822
	}
	goto __824
__824:
	;
	_callbackPtr5 = _objPtr18
	goto __820
__820:
	if 0 != 0 {
		goto __819
	}
	goto __821
__821:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr5)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTEBCresume}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr5 + 8)) = TD
	*(*ClientData)(unsafe.Pointer(_callbackPtr5 + 8 + 1*8)) = pc
	*(*ClientData)(unsafe.Pointer(_callbackPtr5 + 8 + 2*8)) = uintptr(Intptr_t(cleanup))
	*(*ClientData)(unsafe.Pointer(_callbackPtr5 + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr5)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr5
	goto __817
__817:
	if 0 != 0 {
		goto __816
	}
	goto __818
__818:
	;
	goto __814
__814:
	if 0 != 0 {
		goto __813
	}
	goto __815
__815:
	;

	XTclMarkTailcall(tls, interp)
__827:
__830:
	;
__833:
	if !(interp == uintptr(0) || func() bool {
		cachePtr24 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr24)).FnumObjects == 0
	}()) {
		goto __836
	}
	_objPtr19 = XTclThreadAllocObj(tls)
	goto __837
__836:
	_objPtr19 = (*AllocCache)(unsafe.Pointer(cachePtr24)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr24)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr19 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr24)).FnumObjects--
__837:
	;
	goto __834
__834:
	if 0 != 0 {
		goto __833
	}
	goto __835
__835:
	;
	_callbackPtr6 = _objPtr19
	goto __831
__831:
	if 0 != 0 {
		goto __830
	}
	goto __832
__832:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr6)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{XTclClearRootEnsemble}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr6 + 8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr6 + 8 + 1*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr6 + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr6 + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr6)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr6
	goto __828
__828:
	if 0 != 0 {
		goto __827
	}
	goto __829
__829:
	;
	XTcl_ListObjGetElements(tls, uintptr(0), objPtr, bp+720, bp+712)
__838:
__841:
	;
__844:
	if !(interp == uintptr(0) || func() bool {
		cachePtr25 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr25)).FnumObjects == 0
	}()) {
		goto __847
	}
	_objPtr20 = XTclThreadAllocObj(tls)
	goto __848
__847:
	_objPtr20 = (*AllocCache)(unsafe.Pointer(cachePtr25)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr25)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr20 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr25)).FnumObjects--
__848:
	;
	goto __845
__845:
	if 0 != 0 {
		goto __844
	}
	goto __846
__846:
	;
	_callbackPtr7 = _objPtr20
	goto __842
__842:
	if 0 != 0 {
		goto __841
	}
	goto __843
__843:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr7)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{XTclNRReleaseValues}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr7 + 8)) = objPtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr7 + 8 + 1*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr7 + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr7 + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr7)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr7
	goto __839
__839:
	if 0 != 0 {
		goto __838
	}
	goto __840
__840:
	;
	return XTclNREvalObjv(tls, interp, *(*int32)(unsafe.Pointer(bp + 720 /* objc */)), *(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)), TCL_EVAL_INVOKE, uintptr(0))

	// -----------------------------------------------------------------
	//	   Start of INST_LOAD instructions.
	//
	// WARNING: more 'goto' here than your doctor recommended! The different
	// instructions set the value of some variables and then jump to some
	// common execution code.

__185:
instLoadScalar1:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
__849:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __850
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __849
__850:
	;

	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0) {
		goto __851
	}
	// No errors, no traces: just get the value.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))

__852:
	;
	if !(0 == 0) {
		goto __855
	}
	if !(1 != 0) {
		goto __857
	}
	if !(1 > 0) {
		goto __858
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __859
__858:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__859:
	;
__857:
	;
	pc += uintptr(2)
	goto cleanup0
	goto __856
__855:
	if !(1 != 0) {
		goto __860
	}
	if !(1 > 0) {
		goto __862
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__862:
	;
	pc += uintptr(2)
	switch 0 {
	case 1:
		goto __864
	case 2:
		goto __865
	case 0:
		goto __866
	}
	goto __863
__864:
	goto cleanup1_pushObjResultPtr
__865:
	goto cleanup2_pushObjResultPtr
__866:
	goto __863
__863:
	;
	goto __861
__860:
	pc += uintptr(2)
	switch 0 {
	case 1:
		goto __868
	case 2:
		goto __869
	case 0:
		goto __870
	}
	goto __867
__868:
	goto cleanup1
__869:
	goto cleanup2
__870:
	goto __867
__867:
	;
__861:
	;
__856:
	;
	goto __853
__853:
	if 0 != 0 {
		goto __852
	}
	goto __854
__854:
	;
__851:
	;
	pcAdjustment = 2
	cleanup = 0
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = uintptr(0)
	part1Ptr = libc.AssignUintptr(&part2Ptr, uintptr(0))
	goto doCallPtrGetVar

__186:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
__871:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __872
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __871
__872:
	;

	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0) {
		goto __873
	}
	// No errors, no traces: just get the value.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))

__874:
	;
	if !(0 == 0) {
		goto __877
	}
	if !(1 != 0) {
		goto __879
	}
	if !(1 > 0) {
		goto __880
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __881
__880:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__881:
	;
__879:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __878
__877:
	if !(1 != 0) {
		goto __882
	}
	if !(1 > 0) {
		goto __884
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__884:
	;
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __886
	case 2:
		goto __887
	case 0:
		goto __888
	}
	goto __885
__886:
	goto cleanup1_pushObjResultPtr
__887:
	goto cleanup2_pushObjResultPtr
__888:
	goto __885
__885:
	;
	goto __883
__882:
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __890
	case 2:
		goto __891
	case 0:
		goto __892
	}
	goto __889
__890:
	goto cleanup1
__891:
	goto cleanup2
__892:
	goto __889
__889:
	;
__883:
	;
__878:
	;
	goto __875
__875:
	if 0 != 0 {
		goto __874
	}
	goto __876
__876:
	;
__873:
	;
	pcAdjustment = 5
	cleanup = 0
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = uintptr(0)
	part1Ptr = libc.AssignUintptr(&part2Ptr, uintptr(0))
	goto doCallPtrGetVar

__187:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	pcAdjustment = 5
	goto doLoadArray

__188:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	pcAdjustment = 2

doLoadArray:
	part1Ptr = uintptr(0)
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = compiledLocals + uintptr(opnd)*16
__893:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_LINK != 0) {
		goto __894
	}
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8))
	goto __893
__894:
	;

	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_ARRAY != 0 && !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_TRACED_READ != 0)) {
		goto __895
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = sVarHashCreateVar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8)), part2Ptr, uintptr(0))
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0 && (!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0)) {
		goto __896
	}
	// No errors, no traces: just get the value.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))

__897:
	;
	if !(1 == 0) {
		goto __900
	}
	if !(1 != 0) {
		goto __902
	}
	if !(1 > 0) {
		goto __903
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __904
__903:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__904:
	;
__902:
	;
	pc += uintptr(pcAdjustment)
	goto cleanup0
	goto __901
__900:
	if !(1 != 0) {
		goto __905
	}
	if !(1 > 0) {
		goto __907
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__907:
	;
	pc += uintptr(pcAdjustment)
	switch 1 {
	case 1:
		goto __909
	case 2:
		goto __910
	case 0:
		goto __911
	}
	goto __908
__909:
	goto cleanup1_pushObjResultPtr
__910:
	goto cleanup2_pushObjResultPtr
__911:
	goto __908
__908:
	;
	goto __906
__905:
	pc += uintptr(pcAdjustment)
	switch 1 {
	case 1:
		goto __913
	case 2:
		goto __914
	case 0:
		goto __915
	}
	goto __912
__913:
	goto cleanup1
__914:
	goto cleanup2
__915:
	goto __912
__912:
	;
__906:
	;
__901:
	;
	goto __898
__898:
	if 0 != 0 {
		goto __897
	}
	goto __899
__899:
	;
__896:
	;
__895:
	;
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclLookupArrayElement(tls, interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, ts+5472, 0, 1, *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)), opnd)
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) == uintptr(0)) {
		goto __916
	}

	goto gotError
__916:
	;
	cleanup = 1
	goto doCallPtrGetVar

__189:
	cleanup = 2
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))              // element name
	objPtr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) // array name

	goto doLoadStk

__190:
__191:
	cleanup = 1
	part2Ptr = uintptr(0)
	objPtr = *(*uintptr)(unsafe.Pointer(tosPtr)) // variable name

doLoadStk:
	part1Ptr = objPtr
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclObjLookupVarEx(tls, interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, ts+5472, 0 /*createPart2*/, 1,
		bp+728)
	if !!(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0) {
		goto __917
	}

	goto gotError
__917:
	;

	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0 && (!(*(*uintptr)(unsafe.Pointer(bp + 728)) != 0) || !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_TRACED_READ != 0))) {
		goto __918
	}
	// No errors, no traces: just get the value.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))

__919:
	pc += uintptr(1)
	cleanup = cleanup
	if !(1 != 0) {
		goto __922
	}
	if !(1 > 0) {
		goto __924
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__924:
	;
	goto cleanupV_pushObjResultPtr
	goto __923
__922:
	goto cleanupV
__923:
	;
	goto __920
__920:
	if 0 != 0 {
		goto __919
	}
	goto __921
__921:
	;
__918:
	;
	pcAdjustment = 1
	opnd = -1

doCallPtrGetVar:
	// There are either errors or the variable is traced: call
	// TclPtrGetVar to process fully.

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclPtrGetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)),
		part1Ptr, part2Ptr, TCL_LEAVE_ERR_MSG, opnd)
	checkInterp = 1
	if !!(*(*uintptr)(unsafe.Pointer(bp + 936)) != 0) {
		goto __925
	}

	goto gotError
__925:
	;

__926:
	pc += uintptr(pcAdjustment)
	cleanup = cleanup
	if !(1 != 0) {
		goto __929
	}
	if !(1 > 0) {
		goto __931
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__931:
	;
	goto cleanupV_pushObjResultPtr
	goto __930
__929:
	goto cleanupV
__930:
	;
	goto __927
__927:
	if 0 != 0 {
		goto __926
	}
	goto __928
__928:
	;

	/*
	 *	   End of INST_LOAD instructions.
	 * -----------------------------------------------------------------
	 *	   Start of INST_STORE and related instructions.
	 *
	 * WARNING: more 'goto' here than your doctor recommended! The different
	 * instructions set the value of some variables and then jump to somme
	 * common execution code.
	 */

__192:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	pcAdjustment = 5
	goto doStoreArrayDirect

__193:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	pcAdjustment = 2

doStoreArrayDirect:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = compiledLocals + uintptr(opnd)*16

__932:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_LINK != 0) {
		goto __933
	}
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8))
	goto __932
__933:
	;
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_ARRAY != 0 && !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_TRACED_WRITE != 0)) {
		goto __934
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = sVarHashCreateVar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8)), part2Ptr, uintptr(0))
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0 && !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH) != 0)) {
		goto __935
	}
	tosPtr -= 8
__936:
	_objPtr21 = *(*uintptr)(unsafe.Pointer(tosPtr))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr21)).FrefCount, 1) <= 1) {
		goto __939
	}
	XTclFreeObj(tls, _objPtr21)
__939:
	;
	goto __937
__937:
	if 0 != 0 {
		goto __936
	}
	goto __938
__938:
	;
	*(*uintptr)(unsafe.Pointer(tosPtr)) = *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */))
	goto doStoreVarDirect
__935:
	;
__934:
	;
	cleanup = 2
	storeFlags = TCL_LEAVE_ERR_MSG
	part1Ptr = uintptr(0)
	goto doStoreArrayDirectFailed

__194:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	pcAdjustment = 5
	goto doStoreScalarDirect

__195:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	pcAdjustment = 2

doStoreScalarDirect:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16

__940:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __941
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __940
__941:
	;
	if !!!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH) != 0) {
		goto __942
	}
	storeFlags = TCL_LEAVE_ERR_MSG
	part1Ptr = uintptr(0)
	goto doStoreScalar
__942:
	;

	// No traces, no errors, plain 'set': we can safely inline. The value
	// *will* be set to what's requested, so that the stack top remains
	// pointing to the same Tcl_Obj.

doStoreVarDirect:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	if !(*(*uintptr)(unsafe.Pointer(bp + 944)) != uintptr(0)) {
		goto __943
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount, 1) > 1) {
		goto __944
	}
	goto __945
__944:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __946
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != XtclEmptyStringRep) {
		goto __948
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes)
__948:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength = -1
__949:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr26 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr26)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr26)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __952
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)))
	goto __953
__952:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr26)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr26)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 944))
	(*AllocCache)(unsafe.Pointer(cachePtr26)).FnumObjects++
__953:
	;
	goto __950
__950:
	if 0 != 0 {
		goto __949
	}
	goto __951
__951:
	;
	goto __947
__946:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__947:
	;
__945:
	;

__943:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
	if !(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(pcAdjustment)))) == INST_POP) {
		goto __954
	}
	tosPtr -= 8
__955:
	;
	if !(0 == 0) {
		goto __958
	}
	if !(0 != 0) {
		goto __960
	}
	if !(0 > 0) {
		goto __961
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __962
__961:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__962:
	;
__960:
	;
	pc += uintptr(pcAdjustment + 1)
	goto cleanup0
	goto __959
__958:
	if !(0 != 0) {
		goto __963
	}
	if !(0 > 0) {
		goto __965
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__965:
	;
	pc += uintptr(pcAdjustment + 1)
	switch 0 {
	case 1:
		goto __967
	case 2:
		goto __968
	case 0:
		goto __969
	}
	goto __966
__967:
	goto cleanup1_pushObjResultPtr
__968:
	goto cleanup2_pushObjResultPtr
__969:
	goto __966
__966:
	;
	goto __964
__963:
	pc += uintptr(pcAdjustment + 1)
	switch 0 {
	case 1:
		goto __971
	case 2:
		goto __972
	case 0:
		goto __973
	}
	goto __970
__971:
	goto cleanup1
__972:
	goto cleanup2
__973:
	goto __970
__970:
	;
__964:
	;
__959:
	;
	goto __956
__956:
	if 0 != 0 {
		goto __955
	}
	goto __957
__957:
	;
__954:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__974:
	;
	if !(0 == 0) {
		goto __977
	}
	if !(0 != 0) {
		goto __979
	}
	if !(0 > 0) {
		goto __980
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __981
__980:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__981:
	;
__979:
	;
	pc += uintptr(pcAdjustment)
	goto cleanup0
	goto __978
__977:
	if !(0 != 0) {
		goto __982
	}
	if !(0 > 0) {
		goto __984
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__984:
	;
	pc += uintptr(pcAdjustment)
	switch 0 {
	case 1:
		goto __986
	case 2:
		goto __987
	case 0:
		goto __988
	}
	goto __985
__986:
	goto cleanup1_pushObjResultPtr
__987:
	goto cleanup2_pushObjResultPtr
__988:
	goto __985
__985:
	;
	goto __983
__982:
	pc += uintptr(pcAdjustment)
	switch 0 {
	case 1:
		goto __990
	case 2:
		goto __991
	case 0:
		goto __992
	}
	goto __989
__990:
	goto cleanup1
__991:
	goto cleanup2
__992:
	goto __989
__989:
	;
__983:
	;
__978:
	;
	goto __975
__975:
	if 0 != 0 {
		goto __974
	}
	goto __976
__976:
	;

__196:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr)) // value to append
	part2Ptr = uintptr(0)
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE |
		TCL_LIST_ELEMENT
	goto doStoreStk

__197:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr)) // value to append
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE |
		TCL_LIST_ELEMENT
	goto doStoreStk

__198:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr)) // value to append
	part2Ptr = uintptr(0)
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
	goto doStoreStk

__199:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr)) // value to append
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
	goto doStoreStk

__200:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	storeFlags = TCL_LEAVE_ERR_MSG
	goto doStoreStk

__201:
__202:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	part2Ptr = uintptr(0)
	storeFlags = TCL_LEAVE_ERR_MSG

doStoreStk:
	objPtr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1+libc.Bool32(part2Ptr != uintptr(0)))*8)) // variable name
	part1Ptr = objPtr
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclObjLookupVarEx(tls, interp, objPtr, part2Ptr, TCL_LEAVE_ERR_MSG,
		ts+5303, 1 /*createPart2*/, 1, bp+728)
	if !!(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0) {
		goto __993
	}

	goto gotError
__993:
	;
	cleanup = func() int32 {
		if part2Ptr == uintptr(0) {
			return 2
		}
		return 3
	}()
	pcAdjustment = 1
	opnd = -1
	goto doCallPtrSetVar

__203:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	pcAdjustment = 5
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE |
		TCL_LIST_ELEMENT
	goto doStoreArray

__204:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	pcAdjustment = 2
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE |
		TCL_LIST_ELEMENT
	goto doStoreArray

__205:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	pcAdjustment = 5
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
	goto doStoreArray

__206:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	pcAdjustment = 2
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
	goto doStoreArray

doStoreArray:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = compiledLocals + uintptr(opnd)*16

__994:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_LINK != 0) {
		goto __995
	}
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8))
	goto __994
__995:
	;
	cleanup = 2
	part1Ptr = uintptr(0)

doStoreArrayDirectFailed:
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclLookupArrayElement(tls, interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, ts+5303, 1, 1, *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)), opnd)
	if !!(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0) {
		goto __996
	}

	goto gotError
__996:
	;
	goto doCallPtrSetVar

__207:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	pcAdjustment = 5
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE |
		TCL_LIST_ELEMENT
	goto doStoreScalar

__208:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	pcAdjustment = 2
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE |
		TCL_LIST_ELEMENT
	goto doStoreScalar

__209:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	pcAdjustment = 5
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
	goto doStoreScalar

__210:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	pcAdjustment = 2
	storeFlags = TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
	goto doStoreScalar

doStoreScalar:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16

__997:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __998
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __997
__998:
	;
	cleanup = 1
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = uintptr(0)
	part1Ptr = libc.AssignUintptr(&part2Ptr, uintptr(0))

doCallPtrSetVar:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclPtrSetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)),
		part1Ptr, part2Ptr, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), storeFlags, opnd)
	checkInterp = 1
	if !!(*(*uintptr)(unsafe.Pointer(bp + 936)) != 0) {
		goto __999
	}

	goto gotError
__999:
	;
	if !(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(pcAdjustment)))) == INST_POP) {
		goto __1000
	}
__1001:
	pc += uintptr(pcAdjustment + 1)
	cleanup = cleanup
	if !(0 != 0) {
		goto __1004
	}
	if !(0 > 0) {
		goto __1006
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1006:
	;
	goto cleanupV_pushObjResultPtr
	goto __1005
__1004:
	goto cleanupV
__1005:
	;
	goto __1002
__1002:
	if 0 != 0 {
		goto __1001
	}
	goto __1003
__1003:
	;
__1000:
	;

__1007:
	pc += uintptr(pcAdjustment)
	cleanup = cleanup
	if !(1 != 0) {
		goto __1010
	}
	if !(1 > 0) {
		goto __1012
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1012:
	;
	goto cleanupV_pushObjResultPtr
	goto __1011
__1010:
	goto cleanupV
__1011:
	;
	goto __1008
__1008:
	if 0 != 0 {
		goto __1007
	}
	goto __1009
__1009:
	;

__211:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
	cleanup = 1
	pcAdjustment = 5
__1013:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __1014
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __1013
__1014:
	;

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 712)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 720)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+720, bp+712)
	}() !=
		TCL_OK) {
		goto __1015
	}

	goto gotError
__1015:
	;
	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0 &&
		!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH) != 0)) {
		goto __1016
	}
	goto lappendListDirect
__1016:
	;
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = uintptr(0)
	part1Ptr = libc.AssignUintptr(&part2Ptr, uintptr(0))
	goto lappendListPtr

__212:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	part1Ptr = uintptr(0)
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = compiledLocals + uintptr(opnd)*16
	cleanup = 2
	pcAdjustment = 5
__1017:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_LINK != 0) {
		goto __1018
	}
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8))
	goto __1017
__1018:
	;

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 712)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 720)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+720, bp+712)
	}() !=
		TCL_OK) {
		goto __1019
	}

	goto gotError
__1019:
	;
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_ARRAY != 0 && !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_TRACED_READ != 0) &&
		!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_TRACED_WRITE != 0)) {
		goto __1020
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = sVarHashCreateVar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8)), part2Ptr, uintptr(0))
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0 && (!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0) &&
		!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH) != 0)) {
		goto __1021
	}
	goto lappendListDirect
__1021:
	;
__1020:
	;
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclLookupArrayElement(tls, interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, ts+5303, 1, 1, *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)), opnd)
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) == uintptr(0)) {
		goto __1022
	}

	goto gotError
__1022:
	;
	goto lappendListPtr

__213:
	pcAdjustment = 1
	cleanup = 3
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) // element name
	part1Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(2)*8)) // array name

	goto lappendList

__214:
	pcAdjustment = 1
	cleanup = 2
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	part2Ptr = uintptr(0)
	part1Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) // variable name

	goto lappendList

lappendListDirect:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 736)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 936)), bp+736)
	}() != TCL_OK) {
		goto __1023
	}

	goto gotError
__1023:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount > 1) {
		goto __1024
	}
	newValue = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount, 1) > 1) {
		goto __1025
	}
	goto __1026
__1025:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __1027
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes != XtclEmptyStringRep) {
		goto __1029
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes)
__1029:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = -1
__1030:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr27 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr27)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr27)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __1033
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936)))
	goto __1034
__1033:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr27)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr27)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 936))
	(*AllocCache)(unsafe.Pointer(cachePtr27)).FnumObjects++
__1034:
	;
	goto __1031
__1031:
	if 0 != 0 {
		goto __1030
	}
	goto __1032
__1032:
	;
	goto __1028
__1027:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))
__1028:
	;
__1026:
	;

	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = libc.AssignPtrUintptr(bp+936 /* objResultPtr */, newValue)
	(*Tcl_Obj)(unsafe.Pointer(newValue)).FrefCount++
__1024:
	;
	if !(XTcl_ListObjReplace(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 936)), *(*int32)(unsafe.Pointer(bp + 736)), 0, *(*int32)(unsafe.Pointer(bp + 720)), *(*uintptr)(unsafe.Pointer(bp + 712))) !=
		TCL_OK) {
		goto __1035
	}

	goto gotError
__1035:
	;

__1036:
	pc += uintptr(pcAdjustment)
	cleanup = cleanup
	if !(1 != 0) {
		goto __1039
	}
	if !(1 > 0) {
		goto __1041
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1041:
	;
	goto cleanupV_pushObjResultPtr
	goto __1040
__1039:
	goto cleanupV
__1040:
	;
	goto __1037
__1037:
	if 0 != 0 {
		goto __1036
	}
	goto __1038
__1038:
	;

lappendList:
	opnd = -1
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 712)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 720)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+720, bp+712)
	}() !=
		TCL_OK) {
		goto __1042
	}

	goto gotError
__1042:
	;
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclObjLookupVarEx(tls, interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, ts+5303, 1, 1, bp+728)
	checkInterp = 1
	if !!(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0) {
		goto __1043
	}

	goto gotError
__1043:
	;

lappendListPtr:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __1044
	}
	(*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).FrefCount++
__1044:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 728)) != 0 && (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __1045
	}
	(*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).FrefCount++
__1045:
	;
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclPtrGetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)),
		part1Ptr, part2Ptr, TCL_LEAVE_ERR_MSG, opnd)
	checkInterp = 1
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __1046
	}
	(*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).FrefCount--
__1046:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 728)) != 0 && (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __1047
	}
	(*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).FrefCount--
__1047:
	;

	createdNewObj = 0

	if !!(*(*uintptr)(unsafe.Pointer(bp + 936)) != 0) {
		goto __1048
	}
	valueToAssign = *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */))
	goto __1049
__1048:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 736)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 936)), bp+736)
	}() != TCL_OK) {
		goto __1050
	}

	goto gotError
	goto __1051
__1050:
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount > 1) {
		goto __1052
	}
	valueToAssign = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))
	createdNewObj = 1
	goto __1053
__1052:
	valueToAssign = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1053:
	;
	if !(XTcl_ListObjReplace(tls, interp, valueToAssign, *(*int32)(unsafe.Pointer(bp + 736)), 0,
		*(*int32)(unsafe.Pointer(bp + 720)), *(*uintptr)(unsafe.Pointer(bp + 712))) != TCL_OK) {
		goto __1054
	}
	if !(createdNewObj != 0) {
		goto __1055
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(valueToAssign)).FrefCount, 1) > 1) {
		goto __1056
	}
	goto __1057
__1056:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(valueToAssign)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valueToAssign)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __1058
	}

	if !((*Tcl_Obj)(unsafe.Pointer(valueToAssign)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(valueToAssign)).Fbytes != XtclEmptyStringRep) {
		goto __1060
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(valueToAssign)).Fbytes)
__1060:
	;
	(*Tcl_Obj)(unsafe.Pointer(valueToAssign)).Flength = -1
__1061:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr28 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr28)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr28)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __1064
	}
	XTclThreadFreeObj(tls, valueToAssign)
	goto __1065
__1064:
	*(*uintptr)(unsafe.Pointer(valueToAssign + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr28)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr28)).FfirstObjPtr = valueToAssign
	(*AllocCache)(unsafe.Pointer(cachePtr28)).FnumObjects++
__1065:
	;
	goto __1062
__1062:
	if 0 != 0 {
		goto __1061
	}
	goto __1063
__1063:
	;
	goto __1059
__1058:
	XTclFreeObj(tls, valueToAssign)
__1059:
	;
__1057:
	;

__1055:
	;
	goto errorInLappendListPtr
__1054:
	;
__1051:
	;
__1049:
	;
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	(*Tcl_Obj)(unsafe.Pointer(valueToAssign)).FrefCount++
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclPtrSetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)), part1Ptr,
		part2Ptr, valueToAssign, TCL_LEAVE_ERR_MSG, opnd)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(valueToAssign)).FrefCount, 1) > 1) {
		goto __1066
	}
	goto __1067
__1066:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(valueToAssign)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(valueToAssign)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __1068
	}

	if !((*Tcl_Obj)(unsafe.Pointer(valueToAssign)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(valueToAssign)).Fbytes != XtclEmptyStringRep) {
		goto __1070
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(valueToAssign)).Fbytes)
__1070:
	;
	(*Tcl_Obj)(unsafe.Pointer(valueToAssign)).Flength = -1
__1071:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr29 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr29)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr29)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __1074
	}
	XTclThreadFreeObj(tls, valueToAssign)
	goto __1075
__1074:
	*(*uintptr)(unsafe.Pointer(valueToAssign + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr29)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr29)).FfirstObjPtr = valueToAssign
	(*AllocCache)(unsafe.Pointer(cachePtr29)).FnumObjects++
__1075:
	;
	goto __1072
__1072:
	if 0 != 0 {
		goto __1071
	}
	goto __1073
__1073:
	;
	goto __1069
__1068:
	XTclFreeObj(tls, valueToAssign)
__1069:
	;
__1067:
	;

	checkInterp = 1
	if !!(*(*uintptr)(unsafe.Pointer(bp + 936)) != 0) {
		goto __1076
	}
errorInLappendListPtr:
	;
	goto gotError
__1076:
	;

__1077:
	pc += uintptr(pcAdjustment)
	cleanup = cleanup
	if !(1 != 0) {
		goto __1080
	}
	if !(1 > 0) {
		goto __1082
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1082:
	;
	goto cleanupV_pushObjResultPtr
	goto __1081
__1080:
	goto cleanupV
__1081:
	;
	goto __1078
__1078:
	if 0 != 0 {
		goto __1077
	}
	goto __1079
__1079:
	;

	/*
	 *	   End of INST_STORE and related instructions.
	 * -----------------------------------------------------------------
	 *	   Start of INST_INCR instructions.
	 *
	 * WARNING: more 'goto' here than your doctor recommended! The different
	 * instructions set the value of some variables and then jump to somme
	 * common execution code.
	 */

	/*TODO: Consider more untangling here; merge with LOAD and STORE ? */

__215:
__216:
__217:
__218:
__219:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	incrPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_INCR_SCALAR1:
		goto __1084
	case INST_INCR_ARRAY1:
		goto __1085
	default:
		goto __1086
	}
	goto __1083
__1084:
	pcAdjustment = 2
	goto doIncrScalar
__1085:
	pcAdjustment = 2
	goto doIncrArray
__1086:
	pcAdjustment = 1
	goto doIncrStk
__1083:
	;

__220:
__221:
__222:
	increment = int64(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
__1087:
	;
__1090:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr30 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr30)).FnumObjects == 0
	}()) {
		goto __1093
	}
	incrPtr = XTclThreadAllocObj(tls)
	goto __1094
__1093:
	incrPtr = (*AllocCache)(unsafe.Pointer(cachePtr30)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr30)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(incrPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr30)).FnumObjects--
__1094:
	;
	goto __1091
__1091:
	if 0 != 0 {
		goto __1090
	}
	goto __1092
__1092:
	;
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(incrPtr + 32)) = increment
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __1088
__1088:
	if 0 != 0 {
		goto __1087
	}
	goto __1089
__1089:
	;
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount++
	pcAdjustment = 2

doIncrStk:
	if !(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_INCR_ARRAY_STK_IMM ||
		int32(*(*uint8)(unsafe.Pointer(pc))) == INST_INCR_ARRAY_STK) {
		goto __1095
	}
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	objPtr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))

	goto __1096
__1095:
	part2Ptr = uintptr(0)
	objPtr = *(*uintptr)(unsafe.Pointer(tosPtr))

__1096:
	;
	part1Ptr = objPtr
	opnd = -1
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclObjLookupVarEx(tls, interp, objPtr, part2Ptr,
		TCL_LEAVE_ERR_MSG, ts+5472, 1, 1, bp+728)
	if !!(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0) {
		goto __1097
	}
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_AddErrorInfo(tls, interp,
		ts+28361)
	checkInterp = 1

__1098:
	_objPtr22 = incrPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr22)).FrefCount, 1) <= 1) {
		goto __1101
	}
	XTclFreeObj(tls, _objPtr22)
__1101:
	;
	goto __1099
__1099:
	if 0 != 0 {
		goto __1098
	}
	goto __1100
__1100:
	;
	goto gotError
__1097:
	;
	cleanup = func() int32 {
		if part2Ptr == uintptr(0) {
			return 1
		}
		return 2
	}()
	goto doIncrVar

__223:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	increment = int64(int32(*(*int8)(unsafe.Pointer(pc + uintptr(2)))))
__1102:
	;
__1105:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr31 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr31)).FnumObjects == 0
	}()) {
		goto __1108
	}
	incrPtr = XTclThreadAllocObj(tls)
	goto __1109
__1108:
	incrPtr = (*AllocCache)(unsafe.Pointer(cachePtr31)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr31)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(incrPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr31)).FnumObjects--
__1109:
	;
	goto __1106
__1106:
	if 0 != 0 {
		goto __1105
	}
	goto __1107
__1107:
	;
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(incrPtr + 32)) = increment
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __1103
__1103:
	if 0 != 0 {
		goto __1102
	}
	goto __1104
__1104:
	;
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount++
	pcAdjustment = 3

doIncrArray:
	part1Ptr = uintptr(0)
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = compiledLocals + uintptr(opnd)*16
	cleanup = 1
__1110:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_LINK != 0) {
		goto __1111
	}
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8))
	goto __1110
__1111:
	;

	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclLookupArrayElement(tls, interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, ts+5472, 1, 1, *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)), opnd)
	if !!(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0) {
		goto __1112
	}

__1113:
	_objPtr23 = incrPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr23)).FrefCount, 1) <= 1) {
		goto __1116
	}
	XTclFreeObj(tls, _objPtr23)
__1116:
	;
	goto __1114
__1114:
	if 0 != 0 {
		goto __1113
	}
	goto __1115
__1115:
	;
	goto gotError
__1112:
	;
	goto doIncrVar

__224:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	increment = int64(int32(*(*int8)(unsafe.Pointer(pc + uintptr(2)))))
	pcAdjustment = 3
	cleanup = 0
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
__1117:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __1118
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __1117
__1118:
	;

	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ|VAR_TRACED_WRITE) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0) {
		goto __1119
	}

	objPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 740)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 744)) = objPtr + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(objPtr + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 740)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 740)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 744)) = objPtr + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 740)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), objPtr, bp+744, bp+740)
			}()
		}()
	}() == TCL_OK) {
		goto __1120
	}
	if !(*(*int32)(unsafe.Pointer(bp + 740)) == TCL_NUMBER_LONG) {
		goto __1121
	}
	augend = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 744))))
	sum = augend + increment

	// Overflow when (augend and sum have different sign) and
	// (augend and increment have the same sign). This is
	// encapsulated in the Overflowing macro.

	if !!(augend^sum < int64(0) && augend^increment >= int64(0)) {
		goto __1122
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1) {
		goto __1123
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount-- // We know it's shared.
__1125:
	;
__1128:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr32 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr32)).FnumObjects == 0
	}()) {
		goto __1131
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __1132
__1131:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr32)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr32)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr32)).FnumObjects--
__1132:
	;
	goto __1129
__1129:
	if 0 != 0 {
		goto __1128
	}
	goto __1130
__1130:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = sum
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __1126
__1126:
	if 0 != 0 {
		goto __1125
	}
	goto __1127
__1127:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
	goto __1124
__1123:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = objPtr
__1133:
__1136:
	_isobjPtr = objPtr
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0)) {
		goto __1139
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep) {
		goto __1140
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
__1140:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
__1139:
	;
	goto __1137
__1137:
	if 0 != 0 {
		goto __1136
	}
	goto __1138
__1138:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __1141
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __1142
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__1142:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__1141:
	;
	*(*int64)(unsafe.Pointer(objPtr + 32)) = sum
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	goto __1134
__1134:
	if 0 != 0 {
		goto __1133
	}
	goto __1135
__1135:
	;
__1124:
	;
	goto doneIncr
__1122:
	;
__1121:
	; // end if (type == TCL_NUMBER_LONG)
__1120:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1) {
		goto __1143
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount-- // We know it's shared
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_DuplicateObj(tls, objPtr)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
	goto __1144
__1143:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = objPtr
__1144:
	;
__1145:
	;
__1148:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr33 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr33)).FnumObjects == 0
	}()) {
		goto __1151
	}
	incrPtr = XTclThreadAllocObj(tls)
	goto __1152
__1151:
	incrPtr = (*AllocCache)(unsafe.Pointer(cachePtr33)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr33)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(incrPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr33)).FnumObjects--
__1152:
	;
	goto __1149
__1149:
	if 0 != 0 {
		goto __1148
	}
	goto __1150
__1150:
	;
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(incrPtr + 32)) = increment
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __1146
__1146:
	if 0 != 0 {
		goto __1145
	}
	goto __1147
__1147:
	;
	if !(XTclIncrObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 936)), incrPtr) != TCL_OK) {
		goto __1153
	}
__1154:
	_objPtr24 = incrPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr24)).FrefCount, 1) <= 1) {
		goto __1157
	}
	XTclFreeObj(tls, _objPtr24)
__1157:
	;
	goto __1155
__1155:
	if 0 != 0 {
		goto __1154
	}
	goto __1156
__1156:
	;

	goto gotError
__1153:
	;
__1158:
	_objPtr25 = incrPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr25)).FrefCount, 1) <= 1) {
		goto __1161
	}
	XTclFreeObj(tls, _objPtr25)
__1161:
	;
	goto __1159
__1159:
	if 0 != 0 {
		goto __1158
	}
	goto __1160
__1160:
	;
	goto doneIncr
__1119:
	;

	// All other cases, flow through to generic handling.

__1162:
	;
__1165:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr34 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr34)).FnumObjects == 0
	}()) {
		goto __1168
	}
	incrPtr = XTclThreadAllocObj(tls)
	goto __1169
__1168:
	incrPtr = (*AllocCache)(unsafe.Pointer(cachePtr34)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr34)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(incrPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr34)).FnumObjects--
__1169:
	;
	goto __1166
__1166:
	if 0 != 0 {
		goto __1165
	}
	goto __1167
__1167:
	;
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(incrPtr + 32)) = increment
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __1163
__1163:
	if 0 != 0 {
		goto __1162
	}
	goto __1164
__1164:
	;
	(*Tcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount++

doIncrScalar:
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
__1170:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __1171
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __1170
__1171:
	;
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = uintptr(0)
	part1Ptr = libc.AssignUintptr(&part2Ptr, uintptr(0))
	cleanup = 0

doIncrVar:
	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ|VAR_TRACED_WRITE) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0 && (!(*(*uintptr)(unsafe.Pointer(bp + 728)) != 0) || !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE) != 0))) {
		goto __1172
	}
	objPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1) {
		goto __1174
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount-- // We know it's shared
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_DuplicateObj(tls, objPtr)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
	goto __1175
__1174:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = objPtr
__1175:
	;
	if !(XTclIncrObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 936)), incrPtr) != TCL_OK) {
		goto __1176
	}
__1177:
	_objPtr26 = incrPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr26)).FrefCount, 1) <= 1) {
		goto __1180
	}
	XTclFreeObj(tls, _objPtr26)
__1180:
	;
	goto __1178
__1178:
	if 0 != 0 {
		goto __1177
	}
	goto __1179
__1179:
	;

	goto gotError
__1176:
	;
__1181:
	_objPtr27 = incrPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr27)).FrefCount, 1) <= 1) {
		goto __1184
	}
	XTclFreeObj(tls, _objPtr27)
__1184:
	;
	goto __1182
__1182:
	if 0 != 0 {
		goto __1181
	}
	goto __1183
__1183:
	;
	goto __1173
__1172:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclPtrIncrObjVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)),
		part1Ptr, part2Ptr, incrPtr, TCL_LEAVE_ERR_MSG, opnd)
	checkInterp = 1
__1185:
	_objPtr28 = incrPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr28)).FrefCount, 1) <= 1) {
		goto __1188
	}
	XTclFreeObj(tls, _objPtr28)
__1188:
	;
	goto __1186
__1186:
	if 0 != 0 {
		goto __1185
	}
	goto __1187
__1187:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == uintptr(0)) {
		goto __1189
	}

	goto gotError
__1189:
	;
__1173:
	;
doneIncr:
	;
	if !(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(pcAdjustment)))) == INST_POP) {
		goto __1190
	}
__1191:
	pc += uintptr(pcAdjustment + 1)
	cleanup = cleanup
	if !(0 != 0) {
		goto __1194
	}
	if !(0 > 0) {
		goto __1196
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1196:
	;
	goto cleanupV_pushObjResultPtr
	goto __1195
__1194:
	goto cleanupV
__1195:
	;
	goto __1192
__1192:
	if 0 != 0 {
		goto __1191
	}
	goto __1193
__1193:
	;
__1190:
	;
__1197:
	pc += uintptr(pcAdjustment)
	cleanup = cleanup
	if !(1 != 0) {
		goto __1200
	}
	if !(1 > 0) {
		goto __1202
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1202:
	;
	goto cleanupV_pushObjResultPtr
	goto __1201
__1200:
	goto cleanupV
__1201:
	;
	goto __1198
__1198:
	if 0 != 0 {
		goto __1197
	}
	goto __1199
__1199:
	;

	//	   End of INST_INCR instructions.
	// -----------------------------------------------------------------
	//	   Start of INST_EXIST instructions.

__225:
	cleanup = 0
	pcAdjustment = 5
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
__1203:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __1204
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __1203
__1204:
	;

	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_TRACED_READ != 0) {
		goto __1205
	}
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTclObjCallVarTraces(tls, interp, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0), uintptr(0),
		TCL_TRACE_READS, 0, opnd)
	checkInterp = 1
	if !(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) == uintptr(0)) {
		goto __1206
	}
	XTclCleanupVar(tls, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = uintptr(0)
__1206:
	;
__1205:
	;
	goto afterExistsPeephole

__226:
	cleanup = 1
	pcAdjustment = 5
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = compiledLocals + uintptr(opnd)*16
__1207:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_LINK != 0) {
		goto __1208
	}
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8))
	goto __1207
__1208:
	;

	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_ARRAY != 0 && !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_TRACED_READ != 0)) {
		goto __1209
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = sVarHashCreateVar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8)), part2Ptr, uintptr(0))
	if !(!(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0) || !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_TRACED_READ != 0)) {
		goto __1210
	}
	goto afterExistsPeephole
__1210:
	;
__1209:
	;
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclLookupArrayElement(tls, interp, uintptr(0), part2Ptr, 0, ts+28407,
		0, 1, *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)), opnd)
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0) {
		goto __1211
	}
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_TRACED_READ != 0 || *(*uintptr)(unsafe.Pointer(bp + 728)) != 0 && (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_TRACED_READ != 0) {
		goto __1212
	}
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTclObjCallVarTraces(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)), *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0), part2Ptr,
		TCL_TRACE_READS, 0, opnd)
	checkInterp = 1
__1212:
	;
	if !(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) == uintptr(0)) {
		goto __1213
	}
	XTclCleanupVar(tls, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = uintptr(0)
__1213:
	;
__1211:
	;
	goto afterExistsPeephole

__227:
	cleanup = 2
	pcAdjustment = 1
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))                // element name
	part1Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) // array name

	goto doExistStk

__228:
	cleanup = 1
	pcAdjustment = 1
	part2Ptr = uintptr(0)
	part1Ptr = *(*uintptr)(unsafe.Pointer(tosPtr)) // variable name

doExistStk:
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclObjLookupVarEx(tls, interp, part1Ptr, part2Ptr, 0, ts+28407,
		/*createPart1*/ 0 /*createPart2*/, 1, bp+728)
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0) {
		goto __1214
	}
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_TRACED_READ != 0 || *(*uintptr)(unsafe.Pointer(bp + 728)) != 0 && (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_TRACED_READ != 0) {
		goto __1215
	}
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTclObjCallVarTraces(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)), *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), part1Ptr, part2Ptr,
		TCL_TRACE_READS, 0, -1)
	checkInterp = 1
__1215:
	;
	if !(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) == uintptr(0)) {
		goto __1216
	}
	XTclCleanupVar(tls, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = uintptr(0)
__1216:
	;
__1214:
	;

	// Peep-hole optimisation: if you're about to jump, do jump from here.

afterExistsPeephole:
	found = libc.Bool32(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0 && !(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) == uintptr(0)))

__1217:
	pc += uintptr(pcAdjustment)
	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_JUMP_FALSE1:
		goto __1221
	case INST_JUMP_TRUE1:
		goto __1222
	case INST_JUMP_FALSE4:
		goto __1223
	case INST_JUMP_TRUE4:
		goto __1224
	default:
		goto __1225
	}
	goto __1220
__1221:
	;
__1226:
	pc += func() uintptr {
		if found != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	cleanup = cleanup
	if !(0 != 0) {
		goto __1229
	}
	if !(0 > 0) {
		goto __1231
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1231:
	;
	goto cleanupV_pushObjResultPtr
	goto __1230
__1229:
	goto cleanupV
__1230:
	;
	goto __1227
__1227:
	if 0 != 0 {
		goto __1226
	}
	goto __1228
__1228:
	;
	goto __1220
__1222:
	;
__1232:
	pc += func() uintptr {
		if found != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	cleanup = cleanup
	if !(0 != 0) {
		goto __1235
	}
	if !(0 > 0) {
		goto __1237
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1237:
	;
	goto cleanupV_pushObjResultPtr
	goto __1236
__1235:
	goto cleanupV
__1236:
	;
	goto __1233
__1233:
	if 0 != 0 {
		goto __1232
	}
	goto __1234
__1234:
	;
	goto __1220
__1223:
	;
__1238:
	pc += func() uintptr {
		if found != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	cleanup = cleanup
	if !(0 != 0) {
		goto __1241
	}
	if !(0 > 0) {
		goto __1243
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1243:
	;
	goto cleanupV_pushObjResultPtr
	goto __1242
__1241:
	goto cleanupV
__1242:
	;
	goto __1239
__1239:
	if 0 != 0 {
		goto __1238
	}
	goto __1240
__1240:
	;
	goto __1220
__1224:
	;
__1244:
	pc += func() uintptr {
		if found != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	cleanup = cleanup
	if !(0 != 0) {
		goto __1247
	}
	if !(0 > 0) {
		goto __1249
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1249:
	;
	goto cleanupV_pushObjResultPtr
	goto __1248
__1247:
	goto cleanupV
__1248:
	;
	goto __1245
__1245:
	if 0 != 0 {
		goto __1244
	}
	goto __1246
__1246:
	;
	goto __1220
__1225:
	if !(found < 0) {
		goto __1250
	}
__1252:
	;
__1255:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr35 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr35)).FnumObjects == 0
	}()) {
		goto __1258
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __1259
__1258:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr35)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr35)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr35)).FnumObjects--
__1259:
	;
	goto __1256
__1256:
	if 0 != 0 {
		goto __1255
	}
	goto __1257
__1257:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __1253
__1253:
	if 0 != 0 {
		goto __1252
	}
	goto __1254
__1254:
	;
	goto __1251
__1250:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(libc.Bool32(found > 0))*8))
__1251:
	;
__1260:
	pc += uintptr(0)
	cleanup = cleanup
	if !(1 != 0) {
		goto __1263
	}
	if !(1 > 0) {
		goto __1265
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1265:
	;
	goto cleanupV_pushObjResultPtr
	goto __1264
__1263:
	goto cleanupV
__1264:
	;
	goto __1261
__1261:
	if 0 != 0 {
		goto __1260
	}
	goto __1262
__1262:
	;
	goto __1220
__1220:
	;
	goto __1218
__1218:
	if 0 != 0 {
		goto __1217
	}
	goto __1219
__1219:
	;

	/*
	 *	   End of INST_EXIST instructions.
	 * -----------------------------------------------------------------
	 *	   Start of INST_UNSET instructions.
	 */

__229:
	if uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))) != 0 {
		flags = TCL_LEAVE_ERR_MSG
	} else {
		flags = 0
	}
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(2))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(2) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(2) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(2) + uintptr(3)))))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
__1266:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __1267
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __1266
__1267:
	;

	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_UNSET|VAR_DEAD_HASH) != 0) && !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_IN_HASHTABLE != 0)) {
		goto __1268
	}
	// No errors, no traces, no searches: just make the variable cease
	// to exist.

	if !!(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) == uintptr(0)) {
		goto __1269
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FrefCount, 1) > 1) {
		goto __1271
	}
	goto __1272
__1271:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __1273
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes != XtclEmptyStringRep) {
		goto __1275
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes)
__1275:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Flength = -1
__1276:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr36 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr36)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr36)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __1279
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))
	goto __1280
__1279:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr36)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr36)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	(*AllocCache)(unsafe.Pointer(cachePtr36)).FnumObjects++
__1280:
	;
	goto __1277
__1277:
	if 0 != 0 {
		goto __1276
	}
	goto __1278
__1278:
	;
	goto __1274
__1273:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))
__1274:
	;
__1272:
	;

	goto __1270
__1269:
	if !(flags&TCL_LEAVE_ERR_MSG != 0) {
		goto __1281
	}
	goto slowUnsetScalar
__1281:
	;
__1270:
	;
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = uintptr(0)

__1282:
	;
	if !(0 == 0) {
		goto __1285
	}
	if !(0 != 0) {
		goto __1287
	}
	if !(0 > 0) {
		goto __1288
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1289
__1288:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1289:
	;
__1287:
	;
	pc += uintptr(6)
	goto cleanup0
	goto __1286
__1285:
	if !(0 != 0) {
		goto __1290
	}
	if !(0 > 0) {
		goto __1292
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1292:
	;
	pc += uintptr(6)
	switch 0 {
	case 1:
		goto __1294
	case 2:
		goto __1295
	case 0:
		goto __1296
	}
	goto __1293
__1294:
	goto cleanup1_pushObjResultPtr
__1295:
	goto cleanup2_pushObjResultPtr
__1296:
	goto __1293
__1293:
	;
	goto __1291
__1290:
	pc += uintptr(6)
	switch 0 {
	case 1:
		goto __1298
	case 2:
		goto __1299
	case 0:
		goto __1300
	}
	goto __1297
__1298:
	goto cleanup1
__1299:
	goto cleanup2
__1300:
	goto __1297
__1297:
	;
__1291:
	;
__1286:
	;
	goto __1283
__1283:
	if 0 != 0 {
		goto __1282
	}
	goto __1284
__1284:
	;
__1268:
	;

slowUnsetScalar:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	if !(XTclPtrUnsetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760)), uintptr(0), uintptr(0), uintptr(0), flags,
		opnd) != TCL_OK && flags != 0) {
		goto __1301
	}
	goto errorInUnset
__1301:
	;
	checkInterp = 1
__1302:
	;
	if !(0 == 0) {
		goto __1305
	}
	if !(0 != 0) {
		goto __1307
	}
	if !(0 > 0) {
		goto __1308
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1309
__1308:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1309:
	;
__1307:
	;
	pc += uintptr(6)
	goto cleanup0
	goto __1306
__1305:
	if !(0 != 0) {
		goto __1310
	}
	if !(0 > 0) {
		goto __1312
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1312:
	;
	pc += uintptr(6)
	switch 0 {
	case 1:
		goto __1314
	case 2:
		goto __1315
	case 0:
		goto __1316
	}
	goto __1313
__1314:
	goto cleanup1_pushObjResultPtr
__1315:
	goto cleanup2_pushObjResultPtr
__1316:
	goto __1313
__1313:
	;
	goto __1311
__1310:
	pc += uintptr(6)
	switch 0 {
	case 1:
		goto __1318
	case 2:
		goto __1319
	case 0:
		goto __1320
	}
	goto __1317
__1318:
	goto cleanup1
__1319:
	goto cleanup2
__1320:
	goto __1317
__1317:
	;
__1311:
	;
__1306:
	;
	goto __1303
__1303:
	if 0 != 0 {
		goto __1302
	}
	goto __1304
__1304:
	;

__230:
	if uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))) != 0 {
		flags = TCL_LEAVE_ERR_MSG
	} else {
		flags = 0
	}
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(2))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(2) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(2) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(2) + uintptr(3)))))
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = compiledLocals + uintptr(opnd)*16
__1321:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_LINK != 0) {
		goto __1322
	}
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8))
	goto __1321
__1322:
	;

	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_ARRAY != 0 && !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_TRACED_UNSET != 0) &&
		!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)))).Fflags&VAR_SEARCH_ACTIVE != 0)) {
		goto __1323
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = sVarHashCreateVar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 728)) + 8)), part2Ptr, uintptr(0))
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0 && !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_UNSET|VAR_DEAD_HASH) != 0)) {
		goto __1324
	}
	// No nasty traces and element exists, so we can proceed to
	// unset it. Might still not exist though...

	if !!(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) == uintptr(0)) {
		goto __1326
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FrefCount, 1) > 1) {
		goto __1328
	}
	goto __1329
__1328:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __1330
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes != XtclEmptyStringRep) {
		goto __1332
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes)
__1332:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Flength = -1
__1333:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr37 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr37)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr37)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __1336
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))
	goto __1337
__1336:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr37)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr37)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	(*AllocCache)(unsafe.Pointer(cachePtr37)).FnumObjects++
__1337:
	;
	goto __1334
__1334:
	if 0 != 0 {
		goto __1333
	}
	goto __1335
__1335:
	;
	goto __1331
__1330:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))
__1331:
	;
__1329:
	;

	*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))) &= libc.CplInt32(VAR_ARRAY | VAR_LINK)
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = uintptr(0)
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_NAMESPACE_VAR != 0) {
		goto __1338
	}
	*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))) &= libc.CplInt32(VAR_NAMESPACE_VAR)
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __1339
	}
	(*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).FrefCount--
__1339:
	;
__1338:
	;

	XTclCleanupVar(tls, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)))
	goto __1327
__1326:
	if !(flags&TCL_LEAVE_ERR_MSG != 0) {
		goto __1340
	}
	goto slowUnsetArray
__1340:
	;
__1327:
	;

__1341:
	;
	if !(1 == 0) {
		goto __1344
	}
	if !(0 != 0) {
		goto __1346
	}
	if !(0 > 0) {
		goto __1347
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1348
__1347:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1348:
	;
__1346:
	;
	pc += uintptr(6)
	goto cleanup0
	goto __1345
__1344:
	if !(0 != 0) {
		goto __1349
	}
	if !(0 > 0) {
		goto __1351
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1351:
	;
	pc += uintptr(6)
	switch 1 {
	case 1:
		goto __1353
	case 2:
		goto __1354
	case 0:
		goto __1355
	}
	goto __1352
__1353:
	goto cleanup1_pushObjResultPtr
__1354:
	goto cleanup2_pushObjResultPtr
__1355:
	goto __1352
__1352:
	;
	goto __1350
__1349:
	pc += uintptr(6)
	switch 1 {
	case 1:
		goto __1357
	case 2:
		goto __1358
	case 0:
		goto __1359
	}
	goto __1356
__1357:
	goto cleanup1
__1358:
	goto cleanup2
__1359:
	goto __1356
__1356:
	;
__1350:
	;
__1345:
	;
	goto __1342
__1342:
	if 0 != 0 {
		goto __1341
	}
	goto __1343
__1343:
	;
	goto __1325
__1324:
	if !(!(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0) && !(flags&TCL_LEAVE_ERR_MSG != 0)) {
		goto __1360
	}
	// Don't need to do anything here.

__1361:
	;
	if !(1 == 0) {
		goto __1364
	}
	if !(0 != 0) {
		goto __1366
	}
	if !(0 > 0) {
		goto __1367
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1368
__1367:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1368:
	;
__1366:
	;
	pc += uintptr(6)
	goto cleanup0
	goto __1365
__1364:
	if !(0 != 0) {
		goto __1369
	}
	if !(0 > 0) {
		goto __1371
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1371:
	;
	pc += uintptr(6)
	switch 1 {
	case 1:
		goto __1373
	case 2:
		goto __1374
	case 0:
		goto __1375
	}
	goto __1372
__1373:
	goto cleanup1_pushObjResultPtr
__1374:
	goto cleanup2_pushObjResultPtr
__1375:
	goto __1372
__1372:
	;
	goto __1370
__1369:
	pc += uintptr(6)
	switch 1 {
	case 1:
		goto __1377
	case 2:
		goto __1378
	case 0:
		goto __1379
	}
	goto __1376
__1377:
	goto cleanup1
__1378:
	goto cleanup2
__1379:
	goto __1376
__1376:
	;
__1370:
	;
__1365:
	;
	goto __1362
__1362:
	if 0 != 0 {
		goto __1361
	}
	goto __1363
__1363:
	;
__1360:
	;
__1325:
	;
__1323:
	;
slowUnsetArray:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclLookupArrayElement(tls, interp, uintptr(0), part2Ptr, flags, ts+3380,
		0, 0, *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)), opnd)
	if !!(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0) {
		goto __1380
	}
	if !(flags&TCL_LEAVE_ERR_MSG != 0) {
		goto __1382
	}
	goto errorInUnset
__1382:
	;
	goto __1381
__1380:
	if !(XTclPtrUnsetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760)), *(*uintptr)(unsafe.Pointer(bp + 728)), uintptr(0), part2Ptr,
		flags, opnd) != TCL_OK && flags&TCL_LEAVE_ERR_MSG != 0) {
		goto __1383
	}
	goto errorInUnset
__1383:
	;
__1381:
	;
	checkInterp = 1
__1384:
	;
	if !(1 == 0) {
		goto __1387
	}
	if !(0 != 0) {
		goto __1389
	}
	if !(0 > 0) {
		goto __1390
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1391
__1390:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1391:
	;
__1389:
	;
	pc += uintptr(6)
	goto cleanup0
	goto __1388
__1387:
	if !(0 != 0) {
		goto __1392
	}
	if !(0 > 0) {
		goto __1394
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1394:
	;
	pc += uintptr(6)
	switch 1 {
	case 1:
		goto __1396
	case 2:
		goto __1397
	case 0:
		goto __1398
	}
	goto __1395
__1396:
	goto cleanup1_pushObjResultPtr
__1397:
	goto cleanup2_pushObjResultPtr
__1398:
	goto __1395
__1395:
	;
	goto __1393
__1392:
	pc += uintptr(6)
	switch 1 {
	case 1:
		goto __1400
	case 2:
		goto __1401
	case 0:
		goto __1402
	}
	goto __1399
__1400:
	goto cleanup1
__1401:
	goto cleanup2
__1402:
	goto __1399
__1399:
	;
__1393:
	;
__1388:
	;
	goto __1385
__1385:
	if 0 != 0 {
		goto __1384
	}
	goto __1386
__1386:
	;

__231:
	if uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))) != 0 {
		flags = TCL_LEAVE_ERR_MSG
	} else {
		flags = 0
	}
	cleanup = 2
	part2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))                // element name
	part1Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) // array name

	goto doUnsetStk

__232:
	if uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))) != 0 {
		flags = TCL_LEAVE_ERR_MSG
	} else {
		flags = 0
	}
	cleanup = 1
	part2Ptr = uintptr(0)
	part1Ptr = *(*uintptr)(unsafe.Pointer(tosPtr)) // variable name

doUnsetStk:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	if !(XTclObjUnsetVar2(tls, interp, part1Ptr, part2Ptr, flags) != TCL_OK &&
		flags&TCL_LEAVE_ERR_MSG != 0) {
		goto __1403
	}
	goto errorInUnset
__1403:
	;
	checkInterp = 1

__1404:
	pc += uintptr(2)
	cleanup = cleanup
	if !(0 != 0) {
		goto __1407
	}
	if !(0 > 0) {
		goto __1409
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1409:
	;
	goto cleanupV_pushObjResultPtr
	goto __1408
__1407:
	goto cleanupV
__1408:
	;
	goto __1405
__1405:
	if 0 != 0 {
		goto __1404
	}
	goto __1406
__1406:
	;

errorInUnset:
	checkInterp = 1

	goto gotError

	// This is really an unset operation these days. Do not issue.

__233:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))

	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
__1410:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __1411
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __1410
__1411:
	;
	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_UNSET|VAR_DEAD_HASH) != 0) && !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_IN_HASHTABLE != 0)) {
		goto __1412
	}
	if !!(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) == uintptr(0)) {
		goto __1414
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FrefCount, 1) > 1) {
		goto __1415
	}
	goto __1416
__1415:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __1417
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes != XtclEmptyStringRep) {
		goto __1419
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes)
__1419:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Flength = -1
__1420:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr38 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr38)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr38)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __1423
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))
	goto __1424
__1423:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr38)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr38)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	(*AllocCache)(unsafe.Pointer(cachePtr38)).FnumObjects++
__1424:
	;
	goto __1421
__1421:
	if 0 != 0 {
		goto __1420
	}
	goto __1422
__1422:
	;
	goto __1418
__1417:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))
__1418:
	;
__1416:
	;

__1414:
	;
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = uintptr(0)
	goto __1413
__1412:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTclPtrUnsetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0), uintptr(0), uintptr(0), 0, opnd)
	checkInterp = 1
__1413:
	;
__1425:
	;
	if !(0 == 0) {
		goto __1428
	}
	if !(0 != 0) {
		goto __1430
	}
	if !(0 > 0) {
		goto __1431
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1432
__1431:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1432:
	;
__1430:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __1429
__1428:
	if !(0 != 0) {
		goto __1433
	}
	if !(0 > 0) {
		goto __1435
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1435:
	;
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __1437
	case 2:
		goto __1438
	case 0:
		goto __1439
	}
	goto __1436
__1437:
	goto cleanup1_pushObjResultPtr
__1438:
	goto cleanup2_pushObjResultPtr
__1439:
	goto __1436
__1436:
	;
	goto __1434
__1433:
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __1441
	case 2:
		goto __1442
	case 0:
		goto __1443
	}
	goto __1440
__1441:
	goto cleanup1
__1442:
	goto cleanup2
__1443:
	goto __1440
__1440:
	;
__1434:
	;
__1429:
	;
	goto __1426
__1426:
	if 0 != 0 {
		goto __1425
	}
	goto __1427
__1427:
	;

	goto __159

	//	   End of INST_UNSET instructions.
	// -----------------------------------------------------------------
	//	   Start of INST_ARRAY instructions.

__234:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	pcAdjustment = 5
	cleanup = 0
	part1Ptr = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = uintptr(0)

	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
__1444:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __1445
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __1444
__1445:
	;
	goto doArrayExists
__235:
	opnd = -1
	pcAdjustment = 1
	cleanup = 1
	part1Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))

	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclObjLookupVarEx(tls, interp, part1Ptr, uintptr(0), 0, uintptr(0),
		/*createPart1*/ 0 /*createPart2*/, 0, bp+728)
doArrayExists:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	result = XTclCheckArrayTraces(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)), part1Ptr, opnd)
	checkInterp = 1
	if !(result == TCL_ERROR) {
		goto __1446
	}

	goto gotError
__1446:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0 && (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_ARRAY != 0 && !(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) == uintptr(0))) {
		goto __1447
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + 1*8))
	goto __1448
__1447:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants))
__1448:
	;

__1449:
	pc += uintptr(pcAdjustment)
	cleanup = cleanup
	if !(1 != 0) {
		goto __1452
	}
	if !(1 > 0) {
		goto __1454
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1454:
	;
	goto cleanupV_pushObjResultPtr
	goto __1453
__1452:
	goto cleanupV
__1453:
	;
	goto __1450
__1450:
	if 0 != 0 {
		goto __1449
	}
	goto __1451
__1451:
	;

__236:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	pcAdjustment = 5
	cleanup = 0
	part1Ptr = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)) = uintptr(0)

	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
__1455:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __1456
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __1455
__1456:
	;
	goto doArrayMake
__237:
	opnd = -1
	pcAdjustment = 1
	cleanup = 1
	part1Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))

	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclObjLookupVarEx(tls, interp, part1Ptr, uintptr(0), TCL_LEAVE_ERR_MSG,
		ts+5303, 1 /*createPart2*/, 0, bp+728)
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) == uintptr(0)) {
		goto __1457
	}

	goto gotError
__1457:
	;
doArrayMake:
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) != 0 && !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_ARRAY != 0)) {
		goto __1458
	}
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_ARRAY_ELEMENT != 0 || !(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) == uintptr(0))) {
		goto __1459
	}
	// Either an array element, or a scalar: lose!

	XTclObjVarErrMsg(tls, interp, part1Ptr, uintptr(0), ts+28414,
		ts+28424, opnd)
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+160, ts+3593, ts+28445, ts+28451, uintptr(0)))
	checkInterp = 1

	goto gotError
__1459:
	;
	(*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags = (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&libc.CplInt32(VAR_LINK) | VAR_ARRAY
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TclVarHashTable{})))
	XTclInitVarHashTable(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)),
		func() uintptr {
			if (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_IN_HASHTABLE != 0 {
				return (*TclVarHashTable)(unsafe.Pointer((*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fentry.FtablePtr)).FnsPtr
			}
			return uintptr(0)
		}())
__1458:
	;
__1460:
	pc += uintptr(pcAdjustment)
	cleanup = cleanup
	if !(0 != 0) {
		goto __1463
	}
	if !(0 > 0) {
		goto __1465
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1465:
	;
	goto cleanupV_pushObjResultPtr
	goto __1464
__1463:
	goto cleanupV
__1464:
	;
	goto __1461
__1461:
	if 0 != 0 {
		goto __1460
	}
	goto __1462
__1462:
	;

	/*
	 *	   End of INST_ARRAY instructions.
	 * -----------------------------------------------------------------
	 *	   Start of variable linking instructions.
	 */

__238:
	;

	if !(XTclObjGetFrame(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)), bp+752) == -1) {
		goto __1466
	}

	goto gotError
__1466:
	;

	// Locate the other variable.

	savedFramePtr = (*Interp)(unsafe.Pointer(interp)).FvarFramePtr
	(*Interp)(unsafe.Pointer(interp)).FvarFramePtr = *(*uintptr)(unsafe.Pointer(bp + 752 /* framePtr */))
	otherPtr = XTclObjLookupVarEx(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)), uintptr(0),
		TCL_LEAVE_ERR_MSG, ts+28407, 1,
		/*createPart2*/ 1, bp+760)
	(*Interp)(unsafe.Pointer(interp)).FvarFramePtr = savedFramePtr
	if !!(otherPtr != 0) {
		goto __1467
	}

	goto gotError
__1467:
	;
	goto doLinkVars

__239:
	;
	if !(XTclGetNamespaceFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)), bp+768) != TCL_OK) {
		goto __1468
	}

	goto gotError
__1468:
	;

	// Locate the other variable.

	savedNsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr = *(*uintptr)(unsafe.Pointer(bp + 768 /* nsPtr */))
	otherPtr = XTclObjLookupVarEx(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)), uintptr(0),
		TCL_NAMESPACE_ONLY|TCL_LEAVE_ERR_MSG|TCL_AVOID_RESOLVERS,
		ts+28407, 1 /*createPart2*/, 1, bp+760)
	(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr = savedNsPtr
	if !!(otherPtr != 0) {
		goto __1469
	}

	goto gotError
__1469:
	;
	goto doLinkVars

__240:
	;
	otherPtr = XTclObjLookupVarEx(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)), uintptr(0),
		TCL_NAMESPACE_ONLY|TCL_LEAVE_ERR_MSG, ts+28407,
		/*createPart1*/ 1 /*createPart2*/, 1, bp+760)
	if !!(otherPtr != 0) {
		goto __1470
	}

	goto gotError
__1470:
	;

	// Do the [variable] magic.

	if !!((*Var)(unsafe.Pointer(otherPtr)).Fflags&VAR_NAMESPACE_VAR != 0) {
		goto __1471
	}
	*(*int32)(unsafe.Pointer(otherPtr)) |= VAR_NAMESPACE_VAR
	if !((*Var)(unsafe.Pointer(otherPtr)).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __1472
	}
	(*VarInHash)(unsafe.Pointer(otherPtr)).FrefCount++
__1472:
	;
__1471:
	;

doLinkVars:

	// If we are here, the local variable has already been created: do the
	// little work of TclPtrMakeUpvar that remains to be done right here
	// if there are no errors; otherwise, let it handle the case.

	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3))))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) != otherPtr && !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0) &&
		(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) == uintptr(0) || (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0)) {
		goto __1473
	}
	if !!(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) == uintptr(0)) {
		goto __1475
	}
	// Then it is a defined link.

	linkPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))

	if !(linkPtr == otherPtr) {
		goto __1476
	}

__1477:
	;
	if !(1 == 0) {
		goto __1480
	}
	if !(0 != 0) {
		goto __1482
	}
	if !(0 > 0) {
		goto __1483
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1484
__1483:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1484:
	;
__1482:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __1481
__1480:
	if !(0 != 0) {
		goto __1485
	}
	if !(0 > 0) {
		goto __1487
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1487:
	;
	pc += uintptr(5)
	switch 1 {
	case 1:
		goto __1489
	case 2:
		goto __1490
	case 0:
		goto __1491
	}
	goto __1488
__1489:
	goto cleanup1_pushObjResultPtr
__1490:
	goto cleanup2_pushObjResultPtr
__1491:
	goto __1488
__1488:
	;
	goto __1486
__1485:
	pc += uintptr(5)
	switch 1 {
	case 1:
		goto __1493
	case 2:
		goto __1494
	case 0:
		goto __1495
	}
	goto __1492
__1493:
	goto cleanup1
__1494:
	goto cleanup2
__1495:
	goto __1492
__1492:
	;
__1486:
	;
__1481:
	;
	goto __1478
__1478:
	if 0 != 0 {
		goto __1477
	}
	goto __1479
__1479:
	;
__1476:
	;
	if !((*Var)(unsafe.Pointer(linkPtr)).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __1496
	}
	(*VarInHash)(unsafe.Pointer(linkPtr)).FrefCount--
	if !(*(*uintptr)(unsafe.Pointer(linkPtr + 8)) == uintptr(0)) {
		goto __1497
	}
	XTclCleanupVar(tls, linkPtr, uintptr(0))
__1497:
	;
__1496:
	;
__1475:
	;
	(*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags = (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&libc.CplInt32(VAR_ARRAY) | VAR_LINK
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = otherPtr
	if !((*Var)(unsafe.Pointer(otherPtr)).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __1498
	}
	(*VarInHash)(unsafe.Pointer(otherPtr)).FrefCount++
__1498:
	;
	goto __1474
__1473:
	if !(XTclPtrObjMakeUpvarIdx(tls, interp, otherPtr, uintptr(0), 0,
		opnd) != TCL_OK) {
		goto __1499
	}

	goto gotError
__1499:
	;
__1474:
	;

	// Do not pop the namespace or frame index, it may be needed for other
	// variables - and [variable] did not push it at all.

__1500:
	;
	if !(1 == 0) {
		goto __1503
	}
	if !(0 != 0) {
		goto __1505
	}
	if !(0 > 0) {
		goto __1506
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1507
__1506:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1507:
	;
__1505:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __1504
__1503:
	if !(0 != 0) {
		goto __1508
	}
	if !(0 > 0) {
		goto __1510
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1510:
	;
	pc += uintptr(5)
	switch 1 {
	case 1:
		goto __1512
	case 2:
		goto __1513
	case 0:
		goto __1514
	}
	goto __1511
__1512:
	goto cleanup1_pushObjResultPtr
__1513:
	goto cleanup2_pushObjResultPtr
__1514:
	goto __1511
__1511:
	;
	goto __1509
__1508:
	pc += uintptr(5)
	switch 1 {
	case 1:
		goto __1516
	case 2:
		goto __1517
	case 0:
		goto __1518
	}
	goto __1515
__1516:
	goto cleanup1
__1517:
	goto cleanup2
__1518:
	goto __1515
__1515:
	;
__1509:
	;
__1504:
	;
	goto __1501
__1501:
	if 0 != 0 {
		goto __1500
	}
	goto __1502
__1502:
	;

	goto __159

	//	   End of variable linking instructions.
	// -----------------------------------------------------------------

__241:
	opnd = int32(*(*int8)(unsafe.Pointer(pc + uintptr(1))))

__1519:
	;
	if !(0 == 0) {
		goto __1522
	}
	if !(0 != 0) {
		goto __1524
	}
	if !(0 > 0) {
		goto __1525
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1526
__1525:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1526:
	;
__1524:
	;
	pc += uintptr(opnd)
	goto cleanup0
	goto __1523
__1522:
	if !(0 != 0) {
		goto __1527
	}
	if !(0 > 0) {
		goto __1529
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1529:
	;
	pc += uintptr(opnd)
	switch 0 {
	case 1:
		goto __1531
	case 2:
		goto __1532
	case 0:
		goto __1533
	}
	goto __1530
__1531:
	goto cleanup1_pushObjResultPtr
__1532:
	goto cleanup2_pushObjResultPtr
__1533:
	goto __1530
__1530:
	;
	goto __1528
__1527:
	pc += uintptr(opnd)
	switch 0 {
	case 1:
		goto __1535
	case 2:
		goto __1536
	case 0:
		goto __1537
	}
	goto __1534
__1535:
	goto cleanup1
__1536:
	goto cleanup2
__1537:
	goto __1534
__1534:
	;
__1528:
	;
__1523:
	;
	goto __1520
__1520:
	if 0 != 0 {
		goto __1519
	}
	goto __1521
__1521:
	;
	goto __159

__242:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3))))

__1538:
	;
	if !(0 == 0) {
		goto __1541
	}
	if !(0 != 0) {
		goto __1543
	}
	if !(0 > 0) {
		goto __1544
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1545
__1544:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1545:
	;
__1543:
	;
	pc += uintptr(opnd)
	goto cleanup0
	goto __1542
__1541:
	if !(0 != 0) {
		goto __1546
	}
	if !(0 > 0) {
		goto __1548
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1548:
	;
	pc += uintptr(opnd)
	switch 0 {
	case 1:
		goto __1550
	case 2:
		goto __1551
	case 0:
		goto __1552
	}
	goto __1549
__1550:
	goto cleanup1_pushObjResultPtr
__1551:
	goto cleanup2_pushObjResultPtr
__1552:
	goto __1549
__1549:
	;
	goto __1547
__1546:
	pc += uintptr(opnd)
	switch 0 {
	case 1:
		goto __1554
	case 2:
		goto __1555
	case 0:
		goto __1556
	}
	goto __1553
__1554:
	goto cleanup1
__1555:
	goto cleanup2
__1556:
	goto __1553
__1553:
	;
__1547:
	;
__1542:
	;
	goto __1539
__1539:
	if 0 != 0 {
		goto __1538
	}
	goto __1540
__1540:
	;

	// TODO: consider rewrite so we don't compute the offset we're not
	// going to take.
__243:
	*(*int32)(unsafe.Pointer(bp + 776)) = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))) // FALSE offset
	*(*int32)(unsafe.Pointer(bp + 776 + 1*4)) = 5                                                                                                                                                                                                                                                                 // TRUE offset
	goto doCondJump

__244:
	*(*int32)(unsafe.Pointer(bp + 776)) = 5
	*(*int32)(unsafe.Pointer(bp + 776 + 1*4)) = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3))))
	goto doCondJump

__245:
	*(*int32)(unsafe.Pointer(bp + 776)) = int32(*(*int8)(unsafe.Pointer(pc + uintptr(1))))
	*(*int32)(unsafe.Pointer(bp + 776 + 1*4)) = 2
	goto doCondJump

__246:
	*(*int32)(unsafe.Pointer(bp + 776)) = 2
	*(*int32)(unsafe.Pointer(bp + 776 + 1*4)) = int32(*(*int8)(unsafe.Pointer(pc + uintptr(1))))

doCondJump:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))

	// TODO - check claim that taking address of b harms performance
	// TODO - consider optimization search for constants
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) || (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclBooleanType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 784)) = libc.Bool32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) != int64(0))
				return TCL_OK
			}()
		}
		return XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+784)
	}() != TCL_OK) {
		goto __1557
	}

	goto gotError
__1557:
	;

__1558:
	;
	if !(1 == 0) {
		goto __1561
	}
	if !(0 != 0) {
		goto __1563
	}
	if !(0 > 0) {
		goto __1564
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1565
__1564:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1565:
	;
__1563:
	;
	pc += uintptr(*(*int32)(unsafe.Pointer(bp + 776 + uintptr(*(*int32)(unsafe.Pointer(bp + 784)))*4)))
	goto cleanup0
	goto __1562
__1561:
	if !(0 != 0) {
		goto __1566
	}
	if !(0 > 0) {
		goto __1568
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1568:
	;
	pc += uintptr(*(*int32)(unsafe.Pointer(bp + 776 + uintptr(*(*int32)(unsafe.Pointer(bp + 784)))*4)))
	switch 1 {
	case 1:
		goto __1570
	case 2:
		goto __1571
	case 0:
		goto __1572
	}
	goto __1569
__1570:
	goto cleanup1_pushObjResultPtr
__1571:
	goto cleanup2_pushObjResultPtr
__1572:
	goto __1569
__1569:
	;
	goto __1567
__1566:
	pc += uintptr(*(*int32)(unsafe.Pointer(bp + 776 + uintptr(*(*int32)(unsafe.Pointer(bp + 784)))*4)))
	switch 1 {
	case 1:
		goto __1574
	case 2:
		goto __1575
	case 0:
		goto __1576
	}
	goto __1573
__1574:
	goto cleanup1
__1575:
	goto cleanup2
__1576:
	goto __1573
__1573:
	;
__1567:
	;
__1562:
	;
	goto __1559
__1559:
	if 0 != 0 {
		goto __1558
	}
	goto __1560
__1560:
	;

	goto __159

__247:

	// Jump to location looked up in a hashtable; fall through to next
	// instr if lookup fails.

	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3))))
	jtPtr = (*AuxData)(unsafe.Pointer((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FauxDataArrayPtr + uintptr(opnd)*16)).FclientData

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(jtPtr /* &.hashTable */)).FfindProc})).f(tls, jtPtr /* &.hashTable */, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
	}())
	if !(hPtr != uintptr(0)) {
		goto __1577
	}
	jumpOffset = int32((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)

__1579:
	;
	if !(1 == 0) {
		goto __1582
	}
	if !(0 != 0) {
		goto __1584
	}
	if !(0 > 0) {
		goto __1585
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1586
__1585:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1586:
	;
__1584:
	;
	pc += uintptr(jumpOffset)
	goto cleanup0
	goto __1583
__1582:
	if !(0 != 0) {
		goto __1587
	}
	if !(0 > 0) {
		goto __1589
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1589:
	;
	pc += uintptr(jumpOffset)
	switch 1 {
	case 1:
		goto __1591
	case 2:
		goto __1592
	case 0:
		goto __1593
	}
	goto __1590
__1591:
	goto cleanup1_pushObjResultPtr
__1592:
	goto cleanup2_pushObjResultPtr
__1593:
	goto __1590
__1590:
	;
	goto __1588
__1587:
	pc += uintptr(jumpOffset)
	switch 1 {
	case 1:
		goto __1595
	case 2:
		goto __1596
	case 0:
		goto __1597
	}
	goto __1594
__1595:
	goto cleanup1
__1596:
	goto cleanup2
__1597:
	goto __1594
__1594:
	;
__1588:
	;
__1583:
	;
	goto __1580
__1580:
	if 0 != 0 {
		goto __1579
	}
	goto __1581
__1581:
	;
	goto __1578
__1577:
	;
__1598:
	;
	if !(1 == 0) {
		goto __1601
	}
	if !(0 != 0) {
		goto __1603
	}
	if !(0 > 0) {
		goto __1604
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1605
__1604:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1605:
	;
__1603:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __1602
__1601:
	if !(0 != 0) {
		goto __1606
	}
	if !(0 > 0) {
		goto __1608
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1608:
	;
	pc += uintptr(5)
	switch 1 {
	case 1:
		goto __1610
	case 2:
		goto __1611
	case 0:
		goto __1612
	}
	goto __1609
__1610:
	goto cleanup1_pushObjResultPtr
__1611:
	goto cleanup2_pushObjResultPtr
__1612:
	goto __1609
__1609:
	;
	goto __1607
__1606:
	pc += uintptr(5)
	switch 1 {
	case 1:
		goto __1614
	case 2:
		goto __1615
	case 0:
		goto __1616
	}
	goto __1613
__1614:
	goto cleanup1
__1615:
	goto cleanup2
__1616:
	goto __1613
__1613:
	;
__1607:
	;
__1602:
	;
	goto __1599
__1599:
	if 0 != 0 {
		goto __1598
	}
	goto __1600
__1600:
	;
__1578:
	;

	goto __159

	// These two instructions are now redundant: the complete logic of the LOR
	// and LAND is now handled by the expression compiler.

__248:
__249:

	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) || (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclBooleanType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 788)) = libc.Bool32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) != int64(0))
				return TCL_OK
			}()
		}
		return XTcl_GetBooleanFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 944)), bp+788)
	}() != TCL_OK) {
		goto __1617
	}

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	sIllegalExprOperandType(tls, interp, pc, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	checkInterp = 1
	goto gotError
__1617:
	;

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) || (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBooleanType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 792)) = libc.Bool32(*(*int64)(unsafe.Pointer(value2Ptr + 32)) != int64(0))
				return TCL_OK
			}()
		}
		return XTcl_GetBooleanFromObj(tls, uintptr(0), value2Ptr, bp+792)
	}() != TCL_OK) {
		goto __1618
	}

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	sIllegalExprOperandType(tls, interp, pc, value2Ptr)
	checkInterp = 1
	goto gotError
__1618:
	;

	if !(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_LOR) {
		goto __1619
	}
	iResult = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 788)) != 0 || *(*int32)(unsafe.Pointer(bp + 792)) != 0)
	goto __1620
__1619:
	iResult = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 788)) != 0 && *(*int32)(unsafe.Pointer(bp + 792)) != 0)
__1620:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(iResult)*8))

__1621:
	;
	if !(2 == 0) {
		goto __1624
	}
	if !(1 != 0) {
		goto __1626
	}
	if !(1 > 0) {
		goto __1627
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1628
__1627:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1628:
	;
__1626:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1625
__1624:
	if !(1 != 0) {
		goto __1629
	}
	if !(1 > 0) {
		goto __1631
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1631:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __1633
	case 2:
		goto __1634
	case 0:
		goto __1635
	}
	goto __1632
__1633:
	goto cleanup1_pushObjResultPtr
__1634:
	goto cleanup2_pushObjResultPtr
__1635:
	goto __1632
__1632:
	;
	goto __1630
__1629:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __1637
	case 2:
		goto __1638
	case 0:
		goto __1639
	}
	goto __1636
__1637:
	goto cleanup1
__1638:
	goto cleanup2
__1639:
	goto __1636
__1636:
	;
__1630:
	;
__1625:
	;
	goto __1622
__1622:
	if 0 != 0 {
		goto __1621
	}
	goto __1623
__1623:
	;

	goto __159

	// -----------------------------------------------------------------
	//	   Start of general introspector instructions.

__250:
	currNsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr

	if !(currNsPtr == (*Interp)(unsafe.Pointer(interp)).FglobalNsPtr) {
		goto __1640
	}
__1642:
	;
__1645:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr39 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr39)).FnumObjects == 0
	}()) {
		goto __1648
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __1649
__1648:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr39)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr39)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr39)).FnumObjects--
__1649:
	;
	goto __1646
__1646:
	if 0 != 0 {
		goto __1645
	}
	goto __1647
__1647:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0) {
		goto __1650
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	goto __1651
__1650:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes, ts+6847, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes + 2)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
__1651:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	goto __1643
__1643:
	if 0 != 0 {
		goto __1642
	}
	goto __1644
__1644:
	;
	goto __1641
__1640:
__1652:
	;
__1655:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr40 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr40)).FnumObjects == 0
	}()) {
		goto __1658
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __1659
__1658:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr40)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr40)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr40)).FnumObjects--
__1659:
	;
	goto __1656
__1656:
	if 0 != 0 {
		goto __1655
	}
	goto __1657
__1657:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	if !(libc.Xstrlen(tls, (*Namespace)(unsafe.Pointer(currNsPtr)).FfullName) == uint64(0)) {
		goto __1660
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	goto __1661
__1660:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XTcl_Alloc(tls, uint32(libc.Xstrlen(tls, (*Namespace)(unsafe.Pointer(currNsPtr)).FfullName)+uint64(1)))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes, (*Namespace)(unsafe.Pointer(currNsPtr)).FfullName, libc.Xstrlen(tls, (*Namespace)(unsafe.Pointer(currNsPtr)).FfullName))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes + uintptr(libc.Xstrlen(tls, (*Namespace)(unsafe.Pointer(currNsPtr)).FfullName)))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = int32(libc.Xstrlen(tls, (*Namespace)(unsafe.Pointer(currNsPtr)).FfullName))
__1661:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	goto __1653
__1653:
	if 0 != 0 {
		goto __1652
	}
	goto __1654
__1654:
	;
__1641:
	;

__1662:
	;
	if !(0 == 0) {
		goto __1665
	}
	if !(1 != 0) {
		goto __1667
	}
	if !(1 > 0) {
		goto __1668
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1669
__1668:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1669:
	;
__1667:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1666
__1665:
	if !(1 != 0) {
		goto __1670
	}
	if !(1 > 0) {
		goto __1672
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1672:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __1674
	case 2:
		goto __1675
	case 0:
		goto __1676
	}
	goto __1673
__1674:
	goto cleanup1_pushObjResultPtr
__1675:
	goto cleanup2_pushObjResultPtr
__1676:
	goto __1673
__1673:
	;
	goto __1671
__1670:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __1678
	case 2:
		goto __1679
	case 0:
		goto __1680
	}
	goto __1677
__1678:
	goto cleanup1
__1679:
	goto cleanup2
__1680:
	goto __1677
__1677:
	;
__1671:
	;
__1666:
	;
	goto __1663
__1663:
	if 0 != 0 {
		goto __1662
	}
	goto __1664
__1664:
	;

	goto __159
__251:
	corPtr1 = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcorPtr

__1681:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr41 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr41)).FnumObjects == 0
	}()) {
		goto __1684
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __1685
__1684:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr41)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr41)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr41)).FnumObjects--
__1685:
	;
	goto __1682
__1682:
	if 0 != 0 {
		goto __1681
	}
	goto __1683
__1683:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	if !(corPtr1 != 0 && !((*Command1)(unsafe.Pointer((*CoroutineData)(unsafe.Pointer(corPtr1)).FcmdPtr)).Fflags&CMD_IS_DELETED != 0)) {
		goto __1686
	}
	XTcl_GetCommandFullName(tls, interp, (*CoroutineData)(unsafe.Pointer(corPtr1)).FcmdPtr,
		*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))
__1686:
	;

__1687:
	;
	if !(0 == 0) {
		goto __1690
	}
	if !(1 != 0) {
		goto __1692
	}
	if !(1 > 0) {
		goto __1693
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1694
__1693:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1694:
	;
__1692:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1691
__1690:
	if !(1 != 0) {
		goto __1695
	}
	if !(1 > 0) {
		goto __1697
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1697:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __1699
	case 2:
		goto __1700
	case 0:
		goto __1701
	}
	goto __1698
__1699:
	goto cleanup1_pushObjResultPtr
__1700:
	goto cleanup2_pushObjResultPtr
__1701:
	goto __1698
__1698:
	;
	goto __1696
__1695:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __1703
	case 2:
		goto __1704
	case 0:
		goto __1705
	}
	goto __1702
__1703:
	goto cleanup1
__1704:
	goto cleanup2
__1705:
	goto __1702
__1702:
	;
__1696:
	;
__1691:
	;
	goto __1688
__1688:
	if 0 != 0 {
		goto __1687
	}
	goto __1689
__1689:
	;

	goto __159
__252:
__1706:
	;
__1709:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr42 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr42)).FnumObjects == 0
	}()) {
		goto __1712
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __1713
__1712:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr42)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr42)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr42)).FnumObjects--
__1713:
	;
	goto __1710
__1710:
	if 0 != 0 {
		goto __1709
	}
	goto __1711
__1711:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).Flevel)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __1707
__1707:
	if 0 != 0 {
		goto __1706
	}
	goto __1708
__1708:
	;

__1714:
	;
	if !(0 == 0) {
		goto __1717
	}
	if !(1 != 0) {
		goto __1719
	}
	if !(1 > 0) {
		goto __1720
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1721
__1720:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1721:
	;
__1719:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1718
__1717:
	if !(1 != 0) {
		goto __1722
	}
	if !(1 > 0) {
		goto __1724
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1724:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __1726
	case 2:
		goto __1727
	case 0:
		goto __1728
	}
	goto __1725
__1726:
	goto cleanup1_pushObjResultPtr
__1727:
	goto cleanup2_pushObjResultPtr
__1728:
	goto __1725
__1725:
	;
	goto __1723
__1722:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __1730
	case 2:
		goto __1731
	case 0:
		goto __1732
	}
	goto __1729
__1730:
	goto cleanup1
__1731:
	goto cleanup2
__1732:
	goto __1729
__1729:
	;
__1723:
	;
__1718:
	;
	goto __1715
__1715:
	if 0 != 0 {
		goto __1714
	}
	goto __1716
__1716:
	;
	goto __159
__253:
	framePtr1 = (*Interp)(unsafe.Pointer(interp)).FvarFramePtr
	rootFramePtr = (*Interp)(unsafe.Pointer(interp)).FrootFramePtr

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 796)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)), bp+796)
	}() != TCL_OK) {
		goto __1733
	}

	goto gotError
__1733:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 796)) <= 0) {
		goto __1734
	}
	*(*int32)(unsafe.Pointer(bp + 796 /* level1 */)) += (*CallFrame)(unsafe.Pointer(framePtr1)).Flevel
__1734:
	;
__1735:
	if !((*CallFrame)(unsafe.Pointer(framePtr1)).Flevel != *(*int32)(unsafe.Pointer(bp + 796)) && framePtr1 != rootFramePtr) {
		goto __1737
	}
	// Empty loop body
	goto __1736
__1736:
	framePtr1 = (*CallFrame)(unsafe.Pointer(framePtr1)).FcallerVarPtr
	goto __1735
	goto __1737
__1737:
	;
	if !(framePtr1 == rootFramePtr) {
		goto __1738
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+13701, libc.VaList(bp+192, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
		}())))

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+200, ts+3593, ts+7170, ts+28457,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
		}(), uintptr(0)))
	checkInterp = 1
	goto gotError
__1738:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewListObj(tls, (*CallFrame)(unsafe.Pointer(framePtr1)).Fobjc, (*CallFrame)(unsafe.Pointer(framePtr1)).Fobjv)

__1739:
	;
	if !(1 == 0) {
		goto __1742
	}
	if !(1 != 0) {
		goto __1744
	}
	if !(1 > 0) {
		goto __1745
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1746
__1745:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1746:
	;
__1744:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1743
__1742:
	if !(1 != 0) {
		goto __1747
	}
	if !(1 > 0) {
		goto __1749
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1749:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1751
	case 2:
		goto __1752
	case 0:
		goto __1753
	}
	goto __1750
__1751:
	goto cleanup1_pushObjResultPtr
__1752:
	goto cleanup2_pushObjResultPtr
__1753:
	goto __1750
__1750:
	;
	goto __1748
__1747:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1755
	case 2:
		goto __1756
	case 0:
		goto __1757
	}
	goto __1754
__1755:
	goto cleanup1
__1756:
	goto cleanup2
__1757:
	goto __1754
__1754:
	;
__1748:
	;
__1743:
	;
	goto __1740
__1740:
	if 0 != 0 {
		goto __1739
	}
	goto __1741
__1741:
	;

__254:
	cmd = XTcl_GetCommandFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)))
__1758:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr43 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr43)).FnumObjects == 0
	}()) {
		goto __1761
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __1762
__1761:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr43)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr43)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr43)).FnumObjects--
__1762:
	;
	goto __1759
__1759:
	if 0 != 0 {
		goto __1758
	}
	goto __1760
__1760:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	if !(cmd != uintptr(0)) {
		goto __1763
	}
	XTcl_GetCommandFullName(tls, interp, cmd, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))
__1763:
	;

__1764:
	;
	if !(1 == 0) {
		goto __1767
	}
	if !(1 != 0) {
		goto __1769
	}
	if !(1 > 0) {
		goto __1770
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1771
__1770:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1771:
	;
__1769:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1768
__1767:
	if !(1 != 0) {
		goto __1772
	}
	if !(1 > 0) {
		goto __1774
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1774:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1776
	case 2:
		goto __1777
	case 0:
		goto __1778
	}
	goto __1775
__1776:
	goto cleanup1_pushObjResultPtr
__1777:
	goto cleanup2_pushObjResultPtr
__1778:
	goto __1775
__1775:
	;
	goto __1773
__1772:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1780
	case 2:
		goto __1781
	case 0:
		goto __1782
	}
	goto __1779
__1780:
	goto cleanup1
__1781:
	goto cleanup2
__1782:
	goto __1779
__1779:
	;
__1773:
	;
__1768:
	;
	goto __1765
__1765:
	if 0 != 0 {
		goto __1764
	}
	goto __1766
__1766:
	;

__255:
	;
	cmd = XTcl_GetCommandFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)))
	if !(cmd == uintptr(0)) {
		goto __1783
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+7842, libc.VaList(bp+240, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
		}())))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+248, ts+3593, ts+7170, ts+7328,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
		}(), uintptr(0)))
	checkInterp = 1

	goto gotError
__1783:
	;
	origCmd = XTclGetOriginalCommand(tls, cmd)
	if !(origCmd == uintptr(0)) {
		goto __1784
	}
	origCmd = cmd
__1784:
	;
__1785:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr44 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr44)).FnumObjects == 0
	}()) {
		goto __1788
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __1789
__1788:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr44)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr44)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr44)).FnumObjects--
__1789:
	;
	goto __1786
__1786:
	if 0 != 0 {
		goto __1785
	}
	goto __1787
__1787:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	XTcl_GetCommandFullName(tls, interp, origCmd, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))

__1790:
	;
	if !(1 == 0) {
		goto __1793
	}
	if !(1 != 0) {
		goto __1795
	}
	if !(1 > 0) {
		goto __1796
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1797
__1796:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1797:
	;
__1795:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1794
__1793:
	if !(1 != 0) {
		goto __1798
	}
	if !(1 > 0) {
		goto __1800
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1800:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1802
	case 2:
		goto __1803
	case 0:
		goto __1804
	}
	goto __1801
__1802:
	goto cleanup1_pushObjResultPtr
__1803:
	goto cleanup2_pushObjResultPtr
__1804:
	goto __1801
__1801:
	;
	goto __1799
__1798:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1806
	case 2:
		goto __1807
	case 0:
		goto __1808
	}
	goto __1805
__1806:
	goto cleanup1
__1807:
	goto cleanup2
__1808:
	goto __1805
__1805:
	;
__1799:
	;
__1794:
	;
	goto __1791
__1791:
	if 0 != 0 {
		goto __1790
	}
	goto __1792
__1792:
	;

	/*
	 * -----------------------------------------------------------------
	 *	   Start of TclOO support instructions.
	 */

__256:
	framePtr2 = (*Interp)(unsafe.Pointer(interp)).FvarFramePtr
	if !(framePtr2 == uintptr(0) || !((*CallFrame)(unsafe.Pointer(framePtr2)).FisProcCallFrame&FRAME_IS_METHOD != 0)) {
		goto __1809
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+28469,
		-1))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+288, ts+3593, ts+28514, ts+28517, uintptr(0)))
	checkInterp = 1
	goto gotError
__1809:
	;
	contextPtr = (*CallFrame)(unsafe.Pointer(framePtr2)).FclientData

	// Call out to get the name; it's expensive to compute but cached.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclOOObjectName(tls, interp, (*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)

__1810:
	;
	if !(0 == 0) {
		goto __1813
	}
	if !(1 != 0) {
		goto __1815
	}
	if !(1 > 0) {
		goto __1816
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1817
__1816:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1817:
	;
__1815:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1814
__1813:
	if !(1 != 0) {
		goto __1818
	}
	if !(1 > 0) {
		goto __1820
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1820:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __1822
	case 2:
		goto __1823
	case 0:
		goto __1824
	}
	goto __1821
__1822:
	goto cleanup1_pushObjResultPtr
__1823:
	goto cleanup2_pushObjResultPtr
__1824:
	goto __1821
__1821:
	;
	goto __1819
__1818:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __1826
	case 2:
		goto __1827
	case 0:
		goto __1828
	}
	goto __1825
__1826:
	goto cleanup1
__1827:
	goto cleanup2
__1828:
	goto __1825
__1825:
	;
__1819:
	;
__1814:
	;
	goto __1811
__1811:
	if 0 != 0 {
		goto __1810
	}
	goto __1812
__1812:
	;

__257:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	framePtr2 = (*Interp)(unsafe.Pointer(interp)).FvarFramePtr
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(opnd-2)*8))
	*(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)) = tosPtr - uintptr(opnd-1)*8
	skip = 2

	if !(framePtr2 == uintptr(0) || !((*CallFrame)(unsafe.Pointer(framePtr2)).FisProcCallFrame&FRAME_IS_METHOD != 0)) {
		goto __1829
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+28534,
		-1))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+320, ts+3593, ts+28514, ts+28517, uintptr(0)))
	checkInterp = 1
	goto gotError
__1829:
	;
	contextPtr = (*CallFrame)(unsafe.Pointer(framePtr2)).FclientData

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	if !(oPtr == uintptr(0)) {
		goto __1830
	}

	goto gotError
	goto __1831
__1830:
	classPtr = (*Object)(unsafe.Pointer(oPtr)).FclassPtr

	if !(classPtr == uintptr(0)) {
		goto __1832
	}

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+25445, libc.VaList(bp+352, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 944)))
		}())))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+360, ts+3593, ts+28514, ts+28581, uintptr(0)))
	checkInterp = 1
	goto gotError
__1832:
	;

	i3 = (*CallContext)(unsafe.Pointer(contextPtr)).Findex + 1
__1833:
	if !(i3 < (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain) {
		goto __1835
	}
	miPtr = (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr(i3)*24
	if !(!((*MInvoke)(unsafe.Pointer(miPtr)).FisFilter != 0) && (*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer(miPtr)).FmPtr)).FdeclaringClassPtr == classPtr) {
		goto __1836
	}
	newDepth = i3
	goto doInvokeNext
__1836:
	;
	goto __1834
__1834:
	i3++
	goto __1833
	goto __1835
__1835:
	;

	if !((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&CONSTRUCTOR != 0) {
		goto __1837
	}
	methodType = ts + 25887 /* "constructor" */
	goto __1838
__1837:
	if !((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&DESTRUCTOR != 0) {
		goto __1839
	}
	methodType = ts + 25899 /* "destructor" */
	goto __1840
__1839:
	methodType = ts + 25917 /* "method" */
__1840:
	;
__1838:
	;

	i3 = (*CallContext)(unsafe.Pointer(contextPtr)).Findex
__1841:
	if !(i3 >= 0) {
		goto __1843
	}
	miPtr = (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr(i3)*24
	if !((*MInvoke)(unsafe.Pointer(miPtr)).FisFilter != 0 ||
		(*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer(miPtr)).FmPtr)).FdeclaringClassPtr != classPtr) {
		goto __1844
	}
	goto __1842
__1844:
	;
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+28596,
		libc.VaList(bp+392, methodType, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 944)))
		}())))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+408, ts+3593, ts+28514, ts+28646,
		uintptr(0)))
	checkInterp = 1
	goto gotError
	goto __1842
__1842:
	i3--
	goto __1841
	goto __1843
__1843:
	;
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+28666,
		libc.VaList(bp+440, methodType, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 944)))
		}())))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+456, ts+3593, ts+28514, ts+28710, uintptr(0)))
	checkInterp = 1
	goto gotError
__1831:
	;

__258:
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))))
	*(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)) = tosPtr - uintptr(opnd-1)*8
	framePtr2 = (*Interp)(unsafe.Pointer(interp)).FvarFramePtr
	skip = 1

	if !(framePtr2 == uintptr(0) || !((*CallFrame)(unsafe.Pointer(framePtr2)).FisProcCallFrame&FRAME_IS_METHOD != 0)) {
		goto __1845
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+28726,
		-1))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+488, ts+3593, ts+28514, ts+28517, uintptr(0)))
	checkInterp = 1
	goto gotError
__1845:
	;
	contextPtr = (*CallFrame)(unsafe.Pointer(framePtr2)).FclientData

	newDepth = (*CallContext)(unsafe.Pointer(contextPtr)).Findex + 1
	if !(newDepth >= (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain) {
		goto __1846
	}

	if !((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&CONSTRUCTOR != 0) {
		goto __1847
	}
	methodType1 = ts + 25887 /* "constructor" */
	goto __1848
__1847:
	if !((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&DESTRUCTOR != 0) {
		goto __1849
	}
	methodType1 = ts + 25899 /* "destructor" */
	goto __1850
__1849:
	methodType1 = ts + 25917 /* "method" */
__1850:
	;
__1848:
	;

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+28771, libc.VaList(bp+520, methodType1)))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+528, ts+3593, ts+28514, ts+28797, uintptr(0)))
	checkInterp = 1
	goto gotError
__1846:
	;

doInvokeNext:
	*(*uintptr)(unsafe.Pointer(TD + 24 + 40 + 8 /* &.pc */)) = pc
	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = TD + 24

	if !((*Interp)(unsafe.Pointer(interp)).Fflags&INTERP_DEBUG_FRAME != 0) {
		goto __1851
	}
	sArgumentBCEnter(tls, interp, (*TEBCdata)(unsafe.Pointer(TD)).FcodePtr, TD, pc, opnd, *(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)))
__1851:
	;

	pcAdjustment = 2
	cleanup = opnd
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	(*Interp)(unsafe.Pointer(interp)).FvarFramePtr = (*CallFrame)(unsafe.Pointer(framePtr2)).FcallerVarPtr
	pc += uintptr(pcAdjustment)
__1852:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
__1855:
__1858:
	;
__1861:
	if !(interp == uintptr(0) || func() bool {
		cachePtr45 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr45)).FnumObjects == 0
	}()) {
		goto __1864
	}
	_objPtr29 = XTclThreadAllocObj(tls)
	goto __1865
__1864:
	_objPtr29 = (*AllocCache)(unsafe.Pointer(cachePtr45)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr45)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr29 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr45)).FnumObjects--
__1865:
	;
	goto __1862
__1862:
	if 0 != 0 {
		goto __1861
	}
	goto __1863
__1863:
	;
	_callbackPtr8 = _objPtr29
	goto __1859
__1859:
	if 0 != 0 {
		goto __1858
	}
	goto __1860
__1860:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr8)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTEBCresume}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr8 + 8)) = TD
	*(*ClientData)(unsafe.Pointer(_callbackPtr8 + 8 + 1*8)) = pc
	*(*ClientData)(unsafe.Pointer(_callbackPtr8 + 8 + 2*8)) = uintptr(Intptr_t(cleanup))
	*(*ClientData)(unsafe.Pointer(_callbackPtr8 + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr8)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr8
	goto __1856
__1856:
	if 0 != 0 {
		goto __1855
	}
	goto __1857
__1857:
	;
	goto __1853
__1853:
	if 0 != 0 {
		goto __1852
	}
	goto __1854
__1854:
	;

	XTclPushTailcallPoint(tls, interp)
	oPtr = (*CallContext)(unsafe.Pointer(contextPtr)).FoPtr
	if !((*Object)(unsafe.Pointer(oPtr)).Fflags&FILTER_HANDLING != 0) {
		goto __1866
	}
__1868:
__1871:
	;
__1874:
	if !(interp == uintptr(0) || func() bool {
		cachePtr46 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr46)).FnumObjects == 0
	}()) {
		goto __1877
	}
	_objPtr30 = XTclThreadAllocObj(tls)
	goto __1878
__1877:
	_objPtr30 = (*AllocCache)(unsafe.Pointer(cachePtr46)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr46)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr30 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr46)).FnumObjects--
__1878:
	;
	goto __1875
__1875:
	if 0 != 0 {
		goto __1874
	}
	goto __1876
__1876:
	;
	_callbackPtr9 = _objPtr30
	goto __1872
__1872:
	if 0 != 0 {
		goto __1871
	}
	goto __1873
__1873:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr9)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sFinalizeOONextFilter}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr9 + 8)) = framePtr2
	*(*ClientData)(unsafe.Pointer(_callbackPtr9 + 8 + 1*8)) = contextPtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr9 + 8 + 2*8)) = uintptr(Intptr_t((*CallContext)(unsafe.Pointer(contextPtr)).Findex))
	*(*ClientData)(unsafe.Pointer(_callbackPtr9 + 8 + 3*8)) = uintptr(Intptr_t((*CallContext)(unsafe.Pointer(contextPtr)).Fskip))
	(*NRE_callback)(unsafe.Pointer(_callbackPtr9)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr9
	goto __1869
__1869:
	if 0 != 0 {
		goto __1868
	}
	goto __1870
__1870:
	;
	goto __1867
__1866:
__1879:
__1882:
	;
__1885:
	if !(interp == uintptr(0) || func() bool {
		cachePtr47 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr47)).FnumObjects == 0
	}()) {
		goto __1888
	}
	_objPtr31 = XTclThreadAllocObj(tls)
	goto __1889
__1888:
	_objPtr31 = (*AllocCache)(unsafe.Pointer(cachePtr47)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr47)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr31 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr47)).FnumObjects--
__1889:
	;
	goto __1886
__1886:
	if 0 != 0 {
		goto __1885
	}
	goto __1887
__1887:
	;
	_callbackPtr10 = _objPtr31
	goto __1883
__1883:
	if 0 != 0 {
		goto __1882
	}
	goto __1884
__1884:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr10)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sFinalizeOONext}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr10 + 8)) = framePtr2
	*(*ClientData)(unsafe.Pointer(_callbackPtr10 + 8 + 1*8)) = contextPtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr10 + 8 + 2*8)) = uintptr(Intptr_t((*CallContext)(unsafe.Pointer(contextPtr)).Findex))
	*(*ClientData)(unsafe.Pointer(_callbackPtr10 + 8 + 3*8)) = uintptr(Intptr_t((*CallContext)(unsafe.Pointer(contextPtr)).Fskip))
	(*NRE_callback)(unsafe.Pointer(_callbackPtr10)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr10
	goto __1880
__1880:
	if 0 != 0 {
		goto __1879
	}
	goto __1881
__1881:
	;
__1867:
	;
	(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = skip
	(*CallContext)(unsafe.Pointer(contextPtr)).Findex = newDepth
	if !((*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain+uintptr(newDepth)*24)).FisFilter != 0 ||
		(*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&FILTER_HANDLING != 0) {
		goto __1890
	}
	*(*int32)(unsafe.Pointer(oPtr + 92)) |= FILTER_HANDLING
	goto __1891
__1890:
	*(*int32)(unsafe.Pointer(oPtr + 92)) &= libc.CplInt32(FILTER_HANDLING)
__1891:
	;

	mPtr =
		(*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr(newDepth)*24)).FmPtr

	return (*struct {
		f func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FcallProc})).f(tls, (*Method)(unsafe.Pointer(mPtr)).FclientData, interp,
		contextPtr, opnd, *(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)))

__259:
	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)))
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(func() int32 {
		if oPtr != uintptr(0) {
			return 1
		}
		return 0
	}())*8))

__1892:
	;
	if !(1 == 0) {
		goto __1895
	}
	if !(1 != 0) {
		goto __1897
	}
	if !(1 > 0) {
		goto __1898
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1899
__1898:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1899:
	;
__1897:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1896
__1895:
	if !(1 != 0) {
		goto __1900
	}
	if !(1 > 0) {
		goto __1902
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1902:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1904
	case 2:
		goto __1905
	case 0:
		goto __1906
	}
	goto __1903
__1904:
	goto cleanup1_pushObjResultPtr
__1905:
	goto cleanup2_pushObjResultPtr
__1906:
	goto __1903
__1903:
	;
	goto __1901
__1900:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1908
	case 2:
		goto __1909
	case 0:
		goto __1910
	}
	goto __1907
__1908:
	goto cleanup1
__1909:
	goto cleanup2
__1910:
	goto __1907
__1907:
	;
__1901:
	;
__1896:
	;
	goto __1893
__1893:
	if 0 != 0 {
		goto __1892
	}
	goto __1894
__1894:
	;
__260:
	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)))
	if !(oPtr == uintptr(0)) {
		goto __1911
	}

	goto gotError
__1911:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclOOObjectName(tls, interp, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FthisPtr)

__1912:
	;
	if !(1 == 0) {
		goto __1915
	}
	if !(1 != 0) {
		goto __1917
	}
	if !(1 > 0) {
		goto __1918
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1919
__1918:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1919:
	;
__1917:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1916
__1915:
	if !(1 != 0) {
		goto __1920
	}
	if !(1 > 0) {
		goto __1922
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1922:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1924
	case 2:
		goto __1925
	case 0:
		goto __1926
	}
	goto __1923
__1924:
	goto cleanup1_pushObjResultPtr
__1925:
	goto cleanup2_pushObjResultPtr
__1926:
	goto __1923
__1923:
	;
	goto __1921
__1920:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1928
	case 2:
		goto __1929
	case 0:
		goto __1930
	}
	goto __1927
__1928:
	goto cleanup1
__1929:
	goto cleanup2
__1930:
	goto __1927
__1927:
	;
__1921:
	;
__1916:
	;
	goto __1913
__1913:
	if 0 != 0 {
		goto __1912
	}
	goto __1914
__1914:
	;
__261:
	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)))
	if !(oPtr == uintptr(0)) {
		goto __1931
	}

	goto gotError
__1931:
	;

	// TclOO objects *never* have the global namespace as their NS.

__1932:
	;
__1935:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr48 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr48)).FnumObjects == 0
	}()) {
		goto __1938
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __1939
__1938:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr48)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr48)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr48)).FnumObjects--
__1939:
	;
	goto __1936
__1936:
	if 0 != 0 {
		goto __1935
	}
	goto __1937
__1937:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	if !(libc.Xstrlen(tls, (*Tcl_Namespace)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)).FfullName) == uint64(0)) {
		goto __1940
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	goto __1941
__1940:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XTcl_Alloc(tls, uint32(libc.Xstrlen(tls, (*Tcl_Namespace)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)).FfullName)+uint64(1)))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes, (*Tcl_Namespace)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)).FfullName, libc.Xstrlen(tls, (*Tcl_Namespace)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)).FfullName))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes + uintptr(libc.Xstrlen(tls, (*Tcl_Namespace)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)).FfullName)))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = int32(libc.Xstrlen(tls, (*Tcl_Namespace)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)).FfullName))
__1941:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	goto __1933
__1933:
	if 0 != 0 {
		goto __1932
	}
	goto __1934
__1934:
	;

__1942:
	;
	if !(1 == 0) {
		goto __1945
	}
	if !(1 != 0) {
		goto __1947
	}
	if !(1 > 0) {
		goto __1948
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1949
__1948:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1949:
	;
__1947:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1946
__1945:
	if !(1 != 0) {
		goto __1950
	}
	if !(1 > 0) {
		goto __1952
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1952:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1954
	case 2:
		goto __1955
	case 0:
		goto __1956
	}
	goto __1953
__1954:
	goto cleanup1_pushObjResultPtr
__1955:
	goto cleanup2_pushObjResultPtr
__1956:
	goto __1953
__1953:
	;
	goto __1951
__1950:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1958
	case 2:
		goto __1959
	case 0:
		goto __1960
	}
	goto __1957
__1958:
	goto cleanup1
__1959:
	goto cleanup2
__1960:
	goto __1957
__1957:
	;
__1951:
	;
__1946:
	;
	goto __1943
__1943:
	if 0 != 0 {
		goto __1942
	}
	goto __1944
__1944:
	;

	/*
	 *     End of TclOO support instructions.
	 * -----------------------------------------------------------------
	 *	   Start of INST_LIST and related instructions.
	 */

__262:
	// Pop the opnd (objc) top stack elements into a new list obj and then
	// decrement their ref counts.

	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewListObj(tls, opnd, tosPtr-uintptr(opnd-1)*8)

__1961:
	pc += uintptr(5)
	cleanup = opnd
	if !(1 != 0) {
		goto __1964
	}
	if !(1 > 0) {
		goto __1966
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1966:
	;
	goto cleanupV_pushObjResultPtr
	goto __1965
__1964:
	goto cleanupV
__1965:
	;
	goto __1962
__1962:
	if 0 != 0 {
		goto __1961
	}
	goto __1963
__1963:
	;

__263:
	;
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 704)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)), bp+704)
	}() != TCL_OK) {
		goto __1967
	}

	goto gotError
__1967:
	;
__1968:
	;
__1971:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr49 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr49)).FnumObjects == 0
	}()) {
		goto __1974
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __1975
__1974:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr49)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr49)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr49)).FnumObjects--
__1975:
	;
	goto __1972
__1972:
	if 0 != 0 {
		goto __1971
	}
	goto __1973
__1973:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(*(*int32)(unsafe.Pointer(bp + 704)))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __1969
__1969:
	if 0 != 0 {
		goto __1968
	}
	goto __1970
__1970:
	;

__1976:
	;
	if !(1 == 0) {
		goto __1979
	}
	if !(1 != 0) {
		goto __1981
	}
	if !(1 > 0) {
		goto __1982
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __1983
__1982:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__1983:
	;
__1981:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __1980
__1979:
	if !(1 != 0) {
		goto __1984
	}
	if !(1 > 0) {
		goto __1986
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__1986:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1988
	case 2:
		goto __1989
	case 0:
		goto __1990
	}
	goto __1987
__1988:
	goto cleanup1_pushObjResultPtr
__1989:
	goto cleanup2_pushObjResultPtr
__1990:
	goto __1987
__1987:
	;
	goto __1985
__1984:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __1992
	case 2:
		goto __1993
	case 0:
		goto __1994
	}
	goto __1991
__1992:
	goto cleanup1
__1993:
	goto cleanup2
__1994:
	goto __1991
__1991:
	;
__1985:
	;
__1980:
	;
	goto __1977
__1977:
	if 0 != 0 {
		goto __1976
	}
	goto __1978
__1978:
	;

__264: // lindex with objc == 3
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))

	// Extract the desired list element.

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 712)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 720)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+720, bp+712)
	}() == TCL_OK &&
		(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr != uintptr(unsafe.Pointer(&XtclListType)) &&
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(value2Ptr + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(value2Ptr + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 800)) = int32(*(*int64)(unsafe.Pointer(value2Ptr + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, uintptr(0), value2Ptr, *(*int32)(unsafe.Pointer(bp + 720))-1, bp+800)
		}() == TCL_OK) {
		goto __1995
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FrefCount, 1) > 1) {
		goto __1996
	}
	goto __1997
__1996:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __1998
	}

	if !((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != XtclEmptyStringRep) {
		goto __2000
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes)
__2000:
	;
	(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength = -1
__2001:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr50 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr50)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr50)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __2004
	}
	XTclThreadFreeObj(tls, value2Ptr)
	goto __2005
__2004:
	*(*uintptr)(unsafe.Pointer(value2Ptr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr50)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr50)).FfirstObjPtr = value2Ptr
	(*AllocCache)(unsafe.Pointer(cachePtr50)).FnumObjects++
__2005:
	;
	goto __2002
__2002:
	if 0 != 0 {
		goto __2001
	}
	goto __2003
__2003:
	;
	goto __1999
__1998:
	XTclFreeObj(tls, value2Ptr)
__1999:
	;
__1997:
	;

	tosPtr -= 8
	pcAdjustment = 1
	goto lindexFastPath
__1995:
	;

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclLindexList(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), value2Ptr)
	if !!(*(*uintptr)(unsafe.Pointer(bp + 936)) != 0) {
		goto __2006
	}

	goto gotError
__2006:
	;

	// Stash the list element on the stack.

__2007:
	;
	if !(2 == 0) {
		goto __2010
	}
	if !(-1 != 0) {
		goto __2012
	}
	if !(-1 > 0) {
		goto __2013
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2014
__2013:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2014:
	;
__2012:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2011
__2010:
	if !(-1 != 0) {
		goto __2015
	}
	if !(-1 > 0) {
		goto __2017
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2017:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __2019
	case 2:
		goto __2020
	case 0:
		goto __2021
	}
	goto __2018
__2019:
	goto cleanup1_pushObjResultPtr
__2020:
	goto cleanup2_pushObjResultPtr
__2021:
	goto __2018
__2018:
	;
	goto __2016
__2015:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __2023
	case 2:
		goto __2024
	case 0:
		goto __2025
	}
	goto __2022
__2023:
	goto cleanup1
__2024:
	goto cleanup2
__2025:
	goto __2022
__2022:
	;
__2016:
	;
__2011:
	;
	goto __2008
__2008:
	if 0 != 0 {
		goto __2007
	}
	goto __2009
__2009:
	; // Already has the correct refCount

__265: // lindex with objc==3 and index in bytecode
	// stream

	// Pop the list and get the index.

	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3))))

	// Get the contents of the list, making sure that it really is a list
	// in the process.

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 712)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 720)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+720, bp+712)
	}() != TCL_OK) {
		goto __2026
	}

	goto gotError
__2026:
	;

	// Decode end-offset index values.

	*(*int32)(unsafe.Pointer(bp + 800 /* index */)) = XTclIndexDecode(tls, opnd, *(*int32)(unsafe.Pointer(bp + 720))-1)
	pcAdjustment = 5

lindexFastPath:
	if !(*(*int32)(unsafe.Pointer(bp + 800)) >= 0 && *(*int32)(unsafe.Pointer(bp + 800)) < *(*int32)(unsafe.Pointer(bp + 720))) {
		goto __2027
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)) + uintptr(*(*int32)(unsafe.Pointer(bp + 800 /* index */)))*8))
	goto __2028
__2027:
	;
__2029:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr51 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr51)).FnumObjects == 0
	}()) {
		goto __2032
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __2033
__2032:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr51)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr51)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr51)).FnumObjects--
__2033:
	;
	goto __2030
__2030:
	if 0 != 0 {
		goto __2029
	}
	goto __2031
__2031:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

__2028:
	;

__2034:
	;
	if !(1 == 0) {
		goto __2037
	}
	if !(1 != 0) {
		goto __2039
	}
	if !(1 > 0) {
		goto __2040
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2041
__2040:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2041:
	;
__2039:
	;
	pc += uintptr(pcAdjustment)
	goto cleanup0
	goto __2038
__2037:
	if !(1 != 0) {
		goto __2042
	}
	if !(1 > 0) {
		goto __2044
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2044:
	;
	pc += uintptr(pcAdjustment)
	switch 1 {
	case 1:
		goto __2046
	case 2:
		goto __2047
	case 0:
		goto __2048
	}
	goto __2045
__2046:
	goto cleanup1_pushObjResultPtr
__2047:
	goto cleanup2_pushObjResultPtr
__2048:
	goto __2045
__2045:
	;
	goto __2043
__2042:
	pc += uintptr(pcAdjustment)
	switch 1 {
	case 1:
		goto __2050
	case 2:
		goto __2051
	case 0:
		goto __2052
	}
	goto __2049
__2050:
	goto cleanup1
__2051:
	goto cleanup2
__2052:
	goto __2049
__2049:
	;
__2043:
	;
__2038:
	;
	goto __2035
__2035:
	if 0 != 0 {
		goto __2034
	}
	goto __2036
__2036:
	;

__266: // 'lindex' with multiple index args
	// Determine the count of index args.

	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	numIndices = opnd - 1

	// Do the 'lindex' operation.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclLindexFlat(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(numIndices)*8)),
		numIndices, tosPtr-uintptr(numIndices-1)*8)
	if !!(*(*uintptr)(unsafe.Pointer(bp + 936)) != 0) {
		goto __2053
	}

	goto gotError
__2053:
	;

	// Set result.

__2054:
	pc += uintptr(5)
	cleanup = opnd
	if !(-1 != 0) {
		goto __2057
	}
	if !(-1 > 0) {
		goto __2059
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2059:
	;
	goto cleanupV_pushObjResultPtr
	goto __2058
__2057:
	goto cleanupV
__2058:
	;
	goto __2055
__2055:
	if 0 != 0 {
		goto __2054
	}
	goto __2056
__2056:
	;

__267:
	// Lset with 3, 5, or more args. Get the number of index args.

	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	numIndices = opnd - 2

	// Get the old value of variable, and remove the stack ref. This is
	// safe because the variable still references the object; the ref
	// count will never go zero here - we can use the smaller macro
	// Tcl_DecrRefCount.

	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
__2060:
	_objPtr32 = *(*uintptr)(unsafe.Pointer(bp + 944))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr32)).FrefCount, 1) <= 1) {
		goto __2063
	}
	XTclFreeObj(tls, _objPtr32)
__2063:
	;
	goto __2061
__2061:
	if 0 != 0 {
		goto __2060
	}
	goto __2062
__2062:
	; // This one should be done here

	// Compute the new variable value.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclLsetFlat(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), numIndices,
		tosPtr-uintptr(numIndices)*8, *(*uintptr)(unsafe.Pointer(tosPtr)))
	if !!(*(*uintptr)(unsafe.Pointer(bp + 936)) != 0) {
		goto __2064
	}

	goto gotError
__2064:
	;

	// Set result.

__2065:
	pc += uintptr(5)
	cleanup = numIndices + 1
	if !(-1 != 0) {
		goto __2068
	}
	if !(-1 > 0) {
		goto __2070
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2070:
	;
	goto cleanupV_pushObjResultPtr
	goto __2069
__2068:
	goto cleanupV
__2069:
	;
	goto __2066
__2066:
	if 0 != 0 {
		goto __2065
	}
	goto __2067
__2067:
	;

__268: // 'lset' with 4 args
	// Get the old value of variable, and remove the stack ref. This is
	// safe because the variable still references the object; the ref
	// count will never go zero here - we can use the smaller macro
	// Tcl_DecrRefCount.

	objPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
__2071:
	_objPtr33 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr33)).FrefCount, 1) <= 1) {
		goto __2074
	}
	XTclFreeObj(tls, _objPtr33)
__2074:
	;
	goto __2072
__2072:
	if 0 != 0 {
		goto __2071
	}
	goto __2073
__2073:
	; // This one should be done here.

	// Get the new element value, and the index list.

	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))

	// Compute the new variable value.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclLsetList(tls, interp, objPtr, value2Ptr, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	if !!(*(*uintptr)(unsafe.Pointer(bp + 936)) != 0) {
		goto __2075
	}

	goto gotError
__2075:
	;

	// Set result.

__2076:
	;
	if !(2 == 0) {
		goto __2079
	}
	if !(-1 != 0) {
		goto __2081
	}
	if !(-1 > 0) {
		goto __2082
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2083
__2082:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2083:
	;
__2081:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2080
__2079:
	if !(-1 != 0) {
		goto __2084
	}
	if !(-1 > 0) {
		goto __2086
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2086:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __2088
	case 2:
		goto __2089
	case 0:
		goto __2090
	}
	goto __2087
__2088:
	goto cleanup1_pushObjResultPtr
__2089:
	goto cleanup2_pushObjResultPtr
__2090:
	goto __2087
__2087:
	;
	goto __2085
__2084:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __2092
	case 2:
		goto __2093
	case 0:
		goto __2094
	}
	goto __2091
__2092:
	goto cleanup1
__2093:
	goto cleanup2
__2094:
	goto __2091
__2091:
	;
__2085:
	;
__2080:
	;
	goto __2077
__2077:
	if 0 != 0 {
		goto __2076
	}
	goto __2078
__2078:
	;

__269: // lrange with objc==4 and both indices in
	// bytecode stream

	// Pop the list and get the indices.

	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)) = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3))))
	*(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)) = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(5))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(3))))

	// Get the contents of the list, making sure that it really is a list
	// in the process.

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 712)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 720)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+720, bp+712)
	}() != TCL_OK) {
		goto __2095
	}

	goto gotError
__2095:
	;

	// Skip a lot of work if we're about to throw the result away (common
	// with uses of [lassign]).

	if !(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(9)))) == INST_POP) {
		goto __2096
	}
__2097:
	;
	if !(1 == 0) {
		goto __2100
	}
	if !(0 != 0) {
		goto __2102
	}
	if !(0 > 0) {
		goto __2103
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2104
__2103:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2104:
	;
__2102:
	;
	pc += uintptr(10)
	goto cleanup0
	goto __2101
__2100:
	if !(0 != 0) {
		goto __2105
	}
	if !(0 > 0) {
		goto __2107
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2107:
	;
	pc += uintptr(10)
	switch 1 {
	case 1:
		goto __2109
	case 2:
		goto __2110
	case 0:
		goto __2111
	}
	goto __2108
__2109:
	goto cleanup1_pushObjResultPtr
__2110:
	goto cleanup2_pushObjResultPtr
__2111:
	goto __2108
__2108:
	;
	goto __2106
__2105:
	pc += uintptr(10)
	switch 1 {
	case 1:
		goto __2113
	case 2:
		goto __2114
	case 0:
		goto __2115
	}
	goto __2112
__2113:
	goto cleanup1
__2114:
	goto cleanup2
__2115:
	goto __2112
__2112:
	;
__2106:
	;
__2101:
	;
	goto __2098
__2098:
	if 0 != 0 {
		goto __2097
	}
	goto __2099
__2099:
	;
__2096:
	;

	// Every range of an empty list is an empty list
	if !(*(*int32)(unsafe.Pointer(bp + 720)) == 0) {
		goto __2116
	}
	// avoid return of not canonical list (e. g. spaces in string repr.)
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes) != 0) || !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength != 0)) {
		goto __2117
	}

__2118:
	;
	if !(0 == 0) {
		goto __2121
	}
	if !(0 != 0) {
		goto __2123
	}
	if !(0 > 0) {
		goto __2124
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2125
__2124:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2125:
	;
__2123:
	;
	pc += uintptr(9)
	goto cleanup0
	goto __2122
__2121:
	if !(0 != 0) {
		goto __2126
	}
	if !(0 > 0) {
		goto __2128
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2128:
	;
	pc += uintptr(9)
	switch 0 {
	case 1:
		goto __2130
	case 2:
		goto __2131
	case 0:
		goto __2132
	}
	goto __2129
__2130:
	goto cleanup1_pushObjResultPtr
__2131:
	goto cleanup2_pushObjResultPtr
__2132:
	goto __2129
__2129:
	;
	goto __2127
__2126:
	pc += uintptr(9)
	switch 0 {
	case 1:
		goto __2134
	case 2:
		goto __2135
	case 0:
		goto __2136
	}
	goto __2133
__2134:
	goto cleanup1
__2135:
	goto cleanup2
__2136:
	goto __2133
__2133:
	;
__2127:
	;
__2122:
	;
	goto __2119
__2119:
	if 0 != 0 {
		goto __2118
	}
	goto __2120
__2120:
	;
__2117:
	;
	goto emptyList
__2116:
	;

	// Decode index value operands.

	//
	// 	assert ( toIdx != TCL_INDEX_AFTER);
	// 	 *
	// 	 * Extra safety for legacy bytecodes:
	//
	if !(*(*int32)(unsafe.Pointer(bp + 832)) == 0x7fffffff) {
		goto __2137
	}
	*(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)) = -2
__2137:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 832)) == -1 || *(*int32)(unsafe.Pointer(bp + 828)) == 0x7fffffff) {
		goto __2138
	}
	goto emptyList
__2138:
	;
	*(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)) = XTclIndexDecode(tls, *(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)), *(*int32)(unsafe.Pointer(bp + 720))-1)
	if !(*(*int32)(unsafe.Pointer(bp + 832)) < 0) {
		goto __2139
	}
	goto emptyList
	goto __2140
__2139:
	if !(*(*int32)(unsafe.Pointer(bp + 832)) >= *(*int32)(unsafe.Pointer(bp + 720))) {
		goto __2141
	}
	*(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)) = *(*int32)(unsafe.Pointer(bp + 720)) - 1
__2141:
	;
__2140:
	;

	//
	// 	assert ( fromIdx != TCL_INDEX_BEFORE );
	// 	 *
	// 	 * Extra safety for legacy bytecodes:
	//
	if !(*(*int32)(unsafe.Pointer(bp + 828)) == -1) {
		goto __2142
	}
	*(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)) = 0
__2142:
	;

	*(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)) = XTclIndexDecode(tls, *(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)), *(*int32)(unsafe.Pointer(bp + 720))-1)
	if !(*(*int32)(unsafe.Pointer(bp + 828)) < 0) {
		goto __2143
	}
	*(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)) = 0
__2143:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 828)) <= *(*int32)(unsafe.Pointer(bp + 832))) {
		goto __2144
	}
	// Construct the subsquence list
	// unshared optimization
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __2146
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewListObj(tls, *(*int32)(unsafe.Pointer(bp + 832))-*(*int32)(unsafe.Pointer(bp + 828))+1, *(*uintptr)(unsafe.Pointer(bp + 712))+uintptr(*(*int32)(unsafe.Pointer(bp + 828)))*8)
	goto __2147
__2146:
	if !(*(*int32)(unsafe.Pointer(bp + 832)) != *(*int32)(unsafe.Pointer(bp + 720))-1) {
		goto __2148
	}
	XTcl_ListObjReplace(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), *(*int32)(unsafe.Pointer(bp + 832))+1, 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))),
		0, uintptr(0))
__2148:
	;
	XTcl_ListObjReplace(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), 0, *(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)), 0, uintptr(0))

__2149:
	;
	if !(0 == 0) {
		goto __2152
	}
	if !(0 != 0) {
		goto __2154
	}
	if !(0 > 0) {
		goto __2155
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2156
__2155:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2156:
	;
__2154:
	;
	pc += uintptr(9)
	goto cleanup0
	goto __2153
__2152:
	if !(0 != 0) {
		goto __2157
	}
	if !(0 > 0) {
		goto __2159
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2159:
	;
	pc += uintptr(9)
	switch 0 {
	case 1:
		goto __2161
	case 2:
		goto __2162
	case 0:
		goto __2163
	}
	goto __2160
__2161:
	goto cleanup1_pushObjResultPtr
__2162:
	goto cleanup2_pushObjResultPtr
__2163:
	goto __2160
__2160:
	;
	goto __2158
__2157:
	pc += uintptr(9)
	switch 0 {
	case 1:
		goto __2165
	case 2:
		goto __2166
	case 0:
		goto __2167
	}
	goto __2164
__2165:
	goto cleanup1
__2166:
	goto cleanup2
__2167:
	goto __2164
__2164:
	;
__2158:
	;
__2153:
	;
	goto __2150
__2150:
	if 0 != 0 {
		goto __2149
	}
	goto __2151
__2151:
	;
__2147:
	;
	goto __2145
__2144:
emptyList:
	;
__2168:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr52 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr52)).FnumObjects == 0
	}()) {
		goto __2171
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __2172
__2171:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr52)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr52)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr52)).FnumObjects--
__2172:
	;
	goto __2169
__2169:
	if 0 != 0 {
		goto __2168
	}
	goto __2170
__2170:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

__2145:
	;

__2173:
	;
	if !(1 == 0) {
		goto __2176
	}
	if !(1 != 0) {
		goto __2178
	}
	if !(1 > 0) {
		goto __2179
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2180
__2179:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2180:
	;
__2178:
	;
	pc += uintptr(9)
	goto cleanup0
	goto __2177
__2176:
	if !(1 != 0) {
		goto __2181
	}
	if !(1 > 0) {
		goto __2183
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2183:
	;
	pc += uintptr(9)
	switch 1 {
	case 1:
		goto __2185
	case 2:
		goto __2186
	case 0:
		goto __2187
	}
	goto __2184
__2185:
	goto cleanup1_pushObjResultPtr
__2186:
	goto cleanup2_pushObjResultPtr
__2187:
	goto __2184
__2184:
	;
	goto __2182
__2181:
	pc += uintptr(9)
	switch 1 {
	case 1:
		goto __2189
	case 2:
		goto __2190
	case 0:
		goto __2191
	}
	goto __2188
__2189:
	goto cleanup1
__2190:
	goto cleanup2
__2191:
	goto __2188
__2188:
	;
__2182:
	;
__2177:
	;
	goto __2174
__2174:
	if 0 != 0 {
		goto __2173
	}
	goto __2175
__2175:
	;

__270:
__271: // Basic list containment operators.
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))

	s1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 804)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+804)
	}()

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 704)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(value2Ptr + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, value2Ptr, bp+704)
	}() != TCL_OK) {
		goto __2192
	}

	goto gotError
__2192:
	;
	match = 0
	if !(*(*int32)(unsafe.Pointer(bp + 704)) > 0) {
		goto __2193
	}
	i4 = 0

	// An empty list doesn't match anything.

__2194:
	XTcl_ListObjIndex(tls, uintptr(0), value2Ptr, i4, bp+808)
	if !(*(*uintptr)(unsafe.Pointer(bp + 808)) != uintptr(0)) {
		goto __2197
	}
	s2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 808)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 816)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 808)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 808)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 808)), bp+816)
	}()
	goto __2198
__2197:
	s2 = ts + 2046 /* "" */
	*(*int32)(unsafe.Pointer(bp + 816 /* s2len */)) = 0
__2198:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 804)) == *(*int32)(unsafe.Pointer(bp + 816))) {
		goto __2199
	}
	match = libc.Bool32(libc.Xmemcmp(tls, s1, s2, uint64(*(*int32)(unsafe.Pointer(bp + 804)))) == 0)
__2199:
	;
	i4++
	goto __2195
__2195:
	if i4 < *(*int32)(unsafe.Pointer(bp + 704)) && match == 0 {
		goto __2194
	}
	goto __2196
__2196:
	;
__2193:
	;

	if !(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_LIST_NOT_IN) {
		goto __2200
	}
	match = libc.BoolInt32(!(match != 0))
__2200:
	;

	// Peep-hole optimisation: if you're about to jump, do jump from here.
	// We're saving the effort of pushing a boolean value only to pop it
	// for branching.

__2201:
	pc += uintptr(1)
	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_JUMP_FALSE1:
		goto __2205
	case INST_JUMP_TRUE1:
		goto __2206
	case INST_JUMP_FALSE4:
		goto __2207
	case INST_JUMP_TRUE4:
		goto __2208
	default:
		goto __2209
	}
	goto __2204
__2205:
__2210:
	;
	if !(2 == 0) {
		goto __2213
	}
	if !(0 != 0) {
		goto __2215
	}
	if !(0 > 0) {
		goto __2216
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2217
__2216:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2217:
	;
__2215:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	goto cleanup0
	goto __2214
__2213:
	if !(0 != 0) {
		goto __2218
	}
	if !(0 > 0) {
		goto __2220
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2220:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 2 {
	case 1:
		goto __2222
	case 2:
		goto __2223
	case 0:
		goto __2224
	}
	goto __2221
__2222:
	goto cleanup1_pushObjResultPtr
__2223:
	goto cleanup2_pushObjResultPtr
__2224:
	goto __2221
__2221:
	;
	goto __2219
__2218:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 2 {
	case 1:
		goto __2226
	case 2:
		goto __2227
	case 0:
		goto __2228
	}
	goto __2225
__2226:
	goto cleanup1
__2227:
	goto cleanup2
__2228:
	goto __2225
__2225:
	;
__2219:
	;
__2214:
	;
	goto __2211
__2211:
	if 0 != 0 {
		goto __2210
	}
	goto __2212
__2212:
	;
	goto __2204
__2206:
__2229:
	;
	if !(2 == 0) {
		goto __2232
	}
	if !(0 != 0) {
		goto __2234
	}
	if !(0 > 0) {
		goto __2235
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2236
__2235:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2236:
	;
__2234:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	goto cleanup0
	goto __2233
__2232:
	if !(0 != 0) {
		goto __2237
	}
	if !(0 > 0) {
		goto __2239
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2239:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 2 {
	case 1:
		goto __2241
	case 2:
		goto __2242
	case 0:
		goto __2243
	}
	goto __2240
__2241:
	goto cleanup1_pushObjResultPtr
__2242:
	goto cleanup2_pushObjResultPtr
__2243:
	goto __2240
__2240:
	;
	goto __2238
__2237:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 2 {
	case 1:
		goto __2245
	case 2:
		goto __2246
	case 0:
		goto __2247
	}
	goto __2244
__2245:
	goto cleanup1
__2246:
	goto cleanup2
__2247:
	goto __2244
__2244:
	;
__2238:
	;
__2233:
	;
	goto __2230
__2230:
	if 0 != 0 {
		goto __2229
	}
	goto __2231
__2231:
	;
	goto __2204
__2207:
__2248:
	;
	if !(2 == 0) {
		goto __2251
	}
	if !(0 != 0) {
		goto __2253
	}
	if !(0 > 0) {
		goto __2254
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2255
__2254:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2255:
	;
__2253:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	goto cleanup0
	goto __2252
__2251:
	if !(0 != 0) {
		goto __2256
	}
	if !(0 > 0) {
		goto __2258
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2258:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 2 {
	case 1:
		goto __2260
	case 2:
		goto __2261
	case 0:
		goto __2262
	}
	goto __2259
__2260:
	goto cleanup1_pushObjResultPtr
__2261:
	goto cleanup2_pushObjResultPtr
__2262:
	goto __2259
__2259:
	;
	goto __2257
__2256:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 2 {
	case 1:
		goto __2264
	case 2:
		goto __2265
	case 0:
		goto __2266
	}
	goto __2263
__2264:
	goto cleanup1
__2265:
	goto cleanup2
__2266:
	goto __2263
__2263:
	;
__2257:
	;
__2252:
	;
	goto __2249
__2249:
	if 0 != 0 {
		goto __2248
	}
	goto __2250
__2250:
	;
	goto __2204
__2208:
__2267:
	;
	if !(2 == 0) {
		goto __2270
	}
	if !(0 != 0) {
		goto __2272
	}
	if !(0 > 0) {
		goto __2273
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2274
__2273:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2274:
	;
__2272:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	goto cleanup0
	goto __2271
__2270:
	if !(0 != 0) {
		goto __2275
	}
	if !(0 > 0) {
		goto __2277
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2277:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 2 {
	case 1:
		goto __2279
	case 2:
		goto __2280
	case 0:
		goto __2281
	}
	goto __2278
__2279:
	goto cleanup1_pushObjResultPtr
__2280:
	goto cleanup2_pushObjResultPtr
__2281:
	goto __2278
__2278:
	;
	goto __2276
__2275:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 2 {
	case 1:
		goto __2283
	case 2:
		goto __2284
	case 0:
		goto __2285
	}
	goto __2282
__2283:
	goto cleanup1
__2284:
	goto cleanup2
__2285:
	goto __2282
__2282:
	;
__2276:
	;
__2271:
	;
	goto __2268
__2268:
	if 0 != 0 {
		goto __2267
	}
	goto __2269
__2269:
	;
	goto __2204
__2209:
	if !(match < 0) {
		goto __2286
	}
__2288:
	;
__2291:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr53 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr53)).FnumObjects == 0
	}()) {
		goto __2294
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __2295
__2294:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr53)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr53)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr53)).FnumObjects--
__2295:
	;
	goto __2292
__2292:
	if 0 != 0 {
		goto __2291
	}
	goto __2293
__2293:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __2289
__2289:
	if 0 != 0 {
		goto __2288
	}
	goto __2290
__2290:
	;
	goto __2287
__2286:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(libc.Bool32(match > 0))*8))
__2287:
	;
__2296:
	;
	if !(2 == 0) {
		goto __2299
	}
	if !(1 != 0) {
		goto __2301
	}
	if !(1 > 0) {
		goto __2302
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2303
__2302:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2303:
	;
__2301:
	;
	pc += uintptr(0)
	goto cleanup0
	goto __2300
__2299:
	if !(1 != 0) {
		goto __2304
	}
	if !(1 > 0) {
		goto __2306
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2306:
	;
	pc += uintptr(0)
	switch 2 {
	case 1:
		goto __2308
	case 2:
		goto __2309
	case 0:
		goto __2310
	}
	goto __2307
__2308:
	goto cleanup1_pushObjResultPtr
__2309:
	goto cleanup2_pushObjResultPtr
__2310:
	goto __2307
__2307:
	;
	goto __2305
__2304:
	pc += uintptr(0)
	switch 2 {
	case 1:
		goto __2312
	case 2:
		goto __2313
	case 0:
		goto __2314
	}
	goto __2311
__2312:
	goto cleanup1
__2313:
	goto cleanup2
__2314:
	goto __2311
__2311:
	;
__2305:
	;
__2300:
	;
	goto __2297
__2297:
	if 0 != 0 {
		goto __2296
	}
	goto __2298
__2298:
	;
	goto __2204
__2204:
	;
	goto __2202
__2202:
	if 0 != 0 {
		goto __2201
	}
	goto __2203
__2203:
	;

__272:
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __2315
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	if !(XTcl_ListObjAppendList(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 936)),
		value2Ptr) != TCL_OK) {
		goto __2317
	}

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount, 1) > 1) {
		goto __2318
	}
	goto __2319
__2318:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __2320
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes != XtclEmptyStringRep) {
		goto __2322
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes)
__2322:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = -1
__2323:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr54 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr54)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr54)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __2326
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936)))
	goto __2327
__2326:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr54)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr54)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 936))
	(*AllocCache)(unsafe.Pointer(cachePtr54)).FnumObjects++
__2327:
	;
	goto __2324
__2324:
	if 0 != 0 {
		goto __2323
	}
	goto __2325
__2325:
	;
	goto __2321
__2320:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))
__2321:
	;
__2319:
	;

	goto gotError
__2317:
	;

__2328:
	;
	if !(2 == 0) {
		goto __2331
	}
	if !(1 != 0) {
		goto __2333
	}
	if !(1 > 0) {
		goto __2334
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2335
__2334:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2335:
	;
__2333:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2332
__2331:
	if !(1 != 0) {
		goto __2336
	}
	if !(1 > 0) {
		goto __2338
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2338:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __2340
	case 2:
		goto __2341
	case 0:
		goto __2342
	}
	goto __2339
__2340:
	goto cleanup1_pushObjResultPtr
__2341:
	goto cleanup2_pushObjResultPtr
__2342:
	goto __2339
__2339:
	;
	goto __2337
__2336:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __2344
	case 2:
		goto __2345
	case 0:
		goto __2346
	}
	goto __2343
__2344:
	goto cleanup1
__2345:
	goto cleanup2
__2346:
	goto __2343
__2343:
	;
__2337:
	;
__2332:
	;
	goto __2329
__2329:
	if 0 != 0 {
		goto __2328
	}
	goto __2330
__2330:
	;
	goto __2316
__2315:
	if !(XTcl_ListObjAppendList(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944)), value2Ptr) != TCL_OK) {
		goto __2347
	}

	goto gotError
__2347:
	;

__2348:
	;
	if !(1 == 0) {
		goto __2351
	}
	if !(0 != 0) {
		goto __2353
	}
	if !(0 > 0) {
		goto __2354
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2355
__2354:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2355:
	;
__2353:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2352
__2351:
	if !(0 != 0) {
		goto __2356
	}
	if !(0 > 0) {
		goto __2358
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2358:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2360
	case 2:
		goto __2361
	case 0:
		goto __2362
	}
	goto __2359
__2360:
	goto cleanup1_pushObjResultPtr
__2361:
	goto cleanup2_pushObjResultPtr
__2362:
	goto __2359
__2359:
	;
	goto __2357
__2356:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2364
	case 2:
		goto __2365
	case 0:
		goto __2366
	}
	goto __2363
__2364:
	goto cleanup1
__2365:
	goto cleanup2
__2366:
	goto __2363
__2363:
	;
__2357:
	;
__2352:
	;
	goto __2349
__2349:
	if 0 != 0 {
		goto __2348
	}
	goto __2350
__2350:
	;
__2316:
	;

	//	   End of INST_LIST and related instructions.
	// -----------------------------------------------------------------
	//	   Start of string-related instructions.

__273:
__274: // String (in)equality check
__275: // String compare.
stringCompare:
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))

	checkEq = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_EQ || int32(*(*uint8)(unsafe.Pointer(pc))) == INST_NEQ ||
		int32(*(*uint8)(unsafe.Pointer(pc))) == INST_STR_EQ || int32(*(*uint8)(unsafe.Pointer(pc))) == INST_STR_NEQ)
	match = XTclStringCmp(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), value2Ptr, checkEq, 0, -1)

	// Make sure only -1,0,1 is returned
	// TODO: consider peephole opt.

	if !(int32(*(*uint8)(unsafe.Pointer(pc))) != INST_STR_CMP) {
		goto __2367
	}
	// Take care of the opcodes that goto'ed into here.

	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_STR_EQ:
		goto __2369
	case INST_EQ:
		goto __2370
	case INST_STR_NEQ:
		goto __2371
	case INST_NEQ:
		goto __2372
	case INST_LT:
		goto __2373
	case INST_GT:
		goto __2374
	case INST_LE:
		goto __2375
	case INST_GE:
		goto __2376
	}
	goto __2368
__2369:
__2370:
	match = libc.Bool32(match == 0)
	goto __2368
__2371:
__2372:
	match = libc.Bool32(match != 0)
	goto __2368
__2373:
	match = libc.Bool32(match < 0)
	goto __2368
__2374:
	match = libc.Bool32(match > 0)
	goto __2368
__2375:
	match = libc.Bool32(match <= 0)
	goto __2368
__2376:
	match = libc.Bool32(match >= 0)
	goto __2368
__2368:
	;
__2367:
	;

__2377:
	pc += uintptr(1)
	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_JUMP_FALSE1:
		goto __2381
	case INST_JUMP_TRUE1:
		goto __2382
	case INST_JUMP_FALSE4:
		goto __2383
	case INST_JUMP_TRUE4:
		goto __2384
	default:
		goto __2385
	}
	goto __2380
__2381:
__2386:
	;
	if !(2 == 0) {
		goto __2389
	}
	if !(0 != 0) {
		goto __2391
	}
	if !(0 > 0) {
		goto __2392
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2393
__2392:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2393:
	;
__2391:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	goto cleanup0
	goto __2390
__2389:
	if !(0 != 0) {
		goto __2394
	}
	if !(0 > 0) {
		goto __2396
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2396:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 2 {
	case 1:
		goto __2398
	case 2:
		goto __2399
	case 0:
		goto __2400
	}
	goto __2397
__2398:
	goto cleanup1_pushObjResultPtr
__2399:
	goto cleanup2_pushObjResultPtr
__2400:
	goto __2397
__2397:
	;
	goto __2395
__2394:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 2 {
	case 1:
		goto __2402
	case 2:
		goto __2403
	case 0:
		goto __2404
	}
	goto __2401
__2402:
	goto cleanup1
__2403:
	goto cleanup2
__2404:
	goto __2401
__2401:
	;
__2395:
	;
__2390:
	;
	goto __2387
__2387:
	if 0 != 0 {
		goto __2386
	}
	goto __2388
__2388:
	;
	goto __2380
__2382:
__2405:
	;
	if !(2 == 0) {
		goto __2408
	}
	if !(0 != 0) {
		goto __2410
	}
	if !(0 > 0) {
		goto __2411
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2412
__2411:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2412:
	;
__2410:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	goto cleanup0
	goto __2409
__2408:
	if !(0 != 0) {
		goto __2413
	}
	if !(0 > 0) {
		goto __2415
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2415:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 2 {
	case 1:
		goto __2417
	case 2:
		goto __2418
	case 0:
		goto __2419
	}
	goto __2416
__2417:
	goto cleanup1_pushObjResultPtr
__2418:
	goto cleanup2_pushObjResultPtr
__2419:
	goto __2416
__2416:
	;
	goto __2414
__2413:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 2 {
	case 1:
		goto __2421
	case 2:
		goto __2422
	case 0:
		goto __2423
	}
	goto __2420
__2421:
	goto cleanup1
__2422:
	goto cleanup2
__2423:
	goto __2420
__2420:
	;
__2414:
	;
__2409:
	;
	goto __2406
__2406:
	if 0 != 0 {
		goto __2405
	}
	goto __2407
__2407:
	;
	goto __2380
__2383:
__2424:
	;
	if !(2 == 0) {
		goto __2427
	}
	if !(0 != 0) {
		goto __2429
	}
	if !(0 > 0) {
		goto __2430
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2431
__2430:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2431:
	;
__2429:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	goto cleanup0
	goto __2428
__2427:
	if !(0 != 0) {
		goto __2432
	}
	if !(0 > 0) {
		goto __2434
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2434:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 2 {
	case 1:
		goto __2436
	case 2:
		goto __2437
	case 0:
		goto __2438
	}
	goto __2435
__2436:
	goto cleanup1_pushObjResultPtr
__2437:
	goto cleanup2_pushObjResultPtr
__2438:
	goto __2435
__2435:
	;
	goto __2433
__2432:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 2 {
	case 1:
		goto __2440
	case 2:
		goto __2441
	case 0:
		goto __2442
	}
	goto __2439
__2440:
	goto cleanup1
__2441:
	goto cleanup2
__2442:
	goto __2439
__2439:
	;
__2433:
	;
__2428:
	;
	goto __2425
__2425:
	if 0 != 0 {
		goto __2424
	}
	goto __2426
__2426:
	;
	goto __2380
__2384:
__2443:
	;
	if !(2 == 0) {
		goto __2446
	}
	if !(0 != 0) {
		goto __2448
	}
	if !(0 > 0) {
		goto __2449
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2450
__2449:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2450:
	;
__2448:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	goto cleanup0
	goto __2447
__2446:
	if !(0 != 0) {
		goto __2451
	}
	if !(0 > 0) {
		goto __2453
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2453:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 2 {
	case 1:
		goto __2455
	case 2:
		goto __2456
	case 0:
		goto __2457
	}
	goto __2454
__2455:
	goto cleanup1_pushObjResultPtr
__2456:
	goto cleanup2_pushObjResultPtr
__2457:
	goto __2454
__2454:
	;
	goto __2452
__2451:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 2 {
	case 1:
		goto __2459
	case 2:
		goto __2460
	case 0:
		goto __2461
	}
	goto __2458
__2459:
	goto cleanup1
__2460:
	goto cleanup2
__2461:
	goto __2458
__2458:
	;
__2452:
	;
__2447:
	;
	goto __2444
__2444:
	if 0 != 0 {
		goto __2443
	}
	goto __2445
__2445:
	;
	goto __2380
__2385:
	if !(match < 0) {
		goto __2462
	}
__2464:
	;
__2467:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr55 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr55)).FnumObjects == 0
	}()) {
		goto __2470
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __2471
__2470:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr55)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr55)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr55)).FnumObjects--
__2471:
	;
	goto __2468
__2468:
	if 0 != 0 {
		goto __2467
	}
	goto __2469
__2469:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __2465
__2465:
	if 0 != 0 {
		goto __2464
	}
	goto __2466
__2466:
	;
	goto __2463
__2462:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(libc.Bool32(match > 0))*8))
__2463:
	;
__2472:
	;
	if !(2 == 0) {
		goto __2475
	}
	if !(1 != 0) {
		goto __2477
	}
	if !(1 > 0) {
		goto __2478
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2479
__2478:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2479:
	;
__2477:
	;
	pc += uintptr(0)
	goto cleanup0
	goto __2476
__2475:
	if !(1 != 0) {
		goto __2480
	}
	if !(1 > 0) {
		goto __2482
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2482:
	;
	pc += uintptr(0)
	switch 2 {
	case 1:
		goto __2484
	case 2:
		goto __2485
	case 0:
		goto __2486
	}
	goto __2483
__2484:
	goto cleanup1_pushObjResultPtr
__2485:
	goto cleanup2_pushObjResultPtr
__2486:
	goto __2483
__2483:
	;
	goto __2481
__2480:
	pc += uintptr(0)
	switch 2 {
	case 1:
		goto __2488
	case 2:
		goto __2489
	case 0:
		goto __2490
	}
	goto __2487
__2488:
	goto cleanup1
__2489:
	goto cleanup2
__2490:
	goto __2487
__2487:
	;
__2481:
	;
__2476:
	;
	goto __2473
__2473:
	if 0 != 0 {
		goto __2472
	}
	goto __2474
__2474:
	;
	goto __2380
__2380:
	;
	goto __2378
__2378:
	if 0 != 0 {
		goto __2377
	}
	goto __2379
__2379:
	;

__276:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__2491:
	;
__2494:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr56 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr56)).FnumObjects == 0
	}()) {
		goto __2497
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __2498
__2497:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr56)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr56)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr56)).FnumObjects--
__2498:
	;
	goto __2495
__2495:
	if 0 != 0 {
		goto __2494
	}
	goto __2496
__2496:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(*(*int32)(unsafe.Pointer(bp + 704)))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __2492
__2492:
	if 0 != 0 {
		goto __2491
	}
	goto __2493
__2493:
	;

__2499:
	;
	if !(1 == 0) {
		goto __2502
	}
	if !(1 != 0) {
		goto __2504
	}
	if !(1 > 0) {
		goto __2505
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2506
__2505:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2506:
	;
__2504:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2503
__2502:
	if !(1 != 0) {
		goto __2507
	}
	if !(1 > 0) {
		goto __2509
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2509:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2511
	case 2:
		goto __2512
	case 0:
		goto __2513
	}
	goto __2510
__2511:
	goto cleanup1_pushObjResultPtr
__2512:
	goto cleanup2_pushObjResultPtr
__2513:
	goto __2510
__2510:
	;
	goto __2508
__2507:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2515
	case 2:
		goto __2516
	case 0:
		goto __2517
	}
	goto __2514
__2515:
	goto cleanup1
__2516:
	goto cleanup2
__2517:
	goto __2514
__2514:
	;
__2508:
	;
__2503:
	;
	goto __2500
__2500:
	if 0 != 0 {
		goto __2499
	}
	goto __2501
__2501:
	;

__277:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __2518
	}
	s1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 704)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+704)
	}()
__2520:
	;
__2523:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr57 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr57)).FnumObjects == 0
	}()) {
		goto __2526
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __2527
__2526:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr57)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr57)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr57)).FnumObjects--
__2527:
	;
	goto __2524
__2524:
	if 0 != 0 {
		goto __2523
	}
	goto __2525
__2525:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	if !(*(*int32)(unsafe.Pointer(bp + 704)) == 0) {
		goto __2528
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	goto __2529
__2528:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 704))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes, s1, uint64(*(*int32)(unsafe.Pointer(bp + 704))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes + uintptr(*(*int32)(unsafe.Pointer(bp + 704))))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = *(*int32)(unsafe.Pointer(bp + 704))
__2529:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	goto __2521
__2521:
	if 0 != 0 {
		goto __2520
	}
	goto __2522
__2522:
	;
	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = XTcl_UtfToUpper(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 936)))
	}())
	XTcl_SetObjLength(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)), *(*int32)(unsafe.Pointer(bp + 704 /* length */)))

__2530:
	;
	if !(1 == 0) {
		goto __2533
	}
	if !(1 != 0) {
		goto __2535
	}
	if !(1 > 0) {
		goto __2536
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2537
__2536:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2537:
	;
__2535:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2534
__2533:
	if !(1 != 0) {
		goto __2538
	}
	if !(1 > 0) {
		goto __2540
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2540:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2542
	case 2:
		goto __2543
	case 0:
		goto __2544
	}
	goto __2541
__2542:
	goto cleanup1_pushObjResultPtr
__2543:
	goto cleanup2_pushObjResultPtr
__2544:
	goto __2541
__2541:
	;
	goto __2539
__2538:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2546
	case 2:
		goto __2547
	case 0:
		goto __2548
	}
	goto __2545
__2546:
	goto cleanup1
__2547:
	goto cleanup2
__2548:
	goto __2545
__2545:
	;
__2539:
	;
__2534:
	;
	goto __2531
__2531:
	if 0 != 0 {
		goto __2530
	}
	goto __2532
__2532:
	;
	goto __2519
__2518:
	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = XTcl_UtfToUpper(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 944)))
	}())
	XTcl_SetObjLength(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), *(*int32)(unsafe.Pointer(bp + 704 /* length */)))
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr != uintptr(0)) {
		goto __2549
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __2550
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr)).FfreeIntRepProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__2550:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr = uintptr(0)
__2549:
	;

__2551:
	;
	if !(0 == 0) {
		goto __2554
	}
	if !(0 != 0) {
		goto __2556
	}
	if !(0 > 0) {
		goto __2557
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2558
__2557:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2558:
	;
__2556:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2555
__2554:
	if !(0 != 0) {
		goto __2559
	}
	if !(0 > 0) {
		goto __2561
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2561:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2563
	case 2:
		goto __2564
	case 0:
		goto __2565
	}
	goto __2562
__2563:
	goto cleanup1_pushObjResultPtr
__2564:
	goto cleanup2_pushObjResultPtr
__2565:
	goto __2562
__2562:
	;
	goto __2560
__2559:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2567
	case 2:
		goto __2568
	case 0:
		goto __2569
	}
	goto __2566
__2567:
	goto cleanup1
__2568:
	goto cleanup2
__2569:
	goto __2566
__2566:
	;
__2560:
	;
__2555:
	;
	goto __2552
__2552:
	if 0 != 0 {
		goto __2551
	}
	goto __2553
__2553:
	;
__2519:
	;
__278:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __2570
	}
	s1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 704)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+704)
	}()
__2572:
	;
__2575:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr58 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr58)).FnumObjects == 0
	}()) {
		goto __2578
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __2579
__2578:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr58)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr58)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr58)).FnumObjects--
__2579:
	;
	goto __2576
__2576:
	if 0 != 0 {
		goto __2575
	}
	goto __2577
__2577:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	if !(*(*int32)(unsafe.Pointer(bp + 704)) == 0) {
		goto __2580
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	goto __2581
__2580:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 704))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes, s1, uint64(*(*int32)(unsafe.Pointer(bp + 704))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes + uintptr(*(*int32)(unsafe.Pointer(bp + 704))))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = *(*int32)(unsafe.Pointer(bp + 704))
__2581:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	goto __2573
__2573:
	if 0 != 0 {
		goto __2572
	}
	goto __2574
__2574:
	;
	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = XTcl_UtfToLower(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 936)))
	}())
	XTcl_SetObjLength(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)), *(*int32)(unsafe.Pointer(bp + 704 /* length */)))

__2582:
	;
	if !(1 == 0) {
		goto __2585
	}
	if !(1 != 0) {
		goto __2587
	}
	if !(1 > 0) {
		goto __2588
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2589
__2588:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2589:
	;
__2587:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2586
__2585:
	if !(1 != 0) {
		goto __2590
	}
	if !(1 > 0) {
		goto __2592
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2592:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2594
	case 2:
		goto __2595
	case 0:
		goto __2596
	}
	goto __2593
__2594:
	goto cleanup1_pushObjResultPtr
__2595:
	goto cleanup2_pushObjResultPtr
__2596:
	goto __2593
__2593:
	;
	goto __2591
__2590:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2598
	case 2:
		goto __2599
	case 0:
		goto __2600
	}
	goto __2597
__2598:
	goto cleanup1
__2599:
	goto cleanup2
__2600:
	goto __2597
__2597:
	;
__2591:
	;
__2586:
	;
	goto __2583
__2583:
	if 0 != 0 {
		goto __2582
	}
	goto __2584
__2584:
	;
	goto __2571
__2570:
	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = XTcl_UtfToLower(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 944)))
	}())
	XTcl_SetObjLength(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), *(*int32)(unsafe.Pointer(bp + 704 /* length */)))
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr != uintptr(0)) {
		goto __2601
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __2602
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr)).FfreeIntRepProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__2602:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr = uintptr(0)
__2601:
	;

__2603:
	;
	if !(0 == 0) {
		goto __2606
	}
	if !(0 != 0) {
		goto __2608
	}
	if !(0 > 0) {
		goto __2609
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2610
__2609:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2610:
	;
__2608:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2607
__2606:
	if !(0 != 0) {
		goto __2611
	}
	if !(0 > 0) {
		goto __2613
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2613:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2615
	case 2:
		goto __2616
	case 0:
		goto __2617
	}
	goto __2614
__2615:
	goto cleanup1_pushObjResultPtr
__2616:
	goto cleanup2_pushObjResultPtr
__2617:
	goto __2614
__2614:
	;
	goto __2612
__2611:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2619
	case 2:
		goto __2620
	case 0:
		goto __2621
	}
	goto __2618
__2619:
	goto cleanup1
__2620:
	goto cleanup2
__2621:
	goto __2618
__2618:
	;
__2612:
	;
__2607:
	;
	goto __2604
__2604:
	if 0 != 0 {
		goto __2603
	}
	goto __2605
__2605:
	;
__2571:
	;
__279:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __2622
	}
	s1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 704)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+704)
	}()
__2624:
	;
__2627:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr59 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr59)).FnumObjects == 0
	}()) {
		goto __2630
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __2631
__2630:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr59)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr59)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr59)).FnumObjects--
__2631:
	;
	goto __2628
__2628:
	if 0 != 0 {
		goto __2627
	}
	goto __2629
__2629:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	if !(*(*int32)(unsafe.Pointer(bp + 704)) == 0) {
		goto __2632
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	goto __2633
__2632:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 704))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes, s1, uint64(*(*int32)(unsafe.Pointer(bp + 704))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes + uintptr(*(*int32)(unsafe.Pointer(bp + 704))))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = *(*int32)(unsafe.Pointer(bp + 704))
__2633:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	goto __2625
__2625:
	if 0 != 0 {
		goto __2624
	}
	goto __2626
__2626:
	;
	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = XTcl_UtfToTitle(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 936)))
	}())
	XTcl_SetObjLength(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)), *(*int32)(unsafe.Pointer(bp + 704 /* length */)))

__2634:
	;
	if !(1 == 0) {
		goto __2637
	}
	if !(1 != 0) {
		goto __2639
	}
	if !(1 > 0) {
		goto __2640
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2641
__2640:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2641:
	;
__2639:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2638
__2637:
	if !(1 != 0) {
		goto __2642
	}
	if !(1 > 0) {
		goto __2644
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2644:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2646
	case 2:
		goto __2647
	case 0:
		goto __2648
	}
	goto __2645
__2646:
	goto cleanup1_pushObjResultPtr
__2647:
	goto cleanup2_pushObjResultPtr
__2648:
	goto __2645
__2645:
	;
	goto __2643
__2642:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2650
	case 2:
		goto __2651
	case 0:
		goto __2652
	}
	goto __2649
__2650:
	goto cleanup1
__2651:
	goto cleanup2
__2652:
	goto __2649
__2649:
	;
__2643:
	;
__2638:
	;
	goto __2635
__2635:
	if 0 != 0 {
		goto __2634
	}
	goto __2636
__2636:
	;
	goto __2623
__2622:
	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = XTcl_UtfToTitle(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 944)))
	}())
	XTcl_SetObjLength(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), *(*int32)(unsafe.Pointer(bp + 704 /* length */)))
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr != uintptr(0)) {
		goto __2653
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __2654
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr)).FfreeIntRepProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__2654:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr = uintptr(0)
__2653:
	;

__2655:
	;
	if !(0 == 0) {
		goto __2658
	}
	if !(0 != 0) {
		goto __2660
	}
	if !(0 > 0) {
		goto __2661
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2662
__2661:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2662:
	;
__2660:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2659
__2658:
	if !(0 != 0) {
		goto __2663
	}
	if !(0 > 0) {
		goto __2665
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2665:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2667
	case 2:
		goto __2668
	case 0:
		goto __2669
	}
	goto __2666
__2667:
	goto cleanup1_pushObjResultPtr
__2668:
	goto cleanup2_pushObjResultPtr
__2669:
	goto __2666
__2666:
	;
	goto __2664
__2663:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2671
	case 2:
		goto __2672
	case 0:
		goto __2673
	}
	goto __2670
__2671:
	goto cleanup1
__2672:
	goto cleanup2
__2673:
	goto __2670
__2670:
	;
__2664:
	;
__2659:
	;
	goto __2656
__2656:
	if 0 != 0 {
		goto __2655
	}
	goto __2657
__2657:
	;
__2623:
	;

__280:
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))

	// Get char length to calulate what 'end' means.

	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(value2Ptr + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(value2Ptr + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 800)) = int32(*(*int64)(unsafe.Pointer(value2Ptr + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, value2Ptr, *(*int32)(unsafe.Pointer(bp + 704))-1, bp+800)
	}() != TCL_OK) {
		goto __2674
	}

	goto gotError
__2674:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 800)) < 0 || *(*int32)(unsafe.Pointer(bp + 800)) >= *(*int32)(unsafe.Pointer(bp + 704))) {
		goto __2675
	}
__2677:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr60 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr60)).FnumObjects == 0
	}()) {
		goto __2680
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __2681
__2680:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr60)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr60)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr60)).FnumObjects--
__2681:
	;
	goto __2678
__2678:
	if 0 != 0 {
		goto __2677
	}
	goto __2679
__2679:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

	goto __2676
__2675:
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes == uintptr(0)) {
		goto __2682
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewByteArrayObj(tls,
		XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)), uintptr(0))+uintptr(*(*int32)(unsafe.Pointer(bp + 800))), 1)
	goto __2683
__2682:
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 && *(*int32)(unsafe.Pointer(bp + 704)) == (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength) {
		goto __2684
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewStringObj(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes+uintptr(*(*int32)(unsafe.Pointer(bp + 800))), 1)
	goto __2685
__2684:
	*(*[8]int8)(unsafe.Pointer(bp + 820 /* buf */)) = *(*[8]int8)(unsafe.Pointer(ts + 9818))
	ch = int32(XTcl_GetUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), *(*int32)(unsafe.Pointer(bp + 800 /* index */))))

	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = XTclUCS4ToUtf(tls, ch, bp+820)
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewStringObj(tls, bp+820, *(*int32)(unsafe.Pointer(bp + 704 /* length */)))
__2685:
	;
__2683:
	;
__2676:
	;

__2686:
	;
	if !(2 == 0) {
		goto __2689
	}
	if !(1 != 0) {
		goto __2691
	}
	if !(1 > 0) {
		goto __2692
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2693
__2692:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2693:
	;
__2691:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2690
__2689:
	if !(1 != 0) {
		goto __2694
	}
	if !(1 > 0) {
		goto __2696
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2696:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __2698
	case 2:
		goto __2699
	case 0:
		goto __2700
	}
	goto __2697
__2698:
	goto cleanup1_pushObjResultPtr
__2699:
	goto cleanup2_pushObjResultPtr
__2700:
	goto __2697
__2697:
	;
	goto __2695
__2694:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __2702
	case 2:
		goto __2703
	case 0:
		goto __2704
	}
	goto __2701
__2702:
	goto cleanup1
__2703:
	goto cleanup2
__2704:
	goto __2701
__2701:
	;
__2695:
	;
__2690:
	;
	goto __2687
__2687:
	if 0 != 0 {
		goto __2686
	}
	goto __2688
__2688:
	;

__281:
	;
	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(2)*8))) - 1
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 828)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)), *(*int32)(unsafe.Pointer(bp + 704)), bp+828)
	}() != TCL_OK ||
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 832)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)), *(*int32)(unsafe.Pointer(bp + 704)), bp+832)
		}() != TCL_OK) {
		goto __2705
	}

	goto gotError
__2705:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 828)) < 0) {
		goto __2706
	}
	*(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)) = 0
__2706:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 832)) >= *(*int32)(unsafe.Pointer(bp + 704))) {
		goto __2707
	}
	*(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)) = *(*int32)(unsafe.Pointer(bp + 704 /* length */))
__2707:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 832)) >= *(*int32)(unsafe.Pointer(bp + 828))) {
		goto __2708
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_GetRange(tls, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(2)*8)), *(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)), *(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)))
	goto __2709
__2708:
	;
__2710:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr61 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr61)).FnumObjects == 0
	}()) {
		goto __2713
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __2714
__2713:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr61)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr61)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr61)).FnumObjects--
__2714:
	;
	goto __2711
__2711:
	if 0 != 0 {
		goto __2710
	}
	goto __2712
__2712:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

__2709:
	;

__2715:
	pc += uintptr(1)
	cleanup = 3
	if !(1 != 0) {
		goto __2718
	}
	if !(1 > 0) {
		goto __2720
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2720:
	;
	goto cleanupV_pushObjResultPtr
	goto __2719
__2718:
	goto cleanupV
__2719:
	;
	goto __2716
__2716:
	if 0 != 0 {
		goto __2715
	}
	goto __2717
__2717:
	;

__282:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)) = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3))))
	*(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)) = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(5))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(3))))
	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))

	// Every range of an empty value is an empty value
	if !(*(*int32)(unsafe.Pointer(bp + 704)) == 0) {
		goto __2721
	}

__2722:
	;
	if !(0 == 0) {
		goto __2725
	}
	if !(0 != 0) {
		goto __2727
	}
	if !(0 > 0) {
		goto __2728
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2729
__2728:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2729:
	;
__2727:
	;
	pc += uintptr(9)
	goto cleanup0
	goto __2726
__2725:
	if !(0 != 0) {
		goto __2730
	}
	if !(0 > 0) {
		goto __2732
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2732:
	;
	pc += uintptr(9)
	switch 0 {
	case 1:
		goto __2734
	case 2:
		goto __2735
	case 0:
		goto __2736
	}
	goto __2733
__2734:
	goto cleanup1_pushObjResultPtr
__2735:
	goto cleanup2_pushObjResultPtr
__2736:
	goto __2733
__2733:
	;
	goto __2731
__2730:
	pc += uintptr(9)
	switch 0 {
	case 1:
		goto __2738
	case 2:
		goto __2739
	case 0:
		goto __2740
	}
	goto __2737
__2738:
	goto cleanup1
__2739:
	goto cleanup2
__2740:
	goto __2737
__2737:
	;
__2731:
	;
__2726:
	;
	goto __2723
__2723:
	if 0 != 0 {
		goto __2722
	}
	goto __2724
__2724:
	;
__2721:
	;

	// Decode index operands.

	//
	// 	assert ( toIdx != TCL_INDEX_BEFORE );
	// 	assert ( toIdx != TCL_INDEX_AFTER);
	// 	 *
	// 	 * Extra safety for legacy bytecodes:
	//
	if !(*(*int32)(unsafe.Pointer(bp + 832)) == -1) {
		goto __2741
	}
	goto emptyRange
__2741:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 832)) == 0x7fffffff) {
		goto __2742
	}
	*(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)) = -2
__2742:
	;

	*(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)) = XTclIndexDecode(tls, *(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)), *(*int32)(unsafe.Pointer(bp + 704))-1)
	if !(*(*int32)(unsafe.Pointer(bp + 832)) < 0) {
		goto __2743
	}
	goto emptyRange
	goto __2744
__2743:
	if !(*(*int32)(unsafe.Pointer(bp + 832)) >= *(*int32)(unsafe.Pointer(bp + 704))) {
		goto __2745
	}
	*(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)) = *(*int32)(unsafe.Pointer(bp + 704)) - 1
__2745:
	;
__2744:
	;

	//
	// 	assert ( fromIdx != TCL_INDEX_BEFORE );
	// 	assert ( fromIdx != TCL_INDEX_AFTER);
	// 	 *
	// 	 * Extra safety for legacy bytecodes:
	//
	if !(*(*int32)(unsafe.Pointer(bp + 828)) == -1) {
		goto __2746
	}
	*(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)) = 0
__2746:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 828)) == 0x7fffffff) {
		goto __2747
	}
	goto emptyRange
__2747:
	;

	*(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)) = XTclIndexDecode(tls, *(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)), *(*int32)(unsafe.Pointer(bp + 704))-1)
	if !(*(*int32)(unsafe.Pointer(bp + 828)) < 0) {
		goto __2748
	}
	*(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)) = 0
__2748:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 828)) <= *(*int32)(unsafe.Pointer(bp + 832))) {
		goto __2749
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_GetRange(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), *(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)), *(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)))
	goto __2750
__2749:
emptyRange:
	;
__2751:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr62 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr62)).FnumObjects == 0
	}()) {
		goto __2754
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __2755
__2754:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr62)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr62)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr62)).FnumObjects--
__2755:
	;
	goto __2752
__2752:
	if 0 != 0 {
		goto __2751
	}
	goto __2753
__2753:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(0)

__2750:
	;

__2756:
	;
	if !(1 == 0) {
		goto __2759
	}
	if !(1 != 0) {
		goto __2761
	}
	if !(1 > 0) {
		goto __2762
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2763
__2762:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2763:
	;
__2761:
	;
	pc += uintptr(9)
	goto cleanup0
	goto __2760
__2759:
	if !(1 != 0) {
		goto __2764
	}
	if !(1 > 0) {
		goto __2766
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2766:
	;
	pc += uintptr(9)
	switch 1 {
	case 1:
		goto __2768
	case 2:
		goto __2769
	case 0:
		goto __2770
	}
	goto __2767
__2768:
	goto cleanup1_pushObjResultPtr
__2769:
	goto cleanup2_pushObjResultPtr
__2770:
	goto __2767
__2767:
	;
	goto __2765
__2764:
	pc += uintptr(9)
	switch 1 {
	case 1:
		goto __2772
	case 2:
		goto __2773
	case 0:
		goto __2774
	}
	goto __2771
__2772:
	goto cleanup1
__2773:
	goto cleanup2
__2774:
	goto __2771
__2771:
	;
__2765:
	;
__2760:
	;
	goto __2757
__2757:
	if 0 != 0 {
		goto __2756
	}
	goto __2758
__2758:
	;

__283:
	value3Ptr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(2)*8))
	endIdx = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(bp + 944))) - 1

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 828)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)), endIdx, bp+828)
	}() != TCL_OK ||
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 832)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)), endIdx, bp+832)
		}() != TCL_OK) {
		goto __2775
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FrefCount, 1) > 1) {
		goto __2776
	}
	goto __2777
__2776:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __2778
	}

	if !((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes != XtclEmptyStringRep) {
		goto __2780
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes)
__2780:
	;
	(*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Flength = -1
__2781:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr63 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr63)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr63)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __2784
	}
	XTclThreadFreeObj(tls, value3Ptr)
	goto __2785
__2784:
	*(*uintptr)(unsafe.Pointer(value3Ptr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr63)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr63)).FfirstObjPtr = value3Ptr
	(*AllocCache)(unsafe.Pointer(cachePtr63)).FnumObjects++
__2785:
	;
	goto __2782
__2782:
	if 0 != 0 {
		goto __2781
	}
	goto __2783
__2783:
	;
	goto __2779
__2778:
	XTclFreeObj(tls, value3Ptr)
__2779:
	;
__2777:
	;

	goto gotError
__2775:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FrefCount, 1) > 1) {
		goto __2786
	}
	goto __2787
__2786:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __2788
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != XtclEmptyStringRep) {
		goto __2790
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes)
__2790:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Flength = -1
__2791:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr64 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr64)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr64)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __2794
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
	goto __2795
__2794:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr64)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr64)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tosPtr))
	(*AllocCache)(unsafe.Pointer(cachePtr64)).FnumObjects++
__2795:
	;
	goto __2792
__2792:
	if 0 != 0 {
		goto __2791
	}
	goto __2793
__2793:
	;
	goto __2789
__2788:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
__2789:
	;
__2787:
	;

	_ = *(*byte)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FrefCount, 1) > 1) {
		goto __2796
	}
	goto __2797
__2796:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __2798
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != XtclEmptyStringRep) {
		goto __2800
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes)
__2800:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Flength = -1
__2801:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr65 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr65)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr65)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __2804
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
	goto __2805
__2804:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr65)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr65)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tosPtr))
	(*AllocCache)(unsafe.Pointer(cachePtr65)).FnumObjects++
__2805:
	;
	goto __2802
__2802:
	if 0 != 0 {
		goto __2801
	}
	goto __2803
__2803:
	;
	goto __2799
__2798:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
__2799:
	;
__2797:
	;

	_ = *(*byte)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))

	if !(*(*int32)(unsafe.Pointer(bp + 832)) < 0 || *(*int32)(unsafe.Pointer(bp + 828)) > endIdx || *(*int32)(unsafe.Pointer(bp + 832)) < *(*int32)(unsafe.Pointer(bp + 828))) {
		goto __2806
	}

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FrefCount, 1) > 1) {
		goto __2807
	}
	goto __2808
__2807:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __2809
	}

	if !((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes != XtclEmptyStringRep) {
		goto __2811
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes)
__2811:
	;
	(*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Flength = -1
__2812:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr66 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr66)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr66)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __2815
	}
	XTclThreadFreeObj(tls, value3Ptr)
	goto __2816
__2815:
	*(*uintptr)(unsafe.Pointer(value3Ptr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr66)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr66)).FfirstObjPtr = value3Ptr
	(*AllocCache)(unsafe.Pointer(cachePtr66)).FnumObjects++
__2816:
	;
	goto __2813
__2813:
	if 0 != 0 {
		goto __2812
	}
	goto __2814
__2814:
	;
	goto __2810
__2809:
	XTclFreeObj(tls, value3Ptr)
__2810:
	;
__2808:
	;

__2817:
	;
	if !(0 == 0) {
		goto __2820
	}
	if !(0 != 0) {
		goto __2822
	}
	if !(0 > 0) {
		goto __2823
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2824
__2823:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2824:
	;
__2822:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2821
__2820:
	if !(0 != 0) {
		goto __2825
	}
	if !(0 > 0) {
		goto __2827
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2827:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2829
	case 2:
		goto __2830
	case 0:
		goto __2831
	}
	goto __2828
__2829:
	goto cleanup1_pushObjResultPtr
__2830:
	goto cleanup2_pushObjResultPtr
__2831:
	goto __2828
__2828:
	;
	goto __2826
__2825:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2833
	case 2:
		goto __2834
	case 0:
		goto __2835
	}
	goto __2832
__2833:
	goto cleanup1
__2834:
	goto cleanup2
__2835:
	goto __2832
__2832:
	;
__2826:
	;
__2821:
	;
	goto __2818
__2818:
	if 0 != 0 {
		goto __2817
	}
	goto __2819
__2819:
	;
__2806:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 828)) < 0) {
		goto __2836
	}
	*(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)) = 0
__2836:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 832)) > endIdx) {
		goto __2837
	}
	*(*int32)(unsafe.Pointer(bp + 832 /* toIdx */)) = endIdx
__2837:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 828)) == 0 && *(*int32)(unsafe.Pointer(bp + 832)) == endIdx) {
		goto __2838
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FrefCount, 1) > 1) {
		goto __2839
	}
	goto __2840
__2839:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __2841
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != XtclEmptyStringRep) {
		goto __2843
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes)
__2843:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Flength = -1
__2844:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr67 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr67)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr67)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __2847
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
	goto __2848
__2847:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr67)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr67)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tosPtr))
	(*AllocCache)(unsafe.Pointer(cachePtr67)).FnumObjects++
__2848:
	;
	goto __2845
__2845:
	if 0 != 0 {
		goto __2844
	}
	goto __2846
__2846:
	;
	goto __2842
__2841:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
__2842:
	;
__2840:
	;

	*(*uintptr)(unsafe.Pointer(tosPtr)) = value3Ptr

__2849:
	;
	if !(0 == 0) {
		goto __2852
	}
	if !(0 != 0) {
		goto __2854
	}
	if !(0 > 0) {
		goto __2855
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2856
__2855:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2856:
	;
__2854:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2853
__2852:
	if !(0 != 0) {
		goto __2857
	}
	if !(0 > 0) {
		goto __2859
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2859:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2861
	case 2:
		goto __2862
	case 0:
		goto __2863
	}
	goto __2860
__2861:
	goto cleanup1_pushObjResultPtr
__2862:
	goto cleanup2_pushObjResultPtr
__2863:
	goto __2860
__2860:
	;
	goto __2858
__2857:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2865
	case 2:
		goto __2866
	case 0:
		goto __2867
	}
	goto __2864
__2865:
	goto cleanup1
__2866:
	goto cleanup2
__2867:
	goto __2864
__2864:
	;
__2858:
	;
__2853:
	;
	goto __2850
__2850:
	if 0 != 0 {
		goto __2849
	}
	goto __2851
__2851:
	;
__2838:
	;

	*(*int32)(unsafe.Pointer(bp + 840 /* length3 */)) = XTcl_GetCharLength(tls, value3Ptr)

	// See if we can splice in place. This happens when the number of
	// characters being replaced is the same as the number of characters
	// in the string to be inserted.

	if !(*(*int32)(unsafe.Pointer(bp + 840))-1 == *(*int32)(unsafe.Pointer(bp + 832))-*(*int32)(unsafe.Pointer(bp + 828))) {
		goto __2868
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __2869
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	goto __2870
__2869:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */))
__2870:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes == uintptr(0) &&
		((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes == uintptr(0))) {
		goto __2871
	}
	bytes1 = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)), uintptr(0))
	bytes2 = XTcl_GetByteArrayFromObj(tls, value3Ptr, uintptr(0))
	libc.Xmemcpy(tls, bytes1+uintptr(*(*int32)(unsafe.Pointer(bp + 828))), bytes2, uint64(*(*int32)(unsafe.Pointer(bp + 840 /* length3 */))))
	goto __2872
__2871:
	ustring1 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)), uintptr(0))
	ustring2 = XTcl_GetUnicodeFromObj(tls, value3Ptr, uintptr(0))
	libc.Xmemcpy(tls, ustring1+uintptr(*(*int32)(unsafe.Pointer(bp + 828)))*2, ustring2,
		uint64(*(*int32)(unsafe.Pointer(bp + 840)))*uint64(unsafe.Sizeof(Tcl_UniChar(0))))
__2872:
	;
	XTcl_InvalidateStringRep(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FrefCount, 1) > 1) {
		goto __2873
	}
	goto __2874
__2873:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __2875
	}

	if !((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes != XtclEmptyStringRep) {
		goto __2877
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes)
__2877:
	;
	(*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Flength = -1
__2878:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr68 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr68)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr68)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __2881
	}
	XTclThreadFreeObj(tls, value3Ptr)
	goto __2882
__2881:
	*(*uintptr)(unsafe.Pointer(value3Ptr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr68)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr68)).FfirstObjPtr = value3Ptr
	(*AllocCache)(unsafe.Pointer(cachePtr68)).FnumObjects++
__2882:
	;
	goto __2879
__2879:
	if 0 != 0 {
		goto __2878
	}
	goto __2880
__2880:
	;
	goto __2876
__2875:
	XTclFreeObj(tls, value3Ptr)
__2876:
	;
__2874:
	;

	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == *(*uintptr)(unsafe.Pointer(bp + 944))) {
		goto __2883
	}
__2885:
	;
	if !(0 == 0) {
		goto __2888
	}
	if !(0 != 0) {
		goto __2890
	}
	if !(0 > 0) {
		goto __2891
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2892
__2891:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2892:
	;
__2890:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2889
__2888:
	if !(0 != 0) {
		goto __2893
	}
	if !(0 > 0) {
		goto __2895
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2895:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2897
	case 2:
		goto __2898
	case 0:
		goto __2899
	}
	goto __2896
__2897:
	goto cleanup1_pushObjResultPtr
__2898:
	goto cleanup2_pushObjResultPtr
__2899:
	goto __2896
__2896:
	;
	goto __2894
__2893:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2901
	case 2:
		goto __2902
	case 0:
		goto __2903
	}
	goto __2900
__2901:
	goto cleanup1
__2902:
	goto cleanup2
__2903:
	goto __2900
__2900:
	;
__2894:
	;
__2889:
	;
	goto __2886
__2886:
	if 0 != 0 {
		goto __2885
	}
	goto __2887
__2887:
	;
	goto __2884
__2883:
__2904:
	;
	if !(1 == 0) {
		goto __2907
	}
	if !(1 != 0) {
		goto __2909
	}
	if !(1 > 0) {
		goto __2910
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2911
__2910:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2911:
	;
__2909:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2908
__2907:
	if !(1 != 0) {
		goto __2912
	}
	if !(1 > 0) {
		goto __2914
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2914:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2916
	case 2:
		goto __2917
	case 0:
		goto __2918
	}
	goto __2915
__2916:
	goto cleanup1_pushObjResultPtr
__2917:
	goto cleanup2_pushObjResultPtr
__2918:
	goto __2915
__2915:
	;
	goto __2913
__2912:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2920
	case 2:
		goto __2921
	case 0:
		goto __2922
	}
	goto __2919
__2920:
	goto cleanup1
__2921:
	goto cleanup2
__2922:
	goto __2919
__2919:
	;
__2913:
	;
__2908:
	;
	goto __2905
__2905:
	if 0 != 0 {
		goto __2904
	}
	goto __2906
__2906:
	;
__2884:
	;
__2868:
	;

	// Get the unicode representation; this is where we guarantee to lose
	// bytearrays.

	ustring1 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), bp+704)
	*(*int32)(unsafe.Pointer(bp + 704 /* length */))--

	// Remove substring using copying.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = uintptr(0)
	if !(*(*int32)(unsafe.Pointer(bp + 828)) > 0) {
		goto __2923
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewUnicodeObj(tls, ustring1, *(*int32)(unsafe.Pointer(bp + 828 /* fromIdx */)))
__2923:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 840)) > 0) {
		goto __2924
	}
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) != 0) {
		goto __2925
	}
	XTcl_AppendObjToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)), value3Ptr)
	goto __2926
__2925:
	if !((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FrefCount > 1) {
		goto __2927
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_DuplicateObj(tls, value3Ptr)
	goto __2928
__2927:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = value3Ptr
__2928:
	;
__2926:
	;
__2924:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 832)) < *(*int32)(unsafe.Pointer(bp + 704))) {
		goto __2929
	}
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) != 0) {
		goto __2930
	}
	XTcl_AppendUnicodeToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)), ustring1+uintptr(*(*int32)(unsafe.Pointer(bp + 832)))*2+uintptr(1)*2,
		*(*int32)(unsafe.Pointer(bp + 704))-*(*int32)(unsafe.Pointer(bp + 832)))
	goto __2931
__2930:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewUnicodeObj(tls, ustring1+uintptr(*(*int32)(unsafe.Pointer(bp + 832)))*2+uintptr(1)*2,
		*(*int32)(unsafe.Pointer(bp + 704))-*(*int32)(unsafe.Pointer(bp + 832)))
__2931:
	;
__2929:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == uintptr(0)) {
		goto __2932
	}
	// This has to be the case [string replace $s 0 end {}]
	// which has result {} which is same as value3Ptr.
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = value3Ptr
__2932:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == value3Ptr) {
		goto __2933
	}
	// See [Bug 82e7f67325]
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FrefCount, 1) > 1) {
		goto __2934
	}
	goto __2935
__2934:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __2936
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != XtclEmptyStringRep) {
		goto __2938
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes)
__2938:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Flength = -1
__2939:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr69 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr69)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr69)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __2942
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
	goto __2943
__2942:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr69)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr69)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tosPtr))
	(*AllocCache)(unsafe.Pointer(cachePtr69)).FnumObjects++
__2943:
	;
	goto __2940
__2940:
	if 0 != 0 {
		goto __2939
	}
	goto __2941
__2941:
	;
	goto __2937
__2936:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
__2937:
	;
__2935:
	;

	*(*uintptr)(unsafe.Pointer(tosPtr)) = value3Ptr

__2944:
	;
	if !(0 == 0) {
		goto __2947
	}
	if !(0 != 0) {
		goto __2949
	}
	if !(0 > 0) {
		goto __2950
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2951
__2950:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2951:
	;
__2949:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2948
__2947:
	if !(0 != 0) {
		goto __2952
	}
	if !(0 > 0) {
		goto __2954
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2954:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2956
	case 2:
		goto __2957
	case 0:
		goto __2958
	}
	goto __2955
__2956:
	goto cleanup1_pushObjResultPtr
__2957:
	goto cleanup2_pushObjResultPtr
__2958:
	goto __2955
__2955:
	;
	goto __2953
__2952:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __2960
	case 2:
		goto __2961
	case 0:
		goto __2962
	}
	goto __2959
__2960:
	goto cleanup1
__2961:
	goto cleanup2
__2962:
	goto __2959
__2959:
	;
__2953:
	;
__2948:
	;
	goto __2945
__2945:
	if 0 != 0 {
		goto __2944
	}
	goto __2946
__2946:
	;
__2933:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FrefCount, 1) > 1) {
		goto __2963
	}
	goto __2964
__2963:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __2965
	}

	if !((*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes != XtclEmptyStringRep) {
		goto __2967
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Fbytes)
__2967:
	;
	(*Tcl_Obj)(unsafe.Pointer(value3Ptr)).Flength = -1
__2968:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr70 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr70)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr70)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __2971
	}
	XTclThreadFreeObj(tls, value3Ptr)
	goto __2972
__2971:
	*(*uintptr)(unsafe.Pointer(value3Ptr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr70)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr70)).FfirstObjPtr = value3Ptr
	(*AllocCache)(unsafe.Pointer(cachePtr70)).FnumObjects++
__2972:
	;
	goto __2969
__2969:
	if 0 != 0 {
		goto __2968
	}
	goto __2970
__2970:
	;
	goto __2966
__2965:
	XTclFreeObj(tls, value3Ptr)
__2966:
	;
__2964:
	;

__2973:
	;
	if !(1 == 0) {
		goto __2976
	}
	if !(1 != 0) {
		goto __2978
	}
	if !(1 > 0) {
		goto __2979
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __2980
__2979:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__2980:
	;
__2978:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __2977
__2976:
	if !(1 != 0) {
		goto __2981
	}
	if !(1 > 0) {
		goto __2983
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__2983:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2985
	case 2:
		goto __2986
	case 0:
		goto __2987
	}
	goto __2984
__2985:
	goto cleanup1_pushObjResultPtr
__2986:
	goto cleanup2_pushObjResultPtr
__2987:
	goto __2984
__2984:
	;
	goto __2982
__2981:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __2989
	case 2:
		goto __2990
	case 0:
		goto __2991
	}
	goto __2988
__2989:
	goto cleanup1
__2990:
	goto cleanup2
__2991:
	goto __2988
__2988:
	;
__2982:
	;
__2977:
	;
	goto __2974
__2974:
	if 0 != 0 {
		goto __2973
	}
	goto __2975
__2975:
	;

__284:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr)) // "Main" string.
	value3Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))                             // "Target" string.
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(2)*8))                             // "Source" string.
	if !(value3Ptr == value2Ptr) {
		goto __2992
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */))
	goto doneStringMap
	goto __2993
__2992:
	if !(*(*uintptr)(unsafe.Pointer(bp + 944)) == value2Ptr) {
		goto __2994
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = value3Ptr
	goto doneStringMap
__2994:
	;
__2993:
	;
	ustring1 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), bp+704)
	if !(*(*int32)(unsafe.Pointer(bp + 704)) == 0) {
		goto __2995
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */))
	goto doneStringMap
__2995:
	;
	ustring2 = XTcl_GetUnicodeFromObj(tls, value2Ptr, bp+836)
	if !(*(*int32)(unsafe.Pointer(bp + 836)) > *(*int32)(unsafe.Pointer(bp + 704)) || *(*int32)(unsafe.Pointer(bp + 836)) == 0) {
		goto __2996
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */))
	goto doneStringMap
	goto __2997
__2996:
	if !(*(*int32)(unsafe.Pointer(bp + 836)) == *(*int32)(unsafe.Pointer(bp + 704))) {
		goto __2998
	}
	if !(libc.Xmemcmp(tls, ustring1, ustring2, uint64(unsafe.Sizeof(Tcl_UniChar(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 704)))) != 0) {
		goto __2999
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */))
	goto __3000
__2999:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = value3Ptr
__3000:
	;
	goto doneStringMap
__2998:
	;
__2997:
	;
	ustring3 = XTcl_GetUnicodeFromObj(tls, value3Ptr, bp+840)

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewUnicodeObj(tls, ustring1, 0)
	p1 = ustring1
	end = ustring1 + uintptr(*(*int32)(unsafe.Pointer(bp + 704)))*2
__3001:
	if !(ustring1 < end) {
		goto __3003
	}
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(ustring1))) == int32(*(*Tcl_UniChar)(unsafe.Pointer(ustring2))) && (*(*int32)(unsafe.Pointer(bp + 836)) == 1 || libc.Xmemcmp(tls, ustring1, ustring2, uint64(unsafe.Sizeof(Tcl_UniChar(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 836)))) ==
		0)) {
		goto __3004
	}
	if !(p1 != ustring1) {
		goto __3005
	}
	XTcl_AppendUnicodeToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)), p1, int32((int64(ustring1)-int64(p1))/2))
	p1 = ustring1 + uintptr(*(*int32)(unsafe.Pointer(bp + 836)))*2
	goto __3006
__3005:
	p1 += 2 * uintptr(*(*int32)(unsafe.Pointer(bp + 836)))
__3006:
	;
	ustring1 = p1 - uintptr(1)*2

	XTcl_AppendUnicodeToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)), ustring3, *(*int32)(unsafe.Pointer(bp + 840 /* length3 */)))
__3004:
	;
	goto __3002
__3002:
	ustring1 += 2
	goto __3001
	goto __3003
__3003:
	;
	if !(p1 != ustring1) {
		goto __3007
	}
	// Put the rest of the unmapped chars onto result.

	XTcl_AppendUnicodeToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)), p1, int32((int64(ustring1)-int64(p1))/2))
__3007:
	;
doneStringMap:
	;
__3008:
	pc += uintptr(1)
	cleanup = 3
	if !(1 != 0) {
		goto __3011
	}
	if !(1 > 0) {
		goto __3013
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3013:
	;
	goto cleanupV_pushObjResultPtr
	goto __3012
__3011:
	goto cleanupV
__3012:
	;
	goto __3009
__3009:
	if 0 != 0 {
		goto __3008
	}
	goto __3010
__3010:
	;

__285:
	ustring1 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr)), bp+704)                               // Haystack
	ustring2 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)), bp+836 /* &length2 */) // Needle

	match = -1
	if !(*(*int32)(unsafe.Pointer(bp + 836)) > 0 && *(*int32)(unsafe.Pointer(bp + 836)) <= *(*int32)(unsafe.Pointer(bp + 704))) {
		goto __3014
	}
	end = ustring1 + uintptr(*(*int32)(unsafe.Pointer(bp + 704)))*2 - uintptr(*(*int32)(unsafe.Pointer(bp + 836)))*2 + uintptr(1)*2
	p1 = ustring1
__3015:
	if !(p1 < end) {
		goto __3017
	}
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(p1))) == int32(*(*Tcl_UniChar)(unsafe.Pointer(ustring2))) && libc.Xmemcmp(tls, ustring2, p1, uint64(unsafe.Sizeof(Tcl_UniChar(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 836)))) == 0) {
		goto __3018
	}
	match = int32((int64(p1) - int64(ustring1)) / 2)
	goto __3017
__3018:
	;
	goto __3016
__3016:
	p1 += 2
	goto __3015
	goto __3017
__3017:
	;
__3014:
	;

__3019:
	;
__3022:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr71 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr71)).FnumObjects == 0
	}()) {
		goto __3025
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __3026
__3025:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr71)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr71)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr71)).FnumObjects--
__3026:
	;
	goto __3023
__3023:
	if 0 != 0 {
		goto __3022
	}
	goto __3024
__3024:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(match)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __3020
__3020:
	if 0 != 0 {
		goto __3019
	}
	goto __3021
__3021:
	;
__3027:
	;
	if !(2 == 0) {
		goto __3030
	}
	if !(1 != 0) {
		goto __3032
	}
	if !(1 > 0) {
		goto __3033
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3034
__3033:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3034:
	;
__3032:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3031
__3030:
	if !(1 != 0) {
		goto __3035
	}
	if !(1 > 0) {
		goto __3037
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3037:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3039
	case 2:
		goto __3040
	case 0:
		goto __3041
	}
	goto __3038
__3039:
	goto cleanup1_pushObjResultPtr
__3040:
	goto cleanup2_pushObjResultPtr
__3041:
	goto __3038
__3038:
	;
	goto __3036
__3035:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3043
	case 2:
		goto __3044
	case 0:
		goto __3045
	}
	goto __3042
__3043:
	goto cleanup1
__3044:
	goto cleanup2
__3045:
	goto __3042
__3042:
	;
__3036:
	;
__3031:
	;
	goto __3028
__3028:
	if 0 != 0 {
		goto __3027
	}
	goto __3029
__3029:
	;

__286:
	ustring1 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr)), bp+704)                               // Haystack
	ustring2 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)), bp+836 /* &length2 */) // Needle

	match = -1
	if !(*(*int32)(unsafe.Pointer(bp + 836)) > 0 && *(*int32)(unsafe.Pointer(bp + 836)) <= *(*int32)(unsafe.Pointer(bp + 704))) {
		goto __3046
	}
	p1 = ustring1 + uintptr(*(*int32)(unsafe.Pointer(bp + 704)))*2 - uintptr(*(*int32)(unsafe.Pointer(bp + 836)))*2
__3047:
	if !(p1 >= ustring1) {
		goto __3049
	}
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(p1))) == int32(*(*Tcl_UniChar)(unsafe.Pointer(ustring2))) && libc.Xmemcmp(tls, ustring2, p1, uint64(unsafe.Sizeof(Tcl_UniChar(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 836)))) == 0) {
		goto __3050
	}
	match = int32((int64(p1) - int64(ustring1)) / 2)
	goto __3049
__3050:
	;
	goto __3048
__3048:
	p1 -= 2
	goto __3047
	goto __3049
__3049:
	;
__3046:
	;

__3051:
	;
__3054:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr72 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr72)).FnumObjects == 0
	}()) {
		goto __3057
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __3058
__3057:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr72)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr72)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr72)).FnumObjects--
__3058:
	;
	goto __3055
__3055:
	if 0 != 0 {
		goto __3054
	}
	goto __3056
__3056:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(match)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __3052
__3052:
	if 0 != 0 {
		goto __3051
	}
	goto __3053
__3053:
	;
__3059:
	;
	if !(2 == 0) {
		goto __3062
	}
	if !(1 != 0) {
		goto __3064
	}
	if !(1 > 0) {
		goto __3065
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3066
__3065:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3066:
	;
__3064:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3063
__3062:
	if !(1 != 0) {
		goto __3067
	}
	if !(1 > 0) {
		goto __3069
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3069:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3071
	case 2:
		goto __3072
	case 0:
		goto __3073
	}
	goto __3070
__3071:
	goto cleanup1_pushObjResultPtr
__3072:
	goto cleanup2_pushObjResultPtr
__3073:
	goto __3070
__3070:
	;
	goto __3068
__3067:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3075
	case 2:
		goto __3076
	case 0:
		goto __3077
	}
	goto __3074
__3075:
	goto cleanup1
__3076:
	goto cleanup2
__3077:
	goto __3074
__3074:
	;
__3068:
	;
__3063:
	;
	goto __3060
__3060:
	if 0 != 0 {
		goto __3059
	}
	goto __3061
__3061:
	;

__287:
	opnd = int32(*(*int8)(unsafe.Pointer(pc + uintptr(1))))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))

	ustring1 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), bp+704)
	match = 1
	if !(*(*int32)(unsafe.Pointer(bp + 704)) > 0) {
		goto __3078
	}
	end = ustring1 + uintptr(*(*int32)(unsafe.Pointer(bp + 704)))*2
	p1 = ustring1
__3079:
	if !(p1 < end) {
		goto __3081
	}
	p1 += 2 * uintptr(func() int32 {
		*(*int32)(unsafe.Pointer(bp + 844)) = int32(*(*Tcl_UniChar)(unsafe.Pointer(p1)))
		return 1
	}())
	if !!((*struct{ f func(*libc.TLS, int32) int32 })(unsafe.Pointer(&struct{ uintptr }{XtclStringClassTable[opnd].Fcomparator})).f(tls, *(*int32)(unsafe.Pointer(bp + 844))) != 0) {
		goto __3082
	}
	match = 0
	goto __3081
__3082:
	;
	goto __3080
__3080:
	;
	goto __3079
	goto __3081
__3081:
	;
__3078:
	;

__3083:
	pc += uintptr(2)
	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_JUMP_FALSE1:
		goto __3087
	case INST_JUMP_TRUE1:
		goto __3088
	case INST_JUMP_FALSE4:
		goto __3089
	case INST_JUMP_TRUE4:
		goto __3090
	default:
		goto __3091
	}
	goto __3086
__3087:
__3092:
	;
	if !(1 == 0) {
		goto __3095
	}
	if !(0 != 0) {
		goto __3097
	}
	if !(0 > 0) {
		goto __3098
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3099
__3098:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3099:
	;
__3097:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	goto cleanup0
	goto __3096
__3095:
	if !(0 != 0) {
		goto __3100
	}
	if !(0 > 0) {
		goto __3102
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3102:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 1 {
	case 1:
		goto __3104
	case 2:
		goto __3105
	case 0:
		goto __3106
	}
	goto __3103
__3104:
	goto cleanup1_pushObjResultPtr
__3105:
	goto cleanup2_pushObjResultPtr
__3106:
	goto __3103
__3103:
	;
	goto __3101
__3100:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 1 {
	case 1:
		goto __3108
	case 2:
		goto __3109
	case 0:
		goto __3110
	}
	goto __3107
__3108:
	goto cleanup1
__3109:
	goto cleanup2
__3110:
	goto __3107
__3107:
	;
__3101:
	;
__3096:
	;
	goto __3093
__3093:
	if 0 != 0 {
		goto __3092
	}
	goto __3094
__3094:
	;
	goto __3086
__3088:
__3111:
	;
	if !(1 == 0) {
		goto __3114
	}
	if !(0 != 0) {
		goto __3116
	}
	if !(0 > 0) {
		goto __3117
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3118
__3117:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3118:
	;
__3116:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	goto cleanup0
	goto __3115
__3114:
	if !(0 != 0) {
		goto __3119
	}
	if !(0 > 0) {
		goto __3121
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3121:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 1 {
	case 1:
		goto __3123
	case 2:
		goto __3124
	case 0:
		goto __3125
	}
	goto __3122
__3123:
	goto cleanup1_pushObjResultPtr
__3124:
	goto cleanup2_pushObjResultPtr
__3125:
	goto __3122
__3122:
	;
	goto __3120
__3119:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 1 {
	case 1:
		goto __3127
	case 2:
		goto __3128
	case 0:
		goto __3129
	}
	goto __3126
__3127:
	goto cleanup1
__3128:
	goto cleanup2
__3129:
	goto __3126
__3126:
	;
__3120:
	;
__3115:
	;
	goto __3112
__3112:
	if 0 != 0 {
		goto __3111
	}
	goto __3113
__3113:
	;
	goto __3086
__3089:
__3130:
	;
	if !(1 == 0) {
		goto __3133
	}
	if !(0 != 0) {
		goto __3135
	}
	if !(0 > 0) {
		goto __3136
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3137
__3136:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3137:
	;
__3135:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	goto cleanup0
	goto __3134
__3133:
	if !(0 != 0) {
		goto __3138
	}
	if !(0 > 0) {
		goto __3140
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3140:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 1 {
	case 1:
		goto __3142
	case 2:
		goto __3143
	case 0:
		goto __3144
	}
	goto __3141
__3142:
	goto cleanup1_pushObjResultPtr
__3143:
	goto cleanup2_pushObjResultPtr
__3144:
	goto __3141
__3141:
	;
	goto __3139
__3138:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 1 {
	case 1:
		goto __3146
	case 2:
		goto __3147
	case 0:
		goto __3148
	}
	goto __3145
__3146:
	goto cleanup1
__3147:
	goto cleanup2
__3148:
	goto __3145
__3145:
	;
__3139:
	;
__3134:
	;
	goto __3131
__3131:
	if 0 != 0 {
		goto __3130
	}
	goto __3132
__3132:
	;
	goto __3086
__3090:
__3149:
	;
	if !(1 == 0) {
		goto __3152
	}
	if !(0 != 0) {
		goto __3154
	}
	if !(0 > 0) {
		goto __3155
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3156
__3155:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3156:
	;
__3154:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	goto cleanup0
	goto __3153
__3152:
	if !(0 != 0) {
		goto __3157
	}
	if !(0 > 0) {
		goto __3159
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3159:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 1 {
	case 1:
		goto __3161
	case 2:
		goto __3162
	case 0:
		goto __3163
	}
	goto __3160
__3161:
	goto cleanup1_pushObjResultPtr
__3162:
	goto cleanup2_pushObjResultPtr
__3163:
	goto __3160
__3160:
	;
	goto __3158
__3157:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 1 {
	case 1:
		goto __3165
	case 2:
		goto __3166
	case 0:
		goto __3167
	}
	goto __3164
__3165:
	goto cleanup1
__3166:
	goto cleanup2
__3167:
	goto __3164
__3164:
	;
__3158:
	;
__3153:
	;
	goto __3150
__3150:
	if 0 != 0 {
		goto __3149
	}
	goto __3151
__3151:
	;
	goto __3086
__3091:
	if !(match < 0) {
		goto __3168
	}
__3170:
	;
__3173:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr73 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr73)).FnumObjects == 0
	}()) {
		goto __3176
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __3177
__3176:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr73)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr73)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr73)).FnumObjects--
__3177:
	;
	goto __3174
__3174:
	if 0 != 0 {
		goto __3173
	}
	goto __3175
__3175:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __3171
__3171:
	if 0 != 0 {
		goto __3170
	}
	goto __3172
__3172:
	;
	goto __3169
__3168:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(libc.Bool32(match > 0))*8))
__3169:
	;
__3178:
	;
	if !(1 == 0) {
		goto __3181
	}
	if !(1 != 0) {
		goto __3183
	}
	if !(1 > 0) {
		goto __3184
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3185
__3184:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3185:
	;
__3183:
	;
	pc += uintptr(0)
	goto cleanup0
	goto __3182
__3181:
	if !(1 != 0) {
		goto __3186
	}
	if !(1 > 0) {
		goto __3188
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3188:
	;
	pc += uintptr(0)
	switch 1 {
	case 1:
		goto __3190
	case 2:
		goto __3191
	case 0:
		goto __3192
	}
	goto __3189
__3190:
	goto cleanup1_pushObjResultPtr
__3191:
	goto cleanup2_pushObjResultPtr
__3192:
	goto __3189
__3189:
	;
	goto __3187
__3186:
	pc += uintptr(0)
	switch 1 {
	case 1:
		goto __3194
	case 2:
		goto __3195
	case 0:
		goto __3196
	}
	goto __3193
__3194:
	goto cleanup1
__3195:
	goto cleanup2
__3196:
	goto __3193
__3193:
	;
__3187:
	;
__3182:
	;
	goto __3179
__3179:
	if 0 != 0 {
		goto __3178
	}
	goto __3180
__3180:
	;
	goto __3086
__3086:
	;
	goto __3084
__3084:
	if 0 != 0 {
		goto __3083
	}
	goto __3085
__3085:
	;

__288:
	nocase = int32(*(*int8)(unsafe.Pointer(pc + uintptr(1))))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr)) // String
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))                             // Pattern

	// Check that at least one of the objects is Unicode before promoting
	// both.

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclStringType)) ||
		(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclStringType))) {
		goto __3197
	}

	ustring11 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), bp+704)
	ustring21 = XTcl_GetUnicodeFromObj(tls, value2Ptr, bp+836)
	match = XTclUniCharMatch(tls, ustring11, *(*int32)(unsafe.Pointer(bp + 704 /* length */)), ustring21, *(*int32)(unsafe.Pointer(bp + 836 /* length2 */)),
		nocase)
	goto __3198
__3197:
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes == uintptr(0) && !(nocase != 0)) {
		goto __3199
	}

	bytes11 = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), bp+704)
	bytes21 = XTcl_GetByteArrayFromObj(tls, value2Ptr, bp+836)
	match = XTclByteArrayMatch(tls, bytes11, *(*int32)(unsafe.Pointer(bp + 704 /* length */)), bytes21, *(*int32)(unsafe.Pointer(bp + 836 /* length2 */)), 0)
	goto __3200
__3199:
	match = XTcl_StringCaseMatch(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 944)))
	}(),
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes
			}
			return XTcl_GetString(tls, value2Ptr)
		}(), nocase)
__3200:
	;
__3198:
	;

	// Reuse value2Ptr object already on stack if possible. Adjustment is
	// 2 due to the nocase byte

	// Peep-hole optimisation: if you're about to jump, do jump from here.

__3201:
	pc += uintptr(2)
	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_JUMP_FALSE1:
		goto __3205
	case INST_JUMP_TRUE1:
		goto __3206
	case INST_JUMP_FALSE4:
		goto __3207
	case INST_JUMP_TRUE4:
		goto __3208
	default:
		goto __3209
	}
	goto __3204
__3205:
__3210:
	;
	if !(2 == 0) {
		goto __3213
	}
	if !(0 != 0) {
		goto __3215
	}
	if !(0 > 0) {
		goto __3216
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3217
__3216:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3217:
	;
__3215:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	goto cleanup0
	goto __3214
__3213:
	if !(0 != 0) {
		goto __3218
	}
	if !(0 > 0) {
		goto __3220
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3220:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 2 {
	case 1:
		goto __3222
	case 2:
		goto __3223
	case 0:
		goto __3224
	}
	goto __3221
__3222:
	goto cleanup1_pushObjResultPtr
__3223:
	goto cleanup2_pushObjResultPtr
__3224:
	goto __3221
__3221:
	;
	goto __3219
__3218:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 2 {
	case 1:
		goto __3226
	case 2:
		goto __3227
	case 0:
		goto __3228
	}
	goto __3225
__3226:
	goto cleanup1
__3227:
	goto cleanup2
__3228:
	goto __3225
__3225:
	;
__3219:
	;
__3214:
	;
	goto __3211
__3211:
	if 0 != 0 {
		goto __3210
	}
	goto __3212
__3212:
	;
	goto __3204
__3206:
__3229:
	;
	if !(2 == 0) {
		goto __3232
	}
	if !(0 != 0) {
		goto __3234
	}
	if !(0 > 0) {
		goto __3235
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3236
__3235:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3236:
	;
__3234:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	goto cleanup0
	goto __3233
__3232:
	if !(0 != 0) {
		goto __3237
	}
	if !(0 > 0) {
		goto __3239
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3239:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 2 {
	case 1:
		goto __3241
	case 2:
		goto __3242
	case 0:
		goto __3243
	}
	goto __3240
__3241:
	goto cleanup1_pushObjResultPtr
__3242:
	goto cleanup2_pushObjResultPtr
__3243:
	goto __3240
__3240:
	;
	goto __3238
__3237:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 2 {
	case 1:
		goto __3245
	case 2:
		goto __3246
	case 0:
		goto __3247
	}
	goto __3244
__3245:
	goto cleanup1
__3246:
	goto cleanup2
__3247:
	goto __3244
__3244:
	;
__3238:
	;
__3233:
	;
	goto __3230
__3230:
	if 0 != 0 {
		goto __3229
	}
	goto __3231
__3231:
	;
	goto __3204
__3207:
__3248:
	;
	if !(2 == 0) {
		goto __3251
	}
	if !(0 != 0) {
		goto __3253
	}
	if !(0 > 0) {
		goto __3254
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3255
__3254:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3255:
	;
__3253:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	goto cleanup0
	goto __3252
__3251:
	if !(0 != 0) {
		goto __3256
	}
	if !(0 > 0) {
		goto __3258
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3258:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 2 {
	case 1:
		goto __3260
	case 2:
		goto __3261
	case 0:
		goto __3262
	}
	goto __3259
__3260:
	goto cleanup1_pushObjResultPtr
__3261:
	goto cleanup2_pushObjResultPtr
__3262:
	goto __3259
__3259:
	;
	goto __3257
__3256:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 2 {
	case 1:
		goto __3264
	case 2:
		goto __3265
	case 0:
		goto __3266
	}
	goto __3263
__3264:
	goto cleanup1
__3265:
	goto cleanup2
__3266:
	goto __3263
__3263:
	;
__3257:
	;
__3252:
	;
	goto __3249
__3249:
	if 0 != 0 {
		goto __3248
	}
	goto __3250
__3250:
	;
	goto __3204
__3208:
__3267:
	;
	if !(2 == 0) {
		goto __3270
	}
	if !(0 != 0) {
		goto __3272
	}
	if !(0 > 0) {
		goto __3273
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3274
__3273:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3274:
	;
__3272:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	goto cleanup0
	goto __3271
__3270:
	if !(0 != 0) {
		goto __3275
	}
	if !(0 > 0) {
		goto __3277
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3277:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 2 {
	case 1:
		goto __3279
	case 2:
		goto __3280
	case 0:
		goto __3281
	}
	goto __3278
__3279:
	goto cleanup1_pushObjResultPtr
__3280:
	goto cleanup2_pushObjResultPtr
__3281:
	goto __3278
__3278:
	;
	goto __3276
__3275:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 2 {
	case 1:
		goto __3283
	case 2:
		goto __3284
	case 0:
		goto __3285
	}
	goto __3282
__3283:
	goto cleanup1
__3284:
	goto cleanup2
__3285:
	goto __3282
__3282:
	;
__3276:
	;
__3271:
	;
	goto __3268
__3268:
	if 0 != 0 {
		goto __3267
	}
	goto __3269
__3269:
	;
	goto __3204
__3209:
	if !(match < 0) {
		goto __3286
	}
__3288:
	;
__3291:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr74 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr74)).FnumObjects == 0
	}()) {
		goto __3294
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __3295
__3294:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr74)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr74)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr74)).FnumObjects--
__3295:
	;
	goto __3292
__3292:
	if 0 != 0 {
		goto __3291
	}
	goto __3293
__3293:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __3289
__3289:
	if 0 != 0 {
		goto __3288
	}
	goto __3290
__3290:
	;
	goto __3287
__3286:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(libc.Bool32(match > 0))*8))
__3287:
	;
__3296:
	;
	if !(2 == 0) {
		goto __3299
	}
	if !(1 != 0) {
		goto __3301
	}
	if !(1 > 0) {
		goto __3302
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3303
__3302:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3303:
	;
__3301:
	;
	pc += uintptr(0)
	goto cleanup0
	goto __3300
__3299:
	if !(1 != 0) {
		goto __3304
	}
	if !(1 > 0) {
		goto __3306
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3306:
	;
	pc += uintptr(0)
	switch 2 {
	case 1:
		goto __3308
	case 2:
		goto __3309
	case 0:
		goto __3310
	}
	goto __3307
__3308:
	goto cleanup1_pushObjResultPtr
__3309:
	goto cleanup2_pushObjResultPtr
__3310:
	goto __3307
__3307:
	;
	goto __3305
__3304:
	pc += uintptr(0)
	switch 2 {
	case 1:
		goto __3312
	case 2:
		goto __3313
	case 0:
		goto __3314
	}
	goto __3311
__3312:
	goto cleanup1
__3313:
	goto cleanup2
__3314:
	goto __3311
__3311:
	;
__3305:
	;
__3300:
	;
	goto __3297
__3297:
	if 0 != 0 {
		goto __3296
	}
	goto __3298
__3298:
	;
	goto __3204
__3204:
	;
	goto __3202
__3202:
	if 0 != 0 {
		goto __3201
	}
	goto __3203
__3203:
	;

__289:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) // String
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))                                                           // TrimSet
	string2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 836)) = (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, value2Ptr, bp+836)
	}()
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 704)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+704)
	}()
	trim1 = XTclTrimLeft(tls, string1, *(*int32)(unsafe.Pointer(bp + 704 /* length */)), string2, *(*int32)(unsafe.Pointer(bp + 836 /* length2 */)))
	*(*int32)(unsafe.Pointer(bp + 848 /* trim2 */)) = 0
	goto createTrimmedString
__290:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) // String
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))                                                           // TrimSet
	string2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 836)) = (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, value2Ptr, bp+836)
	}()
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 704)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+704)
	}()
	*(*int32)(unsafe.Pointer(bp + 848 /* trim2 */)) = XTclTrimRight(tls, string1, *(*int32)(unsafe.Pointer(bp + 704 /* length */)), string2, *(*int32)(unsafe.Pointer(bp + 836 /* length2 */)))
	trim1 = 0
	goto createTrimmedString
__291:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)) // String
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))                                                           // TrimSet
	string2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 836)) = (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, value2Ptr, bp+836)
	}()
	string1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 704)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)), bp+704)
	}()
	trim1 = XTclTrim(tls, string1, *(*int32)(unsafe.Pointer(bp + 704 /* length */)), string2, *(*int32)(unsafe.Pointer(bp + 836 /* length2 */)), bp+848)
createTrimmedString:
	// Careful here; trim set often contains non-ASCII characters so we
	// take care when printing. [Bug 971cb4f1db]

	if !(trim1 == 0 && *(*int32)(unsafe.Pointer(bp + 848)) == 0) {
		goto __3315
	}
__3317:
	;
	if !(1 == 0) {
		goto __3320
	}
	if !(0 != 0) {
		goto __3322
	}
	if !(0 > 0) {
		goto __3323
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3324
__3323:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3324:
	;
__3322:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3321
__3320:
	if !(0 != 0) {
		goto __3325
	}
	if !(0 > 0) {
		goto __3327
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3327:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3329
	case 2:
		goto __3330
	case 0:
		goto __3331
	}
	goto __3328
__3329:
	goto cleanup1_pushObjResultPtr
__3330:
	goto cleanup2_pushObjResultPtr
__3331:
	goto __3328
__3328:
	;
	goto __3326
__3325:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3333
	case 2:
		goto __3334
	case 0:
		goto __3335
	}
	goto __3332
__3333:
	goto cleanup1
__3334:
	goto cleanup2
__3335:
	goto __3332
__3332:
	;
__3326:
	;
__3321:
	;
	goto __3318
__3318:
	if 0 != 0 {
		goto __3317
	}
	goto __3319
__3319:
	;
	goto __3316
__3315:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewStringObj(tls, string1+uintptr(trim1), *(*int32)(unsafe.Pointer(bp + 704))-trim1-*(*int32)(unsafe.Pointer(bp + 848)))
__3336:
	;
	if !(2 == 0) {
		goto __3339
	}
	if !(1 != 0) {
		goto __3341
	}
	if !(1 > 0) {
		goto __3342
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3343
__3342:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3343:
	;
__3341:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3340
__3339:
	if !(1 != 0) {
		goto __3344
	}
	if !(1 > 0) {
		goto __3346
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3346:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3348
	case 2:
		goto __3349
	case 0:
		goto __3350
	}
	goto __3347
__3348:
	goto cleanup1_pushObjResultPtr
__3349:
	goto cleanup2_pushObjResultPtr
__3350:
	goto __3347
__3347:
	;
	goto __3345
__3344:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3352
	case 2:
		goto __3353
	case 0:
		goto __3354
	}
	goto __3351
__3352:
	goto cleanup1
__3353:
	goto cleanup2
__3354:
	goto __3351
__3351:
	;
__3345:
	;
__3340:
	;
	goto __3337
__3337:
	if 0 != 0 {
		goto __3336
	}
	goto __3338
__3338:
	;
__3316:
	;

__292:
	cflags = int32(*(*int8)(unsafe.Pointer(pc + uintptr(1))))                                  // RE compile flages like NOCASE
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr)) // String
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))                             // Pattern

	/*
	 * Compile and match the regular expression.
	 */

	regExpr =
		XTcl_GetRegExpFromObj(tls, interp, value2Ptr, cflags)

	if !(regExpr == uintptr(0)) {
		goto __3355
	}

	goto gotError
__3355:
	;
	match = XTcl_RegExpExecObj(tls, interp, regExpr, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), 0, 0, 0)
	if !(match < 0) {
		goto __3356
	}

	goto gotError
__3356:
	;

	// Peep-hole optimisation: if you're about to jump, do jump from here.
	// Adjustment is 2 due to the nocase byte.

__3357:
	pc += uintptr(2)
	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_JUMP_FALSE1:
		goto __3361
	case INST_JUMP_TRUE1:
		goto __3362
	case INST_JUMP_FALSE4:
		goto __3363
	case INST_JUMP_TRUE4:
		goto __3364
	default:
		goto __3365
	}
	goto __3360
__3361:
__3366:
	;
	if !(2 == 0) {
		goto __3369
	}
	if !(0 != 0) {
		goto __3371
	}
	if !(0 > 0) {
		goto __3372
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3373
__3372:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3373:
	;
__3371:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	goto cleanup0
	goto __3370
__3369:
	if !(0 != 0) {
		goto __3374
	}
	if !(0 > 0) {
		goto __3376
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3376:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 2 {
	case 1:
		goto __3378
	case 2:
		goto __3379
	case 0:
		goto __3380
	}
	goto __3377
__3378:
	goto cleanup1_pushObjResultPtr
__3379:
	goto cleanup2_pushObjResultPtr
__3380:
	goto __3377
__3377:
	;
	goto __3375
__3374:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 2 {
	case 1:
		goto __3382
	case 2:
		goto __3383
	case 0:
		goto __3384
	}
	goto __3381
__3382:
	goto cleanup1
__3383:
	goto cleanup2
__3384:
	goto __3381
__3381:
	;
__3375:
	;
__3370:
	;
	goto __3367
__3367:
	if 0 != 0 {
		goto __3366
	}
	goto __3368
__3368:
	;
	goto __3360
__3362:
__3385:
	;
	if !(2 == 0) {
		goto __3388
	}
	if !(0 != 0) {
		goto __3390
	}
	if !(0 > 0) {
		goto __3391
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3392
__3391:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3392:
	;
__3390:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	goto cleanup0
	goto __3389
__3388:
	if !(0 != 0) {
		goto __3393
	}
	if !(0 > 0) {
		goto __3395
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3395:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 2 {
	case 1:
		goto __3397
	case 2:
		goto __3398
	case 0:
		goto __3399
	}
	goto __3396
__3397:
	goto cleanup1_pushObjResultPtr
__3398:
	goto cleanup2_pushObjResultPtr
__3399:
	goto __3396
__3396:
	;
	goto __3394
__3393:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 2 {
	case 1:
		goto __3401
	case 2:
		goto __3402
	case 0:
		goto __3403
	}
	goto __3400
__3401:
	goto cleanup1
__3402:
	goto cleanup2
__3403:
	goto __3400
__3400:
	;
__3394:
	;
__3389:
	;
	goto __3386
__3386:
	if 0 != 0 {
		goto __3385
	}
	goto __3387
__3387:
	;
	goto __3360
__3363:
__3404:
	;
	if !(2 == 0) {
		goto __3407
	}
	if !(0 != 0) {
		goto __3409
	}
	if !(0 > 0) {
		goto __3410
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3411
__3410:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3411:
	;
__3409:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	goto cleanup0
	goto __3408
__3407:
	if !(0 != 0) {
		goto __3412
	}
	if !(0 > 0) {
		goto __3414
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3414:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 2 {
	case 1:
		goto __3416
	case 2:
		goto __3417
	case 0:
		goto __3418
	}
	goto __3415
__3416:
	goto cleanup1_pushObjResultPtr
__3417:
	goto cleanup2_pushObjResultPtr
__3418:
	goto __3415
__3415:
	;
	goto __3413
__3412:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 2 {
	case 1:
		goto __3420
	case 2:
		goto __3421
	case 0:
		goto __3422
	}
	goto __3419
__3420:
	goto cleanup1
__3421:
	goto cleanup2
__3422:
	goto __3419
__3419:
	;
__3413:
	;
__3408:
	;
	goto __3405
__3405:
	if 0 != 0 {
		goto __3404
	}
	goto __3406
__3406:
	;
	goto __3360
__3364:
__3423:
	;
	if !(2 == 0) {
		goto __3426
	}
	if !(0 != 0) {
		goto __3428
	}
	if !(0 > 0) {
		goto __3429
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3430
__3429:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3430:
	;
__3428:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	goto cleanup0
	goto __3427
__3426:
	if !(0 != 0) {
		goto __3431
	}
	if !(0 > 0) {
		goto __3433
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3433:
	;
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 2 {
	case 1:
		goto __3435
	case 2:
		goto __3436
	case 0:
		goto __3437
	}
	goto __3434
__3435:
	goto cleanup1_pushObjResultPtr
__3436:
	goto cleanup2_pushObjResultPtr
__3437:
	goto __3434
__3434:
	;
	goto __3432
__3431:
	pc += func() uintptr {
		if match != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 2 {
	case 1:
		goto __3439
	case 2:
		goto __3440
	case 0:
		goto __3441
	}
	goto __3438
__3439:
	goto cleanup1
__3440:
	goto cleanup2
__3441:
	goto __3438
__3438:
	;
__3432:
	;
__3427:
	;
	goto __3424
__3424:
	if 0 != 0 {
		goto __3423
	}
	goto __3425
__3425:
	;
	goto __3360
__3365:
	if !(match < 0) {
		goto __3442
	}
__3444:
	;
__3447:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr75 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr75)).FnumObjects == 0
	}()) {
		goto __3450
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __3451
__3450:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr75)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr75)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr75)).FnumObjects--
__3451:
	;
	goto __3448
__3448:
	if 0 != 0 {
		goto __3447
	}
	goto __3449
__3449:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __3445
__3445:
	if 0 != 0 {
		goto __3444
	}
	goto __3446
__3446:
	;
	goto __3443
__3442:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(libc.Bool32(match > 0))*8))
__3443:
	;
__3452:
	;
	if !(2 == 0) {
		goto __3455
	}
	if !(1 != 0) {
		goto __3457
	}
	if !(1 > 0) {
		goto __3458
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3459
__3458:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3459:
	;
__3457:
	;
	pc += uintptr(0)
	goto cleanup0
	goto __3456
__3455:
	if !(1 != 0) {
		goto __3460
	}
	if !(1 > 0) {
		goto __3462
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3462:
	;
	pc += uintptr(0)
	switch 2 {
	case 1:
		goto __3464
	case 2:
		goto __3465
	case 0:
		goto __3466
	}
	goto __3463
__3464:
	goto cleanup1_pushObjResultPtr
__3465:
	goto cleanup2_pushObjResultPtr
__3466:
	goto __3463
__3463:
	;
	goto __3461
__3460:
	pc += uintptr(0)
	switch 2 {
	case 1:
		goto __3468
	case 2:
		goto __3469
	case 0:
		goto __3470
	}
	goto __3467
__3468:
	goto cleanup1
__3469:
	goto cleanup2
__3470:
	goto __3467
__3467:
	;
__3461:
	;
__3456:
	;
	goto __3453
__3453:
	if 0 != 0 {
		goto __3452
	}
	goto __3454
__3454:
	;
	goto __3360
__3360:
	;
	goto __3358
__3358:
	if 0 != 0 {
		goto __3357
	}
	goto __3359
__3359:
	;

	/*
	 *	   End of string-related instructions.
	 * -----------------------------------------------------------------
	 *	   Start of numeric operator instructions.
	 */

	l1 = int64(0)

__293:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(tosPtr)) + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(tosPtr)) + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(tosPtr)), bp+856, bp+852)
			}()
		}()
	}() != TCL_OK) {
		goto __3471
	}
	*(*int32)(unsafe.Pointer(bp + 852 /* type11 */)) = 0
	goto __3472
__3471:
	if !(*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_LONG) {
		goto __3473
	}

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 864)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(tosPtr)), bp+864)
	}() != TCL_OK) {
		goto __3475
	}
	*(*int32)(unsafe.Pointer(bp + 852 /* type11 */)) = TCL_NUMBER_WIDE
__3475:
	;
	goto __3474
__3473:
	if !(*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_BIG) {
		goto __3476
	}

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp + 872)) = *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(tosPtr)), bp+872)
	}() == TCL_OK) {
		goto __3477
	}
	*(*int32)(unsafe.Pointer(bp + 852 /* type11 */)) = TCL_NUMBER_WIDE
__3477:
	;
__3476:
	;
__3474:
	;
__3472:
	;
__3478:
	;
__3481:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr76 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr76)).FnumObjects == 0
	}()) {
		goto __3484
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __3485
__3484:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr76)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr76)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr76)).FnumObjects--
__3485:
	;
	goto __3482
__3482:
	if 0 != 0 {
		goto __3481
	}
	goto __3483
__3483:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(*(*int32)(unsafe.Pointer(bp + 852)))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __3479
__3479:
	if 0 != 0 {
		goto __3478
	}
	goto __3480
__3480:
	;

__3486:
	;
	if !(1 == 0) {
		goto __3489
	}
	if !(1 != 0) {
		goto __3491
	}
	if !(1 > 0) {
		goto __3492
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3493
__3492:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3493:
	;
__3491:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3490
__3489:
	if !(1 != 0) {
		goto __3494
	}
	if !(1 > 0) {
		goto __3496
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3496:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3498
	case 2:
		goto __3499
	case 0:
		goto __3500
	}
	goto __3497
__3498:
	goto cleanup1_pushObjResultPtr
__3499:
	goto cleanup2_pushObjResultPtr
__3500:
	goto __3497
__3497:
	;
	goto __3495
__3494:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3502
	case 2:
		goto __3503
	case 0:
		goto __3504
	}
	goto __3501
__3502:
	goto cleanup1
__3503:
	goto cleanup2
__3504:
	goto __3501
__3501:
	;
__3495:
	;
__3490:
	;
	goto __3487
__3487:
	if 0 != 0 {
		goto __3486
	}
	goto __3488
__3488:
	;

__294:
__295:
__296:
__297:
__298:
__299:
	iResult1 = 0
	compare = 0

	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))

	//
	// 	    Try to determine, without triggering generation of a string
	// 	    representation, whether one value is not a number.
	//
	if !(XTclCheckEmptyString(tls, *(*uintptr)(unsafe.Pointer(bp + 944))) > 0 || XTclCheckEmptyString(tls, value2Ptr) > 0) {
		goto __3505
	}
	goto stringCompare
__3505:
	;

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 944)), bp+856, bp+852)
			}()
		}()
	}() != TCL_OK ||
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_LONG
					*(*ClientData)(unsafe.Pointer(bp + 888)) = value2Ptr + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
					return func() int32 {
						if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(value2Ptr + 32))) != 0 {
							*(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_NAN
						} else {
							*(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_DOUBLE
						}
						*(*ClientData)(unsafe.Pointer(bp + 888)) = value2Ptr + 32
						return TCL_OK
					}()
				}
				return func() int32 {
					if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength == 0 {
						return func() int32 { *(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_LONG; return TCL_ERROR }()
					}
					return XTclGetNumberFromObj(tls, uintptr(0), value2Ptr, bp+888, bp+880)
				}()
			}()
		}() != TCL_OK) {
		goto __3506
	}
	// At least one non-numeric argument - compare as strings.

	goto stringCompare
__3506:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_NAN || *(*int32)(unsafe.Pointer(bp + 880)) == TCL_NUMBER_NAN) {
		goto __3507
	}
	// NaN arg: NaN != to everything, other compares are false.

	iResult1 = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_NEQ)
	goto foundResult
__3507:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 944)) == value2Ptr) {
		goto __3508
	}
	compare = MP_EQ
	goto convertComparison
__3508:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_LONG && *(*int32)(unsafe.Pointer(bp + 880)) == TCL_NUMBER_LONG) {
		goto __3509
	}
	l1 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 856))))
	l2 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 888))))
	if l1 < l2 {
		compare = -1
	} else {
		compare = func() int32 {
			if l1 > l2 {
				return MP_GT
			}
			return MP_EQ
		}()
	}
	goto __3510
__3509:
	compare = XTclCompareTwoNumbers(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), value2Ptr)
__3510:
	;

	// Turn comparison outcome into appropriate result for opcode.

convertComparison:
	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_EQ:
		goto __3512
	case INST_NEQ:
		goto __3513
	case INST_LT:
		goto __3514
	case INST_GT:
		goto __3515
	case INST_LE:
		goto __3516
	case INST_GE:
		goto __3517
	}
	goto __3511
__3512:
	iResult1 = libc.Bool32(compare == MP_EQ)
	goto __3511
__3513:
	iResult1 = libc.Bool32(compare != MP_EQ)
	goto __3511
__3514:
	iResult1 = libc.Bool32(compare == -1)
	goto __3511
__3515:
	iResult1 = libc.Bool32(compare == MP_GT)
	goto __3511
__3516:
	iResult1 = libc.Bool32(compare != MP_GT)
	goto __3511
__3517:
	iResult1 = libc.Bool32(compare != -1)
	goto __3511
__3511:
	;

	// Peep-hole optimisation: if you're about to jump, do jump from here.

foundResult:
	;
__3518:
	pc += uintptr(1)
	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_JUMP_FALSE1:
		goto __3522
	case INST_JUMP_TRUE1:
		goto __3523
	case INST_JUMP_FALSE4:
		goto __3524
	case INST_JUMP_TRUE4:
		goto __3525
	default:
		goto __3526
	}
	goto __3521
__3522:
__3527:
	;
	if !(2 == 0) {
		goto __3530
	}
	if !(0 != 0) {
		goto __3532
	}
	if !(0 > 0) {
		goto __3533
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3534
__3533:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3534:
	;
__3532:
	;
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	goto cleanup0
	goto __3531
__3530:
	if !(0 != 0) {
		goto __3535
	}
	if !(0 > 0) {
		goto __3537
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3537:
	;
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 2 {
	case 1:
		goto __3539
	case 2:
		goto __3540
	case 0:
		goto __3541
	}
	goto __3538
__3539:
	goto cleanup1_pushObjResultPtr
__3540:
	goto cleanup2_pushObjResultPtr
__3541:
	goto __3538
__3538:
	;
	goto __3536
__3535:
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 2 {
	case 1:
		goto __3543
	case 2:
		goto __3544
	case 0:
		goto __3545
	}
	goto __3542
__3543:
	goto cleanup1
__3544:
	goto cleanup2
__3545:
	goto __3542
__3542:
	;
__3536:
	;
__3531:
	;
	goto __3528
__3528:
	if 0 != 0 {
		goto __3527
	}
	goto __3529
__3529:
	;
	goto __3521
__3523:
__3546:
	;
	if !(2 == 0) {
		goto __3549
	}
	if !(0 != 0) {
		goto __3551
	}
	if !(0 > 0) {
		goto __3552
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3553
__3552:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3553:
	;
__3551:
	;
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	goto cleanup0
	goto __3550
__3549:
	if !(0 != 0) {
		goto __3554
	}
	if !(0 > 0) {
		goto __3556
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3556:
	;
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 2 {
	case 1:
		goto __3558
	case 2:
		goto __3559
	case 0:
		goto __3560
	}
	goto __3557
__3558:
	goto cleanup1_pushObjResultPtr
__3559:
	goto cleanup2_pushObjResultPtr
__3560:
	goto __3557
__3557:
	;
	goto __3555
__3554:
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 2 {
	case 1:
		goto __3562
	case 2:
		goto __3563
	case 0:
		goto __3564
	}
	goto __3561
__3562:
	goto cleanup1
__3563:
	goto cleanup2
__3564:
	goto __3561
__3561:
	;
__3555:
	;
__3550:
	;
	goto __3547
__3547:
	if 0 != 0 {
		goto __3546
	}
	goto __3548
__3548:
	;
	goto __3521
__3524:
__3565:
	;
	if !(2 == 0) {
		goto __3568
	}
	if !(0 != 0) {
		goto __3570
	}
	if !(0 > 0) {
		goto __3571
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3572
__3571:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3572:
	;
__3570:
	;
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	goto cleanup0
	goto __3569
__3568:
	if !(0 != 0) {
		goto __3573
	}
	if !(0 > 0) {
		goto __3575
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3575:
	;
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 2 {
	case 1:
		goto __3577
	case 2:
		goto __3578
	case 0:
		goto __3579
	}
	goto __3576
__3577:
	goto cleanup1_pushObjResultPtr
__3578:
	goto cleanup2_pushObjResultPtr
__3579:
	goto __3576
__3576:
	;
	goto __3574
__3573:
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 2 {
	case 1:
		goto __3581
	case 2:
		goto __3582
	case 0:
		goto __3583
	}
	goto __3580
__3581:
	goto cleanup1
__3582:
	goto cleanup2
__3583:
	goto __3580
__3580:
	;
__3574:
	;
__3569:
	;
	goto __3566
__3566:
	if 0 != 0 {
		goto __3565
	}
	goto __3567
__3567:
	;
	goto __3521
__3525:
__3584:
	;
	if !(2 == 0) {
		goto __3587
	}
	if !(0 != 0) {
		goto __3589
	}
	if !(0 > 0) {
		goto __3590
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3591
__3590:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3591:
	;
__3589:
	;
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	goto cleanup0
	goto __3588
__3587:
	if !(0 != 0) {
		goto __3592
	}
	if !(0 > 0) {
		goto __3594
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3594:
	;
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 2 {
	case 1:
		goto __3596
	case 2:
		goto __3597
	case 0:
		goto __3598
	}
	goto __3595
__3596:
	goto cleanup1_pushObjResultPtr
__3597:
	goto cleanup2_pushObjResultPtr
__3598:
	goto __3595
__3595:
	;
	goto __3593
__3592:
	pc += func() uintptr {
		if iResult1 != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 2 {
	case 1:
		goto __3600
	case 2:
		goto __3601
	case 0:
		goto __3602
	}
	goto __3599
__3600:
	goto cleanup1
__3601:
	goto cleanup2
__3602:
	goto __3599
__3599:
	;
__3593:
	;
__3588:
	;
	goto __3585
__3585:
	if 0 != 0 {
		goto __3584
	}
	goto __3586
__3586:
	;
	goto __3521
__3526:
	if !(iResult1 < 0) {
		goto __3603
	}
__3605:
	;
__3608:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr77 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr77)).FnumObjects == 0
	}()) {
		goto __3611
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __3612
__3611:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr77)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr77)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr77)).FnumObjects--
__3612:
	;
	goto __3609
__3609:
	if 0 != 0 {
		goto __3608
	}
	goto __3610
__3610:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __3606
__3606:
	if 0 != 0 {
		goto __3605
	}
	goto __3607
__3607:
	;
	goto __3604
__3603:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(libc.Bool32(iResult1 > 0))*8))
__3604:
	;
__3613:
	;
	if !(2 == 0) {
		goto __3616
	}
	if !(1 != 0) {
		goto __3618
	}
	if !(1 > 0) {
		goto __3619
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3620
__3619:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3620:
	;
__3618:
	;
	pc += uintptr(0)
	goto cleanup0
	goto __3617
__3616:
	if !(1 != 0) {
		goto __3621
	}
	if !(1 > 0) {
		goto __3623
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3623:
	;
	pc += uintptr(0)
	switch 2 {
	case 1:
		goto __3625
	case 2:
		goto __3626
	case 0:
		goto __3627
	}
	goto __3624
__3625:
	goto cleanup1_pushObjResultPtr
__3626:
	goto cleanup2_pushObjResultPtr
__3627:
	goto __3624
__3624:
	;
	goto __3622
__3621:
	pc += uintptr(0)
	switch 2 {
	case 1:
		goto __3629
	case 2:
		goto __3630
	case 0:
		goto __3631
	}
	goto __3628
__3629:
	goto cleanup1
__3630:
	goto cleanup2
__3631:
	goto __3628
__3628:
	;
__3622:
	;
__3617:
	;
	goto __3614
__3614:
	if 0 != 0 {
		goto __3613
	}
	goto __3615
__3615:
	;
	goto __3521
__3521:
	;
	goto __3519
__3519:
	if 0 != 0 {
		goto __3518
	}
	goto __3520
__3520:
	;

__300:
__301:
__302:
__303:
__304:
__305:
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 944)), bp+856, bp+852)
			}()
		}()
	}() != TCL_OK ||
		*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_DOUBLE || *(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_NAN) {
		goto __3632
	}

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	sIllegalExprOperandType(tls, interp, pc, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	checkInterp = 1
	goto gotError
__3632:
	;

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 888)) = value2Ptr + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(value2Ptr + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 888)) = value2Ptr + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), value2Ptr, bp+888, bp+880)
			}()
		}()
	}() != TCL_OK ||
		*(*int32)(unsafe.Pointer(bp + 880)) == TCL_NUMBER_DOUBLE || *(*int32)(unsafe.Pointer(bp + 880)) == TCL_NUMBER_NAN) {
		goto __3633
	}

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	sIllegalExprOperandType(tls, interp, pc, value2Ptr)
	checkInterp = 1
	goto gotError
__3633:
	;

	// Check for common, simple case.

	if !(*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_LONG && *(*int32)(unsafe.Pointer(bp + 880)) == TCL_NUMBER_LONG) {
		goto __3634
	}
	l1 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 856))))
	l2 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 888))))

	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_MOD:
		goto __3636

	case INST_RSHIFT:
		goto __3637

	case INST_LSHIFT:
		goto __3638

	case INST_BITAND:
		goto __3639
	case INST_BITOR:
		goto __3640
	case INST_BITXOR:
		goto __3641
	}
	goto __3635
__3636:
	if !(l2 == int64(0)) {
		goto __3642
	}

	goto divideByZero
	goto __3643
__3642:
	if !(l2 == int64(1) || l2 == int64(-1)) {
		goto __3644
	}
	// Div. by |1| always yields remainder of 0.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants))

__3646:
	;
	if !(2 == 0) {
		goto __3649
	}
	if !(1 != 0) {
		goto __3651
	}
	if !(1 > 0) {
		goto __3652
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3653
__3652:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3653:
	;
__3651:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3650
__3649:
	if !(1 != 0) {
		goto __3654
	}
	if !(1 > 0) {
		goto __3656
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3656:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3658
	case 2:
		goto __3659
	case 0:
		goto __3660
	}
	goto __3657
__3658:
	goto cleanup1_pushObjResultPtr
__3659:
	goto cleanup2_pushObjResultPtr
__3660:
	goto __3657
__3657:
	;
	goto __3655
__3654:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3662
	case 2:
		goto __3663
	case 0:
		goto __3664
	}
	goto __3661
__3662:
	goto cleanup1
__3663:
	goto cleanup2
__3664:
	goto __3661
__3661:
	;
__3655:
	;
__3650:
	;
	goto __3647
__3647:
	if 0 != 0 {
		goto __3646
	}
	goto __3648
__3648:
	;
	goto __3645
__3644:
	if !(l1 == int64(0)) {
		goto __3665
	}
	// 0 % (non-zero) always yields remainder of 0.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants))

__3667:
	;
	if !(2 == 0) {
		goto __3670
	}
	if !(1 != 0) {
		goto __3672
	}
	if !(1 > 0) {
		goto __3673
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3674
__3673:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3674:
	;
__3672:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3671
__3670:
	if !(1 != 0) {
		goto __3675
	}
	if !(1 > 0) {
		goto __3677
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3677:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3679
	case 2:
		goto __3680
	case 0:
		goto __3681
	}
	goto __3678
__3679:
	goto cleanup1_pushObjResultPtr
__3680:
	goto cleanup2_pushObjResultPtr
__3681:
	goto __3678
__3678:
	;
	goto __3676
__3675:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3683
	case 2:
		goto __3684
	case 0:
		goto __3685
	}
	goto __3682
__3683:
	goto cleanup1
__3684:
	goto cleanup2
__3685:
	goto __3682
__3682:
	;
__3676:
	;
__3671:
	;
	goto __3668
__3668:
	if 0 != 0 {
		goto __3667
	}
	goto __3669
__3669:
	;
	goto __3666
__3665:
	lResult = l1 / l2

	// Force Tcl's integer division rules.
	// TODO: examine for logic simplification

	if !((lResult < int64(0) || lResult == int64(0) && (l1 < int64(0) && l2 > int64(0) || l1 > int64(0) && l2 < int64(0))) && lResult*l2 != l1) {
		goto __3686
	}
	lResult = lResult - int64(1)
__3686:
	;
	lResult = l1 - l2*lResult
	goto longResultOfArithmetic
__3666:
	;
__3645:
	;
__3643:
	;
	goto __3635

__3637:
	if !(l2 < int64(0)) {
		goto __3687
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+28810, -1))
	goto gotError
	goto __3688
__3687:
	if !(l1 == int64(0)) {
		goto __3689
	}

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants))

__3691:
	;
	if !(2 == 0) {
		goto __3694
	}
	if !(1 != 0) {
		goto __3696
	}
	if !(1 > 0) {
		goto __3697
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3698
__3697:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3698:
	;
__3696:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3695
__3694:
	if !(1 != 0) {
		goto __3699
	}
	if !(1 > 0) {
		goto __3701
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3701:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3703
	case 2:
		goto __3704
	case 0:
		goto __3705
	}
	goto __3702
__3703:
	goto cleanup1_pushObjResultPtr
__3704:
	goto cleanup2_pushObjResultPtr
__3705:
	goto __3702
__3702:
	;
	goto __3700
__3699:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3707
	case 2:
		goto __3708
	case 0:
		goto __3709
	}
	goto __3706
__3707:
	goto cleanup1
__3708:
	goto cleanup2
__3709:
	goto __3706
__3706:
	;
__3700:
	;
__3695:
	;
	goto __3692
__3692:
	if 0 != 0 {
		goto __3691
	}
	goto __3693
__3693:
	;
	goto __3690
__3689:
	// Quickly force large right shifts to 0 or -1.

	if !(l2 >= int64(uint64(8)*uint64(unsafe.Sizeof(int64(0))))) {
		goto __3710
	}
	// We assume that INT_MAX is much larger than the
	// number of bits in a long. This is a pretty safe
	// assumption, given that the former is usually around
	// 4e9 and the latter 32 or 64...

	if !(l1 > 0) {
		goto __3711
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants))
	goto __3712
__3711:
__3713:
	;
__3716:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr78 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr78)).FnumObjects == 0
	}()) {
		goto __3719
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __3720
__3719:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr78)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr78)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr78)).FnumObjects--
__3720:
	;
	goto __3717
__3717:
	if 0 != 0 {
		goto __3716
	}
	goto __3718
__3718:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __3714
__3714:
	if 0 != 0 {
		goto __3713
	}
	goto __3715
__3715:
	;
__3712:
	;

__3721:
	;
	if !(2 == 0) {
		goto __3724
	}
	if !(1 != 0) {
		goto __3726
	}
	if !(1 > 0) {
		goto __3727
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3728
__3727:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3728:
	;
__3726:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3725
__3724:
	if !(1 != 0) {
		goto __3729
	}
	if !(1 > 0) {
		goto __3731
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3731:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3733
	case 2:
		goto __3734
	case 0:
		goto __3735
	}
	goto __3732
__3733:
	goto cleanup1_pushObjResultPtr
__3734:
	goto cleanup2_pushObjResultPtr
__3735:
	goto __3732
__3732:
	;
	goto __3730
__3729:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3737
	case 2:
		goto __3738
	case 0:
		goto __3739
	}
	goto __3736
__3737:
	goto cleanup1
__3738:
	goto cleanup2
__3739:
	goto __3736
__3736:
	;
__3730:
	;
__3725:
	;
	goto __3722
__3722:
	if 0 != 0 {
		goto __3721
	}
	goto __3723
__3723:
	;
__3710:
	;

	// Handle shifts within the native long range.

	lResult = l1 >> int32(l2)
	goto longResultOfArithmetic
__3690:
	;
__3688:
	;
	goto __3635

__3638:
	if !(l2 < int64(0)) {
		goto __3740
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+28810, -1))
	goto gotError
	goto __3741
__3740:
	if !(l1 == int64(0)) {
		goto __3742
	}

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants))

__3744:
	;
	if !(2 == 0) {
		goto __3747
	}
	if !(1 != 0) {
		goto __3749
	}
	if !(1 > 0) {
		goto __3750
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3751
__3750:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3751:
	;
__3749:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3748
__3747:
	if !(1 != 0) {
		goto __3752
	}
	if !(1 > 0) {
		goto __3754
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3754:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3756
	case 2:
		goto __3757
	case 0:
		goto __3758
	}
	goto __3755
__3756:
	goto cleanup1_pushObjResultPtr
__3757:
	goto cleanup2_pushObjResultPtr
__3758:
	goto __3755
__3755:
	;
	goto __3753
__3752:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3760
	case 2:
		goto __3761
	case 0:
		goto __3762
	}
	goto __3759
__3760:
	goto cleanup1
__3761:
	goto cleanup2
__3762:
	goto __3759
__3759:
	;
__3753:
	;
__3748:
	;
	goto __3745
__3745:
	if 0 != 0 {
		goto __3744
	}
	goto __3746
__3746:
	;
	goto __3743
__3742:
	if !(l2 > int64(0x7fffffff)) {
		goto __3763
	}
	// Technically, we could hold the value (1 << (INT_MAX+1))
	// in an mp_int, but since we're using mp_mul_2d() to do
	// the work, and it takes only an int argument, that's a
	// good place to draw the line.

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+10555, -1))
	goto gotError
	goto __3764
__3763:
	shift = int32(l2)

	// Handle shifts within the native long range.

	if !(Size_t(shift) < uint64(8)*uint64(unsafe.Sizeof(int64(0))) && l1 != int64(0) &&
		!(func() int64 {
			if l1 > int64(0) {
				return l1
			}
			return ^l1
		}()&-(int64(1)<<(uint64(8)*uint64(unsafe.Sizeof(int64(0)))-uint64(1)-uint64(shift))) != 0)) {
		goto __3765
	}
	lResult = l1 << shift
	goto longResultOfArithmetic
__3765:
	;
__3764:
	;
__3743:
	;
__3741:
	;

	// Too large; need to use the broken-out function.

	goto __3635

__3639:
	lResult = l1 & l2
	goto longResultOfArithmetic
__3640:
	lResult = l1 | l2
	goto longResultOfArithmetic
__3641:
	lResult = l1 ^ l2
longResultOfArithmetic:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __3766
	}
__3767:
	;
__3770:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr79 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr79)).FnumObjects == 0
	}()) {
		goto __3773
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __3774
__3773:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr79)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr79)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr79)).FnumObjects--
__3774:
	;
	goto __3771
__3771:
	if 0 != 0 {
		goto __3770
	}
	goto __3772
__3772:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = lResult
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __3768
__3768:
	if 0 != 0 {
		goto __3767
	}
	goto __3769
__3769:
	;

__3775:
	;
	if !(2 == 0) {
		goto __3778
	}
	if !(1 != 0) {
		goto __3780
	}
	if !(1 > 0) {
		goto __3781
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3782
__3781:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3782:
	;
__3780:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3779
__3778:
	if !(1 != 0) {
		goto __3783
	}
	if !(1 > 0) {
		goto __3785
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3785:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3787
	case 2:
		goto __3788
	case 0:
		goto __3789
	}
	goto __3786
__3787:
	goto cleanup1_pushObjResultPtr
__3788:
	goto cleanup2_pushObjResultPtr
__3789:
	goto __3786
__3786:
	;
	goto __3784
__3783:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3791
	case 2:
		goto __3792
	case 0:
		goto __3793
	}
	goto __3790
__3791:
	goto cleanup1
__3792:
	goto cleanup2
__3793:
	goto __3790
__3790:
	;
__3784:
	;
__3779:
	;
	goto __3776
__3776:
	if 0 != 0 {
		goto __3775
	}
	goto __3777
__3777:
	;
__3766:
	;
__3794:
__3797:
	_isobjPtr1 = *(*uintptr)(unsafe.Pointer(bp + 944))
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes != uintptr(0)) {
		goto __3800
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes != XtclEmptyStringRep) {
		goto __3801
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes)
__3801:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes = uintptr(0)
__3800:
	;
	goto __3798
__3798:
	if 0 != 0 {
		goto __3797
	}
	goto __3799
__3799:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr != uintptr(0)) {
		goto __3802
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __3803
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr)).FfreeIntRepProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__3803:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr = uintptr(0)
__3802:
	;
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) = lResult
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	goto __3795
__3795:
	if 0 != 0 {
		goto __3794
	}
	goto __3796
__3796:
	;

__3804:
	;
	if !(1 == 0) {
		goto __3807
	}
	if !(0 != 0) {
		goto __3809
	}
	if !(0 > 0) {
		goto __3810
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3811
__3810:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3811:
	;
__3809:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3808
__3807:
	if !(0 != 0) {
		goto __3812
	}
	if !(0 > 0) {
		goto __3814
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3814:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3816
	case 2:
		goto __3817
	case 0:
		goto __3818
	}
	goto __3815
__3816:
	goto cleanup1_pushObjResultPtr
__3817:
	goto cleanup2_pushObjResultPtr
__3818:
	goto __3815
__3815:
	;
	goto __3813
__3812:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3820
	case 2:
		goto __3821
	case 0:
		goto __3822
	}
	goto __3819
__3820:
	goto cleanup1
__3821:
	goto cleanup2
__3822:
	goto __3819
__3819:
	;
__3813:
	;
__3808:
	;
	goto __3805
__3805:
	if 0 != 0 {
		goto __3804
	}
	goto __3806
__3806:
	;
__3635:
	;
__3634:
	;

	// DO NOT MERGE THIS WITH THE EQUIVALENT SECTION LATER! That would
	// encourage the compiler to inline ExecuteExtendedBinaryMathOp, which
	// is highly undesirable due to the overall impact on size.

	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = sExecuteExtendedBinaryMathOp(tls, interp, int32(*(*uint8)(unsafe.Pointer(pc))), constants,
		*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), value2Ptr)
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == libc.UintptrFromInt32(-1)) {
		goto __3823
	}

	goto divideByZero
	goto __3824
__3823:
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == libc.UintptrFromInt32(-3)) {
		goto __3825
	}

	goto gotError
	goto __3826
__3825:
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == uintptr(0)) {
		goto __3827
	}

__3829:
	;
	if !(1 == 0) {
		goto __3832
	}
	if !(0 != 0) {
		goto __3834
	}
	if !(0 > 0) {
		goto __3835
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3836
__3835:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3836:
	;
__3834:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3833
__3832:
	if !(0 != 0) {
		goto __3837
	}
	if !(0 > 0) {
		goto __3839
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3839:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3841
	case 2:
		goto __3842
	case 0:
		goto __3843
	}
	goto __3840
__3841:
	goto cleanup1_pushObjResultPtr
__3842:
	goto cleanup2_pushObjResultPtr
__3843:
	goto __3840
__3840:
	;
	goto __3838
__3837:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3845
	case 2:
		goto __3846
	case 0:
		goto __3847
	}
	goto __3844
__3845:
	goto cleanup1
__3846:
	goto cleanup2
__3847:
	goto __3844
__3844:
	;
__3838:
	;
__3833:
	;
	goto __3830
__3830:
	if 0 != 0 {
		goto __3829
	}
	goto __3831
__3831:
	;
	goto __3828
__3827:
	;
__3848:
	;
	if !(2 == 0) {
		goto __3851
	}
	if !(1 != 0) {
		goto __3853
	}
	if !(1 > 0) {
		goto __3854
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3855
__3854:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3855:
	;
__3853:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3852
__3851:
	if !(1 != 0) {
		goto __3856
	}
	if !(1 > 0) {
		goto __3858
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3858:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3860
	case 2:
		goto __3861
	case 0:
		goto __3862
	}
	goto __3859
__3860:
	goto cleanup1_pushObjResultPtr
__3861:
	goto cleanup2_pushObjResultPtr
__3862:
	goto __3859
__3859:
	;
	goto __3857
__3856:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3864
	case 2:
		goto __3865
	case 0:
		goto __3866
	}
	goto __3863
__3864:
	goto cleanup1
__3865:
	goto cleanup2
__3866:
	goto __3863
__3863:
	;
__3857:
	;
__3852:
	;
	goto __3849
__3849:
	if 0 != 0 {
		goto __3848
	}
	goto __3850
__3850:
	;
__3828:
	;
__3826:
	;
__3824:
	;

__306:
__307:
__308:
__309:
__310:
	value2Ptr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 944)), bp+856, bp+852)
			}()
		}()
	}() != TCL_OK ||
		*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_NAN) {
		goto __3867
	}

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	sIllegalExprOperandType(tls, interp, pc, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	checkInterp = 1
	goto gotError
__3867:
	;

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 888)) = value2Ptr + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(value2Ptr + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 888)) = value2Ptr + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 880)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), value2Ptr, bp+888, bp+880)
			}()
		}()
	}() != TCL_OK ||
		*(*int32)(unsafe.Pointer(bp + 880)) == TCL_NUMBER_NAN) {
		goto __3868
	}

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	sIllegalExprOperandType(tls, interp, pc, value2Ptr)
	checkInterp = 1
	goto gotError
__3868:
	;

	// Handle (long,long) arithmetic as best we can without going out to
	// an external function.

	if !(*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_LONG && *(*int32)(unsafe.Pointer(bp + 880)) == TCL_NUMBER_LONG) {
		goto __3869
	}

	l1 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 856))))
	l2 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 888))))

	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_ADD:
		goto __3871

	case INST_SUB:
		goto __3872

	case INST_DIV:
		goto __3873

	case INST_MULT:
		goto __3874
	}
	goto __3870
__3871:
	w1 = l1
	w2 = l2
	wResult = w1 + w2
	// Check for overflow.

	if !(w1^wResult < int64(0) && w1^w2 >= int64(0)) {
		goto __3875
	}
	goto overflow
__3875:
	;
	goto wideResultOfArithmetic

__3872:
	w1 = l1
	w2 = l2
	wResult = w1 - w2
	// Must check for overflow. The macro tests for overflows in
	// sums by looking at the sign bits. As we have a subtraction
	// here, we are adding -w2. As -w2 could in turn overflow, we
	// test with ~w2 instead: it has the opposite sign bit to w2
	// so it does the job. Note that the only "bad" case (w2==0)
	// is irrelevant for this macro, as in that case w1 and
	// wResult have the same sign and there is no overflow anyway.

	if !(w1^wResult < int64(0) && w1^^w2 >= int64(0)) {
		goto __3876
	}
	goto overflow
__3876:
	;
wideResultOfArithmetic:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __3877
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewWideIntObj(tls, wResult)

__3878:
	;
	if !(2 == 0) {
		goto __3881
	}
	if !(1 != 0) {
		goto __3883
	}
	if !(1 > 0) {
		goto __3884
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3885
__3884:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3885:
	;
__3883:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3882
__3881:
	if !(1 != 0) {
		goto __3886
	}
	if !(1 > 0) {
		goto __3888
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3888:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3890
	case 2:
		goto __3891
	case 0:
		goto __3892
	}
	goto __3889
__3890:
	goto cleanup1_pushObjResultPtr
__3891:
	goto cleanup2_pushObjResultPtr
__3892:
	goto __3889
__3889:
	;
	goto __3887
__3886:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3894
	case 2:
		goto __3895
	case 0:
		goto __3896
	}
	goto __3893
__3894:
	goto cleanup1
__3895:
	goto cleanup2
__3896:
	goto __3893
__3893:
	;
__3887:
	;
__3882:
	;
	goto __3879
__3879:
	if 0 != 0 {
		goto __3878
	}
	goto __3880
__3880:
	;
__3877:
	;
	XTcl_SetWideIntObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), wResult)

__3897:
	;
	if !(1 == 0) {
		goto __3900
	}
	if !(0 != 0) {
		goto __3902
	}
	if !(0 > 0) {
		goto __3903
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3904
__3903:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3904:
	;
__3902:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3901
__3900:
	if !(0 != 0) {
		goto __3905
	}
	if !(0 > 0) {
		goto __3907
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3907:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3909
	case 2:
		goto __3910
	case 0:
		goto __3911
	}
	goto __3908
__3909:
	goto cleanup1_pushObjResultPtr
__3910:
	goto cleanup2_pushObjResultPtr
__3911:
	goto __3908
__3908:
	;
	goto __3906
__3905:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3913
	case 2:
		goto __3914
	case 0:
		goto __3915
	}
	goto __3912
__3913:
	goto cleanup1
__3914:
	goto cleanup2
__3915:
	goto __3912
__3912:
	;
__3906:
	;
__3901:
	;
	goto __3898
__3898:
	if 0 != 0 {
		goto __3897
	}
	goto __3899
__3899:
	;
	goto __3870

__3873:
	if !(l2 == int64(0)) {
		goto __3916
	}

	goto divideByZero
	goto __3917
__3916:
	if !(l1 == -0x7fffffffffffffff-1 && l2 == int64(-1)) {
		goto __3918
	}
	// Can't represent (-LONG_MIN) as a long.

	goto overflow
__3918:
	;
__3917:
	;
	lResult = l1 / l2

	// Force Tcl's integer division rules.
	// TODO: examine for logic simplification

	if !((lResult < int64(0) || lResult == int64(0) && (l1 < int64(0) && l2 > int64(0) || l1 > int64(0) && l2 < int64(0))) && lResult*l2 != l1) {
		goto __3919
	}
	lResult = lResult - int64(1)
__3919:
	;
	goto longResultOfArithmetic

__3874:
	if !(uint64(unsafe.Sizeof(int64(0))) >= uint64(2)*uint64(unsafe.Sizeof(int32(0))) &&
		l1 <= int64(0x7fffffff) && l1 >= int64(-0x7fffffff-1) &&
		l2 <= int64(0x7fffffff) && l2 >= int64(-0x7fffffff-1) ||
		uint64(unsafe.Sizeof(int64(0))) >= uint64(2)*uint64(unsafe.Sizeof(int16(0))) &&
			l1 <= int64(0x7fff) && l1 >= int64(-0x7fff-1) &&
			l2 <= int64(0x7fff) && l2 >= int64(-0x7fff-1)) {
		goto __3920
	}
	lResult = l1 * l2
	goto longResultOfArithmetic
__3920:
	;
__3870:
	;

	// Fall through with INST_EXPON, INST_DIV and large multiplies.
__3869:
	;

overflow:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = sExecuteExtendedBinaryMathOp(tls, interp, int32(*(*uint8)(unsafe.Pointer(pc))), constants,
		*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), value2Ptr)
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == libc.UintptrFromInt32(-1)) {
		goto __3921
	}

	goto divideByZero
	goto __3922
__3921:
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == libc.UintptrFromInt32(-2)) {
		goto __3923
	}

	goto exponOfZero
	goto __3924
__3923:
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == libc.UintptrFromInt32(-3)) {
		goto __3925
	}

	goto gotError
	goto __3926
__3925:
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == uintptr(0)) {
		goto __3927
	}

__3929:
	;
	if !(1 == 0) {
		goto __3932
	}
	if !(0 != 0) {
		goto __3934
	}
	if !(0 > 0) {
		goto __3935
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3936
__3935:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3936:
	;
__3934:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3933
__3932:
	if !(0 != 0) {
		goto __3937
	}
	if !(0 > 0) {
		goto __3939
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3939:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3941
	case 2:
		goto __3942
	case 0:
		goto __3943
	}
	goto __3940
__3941:
	goto cleanup1_pushObjResultPtr
__3942:
	goto cleanup2_pushObjResultPtr
__3943:
	goto __3940
__3940:
	;
	goto __3938
__3937:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3945
	case 2:
		goto __3946
	case 0:
		goto __3947
	}
	goto __3944
__3945:
	goto cleanup1
__3946:
	goto cleanup2
__3947:
	goto __3944
__3944:
	;
__3938:
	;
__3933:
	;
	goto __3930
__3930:
	if 0 != 0 {
		goto __3929
	}
	goto __3931
__3931:
	;
	goto __3928
__3927:
	;
__3948:
	;
	if !(2 == 0) {
		goto __3951
	}
	if !(1 != 0) {
		goto __3953
	}
	if !(1 > 0) {
		goto __3954
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3955
__3954:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3955:
	;
__3953:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3952
__3951:
	if !(1 != 0) {
		goto __3956
	}
	if !(1 > 0) {
		goto __3958
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3958:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3960
	case 2:
		goto __3961
	case 0:
		goto __3962
	}
	goto __3959
__3960:
	goto cleanup1_pushObjResultPtr
__3961:
	goto cleanup2_pushObjResultPtr
__3962:
	goto __3959
__3959:
	;
	goto __3957
__3956:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __3964
	case 2:
		goto __3965
	case 0:
		goto __3966
	}
	goto __3963
__3964:
	goto cleanup1
__3965:
	goto cleanup2
__3966:
	goto __3963
__3963:
	;
__3957:
	;
__3952:
	;
	goto __3949
__3949:
	if 0 != 0 {
		goto __3948
	}
	goto __3950
__3950:
	;
__3928:
	;
__3926:
	;
__3924:
	;
__3922:
	;

__311:

	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))

	// TODO - check claim that taking address of b harms performance
	// TODO - consider optimization search for constants
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) || (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclBooleanType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 896)) = libc.Bool32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) != int64(0))
				return TCL_OK
			}()
		}
		return XTcl_GetBooleanFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 944)), bp+896)
	}() != TCL_OK) {
		goto __3967
	}

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	sIllegalExprOperandType(tls, interp, pc, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	checkInterp = 1
	goto gotError
__3967:
	;
	// TODO: Consider peephole opt.
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(libc.BoolInt32(!(*(*int32)(unsafe.Pointer(bp + 896)) != 0)))*8))

__3968:
	;
	if !(1 == 0) {
		goto __3971
	}
	if !(1 != 0) {
		goto __3973
	}
	if !(1 > 0) {
		goto __3974
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __3975
__3974:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__3975:
	;
__3973:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __3972
__3971:
	if !(1 != 0) {
		goto __3976
	}
	if !(1 > 0) {
		goto __3978
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__3978:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3980
	case 2:
		goto __3981
	case 0:
		goto __3982
	}
	goto __3979
__3980:
	goto cleanup1_pushObjResultPtr
__3981:
	goto cleanup2_pushObjResultPtr
__3982:
	goto __3979
__3979:
	;
	goto __3977
__3976:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __3984
	case 2:
		goto __3985
	case 0:
		goto __3986
	}
	goto __3983
__3984:
	goto cleanup1
__3985:
	goto cleanup2
__3986:
	goto __3983
__3983:
	;
__3977:
	;
__3972:
	;
	goto __3969
__3969:
	if 0 != 0 {
		goto __3968
	}
	goto __3970
__3970:
	;

__312:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 944)), bp+856, bp+852)
			}()
		}()
	}() != TCL_OK ||
		*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_NAN || *(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_DOUBLE) {
		goto __3987
	}
	// ... ~$NonInteger => raise an error.

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	sIllegalExprOperandType(tls, interp, pc, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	checkInterp = 1
	goto gotError
__3987:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_LONG) {
		goto __3988
	}
	l1 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 856))))
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __3989
	}
__3990:
	;
__3993:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr80 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr80)).FnumObjects == 0
	}()) {
		goto __3996
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __3997
__3996:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr80)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr80)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr80)).FnumObjects--
__3997:
	;
	goto __3994
__3994:
	if 0 != 0 {
		goto __3993
	}
	goto __3995
__3995:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = ^l1
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __3991
__3991:
	if 0 != 0 {
		goto __3990
	}
	goto __3992
__3992:
	;

__3998:
	;
	if !(1 == 0) {
		goto __4001
	}
	if !(1 != 0) {
		goto __4003
	}
	if !(1 > 0) {
		goto __4004
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4005
__4004:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4005:
	;
__4003:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4002
__4001:
	if !(1 != 0) {
		goto __4006
	}
	if !(1 > 0) {
		goto __4008
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4008:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4010
	case 2:
		goto __4011
	case 0:
		goto __4012
	}
	goto __4009
__4010:
	goto cleanup1_pushObjResultPtr
__4011:
	goto cleanup2_pushObjResultPtr
__4012:
	goto __4009
__4009:
	;
	goto __4007
__4006:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4014
	case 2:
		goto __4015
	case 0:
		goto __4016
	}
	goto __4013
__4014:
	goto cleanup1
__4015:
	goto cleanup2
__4016:
	goto __4013
__4013:
	;
__4007:
	;
__4002:
	;
	goto __3999
__3999:
	if 0 != 0 {
		goto __3998
	}
	goto __4000
__4000:
	;
__3989:
	;
__4017:
__4020:
	_isobjPtr2 = *(*uintptr)(unsafe.Pointer(bp + 944))
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes != uintptr(0)) {
		goto __4023
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes != XtclEmptyStringRep) {
		goto __4024
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes)
__4024:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes = uintptr(0)
__4023:
	;
	goto __4021
__4021:
	if 0 != 0 {
		goto __4020
	}
	goto __4022
__4022:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr != uintptr(0)) {
		goto __4025
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __4026
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr)).FfreeIntRepProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__4026:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr = uintptr(0)
__4025:
	;
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) = ^l1
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	goto __4018
__4018:
	if 0 != 0 {
		goto __4017
	}
	goto __4019
__4019:
	;

__4027:
	;
	if !(0 == 0) {
		goto __4030
	}
	if !(0 != 0) {
		goto __4032
	}
	if !(0 > 0) {
		goto __4033
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4034
__4033:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4034:
	;
__4032:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4031
__4030:
	if !(0 != 0) {
		goto __4035
	}
	if !(0 > 0) {
		goto __4037
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4037:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4039
	case 2:
		goto __4040
	case 0:
		goto __4041
	}
	goto __4038
__4039:
	goto cleanup1_pushObjResultPtr
__4040:
	goto cleanup2_pushObjResultPtr
__4041:
	goto __4038
__4038:
	;
	goto __4036
__4035:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4043
	case 2:
		goto __4044
	case 0:
		goto __4045
	}
	goto __4042
__4043:
	goto cleanup1
__4044:
	goto cleanup2
__4045:
	goto __4042
__4042:
	;
__4036:
	;
__4031:
	;
	goto __4028
__4028:
	if 0 != 0 {
		goto __4027
	}
	goto __4029
__4029:
	;
__3988:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = sExecuteExtendedUnaryMathOp(tls, int32(*(*uint8)(unsafe.Pointer(pc))), *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) != uintptr(0)) {
		goto __4046
	}

__4048:
	;
	if !(1 == 0) {
		goto __4051
	}
	if !(1 != 0) {
		goto __4053
	}
	if !(1 > 0) {
		goto __4054
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4055
__4054:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4055:
	;
__4053:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4052
__4051:
	if !(1 != 0) {
		goto __4056
	}
	if !(1 > 0) {
		goto __4058
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4058:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4060
	case 2:
		goto __4061
	case 0:
		goto __4062
	}
	goto __4059
__4060:
	goto cleanup1_pushObjResultPtr
__4061:
	goto cleanup2_pushObjResultPtr
__4062:
	goto __4059
__4059:
	;
	goto __4057
__4056:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4064
	case 2:
		goto __4065
	case 0:
		goto __4066
	}
	goto __4063
__4064:
	goto cleanup1
__4065:
	goto cleanup2
__4066:
	goto __4063
__4063:
	;
__4057:
	;
__4052:
	;
	goto __4049
__4049:
	if 0 != 0 {
		goto __4048
	}
	goto __4050
__4050:
	;
	goto __4047
__4046:
	;
__4067:
	;
	if !(0 == 0) {
		goto __4070
	}
	if !(0 != 0) {
		goto __4072
	}
	if !(0 > 0) {
		goto __4073
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4074
__4073:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4074:
	;
__4072:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4071
__4070:
	if !(0 != 0) {
		goto __4075
	}
	if !(0 > 0) {
		goto __4077
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4077:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4079
	case 2:
		goto __4080
	case 0:
		goto __4081
	}
	goto __4078
__4079:
	goto cleanup1_pushObjResultPtr
__4080:
	goto cleanup2_pushObjResultPtr
__4081:
	goto __4078
__4078:
	;
	goto __4076
__4075:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4083
	case 2:
		goto __4084
	case 0:
		goto __4085
	}
	goto __4082
__4083:
	goto cleanup1
__4084:
	goto cleanup2
__4085:
	goto __4082
__4082:
	;
__4076:
	;
__4071:
	;
	goto __4068
__4068:
	if 0 != 0 {
		goto __4067
	}
	goto __4069
__4069:
	;
__4047:
	;

__313:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 944)), bp+856, bp+852)
			}()
		}()
	}() != TCL_OK ||
		*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_NAN) {
		goto __4086
	}

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	sIllegalExprOperandType(tls, interp, pc, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	checkInterp = 1
	goto gotError
__4086:
	;
	switch *(*int32)(unsafe.Pointer(bp + 852 /* type11 */)) {
	case TCL_NUMBER_NAN:
		goto __4088
	case TCL_NUMBER_LONG:
		goto __4089
	}
	goto __4087
__4088:
	// -NaN => NaN
	;
__4090:
	;
	if !(0 == 0) {
		goto __4093
	}
	if !(0 != 0) {
		goto __4095
	}
	if !(0 > 0) {
		goto __4096
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4097
__4096:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4097:
	;
__4095:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4094
__4093:
	if !(0 != 0) {
		goto __4098
	}
	if !(0 > 0) {
		goto __4100
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4100:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4102
	case 2:
		goto __4103
	case 0:
		goto __4104
	}
	goto __4101
__4102:
	goto cleanup1_pushObjResultPtr
__4103:
	goto cleanup2_pushObjResultPtr
__4104:
	goto __4101
__4101:
	;
	goto __4099
__4098:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4106
	case 2:
		goto __4107
	case 0:
		goto __4108
	}
	goto __4105
__4106:
	goto cleanup1
__4107:
	goto cleanup2
__4108:
	goto __4105
__4105:
	;
__4099:
	;
__4094:
	;
	goto __4091
__4091:
	if 0 != 0 {
		goto __4090
	}
	goto __4092
__4092:
	;
	goto __4087
__4089:
	l1 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 856))))
	if !(l1 != -0x7fffffffffffffff-1) {
		goto __4109
	}
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __4110
	}
__4111:
	;
__4114:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr81 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr81)).FnumObjects == 0
	}()) {
		goto __4117
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __4118
__4117:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr81)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr81)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr81)).FnumObjects--
__4118:
	;
	goto __4115
__4115:
	if 0 != 0 {
		goto __4114
	}
	goto __4116
__4116:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = -l1
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __4112
__4112:
	if 0 != 0 {
		goto __4111
	}
	goto __4113
__4113:
	;

__4119:
	;
	if !(1 == 0) {
		goto __4122
	}
	if !(1 != 0) {
		goto __4124
	}
	if !(1 > 0) {
		goto __4125
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4126
__4125:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4126:
	;
__4124:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4123
__4122:
	if !(1 != 0) {
		goto __4127
	}
	if !(1 > 0) {
		goto __4129
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4129:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4131
	case 2:
		goto __4132
	case 0:
		goto __4133
	}
	goto __4130
__4131:
	goto cleanup1_pushObjResultPtr
__4132:
	goto cleanup2_pushObjResultPtr
__4133:
	goto __4130
__4130:
	;
	goto __4128
__4127:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4135
	case 2:
		goto __4136
	case 0:
		goto __4137
	}
	goto __4134
__4135:
	goto cleanup1
__4136:
	goto cleanup2
__4137:
	goto __4134
__4134:
	;
__4128:
	;
__4123:
	;
	goto __4120
__4120:
	if 0 != 0 {
		goto __4119
	}
	goto __4121
__4121:
	;
__4110:
	;
__4138:
__4141:
	_isobjPtr3 = *(*uintptr)(unsafe.Pointer(bp + 944))
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr3)).Fbytes != uintptr(0)) {
		goto __4144
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr3)).Fbytes != XtclEmptyStringRep) {
		goto __4145
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr3)).Fbytes)
__4145:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr3)).Fbytes = uintptr(0)
__4144:
	;
	goto __4142
__4142:
	if 0 != 0 {
		goto __4141
	}
	goto __4143
__4143:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr != uintptr(0)) {
		goto __4146
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __4147
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr)).FfreeIntRepProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__4147:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr = uintptr(0)
__4146:
	;
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) = -l1
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	goto __4139
__4139:
	if 0 != 0 {
		goto __4138
	}
	goto __4140
__4140:
	;

__4148:
	;
	if !(0 == 0) {
		goto __4151
	}
	if !(0 != 0) {
		goto __4153
	}
	if !(0 > 0) {
		goto __4154
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4155
__4154:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4155:
	;
__4153:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4152
__4151:
	if !(0 != 0) {
		goto __4156
	}
	if !(0 > 0) {
		goto __4158
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4158:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4160
	case 2:
		goto __4161
	case 0:
		goto __4162
	}
	goto __4159
__4160:
	goto cleanup1_pushObjResultPtr
__4161:
	goto cleanup2_pushObjResultPtr
__4162:
	goto __4159
__4159:
	;
	goto __4157
__4156:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4164
	case 2:
		goto __4165
	case 0:
		goto __4166
	}
	goto __4163
__4164:
	goto cleanup1
__4165:
	goto cleanup2
__4166:
	goto __4163
__4163:
	;
__4157:
	;
__4152:
	;
	goto __4149
__4149:
	if 0 != 0 {
		goto __4148
	}
	goto __4150
__4150:
	;
__4109:
	;
	// FALLTHROUGH
__4087:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = sExecuteExtendedUnaryMathOp(tls, int32(*(*uint8)(unsafe.Pointer(pc))), *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) != uintptr(0)) {
		goto __4167
	}

__4169:
	;
	if !(1 == 0) {
		goto __4172
	}
	if !(1 != 0) {
		goto __4174
	}
	if !(1 > 0) {
		goto __4175
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4176
__4175:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4176:
	;
__4174:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4173
__4172:
	if !(1 != 0) {
		goto __4177
	}
	if !(1 > 0) {
		goto __4179
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4179:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4181
	case 2:
		goto __4182
	case 0:
		goto __4183
	}
	goto __4180
__4181:
	goto cleanup1_pushObjResultPtr
__4182:
	goto cleanup2_pushObjResultPtr
__4183:
	goto __4180
__4180:
	;
	goto __4178
__4177:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4185
	case 2:
		goto __4186
	case 0:
		goto __4187
	}
	goto __4184
__4185:
	goto cleanup1
__4186:
	goto cleanup2
__4187:
	goto __4184
__4184:
	;
__4178:
	;
__4173:
	;
	goto __4170
__4170:
	if 0 != 0 {
		goto __4169
	}
	goto __4171
__4171:
	;
	goto __4168
__4167:
	;
__4188:
	;
	if !(0 == 0) {
		goto __4191
	}
	if !(0 != 0) {
		goto __4193
	}
	if !(0 > 0) {
		goto __4194
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4195
__4194:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4195:
	;
__4193:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4192
__4191:
	if !(0 != 0) {
		goto __4196
	}
	if !(0 > 0) {
		goto __4198
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4198:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4200
	case 2:
		goto __4201
	case 0:
		goto __4202
	}
	goto __4199
__4200:
	goto cleanup1_pushObjResultPtr
__4201:
	goto cleanup2_pushObjResultPtr
__4202:
	goto __4199
__4199:
	;
	goto __4197
__4196:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4204
	case 2:
		goto __4205
	case 0:
		goto __4206
	}
	goto __4203
__4204:
	goto cleanup1
__4205:
	goto cleanup2
__4206:
	goto __4203
__4203:
	;
__4197:
	;
__4192:
	;
	goto __4189
__4189:
	if 0 != 0 {
		goto __4188
	}
	goto __4190
__4190:
	;
__4168:
	;

__314:
__315:
	// Try to convert the topmost stack object to numeric object. This is
	// done in order to support [expr]'s policy of interpreting operands
	// if at all possible as numbers first, then strings.

	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 856)) = *(*uintptr)(unsafe.Pointer(bp + 944)) + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 852)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 944)), bp+856, bp+852)
			}()
		}()
	}() != TCL_OK) {
		goto __4207
	}
	if !(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_UPLUS) {
		goto __4208
	}
	// ... +$NonNumeric => raise an error.

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	sIllegalExprOperandType(tls, interp, pc, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	checkInterp = 1
	goto gotError
__4208:
	;

	// ... TryConvertToNumeric($NonNumeric) is acceptable

__4209:
	;
	if !(0 == 0) {
		goto __4212
	}
	if !(0 != 0) {
		goto __4214
	}
	if !(0 > 0) {
		goto __4215
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4216
__4215:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4216:
	;
__4214:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4213
__4212:
	if !(0 != 0) {
		goto __4217
	}
	if !(0 > 0) {
		goto __4219
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4219:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4221
	case 2:
		goto __4222
	case 0:
		goto __4223
	}
	goto __4220
__4221:
	goto cleanup1_pushObjResultPtr
__4222:
	goto cleanup2_pushObjResultPtr
__4223:
	goto __4220
__4220:
	;
	goto __4218
__4217:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4225
	case 2:
		goto __4226
	case 0:
		goto __4227
	}
	goto __4224
__4225:
	goto cleanup1
__4226:
	goto cleanup2
__4227:
	goto __4224
__4224:
	;
__4218:
	;
__4213:
	;
	goto __4210
__4210:
	if 0 != 0 {
		goto __4209
	}
	goto __4211
__4211:
	;
__4207:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 852)) == TCL_NUMBER_NAN) {
		goto __4228
	}
	if !(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_UPLUS) {
		goto __4229
	}
	// ... +$NonNumeric => raise an error.

	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	sIllegalExprOperandType(tls, interp, pc, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	checkInterp = 1
	goto __4230
__4229:
	// Numeric conversion of NaN -> error.

	;
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTclExprFloatError(tls, interp, *(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 856)))))
	checkInterp = 1
__4230:
	;
	goto gotError
__4228:
	;

	// Ensure that the numeric value has a string rep the same as the
	// formatted version of its internal rep. This is used, e.g., to make
	// sure that "expr {0001}" yields "1", not "0001". We implement this
	// by _discarding_ the string rep since we know it will be
	// regenerated, if needed later, by formatting the internal rep's
	// value.

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes == uintptr(0)) {
		goto __4231
	}

__4232:
	;
	if !(0 == 0) {
		goto __4235
	}
	if !(0 != 0) {
		goto __4237
	}
	if !(0 > 0) {
		goto __4238
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4239
__4238:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4239:
	;
__4237:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4236
__4235:
	if !(0 != 0) {
		goto __4240
	}
	if !(0 > 0) {
		goto __4242
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4242:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4244
	case 2:
		goto __4245
	case 0:
		goto __4246
	}
	goto __4243
__4244:
	goto cleanup1_pushObjResultPtr
__4245:
	goto cleanup2_pushObjResultPtr
__4246:
	goto __4243
__4243:
	;
	goto __4241
__4240:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4248
	case 2:
		goto __4249
	case 0:
		goto __4250
	}
	goto __4247
__4248:
	goto cleanup1
__4249:
	goto cleanup2
__4250:
	goto __4247
__4247:
	;
__4241:
	;
__4236:
	;
	goto __4233
__4233:
	if 0 != 0 {
		goto __4232
	}
	goto __4234
__4234:
	;
__4231:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __4251
	}
	// Here we do some surgery within the Tcl_Obj internals. We want
	// to copy the internalrep, but not the string, so we temporarily hide
	// the string so we do not copy it.

	savedString = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).Fbytes

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).Fbytes = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).Fbytes = savedString

__4252:
	;
	if !(1 == 0) {
		goto __4255
	}
	if !(1 != 0) {
		goto __4257
	}
	if !(1 > 0) {
		goto __4258
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4259
__4258:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4259:
	;
__4257:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4256
__4255:
	if !(1 != 0) {
		goto __4260
	}
	if !(1 > 0) {
		goto __4262
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4262:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4264
	case 2:
		goto __4265
	case 0:
		goto __4266
	}
	goto __4263
__4264:
	goto cleanup1_pushObjResultPtr
__4265:
	goto cleanup2_pushObjResultPtr
__4266:
	goto __4263
__4263:
	;
	goto __4261
__4260:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4268
	case 2:
		goto __4269
	case 0:
		goto __4270
	}
	goto __4267
__4268:
	goto cleanup1
__4269:
	goto cleanup2
__4270:
	goto __4267
__4267:
	;
__4261:
	;
__4256:
	;
	goto __4253
__4253:
	if 0 != 0 {
		goto __4252
	}
	goto __4254
__4254:
	;
__4251:
	;
__4271:
	_isobjPtr4 = *(*uintptr)(unsafe.Pointer(bp + 944))
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr4)).Fbytes != uintptr(0)) {
		goto __4274
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr4)).Fbytes != XtclEmptyStringRep) {
		goto __4275
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr4)).Fbytes)
__4275:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr4)).Fbytes = uintptr(0)
__4274:
	;
	goto __4272
__4272:
	if 0 != 0 {
		goto __4271
	}
	goto __4273
__4273:
	;

__4276:
	;
	if !(0 == 0) {
		goto __4279
	}
	if !(0 != 0) {
		goto __4281
	}
	if !(0 > 0) {
		goto __4282
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4283
__4282:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4283:
	;
__4281:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4280
__4279:
	if !(0 != 0) {
		goto __4284
	}
	if !(0 > 0) {
		goto __4286
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4286:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4288
	case 2:
		goto __4289
	case 0:
		goto __4290
	}
	goto __4287
__4288:
	goto cleanup1_pushObjResultPtr
__4289:
	goto cleanup2_pushObjResultPtr
__4290:
	goto __4287
__4287:
	;
	goto __4285
__4284:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4292
	case 2:
		goto __4293
	case 0:
		goto __4294
	}
	goto __4291
__4292:
	goto cleanup1
__4293:
	goto cleanup2
__4294:
	goto __4291
__4291:
	;
__4285:
	;
__4280:
	;
	goto __4277
__4277:
	if 0 != 0 {
		goto __4276
	}
	goto __4278
__4278:
	;

	goto __159

	//	   End of numeric operator instructions.
	// -----------------------------------------------------------------

__316:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(tosPtr))
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr == uintptr(unsafe.Pointer(&XtclBooleanType))) {
		goto __4295
	}
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + 1*8))
	goto __4296
__4295:
	res = libc.Bool32(XTclSetBooleanFromAny(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 944))) == TCL_OK)
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(res)*8))
__4296:
	;

__4297:
	;
	if !(0 == 0) {
		goto __4300
	}
	if !(1 != 0) {
		goto __4302
	}
	if !(1 > 0) {
		goto __4303
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4304
__4303:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4304:
	;
__4302:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4301
__4300:
	if !(1 != 0) {
		goto __4305
	}
	if !(1 > 0) {
		goto __4307
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4307:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4309
	case 2:
		goto __4310
	case 0:
		goto __4311
	}
	goto __4308
__4309:
	goto cleanup1_pushObjResultPtr
__4310:
	goto cleanup2_pushObjResultPtr
__4311:
	goto __4308
__4308:
	;
	goto __4306
__4305:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4313
	case 2:
		goto __4314
	case 0:
		goto __4315
	}
	goto __4312
__4313:
	goto cleanup1
__4314:
	goto cleanup2
__4315:
	goto __4312
__4312:
	;
__4306:
	;
__4301:
	;
	goto __4298
__4298:
	if 0 != 0 {
		goto __4297
	}
	goto __4299
__4299:
	;
	goto __159

__317:
	//
	// 	DECACHE_STACK_INFO();
	// 	Tcl_ResetResult(interp);
	// 	CACHE_STACK_INFO();
	//
	result = TCL_BREAK
	cleanup = 0

	goto processExceptionReturn

__318:
	//
	// 	DECACHE_STACK_INFO();
	// 	Tcl_ResetResult(interp);
	// 	CACHE_STACK_INFO();
	//
	result = TCL_CONTINUE
	cleanup = 0

	goto processExceptionReturn

__319: // DEPRECATED
	// Initialize the temporary local var that holds the count of the
	// number of iterations of the loop body to -1.

	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	infoPtr = (*AuxData)(unsafe.Pointer((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FauxDataArrayPtr + uintptr(opnd)*16)).FclientData
	iterTmpIndex = (*ForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp
	iterVarPtr = compiledLocals + uintptr(iterTmpIndex)*16
	oldValuePtr = *(*uintptr)(unsafe.Pointer(iterVarPtr + 8))

	if !(oldValuePtr == uintptr(0)) {
		goto __4316
	}
__4318:
	;
__4321:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr82 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr82)).FnumObjects == 0
	}()) {
		goto __4324
	}
	*(*uintptr)(unsafe.Pointer(iterVarPtr + 8)) = XTclThreadAllocObj(tls)
	goto __4325
__4324:
	*(*uintptr)(unsafe.Pointer(iterVarPtr + 8)) = (*AllocCache)(unsafe.Pointer(cachePtr82)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr82)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(iterVarPtr + 8)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr82)).FnumObjects--
__4325:
	;
	goto __4322
__4322:
	if 0 != 0 {
		goto __4321
	}
	goto __4323
__4323:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(iterVarPtr + 8)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(iterVarPtr + 8)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(iterVarPtr + 8)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(iterVarPtr + 8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __4319
__4319:
	if 0 != 0 {
		goto __4318
	}
	goto __4320
__4320:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(iterVarPtr + 8)))).FrefCount++
	goto __4317
__4316:
__4326:
__4329:
	_isobjPtr5 = oldValuePtr
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr5)).Fbytes != uintptr(0)) {
		goto __4332
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr5)).Fbytes != XtclEmptyStringRep) {
		goto __4333
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr5)).Fbytes)
__4333:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr5)).Fbytes = uintptr(0)
__4332:
	;
	goto __4330
__4330:
	if 0 != 0 {
		goto __4329
	}
	goto __4331
__4331:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr != uintptr(0)) {
		goto __4334
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __4335
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr)).FfreeIntRepProc})).f(tls, oldValuePtr)
__4335:
	;
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr = uintptr(0)
__4334:
	;
	*(*int64)(unsafe.Pointer(oldValuePtr + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	goto __4327
__4327:
	if 0 != 0 {
		goto __4326
	}
	goto __4328
__4328:
	;
__4317:
	;

	// Remark that the compiler ALWAYS sets INST_FOREACH_STEP4 immediately
	// after INST_FOREACH_START4 - let us just fall through instead of
	// jumping back to the top.

	pc += uintptr(5)
__4336:
	if !(0 != 0) {
		goto __4339
	}
	if !(curInstName != 0) {
		goto __4341
	}

__4341:
	;
	curInstName = XtclInstructionTable[*(*uint8)(unsafe.Pointer(pc))].Fname
	if !(0 != 0) {
		goto __4342
	}

__4342:
	;
	goto __4340
__4339:
	if !(0 != 0) {
		goto __4343
	}

__4343:
	;
__4340:
	;
	goto __4337
__4337:
	if 0 != 0 {
		goto __4336
	}
	goto __4338
__4338:
	;

__320: // DEPRECATED
	// "Step" a foreach loop (i.e., begin its next iteration) by assigning
	// the next value list element to each loop var.

	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))

	infoPtr = (*AuxData)(unsafe.Pointer((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FauxDataArrayPtr + uintptr(opnd)*16)).FclientData
	numLists = (*ForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists

	// Increment the temp holding the loop iteration number.

	iterVarPtr = compiledLocals + uintptr((*ForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp)*16
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(iterVarPtr + 8))
	iterNum = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) + int64(1))
__4344:
__4347:
	_isobjPtr6 = *(*uintptr)(unsafe.Pointer(bp + 944))
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr6)).Fbytes != uintptr(0)) {
		goto __4350
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr6)).Fbytes != XtclEmptyStringRep) {
		goto __4351
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr6)).Fbytes)
__4351:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr6)).Fbytes = uintptr(0)
__4350:
	;
	goto __4348
__4348:
	if 0 != 0 {
		goto __4347
	}
	goto __4349
__4349:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr != uintptr(0)) {
		goto __4352
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __4353
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr)).FfreeIntRepProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__4353:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))).FtypePtr = uintptr(0)
__4352:
	;
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) = int64(iterNum)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	goto __4345
__4345:
	if 0 != 0 {
		goto __4344
	}
	goto __4346
__4346:
	;

	// Check whether all value lists are exhausted and we should stop the
	// loop.

	continueLoop = 0
	listTmpIndex = (*ForeachInfo)(unsafe.Pointer(infoPtr)).FfirstValueTemp
	i6 = int64(0)
__4354:
	if !(i6 < int64(numLists)) {
		goto __4356
	}
	varListPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 16 + uintptr(i6)*8))
	numVars = (*ForeachVarList)(unsafe.Pointer(varListPtr)).FnumVars

	listVarPtr = compiledLocals + uintptr(listTmpIndex)*16
	listPtr1 = *(*uintptr)(unsafe.Pointer(listVarPtr + 8))
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(listPtr1)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 900)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(listPtr1 + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, listPtr1, bp+900)
	}() != TCL_OK) {
		goto __4357
	}

	goto gotError
__4357:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 900)) > iterNum*numVars) {
		goto __4358
	}
	continueLoop = 1
__4358:
	;
	listTmpIndex++
	goto __4355
__4355:
	i6++
	goto __4354
	goto __4356
__4356:
	;

	// If some var in some var list still has a remaining list element
	// iterate one more time. Assign to var the next element from its
	// value list. We already checked above that each list temp holds a
	// valid list object (by calling Tcl_ListObjLength), but cannot rely
	// on that check remaining valid: one list could have been shimmered
	// as a side effect of setting a traced variable.

	if !(continueLoop != 0) {
		goto __4359
	}
	listTmpIndex = (*ForeachInfo)(unsafe.Pointer(infoPtr)).FfirstValueTemp
	i6 = int64(0)
__4360:
	if !(i6 < int64(numLists)) {
		goto __4362
	}
	varListPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 16 + uintptr(i6)*8))
	numVars = (*ForeachVarList)(unsafe.Pointer(varListPtr)).FnumVars

	listVarPtr = compiledLocals + uintptr(listTmpIndex)*16
	listPtr1 = XTclListObjCopy(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(listVarPtr + 8)))
	if (*Tcl_Obj)(unsafe.Pointer(listPtr1)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 904)) = *(*uintptr)(unsafe.Pointer(listPtr1 + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 900)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(listPtr1 + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, interp, listPtr1, bp+900, bp+904)
	}

	valIndex = iterNum * numVars
	j = 0
__4363:
	if !(j < numVars) {
		goto __4365
	}
	if !(valIndex >= *(*int32)(unsafe.Pointer(bp + 900))) {
		goto __4366
	}
__4368:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr83 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr83)).FnumObjects == 0
	}()) {
		goto __4371
	}
	*(*uintptr)(unsafe.Pointer(bp + 944)) = XTclThreadAllocObj(tls)
	goto __4372
__4371:
	*(*uintptr)(unsafe.Pointer(bp + 944)) = (*AllocCache)(unsafe.Pointer(cachePtr83)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr83)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr83)).FnumObjects--
__4372:
	;
	goto __4369
__4369:
	if 0 != 0 {
		goto __4368
	}
	goto __4370
__4370:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr = uintptr(0)

	goto __4367
__4366:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 904 /* elements */)) + uintptr(valIndex)*8))
__4367:
	;

	varIndex = *(*int32)(unsafe.Pointer(varListPtr + 4 + uintptr(j)*4))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(varIndex)*16
__4373:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __4374
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __4373
__4374:
	;
	if !!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH) != 0) {
		goto __4375
	}
	value2Ptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	if !(*(*uintptr)(unsafe.Pointer(bp + 944)) != value2Ptr) {
		goto __4377
	}
	if !(value2Ptr != uintptr(0)) {
		goto __4378
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FrefCount, 1) > 1) {
		goto __4379
	}
	goto __4380
__4379:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4381
	}

	if !((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != XtclEmptyStringRep) {
		goto __4383
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes)
__4383:
	;
	(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength = -1
__4384:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr84 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr84)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr84)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4387
	}
	XTclThreadFreeObj(tls, value2Ptr)
	goto __4388
__4387:
	*(*uintptr)(unsafe.Pointer(value2Ptr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr84)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr84)).FfirstObjPtr = value2Ptr
	(*AllocCache)(unsafe.Pointer(cachePtr84)).FnumObjects++
__4388:
	;
	goto __4385
__4385:
	if 0 != 0 {
		goto __4384
	}
	goto __4386
__4386:
	;
	goto __4382
__4381:
	XTclFreeObj(tls, value2Ptr)
__4382:
	;
__4380:
	;

__4378:
	;
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount++
__4377:
	;
	goto __4376
__4375:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	if !(XTclPtrSetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760)), uintptr(0), uintptr(0), uintptr(0),
		*(*uintptr)(unsafe.Pointer(bp + 944)), TCL_LEAVE_ERR_MSG, varIndex) == uintptr(0)) {
		goto __4389
	}
	checkInterp = 1

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(listPtr1)).FrefCount, 1) > 1) {
		goto __4390
	}
	goto __4391
__4390:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(listPtr1)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(listPtr1)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4392
	}

	if !((*Tcl_Obj)(unsafe.Pointer(listPtr1)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(listPtr1)).Fbytes != XtclEmptyStringRep) {
		goto __4394
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(listPtr1)).Fbytes)
__4394:
	;
	(*Tcl_Obj)(unsafe.Pointer(listPtr1)).Flength = -1
__4395:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr85 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr85)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr85)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4398
	}
	XTclThreadFreeObj(tls, listPtr1)
	goto __4399
__4398:
	*(*uintptr)(unsafe.Pointer(listPtr1 + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr85)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr85)).FfirstObjPtr = listPtr1
	(*AllocCache)(unsafe.Pointer(cachePtr85)).FnumObjects++
__4399:
	;
	goto __4396
__4396:
	if 0 != 0 {
		goto __4395
	}
	goto __4397
__4397:
	;
	goto __4393
__4392:
	XTclFreeObj(tls, listPtr1)
__4393:
	;
__4391:
	;

	goto gotError
__4389:
	;
	checkInterp = 1
__4376:
	;
	valIndex++
	goto __4364
__4364:
	j++
	goto __4363
	goto __4365
__4365:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(listPtr1)).FrefCount, 1) > 1) {
		goto __4400
	}
	goto __4401
__4400:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(listPtr1)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(listPtr1)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4402
	}

	if !((*Tcl_Obj)(unsafe.Pointer(listPtr1)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(listPtr1)).Fbytes != XtclEmptyStringRep) {
		goto __4404
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(listPtr1)).Fbytes)
__4404:
	;
	(*Tcl_Obj)(unsafe.Pointer(listPtr1)).Flength = -1
__4405:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr86 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr86)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr86)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4408
	}
	XTclThreadFreeObj(tls, listPtr1)
	goto __4409
__4408:
	*(*uintptr)(unsafe.Pointer(listPtr1 + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr86)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr86)).FfirstObjPtr = listPtr1
	(*AllocCache)(unsafe.Pointer(cachePtr86)).FnumObjects++
__4409:
	;
	goto __4406
__4406:
	if 0 != 0 {
		goto __4405
	}
	goto __4407
__4407:
	;
	goto __4403
__4402:
	XTclFreeObj(tls, listPtr1)
__4403:
	;
__4401:
	;

	listTmpIndex++
	goto __4361
__4361:
	i6++
	goto __4360
	goto __4362
__4362:
	;
__4359:
	;

	// Run-time peep-hole optimisation: the compiler ALWAYS follows
	// INST_FOREACH_STEP4 with an INST_JUMP_FALSE. We just skip that
	// instruction and jump direct from here.

	pc += uintptr(5)
	if !(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_JUMP_FALSE1) {
		goto __4410
	}
__4412:
	;
	if !(0 == 0) {
		goto __4415
	}
	if !(0 != 0) {
		goto __4417
	}
	if !(0 > 0) {
		goto __4418
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4419
__4418:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4419:
	;
__4417:
	;
	pc += func() uintptr {
		if continueLoop != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	goto cleanup0
	goto __4416
__4415:
	if !(0 != 0) {
		goto __4420
	}
	if !(0 > 0) {
		goto __4422
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4422:
	;
	pc += func() uintptr {
		if continueLoop != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 0 {
	case 1:
		goto __4424
	case 2:
		goto __4425
	case 0:
		goto __4426
	}
	goto __4423
__4424:
	goto cleanup1_pushObjResultPtr
__4425:
	goto cleanup2_pushObjResultPtr
__4426:
	goto __4423
__4423:
	;
	goto __4421
__4420:
	pc += func() uintptr {
		if continueLoop != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 0 {
	case 1:
		goto __4428
	case 2:
		goto __4429
	case 0:
		goto __4430
	}
	goto __4427
__4428:
	goto cleanup1
__4429:
	goto cleanup2
__4430:
	goto __4427
__4427:
	;
__4421:
	;
__4416:
	;
	goto __4413
__4413:
	if 0 != 0 {
		goto __4412
	}
	goto __4414
__4414:
	;
	goto __4411
__4410:
__4431:
	;
	if !(0 == 0) {
		goto __4434
	}
	if !(0 != 0) {
		goto __4436
	}
	if !(0 > 0) {
		goto __4437
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4438
__4437:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4438:
	;
__4436:
	;
	pc += func() uintptr {
		if continueLoop != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	goto cleanup0
	goto __4435
__4434:
	if !(0 != 0) {
		goto __4439
	}
	if !(0 > 0) {
		goto __4441
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4441:
	;
	pc += func() uintptr {
		if continueLoop != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 0 {
	case 1:
		goto __4443
	case 2:
		goto __4444
	case 0:
		goto __4445
	}
	goto __4442
__4443:
	goto cleanup1_pushObjResultPtr
__4444:
	goto cleanup2_pushObjResultPtr
__4445:
	goto __4442
__4442:
	;
	goto __4440
__4439:
	pc += func() uintptr {
		if continueLoop != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 0 {
	case 1:
		goto __4447
	case 2:
		goto __4448
	case 0:
		goto __4449
	}
	goto __4446
__4447:
	goto cleanup1
__4448:
	goto cleanup2
__4449:
	goto __4446
__4446:
	;
__4440:
	;
__4435:
	;
	goto __4432
__4432:
	if 0 != 0 {
		goto __4431
	}
	goto __4433
__4433:
	;
__4411:
	;

__321:
	// Initialize the data for the looping construct, pushing the
	// corresponding Tcl_Objs to the stack.

	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	infoPtr1 = (*AuxData)(unsafe.Pointer((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FauxDataArrayPtr + uintptr(opnd)*16)).FclientData
	numLists1 = (*ForeachInfo)(unsafe.Pointer(infoPtr1)).FnumLists

	// Compute the number of iterations that will be run: iterMax

	iterMax = 0
	listTmpDepth = numLists1 - 1
	i7 = int64(0)
__4450:
	if !(i7 < int64(numLists1)) {
		goto __4452
	}
	varListPtr1 = *(*uintptr)(unsafe.Pointer(infoPtr1 + 16 + uintptr(i7)*8))
	numVars1 = (*ForeachVarList)(unsafe.Pointer(varListPtr1)).FnumVars
	listPtr2 = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(listTmpDepth)*8))
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(listPtr2)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 912)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(listPtr2 + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, listPtr2, bp+912)
	}() != TCL_OK) {
		goto __4453
	}

	goto gotError
__4453:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(listPtr2)).FrefCount > 1) {
		goto __4454
	}
	objPtr = XTclListObjCopy(tls, uintptr(0), listPtr2)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
__4455:
	_objPtr34 = listPtr2
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr34)).FrefCount, 1) <= 1) {
		goto __4458
	}
	XTclFreeObj(tls, _objPtr34)
__4458:
	;
	goto __4456
__4456:
	if 0 != 0 {
		goto __4455
	}
	goto __4457
__4457:
	;
	*(*uintptr)(unsafe.Pointer(tosPtr - uintptr(listTmpDepth)*8)) = objPtr
__4454:
	;
	iterTmp = (*(*int32)(unsafe.Pointer(bp + 912)) + (numVars1 - 1)) / numVars1
	if !(iterTmp > iterMax) {
		goto __4459
	}
	iterMax = iterTmp
__4459:
	;
	listTmpDepth--
	goto __4451
__4451:
	i7++
	goto __4450
	goto __4452
__4452:
	;

	// Store the iterNum and iterMax in a single Tcl_Obj; we keep a
	// nul-string obj with the pointer stored in the ptrValue so that the
	// thing is properly garbage collected. THIS OBJ MAKES NO SENSE, but
	// it will never leave this scope and is read-only.

__4460:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr87 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr87)).FnumObjects == 0
	}()) {
		goto __4463
	}
	tmpPtr = XTclThreadAllocObj(tls)
	goto __4464
__4463:
	tmpPtr = (*AllocCache)(unsafe.Pointer(cachePtr87)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr87)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr87)).FnumObjects--
__4464:
	;
	goto __4461
__4461:
	if 0 != 0 {
		goto __4460
	}
	goto __4462
__4462:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).FtypePtr = uintptr(0)

	*(*uintptr)(unsafe.Pointer(tmpPtr + 32)) = uintptr(int64(0))
	*(*uintptr)(unsafe.Pointer(tmpPtr + 32 + 8 /* &.ptr2 */)) = uintptr(Intptr_t(iterMax))
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), tmpPtr))).FrefCount++ // iterCounts object

	// Store a pointer to the ForeachInfo struct; same dirty trick
	// as above

__4465:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr88 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr88)).FnumObjects == 0
	}()) {
		goto __4468
	}
	tmpPtr = XTclThreadAllocObj(tls)
	goto __4469
__4468:
	tmpPtr = (*AllocCache)(unsafe.Pointer(cachePtr88)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr88)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr88)).FnumObjects--
__4469:
	;
	goto __4466
__4466:
	if 0 != 0 {
		goto __4465
	}
	goto __4467
__4467:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).FtypePtr = uintptr(0)

	*(*uintptr)(unsafe.Pointer(tmpPtr + 32)) = infoPtr1
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), tmpPtr))).FrefCount++ // infoPtr object

	// Jump directly to the INST_FOREACH_STEP instruction; the C code just
	// falls through.

	pc += uintptr(5 - (*ForeachInfo)(unsafe.Pointer(infoPtr1)).FloopCtTemp)

__322:
	// "Step" a foreach loop (i.e., begin its next iteration) by assigning
	// the next value list element to each loop var.

	tmpPtr = *(*uintptr)(unsafe.Pointer(tosPtr))
	infoPtr1 = *(*uintptr)(unsafe.Pointer(tmpPtr + 32))
	numLists1 = (*ForeachInfo)(unsafe.Pointer(infoPtr1)).FnumLists

	tmpPtr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	iterNum1 = int32(*(*uintptr)(unsafe.Pointer(tmpPtr + 32)))
	iterMax = int32(*(*uintptr)(unsafe.Pointer(tmpPtr + 32 + 8)))

	// If some list still has a remaining list element iterate one more
	// time. Assign to var the next element from its value list.

	if !(iterNum1 < iterMax) {
		goto __4470
	}
	// Set the variables and jump back to run the body

	*(*uintptr)(unsafe.Pointer(tmpPtr + 32)) = uintptr(Intptr_t(iterNum1 + 1))

	listTmpDepth = numLists1 + 1

	i7 = int64(0)
__4471:
	if !(i7 < int64(numLists1)) {
		goto __4473
	}
	varListPtr1 = *(*uintptr)(unsafe.Pointer(infoPtr1 + 16 + uintptr(i7)*8))
	numVars1 = (*ForeachVarList)(unsafe.Pointer(varListPtr1)).FnumVars

	listPtr2 = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(listTmpDepth)*8))
	if (*Tcl_Obj)(unsafe.Pointer(listPtr2)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 920)) = *(*uintptr)(unsafe.Pointer(listPtr2 + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 912)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(listPtr2 + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, interp, listPtr2, bp+912, bp+920)
	}

	valIndex1 = iterNum1 * numVars1
	j1 = 0
__4474:
	if !(j1 < numVars1) {
		goto __4476
	}
	if !(valIndex1 >= *(*int32)(unsafe.Pointer(bp + 912))) {
		goto __4477
	}
__4479:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr89 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr89)).FnumObjects == 0
	}()) {
		goto __4482
	}
	*(*uintptr)(unsafe.Pointer(bp + 944)) = XTclThreadAllocObj(tls)
	goto __4483
__4482:
	*(*uintptr)(unsafe.Pointer(bp + 944)) = (*AllocCache)(unsafe.Pointer(cachePtr89)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr89)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr89)).FnumObjects--
__4483:
	;
	goto __4480
__4480:
	if 0 != 0 {
		goto __4479
	}
	goto __4481
__4481:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr = uintptr(0)

	goto __4478
__4477:
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 920 /* elements1 */)) + uintptr(valIndex1)*8))
__4478:
	;

	varIndex1 = *(*int32)(unsafe.Pointer(varListPtr1 + 4 + uintptr(j1)*4))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(varIndex1)*16
__4484:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __4485
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __4484
__4485:
	;
	if !!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH) != 0) {
		goto __4486
	}
	value2Ptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	if !(*(*uintptr)(unsafe.Pointer(bp + 944)) != value2Ptr) {
		goto __4488
	}
	if !(value2Ptr != uintptr(0)) {
		goto __4489
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FrefCount, 1) > 1) {
		goto __4490
	}
	goto __4491
__4490:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4492
	}

	if !((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != XtclEmptyStringRep) {
		goto __4494
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes)
__4494:
	;
	(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength = -1
__4495:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr90 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr90)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr90)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4498
	}
	XTclThreadFreeObj(tls, value2Ptr)
	goto __4499
__4498:
	*(*uintptr)(unsafe.Pointer(value2Ptr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr90)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr90)).FfirstObjPtr = value2Ptr
	(*AllocCache)(unsafe.Pointer(cachePtr90)).FnumObjects++
__4499:
	;
	goto __4496
__4496:
	if 0 != 0 {
		goto __4495
	}
	goto __4497
__4497:
	;
	goto __4493
__4492:
	XTclFreeObj(tls, value2Ptr)
__4493:
	;
__4491:
	;

__4489:
	;
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount++
__4488:
	;
	goto __4487
__4486:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	if !(XTclPtrSetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760)), uintptr(0), uintptr(0), uintptr(0),
		*(*uintptr)(unsafe.Pointer(bp + 944)), TCL_LEAVE_ERR_MSG, varIndex1) == uintptr(0)) {
		goto __4500
	}
	checkInterp = 1

	goto gotError
__4500:
	;
	checkInterp = 1
__4487:
	;
	valIndex1++
	goto __4475
__4475:
	j1++
	goto __4474
	goto __4476
__4476:
	;
	listTmpDepth--
	goto __4472
__4472:
	i7++
	goto __4471
	goto __4473
__4473:
	;

	// loopCtTemp being 'misused' for storing the jump size
__4501:
	;
	if !(0 == 0) {
		goto __4504
	}
	if !(0 != 0) {
		goto __4506
	}
	if !(0 > 0) {
		goto __4507
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4508
__4507:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4508:
	;
__4506:
	;
	pc += uintptr((*ForeachInfo)(unsafe.Pointer(infoPtr1)).FloopCtTemp)
	goto cleanup0
	goto __4505
__4504:
	if !(0 != 0) {
		goto __4509
	}
	if !(0 > 0) {
		goto __4511
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4511:
	;
	pc += uintptr((*ForeachInfo)(unsafe.Pointer(infoPtr1)).FloopCtTemp)
	switch 0 {
	case 1:
		goto __4513
	case 2:
		goto __4514
	case 0:
		goto __4515
	}
	goto __4512
__4513:
	goto cleanup1_pushObjResultPtr
__4514:
	goto cleanup2_pushObjResultPtr
__4515:
	goto __4512
__4512:
	;
	goto __4510
__4509:
	pc += uintptr((*ForeachInfo)(unsafe.Pointer(infoPtr1)).FloopCtTemp)
	switch 0 {
	case 1:
		goto __4517
	case 2:
		goto __4518
	case 0:
		goto __4519
	}
	goto __4516
__4517:
	goto cleanup1
__4518:
	goto cleanup2
__4519:
	goto __4516
__4516:
	;
__4510:
	;
__4505:
	;
	goto __4502
__4502:
	if 0 != 0 {
		goto __4501
	}
	goto __4503
__4503:
	;
__4470:
	;

	// FALL THROUGH
	pc++

__323:
	// THIS INSTRUCTION IS ONLY CALLED AS A BREAK TARGET
	tmpPtr = *(*uintptr)(unsafe.Pointer(tosPtr))
	infoPtr1 = *(*uintptr)(unsafe.Pointer(tmpPtr + 32))
	numLists1 = (*ForeachInfo)(unsafe.Pointer(infoPtr1)).FnumLists

__4520:
	pc += uintptr(1)
	cleanup = numLists1 + 2
	if !(0 != 0) {
		goto __4523
	}
	if !(0 > 0) {
		goto __4525
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4525:
	;
	goto cleanupV_pushObjResultPtr
	goto __4524
__4523:
	goto cleanupV
__4524:
	;
	goto __4521
__4521:
	if 0 != 0 {
		goto __4520
	}
	goto __4522
__4522:
	;

__324:
	// This instruction is only issued by lmap. The stack is:
	//   - result
	//   - infoPtr
	//   - loop counters
	//   - valLists
	//   - collecting obj (unshared)
	// The instruction lappends the result to the collecting obj.

	tmpPtr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	infoPtr1 = *(*uintptr)(unsafe.Pointer(tmpPtr + 32))
	numLists1 = (*ForeachInfo)(unsafe.Pointer(infoPtr1)).FnumLists

	objPtr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(3+numLists1)*8))
	XTcl_ListObjAppendElement(tls, uintptr(0), objPtr, *(*uintptr)(unsafe.Pointer(tosPtr)))
__4526:
	;
	if !(1 == 0) {
		goto __4529
	}
	if !(0 != 0) {
		goto __4531
	}
	if !(0 > 0) {
		goto __4532
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4533
__4532:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4533:
	;
__4531:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4530
__4529:
	if !(0 != 0) {
		goto __4534
	}
	if !(0 > 0) {
		goto __4536
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4536:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4538
	case 2:
		goto __4539
	case 0:
		goto __4540
	}
	goto __4537
__4538:
	goto cleanup1_pushObjResultPtr
__4539:
	goto cleanup2_pushObjResultPtr
__4540:
	goto __4537
__4537:
	;
	goto __4535
__4534:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4542
	case 2:
		goto __4543
	case 0:
		goto __4544
	}
	goto __4541
__4542:
	goto cleanup1
__4543:
	goto cleanup2
__4544:
	goto __4541
__4541:
	;
__4535:
	;
__4530:
	;
	goto __4527
__4527:
	if 0 != 0 {
		goto __4526
	}
	goto __4528
__4528:
	;

	goto __159

__325:
	// Record start of the catch command with exception range index equal
	// to the operand. Push the current stack depth onto the special catch
	// stack.

	*(*Ptrdiff_t)(unsafe.Pointer(libc.PreIncUintptr(&(*TEBCdata)(unsafe.Pointer(TD)).FcatchTop, 8))) = (int64(tosPtr) - int64(TD+112-uintptr(1)*8+uintptr((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FmaxExceptDepth)*8)) / 8

__4545:
	;
	if !(0 == 0) {
		goto __4548
	}
	if !(0 != 0) {
		goto __4550
	}
	if !(0 > 0) {
		goto __4551
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4552
__4551:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4552:
	;
__4550:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __4549
__4548:
	if !(0 != 0) {
		goto __4553
	}
	if !(0 > 0) {
		goto __4555
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4555:
	;
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __4557
	case 2:
		goto __4558
	case 0:
		goto __4559
	}
	goto __4556
__4557:
	goto cleanup1_pushObjResultPtr
__4558:
	goto cleanup2_pushObjResultPtr
__4559:
	goto __4556
__4556:
	;
	goto __4554
__4553:
	pc += uintptr(5)
	switch 0 {
	case 1:
		goto __4561
	case 2:
		goto __4562
	case 0:
		goto __4563
	}
	goto __4560
__4561:
	goto cleanup1
__4562:
	goto cleanup2
__4563:
	goto __4560
__4560:
	;
__4554:
	;
__4549:
	;
	goto __4546
__4546:
	if 0 != 0 {
		goto __4545
	}
	goto __4547
__4547:
	;
	goto __159

__326:
	(*TEBCdata)(unsafe.Pointer(TD)).FcatchTop -= 8
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_ResetResult(tls, interp)
	checkInterp = 1
	result = TCL_OK

__4564:
	;
	if !(0 == 0) {
		goto __4567
	}
	if !(0 != 0) {
		goto __4569
	}
	if !(0 > 0) {
		goto __4570
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4571
__4570:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4571:
	;
__4569:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4568
__4567:
	if !(0 != 0) {
		goto __4572
	}
	if !(0 > 0) {
		goto __4574
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4574:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4576
	case 2:
		goto __4577
	case 0:
		goto __4578
	}
	goto __4575
__4576:
	goto cleanup1_pushObjResultPtr
__4577:
	goto cleanup2_pushObjResultPtr
__4578:
	goto __4575
__4575:
	;
	goto __4573
__4572:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4580
	case 2:
		goto __4581
	case 0:
		goto __4582
	}
	goto __4579
__4580:
	goto cleanup1
__4581:
	goto cleanup2
__4582:
	goto __4579
__4579:
	;
__4573:
	;
__4568:
	;
	goto __4565
__4565:
	if 0 != 0 {
		goto __4564
	}
	goto __4566
__4566:
	;
	goto __159

__327:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_GetObjResult(tls, interp)

	// See the comments at INST_INVOKE_STK

__4583:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr91 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr91)).FnumObjects == 0
	}()) {
		goto __4586
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __4587
__4586:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr91)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr91)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr91)).FnumObjects--
__4587:
	;
	goto __4584
__4584:
	if 0 != 0 {
		goto __4583
	}
	goto __4585
__4585:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	(*Interp)(unsafe.Pointer(interp)).FobjResultPtr = objPtr
__4588:
	;
	if !(0 == 0) {
		goto __4591
	}
	if !(-1 != 0) {
		goto __4593
	}
	if !(-1 > 0) {
		goto __4594
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4595
__4594:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4595:
	;
__4593:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4592
__4591:
	if !(-1 != 0) {
		goto __4596
	}
	if !(-1 > 0) {
		goto __4598
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4598:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4600
	case 2:
		goto __4601
	case 0:
		goto __4602
	}
	goto __4599
__4600:
	goto cleanup1_pushObjResultPtr
__4601:
	goto cleanup2_pushObjResultPtr
__4602:
	goto __4599
__4599:
	;
	goto __4597
__4596:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4604
	case 2:
		goto __4605
	case 0:
		goto __4606
	}
	goto __4603
__4604:
	goto cleanup1
__4605:
	goto cleanup2
__4606:
	goto __4603
__4603:
	;
__4597:
	;
__4592:
	;
	goto __4589
__4589:
	if 0 != 0 {
		goto __4588
	}
	goto __4590
__4590:
	;
	goto __159

__328:
__4607:
	;
__4610:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr92 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr92)).FnumObjects == 0
	}()) {
		goto __4613
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __4614
__4613:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr92)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr92)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr92)).FnumObjects--
__4614:
	;
	goto __4611
__4611:
	if 0 != 0 {
		goto __4610
	}
	goto __4612
__4612:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(result)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __4608
__4608:
	if 0 != 0 {
		goto __4607
	}
	goto __4609
__4609:
	;

__4615:
	;
	if !(0 == 0) {
		goto __4618
	}
	if !(1 != 0) {
		goto __4620
	}
	if !(1 > 0) {
		goto __4621
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4622
__4621:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4622:
	;
__4620:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4619
__4618:
	if !(1 != 0) {
		goto __4623
	}
	if !(1 > 0) {
		goto __4625
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4625:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4627
	case 2:
		goto __4628
	case 0:
		goto __4629
	}
	goto __4626
__4627:
	goto cleanup1_pushObjResultPtr
__4628:
	goto cleanup2_pushObjResultPtr
__4629:
	goto __4626
__4626:
	;
	goto __4624
__4623:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4631
	case 2:
		goto __4632
	case 0:
		goto __4633
	}
	goto __4630
__4631:
	goto cleanup1
__4632:
	goto cleanup2
__4633:
	goto __4630
__4630:
	;
__4624:
	;
__4619:
	;
	goto __4616
__4616:
	if 0 != 0 {
		goto __4615
	}
	goto __4617
__4617:
	;
	goto __159

__329:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_GetReturnOptions(tls, interp, result)
	checkInterp = 1

__4634:
	;
	if !(0 == 0) {
		goto __4637
	}
	if !(1 != 0) {
		goto __4639
	}
	if !(1 > 0) {
		goto __4640
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4641
__4640:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4641:
	;
__4639:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4638
__4637:
	if !(1 != 0) {
		goto __4642
	}
	if !(1 > 0) {
		goto __4644
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4644:
	;
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4646
	case 2:
		goto __4647
	case 0:
		goto __4648
	}
	goto __4645
__4646:
	goto cleanup1_pushObjResultPtr
__4647:
	goto cleanup2_pushObjResultPtr
__4648:
	goto __4645
__4645:
	;
	goto __4643
__4642:
	pc += uintptr(1)
	switch 0 {
	case 1:
		goto __4650
	case 2:
		goto __4651
	case 0:
		goto __4652
	}
	goto __4649
__4650:
	goto cleanup1
__4651:
	goto cleanup2
__4652:
	goto __4649
__4649:
	;
__4643:
	;
__4638:
	;
	goto __4635
__4635:
	if 0 != 0 {
		goto __4634
	}
	goto __4636
__4636:
	;
	goto __159

__330:

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 928)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(tosPtr)), bp+928)
	}() != TCL_OK) {
		goto __4653
	}
	XTcl_Panic(tls, ts+28834, 0)
__4653:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 928)) == TCL_OK) {
		goto __4654
	}
	XTcl_Panic(tls, ts+28882, 0)
__4654:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 928)) < TCL_ERROR || *(*int32)(unsafe.Pointer(bp + 928)) > TCL_CONTINUE) {
		goto __4655
	}
	*(*int32)(unsafe.Pointer(bp + 928 /* code1 */)) = TCL_CONTINUE + 1
__4655:
	;

__4656:
	;
	if !(1 == 0) {
		goto __4659
	}
	if !(0 != 0) {
		goto __4661
	}
	if !(0 > 0) {
		goto __4662
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4663
__4662:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4663:
	;
__4661:
	;
	pc += uintptr(2**(*int32)(unsafe.Pointer(bp + 928)) - 1)
	goto cleanup0
	goto __4660
__4659:
	if !(0 != 0) {
		goto __4664
	}
	if !(0 > 0) {
		goto __4666
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4666:
	;
	pc += uintptr(2**(*int32)(unsafe.Pointer(bp + 928)) - 1)
	switch 1 {
	case 1:
		goto __4668
	case 2:
		goto __4669
	case 0:
		goto __4670
	}
	goto __4667
__4668:
	goto cleanup1_pushObjResultPtr
__4669:
	goto cleanup2_pushObjResultPtr
__4670:
	goto __4667
__4667:
	;
	goto __4665
__4664:
	pc += uintptr(2**(*int32)(unsafe.Pointer(bp + 928)) - 1)
	switch 1 {
	case 1:
		goto __4672
	case 2:
		goto __4673
	case 0:
		goto __4674
	}
	goto __4671
__4672:
	goto cleanup1
__4673:
	goto cleanup2
__4674:
	goto __4671
__4671:
	;
__4665:
	;
__4660:
	;
	goto __4657
__4657:
	if 0 != 0 {
		goto __4656
	}
	goto __4658
__4658:
	;

	/*
	 * -----------------------------------------------------------------
	 *	   Start of dictionary-related instructions.
	 */

__331:
	dictPtr = *(*uintptr)(unsafe.Pointer(tosPtr))

	if !(XTcl_DictObjSize(tls, interp, dictPtr, bp+932) != TCL_OK) {
		goto __4675
	}

	goto gotError
__4675:
	;

__4676:
	;
	if !(1 == 0) {
		goto __4679
	}
	if !(0 != 0) {
		goto __4681
	}
	if !(0 > 0) {
		goto __4682
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4683
__4682:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4683:
	;
__4681:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __4680
__4679:
	if !(0 != 0) {
		goto __4684
	}
	if !(0 > 0) {
		goto __4686
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4686:
	;
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4688
	case 2:
		goto __4689
	case 0:
		goto __4690
	}
	goto __4687
__4688:
	goto cleanup1_pushObjResultPtr
__4689:
	goto cleanup2_pushObjResultPtr
__4690:
	goto __4687
__4687:
	;
	goto __4685
__4684:
	pc += uintptr(1)
	switch 1 {
	case 1:
		goto __4692
	case 2:
		goto __4693
	case 0:
		goto __4694
	}
	goto __4691
__4692:
	goto cleanup1
__4693:
	goto cleanup2
__4694:
	goto __4691
__4691:
	;
__4685:
	;
__4680:
	;
	goto __4677
__4677:
	if 0 != 0 {
		goto __4676
	}
	goto __4678
__4678:
	;

__332:
__333:
	interp2 = interp

	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))

	dictPtr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(opnd)*8))
	if !(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_DICT_EXISTS) {
		goto __4695
	}
	interp2 = uintptr(0)
__4695:
	;
	if !(opnd > 1) {
		goto __4696
	}
	dictPtr = XTclTraceDictPath(tls, interp2, dictPtr, opnd-1,
		tosPtr-uintptr(opnd-1)*8, DICT_PATH_READ)
	if !(dictPtr == uintptr(0)) {
		goto __4697
	}
	if !(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_DICT_EXISTS) {
		goto __4698
	}
	found1 = 0
	goto afterDictExists
__4698:
	;

	goto gotError
__4697:
	;
__4696:
	;
	if !(XTcl_DictObjGet(tls, interp2, dictPtr, *(*uintptr)(unsafe.Pointer(tosPtr)),
		bp+936) == TCL_OK) {
		goto __4699
	}
	if !(int32(*(*uint8)(unsafe.Pointer(pc))) == INST_DICT_EXISTS) {
		goto __4701
	}
	found1 = func() int32 {
		if *(*uintptr)(unsafe.Pointer(bp + 936)) != 0 {
			return 1
		}
		return 0
	}()
	goto afterDictExists
__4701:
	;
	if !!(*(*uintptr)(unsafe.Pointer(bp + 936)) != 0) {
		goto __4702
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+23231,
		libc.VaList(bp+560, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
		}())))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+568, ts+3593, ts+7170, ts+23264,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(tosPtr)))
		}(), uintptr(0)))
	checkInterp = 1

	goto gotError
__4702:
	;

__4703:
	pc += uintptr(5)
	cleanup = opnd + 1
	if !(1 != 0) {
		goto __4706
	}
	if !(1 > 0) {
		goto __4708
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4708:
	;
	goto cleanupV_pushObjResultPtr
	goto __4707
__4706:
	goto cleanupV
__4707:
	;
	goto __4704
__4704:
	if 0 != 0 {
		goto __4703
	}
	goto __4705
__4705:
	;
	goto __4700
__4699:
	if !(int32(*(*uint8)(unsafe.Pointer(pc))) != INST_DICT_EXISTS) {
		goto __4709
	}

	goto gotError
	goto __4710
__4709:
	found1 = 0
__4710:
	;
__4700:
	;
afterDictExists:
	;

	// The INST_DICT_EXISTS instruction is usually followed by a
	// conditional jump, so we can take advantage of this to do some
	// peephole optimization (note that we're careful to not close out
	// someone doing something else).

__4711:
	pc += uintptr(5)
	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_JUMP_FALSE1:
		goto __4715
	case INST_JUMP_TRUE1:
		goto __4716
	case INST_JUMP_FALSE4:
		goto __4717
	case INST_JUMP_TRUE4:
		goto __4718
	default:
		goto __4719
	}
	goto __4714
__4715:
	;
__4720:
	pc += func() uintptr {
		if found1 != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	cleanup = opnd + 1
	if !(0 != 0) {
		goto __4723
	}
	if !(0 > 0) {
		goto __4725
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4725:
	;
	goto cleanupV_pushObjResultPtr
	goto __4724
__4723:
	goto cleanupV
__4724:
	;
	goto __4721
__4721:
	if 0 != 0 {
		goto __4720
	}
	goto __4722
__4722:
	;
	goto __4714
__4716:
	;
__4726:
	pc += func() uintptr {
		if found1 != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	cleanup = opnd + 1
	if !(0 != 0) {
		goto __4729
	}
	if !(0 > 0) {
		goto __4731
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4731:
	;
	goto cleanupV_pushObjResultPtr
	goto __4730
__4729:
	goto cleanupV
__4730:
	;
	goto __4727
__4727:
	if 0 != 0 {
		goto __4726
	}
	goto __4728
__4728:
	;
	goto __4714
__4717:
	;
__4732:
	pc += func() uintptr {
		if found1 != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	cleanup = opnd + 1
	if !(0 != 0) {
		goto __4735
	}
	if !(0 > 0) {
		goto __4737
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4737:
	;
	goto cleanupV_pushObjResultPtr
	goto __4736
__4735:
	goto cleanupV
__4736:
	;
	goto __4733
__4733:
	if 0 != 0 {
		goto __4732
	}
	goto __4734
__4734:
	;
	goto __4714
__4718:
	;
__4738:
	pc += func() uintptr {
		if found1 != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	cleanup = opnd + 1
	if !(0 != 0) {
		goto __4741
	}
	if !(0 > 0) {
		goto __4743
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4743:
	;
	goto cleanupV_pushObjResultPtr
	goto __4742
__4741:
	goto cleanupV
__4742:
	;
	goto __4739
__4739:
	if 0 != 0 {
		goto __4738
	}
	goto __4740
__4740:
	;
	goto __4714
__4719:
	if !(found1 < 0) {
		goto __4744
	}
__4746:
	;
__4749:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr93 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr93)).FnumObjects == 0
	}()) {
		goto __4752
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __4753
__4752:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr93)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr93)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr93)).FnumObjects--
__4753:
	;
	goto __4750
__4750:
	if 0 != 0 {
		goto __4749
	}
	goto __4751
__4751:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __4747
__4747:
	if 0 != 0 {
		goto __4746
	}
	goto __4748
__4748:
	;
	goto __4745
__4744:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(libc.Bool32(found1 > 0))*8))
__4745:
	;
__4754:
	pc += uintptr(0)
	cleanup = opnd + 1
	if !(1 != 0) {
		goto __4757
	}
	if !(1 > 0) {
		goto __4759
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4759:
	;
	goto cleanupV_pushObjResultPtr
	goto __4758
__4757:
	goto cleanupV
__4758:
	;
	goto __4755
__4755:
	if 0 != 0 {
		goto __4754
	}
	goto __4756
__4756:
	;
	goto __4714
__4714:
	;
	goto __4712
__4712:
	if 0 != 0 {
		goto __4711
	}
	goto __4713
__4713:
	;

__334:
__335:
__336:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	opnd2 = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(3)))))

	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd2)*16
__4760:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __4761
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __4760
__4761:
	;

	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0) {
		goto __4762
	}
	dictPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __4763
__4762:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	dictPtr = XTclPtrGetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0), uintptr(0), uintptr(0), 0,
		opnd2)
	checkInterp = 1
__4763:
	;
	if !(dictPtr == uintptr(0)) {
		goto __4764
	}
__4766:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr94 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr94)).FnumObjects == 0
	}()) {
		goto __4769
	}
	dictPtr = XTclThreadAllocObj(tls)
	goto __4770
__4769:
	dictPtr = (*AllocCache)(unsafe.Pointer(cachePtr94)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr94)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr94)).FnumObjects--
__4770:
	;
	goto __4767
__4767:
	if 0 != 0 {
		goto __4766
	}
	goto __4768
__4768:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = uintptr(0)

	allocateDict = 1
	goto __4765
__4764:
	allocateDict = libc.Bool32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1)
	if !(allocateDict != 0) {
		goto __4771
	}
	dictPtr = XTcl_DuplicateObj(tls, dictPtr)
__4771:
	;
__4765:
	;

	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_DICT_SET:
		goto __4773
	case INST_DICT_INCR_IMM:
		goto __4774
	case INST_DICT_UNSET:
		goto __4775
	default:
		goto __4776
	}
	goto __4772
__4773:
	cleanup = opnd + 1
	result = XTcl_DictObjPutKeyList(tls, interp, dictPtr, opnd,
		tosPtr-uintptr(opnd)*8, *(*uintptr)(unsafe.Pointer(tosPtr)))
	goto __4772
__4774:
	cleanup = 1
	opnd = int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3))))
	result = XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(tosPtr)), bp+944)
	if !(result != TCL_OK) {
		goto __4777
	}
	goto __4772
__4777:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 944)) == uintptr(0)) {
		goto __4778
	}
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(tosPtr)), XTcl_NewIntObj(tls, opnd))
	goto __4779
__4778:
__4780:
	;
__4783:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr95 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr95)).FnumObjects == 0
	}()) {
		goto __4786
	}
	value2Ptr = XTclThreadAllocObj(tls)
	goto __4787
__4786:
	value2Ptr = (*AllocCache)(unsafe.Pointer(cachePtr95)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr95)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(value2Ptr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr95)).FnumObjects--
__4787:
	;
	goto __4784
__4784:
	if 0 != 0 {
		goto __4783
	}
	goto __4785
__4785:
	;
	(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(value2Ptr + 32)) = int64(opnd)
	(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __4781
__4781:
	if 0 != 0 {
		goto __4780
	}
	goto __4782
__4782:
	;
	(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FrefCount++
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __4788
	}
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(tosPtr)), *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__4788:
	;
	result = XTclIncrObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), value2Ptr)
	if !(result == TCL_OK) {
		goto __4789
	}
__4790:
	_isobjPtr7 = dictPtr
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr7)).Fbytes != uintptr(0)) {
		goto __4793
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr7)).Fbytes != XtclEmptyStringRep) {
		goto __4794
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr7)).Fbytes)
__4794:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr7)).Fbytes = uintptr(0)
__4793:
	;
	goto __4791
__4791:
	if 0 != 0 {
		goto __4790
	}
	goto __4792
__4792:
	;
__4789:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FrefCount, 1) > 1) {
		goto __4795
	}
	goto __4796
__4795:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4797
	}

	if !((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != XtclEmptyStringRep) {
		goto __4799
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes)
__4799:
	;
	(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength = -1
__4800:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr96 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr96)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr96)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4803
	}
	XTclThreadFreeObj(tls, value2Ptr)
	goto __4804
__4803:
	*(*uintptr)(unsafe.Pointer(value2Ptr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr96)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr96)).FfirstObjPtr = value2Ptr
	(*AllocCache)(unsafe.Pointer(cachePtr96)).FnumObjects++
__4804:
	;
	goto __4801
__4801:
	if 0 != 0 {
		goto __4800
	}
	goto __4802
__4802:
	;
	goto __4798
__4797:
	XTclFreeObj(tls, value2Ptr)
__4798:
	;
__4796:
	;

__4779:
	;
	goto __4772
__4775:
	cleanup = opnd
	result = XTcl_DictObjRemoveKeyList(tls, interp, dictPtr, opnd,
		tosPtr-uintptr(opnd-1)*8)
	goto __4772
__4776:
	cleanup = 0 // stop compiler warning
	XTcl_Panic(tls, ts+28922, 0)
__4772:
	;

	if !(result != TCL_OK) {
		goto __4805
	}
	if !(allocateDict != 0) {
		goto __4806
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1) {
		goto __4807
	}
	goto __4808
__4807:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4809
	}

	if !((*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep) {
		goto __4811
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
__4811:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
__4812:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr97 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr97)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr97)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4815
	}
	XTclThreadFreeObj(tls, dictPtr)
	goto __4816
__4815:
	*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr97)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr97)).FfirstObjPtr = dictPtr
	(*AllocCache)(unsafe.Pointer(cachePtr97)).FnumObjects++
__4816:
	;
	goto __4813
__4813:
	if 0 != 0 {
		goto __4812
	}
	goto __4814
__4814:
	;
	goto __4810
__4809:
	XTclFreeObj(tls, dictPtr)
__4810:
	;
__4808:
	;

__4806:
	;

	goto checkForCatch
__4805:
	;

	if !!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH) != 0) {
		goto __4817
	}
	if !(allocateDict != 0) {
		goto __4819
	}
	value2Ptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount++
	if !(value2Ptr != uintptr(0)) {
		goto __4820
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FrefCount, 1) > 1) {
		goto __4821
	}
	goto __4822
__4821:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4823
	}

	if !((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != XtclEmptyStringRep) {
		goto __4825
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes)
__4825:
	;
	(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength = -1
__4826:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr98 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr98)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr98)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4829
	}
	XTclThreadFreeObj(tls, value2Ptr)
	goto __4830
__4829:
	*(*uintptr)(unsafe.Pointer(value2Ptr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr98)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr98)).FfirstObjPtr = value2Ptr
	(*AllocCache)(unsafe.Pointer(cachePtr98)).FnumObjects++
__4830:
	;
	goto __4827
__4827:
	if 0 != 0 {
		goto __4826
	}
	goto __4828
__4828:
	;
	goto __4824
__4823:
	XTclFreeObj(tls, value2Ptr)
__4824:
	;
__4822:
	;

__4820:
	;
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = dictPtr
__4819:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = dictPtr
	goto __4818
__4817:
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount++
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclPtrSetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0), uintptr(0), uintptr(0),
		dictPtr, TCL_LEAVE_ERR_MSG, opnd2)
	checkInterp = 1
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1) {
		goto __4831
	}
	goto __4832
__4831:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4833
	}

	if !((*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep) {
		goto __4835
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
__4835:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
__4836:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr99 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr99)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr99)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4839
	}
	XTclThreadFreeObj(tls, dictPtr)
	goto __4840
__4839:
	*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr99)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr99)).FfirstObjPtr = dictPtr
	(*AllocCache)(unsafe.Pointer(cachePtr99)).FnumObjects++
__4840:
	;
	goto __4837
__4837:
	if 0 != 0 {
		goto __4836
	}
	goto __4838
__4838:
	;
	goto __4834
__4833:
	XTclFreeObj(tls, dictPtr)
__4834:
	;
__4832:
	;

	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == uintptr(0)) {
		goto __4841
	}

	goto gotError
__4841:
	;
__4818:
	;
	if !(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(9)))) == INST_POP) {
		goto __4842
	}
__4843:
	pc += uintptr(10)
	cleanup = cleanup
	if !(0 != 0) {
		goto __4846
	}
	if !(0 > 0) {
		goto __4848
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4848:
	;
	goto cleanupV_pushObjResultPtr
	goto __4847
__4846:
	goto cleanupV
__4847:
	;
	goto __4844
__4844:
	if 0 != 0 {
		goto __4843
	}
	goto __4845
__4845:
	;
__4842:
	;

__4849:
	pc += uintptr(9)
	cleanup = cleanup
	if !(1 != 0) {
		goto __4852
	}
	if !(1 > 0) {
		goto __4854
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4854:
	;
	goto cleanupV_pushObjResultPtr
	goto __4853
__4852:
	goto cleanupV
__4853:
	;
	goto __4850
__4850:
	if 0 != 0 {
		goto __4849
	}
	goto __4851
__4851:
	;

__337:
__338:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
__4855:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __4856
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __4855
__4856:
	;

	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0) {
		goto __4857
	}
	dictPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __4858
__4857:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	dictPtr = XTclPtrGetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0), uintptr(0), uintptr(0), 0,
		opnd)
	checkInterp = 1
__4858:
	;
	if !(dictPtr == uintptr(0)) {
		goto __4859
	}
__4861:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr100 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr100)).FnumObjects == 0
	}()) {
		goto __4864
	}
	dictPtr = XTclThreadAllocObj(tls)
	goto __4865
__4864:
	dictPtr = (*AllocCache)(unsafe.Pointer(cachePtr100)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr100)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr100)).FnumObjects--
__4865:
	;
	goto __4862
__4862:
	if 0 != 0 {
		goto __4861
	}
	goto __4863
__4863:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = uintptr(0)

	allocateDict = 1
	goto __4860
__4859:
	allocateDict = libc.Bool32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1)
	if !(allocateDict != 0) {
		goto __4866
	}
	dictPtr = XTcl_DuplicateObj(tls, dictPtr)
__4866:
	;
__4860:
	;

	if !(XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)),
		bp+944) != TCL_OK) {
		goto __4867
	}
	if !(allocateDict != 0) {
		goto __4868
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1) {
		goto __4869
	}
	goto __4870
__4869:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4871
	}

	if !((*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep) {
		goto __4873
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
__4873:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
__4874:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr101 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr101)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr101)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4877
	}
	XTclThreadFreeObj(tls, dictPtr)
	goto __4878
__4877:
	*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr101)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr101)).FfirstObjPtr = dictPtr
	(*AllocCache)(unsafe.Pointer(cachePtr101)).FnumObjects++
__4878:
	;
	goto __4875
__4875:
	if 0 != 0 {
		goto __4874
	}
	goto __4876
__4876:
	;
	goto __4872
__4871:
	XTclFreeObj(tls, dictPtr)
__4872:
	;
__4870:
	;

__4868:
	;

	goto gotError
__4867:
	;

	// Note that a non-existent key results in a NULL valuePtr, which is a
	// case handled separately below. What we *can* say at this point is
	// that the write-back will always succeed.

	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_DICT_APPEND:
		goto __4880
	case INST_DICT_LAPPEND:
		goto __4881
	default:
		goto __4882
	}
	goto __4879
__4880:
	if !(*(*uintptr)(unsafe.Pointer(bp + 944)) == uintptr(0)) {
		goto __4883
	}
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)), *(*uintptr)(unsafe.Pointer(tosPtr)))
	goto __4884
__4883:
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __4885
	}
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	XTcl_AppendObjToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), *(*uintptr)(unsafe.Pointer(tosPtr)))
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)), *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	goto __4886
__4885:
	XTcl_AppendObjToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)), *(*uintptr)(unsafe.Pointer(tosPtr)))

	// Must invalidate the string representation of dictionary
	// here because we have directly updated the internal
	// representation; if we don't, callers could see the wrong
	// string rep despite the internal version of the dictionary
	// having the correct value. [Bug 3079830]

__4887:
	_isobjPtr8 = dictPtr
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr8)).Fbytes != uintptr(0)) {
		goto __4890
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr8)).Fbytes != XtclEmptyStringRep) {
		goto __4891
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr8)).Fbytes)
__4891:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr8)).Fbytes = uintptr(0)
__4890:
	;
	goto __4888
__4888:
	if 0 != 0 {
		goto __4887
	}
	goto __4889
__4889:
	;
__4886:
	;
__4884:
	;
	goto __4879
__4881:
	// More complex because list-append can fail.

	if !(*(*uintptr)(unsafe.Pointer(bp + 944)) == uintptr(0)) {
		goto __4892
	}
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)),
		XTcl_NewListObj(tls, 1, tosPtr))
	goto __4879
	goto __4893
__4892:
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount > 1) {
		goto __4894
	}
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	if !(XTcl_ListObjAppendElement(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944)),
		*(*uintptr)(unsafe.Pointer(tosPtr))) != TCL_OK) {
		goto __4896
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount, 1) > 1) {
		goto __4897
	}
	goto __4898
__4897:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4899
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != XtclEmptyStringRep) {
		goto __4901
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes)
__4901:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength = -1
__4902:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr102 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr102)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr102)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4905
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)))
	goto __4906
__4905:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr102)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr102)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 944))
	(*AllocCache)(unsafe.Pointer(cachePtr102)).FnumObjects++
__4906:
	;
	goto __4903
__4903:
	if 0 != 0 {
		goto __4902
	}
	goto __4904
__4904:
	;
	goto __4900
__4899:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__4900:
	;
__4898:
	;

	if !(allocateDict != 0) {
		goto __4907
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1) {
		goto __4908
	}
	goto __4909
__4908:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4910
	}

	if !((*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep) {
		goto __4912
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
__4912:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
__4913:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr103 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr103)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr103)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4916
	}
	XTclThreadFreeObj(tls, dictPtr)
	goto __4917
__4916:
	*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr103)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr103)).FfirstObjPtr = dictPtr
	(*AllocCache)(unsafe.Pointer(cachePtr103)).FnumObjects++
__4917:
	;
	goto __4914
__4914:
	if 0 != 0 {
		goto __4913
	}
	goto __4915
__4915:
	;
	goto __4911
__4910:
	XTclFreeObj(tls, dictPtr)
__4911:
	;
__4909:
	;

__4907:
	;

	goto gotError
__4896:
	;
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8)), *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
	goto __4895
__4894:
	if !(XTcl_ListObjAppendElement(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 944)),
		*(*uintptr)(unsafe.Pointer(tosPtr))) != TCL_OK) {
		goto __4918
	}
	if !(allocateDict != 0) {
		goto __4919
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1) {
		goto __4920
	}
	goto __4921
__4920:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4922
	}

	if !((*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep) {
		goto __4924
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
__4924:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
__4925:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr104 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr104)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr104)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4928
	}
	XTclThreadFreeObj(tls, dictPtr)
	goto __4929
__4928:
	*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr104)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr104)).FfirstObjPtr = dictPtr
	(*AllocCache)(unsafe.Pointer(cachePtr104)).FnumObjects++
__4929:
	;
	goto __4926
__4926:
	if 0 != 0 {
		goto __4925
	}
	goto __4927
__4927:
	;
	goto __4923
__4922:
	XTclFreeObj(tls, dictPtr)
__4923:
	;
__4921:
	;

__4919:
	;

	goto gotError
__4918:
	;

	// Must invalidate the string representation of dictionary
	// here because we have directly updated the internal
	// representation; if we don't, callers could see the wrong
	// string rep despite the internal version of the dictionary
	// having the correct value. [Bug 3079830]

__4930:
	_isobjPtr9 = dictPtr
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr9)).Fbytes != uintptr(0)) {
		goto __4933
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr9)).Fbytes != XtclEmptyStringRep) {
		goto __4934
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr9)).Fbytes)
__4934:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr9)).Fbytes = uintptr(0)
__4933:
	;
	goto __4931
__4931:
	if 0 != 0 {
		goto __4930
	}
	goto __4932
__4932:
	;
__4895:
	;
__4893:
	;
	goto __4879
__4882:
	XTcl_Panic(tls, ts+28922, 0)
__4879:
	;

	if !!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH) != 0) {
		goto __4935
	}
	if !(allocateDict != 0) {
		goto __4937
	}
	value2Ptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount++
	if !(value2Ptr != uintptr(0)) {
		goto __4938
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FrefCount, 1) > 1) {
		goto __4939
	}
	goto __4940
__4939:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4941
	}

	if !((*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != XtclEmptyStringRep) {
		goto __4943
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes)
__4943:
	;
	(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength = -1
__4944:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr105 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr105)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr105)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4947
	}
	XTclThreadFreeObj(tls, value2Ptr)
	goto __4948
__4947:
	*(*uintptr)(unsafe.Pointer(value2Ptr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr105)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr105)).FfirstObjPtr = value2Ptr
	(*AllocCache)(unsafe.Pointer(cachePtr105)).FnumObjects++
__4948:
	;
	goto __4945
__4945:
	if 0 != 0 {
		goto __4944
	}
	goto __4946
__4946:
	;
	goto __4942
__4941:
	XTclFreeObj(tls, value2Ptr)
__4942:
	;
__4940:
	;

__4938:
	;
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = dictPtr
__4937:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = dictPtr
	goto __4936
__4935:
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount++
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclPtrSetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0), uintptr(0), uintptr(0),
		dictPtr, TCL_LEAVE_ERR_MSG, opnd)
	checkInterp = 1
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1) {
		goto __4949
	}
	goto __4950
__4949:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __4951
	}

	if !((*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep) {
		goto __4953
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
__4953:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
__4954:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr106 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr106)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr106)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __4957
	}
	XTclThreadFreeObj(tls, dictPtr)
	goto __4958
__4957:
	*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr106)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr106)).FfirstObjPtr = dictPtr
	(*AllocCache)(unsafe.Pointer(cachePtr106)).FnumObjects++
__4958:
	;
	goto __4955
__4955:
	if 0 != 0 {
		goto __4954
	}
	goto __4956
__4956:
	;
	goto __4952
__4951:
	XTclFreeObj(tls, dictPtr)
__4952:
	;
__4950:
	;

	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == uintptr(0)) {
		goto __4959
	}

	goto gotError
__4959:
	;
__4936:
	;
	if !(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5)))) == INST_POP) {
		goto __4960
	}
__4961:
	;
	if !(2 == 0) {
		goto __4964
	}
	if !(0 != 0) {
		goto __4966
	}
	if !(0 > 0) {
		goto __4967
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4968
__4967:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4968:
	;
__4966:
	;
	pc += uintptr(6)
	goto cleanup0
	goto __4965
__4964:
	if !(0 != 0) {
		goto __4969
	}
	if !(0 > 0) {
		goto __4971
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4971:
	;
	pc += uintptr(6)
	switch 2 {
	case 1:
		goto __4973
	case 2:
		goto __4974
	case 0:
		goto __4975
	}
	goto __4972
__4973:
	goto cleanup1_pushObjResultPtr
__4974:
	goto cleanup2_pushObjResultPtr
__4975:
	goto __4972
__4972:
	;
	goto __4970
__4969:
	pc += uintptr(6)
	switch 2 {
	case 1:
		goto __4977
	case 2:
		goto __4978
	case 0:
		goto __4979
	}
	goto __4976
__4977:
	goto cleanup1
__4978:
	goto cleanup2
__4979:
	goto __4976
__4976:
	;
__4970:
	;
__4965:
	;
	goto __4962
__4962:
	if 0 != 0 {
		goto __4961
	}
	goto __4963
__4963:
	;
__4960:
	;

__4980:
	;
	if !(2 == 0) {
		goto __4983
	}
	if !(1 != 0) {
		goto __4985
	}
	if !(1 > 0) {
		goto __4986
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __4987
__4986:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__4987:
	;
__4985:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __4984
__4983:
	if !(1 != 0) {
		goto __4988
	}
	if !(1 > 0) {
		goto __4990
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__4990:
	;
	pc += uintptr(5)
	switch 2 {
	case 1:
		goto __4992
	case 2:
		goto __4993
	case 0:
		goto __4994
	}
	goto __4991
__4992:
	goto cleanup1_pushObjResultPtr
__4993:
	goto cleanup2_pushObjResultPtr
__4994:
	goto __4991
__4991:
	;
	goto __4989
__4988:
	pc += uintptr(5)
	switch 2 {
	case 1:
		goto __4996
	case 2:
		goto __4997
	case 0:
		goto __4998
	}
	goto __4995
__4996:
	goto cleanup1
__4997:
	goto cleanup2
__4998:
	goto __4995
__4995:
	;
__4989:
	;
__4984:
	;
	goto __4981
__4981:
	if 0 != 0 {
		goto __4980
	}
	goto __4982
__4982:
	;

__339:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))

	dictPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	searchPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_DictSearch{})))
	if !(XTcl_DictObjFirst(tls, interp, dictPtr, searchPtr, bp+952,
		bp+944, bp+932) != TCL_OK) {
		goto __4999
	}

	// dictPtr is no longer on the stack, and we're not
	// moving it into the internalrep of an iterator.  We need
	// to drop the refcount [Tcl Bug 9b352768e6].

__5000:
	_objPtr35 = dictPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr35)).FrefCount, 1) <= 1) {
		goto __5003
	}
	XTclFreeObj(tls, _objPtr35)
__5003:
	;
	goto __5001
__5001:
	if 0 != 0 {
		goto __5000
	}
	goto __5002
__5002:
	;
	XTclpFree(tls, searchPtr)

	goto gotError
__4999:
	;
__5004:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr107 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr107)).FnumObjects == 0
	}()) {
		goto __5007
	}
	statePtr = XTclThreadAllocObj(tls)
	goto __5008
__5007:
	statePtr = (*AllocCache)(unsafe.Pointer(cachePtr107)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr107)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(statePtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr107)).FnumObjects--
__5008:
	;
	goto __5005
__5005:
	if 0 != 0 {
		goto __5004
	}
	goto __5006
__5006:
	;
	(*Tcl_Obj)(unsafe.Pointer(statePtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(statePtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(statePtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(statePtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(statePtr)).FtypePtr = uintptr(unsafe.Pointer(&dictIteratorType))
	*(*uintptr)(unsafe.Pointer(statePtr + 32)) = searchPtr
	*(*uintptr)(unsafe.Pointer(statePtr + 32 + 8 /* &.ptr2 */)) = dictPtr
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
	if !(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0) {
		goto __5009
	}
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FtypePtr == uintptr(unsafe.Pointer(&dictIteratorType))) {
		goto __5010
	}
	XTcl_Panic(tls, ts+28941, 0)
__5010:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FrefCount, 1) > 1) {
		goto __5011
	}
	goto __5012
__5011:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __5013
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes != XtclEmptyStringRep) {
		goto __5015
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes)
__5015:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Flength = -1
__5016:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr108 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr108)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr108)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __5019
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))
	goto __5020
__5019:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr108)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr108)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	(*AllocCache)(unsafe.Pointer(cachePtr108)).FnumObjects++
__5020:
	;
	goto __5017
__5017:
	if 0 != 0 {
		goto __5016
	}
	goto __5018
__5018:
	;
	goto __5014
__5013:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))
__5014:
	;
__5012:
	;

__5009:
	;
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = statePtr
	(*Tcl_Obj)(unsafe.Pointer(statePtr)).FrefCount++
	goto pushDictIteratorResult

__340:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))

	statePtr = *(*uintptr)(unsafe.Pointer(compiledLocals + uintptr(opnd)*16 + 8))
	if !(statePtr == uintptr(0) || (*Tcl_Obj)(unsafe.Pointer(statePtr)).FtypePtr != uintptr(unsafe.Pointer(&dictIteratorType))) {
		goto __5021
	}
	XTcl_Panic(tls, ts+28963, 0)
__5021:
	;
	searchPtr = *(*uintptr)(unsafe.Pointer(statePtr + 32))
	XTcl_DictObjNext(tls, searchPtr, bp+952, bp+944, bp+932)
pushDictIteratorResult:
	if !(*(*int32)(unsafe.Pointer(bp + 932)) != 0) {
		goto __5022
	}
__5024:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr109 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr109)).FnumObjects == 0
	}()) {
		goto __5027
	}
	emptyPtr = XTclThreadAllocObj(tls)
	goto __5028
__5027:
	emptyPtr = (*AllocCache)(unsafe.Pointer(cachePtr109)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr109)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(emptyPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr109)).FnumObjects--
__5028:
	;
	goto __5025
__5025:
	if 0 != 0 {
		goto __5024
	}
	goto __5026
__5026:
	;
	(*Tcl_Obj)(unsafe.Pointer(emptyPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(emptyPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(emptyPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(emptyPtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), emptyPtr))).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), emptyPtr))).FrefCount++
	goto __5023
__5022:
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 944))))).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 952))))).FrefCount++
__5023:
	;

	// The INST_DICT_FIRST and INST_DICT_NEXT instructsions are always
	// followed by a conditional jump, so we can take advantage of this to
	// do some peephole optimization (note that we're careful to not close
	// out someone doing something else).

__5029:
	pc += uintptr(5)
	switch int32(*(*uint8)(unsafe.Pointer(pc))) {
	case INST_JUMP_FALSE1:
		goto __5033
	case INST_JUMP_TRUE1:
		goto __5034
	case INST_JUMP_FALSE4:
		goto __5035
	case INST_JUMP_TRUE4:
		goto __5036
	default:
		goto __5037
	}
	goto __5032
__5033:
__5038:
	;
	if !(0 == 0) {
		goto __5041
	}
	if !(0 != 0) {
		goto __5043
	}
	if !(0 > 0) {
		goto __5044
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5045
__5044:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5045:
	;
__5043:
	;
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	goto cleanup0
	goto __5042
__5041:
	if !(0 != 0) {
		goto __5046
	}
	if !(0 > 0) {
		goto __5048
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5048:
	;
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 0 {
	case 1:
		goto __5050
	case 2:
		goto __5051
	case 0:
		goto __5052
	}
	goto __5049
__5050:
	goto cleanup1_pushObjResultPtr
__5051:
	goto cleanup2_pushObjResultPtr
__5052:
	goto __5049
__5049:
	;
	goto __5047
__5046:
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(2)
		}
		return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
	}()
	switch 0 {
	case 1:
		goto __5054
	case 2:
		goto __5055
	case 0:
		goto __5056
	}
	goto __5053
__5054:
	goto cleanup1
__5055:
	goto cleanup2
__5056:
	goto __5053
__5053:
	;
__5047:
	;
__5042:
	;
	goto __5039
__5039:
	if 0 != 0 {
		goto __5038
	}
	goto __5040
__5040:
	;
	goto __5032
__5034:
__5057:
	;
	if !(0 == 0) {
		goto __5060
	}
	if !(0 != 0) {
		goto __5062
	}
	if !(0 > 0) {
		goto __5063
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5064
__5063:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5064:
	;
__5062:
	;
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	goto cleanup0
	goto __5061
__5060:
	if !(0 != 0) {
		goto __5065
	}
	if !(0 > 0) {
		goto __5067
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5067:
	;
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 0 {
	case 1:
		goto __5069
	case 2:
		goto __5070
	case 0:
		goto __5071
	}
	goto __5068
__5069:
	goto cleanup1_pushObjResultPtr
__5070:
	goto cleanup2_pushObjResultPtr
__5071:
	goto __5068
__5068:
	;
	goto __5066
__5065:
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(int32(*(*int8)(unsafe.Pointer(pc + uintptr(1)))))
		}
		return uintptr(2)
	}()
	switch 0 {
	case 1:
		goto __5073
	case 2:
		goto __5074
	case 0:
		goto __5075
	}
	goto __5072
__5073:
	goto cleanup1
__5074:
	goto cleanup2
__5075:
	goto __5072
__5072:
	;
__5066:
	;
__5061:
	;
	goto __5058
__5058:
	if 0 != 0 {
		goto __5057
	}
	goto __5059
__5059:
	;
	goto __5032
__5035:
__5076:
	;
	if !(0 == 0) {
		goto __5079
	}
	if !(0 != 0) {
		goto __5081
	}
	if !(0 > 0) {
		goto __5082
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5083
__5082:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5083:
	;
__5081:
	;
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	goto cleanup0
	goto __5080
__5079:
	if !(0 != 0) {
		goto __5084
	}
	if !(0 > 0) {
		goto __5086
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5086:
	;
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 0 {
	case 1:
		goto __5088
	case 2:
		goto __5089
	case 0:
		goto __5090
	}
	goto __5087
__5088:
	goto cleanup1_pushObjResultPtr
__5089:
	goto cleanup2_pushObjResultPtr
__5090:
	goto __5087
__5087:
	;
	goto __5085
__5084:
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(5)
		}
		return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	}()
	switch 0 {
	case 1:
		goto __5092
	case 2:
		goto __5093
	case 0:
		goto __5094
	}
	goto __5091
__5092:
	goto cleanup1
__5093:
	goto cleanup2
__5094:
	goto __5091
__5091:
	;
__5085:
	;
__5080:
	;
	goto __5077
__5077:
	if 0 != 0 {
		goto __5076
	}
	goto __5078
__5078:
	;
	goto __5032
__5036:
__5095:
	;
	if !(0 == 0) {
		goto __5098
	}
	if !(0 != 0) {
		goto __5100
	}
	if !(0 > 0) {
		goto __5101
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5102
__5101:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5102:
	;
__5100:
	;
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	goto cleanup0
	goto __5099
__5098:
	if !(0 != 0) {
		goto __5103
	}
	if !(0 > 0) {
		goto __5105
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5105:
	;
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 0 {
	case 1:
		goto __5107
	case 2:
		goto __5108
	case 0:
		goto __5109
	}
	goto __5106
__5107:
	goto cleanup1_pushObjResultPtr
__5108:
	goto cleanup2_pushObjResultPtr
__5109:
	goto __5106
__5106:
	;
	goto __5104
__5103:
	pc += func() uintptr {
		if *(*int32)(unsafe.Pointer(bp + 932)) != 0 {
			return uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
		}
		return uintptr(5)
	}()
	switch 0 {
	case 1:
		goto __5111
	case 2:
		goto __5112
	case 0:
		goto __5113
	}
	goto __5110
__5111:
	goto cleanup1
__5112:
	goto cleanup2
__5113:
	goto __5110
__5110:
	;
__5104:
	;
__5099:
	;
	goto __5096
__5096:
	if 0 != 0 {
		goto __5095
	}
	goto __5097
__5097:
	;
	goto __5032
__5037:
	if !(*(*int32)(unsafe.Pointer(bp + 932)) < 0) {
		goto __5114
	}
__5116:
	;
__5119:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr110 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr110)).FnumObjects == 0
	}()) {
		goto __5122
	}
	*(*uintptr)(unsafe.Pointer(bp + 936)) = XTclThreadAllocObj(tls)
	goto __5123
__5122:
	*(*uintptr)(unsafe.Pointer(bp + 936)) = (*AllocCache)(unsafe.Pointer(cachePtr110)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr110)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr110)).FnumObjects--
__5123:
	;
	goto __5120
__5120:
	if 0 != 0 {
		goto __5119
	}
	goto __5121
__5121:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)) + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __5117
__5117:
	if 0 != 0 {
		goto __5116
	}
	goto __5118
__5118:
	;
	goto __5115
__5114:
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = *(*uintptr)(unsafe.Pointer(constants + uintptr(libc.Bool32(*(*int32)(unsafe.Pointer(bp + 932)) > 0))*8))
__5115:
	;
__5124:
	;
	if !(0 == 0) {
		goto __5127
	}
	if !(1 != 0) {
		goto __5129
	}
	if !(1 > 0) {
		goto __5130
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5131
__5130:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5131:
	;
__5129:
	;
	pc += uintptr(0)
	goto cleanup0
	goto __5128
__5127:
	if !(1 != 0) {
		goto __5132
	}
	if !(1 > 0) {
		goto __5134
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5134:
	;
	pc += uintptr(0)
	switch 0 {
	case 1:
		goto __5136
	case 2:
		goto __5137
	case 0:
		goto __5138
	}
	goto __5135
__5136:
	goto cleanup1_pushObjResultPtr
__5137:
	goto cleanup2_pushObjResultPtr
__5138:
	goto __5135
__5135:
	;
	goto __5133
__5132:
	pc += uintptr(0)
	switch 0 {
	case 1:
		goto __5140
	case 2:
		goto __5141
	case 0:
		goto __5142
	}
	goto __5139
__5140:
	goto cleanup1
__5141:
	goto cleanup2
__5142:
	goto __5139
__5139:
	;
__5133:
	;
__5128:
	;
	goto __5125
__5125:
	if 0 != 0 {
		goto __5124
	}
	goto __5126
__5126:
	;
	goto __5032
__5032:
	;
	goto __5030
__5030:
	if 0 != 0 {
		goto __5029
	}
	goto __5031
__5031:
	;

__341:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	opnd2 = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(3)))))

	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
	duiPtr = (*AuxData)(unsafe.Pointer((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FauxDataArrayPtr + uintptr(opnd2)*16)).FclientData
__5143:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __5144
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __5143
__5144:
	;
	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0) {
		goto __5145
	}
	dictPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __5146
__5145:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	dictPtr = XTclPtrGetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0), uintptr(0), uintptr(0),
		TCL_LEAVE_ERR_MSG, opnd)
	checkInterp = 1
	if !(dictPtr == uintptr(0)) {
		goto __5147
	}

	goto gotError
__5147:
	;
__5146:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount++
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 960)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 704)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)), bp+704, bp+960)
	}() != TCL_OK) {
		goto __5148
	}

	goto gotError
__5148:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 704)) != (*DictUpdateInfo)(unsafe.Pointer(duiPtr)).Flength) {
		goto __5149
	}
	XTcl_Panic(tls, ts+28984, 0)
__5149:
	;
	i8 = 0
__5150:
	if !(i8 < *(*int32)(unsafe.Pointer(bp + 704))) {
		goto __5152
	}
	if !(XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 960)) + uintptr(i8)*8)),
		bp+944) != TCL_OK) {
		goto __5153
	}

__5154:
	_objPtr36 = dictPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr36)).FrefCount, 1) <= 1) {
		goto __5157
	}
	XTclFreeObj(tls, _objPtr36)
__5157:
	;
	goto __5155
__5155:
	if 0 != 0 {
		goto __5154
	}
	goto __5156
__5156:
	;
	goto gotError
__5153:
	;
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(*(*int32)(unsafe.Pointer(duiPtr + 4 + uintptr(i8)*4)))*16
__5158:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __5159
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __5158
__5159:
	;
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	if !(*(*uintptr)(unsafe.Pointer(bp + 944)) == uintptr(0)) {
		goto __5160
	}
	XTclObjUnsetVar2(tls, interp,
		*(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FlocalCachePtr + 8 + uintptr(*(*int32)(unsafe.Pointer(duiPtr + 4 + uintptr(i8)*4)))*8)),
		uintptr(0), 0)
	goto __5161
__5160:
	if !(XTclPtrSetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760)), uintptr(0), uintptr(0), uintptr(0),
		*(*uintptr)(unsafe.Pointer(bp + 944)), TCL_LEAVE_ERR_MSG,
		*(*int32)(unsafe.Pointer(duiPtr + 4 + uintptr(i8)*4))) == uintptr(0)) {
		goto __5162
	}
	checkInterp = 1

__5163:
	_objPtr37 = dictPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr37)).FrefCount, 1) <= 1) {
		goto __5166
	}
	XTclFreeObj(tls, _objPtr37)
__5166:
	;
	goto __5164
__5164:
	if 0 != 0 {
		goto __5163
	}
	goto __5165
__5165:
	;
	goto gotError
__5162:
	;
__5161:
	;
	checkInterp = 1
	goto __5151
__5151:
	i8++
	goto __5150
	goto __5152
__5152:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1) {
		goto __5167
	}
	goto __5168
__5167:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __5169
	}

	if !((*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep) {
		goto __5171
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
__5171:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
__5172:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr111 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr111)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr111)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __5175
	}
	XTclThreadFreeObj(tls, dictPtr)
	goto __5176
__5175:
	*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr111)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr111)).FfirstObjPtr = dictPtr
	(*AllocCache)(unsafe.Pointer(cachePtr111)).FnumObjects++
__5176:
	;
	goto __5173
__5173:
	if 0 != 0 {
		goto __5172
	}
	goto __5174
__5174:
	;
	goto __5170
__5169:
	XTclFreeObj(tls, dictPtr)
__5170:
	;
__5168:
	;

__5177:
	;
	if !(0 == 0) {
		goto __5180
	}
	if !(0 != 0) {
		goto __5182
	}
	if !(0 > 0) {
		goto __5183
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5184
__5183:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5184:
	;
__5182:
	;
	pc += uintptr(9)
	goto cleanup0
	goto __5181
__5180:
	if !(0 != 0) {
		goto __5185
	}
	if !(0 > 0) {
		goto __5187
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5187:
	;
	pc += uintptr(9)
	switch 0 {
	case 1:
		goto __5189
	case 2:
		goto __5190
	case 0:
		goto __5191
	}
	goto __5188
__5189:
	goto cleanup1_pushObjResultPtr
__5190:
	goto cleanup2_pushObjResultPtr
__5191:
	goto __5188
__5188:
	;
	goto __5186
__5185:
	pc += uintptr(9)
	switch 0 {
	case 1:
		goto __5193
	case 2:
		goto __5194
	case 0:
		goto __5195
	}
	goto __5192
__5193:
	goto cleanup1
__5194:
	goto cleanup2
__5195:
	goto __5192
__5192:
	;
__5186:
	;
__5181:
	;
	goto __5178
__5178:
	if 0 != 0 {
		goto __5177
	}
	goto __5179
__5179:
	;

__342:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	opnd2 = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(5) + uintptr(3)))))

	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16
	duiPtr = (*AuxData)(unsafe.Pointer((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FauxDataArrayPtr + uintptr(opnd2)*16)).FclientData
__5196:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __5197
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __5196
__5197:
	;
	if !(!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ) != 0) && *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) != 0) {
		goto __5198
	}
	dictPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __5199
__5198:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	dictPtr = XTclPtrGetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0), uintptr(0), uintptr(0), 0,
		opnd)
	checkInterp = 1
__5199:
	;
	if !(dictPtr == uintptr(0)) {
		goto __5200
	}

__5201:
	;
	if !(1 == 0) {
		goto __5204
	}
	if !(0 != 0) {
		goto __5206
	}
	if !(0 > 0) {
		goto __5207
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5208
__5207:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5208:
	;
__5206:
	;
	pc += uintptr(9)
	goto cleanup0
	goto __5205
__5204:
	if !(0 != 0) {
		goto __5209
	}
	if !(0 > 0) {
		goto __5211
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5211:
	;
	pc += uintptr(9)
	switch 1 {
	case 1:
		goto __5213
	case 2:
		goto __5214
	case 0:
		goto __5215
	}
	goto __5212
__5213:
	goto cleanup1_pushObjResultPtr
__5214:
	goto cleanup2_pushObjResultPtr
__5215:
	goto __5212
__5212:
	;
	goto __5210
__5209:
	pc += uintptr(9)
	switch 1 {
	case 1:
		goto __5217
	case 2:
		goto __5218
	case 0:
		goto __5219
	}
	goto __5216
__5217:
	goto cleanup1
__5218:
	goto cleanup2
__5219:
	goto __5216
__5216:
	;
__5210:
	;
__5205:
	;
	goto __5202
__5202:
	if 0 != 0 {
		goto __5201
	}
	goto __5203
__5203:
	;
__5200:
	;
	if !(XTcl_DictObjSize(tls, interp, dictPtr, bp+704) != TCL_OK ||
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
				return func() int32 {
					*(*uintptr)(unsafe.Pointer(bp + 960)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)) + 16
					*(*int32)(unsafe.Pointer(bp + 704)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tosPtr)) + 32)))).FelemCount
					return TCL_OK
				}()
			}
			return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(tosPtr)), bp+704, bp+960)
		}() != TCL_OK) {
		goto __5220
	}

	goto gotError
__5220:
	;
	allocdict = libc.Bool32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > 1)
	if !(allocdict != 0) {
		goto __5221
	}
	dictPtr = XTcl_DuplicateObj(tls, dictPtr)
__5221:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 704)) > 0) {
		goto __5222
	}
__5223:
	_isobjPtr10 = dictPtr
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr10)).Fbytes != uintptr(0)) {
		goto __5226
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr10)).Fbytes != XtclEmptyStringRep) {
		goto __5227
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr10)).Fbytes)
__5227:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr10)).Fbytes = uintptr(0)
__5226:
	;
	goto __5224
__5224:
	if 0 != 0 {
		goto __5223
	}
	goto __5225
__5225:
	;
__5222:
	;
	i8 = 0
__5228:
	if !(i8 < *(*int32)(unsafe.Pointer(bp + 704))) {
		goto __5230
	}
	var2Ptr = compiledLocals + uintptr(*(*int32)(unsafe.Pointer(duiPtr + 4 + uintptr(i8)*4)))*16

__5231:
	if !((*Var)(unsafe.Pointer(var2Ptr)).Fflags&VAR_LINK != 0) {
		goto __5232
	}
	var2Ptr = *(*uintptr)(unsafe.Pointer(var2Ptr + 8))
	goto __5231
__5232:
	;
	if !(!((*Var)(unsafe.Pointer(var2Ptr)).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_READ) != 0) && *(*uintptr)(unsafe.Pointer(var2Ptr + 8)) != 0) {
		goto __5233
	}
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(var2Ptr + 8))
	goto __5234
__5233:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = XTclPtrGetVarIdx(tls, interp, var2Ptr, uintptr(0), uintptr(0), uintptr(0),
		0, *(*int32)(unsafe.Pointer(duiPtr + 4 + uintptr(i8)*4)))
	checkInterp = 1
__5234:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 944)) == uintptr(0)) {
		goto __5235
	}
	XTcl_DictObjRemove(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 960 /* keyPtrPtr */)) + uintptr(i8)*8)))
	goto __5236
__5235:
	if !(dictPtr == *(*uintptr)(unsafe.Pointer(bp + 944))) {
		goto __5237
	}
	XTcl_DictObjPut(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 960 /* keyPtrPtr */)) + uintptr(i8)*8)),
		XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */))))
	goto __5238
__5237:
	XTcl_DictObjPut(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 960 /* keyPtrPtr */)) + uintptr(i8)*8)), *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__5238:
	;
__5236:
	;
	goto __5229
__5229:
	i8++
	goto __5228
	goto __5230
__5230:
	;
	if !!((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&(VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH) != 0) {
		goto __5239
	}
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount++
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FrefCount, 1) > 1) {
		goto __5241
	}
	goto __5242
__5241:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __5243
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes != XtclEmptyStringRep) {
		goto __5245
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Fbytes)
__5245:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))).Flength = -1
__5246:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr112 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr112)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr112)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __5249
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))
	goto __5250
__5249:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr112)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr112)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	(*AllocCache)(unsafe.Pointer(cachePtr112)).FnumObjects++
__5250:
	;
	goto __5247
__5247:
	if 0 != 0 {
		goto __5246
	}
	goto __5248
__5248:
	;
	goto __5244
__5243:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)))
__5244:
	;
__5242:
	;

	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8)) = dictPtr
	goto __5240
__5239:
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclPtrSetVarIdx(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0), uintptr(0), uintptr(0),
		dictPtr, TCL_LEAVE_ERR_MSG, opnd)
	checkInterp = 1
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == uintptr(0)) {
		goto __5251
	}
	if !(allocdict != 0) {
		goto __5252
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount, 1) > 1) {
		goto __5253
	}
	goto __5254
__5253:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __5255
	}

	if !((*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != XtclEmptyStringRep) {
		goto __5257
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes)
__5257:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = -1
__5258:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr113 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr113)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr113)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __5261
	}
	XTclThreadFreeObj(tls, dictPtr)
	goto __5262
__5261:
	*(*uintptr)(unsafe.Pointer(dictPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr113)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr113)).FfirstObjPtr = dictPtr
	(*AllocCache)(unsafe.Pointer(cachePtr113)).FnumObjects++
__5262:
	;
	goto __5259
__5259:
	if 0 != 0 {
		goto __5258
	}
	goto __5260
__5260:
	;
	goto __5256
__5255:
	XTclFreeObj(tls, dictPtr)
__5256:
	;
__5254:
	;

__5252:
	;

	goto gotError
__5251:
	;
__5240:
	;

__5263:
	;
	if !(1 == 0) {
		goto __5266
	}
	if !(0 != 0) {
		goto __5268
	}
	if !(0 > 0) {
		goto __5269
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5270
__5269:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5270:
	;
__5268:
	;
	pc += uintptr(9)
	goto cleanup0
	goto __5267
__5266:
	if !(0 != 0) {
		goto __5271
	}
	if !(0 > 0) {
		goto __5273
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5273:
	;
	pc += uintptr(9)
	switch 1 {
	case 1:
		goto __5275
	case 2:
		goto __5276
	case 0:
		goto __5277
	}
	goto __5274
__5275:
	goto cleanup1_pushObjResultPtr
__5276:
	goto cleanup2_pushObjResultPtr
__5277:
	goto __5274
__5274:
	;
	goto __5272
__5271:
	pc += uintptr(9)
	switch 1 {
	case 1:
		goto __5279
	case 2:
		goto __5280
	case 0:
		goto __5281
	}
	goto __5278
__5279:
	goto cleanup1
__5280:
	goto cleanup2
__5281:
	goto __5278
__5278:
	;
__5272:
	;
__5267:
	;
	goto __5264
__5264:
	if 0 != 0 {
		goto __5263
	}
	goto __5265
__5265:
	;

__343:
	dictPtr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	listPtr3 = *(*uintptr)(unsafe.Pointer(tosPtr))

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(listPtr3)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 712)) = *(*uintptr)(unsafe.Pointer(listPtr3 + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 720)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(listPtr3 + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, listPtr3, bp+720, bp+712)
	}() != TCL_OK) {
		goto __5282
	}

	goto gotError
__5282:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTclDictWithInit(tls, interp, dictPtr, *(*int32)(unsafe.Pointer(bp + 720 /* objc */)), *(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)))
	if !(*(*uintptr)(unsafe.Pointer(bp + 936)) == uintptr(0)) {
		goto __5283
	}

	goto gotError
__5283:
	;

__5284:
	;
	if !(2 == 0) {
		goto __5287
	}
	if !(1 != 0) {
		goto __5289
	}
	if !(1 > 0) {
		goto __5290
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5291
__5290:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5291:
	;
__5289:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __5288
__5287:
	if !(1 != 0) {
		goto __5292
	}
	if !(1 > 0) {
		goto __5294
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5294:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __5296
	case 2:
		goto __5297
	case 0:
		goto __5298
	}
	goto __5295
__5296:
	goto cleanup1_pushObjResultPtr
__5297:
	goto cleanup2_pushObjResultPtr
__5298:
	goto __5295
__5295:
	;
	goto __5293
__5292:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __5300
	case 2:
		goto __5301
	case 0:
		goto __5302
	}
	goto __5299
__5300:
	goto cleanup1
__5301:
	goto cleanup2
__5302:
	goto __5299
__5299:
	;
__5293:
	;
__5288:
	;
	goto __5285
__5285:
	if 0 != 0 {
		goto __5284
	}
	goto __5286
__5286:
	;

__344:
	keysPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	varNamePtr = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	listPtr3 = *(*uintptr)(unsafe.Pointer(tosPtr))

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(listPtr3)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 712)) = *(*uintptr)(unsafe.Pointer(listPtr3 + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 720)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(listPtr3 + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, listPtr3, bp+720, bp+712)
	}() != TCL_OK) {
		goto __5303
	}

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keysPtr)).FrefCount, 1) > 1) {
		goto __5304
	}
	goto __5305
__5304:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __5306
	}

	if !((*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != XtclEmptyStringRep) {
		goto __5308
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes)
__5308:
	;
	(*Tcl_Obj)(unsafe.Pointer(keysPtr)).Flength = -1
__5309:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr114 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr114)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr114)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __5312
	}
	XTclThreadFreeObj(tls, keysPtr)
	goto __5313
__5312:
	*(*uintptr)(unsafe.Pointer(keysPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr114)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr114)).FfirstObjPtr = keysPtr
	(*AllocCache)(unsafe.Pointer(cachePtr114)).FnumObjects++
__5313:
	;
	goto __5310
__5310:
	if 0 != 0 {
		goto __5309
	}
	goto __5311
__5311:
	;
	goto __5307
__5306:
	XTclFreeObj(tls, keysPtr)
__5307:
	;
__5305:
	;

	goto gotError
__5303:
	;
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = XTclObjLookupVarEx(tls, interp, varNamePtr, uintptr(0),
		TCL_LEAVE_ERR_MSG, ts+5303, 1, 1, bp+728)
	if !(*(*uintptr)(unsafe.Pointer(bp + 760)) == uintptr(0)) {
		goto __5314
	}

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keysPtr)).FrefCount, 1) > 1) {
		goto __5315
	}
	goto __5316
__5315:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __5317
	}

	if !((*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != XtclEmptyStringRep) {
		goto __5319
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes)
__5319:
	;
	(*Tcl_Obj)(unsafe.Pointer(keysPtr)).Flength = -1
__5320:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr115 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr115)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr115)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __5323
	}
	XTclThreadFreeObj(tls, keysPtr)
	goto __5324
__5323:
	*(*uintptr)(unsafe.Pointer(keysPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr115)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr115)).FfirstObjPtr = keysPtr
	(*AllocCache)(unsafe.Pointer(cachePtr115)).FnumObjects++
__5324:
	;
	goto __5321
__5321:
	if 0 != 0 {
		goto __5320
	}
	goto __5322
__5322:
	;
	goto __5318
__5317:
	XTclFreeObj(tls, keysPtr)
__5318:
	;
__5316:
	;

	goto gotError
__5314:
	;
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	result = XTclDictWithFinish(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), *(*uintptr)(unsafe.Pointer(bp + 728 /* arrayPtr */)), varNamePtr, uintptr(0), -1,
		*(*int32)(unsafe.Pointer(bp + 720 /* objc */)), *(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)), keysPtr)
	checkInterp = 1
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(keysPtr)).FrefCount, 1) > 1) {
		goto __5325
	}
	goto __5326
__5325:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __5327
	}

	if !((*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != XtclEmptyStringRep) {
		goto __5329
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes)
__5329:
	;
	(*Tcl_Obj)(unsafe.Pointer(keysPtr)).Flength = -1
__5330:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr116 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr116)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr116)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __5333
	}
	XTclThreadFreeObj(tls, keysPtr)
	goto __5334
__5333:
	*(*uintptr)(unsafe.Pointer(keysPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr116)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr116)).FfirstObjPtr = keysPtr
	(*AllocCache)(unsafe.Pointer(cachePtr116)).FnumObjects++
__5334:
	;
	goto __5331
__5331:
	if 0 != 0 {
		goto __5330
	}
	goto __5332
__5332:
	;
	goto __5328
__5327:
	XTclFreeObj(tls, keysPtr)
__5328:
	;
__5326:
	;

	if !(result != TCL_OK) {
		goto __5335
	}

	goto gotError
__5335:
	;

__5336:
	;
	if !(2 == 0) {
		goto __5339
	}
	if !(0 != 0) {
		goto __5341
	}
	if !(0 > 0) {
		goto __5342
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5343
__5342:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5343:
	;
__5341:
	;
	pc += uintptr(1)
	goto cleanup0
	goto __5340
__5339:
	if !(0 != 0) {
		goto __5344
	}
	if !(0 > 0) {
		goto __5346
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5346:
	;
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __5348
	case 2:
		goto __5349
	case 0:
		goto __5350
	}
	goto __5347
__5348:
	goto cleanup1_pushObjResultPtr
__5349:
	goto cleanup2_pushObjResultPtr
__5350:
	goto __5347
__5347:
	;
	goto __5345
__5344:
	pc += uintptr(1)
	switch 2 {
	case 1:
		goto __5352
	case 2:
		goto __5353
	case 0:
		goto __5354
	}
	goto __5351
__5352:
	goto cleanup1
__5353:
	goto cleanup2
__5354:
	goto __5351
__5351:
	;
__5345:
	;
__5340:
	;
	goto __5337
__5337:
	if 0 != 0 {
		goto __5336
	}
	goto __5338
__5338:
	;

__345:
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	listPtr3 = *(*uintptr)(unsafe.Pointer(tosPtr - uintptr(1)*8))
	keysPtr = *(*uintptr)(unsafe.Pointer(tosPtr))
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = compiledLocals + uintptr(opnd)*16

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(listPtr3)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 712)) = *(*uintptr)(unsafe.Pointer(listPtr3 + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 720)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(listPtr3 + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, listPtr3, bp+720, bp+712)
	}() != TCL_OK) {
		goto __5355
	}

	goto gotError
__5355:
	;
__5356:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)))).Fflags&VAR_LINK != 0) {
		goto __5357
	}
	*(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 760)) + 8))
	goto __5356
__5357:
	;
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	result = XTclDictWithFinish(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 760 /* varPtr */)), uintptr(0), uintptr(0), uintptr(0), opnd,
		*(*int32)(unsafe.Pointer(bp + 720 /* objc */)), *(*uintptr)(unsafe.Pointer(bp + 712 /* objv */)), keysPtr)
	checkInterp = 1
	if !(result != TCL_OK) {
		goto __5358
	}

	goto gotError
__5358:
	;

__5359:
	;
	if !(2 == 0) {
		goto __5362
	}
	if !(0 != 0) {
		goto __5364
	}
	if !(0 > 0) {
		goto __5365
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5366
__5365:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5366:
	;
__5364:
	;
	pc += uintptr(5)
	goto cleanup0
	goto __5363
__5362:
	if !(0 != 0) {
		goto __5367
	}
	if !(0 > 0) {
		goto __5369
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5369:
	;
	pc += uintptr(5)
	switch 2 {
	case 1:
		goto __5371
	case 2:
		goto __5372
	case 0:
		goto __5373
	}
	goto __5370
__5371:
	goto cleanup1_pushObjResultPtr
__5372:
	goto cleanup2_pushObjResultPtr
__5373:
	goto __5370
__5370:
	;
	goto __5368
__5367:
	pc += uintptr(5)
	switch 2 {
	case 1:
		goto __5375
	case 2:
		goto __5376
	case 0:
		goto __5377
	}
	goto __5374
__5375:
	goto cleanup1
__5376:
	goto cleanup2
__5377:
	goto __5374
__5374:
	;
__5368:
	;
__5363:
	;
	goto __5360
__5360:
	if 0 != 0 {
		goto __5359
	}
	goto __5361
__5361:
	;

	goto __159

	//	   End of dictionary-related instructions.
	// -----------------------------------------------------------------

__346:

	switch uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1)))) {
	case uint32(0):
		goto __5379
	case uint32(1):
		goto __5380
	case uint32(2):
		goto __5381
	case uint32(3):
		goto __5382
	default:
		goto __5383
	}
	goto __5378
__5379: // clicks
	wval = Tcl_WideInt(XTclpGetClicks(tls))
	goto __5378
__5380: // microseconds
	XTcl_GetTime(tls, bp+968)
	wval = (*Tcl_Time)(unsafe.Pointer(bp+968)).Fsec*int64(1000000) + (*Tcl_Time)(unsafe.Pointer(bp+968)).Fusec
	goto __5378
__5381: // milliseconds
	XTcl_GetTime(tls, bp+968)
	wval = (*Tcl_Time)(unsafe.Pointer(bp+968)).Fsec*int64(1000) + (*Tcl_Time)(unsafe.Pointer(bp+968)).Fusec/int64(1000)
	goto __5378
__5382: // seconds
	XTcl_GetTime(tls, bp+968)
	wval = (*Tcl_Time)(unsafe.Pointer(bp + 968 /* &now */)).Fsec
	goto __5378
__5383:
	XTcl_Panic(tls, ts+29025, 0)
__5378:
	;
	*(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */)) = XTcl_NewWideIntObj(tls, wval)

__5384:
	;
	if !(0 == 0) {
		goto __5387
	}
	if !(1 != 0) {
		goto __5389
	}
	if !(1 > 0) {
		goto __5390
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5391
__5390:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5391:
	;
__5389:
	;
	pc += uintptr(2)
	goto cleanup0
	goto __5388
__5387:
	if !(1 != 0) {
		goto __5392
	}
	if !(1 > 0) {
		goto __5394
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5394:
	;
	pc += uintptr(2)
	switch 0 {
	case 1:
		goto __5396
	case 2:
		goto __5397
	case 0:
		goto __5398
	}
	goto __5395
__5396:
	goto cleanup1_pushObjResultPtr
__5397:
	goto cleanup2_pushObjResultPtr
__5398:
	goto __5395
__5395:
	;
	goto __5393
__5392:
	pc += uintptr(2)
	switch 0 {
	case 1:
		goto __5400
	case 2:
		goto __5401
	case 0:
		goto __5402
	}
	goto __5399
__5400:
	goto cleanup1
__5401:
	goto cleanup2
__5402:
	goto __5399
__5399:
	;
__5393:
	;
__5388:
	;
	goto __5385
__5385:
	if 0 != 0 {
		goto __5384
	}
	goto __5386
__5386:
	;

	goto __159

__347:
	XTcl_Panic(tls, ts+29067, libc.VaList(bp+608, int32(*(*uint8)(unsafe.Pointer(pc)))))
__159:
	; /* end of switch on opCode */

	/*
	 * Block for variables needed to process exception returns.
	 */

	// An external evaluation (INST_INVOKE or INST_EVAL) returned
	// something different from TCL_OK, or else INST_BREAK or
	// INST_CONTINUE were called.

processExceptionReturn:
	if !(result == TCL_CONTINUE || result == TCL_BREAK) {
		goto __5403
	}
	rangePtr = sGetExceptRangeForPc(tls, pc, result, (*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)
	if !(rangePtr == uintptr(0)) {
		goto __5404
	}

	goto abnormalReturn
__5404:
	;
	if !((*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype == CATCH_EXCEPTION_RANGE) {
		goto __5405
	}

	goto processCatch
__5405:
	;
__5406:
	if !(libc.PostDecInt32(&cleanup, 1) != 0) {
		goto __5407
	}
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount, 1) > 1) {
		goto __5408
	}
	goto __5409
__5408:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __5410
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != XtclEmptyStringRep) {
		goto __5412
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes)
__5412:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength = -1
__5413:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr117 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr117)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr117)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __5416
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)))
	goto __5417
__5416:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr117)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr117)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 944))
	(*AllocCache)(unsafe.Pointer(cachePtr117)).FnumObjects++
__5417:
	;
	goto __5414
__5414:
	if 0 != 0 {
		goto __5413
	}
	goto __5415
__5415:
	;
	goto __5411
__5410:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__5411:
	;
__5409:
	;

	goto __5406
__5407:
	;
	if !(result == TCL_BREAK) {
		goto __5418
	}
	result = TCL_OK
	pc = (*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FcodeStart + uintptr((*ExceptionRange)(unsafe.Pointer(rangePtr)).FbreakOffset)

__5419:
	;
	if !(0 == 0) {
		goto __5422
	}
	if !(0 != 0) {
		goto __5424
	}
	if !(0 > 0) {
		goto __5425
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5426
__5425:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5426:
	;
__5424:
	;
	pc += uintptr(0)
	goto cleanup0
	goto __5423
__5422:
	if !(0 != 0) {
		goto __5427
	}
	if !(0 > 0) {
		goto __5429
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5429:
	;
	pc += uintptr(0)
	switch 0 {
	case 1:
		goto __5431
	case 2:
		goto __5432
	case 0:
		goto __5433
	}
	goto __5430
__5431:
	goto cleanup1_pushObjResultPtr
__5432:
	goto cleanup2_pushObjResultPtr
__5433:
	goto __5430
__5430:
	;
	goto __5428
__5427:
	pc += uintptr(0)
	switch 0 {
	case 1:
		goto __5435
	case 2:
		goto __5436
	case 0:
		goto __5437
	}
	goto __5434
__5435:
	goto cleanup1
__5436:
	goto cleanup2
__5437:
	goto __5434
__5434:
	;
__5428:
	;
__5423:
	;
	goto __5420
__5420:
	if 0 != 0 {
		goto __5419
	}
	goto __5421
__5421:
	;
__5418:
	;
	if !((*ExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset == -1) {
		goto __5438
	}

	goto checkForCatch
__5438:
	;
	result = TCL_OK
	pc = (*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FcodeStart + uintptr((*ExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset)

__5439:
	;
	if !(0 == 0) {
		goto __5442
	}
	if !(0 != 0) {
		goto __5444
	}
	if !(0 > 0) {
		goto __5445
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5446
__5445:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5446:
	;
__5444:
	;
	pc += uintptr(0)
	goto cleanup0
	goto __5443
__5442:
	if !(0 != 0) {
		goto __5447
	}
	if !(0 > 0) {
		goto __5449
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5449:
	;
	pc += uintptr(0)
	switch 0 {
	case 1:
		goto __5451
	case 2:
		goto __5452
	case 0:
		goto __5453
	}
	goto __5450
__5451:
	goto cleanup1_pushObjResultPtr
__5452:
	goto cleanup2_pushObjResultPtr
__5453:
	goto __5450
__5450:
	;
	goto __5448
__5447:
	pc += uintptr(0)
	switch 0 {
	case 1:
		goto __5455
	case 2:
		goto __5456
	case 0:
		goto __5457
	}
	goto __5454
__5455:
	goto cleanup1
__5456:
	goto cleanup2
__5457:
	goto __5454
__5454:
	;
__5448:
	;
__5443:
	;
	goto __5440
__5440:
	if 0 != 0 {
		goto __5439
	}
	goto __5441
__5441:
	;
__5403:
	;
	goto checkForCatch

	// Division by zero in an expression. Control only reaches this point
	// by "goto divideByZero".

divideByZero:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+29112, -1))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+616, ts+8249, ts+29127, ts+29112, uintptr(0)))
	checkInterp = 1
	goto gotError

	// Exponentiation of zero by negative number in an expression. Control
	// only reaches this point by "goto exponOfZero".

exponOfZero:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+29135, -1))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+648, ts+8249, ts+8255,
		ts+29135, uintptr(0)))
	checkInterp = 1

	// Almost all error paths feed through here rather than assigning to
	// result themselves (for a small but consistent saving).

gotError:
	result = TCL_ERROR

	// Execution has generated an "exception" such as TCL_ERROR. If the
	// exception is an error, record information about what was being
	// executed when the error occurred. Find the closest enclosing catch
	// range, if any. If no enclosing catch range is found, stop execution
	// and return the "exception" code.

checkForCatch:
	if !((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).Frewind != 0) {
		goto __5458
	}
	goto abnormalReturn
__5458:
	;
	if !(result == TCL_ERROR && !((*Interp)(unsafe.Pointer(interp)).Fflags&ERR_ALREADY_LOGGED != 0)) {
		goto __5459
	}

	bytes3 = sGetSrcInfoForPc(tls, pc, (*TEBCdata)(unsafe.Pointer(TD)).FcodePtr, bp+704, bp+984, uintptr(0))
	(*ExecStack)(unsafe.Pointer((*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FexecStackPtr)).FtosPtr = tosPtr
	XTclLogCommandInfo(tls, interp, (*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).Fsource, bytes3,
		func() int32 {
			if bytes3 != 0 {
				return *(*int32)(unsafe.Pointer(bp + 704 /* length */))
			}
			return 0
		}(), *(*uintptr)(unsafe.Pointer(bp + 984 /* pcBeg */)), tosPtr)
	checkInterp = 1
__5459:
	;
	*(*int32)(unsafe.Pointer(interp + 424)) &= libc.CplInt32(ERR_ALREADY_LOGGED)

	// Clear all expansions that may have started after the last
	// INST_BEGIN_CATCH.

__5460:
	if !((*TEBCdata)(unsafe.Pointer(TD)).FauxObjList != 0) {
		goto __5461
	}
	if !((*TEBCdata)(unsafe.Pointer(TD)).FcatchTop != TD+112-uintptr(1)*8 &&
		*(*Ptrdiff_t)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcatchTop)) > Ptrdiff_t(*(*uintptr)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FauxObjList + 32 + 8)))) {
		goto __5462
	}
	goto __5461
__5462:
	;
__5463:
	tmpPtr = (*TEBCdata)(unsafe.Pointer(TD)).FauxObjList
	(*TEBCdata)(unsafe.Pointer(TD)).FauxObjList = *(*uintptr)(unsafe.Pointer(tmpPtr + 32))
__5466:
	_objPtr38 = tmpPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr38)).FrefCount, 1) <= 1) {
		goto __5469
	}
	XTclFreeObj(tls, _objPtr38)
__5469:
	;
	goto __5467
__5467:
	if 0 != 0 {
		goto __5466
	}
	goto __5468
__5468:
	;
	goto __5464
__5464:
	if 0 != 0 {
		goto __5463
	}
	goto __5465
__5465:
	;
	goto __5460
__5461:
	;

	// We must not catch if the script in progress has been canceled with
	// the TCL_CANCEL_UNWIND flag. Instead, it blows outwards until we
	// either hit another interpreter (presumably where the script in
	// progress has not been canceled) or we get to the top-level. We do
	// NOT modify the interpreter result here because we know it will
	// already be set prior to vectoring down to this point in the code.

	if !(((*Interp)(unsafe.Pointer(interp)).Fflags&CANCELED != 0 || (*Interp)(unsafe.Pointer(interp)).Fflags&TCL_CANCEL_UNWIND != 0) && XTcl_Canceled(tls, interp, 0) == TCL_ERROR) {
		goto __5470
	}
	goto abnormalReturn
__5470:
	;

	// We must not catch an exceeded limit. Instead, it blows outwards
	// until we either hit another interpreter (presumably where the limit
	// is not exceeded) or we get to the top-level.

	if !((*Interp)(unsafe.Pointer(interp)).Flimit.Fexceeded != 0) {
		goto __5471
	}
	goto abnormalReturn
__5471:
	;
	if !((*TEBCdata)(unsafe.Pointer(TD)).FcatchTop == TD+112-uintptr(1)*8) {
		goto __5472
	}
	goto abnormalReturn
__5472:
	;
	rangePtr = sGetExceptRangeForPc(tls, pc, TCL_ERROR, (*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)
	if !(rangePtr == uintptr(0)) {
		goto __5473
	}
	// This is only possible when compiling a [catch] that sends its
	// script to INST_EVAL. Cannot correct the compiler without
	// breaking compat with previous .tbc compiled scripts.

	goto abnormalReturn
__5473:
	;

	// A catch exception range (rangePtr) was found to handle an
	// "exception". It was found either by checkForCatch just above or by
	// an instruction during break, continue, or error processing. Jump to
	// its catchOffset after unwinding the operand stack to the depth it
	// had when starting to execute the range's catch command.

processCatch:
__5474:
	if !((int64(tosPtr)-int64(TD+112-uintptr(1)*8+uintptr((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FmaxExceptDepth)*8))/8 > *(*Ptrdiff_t)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcatchTop))) {
		goto __5475
	}
	*(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)) = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FrefCount, 1) > 1) {
		goto __5476
	}
	goto __5477
__5476:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __5478
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes != XtclEmptyStringRep) {
		goto __5480
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Fbytes)
__5480:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)))).Flength = -1
__5481:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr118 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr118)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr118)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __5484
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944)))
	goto __5485
__5484:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 944)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr118)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr118)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 944))
	(*AllocCache)(unsafe.Pointer(cachePtr118)).FnumObjects++
__5485:
	;
	goto __5482
__5482:
	if 0 != 0 {
		goto __5481
	}
	goto __5483
__5483:
	;
	goto __5479
__5478:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 944 /* valuePtr */)))
__5479:
	;
__5477:
	;

	goto __5474
__5475:
	;
	pc = (*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FcodeStart + uintptr((*ExceptionRange)(unsafe.Pointer(rangePtr)).FcatchOffset)
__5486:
	;
	if !(0 == 0) {
		goto __5489
	}
	if !(0 != 0) {
		goto __5491
	}
	if !(0 > 0) {
		goto __5492
	}
	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), *(*uintptr)(unsafe.Pointer(bp + 936))))).FrefCount++
	goto __5493
__5492:
	*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&tosPtr, 8))) = *(*uintptr)(unsafe.Pointer(bp + 936 /* objResultPtr */))
__5493:
	;
__5491:
	;
	pc += uintptr(0)
	goto cleanup0
	goto __5490
__5489:
	if !(0 != 0) {
		goto __5494
	}
	if !(0 > 0) {
		goto __5496
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 936)))).FrefCount++
__5496:
	;
	pc += uintptr(0)
	switch 0 {
	case 1:
		goto __5498
	case 2:
		goto __5499
	case 0:
		goto __5500
	}
	goto __5497
__5498:
	goto cleanup1_pushObjResultPtr
__5499:
	goto cleanup2_pushObjResultPtr
__5500:
	goto __5497
__5497:
	;
	goto __5495
__5494:
	pc += uintptr(0)
	switch 0 {
	case 1:
		goto __5502
	case 2:
		goto __5503
	case 0:
		goto __5504
	}
	goto __5501
__5502:
	goto cleanup1
__5503:
	goto cleanup2
__5504:
	goto __5501
__5501:
	;
__5495:
	;
__5490:
	;
	goto __5487
__5487:
	if 0 != 0 {
		goto __5486
	}
	goto __5488
__5488:
	; // Restart the execution loop at pc.

	// end of infinite loop dispatching on instructions.

	// Done or abnormal return code. Restore the stack to state it had when
	// starting to execute the ByteCode. Panic if the stack is below the
	// initial level.

abnormalReturn:
__5505:
	if !(0 != 0 && curInstName != 0) {
		goto __5508
	}

__5508:
	;
	goto __5506
__5506:
	if 0 != 0 {
		goto __5505
	}
	goto __5507
__5507:
	;

	// Clear all expansions and same-level NR calls.
	//
	// Note that expansion markers have a NULL type; avoid removing other
	// markers.

__5509:
	if !((*TEBCdata)(unsafe.Pointer(TD)).FauxObjList != 0) {
		goto __5510
	}
__5511:
	tmpPtr = (*TEBCdata)(unsafe.Pointer(TD)).FauxObjList
	(*TEBCdata)(unsafe.Pointer(TD)).FauxObjList = *(*uintptr)(unsafe.Pointer(tmpPtr + 32))
__5514:
	_objPtr39 = tmpPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr39)).FrefCount, 1) <= 1) {
		goto __5517
	}
	XTclFreeObj(tls, _objPtr39)
__5517:
	;
	goto __5515
__5515:
	if 0 != 0 {
		goto __5514
	}
	goto __5516
__5516:
	;
	goto __5512
__5512:
	if 0 != 0 {
		goto __5511
	}
	goto __5513
__5513:
	;
	goto __5509
__5510:
	;
__5518:
	if !(tosPtr > TD+112-uintptr(1)*8+uintptr((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FmaxExceptDepth)*8) {
		goto __5519
	}
	objPtr = *(*uintptr)(unsafe.Pointer(libc.PostDecUintptr(&tosPtr, 8)))
__5520:
	_objPtr40 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr40)).FrefCount, 1) <= 1) {
		goto __5523
	}
	XTclFreeObj(tls, _objPtr40)
__5523:
	;
	goto __5521
__5521:
	if 0 != 0 {
		goto __5520
	}
	goto __5522
__5522:
	;
	goto __5518
__5519:
	;

	if !(tosPtr < TD+112-uintptr(1)*8+uintptr((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FmaxExceptDepth)*8) {
		goto __5524
	}
	libc.Xfprintf(tls, libc.Xstderr,

		ts+29176,
		libc.VaList(bp+680, uint32((int64(pc)-int64((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FcodeStart))/1),
			uint32((int64(tosPtr)-int64(TD+112-uintptr(1)*8+uintptr((*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FmaxExceptDepth)*8))/8), uint32(0)))
	XTcl_Panic(tls, ts+29260, 0)
__5524:
	;

	(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr = (*CmdFrame)(unsafe.Pointer(TD + 24)).FnextPtr
	if !(libc.PostDecInt32(&(*ByteCode)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)).FrefCount, 1) <= 1) {
		goto __5525
	}
	XTclCleanupByteCode(tls, (*TEBCdata)(unsafe.Pointer(TD)).FcodePtr)
__5525:
	;
	XTclStackFree(tls, interp, TD) // free my stack

	return result

	//
	//  INST_START_CMD failure case removed where it doesn't bother that much
	//
	//  Remark that if the interpreter is marked for deletion its
	//  compileEpoch is modified, so that the epoch check also verifies
	//  that the interp is not deleted. If no outside call has been made
	//  since the last check, it is safe to omit the check.
	//
	//      * case INST_START_CMD:
	//

instStartCmdFailed:

	*(*int32)(unsafe.Pointer(bp + 704 /* length */)) = 0

	if !(XTclInterpReady(tls, interp) == TCL_ERROR) {
		goto __5526
	}
	goto gotError
__5526:
	;

	// We used to switch to direct eval; for NRE-awareness we now
	// compile and eval the command so that this evaluation does not
	// add a new TEBC instance. Bug [2910748], bug [fa6bf38d07]
	//
	// TODO: recompile, search this command and eval a code starting from,
	// so that this evaluation does not add a new TEBC instance without
	// NRE-trampoline.

	*(*uint32)(unsafe.Pointer((*TEBCdata)(unsafe.Pointer(TD)).FcodePtr + 32)) |= uint32(TCL_BYTECODE_RECOMPILE)
	bytes4 = sGetSrcInfoForPc(tls, pc, (*TEBCdata)(unsafe.Pointer(TD)).FcodePtr, bp+704, uintptr(0), uintptr(0))
	opnd = int32(uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1))))<<24) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(1))))<<16) | uint32(int32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(2))))<<8) | uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(1) + uintptr(3)))))
	pc += uintptr(opnd - 1)

	(*Tcl_Obj)(unsafe.Pointer(libc.AssignPtrUintptr(libc.PreIncUintptr(&tosPtr, 8), XTcl_NewStringObj(tls, bytes4, *(*int32)(unsafe.Pointer(bp + 704)))))).FrefCount++
	goto instEvalStk

	return int32(0)
}

func sFinalizeOONext(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclExecute.c:8257:1: */
	var iPtr uintptr = interp
	var contextPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))

	// Reset the variable lookup frame.

	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = *(*ClientData)(unsafe.Pointer(data))

	// Restore the call chain context index as we've finished the inner invoke
	// and want to operate in the outer context again.

	(*CallContext)(unsafe.Pointer(contextPtr)).Findex = int32(*(*ClientData)(unsafe.Pointer(data + 2*8)))
	(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = int32(*(*ClientData)(unsafe.Pointer(data + 3*8)))
	*(*int32)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr + 92)) &= libc.CplInt32(FILTER_HANDLING)
	return result
}

func sFinalizeOONextFilter(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclExecute.c:8283:1: */
	var iPtr uintptr = interp
	var contextPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))

	// Reset the variable lookup frame.

	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = *(*ClientData)(unsafe.Pointer(data))

	// Restore the call chain context index as we've finished the inner invoke
	// and want to operate in the outer context again.

	(*CallContext)(unsafe.Pointer(contextPtr)).Findex = int32(*(*ClientData)(unsafe.Pointer(data + 2*8)))
	(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = int32(*(*ClientData)(unsafe.Pointer(data + 3*8)))
	*(*int32)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr + 92)) |= FILTER_HANDLING
	return result
}

// LongPwrSmallExpon -- , WidePwrSmallExpon --
//
// Helpers to calculate small powers of integers whose result is long or wide.
func sWidePwrSmallExpon(tls *libc.TLS, w1 Tcl_WideInt, exponent int64) Tcl_WideInt { /* tclExecute.c:8351:1: */
	var wResult Tcl_WideInt

	wResult = w1 * w1 // b**2
	switch exponent {
	case int64(2):
		break
	case int64(3):
		wResult = wResult * w1 // b**3
		break
	case int64(4):
		wResult = wResult * wResult // b**4
		break
	case int64(5):
		wResult = wResult * wResult // b**4
		wResult = wResult * w1      // b**5
		break
	case int64(6):
		wResult = wResult * w1      // b**3
		wResult = wResult * wResult // b**6
		break
	case int64(7):
		wResult = wResult * w1      // b**3
		wResult = wResult * wResult // b**6
		wResult = wResult * w1      // b**7
		break
	case int64(8):
		wResult = wResult * wResult // b**4
		wResult = wResult * wResult // b**8
		break
	case int64(9):
		wResult = wResult * wResult // b**4
		wResult = wResult * wResult // b**8
		wResult = wResult * w1      // b**9
		break
	case int64(10):
		wResult = wResult * wResult // b**4
		wResult = wResult * w1      // b**5
		wResult = wResult * wResult // b**10
		break
	case int64(11):
		wResult = wResult * wResult // b**4
		wResult = wResult * w1      // b**5
		wResult = wResult * wResult // b**10
		wResult = wResult * w1      // b**11
		break
	case int64(12):
		wResult = wResult * w1      // b**3
		wResult = wResult * wResult // b**6
		wResult = wResult * wResult // b**12
		break
	case int64(13):
		wResult = wResult * w1      // b**3
		wResult = wResult * wResult // b**6
		wResult = wResult * wResult // b**12
		wResult = wResult * w1      // b**13
		break
	case int64(14):
		wResult = wResult * w1      // b**3
		wResult = wResult * wResult // b**6
		wResult = wResult * w1      // b**7
		wResult = wResult * wResult // b**14
		break
	case int64(15):
		wResult = wResult * w1      // b**3
		wResult = wResult * wResult // b**6
		wResult = wResult * w1      // b**7
		wResult = wResult * wResult // b**14
		wResult = wResult * w1      // b**15
		break
	case int64(16):
		wResult = wResult * wResult // b**4
		wResult = wResult * wResult // b**8
		wResult = wResult * wResult // b**16
		break
	}
	return wResult
}

//----------------------------------------------------------------------
//
// ExecuteExtendedBinaryMathOp, ExecuteExtendedUnaryMathOp --
//
//	These functions do advanced math for binary and unary operators
//	respectively, so that the main TEBC code does not bear the cost of
//	them.
//
// Results:
//	A Tcl_Obj* result, or a NULL (in which case valuePtr is updated to
//	hold the result value), or one of the special flag values
//	GENERAL_ARITHMETIC_ERROR, EXPONENT_OF_ZERO or DIVIDED_BY_ZERO. The
//	latter two signify a zero value raised to a negative power or a value
//	divided by zero, respectively. With GENERAL_ARITHMETIC_ERROR, all
//	error information will have already been reported in the interpreter
//	result.
//
// Side effects:
//	May update the Tcl_Obj indicated valuePtr if it is unshared. Will
//	return a NULL when that happens.
//
//----------------------------------------------------------------------

func sExecuteExtendedBinaryMathOp(tls *libc.TLS, interp uintptr, opcode int32, constants uintptr, valuePtr uintptr, value2Ptr uintptr) uintptr { /* tclExecute.c:8455:16: */
	bp := tls.Alloc(160)
	defer tls.Free(160)

	// var type1 int32 at bp, 4

	// var type2 int32 at bp+16, 4

	// var ptr1 ClientData at bp+8, 8

	// var ptr2 ClientData at bp+24, 8

	// var d1 float64 at bp+136, 8

	// var d2 float64 at bp+144, 8

	var dResult float64
	var l1 int64
	var l2 int64
	var lResult int64
	// var w1 Tcl_WideInt at bp+128, 8

	// var w2 Tcl_WideInt at bp+152, 8

	var wResult Tcl_WideInt
	// var big1 Mp_int at bp+32, 24

	// var big2 Mp_int at bp+56, 24

	// var bigResult Mp_int at bp+80, 24

	// var bigRemainder Mp_int at bp+104, 24

	var objResultPtr uintptr
	var invalid int32
	var zero int32
	var shift int64
	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	var signum int32
	var oddExponent int32
	var negativeExponent int32
	var base uint16
	var cachePtr6 uintptr

	if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
		*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_LONG
		*(*ClientData)(unsafe.Pointer(bp + 8)) = valuePtr + 32
	} else {
		if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
			if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(valuePtr + 32))) != 0 {
				*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_NAN
			} else {
				*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_DOUBLE
			}
			*(*ClientData)(unsafe.Pointer(bp + 8)) = valuePtr + 32
		} else {
			if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength == 0 {
				*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_LONG
			} else {
				XTclGetNumberFromObj(tls, uintptr(0), valuePtr, bp+8, bp)
			}
		}
	}
	if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
		*(*int32)(unsafe.Pointer(bp + 16)) = TCL_NUMBER_LONG
		*(*ClientData)(unsafe.Pointer(bp + 24)) = value2Ptr + 32
	} else {
		if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
			if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(value2Ptr + 32))) != 0 {
				*(*int32)(unsafe.Pointer(bp + 16)) = TCL_NUMBER_NAN
			} else {
				*(*int32)(unsafe.Pointer(bp + 16)) = TCL_NUMBER_DOUBLE
			}
			*(*ClientData)(unsafe.Pointer(bp + 24)) = value2Ptr + 32
		} else {
			if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength == 0 {
				*(*int32)(unsafe.Pointer(bp + 16)) = TCL_NUMBER_LONG
			} else {
				XTclGetNumberFromObj(tls, uintptr(0), value2Ptr, bp+24, bp+16)
			}
		}
	}

	switch opcode {
	case INST_MOD:
		goto __2

	case INST_LSHIFT:
		goto __3
	case INST_RSHIFT:
		goto __4

	case INST_BITOR:
		goto __5
	case INST_BITXOR:
		goto __6
	case INST_BITAND:
		goto __7

	case INST_EXPON:
		goto __8

	case INST_ADD:
		goto __9
	case INST_SUB:
		goto __10
	case INST_MULT:
		goto __11
	case INST_DIV:
		goto __12
	}
	goto __1
__2:
	// TODO: Attempts to re-use unshared operands on stack

	l2 = int64(0) // silence gcc warning
	if !(*(*int32)(unsafe.Pointer(bp + 16)) == TCL_NUMBER_LONG) {
		goto __13
	}
	l2 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24))))
	if !(l2 == int64(0)) {
		goto __14
	}
	return libc.UintptrFromInt32(-1)
__14:
	;
	if !(l2 == int64(1) || l2 == int64(-1)) {
		goto __15
	}
	// Div. by |1| always yields remainder of 0.

	return *(*uintptr)(unsafe.Pointer(constants))
__15:
	;
__13:
	;
	XTcl_GetBignumFromObj(tls, uintptr(0), valuePtr, bp+32)
	XTcl_GetBignumFromObj(tls, uintptr(0), value2Ptr, bp+56)
	XTclBN_mp_init(tls, bp+80)
	XTclBN_mp_init(tls, bp+104)
	XTclBN_mp_div(tls, bp+32, bp+56, bp+80, bp+104)
	if !(!(func() int32 {
		if (*Mp_int)(unsafe.Pointer(bp+104)).Fused == 0 {
			return MP_YES
		}
		return MP_NO
	}() != 0) && (*Mp_int)(unsafe.Pointer(bp+104)).Fsign != (*Mp_int)(unsafe.Pointer(bp+56)).Fsign) {
		goto __16
	}
	// Convert to Tcl's integer division rules.

	XTclBN_mp_sub_d(tls, bp+80, uint32(1), bp+80)
	XTclBN_mp_add(tls, bp+104, bp+56, bp+104)
__16:
	;
	XTclBN_mp_copy(tls, bp+104, bp+80)
	XTclBN_mp_clear(tls, bp+104)
	XTclBN_mp_clear(tls, bp+32)
	XTclBN_mp_clear(tls, bp+56)
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __17
	}
	return XTcl_NewBignumObj(tls, bp+80)
	goto __18
__17:
	XTcl_SetBignumObj(tls, valuePtr, bp+80)
	return uintptr(0)
__18:
	;

__3:
__4:
	// Reject negative shift argument.

	switch *(*int32)(unsafe.Pointer(bp + 16 /* type2 */)) {
	case TCL_NUMBER_LONG:
		goto __20
	case TCL_NUMBER_BIG:
		goto __21
	default:
		goto __22
	}
	goto __19
__20:
	invalid = libc.Bool32(*(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24)))) < 0)
	goto __19
__21:
	XTcl_TakeBignumFromObj(tls, uintptr(0), value2Ptr, bp+56)
	invalid = libc.Bool32(XTclBN_mp_cmp_d(tls, bp+56, uint32(0)) == -1)
	XTclBN_mp_clear(tls, bp+56)
	goto __19
__22:
	// Unused, here to silence compiler warning
	invalid = 0
__19:
	;
	if !(invalid != 0) {
		goto __23
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+28810, -1))
	return libc.UintptrFromInt32(-3)
__23:
	;

	// Zero shifted any number of bits is still zero.

	if !(*(*int32)(unsafe.Pointer(bp)) == TCL_NUMBER_LONG && *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8)))) == int64(0)) {
		goto __24
	}
	return *(*uintptr)(unsafe.Pointer(constants))
__24:
	;

	if !(opcode == INST_LSHIFT) {
		goto __25
	}
	// Large left shifts create integer overflow.
	//
	// BEWARE! Can't use Tcl_GetIntFromObj() here because that
	// converts values in the (unsigned) range to their signed int
	// counterparts, leading to incorrect results.

	if !(*(*int32)(unsafe.Pointer(bp + 16)) != TCL_NUMBER_LONG ||
		*(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24)))) > int64(0x7fffffff)) {
		goto __27
	}
	// Technically, we could hold the value (1 << (INT_MAX+1)) in
	// an mp_int, but since we're using mp_mul_2d() to do the
	// work, and it takes only an int argument, that's a good
	// place to draw the line.

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+10555, -1))
	return libc.UintptrFromInt32(-3)
__27:
	;
	shift = int64(int32(*(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24))))))

	// Handle shifts within the native wide range.

	if !(*(*int32)(unsafe.Pointer(bp)) != TCL_NUMBER_BIG &&
		Size_t(shift) < uint64(8)*uint64(unsafe.Sizeof(Tcl_WideInt(0)))) {
		goto __28
	}
	if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
		*(*Tcl_WideInt)(unsafe.Pointer(bp + 128)) = *(*int64)(unsafe.Pointer(valuePtr + 32))
	} else {
		XTcl_GetWideIntFromObj(tls, uintptr(0), valuePtr, bp+128)
	}
	if !!(func() int64 {
		if *(*Tcl_WideInt)(unsafe.Pointer(bp + 128)) > int64(0) {
			return *(*Tcl_WideInt)(unsafe.Pointer(bp + 128))
		}
		return ^*(*Tcl_WideInt)(unsafe.Pointer(bp + 128))
	}()&
		-(Tcl_WideInt(int64(1))<<
			(uint64(8)*uint64(unsafe.Sizeof(Tcl_WideInt(0)))-uint64(1)-uint64(shift))) != 0) {
		goto __29
	}
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __30
	}
	return XTcl_NewWideIntObj(tls, *(*Tcl_WideInt)(unsafe.Pointer(bp + 128))<<shift)
	goto __31
__30:
	XTcl_SetWideIntObj(tls, valuePtr, *(*Tcl_WideInt)(unsafe.Pointer(bp + 128))<<shift)
	return uintptr(0)
__31:
	;

__29:
	;
__28:
	;
	goto __26
__25:
	// Quickly force large right shifts to 0 or -1.

	if !(*(*int32)(unsafe.Pointer(bp + 16)) != TCL_NUMBER_LONG ||
		*(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24)))) > int64(0x7fffffff)) {
		goto __32
	}
	// Again, technically, the value to be shifted could be an
	// mp_int so huge that a right shift by (INT_MAX+1) bits could
	// not take us to the result of 0 or -1, but since we're using
	// mp_div_2d to do the work, and it takes only an int
	// argument, we draw the line there.

	switch *(*int32)(unsafe.Pointer(bp /* type1 */)) {
	case TCL_NUMBER_LONG:
		goto __34
	case TCL_NUMBER_BIG:
		goto __35
	default:
		goto __36
	}
	goto __33
__34:
	zero = libc.Bool32(*(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8)))) > 0)
	goto __33
__35:
	XTcl_TakeBignumFromObj(tls, uintptr(0), valuePtr, bp+32)
	zero = libc.Bool32(XTclBN_mp_cmp_d(tls, bp+32, uint32(0)) == MP_GT)
	XTclBN_mp_clear(tls, bp+32)
	goto __33
__36:
	// Unused, here to silence compiler warning.
	zero = 0
__33:
	;
	if !(zero != 0) {
		goto __37
	}
	return *(*uintptr)(unsafe.Pointer(constants))
__37:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __38
	}
__40:
	;
__43:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __46
	}
	objResultPtr = XTclThreadAllocObj(tls)
	goto __47
__46:
	objResultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objResultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__47:
	;
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objResultPtr + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __41
__41:
	if 0 != 0 {
		goto __40
	}
	goto __42
__42:
	;
	return objResultPtr
	goto __39
__38:
	XTcl_SetLongObj(tls, valuePtr, int64(-1))
	return uintptr(0)
__39:
	;

__32:
	;
	shift = int64(int32(*(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24))))))

__26:
	;

	XTcl_TakeBignumFromObj(tls, uintptr(0), valuePtr, bp+32)

	XTclBN_mp_init(tls, bp+80)
	if !(opcode == INST_LSHIFT) {
		goto __48
	}
	XTclBN_mp_mul_2d(tls, bp+32, int32(shift), bp+80)
	goto __49
__48:
	XTclBN_mp_signed_rsh(tls, bp+32, int32(shift), bp+80)
__49:
	;
	XTclBN_mp_clear(tls, bp+32)
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __50
	}
	return XTcl_NewBignumObj(tls, bp+80)
	goto __51
__50:
	XTcl_SetBignumObj(tls, valuePtr, bp+80)
	return uintptr(0)
__51:
	;

__5:
__6:
__7:
	if !(*(*int32)(unsafe.Pointer(bp)) == TCL_NUMBER_BIG || *(*int32)(unsafe.Pointer(bp + 16)) == TCL_NUMBER_BIG) {
		goto __52
	}
	XTcl_TakeBignumFromObj(tls, uintptr(0), valuePtr, bp+32)
	XTcl_TakeBignumFromObj(tls, uintptr(0), value2Ptr, bp+56)

	XTclBN_mp_init(tls, bp+80)

	switch opcode {
	case INST_BITAND:
		goto __54

	case INST_BITOR:
		goto __55

	case INST_BITXOR:
		goto __56
	}
	goto __53
__54:
	XTclBN_mp_and(tls, bp+32, bp+56, bp+80)
	goto __53

__55:
	XTclBN_mp_or(tls, bp+32, bp+56, bp+80)
	goto __53

__56:
	XTclBN_mp_xor(tls, bp+32, bp+56, bp+80)
	goto __53
__53:
	;

	XTclBN_mp_clear(tls, bp+32)
	XTclBN_mp_clear(tls, bp+56)
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __57
	}
	return XTcl_NewBignumObj(tls, bp+80)
	goto __58
__57:
	XTcl_SetBignumObj(tls, valuePtr, bp+80)
	return uintptr(0)
__58:
	;

__52:
	;

	l1 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8))))
	l2 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24))))

	switch opcode {
	case INST_BITAND:
		goto __60
	case INST_BITOR:
		goto __61
	case INST_BITXOR:
		goto __62
	default:
		goto __63
	}
	goto __59
__60:
	lResult = l1 & l2
	goto __59
__61:
	lResult = l1 | l2
	goto __59
__62:
	lResult = l1 ^ l2
	goto __59
__63:
	// Unused, here to silence compiler warning.
	lResult = int64(0)
__59:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __64
	}
__66:
	;
__69:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __72
	}
	objResultPtr = XTclThreadAllocObj(tls)
	goto __73
__72:
	objResultPtr = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objResultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__73:
	;
	goto __70
__70:
	if 0 != 0 {
		goto __69
	}
	goto __71
__71:
	;
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objResultPtr + 32)) = lResult
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __67
__67:
	if 0 != 0 {
		goto __66
	}
	goto __68
__68:
	;
	return objResultPtr
	goto __65
__64:
	XTcl_SetLongObj(tls, valuePtr, lResult)
	return uintptr(0)
__65:
	;

__8:
	oddExponent = 0
	negativeExponent = 0

	if !(*(*int32)(unsafe.Pointer(bp)) == TCL_NUMBER_DOUBLE || *(*int32)(unsafe.Pointer(bp + 16)) == TCL_NUMBER_DOUBLE) {
		goto __74
	}
	XTcl_GetDoubleFromObj(tls, uintptr(0), valuePtr, bp+136)
	XTcl_GetDoubleFromObj(tls, uintptr(0), value2Ptr, bp+144)

	if !(*(*float64)(unsafe.Pointer(bp + 136)) == 0.0 && *(*float64)(unsafe.Pointer(bp + 144)) < 0.0) {
		goto __75
	}
	return libc.UintptrFromInt32(-2)
__75:
	;
	dResult = libc.Xpow(tls, *(*float64)(unsafe.Pointer(bp + 136 /* d1 */)), *(*float64)(unsafe.Pointer(bp + 144 /* d2 */)))
	goto doubleResult
__74:
	;
	l1 = libc.AssignInt64(&l2, int64(0))
	*(*Tcl_WideInt)(unsafe.Pointer(bp + 128 /* w1 */)) = libc.AssignPtrInt64(bp+152 /* w2 */, int64(0)) // to silence compiler warning (maybe-uninitialized)
	switch *(*int32)(unsafe.Pointer(bp + 16 /* type2 */)) {
	case TCL_NUMBER_LONG:
		goto __77
	case TCL_NUMBER_BIG:
		goto __78
	}
	goto __76
__77:
	l2 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24))))
	if !(l2 == int64(0)) {
		goto __79
	}
	// Anything to the zero power is 1.

	return *(*uintptr)(unsafe.Pointer(constants + 1*8))
	goto __80
__79:
	if !(l2 == int64(1)) {
		goto __81
	}
	// Anything to the first power is itself

	return uintptr(0)
__81:
	;
__80:
	;
	negativeExponent = libc.Bool32(l2 < int64(0))
	oddExponent = int32(l2 & int64(1))
	goto __76
__78:
	XTcl_TakeBignumFromObj(tls, uintptr(0), value2Ptr, bp+56)
	negativeExponent = libc.Bool32(XTclBN_mp_cmp_d(tls, bp+56, uint32(0)) == -1)
	XTclBN_mp_mod_2d(tls, bp+56, 1, bp+56)
	oddExponent = libc.BoolInt32(!(func() int32 {
		if (*Mp_int)(unsafe.Pointer(bp+56)).Fused == 0 {
			return MP_YES
		}
		return MP_NO
	}() != 0))
	XTclBN_mp_clear(tls, bp+56)
	goto __76
__76:
	;

	switch *(*int32)(unsafe.Pointer(bp /* type1 */)) {
	case TCL_NUMBER_LONG:
		goto __83
	}
	goto __82
__83:
	l1 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8))))
	switch l1 {
	case int64(0):
		goto __85
	case int64(1):
		goto __86
	case int64(-1):
		goto __87
	}
	goto __84
__85:
	// Zero to a positive power is zero.
	// Zero to a negative power is div by zero error.

	if !(negativeExponent != 0) {
		return *(*uintptr)(unsafe.Pointer(constants))
	}
	return libc.UintptrFromInt32(-2)
__86:
	// 1 to any power is 1.

	return *(*uintptr)(unsafe.Pointer(constants + 1*8))
__87:
	if !!(negativeExponent != 0) {
		goto __88
	}
	if !!(oddExponent != 0) {
		goto __89
	}
	return *(*uintptr)(unsafe.Pointer(constants + 1*8))
__89:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __90
	}
__92:
	;
__95:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __98
	}
	objResultPtr = XTclThreadAllocObj(tls)
	goto __99
__98:
	objResultPtr = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objResultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__99:
	;
	goto __96
__96:
	if 0 != 0 {
		goto __95
	}
	goto __97
__97:
	;
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objResultPtr + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __93
__93:
	if 0 != 0 {
		goto __92
	}
	goto __94
__94:
	;
	return objResultPtr
	goto __91
__90:
	XTcl_SetLongObj(tls, valuePtr, int64(-1))
	return uintptr(0)
__91:
	;

__88:
	;
	// negativeExponent
	if !(oddExponent != 0) {
		goto __100
	}
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __101
	}
__103:
	;
__106:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __109
	}
	objResultPtr = XTclThreadAllocObj(tls)
	goto __110
__109:
	objResultPtr = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objResultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__110:
	;
	goto __107
__107:
	if 0 != 0 {
		goto __106
	}
	goto __108
__108:
	;
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objResultPtr + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __104
__104:
	if 0 != 0 {
		goto __103
	}
	goto __105
__105:
	;
	return objResultPtr
	goto __102
__101:
	XTcl_SetLongObj(tls, valuePtr, int64(-1))
	return uintptr(0)
__102:
	;

__100:
	;
	return *(*uintptr)(unsafe.Pointer(constants + 1*8))
__84:
	;
	goto __82
__82:
	;
	if !(negativeExponent != 0) {
		goto __111
	}

	// Integers with magnitude greater than 1 raise to a negative
	// power yield the answer zero (see TIP 123).
	return *(*uintptr)(unsafe.Pointer(constants))
__111:
	;

	if !(*(*int32)(unsafe.Pointer(bp)) == TCL_NUMBER_BIG) {
		goto __112
	}
	goto overflowExpon
__112:
	;

	// We refuse to accept exponent arguments that exceed one mp_digit
	// which means the max exponent value is 2**28-1 = 0x0FFFFFFF =
	// 268435455, which fits into a signed 32 bit int which is within the
	// range of the long type. This means any numeric Tcl_Obj value
	// not using TCL_NUMBER_LONG type must hold a value larger than we
	// accept.

	if !(*(*int32)(unsafe.Pointer(bp + 16)) != TCL_NUMBER_LONG) {
		goto __113
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+29332, -1))
	return libc.UintptrFromInt32(-3)
__113:
	;

	// From here (up to overflowExpon) exponent is long (l2).

	if !(*(*int32)(unsafe.Pointer(bp)) == TCL_NUMBER_LONG) {
		goto __114
	}
	if !(l1 == int64(2)) {
		goto __115
	}
	// Reduce small powers of 2 to shifts.

	if !(uint64(l2) < uint64(8)*uint64(unsafe.Sizeof(int64(0)))-uint64(1)) {
		goto __116
	}
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __117
	}
__119:
	;
__122:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0
	}()) {
		goto __125
	}
	objResultPtr = XTclThreadAllocObj(tls)
	goto __126
__125:
	objResultPtr = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objResultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects--
__126:
	;
	goto __123
__123:
	if 0 != 0 {
		goto __122
	}
	goto __124
__124:
	;
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objResultPtr + 32)) = int64(1) << l2
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __120
__120:
	if 0 != 0 {
		goto __119
	}
	goto __121
__121:
	;
	return objResultPtr
	goto __118
__117:
	XTcl_SetLongObj(tls, valuePtr, int64(1)<<l2)
	return uintptr(0)
__118:
	;

__116:
	;
	goto overflowExpon
__115:
	;
	if !(l1 == int64(-2)) {
		goto __127
	}
	if oddExponent != 0 {
		signum = -1
	} else {
		signum = 1
	}

	// Reduce small powers of 2 to shifts.

	if !(uint64(l2) < uint64(8)*uint64(unsafe.Sizeof(int64(0)))-uint64(1)) {
		goto __128
	}
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __129
	}
__131:
	;
__134:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0
	}()) {
		goto __137
	}
	objResultPtr = XTclThreadAllocObj(tls)
	goto __138
__137:
	objResultPtr = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objResultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects--
__138:
	;
	goto __135
__135:
	if 0 != 0 {
		goto __134
	}
	goto __136
__136:
	;
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objResultPtr + 32)) = int64(signum) * (int64(1) << l2)
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __132
__132:
	if 0 != 0 {
		goto __131
	}
	goto __133
__133:
	;
	return objResultPtr
	goto __130
__129:
	XTcl_SetLongObj(tls, valuePtr, int64(signum)*(int64(1)<<l2))
	return uintptr(0)
__130:
	;

__128:
	;
	goto overflowExpon
__127:
	;
	// Code below (up to overflowExpon) works with wide-int base
	*(*Tcl_WideInt)(unsafe.Pointer(bp + 128 /* w1 */)) = l1
__114:
	;

	// From here (up to overflowExpon) base is wide-int (w1).

	if !(l2-int64(2) < int64(sMaxBase64Size) &&
		*(*Tcl_WideInt)(unsafe.Pointer(bp + 128)) <= sMaxBase64[l2-int64(2)] &&
		*(*Tcl_WideInt)(unsafe.Pointer(bp + 128)) >= -sMaxBase64[l2-int64(2)]) {
		goto __139
	}
	// Small powers of integers whose result is wide.
	wResult = sWidePwrSmallExpon(tls, *(*Tcl_WideInt)(unsafe.Pointer(bp + 128 /* w1 */)), l2)

	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __140
	}
	return XTcl_NewWideIntObj(tls, wResult)
	goto __141
__140:
	XTcl_SetWideIntObj(tls, valuePtr, wResult)
	return uintptr(0)
__141:
	;

__139:
	;

	// Handle cases of powers > 16 that still fit in a 64-bit word by
	// doing table lookup.

	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 128))-int64(3) >= int64(0) && *(*Tcl_WideInt)(unsafe.Pointer(bp + 128))-int64(2) < int64(sExp64IndexSize) &&
		l2-int64(2) < int64(sExp64ValueSize+sMaxBase64Size)) {
		goto __142
	}
	base = uint16(int32(sExp64Index[*(*Tcl_WideInt)(unsafe.Pointer(bp + 128))-int64(3)]) +
		int32(uint16(Size_t(l2-int64(2))-sMaxBase64Size)))
	if !(int32(base) < int32(sExp64Index[*(*Tcl_WideInt)(unsafe.Pointer(bp + 128))-int64(2)])) {
		goto __143
	}
	// 64-bit number raised to intermediate power, done by
	// table lookup.

	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __144
	}
	return XTcl_NewWideIntObj(tls, sExp64Value[base])
	goto __145
__144:
	XTcl_SetWideIntObj(tls, valuePtr, sExp64Value[base])
	return uintptr(0)
__145:
	;

__143:
	;
__142:
	;

	if !(-*(*Tcl_WideInt)(unsafe.Pointer(bp + 128))-int64(3) >= int64(0) && -*(*Tcl_WideInt)(unsafe.Pointer(bp + 128))-int64(2) < int64(sExp64IndexSize) &&
		l2-int64(2) < int64(sExp64ValueSize+sMaxBase64Size)) {
		goto __146
	}
	base = uint16(int32(sExp64Index[-*(*Tcl_WideInt)(unsafe.Pointer(bp + 128))-int64(3)]) +
		int32(uint16(Size_t(l2-int64(2))-sMaxBase64Size)))
	if !(int32(base) < int32(sExp64Index[-*(*Tcl_WideInt)(unsafe.Pointer(bp + 128))-int64(2)])) {
		goto __147
	}
	// 64-bit number raised to intermediate power, done by
	// table lookup.

	if oddExponent != 0 {
		wResult = -sExp64Value[base]
	} else {
		wResult = sExp64Value[base]
	}
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __148
	}
	return XTcl_NewWideIntObj(tls, wResult)
	goto __149
__148:
	XTcl_SetWideIntObj(tls, valuePtr, wResult)
	return uintptr(0)
__149:
	;

__147:
	;
__146:
	;

overflowExpon:

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*Tcl_WideInt)(unsafe.Pointer(bp + 152)) = *(*int64)(unsafe.Pointer(value2Ptr + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetWideIntFromObj(tls, uintptr(0), value2Ptr, bp+152)
	}() != TCL_OK ||
		(*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr != uintptr(unsafe.Pointer(&XtclIntType)) ||
		Tcl_WideUInt(*(*Tcl_WideInt)(unsafe.Pointer(bp + 152))) >= uint64(int32(1)<<28)) {
		goto __150
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+29332, -1))
	return libc.UintptrFromInt32(-3)
__150:
	;
	XTcl_TakeBignumFromObj(tls, uintptr(0), valuePtr, bp+32)
	XTclBN_mp_init(tls, bp+80)
	XTclBN_mp_expt_d(tls, bp+32, uint32(*(*Tcl_WideInt)(unsafe.Pointer(bp + 152 /* w2 */))), bp+80)
	XTclBN_mp_clear(tls, bp+32)
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __151
	}
	return XTcl_NewBignumObj(tls, bp+80)
	goto __152
__151:
	XTcl_SetBignumObj(tls, valuePtr, bp+80)
	return uintptr(0)
__152:
	;

__9:
__10:
__11:
__12:
	if !(*(*int32)(unsafe.Pointer(bp)) == TCL_NUMBER_DOUBLE || *(*int32)(unsafe.Pointer(bp + 16)) == TCL_NUMBER_DOUBLE) {
		goto __153
	}
	// At least one of the values is floating-point, so perform
	// floating point calculations.

	XTcl_GetDoubleFromObj(tls, uintptr(0), valuePtr, bp+136)
	XTcl_GetDoubleFromObj(tls, uintptr(0), value2Ptr, bp+144)

	switch opcode {
	case INST_ADD:
		goto __155
	case INST_SUB:
		goto __156
	case INST_MULT:
		goto __157
	case INST_DIV:
		goto __158
	default:
		goto __159
	}
	goto __154
__155:
	dResult = *(*float64)(unsafe.Pointer(bp + 136)) + *(*float64)(unsafe.Pointer(bp + 144))
	goto __154
__156:
	dResult = *(*float64)(unsafe.Pointer(bp + 136)) - *(*float64)(unsafe.Pointer(bp + 144))
	goto __154
__157:
	dResult = *(*float64)(unsafe.Pointer(bp + 136)) * *(*float64)(unsafe.Pointer(bp + 144))
	goto __154
__158:
	// We presume that we are running with zero-divide unmasked if
	// we're on an IEEE box. Otherwise, this statement might cause
	// demons to fly out our noses.

	dResult = *(*float64)(unsafe.Pointer(bp + 136)) / *(*float64)(unsafe.Pointer(bp + 144))
	goto __154
__159:
	// Unused, here to silence compiler warning.
	dResult = float64(0)
__154:
	;

doubleResult:
	// Check now for IEEE floating-point error.

	if !(libc.X__builtin_isnan(tls, dResult) != 0) {
		goto __160
	}
	XTclExprFloatError(tls, interp, dResult)
	return libc.UintptrFromInt32(-3)
__160:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __161
	}
__163:
	;
__166:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0
	}()) {
		goto __169
	}
	objResultPtr = XTclThreadAllocObj(tls)
	goto __170
__169:
	objResultPtr = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objResultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects--
__170:
	;
	goto __167
__167:
	if 0 != 0 {
		goto __166
	}
	goto __168
__168:
	;
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = uintptr(0)
	*(*float64)(unsafe.Pointer(objResultPtr + 32)) = dResult
	(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType))

	goto __164
__164:
	if 0 != 0 {
		goto __163
	}
	goto __165
__165:
	;
	return objResultPtr
	goto __162
__161:
	XTcl_SetDoubleObj(tls, valuePtr, dResult)
	return uintptr(0)
__162:
	;

__153:
	;
	if !(*(*int32)(unsafe.Pointer(bp)) != TCL_NUMBER_BIG && *(*int32)(unsafe.Pointer(bp + 16)) != TCL_NUMBER_BIG) {
		goto __171
	}
	if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
		*(*Tcl_WideInt)(unsafe.Pointer(bp + 128)) = *(*int64)(unsafe.Pointer(valuePtr + 32))
	} else {
		XTcl_GetWideIntFromObj(tls, uintptr(0), valuePtr, bp+128)
	}
	if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
		*(*Tcl_WideInt)(unsafe.Pointer(bp + 152)) = *(*int64)(unsafe.Pointer(value2Ptr + 32))
	} else {
		XTcl_GetWideIntFromObj(tls, uintptr(0), value2Ptr, bp+152)
	}

	switch opcode {
	case INST_ADD:
		goto __173

	case INST_SUB:
		goto __174

	case INST_MULT:
		goto __175

	case INST_DIV:
		goto __176

	default:
		goto __177
	}
	goto __172
__173:
	wResult = *(*Tcl_WideInt)(unsafe.Pointer(bp + 128)) + *(*Tcl_WideInt)(unsafe.Pointer(bp + 152))

	// Check for overflow.

	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 128))^wResult < int64(0) && *(*Tcl_WideInt)(unsafe.Pointer(bp + 128))^*(*Tcl_WideInt)(unsafe.Pointer(bp + 152)) >= int64(0)) {
		goto __178
	}
	goto overflowBasic
__178:
	;

	goto __172

__174:
	wResult = *(*Tcl_WideInt)(unsafe.Pointer(bp + 128)) - *(*Tcl_WideInt)(unsafe.Pointer(bp + 152))

	// Must check for overflow. The macro tests for overflows
	// in sums by looking at the sign bits. As we have a
	// subtraction here, we are adding -w2. As -w2 could in
	// turn overflow, we test with ~w2 instead: it has the
	// opposite sign bit to w2 so it does the job. Note that
	// the only "bad" case (w2==0) is irrelevant for this
	// macro, as in that case w1 and wResult have the same
	// sign and there is no overflow anyway.

	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 128))^wResult < int64(0) && *(*Tcl_WideInt)(unsafe.Pointer(bp + 128))^^*(*Tcl_WideInt)(unsafe.Pointer(bp + 152)) >= int64(0)) {
		goto __179
	}
	goto overflowBasic
__179:
	;

	goto __172

__175:
	if !(*(*int32)(unsafe.Pointer(bp)) != TCL_NUMBER_LONG || *(*int32)(unsafe.Pointer(bp + 16)) != TCL_NUMBER_LONG ||
		uint64(unsafe.Sizeof(Tcl_WideInt(0))) < uint64(2)*uint64(unsafe.Sizeof(int64(0)))) {
		goto __180
	}
	goto overflowBasic
__180:
	;
	wResult = *(*Tcl_WideInt)(unsafe.Pointer(bp + 128)) * *(*Tcl_WideInt)(unsafe.Pointer(bp + 152))
	goto __172

__176:
	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 152)) == int64(0)) {
		goto __181
	}
	return libc.UintptrFromInt32(-1)
__181:
	;

	// Need a bignum to represent (LLONG_MIN / -1)

	if !(int64(*(*Tcl_WideInt)(unsafe.Pointer(bp + 128))) == -0x7fffffffffffffff-1 && *(*Tcl_WideInt)(unsafe.Pointer(bp + 152)) == int64(-1)) {
		goto __182
	}
	goto overflowBasic
__182:
	;
	wResult = *(*Tcl_WideInt)(unsafe.Pointer(bp + 128)) / *(*Tcl_WideInt)(unsafe.Pointer(bp + 152))

	// Force Tcl's integer division rules.
	// TODO: examine for logic simplification

	if !((wResult < int64(0) || wResult == int64(0) && (*(*Tcl_WideInt)(unsafe.Pointer(bp + 128)) < int64(0) && *(*Tcl_WideInt)(unsafe.Pointer(bp + 152)) > int64(0) || *(*Tcl_WideInt)(unsafe.Pointer(bp + 128)) > int64(0) && *(*Tcl_WideInt)(unsafe.Pointer(bp + 152)) < int64(0))) && wResult**(*Tcl_WideInt)(unsafe.Pointer(bp + 152)) != *(*Tcl_WideInt)(unsafe.Pointer(bp + 128))) {
		goto __183
	}
	wResult = wResult - int64(1)
__183:
	;
	goto __172

__177:
	// Unused, here to silence compiler warning.

	wResult = int64(0)
__172:
	;

	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __184
	}
	return XTcl_NewWideIntObj(tls, wResult)
	goto __185
__184:
	XTcl_SetWideIntObj(tls, valuePtr, wResult)
	return uintptr(0)
__185:
	;

__171:
	;

overflowBasic:
	XTcl_TakeBignumFromObj(tls, uintptr(0), valuePtr, bp+32)
	XTcl_TakeBignumFromObj(tls, uintptr(0), value2Ptr, bp+56)
	XTclBN_mp_init(tls, bp+80)
	switch opcode {
	case INST_ADD:
		goto __187
	case INST_SUB:
		goto __188
	case INST_MULT:
		goto __189
	case INST_DIV:
		goto __190
	}
	goto __186
__187:
	XTclBN_mp_add(tls, bp+32, bp+56, bp+80)
	goto __186
__188:
	XTclBN_mp_sub(tls, bp+32, bp+56, bp+80)
	goto __186
__189:
	XTclBN_mp_mul(tls, bp+32, bp+56, bp+80)
	goto __186
__190:
	if !(func() int32 {
		if (*Mp_int)(unsafe.Pointer(bp+56)).Fused == 0 {
			return MP_YES
		}
		return MP_NO
	}() != 0) {
		goto __191
	}
	XTclBN_mp_clear(tls, bp+32)
	XTclBN_mp_clear(tls, bp+56)
	XTclBN_mp_clear(tls, bp+80)
	return libc.UintptrFromInt32(-1)
__191:
	;
	XTclBN_mp_init(tls, bp+104)
	XTclBN_mp_div(tls, bp+32, bp+56, bp+80, bp+104)
	// TODO: internals intrusion
	if !(!(func() int32 {
		if (*Mp_int)(unsafe.Pointer(bp+104)).Fused == 0 {
			return MP_YES
		}
		return MP_NO
	}() != 0) &&
		(*Mp_int)(unsafe.Pointer(bp+104)).Fsign != (*Mp_int)(unsafe.Pointer(bp+56)).Fsign) {
		goto __192
	}
	// Convert to Tcl's integer division rules.

	XTclBN_mp_sub_d(tls, bp+80, uint32(1), bp+80)
	XTclBN_mp_add(tls, bp+104, bp+56, bp+104)
__192:
	;
	XTclBN_mp_clear(tls, bp+104)
	goto __186
__186:
	;
	XTclBN_mp_clear(tls, bp+32)
	XTclBN_mp_clear(tls, bp+56)
	if !((*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1) {
		goto __193
	}
	return XTcl_NewBignumObj(tls, bp+80)
	goto __194
__193:
	XTcl_SetBignumObj(tls, valuePtr, bp+80)
	return uintptr(0)
__194:
	;

__1:
	;

	XTcl_Panic(tls, ts+21482, 0)
	return uintptr(0)
}

func sExecuteExtendedUnaryMathOp(tls *libc.TLS, opcode int32, valuePtr uintptr) uintptr { /* tclExecute.c:9275:16: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	*(*ClientData)(unsafe.Pointer(bp + 8 /* ptr */)) = uintptr(0)
	// var type1 int32 at bp, 4

	var w Tcl_WideInt
	// var big Mp_int at bp+16, 24

	var objResultPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
		*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_LONG
		*(*ClientData)(unsafe.Pointer(bp + 8)) = valuePtr + 32
	} else {
		if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
			if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(valuePtr + 32))) != 0 {
				*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_NAN
			} else {
				*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_DOUBLE
			}
			*(*ClientData)(unsafe.Pointer(bp + 8)) = valuePtr + 32
		} else {
			if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength == 0 {
				*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_LONG
			} else {
				XTclGetNumberFromObj(tls, uintptr(0), valuePtr, bp+8, bp)
			}
		}
	}

	switch opcode {
	case INST_BITNOT:
		XTcl_TakeBignumFromObj(tls, uintptr(0), valuePtr, bp+16)
		// ~a = - a - 1
		XTclBN_mp_neg(tls, bp+16, bp+16)
		XTclBN_mp_sub_d(tls, bp+16, uint32(1), bp+16)
		if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1 {
			return XTcl_NewBignumObj(tls, bp+16)
		} else {
			XTcl_SetBignumObj(tls, valuePtr, bp+16)
			return uintptr(0)
		}

		fallthrough
	case INST_UMINUS:
		switch *(*int32)(unsafe.Pointer(bp /* type1 */)) {
		case TCL_NUMBER_DOUBLE:
			if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1 {
				for ok := true; ok; ok = 0 != 0 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							objResultPtr = XTclThreadAllocObj(tls)
						} else {
							objResultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objResultPtr + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount = 0
					(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = uintptr(0)
					*(*float64)(unsafe.Pointer(objResultPtr + 32)) = -*(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8))))
					(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType))
					{
					}
				}
				return objResultPtr
			} else {
				XTcl_SetDoubleObj(tls, valuePtr, -*(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8)))))
				return uintptr(0)
			}

			fallthrough
		case TCL_NUMBER_LONG:
			w = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8))))
			if int64(w) != -0x7fffffffffffffff-1 {
				if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1 {
					return XTcl_NewWideIntObj(tls, -w)
				} else {
					XTcl_SetWideIntObj(tls, valuePtr, -w)
					return uintptr(0)
				}

			}
			XTclBNInitBignumFromLong(tls, bp+16, *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8 /* ptr */)))))
			break
		default:
			XTcl_TakeBignumFromObj(tls, uintptr(0), valuePtr, bp+16)
		}
		XTclBN_mp_neg(tls, bp+16, bp+16)
		if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount > 1 {
			return XTcl_NewBignumObj(tls, bp+16)
		} else {
			XTcl_SetBignumObj(tls, valuePtr, bp+16)
			return uintptr(0)
		}

	}

	XTcl_Panic(tls, ts+21482, 0)
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// CompareTwoNumbers --
//
//	This function compares a pair of numbers in Tcl_Objs. Each argument
//	must already be known to be numeric and not NaN.
//
// Results:
//	One of MP_LT, MP_EQ or MP_GT, depending on whether valuePtr is less
//	than, equal to, or greater than value2Ptr (respectively).
//
// Side effects:
//	None, provided both values are numeric.
//
//----------------------------------------------------------------------

func XTclCompareTwoNumbers(tls *libc.TLS, valuePtr uintptr, value2Ptr uintptr) int32 { /* tclExecute.c:9355:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	// var type1 int32 at bp, 4

	// var type2 int32 at bp+16, 4

	var compare int32
	// var ptr1 ClientData at bp+8, 8

	// var ptr2 ClientData at bp+24, 8

	// var big1 Mp_int at bp+64, 24

	// var big2 Mp_int at bp+40, 24

	var d1 float64
	var d2 float64
	// var tmp float64 at bp+32, 8

	var l1 int64
	var l2 int64
	*(*int32)(unsafe.Pointer(bp /* type1 */)) = TCL_NUMBER_NAN
	*(*int32)(unsafe.Pointer(bp + 16 /* type2 */)) = TCL_NUMBER_NAN

	if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
		*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_LONG
		*(*ClientData)(unsafe.Pointer(bp + 8)) = valuePtr + 32
	} else {
		if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
			if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(valuePtr + 32))) != 0 {
				*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_NAN
			} else {
				*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_DOUBLE
			}
			*(*ClientData)(unsafe.Pointer(bp + 8)) = valuePtr + 32
		} else {
			if (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(valuePtr)).Flength == 0 {
				*(*int32)(unsafe.Pointer(bp)) = TCL_NUMBER_LONG
			} else {
				XTclGetNumberFromObj(tls, uintptr(0), valuePtr, bp+8, bp)
			}
		}
	}
	if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
		*(*int32)(unsafe.Pointer(bp + 16)) = TCL_NUMBER_LONG
		*(*ClientData)(unsafe.Pointer(bp + 24)) = value2Ptr + 32
	} else {
		if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
			if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(value2Ptr + 32))) != 0 {
				*(*int32)(unsafe.Pointer(bp + 16)) = TCL_NUMBER_NAN
			} else {
				*(*int32)(unsafe.Pointer(bp + 16)) = TCL_NUMBER_DOUBLE
			}
			*(*ClientData)(unsafe.Pointer(bp + 24)) = value2Ptr + 32
		} else {
			if (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(value2Ptr)).Flength == 0 {
				*(*int32)(unsafe.Pointer(bp + 16)) = TCL_NUMBER_LONG
			} else {
				XTclGetNumberFromObj(tls, uintptr(0), value2Ptr, bp+24, bp+16)
			}
		}
	}

	switch *(*int32)(unsafe.Pointer(bp /* type1 */)) {
	case TCL_NUMBER_LONG:
		goto __2

	case TCL_NUMBER_DOUBLE:
		goto __3

	case TCL_NUMBER_BIG:
		goto __4
	default:
		goto __5
	}
	goto __1
__2:
	l1 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8))))
	switch *(*int32)(unsafe.Pointer(bp + 16 /* type2 */)) {
	case TCL_NUMBER_LONG:
		goto __7
	case TCL_NUMBER_DOUBLE:
		goto __8
	case TCL_NUMBER_BIG:
		goto __9
	}
	goto __6
__7:
	l2 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24))))
longCompare:
	if l1 < l2 {
		return -1
	}
	return func() int32 {
		if l1 > l2 {
			return MP_GT
		}
		return MP_EQ
	}()
__8:
	d2 = *(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24))))
	d1 = float64(l1)

	// If the double has a fractional part, or if the long can be
	// converted to double without loss of precision, then compare as
	// doubles.

	if !(uint64(53) > uint64(8)*uint64(unsafe.Sizeof(int64(0))) || l1 == int64(d1) ||
		libc.Xmodf(tls, d2, bp+32) != 0.0) {
		goto __10
	}
	goto doubleCompare
__10:
	;

	// Otherwise, to make comparision based on full precision, need to
	// convert the double to a suitably sized integer.
	//
	// Need this to get comparsions like
	//	  expr 20000000000000003 < 20000000000000004.0
	// right. Converting the first argument to double will yield two
	// double values that are equivalent within double precision.
	// Converting the double to an integer gets done exactly, then
	// integer comparison can tell the difference.

	if !(d2 < float64(-0x7fffffffffffffff-1)) {
		goto __11
	}
	return MP_GT
__11:
	;
	if !(d2 > float64(0x7fffffffffffffff)) {
		goto __12
	}
	return -1
__12:
	;
	l2 = int64(d2)
	goto longCompare
__9:
	XTcl_TakeBignumFromObj(tls, uintptr(0), value2Ptr, bp+40)
	if !(XTclBN_mp_cmp_d(tls, bp+40, uint32(0)) == -1) {
		goto __13
	}
	compare = MP_GT
	goto __14
__13:
	compare = -1
__14:
	;
	XTclBN_mp_clear(tls, bp+40)
	return compare
__6:
	;
	goto __1

__3:
	d1 = *(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 8))))
	switch *(*int32)(unsafe.Pointer(bp + 16 /* type2 */)) {
	case TCL_NUMBER_DOUBLE:
		goto __16
	case TCL_NUMBER_LONG:
		goto __17
	case TCL_NUMBER_BIG:
		goto __18
	}
	goto __15
__16:
	d2 = *(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24))))
doubleCompare:
	if d1 < d2 {
		return -1
	}
	return func() int32 {
		if d1 > d2 {
			return MP_GT
		}
		return MP_EQ
	}()
__17:
	l2 = *(*int64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24))))
	d2 = float64(l2)
	if !(uint64(53) > uint64(8)*uint64(unsafe.Sizeof(int64(0))) || l2 == int64(d2) ||
		libc.Xmodf(tls, d1, bp+32) != 0.0) {
		goto __19
	}
	goto doubleCompare
__19:
	;
	if !(d1 < float64(-0x7fffffffffffffff-1)) {
		goto __20
	}
	return -1
__20:
	;
	if !(d1 > float64(0x7fffffffffffffff)) {
		goto __21
	}
	return MP_GT
__21:
	;
	l1 = int64(d1)
	goto longCompare
__18:
	if !(d1 > 1.79769313486231570814527423731704357e+308 || d1 < -1.79769313486231570814527423731704357e+308) {
		goto __22
	}
	if d1 > 0.0 {
		return MP_GT
	}
	return -1
__22:
	;
	XTcl_TakeBignumFromObj(tls, uintptr(0), value2Ptr, bp+40)
	if !(d1 < float64(0x7fffffffffffffff) && d1 > float64(-0x7fffffffffffffff-1)) {
		goto __23
	}
	if !(func() int32 {
		if (*Mp_int)(unsafe.Pointer(bp+40)).Fsign != MP_ZPOS {
			return MP_YES
		}
		return MP_NO
	}() != 0) {
		goto __24
	}
	compare = MP_GT
	goto __25
__24:
	compare = -1
__25:
	;
	XTclBN_mp_clear(tls, bp+40)
	return compare
__23:
	;
	if !(uint64(53) > uint64(8)*uint64(unsafe.Sizeof(int64(0))) &&
		libc.Xmodf(tls, d1, bp+32) != 0.0) {
		goto __26
	}
	d2 = XTclBignumToDouble(tls, bp+40)
	XTclBN_mp_clear(tls, bp+40)
	goto doubleCompare
__26:
	;
	XTcl_InitBignumFromDouble(tls, uintptr(0), d1, bp+64)
	goto bigCompare
__15:
	;
	goto __1

__4:
	XTcl_TakeBignumFromObj(tls, uintptr(0), valuePtr, bp+64)
	switch *(*int32)(unsafe.Pointer(bp + 16 /* type2 */)) {
	case TCL_NUMBER_LONG:
		goto __28
	case TCL_NUMBER_DOUBLE:
		goto __29
	case TCL_NUMBER_BIG:
		goto __30
	}
	goto __27
__28:
	compare = XTclBN_mp_cmp_d(tls, bp+64, uint32(0))
	XTclBN_mp_clear(tls, bp+64)
	return compare
__29:
	d2 = *(*float64)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(bp + 24))))
	if !(d2 > 1.79769313486231570814527423731704357e+308 || d2 < -1.79769313486231570814527423731704357e+308) {
		goto __31
	}
	if d2 > 0.0 {
		compare = -1
	} else {
		compare = MP_GT
	}
	XTclBN_mp_clear(tls, bp+64)
	return compare
__31:
	;
	if !(d2 < float64(0x7fffffffffffffff) && d2 > float64(-0x7fffffffffffffff-1)) {
		goto __32
	}
	compare = XTclBN_mp_cmp_d(tls, bp+64, uint32(0))
	XTclBN_mp_clear(tls, bp+64)
	return compare
__32:
	;
	if !(uint64(53) > uint64(8)*uint64(unsafe.Sizeof(int64(0))) &&
		libc.Xmodf(tls, d2, bp+32) != 0.0) {
		goto __33
	}
	d1 = XTclBignumToDouble(tls, bp+64)
	XTclBN_mp_clear(tls, bp+64)
	goto doubleCompare
__33:
	;
	XTcl_InitBignumFromDouble(tls, uintptr(0), d2, bp+40)
	goto bigCompare
__30:
	XTcl_TakeBignumFromObj(tls, uintptr(0), value2Ptr, bp+40)
bigCompare:
	compare = XTclBN_mp_cmp(tls, bp+64, bp+40)
	XTclBN_mp_clear(tls, bp+64)
	XTclBN_mp_clear(tls, bp+40)
	return compare
__27:
	;
	goto __1
__5:
	XTcl_Panic(tls, ts+29351, 0)
__1:
	;
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// ValidatePcAndStackTop --
//
//	This procedure is called by TclNRExecuteByteCode when debugging to
//	verify that the program counter and stack top are valid during
//	execution.
//
// Results:
//	None.
//
// Side effects:
//	Prints a message to stderr and panics if either the pc or stack top
//	are invalid.
//
//----------------------------------------------------------------------

//----------------------------------------------------------------------
//
// IllegalExprOperandType --
//
//	Used by TclNRExecuteByteCode to append an error message to the interp
//	result when an illegal operand type is detected by an expression
//	instruction. The argument opndPtr holds the operand object in error.
//
// Results:
//	None.
//
// Side effects:
//	An error message is appended to the interp result.
//
//----------------------------------------------------------------------

func sIllegalExprOperandType(tls *libc.TLS, interp uintptr, pc uintptr, opndPtr uintptr) { /* tclExecute.c:9736:1: */
	bp := tls.Alloc(68)
	defer tls.Free(68)

	// var ptr ClientData at bp+56, 8

	// var type1 int32 at bp+48, 4

	var opcode uint8 = *(*uint8)(unsafe.Pointer(pc))
	var description uintptr
	var op uintptr = ts + 12865 /* "unknown" */

	if int32(opcode) == INST_EXPON {
		op = ts + 5696 /* "**" */
	} else if int32(opcode) <= INST_LNOT {
		op = operatorStrings[int32(opcode)-INST_LOR]
	}

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(opndPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 48)) = TCL_NUMBER_LONG
				*(*ClientData)(unsafe.Pointer(bp + 56)) = opndPtr + 32
				return TCL_OK
			}()
		}
		return func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(opndPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
				return func() int32 {
					if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(opndPtr + 32))) != 0 {
						*(*int32)(unsafe.Pointer(bp + 48)) = TCL_NUMBER_NAN
					} else {
						*(*int32)(unsafe.Pointer(bp + 48)) = TCL_NUMBER_DOUBLE
					}
					*(*ClientData)(unsafe.Pointer(bp + 56)) = opndPtr + 32
					return TCL_OK
				}()
			}
			return func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(opndPtr)).Fbytes != uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(opndPtr)).Flength == 0 {
					return func() int32 { *(*int32)(unsafe.Pointer(bp + 48)) = TCL_NUMBER_LONG; return TCL_ERROR }()
				}
				return XTclGetNumberFromObj(tls, uintptr(0), opndPtr, bp+56, bp+48)
			}()
		}()
	}() != TCL_OK {
		// var numBytes int32 at bp+64, 4

		var bytes uintptr = XTcl_GetStringFromObj(tls, opndPtr, bp+64)

		if *(*int32)(unsafe.Pointer(bp + 64)) == 0 {
			description = ts + 29374 /* "empty string" */
		} else if XTclCheckBadOctal(tls, uintptr(0), bytes) != 0 {
			description = ts + 29387 /* "invalid octal nu..." */
		} else {
			description = ts + 29408 /* "non-numeric stri..." */
		}
	} else if *(*int32)(unsafe.Pointer(bp + 48)) == TCL_NUMBER_NAN {
		description = ts + 29427 /* "non-numeric floa..." */
	} else if *(*int32)(unsafe.Pointer(bp + 48)) == TCL_NUMBER_DOUBLE {
		description = ts + 29460 /* "floating-point v..." */
	} else {
		// TODO: No caller needs this. Eliminate?
		description = ts + 29481 /* "(big) integer" */
	}

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+29495, libc.VaList(bp, description, op)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+8249, ts+8255, description, uintptr(0)))
}

//----------------------------------------------------------------------
//
// TclGetSrcInfoForPc, GetSrcInfoForPc, TclGetSourceFromFrame --
//
//	Given a program counter value, finds the closest command in the
//	bytecode code unit's CmdLocation array and returns information about
//	that command's source: a pointer to its first byte and the number of
//	characters.
//
// Results:
//	If a command is found that encloses the program counter value, a
//	pointer to the command's source is returned and the length of the
//	source is stored at *lengthPtr. If multiple commands resulted in code
//	at pc, information about the closest enclosing command is returned. If
//	no matching command is found, NULL is returned and *lengthPtr is
//	unchanged.
//
// Side effects:
//	The CmdFrame at *cfPtr is updated.
//
//----------------------------------------------------------------------

func XTclGetSourceFromFrame(tls *libc.TLS, cfPtr uintptr, objc int32, objv uintptr) uintptr { /* tclExecute.c:9804:9: */
	if cfPtr == uintptr(0) {
		return XTcl_NewListObj(tls, objc, objv)
	}
	if (*CmdFrame)(unsafe.Pointer(cfPtr)).FcmdObj == uintptr(0) {
		if (*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd == uintptr(0) {
			var codePtr uintptr = *(*uintptr)(unsafe.Pointer(cfPtr + 40))

			(*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd = sGetSrcInfoForPc(tls, *(*uintptr)(unsafe.Pointer(cfPtr + 40 + 8 /* &.pc */)), codePtr, cfPtr+72, uintptr(0), uintptr(0))
		}
		if (*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd != 0 {
			(*CmdFrame)(unsafe.Pointer(cfPtr)).FcmdObj = XTcl_NewStringObj(tls, (*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd, (*CmdFrame)(unsafe.Pointer(cfPtr)).Flen)
		} else {
			(*CmdFrame)(unsafe.Pointer(cfPtr)).FcmdObj = XTcl_NewListObj(tls, objc, objv)
		}
		(*Tcl_Obj)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(cfPtr)).FcmdObj)).FrefCount++
	}
	return (*CmdFrame)(unsafe.Pointer(cfPtr)).FcmdObj
}

func XTclGetSrcInfoForPc(tls *libc.TLS, cfPtr uintptr) { /* tclExecute.c:9831:1: */
	var codePtr uintptr = *(*uintptr)(unsafe.Pointer(cfPtr + 40))

	if (*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd == uintptr(0) {

		(*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd = sGetSrcInfoForPc(tls,
			*(*uintptr)(unsafe.Pointer(cfPtr + 40 + 8 /* &.pc */)), codePtr,
			cfPtr+72, uintptr(0), uintptr(0))
	}

	if (*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd != uintptr(0) {
		// We now have the command. We can get the srcOffset back and from
		// there find the list of word locations for this command.

		var eclPtr uintptr
		var locPtr uintptr = uintptr(0)
		var srcOffset int32
		var i int32
		var iPtr uintptr = *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle))
		var hePtr uintptr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlineBCPtr, codePtr)

		if !(hePtr != 0) {
			return
		}

		srcOffset = int32((int64((*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd) - int64((*ByteCode)(unsafe.Pointer(codePtr)).Fsource)) / 1)
		eclPtr = (*Tcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData

		for i = 0; i < (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc; i++ {
			if (*ECL)(unsafe.Pointer((*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc+uintptr(i)*24)).FsrcOffset == srcOffset {
				locPtr = (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(i)*24
				break
			}
		}
		if locPtr == uintptr(0) {
			XTcl_Panic(tls, ts+29527, 0)
		}

		(*CmdFrame)(unsafe.Pointer(cfPtr)).Fline = (*ECL)(unsafe.Pointer(locPtr)).Fline
		(*CmdFrame)(unsafe.Pointer(cfPtr)).Fnline = (*ECL)(unsafe.Pointer(locPtr)).Fnline
		(*CmdFrame)(unsafe.Pointer(cfPtr)).Ftype = (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Ftype

		if (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Ftype == 4 {
			*(*uintptr)(unsafe.Pointer(cfPtr + 40)) = (*ExtCmdLoc)(unsafe.Pointer(eclPtr)).Fpath
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cfPtr + 40)))).FrefCount++
		}

		// Do not set cfPtr->data.eval.path NULL for non-SOURCE. Needed for
		// cfPtr->data.tebc.codePtr.
	}
}

func sGetSrcInfoForPc(tls *libc.TLS, pc uintptr, codePtr uintptr, lengthPtr uintptr, pcBeg uintptr, cmdIdxPtr uintptr) uintptr { /* tclExecute.c:9891:19: */
	var pcOffset int32 = int32((int64(pc) - int64((*ByteCode)(unsafe.Pointer(codePtr)).FcodeStart)) / 1)
	var numCmds int32 = (*ByteCode)(unsafe.Pointer(codePtr)).FnumCommands
	var codeDeltaNext uintptr
	var codeLengthNext uintptr
	var srcDeltaNext uintptr
	var srcLengthNext uintptr
	var codeOffset int32
	var codeLen int32
	var codeEnd int32
	var srcOffset int32
	var srcLen int32
	var delta int32
	var i int32
	var bestDist int32 = 0x7fffffff // Distance of pc to best cmd's start pc.
	var bestSrcOffset int32 = -1    // Initialized to avoid compiler warning.
	var bestSrcLength int32 = -1    // Initialized to avoid compiler warning.
	var bestCmdIdx int32 = -1

	// The pc must point within the bytecode

	// Decode the code and source offset and length for each command. The
	// closest enclosing command is the last one whose code started before
	// pcOffset.

	codeDeltaNext = (*ByteCode)(unsafe.Pointer(codePtr)).FcodeDeltaStart
	codeLengthNext = (*ByteCode)(unsafe.Pointer(codePtr)).FcodeLengthStart
	srcDeltaNext = (*ByteCode)(unsafe.Pointer(codePtr)).FsrcDeltaStart
	srcLengthNext = (*ByteCode)(unsafe.Pointer(codePtr)).FsrcLengthStart
	codeOffset = libc.AssignInt32(&srcOffset, 0)
	for i = 0; i < numCmds; i++ {
		if uint32(*(*uint8)(unsafe.Pointer(codeDeltaNext))) == uint32(0xFF) {
			codeDeltaNext++
			delta = int32(uint32(*(*uint8)(unsafe.Pointer(codeDeltaNext)))<<24) | int32(*(*uint8)(unsafe.Pointer(codeDeltaNext + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(codeDeltaNext + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(codeDeltaNext + uintptr(3))))
			codeDeltaNext += uintptr(4)
		} else {
			delta = int32(*(*int8)(unsafe.Pointer(codeDeltaNext)))
			codeDeltaNext++
		}
		codeOffset = codeOffset + delta

		if uint32(*(*uint8)(unsafe.Pointer(codeLengthNext))) == uint32(0xFF) {
			codeLengthNext++
			codeLen = int32(uint32(*(*uint8)(unsafe.Pointer(codeLengthNext)))<<24) | int32(*(*uint8)(unsafe.Pointer(codeLengthNext + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(codeLengthNext + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(codeLengthNext + uintptr(3))))
			codeLengthNext += uintptr(4)
		} else {
			codeLen = int32(*(*int8)(unsafe.Pointer(codeLengthNext)))
			codeLengthNext++
		}
		codeEnd = codeOffset + codeLen - 1

		if uint32(*(*uint8)(unsafe.Pointer(srcDeltaNext))) == uint32(0xFF) {
			srcDeltaNext++
			delta = int32(uint32(*(*uint8)(unsafe.Pointer(srcDeltaNext)))<<24) | int32(*(*uint8)(unsafe.Pointer(srcDeltaNext + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(srcDeltaNext + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(srcDeltaNext + uintptr(3))))
			srcDeltaNext += uintptr(4)
		} else {
			delta = int32(*(*int8)(unsafe.Pointer(srcDeltaNext)))
			srcDeltaNext++
		}
		srcOffset = srcOffset + delta

		if uint32(*(*uint8)(unsafe.Pointer(srcLengthNext))) == uint32(0xFF) {
			srcLengthNext++
			srcLen = int32(uint32(*(*uint8)(unsafe.Pointer(srcLengthNext)))<<24) | int32(*(*uint8)(unsafe.Pointer(srcLengthNext + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(srcLengthNext + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(srcLengthNext + uintptr(3))))
			srcLengthNext += uintptr(4)
		} else {
			srcLen = int32(*(*int8)(unsafe.Pointer(srcLengthNext)))
			srcLengthNext++
		}

		if codeOffset > pcOffset { // Best cmd already found
			break
		}
		if pcOffset <= codeEnd { // This cmd's code encloses pc
			var dist int32 = pcOffset - codeOffset

			if dist <= bestDist {
				bestDist = dist
				bestSrcOffset = srcOffset
				bestSrcLength = srcLen
				bestCmdIdx = i
			}
		}
	}

	if pcBeg != uintptr(0) {
		var curr uintptr
		var prev uintptr

		// Walk from beginning of command or BC to pc, by complete
		// instructions. Stop when crossing pc; keep previous.

		curr = func() uintptr {
			if bestDist == 0x7fffffff {
				return (*ByteCode)(unsafe.Pointer(codePtr)).FcodeStart
			}
			return pc - uintptr(bestDist)
		}()
		prev = curr
		for curr <= pc {
			prev = curr
			curr += uintptr(XtclInstructionTable[*(*uint8)(unsafe.Pointer(curr))].FnumBytes)
		}
		*(*uintptr)(unsafe.Pointer(pcBeg)) = prev
	}

	if bestDist == 0x7fffffff {
		return uintptr(0)
	}

	if lengthPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(lengthPtr)) = bestSrcLength
	}

	if cmdIdxPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(cmdIdxPtr)) = bestCmdIdx
	}

	return (*ByteCode)(unsafe.Pointer(codePtr)).Fsource + uintptr(bestSrcOffset)
}

//----------------------------------------------------------------------
//
// GetExceptRangeForPc --
//
//	Given a program counter value, return the closest enclosing
//	ExceptionRange.
//
// Results:
//	If the searchMode is TCL_ERROR, this procedure ignores loop exception
//	ranges and returns a pointer to the closest catch range. If the
//	searchMode is TCL_BREAK, this procedure returns a pointer to the most
//	closely enclosing ExceptionRange regardless of whether it is a loop or
//	catch exception range. If the searchMode is TCL_CONTINUE, this
//	procedure returns a pointer to the most closely enclosing
//	ExceptionRange (of any type) skipping only loop exception ranges if
//	they don't have a sensible continueOffset defined. If no matching
//	ExceptionRange is found that encloses pc, a NULL is returned.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sGetExceptRangeForPc(tls *libc.TLS, pc uintptr, searchMode int32, codePtr uintptr) uintptr { /* tclExecute.c:10045:23: */
	var rangeArrayPtr uintptr
	var numRanges int32 = (*ByteCode)(unsafe.Pointer(codePtr)).FnumExceptRanges
	var rangePtr uintptr
	var pcOffset int32 = int32((int64(pc) - int64((*ByteCode)(unsafe.Pointer(codePtr)).FcodeStart)) / 1)
	var start int32

	if numRanges == 0 {
		return uintptr(0)
	}

	// This exploits peculiarities of our compiler: nested ranges are always
	// *after* their containing ranges, so that by scanning backwards we are
	// sure that the first matching range is indeed the deepest.

	rangeArrayPtr = (*ByteCode)(unsafe.Pointer(codePtr)).FexceptArrayPtr
	rangePtr = rangeArrayPtr + uintptr(numRanges)*28
	for libc.PreDecUintptr(&rangePtr, 28) >= rangeArrayPtr {
		start = (*ExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset
		if start <= pcOffset && pcOffset < start+(*ExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes {
			if (*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype == CATCH_EXCEPTION_RANGE {
				return rangePtr
			}
			if searchMode == TCL_BREAK {
				return rangePtr
			}
			if searchMode == TCL_CONTINUE && (*ExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset != -1 {
				return rangePtr
			}
		}
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// GetOpcodeName --
//
//	This procedure is called by the TRACE and TRACE_WITH_OBJ macros used
//	in TclNRExecuteByteCode when debugging. It returns the name of the
//	bytecode instruction at a specified instruction pc.
//
// Results:
//	A character string for the instruction.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

//----------------------------------------------------------------------
//
// TclExprFloatError --
//
//	This procedure is called when an error occurs during a floating-point
//	operation. It reads errno and sets interp->objResultPtr accordingly.
//
// Results:
//	interp->objResultPtr is set to hold an error message.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclExprFloatError(tls *libc.TLS, interp uintptr, value float64) { /* tclExecute.c:10144:1: */
	bp := tls.Alloc(136)
	defer tls.Free(136)

	var s uintptr

	if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EDOM || libc.X__builtin_isnan(tls, value) != 0 {
		s = ts + 8262 /* "domain error: ar..." */
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, s, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+8249, ts+8255, s, uintptr(0)))
	} else if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ERANGE || (value > 1.79769313486231570814527423731704357e+308 || value < -1.79769313486231570814527423731704357e+308) {
		if value == 0.0 {
			s = ts + 29545 /* "floating-point v..." */
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, s, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+8249, ts+29589, s, uintptr(0)))
		} else {
			s = ts + 29599 /* "floating-point v..." */
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, s, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+8249, ts+29643, s, uintptr(0)))
		}
	} else {
		var objPtr uintptr = XTcl_ObjPrintf(tls,
			ts+29652, libc.VaList(bp+96, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))))

		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+104, ts+8249, ts+14203,
			XTcl_GetString(tls, objPtr), uintptr(0)))
		XTcl_SetObjResult(tls, interp, objPtr)
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//---------------------------------------------------------------------------
//
// TclFileRenameCmd
//
//	This function implements the "rename" subcommand of the "file"
//	command. Filename arguments need to be translated to native format
//	before being passed to platform-specific code that implements rename
//	functionality.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//---------------------------------------------------------------------------

func XTclFileRenameCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclFCmd.c:49:1: */
	return sFileCopyRename(tls, interp, objc, objv, 0)
}

//---------------------------------------------------------------------------
//
// TclFileCopyCmd
//
//	This function implements the "copy" subcommand of the "file" command.
//	Filename arguments need to be translated to native format before being
//	passed to platform-specific code that implements copy functionality.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//---------------------------------------------------------------------------

func XTclFileCopyCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclFCmd.c:78:1: */
	return sFileCopyRename(tls, interp, objc, objv, 1)
}

//---------------------------------------------------------------------------
//
// FileCopyRename --
//
//	Performs the work of TclFileRenameCmd and TclFileCopyCmd. See
//	comments for those functions.
//
// Results:
//	See above.
//
// Side effects:
//	See above.
//
//---------------------------------------------------------------------------

func sFileCopyRename(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, copyFlag int32) int32 { /* tclFCmd.c:106:1: */
	bp := tls.Alloc(184)
	defer tls.Free(184)

	var i int32
	var result int32
	// var force int32 at bp+16, 4

	// var statBuf Tcl_StatBuf at bp+24, 144

	var target uintptr

	i = sFileForceOption(tls, interp, objc-1, objv+uintptr(1)*8, bp+16)
	if i < 0 {
		return TCL_ERROR
	}
	i++
	if objc-i < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv,
			ts+29693)
		return TCL_ERROR
	}

	// If target doesn't exist or isn't a directory, try the copy/rename. More
	// than 2 arguments is only valid if the target is an existing directory.

	target = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))
	if XTcl_FSConvertToPathType(tls, interp, target) != TCL_OK {
		return TCL_ERROR
	}

	result = TCL_OK

	// Call Tcl_FSStat() so that if target is a symlink that points to a
	// directory we will put the sources in that directory instead of
	// overwriting the symlink.

	if XTcl_FSStat(tls, target, bp+24) != 0 || !((*Tcl_StatBuf)(unsafe.Pointer(bp+24)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000)) {
		if objc-i > 2 {
			*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = ENOTDIR
			XTcl_PosixError(tls, interp)
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+29740,
				libc.VaList(bp, func() uintptr {
					if copyFlag != 0 {
						return ts + 29781 /* "copying" */
					}
					return ts + 29789 /* "renaming" */
				}(), func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(target)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(target)).Fbytes
					}
					return XTcl_GetString(tls, target)
				}())))
			result = TCL_ERROR
		} else {
			// Even though already have target == translated(objv[i+1]), pass
			// the original argument down, so if there's an error, the error
			// message will reflect the original arguments.

			result = sCopyRenameOneFile(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), copyFlag,
				*(*int32)(unsafe.Pointer(bp + 16 /* force */)))
		}
		return result
	}

	// Move each source file into target directory. Extract the basename from
	// each source, and append it to the end of the target path.

	for ; i < objc-1; i++ {
		// var jargv [2]uintptr at bp+168, 16

		var source uintptr
		var newFileName uintptr

		source = sFileBasename(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		if source == uintptr(0) {
			result = TCL_ERROR
			break
		}
		*(*uintptr)(unsafe.Pointer(bp + 168)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))
		*(*uintptr)(unsafe.Pointer(bp + 168 + 1*8)) = source
		newFileName = XTclJoinPath(tls, 2, bp+168, 1)
		(*Tcl_Obj)(unsafe.Pointer(newFileName)).FrefCount++
		result = sCopyRenameOneFile(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), newFileName, copyFlag,
			*(*int32)(unsafe.Pointer(bp + 16 /* force */)))
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = newFileName
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = source
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}

		if result == TCL_ERROR {
			break
		}
	}
	return result
}

//---------------------------------------------------------------------------
//
// TclFileMakeDirsCmd
//
//	This function implements the "mkdir" subcommand of the "file" command.
//	Filename arguments need to be translated to native format before being
//	passed to platform-specific code that implements mkdir functionality.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTclFileMakeDirsCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclFCmd.c:216:1: */
	bp := tls.Alloc(168)
	defer tls.Free(168)

	var errfile uintptr
	var result int32
	var i int32
	var j int32
	// var pobjc int32 at bp+16, 4

	var split uintptr
	var target uintptr
	// var statBuf Tcl_StatBuf at bp+24, 144

	var _objPtr uintptr
	var errCount int32
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var _objPtr3 uintptr
	errfile = uintptr(0)
	split = uintptr(0)
	target = uintptr(0)

	result = TCL_OK
	i = 1
__1:
	if !(i < objc) {
		goto __3
	}
	if !(XTcl_FSConvertToPathType(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) != TCL_OK) {
		goto __4
	}
	result = TCL_ERROR
	goto __3
__4:
	;

	split = XTcl_FSSplitPath(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+16)
	(*Tcl_Obj)(unsafe.Pointer(split)).FrefCount++
	if !(*(*int32)(unsafe.Pointer(bp + 16)) == 0) {
		goto __5
	}
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = ENOENT
	errfile = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	goto __3
__5:
	;
	j = 0
__6:
	if !(j < *(*int32)(unsafe.Pointer(bp + 16))) {
		goto __8
	}
	errCount = 2

	target = XTcl_FSJoinPath(tls, split, j+1)
	(*Tcl_Obj)(unsafe.Pointer(target)).FrefCount++

createDir:

	// Call Tcl_FSStat() so that if target is a symlink that points to
	// a directory we will create subdirectories in that directory.

	if !(XTcl_FSStat(tls, target, bp+24) == 0) {
		goto __9
	}
	if !!((*Tcl_StatBuf)(unsafe.Pointer(bp+24)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000)) {
		goto __11
	}
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EEXIST
	errfile = target
	goto done
__11:
	;
	goto __10
__9:
	if !(*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != ENOENT) {
		goto __12
	}
	// If Tcl_FSStat() failed and the error is anything other than
	// non-existence of the target, throw the error.

	errfile = target
	goto done
	goto __13
__12:
	if !(XTcl_FSCreateDirectory(tls, target) != TCL_OK) {
		goto __14
	}
	// Create might have failed because of being in a race
	// condition with another process trying to create the same
	// subdirectory.

	if !(*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EEXIST) {
		goto __15
	}
	// Be aware other workers could delete it immediately after
	// creation, so give this worker still one chance (repeat once),
	// see [270f78ca95] for description of the race-condition.
	// Don't repeat the create always (to avoid endless loop).
	if !(libc.PreDecInt32(&errCount, 1) > 0) {
		goto __16
	}
	goto createDir
__16:
	;
	// Already tried, with delete in-between directly after
	// creation, so just continue (assume created successful).
	goto nextPart
__15:
	;

	// return with error
	errfile = target
	goto done
__14:
	;
__13:
	;
__10:
	;

nextPart:
	// Forget about this sub-path.

__17:
	_objPtr = target
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __20
	}
	XTclFreeObj(tls, _objPtr)
__20:
	;
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
	target = uintptr(0)
	goto __7
__7:
	j++
	goto __6
	goto __8
__8:
	;
__21:
	_objPtr1 = split
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __24
	}
	XTclFreeObj(tls, _objPtr1)
__24:
	;
	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
	split = uintptr(0)
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;

done:
	if !(errfile != uintptr(0)) {
		goto __25
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+29798,
		libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(errfile)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(errfile)).Fbytes
			}
			return XTcl_GetString(tls, errfile)
		}(), XTcl_PosixError(tls, interp))))
	result = TCL_ERROR
__25:
	;
	if !(split != uintptr(0)) {
		goto __26
	}
__27:
	_objPtr2 = split
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __30
	}
	XTclFreeObj(tls, _objPtr2)
__30:
	;
	goto __28
__28:
	if 0 != 0 {
		goto __27
	}
	goto __29
__29:
	;
__26:
	;
	if !(target != uintptr(0)) {
		goto __31
	}
__32:
	_objPtr3 = target
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __35
	}
	XTclFreeObj(tls, _objPtr3)
__35:
	;
	goto __33
__33:
	if 0 != 0 {
		goto __32
	}
	goto __34
__34:
	;
__31:
	;
	return result
}

//----------------------------------------------------------------------
//
// TclFileDeleteCmd
//
//	This function implements the "delete" subcommand of the "file"
//	command.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTclFileDeleteCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclFCmd.c:340:1: */
	bp := tls.Alloc(192)
	defer tls.Free(192)

	var i int32
	// var force int32 at bp+32, 4

	var result int32
	var errfile uintptr
	// var errorBuffer uintptr at bp+184, 8

	// var statBuf Tcl_StatBuf at bp+40, 144

	var _objPtr uintptr
	*(*uintptr)(unsafe.Pointer(bp + 184 /* errorBuffer */)) = uintptr(0)

	i = sFileForceOption(tls, interp, objc-1, objv+uintptr(1)*8, bp+32)
	if !(i < 0) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	errfile = uintptr(0)
	result = TCL_OK

	i++
__2:
	if !(i < objc) {
		goto __4
	}

	errfile = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	if !(XTcl_FSConvertToPathType(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) != TCL_OK) {
		goto __5
	}
	result = TCL_ERROR
	goto done
__5:
	;

	// Call lstat() to get info so can delete symbolic link itself.

	if !(XTcl_FSLstat(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+40) != 0) {
		goto __6
	}
	result = TCL_ERROR
	goto __7
__6:
	if !((*Tcl_StatBuf)(unsafe.Pointer(bp+40)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000)) {
		goto __8
	}
	// We own a reference count on errorBuffer, if it was set as a
	// result of this call.

	result = XTcl_FSRemoveDirectory(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), *(*int32)(unsafe.Pointer(bp + 32 /* force */)), bp+184)
	if !(result != TCL_OK) {
		goto __10
	}
	if !(*(*int32)(unsafe.Pointer(bp + 32)) == 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EEXIST) {
		goto __11
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+29830,
		libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		}())))
	XTcl_PosixError(tls, interp)
	goto done
__11:
	;

	// If possible, use the untranslated name for the file.

	errfile = *(*uintptr)(unsafe.Pointer(bp + 184 /* errorBuffer */))

	// FS supposed to check between translated objv and errfile.

	if !(XTcl_FSEqualPaths(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), errfile) != 0) {
		goto __12
	}
	errfile = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
__12:
	;
__10:
	;
	goto __9
__8:
	result = XTcl_FSDeleteFile(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
__9:
	;
__7:
	;

	if !(result != TCL_OK) {
		goto __13
	}

	// Avoid possible race condition (file/directory deleted after call
	// of lstat), so bypass ENOENT because not an error, just a no-op
	if !(*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ENOENT) {
		goto __14
	}
	result = TCL_OK
	goto __3
__14:
	;
	// It is important that we break on error, otherwise we might end
	// up owning reference counts on numerous errorBuffers.
	result = TCL_ERROR
	goto __4
__13:
	;
	goto __3
__3:
	i++
	goto __2
	goto __4
__4:
	;
	if !(result != TCL_OK) {
		goto __15
	}
	if !(errfile == uintptr(0)) {
		goto __16
	}
	// We try to accomodate poor error results from our Tcl_FS calls.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+29871,
		libc.VaList(bp+8, XTcl_PosixError(tls, interp))))
	goto __17
__16:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+29903,
		libc.VaList(bp+16, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(errfile)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(errfile)).Fbytes
			}
			return XTcl_GetString(tls, errfile)
		}(), XTcl_PosixError(tls, interp))))
__17:
	;
__15:
	;

done:
	if !(*(*uintptr)(unsafe.Pointer(bp + 184)) != uintptr(0)) {
		goto __18
	}
__19:
	_objPtr = *(*uintptr)(unsafe.Pointer(bp + 184))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __22
	}
	XTclFreeObj(tls, _objPtr)
__22:
	;
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
__18:
	;
	return result
}

//---------------------------------------------------------------------------
//
// CopyRenameOneFile
//
//	Copies or renames specified source file or directory hierarchy to the
//	specified target.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Target is overwritten if the force flag is set. Attempting to
//	copy/rename a file onto a directory or a directory onto a file will
//	always result in an error.
//
//----------------------------------------------------------------------

func sCopyRenameOneFile(tls *libc.TLS, interp uintptr, source uintptr, target uintptr, copyFlag int32, force int32) int32 { /* tclFCmd.c:468:1: */
	bp := tls.Alloc(408)
	defer tls.Free(408)

	var result int32
	var errfile uintptr
	// var errorBuffer uintptr at bp+400, 8

	var actualSource uintptr // If source is a link, then this is the real
	// file/directory.
	// var sourceStatBuf Tcl_StatBuf at bp+104, 144

	// var targetStatBuf Tcl_StatBuf at bp+248, 144

	var cachePtr uintptr
	var _objPtr uintptr
	var perm uintptr
	// var index int32 at bp+392, 4

	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var _objPtr1 uintptr
	// The copy failed because we're trying to do a
	// cross-filesystem copy. We do this through our Tcl library.

	var copyCommand uintptr
	var cmdObj uintptr
	var opObj uintptr
	var errorMsg uintptr
	var _objPtr2 uintptr
	var _objPtr3 uintptr
	actualSource = uintptr(0)

	if !(XTcl_FSConvertToPathType(tls, interp, source) != TCL_OK) {
		goto __1
	}
	return TCL_ERROR
__1:
	;
	if !(XTcl_FSConvertToPathType(tls, interp, target) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	errfile = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 400 /* errorBuffer */)) = uintptr(0)
	result = TCL_ERROR

	// We want to copy/rename links and not the files they point to, so we use
	// lstat(). If target is a link, we also want to replace the link and not
	// the file it points to, so we also use lstat() on the target.

	if !(XTcl_FSLstat(tls, source, bp+104) != 0) {
		goto __3
	}
	errfile = source
	goto done
__3:
	;
	if !(XTcl_FSLstat(tls, target, bp+248) != 0) {
		goto __4
	}
	if !(*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != ENOENT) {
		goto __6
	}
	errfile = target
	goto done
__6:
	;
	goto __5
__4:
	if !(force == 0) {
		goto __7
	}
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EEXIST
	errfile = target
	goto done
__7:
	;

	// Prevent copying or renaming a file onto itself. On Windows since
	// 8.5 we do get an inode number, however the unsigned short field is
	// insufficient to accept the Win32 API file id so it is truncated to
	// 16 bits and we get collisions. See bug #2015723.

	if !((*Tcl_StatBuf)(unsafe.Pointer(bp+104)).Fst_ino != uint64(0) && (*Tcl_StatBuf)(unsafe.Pointer(bp+248)).Fst_ino != uint64(0)) {
		goto __8
	}
	if !((*Tcl_StatBuf)(unsafe.Pointer(bp+104)).Fst_ino == (*Tcl_StatBuf)(unsafe.Pointer(bp+248)).Fst_ino && (*Tcl_StatBuf)(unsafe.Pointer(bp+104)).Fst_dev == (*Tcl_StatBuf)(unsafe.Pointer(bp+248)).Fst_dev) {
		goto __9
	}
	result = TCL_OK
	goto done
__9:
	;
__8:
	;

	// Prevent copying/renaming a file onto a directory and vice-versa.
	// This is a policy decision based on the fact that existing
	// implementations of copy and rename on all platforms also prevent
	// this.

	if !((*Tcl_StatBuf)(unsafe.Pointer(bp+104)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000) &&
		!((*Tcl_StatBuf)(unsafe.Pointer(bp+248)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000))) {
		goto __10
	}
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EISDIR
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+29927,
		libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(target)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(target)).Fbytes
			}
			return XTcl_GetString(tls, target)
		}(), func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(source)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(source)).Fbytes
			}
			return XTcl_GetString(tls, source)
		}())))
	goto done
__10:
	;
	if !(!((*Tcl_StatBuf)(unsafe.Pointer(bp+104)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000)) &&
		(*Tcl_StatBuf)(unsafe.Pointer(bp+248)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000)) {
		goto __11
	}
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EISDIR
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+29973,
		libc.VaList(bp+16, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(target)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(target)).Fbytes
			}
			return XTcl_GetString(tls, target)
		}(), func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(source)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(source)).Fbytes
			}
			return XTcl_GetString(tls, source)
		}())))
	goto done
__11:
	;

	/*
	 * The destination exists, but appears to be ok to over-write, and
	 * -force is given. We now try to adjust permissions to ensure the
	 * operation succeeds. If we can't adjust permissions, we'll let the
	 * actual copy/rename return an error later.
	 */

__12:
	;
__15:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __18
	}
	perm = XTclThreadAllocObj(tls)
	goto __19
__18:
	perm = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(perm + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__19:
	;
	goto __16
__16:
	if 0 != 0 {
		goto __15
	}
	goto __17
__17:
	;
	(*Tcl_Obj)(unsafe.Pointer(perm)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0) {
		goto __20
	}
	(*Tcl_Obj)(unsafe.Pointer(perm)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(perm)).Flength = 0
	goto __21
__20:
	(*Tcl_Obj)(unsafe.Pointer(perm)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(perm)).Fbytes, ts+30019, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(perm)).Fbytes + 3)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(perm)).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
__21:
	;
	(*Tcl_Obj)(unsafe.Pointer(perm)).FtypePtr = uintptr(0)

	goto __13
__13:
	if 0 != 0 {
		goto __12
	}
	goto __14
__14:
	;
	(*Tcl_Obj)(unsafe.Pointer(perm)).FrefCount++
	if !(XTclFSFileAttrIndex(tls, target, ts+30023, bp+392) == TCL_OK) {
		goto __22
	}
	XTcl_FSFileAttrsSet(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp + 392 /* index */)), target, perm)
__22:
	;
__23:
	_objPtr = perm
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __26
	}
	XTclFreeObj(tls, _objPtr)
__26:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;

__5:
	;

	if !(copyFlag == 0) {
		goto __27
	}
	result = XTcl_FSRenameFile(tls, source, target)
	if !(result == TCL_OK) {
		goto __28
	}
	goto done
__28:
	;

	if !(*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EINVAL) {
		goto __29
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+30036,
		libc.VaList(bp+32, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(source)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(source)).Fbytes
			}
			return XTcl_GetString(tls, source)
		}(), func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(target)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(target)).Fbytes
			}
			return XTcl_GetString(tls, target)
		}())))
	goto done
	goto __30
__29:
	if !(*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != EXDEV) {
		goto __31
	}
	errfile = target
	goto done
__31:
	;
__30:
	;

	// The rename failed because the move was across file systems. Fall
	// through to copy file and then remove original. Note that the
	// low-level Tcl_FSRenameFileProc in the filesystem is allowed to
	// implement cross-filesystem moves itself, if it desires.
__27:
	;

	actualSource = source
	(*Tcl_Obj)(unsafe.Pointer(actualSource)).FrefCount++

	// Activate the following block to copy files instead of links. However
	// Tcl's semantics currently say we should copy links, so any such change
	// should be the subject of careful study on the consequences.
	//
	// Perhaps there could be an optional flag to 'file copy' to dictate which
	// approach to use, with the default being _not_ to have this block
	// active.

	if !((*Tcl_StatBuf)(unsafe.Pointer(bp+104)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000)) {
		goto __32
	}
	result = XTcl_FSCopyDirectory(tls, actualSource, target, bp+400)
	if !(result != TCL_OK) {
		goto __34
	}
	if !(*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EXDEV) {
		goto __35
	}

__37:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __40
	}
	copyCommand = XTclThreadAllocObj(tls)
	goto __41
__40:
	copyCommand = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(copyCommand + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__41:
	;
	goto __38
__38:
	if 0 != 0 {
		goto __37
	}
	goto __39
__39:
	;
	(*Tcl_Obj)(unsafe.Pointer(copyCommand)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(copyCommand)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(copyCommand)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(copyCommand)).FtypePtr = uintptr(0)

__42:
	;
__45:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __48
	}
	cmdObj = XTclThreadAllocObj(tls)
	goto __49
__48:
	cmdObj = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(cmdObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__49:
	;
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
	(*Tcl_Obj)(unsafe.Pointer(cmdObj)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([21]int8{}))-uint64(1)) == 0) {
		goto __50
	}
	(*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(cmdObj)).Flength = 0
	goto __51
__50:
	(*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([21]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes, ts+30123, uint64(int32(uint64(unsafe.Sizeof([21]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes + 20)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(cmdObj)).Flength = int32(uint64(unsafe.Sizeof([21]int8{})) - uint64(1))
__51:
	;
	(*Tcl_Obj)(unsafe.Pointer(cmdObj)).FtypePtr = uintptr(0)

	goto __43
__43:
	if 0 != 0 {
		goto __42
	}
	goto __44
__44:
	;
	XTcl_ListObjAppendElement(tls, interp, copyCommand, cmdObj)
	if !(copyFlag != 0) {
		goto __52
	}
__54:
	;
__57:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __60
	}
	opObj = XTclThreadAllocObj(tls)
	goto __61
__60:
	opObj = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__61:
	;
	goto __58
__58:
	if 0 != 0 {
		goto __57
	}
	goto __59
__59:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)) == 0) {
		goto __62
	}
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
	goto __63
__62:
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+29781, uint64(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 7)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([8]int8{})) - uint64(1))
__63:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)

	goto __55
__55:
	if 0 != 0 {
		goto __54
	}
	goto __56
__56:
	;
	goto __53
__52:
__64:
	;
__67:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0
	}()) {
		goto __70
	}
	opObj = XTclThreadAllocObj(tls)
	goto __71
__70:
	opObj = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects--
__71:
	;
	goto __68
__68:
	if 0 != 0 {
		goto __67
	}
	goto __69
__69:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1)) == 0) {
		goto __72
	}
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
	goto __73
__72:
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+29789, uint64(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 8)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([9]int8{})) - uint64(1))
__73:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)

	goto __65
__65:
	if 0 != 0 {
		goto __64
	}
	goto __66
__66:
	;
__53:
	;
	XTcl_ListObjAppendElement(tls, interp, copyCommand, opObj)
	XTcl_ListObjAppendElement(tls, interp, copyCommand, source)
	XTcl_ListObjAppendElement(tls, interp, copyCommand, target)
	(*Tcl_Obj)(unsafe.Pointer(copyCommand)).FrefCount++
	result = XTcl_EvalObjEx(tls, interp, copyCommand,
		TCL_EVAL_GLOBAL|TCL_EVAL_DIRECT)
__74:
	_objPtr1 = copyCommand
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __77
	}
	XTclFreeObj(tls, _objPtr1)
__77:
	;
	goto __75
__75:
	if 0 != 0 {
		goto __74
	}
	goto __76
__76:
	;
	if !(result != TCL_OK) {
		goto __78
	}
	// There was an error in the Tcl-level copy. We will pass
	// on the Tcl error message and can ensure this by setting
	// errfile to NULL

	errfile = uintptr(0)
__78:
	;
	goto __36
__35:
	errfile = *(*uintptr)(unsafe.Pointer(bp + 400 /* errorBuffer */))
	if !(XTcl_FSEqualPaths(tls, errfile, source) != 0) {
		goto __79
	}
	errfile = source
	goto __80
__79:
	if !(XTcl_FSEqualPaths(tls, errfile, target) != 0) {
		goto __81
	}
	errfile = target
__81:
	;
__80:
	;
__36:
	;
__34:
	;
	goto __33
__32:
	result = XTcl_FSCopyFile(tls, actualSource, target)
	if !(result != TCL_OK && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EXDEV) {
		goto __82
	}
	result = XTclCrossFilesystemCopy(tls, interp, source, target)
__82:
	;
	if !(result != TCL_OK) {
		goto __83
	}
	// We could examine 'errno' to double-check if the problem was
	// with the target, but we checked the source above, so it should
	// be quite clear

	errfile = target
__83:
	;
	// We now need to reset the result, because the above call,
	// may have left set it.  (Ideally we would prefer not to pass
	// an interpreter in above, but the channel IO code used by
	// TclCrossFilesystemCopy currently requires one)
	XTcl_ResetResult(tls, interp)
__33:
	;
	if !(copyFlag == 0 && result == TCL_OK) {
		goto __84
	}
	if !((*Tcl_StatBuf)(unsafe.Pointer(bp+104)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000)) {
		goto __85
	}
	result = XTcl_FSRemoveDirectory(tls, source, 1, bp+400)
	if !(result != TCL_OK) {
		goto __87
	}
	errfile = *(*uintptr)(unsafe.Pointer(bp + 400 /* errorBuffer */))
	if !(XTcl_FSEqualPaths(tls, errfile, source) == 0) {
		goto __88
	}
	errfile = source
__88:
	;
__87:
	;
	goto __86
__85:
	result = XTcl_FSDeleteFile(tls, source)
	if !(result != TCL_OK) {
		goto __89
	}
	errfile = source
__89:
	;
__86:
	;
	if !(result != TCL_OK) {
		goto __90
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+30144,
		libc.VaList(bp+48, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(errfile)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(errfile)).Fbytes
			}
			return XTcl_GetString(tls, errfile)
		}(), XTcl_PosixError(tls, interp))))
	errfile = uintptr(0)
__90:
	;
__84:
	;

done:
	if !(errfile != uintptr(0)) {
		goto __91
	}
	errorMsg = XTcl_ObjPrintf(tls, ts+30166,
		libc.VaList(bp+64, func() uintptr {
			if copyFlag != 0 {
				return ts + 29781 /* "copying" */
			}
			return ts + 29789 /* "renaming" */
		}(), func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(source)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(source)).Fbytes
			}
			return XTcl_GetString(tls, source)
		}()))

	if !(errfile != source) {
		goto __92
	}
	XTcl_AppendPrintfToObj(tls, errorMsg, ts+30180,
		libc.VaList(bp+80, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(target)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(target)).Fbytes
			}
			return XTcl_GetString(tls, target)
		}()))
	if !(errfile != target) {
		goto __93
	}
	XTcl_AppendPrintfToObj(tls, errorMsg, ts+30189,
		libc.VaList(bp+88, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(errfile)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(errfile)).Fbytes
			}
			return XTcl_GetString(tls, errfile)
		}()))
__93:
	;
__92:
	;
	XTcl_AppendPrintfToObj(tls, errorMsg, ts+30196, libc.VaList(bp+96, XTcl_PosixError(tls, interp)))
	XTcl_SetObjResult(tls, interp, errorMsg)
__91:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 400)) != uintptr(0)) {
		goto __94
	}
__95:
	_objPtr2 = *(*uintptr)(unsafe.Pointer(bp + 400))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __98
	}
	XTclFreeObj(tls, _objPtr2)
__98:
	;
	goto __96
__96:
	if 0 != 0 {
		goto __95
	}
	goto __97
__97:
	;
__94:
	;
	if !(actualSource != uintptr(0)) {
		goto __99
	}
__100:
	_objPtr3 = actualSource
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __103
	}
	XTclFreeObj(tls, _objPtr3)
__103:
	;
	goto __101
__101:
	if 0 != 0 {
		goto __100
	}
	goto __102
__102:
	;
__99:
	;
	return result
}

//---------------------------------------------------------------------------
//
// FileForceOption --
//
//	Helps parse command line options for file commands that take the
//	"-force" and "--" options.
//
// Results:
//	The return value is how many arguments from argv were consumed by this
//	function, or -1 if there was an error parsing the options. If an error
//	occurred, an error message is left in the interp's result.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sFileForceOption(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, forcePtr uintptr) int32 { /* tclFCmd.c:819:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var force int32
	var i int32
	// var idx int32 at bp, 4

	force = 0
	for i = 0; i < objc; i++ {
		if int32(*(*int8)(unsafe.Pointer(func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		}()))) != '-' {
			break
		}
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options7)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp) != TCL_OK {
			return -1
		}
		if *(*int32)(unsafe.Pointer(bp)) == 0 {
			force = 1
		} else { // --
			i++
			break
		}
	}
	*(*int32)(unsafe.Pointer(forcePtr)) = force
	return i
}

var options7 = [3]uintptr{
	ts + 30201, ts + 15828, uintptr(0),
} /* tclFCmd.c:828:23 */

//---------------------------------------------------------------------------
//
// FileBasename --
//
//	Given a path in either tcl format (with / separators), or in the
//	platform-specific format for the current platform, return all the
//	characters in the path after the last directory separator. But, if
//	path is the root directory, returns no characters.
//
// Results:
//	Returns the string object that represents the basename. If there is an
//	error, an error message is left in interp, and NULL is returned.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sFileBasename(tls *libc.TLS, interp uintptr, pathPtr uintptr) uintptr { /* tclFCmd.c:871:16: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var objc int32 at bp, 4

	var splitPtr uintptr
	*(*uintptr)(unsafe.Pointer(bp + 8 /* resultPtr */)) = uintptr(0)

	splitPtr = XTcl_FSSplitPath(tls, pathPtr, bp)
	(*Tcl_Obj)(unsafe.Pointer(splitPtr)).FrefCount++

	if *(*int32)(unsafe.Pointer(bp)) != 0 {
		if *(*int32)(unsafe.Pointer(bp)) == 1 && int32(*(*int8)(unsafe.Pointer(func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
			}
			return XTcl_GetString(tls, pathPtr)
		}()))) == '~' {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = splitPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			if XTcl_FSConvertToPathType(tls, interp, pathPtr) != TCL_OK {
				return uintptr(0)
			}
			splitPtr = XTcl_FSSplitPath(tls, pathPtr, bp)
			(*Tcl_Obj)(unsafe.Pointer(splitPtr)).FrefCount++
		}

		// Return the last component, unless it is the only component, and it
		// is the root of an absolute path.

		if *(*int32)(unsafe.Pointer(bp)) > 0 {
			XTcl_ListObjIndex(tls, uintptr(0), splitPtr, *(*int32)(unsafe.Pointer(bp))-1, bp+8)
			if *(*int32)(unsafe.Pointer(bp)) == 1 && XTcl_FSGetPathType(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) != TCL_PATH_RELATIVE {
				*(*uintptr)(unsafe.Pointer(bp + 8 /* resultPtr */)) = uintptr(0)
			}
		}
	}
	if *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				*(*uintptr)(unsafe.Pointer(bp + 8)) = XTclThreadAllocObj(tls)
			} else {
				*(*uintptr)(unsafe.Pointer(bp + 8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr = uintptr(0)
		{
		}

	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = splitPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return *(*uintptr)(unsafe.Pointer(bp + 8 /* resultPtr */))
}

//----------------------------------------------------------------------
//
// TclFileAttrsCmd --
//
//	Sets or gets the platform-specific attributes of a file. The objc-objv
//	points to the file name with the rest of the command line following.
//	This routine uses platform-specific tables of option strings and
//	callbacks. The callback to get the attributes take three parameters:
//	    Tcl_Interp *interp;	    The interp to report errors with. Since
//				    this is an object-based API, the object
//				    form of the result should be used.
//	    const char *fileName;   This is extracted using
//				    Tcl_TranslateFileName.
//	    TclObj **attrObjPtrPtr; A new object to hold the attribute is
//				    allocated and put here.
//	The first two parameters of the callback used to write out the
//	attributes are the same. The third parameter is:
//	    const *attrObjPtr;	    A pointer to the object that has the new
//				    attribute.
//	They both return standard TCL errors; if the routine to get an
//	attribute fails, no object is allocated and *attrObjPtrPtr is
//	unchanged.
//
// Results:
//	Standard TCL error.
//
// Side effects:
//	May set file attributes for the file name.
//
//----------------------------------------------------------------------

func XTclFileAttrsCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclFCmd.c:948:1: */
	bp := tls.Alloc(212)
	defer tls.Free(212)

	var result int32
	var attributeStrings uintptr
	var attributeStringsAllocated uintptr
	// var objStrings uintptr at bp+160, 8

	// var numObjStrings int32 at bp+168, 4

	var filePtr uintptr
	var index int32
	// var objPtr uintptr at bp+176, 8

	var objPtr1 uintptr
	// var objPtrAttr uintptr at bp+184, 8

	var _objPtr uintptr
	// Get all attributes.

	var index1 int32
	var res int32
	var nbAtts int32
	var listPtr uintptr
	// Get one attribute.

	// var index2 int32 at bp+192, 4

	// var objPtr2 uintptr at bp+200, 8

	// Set option/value pairs.

	var i int32
	// var index3 int32 at bp+208, 4

	var _objPtr1 uintptr
	attributeStringsAllocated = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 160 /* objStrings */)) = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 168 /* numObjStrings */)) = -1

	if !(objc < 2) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+30208)
	return TCL_ERROR
__1:
	;

	filePtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if !(XTcl_FSConvertToPathType(tls, interp, filePtr) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	objc = objc - 2
	objv += 8 * uintptr(2)
	result = TCL_ERROR
	XTcl_SetErrno(tls, 0)

	// Get the set of attribute names from the filesystem.

	attributeStrings = XTcl_FSFileAttrStrings(tls, filePtr, bp+160)
	if !(attributeStrings == uintptr(0)) {
		goto __3
	}

	if !(*(*uintptr)(unsafe.Pointer(bp + 160)) == uintptr(0)) {
		goto __5
	}
	if !(XTcl_GetErrno(tls) != 0) {
		goto __6
	}
	// There was an error, probably that the filePtr is not
	// accepted by any filesystem

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+12748,
		libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(filePtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(filePtr)).Fbytes
			}
			return XTcl_GetString(tls, filePtr)
		}(), XTcl_PosixError(tls, interp))))
__6:
	;
	return TCL_ERROR
__5:
	;

	// We own the object now.

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 160)))).FrefCount++

	// Use objStrings as a list object.

	if !(XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 160)), bp+168) != TCL_OK) {
		goto __7
	}
	goto end
__7:
	;
	attributeStringsAllocated = XTclStackAlloc(tls, interp, int32(uint64(1+*(*int32)(unsafe.Pointer(bp + 168)))*uint64(unsafe.Sizeof(uintptr(0)))))
	index = 0
__8:
	if !(index < *(*int32)(unsafe.Pointer(bp + 168))) {
		goto __10
	}
	XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 160 /* objStrings */)), index, bp+176)
	*(*uintptr)(unsafe.Pointer(attributeStringsAllocated + uintptr(index)*8)) = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 176)))
	}()
	goto __9
__9:
	index++
	goto __8
	goto __10
__10:
	;
	*(*uintptr)(unsafe.Pointer(attributeStringsAllocated + uintptr(index)*8)) = uintptr(0)
	attributeStrings = attributeStringsAllocated
	goto __4
__3:
	if !(*(*uintptr)(unsafe.Pointer(bp + 160)) != uintptr(0)) {
		goto __11
	}
	XTcl_Panic(tls, ts+30233, 0)
__11:
	;
__4:
	;

	// Process the attributes to produce a list of all of them, the value of a
	// particular attribute, or to set one or more attributes (depending on
	// the number of arguments).

	if !(objc == 0) {
		goto __12
	}
	res = TCL_OK
	nbAtts = 0

	listPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	index1 = 0
__14:
	if !(*(*uintptr)(unsafe.Pointer(attributeStrings + uintptr(index1)*8)) != uintptr(0)) {
		goto __16
	}

	if !(res != TCL_OK) {
		goto __17
	}
	// Clear the error from the last iteration.

	XTcl_ResetResult(tls, interp)
__17:
	;

	res = XTcl_FSFileAttrsGet(tls, interp, index1, filePtr, bp+184)
	if !(res == TCL_OK) {
		goto __18
	}
	objPtr1 =
		XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(attributeStrings + uintptr(index1)*8)), -1)

	XTcl_ListObjAppendElement(tls, interp, listPtr, objPtr1)
	XTcl_ListObjAppendElement(tls, interp, listPtr, *(*uintptr)(unsafe.Pointer(bp + 184 /* objPtrAttr */)))
	nbAtts++
__18:
	;
	goto __15
__15:
	index1++
	goto __14
	goto __16
__16:
	;

	if !(index1 > 0 && nbAtts == 0) {
		goto __19
	}
	// Error: no valid attributes found.

__20:
	_objPtr = listPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __23
	}
	XTclFreeObj(tls, _objPtr)
__23:
	;
	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	goto end
__19:
	;

	XTcl_SetObjResult(tls, interp, listPtr)
	goto __13
__12:
	if !(objc == 1) {
		goto __24
	}
	*(*uintptr)(unsafe.Pointer(bp + 200 /* objPtr2 */)) = uintptr(0)

	if !(*(*int32)(unsafe.Pointer(bp + 168)) == 0) {
		goto __26
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+30290, libc.VaList(bp+16, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+3593, ts+7420, ts+30355, ts+8211, uintptr(0)))
	goto end
__26:
	;

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), attributeStrings, int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+192) != TCL_OK) {
		goto __27
	}
	goto end
__27:
	;
	if !(attributeStringsAllocated != uintptr(0)) {
		goto __28
	}
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).FtypePtr != uintptr(0)) {
		goto __29
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __30
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).FtypePtr)).FfreeIntRepProc})).f(tls, *(*uintptr)(unsafe.Pointer(objv)))
__30:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).FtypePtr = uintptr(0)
__29:
	;

__28:
	;
	if !(XTcl_FSFileAttrsGet(tls, interp, *(*int32)(unsafe.Pointer(bp + 192)), filePtr,
		bp+200) != TCL_OK) {
		goto __31
	}
	goto end
__31:
	;
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 200 /* objPtr2 */)))
	goto __25
__24:

	if !(*(*int32)(unsafe.Pointer(bp + 168)) == 0) {
		goto __32
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+30290, libc.VaList(bp+64, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+7420, ts+30355, ts+8211, uintptr(0)))
	goto end
__32:
	;

	i = 0
__33:
	if !(i < objc) {
		goto __35
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), attributeStrings, int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+208) != TCL_OK) {
		goto __36
	}
	goto end
__36:
	;
	if !(attributeStringsAllocated != uintptr(0)) {
		goto __37
	}
	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr != uintptr(0)) {
		goto __38
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __39
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr)).FfreeIntRepProc})).f(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
__39:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr = uintptr(0)
__38:
	;

__37:
	;
	if !(i+1 == objc) {
		goto __40
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+30361, libc.VaList(bp+112, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+120, ts+3593, ts+7420, ts+30355,
		ts+30384, uintptr(0)))
	goto end
__40:
	;
	if !(XTcl_FSFileAttrsSet(tls, interp, *(*int32)(unsafe.Pointer(bp + 208)), filePtr,
		*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))) != TCL_OK) {
		goto __41
	}
	goto end
__41:
	;
	goto __34
__34:
	i = i + 2
	goto __33
	goto __35
__35:
	;
__25:
	;
__13:
	;
	result = TCL_OK

	// Free up the array we allocated and drop our reference to any list of
	// attribute names issued by the filesystem.

end:
	if !(attributeStringsAllocated != uintptr(0)) {
		goto __42
	}
	XTclStackFree(tls, interp, attributeStringsAllocated)
__42:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 160)) != uintptr(0)) {
		goto __43
	}
__44:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 160))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __47
	}
	XTclFreeObj(tls, _objPtr1)
__47:
	;
	goto __45
__45:
	if 0 != 0 {
		goto __44
	}
	goto __46
__46:
	;
__43:
	;
	return result
}

//----------------------------------------------------------------------
//
// TclFileLinkCmd --
//
//	This function is invoked to process the "file link" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May create a new link.
//
//----------------------------------------------------------------------

func XTclFileLinkCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclFCmd.c:1170:1: */
	bp := tls.Alloc(76)
	defer tls.Free(76)

	var contents uintptr
	var index int32

	if objc < 2 || objc > 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+30392)
		return TCL_ERROR
	}

	// Index of the 'source' argument.

	if objc == 4 {
		index = 2
	} else {
		index = 1
	}

	if objc > 2 {
		// var linkAction int32 at bp+72, 4

		if objc == 4 {
			if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&linkTypes)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+72) != TCL_OK {
				return TCL_ERROR
			}
			if *(*int32)(unsafe.Pointer(bp + 72)) == 0 {
				*(*int32)(unsafe.Pointer(bp + 72 /* linkAction */)) = TCL_CREATE_SYMBOLIC_LINK
			} else {
				*(*int32)(unsafe.Pointer(bp + 72 /* linkAction */)) = TCL_CREATE_HARD_LINK
			}
		} else {
			*(*int32)(unsafe.Pointer(bp + 72 /* linkAction */)) = TCL_CREATE_SYMBOLIC_LINK | TCL_CREATE_HARD_LINK
		}
		if XTcl_FSConvertToPathType(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8))) != TCL_OK {
			return TCL_ERROR
		}

		// Create link from source to target.

		contents = XTcl_FSLink(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)), *(*uintptr)(unsafe.Pointer(objv + uintptr(index+1)*8)), *(*int32)(unsafe.Pointer(bp + 72 /* linkAction */)))
		if contents == uintptr(0) {
			// We handle three common error cases specially, and for all other
			// errors, we use the standard posix error message.

			if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EEXIST {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

					ts+30422, libc.VaList(bp, func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))).Fbytes
						}
						return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))
					}())))
				XTcl_PosixError(tls, interp)
			} else if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ENOENT {
				// There are two cases here: either the target doesn't exist,
				// or the directory of the src doesn't exist.

				var access int32
				var dirPtr uintptr = XTclPathPart(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)),
					TCL_PATH_DIRNAME)

				if dirPtr == uintptr(0) {
					return TCL_ERROR
				}
				access = XTcl_FSAccess(tls, dirPtr, F_OK)
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = dirPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				if access != 0 {
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

						ts+30479, libc.VaList(bp+8, func() uintptr {
							if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))).Fbytes != 0 {
								return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))).Fbytes
							}
							return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))
						}())))
					XTcl_PosixError(tls, interp)
				} else {
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

						ts+30537, libc.VaList(bp+16, func() uintptr {
							if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))).Fbytes != 0 {
								return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))).Fbytes
							}
							return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))
						}(),
							func() uintptr {
								if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index+1)*8)))).Fbytes != 0 {
									return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index+1)*8)))).Fbytes
								}
								return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(index+1)*8)))
							}())))
					*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = ENOENT
					XTcl_PosixError(tls, interp)
				}
			} else {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+30595,
					libc.VaList(bp+32, func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))).Fbytes
						}
						return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))
					}(),
						func() uintptr {
							if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index+1)*8)))).Fbytes != 0 {
								return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index+1)*8)))).Fbytes
							}
							return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(index+1)*8)))
						}(), XTcl_PosixError(tls, interp))))
			}
			return TCL_ERROR
		}
	} else {
		if XTcl_FSConvertToPathType(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8))) != TCL_OK {
			return TCL_ERROR
		}

		// Read link

		contents = XTcl_FSLink(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)), uintptr(0), 0)
		if contents == uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+30647,
				libc.VaList(bp+56, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(index)*8)))
				}(), XTcl_PosixError(tls, interp))))
			return TCL_ERROR
		}
	}
	XTcl_SetObjResult(tls, interp, contents)
	if objc == 2 {
		// If we are reading a link, we need to free this result refCount. If
		// we are creating a link, this will just be objv[index+1], and so we
		// don't own it.

		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = contents
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return TCL_OK
}

var linkTypes = [3]uintptr{
	ts + 30676, ts + 30686, uintptr(0),
} /* tclFCmd.c:1202:24 */

//----------------------------------------------------------------------
//
// TclFileReadLinkCmd --
//
//	This function is invoked to process the "file readlink" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFileReadLinkCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclFCmd.c:1321:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var contents uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}

	if XTcl_FSConvertToPathType(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) != TCL_OK {
		return TCL_ERROR
	}

	contents = XTcl_FSLink(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), 0)

	if contents == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+30647,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}(), XTcl_PosixError(tls, interp))))
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, contents)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = contents
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// TclFileTemporaryCmd
//
//	This function implements the "tempfile" subcommand of the "file"
//	command.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Creates a temporary file. Opens a channel to that file and puts the
//	name of that channel in the result. *Might* register suitable exit
//	handlers to ensure that the temporary file gets deleted. Might write
//	to a variable, so reentrancy is a potential issue.
//
//---------------------------------------------------------------------------

func XTclFileTemporaryCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclFCmd.c:1372:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var nameVarObj uintptr // Variable to store the name of the temporary
	// file in.
	var nameObj uintptr   // Object that will contain the filename.
	var chan1 Tcl_Channel // The channel opened (RDWR) on the temporary
	// file, or NULL if there's an error.
	var tempDirObj uintptr
	var tempBaseObj uintptr
	var tempExtObj uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var tailObj uintptr
	// var length int32 at bp+8, 4

	var templateObj uintptr
	var string uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	var cachePtr6 uintptr
	var cachePtr7 uintptr
	var cachePtr8 uintptr
	var cachePtr9 uintptr
	nameVarObj = uintptr(0)
	nameObj = uintptr(0)
	tempDirObj = uintptr(0)
	tempBaseObj = uintptr(0)
	tempExtObj = uintptr(0)
	// Pieces of template. Each piece is NULL if
	// it is omitted. The platform temporary file
	// engine might ignore some pieces.

	if !(objc < 1 || objc > 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+30692)
	return TCL_ERROR
__1:
	;

	if !(objc > 1) {
		goto __2
	}
	nameVarObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
__3:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __6
	}
	nameObj = XTclThreadAllocObj(tls)
	goto __7
__6:
	nameObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(nameObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__7:
	;
	goto __4
__4:
	if 0 != 0 {
		goto __3
	}
	goto __5
__5:
	;
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).FtypePtr = uintptr(0)

__2:
	;
	if !(objc > 2) {
		goto __8
	}
	templateObj = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	string = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(templateObj)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 8)) = (*Tcl_Obj)(unsafe.Pointer(templateObj)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(templateObj)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, templateObj, bp+8)
	}()

	// Treat an empty string as if it wasn't there.

	if !(*(*int32)(unsafe.Pointer(bp + 8)) == 0) {
		goto __9
	}
	goto makeTemporary
__9:
	;

	// The template only gives a directory if there is a directory
	// separator in it.

	if !(libc.Xstrchr(tls, string, '/') != uintptr(0) ||
		XtclPlatform == TCL_PLATFORM_WINDOWS &&
			libc.Xstrchr(tls, string, '\\') != uintptr(0)) {
		goto __10
	}
	tempDirObj = XTclPathPart(tls, interp, templateObj, TCL_PATH_DIRNAME)

	// Only allow creation of temporary files in the native filesystem
	// since they are frequently used for integration with external
	// tools or system libraries. [Bug 2388866]

	if !(tempDirObj != uintptr(0) && XTcl_FSGetFileSystemForPath(tls, tempDirObj) !=
		uintptr(unsafe.Pointer(&XtclNativeFilesystem))) {
		goto __11
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tempDirObj)).FrefCount, 1) > 1) {
		goto __12
	}
	goto __13
__12:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tempDirObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tempDirObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __14
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Fbytes != XtclEmptyStringRep) {
		goto __16
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Fbytes)
__16:
	;
	(*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Flength = -1
__17:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __20
	}
	XTclThreadFreeObj(tls, tempDirObj)
	goto __21
__20:
	*(*uintptr)(unsafe.Pointer(tempDirObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = tempDirObj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__21:
	;
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
	goto __15
__14:
	XTclFreeObj(tls, tempDirObj)
__15:
	;
__13:
	;

	tempDirObj = uintptr(0)
__11:
	;
__10:
	;

	// The template only gives the filename if the last character isn't a
	// directory separator.

	if !(int32(*(*int8)(unsafe.Pointer(string + uintptr(*(*int32)(unsafe.Pointer(bp + 8))-1)))) != '/' && (XtclPlatform != TCL_PLATFORM_WINDOWS ||
		int32(*(*int8)(unsafe.Pointer(string + uintptr(*(*int32)(unsafe.Pointer(bp + 8))-1)))) != '\\')) {
		goto __22
	}
	tailObj = XTclPathPart(tls, interp, templateObj,
		TCL_PATH_TAIL)

	if !(tailObj != uintptr(0)) {
		goto __23
	}
	tempBaseObj = XTclPathPart(tls, interp, tailObj, TCL_PATH_ROOT)
	tempExtObj = XTclPathPart(tls, interp, tailObj, TCL_PATH_EXTENSION)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tailObj)).FrefCount, 1) > 1) {
		goto __24
	}
	goto __25
__24:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tailObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tailObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __26
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tailObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tailObj)).Fbytes != XtclEmptyStringRep) {
		goto __28
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tailObj)).Fbytes)
__28:
	;
	(*Tcl_Obj)(unsafe.Pointer(tailObj)).Flength = -1
__29:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __32
	}
	XTclThreadFreeObj(tls, tailObj)
	goto __33
__32:
	*(*uintptr)(unsafe.Pointer(tailObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = tailObj
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__33:
	;
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
	goto __27
__26:
	XTclFreeObj(tls, tailObj)
__27:
	;
__25:
	;

__23:
	;
__22:
	;
__8:
	;

	// Convert empty parts of the template into unspecified parts.

	if !(tempDirObj != 0 && !(int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Fbytes
		}
		return XTcl_GetString(tls, tempDirObj)
	}()))) != 0)) {
		goto __34
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tempDirObj)).FrefCount, 1) > 1) {
		goto __35
	}
	goto __36
__35:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tempDirObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tempDirObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __37
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Fbytes != XtclEmptyStringRep) {
		goto __39
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Fbytes)
__39:
	;
	(*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Flength = -1
__40:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __43
	}
	XTclThreadFreeObj(tls, tempDirObj)
	goto __44
__43:
	*(*uintptr)(unsafe.Pointer(tempDirObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = tempDirObj
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__44:
	;
	goto __41
__41:
	if 0 != 0 {
		goto __40
	}
	goto __42
__42:
	;
	goto __38
__37:
	XTclFreeObj(tls, tempDirObj)
__38:
	;
__36:
	;

	tempDirObj = uintptr(0)
__34:
	;
	if !(tempBaseObj != 0 && !(int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).Fbytes
		}
		return XTcl_GetString(tls, tempBaseObj)
	}()))) != 0)) {
		goto __45
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).FrefCount, 1) > 1) {
		goto __46
	}
	goto __47
__46:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __48
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).Fbytes != XtclEmptyStringRep) {
		goto __50
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).Fbytes)
__50:
	;
	(*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).Flength = -1
__51:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __54
	}
	XTclThreadFreeObj(tls, tempBaseObj)
	goto __55
__54:
	*(*uintptr)(unsafe.Pointer(tempBaseObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = tempBaseObj
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++
__55:
	;
	goto __52
__52:
	if 0 != 0 {
		goto __51
	}
	goto __53
__53:
	;
	goto __49
__48:
	XTclFreeObj(tls, tempBaseObj)
__49:
	;
__47:
	;

	tempBaseObj = uintptr(0)
__45:
	;
	if !(tempExtObj != 0 && !(int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(tempExtObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(tempExtObj)).Fbytes
		}
		return XTcl_GetString(tls, tempExtObj)
	}()))) != 0)) {
		goto __56
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tempExtObj)).FrefCount, 1) > 1) {
		goto __57
	}
	goto __58
__57:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tempExtObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tempExtObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __59
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tempExtObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tempExtObj)).Fbytes != XtclEmptyStringRep) {
		goto __61
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tempExtObj)).Fbytes)
__61:
	;
	(*Tcl_Obj)(unsafe.Pointer(tempExtObj)).Flength = -1
__62:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __65
	}
	XTclThreadFreeObj(tls, tempExtObj)
	goto __66
__65:
	*(*uintptr)(unsafe.Pointer(tempExtObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = tempExtObj
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++
__66:
	;
	goto __63
__63:
	if 0 != 0 {
		goto __62
	}
	goto __64
__64:
	;
	goto __60
__59:
	XTclFreeObj(tls, tempExtObj)
__60:
	;
__58:
	;

	tempExtObj = uintptr(0)
__56:
	;

	// Create and open the temporary file.

makeTemporary:
	chan1 = XTclpOpenTemporaryFile(tls, tempDirObj, tempBaseObj, tempExtObj, nameObj)

	// If we created pieces of template, get rid of them now.

	if !(tempDirObj != 0) {
		goto __67
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tempDirObj)).FrefCount, 1) > 1) {
		goto __68
	}
	goto __69
__68:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tempDirObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tempDirObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __70
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Fbytes != XtclEmptyStringRep) {
		goto __72
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Fbytes)
__72:
	;
	(*Tcl_Obj)(unsafe.Pointer(tempDirObj)).Flength = -1
__73:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __76
	}
	XTclThreadFreeObj(tls, tempDirObj)
	goto __77
__76:
	*(*uintptr)(unsafe.Pointer(tempDirObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = tempDirObj
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++
__77:
	;
	goto __74
__74:
	if 0 != 0 {
		goto __73
	}
	goto __75
__75:
	;
	goto __71
__70:
	XTclFreeObj(tls, tempDirObj)
__71:
	;
__69:
	;

__67:
	;
	if !(tempBaseObj != 0) {
		goto __78
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).FrefCount, 1) > 1) {
		goto __79
	}
	goto __80
__79:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __81
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).Fbytes != XtclEmptyStringRep) {
		goto __83
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).Fbytes)
__83:
	;
	(*Tcl_Obj)(unsafe.Pointer(tempBaseObj)).Flength = -1
__84:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr7 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __87
	}
	XTclThreadFreeObj(tls, tempBaseObj)
	goto __88
__87:
	*(*uintptr)(unsafe.Pointer(tempBaseObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = tempBaseObj
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++
__88:
	;
	goto __85
__85:
	if 0 != 0 {
		goto __84
	}
	goto __86
__86:
	;
	goto __82
__81:
	XTclFreeObj(tls, tempBaseObj)
__82:
	;
__80:
	;

__78:
	;
	if !(tempExtObj != 0) {
		goto __89
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tempExtObj)).FrefCount, 1) > 1) {
		goto __90
	}
	goto __91
__90:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tempExtObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tempExtObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __92
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tempExtObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tempExtObj)).Fbytes != XtclEmptyStringRep) {
		goto __94
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tempExtObj)).Fbytes)
__94:
	;
	(*Tcl_Obj)(unsafe.Pointer(tempExtObj)).Flength = -1
__95:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr8 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __98
	}
	XTclThreadFreeObj(tls, tempExtObj)
	goto __99
__98:
	*(*uintptr)(unsafe.Pointer(tempExtObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = tempExtObj
	(*AllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects++
__99:
	;
	goto __96
__96:
	if 0 != 0 {
		goto __95
	}
	goto __97
__97:
	;
	goto __93
__92:
	XTclFreeObj(tls, tempExtObj)
__93:
	;
__91:
	;

__89:
	;

	// Deal with results.

	if !(chan1 == uintptr(0)) {
		goto __100
	}
	if !(nameVarObj != 0) {
		goto __101
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(nameObj)).FrefCount, 1) > 1) {
		goto __102
	}
	goto __103
__102:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(nameObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(nameObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __104
	}

	if !((*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes != XtclEmptyStringRep) {
		goto __106
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes)
__106:
	;
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).Flength = -1
__107:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr9 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __110
	}
	XTclThreadFreeObj(tls, nameObj)
	goto __111
__110:
	*(*uintptr)(unsafe.Pointer(nameObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr = nameObj
	(*AllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects++
__111:
	;
	goto __108
__108:
	if 0 != 0 {
		goto __107
	}
	goto __109
__109:
	;
	goto __105
__104:
	XTclFreeObj(tls, nameObj)
__105:
	;
__103:
	;

__101:
	;
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+30713, libc.VaList(bp, XTcl_PosixError(tls, interp))))
	return TCL_ERROR
__100:
	;
	XTcl_RegisterChannel(tls, interp, chan1)
	if !(nameVarObj != uintptr(0)) {
		goto __112
	}
	if !(XTcl_ObjSetVar2(tls, interp, nameVarObj, uintptr(0), nameObj,
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __113
	}
	XTcl_UnregisterChannel(tls, interp, chan1)
	return TCL_ERROR
__113:
	;
__112:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, XTcl_GetChannelName(tls, chan1), -1))
	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The following variable is set in the TclPlatformInit call to one of:
// TCL_PLATFORM_UNIX or TCL_PLATFORM_WINDOWS.

var XtclPlatform TclPlatformType = TCL_PLATFORM_UNIX /* tclFileName.c:23:17 */

// When there is no support for getting the block size of a file in a stat()
// call, use this as a guess. Allow it to be overridden in the platform-
// specific files.

//----------------------------------------------------------------------
//
// SetResultLength --
//
//	Resets the result DString for ExtractWinRoot to accommodate
//	any NT extended path prefixes.
//
// Results:
//	None.
//
// Side effects:
//	May modify the Tcl_DString.
//----------------------------------------------------------------------

func sSetResultLength(tls *libc.TLS, resultPtr uintptr, offset int32, extended int32) { /* tclFileName.c:68:1: */
	XTcl_DStringSetLength(tls, resultPtr, offset)
	if extended == 2 {
		XTcl_DStringAppend(tls, resultPtr, ts+30745, int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1)))
	} else if extended == 1 {
		XTcl_DStringAppend(tls, resultPtr, ts+30754, int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)))
	}
}

//----------------------------------------------------------------------
//
// ExtractWinRoot --
//
//	Matches the root portion of a Windows path and appends it to the
//	specified Tcl_DString.
//
// Results:
//	Returns the position in the path immediately after the root including
//	any trailing slashes. Appends a cleaned up version of the root to the
//	Tcl_DString at the specified offest.
//
// Side effects:
//	Modifies the specified Tcl_DString.
//
//----------------------------------------------------------------------

func sExtractWinRoot(tls *libc.TLS, path uintptr, resultPtr uintptr, offset int32, typePtr uintptr) uintptr { /* tclFileName.c:100:19: */
	var extended int32 = 0

	if (int32(*(*int8)(unsafe.Pointer(path))) == '/' || int32(*(*int8)(unsafe.Pointer(path))) == '\\') &&
		(int32(*(*int8)(unsafe.Pointer(path + 1))) == '/' || int32(*(*int8)(unsafe.Pointer(path + 1))) == '\\') &&
		int32(*(*int8)(unsafe.Pointer(path + 2))) == '?' &&
		(int32(*(*int8)(unsafe.Pointer(path + 3))) == '/' || int32(*(*int8)(unsafe.Pointer(path + 3))) == '\\') {
		extended = 1
		path = path + uintptr(4)
		if int32(*(*int8)(unsafe.Pointer(path))) == 'U' && int32(*(*int8)(unsafe.Pointer(path + 1))) == 'N' && int32(*(*int8)(unsafe.Pointer(path + 2))) == 'C' &&
			(int32(*(*int8)(unsafe.Pointer(path + 3))) == '/' || int32(*(*int8)(unsafe.Pointer(path + 3))) == '\\') {
			extended = 2
			path = path + uintptr(4)
		}
	}

	if int32(*(*int8)(unsafe.Pointer(path))) == '/' || int32(*(*int8)(unsafe.Pointer(path))) == '\\' {
		// Might be a UNC or Vol-Relative path.

		var host uintptr
		var share uintptr
		var tail uintptr
		var hlen int32
		var slen int32

		if int32(*(*int8)(unsafe.Pointer(path + 1))) != '/' && int32(*(*int8)(unsafe.Pointer(path + 1))) != '\\' {
			sSetResultLength(tls, resultPtr, offset, extended)
			*(*Tcl_PathType)(unsafe.Pointer(typePtr)) = TCL_PATH_VOLUME_RELATIVE
			XTcl_DStringAppend(tls, resultPtr, ts+5792, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
			return path + 1
		}
		host = path + 2

		// Skip separators.

		for int32(*(*int8)(unsafe.Pointer(host))) == '/' || int32(*(*int8)(unsafe.Pointer(host))) == '\\' {
			host++
		}

		for hlen = 0; *(*int8)(unsafe.Pointer(host + uintptr(hlen))) != 0; hlen++ {
			if int32(*(*int8)(unsafe.Pointer(host + uintptr(hlen)))) == '/' || int32(*(*int8)(unsafe.Pointer(host + uintptr(hlen)))) == '\\' {
				break
			}
		}
		if int32(*(*int8)(unsafe.Pointer(host + uintptr(hlen)))) == 0 || int32(*(*int8)(unsafe.Pointer(host + uintptr(hlen+1)))) == 0 {
			// The path given is simply of the form '/foo', '//foo',
			// '/////foo' or the same with backslashes. If there is exactly
			// one leading '/' the path is volume relative (see filename man
			// page). If there are more than one, we are simply assuming they
			// are superfluous and we trim them away. (An alternative
			// interpretation would be that it is a host name, but we have
			// been documented that that is not the case).

			*(*Tcl_PathType)(unsafe.Pointer(typePtr)) = TCL_PATH_VOLUME_RELATIVE
			XTcl_DStringAppend(tls, resultPtr, ts+5792, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
			return path + 2
		}
		sSetResultLength(tls, resultPtr, offset, extended)
		share = host + uintptr(hlen)

		// Skip separators.

		for int32(*(*int8)(unsafe.Pointer(share))) == '/' || int32(*(*int8)(unsafe.Pointer(share))) == '\\' {
			share++
		}

		for slen = 0; *(*int8)(unsafe.Pointer(share + uintptr(slen))) != 0; slen++ {
			if int32(*(*int8)(unsafe.Pointer(share + uintptr(slen)))) == '/' || int32(*(*int8)(unsafe.Pointer(share + uintptr(slen)))) == '\\' {
				break
			}
		}
		XTcl_DStringAppend(tls, resultPtr, ts+30759, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
		XTcl_DStringAppend(tls, resultPtr, host, hlen)
		XTcl_DStringAppend(tls, resultPtr, ts+5792, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
		XTcl_DStringAppend(tls, resultPtr, share, slen)

		tail = share + uintptr(slen)

		// Skip separators.

		for int32(*(*int8)(unsafe.Pointer(tail))) == '/' || int32(*(*int8)(unsafe.Pointer(tail))) == '\\' {
			tail++
		}

		*(*Tcl_PathType)(unsafe.Pointer(typePtr)) = TCL_PATH_ABSOLUTE
		return tail
	} else if *(*int8)(unsafe.Pointer(path)) != 0 && int32(*(*int8)(unsafe.Pointer(path + 1))) == ':' {
		// Might be a drive separator.

		sSetResultLength(tls, resultPtr, offset, extended)

		if int32(*(*int8)(unsafe.Pointer(path + 2))) != '/' && int32(*(*int8)(unsafe.Pointer(path + 2))) != '\\' {
			*(*Tcl_PathType)(unsafe.Pointer(typePtr)) = TCL_PATH_VOLUME_RELATIVE
			XTcl_DStringAppend(tls, resultPtr, path, 2)
			return path + 2
		} else {
			var tail uintptr = path + 3

			// Skip separators.

			for *(*int8)(unsafe.Pointer(tail)) != 0 && (int32(*(*int8)(unsafe.Pointer(tail))) == '/' || int32(*(*int8)(unsafe.Pointer(tail))) == '\\') {
				tail++
			}

			*(*Tcl_PathType)(unsafe.Pointer(typePtr)) = TCL_PATH_ABSOLUTE
			XTcl_DStringAppend(tls, resultPtr, path, 2)
			XTcl_DStringAppend(tls, resultPtr, ts+5792, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))

			return tail
		}
	} else {
		var abs int32 = 0

		// Check for Windows devices.

		if (int32(*(*int8)(unsafe.Pointer(path))) == 'c' || int32(*(*int8)(unsafe.Pointer(path))) == 'C') &&
			(int32(*(*int8)(unsafe.Pointer(path + 1))) == 'o' || int32(*(*int8)(unsafe.Pointer(path + 1))) == 'O') {
			if (int32(*(*int8)(unsafe.Pointer(path + 2))) == 'm' || int32(*(*int8)(unsafe.Pointer(path + 2))) == 'M') &&
				int32(*(*int8)(unsafe.Pointer(path + 3))) >= '1' && int32(*(*int8)(unsafe.Pointer(path + 3))) <= '9' {
				// May have match for 'com[1-9]:?', which is a serial port.

				if int32(*(*int8)(unsafe.Pointer(path + 4))) == 0 {
					abs = 4
				} else if int32(*(*int8)(unsafe.Pointer(path + 4))) == ':' && int32(*(*int8)(unsafe.Pointer(path + 5))) == 0 {
					abs = 5
				}

			} else if (int32(*(*int8)(unsafe.Pointer(path + 2))) == 'n' || int32(*(*int8)(unsafe.Pointer(path + 2))) == 'N') && int32(*(*int8)(unsafe.Pointer(path + 3))) == 0 {
				// Have match for 'con'.

				abs = 3
			}

		} else if (int32(*(*int8)(unsafe.Pointer(path))) == 'l' || int32(*(*int8)(unsafe.Pointer(path))) == 'L') &&
			(int32(*(*int8)(unsafe.Pointer(path + 1))) == 'p' || int32(*(*int8)(unsafe.Pointer(path + 1))) == 'P') &&
			(int32(*(*int8)(unsafe.Pointer(path + 2))) == 't' || int32(*(*int8)(unsafe.Pointer(path + 2))) == 'T') {
			if int32(*(*int8)(unsafe.Pointer(path + 3))) >= '1' && int32(*(*int8)(unsafe.Pointer(path + 3))) <= '9' {
				// May have match for 'lpt[1-9]:?'

				if int32(*(*int8)(unsafe.Pointer(path + 4))) == 0 {
					abs = 4
				} else if int32(*(*int8)(unsafe.Pointer(path + 4))) == ':' && int32(*(*int8)(unsafe.Pointer(path + 5))) == 0 {
					abs = 5
				}
			}

		} else if (int32(*(*int8)(unsafe.Pointer(path))) == 'p' || int32(*(*int8)(unsafe.Pointer(path))) == 'P') &&
			(int32(*(*int8)(unsafe.Pointer(path + 1))) == 'r' || int32(*(*int8)(unsafe.Pointer(path + 1))) == 'R') &&
			(int32(*(*int8)(unsafe.Pointer(path + 2))) == 'n' || int32(*(*int8)(unsafe.Pointer(path + 2))) == 'N') &&
			int32(*(*int8)(unsafe.Pointer(path + 3))) == 0 {
			// Have match for 'prn'.
			abs = 3

		} else if (int32(*(*int8)(unsafe.Pointer(path))) == 'n' || int32(*(*int8)(unsafe.Pointer(path))) == 'N') &&
			(int32(*(*int8)(unsafe.Pointer(path + 1))) == 'u' || int32(*(*int8)(unsafe.Pointer(path + 1))) == 'U') &&
			(int32(*(*int8)(unsafe.Pointer(path + 2))) == 'l' || int32(*(*int8)(unsafe.Pointer(path + 2))) == 'L') &&
			int32(*(*int8)(unsafe.Pointer(path + 3))) == 0 {
			// Have match for 'nul'.

			abs = 3

		} else if (int32(*(*int8)(unsafe.Pointer(path))) == 'a' || int32(*(*int8)(unsafe.Pointer(path))) == 'A') &&
			(int32(*(*int8)(unsafe.Pointer(path + 1))) == 'u' || int32(*(*int8)(unsafe.Pointer(path + 1))) == 'U') &&
			(int32(*(*int8)(unsafe.Pointer(path + 2))) == 'x' || int32(*(*int8)(unsafe.Pointer(path + 2))) == 'X') &&
			int32(*(*int8)(unsafe.Pointer(path + 3))) == 0 {
			// Have match for 'aux'.

			abs = 3
		}

		if abs != 0 {
			*(*Tcl_PathType)(unsafe.Pointer(typePtr)) = TCL_PATH_ABSOLUTE
			sSetResultLength(tls, resultPtr, offset, extended)
			XTcl_DStringAppend(tls, resultPtr, path, abs)
			return path + uintptr(abs)
		}
	}

	// Anything else is treated as relative.

	*(*Tcl_PathType)(unsafe.Pointer(typePtr)) = TCL_PATH_RELATIVE
	return path
}

//----------------------------------------------------------------------
//
// Tcl_GetPathType --
//
//	Determines whether a given path is relative to the current directory,
//	relative to the current volume, or absolute.
//
//	The objectified Tcl_FSGetPathType should be used in preference to this
//	function (as you can see below, this is just a wrapper around that
//	other function).
//
// Results:
//	Returns one of TCL_PATH_ABSOLUTE, TCL_PATH_RELATIVE, or
//	TCL_PATH_VOLUME_RELATIVE.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetPathType(tls *libc.TLS, path uintptr) Tcl_PathType { /* tclFileName.c:341:1: */
	var type1 Tcl_PathType
	var tempObj uintptr = XTcl_NewStringObj(tls, path, -1)

	(*Tcl_Obj)(unsafe.Pointer(tempObj)).FrefCount++
	type1 = XTcl_FSGetPathType(tls, tempObj)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = tempObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return type1
}

//----------------------------------------------------------------------
//
// TclpGetNativePathType --
//
//	Determines whether a given path is relative to the current directory,
//	relative to the current volume, or absolute, but ONLY FOR THE NATIVE
//	FILESYSTEM. This function is called from tclIOUtil.c (but needs to be
//	here due to its dependence on static variables/functions in this
//	file). The exported function Tcl_FSGetPathType should be used by
//	extensions.
//
//	Note that '~' paths are always considered TCL_PATH_ABSOLUTE, even
//	though expanding the '~' could lead to any possible path type. This
//	function should therefore be considered a low-level, string
//	manipulation function only -- it doesn't actually do any expansion in
//	making its determination.
//
// Results:
//	Returns one of TCL_PATH_ABSOLUTE, TCL_PATH_RELATIVE, or
//	TCL_PATH_VOLUME_RELATIVE.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpGetNativePathType(tls *libc.TLS, pathPtr uintptr, driveNameLengthPtr uintptr, driveNameRef uintptr) Tcl_PathType { /* tclFileName.c:382:1: */
	bp := tls.Alloc(228)
	defer tls.Free(228)

	*(*Tcl_PathType)(unsafe.Pointer(bp + 224 /* type1 */)) = TCL_PATH_ABSOLUTE
	// var pathLen int32 at bp, 4

	var path uintptr = XTcl_GetStringFromObj(tls, pathPtr, bp)

	if int32(*(*int8)(unsafe.Pointer(path))) == '~' {
		// This case is common to all platforms. Paths that begin with ~ are
		// absolute.

		if driveNameLengthPtr != uintptr(0) {
			var end uintptr = path + uintptr(1)
			for int32(*(*int8)(unsafe.Pointer(end))) != 0 && int32(*(*int8)(unsafe.Pointer(end))) != '/' {
				end++
			}
			*(*int32)(unsafe.Pointer(driveNameLengthPtr)) = int32((int64(end) - int64(path)) / 1)
		}
	} else {
		switch XtclPlatform {
		case TCL_PLATFORM_UNIX:
			{
				var origPath uintptr = path

				// Paths that begin with / are absolute.

				if int32(*(*int8)(unsafe.Pointer(path))) == '/' {
					path++
					if driveNameLengthPtr != uintptr(0) {
						// We need this addition in case the QNX or Cygwin code was used.

						*(*int32)(unsafe.Pointer(driveNameLengthPtr)) = int32((int64(path) - int64(origPath)) / 1)
					}
				} else {
					*(*Tcl_PathType)(unsafe.Pointer(bp + 224 /* type1 */)) = TCL_PATH_RELATIVE
				}
				break

			}
			fallthrough
		case TCL_PLATFORM_WINDOWS:
			{
				// var ds Tcl_DString at bp+8, 216

				var rootEnd uintptr

				XTcl_DStringInit(tls, bp+8)
				rootEnd = sExtractWinRoot(tls, path, bp+8, 0, bp+224)
				if rootEnd != path && driveNameLengthPtr != uintptr(0) {
					*(*int32)(unsafe.Pointer(driveNameLengthPtr)) = int32((int64(rootEnd) - int64(path)) / 1)
					if driveNameRef != uintptr(0) {
						*(*uintptr)(unsafe.Pointer(driveNameRef)) = XTclDStringToObj(tls, bp+8)
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(driveNameRef)))).FrefCount++
					}
				}
				XTcl_DStringFree(tls, bp+8)
				break

			}
		}
	}
	return *(*Tcl_PathType)(unsafe.Pointer(bp + 224 /* type1 */))
}

//---------------------------------------------------------------------------
//
// TclpNativeSplitPath --
//
//	This function takes the given Tcl_Obj, which should be a valid path,
//	and returns a Tcl List object containing each segment of that path as
//	an element.
//
//	Note this function currently calls the older Split(Plat)Path
//	functions, which require more memory allocation than is desirable.
//
// Results:
//	Returns list object with refCount of zero. If the passed in lenPtr is
//	non-NULL, we use it to return the number of elements in the returned
//	list.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclpNativeSplitPath(tls *libc.TLS, pathPtr uintptr, lenPtr uintptr) uintptr { /* tclFileName.c:494:9: */
	var resultPtr uintptr = uintptr(0) // Needed only to prevent gcc warnings.

	// Perform platform specific splitting.

	switch XtclPlatform {
	case TCL_PLATFORM_UNIX:
		resultPtr = sSplitUnixPath(tls, XTcl_GetString(tls, pathPtr))
		break

	case TCL_PLATFORM_WINDOWS:
		resultPtr = sSplitWinPath(tls, XTcl_GetString(tls, pathPtr))
		break
	}

	// Compute the number of elements in the result.

	if lenPtr != uintptr(0) {
		XTcl_ListObjLength(tls, uintptr(0), resultPtr, lenPtr)
	}
	return resultPtr
}

//----------------------------------------------------------------------
//
// Tcl_SplitPath --
//
//	Split a path into a list of path components. The first element of the
//	list will have the same path type as the original path.
//
// Results:
//	Returns a standard Tcl result. The interpreter result contains a list
//	of path components. *argvPtr will be filled in with the address of an
//	array whose elements point to the elements of path, in order.
//	*argcPtr will get filled in with the number of valid elements in the
//	array. A single block of memory is dynamically allocated to hold both
//	the argv array and a copy of the path elements. The caller must
//	eventually free this memory by calling ckfree() on *argvPtr. Note:
//	*argvPtr and *argcPtr are only modified if the procedure returns
//	normally.
//
// Side effects:
//	Allocates memory.
//
//----------------------------------------------------------------------

func XTcl_SplitPath(tls *libc.TLS, path uintptr, argcPtr uintptr, argvPtr uintptr) { /* tclFileName.c:551:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var resultPtr uintptr = uintptr(0) // Needed only to prevent gcc warnings.
	var tmpPtr uintptr
	// var eltPtr uintptr at bp, 8

	var i int32
	var size int32
	// var len int32 at bp+8, 4

	var p uintptr
	var str uintptr

	// Perform the splitting, using objectified, vfs-aware code.

	tmpPtr = XTcl_NewStringObj(tls, path, -1)
	(*Tcl_Obj)(unsafe.Pointer(tmpPtr)).FrefCount++
	resultPtr = XTcl_FSSplitPath(tls, tmpPtr, argcPtr)
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = tmpPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	// Calculate space required for the result.

	size = 1
	for i = 0; i < *(*int32)(unsafe.Pointer(argcPtr)); i++ {
		XTcl_ListObjIndex(tls, uintptr(0), resultPtr, i, bp)
		XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp /* eltPtr */)), bp+8)
		size = size + (*(*int32)(unsafe.Pointer(bp + 8)) + 1)
	}

	// Allocate a buffer large enough to hold the contents of all of the list
	// plus the argv pointers and the terminating NULL pointer.

	*(*uintptr)(unsafe.Pointer(argvPtr)) = XTcl_Alloc(tls, uint32(uint64(*(*int32)(unsafe.Pointer(argcPtr))+1)*uint64(unsafe.Sizeof(uintptr(0)))+uint64(size)))

	// Position p after the last argv pointer and copy the contents of the
	// list in, piece by piece.

	p = *(*uintptr)(unsafe.Pointer(argvPtr)) + uintptr(*(*int32)(unsafe.Pointer(argcPtr))+1)*8
	for i = 0; i < *(*int32)(unsafe.Pointer(argcPtr)); i++ {
		XTcl_ListObjIndex(tls, uintptr(0), resultPtr, i, bp)
		str = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp /* eltPtr */)), bp+8)
		libc.Xmemcpy(tls, p, str, uint64(*(*int32)(unsafe.Pointer(bp + 8))+1))
		p += uintptr(*(*int32)(unsafe.Pointer(bp + 8)) + 1)
	}

	// Now set up the argv pointers.

	p = *(*uintptr)(unsafe.Pointer(argvPtr)) + uintptr(*(*int32)(unsafe.Pointer(argcPtr))+1)*8

	for i = 0; i < *(*int32)(unsafe.Pointer(argcPtr)); i++ {
		*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argvPtr)) + uintptr(i)*8)) = p
		for int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) != 0 {
		}
	}
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argvPtr)) + uintptr(i)*8)) = uintptr(0)

	// Free the result ptr given to us by Tcl_FSSplitPath

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = resultPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
}

//----------------------------------------------------------------------
//
// SplitUnixPath --
//
//	This routine is used by Tcl_(FS)SplitPath to handle splitting Unix
//	paths.
//
// Results:
//	Returns a newly allocated Tcl list object.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sSplitUnixPath(tls *libc.TLS, path uintptr) uintptr { /* tclFileName.c:642:16: */
	var length int32
	var origPath uintptr = path
	var elementStart uintptr
	var result uintptr

	// Deal with the root directory as a special case.

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			result = XTclThreadAllocObj(tls)
		} else {
			result = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(result + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(result)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(result)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(result)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(result)).FtypePtr = uintptr(0)
	{
	}

	if int32(*(*int8)(unsafe.Pointer(path))) == '/' {
		var rootElt uintptr
		path++
		rootElt = XTcl_NewStringObj(tls, origPath, int32((int64(path)-int64(origPath))/1))
		XTcl_ListObjAppendElement(tls, uintptr(0), result, rootElt)
		for int32(*(*int8)(unsafe.Pointer(path))) == '/' {
			path++
		}
	}

	// Split on slashes. Embedded elements that start with tilde will be
	// prefixed with "./" so they are not affected by tilde substitution.

	for {
		elementStart = path
		for int32(*(*int8)(unsafe.Pointer(path))) != 0 && int32(*(*int8)(unsafe.Pointer(path))) != '/' {
			path++
		}
		length = int32((int64(path) - int64(elementStart)) / 1)
		if length > 0 {
			var nextElt uintptr
			if int32(*(*int8)(unsafe.Pointer(elementStart))) == '~' && elementStart != origPath {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							nextElt = XTclThreadAllocObj(tls)
						} else {
							nextElt = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(nextElt + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(nextElt)).FrefCount = 0
					if int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0 {
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes, ts+30762, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes + 2)) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
					}
					(*Tcl_Obj)(unsafe.Pointer(nextElt)).FtypePtr = uintptr(0)
					{
					}
				}
				XTcl_AppendToObj(tls, nextElt, elementStart, length)
			} else {
				nextElt = XTcl_NewStringObj(tls, elementStart, length)
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), result, nextElt)
		}
		if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&path, 1)))) == 0 {
			break
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// SplitWinPath --
//
//	This routine is used by Tcl_(FS)SplitPath to handle splitting Windows
//	paths.
//
// Results:
//	Returns a newly allocated Tcl list object.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sSplitWinPath(tls *libc.TLS, path uintptr) uintptr { /* tclFileName.c:732:16: */
	bp := tls.Alloc(220)
	defer tls.Free(220)

	var length int32
	var p uintptr
	var elementStart uintptr
	*(*Tcl_PathType)(unsafe.Pointer(bp + 216 /* type1 */)) = TCL_PATH_ABSOLUTE
	// var buf Tcl_DString at bp, 216

	var result uintptr
	XTcl_DStringInit(tls, bp)

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			result = XTclThreadAllocObj(tls)
		} else {
			result = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(result + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(result)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(result)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(result)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(result)).FtypePtr = uintptr(0)
	{
	}

	p = sExtractWinRoot(tls, path, bp, 0, bp+216)

	// Terminate the root portion, if we matched something.

	if p != path {
		XTcl_ListObjAppendElement(tls, uintptr(0), result, XTclDStringToObj(tls, bp))
	}
	XTcl_DStringFree(tls, bp)

	// Split on slashes. Embedded elements that start with tilde or a drive
	// letter will be prefixed with "./" so they are not affected by tilde
	// substitution.

	for ok1 := true; ok1; ok1 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) != 0 {
		elementStart = p
		for int32(*(*int8)(unsafe.Pointer(p))) != 0 && int32(*(*int8)(unsafe.Pointer(p))) != '/' && int32(*(*int8)(unsafe.Pointer(p))) != '\\' {
			p++
		}
		length = int32((int64(p) - int64(elementStart)) / 1)
		if length > 0 {
			var nextElt uintptr
			if elementStart != path && (int32(*(*int8)(unsafe.Pointer(elementStart))) == '~' ||
				int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(elementStart)))))*2)))&int32(X_ISalpha) != 0 &&
					int32(*(*int8)(unsafe.Pointer(elementStart + 1))) == ':') {
				for ok2 := true; ok2; ok2 = 0 != 0 {
					for ok3 := true; ok3; ok3 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							nextElt = XTclThreadAllocObj(tls)
						} else {
							nextElt = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(nextElt + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(nextElt)).FrefCount = 0
					if int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0 {
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes, ts+30762, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes + 2)) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
					}
					(*Tcl_Obj)(unsafe.Pointer(nextElt)).FtypePtr = uintptr(0)
					{
					}
				}
				XTcl_AppendToObj(tls, nextElt, elementStart, length)
			} else {
				nextElt = XTcl_NewStringObj(tls, elementStart, length)
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), result, nextElt)
		}
	}

	return result
}

//---------------------------------------------------------------------------
//
// Tcl_FSJoinToPath --
//
//	This function takes the given object, which should usually be a valid
//	path or NULL, and joins onto it the array of paths segments given.
//
//	The objects in the array given will temporarily have their refCount
//	increased by one, and then decreased by one when this function exits
//	(which means if they had zero refCount when we were called, they will
//	be freed).
//
// Results:
//	Returns object owned by the caller (which should increment its
//	refCount) - typically an object with refCount of zero.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_FSJoinToPath(tls *libc.TLS, pathPtr uintptr, objc int32, objv uintptr) uintptr { /* tclFileName.c:807:9: */
	bp := tls.Alloc(24)
	defer tls.Free(24)
	*(*uintptr)(unsafe.Pointer(bp)) = pathPtr

	if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
		return XTclJoinPath(tls, objc, objv, 0)
	}
	if objc == 0 {
		return XTclJoinPath(tls, 1, bp, 0)
	}
	if objc == 1 {
		// var pair [2]uintptr at bp+8, 16

		*(*uintptr)(unsafe.Pointer(bp + 8)) = *(*uintptr)(unsafe.Pointer(bp /* pathPtr */))
		*(*uintptr)(unsafe.Pointer(bp + 8 + 1*8)) = *(*uintptr)(unsafe.Pointer(objv))
		return XTclJoinPath(tls, 2, bp+8, 0)
	} else {
		var elemc int32 = objc + 1
		var ret uintptr
		var elemv uintptr = XTcl_Alloc(tls, uint32(uint64(elemc)*uint64(unsafe.Sizeof(uintptr(0)))))

		*(*uintptr)(unsafe.Pointer(elemv)) = *(*uintptr)(unsafe.Pointer(bp /* pathPtr */))
		libc.Xmemcpy(tls, elemv+uintptr(1)*8, objv, uint64(objc)*uint64(unsafe.Sizeof(uintptr(0))))
		ret = XTclJoinPath(tls, elemc, elemv, 0)
		XTclpFree(tls, elemv)
		return ret
	}
	return uintptr(0)
}

//---------------------------------------------------------------------------
//
// TclpNativeJoinPath --
//
//	'prefix' is absolute, 'joining' is relative to prefix.
//
// Results:
//	modifies prefix
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclpNativeJoinPath(tls *libc.TLS, prefix uintptr, joining uintptr) { /* tclFileName.c:854:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var length int32 at bp, 4

	var needsSep int32
	var dest uintptr
	var p uintptr
	var start uintptr

	start = XTcl_GetStringFromObj(tls, prefix, bp)

	// Remove the ./ from tilde prefixed elements, and drive-letter prefixed
	// elements on Windows, unless it is the first component.

	p = joining

	if *(*int32)(unsafe.Pointer(bp)) != 0 {
		if int32(*(*int8)(unsafe.Pointer(p))) == '.' && int32(*(*int8)(unsafe.Pointer(p + 1))) == '/' && (int32(*(*int8)(unsafe.Pointer(p + 2))) == '~' ||
			XtclPlatform == TCL_PLATFORM_WINDOWS && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(p + 2)))))*2)))&int32(X_ISalpha) != 0 &&
				int32(*(*int8)(unsafe.Pointer(p + 3))) == ':') {
			p += uintptr(2)
		}
	}
	if int32(*(*int8)(unsafe.Pointer(p))) == 0 {
		return
	}

	switch XtclPlatform {
	case TCL_PLATFORM_UNIX:
		// Append a separator if needed.

		if *(*int32)(unsafe.Pointer(bp)) > 0 && int32(*(*int8)(unsafe.Pointer(start + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) != '/' {
			XTcl_AppendToObj(tls, prefix, ts+5792, 1)
			XTcl_GetStringFromObj(tls, prefix, bp)
		}
		needsSep = 0

		// Append the element, eliminating duplicate and trailing slashes.

		XTcl_SetObjLength(tls, prefix, *(*int32)(unsafe.Pointer(bp))+int32(libc.Xstrlen(tls, p)))

		dest = XTcl_GetString(tls, prefix) + uintptr(*(*int32)(unsafe.Pointer(bp)))
		for ; int32(*(*int8)(unsafe.Pointer(p))) != 0; p++ {
			if int32(*(*int8)(unsafe.Pointer(p))) == '/' {
				for int32(*(*int8)(unsafe.Pointer(p + 1))) == '/' {
					p++
				}
				if int32(*(*int8)(unsafe.Pointer(p + 1))) != 0 && needsSep != 0 {
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dest, 1))) = int8('/')
				}
			} else {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dest, 1))) = *(*int8)(unsafe.Pointer(p))
				needsSep = 1
			}
		}
		*(*int32)(unsafe.Pointer(bp /* length */)) = int32((int64(dest) - int64(XTcl_GetString(tls, prefix))) / 1)
		XTcl_SetObjLength(tls, prefix, *(*int32)(unsafe.Pointer(bp /* length */)))
		break

	case TCL_PLATFORM_WINDOWS:
		// Check to see if we need to append a separator.

		if *(*int32)(unsafe.Pointer(bp)) > 0 && int32(*(*int8)(unsafe.Pointer(start + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) != '/' && int32(*(*int8)(unsafe.Pointer(start + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) != ':' {
			XTcl_AppendToObj(tls, prefix, ts+5792, 1)
			XTcl_GetStringFromObj(tls, prefix, bp)
		}
		needsSep = 0

		// Append the element, eliminating duplicate and trailing slashes.

		XTcl_SetObjLength(tls, prefix, *(*int32)(unsafe.Pointer(bp))+int32(libc.Xstrlen(tls, p)))
		dest = XTcl_GetString(tls, prefix) + uintptr(*(*int32)(unsafe.Pointer(bp)))
		for ; int32(*(*int8)(unsafe.Pointer(p))) != 0; p++ {
			if int32(*(*int8)(unsafe.Pointer(p))) == '/' || int32(*(*int8)(unsafe.Pointer(p))) == '\\' {
				for int32(*(*int8)(unsafe.Pointer(p + 1))) == '/' || int32(*(*int8)(unsafe.Pointer(p + 1))) == '\\' {
					p++
				}
				if int32(*(*int8)(unsafe.Pointer(p + 1))) != 0 && needsSep != 0 {
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dest, 1))) = int8('/')
				}
			} else {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dest, 1))) = *(*int8)(unsafe.Pointer(p))
				needsSep = 1
			}
		}
		*(*int32)(unsafe.Pointer(bp /* length */)) = int32((int64(dest) - int64(XTcl_GetString(tls, prefix))) / 1)
		XTcl_SetObjLength(tls, prefix, *(*int32)(unsafe.Pointer(bp /* length */)))
		break
	}
	return
}

//----------------------------------------------------------------------
//
// Tcl_JoinPath --
//
//	Combine a list of paths in a platform specific manner. The function
//	'Tcl_FSJoinPath' should be used in preference where possible.
//
// Results:
//	Appends the joined path to the end of the specified Tcl_DString
//	returning a pointer to the resulting string. Note that the
//	Tcl_DString must already be initialized.
//
// Side effects:
//	Modifies the Tcl_DString.
//
//----------------------------------------------------------------------

func XTcl_JoinPath(tls *libc.TLS, argc int32, argv uintptr, resultPtr uintptr) uintptr { /* tclFileName.c:976:6: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var i int32
	// var len int32 at bp, 4

	var listObj uintptr
	var resultObj uintptr
	var resultStr uintptr

	// Build the list of paths.

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			listObj = XTclThreadAllocObj(tls)
		} else {
			listObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(listObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(listObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(listObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(listObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(listObj)).FtypePtr = uintptr(0)
	{
	}

	for i = 0; i < argc; i++ {
		XTcl_ListObjAppendElement(tls, uintptr(0), listObj,
			XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), -1))
	}

	// Ask the objectified code to join the paths.

	(*Tcl_Obj)(unsafe.Pointer(listObj)).FrefCount++
	resultObj = XTcl_FSJoinPath(tls, listObj, argc)
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount++
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = listObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	// Store the result.

	resultStr = XTcl_GetStringFromObj(tls, resultObj, bp)
	XTcl_DStringAppend(tls, resultPtr, resultStr, *(*int32)(unsafe.Pointer(bp /* len */)))
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = resultObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	// Return a pointer to the result.

	return (*Tcl_DString)(unsafe.Pointer(resultPtr)).Fstring
}

//---------------------------------------------------------------------------
//
// Tcl_TranslateFileName --
//
//	Converts a file name into a form usable by the native system
//	interfaces. If the name starts with a tilde, it will produce a name
//	where the tilde and following characters have been replaced by the
//	home directory location for the named user.
//
// Results:
//	The return value is a pointer to a string containing the name after
//	tilde substitution. If there was no tilde substitution, the return
//	value is a pointer to a copy of the original string. If there was an
//	error in processing the name, then an error message is left in the
//	interp's result (if interp was not NULL) and the return value is NULL.
//	Space for the return value is allocated in bufferPtr; the caller must
//	call Tcl_DStringFree() to free the space if the return value was not
//	NULL.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_TranslateFileName(tls *libc.TLS, interp uintptr, name uintptr, bufferPtr uintptr) uintptr { /* tclFileName.c:1047:6: */
	var path uintptr = XTcl_NewStringObj(tls, name, -1)
	var transPtr uintptr

	(*Tcl_Obj)(unsafe.Pointer(path)).FrefCount++
	transPtr = XTcl_FSGetTranslatedPath(tls, interp, path)
	if transPtr == uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = path
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return uintptr(0)
	}

	XTcl_DStringInit(tls, bufferPtr)
	XTclDStringAppendObj(tls, bufferPtr, transPtr)
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = path
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = transPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	// Convert forward slashes to backslashes in Windows paths because some
	// system interfaces don't accept forward slashes.

	if XtclPlatform == TCL_PLATFORM_WINDOWS {
		var p uintptr
		for p = (*Tcl_DString)(unsafe.Pointer(bufferPtr)).Fstring; int32(*(*int8)(unsafe.Pointer(p))) != 0; p++ {
			if int32(*(*int8)(unsafe.Pointer(p))) == '/' {
				*(*int8)(unsafe.Pointer(p)) = int8('\\')
			}
		}
	}

	return (*Tcl_DString)(unsafe.Pointer(bufferPtr)).Fstring
}

//----------------------------------------------------------------------
//
// TclGetExtension --
//
//	This function returns a pointer to the beginning of the extension part
//	of a file name.
//
// Results:
//	Returns a pointer into name which indicates where the extension
//	starts. If there is no extension, returns NULL.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetExtension(tls *libc.TLS, name uintptr) uintptr { /* tclFileName.c:1108:12: */
	var p uintptr
	var lastSep uintptr

	// First find the last directory separator.

	lastSep = uintptr(0) // Needed only to prevent gcc warnings.
	switch XtclPlatform {
	case TCL_PLATFORM_UNIX:
		lastSep = libc.Xstrrchr(tls, name, '/')
		break

	case TCL_PLATFORM_WINDOWS:
		lastSep = uintptr(0)
		for p = name; int32(*(*int8)(unsafe.Pointer(p))) != 0; p++ {
			if libc.Xstrchr(tls, ts+30765, int32(*(*int8)(unsafe.Pointer(p)))) != uintptr(0) {
				lastSep = p
			}
		}
		break
	}
	p = libc.Xstrrchr(tls, name, '.')
	if p != uintptr(0) && lastSep != uintptr(0) && lastSep > p {
		p = uintptr(0)
	}

	// In earlier versions, we used to back up to the first period in a series
	// so that "foo..o" would be split into "foo" and "..o". This is a
	// confusing and usually incorrect behavior, so now we split at the last
	// period in the name.

	return p
}

//----------------------------------------------------------------------
//
// DoTildeSubst --
//
//	Given a string following a tilde, this routine returns the
//	corresponding home directory.
//
// Results:
//	The result is a pointer to a static string containing the home
//	directory in native format. If there was an error in processing the
//	substitution, then an error message is left in the interp's result and
//	the return value is NULL. On success, the results are appended to
//	resultPtr, and the contents of resultPtr are returned.
//
// Side effects:
//	Information may be left in resultPtr.
//
//----------------------------------------------------------------------

func sDoTildeSubst(tls *libc.TLS, interp uintptr, user uintptr, resultPtr uintptr) uintptr { /* tclFileName.c:1169:19: */
	bp := tls.Alloc(304)
	defer tls.Free(304)

	// var dir uintptr at bp+296, 8

	if int32(*(*int8)(unsafe.Pointer(user))) == 0 {
		// var dirString Tcl_DString at bp+80, 216

		*(*uintptr)(unsafe.Pointer(bp + 296 /* dir */)) = XTclGetEnv(tls, ts+27235, bp+80)
		if *(*uintptr)(unsafe.Pointer(bp + 296)) == uintptr(0) {
			if interp != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+30769, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+30824, ts+30833, uintptr(0)))
			}
			return uintptr(0)
		}
		XTcl_JoinPath(tls, 1, bp+296, resultPtr)
		XTcl_DStringFree(tls, bp+80)
	} else if XTclpGetUserHome(tls, user, resultPtr) == uintptr(0) {
		if interp != 0 {
			XTcl_ResetResult(tls, interp)
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+30841, libc.VaList(bp+32, user)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7170, ts+30865, user, uintptr(0)))
		}
		return uintptr(0)
	}
	return (*Tcl_DString)(unsafe.Pointer(resultPtr)).Fstring
}

//----------------------------------------------------------------------
//
// Tcl_GlobObjCmd --
//
//	This procedure is invoked to process the "glob" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_GlobObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclFileName.c:1225:1: */
	bp := tls.Alloc(1040)
	defer tls.Free(1040)

	// var index int32 at bp+352, 4

	var i int32
	var globFlags int32
	// var length int32 at bp+356, 4

	var join int32
	var dir int32
	var result int32
	var string uintptr
	var separators uintptr
	var typePtr uintptr
	// var look uintptr at bp+800, 8

	var pathOrDir uintptr
	// var prefix Tcl_DString at bp+584, 216

	var globTypes uintptr
	// var pref Tcl_DString at bp+368, 216

	var search uintptr
	var find uintptr
	// var pathlength int32 at bp+360, 4

	var last uintptr
	var first uintptr
	// var item uintptr at bp+816, 8

	// var len int32 at bp+808, 4

	var str uintptr
	// var str1 Tcl_DString at bp+824, 216

	var sep uintptr
	var errorMsg uintptr
	var _objPtr uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	pathOrDir = uintptr(0)
	globTypes = uintptr(0)
	_ = dummy

	globFlags = 0
	join = 0
	dir = -1 /* PATH_NONE */
	typePtr = uintptr(0)
	i = 1
__1:
	if !(i < objc) {
		goto __3
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options8)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+352) != TCL_OK) {
		goto __4
	}
	string = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+356)
	if !(int32(*(*int8)(unsafe.Pointer(string))) == '-') {
		goto __5
	}
	// It looks like the command contains an option so signal an
	// error.

	return TCL_ERROR
	goto __6
__5:
	// This clearly isn't an option; assume it's the first glob
	// pattern. We must clear the error.

	XTcl_ResetResult(tls, interp)
	goto __3
__6:
	;
__4:
	;

	switch uint32(*(*int32)(unsafe.Pointer(bp + 352 /* index */))) {
	case uint32(2) /* GLOB_NOCOMPLAIN */ :
		goto __8
	case uint32(0) /* GLOB_DIR */ :
		goto __9
	case uint32(1) /* GLOB_JOIN */ :
		goto __10
	case uint32(4) /* GLOB_TAILS */ :
		goto __11
	case uint32(3) /* GLOB_PATH */ :
		goto __12
	case uint32(5) /* GLOB_TYPE */ :
		goto __13
	case uint32(6) /* GLOB_LAST */ :
		goto __14
	}
	goto __7
__8: // -nocomplain
	globFlags = globFlags | TCL_GLOBMODE_NO_COMPLAIN
	goto __7
__9: // -dir
	if !(i == objc-1) {
		goto __15
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+30870, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+13635, ts+14589, uintptr(0)))
	return TCL_ERROR
__15:
	;
	if !(dir != -1) {
		goto __16
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		func() uintptr {
			if dir == 1 {
				return ts + 30903 /* "\"-directory\" may..." */
			}
			return ts + 30938 /* "\"-directory\" can..." */
		}(),
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+7420, ts+30979,
		ts+30984, uintptr(0)))
	return TCL_ERROR
__16:
	;
	dir = 1 /* PATH_DIR */
	globFlags = globFlags | TCL_GLOBMODE_DIR
	pathOrDir = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	i++
	goto __7
__10: // -join
	join = 1
	goto __7
__11: // -tails
	globFlags = globFlags | TCL_GLOBMODE_TAILS
	goto __7
__12: // -path
	if !(i == objc-1) {
		goto __17
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+31005, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+13635, ts+14589, uintptr(0)))
	return TCL_ERROR
__17:
	;
	if !(dir != -1) {
		goto __18
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		func() uintptr {
			if dir == 0 {
				return ts + 31033 /* "\"-path\" may only..." */
			}
			return ts + 31063 /* "\"-path\" cannot b..." */
		}(),
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+104, ts+3593, ts+7420, ts+30979,
		ts+30984, uintptr(0)))
	return TCL_ERROR
__18:
	;
	dir = 0 /* PATH_GENERAL */
	pathOrDir = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	i++
	goto __7
__13: // -types
	if !(i == objc-1) {
		goto __19
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+31105, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+144, ts+3593, ts+13635, ts+14589, uintptr(0)))
	return TCL_ERROR
__19:
	;
	typePtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	if !(XTcl_ListObjLength(tls, interp, typePtr, bp+356) != TCL_OK) {
		goto __20
	}
	return TCL_ERROR
__20:
	;
	i++
	goto __7
__14: // --
	i++
	goto endOfForLoop
__7:
	;
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;

endOfForLoop:
	if !(globFlags&TCL_GLOBMODE_TAILS != 0 && pathOrDir == uintptr(0)) {
		goto __21
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+31134, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, ts+3593, ts+7420, ts+30979,
		ts+30984, uintptr(0)))
	return TCL_ERROR
__21:
	;

	separators = uintptr(0)
	switch XtclPlatform {
	case TCL_PLATFORM_UNIX:
		goto __23
	case TCL_PLATFORM_WINDOWS:
		goto __24
	}
	goto __22
__23:
	separators = ts + 5792 /* "/" */
	goto __22
__24:
	separators = ts + 30765 /* "/\\:" */
	goto __22
__22:
	;

	if !(dir == 0) {
		goto __25
	}
	first = XTcl_GetStringFromObj(tls, pathOrDir, bp+360)

	// Find the last path separator in the path

	last = first + uintptr(*(*int32)(unsafe.Pointer(bp + 360)))
__26:
	if !(last != first) {
		goto __28
	}
	if !(libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(last - uintptr(1))))) != uintptr(0)) {
		goto __29
	}
	goto __28
__29:
	;
	goto __27
__27:
	last--
	goto __26
	goto __28
__28:
	;

	if !(last == first+uintptr(*(*int32)(unsafe.Pointer(bp + 360)))) {
		goto __30
	}
	// It's really a directory.

	dir = 1 /* PATH_DIR */

	goto __31
__30:
	XTcl_DStringInit(tls, bp+368)
	if !(last == first) {
		goto __32
	}
	// The whole thing is a prefix. This means we must remove any
	// 'tails' flag too, since it is irrelevant now (the same
	// effect will happen without it), but in particular its use
	// in TclGlob requires a non-NULL pathOrDir.

	XTcl_DStringAppend(tls, bp+368, first, -1)
	globFlags = globFlags & libc.CplInt32(TCL_GLOBMODE_TAILS)
	pathOrDir = uintptr(0)
	goto __33
__32:
	// Have to split off the end.

	XTcl_DStringAppend(tls, bp+368, last, int32((int64(first+uintptr(*(*int32)(unsafe.Pointer(bp + 360))))-int64(last))/1))
	pathOrDir = XTcl_NewStringObj(tls, first, int32((int64(last)-int64(first))/1-int64(1)))

	// We must ensure that we haven't cut off too much, and turned
	// a valid path like '/' or 'C:/' into an incorrect path like
	// '' or 'C:'. The way we do this is to add a separator if
	// there are none presently in the prefix.

	if !(libc.Xstrpbrk(tls, XTcl_GetString(tls, pathOrDir), ts+31192) == uintptr(0)) {
		goto __34
	}
	XTcl_AppendToObj(tls, pathOrDir, last-uintptr(1), 1)
__34:
	;
__33:
	;

	// Need to quote 'prefix'.

	XTcl_DStringInit(tls, bp+584)
	search = (*Tcl_DString)(unsafe.Pointer(bp + 368)).Fstring
__35:
	if !(libc.AssignUintptr(&find, libc.Xstrpbrk(tls, search, ts+31195)) != uintptr(0)) {
		goto __36
	}
	XTcl_DStringAppend(tls, bp+584, search, int32((int64(find)-int64(search))/1))
	XTcl_DStringAppend(tls, bp+584, ts+12746, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
	XTcl_DStringAppend(tls, bp+584, find, 1)
	search = find + uintptr(1)
	if !(int32(*(*int8)(unsafe.Pointer(search))) == 0) {
		goto __37
	}
	goto __36
__37:
	;
	goto __35
__36:
	;
	if !(int32(*(*int8)(unsafe.Pointer(search))) != 0) {
		goto __38
	}
	XTcl_DStringAppend(tls, bp+584, search, -1)
__38:
	;
	XTcl_DStringFree(tls, bp+368)
__31:
	;
__25:
	;

	if !(pathOrDir != uintptr(0)) {
		goto __39
	}
	(*Tcl_Obj)(unsafe.Pointer(pathOrDir)).FrefCount++
__39:
	;

	if !(typePtr != uintptr(0)) {
		goto __40
	}
	// The rest of the possible type arguments (except 'd') are platform
	// specific. We don't complain when they are used on an incompatible
	// platform.

	XTcl_ListObjLength(tls, interp, typePtr, bp+356)
	if !(*(*int32)(unsafe.Pointer(bp + 356)) <= 0) {
		goto __41
	}
	goto skipTypes
__41:
	;
	globTypes = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(Tcl_GlobTypeData{})))
	(*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).Ftype = 0
	(*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).Fperm = 0
	(*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacType = uintptr(0)
	(*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacCreator = uintptr(0)

__42:
	if !(libc.PreDecInt32(&*(*int32)(unsafe.Pointer(bp + 356)), 1) >= 0) {
		goto __43
	}

	XTcl_ListObjIndex(tls, interp, typePtr, *(*int32)(unsafe.Pointer(bp + 356 /* length */)), bp+800)
	str = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 800 /* look */)), bp+808)
	if !(libc.Xstrcmp(tls, ts+31203, str) == 0) {
		goto __44
	}
	*(*int32)(unsafe.Pointer(globTypes + 4)) |= int32(1) << 0
	goto __45
__44:
	if !(libc.Xstrcmp(tls, ts+31212, str) == 0) {
		goto __46
	}
	*(*int32)(unsafe.Pointer(globTypes + 4)) |= int32(1) << 1
	goto __47
__46:
	if !(*(*int32)(unsafe.Pointer(bp + 808)) == 1) {
		goto __48
	}
	switch int32(*(*int8)(unsafe.Pointer(str))) {
	case 'r':
		goto __51
	case 'w':
		goto __52
	case 'x':
		goto __53
	case 'b':
		goto __54
	case 'c':
		goto __55
	case 'd':
		goto __56
	case 'p':
		goto __57
	case 'f':
		goto __58
	case 'l':
		goto __59
	case 's':
		goto __60
	default:
		goto __61
	}
	goto __50
__51:
	*(*int32)(unsafe.Pointer(globTypes + 4)) |= int32(1) << 2
	goto __50
__52:
	*(*int32)(unsafe.Pointer(globTypes + 4)) |= int32(1) << 3
	goto __50
__53:
	*(*int32)(unsafe.Pointer(globTypes + 4)) |= int32(1) << 4
	goto __50
__54:
	*(*int32)(unsafe.Pointer(globTypes)) |= int32(1) << 0
	goto __50
__55:
	*(*int32)(unsafe.Pointer(globTypes)) |= int32(1) << 1
	goto __50
__56:
	*(*int32)(unsafe.Pointer(globTypes)) |= int32(1) << 2
	goto __50
__57:
	*(*int32)(unsafe.Pointer(globTypes)) |= int32(1) << 3
	goto __50
__58:
	*(*int32)(unsafe.Pointer(globTypes)) |= int32(1) << 4
	goto __50
__59:
	*(*int32)(unsafe.Pointer(globTypes)) |= int32(1) << 5
	goto __50
__60:
	*(*int32)(unsafe.Pointer(globTypes)) |= int32(1) << 6
	goto __50
__61:
	goto badTypesArg
__50:
	;

	goto __49
__48:
	if !(*(*int32)(unsafe.Pointer(bp + 808)) == 4) {
		goto __62
	}
	// This is assumed to be a MacOS file type.

	if !((*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacType != uintptr(0)) {
		goto __64
	}
	goto badMacTypesArg
__64:
	;
	(*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacType = *(*uintptr)(unsafe.Pointer(bp + 800 /* look */))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 800)))).FrefCount++

	goto __63
__62:

	if !(XTcl_ListObjLength(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 800)), bp+808) == TCL_OK &&
		*(*int32)(unsafe.Pointer(bp + 808)) == 3) {
		goto __65
	}
	XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 800 /* look */)), 0, bp+816)
	if !!(libc.Xstrcmp(tls, ts+31219, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 816)))) != 0) {
		goto __66
	}
	XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 800 /* look */)), 1, bp+816)
	if !!(libc.Xstrcmp(tls, ts+12321, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 816)))) != 0) {
		goto __67
	}
	XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 800 /* look */)), 2, bp+816)
	if !((*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacType != uintptr(0)) {
		goto __69
	}
	goto badMacTypesArg
__69:
	;
	(*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacType = *(*uintptr)(unsafe.Pointer(bp + 816 /* item */))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 816)))).FrefCount++
	goto __42
	goto __68
__67:
	if !!(libc.Xstrcmp(tls, ts+31229, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 816)))) != 0) {
		goto __70
	}
	XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 800 /* look */)), 2, bp+816)
	if !((*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacCreator != uintptr(0)) {
		goto __71
	}
	goto badMacTypesArg
__71:
	;
	(*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacCreator = *(*uintptr)(unsafe.Pointer(bp + 816 /* item */))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 816)))).FrefCount++
	goto __42
__70:
	;
__68:
	;
__66:
	;
__65:
	;

	// Error cases. We reset the 'join' flag to zero, since we
	// haven't yet made use of it.

badTypesArg:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+31237,
		libc.VaList(bp+216, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 800 /* look */))))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+224, ts+3593, ts+13635, ts+31266, uintptr(0)))
	result = TCL_ERROR
	join = 0
	goto endOfGlob

badMacTypesArg:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+31270, -1))
	result = TCL_ERROR
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+256, ts+3593, ts+13635, ts+31266, uintptr(0)))
	join = 0
	goto endOfGlob
__63:
	;
__49:
	;
__47:
	;
__45:
	;
	goto __42
__43:
	;
__40:
	;

skipTypes:
	// Now we perform the actual glob below. This may involve joining together
	// the pattern arguments, dealing with particular file types etc. We use a
	// 'goto' to ensure we free any memory allocated along the way.

	objc = objc - i
	objv += 8 * uintptr(i)
	result = TCL_OK

	if !(join != 0) {
		goto __72
	}
	if !(dir != 0) {
		goto __74
	}
	XTcl_DStringInit(tls, bp+584)
__74:
	;
	i = 0
__75:
	if !(i < objc) {
		goto __77
	}
	XTclDStringAppendObj(tls, bp+584, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	if !(i != objc-1) {
		goto __78
	}
	XTcl_DStringAppend(tls, bp+584, separators, 1)
__78:
	;
	goto __76
__76:
	i++
	goto __75
	goto __77
__77:
	;
	if !(XTclGlob(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp+584)).Fstring, pathOrDir, globFlags,
		globTypes) != TCL_OK) {
		goto __79
	}
	result = TCL_ERROR
	goto endOfGlob
__79:
	;
	goto __73
__72:
	if !(dir == 0) {
		goto __80
	}

	XTcl_DStringInit(tls, bp+824)
	i = 0
__82:
	if !(i < objc) {
		goto __84
	}
	XTcl_DStringSetLength(tls, bp+824, 0)
	if !(dir == 0) {
		goto __85
	}
	XTclDStringAppendDString(tls, bp+824, bp+584)
__85:
	;
	XTclDStringAppendObj(tls, bp+824, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	if !(XTclGlob(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp+824)).Fstring, pathOrDir, globFlags,
		globTypes) != TCL_OK) {
		goto __86
	}
	result = TCL_ERROR
	XTcl_DStringFree(tls, bp+824)
	goto endOfGlob
__86:
	;
	goto __83
__83:
	i++
	goto __82
	goto __84
__84:
	;
	XTcl_DStringFree(tls, bp+824)
	goto __81
__80:
	i = 0
__87:
	if !(i < objc) {
		goto __89
	}
	string = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	if !(XTclGlob(tls, interp, string, pathOrDir, globFlags,
		globTypes) != TCL_OK) {
		goto __90
	}
	result = TCL_ERROR
	goto endOfGlob
__90:
	;
	goto __88
__88:
	i++
	goto __87
	goto __89
__89:
	;
__81:
	;
__73:
	;

	if !(globFlags&TCL_GLOBMODE_NO_COMPLAIN == 0) {
		goto __91
	}
	if !(XTcl_ListObjLength(tls, interp, XTcl_GetObjResult(tls, interp),
		bp+356) != TCL_OK) {
		goto __92
	}
	// This should never happen. Maybe we should be more dramatic.

	result = TCL_ERROR
	goto endOfGlob
__92:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 356)) == 0) {
		goto __93
	}
	errorMsg =
		XTcl_ObjPrintf(tls, ts+31330,
			libc.VaList(bp+288, func() uintptr {
				if join != 0 || objc == 1 {
					return ts + 2046 /* "" */
				}
				return ts + 22784 /* "s" */
			}()))

	if !(join != 0) {
		goto __94
	}
	XTcl_AppendToObj(tls, errorMsg, (*Tcl_DString)(unsafe.Pointer(bp+584)).Fstring, -1)
	goto __95
__94:
	sep = ts + 2046 /* "" */

	i = 0
__96:
	if !(i < objc) {
		goto __98
	}
	XTcl_AppendPrintfToObj(tls, errorMsg, ts+31364,
		libc.VaList(bp+296, sep, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))))
	sep = ts + 14299 /* " " */
	goto __97
__97:
	i++
	goto __96
	goto __98
__98:
	;
__95:
	;
	XTcl_AppendToObj(tls, errorMsg, ts+25027, -1)
	XTcl_SetObjResult(tls, interp, errorMsg)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+312, ts+3593, ts+7420, ts+30979, ts+31369,
		uintptr(0)))
	result = TCL_ERROR
__93:
	;
__91:
	;

endOfGlob:
	if !(join != 0 || dir == 0) {
		goto __99
	}
	XTcl_DStringFree(tls, bp+584)
__99:
	;
	if !(pathOrDir != uintptr(0)) {
		goto __100
	}
__101:
	_objPtr = pathOrDir
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __104
	}
	XTclFreeObj(tls, _objPtr)
__104:
	;
	goto __102
__102:
	if 0 != 0 {
		goto __101
	}
	goto __103
__103:
	;
__100:
	;
	if !(globTypes != uintptr(0)) {
		goto __105
	}
	if !((*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacType != uintptr(0)) {
		goto __106
	}
__107:
	_objPtr1 = (*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacType
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __110
	}
	XTclFreeObj(tls, _objPtr1)
__110:
	;
	goto __108
__108:
	if 0 != 0 {
		goto __107
	}
	goto __109
__109:
	;
__106:
	;
	if !((*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacCreator != uintptr(0)) {
		goto __111
	}
__112:
	_objPtr2 = (*Tcl_GlobTypeData)(unsafe.Pointer(globTypes)).FmacCreator
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __115
	}
	XTclFreeObj(tls, _objPtr2)
__115:
	;
	goto __113
__113:
	if 0 != 0 {
		goto __112
	}
	goto __114
__114:
	;
__111:
	;
	XTclStackFree(tls, interp, globTypes)
__105:
	;
	return result
}

var options8 = [8]uintptr{
	ts + 31377, ts + 31388, ts + 19302, ts + 31394, ts + 31400,
	ts + 31407, ts + 15828, uintptr(0),
} /* tclFileName.c:1237:23 */

//----------------------------------------------------------------------
//
// TclGlob --
//
//	Sets the separator string based on the platform, performs tilde
//	substitution, and calls DoGlob.
//
//	The interpreter's result, on entry to this function, must be a valid
//	Tcl list (e.g. it could be empty), since we will lappend any new
//	results to that list. If it is not a valid list, this function will
//	fail to do anything very meaningful.
//
//	Note that if globFlags contains 'TCL_GLOBMODE_TAILS' then pathPrefix
//	cannot be NULL (it is only allowed with -dir or -path).
//
// Results:
//	The return value is a standard Tcl result indicating whether an error
//	occurred in globbing. After a normal return the result in interp (set
//	by DoGlob) holds all of the file names given by the pattern and
//	pathPrefix arguments. After an error the result in interp will hold
//	an error message.
//
// Side effects:
//	The 'pattern' is written to.
//
//----------------------------------------------------------------------

func XTclGlob(tls *libc.TLS, interp uintptr, pattern uintptr, pathPrefix uintptr, globFlags int32, types1 uintptr) int32 { /* tclFileName.c:1718:1: */
	bp := tls.Alloc(280)
	defer tls.Free(280)

	var separators uintptr
	var head uintptr
	var tail uintptr
	var start uintptr
	var result int32
	var filenamesObj uintptr
	var savedResultObj uintptr

	separators = uintptr(0)
	switch XtclPlatform {
	case TCL_PLATFORM_UNIX:
		separators = ts + 5792 /* "/" */
		break
	case TCL_PLATFORM_WINDOWS:
		separators = ts + 30765 /* "/\\:" */
		break
	}

	if pathPrefix == uintptr(0) {
		var c int8
		// var buffer Tcl_DString at bp, 216

		XTcl_DStringInit(tls, bp)

		start = pattern

		// Perform tilde substitution, if needed.

		if int32(*(*int8)(unsafe.Pointer(start))) == '~' {
			// Find the first path separator after the tilde.

			for tail = start; int32(*(*int8)(unsafe.Pointer(tail))) != 0; tail++ {
				if int32(*(*int8)(unsafe.Pointer(tail))) == '\\' {
					if libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(tail + 1)))) != uintptr(0) {
						break
					}
				} else if libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(tail)))) != uintptr(0) {
					break
				}
			}

			// Determine the home directory for the specified user.

			c = *(*int8)(unsafe.Pointer(tail))
			*(*int8)(unsafe.Pointer(tail)) = int8(0)
			head = sDoTildeSubst(tls, interp, start+uintptr(1), bp)
			*(*int8)(unsafe.Pointer(tail)) = c
			if head == uintptr(0) {
				return TCL_ERROR
			}
			if head != (*Tcl_DString)(unsafe.Pointer(bp)).Fstring {
				XTcl_DStringAppend(tls, bp, head, -1)
			}
			pathPrefix = XTclDStringToObj(tls, bp)
			(*Tcl_Obj)(unsafe.Pointer(pathPrefix)).FrefCount++
			globFlags = globFlags | TCL_GLOBMODE_DIR
			if int32(c) != 0 {
				tail++
			}
			XTcl_DStringFree(tls, bp)
		} else {
			tail = pattern
		}
	} else {
		(*Tcl_Obj)(unsafe.Pointer(pathPrefix)).FrefCount++
		tail = pattern
	}

	// Handling empty path prefixes with glob patterns like 'C:' or
	// 'c:////////' is a pain on Windows if we leave it too late, since these
	// aren't really patterns at all! We therefore check the head of the
	// pattern now for such cases, if we don't have an unquoted prefix yet.
	//
	// Similarly on Unix with '/' at the head of the pattern -- it just
	// indicates the root volume, so we treat it as such.

	if XtclPlatform == TCL_PLATFORM_WINDOWS {
		if pathPrefix == uintptr(0) && int32(*(*int8)(unsafe.Pointer(tail))) != 0 && int32(*(*int8)(unsafe.Pointer(tail + 1))) == ':' {
			var p uintptr = tail + uintptr(1)
			pathPrefix = XTcl_NewStringObj(tls, tail, 1)
			for int32(*(*int8)(unsafe.Pointer(p))) != 0 {
				*(*int8)(unsafe.Pointer(bp + 216 /* c */)) = *(*int8)(unsafe.Pointer(p + 1))
				if int32(*(*int8)(unsafe.Pointer(p))) == '\\' {
					if libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(bp + 216)))) != uintptr(0) {
						if int32(*(*int8)(unsafe.Pointer(bp + 216))) == '\\' {
							*(*int8)(unsafe.Pointer(bp + 216 /* c */)) = int8('/')
						}
						XTcl_AppendToObj(tls, pathPrefix, bp+216, 1)
						p++
					} else {
						break
					}
				} else if libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(p)))) != uintptr(0) {
					XTcl_AppendToObj(tls, pathPrefix, p, 1)
				} else {
					break
				}
				p++
			}
			tail = p
			(*Tcl_Obj)(unsafe.Pointer(pathPrefix)).FrefCount++
		} else if pathPrefix == uintptr(0) && (int32(*(*int8)(unsafe.Pointer(tail))) == '/' ||
			int32(*(*int8)(unsafe.Pointer(tail))) == '\\' && int32(*(*int8)(unsafe.Pointer(tail + 1))) == '\\') {
			// var driveNameLen int32 at bp+220, 4

			// var driveName uintptr at bp+224, 8

			var temp uintptr = XTcl_NewStringObj(tls, tail, -1)
			(*Tcl_Obj)(unsafe.Pointer(temp)).FrefCount++

			switch XTclGetPathType(tls, temp, uintptr(0), bp+220, bp+224) {
			case TCL_PATH_VOLUME_RELATIVE:
				{
					// Volume relative path which is equivalent to a path in the
					// root of the cwd's volume. We will actually return
					// non-volume-relative paths here. i.e. 'glob /foo*' will
					// return 'C:/foobar'. This is much the same as globbing for a
					// path with '\\' will return one with '/' on Windows.

					var cwd uintptr = XTcl_FSGetCwd(tls, interp)

					if cwd == uintptr(0) {
						for ok := true; ok; ok = 0 != 0 {
							var _objPtr uintptr = temp
							if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
								XTclFreeObj(tls, _objPtr)
							}
						}
						return TCL_ERROR
					}
					pathPrefix = XTcl_NewStringObj(tls, XTcl_GetString(tls, cwd), 3)
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var _objPtr uintptr = cwd
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
					if int32(*(*int8)(unsafe.Pointer(tail))) == '/' {
						tail++
					} else {
						tail += uintptr(2)
					}
					(*Tcl_Obj)(unsafe.Pointer(pathPrefix)).FrefCount++
					break

				}
				fallthrough
			case TCL_PATH_ABSOLUTE:
				// Absolute, possibly network path //Machine/Share. Use that
				// as the path prefix (it already has a refCount).

				pathPrefix = *(*uintptr)(unsafe.Pointer(bp + 224 /* driveName */))
				tail += uintptr(*(*int32)(unsafe.Pointer(bp + 220 /* driveNameLen */)))
				break
				fallthrough
			case TCL_PATH_RELATIVE:
				// Do nothing
				break
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = temp
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}

		// ':' no longer needed as a separator. It is only relevant to the
		// beginning of the path.

		separators = ts + 31414 /* "/\\" */

	} else if XtclPlatform == TCL_PLATFORM_UNIX {
		if pathPrefix == uintptr(0) && int32(*(*int8)(unsafe.Pointer(tail))) == '/' {
			pathPrefix = XTcl_NewStringObj(tls, tail, 1)
			tail++
			(*Tcl_Obj)(unsafe.Pointer(pathPrefix)).FrefCount++
		}
	}

	// Finally if we still haven't managed to generate a path prefix, check if
	// the path starts with a current volume.

	if pathPrefix == uintptr(0) {
		// var driveNameLen int32 at bp+232, 4

		// var driveName uintptr at bp+240, 8

		if XTclFSNonnativePathType(tls, tail, int32(libc.Xstrlen(tls, tail)), uintptr(0),
			bp+232, bp+240) == TCL_PATH_ABSOLUTE {
			pathPrefix = *(*uintptr)(unsafe.Pointer(bp + 240 /* driveName */))
			tail += uintptr(*(*int32)(unsafe.Pointer(bp + 232 /* driveNameLen */)))
		}
	}

	// To process a [glob] invocation, this function may be called multiple
	// times. Each time, the previously discovered filenames are in the
	// interpreter result. We stash that away here so the result is free for
	// error messsages.

	savedResultObj = XTcl_GetObjResult(tls, interp)
	(*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FrefCount++
	XTcl_ResetResult(tls, interp)
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			filenamesObj = XTclThreadAllocObj(tls)
		} else {
			filenamesObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(filenamesObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(filenamesObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(filenamesObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(filenamesObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(filenamesObj)).FtypePtr = uintptr(0)
	{
	}

	(*Tcl_Obj)(unsafe.Pointer(filenamesObj)).FrefCount++

	// Now we do the actual globbing, adding filenames as we go to buffer in
	// filenamesObj

	if int32(*(*int8)(unsafe.Pointer(tail))) == 0 && pathPrefix != uintptr(0) {
		// An empty pattern. This means 'pathPrefix' is actually a full path
		// of a file/directory we want to simply check for existence and type.

		if types1 == uintptr(0) {
			// We just want to check for existence. In this case we make it
			// easy on Tcl_FSMatchInDirectory and its sub-implementations by
			// not bothering them (even though they should support this
			// situation) and we just use the simple existence check with
			// Tcl_FSAccess.

			if XTcl_FSAccess(tls, pathPrefix, F_OK) == 0 {
				XTcl_ListObjAppendElement(tls, interp, filenamesObj, pathPrefix)
			}
			result = TCL_OK
		} else {
			// We want to check for the correct type. Tcl_FSMatchInDirectory
			// is documented to do this for us, if we give it a NULL pattern.

			result = XTcl_FSMatchInDirectory(tls, interp, filenamesObj, pathPrefix,
				uintptr(0), types1)
		}
	} else {
		result = sDoGlob(tls, interp, filenamesObj, separators, pathPrefix,
			globFlags&TCL_GLOBMODE_DIR, tail, types1)
	}

	// Check for errors...

	if result != TCL_OK {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(filenamesObj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(filenamesObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(filenamesObj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(filenamesObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(filenamesObj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(filenamesObj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(filenamesObj)).Flength = -1
				for ok4 := true; ok4; ok4 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, filenamesObj)
					} else {
						*(*uintptr)(unsafe.Pointer(filenamesObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = filenamesObj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, filenamesObj)
			}
		}

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Flength = -1
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, savedResultObj)
					} else {
						*(*uintptr)(unsafe.Pointer(savedResultObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = savedResultObj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, savedResultObj)
			}
		}

		if pathPrefix != uintptr(0) {
			for ok6 := true; ok6; ok6 = 0 != 0 {
				var _objPtr uintptr = pathPrefix
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		return result
	}

	// If we only want the tails, we must strip off the prefix now. It may
	// seem more efficient to pass the tails flag down into DoGlob,
	// Tcl_FSMatchInDirectory, but those functions are continually adjusting
	// the prefix as the various pieces of the pattern are assimilated, so
	// that would add a lot of complexity to the code. This way is a little
	// slower (when the -tails flag is given), but much simpler to code.
	//
	// We do it by rewriting the result list in-place.

	if globFlags&TCL_GLOBMODE_TAILS != 0 {
		// var objc int32 at bp+252, 4

		var i int32
		// var objv uintptr at bp+256, 8

		// var prefixLen int32 at bp+248, 4

		var pre uintptr

		// If this length has never been set, set it here.

		if pathPrefix == uintptr(0) {
			XTcl_Panic(tls, ts+31417, 0)
		}

		pre = XTcl_GetStringFromObj(tls, pathPrefix, bp+248)
		if *(*int32)(unsafe.Pointer(bp + 248)) > 0 &&
			libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(pre + uintptr(*(*int32)(unsafe.Pointer(bp + 248))-1))))) == uintptr(0) {
			// If we're on Windows and the prefix is a volume relative one
			// like 'C:', then there won't be a path separator in between, so
			// no need to skip it here.

			if XtclPlatform != TCL_PLATFORM_WINDOWS || *(*int32)(unsafe.Pointer(bp + 248)) != 2 ||
				int32(*(*int8)(unsafe.Pointer(pre + 1))) != ':' {
				*(*int32)(unsafe.Pointer(bp + 248 /* prefixLen */))++
			}
		}

		XTcl_ListObjGetElements(tls, uintptr(0), filenamesObj, bp+252, bp+256)
		for i = 0; i < *(*int32)(unsafe.Pointer(bp + 252 /* objc */)); i++ {
			// var len int32 at bp+264, 4

			var oldStr uintptr = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 256 /* objv */)) + uintptr(i)*8)), bp+264)
			// var elem uintptr at bp+272, 8

			if *(*int32)(unsafe.Pointer(bp + 264)) == *(*int32)(unsafe.Pointer(bp + 248)) {
				if int32(*(*int8)(unsafe.Pointer(pattern))) == 0 ||
					libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(pattern)))) == uintptr(0) {
					for ok7 := true; ok7; ok7 = 0 != 0 {
						for ok8 := true; ok8; ok8 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								*(*uintptr)(unsafe.Pointer(bp + 272)) = XTclThreadAllocObj(tls)
							} else {
								*(*uintptr)(unsafe.Pointer(bp + 272)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)) + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Fbytes, ts+31477, uint64(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Fbytes + 1)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Flength = int32(uint64(unsafe.Sizeof([2]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).FtypePtr = uintptr(0)
						{
						}
					}
				} else {
					for ok9 := true; ok9; ok9 = 0 != 0 {
						for ok10 := true; ok10; ok10 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								*(*uintptr)(unsafe.Pointer(bp + 272)) = XTclThreadAllocObj(tls)
							} else {
								*(*uintptr)(unsafe.Pointer(bp + 272)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)) + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Fbytes, ts+5792, uint64(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Fbytes + 1)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).Flength = int32(uint64(unsafe.Sizeof([2]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).FtypePtr = uintptr(0)
						{
						}
					}
				}
			} else {
				*(*uintptr)(unsafe.Pointer(bp + 272 /* elem */)) = XTcl_NewStringObj(tls, oldStr+uintptr(*(*int32)(unsafe.Pointer(bp + 248))), *(*int32)(unsafe.Pointer(bp + 264))-*(*int32)(unsafe.Pointer(bp + 248)))
			}
			XTcl_ListObjReplace(tls, interp, filenamesObj, i, 1, 1, bp+272)
		}
	}

	// Now we have a list of discovered filenames in filenamesObj and a list
	// of previously discovered (saved earlier from the interpreter result) in
	// savedResultObj. Merge them and put them back in the interpreter result.

	if (*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FrefCount > 1 {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Flength = -1
				for ok11 := true; ok11; ok11 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, savedResultObj)
					} else {
						*(*uintptr)(unsafe.Pointer(savedResultObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = savedResultObj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, savedResultObj)
			}
		}

		savedResultObj = XTcl_DuplicateObj(tls, savedResultObj)
		(*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FrefCount++
	}
	if XTcl_ListObjAppendList(tls, interp, savedResultObj, filenamesObj) != TCL_OK {
		result = TCL_ERROR
	} else {
		XTcl_SetObjResult(tls, interp, savedResultObj)
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(savedResultObj)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(savedResultObj)).Flength = -1
			for ok12 := true; ok12; ok12 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, savedResultObj)
				} else {
					*(*uintptr)(unsafe.Pointer(savedResultObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = savedResultObj
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, savedResultObj)
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(filenamesObj)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(filenamesObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(filenamesObj)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(filenamesObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(filenamesObj)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(filenamesObj)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(filenamesObj)).Flength = -1
			for ok13 := true; ok13; ok13 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, filenamesObj)
				} else {
					*(*uintptr)(unsafe.Pointer(filenamesObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = filenamesObj
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, filenamesObj)
		}
	}

	if pathPrefix != uintptr(0) {
		for ok14 := true; ok14; ok14 = 0 != 0 {
			var _objPtr uintptr = pathPrefix
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	return result
}

//----------------------------------------------------------------------
//
// SkipToChar --
//
//	This function traverses a glob pattern looking for the next unquoted
//	occurrence of the specified character at the same braces nesting level.
//
// Results:
//	Updates stringPtr to point to the matching character, or to the end of
//	the string if nothing matched. The return value is 1 if a match was
//	found at the top level, otherwise it is 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sSkipToChar(tls *libc.TLS, stringPtr uintptr, match int32) int32 { /* tclFileName.c:2083:1: */
	var quoted int32
	var level int32
	var p uintptr

	quoted = 0
	level = 0

	for p = *(*uintptr)(unsafe.Pointer(stringPtr)); int32(*(*int8)(unsafe.Pointer(p))) != 0; p++ {
		if quoted != 0 {
			quoted = 0
			continue
		}
		if level == 0 && int32(*(*int8)(unsafe.Pointer(p))) == match {
			*(*uintptr)(unsafe.Pointer(stringPtr)) = p
			return 1
		}
		if int32(*(*int8)(unsafe.Pointer(p))) == '{' {
			level++
		} else if int32(*(*int8)(unsafe.Pointer(p))) == '}' {
			level--
		} else if int32(*(*int8)(unsafe.Pointer(p))) == '\\' {
			quoted = 1
		}
	}
	*(*uintptr)(unsafe.Pointer(stringPtr)) = p
	return 0
}

//----------------------------------------------------------------------
//
// DoGlob --
//
//	This recursive procedure forms the heart of the globbing code. It
//	performs a depth-first traversal of the tree given by the path name to
//	be globbed and the pattern. The directory and remainder are assumed to
//	be native format paths. The prefix contained in 'pathPtr' is either a
//	directory or path from which to start the search (or NULL). If pathPtr
//	is NULL, then the pattern must not start with an absolute path
//	specification (that case should be handled by moving the absolute path
//	prefix into pathPtr before calling DoGlob).
//
// Results:
//	The return value is a standard Tcl result indicating whether an error
//	occurred in globbing. After a normal return the result in interp will
//	be set to hold all of the file names given by the dir and remaining
//	arguments. After an error the result in interp will hold an error
//	message.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sDoGlob(tls *libc.TLS, interp uintptr, matchesObj uintptr, separators uintptr, pathPtr uintptr, flags int32, pattern uintptr, types1 uintptr) int32 { /* tclFileName.c:2142:1: */
	bp := tls.Alloc(580)
	defer tls.Free(580)

	var baseLength int32
	var quoted int32
	var count int32
	var result int32 = TCL_OK
	var name uintptr
	// var p uintptr at bp+80, 8

	var openBrace uintptr
	var closeBrace uintptr
	var firstSpecialChar uintptr
	var joinedPtr uintptr

	// Consume any leading directory separators, leaving pattern pointing just
	// past the last initial separator.

	count = 0
	name = pattern
	for ; int32(*(*int8)(unsafe.Pointer(pattern))) != 0; pattern++ {
		if int32(*(*int8)(unsafe.Pointer(pattern))) == '\\' {
			// If the first character is escaped, either we have a directory
			// separator, or we have any other character. In the latter case
			// the rest is a pattern, and we must break from the loop. This
			// is particularly important on Windows where '\' is both the
			// escaping character and a directory separator.

			if libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(pattern + 1)))) != uintptr(0) {
				pattern++
			} else {
				break
			}
		} else if libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(pattern)))) == uintptr(0) {
			break
		}
		count++
	}

	// Look for the first matching pair of braces or the first directory
	// separator that is not inside a pair of braces.

	openBrace = libc.AssignUintptr(&closeBrace, uintptr(0))
	quoted = 0
	for *(*uintptr)(unsafe.Pointer(bp + 80 /* p */)) = pattern; int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* p */))))) != 0; *(*uintptr)(unsafe.Pointer(bp + 80 /* p */))++ {
		if quoted != 0 {
			quoted = 0

		} else if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80))))) == '\\' {
			quoted = 1
			if libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)) + 1)))) != uintptr(0) {
				// Quoted directory separator.
				break
			}

		} else if libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80)))))) != uintptr(0) {
			// Unquoted directory separator.
			break

		} else if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80))))) == '{' {
			openBrace = *(*uintptr)(unsafe.Pointer(bp + 80 /* p */))
			*(*uintptr)(unsafe.Pointer(bp + 80 /* p */))++
			if sSkipToChar(tls, bp+80, '}') != 0 {
				// Balanced braces.

				closeBrace = *(*uintptr)(unsafe.Pointer(bp + 80 /* p */))
				break
			}
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+31479, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+30979, ts+31513,
				uintptr(0)))
			return TCL_ERROR

		} else if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80))))) == '}' {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+31521, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7420, ts+30979, ts+31513,
				uintptr(0)))
			return TCL_ERROR
		}
	}

	// Substitute the alternate patterns from the braces and recurse.

	if openBrace != uintptr(0) {
		var element uintptr
		// var newName Tcl_DString at bp+88, 216

		XTcl_DStringInit(tls, bp+88)

		// For each element within in the outermost pair of braces, append the
		// element and the remainder to the fixed portion before the first
		// brace and recursively call DoGlob.

		XTcl_DStringAppend(tls, bp+88, pattern, int32((int64(openBrace)-int64(pattern))/1))
		baseLength = (*Tcl_DString)(unsafe.Pointer(bp + 88)).Flength
		*(*int8)(unsafe.Pointer(closeBrace)) = int8(0)
		for *(*uintptr)(unsafe.Pointer(bp + 80 /* p */)) = openBrace; *(*uintptr)(unsafe.Pointer(bp + 80 /* p */)) != closeBrace; {
			*(*uintptr)(unsafe.Pointer(bp + 80 /* p */))++
			element = *(*uintptr)(unsafe.Pointer(bp + 80 /* p */))
			sSkipToChar(tls, bp+80, ',')
			XTcl_DStringSetLength(tls, bp+88, baseLength)
			XTcl_DStringAppend(tls, bp+88, element, int32((int64(*(*uintptr)(unsafe.Pointer(bp + 80)))-int64(element))/1))
			XTcl_DStringAppend(tls, bp+88, closeBrace+uintptr(1), -1)
			result = sDoGlob(tls, interp, matchesObj, separators, pathPtr, flags,
				(*Tcl_DString)(unsafe.Pointer(bp+88)).Fstring, types1)
			if result != TCL_OK {
				break
			}
		}
		*(*int8)(unsafe.Pointer(closeBrace)) = int8('}')
		XTcl_DStringFree(tls, bp+88)
		return result
	}

	// At this point, there are no more brace substitutions to perform on this
	// path component. The variable p is pointing at a quoted or unquoted
	// directory separator or the end of the string. So we need to check for
	// special globbing characters in the current pattern. We avoid modifying
	// pattern if p is pointing at the end of the string.
	//
	// If we find any globbing characters, then we must call
	// Tcl_FSMatchInDirectory. If we're at the end of the string, then that's
	// all we need to do. If we're not at the end of the string, then we must
	// recurse, so we do that below.
	//
	// Alternatively, if there are no globbing characters then again there are
	// two cases. If we're at the end of the string, we just need to check for
	// the given path's existence and type. If we're not at the end of the
	// string, we recurse.

	if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80))))) != 0 {
		var savedChar int8 = *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* p */))))

		// Note that we are modifying the string in place. This won't work if
		// the string is a static.

		*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* p */)))) = int8(0)
		firstSpecialChar = libc.Xstrpbrk(tls, pattern, ts+31556)
		*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* p */)))) = savedChar
	} else {
		firstSpecialChar = libc.Xstrpbrk(tls, pattern, ts+31556)
	}

	if firstSpecialChar != uintptr(0) {
		var save int8 = *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* p */))))
		var subdirsPtr uintptr

		if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80))))) == 0 {
			return XTcl_FSMatchInDirectory(tls, interp, matchesObj, pathPtr,
				pattern, types1)
		}

		// We do the recursion ourselves. This makes implementing
		// Tcl_FSMatchInDirectory for each filesystem much easier.

		*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* p */)))) = int8(0)
		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				subdirsPtr = XTclThreadAllocObj(tls)
			} else {
				subdirsPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(subdirsPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).FtypePtr = uintptr(0)
		{
		}

		(*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).FrefCount++
		result = XTcl_FSMatchInDirectory(tls, interp, subdirsPtr, pathPtr,
			pattern, uintptr(unsafe.Pointer(&dirOnly)))
		*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* p */)))) = save
		if result == TCL_OK {
			// var subdirc int32 at bp+304, 4

			var i int32
			*(*int32)(unsafe.Pointer(bp + 320 /* repair */)) = -1
			// var subdirv uintptr at bp+312, 8

			result = XTcl_ListObjGetElements(tls, interp, subdirsPtr,
				bp+304, bp+312)
			for i = 0; result == TCL_OK && i < *(*int32)(unsafe.Pointer(bp + 304 /* subdirc */)); i++ {
				var copy uintptr = uintptr(0)

				if pathPtr == uintptr(0) && int32(*(*int8)(unsafe.Pointer(XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + uintptr(i)*8)))))) == '~' {
					XTcl_ListObjLength(tls, uintptr(0), matchesObj, bp+320)
					copy = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312 /* subdirv */)) + uintptr(i)*8))
					*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312 /* subdirv */)) + uintptr(i)*8)) = XTcl_NewStringObj(tls, ts+30762, 2)
					XTcl_AppendObjToObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312 /* subdirv */)) + uintptr(i)*8)), copy)
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + uintptr(i)*8)))).FrefCount++
				}
				result = sDoGlob(tls, interp, matchesObj, separators, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312 /* subdirv */)) + uintptr(i)*8)),
					1, *(*uintptr)(unsafe.Pointer(bp + 80))+uintptr(1), types1)
				if copy != 0 {
					// var end int32 at bp+324, 4

					for ok1 := true; ok1; ok1 = 0 != 0 {
						var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + uintptr(i)*8))
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
					*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312 /* subdirv */)) + uintptr(i)*8)) = copy
					XTcl_ListObjLength(tls, uintptr(0), matchesObj, bp+324)
					for *(*int32)(unsafe.Pointer(bp + 320)) < *(*int32)(unsafe.Pointer(bp + 324)) {
						var bytes uintptr
						// var numBytes int32 at bp+336, 4

						// var fixme uintptr at bp+328, 8

						// var newObj uintptr at bp+344, 8

						XTcl_ListObjIndex(tls, uintptr(0), matchesObj, *(*int32)(unsafe.Pointer(bp + 320 /* repair */)), bp+328)
						bytes = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 328 /* fixme */)), bp+336)
						*(*uintptr)(unsafe.Pointer(bp + 344 /* newObj */)) = XTcl_NewStringObj(tls, bytes+uintptr(2), *(*int32)(unsafe.Pointer(bp + 336))-2)
						XTcl_ListObjReplace(tls, uintptr(0), matchesObj, *(*int32)(unsafe.Pointer(bp + 320 /* repair */)), 1,
							1, bp+344)
						*(*int32)(unsafe.Pointer(bp + 320 /* repair */))++
					}
					*(*int32)(unsafe.Pointer(bp + 320 /* repair */)) = -1
				}
			}
		}
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(subdirsPtr)).Flength = -1
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, subdirsPtr)
					} else {
						*(*uintptr)(unsafe.Pointer(subdirsPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = subdirsPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, subdirsPtr)
			}
		}

		return result
	}

	// We reach here with no pattern char in current section

	if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80))))) == 0 {
		// var length int32 at bp+568, 4

		// var append Tcl_DString at bp+352, 216

		// This is the code path reached by a command like 'glob foo'.
		//
		// There are no more wildcards in the pattern and no more unprocessed
		// characters in the pattern, so now we can construct the path, and
		// pass it to Tcl_FSMatchInDirectory with an empty pattern to verify
		// the existence of the file and check it is of the correct type (if a
		// 'types' flag it given -- if no such flag was given, we could just
		// use 'Tcl_FSLStat', but for simplicity we keep to a common
		// approach).

		XTcl_DStringInit(tls, bp+352)
		XTcl_DStringAppend(tls, bp+352, pattern, int32((int64(*(*uintptr)(unsafe.Pointer(bp + 80)))-int64(pattern))/1))

		if pathPtr != uintptr(0) {
			XTcl_GetStringFromObj(tls, pathPtr, bp+568)
		} else {
			*(*int32)(unsafe.Pointer(bp + 568 /* length */)) = 0
		}

		switch XtclPlatform {
		case TCL_PLATFORM_WINDOWS:
			if *(*int32)(unsafe.Pointer(bp + 568)) == 0 && (*Tcl_DString)(unsafe.Pointer(bp+352)).Flength == 0 {
				if int32(*(*int8)(unsafe.Pointer(name))) == '\\' && (int32(*(*int8)(unsafe.Pointer(name + 1))) == '/' || int32(*(*int8)(unsafe.Pointer(name + 1))) == '\\') || int32(*(*int8)(unsafe.Pointer(name))) == '/' {
					XTcl_DStringAppend(tls, bp+352, ts+5792, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
				} else {
					XTcl_DStringAppend(tls, bp+352, ts+31477, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
				}
			}

			break
			fallthrough

		case TCL_PLATFORM_UNIX:
			if *(*int32)(unsafe.Pointer(bp + 568)) == 0 && (*Tcl_DString)(unsafe.Pointer(bp+352)).Flength == 0 {
				if int32(*(*int8)(unsafe.Pointer(name))) == '\\' && int32(*(*int8)(unsafe.Pointer(name + 1))) == '/' || int32(*(*int8)(unsafe.Pointer(name))) == '/' {
					XTcl_DStringAppend(tls, bp+352, ts+5792, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
				} else {
					XTcl_DStringAppend(tls, bp+352, ts+31477, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
				}
			}
			break
		}

		// Common for all platforms.

		if pathPtr == uintptr(0) {
			joinedPtr = XTclDStringToObj(tls, bp+352)
		} else if flags != 0 {
			joinedPtr = XTclNewFSPathObj(tls, pathPtr, (*Tcl_DString)(unsafe.Pointer(bp+352)).Fstring,
				(*Tcl_DString)(unsafe.Pointer(bp+352)).Flength)
		} else {
			joinedPtr = XTcl_DuplicateObj(tls, pathPtr)
			if libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer((*Tcl_DString)(unsafe.Pointer(bp + 352)).Fstring)))) == uintptr(0) {
				// The current prefix must end in a separator.

				// var len int32 at bp+572, 4

				var joined uintptr = XTcl_GetStringFromObj(tls, joinedPtr, bp+572)

				if *(*int32)(unsafe.Pointer(bp + 572)) > 0 && libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(joined + uintptr(*(*int32)(unsafe.Pointer(bp + 572))-1))))) == uintptr(0) {
					XTcl_AppendToObj(tls, joinedPtr, ts+5792, 1)
				}
			}
			XTcl_AppendToObj(tls, joinedPtr, (*Tcl_DString)(unsafe.Pointer(bp+352)).Fstring,
				(*Tcl_DString)(unsafe.Pointer(bp+352)).Flength)
		}
		(*Tcl_Obj)(unsafe.Pointer(joinedPtr)).FrefCount++
		XTcl_DStringFree(tls, bp+352)
		result = XTcl_FSMatchInDirectory(tls, interp, matchesObj, joinedPtr, uintptr(0),
			types1)
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = joinedPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return result
	}

	// If it's not the end of the string, we must recurse

	if pathPtr == uintptr(0) {
		joinedPtr = XTcl_NewStringObj(tls, pattern, int32((int64(*(*uintptr)(unsafe.Pointer(bp + 80)))-int64(pattern))/1))
	} else if flags != 0 {
		joinedPtr = XTclNewFSPathObj(tls, pathPtr, pattern, int32((int64(*(*uintptr)(unsafe.Pointer(bp + 80)))-int64(pattern))/1))
	} else {
		joinedPtr = XTcl_DuplicateObj(tls, pathPtr)
		if libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(pattern)))) == uintptr(0) {
			// The current prefix must end in a separator, unless this is a
			// volume-relative path. In particular globbing in Windows shares,
			// when not using -dir or -path, e.g. 'glob [file join
			// //machine/share/subdir *]' requires adding a separator here.
			// This behaviour is not currently tested for in the test suite.

			// var len int32 at bp+576, 4

			var joined uintptr = XTcl_GetStringFromObj(tls, joinedPtr, bp+576)

			if *(*int32)(unsafe.Pointer(bp + 576)) > 0 && libc.Xstrchr(tls, separators, int32(*(*int8)(unsafe.Pointer(joined + uintptr(*(*int32)(unsafe.Pointer(bp + 576))-1))))) == uintptr(0) {
				if XTcl_FSGetPathType(tls, pathPtr) != TCL_PATH_VOLUME_RELATIVE {
					XTcl_AppendToObj(tls, joinedPtr, ts+5792, 1)
				}
			}
		}
		XTcl_AppendToObj(tls, joinedPtr, pattern, int32((int64(*(*uintptr)(unsafe.Pointer(bp + 80)))-int64(pattern))/1))
	}

	(*Tcl_Obj)(unsafe.Pointer(joinedPtr)).FrefCount++
	result = sDoGlob(tls, interp, matchesObj, separators, joinedPtr, 1, *(*uintptr)(unsafe.Pointer(bp + 80 /* p */)), types1)
	for ok4 := true; ok4; ok4 = 0 != 0 {
		var _objPtr uintptr = joinedPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	return result
}

var dirOnly = Tcl_GlobTypeData{
	Ftype: int32(1) << 2,
} /* tclFileName.c:2321:26 */

//---------------------------------------------------------------------------
//
// Tcl_AllocStatBuf --
//
//	This procedure allocates a Tcl_StatBuf on the heap. It exists so that
//	extensions may be used unchanged on systems where largefile support is
//	optional.
//
// Results:
//	A pointer to a Tcl_StatBuf which may be deallocated by being passed to
//	ckfree().
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_AllocStatBuf(tls *libc.TLS) uintptr { /* tclFileName.c:2531:13: */
	return XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_StatBuf{})))
}

//---------------------------------------------------------------------------
//
// Access functions for Tcl_StatBuf --
//
//	These functions provide portable read-only access to the portable
//	fields of the Tcl_StatBuf structure (really a 'struct stat', 'struct
//	stat64' or something else related). [TIP #316]
//
// Results:
//	The value from the field being retrieved.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_GetFSDeviceFromStat(tls *libc.TLS, statPtr uintptr) uint32 { /* tclFileName.c:2556:1: */
	return uint32((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_dev)
}

func XTcl_GetFSInodeFromStat(tls *libc.TLS, statPtr uintptr) uint32 { /* tclFileName.c:2563:1: */
	return uint32((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_ino)
}

func XTcl_GetModeFromStat(tls *libc.TLS, statPtr uintptr) uint32 { /* tclFileName.c:2570:1: */
	return (*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_mode
}

func XTcl_GetLinkCountFromStat(tls *libc.TLS, statPtr uintptr) int32 { /* tclFileName.c:2577:1: */
	return int32((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_nlink)
}

func XTcl_GetUserIdFromStat(tls *libc.TLS, statPtr uintptr) int32 { /* tclFileName.c:2584:1: */
	return int32((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_uid)
}

func XTcl_GetGroupIdFromStat(tls *libc.TLS, statPtr uintptr) int32 { /* tclFileName.c:2591:1: */
	return int32((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_gid)
}

func XTcl_GetDeviceTypeFromStat(tls *libc.TLS, statPtr uintptr) int32 { /* tclFileName.c:2598:1: */
	return int32((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_rdev)
}

func XTcl_GetAccessTimeFromStat(tls *libc.TLS, statPtr uintptr) Tcl_WideInt { /* tclFileName.c:2605:1: */
	return (*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_atim.Ftv_sec
}

func XTcl_GetModificationTimeFromStat(tls *libc.TLS, statPtr uintptr) Tcl_WideInt { /* tclFileName.c:2612:1: */
	return (*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_mtim.Ftv_sec
}

func XTcl_GetChangeTimeFromStat(tls *libc.TLS, statPtr uintptr) Tcl_WideInt { /* tclFileName.c:2619:1: */
	return (*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_ctim.Ftv_sec
}

func XTcl_GetSizeFromStat(tls *libc.TLS, statPtr uintptr) Tcl_WideUInt { /* tclFileName.c:2626:1: */
	return Tcl_WideUInt((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_size)
}

func XTcl_GetBlocksFromStat(tls *libc.TLS, statPtr uintptr) Tcl_WideUInt { /* tclFileName.c:2633:1: */
	return Tcl_WideUInt((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_blocks)
}

func XTcl_GetBlockSizeFromStat(tls *libc.TLS, statPtr uintptr) uint32 { /* tclFileName.c:2646:1: */
	return uint32((*Tcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_blksize)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------------
//
// Tcl_GetInt --
//
//	Given a string, produce the corresponding integer value.
//
// Results:
//	The return value is normally TCL_OK; in this case *intPtr will be set
//	to the integer value equivalent to src.  If src is improperly formed
//	then TCL_ERROR is returned and an error message will be left in the
//	interp's result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetInt(tls *libc.TLS, interp uintptr, src uintptr, intPtr uintptr) int32 { /* tclGet.c:37:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	// var obj Tcl_Obj at bp, 48

	var code int32

	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).FrefCount = 1
	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).Fbytes = src
	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).Flength = int32(libc.Xstrlen(tls, src))
	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).FtypePtr = uintptr(0)

	code = XTcl_GetIntFromObj(tls, interp, bp, intPtr)
	if (*Tcl_Obj)(unsafe.Pointer(bp)).FrefCount > 1 {
		XTcl_Panic(tls, ts+31562, 0)
	}
	if (*Tcl_Obj)(unsafe.Pointer(bp)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bp)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).FtypePtr)).FfreeIntRepProc})).f(tls, bp /* &obj */)
		}
		(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).FtypePtr = uintptr(0)
	}

	return code
}

//----------------------------------------------------------------------
//
// Tcl_GetDouble --
//
//	Given a string, produce the corresponding double-precision
//	floating-point value.
//
// Results:
//	The return value is normally TCL_OK; in this case *doublePtr will be
//	set to the double-precision value equivalent to src. If src is
//	improperly formed then TCL_ERROR is returned and an error message will
//	be left in the interp's result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetDouble(tls *libc.TLS, interp uintptr, src uintptr, doublePtr uintptr) int32 { /* tclGet.c:81:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	// var obj Tcl_Obj at bp, 48

	var code int32

	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).FrefCount = 1
	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).Fbytes = src
	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).Flength = int32(libc.Xstrlen(tls, src))
	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).FtypePtr = uintptr(0)

	code = XTcl_GetDoubleFromObj(tls, interp, bp, doublePtr)
	if (*Tcl_Obj)(unsafe.Pointer(bp)).FrefCount > 1 {
		XTcl_Panic(tls, ts+31562, 0)
	}
	if (*Tcl_Obj)(unsafe.Pointer(bp)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bp)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).FtypePtr)).FfreeIntRepProc})).f(tls, bp /* &obj */)
		}
		(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).FtypePtr = uintptr(0)
	}

	return code
}

//----------------------------------------------------------------------
//
// Tcl_GetBoolean --
//
//	Given a string, return a 0/1 boolean value corresponding to the
//	string.
//
// Results:
//	The return value is normally TCL_OK; in this case *boolPtr will be set
//	to the 0/1 value equivalent to src. If src is improperly formed then
//	TCL_ERROR is returned and an error message will be left in the
//	interp's result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetBoolean(tls *libc.TLS, interp uintptr, src uintptr, boolPtr uintptr) int32 { /* tclGet.c:125:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	// var obj Tcl_Obj at bp, 48

	var code int32

	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).FrefCount = 1
	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).Fbytes = src
	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).Flength = int32(libc.Xstrlen(tls, src))
	(*Tcl_Obj)(unsafe.Pointer(bp /* &obj */)).FtypePtr = uintptr(0)

	code = XTclSetBooleanFromAny(tls, interp, bp)
	if (*Tcl_Obj)(unsafe.Pointer(bp)).FrefCount > 1 {
		XTcl_Panic(tls, ts+31562, 0)
	}
	if code == TCL_OK {
		*(*int32)(unsafe.Pointer(boolPtr)) = int32(*(*int64)(unsafe.Pointer(bp + 32)))
	}
	return code
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

var XtclArrayHashKeyType = Tcl_HashKeyType{
	Fversion:         TCL_HASH_KEY_TYPE_VERSION,   // version
	Fflags:           TCL_HASH_KEY_RANDOMIZE_HASH, // flags
	FhashKeyProc:     0,                           // hashKeyProc
	FcompareKeysProc: 0,                           // compareKeysProc
	FallocEntryProc:  0,                           // freeEntryProc
} /* tclHash.c:82:23 */

var XtclOneWordHashKeyType = Tcl_HashKeyType{
	Fversion: TCL_HASH_KEY_TYPE_VERSION, /* FreeOneWordKey, */ // freeEntryProc
} /* tclHash.c:91:23 */

var XtclStringHashKeyType = Tcl_HashKeyType{
	Fversion:         TCL_HASH_KEY_TYPE_VERSION, // flags
	FhashKeyProc:     0,                         // hashKeyProc
	FcompareKeysProc: 0,                         // compareKeysProc
	FallocEntryProc:  0,                         // freeEntryProc
} /* tclHash.c:100:23 */

//----------------------------------------------------------------------
//
// Tcl_InitHashTable --
//
//	Given storage for a hash table, set up the fields to prepare the hash
//	table for use.
//
// Results:
//	None.
//
// Side effects:
//	TablePtr is now ready to be passed to Tcl_FindHashEntry and
//	Tcl_CreateHashEntry.
//
//----------------------------------------------------------------------

func XTcl_InitHashTable(tls *libc.TLS, tablePtr uintptr, keyType int32) { /* tclHash.c:128:1: */
	// Use a special value to inform the extended version that it must not
	// access any of the new fields in the Tcl_HashTable. If an extension is
	// rebuilt then any calls to this function will be redirected to the
	// extended version by a macro.

	XTcl_InitCustomHashTable(tls, tablePtr, keyType, libc.UintptrFromInt32(-1))
}

//----------------------------------------------------------------------
//
// Tcl_InitCustomHashTable --
//
//	Given storage for a hash table, set up the fields to prepare the hash
//	table for use. This is an extended version of Tcl_InitHashTable which
//	supports user defined keys.
//
// Results:
//	None.
//
// Side effects:
//	TablePtr is now ready to be passed to Tcl_FindHashEntry and
//	Tcl_CreateHashEntry.
//
//----------------------------------------------------------------------

func XTcl_InitCustomHashTable(tls *libc.TLS, tablePtr uintptr, keyType int32, typePtr uintptr) { /* tclHash.c:166:1: */

	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets = tablePtr + 8 /* &.staticBuckets */
	*(*uintptr)(unsafe.Pointer(tablePtr + 8)) = libc.AssignPtrUintptr(tablePtr+8+1*8, uintptr(0))
	*(*uintptr)(unsafe.Pointer(tablePtr + 8 + 2*8)) = libc.AssignPtrUintptr(tablePtr+8+3*8, uintptr(0))
	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumBuckets = TCL_SMALL_HASH_TABLE
	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumEntries = 0
	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FrebuildSize = TCL_SMALL_HASH_TABLE * REBUILD_MULTIPLIER
	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FdownShift = 28
	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fmask = 3
	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType = keyType
	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FfindProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	}{sFindHashEntry}))
	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	}{sCreateHashEntry}))

	if typePtr == uintptr(0) {
		// The caller has been rebuilt so the hash table is an extended
		// version.
	} else if typePtr != libc.UintptrFromInt32(-1) {
		// The caller is requesting a customized hash table so it must be an
		// extended version.

		(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FtypePtr = typePtr
	} else {
		// The caller has not been rebuilt so the hash table is not extended.
	}
}

//----------------------------------------------------------------------
//
// Tcl_FindHashEntry --
//
//	Given a hash table find the entry with a matching key.
//
// Results:
//	The return value is a token for the matching entry in the hash table,
//	or NULL if there was no matching entry.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_FindHashEntry(tls *libc.TLS, tablePtr uintptr, key uintptr) uintptr { /* tclHash.c:230:15: */
	return (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FfindProc})).f(tls, tablePtr, key)
}

func sFindHashEntry(tls *libc.TLS, tablePtr uintptr, key uintptr) uintptr { /* tclHash.c:238:22: */
	return sCreateHashEntry(tls, tablePtr, key, uintptr(0))
}

//----------------------------------------------------------------------
//
// Tcl_CreateHashEntry --
//
//	Given a hash table with string keys, and a string key, find the entry
//	with a matching key. If there is no matching entry, then create a new
//	entry that does match.
//
// Results:
//	The return value is a pointer to the matching entry. If this is a
//	newly-created entry, then *newPtr will be set to a non-zero value;
//	otherwise *newPtr will be set to 0. If this is a new entry the value
//	stored in the entry will initially be 0.
//
// Side effects:
//	A new entry may be added to the hash table.
//
//----------------------------------------------------------------------

func XTcl_CreateHashEntry(tls *libc.TLS, tablePtr uintptr, key uintptr, newPtr uintptr) uintptr { /* tclHash.c:268:15: */
	return (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})).f(tls, tablePtr, key, newPtr)
}

func sCreateHashEntry(tls *libc.TLS, tablePtr uintptr, key uintptr, newPtr uintptr) uintptr { /* tclHash.c:279:22: */
	var hPtr uintptr
	var typePtr uintptr
	var hash uint32
	var index int32

	if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == 0 {
		typePtr = uintptr(unsafe.Pointer(&XtclStringHashKeyType))
	} else if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == 1 {
		typePtr = uintptr(unsafe.Pointer(&XtclOneWordHashKeyType))
	} else if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == -2 ||
		(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == -1 {
		typePtr = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FtypePtr
	} else {
		typePtr = uintptr(unsafe.Pointer(&XtclArrayHashKeyType))
	}

	if (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FhashKeyProc != 0 {
		hash = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uint32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FhashKeyProc})).f(tls, tablePtr, key)
		if (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).Fflags&TCL_HASH_KEY_RANDOMIZE_HASH != 0 {
			index = int32(int64(hash) * 1103515245 >> (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FdownShift & int64((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fmask))
		} else {
			index = int32(hash & uint32((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fmask))
		}
	} else {
		hash = uint32(key)
		index = int32(int64(hash) * 1103515245 >> (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FdownShift & int64((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fmask))
	}

	// Search all of the entries in the appropriate bucket.

	if (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FcompareKeysProc != 0 {
		var compareKeysProc uintptr = (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FcompareKeysProc

		for hPtr = *(*uintptr)(unsafe.Pointer((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr(index)*8)); hPtr != uintptr(0); hPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FnextPtr {
			if hash != uint32((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).Fhash) {
				continue
			}
			// if keys pointers or values are equal
			if key == *(*uintptr)(unsafe.Pointer(hPtr + 32)) ||
				(*struct {
					f func(*libc.TLS, uintptr, uintptr) int32
				})(unsafe.Pointer(&struct{ uintptr }{compareKeysProc})).f(tls, key, hPtr) != 0 {
				if newPtr != 0 {
					*(*int32)(unsafe.Pointer(newPtr)) = 0
				}
				return hPtr
			}
		}
	} else {
		for hPtr = *(*uintptr)(unsafe.Pointer((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr(index)*8)); hPtr != uintptr(0); hPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FnextPtr {
			if hash != uint32((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).Fhash) {
				continue
			}
			if key == *(*uintptr)(unsafe.Pointer(hPtr + 32)) {
				if newPtr != 0 {
					*(*int32)(unsafe.Pointer(newPtr)) = 0
				}
				return hPtr
			}
		}
	}

	if !(newPtr != 0) {
		return uintptr(0)
	}

	// Entry not found. Add a new one to the bucket.

	*(*int32)(unsafe.Pointer(newPtr)) = 1
	if (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FallocEntryProc != 0 {
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FallocEntryProc})).f(tls, tablePtr, key)
	} else {
		hPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashEntry{})))
		*(*uintptr)(unsafe.Pointer(hPtr + 32)) = key
		(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(0)
	}

	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FtablePtr = tablePtr
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).Fhash = uintptr(Uintptr_t(hash))
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FnextPtr = *(*uintptr)(unsafe.Pointer((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr(index)*8))
	*(*uintptr)(unsafe.Pointer((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr(index)*8)) = hPtr
	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumEntries++

	// If the table has exceeded a decent size, rebuild it with many more
	// buckets.

	if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumEntries >= (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FrebuildSize {
		sRebuildTable(tls, tablePtr)
	}
	return hPtr
}

//----------------------------------------------------------------------
//
// Tcl_DeleteHashEntry --
//
//	Remove a single entry from a hash table.
//
// Results:
//	None.
//
// Side effects:
//	The entry given by entryPtr is deleted from its table and should never
//	again be used by the caller. It is up to the caller to free the
//	clientData field of the entry, if that is relevant.
//
//----------------------------------------------------------------------

func XTcl_DeleteHashEntry(tls *libc.TLS, entryPtr uintptr) { /* tclHash.c:415:1: */
	var prevPtr uintptr
	var typePtr uintptr
	var tablePtr uintptr
	var bucketPtr uintptr
	var index int32

	tablePtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FtablePtr

	if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == 0 {
		typePtr = uintptr(unsafe.Pointer(&XtclStringHashKeyType))
	} else if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == 1 {
		typePtr = uintptr(unsafe.Pointer(&XtclOneWordHashKeyType))
	} else if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == -2 ||
		(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == -1 {
		typePtr = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FtypePtr
	} else {
		typePtr = uintptr(unsafe.Pointer(&XtclArrayHashKeyType))
	}

	if (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FhashKeyProc == uintptr(0) ||
		(*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).Fflags&TCL_HASH_KEY_RANDOMIZE_HASH != 0 {
		index = int32(int64(int32((*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).Fhash)) * 1103515245 >> (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FdownShift & int64((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fmask))
	} else {
		index = int32(uint32((*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).Fhash) & uint32((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fmask))
	}

	bucketPtr = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr(index)*8

	if *(*uintptr)(unsafe.Pointer(bucketPtr)) == entryPtr {
		*(*uintptr)(unsafe.Pointer(bucketPtr)) = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FnextPtr
	} else {
		for prevPtr = *(*uintptr)(unsafe.Pointer(bucketPtr)); ; prevPtr = (*Tcl_HashEntry)(unsafe.Pointer(prevPtr)).FnextPtr {
			if prevPtr == uintptr(0) {
				XTcl_Panic(tls, ts+31600, 0)
			}
			if (*Tcl_HashEntry)(unsafe.Pointer(prevPtr)).FnextPtr == entryPtr {
				(*Tcl_HashEntry)(unsafe.Pointer(prevPtr)).FnextPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FnextPtr
				break
			}
		}
	}

	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumEntries--
	if (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FfreeEntryProc != 0 {
		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FfreeEntryProc})).f(tls, entryPtr)
	} else {
		XTclpFree(tls, entryPtr)
	}
}

//----------------------------------------------------------------------
//
// Tcl_DeleteHashTable --
//
//	Free up everything associated with a hash table except for the record
//	for the table itself.
//
// Results:
//	None.
//
// Side effects:
//	The hash table is no longer useable.
//
//----------------------------------------------------------------------

func XTcl_DeleteHashTable(tls *libc.TLS, tablePtr uintptr) { /* tclHash.c:492:1: */
	var hPtr uintptr
	var nextPtr uintptr
	var typePtr uintptr
	var i int32

	if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == 0 {
		typePtr = uintptr(unsafe.Pointer(&XtclStringHashKeyType))
	} else if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == 1 {
		typePtr = uintptr(unsafe.Pointer(&XtclOneWordHashKeyType))
	} else if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == -2 ||
		(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == -1 {
		typePtr = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FtypePtr
	} else {
		typePtr = uintptr(unsafe.Pointer(&XtclArrayHashKeyType))
	}

	// Free up all the entries in the table.

	for i = 0; i < (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumBuckets; i++ {
		hPtr = *(*uintptr)(unsafe.Pointer((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr(i)*8))
		for hPtr != uintptr(0) {
			nextPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FnextPtr
			if (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FfreeEntryProc != 0 {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FfreeEntryProc})).f(tls, hPtr)
			} else {
				XTclpFree(tls, hPtr)
			}
			hPtr = nextPtr
		}
	}

	// Free up the bucket array, if it was dynamically allocated.

	if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets != tablePtr+8 {
		if (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).Fflags&TCL_HASH_KEY_SYSTEM_HASH != 0 {
			libc.Xfree(tls, (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets)
		} else {
			XTclpFree(tls, (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets)
		}
	}

	// Arrange for panics if the table is used again without
	// re-initialization.

	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FfindProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	}{sBogusFind}))
	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	}{sBogusCreate}))
}

//----------------------------------------------------------------------
//
// Tcl_FirstHashEntry --
//
//	Locate the first entry in a hash table and set up a record that can be
//	used to step through all the remaining entries of the table.
//
// Results:
//	The return value is a pointer to the first entry in tablePtr, or NULL
//	if tablePtr has no entries in it. The memory at *searchPtr is
//	initialized so that subsequent calls to Tcl_NextHashEntry will return
//	all of the entries in the table, one at a time.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_FirstHashEntry(tls *libc.TLS, tablePtr uintptr, searchPtr uintptr) uintptr { /* tclHash.c:568:15: */
	(*Tcl_HashSearch)(unsafe.Pointer(searchPtr)).FtablePtr = tablePtr
	(*Tcl_HashSearch)(unsafe.Pointer(searchPtr)).FnextIndex = 0
	(*Tcl_HashSearch)(unsafe.Pointer(searchPtr)).FnextEntryPtr = uintptr(0)
	return XTcl_NextHashEntry(tls, searchPtr)
}

//----------------------------------------------------------------------
//
// Tcl_NextHashEntry --
//
//	Once a hash table enumeration has been initiated by calling
//	Tcl_FirstHashEntry, this function may be called to return successive
//	elements of the table.
//
// Results:
//	The return value is the next entry in the hash table being enumerated,
//	or NULL if the end of the table is reached.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_NextHashEntry(tls *libc.TLS, searchPtr uintptr) uintptr { /* tclHash.c:599:15: */
	var hPtr uintptr
	var tablePtr uintptr = (*Tcl_HashSearch)(unsafe.Pointer(searchPtr)).FtablePtr

	for (*Tcl_HashSearch)(unsafe.Pointer(searchPtr)).FnextEntryPtr == uintptr(0) {
		if (*Tcl_HashSearch)(unsafe.Pointer(searchPtr)).FnextIndex >= (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumBuckets {
			return uintptr(0)
		}
		(*Tcl_HashSearch)(unsafe.Pointer(searchPtr)).FnextEntryPtr = *(*uintptr)(unsafe.Pointer((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr((*Tcl_HashSearch)(unsafe.Pointer(searchPtr)).FnextIndex)*8))
		(*Tcl_HashSearch)(unsafe.Pointer(searchPtr)).FnextIndex++
	}
	hPtr = (*Tcl_HashSearch)(unsafe.Pointer(searchPtr)).FnextEntryPtr
	(*Tcl_HashSearch)(unsafe.Pointer(searchPtr)).FnextEntryPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FnextPtr
	return hPtr
}

//----------------------------------------------------------------------
//
// Tcl_HashStats --
//
//	Return statistics describing the layout of the hash table in its hash
//	buckets.
//
// Results:
//	The return value is a malloc-ed string containing information about
//	tablePtr. It is the caller's responsibility to free this string.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_HashStats(tls *libc.TLS, tablePtr uintptr) uintptr { /* tclHash.c:641:6: */
	bp := tls.Alloc(96)
	defer tls.Free(96)

	// var count [10]int32 at bp+56, 40

	var overflow int32
	var i int32
	var j int32
	var average float64
	var tmp float64
	var hPtr uintptr
	var result uintptr
	var p uintptr

	// Compute a histogram of bucket usage.

	for i = 0; i < NUM_COUNTERS; i++ {
		*(*int32)(unsafe.Pointer(bp + 56 + uintptr(i)*4)) = 0
	}
	overflow = 0
	average = 0.0
	for i = 0; i < (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumBuckets; i++ {
		j = 0
		for hPtr = *(*uintptr)(unsafe.Pointer((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr(i)*8)); hPtr != uintptr(0); hPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FnextPtr {
			j++
		}
		if j < NUM_COUNTERS {
			*(*int32)(unsafe.Pointer(bp + 56 + uintptr(j)*4))++
		} else {
			overflow++
		}
		tmp = float64(j)
		if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumEntries != 0 {
			average = average + (tmp+1.0)*(tmp/float64((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumEntries))/2.0
		}
	}

	// Print out the histogram and a few other pieces of information.

	result = XTcl_Alloc(tls, uint32(NUM_COUNTERS*60+300))
	libc.Xsprintf(tls, result, ts+31646,
		libc.VaList(bp, (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumEntries, (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumBuckets))
	p = result + uintptr(libc.Xstrlen(tls, result))
	for i = 0; i < NUM_COUNTERS; i++ {
		libc.Xsprintf(tls, p, ts+31679,
			libc.VaList(bp+16, i, *(*int32)(unsafe.Pointer(bp + 56 + uintptr(i)*4))))
		p += uintptr(libc.Xstrlen(tls, p))
	}
	libc.Xsprintf(tls, p, ts+31718,
		libc.VaList(bp+32, NUM_COUNTERS, overflow))
	p += uintptr(libc.Xstrlen(tls, p))
	libc.Xsprintf(tls, p, ts+31765, libc.VaList(bp+48, average))
	return result
}

//----------------------------------------------------------------------
//
// AllocArrayEntry --
//
//	Allocate space for a Tcl_HashEntry containing the array key.
//
// Results:
//	The return value is a pointer to the created entry.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sAllocArrayEntry(tls *libc.TLS, tablePtr uintptr, keyPtr uintptr) uintptr { /* tclHash.c:712:22: */
	var array uintptr = keyPtr
	var iPtr1 uintptr
	var iPtr2 uintptr
	var hPtr uintptr
	var count int32
	var size uint32

	count = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType

	size = uint32(uint64(unsafe.Sizeof(Tcl_HashEntry{})) + uint64(count)*uint64(unsafe.Sizeof(int32(0))) - uint64(unsafe.Sizeof(struct{ FoneWordValue uintptr }{})))
	if uint64(size) < uint64(unsafe.Sizeof(Tcl_HashEntry{})) {
		size = uint32(unsafe.Sizeof(Tcl_HashEntry{}))
	}
	hPtr = XTcl_Alloc(tls, size)

	iPtr1 = array
	iPtr2 = hPtr + 32
__1:
	if !(count > 0) {
		goto __3
	}
	{
		*(*int32)(unsafe.Pointer(iPtr2)) = *(*int32)(unsafe.Pointer(iPtr1))

	}
	goto __2
__2:
	count--
	iPtr1 += 4
	iPtr2 += 4
	goto __1
	goto __3
__3:
	;
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(0)

	return hPtr
}

//----------------------------------------------------------------------
//
// CompareArrayKeys --
//
//	Compares two array keys.
//
// Results:
//	The return value is 0 if they are different and 1 if they are the
//	same.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sCompareArrayKeys(tls *libc.TLS, keyPtr uintptr, hPtr uintptr) int32 { /* tclHash.c:758:1: */
	var iPtr1 uintptr = keyPtr
	var iPtr2 uintptr = hPtr + 32
	var tablePtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FtablePtr
	var count int32

	count = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType
__1:
	;
	{
		if count == 0 {
			return 1
		}
		if *(*int32)(unsafe.Pointer(iPtr1)) != *(*int32)(unsafe.Pointer(iPtr2)) {
			goto __3
		}

	}
	goto __2
__2:
	count--
	iPtr1 += 4
	iPtr2 += 4
	goto __1
	goto __3
__3:
	;
	return 0
}

//----------------------------------------------------------------------
//
// HashArrayKey --
//
//	Compute a one-word summary of an array, which can be used to generate
//	a hash index.
//
// Results:
//	The return value is a one-word summary of the information in
//	string.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sHashArrayKey(tls *libc.TLS, tablePtr uintptr, keyPtr uintptr) uint32 { /* tclHash.c:797:1: */
	var array uintptr = keyPtr
	var result uint32
	var count int32

	result = uint32(0)
	count = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType
__1:
	if !(count > 0) {
		goto __3
	}
	{
		result = result + uint32(*(*int32)(unsafe.Pointer(array)))

	}
	goto __2
__2:
	count--
	array += 4
	goto __1
	goto __3
__3:
	;
	return result
}

//----------------------------------------------------------------------
//
// AllocStringEntry --
//
//	Allocate space for a Tcl_HashEntry containing the string key.
//
// Results:
//	The return value is a pointer to the created entry.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sAllocStringEntry(tls *libc.TLS, tablePtr uintptr, keyPtr uintptr) uintptr { /* tclHash.c:828:22: */
	var string uintptr = keyPtr
	var hPtr uintptr
	var size uint32
	var allocsize uint32

	allocsize = libc.AssignUint32(&size, uint32(libc.Xstrlen(tls, string)+uint64(1)))
	if uint64(size) < uint64(unsafe.Sizeof(struct{ FoneWordValue uintptr }{})) {
		allocsize = uint32(unsafe.Sizeof(struct{ FoneWordValue uintptr }{}))
	}
	hPtr = XTcl_Alloc(tls, uint32(int32(uintptr(0)+32))+allocsize)
	libc.Xmemset(tls, hPtr, 0, uint64(unsafe.Sizeof(Tcl_HashEntry{}))+uint64(allocsize)-uint64(unsafe.Sizeof(struct{ FoneWordValue uintptr }{})))
	libc.Xmemcpy(tls, hPtr+32, string, uint64(size))
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(0)
	return hPtr
}

//----------------------------------------------------------------------
//
// CompareStringKeys --
//
//	Compares two string keys.
//
// Results:
//	The return value is 0 if they are different and 1 if they are the
//	same.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sCompareStringKeys(tls *libc.TLS, keyPtr uintptr, hPtr uintptr) int32 { /* tclHash.c:866:1: */
	var p1 uintptr = keyPtr
	var p2 uintptr = hPtr + 32

	return libc.BoolInt32(!(libc.Xstrcmp(tls, p1, p2) != 0))
}

//----------------------------------------------------------------------
//
// HashStringKey --
//
//	Compute a one-word summary of a text string, which can be used to
//	generate a hash index.
//
// Results:
//	The return value is a one-word summary of the information in string.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sHashStringKey(tls *libc.TLS, tablePtr uintptr, keyPtr uintptr) uint32 { /* tclHash.c:894:1: */
	var string uintptr = keyPtr
	var result uint32
	var c int8

	// I tried a zillion different hash functions and asked many other people
	// for advice. Many people had their own favorite functions, all
	// different, but no-one had much idea why they were good ones. I chose
	// the one below (multiply by 9 and add new character) because of the
	// following reasons:
	//
	// 1. Multiplying by 10 is perfect for keys that are decimal strings, and
	//    multiplying by 9 is just about as good.
	// 2. Times-9 is (shift-left-3) plus (old). This means that each
	//    character's bits hang around in the low-order bits of the hash value
	//    for ever, plus they spread fairly rapidly up to the high-order bits
	//    to fill out the hash value. This seems works well both for decimal
	//    and non-decimal strings, but isn't strong against maliciously-chosen
	//    keys.
	//
	// Note that this function is very weak against malicious strings; it's
	// very easy to generate multiple keys that have the same hashcode. On the
	// other hand, that hardly ever actually occurs and this function *is*
	// very cheap, even by comparison with industry-standard hashes like FNV.
	// If real strength of hash is required though, use a custom hash based on
	// Bob Jenkins's lookup3(), but be aware that it's significantly slower.
	// Since Tcl command and namespace names are usually reasonably-named (the
	// main use for string hashes in modern Tcl) speed is far more important
	// than strength.
	//
	// See also HashString in tclLiteral.c.
	// See also TclObjHashKey in tclObj.c.
	//
	// See [tcl-Feature Request #2958832]

	if libc.AssignUint32(&result, uint32(uint8(*(*int8)(unsafe.Pointer(string))))) != uint32(0) {
		for int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(libc.PreIncUintptr(&string, 1))))) != 0 {
			result = result + (result<<3 + uint32(uint8(c)))
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// BogusFind --
//
//	This function is invoked when an Tcl_FindHashEntry is called on a
//	table that has been deleted.
//
// Results:
//	If Tcl_Panic returns (which it shouldn't) this function returns NULL.
//
// Side effects:
//	Generates a panic.
//
//----------------------------------------------------------------------

// ARGSUSED
func sBogusFind(tls *libc.TLS, tablePtr uintptr, key uintptr) uintptr { /* tclHash.c:960:22: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	XTcl_Panic(tls, ts+31805, libc.VaList(bp, ts+31832))
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// BogusCreate --
//
//	This function is invoked when an Tcl_CreateHashEntry is called on a
//	table that has been deleted.
//
// Results:
//	If panic returns (which it shouldn't) this function returns NULL.
//
// Side effects:
//	Generates a panic.
//
//----------------------------------------------------------------------

// ARGSUSED
func sBogusCreate(tls *libc.TLS, tablePtr uintptr, key uintptr, newPtr uintptr) uintptr { /* tclHash.c:987:22: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	XTcl_Panic(tls, ts+31805, libc.VaList(bp, ts+31850))
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// RebuildTable --
//
//	This function is invoked when the ratio of entries to hash buckets
//	becomes too large. It creates a new table with a larger bucket array
//	and moves all of the entries into the new table.
//
// Results:
//	None.
//
// Side effects:
//	Memory gets reallocated and entries get re-hashed to new buckets.
//
//----------------------------------------------------------------------

func sRebuildTable(tls *libc.TLS, tablePtr uintptr) { /* tclHash.c:1018:1: */
	var count int32
	var index int32
	var oldSize int32 = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumBuckets
	var oldBuckets uintptr = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets
	var oldChainPtr uintptr
	var newChainPtr uintptr
	var hPtr uintptr
	var typePtr uintptr

	// Avoid outgrowing capability of the memory allocators
	if oldSize > int32(uint64(uint32(0x7fffffff)*2+1)/(uint64(4)*uint64(unsafe.Sizeof(uintptr(0))))) {
		(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FrebuildSize = 0x7fffffff
		return
	}

	if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == 0 {
		typePtr = uintptr(unsafe.Pointer(&XtclStringHashKeyType))
	} else if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == 1 {
		typePtr = uintptr(unsafe.Pointer(&XtclOneWordHashKeyType))
	} else if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == -2 ||
		(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == -1 {
		typePtr = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FtypePtr
	} else {
		typePtr = uintptr(unsafe.Pointer(&XtclArrayHashKeyType))
	}

	// Allocate and initialize the new bucket array, and set up hashing
	// constants for new array size.

	*(*int32)(unsafe.Pointer(tablePtr + 40)) *= 4
	if (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).Fflags&TCL_HASH_KEY_SYSTEM_HASH != 0 {
		(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets = libc.Xmalloc(tls, Size_t(uint32(uint64((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumBuckets)*uint64(unsafe.Sizeof(uintptr(0))))))
	} else {
		(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets = XTcl_Alloc(tls, uint32(uint64((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumBuckets)*uint64(unsafe.Sizeof(uintptr(0)))))
	}
	count = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FnumBuckets
	newChainPtr = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets
__1:
	if !(count > 0) {
		goto __3
	}
	{
		*(*uintptr)(unsafe.Pointer(newChainPtr)) = uintptr(0)

	}
	goto __2
__2:
	count--
	newChainPtr += 8
	goto __1
	goto __3
__3:
	;
	*(*int32)(unsafe.Pointer(tablePtr + 48)) *= 4
	*(*int32)(unsafe.Pointer(tablePtr + 52)) -= 2
	(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fmask = (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fmask<<2 + 3

	// Rehash all of the existing entries into the new bucket array.

	oldChainPtr = oldBuckets
__4:
	if !(oldSize > 0) {
		goto __6
	}
	{
		for hPtr = *(*uintptr)(unsafe.Pointer(oldChainPtr)); hPtr != uintptr(0); hPtr = *(*uintptr)(unsafe.Pointer(oldChainPtr)) {
			*(*uintptr)(unsafe.Pointer(oldChainPtr)) = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FnextPtr
			if (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).FhashKeyProc == uintptr(0) ||
				(*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).Fflags&TCL_HASH_KEY_RANDOMIZE_HASH != 0 {
				index = int32(int64(int32((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).Fhash)) * 1103515245 >> (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FdownShift & int64((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fmask))
			} else {
				index = int32(uint32((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).Fhash) & uint32((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fmask))
			}
			(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FnextPtr = *(*uintptr)(unsafe.Pointer((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr(index)*8))
			*(*uintptr)(unsafe.Pointer((*Tcl_HashTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr(index)*8)) = hPtr
		}

	}
	goto __5
__5:
	oldSize--
	oldChainPtr += 8
	goto __4
	goto __6
__6:
	;

	// Free up the old bucket array, if it was dynamically allocated.

	if oldBuckets != tablePtr+8 {
		if (*Tcl_HashKeyType)(unsafe.Pointer(typePtr)).Fflags&TCL_HASH_KEY_SYSTEM_HASH != 0 {
			libc.Xfree(tls, oldBuckets)
		} else {
			XTclpFree(tls, oldBuckets)
		}
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Type of the assocData structure used to hold the reference to the [history
// add] subcommand, used in Tcl_RecordAndEvalObj.

type HistoryObjs = struct {
	FhistoryObj uintptr
	FaddObj     uintptr
} /* tclHistory.c:26:3 */

//----------------------------------------------------------------------
//
// Tcl_RecordAndEval --
//
//	This procedure adds its command argument to the current list of
//	recorded events and then executes the command by calling Tcl_Eval.
//
// Results:
//	The return value is a standard Tcl return value, the result of
//	executing cmd.
//
// Side effects:
//	The command is recorded and executed.
//
//----------------------------------------------------------------------

func XTcl_RecordAndEval(tls *libc.TLS, interp uintptr, cmd uintptr, flags int32) int32 { /* tclHistory.c:55:1: */
	var cmdPtr uintptr
	var length int32 = int32(libc.Xstrlen(tls, cmd))
	var result int32

	if length > 0 {
		// Call Tcl_RecordAndEvalObj to do the actual work.

		cmdPtr = XTcl_NewStringObj(tls, cmd, length)
		(*Tcl_Obj)(unsafe.Pointer(cmdPtr)).FrefCount++
		result = XTcl_RecordAndEvalObj(tls, interp, cmdPtr, flags)

		// Move the interpreter's object result to the string result, then
		// reset the object result.

		XTcl_GetStringResult(tls, interp)

		// Discard the Tcl object created to hold the command.

		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = cmdPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	} else {
		// An empty string. Just reset the interpreter's result.

		XTcl_ResetResult(tls, interp)
		result = TCL_OK
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_RecordAndEvalObj --
//
//	This procedure adds the command held in its argument object to the
//	current list of recorded events and then executes the command by
//	calling Tcl_EvalObj.
//
// Results:
//	The return value is a standard Tcl return value, the result of
//	executing the command.
//
// Side effects:
//	The command is recorded and executed.
//
//----------------------------------------------------------------------

func XTcl_RecordAndEvalObj(tls *libc.TLS, interp uintptr, cmdPtr uintptr, flags int32) int32 { /* tclHistory.c:120:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	var result int32
	var call int32 = 1
	// var info Tcl_CmdInfo at bp, 64

	var histObjsPtr uintptr = XTcl_GetAssocData(tls, interp, ts+31870, uintptr(0))

	// Create the references to the [::history add] command if necessary.

	if histObjsPtr == uintptr(0) {
		histObjsPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(HistoryObjs{})))
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					(*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj = XTclThreadAllocObj(tls)
				} else {
					(*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).Fbytes, ts+31889, uint64(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).Fbytes + 9)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).Flength = int32(uint64(unsafe.Sizeof([10]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).FtypePtr = uintptr(0)
			{
			}
		}
		for ok2 := true; ok2; ok2 = 0 != 0 {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					(*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj = XTclThreadAllocObj(tls)
				} else {
					(*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).Fbytes, ts+2077, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).Fbytes + 3)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).FtypePtr = uintptr(0)
			{
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).FrefCount++
		(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).FrefCount++
		XTcl_SetAssocData(tls, interp, ts+31870, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr)
		}{sDeleteHistoryObjs})),
			histObjsPtr)
	}

	// Do not call [history] if it has been replaced by an empty proc

	result = XTcl_GetCommandInfo(tls, interp, ts+31889, bp)
	if result != 0 && (*Tcl_CmdInfo)(unsafe.Pointer(bp)).FdeleteProc == *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{XTclProcDeleteProc})) {
		var procPtr uintptr = (*Tcl_CmdInfo)(unsafe.Pointer(bp /* &info */)).FobjClientData
		call = libc.Bool32((*Command1)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FcmdPtr)).FcompileProc != *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
		}{XTclCompileNoOp})))
	}

	if call != 0 {
		// var list [3]uintptr at bp+64, 24

		// Do recording by eval'ing a tcl history command: history add $cmd.

		*(*uintptr)(unsafe.Pointer(bp + 64)) = (*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj
		*(*uintptr)(unsafe.Pointer(bp + 64 + 1*8)) = (*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj
		*(*uintptr)(unsafe.Pointer(bp + 64 + 2*8)) = cmdPtr

		(*Tcl_Obj)(unsafe.Pointer(cmdPtr)).FrefCount++
		XTcl_EvalObjv(tls, interp, 3, bp+64, TCL_EVAL_GLOBAL)
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr = cmdPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}

		// One possible failure mode above: exceeding a resource limit.

		if XTcl_LimitExceeded(tls, interp) != 0 {
			return TCL_ERROR
		}
	}

	// Execute the command.

	result = TCL_OK
	if !(flags&TCL_NO_EVAL != 0) {
		result = XTcl_EvalObjEx(tls, interp, cmdPtr, flags&TCL_EVAL_GLOBAL)
	}
	return result
}

//----------------------------------------------------------------------
//
// DeleteHistoryObjs --
//
//	Called to delete the references to the constant words used when adding
//	to the history.
//
// Results:
//	None.
//
// Side effects:
//	The constant words may be deleted.
//
//----------------------------------------------------------------------

func sDeleteHistoryObjs(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclHistory.c:213:1: */
	var histObjsPtr uintptr = clientData

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, (*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)
				} else {
					*(*uintptr)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, (*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FhistoryObj)
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)).Flength = -1
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, (*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)
				} else {
					*(*uintptr)(unsafe.Pointer((*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, (*HistoryObjs)(unsafe.Pointer(histObjsPtr)).FaddObj)
		}
	}

	XTclpFree(tls, histObjsPtr)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// tclIO.h --
//
//	This file provides the generic portions (those that are the same on
//	all platforms and for all channel types) of Tcl's IO facilities.
//
// Copyright (c) 1998-2000 Ajuba Solutions
// Copyright (c) 1995-1997 Sun Microsystems, Inc.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// Make sure that both EAGAIN and EWOULDBLOCK are defined. This does not
// compile on systems where neither is defined. We want both defined so that
// we can test safely for both. In the code we still have to test for both
// because there may be systems on which both are defined and have different
// values.

// struct ChannelBuffer:
//
// Buffers data being sent to or from a channel.

type ChannelBuffer1 = struct {
	F__ccgo_pad1 [0]uint64
	FrefCount    int32
	FnextAdded   int32
	FnextRemoved int32
	FbufLength   int32
	FnextPtr     uintptr
} /* tclIO.h:38:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// tclIO.h --
//
//	This file provides the generic portions (those that are the same on
//	all platforms and for all channel types) of Tcl's IO facilities.
//
// Copyright (c) 1998-2000 Ajuba Solutions
// Copyright (c) 1995-1997 Sun Microsystems, Inc.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// Make sure that both EAGAIN and EWOULDBLOCK are defined. This does not
// compile on systems where neither is defined. We want both defined so that
// we can test safely for both. In the code we still have to test for both
// because there may be systems on which both are defined and have different
// values.

// struct ChannelBuffer:
//
// Buffers data being sent to or from a channel.

type ChannelBuffer = ChannelBuffer1 /* tclIO.h:51:3 */

// How much extra space to allocate in buffer to hold bytes from previous
// buffer (when converting to UTF-8) or to hold bytes that will go to next
// buffer (when converting from UTF-8).

// The following defines the *default* buffer size for channels.

// The following structure describes the information saved from a call to
// "fileevent". This is used later when the event being waited for to invoke
// the saved script in the interpreter designed in this record.

type EventScriptRecord1 = struct {
	FchanPtr     uintptr
	FscriptPtr   uintptr
	Finterp      uintptr
	Fmask        int32
	F__ccgo_pad1 [4]byte
	FnextPtr     uintptr
} /* tclIO.h:75:9 */

// How much extra space to allocate in buffer to hold bytes from previous
// buffer (when converting to UTF-8) or to hold bytes that will go to next
// buffer (when converting from UTF-8).

// The following defines the *default* buffer size for channels.

// The following structure describes the information saved from a call to
// "fileevent". This is used later when the event being waited for to invoke
// the saved script in the interpreter designed in this record.

type Channel1 = struct {
	Fstate        uintptr
	FinstanceData ClientData
	FtypePtr      uintptr
	FdownChanPtr  uintptr
	FupChanPtr    uintptr
	FinQueueHead  uintptr
	FinQueueTail  uintptr
	FrefCount     int32
	F__ccgo_pad1  [4]byte
} /* tclIO.h:75:9 */

// How much extra space to allocate in buffer to hold bytes from previous
// buffer (when converting to UTF-8) or to hold bytes that will go to next
// buffer (when converting from UTF-8).

// The following defines the *default* buffer size for channels.

// The following structure describes the information saved from a call to
// "fileevent". This is used later when the event being waited for to invoke
// the saved script in the interpreter designed in this record.

type EventScriptRecord = EventScriptRecord1 /* tclIO.h:86:3 */

// struct Channel:
//
// One of these structures is allocated for each open channel. It contains
// data specific to the channel but which belongs to the generic part of the
// Tcl channel mechanism, and it points at an instance specific (and type
// specific) instance data, and at a channel type structure.

type ChannelState1 = struct {
	FchannelName         uintptr
	Fflags               int32
	F__ccgo_pad1         [4]byte
	Fencoding            Tcl_Encoding
	FinputEncodingState  Tcl_EncodingState
	FinputEncodingFlags  int32
	F__ccgo_pad2         [4]byte
	FoutputEncodingState Tcl_EncodingState
	FoutputEncodingFlags int32
	FinputTranslation    TclEolTranslation
	FoutputTranslation   TclEolTranslation
	FinEofChar           int32
	FoutEofChar          int32
	FunreportedError     int32
	FrefCount            int32
	F__ccgo_pad3         [4]byte
	FcloseCbPtr          uintptr
	FoutputStage         uintptr
	FcurOutPtr           uintptr
	FoutQueueHead        uintptr
	FoutQueueTail        uintptr
	FsaveInBufPtr        uintptr
	FinQueueHead         uintptr
	FinQueueTail         uintptr
	FchPtr               uintptr
	FinterestMask        int32
	F__ccgo_pad4         [4]byte
	FscriptRecordPtr     uintptr
	FbufSize             int32
	F__ccgo_pad5         [4]byte
	Ftimer               Tcl_TimerToken
	FcsPtrR              uintptr
	FcsPtrW              uintptr
	FtopChanPtr          uintptr
	FbottomChanPtr       uintptr
	FnextCSPtr           uintptr
	FmanagingThread      Tcl_ThreadId
	FchanMsg             uintptr
	FunreportedMsg       uintptr
	Fepoch               int32
	F__ccgo_pad6         [4]byte
} /* tclIO.h:75:9 */

// struct Channel:
//
// One of these structures is allocated for each open channel. It contains
// data specific to the channel but which belongs to the generic part of the
// Tcl channel mechanism, and it points at an instance specific (and type
// specific) instance data, and at a channel type structure.

type Channel = Channel1 /* tclIO.h:117:3 */

// struct ChannelState:
//
// One of these structures is allocated for each open channel. It contains
// data specific to the channel but which belongs to the generic part of the
// Tcl channel mechanism, and it points at an instance specific (and type
// specific) instance data, and at a channel type structure.

type CloseCallback1 = struct {
	Fproc       uintptr
	FclientData ClientData
	FnextPtr    uintptr
} /* tclIO.h:75:9 */

// struct ChannelState:
//
// One of these structures is allocated for each open channel. It contains
// data specific to the channel but which belongs to the generic part of the
// Tcl channel mechanism, and it points at an instance specific (and type
// specific) instance data, and at a channel type structure.

type ChannelHandler1 = struct {
	FchanPtr     uintptr
	Fmask        int32
	F__ccgo_pad1 [4]byte
	Fproc        uintptr
	FclientData  ClientData
	FnextPtr     uintptr
} /* tclIO.h:75:9 */

// struct ChannelState:
//
// One of these structures is allocated for each open channel. It contains
// data specific to the channel but which belongs to the generic part of the
// Tcl channel mechanism, and it points at an instance specific (and type
// specific) instance data, and at a channel type structure.

type CopyState1 = struct {
	FreadPtr     uintptr
	FwritePtr    uintptr
	FreadFlags   int32
	FwriteFlags  int32
	FtoRead      Tcl_WideInt
	Ftotal       Tcl_WideInt
	Finterp      uintptr
	FcmdPtr      uintptr
	FbufSize     int32
	Fbuffer      [1]int8
	F__ccgo_pad1 [3]byte
} /* tclIO.h:75:9 */

// struct ChannelState:
//
// One of these structures is allocated for each open channel. It contains
// data specific to the channel but which belongs to the generic part of the
// Tcl channel mechanism, and it points at an instance specific (and type
// specific) instance data, and at a channel type structure.

type ChannelState = ChannelState1 /* tclIO.h:219:3 */

// Values for the flags field in Channel. Any ORed combination of the
// following flags can be stored in the field. These flags record various
// options and state bits about the channel. In addition to the flags below,
// the channel can also have TCL_READABLE (1<<1) and TCL_WRITABLE (1<<2) set.

// The length of time to wait between synthetic timer events. Must be zero or
// bad things tend to happen.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.2 Diagnostics	<assert.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// void assert (int expression);
//
//    If NDEBUG is defined, do nothing.
//    If not, and EXPRESSION is zero, print an error message and abort.

// void assert_perror (int errnum);
//
//    If NDEBUG is defined, do nothing.  If not, and ERRNUM is not zero, print an
//    error message with the error text for ERRNUM and abort.
//    (This is a GNU extension.)

// For each channel handler registered in a call to Tcl_CreateChannelHandler,
// there is one record of the following type. All of records for a specific
// channel are chained together in a singly linked list which is stored in
// the channel structure.

type ChannelHandler = ChannelHandler1 /* tclIO.c:34:3 */

// This structure keeps track of the current ChannelHandler being invoked in
// the current invocation of Tcl_NotifyChannel. There is a potential
// problem if a ChannelHandler is deleted while it is the current one, since
// Tcl_NotifyChannel needs to look at the nextPtr field. To handle this
// problem, structures of the type below indicate the next handler to be
// processed for any (recursively nested) dispatches in progress. The
// nextHandlerPtr field is updated if the handler being pointed to is deleted.
// The nestedHandlerPtr field is used to chain together all recursive
// invocations, so that Tcl_DeleteChannelHandler can find all the recursively
// nested invocations of Tcl_NotifyChannel and compare the handler being
// deleted against the NEXT handler to be invoked in that invocation; when it
// finds such a situation, Tcl_DeleteChannelHandler updates the nextHandlerPtr
// field of the structure to the next handler.

type NextChannelHandler1 = struct {
	FnextHandlerPtr   uintptr
	FnestedHandlerPtr uintptr
} /* tclIO.c:52:9 */

// This structure keeps track of the current ChannelHandler being invoked in
// the current invocation of Tcl_NotifyChannel. There is a potential
// problem if a ChannelHandler is deleted while it is the current one, since
// Tcl_NotifyChannel needs to look at the nextPtr field. To handle this
// problem, structures of the type below indicate the next handler to be
// processed for any (recursively nested) dispatches in progress. The
// nextHandlerPtr field is updated if the handler being pointed to is deleted.
// The nestedHandlerPtr field is used to chain together all recursive
// invocations, so that Tcl_DeleteChannelHandler can find all the recursively
// nested invocations of Tcl_NotifyChannel and compare the handler being
// deleted against the NEXT handler to be invoked in that invocation; when it
// finds such a situation, Tcl_DeleteChannelHandler updates the nextHandlerPtr
// field of the structure to the next handler.

type NextChannelHandler = NextChannelHandler1 /* tclIO.c:58:3 */

// The following structure is used by Tcl_GetsObj() to encapsulates the
// state for a "gets" operation.

type GetsState1 = struct {
	FobjPtr     uintptr
	FdstPtr     uintptr
	Fencoding   Tcl_Encoding
	FbufPtr     uintptr
	Fstate      Tcl_EncodingState
	FrawRead    int32
	FbytesWrote int32
	FcharsWrote int32
	FtotalChars int32
} /* tclIO.c:65:9 */

// The following structure is used by Tcl_GetsObj() to encapsulates the
// state for a "gets" operation.

type GetsState = GetsState1 /* tclIO.c:88:3 */

// The following structure encapsulates the state for a background channel
// copy.  Note that the data buffer for the copy will be appended to this
// structure.

type CopyState = CopyState1 /* tclIO.c:108:3 */

// All static variables used in this file are collected into a single instance
// of the following structure. For multi-threaded implementations, there is
// one instance of this structure for each thread.
//
// Notice that different structures with the same name appear in other files.
// The structure defined below is used in this file only.

type ThreadSpecificData2 = struct {
	FnestedHandlerPtr  uintptr
	FfirstCSPtr        uintptr
	FstdinChannel      Tcl_Channel
	FstdinInitialized  int32
	F__ccgo_pad1       [4]byte
	FstdoutChannel     Tcl_Channel
	FstdoutInitialized int32
	F__ccgo_pad2       [4]byte
	FstderrChannel     Tcl_Channel
	FstderrInitialized int32
	F__ccgo_pad3       [4]byte
	FbinaryEncoding    Tcl_Encoding
} /* tclIO.c:134:3 */

var dataKey2 Tcl_ThreadDataKey /* tclIO.c:136:26: */

// Structure to record a close callback. One such record exists for
// each close callback registered for a channel.

type CloseCallback = CloseCallback1 /* tclIO.c:148:3 */

// Simplifying helper macros. All may use their argument(s) multiple times.
// The ANSI C "prototypes" for the macros are listed below, together with a
// short description of what the macro does.
//
// --------------------------------------------------------------------------
// int BytesLeft(ChannelBuffer *bufPtr)
//
//	Returns the number of bytes of data remaining in the buffer.
//
// int SpaceLeft(ChannelBuffer *bufPtr)
//
//	Returns the number of bytes of space remaining at the end of the
//	buffer.
//
// int IsBufferReady(ChannelBuffer *bufPtr)
//
//	Returns whether a buffer has bytes available within it.
//
// int IsBufferEmpty(ChannelBuffer *bufPtr)
//
//	Returns whether a buffer is entirely empty. Note that this is not the
//	inverse of the above operation; trying to merge the two seems to lead
//	to occasional crashes...
//
// int IsBufferFull(ChannelBuffer *bufPtr)
//
//	Returns whether more data can be added to a buffer.
//
// int IsBufferOverflowing(ChannelBuffer *bufPtr)
//
//	Returns whether a buffer has more data in it than it should.
//
// char *InsertPoint(ChannelBuffer *bufPtr)
//
//	Returns a pointer to where characters should be added to the buffer.
//
// char *RemovePoint(ChannelBuffer *bufPtr)
//
//	Returns a pointer to where characters should be removed from the
//	buffer.
// --------------------------------------------------------------------------

// For working with channel state flag bits.

// Macro for testing whether a string (in optionName, length len) matches a
// value (prefix matching rules). Arguments are the minimum length to match
// and the value to match against. (Can't use Tcl_GetIndexFromObj as this is
// used in a situation where no objects are available.)

// The ChannelObjType type.  Used to store the result of looking up
// a channel name in the context of an interp.  Saves the lookup
// result and values needed to check its continued validity.

type ResolvedChanName1 = struct {
	FstatePtr uintptr
	Finterp   uintptr
	Fepoch    int32
	FrefCount int32
} /* tclIO.c:319:9 */

// Simplifying helper macros. All may use their argument(s) multiple times.
// The ANSI C "prototypes" for the macros are listed below, together with a
// short description of what the macro does.
//
// --------------------------------------------------------------------------
// int BytesLeft(ChannelBuffer *bufPtr)
//
//	Returns the number of bytes of data remaining in the buffer.
//
// int SpaceLeft(ChannelBuffer *bufPtr)
//
//	Returns the number of bytes of space remaining at the end of the
//	buffer.
//
// int IsBufferReady(ChannelBuffer *bufPtr)
//
//	Returns whether a buffer has bytes available within it.
//
// int IsBufferEmpty(ChannelBuffer *bufPtr)
//
//	Returns whether a buffer is entirely empty. Note that this is not the
//	inverse of the above operation; trying to merge the two seems to lead
//	to occasional crashes...
//
// int IsBufferFull(ChannelBuffer *bufPtr)
//
//	Returns whether more data can be added to a buffer.
//
// int IsBufferOverflowing(ChannelBuffer *bufPtr)
//
//	Returns whether a buffer has more data in it than it should.
//
// char *InsertPoint(ChannelBuffer *bufPtr)
//
//	Returns a pointer to where characters should be added to the buffer.
//
// char *RemovePoint(ChannelBuffer *bufPtr)
//
//	Returns a pointer to where characters should be removed from the
//	buffer.
// --------------------------------------------------------------------------

// For working with channel state flag bits.

// Macro for testing whether a string (in optionName, length len) matches a
// value (prefix matching rules). Arguments are the minimum length to match
// and the value to match against. (Can't use Tcl_GetIndexFromObj as this is
// used in a situation where no objects are available.)

// The ChannelObjType type.  Used to store the result of looking up
// a channel name in the context of an interp.  Saves the lookup
// result and values needed to check its continued validity.

type ResolvedChanName = ResolvedChanName1 /* tclIO.c:325:3 */

var chanObjType = Tcl_ObjType{
	Fname:           ts + 31899,
	FfreeIntRepProc: 0, // freeIntRepProc
	FdupIntRepProc:  0, // setFromAnyProc
} /* tclIO.c:330:26 */

//---------------------------------------------------------------------------
//
// ChanClose, ChanRead, ChanSeek, ChanThreadAction, ChanWatch, ChanWrite --
//
//	Simplify the access to selected channel driver "methods" that are used
//	in multiple places in a stereotypical fashion. These are just thin
//	wrappers around the driver functions.
//
//---------------------------------------------------------------------------

func sChanClose(tls *libc.TLS, chanPtr uintptr, interp uintptr) int32 { /* tclIO.c:357:1: */
	if (*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FcloseProc != uintptr(1) {
		return (*struct {
			f func(*libc.TLS, ClientData, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FcloseProc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, interp)
	} else {
		return (*struct {
			f func(*libc.TLS, ClientData, uintptr, int32) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).Fclose2Proc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, interp, 0)
	}
	return int32(0)
}

//---------------------------------------------------------------------------
//
// ChanRead --
//
//	Read up to dstSize bytes using the inputProc of chanPtr, store them at
//	dst, and return the number of bytes stored.
//
// Results:
//	The return value of the driver inputProc,
//	  - number of bytes stored at dst, ot
//	  - -1 on error, with a Posix error code available to the caller by
//	    calling Tcl_GetErrno().
//
// Side effects:
//	The CHANNEL_BLOCKED and CHANNEL_EOF flags of the channel state are set
//	as appropriate.  On EOF, the inputEncodingFlags are set to perform
//	ending operations on decoding.
//
//	TODO - Is this really the right place for that?
//
//---------------------------------------------------------------------------
func sChanRead(tls *libc.TLS, chanPtr uintptr, dst uintptr, dstSize int32) int32 { /* tclIO.c:392:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var bytesRead int32
	// var result int32 at bp, 4

	// If the caller asked for zero bytes, we'd force the inputProc to return
	// zero bytes, and then misinterpret that as EOF.

	// Each read op must set the blocked and eof states anew, not let
	// the effect of prior reads leak through.

	if (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).Fflags&(int32(1)<<9) != 0 {
		*(*int32)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate + 32)) |= TCL_ENCODING_START
	}
	*(*int32)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate + 8)) &= libc.CplInt32(int32(1)<<11 | int32(1)<<9)
	*(*int32)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate + 32)) &= libc.CplInt32(TCL_ENCODING_END)
	if sWillRead(tls, chanPtr) < 0 {
		return -1
	}

	bytesRead = (*struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FinputProc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData,
		dst, dstSize, bp /* &result */)

	// Stop any flag leakage through stacked channel levels.

	if (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).Fflags&(int32(1)<<9) != 0 {
		*(*int32)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate + 32)) |= TCL_ENCODING_START
	}
	*(*int32)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate + 8)) &= libc.CplInt32(int32(1)<<11 | int32(1)<<9)
	*(*int32)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate + 32)) &= libc.CplInt32(TCL_ENCODING_END)
	if bytesRead > 0 {
		// If we get a short read, signal up that we may be BLOCKED. We should
		// avoid calling the driver because on some platforms we will block in
		// the low level reading code even though the channel is set into
		// nonblocking mode.

		if bytesRead < dstSize {
			*(*int32)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate + 8)) |= int32(1) << 11
		}
	} else if bytesRead == 0 {
		*(*int32)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate + 8)) |= int32(1) << 9
		*(*int32)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate + 32)) |= TCL_ENCODING_END
	} else if bytesRead < 0 {
		if *(*int32)(unsafe.Pointer(bp)) == EAGAIN || *(*int32)(unsafe.Pointer(bp)) == EAGAIN {
			*(*int32)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate + 8)) |= int32(1) << 11
			*(*int32)(unsafe.Pointer(bp /* result */)) = EAGAIN
		}
		XTcl_SetErrno(tls, *(*int32)(unsafe.Pointer(bp /* result */)))
	}
	return bytesRead
}

func sChanSeek(tls *libc.TLS, chanPtr uintptr, offset Tcl_WideInt, mode int32, errnoPtr uintptr) Tcl_WideInt { /* tclIO.c:457:1: */
	// Note that we prefer the wideSeekProc if that field is available in the
	// type and non-NULL.

	if XTcl_ChannelWideSeekProc(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr) != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, ClientData, Tcl_WideInt, int32, uintptr) Tcl_WideInt
		})(unsafe.Pointer(&struct{ uintptr }{XTcl_ChannelWideSeekProc(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData,
			offset, mode, errnoPtr)
	}

	if offset < -0x7fffffffffffffff-1 || offset > 0x7fffffffffffffff {
		*(*int32)(unsafe.Pointer(errnoPtr)) = EOVERFLOW
		return int64(-1)
	}

	return int64((*struct {
		f func(*libc.TLS, ClientData, int64, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{XTcl_ChannelSeekProc(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, offset, mode, errnoPtr))
}

func sChanThreadAction(tls *libc.TLS, chanPtr uintptr, action int32) { /* tclIO.c:483:1: */
	var threadActionProc uintptr = XTcl_ChannelThreadActionProc(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)

	if threadActionProc != uintptr(0) {
		(*struct {
			f func(*libc.TLS, ClientData, int32)
		})(unsafe.Pointer(&struct{ uintptr }{threadActionProc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, action)
	}
}

func sChanWatch(tls *libc.TLS, chanPtr uintptr, mask int32) { /* tclIO.c:496:1: */
	(*struct {
		f func(*libc.TLS, ClientData, int32)
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FwatchProc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, mask)
}

func sChanWrite(tls *libc.TLS, chanPtr uintptr, src uintptr, srcLen int32, errnoPtr uintptr) int32 { /* tclIO.c:504:1: */
	return (*struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FoutputProc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, src, srcLen,
		errnoPtr)
}

//---------------------------------------------------------------------------
//
// TclInitIOSubsystem --
//
//	Initialize all resources used by this subsystem on a per-process
//	basis.
//
// Results:
//	None.
//
// Side effects:
//	Depends on the memory subsystems.
//
//---------------------------------------------------------------------------

func XTclInitIOSubsystem(tls *libc.TLS) { /* tclIO.c:532:1: */
	// By fetching thread local storage we take care of allocating it for each
	// thread.

	XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))
}

//-------------------------------------------------------------------------
//
// TclFinalizeIOSubsystem --
//
//	Releases all resources used by this subsystem on a per-process basis.
//	Closes all extant channels that have not already been closed because
//	they were not owned by any interp.
//
// Results:
//	None.
//
// Side effects:
//	Depends on encoding and memory subsystems.
//
//-------------------------------------------------------------------------

// ARGSUSED
func XTclFinalizeIOSubsystem(tls *libc.TLS) { /* tclIO.c:562:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))
	var chanPtr uintptr = uintptr(0) // Iterates over open channels.
	var statePtr uintptr             // State of channel stack
	var active int32 = 1             // Flag == 1 while there's still work to do
	var doflushnb int32

	/*
	 * Fetch the pre-TIP#398 compatibility flag.
	 */

	{
		var s uintptr
		// var ds Tcl_DString at bp, 216

		s = XTclGetEnv(tls, ts+31907, bp)
		doflushnb = libc.Bool32(s != uintptr(0) && libc.Xstrcmp(tls, s, ts+18333) != 0)
		if s != uintptr(0) {
			XTcl_DStringFree(tls, bp)
		}

	}

	// Walk all channel state structures known to this thread and close
	// corresponding channels.

	for active != 0 {
		// Iterate through the open channel list, and find the first channel
		// that isn't dead. We start from the head of the list each time,
		// because the close action on one channel can close others.

		active = 0
		for statePtr = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr; statePtr != uintptr(0); statePtr = (*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr {
			chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr
			if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<13) != 0 {
				continue
			}
			if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<19|int32(1)<<8) != 0) ||
				(*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<7) != 0 {
				*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 7)
				active = 1
				break
			}
		}

		// We've found a live (or bg-closing) channel. Close it.

		if active != 0 {
			XTclChannelPreserve(tls, chanPtr)

			// TIP #398: by default, we no longer set the channel back into
			// blocking mode.  To restore the old blocking behavior, the
			// environment variable TCL_FLUSH_NONBLOCKING_ON_EXIT must be set
			// and not be "0".

			if doflushnb != 0 {
				// Set the channel back into blocking mode to ensure that we
				// wait for all data to flush out.

				XTcl_SetChannelOption(tls, uintptr(0), chanPtr,
					ts+31937, ts+18162)
			}

			if chanPtr == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel || chanPtr == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel || chanPtr == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel {
				// Decrement the refcount which was earlier artificially
				// bumped up to keep the channel from being closed.

				(*ChannelState)(unsafe.Pointer(statePtr)).FrefCount--
			}

			if (*ChannelState)(unsafe.Pointer(statePtr)).FrefCount <= 0 {
				// Close it only if the refcount indicates that the channel is
				// not referenced from any interpreter. If it is, that
				// interpreter will close the channel when it gets destroyed.

				XTcl_Close(tls, uintptr(0), chanPtr)
			} else {
				// The refcount is greater than zero, so flush the channel.

				XTcl_Flush(tls, chanPtr)

				// Call the device driver to actually close the underlying
				// device for this channel.

				sChanClose(tls, chanPtr, uintptr(0))

				// Finally, we clean up the fields in the channel data
				// structure since all of them have been deleted already. We
				// mark the channel with CHANNEL_DEAD to prevent any further
				// IO operations on it.

				(*Channel)(unsafe.Pointer(chanPtr)).FinstanceData = uintptr(0)
				*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 13
			}
			XTclChannelRelease(tls, chanPtr)
		}
	}

	XTclpFinalizeSockets(tls)
	XTclpFinalizePipes(tls)
}

//----------------------------------------------------------------------
//
// Tcl_SetStdChannel --
//
//	This function is used to change the channels that are used for
//	stdin/stdout/stderr in new interpreters.
//
// Results:
//	None
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_SetStdChannel(tls *libc.TLS, channel Tcl_Channel, type1 int32) { /* tclIO.c:706:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))

	var init1 int32
	if channel != 0 {
		init1 = 1
	} else {
		init1 = -1
	}
	switch type1 {
	case int32(1) << 1:
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinInitialized = init1
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel = channel
		break
	case int32(1) << 2:
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutInitialized = init1
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel = channel
		break
	case int32(1) << 3:
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrInitialized = init1
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel = channel
		break
	}
}

//----------------------------------------------------------------------
//
// Tcl_GetStdChannel --
//
//	Returns the specified standard channel.
//
// Results:
//	Returns the specified standard channel, or NULL.
//
// Side effects:
//	May cause the creation of a standard channel and the underlying file.
//
//----------------------------------------------------------------------

func XTcl_GetStdChannel(tls *libc.TLS, type1 int32) Tcl_Channel { /* tclIO.c:746:1: */
	var channel Tcl_Channel = uintptr(0)
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))

	// If the channels were not created yet, create them now and store them in
	// the static variables.

	switch type1 {
	case int32(1) << 1:
		if !((*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinInitialized != 0) {
			(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinInitialized = -1
			(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel = XTclpGetDefaultStdChannel(tls, int32(1)<<1)

			// Artificially bump the refcount to ensure that the channel is
			// only closed on exit.
			//
			// NOTE: Must only do this if stdinChannel is not NULL. It can be
			// NULL in situations where Tcl is unable to connect to the
			// standard input.

			if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel != uintptr(0) {
				(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinInitialized = 1
				XTcl_RegisterChannel(tls, uintptr(0), (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel)
			}
		}
		channel = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel
		break
	case int32(1) << 2:
		if !((*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutInitialized != 0) {
			(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutInitialized = -1
			(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel = XTclpGetDefaultStdChannel(tls, int32(1)<<2)
			if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel != uintptr(0) {
				(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutInitialized = 1
				XTcl_RegisterChannel(tls, uintptr(0), (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel)
			}
		}
		channel = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel
		break
	case int32(1) << 3:
		if !((*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrInitialized != 0) {
			(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrInitialized = -1
			(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel = XTclpGetDefaultStdChannel(tls, int32(1)<<3)
			if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel != uintptr(0) {
				(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrInitialized = 1
				XTcl_RegisterChannel(tls, uintptr(0), (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel)
			}
		}
		channel = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel
		break
	}
	return channel
}

//----------------------------------------------------------------------
//
// Tcl_CreateCloseHandler
//
//	Creates a close callback which will be called when the channel is
//	closed.
//
// Results:
//	None.
//
// Side effects:
//	Causes the callback to be called in the future when the channel will
//	be closed.
//
//----------------------------------------------------------------------

func XTcl_CreateCloseHandler(tls *libc.TLS, chan1 Tcl_Channel, proc uintptr, clientData ClientData) { /* tclIO.c:824:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	var cbPtr uintptr

	cbPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CloseCallback{})))
	(*CloseCallback)(unsafe.Pointer(cbPtr)).Fproc = proc
	(*CloseCallback)(unsafe.Pointer(cbPtr)).FclientData = clientData

	(*CloseCallback)(unsafe.Pointer(cbPtr)).FnextPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FcloseCbPtr
	(*ChannelState)(unsafe.Pointer(statePtr)).FcloseCbPtr = cbPtr
}

//----------------------------------------------------------------------
//
// Tcl_DeleteCloseHandler --
//
//	Removes a callback that would have been called on closing the channel.
//	If there is no matching callback then this function has no effect.
//
// Results:
//	None.
//
// Side effects:
//	The callback will not be called in the future when the channel is
//	eventually closed.
//
//----------------------------------------------------------------------

func XTcl_DeleteCloseHandler(tls *libc.TLS, chan1 Tcl_Channel, proc uintptr, clientData ClientData) { /* tclIO.c:862:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	var cbPtr uintptr
	var cbPrevPtr uintptr

	cbPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FcloseCbPtr
	cbPrevPtr = uintptr(0)
	for ; cbPtr != uintptr(0); cbPtr = (*CloseCallback)(unsafe.Pointer(cbPtr)).FnextPtr {
		if (*CloseCallback)(unsafe.Pointer(cbPtr)).Fproc == proc && (*CloseCallback)(unsafe.Pointer(cbPtr)).FclientData == clientData {
			if cbPrevPtr == uintptr(0) {
				(*ChannelState)(unsafe.Pointer(statePtr)).FcloseCbPtr = (*CloseCallback)(unsafe.Pointer(cbPtr)).FnextPtr
			} else {
				(*CloseCallback)(unsafe.Pointer(cbPrevPtr)).FnextPtr = (*CloseCallback)(unsafe.Pointer(cbPtr)).FnextPtr
			}
			XTclpFree(tls, cbPtr)
			break
		}
		cbPrevPtr = cbPtr
	}
}

//----------------------------------------------------------------------
//
// GetChannelTable --
//
//	Gets and potentially initializes the channel table for an interpreter.
//	If it is initializing the table it also inserts channels for stdin,
//	stdout and stderr if the interpreter is trusted.
//
// Results:
//	A pointer to the hash table created, for use by the caller.
//
// Side effects:
//	Initializes the channel table for an interpreter. May create channels
//	for stdin, stdout and stderr.
//
//----------------------------------------------------------------------

func sGetChannelTable(tls *libc.TLS, interp uintptr) uintptr { /* tclIO.c:907:22: */
	var hTblPtr uintptr // Hash table of channels.
	var stdinChan Tcl_Channel
	var stdoutChan Tcl_Channel
	var stderrChan Tcl_Channel

	hTblPtr = XTcl_GetAssocData(tls, interp, ts+31947, uintptr(0))
	if hTblPtr == uintptr(0) {
		hTblPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
		XTcl_InitHashTable(tls, hTblPtr, 0)
		XTcl_SetAssocData(tls, interp, ts+31947,
			*(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr)
			}{sDeleteChannelTable})), hTblPtr)

		// If the interpreter is trusted (not "safe"), insert channels for
		// stdin, stdout and stderr (possibly creating them in the process).

		if XTcl_IsSafe(tls, interp) == 0 {
			stdinChan = XTcl_GetStdChannel(tls, int32(1)<<1)
			if stdinChan != uintptr(0) {
				XTcl_RegisterChannel(tls, interp, stdinChan)
			}
			stdoutChan = XTcl_GetStdChannel(tls, int32(1)<<2)
			if stdoutChan != uintptr(0) {
				XTcl_RegisterChannel(tls, interp, stdoutChan)
			}
			stderrChan = XTcl_GetStdChannel(tls, int32(1)<<3)
			if stderrChan != uintptr(0) {
				XTcl_RegisterChannel(tls, interp, stderrChan)
			}
		}
	}
	return hTblPtr
}

//----------------------------------------------------------------------
//
// DeleteChannelTable --
//
//	Deletes the channel table for an interpreter, closing any open
//	channels whose refcount reaches zero. This procedure is invoked when
//	an interpreter is deleted, via the AssocData cleanup mechanism.
//
// Results:
//	None.
//
// Side effects:
//	Deletes the hash table of channels. May close channels. May flush
//	output on closed channels. Removes any channeEvent handlers that were
//	registered in this interpreter.
//
//----------------------------------------------------------------------

func sDeleteChannelTable(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclIO.c:965:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var hTblPtr uintptr // The hash table.
	// var hSearch Tcl_HashSearch at bp, 24
	// Search variable.
	var hPtr uintptr     // Search variable.
	var chanPtr uintptr  // Channel being deleted.
	var statePtr uintptr // State of Channel being deleted.
	var sPtr uintptr
	var prevPtr uintptr
	var nextPtr uintptr
	// Variables to loop over all channel events
	// registered, to delete the ones that refer
	// to the interpreter being deleted.

	// Delete all the registered channels - this will close channels whose
	// refcount reaches zero.

	hTblPtr = clientData
	for hPtr = XTcl_FirstHashEntry(tls, hTblPtr, bp); hPtr != uintptr(0); hPtr = XTcl_FirstHashEntry(tls, hTblPtr, bp) {
		chanPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

		// Remove any fileevents registered in this interpreter.

		sPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr
		prevPtr = uintptr(0)
		for ; sPtr != uintptr(0); sPtr = nextPtr {
			nextPtr = (*EventScriptRecord)(unsafe.Pointer(sPtr)).FnextPtr
			if (*EventScriptRecord)(unsafe.Pointer(sPtr)).Finterp == interp {
				if prevPtr == uintptr(0) {
					(*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr = nextPtr
				} else {
					(*EventScriptRecord)(unsafe.Pointer(prevPtr)).FnextPtr = nextPtr
				}

				XTcl_DeleteChannelHandler(tls, chanPtr,
					*(*uintptr)(unsafe.Pointer(&struct {
						f func(*libc.TLS, ClientData, int32)
					}{XTclChannelEventScriptInvoker})), sPtr)

				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).Flength = -1
						for ok := true; ok; ok = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, (*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)
							} else {
								*(*uintptr)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, (*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)
					}
				}

				XTclpFree(tls, sPtr)
			} else {
				prevPtr = sPtr
			}
		}

		// Cannot call Tcl_UnregisterChannel because that procedure calls
		// Tcl_GetAssocData to get the channel table, which might already be
		// inaccessible from the interpreter structure. Instead, we emulate
		// the behavior of Tcl_UnregisterChannel directly here.

		XTcl_DeleteHashEntry(tls, hPtr)
		(*ChannelState)(unsafe.Pointer(statePtr)).Fepoch++
		if libc.PostDecInt32(&(*ChannelState)(unsafe.Pointer(statePtr)).FrefCount, 1) <= 1 {
			if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<7) != 0) {
				XTcl_Close(tls, interp, chanPtr)
			}
		}

	}
	XTcl_DeleteHashTable(tls, hTblPtr)
	XTclpFree(tls, hTblPtr)
}

//----------------------------------------------------------------------
//
// CheckForStdChannelsBeingClosed --
//
//	Perform special handling for standard channels being closed. When
//	given a standard channel, if the refcount is now 1, it means that the
//	last reference to the standard channel is being explicitly closed. Now
//	bump the refcount artificially down to 0, to ensure the normal
//	handling of channels being closed will occur. Also reset the static
//	pointer to the channel to NULL, to avoid dangling references.
//
// Results:
//	None.
//
// Side effects:
//	Manipulates the refcount on standard channels. May smash the global
//	static pointer to a standard channel.
//
//----------------------------------------------------------------------

func sCheckForStdChannelsBeingClosed(tls *libc.TLS, chan1 Tcl_Channel) { /* tclIO.c:1057:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))

	if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinInitialized == 1 &&
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel != uintptr(0) &&
		statePtr == (*Channel)(unsafe.Pointer((*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel)).Fstate {
		if (*ChannelState)(unsafe.Pointer(statePtr)).FrefCount < 2 {
			(*ChannelState)(unsafe.Pointer(statePtr)).FrefCount = 0
			(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel = uintptr(0)
			return
		}
	} else if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutInitialized == 1 &&
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel != uintptr(0) &&
		statePtr == (*Channel)(unsafe.Pointer((*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel)).Fstate {
		if (*ChannelState)(unsafe.Pointer(statePtr)).FrefCount < 2 {
			(*ChannelState)(unsafe.Pointer(statePtr)).FrefCount = 0
			(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel = uintptr(0)
			return
		}
	} else if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrInitialized == 1 &&
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel != uintptr(0) &&
		statePtr == (*Channel)(unsafe.Pointer((*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel)).Fstate {
		if (*ChannelState)(unsafe.Pointer(statePtr)).FrefCount < 2 {
			(*ChannelState)(unsafe.Pointer(statePtr)).FrefCount = 0
			(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel = uintptr(0)
			return
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_IsStandardChannel --
//
//	Test if the given channel is a standard channel. No attempt is made to
//	check if the channel or the standard channels are initialized or
//	otherwise valid.
//
// Results:
//	Returns 1 if true, 0 if false.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_IsStandardChannel(tls *libc.TLS, chan1 Tcl_Channel) int32 { /* tclIO.c:1109:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))

	if chan1 == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel ||
		chan1 == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel ||
		chan1 == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel {
		return 1
	} else {
		return 0
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// Tcl_RegisterChannel --
//
//	Adds an already-open channel to the channel table of an interpreter.
//	If the interpreter passed as argument is NULL, it only increments the
//	channel refCount.
//
// Results:
//	None.
//
// Side effects:
//	May increment the reference count of a channel.
//
//----------------------------------------------------------------------

func XTcl_RegisterChannel(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel) { /* tclIO.c:1142:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var hTblPtr uintptr // Hash table of channels.
	var hPtr uintptr    // Search variable.
	// var isNew int32 at bp, 4
	// Is the hash entry new or does it exist?
	var chanPtr uintptr  // The actual channel.
	var statePtr uintptr // State of the actual channel.

	// Always (un)register bottom-most channel in the stack. This makes
	// management of the channel list easier because no manipulation is
	// necessary during (un)stack operation.

	chanPtr = (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chan1)).Fstate)).FbottomChanPtr
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	if (*ChannelState)(unsafe.Pointer(statePtr)).FchannelName == uintptr(0) {
		XTcl_Panic(tls, ts+31953, 0)
	}
	if interp != uintptr(0) {
		hTblPtr = sGetChannelTable(tls, interp)
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hTblPtr)).FcreateProc})).f(tls, hTblPtr, (*ChannelState)(unsafe.Pointer(statePtr)).FchannelName, bp /* &isNew */)
		if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
			if chan1 == (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData {
				return
			}

			XTcl_Panic(tls, ts+31995, 0)
		}
		(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = chanPtr
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FrefCount++
}

//----------------------------------------------------------------------
//
// Tcl_UnregisterChannel --
//
//	Deletes the hash entry for a channel associated with an interpreter.
//	If the interpreter given as argument is NULL, it only decrements the
//	reference count. (This all happens in the Tcl_DetachChannel helper
//	function).
//
//	Finally, if the reference count of the channel drops to zero, it is
//	deleted.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Calls Tcl_DetachChannel which deletes the hash entry for a channel
//	associated with an interpreter.
//
//	May delete the channel, which can have a variety of consequences,
//	especially if we are forced to close the channel.
//
//----------------------------------------------------------------------

func XTcl_UnregisterChannel(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel) int32 { /* tclIO.c:1207:1: */
	var statePtr uintptr // State of the real channel.

	statePtr = (*Channel)(unsafe.Pointer((*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chan1)).Fstate)).FbottomChanPtr)).Fstate

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<19) != 0 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

				ts+32040, -1))
		}
		return TCL_ERROR
	}

	if sDetachChannel(tls, interp, chan1) != TCL_OK {
		return TCL_OK
	}

	statePtr = (*Channel)(unsafe.Pointer((*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chan1)).Fstate)).FbottomChanPtr)).Fstate

	// Perform special handling for standard channels being closed. If the
	// refCount is now 1 it means that the last reference to the standard
	// channel is being explicitly closed, so bump the refCount down
	// artificially to 0. This will ensure that the channel is actually
	// closed, below. Also set the static pointer to NULL for the channel.

	sCheckForStdChannelsBeingClosed(tls, chan1)

	// If the refCount reached zero, close the actual channel.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FrefCount <= 0 {
		XTcl_Preserve(tls, statePtr)
		if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<7) != 0) {
			// We don't want to re-enter Tcl_Close().

			if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<8) != 0) {
				if XTcl_Close(tls, interp, chan1) != TCL_OK {
					*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 8
					XTcl_Release(tls, statePtr)
					return TCL_ERROR
				}
			}
		}
		*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 8
		XTcl_Release(tls, statePtr)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_DetachChannel --
//
//	Deletes the hash entry for a channel associated with an interpreter.
//	If the interpreter given as argument is NULL, it only decrements the
//	reference count. Even if the ref count drops to zero, the channel is
//	NOT closed or cleaned up. This allows a channel to be detached from an
//	interpreter and left in the same state it was in when it was
//	originally returned by 'Tcl_OpenFileChannel', for example.
//
//	This function cannot be used on the standard channels, and will return
//	TCL_ERROR if that is attempted.
//
//	This function should only be necessary for special purposes in which
//	you need to generate a pristine channel from one that has already been
//	used. All ordinary purposes will almost always want to use
//	Tcl_UnregisterChannel instead.
//
//	Provided the channel is not attached to any other interpreter, it can
//	then be closed with Tcl_Close, rather than with Tcl_UnregisterChannel.
//
// Results:
//	A standard Tcl result. If the channel is not currently registered with
//	the given interpreter, TCL_ERROR is returned, otherwise TCL_OK.
//	However no error messages are left in the interp's result.
//
// Side effects:
//	Deletes the hash entry for a channel associated with an interpreter.
//
//----------------------------------------------------------------------

func XTcl_DetachChannel(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel) int32 { /* tclIO.c:1300:1: */
	if XTcl_IsStandardChannel(tls, chan1) != 0 {
		return TCL_ERROR
	}

	return sDetachChannel(tls, interp, chan1)
}

//----------------------------------------------------------------------
//
// DetachChannel --
//
//	Deletes the hash entry for a channel associated with an interpreter.
//	If the interpreter given as argument is NULL, it only decrements the
//	reference count. Even if the ref count drops to zero, the channel is
//	NOT closed or cleaned up. This allows a channel to be detached from an
//	interpreter and left in the same state it was in when it was
//	originally returned by 'Tcl_OpenFileChannel', for example.
//
// Results:
//	A standard Tcl result. If the channel is not currently registered with
//	the given interpreter, TCL_ERROR is returned, otherwise TCL_OK.
//	However no error messages are left in the interp's result.
//
// Side effects:
//	Deletes the hash entry for a channel associated with an interpreter.
//
//----------------------------------------------------------------------

func sDetachChannel(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel) int32 { /* tclIO.c:1335:1: */
	var hTblPtr uintptr  // Hash table of channels.
	var hPtr uintptr     // Search variable.
	var chanPtr uintptr  // The real IO channel.
	var statePtr uintptr // State of the real channel.

	// Always (un)register bottom-most channel in the stack. This makes
	// management of the channel list easier because no manipulation is
	// necessary during (un)stack operation.

	chanPtr = (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chan1)).Fstate)).FbottomChanPtr
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	if interp != uintptr(0) {
		hTblPtr = XTcl_GetAssocData(tls, interp, ts+31947, uintptr(0))
		if hTblPtr == uintptr(0) {
			return TCL_ERROR
		}
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hTblPtr)).FfindProc})).f(tls, hTblPtr, (*ChannelState)(unsafe.Pointer(statePtr)).FchannelName)
		if hPtr == uintptr(0) {
			return TCL_ERROR
		}
		if (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData != chanPtr {
			return TCL_ERROR
		}
		XTcl_DeleteHashEntry(tls, hPtr)
		(*ChannelState)(unsafe.Pointer(statePtr)).Fepoch++

		// Remove channel handlers that refer to this interpreter, so that
		// they will not be present if the actual close is delayed and more
		// events happen on the channel. This may occur if the channel is
		// shared between several interpreters, or if the channel has async
		// flushing active.

		sCleanupChannelHandlers(tls, interp, chanPtr)
	}

	(*ChannelState)(unsafe.Pointer(statePtr)).FrefCount--

	return TCL_OK
}

//---------------------------------------------------------------------------
//
// Tcl_GetChannel --
//
//	Finds an existing Tcl_Channel structure by name in a given
//	interpreter. This function is public because it is used by
//	channel-type-specific functions.
//
// Results:
//	A Tcl_Channel or NULL on failure. If failed, interp's result object
//	contains an error message. *modePtr is filled with the modes in which
//	the channel was opened.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_GetChannel(tls *libc.TLS, interp uintptr, chanName uintptr, modePtr uintptr) Tcl_Channel { /* tclIO.c:1405:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var chanPtr uintptr // The actual channel.
	var hTblPtr uintptr // Hash table of channels.
	var hPtr uintptr    // Search variable.
	var name uintptr    // Translated name.

	// Substitute "stdin", etc. Note that even though we immediately find the
	// channel using Tcl_GetStdChannel, we still need to look it up in the
	// specified interpreter to ensure that it is present in the channel
	// table. Otherwise, safe interpreters would always have access to the
	// standard channels.

	name = chanName
	if int32(*(*int8)(unsafe.Pointer(chanName))) == 's' && int32(*(*int8)(unsafe.Pointer(chanName + 1))) == 't' {
		chanPtr = uintptr(0)
		if libc.Xstrcmp(tls, chanName, ts+32105) == 0 {
			chanPtr = XTcl_GetStdChannel(tls, int32(1)<<1)
		} else if libc.Xstrcmp(tls, chanName, ts+32111) == 0 {
			chanPtr = XTcl_GetStdChannel(tls, int32(1)<<2)
		} else if libc.Xstrcmp(tls, chanName, ts+32118) == 0 {
			chanPtr = XTcl_GetStdChannel(tls, int32(1)<<3)
		}
		if chanPtr != uintptr(0) {
			name = (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).FchannelName
		}
	}

	hTblPtr = sGetChannelTable(tls, interp)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hTblPtr)).FfindProc})).f(tls, hTblPtr, name)
	if hPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+32125, libc.VaList(bp, chanName)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+32157, chanName, uintptr(0)))
		return uintptr(0)
	}

	// Always return bottom-most channel in the stack. This one lives the
	// longest - other channels may go away unnoticed. The other APIs
	// compensate where necessary to retrieve the topmost channel again.

	chanPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	chanPtr = (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).FbottomChanPtr
	if modePtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(modePtr)) = (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).Fflags & (int32(1)<<1 | int32(1)<<2)
	}

	return chanPtr
}

//---------------------------------------------------------------------------
//
// TclGetChannelFromObj --
//
//	Finds an existing Tcl_Channel structure by name in a given
//	interpreter. This function is public because it is used by
//	channel-type-specific functions.
//
// Results:
//	A Tcl_Channel or NULL on failure. If failed, interp's result object
//	contains an error message. *modePtr is filled with the modes in which
//	the channel was opened.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclGetChannelFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, channelPtr uintptr, modePtr uintptr, flags int32) int32 { /* tclIO.c:1487:1: */
	var statePtr uintptr
	var resPtr uintptr
	var chan1 Tcl_Channel
	resPtr = uintptr(0)
	_ = flags

	if !(interp == uintptr(0)) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&chanObjType))) {
		goto __2
	}
	// Confirm validity of saved lookup results.

	resPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	statePtr = (*ResolvedChanName)(unsafe.Pointer(resPtr)).FstatePtr
	if !((*ResolvedChanName)(unsafe.Pointer(resPtr)).Finterp == interp &&

		(*ResolvedChanName)(unsafe.Pointer(resPtr)).Fepoch == (*ChannelState)(unsafe.Pointer(statePtr)).Fepoch) {
		goto __3
	}
	// Have a valid saved lookup. Jump to end to return it.

	goto valid
__3:
	;
__2:
	;

	chan1 = XTcl_GetChannel(tls, interp, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}(), uintptr(0))

	if !(chan1 == uintptr(0)) {
		goto __4
	}
	if !(resPtr != 0) {
		goto __5
	}
	sFreeChannelInternalRep(tls, objPtr)
__5:
	;
	return TCL_ERROR
__4:
	;

	if !(resPtr != 0 && (*ResolvedChanName)(unsafe.Pointer(resPtr)).FrefCount == 1) {
		goto __6
	}
	// Re-use the ResolvedCmdName struct
	XTcl_Release(tls, (*ResolvedChanName)(unsafe.Pointer(resPtr)).FstatePtr)

	goto __7
__6:
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __8
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __9
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__9:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__8:
	;

	resPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ResolvedChanName{})))
	(*ResolvedChanName)(unsafe.Pointer(resPtr)).FrefCount = 1
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = resPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&chanObjType))
__7:
	;
	statePtr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	(*ResolvedChanName)(unsafe.Pointer(resPtr)).FstatePtr = statePtr
	XTcl_Preserve(tls, statePtr)
	(*ResolvedChanName)(unsafe.Pointer(resPtr)).Finterp = interp
	(*ResolvedChanName)(unsafe.Pointer(resPtr)).Fepoch = (*ChannelState)(unsafe.Pointer(statePtr)).Fepoch

valid:
	*(*Tcl_Channel)(unsafe.Pointer(channelPtr)) = (*ChannelState)(unsafe.Pointer(statePtr)).FbottomChanPtr

	if !(modePtr != uintptr(0)) {
		goto __10
	}
	*(*int32)(unsafe.Pointer(modePtr)) = (*ChannelState)(unsafe.Pointer(statePtr)).Fflags & (int32(1)<<1 | int32(1)<<2)
__10:
	;

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_CreateChannel --
//
//	Creates a new entry in the hash table for a Tcl_Channel record.
//
// Results:
//	Returns the new Tcl_Channel.
//
// Side effects:
//	Creates a new Tcl_Channel instance and inserts it into the hash table.
//
//----------------------------------------------------------------------

func XTcl_CreateChannel(tls *libc.TLS, typePtr uintptr, chanName uintptr, instanceData ClientData, mask int32) Tcl_Channel { /* tclIO.c:1579:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var chanPtr uintptr  // The channel structure newly created.
	var statePtr uintptr // The stack-level independent state info for
	// the channel.
	var name uintptr
	var tmp uintptr
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))

	// With the change of the Tcl_ChannelType structure to use a version in
	// 8.3.2+, we have to make sure that our assumption that the structure
	// remains a binary compatible size is true.
	//
	// If this assertion fails on some system, then it can be removed only if
	// the user recompiles code with older channel drivers in the new system
	// as well.

	if uintptr(0) == (*Tcl_ChannelType)(unsafe.Pointer(typePtr)).FcloseProc {
		XTcl_Panic(tls, ts+32165, libc.VaList(bp, (*Tcl_ChannelType)(unsafe.Pointer(typePtr)).FtypeName))
	}
	if int32(1)<<1&mask != 0 && uintptr(0) == (*Tcl_ChannelType)(unsafe.Pointer(typePtr)).FinputProc {
		XTcl_Panic(tls, ts+32203, libc.VaList(bp+8, (*Tcl_ChannelType)(unsafe.Pointer(typePtr)).FtypeName))
	}
	if int32(1)<<2&mask != 0 && uintptr(0) == (*Tcl_ChannelType)(unsafe.Pointer(typePtr)).FoutputProc {
		XTcl_Panic(tls, ts+32270, libc.VaList(bp+16, (*Tcl_ChannelType)(unsafe.Pointer(typePtr)).FtypeName))
	}
	if uintptr(0) == (*Tcl_ChannelType)(unsafe.Pointer(typePtr)).FwatchProc {
		XTcl_Panic(tls, ts+32338, libc.VaList(bp+24, (*Tcl_ChannelType)(unsafe.Pointer(typePtr)).FtypeName))
	}
	if uintptr(0) != (*Tcl_ChannelType)(unsafe.Pointer(typePtr)).FwideSeekProc && uintptr(0) == (*Tcl_ChannelType)(unsafe.Pointer(typePtr)).FseekProc {
		XTcl_Panic(tls, ts+32376, libc.VaList(bp+32, (*Tcl_ChannelType)(unsafe.Pointer(typePtr)).FtypeName))
	}

	// JH: We could subsequently memset these to 0 to avoid the numerous
	// assignments to 0/NULL below.

	chanPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Channel{})))
	statePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ChannelState{})))
	(*Channel)(unsafe.Pointer(chanPtr)).Fstate = statePtr

	(*Channel)(unsafe.Pointer(chanPtr)).FinstanceData = instanceData
	(*Channel)(unsafe.Pointer(chanPtr)).FtypePtr = typePtr

	// Set all the bits that are part of the stack-independent state
	// information for the channel.

	if chanName != uintptr(0) {
		var len uint32 = uint32(libc.Xstrlen(tls, chanName) + uint64(1))

		// Make sure we allocate at least 7 bytes, so it fits for "stdout"
		// later.

		tmp = XTcl_Alloc(tls, func() uint32 {
			if len < uint32(7) {
				return uint32(7)
			}
			return len
		}())
		libc.Xstrcpy(tls, tmp, chanName)
	} else {
		tmp = XTcl_Alloc(tls, uint32(7))
		*(*int8)(unsafe.Pointer(tmp)) = int8(0)
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FchannelName = tmp
	(*ChannelState)(unsafe.Pointer(statePtr)).Fflags = mask

	// Set the channel to system default encoding.
	//
	// Note the strange bit of protection taking place here. If the system
	// encoding name is reported back as "binary", something weird is
	// happening. Tcl provides no "binary" encoding, so someone else has
	// provided one. We ignore it so as not to interfere with the "magic"
	// interpretation that Tcl_Channels give to the "-encoding binary" option.

	(*ChannelState)(unsafe.Pointer(statePtr)).Fencoding = uintptr(0)
	name = XTcl_GetEncodingName(tls, uintptr(0))
	if libc.Xstrcmp(tls, name, ts+9534) != 0 {
		(*ChannelState)(unsafe.Pointer(statePtr)).Fencoding = XTcl_GetEncoding(tls, uintptr(0), name)
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingState = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags = TCL_ENCODING_START
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutputEncodingState = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutputEncodingFlags = TCL_ENCODING_START

	// Set the channel up initially in AUTO input translation mode to accept
	// "\n", "\r" and "\r\n". Output translation mode is set to a platform
	// specific default value. The eofChar is set to 0 for both input and
	// output, so that Tcl does not look for an in-file EOF indicator (e.g.,
	// ^Z) and does not append an EOF indicator to files.

	(*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation = TCL_TRANSLATE_AUTO
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation = TCL_TRANSLATE_LF
	(*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar = 0
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutEofChar = 0

	(*ChannelState)(unsafe.Pointer(statePtr)).FunreportedError = 0
	(*ChannelState)(unsafe.Pointer(statePtr)).FrefCount = 0
	(*ChannelState)(unsafe.Pointer(statePtr)).FcloseCbPtr = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueTail = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FsaveInBufPtr = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FchPtr = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FinterestMask = 0
	(*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FbufSize = 1024 * 4
	(*ChannelState)(unsafe.Pointer(statePtr)).Ftimer = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutputStage = uintptr(0)

	// As we are creating the channel, it is obviously the top for now.

	(*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr = chanPtr
	(*ChannelState)(unsafe.Pointer(statePtr)).FbottomChanPtr = chanPtr
	(*Channel)(unsafe.Pointer(chanPtr)).FdownChanPtr = uintptr(0)
	(*Channel)(unsafe.Pointer(chanPtr)).FupChanPtr = uintptr(0)
	(*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead = uintptr(0)
	(*Channel)(unsafe.Pointer(chanPtr)).FinQueueTail = uintptr(0)
	(*Channel)(unsafe.Pointer(chanPtr)).FrefCount = 0

	// TIP #219, Tcl Channel Reflection API

	(*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FunreportedMsg = uintptr(0)

	(*ChannelState)(unsafe.Pointer(statePtr)).Fepoch = 0

	// Link the channel into the list of all channels; create an on-exit
	// handler if there is not one already, to close off all the channels in
	// the list on exit.
	//
	// JH: Could call Tcl_SpliceChannel, but need to avoid NULL check.
	//
	// TIP #218.
	// AK: Just initialize the field to NULL before invoking Tcl_SpliceChannel
	//	   We need Tcl_SpliceChannel, for the threadAction calls. There is no
	//	   real reason to duplicate all of this.
	// NOTE: All drivers using thread actions now have to perform their TSD
	//	     manipulation only in their thread action proc. Doing it when
	//	     creating their instance structures will collide with the thread
	//	     action activity and lead to damaged lists.

	(*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr = uintptr(0)
	sSpliceChannel(tls, chanPtr)

	// Install this channel in the first empty standard channel slot, if the
	// channel was previously closed explicitly.

	if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel == uintptr(0) && (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinInitialized == 1 {
		libc.Xstrcpy(tls, tmp, ts+32105)
		XTcl_SetStdChannel(tls, chanPtr, int32(1)<<1)
		XTcl_RegisterChannel(tls, uintptr(0), chanPtr)
	} else if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel == uintptr(0) && (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutInitialized == 1 {
		libc.Xstrcpy(tls, tmp, ts+32111)
		XTcl_SetStdChannel(tls, chanPtr, int32(1)<<2)
		XTcl_RegisterChannel(tls, uintptr(0), chanPtr)
	} else if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel == uintptr(0) && (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrInitialized == 1 {
		libc.Xstrcpy(tls, tmp, ts+32118)
		XTcl_SetStdChannel(tls, chanPtr, int32(1)<<3)
		XTcl_RegisterChannel(tls, uintptr(0), chanPtr)
	}
	return chanPtr
}

//----------------------------------------------------------------------
//
// Tcl_StackChannel --
//
//	Replaces an entry in the hash table for a Tcl_Channel record. The
//	replacement is a new channel with same name, it supercedes the
//	replaced channel. Input and output of the superceded channel is now
//	going through the newly created channel and allows the arbitrary
//	filtering/manipulation of the dataflow.
//
//	Andreas Kupries <a.kupries@westend.com>, 12/13/1998 "Trf-Patch for
//	filtering channels"
//
// Results:
//	Returns the new Tcl_Channel, which actually contains the saved
//	information about prevChan.
//
// Side effects:
//	A new channel structure is allocated and linked below the existing
//	channel. The channel operations and client data of the existing
//	channel are copied down to the newly created channel, and the current
//	channel has its operations replaced by the new typePtr.
//
//----------------------------------------------------------------------

func XTcl_StackChannel(tls *libc.TLS, interp uintptr, typePtr uintptr, instanceData ClientData, mask int32, prevChan Tcl_Channel) Tcl_Channel { /* tclIO.c:1798:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))
	var chanPtr uintptr
	var prevChanPtr uintptr
	var statePtr uintptr

	// Find the given channel (prevChan) in the list of all channels. If we do
	// not find it, then it was never registered correctly.
	//
	// This operation should occur at the top of a channel stack.

	statePtr = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr
	prevChanPtr = (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(prevChan)).Fstate)).FtopChanPtr

	for statePtr != uintptr(0) && (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr != prevChanPtr {
		statePtr = (*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr
	}

	if statePtr == uintptr(0) {
		if interp != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+32438,
				libc.VaList(bp, XTcl_GetChannelName(tls, prevChan))))
		}
		return uintptr(0)
	}

	// Here we check if the given "mask" matches the "flags" of the already
	// existing channel.
	//
	//	  | - | R | W | RW |
	//	--+---+---+---+----+	<=>  0 != (chan->mask & prevChan->mask)
	//	- |   |   |   |    |
	//	R |   | + |   | +  |	The superceding channel is allowed to restrict
	//	W |   |   | + | +  |	the capabilities of the superceded one!
	//	RW|   | + | + | +  |
	//	--+---+---+---+----+

	if mask&((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1|int32(1)<<2)) == 0 {
		if interp != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+32475,
				libc.VaList(bp+8, XTcl_GetChannelName(tls, prevChan))))
		}
		return uintptr(0)
	}

	// Flush the buffers. This ensures that any data still in them at this
	// time is not handled by the new transformation. Restrict this to
	// writable channels. Take care to hide a possible bg-copy in progress
	// from Tcl_Flush and the CheckForChannelErrors inside.

	if mask&(int32(1)<<2) != 0 {
		var csPtrR uintptr = (*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR
		var csPtrW uintptr = (*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW

		(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR = uintptr(0)
		(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW = uintptr(0)

		// TODO: Examine what can go wrong if Tcl_Flush() call disturbs
		// the stacking state of this channel during its operations.
		if XTcl_Flush(tls, prevChanPtr) != TCL_OK {
			(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR = csPtrR
			(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW = csPtrW
			if interp != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+32528,
					libc.VaList(bp+16, XTcl_GetChannelName(tls, prevChan))))
			}
			return uintptr(0)
		}

		(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR = csPtrR
		(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW = csPtrW
	}

	// Discard any input in the buffers. They are not yet read by the user of
	// the channel, so they have to go through the new transformation before
	// reading. As the buffers contain the untransformed form their contents
	// are not only useless but actually distorts our view of the system.
	//
	// To preserve the information without having to read them again and to
	// avoid problems with the location in the channel (seeking might be
	// impossible) we move the buffers from the common state structure into
	// the channel itself. We use the buffers in the channel below the new
	// transformation to hold the data. In the future this allows us to write
	// transformations which pre-read data and push the unused part back when
	// they are going away.

	if mask&(int32(1)<<1) != 0 && (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead != uintptr(0) {
		// When statePtr->inQueueHead is not NULL, we know
		// prevChanPtr->inQueueHead must be NULL.

		(*Channel)(unsafe.Pointer(prevChanPtr)).FinQueueHead = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
		(*Channel)(unsafe.Pointer(prevChanPtr)).FinQueueTail = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail

		(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = uintptr(0)
		(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = uintptr(0)
	}

	chanPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Channel{})))

	// Save some of the current state into the new structure, reinitialize the
	// parts which will stay with the transformation.
	//
	// Remarks:

	(*Channel)(unsafe.Pointer(chanPtr)).Fstate = statePtr
	(*Channel)(unsafe.Pointer(chanPtr)).FinstanceData = instanceData
	(*Channel)(unsafe.Pointer(chanPtr)).FtypePtr = typePtr
	(*Channel)(unsafe.Pointer(chanPtr)).FdownChanPtr = prevChanPtr
	(*Channel)(unsafe.Pointer(chanPtr)).FupChanPtr = uintptr(0)
	(*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead = uintptr(0)
	(*Channel)(unsafe.Pointer(chanPtr)).FinQueueTail = uintptr(0)
	(*Channel)(unsafe.Pointer(chanPtr)).FrefCount = 0

	// Place new block at the head of a possibly existing list of previously
	// stacked channels.

	(*Channel)(unsafe.Pointer(prevChanPtr)).FupChanPtr = chanPtr
	(*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr = chanPtr

	// TIP #218, Channel Thread Actions.
	//
	// We call the thread actions for the new channel directly. We _cannot_
	// use SpliceChannel, because the (thread-)global list of all channels
	// always contains the _ChannelState_ for a stack of channels, not the
	// individual channels. And SpliceChannel would not only call the thread
	// actions, but also add the shared ChannelState to this list a second
	// time, mangling it.

	sChanThreadAction(tls, chanPtr, 0)

	return chanPtr
}

func XTclChannelPreserve(tls *libc.TLS, chan1 Tcl_Channel) { /* tclIO.c:1965:1: */
	(*Channel)(unsafe.Pointer(chan1)).FrefCount++
}

func XTclChannelRelease(tls *libc.TLS, chan1 Tcl_Channel) { /* tclIO.c:1972:1: */
	var chanPtr uintptr = chan1

	if (*Channel)(unsafe.Pointer(chanPtr)).FrefCount == 0 {
		XTcl_Panic(tls, ts+32557, 0)
	}
	if libc.PreDecInt32(&(*Channel)(unsafe.Pointer(chanPtr)).FrefCount, 1) != 0 {
		return
	}
	if (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr == uintptr(0) {
		XTclpFree(tls, chanPtr)
	}
}

func sChannelFree(tls *libc.TLS, chanPtr uintptr) { /* tclIO.c:1989:1: */
	if (*Channel)(unsafe.Pointer(chanPtr)).FrefCount == 0 {
		XTclpFree(tls, chanPtr)
		return
	}
	(*Channel)(unsafe.Pointer(chanPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_UnstackChannel --
//
//	Unstacks an entry in the hash table for a Tcl_Channel record. This is
//	the reverse to 'Tcl_StackChannel'.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	If TCL_ERROR is returned, the posix error code will be set with
//	Tcl_SetErrno. May leave a message in interp result as well.
//
//----------------------------------------------------------------------

func XTcl_UnstackChannel(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel) int32 { /* tclIO.c:2018:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var chanPtr uintptr = chan1
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	var result int32 = 0

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	if (*Channel)(unsafe.Pointer(chanPtr)).FdownChanPtr != uintptr(0) {
		// Instead of manipulating the per-thread / per-interp list/hashtable
		// of registered channels we wind down the state of the
		// transformation, and then restore the state of underlying channel
		// into the old structure.
		//
		// TODO: Figure out how to handle the situation where the chan
		// operations called below by this unstacking operation cause
		// another unstacking recursively.  In that case the downChanPtr
		// value we're holding on to will not be the right thing.

		var downChanPtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).FdownChanPtr

		// Flush the buffers. This ensures that any data still in them at this
		// time _is_ handled by the transformation we are unstacking right
		// now. Restrict this to writable channels. Take care to hide a
		// possible bg-copy in progress from Tcl_Flush and the
		// CheckForChannelErrors inside.

		if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<2) != 0 {
			var csPtrR uintptr = (*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR
			var csPtrW uintptr = (*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW

			(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR = uintptr(0)
			(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW = uintptr(0)

			if XTcl_Flush(tls, chanPtr) != TCL_OK {
				(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR = csPtrR
				(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW = csPtrW

				// TIP #219, Tcl Channel Reflection API.
				// Move error messages put by the driver into the chan/ip
				// bypass area into the regular interpreter result. Fall back
				// to the regular message if nothing was found in the
				// bypasses.

				if !(XTclChanCaughtErrorBypass(tls, interp, chan1) != 0) && interp != 0 {
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
						ts+32528,
						libc.VaList(bp, XTcl_GetChannelName(tls, chanPtr))))
				}
				return TCL_ERROR
			}

			(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR = csPtrR
			(*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW = csPtrW
		}

		// Anything in the input queue and the push-back buffers of the
		// transformation going away is transformed data, but not yet read. As
		// unstacking means that the caller does not want to see transformed
		// data any more we have to discard these bytes. To avoid writing an
		// analogue to 'DiscardInputQueued' we move the information in the
		// push back buffers to the input queue and then call
		// 'DiscardInputQueued' on that.

		if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0 && ((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead != uintptr(0) || (*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead != uintptr(0)) {
			if (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead != uintptr(0) && (*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead != uintptr(0) {
				(*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail)).FnextPtr = (*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead
				(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = (*Channel)(unsafe.Pointer(chanPtr)).FinQueueTail
				(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail
			} else if (*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead != uintptr(0) {
				(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = (*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead
				(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = (*Channel)(unsafe.Pointer(chanPtr)).FinQueueTail
			}

			(*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead = uintptr(0)
			(*Channel)(unsafe.Pointer(chanPtr)).FinQueueTail = uintptr(0)

			sDiscardInputQueued(tls, statePtr, 0)
		}

		// TIP #218, Channel Thread Actions.
		//
		// We call the thread actions for the new channel directly. We
		// _cannot_ use CutChannel, because the (thread-)global list of all
		// channels always contains the _ChannelState_ for a stack of
		// channels, not the individual channels. And SpliceChannel would not
		// only call the thread actions, but also remove the shared
		// ChannelState from this list despite there being more channels for
		// the state which are still active.

		sChanThreadAction(tls, chanPtr, 1)

		(*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr = downChanPtr
		(*Channel)(unsafe.Pointer(downChanPtr)).FupChanPtr = uintptr(0)

		// Leave this link intact for closeproc
		//  chanPtr->downChanPtr = NULL;

		// Close and free the channel driver state.

		result = sChanClose(tls, chanPtr, interp)
		sChannelFree(tls, chanPtr)

		sUpdateInterest(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr)

		if result != 0 {
			XTcl_SetErrno(tls, result)

			// TIP #219, Tcl Channel Reflection API.
			// Move error messages put by the driver into the chan/ip bypass
			// area into the regular interpreter result.

			XTclChanCaughtErrorBypass(tls, interp, chan1)
			return TCL_ERROR
		}
	} else {
		// This channel does not cover another one. Simply do a close, if
		// necessary.

		if (*ChannelState)(unsafe.Pointer(statePtr)).FrefCount <= 0 {
			if XTcl_Close(tls, interp, chan1) != TCL_OK {
				// TIP #219, Tcl Channel Reflection API.
				// "TclChanCaughtErrorBypass" is not required here, it was
				// done already by "Tcl_Close".

				return TCL_ERROR
			}
		}

		// TIP #218, Channel Thread Actions.
		// Not required in this branch, this is done by Tcl_Close. If
		// Tcl_Close is not called then the ChannelState is still active in
		// the thread and no action has to be taken either.
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetStackedChannel --
//
//	Determines whether the specified channel is stacked upon another.
//
// Results:
//	NULL if the channel is not stacked upon another one, or a reference to
//	the channel it is stacked upon. This reference can be used in queries,
//	but modification is not allowed.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetStackedChannel(tls *libc.TLS, chan1 Tcl_Channel) Tcl_Channel { /* tclIO.c:2206:1: */
	var chanPtr uintptr = chan1
	// The actual channel.

	return (*Channel)(unsafe.Pointer(chanPtr)).FdownChanPtr
}

//----------------------------------------------------------------------
//
// Tcl_GetTopChannel --
//
//	Returns the top channel of a channel stack.
//
// Results:
//	NULL if the channel is not stacked upon another one, or a reference to
//	the channel it is stacked upon. This reference can be used in queries,
//	but modification is not allowed.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetTopChannel(tls *libc.TLS, chan1 Tcl_Channel) Tcl_Channel { /* tclIO.c:2234:1: */
	var chanPtr uintptr = chan1
	// The actual channel.

	return (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).FtopChanPtr
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelInstanceData --
//
//	Returns the client data associated with a channel.
//
// Results:
//	The client data.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetChannelInstanceData(tls *libc.TLS, chan1 Tcl_Channel) ClientData { /* tclIO.c:2260:1: */
	var chanPtr uintptr = chan1
	// The actual channel.

	return (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelThread --
//
//	Given a channel structure, returns the thread managing it. TIP #10
//
// Results:
//	Returns the id of the thread managing the channel.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetChannelThread(tls *libc.TLS, chan1 Tcl_Channel) Tcl_ThreadId { /* tclIO.c:2286:1: */
	var chanPtr uintptr = chan1
	// The actual channel.

	return (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).FmanagingThread
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelType --
//
//	Given a channel structure, returns the channel type structure.
//
// Results:
//	Returns a pointer to the channel type structure.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetChannelType(tls *libc.TLS, chan1 Tcl_Channel) uintptr { /* tclIO.c:2312:23: */
	var chanPtr uintptr = chan1
	// The actual channel.

	return (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelMode --
//
//	Computes a mask indicating whether the channel is open for reading and
//	writing.
//
// Results:
//	An OR-ed combination of TCL_READABLE and TCL_WRITABLE.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetChannelMode(tls *libc.TLS, chan1 Tcl_Channel) int32 { /* tclIO.c:2340:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	// State of actual channel.

	return (*ChannelState)(unsafe.Pointer(statePtr)).Fflags & (int32(1)<<1 | int32(1)<<2)
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelName --
//
//	Returns the string identifying the channel name.
//
// Results:
//	The string containing the channel name. This memory is owned by the
//	generic layer and should not be modified by the caller.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetChannelName(tls *libc.TLS, chan1 Tcl_Channel) uintptr { /* tclIO.c:2367:12: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	// State of actual channel.

	return (*ChannelState)(unsafe.Pointer(statePtr)).FchannelName
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelHandle --
//
//	Returns an OS handle associated with a channel.
//
// Results:
//	Returns TCL_OK and places the handle in handlePtr, or returns
//	TCL_ERROR on failure.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetChannelHandle(tls *libc.TLS, chan1 Tcl_Channel, direction int32, handlePtr uintptr) int32 { /* tclIO.c:2395:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var chanPtr uintptr // The actual channel.
	// var handle ClientData at bp+8, 8

	var result int32

	chanPtr = (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chan1)).Fstate)).FbottomChanPtr
	if !(int32((*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FgetHandleProc) != 0) {
		XTcl_SetChannelError(tls, chan1, XTcl_ObjPrintf(tls,
			ts+32594,
			libc.VaList(bp, XTcl_GetChannelName(tls, chan1))))
		return TCL_ERROR
	}
	result = (*struct {
		f func(*libc.TLS, ClientData, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FgetHandleProc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, direction,
		bp+8)
	if handlePtr != 0 {
		*(*ClientData)(unsafe.Pointer(handlePtr)) = *(*ClientData)(unsafe.Pointer(bp + 8 /* handle */))
	}
	return result
}

//---------------------------------------------------------------------------
//
// AllocChannelBuffer --
//
//	A channel buffer has BUFFER_PADDING bytes extra at beginning to hold
//	any bytes of a native-encoding character that got split by the end of
//	the previous buffer and need to be moved to the beginning of the next
//	buffer to make a contiguous string so it can be converted to UTF-8.
//
//	A channel buffer has BUFFER_PADDING bytes extra at the end to hold any
//	bytes of a native-encoding character (generated from a UTF-8
//	character) that overflow past the end of the buffer and need to be
//	moved to the next buffer.
//
// Results:
//	A newly allocated channel buffer.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sAllocChannelBuffer(tls *libc.TLS, length int32) uintptr { /* tclIO.c:2443:22: */
	var bufPtr uintptr
	var n int32

	n = length + int32(uintptr(0)+24) + BUFFER_PADDING + BUFFER_PADDING
	bufPtr = XTcl_Alloc(tls, uint32(n))
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded = BUFFER_PADDING
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved = BUFFER_PADDING
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength = length + BUFFER_PADDING
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr = uintptr(0)
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FrefCount = 1
	return bufPtr
}

func sPreserveChannelBuffer(tls *libc.TLS, bufPtr uintptr) { /* tclIO.c:2461:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FrefCount == 0 {
		XTcl_Panic(tls, ts+32635, libc.VaList(bp, bufPtr))
	}
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FrefCount++
}

func sReleaseChannelBuffer(tls *libc.TLS, bufPtr uintptr) { /* tclIO.c:2471:1: */
	if libc.PreDecInt32(&(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FrefCount, 1) != 0 {
		return
	}
	XTclpFree(tls, bufPtr)
}

func sIsShared(tls *libc.TLS, bufPtr uintptr) int32 { /* tclIO.c:2481:1: */
	return libc.Bool32((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FrefCount > 1)
}

//----------------------------------------------------------------------
//
// RecycleBuffer --
//
//	Helper function to recycle input and output buffers. Ensures that two
//	input buffers are saved (one in the input queue and another in the
//	saveInBufPtr field) and that curOutPtr is set to a buffer. Only if
//	these conditions are met is the buffer freed to the OS.
//
// Results:
//	None.
//
// Side effects:
//	May free a buffer to the OS.
//
//----------------------------------------------------------------------

func sRecycleBuffer(tls *libc.TLS, statePtr uintptr, bufPtr uintptr, mustDiscard int32) { /* tclIO.c:2507:1: */
	// Do we have to free the buffer to the OS?

	if !(sIsShared(tls, bufPtr) != 0) {
		goto __1
	}
	mustDiscard = 1
__1:
	;

	if !(mustDiscard != 0) {
		goto __2
	}
	sReleaseChannelBuffer(tls, bufPtr)
	return
__2:
	;

	// Only save buffers which have the requested buffersize for the channel.
	// This is to honor dynamic changes of the buffersize made by the user.

	if !((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength-BUFFER_PADDING != (*ChannelState)(unsafe.Pointer(statePtr)).FbufSize) {
		goto __3
	}
	sReleaseChannelBuffer(tls, bufPtr)
	return
__3:
	;

	// Only save buffers for the input queue if the channel is readable.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0) {
		goto __4
	}
	if !((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead == uintptr(0)) {
		goto __5
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = bufPtr
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = bufPtr
	goto keepBuffer
__5:
	;
	if !((*ChannelState)(unsafe.Pointer(statePtr)).FsaveInBufPtr == uintptr(0)) {
		goto __6
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FsaveInBufPtr = bufPtr
	goto keepBuffer
__6:
	;
__4:
	;

	// Only save buffers for the output queue if the channel is writable.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<2) != 0) {
		goto __7
	}
	if !((*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr == uintptr(0)) {
		goto __8
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr = bufPtr
	goto keepBuffer
__8:
	;
__7:
	;

	// If we reached this code we return the buffer to the OS.

	sReleaseChannelBuffer(tls, bufPtr)
	return

keepBuffer:
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved = BUFFER_PADDING
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded = BUFFER_PADDING
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// DiscardOutputQueued --
//
//	Discards all output queued in the output queue of a channel.
//
// Results:
//	None.
//
// Side effects:
//	Recycles buffers.
//
//----------------------------------------------------------------------

func sDiscardOutputQueued(tls *libc.TLS, statePtr uintptr) { /* tclIO.c:2593:1: */
	var bufPtr uintptr

	for (*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead != uintptr(0) {
		bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead
		(*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
		sRecycleBuffer(tls, statePtr, bufPtr, 0)
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueTail = uintptr(0)
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr
	if bufPtr != 0 && (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded-(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved != 0 {
		(*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr = uintptr(0)
		sRecycleBuffer(tls, statePtr, bufPtr, 0)
	}
}

//----------------------------------------------------------------------
//
// CheckForDeadChannel --
//
//	This function checks is a given channel is Dead (a channel that has
//	been closed but not yet deallocated.)
//
// Results:
//	True (1) if channel is Dead, False (0) if channel is Ok
//
// Side effects:
//	None
//
//----------------------------------------------------------------------

func sCheckForDeadChannel(tls *libc.TLS, interp uintptr, statePtr uintptr) int32 { /* tclIO.c:2630:1: */
	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<13) != 0) {
		return 0
	}

	XTcl_SetErrno(tls, EINVAL)
	if interp != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+32662, -1))
	}
	return 1
}

//----------------------------------------------------------------------
//
// FlushChannel --
//
//	This function flushes as much of the queued output as is possible now.
//	If calledFromAsyncFlush is nonzero, it is being called in an event
//	handler to flush channel output asynchronously.
//
// Results:
//	0 if successful, else the error code that was returned by the channel
//	type operation. May leave a message in the interp result.
//
// Side effects:
//	May produce output on a channel. May block indefinitely if the channel
//	is synchronous. May schedule an async flush on the channel. May
//	recycle memory for buffers in the output queue.
//
//----------------------------------------------------------------------

func sFlushChannel(tls *libc.TLS, interp uintptr, chanPtr uintptr, calledFromAsyncFlush int32) int32 { /* tclIO.c:2668:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var statePtr uintptr
	// State of the channel stack.
	var bufPtr uintptr // Iterates over buffered output queue.
	var written int32  // Amount of output data actually written in
	// current round.
	// var errorCode int32 at bp, 4
	// Stores POSIX error codes from channel
	// driver operations.
	var wroteSome int32
	var cachePtr uintptr
	// TIP #219, Tcl Channel Reflection API.
	// When defering the error copy a message from the bypass into
	// the unreported area. Or discard it if the new error is to
	// be ignored in favor of an earlier defered error.

	var msg uintptr
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	*(*int32)(unsafe.Pointer(bp /* errorCode */)) = 0
	wroteSome = 0 // Set to one if any data was written to the
	// driver.

	// Prevent writing on a dead channel -- a channel that has been closed but
	// not yet deallocated. This can occur if the exit handler for the channel
	// deallocation runs before all channels are deregistered in all
	// interpreters.

	if !(sCheckForDeadChannel(tls, interp, statePtr) != 0) {
		goto __1
	}
	return -1
__1:
	;

	// Should we shift the current output buffer over to the output queue?
	// First check that there are bytes in it.  If so then...
	//
	// If the output queue is empty, then yes, trusting the caller called us
	// only when written bytes ought to be flushed.
	//
	// If the current output buffer is full, then yes, so we can meet the
	// post-condition that on a successful return to caller we've left space
	// in the current output buffer for more writing (the flush call was to
	// make new room).
	//
	// If the channel is blocking, then yes, so we guarantee that blocking
	// flushes actually flush all pending data.
	//
	// Otherwise, no.  Keep the current output buffer where it is so more
	// can be written to it, possibly filling it, to promote more efficient
	// buffer usage.

	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr
	if !(bufPtr != 0 && (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded-(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved != 0 && ((*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead == uintptr(0) || bufPtr != 0 && (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded >= (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength ||
		!((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<3) != 0))) {
		goto __2
	}
	if !((*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead == uintptr(0)) {
		goto __3
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead = bufPtr
	goto __4
__3:
	(*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueTail)).FnextPtr = bufPtr
__4:
	;
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueTail = bufPtr
	(*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr = uintptr(0)
__2:
	;

	// If we are not being called from an async flush and an async flush
	// is active, we just return without producing any output.

	if !(!(calledFromAsyncFlush != 0) && (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<7) != 0) {
		goto __5
	}
	return 0
__5:
	;

	// Loop over the queued buffers and attempt to flush as much as possible
	// of the queued output to the channel.

	XTclChannelPreserve(tls, chanPtr)
__6:
	if !((*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead != 0) {
		goto __7
	}
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead

	// Produce the output on the channel.

	sPreserveChannelBuffer(tls, bufPtr)
	written = sChanWrite(tls, chanPtr, bufPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved), (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded-(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved,
		bp)

	// If the write failed completely attempt to start the asynchronous
	// flush mechanism and break out of this loop - do not attempt to
	// write any more output at this time.

	if !(written < 0) {
		goto __8
	}
	// If the last attempt to write was interrupted, simply retry.

	if !(*(*int32)(unsafe.Pointer(bp)) == EINTR) {
		goto __10
	}
	*(*int32)(unsafe.Pointer(bp /* errorCode */)) = 0
	sReleaseChannelBuffer(tls, bufPtr)
	goto __6
__10:
	;

	// If the channel is non-blocking and we would have blocked, start
	// a background flushing handler and break out of the loop.

	if !(*(*int32)(unsafe.Pointer(bp)) == EAGAIN || *(*int32)(unsafe.Pointer(bp)) == EAGAIN) {
		goto __11
	}
	// This used to check for CHANNEL_NONBLOCKING, and panic if
	// the channel was blocking. However, it appears that setting
	// stdin to -blocking 0 has some effect on the stdout when
	// it's a tty channel (dup'ed underneath)

	if !(!((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<7) != 0) && !(XTclInExit(tls) != 0)) {
		goto __12
	}
	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 7
	sUpdateInterest(tls, chanPtr)
__12:
	;
	*(*int32)(unsafe.Pointer(bp /* errorCode */)) = 0
	sReleaseChannelBuffer(tls, bufPtr)
	goto __7
__11:
	;

	// Decide whether to report the error upwards or defer it.

	if !(calledFromAsyncFlush != 0) {
		goto __13
	}
	// TIP #219, Tcl Channel Reflection API.
	// When defering the error copy a message from the bypass into
	// the unreported area. Or discard it if the new error is to
	// be ignored in favor of an earlier defered error.

	msg = (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg

	if !((*ChannelState)(unsafe.Pointer(statePtr)).FunreportedError == 0) {
		goto __15
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FunreportedError = *(*int32)(unsafe.Pointer(bp /* errorCode */))
	(*ChannelState)(unsafe.Pointer(statePtr)).FunreportedMsg = msg
	if !(msg != uintptr(0)) {
		goto __17
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount++
__17:
	;
	goto __16
__15:
	// An old unreported error is kept, and this error thrown
	// away.

	(*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg = uintptr(0)
	if !(msg != uintptr(0)) {
		goto __18
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount, 1) > 1) {
		goto __19
	}
	goto __20
__19:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __21
	}

	if !((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes != XtclEmptyStringRep) {
		goto __23
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes)
__23:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = -1
__24:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __27
	}
	XTclThreadFreeObj(tls, msg)
	goto __28
__27:
	*(*uintptr)(unsafe.Pointer(msg + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = msg
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__28:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
	goto __22
__21:
	XTclFreeObj(tls, msg)
__22:
	;
__20:
	;

__18:
	;
__16:
	;
	goto __14
__13:
	// TIP #219, Tcl Channel Reflection API.
	// Move error messages put by the driver into the chan bypass
	// area into the regular interpreter result. Fall back to the
	// regular message if nothing was found in the bypasses.

	XTcl_SetErrno(tls, *(*int32)(unsafe.Pointer(bp /* errorCode */)))
	if !(interp != uintptr(0) && !(XTclChanCaughtErrorBypass(tls, interp,
		chanPtr) != 0)) {
		goto __29
	}
	XTcl_SetObjResult(tls, interp,
		XTcl_NewStringObj(tls, XTcl_PosixError(tls, interp), -1))
__29:
	;

	// An unreportable bypassed message is kept, for the caller of
	// Tcl_Seek, Tcl_Write, etc.
__14:
	;

	// When we get an error we throw away all the output currently
	// queued.

	sDiscardOutputQueued(tls, statePtr)
	sReleaseChannelBuffer(tls, bufPtr)
	goto __7
	goto __9
__8:
	// TODO: Consider detecting and reacting to short writes on
	// blocking channels.  Ought not happen.  See iocmd-24.2.

	wroteSome = 1
__9:
	;

	*(*int32)(unsafe.Pointer(bufPtr + 8)) += written

	// If this buffer is now empty, recycle it.

	if !((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded == (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved) {
		goto __30
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
	if !((*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead == uintptr(0)) {
		goto __31
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueTail = uintptr(0)
__31:
	;
	sRecycleBuffer(tls, statePtr, bufPtr, 0)
__30:
	;
	sReleaseChannelBuffer(tls, bufPtr)
	goto __6
__7:
	; // Closes "while".

	// If we wrote some data while flushing in the background, we are done.
	// We can't finish the background flush until we run out of data and the
	// channel becomes writable again. This ensures that all of the pending
	// data has been flushed at the system level.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<7) != 0) {
		goto __32
	}
	if !(wroteSome != 0) {
		goto __33
	}
	goto done
	goto __34
__33:
	if !((*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead == uintptr(0)) {
		goto __35
	}
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 7)
	sChanWatch(tls, chanPtr, (*ChannelState)(unsafe.Pointer(statePtr)).FinterestMask)
	goto __36
__35:
	//
	//  When we are calledFromAsyncFlush, that means a writable
	//  state on the channel triggered the call, so we should be
	//  able to write something.  Either we did write something
	//  and wroteSome should be set, or there was nothing left to
	//  write in this call, and we've completed the BG flush.
	//  These are the two cases above.  If we get here, that means
	//  there is some kind failure in the writable event machinery.
	//
	//  The tls extension indeed suffers from flaws in its channel
	//  event mgmt.  See https://core.tcl-lang.org/tcl/info/c31ca233ca.
	//  Until that patch is broadly distributed, disable the
	//  assertion checking here, so that programs using Tcl and
	//  tls can be debugged.
	//
	// 	    assert(!calledFromAsyncFlush);
	//
	;
__36:
	;
__34:
	;
__32:
	;

	// If the channel is flagged as closed, delete it when the refCount drops
	// to zero, the output queue is empty and there is no output in the
	// current output buffer.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<8) != 0 && (*ChannelState)(unsafe.Pointer(statePtr)).FrefCount <= 0 && (*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead == uintptr(0) && ((*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr == uintptr(0) || (*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr)).FnextAdded == (*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr)).FnextRemoved)) {
		goto __37
	}
	*(*int32)(unsafe.Pointer(bp /* errorCode */)) = sCloseChannel(tls, interp, chanPtr, *(*int32)(unsafe.Pointer(bp /* errorCode */)))
	goto done
__37:
	;

	// If the write-side of the channel is flagged as closed, delete it when
	// the output queue is empty and there is no output in the current output
	// buffer.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<21) != 0 && (*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead == uintptr(0) && ((*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr == uintptr(0) || (*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr)).FnextAdded == (*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr)).FnextRemoved)) {
		goto __38
	}
	*(*int32)(unsafe.Pointer(bp /* errorCode */)) = sCloseChannelPart(tls, interp, chanPtr, *(*int32)(unsafe.Pointer(bp /* errorCode */)),
		int32(1)<<2)
	goto done
__38:
	;

done:
	XTclChannelRelease(tls, chanPtr)
	return *(*int32)(unsafe.Pointer(bp /* errorCode */))
}

//----------------------------------------------------------------------
//
// CloseChannel --
//
//	Utility procedure to close a channel and free associated resources.
//
//	If the channel was stacked, then the it will copy the necessary
//	elements of the NEXT channel into the TOP channel, in essence
//	unstacking the channel. The NEXT channel will then be freed.
//
//	If the channel was not stacked, then we will free all the bits for the
//	TOP channel, including the data structure itself.
//
// Results:
//	Error code from an unreported error or the driver close operation.
//
// Side effects:
//	May close the actual channel, may free memory, may change the value of
//	errno.
//
//----------------------------------------------------------------------

func sCloseChannel(tls *libc.TLS, interp uintptr, chanPtr uintptr, errorCode int32) int32 { /* tclIO.c:2973:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var result int32 = 0 // Of calling driver close operation.
	var statePtr uintptr // State of the channel stack.
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))

	if chanPtr == uintptr(0) {
		return result
	}
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	// No more input can be consumed so discard any leftover input.

	sDiscardInputQueued(tls, statePtr, 1)

	// Discard a leftover buffer in the current output buffer field.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr != uintptr(0) {
		sReleaseChannelBuffer(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr)
		(*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr = uintptr(0)
	}

	// The caller guarantees that there are no more buffers queued for output.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead != uintptr(0) {
		XTcl_Panic(tls, ts+32704, 0)
	}

	// If the EOF character is set in the channel, append that to the output
	// device.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FoutEofChar != 0 && (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<2) != 0 {
		// var dummy int32 at bp+4, 4

		*(*int8)(unsafe.Pointer(bp /* c */)) = int8((*ChannelState)(unsafe.Pointer(statePtr)).FoutEofChar)

		sChanWrite(tls, chanPtr, bp, 1, bp+4)
	}

	// TIP #219, Tcl Channel Reflection API.
	// Move a leftover error message in the channel bypass into the
	// interpreter bypass. Just clear it if there is no interpreter.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg != uintptr(0) {
		if interp != uintptr(0) {
			XTcl_SetChannelErrorInterp(tls, interp, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
		}
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
					} else {
						*(*uintptr)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
			}
		}

		(*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg = uintptr(0)
	}

	// Remove this channel from of the list of all channels.

	sCutChannel(tls, chanPtr)

	// Close and free the channel driver state.
	// This may leave a TIP #219 error message in the interp.

	result = sChanClose(tls, chanPtr, interp)

	// Some resources can be cleared only if the bottom channel in a stack is
	// closed. All the other channels in the stack are not allowed to remove.

	if chanPtr == (*ChannelState)(unsafe.Pointer(statePtr)).FbottomChanPtr {
		if (*ChannelState)(unsafe.Pointer(statePtr)).FchannelName != uintptr(0) {
			XTclpFree(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchannelName)
			(*ChannelState)(unsafe.Pointer(statePtr)).FchannelName = uintptr(0)
		}

		XTcl_FreeEncoding(tls, (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding)
	}

	// If we are being called synchronously, report either any latent error on
	// the channel or the current error.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FunreportedError != 0 {
		errorCode = (*ChannelState)(unsafe.Pointer(statePtr)).FunreportedError

		// TIP #219, Tcl Channel Reflection API.
		// Move an error message found in the unreported area into the regular
		// bypass (interp). This kills any message in the channel bypass area.

		if (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg != uintptr(0) {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Flength = -1
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
						} else {
							*(*uintptr)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
				}
			}

			(*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg = uintptr(0)
		}
		if interp != 0 {
			XTcl_SetChannelErrorInterp(tls, interp, (*ChannelState)(unsafe.Pointer(statePtr)).FunreportedMsg)
		}
	}
	if errorCode == 0 {
		errorCode = result
		if errorCode != 0 {
			XTcl_SetErrno(tls, errorCode)
		}
	}

	// Cancel any outstanding timer.

	XTcl_DeleteTimerHandler(tls, (*ChannelState)(unsafe.Pointer(statePtr)).Ftimer)

	// Mark the channel as deleted by clearing the type structure.

	if (*Channel)(unsafe.Pointer(chanPtr)).FdownChanPtr != uintptr(0) {
		var downChanPtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).FdownChanPtr

		(*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr = statePtr

		(*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr = downChanPtr
		(*Channel)(unsafe.Pointer(downChanPtr)).FupChanPtr = uintptr(0)

		sChannelFree(tls, chanPtr)

		return XTcl_Close(tls, interp, downChanPtr)
	}

	// There is only the TOP Channel, so we free the remaining pointers we
	// have and then ourselves. Since this is the last of the channels in the
	// stack, make sure to free the ChannelState structure associated with it.

	sChannelFree(tls, chanPtr)

	XTcl_EventuallyFree(tls, statePtr, uintptr(3))

	return errorCode
}

//----------------------------------------------------------------------
//
// Tcl_CutChannel --
// CutChannel --
//
//	Removes a channel from the (thread-)global list of all channels (in
//	that thread). This is actually the statePtr for the stack of channel.
//
// Results:
//	Nothing.
//
// Side effects:
//	Resets the field 'nextCSPtr' of the specified channel state to NULL.
//
// NOTE:
//	The channel to cut out of the list must not be referenced in any
//	interpreter. This is something this procedure cannot check (despite
//	the refcount) because the caller usually wants fiddle with the channel
//	(like transfering it to a different thread) and thus keeps the
//	refcount artifically high to prevent its destruction.
//
//----------------------------------------------------------------------

func sCutChannel(tls *libc.TLS, chan1 Tcl_Channel) { /* tclIO.c:3155:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))
	var prevCSPtr uintptr // Preceding channel state in list of all
	// states - used to splice a channel out of
	// the list on close.
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	// State of the channel stack.

	// Remove this channel from of the list of all channels (in the current
	// thread).

	if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr != 0 && statePtr == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr {
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr
	} else {
		for prevCSPtr = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr; prevCSPtr != 0 && (*ChannelState)(unsafe.Pointer(prevCSPtr)).FnextCSPtr != statePtr; prevCSPtr = (*ChannelState)(unsafe.Pointer(prevCSPtr)).FnextCSPtr {
			// Empty loop body.
		}
		if prevCSPtr == uintptr(0) {
			XTcl_Panic(tls, ts+32749, 0)
		}
		(*ChannelState)(unsafe.Pointer(prevCSPtr)).FnextCSPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr
	}

	(*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr = uintptr(0)

	// TIP #218, Channel Thread Actions

	sChanThreadAction(tls, chan1, 1)

	// Channel is not managed by any thread
	(*ChannelState)(unsafe.Pointer(statePtr)).FmanagingThread = uintptr(0)
}

func XTcl_CutChannel(tls *libc.TLS, chan1 Tcl_Channel) { /* tclIO.c:3198:1: */
	var chanPtr uintptr = (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chan1)).Fstate)).FbottomChanPtr
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))
	var prevCSPtr uintptr // Preceding channel state in list of all
	// states - used to splice a channel out of
	// the list on close.
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State of the channel stack.

	// Remove this channel from of the list of all channels (in the current
	// thread).

	if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr != 0 && statePtr == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr {
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr
	} else {
		for prevCSPtr = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr; prevCSPtr != 0 && (*ChannelState)(unsafe.Pointer(prevCSPtr)).FnextCSPtr != statePtr; prevCSPtr = (*ChannelState)(unsafe.Pointer(prevCSPtr)).FnextCSPtr {
			// Empty loop body.
		}
		if prevCSPtr == uintptr(0) {
			XTcl_Panic(tls, ts+32749, 0)
		}
		(*ChannelState)(unsafe.Pointer(prevCSPtr)).FnextCSPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr
	}

	(*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr = uintptr(0)

	// TIP #218, Channel Thread Actions
	// For all transformations and the base channel.

	for ; chanPtr != uintptr(0); chanPtr = (*Channel)(unsafe.Pointer(chanPtr)).FupChanPtr {
		sChanThreadAction(tls, chanPtr, 1)
	}

	// Channel is not managed by any thread
	(*ChannelState)(unsafe.Pointer(statePtr)).FmanagingThread = uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_SpliceChannel --
// SpliceChannel --
//
//	Adds a channel to the (thread-)global list of all channels (in that
//	thread). Expects that the field 'nextChanPtr' in the channel is set to
//	NULL.
//
// Results:
//	Nothing.
//
// Side effects:
//	Nothing.
//
// NOTE:
//	The channel to splice into the list must not be referenced in any
//	interpreter. This is something this procedure cannot check (despite
//	the refcount) because the caller usually wants figgle with the channel
//	(like transfering it to a different thread) and thus keeps the
//	refcount artifically high to prevent its destruction.
//
//----------------------------------------------------------------------

func sSpliceChannel(tls *libc.TLS, chan1 Tcl_Channel) { /* tclIO.c:3271:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate

	if (*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr != uintptr(0) {
		XTcl_Panic(tls, ts+32784, 0)
	}

	(*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr
	(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr = statePtr

	// TIP #10. Mark the current thread as the new one managing this channel.
	//		Note: 'Tcl_GetCurrentThread' returns sensible values even for
	//		a non-threaded core.

	(*ChannelState)(unsafe.Pointer(statePtr)).FmanagingThread = XTcl_GetCurrentThread(tls)

	// TIP #218, Channel Thread Actions

	sChanThreadAction(tls, chan1, 0)
}

func XTcl_SpliceChannel(tls *libc.TLS, chan1 Tcl_Channel) { /* tclIO.c:3301:1: */
	var chanPtr uintptr = (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chan1)).Fstate)).FbottomChanPtr
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	if (*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr != uintptr(0) {
		XTcl_Panic(tls, ts+32784, 0)
	}

	(*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr
	(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr = statePtr

	// TIP #10. Mark the current thread as the new one managing this channel.
	//		Note: 'Tcl_GetCurrentThread' returns sensible values even for
	//		a non-threaded core.

	(*ChannelState)(unsafe.Pointer(statePtr)).FmanagingThread = XTcl_GetCurrentThread(tls)

	// TIP #218, Channel Thread Actions
	// For all transformations and the base channel.

	for ; chanPtr != uintptr(0); chanPtr = (*Channel)(unsafe.Pointer(chanPtr)).FupChanPtr {
		sChanThreadAction(tls, chanPtr, 0)
	}
}

//----------------------------------------------------------------------
//
// Tcl_Close --
//
//	Closes a channel.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Closes the channel if this is the last reference.
//
// NOTE:
//	Tcl_Close removes the channel as far as the user is concerned.
//	However, it may continue to exist for a while longer if it has a
//	background flush scheduled. The device itself is eventually closed and
//	the channel record removed, in CloseChannel, above.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_Close(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel) int32 { /* tclIO.c:3358:1: */
	var cbPtr uintptr // Iterate over close callbacks for this
	// channel.
	var chanPtr uintptr  // The real IO channel.
	var statePtr uintptr // State of real IO channel.
	var result int32 = 0 // Of calling FlushChannel.
	var flushcode int32
	var stickyError int32

	if chan1 == uintptr(0) {
		return TCL_OK
	}

	// Perform special handling for standard channels being closed. If the
	// refCount is now 1 it means that the last reference to the standard
	// channel is being explicitly closed, so bump the refCount down
	// artificially to 0. This will ensure that the channel is actually
	// closed, below. Also set the static pointer to NULL for the channel.

	sCheckForStdChannelsBeingClosed(tls, chan1)

	// This operation should occur at the top of a channel stack.

	chanPtr = chan1
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	if (*ChannelState)(unsafe.Pointer(statePtr)).FrefCount > 0 {
		XTcl_Panic(tls, ts+32844, 0)
	}

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<19) != 0 {
		if interp != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

				ts+32040, -1))
		}
		return TCL_ERROR
	}
	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 19

	// When the channel has an escape sequence driven encoding such as
	// iso2022, the terminated escape sequence must write to the buffer.

	stickyError = 0

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<2) != 0 && (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding != uintptr(0) &&
		!((*ChannelState)(unsafe.Pointer(statePtr)).FoutputEncodingFlags&TCL_ENCODING_START != 0) {
		var code int32 = sCheckChannelErrors(tls, statePtr, int32(1)<<2)

		if code == 0 {
			*(*int32)(unsafe.Pointer(statePtr + 48)) |= TCL_ENCODING_END
			code = sWrite(tls, chanPtr, ts+2046, 0, (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).Fencoding)
			*(*int32)(unsafe.Pointer(statePtr + 48)) &= libc.CplInt32(TCL_ENCODING_END)
			*(*int32)(unsafe.Pointer(statePtr + 48)) |= TCL_ENCODING_START
		}
		if code < 0 {
			stickyError = XTcl_GetErrno(tls)
		}

		// TIP #219, Tcl Channel Reflection API.
		// Move an error message found in the channel bypass into the
		// interpreter bypass. Just clear it if there is no interpreter.

		if (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg != uintptr(0) {
			if interp != uintptr(0) {
				XTcl_SetChannelErrorInterp(tls, interp, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
			}
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
						} else {
							*(*uintptr)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
				}
			}

			(*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg = uintptr(0)
		}
	}

	XTcl_ClearChannelHandlers(tls, chan1)

	// Invoke the registered close callbacks and delete their records.

	for (*ChannelState)(unsafe.Pointer(statePtr)).FcloseCbPtr != uintptr(0) {
		cbPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FcloseCbPtr
		(*ChannelState)(unsafe.Pointer(statePtr)).FcloseCbPtr = (*CloseCallback)(unsafe.Pointer(cbPtr)).FnextPtr
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*CloseCallback)(unsafe.Pointer(cbPtr)).Fproc})).f(tls, (*CloseCallback)(unsafe.Pointer(cbPtr)).FclientData)
		XTclpFree(tls, cbPtr)
	}

	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 19)

	// If this channel supports it, close the read side, since we don't need
	// it anymore and this will help avoid deadlocks on some channel types.

	if (*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FcloseProc == uintptr(1) {
		result = (*struct {
			f func(*libc.TLS, ClientData, uintptr, int32) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).Fclose2Proc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, interp,
			int32(1)<<1)
		if result == EINVAL || result == ENOTCONN {
			result = 0
		}
	}

	// The call to FlushChannel will flush any queued output and invoke the
	// close function of the channel driver, or it will set up the channel to
	// be flushed and closed asynchronously.

	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 8

	flushcode = sFlushChannel(tls, interp, chanPtr, 0)

	// TIP #219.
	// Capture error messages put by the driver into the bypass area and put
	// them into the regular interpreter result.
	//
	// Notes: Due to the assertion of CHANNEL_CLOSED in the flags
	// FlushChannel() has called CloseChannel() and thus freed all the channel
	// structures. We must not try to access "chan" anymore, hence the NULL
	// argument in the call below. The only place which may still contain a
	// message is the interpreter itself, and "CloseChannel" made sure to lift
	// any channel message it generated into it.

	if XTclChanCaughtErrorBypass(tls, interp, uintptr(0)) != 0 {
		result = EINVAL
	}

	if stickyError != 0 {
		XTcl_SetErrno(tls, stickyError)
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp,
				XTcl_NewStringObj(tls, XTcl_PosixError(tls, interp), -1))
		}
		return TCL_ERROR
	}

	// Bug 97069ea11a: set error message if a flush code is set and no error
	// message set up to now.

	if flushcode != 0 {
		// flushcode has precedence, if available
		result = flushcode
	}
	if result != 0 && result != TCL_ERROR && interp != uintptr(0) &&
		0 == XTcl_GetCharLength(tls, XTcl_GetObjResult(tls, interp)) {
		XTcl_SetErrno(tls, result)
		XTcl_SetObjResult(tls, interp,
			XTcl_NewStringObj(tls, XTcl_PosixError(tls, interp), -1))
	}
	if result != 0 {
		return TCL_ERROR
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_CloseEx --
//
//	Closes one side of a channel, read or write.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Closes one direction of the channel.
//
// NOTE:
//	Tcl_CloseEx closes the specified direction of the channel as far as
//	the user is concerned. The channel keeps existing however. You cannot
//	call this function to close the last possible direction of the
//	channel. Use Tcl_Close for that.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_CloseEx(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel, flags int32) int32 { /* tclIO.c:3552:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var chanPtr uintptr  // The real IO channel.
	var statePtr uintptr // State of real IO channel.

	if chan1 == uintptr(0) {
		return TCL_OK
	}

	chanPtr = chan1
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	if flags&(int32(1)<<1|int32(1)<<2) == 0 {
		return XTcl_Close(tls, interp, chan1)
	}
	if flags&(int32(1)<<1|int32(1)<<2) == int32(1)<<1|int32(1)<<2 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+32890,
			libc.VaList(bp, (*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FtypeName)))
		return TCL_ERROR
	}

	// Does the channel support half-close anyway? Error if not.

	if !(int32((*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).Fclose2Proc) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+32936,
			libc.VaList(bp+8, (*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FtypeName)))
		return TCL_ERROR
	}

	// Is the channel unstacked ? If not we fail.

	if chanPtr != (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+32980, -1))
		return TCL_ERROR
	}

	// Check direction against channel mode. It is an error if we try to close
	// a direction not supported by the channel (already closed, or never
	// opened for that direction).

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1|int32(1)<<2)&flags != 0) {
		var msg uintptr

		if flags&(int32(1)<<1) != 0 {
			msg = ts + 5472 /* "read" */
		} else {
			msg = ts + 33034 /* "write" */
		}
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

			ts+33040, libc.VaList(bp+16, msg)))
		return TCL_ERROR
	}

	// A user may try to call half-close from within a channel close handler.
	// That won't do.

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<19) != 0 {
		if interp != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

				ts+32040, -1))
		}
		return TCL_ERROR
	}

	if flags&(int32(1)<<1) != 0 {
		// Call the finalization code directly. There are no events to handle,
		// there cannot be for the read-side.

		return sCloseChannelPart(tls, interp, chanPtr, 0, flags)
	} else if flags&(int32(1)<<2) != 0 {
		XTcl_Preserve(tls, statePtr)
		if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<7) != 0) {
			// We don't want to re-enter CloseWrite().

			if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<21) != 0) {
				if sCloseWrite(tls, interp, chanPtr) != TCL_OK {
					*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 21
					XTcl_Release(tls, statePtr)
					return TCL_ERROR
				}
			}
		}
		*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 21
		XTcl_Release(tls, statePtr)
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// CloseWrite --
//
//	Closes the write side a channel.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Closes the write side of the channel.
//
// NOTE:
//	CloseWrite removes the channel as far as the user is concerned.
//	However, the ooutput data structures may continue to exist for a while
//	longer if it has a background flush scheduled. The device itself is
//	eventually closed and the channel structures modified, in
//	CloseChannelPart, below.
//
//----------------------------------------------------------------------

func sCloseWrite(tls *libc.TLS, interp uintptr, chanPtr uintptr) int32 { /* tclIO.c:3686:1: */
	// Notes: clear-channel-handlers - write side only ? or keep around, just
	// not called.
	//
	// No close callbacks are run - channel is still open (read side)

	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State of real IO channel.
	var flushcode int32
	var result int32 = 0

	// The call to FlushChannel will flush any queued output and invoke the
	// close function of the channel driver, or it will set up the channel to
	// be flushed and closed asynchronously.

	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 21

	flushcode = sFlushChannel(tls, interp, chanPtr, 0)

	// TIP #219.
	// Capture error messages put by the driver into the bypass area and put
	// them into the regular interpreter result.
	//
	// Notes: Due to the assertion of CHANNEL_CLOSEDWRITE in the flags
	// FlushChannel() has called CloseChannelPart(). While we can still access
	// "chan" (no structures were freed), the only place which may still
	// contain a message is the interpreter itself, and "CloseChannelPart"
	// made sure to lift any channel message it generated into it. Hence the
	// NULL argument in the call below.

	if XTclChanCaughtErrorBypass(tls, interp, uintptr(0)) != 0 {
		result = EINVAL
	}

	if flushcode != 0 || result != 0 {
		return TCL_ERROR
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// CloseChannelPart --
//
//	Utility procedure to close a channel partially and free associated
//	resources. If the channel was stacked it will never be run (The higher
//	level forbid this). If the channel was not stacked, then we will free
//	all the bits of the chosen side (read, or write) for the TOP channel.
//
// Results:
//	Error code from an unreported error or the driver close2 operation.
//
// Side effects:
//	May free memory, may change the value of errno.
//
//----------------------------------------------------------------------

func sCloseChannelPart(tls *libc.TLS, interp uintptr, chanPtr uintptr, errorCode int32, flags int32) int32 { /* tclIO.c:3758:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var statePtr uintptr // State of real IO channel.
	var result int32     // Of calling the close2proc.

	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	if flags&(int32(1)<<1) != 0 {
		// No more input can be consumed so discard any leftover input.

		sDiscardInputQueued(tls, statePtr, 1)
	} else if flags&(int32(1)<<2) != 0 {
		// The caller guarantees that there are no more buffers queued for
		// output.

		if (*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead != uintptr(0) {
			XTcl_Panic(tls,
				ts+33110, 0)
		}

		// If the EOF character is set in the channel, append that to the
		// output device.

		if (*ChannelState)(unsafe.Pointer(statePtr)).FoutEofChar != 0 && (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<2) != 0 {
			// var dummy int32 at bp+4, 4

			*(*int8)(unsafe.Pointer(bp /* c */)) = int8((*ChannelState)(unsafe.Pointer(statePtr)).FoutEofChar)

			sChanWrite(tls, chanPtr, bp, 1, bp+4)
		}

		// TIP #219, Tcl Channel Reflection API.
		// Move a leftover error message in the channel bypass into the
		// interpreter bypass. Just clear it if there is no interpreter.

		if (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg != uintptr(0) {
			if interp != uintptr(0) {
				XTcl_SetChannelErrorInterp(tls, interp, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
			}
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
						} else {
							*(*uintptr)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
				}
			}

			(*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg = uintptr(0)
		}
	}

	// Finally do what is asked of us. Close and free the channel driver state
	// for the chosen side of the channel. This may leave a TIP #219 error
	// message in the interp.

	result = (*struct {
		f func(*libc.TLS, ClientData, uintptr, int32) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).Fclose2Proc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, uintptr(0), flags)

	// If we are being called synchronously, report either any latent error on
	// the channel or the current error.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FunreportedError != 0 {
		errorCode = (*ChannelState)(unsafe.Pointer(statePtr)).FunreportedError

		// TIP #219, Tcl Channel Reflection API.
		// Move an error message found in the unreported area into the regular
		// bypass (interp). This kills any message in the channel bypass area.

		if (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg != uintptr(0) {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Flength = -1
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
						} else {
							*(*uintptr)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
				}
			}

			(*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg = uintptr(0)
		}
		if interp != 0 {
			XTcl_SetChannelErrorInterp(tls, interp, (*ChannelState)(unsafe.Pointer(statePtr)).FunreportedMsg)
		}
	}
	if errorCode == 0 {
		errorCode = result
		if errorCode != 0 {
			XTcl_SetErrno(tls, errorCode)
		}
	}

	// TIP #219.
	// Capture error messages put by the driver into the bypass area and put
	// them into the regular interpreter result. See also the bottom of
	// CloseWrite().

	if XTclChanCaughtErrorBypass(tls, interp, chanPtr) != 0 {
		result = EINVAL
	}

	if result != 0 {
		return TCL_ERROR
	}

	// Remove the closed side from the channel mode/flags.

	*(*int32)(unsafe.Pointer(statePtr + 8)) &= ^(flags & (int32(1)<<1 | int32(1)<<2))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ClearChannelHandlers --
//
//	Removes all channel handlers and event scripts from the channel,
//	cancels all background copies involving the channel and any interest
//	in events.
//
// Results:
//	None.
//
// Side effects:
//	See above. Deallocates memory.
//
//----------------------------------------------------------------------

func XTcl_ClearChannelHandlers(tls *libc.TLS, channel Tcl_Channel) { /* tclIO.c:3893:1: */
	var chPtr uintptr
	var chNext uintptr // Iterate over channel handlers.
	var ePtr uintptr
	var eNextPtr uintptr // Iterate over eventscript records.
	var chanPtr uintptr  // The real IO channel.
	var statePtr uintptr // State of real IO channel.
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))
	var nhPtr uintptr

	// This operation should occur at the top of a channel stack.

	chanPtr = channel
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	// Cancel any outstanding timer.

	XTcl_DeleteTimerHandler(tls, (*ChannelState)(unsafe.Pointer(statePtr)).Ftimer)

	// Remove any references to channel handlers for this channel that may be
	// about to be invoked.

	for nhPtr = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FnestedHandlerPtr; nhPtr != uintptr(0); nhPtr = (*NextChannelHandler)(unsafe.Pointer(nhPtr)).FnestedHandlerPtr {
		if (*NextChannelHandler)(unsafe.Pointer(nhPtr)).FnextHandlerPtr != 0 && (*ChannelHandler)(unsafe.Pointer((*NextChannelHandler)(unsafe.Pointer(nhPtr)).FnextHandlerPtr)).FchanPtr == chanPtr {
			(*NextChannelHandler)(unsafe.Pointer(nhPtr)).FnextHandlerPtr = uintptr(0)
		}
	}

	// Remove all the channel handler records attached to the channel itself.

	for chPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchPtr; chPtr != uintptr(0); chPtr = chNext {
		chNext = (*ChannelHandler)(unsafe.Pointer(chPtr)).FnextPtr
		XTclpFree(tls, chPtr)
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FchPtr = uintptr(0)

	// Cancel any pending copy operation.

	sStopCopy(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR)
	sStopCopy(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW)

	// Must set the interest mask now to 0, otherwise infinite loops will
	// occur if Tcl_DoOneEvent is called before the channel is finally deleted
	// in FlushChannel. This can happen if the channel has a background flush
	// active.

	(*ChannelState)(unsafe.Pointer(statePtr)).FinterestMask = 0

	// Remove any EventScript records for this channel.

	for ePtr = (*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr; ePtr != uintptr(0); ePtr = eNextPtr {
		eNextPtr = (*EventScriptRecord)(unsafe.Pointer(ePtr)).FnextPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(ePtr)).FscriptPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(ePtr)).FscriptPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(ePtr)).FscriptPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(ePtr)).FscriptPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(ePtr)).FscriptPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(ePtr)).FscriptPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(ePtr)).FscriptPtr)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, (*EventScriptRecord)(unsafe.Pointer(ePtr)).FscriptPtr)
					} else {
						*(*uintptr)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(ePtr)).FscriptPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*EventScriptRecord)(unsafe.Pointer(ePtr)).FscriptPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, (*EventScriptRecord)(unsafe.Pointer(ePtr)).FscriptPtr)
			}
		}

		XTclpFree(tls, ePtr)
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_Write --
//
//	Puts a sequence of bytes into an output buffer, may queue the buffer
//	for output if it gets full, and also remembers whether the current
//	buffer is ready e.g. if it contains a newline and we are in line
//	buffering mode. Compensates stacking, i.e. will redirect the data from
//	the specified channel to the topmost channel in a stack.
//
//	No encoding conversions are applied to the bytes being read.
//
// Results:
//	The number of bytes written or -1 in case of error. If -1,
//	Tcl_GetErrno will return the error code.
//
// Side effects:
//	May buffer up output and may cause output to be produced on the
//	channel.
//
//----------------------------------------------------------------------

func XTcl_Write(tls *libc.TLS, chan1 Tcl_Channel, src uintptr, srcLen int32) int32 { /* tclIO.c:3993:1: */
	// Always use the topmost channel of the stack

	var chanPtr uintptr
	var statePtr uintptr // State info for channel

	statePtr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	if sCheckChannelErrors(tls, statePtr, int32(1)<<2) != 0 {
		return -1
	}

	if srcLen < 0 {
		srcLen = int32(libc.Xstrlen(tls, src))
	}
	if sWrite(tls, chanPtr, src, srcLen, XtclIdentityEncoding) < 0 {
		return -1
	}
	return srcLen
}

//----------------------------------------------------------------------
//
// Tcl_WriteRaw --
//
//	Puts a sequence of bytes into an output buffer, may queue the buffer
//	for output if it gets full, and also remembers whether the current
//	buffer is ready e.g. if it contains a newline and we are in line
//	buffering mode. Writes directly to the driver of the channel, does not
//	compensate for stacking.
//
//	No encoding conversions are applied to the bytes being read.
//
// Results:
//	The number of bytes written or -1 in case of error. If -1,
//	Tcl_GetErrno will return the error code.
//
// Side effects:
//	May buffer up output and may cause output to be produced on the
//	channel.
//
//----------------------------------------------------------------------

func XTcl_WriteRaw(tls *libc.TLS, chan1 Tcl_Channel, src uintptr, srcLen int32) int32 { /* tclIO.c:4047:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var chanPtr uintptr = chan1
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	// var errorCode int32 at bp, 4

	var written int32

	if sCheckChannelErrors(tls, statePtr, int32(1)<<2|int32(1)<<16) != 0 {
		return -1
	}

	if srcLen < 0 {
		srcLen = int32(libc.Xstrlen(tls, src))
	}

	// Go immediately to the driver, do all the error handling by ourselves.
	// The code was stolen from 'FlushChannel'.

	written = sChanWrite(tls, chanPtr, src, srcLen, bp)
	if written < 0 {
		XTcl_SetErrno(tls, *(*int32)(unsafe.Pointer(bp /* errorCode */)))
	}

	return written
}

//---------------------------------------------------------------------------
//
// Tcl_WriteChars --
//
//	Takes a sequence of UTF-8 characters and converts them for output
//	using the channel's current encoding, may queue the buffer for output
//	if it gets full, and also remembers whether the current buffer is
//	ready e.g. if it contains a newline and we are in line buffering
//	mode. Compensates stacking, i.e. will redirect the data from the
//	specified channel to the topmost channel in a stack.
//
// Results:
//	The number of bytes written or -1 in case of error. If -1,
//	Tcl_GetErrno will return the error code.
//
// Side effects:
//	May buffer up output and may cause output to be produced on the
//	channel.
//
//----------------------------------------------------------------------

func XTcl_WriteChars(tls *libc.TLS, chan1 Tcl_Channel, src uintptr, len int32) int32 { /* tclIO.c:4103:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)
	*(*int32)(unsafe.Pointer(bp)) = len

	var chanPtr uintptr = chan1
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate // State info for channel
	var result int32
	var objPtr uintptr

	if sCheckChannelErrors(tls, statePtr, int32(1)<<2) != 0 {
		return -1
	}

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	if *(*int32)(unsafe.Pointer(bp)) < 0 {
		*(*int32)(unsafe.Pointer(bp /* len */)) = int32(libc.Xstrlen(tls, src))
	}
	if (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding != 0 {
		return sWrite(tls, chanPtr, src, *(*int32)(unsafe.Pointer(bp /* len */)), (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).Fencoding)
	}

	// Inefficient way to convert UTF-8 to byte-array, but the code
	// parallels the way it is done for objects.  Special case for 1-byte
	// (used by eg [puts] for the \n) could be extended to more efficient
	// translation of the src string.

	if *(*int32)(unsafe.Pointer(bp)) == 1 && int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0xC0 {
		return sWrite(tls, chanPtr, src, *(*int32)(unsafe.Pointer(bp /* len */)), XtclIdentityEncoding)
	}

	objPtr = XTcl_NewStringObj(tls, src, *(*int32)(unsafe.Pointer(bp /* len */)))
	src = XTcl_GetByteArrayFromObj(tls, objPtr, bp)
	result = sWrite(tls, chanPtr, src, *(*int32)(unsafe.Pointer(bp /* len */)), XtclIdentityEncoding)
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, objPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, objPtr)
		}
	}

	return result
}

//---------------------------------------------------------------------------
//
// Tcl_WriteObj --
//
//	Takes the Tcl object and queues its contents for output. If the
//	encoding of the channel is NULL, takes the byte-array representation
//	of the object and queues those bytes for output. Otherwise, takes the
//	characters in the UTF-8 (string) representation of the object and
//	converts them for output using the channel's current encoding. May
//	flush internal buffers to output if one becomes full or is ready for
//	some other reason, e.g. if it contains a newline and the channel is in
//	line buffering mode.
//
// Results:
//	The number of bytes written or -1 in case of error. If -1,
//	Tcl_GetErrno() will return the error code.
//
// Side effects:
//	May buffer up output and may cause output to be produced on the
//	channel.
//
//----------------------------------------------------------------------

func XTcl_WriteObj(tls *libc.TLS, chan1 Tcl_Channel, objPtr uintptr) int32 { /* tclIO.c:4172:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// Always use the topmost channel of the stack

	var chanPtr uintptr
	var statePtr uintptr // State info for channel
	var src uintptr
	// var srcLen int32 at bp, 4

	statePtr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	if sCheckChannelErrors(tls, statePtr, int32(1)<<2) != 0 {
		return -1
	}
	if (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding == uintptr(0) {
		src = XTcl_GetByteArrayFromObj(tls, objPtr, bp)
		return sWrite(tls, chanPtr, src, *(*int32)(unsafe.Pointer(bp /* srcLen */)), XtclIdentityEncoding)
	} else {
		src = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, objPtr, bp)
		}()
		return sWrite(tls, chanPtr, src, *(*int32)(unsafe.Pointer(bp /* srcLen */)), (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).Fencoding)
	}
	return int32(0)
}

func sWillWrite(tls *libc.TLS, chanPtr uintptr) { /* tclIO.c:4201:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var inputBuffered int32

	if XTcl_ChannelSeekProc(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr) != uintptr(0) && libc.AssignInt32(&inputBuffered, XTcl_InputBuffered(tls, chanPtr)) > 0 {
		// var ignore int32 at bp, 4

		sDiscardInputQueued(tls, (*Channel)(unsafe.Pointer(chanPtr)).Fstate, 0)
		sChanSeek(tls, chanPtr, int64(-inputBuffered), SEEK_CUR, bp)
	}
}

func sWillRead(tls *libc.TLS, chanPtr uintptr) int32 { /* tclIO.c:4216:1: */
	if (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr == uintptr(0) {
		// Prevent read attempts on a closed channel.

		sDiscardInputQueued(tls, (*Channel)(unsafe.Pointer(chanPtr)).Fstate, 0)
		XTcl_SetErrno(tls, EINVAL)
		return -1
	}
	if XTcl_ChannelSeekProc(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr) != uintptr(0) &&
		XTcl_OutputBuffered(tls, chanPtr) > 0 {

		// CAVEAT - The assumption here is that FlushChannel() will push out
		// the bytes of any writes that are in progress.  Since this is a
		// seekable channel, we assume it is not one that can block and force
		// bg flushing.  Channels we know that can do that - sockets, pipes -
		// are not seekable. If the assumption is wrong, more drastic measures
		// may be required here like temporarily setting the channel into
		// blocking mode.

		if sFlushChannel(tls, uintptr(0), chanPtr, 0) != 0 {
			return -1
		}
	}
	return 0
}

//----------------------------------------------------------------------
//
// Write --
//
//	Convert srcLen bytes starting at src according to encoding and write
//	produced bytes into an output buffer, may queue the buffer for output
//	if it gets full, and also remembers whether the current buffer is
//	ready e.g. if it contains a newline and we are in line buffering mode.
//
// Results:
//	The number of bytes written or -1 in case of error. If -1,
//	Tcl_GetErrno will return the error code.
//
// Side effects:
//	May buffer up output and may cause output to be produced on the
//	channel.
//
//----------------------------------------------------------------------

func sWrite(tls *libc.TLS, chanPtr uintptr, src uintptr, srcLen int32, encoding Tcl_Encoding) int32 { /* tclIO.c:4270:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var nextNewLine uintptr = uintptr(0)
	var endEncoding int32
	var saved int32 = 0
	var total int32 = 0
	var flushed int32 = 0
	var needNlFlush int32 = 0
	// var safe [16]int8 at bp, 16

	if srcLen != 0 {
		sWillWrite(tls, chanPtr)
	}

	// Write the terminated escape sequence even if srcLen is 0.

	endEncoding = libc.Bool32((*ChannelState)(unsafe.Pointer(statePtr)).FoutputEncodingFlags&TCL_ENCODING_END != 0)

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<4) != 0 ||
		(*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation != TCL_TRANSLATE_LF {
		nextNewLine = libc.Xmemchr(tls, src, '\n', uint64(srcLen))
	}

	for srcLen+saved+endEncoding > 0 {
		var bufPtr uintptr
		var dst uintptr
		var result int32
		// var srcRead int32 at bp+16, 4

		var dstLen int32
		// var dstWrote int32 at bp+20, 4

		var srcLimit int32 = srcLen

		if nextNewLine != 0 {
			srcLimit = int32((int64(nextNewLine) - int64(src)) / 1)
		}

		// Get space to write into
		bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr
		if bufPtr == uintptr(0) {
			bufPtr = sAllocChannelBuffer(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FbufSize)
			(*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr = bufPtr
		}
		if saved != 0 {
			// Here's some translated bytes left over from the last buffer
			// that we need to stick at the beginning of this buffer.

			libc.Xmemcpy(tls, bufPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded), bp, uint64(saved))
			*(*int32)(unsafe.Pointer(bufPtr + 4)) += saved
			saved = 0
		}
		sPreserveChannelBuffer(tls, bufPtr)
		dst = bufPtr + 24 + uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded)
		dstLen = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded

		result = XTcl_UtfToExternal(tls, uintptr(0), encoding, src, srcLimit,
			(*ChannelState)(unsafe.Pointer(statePtr)).FoutputEncodingFlags,
			statePtr+40, dst,
			dstLen+BUFFER_PADDING, bp+16, bp+20, uintptr(0))

		// See chan-io-1.[89]. Tcl Bug 506297.

		*(*int32)(unsafe.Pointer(statePtr + 48)) &= libc.CplInt32(TCL_ENCODING_START)

		if result != TCL_OK && *(*int32)(unsafe.Pointer(bp + 16))+*(*int32)(unsafe.Pointer(bp + 20)) == 0 {
			// We're reading from invalid/incomplete UTF-8.

			sReleaseChannelBuffer(tls, bufPtr)
			if total == 0 {
				XTcl_SetErrno(tls, EINVAL)
				return -1
			}
			break
		}

		*(*int32)(unsafe.Pointer(bufPtr + 4)) += *(*int32)(unsafe.Pointer(bp + 20))
		src += uintptr(*(*int32)(unsafe.Pointer(bp + 16 /* srcRead */)))
		srcLen = srcLen - *(*int32)(unsafe.Pointer(bp + 16))
		total = total + *(*int32)(unsafe.Pointer(bp + 20))
		dst += uintptr(*(*int32)(unsafe.Pointer(bp + 20 /* dstWrote */)))
		dstLen = dstLen - *(*int32)(unsafe.Pointer(bp + 20))

		if src == nextNewLine && dstLen > 0 {
			var nl uintptr = uintptr(0)
			var nlLen int32 = 0

			switch (*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation {
			case TCL_TRANSLATE_LF:
				nl = uintptr(unsafe.Pointer(&crln)) + uintptr(1)
				nlLen = 1
				break
				fallthrough
			case TCL_TRANSLATE_CR:
				nl = uintptr(unsafe.Pointer(&crln))
				nlLen = 1
				break
				fallthrough
			case TCL_TRANSLATE_CRLF:
				nl = uintptr(unsafe.Pointer(&crln))
				nlLen = 2
				break
				fallthrough
			default:
				XTcl_Panic(tls, ts+33174, 0)
				break
			}

			result = result | XTcl_UtfToExternal(tls, uintptr(0), encoding, nl, nlLen,
				(*ChannelState)(unsafe.Pointer(statePtr)).FoutputEncodingFlags,
				statePtr+40, dst,
				dstLen+BUFFER_PADDING, bp+16, bp+20, uintptr(0))

			*(*int32)(unsafe.Pointer(bufPtr + 4)) += *(*int32)(unsafe.Pointer(bp + 20))
			src++
			srcLen--
			total = total + *(*int32)(unsafe.Pointer(bp + 20))
			dst += uintptr(*(*int32)(unsafe.Pointer(bp + 20 /* dstWrote */)))
			dstLen = dstLen - *(*int32)(unsafe.Pointer(bp + 20))
			nextNewLine = libc.Xmemchr(tls, src, '\n', uint64(srcLen))
			needNlFlush = 1
		}

		if (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded > (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength {
			// When translating from UTF-8 to external encoding, we allowed
			// the translation to produce a character that crossed the end of
			// the output buffer, so that we would get a completely full
			// buffer before flushing it. The extra bytes will be moved to the
			// beginning of the next buffer.

			saved = -((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded)
			libc.Xmemcpy(tls, bp, dst+uintptr(dstLen), uint64(saved))
			(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength
		}

		if srcLen+saved == 0 && result == TCL_OK {
			endEncoding = 0
		}

		if bufPtr != 0 && (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded >= (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength {
			if sFlushChannel(tls, uintptr(0), chanPtr, 0) != 0 {
				sReleaseChannelBuffer(tls, bufPtr)
				return -1
			}
			flushed = flushed + (*ChannelState)(unsafe.Pointer(statePtr)).FbufSize

			// We just flushed.  So if we have needNlFlush set to record that
			// we need to flush because theres a (translated) newline in the
			// buffer, that's likely not true any more.  But there is a tricky
			// exception.  If we have saved bytes that did not really get
			// flushed and those bytes came from a translation of a newline as
			// the last thing taken from the src array, then needNlFlush needs
			// to remain set to flag that the next buffer still needs a
			// newline flush.

			if needNlFlush != 0 && (saved == 0 || int32(*(*int8)(unsafe.Pointer(src + libc.UintptrFromInt32(-1)))) != '\n') {
				needNlFlush = 0
			}
		}
		sReleaseChannelBuffer(tls, bufPtr)
	}
	if flushed < total && ((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<5) != 0 || needNlFlush != 0 && (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<4) != 0) {
		if sFlushChannel(tls, uintptr(0), chanPtr, 0) != 0 {
			return -1
		}
	}

	return total
}

var crln = *(*[3]int8)(unsafe.Pointer(ts + 33211)) /* tclIO.c:4358:18 */

//---------------------------------------------------------------------------
//
// Tcl_Gets --
//
//	Reads a complete line of input from the channel into a Tcl_DString.
//
// Results:
//	Length of line read (in characters) or -1 if error, EOF, or blocked.
//	If -1, use Tcl_GetErrno() to retrieve the POSIX error code for the
//	error or condition that occurred.
//
// Side effects:
//	May flush output on the channel. May cause input to be consumed from
//	the channel.
//
//---------------------------------------------------------------------------

func XTcl_Gets(tls *libc.TLS, chan1 Tcl_Channel, lineRead uintptr) int32 { /* tclIO.c:4468:1: */
	var objPtr uintptr
	var charsStored int32

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	charsStored = XTcl_GetsObj(tls, chan1, objPtr)
	if charsStored > 0 {
		XTclDStringAppendObj(tls, lineRead, objPtr)
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, objPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, objPtr)
		}
	}

	return charsStored
}

//---------------------------------------------------------------------------
//
// Tcl_GetsObj --
//
//	Accumulate input from the input channel until end-of-line or
//	end-of-file has been seen. Bytes read from the input channel are
//	converted to UTF-8 using the encoding specified by the channel.
//
// Results:
//	Number of characters accumulated in the object or -1 if error,
//	blocked, or EOF. If -1, use Tcl_GetErrno() to retrieve the POSIX error
//	code for the error or condition that occurred.
//
// Side effects:
//	Consumes input from the channel.
//
//	On reading EOF, leave channel pointing at EOF char. On reading EOL,
//	leave channel pointing after EOL, but don't return EOL in dst buffer.
//
//---------------------------------------------------------------------------

func XTcl_GetsObj(tls *libc.TLS, chan1 Tcl_Channel, objPtr uintptr) int32 { /* tclIO.c:4511:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	// var gs GetsState at bp+16, 56

	var chanPtr uintptr
	var statePtr uintptr
	// State info for channel
	var bufPtr uintptr
	var inEofChar int32
	var skip int32
	var copiedTotal int32
	// var oldLength int32 at bp, 4

	var oldFlags int32
	var oldRemoved int32
	var encoding Tcl_Encoding
	// var dst uintptr at bp+8, 8

	// var dstEnd uintptr at bp+80, 8

	var eol uintptr
	var eof uintptr
	var oldState Tcl_EncodingState
	var offset int32
	// Skip the raw bytes that make up the '\n'.

	// var rawRead int32 at bp+76, 4

	// var tmp [3]int8 at bp+72, 3

	var offset1 int32
	chanPtr = chan1
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	if !(sCheckChannelErrors(tls, statePtr, int32(1)<<1) != 0) {
		goto __1
	}
	return -1
__1:
	;

	// If we're sitting ready to read the eofchar, there's no need to
	// do it.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<10) != 0) {
		goto __2
	}
	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 9

	// TODO: Do we need this?
	sUpdateInterest(tls, chanPtr)
	return -1
__2:
	;

	// A binary version of Tcl_GetsObj. This could also handle encodings that
	// are ascii-7 pure (iso8859, utf-8, ...) with a final encoding conversion
	// done on objPtr.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fencoding == uintptr(0) &&
		((*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation == TCL_TRANSLATE_LF ||
			(*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation == TCL_TRANSLATE_CR)) {
		goto __3
	}
	return sTclGetsObjBinary(tls, chan1, objPtr)
__3:
	;

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr
	XTclChannelPreserve(tls, chanPtr)

	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
	encoding = (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding

	// Preserved so we can restore the channel's state in case we don't find a
	// newline in the available input.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
		*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
		_ = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
	} else {
		XTcl_GetStringFromObj(tls, objPtr, bp)
	}
	oldFlags = (*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags
	oldState = (*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingState
	oldRemoved = BUFFER_PADDING
	if !(bufPtr != uintptr(0)) {
		goto __4
	}
	oldRemoved = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved
__4:
	;

	// If there is no encoding, use "iso8859-1" -- Tcl_GetsObj() doesn't
	// produce ByteArray objects.

	if !(encoding == uintptr(0)) {
		goto __5
	}
	encoding = sGetBinaryEncoding(tls)
__5:
	;

	// Object used by FilterInputBytes to keep track of how much data has been
	// consumed from the channel buffers.

	(*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).FobjPtr = objPtr
	(*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).FdstPtr = bp + 8 /* &dst */
	(*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).Fencoding = encoding
	(*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).FbufPtr = bufPtr
	(*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).Fstate = oldState
	(*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).FrawRead = 0
	(*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).FbytesWrote = 0
	(*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).FcharsWrote = 0
	(*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).FtotalChars = 0

	*(*uintptr)(unsafe.Pointer(bp + 8 /* dst */)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(*(*int32)(unsafe.Pointer(bp)))
	*(*uintptr)(unsafe.Pointer(bp + 80 /* dstEnd */)) = *(*uintptr)(unsafe.Pointer(bp + 8 /* dst */))

	skip = 0
	eof = uintptr(0)
	inEofChar = (*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar

	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 11)
__6:
	if !(1 != 0) {
		goto __7
	}
	if !(*(*uintptr)(unsafe.Pointer(bp + 8)) >= *(*uintptr)(unsafe.Pointer(bp + 80))) {
		goto __8
	}
	if !(sFilterInputBytes(tls, chanPtr, bp+16) != 0) {
		goto __9
	}
	goto restore
__9:
	;
	*(*uintptr)(unsafe.Pointer(bp + 80 /* dstEnd */)) = *(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr((*GetsState)(unsafe.Pointer(bp+16)).FbytesWrote)
__8:
	;

	// Remember if EOF char is seen, then look for EOL anyhow, because the
	// EOL might be before the EOF char.

	if !(inEofChar != 0) {
		goto __10
	}
	eol = *(*uintptr)(unsafe.Pointer(bp + 8 /* dst */))
__11:
	if !(eol < *(*uintptr)(unsafe.Pointer(bp + 80))) {
		goto __13
	}
	if !(int32(*(*int8)(unsafe.Pointer(eol))) == inEofChar) {
		goto __14
	}
	*(*uintptr)(unsafe.Pointer(bp + 80 /* dstEnd */)) = eol
	eof = eol
	goto __13
__14:
	;
	goto __12
__12:
	eol++
	goto __11
	goto __13
__13:
	;
__10:
	;

	// On EOL, leave current file position pointing after the EOL, but
	// don't store the EOL in the output string.

	switch (*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation {
	case TCL_TRANSLATE_LF:
		goto __16
	case TCL_TRANSLATE_CR:
		goto __17
	case TCL_TRANSLATE_CRLF:
		goto __18
	case TCL_TRANSLATE_AUTO:
		goto __19
	}
	goto __15
__16:
	eol = *(*uintptr)(unsafe.Pointer(bp + 8 /* dst */))
__20:
	if !(eol < *(*uintptr)(unsafe.Pointer(bp + 80))) {
		goto __22
	}
	if !(int32(*(*int8)(unsafe.Pointer(eol))) == '\n') {
		goto __23
	}
	skip = 1
	goto gotEOL
__23:
	;
	goto __21
__21:
	eol++
	goto __20
	goto __22
__22:
	;
	goto __15
__17:
	eol = *(*uintptr)(unsafe.Pointer(bp + 8 /* dst */))
__24:
	if !(eol < *(*uintptr)(unsafe.Pointer(bp + 80))) {
		goto __26
	}
	if !(int32(*(*int8)(unsafe.Pointer(eol))) == '\r') {
		goto __27
	}
	skip = 1
	goto gotEOL
__27:
	;
	goto __25
__25:
	eol++
	goto __24
	goto __26
__26:
	;
	goto __15
__18:
	eol = *(*uintptr)(unsafe.Pointer(bp + 8 /* dst */))
__28:
	if !(eol < *(*uintptr)(unsafe.Pointer(bp + 80))) {
		goto __30
	}
	if !(int32(*(*int8)(unsafe.Pointer(eol))) == '\r') {
		goto __31
	}
	eol++

	// If a CR is at the end of the buffer, then check for a
	// LF at the begining of the next buffer, unless EOF char
	// was found already.

	if !(eol >= *(*uintptr)(unsafe.Pointer(bp + 80))) {
		goto __32
	}

	if !(eol != eof) {
		goto __33
	}
	offset = int32((int64(eol) - int64((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)) / 1)
	*(*uintptr)(unsafe.Pointer(bp + 8 /* dst */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* dstEnd */))
	if !(sFilterInputBytes(tls, chanPtr, bp+16) != 0) {
		goto __34
	}
	goto restore
__34:
	;
	*(*uintptr)(unsafe.Pointer(bp + 80 /* dstEnd */)) = *(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr((*GetsState)(unsafe.Pointer(bp+16)).FbytesWrote)
	eol = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(offset)
__33:
	;
	if !(eol >= *(*uintptr)(unsafe.Pointer(bp + 80))) {
		goto __35
	}
	skip = 0
	goto gotEOL
__35:
	;
__32:
	;
	if !(int32(*(*int8)(unsafe.Pointer(eol))) == '\n') {
		goto __36
	}
	eol--
	skip = 2
	goto gotEOL
__36:
	;
__31:
	;
	goto __29
__29:
	eol++
	goto __28
	goto __30
__30:
	;
	goto __15
__19:
	eol = *(*uintptr)(unsafe.Pointer(bp + 8 /* dst */))
	skip = 1
	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<12) != 0) {
		goto __37
	}
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 12)
	if !(eol < *(*uintptr)(unsafe.Pointer(bp + 80)) && int32(*(*int8)(unsafe.Pointer(eol))) == '\n') {
		goto __38
	}

	bufPtr = (*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).FbufPtr
	XTcl_ExternalToUtf(tls, uintptr(0), (*GetsState)(unsafe.Pointer(bp+16 /* &gs */)).Fencoding, bufPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved),
		(*GetsState)(unsafe.Pointer(bp+16 /* &gs */)).FrawRead, (*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags|
			TCL_ENCODING_NO_TERMINATE, bp+16+32, bp+72,
		int32(unsafe.Sizeof([3]int8{})), bp+76, uintptr(0), uintptr(0))
	*(*int32)(unsafe.Pointer(bufPtr + 8)) += *(*int32)(unsafe.Pointer(bp + 76))
	*(*int32)(unsafe.Pointer(bp + 16 + 40)) -= *(*int32)(unsafe.Pointer(bp + 76))
	(*GetsState)(unsafe.Pointer(bp+16 /* &gs */)).FbytesWrote--
	(*GetsState)(unsafe.Pointer(bp+16 /* &gs */)).FcharsWrote--
	libc.Xmemmove(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* dst */)), *(*uintptr)(unsafe.Pointer(bp + 8))+uintptr(1), uint64((int64(*(*uintptr)(unsafe.Pointer(bp + 80)))-int64(*(*uintptr)(unsafe.Pointer(bp + 8))))/1))
	*(*uintptr)(unsafe.Pointer(bp + 80 /* dstEnd */))--
__38:
	;
__37:
	;
	eol = *(*uintptr)(unsafe.Pointer(bp + 8 /* dst */))
__39:
	if !(eol < *(*uintptr)(unsafe.Pointer(bp + 80))) {
		goto __41
	}
	if !(int32(*(*int8)(unsafe.Pointer(eol))) == '\r') {
		goto __42
	}
	eol++
	if !(eol == *(*uintptr)(unsafe.Pointer(bp + 80))) {
		goto __44
	}
	// If buffer ended on \r, peek ahead to see if a \n is
	// available, unless EOF char was found already.

	if !(eol != eof) {
		goto __45
	}

	offset1 = int32((int64(eol) - int64((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)) / 1)
	*(*uintptr)(unsafe.Pointer(bp + 8 /* dst */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* dstEnd */))
	sPeekAhead(tls, chanPtr, bp+80, bp+16)
	eol = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(offset1)
__45:
	;

	if !(eol >= *(*uintptr)(unsafe.Pointer(bp + 80))) {
		goto __46
	}
	eol--
	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 12
	goto gotEOL
__46:
	;
__44:
	;
	if !(int32(*(*int8)(unsafe.Pointer(eol))) == '\n') {
		goto __47
	}
	skip++
__47:
	;
	eol--
	goto gotEOL
	goto __43
__42:
	if !(int32(*(*int8)(unsafe.Pointer(eol))) == '\n') {
		goto __48
	}
	goto gotEOL
__48:
	;
__43:
	;
	goto __40
__40:
	eol++
	goto __39
	goto __41
__41:
	;
__15:
	;
	if !(eof != uintptr(0)) {
		goto __49
	}
	// EOF character was seen. On EOF, leave current file position
	// pointing at the EOF character, but don't store the EOF
	// character in the output string.

	*(*uintptr)(unsafe.Pointer(bp + 80 /* dstEnd */)) = eof
	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1)<<9 | int32(1)<<10
	*(*int32)(unsafe.Pointer(statePtr + 32)) |= TCL_ENCODING_END
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<11 | int32(1)<<12)
__49:
	;
	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0) {
		goto __50
	}
	skip = 0
	eol = *(*uintptr)(unsafe.Pointer(bp + 80 /* dstEnd */))
	if !(eol == (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes+uintptr(*(*int32)(unsafe.Pointer(bp)))) {
		goto __51
	}
	// If we didn't append any bytes before encountering EOF,
	// caller needs to see -1.

	XTcl_SetObjLength(tls, objPtr, *(*int32)(unsafe.Pointer(bp /* oldLength */)))
	sCommonGetsCleanup(tls, chanPtr)
	copiedTotal = -1
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 11)
	goto done
__51:
	;
	goto gotEOL
__50:
	;
	*(*uintptr)(unsafe.Pointer(bp + 8 /* dst */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* dstEnd */))
	goto __6
__7:
	;

	// Found EOL or EOF, but the output buffer may now contain too many UTF-8
	// characters. We need to know how many raw bytes correspond to the number
	// of UTF-8 characters we want, plus how many raw bytes correspond to the
	// character(s) making up EOL (if any), so we can remove the correct
	// number of bytes from the channel buffer.

gotEOL:
	// Regenerate the top channel, in case it was changed due to
	// self-modifying reflected transforms.

	if !(chanPtr != (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr) {
		goto __52
	}
	XTclChannelRelease(tls, chanPtr)
	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr
	XTclChannelPreserve(tls, chanPtr)
__52:
	;

	bufPtr = (*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).FbufPtr
	if !(bufPtr == uintptr(0)) {
		goto __53
	}
	XTcl_Panic(tls, ts+33214, 0)
__53:
	;
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingState = (*GetsState)(unsafe.Pointer(bp + 16 /* &gs */)).Fstate
	XTcl_ExternalToUtf(tls, uintptr(0), (*GetsState)(unsafe.Pointer(bp+16 /* &gs */)).Fencoding, bufPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved), (*GetsState)(unsafe.Pointer(bp+16 /* &gs */)).FrawRead,
		(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags|TCL_ENCODING_NO_TERMINATE,
		statePtr+24, *(*uintptr)(unsafe.Pointer(bp + 8 /* dst */)),
		int32((int64(eol)-int64(*(*uintptr)(unsafe.Pointer(bp + 8))))/1+int64(skip)+int64(TCL_UTF_MAX)-int64(1)), bp+16+40, uintptr(0),
		bp+16+48)
	*(*int32)(unsafe.Pointer(bufPtr + 8)) += (*GetsState)(unsafe.Pointer(bp + 16)).FrawRead

	// Recycle all the emptied buffers.

	XTcl_SetObjLength(tls, objPtr, int32((int64(eol)-int64((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes))/1))
	sCommonGetsCleanup(tls, chanPtr)
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 11)
	copiedTotal = (*GetsState)(unsafe.Pointer(bp+16)).FtotalChars + (*GetsState)(unsafe.Pointer(bp+16)).FcharsWrote - skip
	goto done

	// Couldn't get a complete line. This only happens if we get a error
	// reading from the channel or we are non-blocking and there wasn't an EOL
	// or EOF in the data available.

restore:
	// Regenerate the top channel, in case it was changed due to
	// self-modifying reflected transforms.
	if !(chanPtr != (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr) {
		goto __54
	}
	XTclChannelRelease(tls, chanPtr)
	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr
	XTclChannelPreserve(tls, chanPtr)
__54:
	;
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
	if !(bufPtr != uintptr(0)) {
		goto __55
	}
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved = oldRemoved
	bufPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
__55:
	;

__56:
	if !(bufPtr != uintptr(0)) {
		goto __58
	}
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved = BUFFER_PADDING
	goto __57
__57:
	bufPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
	goto __56
	goto __58
__58:
	;
	sCommonGetsCleanup(tls, chanPtr)

	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingState = oldState
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags = oldFlags
	XTcl_SetObjLength(tls, objPtr, *(*int32)(unsafe.Pointer(bp /* oldLength */)))

	// We didn't get a complete line so we need to indicate to UpdateInterest
	// that the gets blocked. It will wait for more data instead of firing a
	// timer, avoiding a busy wait. This is where we are assuming that the
	// next operation is a gets. No more file events will be delivered on this
	// channel until new data arrives or some operation is performed on the
	// channel (e.g. gets, read, fconfigure) that changes the blocking state.
	// Note that this means a file event will not be delivered even though a
	// read would be able to consume the buffered data.

	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 14
	copiedTotal = -1

	// Update the notifier state so we don't block while there is still data
	// in the buffers.

done:
	;

	// Regenerate the top channel, in case it was changed due to
	// self-modifying reflected transforms.

	if !(chanPtr != (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr) {
		goto __59
	}
	XTclChannelRelease(tls, chanPtr)
	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr
	XTclChannelPreserve(tls, chanPtr)
__59:
	;
	sUpdateInterest(tls, chanPtr)
	XTclChannelRelease(tls, chanPtr)
	return copiedTotal
}

//---------------------------------------------------------------------------
//
// TclGetsObjBinary --
//
//	A variation of Tcl_GetsObj that works directly on the buffers until
//	end-of-line or end-of-file has been seen. Bytes read from the input
//	channel return as a ByteArray obj.
//
//	WARNING!  The notion of "binary" used here is different from notions
//	of "binary" used in other places. In particular, this "binary" routine
//	may be called when an -eofchar is set on the channel.
//
// Results:
//	Number of characters accumulated in the object or -1 if error,
//	blocked, or EOF. If -1, use Tcl_GetErrno() to retrieve the POSIX error
//	code for the error or condition that occurred.
//
// Side effects:
//	Consumes input from the channel.
//
//	On reading EOF, leave channel pointing at EOF char. On reading EOL,
//	leave channel pointing after EOL, but don't return EOL in dst buffer.
//
//---------------------------------------------------------------------------

func sTclGetsObjBinary(tls *libc.TLS, chan1 Tcl_Channel, objPtr uintptr) int32 { /* tclIO.c:4927:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var chanPtr uintptr
	var statePtr uintptr
	// State info for channel
	var bufPtr uintptr
	var inEofChar int32
	var skip int32
	var copiedTotal int32
	var oldLength int32
	var oldFlags int32
	var oldRemoved int32
	var rawLen int32
	// var byteLen int32 at bp, 4

	var eolChar int32
	var dst uintptr
	var dstEnd uintptr
	var eol uintptr
	var eof uintptr
	var byteArray uintptr
	chanPtr = chan1
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr
	XTclChannelPreserve(tls, chanPtr)

	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead

	// Preserved so we can restore the channel's state in case we don't find a
	// newline in the available input.

	byteArray = XTcl_GetByteArrayFromObj(tls, objPtr, bp)
	oldFlags = (*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags
	oldRemoved = BUFFER_PADDING
	oldLength = *(*int32)(unsafe.Pointer(bp /* byteLen */))
	if !(bufPtr != uintptr(0)) {
		goto __1
	}
	oldRemoved = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved
__1:
	;

	rawLen = 0
	skip = 0
	eof = uintptr(0)
	inEofChar = (*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar

	// Only handle TCL_TRANSLATE_LF and TCL_TRANSLATE_CR.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation == TCL_TRANSLATE_LF {
		eolChar = '\n'
	} else {
		eolChar = '\r'
	}

	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 11)
__2:
	if !(1 != 0) {
		goto __3
	}
	// Subtract the number of bytes that were removed from channel buffer
	// during last call.

	if !(bufPtr != uintptr(0)) {
		goto __4
	}
	*(*int32)(unsafe.Pointer(bufPtr + 8)) += rawLen
	if !!((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded > (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved) {
		goto __5
	}
	bufPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
__5:
	;
__4:
	;

	if !(bufPtr == uintptr(0) || (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded == BUFFER_PADDING) {
		goto __6
	}
	// All channel buffers were exhausted and the caller still hasn't
	// seen EOL. Need to read more bytes from the channel device. Side
	// effect is to allocate another channel buffer.

	if !(sGetInput(tls, chanPtr) != 0) {
		goto __8
	}
	goto restore
__8:
	;
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail
	if !(bufPtr == uintptr(0)) {
		goto __9
	}
	goto restore
__9:
	;
	goto __7
__6:
	// Incoming CHANNEL_STICKY_EOF is filtered out on entry.  A new
	// CHANNEL_STICKY_EOF set in this routine leads to return before
	// coming back here.  When we are not dealing with
	// CHANNEL_STICKY_EOF, a CHANNEL_EOF implies an empty buffer.
	// Here the buffer is non-empty so we know we're a non-EOF.

	;

__7:
	;

	dst = bufPtr + 24 + uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved)
	dstEnd = dst + uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded-(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved)

	// Remember if EOF char is seen, then look for EOL anyhow, because the
	// EOL might be before the EOF char.
	// XXX - in the binary case, consider coincident search for eol/eof.

	if !(inEofChar != 0) {
		goto __10
	}
	eol = dst
__11:
	if !(eol < dstEnd) {
		goto __13
	}
	if !(int32(*(*uint8)(unsafe.Pointer(eol))) == inEofChar) {
		goto __14
	}
	dstEnd = eol
	eof = eol
	goto __13
__14:
	;
	goto __12
__12:
	eol++
	goto __11
	goto __13
__13:
	;
__10:
	;

	// On EOL, leave current file position pointing after the EOL, but
	// don't store the EOL in the output string.

	eol = dst
__15:
	if !(eol < dstEnd) {
		goto __17
	}
	if !(int32(*(*uint8)(unsafe.Pointer(eol))) == eolChar) {
		goto __18
	}
	skip = 1
	goto gotEOL
__18:
	;
	goto __16
__16:
	eol++
	goto __15
	goto __17
__17:
	;
	if !(eof != uintptr(0)) {
		goto __19
	}
	// EOF character was seen. On EOF, leave current file position
	// pointing at the EOF character, but don't store the EOF
	// character in the output string.

	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1)<<9 | int32(1)<<10
	*(*int32)(unsafe.Pointer(statePtr + 32)) |= TCL_ENCODING_END
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<11 | int32(1)<<12)
__19:
	;
	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0) {
		goto __20
	}
	skip = 0
	eol = dstEnd
	if !(dst == dstEnd && *(*int32)(unsafe.Pointer(bp)) == oldLength) {
		goto __21
	}
	// If we didn't append any bytes before encountering EOF,
	// caller needs to see -1.

	byteArray = XTcl_SetByteArrayLength(tls, objPtr, oldLength)
	sCommonGetsCleanup(tls, chanPtr)
	copiedTotal = -1
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 11)
	goto done
__21:
	;
	goto gotEOL
__20:
	;
	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<11|int32(1)<<3) ==
		int32(1)<<11|int32(1)<<3) {
		goto __22
	}
	goto restore
__22:
	;

	// Copy bytes from the channel buffer to the ByteArray. This may
	// realloc space, so keep track of result.

	rawLen = int32((int64(dstEnd) - int64(dst)) / 1)
	byteArray = XTcl_SetByteArrayLength(tls, objPtr, *(*int32)(unsafe.Pointer(bp))+rawLen)
	libc.Xmemcpy(tls, byteArray+uintptr(*(*int32)(unsafe.Pointer(bp))), dst, uint64(rawLen))
	*(*int32)(unsafe.Pointer(bp /* byteLen */)) += rawLen
	goto __2
__3:
	;

	// Found EOL or EOF, but the output buffer may now contain too many bytes.
	// We need to know how many bytes correspond to the number we want, so we
	// can remove the correct number of bytes from the channel buffer.

gotEOL:
	if !(bufPtr == uintptr(0)) {
		goto __23
	}
	XTcl_Panic(tls, ts+33260, 0)
__23:
	;

	rawLen = int32((int64(eol) - int64(dst)) / 1)
	byteArray = XTcl_SetByteArrayLength(tls, objPtr, *(*int32)(unsafe.Pointer(bp))+rawLen)
	libc.Xmemcpy(tls, byteArray+uintptr(*(*int32)(unsafe.Pointer(bp))), dst, uint64(rawLen))
	*(*int32)(unsafe.Pointer(bp /* byteLen */)) += rawLen
	*(*int32)(unsafe.Pointer(bufPtr + 8)) += rawLen + skip

	// Convert the buffer if there was an encoding.
	// XXX - unimplemented.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fencoding != uintptr(0)) {
		goto __24
	}
__24:
	;

	// Recycle all the emptied buffers.

	sCommonGetsCleanup(tls, chanPtr)
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 11)
	copiedTotal = *(*int32)(unsafe.Pointer(bp /* byteLen */))
	goto done

	// Couldn't get a complete line. This only happens if we get a error
	// reading from the channel or we are non-blocking and there wasn't an EOL
	// or EOF in the data available.

restore:
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
	if !(bufPtr != 0) {
		goto __25
	}
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved = oldRemoved
	bufPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
__25:
	;

__26:
	if !(bufPtr != uintptr(0)) {
		goto __28
	}
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved = BUFFER_PADDING
	goto __27
__27:
	bufPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
	goto __26
	goto __28
__28:
	;
	sCommonGetsCleanup(tls, chanPtr)

	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags = oldFlags
	byteArray = XTcl_SetByteArrayLength(tls, objPtr, oldLength)

	// We didn't get a complete line so we need to indicate to UpdateInterest
	// that the gets blocked. It will wait for more data instead of firing a
	// timer, avoiding a busy wait. This is where we are assuming that the
	// next operation is a gets. No more file events will be delivered on this
	// channel until new data arrives or some operation is performed on the
	// channel (e.g. gets, read, fconfigure) that changes the blocking state.
	// Note that this means a file event will not be delivered even though a
	// read would be able to consume the buffered data.

	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 14
	copiedTotal = -1

	// Update the notifier state so we don't block while there is still data
	// in the buffers.

done:
	;

	sUpdateInterest(tls, chanPtr)
	XTclChannelRelease(tls, chanPtr)
	return copiedTotal
}

//---------------------------------------------------------------------------
//
// FreeBinaryEncoding --
//
//	Frees any "iso8859-1" Tcl_Encoding created by [gets] on a binary
//	channel in a thread as part of that thread's finalization.
//
// Results:
//	None.
//
//---------------------------------------------------------------------------

func sFreeBinaryEncoding(tls *libc.TLS, dummy ClientData) { /* tclIO.c:5188:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))
	_ = dummy

	if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FbinaryEncoding != uintptr(0) {
		XTcl_FreeEncoding(tls, (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FbinaryEncoding)
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FbinaryEncoding = uintptr(0)
	}
}

func sGetBinaryEncoding(tls *libc.TLS) Tcl_Encoding { /* tclIO.c:5201:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))

	if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FbinaryEncoding == uintptr(0) {
		(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FbinaryEncoding = XTcl_GetEncoding(tls, uintptr(0), ts+25963)
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFreeBinaryEncoding})), uintptr(0))
	}
	if (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FbinaryEncoding == uintptr(0) {
		XTcl_Panic(tls, ts+33311, 0)
	}
	return (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FbinaryEncoding
}

//---------------------------------------------------------------------------
//
// FilterInputBytes --
//
//	Helper function for Tcl_GetsObj. Produces UTF-8 characters from raw
//	bytes read from the channel.
//
//	Consumes available bytes from channel buffers. When channel buffers
//	are exhausted, reads more bytes from channel device into a new channel
//	buffer. It is the caller's responsibility to free the channel buffers
//	that have been exhausted.
//
// Results:
//	The return value is -1 if there was an error reading from the channel,
//	0 otherwise.
//
// Side effects:
//	Status object keeps track of how much data from channel buffers has
//	been consumed and where UTF-8 bytes should be stored.
//
//---------------------------------------------------------------------------

func sFilterInputBytes(tls *libc.TLS, chanPtr uintptr, gsPtr uintptr) int32 { /* tclIO.c:5240:1: */
	var statePtr uintptr
	// State info for channel
	var bufPtr uintptr
	var raw uintptr
	var dst uintptr
	var offset int32
	var toRead int32
	var dstNeeded int32
	var spaceLeft int32
	var result int32
	var rawLen int32
	var objPtr uintptr
	var length int32
	// The last few bytes in this channel buffer were the start of a
	// multibyte sequence. If this buffer was full, then move them to the
	// next buffer so the bytes will be contiguous.

	var nextPtr uintptr
	var extra int32
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	objPtr = (*GetsState)(unsafe.Pointer(gsPtr)).FobjPtr

	// Subtract the number of bytes that were removed from channel buffer
	// during last call.

	bufPtr = (*GetsState)(unsafe.Pointer(gsPtr)).FbufPtr
	if !(bufPtr != uintptr(0)) {
		goto __1
	}
	*(*int32)(unsafe.Pointer(bufPtr + 8)) += (*GetsState)(unsafe.Pointer(gsPtr)).FrawRead
	if !!((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded > (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved) {
		goto __2
	}
	bufPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
__2:
	;
__1:
	;
	*(*int32)(unsafe.Pointer(gsPtr + 52)) += (*GetsState)(unsafe.Pointer(gsPtr)).FcharsWrote

	if !(bufPtr == uintptr(0) || (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded == BUFFER_PADDING) {
		goto __3
	}
	// All channel buffers were exhausted and the caller still hasn't seen
	// EOL. Need to read more bytes from the channel device. Side effect
	// is to allocate another channel buffer.

read:
	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<3|int32(1)<<11) ==
		int32(1)<<3|int32(1)<<11) {
		goto __5
	}
	(*GetsState)(unsafe.Pointer(gsPtr)).FcharsWrote = 0
	(*GetsState)(unsafe.Pointer(gsPtr)).FrawRead = 0
	return -1
__5:
	;
	if !(sGetInput(tls, chanPtr) != 0) {
		goto __6
	}
	(*GetsState)(unsafe.Pointer(gsPtr)).FcharsWrote = 0
	(*GetsState)(unsafe.Pointer(gsPtr)).FrawRead = 0
	return -1
__6:
	;
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail
	(*GetsState)(unsafe.Pointer(gsPtr)).FbufPtr = bufPtr
	if !(bufPtr == uintptr(0)) {
		goto __7
	}
	(*GetsState)(unsafe.Pointer(gsPtr)).FcharsWrote = 0
	(*GetsState)(unsafe.Pointer(gsPtr)).FrawRead = 0
	return -1
__7:
	;
	goto __4
__3:
	// Incoming CHANNEL_STICKY_EOF is filtered out on entry.  A new
	// CHANNEL_STICKY_EOF set in this routine leads to return before
	// coming back here.  When we are not dealing with CHANNEL_STICKY_EOF,
	// a CHANNEL_EOF implies an empty buffer.  Here the buffer is
	// non-empty so we know we're a non-EOF.

	;

__4:
	;

	// Convert some of the bytes from the channel buffer to UTF-8. Space in
	// objPtr's string rep is used to hold the UTF-8 characters. Grow the
	// string rep if we need more space.

	raw = bufPtr + 24 + uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved)
	rawLen = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved

	dst = *(*uintptr)(unsafe.Pointer((*GetsState)(unsafe.Pointer(gsPtr)).FdstPtr))
	offset = int32((int64(dst) - int64((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)) / 1)
	toRead = ENCODING_LINESIZE
	if !(toRead > rawLen) {
		goto __8
	}
	toRead = rawLen
__8:
	;
	dstNeeded = toRead * TCL_UTF_MAX
	spaceLeft = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength - offset
	if !(dstNeeded > spaceLeft) {
		goto __9
	}
	length = offset + func() int32 {
		if offset < dstNeeded {
			return dstNeeded
		}
		return offset
	}()

	if !(XTcl_AttemptSetObjLength(tls, objPtr, length) == 0) {
		goto __10
	}
	length = offset + dstNeeded
	if !(XTcl_AttemptSetObjLength(tls, objPtr, length) == 0) {
		goto __11
	}
	dstNeeded = TCL_UTF_MAX - 1 + toRead
	length = offset + dstNeeded
	XTcl_SetObjLength(tls, objPtr, length)
__11:
	;
__10:
	;
	spaceLeft = length - offset
	dst = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(offset)
	*(*uintptr)(unsafe.Pointer((*GetsState)(unsafe.Pointer(gsPtr)).FdstPtr)) = dst
__9:
	;
	(*GetsState)(unsafe.Pointer(gsPtr)).Fstate = (*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingState
	result = XTcl_ExternalToUtf(tls, uintptr(0), (*GetsState)(unsafe.Pointer(gsPtr)).Fencoding, raw, rawLen,
		(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags|TCL_ENCODING_NO_TERMINATE,
		statePtr+24, dst, spaceLeft, gsPtr+40,
		gsPtr+44, gsPtr+48)

	// Make sure that if we go through 'gets', that we reset the
	// TCL_ENCODING_START flag still. [Bug #523988]

	*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(TCL_ENCODING_START)

	if !(result == -1) {
		goto __12
	}

	nextPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
	if !!(bufPtr != 0 && (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded >= (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength) {
		goto __13
	}
	if !((*GetsState)(unsafe.Pointer(gsPtr)).FrawRead > 0) {
		goto __15
	}
	// Some raw bytes were converted to UTF-8. Fall through,
	// returning those UTF-8 characters because a EOL might be
	// present in them.
	goto __16
__15:
	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0) {
		goto __17
	}
	// There was a partial character followed by EOF on the
	// device. Fall through, returning that nothing was found.

	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded
	goto __18
__17:
	// There are no more cached raw bytes left. See if we can get
	// some more, but avoid blocking on a non-blocking channel.

	goto read
__18:
	;
__16:
	;
	goto __14
__13:
	if !(nextPtr == uintptr(0)) {
		goto __19
	}
	nextPtr = sAllocChannelBuffer(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FbufSize)
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr = nextPtr
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = nextPtr
__19:
	;
	extra = rawLen - (*GetsState)(unsafe.Pointer(gsPtr)).FrawRead
	libc.Xmemcpy(tls, nextPtr+24+uintptr(BUFFER_PADDING-extra),
		raw+uintptr((*GetsState)(unsafe.Pointer(gsPtr)).FrawRead), Size_t(extra))
	*(*int32)(unsafe.Pointer(nextPtr + 8)) -= extra
	*(*int32)(unsafe.Pointer(bufPtr + 4)) -= extra
__14:
	;
__12:
	;

	(*GetsState)(unsafe.Pointer(gsPtr)).FbufPtr = bufPtr
	return 0
}

//---------------------------------------------------------------------------
//
// PeekAhead --
//
//	Helper function used by Tcl_GetsObj(). Called when we've seen a \r at
//	the end of the UTF-8 string and want to look ahead one character to
//	see if it is a \n.
//
// Results:
//	*gsPtr->dstPtr is filled with a pointer to the start of the range of
//	UTF-8 characters that were found by peeking and *dstEndPtr is filled
//	with a pointer to the bytes just after the end of the range.
//
// Side effects:
//	If no more raw bytes were available in one of the channel buffers,
//	tries to perform a non-blocking read to get more bytes from the
//	channel device.
//
//---------------------------------------------------------------------------

func sPeekAhead(tls *libc.TLS, chanPtr uintptr, dstEndPtr uintptr, gsPtr uintptr) { /* tclIO.c:5431:1: */
	var statePtr uintptr
	// State info for channel
	var bufPtr uintptr
	var blockModeProc uintptr
	var bytesLeft int32
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	bufPtr = (*GetsState)(unsafe.Pointer(gsPtr)).FbufPtr

	// If there's any more raw input that's still buffered, we'll peek into
	// that. Otherwise, only get more data from the channel driver if it looks
	// like there might actually be more data. The assumption is that if the
	// channel buffer is filled right up to the end, then there might be more
	// data to read.

	blockModeProc = uintptr(0)
	if !((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr == uintptr(0)) {
		goto __1
	}
	bytesLeft = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved - (*GetsState)(unsafe.Pointer(gsPtr)).FrawRead
	if !(bytesLeft == 0) {
		goto __2
	}
	if !!(bufPtr != 0 && (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded >= (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength) {
		goto __3
	}
	// Don't peek ahead if last read was short read.

	goto cleanup
__3:
	;
	if !!((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<3) != 0) {
		goto __4
	}
	blockModeProc = XTcl_ChannelBlockModeProc(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)
	if !(blockModeProc == uintptr(0)) {
		goto __5
	}
	// Don't peek ahead if cannot set non-blocking mode.

	goto cleanup
__5:
	;
	sStackSetBlockMode(tls, chanPtr, TCL_MODE_NONBLOCKING)
__4:
	;
__2:
	;
__1:
	;
	if !(sFilterInputBytes(tls, chanPtr, gsPtr) == 0) {
		goto __6
	}
	*(*uintptr)(unsafe.Pointer(dstEndPtr)) = *(*uintptr)(unsafe.Pointer((*GetsState)(unsafe.Pointer(gsPtr)).FdstPtr)) + uintptr((*GetsState)(unsafe.Pointer(gsPtr)).FbytesWrote)
__6:
	;
	if !(blockModeProc != uintptr(0)) {
		goto __7
	}
	sStackSetBlockMode(tls, chanPtr, TCL_MODE_BLOCKING)
__7:
	;
	return

cleanup:
	*(*int32)(unsafe.Pointer(bufPtr + 8)) += (*GetsState)(unsafe.Pointer(gsPtr)).FrawRead
	(*GetsState)(unsafe.Pointer(gsPtr)).FrawRead = 0
	*(*int32)(unsafe.Pointer(gsPtr + 52)) += (*GetsState)(unsafe.Pointer(gsPtr)).FcharsWrote
	(*GetsState)(unsafe.Pointer(gsPtr)).FbytesWrote = 0
	(*GetsState)(unsafe.Pointer(gsPtr)).FcharsWrote = 0
}

//---------------------------------------------------------------------------
//
// CommonGetsCleanup --
//
//	Helper function for Tcl_GetsObj() to restore the channel after a
//	"gets" operation.
//
// Results:
//	None.
//
// Side effects:
//	Encoding may be freed.
//
//---------------------------------------------------------------------------

func sCommonGetsCleanup(tls *libc.TLS, chanPtr uintptr) { /* tclIO.c:5511:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var bufPtr uintptr
	var nextPtr uintptr

	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
	for ; bufPtr != uintptr(0); bufPtr = nextPtr {
		nextPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
		if (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded > (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved {
			break
		}
		sRecycleBuffer(tls, statePtr, bufPtr, 0)
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = bufPtr
	if bufPtr == uintptr(0) {
		(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = uintptr(0)
	} else {
		// If any multi-byte characters were split across channel buffer
		// boundaries, the split-up bytes were moved to the next channel
		// buffer by FilterInputBytes(). Move the bytes back to their original
		// buffer because the caller could change the channel's encoding which
		// could change the interpretation of whether those bytes really made
		// up multi-byte characters after all.

		nextPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
		for ; nextPtr != uintptr(0); nextPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr {
			var extra int32

			extra = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded
			if extra > 0 {
				libc.Xmemcpy(tls, bufPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded),
					nextPtr+24+uintptr(BUFFER_PADDING-extra),
					Size_t(extra))
				*(*int32)(unsafe.Pointer(bufPtr + 4)) += extra
				(*ChannelBuffer)(unsafe.Pointer(nextPtr)).FnextRemoved = BUFFER_PADDING
			}
			bufPtr = nextPtr
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_Read --
//
//	Reads a given number of bytes from a channel. EOL and EOF translation
//	is done on the bytes being read, so the number of bytes consumed from
//	the channel may not be equal to the number of bytes stored in the
//	destination buffer.
//
//	No encoding conversions are applied to the bytes being read.
//
// Results:
//	The number of bytes read, or -1 on error. Use Tcl_GetErrno() to
//	retrieve the error code for the error that occurred.
//
// Side effects:
//	May cause input to be buffered.
//
//----------------------------------------------------------------------

func XTcl_Read(tls *libc.TLS, chan1 Tcl_Channel, dst uintptr, bytesToRead int32) int32 { /* tclIO.c:5579:1: */
	var chanPtr uintptr = chan1
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	if sCheckChannelErrors(tls, statePtr, int32(1)<<1) != 0 {
		return -1
	}

	return sDoRead(tls, chanPtr, dst, bytesToRead, 0)
}

//----------------------------------------------------------------------
//
// Tcl_ReadRaw --
//
//	Reads a given number of bytes from a channel. EOL and EOF translation
//	is done on the bytes being read, so the number of bytes consumed from
//	the channel may not be equal to the number of bytes stored in the
//	destination buffer.
//
//	No encoding conversions are applied to the bytes being read.
//
// Results:
//	The number of bytes read, or -1 on error. Use Tcl_GetErrno() to
//	retrieve the error code for the error that occurred.
//
// Side effects:
//	May cause input to be buffered.
//
//----------------------------------------------------------------------

func XTcl_ReadRaw(tls *libc.TLS, chan1 Tcl_Channel, readBuf uintptr, bytesToRead int32) int32 { /* tclIO.c:5624:1: */
	var chanPtr uintptr = chan1
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var copied int32 = 0

	if sCheckChannelErrors(tls, statePtr, int32(1)<<1|int32(1)<<16) != 0 {
		return -1
	}

	// First read bytes from the push-back buffers.

	for (*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead != 0 && bytesToRead > 0 {
		var bufPtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead
		var bytesInBuffer int32 = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved
		var toCopy int32
		if bytesInBuffer < bytesToRead {
			toCopy = bytesInBuffer
		} else {
			toCopy = bytesToRead
		}

		// Copy the current chunk into the read buffer.

		libc.Xmemcpy(tls, readBuf, bufPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved), uint64(toCopy))
		*(*int32)(unsafe.Pointer(bufPtr + 8)) += toCopy
		copied = copied + toCopy
		readBuf += uintptr(toCopy)
		bytesToRead = bytesToRead - toCopy

		// If the current buffer is empty recycle it.

		if (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded == (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved {
			(*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
			if (*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead == uintptr(0) {
				(*Channel)(unsafe.Pointer(chanPtr)).FinQueueTail = uintptr(0)
			}
			sRecycleBuffer(tls, (*Channel)(unsafe.Pointer(chanPtr)).Fstate, bufPtr, 0)
		}
	}

	// Go to the driver only if we got nothing from pushback.  Have to do it
	// this way to avoid EOF mis-timings when we consider the ability that EOF
	// may not be a permanent condition in the driver, and in that case we
	// have to synchronize.

	if copied != 0 {
		return copied
	}

	// This test not needed.

	if bytesToRead > 0 {
		var nread int32 = sChanRead(tls, chanPtr, readBuf, bytesToRead)

		if nread > 0 {
			// Successful read (short is OK) - add to bytes copied.

			copied = copied + nread
		} else if nread < 0 {
			// An error signaled.  If CHANNEL_BLOCKED, then the error is not
			// real, but an indication of blocked state.  In that case, retain
			// the flag and let caller receive the short read of copied bytes
			// from the pushback.  HOWEVER, if copied==0 bytes from pushback
			// then repeat signalling the blocked state as an error to caller
			// so there is no false report of an EOF.  When !CHANNEL_BLOCKED,
			// the error is real and passes on to caller.

			if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<11) != 0) || copied == 0 {
				copied = -1
			}
		} else {
			// nread == 0.  Driver is at EOF. Let that state filter up.
		}
	}
	return copied
}

//---------------------------------------------------------------------------
//
// Tcl_ReadChars --
//
//	Reads from the channel until the requested number of characters have
//	been seen, EOF is seen, or the channel would block. EOL and EOF
//	translation is done. If reading binary data, the raw bytes are wrapped
//	in a Tcl byte array object. Otherwise, the raw bytes are converted to
//	UTF-8 using the channel's current encoding and stored in a Tcl string
//	object.
//
// Results:
//	The number of characters read, or -1 on error. Use Tcl_GetErrno() to
//	retrieve the error code for the error that occurred.
//
// Side effects:
//	May cause input to be buffered.
//
//---------------------------------------------------------------------------

func XTcl_ReadChars(tls *libc.TLS, chan1 Tcl_Channel, objPtr uintptr, toRead int32, appendFlag int32) int32 { /* tclIO.c:5742:1: */
	var chanPtr uintptr = chan1
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	if sCheckChannelErrors(tls, statePtr, int32(1)<<1) != 0 {
		// Update the notifier state so we don't block while there is still
		// data in the buffers.

		sUpdateInterest(tls, chanPtr)
		return -1
	}

	return sDoReadChars(tls, chanPtr, objPtr, toRead, appendFlag)
}

//---------------------------------------------------------------------------
//
// DoReadChars --
//
//	Reads from the channel until the requested number of characters have
//	been seen, EOF is seen, or the channel would block. EOL and EOF
//	translation is done. If reading binary data, the raw bytes are wrapped
//	in a Tcl byte array object. Otherwise, the raw bytes are converted to
//	UTF-8 using the channel's current encoding and stored in a Tcl string
//	object.
//
// Results:
//	The number of characters read, or -1 on error. Use Tcl_GetErrno() to
//	retrieve the error code for the error that occurred.
//
// Side effects:
//	May cause input to be buffered.
//
//---------------------------------------------------------------------------

func sDoReadChars(tls *libc.TLS, chanPtr uintptr, objPtr uintptr, toRead int32, appendFlag int32) int32 { /* tclIO.c:5798:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var bufPtr uintptr
	var copied int32
	var copiedNow int32
	var result int32
	var encoding Tcl_Encoding = (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding
	var binaryMode int32
	*(*int32)(unsafe.Pointer(bp /* factor */)) = UTF_EXPANSION_FACTOR

	binaryMode = libc.Bool32(encoding == uintptr(0) &&
		(*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation == TCL_TRANSLATE_LF &&
		(*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar == 0)

	if appendFlag == 0 {
		if binaryMode != 0 {
			XTcl_SetByteArrayLength(tls, objPtr, 0)
		} else {
			XTcl_SetObjLength(tls, objPtr, 0)

			// We're going to access objPtr->bytes directly, so we must ensure
			// that this is actually a string object (otherwise it might have
			// been pure Unicode).
			//
			// Probably not needed anymore.

			if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0) {
				XTcl_GetString(tls, objPtr)
			}
		}
	}

	// Early out when next read will see eofchar.
	//
	// NOTE: See DoRead for argument that it's a bug (one we're keeping) to
	// have this escape before the one for zero-char read request.

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<10) != 0 {
		*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 9

		// TODO: We don't need this call?
		sUpdateInterest(tls, chanPtr)
		return 0
	}

	// Special handling for zero-char read request.
	if toRead == 0 {
		if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0 {
			*(*int32)(unsafe.Pointer(statePtr + 32)) |= TCL_ENCODING_START
		}
		*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<11 | int32(1)<<9)
		*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(TCL_ENCODING_END)
		// TODO: We don't need this call?
		sUpdateInterest(tls, chanPtr)
		return 0
	}

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr
	XTclChannelPreserve(tls, chanPtr)

	// Must clear the BLOCKED|EOF flags here since we check before reading.

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0 {
		*(*int32)(unsafe.Pointer(statePtr + 32)) |= TCL_ENCODING_START
	}
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<11 | int32(1)<<9)
	*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(TCL_ENCODING_END)
	for copied = 0; uint32(toRead) > uint32(0); {
		copiedNow = -1
		if (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead != uintptr(0) {
			if binaryMode != 0 {
				copiedNow = sReadBytes(tls, statePtr, objPtr, toRead)
			} else {
				copiedNow = sReadChars(tls, statePtr, objPtr, toRead, bp)
			}

			// If the current buffer is empty recycle it.

			bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
			if (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded == (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved {
				var nextPtr uintptr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr

				sRecycleBuffer(tls, statePtr, bufPtr, 0)
				(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = nextPtr
				if nextPtr == uintptr(0) {
					(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = uintptr(0)
				}
			}
		}

		if copiedNow < 0 {
			if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0 {
				break
			}
			if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<3|int32(1)<<11) ==
				int32(1)<<3|int32(1)<<11 {
				break
			}
			result = sGetInput(tls, chanPtr)
			if chanPtr != (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr {
				XTclChannelRelease(tls, chanPtr)
				chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr
				XTclChannelPreserve(tls, chanPtr)
			}
			if result != 0 {
				if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<11) != 0) {
					copied = -1
				}
				break
			}
		} else {
			copied = copied + copiedNow
			toRead = toRead - copiedNow
		}
	}

	// Failure to fill a channel buffer may have left channel reporting a
	// "blocked" state, but so long as we fulfilled the request here, the
	// caller does not consider us blocked.

	if toRead == 0 {
		*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 11)
	}

	// Regenerate the top channel, in case it was changed due to
	// self-modifying reflected transforms.

	if chanPtr != (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr {
		XTclChannelRelease(tls, chanPtr)
		chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr
		XTclChannelPreserve(tls, chanPtr)
	}

	// Update the notifier state so we don't block while there is still data
	// in the buffers.

	sUpdateInterest(tls, chanPtr)
	XTclChannelRelease(tls, chanPtr)
	return copied
}

//---------------------------------------------------------------------------
//
// ReadBytes --
//
//	Reads from the channel until the requested number of bytes have been
//	seen, EOF is seen, or the channel would block. Bytes from the channel
//	are stored in objPtr as a ByteArray object. EOL and EOF translation
//	are done.
//
//	'bytesToRead' can safely be a very large number because space is only
//	allocated to hold data read from the channel as needed.
//
// Results:
//	The return value is the number of bytes appended to the object, or
//	-1 to indicate that zero bytes were read due to an EOF.
//
// Side effects:
//	The storage of bytes in objPtr can cause (re-)allocation of memory.
//
//---------------------------------------------------------------------------

func sReadBytes(tls *libc.TLS, statePtr uintptr, objPtr uintptr, bytesToRead int32) int32 { /* tclIO.c:5998:1: */
	var bufPtr uintptr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
	var srcLen int32 = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved
	var toRead int32
	if bytesToRead > srcLen || bytesToRead < 0 {
		toRead = srcLen
	} else {
		toRead = bytesToRead
	}

	XTclAppendBytesToByteArray(tls, objPtr, bufPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved),
		toRead)
	*(*int32)(unsafe.Pointer(bufPtr + 8)) += toRead
	return toRead
}

//---------------------------------------------------------------------------
//
// ReadChars --
//
//	Reads from the channel until the requested number of UTF-8 characters
//	have been seen, EOF is seen, or the channel would block. Raw bytes
//	from the channel are converted to UTF-8 and stored in objPtr. EOL and
//	EOF translation is done.
//
//	'charsToRead' can safely be a very large number because space is only
//	allocated to hold data read from the channel as needed.
//
//	'charsToRead' may *not* be 0.
//
// Results:
//	The return value is the number of characters appended to the object,
//	*offsetPtr is filled with the number of bytes that were appended, and
//	*factorPtr is filled with the expansion factor used to guess how many
//	bytes of UTF-8 to allocate to hold N source bytes.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sReadChars(tls *libc.TLS, statePtr uintptr, objPtr uintptr, charsToRead int32, factorPtr uintptr) int32 { /* tclIO.c:6051:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var encoding Tcl_Encoding
	var savedState Tcl_EncodingState
	var bufPtr uintptr
	var savedIEFlags int32
	var savedFlags int32
	var dst uintptr
	var src uintptr
	// var numBytes int32 at bp, 4

	var srcLen int32

	// One src byte can yield at most one character.  So when the number of
	// src bytes we plan to read is less than the limit on character count to
	// be read, clearly we will remain within that limit, and we can use the
	// value of "srcLen" as a tighter limit for sizing receiving buffers.

	var toRead int32

	// 'factor' is how much we guess that the bytes in the source buffer will
	// expand when converted to UTF-8 chars. This guess comes from analyzing
	// how many characters were produced by the previous pass.

	var factor int32
	var dstLimit int32
	// var size uint32 at bp+4, 4

	// var read int32 at bp+32, 4

	// var decoded int32 at bp+36, 4

	// var count int32 at bp+40, 4

	// var buffer [4]int8 at bp+28, 4

	var nextPtr uintptr
	// var dstDecoded int32 at bp+12, 4

	// var dstRead int32 at bp+24, 4

	// var dstWrote int32 at bp+20, 4

	// var srcRead int32 at bp+8, 4

	// var numChars int32 at bp+16, 4

	var code int32
	var flags int32
	if (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding != 0 {
		encoding = (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding
	} else {
		encoding = sGetBinaryEncoding(tls)
	}
	savedState = (*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingState
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
	savedIEFlags = (*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags
	savedFlags = (*ChannelState)(unsafe.Pointer(statePtr)).Fflags
	src = bufPtr + 24 + uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved)
	srcLen = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved
	if charsToRead < 0 || charsToRead > srcLen {
		toRead = srcLen
	} else {
		toRead = charsToRead
	}
	factor = *(*int32)(unsafe.Pointer(factorPtr))
	dstLimit = TCL_UTF_MAX - 1 + toRead*factor/UTF_EXPANSION_FACTOR

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
		*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
		_ = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
	} else {
		XTcl_GetStringFromObj(tls, objPtr, bp)
	}
	XTcl_AppendToObj(tls, objPtr, uintptr(0), dstLimit)
	if !(toRead == srcLen) {
		goto __1
	}

	dst = XTclGetStringStorage(tls, objPtr, bp+4) + uintptr(*(*int32)(unsafe.Pointer(bp)))
	dstLimit = int32(*(*uint32)(unsafe.Pointer(bp + 4)) - uint32(*(*int32)(unsafe.Pointer(bp))))
	goto __2
__1:
	dst = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}() + uintptr(*(*int32)(unsafe.Pointer(bp)))
__2:
	;

	// This routine is burdened with satisfying several constraints. It cannot
	// append more than 'charsToRead` chars onto objPtr. This is measured
	// after encoding and translation transformations are completed. There is
	// no precise number of src bytes that can be associated with the limit.
	// Yet, when we are done, we must know precisely the number of src bytes
	// that were consumed to produce the appended chars, so that all
	// subsequent bytes are left in the buffers for future read operations.
	//
	// The consequence is that we have no choice but to implement a "trial and
	// error" approach, where in general we may need to perform
	// transformations and copies multiple times to achieve a consistent set
	// of results.  This takes the shape of a loop.

__3:
	if !(1 != 0) {
		goto __4
	}
	flags = (*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags | TCL_ENCODING_NO_TERMINATE

	if !(charsToRead > 0) {
		goto __5
	}
	flags = flags | TCL_ENCODING_CHAR_LIMIT
	*(*int32)(unsafe.Pointer(bp + 16 /* numChars */)) = charsToRead
__5:
	;

	// Perform the encoding transformation.  Read no more than srcLen
	// bytes, write no more than dstLimit bytes.
	//
	// Some trickiness with encoding flags here.  We do not want the end
	// of a buffer to be treated as the end of all input when the presence
	// of bytes in a next buffer are already known to exist.  This is
	// checked with an assert() because so far no test case causing the
	// assertion to be false has been created.  The normal operations of
	// channel reading appear to cause EOF and TCL_ENCODING_END setting to
	// appear only in situations where there are no further bytes in any
	// buffers.

	code = XTcl_ExternalToUtf(tls, uintptr(0), encoding, src, srcLen,
		flags, statePtr+24,
		dst, dstLimit, bp+8, bp+12, bp+16)

	// Perform the translation transformation in place.  Read no more than
	// the dstDecoded bytes the encoding transformation actually produced.
	// Capture the number of bytes written in dstWrote. Capture the number
	// of bytes actually consumed in dstRead.

	*(*int32)(unsafe.Pointer(bp + 20 /* dstWrote */)) = dstLimit
	*(*int32)(unsafe.Pointer(bp + 24 /* dstRead */)) = *(*int32)(unsafe.Pointer(bp + 12 /* dstDecoded */))
	sTranslateInputEOL(tls, statePtr, dst, dst, bp+20, bp+24)

	if !(*(*int32)(unsafe.Pointer(bp + 24)) < *(*int32)(unsafe.Pointer(bp + 12))) {
		goto __6
	}
	// The encoding transformation produced bytes that the translation
	// transformation did not consume.  Why did this happen?

	if !((*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar != 0 && int32(*(*int8)(unsafe.Pointer(dst + uintptr(*(*int32)(unsafe.Pointer(bp + 24)))))) == (*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar) {
		goto __7
	}
	// 1) There's an eof char set on the channel, and
	//    we saw it and stopped translating at that point.
	//
	// NOTE the bizarre spec of TranslateInputEOL in this case.
	// Clearly the eof char had to be read in order to account for
	// the stopping, but the value of dstRead does not include it.
	//
	// Also rather bizarre, our caller can only notice an EOF
	// condition if we return the value -1 as the number of chars
	// read.  This forces us to perform a 2-call dance where the
	// first call can read all the chars up to the eof char, and
	// the second call is solely for consuming the encoded eof
	// char then pointed at by src so that we can return that
	// magic -1 value.  This seems really wasteful, especially
	// since the first decoding pass of each call is likely to
	// decode many bytes beyond that eof char that's all we care
	// about.

	if !(*(*int32)(unsafe.Pointer(bp + 24)) == 0) {
		goto __8
	}
	// Curious choice in the eof char handling.  We leave the
	// eof char in the buffer. So, no need to compute a proper
	// srcRead value. At this point, there are no chars before
	// the eof char in the buffer.

	XTcl_SetObjLength(tls, objPtr, *(*int32)(unsafe.Pointer(bp /* numBytes */)))
	return -1
__8:
	;

	// There are chars leading the buffer before the eof char.
	// Adjust the dstLimit so we go back and read only those
	// and do not encounter the eof char this time.

	dstLimit = *(*int32)(unsafe.Pointer(bp + 24)) + (TCL_UTF_MAX - 1)
	(*ChannelState)(unsafe.Pointer(statePtr)).Fflags = savedFlags
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags = savedIEFlags
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingState = savedState
	goto __3

__7:
	;

	// 2) The other way to read fewer bytes than are decoded is when
	//    the final byte is \r and we're in a CRLF translation mode so
	//    we cannot decide whether to record \r or \n yet.

	if !(*(*int32)(unsafe.Pointer(bp + 20)) > 0) {
		goto __9
	}
	// There are chars we can read before we hit the bare CR.  Go
	// back with a smaller dstLimit so we get them in the next
	// pass, compute a matching srcRead, and don't end up back
	// here in this call.

	dstLimit = *(*int32)(unsafe.Pointer(bp + 24)) + (TCL_UTF_MAX - 1)
	(*ChannelState)(unsafe.Pointer(statePtr)).Fflags = savedFlags
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags = savedIEFlags
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingState = savedState
	goto __3
__9:
	;

	// We decoded only the bare CR, and we cannot read a translated
	// char from that alone. We have to know what's next.  So why do
	// we only have the one decoded char?

	if !(code != TCL_OK) {
		goto __10
	}

	// Didn't get everything the buffer could offer

	(*ChannelState)(unsafe.Pointer(statePtr)).Fflags = savedFlags
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags = savedIEFlags
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingState = savedState

	XTcl_ExternalToUtf(tls, uintptr(0), encoding, src, srcLen,
		(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags|TCL_ENCODING_NO_TERMINATE,
		statePtr+24, bp+28, int32(unsafe.Sizeof([4]int8{})),
		bp+32, bp+36, bp+40)

	if !(*(*int32)(unsafe.Pointer(bp + 40)) == 2) {
		goto __12
	}
	if !(int32(*(*int8)(unsafe.Pointer(bp + 28 + 1))) == '\n') {
		goto __13
	}
	// \r\n translate to \n
	*(*int8)(unsafe.Pointer(dst)) = int8('\n')
	*(*int32)(unsafe.Pointer(bufPtr + 8)) += *(*int32)(unsafe.Pointer(bp + 32))
	goto __14
__13:
	*(*int8)(unsafe.Pointer(dst)) = int8('\r')
	*(*int32)(unsafe.Pointer(bufPtr + 8)) += *(*int32)(unsafe.Pointer(bp + 8))
__14:
	;

	*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(TCL_ENCODING_START)

	XTcl_SetObjLength(tls, objPtr, *(*int32)(unsafe.Pointer(bp))+1)
	return 1
__12:
	;

	goto __11
__10:
	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0) {
		goto __15
	}
	// The bare \r is the only char and we will never read a
	// subsequent char to make the determination.

	*(*int8)(unsafe.Pointer(dst)) = int8('\r')
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded
	XTcl_SetObjLength(tls, objPtr, *(*int32)(unsafe.Pointer(bp))+1)
	return 1
__15:
	;
__11:
	;

	// Revise the dstRead value so that the numChars calc below
	// correctly computes zero characters read.

	*(*int32)(unsafe.Pointer(bp + 24 /* dstRead */)) = *(*int32)(unsafe.Pointer(bp + 16 /* numChars */))

	// FALL THROUGH - get more data (dstWrote == 0)
__6:
	;

	// The translation transformation can only reduce the number of chars
	// when it converts \r\n into \n. The reduction in the number of chars
	// is the difference in bytes read and written.

	*(*int32)(unsafe.Pointer(bp + 16 /* numChars */)) -= *(*int32)(unsafe.Pointer(bp + 24)) - *(*int32)(unsafe.Pointer(bp + 20))

	if !(charsToRead > 0 && *(*int32)(unsafe.Pointer(bp + 16)) > charsToRead) {
		goto __16
	}

	// TODO: This cannot happen anymore.
	//
	// We read more chars than allowed.  Reset limits to prevent that
	// and try again.  Don't forget the extra padding of TCL_UTF_MAX
	// bytes demanded by the Tcl_ExternalToUtf() call!

	dstLimit = int32((int64(XTcl_UtfAtIndex(tls, dst, charsToRead))-int64(dst))/1 + int64(TCL_UTF_MAX-1))
	(*ChannelState)(unsafe.Pointer(statePtr)).Fflags = savedFlags
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags = savedIEFlags
	(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingState = savedState
	goto __3
__16:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 20)) == 0) {
		goto __17
	}

	// We were not able to read any chars.

	// There is one situation where this is the correct final result.
	// If the src buffer contains only a single \n byte, and we are in
	// TCL_TRANSLATE_AUTO mode, and when the translation pass was made
	// the INPUT_SAW_CR flag was set on the channel. In that case, the
	// correct behavior is to consume that \n and produce the empty
	// string.

	if !(*(*int32)(unsafe.Pointer(bp + 24)) == 1 && int32(*(*int8)(unsafe.Pointer(dst))) == '\n') {
		goto __18
	}

	goto consume
__18:
	;

	// Otherwise, reading zero characters indicates there's something
	// incomplete at the end of the src buffer.  Maybe there were not
	// enough src bytes to decode into a char.  Maybe a lone \r could
	// not be translated (crlf mode).  Need to combine any unused src
	// bytes we have in the first buffer with subsequent bytes to try
	// again.

	nextPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr

	if !(nextPtr == uintptr(0)) {
		goto __19
	}
	if !(srcLen > 0) {
		goto __20
	}
	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 14
__20:
	;
	XTcl_SetObjLength(tls, objPtr, *(*int32)(unsafe.Pointer(bp /* numBytes */)))
	return -1
__19:
	;

	// Space is made at the beginning of the buffer to copy the
	// previous unused bytes there. Check first if the buffer we are
	// using actually has enough space at its beginning for the data
	// we are copying.  Because if not we will write over the buffer
	// management information, especially the 'nextPtr'.
	//
	// Note that the BUFFER_PADDING (See AllocChannelBuffer) is used
	// to prevent exactly this situation. I.e. it should never happen.
	// Therefore it is ok to panic should it happen despite the
	// precautions.

	if !((*ChannelBuffer)(unsafe.Pointer(nextPtr)).FnextRemoved-srcLen < 0) {
		goto __21
	}
	XTcl_Panic(tls, ts+33344, 0)
__21:
	;

	*(*int32)(unsafe.Pointer(nextPtr + 8)) -= srcLen
	libc.Xmemcpy(tls, nextPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(nextPtr)).FnextRemoved), src, uint64(srcLen))
	sRecycleBuffer(tls, statePtr, bufPtr, 0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = nextPtr
	XTcl_SetObjLength(tls, objPtr, *(*int32)(unsafe.Pointer(bp /* numBytes */)))
	return sReadChars(tls, statePtr, objPtr, charsToRead, factorPtr)
__17:
	;

	*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(TCL_ENCODING_START)

consume:
	*(*int32)(unsafe.Pointer(bufPtr + 8)) += *(*int32)(unsafe.Pointer(bp + 8))

	// If this read contained multibyte characters, revise factorPtr so
	// the next read will allocate bigger buffers.

	if !(*(*int32)(unsafe.Pointer(bp + 16)) != 0 && *(*int32)(unsafe.Pointer(bp + 16)) < *(*int32)(unsafe.Pointer(bp + 8))) {
		goto __22
	}
	*(*int32)(unsafe.Pointer(factorPtr)) = *(*int32)(unsafe.Pointer(bp + 8)) * UTF_EXPANSION_FACTOR / *(*int32)(unsafe.Pointer(bp + 16))
__22:
	;
	XTcl_SetObjLength(tls, objPtr, *(*int32)(unsafe.Pointer(bp))+*(*int32)(unsafe.Pointer(bp + 20)))
	return *(*int32)(unsafe.Pointer(bp + 16 /* numChars */))
	goto __3
__4:
	;
	return int32(0)
}

//---------------------------------------------------------------------------
//
// TranslateInputEOL --
//
//	Perform input EOL and EOF translation on the source buffer, leaving
//	the translated result in the destination buffer.
//
// Results:
//	The return value is 1 if the EOF character was found when copying
//	bytes to the destination buffer, 0 otherwise.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sTranslateInputEOL(tls *libc.TLS, statePtr uintptr, dstStart uintptr, srcStart uintptr, dstLenPtr uintptr, srcLenPtr uintptr) { /* tclIO.c:6445:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var eof uintptr = uintptr(0)
	var dstLen int32 = *(*int32)(unsafe.Pointer(dstLenPtr))
	var srcLen int32 = *(*int32)(unsafe.Pointer(srcLenPtr))
	var inEofChar int32 = (*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar

	// Depending on the translation mode in use, there's no need to scan more
	// srcLen bytes at srcStart than can possibly transform to dstLen bytes.
	// This keeps the scan for eof char below from being pointlessly long.

	switch (*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation {
	case TCL_TRANSLATE_LF:
		fallthrough
	case TCL_TRANSLATE_CR:
		if srcLen > dstLen {
			// In these modes, each src byte become a dst byte.

			srcLen = dstLen
		}
		break
	default:
		// In other modes, at most 2 src bytes become a dst byte.

		if srcLen/2 > dstLen {
			srcLen = 2 * dstLen
		}
		break
	}

	if inEofChar != 0 {
		// Make sure we do not read past any logical end of channel input
		// created by the presence of the input eof char.

		if libc.AssignUintptr(&eof, libc.Xmemchr(tls, srcStart, inEofChar, uint64(srcLen))) != 0 {
			srcLen = int32((int64(eof) - int64(srcStart)) / 1)
		}
	}

	switch (*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation {
	case TCL_TRANSLATE_LF:
		fallthrough
	case TCL_TRANSLATE_CR:
		if dstStart != srcStart {
			libc.Xmemcpy(tls, dstStart, srcStart, uint64(srcLen))
		}
		if (*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation == TCL_TRANSLATE_CR {
			var dst uintptr = dstStart
			var dstEnd uintptr = dstStart + uintptr(srcLen)

			for libc.AssignUintptr(&dst, libc.Xmemchr(tls, dst, '\r', uint64((int64(dstEnd)-int64(dst))/1))) != 0 {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8('\n')
			}
		}
		dstLen = srcLen
		break
	case TCL_TRANSLATE_CRLF:
		{
			var crFound uintptr
			var src uintptr = srcStart
			var dst uintptr = dstStart
			var lesser int32
			if dstLen < srcLen {
				lesser = dstLen
			} else {
				lesser = srcLen
			}

			for libc.AssignUintptr(&crFound, libc.Xmemchr(tls, src, '\r', uint64(lesser))) != 0 {
				var numBytes int32 = int32((int64(crFound) - int64(src)) / 1)
				libc.Xmemmove(tls, dst, src, uint64(numBytes))

				dst += uintptr(numBytes)
				dstLen = dstLen - numBytes
				src += uintptr(numBytes)
				srcLen = srcLen - numBytes
				if srcLen == 1 {
					// valid src bytes end in \r
					if eof != 0 {
						*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8('\r')
						src++
						srcLen--
					} else {
						lesser = 0
						break
					}
				} else if int32(*(*int8)(unsafe.Pointer(src + 1))) == '\n' {
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8('\n')
					src += uintptr(2)
					srcLen = srcLen - 2
				} else {
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8('\r')
					src++
					srcLen--
				}
				dstLen--
				if dstLen < srcLen {
					lesser = dstLen
				} else {
					lesser = srcLen
				}
			}
			libc.Xmemmove(tls, dst, src, uint64(lesser))
			srcLen = int32((int64(src+uintptr(lesser)) - int64(srcStart)) / 1)
			dstLen = int32((int64(dst+uintptr(lesser)) - int64(dstStart)) / 1)
			break

		}
	case TCL_TRANSLATE_AUTO:
		{
			var crFound uintptr
			var src uintptr = srcStart
			var dst uintptr = dstStart
			var lesser int32

			if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<12) != 0 && srcLen != 0 {
				if int32(*(*int8)(unsafe.Pointer(src))) == '\n' {
					src++
					srcLen--
				}
				*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 12)
			}
			if dstLen < srcLen {
				lesser = dstLen
			} else {
				lesser = srcLen
			}
			for libc.AssignUintptr(&crFound, libc.Xmemchr(tls, src, '\r', uint64(lesser))) != 0 {
				var numBytes int32 = int32((int64(crFound) - int64(src)) / 1)
				libc.Xmemmove(tls, dst, src, uint64(numBytes))

				*(*int8)(unsafe.Pointer(dst + uintptr(numBytes))) = int8('\n')
				dst += uintptr(numBytes + 1)
				dstLen = dstLen - (numBytes + 1)
				src += uintptr(numBytes + 1)
				srcLen = srcLen - (numBytes + 1)
				if srcLen == 0 {
					*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 12
				} else if int32(*(*int8)(unsafe.Pointer(src))) == '\n' {
					src++
					srcLen--
				}
				if dstLen < srcLen {
					lesser = dstLen
				} else {
					lesser = srcLen
				}
			}
			libc.Xmemmove(tls, dst, src, uint64(lesser))
			srcLen = int32((int64(src+uintptr(lesser)) - int64(srcStart)) / 1)
			dstLen = int32((int64(dst+uintptr(lesser)) - int64(dstStart)) / 1)
			break

		}
	default:
		XTcl_Panic(tls, ts+33388, libc.VaList(bp, (*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation))
	}
	*(*int32)(unsafe.Pointer(dstLenPtr)) = dstLen
	*(*int32)(unsafe.Pointer(srcLenPtr)) = srcLen

	if srcStart+uintptr(srcLen) == eof {
		// EOF character was seen in EOL translated range. Leave current file
		// position pointing at the EOF character, but don't store the EOF
		// character in the output string.

		*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1)<<9 | int32(1)<<10
		*(*int32)(unsafe.Pointer(statePtr + 32)) |= TCL_ENCODING_END
		*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<11 | int32(1)<<12)
	}
}

//----------------------------------------------------------------------
//
// Tcl_Ungets --
//
//	Causes the supplied string to be added to the input queue of the
//	channel, at either the head or tail of the queue.
//
// Results:
//	The number of bytes stored in the channel, or -1 on error.
//
// Side effects:
//	Adds input to the input queue of a channel.
//
//----------------------------------------------------------------------

func XTcl_Ungets(tls *libc.TLS, chan1 Tcl_Channel, str uintptr, len int32, atEnd int32) int32 { /* tclIO.c:6620:1: */
	var chanPtr uintptr  // The real IO channel.
	var statePtr uintptr // State of actual channel.
	var bufPtr uintptr   // Buffer to contain the data.
	var flags int32

	chanPtr = chan1
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	// CheckChannelErrors clears too many flag bits in this one case.

	flags = (*ChannelState)(unsafe.Pointer(statePtr)).Fflags
	if !(sCheckChannelErrors(tls, statePtr, int32(1)<<1) != 0) {
		goto __1
	}
	len = -1
	goto done
__1:
	;
	(*ChannelState)(unsafe.Pointer(statePtr)).Fflags = flags

	// Clear the EOF flags, and clear the BLOCKED bit.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0) {
		goto __2
	}
	*(*int32)(unsafe.Pointer(statePtr + 32)) |= TCL_ENCODING_START
__2:
	;
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<11 | int32(1)<<10 | int32(1)<<9 | int32(1)<<12)
	*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(TCL_ENCODING_END)

	bufPtr = sAllocChannelBuffer(tls, len)
	libc.Xmemcpy(tls, bufPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded), str, uint64(len))
	*(*int32)(unsafe.Pointer(bufPtr + 4)) += len

	if !((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead == uintptr(0)) {
		goto __3
	}
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = bufPtr
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = bufPtr
	goto __4
__3:
	if !(atEnd != 0) {
		goto __5
	}
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr = uintptr(0)
	(*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail)).FnextPtr = bufPtr
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = bufPtr
	goto __6
__5:
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = bufPtr
__6:
	;
__4:
	;

	// Update the notifier state so we don't block while there is still data
	// in the buffers.

done:
	sUpdateInterest(tls, chanPtr)
	return len
}

//----------------------------------------------------------------------
//
// Tcl_Flush --
//
//	Flushes output data on a channel.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May flush output queued on this channel.
//
//----------------------------------------------------------------------

func XTcl_Flush(tls *libc.TLS, chan1 Tcl_Channel) int32 { /* tclIO.c:6707:1: */
	var result int32 // Of calling FlushChannel.
	var chanPtr uintptr = chan1
	// The actual channel.
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State of actual channel.

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	if sCheckChannelErrors(tls, statePtr, int32(1)<<2) != 0 {
		return TCL_ERROR
	}

	result = sFlushChannel(tls, uintptr(0), chanPtr, 0)
	if result != 0 {
		return TCL_ERROR
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// DiscardInputQueued --
//
//	Discards any input read from the channel but not yet consumed by Tcl
//	reading commands.
//
// Results:
//	None.
//
// Side effects:
//	May discard input from the channel. If discardLastBuffer is zero,
//	leaves one buffer in place for back-filling.
//
//----------------------------------------------------------------------

func sDiscardInputQueued(tls *libc.TLS, statePtr uintptr, discardSavedBuffers int32) { /* tclIO.c:6753:1: */
	var bufPtr uintptr
	var nxtPtr uintptr
	// Loop variables.

	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = uintptr(0)
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = uintptr(0)
	for ; bufPtr != uintptr(0); bufPtr = nxtPtr {
		nxtPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
		sRecycleBuffer(tls, statePtr, bufPtr, discardSavedBuffers)
	}

	// If discardSavedBuffers is nonzero, must also discard any previously
	// saved buffer in the saveInBufPtr field.

	if discardSavedBuffers != 0 && (*ChannelState)(unsafe.Pointer(statePtr)).FsaveInBufPtr != uintptr(0) {
		sReleaseChannelBuffer(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FsaveInBufPtr)
		(*ChannelState)(unsafe.Pointer(statePtr)).FsaveInBufPtr = uintptr(0)
	}
}

//---------------------------------------------------------------------------
//
// GetInput --
//
//	Reads input data from a device into a channel buffer.
//
//	IMPORTANT!  This routine is only called on a chanPtr argument
//	that is the top channel of a stack!
//
// Results:
//	The return value is the Posix error code if an error occurred while
//	reading from the file, or 0 otherwise.
//
// Side effects:
//	Reads from the underlying device.
//
//---------------------------------------------------------------------------

func sGetInput(tls *libc.TLS, chanPtr uintptr) int32 { /* tclIO.c:6802:1: */
	var toRead int32   // How much to read?
	var result int32   // Of calling driver.
	var nread int32    // How much was read from channel?
	var bufPtr uintptr // New buffer to add to input queue.
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel

	// Verify that all callers know better than to call us when
	// it's recorded that the next char waiting to be read is the
	// eofchar.

	// Prevent reading from a dead channel -- a channel that has been closed
	// but not yet deallocated, which can happen if the exit handler for
	// channel cleanup has run but the channel is still registered in some
	// interpreter.

	if sCheckForDeadChannel(tls, uintptr(0), statePtr) != 0 {
		return EINVAL
	}

	// WARNING: There was once a comment here claiming that it was
	// a bad idea to make another call to the inputproc of a channel
	// driver when EOF has already been detected on the channel.  Through
	// much of Tcl's history, this warning was then completely negated
	// by having all (most?) read paths clear the EOF setting before
	// reaching here.  So we had a guard that was never triggered.
	//
	// Don't be tempted to restore the guard.  Even if EOF is set on
	// the channel, continue through and call the inputproc again.  This
	// is the way to enable the ability to [read] again beyond the EOF,
	// which seems a strange thing to do, but for which use cases exist
	// [Tcl Bug 5adc350683] and which may even be essential for channels
	// representing things like ttys or other devices where the stream
	// might take the logical form of a series of 'files' separated by
	// an EOF condition.

	// First check for more buffers in the pushback area of the topmost
	// channel in the stack and use them. They can be the result of a
	// transformation which went away without reading all the information
	// placed in the area when it was stacked.

	if (*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead != uintptr(0) {
		// TODO: Tests to cover this.

		(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = (*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead
		(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = (*Channel)(unsafe.Pointer(chanPtr)).FinQueueTail
		(*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead = uintptr(0)
		(*Channel)(unsafe.Pointer(chanPtr)).FinQueueTail = uintptr(0)
		return 0
	}

	// Nothing in the pushback area, fall back to the usual handling (driver,
	// etc.)

	// See if we can fill an existing buffer. If we can, read only as much as
	// will fit in it. Otherwise allocate a new buffer, add it to the input
	// queue and attempt to fill it to the max.

	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail

	if bufPtr == uintptr(0) || bufPtr != 0 && (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded >= (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength {
		bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FsaveInBufPtr
		(*ChannelState)(unsafe.Pointer(statePtr)).FsaveInBufPtr = uintptr(0)

		// Check the actual buffersize against the requested buffersize.
		// Saved buffers of the wrong size are squashed. This is done to honor
		// dynamic changes of the buffersize made by the user.
		//
		// TODO: Tests to cover this.

		if bufPtr != uintptr(0) &&
			(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength-BUFFER_PADDING != (*ChannelState)(unsafe.Pointer(statePtr)).FbufSize {
			sReleaseChannelBuffer(tls, bufPtr)
			bufPtr = uintptr(0)
		}

		if bufPtr == uintptr(0) {
			bufPtr = sAllocChannelBuffer(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FbufSize)
		}
		(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr = uintptr(0)

		toRead = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded

		if (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail == uintptr(0) {
			(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = bufPtr
		} else {
			(*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail)).FnextPtr = bufPtr
		}
		(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = bufPtr
	} else {
		toRead = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded
	}

	sPreserveChannelBuffer(tls, bufPtr)
	nread = sChanRead(tls, chanPtr, bufPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded), toRead)

	if nread < 0 {
		result = XTcl_GetErrno(tls)
	} else {
		result = 0
		*(*int32)(unsafe.Pointer(bufPtr + 4)) += nread
	}

	sReleaseChannelBuffer(tls, bufPtr)
	return result
}

//----------------------------------------------------------------------
//
// Tcl_Seek --
//
//	Implements seeking on Tcl Channels. This is a public function so that
//	other C facilities may be implemented on top of it.
//
// Results:
//	The new access point or -1 on error. If error, use Tcl_GetErrno() to
//	retrieve the POSIX error code for the error that occurred.
//
// Side effects:
//	May flush output on the channel. May discard queued input.
//
//----------------------------------------------------------------------

func XTcl_Seek(tls *libc.TLS, chan1 Tcl_Channel, offset Tcl_WideInt, mode int32) Tcl_WideInt { /* tclIO.c:6949:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var chanPtr uintptr = chan1
	// The real IO channel.
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var inputBuffered int32
	var outputBuffered int32
	// # bytes held in buffers.
	// var result int32 at bp, 4
	// Of device driver operations.
	var curPos Tcl_WideInt // Position on the device.
	var wasAsync int32     // Was the channel nonblocking before the seek
	// operation? If so, must restore to
	// non-blocking mode after the seek.

	if sCheckChannelErrors(tls, statePtr, int32(1)<<2|int32(1)<<1) != 0 {
		return int64(-1)
	}

	// Disallow seek on dead channels - channels that have been closed but not
	// yet been deallocated. Such channels can be found if the exit handler
	// for channel cleanup has run but the channel is still registered in an
	// interpreter.

	if sCheckForDeadChannel(tls, uintptr(0), statePtr) != 0 {
		return int64(-1)
	}

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	// Disallow seek on channels whose type does not have a seek procedure
	// defined. This means that the channel does not support seeking.

	if XTcl_ChannelSeekProc(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr) == uintptr(0) {
		XTcl_SetErrno(tls, EINVAL)
		return int64(-1)
	}

	// Compute how much input and output is buffered. If both input and output
	// is buffered, cannot compute the current position.

	inputBuffered = XTcl_InputBuffered(tls, chan1)
	outputBuffered = XTcl_OutputBuffered(tls, chan1)

	if inputBuffered != 0 && outputBuffered != 0 {
		XTcl_SetErrno(tls, EFAULT)
		return int64(-1)
	}

	// If we are seeking relative to the current position, compute the
	// corrected offset taking into account the amount of unread input.

	if mode == SEEK_CUR {
		offset = offset - Tcl_WideInt(inputBuffered)
	}

	// Discard any queued input - this input should not be read after the
	// seek.

	sDiscardInputQueued(tls, statePtr, 0)

	// Reset EOF and BLOCKED flags. We invalidate them by moving the access
	// point. Also clear CR related flags.

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0 {
		*(*int32)(unsafe.Pointer(statePtr + 32)) |= TCL_ENCODING_START
	}
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<9 | int32(1)<<10 | int32(1)<<11 | int32(1)<<12)
	*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(TCL_ENCODING_END)

	// If the channel is in asynchronous output mode, switch it back to
	// synchronous mode and cancel any async flush that may be scheduled.
	// After the flush, the channel will be put back into asynchronous output
	// mode.

	wasAsync = 0
	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<3) != 0 {
		wasAsync = 1
		*(*int32)(unsafe.Pointer(bp /* result */)) = sStackSetBlockMode(tls, chanPtr, TCL_MODE_BLOCKING)
		if *(*int32)(unsafe.Pointer(bp)) != 0 {
			return int64(-1)
		}
		*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 3)
		if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<7) != 0 {
			*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 7)
		}
	}

	// If the flush fails we cannot recover the original position. In that
	// case the seek is not attempted because we do not know where the access
	// position is - instead we return the error. FlushChannel has already
	// called Tcl_SetErrno() to report the error upwards. If the flush
	// succeeds we do the seek also.

	if sFlushChannel(tls, uintptr(0), chanPtr, 0) != 0 {
		curPos = int64(-1)
	} else {
		// Now seek to the new position in the channel as requested by the
		// caller.

		curPos = sChanSeek(tls, chanPtr, offset, mode, bp)
		if curPos == int64(-1) {
			XTcl_SetErrno(tls, *(*int32)(unsafe.Pointer(bp /* result */)))
		}
	}

	// Restore to nonblocking mode if that was the previous behavior.
	//
	// NOTE: Even if there was an async flush active we do not restore it now
	// because we already flushed all the queued output, above.

	if wasAsync != 0 {
		*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 3
		*(*int32)(unsafe.Pointer(bp /* result */)) = sStackSetBlockMode(tls, chanPtr, TCL_MODE_NONBLOCKING)
		if *(*int32)(unsafe.Pointer(bp)) != 0 {
			return int64(-1)
		}
	}

	return curPos
}

//----------------------------------------------------------------------
//
// Tcl_Tell --
//
//	Returns the position of the next character to be read/written on this
//	channel.
//
// Results:
//	A nonnegative integer on success, -1 on failure. If failed, use
//	Tcl_GetErrno() to retrieve the POSIX error code for the error that
//	occurred.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_Tell(tls *libc.TLS, chan1 Tcl_Channel) Tcl_WideInt { /* tclIO.c:7118:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var chanPtr uintptr = chan1
	// The real IO channel.
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var inputBuffered int32
	var outputBuffered int32
	// # bytes held in buffers.
	// var result int32 at bp, 4
	// Of calling device driver.
	var curPos Tcl_WideInt // Position on device.

	if sCheckChannelErrors(tls, statePtr, int32(1)<<2|int32(1)<<1) != 0 {
		return int64(-1)
	}

	// Disallow tell on dead channels -- channels that have been closed but
	// not yet been deallocated. Such channels can be found if the exit
	// handler for channel cleanup has run but the channel is still registered
	// in an interpreter.

	if sCheckForDeadChannel(tls, uintptr(0), statePtr) != 0 {
		return int64(-1)
	}

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	// Disallow tell on channels whose type does not have a seek procedure
	// defined. This means that the channel does not support seeking.

	if XTcl_ChannelSeekProc(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr) == uintptr(0) {
		XTcl_SetErrno(tls, EINVAL)
		return int64(-1)
	}

	// Compute how much input and output is buffered. If both input and output
	// is buffered, cannot compute the current position.

	inputBuffered = XTcl_InputBuffered(tls, chan1)
	outputBuffered = XTcl_OutputBuffered(tls, chan1)

	// Get the current position in the device and compute the position where
	// the next character will be read or written. Note that we prefer the
	// wideSeekProc if that is available and non-NULL...

	curPos = sChanSeek(tls, chanPtr, int64(0), SEEK_CUR, bp)
	if curPos == int64(-1) {
		XTcl_SetErrno(tls, *(*int32)(unsafe.Pointer(bp /* result */)))
		return int64(-1)
	}

	if inputBuffered != 0 {
		return curPos - Tcl_WideInt(inputBuffered)
	}
	return curPos + Tcl_WideInt(outputBuffered)
}

//---------------------------------------------------------------------------
//
// Tcl_SeekOld, Tcl_TellOld --
//
//	Backward-compatibility versions of the seek/tell interface that do not
//	support 64-bit offsets. This interface is not documented or expected
//	to be supported indefinitely.
//
// Results:
//	As for Tcl_Seek and Tcl_Tell respectively, except truncated to
//	whatever value will fit in an 'int'.
//
// Side effects:
//	As for Tcl_Seek and Tcl_Tell respectively.
//
//---------------------------------------------------------------------------

func XTcl_SeekOld(tls *libc.TLS, chan1 Tcl_Channel, offset int32, mode int32) int32 { /* tclIO.c:7207:1: */
	var wOffset Tcl_WideInt
	var wResult Tcl_WideInt

	wOffset = int64(offset)
	wResult = XTcl_Seek(tls, chan1, wOffset, mode)
	return int32(wResult)
}

func XTcl_TellOld(tls *libc.TLS, chan1 Tcl_Channel) int32 { /* tclIO.c:7220:1: */
	var wResult Tcl_WideInt = XTcl_Tell(tls, chan1)

	return int32(wResult)
}

//---------------------------------------------------------------------------
//
// Tcl_TruncateChannel --
//
//	Truncate a channel to the given length.
//
// Results:
//	TCL_OK on success, TCL_ERROR if the operation failed (e.g., is not
//	supported by the type of channel, or the underlying OS operation
//	failed in some way).
//
// Side effects:
//	Seeks the channel to the current location. Sets errno on OS error.
//
//---------------------------------------------------------------------------

func XTcl_TruncateChannel(tls *libc.TLS, chan1 Tcl_Channel, length Tcl_WideInt) int32 { /* tclIO.c:7247:1: */
	var chanPtr uintptr = chan1
	var truncateProc uintptr = XTcl_ChannelTruncateProc(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)
	var result int32

	if truncateProc == uintptr(0) {
		// Feature not supported and it's not emulatable. Pretend it's
		// returned an EINVAL, a very generic error!

		XTcl_SetErrno(tls, EINVAL)
		return TCL_ERROR
	}

	if !((*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).Fflags&(int32(1)<<2) != 0) {
		// We require that the file was opened of writing. Do that check now
		// so that we only flush if we think we're going to succeed.

		XTcl_SetErrno(tls, EINVAL)
		return TCL_ERROR
	}

	// Seek first to force a total flush of all pending buffers and ditch any
	// pre-read input data.

	sWillWrite(tls, chanPtr)

	if sWillRead(tls, chanPtr) < 0 {
		return TCL_ERROR
	}

	// We're all flushed to disk now and we also don't have any unfortunate
	// input baggage around either; can truncate with impunity.

	result = (*struct {
		f func(*libc.TLS, ClientData, Tcl_WideInt) int32
	})(unsafe.Pointer(&struct{ uintptr }{truncateProc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, length)
	if result != 0 {
		XTcl_SetErrno(tls, result)
		return TCL_ERROR
	}
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// CheckChannelErrors --
//
//	See if the channel is in an ready state and can perform the desired
//	operation.
//
// Results:
//	The return value is 0 if the channel is OK, otherwise the return value
//	is -1 and errno is set to indicate the error.
//
// Side effects:
//	May clear the EOF and/or BLOCKED bits if reading from channel.
//
//---------------------------------------------------------------------------

func sCheckChannelErrors(tls *libc.TLS, statePtr uintptr, flags int32) int32 { /* tclIO.c:7319:1: */
	var direction int32 = flags & (int32(1)<<1 | int32(1)<<2)

	// Check for unreported error.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FunreportedError != 0 {
		XTcl_SetErrno(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FunreportedError)
		(*ChannelState)(unsafe.Pointer(statePtr)).FunreportedError = 0

		// TIP #219, Tcl Channel Reflection API.
		// Move a defered error message back into the channel bypass.

		if (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg != uintptr(0) {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
						} else {
							*(*uintptr)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
				}
			}

		}
		(*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg = (*ChannelState)(unsafe.Pointer(statePtr)).FunreportedMsg
		(*ChannelState)(unsafe.Pointer(statePtr)).FunreportedMsg = uintptr(0)
		return -1
	}

	// Only the raw read and write operations are allowed during close in
	// order to drain data from stacked channels.

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<8) != 0 && !(flags&(int32(1)<<16) != 0) {
		XTcl_SetErrno(tls, EACCES)
		return -1
	}

	// Fail if the channel is not opened for desired operation.

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&direction == 0 {
		XTcl_SetErrno(tls, EACCES)
		return -1
	}

	// Fail if the channel is in the middle of a background copy.
	//
	// Don't do this tests for raw channels here or else the chaining in the
	// transformation drivers will fail with 'file busy' error instead of
	// retrieving and transforming the data to copy.

	if ((*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR != 0 && flags&(int32(1)<<1) != 0 || (*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW != 0 && flags&(int32(1)<<2) != 0) && flags&(int32(1)<<16) == 0 {
		XTcl_SetErrno(tls, EBUSY)
		return -1
	}

	if direction == int32(1)<<1 {
		*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 14)
	}

	return 0
}

//----------------------------------------------------------------------
//
// Tcl_Eof --
//
//	Returns 1 if the channel is at EOF, 0 otherwise.
//
// Results:
//	1 or 0, always.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_Eof(tls *libc.TLS, chan1 Tcl_Channel) int32 { /* tclIO.c:7405:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	// State of real channel structure.

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0 {
		return 1
	}
	return 0
}

//----------------------------------------------------------------------
//
// Tcl_InputBlocked --
//
//	Returns 1 if input is blocked on this channel, 0 otherwise.
//
// Results:
//	0 or 1, always.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_InputBlocked(tls *libc.TLS, chan1 Tcl_Channel) int32 { /* tclIO.c:7431:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	// State of real channel structure.

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<11) != 0 {
		return 1
	}
	return 0
}

//----------------------------------------------------------------------
//
// Tcl_InputBuffered --
//
//	Returns the number of bytes of input currently buffered in the common
//	internal buffer of a channel.
//
// Results:
//	The number of input bytes buffered, or zero if the channel is not open
//	for reading.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_InputBuffered(tls *libc.TLS, chan1 Tcl_Channel) int32 { /* tclIO.c:7459:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	// State of real channel structure.
	var bufPtr uintptr
	var bytesBuffered int32

	bytesBuffered = 0
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
	for ; bufPtr != uintptr(0); bufPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr {
		bytesBuffered = bytesBuffered + ((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved)
	}

	// Don't forget the bytes in the topmost pushback area.

	for bufPtr = (*Channel)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr)).FinQueueHead; bufPtr != uintptr(0); bufPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr {
		bytesBuffered = bytesBuffered + ((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved)
	}

	return bytesBuffered
}

//----------------------------------------------------------------------
//
// Tcl_OutputBuffered --
//
//    Returns the number of bytes of output currently buffered in the common
//    internal buffer of a channel.
//
// Results:
//    The number of output bytes buffered, or zero if the channel is not open
//    for writing.
//
// Side effects:
//    None.
//
//----------------------------------------------------------------------

func XTcl_OutputBuffered(tls *libc.TLS, chan1 Tcl_Channel) int32 { /* tclIO.c:7503:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	// State of real channel structure.
	var bufPtr uintptr
	var bytesBuffered int32

	bytesBuffered = 0
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FoutQueueHead
	for ; bufPtr != uintptr(0); bufPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr {
		bytesBuffered = bytesBuffered + ((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved)
	}
	if (*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr != uintptr(0) {
		var curOutPtr uintptr = (*ChannelState)(unsafe.Pointer(statePtr)).FcurOutPtr

		if (*ChannelBuffer)(unsafe.Pointer(curOutPtr)).FnextAdded > (*ChannelBuffer)(unsafe.Pointer(curOutPtr)).FnextRemoved {
			bytesBuffered = bytesBuffered + ((*ChannelBuffer)(unsafe.Pointer(curOutPtr)).FnextAdded - (*ChannelBuffer)(unsafe.Pointer(curOutPtr)).FnextRemoved)
		}
	}

	return bytesBuffered
}

//----------------------------------------------------------------------
//
// Tcl_ChannelBuffered --
//
//	Returns the number of bytes of input currently buffered in the
//	internal buffer (push back area) of a channel.
//
// Results:
//	The number of input bytes buffered, or zero if the channel is not open
//	for reading.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelBuffered(tls *libc.TLS, chan1 Tcl_Channel) int32 { /* tclIO.c:7545:1: */
	var chanPtr uintptr = chan1
	// Real channel structure.
	var bufPtr uintptr
	var bytesBuffered int32 = 0

	for bufPtr = (*Channel)(unsafe.Pointer(chanPtr)).FinQueueHead; bufPtr != uintptr(0); bufPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr {
		bytesBuffered = bytesBuffered + ((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved)
	}

	return bytesBuffered
}

//----------------------------------------------------------------------
//
// Tcl_SetChannelBufferSize --
//
//	Sets the size of buffers to allocate to store input or output in the
//	channel. The size must be between 1 byte and 1 MByte.
//
// Results:
//	None.
//
// Side effects:
//	Sets the size of buffers subsequently allocated for this channel.
//
//----------------------------------------------------------------------

func XTcl_SetChannelBufferSize(tls *libc.TLS, chan1 Tcl_Channel, sz int32) { /* tclIO.c:7579:1: */
	var statePtr uintptr // State of real channel structure.

	// Clip the buffer size to force it into the [1,1M] range

	if sz < 1 {
		sz = 1
	} else if sz > 1024*1024 {
		sz = 1024 * 1024
	}

	statePtr = (*Channel)(unsafe.Pointer(chan1)).Fstate

	if (*ChannelState)(unsafe.Pointer(statePtr)).FbufSize == sz {
		return
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FbufSize = sz

	// If bufsize changes, need to get rid of old utility buffer.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FsaveInBufPtr != uintptr(0) {
		sRecycleBuffer(tls, statePtr, (*ChannelState)(unsafe.Pointer(statePtr)).FsaveInBufPtr, 1)
		(*ChannelState)(unsafe.Pointer(statePtr)).FsaveInBufPtr = uintptr(0)
	}
	if (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead != uintptr(0) &&
		(*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead)).FnextPtr == uintptr(0) &&
		(*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead)).FnextAdded == (*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead)).FnextRemoved {
		sRecycleBuffer(tls, statePtr, (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead, 1)
		(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = uintptr(0)
		(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = uintptr(0)
	}
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelBufferSize --
//
//	Retrieves the size of buffers to allocate for this channel.
//
// Results:
//	The size.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetChannelBufferSize(tls *libc.TLS, chan1 Tcl_Channel) int32 { /* tclIO.c:7636:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	// State of real channel structure.

	return (*ChannelState)(unsafe.Pointer(statePtr)).FbufSize
}

//
// ----------------------------------------------------------------------
//
//  Tcl_BadChannelOption --
//
// 	This procedure generates a "bad option" error message in an (optional)
// 	interpreter. It is used by channel drivers when a invalid Set/Get
// 	option is requested. Its purpose is to concatenate the generic options
// 	list to the specific ones and factorize the generic options error
// 	message string.
//
//  Results:
// 	TCL_ERROR.
//
//  Side effects:
//
//  *	An error message is generated in interp's result object to indicate
//  *	that a command was invoked with the a bad option. The message has the
//  *	form:
//  *		bad option "blah": should be one of
//  *		<...generic options...>+<...specific options...>
//  *	"blah" is the optionName argument and "<specific options>" is a space
//  *	separated list of specific option words. The function takes good care
//  *	of inserting minus signs before each option, commas after, and an "or"
//  *	before the last option.
//  *
//  *----------------------------------------------------------------------
//

func XTcl_BadChannelOption(tls *libc.TLS, interp uintptr, optionName uintptr, optionList uintptr) int32 { /* tclIO.c:7676:1: */
	bp := tls.Alloc(256)
	defer tls.Free(256)

	if interp != uintptr(0) {
		var genericopt uintptr = ts + 33417 /* "blocking bufferi..." */
		// var argv uintptr at bp+248, 8

		// var argc int32 at bp+240, 4

		var i int32
		// var ds Tcl_DString at bp+24, 216

		var errObj uintptr

		XTcl_DStringInit(tls, bp+24)
		XTcl_DStringAppend(tls, bp+24, genericopt, -1)
		if optionList != 0 && *(*int8)(unsafe.Pointer(optionList)) != 0 {
			XTcl_DStringAppend(tls, bp+24, ts+14299, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
			XTcl_DStringAppend(tls, bp+24, optionList, -1)
		}
		if XTcl_SplitList(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp+24)).Fstring,
			bp+240, bp+248) != TCL_OK {
			XTcl_Panic(tls, ts+33476, 0)
		}
		XTcl_ResetResult(tls, interp)
		errObj = XTcl_ObjPrintf(tls, ts+33516,
			libc.VaList(bp, func() uintptr {
				if optionName != 0 {
					return optionName
				}
				return ts + 2046 /* "" */
			}()))
		*(*int32)(unsafe.Pointer(bp + 240 /* argc */))--
		for i = 0; i < *(*int32)(unsafe.Pointer(bp + 240 /* argc */)); i++ {
			XTcl_AppendPrintfToObj(tls, errObj, ts+33551, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248 /* argv */)) + uintptr(i)*8))))
		}
		XTcl_AppendPrintfToObj(tls, errObj, ts+33557, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248 /* argv */)) + uintptr(i)*8))))
		XTcl_SetObjResult(tls, interp, errObj)
		XTcl_DStringFree(tls, bp+24)
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 248)))
	}
	XTcl_SetErrno(tls, EINVAL)
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelOption --
//
//	Gets a mode associated with an IO channel. If the optionName arg is
//	non NULL, retrieves the value of that option. If the optionName arg is
//	NULL, retrieves a list of alternating option names and values for the
//	given channel.
//
// Results:
//	A standard Tcl result. Also sets the supplied DString to the string
//	value of the option(s) returned.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetChannelOption(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel, optionName uintptr, dsPtr uintptr) int32 { /* tclIO.c:7738:1: */
	bp := tls.Alloc(152)
	defer tls.Free(152)

	var len Size_t // Length of optionName string.
	// var optionVal [128]int8 at bp+16, 128
	// Buffer for sprintf.
	var chanPtr uintptr = chan1
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var flags int32

	// Disallow options on dead channels -- channels that have been closed but
	// not yet been deallocated. Such channels can be found if the exit
	// handler for channel cleanup has run but the channel is still registered
	// in an interpreter.

	if sCheckForDeadChannel(tls, interp, statePtr) != 0 {
		return TCL_ERROR
	}

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	// If we are in the middle of a background copy, use the saved flags.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR != 0 {
		flags = (*CopyState1)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR)).FreadFlags
	} else if (*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW != 0 {
		flags = (*CopyState1)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW)).FwriteFlags
	} else {
		flags = (*ChannelState)(unsafe.Pointer(statePtr)).Fflags
	}

	// If the optionName is NULL it means that we want a list of all options
	// and values.

	if optionName == uintptr(0) {
		len = uint64(0)
	} else {
		len = libc.Xstrlen(tls, optionName)
	}

	if len == uint64(0) || len > uint64(2) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 31937 + 1))) && libc.Xstrncmp(tls, optionName, ts+31937, len) == 0 {
		if len == uint64(0) {
			XTcl_DStringAppendElement(tls, dsPtr, ts+31937)
		}
		XTcl_DStringAppendElement(tls, dsPtr,
			func() uintptr {
				if flags&(int32(1)<<3) != 0 {
					return ts + 18333 /* "0" */
				}
				return ts + 6615 /* "1" */
			}())
		if len > uint64(0) {
			return TCL_OK
		}
	}
	if len == uint64(0) || len > uint64(7) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 33564 + 1))) && libc.Xstrncmp(tls, optionName, ts+33564, len) == 0 {
		if len == uint64(0) {
			XTcl_DStringAppendElement(tls, dsPtr, ts+33564)
		}
		if flags&(int32(1)<<4) != 0 {
			XTcl_DStringAppendElement(tls, dsPtr, ts+13722)
		} else if flags&(int32(1)<<5) != 0 {
			XTcl_DStringAppendElement(tls, dsPtr, ts+33575)
		} else {
			XTcl_DStringAppendElement(tls, dsPtr, ts+33580)
		}
		if len > uint64(0) {
			return TCL_OK
		}
	}
	if len == uint64(0) || len > uint64(7) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 33585 + 1))) && libc.Xstrncmp(tls, optionName, ts+33585, len) == 0 {
		if len == uint64(0) {
			XTcl_DStringAppendElement(tls, dsPtr, ts+33585)
		}
		XTclFormatInt(tls, bp+16, int64((*ChannelState)(unsafe.Pointer(statePtr)).FbufSize))
		XTcl_DStringAppendElement(tls, dsPtr, bp+16)
		if len > uint64(0) {
			return TCL_OK
		}
	}
	if len == uint64(0) || len > uint64(2) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 15934 + 1))) && libc.Xstrncmp(tls, optionName, ts+15934, len) == 0 {
		if len == uint64(0) {
			XTcl_DStringAppendElement(tls, dsPtr, ts+15934)
		}
		if (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding == uintptr(0) {
			XTcl_DStringAppendElement(tls, dsPtr, ts+9534)
		} else {
			XTcl_DStringAppendElement(tls, dsPtr,
				XTcl_GetEncodingName(tls, (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding))
		}
		if len > uint64(0) {
			return TCL_OK
		}
	}
	if len == uint64(0) || len > uint64(2) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 33597 + 1))) && libc.Xstrncmp(tls, optionName, ts+33597, len) == 0 {
		if len == uint64(0) {
			XTcl_DStringAppendElement(tls, dsPtr, ts+33597)
		}
		if flags&(int32(1)<<1|int32(1)<<2) == int32(1)<<1|int32(1)<<2 && len == uint64(0) {
			XTcl_DStringStartSublist(tls, dsPtr)
		}
		if flags&(int32(1)<<1) != 0 {
			if (*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar == 0 {
				XTcl_DStringAppendElement(tls, dsPtr, ts+2046)
			} else {
				// var buf [4]int8 at bp+144, 4

				libc.Xsprintf(tls, bp+144, ts+25061, libc.VaList(bp, (*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar))
				XTcl_DStringAppendElement(tls, dsPtr, bp+144)
			}
		}
		if flags&(int32(1)<<2) != 0 {
			if (*ChannelState)(unsafe.Pointer(statePtr)).FoutEofChar == 0 {
				XTcl_DStringAppendElement(tls, dsPtr, ts+2046)
			} else {
				// var buf [4]int8 at bp+148, 4

				libc.Xsprintf(tls, bp+148, ts+25061, libc.VaList(bp+8, (*ChannelState)(unsafe.Pointer(statePtr)).FoutEofChar))
				XTcl_DStringAppendElement(tls, dsPtr, bp+148)
			}
		}
		if !(flags&(int32(1)<<1|int32(1)<<2) != 0) {
			// Not readable or writable (e.g. server socket)

			XTcl_DStringAppendElement(tls, dsPtr, ts+2046)
		}
		if flags&(int32(1)<<1|int32(1)<<2) == int32(1)<<1|int32(1)<<2 && len == uint64(0) {
			XTcl_DStringEndSublist(tls, dsPtr)
		}
		if len > uint64(0) {
			return TCL_OK
		}
	}
	if len == uint64(0) || len > uint64(1) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 33606 + 1))) && libc.Xstrncmp(tls, optionName, ts+33606, len) == 0 {
		if len == uint64(0) {
			XTcl_DStringAppendElement(tls, dsPtr, ts+33606)
		}
		if flags&(int32(1)<<1|int32(1)<<2) == int32(1)<<1|int32(1)<<2 && len == uint64(0) {
			XTcl_DStringStartSublist(tls, dsPtr)
		}
		if flags&(int32(1)<<1) != 0 {
			if (*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation == TCL_TRANSLATE_AUTO {
				XTcl_DStringAppendElement(tls, dsPtr, ts+33619)
			} else if (*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation == TCL_TRANSLATE_CR {
				XTcl_DStringAppendElement(tls, dsPtr, ts+33624)
			} else if (*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation == TCL_TRANSLATE_CRLF {
				XTcl_DStringAppendElement(tls, dsPtr, ts+33627)
			} else {
				XTcl_DStringAppendElement(tls, dsPtr, ts+33632)
			}
		}
		if flags&(int32(1)<<2) != 0 {
			if (*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation == TCL_TRANSLATE_AUTO {
				XTcl_DStringAppendElement(tls, dsPtr, ts+33619)
			} else if (*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation == TCL_TRANSLATE_CR {
				XTcl_DStringAppendElement(tls, dsPtr, ts+33624)
			} else if (*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation == TCL_TRANSLATE_CRLF {
				XTcl_DStringAppendElement(tls, dsPtr, ts+33627)
			} else {
				XTcl_DStringAppendElement(tls, dsPtr, ts+33632)
			}
		}
		if !(flags&(int32(1)<<1|int32(1)<<2) != 0) {
			// Not readable or writable (e.g. server socket)

			XTcl_DStringAppendElement(tls, dsPtr, ts+33619)
		}
		if flags&(int32(1)<<1|int32(1)<<2) == int32(1)<<1|int32(1)<<2 && len == uint64(0) {
			XTcl_DStringEndSublist(tls, dsPtr)
		}
		if len > uint64(0) {
			return TCL_OK
		}
	}

	if (*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FgetOptionProc != uintptr(0) {
		// Let the driver specific handle additional options and result code
		// and message.

		return (*struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FgetOptionProc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, interp,
			optionName, dsPtr)
	} else {
		// No driver specific options case.

		if len == uint64(0) {
			return TCL_OK
		}
		return XTcl_BadChannelOption(tls, interp, optionName, uintptr(0))
	}
	return int32(0)
}

//---------------------------------------------------------------------------
//
// Tcl_SetChannelOption --
//
//	Sets an option on a channel.
//
// Results:
//	A standard Tcl result. On error, sets interp's result object if
//	interp is not NULL.
//
// Side effects:
//	May modify an option on a device.
//
//---------------------------------------------------------------------------

func XTcl_SetChannelOption(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel, optionName uintptr, newValue uintptr) int32 { /* tclIO.c:7967:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var chanPtr uintptr = chan1
	// The real IO channel.
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var len Size_t // Length of optionName string.
	// var argc int32 at bp+8, 4

	// var argv uintptr at bp+16, 8

	// If the channel is in the middle of a background copy, fail.

	if (*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrR != 0 || (*ChannelState)(unsafe.Pointer(statePtr)).FcsPtrW != 0 {
		if interp != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

				ts+33635, -1))
		}
		return TCL_ERROR
	}

	// Disallow options on dead channels -- channels that have been closed but
	// not yet been deallocated. Such channels can be found if the exit
	// handler for channel cleanup has run but the channel is still registered
	// in an interpreter.

	if sCheckForDeadChannel(tls, uintptr(0), statePtr) != 0 {
		return TCL_ERROR
	}

	// This operation should occur at the top of a channel stack.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr

	len = libc.Xstrlen(tls, optionName)

	if len > uint64(2) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 31937 + 1))) && libc.Xstrncmp(tls, optionName, ts+31937, len) == 0 {
		// var newMode int32 at bp, 4

		if XTcl_GetBoolean(tls, interp, newValue, bp) == TCL_ERROR {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp)) != 0 {
			*(*int32)(unsafe.Pointer(bp /* newMode */)) = TCL_MODE_BLOCKING
		} else {
			*(*int32)(unsafe.Pointer(bp /* newMode */)) = TCL_MODE_NONBLOCKING
		}
		return sSetBlockMode(tls, interp, chanPtr, *(*int32)(unsafe.Pointer(bp /* newMode */)))
	} else if len > uint64(7) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 33564 + 1))) && libc.Xstrncmp(tls, optionName, ts+33564, len) == 0 {
		len = libc.Xstrlen(tls, newValue)
		if int32(*(*int8)(unsafe.Pointer(newValue))) == 'f' && libc.Xstrncmp(tls, newValue, ts+33580, len) == 0 {
			*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<5 | int32(1)<<4)
		} else if int32(*(*int8)(unsafe.Pointer(newValue))) == 'l' && libc.Xstrncmp(tls, newValue, ts+13722, len) == 0 {
			*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 5)
			*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 4
		} else if int32(*(*int8)(unsafe.Pointer(newValue))) == 'n' && libc.Xstrncmp(tls, newValue, ts+33575, len) == 0 {
			*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 4)
			*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 5
		} else if interp != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

				ts+33694, -1))
			return TCL_ERROR
		}
		return TCL_OK
	} else if len > uint64(7) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 33585 + 1))) && libc.Xstrncmp(tls, optionName, ts+33585, len) == 0 {
		// var newBufferSize int32 at bp+4, 4

		if XTcl_GetInt(tls, interp, newValue, bp+4) == TCL_ERROR {
			return TCL_ERROR
		}
		XTcl_SetChannelBufferSize(tls, chan1, *(*int32)(unsafe.Pointer(bp + 4 /* newBufferSize */)))
		return TCL_OK
	} else if len > uint64(2) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 15934 + 1))) && libc.Xstrncmp(tls, optionName, ts+15934, len) == 0 {
		var encoding Tcl_Encoding

		if int32(*(*int8)(unsafe.Pointer(newValue))) == 0 || libc.Xstrcmp(tls, newValue, ts+9534) == 0 {
			encoding = uintptr(0)
		} else {
			encoding = XTcl_GetEncoding(tls, interp, newValue)
			if encoding == uintptr(0) {
				return TCL_ERROR
			}
		}

		// When the channel has an escape sequence driven encoding such as
		// iso2022, the terminated escape sequence must write to the buffer.

		if (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding != uintptr(0) &&
			!((*ChannelState)(unsafe.Pointer(statePtr)).FoutputEncodingFlags&TCL_ENCODING_START != 0) &&
			sCheckChannelErrors(tls, statePtr, int32(1)<<2) == 0 {
			*(*int32)(unsafe.Pointer(statePtr + 48)) |= TCL_ENCODING_END
			sWrite(tls, chanPtr, ts+2046, 0, (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).Fencoding)
		}
		XTcl_FreeEncoding(tls, (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding)
		(*ChannelState)(unsafe.Pointer(statePtr)).Fencoding = encoding
		(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingState = uintptr(0)
		(*ChannelState)(unsafe.Pointer(statePtr)).FinputEncodingFlags = TCL_ENCODING_START
		(*ChannelState)(unsafe.Pointer(statePtr)).FoutputEncodingState = uintptr(0)
		(*ChannelState)(unsafe.Pointer(statePtr)).FoutputEncodingFlags = TCL_ENCODING_START
		*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 14)
		sUpdateInterest(tls, chanPtr)
		return TCL_OK
	} else if len > uint64(2) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 33597 + 1))) && libc.Xstrncmp(tls, optionName, ts+33597, len) == 0 {
		if XTcl_SplitList(tls, interp, newValue, bp+8, bp+16) == TCL_ERROR {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp + 8)) == 0 {
			(*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar = 0
			(*ChannelState)(unsafe.Pointer(statePtr)).FoutEofChar = 0
		} else if *(*int32)(unsafe.Pointer(bp + 8)) == 1 || *(*int32)(unsafe.Pointer(bp + 8)) == 2 {
			var outIndex int32 = *(*int32)(unsafe.Pointer(bp + 8)) - 1
			var inValue int32 = int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* argv */)))))))
			var outValue int32 = int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* argv */)) + uintptr(outIndex)*8)))))

			if inValue&0x80 != 0 || outValue&0x80 != 0 {
				if interp != 0 {
					XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

						ts+33755, -1))
				}
				XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
				return TCL_ERROR
			}
			if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0 {
				(*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar = inValue
			}
			if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<2) != 0 {
				(*ChannelState)(unsafe.Pointer(statePtr)).FoutEofChar = outValue
			}
		} else {
			if interp != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+33811, -1))
			}
			XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
			return TCL_ERROR
		}
		if *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0) {
			XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
		}

		// [Bug 930851] Reset EOF and BLOCKED flags. Changing the character
		// which signals eof can transform a current eof condition into a 'go
		// ahead'. Ditto for blocked.

		if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0 {
			*(*int32)(unsafe.Pointer(statePtr + 32)) |= TCL_ENCODING_START
		}
		*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<9 | int32(1)<<10 | int32(1)<<11)
		*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(TCL_ENCODING_END)
		return TCL_OK
	} else if len > uint64(1) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == int32(*(*int8)(unsafe.Pointer(ts + 33606 + 1))) && libc.Xstrncmp(tls, optionName, ts+33606, len) == 0 {
		var readMode uintptr
		var writeMode uintptr

		if XTcl_SplitList(tls, interp, newValue, bp+8, bp+16) == TCL_ERROR {
			return TCL_ERROR
		}

		if *(*int32)(unsafe.Pointer(bp + 8)) == 1 {
			if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0 {
				readMode = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* argv */))))
			} else {
				readMode = uintptr(0)
			}
			if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<2) != 0 {
				writeMode = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* argv */))))
			} else {
				writeMode = uintptr(0)
			}
		} else if *(*int32)(unsafe.Pointer(bp + 8)) == 2 {
			if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0 {
				readMode = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* argv */))))
			} else {
				readMode = uintptr(0)
			}
			if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<2) != 0 {
				writeMode = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* argv */)) + 1*8))
			} else {
				writeMode = uintptr(0)
			}
		} else {
			if interp != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+33882, -1))
			}
			XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
			return TCL_ERROR
		}

		if readMode != 0 {
			var translation TclEolTranslation

			if int32(*(*int8)(unsafe.Pointer(readMode))) == 0 {
				translation = (*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation
			} else if libc.Xstrcmp(tls, readMode, ts+33619) == 0 {
				translation = TCL_TRANSLATE_AUTO
			} else if libc.Xstrcmp(tls, readMode, ts+9534) == 0 {
				translation = TCL_TRANSLATE_LF
				(*ChannelState)(unsafe.Pointer(statePtr)).FinEofChar = 0
				XTcl_FreeEncoding(tls, (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding)
				(*ChannelState)(unsafe.Pointer(statePtr)).Fencoding = uintptr(0)
			} else if libc.Xstrcmp(tls, readMode, ts+33632) == 0 {
				translation = TCL_TRANSLATE_LF
			} else if libc.Xstrcmp(tls, readMode, ts+33624) == 0 {
				translation = TCL_TRANSLATE_CR
			} else if libc.Xstrcmp(tls, readMode, ts+33627) == 0 {
				translation = TCL_TRANSLATE_CRLF
			} else if libc.Xstrcmp(tls, readMode, ts+33944) == 0 {
				translation = TCL_TRANSLATE_LF
			} else {
				if interp != 0 {
					XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

						ts+33953, -1))
				}
				XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
				return TCL_ERROR
			}

			// Reset the EOL flags since we need to look at any buffered data
			// to see if the new translation mode allows us to complete the
			// line.

			if translation != (*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation {
				(*ChannelState)(unsafe.Pointer(statePtr)).FinputTranslation = translation
				*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<12 | int32(1)<<14)
				sUpdateInterest(tls, chanPtr)
			}
		}
		if writeMode != 0 {
			if int32(*(*int8)(unsafe.Pointer(writeMode))) == 0 {
				// Do nothing.
			} else if libc.Xstrcmp(tls, writeMode, ts+33619) == 0 {
				// This is a hack to get TCP sockets to produce output in CRLF
				// mode if they are being set into AUTO mode. A better
				// solution for achieving this effect will be coded later.

				if libc.Xstrcmp(tls, XTcl_ChannelName(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr), ts+34036) == 0 {
					(*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation = TCL_TRANSLATE_CRLF
				} else {
					(*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation = TCL_TRANSLATE_LF
				}
			} else if libc.Xstrcmp(tls, writeMode, ts+9534) == 0 {
				(*ChannelState)(unsafe.Pointer(statePtr)).FoutEofChar = 0
				(*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation = TCL_TRANSLATE_LF
				XTcl_FreeEncoding(tls, (*ChannelState)(unsafe.Pointer(statePtr)).Fencoding)
				(*ChannelState)(unsafe.Pointer(statePtr)).Fencoding = uintptr(0)
			} else if libc.Xstrcmp(tls, writeMode, ts+33632) == 0 {
				(*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation = TCL_TRANSLATE_LF
			} else if libc.Xstrcmp(tls, writeMode, ts+33624) == 0 {
				(*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation = TCL_TRANSLATE_CR
			} else if libc.Xstrcmp(tls, writeMode, ts+33627) == 0 {
				(*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation = TCL_TRANSLATE_CRLF
			} else if libc.Xstrcmp(tls, writeMode, ts+33944) == 0 {
				(*ChannelState)(unsafe.Pointer(statePtr)).FoutputTranslation = TCL_TRANSLATE_LF
			} else {
				if interp != 0 {
					XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

						ts+33953, -1))
				}
				XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
				return TCL_ERROR
			}
		}
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
		return TCL_OK
	} else if (*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FsetOptionProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ChannelType)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)).FsetOptionProc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, interp,
			optionName, newValue)
	} else {
		return XTcl_BadChannelOption(tls, interp, optionName, uintptr(0))
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// CleanupChannelHandlers --
//
//	Removes channel handlers that refer to the supplied interpreter, so
//	that if the actual channel is not closed now, these handlers will not
//	run on subsequent events on the channel. This would be erroneous,
//	because the interpreter no longer has a reference to this channel.
//
// Results:
//	None.
//
// Side effects:
//	Removes channel handlers.
//
//----------------------------------------------------------------------

func sCleanupChannelHandlers(tls *libc.TLS, interp uintptr, chanPtr uintptr) { /* tclIO.c:8271:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var sPtr uintptr
	var prevPtr uintptr
	var nextPtr uintptr

	// Remove fileevent records on this channel that refer to the given
	// interpreter.

	sPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr
	prevPtr = uintptr(0)
	for ; sPtr != uintptr(0); sPtr = nextPtr {
		nextPtr = (*EventScriptRecord)(unsafe.Pointer(sPtr)).FnextPtr
		if (*EventScriptRecord)(unsafe.Pointer(sPtr)).Finterp == interp {
			if prevPtr == uintptr(0) {
				(*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr = nextPtr
			} else {
				(*EventScriptRecord)(unsafe.Pointer(prevPtr)).FnextPtr = nextPtr
			}

			XTcl_DeleteChannelHandler(tls, chanPtr,
				*(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, int32)
				}{XTclChannelEventScriptInvoker})), sPtr)

			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)
						} else {
							*(*uintptr)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*EventScriptRecord)(unsafe.Pointer(sPtr)).FscriptPtr)
				}
			}

			XTclpFree(tls, sPtr)
		} else {
			prevPtr = sPtr
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_NotifyChannel --
//
//	This procedure is called by a channel driver when a driver detects an
//	event on a channel. This procedure is responsible for actually
//	handling the event by invoking any channel handler callbacks.
//
// Results:
//	None.
//
// Side effects:
//	Whatever the channel handler callback procedure does.
//
//----------------------------------------------------------------------

func XTcl_NotifyChannel(tls *libc.TLS, channel Tcl_Channel, mask int32) { /* tclIO.c:8324:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var chanPtr uintptr
	var statePtr uintptr
	// State info for channel
	var chPtr uintptr
	var tsdPtr uintptr
	// var nh NextChannelHandler at bp, 16

	var upChanPtr uintptr
	var upTypePtr uintptr
	var upHandlerProc uintptr
	chanPtr = channel
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))

	// In contrast to the other API functions this procedure walks towards the
	// top of a stack and not down from it.
	//
	// The channel calling this procedure is the one who generated the event,
	// and thus does not take part in handling it. IOW, its HandlerProc is not
	// called, instead we begin with the channel above it.
	//
	// This behaviour also allows the transformation channels to generate
	// their own events and pass them upward.

__1:
	if !(mask != 0 && (*Channel)(unsafe.Pointer(chanPtr)).FupChanPtr != uintptr(0)) {
		goto __2
	}

	upChanPtr = (*Channel)(unsafe.Pointer(chanPtr)).FupChanPtr
	upTypePtr = (*Channel)(unsafe.Pointer(upChanPtr)).FtypePtr
	upHandlerProc = XTcl_ChannelHandlerProc(tls, upTypePtr)
	if !(upHandlerProc != uintptr(0)) {
		goto __3
	}
	mask = (*struct {
		f func(*libc.TLS, ClientData, int32) int32
	})(unsafe.Pointer(&struct{ uintptr }{upHandlerProc})).f(tls, (*Channel)(unsafe.Pointer(upChanPtr)).FinstanceData, mask)
__3:
	;

	// ELSE: Ignore transformations which are unable to handle the event
	// coming from below. Assume that they don't change the mask and pass
	// it on.

	chanPtr = upChanPtr
	goto __1
__2:
	;

	channel = chanPtr

	// Here we have either reached the top of the stack or the mask is empty.
	// We break out of the procedure if it is the latter.

	if !!(mask != 0) {
		goto __4
	}
	return
__4:
	;

	// We are now above the topmost channel in a stack and have events left.
	// Now call the channel handlers as usual.
	//
	// Preserve the channel struct in case the script closes it.

	XTclChannelPreserve(tls, channel)
	XTcl_Preserve(tls, statePtr)

	// Avoid processing if the channel owner has been changed.
	if !((*ChannelState)(unsafe.Pointer(statePtr)).FmanagingThread != XTcl_GetCurrentThread(tls)) {
		goto __5
	}
	goto done
__5:
	;

	// If we are flushing in the background, be sure to call FlushChannel for
	// writable events. Note that we have to discard the writable event so we
	// don't call any write handlers before the flush is complete.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<7) != 0 && mask&(int32(1)<<2) != 0) {
		goto __6
	}
	if !(0 == sFlushChannel(tls, uintptr(0), chanPtr, 1)) {
		goto __7
	}
	mask = mask & libc.CplInt32(int32(1)<<2)
__7:
	;
__6:
	;

	// Add this invocation to the list of recursive invocations of
	// Tcl_NotifyChannel.

	(*NextChannelHandler)(unsafe.Pointer(bp /* &nh */)).FnextHandlerPtr = uintptr(0)
	(*NextChannelHandler)(unsafe.Pointer(bp /* &nh */)).FnestedHandlerPtr = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FnestedHandlerPtr
	(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FnestedHandlerPtr = bp /* &nh */

	chPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchPtr
__8:
	if !(chPtr != uintptr(0)) {
		goto __10
	}
	// If this channel handler is interested in any of the events that
	// have occurred on the channel, invoke its procedure.

	if !((*ChannelHandler)(unsafe.Pointer(chPtr)).Fmask&mask != 0) {
		goto __11
	}
	(*NextChannelHandler)(unsafe.Pointer(bp /* &nh */)).FnextHandlerPtr = (*ChannelHandler)(unsafe.Pointer(chPtr)).FnextPtr
	(*struct {
		f func(*libc.TLS, ClientData, int32)
	})(unsafe.Pointer(&struct{ uintptr }{(*ChannelHandler)(unsafe.Pointer(chPtr)).Fproc})).f(tls, (*ChannelHandler)(unsafe.Pointer(chPtr)).FclientData, (*ChannelHandler)(unsafe.Pointer(chPtr)).Fmask&mask)
	chPtr = (*NextChannelHandler)(unsafe.Pointer(bp /* &nh */)).FnextHandlerPtr
	goto __12
__11:
	chPtr = (*ChannelHandler)(unsafe.Pointer(chPtr)).FnextPtr
__12:
	;

	// Stop if the channel owner has been changed in-between.
	if !((*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).FmanagingThread != XTcl_GetCurrentThread(tls)) {
		goto __13
	}
	goto done
__13:
	;
	goto __9
__9:
	;
	goto __8
	goto __10
__10:
	;

	// Update the notifier interest, since it may have changed after invoking
	// event handlers. Skip that if the channel was deleted in the call to the
	// channel handler.

	if !((*Channel)(unsafe.Pointer(chanPtr)).FtypePtr != uintptr(0)) {
		goto __14
	}
	// TODO: This call may not be needed.  If a handler induced a
	// change in interest, that handler should have made its own
	// UpdateInterest() call, one would think.
	sUpdateInterest(tls, chanPtr)
__14:
	;

done:
	XTcl_Release(tls, statePtr)
	XTclChannelRelease(tls, channel)

	(*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FnestedHandlerPtr = (*NextChannelHandler)(unsafe.Pointer(bp /* &nh */)).FnestedHandlerPtr
}

//----------------------------------------------------------------------
//
// UpdateInterest --
//
//	Arrange for the notifier to call us back at appropriate times based on
//	the current state of the channel.
//
// Results:
//	None.
//
// Side effects:
//	May schedule a timer or driver handler.
//
//----------------------------------------------------------------------

func sUpdateInterest(tls *libc.TLS, chanPtr uintptr) { /* tclIO.c:8481:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var mask int32 = (*ChannelState)(unsafe.Pointer(statePtr)).FinterestMask

	if (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr == uintptr(0) {
		// Do not update interest on a closed channel
		return
	}

	// If there are flushed buffers waiting to be written, then we need to
	// watch for the channel to become writable.

	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<7) != 0 {
		mask = mask | int32(1)<<2
	}

	// If there is data in the input queue, and we aren't waiting for more
	// data, then we need to schedule a timer so we don't block in the
	// notifier. Also, cancel the read interest so we don't get duplicate
	// events.

	if mask&(int32(1)<<1) != 0 {
		if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<14) != 0) &&
			(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead != uintptr(0) &&
			(*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead)).FnextAdded > (*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead)).FnextRemoved {
			mask = mask & libc.CplInt32(int32(1)<<1)

			// Andreas Kupries, April 11, 2003
			//
			// Some operating systems (Solaris 2.6 and higher (but not Solaris
			// 2.5, go figure)) generate READABLE and EXCEPTION events when
			// select()'ing [*] on a plain file, even if EOF was not yet
			// reached. This is a problem in the following situation:
			//
			// - An extension asks to get both READABLE and EXCEPTION events.
			// - It reads data into a buffer smaller than the buffer used by
			//	 Tcl itself.
			// - It does not process all events in the event queue, but only
			//	 one, at least in some situations.
			//
			// In that case we can get into a situation where
			//
			// - Tcl drops READABLE here, because it has data in its own
			//	 buffers waiting to be read by the extension.
			// - A READABLE event is synthesized via timer.
			// - The OS still reports the EXCEPTION condition on the file.
			// - And the extension gets the EXCEPTION event first, and handles
			//	 this as EOF.
			//
			// End result ==> Premature end of reading from a file.
			//
			// The concrete example is 'Expect', and its [expect] command
			// (and at the C-level, deep in the bowels of Expect,
			// 'exp_get_next_event'. See marker 'SunOS' for commentary in
			// that function too).
			//
			// [*] As the Tcl notifier does. See also for marker 'SunOS' in
			// file 'exp_event.c' of Expect.
			//
			// Our solution here is to drop the interest in the EXCEPTION
			// events too. This compiles on all platforms, and also passes the
			// testsuite on all of them.

			mask = mask & libc.CplInt32(int32(1)<<3)

			if !(int32((*ChannelState)(unsafe.Pointer(statePtr)).Ftimer) != 0) {
				(*ChannelState)(unsafe.Pointer(statePtr)).Ftimer = XTcl_CreateTimerHandler(tls, SYNTHETIC_EVENT_TIME,
					*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sChannelTimerProc})), chanPtr)
			}
		}
	}
	sChanWatch(tls, chanPtr, mask)
}

//----------------------------------------------------------------------
//
// ChannelTimerProc --
//
//	Timer handler scheduled by UpdateInterest to monitor the channel
//	buffers until they are empty.
//
// Results:
//	None.
//
// Side effects:
//	May invoke channel handlers.
//
//----------------------------------------------------------------------

func sChannelTimerProc(tls *libc.TLS, clientData ClientData) { /* tclIO.c:8582:1: */
	var chanPtr uintptr = clientData
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<14) != 0) &&
		(*ChannelState)(unsafe.Pointer(statePtr)).FinterestMask&(int32(1)<<1) != 0 &&
		(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead != uintptr(0) &&
		(*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead)).FnextAdded > (*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead)).FnextRemoved {
		// Restart the timer in case a channel handler reenters the event loop
		// before UpdateInterest gets called by Tcl_NotifyChannel.

		(*ChannelState)(unsafe.Pointer(statePtr)).Ftimer = XTcl_CreateTimerHandler(tls, SYNTHETIC_EVENT_TIME,
			*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sChannelTimerProc})), chanPtr)
		XTcl_Preserve(tls, statePtr)
		XTcl_NotifyChannel(tls, chanPtr, int32(1)<<1)
		XTcl_Release(tls, statePtr)
	} else {
		(*ChannelState)(unsafe.Pointer(statePtr)).Ftimer = uintptr(0)
		sUpdateInterest(tls, chanPtr)
	}
}

//----------------------------------------------------------------------
//
// Tcl_CreateChannelHandler --
//
//	Arrange for a given procedure to be invoked whenever the channel
//	indicated by the chanPtr arg becomes readable or writable.
//
// Results:
//	None.
//
// Side effects:
//	From now on, whenever the I/O channel given by chanPtr becomes ready
//	in the way indicated by mask, proc will be invoked. See the manual
//	entry for details on the calling sequence to proc. If there is already
//	an event handler for chan, proc and clientData, then the mask will be
//	updated.
//
//----------------------------------------------------------------------

func XTcl_CreateChannelHandler(tls *libc.TLS, chan1 Tcl_Channel, mask int32, proc uintptr, clientData ClientData) { /* tclIO.c:8631:1: */
	var chPtr uintptr
	var chanPtr uintptr = chan1
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel

	// Check whether this channel handler is not already registered. If it is
	// not, create a new record, else reuse existing record (smash current
	// values).

	for chPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchPtr; chPtr != uintptr(0); chPtr = (*ChannelHandler)(unsafe.Pointer(chPtr)).FnextPtr {
		if (*ChannelHandler)(unsafe.Pointer(chPtr)).FchanPtr == chanPtr && (*ChannelHandler)(unsafe.Pointer(chPtr)).Fproc == proc && (*ChannelHandler)(unsafe.Pointer(chPtr)).FclientData == clientData {
			break
		}
	}
	if chPtr == uintptr(0) {
		chPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ChannelHandler{})))
		(*ChannelHandler)(unsafe.Pointer(chPtr)).Fmask = 0
		(*ChannelHandler)(unsafe.Pointer(chPtr)).Fproc = proc
		(*ChannelHandler)(unsafe.Pointer(chPtr)).FclientData = clientData
		(*ChannelHandler)(unsafe.Pointer(chPtr)).FchanPtr = chanPtr
		(*ChannelHandler)(unsafe.Pointer(chPtr)).FnextPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchPtr
		(*ChannelState)(unsafe.Pointer(statePtr)).FchPtr = chPtr
	}

	// The remainder of the initialization below is done regardless of whether
	// or not this is a new record or a modification of an old one.

	(*ChannelHandler)(unsafe.Pointer(chPtr)).Fmask = mask

	// Recompute the interest mask for the channel - this call may actually be
	// disabling an existing handler.

	(*ChannelState)(unsafe.Pointer(statePtr)).FinterestMask = 0
	for chPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchPtr; chPtr != uintptr(0); chPtr = (*ChannelHandler)(unsafe.Pointer(chPtr)).FnextPtr {
		*(*int32)(unsafe.Pointer(statePtr + 152)) |= (*ChannelHandler)(unsafe.Pointer(chPtr)).Fmask
	}

	sUpdateInterest(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr)
}

//----------------------------------------------------------------------
//
// Tcl_DeleteChannelHandler --
//
//	Cancel a previously arranged callback arrangement for an IO channel.
//
// Results:
//	None.
//
// Side effects:
//	If a callback was previously registered for this chan, proc and
//	clientData, it is removed and the callback will no longer be called
//	when the channel becomes ready for IO.
//
//----------------------------------------------------------------------

func XTcl_DeleteChannelHandler(tls *libc.TLS, chan1 Tcl_Channel, proc uintptr, clientData ClientData) { /* tclIO.c:8708:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))
	var chPtr uintptr
	var prevChPtr uintptr
	var chanPtr uintptr = chan1
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var nhPtr uintptr

	// Find the entry and the previous one in the list.

	prevChPtr = uintptr(0)
	chPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchPtr
	for ; chPtr != uintptr(0); chPtr = (*ChannelHandler)(unsafe.Pointer(chPtr)).FnextPtr {
		if (*ChannelHandler)(unsafe.Pointer(chPtr)).FchanPtr == chanPtr && (*ChannelHandler)(unsafe.Pointer(chPtr)).FclientData == clientData &&
			(*ChannelHandler)(unsafe.Pointer(chPtr)).Fproc == proc {
			break
		}
		prevChPtr = chPtr
	}

	// If not found, return without doing anything.

	if chPtr == uintptr(0) {
		return
	}

	// If Tcl_NotifyChannel is about to process this handler, tell it to
	// process the next one instead - we are going to delete *this* one.

	for nhPtr = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FnestedHandlerPtr; nhPtr != uintptr(0); nhPtr = (*NextChannelHandler)(unsafe.Pointer(nhPtr)).FnestedHandlerPtr {
		if (*NextChannelHandler)(unsafe.Pointer(nhPtr)).FnextHandlerPtr == chPtr {
			(*NextChannelHandler)(unsafe.Pointer(nhPtr)).FnextHandlerPtr = (*ChannelHandler)(unsafe.Pointer(chPtr)).FnextPtr
		}
	}

	// Splice it out of the list of channel handlers.

	if prevChPtr == uintptr(0) {
		(*ChannelState)(unsafe.Pointer(statePtr)).FchPtr = (*ChannelHandler)(unsafe.Pointer(chPtr)).FnextPtr
	} else {
		(*ChannelHandler)(unsafe.Pointer(prevChPtr)).FnextPtr = (*ChannelHandler)(unsafe.Pointer(chPtr)).FnextPtr
	}
	XTclpFree(tls, chPtr)

	// Recompute the interest list for the channel, so that infinite loops
	// will not result if Tcl_DeleteChannelHandler is called inside an event.

	(*ChannelState)(unsafe.Pointer(statePtr)).FinterestMask = 0
	for chPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchPtr; chPtr != uintptr(0); chPtr = (*ChannelHandler)(unsafe.Pointer(chPtr)).FnextPtr {
		*(*int32)(unsafe.Pointer(statePtr + 152)) |= (*ChannelHandler)(unsafe.Pointer(chPtr)).Fmask
	}

	sUpdateInterest(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr)
}

//----------------------------------------------------------------------
//
// DeleteScriptRecord --
//
//	Delete a script record for this combination of channel, interp and
//	mask.
//
// Results:
//	None.
//
// Side effects:
//	Deletes a script record and cancels a channel event handler.
//
//----------------------------------------------------------------------

func sDeleteScriptRecord(tls *libc.TLS, interp uintptr, chanPtr uintptr, mask int32) { /* tclIO.c:8797:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var esPtr uintptr
	var prevEsPtr uintptr

	esPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr
	prevEsPtr = uintptr(0)
__1:
	if !(esPtr != uintptr(0)) {
		goto __3
	}
	{
		if (*EventScriptRecord)(unsafe.Pointer(esPtr)).Finterp == interp && (*EventScriptRecord)(unsafe.Pointer(esPtr)).Fmask == mask {
			if esPtr == (*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr {
				(*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr = (*EventScriptRecord)(unsafe.Pointer(esPtr)).FnextPtr
			} else {

				(*EventScriptRecord)(unsafe.Pointer(prevEsPtr)).FnextPtr = (*EventScriptRecord)(unsafe.Pointer(esPtr)).FnextPtr
			}

			XTcl_DeleteChannelHandler(tls, chanPtr,
				*(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, int32)
				}{XTclChannelEventScriptInvoker})), esPtr)

			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)
						} else {
							*(*uintptr)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)
				}
			}

			XTclpFree(tls, esPtr)

			goto __3
		}

	}
	goto __2
__2:
	prevEsPtr = esPtr
	esPtr = (*EventScriptRecord)(unsafe.Pointer(esPtr)).FnextPtr
	goto __1
	goto __3
__3:
}

//----------------------------------------------------------------------
//
// CreateScriptRecord --
//
//	Creates a record to store a script to be executed when a specific
//	event fires on a specific channel.
//
// Results:
//	None.
//
// Side effects:
//	Causes the script to be stored for later execution.
//
//----------------------------------------------------------------------

func sCreateScriptRecord(tls *libc.TLS, interp uintptr, chanPtr uintptr, mask int32, scriptPtr uintptr) { /* tclIO.c:8848:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel
	var esPtr uintptr
	var makeCH int32

	for esPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr; esPtr != uintptr(0); esPtr = (*EventScriptRecord)(unsafe.Pointer(esPtr)).FnextPtr {
		if (*EventScriptRecord)(unsafe.Pointer(esPtr)).Finterp == interp && (*EventScriptRecord)(unsafe.Pointer(esPtr)).Fmask == mask {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)
						} else {
							*(*uintptr)(unsafe.Pointer((*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)
				}
			}

			(*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr = uintptr(0)
			break
		}
	}

	makeCH = libc.Bool32(esPtr == uintptr(0))

	if makeCH != 0 {
		esPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(EventScriptRecord{})))
	}

	// Initialize the structure before calling Tcl_CreateChannelHandler,
	// because a reflected channel calling 'chan postevent' aka
	// 'Tcl_NotifyChannel' in its 'watch'Proc will invoke
	// 'TclChannelEventScriptInvoker' immediately, and we do not wish it to
	// see uninitialized memory and crash. See [Bug 2918110].

	(*EventScriptRecord)(unsafe.Pointer(esPtr)).FchanPtr = chanPtr
	(*EventScriptRecord)(unsafe.Pointer(esPtr)).Finterp = interp
	(*EventScriptRecord)(unsafe.Pointer(esPtr)).Fmask = mask
	(*Tcl_Obj)(unsafe.Pointer(scriptPtr)).FrefCount++
	(*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr = scriptPtr

	if makeCH != 0 {
		(*EventScriptRecord)(unsafe.Pointer(esPtr)).FnextPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr
		(*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr = esPtr

		XTcl_CreateChannelHandler(tls, chanPtr, mask,
			*(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, int32)
			}{XTclChannelEventScriptInvoker})), esPtr)
	}
}

//----------------------------------------------------------------------
//
// TclChannelEventScriptInvoker --
//
//	Invokes a script scheduled by "fileevent" for when the channel becomes
//	ready for IO. This function is invoked by the channel handler which
//	was created by the Tcl "fileevent" command.
//
// Results:
//	None.
//
// Side effects:
//	Whatever the script does.
//
//----------------------------------------------------------------------

func XTclChannelEventScriptInvoker(tls *libc.TLS, clientData ClientData, mask int32) { /* tclIO.c:8917:1: */
	var interp uintptr  // Interpreter in which to eval the script.
	var chanPtr uintptr // The channel for which this handler is
	// registered.
	var esPtr uintptr // The event script + interpreter to eval it
	// in.
	var result int32 // Result of call to eval script.

	esPtr = clientData
	chanPtr = (*EventScriptRecord)(unsafe.Pointer(esPtr)).FchanPtr
	mask = (*EventScriptRecord)(unsafe.Pointer(esPtr)).Fmask
	interp = (*EventScriptRecord)(unsafe.Pointer(esPtr)).Finterp

	// Be sure event executed in managed channel (covering bugs similar [f583715154]).

	// We must preserve the interpreter so we can report errors on it later.
	// Note that we do not need to preserve the channel because that is done
	// by Tcl_NotifyChannel before calling channel handlers.

	XTcl_Preserve(tls, interp)
	XTclChannelPreserve(tls, chanPtr)
	result = XTcl_EvalObjEx(tls, interp, (*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr, TCL_EVAL_GLOBAL)

	// On error, cause a background error and remove the channel handler and
	// the script record.
	//
	// NOTE: Must delete channel handler before causing the background error
	// because the background error may want to reinstall the handler.

	if result != TCL_OK {
		if (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr != uintptr(0) {
			sDeleteScriptRecord(tls, interp, chanPtr, mask)
		}
		XTcl_BackgroundException(tls, interp, result)
	}
	XTclChannelRelease(tls, chanPtr)
	XTcl_Release(tls, interp)
}

//----------------------------------------------------------------------
//
// Tcl_FileEventObjCmd --
//
//	This procedure implements the "fileevent" Tcl command. See the user
//	documentation for details on what it does. This command is based on
//	the Tk command "fileevent" which in turn is based on work contributed
//	by Mark Diekhans.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May create a channel handler for the specified channel.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_FileEventObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIO.c:8987:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var chanPtr uintptr   // The channel to create the handler for.
	var statePtr uintptr  // State info for channel
	var chan1 Tcl_Channel // The opaque type for the channel.
	var chanName uintptr
	// var modeIndex int32 at bp+8, 4
	// Index of mode argument.
	var mask int32
	_ = dummy

	if objc != 3 && objc != 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34040)
		return TCL_ERROR
	}
	if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&modeOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+34065, 0, bp+8) != TCL_OK {
		return TCL_ERROR
	}
	mask = maskArray[*(*int32)(unsafe.Pointer(bp + 8 /* modeIndex */))]

	chanName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	chan1 = XTcl_GetChannel(tls, interp, chanName, uintptr(0))
	if chan1 == uintptr(0) {
		return TCL_ERROR
	}
	chanPtr = chan1
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	if (*ChannelState)(unsafe.Pointer(statePtr)).Fflags&mask == 0 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+34076,
			libc.VaList(bp, func() uintptr {
				if mask == int32(1)<<1 {
					return ts + 12260 /* "readable" */
				}
				return ts + 12334 /* "writable" */
			}())))
		return TCL_ERROR
	}

	// If we are supposed to return the script, do so.

	if objc == 3 {
		var esPtr uintptr

		for esPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FscriptRecordPtr; esPtr != uintptr(0); esPtr = (*EventScriptRecord)(unsafe.Pointer(esPtr)).FnextPtr {
			if (*EventScriptRecord)(unsafe.Pointer(esPtr)).Finterp == interp && (*EventScriptRecord)(unsafe.Pointer(esPtr)).Fmask == mask {
				XTcl_SetObjResult(tls, interp, (*EventScriptRecord)(unsafe.Pointer(esPtr)).FscriptPtr)
				break
			}
		}
		return TCL_OK
	}

	// If we are supposed to delete a stored script, do so.

	if int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}()))) == 0 {
		sDeleteScriptRecord(tls, interp, chanPtr, mask)
		return TCL_OK
	}

	// Make the script record that will link between the event and the script
	// to invoke. This also creates a channel event handler which will
	// evaluate the script in the supplied interpreter.

	sCreateScriptRecord(tls, interp, chanPtr, mask, *(*uintptr)(unsafe.Pointer(objv + 3*8)))

	return TCL_OK
}

var modeOptions = [3]uintptr{ts + 12260, ts + 12334, uintptr(0)} /* tclIO.c:9000:23 */
var maskArray = [2]int32{int32(1) << 1, int32(1) << 2}           /* tclIO.c:9001:22 */

//----------------------------------------------------------------------
//
// ZeroTransferTimerProc --
//
//	Timer handler scheduled by TclCopyChannel so that -command is
//	called asynchronously even when -size is 0.
//
// Results:
//	None.
//
// Side effects:
//	Calls CopyData for -command invocation.
//
//----------------------------------------------------------------------

func sZeroTransferTimerProc(tls *libc.TLS, clientData ClientData) { /* tclIO.c:9082:1: */
	// calling CopyData with mask==0 still implies immediate invocation of the
	//  -command callback, and completion of the fcopy.
	sCopyData(tls, clientData, 0)
}

//----------------------------------------------------------------------
//
// TclCopyChannel --
//
//	This routine copies data from one channel to another, either
//	synchronously or asynchronously. If a command script is supplied, the
//	operation runs in the background. The script is invoked when the copy
//	completes. Otherwise the function waits until the copy is completed
//	before returning.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May schedule a background copy operation that causes both channels to
//	be marked busy.
//
//----------------------------------------------------------------------

func XTclCopyChannelOld(tls *libc.TLS, interp uintptr, inChan Tcl_Channel, outChan Tcl_Channel, toRead int32, cmdPtr uintptr) int32 { /* tclIO.c:9113:1: */
	return XTclCopyChannel(tls, interp, inChan, outChan, Tcl_WideInt(toRead),
		cmdPtr)
}

func XTclCopyChannel(tls *libc.TLS, interp uintptr, inChan Tcl_Channel, outChan Tcl_Channel, toRead Tcl_WideInt, cmdPtr uintptr) int32 { /* tclIO.c:9125:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var inPtr uintptr = inChan
	var outPtr uintptr = outChan
	var inStatePtr uintptr
	var outStatePtr uintptr
	var readFlags int32
	var writeFlags int32
	var csPtr uintptr
	var nonBlocking int32
	if cmdPtr != 0 {
		nonBlocking = int32(1) << 3
	} else {
		nonBlocking = 0
	}
	var moveBytes int32

	inStatePtr = (*Channel)(unsafe.Pointer(inPtr)).Fstate
	outStatePtr = (*Channel)(unsafe.Pointer(outPtr)).Fstate

	if (*ChannelState)(unsafe.Pointer(inStatePtr)).FcsPtrR != 0 && int32(1)<<1&(int32(1)<<1) != 0 || (*ChannelState)(unsafe.Pointer(inStatePtr)).FcsPtrW != 0 && int32(1)<<1&(int32(1)<<2) != 0 {
		if interp != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+34094, libc.VaList(bp, XTcl_GetChannelName(tls, inChan))))
		}
		return TCL_ERROR
	}
	if (*ChannelState)(unsafe.Pointer(outStatePtr)).FcsPtrR != 0 && int32(1)<<2&(int32(1)<<1) != 0 || (*ChannelState)(unsafe.Pointer(outStatePtr)).FcsPtrW != 0 && int32(1)<<2&(int32(1)<<2) != 0 {
		if interp != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+34094, libc.VaList(bp+8, XTcl_GetChannelName(tls, outChan))))
		}
		return TCL_ERROR
	}

	readFlags = (*ChannelState)(unsafe.Pointer(inStatePtr)).Fflags
	writeFlags = (*ChannelState)(unsafe.Pointer(outStatePtr)).Fflags

	// Set up the blocking mode appropriately. Background copies need
	// non-blocking channels. Foreground copies need blocking channels. If
	// there is an error, restore the old blocking mode.

	if nonBlocking != readFlags&(int32(1)<<3) {
		if sSetBlockMode(tls, interp, inPtr, func() int32 {
			if nonBlocking != 0 {
				return TCL_MODE_NONBLOCKING
			}
			return TCL_MODE_BLOCKING
		}()) != TCL_OK {
			return TCL_ERROR
		}
	}
	if inPtr != outPtr && nonBlocking != writeFlags&(int32(1)<<3) && sSetBlockMode(tls, uintptr(0), outPtr, func() int32 {
		if nonBlocking != 0 {
			return TCL_MODE_NONBLOCKING
		}
		return TCL_MODE_BLOCKING
	}()) != TCL_OK && nonBlocking != readFlags&(int32(1)<<3) {
		sSetBlockMode(tls, uintptr(0), inPtr, func() int32 {
			if readFlags&(int32(1)<<3) != 0 {
				return TCL_MODE_NONBLOCKING
			}
			return TCL_MODE_BLOCKING
		}())
		return TCL_ERROR
	}

	// Make sure the output side is unbuffered.

	(*ChannelState)(unsafe.Pointer(outStatePtr)).Fflags = (*ChannelState)(unsafe.Pointer(outStatePtr)).Fflags&libc.CplInt32(int32(1)<<4) |
		int32(1)<<5

	// Test for conditions where we know we can just move bytes from input
	// channel to output channel with no transformation or even examination
	// of the bytes themselves.

	moveBytes = libc.Bool32((*ChannelState)(unsafe.Pointer(inStatePtr)).FinEofChar == 0 &&
		(*ChannelState)(unsafe.Pointer(inStatePtr)).FinputTranslation == TCL_TRANSLATE_LF &&
		(*ChannelState)(unsafe.Pointer(outStatePtr)).FoutputTranslation == TCL_TRANSLATE_LF &&
		(*ChannelState)(unsafe.Pointer(inStatePtr)).Fencoding == (*ChannelState)(unsafe.Pointer(outStatePtr)).Fencoding)

	// Allocate a new CopyState to maintain info about the current copy in
	// progress. This structure will be deallocated when the copy is
	// completed.

	csPtr = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(CopyState{}))+uint64(libc.BoolInt32(!(moveBytes != 0))*(*ChannelState)(unsafe.Pointer(inStatePtr)).FbufSize)))
	(*CopyState)(unsafe.Pointer(csPtr)).FbufSize = libc.BoolInt32(!(moveBytes != 0)) * (*ChannelState)(unsafe.Pointer(inStatePtr)).FbufSize
	(*CopyState)(unsafe.Pointer(csPtr)).FreadPtr = inPtr
	(*CopyState)(unsafe.Pointer(csPtr)).FwritePtr = outPtr
	(*CopyState)(unsafe.Pointer(csPtr)).FreadFlags = readFlags
	(*CopyState)(unsafe.Pointer(csPtr)).FwriteFlags = writeFlags
	(*CopyState)(unsafe.Pointer(csPtr)).FtoRead = toRead
	(*CopyState)(unsafe.Pointer(csPtr)).Ftotal = int64(0)
	(*CopyState)(unsafe.Pointer(csPtr)).Finterp = interp
	if cmdPtr != 0 {
		(*Tcl_Obj)(unsafe.Pointer(cmdPtr)).FrefCount++
	}
	(*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr = cmdPtr

	(*ChannelState)(unsafe.Pointer(inStatePtr)).FcsPtrR = csPtr
	(*ChannelState)(unsafe.Pointer(outStatePtr)).FcsPtrW = csPtr

	if moveBytes != 0 {
		return sMoveBytes(tls, csPtr)
	}

	// Special handling of -size 0 async transfers, so that the -command is
	// still called asynchronously.

	if nonBlocking == int32(1)<<3 && toRead == int64(0) {
		XTcl_CreateTimerHandler(tls, 0, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sZeroTransferTimerProc})), csPtr)
		return 0
	}

	// Start copying data between the channels.

	return sCopyData(tls, csPtr, 0)
}

//----------------------------------------------------------------------
//
// CopyData --
//
//	This function implements the lowest level of the copying mechanism for
//	TclCopyChannel.
//
// Results:
//	Returns TCL_OK on success, else TCL_ERROR.
//
// Side effects:
//	Moves data between channels, may create channel handlers.
//
//----------------------------------------------------------------------

func sMBCallback(tls *libc.TLS, csPtr uintptr, errObj uintptr) { /* tclIO.c:9262:1: */
	var cmdPtr uintptr = XTcl_DuplicateObj(tls, (*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr)
	var total Tcl_WideInt = (*CopyState)(unsafe.Pointer(csPtr)).Ftotal
	var interp uintptr = (*CopyState)(unsafe.Pointer(csPtr)).Finterp
	var code int32

	(*Tcl_Obj)(unsafe.Pointer(cmdPtr)).FrefCount++
	sStopCopy(tls, csPtr)

	// TODO: What if cmdPtr is not a list?!

	XTcl_ListObjAppendElement(tls, uintptr(0), cmdPtr, XTcl_NewWideIntObj(tls, total))
	if errObj != 0 {
		XTcl_ListObjAppendElement(tls, uintptr(0), cmdPtr, errObj)
	}

	XTcl_Preserve(tls, interp)
	code = XTcl_EvalObjEx(tls, interp, cmdPtr, TCL_EVAL_GLOBAL)
	if code != TCL_OK {
		XTcl_BackgroundException(tls, interp, code)
	}
	XTcl_Release(tls, interp)
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(cmdPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(cmdPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(cmdPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(cmdPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(cmdPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(cmdPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(cmdPtr)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, cmdPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(cmdPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = cmdPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, cmdPtr)
		}
	}

}

func sMBError(tls *libc.TLS, csPtr uintptr, mask int32, errorCode int32) { /* tclIO.c:9291:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var inChan Tcl_Channel = (*CopyState)(unsafe.Pointer(csPtr)).FreadPtr
	var outChan Tcl_Channel = (*CopyState)(unsafe.Pointer(csPtr)).FwritePtr
	var errObj uintptr

	XTcl_SetErrno(tls, errorCode)

	errObj = XTcl_ObjPrintf(tls, ts+34115,
		libc.VaList(bp, func() uintptr {
			if mask&(int32(1)<<1) != 0 {
				return ts + 5472 /* "read" */
			}
			return ts + 34136 /* "writ" */
		}(),
			XTcl_GetChannelName(tls, func() uintptr {
				if mask&(int32(1)<<1) != 0 {
					return inChan
				}
				return outChan
			}()),
			XTcl_PosixError(tls, (*CopyState)(unsafe.Pointer(csPtr)).Finterp)))

	if (*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr != 0 {
		sMBCallback(tls, csPtr, errObj)
	} else {
		XTcl_SetObjResult(tls, (*CopyState)(unsafe.Pointer(csPtr)).Finterp, errObj)
		sStopCopy(tls, csPtr)
	}
}

func sMBEvent(tls *libc.TLS, clientData ClientData, mask int32) { /* tclIO.c:9316:1: */
	var csPtr uintptr = clientData
	var inChan Tcl_Channel = (*CopyState)(unsafe.Pointer(csPtr)).FreadPtr
	var outChan Tcl_Channel = (*CopyState)(unsafe.Pointer(csPtr)).FwritePtr
	var inStatePtr uintptr = (*Channel1)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FreadPtr)).Fstate

	if mask&(int32(1)<<2) != 0 {
		XTcl_DeleteChannelHandler(tls, inChan, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, int32)
		}{sMBEvent})), csPtr)
		XTcl_DeleteChannelHandler(tls, outChan, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, int32)
		}{sMBEvent})), csPtr)
		switch sMBWrite(tls, csPtr) {
		case TCL_OK:
			sMBCallback(tls, csPtr, uintptr(0))
			break
			fallthrough
		case TCL_CONTINUE:
			XTcl_CreateChannelHandler(tls, inChan, int32(1)<<1, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, int32)
			}{sMBEvent})), csPtr)
			break
		}
	} else if mask&(int32(1)<<1) != 0 {
		if TCL_OK == sMBRead(tls, csPtr) {
			// When at least one full buffer is present, stop reading.
			if (*ChannelState)(unsafe.Pointer(inStatePtr)).FinQueueHead != 0 && (*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(inStatePtr)).FinQueueHead)).FnextAdded >= (*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(inStatePtr)).FinQueueHead)).FbufLength ||
				!(XTcl_InputBlocked(tls, inChan) != 0) {
				XTcl_DeleteChannelHandler(tls, inChan, *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, int32)
				}{sMBEvent})), csPtr)
			}

			// Successful read -- set up to write the bytes we read
			XTcl_CreateChannelHandler(tls, outChan, int32(1)<<2, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, int32)
			}{sMBEvent})), csPtr)
		}
	}
}

func sMBRead(tls *libc.TLS, csPtr uintptr) int32 { /* tclIO.c:9351:1: */
	var inStatePtr uintptr = (*Channel1)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FreadPtr)).Fstate
	var bufPtr uintptr = (*ChannelState)(unsafe.Pointer(inStatePtr)).FinQueueHead
	var code int32

	if bufPtr != 0 && (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded-(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved > 0 {
		return TCL_OK
	}

	code = sGetInput(tls, (*ChannelState)(unsafe.Pointer(inStatePtr)).FtopChanPtr)
	if code == 0 || (*ChannelState)(unsafe.Pointer(inStatePtr)).Fflags&(int32(1)<<11) != 0 {
		return TCL_OK
	} else {
		sMBError(tls, csPtr, int32(1)<<1, code)
		return TCL_ERROR
	}
	return int32(0)
}

func sMBWrite(tls *libc.TLS, csPtr uintptr) int32 { /* tclIO.c:9372:1: */
	var inStatePtr uintptr = (*Channel1)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FreadPtr)).Fstate
	var outStatePtr uintptr = (*Channel1)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FwritePtr)).Fstate
	var bufPtr uintptr = (*ChannelState)(unsafe.Pointer(inStatePtr)).FinQueueHead
	var tail uintptr = uintptr(0)
	var code int32
	var inBytes Tcl_WideInt = int64(0)

	// Count up number of bytes waiting in the input queue
	for bufPtr != 0 {
		inBytes = inBytes + Tcl_WideInt((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded-(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved)
		tail = bufPtr
		if (*CopyState)(unsafe.Pointer(csPtr)).FtoRead != int64(-1) && (*CopyState)(unsafe.Pointer(csPtr)).FtoRead < inBytes {
			// Queue has enough bytes to complete the copy
			break
		}
		bufPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
	}

	if bufPtr != 0 {
		// Split the overflowing buffer in two
		var extra int32 = int32(inBytes - (*CopyState)(unsafe.Pointer(csPtr)).FtoRead)
		// Note that going with int for extra assumes that inBytes is not too
		// much over toRead to require a wide itself. If that gets violated
		// then the calculations involving extra must be made wide too.
		//
		// Noted with Win32/MSVC debug build treating the warning (possible of
		// data in __int64 to int conversion) as error.

		bufPtr = sAllocChannelBuffer(tls, extra)

		*(*int32)(unsafe.Pointer(tail + 4)) -= extra
		libc.Xmemcpy(tls, bufPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded), tail+24+uintptr((*ChannelBuffer)(unsafe.Pointer(tail)).FnextAdded), uint64(extra))
		*(*int32)(unsafe.Pointer(bufPtr + 4)) += extra
		(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr = (*ChannelBuffer)(unsafe.Pointer(tail)).FnextPtr
		(*ChannelBuffer)(unsafe.Pointer(tail)).FnextPtr = uintptr(0)
		inBytes = (*CopyState)(unsafe.Pointer(csPtr)).FtoRead
	}

	// Update the byte counts
	if (*CopyState)(unsafe.Pointer(csPtr)).FtoRead != int64(-1) {
		*(*Tcl_WideInt)(unsafe.Pointer(csPtr + 24)) -= inBytes
	}
	*(*Tcl_WideInt)(unsafe.Pointer(csPtr + 32)) += inBytes

	// Move buffers from input to output channels
	if (*ChannelState)(unsafe.Pointer(outStatePtr)).FoutQueueTail != 0 {
		(*ChannelBuffer)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(outStatePtr)).FoutQueueTail)).FnextPtr = (*ChannelState)(unsafe.Pointer(inStatePtr)).FinQueueHead
	} else {
		(*ChannelState)(unsafe.Pointer(outStatePtr)).FoutQueueHead = (*ChannelState)(unsafe.Pointer(inStatePtr)).FinQueueHead
	}
	(*ChannelState)(unsafe.Pointer(outStatePtr)).FoutQueueTail = tail
	(*ChannelState)(unsafe.Pointer(inStatePtr)).FinQueueHead = bufPtr
	if (*ChannelState)(unsafe.Pointer(inStatePtr)).FinQueueTail == tail {
		(*ChannelState)(unsafe.Pointer(inStatePtr)).FinQueueTail = bufPtr
	}
	if bufPtr == uintptr(0) {
		(*ChannelState)(unsafe.Pointer(inStatePtr)).FinQueueTail = uintptr(0)
	}

	code = sFlushChannel(tls, (*CopyState)(unsafe.Pointer(csPtr)).Finterp, (*ChannelState)(unsafe.Pointer(outStatePtr)).FtopChanPtr, 0)
	if code != 0 {
		sMBError(tls, csPtr, int32(1)<<2, code)
		return TCL_ERROR
	}
	if (*CopyState)(unsafe.Pointer(csPtr)).FtoRead == int64(0) || (*ChannelState)(unsafe.Pointer(inStatePtr)).Fflags&(int32(1)<<9) != 0 {
		return TCL_OK
	}
	return TCL_CONTINUE
}

func sMoveBytes(tls *libc.TLS, csPtr uintptr) int32 { /* tclIO.c:9447:1: */
	var outStatePtr uintptr = (*Channel1)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FwritePtr)).Fstate
	var bufPtr uintptr = (*ChannelState)(unsafe.Pointer(outStatePtr)).FcurOutPtr
	var errorCode int32

	if bufPtr != 0 && (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded-(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved != 0 {
		// If we start with unflushed bytes in the destination
		// channel, flush them out of the way first.

		errorCode = sFlushChannel(tls, (*CopyState)(unsafe.Pointer(csPtr)).Finterp, (*ChannelState)(unsafe.Pointer(outStatePtr)).FtopChanPtr, 0)
		if errorCode != 0 {
			sMBError(tls, csPtr, int32(1)<<2, errorCode)
			return TCL_ERROR
		}
	}

	if (*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr != 0 {
		var inChan Tcl_Channel = (*CopyState)(unsafe.Pointer(csPtr)).FreadPtr
		XTcl_CreateChannelHandler(tls, inChan, int32(1)<<1, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, int32)
		}{sMBEvent})), csPtr)
		return TCL_OK
	}

	for 1 != 0 {
		var code int32

		if TCL_ERROR == sMBRead(tls, csPtr) {
			return TCL_ERROR
		}
		code = sMBWrite(tls, csPtr)
		if code == TCL_OK {
			XTcl_SetObjResult(tls, (*CopyState)(unsafe.Pointer(csPtr)).Finterp, XTcl_NewWideIntObj(tls, (*CopyState)(unsafe.Pointer(csPtr)).Ftotal))
			sStopCopy(tls, csPtr)
			return TCL_OK
		}
		if code == TCL_ERROR {
			return TCL_ERROR
		}
		// code == TCL_CONTINUE --> continue the loop
	}
	return TCL_OK // Silence compiler warnings
}

func sCopyData(tls *libc.TLS, csPtr uintptr, mask int32) int32 { /* tclIO.c:9492:1: */
	bp := tls.Alloc(108)
	defer tls.Free(108)

	var interp uintptr
	var cmdPtr uintptr
	var errObj uintptr
	var bufObj uintptr
	// var msg uintptr at bp+96, 8

	var inChan Tcl_Channel
	var outChan Tcl_Channel
	var inStatePtr uintptr
	var outStatePtr uintptr
	var result int32
	var size int32
	// var sizeb int32 at bp+104, 4

	var total Tcl_WideInt
	var buffer uintptr
	var inBinary int32
	var outBinary int32
	var sameEncoding int32
	// Encoding control
	var underflow int32
	var cachePtr uintptr
	var cachePtr1 uintptr
	var _objPtr uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var _objPtr1 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	var cachePtr6 uintptr
	var cachePtr7 uintptr
	var code int32
	errObj = uintptr(0)
	bufObj = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 96 /* msg */)) = uintptr(0)
	result = TCL_OK // Input underflow

	inChan = (*CopyState)(unsafe.Pointer(csPtr)).FreadPtr
	outChan = (*CopyState)(unsafe.Pointer(csPtr)).FwritePtr
	inStatePtr = (*Channel1)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FreadPtr)).Fstate
	outStatePtr = (*Channel1)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FwritePtr)).Fstate
	interp = (*CopyState)(unsafe.Pointer(csPtr)).Finterp
	cmdPtr = (*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr

	// Copy the data the slow way, using the translation mechanism.
	//
	// Note: We have make sure that we use the topmost channel in a stack for
	// the copying. The caller uses Tcl_GetChannel to access it, and thus gets
	// the bottom of the stack.

	inBinary = libc.Bool32((*ChannelState)(unsafe.Pointer(inStatePtr)).Fencoding == uintptr(0))
	outBinary = libc.Bool32((*ChannelState)(unsafe.Pointer(outStatePtr)).Fencoding == uintptr(0))
	sameEncoding = libc.Bool32((*ChannelState)(unsafe.Pointer(inStatePtr)).Fencoding == (*ChannelState)(unsafe.Pointer(outStatePtr)).Fencoding)

	if !!(inBinary != 0 || sameEncoding != 0) {
		goto __1
	}
__2:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __5
	}
	bufObj = XTclThreadAllocObj(tls)
	goto __6
__5:
	bufObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bufObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__6:
	;
	goto __3
__3:
	if 0 != 0 {
		goto __2
	}
	goto __4
__4:
	;
	(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(bufObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(bufObj)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount++
__1:
	;

__7:
	if !((*CopyState)(unsafe.Pointer(csPtr)).FtoRead != int64(0)) {
		goto __8
	}
	// Check for unreported background errors.

	XTcl_GetChannelError(tls, inChan, bp+96)
	if !((*ChannelState)(unsafe.Pointer(inStatePtr)).FunreportedError != 0 || *(*uintptr)(unsafe.Pointer(bp + 96)) != uintptr(0)) {
		goto __9
	}
	XTcl_SetErrno(tls, (*ChannelState)(unsafe.Pointer(inStatePtr)).FunreportedError)
	(*ChannelState)(unsafe.Pointer(inStatePtr)).FunreportedError = 0
	goto readError
__9:
	;
	XTcl_GetChannelError(tls, outChan, bp+96)
	if !((*ChannelState)(unsafe.Pointer(outStatePtr)).FunreportedError != 0 || *(*uintptr)(unsafe.Pointer(bp + 96)) != uintptr(0)) {
		goto __10
	}
	XTcl_SetErrno(tls, (*ChannelState)(unsafe.Pointer(outStatePtr)).FunreportedError)
	(*ChannelState)(unsafe.Pointer(outStatePtr)).FunreportedError = 0
	goto writeError
__10:
	;

	if !(cmdPtr != 0 && mask == 0) {
		goto __11
	}
	// In async mode, we skip reading synchronously and fake an
	// underflow instead to prime the readable fileevent.

	size = 0
	underflow = 1
	goto __12
__11:
	// Read up to bufSize bytes.

	if !((*CopyState)(unsafe.Pointer(csPtr)).FtoRead == int64(-1) ||
		(*CopyState)(unsafe.Pointer(csPtr)).FtoRead > Tcl_WideInt((*CopyState)(unsafe.Pointer(csPtr)).FbufSize)) {
		goto __13
	}
	*(*int32)(unsafe.Pointer(bp + 104 /* sizeb */)) = (*CopyState)(unsafe.Pointer(csPtr)).FbufSize
	goto __14
__13:
	*(*int32)(unsafe.Pointer(bp + 104 /* sizeb */)) = int32((*CopyState)(unsafe.Pointer(csPtr)).FtoRead)
__14:
	;

	if !(inBinary != 0 || sameEncoding != 0) {
		goto __15
	}
	size = sDoRead(tls, (*ChannelState)(unsafe.Pointer(inStatePtr)).FtopChanPtr, csPtr+60, *(*int32)(unsafe.Pointer(bp + 104 /* sizeb */)),
		libc.BoolInt32(!((*ChannelState)(unsafe.Pointer(inStatePtr)).Fflags&(int32(1)<<3) != 0)))
	goto __16
__15:
	size = sDoReadChars(tls, (*ChannelState)(unsafe.Pointer(inStatePtr)).FtopChanPtr, bufObj, *(*int32)(unsafe.Pointer(bp + 104 /* sizeb */)),
		0)
__16:
	;
	underflow = libc.Bool32(size >= 0 && size < *(*int32)(unsafe.Pointer(bp + 104))) // Input underflow
__12:
	;

	if !(size < 0) {
		goto __17
	}
readError:
	if !(interp != 0) {
		goto __19
	}
__20:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __23
	}
	errObj = XTclThreadAllocObj(tls)
	goto __24
__23:
	errObj = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(errObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__24:
	;
	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	(*Tcl_Obj)(unsafe.Pointer(errObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(errObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(errObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(errObj)).FtypePtr = uintptr(0)

	XTcl_AppendStringsToObj(tls, errObj, libc.VaList(bp, ts+34141,
		XTcl_GetChannelName(tls, inChan), ts+34157, uintptr(0)))
	if !(*(*uintptr)(unsafe.Pointer(bp + 96)) != uintptr(0)) {
		goto __25
	}
	XTcl_AppendObjToObj(tls, errObj, *(*uintptr)(unsafe.Pointer(bp + 96 /* msg */)))
	goto __26
__25:
	XTcl_AppendStringsToObj(tls, errObj, libc.VaList(bp+32, XTcl_PosixError(tls, interp),
		uintptr(0)))
__26:
	;
__19:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 96)) != uintptr(0)) {
		goto __27
	}
__28:
	_objPtr = *(*uintptr)(unsafe.Pointer(bp + 96))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __31
	}
	XTclFreeObj(tls, _objPtr)
__31:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
__27:
	;
	goto __8
	goto __18
__17:
	if !(underflow != 0) {
		goto __32
	}
	// We had an underflow on the read side. If we are at EOF, and not
	// in the synchronous part of an asynchronous fcopy, then the
	// copying is done, otherwise set up a channel handler to detect
	// when the channel becomes readable again.

	if !(size == 0 && XTcl_Eof(tls, inChan) != 0 && !(cmdPtr != 0 && mask == 0)) {
		goto __33
	}
	goto __8
__33:
	;
	if !(cmdPtr != 0 && (!(XTcl_Eof(tls, inChan) != 0) || mask == 0) && !(mask&(int32(1)<<1) != 0)) {
		goto __34
	}
	if !(mask&(int32(1)<<2) != 0) {
		goto __35
	}
	XTcl_DeleteChannelHandler(tls, outChan, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sCopyEventProc})), csPtr)
__35:
	;
	XTcl_CreateChannelHandler(tls, inChan, int32(1)<<1, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sCopyEventProc})),
		csPtr)
__34:
	;
	if !(size == 0) {
		goto __36
	}
	if !!((*ChannelState)(unsafe.Pointer(inStatePtr)).Fflags&(int32(1)<<3) != 0) {
		goto __37
	}
	// We allowed a short read.  Keep trying.

	goto __7
__37:
	;
	if !(bufObj != uintptr(0)) {
		goto __38
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount, 1) > 1) {
		goto __39
	}
	goto __40
__39:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(bufObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bufObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __41
	}

	if !((*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes != XtclEmptyStringRep) {
		goto __43
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes)
__43:
	;
	(*Tcl_Obj)(unsafe.Pointer(bufObj)).Flength = -1
__44:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __47
	}
	XTclThreadFreeObj(tls, bufObj)
	goto __48
__47:
	*(*uintptr)(unsafe.Pointer(bufObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = bufObj
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__48:
	;
	goto __45
__45:
	if 0 != 0 {
		goto __44
	}
	goto __46
__46:
	;
	goto __42
__41:
	XTclFreeObj(tls, bufObj)
__42:
	;
__40:
	;

	bufObj = uintptr(0)
__38:
	;
	return TCL_OK
__36:
	;
__32:
	;
__18:
	;

	// Now write the buffer out.

	if !(inBinary != 0 || sameEncoding != 0) {
		goto __49
	}
	buffer = csPtr + 60 /* &.buffer */
	*(*int32)(unsafe.Pointer(bp + 104 /* sizeb */)) = size
	goto __50
__49:
	buffer = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 104)) = (*Tcl_Obj)(unsafe.Pointer(bufObj)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, bufObj, bp+104)
	}()
__50:
	;

	if !(outBinary != 0 || sameEncoding != 0) {
		goto __51
	}
	*(*int32)(unsafe.Pointer(bp + 104 /* sizeb */)) = sWrite(tls, (*ChannelState)(unsafe.Pointer(outStatePtr)).FtopChanPtr, buffer, *(*int32)(unsafe.Pointer(bp + 104 /* sizeb */)), XtclIdentityEncoding)
	goto __52
__51:
	*(*int32)(unsafe.Pointer(bp + 104 /* sizeb */)) = sWrite(tls, (*ChannelState)(unsafe.Pointer(outStatePtr)).FtopChanPtr, buffer, *(*int32)(unsafe.Pointer(bp + 104 /* sizeb */)), (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(outStatePtr)).FtopChanPtr)).Fstate)).Fencoding)
__52:
	;

	// [Bug 2895565]. At this point 'size' still contains the number of
	// bytes or characters which have been read. We keep this to later to
	// update the totals and toRead information, see marker (UP) below. We
	// must not overwrite it with 'sizeb', which is the number of written
	// bytes or characters, and both EOL translation and encoding
	// conversion may have changed this number unpredictably in relation
	// to 'size' (It can be smaller or larger, in the latter case able to
	// drive toRead below -1, causing infinite looping). Completely
	// unsuitable for updating totals and toRead.

	if !(*(*int32)(unsafe.Pointer(bp + 104)) < 0) {
		goto __53
	}
writeError:
	if !(interp != 0) {
		goto __54
	}
__55:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __58
	}
	errObj = XTclThreadAllocObj(tls)
	goto __59
__58:
	errObj = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(errObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__59:
	;
	goto __56
__56:
	if 0 != 0 {
		goto __55
	}
	goto __57
__57:
	;
	(*Tcl_Obj)(unsafe.Pointer(errObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(errObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(errObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(errObj)).FtypePtr = uintptr(0)

	XTcl_AppendStringsToObj(tls, errObj, libc.VaList(bp+48, ts+34161,
		XTcl_GetChannelName(tls, outChan), ts+34157, uintptr(0)))
	if !(*(*uintptr)(unsafe.Pointer(bp + 96)) != uintptr(0)) {
		goto __60
	}
	XTcl_AppendObjToObj(tls, errObj, *(*uintptr)(unsafe.Pointer(bp + 96 /* msg */)))
	goto __61
__60:
	XTcl_AppendStringsToObj(tls, errObj, libc.VaList(bp+80, XTcl_PosixError(tls, interp),
		uintptr(0)))
__61:
	;
__54:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 96)) != uintptr(0)) {
		goto __62
	}
__63:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 96))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __66
	}
	XTclFreeObj(tls, _objPtr1)
__66:
	;
	goto __64
__64:
	if 0 != 0 {
		goto __63
	}
	goto __65
__65:
	;
__62:
	;
	goto __8
__53:
	;

	// Update the current byte count. Do it now so the count is valid
	// before a return or break takes us out of the loop. The invariant at
	// the top of the loop should be that csPtr->toRead holds the number
	// of bytes left to copy.

	if !((*CopyState)(unsafe.Pointer(csPtr)).FtoRead != int64(-1)) {
		goto __67
	}
	*(*Tcl_WideInt)(unsafe.Pointer(csPtr + 24)) -= Tcl_WideInt(size)
__67:
	;
	*(*Tcl_WideInt)(unsafe.Pointer(csPtr + 32)) += Tcl_WideInt(size)

	// Break loop if EOF && (size>0)

	if !(XTcl_Eof(tls, inChan) != 0) {
		goto __68
	}
	goto __8
__68:
	;

	// Check to see if the write is happening in the background. If so,
	// stop copying and wait for the channel to become writable again.
	// After input underflow we already installed a readable handler
	// therefore we don't need a writable handler.

	if !(!(underflow != 0) && (*ChannelState)(unsafe.Pointer(outStatePtr)).Fflags&(int32(1)<<7) != 0) {
		goto __69
	}
	if !!(mask&(int32(1)<<2) != 0) {
		goto __70
	}
	if !(mask&(int32(1)<<1) != 0) {
		goto __71
	}
	XTcl_DeleteChannelHandler(tls, inChan, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sCopyEventProc})), csPtr)
__71:
	;
	XTcl_CreateChannelHandler(tls, outChan, int32(1)<<2,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, int32)
		}{sCopyEventProc})), csPtr)
__70:
	;
	if !(bufObj != uintptr(0)) {
		goto __72
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount, 1) > 1) {
		goto __73
	}
	goto __74
__73:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(bufObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bufObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __75
	}

	if !((*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes != XtclEmptyStringRep) {
		goto __77
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes)
__77:
	;
	(*Tcl_Obj)(unsafe.Pointer(bufObj)).Flength = -1
__78:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __81
	}
	XTclThreadFreeObj(tls, bufObj)
	goto __82
__81:
	*(*uintptr)(unsafe.Pointer(bufObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = bufObj
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++
__82:
	;
	goto __79
__79:
	if 0 != 0 {
		goto __78
	}
	goto __80
__80:
	;
	goto __76
__75:
	XTclFreeObj(tls, bufObj)
__76:
	;
__74:
	;

	bufObj = uintptr(0)
__72:
	;
	return TCL_OK
__69:
	;

	// For background copies, we only do one buffer per invocation so we
	// don't starve the rest of the system.

	if !(cmdPtr != 0 && (*CopyState)(unsafe.Pointer(csPtr)).FtoRead != int64(0)) {
		goto __83
	}
	// The first time we enter this code, there won't be a channel
	// handler established yet, so do it here.

	if !(mask == 0) {
		goto __84
	}
	XTcl_CreateChannelHandler(tls, outChan, int32(1)<<2, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sCopyEventProc})),
		csPtr)
__84:
	;
	if !(bufObj != uintptr(0)) {
		goto __85
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount, 1) > 1) {
		goto __86
	}
	goto __87
__86:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(bufObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bufObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __88
	}

	if !((*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes != XtclEmptyStringRep) {
		goto __90
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes)
__90:
	;
	(*Tcl_Obj)(unsafe.Pointer(bufObj)).Flength = -1
__91:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __94
	}
	XTclThreadFreeObj(tls, bufObj)
	goto __95
__94:
	*(*uintptr)(unsafe.Pointer(bufObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = bufObj
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++
__95:
	;
	goto __92
__92:
	if 0 != 0 {
		goto __91
	}
	goto __93
__93:
	;
	goto __89
__88:
	XTclFreeObj(tls, bufObj)
__89:
	;
__87:
	;

	bufObj = uintptr(0)
__85:
	;
	return TCL_OK
__83:
	;
	goto __7
__8:
	; // while

	if !(bufObj != uintptr(0)) {
		goto __96
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount, 1) > 1) {
		goto __97
	}
	goto __98
__97:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(bufObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bufObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __99
	}

	if !((*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes != XtclEmptyStringRep) {
		goto __101
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(bufObj)).Fbytes)
__101:
	;
	(*Tcl_Obj)(unsafe.Pointer(bufObj)).Flength = -1
__102:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __105
	}
	XTclThreadFreeObj(tls, bufObj)
	goto __106
__105:
	*(*uintptr)(unsafe.Pointer(bufObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = bufObj
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++
__106:
	;
	goto __103
__103:
	if 0 != 0 {
		goto __102
	}
	goto __104
__104:
	;
	goto __100
__99:
	XTclFreeObj(tls, bufObj)
__100:
	;
__98:
	;

	bufObj = uintptr(0)
__96:
	;

	// Make the callback or return the number of bytes transferred. The local
	// total is used because StopCopy frees csPtr.

	total = (*CopyState)(unsafe.Pointer(csPtr)).Ftotal
	if !(cmdPtr != 0 && interp != 0) {
		goto __107
	}

	// Get a private copy of the command so we can mutate it by adding
	// arguments. Note that StopCopy frees our saved reference to the
	// original command obj.

	cmdPtr = XTcl_DuplicateObj(tls, cmdPtr)
	(*Tcl_Obj)(unsafe.Pointer(cmdPtr)).FrefCount++
	sStopCopy(tls, csPtr)
	XTcl_Preserve(tls, interp)

	XTcl_ListObjAppendElement(tls, interp, cmdPtr, XTcl_NewWideIntObj(tls, total))
	if !(errObj != 0) {
		goto __109
	}
	XTcl_ListObjAppendElement(tls, interp, cmdPtr, errObj)
__109:
	;
	code = XTcl_EvalObjEx(tls, interp, cmdPtr, TCL_EVAL_GLOBAL)
	if !(code != TCL_OK) {
		goto __110
	}
	XTcl_BackgroundException(tls, interp, code)
	result = TCL_ERROR
__110:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(cmdPtr)).FrefCount, 1) > 1) {
		goto __111
	}
	goto __112
__111:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(cmdPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(cmdPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __113
	}

	if !((*Tcl_Obj)(unsafe.Pointer(cmdPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(cmdPtr)).Fbytes != XtclEmptyStringRep) {
		goto __115
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(cmdPtr)).Fbytes)
__115:
	;
	(*Tcl_Obj)(unsafe.Pointer(cmdPtr)).Flength = -1
__116:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr7 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __119
	}
	XTclThreadFreeObj(tls, cmdPtr)
	goto __120
__119:
	*(*uintptr)(unsafe.Pointer(cmdPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = cmdPtr
	(*AllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++
__120:
	;
	goto __117
__117:
	if 0 != 0 {
		goto __116
	}
	goto __118
__118:
	;
	goto __114
__113:
	XTclFreeObj(tls, cmdPtr)
__114:
	;
__112:
	;

	XTcl_Release(tls, interp)
	goto __108
__107:
	sStopCopy(tls, csPtr)
	if !(interp != 0) {
		goto __121
	}
	if !(errObj != 0) {
		goto __122
	}
	XTcl_SetObjResult(tls, interp, errObj)
	result = TCL_ERROR
	goto __123
__122:
	XTcl_ResetResult(tls, interp)
	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, total))
__123:
	;
__121:
	;
__108:
	;
	return result
}

//----------------------------------------------------------------------
//
// DoRead --
//
//	Stores up to "bytesToRead" bytes in memory pointed to by "dst".
//	These bytes come from reading the channel "chanPtr" and
//	performing the configured translations.  No encoding conversions
//	are applied to the bytes being read.
//
// Results:
//	The number of bytes actually stored (<= bytesToRead),
// 	or -1 if there is an error in reading the channel.  Use
// 	Tcl_GetErrno() to retrieve the error code for the error
//	that occurred.
//
//	The number of bytes stored can be less than the number
// 	requested when
//	  - EOF is reached on the channel; or
//	  - the channel is non-blocking, and we've read all we can
//	    without blocking.
//	  - a channel reading error occurs (and we return -1)
//
// Side effects:
//	May cause input to be buffered.
//
//----------------------------------------------------------------------

func sDoRead(tls *libc.TLS, chanPtr uintptr, dst uintptr, bytesToRead int32, allowShortReads int32) int32 { /* tclIO.c:9825:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var statePtr uintptr
	var p uintptr
	// Not enough bytes in it yet
	// to fill the dst
	var code int32
	// There's a next buffer.  Shift orphan \r to it.

	var nextPtr uintptr
	// Each pass through the loop is intended to process up to one channel
	// buffer.

	// var bytesRead int32 at bp+4, 4

	// var bytesWritten int32 at bp, 4

	var bufPtr uintptr
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	p = dst

	// Early out when we know a read will get the eofchar.
	//
	// NOTE: This seems to be a bug.  The special handling for
	// a zero-char read request ought to come first.  As coded
	// the EOF due to eofchar has distinguishing behavior from
	// the EOF due to reported EOF on the underlying device, and
	// that seems undesirable.  However recent history indicates
	// that new inconsistent behavior in a patchlevel has problems
	// too.  Keep on keeping on for now.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<10) != 0) {
		goto __1
	}
	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 9

	// TODO: Don't need this call
	sUpdateInterest(tls, chanPtr)
	return 0
__1:
	;

	// Special handling for zero-char read request.

	if !(bytesToRead == 0) {
		goto __2
	}
	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0) {
		goto __3
	}
	*(*int32)(unsafe.Pointer(statePtr + 32)) |= TCL_ENCODING_START
__3:
	;
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<11 | int32(1)<<9)
	*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(TCL_ENCODING_END)
	// TODO: Don't need this call
	sUpdateInterest(tls, chanPtr)
	return 0
__2:
	;

	XTclChannelPreserve(tls, chanPtr)
__4:
	if !(bytesToRead != 0) {
		goto __5
	}
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead

	// Don't read more data if we have what we need.

__6:
	if !(!(bufPtr != 0) || !(bufPtr != 0 && (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded >= (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FbufLength) && (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded-(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved < bytesToRead) {
		goto __7
	}

moreData:
	code = sGetInput(tls, chanPtr)
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9|int32(1)<<11) != 0) {
		goto __8
	}
	// Further reads cannot do any more.

	goto __7
__8:
	;

	if !(code != 0) {
		goto __9
	}
	// Read error

	sUpdateInterest(tls, chanPtr)
	XTclChannelRelease(tls, chanPtr)
	return -1
__9:
	;

	goto __6
__7:
	;

	*(*int32)(unsafe.Pointer(bp + 4 /* bytesRead */)) = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded - (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved
	*(*int32)(unsafe.Pointer(bp /* bytesWritten */)) = bytesToRead

	sTranslateInputEOL(tls, statePtr, p, bufPtr+24+uintptr((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved),
		bp, bp+4)
	*(*int32)(unsafe.Pointer(bufPtr + 8)) += *(*int32)(unsafe.Pointer(bp + 4))
	p += uintptr(*(*int32)(unsafe.Pointer(bp /* bytesWritten */)))
	bytesToRead = bytesToRead - *(*int32)(unsafe.Pointer(bp))

	if !!((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded == (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved) {
		goto __10
	}
	// Buffer is not empty.  How can that be?
	//
	// 0) We stopped early because we got all the bytes we were
	//    seeking. That's fine.

	if !(bytesToRead == 0) {
		goto __11
	}
	goto __5
__11:
	;

	// 1) We're @EOF because we saw eof char.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<10) != 0) {
		goto __12
	}
	goto __5
__12:
	;

	// 2) The buffer holds a \r while in CRLF translation, followed by
	//    the end of the buffer.

	if !((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr == uintptr(0)) {
		goto __13
	}
	// There's no more buffered data...

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0) {
		goto __14
	}
	// ...and there never will be.

	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8('\r')
	bytesToRead--
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved++
	goto __15
__14:
	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<11) != 0) {
		goto __16
	}
	// ...and we cannot get more now.

	*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 14
	goto __5
	goto __17
__16:
	// ...so we need to get some.

	goto moreData
__17:
	;
__15:
	;
__13:
	;

	if !((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr != 0) {
		goto __18
	}
	// There's a next buffer.  Shift orphan \r to it.

	nextPtr = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr

	*(*int32)(unsafe.Pointer(nextPtr + 8)) -= 1
	*(*int8)(unsafe.Pointer(nextPtr + 24 + uintptr((*ChannelBuffer)(unsafe.Pointer(nextPtr)).FnextRemoved))) = int8('\r')
	(*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved++
__18:
	;
__10:
	;

	if !((*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded == (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved) {
		goto __19
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead = (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextPtr
	if !((*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead == uintptr(0)) {
		goto __20
	}
	(*ChannelState)(unsafe.Pointer(statePtr)).FinQueueTail = uintptr(0)
__20:
	;
	sRecycleBuffer(tls, statePtr, bufPtr, 0)
	bufPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FinQueueHead
__19:
	;

	if !(((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<3) != 0 || allowShortReads != 0) &&
		(*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<11) != 0) {
		goto __21
	}
	goto __5
__21:
	;

	// When there's no buffered data to read, and we're at EOF, escape to
	// the caller.

	if !((*ChannelState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<9) != 0 &&
		(bufPtr == uintptr(0) || (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextAdded == (*ChannelBuffer)(unsafe.Pointer(bufPtr)).FnextRemoved)) {
		goto __22
	}
	goto __5
__22:
	;
	goto __4
__5:
	;
	if !(bytesToRead == 0) {
		goto __23
	}
	*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1) << 11)
__23:
	;

	sUpdateInterest(tls, chanPtr)
	XTclChannelRelease(tls, chanPtr)
	return int32((int64(p) - int64(dst)) / 1)
}

//----------------------------------------------------------------------
//
// CopyEventProc --
//
//	This routine is invoked as a channel event handler for the background
//	copy operation. It is just a trivial wrapper around the CopyData
//	routine.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sCopyEventProc(tls *libc.TLS, clientData ClientData, mask int32) { /* tclIO.c:10060:1: */
	sCopyData(tls, clientData, mask)
}

//----------------------------------------------------------------------
//
// StopCopy --
//
//	This routine halts a copy that is in progress.
//
// Results:
//	None.
//
// Side effects:
//	Removes any pending channel handlers and restores the blocking and
//	buffering modes of the channels. The CopyState is freed.
//
//----------------------------------------------------------------------

func sStopCopy(tls *libc.TLS, csPtr uintptr) { /* tclIO.c:10085:1: */
	var inStatePtr uintptr
	var outStatePtr uintptr
	var inChan Tcl_Channel
	var outChan Tcl_Channel
	var nonBlocking int32

	if !(csPtr != 0) {
		return
	}

	inChan = (*CopyState)(unsafe.Pointer(csPtr)).FreadPtr
	outChan = (*CopyState)(unsafe.Pointer(csPtr)).FwritePtr
	inStatePtr = (*Channel1)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FreadPtr)).Fstate
	outStatePtr = (*Channel1)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FwritePtr)).Fstate

	// Restore the old blocking mode and output buffering mode.

	nonBlocking = (*CopyState)(unsafe.Pointer(csPtr)).FreadFlags & (int32(1) << 3)
	if nonBlocking != (*ChannelState)(unsafe.Pointer(inStatePtr)).Fflags&(int32(1)<<3) {
		sSetBlockMode(tls, uintptr(0), (*CopyState)(unsafe.Pointer(csPtr)).FreadPtr,
			func() int32 {
				if nonBlocking != 0 {
					return TCL_MODE_NONBLOCKING
				}
				return TCL_MODE_BLOCKING
			}())
	}
	if (*CopyState)(unsafe.Pointer(csPtr)).FreadPtr != (*CopyState)(unsafe.Pointer(csPtr)).FwritePtr {
		nonBlocking = (*CopyState)(unsafe.Pointer(csPtr)).FwriteFlags & (int32(1) << 3)
		if nonBlocking != (*ChannelState)(unsafe.Pointer(outStatePtr)).Fflags&(int32(1)<<3) {
			sSetBlockMode(tls, uintptr(0), (*CopyState)(unsafe.Pointer(csPtr)).FwritePtr,
				func() int32 {
					if nonBlocking != 0 {
						return TCL_MODE_NONBLOCKING
					}
					return TCL_MODE_BLOCKING
				}())
		}
	}
	*(*int32)(unsafe.Pointer(outStatePtr + 8)) &= libc.CplInt32(int32(1)<<4 | int32(1)<<5)
	*(*int32)(unsafe.Pointer(outStatePtr + 8)) |= (*CopyState)(unsafe.Pointer(csPtr)).FwriteFlags & (int32(1)<<4 | int32(1)<<5)

	if (*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr != 0 {
		XTcl_DeleteChannelHandler(tls, inChan, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, int32)
		}{sCopyEventProc})), csPtr)
		if inChan != outChan {
			XTcl_DeleteChannelHandler(tls, outChan, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, int32)
			}{sCopyEventProc})), csPtr)
		}
		XTcl_DeleteChannelHandler(tls, inChan, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, int32)
		}{sMBEvent})), csPtr)
		XTcl_DeleteChannelHandler(tls, outChan, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, int32)
		}{sMBEvent})), csPtr)
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, (*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr)
					} else {
						*(*uintptr)(unsafe.Pointer((*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, (*CopyState)(unsafe.Pointer(csPtr)).FcmdPtr)
			}
		}

	}
	(*ChannelState)(unsafe.Pointer(inStatePtr)).FcsPtrR = uintptr(0)
	(*ChannelState)(unsafe.Pointer(outStatePtr)).FcsPtrW = uintptr(0)
	XTclpFree(tls, csPtr)
}

//----------------------------------------------------------------------
//
// StackSetBlockMode --
//
//	This function sets the blocking mode for a channel, iterating through
//	each channel in a stack and updates the state flags.
//
// Results:
//	0 if OK, result code from failed blockModeProc otherwise.
//
// Side effects:
//	Modifies the blocking mode of the channel and possibly generates an
//	error.
//
//----------------------------------------------------------------------

func sStackSetBlockMode(tls *libc.TLS, chanPtr uintptr, mode int32) int32 { /* tclIO.c:10155:1: */
	var result int32 = 0
	var blockModeProc uintptr
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	// Start at the top of the channel stack
	// TODO: Examine what can go wrong when blockModeProc calls
	// disturb the stacking state of the channel.

	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr
	for chanPtr != uintptr(0) {
		blockModeProc = XTcl_ChannelBlockModeProc(tls, (*Channel)(unsafe.Pointer(chanPtr)).FtypePtr)
		if blockModeProc != uintptr(0) {
			result = (*struct {
				f func(*libc.TLS, ClientData, int32) int32
			})(unsafe.Pointer(&struct{ uintptr }{blockModeProc})).f(tls, (*Channel)(unsafe.Pointer(chanPtr)).FinstanceData, mode)
			if result != 0 {
				XTcl_SetErrno(tls, result)
				return result
			}
		}
		chanPtr = (*Channel)(unsafe.Pointer(chanPtr)).FdownChanPtr
	}
	return 0
}

//----------------------------------------------------------------------
//
// SetBlockMode --
//
//	This function sets the blocking mode for a channel and updates the
//	state flags.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Modifies the blocking mode of the channel and possibly generates an
//	error.
//
//----------------------------------------------------------------------

func sSetBlockMode(tls *libc.TLS, interp uintptr, chanPtr uintptr, mode int32) int32 { /* tclIO.c:10204:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var result int32 = 0
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	// State info for channel

	result = sStackSetBlockMode(tls, chanPtr, mode)
	if result != 0 {
		if interp != uintptr(0) {
			// TIP #219.
			// Move error messages put by the driver into the bypass area and
			// put them into the regular interpreter result. Fall back to the
			// regular message if nothing was found in the bypass.
			//
			// Note that we cannot have a message in the interpreter bypass
			// area, StackSetBlockMode is restricted to the channel bypass.
			// We still need the interp as the destination of the move.

			if !(XTclChanCaughtErrorBypass(tls, interp, chanPtr) != 0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+34177,
					libc.VaList(bp, XTcl_PosixError(tls, interp))))
			}
		} else {
			// TIP #219.
			// If we have no interpreter to put a bypass message into we have
			// to clear it, to prevent its propagation and use in other places
			// unrelated to the actual occurence of the problem.

			XTcl_SetChannelError(tls, chanPtr, uintptr(0))
		}
		return TCL_ERROR
	}
	if mode == TCL_MODE_BLOCKING {
		*(*int32)(unsafe.Pointer(statePtr + 8)) &= libc.CplInt32(int32(1)<<3 | int32(1)<<7)
	} else {
		*(*int32)(unsafe.Pointer(statePtr + 8)) |= int32(1) << 3
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelNames --
//
//	Return the names of all open channels in the interp.
//
// Results:
//	TCL_OK or TCL_ERROR.
//
// Side effects:
//	Interp result modified with list of channel names.
//
//----------------------------------------------------------------------

func XTcl_GetChannelNames(tls *libc.TLS, interp uintptr) int32 { /* tclIO.c:10270:1: */
	return XTcl_GetChannelNamesEx(tls, interp, uintptr(0))
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelNamesEx --
//
//	Return the names of open channels in the interp filtered filtered
//	through a pattern. If pattern is NULL, it returns all the open
//	channels.
//
// Results:
//	TCL_OK or TCL_ERROR.
//
// Side effects:
//	Interp result modified with list of channel names.
//
//----------------------------------------------------------------------

func XTcl_GetChannelNamesEx(tls *libc.TLS, interp uintptr, pattern uintptr) int32 { /* tclIO.c:10295:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var tsdPtr uintptr
	var statePtr uintptr
	var name uintptr      // Name for channel
	var resultPtr uintptr // Pointer to result object
	var hTblPtr uintptr   // Hash table of channels.
	var hPtr uintptr      // Search variable.
	// var hSearch Tcl_HashSearch at bp, 24

	var cachePtr uintptr
	var cachePtr1 uintptr
	tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{}))) // Search variable.

	if !(interp == uintptr(0)) {
		goto __1
	}
	return TCL_OK
__1:
	;

	// Get the channel table that stores the channels registered for this
	// interpreter.

	hTblPtr = sGetChannelTable(tls, interp)
__2:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __5
	}
	resultPtr = XTclThreadAllocObj(tls)
	goto __6
__5:
	resultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__6:
	;
	goto __3
__3:
	if 0 != 0 {
		goto __2
	}
	goto __4
__4:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = uintptr(0)

	if !(pattern != uintptr(0) && libc.Xstrpbrk(tls, pattern, ts+13556) == uintptr(0) &&
		!(int32(*(*int8)(unsafe.Pointer(pattern))) == 's' && int32(*(*int8)(unsafe.Pointer(pattern + 1))) == 't' &&
			int32(*(*int8)(unsafe.Pointer(pattern + 2))) == 'd')) {
		goto __7
	}
	if !((*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hTblPtr)).FfindProc})).f(tls, hTblPtr, pattern) != uintptr(0) &&
		XTcl_ListObjAppendElement(tls, interp, resultPtr,
			XTcl_NewStringObj(tls, pattern, -1)) != TCL_OK) {
		goto __8
	}
	goto error
__8:
	;
	goto done
__7:
	;

	hPtr = XTcl_FirstHashEntry(tls, hTblPtr, bp)
__9:
	if !(hPtr != uintptr(0)) {
		goto __11
	}
	statePtr = (*Channel)(unsafe.Pointer((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)).Fstate

	if !((*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel) {
		goto __12
	}
	name = ts + 32105 /* "stdin" */
	goto __13
__12:
	if !((*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel) {
		goto __14
	}
	name = ts + 32111 /* "stdout" */
	goto __15
__14:
	if !((*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel) {
		goto __16
	}
	name = ts + 32118 /* "stderr" */
	goto __17
__16:
	// This is also stored in Tcl_GetHashKey(hTblPtr, hPtr), but it's
	// simpler to just grab the name from the statePtr.

	name = (*ChannelState)(unsafe.Pointer(statePtr)).FchannelName
__17:
	;
__15:
	;
__13:
	;

	if !((pattern == uintptr(0) || XTcl_StringMatch(tls, name, pattern) != 0) && XTcl_ListObjAppendElement(tls, interp, resultPtr,
		XTcl_NewStringObj(tls, name, -1)) != TCL_OK) {
		goto __18
	}
error:
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount, 1) > 1) {
		goto __19
	}
	goto __20
__19:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __21
	}

	if !((*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != XtclEmptyStringRep) {
		goto __23
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes)
__23:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = -1
__24:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __27
	}
	XTclThreadFreeObj(tls, resultPtr)
	goto __28
__27:
	*(*uintptr)(unsafe.Pointer(resultPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = resultPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__28:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
	goto __22
__21:
	XTclFreeObj(tls, resultPtr)
__22:
	;
__20:
	;

	return TCL_ERROR
__18:
	;
	goto __10
__10:
	hPtr = XTcl_NextHashEntry(tls, bp)
	goto __9
	goto __11
__11:
	;

done:
	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_IsChannelRegistered --
//
//	Checks whether the channel is associated with the interp. See also
//	Tcl_RegisterChannel and Tcl_UnregisterChannel.
//
// Results:
//	0 if the channel is not registered in the interpreter, 1 else.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_IsChannelRegistered(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel) int32 { /* tclIO.c:10380:1: */
	var hTblPtr uintptr  // Hash table of channels.
	var hPtr uintptr     // Search variable.
	var chanPtr uintptr  // The real IO channel.
	var statePtr uintptr // State of the real channel.

	// Always check bottom-most channel in the stack. This is the one that
	// gets registered.

	chanPtr = (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chan1)).Fstate)).FbottomChanPtr
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate

	hTblPtr = XTcl_GetAssocData(tls, interp, ts+31947, uintptr(0))
	if hTblPtr == uintptr(0) {
		return 0
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hTblPtr)).FfindProc})).f(tls, hTblPtr, (*ChannelState)(unsafe.Pointer(statePtr)).FchannelName)
	if hPtr == uintptr(0) {
		return 0
	}
	if (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData != chanPtr {
		return 0
	}

	return 1
}

//----------------------------------------------------------------------
//
// Tcl_IsChannelShared --
//
//	Checks whether the channel is shared by multiple interpreters.
//
// Results:
//	A boolean value (0 = Not shared, 1 = Shared).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_IsChannelShared(tls *libc.TLS, chan1 Tcl_Channel) int32 { /* tclIO.c:10429:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate
	// State of real channel structure.

	return func() int32 {
		if (*ChannelState)(unsafe.Pointer(statePtr)).FrefCount > 1 {
			return 1
		}
		return 0
	}()
}

//----------------------------------------------------------------------
//
// Tcl_IsChannelExisting --
//
//	Checks whether a channel of the given name exists in the
//	(thread)-global list of all channels. See Tcl_GetChannelNamesEx for
//	function exposed at the Tcl level.
//
// Results:
//	A boolean value (0 = Does not exist, 1 = Does exist).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_IsChannelExisting(tls *libc.TLS, chanName uintptr) int32 { /* tclIO.c:10457:1: */
	var statePtr uintptr
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey2)), int32(unsafe.Sizeof(ThreadSpecificData2{})))
	var name uintptr
	var chanNameLen int32

	chanNameLen = int32(libc.Xstrlen(tls, chanName))
	for statePtr = (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FfirstCSPtr; statePtr != uintptr(0); statePtr = (*ChannelState)(unsafe.Pointer(statePtr)).FnextCSPtr {
		if (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdinChannel {
			name = ts + 32105 /* "stdin" */
		} else if (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstdoutChannel {
			name = ts + 32111 /* "stdout" */
		} else if (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr == (*ThreadSpecificData2)(unsafe.Pointer(tsdPtr)).FstderrChannel {
			name = ts + 32118 /* "stderr" */
		} else {
			name = (*ChannelState)(unsafe.Pointer(statePtr)).FchannelName
		}

		if int32(*(*int8)(unsafe.Pointer(chanName))) == int32(*(*int8)(unsafe.Pointer(name))) && libc.Xmemcmp(tls, name, chanName, uint64(chanNameLen+1)) == 0 {
			return 1
		}
	}

	return 0
}

//----------------------------------------------------------------------
//
// Tcl_ChannelName --
//
//	Return the name of the channel type.
//
// Results:
//	A pointer the name of the channel type.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelName(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10503:12: */
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FtypeName
}

//----------------------------------------------------------------------
//
// Tcl_ChannelVersion --
//
//	Return the of version of the channel type.
//
// Results:
//	One of the TCL_CHANNEL_VERSION_* constants from tcl.h
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelVersion(tls *libc.TLS, chanTypePtr uintptr) Tcl_ChannelTypeVersion { /* tclIO.c:10527:1: */
	if (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).Fversion < uintptr(0x2) ||
		(*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).Fversion > uintptr(0x5) {
		// In <v2 channel versions, the version field is occupied by the
		// Tcl_DriverBlockModeProc
		return uintptr(0x1)
	}
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).Fversion
}

//
//----------------------------------------------------------------------
//
// Tcl_ChannelBlockModeProc --
//
//	Return the Tcl_DriverBlockModeProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelBlockModeProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10557:25: */
	if XTcl_ChannelVersion(tls, chanTypePtr) < uintptr(0x2) {
		// The v1 structure had the blockModeProc in a different place.
		return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).Fversion
	}

	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FblockModeProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelCloseProc --
//
//	Return the Tcl_DriverCloseProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelCloseProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10588:21: */
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FcloseProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelClose2Proc --
//
//	Return the Tcl_DriverClose2Proc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelClose2Proc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10612:22: */
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).Fclose2Proc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelInputProc --
//
//	Return the Tcl_DriverInputProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelInputProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10636:21: */
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FinputProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelOutputProc --
//
//	Return the Tcl_DriverOutputProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelOutputProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10660:22: */
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FoutputProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelSeekProc --
//
//	Return the Tcl_DriverSeekProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelSeekProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10684:20: */
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FseekProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelSetOptionProc --
//
//	Return the Tcl_DriverSetOptionProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelSetOptionProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10708:25: */
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FsetOptionProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelGetOptionProc --
//
//	Return the Tcl_DriverGetOptionProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelGetOptionProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10732:25: */
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FgetOptionProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelWatchProc --
//
//	Return the Tcl_DriverWatchProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelWatchProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10756:21: */
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FwatchProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelGetHandleProc --
//
//	Return the Tcl_DriverGetHandleProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelGetHandleProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10780:25: */
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FgetHandleProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelFlushProc --
//
//	Return the Tcl_DriverFlushProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelFlushProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10804:21: */
	if XTcl_ChannelVersion(tls, chanTypePtr) < uintptr(0x2) {
		return uintptr(0)
	}
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FflushProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelHandlerProc --
//
//	Return the Tcl_DriverHandlerProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelHandlerProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10831:23: */
	if XTcl_ChannelVersion(tls, chanTypePtr) < uintptr(0x2) {
		return uintptr(0)
	}
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FhandlerProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelWideSeekProc --
//
//	Return the Tcl_DriverWideSeekProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelWideSeekProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10858:24: */
	if XTcl_ChannelVersion(tls, chanTypePtr) < uintptr(0x3) {
		return uintptr(0)
	}
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FwideSeekProc
}

//----------------------------------------------------------------------
//
// Tcl_ChannelThreadActionProc --
//
//	TIP #218, Channel Thread Actions. Return the
//	Tcl_DriverThreadActionProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelThreadActionProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:10886:28: */
	if XTcl_ChannelVersion(tls, chanTypePtr) < uintptr(0x4) {
		return uintptr(0)
	}
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FthreadActionProc
}

//----------------------------------------------------------------------
//
// Tcl_SetChannelErrorInterp --
//
//	TIP #219, Tcl Channel Reflection API.
//	Store an error message for the I/O system.
//
// Results:
//	None.
//
// Side effects:
//	Discards a previously stored message.
//
//----------------------------------------------------------------------

func XTcl_SetChannelErrorInterp(tls *libc.TLS, interp uintptr, msg uintptr) { /* tclIO.c:10915:1: */
	var iPtr uintptr = interp

	if (*Interp)(unsafe.Pointer(iPtr)).FchanMsg != uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FchanMsg)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FchanMsg)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FchanMsg)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FchanMsg)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FchanMsg)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FchanMsg)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FchanMsg)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FchanMsg)
					} else {
						*(*uintptr)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FchanMsg + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*Interp)(unsafe.Pointer(iPtr)).FchanMsg
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FchanMsg)
			}
		}

		(*Interp)(unsafe.Pointer(iPtr)).FchanMsg = uintptr(0)
	}

	if msg != uintptr(0) {
		(*Interp)(unsafe.Pointer(iPtr)).FchanMsg = sFixLevelCode(tls, msg)
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FchanMsg)).FrefCount++
	}
	return
}

//----------------------------------------------------------------------
//
// Tcl_SetChannelError --
//
//	TIP #219, Tcl Channel Reflection API.
//	Store an error message for the I/O system.
//
// Results:
//	None.
//
// Side effects:
//	Discards a previously stored message.
//
//----------------------------------------------------------------------

func XTcl_SetChannelError(tls *libc.TLS, chan1 Tcl_Channel, msg uintptr) { /* tclIO.c:10951:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate

	if (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg != uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
					} else {
						*(*uintptr)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)
			}
		}

		(*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg = uintptr(0)
	}

	if msg != uintptr(0) {
		(*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg = sFixLevelCode(tls, msg)
		(*Tcl_Obj)(unsafe.Pointer((*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg)).FrefCount++
	}
	return
}

//----------------------------------------------------------------------
//
// FixLevelCode --
//
//	TIP #219, Tcl Channel Reflection API.
//	Scans an error message for bad -code / -level directives. Returns a
//	modified copy with such directives corrected, and the input if it had
//	no problems.
//
// Results:
//	A Tcl_Obj*
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFixLevelCode(tls *libc.TLS, msg uintptr) uintptr { /* tclIO.c:10988:16: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var explicitResult int32
	var numOptions int32
	// var lc int32 at bp, 4

	var lcn int32
	// var lv uintptr at bp+8, 8

	var lvn uintptr
	var res int32
	var i int32
	var j int32
	// var val int32 at bp+16, 4

	var lignore int32
	var cignore int32
	var newlevel int32 = -1
	var newcode int32 = -1

	// ASSERT msg != NULL

	// Process the caught message.
	//
	// Syntax = (option value)... ?message?
	//
	// Bad message syntax causes a panic, because the other side uses
	// Tcl_GetReturnOptions and list construction functions to marshall the
	// information. Hence an error means that we've got serious breakage.

	res = XTcl_ListObjGetElements(tls, uintptr(0), msg, bp, bp+8)
	if res != TCL_OK {
		XTcl_Panic(tls, ts+34209, 0)
	}

	explicitResult = libc.Bool32(1 == *(*int32)(unsafe.Pointer(bp))%2)
	numOptions = *(*int32)(unsafe.Pointer(bp)) - explicitResult

	// No options, nothing to do.

	if numOptions == 0 {
		return msg
	}

	// Check for -code x, x != 1|error, and -level x, x != 0

	for i = 0; i < numOptions; i = i + 2 {
		if 0 == libc.Xstrcmp(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))
		}(), ts+27354) {

			res = func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
					return func() int32 {
						*(*int32)(unsafe.Pointer(bp + 16)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)) + 32)))
						return TCL_OK
					}()
				}
				return XTcl_GetIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)), bp+16)
			}()
			if res == TCL_OK && *(*int32)(unsafe.Pointer(bp + 16)) != 1 || res != TCL_OK && 0 != libc.Xstrcmp(tls, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)))
			}(), ts+5136) {
				newcode = 1
			}
		} else if 0 == libc.Xstrcmp(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))
		}(), ts+27316) {

			res = func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
					return func() int32 {
						*(*int32)(unsafe.Pointer(bp + 16)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)) + 32)))
						return TCL_OK
					}()
				}
				return XTcl_GetIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+1)*8)), bp+16)
			}()
			if res != TCL_OK || *(*int32)(unsafe.Pointer(bp + 16)) != 0 {
				newlevel = 0
			}
		}
	}

	// -code, -level are either not present or ok. Nothing to do.

	if newlevel < 0 && newcode < 0 {
		return msg
	}

	lcn = numOptions
	if explicitResult != 0 {
		lcn++
	}
	if newlevel >= 0 {
		lcn = lcn + 2
	}
	if newcode >= 0 {
		lcn = lcn + 2
	}

	lvn = XTcl_Alloc(tls, uint32(uint64(lcn)*uint64(unsafe.Sizeof(uintptr(0)))))

	// New level/code information is spliced into the first occurence of
	// -level, -code, further occurences are ignored. The options cannot be
	// not present, we would not come here. Options which are ok are simply
	// copied over.

	lignore = libc.AssignInt32(&cignore, 0)
	i = 0
	j = 0
	for ; i < numOptions; i = i + 2 {
		if 0 == libc.Xstrcmp(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))
		}(), ts+27316) {
			if newlevel >= 0 {
				*(*uintptr)(unsafe.Pointer(lvn + uintptr(libc.PostIncInt32(&j, 1))*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* lv */)) + uintptr(i)*8))
				*(*uintptr)(unsafe.Pointer(lvn + uintptr(libc.PostIncInt32(&j, 1))*8)) = XTcl_NewIntObj(tls, newlevel)
				newlevel = -1
				lignore = 1
				continue
			} else if lignore != 0 {
				continue
			}
		} else if 0 == libc.Xstrcmp(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))
		}(), ts+27354) {
			if newcode >= 0 {
				*(*uintptr)(unsafe.Pointer(lvn + uintptr(libc.PostIncInt32(&j, 1))*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* lv */)) + uintptr(i)*8))
				*(*uintptr)(unsafe.Pointer(lvn + uintptr(libc.PostIncInt32(&j, 1))*8)) = XTcl_NewIntObj(tls, newcode)
				newcode = -1
				cignore = 1
				continue
			} else if cignore != 0 {
				continue
			}
		}

		// Keep everything else, possibly copied down.

		*(*uintptr)(unsafe.Pointer(lvn + uintptr(libc.PostIncInt32(&j, 1))*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* lv */)) + uintptr(i)*8))
		*(*uintptr)(unsafe.Pointer(lvn + uintptr(libc.PostIncInt32(&j, 1))*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* lv */)) + uintptr(i+1)*8))
	}
	if newlevel >= 0 {
		XTcl_Panic(tls, ts+34252, 0)
	}
	if newcode >= 0 {
		XTcl_Panic(tls, ts+34289, 0)
	}

	if explicitResult != 0 {
		*(*uintptr)(unsafe.Pointer(lvn + uintptr(libc.PostIncInt32(&j, 1))*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* lv */)) + uintptr(i)*8))
	}

	msg = XTcl_NewListObj(tls, j, lvn)

	XTclpFree(tls, lvn)
	return msg
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelErrorInterp --
//
//	TIP #219, Tcl Channel Reflection API.
//	Return the message stored by the channel driver.
//
// Results:
//	Tcl error message object.
//
// Side effects:
//	Resets the stored data to NULL.
//
//----------------------------------------------------------------------

func XTcl_GetChannelErrorInterp(tls *libc.TLS, interp uintptr, msg uintptr) { /* tclIO.c:11146:1: */
	var iPtr uintptr = interp

	*(*uintptr)(unsafe.Pointer(msg)) = (*Interp)(unsafe.Pointer(iPtr)).FchanMsg
	(*Interp)(unsafe.Pointer(iPtr)).FchanMsg = uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_GetChannelError --
//
//	TIP #219, Tcl Channel Reflection API.
//	Return the message stored by the channel driver.
//
// Results:
//	Tcl error message object.
//
// Side effects:
//	Resets the stored data to NULL.
//
//----------------------------------------------------------------------

func XTcl_GetChannelError(tls *libc.TLS, chan1 Tcl_Channel, msg uintptr) { /* tclIO.c:11174:1: */
	var statePtr uintptr = (*Channel)(unsafe.Pointer(chan1)).Fstate

	*(*uintptr)(unsafe.Pointer(msg)) = (*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg
	(*ChannelState)(unsafe.Pointer(statePtr)).FchanMsg = uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_ChannelTruncateProc --
//
//	TIP #208 (subsection relating to truncation, based on TIP #206).
//	Return the Tcl_DriverTruncateProc of the channel type.
//
// Results:
//	A pointer to the proc.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ChannelTruncateProc(tls *libc.TLS, chanTypePtr uintptr) uintptr { /* tclIO.c:11201:24: */
	if XTcl_ChannelVersion(tls, chanTypePtr) < uintptr(0x5) {
		return uintptr(0)
	}
	return (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FtruncateProc
}

//----------------------------------------------------------------------
//
// DupChannelInternalRep --
//
//	Initialize the internal representation of a new Tcl_Obj to a copy of
//	the internal representation of an existing string object.
//
// Results:
//	None.
//
// Side effects:
//	copyPtr's internal rep is set to a copy of srcPtr's internal
//	representation.
//
//----------------------------------------------------------------------

func sDupChannelInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclIO.c:11231:1: */
	var resPtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))

	(*ResolvedChanName)(unsafe.Pointer(resPtr)).FrefCount++
	*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = resPtr
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = (*Tcl_Obj)(unsafe.Pointer(srcPtr)).FtypePtr
}

//----------------------------------------------------------------------
//
// FreeChannelInternalRep --
//
//	Release statePtr storage.
//
// Results:
//	None.
//
// Side effects:
//	May cause state to be freed.
//
//----------------------------------------------------------------------

func sFreeChannelInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclIO.c:11261:1: */
	var resPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	if libc.PreDecInt32(&(*ResolvedChanName)(unsafe.Pointer(resPtr)).FrefCount, 1) != 0 {
		return
	}
	XTcl_Release(tls, (*ResolvedChanName)(unsafe.Pointer(resPtr)).FstatePtr)
	XTclpFree(tls, resPtr)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// indent-tabs-mode: nil
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Callback structure for accept callback in a TCP server.

type AcceptCallback1 = struct {
	Fscript uintptr
	Finterp uintptr
} /* tclIOCmd.c:18:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Callback structure for accept callback in a TCP server.

type AcceptCallback = AcceptCallback1 /* tclIOCmd.c:21:3 */

// Thread local storage used to maintain a per-thread stdout channel obj.
// It must be per-thread because of std channel limitations.

type ThreadSpecificData3 = struct {
	Finitialized  int32
	F__ccgo_pad1  [4]byte
	FstdoutObjPtr uintptr
} /* tclIOCmd.c:31:3 */

var dataKey3 Tcl_ThreadDataKey /* tclIOCmd.c:33:26: */

//----------------------------------------------------------------------
//
// FinalizeIOCmdTSD --
//
//	Release the storage associated with the per-thread cache.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFinalizeIOCmdTSD(tls *libc.TLS, clientData ClientData) { /* tclIOCmd.c:74:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey3)), int32(unsafe.Sizeof(ThreadSpecificData3{})))

	if (*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr = uintptr(0)
	}
	(*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).Finitialized = 0
}

//----------------------------------------------------------------------
//
// Tcl_PutsObjCmd --
//
//	This function is invoked to process the "puts" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Produces output on a channel.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_PutsObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:105:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	// var chan1 Tcl_Channel at bp+24, 8
	// The channel to puts on.
	var string uintptr     // String to write.
	var chanObjPtr uintptr // channel object.
	var newline int32      // Add a newline at end?
	var result int32       // Result of puts operation.
	// var mode int32 at bp+32, 4
	// Mode in which channel is opened.
	var tsdPtr uintptr
	var cachePtr uintptr
	chanObjPtr = uintptr(0)

	switch objc {
	case 2:
		goto __2

	case 3:
		goto __3

	case 4:
		goto __4
		// Fall through
	default:
		goto __5
	}
	goto __1
__2: // [puts $x]
	string = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	newline = 1
	goto __1

__3: // [puts -nonewline $x] or [puts $chan $x]
	if !(libc.Xstrcmp(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}(), ts+34325) == 0) {
		goto __6
	}
	newline = 0
	goto __7
__6:
	newline = 1
	chanObjPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
__7:
	;
	string = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	goto __1

__4: // [puts -nonewline $chan $x] or
	// [puts $chan $x nonewline]
	newline = 0
	if !(libc.Xstrcmp(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}(), ts+34325) == 0) {
		goto __8
	}
	chanObjPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	string = *(*uintptr)(unsafe.Pointer(objv + 3*8))
	goto __1
	goto __9
__8:
	if !(libc.Xstrcmp(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}(), ts+34336) == 0) {
		goto __10
	}
	// The code below provides backwards compatibility with an old
	// form of the command that is no longer recommended or
	// documented. See also [Bug #3151675]. Will be removed in Tcl 9,
	// maybe even earlier.

	chanObjPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	string = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	goto __1
__10:
	;
__9:
	;
	// Fall through
__5: // [puts] or
	// [puts some bad number of arguments...]
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34346)
	return TCL_ERROR
__1:
	;

	if !(chanObjPtr == uintptr(0)) {
		goto __11
	}
	tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey3)), int32(unsafe.Sizeof(ThreadSpecificData3{})))

	if !!((*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).Finitialized != 0) {
		goto __12
	}
	(*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).Finitialized = 1
__13:
	;
__16:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __19
	}
	(*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr = XTclThreadAllocObj(tls)
	goto __20
__19:
	(*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__20:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)) == 0) {
		goto __21
	}
	(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr)).Flength = 0
	goto __22
__21:
	(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr)).Fbytes, ts+32111, uint64(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr)).Fbytes + 6)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr)).Flength = int32(uint64(unsafe.Sizeof([7]int8{})) - uint64(1))
__22:
	;
	(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr)).FtypePtr = uintptr(0)

	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
	(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr)).FrefCount++
	XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFinalizeIOCmdTSD})), uintptr(0))
__12:
	;
	chanObjPtr = (*ThreadSpecificData3)(unsafe.Pointer(tsdPtr)).FstdoutObjPtr
__11:
	;
	if !(XTclGetChannelFromObj(tls, interp, chanObjPtr, bp+24, bp+32, 0) != TCL_OK) {
		goto __23
	}
	return TCL_ERROR
__23:
	;
	if !!(*(*int32)(unsafe.Pointer(bp + 32))&(int32(1)<<2) != 0) {
		goto __24
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+34378,
		libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes
			}
			return XTcl_GetString(tls, chanObjPtr)
		}())))
	return TCL_ERROR
__24:
	;

	XTclChannelPreserve(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24 /* chan1 */)))
	result = XTcl_WriteObj(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24 /* chan1 */)), string)
	if !(result < 0) {
		goto __25
	}
	goto error
__25:
	;
	if !(newline != 0) {
		goto __26
	}
	result = XTcl_WriteChars(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24 /* chan1 */)), ts+350, 1)
	if !(result < 0) {
		goto __27
	}
	goto error
__27:
	;
__26:
	;
	XTclChannelRelease(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24 /* chan1 */)))
	return TCL_OK

	// TIP #219.
	// Capture error messages put by the driver into the bypass area and put
	// them into the regular interpreter result. Fall back to the regular
	// message if nothing was found in the bypass.

error:
	if !!(XTclChanCaughtErrorBypass(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp + 24))) != 0) {
		goto __28
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+34417,
		libc.VaList(bp+8, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes
			}
			return XTcl_GetString(tls, chanObjPtr)
		}(), XTcl_PosixError(tls, interp))))
__28:
	;
	XTclChannelRelease(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24 /* chan1 */)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_FlushObjCmd --
//
//	This function is called to process the Tcl "flush" command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May cause output to appear on the specified channel.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_FlushObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:233:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var chanObjPtr uintptr
	// var chan1 Tcl_Channel at bp+24, 8
	// The channel to flush on.
	// var mode int32 at bp+32, 4

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34440)
		return TCL_ERROR
	}
	chanObjPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if XTclGetChannelFromObj(tls, interp, chanObjPtr, bp+24, bp+32, 0) != TCL_OK {
		return TCL_ERROR
	}
	if !(*(*int32)(unsafe.Pointer(bp + 32))&(int32(1)<<2) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+34378,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes
				}
				return XTcl_GetString(tls, chanObjPtr)
			}())))
		return TCL_ERROR
	}

	XTclChannelPreserve(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24 /* chan1 */)))
	if XTcl_Flush(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24))) != TCL_OK {
		// TIP #219.
		// Capture error messages put by the driver into the bypass area and
		// put them into the regular interpreter result. Fall back to the
		// regular message if nothing was found in the bypass.

		if !(XTclChanCaughtErrorBypass(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp + 24))) != 0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+34450,
				libc.VaList(bp+8, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes
					}
					return XTcl_GetString(tls, chanObjPtr)
				}(), XTcl_PosixError(tls, interp))))
		}
		XTclChannelRelease(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24 /* chan1 */)))
		return TCL_ERROR
	}
	XTclChannelRelease(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24 /* chan1 */)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetsObjCmd --
//
//	This function is called to process the Tcl "gets" command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May consume input from channel.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_GetsObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:298:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	// var chan1 Tcl_Channel at bp+24, 8
	// The channel to read from.
	var lineLen int32 // Length of line just read.
	// var mode int32 at bp+32, 4
	// Mode in which channel is opened.
	var linePtr uintptr
	var chanObjPtr uintptr
	var code int32
	var _objPtr uintptr
	code = TCL_OK

	if !(objc != 2 && objc != 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34474)
	return TCL_ERROR
__1:
	;
	chanObjPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if !(XTclGetChannelFromObj(tls, interp, chanObjPtr, bp+24, bp+32, 0) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;
	if !!(*(*int32)(unsafe.Pointer(bp + 32))&(int32(1)<<1) != 0) {
		goto __3
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+34494,
		libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes
			}
			return XTcl_GetString(tls, chanObjPtr)
		}())))
	return TCL_ERROR
__3:
	;

	XTclChannelPreserve(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24 /* chan1 */)))
	linePtr = XTcl_NewObj(tls)
	lineLen = XTcl_GetsObj(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24 /* chan1 */)), linePtr)
	if !(lineLen < 0) {
		goto __4
	}
	if !(!(XTcl_Eof(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24))) != 0) && !(XTcl_InputBlocked(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24))) != 0)) {
		goto __5
	}
__6:
	_objPtr = linePtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __9
	}
	XTclFreeObj(tls, _objPtr)
__9:
	;
	goto __7
__7:
	if 0 != 0 {
		goto __6
	}
	goto __8
__8:
	;

	// TIP #219.
	// Capture error messages put by the driver into the bypass area
	// and put them into the regular interpreter result. Fall back to
	// the regular message if nothing was found in the bypass.

	if !!(XTclChanCaughtErrorBypass(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp + 24))) != 0) {
		goto __10
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+34533,
		libc.VaList(bp+8, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes
			}
			return XTcl_GetString(tls, chanObjPtr)
		}(), XTcl_PosixError(tls, interp))))
__10:
	;
	code = TCL_ERROR
	goto done
__5:
	;
	lineLen = -1
__4:
	;
	if !(objc == 3) {
		goto __11
	}
	if !(XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(0), linePtr,
		TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __13
	}
	code = TCL_ERROR
	goto done
__13:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, lineLen))
	goto __12
__11:
	XTcl_SetObjResult(tls, interp, linePtr)
__12:
	;
done:
	XTclChannelRelease(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 24 /* chan1 */)))
	return code
}

//----------------------------------------------------------------------
//
// Tcl_ReadObjCmd --
//
//	This function is invoked to process the Tcl "read" command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May consume input from channel.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ReadObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:383:1: */
	bp := tls.Alloc(84)
	defer tls.Free(84)

	// var chan1 Tcl_Channel at bp+64, 8
	// The channel to read from.
	var newline int32
	var i int32 // Discard newline at end?
	// var toRead int32 at bp+76, 4
	// How many bytes to read?
	var charactersRead int32 // How many characters were read?
	// var mode int32 at bp+72, 4
	// Mode in which channel is opened.
	var resultPtr uintptr
	var chanObjPtr uintptr
	var iPtr uintptr
	var _objPtr uintptr
	var result uintptr
	// var length int32 at bp+80, 4

	var _objPtr1 uintptr

	if !(objc != 2 && objc != 3) {
		goto __1
	}

argerror:
	iPtr = interp
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34556)

	// Do not append directly; that makes ensembles using this command as
	// a subcommand produce the wrong message.

	*(*int32)(unsafe.Pointer(iPtr + 424)) |= INTERP_ALTERNATE_WRONG_ARGS
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34577)
	return TCL_ERROR
__1:
	;

	i = 1
	newline = 0
	if !(libc.Xstrcmp(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}(), ts+34325) == 0) {
		goto __2
	}
	newline = 1
	i++
__2:
	;

	if !(i == objc) {
		goto __3
	}
	goto argerror
__3:
	;

	chanObjPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	if !(XTclGetChannelFromObj(tls, interp, chanObjPtr, bp+64, bp+72, 0) != TCL_OK) {
		goto __4
	}
	return TCL_ERROR
__4:
	;
	if !!(*(*int32)(unsafe.Pointer(bp + 72))&(int32(1)<<1) != 0) {
		goto __5
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+34494,
		libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes
			}
			return XTcl_GetString(tls, chanObjPtr)
		}())))
	return TCL_ERROR
__5:
	;
	i++ // Consumed channel name.

	// Compute how many bytes to read.

	*(*int32)(unsafe.Pointer(bp + 76 /* toRead */)) = -1
	if !(i < objc) {
		goto __6
	}
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 76)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+76)
	}() != TCL_OK ||
		*(*int32)(unsafe.Pointer(bp + 76)) < 0) {
		goto __7
	}
	// The code below provides backwards compatibility with an old
	// form of the command that is no longer recommended or
	// documented. See also [Bug #3151675]. Will be removed in Tcl 9,
	// maybe even earlier.

	if !(libc.Xstrcmp(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}(), ts+34336) != 0) {
		goto __8
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+34600,
		libc.VaList(bp+8, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+6915, ts+34643, uintptr(0)))
	return TCL_ERROR
__8:
	;
	newline = 1
__7:
	;
__6:
	;

	resultPtr = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
	XTclChannelPreserve(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 64 /* chan1 */)))
	charactersRead = XTcl_ReadChars(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 64 /* chan1 */)), resultPtr, *(*int32)(unsafe.Pointer(bp + 76 /* toRead */)), 0)
	if !(charactersRead < 0) {
		goto __9
	}
	// TIP #219.
	// Capture error messages put by the driver into the bypass area and
	// put them into the regular interpreter result. Fall back to the
	// regular message if nothing was found in the bypass.

	if !!(XTclChanCaughtErrorBypass(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp + 64))) != 0) {
		goto __10
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+34533,
		libc.VaList(bp+48, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(chanObjPtr)).Fbytes
			}
			return XTcl_GetString(tls, chanObjPtr)
		}(), XTcl_PosixError(tls, interp))))
__10:
	;
	XTclChannelRelease(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 64 /* chan1 */)))
__11:
	_objPtr = resultPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __14
	}
	XTclFreeObj(tls, _objPtr)
__14:
	;
	goto __12
__12:
	if 0 != 0 {
		goto __11
	}
	goto __13
__13:
	;
	return TCL_ERROR
__9:
	;

	// If requested, remove the last newline in the channel if at EOF.

	if !(charactersRead > 0 && newline != 0) {
		goto __15
	}

	result = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 80)) = (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, resultPtr, bp+80)
	}()
	if !(int32(*(*int8)(unsafe.Pointer(result + uintptr(*(*int32)(unsafe.Pointer(bp + 80))-1)))) == '\n') {
		goto __16
	}
	XTcl_SetObjLength(tls, resultPtr, *(*int32)(unsafe.Pointer(bp + 80))-1)
__16:
	;
__15:
	;
	XTcl_SetObjResult(tls, interp, resultPtr)
	XTclChannelRelease(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 64 /* chan1 */)))
__17:
	_objPtr1 = resultPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __20
	}
	XTclFreeObj(tls, _objPtr1)
__20:
	;
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_SeekObjCmd --
//
//	This function is invoked to process the Tcl "seek" command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Moves the position of the access point on the specified channel.  May
//	flush queued output.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_SeekObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:527:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	// var chan1 Tcl_Channel at bp+16, 8
	// The channel to tell on.
	// var offset Tcl_WideInt at bp+24, 8
	// Where to seek?
	var mode int32         // How to seek?
	var result Tcl_WideInt // Of calling Tcl_Seek.
	// var optionIndex int32 at bp+32, 4

	if objc != 3 && objc != 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34650)
		return TCL_ERROR
	}
	if XTclGetChannelFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16, uintptr(0), 0) != TCL_OK {
		return TCL_ERROR
	}
	if XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+24) != TCL_OK {
		return TCL_ERROR
	}
	mode = SEEK_SET
	if objc == 4 {
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), uintptr(unsafe.Pointer(&originOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+34676, 0, bp+32) != TCL_OK {
			return TCL_ERROR
		}
		mode = modeArray[*(*int32)(unsafe.Pointer(bp + 32 /* optionIndex */))]
	}

	XTclChannelPreserve(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 16 /* chan1 */)))
	result = XTcl_Seek(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 16 /* chan1 */)), *(*Tcl_WideInt)(unsafe.Pointer(bp + 24 /* offset */)), mode)
	if result == int64(-1) {
		// TIP #219.
		// Capture error messages put by the driver into the bypass area and
		// put them into the regular interpreter result. Fall back to the
		// regular message if nothing was found in the bypass.

		if !(XTclChanCaughtErrorBypass(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp + 16))) != 0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+34683,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
				}(), XTcl_PosixError(tls, interp))))
		}
		XTclChannelRelease(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 16 /* chan1 */)))
		return TCL_ERROR
	}
	XTclChannelRelease(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 16 /* chan1 */)))
	return TCL_OK
}

var originOptions = [4]uintptr{
	ts + 34713, ts + 34719, ts + 18768, uintptr(0),
}                                                      /* tclIOCmd.c:538:23 */
var modeArray = [3]int32{SEEK_SET, SEEK_CUR, SEEK_END} /* tclIOCmd.c:541:22 */

//----------------------------------------------------------------------
//
// Tcl_TellObjCmd --
//
//	This function is invoked to process the Tcl "tell" command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_TellObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:603:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var chan1 Tcl_Channel at bp, 8
	// The channel to tell on.
	var newLoc Tcl_WideInt
	var code int32

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34440)
		return TCL_ERROR
	}

	// Try to find a channel with the right name and permissions in the IO
	// channel table of this interpreter.

	if XTclGetChannelFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, uintptr(0), 0) != TCL_OK {
		return TCL_ERROR
	}

	XTclChannelPreserve(tls, *(*Tcl_Channel)(unsafe.Pointer(bp /* chan1 */)))
	newLoc = XTcl_Tell(tls, *(*Tcl_Channel)(unsafe.Pointer(bp /* chan1 */)))

	// TIP #219.
	// Capture error messages put by the driver into the bypass area and put
	// them into the regular interpreter result.

	code = XTclChanCaughtErrorBypass(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp /* chan1 */)))
	XTclChannelRelease(tls, *(*Tcl_Channel)(unsafe.Pointer(bp /* chan1 */)))
	if code != 0 {
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, newLoc))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_CloseObjCmd --
//
//	This function is invoked to process the Tcl "close" command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May discard queued input; may flush queued output.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_CloseObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:666:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var chan1 Tcl_Channel at bp+8, 8

	if objc != 2 && objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34727)
		return TCL_ERROR
	}

	if XTclGetChannelFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, uintptr(0), 0) != TCL_OK {
		return TCL_ERROR
	}

	if objc == 3 {
		// var index int32 at bp+16, 4

		var dir int32

		// Get direction requested to close, and check syntax.

		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&dirOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+34749, 0, bp+16) != TCL_OK {
			return TCL_ERROR
		}
		dir = dirArray[*(*int32)(unsafe.Pointer(bp + 16 /* index */))]

		// Check direction against channel mode. It is an error if we try to
		// close a direction not supported by the channel (already closed, or
		// never opened for that direction).

		if !(dir&XTcl_GetChannelMode(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 8))) != 0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

				ts+33040, libc.VaList(bp, dirOptions[*(*int32)(unsafe.Pointer(bp + 16 /* index */))])))
			return TCL_ERROR
		}

		// Special handling is needed if and only if the channel mode supports
		// more than the direction to close. Because if the close the last
		// direction supported we can and will go through the regular
		// process.

		if XTcl_GetChannelMode(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 8)))&(int32(1)<<1|int32(1)<<2) != dir {
			return XTcl_CloseEx(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp + 8 /* chan1 */)), dir)
		}
	}

	if XTcl_UnregisterChannel(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp + 8))) != TCL_OK {
		// If there is an error message and it ends with a newline, remove the
		// newline. This is done for command pipeline channels where the error
		// output from the subprocesses is stored in interp's result.
		//
		// NOTE: This is likely to not have any effect on regular error
		// messages produced by drivers during the closing of a channel,
		// because the Tcl convention is that such error messages do not have
		// a terminating newline.

		var resultPtr uintptr = XTcl_GetObjResult(tls, interp)
		var string uintptr
		// var len int32 at bp+20, 4

		if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount > 1 {
			resultPtr = XTcl_DuplicateObj(tls, resultPtr)
			XTcl_SetObjResult(tls, interp, resultPtr)
		}
		string = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 20)) = (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, resultPtr, bp+20)
		}()
		if *(*int32)(unsafe.Pointer(bp + 20)) > 0 && int32(*(*int8)(unsafe.Pointer(string + uintptr(*(*int32)(unsafe.Pointer(bp + 20))-1)))) == '\n' {
			XTcl_SetObjLength(tls, resultPtr, *(*int32)(unsafe.Pointer(bp + 20))-1)
		}
		return TCL_ERROR
	}

	return TCL_OK
}

var dirOptions = [3]uintptr{
	ts + 5472, ts + 33034, uintptr(0),
}                                                     /* tclIOCmd.c:673:23 */
var dirArray = [2]int32{int32(1) << 1, int32(1) << 2} /* tclIOCmd.c:676:22 */

//----------------------------------------------------------------------
//
// Tcl_FconfigureObjCmd --
//
//	This function is invoked to process the Tcl "fconfigure" command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May modify the behavior of an IO channel.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_FconfigureObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:775:1: */
	bp := tls.Alloc(440)
	defer tls.Free(440)

	var optionName uintptr
	var valueName uintptr
	// var chan1 Tcl_Channel at bp, 8
	// The channel to set a mode on.
	var i int32 // Iterate over arg-value pairs.

	if objc < 2 || objc%2 == 1 && objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34759)
		return TCL_ERROR
	}

	if XTclGetChannelFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, uintptr(0), 0) != TCL_OK {
		return TCL_ERROR
	}

	if objc == 2 {
		// var ds Tcl_DString at bp+8, 216
		// DString to hold result of calling
		// Tcl_GetChannelOption.

		XTcl_DStringInit(tls, bp+8)
		if XTcl_GetChannelOption(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp)), uintptr(0), bp+8) != TCL_OK {
			XTcl_DStringFree(tls, bp+8)
			return TCL_ERROR
		}
		XTcl_DStringResult(tls, interp, bp+8)
		return TCL_OK
	} else if objc == 3 {
		// var ds Tcl_DString at bp+224, 216
		// DString to hold result of calling
		// Tcl_GetChannelOption.

		XTcl_DStringInit(tls, bp+224)
		optionName = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}()
		if XTcl_GetChannelOption(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp)), optionName, bp+224) != TCL_OK {
			XTcl_DStringFree(tls, bp+224)
			return TCL_ERROR
		}
		XTcl_DStringResult(tls, interp, bp+224)
		return TCL_OK
	}

	for i = 3; i < objc; i = i + 2 {
		optionName = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i-1)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i-1)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i-1)*8)))
		}()
		valueName = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		}()
		if XTcl_SetChannelOption(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp)), optionName, valueName) !=
			TCL_OK {
			return TCL_ERROR
		}
	}

	return TCL_OK
}

//---------------------------------------------------------------------------
//
// Tcl_EofObjCmd --
//
//	This function is invoked to process the Tcl "eof" command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Sets interp's result to boolean true or false depending on whether the
//	specified channel has an EOF condition.
//
//---------------------------------------------------------------------------

// ARGSUSED
func XTcl_EofObjCmd(tls *libc.TLS, unused ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:851:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var chan1 Tcl_Channel at bp, 8

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34440)
		return TCL_ERROR
	}

	if XTclGetChannelFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, uintptr(0), 0) != TCL_OK {
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(XTcl_Eof(tls, *(*Tcl_Channel)(unsafe.Pointer(bp))) != 0)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ExecObjCmd --
//
//	This function is invoked to process the "exec" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ExecObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:891:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var resultPtr uintptr
	var argv uintptr // An array for the string arguments. Stored
	// on the _Tcl_ stack.
	var string uintptr
	var chan1 Tcl_Channel
	var argc int32
	var background int32
	var i int32
	// var index int32 at bp+8, 4

	var keepNewline int32
	var result int32
	var skip int32
	// var length int32 at bp+12, 4

	var ignoreStderr int32

	// Check for any leading option arguments.

	keepNewline = 0
	ignoreStderr = 0
	for skip = 1; skip < objc; skip++ {
		string = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))
		}()
		if int32(*(*int8)(unsafe.Pointer(string))) != '-' {
			break
		}
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)), uintptr(unsafe.Pointer(&options9)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp+8) != TCL_OK {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp + 8)) == 1 {
			keepNewline = 1
		} else if *(*int32)(unsafe.Pointer(bp + 8)) == 0 {
			ignoreStderr = 1
		} else {
			skip++
			break
		}
	}
	if objc <= skip {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34789)
		return TCL_ERROR
	}

	// See if the command is to be run in background.

	background = 0
	string = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))
	}()
	if int32(*(*int8)(unsafe.Pointer(string))) == '&' && int32(*(*int8)(unsafe.Pointer(string + 1))) == 0 {
		objc--
		background = 1
	}

	// Create the string argument array "argv". Make sure argv is large enough
	// to hold the argc arguments plus 1 extra for the zero end-of-argv word.

	argc = objc - skip
	argv = XTclStackAlloc(tls, interp, int32(uint64(uint32(argc+1))*uint64(unsafe.Sizeof(uintptr(0)))))

	// Copy the string conversions of each (post option) object into the
	// argument vector.

	for i = 0; i < argc; i++ {
		*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+skip)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+skip)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+skip)*8)))
		}()
	}
	*(*uintptr)(unsafe.Pointer(argv + uintptr(argc)*8)) = uintptr(0)
	chan1 = XTcl_OpenCommandChannel(tls, interp, argc, argv, func() int32 {
		if background != 0 {
			return 0
		}
		return func() int32 {
			if ignoreStderr != 0 {
				return int32(1) << 2
			}
			return int32(1)<<2 | int32(1)<<3
		}()
	}())

	// Free the argv array.

	XTclStackFree(tls, interp, argv)

	if chan1 == uintptr(0) {
		return TCL_ERROR
	}

	if background != 0 {
		// Store the list of PIDs from the pipeline in interp's result and
		// detach the PIDs (instead of waiting for them).

		XTclGetAndDetachPids(tls, interp, chan1)
		if XTcl_Close(tls, interp, chan1) != TCL_OK {
			return TCL_ERROR
		}
		return TCL_OK
	}

	resultPtr = XTcl_NewObj(tls)
	if XTcl_GetChannelHandle(tls, chan1, int32(1)<<1, uintptr(0)) == TCL_OK {
		if XTcl_ReadChars(tls, chan1, resultPtr, -1, 0) < 0 {
			// TIP #219.
			// Capture error messages put by the driver into the bypass area
			// and put them into the regular interpreter result. Fall back to
			// the regular message if nothing was found in the bypass.

			if !(XTclChanCaughtErrorBypass(tls, interp, chan1) != 0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+34817,
					libc.VaList(bp, XTcl_PosixError(tls, interp))))
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = resultPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
			return TCL_ERROR
		}
	}

	// If the process produced anything on stderr, it will have been returned
	// in the interpreter result. It needs to be appended to the result
	// string.

	result = XTcl_Close(tls, interp, chan1)
	XTcl_AppendObjToObj(tls, resultPtr, XTcl_GetObjResult(tls, interp))

	// If the last character of the result is a newline, then remove the
	// newline character.

	if keepNewline == 0 {
		string = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 12)) = (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, resultPtr, bp+12)
		}()
		if *(*int32)(unsafe.Pointer(bp + 12)) > 0 && int32(*(*int8)(unsafe.Pointer(string + uintptr(*(*int32)(unsafe.Pointer(bp + 12))-1)))) == '\n' {
			XTcl_SetObjLength(tls, resultPtr, *(*int32)(unsafe.Pointer(bp + 12))-1)
		}
	}
	XTcl_SetObjResult(tls, interp, resultPtr)

	return result
}

var options9 = [4]uintptr{
	ts + 34855, ts + 34869, ts + 15828, uintptr(0),
} /* tclIOCmd.c:904:23 */

//---------------------------------------------------------------------------
//
// Tcl_FblockedObjCmd --
//
//	This function is invoked to process the Tcl "fblocked" command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Sets interp's result to boolean true or false depending on whether the
//	preceeding input operation on the channel would have blocked.
//
//---------------------------------------------------------------------------

// ARGSUSED
func XTcl_FblockedObjCmd(tls *libc.TLS, unused ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:1059:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	// var chan1 Tcl_Channel at bp+8, 8

	// var mode int32 at bp+16, 4

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34440)
		return TCL_ERROR
	}

	if XTclGetChannelFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp+16, 0) != TCL_OK {
		return TCL_ERROR
	}
	if !(*(*int32)(unsafe.Pointer(bp + 16))&(int32(1)<<1) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+34494,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}())))
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(XTcl_InputBlocked(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 8))) != 0)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_OpenObjCmd --
//
//	This function is invoked to process the "open" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_OpenObjCmd(tls *libc.TLS, notUsed ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:1106:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var pipeline int32
	// var prot int32 at bp, 4

	var modeString uintptr
	var what uintptr
	var chan1 Tcl_Channel

	if objc < 2 || objc > 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34882)
		return TCL_ERROR
	}
	*(*int32)(unsafe.Pointer(bp /* prot */)) = 0666
	if objc == 2 {
		modeString = ts + 22782 /* "r" */
	} else {
		modeString = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}()
		if objc == 4 {
			var permString uintptr = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
			}()
			var code int32 = TCL_ERROR
			var scanned int32 = XTclParseAllWhiteSpace(tls, permString, -1)

			// Support legacy octal numbers.

			if int32(*(*int8)(unsafe.Pointer(permString + uintptr(scanned)))) == '0' &&
				int32(*(*int8)(unsafe.Pointer(permString + uintptr(scanned+1)))) >= '0' &&
				int32(*(*int8)(unsafe.Pointer(permString + uintptr(scanned+1)))) <= '7' {
				var permObj uintptr

				for ok := true; ok; ok = 0 != 0 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							permObj = XTclThreadAllocObj(tls)
						} else {
							permObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(permObj + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(permObj)).FrefCount = 0
					if int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0 {
						(*Tcl_Obj)(unsafe.Pointer(permObj)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(permObj)).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer(permObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(permObj)).Fbytes, ts+34914, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(permObj)).Fbytes + 2)) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer(permObj)).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
					}
					(*Tcl_Obj)(unsafe.Pointer(permObj)).FtypePtr = uintptr(0)
					{
					}
				}
				XTcl_AppendToObj(tls, permObj, permString+uintptr(scanned)+uintptr(1), -1)
				code = func() int32 {
					if (*Tcl_Obj)(unsafe.Pointer(permObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(permObj + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(permObj + 32)) <= int64(uint32(0x7fffffff)*2+1) {
						return func() int32 {
							*(*int32)(unsafe.Pointer(bp)) = int32(*(*int64)(unsafe.Pointer(permObj + 32)))
							return TCL_OK
						}()
					}
					return XTcl_GetIntFromObj(tls, uintptr(0), permObj, bp)
				}()
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var _objPtr uintptr = permObj
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}

			if code == TCL_ERROR &&
				func() int32 {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
						return func() int32 {
							*(*int32)(unsafe.Pointer(bp)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)) + 32)))
							return TCL_OK
						}()
					}
					return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp)
				}() != TCL_OK {
				return TCL_ERROR
			}
		}
	}

	pipeline = 0
	what = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	if int32(*(*int8)(unsafe.Pointer(what))) == '|' {
		pipeline = 1
	}

	// Open the file or create a process pipeline.

	if !(pipeline != 0) {
		chan1 = XTcl_FSOpenFileChannel(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), modeString, *(*int32)(unsafe.Pointer(bp /* prot */)))
	} else {
		var mode int32
		// var seekFlag int32 at bp+16, 4

		// var cmdObjc int32 at bp+4, 4

		// var binary int32 at bp+20, 4

		// var cmdArgv uintptr at bp+8, 8

		if XTcl_SplitList(tls, interp, what+uintptr(1), bp+4, bp+8) != TCL_OK {
			return TCL_ERROR
		}

		mode = XTclGetOpenModeEx(tls, interp, modeString, bp+16, bp+20)
		if mode == -1 {
			chan1 = uintptr(0)
		} else {
			var flags int32 = int32(1)<<3 | int32(1)<<4

			switch mode & (O_RDONLY | O_WRONLY | O_RDWR) {
			case O_RDONLY:
				flags = flags | int32(1)<<2
				break
				fallthrough
			case O_WRONLY:
				flags = flags | int32(1)<<1
				break
				fallthrough
			case O_RDWR:
				flags = flags | (int32(1)<<1 | int32(1)<<2)
				break
				fallthrough
			default:
				XTcl_Panic(tls, ts+34917, 0)
				break
			}
			chan1 = XTcl_OpenCommandChannel(tls, interp, *(*int32)(unsafe.Pointer(bp + 4 /* cmdObjc */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* cmdArgv */)), flags)
			if *(*int32)(unsafe.Pointer(bp + 20)) != 0 && chan1 != 0 {
				XTcl_SetChannelOption(tls, interp, chan1, ts+33606, ts+9534)
			}
		}
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
	}
	if chan1 == uintptr(0) {
		return TCL_ERROR
	}
	XTcl_RegisterChannel(tls, interp, chan1)
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, XTcl_GetChannelName(tls, chan1), -1))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TcpAcceptCallbacksDeleteProc --
//
//	Assocdata cleanup routine called when an interpreter is being deleted
//	to set the interp field of all the accept callback records registered
//	with the interpreter to NULL. This will prevent the interpreter from
//	being used in the future to eval accept scripts.
//
// Results:
//	None.
//
// Side effects:
//	Deallocates memory and sets the interp field of all the accept
//	callback records to NULL to prevent this interpreter from being used
//	subsequently to eval accept scripts.
//
//----------------------------------------------------------------------

// ARGSUSED
func sTcpAcceptCallbacksDeleteProc(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclIOCmd.c:1230:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var hTblPtr uintptr = clientData
	var hPtr uintptr
	// var hSearch Tcl_HashSearch at bp, 24

	for hPtr = XTcl_FirstHashEntry(tls, hTblPtr, bp); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
		var acceptCallbackPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		(*AcceptCallback)(unsafe.Pointer(acceptCallbackPtr)).Finterp = uintptr(0)
	}
	XTcl_DeleteHashTable(tls, hTblPtr)
	XTclpFree(tls, hTblPtr)
}

//----------------------------------------------------------------------
//
// RegisterTcpServerInterpCleanup --
//
//	Registers an accept callback record to have its interp field set to
//	NULL when the interpreter is deleted.
//
// Results:
//	None.
//
// Side effects:
//	When, in the future, the interpreter is deleted, the interp field of
//	the accept callback data structure will be set to NULL. This will
//	prevent attempts to eval the accept script in a deleted interpreter.
//
//----------------------------------------------------------------------

func sRegisterTcpServerInterpCleanup(tls *libc.TLS, interp uintptr, acceptCallbackPtr uintptr) { /* tclIOCmd.c:1269:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var hTblPtr uintptr // Hash table for accept callback records to
	// smash when the interpreter will be
	// deleted.
	var hPtr uintptr // Entry for this record.
	// var isNew int32 at bp, 4
	// Is the entry new?

	hTblPtr = XTcl_GetAssocData(tls, interp, ts+34949, uintptr(0))

	if hTblPtr == uintptr(0) {
		hTblPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
		XTcl_InitHashTable(tls, hTblPtr, 1)
		XTcl_SetAssocData(tls, interp, ts+34949,
			*(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr)
			}{sTcpAcceptCallbacksDeleteProc})), hTblPtr)
	}

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hTblPtr)).FcreateProc})).f(tls, hTblPtr, acceptCallbackPtr, bp /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
		XTcl_Panic(tls, ts+34971, 0)
	}
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = acceptCallbackPtr
}

//----------------------------------------------------------------------
//
// UnregisterTcpServerInterpCleanupProc --
//
//	Unregister a previously registered accept callback record. The interp
//	field of this record will no longer be set to NULL in the future when
//	the interpreter is deleted.
//
// Results:
//	None.
//
// Side effects:
//	Prevents the interp field of the accept callback record from being set
//	to NULL in the future when the interpreter is deleted.
//
//----------------------------------------------------------------------

func sUnregisterTcpServerInterpCleanupProc(tls *libc.TLS, interp uintptr, acceptCallbackPtr uintptr) { /* tclIOCmd.c:1319:1: */
	var hTblPtr uintptr
	var hPtr uintptr

	hTblPtr = XTcl_GetAssocData(tls, interp, ts+34949, uintptr(0))
	if hTblPtr == uintptr(0) {
		return
	}

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(hTblPtr)).FfindProc})).f(tls, hTblPtr, acceptCallbackPtr)
	if hPtr != uintptr(0) {
		XTcl_DeleteHashEntry(tls, hPtr)
	}
}

//----------------------------------------------------------------------
//
// AcceptCallbackProc --
//
//	This callback is invoked by the TCP channel driver when it accepts a
//	new connection from a client on a server socket.
//
// Results:
//	None.
//
// Side effects:
//	Whatever the script does.
//
//----------------------------------------------------------------------

func sAcceptCallbackProc(tls *libc.TLS, callbackData ClientData, chan1 Tcl_Channel, address uintptr, port int32) { /* tclIOCmd.c:1358:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	var acceptCallbackPtr uintptr = callbackData

	// Check if the callback is still valid; the interpreter may have gone
	// away, this is signalled by setting the interp field of the callback
	// data to NULL.

	if (*AcceptCallback)(unsafe.Pointer(acceptCallbackPtr)).Finterp != uintptr(0) {
		// var portBuf [24]int8 at bp+64, 24

		var script uintptr = (*AcceptCallback)(unsafe.Pointer(acceptCallbackPtr)).Fscript
		var interp uintptr = (*AcceptCallback)(unsafe.Pointer(acceptCallbackPtr)).Finterp
		var result int32

		XTcl_Preserve(tls, script)
		XTcl_Preserve(tls, interp)

		XTclFormatInt(tls, bp+64, int64(port))
		XTcl_RegisterChannel(tls, interp, chan1)

		// Artificially bump the refcount to protect the channel from being
		// deleted while the script is being evaluated.

		XTcl_RegisterChannel(tls, uintptr(0), chan1)

		result = XTcl_VarEval(tls, interp, libc.VaList(bp, script, ts+14299, XTcl_GetChannelName(tls, chan1),
			ts+14299, address, ts+14299, bp+64, uintptr(0)))
		if result != TCL_OK {
			XTcl_BackgroundException(tls, interp, result)
			XTcl_UnregisterChannel(tls, interp, chan1)
		}

		// Decrement the artificially bumped refcount. After this it is not
		// safe anymore to use "chan", because it may now be deleted.

		XTcl_UnregisterChannel(tls, uintptr(0), chan1)

		XTcl_Release(tls, interp)
		XTcl_Release(tls, script)
	} else {
		// The interpreter has been deleted, so there is no useful way to use
		// the client socket - just close it.

		XTcl_Close(tls, uintptr(0), chan1)
	}
}

//----------------------------------------------------------------------
//
// TcpServerCloseProc --
//
//	This callback is called when the TCP server channel for which it was
//	registered is being closed. It informs the interpreter in which the
//	accept script is evaluated (if that interpreter still exists) that
//	this channel no longer needs to be informed if the interpreter is
//	deleted.
//
// Results:
//	None.
//
// Side effects:
//	In the future, if the interpreter is deleted this channel will no
//	longer be informed.
//
//----------------------------------------------------------------------

func sTcpServerCloseProc(tls *libc.TLS, callbackData ClientData) { /* tclIOCmd.c:1442:1: */
	var acceptCallbackPtr uintptr = callbackData
	// The actual data.

	if (*AcceptCallback)(unsafe.Pointer(acceptCallbackPtr)).Finterp != uintptr(0) {
		sUnregisterTcpServerInterpCleanupProc(tls, (*AcceptCallback)(unsafe.Pointer(acceptCallbackPtr)).Finterp,
			acceptCallbackPtr)
	}
	XTcl_EventuallyFree(tls, (*AcceptCallback)(unsafe.Pointer(acceptCallbackPtr)).Fscript, uintptr(3))
	XTclpFree(tls, acceptCallbackPtr)
}

//----------------------------------------------------------------------
//
// Tcl_SocketObjCmd --
//
//	This function is invoked to process the "socket" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Creates a socket based channel.
//
//----------------------------------------------------------------------

func XTcl_SocketObjCmd(tls *libc.TLS, notUsed ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:1475:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var optionIndex int32 at bp, 4

	var a int32
	var server int32
	// var port int32 at bp+8, 4

	// var myport int32 at bp+4, 4

	var async int32
	var host uintptr
	var script uintptr
	var myaddr uintptr
	var chan1 Tcl_Channel
	var myPortName uintptr
	var arg uintptr
	var iPtr uintptr
	var acceptCallbackPtr uintptr
	var len uint32
	var copyScript uintptr
	server = 0
	*(*int32)(unsafe.Pointer(bp + 4 /* myport */)) = 0
	async = 0
	script = uintptr(0)
	myaddr = uintptr(0)

	if !(XTclpHasSockets(tls, interp) != TCL_OK) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	a = 1
__2:
	if !(a < objc) {
		goto __4
	}
	arg = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))

	if !(int32(*(*int8)(unsafe.Pointer(arg))) != '-') {
		goto __5
	}
	goto __4
__5:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)), uintptr(unsafe.Pointer(&socketOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, TCL_EXACT, bp) != TCL_OK) {
		goto __6
	}
	return TCL_ERROR
__6:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp /* optionIndex */))) {
	case uint32(0) /* SKT_ASYNC */ :
		goto __8
	case uint32(1) /* SKT_MYADDR */ :
		goto __9
	case uint32(2) /* SKT_MYPORT */ :
		goto __10
	case uint32(3) /* SKT_SERVER */ :
		goto __11
	default:
		goto __12
	}
	goto __7
__8:
	if !(server == 1) {
		goto __13
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+35025, -1))
	return TCL_ERROR
__13:
	;
	async = 1
	goto __7
__9:
	a++
	if !(a >= objc) {
		goto __14
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+35069, -1))
	return TCL_ERROR
__14:
	;
	myaddr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))
	}()
	goto __7
__10:

	a++
	if !(a >= objc) {
		goto __15
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+35106, -1))
	return TCL_ERROR
__15:
	;
	myPortName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))
	}()
	if !(XTclSockGetPort(tls, interp, myPortName, ts+34036, bp+4) != TCL_OK) {
		goto __16
	}
	return TCL_ERROR
__16:
	;
	goto __7

__11:
	if !(async == 1) {
		goto __17
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+35025, -1))
	return TCL_ERROR
__17:
	;
	server = 1
	a++
	if !(a >= objc) {
		goto __18
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+35143, -1))
	return TCL_ERROR
__18:
	;
	script = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))
	}()
	goto __7
__12:
	XTcl_Panic(tls, ts+35180, 0)
__7:
	;
	goto __3
__3:
	a++
	goto __2
	goto __4
__4:
	;
	if !(server != 0) {
		goto __19
	}
	host = myaddr // NULL implies INADDR_ANY
	if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
		goto __21
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+35232, -1))
	return TCL_ERROR
__21:
	;
	goto __20
__19:
	if !(a < objc) {
		goto __22
	}
	host = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))
	}()
	a++
	goto __23
__22:

wrongNumArgs:
	iPtr = interp
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+35272)
	*(*int32)(unsafe.Pointer(iPtr + 424)) |= INTERP_ALTERNATE_WRONG_ARGS
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+35323)
	return TCL_ERROR
__23:
	;
__20:
	;

	if !(a == objc-1) {
		goto __24
	}
	if !(XTclSockGetPort(tls, interp, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(a)*8)))
	}(), ts+34036,
		bp+8) != TCL_OK) {
		goto __26
	}
	return TCL_ERROR
__26:
	;
	goto __25
__24:
	goto wrongNumArgs
__25:
	;

	if !(server != 0) {
		goto __27
	}
	acceptCallbackPtr =
		XTcl_Alloc(tls, uint32(unsafe.Sizeof(AcceptCallback{})))
	len = uint32(libc.Xstrlen(tls, script) + uint64(1))
	copyScript = XTcl_Alloc(tls, len)

	libc.Xmemcpy(tls, copyScript, script, uint64(len))
	(*AcceptCallback)(unsafe.Pointer(acceptCallbackPtr)).Fscript = copyScript
	(*AcceptCallback)(unsafe.Pointer(acceptCallbackPtr)).Finterp = interp
	chan1 = XTcl_OpenTcpServer(tls, interp, *(*int32)(unsafe.Pointer(bp + 8 /* port */)), host, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, Tcl_Channel, uintptr, int32)
	}{sAcceptCallbackProc})),
		acceptCallbackPtr)
	if !(chan1 == uintptr(0)) {
		goto __29
	}
	XTclpFree(tls, copyScript)
	XTclpFree(tls, acceptCallbackPtr)
	return TCL_ERROR
__29:
	;

	// Register with the interpreter to let us know when the interpreter
	// is deleted (by having the callback set the interp field of the
	// acceptCallbackPtr's structure to NULL). This is to avoid trying to
	// eval the script in a deleted interpreter.

	sRegisterTcpServerInterpCleanup(tls, interp, acceptCallbackPtr)

	// Register a close callback. This callback will inform the
	// interpreter (if it still exists) that this channel does not need to
	// be informed when the interpreter is deleted.

	XTcl_CreateCloseHandler(tls, chan1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sTcpServerCloseProc})), acceptCallbackPtr)
	goto __28
__27:
	chan1 = XTcl_OpenTcpClient(tls, interp, *(*int32)(unsafe.Pointer(bp + 8 /* port */)), host, myaddr, *(*int32)(unsafe.Pointer(bp + 4 /* myport */)), async)
	if !(chan1 == uintptr(0)) {
		goto __30
	}
	return TCL_ERROR
__30:
	;
__28:
	;

	XTcl_RegisterChannel(tls, interp, chan1)
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, XTcl_GetChannelName(tls, chan1), -1))
	return TCL_OK
}

var socketOptions = [5]uintptr{
	ts + 35359, ts + 35366, ts + 35374, ts + 35382, uintptr(0),
} /* tclIOCmd.c:1481:23 */

//----------------------------------------------------------------------
//
// Tcl_FcopyObjCmd --
//
//	This function is invoked to process the "fcopy" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Moves data between two channels and possibly sets up a background copy
//	handler.
//
//----------------------------------------------------------------------

func XTcl_FcopyObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:1653:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	// var inChan Tcl_Channel at bp+16, 8

	// var outChan Tcl_Channel at bp+32, 8

	// var mode int32 at bp+24, 4

	var i int32
	// var index int32 at bp+40, 4

	// var toRead Tcl_WideInt at bp+48, 8

	var cmdPtr uintptr

	if objc < 3 || objc > 7 || objc == 4 || objc == 6 {
		XTcl_WrongNumArgs(tls, interp, 1, objv,
			ts+35390)
		return TCL_ERROR
	}

	// Parse the channel arguments and verify that they are readable or
	// writable, as appropriate.

	if XTclGetChannelFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16, bp+24, 0) != TCL_OK {
		return TCL_ERROR
	}
	if !(*(*int32)(unsafe.Pointer(bp + 24))&(int32(1)<<1) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+34494,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}())))
		return TCL_ERROR
	}
	if XTclGetChannelFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+32, bp+24, 0) != TCL_OK {
		return TCL_ERROR
	}
	if !(*(*int32)(unsafe.Pointer(bp + 24))&(int32(1)<<2) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+34378,
			libc.VaList(bp+8, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
			}())))
		return TCL_ERROR
	}

	*(*Tcl_WideInt)(unsafe.Pointer(bp + 48 /* toRead */)) = int64(-1)
	cmdPtr = uintptr(0)
	for i = 3; i < objc; i = i + 2 {
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&switches1)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+40) != TCL_OK {
			return TCL_ERROR
		}
		switch *(*int32)(unsafe.Pointer(bp + 40 /* index */)) {
		case 0 /* FcopySize */ :
			if XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+48) != TCL_OK {
				return TCL_ERROR
			}
			if *(*Tcl_WideInt)(unsafe.Pointer(bp + 48)) < int64(0) {
				// Handle all negative sizes like -1, meaning 'copy all'. By
				// resetting toRead we avoid changes in the core copying
				// functions (which explicitly check for -1 and crash on any
				// other negative value).

				*(*Tcl_WideInt)(unsafe.Pointer(bp + 48 /* toRead */)) = int64(-1)
			}
			break
		case 1 /* FcopyCommand */ :
			cmdPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
			break
		}
	}

	return XTclCopyChannel(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(bp + 16 /* inChan */)), *(*Tcl_Channel)(unsafe.Pointer(bp + 32 /* outChan */)), *(*Tcl_WideInt)(unsafe.Pointer(bp + 48 /* toRead */)), cmdPtr)
}

var switches1 = [3]uintptr{ts + 35436, ts + 15408, uintptr(0)} /* tclIOCmd.c:1663:23 */

//---------------------------------------------------------------------------
//
// ChanPendingObjCmd --
//
//	This function is invoked to process the Tcl "chan pending" command
//	(TIP #287). See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Sets interp's result to the number of bytes of buffered input or
//	output (depending on whether the first argument is "input" or
//	"output"), or -1 if the channel wasn't opened for that mode.
//
//---------------------------------------------------------------------------

// ARGSUSED
func sChanPendingObjCmd(tls *libc.TLS, unused ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:1749:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	// var chan1 Tcl_Channel at bp+8, 8

	// var index int32 at bp, 4

	// var mode int32 at bp+16, 4

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+35442)
		return TCL_ERROR
	}

	if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&options10)), int32(unsafe.Sizeof(uintptr(0))), ts+12815, 0, bp) != TCL_OK {
		return TCL_ERROR
	}

	if XTclGetChannelFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+8, bp+16, 0) != TCL_OK {
		return TCL_ERROR
	}

	switch uint32(*(*int32)(unsafe.Pointer(bp /* index */))) {
	case uint32(0) /* PENDING_INPUT */ :
		if !(*(*int32)(unsafe.Pointer(bp + 16))&(int32(1)<<1) != 0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, -1))
		} else {
			XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, XTcl_InputBuffered(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 8 /* chan1 */)))))
		}
		break
	case uint32(1) /* PENDING_OUTPUT */ :
		if !(*(*int32)(unsafe.Pointer(bp + 16))&(int32(1)<<2) != 0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, -1))
		} else {
			XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, XTcl_OutputBuffered(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 8 /* chan1 */)))))
		}
		break
	}
	return TCL_OK
}

var options10 = [3]uintptr{ts + 35457, ts + 35463, uintptr(0)} /* tclIOCmd.c:1757:23 */

//----------------------------------------------------------------------
//
// ChanTruncateObjCmd --
//
//	This function is invoked to process the "chan truncate" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Truncates a channel (or rather a file underlying a channel).
//
//----------------------------------------------------------------------

func sChanTruncateObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:1811:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	// var chan1 Tcl_Channel at bp+32, 8

	// var length Tcl_WideInt at bp+40, 8

	if objc < 2 || objc > 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+35470)
		return TCL_ERROR
	}
	if XTclGetChannelFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+32, uintptr(0), 0) != TCL_OK {
		return TCL_ERROR
	}

	if objc == 3 {
		// User is supplying an explicit length.

		if XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+40) != TCL_OK {
			return TCL_ERROR
		}
		if *(*Tcl_WideInt)(unsafe.Pointer(bp + 40)) < int64(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+35489, -1))
			return TCL_ERROR
		}
	} else {
		// User wants to truncate to the current file position.

		*(*Tcl_WideInt)(unsafe.Pointer(bp + 40 /* length */)) = XTcl_Tell(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 32 /* chan1 */)))
		if *(*Tcl_WideInt)(unsafe.Pointer(bp + 40)) == int64(-1) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+35532,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
				}(), XTcl_PosixError(tls, interp))))
			return TCL_ERROR
		}
	}

	if XTcl_TruncateChannel(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 32)), *(*Tcl_WideInt)(unsafe.Pointer(bp + 40))) != TCL_OK {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+35581,
			libc.VaList(bp+16, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}(), XTcl_PosixError(tls, interp))))
		return TCL_ERROR
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// ChanPipeObjCmd --
//
//	This function is invoked to process the "chan pipe" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Creates a pair of Tcl channels wrapping both ends of a new
//	anonymous pipe.
//
//----------------------------------------------------------------------

func sChanPipeObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:1884:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// var rchan Tcl_Channel at bp, 8

	// var wchan Tcl_Channel at bp+8, 8

	// var channelNames [2]uintptr at bp+16, 16

	var resultPtr uintptr

	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2046)
		return TCL_ERROR
	}

	if XTcl_CreatePipe(tls, interp, bp, bp+8, 0) != TCL_OK {
		return TCL_ERROR
	}

	*(*uintptr)(unsafe.Pointer(bp + 16)) = XTcl_GetChannelName(tls, *(*Tcl_Channel)(unsafe.Pointer(bp /* rchan */)))
	*(*uintptr)(unsafe.Pointer(bp + 16 + 1*8)) = XTcl_GetChannelName(tls, *(*Tcl_Channel)(unsafe.Pointer(bp + 8 /* wchan */)))

	resultPtr = XTcl_NewObj(tls)
	XTcl_ListObjAppendElement(tls, uintptr(0), resultPtr,
		XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), -1))
	XTcl_ListObjAppendElement(tls, uintptr(0), resultPtr,
		XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16 + 1*8)), -1))
	XTcl_SetObjResult(tls, interp, resultPtr)

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclChannelNamesCmd --
//
//	This function is invoked to process the "chan names" and "file
//	channels" Tcl commands.  See the user documentation for details on
//	what they do.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclChannelNamesCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIOCmd.c:1935:1: */
	if objc < 1 || objc > 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13546)
		return TCL_ERROR
	}
	return XTcl_GetChannelNamesEx(tls, interp,
		func() uintptr {
			if objc == 1 {
				return uintptr(0)
			}
			return func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}()
		}())
}

//----------------------------------------------------------------------
//
// TclInitChanCmd --
//
//	This function is invoked to create the "chan" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A Tcl command handle.
//
// Side effects:
//	None (since nothing is byte-compiled).
//
//----------------------------------------------------------------------

func XTclInitChanCmd(tls *libc.TLS, interp uintptr) Tcl_Command { /* tclIOCmd.c:1967:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var ensemble Tcl_Command
	// var mapObj uintptr at bp, 8

	var i int32

	ensemble = XTclMakeEnsemble(tls, interp, ts+35615, uintptr(unsafe.Pointer(&initMap1)))
	XTcl_GetEnsembleMappingDict(tls, uintptr(0), ensemble, bp)
	for i = 0; extras[i] != 0; i = i + 2 {
		// Can assume that reference counts are all incremented.

		XTcl_DictObjPut(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp /* mapObj */)), XTcl_NewStringObj(tls, extras[i], -1),
			XTcl_NewStringObj(tls, extras[i+1], -1))
	}
	XTcl_SetEnsembleMappingDict(tls, interp, ensemble, *(*uintptr)(unsafe.Pointer(bp /* mapObj */)))
	return ensemble
}

var initMap1 = [20]EnsembleImplMap{
	{Fname: ts + 35620, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5382, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12141, Fproc: 0},
	{Fname: ts + 23142, Fproc: 0, FcompileProc: 0}, // TIP #219
	{Fname: ts + 5388, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 35628, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5438, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5444, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 11701, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 35634, Fproc: 0, FcompileProc: 0}, // TIP #287
	{Fname: ts + 35642, Fproc: 0, FcompileProc: 0}, // TIP #304
	{Fname: ts + 3001, Fproc: 0, FcompileProc: 0},  // TIP #230
	{Fname: ts + 35647, Fproc: 0, FcompileProc: 0}, // TIP #219
	{Fname: ts + 2072, Fproc: 0, FcompileProc: 0},  // TIP #230
	{Fname: ts + 5463, Fproc: 0},
	{Fname: ts + 5472, Fproc: 0},
	{Fname: ts + 5477, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5496, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 35657, Fproc: 0, FcompileProc: 0}, // TIP #208
	{},
} /* tclIOCmd.c:1977:34 */
var extras = [3]uintptr{
	ts + 26108, ts + 35666,
	uintptr(0),
} /* tclIOCmd.c:1999:23 */

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Forward declarations of internal procedures. Third, helper procedures
// encapsulating essential tasks.

type TransformChannelData1 = struct {
	Fself          Tcl_Channel
	FreadIsFlushed int32
	FeofPending    int32
	Fflags         int32
	FwatchMask     int32
	Fmode          int32
	F__ccgo_pad1   [4]byte
	Ftimer         Tcl_TimerToken
	FmaxRead       int32
	F__ccgo_pad2   [4]byte
	Finterp        uintptr
	Fcommand       uintptr
	Fresult        ResultBuffer
	FrefCount      int32
	F__ccgo_pad3   [4]byte
} /* tclIOGT.c:59:9 */

// Forward declarations of internal procedures. Third, helper procedures
// encapsulating essential tasks.

type TransformChannelData = TransformChannelData1 /* tclIOGT.c:59:37 */

// Action codes to give to 'ExecuteCallback' (argument 'transmit'), telling
// the procedure what to do with the result of the script it calls.

// Codes for 'preserve' of 'ExecuteCallback'.

// Strings for the action codes delivered to the script implementing a
// transformation. Argument 'op' of 'ExecuteCallback'.

// Management of a simple buffer.

type ResultBuffer2 = struct {
	Fbuf       uintptr
	Fallocated Size_t
	Fused      Size_t
} /* tclIOGT.c:59:9 */

// Action codes to give to 'ExecuteCallback' (argument 'transmit'), telling
// the procedure what to do with the result of the script it calls.

// Codes for 'preserve' of 'ExecuteCallback'.

// Strings for the action codes delivered to the script implementing a
// transformation. Argument 'op' of 'ExecuteCallback'.

// Management of a simple buffer.

type ResultBuffer = ResultBuffer2 /* tclIOGT.c:106:29 */

// This structure describes the channel type structure for Tcl-based
// transformations.

var transformChannelType = Tcl_ChannelType{
	FtypeName:      ts + 35679,
	Fversion:       uintptr(0x5),
	FcloseProc:     0, // Close proc.
	FinputProc:     0, // Input proc.
	FoutputProc:    0, // Output proc.
	FseekProc:      0, // Seek proc.
	FsetOptionProc: 0, // Set option proc.
	FgetOptionProc: 0, // Get option proc.
	FwatchProc:     0, // Initialize notifier.
	FgetHandleProc: 0, // Get OS handles out of channel.
	Fclose2Proc:    0, // close2proc
	FblockModeProc: 0, // Flush proc.
	FhandlerProc:   0, // Handling of events bubbling up.
	FwideSeekProc:  0, // Truncate.
} /* tclIOGT.c:121:30 */

func sPreserveData(tls *libc.TLS, dataPtr uintptr) { /* tclIOGT.c:220:1: */
	(*TransformChannelData)(unsafe.Pointer(dataPtr)).FrefCount++
}

func sReleaseData(tls *libc.TLS, dataPtr uintptr) { /* tclIOGT.c:227:1: */
	if libc.PreDecInt32(&(*TransformChannelData)(unsafe.Pointer(dataPtr)).FrefCount, 1) != 0 {
		return
	}
	sResultClear(tls, dataPtr+64)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fcommand
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTclpFree(tls, dataPtr)
}

//----------------------------------------------------------------------
//
// TclChannelTransform --
//
//	Implements the Tcl "testchannel transform" debugging command. This is
//	part of the testing environment. This sets up a tcl script (cmdObjPtr)
//	to be used as a transform on the channel.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTclChannelTransform(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel, cmdObjPtr uintptr) int32 { /* tclIOGT.c:258:1: */
	bp := tls.Alloc(232)
	defer tls.Free(232)

	var chanPtr uintptr  // The actual channel.
	var statePtr uintptr // State info for channel.
	var mode int32       // Read/write mode of the channel.
	// var objc int32 at bp+8, 4

	var dataPtr uintptr
	// var ds Tcl_DString at bp+16, 216

	if chan1 == uintptr(0) {
		return TCL_ERROR
	}

	if TCL_OK != XTcl_ListObjLength(tls, interp, cmdObjPtr, bp+8) {
		XTcl_SetObjResult(tls, interp,
			XTcl_NewStringObj(tls, ts+35689, -1))
		return TCL_ERROR
	}

	chanPtr = chan1
	statePtr = (*Channel)(unsafe.Pointer(chanPtr)).Fstate
	chanPtr = (*ChannelState)(unsafe.Pointer(statePtr)).FtopChanPtr
	chan1 = chanPtr
	mode = (*ChannelState)(unsafe.Pointer(statePtr)).Fflags & (int32(1)<<1 | int32(1)<<2)

	// Now initialize the transformation state and stack it upon the specified
	// channel. One of the necessary things to do is to retrieve the blocking
	// regime of the underlying channel and to use the same for us too.

	dataPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TransformChannelData{})))

	(*TransformChannelData)(unsafe.Pointer(dataPtr)).FrefCount = 1
	XTcl_DStringInit(tls, bp+16)
	XTcl_GetChannelOption(tls, interp, chan1, ts+31937, bp+16)
	(*TransformChannelData)(unsafe.Pointer(dataPtr)).FreadIsFlushed = 0
	(*TransformChannelData)(unsafe.Pointer(dataPtr)).FeofPending = 0
	(*TransformChannelData)(unsafe.Pointer(dataPtr)).Fflags = 0
	if int32(*(*int8)(unsafe.Pointer((*Tcl_DString)(unsafe.Pointer(bp + 16)).Fstring))) == '0' {
		*(*int32)(unsafe.Pointer(dataPtr + 16)) |= int32(1) << 0
	}
	XTcl_DStringFree(tls, bp+16)

	(*TransformChannelData)(unsafe.Pointer(dataPtr)).FwatchMask = 0
	(*TransformChannelData)(unsafe.Pointer(dataPtr)).Fmode = mode
	(*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer = uintptr(0)
	(*TransformChannelData)(unsafe.Pointer(dataPtr)).FmaxRead = 4096 // Initial value not relevant.
	(*TransformChannelData)(unsafe.Pointer(dataPtr)).Finterp = interp
	(*TransformChannelData)(unsafe.Pointer(dataPtr)).Fcommand = cmdObjPtr
	(*Tcl_Obj)(unsafe.Pointer((*TransformChannelData)(unsafe.Pointer(dataPtr)).Fcommand)).FrefCount++

	sResultInit(tls, dataPtr+64)

	(*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself = XTcl_StackChannel(tls, interp, uintptr(unsafe.Pointer(&transformChannelType)), dataPtr,
		mode, chan1)
	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself == uintptr(0) {
		XTcl_AppendPrintfToObj(tls, XTcl_GetObjResult(tls, interp),
			ts+35718, libc.VaList(bp, XTcl_GetChannelName(tls, chan1)))
		sReleaseData(tls, dataPtr)
		return TCL_ERROR
	}
	XTcl_Preserve(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself)

	// At last initialize the transformation at the script level.

	sPreserveData(tls, dataPtr)
	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fmode&(int32(1)<<2) != 0 && sExecuteCallback(tls, dataPtr, uintptr(0),
		ts+35748, uintptr(0), 0, TRANSMIT_DONT, P_NO_PRESERVE) != TCL_OK {
		XTcl_UnstackChannel(tls, interp, chan1)
		sReleaseData(tls, dataPtr)
		return TCL_ERROR
	}

	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fmode&(int32(1)<<1) != 0 && sExecuteCallback(tls, dataPtr, uintptr(0),
		ts+35761, uintptr(0), 0, TRANSMIT_DONT, P_NO_PRESERVE) != TCL_OK {
		sExecuteCallback(tls, dataPtr, uintptr(0), ts+35773, uintptr(0), 0, TRANSMIT_DONT,
			P_NO_PRESERVE)
		XTcl_UnstackChannel(tls, interp, chan1)
		sReleaseData(tls, dataPtr)
		return TCL_ERROR
	}

	sReleaseData(tls, dataPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ExecuteCallback --
//
//	Executes the defined callback for buffer and operation.
//
// Side effects:
//	As of the executed tcl script.
//
// Result:
//	A standard TCL error code. In case of an error a message is left in
//	the result area of the specified interpreter.
//
//----------------------------------------------------------------------

func sExecuteCallback(tls *libc.TLS, dataPtr uintptr, interp uintptr, op uintptr, buf uintptr, bufLen int32, transmit int32, preserve int32) int32 { /* tclIOGT.c:368:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var resObj uintptr // See below, switch (transmit).
	// var resLen int32 at bp, 4

	var resBuf uintptr
	var state Tcl_InterpState = uintptr(0)
	var res int32 = TCL_OK
	var command uintptr = XTclListObjCopy(tls, uintptr(0), (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fcommand)
	var eval uintptr = (*TransformChannelData)(unsafe.Pointer(dataPtr)).Finterp

	XTcl_Preserve(tls, eval)

	// Step 1, create the complete command to execute. Do this by appending
	// operation and buffer to operate upon to a copy of the callback
	// definition. We *cannot* create a list containing 3 objects and then use
	// 'Tcl_EvalObjv', because the command may contain additional prefixed
	// arguments. Feather's curried commands would come in handy here.

	if preserve == P_PRESERVE {
		state = XTcl_SaveInterpState(tls, eval, res)
	}

	(*Tcl_Obj)(unsafe.Pointer(command)).FrefCount++
	XTcl_ListObjAppendElement(tls, uintptr(0), command, XTcl_NewStringObj(tls, op, -1))

	// Use a byte-array to prevent the misinterpretation of binary data coming
	// through as UTF while at the tcl level.

	XTcl_ListObjAppendElement(tls, uintptr(0), command, XTcl_NewByteArrayObj(tls, buf, bufLen))

	// Step 2, execute the command at the global level of the interpreter used
	// to create the transformation. Destroy the command afterward. If an
	// error occured and the current interpreter is defined and not equal to
	// the interpreter for the callback, then copy the error message into
	// current interpreter. Don't copy if in preservation mode.

	res = XTcl_EvalObjEx(tls, eval, command, TCL_EVAL_GLOBAL)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = command
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	command = uintptr(0)

	if res != TCL_OK && interp != uintptr(0) && eval != interp &&
		preserve == P_NO_PRESERVE {
		XTcl_SetObjResult(tls, interp, XTcl_GetObjResult(tls, eval))
		XTcl_Release(tls, eval)
		return res
	}

	// Step 3, transmit a possible conversion result to the underlying
	// channel, or ourselves.

	switch transmit {
	case TRANSMIT_DONT:
		// nothing to do
		break

	case TRANSMIT_DOWN:
		if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself == uintptr(0) {
			break
		}
		resObj = XTcl_GetObjResult(tls, eval)
		resBuf = XTcl_GetByteArrayFromObj(tls, resObj, bp)
		XTcl_WriteRaw(tls, XTcl_GetStackedChannel(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself), resBuf,
			*(*int32)(unsafe.Pointer(bp /* resLen */)))
		break

	case TRANSMIT_SELF:
		if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself == uintptr(0) {
			break
		}
		resObj = XTcl_GetObjResult(tls, eval)
		resBuf = XTcl_GetByteArrayFromObj(tls, resObj, bp)
		XTcl_WriteRaw(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself, resBuf, *(*int32)(unsafe.Pointer(bp /* resLen */)))
		break

	case TRANSMIT_IBUF:
		resObj = XTcl_GetObjResult(tls, eval)
		resBuf = XTcl_GetByteArrayFromObj(tls, resObj, bp)
		sResultAdd(tls, dataPtr+64, resBuf, uint64(*(*int32)(unsafe.Pointer(bp /* resLen */))))
		break

	case TRANSMIT_NUM:
		// Interpret result as integer number.

		resObj = XTcl_GetObjResult(tls, eval)
		if (*Tcl_Obj)(unsafe.Pointer(resObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(resObj + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(resObj + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			*(*int32)(unsafe.Pointer(dataPtr + 40)) = int32(*(*int64)(unsafe.Pointer(resObj + 32)))
		} else {
			XTcl_GetIntFromObj(tls, eval, resObj, dataPtr+40)
		}
		break
	}

	XTcl_ResetResult(tls, eval)
	if preserve == P_PRESERVE {
		XTcl_RestoreInterpState(tls, eval, state)
	}
	XTcl_Release(tls, eval)
	return res
}

//----------------------------------------------------------------------
//
// TransformBlockModeProc --
//
//	Trap handler. Called by the generic IO system during option processing
//	to change the blocking mode of the channel.
//
// Side effects:
//	Forwards the request to the underlying channel.
//
// Result:
//	0 if successful, errno when failed.
//
//----------------------------------------------------------------------

func sTransformBlockModeProc(tls *libc.TLS, instanceData ClientData, mode int32) int32 { /* tclIOGT.c:504:1: */
	var dataPtr uintptr = instanceData

	if mode == TCL_MODE_NONBLOCKING {
		*(*int32)(unsafe.Pointer(dataPtr + 16)) |= int32(1) << 0
	} else {
		*(*int32)(unsafe.Pointer(dataPtr + 16)) &= libc.CplInt32(int32(1) << 0)
	}
	return 0
}

//----------------------------------------------------------------------
//
// TransformCloseProc/TransformClose2Proc --
//
//	Trap handler. Called by the generic IO system during destruction of
//	the transformation channel.
//
// Side effects:
//	Releases the memory allocated in 'Tcl_TransformObjCmd'.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sTransformCloseProc(tls *libc.TLS, instanceData ClientData, interp uintptr) int32 { /* tclIOGT.c:536:1: */
	var dataPtr uintptr = instanceData

	// Important: In this procedure 'dataPtr->self' already points to the
	// underlying channel.
	//
	// There is no need to cancel an existing channel handler, this is already
	// done. Either by 'Tcl_UnstackChannel' or by the general cleanup in
	// 'Tcl_Close'.
	//
	// But we have to cancel an active timer to prevent it from firing on the
	// removed channel.

	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer != uintptr(0) {
		XTcl_DeleteTimerHandler(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer)
		(*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer = uintptr(0)
	}

	// Now flush data waiting in internal buffers to output and input. The
	// input must be done despite the fact that there is no real receiver for
	// it anymore. But the scripts might have sideeffects other parts of the
	// system rely on (f.e. signaling the close to interested parties).

	sPreserveData(tls, dataPtr)
	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fmode&(int32(1)<<2) != 0 {
		sExecuteCallback(tls, dataPtr, interp, ts+35786, uintptr(0), 0,
			TRANSMIT_DOWN, P_PRESERVE)
	}

	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fmode&(int32(1)<<1) != 0 && !((*TransformChannelData)(unsafe.Pointer(dataPtr)).FreadIsFlushed != 0) {
		(*TransformChannelData)(unsafe.Pointer(dataPtr)).FreadIsFlushed = 1
		sExecuteCallback(tls, dataPtr, interp, ts+35798, uintptr(0), 0, TRANSMIT_IBUF,
			P_PRESERVE)
	}

	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fmode&(int32(1)<<2) != 0 {
		sExecuteCallback(tls, dataPtr, interp, ts+35773, uintptr(0), 0,
			TRANSMIT_DONT, P_PRESERVE)
	}
	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fmode&(int32(1)<<1) != 0 {
		sExecuteCallback(tls, dataPtr, interp, ts+35809, uintptr(0), 0,
			TRANSMIT_DONT, P_PRESERVE)
	}
	sReleaseData(tls, dataPtr)

	// General cleanup.

	XTcl_Release(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself)
	(*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself = uintptr(0)
	sReleaseData(tls, dataPtr)
	return TCL_OK
}

func sTransformClose2Proc(tls *libc.TLS, instanceData ClientData, interp uintptr, flags int32) int32 { /* tclIOGT.c:599:1: */
	if flags&(int32(1)<<1|int32(1)<<2) == 0 {
		return sTransformCloseProc(tls, instanceData, interp)
	}
	return EINVAL
}

//----------------------------------------------------------------------
//
// TransformInputProc --
//
//	Called by the generic IO system to convert read data.
//
// Side effects:
//	As defined by the conversion.
//
// Result:
//	A transformed buffer.
//
//----------------------------------------------------------------------

func sTransformInputProc(tls *libc.TLS, instanceData ClientData, buf uintptr, toRead int32, errorCodePtr uintptr) int32 { /* tclIOGT.c:627:1: */
	var dataPtr uintptr = instanceData
	var gotBytes int32
	var read int32
	var copied int32
	var downChan Tcl_Channel

	// Should assert(dataPtr->mode & TCL_READABLE);

	if toRead == 0 || (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself == uintptr(0) {
		// Catch a no-op. TODO: Is this a panic()?
		return 0
	}

	gotBytes = 0
	downChan = XTcl_GetStackedChannel(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself)

	sPreserveData(tls, dataPtr)
	for toRead > 0 {
		// Loop until the request is satisfied (or no data is available from
		// below, possibly EOF).

		copied = sResultCopy(tls, dataPtr+64, buf, uint64(toRead))
		toRead = toRead - copied
		buf += uintptr(copied)
		gotBytes = gotBytes + copied

		if toRead == 0 {
			// The request was completely satisfied from our buffers. We can
			// break out of the loop and return to the caller.

			break
		}

		// Length (dataPtr->result) == 0, toRead > 0 here. Use the incoming
		// 'buf'! as target to store the intermediary information read from
		// the underlying channel.
		//
		// Ask the tcl level how much data it allows us to read from the
		// underlying channel. This feature allows the transform to signal EOF
		// upstream although there is none downstream. Useful to control an
		// unbounded 'fcopy', either through counting bytes, or by pattern
		// matching.

		sExecuteCallback(tls, dataPtr, uintptr(0), ts+35821, uintptr(0), 0,
			TRANSMIT_NUM, P_PRESERVE)

		if (*TransformChannelData)(unsafe.Pointer(dataPtr)).FmaxRead >= 0 {
			if (*TransformChannelData)(unsafe.Pointer(dataPtr)).FmaxRead < toRead {
				toRead = (*TransformChannelData)(unsafe.Pointer(dataPtr)).FmaxRead
			}
		} // else: 'maxRead < 0' == Accept the current value of toRead.
		if toRead <= 0 {
			break
		}
		if (*TransformChannelData)(unsafe.Pointer(dataPtr)).FeofPending != 0 {
			// Already saw EOF from downChan; don't ask again.
			// NOTE: Could move this up to avoid the last maxRead
			// execution.  Believe this would still be correct behavior,
			// but the test suite tests the whole command callback
			// sequence, so leave it unchanged for now.

			break
		}

		// Get bytes from the underlying channel.

		read = XTcl_ReadRaw(tls, downChan, buf, toRead)
		if read < 0 {
			if XTcl_InputBlocked(tls, downChan) != 0 && gotBytes > 0 {
				// Zero bytes available from downChan because blocked.
				// But nonzero bytes already copied, so total is a
				// valid blocked short read. Return to caller.

				break
			}

			// Either downChan is not blocked (there's a real error).
			// or it is and there are no bytes copied yet.  In either
			// case we want to pass the "error" along to the caller,
			// either to report an error, or to signal to the caller
			// that zero bytes are available because blocked.

			*(*int32)(unsafe.Pointer(errorCodePtr)) = XTcl_GetErrno(tls)
			gotBytes = -1
			break
		} else if read == 0 {

			// Zero returned from Tcl_ReadRaw() always indicates EOF
			// on the down channel.

			(*TransformChannelData)(unsafe.Pointer(dataPtr)).FeofPending = 1
			(*TransformChannelData)(unsafe.Pointer(dataPtr)).FreadIsFlushed = 1
			sExecuteCallback(tls, dataPtr, uintptr(0), ts+35798, uintptr(0), 0,
				TRANSMIT_IBUF, P_PRESERVE)

			if sResultEmpty(tls, dataPtr+64) != 0 {
				// We had nothing to flush.

				break
			}

			continue // at: while (toRead > 0)
		} // read == 0

		// Transform the read chunk and add the result to our read buffer
		// (dataPtr->result).

		if sExecuteCallback(tls, dataPtr, uintptr(0), ts+5472, buf, read,
			TRANSMIT_IBUF, P_PRESERVE) != TCL_OK {
			*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
			gotBytes = -1
			break
		}
	} // while toRead > 0

	if gotBytes == 0 {
		(*TransformChannelData)(unsafe.Pointer(dataPtr)).FeofPending = 0
	}
	sReleaseData(tls, dataPtr)
	return gotBytes
}

//----------------------------------------------------------------------
//
// TransformOutputProc --
//
//	Called by the generic IO system to convert data waiting to be written.
//
// Side effects:
//	As defined by the transformation.
//
// Result:
//	A transformed buffer.
//
//----------------------------------------------------------------------

func sTransformOutputProc(tls *libc.TLS, instanceData ClientData, buf uintptr, toWrite int32, errorCodePtr uintptr) int32 { /* tclIOGT.c:794:1: */
	var dataPtr uintptr = instanceData

	// Should assert(dataPtr->mode & TCL_WRITABLE);

	if toWrite == 0 {
		// Catch a no-op.

		return 0
	}

	sPreserveData(tls, dataPtr)
	if sExecuteCallback(tls, dataPtr, uintptr(0), ts+33034, buf, toWrite,
		TRANSMIT_DOWN, P_NO_PRESERVE) != TCL_OK {
		*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
		toWrite = -1
	}
	sReleaseData(tls, dataPtr)

	return toWrite
}

//----------------------------------------------------------------------
//
// TransformSeekProc --
//
//	This procedure is called by the generic IO level to move the access
//	point in a channel.
//
// Side effects:
//	Moves the location at which the channel will be accessed in future
//	operations. Flushes all transformation buffers, then forwards it to
//	the underlying channel.
//
// Result:
//	-1 if failed, the new position if successful. An output argument
//	contains the POSIX error code if an error occurred, or zero.
//
//----------------------------------------------------------------------

func sTransformSeekProc(tls *libc.TLS, instanceData ClientData, offset int64, mode int32, errorCodePtr uintptr) int32 { /* tclIOGT.c:846:1: */
	var dataPtr uintptr = instanceData
	var parent Tcl_Channel = XTcl_GetStackedChannel(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself)
	var parentType uintptr = XTcl_GetChannelType(tls, parent)
	var parentSeekProc uintptr = XTcl_ChannelSeekProc(tls, parentType)

	if offset == int64(0) && mode == SEEK_CUR {
		// This is no seek but a request to tell the caller the current
		// location. Simply pass the request down.

		return (*struct {
			f func(*libc.TLS, ClientData, int64, int32, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{parentSeekProc})).f(tls, XTcl_GetChannelInstanceData(tls, parent), offset,
			mode, errorCodePtr)
	}

	// It is a real request to change the position. Flush all data waiting for
	// output and discard everything in the input buffers. Then pass the
	// request down, unchanged.

	sPreserveData(tls, dataPtr)
	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fmode&(int32(1)<<2) != 0 {
		sExecuteCallback(tls, dataPtr, uintptr(0), ts+35786, uintptr(0), 0, TRANSMIT_DOWN,
			P_NO_PRESERVE)
	}

	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fmode&(int32(1)<<1) != 0 {
		sExecuteCallback(tls, dataPtr, uintptr(0), ts+35835, uintptr(0), 0, TRANSMIT_DONT,
			P_NO_PRESERVE)
		sResultClear(tls, dataPtr+64)
		(*TransformChannelData)(unsafe.Pointer(dataPtr)).FreadIsFlushed = 0
		(*TransformChannelData)(unsafe.Pointer(dataPtr)).FeofPending = 0
	}
	sReleaseData(tls, dataPtr)

	return (*struct {
		f func(*libc.TLS, ClientData, int64, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{parentSeekProc})).f(tls, XTcl_GetChannelInstanceData(tls, parent), offset, mode,
		errorCodePtr)
}

//----------------------------------------------------------------------
//
// TransformWideSeekProc --
//
//	This procedure is called by the generic IO level to move the access
//	point in a channel, with a (potentially) 64-bit offset.
//
// Side effects:
//	Moves the location at which the channel will be accessed in future
//	operations. Flushes all transformation buffers, then forwards it to
//	the underlying channel.
//
// Result:
//	-1 if failed, the new position if successful. An output argument
//	contains the POSIX error code if an error occurred, or zero.
//
//----------------------------------------------------------------------

func sTransformWideSeekProc(tls *libc.TLS, instanceData ClientData, offset Tcl_WideInt, mode int32, errorCodePtr uintptr) Tcl_WideInt { /* tclIOGT.c:913:1: */
	var dataPtr uintptr = instanceData
	var parent Tcl_Channel = XTcl_GetStackedChannel(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself)
	var parentType uintptr = XTcl_GetChannelType(tls, parent)
	var parentSeekProc uintptr = XTcl_ChannelSeekProc(tls, parentType)
	var parentWideSeekProc uintptr = XTcl_ChannelWideSeekProc(tls, parentType)
	var parentData ClientData = XTcl_GetChannelInstanceData(tls, parent)

	if offset == int64(0) && mode == SEEK_CUR {
		// This is no seek but a request to tell the caller the current
		// location. Simply pass the request down.

		if parentWideSeekProc != uintptr(0) {
			return (*struct {
				f func(*libc.TLS, ClientData, Tcl_WideInt, int32, uintptr) Tcl_WideInt
			})(unsafe.Pointer(&struct{ uintptr }{parentWideSeekProc})).f(tls, parentData, offset, mode, errorCodePtr)
		}

		return int64((*struct {
			f func(*libc.TLS, ClientData, int64, int32, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{parentSeekProc})).f(tls, parentData, int64(0), mode, errorCodePtr))
	}

	// It is a real request to change the position. Flush all data waiting for
	// output and discard everything in the input buffers. Then pass the
	// request down, unchanged.

	sPreserveData(tls, dataPtr)
	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fmode&(int32(1)<<2) != 0 {
		sExecuteCallback(tls, dataPtr, uintptr(0), ts+35786, uintptr(0), 0, TRANSMIT_DOWN,
			P_NO_PRESERVE)
	}

	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fmode&(int32(1)<<1) != 0 {
		sExecuteCallback(tls, dataPtr, uintptr(0), ts+35835, uintptr(0), 0, TRANSMIT_DONT,
			P_NO_PRESERVE)
		sResultClear(tls, dataPtr+64)
		(*TransformChannelData)(unsafe.Pointer(dataPtr)).FreadIsFlushed = 0
		(*TransformChannelData)(unsafe.Pointer(dataPtr)).FeofPending = 0
	}
	sReleaseData(tls, dataPtr)

	// If we have a wide seek capability, we should stick with that.

	if parentWideSeekProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, ClientData, Tcl_WideInt, int32, uintptr) Tcl_WideInt
		})(unsafe.Pointer(&struct{ uintptr }{parentWideSeekProc})).f(tls, parentData, offset, mode, errorCodePtr)
	}

	// We're transferring to narrow seeks at this point; this is a bit complex
	// because we have to check whether the seek is possible first (i.e.
	// whether we are losing information in truncating the bits of the
	// offset). Luckily, there's a defined error for what happens when trying
	// to go out of the representable range.

	if offset < -0x7fffffffffffffff-1 || offset > 0x7fffffffffffffff {
		*(*int32)(unsafe.Pointer(errorCodePtr)) = EOVERFLOW
		return int64(-1)
	}

	return int64((*struct {
		f func(*libc.TLS, ClientData, int64, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{parentSeekProc})).f(tls, parentData, offset, mode, errorCodePtr))
}

//----------------------------------------------------------------------
//
// TransformSetOptionProc --
//
//	Called by generic layer to handle the reconfiguration of channel
//	specific options. As this channel type does not have such, it simply
//	passes all requests downstream.
//
// Side effects:
//	As defined by the channel downstream.
//
// Result:
//	A standard TCL error code.
//
//----------------------------------------------------------------------

func sTransformSetOptionProc(tls *libc.TLS, instanceData ClientData, interp uintptr, optionName uintptr, value uintptr) int32 { /* tclIOGT.c:1006:1: */
	var dataPtr uintptr = instanceData
	var downChan Tcl_Channel = XTcl_GetStackedChannel(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself)
	var setOptionProc uintptr

	setOptionProc = XTcl_ChannelSetOptionProc(tls, XTcl_GetChannelType(tls, downChan))
	if setOptionProc == uintptr(0) {
		return TCL_ERROR
	}

	return (*struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{setOptionProc})).f(tls, XTcl_GetChannelInstanceData(tls, downChan), interp,
		optionName, value)
}

//----------------------------------------------------------------------
//
// TransformGetOptionProc --
//
//	Called by generic layer to handle requests for the values of channel
//	specific options. As this channel type does not have such, it simply
//	passes all requests downstream.
//
// Side effects:
//	As defined by the channel downstream.
//
// Result:
//	A standard TCL error code.
//
//----------------------------------------------------------------------

func sTransformGetOptionProc(tls *libc.TLS, instanceData ClientData, interp uintptr, optionName uintptr, dsPtr uintptr) int32 { /* tclIOGT.c:1044:1: */
	var dataPtr uintptr = instanceData
	var downChan Tcl_Channel = XTcl_GetStackedChannel(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself)
	var getOptionProc uintptr

	getOptionProc = XTcl_ChannelGetOptionProc(tls, XTcl_GetChannelType(tls, downChan))
	if getOptionProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{getOptionProc})).f(tls, XTcl_GetChannelInstanceData(tls, downChan), interp,
			optionName, dsPtr)
	} else if optionName == uintptr(0) {
		// Request is query for all options, this is ok.

		return TCL_OK
	}

	// Request for a specific option has to fail, since we don't have any.

	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TransformWatchProc --
//
//	Initialize the notifier to watch for events from this channel.
//
// Side effects:
//	Sets up the notifier so that a future event on the channel will be
//	seen by Tcl.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

// ARGSUSED
func sTransformWatchProc(tls *libc.TLS, instanceData ClientData, mask int32) { /* tclIOGT.c:1092:1: */
	var dataPtr uintptr = instanceData
	var downChan Tcl_Channel

	// The caller expressed interest in events occuring for this channel. We
	// are forwarding the call to the underlying channel now.

	(*TransformChannelData)(unsafe.Pointer(dataPtr)).FwatchMask = mask

	// No channel handlers any more. We will be notified automatically about
	// events on the channel below via a call to our 'TransformNotifyProc'.
	// But we have to pass the interest down now. We are allowed to add
	// additional 'interest' to the mask if we want to. But this
	// transformation has no such interest. It just passes the request down,
	// unchanged.

	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself == uintptr(0) {
		return
	}
	downChan = XTcl_GetStackedChannel(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself)

	(*struct {
		f func(*libc.TLS, ClientData, int32)
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ChannelType)(unsafe.Pointer(XTcl_GetChannelType(tls, downChan))).FwatchProc})).f(tls,
		XTcl_GetChannelInstanceData(tls, downChan), mask)

	// Management of the internal timer.

	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer != uintptr(0) && (!(mask&(int32(1)<<1) != 0) || sResultEmpty(tls, dataPtr+64) != 0) {
		// A pending timer exists, but either is there no (more) interest in
		// the events it generates or nothing is available for reading, so
		// remove it.

		XTcl_DeleteTimerHandler(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer)
		(*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer = uintptr(0)
	}

	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer == uintptr(0) && mask&(int32(1)<<1) != 0 &&
		!(sResultEmpty(tls, dataPtr+64) != 0) {
		// There is no pending timer, but there is interest in readable events
		// and we actually have data waiting, so generate a timer to flush
		// that.

		(*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer = XTcl_CreateTimerHandler(tls, FLUSH_DELAY,
			*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sTransformChannelHandlerTimer})), dataPtr)
	}
}

//----------------------------------------------------------------------
//
// TransformGetFileHandleProc --
//
//	Called from Tcl_GetChannelHandle to retrieve OS specific file handle
//	from inside this channel.
//
// Side effects:
//	None.
//
// Result:
//	The appropriate Tcl_File or NULL if not present.
//
//----------------------------------------------------------------------

func sTransformGetFileHandleProc(tls *libc.TLS, instanceData ClientData, direction int32, handlePtr uintptr) int32 { /* tclIOGT.c:1170:1: */
	var dataPtr uintptr = instanceData

	// Return the handle belonging to parent channel. IOW, pass the request
	// down and the result up.

	return XTcl_GetChannelHandle(tls, XTcl_GetStackedChannel(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself),
		direction, handlePtr)
}

//----------------------------------------------------------------------
//
// TransformNotifyProc --
//
//	Handler called by Tcl to inform us of activity on the underlying
//	channel.
//
// Side effects:
//	May process the incoming event by itself.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sTransformNotifyProc(tls *libc.TLS, clientData ClientData, mask int32) int32 { /* tclIOGT.c:1204:1: */
	var dataPtr uintptr = clientData

	// An event occured in the underlying channel. This transformation doesn't
	// process such events thus returns the incoming mask unchanged.

	if (*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer != uintptr(0) {
		// Delete an existing timer. It was not fired, yet we are here, so the
		// channel below generated such an event and we don't have to. The
		// renewal of the interest after the execution of channel handlers
		// will eventually cause us to recreate the timer (in
		// TransformWatchProc).

		XTcl_DeleteTimerHandler(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer)
		(*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer = uintptr(0)
	}
	return mask
}

//----------------------------------------------------------------------
//
// TransformChannelHandlerTimer --
//
//	Called by the notifier (-> timer) to flush out information waiting in
//	the input buffer.
//
// Side effects:
//	As of 'Tcl_NotifyChannel'.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sTransformChannelHandlerTimer(tls *libc.TLS, clientData ClientData) { /* tclIOGT.c:1249:1: */
	var dataPtr uintptr = clientData

	(*TransformChannelData)(unsafe.Pointer(dataPtr)).Ftimer = uintptr(0)
	if !((*TransformChannelData)(unsafe.Pointer(dataPtr)).FwatchMask&(int32(1)<<1) != 0) || sResultEmpty(tls, dataPtr+64) != 0 {
		// The timer fired, but either is there no (more) interest in the
		// events it generates or nothing is available for reading, so ignore
		// it and don't recreate it.

		return
	}
	XTcl_NotifyChannel(tls, (*TransformChannelData)(unsafe.Pointer(dataPtr)).Fself, int32(1)<<1)
}

//----------------------------------------------------------------------
//
// ResultClear --
//
//	Deallocates any memory allocated by 'ResultAdd'.
//
// Side effects:
//	See above.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sResultClear(tls *libc.TLS, r uintptr) { /* tclIOGT.c:1284:1: */
	(*ResultBuffer)(unsafe.Pointer(r)).Fused = uint64(0)

	if (*ResultBuffer)(unsafe.Pointer(r)).Fallocated != 0 {
		XTclpFree(tls, (*ResultBuffer)(unsafe.Pointer(r)).Fbuf)
		(*ResultBuffer)(unsafe.Pointer(r)).Fbuf = uintptr(0)
		(*ResultBuffer)(unsafe.Pointer(r)).Fallocated = uint64(0)
	}
}

//----------------------------------------------------------------------
//
// ResultInit --
//
//	Initializes the specified buffer structure. The structure will contain
//	valid information for an emtpy buffer.
//
// Side effects:
//	See above.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sResultInit(tls *libc.TLS, r uintptr) { /* tclIOGT.c:1314:1: */
	(*ResultBuffer)(unsafe.Pointer(r)).Fused = uint64(0)
	(*ResultBuffer)(unsafe.Pointer(r)).Fallocated = uint64(0)
	(*ResultBuffer)(unsafe.Pointer(r)).Fbuf = uintptr(0)
}

//----------------------------------------------------------------------
//
// ResultEmpty --
//
//	Returns whether the number of bytes stored in the buffer is zero.
//
// Side effects:
//	None.
//
// Result:
//	A boolean.
//
//----------------------------------------------------------------------

func sResultEmpty(tls *libc.TLS, r uintptr) int32 { /* tclIOGT.c:1340:1: */
	return libc.Bool32((*ResultBuffer)(unsafe.Pointer(r)).Fused == uint64(0))
}

//----------------------------------------------------------------------
//
// ResultCopy --
//
//	Copies the requested number of bytes from the buffer into the
//	specified array and removes them from the buffer afterward. Copies
//	less if there is not enough data in the buffer.
//
// Side effects:
//	See above.
//
// Result:
//	The number of actually copied bytes, possibly less than 'toRead'.
//
//----------------------------------------------------------------------

func sResultCopy(tls *libc.TLS, r uintptr, buf uintptr, toRead Size_t) int32 { /* tclIOGT.c:1365:1: */
	if (*ResultBuffer)(unsafe.Pointer(r)).Fused == uint64(0) {
		// Nothing to copy in the case of an empty buffer.

		return 0
	} else if (*ResultBuffer)(unsafe.Pointer(r)).Fused == toRead {
		// We have just enough. Copy everything to the caller.

		libc.Xmemcpy(tls, buf, (*ResultBuffer)(unsafe.Pointer(r)).Fbuf, toRead)
		(*ResultBuffer)(unsafe.Pointer(r)).Fused = uint64(0)
	} else if (*ResultBuffer)(unsafe.Pointer(r)).Fused > toRead {
		// The internal buffer contains more than requested. Copy the
		// requested subset to the caller, and shift the remaining bytes down.

		libc.Xmemcpy(tls, buf, (*ResultBuffer)(unsafe.Pointer(r)).Fbuf, toRead)
		libc.Xmemmove(tls, (*ResultBuffer)(unsafe.Pointer(r)).Fbuf, (*ResultBuffer)(unsafe.Pointer(r)).Fbuf+uintptr(toRead), (*ResultBuffer)(unsafe.Pointer(r)).Fused-toRead)
		*(*Size_t)(unsafe.Pointer(r + 16)) -= toRead
	} else {
		// There is not enough in the buffer to satisfy the caller, so take
		// everything.

		libc.Xmemcpy(tls, buf, (*ResultBuffer)(unsafe.Pointer(r)).Fbuf, (*ResultBuffer)(unsafe.Pointer(r)).Fused)
		toRead = (*ResultBuffer)(unsafe.Pointer(r)).Fused
		(*ResultBuffer)(unsafe.Pointer(r)).Fused = uint64(0)
	}
	return int32(toRead)
}

//----------------------------------------------------------------------
//
// ResultAdd --
//
//	Adds the bytes in the specified array to the buffer, by appending it.
//
// Side effects:
//	See above.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sResultAdd(tls *libc.TLS, r uintptr, buf uintptr, toWrite Size_t) { /* tclIOGT.c:1422:1: */
	if (*ResultBuffer)(unsafe.Pointer(r)).Fused+toWrite > (*ResultBuffer)(unsafe.Pointer(r)).Fallocated {
		// Extension of the internal buffer is required.

		if (*ResultBuffer)(unsafe.Pointer(r)).Fallocated == uint64(0) {
			(*ResultBuffer)(unsafe.Pointer(r)).Fallocated = toWrite + uint64(INCREMENT)
			(*ResultBuffer)(unsafe.Pointer(r)).Fbuf = XTcl_Alloc(tls, uint32((*ResultBuffer)(unsafe.Pointer(r)).Fallocated))
		} else {
			*(*Size_t)(unsafe.Pointer(r + 8)) += toWrite + uint64(INCREMENT)
			(*ResultBuffer)(unsafe.Pointer(r)).Fbuf = XTcl_Realloc(tls, (*ResultBuffer)(unsafe.Pointer(r)).Fbuf, uint32((*ResultBuffer)(unsafe.Pointer(r)).Fallocated))
		}
	}

	// Now we may copy the data.

	libc.Xmemcpy(tls, (*ResultBuffer)(unsafe.Pointer(r)).Fbuf+uintptr((*ResultBuffer)(unsafe.Pointer(r)).Fused), buf, toWrite)
	*(*Size_t)(unsafe.Pointer(r + 16)) += toWrite
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The C layer channel type/driver definition used by the reflection.

var tclRChannelType = Tcl_ChannelType{
	FtypeName:         ts + 35846,
	Fversion:          uintptr(0x5),
	FcloseProc:        0, // Close channel, clean instance data
	FinputProc:        0, // Handle read request
	FoutputProc:       0, // Handle write request
	FseekProc:         0, // Move location of access point.	NULL'able
	FsetOptionProc:    0, // Set options.			NULL'able
	FgetOptionProc:    0, // Get options.			NULL'able
	FwatchProc:        0, // Get OS handle from the channel.	NULL'able
	Fclose2Proc:       0, // No close2 support.		NULL'able
	FblockModeProc:    0, // Handle events.			NULL'able
	FwideSeekProc:     0, // Move access point (64 bit).	NULL'able
	FthreadActionProc: 0, // truncate
} /* tclIORChan.c:64:30 */

// Instance data for a reflected channel. ===========================

type ReflectedChannel = struct {
	Fchan        Tcl_Channel
	Finterp      uintptr
	Fthread      Tcl_ThreadId
	Fowner       Tcl_ThreadId
	Fcmd         uintptr
	Fmethods     uintptr
	Fname        uintptr
	Fmode        int32
	Finterest    int32
	Fdead        int32
	F__ccgo_pad1 [4]byte
} /* tclIORChan.c:131:3 */

// Structure of the table maping from channel handles to reflected
// channels. Each interpreter which has the handler command for one or more
// reflected channels records them in such a table, so that 'chan postevent'
// is able to find them even if the actual channel was moved to a different
// interpreter and/or thread.
//
// The table is reachable via the standard interpreter AssocData, the key is
// defined below.

type ReflectedChannelMap = struct{ Fmap Tcl_HashTable } /* tclIORChan.c:146:3 */

// Event literals. ==================================================

var eventOptions = [3]uintptr{
	ts + 5472, ts + 33034, uintptr(0),
}                         /* tclIORChan.c:154:19 */
type EventOption = uint32 /* tclIORChan.c:159:3 */

// Method literals. ==================================================

var methodNames = [11]uintptr{
	ts + 35858,
	ts + 35867,
	ts + 35872,
	ts + 26108,
	ts + 35880,
	ts + 35889,
	ts + 5472,
	ts + 5477,
	ts + 35900,
	ts + 33034,
	uintptr(0),
}                        /* tclIORChan.c:165:19 */
type MethodName = uint32 /* tclIORChan.c:189:3 */

// Thread specific types and structures.
//
// We are here essentially creating a very specific implementation of 'thread
// send'.

// Enumeration of all operations which can be forwarded.

type ForwardedOperation = uint32 /* tclIORChan.c:227:3 */

// Event used to forward driver invocations to the thread actually managing
// the channel. We cannot construct the command to execute and forward that.
// Because then it will contain a mixture of Tcl_Obj's belonging to both the
// command handler thread (CT), and the thread managing the channel (MT),
// executed in CT. Tcl_Obj's are not allowed to cross thread boundaries. So we
// forward an operation code, the argument details, and reference to results.
// The command is assembled in the CT and belongs fully to that thread. No
// sharing problems.

type ForwardParamBase1 = struct {
	Fcode        int32
	F__ccgo_pad1 [4]byte
	FmsgStr      uintptr
	FmustFree    int32
	F__ccgo_pad2 [4]byte
} /* tclIORChan.c:240:9 */

// Event used to forward driver invocations to the thread actually managing
// the channel. We cannot construct the command to execute and forward that.
// Because then it will contain a mixture of Tcl_Obj's belonging to both the
// command handler thread (CT), and the thread managing the channel (MT),
// executed in CT. Tcl_Obj's are not allowed to cross thread boundaries. So we
// forward an operation code, the argument details, and reference to results.
// The command is assembled in the CT and belongs fully to that thread. No
// sharing problems.

type ForwardParamBase = ForwardParamBase1 /* tclIORChan.c:245:3 */

// Operation specific parameter/result structures. (These are "subtypes" of
// ForwardParamBase. Where an operation does not need any special types, it
// has no "subtype" and just uses ForwardParamBase, as listed above.)

type ForwardParamInput = struct {
	Fbase        ForwardParamBase
	Fbuf         uintptr
	FtoRead      int32
	F__ccgo_pad1 [4]byte
} /* tclIORChan.c:253:1 */

type ForwardParamOutput = struct {
	Fbase        ForwardParamBase
	Fbuf         uintptr
	FtoWrite     int32
	F__ccgo_pad1 [4]byte
} /* tclIORChan.c:259:1 */

type ForwardParamSeek = struct {
	Fbase        ForwardParamBase
	FseekMode    int32
	F__ccgo_pad1 [4]byte
	Foffset      Tcl_WideInt
} /* tclIORChan.c:265:1 */

type ForwardParamWatch = struct {
	Fbase        ForwardParamBase
	Fmask        int32
	F__ccgo_pad1 [4]byte
} /* tclIORChan.c:271:1 */

type ForwardParamBlock = struct {
	Fbase        ForwardParamBase
	Fnonblocking int32
	F__ccgo_pad1 [4]byte
} /* tclIORChan.c:275:1 */

type ForwardParamSetOpt = struct {
	Fbase  ForwardParamBase
	Fname  uintptr
	Fvalue uintptr
} /* tclIORChan.c:279:1 */

type ForwardParamGetOpt = struct {
	Fbase  ForwardParamBase
	Fname  uintptr
	Fvalue uintptr
} /* tclIORChan.c:284:1 */

// Now join all these together in a single union for convenience.

type ForwardParam = struct {
	Fbase        ForwardParamBase
	F__ccgo_pad1 [16]byte
} /* tclIORChan.c:303:3 */

// Forward declaration.

type ForwardingResult1 = struct {
	Fsrc         Tcl_ThreadId
	Fdst         Tcl_ThreadId
	Fdsti        uintptr
	Fdone        Tcl_Condition
	Fresult      int32
	F__ccgo_pad1 [4]byte
	FevPtr       uintptr
	FprevPtr     uintptr
	FnextPtr     uintptr
} /* tclIORChan.c:309:9 */

// Forward declaration.

type ForwardingResult = ForwardingResult1 /* tclIORChan.c:309:33 */

// General event structure, with reference to operation specific data.

type ForwardingEvent = struct {
	Fevent       Tcl_Event
	FresultPtr   uintptr
	Fop          ForwardedOperation
	F__ccgo_pad1 [4]byte
	FrcPtr       uintptr
	Fparam       uintptr
} /* tclIORChan.c:322:3 */

type ThreadSpecificData4 = struct{ FrcmPtr uintptr } /* tclIORChan.c:359:3 */

var dataKey4 Tcl_ThreadDataKey /* tclIORChan.c:361:26: */

// List of forwarded operations which have not completed yet, plus the mutex
// to protect the access to this process global list.

var forwardList uintptr = uintptr(0) /* tclIORChan.c:368:25 */
var rcForwardMutex Tcl_Mutex         /* tclIORChan.c:369:1: */

// Global constant strings (messages). ==================
// These string are used directly as bypass errors, thus they have to be valid
// Tcl lists where the last element is the message itself. Hence the
// list-quoting to keep the words of the message together. See also [x].

var msg_read_toomuch uintptr = ts + 35906     /* "{read delivered ..." */ /* tclIORChan.c:451:19 */
var msg_write_toomuch uintptr = ts + 35943    /* "{write wrote mor..." */ /* tclIORChan.c:452:19 */
var msg_write_nothing uintptr = ts + 35977    /* "{write wrote not..." */ /* tclIORChan.c:453:19 */
var msg_seek_beforestart uintptr = ts + 35999 /* "{Tried to seek b..." */ /* tclIORChan.c:454:19 */
var msg_send_originlost uintptr = ts + 36029  /* "{Channel thread ..." */ /* tclIORChan.c:456:19 */
var msg_send_dstlost uintptr = ts + 36051     /* "{Owner lost}" */        /* tclIORChan.c:458:19 */
var msg_dstlost uintptr = ts + 36064          /* "-code 1 -level 0..." */ /* tclIORChan.c:459:19 */

// Main methods to plug into the 'chan' ensemble'. ==================

//----------------------------------------------------------------------
//
// TclChanCreateObjCmd --
//
//	This function is invoked to process the "chan create" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result. The handle of the new channel is placed in the
//	interp result.
//
// Side effects:
//	Creates a new channel.
//
//----------------------------------------------------------------------

func XTclChanCreateObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIORChan.c:484:1: */
	bp := tls.Alloc(104)
	defer tls.Free(104)

	var rcPtr uintptr // Instance data of the new channel
	var rcId uintptr  // Handle of the new channel
	// var mode int32 at bp+56, 4
	// R/W mode of new channel. Has to match
	// abilities of handler commands
	var cmdObj uintptr // Command prefix, list of words
	// var cmdNameObj uintptr at bp+64, 8
	// Command name
	var chan1 Tcl_Channel // Token for the new channel
	var modeObj uintptr   // mode in obj form for method call
	// var listc int32 at bp+80, 4
	// Result of 'initialize', and of
	// var listv uintptr at bp+88, 8
	// its sublist in the 2nd element
	// var methIndex int32 at bp+96, 4
	// Encoded method name
	var result int32 // Result code for 'initialize'
	// var resObj uintptr at bp+72, 8
	// Result data for 'initialize'
	var methods int32   // Bitmask for supported methods.
	var chanPtr uintptr // 'chan' resolved to internal struct.
	var err uintptr     // Error message
	var rcmPtr uintptr
	// Map of reflected channels with handlers in
	// this interp.
	var hPtr uintptr // Entry in the above map
	// var isNew int32 at bp+100, 4

	var _objPtr uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var cachePtr uintptr
	var _objPtr3 uintptr
	var _objPtr4 uintptr
	// Some of the nullable methods are not supported. We clone the
	// channel type, null the associated C functions, and use the result
	// as the actual channel type.

	var clonePtr uintptr
	var _objPtr5 uintptr
	var _objPtr6 uintptr
	var _objPtr7 uintptr // Placeholder.
	_ = dummy

	// Syntax:   chan create MODE CMDPREFIX
	//           [0]  [1]    [2]  [3]
	//
	// Actually: rCreate MODE CMDPREFIX
	//           [0]     [1]  [2]

	// Number of arguments...

	if !(objc != 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+36137)
	return TCL_ERROR
__1:
	;

	// First argument is a list of modes. Allowed entries are "read", "write".
	// Expect at least one list element. Abbreviations are ok.

	modeObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if !(sEncodeEventMask(tls, interp, ts+12815, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+56) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	// Second argument is command prefix, i.e. list of words, first word is
	// name of handler command, other words are fixed arguments. Run the
	// 'initialize' method to get the list of supported methods. Validate
	// this.

	cmdObj = *(*uintptr)(unsafe.Pointer(objv + 2*8))

	// Basic check that the command prefix truly is a list.

	if !(XTcl_ListObjIndex(tls, interp, cmdObj, 0, bp+64) != TCL_OK) {
		goto __3
	}
	return TCL_ERROR
__3:
	;

	// Now create the channel.

	rcId = sNextHandle(tls)
	rcPtr = sNewReflectedChannel(tls, interp, cmdObj, *(*int32)(unsafe.Pointer(bp + 56 /* mode */)), rcId)

	// Invoke 'initialize' and validate that the handler is present and ok.
	// Squash the channel if not.
	//
	// Note: The conversion of 'mode' back into a Tcl_Obj ensures that
	// 'initialize' is invoked with canonical mode names, and no
	// abbreviations. Using modeObj directly could feed abbreviations into the
	// handler, and the handler is not specified to handle such.

	modeObj = sDecodeEventMask(tls, *(*int32)(unsafe.Pointer(bp + 56 /* mode */)))
	// assert modeObj.refCount == 1
	result = sInvokeTclMethod(tls, rcPtr, uint32(5) /* METH_INIT */, modeObj, uintptr(0), bp+72)
__4:
	_objPtr = modeObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __7
	}
	XTclFreeObj(tls, _objPtr)
__7:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;

	if !(result != TCL_OK) {
		goto __8
	}
	sUnmarshallErrorResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 72 /* resObj */)))
__9:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 72))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __12
	}
	XTclFreeObj(tls, _objPtr1)
__12:
	;
	goto __10
__10:
	if 0 != 0 {
		goto __9
	}
	goto __11
__11:
	; // Remove reference held from invoke
	goto error
__8:
	;

	// Verify the result.
	// - List, of method names. Convert to mask.
	//   Check for non-optionals through the mask.
	//   Compare open mode against optional r/w.

	if !(XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 72)), bp+80, bp+88) != TCL_OK) {
		goto __13
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+36152,
		libc.VaList(bp, XTcl_GetString(tls, cmdObj), XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* resObj */))))))
__14:
	_objPtr2 = *(*uintptr)(unsafe.Pointer(bp + 72))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __17
	}
	XTclFreeObj(tls, _objPtr2)
__17:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	goto error
__13:
	;

	methods = 0
__18:
	if !(*(*int32)(unsafe.Pointer(bp + 80)) > 0) {
		goto __19
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)) + uintptr(*(*int32)(unsafe.Pointer(bp + 80))-1)*8)), uintptr(unsafe.Pointer(&methodNames)), int32(unsafe.Sizeof(uintptr(0))), ts+25917, TCL_EXACT, bp+96) != TCL_OK) {
		goto __20
	}
__21:
	;
__24:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __27
	}
	err = XTclThreadAllocObj(tls)
	goto __28
__27:
	err = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(err + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__28:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
	(*Tcl_Obj)(unsafe.Pointer(err)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1)) == 0) {
		goto __29
	}
	(*Tcl_Obj)(unsafe.Pointer(err)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(err)).Flength = 0
	goto __30
__29:
	(*Tcl_Obj)(unsafe.Pointer(err)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(err)).Fbytes, ts+36203, uint64(int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(err)).Fbytes + 14)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(err)).Flength = int32(uint64(unsafe.Sizeof([15]int8{})) - uint64(1))
__30:
	;
	(*Tcl_Obj)(unsafe.Pointer(err)).FtypePtr = uintptr(0)

	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
	XTcl_AppendObjToObj(tls, err, cmdObj)
	XTcl_AppendToObj(tls, err, ts+36218, -1)
	XTcl_AppendObjToObj(tls, err, XTcl_GetObjResult(tls, interp))
	XTcl_SetObjResult(tls, interp, err)
__31:
	_objPtr3 = *(*uintptr)(unsafe.Pointer(bp + 72))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __34
	}
	XTclFreeObj(tls, _objPtr3)
__34:
	;
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
	goto error
__20:
	;

	methods = methods | int32(1)<<*(*int32)(unsafe.Pointer(bp + 96))
	*(*int32)(unsafe.Pointer(bp + 80 /* listc */))--
	goto __18
__19:
	;
__35:
	_objPtr4 = *(*uintptr)(unsafe.Pointer(bp + 72))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __38
	}
	XTclFreeObj(tls, _objPtr4)
__38:
	;
	goto __36
__36:
	if 0 != 0 {
		goto __35
	}
	goto __37
__37:
	;

	if !((int32(1)<<5|int32(1)<<4|int32(1)<<METH_WATCH)&methods != int32(1)<<5|int32(1)<<4|int32(1)<<METH_WATCH) {
		goto __39
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+36241,
		libc.VaList(bp+16, XTcl_GetString(tls, cmdObj))))
	goto error
__39:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 56))&(int32(1)<<1) != 0 && !(methods&(int32(1)<<METH_READ) != 0)) {
		goto __40
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+36297,
		libc.VaList(bp+24, XTcl_GetString(tls, cmdObj))))
	goto error
__40:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 56))&(int32(1)<<2) != 0 && !(methods&(int32(1)<<9) != 0)) {
		goto __41
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+36337,
		libc.VaList(bp+32, XTcl_GetString(tls, cmdObj))))
	goto error
__41:
	;

	if !!(!(methods&(int32(1)<<METH_CGET) != 0) || methods&(int32(1)<<METH_CGETALL) != 0) {
		goto __42
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+36378,
		libc.VaList(bp+40, XTcl_GetString(tls, cmdObj))))
	goto error
__42:
	;

	if !!(!(methods&(int32(1)<<METH_CGETALL) != 0) || methods&(int32(1)<<METH_CGET) != 0) {
		goto __43
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+36430,
		libc.VaList(bp+48, XTcl_GetString(tls, cmdObj))))
	goto error
__43:
	;

	XTcl_ResetResult(tls, interp)

	// Everything is fine now.

	chan1 = XTcl_CreateChannel(tls, uintptr(unsafe.Pointer(&tclRChannelType)), func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(rcId)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(rcId)).Fbytes
		}
		return XTcl_GetString(tls, rcId)
	}(), rcPtr,
		*(*int32)(unsafe.Pointer(bp + 56 /* mode */)))
	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan = chan1
	XTclChannelPreserve(tls, chan1)
	chanPtr = chan1

	if !(methods&(int32(1)<<METH_BLOCKING|int32(1)<<METH_SEEK|int32(1)<<METH_CONFIGURE|int32(1)<<METH_CGET|int32(1)<<METH_CGETALL) != int32(1)<<METH_BLOCKING|int32(1)<<METH_SEEK|int32(1)<<METH_CONFIGURE|int32(1)<<METH_CGET|int32(1)<<METH_CGETALL) {
		goto __44
	}
	// Some of the nullable methods are not supported. We clone the
	// channel type, null the associated C functions, and use the result
	// as the actual channel type.

	clonePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_ChannelType{})))

	libc.Xmemcpy(tls, clonePtr, uintptr(unsafe.Pointer(&tclRChannelType)), uint64(unsafe.Sizeof(Tcl_ChannelType{})))

	if !!(methods&(int32(1)<<METH_CONFIGURE) != 0) {
		goto __45
	}
	(*Tcl_ChannelType)(unsafe.Pointer(clonePtr)).FsetOptionProc = uintptr(0)
__45:
	;

	if !(!(methods&(int32(1)<<METH_CGET) != 0) && !(methods&(int32(1)<<METH_CGETALL) != 0)) {
		goto __46
	}
	(*Tcl_ChannelType)(unsafe.Pointer(clonePtr)).FgetOptionProc = uintptr(0)
__46:
	;
	if !!(methods&(int32(1)<<METH_BLOCKING) != 0) {
		goto __47
	}
	(*Tcl_ChannelType)(unsafe.Pointer(clonePtr)).FblockModeProc = uintptr(0)
__47:
	;
	if !!(methods&(int32(1)<<METH_SEEK) != 0) {
		goto __48
	}
	(*Tcl_ChannelType)(unsafe.Pointer(clonePtr)).FseekProc = uintptr(0)
	(*Tcl_ChannelType)(unsafe.Pointer(clonePtr)).FwideSeekProc = uintptr(0)
__48:
	;

	(*Channel)(unsafe.Pointer(chanPtr)).FtypePtr = clonePtr
__44:
	;

	// Register the channel in the I/O system, and in our our map for 'chan
	// postevent'.

	XTcl_RegisterChannel(tls, interp, chan1)

	rcmPtr = sGetReflectedChannelMap(tls, interp)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rcmPtr /* &.map */)).FcreateProc})).f(tls, rcmPtr /* &.map */, (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).FchannelName, bp+100 /* &isNew */)
	if !(!(*(*int32)(unsafe.Pointer(bp + 100)) != 0) && chanPtr != (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData) {
		goto __49
	}
	XTcl_Panic(tls, ts+36482, 0)
__49:
	;
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = chan1
	rcmPtr = sGetThreadReflectedChannelMap(tls)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rcmPtr /* &.map */)).FcreateProc})).f(tls, rcmPtr /* &.map */, (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).FchannelName, bp+100 /* &isNew */)
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = chan1

	// Return handle as result of command.

	XTcl_SetObjResult(tls, interp,
		XTcl_NewStringObj(tls, (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(chanPtr)).Fstate)).FchannelName, -1))
	return TCL_OK

error:
__50:
	_objPtr5 = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fname
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __53
	}
	XTclFreeObj(tls, _objPtr5)
__53:
	;
	goto __51
__51:
	if 0 != 0 {
		goto __50
	}
	goto __52
__52:
	;
__54:
	_objPtr6 = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmethods
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr6)).FrefCount, 1) <= 1) {
		goto __57
	}
	XTclFreeObj(tls, _objPtr6)
__57:
	;
	goto __55
__55:
	if 0 != 0 {
		goto __54
	}
	goto __56
__56:
	;
__58:
	_objPtr7 = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fcmd
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr7)).FrefCount, 1) <= 1) {
		goto __61
	}
	XTclFreeObj(tls, _objPtr7)
__61:
	;
	goto __59
__59:
	if 0 != 0 {
		goto __58
	}
	goto __60
__60:
	;
	XTclpFree(tls, rcPtr)
	return TCL_ERROR

}

//----------------------------------------------------------------------
//
// TclChanPostEventObjCmd --
//
//	This function is invoked to process the "chan postevent" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Posts events to a reflected channel, invokes event handlers. The
//	latter implies that arbitrary side effects are possible.
//
//----------------------------------------------------------------------

type ReflectEvent1 = struct {
	Fheader      Tcl_Event
	FrcPtr       uintptr
	Fevents      int32
	F__ccgo_pad1 [4]byte
} /* tclIORChan.c:756:9 */

//----------------------------------------------------------------------
//
// TclChanPostEventObjCmd --
//
//	This function is invoked to process the "chan postevent" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Posts events to a reflected channel, invokes event handlers. The
//	latter implies that arbitrary side effects are possible.
//
//----------------------------------------------------------------------

type ReflectEvent = ReflectEvent1 /* tclIORChan.c:760:3 */

func sReflectEventRun(tls *libc.TLS, ev uintptr, flags int32) int32 { /* tclIORChan.c:763:1: */
	// OWNER thread
	//
	// Note: When the channel is closed any pending events of this type are
	// deleted. See ReflectClose() for the Tcl_DeleteEvents() calls
	// accomplishing that.

	var e uintptr = ev
	_ = flags

	XTcl_NotifyChannel(tls, (*ReflectedChannel)(unsafe.Pointer((*ReflectEvent)(unsafe.Pointer(e)).FrcPtr)).Fchan, (*ReflectEvent)(unsafe.Pointer(e)).Fevents)
	return 1
}

func sReflectEventDelete(tls *libc.TLS, ev uintptr, cd ClientData) int32 { /* tclIORChan.c:782:1: */
	// OWNER thread
	//
	// Invoked by DeleteThreadReflectedChannelMap() and ReflectClose(). The
	// latter ensures that no pending events of this type are run on an
	// invalid channel.

	var e uintptr = ev

	if (*Tcl_Event)(unsafe.Pointer(ev)).Fproc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, int32) int32
	}{sReflectEventRun})) || cd != uintptr(0) && cd != (*ReflectEvent)(unsafe.Pointer(e)).FrcPtr {
		return 0
	}
	return 1
}

func XTclChanPostEventObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIORChan.c:803:1: */
	bp := tls.Alloc(60)
	defer tls.Free(60)

	// Ensure -> HANDLER thread
	//
	// Syntax:   chan postevent CHANNEL EVENTSPEC
	//           [0]  [1]       [2]     [3]
	//
	// Actually: rPostevent CHANNEL EVENTSPEC
	//           [0]        [1]     [2]
	//
	// where EVENTSPEC = {read write ...} (Abbreviations allowed as well).

	var chanId uintptr    // Tcl level channel handle
	var chan1 Tcl_Channel // Channel associated to the handle
	var chanTypePtr uintptr
	// Its associated driver structure
	var rcPtr uintptr // Associated instance data
	// var events int32 at bp+56, 4
	// Mask of events to post
	var rcmPtr uintptr // Map of reflected channels with handlers in
	// this interp.
	var hPtr uintptr // Entry in the above map
	_ = dummy

	// Number of arguments...

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+36527)
		return TCL_ERROR
	}

	// First argument is a channel, a reflected channel, and the call of this
	// command is done from the interp defining the channel handler cmd.

	chanId = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()

	rcmPtr = sGetReflectedChannelMap(tls, interp)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rcmPtr /* &.map */)).FfindProc})).f(tls, rcmPtr /* &.map */, chanId)

	if hPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+36545, libc.VaList(bp, chanId)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+32157, chanId, uintptr(0)))
		return TCL_ERROR
	}

	// Note that the search above subsumes several of the older checks,
	// namely:
	//
	// (1) Does the channel handle refer to a reflected channel?
	// (2) Is the post event issued from the interpreter holding the handler
	//     of the reflected channel?
	//
	// A successful search answers yes to both. Because the map holds only
	// handles of reflected channels, and only of such whose handler is
	// defined in this interpreter.
	//
	// We keep the old checks for both, for paranioa, but abort now instead of
	// throwing errors, as failure now means that our internal datastructures
	// have gone seriously haywire.

	chan1 = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	chanTypePtr = XTcl_GetChannelType(tls, chan1)

	// We use a function referenced by the channel type as our cookie to
	// detect calls to non-reflecting channels. The channel type itself is not
	// suitable, as it might not be the static definition in this file, but a
	// clone thereof. And while we have reserved the name of the type nothing
	// in the core checks against violation, so someone else might have
	// created a channel type using our name, clashing with ourselves.

	if (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FwatchProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sReflectWatch})) {
		XTcl_Panic(tls, ts+36587, 0)
	}

	rcPtr = XTcl_GetChannelInstanceData(tls, chan1)

	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp != interp {
		XTcl_Panic(tls, ts+36646, 0)
	}

	// Second argument is a list of events. Allowed entries are "read",
	// "write". Expect at least one list element. Abbreviations are ok.

	if sEncodeEventMask(tls, interp, ts+35628, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+56) != TCL_OK {
		return TCL_ERROR
	}

	// Check that the channel is actually interested in the provided events.

	if *(*int32)(unsafe.Pointer(bp + 56)) & ^(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterest != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+36723,
			libc.VaList(bp+48, chanId)))
		return TCL_ERROR
	}

	// We have the channel and the events to post.

	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fowner == (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread {
		XTcl_NotifyChannel(tls, chan1, *(*int32)(unsafe.Pointer(bp + 56 /* events */)))
	} else {
		var ev uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ReflectEvent{})))

		(*ReflectEvent)(unsafe.Pointer(ev)).Fheader.Fproc = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, int32) int32
		}{sReflectEventRun}))
		(*ReflectEvent)(unsafe.Pointer(ev)).Fevents = *(*int32)(unsafe.Pointer(bp + 56 /* events */))
		(*ReflectEvent)(unsafe.Pointer(ev)).FrcPtr = rcPtr

		// We are not preserving the structure here. When the channel is
		// closed any pending events are deleted, see ReflectClose(), and
		// ReflectEventDelete(). Trying to preserve and later release when the
		// event is run may generate a situation where the channel structure
		// is deleted but not our structure, crashing in
		// FreeReflectedChannel().
		//
		// Force creation of the RCM, for proper cleanup on thread teardown.
		// The teardown of unprocessed events is currently coupled to the
		// thread reflected channel map

		sGetThreadReflectedChannelMap(tls)

		// XXX Race condition !!
		// XXX The destination thread may not exist anymore already.
		// XXX (Delayed postevent executed after channel got removed).
		// XXX Can we detect this ? (check the validity of the owner threadid ?)
		// XXX Actually, in that case the channel should be dead also !

		XTcl_ThreadQueueEvent(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fowner, ev, TCL_QUEUE_TAIL)
		XTcl_ThreadAlert(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fowner)
	}

	// Squash interp results left by the event script.

	XTcl_ResetResult(tls, interp)
	return TCL_OK

}

// Channel error message marshalling utilities.

func sMarshallError(tls *libc.TLS, interp uintptr) uintptr { /* tclIORChan.c:979:16: */
	// Capture the result status of the interpreter into a string. => List of
	// options and values, followed by the error message. The result has
	// refCount 0.

	var returnOpt uintptr = XTcl_GetReturnOptions(tls, interp, TCL_ERROR)

	// => returnOpt.refCount == 0. We can append directly.

	XTcl_ListObjAppendElement(tls, uintptr(0), returnOpt, XTcl_GetObjResult(tls, interp))
	return returnOpt
}

func sUnmarshallErrorResult(tls *libc.TLS, interp uintptr, msgObj uintptr) { /* tclIORChan.c:1000:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var lc int32 at bp, 4

	// var lv uintptr at bp+8, 8

	var explicitResult int32
	var numOptions int32

	// Process the caught message.
	//
	// Syntax = (option value)... ?message?
	//
	// Bad syntax causes a panic. This is OK because the other side uses
	// Tcl_GetReturnOptions and list construction functions to marshall the
	// information; if we panic here, something has gone badly wrong already.

	if XTcl_ListObjGetElements(tls, interp, msgObj, bp, bp+8) != TCL_OK {
		XTcl_Panic(tls, ts+36778, 0)
	}
	if interp == uintptr(0) {
		return
	}

	explicitResult = *(*int32)(unsafe.Pointer(bp)) & 1 // Odd number of values?
	numOptions = *(*int32)(unsafe.Pointer(bp)) - explicitResult

	if explicitResult != 0 {
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* lv */)) + uintptr(*(*int32)(unsafe.Pointer(bp))-1)*8)))
	}

	XTcl_SetReturnOptions(tls, interp, XTcl_NewListObj(tls, numOptions, *(*uintptr)(unsafe.Pointer(bp + 8 /* lv */))))
	*(*int32)(unsafe.Pointer(interp + 424)) &= libc.CplInt32(ERR_ALREADY_LOGGED)
}

func XTclChanCaughtErrorBypass(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel) int32 { /* tclIORChan.c:1038:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	*(*uintptr)(unsafe.Pointer(bp /* chanMsgObj */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 8 /* interpMsgObj */)) = uintptr(0)
	var msgObj uintptr = uintptr(0)

	// Get a bypassed error message from channel and/or interpreter, save the
	// reference, then kill the returned objects, if there were any. If there
	// are messages in both the channel has preference.

	if chan1 == uintptr(0) && interp == uintptr(0) {
		return 0
	}

	if chan1 != uintptr(0) {
		XTcl_GetChannelError(tls, chan1, bp)
	}
	if interp != uintptr(0) {
		XTcl_GetChannelErrorInterp(tls, interp, bp+8)
	}

	if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
		msgObj = *(*uintptr)(unsafe.Pointer(bp /* chanMsgObj */))
	} else if *(*uintptr)(unsafe.Pointer(bp + 8)) != uintptr(0) {
		msgObj = *(*uintptr)(unsafe.Pointer(bp + 8 /* interpMsgObj */))
	}
	if msgObj != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer(msgObj)).FrefCount++
	}

	if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if *(*uintptr)(unsafe.Pointer(bp + 8)) != uintptr(0) {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	// No message returned, nothing caught.

	if msgObj == uintptr(0) {
		return 0
	}

	sUnmarshallErrorResult(tls, interp, msgObj)

	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = msgObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return 1
}

// Driver functions. ================================================

//----------------------------------------------------------------------
//
// ReflectClose/ReflectClose2 --
//
//	This function is invoked when the channel is closed, to delete the
//	driver specific instance data.
//
// Results:
//	A posix error.
//
// Side effects:
//	Releases memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectClose(tls *libc.TLS, clientData ClientData, interp uintptr) int32 { /* tclIORChan.c:1115:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	var rcPtr uintptr = clientData
	var result int32 // Result code for 'close'
	// var resObj uintptr at bp+80, 8
	// Result data for 'close'
	var rcmPtr uintptr // Map of reflected channels with handlers in
	// this interp
	var hPtr uintptr // Entry in the above map
	var tctPtr uintptr

	if XTclInThreadExit(tls) != 0 {
		// This call comes from TclFinalizeIOSystem. There are no
		// interpreters, and therefore we cannot call upon the handler command
		// anymore. Threading is irrelevant as well. We simply clean up all
		// our C level data structures and leave the Tcl level to the other
		// finalization functions.

		// THREADED => Forward this to the origin thread
		//
		// Note: DeleteThreadReflectedChannelMap() is the thread exit handler
		// for the origin thread. Use this to clean up the structure? Except
		// if lost?

		if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread != XTcl_GetCurrentThread(tls) {
			// var p ForwardParam at bp, 40

			sForwardOpToHandlerThread(tls, rcPtr, uint32(0) /* ForwardedClose */, bp)
			result = (*ForwardParamBase)(unsafe.Pointer(bp)).Fcode

			// Now squash the pending reflection events for this channel.

			XTcl_DeleteEvents(tls, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, ClientData) int32
			}{sReflectEventDelete})), rcPtr)

			if result != TCL_OK {
				if (*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0 {
					XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
				}

			}
		}

		tctPtr = (*Channel)(unsafe.Pointer((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan)).FtypePtr
		if tctPtr != 0 && tctPtr != uintptr(unsafe.Pointer(&tclRChannelType)) {
			XTclpFree(tls, tctPtr)
			(*Channel)(unsafe.Pointer((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan)).FtypePtr = uintptr(0)
		}
		XTcl_EventuallyFree(tls, rcPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sFreeReflectedChannel})))
		return EOK
	}

	// Are we in the correct thread?

	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread != XTcl_GetCurrentThread(tls) {
		// var p ForwardParam at bp+40, 40

		sForwardOpToHandlerThread(tls, rcPtr, uint32(0) /* ForwardedClose */, bp+40)
		result = (*ForwardParamBase)(unsafe.Pointer(bp + 40)).Fcode

		// Now squash the pending reflection events for this channel.

		XTcl_DeleteEvents(tls, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, ClientData) int32
		}{sReflectEventDelete})), rcPtr)

		if result != TCL_OK {
			if interp != uintptr(0) {
				XTcl_SetChannelErrorInterp(tls, interp, XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp+40)).FmsgStr, -1))
			}
			if (*ForwardParamBase)(unsafe.Pointer(bp+40)).FmustFree != 0 {
				XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp+40)).FmsgStr)
			}

		}
	} else {
		result = sInvokeTclMethod(tls, rcPtr, uint32(4) /* METH_FINAL */, uintptr(0), uintptr(0), bp+80)
		if result != TCL_OK && interp != uintptr(0) {
			XTcl_SetChannelErrorInterp(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 80 /* resObj */)))
		}

		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 80))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		} // Remove reference we held from the
		// invoke

		// Remove the channel from the map before releasing the memory, to
		// prevent future accesses (like by 'postevent') from finding and
		// dereferencing a dangling pointer.
		//
		// NOTE: The channel may not be in the map. This is ok, that happens
		// when the channel was created in a different interpreter and/or
		// thread and then was moved here.
		//
		// NOTE: The channel may have been removed from the map already via
		// the per-interp DeleteReflectedChannelMap exit-handler.

		if !((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fdead != 0) {
			rcmPtr = sGetReflectedChannelMap(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp)
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rcmPtr /* &.map */)).FfindProc})).f(tls, rcmPtr /* &.map */, XTcl_GetChannelName(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan))
			if hPtr != 0 {
				XTcl_DeleteHashEntry(tls, hPtr)
			}
		}
		rcmPtr = sGetThreadReflectedChannelMap(tls)
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rcmPtr /* &.map */)).FfindProc})).f(tls, rcmPtr /* &.map */, XTcl_GetChannelName(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan))
		if hPtr != 0 {
			XTcl_DeleteHashEntry(tls, hPtr)
		}
	}
	tctPtr = (*Channel)(unsafe.Pointer((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan)).FtypePtr
	if tctPtr != 0 && tctPtr != uintptr(unsafe.Pointer(&tclRChannelType)) {
		XTclpFree(tls, tctPtr)
		(*Channel)(unsafe.Pointer((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan)).FtypePtr = uintptr(0)
	}
	XTcl_EventuallyFree(tls, rcPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sFreeReflectedChannel})))
	if result == TCL_OK {
		return EOK
	}
	return EINVAL
}

func sReflectClose2(tls *libc.TLS, clientData ClientData, interp uintptr, flags int32) int32 { /* tclIORChan.c:1242:1: */
	if flags&(int32(1)<<1|int32(1)<<2) == 0 {
		return sReflectClose(tls, clientData, interp)
	}
	return EINVAL
}

//----------------------------------------------------------------------
//
// ReflectInput --
//
//	This function is invoked when more data is requested from the channel.
//
// Results:
//	The number of bytes read.
//
// Side effects:
//	Allocates memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectInput(tls *libc.TLS, clientData ClientData, buf uintptr, toRead int32, errorCodePtr uintptr) int32 { /* tclIORChan.c:1270:1: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	var rcPtr uintptr
	var toReadObj uintptr
	// var bytec int32 at bp+48, 4
	// Number of returned bytes
	var bytev uintptr // Array of returned bytes
	// var resObj uintptr at bp+40, 8

	// var p ForwardParam at bp, 40

	var cachePtr uintptr
	var code int32
	var _objPtr uintptr
	var _objPtr1 uintptr
	rcPtr = clientData // Result data for 'read'

	// Are we in the correct thread?

	if !((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread != XTcl_GetCurrentThread(tls)) {
		goto __1
	}

	(*ForwardParamInput)(unsafe.Pointer(bp)).Fbuf = buf
	(*ForwardParamInput)(unsafe.Pointer(bp)).FtoRead = toRead

	sForwardOpToHandlerThread(tls, rcPtr, uint32(1) /* ForwardedInput */, bp)

	if !((*ForwardParamBase)(unsafe.Pointer(bp)).Fcode != TCL_OK) {
		goto __2
	}
	if !((*ForwardParamBase)(unsafe.Pointer(bp)).Fcode < 0) {
		goto __4
	}
	// No error message, this is an errno signal.

	*(*int32)(unsafe.Pointer(errorCodePtr)) = -(*ForwardParamBase)(unsafe.Pointer(bp)).Fcode
	goto __5
__4:
	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr, -1))
	if !((*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0) {
		goto __6
	}
	XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
__6:
	;

	*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
__5:
	;
	(*ForwardParamInput)(unsafe.Pointer(bp)).FtoRead = -1
	goto __3
__2:
	*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
__3:
	;

	return (*ForwardParamInput)(unsafe.Pointer(bp)).FtoRead
__1:
	;

	// ASSERT: rcPtr->method & FLAG(METH_READ)
	// ASSERT: rcPtr->mode & TCL_READABLE

	XTcl_Preserve(tls, rcPtr)

__7:
	;
__10:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __13
	}
	toReadObj = XTclThreadAllocObj(tls)
	goto __14
__13:
	toReadObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(toReadObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__14:
	;
	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
	(*Tcl_Obj)(unsafe.Pointer(toReadObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(toReadObj)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(toReadObj + 32)) = int64(toRead)
	(*Tcl_Obj)(unsafe.Pointer(toReadObj)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __8
__8:
	if 0 != 0 {
		goto __7
	}
	goto __9
__9:
	;
	(*Tcl_Obj)(unsafe.Pointer(toReadObj)).FrefCount++

	if !(sInvokeTclMethod(tls, rcPtr, METH_READ, toReadObj, uintptr(0), bp+40) != TCL_OK) {
		goto __15
	}
	code = sErrnoReturn(tls, rcPtr, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))

	if !(code < 0) {
		goto __16
	}
	*(*int32)(unsafe.Pointer(errorCodePtr)) = -code
	goto error
__16:
	;

	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))
	goto invalid
__15:
	;

	bytev = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)), bp+48)

	if !(toRead < *(*int32)(unsafe.Pointer(bp + 48))) {
		goto __17
	}
	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, XTcl_NewStringObj(tls, msg_read_toomuch, -1))
	goto invalid
__17:
	;

	*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK

	if !(*(*int32)(unsafe.Pointer(bp + 48)) > 0) {
		goto __18
	}
	libc.Xmemcpy(tls, buf, bytev, uint64(*(*int32)(unsafe.Pointer(bp + 48 /* bytec */))))
__18:
	;

stop:
__19:
	_objPtr = toReadObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __22
	}
	XTclFreeObj(tls, _objPtr)
__22:
	;
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
__23:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 40))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __26
	}
	XTclFreeObj(tls, _objPtr1)
__26:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	; // Remove reference held from invoke
	XTcl_Release(tls, rcPtr)
	return *(*int32)(unsafe.Pointer(bp + 48 /* bytec */))
invalid:
	*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
error:
	*(*int32)(unsafe.Pointer(bp + 48 /* bytec */)) = -1
	goto stop
	return int32(0)
}

//----------------------------------------------------------------------
//
// ReflectOutput --
//
//	This function is invoked when data is writen to the channel.
//
// Results:
//	The number of bytes actually written.
//
// Side effects:
//	Allocates memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectOutput(tls *libc.TLS, clientData ClientData, buf uintptr, toWrite int32, errorCodePtr uintptr) int32 { /* tclIORChan.c:1377:1: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	var rcPtr uintptr
	var bufObj uintptr
	// var resObj uintptr at bp+40, 8
	// Result data for 'write'
	// var written int32 at bp+48, 4

	// var p ForwardParam at bp, 40

	var code int32
	var _objPtr uintptr
	var _objPtr1 uintptr
	rcPtr = clientData

	// Are we in the correct thread?

	if !((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread != XTcl_GetCurrentThread(tls)) {
		goto __1
	}

	(*ForwardParamOutput)(unsafe.Pointer(bp)).Fbuf = buf
	(*ForwardParamOutput)(unsafe.Pointer(bp)).FtoWrite = toWrite

	sForwardOpToHandlerThread(tls, rcPtr, uint32(2) /* ForwardedOutput */, bp)

	if !((*ForwardParamBase)(unsafe.Pointer(bp)).Fcode != TCL_OK) {
		goto __2
	}
	if !((*ForwardParamBase)(unsafe.Pointer(bp)).Fcode < 0) {
		goto __4
	}
	// No error message, this is an errno signal.

	*(*int32)(unsafe.Pointer(errorCodePtr)) = -(*ForwardParamBase)(unsafe.Pointer(bp)).Fcode
	goto __5
__4:
	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr, -1))
	if !((*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0) {
		goto __6
	}
	XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
__6:
	;

	*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
__5:
	;
	(*ForwardParamOutput)(unsafe.Pointer(bp)).FtoWrite = -1
	goto __3
__2:
	*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
__3:
	;

	return (*ForwardParamOutput)(unsafe.Pointer(bp)).FtoWrite
__1:
	;

	// ASSERT: rcPtr->method & FLAG(METH_WRITE)
	// ASSERT: rcPtr->mode & TCL_WRITABLE

	XTcl_Preserve(tls, rcPtr)
	XTcl_Preserve(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp)

	bufObj = XTcl_NewByteArrayObj(tls, buf, toWrite)
	(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount++

	if !(sInvokeTclMethod(tls, rcPtr, uint32(9), bufObj, uintptr(0), bp+40) != TCL_OK) {
		goto __7
	}
	code = sErrnoReturn(tls, rcPtr, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))

	if !(code < 0) {
		goto __8
	}
	*(*int32)(unsafe.Pointer(errorCodePtr)) = -code
	goto error
__8:
	;

	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))
	goto invalid
__7:
	;

	if !(XTcl_InterpDeleted(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp) != 0) {
		goto __9
	}
	// The interp was destroyed during InvokeTclMethod().

	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, XTcl_NewStringObj(tls, msg_send_dstlost, -1))
	goto invalid
__9:
	;
	if !(XTcl_GetIntFromObj(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, *(*uintptr)(unsafe.Pointer(bp + 40)), bp+48) != TCL_OK) {
		goto __10
	}
	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, sMarshallError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp))
	goto invalid
__10:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 48)) == 0 && toWrite > 0) {
		goto __11
	}
	// The handler claims to have written nothing of what it was given.
	// That is bad.

	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, XTcl_NewStringObj(tls, msg_write_nothing, -1))
	goto invalid
__11:
	;
	if !(toWrite < *(*int32)(unsafe.Pointer(bp + 48))) {
		goto __12
	}
	// The handler claims to have written more than it was given. That is
	// bad. Note that the I/O core would crash if we were to return this
	// information, trying to write -nnn bytes in the next iteration.

	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, XTcl_NewStringObj(tls, msg_write_toomuch, -1))
	goto invalid
__12:
	;

	*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
stop:
__13:
	_objPtr = bufObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __16
	}
	XTclFreeObj(tls, _objPtr)
__16:
	;
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
__17:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 40))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __20
	}
	XTclFreeObj(tls, _objPtr1)
__20:
	;
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	; // Remove reference held from invoke
	XTcl_Release(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp)
	XTcl_Release(tls, rcPtr)
	return *(*int32)(unsafe.Pointer(bp + 48 /* written */))
invalid:
	*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
error:
	*(*int32)(unsafe.Pointer(bp + 48 /* written */)) = -1
	goto stop
	return int32(0)
}

//----------------------------------------------------------------------
//
// ReflectSeekWide / ReflectSeek --
//
//	This function is invoked when the user wishes to seek on the channel.
//
// Results:
//	The new location of the access point.
//
// Side effects:
//	Allocates memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectSeekWide(tls *libc.TLS, clientData ClientData, offset Tcl_WideInt, seekMode int32, errorCodePtr uintptr) Tcl_WideInt { /* tclIORChan.c:1506:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	var rcPtr uintptr
	var offObj uintptr
	var baseObj uintptr
	// var resObj uintptr at bp+40, 8
	// Result for 'seek'
	// var newLoc Tcl_WideInt at bp+48, 8

	// var p ForwardParam at bp, 40

	var _objPtr uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	rcPtr = clientData

	// Are we in the correct thread?

	if !((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread != XTcl_GetCurrentThread(tls)) {
		goto __1
	}

	(*ForwardParamSeek)(unsafe.Pointer(bp)).FseekMode = seekMode
	(*ForwardParamSeek)(unsafe.Pointer(bp)).Foffset = offset

	sForwardOpToHandlerThread(tls, rcPtr, ForwardedSeek, bp)

	if !((*ForwardParamBase)(unsafe.Pointer(bp)).Fcode != TCL_OK) {
		goto __2
	}
	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr, -1))
	if !((*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0) {
		goto __4
	}
	XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
__4:
	;

	*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
	(*ForwardParamSeek)(unsafe.Pointer(bp)).Foffset = int64(-1)
	goto __3
__2:
	*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
__3:
	;

	return (*ForwardParamSeek)(unsafe.Pointer(bp)).Foffset
__1:
	;

	// ASSERT: rcPtr->method & FLAG(METH_SEEK)

	XTcl_Preserve(tls, rcPtr)

	offObj = XTcl_NewWideIntObj(tls, offset)
	baseObj = XTcl_NewStringObj(tls,
		func() uintptr {
			if seekMode == SEEK_SET {
				return ts + 34713 /* "start" */
			}
			return func() uintptr {
				if seekMode == SEEK_CUR {
					return ts + 34719 /* "current" */
				}
				return ts + 18768 /* "end" */
			}()
		}(), -1)
	(*Tcl_Obj)(unsafe.Pointer(offObj)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(baseObj)).FrefCount++

	if !(sInvokeTclMethod(tls, rcPtr, METH_SEEK, offObj, baseObj, bp+40) != TCL_OK) {
		goto __5
	}
	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))
	goto invalid
__5:
	;

	if !(XTcl_GetWideIntFromObj(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, *(*uintptr)(unsafe.Pointer(bp + 40)), bp+48) != TCL_OK) {
		goto __6
	}
	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, sMarshallError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp))
	goto invalid
__6:
	;

	if !(*(*Tcl_WideInt)(unsafe.Pointer(bp + 48)) < int64(0)) {
		goto __7
	}
	XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, XTcl_NewStringObj(tls, msg_seek_beforestart, -1))
	goto invalid
__7:
	;

	*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
stop:
__8:
	_objPtr = offObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __11
	}
	XTclFreeObj(tls, _objPtr)
__11:
	;
	goto __9
__9:
	if 0 != 0 {
		goto __8
	}
	goto __10
__10:
	;
__12:
	_objPtr1 = baseObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __15
	}
	XTclFreeObj(tls, _objPtr1)
__15:
	;
	goto __13
__13:
	if 0 != 0 {
		goto __12
	}
	goto __14
__14:
	;
__16:
	_objPtr2 = *(*uintptr)(unsafe.Pointer(bp + 40))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __19
	}
	XTclFreeObj(tls, _objPtr2)
__19:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	; // Remove reference held from invoke
	XTcl_Release(tls, rcPtr)
	return *(*Tcl_WideInt)(unsafe.Pointer(bp + 48 /* newLoc */))
invalid:
	*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
	*(*Tcl_WideInt)(unsafe.Pointer(bp + 48 /* newLoc */)) = int64(-1)
	goto stop
	return Tcl_WideInt(0)
}

func sReflectSeek(tls *libc.TLS, clientData ClientData, offset int64, seekMode int32, errorCodePtr uintptr) int32 { /* tclIORChan.c:1582:1: */
	// This function can be invoked from a transformation which is based on
	// standard seeking, i.e. non-wide. Because of this we have to implement
	// it, a dummy is not enough. We simply delegate the call to the wide
	// routine.

	return int32(sReflectSeekWide(tls, clientData, offset, seekMode,
		errorCodePtr))
}

//----------------------------------------------------------------------
//
// ReflectWatch --
//
//	This function is invoked to tell the channel what events the I/O
//	system is interested in.
//
// Results:
//	None.
//
// Side effects:
//	Allocates memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectWatch(tls *libc.TLS, clientData ClientData, mask int32) { /* tclIORChan.c:1617:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var rcPtr uintptr = clientData
	var maskObj uintptr

	// We restrict the interest to what the channel can support. IOW there
	// will never be write events for a channel which is not writable.
	// Analoguously for read events and non-readable channels.

	mask = mask & (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmode

	if mask == (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterest {
		// Same old, same old, why should we do something?

		return
	}

	// Are we in the correct thread?

	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread != XTcl_GetCurrentThread(tls) {
		// var p ForwardParam at bp, 40

		(*ForwardParamWatch)(unsafe.Pointer(bp)).Fmask = mask
		sForwardOpToHandlerThread(tls, rcPtr, ForwardedWatch, bp)

		// Any failure from the forward is ignored. We have no place to put
		// this.

		return
	}

	XTcl_Preserve(tls, rcPtr)

	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterest = mask
	maskObj = sDecodeEventMask(tls, mask)
	// assert maskObj.refCount == 1
	sInvokeTclMethod(tls, rcPtr, METH_WATCH, maskObj, uintptr(0), uintptr(0))
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = maskObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	XTcl_Release(tls, rcPtr)
}

//----------------------------------------------------------------------
//
// ReflectBlock --
//
//	This function is invoked to tell the channel which blocking behaviour
//	is required of it.
//
// Results:
//	A posix error number.
//
// Side effects:
//	Allocates memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectBlock(tls *libc.TLS, clientData ClientData, nonblocking int32) int32 { /* tclIORChan.c:1689:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var rcPtr uintptr = clientData
	var blockObj uintptr
	var errorNum int32 // EINVAL or EOK (success).
	// var resObj uintptr at bp+40, 8
	// Result data for 'blocking'

	// Are we in the correct thread?

	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread != XTcl_GetCurrentThread(tls) {
		// var p ForwardParam at bp, 40

		(*ForwardParamBlock)(unsafe.Pointer(bp)).Fnonblocking = nonblocking

		sForwardOpToHandlerThread(tls, rcPtr, ForwardedBlock, bp)

		if (*ForwardParamBase)(unsafe.Pointer(bp)).Fcode != TCL_OK {
			XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr, -1))
			if (*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0 {
				XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
			}

			return EINVAL
		}

		return EOK
	}

	blockObj = XTcl_NewIntObj(tls, libc.Bool32(libc.BoolInt32(!(nonblocking != 0)) != 0))
	(*Tcl_Obj)(unsafe.Pointer(blockObj)).FrefCount++

	XTcl_Preserve(tls, rcPtr)

	if sInvokeTclMethod(tls, rcPtr, METH_BLOCKING, blockObj, uintptr(0), bp+40) != TCL_OK {
		XTcl_SetChannelError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))
		errorNum = EINVAL
	} else {
		errorNum = EOK
	}

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = blockObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	} // Remove reference held from invoke

	XTcl_Release(tls, rcPtr)
	return errorNum
}

//----------------------------------------------------------------------
//
// ReflectThread --
//
//	This function is invoked to tell the channel about thread movements.
//
// Results:
//	None.
//
// Side effects:
//	Allocates memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectThread(tls *libc.TLS, clientData ClientData, action int32) { /* tclIORChan.c:1756:1: */
	var rcPtr uintptr = clientData

	switch action {
	case 0:
		(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fowner = XTcl_GetCurrentThread(tls)
		break
	case 1:
		(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fowner = uintptr(0)
		break
	default:
		XTcl_Panic(tls, ts+36832, 0)
		break
	}
}

//----------------------------------------------------------------------
//
// ReflectSetOption --
//
//	This function is invoked to configure a channel option.
//
// Results:
//	A standard Tcl result code.
//
// Side effects:
//	Arbitrary, as it calls upon a Tcl script.
//
//----------------------------------------------------------------------

func sReflectSetOption(tls *libc.TLS, clientData ClientData, interp uintptr, optionName uintptr, newValue uintptr) int32 { /* tclIORChan.c:1793:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var rcPtr uintptr = clientData
	var optionObj uintptr
	var valueObj uintptr
	var result int32 // Result code for 'configure'
	// var resObj uintptr at bp+40, 8
	// Result data for 'configure'

	// Are we in the correct thread?

	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread != XTcl_GetCurrentThread(tls) {
		// var p ForwardParam at bp, 40

		(*ForwardParamSetOpt)(unsafe.Pointer(bp)).Fname = optionName
		(*ForwardParamSetOpt)(unsafe.Pointer(bp)).Fvalue = newValue

		sForwardOpToHandlerThread(tls, rcPtr, ForwardedSetOpt, bp)

		if (*ForwardParamBase)(unsafe.Pointer(bp)).Fcode != TCL_OK {
			var err uintptr = XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr, -1)

			sUnmarshallErrorResult(tls, interp, err)
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = err
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			if (*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0 {
				XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
			}

		}

		return (*ForwardParamBase)(unsafe.Pointer(bp)).Fcode
	}
	XTcl_Preserve(tls, rcPtr)

	optionObj = XTcl_NewStringObj(tls, optionName, -1)
	valueObj = XTcl_NewStringObj(tls, newValue, -1)

	(*Tcl_Obj)(unsafe.Pointer(optionObj)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(valueObj)).FrefCount++

	result = sInvokeTclMethod(tls, rcPtr, METH_CONFIGURE, optionObj, valueObj, bp+40)
	if result != TCL_OK {
		sUnmarshallErrorResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))
	}

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = optionObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = valueObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	} // Remove reference held from invoke
	XTcl_Release(tls, rcPtr)
	return result
}

//----------------------------------------------------------------------
//
// ReflectGetOption --
//
//	This function is invoked to retrieve all or a channel option.
//
// Results:
//	A standard Tcl result code.
//
// Side effects:
//	Arbitrary, as it calls upon a Tcl script.
//
//----------------------------------------------------------------------

func sReflectGetOption(tls *libc.TLS, clientData ClientData, interp uintptr, optionName uintptr, dsPtr uintptr) int32 { /* tclIORChan.c:1865:1: */
	bp := tls.Alloc(84)
	defer tls.Free(84)

	// This code is special. It has regular passing of Tcl result, and errors.
	// The bypass functions are not required.

	var rcPtr uintptr
	var optionObj uintptr
	// var resObj uintptr at bp+56, 8
	// Result data for 'configure'
	// var listc int32 at bp+64, 4

	var result int32
	// var listv uintptr at bp+72, 8

	var method MethodName
	var _objPtr uintptr
	var err uintptr
	var opcode int32
	// var p ForwardParam at bp+16, 40

	// var len int32 at bp+80, 4

	var str uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	rcPtr = clientData
	result = TCL_OK

	// Are we in the correct thread?

	if !((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread != XTcl_GetCurrentThread(tls)) {
		goto __1
	}

	(*ForwardParamGetOpt)(unsafe.Pointer(bp + 16)).Fname = optionName
	(*ForwardParamGetOpt)(unsafe.Pointer(bp + 16)).Fvalue = dsPtr

	if !(optionName == uintptr(0)) {
		goto __2
	}
	opcode = ForwardedGetOptAll
	goto __3
__2:
	opcode = ForwardedGetOpt
__3:
	;

	sForwardOpToHandlerThread(tls, rcPtr, uint32(opcode), bp+16)

	if !((*ForwardParamBase)(unsafe.Pointer(bp+16)).Fcode != TCL_OK) {
		goto __4
	}
	err = XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp+16)).FmsgStr, -1)

	sUnmarshallErrorResult(tls, interp, err)
__5:
	_objPtr = err
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __8
	}
	XTclFreeObj(tls, _objPtr)
__8:
	;
	goto __6
__6:
	if 0 != 0 {
		goto __5
	}
	goto __7
__7:
	;
	if !((*ForwardParamBase)(unsafe.Pointer(bp+16)).FmustFree != 0) {
		goto __9
	}
	XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp+16)).FmsgStr)
__9:
	;

__4:
	;

	return (*ForwardParamBase)(unsafe.Pointer(bp + 16)).Fcode
__1:
	;

	if !(optionName == uintptr(0)) {
		goto __10
	}
	// Retrieve all options.

	method = METH_CGETALL
	optionObj = uintptr(0)
	goto __11
__10:
	// Retrieve the value of one option.

	method = METH_CGET
	optionObj = XTcl_NewStringObj(tls, optionName, -1)
	(*Tcl_Obj)(unsafe.Pointer(optionObj)).FrefCount++
__11:
	;

	XTcl_Preserve(tls, rcPtr)

	if !(sInvokeTclMethod(tls, rcPtr, method, optionObj, uintptr(0), bp+56) != TCL_OK) {
		goto __12
	}
	sUnmarshallErrorResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 56 /* resObj */)))
	goto error
__12:
	;

	// The result has to go into the 'dsPtr' for propagation to the caller of
	// the driver.

	if !(optionObj != uintptr(0)) {
		goto __13
	}
	XTclDStringAppendObj(tls, dsPtr, *(*uintptr)(unsafe.Pointer(bp + 56 /* resObj */)))
	goto ok
__13:
	;

	// Extract the list and append each item as element.

	// NOTE (4): If we extract the string rep we can assume a properly quoted
	// string. Together with a separating space this way of simply appending
	// the whole string rep might be faster. It also doesn't check if the
	// result is a valid list. Nor that the list has an even number elements.

	if !(XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 56)), bp+64, bp+72) != TCL_OK) {
		goto __14
	}
	goto error
__14:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 64))%2 == 1) {
		goto __15
	}
	// Odd number of elements is wrong.

	XTcl_ResetResult(tls, interp)
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+36860, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 64 /* listc */)),
			func() uintptr {
				if *(*int32)(unsafe.Pointer(bp + 64)) == 1 {
					return ts + 2046 /* "" */
				}
				return ts + 22784 /* "s" */
			}())))
	goto error
	goto __16
__15:
	str = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* resObj */)), bp+80)

	if !(*(*int32)(unsafe.Pointer(bp + 80)) != 0) {
		goto __17
	}
	XTcl_DStringAppend(tls, dsPtr, ts+14299, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
	XTcl_DStringAppend(tls, dsPtr, str, *(*int32)(unsafe.Pointer(bp + 80 /* len */)))
__17:
	;
	goto ok
__16:
	;

ok:
	result = TCL_OK
stop:
	if !(optionObj != 0) {
		goto __18
	}
__19:
	_objPtr1 = optionObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __22
	}
	XTclFreeObj(tls, _objPtr1)
__22:
	;
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
__18:
	;
__23:
	_objPtr2 = *(*uintptr)(unsafe.Pointer(bp + 56))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __26
	}
	XTclFreeObj(tls, _objPtr2)
__26:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	; // Remove reference held from invoke
	XTcl_Release(tls, rcPtr)
	return result
error:
	result = TCL_ERROR
	goto stop
	return int32(0)
}

// Helpers. =========================================================

//----------------------------------------------------------------------
//
// EncodeEventMask --
//
//	This function takes a list of event items and constructs the
//	equivalent internal bitmask. The list must contain at least one
//	element. Elements are "read", "write", or any unique abbreviation of
//	them. Note that the bitmask is not changed if problems are
//	encountered.
//
// Results:
//	A standard Tcl error code. A bitmask where TCL_READABLE and/or
//	TCL_WRITABLE can be set.
//
// Side effects:
//	May shimmer 'obj' to a list representation. May place an error message
//	into the interp result.
//
//----------------------------------------------------------------------

func sEncodeEventMask(tls *libc.TLS, interp uintptr, objName uintptr, obj uintptr, mask uintptr) int32 { /* tclIORChan.c:2027:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var events int32 // Mask of events to post
	// var listc int32 at bp+8, 4
	// #elements in eventspec list
	// var listv uintptr at bp+16, 8
	// Elements of eventspec list
	// var evIndex int32 at bp+24, 4
	// Id of event for an element of the eventspec
	// list.

	if XTcl_ListObjGetElements(tls, interp, obj, bp+8, bp+16) != TCL_OK {
		return TCL_ERROR
	}

	if *(*int32)(unsafe.Pointer(bp + 8)) < 1 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+36929, libc.VaList(bp, objName)))
		return TCL_ERROR
	}

	events = 0
	for *(*int32)(unsafe.Pointer(bp + 8)) > 0 {
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(*(*int32)(unsafe.Pointer(bp + 8))-1)*8)), uintptr(unsafe.Pointer(&eventOptions)), int32(unsafe.Sizeof(uintptr(0))), objName, 0, bp+24) != TCL_OK {
			return TCL_ERROR
		}
		switch *(*int32)(unsafe.Pointer(bp + 24 /* evIndex */)) {
		case EVENT_READ:
			events = events | int32(1)<<1
			break
		case EVENT_WRITE:
			events = events | int32(1)<<2
			break
		}
		*(*int32)(unsafe.Pointer(bp + 8 /* listc */))--
	}

	*(*int32)(unsafe.Pointer(mask)) = events
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DecodeEventMask --
//
//	This function takes an internal bitmask of events and constructs the
//	equivalent list of event items.
//
// Results, Contract:
//	A Tcl_Obj reference. The object will have a refCount of one. The user
//	has to decrement it to release the object.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sDecodeEventMask(tls *libc.TLS, mask int32) uintptr { /* tclIORChan.c:2088:16: */
	var eventStr uintptr
	var evObj uintptr

	switch mask & (int32(1)<<1 | int32(1)<<2) {
	case int32(1)<<1 | int32(1)<<2:
		eventStr = ts + 36951 /* "read write" */
		break
	case int32(1) << 1:
		eventStr = ts + 5472 /* "read" */
		break
	case int32(1) << 2:
		eventStr = ts + 33034 /* "write" */
		break
	default:
		eventStr = ts + 2046 /* "" */
		break
	}

	evObj = XTcl_NewStringObj(tls, eventStr, -1)
	(*Tcl_Obj)(unsafe.Pointer(evObj)).FrefCount++
	// assert evObj.refCount == 1
	return evObj
}

//----------------------------------------------------------------------
//
// NewReflectedChannel --
//
//	This function is invoked to allocate and initialize the instance data
//	of a new reflected channel.
//
// Results:
//	A heap-allocated channel instance.
//
// Side effects:
//	Allocates memory.
//
//----------------------------------------------------------------------

func sNewReflectedChannel(tls *libc.TLS, interp uintptr, cmdpfxObj uintptr, mode int32, handleObj uintptr) uintptr { /* tclIORChan.c:2133:25: */
	var rcPtr uintptr
	var mn MethodName = METH_BLOCKING

	rcPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ReflectedChannel{})))

	// rcPtr->chan: Assigned by caller. Dummy data here.

	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan = uintptr(0)
	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp = interp
	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fdead = 0
	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread = XTcl_GetCurrentThread(tls)
	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmode = mode
	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterest = 0 // Initially no interest registered

	// ASSERT: cmdpfxObj is a Tcl List
	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fcmd = XTclListObjCopy(tls, uintptr(0), cmdpfxObj)
	(*Tcl_Obj)(unsafe.Pointer((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fcmd)).FrefCount++
	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmethods = XTcl_NewListObj(tls, 9+1, uintptr(0))
	for mn <= MethodName(9) {
		XTcl_ListObjAppendElement(tls, uintptr(0), (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmethods,
			XTcl_NewStringObj(tls, methodNames[libc.PostIncUint32(&mn, 1)], -1))
	}
	(*Tcl_Obj)(unsafe.Pointer((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmethods)).FrefCount++
	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fname = handleObj
	(*Tcl_Obj)(unsafe.Pointer((*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fname)).FrefCount++
	return rcPtr
}

//----------------------------------------------------------------------
//
// NextHandle --
//
//	This function is invoked to generate a channel handle for a new
//	reflected channel.
//
// Results:
//	A Tcl_Obj containing the string of the new channel handle. The
//	refcount of the returned object is -- zero --.
//
// Side effects:
//	May allocate memory. Mutex protected critical section locks out other
//	threads for a short time.
//
//----------------------------------------------------------------------

func sNextHandle(tls *libc.TLS) uintptr { /* tclIORChan.c:2189:16: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var resObj uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rcCounterMutex)))
	resObj = XTcl_ObjPrintf(tls, ts+36962, libc.VaList(bp, rcCounter))
	rcCounter++
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rcCounterMutex)))

	return resObj
}

var rcCounterMutex Tcl_Mutex     /* tclIORChan.c:2200:5: */
var rcCounter uint64 = uint64(0) /* tclIORChan.c:2201:26 */

func sFreeReflectedChannel(tls *libc.TLS, rcPtr uintptr) { /* tclIORChan.c:2213:1: */
	var chanPtr uintptr = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan

	XTclChannelRelease(tls, chanPtr)
	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fname != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fname
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmethods != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmethods
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fcmd != 0 {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fcmd
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	XTclpFree(tls, rcPtr)
}

//----------------------------------------------------------------------
//
// InvokeTclMethod --
//
//	This function is used to invoke the Tcl level of a reflected channel.
//	It handles all the command assembly, invokation, and generic state and
//	result mgmt. It does *not* handle thread redirection; that is the
//	responsibility of clients of this function.
//
// Results:
//	Result code and data as returned by the method.
//
// Side effects:
//	Arbitrary, as it calls upon a Tcl script.
//
// Contract:
//	argOneObj.refCount >= 1 on entry and exit, if argOneObj != NULL
//	argTwoObj.refCount >= 1 on entry and exit, if argTwoObj != NULL
//	resObj.refCount in {0, 1, ...}
//
//----------------------------------------------------------------------

func sInvokeTclMethod(tls *libc.TLS, rcPtr uintptr, method MethodName, argOneObj uintptr, argTwoObj uintptr, resultObjPtr uintptr) int32 { /* tclIORChan.c:2256:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	*(*uintptr)(unsafe.Pointer(bp + 16 /* methObj */)) = uintptr(0) // Method name in object form
	var sr Tcl_InterpState                                          // State of handler interp
	var result int32                                                // Result code of method invokation
	var resObj uintptr = uintptr(0)                                 // Result of method invokation.
	var cmd uintptr

	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fdead != 0 {
		// The channel is marked as dead. Bail out immediately, with an
		// appropriate error.

		if resultObjPtr != uintptr(0) {
			resObj = XTcl_NewStringObj(tls, msg_dstlost, -1)
			*(*uintptr)(unsafe.Pointer(resultObjPtr)) = resObj
			(*Tcl_Obj)(unsafe.Pointer(resObj)).FrefCount++
		}

		// Not touching argOneObj, argTwoObj, they have not been used.
		// See the contract as well.

		return TCL_ERROR
	}

	// Insert method into the callback command, after the command prefix,
	// before the channel id.

	cmd = XTclListObjCopy(tls, uintptr(0), (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fcmd)

	XTcl_ListObjIndex(tls, uintptr(0), (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmethods, int32(method), bp+16)
	XTcl_ListObjAppendElement(tls, uintptr(0), cmd, *(*uintptr)(unsafe.Pointer(bp + 16 /* methObj */)))
	XTcl_ListObjAppendElement(tls, uintptr(0), cmd, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fname)

	// Append the additional argument containing method specific details
	// behind the channel id. If specified.
	//
	// Because of the contract there is no need to increment the refcounts.
	// The objects will survive the Tcl_EvalObjv without change.

	if argOneObj != 0 {
		XTcl_ListObjAppendElement(tls, uintptr(0), cmd, argOneObj)
		if argTwoObj != 0 {
			XTcl_ListObjAppendElement(tls, uintptr(0), cmd, argTwoObj)
		}
	}

	// And run the handler... This is done in auch a manner which leaves any
	// existing state intact.

	(*Tcl_Obj)(unsafe.Pointer(cmd)).FrefCount++
	sr = XTcl_SaveInterpState(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, 0)
	XTcl_Preserve(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp)
	result = XTcl_EvalObjEx(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, cmd, TCL_EVAL_GLOBAL)

	// We do not try to extract the result information if the caller has no
	// interest in it. I.e. there is no need to put effort into creating
	// something which is discarded immediately after.

	if resultObjPtr != 0 {
		if result == TCL_OK {
			// Ok result taken as is, also if the caller requests that there
			// is no capture.

			resObj = XTcl_GetObjResult(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp)
		} else {
			// Non-ok result is always treated as an error. We have to capture
			// the full state of the result, including additional options.
			//
			// This is complex and ugly, and would be completely unnecessary
			// if we only added support for a TCL_FORBID_EXCEPTIONS flag.

			if result != TCL_ERROR {
				// var cmdLen int32 at bp+24, 4

				var cmdString uintptr = XTcl_GetStringFromObj(tls, cmd, bp+24)

				(*Tcl_Obj)(unsafe.Pointer(cmd)).FrefCount++
				XTcl_ResetResult(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp)
				XTcl_SetObjResult(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, XTcl_ObjPrintf(tls,
					ts+36968, libc.VaList(bp, result)))
				XTcl_LogCommandInfo(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, cmdString, cmdString,
					*(*int32)(unsafe.Pointer(bp + 24 /* cmdLen */)))
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = cmd
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				result = TCL_ERROR
			}
			XTcl_AppendObjToErrorInfo(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, XTcl_ObjPrintf(tls,
				ts+37003,
				libc.VaList(bp+8, methodNames[method])))
			resObj = sMarshallError(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp)
		}
		(*Tcl_Obj)(unsafe.Pointer(resObj)).FrefCount++
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = cmd
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTcl_RestoreInterpState(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, sr)
	XTcl_Release(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp)

	// The resObj has a ref count of 1 at this location. This means that the
	// caller of InvokeTclMethod has to dispose of it (but only if it was
	// returned to it).

	if resultObjPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(resultObjPtr)) = resObj
	}

	// There no need to handle the case where nothing is returned, because for
	// that case resObj was not set anyway.

	return result
}

//----------------------------------------------------------------------
//
// ErrnoReturn --
//
//	Checks a method error result if it returned an 'errno'.
//
// Results:
//	The negative errno found in the error result, or 0.
//
// Side effects:
//	None.
//
// Users:
//	ReflectInput/Output(), to enable the signaling of EAGAIN on 0-sized
//	short reads/writes.
//
//----------------------------------------------------------------------

func sErrnoReturn(tls *libc.TLS, rcPtr uintptr, resObj uintptr) int32 { /* tclIORChan.c:2411:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var code int32 at bp, 4

	var sr Tcl_InterpState // State of handler interp

	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fdead != 0 {
		return 0
	}

	sr = XTcl_SaveInterpState(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, 0)
	sUnmarshallErrorResult(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, resObj)

	resObj = XTcl_GetObjResult(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp)

	if XTcl_GetIntFromObj(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, resObj, bp) != TCL_OK ||
		*(*int32)(unsafe.Pointer(bp)) >= 0 {
		if libc.Xstrcmp(tls, ts+37039, XTcl_GetString(tls, resObj)) == 0 {
			*(*int32)(unsafe.Pointer(bp /* code */)) = -EAGAIN
		} else {
			*(*int32)(unsafe.Pointer(bp /* code */)) = 0
		}
	}

	XTcl_RestoreInterpState(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp, sr)
	return *(*int32)(unsafe.Pointer(bp /* code */))
}

//----------------------------------------------------------------------
//
// GetReflectedChannelMap --
//
//	Gets and potentially initializes the reflected channel map for an
//	interpreter.
//
// Results:
//	A pointer to the map created, for use by the caller.
//
// Side effects:
//	Initializes the reflected channel map for an interpreter.
//
//----------------------------------------------------------------------

func sGetReflectedChannelMap(tls *libc.TLS, interp uintptr) uintptr { /* tclIORChan.c:2457:28: */
	var rcmPtr uintptr = XTcl_GetAssocData(tls, interp, ts+37046, uintptr(0))

	if rcmPtr == uintptr(0) {
		rcmPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ReflectedChannelMap{})))
		XTcl_InitHashTable(tls, rcmPtr, 0)
		XTcl_SetAssocData(tls, interp, ts+37046,
			*(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr)
			}{sDeleteReflectedChannelMap})), rcmPtr)
	}
	return rcmPtr
}

//----------------------------------------------------------------------
//
// DeleteReflectedChannelMap --
//
//	Deletes the channel table for an interpreter, closing any open
//	channels whose refcount reaches zero. This procedure is invoked when
//	an interpreter is deleted, via the AssocData cleanup mechanism.
//
// Results:
//	None.
//
// Side effects:
//	Deletes the hash table of channels. May close channels. May flush
//	output on closed channels. Removes any channeEvent handlers that were
//	registered in this interpreter.
//
//----------------------------------------------------------------------

func sMarkDead(tls *libc.TLS, rcPtr uintptr) { /* tclIORChan.c:2493:1: */
	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fdead != 0 {
		return
	}
	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fname != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fname
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fname = uintptr(0)
	}
	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmethods != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmethods
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fmethods = uintptr(0)
	}
	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fcmd != 0 {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fcmd
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fcmd = uintptr(0)
	}
	(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fdead = 1
}

func sDeleteReflectedChannelMap(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclIORChan.c:2515:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var rcmPtr uintptr = clientData
	// The map
	// var hSearch Tcl_HashSearch at bp, 24
	// Search variable.
	var hPtr uintptr // Search variable.
	var rcPtr uintptr
	var chan1 Tcl_Channel
	var resultPtr uintptr
	var evPtr uintptr
	var paramPtr uintptr

	// Delete all entries. The channels may have been closed already, or will
	// be closed later, by the standard IO finalization of an interpreter
	// under destruction. Except for the channels which were moved to a
	// different interpreter and/or thread. They do not exist from the IO
	// systems point of view and will not get closed. Therefore mark all as
	// dead so that any future access will cause a proper error. For channels
	// in a different thread we actually do the same as
	// DeleteThreadReflectedChannelMap(), just restricted to the channels of
	// this interp.

	for hPtr = XTcl_FirstHashEntry(tls, rcmPtr, bp); hPtr != uintptr(0); hPtr = XTcl_FirstHashEntry(tls, rcmPtr, bp) {
		chan1 = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		rcPtr = XTcl_GetChannelInstanceData(tls, chan1)

		sMarkDead(tls, rcPtr)
		XTcl_DeleteHashEntry(tls, hPtr)
	}
	XTcl_DeleteHashTable(tls, rcmPtr)
	XTclpFree(tls, rcmPtr)

	// The origin interpreter for one or more reflected channels is gone.

	// Go through the list of pending results and cancel all whose events were
	// destined for this interpreter. While this is in progress we block any
	// other access to the list of pending results.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rcForwardMutex)))

	for resultPtr = forwardList; resultPtr != uintptr(0); resultPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr {
		if (*ForwardingResult)(unsafe.Pointer(resultPtr)).Fdsti != interp {
			// Ignore results/events for other interpreters.

			continue
		}

		// The receiver for the event exited, before processing the event. We
		// detach the result now, wake the originator up and signal failure.
		//
		// Attention: Results may have been detached already, by either the
		// receiver, or this thread, as part of other parts in the thread
		// teardown. Such results are ignored. See ticket [b47b176adf] for the
		// identical race condition in Tcl 8.6 IORTrans.

		evPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr

		// Basic crash safety until this routine can get revised [3411310]

		if evPtr == uintptr(0) {
			continue
		}
		paramPtr = (*ForwardingEvent)(unsafe.Pointer(evPtr)).Fparam
		if !(evPtr != 0) {
			continue
		}

		(*ForwardingEvent)(unsafe.Pointer(evPtr)).FresultPtr = uintptr(0)
		(*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr = uintptr(0)
		(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult = TCL_ERROR

		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 0
		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = msg_send_dstlost

		XTcl_ConditionNotify(tls, resultPtr+24)
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rcForwardMutex)))

	// Get the map of all channels handled by the current thread. This is a
	// ReflectedChannelMap, but on a per-thread basis, not per-interp. Go
	// through the channels and remove all which were handled by this
	// interpreter. They have already been marked as dead.

	rcmPtr = sGetThreadReflectedChannelMap(tls)
	for hPtr = XTcl_FirstHashEntry(tls, rcmPtr, bp); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
		chan1 = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		rcPtr = XTcl_GetChannelInstanceData(tls, chan1)

		if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp != interp {
			// Ignore entries for other interpreters.

			continue
		}

		sMarkDead(tls, rcPtr)
		XTcl_DeleteHashEntry(tls, hPtr)
	}
}

//----------------------------------------------------------------------
//
// GetThreadReflectedChannelMap --
//
//	Gets and potentially initializes the reflected channel map for a
//	thread.
//
// Results:
//	A pointer to the map created, for use by the caller.
//
// Side effects:
//	Initializes the reflected channel map for a thread.
//
//----------------------------------------------------------------------

func sGetThreadReflectedChannelMap(tls *libc.TLS) uintptr { /* tclIORChan.c:2659:28: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey4)), int32(unsafe.Sizeof(ThreadSpecificData4{})))

	if !(int32((*ThreadSpecificData4)(unsafe.Pointer(tsdPtr)).FrcmPtr) != 0) {
		(*ThreadSpecificData4)(unsafe.Pointer(tsdPtr)).FrcmPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ReflectedChannelMap{})))
		XTcl_InitHashTable(tls, (*ThreadSpecificData4)(unsafe.Pointer(tsdPtr)).FrcmPtr, 0)
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteThreadReflectedChannelMap})), uintptr(0))
	}

	return (*ThreadSpecificData4)(unsafe.Pointer(tsdPtr)).FrcmPtr
}

//----------------------------------------------------------------------
//
// DeleteThreadReflectedChannelMap --
//
//	Deletes the channel table for a thread. This procedure is invoked when
//	a thread is deleted. The channels have already been marked as dead, in
//	DeleteReflectedChannelMap().
//
// Results:
//	None.
//
// Side effects:
//	Deletes the hash table of channels.
//
//----------------------------------------------------------------------

func sDeleteThreadReflectedChannelMap(tls *libc.TLS, dummy ClientData) { /* tclIORChan.c:2692:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var hSearch Tcl_HashSearch at bp, 24
	// Search variable.
	var hPtr uintptr // Search variable.
	var self Tcl_ThreadId = XTcl_GetCurrentThread(tls)
	var rcmPtr uintptr // The map
	var resultPtr uintptr
	_ = dummy

	// The origin thread for one or more reflected channels is gone.
	// NOTE: If this function is called due to a thread getting killed the
	//       per-interp DeleteReflectedChannelMap is apparently not called.

	// Go through the list of pending results and cancel all whose events were
	// destined for this thread. While this is in progress we block any other
	// access to the list of pending results.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rcForwardMutex)))

	for resultPtr = forwardList; resultPtr != uintptr(0); resultPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr {
		var evPtr uintptr
		var paramPtr uintptr

		if (*ForwardingResult)(unsafe.Pointer(resultPtr)).Fdst != self {
			// Ignore results/events for other threads.

			continue
		}

		// The receiver for the event exited, before processing the event. We
		// detach the result now, wake the originator up and signal failure.
		//
		// Attention: Results may have been detached already, by either the
		// receiver, or this thread, as part of other parts in the thread
		// teardown. Such results are ignored. See ticket [b47b176adf] for the
		// identical race condition in Tcl 8.6 IORTrans.

		evPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr

		// Basic crash safety until this routine can get revised [3411310]

		if evPtr == uintptr(0) {
			continue
		}
		paramPtr = (*ForwardingEvent)(unsafe.Pointer(evPtr)).Fparam
		if !(evPtr != 0) {
			continue
		}

		(*ForwardingEvent)(unsafe.Pointer(evPtr)).FresultPtr = uintptr(0)
		(*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr = uintptr(0)
		(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult = TCL_ERROR

		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 0
		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = msg_send_dstlost

		XTcl_ConditionNotify(tls, resultPtr+24)
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rcForwardMutex)))

	// Run over the event queue of this thread and remove all ReflectEvent's
	// still pending. These are inbound events for reflected channels this
	// thread owns but doesn't handle. The inverse of the channel map
	// actually.

	XTcl_DeleteEvents(tls, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, ClientData) int32
	}{sReflectEventDelete})), uintptr(0))

	// Get the map of all channels handled by the current thread. This is a
	// ReflectedChannelMap, but on a per-thread basis, not per-interp. Go
	// through the channels, remove all, mark them as dead.

	rcmPtr = sGetThreadReflectedChannelMap(tls)
	for hPtr = XTcl_FirstHashEntry(tls, rcmPtr, bp); hPtr != uintptr(0); hPtr = XTcl_FirstHashEntry(tls, rcmPtr, bp) {
		var chan1 Tcl_Channel = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		var rcPtr uintptr = XTcl_GetChannelInstanceData(tls, chan1)

		sMarkDead(tls, rcPtr)
		XTcl_DeleteHashEntry(tls, hPtr)
	}
	XTclpFree(tls, rcmPtr)
}

func sForwardOpToHandlerThread(tls *libc.TLS, rcPtr uintptr, op ForwardedOperation, param uintptr) { /* tclIORChan.c:2793:1: */
	// Core of the communication from OWNER to HANDLER thread. The receiver is
	// ForwardProc() below.

	var dst Tcl_ThreadId = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fthread
	var evPtr uintptr
	var resultPtr uintptr

	// We gather the lock early. This allows us to check the liveness of the
	// channel without interference from DeleteThreadReflectedChannelMap().

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rcForwardMutex)))

	if (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fdead != 0 {
		// The channel is marked as dead. Bail out immediately, with an
		// appropriate error. Do not forget to unlock the mutex on this path.

		(*ForwardParamBase)(unsafe.Pointer(param)).Fcode = TCL_ERROR
		(*ForwardParamBase)(unsafe.Pointer(param)).FmustFree = 0
		(*ForwardParamBase)(unsafe.Pointer(param)).FmsgStr = msg_send_dstlost
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rcForwardMutex)))
		return
	}

	// Create and initialize the event and data structures.

	evPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ForwardingEvent{})))
	resultPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ForwardingResult{})))

	(*ForwardingEvent)(unsafe.Pointer(evPtr)).Fevent.Fproc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, int32) int32
	}{sForwardProc}))
	(*ForwardingEvent)(unsafe.Pointer(evPtr)).FresultPtr = resultPtr
	(*ForwardingEvent)(unsafe.Pointer(evPtr)).Fop = op
	(*ForwardingEvent)(unsafe.Pointer(evPtr)).FrcPtr = rcPtr
	(*ForwardingEvent)(unsafe.Pointer(evPtr)).Fparam = param

	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fsrc = XTcl_GetCurrentThread(tls)
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fdst = dst
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fdsti = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fdone = uintptr(0)
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult = -1
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr = evPtr

	// Now execute the forward.

	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr = forwardList
	if forwardList != uintptr(0) {
		(*ForwardingResult)(unsafe.Pointer(forwardList)).FprevPtr = resultPtr
	}
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FprevPtr = uintptr(0)
	forwardList = resultPtr

	// Do not unlock here. That is done by the ConditionWait.

	// Ensure cleanup of the event if the origin thread exits while this event
	// is pending or in progress. Exit of the destination thread is handled by
	// DeleteThreadReflectedChannelMap(), this is set up by
	// GetThreadReflectedChannelMap(). This is what we use the 'forwardList'
	// (see above) for.

	XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sSrcExitProc})), evPtr)

	// Queue the event and poke the other thread's notifier.

	XTcl_ThreadQueueEvent(tls, dst, evPtr, TCL_QUEUE_TAIL)
	XTcl_ThreadAlert(tls, dst)

	// (*) Block until the handler thread has either processed the transfer or
	// rejected it.

	for (*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult < 0 {
		// NOTE (1): Is it possible that the current thread goes away while
		// waiting here? IOW Is it possible that "SrcExitProc" is called while
		// we are here? See complementary note (2) in "SrcExitProc"
		//
		// The ConditionWait unlocks the mutex during the wait and relocks it
		// immediately after.

		XTcl_ConditionWait(tls, resultPtr+24, uintptr(unsafe.Pointer(&rcForwardMutex)), uintptr(0))
	}

	// Unlink result from the forwarder list. No need to lock. Either still
	// locked, or locked by the ConditionWait

	if (*ForwardingResult)(unsafe.Pointer(resultPtr)).FprevPtr != uintptr(0) {
		(*ForwardingResult)(unsafe.Pointer((*ForwardingResult)(unsafe.Pointer(resultPtr)).FprevPtr)).FnextPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr
	} else {
		forwardList = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr
	}
	if (*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr != uintptr(0) {
		(*ForwardingResult)(unsafe.Pointer((*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr)).FprevPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FprevPtr
	}

	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr = uintptr(0)
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FprevPtr = uintptr(0)

	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rcForwardMutex)))
	XTcl_ConditionFinalize(tls, resultPtr+24)

	// Kill the cleanup handler now, and the result structure as well, before
	// returning the success code.
	//
	// Note: The event structure has already been deleted.

	XTcl_DeleteThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sSrcExitProc})), evPtr)

	XTclpFree(tls, resultPtr)
}

func sForwardProc(tls *libc.TLS, evGPtr uintptr, mask int32) int32 { /* tclIORChan.c:2916:1: */
	bp := tls.Alloc(60)
	defer tls.Free(60)

	//
	//  HANDLER thread.
	//
	//      * The receiver part for the operations coming from the OWNER thread.
	//      * See ForwardOpToHandlerThread() for the transmitter.
	//      *
	//      * Notes regarding access to the referenced data.
	//      *
	//      * In principle the data belongs to the originating thread (see
	//      * evPtr->src), however this thread is currently blocked at (*), i.e.,
	//      * quiescent. Because of this we can treat the data as belonging to us,
	//      * without fear of race conditions. I.e. we can read and write as we like.
	//      *
	//      * The only thing we cannot be sure of is the resultPtr. This can be be
	//      * NULLed if the originating thread went away while the event is handled
	//      * here now.
	//

	var evPtr uintptr = evGPtr
	var resultPtr uintptr = (*ForwardingEvent)(unsafe.Pointer(evPtr)).FresultPtr
	var rcPtr uintptr = (*ForwardingEvent)(unsafe.Pointer(evPtr)).FrcPtr
	var interp uintptr = (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterp
	var paramPtr uintptr = (*ForwardingEvent)(unsafe.Pointer(evPtr)).Fparam
	*(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)) = uintptr(0) // Interp result of InvokeTclMethod
	var rcmPtr uintptr                                             // Map of reflected channels with handlers in
	// this interp.
	var hPtr uintptr // Entry in the above map
	_ = mask

	// Ignore the event if no one is waiting for its result anymore.

	if !(resultPtr != 0) {
		return 1
	}

	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_OK
	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = uintptr(0)
	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 0

	switch (*ForwardingEvent)(unsafe.Pointer(evPtr)).Fop {
	// The destination thread for the following operations is
	// rcPtr->thread, which contains rcPtr->interp, the interp we have to
	// call upon for the driver.

	case ForwardedOperation(0) /* ForwardedClose */ :
		{
			// No parameters/results.

			if sInvokeTclMethod(tls, rcPtr, uint32(4), uintptr(0), uintptr(0), bp+16) != TCL_OK {
				sForwardSetObjError(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
			}

			// Freeing is done here, in the origin thread, callback command
			// objects belong to this thread. Deallocating them in a different
			// thread is not allowed
			//
			// We remove the channel from both interpreter and thread maps before
			// releasing the memory, to prevent future accesses (like by
			// 'postevent') from finding and dereferencing a dangling pointer.

			rcmPtr = sGetReflectedChannelMap(tls, interp)
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rcmPtr /* &.map */)).FfindProc})).f(tls, rcmPtr /* &.map */, XTcl_GetChannelName(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan))
			XTcl_DeleteHashEntry(tls, hPtr)

			rcmPtr = sGetThreadReflectedChannelMap(tls)
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rcmPtr /* &.map */)).FfindProc})).f(tls, rcmPtr /* &.map */, XTcl_GetChannelName(tls, (*ReflectedChannel)(unsafe.Pointer(rcPtr)).Fchan))
			XTcl_DeleteHashEntry(tls, hPtr)
			sMarkDead(tls, rcPtr)
			break

		}

	case ForwardedOperation(1) /* ForwardedInput */ :
		{
			var toReadObj uintptr

			for ok := true; ok; ok = 0 != 0 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						toReadObj = XTclThreadAllocObj(tls)
					} else {
						toReadObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(toReadObj + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(toReadObj)).FrefCount = 0
				(*Tcl_Obj)(unsafe.Pointer(toReadObj)).Fbytes = uintptr(0)
				*(*int64)(unsafe.Pointer(toReadObj + 32)) = int64((*ForwardParamInput)(unsafe.Pointer(paramPtr)).FtoRead)
				(*Tcl_Obj)(unsafe.Pointer(toReadObj)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
				{
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(toReadObj)).FrefCount++

			XTcl_Preserve(tls, rcPtr)
			if sInvokeTclMethod(tls, rcPtr, METH_READ, toReadObj, uintptr(0), bp+16) != TCL_OK {
				var code int32 = sErrnoReturn(tls, rcPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))

				if code < 0 {
					(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = code
				} else {
					sForwardSetObjError(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
				}
				(*ForwardParamInput)(unsafe.Pointer(paramPtr)).FtoRead = -1
			} else {
				// Process a regular result.

				// var bytec int32 at bp+24, 4
				// Number of returned bytes
				var bytev uintptr // Array of returned bytes

				bytev = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)), bp+24)

				if (*ForwardParamInput)(unsafe.Pointer(paramPtr)).FtoRead < *(*int32)(unsafe.Pointer(bp + 24)) {
					(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
					(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 0
					(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = msg_read_toomuch
					(*ForwardParamInput)(unsafe.Pointer(paramPtr)).FtoRead = -1
				} else {
					if *(*int32)(unsafe.Pointer(bp + 24)) > 0 {
						libc.Xmemcpy(tls, (*ForwardParamInput)(unsafe.Pointer(paramPtr)).Fbuf, bytev, uint64(*(*int32)(unsafe.Pointer(bp + 24 /* bytec */))))
					}
					(*ForwardParamInput)(unsafe.Pointer(paramPtr)).FtoRead = *(*int32)(unsafe.Pointer(bp + 24 /* bytec */))
				}
			}
			XTcl_Release(tls, rcPtr)
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = toReadObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			break

		}

	case ForwardedOperation(2) /* ForwardedOutput */ :
		{
			var bufObj uintptr = XTcl_NewByteArrayObj(tls, (*ForwardParamOutput)(unsafe.Pointer(paramPtr)).Fbuf, (*ForwardParamOutput)(unsafe.Pointer(paramPtr)).FtoWrite)
			(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount++

			XTcl_Preserve(tls, rcPtr)
			if sInvokeTclMethod(tls, rcPtr, uint32(9), bufObj, uintptr(0), bp+16) != TCL_OK {
				var code int32 = sErrnoReturn(tls, rcPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))

				if code < 0 {
					(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = code
				} else {
					sForwardSetObjError(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
				}
				(*ForwardParamOutput)(unsafe.Pointer(paramPtr)).FtoWrite = -1
			} else {
				// Process a regular result.

				// var written int32 at bp+28, 4

				if XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+28) != TCL_OK {
					for ok3 := true; ok3; ok3 = 0 != 0 {
						var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 16))
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
					*(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)) = sMarshallError(tls, interp)
					sForwardSetObjError(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
					(*ForwardParamOutput)(unsafe.Pointer(paramPtr)).FtoWrite = -1
				} else if *(*int32)(unsafe.Pointer(bp + 28)) == 0 || (*ForwardParamOutput)(unsafe.Pointer(paramPtr)).FtoWrite < *(*int32)(unsafe.Pointer(bp + 28)) {
					(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
					(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 0
					(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = msg_write_toomuch
					(*ForwardParamOutput)(unsafe.Pointer(paramPtr)).FtoWrite = -1
				} else {
					(*ForwardParamOutput)(unsafe.Pointer(paramPtr)).FtoWrite = *(*int32)(unsafe.Pointer(bp + 28 /* written */))
				}
			}
			XTcl_Release(tls, rcPtr)
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _objPtr uintptr = bufObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			break

		}

	case ForwardedSeek:
		{
			var offObj uintptr = XTcl_NewWideIntObj(tls, (*ForwardParamSeek)(unsafe.Pointer(paramPtr)).Foffset)
			var baseObj uintptr = XTcl_NewStringObj(tls,
				func() uintptr {
					if (*ForwardParamSeek)(unsafe.Pointer(paramPtr)).FseekMode == SEEK_SET {
						return ts + 34713 /* "start" */
					}
					return func() uintptr {
						if (*ForwardParamSeek)(unsafe.Pointer(paramPtr)).FseekMode == SEEK_CUR {
							return ts + 34719 /* "current" */
						}
						return ts + 18768 /* "end" */
					}()
				}(), -1)

			(*Tcl_Obj)(unsafe.Pointer(offObj)).FrefCount++
			(*Tcl_Obj)(unsafe.Pointer(baseObj)).FrefCount++

			XTcl_Preserve(tls, rcPtr)
			if sInvokeTclMethod(tls, rcPtr, METH_SEEK, offObj, baseObj, bp+16) != TCL_OK {
				sForwardSetObjError(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
				(*ForwardParamSeek)(unsafe.Pointer(paramPtr)).Foffset = int64(-1)
			} else {
				// Process a regular result. If the type is wrong this may change
				// into an error.

				// var newLoc Tcl_WideInt at bp+32, 8

				if XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+32) == TCL_OK {
					if *(*Tcl_WideInt)(unsafe.Pointer(bp + 32)) < int64(0) {
						(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
						(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 0
						(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = msg_seek_beforestart
						(*ForwardParamSeek)(unsafe.Pointer(paramPtr)).Foffset = int64(-1)
					} else {
						(*ForwardParamSeek)(unsafe.Pointer(paramPtr)).Foffset = *(*Tcl_WideInt)(unsafe.Pointer(bp + 32 /* newLoc */))
					}
				} else {
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 16))
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
					*(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)) = sMarshallError(tls, interp)
					sForwardSetObjError(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
					(*ForwardParamSeek)(unsafe.Pointer(paramPtr)).Foffset = int64(-1)
				}
			}
			XTcl_Release(tls, rcPtr)
			for ok6 := true; ok6; ok6 = 0 != 0 {
				var _objPtr uintptr = offObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objPtr uintptr = baseObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			break

		}

	case ForwardedWatch:
		{
			var maskObj uintptr = sDecodeEventMask(tls, (*ForwardParamWatch)(unsafe.Pointer(paramPtr)).Fmask)
			// assert maskObj.refCount == 1

			XTcl_Preserve(tls, rcPtr)
			(*ReflectedChannel)(unsafe.Pointer(rcPtr)).Finterest = (*ForwardParamWatch)(unsafe.Pointer(paramPtr)).Fmask
			sInvokeTclMethod(tls, rcPtr, METH_WATCH, maskObj, uintptr(0), uintptr(0))
			for ok8 := true; ok8; ok8 = 0 != 0 {
				var _objPtr uintptr = maskObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			XTcl_Release(tls, rcPtr)
			break

		}

	case ForwardedBlock:
		{
			var blockObj uintptr = XTcl_NewIntObj(tls, libc.Bool32(libc.BoolInt32(!((*ForwardParamBlock)(unsafe.Pointer(paramPtr)).Fnonblocking != 0)) != 0))

			(*Tcl_Obj)(unsafe.Pointer(blockObj)).FrefCount++
			XTcl_Preserve(tls, rcPtr)
			if sInvokeTclMethod(tls, rcPtr, METH_BLOCKING, blockObj, uintptr(0),
				bp+16) != TCL_OK {
				sForwardSetObjError(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
			}
			XTcl_Release(tls, rcPtr)
			for ok9 := true; ok9; ok9 = 0 != 0 {
				var _objPtr uintptr = blockObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			break

		}

	case ForwardedSetOpt:
		{
			var optionObj uintptr = XTcl_NewStringObj(tls, (*ForwardParamSetOpt)(unsafe.Pointer(paramPtr)).Fname, -1)
			var valueObj uintptr = XTcl_NewStringObj(tls, (*ForwardParamSetOpt)(unsafe.Pointer(paramPtr)).Fvalue, -1)

			(*Tcl_Obj)(unsafe.Pointer(optionObj)).FrefCount++
			(*Tcl_Obj)(unsafe.Pointer(valueObj)).FrefCount++
			XTcl_Preserve(tls, rcPtr)
			if sInvokeTclMethod(tls, rcPtr, METH_CONFIGURE, optionObj, valueObj,
				bp+16) != TCL_OK {
				sForwardSetObjError(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
			}
			XTcl_Release(tls, rcPtr)
			for ok10 := true; ok10; ok10 = 0 != 0 {
				var _objPtr uintptr = optionObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var _objPtr uintptr = valueObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			break

		}

	case ForwardedGetOpt:
		{
			// Retrieve the value of one option.

			var optionObj uintptr = XTcl_NewStringObj(tls, (*ForwardParamGetOpt)(unsafe.Pointer(paramPtr)).Fname, -1)

			(*Tcl_Obj)(unsafe.Pointer(optionObj)).FrefCount++
			XTcl_Preserve(tls, rcPtr)
			if sInvokeTclMethod(tls, rcPtr, METH_CGET, optionObj, uintptr(0), bp+16) != TCL_OK {
				sForwardSetObjError(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
			} else {
				XTclDStringAppendObj(tls, (*ForwardParamGetOpt)(unsafe.Pointer(paramPtr)).Fvalue, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
			}
			XTcl_Release(tls, rcPtr)
			for ok12 := true; ok12; ok12 = 0 != 0 {
				var _objPtr uintptr = optionObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			break

		}

	case ForwardedGetOptAll:
		// Retrieve all options.

		XTcl_Preserve(tls, rcPtr)
		if sInvokeTclMethod(tls, rcPtr, METH_CGETALL, uintptr(0), uintptr(0), bp+16) != TCL_OK {
			sForwardSetObjError(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
		} else {
			// Extract list, validate that it is a list, and #elements. See
			// NOTE (4) as well.

			// var listc int32 at bp+40, 4

			// var listv uintptr at bp+48, 8

			if XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+40,
				bp+48) != TCL_OK {
				for ok13 := true; ok13; ok13 = 0 != 0 {
					var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 16))
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				*(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)) = sMarshallError(tls, interp)
				sForwardSetObjError(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)))
			} else if *(*int32)(unsafe.Pointer(bp + 40))%2 == 1 {
				// Odd number of elements is wrong. [x].

				var buf uintptr = XTcl_Alloc(tls, uint32(200))
				libc.Xsprintf(tls, buf,
					ts+37066,
					libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 40 /* listc */)), func() uintptr {
						if *(*int32)(unsafe.Pointer(bp + 40)) == 1 {
							return ts + 37130 /* "element" */
						}
						return ts + 37138 /* "elements" */
					}()))

				(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
				(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 1
				(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = buf
			} else {
				// var len int32 at bp+56, 4

				var str uintptr = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* resObj */)), bp+56)

				if *(*int32)(unsafe.Pointer(bp + 56)) != 0 {
					XTcl_DStringAppend(tls, (*ForwardParamGetOpt)(unsafe.Pointer(paramPtr)).Fvalue, ts+14299, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
					XTcl_DStringAppend(tls, (*ForwardParamGetOpt)(unsafe.Pointer(paramPtr)).Fvalue, str, *(*int32)(unsafe.Pointer(bp + 56 /* len */)))
				}
			}
		}
		XTcl_Release(tls, rcPtr)
		break

	default:
		// Bad operation code.

		XTcl_Panic(tls, ts+37147, 0)
		break
	}

	// Remove the reference we held on the result of the invoke, if we had
	// such.

	if *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0) {
		for ok14 := true; ok14; ok14 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 16))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	if resultPtr != 0 {
		// Report the forwarding result synchronously to the waiting caller.
		// This unblocks (*) as well. This is wrapped into a conditional
		// because the caller may have exited in the mean time.

		XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rcForwardMutex)))
		(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult = TCL_OK
		XTcl_ConditionNotify(tls, resultPtr+24)
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rcForwardMutex)))
	}

	return 1
}

func sSrcExitProc(tls *libc.TLS, clientData ClientData) { /* tclIORChan.c:3264:1: */
	var evPtr uintptr = clientData
	var resultPtr uintptr
	var paramPtr uintptr

	// NOTE (2): Can this handler be called with the originator blocked?

	// The originator for the event exited. It is not sure if this can happen,
	// as the originator should be blocked at (*) while the event is in
	// transit/pending.
	//
	// We make sure that the event cannot refer to the result anymore, remove
	// it from the list of pending results and free the structure. Locking the
	// access ensures that we cannot get in conflict with "ForwardProc",
	// should it already execute the event.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rcForwardMutex)))

	resultPtr = (*ForwardingEvent)(unsafe.Pointer(evPtr)).FresultPtr
	paramPtr = (*ForwardingEvent)(unsafe.Pointer(evPtr)).Fparam

	(*ForwardingEvent)(unsafe.Pointer(evPtr)).FresultPtr = uintptr(0)
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr = uintptr(0)
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult = TCL_ERROR

	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 0
	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = msg_send_originlost

	// See below: TclSpliceOut(resultPtr, forwardList);

	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rcForwardMutex)))

	// This unlocks (*). The structure will be spliced out and freed by
	// "ForwardProc". Maybe.

	XTcl_ConditionNotify(tls, resultPtr+24)
}

func sForwardSetObjError(tls *libc.TLS, paramPtr uintptr, obj uintptr) { /* tclIORChan.c:3312:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var len int32 at bp, 4

	var msgStr uintptr = XTcl_GetStringFromObj(tls, obj, bp)

	*(*int32)(unsafe.Pointer(bp /* len */))++
	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 1
	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp))))
	libc.Xmemcpy(tls, (*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr, msgStr, uint64(*(*int32)(unsafe.Pointer(bp /* len */))))
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// indent-tabs-mode: nil
// End:

// The C layer channel type/driver definition used by the reflection.

var tclRTransformType = Tcl_ChannelType{
	FtypeName:      ts + 37181,
	Fversion:       uintptr(0x5),
	FcloseProc:     0, // Close channel, clean instance data.
	FinputProc:     0, // Handle read request.
	FoutputProc:    0, // Handle write request.
	FseekProc:      0, // Move location of access point.
	FsetOptionProc: 0, // Set options.
	FgetOptionProc: 0, // Get options.
	FwatchProc:     0, // Initialize notifier.
	FgetHandleProc: 0, // Get OS handle from the channel.
	Fclose2Proc:    0, // No close2 support. NULL'able.
	FblockModeProc: 0, // Flush channel. Not used by core.
	// NULL'able.
	FhandlerProc:  0, // Handle events.
	FwideSeekProc: 0, // truncate
} /* tclIORTrans.c:62:30 */

// Structure of the buffer to hold transform results to be consumed by higher
// layers upon reading from the channel, plus the functions to manage such.

type X_ResultBuffer_ = struct {
	Fbuf       uintptr
	Fallocated int32
	Fused      int32
} /* tclIORTrans.c:88:9 */

// Structure of the buffer to hold transform results to be consumed by higher
// layers upon reading from the channel, plus the functions to manage such.

type ResultBuffer1 = X_ResultBuffer_ /* tclIORTrans.c:93:3 */

// Convenience macro to make some casts easier to use.

// Instance data for a reflected transformation. ===========================

type ReflectedTransform = struct {
	Fchan          Tcl_Channel
	Fparent        Tcl_Channel
	Finterp        uintptr
	Fhandle        uintptr
	Fthread        Tcl_ThreadId
	Ftimer         Tcl_TimerToken
	Fargc          int32
	F__ccgo_pad1   [4]byte
	Fargv          uintptr
	Fmethods       int32
	Fmode          int32
	Fnonblocking   int32
	FreadIsDrained int32
	FeofPending    int32
	Fdead          int32
	Fresult        ResultBuffer1
} /* tclIORTrans.c:166:3 */

// Structure of the table mapping from transform handles to reflected
// transform (channels). Each interpreter which has the handler command for
// one or more reflected transforms records them in such a table, so that we
// are able to find them during interpreter/thread cleanup even if the actual
// channel they belong to was moved to a different interpreter and/or thread.
//
// The table is reachable via the standard interpreter AssocData, the key is
// defined below.

type ReflectedTransformMap = struct{ Fmap Tcl_HashTable } /* tclIORTrans.c:181:3 */

// Method literals. ==================================================

var methodNames1 = [9]uintptr{
	ts + 37195,
	ts + 37201,
	ts + 35880,
	ts + 5438,
	ts + 35889,
	ts + 37207,
	ts + 5472,
	ts + 33034,
	uintptr(0),
} /* tclIORTrans.c:189:19 */

// Operation specific parameter/result structures. (These are "subtypes" of
// ForwardParamBase. Where an operation does not need any special types, it
// has no "subtype" and just uses ForwardParamBase, as listed above.)

type ForwardParamTransform = struct {
	Fbase        ForwardParamBase
	Fbuf         uintptr
	Fsize        int32
	F__ccgo_pad1 [4]byte
} /* tclIORTrans.c:267:1 */

type ForwardParamLimit = struct {
	Fbase        ForwardParamBase
	Fmax         int32
	F__ccgo_pad1 [4]byte
} /* tclIORTrans.c:274:1 */

// Now join all these together in a single union for convenience.

type ForwardParam1 = struct {
	Fbase        ForwardParamBase
	F__ccgo_pad1 [16]byte
} /* tclIORTrans.c:287:3 */

// General event structure, with reference to operation specific data.

type ForwardingEvent1 = struct {
	Fevent       Tcl_Event
	FresultPtr   uintptr
	Fop          ForwardedOperation
	F__ccgo_pad1 [4]byte
	FrtPtr       uintptr
	Fparam       uintptr
} /* tclIORTrans.c:306:3 */

type ThreadSpecificData5 = struct{ FrtmPtr uintptr } /* tclIORTrans.c:336:3 */

var dataKey5 Tcl_ThreadDataKey /* tclIORTrans.c:338:26: */

// List of forwarded operations which have not completed yet, plus the mutex
// to protect the access to this process global list.

var forwardList1 uintptr = uintptr(0) /* tclIORTrans.c:345:25 */
var rtForwardMutex Tcl_Mutex          /* tclIORTrans.c:346:1: */

// Global constant strings (messages). ==================
// These string are used directly as bypass errors, thus they have to be valid
// Tcl lists where the last element is the message itself. Hence the
// list-quoting to keep the words of the message together. See also [x].

var msg_read_unsup uintptr = ts + 37214       /* "{read not suppor..." */ /* tclIORTrans.c:437:19 */
var msg_write_unsup uintptr = ts + 37249      /* "{write not suppo..." */ /* tclIORTrans.c:438:19 */
var msg_send_originlost1 uintptr = ts + 36029 /* "{Channel thread ..." */ /* tclIORTrans.c:440:19 */
var msg_send_dstlost1 uintptr = ts + 36051    /* "{Owner lost}" */        /* tclIORTrans.c:441:19 */
var msg_dstlost1 uintptr = ts + 36064         /* "-code 1 -level 0..." */ /* tclIORTrans.c:443:19 */

// Operation codes for TransformFlush().

// Main methods to plug into the 'chan' ensemble'. ==================

//----------------------------------------------------------------------
//
// TclChanPushObjCmd --
//
//	This function is invoked to process the "chan push" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result. The handle of the new channel is placed in the
//	interp result.
//
// Side effects:
//	Creates a new channel.
//
//----------------------------------------------------------------------

func XTclChanPushObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIORTrans.c:501:1: */
	bp := tls.Alloc(112)
	defer tls.Free(112)

	var rtPtr uintptr // Instance data of the new (transform)
	// channel.
	var chanObj uintptr        // Handle of parent channel
	var parentChan Tcl_Channel // Token of parent channel
	// var mode int32 at bp+64, 4
	// R/W mode of parent, later the new channel.
	// Has to match the abilities of the handler
	// commands
	var cmdObj uintptr // Command prefix, list of words
	// var cmdNameObj uintptr at bp+72, 8
	// Command name
	var rtId uintptr    // Handle of the new transform (channel)
	var modeObj uintptr // mode in obj form for method call
	// var listc int32 at bp+88, 4
	// Result of 'initialize', and of
	// var listv uintptr at bp+96, 8
	// its sublist in the 2nd element
	// var methIndex int32 at bp+104, 4
	// Encoded method name
	var result int32 // Result code for 'initialize'
	// var resObj uintptr at bp+80, 8
	// Result data for 'initialize'
	var methods int32 // Bitmask for supported methods.
	var rtmPtr uintptr
	// Map of reflected transforms with handlers
	// in this interp.
	var hPtr uintptr // Entry in the above map
	// var isNew int32 at bp+108, 4

	var _objPtr uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var _objPtr3 uintptr
	var _objPtr4 uintptr // Placeholder.
	_ = dummy

	// Syntax:   chan push CHANNEL CMDPREFIX
	//           [0]  [1]  [2]     [3]
	//
	// Actually: rPush CHANNEL CMDPREFIX
	//           [0]   [1]     [2]

	// Number of arguments...

	if !(objc != 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+37285)
	return TCL_ERROR
__1:
	;

	// First argument is a channel handle.

	chanObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	parentChan = XTcl_GetChannel(tls, interp, XTcl_GetString(tls, chanObj), bp+64)
	if !(parentChan == uintptr(0)) {
		goto __2
	}
	return TCL_ERROR
__2:
	;
	parentChan = XTcl_GetTopChannel(tls, parentChan)

	// Second argument is command prefix, i.e. list of words, first word is
	// name of handler command, other words are fixed arguments. Run the
	// 'initialize' method to get the list of supported methods. Validate
	// this.

	cmdObj = *(*uintptr)(unsafe.Pointer(objv + 2*8))

	// Basic check that the command prefix truly is a list.

	if !(XTcl_ListObjIndex(tls, interp, cmdObj, 0, bp+72) != TCL_OK) {
		goto __3
	}
	return TCL_ERROR
__3:
	;

	// Now create the transformation (channel).

	rtId = sNextHandle1(tls)
	rtPtr = sNewReflectedTransform(tls, interp, cmdObj, *(*int32)(unsafe.Pointer(bp + 64 /* mode */)), rtId, parentChan)

	// Invoke 'initialize' and validate that the handler is present and ok.
	// Squash the transformation if not.

	modeObj = sDecodeEventMask1(tls, *(*int32)(unsafe.Pointer(bp + 64 /* mode */)))
	// assert modeObj.refCount == 1
	result = sInvokeTclMethod1(tls, rtPtr, ts+35889, modeObj, uintptr(0), bp+80)
__4:
	_objPtr = modeObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __7
	}
	XTclFreeObj(tls, _objPtr)
__7:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;
	if !(result != TCL_OK) {
		goto __8
	}
	sUnmarshallErrorResult1(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 80 /* resObj */)))
__9:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 80))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __12
	}
	XTclFreeObj(tls, _objPtr1)
__12:
	;
	goto __10
__10:
	if 0 != 0 {
		goto __9
	}
	goto __11
__11:
	; // Remove reference held from invoke
	goto error
__8:
	;

	// Verify the result.
	// - List, of method names. Convert to mask. Check for non-optionals
	//   through the mask. Compare open mode against optional r/w.

	if !(XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 80)), bp+88, bp+96) != TCL_OK) {
		goto __13
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+36152,
		libc.VaList(bp, XTcl_GetString(tls, cmdObj), XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* resObj */))))))
__14:
	_objPtr2 = *(*uintptr)(unsafe.Pointer(bp + 80))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __17
	}
	XTclFreeObj(tls, _objPtr2)
__17:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	goto error
__13:
	;

	methods = 0
__18:
	if !(*(*int32)(unsafe.Pointer(bp + 88)) > 0) {
		goto __19
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)) + uintptr(*(*int32)(unsafe.Pointer(bp + 88))-1)*8)), uintptr(unsafe.Pointer(&methodNames1)), int32(unsafe.Sizeof(uintptr(0))), ts+25917, TCL_EXACT, bp+104) != TCL_OK) {
		goto __20
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+37303,
		libc.VaList(bp+16, XTcl_GetString(tls, cmdObj),
			XTcl_GetString(tls, XTcl_GetObjResult(tls, interp)))))
__21:
	_objPtr3 = *(*uintptr)(unsafe.Pointer(bp + 80))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __24
	}
	XTclFreeObj(tls, _objPtr3)
__24:
	;
	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
	goto error
__20:
	;

	methods = methods | int32(1)<<*(*int32)(unsafe.Pointer(bp + 104))
	*(*int32)(unsafe.Pointer(bp + 88 /* listc */))--
	goto __18
__19:
	;
__25:
	_objPtr4 = *(*uintptr)(unsafe.Pointer(bp + 80))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __28
	}
	XTclFreeObj(tls, _objPtr4)
__28:
	;
	goto __26
__26:
	if 0 != 0 {
		goto __25
	}
	goto __27
__27:
	;

	if !((int32(1)<<4|int32(1)<<2)&methods != int32(1)<<4|int32(1)<<2) {
		goto __29
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+36241,
		libc.VaList(bp+32, XTcl_GetString(tls, cmdObj))))
	goto error
__29:
	;

	// Mode tell us what the parent channel supports. The methods tell us what
	// the handler supports. We remove the non-supported bits from the mode
	// and check that the channel is not completely inacessible. Afterward the
	// mode tells us which methods are still required, and these methods will
	// also be supported by the handler, by design of the check.

	if !!(methods&(int32(1)<<METH_READ) != 0) {
		goto __30
	}
	*(*int32)(unsafe.Pointer(bp + 64 /* mode */)) &= libc.CplInt32(int32(1) << 1)
__30:
	;
	if !!(methods&(int32(1)<<7) != 0) {
		goto __31
	}
	*(*int32)(unsafe.Pointer(bp + 64 /* mode */)) &= libc.CplInt32(int32(1) << 2)
__31:
	;

	if !!(*(*int32)(unsafe.Pointer(bp + 64)) != 0) {
		goto __32
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+37344,
		libc.VaList(bp+40, XTcl_GetString(tls, cmdObj))))
	goto error
__32:
	;

	// The mode and support for it is ok, now check the internal constraints.

	if !!(!(methods&(int32(1)<<METH_DRAIN) != 0) || methods&(int32(1)<<METH_READ) != 0) {
		goto __33
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+37393,
		libc.VaList(bp+48, XTcl_GetString(tls, cmdObj))))
	goto error
__33:
	;

	if !!(!(methods&(int32(1)<<METH_FLUSH) != 0) || methods&(int32(1)<<7) != 0) {
		goto __34
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+37443,
		libc.VaList(bp+56, XTcl_GetString(tls, cmdObj))))
	goto error
__34:
	;

	XTcl_ResetResult(tls, interp)

	// Everything is fine now.

	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods = methods
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmode = *(*int32)(unsafe.Pointer(bp + 64 /* mode */))
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan = XTcl_StackChannel(tls, interp, uintptr(unsafe.Pointer(&tclRTransformType)), rtPtr, *(*int32)(unsafe.Pointer(bp + 64 /* mode */)),
		(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent)

	// Register the transform in our our map for proper handling of deleted
	// interpreters and/or threads.

	rtmPtr = sGetReflectedTransformMap(tls, interp)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rtmPtr /* &.map */)).FcreateProc})).f(tls, rtmPtr /* &.map */, XTcl_GetString(tls, rtId), bp+108 /* &isNew */)
	if !(!(*(*int32)(unsafe.Pointer(bp + 108)) != 0) && rtPtr != (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData) {
		goto __35
	}
	XTcl_Panic(tls, ts+37494, 0)
__35:
	;
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = rtPtr
	rtmPtr = sGetThreadReflectedTransformMap(tls)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rtmPtr /* &.map */)).FcreateProc})).f(tls, rtmPtr /* &.map */, XTcl_GetString(tls, rtId), bp+108 /* &isNew */)
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = rtPtr

	// Return the channel as the result of the command.

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		XTcl_GetChannelName(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan), -1))
	return TCL_OK

error:
	// We are not going through ReflectClose as we never had a channel
	// structure.

	XTcl_EventuallyFree(tls, rtPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sFreeReflectedTransform})))
	return TCL_ERROR

}

//----------------------------------------------------------------------
//
// TclChanPopObjCmd --
//
//	This function is invoked to process the "chan pop" Tcl command. See
//	the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Posts events to a reflected channel, invokes event handlers. The
//	latter implies that arbitrary side effects are possible.
//
//----------------------------------------------------------------------

func XTclChanPopObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIORTrans.c:747:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// Syntax:   chan pop CHANNEL
	//           [0]  [1] [2]
	//
	// Actually: rPop CHANNEL
	//           [0]  [1]

	var chanId uintptr    // Tcl level channel handle
	var chan1 Tcl_Channel // Channel associated to the handle
	// var mode int32 at bp, 4
	// Channel r/w mode
	_ = dummy

	// Number of arguments...

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31899)
		return TCL_ERROR
	}

	// First argument is a channel, which may have a (reflected)
	// transformation.

	chanId = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	chan1 = XTcl_GetChannel(tls, interp, chanId, bp)

	if chan1 == uintptr(0) {
		return TCL_ERROR
	}

	// Removing transformations is generic, and not restricted to reflected
	// transformations.

	XTcl_UnstackChannel(tls, interp, chan1)
	return TCL_OK

}

// Channel error message marshalling utilities.

func sMarshallError1(tls *libc.TLS, interp uintptr) uintptr { /* tclIORTrans.c:804:16: */
	// Capture the result status of the interpreter into a string. => List of
	// options and values, followed by the error message. The result has
	// refCount 0.

	var returnOpt uintptr = XTcl_GetReturnOptions(tls, interp, TCL_ERROR)

	// => returnOpt.refCount == 0. We can append directly.

	XTcl_ListObjAppendElement(tls, uintptr(0), returnOpt, XTcl_GetObjResult(tls, interp))
	return returnOpt
}

func sUnmarshallErrorResult1(tls *libc.TLS, interp uintptr, msgObj uintptr) { /* tclIORTrans.c:825:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var lc int32 at bp, 4

	// var lv uintptr at bp+8, 8

	var explicitResult int32
	var numOptions int32

	// Process the caught message.
	//
	// Syntax = (option value)... ?message?
	//
	// Bad syntax causes a panic. This is OK because the other side uses
	// Tcl_GetReturnOptions and list construction functions to marshall the
	// information; if we panic here, something has gone badly wrong already.

	if XTcl_ListObjGetElements(tls, interp, msgObj, bp, bp+8) != TCL_OK {
		XTcl_Panic(tls, ts+36778, 0)
	}
	if interp == uintptr(0) {
		return
	}

	explicitResult = *(*int32)(unsafe.Pointer(bp)) & 1 // Odd number of values?
	numOptions = *(*int32)(unsafe.Pointer(bp)) - explicitResult

	if explicitResult != 0 {
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* lv */)) + uintptr(*(*int32)(unsafe.Pointer(bp))-1)*8)))
	}

	XTcl_SetReturnOptions(tls, interp, XTcl_NewListObj(tls, numOptions, *(*uintptr)(unsafe.Pointer(bp + 8 /* lv */))))
	*(*int32)(unsafe.Pointer(interp + 424)) &= libc.CplInt32(ERR_ALREADY_LOGGED)
}

// Driver functions. ================================================

//----------------------------------------------------------------------
//
// ReflectClose --
//
//	This function is invoked when the channel is closed, to delete the
//	driver specific instance data.
//
// Results:
//	A posix error.
//
// Side effects:
//	Releases memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectClose1(tls *libc.TLS, clientData ClientData, interp uintptr) int32 { /* tclIORTrans.c:884:1: */
	bp := tls.Alloc(96)
	defer tls.Free(96)

	var rtPtr uintptr
	// var errorCode int32 at bp+40, 4

	var errorCodeSet int32
	var result int32 // Result code for 'close'
	// var resObj uintptr at bp+88, 8
	// Result data for 'close'
	var rtmPtr uintptr
	// Map of reflected transforms with handlers
	// in this interp.
	var hPtr uintptr
	// var p ForwardParam1 at bp, 40

	// var p1 ForwardParam1 at bp+48, 40

	var _objPtr uintptr
	rtPtr = clientData
	errorCodeSet = 0
	result = TCL_OK // Entry in the above map

	if !(XTclInThreadExit(tls) != 0) {
		goto __1
	}
	// This call comes from TclFinalizeIOSystem. There are no
	// interpreters, and therefore we cannot call upon the handler command
	// anymore. Threading is irrelevant as well. We simply clean up all
	// our C level data structures and leave the Tcl level to the other
	// finalization functions.

	// THREADED => Forward this to the origin thread
	//
	// Note: DeleteThreadReflectedTransformMap() is the thread exit handler
	// for the origin thread. Use this to clean up the structure? Except
	// if lost?

	if !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread != XTcl_GetCurrentThread(tls)) {
		goto __2
	}

	sForwardOpToOwnerThread(tls, rtPtr, uint32(1) /* ForwardedClose */, bp)
	result = (*ForwardParamBase)(unsafe.Pointer(bp)).Fcode

	if !(result != TCL_OK) {
		goto __3
	}
__4:
	if !((*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0) {
		goto __7
	}
	XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
__7:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;
__3:
	;
__2:
	;

	XTcl_EventuallyFree(tls, rtPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sFreeReflectedTransform})))
	return EOK
__1:
	;

	// In the reflected channel implementation a cleaned method mask here
	// implies that the channel creation was aborted, and "finalize" must not
	// be called. for transformations however we are not going through here on
	// such an abort, but directly through FreeReflectedTransform. So for us
	// that check is not necessary. We always go through 'finalize'.

	if !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods&(int32(1)<<METH_DRAIN) != 0 && !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).FreadIsDrained != 0)) {
		goto __8
	}
	if !!(sTransformDrain(tls, rtPtr, bp+40) != 0) {
		goto __9
	}
	if !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread != XTcl_GetCurrentThread(tls)) {
		goto __10
	}
	XTcl_EventuallyFree(tls, rtPtr,
		*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sFreeReflectedTransform})))
	return *(*int32)(unsafe.Pointer(bp + 40 /* errorCode */))
__10:
	;
	errorCodeSet = 1
	goto cleanup
__9:
	;
__8:
	;

	if !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods&(int32(1)<<METH_FLUSH) != 0) {
		goto __11
	}
	if !!(sTransformFlush(tls, rtPtr, bp+40, FLUSH_WRITE) != 0) {
		goto __12
	}
	if !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread != XTcl_GetCurrentThread(tls)) {
		goto __13
	}
	XTcl_EventuallyFree(tls, rtPtr,
		*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sFreeReflectedTransform})))
	return *(*int32)(unsafe.Pointer(bp + 40 /* errorCode */))
__13:
	;
	errorCodeSet = 1
	goto cleanup
__12:
	;
__11:
	;

	// Are we in the correct thread?

	if !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread != XTcl_GetCurrentThread(tls)) {
		goto __14
	}

	sForwardOpToOwnerThread(tls, rtPtr, uint32(1) /* ForwardedClose */, bp+48)
	result = (*ForwardParamBase)(unsafe.Pointer(bp + 48)).Fcode

	XTcl_EventuallyFree(tls, rtPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sFreeReflectedTransform})))

	if !(result != TCL_OK) {
		goto __15
	}
__16:
	if !(interp != uintptr(0)) {
		goto __19
	}
	XTcl_SetChannelErrorInterp(tls, interp, XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp+48)).FmsgStr, -1))
__19:
	;
__20:
	if !((*ForwardParamBase)(unsafe.Pointer(bp+48)).FmustFree != 0) {
		goto __23
	}
	XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp+48)).FmsgStr)
__23:
	;
	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	return EINVAL
__15:
	;
	return EOK
__14:
	;

	// Do the actual invokation of "finalize" now; we're in the right thread.

	result = sInvokeTclMethod1(tls, rtPtr, ts+35880, uintptr(0), uintptr(0), bp+88)
	if !(result != TCL_OK && interp != uintptr(0)) {
		goto __24
	}
	XTcl_SetChannelErrorInterp(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 88 /* resObj */)))
__24:
	;

__25:
	_objPtr = *(*uintptr)(unsafe.Pointer(bp + 88))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __28
	}
	XTclFreeObj(tls, _objPtr)
__28:
	;
	goto __26
__26:
	if 0 != 0 {
		goto __25
	}
	goto __27
__27:
	; // Remove reference we held from the
	// invoke.

cleanup:

	// Remove the transform from the map before releasing the memory, to
	// prevent future accesses from finding and dereferencing a dangling
	// pointer.
	//
	// NOTE: The transform may not be in the map. This is ok, that happens
	// when the transform was created in a different interpreter and/or thread
	// and then was moved here.
	//
	// NOTE: The channel may have been removed from the map already via
	// the per-interp DeleteReflectedTransformMap exit-handler.

	if !!((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fdead != 0) {
		goto __29
	}
	rtmPtr = sGetReflectedTransformMap(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rtmPtr /* &.map */)).FfindProc})).f(tls, rtmPtr /* &.map */, XTcl_GetString(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fhandle))
	if !(hPtr != 0) {
		goto __30
	}
	XTcl_DeleteHashEntry(tls, hPtr)
__30:
	;

	// In a threaded interpreter we manage a per-thread map as well,
	// to allow us to survive if the script level pulls the rug out
	// under a channel by deleting the owning thread.

	rtmPtr = sGetThreadReflectedTransformMap(tls)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rtmPtr /* &.map */)).FfindProc})).f(tls, rtmPtr /* &.map */, XTcl_GetString(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fhandle))
	if !(hPtr != 0) {
		goto __31
	}
	XTcl_DeleteHashEntry(tls, hPtr)
__31:
	;
__29:
	;

	XTcl_EventuallyFree(tls, rtPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sFreeReflectedTransform})))
	if errorCodeSet != 0 {
		return *(*int32)(unsafe.Pointer(bp + 40 /* errorCode */))
	}
	return func() int32 {
		if result == TCL_OK {
			return EOK
		}
		return EINVAL
	}()
}

func sReflectClose21(tls *libc.TLS, clientData ClientData, interp uintptr, flags int32) int32 { /* tclIORTrans.c:1042:1: */
	if flags&(int32(1)<<1|int32(1)<<2) == 0 {
		return sReflectClose1(tls, clientData, interp)
	}
	return EINVAL
}

//----------------------------------------------------------------------
//
// ReflectInput --
//
//	This function is invoked when more data is requested from the channel.
//
// Results:
//	The number of bytes read.
//
// Side effects:
//	Allocates memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectInput1(tls *libc.TLS, clientData ClientData, buf uintptr, toRead int32, errorCodePtr uintptr) int32 { /* tclIORTrans.c:1070:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var rtPtr uintptr
	var gotBytes int32
	var copied int32
	var readBytes int32
	var bufObj uintptr
	// var maxRead int32 at bp, 4

	var _objPtr uintptr
	var _objPtr1 uintptr
	rtPtr = clientData

	// The following check can be done before thread redirection, because we
	// are reading from an item which is readonly, i.e. will never change
	// during the lifetime of the channel.

	if !!((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods&(int32(1)<<METH_READ) != 0) {
		goto __1
	}
	XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, XTcl_NewStringObj(tls, msg_read_unsup, -1))
	*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
	return -1
__1:
	;

	XTcl_Preserve(tls, rtPtr)

	// TODO: Consider a more appropriate buffer size.
	bufObj = XTcl_NewByteArrayObj(tls, uintptr(0), toRead)
	(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount++
	gotBytes = 0
	if !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).FeofPending != 0) {
		goto __2
	}
	goto stop
__2:
	;
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).FreadIsDrained = 0
__3:
	if !(toRead > 0) {
		goto __4
	}
	// Loop until the request is satisfied (or no data available from
	// below, possibly EOF).

	copied = sResultCopy1(tls, rtPtr+88, buf, toRead)
	toRead = toRead - copied
	buf += uintptr(copied)
	gotBytes = gotBytes + copied

	if !(toRead == 0) {
		goto __5
	}
	goto stop
__5:
	;

	if !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).FeofPending != 0) {
		goto __6
	}
	goto stop
__6:
	;

	// The buffer is exhausted, but the caller wants even more. We now
	// have to go to the underlying channel, get more bytes and then
	// transform them for delivery. We may not get what we want (full EOF
	// or temporarily out of data).
	//
	// Length (rtPtr->result) == 0, toRead > 0 here. Use 'buf'! as target
	// to store the intermediary information read from the parent channel.
	//
	// Ask the transform how much data it allows us to read from the
	// underlying channel. This feature allows the transform to signal EOF
	// upstream although there is none downstream. Useful to control an
	// unbounded 'fcopy' for example, either through counting bytes, or by
	// pattern matching.

	if !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods&(int32(1)<<METH_LIMIT) != 0) {
		goto __7
	}
	*(*int32)(unsafe.Pointer(bp /* maxRead */)) = -1

	if !!(sTransformLimit(tls, rtPtr, errorCodePtr, bp) != 0) {
		goto __8
	}
	goto error
__8:
	;
	if !(*(*int32)(unsafe.Pointer(bp)) == 0) {
		goto __9
	}
	goto stop
	goto __10
__9:
	if !(*(*int32)(unsafe.Pointer(bp)) > 0) {
		goto __11
	}
	if !(*(*int32)(unsafe.Pointer(bp)) < toRead) {
		goto __12
	}
	toRead = *(*int32)(unsafe.Pointer(bp /* maxRead */))
__12:
	;
__11:
	;
__10:
	; // else: 'maxRead < 0' == Accept the current value of toRead
__7:
	;

	if !(toRead <= 0) {
		goto __13
	}
	goto stop
__13:
	;

	readBytes = XTcl_ReadRaw(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent,
		XTcl_SetByteArrayLength(tls, bufObj, toRead), toRead)
	if !(readBytes < 0) {
		goto __14
	}
	if !(XTcl_InputBlocked(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent) != 0 && gotBytes > 0) {
		goto __15
	}

	// Down channel is blocked and offers zero additional bytes.
	// The nonzero gotBytes already returned makes the total
	// operation a valid short read.  Return to caller.

	goto stop
__15:
	;

	// Either the down channel is not blocked (a real error)
	// or it is and there are gotBytes==0 byte copied so far.
	// In either case, pass up the error, so we either report
	// any real error, or do not mistakenly signal EOF by
	// returning 0 to the caller.

	*(*int32)(unsafe.Pointer(errorCodePtr)) = XTcl_GetErrno(tls)
	goto error
__14:
	;

	if !(readBytes == 0) {
		goto __16
	}

	// Zero returned from Tcl_ReadRaw() always indicates EOF
	// on the down channel.

	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).FeofPending = 1

	// Now this is a bit different. The partial data waiting is
	// converted and returned.

	if !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods&(int32(1)<<METH_DRAIN) != 0) {
		goto __17
	}
	if !!(sTransformDrain(tls, rtPtr, errorCodePtr) != 0) {
		goto __18
	}
	goto error
__18:
	;
__17:
	;

	if !((*ResultBuffer1)(unsafe.Pointer(rtPtr+88)).Fused == 0) {
		goto __19
	}
	// The drain delivered nothing.

	goto stop
__19:
	;

	goto __3 // at: while (toRead > 0)
__16:
	; // readBytes == 0

	// Transform the read chunk, which was not empty. Anything we got back
	// is a transformation result is put into our buffers, and the next
	// iteration will put it into the result.

	XTcl_SetByteArrayLength(tls, bufObj, readBytes)
	if !!(sTransformRead(tls, rtPtr, errorCodePtr, bufObj) != 0) {
		goto __20
	}
	goto error
__20:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount > 1) {
		goto __21
	}
__22:
	_objPtr = bufObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __25
	}
	XTclFreeObj(tls, _objPtr)
__25:
	;
	goto __23
__23:
	if 0 != 0 {
		goto __22
	}
	goto __24
__24:
	;
	bufObj = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount++
__21:
	;
	XTcl_SetByteArrayLength(tls, bufObj, 0)
	goto __3
__4:
	; // while toRead > 0

stop:
	if !(gotBytes == 0) {
		goto __26
	}
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).FeofPending = 0
__26:
	;
__27:
	_objPtr1 = bufObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __30
	}
	XTclFreeObj(tls, _objPtr1)
__30:
	;
	goto __28
__28:
	if 0 != 0 {
		goto __27
	}
	goto __29
__29:
	;
	XTcl_Release(tls, rtPtr)
	return gotBytes

error:
	gotBytes = -1
	goto stop
	return int32(0)
}

//----------------------------------------------------------------------
//
// ReflectOutput --
//
//	This function is invoked when data is written to the channel.
//
// Results:
//	The number of bytes actually written.
//
// Side effects:
//	Allocates memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectOutput1(tls *libc.TLS, clientData ClientData, buf uintptr, toWrite int32, errorCodePtr uintptr) int32 { /* tclIORTrans.c:1263:1: */
	var rtPtr uintptr = clientData

	// The following check can be done before thread redirection, because we
	// are reading from an item which is readonly, i.e. will never change
	// during the lifetime of the channel.

	if !((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods&(int32(1)<<7) != 0) {
		XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, XTcl_NewStringObj(tls, msg_write_unsup, -1))
		*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
		return -1
	}

	if toWrite == 0 {
		// Nothing came in to write, ignore the call

		return 0
	}

	// Discard partial data in the input buffers, i.e. on the read side. Like
	// we do when explicitly seeking as well.

	XTcl_Preserve(tls, rtPtr)

	if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods&(int32(1)<<METH_CLEAR) != 0 {
		sTransformClear(tls, rtPtr)
	}

	// Hand the data to the transformation itself. Anything it deigned to
	// return to us is a (partial) transformation result and written to the
	// parent channel for further processing.

	if !(sTransformWrite(tls, rtPtr, errorCodePtr, buf, toWrite) != 0) {
		XTcl_Release(tls, rtPtr)
		return -1
	}

	*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
	XTcl_Release(tls, rtPtr)
	return toWrite
}

//----------------------------------------------------------------------
//
// ReflectSeekWide / ReflectSeek --
//
//	This function is invoked when the user wishes to seek on the channel.
//
// Results:
//	The new location of the access point.
//
// Side effects:
//	Allocates memory. Arbitrary, per the parent channel, and the called
//	scripts.
//
//----------------------------------------------------------------------

func sReflectSeekWide1(tls *libc.TLS, clientData ClientData, offset Tcl_WideInt, seekMode int32, errorCodePtr uintptr) Tcl_WideInt { /* tclIORTrans.c:1336:1: */
	var rtPtr uintptr = clientData
	var parent uintptr = (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent
	var curPos Tcl_WideInt // Position on the device.

	var seekProc uintptr = XTcl_ChannelSeekProc(tls, XTcl_GetChannelType(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent))

	// Fail if the parent channel is not seekable.

	if seekProc == uintptr(0) {
		XTcl_SetErrno(tls, EINVAL)
		return int64(-1)
	}

	// Check if we can leave out involving the Tcl level, i.e. transformation
	// handler. This is true for tell requests, and transformations which
	// support neither flush, nor drain. For these cases we can pass the
	// request down and the result back up unchanged.

	XTcl_Preserve(tls, rtPtr)

	if (seekMode != SEEK_CUR || offset != int64(0)) &&
		((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods&(int32(1)<<METH_CLEAR) != 0 ||
			(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods&(int32(1)<<METH_FLUSH) != 0) {
		// Neither a tell request, nor clear/flush both not supported. We have
		// to go through the Tcl level to clear and/or flush the
		// transformation.

		if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods&(int32(1)<<METH_CLEAR) != 0 {
			sTransformClear(tls, rtPtr)
		}

		// When flushing the transform for seeking the generated results are
		// irrelevant. We cannot put them into the channel, this would move
		// the location, throwing it off with regard to where we are and are
		// seeking to.

		if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods&(int32(1)<<METH_FLUSH) != 0 {
			if !(sTransformFlush(tls, rtPtr, errorCodePtr, FLUSH_DISCARD) != 0) {
				XTcl_Release(tls, rtPtr)
				return int64(-1)
			}
		}
	}

	// Now seek to the new position in the channel as requested by the
	// caller. Note that we prefer the wideSeekProc if that is available and
	// non-NULL...

	if XTcl_ChannelWideSeekProc(tls, (*Channel)(unsafe.Pointer(parent)).FtypePtr) != uintptr(0) {
		curPos = (*struct {
			f func(*libc.TLS, ClientData, Tcl_WideInt, int32, uintptr) Tcl_WideInt
		})(unsafe.Pointer(&struct{ uintptr }{XTcl_ChannelWideSeekProc(tls, (*Channel)(unsafe.Pointer(parent)).FtypePtr)})).f(tls, (*Channel)(unsafe.Pointer(parent)).FinstanceData, offset,
			seekMode, errorCodePtr)
	} else if offset < -0x7fffffffffffffff-1 || offset > 0x7fffffffffffffff {
		*(*int32)(unsafe.Pointer(errorCodePtr)) = EOVERFLOW
		curPos = int64(-1)
	} else {
		curPos = int64((*struct {
			f func(*libc.TLS, ClientData, int64, int32, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{XTcl_ChannelSeekProc(tls, (*Channel)(unsafe.Pointer(parent)).FtypePtr)})).f(tls, (*Channel)(unsafe.Pointer(parent)).FinstanceData, offset, seekMode, errorCodePtr))
	}
	if curPos == int64(-1) {
		XTcl_SetErrno(tls, *(*int32)(unsafe.Pointer(errorCodePtr)))
	}

	*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
	XTcl_Release(tls, rtPtr)
	return curPos
}

func sReflectSeek1(tls *libc.TLS, clientData ClientData, offset int64, seekMode int32, errorCodePtr uintptr) int32 { /* tclIORTrans.c:1423:1: */
	// This function can be invoked from a transformation which is based on
	// standard seeking, i.e. non-wide. Because of this we have to implement
	// it, a dummy is not enough. We simply delegate the call to the wide
	// routine.

	return int32(sReflectSeekWide1(tls, clientData, offset, seekMode,
		errorCodePtr))
}

//----------------------------------------------------------------------
//
// ReflectWatch --
//
//	This function is invoked to tell the channel what events the I/O
//	system is interested in.
//
// Results:
//	None.
//
// Side effects:
//	Allocates memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectWatch1(tls *libc.TLS, clientData ClientData, mask int32) { /* tclIORTrans.c:1458:1: */
	var rtPtr uintptr = clientData
	var watchProc uintptr

	watchProc = XTcl_ChannelWatchProc(tls, XTcl_GetChannelType(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent))
	(*struct {
		f func(*libc.TLS, ClientData, int32)
	})(unsafe.Pointer(&struct{ uintptr }{watchProc})).f(tls, XTcl_GetChannelInstanceData(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent), mask)

	// Management of the internal timer.

	if !(mask&(int32(1)<<1) != 0) || (*ResultBuffer1)(unsafe.Pointer(rtPtr+88)).Fused == 0 {
		// A pending timer may exist, but either is there no (more) interest
		// in the events it generates or nothing is available for reading.
		// Remove it, if existing.

		sTimerKill(tls, rtPtr)
	} else {
		// There might be no pending timer, but there is interest in readable
		// events and we actually have data waiting, so generate a timer to
		// flush that if it does not exist.

		sTimerSetup(tls, rtPtr)
	}
}

//----------------------------------------------------------------------
//
// ReflectBlock --
//
//	This function is invoked to tell the channel which blocking behaviour
//	is required of it.
//
// Results:
//	A posix error number.
//
// Side effects:
//	Allocates memory. Arbitrary, as it calls upon a script.
//
//----------------------------------------------------------------------

func sReflectBlock1(tls *libc.TLS, clientData ClientData, nonblocking int32) int32 { /* tclIORTrans.c:1509:1: */
	var rtPtr uintptr = clientData

	// Transformations simply record the blocking mode in their C level
	// structure for use by --> ReflectInput. The Tcl level doesn't see this
	// information or change. As such thread forwarding is not required.

	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fnonblocking = nonblocking
	return EOK
}

//----------------------------------------------------------------------
//
// ReflectSetOption --
//
//	This function is invoked to configure a channel option.
//
// Results:
//	A standard Tcl result code.
//
// Side effects:
//	Arbitrary, per the parent channel.
//
//----------------------------------------------------------------------

func sReflectSetOption1(tls *libc.TLS, clientData ClientData, interp uintptr, optionName uintptr, newValue uintptr) int32 { /* tclIORTrans.c:1542:1: */
	var rtPtr uintptr = clientData

	// Transformations have no options. Thus the call is passed down unchanged
	// to the parent channel for processing. Its results are passed back
	// unchanged as well. This all happens in the thread we are in. As the Tcl
	// level is not involved there is no need for thread forwarding.

	var setOptionProc uintptr = XTcl_ChannelSetOptionProc(tls, XTcl_GetChannelType(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent))

	if setOptionProc == uintptr(0) {
		return TCL_ERROR
	}
	return (*struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{setOptionProc})).f(tls, XTcl_GetChannelInstanceData(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent), interp,
		optionName, newValue)
}

//----------------------------------------------------------------------
//
// ReflectGetOption --
//
//	This function is invoked to retrieve all or a channel options.
//
// Results:
//	A standard Tcl result code.
//
// Side effects:
//	Arbitrary, per the parent channel.
//
//----------------------------------------------------------------------

func sReflectGetOption1(tls *libc.TLS, clientData ClientData, interp uintptr, optionName uintptr, dsPtr uintptr) int32 { /* tclIORTrans.c:1584:1: */
	var rtPtr uintptr = clientData

	// Transformations have no options. Thus the call is passed down unchanged
	// to the parent channel for processing. Its results are passed back
	// unchanged as well. This all happens in the thread we are in. As the Tcl
	// level is not involved there is no need for thread forwarding.
	//
	// Note that the parent not having a driver for option retrieval is not an
	// immediate error. A query for all options is ok. Only a request for a
	// specific option has to fail.

	var getOptionProc uintptr = XTcl_ChannelGetOptionProc(tls, XTcl_GetChannelType(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent))

	if getOptionProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{getOptionProc})).f(tls, XTcl_GetChannelInstanceData(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent),
			interp, optionName, dsPtr)
	} else if optionName == uintptr(0) {
		return TCL_OK
	} else {
		return TCL_ERROR
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// ReflectHandle --
//
//	This function is invoked to retrieve the associated file handle.
//
// Results:
//	A standard Tcl result code.
//
// Side effects:
//	Arbitrary, per the parent channel.
//
//----------------------------------------------------------------------

func sReflectHandle(tls *libc.TLS, clientData ClientData, direction int32, handlePtr uintptr) int32 { /* tclIORTrans.c:1633:1: */
	var rtPtr uintptr = clientData

	// Transformations have no handle of their own. As such we simply query
	// the parent channel for it. This way the qery will ripple down through
	// all transformations until reaches the base channel. Which then returns
	// its handle, or fails. The former will then ripple up the stack.
	//
	// This all happens in the thread we are in. As the Tcl level is not
	// involved no forwarding is required.

	return XTcl_GetChannelHandle(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent, direction, handlePtr)
}

//----------------------------------------------------------------------
//
// ReflectNotify --
//
//	This function is invoked to reported incoming events.
//
// Results:
//	A standard Tcl result code.
//
// Side effects:
//	Arbitrary, per the parent channel.
//
//----------------------------------------------------------------------

func sReflectNotify(tls *libc.TLS, clientData ClientData, mask int32) int32 { /* tclIORTrans.c:1669:1: */
	var rtPtr uintptr = clientData

	// An event occured in the underlying channel.
	//
	// We delete our timer. It was not fired, yet we are here, so the channel
	// below generated such an event and we don't have to. The renewal of the
	// interest after the execution of channel handlers will eventually cause
	// us to recreate the timer (in ReflectWatch).

	sTimerKill(tls, rtPtr)

	// Pass to higher layers.

	return mask
}

// Helpers. =========================================================

//----------------------------------------------------------------------
//
// DecodeEventMask --
//
//	This function takes an internal bitmask of events and constructs the
//	equivalent list of event items.
//
// Results:
//	A Tcl_Obj reference. The object will have a refCount of one. The user
//	has to decrement it to release the object.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------
// DUPLICATE of 'DecodeEventMask' in tclIORChan.c

func sDecodeEventMask1(tls *libc.TLS, mask int32) uintptr { /* tclIORTrans.c:1717:16: */
	var eventStr uintptr
	var evObj uintptr

	switch mask & (int32(1)<<1 | int32(1)<<2) {
	case int32(1)<<1 | int32(1)<<2:
		eventStr = ts + 36951 /* "read write" */
		break
	case int32(1) << 1:
		eventStr = ts + 5472 /* "read" */
		break
	case int32(1) << 2:
		eventStr = ts + 33034 /* "write" */
		break
	default:
		eventStr = ts + 2046 /* "" */
		break
	}

	evObj = XTcl_NewStringObj(tls, eventStr, -1)
	(*Tcl_Obj)(unsafe.Pointer(evObj)).FrefCount++
	return evObj
}

//----------------------------------------------------------------------
//
// NewReflectedTransform --
//
//	This function is invoked to allocate and initialize the instance data
//	of a new reflected channel.
//
// Results:
//	A heap-allocated channel instance.
//
// Side effects:
//	Allocates memory.
//
//----------------------------------------------------------------------

func sNewReflectedTransform(tls *libc.TLS, interp uintptr, cmdpfxObj uintptr, mode int32, handleObj uintptr, parentChan Tcl_Channel) uintptr { /* tclIORTrans.c:1761:27: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var rtPtr uintptr
	// var listc int32 at bp, 4

	// var listv uintptr at bp+8, 8

	var i int32
	_ = mode

	rtPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ReflectedTransform{})))

	// rtPtr->chan: Assigned by caller. Dummy data here.
	// rtPtr->methods: Assigned by caller. Dummy data here.

	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan = uintptr(0)
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmethods = 0
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread = XTcl_GetCurrentThread(tls)
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent = parentChan
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp = interp
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fhandle = handleObj
	(*Tcl_Obj)(unsafe.Pointer(handleObj)).FrefCount++
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Ftimer = uintptr(0)
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fmode = 0
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).FreadIsDrained = 0
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).FeofPending = 0
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fnonblocking = (*ChannelState1)(unsafe.Pointer((*Channel)(unsafe.Pointer(parentChan)).Fstate)).Fflags & (int32(1) << 3)
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fdead = 0

	// Query parent for current blocking mode.

	sResultInit1(tls, rtPtr+88)

	// Method placeholder.

	// ASSERT: cmdpfxObj is a Tcl List

	XTcl_ListObjGetElements(tls, interp, cmdpfxObj, bp, bp+8)

	// See [==] as well.
	// Storage for the command prefix and the additional words required for
	// the invocation of methods in the command handler.
	//
	// listv [0] [listc-1] | [listc]  [listc+1] |
	// argv  [0]   ... [.] | [argc-2] [argc-1]  | [argc]  [argc+2]
	//       cmd   ... pfx | method   chan      | detail1 detail2

	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargc = *(*int32)(unsafe.Pointer(bp)) + 2
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargv = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp))+4)))

	// Duplicate object references.

	for i = 0; i < *(*int32)(unsafe.Pointer(bp /* listc */)); i++ {
		var word uintptr = libc.AssignPtrUintptr((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargv+uintptr(i)*8, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* listv */)) + uintptr(i)*8)))

		(*Tcl_Obj)(unsafe.Pointer(word)).FrefCount++
	}

	i++ // Skip placeholder for method

	// See [x] in FreeReflectedTransform for release
	*(*uintptr)(unsafe.Pointer((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargv + uintptr(i)*8)) = handleObj
	(*Tcl_Obj)(unsafe.Pointer(handleObj)).FrefCount++

	// The next two objects are kept empty, varying arguments.

	// Initialization complete.

	return rtPtr
}

//----------------------------------------------------------------------
//
// NextHandle --
//
//	This function is invoked to generate a channel handle for a new
//	reflected channel.
//
// Results:
//	A Tcl_Obj containing the string of the new channel handle. The
//	refcount of the returned object is -- zero --.
//
// Side effects:
//	May allocate memory. Mutex protected critical section locks out other
//	threads for a short time.
//
//----------------------------------------------------------------------

func sNextHandle1(tls *libc.TLS) uintptr { /* tclIORTrans.c:1872:16: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var resObj uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rtCounterMutex)))
	resObj = XTcl_ObjPrintf(tls, ts+37545, libc.VaList(bp, rtCounter))
	rtCounter++
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rtCounterMutex)))

	return resObj
}

var rtCounterMutex Tcl_Mutex     /* tclIORTrans.c:1883:5: */
var rtCounter uint64 = uint64(0) /* tclIORTrans.c:1884:26 */

func sFreeReflectedTransformArgs(tls *libc.TLS, rtPtr uintptr) { /* tclIORTrans.c:1896:1: */
	var i int32
	var n int32 = (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargc - 2

	if n < 0 {
		return
	}

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fhandle
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fhandle = uintptr(0)

	for i = 0; i < n; i++ {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargv + uintptr(i)*8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	// See [x] in NewReflectedTransform for lock
	// n+1 = argc-1.
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargv + uintptr(n+1)*8))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargc = 1
}

func sFreeReflectedTransform(tls *libc.TLS, rtPtr uintptr) { /* tclIORTrans.c:1922:1: */
	sTimerKill(tls, rtPtr)
	sResultClear1(tls, rtPtr+88)

	sFreeReflectedTransformArgs(tls, rtPtr)

	XTclpFree(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargv)
	XTclpFree(tls, rtPtr)
}

//----------------------------------------------------------------------
//
// InvokeTclMethod --
//
//	This function is used to invoke the Tcl level of a reflected channel.
//	It handles all the command assembly, invokation, and generic state and
//	result mgmt. It does *not* handle thread redirection; that is the
//	responsibility of clients of this function.
//
// Results:
//	Result code and data as returned by the method.
//
// Side effects:
//	Arbitrary, as it calls upon a Tcl script.
//
// Contract:
//	argOneObj.refCount >= 1 on entry and exit, if argOneObj != NULL
//	argTwoObj.refCount >= 1 on entry and exit, if argTwoObj != NULL
//	resObj.refCount in {0, 1, ...}
//
//----------------------------------------------------------------------
// Semi-DUPLICATE of 'InvokeTclMethod' in tclIORChan.c
// - Semi because different structures are used.
// - Still possible to factor out the commonalities into a separate structure.

func sInvokeTclMethod1(tls *libc.TLS, rtPtr uintptr, method uintptr, argOneObj uintptr, argTwoObj uintptr, resultObjPtr uintptr) int32 { /* tclIORTrans.c:1962:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var cmdc int32                   // #words in constructed command
	var methObj uintptr = uintptr(0) // Method name in object form
	var sr Tcl_InterpState           // State of handler interp
	var result int32                 // Result code of method invokation
	var resObj uintptr = uintptr(0)  // Result of method invokation.

	if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fdead != 0 {
		// The transform is marked as dead. Bail out immediately, with an
		// appropriate error.

		if resultObjPtr != uintptr(0) {
			resObj = XTcl_NewStringObj(tls, msg_dstlost1, -1)
			*(*uintptr)(unsafe.Pointer(resultObjPtr)) = resObj
			(*Tcl_Obj)(unsafe.Pointer(resObj)).FrefCount++
		}
		return TCL_ERROR
	}

	// NOTE (5): Decide impl. issue: Cache objects with method names?
	// Requires TSD data as reflections can be created in many different
	// threads.
	// NO: Caching of command resolutions means storage per channel.

	// Insert method into the pre-allocated area, after the command prefix,
	// before the channel id.

	methObj = XTcl_NewStringObj(tls, method, -1)
	(*Tcl_Obj)(unsafe.Pointer(methObj)).FrefCount++
	*(*uintptr)(unsafe.Pointer((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargv + uintptr((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargc-2)*8)) = methObj

	// Append the additional argument containing method specific details
	// behind the channel id. If specified.
	//
	// Because of the contract there is no need to increment the refcounts.
	// The objects will survive the Tcl_EvalObjv without change.

	cmdc = (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargc
	if argOneObj != 0 {
		*(*uintptr)(unsafe.Pointer((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargv + uintptr(cmdc)*8)) = argOneObj
		cmdc++
		if argTwoObj != 0 {
			*(*uintptr)(unsafe.Pointer((*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargv + uintptr(cmdc)*8)) = argTwoObj
			cmdc++
		}
	}

	// And run the handler... This is done in auch a manner which leaves any
	// existing state intact.

	sr = XTcl_SaveInterpState(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp, 0)
	XTcl_Preserve(tls, rtPtr)
	XTcl_Preserve(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp)
	result = XTcl_EvalObjv(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp, cmdc, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargv, TCL_EVAL_GLOBAL)

	// We do not try to extract the result information if the caller has no
	// interest in it. I.e. there is no need to put effort into creating
	// something which is discarded immediately after.

	if resultObjPtr != 0 {
		if result == TCL_OK {
			// Ok result taken as is, also if the caller requests that there
			// is no capture.

			resObj = XTcl_GetObjResult(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp)
		} else {
			// Non-ok result is always treated as an error. We have to capture
			// the full state of the result, including additional options.
			//
			// This is complex and ugly, and would be completely unnecessary
			// if we only added support for a TCL_FORBID_EXCEPTIONS flag.
			if result != TCL_ERROR {
				var cmd uintptr = XTcl_NewListObj(tls, cmdc, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fargv)
				// var cmdLen int32 at bp+16, 4

				var cmdString uintptr = XTcl_GetStringFromObj(tls, cmd, bp+16)

				(*Tcl_Obj)(unsafe.Pointer(cmd)).FrefCount++
				XTcl_ResetResult(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp)
				XTcl_SetObjResult(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp, XTcl_ObjPrintf(tls,
					ts+36968, libc.VaList(bp, result)))
				XTcl_LogCommandInfo(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp, cmdString, cmdString, *(*int32)(unsafe.Pointer(bp + 16 /* cmdLen */)))
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = cmd
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				result = TCL_ERROR
			}
			XTcl_AppendObjToErrorInfo(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp, XTcl_ObjPrintf(tls,
				ts+37003, libc.VaList(bp+8, method)))
			resObj = sMarshallError1(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp)
		}
		(*Tcl_Obj)(unsafe.Pointer(resObj)).FrefCount++
	}
	XTcl_RestoreInterpState(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp, sr)
	XTcl_Release(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp)
	XTcl_Release(tls, rtPtr)

	// Cleanup of the dynamic parts of the command.
	//
	// The detail objects survived the Tcl_EvalObjv without change because of
	// the contract. Therefore there is no need to decrement the refcounts. Only
	// the internal method object has to be disposed of.

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = methObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	// The resObj has a ref count of 1 at this location. This means that the
	// caller of InvokeTclMethod has to dispose of it (but only if it was
	// returned to it).

	if resultObjPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(resultObjPtr)) = resObj
	}

	// There no need to handle the case where nothing is returned, because for
	// that case resObj was not set anyway.

	return result
}

//----------------------------------------------------------------------
//
// GetReflectedTransformMap --
//
//	Gets and potentially initializes the reflected channel map for an
//	interpreter.
//
// Results:
//	A pointer to the map created, for use by the caller.
//
// Side effects:
//	Initializes the reflected channel map for an interpreter.
//
//----------------------------------------------------------------------

func sGetReflectedTransformMap(tls *libc.TLS, interp uintptr) uintptr { /* tclIORTrans.c:2123:30: */
	var rtmPtr uintptr = XTcl_GetAssocData(tls, interp, ts+37551, uintptr(0))

	if rtmPtr == uintptr(0) {
		rtmPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ReflectedTransformMap{})))
		XTcl_InitHashTable(tls, rtmPtr, 0)
		XTcl_SetAssocData(tls, interp, ts+37551,
			*(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr)
			}{sDeleteReflectedTransformMap})), rtmPtr)
	}
	return rtmPtr
}

//----------------------------------------------------------------------
//
// DeleteReflectedTransformMap --
//
//	Deletes the channel table for an interpreter, closing any open
//	channels whose refcount reaches zero. This procedure is invoked when
//	an interpreter is deleted, via the AssocData cleanup mechanism.
//
// Results:
//	None.
//
// Side effects:
//	Deletes the hash table of channels. May close channels. May flush
//	output on closed channels. Removes any channeEvent handlers that were
//	registered in this interpreter.
//
//----------------------------------------------------------------------

func sDeleteReflectedTransformMap(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclIORTrans.c:2159:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var rtmPtr uintptr // The map
	// var hSearch Tcl_HashSearch at bp, 24
	// Search variable.
	var hPtr uintptr // Search variable.
	var rtPtr uintptr
	var resultPtr uintptr
	var evPtr uintptr
	var paramPtr uintptr

	// Delete all entries. The channels may have been closed already, or will
	// be closed later, by the standard IO finalization of an interpreter
	// under destruction. Except for the channels which were moved to a
	// different interpreter and/or thread. They do not exist from the IO
	// systems point of view and will not get closed. Therefore mark all as
	// dead so that any future access will cause a proper error. For channels
	// in a different thread we actually do the same as
	// DeleteThreadReflectedTransformMap(), just restricted to the channels of
	// this interp.

	rtmPtr = clientData
	for hPtr = XTcl_FirstHashEntry(tls, rtmPtr, bp); hPtr != uintptr(0); hPtr = XTcl_FirstHashEntry(tls, rtmPtr, bp) {
		rtPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fdead = 1
		XTcl_DeleteHashEntry(tls, hPtr)
	}
	XTcl_DeleteHashTable(tls, rtmPtr)
	XTclpFree(tls, rtmPtr)

	// The origin interpreter for one or more reflected channels is gone.

	// Get the map of all channels handled by the current thread. This is a
	// ReflectedTransformMap, but on a per-thread basis, not per-interp. Go
	// through the channels and remove all which were handled by this
	// interpreter. They have already been marked as dead.

	rtmPtr = sGetThreadReflectedTransformMap(tls)
	for hPtr = XTcl_FirstHashEntry(tls, rtmPtr, bp); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
		rtPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp != interp {
			// Ignore entries for other interpreters.

			continue
		}

		(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fdead = 1
		sFreeReflectedTransformArgs(tls, rtPtr)
		XTcl_DeleteHashEntry(tls, hPtr)
	}

	// Go through the list of pending results and cancel all whose events were
	// destined for this interpreter. While this is in progress we block any
	// other access to the list of pending results.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rtForwardMutex)))

	for resultPtr = forwardList1; resultPtr != uintptr(0); resultPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr {
		if (*ForwardingResult)(unsafe.Pointer(resultPtr)).Fdsti != interp {
			// Ignore results/events for other interpreters.

			continue
		}

		// The receiver for the event exited, before processing the event. We
		// detach the result now, wake the originator up and signal failure.

		evPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr
		if evPtr == uintptr(0) {
			continue
		}
		paramPtr = (*ForwardingEvent1)(unsafe.Pointer(evPtr)).Fparam

		(*ForwardingEvent1)(unsafe.Pointer(evPtr)).FresultPtr = uintptr(0)
		(*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr = uintptr(0)
		(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult = TCL_ERROR

		for ok := true; ok; ok = 0 != 0 {
			(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
			(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 0
			(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = msg_send_dstlost1
		}

		XTcl_ConditionNotify(tls, resultPtr+24)
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rtForwardMutex)))
}

//----------------------------------------------------------------------
//
// GetThreadReflectedTransformMap --
//
//	Gets and potentially initializes the reflected channel map for a
//	thread.
//
// Results:
//	A pointer to the map created, for use by the caller.
//
// Side effects:
//	Initializes the reflected channel map for a thread.
//
//----------------------------------------------------------------------

func sGetThreadReflectedTransformMap(tls *libc.TLS) uintptr { /* tclIORTrans.c:2287:30: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey5)), int32(unsafe.Sizeof(ThreadSpecificData5{})))

	if !(int32((*ThreadSpecificData5)(unsafe.Pointer(tsdPtr)).FrtmPtr) != 0) {
		(*ThreadSpecificData5)(unsafe.Pointer(tsdPtr)).FrtmPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ReflectedTransformMap{})))
		XTcl_InitHashTable(tls, (*ThreadSpecificData5)(unsafe.Pointer(tsdPtr)).FrtmPtr, 0)
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteThreadReflectedTransformMap})), uintptr(0))
	}

	return (*ThreadSpecificData5)(unsafe.Pointer(tsdPtr)).FrtmPtr
}

//----------------------------------------------------------------------
//
// DeleteThreadReflectedTransformMap --
//
//	Deletes the channel table for a thread. This procedure is invoked when
//	a thread is deleted. The channels have already been marked as dead, in
//	DeleteReflectedTransformMap().
//
// Results:
//	None.
//
// Side effects:
//	Deletes the hash table of channels.
//
//----------------------------------------------------------------------

func sDeleteThreadReflectedTransformMap(tls *libc.TLS, dummy ClientData) { /* tclIORTrans.c:2320:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var hSearch Tcl_HashSearch at bp, 24
	// Search variable.
	var hPtr uintptr // Search variable.
	var self Tcl_ThreadId = XTcl_GetCurrentThread(tls)
	var rtmPtr uintptr // The map
	var resultPtr uintptr
	_ = dummy

	// The origin thread for one or more reflected channels is gone.
	// NOTE: If this function is called due to a thread getting killed the
	//       per-interp DeleteReflectedTransformMap is apparently not called.

	// Get the map of all channels handled by the current thread. This is a
	// ReflectedTransformMap, but on a per-thread basis, not per-interp. Go
	// through the channels, remove all, mark them as dead.

	rtmPtr = sGetThreadReflectedTransformMap(tls)
	for hPtr = XTcl_FirstHashEntry(tls, rtmPtr, bp); hPtr != uintptr(0); hPtr = XTcl_FirstHashEntry(tls, rtmPtr, bp) {
		var rtPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fdead = 1
		sFreeReflectedTransformArgs(tls, rtPtr)
		XTcl_DeleteHashEntry(tls, hPtr)
	}
	XTclpFree(tls, rtmPtr)

	// Go through the list of pending results and cancel all whose events were
	// destined for this thread. While this is in progress we block any
	// other access to the list of pending results.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rtForwardMutex)))

	for resultPtr = forwardList1; resultPtr != uintptr(0); resultPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr {
		var evPtr uintptr
		var paramPtr uintptr

		if (*ForwardingResult)(unsafe.Pointer(resultPtr)).Fdst != self {
			// Ignore results/events for other threads.

			continue
		}

		// The receiver for the event exited, before processing the event. We
		// detach the result now, wake the originator up and signal failure.

		evPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr
		if evPtr == uintptr(0) {
			continue
		}
		paramPtr = (*ForwardingEvent1)(unsafe.Pointer(evPtr)).Fparam

		(*ForwardingEvent1)(unsafe.Pointer(evPtr)).FresultPtr = uintptr(0)
		(*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr = uintptr(0)
		(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult = TCL_ERROR

		for ok := true; ok; ok = 0 != 0 {
			(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
			(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 0
			(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = msg_send_dstlost1
		}

		XTcl_ConditionNotify(tls, resultPtr+24)
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rtForwardMutex)))
}

func sForwardOpToOwnerThread(tls *libc.TLS, rtPtr uintptr, op ForwardedOperation, param uintptr) { /* tclIORTrans.c:2398:1: */
	var dst Tcl_ThreadId = (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread
	var evPtr uintptr
	var resultPtr uintptr

	// We gather the lock early. This allows us to check the liveness of the
	// channel without interference from DeleteThreadReflectedTransformMap().

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rtForwardMutex)))

	if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fdead != 0 {
		// The channel is marked as dead. Bail out immediately, with an
		// appropriate error. Do not forget to unlock the mutex on this path.

		for ok := true; ok; ok = 0 != 0 {
			(*ForwardParamBase)(unsafe.Pointer(param)).Fcode = TCL_ERROR
			(*ForwardParamBase)(unsafe.Pointer(param)).FmustFree = 0
			(*ForwardParamBase)(unsafe.Pointer(param)).FmsgStr = msg_send_dstlost1
		}
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rtForwardMutex)))
		return
	}

	// Create and initialize the event and data structures.

	evPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ForwardingEvent1{})))
	resultPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ForwardingResult{})))

	(*ForwardingEvent1)(unsafe.Pointer(evPtr)).Fevent.Fproc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, int32) int32
	}{sForwardProc1}))
	(*ForwardingEvent1)(unsafe.Pointer(evPtr)).FresultPtr = resultPtr
	(*ForwardingEvent1)(unsafe.Pointer(evPtr)).Fop = op
	(*ForwardingEvent1)(unsafe.Pointer(evPtr)).FrtPtr = rtPtr
	(*ForwardingEvent1)(unsafe.Pointer(evPtr)).Fparam = param

	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fsrc = XTcl_GetCurrentThread(tls)
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fdst = dst
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fdsti = (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fdone = uintptr(0)
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult = -1
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr = evPtr

	// Now execute the forward.

	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr = forwardList1
	if forwardList1 != uintptr(0) {
		(*ForwardingResult)(unsafe.Pointer(forwardList1)).FprevPtr = resultPtr
	}
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FprevPtr = uintptr(0)
	forwardList1 = resultPtr

	// Do not unlock here. That is done by the ConditionWait

	// Ensure cleanup of the event if the origin thread exits while this event
	// is pending or in progress. Exit of the destination thread is handled by
	// DeleteThreadReflectionChannelMap(), this is set up by
	// GetThreadReflectedTransformMap(). This is what we use the 'forwardList'
	// (see above) for.

	XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sSrcExitProc1})), evPtr)

	// Queue the event and poke the other thread's notifier.

	XTcl_ThreadQueueEvent(tls, dst, evPtr, TCL_QUEUE_TAIL)
	XTcl_ThreadAlert(tls, dst)

	// (*) Block until the other thread has either processed the transfer or
	// rejected it.

	for (*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult < 0 {
		// NOTE (1): Is it possible that the current thread goes away while
		// waiting here? IOW Is it possible that "SrcExitProc" is called
		// while we are here? See complementary note (2) in "SrcExitProc"
		//
		// The ConditionWait unlocks the mutex during the wait and relocks it
		// immediately after.

		XTcl_ConditionWait(tls, resultPtr+24, uintptr(unsafe.Pointer(&rtForwardMutex)), uintptr(0))
	}

	// Unlink result from the forwarder list. No need to lock. Either still
	// locked, or locked by the ConditionWait

	if (*ForwardingResult)(unsafe.Pointer(resultPtr)).FprevPtr != uintptr(0) {
		(*ForwardingResult)(unsafe.Pointer((*ForwardingResult)(unsafe.Pointer(resultPtr)).FprevPtr)).FnextPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr
	} else {
		forwardList1 = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr
	}
	if (*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr != uintptr(0) {
		(*ForwardingResult)(unsafe.Pointer((*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr)).FprevPtr = (*ForwardingResult)(unsafe.Pointer(resultPtr)).FprevPtr
	}

	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FnextPtr = uintptr(0)
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FprevPtr = uintptr(0)

	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rtForwardMutex)))
	XTcl_ConditionFinalize(tls, resultPtr+24)

	// Kill the cleanup handler now, and the result structure as well, before
	// returning the success code.
	//
	// Note: The event structure has already been deleted by the destination
	// notifier, after it serviced the event.

	XTcl_DeleteThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sSrcExitProc1})), evPtr)

	XTclpFree(tls, resultPtr)
}

func sForwardProc1(tls *libc.TLS, evGPtr uintptr, mask int32) int32 { /* tclIORTrans.c:2514:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// Notes regarding access to the referenced data.
	//
	// In principle the data belongs to the originating thread (see
	// evPtr->src), however this thread is currently blocked at (*), i.e.
	// quiescent. Because of this we can treat the data as belonging to us,
	// without fear of race conditions. I.e. we can read and write as we like.
	//
	// The only thing we cannot be sure of is the resultPtr. This can be be
	// NULLed if the originating thread went away while the event is handled
	// here now.

	var evPtr uintptr = evGPtr
	var resultPtr uintptr = (*ForwardingEvent1)(unsafe.Pointer(evPtr)).FresultPtr
	var rtPtr uintptr = (*ForwardingEvent1)(unsafe.Pointer(evPtr)).FrtPtr
	var interp uintptr = (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp
	var paramPtr uintptr = (*ForwardingEvent1)(unsafe.Pointer(evPtr)).Fparam
	*(*uintptr)(unsafe.Pointer(bp /* resObj */)) = uintptr(0) // Interp result of InvokeTclMethod
	var rtmPtr uintptr
	// Map of reflected channels with handlers in
	// this interp.
	var hPtr uintptr // Entry in the above map
	_ = mask

	// Ignore the event if no one is waiting for its result anymore.

	if !(resultPtr != 0) {
		return 1
	}

	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_OK
	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = uintptr(0)
	(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 0

	switch (*ForwardingEvent1)(unsafe.Pointer(evPtr)).Fop {
	// The destination thread for the following operations is
	// rtPtr->thread, which contains rtPtr->interp, the interp we have to
	// call upon for the driver.

	case ForwardedOperation(1) /* ForwardedClose */ :
		// No parameters/results.

		if sInvokeTclMethod1(tls, rtPtr, ts+35880, uintptr(0), uintptr(0),
			bp) != TCL_OK {
			sForwardSetObjError1(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp /* resObj */)))
		}

		// Freeing is done here, in the origin thread, because the argv[]
		// objects belong to this thread. Deallocating them in a different
		// thread is not allowed

		// Remove the channel from the map before releasing the memory, to
		// prevent future accesses (like by 'postevent') from finding and
		// dereferencing a dangling pointer.

		rtmPtr = sGetReflectedTransformMap(tls, interp)
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rtmPtr /* &.map */)).FfindProc})).f(tls, rtmPtr /* &.map */, XTcl_GetString(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fhandle))
		XTcl_DeleteHashEntry(tls, hPtr)

		// In a threaded interpreter we manage a per-thread map as well, to
		// allow us to survive if the script level pulls the rug out under a
		// channel by deleting the owning thread.

		rtmPtr = sGetThreadReflectedTransformMap(tls)
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(rtmPtr /* &.map */)).FfindProc})).f(tls, rtmPtr /* &.map */, XTcl_GetString(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fhandle))
		XTcl_DeleteHashEntry(tls, hPtr)

		sFreeReflectedTransformArgs(tls, rtPtr)
		break

	case ForwardedOperation(4) /* ForwardedInput */ :
		{
			var bufObj uintptr = XTcl_NewByteArrayObj(tls, (*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf, (*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fsize)
			(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount++

			if sInvokeTclMethod1(tls, rtPtr, ts+5472, bufObj, uintptr(0), bp) != TCL_OK {
				sForwardSetObjError1(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp /* resObj */)))
				(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fsize = -1
			} else {
				// Process a regular return. Contains the transformation result.
				// Sent it back to the request originator.

				// var bytec int32 at bp+8, 4
				// Number of returned bytes
				var bytev uintptr
				// Array of returned bytes

				bytev = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp /* resObj */)), bp+8)

				(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fsize = *(*int32)(unsafe.Pointer(bp + 8 /* bytec */))

				if *(*int32)(unsafe.Pointer(bp + 8)) > 0 {
					(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 8))))
					libc.Xmemcpy(tls, (*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf, bytev, uint64(*(*int32)(unsafe.Pointer(bp + 8 /* bytec */))))
				} else {
					(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf = uintptr(0)
				}
			}

			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = bufObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			break

		}

	case ForwardedOperation(6) /* ForwardedOutput */ :
		{
			var bufObj uintptr = XTcl_NewByteArrayObj(tls, (*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf, (*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fsize)
			(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount++

			if sInvokeTclMethod1(tls, rtPtr, ts+33034, bufObj, uintptr(0), bp) != TCL_OK {
				sForwardSetObjError1(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp /* resObj */)))
				(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fsize = -1
			} else {
				// Process a regular return. Contains the transformation result.
				// Sent it back to the request originator.

				// var bytec int32 at bp+12, 4
				// Number of returned bytes
				var bytev uintptr
				// Array of returned bytes

				bytev = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp /* resObj */)), bp+12)

				(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fsize = *(*int32)(unsafe.Pointer(bp + 12 /* bytec */))

				if *(*int32)(unsafe.Pointer(bp + 12)) > 0 {
					(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 12))))
					libc.Xmemcpy(tls, (*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf, bytev, uint64(*(*int32)(unsafe.Pointer(bp + 12 /* bytec */))))
				} else {
					(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf = uintptr(0)
				}
			}

			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr = bufObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			break

		}

	case ForwardedDrain:
		if sInvokeTclMethod1(tls, rtPtr, ts+37201, uintptr(0), uintptr(0), bp) != TCL_OK {
			sForwardSetObjError1(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp /* resObj */)))
			(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fsize = -1
		} else {
			// Process a regular return. Contains the transformation result.
			// Sent it back to the request originator.

			// var bytec int32 at bp+16, 4
			// Number of returned bytes
			var bytev uintptr // Array of returned bytes

			bytev = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp /* resObj */)), bp+16)

			(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fsize = *(*int32)(unsafe.Pointer(bp + 16 /* bytec */))

			if *(*int32)(unsafe.Pointer(bp + 16)) > 0 {
				(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 16))))
				libc.Xmemcpy(tls, (*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf, bytev, uint64(*(*int32)(unsafe.Pointer(bp + 16 /* bytec */))))
			} else {
				(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf = uintptr(0)
			}
		}
		break

	case ForwardedFlush:
		if sInvokeTclMethod1(tls, rtPtr, ts+5438, uintptr(0), uintptr(0), bp) != TCL_OK {
			sForwardSetObjError1(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp /* resObj */)))
			(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fsize = -1
		} else {
			// Process a regular return. Contains the transformation result.
			// Sent it back to the request originator.

			// var bytec int32 at bp+20, 4
			// Number of returned bytes
			var bytev uintptr
			// Array of returned bytes

			bytev = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp /* resObj */)), bp+20)

			(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fsize = *(*int32)(unsafe.Pointer(bp + 20 /* bytec */))

			if *(*int32)(unsafe.Pointer(bp + 20)) > 0 {
				(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 20))))
				libc.Xmemcpy(tls, (*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf, bytev, uint64(*(*int32)(unsafe.Pointer(bp + 20 /* bytec */))))
			} else {
				(*ForwardParamTransform)(unsafe.Pointer(paramPtr)).Fbuf = uintptr(0)
			}
		}
		break

	case ForwardedClear:
		sInvokeTclMethod1(tls, rtPtr, ts+37195, uintptr(0), uintptr(0), uintptr(0))
		break

	case ForwardedLimit:
		if sInvokeTclMethod1(tls, rtPtr, ts+37207, uintptr(0), uintptr(0), bp) != TCL_OK {
			sForwardSetObjError1(tls, paramPtr, *(*uintptr)(unsafe.Pointer(bp /* resObj */)))
			(*ForwardParamLimit)(unsafe.Pointer(paramPtr)).Fmax = -1
		} else if XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)),
			paramPtr+24) != TCL_OK {
			sForwardSetObjError1(tls, paramPtr, sMarshallError1(tls, interp))
			(*ForwardParamLimit)(unsafe.Pointer(paramPtr)).Fmax = -1
		}
		break

	default:
		// Bad operation code.
		XTcl_Panic(tls, ts+37147, 0)
		break
	}

	// Remove the reference we held on the result of the invoke, if we had
	// such.

	if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	if resultPtr != 0 {
		// Report the forwarding result synchronously to the waiting caller.
		// This unblocks (*) as well. This is wrapped into a conditional
		// because the caller may have exited in the mean time.

		XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rtForwardMutex)))
		(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult = TCL_OK
		XTcl_ConditionNotify(tls, resultPtr+24)
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rtForwardMutex)))
	}

	return 1
}

func sSrcExitProc1(tls *libc.TLS, clientData ClientData) { /* tclIORTrans.c:2771:1: */
	var evPtr uintptr = clientData
	var resultPtr uintptr
	var paramPtr uintptr

	// NOTE (2): Can this handler be called with the originator blocked?

	// The originator for the event exited. It is not sure if this can happen,
	// as the originator should be blocked at (*) while the event is in
	// transit/pending.
	//
	// We make sure that the event cannot refer to the result anymore, remove
	// it from the list of pending results and free the structure. Locking the
	// access ensures that we cannot get in conflict with "ForwardProc",
	// should it already execute the event.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&rtForwardMutex)))

	resultPtr = (*ForwardingEvent1)(unsafe.Pointer(evPtr)).FresultPtr
	paramPtr = (*ForwardingEvent1)(unsafe.Pointer(evPtr)).Fparam

	(*ForwardingEvent1)(unsafe.Pointer(evPtr)).FresultPtr = uintptr(0)
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).FevPtr = uintptr(0)
	(*ForwardingResult)(unsafe.Pointer(resultPtr)).Fresult = TCL_ERROR

	for ok := true; ok; ok = 0 != 0 {
		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 0
		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = msg_send_originlost1
	}

	// See below: TclSpliceOut(resultPtr, forwardList);

	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&rtForwardMutex)))

	// This unlocks (*). The structure will be spliced out and freed by
	// "ForwardProc". Maybe.

	XTcl_ConditionNotify(tls, resultPtr+24)
}

func sForwardSetObjError1(tls *libc.TLS, paramPtr uintptr, obj uintptr) { /* tclIORTrans.c:2819:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var len int32 at bp, 4

	var msgStr uintptr = XTcl_GetStringFromObj(tls, obj, bp)

	*(*int32)(unsafe.Pointer(bp /* len */))++
	for ok := true; ok; ok = 0 != 0 {
		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).Fcode = TCL_ERROR
		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmustFree = 1
		(*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp))))
	}
	libc.Xmemcpy(tls, (*ForwardParamBase)(unsafe.Pointer(paramPtr)).FmsgStr, msgStr, uint64(*(*int32)(unsafe.Pointer(bp /* len */))))
}

//----------------------------------------------------------------------
//
// TimerKill --
//
//	Timer management. Removes the internal timer if it exists.
//
// Side effects:
//	See above.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sTimerKill(tls *libc.TLS, rtPtr uintptr) { /* tclIORTrans.c:2849:1: */
	if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Ftimer == uintptr(0) {
		return
	}

	// Delete an existing flush-out timer, prevent it from firing on a
	// removed/dead channel.

	XTcl_DeleteTimerHandler(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Ftimer)
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Ftimer = uintptr(0)
}

//----------------------------------------------------------------------
//
// TimerSetup --
//
//	Timer management. Creates the internal timer if it does not exist.
//
// Side effects:
//	See above.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sTimerSetup(tls *libc.TLS, rtPtr uintptr) { /* tclIORTrans.c:2882:1: */
	if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Ftimer != uintptr(0) {
		return
	}

	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Ftimer = XTcl_CreateTimerHandler(tls, SYNTHETIC_EVENT_TIME,
		*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sTimerRun})), rtPtr)
}

//----------------------------------------------------------------------
//
// TimerRun --
//
//	Called by the notifier (-> timer) to flush out information waiting in
//	channel buffers.
//
// Side effects:
//	As of 'Tcl_NotifyChannel'.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sTimerRun(tls *libc.TLS, clientData ClientData) { /* tclIORTrans.c:2911:1: */
	var rtPtr uintptr = clientData

	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).Ftimer = uintptr(0)
	XTcl_NotifyChannel(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, int32(1)<<1)
}

//----------------------------------------------------------------------
//
// ResultInit --
//
//	Initializes the specified buffer structure. The structure will contain
//	valid information for an emtpy buffer.
//
// Side effects:
//	See above.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sResultInit1(tls *libc.TLS, rPtr uintptr) { /* tclIORTrans.c:2938:1: */
	(*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused = 0
	(*ResultBuffer1)(unsafe.Pointer(rPtr)).Fallocated = 0
	(*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf = uintptr(0)
}

//----------------------------------------------------------------------
//
// ResultClear --
//
//	Deallocates any memory allocated by 'ResultAdd'.
//
// Side effects:
//	See above.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sResultClear1(tls *libc.TLS, rPtr uintptr) { /* tclIORTrans.c:2963:1: */
	(*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused = 0

	if !((*ResultBuffer1)(unsafe.Pointer(rPtr)).Fallocated != 0) {
		return
	}

	XTclpFree(tls, (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf)
	(*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf = uintptr(0)
	(*ResultBuffer1)(unsafe.Pointer(rPtr)).Fallocated = 0
}

//----------------------------------------------------------------------
//
// ResultAdd --
//
//	Adds the bytes in the specified array to the buffer, by appending it.
//
// Side effects:
//	See above.
//
// Result:
//	None.
//
//----------------------------------------------------------------------

func sResultAdd1(tls *libc.TLS, rPtr uintptr, buf uintptr, toWrite int32) { /* tclIORTrans.c:2994:1: */
	if (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused+toWrite+1 > (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fallocated {
		// Extension of the internal buffer is required.
		// NOTE: Currently linear. Should be doubling to amortize.

		if (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fallocated == 0 {
			(*ResultBuffer1)(unsafe.Pointer(rPtr)).Fallocated = toWrite + 512
			(*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf = XTcl_Alloc(tls, uint32((*ResultBuffer1)(unsafe.Pointer(rPtr)).Fallocated))
		} else {
			*(*int32)(unsafe.Pointer(rPtr + 8)) += toWrite + 512
			(*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf = XTcl_Realloc(tls, (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf, uint32((*ResultBuffer1)(unsafe.Pointer(rPtr)).Fallocated))
		}
	}

	// Now copy data.

	libc.Xmemcpy(tls, (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf+uintptr((*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused), buf, uint64(toWrite))
	*(*int32)(unsafe.Pointer(rPtr + 12)) += toWrite
}

//----------------------------------------------------------------------
//
// ResultCopy --
//
//	Copies the requested number of bytes from the buffer into the
//	specified array and removes them from the buffer afterward. Copies
//	less if there is not enough data in the buffer.
//
// Side effects:
//	See above.
//
// Result:
//	The number of actually copied bytes, possibly less than 'toRead'.
//
//----------------------------------------------------------------------

func sResultCopy1(tls *libc.TLS, rPtr uintptr, buf uintptr, toRead int32) int32 { /* tclIORTrans.c:3042:1: */
	var copied int32

	if (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused == 0 {
		// Nothing to copy in the case of an empty buffer.

		copied = 0
	} else if (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused == toRead {
		// We have just enough. Copy everything to the caller.

		libc.Xmemcpy(tls, buf, (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf, uint64(toRead))
		(*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused = 0
		copied = toRead
	} else if (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused > toRead {
		// The internal buffer contains more than requested. Copy the
		// requested subset to the caller, and shift the remaining bytes down.

		libc.Xmemcpy(tls, buf, (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf, uint64(toRead))
		libc.Xmemmove(tls, (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf, (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf+uintptr(toRead), uint64((*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused-toRead))

		*(*int32)(unsafe.Pointer(rPtr + 12)) -= toRead
		copied = toRead
	} else {
		// There is not enough in the buffer to satisfy the caller, so take
		// everything.

		libc.Xmemcpy(tls, buf, (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fbuf, uint64((*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused))
		toRead = (*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused
		(*ResultBuffer1)(unsafe.Pointer(rPtr)).Fused = 0
		copied = toRead
	}

	// -- common postwork code -------

	return copied
}

func sTransformRead(tls *libc.TLS, rtPtr uintptr, errorCodePtr uintptr, bufObj uintptr) int32 { /* tclIORTrans.c:3092:1: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	// var resObj uintptr at bp+40, 8

	// var bytec int32 at bp+48, 4
	// Number of returned bytes
	var bytev uintptr // Array of returned bytes

	// Are we in the correct thread?

	if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread != XTcl_GetCurrentThread(tls) {
		// var p ForwardParam1 at bp, 40

		(*ForwardParamTransform)(unsafe.Pointer(bp)).Fbuf = XTcl_GetByteArrayFromObj(tls, bufObj,
			bp+32)

		sForwardOpToOwnerThread(tls, rtPtr, uint32(4) /* ForwardedInput */, bp)

		if (*ForwardParamBase)(unsafe.Pointer(bp)).Fcode != TCL_OK {
			for ok := true; ok; ok = 0 != 0 {
				XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr, -1))
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0 {
						XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
					}
				}
			}
			*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
			return 0
		}

		*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
		sResultAdd1(tls, rtPtr+88, (*ForwardParamTransform)(unsafe.Pointer(bp)).Fbuf, (*ForwardParamTransform)(unsafe.Pointer(bp)).Fsize)
		XTclpFree(tls, (*ForwardParamTransform)(unsafe.Pointer(bp)).Fbuf)
		return 1
	}

	// ASSERT: rtPtr->method & FLAG(METH_READ)
	// ASSERT: rtPtr->mode & TCL_READABLE

	if sInvokeTclMethod1(tls, rtPtr, ts+5472, bufObj, uintptr(0), bp+40) != TCL_OK {
		XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		} // Remove reference held from invoke
		*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
		return 0
	}

	bytev = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)), bp+48)
	sResultAdd1(tls, rtPtr+88, bytev, *(*int32)(unsafe.Pointer(bp + 48 /* bytec */)))

	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	} // Remove reference held from invoke
	return 1
}

func sTransformWrite(tls *libc.TLS, rtPtr uintptr, errorCodePtr uintptr, buf uintptr, toWrite int32) int32 { /* tclIORTrans.c:3145:1: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	var bufObj uintptr
	// var resObj uintptr at bp+40, 8

	// var bytec int32 at bp+48, 4
	// Number of returned bytes
	var bytev uintptr // Array of returned bytes
	var res int32

	// Are we in the correct thread?

	if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread != XTcl_GetCurrentThread(tls) {
		// var p ForwardParam1 at bp, 40

		(*ForwardParamTransform)(unsafe.Pointer(bp)).Fbuf = buf
		(*ForwardParamTransform)(unsafe.Pointer(bp)).Fsize = toWrite

		sForwardOpToOwnerThread(tls, rtPtr, uint32(6) /* ForwardedOutput */, bp)

		if (*ForwardParamBase)(unsafe.Pointer(bp)).Fcode != TCL_OK {
			for ok := true; ok; ok = 0 != 0 {
				XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr, -1))
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0 {
						XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
					}
				}
			}
			*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
			return 0
		}

		*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
		res = XTcl_WriteRaw(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent, (*ForwardParamTransform)(unsafe.Pointer(bp)).Fbuf,
			(*ForwardParamTransform)(unsafe.Pointer(bp)).Fsize)
		XTclpFree(tls, (*ForwardParamTransform)(unsafe.Pointer(bp)).Fbuf)
	} else {
		// ASSERT: rtPtr->method & FLAG(METH_WRITE)
		// ASSERT: rtPtr->mode & TCL_WRITABLE

		bufObj = XTcl_NewByteArrayObj(tls, buf, toWrite)
		(*Tcl_Obj)(unsafe.Pointer(bufObj)).FrefCount++
		if sInvokeTclMethod1(tls, rtPtr, ts+33034, bufObj, uintptr(0), bp+40) != TCL_OK {
			*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
			XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))

			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = bufObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			} // Remove reference held from invoke
			return 0
		}

		*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK

		bytev = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)), bp+48)
		res = XTcl_WriteRaw(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent, bytev, *(*int32)(unsafe.Pointer(bp + 48 /* bytec */)))

		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr = bufObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok5 := true; ok5; ok5 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		} // Remove reference held from invoke
	}

	if res < 0 {
		*(*int32)(unsafe.Pointer(errorCodePtr)) = XTcl_GetErrno(tls)
		return 0
	}

	return 1
}

func sTransformDrain(tls *libc.TLS, rtPtr uintptr, errorCodePtr uintptr) int32 { /* tclIORTrans.c:3215:1: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	// var resObj uintptr at bp+40, 8

	// var bytec int32 at bp+48, 4
	// Number of returned bytes
	var bytev uintptr // Array of returned bytes

	// Are we in the correct thread?

	if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread != XTcl_GetCurrentThread(tls) {
		// var p ForwardParam1 at bp, 40

		sForwardOpToOwnerThread(tls, rtPtr, ForwardedDrain, bp)

		if (*ForwardParamBase)(unsafe.Pointer(bp)).Fcode != TCL_OK {
			for ok := true; ok; ok = 0 != 0 {
				XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr, -1))
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0 {
						XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
					}
				}
			}
			*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
			return 0
		}

		*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
		sResultAdd1(tls, rtPtr+88, (*ForwardParamTransform)(unsafe.Pointer(bp)).Fbuf, (*ForwardParamTransform)(unsafe.Pointer(bp)).Fsize)
		XTclpFree(tls, (*ForwardParamTransform)(unsafe.Pointer(bp)).Fbuf)
	} else {
		if sInvokeTclMethod1(tls, rtPtr, ts+37201, uintptr(0), uintptr(0), bp+40) != TCL_OK {
			XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			} // Remove reference held from invoke
			*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
			return 0
		}

		bytev = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)), bp+48)
		sResultAdd1(tls, rtPtr+88, bytev, *(*int32)(unsafe.Pointer(bp + 48 /* bytec */)))

		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		} // Remove reference held from invoke
	}

	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).FreadIsDrained = 1
	return 1
}

func sTransformFlush(tls *libc.TLS, rtPtr uintptr, errorCodePtr uintptr, op int32) int32 { /* tclIORTrans.c:3263:1: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	// var resObj uintptr at bp+40, 8

	// var bytec int32 at bp+48, 4
	// Number of returned bytes
	var bytev uintptr // Array of returned bytes
	var res int32

	// Are we in the correct thread?

	if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread != XTcl_GetCurrentThread(tls) {
		// var p ForwardParam1 at bp, 40

		sForwardOpToOwnerThread(tls, rtPtr, ForwardedFlush, bp)

		if (*ForwardParamBase)(unsafe.Pointer(bp)).Fcode != TCL_OK {
			for ok := true; ok; ok = 0 != 0 {
				XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr, -1))
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0 {
						XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
					}
				}
			}
			*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
			return 0
		}

		*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
		if op == FLUSH_WRITE {
			res = XTcl_WriteRaw(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent, (*ForwardParamTransform)(unsafe.Pointer(bp)).Fbuf,
				(*ForwardParamTransform)(unsafe.Pointer(bp)).Fsize)
		} else {
			res = 0
		}
		XTclpFree(tls, (*ForwardParamTransform)(unsafe.Pointer(bp)).Fbuf)
	} else {
		if sInvokeTclMethod1(tls, rtPtr, ts+5438, uintptr(0), uintptr(0), bp+40) != TCL_OK {
			XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			} // Remove reference held from invoke
			*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
			return 0
		}

		if op == FLUSH_WRITE {
			bytev = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)), bp+48)
			res = XTcl_WriteRaw(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fparent, bytev, *(*int32)(unsafe.Pointer(bp + 48 /* bytec */)))
		} else {
			res = 0
		}
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		} // Remove reference held from invoke
	}

	if res < 0 {
		*(*int32)(unsafe.Pointer(errorCodePtr)) = XTcl_GetErrno(tls)
		return 0
	}

	return 1
}

func sTransformClear(tls *libc.TLS, rtPtr uintptr) { /* tclIORTrans.c:3325:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	// Are we in the correct thread?

	if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread != XTcl_GetCurrentThread(tls) {
		// var p ForwardParam1 at bp, 40

		sForwardOpToOwnerThread(tls, rtPtr, ForwardedClear, bp)
		return
	}

	// ASSERT: rtPtr->method & FLAG(METH_READ)
	// ASSERT: rtPtr->mode & TCL_READABLE

	sInvokeTclMethod1(tls, rtPtr, ts+37195, uintptr(0), uintptr(0), uintptr(0))

	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).FreadIsDrained = 0
	(*ReflectedTransform)(unsafe.Pointer(rtPtr)).FeofPending = 0
	sResultClear1(tls, rtPtr+88)
}

func sTransformLimit(tls *libc.TLS, rtPtr uintptr, errorCodePtr uintptr, maxPtr uintptr) int32 { /* tclIORTrans.c:3352:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	// var resObj uintptr at bp+40, 8

	var sr Tcl_InterpState // State of handler interp

	// Are we in the correct thread?

	if (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fthread != XTcl_GetCurrentThread(tls) {
		// var p ForwardParam1 at bp, 40

		sForwardOpToOwnerThread(tls, rtPtr, ForwardedLimit, bp)

		if (*ForwardParamBase)(unsafe.Pointer(bp)).Fcode != TCL_OK {
			for ok := true; ok; ok = 0 != 0 {
				XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, XTcl_NewStringObj(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr, -1))
				for ok1 := true; ok1; ok1 = 0 != 0 {
					if (*ForwardParamBase)(unsafe.Pointer(bp)).FmustFree != 0 {
						XTclpFree(tls, (*ForwardParamBase)(unsafe.Pointer(bp)).FmsgStr)
					}
				}
			}
			*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
			return 0
		}

		*(*int32)(unsafe.Pointer(errorCodePtr)) = EOK
		*(*int32)(unsafe.Pointer(maxPtr)) = (*ForwardParamLimit)(unsafe.Pointer(bp)).Fmax
		return 1
	}

	// ASSERT: rtPtr->method & FLAG(METH_WRITE)
	// ASSERT: rtPtr->mode & TCL_WRITABLE

	if sInvokeTclMethod1(tls, rtPtr, ts+37207, uintptr(0), uintptr(0), bp+40) != TCL_OK {
		XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, *(*uintptr)(unsafe.Pointer(bp + 40 /* resObj */)))
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		} // Remove reference held from invoke
		*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
		return 0
	}

	sr = XTcl_SaveInterpState(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp, 0)

	if XTcl_GetIntFromObj(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp, *(*uintptr)(unsafe.Pointer(bp + 40)), maxPtr) != TCL_OK {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		} // Remove reference held from invoke
		XTcl_SetChannelError(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Fchan, sMarshallError1(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp))
		*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL

		XTcl_RestoreInterpState(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp, sr)
		return 0
	}

	for ok4 := true; ok4; ok4 = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	} // Remove reference held from invoke
	XTcl_RestoreInterpState(tls, (*ReflectedTransform)(unsafe.Pointer(rtPtr)).Finterp, sr)
	return 1
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//---------------------------------------------------------------------------
//
// TclSockGetPort --
//
//	Maps from a string, which could be a service name, to a port. Used by
//	socket creation code to get port numbers and resolve registered
//	service names to port numbers.
//
// Results:
//	A standard Tcl result. On success, the port number is returned in
//	portPtr. On failure, an error message is left in the interp's result.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclSockGetPort(tls *libc.TLS, interp uintptr, string uintptr, proto uintptr, portPtr uintptr) int32 { /* tclIOSock.c:57:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var sp uintptr // Protocol info for named services
	// var ds Tcl_DString at bp, 216

	var native uintptr

	if XTcl_GetInt(tls, uintptr(0), string, portPtr) != TCL_OK {
		// Don't bother translating 'proto' to native.

		native = XTcl_UtfToExternalDString(tls, uintptr(0), string, -1, bp)
		sp = libc.Xgetservbyname(tls, native, proto) // INTL: Native.
		XTcl_DStringFree(tls, bp)
		if sp != uintptr(0) {
			*(*int32)(unsafe.Pointer(portPtr)) = int32(libc.Xntohs(tls, uint16((*Servent)(unsafe.Pointer(sp)).Fs_port)))
			return TCL_OK
		}
	}
	if XTcl_GetInt(tls, interp, string, portPtr) != TCL_OK {
		return TCL_ERROR
	}
	if *(*int32)(unsafe.Pointer(portPtr)) > 0xFFFF {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+37573, -1))
		return TCL_ERROR
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclSockMinimumBuffers --
//
//	Ensure minimum buffer sizes (non zero).
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Sets SO_SNDBUF and SO_RCVBUF sizes.
//
//----------------------------------------------------------------------

func XTclSockMinimumBuffers(tls *libc.TLS, sock uintptr, size int32) int32 { /* tclIOSock.c:112:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)
	*(*int32)(unsafe.Pointer(bp + 8)) = size

	// var current int32 at bp, 4

	// var len Socklen_t at bp+4, 4

	*(*Socklen_t)(unsafe.Pointer(bp + 4 /* len */)) = Socklen_t(unsafe.Sizeof(int32(0)))
	libc.Xgetsockopt(tls, int32(sock), SOL_SOCKET, SO_SNDBUF,
		bp, bp+4)
	if *(*int32)(unsafe.Pointer(bp)) < *(*int32)(unsafe.Pointer(bp + 8)) {
		*(*Socklen_t)(unsafe.Pointer(bp + 4 /* len */)) = Socklen_t(unsafe.Sizeof(int32(0)))
		libc.Xsetsockopt(tls, int32(sock), SOL_SOCKET, SO_SNDBUF,
			bp+8, *(*Socklen_t)(unsafe.Pointer(bp + 4 /* len */)))
	}
	*(*Socklen_t)(unsafe.Pointer(bp + 4 /* len */)) = Socklen_t(unsafe.Sizeof(int32(0)))
	libc.Xgetsockopt(tls, int32(sock), SOL_SOCKET, SO_RCVBUF,
		bp, bp+4)
	if *(*int32)(unsafe.Pointer(bp)) < *(*int32)(unsafe.Pointer(bp + 8)) {
		*(*Socklen_t)(unsafe.Pointer(bp + 4 /* len */)) = Socklen_t(unsafe.Sizeof(int32(0)))
		libc.Xsetsockopt(tls, int32(sock), SOL_SOCKET, SO_RCVBUF,
			bp+8, *(*Socklen_t)(unsafe.Pointer(bp + 4 /* len */)))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCreateSocketAddress --
//
//	This function initializes a sockaddr structure for a host and port.
//
// Results:
//	1 if the host was valid, 0 if the host could not be converted to an IP
//	address.
//
// Side effects:
//	Fills in the *sockaddrPtr structure.
//
//----------------------------------------------------------------------

func XTclCreateSocketAddress(tls *libc.TLS, interp uintptr, addrlist uintptr, host uintptr, port int32, willBind int32, errorMsgPtr uintptr) int32 { /* tclIOSock.c:156:1: */
	bp := tls.Alloc(288)
	defer tls.Free(288)

	// var hints Addrinfo at bp+240, 48

	var p uintptr
	var v4head uintptr = uintptr(0)
	var v4ptr uintptr = uintptr(0)
	var v6head uintptr = uintptr(0)
	var v6ptr uintptr = uintptr(0)
	var native uintptr = uintptr(0)
	// var portbuf [24]int8 at bp+216, 24

	var portstring uintptr
	var family uintptr = uintptr(0)
	// var ds Tcl_DString at bp, 216

	var result int32

	if host != uintptr(0) {
		native = XTcl_UtfToExternalDString(tls, uintptr(0), host, -1, bp)
	}

	// Workaround for OSX's apparent inability to resolve "localhost", "0"
	// when the loopback device is the only available network interface.
	if host != uintptr(0) && port == 0 {
		portstring = uintptr(0)
	} else {
		XTclFormatInt(tls, bp+216, int64(port))
		portstring = bp + 216 /* &portbuf[0] */
	}

	libc.Xmemset(tls, bp+240, 0, uint64(unsafe.Sizeof(Addrinfo{})))
	(*Addrinfo)(unsafe.Pointer(bp + 240 /* &hints */)).Fai_family = PF_UNSPEC

	// Magic variable to enforce a certain address family - to be superseded
	// by a TIP that adds explicit switches to [socket]

	if interp != uintptr(0) {
		family = XTcl_GetVar2(tls, interp, ts+37616, uintptr(0), 0)
		if family != uintptr(0) {
			if libc.Xstrcmp(tls, family, ts+37645) == 0 {
				(*Addrinfo)(unsafe.Pointer(bp + 240 /* &hints */)).Fai_family = PF_INET
			} else if libc.Xstrcmp(tls, family, ts+37650) == 0 {
				(*Addrinfo)(unsafe.Pointer(bp + 240 /* &hints */)).Fai_family = PF_INET6
			}
		}
	}

	(*Addrinfo)(unsafe.Pointer(bp + 240 /* &hints */)).Fai_socktype = SOCK_STREAM

	if willBind != 0 {
		*(*int32)(unsafe.Pointer(bp + 240)) |= AI_PASSIVE
	}

	result = libc.Xgetaddrinfo(tls, native, portstring, bp+240, addrlist)

	if host != uintptr(0) {
		XTcl_DStringFree(tls, bp)
	}

	if result != 0 {
		*(*uintptr)(unsafe.Pointer(errorMsgPtr)) = func() uintptr {
			if result == -11 {
				return XTcl_PosixError(tls, interp)
			}
			return libc.Xgai_strerror(tls, result)
		}()
		return 0
	}

	// Put IPv4 addresses before IPv6 addresses to maximize backwards
	// compatibility of [fconfigure -sockname] output.
	//
	// There might be more elegant/efficient ways to do this.
	if willBind != 0 {
		for p = *(*uintptr)(unsafe.Pointer(addrlist)); p != uintptr(0); p = (*Addrinfo)(unsafe.Pointer(p)).Fai_next {
			if (*Addrinfo)(unsafe.Pointer(p)).Fai_family == PF_INET {
				if v4head == uintptr(0) {
					v4head = p
				} else {
					(*Addrinfo)(unsafe.Pointer(v4ptr)).Fai_next = p
				}
				v4ptr = p
			} else {
				if v6head == uintptr(0) {
					v6head = p
				} else {
					(*Addrinfo)(unsafe.Pointer(v6ptr)).Fai_next = p
				}
				v6ptr = p
			}
		}
		*(*uintptr)(unsafe.Pointer(addrlist)) = uintptr(0)
		if v6head != uintptr(0) {
			*(*uintptr)(unsafe.Pointer(addrlist)) = v6head
			(*Addrinfo)(unsafe.Pointer(v6ptr)).Fai_next = uintptr(0)
		}
		if v4head != uintptr(0) {
			(*Addrinfo)(unsafe.Pointer(v4ptr)).Fai_next = *(*uintptr)(unsafe.Pointer(addrlist))
			*(*uintptr)(unsafe.Pointer(addrlist)) = v4head
		}
	}
	return 1
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// struct FilesystemRecord --
//
// A filesystem record is used to keep track of each filesystem currently
// registered with the core, in a linked list.

type FilesystemRecord1 = struct {
	FclientData ClientData
	FfsPtr      uintptr
	FnextPtr    uintptr
	FprevPtr    uintptr
} /* tclIOUtil.c:40:9 */

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// struct FilesystemRecord --
//
// A filesystem record is used to keep track of each filesystem currently
// registered with the core, in a linked list.

type FilesystemRecord = FilesystemRecord1 /* tclIOUtil.c:50:3 */

// This structure holds per-thread private copy of the current directory
// maintained by the global cwdPathPtr. This structure holds per-thread
// private copies of some global data. This way we avoid most of the
// synchronization calls which boosts performance, at cost of having to update
// this information each time the corresponding epoch counter changes.

type ThreadSpecificData6 = struct {
	Finitialized     int32
	F__ccgo_pad1     [4]byte
	FcwdPathEpoch    Size_t
	FfilesystemEpoch Size_t
	FcwdPathPtr      uintptr
	FcwdClientData   ClientData
	FfilesystemList  uintptr
	Fclaims          Size_t
} /* tclIOUtil.c:68:3 */

// Define the native filesystem dispatch table. If necessary, it is ok to make
// this non-static, but it should only be accessed by the functions actually
// listed within it (or perhaps other helper functions of them). Anything
// which is not part of this 'native filesystem implementation' should not be
// delving inside here!

var XtclNativeFilesystem = Tcl_Filesystem{
	FtypeName:                 ts + 37656,
	FstructureLength:          int32(unsafe.Sizeof(Tcl_Filesystem{})),
	Fversion:                  uintptr(0x2),
	FpathInFilesystemProc:     0,
	FdupInternalRepProc:       0,
	FfreeInternalRepProc:      0,
	FinternalToNormalizedProc: 0,
	FcreateInternalRepProc:    0,
	FnormalizePathProc:        0,
	FfilesystemPathTypeProc:   0,
	FfilesystemSeparatorProc:  0,
	FstatProc:                 0,
	FaccessProc:               0,
	FopenFileChannelProc:      0,
	FmatchInDirectoryProc:     0,
	FutimeProc:                0,
	FlinkProc:                 0,
	FlistVolumesProc:          0,
	FfileAttrStringsProc:      0,
	FfileAttrsGetProc:         0,
	FfileAttrsSetProc:         0,
	FcreateDirectoryProc:      0,
	FremoveDirectoryProc:      0,
	FdeleteFileProc:           0,
	FcopyFileProc:             0,
	FrenameFileProc:           0,
	FcopyDirectoryProc:        0,
	FlstatProc:                0,
	// Needs casts since we're using version_2.
	FloadFileProc: 0,
	FgetCwdProc:   0,
	FchdirProc:    0,
} /* tclIOUtil.c:153:22 */

// Define the tail of the linked list. Note that for unconventional uses of
// Tcl without a native filesystem, we may in the future wish to modify the
// current approach of hard-coding the native filesystem in the lookup list
// 'filesystemList' below.
//
// We initialize the record so that it thinks one file uses it. This means it
// will never be freed.

var nativeFilesystemRecord = FilesystemRecord{
	FfsPtr: 0,
} /* tclIOUtil.c:202:25 */

// This is incremented each time we modify the linked list of filesystems. Any
// time it changes, all cached filesystem representations are suspect and must
// be freed. For multithreading builds, change of the filesystem epoch will
// trigger cache cleanup in all threads.

var theFilesystemEpoch Size_t = uint64(1) /* tclIOUtil.c:216:15 */

// Stores the linked list of filesystems. A 1:1 copy of this list is also
// maintained in the TSD for each thread. This is to avoid synchronization
// issues.

var filesystemList uintptr = 0 /* tclIOUtil.c:224:25 */
var filesystemMutex Tcl_Mutex  /* tclIOUtil.c:225:1: */

// Used to implement Tcl_FSGetCwd in a file-system independent way.

var cwdPathPtr uintptr = uintptr(0)       /* tclIOUtil.c:231:16 */
var cwdPathEpoch Size_t = uint64(0)       /* tclIOUtil.c:232:15 */
var cwdClientData ClientData = uintptr(0) /* tclIOUtil.c:233:19 */
var cwdMutex Tcl_Mutex                    /* tclIOUtil.c:234:1: */

var fsDataKey Tcl_ThreadDataKey /* tclIOUtil.c:236:26: */

// One of these structures is used each time we successfully load a file from
// a file system by way of making a temporary copy of the file on the native
// filesystem. We need to store both the actual unloadProc/clientData
// combination which was used, and the original and modified filenames, so
// that we can correctly undo the entire operation when we want to unload the
// code.

type FsDivertLoad1 = struct {
	FloadHandle            Tcl_LoadHandle
	FunloadProcPtr         uintptr
	FdivertedFile          uintptr
	FdivertedFilesystem    uintptr
	FdivertedFileNativeRep ClientData
} /* tclIOUtil.c:247:9 */

// One of these structures is used each time we successfully load a file from
// a file system by way of making a temporary copy of the file on the native
// filesystem. We need to store both the actual unloadProc/clientData
// combination which was used, and the original and modified filenames, so
// that we can correctly undo the entire operation when we want to unload the
// code.

type FsDivertLoad = FsDivertLoad1 /* tclIOUtil.c:253:3 */

// The following functions are obsolete string based APIs, and should be
// removed in a future release (Tcl 9 would be a good time).

// Obsolete
func XTcl_Stat(tls *libc.TLS, path uintptr, oldStyleBuf uintptr) int32 { /* tclIOUtil.c:262:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	var ret int32
	// var buf Tcl_StatBuf at bp, 144

	var pathPtr uintptr = XTcl_NewStringObj(tls, path, -1)

	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount++
	ret = XTcl_FSStat(tls, pathPtr, bp)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = pathPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if ret != -1 {

		// Copy across all supported fields, with possible type coercions on
		// those fields that change between the normal and lf64 versions of
		// the stat structure (on Solaris at least). This is slow when the
		// structure sizes coincide, but that's what you get for using an
		// obsolete interface.

		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_mode = (*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_mode
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_ino = (*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_ino
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_dev = (*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_dev
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_rdev = (*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_rdev
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_nlink = (*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_nlink
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_uid = (*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_uid
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_gid = (*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_gid
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_size = (*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_size
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_atim.Ftv_sec = XTcl_GetAccessTimeFromStat(tls, bp)
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_mtim.Ftv_sec = XTcl_GetModificationTimeFromStat(tls, bp)
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_ctim.Ftv_sec = XTcl_GetChangeTimeFromStat(tls, bp)
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_blksize = (*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_blksize
		(*Stat)(unsafe.Pointer(oldStyleBuf)).Fst_blocks = (*Tcl_StatBuf)(unsafe.Pointer(bp /* &buf */)).Fst_blocks
	}
	return ret
}

// Obsolete
func XTcl_Access(tls *libc.TLS, path uintptr, mode int32) int32 { /* tclIOUtil.c:349:1: */
	var ret int32
	var pathPtr uintptr = XTcl_NewStringObj(tls, path, -1)

	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount++
	ret = XTcl_FSAccess(tls, pathPtr, mode)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = pathPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	return ret
}

// Obsolete
func XTcl_OpenFileChannel(tls *libc.TLS, interp uintptr, path uintptr, modeString uintptr, permissions int32) Tcl_Channel { /* tclIOUtil.c:365:1: */
	var ret Tcl_Channel
	var pathPtr uintptr = XTcl_NewStringObj(tls, path, -1)

	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount++
	ret = XTcl_FSOpenFileChannel(tls, interp, pathPtr, modeString, permissions)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = pathPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	return ret
}

// Obsolete
func XTcl_Chdir(tls *libc.TLS, dirName uintptr) int32 { /* tclIOUtil.c:386:1: */
	var ret int32
	var pathPtr uintptr = XTcl_NewStringObj(tls, dirName, -1)
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount++
	ret = XTcl_FSChdir(tls, pathPtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = pathPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return ret
}

// Obsolete
func XTcl_GetCwd(tls *libc.TLS, interp uintptr, cwdPtr uintptr) uintptr { /* tclIOUtil.c:398:6: */
	var cwd uintptr = XTcl_FSGetCwd(tls, interp)

	if cwd == uintptr(0) {
		return uintptr(0)
	}
	XTcl_DStringInit(tls, cwdPtr)
	XTclDStringAppendObj(tls, cwdPtr, cwd)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = cwd
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return (*Tcl_DString)(unsafe.Pointer(cwdPtr)).Fstring
}

func XTcl_EvalFile(tls *libc.TLS, interp uintptr, fileName uintptr) int32 { /* tclIOUtil.c:415:1: */
	var ret int32
	var pathPtr uintptr = XTcl_NewStringObj(tls, fileName, -1)

	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount++
	ret = XTcl_FSEvalFile(tls, interp, pathPtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = pathPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return ret
}

// Now move on to the basic filesystem implementation.

func sFsThrExitProc(tls *libc.TLS, cd ClientData) { /* tclIOUtil.c:434:1: */
	var tsdPtr uintptr = cd
	var fsRecPtr uintptr = uintptr(0)
	var tmpFsRecPtr uintptr = uintptr(0)

	// Trash the cwd copy.

	if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr = uintptr(0)
	}
	if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData != uintptr(0) {
		sNativeFreeInternalRep(tls, (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData)
	}

	// Trash the filesystems cache.

	fsRecPtr = (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FfilesystemList
	for fsRecPtr != uintptr(0) {
		tmpFsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr
		(*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr = uintptr(0)
		XTclpFree(tls, fsRecPtr)
		fsRecPtr = tmpFsRecPtr
	}
	(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FfilesystemList = uintptr(0)
	(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).Finitialized = 0
}

func XTclFSCwdIsNative(tls *libc.TLS) int32 { /* tclIOUtil.c:468:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&fsDataKey)), int32(unsafe.Sizeof(ThreadSpecificData6{})))

	if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData != uintptr(0) {
		return 1
	} else {
		return 0
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// TclFSCwdPointerEquals --
//
//	Check whether the current working directory is equal to the path
//	given.
//
// Results:
//	1 (equal) or 0 (un-equal) as appropriate.
//
// Side effects:
//	If the paths are equal, but are not the same object, this method will
//	modify the given pathPtrPtr to refer to the same object. In this case
//	the object pointed to by pathPtrPtr will have its refCount
//	decremented, and it will be adjusted to point to the cwd (with a new
//	refCount).
//
//----------------------------------------------------------------------

func XTclFSCwdPointerEquals(tls *libc.TLS, pathPtrPtr uintptr) int32 { /* tclIOUtil.c:501:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&fsDataKey)), int32(unsafe.Sizeof(ThreadSpecificData6{})))

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&cwdMutex)))
	if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr == uintptr(0) ||
		(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathEpoch != cwdPathEpoch {
		if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr != uintptr(0) {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData != uintptr(0) {
			sNativeFreeInternalRep(tls, (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData)
		}
		if cwdPathPtr == uintptr(0) {
			(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr = uintptr(0)
		} else {
			(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr = XTcl_DuplicateObj(tls, cwdPathPtr)
			(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr)).FrefCount++
		}
		if cwdClientData == uintptr(0) {
			(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData = uintptr(0)
		} else {
			(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData = XTclNativeDupInternalRep(tls, cwdClientData)
		}
		(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathEpoch = cwdPathEpoch
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&cwdMutex)))

	if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).Finitialized == 0 {
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFsThrExitProc})), tsdPtr)
		(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).Finitialized = 1
	}

	if pathPtrPtr == uintptr(0) {
		return libc.Bool32((*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr == uintptr(0))
	}

	if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr == *(*uintptr)(unsafe.Pointer(pathPtrPtr)) {
		return 1
	} else {
		// var len1 int32 at bp, 4

		// var len2 int32 at bp+4, 4

		var str1 uintptr
		var str2 uintptr

		str1 = XTcl_GetStringFromObj(tls, (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr, bp)
		str2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(pathPtrPtr)), bp+4)
		if *(*int32)(unsafe.Pointer(bp)) == *(*int32)(unsafe.Pointer(bp + 4)) && !(libc.Xmemcmp(tls, str1, str2, uint64(*(*int32)(unsafe.Pointer(bp)))) != 0) {
			// They are equal, but different objects. Update so they will be
			// the same object in the future.

			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(pathPtrPtr))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			*(*uintptr)(unsafe.Pointer(pathPtrPtr)) = (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtrPtr)))).FrefCount++
			return 1
		} else {
			return 0
		}
	}
	return int32(0)
}

func sFsRecacheFilesystemList(tls *libc.TLS) { /* tclIOUtil.c:564:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&fsDataKey)), int32(unsafe.Sizeof(ThreadSpecificData6{})))
	var fsRecPtr uintptr
	var tmpFsRecPtr uintptr = uintptr(0)
	var toFree uintptr = uintptr(0)
	var list uintptr

	// Trash the current cache.

	fsRecPtr = (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FfilesystemList
	for fsRecPtr != uintptr(0) {
		tmpFsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr
		(*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr = toFree
		toFree = fsRecPtr
		fsRecPtr = tmpFsRecPtr
	}

	// Locate tail of the global filesystem list.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&filesystemMutex)))
	fsRecPtr = filesystemList
	for fsRecPtr != uintptr(0) {
		tmpFsRecPtr = fsRecPtr
		fsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr
	}

	// Refill the cache honouring the order.

	list = uintptr(0)
	fsRecPtr = tmpFsRecPtr
	for fsRecPtr != uintptr(0) {
		tmpFsRecPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FilesystemRecord{})))
		*(*FilesystemRecord)(unsafe.Pointer(tmpFsRecPtr)) = *(*FilesystemRecord)(unsafe.Pointer(fsRecPtr))
		(*FilesystemRecord)(unsafe.Pointer(tmpFsRecPtr)).FnextPtr = list
		(*FilesystemRecord)(unsafe.Pointer(tmpFsRecPtr)).FprevPtr = uintptr(0)
		list = tmpFsRecPtr
		fsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FprevPtr
	}
	(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FfilesystemList = list
	(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FfilesystemEpoch = theFilesystemEpoch
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&filesystemMutex)))

	for toFree != 0 {
		var next uintptr = (*FilesystemRecord)(unsafe.Pointer(toFree)).FnextPtr
		(*FilesystemRecord)(unsafe.Pointer(toFree)).FfsPtr = uintptr(0)
		XTclpFree(tls, toFree)
		toFree = next
	}

	// Make sure the above gets released on thread exit.

	if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).Finitialized == 0 {
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFsThrExitProc})), tsdPtr)
		(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).Finitialized = 1
	}
}

func sFsGetFirstFilesystem(tls *libc.TLS) uintptr { /* tclIOUtil.c:627:25: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&fsDataKey)), int32(unsafe.Sizeof(ThreadSpecificData6{})))
	if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FfilesystemList == uintptr(0) || (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).Fclaims == uint64(0) &&
		(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FfilesystemEpoch != theFilesystemEpoch {
		sFsRecacheFilesystemList(tls)
	}
	return (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FfilesystemList
}

// The epoch can be changed by filesystems being added or removed, by changing
// the "system encoding" and by env(HOME) changing.

func XTclFSEpochOk(tls *libc.TLS, filesystemEpoch Size_t) int32 { /* tclIOUtil.c:644:1: */
	return libc.Bool32(filesystemEpoch == uint64(0) || filesystemEpoch == theFilesystemEpoch)
}

func sClaim(tls *libc.TLS) { /* tclIOUtil.c:651:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&fsDataKey)), int32(unsafe.Sizeof(ThreadSpecificData6{})))

	(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).Fclaims++
}

func sDisclaim(tls *libc.TLS) { /* tclIOUtil.c:659:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&fsDataKey)), int32(unsafe.Sizeof(ThreadSpecificData6{})))

	(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).Fclaims--
}

func XTclFSEpoch(tls *libc.TLS) Size_t { /* tclIOUtil.c:667:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&fsDataKey)), int32(unsafe.Sizeof(ThreadSpecificData6{})))

	return (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FfilesystemEpoch
}

// If non-NULL, clientData is owned by us and must be freed later.

func sFsUpdateCwd(tls *libc.TLS, cwdObj uintptr, clientData ClientData) { /* tclIOUtil.c:680:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var len int32 at bp, 4

	var str uintptr = uintptr(0)
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&fsDataKey)), int32(unsafe.Sizeof(ThreadSpecificData6{})))

	if cwdObj != uintptr(0) {
		str = XTcl_GetStringFromObj(tls, cwdObj, bp)
	}

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&cwdMutex)))
	if cwdPathPtr != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = cwdPathPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if cwdClientData != uintptr(0) {
		sNativeFreeInternalRep(tls, cwdClientData)
	}

	if cwdObj == uintptr(0) {
		cwdPathPtr = uintptr(0)
		cwdClientData = uintptr(0)
	} else {
		// This must be stored as string obj!

		cwdPathPtr = XTcl_NewStringObj(tls, str, *(*int32)(unsafe.Pointer(bp /* len */)))
		(*Tcl_Obj)(unsafe.Pointer(cwdPathPtr)).FrefCount++
		cwdClientData = XTclNativeDupInternalRep(tls, clientData)
	}

	if libc.PreIncUint64(&cwdPathEpoch, 1) == uint64(0) {
		cwdPathEpoch++
	}
	(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathEpoch = cwdPathEpoch
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&cwdMutex)))

	if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData != 0 {
		sNativeFreeInternalRep(tls, (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData)
	}

	if cwdObj == uintptr(0) {
		(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr = uintptr(0)
		(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData = uintptr(0)
	} else {
		(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr = XTcl_NewStringObj(tls, str, *(*int32)(unsafe.Pointer(bp /* len */)))
		(*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData = clientData
		(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr)).FrefCount++
	}
}

//----------------------------------------------------------------------
//
// TclFinalizeFilesystem --
//
//	Clean up the filesystem. After this, calls to all Tcl_FS... functions
//	will fail.
//
//	We will later call TclResetFilesystem to restore the FS to a pristine
//	state.
//
// Results:
//	None.
//
// Side effects:
//	Frees any memory allocated by the filesystem.
//
//----------------------------------------------------------------------

func XTclFinalizeFilesystem(tls *libc.TLS) { /* tclIOUtil.c:757:1: */
	var fsRecPtr uintptr

	// Assumption that only one thread is active now. Otherwise we would need
	// to put various mutexes around this code.

	if cwdPathPtr != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = cwdPathPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		cwdPathPtr = uintptr(0)
		cwdPathEpoch = uint64(0)
	}
	if cwdClientData != uintptr(0) {
		sNativeFreeInternalRep(tls, cwdClientData)
		cwdClientData = uintptr(0)
	}

	// Remove all filesystems, freeing any allocated memory that is no longer
	// needed.

	fsRecPtr = filesystemList
	for fsRecPtr != uintptr(0) {
		var tmpFsRecPtr uintptr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr

		// The native filesystem is static, so we don't free it.

		if fsRecPtr != uintptr(unsafe.Pointer(&nativeFilesystemRecord)) {
			XTclpFree(tls, fsRecPtr)
		}
		fsRecPtr = tmpFsRecPtr
	}
	if libc.PreIncUint64(&theFilesystemEpoch, 1) == uint64(0) {
		theFilesystemEpoch++
	}
	filesystemList = uintptr(0)

	// Now filesystemList is NULL. This means that any attempt to use the
	// filesystem is likely to fail.

}

//----------------------------------------------------------------------
//
// TclResetFilesystem --
//
//	Restore the filesystem to a pristine state.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclResetFilesystem(tls *libc.TLS) { /* tclIOUtil.c:824:1: */
	filesystemList = uintptr(unsafe.Pointer(&nativeFilesystemRecord))
	if libc.PreIncUint64(&theFilesystemEpoch, 1) == uint64(0) {
		theFilesystemEpoch++
	}

}

//----------------------------------------------------------------------
//
// Tcl_FSRegister --
//
//	Insert the filesystem function table at the head of the list of
//	functions which are used during calls to all file-system operations.
//	The filesystem will be added even if it is already in the list. (You
//	can use Tcl_FSData to check if it is in the list, provided the
//	ClientData used was not NULL).
//
//	Note that the filesystem handling is head-to-tail of the list. Each
//	filesystem is asked in turn whether it can handle a particular
//	request, until one of them says 'yes'. At that point no further
//	filesystems are asked.
//
//	In particular this means if you want to add a diagnostic filesystem
//	(which simply reports all fs activity), it must be at the head of the
//	list: i.e. it must be the last registered.
//
// Results:
//	Normally TCL_OK; TCL_ERROR if memory for a new node in the list could
//	not be allocated.
//
// Side effects:
//	Memory allocated and modifies the link list for filesystems.
//
//----------------------------------------------------------------------

func XTcl_FSRegister(tls *libc.TLS, clientData ClientData, fsPtr uintptr) int32 { /* tclIOUtil.c:872:1: */
	var newFilesystemPtr uintptr

	if fsPtr == uintptr(0) {
		return TCL_ERROR
	}

	newFilesystemPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FilesystemRecord{})))

	(*FilesystemRecord)(unsafe.Pointer(newFilesystemPtr)).FclientData = clientData
	(*FilesystemRecord)(unsafe.Pointer(newFilesystemPtr)).FfsPtr = fsPtr

	// Is this lock and wait strictly speaking necessary? Since any iterators
	// out there will have grabbed a copy of the head of the list and be
	// iterating away from that, if we add a new element to the head of the
	// list, it can't possibly have any effect on any of their loops. In fact
	// it could be better not to wait, since we are adjusting the filesystem
	// epoch, any cached representations calculated by existing iterators are
	// going to have to be thrown away anyway.
	//
	// However, since registering and unregistering filesystems is a very rare
	// action, this is not a very important point.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&filesystemMutex)))

	(*FilesystemRecord)(unsafe.Pointer(newFilesystemPtr)).FnextPtr = filesystemList
	(*FilesystemRecord)(unsafe.Pointer(newFilesystemPtr)).FprevPtr = uintptr(0)
	if filesystemList != 0 {
		(*FilesystemRecord)(unsafe.Pointer(filesystemList)).FprevPtr = newFilesystemPtr
	}
	filesystemList = newFilesystemPtr

	// Increment the filesystem epoch counter, since existing paths might
	// conceivably now belong to different filesystems.

	if libc.PreIncUint64(&theFilesystemEpoch, 1) == uint64(0) {
		theFilesystemEpoch++
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&filesystemMutex)))

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_FSUnregister --
//
//	Remove the passed filesystem from the list of filesystem function
//	tables. It also ensures that the built-in (native) filesystem is not
//	removable, although we may wish to change that decision in the future
//	to allow a smaller Tcl core, in which the native filesystem is not
//	used at all (we could, say, initialise Tcl completely over a network
//	connection).
//
// Results:
//	TCL_OK if the function pointer was successfully removed, TCL_ERROR
//	otherwise.
//
// Side effects:
//	Memory may be deallocated (or will be later, once no "path" objects
//	refer to this filesystem), but the list of registered filesystems is
//	updated immediately.
//
//----------------------------------------------------------------------

func XTcl_FSUnregister(tls *libc.TLS, fsPtr uintptr) int32 { /* tclIOUtil.c:947:1: */
	var retVal int32 = TCL_ERROR
	var fsRecPtr uintptr

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&filesystemMutex)))

	// Traverse the 'filesystemList' looking for the particular node whose
	// 'fsPtr' member matches 'fsPtr' and remove that one from the list.
	// Ensure that the "default" node cannot be removed.

	fsRecPtr = filesystemList
	for retVal == TCL_ERROR && fsRecPtr != uintptr(unsafe.Pointer(&nativeFilesystemRecord)) {
		if (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr == fsPtr {
			if (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FprevPtr != 0 {
				(*FilesystemRecord1)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FprevPtr)).FnextPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr
			} else {
				filesystemList = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr
			}
			if (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr != 0 {
				(*FilesystemRecord1)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr)).FprevPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FprevPtr
			}

			// Increment the filesystem epoch counter, since existing paths
			// might conceivably now belong to different filesystems. This
			// should also ensure that paths which have cached the filesystem
			// which is about to be deleted do not reference that filesystem
			// (which would of course lead to memory exceptions).

			if libc.PreIncUint64(&theFilesystemEpoch, 1) == uint64(0) {
				theFilesystemEpoch++
			}

			XTclpFree(tls, fsRecPtr)

			retVal = TCL_OK
		} else {
			fsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr
		}
	}

	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&filesystemMutex)))
	return retVal
}

//----------------------------------------------------------------------
//
// Tcl_FSMatchInDirectory --
//
//	This routine is used by the globbing code to search a directory for
//	all files which match a given pattern. The appropriate function for
//	the filesystem to which pathPtr belongs will be called. If pathPtr
//	does not belong to any filesystem and if it is NULL or the empty
//	string, then we assume the pattern is to be matched in the current
//	working directory. To avoid have the Tcl_FSMatchInDirectoryProc for
//	each filesystem from having to deal with this issue, we create a
//	pathPtr on the fly (equal to the cwd), and then remove it from the
//	results returned. This makes filesystems easy to write, since they can
//	assume the pathPtr passed to them is an ordinary path. In fact this
//	means we could remove such special case handling from Tcl's native
//	filesystems.
//
//	If 'pattern' is NULL, then pathPtr is assumed to be a fully specified
//	path of a single file/directory which must be checked for existence
//	and correct type.
//
// Results:
//
//	The return value is a standard Tcl result indicating whether an error
//	occurred in globbing. Error messages are placed in interp, but good
//	results are placed in the resultPtr given.
//
//	Recursive searches, e.g.
//		glob -dir $dir -join * pkgIndex.tcl
//	which must recurse through each directory matching '*' are handled
//	internally by Tcl, by passing specific flags in a modified 'types'
//	parameter. This means the actual filesystem only ever sees patterns
//	which match in a single directory.
//
// Side effects:
//	The interpreter may have an error message inserted into it.
//
//----------------------------------------------------------------------

func XTcl_FSMatchInDirectory(tls *libc.TLS, interp uintptr, resultPtr uintptr, pathPtr uintptr, pattern uintptr, types1 uintptr) int32 { /* tclIOUtil.c:1039:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var fsPtr uintptr
	var cwd uintptr
	var tmpResultPtr uintptr
	// var elemsPtr uintptr at bp+8, 8

	// var resLength int32 at bp, 4

	var i int32
	var ret int32 = -1

	if types1 != uintptr(0) && (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype&(int32(1)<<7) != 0 {
		// We don't currently allow querying of mounts by external code (a
		// valuable future step), so since we're the only function that
		// actually knows about mounts, this means we're being called
		// recursively by ourself. Return no matches.

		return TCL_OK
	}

	if pathPtr != uintptr(0) {
		fsPtr = XTcl_FSGetFileSystemForPath(tls, pathPtr)
	} else {
		fsPtr = uintptr(0)
	}

	// Check if we've successfully mapped the path to a filesystem within
	// which to search.

	if fsPtr != uintptr(0) {
		if (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FmatchInDirectoryProc == uintptr(0) {
			XTcl_SetErrno(tls, ENOENT)
			return -1
		}
		ret = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FmatchInDirectoryProc})).f(tls, interp, resultPtr, pathPtr, pattern,
			types1)
		if ret == TCL_OK && pattern != uintptr(0) {
			sFsAddMountsToGlobResult(tls, resultPtr, pathPtr, pattern, types1)
		}
		return ret
	}

	// If the path isn't empty, we have no idea how to match files in a
	// directory which belongs to no known filesystem.

	if pathPtr != uintptr(0) && int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
		}
		return XTcl_GetString(tls, pathPtr)
	}()))) != 0 {
		XTcl_SetErrno(tls, ENOENT)
		return -1
	}

	// We have an empty or NULL path. This is defined to mean we must search
	// for files within the current 'cwd'. We therefore use that, but then
	// since the proc we call will return results which include the cwd we
	// must then trim it off the front of each path in the result. We choose
	// to deal with this here (in the generic code), since if we don't, every
	// single filesystem's implementation of Tcl_FSMatchInDirectory will have
	// to deal with it for us.

	cwd = XTcl_FSGetCwd(tls, uintptr(0))
	if cwd == uintptr(0) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+37663,
				-1))
		}
		return TCL_ERROR
	}

	fsPtr = XTcl_FSGetFileSystemForPath(tls, cwd)
	if fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FmatchInDirectoryProc != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				tmpResultPtr = XTclThreadAllocObj(tls)
			} else {
				tmpResultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpResultPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).FtypePtr = uintptr(0)
		{
		}

		(*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).FrefCount++
		ret = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FmatchInDirectoryProc})).f(tls, interp, tmpResultPtr, cwd, pattern,
			types1)
		if ret == TCL_OK {
			sFsAddMountsToGlobResult(tls, tmpResultPtr, cwd, pattern, types1)

			// Note that we know resultPtr and tmpResultPtr are distinct.

			ret = XTcl_ListObjGetElements(tls, interp, tmpResultPtr,
				bp, bp+8)
			for i = 0; ret == TCL_OK && i < *(*int32)(unsafe.Pointer(bp /* resLength */)); i++ {
				ret = XTcl_ListObjAppendElement(tls, interp, resultPtr,
					XTclFSMakePathRelative(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* elemsPtr */)) + uintptr(i)*8)), cwd))
			}
		}
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpResultPtr)).Flength = -1
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, tmpResultPtr)
					} else {
						*(*uintptr)(unsafe.Pointer(tmpResultPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = tmpResultPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, tmpResultPtr)
			}
		}

	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = cwd
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return ret
}

//----------------------------------------------------------------------
//
// FsAddMountsToGlobResult --
//
//	This routine is used by the globbing code to take the results of a
//	directory listing and add any mounted paths to that listing. This is
//	required so that simple things like 'glob *' merge mounts and listings
//	correctly.
//
// Results:
//	None.
//
// Side effects:
//	Modifies the resultPtr.
//
//----------------------------------------------------------------------

func sFsAddMountsToGlobResult(tls *libc.TLS, resultPtr uintptr, pathPtr uintptr, pattern uintptr, types1 uintptr) { /* tclIOUtil.c:1164:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// var mLength int32 at bp, 4

	// var gLength int32 at bp+4, 4

	var i int32
	var dir int32
	var mounts uintptr
	// var gElt uintptr at bp+16, 8

	var path uintptr
	var mount uintptr
	var norm uintptr
	// var len int32 at bp+28, 4

	// var mlen int32 at bp+24, 4

	// var mElt uintptr at bp+8, 8

	var j int32
	var found int32
	var _objPtr uintptr
	dir = libc.Bool32(types1 == uintptr(0) || (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype&(int32(1)<<2) != 0)
	mounts = sFsListMounts(tls, pathPtr, pattern)

	if !(mounts == uintptr(0)) {
		goto __1
	}
	return
__1:
	;

	if !(XTcl_ListObjLength(tls, uintptr(0), mounts, bp) != TCL_OK || *(*int32)(unsafe.Pointer(bp)) == 0) {
		goto __2
	}
	goto endOfMounts
__2:
	;
	if !(XTcl_ListObjLength(tls, uintptr(0), resultPtr, bp+4) != TCL_OK) {
		goto __3
	}
	goto endOfMounts
__3:
	;
	i = 0
__4:
	if !(i < *(*int32)(unsafe.Pointer(bp))) {
		goto __6
	}
	found = 0

	XTcl_ListObjIndex(tls, uintptr(0), mounts, i, bp+8)

	j = 0
__7:
	if !(j < *(*int32)(unsafe.Pointer(bp + 4))) {
		goto __9
	}

	XTcl_ListObjIndex(tls, uintptr(0), resultPtr, j, bp+16)
	if !(XTcl_FSEqualPaths(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16))) != 0) {
		goto __10
	}
	found = 1
	if !!(dir != 0) {
		goto __11
	}
	// We don't want to list this.

	XTcl_ListObjReplace(tls, uintptr(0), resultPtr, j, 1, 0, uintptr(0))
	*(*int32)(unsafe.Pointer(bp + 4 /* gLength */))--
__11:
	;
	goto __9 // Break out of for loop.
__10:
	;
	goto __8
__8:
	j++
	goto __7
	goto __9
__9:
	;
	if !(!(found != 0) && dir != 0) {
		goto __12
	}

	// We know mElt is absolute normalized and lies inside pathPtr, so
	// now we must add to the result the right representation of mElt,
	// i.e. the representation which is relative to pathPtr.

	norm = XTcl_FSGetNormalizedPath(tls, uintptr(0), pathPtr)
	if !(norm != uintptr(0)) {
		goto __13
	}

	mount = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* mElt */)), bp+24)
	path = XTcl_GetStringFromObj(tls, norm, bp+28)
	if !(int32(*(*int8)(unsafe.Pointer(path + uintptr(*(*int32)(unsafe.Pointer(bp + 28))-1)))) == '/') {
		goto __14
	}
	// Deal with the root of the volume.

	*(*int32)(unsafe.Pointer(bp + 28 /* len */))--
__14:
	;
	*(*int32)(unsafe.Pointer(bp + 28 /* len */))++ // account for '/' in the mElt [Bug 1602539]
	*(*uintptr)(unsafe.Pointer(bp + 8 /* mElt */)) = XTclNewFSPathObj(tls, pathPtr, mount+uintptr(*(*int32)(unsafe.Pointer(bp + 28))), *(*int32)(unsafe.Pointer(bp + 24))-*(*int32)(unsafe.Pointer(bp + 28)))
	XTcl_ListObjAppendElement(tls, uintptr(0), resultPtr, *(*uintptr)(unsafe.Pointer(bp + 8 /* mElt */)))
__13:
	;
	// No need to increment gLength, since we don't want to compare
	// mounts against mounts.
__12:
	;
	goto __5
__5:
	i++
	goto __4
	goto __6
__6:
	;

endOfMounts:
__15:
	_objPtr = mounts
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __18
	}
	XTclFreeObj(tls, _objPtr)
__18:
	;
	goto __16
__16:
	if 0 != 0 {
		goto __15
	}
	goto __17
__17:
}

//----------------------------------------------------------------------
//
// Tcl_FSMountsChanged --
//
//	Notify the filesystem that the available mounted filesystems (or
//	within any one filesystem type, the number or location of mount
//	points) have changed.
//
// Results:
//	None.
//
// Side effects:
//	The global filesystem variable 'theFilesystemEpoch' is incremented.
//	The effect of this is to make all cached path representations invalid.
//	Clearly it should only therefore be called when it is really required!
//	There are a few circumstances when it should be called:
//
//	(1) when a new filesystem is registered or unregistered. Strictly
//	speaking this is only necessary if the new filesystem accepts file
//	paths as is (normally the filesystem itself is really a shell which
//	hasn't yet had any mount points established and so its
//	'pathInFilesystem' proc will always fail). However, for safety, Tcl
//	always calls this for you in these circumstances.
//
//	(2) when additional mount points are established inside any existing
//	filesystem (except the native fs)
//
//	(3) when any filesystem (except the native fs) changes the list of
//	available volumes.
//
//	(4) when the mapping from a string representation of a file to a full,
//	normalized path changes. For example, if 'env(HOME)' is modified, then
//	any path containing '~' will map to a different filesystem location.
//	Therefore all such paths need to have their internal representation
//	invalidated.
//
//	Tcl has no control over (2) and (3), so any registered filesystem must
//	make sure it calls this function when those situations occur.
//
//	(Note: the reason for the exception in 2,3 for the native filesystem
//	is that the native filesystem by default claims all unknown files even
//	if it really doesn't understand them or if they don't exist).
//
//----------------------------------------------------------------------

func XTcl_FSMountsChanged(tls *libc.TLS, fsPtr uintptr) { /* tclIOUtil.c:1297:1: */
	// We currently don't do anything with this parameter. We could in the
	// future only invalidate files for this filesystem or otherwise take more
	// advanced action.

	_ = fsPtr

	// Increment the filesystem epoch counter, since existing paths might now
	// belong to different filesystems.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&filesystemMutex)))
	if libc.PreIncUint64(&theFilesystemEpoch, 1) == uint64(0) {
		theFilesystemEpoch++
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&filesystemMutex)))
}

//----------------------------------------------------------------------
//
// Tcl_FSData --
//
//	Retrieve the clientData field for the filesystem given, or NULL if
//	that filesystem is not registered.
//
// Results:
//	A clientData value, or NULL. Note that if the filesystem was
//	registered with a NULL clientData field, this function will return
//	that NULL value.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_FSData(tls *libc.TLS, fsPtr uintptr) ClientData { /* tclIOUtil.c:1340:1: */
	var retVal ClientData = uintptr(0)
	var fsRecPtr uintptr = sFsGetFirstFilesystem(tls)

	// Traverse the list of filesystems look for a particular one. If found,
	// return that filesystem's clientData (originally provided when calling
	// Tcl_FSRegister).

	for retVal == uintptr(0) && fsRecPtr != uintptr(0) {
		if (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr == fsPtr {
			retVal = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FclientData
		}
		fsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr
	}

	return retVal
}

//---------------------------------------------------------------------------
//
// TclFSNormalizeToUniquePath --
//
//	Takes a path specification containing no ../, ./ sequences, and
//	converts it into a unique path for the given platform. On Unix, this
//	means the path must be free of symbolic links/aliases, and on Windows
//	it means we want the long form, with that long form's case-dependence
//	(which gives us a unique, case-dependent path).
//
// Results:
//	The pathPtr is modified in place. The return value is the last byte
//	offset which was recognised in the path string.
//
// Side effects:
//	None (beyond the memory allocation for the result).
//
// Special notes:
//	If the filesystem-specific normalizePathProcs can re-introduce ../, ./
//	sequences into the path, then this function will not return the
//	correct result. This may be possible with symbolic links on unix.
//
//	Important assumption: if startAt is non-zero, it must point to a
//	directory separator that we know exists and is already normalized (so
//	it is important not to point to the char just after the separator).
//
//---------------------------------------------------------------------------

func XTclFSNormalizeToUniquePath(tls *libc.TLS, interp uintptr, pathPtr uintptr, startAt int32) int32 { /* tclIOUtil.c:1393:1: */
	var fsRecPtr uintptr
	var firstFsRecPtr uintptr

	// Call each of the "normalise path" functions in succession. This is a
	// special case, in which if we have a native filesystem handler, we call
	// it first. This is because the root of Tcl's filesystem is always a
	// native filesystem (i.e. '/' on unix is native).

	firstFsRecPtr = sFsGetFirstFilesystem(tls)

	sClaim(tls)
	for fsRecPtr = firstFsRecPtr; fsRecPtr != uintptr(0); fsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr {
		if (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr != uintptr(unsafe.Pointer(&XtclNativeFilesystem)) {
			continue
		}

		// TODO: Assume that we always find the native file system; it should
		// always be there...

		if (*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FnormalizePathProc != uintptr(0) {
			startAt = (*struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FnormalizePathProc})).f(tls, interp, pathPtr,
				startAt)
		}
		break
	}

	for fsRecPtr = firstFsRecPtr; fsRecPtr != uintptr(0); fsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr {
		// Skip the native system next time through.

		if (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr == uintptr(unsafe.Pointer(&XtclNativeFilesystem)) {
			continue
		}

		if (*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FnormalizePathProc != uintptr(0) {
			startAt = (*struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FnormalizePathProc})).f(tls, interp, pathPtr,
				startAt)
		}

		// We could add an efficiency check like this:
		//		if (retVal == length-of(pathPtr)) {break;}
		// but there's not much benefit.
	}
	sDisclaim(tls)

	return startAt
}

//---------------------------------------------------------------------------
//
// TclGetOpenMode --
//
//	This routine is an obsolete, limited version of TclGetOpenModeEx()
//	below. It exists only to satisfy any extensions imprudently using it
//	via Tcl's internal stubs table.
//
// Results:
//	Same as TclGetOpenModeEx().
//
// Side effects:
//	Same as TclGetOpenModeEx().
//
//---------------------------------------------------------------------------

func XTclGetOpenMode(tls *libc.TLS, interp uintptr, modeString uintptr, seekFlagPtr uintptr) int32 { /* tclIOUtil.c:1471:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	*(*int32)(unsafe.Pointer(bp /* binary */)) = 0
	return XTclGetOpenModeEx(tls, interp, modeString, seekFlagPtr, bp)
}

//---------------------------------------------------------------------------
//
// TclGetOpenModeEx --
//
//	Computes a POSIX mode mask for opening a file, from a given string,
//	and also sets flags to indicate whether the caller should seek to EOF
//	after opening the file, and whether the caller should configure the
//	channel for binary data.
//
// Results:
//	On success, returns mode to pass to "open". If an error occurs, the
//	return value is -1 and if interp is not NULL, sets interp's result
//	object to an error message.
//
// Side effects:
//	Sets the integer referenced by seekFlagPtr to 1 to tell the caller to
//	seek to EOF after opening the file, or to 0 otherwise. Sets the
//	integer referenced by binaryPtr to 1 to tell the caller to seek to
//	configure the channel for binary data, or to 0 otherwise.
//
// Special note:
//	This code is based on a prototype implementation contributed by Mark
//	Diekhans.
//
//---------------------------------------------------------------------------

func XTclGetOpenModeEx(tls *libc.TLS, interp uintptr, modeString uintptr, seekFlagPtr uintptr, binaryPtr uintptr) int32 { /* tclIOUtil.c:1511:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var mode int32
	// var modeArgc int32 at bp+16, 4

	var c int32
	var i int32
	var gotRW int32
	// var modeArgv uintptr at bp+24, 8

	var flag uintptr

	// Check for the simpler fopen-like access modes (e.g. "r"). They are
	// distinguished from the POSIX access modes by the presence of a
	// lower-case first letter.

	*(*int32)(unsafe.Pointer(seekFlagPtr)) = 0
	*(*int32)(unsafe.Pointer(binaryPtr)) = 0
	mode = 0

	// Guard against international characters before using byte oriented
	// routines.

	if !(!(int32(*(*int8)(unsafe.Pointer(modeString)))&0x80 != 0) &&
		int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(modeString)))))*2)))&int32(X_ISlower) != 0) {
		goto __1
	} // INTL: ISO only.
	switch int32(*(*int8)(unsafe.Pointer(modeString))) {
	case 'r':
		goto __3
	case 'w':
		goto __4
	case 'a':
		goto __5
	default:
		goto __6
	}
	goto __2
__3:
	mode = O_RDONLY
	goto __2
__4:
	mode = O_WRONLY | O_CREAT | O_TRUNC
	goto __2
__5:
	// Added O_APPEND for proper automatic seek-to-end-on-write by the
	// OS. [Bug 680143]

	mode = O_WRONLY | O_CREAT | O_APPEND
	*(*int32)(unsafe.Pointer(seekFlagPtr)) = 1
	goto __2
__6:
	goto error
__2:
	;
	i = 1
__7:
	if !(i < 3 && *(*int8)(unsafe.Pointer(modeString + uintptr(i))) != 0) {
		goto __8
	}
	if !(int32(*(*int8)(unsafe.Pointer(modeString + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(modeString + uintptr(i-1))))) {
		goto __9
	}
	goto error
__9:
	;
	switch int32(*(*int8)(unsafe.Pointer(modeString + uintptr(libc.PostIncInt32(&i, 1))))) {
	case '+':
		goto __11
	case 'b':
		goto __12
	default:
		goto __13
	}
	goto __10
__11:
	// Must remove the O_APPEND flag so that the seek command
	// works. [Bug 1773127]

	mode = mode & libc.CplInt32(O_RDONLY|O_WRONLY|O_APPEND)
	mode = mode | O_RDWR
	goto __10
__12:
	*(*int32)(unsafe.Pointer(binaryPtr)) = 1
	goto __10
__13:
	goto error
__10:
	;
	goto __7
__8:
	;
	if !(int32(*(*int8)(unsafe.Pointer(modeString + uintptr(i)))) != 0) {
		goto __14
	}
	goto error
__14:
	;
	return mode

error:
	*(*int32)(unsafe.Pointer(seekFlagPtr)) = 0
	*(*int32)(unsafe.Pointer(binaryPtr)) = 0
	if !(interp != uintptr(0)) {
		goto __15
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+37717, libc.VaList(bp, modeString)))
__15:
	;
	return -1
__1:
	;

	// The access modes are specified using a list of POSIX modes such as
	// O_CREAT.
	//
	// IMPORTANT NOTE: We rely on Tcl_SplitList working correctly when a NULL
	// interpreter is passed in.

	if !(XTcl_SplitList(tls, interp, modeString, bp+16, bp+24) != TCL_OK) {
		goto __16
	}
	if !(interp != uintptr(0)) {
		goto __17
	}
	XTcl_AddErrorInfo(tls, interp,
		ts+37742)
	XTcl_AddErrorInfo(tls, interp, modeString)
	XTcl_AddErrorInfo(tls, interp, ts+25027)
__17:
	;
	return -1
__16:
	;

	gotRW = 0
	i = 0
__18:
	if !(i < *(*int32)(unsafe.Pointer(bp + 16))) {
		goto __20
	}
	flag = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* modeArgv */)) + uintptr(i)*8))
	c = int32(*(*int8)(unsafe.Pointer(flag)))
	if !(c == 'R' && libc.Xstrcmp(tls, flag, ts+37784) == 0) {
		goto __21
	}
	mode = mode&libc.CplInt32(O_RDONLY|O_WRONLY|O_RDWR) | O_RDONLY
	gotRW = 1
	goto __22
__21:
	if !(c == 'W' && libc.Xstrcmp(tls, flag, ts+37791) == 0) {
		goto __23
	}
	mode = mode&libc.CplInt32(O_RDONLY|O_WRONLY|O_RDWR) | O_WRONLY
	gotRW = 1
	goto __24
__23:
	if !(c == 'R' && libc.Xstrcmp(tls, flag, ts+37798) == 0) {
		goto __25
	}
	mode = mode&libc.CplInt32(O_RDONLY|O_WRONLY|O_RDWR) | O_RDWR
	gotRW = 1
	goto __26
__25:
	if !(c == 'A' && libc.Xstrcmp(tls, flag, ts+37803) == 0) {
		goto __27
	}
	mode = mode | O_APPEND
	*(*int32)(unsafe.Pointer(seekFlagPtr)) = 1
	goto __28
__27:
	if !(c == 'C' && libc.Xstrcmp(tls, flag, ts+37810) == 0) {
		goto __29
	}
	mode = mode | O_CREAT
	goto __30
__29:
	if !(c == 'E' && libc.Xstrcmp(tls, flag, ts+37816) == 0) {
		goto __31
	}
	mode = mode | O_EXCL

	goto __32
__31:
	if !(c == 'N' && libc.Xstrcmp(tls, flag, ts+37821) == 0) {
		goto __33
	}
	mode = mode | O_NOCTTY

	goto __34
__33:
	if !(c == 'N' && libc.Xstrcmp(tls, flag, ts+37828) == 0) {
		goto __35
	}
	mode = mode | O_NONBLOCK

	goto __36
__35:
	if !(c == 'T' && libc.Xstrcmp(tls, flag, ts+37837) == 0) {
		goto __37
	}
	mode = mode | O_TRUNC
	goto __38
__37:
	if !(c == 'B' && libc.Xstrcmp(tls, flag, ts+9997) == 0) {
		goto __39
	}
	*(*int32)(unsafe.Pointer(binaryPtr)) = 1
	goto __40
__39:

	if !(interp != uintptr(0)) {
		goto __41
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+37843, libc.VaList(bp+8, flag)))
__41:
	;
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
	return -1
__40:
	;
__38:
	;
__36:
	;
__34:
	;
__32:
	;
__30:
	;
__28:
	;
__26:
	;
__24:
	;
__22:
	;
	goto __19
__19:
	i++
	goto __18
	goto __20
__20:
	;

	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))

	if !!(gotRW != 0) {
		goto __42
	}
	if !(interp != uintptr(0)) {
		goto __43
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+37955,
		-1))
__43:
	;
	return -1
__42:
	;
	return mode
}

//----------------------------------------------------------------------
//
// Tcl_FSEvalFile, Tcl_FSEvalFileEx, TclNREvalFile --
//
//	Read in a file and process the entire file as one gigantic Tcl
//	command. Tcl_FSEvalFile is Tcl_FSEvalFileEx without encoding argument.
//	TclNREvalFile is an NRE-enabled version of Tcl_FSEvalFileEx.
//
// Results:
//	A standard Tcl result, which is either the result of executing the
//	file or an error indicating why the file couldn't be read.
//
// Side effects:
//	Depends on the commands in the file. During the evaluation of the
//	contents of the file, iPtr->scriptFile is made to point to pathPtr
//	(the old value is cached and replaced when this function returns).
//
//----------------------------------------------------------------------

func XTcl_FSEvalFile(tls *libc.TLS, interp uintptr, pathPtr uintptr) int32 { /* tclIOUtil.c:1715:1: */
	return XTcl_FSEvalFileEx(tls, interp, pathPtr, uintptr(0))
}

func XTcl_FSEvalFileEx(tls *libc.TLS, interp uintptr, pathPtr uintptr, encodingName uintptr) int32 { /* tclIOUtil.c:1724:1: */
	bp := tls.Alloc(244)
	defer tls.Free(244)

	// var length int32 at bp+240, 4

	var result int32
	// var statBuf Tcl_StatBuf at bp+96, 144

	var oldScriptFile uintptr
	var iPtr uintptr
	var string uintptr
	var chan1 Tcl_Channel
	var objPtr uintptr
	var _objPtr uintptr
	// Record information telling where the error occurred.

	var pathString uintptr
	var limit int32
	var overflow int32
	var _objPtr1 uintptr
	result = TCL_ERROR

	if !(XTcl_FSGetNormalizedPath(tls, interp, pathPtr) == uintptr(0)) {
		goto __1
	}
	return result
__1:
	;

	if !(XTcl_FSStat(tls, pathPtr, bp+96) == -1) {
		goto __2
	}
	XTcl_SetErrno(tls, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38011,
		libc.VaList(bp, XTcl_GetString(tls, pathPtr), XTcl_PosixError(tls, interp))))
	return result
__2:
	;
	chan1 = XTcl_FSOpenFileChannel(tls, interp, pathPtr, ts+22782, 0644)
	if !(chan1 == uintptr(0)) {
		goto __3
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38011,
		libc.VaList(bp+16, XTcl_GetString(tls, pathPtr), XTcl_PosixError(tls, interp))))
	return result
__3:
	;

	// The eofchar is \32 (^Z). This is the usual on Windows, but we effect
	// this cross-platform to allow for scripted documents. [Bug: 2040]

	XTcl_SetChannelOption(tls, interp, chan1, ts+33597, ts+38039)

	// If the encoding is specified, set it for the channel. Else don't touch
	// it (and use the system encoding) Report error on unknown encoding.

	if !(encodingName != uintptr(0)) {
		goto __4
	}
	if !(XTcl_SetChannelOption(tls, interp, chan1, ts+15934, encodingName) !=
		TCL_OK) {
		goto __5
	}
	XTcl_Close(tls, interp, chan1)
	return result
__5:
	;
__4:
	;

	objPtr = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++

	// Try to read first character of stream, so we can check for utf-8 BOM to
	// be handled especially.

	if !(XTcl_ReadChars(tls, chan1, objPtr, 1, 0) < 0) {
		goto __6
	}
	XTcl_Close(tls, interp, chan1)
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38011,
		libc.VaList(bp+32, XTcl_GetString(tls, pathPtr), XTcl_PosixError(tls, interp))))
	goto end
__6:
	;
	string = XTcl_GetString(tls, objPtr)

	// If first character is not a BOM, append the remaining characters,
	// otherwise replace them. [Bug 3466099]

	if !(XTcl_ReadChars(tls, chan1, objPtr, -1,
		libc.Xmemcmp(tls, string, ts+38044, uint64(3))) < 0) {
		goto __7
	}
	XTcl_Close(tls, interp, chan1)
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38011,
		libc.VaList(bp+48, XTcl_GetString(tls, pathPtr), XTcl_PosixError(tls, interp))))
	goto end
__7:
	;

	if !(XTcl_Close(tls, interp, chan1) != TCL_OK) {
		goto __8
	}
	goto end
__8:
	;

	iPtr = interp
	oldScriptFile = (*Interp)(unsafe.Pointer(iPtr)).FscriptFile
	(*Interp)(unsafe.Pointer(iPtr)).FscriptFile = pathPtr
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FscriptFile)).FrefCount++
	string = XTcl_GetStringFromObj(tls, objPtr, bp+240)

	// TIP #280 Force the evaluator to open a frame for a sourced file.

	*(*int32)(unsafe.Pointer(iPtr + 324)) |= TCL_EVAL_FILE
	result = XTclEvalEx(tls, interp, string, *(*int32)(unsafe.Pointer(bp + 240 /* length */)), 0, 1, uintptr(0), string)

	// Now we have to be careful; the script may have changed the
	// iPtr->scriptFile value, so we must reset it without assuming it still
	// points to 'pathPtr'.

	if !((*Interp)(unsafe.Pointer(iPtr)).FscriptFile != uintptr(0)) {
		goto __9
	}
__10:
	_objPtr = (*Interp)(unsafe.Pointer(iPtr)).FscriptFile
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __13
	}
	XTclFreeObj(tls, _objPtr)
__13:
	;
	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
__9:
	;
	(*Interp)(unsafe.Pointer(iPtr)).FscriptFile = oldScriptFile

	if !(result == TCL_RETURN) {
		goto __14
	}
	result = XTclUpdateReturnInfo(tls, iPtr)
	goto __15
__14:
	if !(result == TCL_ERROR) {
		goto __16
	}
	// Record information telling where the error occurred.

	pathString = XTcl_GetStringFromObj(tls, pathPtr, bp+240)
	limit = 150
	overflow = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 240)) > limit)

	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+38048,
		libc.VaList(bp+64, func() int32 {
			if overflow != 0 {
				return limit
			}
			return *(*int32)(unsafe.Pointer(bp + 240))
		}(), pathString,
			func() uintptr {
				if overflow != 0 {
					return ts + 7891 /* "..." */
				}
				return ts + 2046 /* "" */
			}(), XTcl_GetErrorLine(tls, interp))))
__16:
	;
__15:
	;

end:
__17:
	_objPtr1 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __20
	}
	XTclFreeObj(tls, _objPtr1)
__20:
	;
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
	return result
}

func XTclNREvalFile(tls *libc.TLS, interp uintptr, pathPtr uintptr, encodingName uintptr) int32 { /* tclIOUtil.c:1860:1: */
	bp := tls.Alloc(208)
	defer tls.Free(208)

	// var statBuf Tcl_StatBuf at bp+64, 144

	var oldScriptFile uintptr
	var objPtr uintptr
	var iPtr uintptr
	var chan1 Tcl_Channel
	var string uintptr

	if XTcl_FSGetNormalizedPath(tls, interp, pathPtr) == uintptr(0) {
		return TCL_ERROR
	}

	if XTcl_FSStat(tls, pathPtr, bp+64) == -1 {
		XTcl_SetErrno(tls, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+38011,
			libc.VaList(bp, XTcl_GetString(tls, pathPtr), XTcl_PosixError(tls, interp))))
		return TCL_ERROR
	}
	chan1 = XTcl_FSOpenFileChannel(tls, interp, pathPtr, ts+22782, 0644)
	if chan1 == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+38011,
			libc.VaList(bp+16, XTcl_GetString(tls, pathPtr), XTcl_PosixError(tls, interp))))
		return TCL_ERROR
	}

	// The eofchar is \32 (^Z). This is the usual on Windows, but we effect
	// this cross-platform to allow for scripted documents. [Bug: 2040]

	XTcl_SetChannelOption(tls, interp, chan1, ts+33597, ts+38039)

	// If the encoding is specified, set it for the channel. Else don't touch
	// it (and use the system encoding) Report error on unknown encoding.

	if encodingName != uintptr(0) {
		if XTcl_SetChannelOption(tls, interp, chan1, ts+15934, encodingName) !=
			TCL_OK {
			XTcl_Close(tls, interp, chan1)
			return TCL_ERROR
		}
	}

	objPtr = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++

	// Try to read first character of stream, so we can check for utf-8 BOM to
	// be handled especially.

	if XTcl_ReadChars(tls, chan1, objPtr, 1, 0) < 0 {
		XTcl_Close(tls, interp, chan1)
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+38011,
			libc.VaList(bp+32, XTcl_GetString(tls, pathPtr), XTcl_PosixError(tls, interp))))
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return TCL_ERROR
	}
	string = XTcl_GetString(tls, objPtr)

	// If first character is not a BOM, append the remaining characters,
	// otherwise replace them. [Bug 3466099]

	if XTcl_ReadChars(tls, chan1, objPtr, -1,
		libc.Xmemcmp(tls, string, ts+38044, uint64(3))) < 0 {
		XTcl_Close(tls, interp, chan1)
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+38011,
			libc.VaList(bp+48, XTcl_GetString(tls, pathPtr), XTcl_PosixError(tls, interp))))
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return TCL_ERROR
	}

	if XTcl_Close(tls, interp, chan1) != TCL_OK {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return TCL_ERROR
	}

	iPtr = interp
	oldScriptFile = (*Interp)(unsafe.Pointer(iPtr)).FscriptFile
	(*Interp)(unsafe.Pointer(iPtr)).FscriptFile = pathPtr
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FscriptFile)).FrefCount++

	// TIP #280: Force the evaluator to open a frame for a sourced file.

	*(*int32)(unsafe.Pointer(iPtr + 324)) |= TCL_EVAL_FILE
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _callbackPtr uintptr
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sEvalFileCallback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = oldScriptFile
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = pathPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = objPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return XTclNREvalObjEx(tls, interp, objPtr, 0, uintptr(0), -0x7fffffff-1)
}

func sEvalFileCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclIOUtil.c:1966:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var iPtr uintptr = interp
	var oldScriptFile uintptr = *(*ClientData)(unsafe.Pointer(data))
	var pathPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))
	var objPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))

	// Now we have to be careful; the script may have changed the
	// iPtr->scriptFile value, so we must reset it without assuming it still
	// points to 'pathPtr'.

	if (*Interp)(unsafe.Pointer(iPtr)).FscriptFile != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FscriptFile
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FscriptFile = oldScriptFile

	if result == TCL_RETURN {
		result = XTclUpdateReturnInfo(tls, iPtr)
	} else if result == TCL_ERROR {
		// Record information telling where the error occurred.

		// var length int32 at bp+32, 4

		var pathString uintptr = XTcl_GetStringFromObj(tls, pathPtr, bp+32)
		var limit int32 = 150
		var overflow int32 = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 32)) > limit)

		XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
			ts+38048,
			libc.VaList(bp, func() int32 {
				if overflow != 0 {
					return limit
				}
				return *(*int32)(unsafe.Pointer(bp + 32))
			}(), pathString,
				func() uintptr {
					if overflow != 0 {
						return ts + 7891 /* "..." */
					}
					return ts + 2046 /* "" */
				}(), XTcl_GetErrorLine(tls, interp))))
	}

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = objPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_GetErrno --
//
//	Gets the current value of the Tcl error code variable. This is
//	currently the global variable "errno" but could in the future change
//	to something else.
//
// Results:
//	The value of the Tcl error code variable.
//
// Side effects:
//	None. Note that the value of the Tcl error code variable is UNDEFINED
//	if a call to Tcl_SetErrno did not precede this call.
//
//----------------------------------------------------------------------

func XTcl_GetErrno(tls *libc.TLS) int32 { /* tclIOUtil.c:2029:1: */
	// On some platforms, errno is really a thread local (implemented by the C
	// library).

	return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
}

//----------------------------------------------------------------------
//
// Tcl_SetErrno --
//
//	Sets the Tcl error code variable to the supplied value. On some saner
//	platforms this is actually a thread-local (this is implemented in the
//	C library) but this is *really* unsafe to assume!
//
// Results:
//	None.
//
// Side effects:
//	Modifies the value of the Tcl error code variable.
//
//----------------------------------------------------------------------

func XTcl_SetErrno(tls *libc.TLS, err int32) { /* tclIOUtil.c:2058:1: */
	// On some platforms, errno is really a thread local (implemented by the C
	// library).

	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = err
}

//----------------------------------------------------------------------
//
// Tcl_PosixError --
//
//	This function is typically called after UNIX kernel calls return
//	errors. It stores machine-readable information about the error in
//	errorCode field of interp and returns an information string for the
//	caller's use.
//
// Results:
//	The return value is a human-readable string describing the error.
//
// Side effects:
//	The errorCode field of the interp is set.
//
//----------------------------------------------------------------------

func XTcl_PosixError(tls *libc.TLS, interp uintptr) uintptr { /* tclIOUtil.c:2088:12: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var id uintptr
	var msg uintptr

	msg = XTcl_ErrnoMsg(tls, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
	id = XTcl_ErrnoId(tls)
	if interp != 0 {
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+38077, id, msg, uintptr(0)))
	}
	return msg
}

//----------------------------------------------------------------------
//
// Tcl_FSStat --
//
//	This function replaces the library version of stat and lsat.
//
//	The appropriate function for the filesystem to which pathPtr belongs
//	will be called.
//
// Results:
//	See stat documentation.
//
// Side effects:
//	See stat documentation.
//
//----------------------------------------------------------------------

func XTcl_FSStat(tls *libc.TLS, pathPtr uintptr, buf uintptr) int32 { /* tclIOUtil.c:2123:1: */
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FstatProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FstatProc})).f(tls, pathPtr, buf)
	}
	XTcl_SetErrno(tls, ENOENT)
	return -1
}

//----------------------------------------------------------------------
//
// Tcl_FSLstat --
//
//	This function replaces the library version of lstat. The appropriate
//	function for the filesystem to which pathPtr belongs will be called.
//	If no 'lstat' function is listed, but a 'stat' function is, then Tcl
//	will fall back on the stat function.
//
// Results:
//	See lstat documentation.
//
// Side effects:
//	See lstat documentation.
//
//----------------------------------------------------------------------

func XTcl_FSLstat(tls *libc.TLS, pathPtr uintptr, buf uintptr) int32 { /* tclIOUtil.c:2156:1: */
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr != uintptr(0) {
		if (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FlstatProc != uintptr(0) {
			return (*struct {
				f func(*libc.TLS, uintptr, uintptr) int32
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FlstatProc})).f(tls, pathPtr, buf)
		}
		if (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FstatProc != uintptr(0) {
			return (*struct {
				f func(*libc.TLS, uintptr, uintptr) int32
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FstatProc})).f(tls, pathPtr, buf)
		}
	}
	XTcl_SetErrno(tls, ENOENT)
	return -1
}

//----------------------------------------------------------------------
//
// Tcl_FSAccess --
//
//	This function replaces the library version of access. The appropriate
//	function for the filesystem to which pathPtr belongs will be called.
//
// Results:
//	See access documentation.
//
// Side effects:
//	See access documentation.
//
//----------------------------------------------------------------------

func XTcl_FSAccess(tls *libc.TLS, pathPtr uintptr, mode int32) int32 { /* tclIOUtil.c:2192:1: */
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FaccessProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, uintptr, int32) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FaccessProc})).f(tls, pathPtr, mode)
	}
	XTcl_SetErrno(tls, ENOENT)
	return -1
}

//----------------------------------------------------------------------
//
// Tcl_FSOpenFileChannel --
//
//	The appropriate function for the filesystem to which pathPtr belongs
//	will be called.
//
// Results:
//	The new channel or NULL, if the named file could not be opened.
//
// Side effects:
//	May open the channel and may cause creation of a file on the file
//	system.
//
//----------------------------------------------------------------------

func XTcl_FSOpenFileChannel(tls *libc.TLS, interp uintptr, pathPtr uintptr, modeString uintptr, permissions int32) Tcl_Channel { /* tclIOUtil.c:2224:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var fsPtr uintptr
	var retVal Tcl_Channel = uintptr(0)

	// We need this just to ensure we return the correct error messages under
	// some circumstances.

	if XTcl_FSGetNormalizedPath(tls, interp, pathPtr) == uintptr(0) {
		return uintptr(0)
	}

	fsPtr = XTcl_FSGetFileSystemForPath(tls, pathPtr)
	if fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FopenFileChannelProc != uintptr(0) {
		var mode int32
		// var seekFlag int32 at bp+32, 4

		// var binary int32 at bp+36, 4

		// Parse the mode, picking up whether we want to seek to start with
		// and/or set the channel automatically into binary mode.

		mode = XTclGetOpenModeEx(tls, interp, modeString, bp+32, bp+36)
		if mode == -1 {
			return uintptr(0)
		}

		// Do the actual open() call.

		retVal = (*struct {
			f func(*libc.TLS, uintptr, uintptr, int32, int32) Tcl_Channel
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FopenFileChannelProc})).f(tls, interp, pathPtr, mode,
			permissions)
		if retVal == uintptr(0) {
			return uintptr(0)
		}

		// Apply appropriate flags parsed out above.

		if *(*int32)(unsafe.Pointer(bp + 32)) != 0 && XTcl_Seek(tls, retVal, int64(0), SEEK_END) <
			int64(0) {
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+38083,
					libc.VaList(bp, XTcl_GetString(tls, pathPtr), XTcl_PosixError(tls, interp))))
			}
			XTcl_Close(tls, uintptr(0), retVal)
			return uintptr(0)
		}
		if *(*int32)(unsafe.Pointer(bp + 36)) != 0 {
			XTcl_SetChannelOption(tls, interp, retVal, ts+33606, ts+9534)
		}
		return retVal
	}

	// File doesn't belong to any filesystem that can open it.

	XTcl_SetErrno(tls, ENOENT)
	if interp != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+38136,
			libc.VaList(bp+16, XTcl_GetString(tls, pathPtr), XTcl_PosixError(tls, interp))))
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_FSUtime --
//
//	This function replaces the library version of utime. The appropriate
//	function for the filesystem to which pathPtr belongs will be called.
//
// Results:
//	See utime documentation.
//
// Side effects:
//	See utime documentation.
//
//----------------------------------------------------------------------

func XTcl_FSUtime(tls *libc.TLS, pathPtr uintptr, tval uintptr) int32 { /* tclIOUtil.c:2320:1: */
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FutimeProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FutimeProc})).f(tls, pathPtr, tval)
	}
	// TODO: set errno here? Tcl_SetErrno(ENOENT);
	return -1
}

//----------------------------------------------------------------------
//
// NativeFileAttrStrings --
//
//	This function implements the platform dependent 'file attributes'
//	subcommand, for the native filesystem, for listing the set of possible
//	attribute strings. This function is part of Tcl's native filesystem
//	support, and is placed here because it is shared by Unix and Windows
//	code.
//
// Results:
//	An array of strings
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sNativeFileAttrStrings(tls *libc.TLS, pathPtr uintptr, objPtrRef uintptr) uintptr { /* tclIOUtil.c:2355:19: */
	return uintptr(unsafe.Pointer(&XtclpFileAttrStrings))
}

//----------------------------------------------------------------------
//
// NativeFileAttrsGet --
//
//	This function implements the platform dependent 'file attributes'
//	subcommand, for the native filesystem, for 'get' operations. This
//	function is part of Tcl's native filesystem support, and is placed
//	here because it is shared by Unix and Windows code.
//
// Results:
//	Standard Tcl return code. The object placed in objPtrRef (if TCL_OK
//	was returned) is likely to have a refCount of zero. Either way we must
//	either store it somewhere (e.g. the Tcl result), or Incr/Decr its
//	refCount to ensure it is properly freed.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sNativeFileAttrsGet(tls *libc.TLS, interp uintptr, index int32, pathPtr uintptr, objPtrRef uintptr) int32 { /* tclIOUtil.c:2386:1: */
	return (*struct {
		f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{XtclpFileAttrProcs[index].FgetProc})).f(tls, interp, index, pathPtr, objPtrRef)
}

//----------------------------------------------------------------------
//
// NativeFileAttrsSet --
//
//	This function implements the platform dependent 'file attributes'
//	subcommand, for the native filesystem, for 'set' operations. This
//	function is part of Tcl's native filesystem support, and is placed
//	here because it is shared by Unix and Windows code.
//
// Results:
//	Standard Tcl return code.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sNativeFileAttrsSet(tls *libc.TLS, interp uintptr, index int32, pathPtr uintptr, objPtr uintptr) int32 { /* tclIOUtil.c:2415:1: */
	return (*struct {
		f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{XtclpFileAttrProcs[index].FsetProc})).f(tls, interp, index, pathPtr, objPtr)
}

//----------------------------------------------------------------------
//
// Tcl_FSFileAttrStrings --
//
//	This function implements part of the hookable 'file attributes'
//	subcommand. The appropriate function for the filesystem to which
//	pathPtr belongs will be called.
//
// Results:
//	The called function may either return an array of strings, or may
//	instead return NULL and place a Tcl list into the given objPtrRef.
//	Tcl will take that list and first increment its refCount before using
//	it. On completion of that use, Tcl will decrement its refCount. Hence
//	if the list should be disposed of by Tcl when done, it should have a
//	refCount of zero, and if the list should not be disposed of, the
//	filesystem should ensure it retains a refCount on the object.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_FSFileAttrStrings(tls *libc.TLS, pathPtr uintptr, objPtrRef uintptr) uintptr { /* tclIOUtil.c:2448:12: */
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfileAttrStringsProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfileAttrStringsProc})).f(tls, pathPtr, objPtrRef)
	}
	XTcl_SetErrno(tls, ENOENT)
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// TclFSFileAttrIndex --
//
//	Helper function for converting an attribute name to an index into the
//	attribute table.
//
// Results:
//	Tcl result code, index written to *indexPtr on result==TCL_OK
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFSFileAttrIndex(tls *libc.TLS, pathPtr uintptr, attributeName uintptr, indexPtr uintptr) int32 { /* tclIOUtil.c:2480:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	*(*uintptr)(unsafe.Pointer(bp /* listObj */)) = uintptr(0)
	var attrTable uintptr

	// Get the attribute table for the file.

	attrTable = XTcl_FSFileAttrStrings(tls, pathPtr, bp)
	if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount++
	}

	if attrTable != uintptr(0) {
		// It's a constant attribute table, so use T_GIFO.

		var tmpObj uintptr = XTcl_NewStringObj(tls, attributeName, -1)
		var result int32

		result = XTcl_GetIndexFromObjStruct(tls, uintptr(0), tmpObj, attrTable, int32(unsafe.Sizeof(uintptr(0))), uintptr(0), TCL_EXACT, indexPtr)
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, tmpObj)
					} else {
						*(*uintptr)(unsafe.Pointer(tmpObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = tmpObj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, tmpObj)
			}
		}

		if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = -1
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp)))
						} else {
							*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp /* listObj */)))
				}
			}

		}
		return result
	} else if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
		// It's a non-constant attribute list, so do a literal search.

		var i int32
		// var objc int32 at bp+8, 4

		// var objv uintptr at bp+16, 8

		if XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp)), bp+8, bp+16) != TCL_OK {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = -1
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp)))
						} else {
							*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp /* listObj */)))
				}
			}

			return TCL_ERROR
		}
		for i = 0; i < *(*int32)(unsafe.Pointer(bp + 8 /* objc */)); i++ {
			if !(libc.Xstrcmp(tls, attributeName, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)))
			}()) != 0) {
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = -1
						for ok3 := true; ok3; ok3 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp)))
							} else {
								*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp /* listObj */)))
					}
				}

				*(*int32)(unsafe.Pointer(indexPtr)) = i
				return TCL_OK
			}
		}
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = -1
				for ok4 := true; ok4; ok4 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp)))
					} else {
						*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp /* listObj */)))
			}
		}

		return TCL_ERROR
	} else {
		return TCL_ERROR
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// Tcl_FSFileAttrsGet --
//
//	This function implements read access for the hookable 'file
//	attributes' subcommand. The appropriate function for the filesystem to
//	which pathPtr belongs will be called.
//
// Results:
//	Standard Tcl return code. The object placed in objPtrRef (if TCL_OK
//	was returned) is likely to have a refCount of zero. Either way we must
//	either store it somewhere (e.g. the Tcl result), or Incr/Decr its
//	refCount to ensure it is properly freed.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_FSFileAttrsGet(tls *libc.TLS, interp uintptr, index int32, pathPtr uintptr, objPtrRef uintptr) int32 { /* tclIOUtil.c:2561:1: */
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfileAttrsGetProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfileAttrsGetProc})).f(tls, interp, index, pathPtr, objPtrRef)
	}
	XTcl_SetErrno(tls, ENOENT)
	return -1
}

//----------------------------------------------------------------------
//
// Tcl_FSFileAttrsSet --
//
//	This function implements write access for the hookable 'file
//	attributes' subcommand. The appropriate function for the filesystem to
//	which pathPtr belongs will be called.
//
// Results:
//	Standard Tcl return code.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_FSFileAttrsSet(tls *libc.TLS, interp uintptr, index int32, pathPtr uintptr, objPtr uintptr) int32 { /* tclIOUtil.c:2595:1: */
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfileAttrsSetProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfileAttrsSetProc})).f(tls, interp, index, pathPtr, objPtr)
	}
	XTcl_SetErrno(tls, ENOENT)
	return -1
}

//----------------------------------------------------------------------
//
// Tcl_FSGetCwd --
//
//	This function replaces the library version of getcwd().
//
//	Most VFS's will *not* implement a 'cwdProc'. Tcl now maintains its own
//	record (in a Tcl_Obj) of the cwd, and an attempt is made to synch this
//	with the cwd's containing filesystem, if that filesystem provides a
//	cwdProc (e.g. the native filesystem).
//
//	Note that if Tcl's cwd is not in the native filesystem, then of course
//	Tcl's cwd and the native cwd are different: extensions should
//	therefore ensure they only access the cwd through this function to
//	avoid confusion.
//
//	If a global cwdPathPtr already exists, it is cached in the thread's
//	private data structures and reference to the cached copy is returned,
//	subject to a synchronisation attempt in that cwdPathPtr's fs.
//
//	Otherwise, the chain of functions that have been "inserted" into the
//	filesystem will be called in succession until either a value other
//	than NULL is returned, or the entire list is visited.
//
// Results:
//	The result is a pointer to a Tcl_Obj specifying the current directory,
//	or NULL if the current directory could not be determined. If NULL is
//	returned, an error message is left in the interp's result.
//
//	The result already has its refCount incremented for the caller. When
//	it is no longer needed, that refCount should be decremented.
//
// Side effects:
//	Various objects may be freed and allocated.
//
//----------------------------------------------------------------------

func XTcl_FSGetCwd(tls *libc.TLS, interp uintptr) uintptr { /* tclIOUtil.c:2649:9: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var tsdPtr uintptr
	var _objPtr uintptr
	var _objPtr1 uintptr
	var norm uintptr
	var retCd ClientData
	var proc2 uintptr
	var _objPtr2 uintptr
	// We found a cwd, which is now in our global storage. We must
	// make a copy. Norm already has a refCount of 1.
	//
	// Threading issue: note that multiple threads at system
	// startup could in principle call this function
	// simultaneously. They will therefore each set the cwdPathPtr
	// independently. That behaviour is a bit peculiar, but should
	// be fine. Once we have a cwd, we'll always be in the 'else'
	// branch below which is simpler.

	var cd ClientData
	var _objPtr3 uintptr
	var norm1 uintptr
	var fsRecPtr uintptr
	var retVal uintptr
	// New API.

	var proc21 uintptr
	var _objPtr4 uintptr
	var _objPtr5 uintptr
	// Note that both 'norm' and 'tsdPtr->cwdPathPtr' are normalized
	// paths. Therefore we can be more efficient than calling
	// 'Tcl_FSEqualPaths', and in addition avoid a nasty infinite loop
	// bug when trying to normalize tsdPtr->cwdPathPtr.

	// var len1 int32 at bp+16, 4

	// var len2 int32 at bp+20, 4

	var str1 uintptr
	var str2 uintptr
	var _objPtr6 uintptr
	// We already have a cwd cached, but we want to give the filesystem it
	// is in a chance to check whether that cwd has changed, or is perhaps
	// no longer accessible. This allows an error to be thrown if, say,
	// the permissions on that directory have changed.

	var fsPtr uintptr
	var retCd1 ClientData
	var retVal1 uintptr
	var norm2 uintptr
	tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&fsDataKey)), int32(unsafe.Sizeof(ThreadSpecificData6{})))

	if !(XTclFSCwdPointerEquals(tls, uintptr(0)) != 0) {
		goto __1
	}
	retVal = uintptr(0)

	// We've never been called before, try to find a cwd. Call each of the
	// "Tcl_GetCwd" function in succession. A non-NULL return value
	// indicates the particular function has succeeded.

	fsRecPtr = sFsGetFirstFilesystem(tls)
	sClaim(tls)
__3:
	if !(retVal == uintptr(0) && fsRecPtr != uintptr(0)) {
		goto __5
	}
	if !((*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FgetCwdProc == uintptr(0)) {
		goto __6
	}
	goto __4
__6:
	;

	if !((*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).Fversion == uintptr(0x1)) {
		goto __7
	}
	retVal = (*struct {
		f func(*libc.TLS, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FgetCwdProc})).f(tls, interp)
	goto __4
__7:
	;

	proc2 = (*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FgetCwdProc
	retCd = (*struct {
		f func(*libc.TLS, ClientData) ClientData
	})(unsafe.Pointer(&struct{ uintptr }{proc2})).f(tls, uintptr(0))
	if !(retCd != uintptr(0)) {
		goto __8
	}

	// Looks like a new current directory.

	retVal = (*struct {
		f func(*libc.TLS, ClientData) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FinternalToNormalizedProc})).f(tls, retCd)
	(*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount++
	norm = XTclFSNormalizeAbsolutePath(tls, interp, retVal)
	if !(norm != uintptr(0)) {
		goto __10
	}
	// We found a cwd, which is now in our global storage. We
	// must make a copy. Norm already has a refCount of 1.
	//
	// Threading issue: note that multiple threads at system
	// startup could in principle call this function
	// simultaneously. They will therefore each set the
	// cwdPathPtr independently. That behaviour is a bit
	// peculiar, but should be fine. Once we have a cwd, we'll
	// always be in the 'else' branch below which is simpler.

	sFsUpdateCwd(tls, norm, retCd)
__12:
	_objPtr = norm
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __15
	}
	XTclFreeObj(tls, _objPtr)
__15:
	;
	goto __13
__13:
	if 0 != 0 {
		goto __12
	}
	goto __14
__14:
	;
	goto __11
__10:
	(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FfreeInternalRepProc})).f(tls, retCd)
__11:
	;
__16:
	_objPtr1 = retVal
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __19
	}
	XTclFreeObj(tls, _objPtr1)
__19:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	retVal = uintptr(0)
	sDisclaim(tls)
	goto cdDidNotChange
	goto __9
__8:
	if !(interp != uintptr(0)) {
		goto __20
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38159,
		libc.VaList(bp, XTcl_PosixError(tls, interp))))
__20:
	;
__9:
	;
	goto __4
__4:
	fsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr
	goto __3
	goto __5
__5:
	;
	sDisclaim(tls)

	// Now the 'cwd' may NOT be normalized, at least on some platforms.
	// For the sake of efficiency, we want a completely normalized cwd at
	// all times.
	//
	// Finally, if retVal is NULL, we do not have a cwd, which could be
	// problematic.

	if !(retVal != uintptr(0)) {
		goto __21
	}
	norm1 = XTclFSNormalizeAbsolutePath(tls, interp, retVal)

	if !(norm1 != uintptr(0)) {
		goto __22
	}
	// We found a cwd, which is now in our global storage. We must
	// make a copy. Norm already has a refCount of 1.
	//
	// Threading issue: note that multiple threads at system
	// startup could in principle call this function
	// simultaneously. They will therefore each set the cwdPathPtr
	// independently. That behaviour is a bit peculiar, but should
	// be fine. Once we have a cwd, we'll always be in the 'else'
	// branch below which is simpler.

	cd = XTcl_FSGetNativePath(tls, norm1)

	sFsUpdateCwd(tls, norm1, XTclNativeDupInternalRep(tls, cd))
__23:
	_objPtr2 = norm1
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __26
	}
	XTclFreeObj(tls, _objPtr2)
__26:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
__22:
	;
__27:
	_objPtr3 = retVal
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __30
	}
	XTclFreeObj(tls, _objPtr3)
__30:
	;
	goto __28
__28:
	if 0 != 0 {
		goto __27
	}
	goto __29
__29:
	;
__21:
	;
	goto __2
__1:
	fsPtr =
		XTcl_FSGetFileSystemForPath(tls, (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr)
	retCd1 = uintptr(0)

	// If the filesystem couldn't be found, or if no cwd function exists
	// for this filesystem, then we simply assume the cached cwd is ok.
	// If we do call a cwd, we must watch for errors (if the cwd returns
	// NULL). This ensures that, say, on Unix if the permissions of the
	// cwd change, 'pwd' does actually throw the correct error in Tcl.
	// (This is tested for in the test suite on unix).

	if !(fsPtr == uintptr(0) || (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FgetCwdProc == uintptr(0)) {
		goto __31
	}
	goto cdDidNotChange
__31:
	;

	if !((*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).Fversion == uintptr(0x1)) {
		goto __32
	}
	retVal1 = (*struct {
		f func(*libc.TLS, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FgetCwdProc})).f(tls, interp)
	goto __33
__32:
	// New API.

	proc21 = (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FgetCwdProc

	retCd1 = (*struct {
		f func(*libc.TLS, ClientData) ClientData
	})(unsafe.Pointer(&struct{ uintptr }{proc21})).f(tls, (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData)
	if !(retCd1 == uintptr(0) && interp != uintptr(0)) {
		goto __34
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38159,
		libc.VaList(bp+8, XTcl_PosixError(tls, interp))))
__34:
	;

	if !(retCd1 == (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData) {
		goto __35
	}
	goto cdDidNotChange
__35:
	;

	// Looks like a new current directory.

	retVal1 = (*struct {
		f func(*libc.TLS, ClientData) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FinternalToNormalizedProc})).f(tls, retCd1)
	(*Tcl_Obj)(unsafe.Pointer(retVal1)).FrefCount++
__33:
	;

	// Check if the 'cwd' function returned an error; if so, reset the
	// cwd.

	if !(retVal1 == uintptr(0)) {
		goto __36
	}
	sFsUpdateCwd(tls, uintptr(0), uintptr(0))
	goto cdDidNotChange
__36:
	;

	// Normalize the path.

	norm2 = XTclFSNormalizeAbsolutePath(tls, interp, retVal1)

	// Check whether cwd has changed from the value previously stored in
	// cwdPathPtr. Really 'norm' shouldn't be NULL, but we are careful.

	if !(norm2 == uintptr(0)) {
		goto __37
	}
	// Do nothing
	if !(retCd1 != uintptr(0)) {
		goto __39
	}
	(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfreeInternalRepProc})).f(tls, retCd1)
__39:
	;
	goto __38
__37:
	if !(norm2 == (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr) {
		goto __40
	}
	goto cdEqual
	goto __41
__40:

	str1 = XTcl_GetStringFromObj(tls, (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr, bp+16)
	str2 = XTcl_GetStringFromObj(tls, norm2, bp+20)
	if !(*(*int32)(unsafe.Pointer(bp + 16)) == *(*int32)(unsafe.Pointer(bp + 20)) && libc.Xstrcmp(tls, str1, str2) == 0) {
		goto __42
	}
	// If the paths were equal, we can be more efficient and
	// retain the old path object which will probably already be
	// shared. In this case we can simply free the normalized path
	// we just calculated.

cdEqual:
__44:
	_objPtr4 = norm2
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __47
	}
	XTclFreeObj(tls, _objPtr4)
__47:
	;
	goto __45
__45:
	if 0 != 0 {
		goto __44
	}
	goto __46
__46:
	;
	if !(retCd1 != uintptr(0)) {
		goto __48
	}
	(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfreeInternalRepProc})).f(tls, retCd1)
__48:
	;
	goto __43
__42:
	sFsUpdateCwd(tls, norm2, retCd1)
__49:
	_objPtr5 = norm2
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __52
	}
	XTclFreeObj(tls, _objPtr5)
__52:
	;
	goto __50
__50:
	if 0 != 0 {
		goto __49
	}
	goto __51
__51:
	;
__43:
	;
__41:
	;
__38:
	;
__53:
	_objPtr6 = retVal1
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr6)).FrefCount, 1) <= 1) {
		goto __56
	}
	XTclFreeObj(tls, _objPtr6)
__56:
	;
	goto __54
__54:
	if 0 != 0 {
		goto __53
	}
	goto __55
__55:
	;
__2:
	;

cdDidNotChange:
	if !((*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr != uintptr(0)) {
		goto __57
	}
	(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr)).FrefCount++
__57:
	;

	return (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr
}

//----------------------------------------------------------------------
//
// Tcl_FSChdir --
//
//	This function replaces the library version of chdir().
//
//	The path is normalized and then passed to the filesystem which claims
//	it.
//
// Results:
//	See chdir() documentation. If successful, we keep a record of the
//	successful path in cwdPathPtr for subsequent calls to getcwd.
//
// Side effects:
//	See chdir() documentation. The global cwdPathPtr may change value.
//
//----------------------------------------------------------------------

func XTcl_FSChdir(tls *libc.TLS, pathPtr uintptr) int32 { /* tclIOUtil.c:2899:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	var fsPtr uintptr
	var oldFsPtr uintptr = uintptr(0)
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&fsDataKey)), int32(unsafe.Sizeof(ThreadSpecificData6{})))
	var retVal int32 = -1

	if (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr != uintptr(0) {
		oldFsPtr = XTcl_FSGetFileSystemForPath(tls, (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdPathPtr)
	}
	if XTcl_FSGetNormalizedPath(tls, uintptr(0), pathPtr) == uintptr(0) {
		XTcl_SetErrno(tls, ENOENT)
		return retVal
	}

	fsPtr = XTcl_FSGetFileSystemForPath(tls, pathPtr)
	if fsPtr != uintptr(0) {
		if (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FchdirProc != uintptr(0) {
			// If this fails, an appropriate errno will have been stored using
			// 'Tcl_SetErrno()'.

			retVal = (*struct {
				f func(*libc.TLS, uintptr) int32
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FchdirProc})).f(tls, pathPtr)
		} else {
			// Fallback on stat-based implementation.

			// var buf Tcl_StatBuf at bp, 144

			// If the file can be stat'ed and is a directory and is readable,
			// then we can chdir. If any of these actions fail, then
			// 'Tcl_SetErrno()' should automatically have been called to set
			// an appropriate error code.

			if XTcl_FSStat(tls, pathPtr, bp) == 0 && (*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000) &&
				XTcl_FSAccess(tls, pathPtr, R_OK) == 0 {
				// We allow the chdir.

				retVal = 0
			}
		}
	} else {
		XTcl_SetErrno(tls, ENOENT)
	}

	// The cwd changed, or an error was thrown. If an error was thrown, we can
	// just continue (and that will report the error to the user). If there
	// was no error we must assume that the cwd was actually changed to the
	// normalized value we calculated above, and we must therefore cache that
	// information.
	//
	// If the filesystem in question has a getCwdProc, then the correct logic
	// which performs the part below is already part of the Tcl_FSGetCwd()
	// call, so no need to replicate it again. This will have a side effect
	// though. The private authoritative representation of the current working
	// directory stored in cwdPathPtr in static memory will be out-of-sync
	// with the real OS-maintained value. The first call to Tcl_FSGetCwd will
	// however recalculate the private copy to match the OS-value so
	// everything will work right.
	//
	// However, if there is no getCwdProc, then we _must_ update our private
	// storage of the cwd, since this is the only opportunity to do that!
	//
	// Note: We currently call this block of code irrespective of whether
	// there was a getCwdProc or not, but the code should all in principle
	// work if we only call this block if fsPtr->getCwdProc == NULL.

	if retVal == 0 {
		// Note that this normalized path may be different to what we found
		// above (or at least a different object), if the filesystem epoch
		// changed recently. This can actually happen with scripted documents
		// very easily. Therefore we ask for the normalized path again (the
		// correct value will have been cached as a result of the
		// Tcl_FSGetFileSystemForPath call above anyway).

		var normDirName uintptr = XTcl_FSGetNormalizedPath(tls, uintptr(0), pathPtr)

		if normDirName == uintptr(0) {
			// Not really true, but what else to do?
			XTcl_SetErrno(tls, ENOENT)
			return -1
		}

		if fsPtr == uintptr(unsafe.Pointer(&XtclNativeFilesystem)) {
			// For the native filesystem, we keep a cache of the native
			// representation of the cwd. But, we want to do that for the
			// exact format that is returned by 'getcwd' (so that we can later
			// compare the two representations for equality), which might not
			// be exactly the same char-string as the native representation of
			// the fully normalized path (e.g. on Windows there's a
			// forward-slash vs backslash difference). Hence we ask for this
			// again here. On Unix it might actually be true that we always
			// have the correct form in the native rep in which case we could
			// simply use:
			//		cd = Tcl_FSGetNativePath(pathPtr);
			// instead. This should be examined by someone on Unix.

			var cd ClientData
			var oldcd ClientData = (*ThreadSpecificData6)(unsafe.Pointer(tsdPtr)).FcwdClientData

			// Assumption we are using a filesystem version 2.

			var proc2 uintptr = (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FgetCwdProc

			cd = (*struct {
				f func(*libc.TLS, ClientData) ClientData
			})(unsafe.Pointer(&struct{ uintptr }{proc2})).f(tls, oldcd)
			if cd != oldcd {
				sFsUpdateCwd(tls, normDirName, cd)
			}
		} else {
			sFsUpdateCwd(tls, normDirName, uintptr(0))
		}

		// If the filesystem changed between old and new cwd
		// force filesystem refresh on path objects.
		if oldFsPtr != uintptr(0) && fsPtr != oldFsPtr {
			XTcl_FSMountsChanged(tls, uintptr(0))
		}
	}

	return retVal
}

//----------------------------------------------------------------------
//
// Tcl_FSLoadFile --
//
//	Dynamically loads a binary code file into memory and returns the
//	addresses of two functions within that file, if they are defined. The
//	appropriate function for the filesystem to which pathPtr belongs will
//	be called.
//
//	Note that the native filesystem doesn't actually assume 'pathPtr' is a
//	path. Rather it assumes pathPtr is either a path or just the name
//	(tail) of a file which can be found somewhere in the environment's
//	loadable path. This behaviour is not very compatible with virtual
//	filesystems (and has other problems documented in the load man-page),
//	so it is advised that full paths are always used.
//
// Results:
//	A standard Tcl completion code. If an error occurs, an error message
//	is left in the interp's result.
//
// Side effects:
//	New code suddenly appears in memory. This may later be unloaded by
//	passing the clientData to the unloadProc.
//
//----------------------------------------------------------------------

func XTcl_FSLoadFile(tls *libc.TLS, interp uintptr, pathPtr uintptr, sym1 uintptr, sym2 uintptr, proc1Ptr uintptr, proc2Ptr uintptr, handlePtr uintptr, unloadProcPtr uintptr) int32 { /* tclIOUtil.c:3066:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	// var symbols [3]uintptr at bp, 24

	// var procPtrs [2]uintptr at bp+24, 16

	var res int32

	// Initialize the arrays.

	*(*uintptr)(unsafe.Pointer(bp)) = sym1
	*(*uintptr)(unsafe.Pointer(bp + 1*8)) = sym2
	*(*uintptr)(unsafe.Pointer(bp + 2*8)) = uintptr(0)

	// Perform the load.

	res = XTcl_LoadFile(tls, interp, pathPtr, bp, 0, bp+24, handlePtr)
	if res == TCL_OK {
		*(*uintptr)(unsafe.Pointer(proc1Ptr)) = *(*uintptr)(unsafe.Pointer(bp + 24))
		*(*uintptr)(unsafe.Pointer(proc2Ptr)) = *(*uintptr)(unsafe.Pointer(bp + 24 + 1*8))
	} else {
		*(*uintptr)(unsafe.Pointer(proc1Ptr)) = libc.AssignPtrUintptr(proc2Ptr, uintptr(0))
	}

	return res
}

//----------------------------------------------------------------------
//
// Tcl_LoadFile --
//
//	Dynamically loads a binary code file into memory and returns the
//	addresses of a number of given functions within that file, if they are
//	defined. The appropriate function for the filesystem to which pathPtr
//	belongs will be called.
//
//	Note that the native filesystem doesn't actually assume 'pathPtr' is a
//	path. Rather it assumes pathPtr is either a path or just the name
//	(tail) of a file which can be found somewhere in the environment's
//	loadable path. This behaviour is not very compatible with virtual
//	filesystems (and has other problems documented in the load man-page),
//	so it is advised that full paths are always used.
//
// Results:
//	A standard Tcl completion code. If an error occurs, an error message
//	is left in the interp's result.
//
// Side effects:
//	New code suddenly appears in memory. This may later be unloaded by
//	calling TclFS_UnloadFile.
//
//----------------------------------------------------------------------

// Workaround for issue with modern HPUX which do allow the unlink (no ETXTBSY
// error) yet somehow trash some internal data structures which prevents the
// second and further shared libraries from getting properly loaded. Only the
// first is ok. We try to get around the issue by not unlinking,
// i.e. emulating the behaviour of the older HPUX which denied removal.
//
// Doing the unlink is also an issue within docker containers, whose AUFS
// bungles this as well, see
//     https://github.com/dotcloud/docker/issues/1911
//
// For these situations the change below makes the execution of the unlink
// semi-controllable at runtime.
//
//     An AUFS filesystem (if it can be detected) will force avoidance of
//     unlink. The env variable TCL_TEMPLOAD_NO_UNLINK allows detection of a
//     users general request (unlink and not.
//
// By default the unlink is done (if not in AUFS). However if the variable is
// present and set to true (any integer > 0) then the unlink is skipped.

func skipUnlink(tls *libc.TLS, shlibFile uintptr) int32 { /* tclIOUtil.c:3169:1: */
	// Order of testing:
	// 1. On hpux we generally want to skip unlink in general
	//
	// Outside of hpux then:
	// 2. For a general user request   (TCL_TEMPLOAD_NO_UNLINK present, non-empty, => int)
	// 3. For general AUFS environment (statfs, if available).
	//
	// Ad 2: This variable can disable/override the AUFS detection, i.e. for
	// testing if a newer AUFS does not have the bug any more.
	//
	// Ad 3: This is conditionally compiled in. Condition currently must be set manually.
	//       This part needs proper tests in the configure(.in).

	var skipstr uintptr

	skipstr = libc.Xgetenv(tls, ts+38200)
	if skipstr != 0 && int32(*(*int8)(unsafe.Pointer(skipstr))) != 0 {
		return libc.Xatoi(tls, skipstr)
	}

	// Fallback: !hpux, no EV override, no AUFS (detection, nor detected):
	// Don't skip
	return 0
}

func XTcl_LoadFile(tls *libc.TLS, interp uintptr, pathPtr uintptr, symbols uintptr, flags int32, procVPtrs uintptr, handlePtr uintptr) int32 { /* tclIOUtil.c:3223:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var procPtrs uintptr
	var fsPtr uintptr
	var copyFsPtr uintptr
	// var unloadProcPtr uintptr at bp+16, 8

	var copyToPtr uintptr
	// var newLoadHandle Tcl_LoadHandle at bp+32, 8

	var divertedLoadHandle Tcl_LoadHandle
	var newUnloadProcPtr uintptr
	var tvdlPtr uintptr
	var retVal int32
	var i int32
	var _objPtr uintptr
	var _objPtr1 uintptr
	var cachePtr uintptr
	var _objPtr2 uintptr
	// var index int32 at bp+24, 4

	var perm uintptr
	var _objPtr3 uintptr
	var _objPtr4 uintptr
	var _objPtr5 uintptr
	procPtrs = procVPtrs
	fsPtr = XTcl_FSGetFileSystemForPath(tls, pathPtr)
	*(*Tcl_LoadHandle)(unsafe.Pointer(bp + 32 /* newLoadHandle */)) = uintptr(0)
	divertedLoadHandle = uintptr(0)
	newUnloadProcPtr = uintptr(0)

	if !(fsPtr == uintptr(0)) {
		goto __1
	}
	XTcl_SetErrno(tls, ENOENT)
	return TCL_ERROR
__1:
	;

	if !((*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FloadFileProc != uintptr(0)) {
		goto __2
	}
	retVal = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(fsPtr + 224)))(tls, interp, pathPtr, handlePtr, bp+16, flags)

	if !(retVal == TCL_OK) {
		goto __3
	}
	if !(*(*Tcl_LoadHandle)(unsafe.Pointer(handlePtr)) == uintptr(0)) {
		goto __4
	}
	return TCL_ERROR
__4:
	;
	if !(interp != 0) {
		goto __5
	}
	XTcl_ResetResult(tls, interp)
__5:
	;
	goto resolveSymbols
__3:
	;
	if !(XTcl_GetErrno(tls) != EXDEV) {
		goto __6
	}
	return retVal
__6:
	;
__2:
	;

	// The filesystem doesn't support 'load', so we fall back on the following
	// technique:
	//
	// First check if it is readable -- and exists!

	if !(XTcl_FSAccess(tls, pathPtr, R_OK) != 0) {
		goto __7
	}
	if !(interp != 0) {
		goto __8
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38223,
		libc.VaList(bp, XTcl_GetString(tls, pathPtr), XTcl_PosixError(tls, interp))))
__8:
	;
	return TCL_ERROR
__7:
	;

	// Get a temporary filename to use, first to copy the file into, and then
	// to load.

	copyToPtr = XTclpTempFileNameForLibrary(tls, interp, pathPtr)
	if !(copyToPtr == uintptr(0)) {
		goto __9
	}
	return TCL_ERROR
__9:
	;
	(*Tcl_Obj)(unsafe.Pointer(copyToPtr)).FrefCount++

	copyFsPtr = XTcl_FSGetFileSystemForPath(tls, copyToPtr)
	if !(copyFsPtr == uintptr(0) || copyFsPtr == fsPtr) {
		goto __10
	}
	// We already know we can't use Tcl_FSLoadFile from this filesystem,
	// and we must avoid a possible infinite loop. Try to delete the file
	// we probably created, and then exit.

	XTcl_FSDeleteFile(tls, copyToPtr)
__11:
	_objPtr = copyToPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __14
	}
	XTclFreeObj(tls, _objPtr)
__14:
	;
	goto __12
__12:
	if 0 != 0 {
		goto __11
	}
	goto __13
__13:
	;
	if !(interp != 0) {
		goto __15
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+38254, -1))
__15:
	;
	return TCL_ERROR
__10:
	;

	if !(XTclCrossFilesystemCopy(tls, interp, pathPtr, copyToPtr) != TCL_OK) {
		goto __16
	}
	// Cross-platform copy failed.

	XTcl_FSDeleteFile(tls, copyToPtr)
__17:
	_objPtr1 = copyToPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __20
	}
	XTclFreeObj(tls, _objPtr1)
__20:
	;
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
	return TCL_ERROR
__16:
	;

	/*
	 * Do we need to set appropriate permissions on the file? This may be
	 * required on some systems. On Unix we could loop over the file
	 * attributes, and set any that are called "-permissions" to 0700. However
	 * we just do this directly, like this:
	 */

__21:
	;
__24:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __27
	}
	perm = XTclThreadAllocObj(tls)
	goto __28
__27:
	perm = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(perm + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__28:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
	(*Tcl_Obj)(unsafe.Pointer(perm)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0) {
		goto __29
	}
	(*Tcl_Obj)(unsafe.Pointer(perm)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(perm)).Flength = 0
	goto __30
__29:
	(*Tcl_Obj)(unsafe.Pointer(perm)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(perm)).Fbytes, ts+38292, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(perm)).Fbytes + 4)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(perm)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
__30:
	;
	(*Tcl_Obj)(unsafe.Pointer(perm)).FtypePtr = uintptr(0)

	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
	(*Tcl_Obj)(unsafe.Pointer(perm)).FrefCount++
	if !(XTclFSFileAttrIndex(tls, copyToPtr, ts+30023, bp+24) == TCL_OK) {
		goto __31
	}
	XTcl_FSFileAttrsSet(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp + 24 /* index */)), copyToPtr, perm)
__31:
	;
__32:
	_objPtr2 = perm
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __35
	}
	XTclFreeObj(tls, _objPtr2)
__35:
	;
	goto __33
__33:
	if 0 != 0 {
		goto __32
	}
	goto __34
__34:
	;

	// We need to reset the result now, because the cross-filesystem copy may
	// have stored the number of bytes in the result.

	if !(interp != 0) {
		goto __36
	}
	XTcl_ResetResult(tls, interp)
__36:
	;

	retVal = XTcl_LoadFile(tls, interp, copyToPtr, symbols, flags, procPtrs,
		bp+32)
	if !(retVal != TCL_OK) {
		goto __37
	}
	// The file didn't load successfully.

	XTcl_FSDeleteFile(tls, copyToPtr)
__38:
	_objPtr3 = copyToPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __41
	}
	XTclFreeObj(tls, _objPtr3)
__41:
	;
	goto __39
__39:
	if 0 != 0 {
		goto __38
	}
	goto __40
__40:
	;
	return retVal
__37:
	;

	// Try to delete the file immediately - this is possible in some OSes, and
	// avoids any worries about leaving the copy laying around on exit.

	if !(!(skipUnlink(tls, copyToPtr) != 0) && XTcl_FSDeleteFile(tls, copyToPtr) == TCL_OK) {
		goto __42
	}
__43:
	_objPtr4 = copyToPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __46
	}
	XTclFreeObj(tls, _objPtr4)
__46:
	;
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;

	// We tell our caller about the real shared library which was loaded.
	// Note that this does mean that the package list maintained by 'load'
	// will store the original (vfs) path alongside the temporary load
	// handle and unload proc ptr.

	*(*Tcl_LoadHandle)(unsafe.Pointer(handlePtr)) = *(*Tcl_LoadHandle)(unsafe.Pointer(bp + 32 /* newLoadHandle */))
	if !(interp != 0) {
		goto __47
	}
	XTcl_ResetResult(tls, interp)
__47:
	;
	return TCL_OK
__42:
	;

	// When we unload this file, we need to divert the unloading so we can
	// unload and cleanup the temporary file correctly.

	tvdlPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FsDivertLoad{})))

	// Remember three pieces of information. This allows us to cleanup the
	// diverted load completely, on platforms which allow proper unloading of
	// code.

	(*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FloadHandle = *(*Tcl_LoadHandle)(unsafe.Pointer(bp + 32 /* newLoadHandle */))
	(*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FunloadProcPtr = newUnloadProcPtr

	if !(copyFsPtr != uintptr(unsafe.Pointer(&XtclNativeFilesystem))) {
		goto __48
	}
	// copyToPtr is already incremented for this reference.

	(*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFile = copyToPtr

	// This is the filesystem we loaded it into. Since we have a reference
	// to 'copyToPtr', we already have a refCount on this filesystem, so
	// we don't need to worry about it disappearing on us.

	(*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFilesystem = copyFsPtr
	(*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFileNativeRep = uintptr(0)
	goto __49
__48:
	// We need the native rep.

	(*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFileNativeRep = XTclNativeDupInternalRep(tls,
		XTcl_FSGetInternalRep(tls, copyToPtr, copyFsPtr))

	// We don't need or want references to the copied Tcl_Obj or the
	// filesystem if it is the native one.

	(*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFile = uintptr(0)
	(*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFilesystem = uintptr(0)
__50:
	_objPtr5 = copyToPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __53
	}
	XTclFreeObj(tls, _objPtr5)
__53:
	;
	goto __51
__51:
	if 0 != 0 {
		goto __50
	}
	goto __52
__52:
	;
__49:
	;

	copyToPtr = uintptr(0)

	divertedLoadHandle = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_LoadHandle_{})))
	(*Tcl_LoadHandle_)(unsafe.Pointer(divertedLoadHandle)).FclientData = tvdlPtr
	(*Tcl_LoadHandle_)(unsafe.Pointer(divertedLoadHandle)).FfindSymbolProcPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, Tcl_LoadHandle, uintptr) uintptr
	}{sDivertFindSymbol}))
	(*Tcl_LoadHandle_)(unsafe.Pointer(divertedLoadHandle)).FunloadFileProcPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, Tcl_LoadHandle)
	}{sDivertUnloadFile}))
	*(*Tcl_LoadHandle)(unsafe.Pointer(handlePtr)) = divertedLoadHandle

	if !(interp != 0) {
		goto __54
	}
	XTcl_ResetResult(tls, interp)
__54:
	;
	return retVal

resolveSymbols:
	// At this point, *handlePtr is already set up to the handle for the
	// loaded library. We now try to resolve the symbols.

	if !(symbols != uintptr(0)) {
		goto __55
	}
	i = 0
__56:
	if !(*(*uintptr)(unsafe.Pointer(symbols + uintptr(i)*8)) != uintptr(0)) {
		goto __58
	}
	*(*uintptr)(unsafe.Pointer(procPtrs + uintptr(i)*8)) = XTcl_FindSymbol(tls, interp, *(*Tcl_LoadHandle)(unsafe.Pointer(handlePtr)), *(*uintptr)(unsafe.Pointer(symbols + uintptr(i)*8)))
	if !(*(*uintptr)(unsafe.Pointer(procPtrs + uintptr(i)*8)) == uintptr(0)) {
		goto __59
	}
	// At least one symbol in the list was not found.  Unload the
	// file, and report the problem back to the caller.
	// (Tcl_FindSymbol should already have left an appropriate
	// error message.)

	(*struct {
		f func(*libc.TLS, Tcl_LoadHandle)
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_LoadHandle_)(unsafe.Pointer(*(*Tcl_LoadHandle)(unsafe.Pointer(handlePtr)))).FunloadFileProcPtr})).f(tls, *(*Tcl_LoadHandle)(unsafe.Pointer(handlePtr)))
	*(*Tcl_LoadHandle)(unsafe.Pointer(handlePtr)) = uintptr(0)
	return TCL_ERROR
__59:
	;
	goto __57
__57:
	i++
	goto __56
	goto __58
__58:
	;
__55:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DivertFindSymbol --
//
//	Find a symbol in a shared library loaded by copy-from-VFS.
//
//----------------------------------------------------------------------

func sDivertFindSymbol(tls *libc.TLS, interp uintptr, loadHandle Tcl_LoadHandle, symbol uintptr) uintptr { /* tclIOUtil.c:3539:13: */
	var tvdlPtr uintptr = (*Tcl_LoadHandle_)(unsafe.Pointer(loadHandle)).FclientData
	var originalHandle Tcl_LoadHandle = (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FloadHandle

	return (*struct {
		f func(*libc.TLS, uintptr, Tcl_LoadHandle, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_LoadHandle_)(unsafe.Pointer(originalHandle)).FfindSymbolProcPtr})).f(tls, interp, originalHandle, symbol)
}

//----------------------------------------------------------------------
//
// DivertUnloadFile --
//
//	Unloads a file that has been loaded by copying from VFS to the native
//	filesystem.
//
// Parameters:
//	loadHandle -- Handle of the file to unload
//
//----------------------------------------------------------------------

func sDivertUnloadFile(tls *libc.TLS, loadHandle Tcl_LoadHandle) { /* tclIOUtil.c:3566:1: */
	var tvdlPtr uintptr = (*Tcl_LoadHandle_)(unsafe.Pointer(loadHandle)).FclientData
	var originalHandle Tcl_LoadHandle

	// This test should never trigger, since we give the client data in the
	// function above.

	if tvdlPtr == uintptr(0) {
		return
	}
	originalHandle = (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FloadHandle

	// Call the real 'unloadfile' proc we actually used. It is very important
	// that we call this first, so that the shared library is actually
	// unloaded by the OS. Otherwise, the following 'delete' may well fail
	// because the shared library is still in use.

	(*struct {
		f func(*libc.TLS, Tcl_LoadHandle)
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_LoadHandle_)(unsafe.Pointer(originalHandle)).FunloadFileProcPtr})).f(tls, originalHandle)

	// What filesystem contains the temp copy of the library?

	if (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFilesystem == uintptr(0) {
		// It was the native filesystem, and we have a special function
		// available just for this purpose, which we know works even at this
		// late stage.

		XTclpDeleteFile(tls, (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFileNativeRep)
		sNativeFreeInternalRep(tls, (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFileNativeRep)
	} else {
		// Remove the temporary file we created. Note, we may crash here
		// because encodings have been taken down already.

		if (*struct {
			f func(*libc.TLS, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer((*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFilesystem)).FdeleteFileProc})).f(tls, (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFile) !=
			TCL_OK {
			// The above may have failed because the filesystem, or something
			// it depends upon (e.g. encodings) have been taken down because
			// Tcl is exiting.
			//
			// We may need to work out how to delete this file more robustly
			// (or give the filesystem the information it needs to delete the
			// file more robustly).
			//
			// In particular, one problem might be that the filesystem cannot
			// extract the information it needs from the above path object
			// because Tcl's entire filesystem apparatus (the code in this
			// file) has been finalized, and it refuses to pass the internal
			// representation to the filesystem.
		}

		// And free up the allocations. This will also of course remove a
		// refCount from the Tcl_Filesystem to which this file belongs, which
		// could then free up the filesystem if we are exiting.

		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFile
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	XTclpFree(tls, tvdlPtr)
	XTclpFree(tls, loadHandle)
}

//----------------------------------------------------------------------
//
// Tcl_FindSymbol --
//
//	Find a symbol in a loaded library
//
// Results:
//	Returns a pointer to the symbol if found. If not found, returns NULL
//	and leaves an error message in the interpreter result.
//
// This function was once filesystem-specific, but has been made portable by
// having TclpDlopen return a structure that includes procedure pointers.
//
//----------------------------------------------------------------------

func XTcl_FindSymbol(tls *libc.TLS, interp uintptr, loadHandle Tcl_LoadHandle, symbol uintptr) uintptr { /* tclIOUtil.c:3659:6: */
	return (*struct {
		f func(*libc.TLS, uintptr, Tcl_LoadHandle, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_LoadHandle_)(unsafe.Pointer(loadHandle)).FfindSymbolProcPtr})).f(tls, interp, loadHandle, symbol)
}

//----------------------------------------------------------------------
//
// Tcl_FSUnloadFile --
//
//	Unloads a library given its handle. Checks first that the library
//	supports unloading.
//
//----------------------------------------------------------------------

func XTcl_FSUnloadFile(tls *libc.TLS, interp uintptr, handle Tcl_LoadHandle) int32 { /* tclIOUtil.c:3680:1: */
	if (*Tcl_LoadHandle_)(unsafe.Pointer(handle)).FunloadFileProcPtr == uintptr(0) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+38297,
				-1))
		}
		return TCL_ERROR
	}
	if (*Tcl_LoadHandle_)(unsafe.Pointer(handle)).FunloadFileProcPtr != uintptr(0) {
		(*struct {
			f func(*libc.TLS, Tcl_LoadHandle)
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_LoadHandle_)(unsafe.Pointer(handle)).FunloadFileProcPtr})).f(tls, handle)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclFSUnloadTempFile --
//
//	This function is called when we loaded a library of code via an
//	intermediate temporary file. This function ensures the library is
//	correctly unloaded and the temporary file is correctly deleted.
//
// Results:
//	None.
//
// Side effects:
//	The effects of the 'unload' function called, and of course the
//	temporary file will be deleted.
//
//----------------------------------------------------------------------

func XTclFSUnloadTempFile(tls *libc.TLS, loadHandle Tcl_LoadHandle) { /* tclIOUtil.c:3718:1: */
	var tvdlPtr uintptr = loadHandle

	// This test should never trigger, since we give the client data in the
	// function above.

	if tvdlPtr == uintptr(0) {
		return
	}

	// Call the real 'unloadfile' proc we actually used. It is very important
	// that we call this first, so that the shared library is actually
	// unloaded by the OS. Otherwise, the following 'delete' may well fail
	// because the shared library is still in use.

	if (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FunloadProcPtr != uintptr(0) {
		(*struct {
			f func(*libc.TLS, Tcl_LoadHandle)
		})(unsafe.Pointer(&struct{ uintptr }{(*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FunloadProcPtr})).f(tls, (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FloadHandle)
	}

	if (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFilesystem == uintptr(0) {
		// It was the native filesystem, and we have a special function
		// available just for this purpose, which we know works even at this
		// late stage.

		XTclpDeleteFile(tls, (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFileNativeRep)
		sNativeFreeInternalRep(tls, (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFileNativeRep)
	} else {
		// Remove the temporary file we created. Note, we may crash here
		// because encodings have been taken down already.

		if (*struct {
			f func(*libc.TLS, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer((*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFilesystem)).FdeleteFileProc})).f(tls, (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFile) !=
			TCL_OK {
			// The above may have failed because the filesystem, or something
			// it depends upon (e.g. encodings) have been taken down because
			// Tcl is exiting.
			//
			// We may need to work out how to delete this file more robustly
			// (or give the filesystem the information it needs to delete the
			// file more robustly).
			//
			// In particular, one problem might be that the filesystem cannot
			// extract the information it needs from the above path object
			// because Tcl's entire filesystem apparatus (the code in this
			// file) has been finalized, and it refuses to pass the internal
			// representation to the filesystem.
		}

		// And free up the allocations. This will also of course remove a
		// refCount from the Tcl_Filesystem to which this file belongs, which
		// could then free up the filesystem if we are exiting.

		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*FsDivertLoad)(unsafe.Pointer(tvdlPtr)).FdivertedFile
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	XTclpFree(tls, tvdlPtr)
}

//---------------------------------------------------------------------------
//
// Tcl_FSLink --
//
//	This function replaces the library version of readlink() and can also
//	be used to make links. The appropriate function for the filesystem to
//	which pathPtr belongs will be called.
//
// Results:
//	If toPtr is NULL, then the result is a Tcl_Obj specifying the contents
//	of the symbolic link given by 'pathPtr', or NULL if the symbolic link
//	could not be read. The result is owned by the caller, which should
//	call Tcl_DecrRefCount when the result is no longer needed.
//
//	If toPtr is non-NULL, then the result is toPtr if the link action was
//	successful, or NULL if not. In this case the result has no additional
//	reference count, and need not be freed. The actual action to perform
//	is given by the 'linkAction' flags, which is an or'd combination of:
//
//		TCL_CREATE_SYMBOLIC_LINK
//		TCL_CREATE_HARD_LINK
//
//	Note that most filesystems will not support linking across to
//	different filesystems, so this function will usually fail unless toPtr
//	is in the same FS as pathPtr.
//
// Side effects:
//	See readlink() documentation. A new filesystem link object may appear.
//
//---------------------------------------------------------------------------

func XTcl_FSLink(tls *libc.TLS, pathPtr uintptr, toPtr uintptr, linkAction int32) uintptr { /* tclIOUtil.c:3824:9: */
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FlinkProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, uintptr, uintptr, int32) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FlinkProc})).f(tls, pathPtr, toPtr, linkAction)
	}

	// If S_IFLNK isn't defined it means that the machine doesn't support
	// symbolic links, so the file can't possibly be a symbolic link. Generate
	// an EINVAL error, which is what happens on machines that do support
	// symbolic links when you invoke readlink on a file that isn't a symbolic
	// link.

	XTcl_SetErrno(tls, ENOENT)
	return uintptr(0)
}

//---------------------------------------------------------------------------
//
// Tcl_FSListVolumes --
//
//	Lists the currently mounted volumes. The chain of functions that have
//	been "inserted" into the filesystem will be called in succession; each
//	may return a list of volumes, all of which are added to the result
//	until all mounted file systems are listed.
//
//	Notice that we assume the lists returned by each filesystem (if non
//	NULL) have been given a refCount for us already. However, we are NOT
//	allowed to hang on to the list itself (it belongs to the filesystem we
//	called). Therefore we quite naturally add its contents to the result
//	we are building, and then decrement the refCount.
//
// Results:
//	The list of volumes, in an object which has refCount 0.
//
// Side effects:
//	None
//
//---------------------------------------------------------------------------

func XTcl_FSListVolumes(tls *libc.TLS) uintptr { /* tclIOUtil.c:3877:9: */
	var fsRecPtr uintptr
	var resultPtr uintptr = XTcl_NewObj(tls)

	// Call each of the "listVolumes" function in succession. A non-NULL
	// return value indicates the particular function has succeeded. We call
	// all the functions registered, since we want a list of all drives from
	// all filesystems.

	fsRecPtr = sFsGetFirstFilesystem(tls)
	sClaim(tls)
	for fsRecPtr != uintptr(0) {
		if (*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FlistVolumesProc != uintptr(0) {
			var thisFsVolumes uintptr = (*struct{ f func(*libc.TLS) uintptr })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FlistVolumesProc})).f(tls)

			if thisFsVolumes != uintptr(0) {
				XTcl_ListObjAppendList(tls, uintptr(0), resultPtr, thisFsVolumes)
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = thisFsVolumes
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
		}
		fsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr
	}
	sDisclaim(tls)

	return resultPtr
}

//---------------------------------------------------------------------------
//
// FsListMounts --
//
//	List all mounts within the given directory, which match the given
//	pattern.
//
// Results:
//	The list of mounts, in a list object which has refCount 0, or NULL if
//	we didn't even find any filesystems to try to list mounts.
//
// Side effects:
//	None
//
//---------------------------------------------------------------------------

func sFsListMounts(tls *libc.TLS, pathPtr uintptr, pattern uintptr) uintptr { /* tclIOUtil.c:3926:16: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var fsRecPtr uintptr
	*(*Tcl_GlobTypeData)(unsafe.Pointer(bp /* mountsOnly */)) = Tcl_GlobTypeData{Ftype: int32(1) << 7}
	var resultPtr uintptr = uintptr(0)

	// Call each of the "matchInDirectory" functions in succession, with the
	// specific type information 'mountsOnly'. A non-NULL return value
	// indicates the particular function has succeeded. We call all the
	// functions registered, since we want a list from each filesystems.

	fsRecPtr = sFsGetFirstFilesystem(tls)
	sClaim(tls)
	for fsRecPtr != uintptr(0) {
		if (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr != uintptr(unsafe.Pointer(&XtclNativeFilesystem)) && (*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FmatchInDirectoryProc != uintptr(0) {
			if resultPtr == uintptr(0) {
				resultPtr = XTcl_NewObj(tls)
			}
			(*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FmatchInDirectoryProc})).f(tls, uintptr(0), resultPtr, pathPtr,
				pattern, bp /* &mountsOnly */)
		}
		fsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr
	}
	sDisclaim(tls)

	return resultPtr
}

//---------------------------------------------------------------------------
//
// Tcl_FSSplitPath --
//
//	This function takes the given Tcl_Obj, which should be a valid path,
//	and returns a Tcl List object containing each segment of that path as
//	an element.
//
// Results:
//	Returns list object with refCount of zero. If the passed in lenPtr is
//	non-NULL, we use it to return the number of elements in the returned
//	list.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_FSSplitPath(tls *libc.TLS, pathPtr uintptr, lenPtr uintptr) uintptr { /* tclIOUtil.c:3980:9: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var result uintptr = uintptr(0) // Needed only to prevent gcc warnings.
	// var fsPtr uintptr at bp, 8

	var separator int8 = int8('/')
	// var driveNameLength int32 at bp+8, 4

	var p uintptr

	// Perform platform specific splitting.

	if XTclFSGetPathType(tls, pathPtr, bp,
		bp+8) == TCL_PATH_ABSOLUTE {
		if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(unsafe.Pointer(&XtclNativeFilesystem)) {
			return XTclpNativeSplitPath(tls, pathPtr, lenPtr)
		}
	} else {
		return XTclpNativeSplitPath(tls, pathPtr, lenPtr)
	}

	// We assume separators are single characters.

	if (*Tcl_Filesystem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FfilesystemSeparatorProc != uintptr(0) {
		var sep uintptr = (*struct {
			f func(*libc.TLS, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* fsPtr */)))).FfilesystemSeparatorProc})).f(tls, pathPtr)

		if sep != uintptr(0) {
			(*Tcl_Obj)(unsafe.Pointer(sep)).FrefCount++
			separator = *(*int8)(unsafe.Pointer(XTcl_GetString(tls, sep)))
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = sep
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
	}

	// Place the drive name as first element of the result list. The drive
	// name may contain strange characters, like colons and multiple forward
	// slashes (for example 'ftp://' is a valid vfs drive name)

	result = XTcl_NewObj(tls)
	p = XTcl_GetString(tls, pathPtr)
	XTcl_ListObjAppendElement(tls, uintptr(0), result,
		XTcl_NewStringObj(tls, p, *(*int32)(unsafe.Pointer(bp + 8 /* driveNameLength */))))
	p += uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* driveNameLength */)))

	// Add the remaining path elements to the list.

	for {
		var elementStart uintptr = p
		var length int32

		for int32(*(*int8)(unsafe.Pointer(p))) != 0 && int32(*(*int8)(unsafe.Pointer(p))) != int32(separator) {
			p++
		}
		length = int32((int64(p) - int64(elementStart)) / 1)
		if length > 0 {
			var nextElt uintptr

			if int32(*(*int8)(unsafe.Pointer(elementStart))) == '~' {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							nextElt = XTclThreadAllocObj(tls)
						} else {
							nextElt = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(nextElt + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(nextElt)).FrefCount = 0
					if int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0 {
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes, ts+30762, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(nextElt)).Fbytes + 2)) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer(nextElt)).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
					}
					(*Tcl_Obj)(unsafe.Pointer(nextElt)).FtypePtr = uintptr(0)
					{
					}
				}
				XTcl_AppendToObj(tls, nextElt, elementStart, length)
			} else {
				nextElt = XTcl_NewStringObj(tls, elementStart, length)
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), result, nextElt)
		}
		if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) == 0 {
			break
		}
	}

	// Compute the number of elements in the result.

	if lenPtr != uintptr(0) {
		if (*Tcl_Obj)(unsafe.Pointer(result)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			*(*int32)(unsafe.Pointer(lenPtr)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(result + 32)))).FelemCount
		} else {
			XTcl_ListObjLength(tls, uintptr(0), result, lenPtr)
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// TclGetPathType --
//
//	Helper function used by FSGetPathType.
//
// Results:
//	Returns one of TCL_PATH_ABSOLUTE, TCL_PATH_RELATIVE, or
//	TCL_PATH_VOLUME_RELATIVE. The filesystem reference will be set if and
//	only if it is non-NULL and the function's return value is
//	TCL_PATH_ABSOLUTE.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetPathType(tls *libc.TLS, pathPtr uintptr, filesystemPtrPtr uintptr, driveNameLengthPtr uintptr, driveNameRef uintptr) Tcl_PathType { /* tclIOUtil.c:4087:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var pathLen int32 at bp, 4

	var path uintptr = XTcl_GetStringFromObj(tls, pathPtr, bp)
	var type1 Tcl_PathType

	type1 = XTclFSNonnativePathType(tls, path, *(*int32)(unsafe.Pointer(bp /* pathLen */)), filesystemPtrPtr,
		driveNameLengthPtr, driveNameRef)

	if type1 != TCL_PATH_ABSOLUTE {
		type1 = XTclpGetNativePathType(tls, pathPtr, driveNameLengthPtr,
			driveNameRef)
		if type1 == TCL_PATH_ABSOLUTE && filesystemPtrPtr != uintptr(0) {
			*(*uintptr)(unsafe.Pointer(filesystemPtrPtr)) = uintptr(unsafe.Pointer(&XtclNativeFilesystem))
		}
	}
	return type1
}

//----------------------------------------------------------------------
//
// TclFSNonnativePathType --
//
//	Helper function used by TclGetPathType. Its purpose is to check
//	whether the given path starts with a string which corresponds to a
//	file volume in any registered filesystem except the native one. For
//	speed and historical reasons the native filesystem has special
//	hard-coded checks dotted here and there in the filesystem code.
//
// Results:
//	Returns one of TCL_PATH_ABSOLUTE or TCL_PATH_RELATIVE. The filesystem
//	reference will be set if and only if it is non-NULL and the function's
//	return value is TCL_PATH_ABSOLUTE.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFSNonnativePathType(tls *libc.TLS, path uintptr, pathLen int32, filesystemPtrPtr uintptr, driveNameLengthPtr uintptr, driveNameRef uintptr) Tcl_PathType { /* tclIOUtil.c:4142:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var fsRecPtr uintptr
	var type1 Tcl_PathType = TCL_PATH_RELATIVE

	// Call each of the "listVolumes" function in succession, checking whether
	// the given path is an absolute path on any of the volumes returned (this
	// is done by checking whether the path's prefix matches).

	fsRecPtr = sFsGetFirstFilesystem(tls)
	sClaim(tls)
	for fsRecPtr != uintptr(0) {
		// We want to skip the native filesystem in this loop because
		// otherwise we won't necessarily pass all the Tcl testsuite - this is
		// because some of the tests artificially change the current platform
		// (between win, unix) but the list of volumes we get by calling
		// fsRecPtr->fsPtr->listVolumesProc will reflect the current (real)
		// platform only and this may cause some tests to fail. In particular,
		// on Unix '/' will match the beginning of certain absolute Windows
		// paths starting '//' and those tests will go wrong.
		//
		// Besides these test-suite issues, there is one other reason to skip
		// the native filesystem - since the tclFilename.c code has nice fast
		// 'absolute path' checkers, we don't want to waste time repeating
		// that effort here, and this function is actually called quite often,
		// so if we can save the overhead of the native filesystem returning
		// us a list of volumes all the time, it is better.

		if (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr != uintptr(unsafe.Pointer(&XtclNativeFilesystem)) &&
			(*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FlistVolumesProc != uintptr(0) {
			// var numVolumes int32 at bp, 4

			var thisFsVolumes uintptr = (*struct{ f func(*libc.TLS) uintptr })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FlistVolumesProc})).f(tls)

			if thisFsVolumes != uintptr(0) {
				if XTcl_ListObjLength(tls, uintptr(0), thisFsVolumes, bp) !=
					TCL_OK {
					// This is VERY bad; the listVolumesProc didn't return a
					// valid list. Set numVolumes to -1 so that we skip the
					// while loop below and just return with the current value
					// of 'type'.
					//
					// It would be better if we could signal an error here
					// (but Tcl_Panic seems a bit excessive).

					*(*int32)(unsafe.Pointer(bp /* numVolumes */)) = -1
				}
				for *(*int32)(unsafe.Pointer(bp)) > 0 {
					// var vol uintptr at bp+8, 8

					// var len int32 at bp+16, 4

					var strVol uintptr

					*(*int32)(unsafe.Pointer(bp /* numVolumes */))--
					XTcl_ListObjIndex(tls, uintptr(0), thisFsVolumes, *(*int32)(unsafe.Pointer(bp /* numVolumes */)), bp+8)
					strVol = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* vol */)), bp+16)
					if pathLen < *(*int32)(unsafe.Pointer(bp + 16)) {
						continue
					}
					if libc.Xstrncmp(tls, strVol, path, uint64(*(*int32)(unsafe.Pointer(bp + 16)))) == 0 {
						type1 = TCL_PATH_ABSOLUTE
						if filesystemPtrPtr != uintptr(0) {
							*(*uintptr)(unsafe.Pointer(filesystemPtrPtr)) = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr
						}
						if driveNameLengthPtr != uintptr(0) {
							*(*int32)(unsafe.Pointer(driveNameLengthPtr)) = *(*int32)(unsafe.Pointer(bp + 16 /* len */))
						}
						if driveNameRef != uintptr(0) {
							*(*uintptr)(unsafe.Pointer(driveNameRef)) = *(*uintptr)(unsafe.Pointer(bp + 8 /* vol */))
							(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++
						}
						break
					}
				}
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = thisFsVolumes
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				if type1 == TCL_PATH_ABSOLUTE {
					// We don't need to examine any more filesystems.

					break
				}
			}
		}
		fsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr
	}
	sDisclaim(tls)
	return type1
}

//---------------------------------------------------------------------------
//
// Tcl_FSRenameFile --
//
//	If the two paths given belong to the same filesystem, we call that
//	filesystems rename function. Otherwise we simply return the POSIX
//	error 'EXDEV', and -1.
//
// Results:
//	Standard Tcl error code if a function was called.
//
// Side effects:
//	A file may be renamed.
//
//---------------------------------------------------------------------------

func XTcl_FSRenameFile(tls *libc.TLS, srcPathPtr uintptr, destPathPtr uintptr) int32 { /* tclIOUtil.c:4269:1: */
	var retVal int32 = -1
	var fsPtr uintptr
	var fsPtr2 uintptr

	fsPtr = XTcl_FSGetFileSystemForPath(tls, srcPathPtr)
	fsPtr2 = XTcl_FSGetFileSystemForPath(tls, destPathPtr)

	if fsPtr == fsPtr2 && fsPtr != uintptr(0) &&
		(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FrenameFileProc != uintptr(0) {
		retVal = (*struct {
			f func(*libc.TLS, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FrenameFileProc})).f(tls, srcPathPtr, destPathPtr)
	}
	if retVal == -1 {
		XTcl_SetErrno(tls, EXDEV)
	}
	return retVal
}

//---------------------------------------------------------------------------
//
// Tcl_FSCopyFile --
//
//	If the two paths given belong to the same filesystem, we call that
//	filesystem's copy function. Otherwise we simply return the POSIX error
//	'EXDEV', and -1.
//
//	Note that in the native filesystems, 'copyFileProc' is defined to copy
//	soft links (i.e. it copies the links themselves, not the things they
//	point to).
//
// Results:
//	Standard Tcl error code if a function was called.
//
// Side effects:
//	A file may be copied.
//
//---------------------------------------------------------------------------

func XTcl_FSCopyFile(tls *libc.TLS, srcPathPtr uintptr, destPathPtr uintptr) int32 { /* tclIOUtil.c:4314:1: */
	var retVal int32 = -1
	var fsPtr uintptr
	var fsPtr2 uintptr

	fsPtr = XTcl_FSGetFileSystemForPath(tls, srcPathPtr)
	fsPtr2 = XTcl_FSGetFileSystemForPath(tls, destPathPtr)

	if fsPtr == fsPtr2 && fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FcopyFileProc != uintptr(0) {
		retVal = (*struct {
			f func(*libc.TLS, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FcopyFileProc})).f(tls, srcPathPtr, destPathPtr)
	}
	if retVal == -1 {
		XTcl_SetErrno(tls, EXDEV)
	}
	return retVal
}

//---------------------------------------------------------------------------
//
// TclCrossFilesystemCopy --
//
//	Helper for above function, and for Tcl_FSLoadFile, to copy files from
//	one filesystem to another. This function will overwrite the target
//	file if it already exists.
//
// Results:
//	Standard Tcl error code.
//
// Side effects:
//	A file may be created.
//
//---------------------------------------------------------------------------

func XTclCrossFilesystemCopy(tls *libc.TLS, interp uintptr, source uintptr, target uintptr) int32 { /* tclIOUtil.c:4352:1: */
	bp := tls.Alloc(160)
	defer tls.Free(160)

	var result int32
	var prot int32
	var in Tcl_Channel
	var out Tcl_Channel
	// var sourceStatBuf Tcl_StatBuf at bp, 144

	// var tval Utimbuf at bp+144, 16
	result = TCL_ERROR
	prot = 0666

	out = XTcl_FSOpenFileChannel(tls, interp, target, ts+38350, prot)
	if !(out == uintptr(0)) {
		goto __1
	}
	// It looks like we cannot copy it over. Bail out...
	goto done
__1:
	;

	in = XTcl_FSOpenFileChannel(tls, interp, source, ts+38353, prot)
	if !(in == uintptr(0)) {
		goto __2
	}
	// This is very strange, caller should have checked this...

	XTcl_Close(tls, interp, out)
	goto done
__2:
	;

	// Copy it synchronously. We might wish to add an asynchronous option to
	// support vfs's which are slow (e.g. network sockets).

	if !(XTclCopyChannel(tls, interp, in, out, int64(-1), uintptr(0)) == TCL_OK) {
		goto __3
	}
	result = TCL_OK
__3:
	;

	// If the copy failed, assume that copy channel left a good error message.

	XTcl_Close(tls, interp, in)
	XTcl_Close(tls, interp, out)

	// Set modification date of copied file.

	if !(XTcl_FSLstat(tls, source, bp) == 0) {
		goto __4
	}
	(*Utimbuf)(unsafe.Pointer(bp + 144 /* &tval */)).Factime = XTcl_GetAccessTimeFromStat(tls, bp)
	(*Utimbuf)(unsafe.Pointer(bp + 144 /* &tval */)).Fmodtime = XTcl_GetModificationTimeFromStat(tls, bp)
	XTcl_FSUtime(tls, target, bp+144)
__4:
	;

done:
	return result
}

//---------------------------------------------------------------------------
//
// Tcl_FSDeleteFile --
//
//	The appropriate function for the filesystem to which pathPtr belongs
//	will be called.
//
// Results:
//	Standard Tcl error code.
//
// Side effects:
//	A file may be deleted.
//
//---------------------------------------------------------------------------

func XTcl_FSDeleteFile(tls *libc.TLS, pathPtr uintptr) int32 { /* tclIOUtil.c:4429:1: */
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FdeleteFileProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FdeleteFileProc})).f(tls, pathPtr)
	}
	XTcl_SetErrno(tls, ENOENT)
	return -1
}

//---------------------------------------------------------------------------
//
// Tcl_FSCreateDirectory --
//
//	The appropriate function for the filesystem to which pathPtr belongs
//	will be called.
//
// Results:
//	Standard Tcl error code.
//
// Side effects:
//	A directory may be created.
//
//---------------------------------------------------------------------------

func XTcl_FSCreateDirectory(tls *libc.TLS, pathPtr uintptr) int32 { /* tclIOUtil.c:4459:1: */
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FcreateDirectoryProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FcreateDirectoryProc})).f(tls, pathPtr)
	}
	XTcl_SetErrno(tls, ENOENT)
	return -1
}

//---------------------------------------------------------------------------
//
// Tcl_FSCopyDirectory --
//
//	If the two paths given belong to the same filesystem, we call that
//	filesystems copy-directory function. Otherwise we simply return the
//	POSIX error 'EXDEV', and -1.
//
// Results:
//	Standard Tcl error code if a function was called.
//
// Side effects:
//	A directory may be copied.
//
//---------------------------------------------------------------------------

func XTcl_FSCopyDirectory(tls *libc.TLS, srcPathPtr uintptr, destPathPtr uintptr, errorPtr uintptr) int32 { /* tclIOUtil.c:4490:1: */
	var retVal int32 = -1
	var fsPtr uintptr
	var fsPtr2 uintptr

	fsPtr = XTcl_FSGetFileSystemForPath(tls, srcPathPtr)
	fsPtr2 = XTcl_FSGetFileSystemForPath(tls, destPathPtr)

	if fsPtr == fsPtr2 && fsPtr != uintptr(0) && (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FcopyDirectoryProc != uintptr(0) {
		retVal = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FcopyDirectoryProc})).f(tls, srcPathPtr, destPathPtr, errorPtr)
	}
	if retVal == -1 {
		XTcl_SetErrno(tls, EXDEV)
	}
	return retVal
}

//---------------------------------------------------------------------------
//
// Tcl_FSRemoveDirectory --
//
//	The appropriate function for the filesystem to which pathPtr belongs
//	will be called.
//
// Results:
//	Standard Tcl error code.
//
// Side effects:
//	A directory may be deleted.
//
//---------------------------------------------------------------------------

func XTcl_FSRemoveDirectory(tls *libc.TLS, pathPtr uintptr, recursive int32, errorPtr uintptr) int32 { /* tclIOUtil.c:4531:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr == uintptr(0) || (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FremoveDirectoryProc == uintptr(0) {
		XTcl_SetErrno(tls, ENOENT)
		return -1
	}

	// When working recursively, we check whether the cwd lies inside this
	// directory and move it if it does.

	if recursive != 0 {
		var cwdPtr uintptr = XTcl_FSGetCwd(tls, uintptr(0))

		if cwdPtr != uintptr(0) {
			var cwdStr uintptr
			var normPathStr uintptr
			// var cwdLen int32 at bp+4, 4

			// var normLen int32 at bp, 4

			var normPath uintptr = XTcl_FSGetNormalizedPath(tls, uintptr(0), pathPtr)

			if normPath != uintptr(0) {
				normPathStr = XTcl_GetStringFromObj(tls, normPath, bp)
				cwdStr = XTcl_GetStringFromObj(tls, cwdPtr, bp+4)
				if *(*int32)(unsafe.Pointer(bp + 4)) >= *(*int32)(unsafe.Pointer(bp)) && libc.Xstrncmp(tls, normPathStr, cwdStr,
					Size_t(*(*int32)(unsafe.Pointer(bp)))) == 0 {
					// The cwd is inside the directory, so we perform a 'cd
					// [file dirname $path]'.

					var dirPtr uintptr = XTclPathPart(tls, uintptr(0), pathPtr,
						TCL_PATH_DIRNAME)

					XTcl_FSChdir(tls, dirPtr)
					for ok := true; ok; ok = 0 != 0 {
						var _objPtr uintptr = dirPtr
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
				}
			}
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr = cwdPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
	}
	return (*struct {
		f func(*libc.TLS, uintptr, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FremoveDirectoryProc})).f(tls, pathPtr, recursive, errorPtr)
}

//---------------------------------------------------------------------------
//
// Tcl_FSGetFileSystemForPath --
//
//	This function determines which filesystem to use for a particular path
//	object, and returns the filesystem which accepts this file. If no
//	filesystem will accept this object as a valid file path, then NULL is
//	returned.
//
// Results:
//	NULL or a filesystem which will accept this path.
//
// Side effects:
//	The object may be converted to a path type.
//
//---------------------------------------------------------------------------

func XTcl_FSGetFileSystemForPath(tls *libc.TLS, pathPtr uintptr) uintptr { /* tclIOUtil.c:4603:22: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var fsRecPtr uintptr
	*(*uintptr)(unsafe.Pointer(bp /* retVal */)) = uintptr(0)

	if pathPtr == uintptr(0) {
		XTcl_Panic(tls, ts+38356, 0)
		return uintptr(0)
	}

	// If the object has a refCount of zero, we reject it. This is to avoid
	// possible segfaults or nondeterministic memory leaks (i.e. the user
	// doesn't know if they should decrement the ref count on return or not).

	if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount == 0 {
		XTcl_Panic(tls, ts+38407, 0)
		return uintptr(0)
	}

	// Check if the filesystem has changed in some way since this object's
	// internal representation was calculated. Before doing that, assure we
	// have the most up-to-date copy of the first filesystem. This is
	// accomplished by the FsGetFirstFilesystem() call.

	fsRecPtr = sFsGetFirstFilesystem(tls)
	sClaim(tls)

	if XTclFSEnsureEpochOk(tls, pathPtr, bp) != TCL_OK {
		sDisclaim(tls)
		return uintptr(0)
	} else if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
		// TODO: Can this happen?
		sDisclaim(tls)
		return *(*uintptr)(unsafe.Pointer(bp /* retVal */))
	}

	// Call each of the "pathInFilesystem" functions in succession. A
	// non-return value of -1 indicates the particular function has succeeded.

	for ; fsRecPtr != uintptr(0); fsRecPtr = (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FnextPtr {
		*(*ClientData)(unsafe.Pointer(bp + 8 /* clientData */)) = uintptr(0)

		if (*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FpathInFilesystemProc == uintptr(0) {
			continue
		}

		if (*struct {
			f func(*libc.TLS, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer((*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr)).FpathInFilesystemProc})).f(tls, pathPtr, bp+8) != -1 {

			XTclFSSetPathDetails(tls, pathPtr, (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr, *(*ClientData)(unsafe.Pointer(bp + 8 /* clientData */)))
			sDisclaim(tls)
			return (*FilesystemRecord)(unsafe.Pointer(fsRecPtr)).FfsPtr
		}
	}
	sDisclaim(tls)

	return uintptr(0)
}

//---------------------------------------------------------------------------
//
// Tcl_FSGetNativePath --
//
//	This function is for use by the Win/Unix native filesystems, so that
//	they can easily retrieve the native (char* or WCHAR*) representation
//	of a path. Other filesystems will probably want to implement similar
//	functions. They basically act as a safety net around
//	Tcl_FSGetInternalRep. Normally your file-system functions will always
//	be called with path objects already converted to the correct
//	filesystem, but if for some reason they are called directly (i.e. by
//	functions not in this file), then one cannot necessarily guarantee
//	that the path object pointer is from the correct filesystem.
//
//	Note: in the future it might be desirable to have separate versions
//	of this function with different signatures, for example
//	Tcl_FSGetNativeWinPath, Tcl_FSGetNativeUnixPath etc. Right now, since
//	native paths are all string based, we use just one function.
//
// Results:
//	NULL or a valid native path.
//
// Side effects:
//	See Tcl_FSGetInternalRep.
//
//---------------------------------------------------------------------------

func XTcl_FSGetNativePath(tls *libc.TLS, pathPtr uintptr) uintptr { /* tclIOUtil.c:4702:12: */
	return XTcl_FSGetInternalRep(tls, pathPtr, uintptr(unsafe.Pointer(&XtclNativeFilesystem)))
}

//---------------------------------------------------------------------------
//
// NativeFreeInternalRep --
//
//	Free a native internal representation, which will be non-NULL.
//
// Results:
//	None.
//
// Side effects:
//	Memory is released.
//
//---------------------------------------------------------------------------

func sNativeFreeInternalRep(tls *libc.TLS, clientData ClientData) { /* tclIOUtil.c:4726:1: */
	XTclpFree(tls, clientData)
}

//---------------------------------------------------------------------------
//
// Tcl_FSFileSystemInfo --
//
//	This function returns a list of two elements. The first element is the
//	name of the filesystem (e.g. "native" or "vfs"), and the second is the
//	particular type of the given path within that filesystem.
//
// Results:
//	A list of two elements.
//
// Side effects:
//	The object may be converted to a path type.
//
//---------------------------------------------------------------------------

func XTcl_FSFileSystemInfo(tls *libc.TLS, pathPtr uintptr) uintptr { /* tclIOUtil.c:4750:9: */
	var resPtr uintptr
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

	if fsPtr == uintptr(0) {
		return uintptr(0)
	}

	resPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	XTcl_ListObjAppendElement(tls, uintptr(0), resPtr,
		XTcl_NewStringObj(tls, (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FtypeName, -1))

	if (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfilesystemPathTypeProc != uintptr(0) {
		var typePtr uintptr = (*struct {
			f func(*libc.TLS, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfilesystemPathTypeProc})).f(tls, pathPtr)

		if typePtr != uintptr(0) {
			XTcl_ListObjAppendElement(tls, uintptr(0), resPtr, typePtr)
		}
	}

	return resPtr
}

//---------------------------------------------------------------------------
//
// Tcl_FSPathSeparator --
//
//	This function returns the separator to be used for a given path. The
//	object returned should have a refCount of zero
//
// Results:
//	A Tcl object, with a refCount of zero. If the caller needs to retain a
//	reference to the object, it should call Tcl_IncrRefCount, and should
//	otherwise free the object.
//
// Side effects:
//	The path object may be converted to a path type.
//
//---------------------------------------------------------------------------

func XTcl_FSPathSeparator(tls *libc.TLS, pathPtr uintptr) uintptr { /* tclIOUtil.c:4795:9: */
	var fsPtr uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)
	var resultObj uintptr

	if fsPtr == uintptr(0) {
		return uintptr(0)
	}

	if (*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfilesystemSeparatorProc != uintptr(0) {
		return (*struct {
			f func(*libc.TLS, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fsPtr)).FfilesystemSeparatorProc})).f(tls, pathPtr)
	}

	// Allow filesystems not to provide a filesystemSeparatorProc if they wish
	// to use the standard forward slash.

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				resultObj = XTclThreadAllocObj(tls)
			} else {
				resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes, ts+5792, uint64(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes + 1)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = int32(uint64(unsafe.Sizeof([2]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)
		{
		}
	}
	return resultObj
}

//---------------------------------------------------------------------------
//
// NativeFilesystemSeparator --
//
//	This function is part of the native filesystem support, and returns
//	the separator for the given path.
//
// Results:
//	String object containing the separator character.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sNativeFilesystemSeparator(tls *libc.TLS, pathPtr uintptr) uintptr { /* tclIOUtil.c:4836:16: */
	var separator uintptr = uintptr(0) // lint

	switch XtclPlatform {
	case TCL_PLATFORM_UNIX:
		separator = ts + 5792 /* "/" */
		break
	case TCL_PLATFORM_WINDOWS:
		separator = ts + 12746 /* "\\" */
		break
	}
	return XTcl_NewStringObj(tls, separator, 1)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The structure below defines the index Tcl object type by means of functions
// that can be invoked by generic object code.

var indexType = Tcl_ObjType{
	Fname:             ts + 16630,
	FfreeIntRepProc:   0, // freeIntRepProc
	FdupIntRepProc:    0, // dupIntRepProc
	FupdateStringProc: 0, // setFromAnyProc
} /* tclIndexObj.c:45:26 */

// The definition of the internal representation of the "index" object; The
// internalRep.twoPtrValue.ptr1 field of an object of "index" type will be a
// pointer to one of these structures.
//
// Keep this structure declaration in sync with tclTestObj.c

type IndexRep = struct {
	FtablePtr uintptr
	Foffset   int32
	Findex    int32
} /* tclIndexObj.c:65:3 */

// The following macros greatly simplify moving through a table...

//----------------------------------------------------------------------
//
// Tcl_GetIndexFromObj --
//
//	This function looks up an object's value in a table of strings and
//	returns the index of the matching string, if any.
//
// Results:
//	If the value of objPtr is identical to or a unique abbreviation for
//	one of the entries in tablePtr, then the return value is TCL_OK and the
//	index of the matching entry is stored at *indexPtr. If there isn't a
//	proper match, then TCL_ERROR is returned and an error message is left
//	in interp's result (unless interp is NULL). The msg argument is used
//	in the error message; for example, if msg has the value "option" then
//	the error message will say something flag 'bad option "foo": must be
//	...'
//
// Side effects:
//	The result of the lookup is cached as the internal rep of objPtr, so
//	that repeated lookups can be done quickly.
//
//----------------------------------------------------------------------

func XTcl_GetIndexFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, tablePtr uintptr, msg uintptr, flags int32, indexPtr uintptr) int32 { /* tclIndexObj.c:105:1: */

	// See if there is a valid cached result from a previous lookup (doing the
	// check here saves the overhead of calling Tcl_GetIndexFromObjStruct in
	// the common case where the result is cached).

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&indexType)) {
		var indexRep uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

		// Here's hoping we don't get hit by unfortunate packing constraints
		// on odd platforms like a Cray PVP...

		if (*IndexRep)(unsafe.Pointer(indexRep)).FtablePtr == tablePtr &&
			uint64((*IndexRep)(unsafe.Pointer(indexRep)).Foffset) == uint64(unsafe.Sizeof(uintptr(0))) {
			*(*int32)(unsafe.Pointer(indexPtr)) = (*IndexRep)(unsafe.Pointer(indexRep)).Findex
			return TCL_OK
		}
	}
	return XTcl_GetIndexFromObjStruct(tls, interp, objPtr, tablePtr, int32(unsafe.Sizeof(uintptr(0))),
		msg, flags, indexPtr)
}

//----------------------------------------------------------------------
//
// GetIndexFromObjList --
//
//	This procedure looks up an object's value in a table of strings and
//	returns the index of the matching string, if any.
//
// Results:
//	If the value of objPtr is identical to or a unique abbreviation for
//	one of the entries in tableObjPtr, then the return value is TCL_OK and
//	the index of the matching entry is stored at *indexPtr. If there isn't
//	a proper match, then TCL_ERROR is returned and an error message is
//	left in interp's result (unless interp is NULL). The msg argument is
//	used in the error message; for example, if msg has the value "option"
//	then the error message will say something flag 'bad option "foo": must
//	be ...'
//
// Side effects:
//	Removes any internal representation that the object might have. (TODO:
//	find a way to cache the lookup.)
//
//----------------------------------------------------------------------

func XGetIndexFromObjList(tls *libc.TLS, interp uintptr, objPtr uintptr, tableObjPtr uintptr, msg uintptr, flags int32, indexPtr uintptr) int32 { /* tclIndexObj.c:167:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var objc int32 at bp, 4

	var result int32
	var t int32
	// var objv uintptr at bp+8, 8

	var tablePtr uintptr

	// Use Tcl_GetIndexFromObjStruct to do the work to avoid duplicating most
	// of the code there. This is a bit ineffiecient but simpler.

	result = XTcl_ListObjGetElements(tls, interp, tableObjPtr, bp, bp+8)
	if result != TCL_OK {
		return result
	}

	// Build a string table from the list.

	tablePtr = XTcl_Alloc(tls, uint32(uint64(*(*int32)(unsafe.Pointer(bp))+1)*uint64(unsafe.Sizeof(uintptr(0)))))
	for t = 0; t < *(*int32)(unsafe.Pointer(bp /* objc */)); t++ {
		if *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(t)*8)) == objPtr {
			// An exact match is always chosen, so we can stop here.

			XTclpFree(tls, tablePtr)
			*(*int32)(unsafe.Pointer(indexPtr)) = t
			return TCL_OK
		}

		*(*uintptr)(unsafe.Pointer(tablePtr + uintptr(t)*8)) = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* objv */)) + uintptr(t)*8)))
	}
	*(*uintptr)(unsafe.Pointer(tablePtr + uintptr(*(*int32)(unsafe.Pointer(bp /* objc */)))*8)) = uintptr(0)

	result = XTcl_GetIndexFromObjStruct(tls, interp, objPtr, tablePtr,
		int32(unsafe.Sizeof(uintptr(0))), msg, flags, indexPtr)

	// The internal rep must be cleared since tablePtr will go away.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	}

	XTclpFree(tls, tablePtr)

	return result
}

//----------------------------------------------------------------------
//
// Tcl_GetIndexFromObjStruct --
//
//	This function looks up an object's value given a starting string and
//	an offset for the amount of space between strings. This is useful when
//	the strings are embedded in some other kind of array.
//
// Results:
//	If the value of objPtr is identical to or a unique abbreviation for
//	one of the entries in tablePtr, then the return value is TCL_OK and
//	the index of the matching entry is stored at *indexPtr. If there isn't
//	a proper match, then TCL_ERROR is returned and an error message is
//	left in interp's result (unless interp is NULL). The msg argument is
//	used in the error message; for example, if msg has the value "option"
//	then the error message will say something like 'bad option "foo": must
//	be ...'
//
// Side effects:
//	The result of the lookup is cached as the internal rep of objPtr, so
//	that repeated lookups can be done quickly.
//
//----------------------------------------------------------------------

func XTcl_GetIndexFromObjStruct(tls *libc.TLS, interp uintptr, objPtr uintptr, tablePtr uintptr, offset int32, msg uintptr, flags int32, indexPtr uintptr) int32 { /* tclIndexObj.c:252:1: */
	bp := tls.Alloc(184)
	defer tls.Free(184)

	var index int32
	var idx int32
	var numAbbrev int32
	var key uintptr
	var p1 uintptr
	var p2 uintptr
	var entryPtr uintptr
	var resultPtr uintptr
	var indexRep uintptr
	var cachePtr uintptr
	// Produce a fancy error message.

	var count int32

	// Protect against invalid values, like -1 or 0.
	if !(offset < int32(unsafe.Sizeof(uintptr(0)))) {
		goto __1
	}
	offset = int32(unsafe.Sizeof(uintptr(0)))
__1:
	;
	// See if there is a valid cached result from a previous lookup.

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&indexType))) {
		goto __2
	}
	indexRep = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	if !((*IndexRep)(unsafe.Pointer(indexRep)).FtablePtr == tablePtr && (*IndexRep)(unsafe.Pointer(indexRep)).Foffset == offset) {
		goto __3
	}
	*(*int32)(unsafe.Pointer(indexPtr)) = (*IndexRep)(unsafe.Pointer(indexRep)).Findex
	return TCL_OK
__3:
	;
__2:
	;

	// Lookup the value of the object in the table. Accept unique
	// abbreviations unless TCL_EXACT is set in flags.

	key = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()
	index = -1
	numAbbrev = 0

	// Scan the table looking for one of:
	//  - An exact match (always preferred)
	//  - A single abbreviation (allowed depending on flags)
	//  - Several abbreviations (never allowed, but overridden by exact match)

	entryPtr = tablePtr
	idx = 0
__4:
	if !(*(*uintptr)(unsafe.Pointer(entryPtr)) != uintptr(0)) {
		goto __6
	}
	p1 = key
	p2 = *(*uintptr)(unsafe.Pointer(entryPtr))
__7:
	if !(int32(*(*int8)(unsafe.Pointer(p1))) == int32(*(*int8)(unsafe.Pointer(p2)))) {
		goto __9
	}
	if !(int32(*(*int8)(unsafe.Pointer(p1))) == 0) {
		goto __10
	}
	index = idx
	goto done
__10:
	;
	goto __8
__8:
	p1++
	p2++
	goto __7
	goto __9
__9:
	;
	if !(int32(*(*int8)(unsafe.Pointer(p1))) == 0) {
		goto __11
	}
	// The value is an abbreviation for this entry. Continue checking
	// other entries to make sure it's unique. If we get more than one
	// unique abbreviation, keep searching to see if there is an exact
	// match, but remember the number of unique abbreviations and
	// don't allow either.

	numAbbrev++
	index = idx
__11:
	;
	goto __5
__5:
	entryPtr = entryPtr + uintptr(offset)
	idx++
	goto __4
	goto __6
__6:
	;

	// Check if we were instructed to disallow abbreviations.

	if !(flags&TCL_EXACT != 0 || int32(*(*int8)(unsafe.Pointer(key))) == 0 || numAbbrev != 1) {
		goto __12
	}
	goto error
__12:
	;

done:
	// Cache the found representation. Note that we want to avoid allocating a
	// new internal-rep if at all possible since that is potentially a slow
	// operation.

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&indexType))) {
		goto __13
	}
	indexRep = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	goto __14
__13:
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __15
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __16
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__16:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__15:
	;

	indexRep = XTcl_Alloc(tls, uint32(unsafe.Sizeof(IndexRep{})))
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = indexRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&indexType))
__14:
	;
	(*IndexRep)(unsafe.Pointer(indexRep)).FtablePtr = tablePtr
	(*IndexRep)(unsafe.Pointer(indexRep)).Foffset = offset
	(*IndexRep)(unsafe.Pointer(indexRep)).Findex = index

	*(*int32)(unsafe.Pointer(indexPtr)) = index
	return TCL_OK

error:
	if !(interp != uintptr(0)) {
		goto __17
	}
	// Produce a fancy error message.

	count = 0

__18:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __21
	}
	resultPtr = XTclThreadAllocObj(tls)
	goto __22
__21:
	resultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__22:
	;
	goto __19
__19:
	if 0 != 0 {
		goto __18
	}
	goto __20
__20:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = uintptr(0)

	entryPtr = tablePtr
__23:
	if !(*(*uintptr)(unsafe.Pointer(entryPtr)) != uintptr(0) && !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(entryPtr))))) != 0)) {
		goto __24
	}
	entryPtr = entryPtr + uintptr(offset)
	goto __23
__24:
	;
	XTcl_AppendStringsToObj(tls, resultPtr,
		libc.VaList(bp, func() uintptr {
			if numAbbrev > 1 && !(flags&TCL_EXACT != 0) {
				return ts + 38472 /* "ambiguous " */
			}
			return ts + 38483 /* "bad " */
		}(),
			msg, ts+38488, key, uintptr(0)))
	if !(*(*uintptr)(unsafe.Pointer(entryPtr)) == uintptr(0)) {
		goto __25
	}
	XTcl_AppendStringsToObj(tls, resultPtr, libc.VaList(bp+40, ts+38491, uintptr(0)))
	goto __26
__25:
	XTcl_AppendStringsToObj(tls, resultPtr, libc.VaList(bp+56, ts+38511,
		*(*uintptr)(unsafe.Pointer(entryPtr)), uintptr(0)))
	entryPtr = entryPtr + uintptr(offset)
__27:
	if !(*(*uintptr)(unsafe.Pointer(entryPtr)) != uintptr(0)) {
		goto __28
	}
	if !(*(*uintptr)(unsafe.Pointer(entryPtr + uintptr(offset))) == uintptr(0)) {
		goto __29
	}
	XTcl_AppendStringsToObj(tls, resultPtr, libc.VaList(bp+80, func() uintptr {
		if count > 0 {
			return ts + 18589 /* "," */
		}
		return ts + 2046 /* "" */
	}(),
		ts+38523, *(*uintptr)(unsafe.Pointer(entryPtr)), uintptr(0)))
	goto __30
__29:
	if !(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(entryPtr)))) != 0) {
		goto __31
	}
	XTcl_AppendStringsToObj(tls, resultPtr, libc.VaList(bp+112, ts+18549, *(*uintptr)(unsafe.Pointer(entryPtr)), uintptr(0)))
	count++
__31:
	;
__30:
	;
	entryPtr = entryPtr + uintptr(offset)
	goto __27
__28:
	;
__26:
	;
	XTcl_SetObjResult(tls, interp, resultPtr)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+136, ts+3593, ts+7170, ts+16210, msg, key, uintptr(0)))
__17:
	;
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// UpdateStringOfIndex --
//
//	This function is called to convert a Tcl object from index internal
//	form to its string form. No abbreviation is ever generated.
//
// Results:
//	None.
//
// Side effects:
//	The string representation of the object is updated.
//
//----------------------------------------------------------------------

func sUpdateStringOfIndex(tls *libc.TLS, objPtr uintptr) { /* tclIndexObj.c:414:1: */
	var indexRep uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	var buf uintptr
	var len uint32
	var indexStr uintptr = *(*uintptr)(unsafe.Pointer((*IndexRep)(unsafe.Pointer(indexRep)).FtablePtr + uintptr((*IndexRep)(unsafe.Pointer(indexRep)).Foffset*(*IndexRep)(unsafe.Pointer(indexRep)).Findex)))

	len = uint32(libc.Xstrlen(tls, indexStr))
	buf = XTcl_Alloc(tls, len+uint32(1))
	libc.Xmemcpy(tls, buf, indexStr, uint64(len+uint32(1)))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = buf
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = int32(len)
}

//----------------------------------------------------------------------
//
// DupIndex --
//
//	This function is called to copy the internal rep of an index Tcl
//	object from to another object.
//
// Results:
//	None.
//
// Side effects:
//	The internal representation of the target object is updated and the
//	type is set.
//
//----------------------------------------------------------------------

func sDupIndex(tls *libc.TLS, srcPtr uintptr, dupPtr uintptr) { /* tclIndexObj.c:448:1: */
	var srcIndexRep uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))
	var dupIndexRep uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(IndexRep{})))

	libc.Xmemcpy(tls, dupIndexRep, srcIndexRep, uint64(unsafe.Sizeof(IndexRep{})))
	*(*uintptr)(unsafe.Pointer(dupPtr + 32)) = dupIndexRep
	(*Tcl_Obj)(unsafe.Pointer(dupPtr)).FtypePtr = uintptr(unsafe.Pointer(&indexType))
}

//----------------------------------------------------------------------
//
// FreeIndex --
//
//	This function is called to delete the internal rep of an index Tcl
//	object.
//
// Results:
//	None.
//
// Side effects:
//	The internal representation of the target object is deleted.
//
//----------------------------------------------------------------------

func sFreeIndex(tls *libc.TLS, objPtr uintptr) { /* tclIndexObj.c:478:1: */
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(objPtr + 32)))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// TclInitPrefixCmd --
//
//	This procedure creates the "prefix" Tcl command. See the user
//	documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTclInitPrefixCmd(tls *libc.TLS, interp uintptr) Tcl_Command { /* tclIndexObj.c:503:1: */
	var prefixCmd Tcl_Command

	prefixCmd = XTclMakeEnsemble(tls, interp, ts+38528, uintptr(unsafe.Pointer(&prefixImplMap)))
	XTcl_Export(tls, interp, XTcl_FindNamespace(tls, interp, ts+20875, uintptr(0), 0),
		ts+38542, 0)
	return prefixCmd
}

var prefixImplMap = [4]EnsembleImplMap{
	{Fname: ts + 38549, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 38553, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16655, Fproc: 0, FcompileProc: 0},
	{},
} /* tclIndexObj.c:506:34 */

// ----------------------------------------------------------------------
//
// PrefixMatchObjCmd --
//
//	This function implements the 'prefix match' Tcl command. Refer to the
//	user documentation for details on what it does.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPrefixMatchObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIndexObj.c:537:1: */
	bp := tls.Alloc(120)
	defer tls.Free(120)

	var flags int32 = 0
	var result int32
	// var index int32 at bp+96, 4

	// var dummyLength int32 at bp+104, 4

	var i int32
	// var errorLength int32 at bp+100, 4

	var errorPtr uintptr = uintptr(0)
	var message uintptr = ts + 9944 /* "option" */
	var tablePtr uintptr
	var objPtr uintptr
	// var resultPtr uintptr at bp+112, 8

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+38561)
		return TCL_ERROR
	}

	for i = 1; i < objc-2; i++ {
		if XTcl_GetIndexFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&matchOptions)), ts+9944, 0,
			bp+96) != TCL_OK {
			return TCL_ERROR
		}
		switch uint32(*(*int32)(unsafe.Pointer(bp + 96 /* index */))) {
		case uint32(1) /* PRFMATCH_EXACT */ :
			flags = flags | TCL_EXACT
			break
		case uint32(2) /* PRFMATCH_MESSAGE */ :
			if i > objc-4 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+38584, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+38611, uintptr(0)))
				return TCL_ERROR
			}
			i++
			message = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
			break
		case uint32(0) /* PRFMATCH_ERROR */ :
			if i > objc-4 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+38617, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+7420, ts+38611, uintptr(0)))
				return TCL_ERROR
			}
			i++
			result = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+100)
			if result != TCL_OK {
				return TCL_ERROR
			}
			if *(*int32)(unsafe.Pointer(bp + 100))%2 != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+38642,
					-1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+6915, ts+23220, uintptr(0)))
				return TCL_ERROR
			}
			errorPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
			break
		}
	}

	tablePtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-2)*8))
	objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))

	// Check that table is a valid list first, since we want to handle that
	// error case regardless of level.

	result = XTcl_ListObjLength(tls, interp, tablePtr, bp+104)
	if result != TCL_OK {
		return result
	}

	result = XGetIndexFromObjList(tls, interp, objPtr, tablePtr, message, flags,
		bp+96)
	if result != TCL_OK {
		if errorPtr != uintptr(0) && *(*int32)(unsafe.Pointer(bp + 100)) == 0 {
			XTcl_ResetResult(tls, interp)
			return TCL_OK
		} else if errorPtr == uintptr(0) {
			return TCL_ERROR
		}

		if (*Tcl_Obj)(unsafe.Pointer(errorPtr)).FrefCount > 1 {
			errorPtr = XTcl_DuplicateObj(tls, errorPtr)
		}
		XTcl_ListObjAppendElement(tls, interp, errorPtr,
			XTcl_NewStringObj(tls, ts+27354, 5))
		XTcl_ListObjAppendElement(tls, interp, errorPtr, XTcl_NewIntObj(tls, result))

		return XTcl_SetReturnOptions(tls, interp, errorPtr)
	}

	result = XTcl_ListObjIndex(tls, interp, tablePtr, *(*int32)(unsafe.Pointer(bp + 96 /* index */)), bp+112)
	if result != TCL_OK {
		return result
	}
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 112 /* resultPtr */)))
	return TCL_OK
}

var matchOptions = [4]uintptr{
	ts + 38693, ts + 14906, ts + 38700, uintptr(0),
} /* tclIndexObj.c:548:23 */

// ----------------------------------------------------------------------
//
// PrefixAllObjCmd --
//
//	This function implements the 'prefix all' Tcl command. Refer to the
//	user documentation for details on what it does.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPrefixAllObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIndexObj.c:661:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var tableObjc int32 at bp, 4

	var result int32
	var t int32
	// var length int32 at bp+16, 4

	// var elemLength int32 at bp+20, 4

	var string uintptr
	var elemString uintptr
	// var tableObjv uintptr at bp+8, 8

	var resultPtr uintptr

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+38709)
		return TCL_ERROR
	}

	result = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, bp+8)
	if result != TCL_OK {
		return result
	}
	resultPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	string = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+16)

	for t = 0; t < *(*int32)(unsafe.Pointer(bp /* tableObjc */)); t++ {
		elemString = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* tableObjv */)) + uintptr(t)*8)), bp+20 /* &elemLength */)

		// A prefix cannot match if it is longest.

		if *(*int32)(unsafe.Pointer(bp + 16)) <= *(*int32)(unsafe.Pointer(bp + 20)) {
			if XTclpUtfNcmp2(tls, elemString, string, uint64(*(*int32)(unsafe.Pointer(bp + 16)))) == 0 {
				XTcl_ListObjAppendElement(tls, interp, resultPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* tableObjv */)) + uintptr(t)*8)))
			}
		}
	}

	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// PrefixLongestObjCmd --
//
//	This function implements the 'prefix longest' Tcl command. Refer to
//	the user documentation for details on what it does.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPrefixLongestObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclIndexObj.c:718:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var tableObjc int32 at bp, 4

	var result int32
	var i int32
	var t int32
	// var length int32 at bp+16, 4

	// var elemLength int32 at bp+20, 4

	var resultLength int32
	var string uintptr
	var elemString uintptr
	var resultString uintptr
	// var tableObjv uintptr at bp+8, 8

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+38709)
		return TCL_ERROR
	}

	result = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, bp+8)
	if result != TCL_OK {
		return result
	}
	string = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+16)

	resultString = uintptr(0)
	resultLength = 0

	for t = 0; t < *(*int32)(unsafe.Pointer(bp /* tableObjc */)); t++ {
		elemString = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* tableObjv */)) + uintptr(t)*8)), bp+20 /* &elemLength */)

		// First check if the prefix string matches the element. A prefix
		// cannot match if it is longest.

		if *(*int32)(unsafe.Pointer(bp + 16)) > *(*int32)(unsafe.Pointer(bp + 20)) || XTclpUtfNcmp2(tls, elemString, string, uint64(*(*int32)(unsafe.Pointer(bp + 16)))) != 0 {
			continue
		}

		if resultString == uintptr(0) {
			// If this is the first match, the longest common substring this
			// far is the complete string. The result is part of this string
			// so we only need to adjust the length later.

			resultString = elemString
			resultLength = *(*int32)(unsafe.Pointer(bp + 20 /* elemLength */))
		} else {
			// Longest common substring cannot be longer than shortest string.

			if *(*int32)(unsafe.Pointer(bp + 20)) < resultLength {
				resultLength = *(*int32)(unsafe.Pointer(bp + 20 /* elemLength */))
			}

			// Compare strings.

			for i = 0; i < resultLength; i++ {
				if int32(*(*int8)(unsafe.Pointer(resultString + uintptr(i)))) != int32(*(*int8)(unsafe.Pointer(elemString + uintptr(i)))) {
					// Adjust in case we stopped in the middle of a UTF char.

					resultLength = int32((func() int64 {
						if resultString+uintptr(i+1) < resultString+uintptr(2) {
							return int64(resultString)
						}
						return func() int64 {
							if int32(uint8(*(*int8)(unsafe.Pointer(resultString + uintptr(i+1) - uintptr(1))))) < 0x80 {
								return int64(resultString + uintptr(i+1) - uintptr(1))
							}
							return int64(XTcl_UtfPrev(tls, resultString+uintptr(i+1), resultString))
						}()
					}() - int64(resultString)) / 1)
					break
				}
			}
		}
	}
	if resultLength > 0 {
		XTcl_SetObjResult(tls, interp,
			XTcl_NewStringObj(tls, resultString, resultLength))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_WrongNumArgs --
//
//	This function generates a "wrong # args" error message in an
//	interpreter. It is used as a utility function by many command
//	functions, including the function that implements procedures.
//
// Results:
//	None.
//
// Side effects:
//	An error message is generated in interp's result object to indicate
//	that a command was invoked with the wrong number of arguments. The
//	message has the form
//		wrong # args: should be "foo bar additional stuff"
//	where "foo" and "bar" are the initial objects in objv (objc determines
//	how many of these are printed) and "additional stuff" is the contents
//	of the message argument.
//
//	The message printed is modified somewhat if the command is wrapped
//	inside an ensemble. In that case, the error message generated is
//	rewritten in such a way that it appears to be generated from the
//	user-visible command and not how that command is actually implemented,
//	giving a better overall user experience.
//
//	Internally, the Tcl core may set the flag INTERP_ALTERNATE_WRONG_ARGS
//	in the interpreter to generate complex multi-part messages by calling
//	this function repeatedly. This allows the code that knows how to
//	handle ensemble-related error messages to be kept here while still
//	generating suitable error messages for commands like [read] and
//	[socket]. Ideally, this would be done through an extra flags argument,
//	but that wouldn't be source-compatible with the existing API and it's
//	a fairly rare requirement anyway.
//
//----------------------------------------------------------------------

func XTcl_WrongNumArgs(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, message uintptr) { /* tclIndexObj.c:837:1: */
	bp := tls.Alloc(109)
	defer tls.Free(109)

	var objPtr uintptr
	var i int32
	var len int32
	// var elemLen int32 at bp+104, 4

	// var flags int8 at bp+108, 1

	var iPtr uintptr
	var elementStr uintptr

	// [incr Tcl] does something fairly horrific when generating error
	// messages for its ensembles; it passes the whole set of ensemble
	// arguments as a list in the first argument. This means that this code
	// causes a problem in iTcl if it attempts to correctly quote all
	// arguments, which would be the correct thing to do. We work around this
	// nasty behaviour for now, and hope that we can remove it all in the
	// future...

	var isFirst int32
	var cachePtr uintptr
	var indexRep uintptr
	var quotedElementStr uintptr
	var toSkip int32
	var toPrint int32
	var origObjv uintptr
	var indexRep1 uintptr
	var quotedElementStr1 uintptr
	iPtr = interp
	isFirst = 1 // Special flag used to inhibit the treating
	// of the first word as a list element so the
	// hacky way Itcl generates error messages for
	// its ensembles will still work. [Bug
	// 1066837]

__1:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __4
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __5
__4:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__5:
	;
	goto __2
__2:
	if 0 != 0 {
		goto __1
	}
	goto __3
__3:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)

	if !((*Interp)(unsafe.Pointer(iPtr)).Fflags&INTERP_ALTERNATE_WRONG_ARGS != 0) {
		goto __6
	}
	*(*int32)(unsafe.Pointer(iPtr + 424)) &= libc.CplInt32(INTERP_ALTERNATE_WRONG_ARGS)
	XTcl_AppendObjToObj(tls, objPtr, XTcl_GetObjResult(tls, interp))
	XTcl_AppendToObj(tls, objPtr, ts+38722, -1)
	goto __7
__6:
	XTcl_AppendToObj(tls, objPtr, ts+38728, -1)
__7:
	;

	// If processing an an ensemble implementation, rewrite the results in
	// terms of how the ensemble was invoked.

	if !((*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs != uintptr(0)) {
		goto __8
	}
	toSkip = (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs
	toPrint = (*Interp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs
	origObjv = XTclEnsembleGetRewriteValues(tls, interp)

	// Only do rewrite the command if all the replaced objects are
	// actually arguments (in objv) to this function. Otherwise it just
	// gets too complicated and it's to just give a slightly
	// confusing error message...

	if !(objc < toSkip) {
		goto __9
	}
	goto addNormalArgumentsToMessage
__9:
	;

	// Strip out the actual arguments that the ensemble inserted.

	objv += 8 * uintptr(toSkip)
	objc = objc - toSkip

	// We assume no object is of index type.

	i = 0
__10:
	if !(i < toPrint) {
		goto __12
	}
	// Add the element, quoting it if necessary.

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(origObjv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&indexType))) {
		goto __13
	}
	indexRep =
		*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(origObjv + uintptr(i)*8)) + 32))

	elementStr = *(*uintptr)(unsafe.Pointer((*IndexRep)(unsafe.Pointer(indexRep)).FtablePtr + uintptr((*IndexRep)(unsafe.Pointer(indexRep)).Foffset*(*IndexRep)(unsafe.Pointer(indexRep)).Findex)))
	*(*int32)(unsafe.Pointer(bp + 104 /* elemLen */)) = int32(libc.Xstrlen(tls, elementStr))
	goto __14
__13:
	elementStr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(origObjv + uintptr(i)*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 104)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(origObjv + uintptr(i)*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(origObjv + uintptr(i)*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(origObjv + uintptr(i)*8)), bp+104)
	}()
__14:
	;
	*(*int8)(unsafe.Pointer(bp + 108 /* flags */)) = int8(0)
	len = XTclScanElement(tls, elementStr, *(*int32)(unsafe.Pointer(bp + 104 /* elemLen */)), bp+108)

	if !(!(isFirst != 0) && len != *(*int32)(unsafe.Pointer(bp + 104))) {
		goto __15
	}
	quotedElementStr = XTclStackAlloc(tls, interp,
		int32(uint32(len)+uint32(1)))

	len = XTclConvertElement(tls, elementStr, *(*int32)(unsafe.Pointer(bp + 104 /* elemLen */)),
		quotedElementStr, int32(*(*int8)(unsafe.Pointer(bp + 108 /* flags */))))
	XTcl_AppendToObj(tls, objPtr, quotedElementStr, len)
	XTclStackFree(tls, interp, quotedElementStr)
	goto __16
__15:
	XTcl_AppendToObj(tls, objPtr, elementStr, *(*int32)(unsafe.Pointer(bp + 104 /* elemLen */)))
__16:
	;

	isFirst = 0

	// Add a space if the word is not the last one (which has a
	// moderately complex condition here).

	if !(i < toPrint-1 || objc != 0 || message != uintptr(0)) {
		goto __17
	}
	XTcl_AppendStringsToObj(tls, objPtr, libc.VaList(bp, ts+14299, uintptr(0)))
__17:
	;
	goto __11
__11:
	i++
	goto __10
	goto __12
__12:
	;
__8:
	;

	// Now add the arguments (other than those rewritten) that the caller took
	// from its calling context.

addNormalArgumentsToMessage:
	i = 0
__18:
	if !(i < objc) {
		goto __20
	}
	// If the object is an index type use the index table which allows for
	// the correct error message even if the subcommand was abbreviated.
	// Otherwise, just use the string rep.

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&indexType))) {
		goto __21
	}
	indexRep1 = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32))

	XTcl_AppendStringsToObj(tls, objPtr, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer((*IndexRep)(unsafe.Pointer(indexRep1)).FtablePtr + uintptr((*IndexRep)(unsafe.Pointer(indexRep1)).Foffset*(*IndexRep)(unsafe.Pointer(indexRep1)).Findex))), uintptr(0)))
	goto __22
__21:
	// Quote the argument if it contains spaces (Bug 942757).

	elementStr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 104)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+104)
	}()
	*(*int8)(unsafe.Pointer(bp + 108 /* flags */)) = int8(0)
	len = XTclScanElement(tls, elementStr, *(*int32)(unsafe.Pointer(bp + 104 /* elemLen */)), bp+108)

	if !(!(isFirst != 0) && len != *(*int32)(unsafe.Pointer(bp + 104))) {
		goto __23
	}
	quotedElementStr1 = XTclStackAlloc(tls, interp,
		int32(uint32(len)+uint32(1)))

	len = XTclConvertElement(tls, elementStr, *(*int32)(unsafe.Pointer(bp + 104 /* elemLen */)),
		quotedElementStr1, int32(*(*int8)(unsafe.Pointer(bp + 108 /* flags */))))
	XTcl_AppendToObj(tls, objPtr, quotedElementStr1, len)
	XTclStackFree(tls, interp, quotedElementStr1)
	goto __24
__23:
	XTcl_AppendToObj(tls, objPtr, elementStr, *(*int32)(unsafe.Pointer(bp + 104 /* elemLen */)))
__24:
	;
__22:
	;

	isFirst = 0

	// Append a space character (" ") if there is more text to follow
	// (either another element from objv, or the message string).

	if !(i < objc-1 || message != uintptr(0)) {
		goto __25
	}
	XTcl_AppendStringsToObj(tls, objPtr, libc.VaList(bp+32, ts+14299, uintptr(0)))
__25:
	;
	goto __19
__19:
	i++
	goto __18
	goto __20
__20:
	;

	// Add any trailing message bits and set the resulting string as the
	// interpreter result. Caller is responsible for reporting this as an
	// actual error.

	if !(message != uintptr(0)) {
		goto __26
	}
	XTcl_AppendStringsToObj(tls, objPtr, libc.VaList(bp+48, message, uintptr(0)))
__26:
	;
	XTcl_AppendStringsToObj(tls, objPtr, libc.VaList(bp+64, ts+25027, uintptr(0)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, ts+3593, ts+8360, uintptr(0)))
	XTcl_SetObjResult(tls, interp, objPtr)
}

//----------------------------------------------------------------------
//
// Tcl_ParseArgsObjv --
//
//	Process an objv array according to a table of expected command-line
//	options. See the manual page for more details.
//
// Results:
//	The return value is a standard Tcl return value. If an error occurs
//	then an error message is left in the interp's result. Under normal
//	conditions, both *objcPtr and *objv are modified to return the
//	arguments that couldn't be processed here (they didn't match the
//	option table, or followed an TCL_ARGV_REST argument).
//
// Side effects:
//	Variables may be modified, or procedures may be called. It all depends
//	on the arguments and their entries in argTable. See the user
//	documentation for details.
//
//----------------------------------------------------------------------

func XTcl_ParseArgsObjv(tls *libc.TLS, interp uintptr, argTable uintptr, objcPtr uintptr, objv uintptr, remObjv uintptr) int32 { /* tclIndexObj.c:1049:1: */
	bp := tls.Alloc(68)
	defer tls.Free(68)

	var leftovers uintptr // Array to write back to remObjv on
	// successful exit. Will include the name of
	// the command.
	var nrem int32 // Size of leftovers.
	var infoPtr uintptr
	// Pointer to the current entry in the table
	// of argument descriptions.
	var matchPtr uintptr
	// Descriptor that matches current argument
	var curArg uintptr // Current argument
	var str uintptr
	var c int8 // Second character of current arg (used for
	// quick check for matching; use 2nd char.
	// because first char. will almost always be
	// '-').
	var srcIndex int32 // Location from which to read next argument
	// from objv.
	var dstIndex int32 // Used to keep track of current arguments
	// being processed, primarily for error
	// reporting.
	var objc int32 // # arguments in objv still to process.
	// var length int32 at bp+64, 4

	var handlerProc uintptr
	var argObj uintptr
	var handlerProc1 uintptr
	str = uintptr(0) // Number of characters in current argument

	if !(remObjv != uintptr(0)) {
		goto __1
	}
	// Then we should copy the name of the command (0th argument). The
	// upper bound on the number of elements is known, and (undocumented,
	// but historically true) there should be a NULL argument after the
	// last result. [Bug 3413857]

	nrem = 1
	leftovers = XTcl_Alloc(tls, uint32(uint64(1+*(*int32)(unsafe.Pointer(objcPtr)))*uint64(unsafe.Sizeof(uintptr(0)))))
	*(*uintptr)(unsafe.Pointer(leftovers)) = *(*uintptr)(unsafe.Pointer(objv))
	goto __2
__1:
	nrem = 0
	leftovers = uintptr(0)
__2:
	;

	// OK, now start processing from the second element (1st argument).

	srcIndex = libc.AssignInt32(&dstIndex, 1)
	objc = *(*int32)(unsafe.Pointer(objcPtr)) - 1

__3:
	if !(objc > 0) {
		goto __4
	}
	curArg = *(*uintptr)(unsafe.Pointer(objv + uintptr(srcIndex)*8))
	srcIndex++
	objc--
	str = XTcl_GetStringFromObj(tls, curArg, bp+64)
	if !(*(*int32)(unsafe.Pointer(bp + 64)) > 0) {
		goto __5
	}
	c = *(*int8)(unsafe.Pointer(str + 1))
	goto __6
__5:
	c = int8(0)
__6:
	;

	// Loop throught the argument descriptors searching for one with the
	// matching key string. If found, leave a pointer to it in matchPtr.

	matchPtr = uintptr(0)
	infoPtr = argTable
__7:
	if !(infoPtr != uintptr(0) && (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).Ftype != TCL_ARGV_END) {
		goto __9
	}
	if !((*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FkeyStr == uintptr(0)) {
		goto __10
	}
	goto __8
__10:
	;
	if !(int32(*(*int8)(unsafe.Pointer((*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FkeyStr + 1))) != int32(c) ||
		libc.Xstrncmp(tls, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FkeyStr, str, uint64(*(*int32)(unsafe.Pointer(bp + 64)))) != 0) {
		goto __11
	}
	goto __8
__11:
	;
	if !(int32(*(*int8)(unsafe.Pointer((*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FkeyStr + uintptr(*(*int32)(unsafe.Pointer(bp + 64)))))) == 0) {
		goto __12
	}
	matchPtr = infoPtr
	goto gotMatch
__12:
	;
	if !(matchPtr != uintptr(0)) {
		goto __13
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38754, libc.VaList(bp, str)))
	goto error
__13:
	;
	matchPtr = infoPtr
	goto __8
__8:
	infoPtr += 48
	goto __7
	goto __9
__9:
	;
	if !(matchPtr == uintptr(0)) {
		goto __14
	}
	// Unrecognized argument. Just copy it down, unless the caller
	// prefers an error to be registered.

	if !(remObjv == uintptr(0)) {
		goto __15
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38776, libc.VaList(bp+8, str)))
	goto error
__15:
	;

	dstIndex++ // This argument is now handled
	*(*uintptr)(unsafe.Pointer(leftovers + uintptr(libc.PostIncInt32(&nrem, 1))*8)) = curArg
	goto __3
__14:
	;

	// Take the appropriate action based on the option type

gotMatch:
	infoPtr = matchPtr
	switch (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).Ftype {
	case TCL_ARGV_CONSTANT:
		goto __17
	case TCL_ARGV_INT:
		goto __18
	case TCL_ARGV_STRING:
		goto __19
	case TCL_ARGV_REST:
		goto __20
	case TCL_ARGV_FLOAT:
		goto __21
	case TCL_ARGV_FUNC:
		goto __22
	case TCL_ARGV_GENFUNC:
		goto __23
	case TCL_ARGV_HELP:
		goto __24
	default:
		goto __25
	}
	goto __16
__17:
	*(*int32)(unsafe.Pointer((*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FdstPtr)) = int32((*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FsrcPtr)
	goto __16
__18:
	if !(objc == 0) {
		goto __26
	}
	goto missingArg
__26:
	;
	if !(XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(srcIndex)*8)),
		(*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FdstPtr) == TCL_ERROR) {
		goto __27
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38803,
		libc.VaList(bp+16, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FkeyStr, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(srcIndex)*8))))))
	goto error
__27:
	;
	srcIndex++
	objc--
	goto __16
__19:
	if !(objc == 0) {
		goto __28
	}
	goto missingArg
__28:
	;
	*(*uintptr)(unsafe.Pointer((*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FdstPtr)) = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(srcIndex)*8)))
	srcIndex++
	objc--
	goto __16
__20:
	// Only store the point where we got to if it's not to be written
	// to NULL, so that TCL_ARGV_AUTO_REST works.

	if !((*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FdstPtr != uintptr(0)) {
		goto __29
	}
	*(*int32)(unsafe.Pointer((*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FdstPtr)) = dstIndex
__29:
	;
	goto argsDone
__21:
	if !(objc == 0) {
		goto __30
	}
	goto missingArg
__30:
	;
	if !(XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(srcIndex)*8)),
		(*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FdstPtr) == TCL_ERROR) {
		goto __31
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38851,
		libc.VaList(bp+32, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FkeyStr, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(srcIndex)*8))))))
	goto error
__31:
	;
	srcIndex++
	objc--
	goto __16
__22:
	handlerProc = (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FsrcPtr

	if !(objc == 0) {
		goto __32
	}
	argObj = uintptr(0)
	goto __33
__32:
	argObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(srcIndex)*8))
__33:
	;
	if !((*struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{handlerProc})).f(tls, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FclientData, argObj, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FdstPtr) != 0) {
		goto __34
	}
	srcIndex++
	objc--
__34:
	;
	goto __16

__23:
	handlerProc1 = (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FsrcPtr

	objc = (*struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{handlerProc1})).f(tls, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FclientData, interp, objc,
		objv+uintptr(srcIndex)*8, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FdstPtr)
	if !(objc < 0) {
		goto __35
	}
	goto error
__35:
	;
	goto __16

__24:
	sPrintUsage(tls, interp, argTable)
	goto error
__25:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38906, libc.VaList(bp+48, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).Ftype)))
	goto error
__16:
	;
	goto __3
__4:
	;

	// If we broke out of the loop because of an OPT_REST argument, copy the
	// remaining arguments down. Note that there is always at least one
	// argument left over - the command name - so we always have a result if
	// our caller is willing to receive it. [Bug 3413857]

argsDone:
	if !(remObjv == uintptr(0)) {
		goto __36
	}
	// Nothing to do.

	return TCL_OK
__36:
	;

	if !(objc > 0) {
		goto __37
	}
	libc.Xmemcpy(tls, leftovers+uintptr(nrem)*8, objv+uintptr(srcIndex)*8, uint64(objc)*uint64(unsafe.Sizeof(uintptr(0))))
	nrem = nrem + objc
__37:
	;
	*(*uintptr)(unsafe.Pointer(leftovers + uintptr(nrem)*8)) = uintptr(0)
	*(*int32)(unsafe.Pointer(objcPtr)) = libc.PostIncInt32(&nrem, 1)
	*(*uintptr)(unsafe.Pointer(remObjv)) = XTcl_Realloc(tls, leftovers, uint32(uint64(nrem)*uint64(unsafe.Sizeof(uintptr(0)))))
	return TCL_OK

	// Make sure to handle freeing any temporary space we've allocated on the
	// way to an error.

missingArg:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+38943, libc.VaList(bp+56, str)))
error:
	if !(leftovers != uintptr(0)) {
		goto __38
	}
	XTclpFree(tls, leftovers)
__38:
	;
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// PrintUsage --
//
//	Generate a help string describing command-line options.
//
// Results:
//	The interp's result will be modified to hold a help string describing
//	all the options in argTable.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPrintUsage(tls *libc.TLS, interp uintptr, argTable uintptr) { /* tclIndexObj.c:1312:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var infoPtr uintptr
	var width int32
	var numSpaces int32
	var msg uintptr

	// First, compute the width of the widest option key, so that we can make
	// everything line up.

	width = 4
	for infoPtr = argTable; (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).Ftype != TCL_ARGV_END; infoPtr += 48 {
		var length int32

		if (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FkeyStr == uintptr(0) {
			continue
		}
		length = int32(libc.Xstrlen(tls, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FkeyStr))
		if length > width {
			width = length
		}
	}

	// Now add the option information, with pretty-printing.

	msg = XTcl_NewStringObj(tls, ts+38987, -1)
	for infoPtr = argTable; (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).Ftype != TCL_ARGV_END; infoPtr += 48 {
		if (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).Ftype == TCL_ARGV_HELP && (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FkeyStr == uintptr(0) {
			XTcl_AppendPrintfToObj(tls, msg, ts+39013, libc.VaList(bp, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FhelpStr))
			continue
		}
		XTcl_AppendPrintfToObj(tls, msg, ts+39017, libc.VaList(bp+8, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FkeyStr))
		numSpaces = int32(Size_t(width+1) - libc.Xstrlen(tls, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FkeyStr))
		for numSpaces > 0 {
			if numSpaces >= NUM_SPACES {
				XTcl_AppendToObj(tls, msg, uintptr(unsafe.Pointer(&spaces)), NUM_SPACES)
			} else {
				XTcl_AppendToObj(tls, msg, uintptr(unsafe.Pointer(&spaces)), numSpaces)
			}
			numSpaces = numSpaces - NUM_SPACES
		}
		XTcl_AppendToObj(tls, msg, (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FhelpStr, -1)
		switch (*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).Ftype {
		case TCL_ARGV_INT:
			XTcl_AppendPrintfToObj(tls, msg, ts+39023,
				libc.VaList(bp+16, *(*int32)(unsafe.Pointer((*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FdstPtr))))
			break
		case TCL_ARGV_FLOAT:
			XTcl_AppendPrintfToObj(tls, msg, ts+39044,
				libc.VaList(bp+24, *(*float64)(unsafe.Pointer((*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FdstPtr))))
			break
		case TCL_ARGV_STRING:
			{
				var string uintptr = *(*uintptr)(unsafe.Pointer((*Tcl_ArgvInfo)(unsafe.Pointer(infoPtr)).FdstPtr))

				if string != uintptr(0) {
					XTcl_AppendPrintfToObj(tls, msg, ts+39065,
						libc.VaList(bp+32, string))
				}
				break

			}
		default:
			break
		}
	}
	XTcl_SetObjResult(tls, interp, msg)
}

var spaces = *(*[21]int8)(unsafe.Pointer(ts + 39088)) /* tclIndexObj.c:1322:23 */

//----------------------------------------------------------------------
//
// TclGetCompletionCodeFromObj --
//
//	Parses Completion code Code
//
// Results:
//	Returns TCL_ERROR if the value is an invalid completion code.
//	Otherwise, returns TCL_OK, and writes the completion code to the
//	pointer provided.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetCompletionCodeFromObj(tls *libc.TLS, interp uintptr, value uintptr, codePtr uintptr) int32 { /* tclIndexObj.c:1408:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	if (*Tcl_Obj)(unsafe.Pointer(value)).FtypePtr != uintptr(unsafe.Pointer(&indexType)) &&
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(value)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(value + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(value + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(codePtr)) = int32(*(*int64)(unsafe.Pointer(value + 32)))
					return TCL_OK
				}()
			}
			return XTcl_GetIntFromObj(tls, uintptr(0), value, codePtr)
		}() == TCL_OK {
		return TCL_OK
	}
	if XTcl_GetIndexFromObj(tls, uintptr(0), value, uintptr(unsafe.Pointer(&returnCodes)), uintptr(0), TCL_EXACT,
		codePtr) == TCL_OK {
		return TCL_OK
	}

	// Value is not a legal completion code.

	if interp != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

			ts+39109,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(value)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(value)).Fbytes
				}
				return XTcl_GetString(tls, value)
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+39193, ts+39200, uintptr(0)))
	}
	return TCL_ERROR
}

var returnCodes = [6]uintptr{
	ts + 39213, ts + 5136, ts + 5291, ts + 5100, ts + 5117, uintptr(0),
} /* tclIndexObj.c:1413:23 */

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Forward declaration of the TIP#143 limit handler structure.

type LimitHandler = LimitHandler1 /* tclInt.h:1729:29 */ // Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// A pointer to a string that holds an initialization script that if non-NULL
// is evaluated in Tcl_Init() prior to the built-in initialization script
// above. This variable can be modified by the function below.

var tclPreInitScript uintptr = uintptr(0) /* tclInterp.c:22:19 */

// Forward declaration
type Target1 = struct {
	FchildCmd    Tcl_Command
	FchildInterp uintptr
	FnextPtr     uintptr
	FprevPtr     uintptr
} /* tclInterp.c:25:1 */

// struct Alias:
//
// Stores information about an alias. Is stored in the child interpreter and
// used by the source command to find the target command in the parent when
// the source command is invoked.

type Alias1 = struct {
	Ftoken         uintptr
	FtargetInterp  uintptr
	FchildCmd      Tcl_Command
	FaliasEntryPtr uintptr
	FtargetPtr     uintptr
	Fobjc          int32
	F__ccgo_pad1   [4]byte
	FobjPtr        uintptr
} /* tclInterp.c:35:9 */

// struct Alias:
//
// Stores information about an alias. Is stored in the child interpreter and
// used by the source command to find the target command in the parent when
// the source command is invoked.

type Alias = Alias1 /* tclInterp.c:65:3 */

//
// struct Child:
//
// Used by the "interp" command to record and find information about child
// interpreters. Maps from a command name in the parent to information about a
// child interpreter, e.g. what aliases are defined in it.

type Child1 = struct {
	FparentInterp  uintptr
	FchildEntryPtr uintptr
	FchildInterp   uintptr
	FinterpCmd     Tcl_Command
	FaliasTable    Tcl_HashTable
} /* tclInterp.c:76:9 */

//
// struct Child:
//
// Used by the "interp" command to record and find information about child
// interpreters. Maps from a command name in the parent to information about a
// child interpreter, e.g. what aliases are defined in it.

type Child = Child1 /* tclInterp.c:89:3 */

// struct Target:
//
// Maps from parent interpreter commands back to the source commands in child
// interpreters. This is needed because aliases can be created between sibling
// interpreters and must be deleted when the target interpreter is deleted. In
// case they would not be deleted the source interpreter would be left with a
// "dangling pointer". One such record is stored in the Parent record of the
// parent interpreter with the parent for each alias which directs to a
// command in the parent. These records are used to remove the source command
// for an from a child if/when the parent is deleted. They are organized in a
// doubly-linked list attached to the parent interpreter.

type Target = Target1 /* tclInterp.c:112:3 */

// struct Parent:
//
// This record is used for two purposes: First, childTable (a hashtable) maps
// from names of commands to child interpreters. This hashtable is used to
// store information about child interpreters of this interpreter, to map over
// all children, etc. The second purpose is to store information about all
// aliases in children (or siblings) which direct to target commands in this
// interpreter (using the targetsPtr doubly-linked list).
//
// NB: the flags field in the interp structure, used with SAFE_INTERP mask
// denotes whether the interpreter is safe or not. Safe interpreters have
// restricted functionality, can only create safe interpreters and can
// only load safe extensions.

type Parent1 = struct {
	FchildTable Tcl_HashTable
	FtargetsPtr uintptr
} /* tclInterp.c:130:9 */

// struct Parent:
//
// This record is used for two purposes: First, childTable (a hashtable) maps
// from names of commands to child interpreters. This hashtable is used to
// store information about child interpreters of this interpreter, to map over
// all children, etc. The second purpose is to store information about all
// aliases in children (or siblings) which direct to target commands in this
// interpreter (using the targetsPtr doubly-linked list).
//
// NB: the flags field in the interp structure, used with SAFE_INTERP mask
// denotes whether the interpreter is safe or not. Safe interpreters have
// restricted functionality, can only create safe interpreters and can
// only load safe extensions.

type Parent = Parent1 /* tclInterp.c:140:3 */

// The following structure keeps track of all the Parent and Child information
// on a per-interp basis.

type InterpInfo1 = struct {
	Fparent Parent
	Fchild  Child
} /* tclInterp.c:147:9 */

// The following structure keeps track of all the Parent and Child information
// on a per-interp basis.

type InterpInfo = InterpInfo1 /* tclInterp.c:152:3 */

// Limit callbacks handled by scripts are modelled as structures which are
// stored in hashes indexed by a two-word key. Note that the type of the
// 'type' field in the key is not int; this is to make sure that things are
// likely to work properly on 64-bit architectures.

type ScriptLimitCallback1 = struct {
	Finterp      uintptr
	FscriptObj   uintptr
	Ftype        int32
	F__ccgo_pad1 [4]byte
	FentryPtr    uintptr
} /* tclInterp.c:161:9 */

// Limit callbacks handled by scripts are modelled as structures which are
// stored in hashes indexed by a two-word key. Note that the type of the
// 'type' field in the key is not int; this is to make sure that things are
// likely to work properly on 64-bit architectures.

type ScriptLimitCallback = ScriptLimitCallback1 /* tclInterp.c:172:3 */

type ScriptLimitCallbackKey1 = struct {
	Finterp uintptr
	Ftype   int64
} /* tclInterp.c:174:9 */

type ScriptLimitCallbackKey = ScriptLimitCallbackKey1 /* tclInterp.c:179:3 */

//----------------------------------------------------------------------
//
// TclSetPreInitScript --
//
//	This routine is used to change the value of the internal variable,
//	tclPreInitScript.
//
// Results:
//	Returns the current value of tclPreInitScript.
//
// Side effects:
//	Changes the way Tcl_Init() routine behaves.
//
//----------------------------------------------------------------------

func XTclSetPreInitScript(tls *libc.TLS, string uintptr) uintptr { /* tclInterp.c:306:12: */
	var prevString uintptr = tclPreInitScript
	tclPreInitScript = string
	return prevString
}

//----------------------------------------------------------------------
//
// Tcl_Init --
//
//	This function is typically invoked by Tcl_AppInit functions to find
//	and source the "init.tcl" script, which should exist somewhere on the
//	Tcl library path.
//
// Results:
//	Returns a standard Tcl completion code and sets the interp's result if
//	there is an error.
//
// Side effects:
//	Depends on what's in the init.tcl script.
//
//----------------------------------------------------------------------

func XTcl_Init(tls *libc.TLS, interp uintptr) int32 { /* tclInterp.c:335:1: */
	if tclPreInitScript != uintptr(0) {
		if XTcl_Eval(tls, interp, tclPreInitScript) == TCL_ERROR {
			return TCL_ERROR
		}
	}

	// In order to find init.tcl during initialization, the following script
	// is invoked by Tcl_Init(). It looks in several different directories:
	//
	//	$tcl_library		- can specify a primary location, if set, no
	//				  other locations will be checked. This is the
	//				  recommended way for a program that embeds
	//				  Tcl to specifically tell Tcl where to find
	//				  an init.tcl file.
	//
	//	$env(TCL_LIBRARY)	- highest priority so user can always override
	//				  the search path unless the application has
	//				  specified an exact directory above
	//
	//	$tclDefaultLibrary	- INTERNAL: This variable is set by Tcl on
	//				  those platforms where it can determine at
	//				  runtime the directory where it expects the
	//				  init.tcl file to be. After [tclInit] reads
	//				  and uses this value, it [unset]s it.
	//				  External users of Tcl should not make use of
	//				  the variable to customize [tclInit].
	//
	//	$tcl_libPath		- OBSOLETE: This variable is no longer set by
	//				  Tcl itself, but [tclInit] examines it in
	//				  case some program that embeds Tcl is
	//				  customizing [tclInit] by setting this
	//				  variable to a list of directories in which
	//				  to search.
	//
	//	[tcl::pkgconfig get scriptdir,runtime]
	//				- the directory determined by configure to be
	//				  the place where Tcl's script library is to
	//				  be installed.
	//
	// The first directory on this path that contains a valid init.tcl script
	// will be set as the value of tcl_library.
	//
	// Note that this entire search mechanism can be bypassed by defining an
	// alternate tclInit command before calling Tcl_Init().

	return XTcl_Eval(tls, interp,

		ts+39216)
}

//---------------------------------------------------------------------------
//
// TclInterpInit --
//
//	Initializes the invoking interpreter for using the parent, child and
//	safe interp facilities. This is called from inside Tcl_CreateInterp().
//
// Results:
//	Always returns TCL_OK for backwards compatibility.
//
// Side effects:
//	Adds the "interp" command to an interpreter and initializes the
//	interpInfoPtr field of the invoking interpreter.
//
//---------------------------------------------------------------------------

func XTclInterpInit(tls *libc.TLS, interp uintptr) int32 { /* tclInterp.c:469:1: */
	var interpInfoPtr uintptr
	var parentPtr uintptr
	var childPtr uintptr

	interpInfoPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(InterpInfo{})))
	(*Interp)(unsafe.Pointer(interp)).FinterpInfo = interpInfoPtr

	parentPtr = interpInfoPtr
	XTcl_InitHashTable(tls, parentPtr, 0)
	(*Parent)(unsafe.Pointer(parentPtr)).FtargetsPtr = uintptr(0)

	childPtr = interpInfoPtr + 96
	(*Child)(unsafe.Pointer(childPtr)).FparentInterp = uintptr(0)
	(*Child)(unsafe.Pointer(childPtr)).FchildEntryPtr = uintptr(0)
	(*Child)(unsafe.Pointer(childPtr)).FchildInterp = interp
	(*Child)(unsafe.Pointer(childPtr)).FinterpCmd = uintptr(0)
	XTcl_InitHashTable(tls, childPtr+32, 0)

	XTcl_NRCreateCommand(tls, interp, ts+41279, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTcl_InterpObjCmd})), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNRInterpCmd})),
		uintptr(0), uintptr(0))

	XTcl_CallWhenDeleted(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr)
	}{sInterpInfoDeleteProc})), uintptr(0))
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// InterpInfoDeleteProc --
//
//	Invoked when an interpreter is being deleted. It releases all storage
//	used by the parent/child/safe interpreter facilities.
//
// Results:
//	None.
//
// Side effects:
//	Cleans up storage. Sets the interpInfoPtr field of the interp to NULL.
//
//---------------------------------------------------------------------------

func sInterpInfoDeleteProc(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclInterp.c:515:1: */
	var interpInfoPtr uintptr
	var childPtr uintptr
	var parentPtr uintptr
	var targetPtr uintptr

	interpInfoPtr = (*Interp)(unsafe.Pointer(interp)).FinterpInfo

	// There shouldn't be any commands left.

	parentPtr = interpInfoPtr
	if (*Parent)(unsafe.Pointer(parentPtr)).FchildTable.FnumEntries != 0 {
		XTcl_Panic(tls, ts+41286, 0)
	}
	XTcl_DeleteHashTable(tls, parentPtr)

	// Tell any interps that have aliases to this interp that they should
	// delete those aliases. If the other interp was already dead, it would
	// have removed the target record already.

	for targetPtr = (*Parent)(unsafe.Pointer(parentPtr)).FtargetsPtr; targetPtr != uintptr(0); {
		var tmpPtr uintptr = (*Target)(unsafe.Pointer(targetPtr)).FnextPtr
		XTcl_DeleteCommandFromToken(tls, (*Target)(unsafe.Pointer(targetPtr)).FchildInterp,
			(*Target)(unsafe.Pointer(targetPtr)).FchildCmd)
		targetPtr = tmpPtr
	}

	childPtr = interpInfoPtr + 96
	if (*Child)(unsafe.Pointer(childPtr)).FinterpCmd != uintptr(0) {
		// Tcl_DeleteInterp() was called on this interpreter, rather "interp
		// delete" or the equivalent deletion of the command in the parent.
		// First ensure that the cleanup callback doesn't try to delete the
		// interp again.

		(*Child)(unsafe.Pointer(childPtr)).FchildInterp = uintptr(0)
		XTcl_DeleteCommandFromToken(tls, (*Child)(unsafe.Pointer(childPtr)).FparentInterp,
			(*Child)(unsafe.Pointer(childPtr)).FinterpCmd)
	}

	// There shouldn't be any aliases left.

	if (*Child)(unsafe.Pointer(childPtr)).FaliasTable.FnumEntries != 0 {
		XTcl_Panic(tls, ts+41329, 0)
	}
	XTcl_DeleteHashTable(tls, childPtr+32)

	XTclpFree(tls, interpInfoPtr)
}

//----------------------------------------------------------------------
//
// Tcl_InterpObjCmd --
//
//	This function is invoked to process the "interp" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------
// ARGSUSED
func XTcl_InterpObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:594:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNRInterpCmd})), clientData, objc, objv)
}

func sNRInterpCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:604:1: */
	bp := tls.Alloc(304)
	defer tls.Free(304)

	var childInterp uintptr
	// var index int32 at bp+160, 4

	var parentInterp uintptr
	var i int32
	var flags int32
	var resultObjPtr uintptr
	// var cmdInfo Tcl_CmdInfo at bp+208, 64

	var _objPtr uintptr
	var i1 int32
	var last int32
	var safe int32
	var childPtr uintptr
	// var buf [40]int8 at bp+164, 40

	var i2 int32
	var iiPtr uintptr
	var exists int32
	var i3 int32
	var namespaceName uintptr
	// var limitType int32 at bp+272, 4

	var iiPtr1 uintptr
	var resultPtr uintptr
	var hPtr uintptr
	// var hashSearch Tcl_HashSearch at bp+280, 24

	var string uintptr
	var parentInterp1 uintptr // The parent of the child.
	var chan1 Tcl_Channel
	var iiPtr2 uintptr
	var hPtr1 uintptr
	var aliasPtr uintptr
	var aliasName uintptr

	if !(objc < 2) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+41371)
	return TCL_ERROR
__1:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&options11)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+160) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 160 /* index */))) {
	case uint32(0) /* OPT_ALIAS */ :
		goto __4
	case uint32(1) /* OPT_ALIASES */ :
		goto __5
	case uint32(2) /* OPT_BGERROR */ :
		goto __6
	case uint32(3) /* OPT_CANCEL */ :
		goto __7
	case uint32(5) /* OPT_CREATE */ :
		goto __8
	case uint32(6) /* OPT_DEBUG */ :
		goto __9
	case uint32(7) /* OPT_DELETE */ :
		goto __10
	case uint32(8) /* OPT_EVAL */ :
		goto __11
	case uint32(9) /* OPT_EXISTS */ :
		goto __12
	case uint32(10) /* OPT_EXPOSE */ :
		goto __13
	case uint32(11) /* OPT_HIDE */ :
		goto __14
	case uint32(12) /* OPT_HIDDEN */ :
		goto __15
	case uint32(13) /* OPT_ISSAFE */ :
		goto __16
	case uint32(14) /* OPT_INVOKEHID */ :
		goto __17
	case uint32(15) /* OPT_LIMIT */ :
		goto __18
	case uint32(16) /* OPT_MARKTRUSTED */ :
		goto __19
	case uint32(17) /* OPT_RECLIMIT */ :
		goto __20
	case uint32(4) /* OPT_CHILDREN */ :
		goto __21
	case uint32(18) /* OPT_SLAVES */ :
		goto __22
	case uint32(21) /* OPT_TRANSFER */ :
		goto __23
	case uint32(19) /* OPT_SHARE */ :
		goto __24
	case uint32(20) /* OPT_TARGET */ :
		goto __25
	}
	goto __3
__4:

	if !(objc < 4) {
		goto __26
	}
aliasArgs:
	XTcl_WrongNumArgs(tls, interp, 2, objv,
		ts+41385)
	return TCL_ERROR
__26:
	;
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(childInterp == uintptr(0)) {
		goto __27
	}
	return TCL_ERROR
__27:
	;
	if !(objc == 4) {
		goto __28
	}
	return sAliasDescribe(tls, interp, childInterp, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
__28:
	;
	if !(objc == 5 && int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 4*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 4*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 4*8)))
	}()))) == 0) {
		goto __29
	}
	return sAliasDelete(tls, interp, childInterp, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
__29:
	;
	if !(objc > 5) {
		goto __30
	}
	parentInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 4*8)))
	if !(parentInterp == uintptr(0)) {
		goto __31
	}
	return TCL_ERROR
__31:
	;

	return sAliasCreate(tls, interp, childInterp, parentInterp, *(*uintptr)(unsafe.Pointer(objv + 3*8)),
		*(*uintptr)(unsafe.Pointer(objv + 5*8)), objc-6, objv+uintptr(6)*8)
__30:
	;
	goto aliasArgs

__5:
	childInterp = sGetInterp2(tls, interp, objc, objv)
	if !(childInterp == uintptr(0)) {
		goto __32
	}
	return TCL_ERROR
__32:
	;
	return sAliasList(tls, interp, childInterp)
__6:
	if !(objc != 3 && objc != 4) {
		goto __33
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+41437)
	return TCL_ERROR
__33:
	;
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(childInterp == uintptr(0)) {
		goto __34
	}
	return TCL_ERROR
__34:
	;
	return sChildBgerror(tls, interp, childInterp, objc-3, objv+uintptr(3)*8)
__7:

	flags = 0

	i = 2
__35:
	if !(i < objc) {
		goto __37
	}
	if !(int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}()))) != '-') {
		goto __38
	}
	goto __37
__38:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&cancelOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+160) != TCL_OK) {
		goto __39
	}
	return TCL_ERROR
__39:
	;

	switch uint32(*(*int32)(unsafe.Pointer(bp + 160 /* index */))) {
	case uint32(0) /* OPT_UNWIND */ :
		goto __41
	case uint32(1) /* OPT_LAST */ :
		goto __42
	}
	goto __40
__41:
	// The evaluation stack in the target interp is to be unwound.

	flags = flags | TCL_CANCEL_UNWIND
	goto __40
__42:
	i++
	goto endOfForLoop
__40:
	;
	goto __36
__36:
	i++
	goto __35
	goto __37
__37:
	;

endOfForLoop:
	if !(i < objc-2) {
		goto __43
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv,
		ts+41454)
	return TCL_ERROR
__43:
	;

	// Did they specify a child interp to cancel the script in progress
	// in?  If not, use the current interp.

	if !(i < objc) {
		goto __44
	}
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	if !(childInterp == uintptr(0)) {
		goto __46
	}
	return TCL_ERROR
__46:
	;
	i++
	goto __45
__44:
	childInterp = interp
__45:
	;

	if !(i < objc) {
		goto __47
	}
	resultObjPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))

	// Tcl_CancelEval removes this reference.

	(*Tcl_Obj)(unsafe.Pointer(resultObjPtr)).FrefCount++
	i++
	goto __48
__47:
	resultObjPtr = uintptr(0)
__48:
	;

	return XTcl_CancelEval(tls, childInterp, resultObjPtr, uintptr(0), flags)

__8:

	safe = XTcl_IsSafe(tls, interp)

	// Weird historical rules: "-safe" is accepted at the end, too.

	childPtr = uintptr(0)
	last = 0
	i1 = 2
__49:
	if !(i1 < objc) {
		goto __51
	}
	if !(last == 0 && int32(*(*int8)(unsafe.Pointer(XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)))))) == '-') {
		goto __52
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)), uintptr(unsafe.Pointer(&createOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+160) != TCL_OK) {
		goto __53
	}
	return TCL_ERROR
__53:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 160)) == 0) {
		goto __54
	}
	safe = 1
	goto __50
__54:
	;
	i1++
	last = 1
__52:
	;
	if !(childPtr != uintptr(0)) {
		goto __55
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+41485)
	return TCL_ERROR
__55:
	;
	if !(i1 < objc) {
		goto __56
	}
	childPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8))
__56:
	;
	goto __50
__50:
	i1++
	goto __49
	goto __51
__51:
	;
	*(*int8)(unsafe.Pointer(bp + 164)) = int8(0)
	if !(childPtr == uintptr(0)) {
		goto __57
	}
	// Create an anonymous interpreter -- we choose its name and the
	// name of the command. We check that the command name that we use
	// for the interpreter does not collide with an existing command
	// in the parent interpreter.

	i1 = 0
__58:
	;

	libc.Xsprintf(tls, bp+164, ts+41505, libc.VaList(bp, i1))
	if !(XTcl_GetCommandInfo(tls, interp, bp+164, bp+208) == 0) {
		goto __61
	}
	goto __60
__61:
	;
	goto __59
__59:
	i1++
	goto __58
	goto __60
__60:
	;
	childPtr = XTcl_NewStringObj(tls, bp+164, -1)
__57:
	;
	if !(sChildCreate(tls, interp, childPtr, safe) == uintptr(0)) {
		goto __62
	}
	if !(int32(*(*int8)(unsafe.Pointer(bp + 164))) != 0) {
		goto __63
	}
__64:
	_objPtr = childPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __67
	}
	XTclFreeObj(tls, _objPtr)
__67:
	;
	goto __65
__65:
	if 0 != 0 {
		goto __64
	}
	goto __66
__66:
	;
__63:
	;
	return TCL_ERROR
__62:
	;
	XTcl_SetObjResult(tls, interp, childPtr)
	return TCL_OK

__9: // TIP #378
	// Currently only -frame supported, otherwise ?-option ?value??

	if !(objc < 3 || objc > 5) {
		goto __68
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+41514)
	return TCL_ERROR
__68:
	;
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(childInterp == uintptr(0)) {
		goto __69
	}
	return TCL_ERROR
__69:
	;
	return sChildDebugCmd(tls, interp, childInterp, objc-3, objv+uintptr(3)*8)
__10:

	i2 = 2
__70:
	if !(i2 < objc) {
		goto __72
	}
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i2)*8)))
	if !(childInterp == uintptr(0)) {
		goto __73
	}
	return TCL_ERROR
	goto __74
__73:
	if !(childInterp == interp) {
		goto __75
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+41535, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7420, ts+41573,
		ts+41580, uintptr(0)))
	return TCL_ERROR
__75:
	;
__74:
	;
	iiPtr = (*Interp)(unsafe.Pointer(childInterp)).FinterpInfo
	XTcl_DeleteCommandFromToken(tls, (*InterpInfo)(unsafe.Pointer(iiPtr)).Fchild.FparentInterp,
		(*InterpInfo)(unsafe.Pointer(iiPtr)).Fchild.FinterpCmd)
	goto __71
__71:
	i2++
	goto __70
	goto __72
__72:
	;
	return TCL_OK

__11:
	if !(objc < 4) {
		goto __76
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+41591)
	return TCL_ERROR
__76:
	;
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(childInterp == uintptr(0)) {
		goto __77
	}
	return TCL_ERROR
__77:
	;
	return sChildEval(tls, interp, childInterp, objc-3, objv+uintptr(3)*8)
__12:
	exists = 1

	childInterp = sGetInterp2(tls, interp, objc, objv)
	if !(childInterp == uintptr(0)) {
		goto __78
	}
	if !(objc > 3) {
		goto __79
	}
	return TCL_ERROR
__79:
	;
	XTcl_ResetResult(tls, interp)
	exists = 0
__78:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(exists != 0)))
	return TCL_OK

__13:
	if !(objc < 4 || objc > 5) {
		goto __80
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+41610)
	return TCL_ERROR
__80:
	;
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(childInterp == uintptr(0)) {
		goto __81
	}
	return TCL_ERROR
__81:
	;
	return sChildExpose(tls, interp, childInterp, objc-3, objv+uintptr(3)*8)
__14:
	if !(objc < 4 || objc > 5) {
		goto __82
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+41639)
	return TCL_ERROR
__82:
	;
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(childInterp == uintptr(0)) {
		goto __83
	}
	return TCL_ERROR
__83:
	;
	return sChildHide(tls, interp, childInterp, objc-3, objv+uintptr(3)*8)
__15:
	childInterp = sGetInterp2(tls, interp, objc, objv)
	if !(childInterp == uintptr(0)) {
		goto __84
	}
	return TCL_ERROR
__84:
	;
	return sChildHidden(tls, interp, childInterp)
__16:
	childInterp = sGetInterp2(tls, interp, objc, objv)
	if !(childInterp == uintptr(0)) {
		goto __85
	}
	return TCL_ERROR
__85:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(XTcl_IsSafe(tls, childInterp) != 0)))
	return TCL_OK
__17:

	namespaceName = uintptr(0)
	i3 = 3
__86:
	if !(i3 < objc) {
		goto __88
	}
	if !(int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)))
	}()))) != '-') {
		goto __89
	}
	goto __88
__89:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)), uintptr(unsafe.Pointer(&hiddenOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+160) != TCL_OK) {
		goto __90
	}
	return TCL_ERROR
__90:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 160)) == 0) {
		goto __91
	}
	namespaceName = ts + 6847 /* "::" */
	goto __92
__91:
	if !(*(*int32)(unsafe.Pointer(bp + 160)) == 1) {
		goto __93
	}
	if !(libc.PreIncInt32(&i3, 1) == objc) {
		goto __95
	} // There must be more arguments.
	goto __88
	goto __96
__95:
	namespaceName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)))
	}()
__96:
	;
	goto __94
__93:
	i3++
	goto __88
__94:
	;
__92:
	;
	goto __87
__87:
	i3++
	goto __86
	goto __88
__88:
	;
	if !(objc-i3 < 1) {
		goto __97
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv,
		ts+41668)
	return TCL_ERROR
__97:
	;
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(childInterp == uintptr(0)) {
		goto __98
	}
	return TCL_ERROR
__98:
	;
	return sChildInvokeHidden(tls, interp, childInterp, namespaceName, objc-i3,
		objv+uintptr(i3)*8)

__18:

	if !(objc < 4) {
		goto __99
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv,
		ts+41717)
	return TCL_ERROR
__99:
	;
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(childInterp == uintptr(0)) {
		goto __100
	}
	return TCL_ERROR
__100:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), uintptr(unsafe.Pointer(&limitTypes)), int32(unsafe.Sizeof(uintptr(0))), ts+41752, 0, bp+272) != TCL_OK) {
		goto __101
	}
	return TCL_ERROR
__101:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 272 /* limitType */))) {
	case uint32(0) /* LIMIT_TYPE_COMMANDS */ :
		goto __103
	case uint32(1) /* LIMIT_TYPE_TIME */ :
		goto __104
	}
	goto __102
__103:
	return sChildCommandLimitCmd(tls, interp, childInterp, 4, objc, objv)
__104:
	return sChildTimeLimitCmd(tls, interp, childInterp, 4, objc, objv)
__102:
	;

	goto __3
__19:
	if !(objc != 3) {
		goto __105
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+41763)
	return TCL_ERROR
__105:
	;
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(childInterp == uintptr(0)) {
		goto __106
	}
	return TCL_ERROR
__106:
	;
	return sChildMarkTrusted(tls, interp, childInterp)
__20:
	if !(objc != 3 && objc != 4) {
		goto __107
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+41768)
	return TCL_ERROR
__107:
	;
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(childInterp == uintptr(0)) {
		goto __108
	}
	return TCL_ERROR
__108:
	;
	return sChildRecursionLimit(tls, interp, childInterp, objc-3, objv+uintptr(3)*8)
__21:
__22:

	childInterp = sGetInterp2(tls, interp, objc, objv)
	if !(childInterp == uintptr(0)) {
		goto __109
	}
	return TCL_ERROR
__109:
	;
	iiPtr1 = (*Interp)(unsafe.Pointer(childInterp)).FinterpInfo
	resultPtr = XTcl_NewObj(tls)
	hPtr = XTcl_FirstHashEntry(tls, iiPtr1, bp+280)
__110:
	if !(hPtr != uintptr(0)) {
		goto __112
	}
	string = func() uintptr {
		if (*Tcl_HashTable)(unsafe.Pointer(iiPtr1)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(iiPtr1)).FkeyType == -1 {
			return *(*uintptr)(unsafe.Pointer(hPtr + 32))
		}
		return hPtr + 32
	}()
	XTcl_ListObjAppendElement(tls, uintptr(0), resultPtr,
		XTcl_NewStringObj(tls, string, -1))
	goto __111
__111:
	hPtr = XTcl_NextHashEntry(tls, bp+280)
	goto __110
	goto __112
__112:
	;
	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK

__23:
__24:

	if !(objc != 5) {
		goto __113
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+41784)
	return TCL_ERROR
__113:
	;
	parentInterp1 = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(parentInterp1 == uintptr(0)) {
		goto __114
	}
	return TCL_ERROR
__114:
	;
	chan1 = XTcl_GetChannel(tls, parentInterp1, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}(), uintptr(0))
	if !(chan1 == uintptr(0)) {
		goto __115
	}
	XTcl_TransferResult(tls, parentInterp1, TCL_OK, interp)
	return TCL_ERROR
__115:
	;
	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 4*8)))
	if !(childInterp == uintptr(0)) {
		goto __116
	}
	return TCL_ERROR
__116:
	;
	XTcl_RegisterChannel(tls, childInterp, chan1)
	if !(*(*int32)(unsafe.Pointer(bp + 160)) == 21) {
		goto __117
	}
	// When transferring, as opposed to sharing, we must unhitch the
	// channel from the interpreter where it started.

	if !(XTcl_UnregisterChannel(tls, parentInterp1, chan1) != TCL_OK) {
		goto __118
	}
	XTcl_TransferResult(tls, parentInterp1, TCL_OK, interp)
	return TCL_ERROR
__118:
	;
__117:
	;
	return TCL_OK

__25:

	if !(objc != 4) {
		goto __119
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+41811)
	return TCL_ERROR
__119:
	;

	childInterp = sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(childInterp == uintptr(0)) {
		goto __120
	}
	return TCL_ERROR
__120:
	;

	aliasName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}()

	iiPtr2 = (*Interp)(unsafe.Pointer(childInterp)).FinterpInfo
	hPtr1 = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iiPtr2 + 96 /* &.child */ + 32 /* &.aliasTable */)).FfindProc})).f(tls, iiPtr2+96 /* &.child */ +32 /* &.aliasTable */, aliasName)
	if !(hPtr1 == uintptr(0)) {
		goto __121
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+41822,
		libc.VaList(bp+48, aliasName, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+7170, ts+41856, aliasName,
		uintptr(0)))
	return TCL_ERROR
__121:
	;
	aliasPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr1)).FclientData
	if !(XTcl_GetInterpPath(tls, interp, (*Alias)(unsafe.Pointer(aliasPtr)).FtargetInterp) != TCL_OK) {
		goto __122
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+41862, libc.VaList(bp+104, aliasName, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+120, ts+3593, ts+7420, ts+41573,
		ts+41930, uintptr(0)))
	return TCL_ERROR
__122:
	;
	return TCL_OK

__3:
	;
	return TCL_OK
}

var options11 = [23]uintptr{
	ts + 41945, ts + 41951, ts + 27390, ts + 41959,
	ts + 41966, ts + 23142, ts + 41975, ts + 7321,
	ts + 2409, ts + 12165, ts + 41981,
	ts + 41988, ts + 31212, ts + 41993,
	ts + 42000, ts + 42013, ts + 42019, ts + 42031,
	ts + 42046, ts + 42053, ts + 42059, ts + 42066,
	uintptr(0),
} /* tclInterp.c:612:23 */
var cancelOptions = [3]uintptr{
	ts + 42075, ts + 15828, uintptr(0),
} /* tclInterp.c:688:20 */
var createOptions = [3]uintptr{
	ts + 42083, ts + 15828, uintptr(0),
} /* tclInterp.c:761:20 */
var hiddenOptions = [4]uintptr{
	ts + 42089, ts + 26167, ts + 15828, uintptr(0),
} /* tclInterp.c:920:20 */
var limitTypes = [3]uintptr{
	ts + 13145, ts + 5501, uintptr(0),
} /* tclInterp.c:962:20 */

//---------------------------------------------------------------------------
//
// GetInterp2 --
//
//	Helper function for Tcl_InterpObjCmd() to convert the interp name
//	potentially specified on the command line to an Tcl_Interp.
//
// Results:
//	The return value is the interp specified on the command line, or the
//	interp argument itself if no interp was specified on the command line.
//	If the interp could not be found or the wrong number of arguments was
//	specified on the command line, the return value is NULL and an error
//	message is left in the interp's result.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sGetInterp2(tls *libc.TLS, interp uintptr, objc int32, objv uintptr) uintptr { /* tclInterp.c:1134:19: */
	if objc == 2 {
		return interp
	} else if objc == 3 {
		return sGetInterp(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	} else {
		XTcl_WrongNumArgs(tls, interp, 2, objv, ts+42097)
		return uintptr(0)
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_CreateAlias --
//
//	Creates an alias between two interpreters.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Creates a new alias, manipulates the result field of childInterp.
//
//----------------------------------------------------------------------

func XTcl_CreateAlias(tls *libc.TLS, childInterp uintptr, childCmd uintptr, targetInterp uintptr, targetCmd uintptr, argc int32, argv uintptr) int32 { /* tclInterp.c:1168:1: */
	var childObjPtr uintptr
	var targetObjPtr uintptr
	var objv uintptr
	var i int32
	var result int32

	objv = XTclStackAlloc(tls, childInterp, int32(uint32(unsafe.Sizeof(uintptr(0)))*uint32(argc)))
	for i = 0; i < argc; i++ {
		*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) = XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), -1)
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FrefCount++
	}

	childObjPtr = XTcl_NewStringObj(tls, childCmd, -1)
	(*Tcl_Obj)(unsafe.Pointer(childObjPtr)).FrefCount++

	targetObjPtr = XTcl_NewStringObj(tls, targetCmd, -1)
	(*Tcl_Obj)(unsafe.Pointer(targetObjPtr)).FrefCount++

	result = sAliasCreate(tls, childInterp, childInterp, targetInterp, childObjPtr,
		targetObjPtr, argc, objv)

	for i = 0; i < argc; i++ {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	XTclStackFree(tls, childInterp, objv)
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = targetObjPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = childObjPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	return result
}

//----------------------------------------------------------------------
//
// Tcl_CreateAliasObj --
//
//	Object version: Creates an alias between two interpreters.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Creates a new alias.
//
//----------------------------------------------------------------------

func XTcl_CreateAliasObj(tls *libc.TLS, childInterp uintptr, childCmd uintptr, targetInterp uintptr, targetCmd uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:1223:1: */
	var childObjPtr uintptr
	var targetObjPtr uintptr
	var result int32

	childObjPtr = XTcl_NewStringObj(tls, childCmd, -1)
	(*Tcl_Obj)(unsafe.Pointer(childObjPtr)).FrefCount++

	targetObjPtr = XTcl_NewStringObj(tls, targetCmd, -1)
	(*Tcl_Obj)(unsafe.Pointer(targetObjPtr)).FrefCount++

	result = sAliasCreate(tls, childInterp, childInterp, targetInterp, childObjPtr,
		targetObjPtr, objc, objv)

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = childObjPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = targetObjPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_GetAlias --
//
//	Gets information about an alias.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetAlias(tls *libc.TLS, interp uintptr, aliasName uintptr, targetInterpPtr uintptr, targetNamePtr uintptr, argcPtr uintptr, argvPtr uintptr) int32 { /* tclInterp.c:1265:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var iiPtr uintptr = (*Interp)(unsafe.Pointer(interp)).FinterpInfo
	var hPtr uintptr
	var aliasPtr uintptr
	var i int32
	var objc int32
	var objv uintptr

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iiPtr + 96 /* &.child */ + 32 /* &.aliasTable */)).FfindProc})).f(tls, iiPtr+96 /* &.child */ +32 /* &.aliasTable */, aliasName)
	if hPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+42104, libc.VaList(bp, aliasName)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+41856, aliasName, uintptr(0)))
		return TCL_ERROR
	}
	aliasPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	objc = (*Alias)(unsafe.Pointer(aliasPtr)).Fobjc
	objv = aliasPtr + 48

	if targetInterpPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(targetInterpPtr)) = (*Alias)(unsafe.Pointer(aliasPtr)).FtargetInterp
	}
	if targetNamePtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(targetNamePtr)) = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
		}()
	}
	if argcPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(argcPtr)) = objc - 1
	}
	if argvPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(argvPtr)) = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(objc-1)))
		for i = 1; i < objc; i++ {
			*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argvPtr)) + uintptr(i-1)*8)) = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
			}()
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetAliasObj --
//
//	Object version: Gets information about an alias.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetAliasObj(tls *libc.TLS, interp uintptr, aliasName uintptr, targetInterpPtr uintptr, targetNamePtr uintptr, objcPtr uintptr, objvPtr uintptr) int32 { /* tclInterp.c:1327:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var iiPtr uintptr = (*Interp)(unsafe.Pointer(interp)).FinterpInfo
	var hPtr uintptr
	var aliasPtr uintptr
	var objc int32
	var objv uintptr

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iiPtr + 96 /* &.child */ + 32 /* &.aliasTable */)).FfindProc})).f(tls, iiPtr+96 /* &.child */ +32 /* &.aliasTable */, aliasName)
	if hPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+42104, libc.VaList(bp, aliasName)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+41856, aliasName, uintptr(0)))
		return TCL_ERROR
	}
	aliasPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	objc = (*Alias)(unsafe.Pointer(aliasPtr)).Fobjc
	objv = aliasPtr + 48

	if targetInterpPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(targetInterpPtr)) = (*Alias)(unsafe.Pointer(aliasPtr)).FtargetInterp
	}
	if targetNamePtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(targetNamePtr)) = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
		}()
	}
	if objcPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(objcPtr)) = objc - 1
	}
	if objvPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(objvPtr)) = objv + uintptr(1)*8
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclPreventAliasLoop --
//
//	When defining an alias or renaming a command, prevent an alias loop
//	from being formed.
//
// Results:
//	A standard Tcl object result.
//
// Side effects:
//	If TCL_ERROR is returned, the function also stores an error message in
//	the interpreter's result object.
//
// NOTE:
//	This function is public internal (instead of being static to this
//	file) because it is also used from TclRenameCommand.
//
//----------------------------------------------------------------------

func XTclPreventAliasLoop(tls *libc.TLS, interp uintptr, cmdInterp uintptr, cmd Tcl_Command) int32 { /* tclInterp.c:1391:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	var cmdPtr uintptr = cmd
	var aliasPtr uintptr
	var nextAliasPtr uintptr
	var aliasCmd Tcl_Command
	var aliasCmdPtr uintptr

	// If we are not creating or renaming an alias, then it is always OK to
	// create or rename the command.

	if (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sAliasObjCmd})) {
		return TCL_OK
	}

	// OK, we are dealing with an alias, so traverse the chain of aliases. If
	// we encounter the alias we are defining (or renaming to) any in the
	// chain then we have a loop.

	aliasPtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	nextAliasPtr = aliasPtr
	for 1 != 0 {
		var cmdNamePtr uintptr

		// If the target of the next alias in the chain is the same as the
		// source alias, we have a loop.

		if XTcl_InterpDeleted(tls, (*Alias)(unsafe.Pointer(nextAliasPtr)).FtargetInterp) != 0 {
			// The child interpreter can be deleted while creating the alias.
			// [Bug #641195]

			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+42125,
				libc.VaList(bp, XTcl_GetCommandName(tls, cmdInterp, cmd))))
			return TCL_ERROR
		}
		cmdNamePtr = (*Alias)(unsafe.Pointer(nextAliasPtr)).FobjPtr
		aliasCmd = XTcl_FindCommand(tls, (*Alias)(unsafe.Pointer(nextAliasPtr)).FtargetInterp,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(cmdNamePtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(cmdNamePtr)).Fbytes
				}
				return XTcl_GetString(tls, cmdNamePtr)
			}(),
			XTcl_GetGlobalNamespace(tls, (*Alias)(unsafe.Pointer(nextAliasPtr)).FtargetInterp),
			/*flags*/ 0)
		if aliasCmd == uintptr(0) {
			return TCL_OK
		}
		aliasCmdPtr = aliasCmd
		if aliasCmdPtr == cmdPtr {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+42181,
				libc.VaList(bp+8, XTcl_GetCommandName(tls, cmdInterp, cmd))))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+7420, ts+41573,
				ts+42237, uintptr(0)))
			return TCL_ERROR
		}

		// Otherwise, follow the chain one step further. See if the target
		// command is an alias - if so, follow the loop to its target command.
		// Otherwise we do not have a loop.

		if (*Command)(unsafe.Pointer(aliasCmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sAliasObjCmd})) {
			return TCL_OK
		}
		nextAliasPtr = (*Command)(unsafe.Pointer(aliasCmdPtr)).FobjClientData
	}
	return int32(0)

	// NOTREACHED
}

//----------------------------------------------------------------------
//
// AliasCreate --
//
//	Helper function to do the work to actually create an alias.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	An alias command is created and entered into the alias table for the
//	child interpreter.
//
//----------------------------------------------------------------------

func sAliasCreate(tls *libc.TLS, interp uintptr, childInterp uintptr, parentInterp uintptr, namePtr uintptr, targetNamePtr uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:1489:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var aliasPtr uintptr
	var hPtr uintptr
	var targetPtr uintptr
	var childPtr uintptr
	var parentPtr uintptr
	var prefv uintptr
	// var isNew int32 at bp, 4

	var i int32

	aliasPtr = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(Alias{}))+uint64(objc)*uint64(unsafe.Sizeof(uintptr(0)))))
	(*Alias)(unsafe.Pointer(aliasPtr)).Ftoken = namePtr
	(*Tcl_Obj)(unsafe.Pointer((*Alias)(unsafe.Pointer(aliasPtr)).Ftoken)).FrefCount++
	(*Alias)(unsafe.Pointer(aliasPtr)).FtargetInterp = parentInterp

	(*Alias)(unsafe.Pointer(aliasPtr)).Fobjc = objc + 1
	prefv = aliasPtr + 48

	*(*uintptr)(unsafe.Pointer(prefv)) = targetNamePtr
	(*Tcl_Obj)(unsafe.Pointer(targetNamePtr)).FrefCount++
	for i = 0; i < objc; i++ {
		*(*uintptr)(unsafe.Pointer(libc.PreIncUintptr(&prefv, 8))) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FrefCount++
	}

	XTcl_Preserve(tls, childInterp)
	XTcl_Preserve(tls, parentInterp)

	if childInterp == parentInterp {
		(*Alias)(unsafe.Pointer(aliasPtr)).FchildCmd = XTcl_NRCreateCommand(tls, childInterp,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes
				}
				return XTcl_GetString(tls, namePtr)
			}(), *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
			}{sAliasObjCmd})), *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
			}{sAliasNRCmd})), aliasPtr,
			*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sAliasObjCmdDeleteProc})))
	} else {
		(*Alias)(unsafe.Pointer(aliasPtr)).FchildCmd = XTcl_CreateObjCommand(tls, childInterp,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes
				}
				return XTcl_GetString(tls, namePtr)
			}(), *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
			}{sAliasObjCmd})), aliasPtr,
			*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sAliasObjCmdDeleteProc})))
	}

	if XTclPreventAliasLoop(tls, interp, childInterp,
		(*Alias)(unsafe.Pointer(aliasPtr)).FchildCmd) != TCL_OK {
		// Found an alias loop! The last call to Tcl_CreateObjCommand made the
		// alias point to itself. Delete the command and its alias record. Be
		// careful to wipe out its client data first, so the command doesn't
		// try to delete itself.

		var cmdPtr uintptr

		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Alias)(unsafe.Pointer(aliasPtr)).Ftoken
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = targetNamePtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for i = 0; i < objc; i++ {
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}

		cmdPtr = (*Alias)(unsafe.Pointer(aliasPtr)).FchildCmd
		(*Command)(unsafe.Pointer(cmdPtr)).FclientData = uintptr(0)
		(*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc = uintptr(0)
		(*Command)(unsafe.Pointer(cmdPtr)).FdeleteData = uintptr(0)
		XTcl_DeleteCommandFromToken(tls, childInterp, (*Alias)(unsafe.Pointer(aliasPtr)).FchildCmd)

		XTclpFree(tls, aliasPtr)

		// The result was already set by TclPreventAliasLoop.

		XTcl_Release(tls, childInterp)
		XTcl_Release(tls, parentInterp)
		return TCL_ERROR
	}

	// Make an entry in the alias table. If it already exists, retry.

	childPtr = (*Interp)(unsafe.Pointer(childInterp)).FinterpInfo + 96
	for 1 != 0 {
		var newToken uintptr
		var string uintptr

		string = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer((*Alias)(unsafe.Pointer(aliasPtr)).Ftoken)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer((*Alias)(unsafe.Pointer(aliasPtr)).Ftoken)).Fbytes
			}
			return XTcl_GetString(tls, (*Alias)(unsafe.Pointer(aliasPtr)).Ftoken)
		}()
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(childPtr + 32 /* &.aliasTable */)).FcreateProc})).f(tls, childPtr+32 /* &.aliasTable */, string, bp /* &isNew */)
		if *(*int32)(unsafe.Pointer(bp)) != 0 {
			break
		}

		// The alias name cannot be used as unique token, it is already taken.
		// We can produce a unique token by prepending "::" repeatedly. This
		// algorithm is a stop-gap to try to maintain the command name as
		// token for most use cases, fearful of possible backwards compat
		// problems. A better algorithm would produce unique tokens that need
		// not be related to the command name.
		//
		// ATTENTION: the tests in interp.test and possibly safe.test depend
		// on the precise definition of these tokens.

		for ok3 := true; ok3; ok3 = 0 != 0 {
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					newToken = XTclThreadAllocObj(tls)
				} else {
					newToken = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(newToken + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(newToken)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(newToken)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(newToken)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(newToken)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(newToken)).Fbytes, ts+6847, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(newToken)).Fbytes + 2)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(newToken)).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(newToken)).FtypePtr = uintptr(0)
			{
			}
		}
		XTcl_AppendObjToObj(tls, newToken, (*Alias)(unsafe.Pointer(aliasPtr)).Ftoken)
		for ok5 := true; ok5; ok5 = 0 != 0 {
			var _objPtr uintptr = (*Alias)(unsafe.Pointer(aliasPtr)).Ftoken
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Alias)(unsafe.Pointer(aliasPtr)).Ftoken = newToken
		(*Tcl_Obj)(unsafe.Pointer((*Alias)(unsafe.Pointer(aliasPtr)).Ftoken)).FrefCount++
	}

	(*Alias)(unsafe.Pointer(aliasPtr)).FaliasEntryPtr = hPtr
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = aliasPtr

	// Create the new command. We must do it after deleting any old command,
	// because the alias may be pointing at a renamed alias, as in:
	//
	// interp alias {} foo {} bar		# Create an alias "foo"
	// rename foo zop				# Now rename the alias
	// interp alias {} foo {} zop		# Now recreate "foo"...

	targetPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Target{})))
	(*Target)(unsafe.Pointer(targetPtr)).FchildCmd = (*Alias)(unsafe.Pointer(aliasPtr)).FchildCmd
	(*Target)(unsafe.Pointer(targetPtr)).FchildInterp = childInterp

	parentPtr = (*Interp)(unsafe.Pointer(parentInterp)).FinterpInfo
	(*Target)(unsafe.Pointer(targetPtr)).FnextPtr = (*Parent)(unsafe.Pointer(parentPtr)).FtargetsPtr
	(*Target)(unsafe.Pointer(targetPtr)).FprevPtr = uintptr(0)
	if (*Parent)(unsafe.Pointer(parentPtr)).FtargetsPtr != uintptr(0) {
		(*Target)(unsafe.Pointer((*Parent)(unsafe.Pointer(parentPtr)).FtargetsPtr)).FprevPtr = targetPtr
	}
	(*Parent)(unsafe.Pointer(parentPtr)).FtargetsPtr = targetPtr
	(*Alias)(unsafe.Pointer(aliasPtr)).FtargetPtr = targetPtr

	XTcl_SetObjResult(tls, interp, (*Alias)(unsafe.Pointer(aliasPtr)).Ftoken)

	XTcl_Release(tls, childInterp)
	XTcl_Release(tls, parentInterp)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// AliasDelete --
//
//	Deletes the given alias from the child interpreter given.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Deletes the alias from the child interpreter.
//
//----------------------------------------------------------------------

func sAliasDelete(tls *libc.TLS, interp uintptr, childInterp uintptr, namePtr uintptr) int32 { /* tclInterp.c:1653:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var childPtr uintptr
	var aliasPtr uintptr
	var hPtr uintptr

	// If the alias has been renamed in the child, the parent can still use
	// the original name (with which it was created) to find the alias to
	// delete it.

	childPtr = (*Interp)(unsafe.Pointer(childInterp)).FinterpInfo + 96
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(childPtr + 32 /* &.aliasTable */)).FfindProc})).f(tls, childPtr+32 /* &.aliasTable */, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes
		}
		return XTcl_GetString(tls, namePtr)
	}())
	if hPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+42104, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes
				}
				return XTcl_GetString(tls, namePtr)
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+41856,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes
				}
				return XTcl_GetString(tls, namePtr)
			}(), uintptr(0)))
		return TCL_ERROR
	}
	aliasPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	XTcl_DeleteCommandFromToken(tls, childInterp, (*Alias)(unsafe.Pointer(aliasPtr)).FchildCmd)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// AliasDescribe --
//
//	Sets the interpreter's result object to a Tcl list describing the
//	given alias in the given interpreter: its target command and the
//	additional arguments to prepend to any invocation of the alias.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sAliasDescribe(tls *libc.TLS, interp uintptr, childInterp uintptr, namePtr uintptr) int32 { /* tclInterp.c:1701:1: */
	var childPtr uintptr
	var hPtr uintptr
	var aliasPtr uintptr
	var prefixPtr uintptr

	// If the alias has been renamed in the child, the parent can still use
	// the original name (with which it was created) to find the alias to
	// describe it.

	childPtr = (*Interp)(unsafe.Pointer(childInterp)).FinterpInfo + 96
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(childPtr + 32 /* &.aliasTable */)).FfindProc})).f(tls, childPtr+32 /* &.aliasTable */, XTcl_GetString(tls, namePtr))
	if hPtr == uintptr(0) {
		return TCL_OK
	}
	aliasPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	prefixPtr = XTcl_NewListObj(tls, (*Alias)(unsafe.Pointer(aliasPtr)).Fobjc, aliasPtr+48)
	XTcl_SetObjResult(tls, interp, prefixPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// AliasList --
//
//	Computes a list of aliases defined in a child interpreter.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sAliasList(tls *libc.TLS, interp uintptr, childInterp uintptr) int32 { /* tclInterp.c:1745:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var entryPtr uintptr
	// var hashSearch Tcl_HashSearch at bp, 24

	var resultPtr uintptr = XTcl_NewObj(tls)
	var aliasPtr uintptr
	var childPtr uintptr

	childPtr = (*Interp)(unsafe.Pointer(childInterp)).FinterpInfo + 96

	entryPtr = XTcl_FirstHashEntry(tls, childPtr+32, bp)
	for ; entryPtr != uintptr(0); entryPtr = XTcl_NextHashEntry(tls, bp) {
		aliasPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
		XTcl_ListObjAppendElement(tls, uintptr(0), resultPtr, (*Alias)(unsafe.Pointer(aliasPtr)).Ftoken)
	}
	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// AliasObjCmd --
//
//	This is the function that services invocations of aliases in a child
//	interpreter. One such command exists for each alias. When invoked,
//	this function redirects the invocation to the target command in the
//	parent interpreter as designated by the Alias record associated with
//	this command.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Causes forwarding of the invocation; all possible side effects may
//	occur as a result of invoking the command to which the invocation is
//	forwarded.
//
//----------------------------------------------------------------------

func sAliasNRCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:1789:1: */
	var aliasPtr uintptr = clientData
	var prefc int32
	var cmdc int32
	var i int32
	var prefv uintptr
	var cmdv uintptr
	var listPtr uintptr
	var listRep uintptr
	var flags int32 = TCL_EVAL_INVOKE

	// Append the arguments to the command prefix and invoke the command in
	// the target interp's global namespace.

	prefc = (*Alias)(unsafe.Pointer(aliasPtr)).Fobjc
	prefv = aliasPtr + 48
	cmdc = prefc + objc - 1

	listPtr = XTcl_NewListObj(tls, cmdc, uintptr(0))
	listRep = *(*uintptr)(unsafe.Pointer(listPtr + 32))
	(*List)(unsafe.Pointer(listRep)).FelemCount = cmdc
	cmdv = listRep + 16

	prefv = aliasPtr + 48
	libc.Xmemcpy(tls, cmdv, prefv, uint64(prefc)*uint64(unsafe.Sizeof(uintptr(0))))
	libc.Xmemcpy(tls, cmdv+uintptr(prefc)*8, objv+uintptr(1)*8, uint64(objc-1)*uint64(unsafe.Sizeof(uintptr(0))))

	for i = 0; i < cmdc; i++ {
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cmdv + uintptr(i)*8)))).FrefCount++
	}

	// Use the ensemble rewriting machinery to ensure correct error messages:
	// only the source command should show, not the full target prefix.

	if XTclInitRewriteEnsemble(tls, interp, 1, prefc, objv) != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{XTclClearRootEnsemble}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	}
	XTclSkipTailcall(tls, interp)
	return XTcl_NREvalObj(tls, interp, listPtr, flags)
}

func sAliasObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:1837:1: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	var aliasPtr uintptr = clientData
	var targetInterp uintptr = (*Alias)(unsafe.Pointer(aliasPtr)).FtargetInterp
	var result int32
	var prefc int32
	var cmdc int32
	var i int32
	var prefv uintptr
	var cmdv uintptr
	// var cmdArr [10]uintptr at bp, 80

	var tPtr uintptr = targetInterp
	var isRootEnsemble int32

	// Append the arguments to the command prefix and invoke the command in
	// the target interp's global namespace.

	prefc = (*Alias)(unsafe.Pointer(aliasPtr)).Fobjc
	prefv = aliasPtr + 48
	cmdc = prefc + objc - 1
	if cmdc <= 10 {
		cmdv = bp /* &cmdArr[0] */
	} else {
		cmdv = XTclStackAlloc(tls, interp, int32(uint64(cmdc)*uint64(unsafe.Sizeof(uintptr(0)))))
	}

	libc.Xmemcpy(tls, cmdv, prefv, uint64(prefc)*uint64(unsafe.Sizeof(uintptr(0))))
	libc.Xmemcpy(tls, cmdv+uintptr(prefc)*8, objv+uintptr(1)*8, uint64(objc-1)*uint64(unsafe.Sizeof(uintptr(0))))

	XTcl_ResetResult(tls, targetInterp)

	for i = 0; i < cmdc; i++ {
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cmdv + uintptr(i)*8)))).FrefCount++
	}

	// Use the ensemble rewriting machinery to ensure correct error messages:
	// only the source command should show, not the full target prefix.

	isRootEnsemble = XTclInitRewriteEnsemble(tls, tPtr, 1, prefc, objv)

	// Protect the target interpreter if it isn't the same as the source
	// interpreter so that we can continue to work with it after the target
	// command completes.

	if targetInterp != interp {
		XTcl_Preserve(tls, targetInterp)
	}

	// Execute the target command in the target interpreter.

	result = XTcl_EvalObjv(tls, targetInterp, cmdc, cmdv, TCL_EVAL_INVOKE)

	// Clean up the ensemble rewrite info if we set it in the first place.

	if isRootEnsemble != 0 {
		XTclResetRewriteEnsemble(tls, tPtr, 1)
	}

	// If it was a cross-interpreter alias, we need to transfer the result
	// back to the source interpreter and release the lock we previously set
	// on the target interpreter.

	if targetInterp != interp {
		XTcl_TransferResult(tls, targetInterp, result, interp)
		XTcl_Release(tls, targetInterp)
	}

	for i = 0; i < cmdc; i++ {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(cmdv + uintptr(i)*8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if cmdv != bp {
		XTclStackFree(tls, interp, cmdv)
	}
	return result
}

//----------------------------------------------------------------------
//
// AliasObjCmdDeleteProc --
//
//	Is invoked when an alias command is deleted in a child. Cleans up all
//	storage associated with this alias.
//
// Results:
//	None.
//
// Side effects:
//	Deletes the alias record and its entry in the alias table for the
//	interpreter.
//
//----------------------------------------------------------------------

func sAliasObjCmdDeleteProc(tls *libc.TLS, clientData ClientData) { /* tclInterp.c:1946:1: */
	var aliasPtr uintptr = clientData
	var targetPtr uintptr
	var i int32
	var objv uintptr

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = (*Alias)(unsafe.Pointer(aliasPtr)).Ftoken
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	objv = aliasPtr + 48
	for i = 0; i < (*Alias)(unsafe.Pointer(aliasPtr)).Fobjc; i++ {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	XTcl_DeleteHashEntry(tls, (*Alias)(unsafe.Pointer(aliasPtr)).FaliasEntryPtr)

	// Splice the target record out of the target interpreter's parent list.

	targetPtr = (*Alias)(unsafe.Pointer(aliasPtr)).FtargetPtr
	if (*Target)(unsafe.Pointer(targetPtr)).FprevPtr != uintptr(0) {
		(*Target1)(unsafe.Pointer((*Target)(unsafe.Pointer(targetPtr)).FprevPtr)).FnextPtr = (*Target)(unsafe.Pointer(targetPtr)).FnextPtr
	} else {
		var parentPtr uintptr = (*Interp)(unsafe.Pointer((*Alias)(unsafe.Pointer(aliasPtr)).FtargetInterp)).FinterpInfo

		(*Parent)(unsafe.Pointer(parentPtr)).FtargetsPtr = (*Target)(unsafe.Pointer(targetPtr)).FnextPtr
	}
	if (*Target)(unsafe.Pointer(targetPtr)).FnextPtr != uintptr(0) {
		(*Target1)(unsafe.Pointer((*Target)(unsafe.Pointer(targetPtr)).FnextPtr)).FprevPtr = (*Target)(unsafe.Pointer(targetPtr)).FprevPtr
	}

	XTclpFree(tls, targetPtr)
	XTclpFree(tls, aliasPtr)
}

//----------------------------------------------------------------------
//
// Tcl_CreateChild --
//
//	Creates a child interpreter. The childPath argument denotes the name
//	of the new child relative to the current interpreter; the child is a
//	direct descendant of the one-before-last component of the path,
//	e.g. it is a descendant of the current interpreter if the childPath
//	argument contains only one component. Optionally makes the child
//	interpreter safe.
//
// Results:
//	Returns the interpreter structure created, or NULL if an error
//	occurred.
//
// Side effects:
//	Creates a new interpreter and a new interpreter object command in the
//	interpreter indicated by the childPath argument.
//
//----------------------------------------------------------------------

func XTcl_CreateSlave(tls *libc.TLS, interp uintptr, childPath uintptr, isSafe int32) uintptr { /* tclInterp.c:2005:12: */
	var pathPtr uintptr
	var childInterp uintptr

	pathPtr = XTcl_NewStringObj(tls, childPath, -1)
	childInterp = sChildCreate(tls, interp, pathPtr, isSafe)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = pathPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	return childInterp
}

//----------------------------------------------------------------------
//
// Tcl_GetChild --
//
//	Finds a child interpreter by its path name.
//
// Results:
//	Returns a Tcl_Interp * for the named interpreter or NULL if not found.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetSlave(tls *libc.TLS, interp uintptr, childPath uintptr) uintptr { /* tclInterp.c:2037:12: */
	var pathPtr uintptr
	var childInterp uintptr

	pathPtr = XTcl_NewStringObj(tls, childPath, -1)
	childInterp = sGetInterp(tls, interp, pathPtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = pathPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	return childInterp
}

//----------------------------------------------------------------------
//
// Tcl_GetParent --
//
//	Finds the parent interpreter of a child interpreter.
//
// Results:
//	Returns a Tcl_Interp * for the parent interpreter or NULL if none.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetMaster(tls *libc.TLS, interp uintptr) uintptr { /* tclInterp.c:2068:12: */
	var childPtr uintptr // Child record of this interpreter.

	if interp == uintptr(0) {
		return uintptr(0)
	}
	childPtr = (*Interp)(unsafe.Pointer(interp)).FinterpInfo + 96
	return (*Child)(unsafe.Pointer(childPtr)).FparentInterp
}

//----------------------------------------------------------------------
//
// TclSetChildCancelFlags --
//
//	This function marks all child interpreters belonging to a given
//	interpreter as being canceled or not canceled, depending on the
//	provided flags.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclSetSlaveCancelFlags(tls *libc.TLS, interp uintptr, flags int32, force int32) { /* tclInterp.c:2100:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var parentPtr uintptr // Parent record of given interpreter.
	var hPtr uintptr      // Search element.
	// var hashSearch Tcl_HashSearch at bp, 24
	// Search variable.
	var childPtr uintptr // Child record of interpreter.
	var iPtr uintptr

	if interp == uintptr(0) {
		return
	}

	flags = flags & (CANCELED | TCL_CANCEL_UNWIND)

	parentPtr = (*Interp)(unsafe.Pointer(interp)).FinterpInfo

	hPtr = XTcl_FirstHashEntry(tls, parentPtr, bp)
	for ; hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
		childPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		iPtr = (*Child)(unsafe.Pointer(childPtr)).FchildInterp

		if iPtr == uintptr(0) {
			continue
		}

		if flags == 0 {
			XTclResetCancellation(tls, iPtr, force)
		} else {
			*(*int32)(unsafe.Pointer(iPtr + 424)) |= CANCELED
			if flags&TCL_CANCEL_UNWIND != 0 {
				*(*int32)(unsafe.Pointer(iPtr + 424)) |= TCL_CANCEL_UNWIND
			}

		}

		// Now, recursively handle this for the children of this child
		// interpreter.

		XTclSetSlaveCancelFlags(tls, iPtr, flags, force)
	}
}

//----------------------------------------------------------------------
//
// Tcl_GetInterpPath --
//
//	Sets the result of the asking interpreter to a proper Tcl list
//	containing the names of interpreters between the asking and target
//	interpreters. The target interpreter must be either the same as the
//	asking interpreter or one of its children (including recursively).
//
// Results:
//	TCL_OK if the target interpreter is the same as, or a descendant of,
//	the asking interpreter; TCL_ERROR else. This way one can distinguish
//	between the case where the asking and target interps are the same (an
//	empty list is the result, and TCL_OK is returned) and when the target
//	is not a descendant of the asking interpreter (in which case the Tcl
//	result is an error message and the function returns TCL_ERROR).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetInterpPath(tls *libc.TLS, interp uintptr, targetInterp uintptr) int32 { /* tclInterp.c:2172:1: */
	var iiPtr uintptr

	if targetInterp == interp {
		XTcl_SetObjResult(tls, interp, XTcl_NewObj(tls))
		return TCL_OK
	}
	if targetInterp == uintptr(0) {
		return TCL_ERROR
	}
	iiPtr = (*Interp)(unsafe.Pointer(targetInterp)).FinterpInfo
	if XTcl_GetInterpPath(tls, interp, (*InterpInfo)(unsafe.Pointer(iiPtr)).Fchild.FparentInterp) != TCL_OK {
		return TCL_ERROR
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), XTcl_GetObjResult(tls, interp),
		XTcl_NewStringObj(tls, func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(iiPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(iiPtr)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer((*InterpInfo)(unsafe.Pointer(iiPtr)).Fchild.FchildEntryPtr + 32))
			}
			return (*InterpInfo)(unsafe.Pointer(iiPtr)).Fchild.FchildEntryPtr + 32
		}(), -1))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// GetInterp --
//
//	Helper function to find a child interpreter given a pathname.
//
// Results:
//	Returns the child interpreter known by that name in the calling
//	interpreter, or NULL if no interpreter known by that name exists.
//
// Side effects:
//	Assigns to the pointer variable passed in, if not NULL.
//
//----------------------------------------------------------------------

func sGetInterp(tls *libc.TLS, interp uintptr, pathPtr uintptr) uintptr { /* tclInterp.c:2212:19: */
	bp := tls.Alloc(60)
	defer tls.Free(60)

	var hPtr uintptr     // Search element.
	var childPtr uintptr // Interim child record.
	// var objv uintptr at bp+48, 8

	// var objc int32 at bp+56, 4

	var i int32
	var searchInterp uintptr // Interim storage for interp. to find.
	var parentInfoPtr uintptr

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 48)) = *(*uintptr)(unsafe.Pointer(pathPtr + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 56)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, pathPtr, bp+56, bp+48)
	}() != TCL_OK {
		return uintptr(0)
	}

	searchInterp = interp
	for i = 0; i < *(*int32)(unsafe.Pointer(bp + 56 /* objc */)); i++ {
		parentInfoPtr = (*Interp)(unsafe.Pointer(searchInterp)).FinterpInfo
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(parentInfoPtr /* &.parent */ /* &.childTable */)).FfindProc})).f(tls, parentInfoPtr /* &.parent */ /* &.childTable */, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* objv */)) + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* objv */)) + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* objv */)) + uintptr(i)*8)))
		}())
		if hPtr == uintptr(0) {
			searchInterp = uintptr(0)
			break
		}
		childPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		searchInterp = (*Child)(unsafe.Pointer(childPtr)).FchildInterp
		if searchInterp == uintptr(0) {
			break
		}
	}
	if searchInterp == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+42247, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
				}
				return XTcl_GetString(tls, pathPtr)
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+41573,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
				}
				return XTcl_GetString(tls, pathPtr)
			}(), uintptr(0)))
	}
	return searchInterp
}

//----------------------------------------------------------------------
//
// ChildBgerror --
//
//	Helper function to set/query the background error handling command
//	prefix of an interp
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	When (objc == 1), childInterp will be set to a new background handler
//	of objv[0].
//
//----------------------------------------------------------------------

func sChildBgerror(tls *libc.TLS, interp uintptr, childInterp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:2272:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	if objc != 0 {
		// var length int32 at bp+40, 4

		if TCL_ERROR == func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 40)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32)))).FelemCount
					return TCL_OK
				}()
			}
			return XTcl_ListObjLength(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv)), bp+40)
		}() ||
			*(*int32)(unsafe.Pointer(bp + 40)) < 1 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+42279, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+41573,
				ts+42317, uintptr(0)))
			return TCL_ERROR
		}
		XTclSetBgErrorHandler(tls, childInterp, *(*uintptr)(unsafe.Pointer(objv)))
	}
	XTcl_SetObjResult(tls, interp, XTclGetBgErrorHandler(tls, childInterp))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ChildCreate --
//
//	Helper function to do the actual work of creating a child interp and
//	new object command. Also optionally makes the new child interpreter
//	"safe".
//
// Results:
//	Returns the new Tcl_Interp * if successful or NULL if not. If failed,
//	the result of the invoking interpreter contains an error message.
//
// Side effects:
//	Creates a new child interpreter and a new object command.
//
//----------------------------------------------------------------------

func sChildCreate(tls *libc.TLS, interp uintptr, pathPtr uintptr, safe int32) uintptr { /* tclInterp.c:2314:19: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var parentInterp uintptr
	var childInterp uintptr
	var childPtr uintptr
	var parentInfoPtr uintptr
	var hPtr uintptr
	var path uintptr
	// var isNew int32 at bp+24, 4

	// var objc int32 at bp+8, 4

	// var objv uintptr at bp+16, 8

	var _objPtr uintptr
	var objPtr uintptr
	var cachePtr uintptr
	var _objPtr1 uintptr
	var clockObj uintptr
	var status int32

	if !(XTcl_ListObjGetElements(tls, interp, pathPtr, bp+8, bp+16) != TCL_OK) {
		goto __1
	}
	return uintptr(0)
__1:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 8)) < 2) {
		goto __2
	}
	parentInterp = interp
	path = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
		}
		return XTcl_GetString(tls, pathPtr)
	}()
	goto __3
__2:

	objPtr = XTcl_NewListObj(tls, *(*int32)(unsafe.Pointer(bp + 8))-1, *(*uintptr)(unsafe.Pointer(bp + 16 /* objv */)))
	parentInterp = sGetInterp(tls, interp, objPtr)
__4:
	_objPtr = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __7
	}
	XTclFreeObj(tls, _objPtr)
__7:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;
	if !(parentInterp == uintptr(0)) {
		goto __8
	}
	return uintptr(0)
__8:
	;
	path = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(*(*int32)(unsafe.Pointer(bp + 8))-1)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(*(*int32)(unsafe.Pointer(bp + 8))-1)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(*(*int32)(unsafe.Pointer(bp + 8))-1)*8)))
	}()
__3:
	;
	if !(safe == 0) {
		goto __9
	}
	safe = XTcl_IsSafe(tls, parentInterp)
__9:
	;

	parentInfoPtr = (*Interp)(unsafe.Pointer(parentInterp)).FinterpInfo
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(parentInfoPtr /* &.parent */ /* &.childTable */)).FcreateProc})).f(tls, parentInfoPtr /* &.parent */ /* &.childTable */, path, bp+24 /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp + 24)) == 0) {
		goto __10
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+42331,
		libc.VaList(bp, path)))
	return uintptr(0)
__10:
	;

	childInterp = XTcl_CreateInterp(tls)
	childPtr = (*Interp)(unsafe.Pointer(childInterp)).FinterpInfo + 96
	(*Child)(unsafe.Pointer(childPtr)).FparentInterp = parentInterp
	(*Child)(unsafe.Pointer(childPtr)).FchildEntryPtr = hPtr
	(*Child)(unsafe.Pointer(childPtr)).FchildInterp = childInterp
	(*Child)(unsafe.Pointer(childPtr)).FinterpCmd = XTcl_NRCreateCommand(tls, parentInterp, path,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sChildObjCmd})), *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sNRChildCmd})), childInterp, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sChildObjCmdDeleteProc})))
	XTcl_InitHashTable(tls, childPtr+32, 0)
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = childPtr
	XTcl_SetVar2(tls, childInterp, ts+42384, uintptr(0), ts+18333, TCL_GLOBAL_ONLY)

	// Inherit the recursion limit.

	(*Interp)(unsafe.Pointer(childInterp)).FmaxNestingDepth = (*Interp)(unsafe.Pointer(parentInterp)).FmaxNestingDepth

	if !(safe != 0) {
		goto __11
	}
	if !(XTcl_MakeSafe(tls, childInterp) == TCL_ERROR) {
		goto __13
	}
	goto error
__13:
	;
	goto __12
__11:
	if !(XTcl_Init(tls, childInterp) == TCL_ERROR) {
		goto __14
	}
	goto error
__14:
	;

	// This will create the "memory" command in child interpreters if we
	// compiled with TCL_MEM_DEBUG, otherwise it does nothing.

__12:
	;

	// Inherit the TIP#143 limits.

	sInheritLimitsFromParent(tls, childInterp, parentInterp)

	// The [clock] command presents a safe API, but uses unsafe features in
	// its implementation. This means it has to be implemented in safe interps
	// as an alias to a version in the (trusted) parent.

	if !(safe != 0) {
		goto __15
	}

__16:
	;
__19:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __22
	}
	clockObj = XTclThreadAllocObj(tls)
	goto __23
__22:
	clockObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(clockObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__23:
	;
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
	(*Tcl_Obj)(unsafe.Pointer(clockObj)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0) {
		goto __24
	}
	(*Tcl_Obj)(unsafe.Pointer(clockObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(clockObj)).Flength = 0
	goto __25
__24:
	(*Tcl_Obj)(unsafe.Pointer(clockObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(clockObj)).Fbytes, ts+10815, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(clockObj)).Fbytes + 5)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(clockObj)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
__25:
	;
	(*Tcl_Obj)(unsafe.Pointer(clockObj)).FtypePtr = uintptr(0)

	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	(*Tcl_Obj)(unsafe.Pointer(clockObj)).FrefCount++
	status = sAliasCreate(tls, interp, childInterp, parentInterp, clockObj,
		clockObj, 0, uintptr(0))
__26:
	_objPtr1 = clockObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __29
	}
	XTclFreeObj(tls, _objPtr1)
__29:
	;
	goto __27
__27:
	if 0 != 0 {
		goto __26
	}
	goto __28
__28:
	;
	if !(status != TCL_OK) {
		goto __30
	}
	goto error2
__30:
	;
__15:
	;

	return childInterp

error:
	XTcl_TransferResult(tls, childInterp, TCL_ERROR, interp)
error2:
	XTcl_DeleteInterp(tls, childInterp)

	return uintptr(0)
}

//----------------------------------------------------------------------
//
// ChildObjCmd --
//
//	Command to manipulate an interpreter, e.g. to send commands to it to
//	be evaluated. One such command exists for each child interpreter.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See user documentation for details.
//
//----------------------------------------------------------------------

func sChildObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:2448:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNRChildCmd})), clientData, objc, objv)
}

func sNRChildCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:2458:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var childInterp uintptr = clientData
	// var index int32 at bp, 4

	if childInterp == uintptr(0) {
		XTcl_Panic(tls, ts+42400, 0)
	}

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+41371)
		return TCL_ERROR
	}
	if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&options12)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp) != TCL_OK {
		return TCL_ERROR
	}

	switch uint32(*(*int32)(unsafe.Pointer(bp /* index */))) {
	case uint32(0) /* OPT_ALIAS */ :
		if objc > 2 {
			if objc == 3 {
				return sAliasDescribe(tls, interp, childInterp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
			}
			if int32(*(*int8)(unsafe.Pointer(func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
			}()))) == 0 {
				if objc == 4 {
					return sAliasDelete(tls, interp, childInterp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
				}
			} else {
				return sAliasCreate(tls, interp, childInterp, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)),
					*(*uintptr)(unsafe.Pointer(objv + 3*8)), objc-4, objv+uintptr(4)*8)
			}
		}
		XTcl_WrongNumArgs(tls, interp, 2, objv, ts+42442)
		return TCL_ERROR
	case uint32(1) /* OPT_ALIASES */ :
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}
		return sAliasList(tls, interp, childInterp)
	case uint32(2) /* OPT_BGERROR */ :
		if objc != 2 && objc != 3 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, ts+42475)
			return TCL_ERROR
		}
		return sChildBgerror(tls, interp, childInterp, objc-2, objv+uintptr(2)*8)
	case uint32(3) /* OPT_DEBUG */ :
		// TIP #378
		// Currently only -frame supported, otherwise ?-option ?value? ...?
		if objc > 4 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, ts+42487)
			return TCL_ERROR
		}
		return sChildDebugCmd(tls, interp, childInterp, objc-2, objv+uintptr(2)*8)
	case uint32(4) /* OPT_EVAL */ :
		if objc < 3 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12083)
			return TCL_ERROR
		}
		return sChildEval(tls, interp, childInterp, objc-2, objv+uintptr(2)*8)
	case uint32(5) /* OPT_EXPOSE */ :
		if objc < 3 || objc > 4 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, ts+42503)
			return TCL_ERROR
		}
		return sChildExpose(tls, interp, childInterp, objc-2, objv+uintptr(2)*8)
	case uint32(6) /* OPT_HIDE */ :
		if objc < 3 || objc > 4 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, ts+42527)
			return TCL_ERROR
		}
		return sChildHide(tls, interp, childInterp, objc-2, objv+uintptr(2)*8)
	case uint32(7) /* OPT_HIDDEN */ :
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}
		return sChildHidden(tls, interp, childInterp)
	case uint32(8) /* OPT_ISSAFE */ :
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}
		XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(XTcl_IsSafe(tls, childInterp) != 0)))
		return TCL_OK
	case uint32(9) /* OPT_INVOKEHIDDEN */ :
		{
			var i int32
			var namespaceName uintptr

			namespaceName = uintptr(0)
			for i = 2; i < objc; i++ {
				if int32(*(*int8)(unsafe.Pointer(func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
				}()))) != '-' {
					break
				}
				if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&hiddenOptions1)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp) != TCL_OK {
					return TCL_ERROR
				}
				if *(*int32)(unsafe.Pointer(bp)) == 0 {
					namespaceName = ts + 6847 /* "::" */
				} else if *(*int32)(unsafe.Pointer(bp)) == 1 {
					if libc.PreIncInt32(&i, 1) == objc { // There must be more arguments.
						break
					} else {
						namespaceName = func() uintptr {
							if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
								return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
							}
							return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
						}()
					}
				} else {
					i++
					break
				}
			}
			if objc-i < 1 {
				XTcl_WrongNumArgs(tls, interp, 2, objv,
					ts+42551)
				return TCL_ERROR
			}
			return sChildInvokeHidden(tls, interp, childInterp, namespaceName,
				objc-i, objv+uintptr(i)*8)

		}
	case uint32(10) /* OPT_LIMIT */ :
		{
			// var limitType int32 at bp+4, 4

			if objc < 3 {
				XTcl_WrongNumArgs(tls, interp, 2, objv, ts+42595)
				return TCL_ERROR
			}
			if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&limitTypes1)), int32(unsafe.Sizeof(uintptr(0))), ts+41752, 0, bp+4) != TCL_OK {
				return TCL_ERROR
			}
			switch uint32(*(*int32)(unsafe.Pointer(bp + 4 /* limitType */))) {
			case uint32(0) /* LIMIT_TYPE_COMMANDS */ :
				return sChildCommandLimitCmd(tls, interp, childInterp, 3, objc, objv)
			case uint32(1) /* LIMIT_TYPE_TIME */ :
				return sChildTimeLimitCmd(tls, interp, childInterp, 3, objc, objv)
			}

		}
		break
	case uint32(11) /* OPT_MARKTRUSTED */ :
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}
		return sChildMarkTrusted(tls, interp, childInterp)
	case uint32(12) /* OPT_RECLIMIT */ :
		if objc != 2 && objc != 3 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, ts+42625)
			return TCL_ERROR
		}
		return sChildRecursionLimit(tls, interp, childInterp, objc-2, objv+uintptr(2)*8)
	}

	return TCL_ERROR
}

var options12 = [14]uintptr{
	ts + 41945, ts + 41951, ts + 27390, ts + 41975,
	ts + 2409, ts + 41981, ts + 41988, ts + 31212,
	ts + 41993, ts + 42000, ts + 42013, ts + 42019,
	ts + 42031, uintptr(0),
} /* tclInterp.c:2466:23 */
var hiddenOptions1 = [4]uintptr{
	ts + 42089, ts + 26167, ts + 15828, uintptr(0),
} /* tclInterp.c:2565:20 */
var limitTypes1 = [3]uintptr{
	ts + 13145, ts + 5501, uintptr(0),
} /* tclInterp.c:2603:20 */

//----------------------------------------------------------------------
//
// ChildObjCmdDeleteProc --
//
//	Invoked when an object command for a child interpreter is deleted;
//	cleans up all state associated with the child interpreter and destroys
//	the child interpreter.
//
// Results:
//	None.
//
// Side effects:
//	Cleans up all state associated with the child interpreter and destroys
//	the child interpreter.
//
//----------------------------------------------------------------------

func sChildObjCmdDeleteProc(tls *libc.TLS, clientData ClientData) { /* tclInterp.c:2664:1: */
	var childPtr uintptr // Interim storage for Child record.
	var childInterp uintptr = clientData
	// And for a child interp.

	childPtr = (*Interp)(unsafe.Pointer(childInterp)).FinterpInfo + 96

	// Unlink the child from its parent interpreter.

	XTcl_DeleteHashEntry(tls, (*Child)(unsafe.Pointer(childPtr)).FchildEntryPtr)

	// Set to NULL so that when the InterpInfo is cleaned up in the child it
	// does not try to delete the command causing all sorts of grief. See
	// ChildRecordDeleteProc().

	(*Child)(unsafe.Pointer(childPtr)).FinterpCmd = uintptr(0)

	if (*Child)(unsafe.Pointer(childPtr)).FchildInterp != uintptr(0) {
		XTcl_DeleteInterp(tls, (*Child)(unsafe.Pointer(childPtr)).FchildInterp)
	}
}

//----------------------------------------------------------------------
//
// ChildDebugCmd -- TIP #378
//
//	Helper function to handle 'debug' command in a child interpreter.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May modify INTERP_DEBUG_FRAME flag in the child.
//
//----------------------------------------------------------------------

func sChildDebugCmd(tls *libc.TLS, interp uintptr, childInterp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:2709:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var debugType int32 at bp, 4

	var iPtr uintptr
	var resultPtr uintptr

	iPtr = childInterp
	if objc == 0 {
		resultPtr = XTcl_NewObj(tls)
		XTcl_ListObjAppendElement(tls, uintptr(0), resultPtr,
			XTcl_NewStringObj(tls, ts+42636, -1))
		XTcl_ListObjAppendElement(tls, uintptr(0), resultPtr,
			XTcl_NewIntObj(tls, libc.Bool32((*Interp)(unsafe.Pointer(iPtr)).Fflags&INTERP_DEBUG_FRAME != 0)))
		XTcl_SetObjResult(tls, interp, resultPtr)
	} else {
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), uintptr(unsafe.Pointer(&debugTypes)), int32(unsafe.Sizeof(uintptr(0))), ts+42643, 0, bp) != TCL_OK {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp)) == 0 {
			if objc == 2 { // set
				if XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) !=
					TCL_OK {
					return TCL_ERROR
				}

				// Quietly ignore attempts to disable interp debugging.  This
				// is a one-way switch as frame debug info is maintained in a
				// stack that must be consistent once turned on.

				if *(*int32)(unsafe.Pointer(bp)) != 0 {
					*(*int32)(unsafe.Pointer(iPtr + 424)) |= INTERP_DEBUG_FRAME
				}
			}
			XTcl_SetObjResult(tls, interp,
				XTcl_NewIntObj(tls, libc.Bool32((*Interp)(unsafe.Pointer(iPtr)).Fflags&INTERP_DEBUG_FRAME != 0)))
		}
	}
	return TCL_OK
}

var debugTypes = [2]uintptr{
	ts + 42636, uintptr(0),
} /* tclInterp.c:2716:23 */

//----------------------------------------------------------------------
//
// ChildEval --
//
//	Helper function to evaluate a command in a child interpreter.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Whatever the command does.
//
//----------------------------------------------------------------------

func sChildEval(tls *libc.TLS, interp uintptr, childInterp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:2780:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var result int32

	// TIP #285: If necessary, reset the cancellation flags for the child
	// interpreter now; otherwise, canceling a script in a parent interpreter
	// can result in a situation where a child interpreter can no longer
	// evaluate any scripts unless somebody calls the TclResetCancellation
	// function for that particular Tcl_Interp.

	XTclSetSlaveCancelFlags(tls, childInterp, 0, 0)

	XTcl_Preserve(tls, childInterp)
	XTcl_AllowExceptions(tls, childInterp)

	if objc == 1 {
		// TIP #280: Make actual argument location available to eval'd script.

		var iPtr uintptr = interp
		*(*uintptr)(unsafe.Pointer(bp /* invoker */)) = (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr
		*(*int32)(unsafe.Pointer(bp + 8 /* word */)) = 0

		XTclArgumentGet(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp, bp+8)

		result = XTclEvalObjEx(tls, childInterp, *(*uintptr)(unsafe.Pointer(objv)), 0, *(*uintptr)(unsafe.Pointer(bp /* invoker */)), *(*int32)(unsafe.Pointer(bp + 8 /* word */)))
	} else {
		var objPtr uintptr = XTcl_ConcatObj(tls, objc, objv)
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
		result = XTcl_EvalObjEx(tls, childInterp, objPtr, 0)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	XTcl_TransferResult(tls, childInterp, result, interp)

	XTcl_Release(tls, childInterp)
	return result
}

//----------------------------------------------------------------------
//
// ChildExpose --
//
//	Helper function to expose a command in a child interpreter.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	After this call scripts in the child will be able to invoke the newly
//	exposed command.
//
//----------------------------------------------------------------------

func sChildExpose(tls *libc.TLS, interp uintptr, childInterp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:2844:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var name uintptr

	if XTcl_IsSafe(tls, interp) != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+42656,
			-1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+41573, ts+42715,
			uintptr(0)))
		return TCL_ERROR
	}

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(func() int32 {
			if objc == 1 {
				return 0
			}
			return 1
		}())*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(func() int32 {
				if objc == 1 {
					return 0
				}
				return 1
			}())*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(func() int32 {
			if objc == 1 {
				return 0
			}
			return 1
		}())*8)))
	}()
	if XTcl_ExposeCommand(tls, childInterp, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
	}(),
		name) != TCL_OK {
		XTcl_TransferResult(tls, childInterp, TCL_ERROR, interp)
		return TCL_ERROR
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ChildRecursionLimit --
//
//	Helper function to set/query the Recursion limit of an interp
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	When (objc == 1), childInterp will be set to a new recursion limit of
//	objv[0].
//
//----------------------------------------------------------------------

func sChildRecursionLimit(tls *libc.TLS, interp uintptr, childInterp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:2888:1: */
	bp := tls.Alloc(108)
	defer tls.Free(108)

	var iPtr uintptr
	// var limit int32 at bp+104, 4

	if objc != 0 {
		if XTcl_IsSafe(tls, interp) != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+42722, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+41573, ts+42715,
				uintptr(0)))
			return TCL_ERROR
		}
		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 104)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32)))
					return TCL_OK
				}()
			}
			return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp+104)
		}() == TCL_ERROR {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp + 104)) <= 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+42789, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7420, ts+41573, ts+42817,
				uintptr(0)))
			return TCL_ERROR
		}
		XTcl_SetRecursionLimit(tls, childInterp, *(*int32)(unsafe.Pointer(bp + 104 /* limit */)))
		iPtr = childInterp
		if interp == childInterp && (*Interp)(unsafe.Pointer(iPtr)).FnumLevels > *(*int32)(unsafe.Pointer(bp + 104)) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+42826, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, ts+3593, ts+42866, uintptr(0)))
			return TCL_ERROR
		}
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv)))
		return TCL_OK
	} else {
		*(*int32)(unsafe.Pointer(bp + 104 /* limit */)) = XTcl_SetRecursionLimit(tls, childInterp, 0)
		XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 104 /* limit */))))
		return TCL_OK
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// ChildHide --
//
//	Helper function to hide a command in a child interpreter.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	After this call scripts in the child will no longer be able to invoke
//	the named command.
//
//----------------------------------------------------------------------

func sChildHide(tls *libc.TLS, interp uintptr, childInterp uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:2950:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var name uintptr

	if XTcl_IsSafe(tls, interp) != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+42876,
			-1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+41573, ts+42715,
			uintptr(0)))
		return TCL_ERROR
	}

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(func() int32 {
			if objc == 1 {
				return 0
			}
			return 1
		}())*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(func() int32 {
				if objc == 1 {
					return 0
				}
				return 1
			}())*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(func() int32 {
			if objc == 1 {
				return 0
			}
			return 1
		}())*8)))
	}()
	if XTcl_HideCommand(tls, childInterp, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
	}(), name) != TCL_OK {
		XTcl_TransferResult(tls, childInterp, TCL_ERROR, interp)
		return TCL_ERROR
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ChildHidden --
//
//	Helper function to compute list of hidden commands in a child
//	interpreter.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sChildHidden(tls *libc.TLS, interp uintptr, childInterp uintptr) int32 { /* tclInterp.c:2993:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var listObjPtr uintptr = XTcl_NewObj(tls) // Local object pointer.
	var hTblPtr uintptr                       // For local searches.
	var hPtr uintptr                          // For local searches.
	// var hSearch Tcl_HashSearch at bp, 24
	// For local searches.

	hTblPtr = (*Interp)(unsafe.Pointer(childInterp)).FhiddenCmdTablePtr
	if hTblPtr != uintptr(0) {
		for hPtr = XTcl_FirstHashEntry(tls, hTblPtr, bp); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
			XTcl_ListObjAppendElement(tls, uintptr(0), listObjPtr,
				XTcl_NewStringObj(tls, func() uintptr {
					if (*Tcl_HashTable)(unsafe.Pointer(hTblPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(hTblPtr)).FkeyType == -1 {
						return *(*uintptr)(unsafe.Pointer(hPtr + 32))
					}
					return hPtr + 32
				}(), -1))
		}
	}
	XTcl_SetObjResult(tls, interp, listObjPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ChildInvokeHidden --
//
//	Helper function to invoke a hidden command in a child interpreter.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Whatever the hidden command does.
//
//----------------------------------------------------------------------

func sChildInvokeHidden(tls *libc.TLS, interp uintptr, childInterp uintptr, namespaceName uintptr, objc int32, objv uintptr) int32 { /* tclInterp.c:3032:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var result int32

	if XTcl_IsSafe(tls, interp) != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+42933,
			-1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+41573, ts+42715,
			uintptr(0)))
		return TCL_ERROR
	}

	XTcl_Preserve(tls, childInterp)
	XTcl_AllowExceptions(tls, childInterp)

	if namespaceName == uintptr(0) {
		var rootPtr uintptr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(childInterp)).FexecEnvPtr)).FcallbackPtr

		XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sNRPostInvokeHidden})), childInterp,
			rootPtr, uintptr(0), uintptr(0))
		return XTclNRInvoke(tls, uintptr(0), childInterp, objc, objv)
	} else {
		// var nsPtr uintptr at bp+40, 8

		// var dummy1 uintptr at bp+48, 8

		// var dummy2 uintptr at bp+56, 8

		// var tail uintptr at bp+64, 8

		result = XTclGetNamespaceForQualName(tls, childInterp, namespaceName, uintptr(0),
			TCL_FIND_ONLY_NS|TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG|
				TCL_CREATE_NS_IF_UNKNOWN, bp+40, bp+48, bp+56, bp+64)
		if result == TCL_OK {
			result = XTclObjInvokeNamespace(tls, childInterp, objc, objv,
				*(*uintptr)(unsafe.Pointer(bp + 40 /* nsPtr */)), int32(1)<<0)
		}
	}

	XTcl_TransferResult(tls, childInterp, result, interp)

	XTcl_Release(tls, childInterp)
	return result
}

func sNRPostInvokeHidden(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclInterp.c:3080:1: */
	var childInterp uintptr = *(*ClientData)(unsafe.Pointer(data))
	var rootPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))

	if interp != childInterp {
		result = XTclNRRunCallbacks(tls, childInterp, result, rootPtr)
		XTcl_TransferResult(tls, childInterp, result, interp)
	}
	XTcl_Release(tls, childInterp)
	return result
}

//----------------------------------------------------------------------
//
// ChildMarkTrusted --
//
//	Helper function to mark a child interpreter as trusted (unsafe).
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	After this call the hard-wired security checks in the core no longer
//	prevent the child from performing certain operations.
//
//----------------------------------------------------------------------

func sChildMarkTrusted(tls *libc.TLS, interp uintptr, childInterp uintptr) int32 { /* tclInterp.c:3114:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	if XTcl_IsSafe(tls, interp) != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+42993,
			-1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+41573, ts+42715,
			uintptr(0)))
		return TCL_ERROR
	}
	*(*int32)(unsafe.Pointer(childInterp + 424)) &= libc.CplInt32(SAFE_INTERP)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_IsSafe --
//
//	Determines whether an interpreter is safe
//
// Results:
//	1 if it is safe, 0 if it is not.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_IsSafe(tls *libc.TLS, interp uintptr) int32 { /* tclInterp.c:3148:1: */
	var iPtr uintptr = interp

	if iPtr == uintptr(0) {
		return 0
	}
	if (*Interp)(unsafe.Pointer(iPtr)).Fflags&SAFE_INTERP != 0 {
		return 1
	}
	return 0
}

//----------------------------------------------------------------------
//
// Tcl_MakeSafe --
//
//	Makes its argument interpreter contain only functionality that is
//	defined to be part of Safe Tcl. Unsafe commands are hidden, the env
//	array is unset, and the standard channels are removed.
//
// Results:
//	None.
//
// Side effects:
//	Hides commands in its argument interpreter, and removes settings and
//	channels.
//
//----------------------------------------------------------------------

func XTcl_MakeSafe(tls *libc.TLS, interp uintptr) int32 { /* tclInterp.c:3179:1: */
	var chan1 Tcl_Channel // Channel to remove from safe interpreter.
	var iPtr uintptr = interp
	var parent uintptr = (*InterpInfo)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FinterpInfo)).Fchild.FparentInterp

	XTclHideUnsafeCommands(tls, interp)

	if parent != uintptr(0) {
		// Alias these function implementations in the child to those in the
		// parent; the overall implementations are safe, but they're normally
		// defined by init.tcl which is not sourced by safe interpreters.
		// Assume these functions all work. [Bug 2895741]

		XTcl_Eval(tls, interp,
			ts+43049)
		XTcl_CreateAlias(tls, interp, ts+43099, parent,
			ts+43099, 0, uintptr(0))
		XTcl_CreateAlias(tls, interp, ts+43120, parent,
			ts+43120, 0, uintptr(0))
	}

	*(*int32)(unsafe.Pointer(iPtr + 424)) |= SAFE_INTERP

	// Unsetting variables : (which should not have been set in the first
	// place, but...)

	// No env array in a safe interpreter.

	XTcl_UnsetVar2(tls, interp, ts+27231, uintptr(0), TCL_GLOBAL_ONLY)

	// Remove unsafe parts of tcl_platform

	XTcl_UnsetVar2(tls, interp, ts+6476, ts+43141, TCL_GLOBAL_ONLY)
	XTcl_UnsetVar2(tls, interp, ts+6476, ts+43144, TCL_GLOBAL_ONLY)
	XTcl_UnsetVar2(tls, interp, ts+6476, ts+43154, TCL_GLOBAL_ONLY)
	XTcl_UnsetVar2(tls, interp, ts+6476, ts+43162, TCL_GLOBAL_ONLY)

	// Unset path informations variables (the only one remaining is [info
	// nameofexecutable])

	XTcl_UnsetVar2(tls, interp, ts+43167, uintptr(0), TCL_GLOBAL_ONLY)
	XTcl_UnsetVar2(tls, interp, ts+14211, uintptr(0), TCL_GLOBAL_ONLY)
	XTcl_UnsetVar2(tls, interp, ts+43185, uintptr(0), TCL_GLOBAL_ONLY)

	// Remove the standard channels from the interpreter; safe interpreters do
	// not ordinarily have access to stdin, stdout and stderr.
	//
	// NOTE: These channels are not added to the interpreter by the
	// Tcl_CreateInterp call, but may be added later, by another I/O
	// operation. We want to ensure that the interpreter does not have these
	// channels even if it is being made safe after being used for some time..

	chan1 = XTcl_GetStdChannel(tls, int32(1)<<1)
	if chan1 != uintptr(0) {
		XTcl_UnregisterChannel(tls, interp, chan1)
	}
	chan1 = XTcl_GetStdChannel(tls, int32(1)<<2)
	if chan1 != uintptr(0) {
		XTcl_UnregisterChannel(tls, interp, chan1)
	}
	chan1 = XTcl_GetStdChannel(tls, int32(1)<<3)
	if chan1 != uintptr(0) {
		XTcl_UnregisterChannel(tls, interp, chan1)
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_LimitExceeded --
//
//	Tests whether any limit has been exceeded in the given interpreter
//	(i.e. whether the interpreter is currently unable to process further
//	scripts).
//
// Results:
//	A boolean value.
//
// Side effects:
//	None.
//
// Notes:
//	If you change this function, you MUST also update TclLimitExceeded() in
//	tclInt.h.
//----------------------------------------------------------------------

func XTcl_LimitExceeded(tls *libc.TLS, interp uintptr) int32 { /* tclInterp.c:3283:1: */
	var iPtr uintptr = interp

	return libc.Bool32((*Interp)(unsafe.Pointer(iPtr)).Flimit.Fexceeded != 0)
}

//----------------------------------------------------------------------
//
// Tcl_LimitReady --
//
//	Find out whether any limit has been set on the interpreter, and if so
//	check whether the granularity of that limit is such that the full
//	limit check should be carried out.
//
// Results:
//	A boolean value that indicates whether to call Tcl_LimitCheck.
//
// Side effects:
//	Increments the limit granularity counter.
//
// Notes:
//	If you change this function, you MUST also update TclLimitReady() in
//	tclInt.h.
//
//----------------------------------------------------------------------

func XTcl_LimitReady(tls *libc.TLS, interp uintptr) int32 { /* tclInterp.c:3314:1: */
	var iPtr uintptr = interp

	if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Factive != 0 {
		var ticker int32 = libc.PreIncInt32(&(*Interp)(unsafe.Pointer(iPtr)).Flimit.FgranularityTicker, 1)

		if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Factive&TCL_LIMIT_COMMANDS != 0 && ((*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdGranularity == 1 || ticker%(*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdGranularity == 0) {
			return 1
		}
		if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Factive&TCL_LIMIT_TIME != 0 && ((*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeGranularity == 1 || ticker%(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeGranularity == 0) {
			return 1
		}
	}
	return 0
}

//----------------------------------------------------------------------
//
// Tcl_LimitCheck --
//
//	Check all currently set limits in the interpreter (where permitted by
//	granularity). If a limit is exceeded, call its callbacks and, if the
//	limit is still exceeded after the callbacks have run, make the
//	interpreter generate an error that cannot be caught within the limited
//	interpreter.
//
// Results:
//	A Tcl result value (TCL_OK if no limit is exceeded, and TCL_ERROR if a
//	limit has been exceeded).
//
// Side effects:
//	May invoke system calls. May invoke other interpreters. May be
//	reentrant. May put the interpreter into a state where it can no longer
//	execute commands without outside intervention.
//
//----------------------------------------------------------------------

func XTcl_LimitCheck(tls *libc.TLS, interp uintptr) int32 { /* tclInterp.c:3360:1: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	var iPtr uintptr = interp
	var ticker int32 = (*Interp)(unsafe.Pointer(iPtr)).Flimit.FgranularityTicker

	if XTcl_InterpDeleted(tls, interp) != 0 {
		return TCL_OK
	}

	if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Factive&TCL_LIMIT_COMMANDS != 0 && ((*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdGranularity == 1 || ticker%(*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdGranularity == 0) && (*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdCount < (*Interp)(unsafe.Pointer(iPtr)).FcmdCount {
		*(*int32)(unsafe.Pointer(iPtr + 768 + 8)) |= TCL_LIMIT_COMMANDS
		XTcl_Preserve(tls, interp)
		sRunLimitHandlers(tls, (*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdHandlers, interp)
		if (*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdCount >= (*Interp)(unsafe.Pointer(iPtr)).FcmdCount {
			*(*int32)(unsafe.Pointer(iPtr + 768 + 8)) &= libc.CplInt32(TCL_LIMIT_COMMANDS)
		} else if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Fexceeded&TCL_LIMIT_COMMANDS != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+43197, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7670, ts+43226, uintptr(0)))
			XTcl_Release(tls, interp)
			return TCL_ERROR
		}
		XTcl_Release(tls, interp)
	}

	if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Factive&TCL_LIMIT_TIME != 0 && ((*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeGranularity == 1 || ticker%(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeGranularity == 0) {
		// var now Tcl_Time at bp+64, 16

		XTcl_GetTime(tls, bp+64)
		if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fsec < (*Tcl_Time)(unsafe.Pointer(bp+64)).Fsec || (*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fsec == (*Tcl_Time)(unsafe.Pointer(bp+64)).Fsec && (*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fusec < (*Tcl_Time)(unsafe.Pointer(bp+64)).Fusec {
			*(*int32)(unsafe.Pointer(iPtr + 768 + 8)) |= TCL_LIMIT_TIME
			XTcl_Preserve(tls, interp)
			sRunLimitHandlers(tls, (*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeHandlers, interp)
			if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fsec > (*Tcl_Time)(unsafe.Pointer(bp+64)).Fsec || (*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fsec == (*Tcl_Time)(unsafe.Pointer(bp+64)).Fsec && (*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fusec >= (*Tcl_Time)(unsafe.Pointer(bp+64)).Fusec {
				*(*int32)(unsafe.Pointer(iPtr + 768 + 8)) &= libc.CplInt32(TCL_LIMIT_TIME)
			} else if (*Interp)(unsafe.Pointer(iPtr)).Flimit.Fexceeded&TCL_LIMIT_TIME != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+43235, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+7670, ts+43255, uintptr(0)))
				XTcl_Release(tls, interp)
				return TCL_ERROR
			}
			XTcl_Release(tls, interp)
		}
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// RunLimitHandlers --
//
//	Invoke all the limit handlers in a list (for a particular limit).
//	Note that no particular limit handler callback will be invoked
//	reentrantly.
//
// Results:
//	None.
//
// Side effects:
//	Depends on the limit handlers.
//
//----------------------------------------------------------------------

func sRunLimitHandlers(tls *libc.TLS, handlerPtr uintptr, interp uintptr) { /* tclInterp.c:3438:1: */
	var nextPtr uintptr
	for ; handlerPtr != uintptr(0); handlerPtr = nextPtr {
		if (*LimitHandler)(unsafe.Pointer(handlerPtr)).Fflags&(LIMIT_HANDLER_DELETED|LIMIT_HANDLER_ACTIVE) != 0 {
			// Reentrant call or something seriously strange in the delete
			// code.

			nextPtr = (*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr
			continue
		}

		// Set the ACTIVE flag while running the limit handler itself so we
		// cannot reentrantly call this handler and know to use the alternate
		// method of deletion if necessary.

		*(*int32)(unsafe.Pointer(handlerPtr)) |= LIMIT_HANDLER_ACTIVE
		(*struct {
			f func(*libc.TLS, ClientData, uintptr)
		})(unsafe.Pointer(&struct{ uintptr }{(*LimitHandler)(unsafe.Pointer(handlerPtr)).FhandlerProc})).f(tls, (*LimitHandler)(unsafe.Pointer(handlerPtr)).FclientData, interp)
		*(*int32)(unsafe.Pointer(handlerPtr)) &= libc.CplInt32(LIMIT_HANDLER_ACTIVE)

		// Rediscover this value; it might have changed during the processing
		// of a limit handler. We have to record it here because we might
		// delete the structure below, and reading a value out of a deleted
		// structure is unsafe (even if actually legal with some
		// malloc()/free() implementations.)

		nextPtr = (*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr

		// If we deleted the current handler while we were executing it, we
		// will have spliced it out of the list and set the
		// LIMIT_HANDLER_DELETED flag.

		if (*LimitHandler)(unsafe.Pointer(handlerPtr)).Fflags&LIMIT_HANDLER_DELETED != 0 {
			if (*LimitHandler)(unsafe.Pointer(handlerPtr)).FdeleteProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*LimitHandler)(unsafe.Pointer(handlerPtr)).FdeleteProc})).f(tls, (*LimitHandler)(unsafe.Pointer(handlerPtr)).FclientData)
			}
			XTclpFree(tls, handlerPtr)
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_LimitAddHandler --
//
//	Add a callback handler for a particular resource limit.
//
// Results:
//	None.
//
// Side effects:
//	Extends the internal linked list of handlers for a limit.
//
//----------------------------------------------------------------------

func XTcl_LimitAddHandler(tls *libc.TLS, interp uintptr, type1 int32, handlerProc uintptr, clientData ClientData, deleteProc uintptr) { /* tclInterp.c:3506:1: */
	var iPtr uintptr = interp
	var handlerPtr uintptr

	// Convert everything into a real deletion callback.

	if deleteProc == uintptr(3) {
		deleteProc = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{XTcl_Free}))
	}
	if deleteProc == uintptr(0) {
		deleteProc = uintptr(0)
	}

	// Allocate a handler record.

	handlerPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(LimitHandler{})))
	(*LimitHandler)(unsafe.Pointer(handlerPtr)).Fflags = 0
	(*LimitHandler)(unsafe.Pointer(handlerPtr)).FhandlerProc = handlerProc
	(*LimitHandler)(unsafe.Pointer(handlerPtr)).FclientData = clientData
	(*LimitHandler)(unsafe.Pointer(handlerPtr)).FdeleteProc = deleteProc
	(*LimitHandler)(unsafe.Pointer(handlerPtr)).FprevPtr = uintptr(0)

	// Prepend onto the front of the correct linked list.

	switch type1 {
	case TCL_LIMIT_COMMANDS:
		(*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr = (*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdHandlers
		if (*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr != uintptr(0) {
			(*LimitHandler)(unsafe.Pointer((*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr)).FprevPtr = handlerPtr
		}
		(*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdHandlers = handlerPtr
		return

	case TCL_LIMIT_TIME:
		(*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr = (*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeHandlers
		if (*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr != uintptr(0) {
			(*LimitHandler)(unsafe.Pointer((*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr)).FprevPtr = handlerPtr
		}
		(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeHandlers = handlerPtr
		return
	}

	XTcl_Panic(tls, ts+43260, 0)
}

//----------------------------------------------------------------------
//
// Tcl_LimitRemoveHandler --
//
//	Remove a callback handler for a particular resource limit.
//
// Results:
//	None.
//
// Side effects:
//	The handler is spliced out of the internal linked list for the limit,
//	and if not currently being invoked, deleted. Otherwise it is just
//	marked for deletion and removed when the limit handler has finished
//	executing.
//
//----------------------------------------------------------------------

func XTcl_LimitRemoveHandler(tls *libc.TLS, interp uintptr, type1 int32, handlerProc uintptr, clientData ClientData) { /* tclInterp.c:3583:1: */
	var iPtr uintptr = interp
	var handlerPtr uintptr

	switch type1 {
	case TCL_LIMIT_COMMANDS:
		handlerPtr = (*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdHandlers
		break
	case TCL_LIMIT_TIME:
		handlerPtr = (*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeHandlers
		break
	default:
		XTcl_Panic(tls, ts+43260, 0)
		return
	}

	for ; handlerPtr != uintptr(0); handlerPtr = (*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr {
		if (*LimitHandler)(unsafe.Pointer(handlerPtr)).FhandlerProc != handlerProc || (*LimitHandler)(unsafe.Pointer(handlerPtr)).FclientData != clientData {
			continue
		}

		// We've found the handler to delete; mark it as doomed if not already
		// so marked (which shouldn't actually happen).

		if (*LimitHandler)(unsafe.Pointer(handlerPtr)).Fflags&LIMIT_HANDLER_DELETED != 0 {
			return
		}
		*(*int32)(unsafe.Pointer(handlerPtr)) |= LIMIT_HANDLER_DELETED

		// Splice the handler out of the doubly-linked list.

		if (*LimitHandler)(unsafe.Pointer(handlerPtr)).FprevPtr == uintptr(0) {
			switch type1 {
			case TCL_LIMIT_COMMANDS:
				(*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdHandlers = (*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr
				break
				fallthrough
			case TCL_LIMIT_TIME:
				(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeHandlers = (*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr
				break
			}
		} else {
			(*LimitHandler)(unsafe.Pointer((*LimitHandler)(unsafe.Pointer(handlerPtr)).FprevPtr)).FnextPtr = (*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr
		}
		if (*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr != uintptr(0) {
			(*LimitHandler)(unsafe.Pointer((*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr)).FprevPtr = (*LimitHandler)(unsafe.Pointer(handlerPtr)).FprevPtr
		}

		// If nothing is currently executing the handler, delete its client
		// data and the overall handler structure now. Otherwise it will all
		// go away when the handler returns.

		if !((*LimitHandler)(unsafe.Pointer(handlerPtr)).Fflags&LIMIT_HANDLER_ACTIVE != 0) {
			if (*LimitHandler)(unsafe.Pointer(handlerPtr)).FdeleteProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*LimitHandler)(unsafe.Pointer(handlerPtr)).FdeleteProc})).f(tls, (*LimitHandler)(unsafe.Pointer(handlerPtr)).FclientData)
			}
			XTclpFree(tls, handlerPtr)
		}
		return
	}
}

//----------------------------------------------------------------------
//
// TclLimitRemoveAllHandlers --
//
//	Remove all limit callback handlers for an interpreter. This is invoked
//	as part of deleting the interpreter.
//
// Results:
//	None.
//
// Side effects:
//	Limit handlers are deleted or marked for deletion (as with
//	Tcl_LimitRemoveHandler).
//
//----------------------------------------------------------------------

func XTclLimitRemoveAllHandlers(tls *libc.TLS, interp uintptr) { /* tclInterp.c:3675:1: */
	var iPtr uintptr = interp
	var handlerPtr uintptr
	var nextHandlerPtr uintptr

	// Delete all command-limit handlers.

	handlerPtr = (*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdHandlers
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdHandlers = uintptr(0)
	for ; handlerPtr != uintptr(0); handlerPtr = nextHandlerPtr {
		nextHandlerPtr = (*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr

		// Do not delete here if it has already been marked for deletion.

		if (*LimitHandler)(unsafe.Pointer(handlerPtr)).Fflags&LIMIT_HANDLER_DELETED != 0 {
			continue
		}
		*(*int32)(unsafe.Pointer(handlerPtr)) |= LIMIT_HANDLER_DELETED
		(*LimitHandler)(unsafe.Pointer(handlerPtr)).FprevPtr = uintptr(0)
		(*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr = uintptr(0)

		// If nothing is currently executing the handler, delete its client
		// data and the overall handler structure now. Otherwise it will all
		// go away when the handler returns.

		if !((*LimitHandler)(unsafe.Pointer(handlerPtr)).Fflags&LIMIT_HANDLER_ACTIVE != 0) {
			if (*LimitHandler)(unsafe.Pointer(handlerPtr)).FdeleteProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*LimitHandler)(unsafe.Pointer(handlerPtr)).FdeleteProc})).f(tls, (*LimitHandler)(unsafe.Pointer(handlerPtr)).FclientData)
			}
			XTclpFree(tls, handlerPtr)
		}
	}

	// Delete all time-limit handlers.

	handlerPtr = (*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeHandlers
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeHandlers = uintptr(0)
	for ; handlerPtr != uintptr(0); handlerPtr = nextHandlerPtr {
		nextHandlerPtr = (*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr

		// Do not delete here if it has already been marked for deletion.

		if (*LimitHandler)(unsafe.Pointer(handlerPtr)).Fflags&LIMIT_HANDLER_DELETED != 0 {
			continue
		}
		*(*int32)(unsafe.Pointer(handlerPtr)) |= LIMIT_HANDLER_DELETED
		(*LimitHandler)(unsafe.Pointer(handlerPtr)).FprevPtr = uintptr(0)
		(*LimitHandler)(unsafe.Pointer(handlerPtr)).FnextPtr = uintptr(0)

		// If nothing is currently executing the handler, delete its client
		// data and the overall handler structure now. Otherwise it will all
		// go away when the handler returns.

		if !((*LimitHandler)(unsafe.Pointer(handlerPtr)).Fflags&LIMIT_HANDLER_ACTIVE != 0) {
			if (*LimitHandler)(unsafe.Pointer(handlerPtr)).FdeleteProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*LimitHandler)(unsafe.Pointer(handlerPtr)).FdeleteProc})).f(tls, (*LimitHandler)(unsafe.Pointer(handlerPtr)).FclientData)
			}
			XTclpFree(tls, handlerPtr)
		}
	}

	// Delete the timer callback that is used to trap limits that occur in
	// [vwait]s...

	if (*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeEvent != uintptr(0) {
		XTcl_DeleteTimerHandler(tls, (*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeEvent)
		(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeEvent = uintptr(0)
	}
}

//----------------------------------------------------------------------
//
// Tcl_LimitTypeEnabled --
//
//	Check whether a particular limit has been enabled for an interpreter.
//
// Results:
//	A boolean value.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_LimitTypeEnabled(tls *libc.TLS, interp uintptr, type1 int32) int32 { /* tclInterp.c:3775:1: */
	var iPtr uintptr = interp

	return libc.Bool32((*Interp)(unsafe.Pointer(iPtr)).Flimit.Factive&type1 != 0)
}

//----------------------------------------------------------------------
//
// Tcl_LimitTypeExceeded --
//
//	Check whether a particular limit has been exceeded for an interpreter.
//
// Results:
//	A boolean value (note that Tcl_LimitExceeded will always return
//	non-zero when this function returns non-zero).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_LimitTypeExceeded(tls *libc.TLS, interp uintptr, type1 int32) int32 { /* tclInterp.c:3802:1: */
	var iPtr uintptr = interp

	return libc.Bool32((*Interp)(unsafe.Pointer(iPtr)).Flimit.Fexceeded&type1 != 0)
}

//----------------------------------------------------------------------
//
// Tcl_LimitTypeSet --
//
//	Enable a particular limit for an interpreter.
//
// Results:
//	None.
//
// Side effects:
//	The limit is turned on and will be checked in future at an interval
//	determined by the frequency of calling of Tcl_LimitReady and the
//	granularity of the limit in question.
//
//----------------------------------------------------------------------

func XTcl_LimitTypeSet(tls *libc.TLS, interp uintptr, type1 int32) { /* tclInterp.c:3830:1: */
	var iPtr uintptr = interp

	*(*int32)(unsafe.Pointer(iPtr + 768)) |= type1
}

//----------------------------------------------------------------------
//
// Tcl_LimitTypeReset --
//
//	Disable a particular limit for an interpreter.
//
// Results:
//	None.
//
// Side effects:
//	The limit is disabled. If the limit was exceeded when this function
//	was called, the limit will no longer be exceeded afterwards and the
//	interpreter will be free to execute further scripts (assuming it isn't
//	also deleted, of course).
//
//----------------------------------------------------------------------

func XTcl_LimitTypeReset(tls *libc.TLS, interp uintptr, type1 int32) { /* tclInterp.c:3859:1: */
	var iPtr uintptr = interp

	*(*int32)(unsafe.Pointer(iPtr + 768)) &= ^type1
	*(*int32)(unsafe.Pointer(iPtr + 768 + 8)) &= ^type1
}

//----------------------------------------------------------------------
//
// Tcl_LimitSetCommands --
//
//	Set the command limit for an interpreter.
//
// Results:
//	None.
//
// Side effects:
//	Also resets whether the command limit was exceeded. This might permit
//	a small amount of further execution in the interpreter even if the
//	limit itself is theoretically exceeded.
//
//----------------------------------------------------------------------

func XTcl_LimitSetCommands(tls *libc.TLS, interp uintptr, commandLimit int32) { /* tclInterp.c:3888:1: */
	var iPtr uintptr = interp

	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdCount = commandLimit
	*(*int32)(unsafe.Pointer(iPtr + 768 + 8)) &= libc.CplInt32(TCL_LIMIT_COMMANDS)
}

//----------------------------------------------------------------------
//
// Tcl_LimitGetCommands --
//
//	Get the number of commands that may be executed in the interpreter
//	before the command-limit is reached.
//
// Results:
//	An upper bound on the number of commands.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_LimitGetCommands(tls *libc.TLS, interp uintptr) int32 { /* tclInterp.c:3916:1: */
	var iPtr uintptr = interp

	return (*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdCount
}

//----------------------------------------------------------------------
//
// Tcl_LimitSetTime --
//
//	Set the time limit for an interpreter by copying it from the value
//	pointed to by the timeLimitPtr argument.
//
// Results:
//	None.
//
// Side effects:
//	Also resets whether the time limit was exceeded. This might permit a
//	small amount of further execution in the interpreter even if the limit
//	itself is theoretically exceeded.
//
//----------------------------------------------------------------------

func XTcl_LimitSetTime(tls *libc.TLS, interp uintptr, timeLimitPtr uintptr) { /* tclInterp.c:3944:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var iPtr uintptr = interp
	// var nextMoment Tcl_Time at bp, 16

	libc.Xmemcpy(tls, iPtr+768+32, timeLimitPtr, uint64(unsafe.Sizeof(Tcl_Time{})))
	if (*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeEvent != uintptr(0) {
		XTcl_DeleteTimerHandler(tls, (*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeEvent)
	}
	(*Tcl_Time)(unsafe.Pointer(bp /* &nextMoment */)).Fsec = (*Tcl_Time)(unsafe.Pointer(timeLimitPtr)).Fsec
	(*Tcl_Time)(unsafe.Pointer(bp /* &nextMoment */)).Fusec = (*Tcl_Time)(unsafe.Pointer(timeLimitPtr)).Fusec + int64(10)
	if (*Tcl_Time)(unsafe.Pointer(bp)).Fusec >= int64(1000000) {
		(*Tcl_Time)(unsafe.Pointer(bp /* &nextMoment */)).Fsec++
		*(*int64)(unsafe.Pointer(bp + 8)) -= int64(1000000)
	}
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeEvent = XTclCreateAbsoluteTimerHandler(tls, bp,
		*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sTimeLimitCallback})), interp)
	*(*int32)(unsafe.Pointer(iPtr + 768 + 8)) &= libc.CplInt32(TCL_LIMIT_TIME)
}

//----------------------------------------------------------------------
//
// TimeLimitCallback --
//
//	Callback that allows time limits to be enforced even when doing a
//	blocking wait for events.
//
// Results:
//	None.
//
// Side effects:
//	May put the interpreter into a state where it can no longer execute
//	commands. May make callbacks into other interpreters.
//
//----------------------------------------------------------------------

func sTimeLimitCallback(tls *libc.TLS, clientData ClientData) { /* tclInterp.c:3985:1: */
	var interp uintptr = clientData
	var iPtr uintptr = clientData
	var code int32

	XTcl_Preserve(tls, interp)
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeEvent = uintptr(0)

	// Must reset the granularity ticker here to force an immediate full
	// check. This is OK because we're swallowing the cost in the overall cost
	// of the event loop. [Bug 2891362]

	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FgranularityTicker = 0

	code = XTcl_LimitCheck(tls, interp)
	if code != TCL_OK {
		XTcl_AddErrorInfo(tls, interp, ts+43291)
		XTcl_BackgroundException(tls, interp, code)
	}
	XTcl_Release(tls, interp)
}

//----------------------------------------------------------------------
//
// Tcl_LimitGetTime --
//
//	Get the current time limit.
//
// Results:
//	The time limit (by it being copied into the variable pointed to by the
//	timeLimitPtr).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_LimitGetTime(tls *libc.TLS, interp uintptr, timeLimitPtr uintptr) { /* tclInterp.c:4029:1: */
	var iPtr uintptr = interp

	libc.Xmemcpy(tls, timeLimitPtr, iPtr+768+32, uint64(unsafe.Sizeof(Tcl_Time{})))
}

//----------------------------------------------------------------------
//
// Tcl_LimitSetGranularity --
//
//	Set the granularity divisor (which must be positive) for a particular
//	limit.
//
// Results:
//	None.
//
// Side effects:
//	The granularity is updated.
//
//----------------------------------------------------------------------

func XTcl_LimitSetGranularity(tls *libc.TLS, interp uintptr, type1 int32, granularity int32) { /* tclInterp.c:4056:1: */
	var iPtr uintptr = interp
	if granularity < 1 {
		XTcl_Panic(tls, ts+43322, 0)
	}

	switch type1 {
	case TCL_LIMIT_COMMANDS:
		(*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdGranularity = granularity
		return
	case TCL_LIMIT_TIME:
		(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeGranularity = granularity
		return
	}
	XTcl_Panic(tls, ts+43260, 0)
}

//----------------------------------------------------------------------
//
// Tcl_LimitGetGranularity --
//
//	Get the granularity divisor for a particular limit.
//
// Results:
//	The granularity divisor for the given limit.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_LimitGetGranularity(tls *libc.TLS, interp uintptr, type1 int32) int32 { /* tclInterp.c:4094:1: */
	var iPtr uintptr = interp

	switch type1 {
	case TCL_LIMIT_COMMANDS:
		return (*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdGranularity
	case TCL_LIMIT_TIME:
		return (*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeGranularity
	}
	XTcl_Panic(tls, ts+43260, 0)
	return -1 // NOT REACHED
}

//----------------------------------------------------------------------
//
// DeleteScriptLimitCallback --
//
//	Callback for when a script limit (a limit callback implemented as a
//	Tcl script in a parent interpreter, as set up from Tcl) is deleted.
//
// Results:
//	None.
//
// Side effects:
//	The reference to the script callback from the controlling interpreter
//	is removed.
//
//----------------------------------------------------------------------

func sDeleteScriptLimitCallback(tls *libc.TLS, clientData ClientData) { /* tclInterp.c:4129:1: */
	var limitCBPtr uintptr = clientData

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FscriptObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FentryPtr != uintptr(0) {
		XTcl_DeleteHashEntry(tls, (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FentryPtr)
	}
	XTclpFree(tls, limitCBPtr)
}

//----------------------------------------------------------------------
//
// CallScriptLimitCallback --
//
//	Invoke a script limit callback. Used to implement limit callbacks set
//	at the Tcl level on child interpreters.
//
// Results:
//	None.
//
// Side effects:
//	Depends on the callback script. Errors are reported as background
//	errors.
//
//----------------------------------------------------------------------

func sCallScriptLimitCallback(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclInterp.c:4160:1: */
	var limitCBPtr uintptr = clientData
	var code int32

	if XTcl_InterpDeleted(tls, (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).Finterp) != 0 {
		return
	}
	XTcl_Preserve(tls, (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).Finterp)
	code = XTcl_EvalObjEx(tls, (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).Finterp, (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FscriptObj,
		TCL_EVAL_GLOBAL)
	if code != TCL_OK && !(XTcl_InterpDeleted(tls, (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).Finterp) != 0) {
		XTcl_BackgroundException(tls, (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).Finterp, code)
	}
	XTcl_Release(tls, (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).Finterp)
}

//----------------------------------------------------------------------
//
// SetScriptLimitCallback --
//
//	Install (or remove, if scriptObj is NULL) a limit callback script that
//	is called when the target interpreter exceeds the type of limit
//	specified. Each interpreter may only have one callback set on another
//	interpreter through this mechanism (though as many interpreters may be
//	limited as the programmer chooses overall).
//
// Results:
//	None.
//
// Side effects:
//	A limit callback implemented as an invokation of a Tcl script in
//	another interpreter is either installed or removed.
//
//----------------------------------------------------------------------

func sSetScriptLimitCallback(tls *libc.TLS, interp uintptr, type1 int32, targetInterp uintptr, scriptObj uintptr) { /* tclInterp.c:4201:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var limitCBPtr uintptr
	var hashPtr uintptr
	// var isNew int32 at bp+16, 4

	// var key ScriptLimitCallbackKey at bp, 16

	var iPtr uintptr = interp

	if interp == targetInterp {
		XTcl_Panic(tls, ts+43357, 0)
	}

	(*ScriptLimitCallbackKey)(unsafe.Pointer(bp /* &key */)).Finterp = targetInterp
	(*ScriptLimitCallbackKey)(unsafe.Pointer(bp /* &key */)).Ftype = int64(type1)

	if scriptObj == uintptr(0) {
		hashPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 768 /* &.limit */ + 72 /* &.callbacks */)).FfindProc})).f(tls, iPtr+768 /* &.limit */ +72 /* &.callbacks */, bp /* &key */)
		if hashPtr != uintptr(0) {
			XTcl_LimitRemoveHandler(tls, targetInterp, type1, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr)
			}{sCallScriptLimitCallback})),
				(*Tcl_HashEntry)(unsafe.Pointer(hashPtr)).FclientData)
		}
		return
	}

	hashPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 768 /* &.limit */ + 72 /* &.callbacks */)).FcreateProc})).f(tls, iPtr+768 /* &.limit */ +72 /* &.callbacks */, bp /* &key */, bp+16 /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp + 16)) != 0) {
		limitCBPtr = (*Tcl_HashEntry)(unsafe.Pointer(hashPtr)).FclientData
		(*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FentryPtr = uintptr(0)
		XTcl_LimitRemoveHandler(tls, targetInterp, type1, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr)
		}{sCallScriptLimitCallback})),
			limitCBPtr)
	}

	limitCBPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ScriptLimitCallback{})))
	(*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).Finterp = interp
	(*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FscriptObj = scriptObj
	(*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FentryPtr = hashPtr
	(*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).Ftype = type1
	(*Tcl_Obj)(unsafe.Pointer(scriptObj)).FrefCount++

	XTcl_LimitAddHandler(tls, targetInterp, type1, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr)
	}{sCallScriptLimitCallback})),
		limitCBPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteScriptLimitCallback})))
	(*Tcl_HashEntry)(unsafe.Pointer(hashPtr)).FclientData = limitCBPtr
}

//----------------------------------------------------------------------
//
// TclRemoveScriptLimitCallbacks --
//
//	Remove all script-implemented limit callbacks that make calls back
//	into the given interpreter. This invoked as part of deleting an
//	interpreter.
//
// Results:
//	None.
//
// Side effects:
//	The script limit callbacks are removed or marked for later removal.
//
//----------------------------------------------------------------------

func XTclRemoveScriptLimitCallbacks(tls *libc.TLS, interp uintptr) { /* tclInterp.c:4269:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var iPtr uintptr = interp
	var hashPtr uintptr
	// var search Tcl_HashSearch at bp, 24

	var keyPtr uintptr

	hashPtr = XTcl_FirstHashEntry(tls, iPtr+768+72, bp)
	for hashPtr != uintptr(0) {
		keyPtr = func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(iPtr+768+72)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(iPtr+768+72)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(hashPtr + 32))
			}
			return hashPtr + 32
		}()
		XTcl_LimitRemoveHandler(tls, (*ScriptLimitCallbackKey)(unsafe.Pointer(keyPtr)).Finterp, int32((*ScriptLimitCallbackKey)(unsafe.Pointer(keyPtr)).Ftype),
			*(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr)
			}{sCallScriptLimitCallback})), (*Tcl_HashEntry)(unsafe.Pointer(hashPtr)).FclientData)
		hashPtr = XTcl_NextHashEntry(tls, bp)
	}
	XTcl_DeleteHashTable(tls, iPtr+768+72)
}

//----------------------------------------------------------------------
//
// TclInitLimitSupport --
//
//	Initialise all the parts of the interpreter relating to resource limit
//	management. This allows an interpreter to both have limits set upon
//	itself and set limits upon other interpreters.
//
// Results:
//	None.
//
// Side effects:
//	The resource limit subsystem is initialised for the interpreter.
//
//----------------------------------------------------------------------

func XTclInitLimitSupport(tls *libc.TLS, interp uintptr) { /* tclInterp.c:4307:1: */
	var iPtr uintptr = interp

	(*Interp)(unsafe.Pointer(iPtr)).Flimit.Factive = 0
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FgranularityTicker = 0
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.Fexceeded = 0
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdCount = 0
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdHandlers = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FcmdGranularity = 1
	libc.Xmemset(tls, iPtr+768+32, 0, uint64(unsafe.Sizeof(Tcl_Time{})))
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeHandlers = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeEvent = uintptr(0)
	(*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeGranularity = 10
	XTcl_InitHashTable(tls, iPtr+768+72,
		int32(uint64(unsafe.Sizeof(ScriptLimitCallbackKey{}))/uint64(unsafe.Sizeof(int32(0)))))
}

//----------------------------------------------------------------------
//
// InheritLimitsFromParent --
//
//	Derive the interpreter limit configuration for a child interpreter
//	from the limit config for the parent.
//
// Results:
//	None.
//
// Side effects:
//	The child interpreter limits are set so that if the parent has a
//	limit, it may not exceed it by handing off work to child interpreters.
//	Note that this does not transfer limit callbacks from the parent to
//	the child.
//
//----------------------------------------------------------------------

func sInheritLimitsFromParent(tls *libc.TLS, childInterp uintptr, parentInterp uintptr) { /* tclInterp.c:4347:1: */
	var childPtr uintptr = childInterp
	var parentPtr uintptr = parentInterp

	if (*Interp)(unsafe.Pointer(parentPtr)).Flimit.Factive&TCL_LIMIT_COMMANDS != 0 {
		*(*int32)(unsafe.Pointer(childPtr + 768)) |= TCL_LIMIT_COMMANDS
		(*Interp)(unsafe.Pointer(childPtr)).Flimit.FcmdCount = 0
		(*Interp)(unsafe.Pointer(childPtr)).Flimit.FcmdGranularity = (*Interp)(unsafe.Pointer(parentPtr)).Flimit.FcmdGranularity
	}
	if (*Interp)(unsafe.Pointer(parentPtr)).Flimit.Factive&TCL_LIMIT_TIME != 0 {
		*(*int32)(unsafe.Pointer(childPtr + 768)) |= TCL_LIMIT_TIME
		libc.Xmemcpy(tls, childPtr+768+32, parentPtr+768+32,
			uint64(unsafe.Sizeof(Tcl_Time{})))
		(*Interp)(unsafe.Pointer(childPtr)).Flimit.FtimeGranularity = (*Interp)(unsafe.Pointer(parentPtr)).Flimit.FtimeGranularity
	}
}

//----------------------------------------------------------------------
//
// ChildCommandLimitCmd --
//
//	Implementation of the [interp limit $i commands] and [$i limit
//	commands] subcommands. See the interp manual page for a full
//	description.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Depends on the arguments.
//
//----------------------------------------------------------------------

func sChildCommandLimitCmd(tls *libc.TLS, interp uintptr, childInterp uintptr, consumedObjc int32, objc int32, objv uintptr) int32 { /* tclInterp.c:4386:1: */
	bp := tls.Alloc(156)
	defer tls.Free(156)

	var iPtr uintptr
	// var index int32 at bp+136, 4

	// var key ScriptLimitCallbackKey at bp+120, 16

	var limitCBPtr uintptr
	var hPtr uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr
	var empty uintptr
	var cachePtr2 uintptr
	var empty1 uintptr
	var dictPtr uintptr
	var i int32
	// var scriptLen int32 at bp+140, 4

	// var limitLen int32 at bp+148, 4

	var scriptObj uintptr
	var granObj uintptr
	var limitObj uintptr
	// var gran int32 at bp+144, 4

	// var limit int32 at bp+152, 4
	iPtr = interp

	// First, ensure that we are not reading or writing the calling
	// interpreter's limits; it may only manipulate its children. Note that
	// the low level API enforces this with Tcl_Panic, which we want to
	// avoid. [Bug 3398794]

	if !(interp == childInterp) {
		goto __1
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+43410, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+41573, ts+43453, uintptr(0)))
	return TCL_ERROR
__1:
	;

	if !(objc == consumedObjc) {
		goto __2
	}

__4:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __7
	}
	dictPtr = XTclThreadAllocObj(tls)
	goto __8
__7:
	dictPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__8:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = uintptr(0)

	(*ScriptLimitCallbackKey)(unsafe.Pointer(bp + 120 /* &key */)).Finterp = childInterp
	(*ScriptLimitCallbackKey)(unsafe.Pointer(bp + 120 /* &key */)).Ftype = int64(TCL_LIMIT_COMMANDS)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 768 /* &.limit */ + 72 /* &.callbacks */)).FfindProc})).f(tls, iPtr+768 /* &.limit */ +72 /* &.callbacks */, bp+120 /* &key */)
	if !(hPtr != uintptr(0)) {
		goto __9
	}
	limitCBPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !(limitCBPtr != uintptr(0) && (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FscriptObj != uintptr(0)) {
		goto __11
	}
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, XTcl_NewStringObj(tls, options13[0], -1),
		(*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FscriptObj)
	goto __12
__11:
	goto putEmptyCommandInDict
__12:
	;
	goto __10
__9:

putEmptyCommandInDict:
	;
__13:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __16
	}
	empty = XTclThreadAllocObj(tls)
	goto __17
__16:
	empty = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(empty + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__17:
	;
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
	(*Tcl_Obj)(unsafe.Pointer(empty)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(empty)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(empty)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(empty)).FtypePtr = uintptr(0)

	XTcl_DictObjPut(tls, uintptr(0), dictPtr,
		XTcl_NewStringObj(tls, options13[0], -1), empty)
__10:
	;
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, XTcl_NewStringObj(tls, options13[1], -1),
		XTcl_NewIntObj(tls, XTcl_LimitGetGranularity(tls, childInterp,
			TCL_LIMIT_COMMANDS)))

	if !(XTcl_LimitTypeEnabled(tls, childInterp, TCL_LIMIT_COMMANDS) != 0) {
		goto __18
	}
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, XTcl_NewStringObj(tls, options13[2], -1),
		XTcl_NewIntObj(tls, XTcl_LimitGetCommands(tls, childInterp)))
	goto __19
__18:
	;
__20:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __23
	}
	empty1 = XTclThreadAllocObj(tls)
	goto __24
__23:
	empty1 = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(empty1 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__24:
	;
	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	(*Tcl_Obj)(unsafe.Pointer(empty1)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(empty1)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(empty1)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(empty1)).FtypePtr = uintptr(0)

	XTcl_DictObjPut(tls, uintptr(0), dictPtr,
		XTcl_NewStringObj(tls, options13[2], -1), empty1)
__19:
	;
	XTcl_SetObjResult(tls, interp, dictPtr)
	return TCL_OK
	goto __3
__2:
	if !(objc == consumedObjc+1) {
		goto __25
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(consumedObjc)*8)), uintptr(unsafe.Pointer(&options13)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+136) != TCL_OK) {
		goto __27
	}
	return TCL_ERROR
__27:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 136 /* index */))) {
	case uint32(0) /* OPT_CMD */ :
		goto __29
	case uint32(1) /* OPT_GRAN */ :
		goto __30
	case uint32(2) /* OPT_VAL */ :
		goto __31
	}
	goto __28
__29:
	(*ScriptLimitCallbackKey)(unsafe.Pointer(bp + 120 /* &key */)).Finterp = childInterp
	(*ScriptLimitCallbackKey)(unsafe.Pointer(bp + 120 /* &key */)).Ftype = int64(TCL_LIMIT_COMMANDS)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 768 /* &.limit */ + 72 /* &.callbacks */)).FfindProc})).f(tls, iPtr+768 /* &.limit */ +72 /* &.callbacks */, bp+120 /* &key */)
	if !(hPtr != uintptr(0)) {
		goto __32
	}
	limitCBPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !(limitCBPtr != uintptr(0) && (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FscriptObj != uintptr(0)) {
		goto __33
	}
	XTcl_SetObjResult(tls, interp, (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FscriptObj)
__33:
	;
__32:
	;
	goto __28
__30:
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls,
		XTcl_LimitGetGranularity(tls, childInterp, TCL_LIMIT_COMMANDS)))
	goto __28
__31:
	if !(XTcl_LimitTypeEnabled(tls, childInterp, TCL_LIMIT_COMMANDS) != 0) {
		goto __34
	}
	XTcl_SetObjResult(tls, interp,
		XTcl_NewIntObj(tls, XTcl_LimitGetCommands(tls, childInterp)))
__34:
	;
	goto __28
__28:
	;
	return TCL_OK
	goto __26
__25:
	if !((objc-consumedObjc)&1 != 0) {
		goto __35
	}
	XTcl_WrongNumArgs(tls, interp, consumedObjc, objv, ts+43458)
	return TCL_ERROR
	goto __36
__35:
	*(*int32)(unsafe.Pointer(bp + 140 /* scriptLen */)) = 0
	*(*int32)(unsafe.Pointer(bp + 148 /* limitLen */)) = 0
	scriptObj = uintptr(0)
	granObj = uintptr(0)
	limitObj = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 144 /* gran */)) = 0
	*(*int32)(unsafe.Pointer(bp + 152 /* limit */)) = 0

	i = consumedObjc
__37:
	if !(i < objc) {
		goto __39
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options13)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+136) != TCL_OK) {
		goto __40
	}
	return TCL_ERROR
__40:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 136 /* index */))) {
	case uint32(0) /* OPT_CMD */ :
		goto __42
	case uint32(1) /* OPT_GRAN */ :
		goto __43
	case uint32(2) /* OPT_VAL */ :
		goto __44
	}
	goto __41
__42:
	scriptObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+140)
	goto __41
__43:
	granObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 144)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+144)
	}() != TCL_OK) {
		goto __45
	}
	return TCL_ERROR
__45:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 144)) < 1) {
		goto __46
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+43478, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7420, ts+41573,
		ts+43509, uintptr(0)))
	return TCL_ERROR
__46:
	;
	goto __41
__44:
	limitObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+148)
	if !(*(*int32)(unsafe.Pointer(bp + 148)) == 0) {
		goto __47
	}
	goto __41
__47:
	;
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 152)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+152)
	}() != TCL_OK) {
		goto __48
	}
	return TCL_ERROR
__48:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 152)) < 0) {
		goto __49
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+43518, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, ts+3593, ts+7420, ts+41573,
		ts+43509, uintptr(0)))
	return TCL_ERROR
__49:
	;
	goto __41
__41:
	;
	goto __38
__38:
	i = i + 2
	goto __37
	goto __39
__39:
	;
	if !(scriptObj != uintptr(0)) {
		goto __50
	}
	sSetScriptLimitCallback(tls, interp, TCL_LIMIT_COMMANDS, childInterp,
		func() uintptr {
			if *(*int32)(unsafe.Pointer(bp + 140)) > 0 {
				return scriptObj
			}
			return uintptr(0)
		}())
__50:
	;
	if !(granObj != uintptr(0)) {
		goto __51
	}
	XTcl_LimitSetGranularity(tls, childInterp, TCL_LIMIT_COMMANDS, *(*int32)(unsafe.Pointer(bp + 144 /* gran */)))
__51:
	;
	if !(limitObj != uintptr(0)) {
		goto __52
	}
	if !(*(*int32)(unsafe.Pointer(bp + 148)) > 0) {
		goto __53
	}
	XTcl_LimitSetCommands(tls, childInterp, *(*int32)(unsafe.Pointer(bp + 152 /* limit */)))
	XTcl_LimitTypeSet(tls, childInterp, TCL_LIMIT_COMMANDS)
	goto __54
__53:
	XTcl_LimitTypeReset(tls, childInterp, TCL_LIMIT_COMMANDS)
__54:
	;
__52:
	;
	return TCL_OK
__36:
	;
__26:
	;
__3:
	;
	return int32(0)
}

var options13 = [4]uintptr{
	ts + 15408, ts + 43557, ts + 43570, uintptr(0),
} /* tclInterp.c:4393:23 */

//----------------------------------------------------------------------
//
// ChildTimeLimitCmd --
//
//	Implementation of the [interp limit $i time] and [$i limit time]
//	subcommands. See the interp manual page for a full description.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Depends on the arguments.
//
//----------------------------------------------------------------------

func sChildTimeLimitCmd(tls *libc.TLS, interp uintptr, childInterp uintptr, consumedObjc int32, objc int32, objv uintptr) int32 { /* tclInterp.c:4574:1: */
	bp := tls.Alloc(348)
	defer tls.Free(348)

	var iPtr uintptr
	// var index int32 at bp+272, 4

	// var key ScriptLimitCallbackKey at bp+240, 16

	var limitCBPtr uintptr
	var hPtr uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr
	var empty uintptr
	// var limitMoment Tcl_Time at bp+256, 16

	var cachePtr2 uintptr
	var empty1 uintptr
	var dictPtr uintptr
	// var limitMoment1 Tcl_Time at bp+280, 16

	// var limitMoment2 Tcl_Time at bp+296, 16

	var i int32
	// var scriptLen int32 at bp+328, 4

	// var milliLen int32 at bp+336, 4

	// var secLen int32 at bp+344, 4

	var scriptObj uintptr
	var granObj uintptr
	var milliObj uintptr
	var secObj uintptr
	// var gran int32 at bp+332, 4

	// var limitMoment3 Tcl_Time at bp+312, 16

	// var tmp int32 at bp+340, 4
	iPtr = interp

	// First, ensure that we are not reading or writing the calling
	// interpreter's limits; it may only manipulate its children. Note that
	// the low level API enforces this with Tcl_Panic, which we want to
	// avoid. [Bug 3398794]

	if !(interp == childInterp) {
		goto __1
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+43410, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+41573, ts+43453, uintptr(0)))
	return TCL_ERROR
__1:
	;

	if !(objc == consumedObjc) {
		goto __2
	}

__4:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __7
	}
	dictPtr = XTclThreadAllocObj(tls)
	goto __8
__7:
	dictPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(dictPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__8:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = uintptr(0)

	(*ScriptLimitCallbackKey)(unsafe.Pointer(bp + 240 /* &key */)).Finterp = childInterp
	(*ScriptLimitCallbackKey)(unsafe.Pointer(bp + 240 /* &key */)).Ftype = int64(TCL_LIMIT_TIME)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 768 /* &.limit */ + 72 /* &.callbacks */)).FfindProc})).f(tls, iPtr+768 /* &.limit */ +72 /* &.callbacks */, bp+240 /* &key */)
	if !(hPtr != uintptr(0)) {
		goto __9
	}
	limitCBPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !(limitCBPtr != uintptr(0) && (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FscriptObj != uintptr(0)) {
		goto __11
	}
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, XTcl_NewStringObj(tls, options14[0], -1),
		(*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FscriptObj)
	goto __12
__11:
	goto putEmptyCommandInDict
__12:
	;
	goto __10
__9:
putEmptyCommandInDict:
	;
__13:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __16
	}
	empty = XTclThreadAllocObj(tls)
	goto __17
__16:
	empty = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(empty + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__17:
	;
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
	(*Tcl_Obj)(unsafe.Pointer(empty)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(empty)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(empty)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(empty)).FtypePtr = uintptr(0)

	XTcl_DictObjPut(tls, uintptr(0), dictPtr,
		XTcl_NewStringObj(tls, options14[0], -1), empty)
__10:
	;
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, XTcl_NewStringObj(tls, options14[1], -1),
		XTcl_NewIntObj(tls, XTcl_LimitGetGranularity(tls, childInterp,
			TCL_LIMIT_TIME)))

	if !(XTcl_LimitTypeEnabled(tls, childInterp, TCL_LIMIT_TIME) != 0) {
		goto __18
	}

	XTcl_LimitGetTime(tls, childInterp, bp+256)
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, XTcl_NewStringObj(tls, options14[2], -1),
		XTcl_NewLongObj(tls, (*Tcl_Time)(unsafe.Pointer(bp+256)).Fusec/int64(1000)))
	XTcl_DictObjPut(tls, uintptr(0), dictPtr, XTcl_NewStringObj(tls, options14[3], -1),
		XTcl_NewLongObj(tls, (*Tcl_Time)(unsafe.Pointer(bp+256 /* &limitMoment */)).Fsec))
	goto __19
__18:
	;
__20:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __23
	}
	empty1 = XTclThreadAllocObj(tls)
	goto __24
__23:
	empty1 = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(empty1 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__24:
	;
	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	(*Tcl_Obj)(unsafe.Pointer(empty1)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(empty1)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(empty1)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(empty1)).FtypePtr = uintptr(0)

	XTcl_DictObjPut(tls, uintptr(0), dictPtr,
		XTcl_NewStringObj(tls, options14[2], -1), empty1)
	XTcl_DictObjPut(tls, uintptr(0), dictPtr,
		XTcl_NewStringObj(tls, options14[3], -1), empty1)
__19:
	;
	XTcl_SetObjResult(tls, interp, dictPtr)
	return TCL_OK
	goto __3
__2:
	if !(objc == consumedObjc+1) {
		goto __25
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(consumedObjc)*8)), uintptr(unsafe.Pointer(&options14)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+272) != TCL_OK) {
		goto __27
	}
	return TCL_ERROR
__27:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 272 /* index */))) {
	case uint32(0) /* OPT_CMD */ :
		goto __29
	case uint32(1) /* OPT_GRAN */ :
		goto __30
	case uint32(2) /* OPT_MILLI */ :
		goto __31
	case uint32(3) /* OPT_SEC */ :
		goto __32
	}
	goto __28
__29:
	(*ScriptLimitCallbackKey)(unsafe.Pointer(bp + 240 /* &key */)).Finterp = childInterp
	(*ScriptLimitCallbackKey)(unsafe.Pointer(bp + 240 /* &key */)).Ftype = int64(TCL_LIMIT_TIME)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 768 /* &.limit */ + 72 /* &.callbacks */)).FfindProc})).f(tls, iPtr+768 /* &.limit */ +72 /* &.callbacks */, bp+240 /* &key */)
	if !(hPtr != uintptr(0)) {
		goto __33
	}
	limitCBPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !(limitCBPtr != uintptr(0) && (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FscriptObj != uintptr(0)) {
		goto __34
	}
	XTcl_SetObjResult(tls, interp, (*ScriptLimitCallback)(unsafe.Pointer(limitCBPtr)).FscriptObj)
__34:
	;
__33:
	;
	goto __28
__30:
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls,
		XTcl_LimitGetGranularity(tls, childInterp, TCL_LIMIT_TIME)))
	goto __28
__31:
	if !(XTcl_LimitTypeEnabled(tls, childInterp, TCL_LIMIT_TIME) != 0) {
		goto __35
	}

	XTcl_LimitGetTime(tls, childInterp, bp+280)
	XTcl_SetObjResult(tls, interp,
		XTcl_NewLongObj(tls, (*Tcl_Time)(unsafe.Pointer(bp+280)).Fusec/int64(1000)))
__35:
	;
	goto __28
__32:
	if !(XTcl_LimitTypeEnabled(tls, childInterp, TCL_LIMIT_TIME) != 0) {
		goto __36
	}

	XTcl_LimitGetTime(tls, childInterp, bp+296)
	XTcl_SetObjResult(tls, interp, XTcl_NewLongObj(tls, (*Tcl_Time)(unsafe.Pointer(bp+296 /* &limitMoment2 */)).Fsec))
__36:
	;
	goto __28
__28:
	;
	return TCL_OK
	goto __26
__25:
	if !((objc-consumedObjc)&1 != 0) {
		goto __37
	}
	XTcl_WrongNumArgs(tls, interp, consumedObjc, objv, ts+43458)
	return TCL_ERROR
	goto __38
__37:
	*(*int32)(unsafe.Pointer(bp + 328 /* scriptLen */)) = 0
	*(*int32)(unsafe.Pointer(bp + 336 /* milliLen */)) = 0
	*(*int32)(unsafe.Pointer(bp + 344 /* secLen */)) = 0
	scriptObj = uintptr(0)
	granObj = uintptr(0)
	milliObj = uintptr(0)
	secObj = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 332 /* gran */)) = 0

	XTcl_LimitGetTime(tls, childInterp, bp+312)
	i = consumedObjc
__39:
	if !(i < objc) {
		goto __41
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options14)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+272) != TCL_OK) {
		goto __42
	}
	return TCL_ERROR
__42:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 272 /* index */))) {
	case uint32(0) /* OPT_CMD */ :
		goto __44
	case uint32(1) /* OPT_GRAN */ :
		goto __45
	case uint32(2) /* OPT_MILLI */ :
		goto __46
	case uint32(3) /* OPT_SEC */ :
		goto __47
	}
	goto __43
__44:
	scriptObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+328)
	goto __43
__45:
	granObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 332)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+332)
	}() != TCL_OK) {
		goto __48
	}
	return TCL_ERROR
__48:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 332)) < 1) {
		goto __49
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+43478, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7420, ts+41573,
		ts+43509, uintptr(0)))
	return TCL_ERROR
__49:
	;
	goto __43
__46:
	milliObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+336)
	if !(*(*int32)(unsafe.Pointer(bp + 336)) == 0) {
		goto __50
	}
	goto __43
__50:
	;
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 340)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+340)
	}() != TCL_OK) {
		goto __51
	}
	return TCL_ERROR
__51:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 340)) < 0) {
		goto __52
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+43577, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, ts+3593, ts+7420, ts+41573,
		ts+43509, uintptr(0)))
	return TCL_ERROR
__52:
	;
	(*Tcl_Time)(unsafe.Pointer(bp + 312 /* &limitMoment3 */)).Fusec = int64(*(*int32)(unsafe.Pointer(bp + 340))) * int64(1000)
	goto __43
__47:
	secObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+344)
	if !(*(*int32)(unsafe.Pointer(bp + 344)) == 0) {
		goto __53
	}
	goto __43
__53:
	;
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 340)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)), bp+340)
	}() != TCL_OK) {
		goto __54
	}
	return TCL_ERROR
__54:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 340)) < 0) {
		goto __55
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+43609, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+120, ts+3593, ts+7420, ts+41573,
		ts+43509, uintptr(0)))
	return TCL_ERROR
__55:
	;
	(*Tcl_Time)(unsafe.Pointer(bp + 312 /* &limitMoment3 */)).Fsec = int64(*(*int32)(unsafe.Pointer(bp + 340 /* tmp */)))
	goto __43
__43:
	;
	goto __40
__40:
	i = i + 2
	goto __39
	goto __41
__41:
	;
	if !(milliObj != uintptr(0) || secObj != uintptr(0)) {
		goto __56
	}
	if !(milliObj != uintptr(0)) {
		goto __57
	}
	// Setting -milliseconds but clearing -seconds, or resetting
	// -milliseconds but not resetting -seconds? Bad voodoo!

	if !(secObj != uintptr(0) && *(*int32)(unsafe.Pointer(bp + 344)) == 0 && *(*int32)(unsafe.Pointer(bp + 336)) > 0) {
		goto __58
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+43636, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+160, ts+3593, ts+7420, ts+41573,
		ts+43699, uintptr(0)))
	return TCL_ERROR
__58:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 336)) == 0 && (secObj == uintptr(0) || *(*int32)(unsafe.Pointer(bp + 344)) > 0)) {
		goto __59
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+43708, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+200, ts+3593, ts+7420, ts+41573,
		ts+43699, uintptr(0)))
	return TCL_ERROR
__59:
	;
__57:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 336)) > 0 || *(*int32)(unsafe.Pointer(bp + 344)) > 0) {
		goto __60
	}
	// Force usec to be in range [0..1000000), possibly
	// incrementing sec in the process. This makes it much easier
	// for people to write scripts that do small time increments.

	*(*int64)(unsafe.Pointer(bp + 312)) += (*Tcl_Time)(unsafe.Pointer(bp+312)).Fusec / int64(1000000)
	*(*int64)(unsafe.Pointer(bp + 312 + 8)) %= int64(1000000)

	XTcl_LimitSetTime(tls, childInterp, bp+312)
	XTcl_LimitTypeSet(tls, childInterp, TCL_LIMIT_TIME)
	goto __61
__60:
	XTcl_LimitTypeReset(tls, childInterp, TCL_LIMIT_TIME)
__61:
	;
__56:
	;
	if !(scriptObj != uintptr(0)) {
		goto __62
	}
	sSetScriptLimitCallback(tls, interp, TCL_LIMIT_TIME, childInterp,
		func() uintptr {
			if *(*int32)(unsafe.Pointer(bp + 328)) > 0 {
				return scriptObj
			}
			return uintptr(0)
		}())
__62:
	;
	if !(granObj != uintptr(0)) {
		goto __63
	}
	XTcl_LimitSetGranularity(tls, childInterp, TCL_LIMIT_TIME, *(*int32)(unsafe.Pointer(bp + 332 /* gran */)))
__63:
	;
	return TCL_OK
__38:
	;
__26:
	;
__3:
	;
	return int32(0)
}

var options14 = [5]uintptr{
	ts + 15408, ts + 43557, ts + 11240, ts + 43769, uintptr(0),
} /* tclInterp.c:4581:23 */

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// For each linked variable there is a data structure of the following type,
// which describes the link and is the clientData for the trace set on the Tcl
// variable.

type Link1 = struct {
	Finterp      uintptr
	FnsPtr       uintptr
	FvarName     uintptr
	Faddr        uintptr
	Ftype        int32
	F__ccgo_pad1 [4]byte
	FlastValue   struct {
		F__ccgo_pad1 [0]uint64
		Fc           int8
		F__ccgo_pad2 [7]byte
	}
	Fflags       int32
	F__ccgo_pad2 [4]byte
} /* tclLink.c:24:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// For each linked variable there is a data structure of the following type,
// which describes the link and is the clientData for the trace set on the Tcl
// variable.

type Link = Link1 /* tclLink.c:50:3 */

// Convenience macro for accessing the value of the C variable pointed to by a
// link. Note that this macro produces something that may be regarded as an
// lvalue or rvalue; it may be assigned to as well as read. Also note that
// this macro assumes the name of the variable being accessed (linkPtr); this
// is not strictly a good thing, but it keeps the code much shorter and
// cleaner.

//----------------------------------------------------------------------
//
// Tcl_LinkVar --
//
//	Link a C variable to a Tcl variable so that changes to either one
//	causes the other to change.
//
// Results:
//	The return value is TCL_OK if everything went well or TCL_ERROR if an
//	error occurred (the interp's result is also set after errors).
//
// Side effects:
//	The value at *addr is linked to the Tcl variable "varName", using
//	"type" to convert between string values for Tcl and binary values for
//	*addr.
//
//----------------------------------------------------------------------

func XTcl_LinkVar(tls *libc.TLS, interp uintptr, varName uintptr, addr uintptr, type1 int32) int32 { /* tclLink.c:107:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var objPtr uintptr
	var linkPtr uintptr
	// var dummy uintptr at bp+8, 8

	// var name uintptr at bp+16, 8

	var code int32

	linkPtr = XTcl_VarTraceInfo2(tls, interp, varName, uintptr(0),
		TCL_GLOBAL_ONLY, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sLinkTraceProc})), uintptr(0))
	if linkPtr != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+43778, libc.VaList(bp, varName)))
		return TCL_ERROR
	}

	linkPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Link{})))
	(*Link)(unsafe.Pointer(linkPtr)).Finterp = interp
	(*Link)(unsafe.Pointer(linkPtr)).FnsPtr = uintptr(0)
	(*Link)(unsafe.Pointer(linkPtr)).FvarName = XTcl_NewStringObj(tls, varName, -1)
	(*Tcl_Obj)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).FvarName)).FrefCount++
	(*Link)(unsafe.Pointer(linkPtr)).Faddr = addr
	(*Link)(unsafe.Pointer(linkPtr)).Ftype = type1 & libc.CplInt32(TCL_LINK_READ_ONLY)
	if type1&TCL_LINK_READ_ONLY != 0 {
		(*Link)(unsafe.Pointer(linkPtr)).Fflags = LINK_READ_ONLY
	} else {
		(*Link)(unsafe.Pointer(linkPtr)).Fflags = 0
	}
	objPtr = sObjValue(tls, linkPtr)
	if XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), objPtr,
		TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Link)(unsafe.Pointer(linkPtr)).FvarName
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		XTclpFree(tls, linkPtr)
		return TCL_ERROR
	}

	XTclGetNamespaceForQualName(tls, interp, varName, uintptr(0), TCL_GLOBAL_ONLY,
		linkPtr+8, bp+8, bp+8, bp+16)
	(*Namespace)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).FnsPtr)).FrefCount++

	code = XTcl_TraceVar2(tls, interp, varName, uintptr(0),
		TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sLinkTraceProc})), linkPtr)
	if code != TCL_OK {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*Link)(unsafe.Pointer(linkPtr)).FvarName
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		XTclNsDecrRefCount(tls, (*Link)(unsafe.Pointer(linkPtr)).FnsPtr)
		XTclpFree(tls, linkPtr)
	}
	return code
}

//----------------------------------------------------------------------
//
// Tcl_UnlinkVar --
//
//	Destroy the link between a Tcl variable and a C variable.
//
// Results:
//	None.
//
// Side effects:
//	If "varName" was previously linked to a C variable, the link is broken
//	to make the variable independent. If there was no previous link for
//	"varName" then nothing happens.
//
//----------------------------------------------------------------------

func XTcl_UnlinkVar(tls *libc.TLS, interp uintptr, varName uintptr) { /* tclLink.c:183:1: */
	var linkPtr uintptr = XTcl_VarTraceInfo2(tls, interp, varName, uintptr(0),
		TCL_GLOBAL_ONLY, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sLinkTraceProc})), uintptr(0))

	if linkPtr == uintptr(0) {
		return
	}
	XTcl_UntraceVar2(tls, interp, varName, uintptr(0),
		TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sLinkTraceProc})), linkPtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = (*Link)(unsafe.Pointer(linkPtr)).FvarName
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if (*Link)(unsafe.Pointer(linkPtr)).FnsPtr != 0 {
		XTclNsDecrRefCount(tls, (*Link)(unsafe.Pointer(linkPtr)).FnsPtr)
	}
	XTclpFree(tls, linkPtr)
}

//----------------------------------------------------------------------
//
// Tcl_UpdateLinkedVar --
//
//	This function is invoked after a linked variable has been changed by C
//	code. It updates the Tcl variable so that traces on the variable will
//	trigger.
//
// Results:
//	None.
//
// Side effects:
//	The Tcl variable "varName" is updated from its C value, causing traces
//	on the variable to trigger.
//
//----------------------------------------------------------------------

func XTcl_UpdateLinkedVar(tls *libc.TLS, interp uintptr, varName uintptr) { /* tclLink.c:223:1: */
	var linkPtr uintptr = XTcl_VarTraceInfo2(tls, interp, varName, uintptr(0),
		TCL_GLOBAL_ONLY, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sLinkTraceProc})), uintptr(0))
	var savedFlag int32

	if linkPtr == uintptr(0) {
		return
	}
	savedFlag = (*Link)(unsafe.Pointer(linkPtr)).Fflags & LINK_BEING_UPDATED
	*(*int32)(unsafe.Pointer(linkPtr + 48)) |= LINK_BEING_UPDATED
	XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
		TCL_GLOBAL_ONLY)
	// Callback may have unlinked the variable. [Bug 1740631]
	linkPtr = XTcl_VarTraceInfo2(tls, interp, varName, uintptr(0),
		TCL_GLOBAL_ONLY, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sLinkTraceProc})), uintptr(0))
	if linkPtr != uintptr(0) {
		(*Link)(unsafe.Pointer(linkPtr)).Fflags = (*Link)(unsafe.Pointer(linkPtr)).Fflags&libc.CplInt32(LINK_BEING_UPDATED) | savedFlag
	}
}

//----------------------------------------------------------------------
//
// LinkTraceProc --
//
//	This function is invoked when a linked Tcl variable is read, written,
//	or unset from Tcl. It's responsible for keeping the C variable in sync
//	with the Tcl variable.
//
// Results:
//	If all goes well, NULL is returned; otherwise an error message is
//	returned.
//
// Side effects:
//	The C variable may be updated to make it consistent with the Tcl
//	variable, or the Tcl variable may be overwritten to reject a
//	modification.
//
//----------------------------------------------------------------------

func sLinkTraceProc(tls *libc.TLS, clientData ClientData, interp uintptr, name1 uintptr, name2 uintptr, flags int32) uintptr { /* tclLink.c:269:13: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var linkPtr uintptr = clientData
	var changed int32
	var valueLength Size_t
	var value uintptr
	var pp uintptr
	var valueObj uintptr
	// var valueInt int32 at bp, 4

	// var valueWide Tcl_WideInt at bp+8, 8

	// var valueDouble float64 at bp+16, 8

	// If the variable is being unset, then just re-create it (with a trace)
	// unless the whole interpreter is going away.

	if flags&TCL_TRACE_UNSETS != 0 {
		if XTcl_InterpDeleted(tls, interp) != 0 || XTclNamespaceDeleted(tls, (*Link)(unsafe.Pointer(linkPtr)).FnsPtr) != 0 {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = (*Link)(unsafe.Pointer(linkPtr)).FvarName
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			if (*Link)(unsafe.Pointer(linkPtr)).FnsPtr != 0 {
				XTclNsDecrRefCount(tls, (*Link)(unsafe.Pointer(linkPtr)).FnsPtr)
			}
			XTclpFree(tls, linkPtr)
		} else if flags&TCL_TRACE_DESTROYED != 0 {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			XTcl_TraceVar2(tls, interp, XTcl_GetString(tls, (*Link)(unsafe.Pointer(linkPtr)).FvarName), uintptr(0),
				TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|
					TCL_TRACE_UNSETS, *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
				}{sLinkTraceProc})), linkPtr)
		}
		return uintptr(0)
	}

	// If we were invoked because of a call to Tcl_UpdateLinkedVar, then don't
	// do anything at all. In particular, we don't want to get upset that the
	// variable is being modified, even if it is supposed to be read-only.

	if (*Link)(unsafe.Pointer(linkPtr)).Fflags&LINK_BEING_UPDATED != 0 {
		return uintptr(0)
	}

	// For read accesses, update the Tcl variable if the C variable has
	// changed since the last time we updated the Tcl variable.

	if flags&TCL_TRACE_READS != 0 {
		switch (*Link)(unsafe.Pointer(linkPtr)).Ftype {
		case TCL_LINK_INT:
			fallthrough
		case TCL_LINK_BOOLEAN:
			changed = libc.Bool32(*(*int32)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) != *(*int32)(unsafe.Pointer(linkPtr + 40)))
			break
			fallthrough
		case TCL_LINK_DOUBLE:
			changed = libc.Bool32(*(*float64)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) != *(*float64)(unsafe.Pointer(linkPtr + 40)))
			break
			fallthrough
		case TCL_LINK_WIDE_INT:
			changed = libc.Bool32(*(*Tcl_WideInt)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) != *(*Tcl_WideInt)(unsafe.Pointer(linkPtr + 40)))
			break
			fallthrough
		case TCL_LINK_WIDE_UINT:
			changed = libc.Bool32(*(*Tcl_WideUInt)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) != *(*Tcl_WideUInt)(unsafe.Pointer(linkPtr + 40)))
			break
			fallthrough
		case TCL_LINK_CHAR:
			changed = libc.Bool32(int32(*(*int8)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))) != int32(*(*int8)(unsafe.Pointer(linkPtr + 40))))
			break
			fallthrough
		case TCL_LINK_UCHAR:
			changed = libc.Bool32(int32(*(*uint8)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))) != int32(*(*uint8)(unsafe.Pointer(linkPtr + 40))))
			break
			fallthrough
		case TCL_LINK_SHORT:
			changed = libc.Bool32(int32(*(*int16)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))) != int32(*(*int16)(unsafe.Pointer(linkPtr + 40))))
			break
			fallthrough
		case TCL_LINK_USHORT:
			changed = libc.Bool32(int32(*(*uint16)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))) != int32(*(*uint16)(unsafe.Pointer(linkPtr + 40))))
			break
			fallthrough
		case TCL_LINK_UINT:
			changed = libc.Bool32(*(*uint32)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) != *(*uint32)(unsafe.Pointer(linkPtr + 40)))
			break
			fallthrough
		case TCL_LINK_LONG:
			changed = libc.Bool32(*(*int64)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) != *(*int64)(unsafe.Pointer(linkPtr + 40)))
			break
			fallthrough
		case TCL_LINK_ULONG:
			changed = libc.Bool32(*(*uint64)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) != *(*uint64)(unsafe.Pointer(linkPtr + 40)))
			break
			fallthrough
		case TCL_LINK_FLOAT:
			changed = libc.Bool32(*(*float32)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) != *(*float32)(unsafe.Pointer(linkPtr + 40)))
			break
			fallthrough
		case TCL_LINK_STRING:
			changed = 1
			break
			fallthrough
		default:
			return ts + 43810 /* "internal error: ..." */
		}
		if changed != 0 {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
		}
		return uintptr(0)
	}

	// For writes, first make sure that the variable is writable. Then convert
	// the Tcl value to C if possible. If the variable isn't writable or can't
	// be converted, then restore the varaible's old value and return an
	// error. Another tricky thing: we have to save and restore the interp's
	// result, since the variable access could occur when the result has been
	// partially set.

	if (*Link)(unsafe.Pointer(linkPtr)).Fflags&LINK_READ_ONLY != 0 {
		XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
			TCL_GLOBAL_ONLY)
		return ts + 43851 /* "linked variable ..." */
	}
	valueObj = XTcl_ObjGetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), TCL_GLOBAL_ONLY)
	if valueObj == uintptr(0) {
		// This shouldn't ever happen.

		return ts + 43880 /* "internal error: ..." */
	}

	switch (*Link)(unsafe.Pointer(linkPtr)).Ftype {
	case TCL_LINK_INT:
		if XTcl_GetIntFromObj(tls, uintptr(0), valueObj, linkPtr+40) != TCL_OK &&
			XGetInvalidIntFromObj(tls, valueObj, linkPtr+40) != TCL_OK {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 43929 /* "variable must ha..." */
		}
		*(*int32)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = *(*int32)(unsafe.Pointer(linkPtr + 40))
		break

	case TCL_LINK_WIDE_INT:
		if XTcl_GetWideIntFromObj(tls, uintptr(0), valueObj, linkPtr+40) != TCL_OK &&
			XGetInvalidWideFromObj(tls, valueObj, linkPtr+40) != TCL_OK {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 43929 /* "variable must ha..." */
		}
		*(*Tcl_WideInt)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = *(*Tcl_WideInt)(unsafe.Pointer(linkPtr + 40))
		break

	case TCL_LINK_DOUBLE:
		if XTcl_GetDoubleFromObj(tls, uintptr(0), valueObj, linkPtr+40) != TCL_OK {
			if XGetInvalidDoubleFromObj(tls, valueObj, linkPtr+40) != TCL_OK {
				XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
					TCL_GLOBAL_ONLY)
				return ts + 43962 /* "variable must ha..." */
			}
		}
		*(*float64)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = *(*float64)(unsafe.Pointer(linkPtr + 40))
		break

	case TCL_LINK_BOOLEAN:
		if XTcl_GetBooleanFromObj(tls, uintptr(0), valueObj, linkPtr+40) != TCL_OK {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 43992 /* "variable must ha..." */
		}
		*(*int32)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = *(*int32)(unsafe.Pointer(linkPtr + 40))
		break

	case TCL_LINK_CHAR:
		if XTcl_GetIntFromObj(tls, uintptr(0), valueObj, bp) != TCL_OK &&
			XGetInvalidIntFromObj(tls, valueObj, bp) != TCL_OK ||
			*(*int32)(unsafe.Pointer(bp)) < -0x7f-1 || *(*int32)(unsafe.Pointer(bp)) > 0x7f {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 44025 /* "variable must ha..." */
		}
		*(*int8)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = libc.AssignPtrInt8(linkPtr+40, int8(*(*int32)(unsafe.Pointer(bp /* valueInt */))))
		break

	case TCL_LINK_UCHAR:
		if XTcl_GetIntFromObj(tls, uintptr(0), valueObj, bp) != TCL_OK &&
			XGetInvalidIntFromObj(tls, valueObj, bp) != TCL_OK ||
			*(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > 0x7f*2+1 {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 44055 /* "variable must ha..." */
		}
		*(*uint8)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = libc.AssignPtrUint8(linkPtr+40, uint8(*(*int32)(unsafe.Pointer(bp /* valueInt */))))
		break

	case TCL_LINK_SHORT:
		if XTcl_GetIntFromObj(tls, uintptr(0), valueObj, bp) != TCL_OK &&
			XGetInvalidIntFromObj(tls, valueObj, bp) != TCL_OK ||
			*(*int32)(unsafe.Pointer(bp)) < -0x7fff-1 || *(*int32)(unsafe.Pointer(bp)) > 0x7fff {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 44094 /* "variable must ha..." */
		}
		*(*int16)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = libc.AssignPtrInt16(linkPtr+40, int16(*(*int32)(unsafe.Pointer(bp /* valueInt */))))
		break

	case TCL_LINK_USHORT:
		if XTcl_GetIntFromObj(tls, uintptr(0), valueObj, bp) != TCL_OK &&
			XGetInvalidIntFromObj(tls, valueObj, bp) != TCL_OK ||
			*(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > 0x7fff*2+1 {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 44125 /* "variable must ha..." */
		}
		*(*uint16)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = libc.AssignPtrUint16(linkPtr+40, uint16(*(*int32)(unsafe.Pointer(bp /* valueInt */))))
		break

	case TCL_LINK_UINT:
		if XTcl_GetWideIntFromObj(tls, uintptr(0), valueObj, bp+8) != TCL_OK &&
			XGetInvalidWideFromObj(tls, valueObj, bp+8) != TCL_OK ||
			*(*Tcl_WideInt)(unsafe.Pointer(bp + 8)) < int64(0) || *(*Tcl_WideInt)(unsafe.Pointer(bp + 8)) > int64(uint32(0x7fffffff)*2+1) {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 44165 /* "variable must ha..." */
		}
		*(*uint32)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = libc.AssignPtrUint32(linkPtr+40, uint32(*(*Tcl_WideInt)(unsafe.Pointer(bp + 8 /* valueWide */))))
		break

	case TCL_LINK_LONG:
		if XTcl_GetWideIntFromObj(tls, uintptr(0), valueObj, bp+8) != TCL_OK &&
			XGetInvalidWideFromObj(tls, valueObj, bp+8) != TCL_OK ||
			*(*Tcl_WideInt)(unsafe.Pointer(bp + 8)) < -0x7fffffffffffffff-1 || *(*Tcl_WideInt)(unsafe.Pointer(bp + 8)) > 0x7fffffffffffffff {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 44203 /* "variable must ha..." */
		}
		*(*int64)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = libc.AssignPtrInt64(linkPtr+40, *(*Tcl_WideInt)(unsafe.Pointer(bp + 8 /* valueWide */)))
		break

	case TCL_LINK_ULONG:
		if XTcl_GetWideIntFromObj(tls, uintptr(0), valueObj, bp+8) != TCL_OK &&
			XGetInvalidWideFromObj(tls, valueObj, bp+8) != TCL_OK ||
			*(*Tcl_WideInt)(unsafe.Pointer(bp + 8)) < int64(0) || Tcl_WideUInt(*(*Tcl_WideInt)(unsafe.Pointer(bp + 8))) > uint64(0x7fffffffffffffff)*2+1 {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 44233 /* "variable must ha..." */
		}
		*(*uint64)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = libc.AssignPtrUint64(linkPtr+40, uint64(*(*Tcl_WideInt)(unsafe.Pointer(bp + 8 /* valueWide */))))
		break

	case TCL_LINK_WIDE_UINT:
		// FIXME: represent as a bignum.
		if XTcl_GetWideIntFromObj(tls, uintptr(0), valueObj, bp+8) != TCL_OK &&
			XGetInvalidWideFromObj(tls, valueObj, bp+8) != TCL_OK {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 44272 /* "variable must ha..." */
		}
		*(*Tcl_WideUInt)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = libc.AssignPtrUint64(linkPtr+40, Tcl_WideUInt(*(*Tcl_WideInt)(unsafe.Pointer(bp + 8 /* valueWide */))))
		break

	case TCL_LINK_FLOAT:
		if XTcl_GetDoubleFromObj(tls, uintptr(0), valueObj, bp+16) != TCL_OK &&
			XGetInvalidDoubleFromObj(tls, valueObj, bp+16) != TCL_OK ||
			*(*float64)(unsafe.Pointer(bp + 16)) < float64(-3.40282346638528859811704183484516925e+38) || *(*float64)(unsafe.Pointer(bp + 16)) > 3.40282346638528859811704183484516925e+38 {
			XTcl_ObjSetVar2(tls, interp, (*Link)(unsafe.Pointer(linkPtr)).FvarName, uintptr(0), sObjValue(tls, linkPtr),
				TCL_GLOBAL_ONLY)
			return ts + 44315 /* "variable must ha..." */
		}
		*(*float32)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr)) = libc.AssignPtrFloat32(linkPtr+40, float32(*(*float64)(unsafe.Pointer(bp + 16 /* valueDouble */))))
		break

	case TCL_LINK_STRING:
		value = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(valueObj)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(valueObj)).Fbytes
			}
			return XTcl_GetString(tls, valueObj)
		}()
		valueLength = Size_t((*Tcl_Obj)(unsafe.Pointer(valueObj)).Flength + 1)
		pp = (*Link)(unsafe.Pointer(linkPtr)).Faddr

		*(*uintptr)(unsafe.Pointer(pp)) = XTcl_Realloc(tls, *(*uintptr)(unsafe.Pointer(pp)), uint32(valueLength))
		libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(pp)), value, valueLength)
		break

	default:
		return ts + 43810 /* "internal error: ..." */
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// ObjValue --
//
//	Converts the value of a C variable to a Tcl_Obj* for use in a Tcl
//	variable to which it is linked.
//
// Results:
//	The return value is a pointer to a Tcl_Obj that represents the value
//	of the C variable given by linkPtr.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sObjValue(tls *libc.TLS, linkPtr uintptr) uintptr { /* tclLink.c:581:16: */
	var p uintptr
	var resultObj uintptr

	switch (*Link)(unsafe.Pointer(linkPtr)).Ftype {
	case TCL_LINK_INT:
		*(*int32)(unsafe.Pointer(linkPtr + 40)) = *(*int32)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(linkPtr + 40)))
	case TCL_LINK_WIDE_INT:
		*(*Tcl_WideInt)(unsafe.Pointer(linkPtr + 40)) = *(*Tcl_WideInt)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewWideIntObj(tls, *(*Tcl_WideInt)(unsafe.Pointer(linkPtr + 40)))
	case TCL_LINK_DOUBLE:
		*(*float64)(unsafe.Pointer(linkPtr + 40)) = *(*float64)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewDoubleObj(tls, *(*float64)(unsafe.Pointer(linkPtr + 40)))
	case TCL_LINK_BOOLEAN:
		*(*int32)(unsafe.Pointer(linkPtr + 40)) = *(*int32)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewIntObj(tls, libc.Bool32(libc.Bool32(*(*int32)(unsafe.Pointer(linkPtr + 40)) != 0) != 0))
	case TCL_LINK_CHAR:
		*(*int8)(unsafe.Pointer(linkPtr + 40)) = *(*int8)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewIntObj(tls, int32(*(*int8)(unsafe.Pointer(linkPtr + 40))))
	case TCL_LINK_UCHAR:
		*(*uint8)(unsafe.Pointer(linkPtr + 40)) = *(*uint8)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewIntObj(tls, int32(*(*uint8)(unsafe.Pointer(linkPtr + 40))))
	case TCL_LINK_SHORT:
		*(*int16)(unsafe.Pointer(linkPtr + 40)) = *(*int16)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewIntObj(tls, int32(*(*int16)(unsafe.Pointer(linkPtr + 40))))
	case TCL_LINK_USHORT:
		*(*uint16)(unsafe.Pointer(linkPtr + 40)) = *(*uint16)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewIntObj(tls, int32(*(*uint16)(unsafe.Pointer(linkPtr + 40))))
	case TCL_LINK_UINT:
		*(*uint32)(unsafe.Pointer(linkPtr + 40)) = *(*uint32)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewWideIntObj(tls, Tcl_WideInt(*(*uint32)(unsafe.Pointer(linkPtr + 40))))
	case TCL_LINK_LONG:
		*(*int64)(unsafe.Pointer(linkPtr + 40)) = *(*int64)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewWideIntObj(tls, *(*int64)(unsafe.Pointer(linkPtr + 40)))
	case TCL_LINK_ULONG:
		*(*uint64)(unsafe.Pointer(linkPtr + 40)) = *(*uint64)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewWideIntObj(tls, Tcl_WideInt(*(*uint64)(unsafe.Pointer(linkPtr + 40))))
	case TCL_LINK_FLOAT:
		*(*float32)(unsafe.Pointer(linkPtr + 40)) = *(*float32)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		return XTcl_NewDoubleObj(tls, float64(*(*float32)(unsafe.Pointer(linkPtr + 40))))
	case TCL_LINK_WIDE_UINT:
		*(*Tcl_WideUInt)(unsafe.Pointer(linkPtr + 40)) = *(*Tcl_WideUInt)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		// FIXME: represent as a bignum.
		return XTcl_NewWideIntObj(tls, Tcl_WideInt(*(*Tcl_WideUInt)(unsafe.Pointer(linkPtr + 40))))
	case TCL_LINK_STRING:
		p = *(*uintptr)(unsafe.Pointer((*Link)(unsafe.Pointer(linkPtr)).Faddr))
		if p == uintptr(0) {
			for ok := true; ok; ok = 0 != 0 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						resultObj = XTclThreadAllocObj(tls)
					} else {
						resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
				if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
					(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
				} else {
					(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
					libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes, ts+44346, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
					*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes + 4)) = int8(0)
					(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
				}
				(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)
				{
				}
			}
			return resultObj
		}
		return XTcl_NewStringObj(tls, p, -1)

	// This code only gets executed if the link type is unknown (shouldn't
	// ever happen).

	default:
		for ok2 := true; ok2; ok2 = 0 != 0 {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					resultObj = XTclThreadAllocObj(tls)
				} else {
					resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes, ts+44351, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes + 2)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)
			{
			}
		}
		return resultObj
	}
	return uintptr(0)
}

var invalidRealType = Tcl_ObjType{
	Fname: ts + 44354,
} /* tclLink.c:652:20 */

func sSetInvalidRealFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclLink.c:661:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var length int32 at bp, 4

	var str uintptr
	// var endPtr uintptr at bp+8, 8

	str = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp)
	}()
	if *(*int32)(unsafe.Pointer(bp)) == 1 && int32(*(*int8)(unsafe.Pointer(str))) == '.' {
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&invalidRealType))
		*(*float64)(unsafe.Pointer(objPtr + 32)) = 0.0
		return TCL_OK
	}
	if XTclParseNumber(tls, uintptr(0), objPtr, uintptr(0), str, *(*int32)(unsafe.Pointer(bp)), bp+8,
		TCL_PARSE_DECIMAL_ONLY) == TCL_OK {
		// If number is followed by [eE][+-]?, then it is an invalid
		// double, but it could be the start of a valid double.
		if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) == 'e' || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) == 'E' {
			*(*uintptr)(unsafe.Pointer(bp + 8 /* endPtr */))++
			if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) == '+' || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) == '-' {
				*(*uintptr)(unsafe.Pointer(bp + 8 /* endPtr */))++
			}
			if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) == 0 {
				*(*float64)(unsafe.Pointer(bp + 16 /* doubleValue */)) = 0.0
				XTcl_GetDoubleFromObj(tls, uintptr(0), objPtr, bp+16)
				if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != 0 {
					(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
				}
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&invalidRealType))
				*(*float64)(unsafe.Pointer(objPtr + 32)) = *(*float64)(unsafe.Pointer(bp + 16 /* doubleValue */))
				return TCL_OK
			}
		}
	}
	return TCL_ERROR
}

// This function checks for integer representations, which are valid
// when linking with C variables, but which are invalid in other
// contexts in Tcl. Handled are "+", "-", "", "0x", "0b" and "0o"
// (upperand lowercase). See bug [39f6304c2e].
func XGetInvalidIntFromObj(tls *libc.TLS, objPtr uintptr, intPtr uintptr) int32 { /* tclLink.c:700:1: */
	var str uintptr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == 0 || (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == 2 && int32(*(*int8)(unsafe.Pointer(str))) == '0' && libc.Xstrchr(tls, ts+44366, int32(*(*int8)(unsafe.Pointer(str + 1)))) != 0 {
		*(*int32)(unsafe.Pointer(intPtr)) = 0
		return TCL_OK
	} else if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == 1 && libc.Xstrchr(tls, ts+44373, int32(*(*int8)(unsafe.Pointer(str)))) != 0 {
		*(*int32)(unsafe.Pointer(intPtr)) = libc.Bool32(int32(*(*int8)(unsafe.Pointer(str))) == '+')
		return TCL_OK
	}
	return TCL_ERROR
}

func XGetInvalidWideFromObj(tls *libc.TLS, objPtr uintptr, widePtr uintptr) int32 { /* tclLink.c:717:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var intValue int32 at bp, 4

	if XGetInvalidIntFromObj(tls, objPtr, bp) != TCL_OK {
		return TCL_ERROR
	}
	*(*Tcl_WideInt)(unsafe.Pointer(widePtr)) = Tcl_WideInt(*(*int32)(unsafe.Pointer(bp /* intValue */)))
	return TCL_OK
}

// This function checks for double representations, which are valid
// when linking with C variables, but which are invalid in other
// contexts in Tcl. Handled are "+", "-", "", ".", "0x", "0b" and "0o"
// (upper- and lowercase) and sequences like "1e-". See bug [39f6304c2e].
func XGetInvalidDoubleFromObj(tls *libc.TLS, objPtr uintptr, doublePtr uintptr) int32 { /* tclLink.c:735:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var intValue int32 at bp, 4

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&invalidRealType))) {
		goto __1
	}
	goto gotdouble
__1:
	;
	if !(XGetInvalidIntFromObj(tls, objPtr, bp) == TCL_OK) {
		goto __2
	}
	*(*float64)(unsafe.Pointer(doublePtr)) = float64(*(*int32)(unsafe.Pointer(bp /* intValue */)))
	return TCL_OK
__2:
	;
	if !(sSetInvalidRealFromAny(tls, uintptr(0), objPtr) == TCL_OK) {
		goto __3
	}
gotdouble:
	*(*float64)(unsafe.Pointer(doublePtr)) = *(*float64)(unsafe.Pointer(objPtr + 32))
	return TCL_OK
__3:
	;
	return TCL_ERROR
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The structure below defines the list Tcl object type by means of functions
// that can be invoked by generic object code.
//
// The internal representation of a list object is a two-pointer
// representation. The first pointer designates a List structure that contains
// an array of pointers to the element objects, together with integers that
// represent the current element count and the allocated size of the array.
// The second pointer is normally NULL; during execution of functions in this
// file that operate on nested sublists, it is occasionally used as working
// storage to avoid an auxiliary stack.

var XtclListType = Tcl_ObjType{
	Fname:             ts + 2810,
	FfreeIntRepProc:   0, // freeIntRepProc
	FdupIntRepProc:    0, // dupIntRepProc
	FupdateStringProc: 0, // updateStringProc
	FsetFromAnyProc:   0, // setFromAnyProc
} /* tclListObj.c:41:19 */

// Macros to manipulate the List internal rep

//----------------------------------------------------------------------
//
// NewListInternalRep --
//
//	Creates a 'List' structure with space for 'objc' elements.  'objc' must
//	be > 0.  If 'objv' is not NULL, The list is initialized with first
//	'objc' values in that array.  Otherwise the list is initialized to have
//	0 elements, with space to add 'objc' more.  Flag value 'p' indicates
//	how to behave on failure.
//
// Value
//
//	A new 'List' structure with refCount 0. If some failure
//	prevents this NULL is returned if 'p' is 0 , and 'Tcl_Panic'
//	is called if it is not.
//
// Effect
//
//	The refCount of each value in 'objv' is incremented as it is added
//	to the list.
//
//----------------------------------------------------------------------

func sNewListInternalRep(tls *libc.TLS, objc int32, objv uintptr, p int32) uintptr { /* tclListObj.c:87:13: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var listRepPtr uintptr

	if objc <= 0 {
		XTcl_Panic(tls, ts+44376, 0)
	}

	// First check to see if we'd overflow and try to allocate an object
	// larger than our memory allocator allows. Note that this is actually a
	// fairly small value when you're on a serious 64-bit machine, but that
	// requires API changes to fix. See [Bug 219196] for a discussion.

	if Size_t(objc) > uint64(1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0))))) {
		if p != 0 {
			XTcl_Panic(tls, ts+14448,
				libc.VaList(bp, 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0))))))
		}
		return uintptr(0)
	}

	listRepPtr = XTclpAlloc(tls, uint32(uint64(unsafe.Sizeof(List{}))+uint64(objc-1)*uint64(unsafe.Sizeof(uintptr(0)))))
	if listRepPtr == uintptr(0) {
		if p != 0 {
			XTcl_Panic(tls, ts+44426,
				libc.VaList(bp+8, uint32(uint64(unsafe.Sizeof(List{}))+uint64(objc-1)*uint64(unsafe.Sizeof(uintptr(0))))))
		}
		return uintptr(0)
	}

	(*List)(unsafe.Pointer(listRepPtr)).FcanonicalFlag = 0
	(*List)(unsafe.Pointer(listRepPtr)).FrefCount = 0
	(*List)(unsafe.Pointer(listRepPtr)).FmaxElemCount = objc

	if objv != 0 {
		var elemPtrs uintptr
		var i int32

		(*List)(unsafe.Pointer(listRepPtr)).FelemCount = objc
		elemPtrs = listRepPtr + 16
		for i = 0; i < objc; i++ {
			*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)))).FrefCount++
		}
	} else {
		(*List)(unsafe.Pointer(listRepPtr)).FelemCount = 0
	}
	return listRepPtr
}

//----------------------------------------------------------------------
//
//  AttemptNewList --
//
//	Like NewListInternalRep, but additionally sets an error message on failure.
//
//----------------------------------------------------------------------

func sAttemptNewList(tls *libc.TLS, interp uintptr, objc int32, objv uintptr) uintptr { /* tclListObj.c:153:13: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var listRepPtr uintptr = sNewListInternalRep(tls, objc, objv, 0)

	if interp != uintptr(0) && listRepPtr == uintptr(0) {
		if objc > 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+14448,
				libc.VaList(bp, 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))))))
		} else {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+44426,
				libc.VaList(bp+8, uint32(uint64(unsafe.Sizeof(List{}))+uint64(objc-1)*uint64(unsafe.Sizeof(uintptr(0)))))))
		}
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+14496, uintptr(0)))
	}
	return listRepPtr
}

//----------------------------------------------------------------------
//
// Tcl_NewListObj --
//
//	Creates a new list object and adds values to it. When TCL_MEM_DEBUG is
//	defined, 'Tcl_DbNewListObj' is called instead.
//
// Value
//
//	A new list 'Tcl_Obj' to which is appended values from 'objv', or if
//	'objc' is less than or equal to zero, a list 'Tcl_Obj' having no
//	elements.  The string representation of the new 'Tcl_Obj' is set to
//	NULL.  The refCount of the list is 0.
//
// Effect
//
//	The refCount of each elements in 'objv' is incremented as it is added
//	to the list.
//
//----------------------------------------------------------------------

func XTcl_NewListObj(tls *libc.TLS, objc int32, objv uintptr) uintptr { /* tclListObj.c:212:9: */
	var listRepPtr uintptr
	var listPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			listPtr = XTclThreadAllocObj(tls)
		} else {
			listPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr = uintptr(0)
	{
	}

	if objc <= 0 {
		return listPtr
	}

	// Create the internal rep.

	listRepPtr = sNewListInternalRep(tls, objc, objv, 1)

	// Now create the object.

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _isobjPtr uintptr = listPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	*(*uintptr)(unsafe.Pointer(listPtr + 32)) = listRepPtr
	*(*uintptr)(unsafe.Pointer(listPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
	(*List)(unsafe.Pointer(listRepPtr)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclListType))
	return listPtr
}

//----------------------------------------------------------------------
//
//  Tcl_DbNewListObj --
//
//	Like 'Tcl_NewListObj', but it calls Tcl_DbCkalloc directly with the
//	file name and line number from its caller.  This simplifies debugging
//	since the [memory active] command will report the correct file
//	name and line number when reporting objects that haven't been freed.
//
//	When TCL_MEM_DEBUG is not defined, 'Tcl_NewListObj' is called instead.
//
//----------------------------------------------------------------------

func XTcl_DbNewListObj(tls *libc.TLS, objc int32, objv uintptr, file uintptr, line int32) uintptr { /* tclListObj.c:295:9: */
	return XTcl_NewListObj(tls, objc, objv)
}

//----------------------------------------------------------------------
//
// Tcl_SetListObj --
//
//	Like 'Tcl_NewListObj', but operates on an existing 'Tcl_Obj'instead of
//	creating a new one.
//
//----------------------------------------------------------------------

func XTcl_SetListObj(tls *libc.TLS, objPtr uintptr, objc int32, objv uintptr) { /* tclListObj.c:320:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var listRepPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+44473))
	}

	// Free any old string rep and any internal rep for the old type.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	}

	for ok := true; ok; ok = 0 != 0 {
		var _isobjPtr uintptr = objPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}

	// Set the object's type to "list" and initialize the internal rep.
	// However, if there are no elements to put in the list, just give the
	// object an empty string rep and a NULL type.

	if objc > 0 {
		listRepPtr = sNewListInternalRep(tls, objc, objv, 1)
		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = listRepPtr
		*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
		(*List)(unsafe.Pointer(listRepPtr)).FrefCount++
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclListType))
	} else {
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	}
}

//----------------------------------------------------------------------
//
// TclListObjCopy --
//
//	Creates a new 'Tcl_Obj' which is a pure copy of a list value. This
//	provides for the C level a counterpart of the [lrange $list 0 end]
//	command, while using internals details to be as efficient as possible.
//
// Value
//
//	The address of the new 'Tcl_Obj' which shares its internal
//	representation with 'listPtr', and whose refCount is 0.  If 'listPtr'
//	is not actually a list, the value is NULL, and an error message is left
//	in 'interp' if it is not NULL.
//
// Effect
//
//	'listPtr' is converted to a list if it isn't one already.
//
//----------------------------------------------------------------------

func XTclListObjCopy(tls *libc.TLS, interp uintptr, listPtr uintptr) uintptr { /* tclListObj.c:376:9: */
	var copyPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclListType)) {
		if sSetListFromAny(tls, interp, listPtr) != TCL_OK {
			return uintptr(0)
		}
	}

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			copyPtr = XTclThreadAllocObj(tls)
		} else {
			copyPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(copyPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(0)
	{
	}

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _isobjPtr uintptr = copyPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	sDupListInternalRep(tls, listPtr, copyPtr)
	return copyPtr
}

//----------------------------------------------------------------------
//
// Tcl_ListObjGetElements --
//
//	Retreive the elements in a list 'Tcl_Obj'.
//
// Value
//
//	TCL_OK
//
//	    A count of list elements is stored, 'objcPtr', And a pointer to the
//	    array of elements in the list is stored in 'objvPtr'.
//
//	    The elements accessible via 'objvPtr' should be treated as readonly
//	    and the refCount for each object is _not_ incremented; the caller
//	    must do that if it holds on to a reference. Furthermore, the
//	    pointer and length returned by this function may change as soon as
//	    any function is called on the list object. Be careful about
//	    retaining the pointer in a local data structure.
//
//	TCL_ERROR
//
//	    'listPtr' is not a valid list. An error message is left in the
//	    interpreter's result if 'interp' is not NULL.
//
// Effect
//
//	'listPtr' is converted to a list object if it isn't one already.
//
//----------------------------------------------------------------------

func XTcl_ListObjGetElements(tls *libc.TLS, interp uintptr, listPtr uintptr, objcPtr uintptr, objvPtr uintptr) int32 { /* tclListObj.c:430:1: */
	var listRepPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclListType)) {
		var result int32

		if (*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes == XtclEmptyStringRep {
			*(*int32)(unsafe.Pointer(objcPtr)) = 0
			*(*uintptr)(unsafe.Pointer(objvPtr)) = uintptr(0)
			return TCL_OK
		}
		result = sSetListFromAny(tls, interp, listPtr)
		if result != TCL_OK {
			return result
		}
	}
	listRepPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
	*(*int32)(unsafe.Pointer(objcPtr)) = (*List)(unsafe.Pointer(listRepPtr)).FelemCount
	*(*uintptr)(unsafe.Pointer(objvPtr)) = listRepPtr + 16
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ListObjAppendList --
//
//	Appends the elements of elemListPtr to those of listPtr.
//
// Value
//
//	TCL_OK
//
//	    Success.
//
//	TCL_ERROR
//
//	    'listPtr' or 'elemListPtr' are not valid lists.  An error
//	    message is left in the interpreter's result if 'interp' is not NULL.
//
// Effect
//
//	The reference count of each element of 'elemListPtr' as it is added to
//	'listPtr'. 'listPtr' and 'elemListPtr' are converted to 'tclListType'
//	if they are not already. Appending the new elements may cause the
//	array of element pointers in 'listObj' to grow.  If any objects are
//	appended to 'listPtr'. Any preexisting string representation of
//	'listPtr' is invalidated.
//
//----------------------------------------------------------------------

func XTcl_ListObjAppendList(tls *libc.TLS, interp uintptr, listPtr uintptr, elemListPtr uintptr) int32 { /* tclListObj.c:491:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	// var objc int32 at bp+16, 4

	// var objv uintptr at bp+8, 8

	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+44488))
	}

	// Pull the elements to append from elemListPtr.

	if TCL_OK != func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(elemListPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 8)) = *(*uintptr)(unsafe.Pointer(elemListPtr + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 16)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemListPtr + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, elemListPtr, bp+16, bp+8)
	}() {
		return TCL_ERROR
	}

	// Insert the new elements starting after the lists's last element.
	// Delete zero existing elements.

	return XTcl_ListObjReplace(tls, interp, listPtr, 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))), 0, *(*int32)(unsafe.Pointer(bp + 16 /* objc */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* objv */)))
}

//----------------------------------------------------------------------
//
// Tcl_ListObjAppendElement --
//
//	Like 'Tcl_ListObjAppendList', but Appends a single value to a list.
//
// Value
//
//	TCL_OK
//
//	    'objPtr' is appended to the elements of 'listPtr'.
//
//	TCL_ERROR
//
//	    listPtr does not refer to a list object and the object can not be
//	    converted to one. An error message will be left in the
//	    interpreter's result if interp is not NULL.
//
// Effect
//
//	If 'listPtr' is not already of type 'tclListType', it is converted.
//	The 'refCount' of 'objPtr' is incremented as it is added to 'listPtr'.
//	Appending the new element may cause the the array of element pointers
//	in 'listObj' to grow.  Any preexisting string representation of
//	'listPtr' is invalidated.
//
//----------------------------------------------------------------------

func XTcl_ListObjAppendElement(tls *libc.TLS, interp uintptr, listPtr uintptr, objPtr uintptr) int32 { /* tclListObj.c:550:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)
	*(*uintptr)(unsafe.Pointer(bp + 40)) = objPtr

	var listRepPtr uintptr
	var newPtr uintptr = uintptr(0)
	var numElems int32
	var numRequired int32
	var needGrow int32
	var isShared int32
	var attempt int32

	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+44510))
	}
	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclListType)) {
		var result int32

		if (*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes == XtclEmptyStringRep {
			XTcl_SetListObj(tls, listPtr, 1, bp+40)
			return TCL_OK
		}
		result = sSetListFromAny(tls, interp, listPtr)
		if result != TCL_OK {
			return result
		}
	}

	listRepPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
	numElems = (*List)(unsafe.Pointer(listRepPtr)).FelemCount
	numRequired = numElems + 1
	needGrow = libc.Bool32(numRequired > (*List)(unsafe.Pointer(listRepPtr)).FmaxElemCount)
	isShared = libc.Bool32((*List)(unsafe.Pointer(listRepPtr)).FrefCount > 1)

	if numRequired > 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+14448,
				libc.VaList(bp+8, 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))))))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+14496, uintptr(0)))
		}
		return TCL_ERROR
	}

	if needGrow != 0 && !(isShared != 0) {
		// Need to grow + unshared internalrep => try to realloc

		attempt = 2 * numRequired
		if attempt <= 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))) {
			newPtr = XTclpRealloc(tls, listRepPtr, uint32(uint64(unsafe.Sizeof(List{}))+uint64(attempt-1)*uint64(unsafe.Sizeof(uintptr(0)))))
		}
		if newPtr == uintptr(0) {
			attempt = int32(uint64(numRequired+1) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(uintptr(0))))
			if attempt > 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))) {
				attempt = 1 + int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0))))
			}
			newPtr = XTclpRealloc(tls, listRepPtr, uint32(uint64(unsafe.Sizeof(List{}))+uint64(attempt-1)*uint64(unsafe.Sizeof(uintptr(0)))))
		}
		if newPtr == uintptr(0) {
			attempt = numRequired
			newPtr = XTclpRealloc(tls, listRepPtr, uint32(uint64(unsafe.Sizeof(List{}))+uint64(attempt-1)*uint64(unsafe.Sizeof(uintptr(0)))))
		}
		if newPtr != 0 {
			listRepPtr = newPtr
			(*List)(unsafe.Pointer(listRepPtr)).FmaxElemCount = attempt
			needGrow = 0
		}
	}
	if isShared != 0 || needGrow != 0 {
		var dst uintptr
		var src uintptr = listRepPtr + 16

		// Either we have a shared internalrep and we must copy to write, or we
		// need to grow and realloc attempts failed.  Attempt internalrep copy.

		attempt = 2 * numRequired
		newPtr = sAttemptNewList(tls, uintptr(0), attempt, uintptr(0))
		if newPtr == uintptr(0) {
			attempt = int32(uint64(numRequired+1) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(uintptr(0))))
			if attempt > 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))) {
				attempt = 1 + int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0))))
			}
			newPtr = sAttemptNewList(tls, uintptr(0), attempt, uintptr(0))
		}
		if newPtr == uintptr(0) {
			attempt = numRequired
			newPtr = sAttemptNewList(tls, interp, attempt, uintptr(0))
		}
		if newPtr == uintptr(0) {
			// All growth attempts failed; throw the error.

			return TCL_ERROR
		}

		dst = newPtr + 16
		(*List)(unsafe.Pointer(newPtr)).FrefCount++
		(*List)(unsafe.Pointer(newPtr)).FcanonicalFlag = (*List)(unsafe.Pointer(listRepPtr)).FcanonicalFlag
		(*List)(unsafe.Pointer(newPtr)).FelemCount = (*List)(unsafe.Pointer(listRepPtr)).FelemCount

		if isShared != 0 {
			// The original internalrep must remain undisturbed.  Copy into the new
			// one and bump refcounts
			for libc.PostDecInt32(&numElems, 1) != 0 {
				*(*uintptr)(unsafe.Pointer(dst)) = *(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&src, 8)))
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&dst, 8))))).FrefCount++
			}
			(*List)(unsafe.Pointer(listRepPtr)).FrefCount--
		} else {
			// Old internalrep to be freed, re-use refCounts.

			libc.Xmemcpy(tls, dst, src, uint64(numElems)*uint64(unsafe.Sizeof(uintptr(0))))
			XTclpFree(tls, listRepPtr)
		}
		listRepPtr = newPtr
	}
	*(*uintptr)(unsafe.Pointer(listPtr + 32)) = listRepPtr

	// Add objPtr to the end of listPtr's array of element pointers. Increment
	// the ref count for the (now shared) objPtr.

	*(*uintptr)(unsafe.Pointer(listRepPtr + 16 + uintptr((*List)(unsafe.Pointer(listRepPtr)).FelemCount)*8)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* objPtr */))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FrefCount++
	(*List)(unsafe.Pointer(listRepPtr)).FelemCount++

	// Invalidate any old string representation since the list's internal
	// representation has changed.

	for ok := true; ok; ok = 0 != 0 {
		var _isobjPtr uintptr = listPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ListObjIndex --
//
// 	Retrieve a pointer to the element of 'listPtr' at 'index'.  The index
// 	of the first element is 0.
//
// Value
//
// 	TCL_OK
//
//	    A pointer to the element at 'index' is stored in 'objPtrPtr'.  If
//	    'index' is out of range, NULL is stored in 'objPtrPtr'.  This
//	    object should be treated as readonly and its 'refCount' is _not_
//	    incremented. The caller must do that if it holds on to the
//	    reference.
//
// 	TCL_ERROR
//
// 	    'listPtr' is not a valid list. An an error message is left in the
// 	    interpreter's result if 'interp' is not NULL.
//
//  Effect
//
// 	If 'listPtr' is not already of type 'tclListType', it is converted.
//
//----------------------------------------------------------------------

func XTcl_ListObjIndex(tls *libc.TLS, interp uintptr, listPtr uintptr, index int32, objPtrPtr uintptr) int32 { /* tclListObj.c:721:1: */
	var listRepPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclListType)) {
		var result int32

		if (*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes == XtclEmptyStringRep {
			*(*uintptr)(unsafe.Pointer(objPtrPtr)) = uintptr(0)
			return TCL_OK
		}
		result = sSetListFromAny(tls, interp, listPtr)
		if result != TCL_OK {
			return result
		}
	}

	listRepPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
	if index < 0 || index >= (*List)(unsafe.Pointer(listRepPtr)).FelemCount {
		*(*uintptr)(unsafe.Pointer(objPtrPtr)) = uintptr(0)
	} else {
		*(*uintptr)(unsafe.Pointer(objPtrPtr)) = *(*uintptr)(unsafe.Pointer(listRepPtr + 16 + uintptr(index)*8))
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ListObjLength --
//
// 	Retrieve the number of elements in a list.
//
// Value
//
//	TCL_OK
//
//	    A count of list elements is stored at the address provided by
//	    'intPtr'. If 'listPtr' is not already of type 'tclListPtr', it is
//	    converted.
//
//	TCL_ERROR
//
//	    'listPtr' is not a valid list.  An error message will be left in
//	    the interpreter's result if 'interp' is not NULL.
//
//----------------------------------------------------------------------

func XTcl_ListObjLength(tls *libc.TLS, interp uintptr, listPtr uintptr, intPtr uintptr) int32 { /* tclListObj.c:776:1: */
	var listRepPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclListType)) {
		var result int32

		if (*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes == XtclEmptyStringRep {
			*(*int32)(unsafe.Pointer(intPtr)) = 0
			return TCL_OK
		}
		result = sSetListFromAny(tls, interp, listPtr)
		if result != TCL_OK {
			return result
		}
	}

	listRepPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
	*(*int32)(unsafe.Pointer(intPtr)) = (*List)(unsafe.Pointer(listRepPtr)).FelemCount
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ListObjReplace --
//
//	Replace values in a list.
//
//	If 'first' is zero or negative, it refers to the first element. If
//	'first' outside the range of elements in the list, no elements are
//	deleted.
//
//	If 'count' is zero or negative no elements are deleted, and any new
//	elements are inserted at the beginning of the list.
//
// Value
//
//	TCL_OK
//
//	    The first 'objc' values of 'objv' replaced 'count' elements in 'listPtr'
//	    starting at 'first'.  If 'objc' 0, no new elements are added.
//
//	TCL_ERROR
//
//	    'listPtr' is not a valid list.   An error message is left in the
//	    interpreter's result if 'interp' is not NULL.
//
// Effect
//
//	If 'listPtr' is not of type 'tclListType', it is converted if possible.
//
//	The 'refCount' of each element appended to the list is incremented.
//	Similarly, the 'refCount' for each replaced element is decremented.
//
//	If 'listPtr' is modified, any previous string representation is
//	invalidated.
//
//----------------------------------------------------------------------

func XTcl_ListObjReplace(tls *libc.TLS, interp uintptr, listPtr uintptr, first int32, count int32, objc int32, objv uintptr) int32 { /* tclListObj.c:841:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var listRepPtr uintptr
	var elemPtrs uintptr
	var needGrow int32
	var numElems int32
	var numRequired int32
	var numAfterLast int32
	var start int32
	var i int32
	var j int32
	var isShared int32

	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+44535))
	}
	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclListType)) {
		if (*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes == XtclEmptyStringRep {
			if !(objc != 0) {
				return TCL_OK
			}
			XTcl_SetListObj(tls, listPtr, objc, uintptr(0))
		} else {
			var result int32 = sSetListFromAny(tls, interp, listPtr)

			if result != TCL_OK {
				return result
			}
		}
	}

	// Note that when count == 0 and objc == 0, this routine is logically a
	// no-op, removing and adding no elements to the list. However, by flowing
	// through this routine anyway, we get the important side effect that the
	// resulting listPtr is a list in canoncial form. This is important.
	// Resist any temptation to optimize this case.

	listRepPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
	elemPtrs = listRepPtr + 16
	numElems = (*List)(unsafe.Pointer(listRepPtr)).FelemCount

	if first < 0 {
		first = 0
	}
	if first >= numElems {
		first = numElems // So we'll insert after last element.
	}
	if count < 0 {
		count = 0
	} else if first > 0x7fffffff-count ||
		numElems < first+count {

		count = numElems - first
	}

	if objc > 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0))))-(numElems-count) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+14448,
				libc.VaList(bp+8, 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))))))
		}
		return TCL_ERROR
	}
	isShared = libc.Bool32((*List)(unsafe.Pointer(listRepPtr)).FrefCount > 1)
	numRequired = numElems - count + objc // Known <= LIST_MAX
	needGrow = libc.Bool32(numRequired > (*List)(unsafe.Pointer(listRepPtr)).FmaxElemCount)

	for i = 0; i < objc; i++ {
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FrefCount++
	}

	if needGrow != 0 && !(isShared != 0) {
		// Try to use realloc
		var newPtr uintptr = uintptr(0)
		var attempt int32 = 2 * numRequired
		if attempt <= 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))) {
			newPtr = XTclpRealloc(tls, listRepPtr, uint32(uint64(unsafe.Sizeof(List{}))+uint64(attempt-1)*uint64(unsafe.Sizeof(uintptr(0)))))
		}
		if newPtr == uintptr(0) {
			attempt = int32(uint64(numRequired+1) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(uintptr(0))))
			if attempt > 1+int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))) {
				attempt = 1 + int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0))))
			}
			newPtr = XTclpRealloc(tls, listRepPtr, uint32(uint64(unsafe.Sizeof(List{}))+uint64(attempt-1)*uint64(unsafe.Sizeof(uintptr(0)))))
		}
		if newPtr == uintptr(0) {
			attempt = numRequired
			newPtr = XTclpRealloc(tls, listRepPtr, uint32(uint64(unsafe.Sizeof(List{}))+uint64(attempt-1)*uint64(unsafe.Sizeof(uintptr(0)))))
		}
		if newPtr != 0 {
			listRepPtr = newPtr
			*(*uintptr)(unsafe.Pointer(listPtr + 32)) = listRepPtr
			elemPtrs = listRepPtr + 16
			(*List)(unsafe.Pointer(listRepPtr)).FmaxElemCount = attempt
			needGrow = libc.Bool32(numRequired > (*List)(unsafe.Pointer(listRepPtr)).FmaxElemCount)
		}
	}
	if !(needGrow != 0) && !(isShared != 0) {
		var shift int32

		// Can use the current List struct. First "delete" count elements
		// starting at first.

		for j = first; j < first+count; j++ {
			var victimPtr uintptr = *(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(j)*8))

			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(victimPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(victimPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(victimPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(victimPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(victimPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(victimPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(victimPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, victimPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(victimPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = victimPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, victimPtr)
				}
			}

		}

		// Shift the elements after the last one removed to their new
		// locations.

		start = first + count
		numAfterLast = numElems - start
		shift = objc - count // numNewElems - numDeleted
		if numAfterLast > 0 && shift != 0 {
			var src uintptr = elemPtrs + uintptr(start)*8

			libc.Xmemmove(tls, src+uintptr(shift)*8, src, uint64(numAfterLast)*uint64(unsafe.Sizeof(uintptr(0))))
		}
	} else {
		// Cannot use the current List struct; it is shared, too small, or
		// both. Allocate a new struct and insert elements into it.

		var oldListRepPtr uintptr = listRepPtr
		var oldPtrs uintptr = elemPtrs
		var newMax int32

		if needGrow != 0 {
			newMax = 2 * numRequired
		} else {
			newMax = (*List)(unsafe.Pointer(listRepPtr)).FmaxElemCount
		}

		listRepPtr = sAttemptNewList(tls, uintptr(0), newMax, uintptr(0))
		if listRepPtr == uintptr(0) {
			var limit uint32 = uint32(1 + int32((uint64(uint32(0x7fffffff)*2+1)-Size_t(unsafe.Sizeof(List{})))/Size_t(unsafe.Sizeof(uintptr(0)))) - numRequired)
			var extra uint32 = uint32(uint64(numRequired-numElems) +
				uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(uintptr(0))))
			var growth int32 = func() int32 {
				if extra > limit {
					return int32(limit)
				}
				return int32(extra)
			}()

			listRepPtr = sAttemptNewList(tls, uintptr(0), numRequired+growth, uintptr(0))
			if listRepPtr == uintptr(0) {
				listRepPtr = sAttemptNewList(tls, interp, numRequired, uintptr(0))
				if listRepPtr == uintptr(0) {
					for i = 0; i < objc; i++ {
						// See bug 3598580
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FrefCount--
					}
					return TCL_ERROR
				}
			}
		}

		*(*uintptr)(unsafe.Pointer(listPtr + 32)) = listRepPtr
		(*List)(unsafe.Pointer(listRepPtr)).FrefCount++

		elemPtrs = listRepPtr + 16

		if isShared != 0 {
			// The old struct will remain in place; need new refCounts for the
			// new List struct references. Copy over only the surviving
			// elements.

			for i = 0; i < first; i++ {
				*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(oldPtrs + uintptr(i)*8))
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)))).FrefCount++
			}
			i = first + count
			j = first + objc
		__1:
			if !(j < numRequired) {
				goto __3
			}
			{
				*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer(oldPtrs + uintptr(i)*8))
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(j)*8)))).FrefCount++

			}
			goto __2
		__2:
			i++
			j++
			goto __1
			goto __3
		__3:
			;

			(*List)(unsafe.Pointer(oldListRepPtr)).FrefCount--
		} else {
			// The old struct will be removed; use its inherited refCounts.

			if first > 0 {
				libc.Xmemcpy(tls, elemPtrs, oldPtrs, uint64(first)*uint64(unsafe.Sizeof(uintptr(0))))
			}

			// "Delete" count elements starting at first.

			for j = first; j < first+count; j++ {
				var victimPtr uintptr = *(*uintptr)(unsafe.Pointer(oldPtrs + uintptr(j)*8))

				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(victimPtr)).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer(victimPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(victimPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer(victimPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(victimPtr)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(victimPtr)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer(victimPtr)).Flength = -1
						for ok1 := true; ok1; ok1 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, victimPtr)
							} else {
								*(*uintptr)(unsafe.Pointer(victimPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = victimPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, victimPtr)
					}
				}

			}

			// Copy the elements after the last one removed, shifted to their
			// new locations.

			start = first + count
			numAfterLast = numElems - start
			if numAfterLast > 0 {
				libc.Xmemcpy(tls, elemPtrs+uintptr(first)*8+uintptr(objc)*8, oldPtrs+uintptr(start)*8,
					Size_t(numAfterLast)*Size_t(unsafe.Sizeof(uintptr(0))))
			}

			XTclpFree(tls, oldListRepPtr)
		}
	}

	// Insert the new elements into elemPtrs before "first".

	i = 0
	j = first
__4:
	if !(i < objc) {
		goto __6
	}
	{
		*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))

	}
	goto __5
__5:
	i++
	j++
	goto __4
	goto __6
__6:
	;

	// Update the count of elements.

	(*List)(unsafe.Pointer(listRepPtr)).FelemCount = numRequired

	// Invalidate and free any old string representation since it no longer
	// reflects the list's internal representation.

	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _isobjPtr uintptr = listPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclLindexList --
//
//	Implements the 'lindex' command when objc==3.
//
//	Implemented entirely as a wrapper around 'TclLindexFlat'. Reconfigures
//	the argument format into required form while taking care to manage
//	shimmering so as to tend to keep the most useful internalreps
//	and/or avoid the most expensive conversions.
//
// Value
//
//	A pointer to the specified element, with its 'refCount' incremented, or
//	NULL if an error occurred.
//
// Notes
//
//----------------------------------------------------------------------

func XTclLindexList(tls *libc.TLS, interp uintptr, listPtr uintptr, argPtr uintptr) uintptr { /* tclListObj.c:1110:9: */
	bp := tls.Alloc(28)
	defer tls.Free(28)
	*(*uintptr)(unsafe.Pointer(bp + 8)) = argPtr

	// var index int32 at bp, 4
	// Index into the list.
	var indexListCopy uintptr

	// Determine whether argPtr designates a list or a single index. We have
	// to be careful about the order of the checks to avoid repeated
	// shimmering; see TIP#22 and TIP#33 for the details.

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr != uintptr(unsafe.Pointer(&XtclListType)) &&
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 8)), 0, bp)
		}() == TCL_OK {
		// argPtr designates a single index.

		return XTclLindexFlat(tls, interp, listPtr, 1, bp+8)
	}

	// Here we make a private copy of the index list argument to avoid any
	// shimmering issues that might invalidate the indices array below while
	// we are still using it. This is probably unnecessary. It does not appear
	// that any damaging shimmering is possible, and no test has been devised
	// to show any error when this private copy is not made. But it's cheap,
	// and it offers some future-proofing insurance in case the TclLindexFlat
	// implementation changes in some unexpected way, or some new form of
	// trace or callback permits things to happen that the current
	// implementation does not.

	indexListCopy = XTclListObjCopy(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 8 /* argPtr */)))
	if indexListCopy == uintptr(0) {
		// argPtr designates something that is neither an index nor a
		// well-formed list. Report the error via TclLindexFlat.

		return XTclLindexFlat(tls, interp, listPtr, 1, bp+8)
	}

	{
		*(*int32)(unsafe.Pointer(bp + 24 /* indexCount */)) = -1        // Size of the array of list indices.
		*(*uintptr)(unsafe.Pointer(bp + 16 /* indices */)) = uintptr(0) // Array of list indices.

		if (*Tcl_Obj)(unsafe.Pointer(indexListCopy)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			*(*uintptr)(unsafe.Pointer(bp + 16)) = *(*uintptr)(unsafe.Pointer(indexListCopy + 32)) + 16
			*(*int32)(unsafe.Pointer(bp + 24)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexListCopy + 32)))).FelemCount
		} else {
			XTcl_ListObjGetElements(tls, uintptr(0), indexListCopy, bp+24, bp+16)
		}
		listPtr = XTclLindexFlat(tls, interp, listPtr, *(*int32)(unsafe.Pointer(bp + 24 /* indexCount */)), *(*uintptr)(unsafe.Pointer(bp + 16 /* indices */)))

	}
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = indexListCopy
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return listPtr
}

//----------------------------------------------------------------------
//
//  TclLindexFlat --
//
// 	The core of the 'lindex' command, with all index
// 	arguments presented as a flat list.
//
//  Value
//
//	A pointer to the object extracted, with its 'refCount' incremented,  or
//	NULL if an error occurred.  Thus, the calling code will usually do
//	something like:
//
// 		Tcl_SetObjResult(interp, result);
// 		Tcl_DecrRefCount(result);
//
//
//----------------------------------------------------------------------

func XTclLindexFlat(tls *libc.TLS, interp uintptr, listPtr uintptr, indexCount int32, indexArray uintptr) uintptr { /* tclListObj.c:1189:9: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var i int32

	(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount++

	for i = 0; i < indexCount && listPtr != 0; i++ {
		// var index int32 at bp+12, 4

		*(*int32)(unsafe.Pointer(bp + 8 /* listLen */)) = 0
		*(*uintptr)(unsafe.Pointer(bp /* elemPtrs */)) = uintptr(0)
		var sublistCopy uintptr

		// Here we make a private copy of the current sublist, so we avoid any
		// shimmering issues that might invalidate the elemPtr array below
		// while we are still using it. See test lindex-8.4.

		sublistCopy = XTclListObjCopy(tls, interp, listPtr)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = listPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		listPtr = uintptr(0)

		if sublistCopy == uintptr(0) {
			// The sublist is not a list at all => error.

			break
		}
		if (*Tcl_Obj)(unsafe.Pointer(sublistCopy)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(sublistCopy + 32)) + 16
			*(*int32)(unsafe.Pointer(bp + 8)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(sublistCopy + 32)))).FelemCount
		} else {
			XTcl_ListObjGetElements(tls, uintptr(0), sublistCopy, bp+8, bp)
		}

		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray + uintptr(i)*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray + uintptr(i)*8)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 12)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray + uintptr(i)*8)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(indexArray + uintptr(i)*8)), *(*int32)(unsafe.Pointer(bp + 8))-1, bp+12)
		}() == TCL_OK {
			if *(*int32)(unsafe.Pointer(bp + 12)) < 0 || *(*int32)(unsafe.Pointer(bp + 12)) >= *(*int32)(unsafe.Pointer(bp + 8)) {
				// Index is out of range. Break out of loop with empty result.
				// First check remaining indices for validity

				for libc.PreIncInt32(&i, 1) < indexCount {
					if func() int32 {
						if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray + uintptr(i)*8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray + uintptr(i)*8)) + 32)) <= int64(0x7fffffff) {
							return func() int32 {
								*(*int32)(unsafe.Pointer(bp + 12)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray + uintptr(i)*8)) + 32)))
								return TCL_OK
							}()
						}
						return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(indexArray + uintptr(i)*8)), -1, bp+12)
					}() !=
						TCL_OK {
						for ok1 := true; ok1; ok1 = 0 != 0 {
							var _objPtr uintptr = sublistCopy
							if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
								XTclFreeObj(tls, _objPtr)
							}
						}
						return uintptr(0)
					}
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						listPtr = XTclThreadAllocObj(tls)
					} else {
						listPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount = 0
				(*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(listPtr)).Flength = 0
				(*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr = uintptr(0)
				{
				}

			} else {
				// Extract the pointer to the appropriate element.

				listPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* elemPtrs */)) + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* index */)))*8))
			}
			(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount++
		}
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = sublistCopy
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	return listPtr
}

//----------------------------------------------------------------------
//
// TclLsetList --
//
//	The core of [lset] when objc == 4. Objv[2] may be either a
//	scalar index or a list of indices.
//
//	Implemented entirely as a wrapper around 'TclLindexFlat', as described
//	for 'TclLindexList'.
//
// Value
//
//	The new list, with the 'refCount' of 'valuPtr' incremented, or NULL if
//	there was an error.
//
//----------------------------------------------------------------------

func XTclLsetList(tls *libc.TLS, interp uintptr, listPtr uintptr, indexArgPtr uintptr, valuePtr uintptr) uintptr { /* tclListObj.c:1274:9: */
	bp := tls.Alloc(28)
	defer tls.Free(28)
	*(*uintptr)(unsafe.Pointer(bp + 8)) = indexArgPtr

	*(*int32)(unsafe.Pointer(bp + 24 /* indexCount */)) = 0         // Number of indices in the index list.
	*(*uintptr)(unsafe.Pointer(bp + 16 /* indices */)) = uintptr(0) // Vector of indices in the index list.
	var retValuePtr uintptr                                         // Pointer to the list to be returned.
	// var index int32 at bp, 4
	// Current index in the list - discarded.
	var indexListCopy uintptr

	// Determine whether the index arg designates a list or a single index.
	// We have to be careful about the order of the checks to avoid repeated
	// shimmering; see TIP #22 and #23 for details.

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr != uintptr(unsafe.Pointer(&XtclListType)) &&
		func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 8)), 0, bp)
		}() == TCL_OK {
		// indexArgPtr designates a single index.

		return XTclLsetFlat(tls, interp, listPtr, 1, bp+8, valuePtr)

	}

	indexListCopy = XTclListObjCopy(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 8 /* indexArgPtr */)))
	if indexListCopy == uintptr(0) {
		// indexArgPtr designates something that is neither an index nor a
		// well formed list. Report the error via TclLsetFlat.

		return XTclLsetFlat(tls, interp, listPtr, 1, bp+8, valuePtr)
	}
	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 16)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 24)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 8)), bp+24, bp+16)
	}

	// Let TclLsetFlat handle the actual lset'ting.

	retValuePtr = XTclLsetFlat(tls, interp, listPtr, *(*int32)(unsafe.Pointer(bp + 24 /* indexCount */)), *(*uintptr)(unsafe.Pointer(bp + 16 /* indices */)), valuePtr)

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = indexListCopy
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return retValuePtr
}

//----------------------------------------------------------------------
//
// TclLsetFlat --
//
//	Core engine of the 'lset' command.
//
// Value
//
//	The resulting list
//
//	    The 'refCount' of 'valuePtr' is incremented.  If 'listPtr' was not
//	    duplicated, its 'refCount' is incremented.  The reference count of
//	    an unduplicated object is therefore 2 (one for the returned pointer
//	    and one for the variable that holds it).  The reference count of a
//	    duplicate object is 1, reflecting that result is the only active
//	    reference. The caller is expected to store the result in the
//	    variable and decrement its reference count. (INST_STORE_* does
//	    exactly this.)
//
//	NULL
//
//	    An error occurred.  If 'listPtr' was duplicated, the reference
//	    count on the duplicate is decremented so that it is 0, causing any
//	    memory allocated by this function to be freed.
//
//
// Effect
//
//	On entry, the reference count of 'listPtr' does not reflect any
//	references held on the stack. The first action of this function is to
//	determine whether 'listPtr' is shared and to create a duplicate
//	unshared copy if it is.  The reference count of the duplicate is
//	incremented. At this point, the reference count is 1 in either case so
//	that the object is considered unshared.
//
//	The unshared list is altered directly to produce the result.
//	'TclLsetFlat' maintains a linked list of 'Tcl_Obj' values whose string
//	representations must be spoilt by threading via 'ptr2' of the
//	two-pointer internal representation. On entry to 'TclLsetFlat', the
//	values of 'ptr2' are immaterial; on exit, the 'ptr2' field of any
//	Tcl_Obj that has been modified is set to NULL.
//
//----------------------------------------------------------------------

func XTclLsetFlat(tls *libc.TLS, interp uintptr, listPtr uintptr, indexCount int32, indexArray uintptr, valuePtr uintptr) uintptr { /* tclListObj.c:1370:9: */
	bp := tls.Alloc(60)
	defer tls.Free(60)

	// var index int32 at bp+52, 4

	var result int32
	// var len int32 at bp+56, 4

	var subListPtr uintptr
	var retValuePtr uintptr
	var chainPtr uintptr

	// If there are no indices, simply return the new value.  (Without
	// indices, [lset] is a synonym for [set].

	if indexCount == 0 {
		(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++
		return valuePtr
	}

	// If the list is shared, make a copy we can modify (copy-on-write).  We
	// use Tcl_DuplicateObj() instead of TclListObjCopy() for a few reasons:
	// 1) we have not yet confirmed listPtr is actually a list; 2) We make a
	// verbatim copy of any existing string rep, and when we combine that with
	// the delayed invalidation of string reps of modified Tcl_Obj's
	// implemented below, the outcome is that any error condition that causes
	// this routine to return NULL, will leave the string rep of listPtr and
	// all elements to be unchanged.

	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount > 1 {
		subListPtr = XTcl_DuplicateObj(tls, listPtr)
	} else {
		subListPtr = listPtr
	}

	// Anchor the linked list of Tcl_Obj's whose string reps must be
	// invalidated if the operation succeeds.

	retValuePtr = subListPtr
	chainPtr = uintptr(0)
	result = TCL_OK

	// Loop through all the index arguments, and for each one dive into the
	// appropriate sublist.

	for ok := true; ok; ok = indexCount > 0 {
		// var elemCount int32 at bp+48, 4

		var parentList uintptr
		// var elemPtrs uintptr at bp+40, 8

		// Check for the possible error conditions...

		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(subListPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
				return func() int32 {
					*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(subListPtr + 32)) + 16
					*(*int32)(unsafe.Pointer(bp + 48)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(subListPtr + 32)))).FelemCount
					return TCL_OK
				}()
			}
			return XTcl_ListObjGetElements(tls, interp, subListPtr, bp+48, bp+40)
		}() !=
			TCL_OK {
			// ...the sublist we're indexing into isn't a list at all.
			result = TCL_ERROR
			break
		}

		// WARNING: the macro TclGetIntForIndexM is not safe for
		// post-increments, avoid '*indexArray++' here.

		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray)) + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray)) + 32)) <= int64(0x7fffffff) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp + 52)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(indexArray)) + 32)))
					return TCL_OK
				}()
			}
			return XTclGetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(indexArray)), *(*int32)(unsafe.Pointer(bp + 48))-1, bp+52)
		}() !=
			TCL_OK {
			// ...the index we're trying to use isn't an index at all.
			result = TCL_ERROR
			indexArray += 8
			break
		}
		indexArray += 8

		if *(*int32)(unsafe.Pointer(bp + 52)) < 0 || *(*int32)(unsafe.Pointer(bp + 52)) > *(*int32)(unsafe.Pointer(bp + 48)) {
			// ...the index points outside the sublist.
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp,
					XTcl_NewStringObj(tls, ts+44554, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+44578,
					ts+15353, uintptr(0)))
			}
			result = TCL_ERROR
			break
		}

		// No error conditions.  As long as we're not yet on the last index,
		// determine the next sublist for the next pass through the loop, and
		// take steps to make sure it is an unshared copy, as we intend to
		// modify it.

		if libc.PreDecInt32(&indexCount, 1) != 0 {
			parentList = subListPtr
			if *(*int32)(unsafe.Pointer(bp + 52)) == *(*int32)(unsafe.Pointer(bp + 48)) {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						subListPtr = XTclThreadAllocObj(tls)
					} else {
						subListPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(subListPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(subListPtr)).FrefCount = 0
				(*Tcl_Obj)(unsafe.Pointer(subListPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(subListPtr)).Flength = 0
				(*Tcl_Obj)(unsafe.Pointer(subListPtr)).FtypePtr = uintptr(0)
				{
				}

			} else {
				subListPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* elemPtrs */)) + uintptr(*(*int32)(unsafe.Pointer(bp + 52 /* index */)))*8))
			}
			if (*Tcl_Obj)(unsafe.Pointer(subListPtr)).FrefCount > 1 {
				subListPtr = XTcl_DuplicateObj(tls, subListPtr)
			}

			// Replace the original elemPtr[index] in parentList with a copy
			// we know to be unshared.  This call will also deal with the
			// situation where parentList shares its internalrep with other
			// Tcl_Obj's.  Dealing with the shared internalrep case can cause
			// subListPtr to become shared again, so detect that case and make
			// and store another copy.

			if *(*int32)(unsafe.Pointer(bp + 52)) == *(*int32)(unsafe.Pointer(bp + 48)) {
				XTcl_ListObjAppendElement(tls, uintptr(0), parentList, subListPtr)
			} else {
				XTclListObjSetElement(tls, uintptr(0), parentList, *(*int32)(unsafe.Pointer(bp + 52 /* index */)), subListPtr)
			}
			if (*Tcl_Obj)(unsafe.Pointer(subListPtr)).FrefCount > 1 {
				subListPtr = XTcl_DuplicateObj(tls, subListPtr)
				XTclListObjSetElement(tls, uintptr(0), parentList, *(*int32)(unsafe.Pointer(bp + 52 /* index */)), subListPtr)
			}

			// The TclListObjSetElement() calls do not spoil the string rep of
			// parentList, and that's fine for now, since all we've done so
			// far is replace a list element with an unshared copy.  The list
			// value remains the same, so the string rep. is still valid, and
			// unchanged, which is good because if this whole routine returns
			// NULL, we'd like to leave no change to the value of the lset
			// variable.  Later on, when we set valuePtr in its proper place,
			// then all containing lists will have their values changed, and
			// will need their string reps spoiled.  We maintain a list of all
			// those Tcl_Obj's (via a little internalrep surgery) so we can spoil
			// them at that time.

			*(*uintptr)(unsafe.Pointer(parentList + 32 + 8 /* &.ptr2 */)) = chainPtr
			chainPtr = parentList
		}
	}

	// Either we've detected and error condition, and exited the loop with
	// result == TCL_ERROR, or we've successfully reached the last index, and
	// we're ready to store valuePtr.  In either case, we need to clean up our
	// string spoiling list of Tcl_Obj's.

	for chainPtr != 0 {
		var objPtr uintptr = chainPtr

		if result == TCL_OK {
			// We're going to store valuePtr, so spoil string reps of all
			// containing lists.

			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _isobjPtr uintptr = objPtr
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
					if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
				}
			}
		}

		// Clear away our internalrep surgery mess.

		chainPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */))
		*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
	}

	if result != TCL_OK {
		// Error return; message is already in interp. Clean up any excess
		// memory.

		if retValuePtr != listPtr {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var _objPtr uintptr = retValuePtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		return uintptr(0)
	}

	// Store valuePtr in proper sublist and return. The -1 is to avoid a
	// compiler warning (not a problem because we checked that we have a
	// proper list - or something convertible to one - above).

	*(*int32)(unsafe.Pointer(bp + 56 /* len */)) = -1
	if (*Tcl_Obj)(unsafe.Pointer(subListPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*int32)(unsafe.Pointer(bp + 56)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(subListPtr + 32)))).FelemCount
	} else {
		XTcl_ListObjLength(tls, uintptr(0), subListPtr, bp+56)
	}
	if *(*int32)(unsafe.Pointer(bp + 52)) == *(*int32)(unsafe.Pointer(bp + 56)) {
		XTcl_ListObjAppendElement(tls, uintptr(0), subListPtr, valuePtr)
	} else {
		XTclListObjSetElement(tls, uintptr(0), subListPtr, *(*int32)(unsafe.Pointer(bp + 52 /* index */)), valuePtr)
	}
	for ok4 := true; ok4; ok4 = 0 != 0 {
		var _isobjPtr uintptr = subListPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(retValuePtr)).FrefCount++
	return retValuePtr
}

//----------------------------------------------------------------------
//
// TclListObjSetElement --
//
//	Set a single element of a list to a specified value.
//
//	It is the caller's responsibility to invalidate the string
//	representation of the 'listPtr'.
//
// Value
//
// 	TCL_OK
//
//	    Success.
//
//	TCL_ERROR
//
//	    'listPtr' does not refer to a list object and cannot be converted
//	    to one.  An error message will be left in the interpreter result if
//	    interp is not NULL.
//
//	TCL_ERROR
//
//	    An index designates an element outside the range [0..listLength-1],
//	    where 'listLength' is the count of elements in the list object
//	    designated by 'listPtr'.  An error message is left in the
//	    interpreter result.
//
// Effect
//
//	If 'listPtr' designates a shared object, 'Tcl_Panic' is called.  If
//	'listPtr' is not already of type 'tclListType', it is converted and the
//	internal representation is unshared. The 'refCount' of the element at
//	'index' is decremented and replaced in the list with the 'valuePtr',
//	whose 'refCount' in turn is incremented.
//
//
//----------------------------------------------------------------------

func XTclListObjSetElement(tls *libc.TLS, interp uintptr, listPtr uintptr, index int32, valuePtr uintptr) int32 { /* tclListObj.c:1615:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	var listRepPtr uintptr // Internal representation of the list being
	// modified.
	var elemPtrs uintptr // Pointers to elements of the list.
	var elemCount int32  // Number of elements in the list.

	// Ensure that the listPtr parameter designates an unshared list.

	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+44583))
	}
	if (*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclListType)) {
		var result int32

		if (*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes == XtclEmptyStringRep {
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp,
					XTcl_NewStringObj(tls, ts+44554, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7420, ts+44578,
					ts+15353, uintptr(0)))
			}
			return TCL_ERROR
		}
		result = sSetListFromAny(tls, interp, listPtr)
		if result != TCL_OK {
			return result
		}
	}

	listRepPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
	elemCount = (*List)(unsafe.Pointer(listRepPtr)).FelemCount

	// Ensure that the index is in bounds.

	if index < 0 || index >= elemCount {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp,
				XTcl_NewStringObj(tls, ts+44554, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+7420, ts+44578, ts+15353,
				uintptr(0)))
		}
		return TCL_ERROR
	}

	// If the internal rep is shared, replace it with an unshared copy.

	if (*List)(unsafe.Pointer(listRepPtr)).FrefCount > 1 {
		var dst uintptr
		var src uintptr = listRepPtr + 16
		var newPtr uintptr = sAttemptNewList(tls, uintptr(0), (*List)(unsafe.Pointer(listRepPtr)).FmaxElemCount, uintptr(0))

		if newPtr == uintptr(0) {
			newPtr = sAttemptNewList(tls, interp, elemCount, uintptr(0))
			if newPtr == uintptr(0) {
				return TCL_ERROR
			}
		}
		(*List)(unsafe.Pointer(newPtr)).FrefCount++
		(*List)(unsafe.Pointer(newPtr)).FelemCount = elemCount
		(*List)(unsafe.Pointer(newPtr)).FcanonicalFlag = (*List)(unsafe.Pointer(listRepPtr)).FcanonicalFlag

		dst = newPtr + 16
		for libc.PostDecInt32(&elemCount, 1) != 0 {
			*(*uintptr)(unsafe.Pointer(dst)) = *(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&src, 8)))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&dst, 8))))).FrefCount++
		}

		(*List)(unsafe.Pointer(listRepPtr)).FrefCount--

		*(*uintptr)(unsafe.Pointer(listPtr + 32)) = libc.AssignUintptr(&listRepPtr, newPtr)
	}
	elemPtrs = listRepPtr + 16

	// Add a reference to the new list element.

	(*Tcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++

	// Remove a reference from the old list element.

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(index)*8))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	// Stash the new object in the list.

	*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(index)*8)) = valuePtr

	return TCL_OK
}

//----------------------------------------------------------------------
//
// FreeListInternalRep --
//
//	Deallocate the storage associated with the internal representation of a
//	a list object.
//
// Effect
//
//	The storage for the internal 'List' pointer of 'listPtr' is freed, the
//	'internalRep.twoPtrValue.ptr1' of 'listPtr' is set to NULL, and the 'refCount'
//	of each element of the list is decremented.
//
//----------------------------------------------------------------------

func sFreeListInternalRep(tls *libc.TLS, listPtr uintptr) { /* tclListObj.c:1740:1: */
	var listRepPtr uintptr = *(*uintptr)(unsafe.Pointer(listPtr + 32))

	if libc.PostDecInt32(&(*List)(unsafe.Pointer(listRepPtr)).FrefCount, 1) <= 1 {
		var elemPtrs uintptr = listRepPtr + 16
		var i int32
		var numElems int32 = (*List)(unsafe.Pointer(listRepPtr)).FelemCount

		for i = 0; i < numElems; i++ {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		XTclpFree(tls, listRepPtr)
	}

	(*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// DupListInternalRep --
//
//	Initialize the internal representation of a list 'Tcl_Obj' to share the
//	internal representation of an existing list object.
//
// Effect
//
//	The 'refCount' of the List internal rep is incremented.
//
//----------------------------------------------------------------------

func sDupListInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclListObj.c:1774:1: */
	var listRepPtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))

	*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = listRepPtr
	*(*uintptr)(unsafe.Pointer(copyPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
	(*List)(unsafe.Pointer(listRepPtr)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclListType))
}

//----------------------------------------------------------------------
//
// SetListFromAny --
//
//	Convert any object to a list.
//
// Value
//
//    TCL_OK
//
//	Success.  The internal representation of 'objPtr' is set, and the type
//	of 'objPtr' is 'tclListType'.
//
//    TCL_ERROR
//
//	An error occured during conversion. An error message is left in the
//	interpreter's result if 'interp' is not NULL.
//
//
//----------------------------------------------------------------------

func sSetListFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclListObj.c:1807:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	var listRepPtr uintptr
	var elemPtrs uintptr

	// Dictionaries are a special case; they have a string representation such
	// that *all* valid dictionaries are valid lists. Hence we can convert
	// more directly. Only do this when there's no existing string rep; if
	// there is, it is the string rep that's authoritative (because it could
	// describe duplicate keys).

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) && !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes) != 0) {
		// var keyPtr uintptr at bp+32, 8

		// var valuePtr uintptr at bp+40, 8

		// var search Tcl_DictSearch at bp+8, 24

		// var done int32 at bp+48, 4

		// var size int32 at bp, 4

		// Create the new list representation. Note that we do not need to do
		// anything with the string representation as the transformation (and
		// the reverse back to a dictionary) are both order-preserving. Also
		// note that since we know we've got a valid dictionary (by
		// representation) we also know that fetching the size of the
		// dictionary or iterating over it will not fail.

		XTcl_DictObjSize(tls, uintptr(0), objPtr, bp)
		listRepPtr = sAttemptNewList(tls, interp, func() int32 {
			if *(*int32)(unsafe.Pointer(bp)) > 0 {
				return 2 * *(*int32)(unsafe.Pointer(bp))
			}
			return 1
		}(), uintptr(0))
		if !(listRepPtr != 0) {
			return TCL_ERROR
		}
		(*List)(unsafe.Pointer(listRepPtr)).FelemCount = 2 * *(*int32)(unsafe.Pointer(bp))

		// Populate the list representation.

		elemPtrs = listRepPtr + 16
		XTcl_DictObjFirst(tls, uintptr(0), objPtr, bp+8, bp+32, bp+40, bp+48)
		for !(*(*int32)(unsafe.Pointer(bp + 48)) != 0) {
			*(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&elemPtrs, 8))) = *(*uintptr)(unsafe.Pointer(bp + 32 /* keyPtr */))
			*(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&elemPtrs, 8))) = *(*uintptr)(unsafe.Pointer(bp + 40 /* valuePtr */))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FrefCount++
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FrefCount++
			XTcl_DictObjNext(tls, bp+8, bp+32, bp+40, bp+48)
		}
	} else {
		var estCount int32
		// var length int32 at bp+52, 4

		// var limit uintptr at bp+56, 8

		*(*uintptr)(unsafe.Pointer(bp + 72 /* nextElem */)) = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 52)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, objPtr, bp+52)
		}()

		// Allocate enough space to hold a (Tcl_Obj *) for each
		// (possible) list element.

		estCount = XTclMaxListLength(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* nextElem */)), *(*int32)(unsafe.Pointer(bp + 52 /* length */)), bp+56)
		estCount = estCount + libc.Bool32(estCount == 0) // Smallest list struct holds 1
		// element.
		listRepPtr = sAttemptNewList(tls, interp, estCount, uintptr(0))
		if listRepPtr == uintptr(0) {
			return TCL_ERROR
		}
		elemPtrs = listRepPtr + 16

		// Each iteration, parse and store a list element.

		for *(*uintptr)(unsafe.Pointer(bp + 72)) < *(*uintptr)(unsafe.Pointer(bp + 56)) {
			// var elemStart uintptr at bp+64, 8

			// var elemSize int32 at bp+80, 4

			// var literal int32 at bp+84, 4

			if TCL_OK != XTclFindElement(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 72)), int32((int64(*(*uintptr)(unsafe.Pointer(bp + 56)))-int64(*(*uintptr)(unsafe.Pointer(bp + 72))))/1),
				bp+64, bp+72, bp+80, bp+84) {
				for libc.PreDecUintptr(&elemPtrs, 8) >= listRepPtr+16 {
					for ok := true; ok; ok = 0 != 0 {
						var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(elemPtrs))
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
				}
				XTclpFree(tls, listRepPtr)
				return TCL_ERROR
			}
			if *(*uintptr)(unsafe.Pointer(bp + 64)) == *(*uintptr)(unsafe.Pointer(bp + 56)) {
				break
			}

			// TODO: replace panic with error on alloc failure?
			if *(*int32)(unsafe.Pointer(bp + 84)) != 0 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							*(*uintptr)(unsafe.Pointer(elemPtrs)) = XTclThreadAllocObj(tls)
						} else {
							*(*uintptr)(unsafe.Pointer(elemPtrs)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)) + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).FrefCount = 0
					if *(*int32)(unsafe.Pointer(bp + 80)) == 0 {
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).Fbytes = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 80))+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).Fbytes, *(*uintptr)(unsafe.Pointer(bp + 64)), uint64(*(*int32)(unsafe.Pointer(bp + 80))))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).Fbytes + uintptr(*(*int32)(unsafe.Pointer(bp + 80))))) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).Flength = *(*int32)(unsafe.Pointer(bp + 80))
					}
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).FtypePtr = uintptr(0)
					{
					}
				}
			} else {
				for ok3 := true; ok3; ok3 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						*(*uintptr)(unsafe.Pointer(elemPtrs)) = XTclThreadAllocObj(tls)
					} else {
						*(*uintptr)(unsafe.Pointer(elemPtrs)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)) + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).FrefCount = 0
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).Flength = 0
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).FtypePtr = uintptr(0)
				{
				}

				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).Fbytes = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 80)))+uint32(1))
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).Flength = XTclCopyAndCollapse(tls, *(*int32)(unsafe.Pointer(bp + 80 /* elemSize */)), *(*uintptr)(unsafe.Pointer(bp + 64 /* elemStart */)),
					(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs)))).Fbytes)
			}

			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&elemPtrs, 8))))).FrefCount++ // Since list now holds ref to it.
		}

		(*List)(unsafe.Pointer(listRepPtr)).FelemCount = int32((int64(elemPtrs) - int64(listRepPtr+16)) / 8)
	}

	// Free the old internalRep before setting the new one. We do this as late
	// as possible to allow the conversion code, in particular
	// Tcl_GetStringFromObj, to use that old internalRep.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	}

	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = listRepPtr
	*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
	(*List)(unsafe.Pointer(listRepPtr)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclListType))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// UpdateStringOfList --
//
//	Update the string representation for a list object.
//
//	Any previously-exising string representation is not invalidated, so
//	storage is lost if this has not been taken care of.
//
// Effect
//
//	The string representation of 'listPtr' is set to the resulting string.
//	This string will be empty if the list has no elements. It is assumed
//	that the list internal representation is not NULL.
//
//----------------------------------------------------------------------

func sUpdateStringOfList(tls *libc.TLS, listPtr uintptr) { /* tclListObj.c:1941:1: */
	bp := tls.Alloc(84)
	defer tls.Free(84)

	// var localFlags [64]int8 at bp+16, 64

	var flagPtr uintptr = uintptr(0)
	var listRepPtr uintptr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
	var numElems int32 = (*List)(unsafe.Pointer(listRepPtr)).FelemCount
	var i int32
	// var length int32 at bp+80, 4

	var bytesNeeded int32 = 0
	var elem uintptr
	var dst uintptr
	var elemPtrs uintptr

	// Mark the list as being canonical; although it will now have a string
	// rep, it is one we derived through proper "canonical" quoting and so
	// it's known to be free from nasties relating to [concat] and [eval].

	(*List)(unsafe.Pointer(listRepPtr)).FcanonicalFlag = 1

	// Handle empty list case first, so rest of the routine is simpler.

	if numElems == 0 {
		(*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(listPtr)).Flength = 0
		return
	}

	// Pass 1: estimate space, gather flags.

	if numElems <= LOCAL_SIZE {
		flagPtr = bp + 16 /* &localFlags[0] */
	} else {
		// We know numElems <= LIST_MAX, so this is safe.

		flagPtr = XTcl_Alloc(tls, uint32(numElems))
	}
	elemPtrs = listRepPtr + 16
	for i = 0; i < numElems; i++ {
		*(*int8)(unsafe.Pointer(flagPtr + uintptr(i))) = func() int8 {
			if i != 0 {
				return int8(TCL_DONT_QUOTE_HASH)
			}
			return int8(0)
		}()
		elem = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 80)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)), bp+80)
		}()
		bytesNeeded = bytesNeeded + XTclScanElement(tls, elem, *(*int32)(unsafe.Pointer(bp + 80)), flagPtr+uintptr(i))
		if bytesNeeded < 0 {
			XTcl_Panic(tls, ts+9405, libc.VaList(bp, 0x7fffffff))
		}
	}
	if bytesNeeded > 0x7fffffff-numElems+1 {
		XTcl_Panic(tls, ts+9405, libc.VaList(bp+8, 0x7fffffff))
	}
	bytesNeeded = bytesNeeded + numElems

	// Pass 2: copy into string rep buffer.

	//
	//  We used to set the string length here, relying on a presumed
	//  guarantee that the number of bytes TclScanElement() calls reported
	//  to be needed was a precise count and not an over-estimate, so long
	//  as the same flag values were passed to TclConvertElement().
	//
	//  Then we saw [35a8f1c04a], where a bug in TclScanElement() caused
	//  that guarantee to fail. Rather than trust there are no more bugs,
	//  we set the length after the loop based on what was actually written,
	//  an not on what was predicted.
	//
	//     listPtr->length = bytesNeeded - 1;
	//      *
	//

	(*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes = XTcl_Alloc(tls, uint32(bytesNeeded))
	dst = (*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes
	for i = 0; i < numElems; i++ {
		*(*int8)(unsafe.Pointer(flagPtr + uintptr(i))) |= int8(func() int32 {
			if i != 0 {
				return TCL_DONT_QUOTE_HASH
			}
			return 0
		}())
		elem = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 80)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(elemPtrs + uintptr(i)*8)), bp+80)
		}()
		dst += uintptr(XTclConvertElement(tls, elem, *(*int32)(unsafe.Pointer(bp + 80 /* length */)), dst, int32(*(*int8)(unsafe.Pointer(flagPtr + uintptr(i))))))
		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(' ')
	}
	*(*int8)(unsafe.Pointer(dst + libc.UintptrFromInt32(-1))) = int8(0)

	// Here is the safe setting of the string length.
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).Flength = int32((int64(dst-uintptr(1)) - int64((*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes)) / 1)

	if flagPtr != bp+16 {
		XTclpFree(tls, flagPtr)
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------------
//
// TclInitLiteralTable --
//
//	This function is called to initialize the fields of a literal table
//	structure for either an interpreter or a compilation's CompileEnv
//	structure.
//
// Results:
//	None.
//
// Side effects:
//	The literal table is made ready for use.
//
//----------------------------------------------------------------------

func XTclInitLiteralTable(tls *libc.TLS, tablePtr uintptr) { /* tclLiteral.c:60:1: */

	(*LiteralTable)(unsafe.Pointer(tablePtr)).Fbuckets = tablePtr + 8 /* &.staticBuckets */
	*(*uintptr)(unsafe.Pointer(tablePtr + 8)) = libc.AssignPtrUintptr(tablePtr+8+1*8, uintptr(0))
	*(*uintptr)(unsafe.Pointer(tablePtr + 8 + 2*8)) = libc.AssignPtrUintptr(tablePtr+8+3*8, uintptr(0))
	(*LiteralTable)(unsafe.Pointer(tablePtr)).FnumBuckets = TCL_SMALL_HASH_TABLE
	(*LiteralTable)(unsafe.Pointer(tablePtr)).FnumEntries = 0
	(*LiteralTable)(unsafe.Pointer(tablePtr)).FrebuildSize = TCL_SMALL_HASH_TABLE * REBUILD_MULTIPLIER
	(*LiteralTable)(unsafe.Pointer(tablePtr)).Fmask = 3
}

//----------------------------------------------------------------------
//
// TclDeleteLiteralTable --
//
//	This function frees up everything associated with a literal table
//	except for the table's structure itself. It is called when the
//	interpreter is deleted.
//
// Results:
//	None.
//
// Side effects:
//	Each literal in the table is released: i.e., its reference count in
//	the global literal table is decremented and, if it becomes zero, the
//	literal is freed. In addition, the table's bucket array is freed.
//
//----------------------------------------------------------------------

func XTclDeleteLiteralTable(tls *libc.TLS, interp uintptr, tablePtr uintptr) { /* tclLiteral.c:100:1: */
	var entryPtr uintptr
	var nextPtr uintptr
	var objPtr uintptr
	var i int32

	// Release remaining literals in the table. Note that releasing a literal
	// might release other literals, modifying the table, so we restart the
	// search from the bucket chain we last found an entry.

	// We used to call TclReleaseLiteral for each literal in the table, which
	// is rather inefficient as it causes one lookup-by-hash for each
	// reference to the literal. We now rely at interp-deletion on each
	// bytecode object to release its references to the literal Tcl_Obj
	// without requiring that it updates the global table itself, and deal
	// here only with the table.

	for i = 0; i < (*LiteralTable)(unsafe.Pointer(tablePtr)).FnumBuckets; i++ {
		entryPtr = *(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr(i)*8))
		for entryPtr != uintptr(0) {
			objPtr = (*LiteralEntry)(unsafe.Pointer(entryPtr)).FobjPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, objPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, objPtr)
				}
			}

			nextPtr = (*LiteralEntry)(unsafe.Pointer(entryPtr)).FnextPtr
			XTclpFree(tls, entryPtr)
			entryPtr = nextPtr
		}
	}

	// Free up the table's bucket array if it was dynamically allocated.

	if (*LiteralTable)(unsafe.Pointer(tablePtr)).Fbuckets != tablePtr+8 {
		XTclpFree(tls, (*LiteralTable)(unsafe.Pointer(tablePtr)).Fbuckets)
	}
}

//----------------------------------------------------------------------
//
// TclCreateLiteral --
//
//	Find, or if necessary create, an object in the interpreter's literal
//	table that has a string representation matching the argument
//	string. If nsPtr!=NULL then only literals stored for the namespace are
//	considered.
//
// Results:
//	The literal object. If it was created in this call *newPtr is set to
//	1, else 0. NULL is returned if newPtr==NULL and no literal is found.
//
// Side effects:
//	Increments the ref count of the global LiteralEntry since the caller
//	now holds a reference. If LITERAL_ON_HEAP is set in flags, this
//	function is given ownership of the string: if an object is created
//	then its string representation is set directly from string, otherwise
//	the string is freed. Typically, a caller sets LITERAL_ON_HEAP if
//	"string" is an already heap-allocated buffer holding the result of
//	backslash substitutions.
//
//----------------------------------------------------------------------

func XTclCreateLiteral(tls *libc.TLS, iPtr uintptr, bytes uintptr, length int32, hash uint32, newPtr uintptr, nsPtr uintptr, flags int32, globalPtrPtr uintptr) uintptr { /* tclLiteral.c:174:9: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var globalTablePtr uintptr = iPtr + 336
	var globalPtr uintptr
	var globalHash int32
	var objPtr uintptr

	// Is it in the interpreter's global literal table?

	if hash == libc.Uint32(libc.Uint32FromInt32(-1)) {
		hash = sHashString(tls, bytes, length)
	}
	globalHash = int32(hash & uint32((*LiteralTable)(unsafe.Pointer(globalTablePtr)).Fmask))
	for globalPtr = *(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(globalTablePtr)).Fbuckets + uintptr(globalHash)*8)); globalPtr != uintptr(0); globalPtr = (*LiteralEntry)(unsafe.Pointer(globalPtr)).FnextPtr {
		objPtr = (*LiteralEntry)(unsafe.Pointer(globalPtr)).FobjPtr
		if (*LiteralEntry)(unsafe.Pointer(globalPtr)).FnsPtr == nsPtr {
			// Literals should always have UTF-8 representations... but this
			// is not guaranteed so we need to be careful anyway.
			//
			// https://stackoverflow.com/q/54337750/301832

			// var objLength int32 at bp, 4

			var objBytes uintptr = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
					return func() uintptr {
						*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
						return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
					}()
				}
				return XTcl_GetStringFromObj(tls, objPtr, bp)
			}()

			if *(*int32)(unsafe.Pointer(bp)) == length && (length == 0 ||
				int32(*(*int8)(unsafe.Pointer(objBytes))) == int32(*(*int8)(unsafe.Pointer(bytes))) &&
					libc.Xmemcmp(tls, objBytes, bytes, uint64(length)) == 0) {
				// A literal was found: return it

				if newPtr != 0 {
					*(*int32)(unsafe.Pointer(newPtr)) = 0
				}
				if globalPtrPtr != 0 {
					*(*uintptr)(unsafe.Pointer(globalPtrPtr)) = globalPtr
				}
				if flags&LITERAL_ON_HEAP != 0 {
					XTclpFree(tls, bytes)
				}
				(*LiteralEntry)(unsafe.Pointer(globalPtr)).FrefCount++
				return objPtr
			}
		}
	}
	if !(newPtr != 0) {
		if flags&LITERAL_ON_HEAP != 0 {
			XTclpFree(tls, bytes)
		}
		return uintptr(0)
	}

	// The literal is new to the interpreter. Add it to the global literal
	// table.

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	if flags&LITERAL_ON_HEAP != 0 {
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = bytes
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = length
	} else {
		if length == 0 {
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(length+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, bytes, uint64(length))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(length))) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = length
		}

	}

	if flags&LITERAL_UNSHARED != 0 {
		// Make clear, that no global value is returned
		if globalPtrPtr != uintptr(0) {
			*(*uintptr)(unsafe.Pointer(globalPtrPtr)) = uintptr(0)
		}
		return objPtr
	}

	globalPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(LiteralEntry{})))
	(*LiteralEntry)(unsafe.Pointer(globalPtr)).FobjPtr = objPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	(*LiteralEntry)(unsafe.Pointer(globalPtr)).FrefCount = 1
	(*LiteralEntry)(unsafe.Pointer(globalPtr)).FnsPtr = nsPtr
	(*LiteralEntry)(unsafe.Pointer(globalPtr)).FnextPtr = *(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(globalTablePtr)).Fbuckets + uintptr(globalHash)*8))
	*(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(globalTablePtr)).Fbuckets + uintptr(globalHash)*8)) = globalPtr
	(*LiteralTable)(unsafe.Pointer(globalTablePtr)).FnumEntries++

	// If the global literal table has exceeded a decent size, rebuild it with
	// more buckets.

	if (*LiteralTable)(unsafe.Pointer(globalTablePtr)).FnumEntries >= (*LiteralTable)(unsafe.Pointer(globalTablePtr)).FrebuildSize {
		sRebuildLiteralTable(tls, globalTablePtr)
	}

	if globalPtrPtr != 0 {
		*(*uintptr)(unsafe.Pointer(globalPtrPtr)) = globalPtr
	}
	*(*int32)(unsafe.Pointer(newPtr)) = 1
	return objPtr
}

//----------------------------------------------------------------------
//
// TclFetchLiteral --
//
//	Fetch from a CompileEnv the literal value identified by an index
//	value, as returned by a prior call to TclRegisterLiteral().
//
// Results:
//	The literal value, or NULL if the index is out of range.
//
//----------------------------------------------------------------------

func XTclFetchLiteral(tls *libc.TLS, envPtr uintptr, index uint32) uintptr { /* tclLiteral.c:340:9: */
	if index >= uint32((*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext) {
		return uintptr(0)
	}
	return (*LiteralEntry)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr + uintptr(index)*32)).FobjPtr
}

//----------------------------------------------------------------------
//
// TclRegisterLiteral --
//
//	Find, or if necessary create, an object in a CompileEnv literal array
//	that has a string representation matching the argument string.
//
// Results:
//	The index in the CompileEnv's literal array that references a shared
//	literal matching the string. The object is created if necessary.
//
// Side effects:
//	To maximize sharing, we look up the string in the interpreter's global
//	literal table. If not found, we create a new shared literal in the
//	global table. We then add a reference to the shared literal in the
//	CompileEnv's literal array.
//
//	If LITERAL_ON_HEAP is set in flags, this function is given ownership
//	of the string: if an object is created then its string representation
//	is set directly from string, otherwise the string is freed. Typically,
//	a caller sets LITERAL_ON_HEAP if "string" is an already heap-allocated
//	buffer holding the result of backslash substitutions.
//
//----------------------------------------------------------------------

func XTclRegisterLiteral(tls *libc.TLS, ePtr uintptr, bytes uintptr, length int32, flags int32) int32 { /* tclLiteral.c:381:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var envPtr uintptr = ePtr
	var iPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FiPtr
	var localTablePtr uintptr = envPtr + 56
	// var globalPtr uintptr at bp+8, 8

	var localPtr uintptr
	var objPtr uintptr
	var hash uint32
	var localHash int32
	var objIndex int32
	// var new int32 at bp, 4

	var nsPtr uintptr

	if length < 0 {
		length = func() int32 {
			if bytes != 0 {
				return int32(libc.Xstrlen(tls, bytes))
			}
			return 0
		}()
	}
	hash = sHashString(tls, bytes, length)

	// Is the literal already in the CompileEnv's local literal array? If so,
	// just return its index.

	localHash = int32(hash & uint32((*LiteralTable)(unsafe.Pointer(localTablePtr)).Fmask))
	for localPtr = *(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(localTablePtr)).Fbuckets + uintptr(localHash)*8)); localPtr != uintptr(0); localPtr = (*LiteralEntry)(unsafe.Pointer(localPtr)).FnextPtr {
		objPtr = (*LiteralEntry)(unsafe.Pointer(localPtr)).FobjPtr
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == length && (length == 0 ||
			int32(*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes))) == int32(*(*int8)(unsafe.Pointer(bytes))) &&
				libc.Xmemcmp(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, bytes, uint64(length)) == 0) {
			if flags&LITERAL_ON_HEAP != 0 {
				XTclpFree(tls, bytes)
			}
			objIndex = int32((int64(localPtr) - int64((*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr)) / 32)

			return objIndex
		}
	}

	// The literal is new to this CompileEnv. If it is a command name, avoid
	// sharing it accross namespaces, and try not to share it with non-cmd
	// literals. Note that FQ command names can be shared, so that we register
	// the namespace as the interp's global NS.

	if flags&LITERAL_CMD_NAME != 0 {
		if length >= 2 && int32(*(*int8)(unsafe.Pointer(bytes))) == ':' && int32(*(*int8)(unsafe.Pointer(bytes + 1))) == ':' {
			nsPtr = (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr
		} else {
			nsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr
		}
	} else {
		nsPtr = uintptr(0)
	}

	// Is it in the interpreter's global literal table? If not, create it.

	*(*uintptr)(unsafe.Pointer(bp + 8 /* globalPtr */)) = uintptr(0)
	objPtr = XTclCreateLiteral(tls, iPtr, bytes, length, hash, bp, nsPtr, flags,
		bp+8)
	objIndex = sAddLocalLiteralEntry(tls, envPtr, objPtr, localHash)

	return objIndex
}

//----------------------------------------------------------------------
//
// TclHideLiteral --
//
//	Remove a literal entry from the literal hash tables, leaving it in the
//	literal array so existing references continue to function. This makes
//	it possible to turn a shared literal into a private literal that
//	cannot be shared.
//
// Results:
//	None.
//
// Side effects:
//	Removes the literal from the local hash table and decrements the
//	global hash entry's reference count.
//
//----------------------------------------------------------------------

func XTclHideLiteral(tls *libc.TLS, interp uintptr, envPtr uintptr, index int32) { /* tclLiteral.c:536:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var nextPtrPtr uintptr
	var entryPtr uintptr
	var lPtr uintptr
	var localTablePtr uintptr = envPtr + 56
	var localHash int32
	// var length int32 at bp, 4

	var bytes uintptr
	var newObjPtr uintptr

	lPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr + uintptr(index)*32

	// To avoid unwanted sharing we need to copy the object and remove it from
	// the local and global literal tables. It still has a slot in the literal
	// array so it can be referred to by byte codes, but it will not be
	// matched by literal searches.

	newObjPtr = XTcl_DuplicateObj(tls, (*LiteralEntry)(unsafe.Pointer(lPtr)).FobjPtr)
	(*Tcl_Obj)(unsafe.Pointer(newObjPtr)).FrefCount++
	XTclReleaseLiteral(tls, interp, (*LiteralEntry)(unsafe.Pointer(lPtr)).FobjPtr)
	(*LiteralEntry)(unsafe.Pointer(lPtr)).FobjPtr = newObjPtr

	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(newObjPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(newObjPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(newObjPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, newObjPtr, bp)
	}()
	localHash = int32(sHashString(tls, bytes, *(*int32)(unsafe.Pointer(bp))) & uint32((*LiteralTable)(unsafe.Pointer(localTablePtr)).Fmask))
	nextPtrPtr = (*LiteralTable)(unsafe.Pointer(localTablePtr)).Fbuckets + uintptr(localHash)*8

	for entryPtr = *(*uintptr)(unsafe.Pointer(nextPtrPtr)); entryPtr != uintptr(0); entryPtr = *(*uintptr)(unsafe.Pointer(nextPtrPtr)) {
		if entryPtr == lPtr {
			*(*uintptr)(unsafe.Pointer(nextPtrPtr)) = (*LiteralEntry)(unsafe.Pointer(lPtr)).FnextPtr
			(*LiteralEntry)(unsafe.Pointer(lPtr)).FnextPtr = uintptr(0)
			(*LiteralTable)(unsafe.Pointer(localTablePtr)).FnumEntries--
			break
		}
		nextPtrPtr = entryPtr
	}
}

//----------------------------------------------------------------------
//
// TclAddLiteralObj --
//
//	Add a single literal object to the literal array. This function does
//	not add the literal to the local or global literal tables. The caller
//	is expected to add the entry to whatever tables are appropriate.
//
// Results:
//	The index in the CompileEnv's literal array that references the
//	literal. Stores the pointer to the new literal entry in the location
//	referenced by the localPtrPtr argument.
//
// Side effects:
//	Expands the literal array if necessary. Increments the refcount on the
//	literal object.
//
//----------------------------------------------------------------------

func XTclAddLiteralObj(tls *libc.TLS, envPtr uintptr, objPtr uintptr, litPtrPtr uintptr) int32 { /* tclLiteral.c:601:1: */
	var lPtr uintptr
	var objIndex int32

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext >= (*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayEnd {
		sExpandLocalLiteralArray(tls, envPtr)
	}
	objIndex = (*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext
	(*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext++

	lPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr + uintptr(objIndex)*32
	(*LiteralEntry)(unsafe.Pointer(lPtr)).FobjPtr = objPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	(*LiteralEntry)(unsafe.Pointer(lPtr)).FrefCount = -1 // i.e., unused
	(*LiteralEntry)(unsafe.Pointer(lPtr)).FnextPtr = uintptr(0)

	if litPtrPtr != 0 {
		*(*uintptr)(unsafe.Pointer(litPtrPtr)) = lPtr
	}

	return objIndex
}

//----------------------------------------------------------------------
//
// AddLocalLiteralEntry --
//
//	Insert a new literal into a CompileEnv's local literal array.
//
// Results:
//	The index in the CompileEnv's literal array that references the
//	literal.
//
// Side effects:
//	Expands the literal array if necessary. May rebuild the hash bucket
//	array of the CompileEnv's literal array if it becomes too large.
//
//----------------------------------------------------------------------

func sAddLocalLiteralEntry(tls *libc.TLS, envPtr uintptr, objPtr uintptr, localHash int32) int32 { /* tclLiteral.c:650:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var localTablePtr uintptr = envPtr + 56
	// var localPtr uintptr at bp, 8

	var objIndex int32

	objIndex = XTclAddLiteralObj(tls, envPtr, objPtr, bp)

	// Add the literal to the local table.

	(*LiteralEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* localPtr */)))).FnextPtr = *(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(localTablePtr)).Fbuckets + uintptr(localHash)*8))
	*(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(localTablePtr)).Fbuckets + uintptr(localHash)*8)) = *(*uintptr)(unsafe.Pointer(bp /* localPtr */))
	(*LiteralTable)(unsafe.Pointer(localTablePtr)).FnumEntries++

	// If the CompileEnv's local literal table has exceeded a decent size,
	// rebuild it with more buckets.

	if (*LiteralTable)(unsafe.Pointer(localTablePtr)).FnumEntries >= (*LiteralTable)(unsafe.Pointer(localTablePtr)).FrebuildSize {
		sRebuildLiteralTable(tls, localTablePtr)
	}

	return objIndex
}

//----------------------------------------------------------------------
//
// ExpandLocalLiteralArray --
//
//	Function that uses malloc to allocate more storage for a CompileEnv's
//	local literal array.
//
// Results:
//	None.
//
// Side effects:
//	The literal array in *envPtr is reallocated to a new array of double
//	the size, and if envPtr->mallocedLiteralArray is non-zero the old
//	array is freed. Entries are copied from the old array to the new one.
//	The local literal table is updated to refer to the new entries.
//
//----------------------------------------------------------------------

func sExpandLocalLiteralArray(tls *libc.TLS, envPtr uintptr) { /* tclLiteral.c:727:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// The current allocated local literal entries are stored between elements
	// 0 and (envPtr->literalArrayNext - 1) [inclusive].

	var localTablePtr uintptr = envPtr + 56
	var currElems int32 = (*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext
	var currBytes Size_t = uint64(currElems) * uint64(unsafe.Sizeof(LiteralEntry{}))
	var currArrayPtr uintptr = (*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr
	var newArrayPtr uintptr
	var i int32
	var newSize uint32
	if currBytes <= uint64((uint32(0x7fffffff)*2+1)/uint32(2)) {
		newSize = uint32(uint64(2) * currBytes)
	} else {
		newSize = uint32(0x7fffffff)*2 + 1
	}

	if currBytes == Size_t(newSize) {
		XTcl_Panic(tls, ts+44604,
			libc.VaList(bp, currElems))
	}

	if (*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedLiteralArray != 0 {
		newArrayPtr = XTcl_Realloc(tls, currArrayPtr, newSize)
	} else {
		// envPtr->literalArrayPtr isn't a ckalloc'd pointer, so we must
		// code a ckrealloc equivalent for ourselves.

		newArrayPtr = XTcl_Alloc(tls, newSize)
		libc.Xmemcpy(tls, newArrayPtr, currArrayPtr, currBytes)
		(*CompileEnv)(unsafe.Pointer(envPtr)).FmallocedLiteralArray = 1
	}

	// Update the local literal table's bucket array.

	if currArrayPtr != newArrayPtr {
		for i = 0; i < currElems; i++ {
			if (*LiteralEntry)(unsafe.Pointer(newArrayPtr+uintptr(i)*32)).FnextPtr != uintptr(0) {
				(*LiteralEntry)(unsafe.Pointer(newArrayPtr + uintptr(i)*32)).FnextPtr = newArrayPtr +
					uintptr((int64((*LiteralEntry)(unsafe.Pointer(newArrayPtr+uintptr(i)*32)).FnextPtr)-int64(currArrayPtr))/32)*32
			}
		}
		for i = 0; i < (*LiteralTable)(unsafe.Pointer(localTablePtr)).FnumBuckets; i++ {
			if *(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(localTablePtr)).Fbuckets + uintptr(i)*8)) != uintptr(0) {
				*(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(localTablePtr)).Fbuckets + uintptr(i)*8)) = newArrayPtr +
					uintptr((int64(*(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(localTablePtr)).Fbuckets + uintptr(i)*8)))-int64(currArrayPtr))/32)*32
			}
		}
	}

	(*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr = newArrayPtr
	(*CompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayEnd = int32(uint64(newSize) / uint64(unsafe.Sizeof(LiteralEntry{})))
}

//----------------------------------------------------------------------
//
// TclReleaseLiteral --
//
//	This function releases a reference to one of the shared Tcl objects
//	that hold literals. It is called to release the literals referenced by
//	a ByteCode that is being destroyed, and it is also called by
//	TclDeleteLiteralTable.
//
// Results:
//	None.
//
// Side effects:
//	The reference count for the global LiteralTable entry that corresponds
//	to the literal is decremented. If no other reference to a global
//	literal object remains, it is freed.
//
//----------------------------------------------------------------------

func XTclReleaseLiteral(tls *libc.TLS, interp uintptr, objPtr uintptr) { /* tclLiteral.c:807:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr
	var globalTablePtr uintptr
	var entryPtr uintptr
	var prevPtr uintptr
	var bytes uintptr
	// var length int32 at bp, 4

	var index int32
	var cachePtr uintptr
	var _objPtr uintptr
	iPtr = interp

	if !(iPtr == uintptr(0)) {
		goto __1
	}
	goto done
__1:
	;

	globalTablePtr = iPtr + 336
	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp)
	}()
	index = int32(sHashString(tls, bytes, *(*int32)(unsafe.Pointer(bp))) & uint32((*LiteralTable)(unsafe.Pointer(globalTablePtr)).Fmask))

	// Check to see if the object is in the global literal table and remove
	// this reference. The object may not be in the table if it is a hidden
	// local literal.

	prevPtr = uintptr(0)
	entryPtr = *(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(globalTablePtr)).Fbuckets + uintptr(index)*8))
__2:
	if !(entryPtr != uintptr(0)) {
		goto __4
	}
	if !((*LiteralEntry)(unsafe.Pointer(entryPtr)).FobjPtr == objPtr) {
		goto __5
	}
	(*LiteralEntry)(unsafe.Pointer(entryPtr)).FrefCount--

	// If the literal is no longer being used by any ByteCode, delete
	// the entry then remove the reference corresponding to the global
	// literal table entry (decrement the ref count of the object).

	if !((*LiteralEntry)(unsafe.Pointer(entryPtr)).FrefCount == 0) {
		goto __6
	}
	if !(prevPtr == uintptr(0)) {
		goto __7
	}
	*(*uintptr)(unsafe.Pointer((*LiteralTable)(unsafe.Pointer(globalTablePtr)).Fbuckets + uintptr(index)*8)) = (*LiteralEntry)(unsafe.Pointer(entryPtr)).FnextPtr
	goto __8
__7:
	(*LiteralEntry)(unsafe.Pointer(prevPtr)).FnextPtr = (*LiteralEntry)(unsafe.Pointer(entryPtr)).FnextPtr
__8:
	;
	XTclpFree(tls, entryPtr)
	(*LiteralTable)(unsafe.Pointer(globalTablePtr)).FnumEntries--

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1) {
		goto __9
	}
	goto __10
__9:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __11
	}

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep) {
		goto __13
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
__13:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
__14:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __17
	}
	XTclThreadFreeObj(tls, objPtr)
	goto __18
__17:
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__18:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	goto __12
__11:
	XTclFreeObj(tls, objPtr)
__12:
	;
__10:
	;

__6:
	;
	goto __4
__5:
	;
	goto __3
__3:
	prevPtr = entryPtr
	entryPtr = (*LiteralEntry)(unsafe.Pointer(entryPtr)).FnextPtr
	goto __2
	goto __4
__4:
	;

	// Remove the reference corresponding to the local literal table entry.

done:
__19:
	_objPtr = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __22
	}
	XTclFreeObj(tls, _objPtr)
__22:
	;
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
}

//----------------------------------------------------------------------
//
// HashString --
//
//	Compute a one-word summary of a text string, which can be used to
//	generate a hash index.
//
// Results:
//	The return value is a one-word summary of the information in string.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sHashString(tls *libc.TLS, string uintptr, length int32) uint32 { /* tclLiteral.c:890:1: */
	var result uint32 = uint32(0)

	// I tried a zillion different hash functions and asked many other people
	// for advice. Many people had their own favorite functions, all
	// different, but no-one had much idea why they were good ones. I chose
	// the one below (multiply by 9 and add new character) because of the
	// following reasons:
	//
	// 1. Multiplying by 10 is perfect for keys that are decimal strings, and
	//    multiplying by 9 is just about as good.
	// 2. Times-9 is (shift-left-3) plus (old). This means that each
	//    character's bits hang around in the low-order bits of the hash value
	//    for ever, plus they spread fairly rapidly up to the high-order bits
	//    to fill out the hash value. This seems works well both for decimal
	//    and non-decimal strings.
	//
	// Note that this function is very weak against malicious strings; it's
	// very easy to generate multiple keys that have the same hashcode. On the
	// other hand, that hardly ever actually occurs and this function *is*
	// very cheap, even by comparison with industry-standard hashes like FNV.
	// If real strength of hash is required though, use a custom hash based on
	// Bob Jenkins's lookup3(), but be aware that it's significantly slower.
	// Tcl scripts tend to not have a big issue in this area, and literals
	// mostly aren't looked up by name anyway.
	//
	// See also HashStringKey in tclHash.c.
	// See also TclObjHashKey in tclObj.c.
	//
	// See [tcl-Feature Request #2958832]

	if length > 0 {
		result = uint32(uint8(*(*int8)(unsafe.Pointer(string))))
		for libc.PreDecInt32(&length, 1) != 0 {
			result = result + (result<<3 + uint32(uint8(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&string, 1))))))
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// RebuildLiteralTable --
//
//	This function is invoked when the ratio of entries to hash buckets
//	becomes too large in a local or global literal table. It allocates a
//	larger bucket array and moves the entries into the new buckets.
//
// Results:
//	None.
//
// Side effects:
//	Memory gets reallocated and entries get rehashed into new buckets.
//
//----------------------------------------------------------------------

func sRebuildLiteralTable(tls *libc.TLS, tablePtr uintptr) { /* tclLiteral.c:954:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var oldBuckets uintptr
	var oldChainPtr uintptr
	var newChainPtr uintptr
	var entryPtr uintptr
	var bucketPtr uintptr
	var bytes uintptr
	var oldSize uint32
	var count int32
	var index int32
	// var length int32 at bp, 4

	oldSize = uint32((*LiteralTable)(unsafe.Pointer(tablePtr)).FnumBuckets)
	oldBuckets = (*LiteralTable)(unsafe.Pointer(tablePtr)).Fbuckets

	// Allocate and initialize the new bucket array, and set up hashing
	// constants for new array size.

	if uint64(oldSize) > uint64(uint32(0x7fffffff)*2+1)/(uint64(4)*uint64(unsafe.Sizeof(uintptr(0)))) {
		// Memory allocator limitations will not let us create the
		// next larger table size.  Best option is to limp along
		// with what we have.

		return
	}

	*(*int32)(unsafe.Pointer(tablePtr + 40)) *= 4
	(*LiteralTable)(unsafe.Pointer(tablePtr)).Fbuckets = XTcl_Alloc(tls, uint32(uint64((*LiteralTable)(unsafe.Pointer(tablePtr)).FnumBuckets)*uint64(unsafe.Sizeof(uintptr(0)))))
	count = (*LiteralTable)(unsafe.Pointer(tablePtr)).FnumBuckets
	newChainPtr = (*LiteralTable)(unsafe.Pointer(tablePtr)).Fbuckets
__1:
	if !(count > 0) {
		goto __3
	}
	{
		*(*uintptr)(unsafe.Pointer(newChainPtr)) = uintptr(0)

	}
	goto __2
__2:
	count--
	newChainPtr += 8
	goto __1
	goto __3
__3:
	;
	*(*int32)(unsafe.Pointer(tablePtr + 48)) *= 4
	(*LiteralTable)(unsafe.Pointer(tablePtr)).Fmask = (*LiteralTable)(unsafe.Pointer(tablePtr)).Fmask<<2 + 3

	// Rehash all of the existing entries into the new bucket array.

	oldChainPtr = oldBuckets
__4:
	if !(oldSize > uint32(0)) {
		goto __6
	}
	{
		for entryPtr = *(*uintptr)(unsafe.Pointer(oldChainPtr)); entryPtr != uintptr(0); entryPtr = *(*uintptr)(unsafe.Pointer(oldChainPtr)) {
			bytes = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer((*LiteralEntry)(unsafe.Pointer(entryPtr)).FobjPtr)).Fbytes != 0 {
					return func() uintptr {
						*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer((*LiteralEntry)(unsafe.Pointer(entryPtr)).FobjPtr)).Flength
						return (*Tcl_Obj)(unsafe.Pointer((*LiteralEntry)(unsafe.Pointer(entryPtr)).FobjPtr)).Fbytes
					}()
				}
				return XTcl_GetStringFromObj(tls, (*LiteralEntry)(unsafe.Pointer(entryPtr)).FobjPtr, bp)
			}()
			index = int32(sHashString(tls, bytes, *(*int32)(unsafe.Pointer(bp))) & uint32((*LiteralTable)(unsafe.Pointer(tablePtr)).Fmask))

			*(*uintptr)(unsafe.Pointer(oldChainPtr)) = (*LiteralEntry)(unsafe.Pointer(entryPtr)).FnextPtr
			bucketPtr = (*LiteralTable)(unsafe.Pointer(tablePtr)).Fbuckets + uintptr(index)*8
			(*LiteralEntry)(unsafe.Pointer(entryPtr)).FnextPtr = *(*uintptr)(unsafe.Pointer(bucketPtr))
			*(*uintptr)(unsafe.Pointer(bucketPtr)) = entryPtr
		}

	}
	goto __5
__5:
	oldSize--
	oldChainPtr += 8
	goto __4
	goto __6
__6:
	;

	// Free up the old bucket array, if it was dynamically allocated.

	if oldBuckets != tablePtr+8 {
		XTclpFree(tls, oldBuckets)
	}
}

//----------------------------------------------------------------------
//
// TclInvalidateCmdLiteral --
//
//	Invalidate a command literal entry, if present in the literal hash
//	tables, by resetting its internal representation. This invalidation
//	leaves it in the literal tables and in existing literal arrays. As a
//	result, existing references continue to work but we force a fresh
//	command look-up upon the next use (see, in particular,
//	TclSetCmdNameObj()).
//
// Results:
//	None.
//
// Side effects:
//	Resets the internal representation of the CmdName Tcl_Obj
//	using TclFreeIntRep().
//
//----------------------------------------------------------------------

func XTclInvalidateCmdLiteral(tls *libc.TLS, interp uintptr, name uintptr, nsPtr uintptr) { /* tclLiteral.c:1042:1: */
	var iPtr uintptr = interp
	var literalObjPtr uintptr = XTclCreateLiteral(tls, iPtr, name,
		int32(libc.Xstrlen(tls, name)), libc.Uint32FromInt32(-1), uintptr(0), nsPtr, 0, uintptr(0))

	if literalObjPtr != uintptr(0) {
		if (*Tcl_Obj)(unsafe.Pointer(literalObjPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclCmdNameType)) {
			if (*Tcl_Obj)(unsafe.Pointer(literalObjPtr)).FtypePtr != uintptr(0) {
				if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(literalObjPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
					(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(literalObjPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, literalObjPtr)
				}
				(*Tcl_Obj)(unsafe.Pointer(literalObjPtr)).FtypePtr = uintptr(0)
			}

		}
		// Balance the refcount effects of TclCreateLiteral() above
		(*Tcl_Obj)(unsafe.Pointer(literalObjPtr)).FrefCount++
		XTclReleaseLiteral(tls, interp, literalObjPtr)
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The following structure describes a package that has been loaded either
// dynamically (with the "load" command) or statically (as indicated by a call
// to TclGetLoadedPackages). All such packages are linked together into a
// single list for the process. Packages are never unloaded, until the
// application exits, when TclFinalizeLoad is called, and these structures are
// freed.

type LoadedPackage1 = struct {
	FfileName           uintptr
	FpackageName        uintptr
	FloadHandle         Tcl_LoadHandle
	FinitProc           uintptr
	FsafeInitProc       uintptr
	FunloadProc         uintptr
	FsafeUnloadProc     uintptr
	FinterpRefCount     int32
	FsafeInterpRefCount int32
	FnextPtr            uintptr
} /* tclLoad.c:24:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The following structure describes a package that has been loaded either
// dynamically (with the "load" command) or statically (as indicated by a call
// to TclGetLoadedPackages). All such packages are linked together into a
// single list for the process. Packages are never unloaded, until the
// application exits, when TclFinalizeLoad is called, and these structures are
// freed.

type LoadedPackage = LoadedPackage1 /* tclLoad.c:62:3 */

// TCL_THREADS
// There is a global list of packages that is anchored at firstPackagePtr.
// Access to this list is governed by a mutex.

var firstPackagePtr uintptr = uintptr(0) /* tclLoad.c:70:22 */
// First in list of all packages loaded into
// this process.

var packageMutex Tcl_Mutex /* tclLoad.c:74:1: */

// The following structure represents a particular package that has been
// incorporated into a particular interpreter (by calling its initialization
// function). There is a list of these structures for each interpreter, with
// an AssocData value (key "load") for the interpreter that points to the
// first package (if any).

type InterpPackage1 = struct {
	FpkgPtr  uintptr
	FnextPtr uintptr
} /* tclLoad.c:84:9 */

// The following structure represents a particular package that has been
// incorporated into a particular interpreter (by calling its initialization
// function). There is a list of these structures for each interpreter, with
// an AssocData value (key "load") for the interpreter that points to the
// first package (if any).

type InterpPackage = InterpPackage1 /* tclLoad.c:90:3 */

//----------------------------------------------------------------------
//
// Tcl_LoadObjCmd --
//
//	This function is invoked to process the "load" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_LoadObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclLoad.c:117:1: */
	bp := tls.Alloc(1648)
	defer tls.Free(1648)

	var target uintptr
	var pkgPtr uintptr
	var defaultPtr uintptr
	// var prefix Tcl_DString at bp+296, 216

	// var tmp Tcl_DString at bp+1376, 216

	// var initName Tcl_DString at bp+512, 216

	// var safeInitName Tcl_DString at bp+728, 216

	// var unloadName Tcl_DString at bp+944, 216

	// var safeUnloadName Tcl_DString at bp+1160, 216

	var ipFirstPtr uintptr
	var ipPtr uintptr
	var code int32
	var namesMatch int32
	var filesMatch int32
	var offset int32
	// var symbols [2]uintptr at bp+1616, 16

	// var initProc uintptr at bp+1632, 8

	var p uintptr
	var fullFileName uintptr
	var packageName uintptr
	// var loadHandle Tcl_LoadHandle at bp+1640, 8

	// var ch Tcl_UniChar at bp+1608, 2

	var len uint32
	// var index int32 at bp+288, 4

	var flags int32
	var savedobjv uintptr
	var childIntName uintptr
	var _objPtr uintptr
	var _objPtr1 uintptr
	var splitPtr uintptr
	// var pkgGuessPtr uintptr at bp+1600, 8

	// var pElements int32 at bp+1592, 4

	var pkgGuess uintptr
	var retc int32
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 1608 /* ch */)) = Tcl_UniChar(0)
	flags = 0
	savedobjv = objv

__1:
	if !(objc > 2) {
		goto __2
	}
	if !(int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()))) != '-') {
		goto __3
	}
	goto __2
__3:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&options15)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+288) != TCL_OK) {
		goto __4
	}
	return TCL_ERROR
__4:
	;
	objv += 8
	objc--
	if !(0 == int32(uint32(*(*int32)(unsafe.Pointer(bp + 288))))) {
		goto __5
	}
	flags = flags | TCL_LOAD_GLOBAL
	goto __6
__5:
	if !(1 == int32(uint32(*(*int32)(unsafe.Pointer(bp + 288))))) {
		goto __7
	}
	flags = flags | TCL_LOAD_LAZY
	goto __8
__7:
	goto __2
__8:
	;
__6:
	;
	goto __1
__2:
	;
	if !(objc < 2 || objc > 4) {
		goto __9
	}
	XTcl_WrongNumArgs(tls, interp, 1, savedobjv, ts+44657)
	return TCL_ERROR
__9:
	;
	if !(XTcl_FSConvertToPathType(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) != TCL_OK) {
		goto __10
	}
	return TCL_ERROR
__10:
	;
	fullFileName = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))

	XTcl_DStringInit(tls, bp+296)
	XTcl_DStringInit(tls, bp+512)
	XTcl_DStringInit(tls, bp+728)
	XTcl_DStringInit(tls, bp+944)
	XTcl_DStringInit(tls, bp+1160)
	XTcl_DStringInit(tls, bp+1376)

	packageName = uintptr(0)
	if !(objc >= 3) {
		goto __11
	}
	packageName = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(int32(*(*int8)(unsafe.Pointer(packageName))) == 0) {
		goto __12
	}
	packageName = uintptr(0)
__12:
	;
__11:
	;
	if !(int32(*(*int8)(unsafe.Pointer(fullFileName))) == 0 && packageName == uintptr(0)) {
		goto __13
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+44712, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+44758, ts+44763,
		uintptr(0)))
	code = TCL_ERROR
	goto done
__13:
	;

	// Figure out which interpreter we're going to load the package into.

	target = interp
	if !(objc == 4) {
		goto __14
	}
	childIntName = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))

	target = XTcl_GetSlave(tls, interp, childIntName)
	if !(target == uintptr(0)) {
		goto __15
	}
	code = TCL_ERROR
	goto done
__15:
	;
__14:
	;

	// Scan through the packages that are currently loaded to see if the
	// package we want is already loaded. We'll use a loaded package if it
	// meets any of the following conditions:
	//  - Its name and file match the once we're looking for.
	//  - Its file matches, and we weren't given a name.
	//  - Its name matches, the file name was specified as empty, and there is
	//	  only no statically loaded package with the same name.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&packageMutex)))

	defaultPtr = uintptr(0)
	pkgPtr = firstPackagePtr
__16:
	if !(pkgPtr != uintptr(0)) {
		goto __18
	}
	if !(packageName == uintptr(0)) {
		goto __19
	}
	namesMatch = 0
	goto __20
__19:
	XTcl_DStringSetLength(tls, bp+296, 0)
	XTcl_DStringAppend(tls, bp+296, packageName, -1)
	XTcl_DStringSetLength(tls, bp+1376, 0)
	XTcl_DStringAppend(tls, bp+1376, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName, -1)
	XTcl_UtfToLower(tls, (*Tcl_DString)(unsafe.Pointer(bp+296)).Fstring)
	XTcl_UtfToLower(tls, (*Tcl_DString)(unsafe.Pointer(bp+1376)).Fstring)
	if !(libc.Xstrcmp(tls, (*Tcl_DString)(unsafe.Pointer(bp+1376)).Fstring,
		(*Tcl_DString)(unsafe.Pointer(bp+296)).Fstring) == 0) {
		goto __21
	}
	namesMatch = 1
	goto __22
__21:
	namesMatch = 0
__22:
	;
__20:
	;
	XTcl_DStringSetLength(tls, bp+296, 0)

	filesMatch = libc.Bool32(libc.Xstrcmp(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FfileName, fullFileName) == 0)
	if !(filesMatch != 0 && (namesMatch != 0 || packageName == uintptr(0))) {
		goto __23
	}
	goto __18
__23:
	;
	if !(namesMatch != 0 && int32(*(*int8)(unsafe.Pointer(fullFileName))) == 0) {
		goto __24
	}
	defaultPtr = pkgPtr
__24:
	;
	if !(filesMatch != 0 && !(namesMatch != 0) && int32(*(*int8)(unsafe.Pointer(fullFileName))) != 0) {
		goto __25
	}
	// Can't have two different packages loaded from the same file.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+44773,
		libc.VaList(bp+40, fullFileName, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+3593, ts+7420, ts+44758,
		ts+44818, uintptr(0)))
	code = TCL_ERROR
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	goto done
__25:
	;
	goto __17
__17:
	pkgPtr = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FnextPtr
	goto __16
	goto __18
__18:
	;
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	if !(pkgPtr == uintptr(0)) {
		goto __26
	}
	pkgPtr = defaultPtr
__26:
	;

	// Scan through the list of packages already loaded in the target
	// interpreter. If the package we want is already loaded there, then
	// there's nothing for us to do.

	if !(pkgPtr != uintptr(0)) {
		goto __27
	}
	ipFirstPtr = XTcl_GetAssocData(tls, target, ts+44835, uintptr(0))
	ipPtr = ipFirstPtr
__28:
	if !(ipPtr != uintptr(0)) {
		goto __30
	}
	if !((*InterpPackage)(unsafe.Pointer(ipPtr)).FpkgPtr == pkgPtr) {
		goto __31
	}
	code = TCL_OK
	goto done
__31:
	;
	goto __29
__29:
	ipPtr = (*InterpPackage)(unsafe.Pointer(ipPtr)).FnextPtr
	goto __28
	goto __30
__30:
	;
__27:
	;

	if !(pkgPtr == uintptr(0)) {
		goto __32
	}
	// The desired file isn't currently loaded, so load it. It's an error
	// if the desired package is a static one.

	if !(int32(*(*int8)(unsafe.Pointer(fullFileName))) == 0) {
		goto __33
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+44843, libc.VaList(bp+96, packageName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+104, ts+3593, ts+7420, ts+44758, ts+44880,
		uintptr(0)))
	code = TCL_ERROR
	goto done
__33:
	;

	// Figure out the module name if it wasn't provided explicitly.

	if !(packageName != uintptr(0)) {
		goto __34
	}
	XTcl_DStringAppend(tls, bp+296, packageName, -1)
	goto __35
__34:

	// Threading note - this call used to be protected by a mutex.

	retc = XTclGuessPackageName(tls, fullFileName, bp+296)
	if !!(retc != 0) {
		goto __36
	}

	// The platform-specific code couldn't figure out the module
	// name. Make a guess by taking the last element of the file
	// name, stripping off any leading "lib", and then using all
	// of the alphabetic and underline characters that follow
	// that.

	splitPtr = XTcl_FSSplitPath(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+1592)
	XTcl_ListObjIndex(tls, uintptr(0), splitPtr, *(*int32)(unsafe.Pointer(bp + 1592))-1, bp+1600)
	pkgGuess = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 1600 /* pkgGuessPtr */)))
	if !(int32(*(*int8)(unsafe.Pointer(pkgGuess))) == 'l' && int32(*(*int8)(unsafe.Pointer(pkgGuess + 1))) == 'i' &&
		int32(*(*int8)(unsafe.Pointer(pkgGuess + 2))) == 'b') {
		goto __37
	}
	pkgGuess += uintptr(3)
__37:
	;
	p = pkgGuess
__38:
	if !(int32(*(*int8)(unsafe.Pointer(p))) != 0) {
		goto __40
	}
	offset = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(p)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 1608)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(p))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, p, bp+1608)
	}()
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 1608))) > 0x100 ||
		!(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 1608)))))*2)))&int32(X_ISalpha) != 0 ||
			int32(uint8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 1608)))) == '_')) {
		goto __41
	}
	goto __40
__41:
	;
	goto __39
__39:
	p += uintptr(offset)
	goto __38
	goto __40
__40:
	;
	if !(p == pkgGuess) {
		goto __42
	}
__43:
	_objPtr = splitPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __46
	}
	XTclFreeObj(tls, _objPtr)
__46:
	;
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+44890,
		libc.VaList(bp+144, fullFileName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+152, ts+3593, ts+7420, ts+44758,
		ts+44930, uintptr(0)))
	code = TCL_ERROR
	goto done
__42:
	;
	XTcl_DStringAppend(tls, bp+296, pkgGuess, int32((int64(p)-int64(pkgGuess))/1))
__47:
	_objPtr1 = splitPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __50
	}
	XTclFreeObj(tls, _objPtr1)
__50:
	;
	goto __48
__48:
	if 0 != 0 {
		goto __47
	}
	goto __49
__49:
	;
__36:
	;
__35:
	;

	// Fix the capitalization in the package name so that the first
	// character is in caps (or title case) but the others are all
	// lower-case.

	XTcl_DStringSetLength(tls, bp+296,
		XTcl_UtfToTitle(tls, (*Tcl_DString)(unsafe.Pointer(bp+296)).Fstring))

	// Compute the names of the two initialization functions, based on the
	// package name.

	XTclDStringAppendDString(tls, bp+512, bp+296)
	XTcl_DStringAppend(tls, bp+512, ts+44942, int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)))
	XTclDStringAppendDString(tls, bp+728, bp+296)
	XTcl_DStringAppend(tls, bp+728, ts+44948, int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1)))
	XTclDStringAppendDString(tls, bp+944, bp+296)
	XTcl_DStringAppend(tls, bp+944, ts+44958, int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)))
	XTclDStringAppendDString(tls, bp+1160, bp+296)
	XTcl_DStringAppend(tls, bp+1160, ts+44966, int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1)))

	// Call platform-specific code to load the package and find the two
	// initialization functions.

	*(*uintptr)(unsafe.Pointer(bp + 1616)) = (*Tcl_DString)(unsafe.Pointer(bp + 512)).Fstring
	*(*uintptr)(unsafe.Pointer(bp + 1616 + 1*8)) = uintptr(0)

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	code = XTcl_LoadFile(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+1616, flags, bp+1632,
		bp+1640)
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	if !(code != TCL_OK) {
		goto __51
	}
	goto done
__51:
	;

	// Create a new record to describe this package.

	pkgPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(LoadedPackage{})))
	len = uint32(libc.Xstrlen(tls, fullFileName) + uint64(1))
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FfileName = XTcl_Alloc(tls, len)
	libc.Xmemcpy(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FfileName, fullFileName, uint64(len))
	len = uint32((*Tcl_DString)(unsafe.Pointer(bp+296)).Flength) + uint32(1)
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName = XTcl_Alloc(tls, len)
	libc.Xmemcpy(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName, (*Tcl_DString)(unsafe.Pointer(bp+296)).Fstring, uint64(len))
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FloadHandle = *(*Tcl_LoadHandle)(unsafe.Pointer(bp + 1640 /* loadHandle */))
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinitProc = *(*uintptr)(unsafe.Pointer(bp + 1632 /* initProc */))
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInitProc = XTcl_FindSymbol(tls, interp, *(*Tcl_LoadHandle)(unsafe.Pointer(bp + 1640 /* loadHandle */)),
		(*Tcl_DString)(unsafe.Pointer(bp+728)).Fstring)
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FunloadProc = XTcl_FindSymbol(tls, interp, *(*Tcl_LoadHandle)(unsafe.Pointer(bp + 1640 /* loadHandle */)),
		(*Tcl_DString)(unsafe.Pointer(bp+944)).Fstring)
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeUnloadProc = XTcl_FindSymbol(tls, interp, *(*Tcl_LoadHandle)(unsafe.Pointer(bp + 1640 /* loadHandle */)),
		(*Tcl_DString)(unsafe.Pointer(bp+1160)).Fstring)
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinterpRefCount = 0
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInterpRefCount = 0

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FnextPtr = firstPackagePtr
	firstPackagePtr = pkgPtr
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))

	// The Tcl_FindSymbol calls may have left a spurious error message in
	// the interpreter result.

	XTcl_ResetResult(tls, interp)
__32:
	;

	// Invoke the package's initialization function (either the normal one or
	// the safe one, depending on whether or not the interpreter is safe).

	if !(XTcl_IsSafe(tls, target) != 0) {
		goto __52
	}
	if !((*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInitProc == uintptr(0)) {
		goto __54
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+44978, libc.VaList(bp+192, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+200, ts+3593, ts+7420, ts+44758, ts+42715,
		uintptr(0)))
	code = TCL_ERROR
	goto done
__54:
	;
	code = (*struct {
		f func(*libc.TLS, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInitProc})).f(tls, target)
	goto __53
__52:
	if !((*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinitProc == uintptr(0)) {
		goto __55
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+45044,
		libc.VaList(bp+240, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+248, ts+3593, ts+7420, ts+44758, ts+45102,
		uintptr(0)))
	code = TCL_ERROR
	goto done
__55:
	;
	code = (*struct {
		f func(*libc.TLS, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinitProc})).f(tls, target)
__53:
	;

	// Test for whether the initialization failed. If so, transfer the error
	// from the target interpreter to the originating one.

	if !(code != TCL_OK) {
		goto __56
	}
	XTcl_TransferResult(tls, target, code, interp)
	goto done
__56:
	;

	// Record the fact that the package has been loaded in the target
	// interpreter.
	//
	// Update the proper reference count.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	if !(XTcl_IsSafe(tls, target) != 0) {
		goto __57
	}
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInterpRefCount++
	goto __58
__57:
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinterpRefCount++
__58:
	;
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))

	// Refetch ipFirstPtr: loading the package may have introduced additional
	// static packages at the head of the linked list!

	ipFirstPtr = XTcl_GetAssocData(tls, target, ts+44835, uintptr(0))
	ipPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(InterpPackage{})))
	(*InterpPackage)(unsafe.Pointer(ipPtr)).FpkgPtr = pkgPtr
	(*InterpPackage)(unsafe.Pointer(ipPtr)).FnextPtr = ipFirstPtr
	XTcl_SetAssocData(tls, target, ts+44835, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr)
	}{sLoadCleanupProc})), ipPtr)

done:
	XTcl_DStringFree(tls, bp+296)
	XTcl_DStringFree(tls, bp+512)
	XTcl_DStringFree(tls, bp+728)
	XTcl_DStringFree(tls, bp+944)
	XTcl_DStringFree(tls, bp+1160)
	XTcl_DStringFree(tls, bp+1376)
	return code
}

var options15 = [4]uintptr{
	ts + 42089, ts + 45113, ts + 15828, uintptr(0),
} /* tclLoad.c:137:23 */

//----------------------------------------------------------------------
//
// Tcl_UnloadObjCmd --
//
//	This function is invoked to process the "unload" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_UnloadObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclLoad.c:531:1: */
	bp := tls.Alloc(720)
	defer tls.Free(720)

	var target uintptr // Which interpreter to unload from.
	var pkgPtr uintptr
	var defaultPtr uintptr
	// var prefix Tcl_DString at bp+288, 216

	// var tmp Tcl_DString at bp+504, 216

	var unloadProc uintptr
	var ipFirstPtr uintptr
	var ipPtr uintptr
	var i int32
	// var index int32 at bp+280, 4

	var code int32
	var complain int32
	var keepLibrary int32
	var trustedRefCount int32
	var safeRefCount int32
	var fullFileName uintptr
	var packageName uintptr
	var childIntName uintptr
	var namesMatch int32
	var filesMatch int32
	var ipPrevPtr uintptr
	complain = 1
	keepLibrary = 0
	trustedRefCount = -1
	safeRefCount = -1
	fullFileName = ts + 2046 /* "" */

	i = 1
__1:
	if !(i < objc) {
		goto __3
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options16)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+280) != TCL_OK) {
		goto __4
	}
	fullFileName = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	if !(int32(*(*int8)(unsafe.Pointer(fullFileName))) == '-') {
		goto __5
	}
	// It looks like the command contains an option so signal an
	// error

	return TCL_ERROR
	goto __6
__5:
	// This clearly isn't an option; assume it's the filename. We
	// must clear the error.

	XTcl_ResetResult(tls, interp)
	goto __3
__6:
	;
__4:
	;
	switch *(*int32)(unsafe.Pointer(bp + 280 /* index */)) {
	case 0 /* UNLOAD_NOCOMPLAIN */ :
		goto __8
	case 1 /* UNLOAD_KEEPLIB */ :
		goto __9
	case 2 /* UNLOAD_LAST */ :
		goto __10
	}
	goto __7
__8: // -nocomplain
	complain = 0
	goto __7
__9: // -keeplibrary
	keepLibrary = 1
	goto __7
__10: // --
	i++
	goto endOfForLoop
__7:
	;
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;
endOfForLoop:
	if !(objc-i < 1 || objc-i > 3) {
		goto __11
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+45119)
	return TCL_ERROR
__11:
	;
	if !(XTcl_FSConvertToPathType(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) != TCL_OK) {
		goto __12
	}
	return TCL_ERROR
__12:
	;

	fullFileName = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	XTcl_DStringInit(tls, bp+288)
	XTcl_DStringInit(tls, bp+504)

	packageName = uintptr(0)
	if !(objc-i >= 2) {
		goto __13
	}
	packageName = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)))
	if !(int32(*(*int8)(unsafe.Pointer(packageName))) == 0) {
		goto __14
	}
	packageName = uintptr(0)
__14:
	;
__13:
	;
	if !(int32(*(*int8)(unsafe.Pointer(fullFileName))) == 0 && packageName == uintptr(0)) {
		goto __15
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+44712, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+45165, ts+44763,
		uintptr(0)))
	code = TCL_ERROR
	goto done
__15:
	;

	// Figure out which interpreter we're going to load the package into.

	target = interp
	if !(objc-i == 3) {
		goto __16
	}
	childIntName = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+2)*8)))

	target = XTcl_GetSlave(tls, interp, childIntName)
	if !(target == uintptr(0)) {
		goto __17
	}
	return TCL_ERROR
__17:
	;
__16:
	;

	// Scan through the packages that are currently loaded to see if the
	// package we want is already loaded. We'll use a loaded package if it
	// meets any of the following conditions:
	//  - Its name and file match the once we're looking for.
	//  - Its file matches, and we weren't given a name.
	//  - Its name matches, the file name was specified as empty, and there is
	//	  only no statically loaded package with the same name.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&packageMutex)))

	defaultPtr = uintptr(0)
	pkgPtr = firstPackagePtr
__18:
	if !(pkgPtr != uintptr(0)) {
		goto __20
	}

	if !(packageName == uintptr(0)) {
		goto __21
	}
	namesMatch = 0
	goto __22
__21:
	XTcl_DStringSetLength(tls, bp+288, 0)
	XTcl_DStringAppend(tls, bp+288, packageName, -1)
	XTcl_DStringSetLength(tls, bp+504, 0)
	XTcl_DStringAppend(tls, bp+504, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName, -1)
	XTcl_UtfToLower(tls, (*Tcl_DString)(unsafe.Pointer(bp+288)).Fstring)
	XTcl_UtfToLower(tls, (*Tcl_DString)(unsafe.Pointer(bp+504)).Fstring)
	if !(libc.Xstrcmp(tls, (*Tcl_DString)(unsafe.Pointer(bp+504)).Fstring,
		(*Tcl_DString)(unsafe.Pointer(bp+288)).Fstring) == 0) {
		goto __23
	}
	namesMatch = 1
	goto __24
__23:
	namesMatch = 0
__24:
	;
__22:
	;
	XTcl_DStringSetLength(tls, bp+288, 0)

	filesMatch = libc.Bool32(libc.Xstrcmp(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FfileName, fullFileName) == 0)
	if !(filesMatch != 0 && (namesMatch != 0 || packageName == uintptr(0))) {
		goto __25
	}
	goto __20
__25:
	;
	if !(namesMatch != 0 && int32(*(*int8)(unsafe.Pointer(fullFileName))) == 0) {
		goto __26
	}
	defaultPtr = pkgPtr
__26:
	;
	if !(filesMatch != 0 && !(namesMatch != 0) && int32(*(*int8)(unsafe.Pointer(fullFileName))) != 0) {
		goto __27
	}
	goto __20
__27:
	;
	goto __19
__19:
	pkgPtr = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FnextPtr
	goto __18
	goto __20
__20:
	;
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	if !(int32(*(*int8)(unsafe.Pointer(fullFileName))) == 0) {
		goto __28
	}
	// It's an error to try unload a static package.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+45172,
		libc.VaList(bp+40, packageName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+7420, ts+45165, ts+45229,
		uintptr(0)))
	code = TCL_ERROR
	goto done
__28:
	;
	if !(pkgPtr == uintptr(0)) {
		goto __29
	}
	// The DLL pointed by the provided filename has never been loaded.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+45236, libc.VaList(bp+88, fullFileName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+7420, ts+45165, ts+45268,
		uintptr(0)))
	code = TCL_ERROR
	goto done
__29:
	;

	// Scan through the list of packages already loaded in the target
	// interpreter. If the package we want is already loaded there, then we
	// should proceed with unloading.

	code = TCL_ERROR
	if !(pkgPtr != uintptr(0)) {
		goto __30
	}
	ipFirstPtr = XTcl_GetAssocData(tls, target, ts+44835, uintptr(0))
	ipPtr = ipFirstPtr
__31:
	if !(ipPtr != uintptr(0)) {
		goto __33
	}
	if !((*InterpPackage)(unsafe.Pointer(ipPtr)).FpkgPtr == pkgPtr) {
		goto __34
	}
	code = TCL_OK
	goto __33
__34:
	;
	goto __32
__32:
	ipPtr = (*InterpPackage)(unsafe.Pointer(ipPtr)).FnextPtr
	goto __31
	goto __33
__33:
	;
__30:
	;
	if !(code != TCL_OK) {
		goto __35
	}
	// The package has not been loaded in this interpreter.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+45280,
		libc.VaList(bp+136, fullFileName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+144, ts+3593, ts+7420, ts+45165, ts+45268,
		uintptr(0)))
	code = TCL_ERROR
	goto done
__35:
	;

	// Ensure that the DLL can be unloaded. If it is a trusted interpreter,
	// pkgPtr->unloadProc must not be NULL for the DLL to be unloadable. If
	// the interpreter is a safe one, pkgPtr->safeUnloadProc must be non-NULL.

	if !(XTcl_IsSafe(tls, target) != 0) {
		goto __36
	}
	if !((*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeUnloadProc == uintptr(0)) {
		goto __38
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+45332,
		libc.VaList(bp+184, fullFileName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+192, ts+3593, ts+7420, ts+45165, ts+45386,
		uintptr(0)))
	code = TCL_ERROR
	goto done
__38:
	;
	unloadProc = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeUnloadProc
	goto __37
__36:
	if !((*LoadedPackage)(unsafe.Pointer(pkgPtr)).FunloadProc == uintptr(0)) {
		goto __39
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+45393,
		libc.VaList(bp+232, fullFileName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+240, ts+3593, ts+7420, ts+45165, ts+45386,
		uintptr(0)))
	code = TCL_ERROR
	goto done
__39:
	;
	unloadProc = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FunloadProc
__37:
	;

	// We are ready to unload the package. First, evaluate the unload
	// function. If this fails, we cannot proceed with unload. Also, we must
	// specify the proper flag to pass to the unload callback.
	// TCL_UNLOAD_DETACH_FROM_INTERPRETER is defined when the callback should
	// only remove itself from the interpreter; the library will be unloaded
	// in a future call of unload. In case the library will be unloaded just
	// after the callback returns, TCL_UNLOAD_DETACH_FROM_PROCESS is passed.

	code = int32(1) << 0
	if !!(keepLibrary != 0) {
		goto __40
	}
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	trustedRefCount = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinterpRefCount
	safeRefCount = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInterpRefCount
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))

	if !(XTcl_IsSafe(tls, target) != 0) {
		goto __41
	}
	safeRefCount--
	goto __42
__41:
	trustedRefCount--
__42:
	;

	if !(safeRefCount <= 0 && trustedRefCount <= 0) {
		goto __43
	}
	code = int32(1) << 1
__43:
	;
__40:
	;
	code = (*struct {
		f func(*libc.TLS, uintptr, int32) int32
	})(unsafe.Pointer(&struct{ uintptr }{unloadProc})).f(tls, target, code)
	if !(code != TCL_OK) {
		goto __44
	}
	XTcl_TransferResult(tls, target, code, interp)
	goto done
__44:
	;

	// The unload function executed fine. Examine the reference count to see
	// if we unload the DLL.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	if !(XTcl_IsSafe(tls, target) != 0) {
		goto __45
	}
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInterpRefCount--

	// Do not let counter get negative.

	if !((*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInterpRefCount < 0) {
		goto __47
	}
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInterpRefCount = 0
__47:
	;
	goto __46
__45:
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinterpRefCount--

	// Do not let counter get negative.

	if !((*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinterpRefCount < 0) {
		goto __48
	}
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinterpRefCount = 0
__48:
	;
__46:
	;
	trustedRefCount = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinterpRefCount
	safeRefCount = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInterpRefCount
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))

	code = TCL_OK
	if !((*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInterpRefCount <= 0 && (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinterpRefCount <= 0 &&
		!(keepLibrary != 0)) {
		goto __49
	}
	// Unload the shared library from the application memory...

	// Some Unix dlls are poorly behaved - registering things like atexit
	// calls that can't be unregistered. If you unload such dlls, you get
	// a core on exit because it wants to call a function in the dll after
	// it's been unloaded.

	if !(int32(*(*int8)(unsafe.Pointer((*LoadedPackage)(unsafe.Pointer(pkgPtr)).FfileName))) != 0) {
		goto __50
	}
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	if !(XTcl_FSUnloadFile(tls, interp, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FloadHandle) == TCL_OK) {
		goto __51
	}
	// Remove this library from the loaded library cache.

	defaultPtr = pkgPtr
	if !(defaultPtr == firstPackagePtr) {
		goto __53
	}
	firstPackagePtr = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FnextPtr
	goto __54
__53:
	pkgPtr = firstPackagePtr
__55:
	if !(pkgPtr != uintptr(0)) {
		goto __57
	}
	if !((*LoadedPackage)(unsafe.Pointer(pkgPtr)).FnextPtr == defaultPtr) {
		goto __58
	}
	(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FnextPtr = (*LoadedPackage)(unsafe.Pointer(defaultPtr)).FnextPtr
	goto __57
__58:
	;
	goto __56
__56:
	pkgPtr = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FnextPtr
	goto __55
	goto __57
__57:
	;
__54:
	;

	// Remove this library from the interpreter's library cache.

	ipFirstPtr = XTcl_GetAssocData(tls, target, ts+44835, uintptr(0))
	ipPtr = ipFirstPtr
	if !((*InterpPackage)(unsafe.Pointer(ipPtr)).FpkgPtr == defaultPtr) {
		goto __59
	}
	ipFirstPtr = (*InterpPackage)(unsafe.Pointer(ipFirstPtr)).FnextPtr
	goto __60
__59:

	ipPrevPtr = ipPtr
__61:
	if !(ipPtr != uintptr(0)) {
		goto __63
	}
	if !((*InterpPackage)(unsafe.Pointer(ipPtr)).FpkgPtr == defaultPtr) {
		goto __64
	}
	(*InterpPackage)(unsafe.Pointer(ipPrevPtr)).FnextPtr = (*InterpPackage)(unsafe.Pointer(ipPtr)).FnextPtr
	goto __63
__64:
	;
	goto __62
__62:
	ipPrevPtr = ipPtr
	ipPtr = (*InterpPackage)(unsafe.Pointer(ipPtr)).FnextPtr
	goto __61
	goto __63
__63:
	;
__60:
	;
	XTcl_SetAssocData(tls, target, ts+44835, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr)
	}{sLoadCleanupProc})),
		ipFirstPtr)
	XTclpFree(tls, (*LoadedPackage)(unsafe.Pointer(defaultPtr)).FfileName)
	XTclpFree(tls, (*LoadedPackage)(unsafe.Pointer(defaultPtr)).FpackageName)
	XTclpFree(tls, defaultPtr)
	XTclpFree(tls, ipPtr)
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	goto __52
__51:
	code = TCL_ERROR
__52:
	;
__50:
	;
__49:
	;

done:
	XTcl_DStringFree(tls, bp+288)
	XTcl_DStringFree(tls, bp+504)
	if !(!(complain != 0) && code != TCL_OK) {
		goto __65
	}
	code = TCL_OK
	XTcl_ResetResult(tls, interp)
__65:
	;
	return code
}

var options16 = [4]uintptr{
	ts + 19302, ts + 45450, ts + 15828, uintptr(0),
} /* tclLoad.c:546:23 */

//----------------------------------------------------------------------
//
// Tcl_StaticPackage --
//
//	This function is invoked to indicate that a particular package has
//	been linked statically with an application.
//
// Results:
//	None.
//
// Side effects:
//	Once this function completes, the package becomes loadable via the
//	"load" command with an empty file name.
//
//----------------------------------------------------------------------

func XTcl_StaticPackage(tls *libc.TLS, interp uintptr, prefix uintptr, initProc uintptr, safeInitProc uintptr) { /* tclLoad.c:930:1: */
	var pkgPtr uintptr
	var ipPtr uintptr
	var ipFirstPtr uintptr

	// Check to see if someone else has already reported this package as
	// statically loaded in the process.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	for pkgPtr = firstPackagePtr; pkgPtr != uintptr(0); pkgPtr = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FnextPtr {
		if (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinitProc == initProc &&
			(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInitProc == safeInitProc &&
			libc.Xstrcmp(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName, prefix) == 0 {
			break
		}
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))

	// If the package is not yet recorded as being loaded statically, add it
	// to the list now.

	if pkgPtr == uintptr(0) {
		pkgPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(LoadedPackage{})))
		(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FfileName = XTcl_Alloc(tls, uint32(1))
		*(*int8)(unsafe.Pointer((*LoadedPackage)(unsafe.Pointer(pkgPtr)).FfileName)) = int8(0)
		(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName = XTcl_Alloc(tls, uint32(libc.Xstrlen(tls, prefix)+uint64(1)))
		libc.Xstrcpy(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName, prefix)
		(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FloadHandle = uintptr(0)
		(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FinitProc = initProc
		(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FsafeInitProc = safeInitProc
		XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&packageMutex)))
		(*LoadedPackage)(unsafe.Pointer(pkgPtr)).FnextPtr = firstPackagePtr
		firstPackagePtr = pkgPtr
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))
	}

	if interp != uintptr(0) {

		// If we're loading the package into an interpreter, determine whether
		// it's already loaded.

		ipFirstPtr = XTcl_GetAssocData(tls, interp, ts+44835, uintptr(0))
		for ipPtr = ipFirstPtr; ipPtr != uintptr(0); ipPtr = (*InterpPackage)(unsafe.Pointer(ipPtr)).FnextPtr {
			if (*InterpPackage)(unsafe.Pointer(ipPtr)).FpkgPtr == pkgPtr {
				return
			}
		}

		// Package isn't loade in the current interp yet. Mark it as now being
		// loaded.

		ipPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(InterpPackage{})))
		(*InterpPackage)(unsafe.Pointer(ipPtr)).FpkgPtr = pkgPtr
		(*InterpPackage)(unsafe.Pointer(ipPtr)).FnextPtr = ipFirstPtr
		XTcl_SetAssocData(tls, interp, ts+44835, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr)
		}{sLoadCleanupProc})), ipPtr)
	}
}

//----------------------------------------------------------------------
//
// TclGetLoadedPackages --
//
//	This function returns information about all of the files that are
//	loaded (either in a particular intepreter, or for all interpreters).
//
// Results:
//	The return value is a standard Tcl completion code. If successful, a
//	list of lists is placed in the interp's result. Each sublist
//	corresponds to one loaded file; its first element is the name of the
//	file (or an empty string for something that's statically loaded) and
//	the second element is the name of the package in that file.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetLoadedPackages(tls *libc.TLS, interp uintptr, targetName uintptr) int32 { /* tclLoad.c:1034:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var target uintptr
	var pkgPtr uintptr
	var ipPtr uintptr
	var resultObj uintptr
	// var pkgDesc [2]uintptr at bp, 16

	if targetName == uintptr(0) {
		// Return information about all of the available packages.

		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				resultObj = XTclThreadAllocObj(tls)
			} else {
				resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)
		{
		}

		XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&packageMutex)))
		for pkgPtr = firstPackagePtr; pkgPtr != uintptr(0); pkgPtr = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FnextPtr {
			*(*uintptr)(unsafe.Pointer(bp)) = XTcl_NewStringObj(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FfileName, -1)
			*(*uintptr)(unsafe.Pointer(bp + 1*8)) = XTcl_NewStringObj(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName, -1)
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj,
				XTcl_NewListObj(tls, 2, bp))
		}
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&packageMutex)))
		XTcl_SetObjResult(tls, interp, resultObj)
		return TCL_OK
	}

	// Return information about only the packages that are loaded in a given
	// interpreter.

	target = XTcl_GetSlave(tls, interp, targetName)
	if target == uintptr(0) {
		return TCL_ERROR
	}
	ipPtr = XTcl_GetAssocData(tls, target, ts+44835, uintptr(0))
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultObj = XTclThreadAllocObj(tls)
		} else {
			resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)
	{
	}

	for ; ipPtr != uintptr(0); ipPtr = (*InterpPackage)(unsafe.Pointer(ipPtr)).FnextPtr {
		pkgPtr = (*InterpPackage)(unsafe.Pointer(ipPtr)).FpkgPtr
		*(*uintptr)(unsafe.Pointer(bp)) = XTcl_NewStringObj(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FfileName, -1)
		*(*uintptr)(unsafe.Pointer(bp + 1*8)) = XTcl_NewStringObj(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName, -1)
		XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, XTcl_NewListObj(tls, 2, bp))
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// LoadCleanupProc --
//
//	This function is called to delete all of the InterpPackage structures
//	for an interpreter when the interpreter is deleted. It gets invoked
//	via the Tcl AssocData mechanism.
//
// Results:
//	None.
//
// Side effects:
//	Storage for all of the InterpPackage functions for interp get deleted.
//
//----------------------------------------------------------------------

func sLoadCleanupProc(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclLoad.c:1106:1: */
	var ipPtr uintptr
	var nextPtr uintptr

	ipPtr = clientData
	for ipPtr != uintptr(0) {
		nextPtr = (*InterpPackage)(unsafe.Pointer(ipPtr)).FnextPtr
		XTclpFree(tls, ipPtr)
		ipPtr = nextPtr
	}
}

//----------------------------------------------------------------------
//
// TclFinalizeLoad --
//
//	This function is invoked just before the application exits. It frees
//	all of the LoadedPackage structures.
//
// Results:
//	None.
//
// Side effects:
//	Memory is freed.
//
//----------------------------------------------------------------------

func XTclFinalizeLoad(tls *libc.TLS) { /* tclLoad.c:1139:1: */
	var pkgPtr uintptr

	// No synchronization here because there should just be one thread alive
	// at this point. Logically, packageMutex should be grabbed at this point,
	// but the Mutexes get finalized before the call to this routine. The only
	// subsystem left alive at this point is the memory allocator.

	for firstPackagePtr != uintptr(0) {
		pkgPtr = firstPackagePtr
		firstPackagePtr = (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FnextPtr

		// Some Unix dlls are poorly behaved - registering things like atexit
		// calls that can't be unregistered. If you unload such dlls, you get
		// a core on exit because it wants to call a function in the dll after
		// it has been unloaded.

		if int32(*(*int8)(unsafe.Pointer((*LoadedPackage)(unsafe.Pointer(pkgPtr)).FfileName))) != 0 {
			XTcl_FSUnloadFile(tls, uintptr(0), (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FloadHandle)
		}

		XTclpFree(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FfileName)
		XTclpFree(tls, (*LoadedPackage)(unsafe.Pointer(pkgPtr)).FpackageName)
		XTclpFree(tls, pkgPtr)
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------------
//
// TclpDlopen --
//
//	This procedure is called to carry out dynamic loading of binary code;
//	it is intended for use only on systems that don't support dynamic
//	loading (it returns an error).
//
// Results:
//	The result is TCL_ERROR, and an error message is left in the interp's
//	result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpDlopen(tls *libc.TLS, interp uintptr, pathPtr uintptr, loadHandle uintptr, unloadProcPtr uintptr, flags int32) int32 { /* tclLoadNone.c:35:1: */
	if interp != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+45463,
			-1))
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclGuessPackageName --
//
//	If the "load" command is invoked without providing a package name,
//	this procedure is invoked to try to figure it out.
//
// Results:
//	Always returns 0 to indicate that we couldn't figure out a package
//	name; generic code will then try to guess the package from the file
//	name. A return value of 1 would have meant that we figured out the
//	package name and put it in bufPtr.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGuessPackageName(tls *libc.TLS, fileName uintptr, bufPtr uintptr) int32 { /* tclLoadNone.c:77:1: */
	return 0
}

// These functions are fallbacks if we somehow determine that the platform can
// do loading from memory but the user wishes to disable it. They just report
// (gracefully) that they fail.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The default prompt used when the user has not overridden it.

// This file can be compiled on Windows in UNICODE mode, as well as on all
// other platforms using the native encoding. This is done by using the normal
// Windows functions like _tcscmp, but on platforms which don't have <tchar.h>
// we have to translate that to strcmp here.

func sNewNativeObj(tls *libc.TLS, string uintptr) uintptr { /* tclMain.c:46:23: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	// var ds Tcl_DString at bp, 216

	XTcl_ExternalToUtfDString(tls, uintptr(0), string, -1, bp)
	return XTclDStringToObj(tls, bp)
}

// Declarations for various library functions and variables (don't want to
// include tclPort.h here, because people might copy this file out of the Tcl
// source directory to make their own modified versions).

// The thread-local variables for this file's functions.

type ThreadSpecificData7 = struct {
	Fpath         uintptr
	Fencoding     uintptr
	FmainLoopProc uintptr
} /* tclMain.c:84:3 */

// Structure definition for information used to keep the state of an
// interactive command processor that reads lines from standard input and
// writes prompts and results to standard output.

type PromptType = uint32 /* tclMain.c:96:3 */

type InteractiveState1 = struct {
	Finput       Tcl_Channel
	Ftty         int32
	F__ccgo_pad1 [4]byte
	FcommandPtr  uintptr
	Fprompt      PromptType
	F__ccgo_pad2 [4]byte
	Finterp      uintptr
} /* tclMain.c:98:9 */

type InteractiveState = InteractiveState1 /* tclMain.c:109:3 */

var dataKey6 Tcl_ThreadDataKey /* tclMain.c:121:26: */

//----------------------------------------------------------------------
//
// Tcl_SetStartupScript --
//
//	Sets the path and encoding of the startup script to be evaluated by
//	Tcl_Main, used to override the command line processing.
//
// Results:
//	None.
//
// Side effects:
//
//----------------------------------------------------------------------

func XTcl_SetStartupScript(tls *libc.TLS, path uintptr, encoding uintptr) { /* tclMain.c:140:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey6)), int32(unsafe.Sizeof(ThreadSpecificData7{})))
	var newEncoding uintptr = uintptr(0)

	if encoding != uintptr(0) {
		newEncoding = XTcl_NewStringObj(tls, encoding, -1)
	}

	if (*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fpath != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fpath
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	(*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fpath = path
	if (*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fpath != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fpath)).FrefCount++
	}

	if (*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fencoding != uintptr(0) {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fencoding
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	(*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fencoding = newEncoding
	if (*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fencoding != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer((*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fencoding)).FrefCount++
	}
}

//----------------------------------------------------------------------
//
// Tcl_GetStartupScript --
//
//	Gets the path and encoding of the startup script to be evaluated by
//	Tcl_Main.
//
// Results:
//	The path of the startup script; NULL if none has been set.
//
// Side effects:
//	If encodingPtr is not NULL, stores a (const char *) in it pointing to
//	the encoding name registered for the startup script. Tcl retains
//	ownership of the string, and may free it. Caller should make a copy
//	for long-term use.
//
//----------------------------------------------------------------------

func XTcl_GetStartupScript(tls *libc.TLS, encodingPtr uintptr) uintptr { /* tclMain.c:188:9: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey6)), int32(unsafe.Sizeof(ThreadSpecificData7{})))

	if encodingPtr != uintptr(0) {
		if (*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fencoding == uintptr(0) {
			*(*uintptr)(unsafe.Pointer(encodingPtr)) = uintptr(0)
		} else {
			*(*uintptr)(unsafe.Pointer(encodingPtr)) = XTcl_GetString(tls, (*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fencoding)
		}
	}
	return (*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).Fpath
}

// ----------------------------------------------------------------------
//
// Tcl_SourceRCFile --
//
//	This function is typically invoked by Tcl_Main of Tk_Main function to
//	source an application specific rc file into the interpreter at startup
//	time.
//
// Results:
//	None.
//
// Side effects:
//	Depends on what's in the rc script.
//
//----------------------------------------------------------------------

func XTcl_SourceRCFile(tls *libc.TLS, interp uintptr) { /* tclMain.c:225:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	// var temp Tcl_DString at bp, 216

	var fileName uintptr
	var chan1 Tcl_Channel

	fileName = XTcl_GetVar2(tls, interp, ts+45521, uintptr(0), TCL_GLOBAL_ONLY)
	if fileName != uintptr(0) {
		var c Tcl_Channel
		var fullName uintptr

		XTcl_DStringInit(tls, bp)
		fullName = XTcl_TranslateFileName(tls, interp, fileName, bp)
		if fullName == uintptr(0) {
			// Couldn't translate the file name (e.g. it referred to a bogus
			// user or there was no HOME environment variable). Just do
			// nothing.
		} else {
			// Test for the existence of the rc file before trying to read it.

			c = XTcl_OpenFileChannel(tls, uintptr(0), fullName, ts+22782, 0)
			if c != uintptr(0) {
				XTcl_Close(tls, uintptr(0), c)
				if XTcl_EvalFile(tls, interp, fullName) != TCL_OK {
					chan1 = XTcl_GetStdChannel(tls, int32(1)<<3)
					if chan1 != 0 {
						XTcl_WriteObj(tls, chan1, XTcl_GetObjResult(tls, interp))
						XTcl_WriteChars(tls, chan1, ts+350, 1)
					}
				}
			}
		}
		XTcl_DStringFree(tls, bp)
	}
}

// ----------------------------------------------------------------------
//
// Tcl_Main, Tcl_MainEx --
//
//	Main program for tclsh and most other Tcl-based applications.
//
// Results:
//	None. This function never returns (it exits the process when it's
//	done).
//
// Side effects:
//	This function initializes the Tcl world and then starts interpreting
//	commands; almost anything could happen, depending on the script being
//	interpreted.
//
//----------------------------------------------------------------------

func XTcl_MainEx(tls *libc.TLS, argc int32, argv uintptr, appInitProc uintptr, interp uintptr) { /* tclMain.c:286:1: */
	bp := tls.Alloc(68)
	defer tls.Free(68)

	var path uintptr
	var resultPtr uintptr
	var argvPtr uintptr
	var appName uintptr
	// var encodingName uintptr at bp+8, 8

	var code int32
	var exitCode int32
	var mainLoopProc uintptr
	var chan1 Tcl_Channel
	// var is InteractiveState at bp+24, 40

	var cachePtr uintptr
	var _objPtr uintptr
	var value uintptr
	var cachePtr1 uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var options uintptr
	var keyPtr uintptr
	// var valuePtr uintptr at bp+16, 8

	var _objPtr3 uintptr
	var _objPtr4 uintptr
	var _objPtr5 uintptr
	var cachePtr2 uintptr
	var _objPtr6 uintptr
	// var length int32 at bp+64, 4

	var _objPtr7 uintptr
	var _objPtr8 uintptr
	var cmd uintptr
	*(*uintptr)(unsafe.Pointer(bp + 8 /* encodingName */)) = uintptr(0)
	exitCode = 0

	XTclpSetInitialEncodings(tls)
	XTclpFindExecutable(tls, *(*uintptr)(unsafe.Pointer(argv)))

	(*InteractiveState)(unsafe.Pointer(bp + 24 /* &is */)).Finterp = interp
	(*InteractiveState)(unsafe.Pointer(bp + 24 /* &is */)).Fprompt = PROMPT_START
__1:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __4
	}
	(*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr = XTclThreadAllocObj(tls)
	goto __5
__4:
	(*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp+24)).FcommandPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__5:
	;
	goto __2
__2:
	if 0 != 0 {
		goto __1
	}
	goto __3
__3:
	;
	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr)).FtypePtr = uintptr(0)

	// If the application has not already set a startup script, parse the
	// first few command line arguments to determine the script path and
	// encoding.

	if !(uintptr(0) == XTcl_GetStartupScript(tls, uintptr(0))) {
		goto __6
	}
	// Check whether first 3 args (argv[1] - argv[3]) look like
	//  -encoding ENCODING FILENAME
	// or like
	//  FILENAME

	if !(argc > 3 && 0 == libc.Xstrcmp(tls, ts+15934, *(*uintptr)(unsafe.Pointer(argv + 1*8))) &&
		'-' != int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 3*8)))))) {
		goto __7
	}
	value = sNewNativeObj(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))
	XTcl_SetStartupScript(tls, sNewNativeObj(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))),
		XTcl_GetString(tls, value))
__9:
	_objPtr = value
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __12
	}
	XTclFreeObj(tls, _objPtr)
__12:
	;
	goto __10
__10:
	if 0 != 0 {
		goto __9
	}
	goto __11
__11:
	;
	argc = argc - 3
	argv += 8 * uintptr(3)
	goto __8
__7:
	if !(argc > 1 && '-' != int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 1*8)))))) {
		goto __13
	}
	XTcl_SetStartupScript(tls, sNewNativeObj(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))), uintptr(0))
	argc--
	argv += 8
__13:
	;
__8:
	;
__6:
	;

	path = XTcl_GetStartupScript(tls, bp+8)
	if !(path == uintptr(0)) {
		goto __14
	}
	appName = sNewNativeObj(tls, *(*uintptr)(unsafe.Pointer(argv)))
	goto __15
__14:
	appName = path
__15:
	;
	XTcl_SetVar2Ex(tls, interp, ts+45536, uintptr(0), appName, TCL_GLOBAL_ONLY)
	argc--
	argv += 8

	XTcl_SetVar2Ex(tls, interp, ts+45542, uintptr(0), XTcl_NewIntObj(tls, argc), TCL_GLOBAL_ONLY)

	argvPtr = XTcl_NewListObj(tls, 0, uintptr(0))
__16:
	if !(libc.PostDecInt32(&argc, 1) != 0) {
		goto __17
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), argvPtr, sNewNativeObj(tls, *(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&argv, 8)))))
	goto __16
__17:
	;
	XTcl_SetVar2Ex(tls, interp, ts+45547, uintptr(0), argvPtr, TCL_GLOBAL_ONLY)

	// Set the "tcl_interactive" variable.

	(*InteractiveState)(unsafe.Pointer(bp + 24 /* &is */)).Ftty = libc.Xisatty(tls, 0)
	XTcl_SetVar2Ex(tls, interp, ts+42384, uintptr(0),
		XTcl_NewIntObj(tls, libc.Bool32(!(path != 0) && (*InteractiveState)(unsafe.Pointer(bp+24)).Ftty != 0)), TCL_GLOBAL_ONLY)

	// Invoke application-specific initialization.

	XTcl_Preserve(tls, interp)
	if !((*struct {
		f func(*libc.TLS, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{appInitProc})).f(tls, interp) != TCL_OK) {
		goto __18
	}
	chan1 = XTcl_GetStdChannel(tls, int32(1)<<3)
	if !(chan1 != 0) {
		goto __19
	}
	XTcl_WriteChars(tls, chan1,
		ts+45552, -1)
	XTcl_WriteObj(tls, chan1, XTcl_GetObjResult(tls, interp))
	XTcl_WriteChars(tls, chan1, ts+350, 1)
__19:
	;
__18:
	;
	if !(XTcl_InterpDeleted(tls, interp) != 0) {
		goto __20
	}
	goto done
__20:
	;
	if !(XTcl_LimitExceeded(tls, interp) != 0) {
		goto __21
	}
	goto done
__21:
	;
	if !(XTclFullFinalizationRequested(tls) != 0) {
		goto __22
	}
	// Arrange for final deletion of the main interp

	// ARGH Munchhausen effect
	XTcl_CreateExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFreeMainInterp})), interp)
__22:
	;

	// Invoke the script specified on the command line, if any. Must fetch it
	// again, as the appInitProc might have reset it.

	path = XTcl_GetStartupScript(tls, bp+8)
	if !(path != uintptr(0)) {
		goto __23
	}
	XTcl_ResetResult(tls, interp)
	code = XTcl_FSEvalFileEx(tls, interp, path, *(*uintptr)(unsafe.Pointer(bp + 8 /* encodingName */)))
	if !(code != TCL_OK) {
		goto __24
	}
	chan1 = XTcl_GetStdChannel(tls, int32(1)<<3)
	if !(chan1 != 0) {
		goto __25
	}
	options = XTcl_GetReturnOptions(tls, interp, code)

__26:
	;
__29:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __32
	}
	keyPtr = XTclThreadAllocObj(tls)
	goto __33
__32:
	keyPtr = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(keyPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__33:
	;
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)) == 0) {
		goto __34
	}
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = 0
	goto __35
__34:
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes, ts+12034, uint64(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes + 10)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).Flength = int32(uint64(unsafe.Sizeof([11]int8{})) - uint64(1))
__35:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr = uintptr(0)

	goto __27
__27:
	if 0 != 0 {
		goto __26
	}
	goto __28
__28:
	;
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount++
	XTcl_DictObjGet(tls, uintptr(0), options, keyPtr, bp+16)
__36:
	_objPtr1 = keyPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __39
	}
	XTclFreeObj(tls, _objPtr1)
__39:
	;
	goto __37
__37:
	if 0 != 0 {
		goto __36
	}
	goto __38
__38:
	;

	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
		goto __40
	}
	XTcl_WriteObj(tls, chan1, *(*uintptr)(unsafe.Pointer(bp + 16 /* valuePtr */)))
__40:
	;
	XTcl_WriteChars(tls, chan1, ts+350, 1)
__41:
	_objPtr2 = options
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __44
	}
	XTclFreeObj(tls, _objPtr2)
__44:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
__25:
	;
	exitCode = 1
__24:
	;
	goto done
__23:
	;

	// We're running interactively. Source a user-specific startup file if the
	// application specified one and if the file exists.

	XTcl_SourceRCFile(tls, interp)
	if !(XTcl_LimitExceeded(tls, interp) != 0) {
		goto __45
	}
	goto done
__45:
	;

	// Process commands from stdin until there's an end-of-file. Note that we
	// need to fetch the standard channels again after every eval, since they
	// may have been changed.

	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp+24)).FcommandPtr)).FrefCount++

	// Get a new value for tty if anyone writes to ::tcl_interactive

	XTcl_LinkVar(tls, interp, ts+42384, bp+24+8, TCL_LINK_BOOLEAN)
	(*InteractiveState)(unsafe.Pointer(bp + 24 /* &is */)).Finput = XTcl_GetStdChannel(tls, int32(1)<<1)
__46:
	if !((*InteractiveState)(unsafe.Pointer(bp+24)).Finput != uintptr(0) && !(XTcl_InterpDeleted(tls, interp) != 0)) {
		goto __47
	}
	mainLoopProc = XTclGetMainLoop(tls)
	if !(mainLoopProc == uintptr(0)) {
		goto __48
	}

	if !((*InteractiveState)(unsafe.Pointer(bp+24)).Ftty != 0) {
		goto __50
	}
	sPrompt(tls, interp, bp+24)
	if !(XTcl_InterpDeleted(tls, interp) != 0) {
		goto __51
	}
	goto __47
__51:
	;
	if !(XTcl_LimitExceeded(tls, interp) != 0) {
		goto __52
	}
	goto __47
__52:
	;
	(*InteractiveState)(unsafe.Pointer(bp + 24 /* &is */)).Finput = XTcl_GetStdChannel(tls, int32(1)<<1)
	if !((*InteractiveState)(unsafe.Pointer(bp+24)).Finput == uintptr(0)) {
		goto __53
	}
	goto __47
__53:
	;
__50:
	;
	if !((*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp+24)).FcommandPtr)).FrefCount > 1) {
		goto __54
	}
__55:
	_objPtr3 = (*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __58
	}
	XTclFreeObj(tls, _objPtr3)
__58:
	;
	goto __56
__56:
	if 0 != 0 {
		goto __55
	}
	goto __57
__57:
	;
	(*InteractiveState)(unsafe.Pointer(bp + 24 /* &is */)).FcommandPtr = XTcl_DuplicateObj(tls, (*InteractiveState)(unsafe.Pointer(bp+24 /* &is */)).FcommandPtr)
	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp+24)).FcommandPtr)).FrefCount++
__54:
	;
	*(*int32)(unsafe.Pointer(bp + 64 /* length */)) = XTcl_GetsObj(tls, (*InteractiveState)(unsafe.Pointer(bp+24 /* &is */)).Finput, (*InteractiveState)(unsafe.Pointer(bp+24 /* &is */)).FcommandPtr)
	if !(*(*int32)(unsafe.Pointer(bp + 64)) < 0) {
		goto __59
	}
	if !(XTcl_InputBlocked(tls, (*InteractiveState)(unsafe.Pointer(bp+24)).Finput) != 0) {
		goto __60
	}
	// This can only happen if stdin has been set to
	// non-blocking. In that case cycle back and try again.
	// This sets up a tight polling loop (since we have no
	// event loop running). If this causes bad CPU hogging, we
	// might try toggling the blocking on stdin instead.

	goto __46
__60:
	;

	// Either EOF, or an error on stdin; we're done

	goto __47
__59:
	;

	// Add the newline removed by Tcl_GetsObj back to the string. Have
	// to add it back before testing completeness, because it can make
	// a difference. [Bug 1775878]

	if !((*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp+24)).FcommandPtr)).FrefCount > 1) {
		goto __61
	}
__62:
	_objPtr4 = (*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __65
	}
	XTclFreeObj(tls, _objPtr4)
__65:
	;
	goto __63
__63:
	if 0 != 0 {
		goto __62
	}
	goto __64
__64:
	;
	(*InteractiveState)(unsafe.Pointer(bp + 24 /* &is */)).FcommandPtr = XTcl_DuplicateObj(tls, (*InteractiveState)(unsafe.Pointer(bp+24 /* &is */)).FcommandPtr)
	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp+24)).FcommandPtr)).FrefCount++
__61:
	;
	XTcl_AppendToObj(tls, (*InteractiveState)(unsafe.Pointer(bp+24 /* &is */)).FcommandPtr, ts+350, 1)
	if !!(XTclObjCommandComplete(tls, (*InteractiveState)(unsafe.Pointer(bp+24)).FcommandPtr) != 0) {
		goto __66
	}
	(*InteractiveState)(unsafe.Pointer(bp + 24 /* &is */)).Fprompt = PROMPT_CONTINUE
	goto __46
__66:
	;

	(*InteractiveState)(unsafe.Pointer(bp + 24 /* &is */)).Fprompt = PROMPT_START

	// The final newline is syntactically redundant, and causes some
	// error messages troubles deeper in, so lop it back off.

	XTcl_GetStringFromObj(tls, (*InteractiveState)(unsafe.Pointer(bp+24 /* &is */)).FcommandPtr, bp+64)
	XTcl_SetObjLength(tls, (*InteractiveState)(unsafe.Pointer(bp+24 /* &is */)).FcommandPtr, libc.PreDecInt32(&*(*int32)(unsafe.Pointer(bp + 64 /* length */)), 1))
	code = XTcl_RecordAndEvalObj(tls, interp, (*InteractiveState)(unsafe.Pointer(bp+24 /* &is */)).FcommandPtr,
		TCL_EVAL_GLOBAL)
	(*InteractiveState)(unsafe.Pointer(bp + 24 /* &is */)).Finput = XTcl_GetStdChannel(tls, int32(1)<<1)
__67:
	_objPtr5 = (*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __70
	}
	XTclFreeObj(tls, _objPtr5)
__70:
	;
	goto __68
__68:
	if 0 != 0 {
		goto __67
	}
	goto __69
__69:
	;
__71:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __74
	}
	(*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr = XTclThreadAllocObj(tls)
	goto __75
__74:
	(*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp+24)).FcommandPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__75:
	;
	goto __72
__72:
	if 0 != 0 {
		goto __71
	}
	goto __73
__73:
	;
	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer((*InteractiveState)(unsafe.Pointer(bp+24)).FcommandPtr)).FrefCount++
	if !(code != TCL_OK) {
		goto __76
	}
	chan1 = XTcl_GetStdChannel(tls, int32(1)<<3)
	if !(chan1 != 0) {
		goto __78
	}
	XTcl_WriteObj(tls, chan1, XTcl_GetObjResult(tls, interp))
	XTcl_WriteChars(tls, chan1, ts+350, 1)
__78:
	;
	goto __77
__76:
	if !((*InteractiveState)(unsafe.Pointer(bp+24)).Ftty != 0) {
		goto __79
	}
	resultPtr = XTcl_GetObjResult(tls, interp)
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
	XTcl_GetStringFromObj(tls, resultPtr, bp+64)
	chan1 = XTcl_GetStdChannel(tls, int32(1)<<2)
	if !(*(*int32)(unsafe.Pointer(bp + 64)) > 0 && chan1 != 0) {
		goto __80
	}
	XTcl_WriteObj(tls, chan1, resultPtr)
	XTcl_WriteChars(tls, chan1, ts+350, 1)
__80:
	;
__81:
	_objPtr6 = resultPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr6)).FrefCount, 1) <= 1) {
		goto __84
	}
	XTclFreeObj(tls, _objPtr6)
__84:
	;
	goto __82
__82:
	if 0 != 0 {
		goto __81
	}
	goto __83
__83:
	;
__79:
	;
__77:
	;
	goto __49
__48: // (mainLoopProc != NULL)
	// If a main loop has been defined while running interactively, we
	// want to start a fileevent based prompt by establishing a
	// channel handler for stdin.

	if !((*InteractiveState)(unsafe.Pointer(bp+24)).Finput != 0) {
		goto __85
	}
	if !((*InteractiveState)(unsafe.Pointer(bp+24)).Ftty != 0) {
		goto __86
	}
	sPrompt(tls, interp, bp+24)
__86:
	;

	XTcl_CreateChannelHandler(tls, (*InteractiveState)(unsafe.Pointer(bp+24 /* &is */)).Finput, int32(1)<<1,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, int32)
		}{sStdinProc})), bp+24 /* &is */)
__85:
	;

	(*struct{ f func(*libc.TLS) })(unsafe.Pointer(&struct{ uintptr }{mainLoopProc})).f(tls)
	XTcl_SetMainLoop(tls, uintptr(0))

	if !((*InteractiveState)(unsafe.Pointer(bp+24)).Finput != 0) {
		goto __87
	}
	XTcl_DeleteChannelHandler(tls, (*InteractiveState)(unsafe.Pointer(bp+24 /* &is */)).Finput, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sStdinProc})), bp+24 /* &is */)
__87:
	;
	(*InteractiveState)(unsafe.Pointer(bp + 24 /* &is */)).Finput = XTcl_GetStdChannel(tls, int32(1)<<1)
__49:
	;

	// This code here only for the (unsupported and deprecated) [checkmem]
	// command.

	goto __46
__47:
	;

done:
	mainLoopProc = XTclGetMainLoop(tls)
	if !(exitCode == 0 && mainLoopProc != 0 && !(XTcl_LimitExceeded(tls, interp) != 0)) {
		goto __88
	}
	// If everything has gone OK so far, call the main loop proc, if it
	// exists. Packages (like Tk) can set it to start processing events at
	// this point.

	(*struct{ f func(*libc.TLS) })(unsafe.Pointer(&struct{ uintptr }{mainLoopProc})).f(tls)
	XTcl_SetMainLoop(tls, uintptr(0))
__88:
	;
	if !((*InteractiveState)(unsafe.Pointer(bp+24)).FcommandPtr != uintptr(0)) {
		goto __89
	}
__90:
	_objPtr7 = (*InteractiveState)(unsafe.Pointer(bp + 24)).FcommandPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr7)).FrefCount, 1) <= 1) {
		goto __93
	}
	XTclFreeObj(tls, _objPtr7)
__93:
	;
	goto __91
__91:
	if 0 != 0 {
		goto __90
	}
	goto __92
__92:
	;
__89:
	;

	// Rather than calling exit, invoke the "exit" command so that users can
	// replace "exit" with some other command to do additional cleanup on
	// exit. The Tcl_EvalObjEx call should never return.

	if !(!(XTcl_InterpDeleted(tls, interp) != 0) && !(XTcl_LimitExceeded(tls, interp) != 0)) {
		goto __94
	}
	cmd = XTcl_ObjPrintf(tls, ts+45597, libc.VaList(bp, exitCode))

	(*Tcl_Obj)(unsafe.Pointer(cmd)).FrefCount++
	XTcl_EvalObjEx(tls, interp, cmd, TCL_EVAL_GLOBAL)
__95:
	_objPtr8 = cmd
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr8)).FrefCount, 1) <= 1) {
		goto __98
	}
	XTclFreeObj(tls, _objPtr8)
__98:
	;
	goto __96
__96:
	if 0 != 0 {
		goto __95
	}
	goto __97
__97:
	;
__94:
	;

	// If Tcl_EvalObjEx returns, trying to eval [exit], something unusual is
	// happening. Maybe interp has been deleted; maybe [exit] was redefined,
	// maybe we've blown up because of an exceeded limit. We still want to
	// cleanup and exit.

	XTcl_Exit(tls, exitCode)
}

func XTcl_Main(tls *libc.TLS, argc int32, argv uintptr, appInitProc uintptr) { /* tclMain.c:624:1: */
	XTcl_MainEx(tls, argc, argv, appInitProc, XTcl_CreateInterp(tls))
}

//---------------------------------------------------------------
//
// Tcl_SetMainLoop --
//
//	Sets an alternative main loop function.
//
// Results:
//	None.
//
// Side effects:
//	This function will be called before Tcl exits, allowing for the
//	creation of an event loop.
//
//---------------------------------------------------------------

func XTcl_SetMainLoop(tls *libc.TLS, proc uintptr) { /* tclMain.c:656:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey6)), int32(unsafe.Sizeof(ThreadSpecificData7{})))

	(*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).FmainLoopProc = proc
}

//---------------------------------------------------------------
//
// TclGetMainLoop --
//
//	Returns the current alternative main loop function.
//
// Results:
//	Returns the previously defined main loop function, or NULL to indicate
//	that no such function has been installed and standard tclsh behaviour
//	(i.e., exit once the script is evaluated if not interactive) is
//	requested..
//
// Side effects:
//	None (other than possible creation of this file's TSD block).
//
//---------------------------------------------------------------

func XTclGetMainLoop(tls *libc.TLS) uintptr { /* tclMain.c:683:18: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey6)), int32(unsafe.Sizeof(ThreadSpecificData7{})))

	return (*ThreadSpecificData7)(unsafe.Pointer(tsdPtr)).FmainLoopProc
}

//----------------------------------------------------------------------
//
// TclFullFinalizationRequested --
//
//	This function returns true when either -DPURIFY is specified, or the
//	environment variable TCL_FINALIZE_ON_EXIT is set and not "0". This
//	predicate is called at places affecting the exit sequence, so that the
//	default behavior is a fast and deadlock-free exit, and the modified
//	behavior is a more thorough finalization for debugging purposes (leak
//	hunting etc).
//
// Results:
//	A boolean.
//
//----------------------------------------------------------------------

func XTclFullFinalizationRequested(tls *libc.TLS) int32 { /* tclMain.c:710:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var fin uintptr
	// var ds Tcl_DString at bp, 216

	var finalize int32 = 0

	fin = XTclGetEnv(tls, ts+45605, bp)
	finalize = libc.Bool32(fin != uintptr(0) && libc.Xstrcmp(tls, fin, ts+18333) != 0)
	if fin != uintptr(0) {
		XTcl_DStringFree(tls, bp)
	}
	return finalize
}

//----------------------------------------------------------------------
//
// StdinProc --
//
//	This function is invoked by the event dispatcher whenever standard
//	input becomes readable. It grabs the next line of input characters,
//	adds them to a command being assembled, and executes the command if
//	it's complete.
//
// Results:
//	None.
//
// Side effects:
//	Could be almost arbitrary, depending on the command that's typed.
//
//----------------------------------------------------------------------

// ARGSUSED
func sStdinProc(tls *libc.TLS, clientData ClientData, mask int32) { /* tclMain.c:750:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var code int32
	// var length int32 at bp, 4

	var isPtr uintptr
	var chan1 Tcl_Channel
	var commandPtr uintptr
	var interp uintptr
	var _objPtr uintptr
	var _objPtr1 uintptr
	var _objPtr2 uintptr
	var cachePtr uintptr
	var _objPtr3 uintptr
	var resultPtr uintptr
	isPtr = clientData
	chan1 = (*InteractiveState)(unsafe.Pointer(isPtr)).Finput
	commandPtr = (*InteractiveState)(unsafe.Pointer(isPtr)).FcommandPtr
	interp = (*InteractiveState)(unsafe.Pointer(isPtr)).Finterp

	if !((*Tcl_Obj)(unsafe.Pointer(commandPtr)).FrefCount > 1) {
		goto __1
	}
__2:
	_objPtr = commandPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __5
	}
	XTclFreeObj(tls, _objPtr)
__5:
	;
	goto __3
__3:
	if 0 != 0 {
		goto __2
	}
	goto __4
__4:
	;
	commandPtr = XTcl_DuplicateObj(tls, commandPtr)
	(*Tcl_Obj)(unsafe.Pointer(commandPtr)).FrefCount++
__1:
	;
	*(*int32)(unsafe.Pointer(bp /* length */)) = XTcl_GetsObj(tls, chan1, commandPtr)
	if !(*(*int32)(unsafe.Pointer(bp)) < 0) {
		goto __6
	}
	if !(XTcl_InputBlocked(tls, chan1) != 0) {
		goto __7
	}
	return
__7:
	;
	if !((*InteractiveState)(unsafe.Pointer(isPtr)).Ftty != 0) {
		goto __8
	}
	// Would be better to find a way to exit the mainLoop? Or perhaps
	// evaluate [exit]? Leaving as is for now due to compatibility
	// concerns.

	XTcl_Exit(tls, 0)
__8:
	;
	XTcl_DeleteChannelHandler(tls, chan1, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sStdinProc})), isPtr)
	return
__6:
	;

	if !((*Tcl_Obj)(unsafe.Pointer(commandPtr)).FrefCount > 1) {
		goto __9
	}
__10:
	_objPtr1 = commandPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __13
	}
	XTclFreeObj(tls, _objPtr1)
__13:
	;
	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
	commandPtr = XTcl_DuplicateObj(tls, commandPtr)
	(*Tcl_Obj)(unsafe.Pointer(commandPtr)).FrefCount++
__9:
	;
	XTcl_AppendToObj(tls, commandPtr, ts+350, 1)
	if !!(XTclObjCommandComplete(tls, commandPtr) != 0) {
		goto __14
	}
	(*InteractiveState)(unsafe.Pointer(isPtr)).Fprompt = PROMPT_CONTINUE
	goto prompt
__14:
	;
	(*InteractiveState)(unsafe.Pointer(isPtr)).Fprompt = PROMPT_START
	XTcl_GetStringFromObj(tls, commandPtr, bp)
	XTcl_SetObjLength(tls, commandPtr, libc.PreDecInt32(&*(*int32)(unsafe.Pointer(bp /* length */)), 1))

	// Disable the stdin channel handler while evaluating the command;
	// otherwise if the command re-enters the event loop we might process
	// commands from stdin before the current command is finished. Among other
	// things, this will trash the text of the command being evaluated.

	XTcl_CreateChannelHandler(tls, chan1, 0, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sStdinProc})), isPtr)
	code = XTcl_RecordAndEvalObj(tls, interp, commandPtr, TCL_EVAL_GLOBAL)
	(*InteractiveState)(unsafe.Pointer(isPtr)).Finput = libc.AssignUintptr(&chan1, XTcl_GetStdChannel(tls, int32(1)<<1))
__15:
	_objPtr2 = commandPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __18
	}
	XTclFreeObj(tls, _objPtr2)
__18:
	;
	goto __16
__16:
	if 0 != 0 {
		goto __15
	}
	goto __17
__17:
	;
__19:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __22
	}
	commandPtr = XTclThreadAllocObj(tls)
	goto __23
__22:
	commandPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(commandPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__23:
	;
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
	(*Tcl_Obj)(unsafe.Pointer(commandPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(commandPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(commandPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(commandPtr)).FtypePtr = uintptr(0)

	(*InteractiveState)(unsafe.Pointer(isPtr)).FcommandPtr = commandPtr
	(*Tcl_Obj)(unsafe.Pointer(commandPtr)).FrefCount++
	if !(chan1 != uintptr(0)) {
		goto __24
	}
	XTcl_CreateChannelHandler(tls, chan1, int32(1)<<1, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sStdinProc})), isPtr)
__24:
	;
	if !(code != TCL_OK) {
		goto __25
	}
	chan1 = XTcl_GetStdChannel(tls, int32(1)<<3)

	if !(chan1 != uintptr(0)) {
		goto __27
	}
	XTcl_WriteObj(tls, chan1, XTcl_GetObjResult(tls, interp))
	XTcl_WriteChars(tls, chan1, ts+350, 1)
__27:
	;
	goto __26
__25:
	if !((*InteractiveState)(unsafe.Pointer(isPtr)).Ftty != 0) {
		goto __28
	}
	resultPtr = XTcl_GetObjResult(tls, interp)
	chan1 = XTcl_GetStdChannel(tls, int32(1)<<2)

	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
	XTcl_GetStringFromObj(tls, resultPtr, bp)
	if !(*(*int32)(unsafe.Pointer(bp)) > 0 && chan1 != uintptr(0)) {
		goto __29
	}
	XTcl_WriteObj(tls, chan1, resultPtr)
	XTcl_WriteChars(tls, chan1, ts+350, 1)
__29:
	;
__30:
	_objPtr3 = resultPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __33
	}
	XTclFreeObj(tls, _objPtr3)
__33:
	;
	goto __31
__31:
	if 0 != 0 {
		goto __30
	}
	goto __32
__32:
	;
__28:
	;
__26:
	;

	// If a tty stdin is still around, output a prompt.

prompt:
	if !((*InteractiveState)(unsafe.Pointer(isPtr)).Ftty != 0 && (*InteractiveState)(unsafe.Pointer(isPtr)).Finput != uintptr(0)) {
		goto __34
	}
	sPrompt(tls, interp, isPtr)
	(*InteractiveState)(unsafe.Pointer(isPtr)).Finput = XTcl_GetStdChannel(tls, int32(1)<<1)
__34:
}

//----------------------------------------------------------------------
//
// Prompt --
//
//	Issue a prompt on standard output, or invoke a script to issue the
//	prompt.
//
// Results:
//	None.
//
// Side effects:
//	A prompt gets output, and a Tcl script may be evaluated in interp.
//
//----------------------------------------------------------------------

func sPrompt(tls *libc.TLS, interp uintptr, isPtr uintptr) { /* tclMain.c:863:1: */
	var promptCmdPtr uintptr
	var code int32
	var chan1 Tcl_Channel

	if !((*InteractiveState)(unsafe.Pointer(isPtr)).Fprompt == PROMPT_NONE) {
		goto __1
	}
	return
__1:
	;

	promptCmdPtr = XTcl_GetVar2Ex(tls, interp,
		func() uintptr {
			if (*InteractiveState)(unsafe.Pointer(isPtr)).Fprompt == PROMPT_CONTINUE {
				return ts + 45626 /* "tcl_prompt2" */
			}
			return ts + 45638 /* "tcl_prompt1" */
		}(),
		uintptr(0), TCL_GLOBAL_ONLY)

	if !(XTcl_InterpDeleted(tls, interp) != 0) {
		goto __2
	}
	return
__2:
	;
	if !(promptCmdPtr == uintptr(0)) {
		goto __3
	}
defaultPrompt:
	if !((*InteractiveState)(unsafe.Pointer(isPtr)).Fprompt == PROMPT_START) {
		goto __5
	}
	chan1 = XTcl_GetStdChannel(tls, int32(1)<<2)
	if !(chan1 != uintptr(0)) {
		goto __6
	}
	XTcl_WriteChars(tls, chan1, ts+45650,
		int32(libc.Xstrlen(tls, ts+45650)))
__6:
	;
__5:
	;
	goto __4
__3:
	code = XTcl_EvalObjEx(tls, interp, promptCmdPtr, TCL_EVAL_GLOBAL)
	if !(code != TCL_OK) {
		goto __7
	}
	XTcl_AddErrorInfo(tls, interp,
		ts+45653)
	chan1 = XTcl_GetStdChannel(tls, int32(1)<<3)
	if !(chan1 != uintptr(0)) {
		goto __8
	}
	XTcl_WriteObj(tls, chan1, XTcl_GetObjResult(tls, interp))
	XTcl_WriteChars(tls, chan1, ts+350, 1)
__8:
	;
	goto defaultPrompt
__7:
	;
__4:
	;

	chan1 = XTcl_GetStdChannel(tls, int32(1)<<2)
	if !(chan1 != uintptr(0)) {
		goto __9
	}
	XTcl_Flush(tls, chan1)
__9:
	;
	(*InteractiveState)(unsafe.Pointer(isPtr)).Fprompt = PROMPT_NONE
}

//----------------------------------------------------------------------
//
// FreeMainInterp --
//
//	Exit handler used to cleanup the main interpreter and ancillary
//	startup script storage at exit.
//
//----------------------------------------------------------------------

func sFreeMainInterp(tls *libc.TLS, clientData ClientData) { /* tclMain.c:925:1: */
	var interp uintptr = clientData

	//if (TclInExit()) return;

	if !(XTcl_InterpDeleted(tls, interp) != 0) {
		XTcl_DeleteInterp(tls, interp)
	}
	XTcl_SetStartupScript(tls, uintptr(0), uintptr(0))
	XTcl_Release(tls, interp)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------
// Macros and flag values used by Tcl bytecode compilation and execution
// modules inside the Tcl core but not used outside.
//----------------------------------------------------------------

// Simplified form to access AuxData.
//
// ClientData TclFetchAuxData(CompileEng *envPtr, int index);

// Form of TclRegisterLiteral with flags == 0. In that case, it is safe to
// cast away constness, and it is cleanest to do that here, all in one place.
//
// int TclRegisterNewLiteral(CompileEnv *envPtr, const char *bytes,
//			     int length);

// Form of TclRegisterLiteral with flags == LITERAL_CMD_NAME. In that case, it
// is safe to cast away constness, and it is cleanest to do that here, all in
// one place.
//
// int TclRegisterNewNSLiteral(CompileEnv *envPtr, const char *bytes,
//			       int length);

// Macro used to manually adjust the stack requirements; used in cases where
// the stack effect cannot be computed from the opcode and its operands, but
// is still known at compile time.
//
// void TclAdjustStackDepth(int delta, CompileEnv *envPtr);

// Macro used to update the stack requirements. It is called by the macros
// TclEmitOpCode, TclEmitInst1 and TclEmitInst4.
// Remark that the very last instruction of a bytecode always reduces the
// stack level: INST_DONE or INST_POP, so that the maxStackdepth is always
// updated.
//
// void TclUpdateStackReqs(unsigned char op, int i, CompileEnv *envPtr);

// Macros used to update the flag that indicates if we are at the start of a
// command, based on whether the opcode is INST_START_COMMAND.
//
// void TclUpdateAtCmdStart(unsigned char op, CompileEnv *envPtr);

// Macro to emit an opcode byte into a CompileEnv's code array. The ANSI C
// "prototype" for this macro is:
//
// void TclEmitOpcode(unsigned char op, CompileEnv *envPtr);

// Macros to emit an integer operand. The ANSI C "prototype" for these macros
// are:
//
// void TclEmitInt1(int i, CompileEnv *envPtr);
// void TclEmitInt4(int i, CompileEnv *envPtr);

// Macros to emit an instruction with signed or unsigned integer operands.
// Four byte integers are stored in "big-endian" order with the high order
// byte stored at the lowest address. The ANSI C "prototypes" for these macros
// are:
//
// void TclEmitInstInt1(unsigned char op, int i, CompileEnv *envPtr);
// void TclEmitInstInt4(unsigned char op, int i, CompileEnv *envPtr);

// Macro to push a Tcl object onto the Tcl evaluation stack. It emits the
// object's one or four byte array index into the CompileEnv's code array.
// These support, respectively, a maximum of 256 (2**8) and 2**32 objects in a
// CompileEnv. The ANSI C "prototype" for this macro is:
//
// void	TclEmitPush(int objIndex, CompileEnv *envPtr);

// Macros to update a (signed or unsigned) integer starting at a pointer. The
// two variants depend on the number of bytes. The ANSI C "prototypes" for
// these macros are:
//
// void TclStoreInt1AtPtr(int i, unsigned char *p);
// void TclStoreInt4AtPtr(int i, unsigned char *p);

// Macros to update instructions at a particular pc with a new op code and a
// (signed or unsigned) int operand. The ANSI C "prototypes" for these macros
// are:
//
// void TclUpdateInstInt1AtPc(unsigned char op, int i, unsigned char *pc);
// void TclUpdateInstInt4AtPc(unsigned char op, int i, unsigned char *pc);

// Macro to fix up a forward jump to point to the current code-generation
// position in the bytecode being created (the most common case). The ANSI C
// "prototypes" for this macro is:
//
// int TclFixupForwardJumpToHere(CompileEnv *envPtr, JumpFixup *fixupPtr,
//				 int threshold);

// Macros to get a signed integer (GET_INT{1,2}) or an unsigned int
// (GET_UINT{1,2}) from a pointer. There are two variants for each return type
// that depend on the number of bytes fetched. The ANSI C "prototypes" for
// these macros are:
//
// int TclGetInt1AtPtr(unsigned char *p);
// int TclGetInt4AtPtr(unsigned char *p);
// unsigned int TclGetUInt1AtPtr(unsigned char *p);
// unsigned int TclGetUInt4AtPtr(unsigned char *p);

// The TclGetInt1AtPtr macro is tricky because we want to do sign extension on
// the 1-byte value. Unfortunately the "char" type isn't signed on all
// platforms so sign-extension doesn't always happen automatically. Sometimes
// we can explicitly declare the pointer to be signed, but other times we have
// to explicitly sign-extend the value in software.

// Macros used to compute the minimum and maximum of two integers. The ANSI C
// "prototypes" for these macros are:
//
// int TclMin(int i, int j);
// int TclMax(int i, int j);

// Convenience macros for use when compiling bodies of commands. The ANSI C
// "prototype" for these macros are:
//
// static void		BODY(Tcl_Token *tokenPtr, int word);

// Convenience macro for use when compiling tokens to be pushed. The ANSI C
// "prototype" for this macro is:
//
// static void		CompileTokens(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp);

// Convenience macros for use when pushing literals. The ANSI C "prototype" for
// these macros are:
//
// static void		PushLiteral(CompileEnv *envPtr,
//			    const char *string, int length);
// static void		PushStringLiteral(CompileEnv *envPtr,
//			    const char *string);

// Macro to advance to the next token; it is more mnemonic than the address
// arithmetic that it replaces. The ANSI C "prototype" for this macro is:
//
// static Tcl_Token *	TokenAfter(Tcl_Token *tokenPtr);

// Macro to get the offset to the next instruction to be issued. The ANSI C
// "prototype" for this macro is:
//
// static int	CurrentOffset(CompileEnv *envPtr);

// Note: the exceptDepth is a bit of a misnomer: TEBC only needs the
// maximal depth of nested CATCH ranges in order to alloc runtime
// memory. These macros should compute precisely that? OTOH, the nesting depth
// of LOOP ranges is an interesting datum for debugging purposes, and that is
// what we compute now.
//
// static int	ExceptionRangeStarts(CompileEnv *envPtr, int index);
// static void	ExceptionRangeEnds(CompileEnv *envPtr, int index);
// static void	ExceptionRangeTarget(CompileEnv *envPtr, int index, LABEL);

// Check if there is an LVT for compiled locals

// Macros for making it easier to deal with tokens and DStrings.

// Macro that encapsulates an efficiency trick that avoids a function call for
// the simplest of compiles. The ANSI C "prototype" for this macro is:
//
// static void		CompileWord(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp, int word);

// TIP #280: Remember the per-word line information of the current command. An
// index is used instead of a pointer as recursive compilation may reallocate,
// i.e. move, the array. This is also the reason to save the nuloc now, it may
// change during the course of the function.
//
// Macro to encapsulate the variable definition and setup.

// Often want to issue one of two versions of an instruction based on whether
// the argument will fit in a single byte or not. This makes it much clearer.

// How to get an anonymous local variable (used for holding temporary values
// off the stack) or a local simple scalar.

// Flags bits used by TclPushVarName.

// DTrace probe macros (NOPs if DTrace support is not enabled).

// Define the following macros to enable debug logging of the DTrace proc,
// cmd, and inst probes. Note that this does _not_ require a platform with
// DTrace, it simply logs all probe output to /tmp/tclDTraceDebug-[pid].log.
//
// If the second macro is defined, logging to file starts immediately,
// otherwise only after the first call to [tcl::dtrace]. Note that the debug
// probe data is always computed, even when it is not logged to file.
//
// Defining the third macro enables debug logging of inst probes (disabled
// by default due to the significant performance impact).

//
// #define TCL_DTRACE_DEBUG 1
// #define TCL_DTRACE_DEBUG_LOG_ENABLED 1
// #define TCL_DTRACE_DEBUG_INST_PROBES 1

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Thread-local storage used to avoid having a global lock on data that is not
// limited to a single interpreter.

type ThreadSpecificData8 = struct{ FnumNsCreated int64 } /* tclNamesp.c:44:3 */

var dataKey7 Tcl_ThreadDataKey /* tclNamesp.c:46:26: */

// This structure contains a cached pointer to a namespace that is the result
// of resolving the namespace's name in some other namespace. It is the
// internal representation for a nsName object. It contains the pointer along
// with some information that is used to check the cached pointer's validity.

type ResolvedNsName1 = struct {
	FnsPtr       uintptr
	FrefNsPtr    uintptr
	FrefCount    int32
	F__ccgo_pad1 [4]byte
} /* tclNamesp.c:55:9 */

// This structure contains a cached pointer to a namespace that is the result
// of resolving the namespace's name in some other namespace. It is the
// internal representation for a nsName object. It contains the pointer along
// with some information that is used to check the cached pointer's validity.

type ResolvedNsName = ResolvedNsName1 /* tclNamesp.c:67:3 */

// This structure defines a Tcl object type that contains a namespace
// reference. It is used in commands that take the name of a namespace as an
// argument. The namespace reference is resolved, and the result in cached in
// the object.

var nsNameType = Tcl_ObjType{
	Fname:           ts + 45689,
	FfreeIntRepProc: 0, // freeIntRepProc
	FdupIntRepProc:  0, // updateStringProc
	FsetFromAnyProc: 0, // setFromAnyProc
} /* tclNamesp.c:149:26 */

// Array of values describing how to implement each standard subcommand of the
// "namespace" command.

var defaultNamespaceMap = [20]EnsembleImplMap{
	{Fname: ts + 41966, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 45696, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 34719, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 7321, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 45701, Fproc: 0},
	{Fname: ts + 2409, Fproc: 0, FnreProc: 0},
	{Fname: ts + 12165, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 45710, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 45717, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 45724, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 18756, Fproc: 0, FnreProc: 0},
	{Fname: ts + 34676, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 45731, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 41763, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 45738, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12307, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12865, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 3426, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 45749, Fproc: 0, FcompileProc: 0},
	{},
} /* tclNamesp.c:162:30 */

//----------------------------------------------------------------------
//
// TclInitNamespaceSubsystem --
//
//	This function is called to initialize all the structures that are used
//	by namespaces on a per-process basis.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclInitNamespaceSubsystem(tls *libc.TLS) { /* tclNamesp.c:203:1: */
	// Does nothing for now.
}

//----------------------------------------------------------------------
//
// Tcl_GetCurrentNamespace --
//
//	Returns a pointer to an interpreter's currently active namespace.
//
// Results:
//	Returns a pointer to the interpreter's current namespace.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetCurrentNamespace(tls *libc.TLS, interp uintptr) uintptr { /* tclNamesp.c:226:15: */
	return (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
}

//----------------------------------------------------------------------
//
// Tcl_GetGlobalNamespace --
//
//	Returns a pointer to an interpreter's global :: namespace.
//
// Results:
//	Returns a pointer to the specified interpreter's global namespace.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetGlobalNamespace(tls *libc.TLS, interp uintptr) uintptr { /* tclNamesp.c:250:15: */
	return (*Interp)(unsafe.Pointer(interp)).FglobalNsPtr
}

//----------------------------------------------------------------------
//
// Tcl_PushCallFrame --
//
//	Pushes a new call frame onto the interpreter's Tcl call stack. Called
//	when executing a Tcl procedure or a "namespace eval" or "namespace
//	inscope" command.
//
// Results:
//	Returns TCL_OK if successful, or TCL_ERROR (along with an error
//	message in the interpreter's result object) if something goes wrong.
//
// Side effects:
//	Modifies the interpreter's Tcl call stack.
//
//----------------------------------------------------------------------

func XTcl_PushCallFrame(tls *libc.TLS, interp uintptr, callFramePtr uintptr, namespacePtr uintptr, isProcCallFrame int32) int32 { /* tclNamesp.c:278:1: */
	var iPtr uintptr = interp
	var framePtr uintptr = callFramePtr
	var nsPtr uintptr

	if namespacePtr == uintptr(0) {
		nsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	} else {
		nsPtr = namespacePtr

		// TODO: Examine whether it would be better to guard based on NS_DYING
		// or NS_KILLED. It appears that these are not tested because they can
		// be set in a global interp that has been [namespace delete]d, but
		// which never really completely goes away because of lingering global
		// things like ::errorInfo and [::unknown] and hidden commands.
		// Review of those designs might permit stricter checking here.

		if (*Namespace)(unsafe.Pointer(nsPtr)).Fflags&NS_DEAD != 0 {
			XTcl_Panic(tls, ts+45755, 0)
			//NOTREACHED
		}
	}

	(*Namespace)(unsafe.Pointer(nsPtr)).FactivationCount++
	(*CallFrame)(unsafe.Pointer(framePtr)).FnsPtr = nsPtr
	(*CallFrame)(unsafe.Pointer(framePtr)).FisProcCallFrame = isProcCallFrame
	(*CallFrame)(unsafe.Pointer(framePtr)).Fobjc = 0
	(*CallFrame)(unsafe.Pointer(framePtr)).Fobjv = uintptr(0)
	(*CallFrame)(unsafe.Pointer(framePtr)).FcallerPtr = (*Interp)(unsafe.Pointer(iPtr)).FframePtr
	(*CallFrame)(unsafe.Pointer(framePtr)).FcallerVarPtr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	if (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr != uintptr(0) {
		(*CallFrame)(unsafe.Pointer(framePtr)).Flevel = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Flevel + 1
	} else {
		(*CallFrame)(unsafe.Pointer(framePtr)).Flevel = 0
	}
	(*CallFrame)(unsafe.Pointer(framePtr)).FprocPtr = uintptr(0)     // no called procedure
	(*CallFrame)(unsafe.Pointer(framePtr)).FvarTablePtr = uintptr(0) // and no local variables
	(*CallFrame)(unsafe.Pointer(framePtr)).FnumCompiledLocals = 0
	(*CallFrame)(unsafe.Pointer(framePtr)).FcompiledLocals = uintptr(0)
	(*CallFrame)(unsafe.Pointer(framePtr)).FclientData = uintptr(0)
	(*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr = uintptr(0)
	(*CallFrame)(unsafe.Pointer(framePtr)).FtailcallPtr = uintptr(0)

	// Push the new call frame onto the interpreter's stack of procedure call
	// frames making it the current frame.

	(*Interp)(unsafe.Pointer(iPtr)).FframePtr = framePtr
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = framePtr

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_PopCallFrame --
//
//	Removes a call frame from the Tcl call stack for the interpreter.
//	Called to remove a frame previously pushed by Tcl_PushCallFrame.
//
// Results:
//	None.
//
// Side effects:
//	Modifies the call stack of the interpreter. Resets various fields of
//	the popped call frame. If a namespace has been deleted and has no more
//	activations on the call stack, the namespace is destroyed.
//
//----------------------------------------------------------------------

func XTcl_PopCallFrame(tls *libc.TLS, interp uintptr) { /* tclNamesp.c:378:1: */
	var iPtr uintptr = interp
	var framePtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FframePtr
	var nsPtr uintptr

	// It's important to remove the call frame from the interpreter's stack of
	// call frames before deleting local variables, so that traces invoked by
	// the variable deletion don't see the partially-deleted frame.

	if (*CallFrame)(unsafe.Pointer(framePtr)).FcallerPtr != 0 {
		(*Interp)(unsafe.Pointer(iPtr)).FframePtr = (*CallFrame)(unsafe.Pointer(framePtr)).FcallerPtr
		(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = (*CallFrame)(unsafe.Pointer(framePtr)).FcallerVarPtr
	} else {
		// Tcl_PopCallFrame: trying to pop rootCallFrame!
	}

	if (*CallFrame)(unsafe.Pointer(framePtr)).FvarTablePtr != uintptr(0) {
		XTclDeleteVars(tls, iPtr, (*CallFrame)(unsafe.Pointer(framePtr)).FvarTablePtr)
		XTclpFree(tls, (*CallFrame)(unsafe.Pointer(framePtr)).FvarTablePtr)
		(*CallFrame)(unsafe.Pointer(framePtr)).FvarTablePtr = uintptr(0)
	}
	if (*CallFrame)(unsafe.Pointer(framePtr)).FnumCompiledLocals > 0 {
		XTclDeleteCompiledLocalVars(tls, iPtr, framePtr)
		if libc.PreDecInt32(&(*LocalCache)(unsafe.Pointer((*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr)).FrefCount, 1) == 0 {
			XTclFreeLocalCache(tls, interp, (*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr)
		}
		(*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr = uintptr(0)
	}

	// Decrement the namespace's count of active call frames. If the namespace
	// is "dying" and there are no more active call frames, call
	// Tcl_DeleteNamespace to destroy it.

	nsPtr = (*CallFrame)(unsafe.Pointer(framePtr)).FnsPtr
	(*Namespace)(unsafe.Pointer(nsPtr)).FactivationCount--
	if (*Namespace)(unsafe.Pointer(nsPtr)).Fflags&NS_DYING != 0 &&
		(*Namespace)(unsafe.Pointer(nsPtr)).FactivationCount-libc.Bool32(nsPtr == (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr) == 0 {
		XTcl_DeleteNamespace(tls, nsPtr)
	}
	(*CallFrame)(unsafe.Pointer(framePtr)).FnsPtr = uintptr(0)

	if (*CallFrame)(unsafe.Pointer(framePtr)).FtailcallPtr != 0 {
		XTclSetTailcall(tls, interp, (*CallFrame)(unsafe.Pointer(framePtr)).FtailcallPtr)
	}
}

//----------------------------------------------------------------------
//
// TclPushStackFrame --
//
//	Allocates a new call frame in the interpreter's execution stack, then
//	pushes it onto the interpreter's Tcl call stack. Called when executing
//	a Tcl procedure or a "namespace eval" or "namespace inscope" command.
//
// Results:
//	Returns TCL_OK if successful, or TCL_ERROR (along with an error
//	message in the interpreter's result object) if something goes wrong.
//
// Side effects:
//	Modifies the interpreter's Tcl call stack.
//
//----------------------------------------------------------------------

func XTclPushStackFrame(tls *libc.TLS, interp uintptr, framePtrPtr uintptr, namespacePtr uintptr, isProcCallFrame int32) int32 { /* tclNamesp.c:450:1: */
	*(*uintptr)(unsafe.Pointer(framePtrPtr)) = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(CallFrame{})))
	return XTcl_PushCallFrame(tls, interp, *(*uintptr)(unsafe.Pointer(framePtrPtr)), namespacePtr,
		isProcCallFrame)
}

func XTclPopStackFrame(tls *libc.TLS, interp uintptr) { /* tclNamesp.c:474:1: */
	var freePtr uintptr = (*Interp)(unsafe.Pointer(interp)).FframePtr

	XTcl_PopCallFrame(tls, interp)
	XTclStackFree(tls, interp, freePtr)
}

//----------------------------------------------------------------------
//
// EstablishErrorCodeTraces --
//
//	Creates traces on the ::errorCode variable to keep its value
//	consistent with the expectations of legacy code.
//
// Results:
//	None.
//
// Side effects:
//	Read and unset traces are established on ::errorCode.
//
//----------------------------------------------------------------------

func sEstablishErrorCodeTraces(tls *libc.TLS, clientData ClientData, interp uintptr, name1 uintptr, name2 uintptr, flags int32) uintptr { /* tclNamesp.c:500:13: */
	XTcl_TraceVar2(tls, interp, ts+45800, uintptr(0), TCL_GLOBAL_ONLY|TCL_TRACE_READS,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sErrorCodeRead})), uintptr(0))
	XTcl_TraceVar2(tls, interp, ts+45800, uintptr(0), TCL_GLOBAL_ONLY|TCL_TRACE_UNSETS,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sEstablishErrorCodeTraces})), uintptr(0))
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// ErrorCodeRead --
//
//	Called when the ::errorCode variable is read. Copies the current value
//	of the interp's errorCode field into ::errorCode.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sErrorCodeRead(tls *libc.TLS, clientData ClientData, interp uintptr, name1 uintptr, name2 uintptr, flags int32) uintptr { /* tclNamesp.c:532:13: */
	var iPtr uintptr = interp

	if XTcl_InterpDeleted(tls, interp) != 0 || !((*Interp)(unsafe.Pointer(iPtr)).Fflags&ERR_LEGACY_COPY != 0) {
		return uintptr(0)
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorCode != 0 {
		XTcl_ObjSetVar2(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FecVar, uintptr(0),
			(*Interp)(unsafe.Pointer(iPtr)).FerrorCode, TCL_GLOBAL_ONLY)
		return uintptr(0)
	}
	if uintptr(0) == XTcl_ObjGetVar2(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FecVar, uintptr(0), TCL_GLOBAL_ONLY) {
		XTcl_ObjSetVar2(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FecVar, uintptr(0),
			XTcl_NewObj(tls), TCL_GLOBAL_ONLY)
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// EstablishErrorInfoTraces --
//
//	Creates traces on the ::errorInfo variable to keep its value
//	consistent with the expectations of legacy code.
//
// Results:
//	None.
//
// Side effects:
//	Read and unset traces are established on ::errorInfo.
//
//----------------------------------------------------------------------

func sEstablishErrorInfoTraces(tls *libc.TLS, clientData ClientData, interp uintptr, name1 uintptr, name2 uintptr, flags int32) uintptr { /* tclNamesp.c:574:13: */
	XTcl_TraceVar2(tls, interp, ts+27398, uintptr(0), TCL_GLOBAL_ONLY|TCL_TRACE_READS,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sErrorInfoRead})), uintptr(0))
	XTcl_TraceVar2(tls, interp, ts+27398, uintptr(0), TCL_GLOBAL_ONLY|TCL_TRACE_UNSETS,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
		}{sEstablishErrorInfoTraces})), uintptr(0))
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// ErrorInfoRead --
//
//	Called when the ::errorInfo variable is read. Copies the current value
//	of the interp's errorInfo field into ::errorInfo.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sErrorInfoRead(tls *libc.TLS, clientData ClientData, interp uintptr, name1 uintptr, name2 uintptr, flags int32) uintptr { /* tclNamesp.c:606:13: */
	var iPtr uintptr = interp

	if XTcl_InterpDeleted(tls, interp) != 0 || !((*Interp)(unsafe.Pointer(iPtr)).Fflags&ERR_LEGACY_COPY != 0) {
		return uintptr(0)
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo != 0 {
		XTcl_ObjSetVar2(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FeiVar, uintptr(0),
			(*Interp)(unsafe.Pointer(iPtr)).FerrorInfo, TCL_GLOBAL_ONLY)
		return uintptr(0)
	}
	if uintptr(0) == XTcl_ObjGetVar2(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FeiVar, uintptr(0), TCL_GLOBAL_ONLY) {
		XTcl_ObjSetVar2(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FeiVar, uintptr(0),
			XTcl_NewObj(tls), TCL_GLOBAL_ONLY)
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_CreateNamespace --
//
//	Creates a new namespace with the given name. If there is no active
//	namespace (i.e., the interpreter is being initialized), the global ::
//	namespace is created and returned.
//
// Results:
//	Returns a pointer to the new namespace if successful. If the namespace
//	already exists or if another error occurs, this routine returns NULL,
//	along with an error message in the interpreter's result object.
//
// Side effects:
//	If the name contains "::" qualifiers and a parent namespace does not
//	already exist, it is automatically created.
//
//----------------------------------------------------------------------

func XTcl_CreateNamespace(tls *libc.TLS, interp uintptr, name uintptr, clientData ClientData, deleteProc uintptr) uintptr { /* tclNamesp.c:652:15: */
	bp := tls.Alloc(776)
	defer tls.Free(776)

	var iPtr uintptr
	var nsPtr uintptr
	var ancestorPtr uintptr
	// var parentPtr uintptr at bp+304, 8

	// var dummy1Ptr uintptr at bp+312, 8

	// var dummy2Ptr uintptr at bp+320, 8

	var globalNsPtr uintptr
	// var simpleName uintptr at bp+328, 8

	var entryPtr uintptr
	// var buffer1 Tcl_DString at bp+344, 216

	// var buffer2 Tcl_DString at bp+560, 216

	var namePtr uintptr
	var buffPtr uintptr
	// var newEntry int32 at bp+336, 4

	var nameLen int32
	var tsdPtr uintptr
	var nameStr uintptr
	// var tmpBuffer Tcl_DString at bp+88, 216

	var tempPtr uintptr
	iPtr = interp
	globalNsPtr = (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr
	tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey7)), int32(unsafe.Sizeof(ThreadSpecificData8{})))

	XTcl_DStringInit(tls, bp+88)

	// If there is no active namespace, the interpreter is being initialized.

	if !(globalNsPtr == uintptr(0) && (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr == uintptr(0)) {
		goto __1
	}
	// Treat this namespace as the global namespace, and avoid looking for
	// a parent.

	*(*uintptr)(unsafe.Pointer(bp + 304 /* parentPtr */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 328 /* simpleName */)) = ts + 2046 /* "" */
	goto doCreate
__1:
	;

	// Ensure that there are no trailing colons as that causes chaos when a
	// deleteProc is specified. [Bug d614d63989]

	if !(deleteProc != uintptr(0)) {
		goto __2
	}
	nameStr = name + uintptr(libc.Xstrlen(tls, name)) - uintptr(2)
	if !(nameStr >= name && int32(*(*int8)(unsafe.Pointer(nameStr + 1))) == ':' && int32(*(*int8)(unsafe.Pointer(nameStr))) == ':') {
		goto __3
	}
	XTcl_DStringAppend(tls, bp+88, name, -1)
__4:
	if !(libc.AssignInt32(&nameLen, (*Tcl_DString)(unsafe.Pointer(bp+88)).Flength) > 0 &&
		int32(*(*int8)(unsafe.Pointer((*Tcl_DString)(unsafe.Pointer(bp+88)).Fstring + uintptr(nameLen-1)))) == ':') {
		goto __5
	}
	XTcl_DStringSetLength(tls, bp+88, nameLen-1)
	goto __4
__5:
	;
	name = (*Tcl_DString)(unsafe.Pointer(bp + 88)).Fstring
__3:
	;
__2:
	;

	// If we've ended up with an empty string now, we're attempting to create
	// the global namespace despite the global namespace existing. That's
	// naughty!

	if !(int32(*(*int8)(unsafe.Pointer(name))) == 0) {
		goto __6
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+45810, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+9231,
		ts+45879, uintptr(0)))
	XTcl_DStringFree(tls, bp+88)
	return uintptr(0)
__6:
	;

	// Find the parent for the new namespace.

	XTclGetNamespaceForQualName(tls, interp, name, uintptr(0), TCL_CREATE_NS_IF_UNKNOWN,
		bp+304, bp+312, bp+320, bp+328)

	// If the unqualified name at the end is empty, there were trailing "::"s
	// after the namespace's name which we ignore. The new namespace was
	// already (recursively) created and is pointed to by parentPtr.

	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 328))))) == 0) {
		goto __7
	}
	XTcl_DStringFree(tls, bp+88)
	return *(*uintptr)(unsafe.Pointer(bp + 304 /* parentPtr */))
__7:
	;

	// Check for a bad namespace name and make sure that the name does not
	// already exist in the parent namespace.

	if !((*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 304)) + 40)).FfindProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 304))+40, *(*uintptr)(unsafe.Pointer(bp + 328))) != uintptr(0)) {
		goto __8
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+45892, libc.VaList(bp+40, name)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+7420, ts+9231,
		ts+45936, uintptr(0)))
	XTcl_DStringFree(tls, bp+88)
	return uintptr(0)
__8:
	;

	// Create the new namespace and root it in its parent. Increment the count
	// of namespaces created.

doCreate:
	nsPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Namespace{})))
	nameLen = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 328))) + uint64(1))
	(*Namespace)(unsafe.Pointer(nsPtr)).Fname = XTcl_Alloc(tls, uint32(nameLen))
	libc.Xmemcpy(tls, (*Namespace)(unsafe.Pointer(nsPtr)).Fname, *(*uintptr)(unsafe.Pointer(bp + 328 /* simpleName */)), uint64(nameLen))
	(*Namespace)(unsafe.Pointer(nsPtr)).FfullName = uintptr(0) // Set below.
	(*Namespace)(unsafe.Pointer(nsPtr)).FclientData = clientData
	(*Namespace)(unsafe.Pointer(nsPtr)).FdeleteProc = deleteProc
	(*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr = *(*uintptr)(unsafe.Pointer(bp + 304 /* parentPtr */))
	XTcl_InitHashTable(tls, nsPtr+40, 0)
	(*Namespace)(unsafe.Pointer(nsPtr)).FnsId = libc.PreIncInt64(&(*ThreadSpecificData8)(unsafe.Pointer(tsdPtr)).FnumNsCreated, 1)
	(*Namespace)(unsafe.Pointer(nsPtr)).Finterp = interp
	(*Namespace)(unsafe.Pointer(nsPtr)).Fflags = 0
	(*Namespace)(unsafe.Pointer(nsPtr)).FactivationCount = 0
	(*Namespace)(unsafe.Pointer(nsPtr)).FrefCount = 0
	XTcl_InitHashTable(tls, nsPtr+160, 0)
	XTclInitVarHashTable(tls, nsPtr+248, nsPtr)
	(*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr = uintptr(0)
	(*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns = 0
	(*Namespace)(unsafe.Pointer(nsPtr)).FmaxExportPatterns = 0
	(*Namespace)(unsafe.Pointer(nsPtr)).FcmdRefEpoch = 0
	(*Namespace)(unsafe.Pointer(nsPtr)).FresolverEpoch = 0
	(*Namespace)(unsafe.Pointer(nsPtr)).FcmdResProc = uintptr(0)
	(*Namespace)(unsafe.Pointer(nsPtr)).FvarResProc = uintptr(0)
	(*Namespace)(unsafe.Pointer(nsPtr)).FcompiledVarResProc = uintptr(0)
	(*Namespace)(unsafe.Pointer(nsPtr)).FexportLookupEpoch = 0
	(*Namespace)(unsafe.Pointer(nsPtr)).Fensembles = uintptr(0)
	(*Namespace)(unsafe.Pointer(nsPtr)).FunknownHandlerPtr = uintptr(0)
	(*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength = 0
	(*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathArray = uintptr(0)
	(*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathSourceList = uintptr(0)
	(*Namespace)(unsafe.Pointer(nsPtr)).FearlyDeleteProc = uintptr(0)

	if !(*(*uintptr)(unsafe.Pointer(bp + 304)) != uintptr(0)) {
		goto __9
	}
	entryPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(XTclGetNamespaceChildTable(tls, *(*uintptr)(unsafe.Pointer(bp + 304 /* parentPtr */))))).FcreateProc})).f(tls, XTclGetNamespaceChildTable(tls, *(*uintptr)(unsafe.Pointer(bp + 304 /* parentPtr */))), *(*uintptr)(unsafe.Pointer(bp + 328 /* simpleName */)), bp+336 /* &newEntry */)
	(*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData = nsPtr
	goto __10
__9:
	// In the global namespace create traces to maintain the ::errorInfo
	// and ::errorCode variables.

	(*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr = nsPtr
	sEstablishErrorInfoTraces(tls, uintptr(0), interp, uintptr(0), uintptr(0), 0)
	sEstablishErrorCodeTraces(tls, uintptr(0), interp, uintptr(0), uintptr(0), 0)
__10:
	;

	// Build the fully qualified name for this namespace.

	XTcl_DStringInit(tls, bp+344)
	XTcl_DStringInit(tls, bp+560)
	namePtr = bp + 344 /* &buffer1 */
	buffPtr = bp + 560 /* &buffer2 */
	ancestorPtr = nsPtr
__11:
	if !(ancestorPtr != uintptr(0)) {
		goto __13
	}
	if !(ancestorPtr != globalNsPtr) {
		goto __14
	}
	tempPtr = namePtr

	XTcl_DStringAppend(tls, buffPtr, ts+6847, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
	XTcl_DStringAppend(tls, buffPtr, (*Namespace)(unsafe.Pointer(ancestorPtr)).Fname, -1)
	XTclDStringAppendDString(tls, buffPtr, namePtr)

	// Clear the unwanted buffer or we end up appending to previous
	// results, making the namespace fullNames of nested namespaces
	// very wrong (and strange).

	XTcl_DStringSetLength(tls, namePtr, 0)

	// Now swap the buffer pointers so that we build in the other
	// buffer. This is faster than repeated copying back and forth
	// between buffers.

	namePtr = buffPtr
	buffPtr = tempPtr
__14:
	;
	goto __12
__12:
	ancestorPtr = (*Namespace)(unsafe.Pointer(ancestorPtr)).FparentPtr
	goto __11
	goto __13
__13:
	;

	name = (*Tcl_DString)(unsafe.Pointer(namePtr)).Fstring
	nameLen = (*Tcl_DString)(unsafe.Pointer(namePtr)).Flength
	(*Namespace)(unsafe.Pointer(nsPtr)).FfullName = XTcl_Alloc(tls, uint32(nameLen+1))
	libc.Xmemcpy(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FfullName, name, uint64(nameLen+1))

	XTcl_DStringFree(tls, bp+344)
	XTcl_DStringFree(tls, bp+560)
	XTcl_DStringFree(tls, bp+88)

	// If compilation of commands originating from the parent NS is
	// suppressed, suppress it for commands originating in this one too.

	if !((*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr != uintptr(0) && (*Namespace1)(unsafe.Pointer((*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr)).Fflags&NS_SUPPRESS_COMPILATION != 0) {
		goto __15
	}
	*(*int32)(unsafe.Pointer(nsPtr + 144)) |= NS_SUPPRESS_COMPILATION
__15:
	;

	// Return a pointer to the new namespace.

	return nsPtr
}

//----------------------------------------------------------------------
//
// Tcl_DeleteNamespace --
//
//	Deletes a namespace and all of the commands, variables, and other
//	namespaces within it.
//
// Results:
//	None.
//
// Side effects:
//	When a namespace is deleted, it is automatically removed as a child of
//	its parent namespace. Also, all its commands, variables and child
//	namespaces are deleted.
//
//----------------------------------------------------------------------

func XTcl_DeleteNamespace(tls *libc.TLS, namespacePtr uintptr) { /* tclNamesp.c:907:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var nsPtr uintptr = namespacePtr
	var iPtr uintptr = (*Namespace)(unsafe.Pointer(nsPtr)).Finterp
	var globalNsPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr
	var entryPtr uintptr
	// var search Tcl_HashSearch at bp, 24

	var cmdPtr uintptr

	// Ensure that this namespace doesn't get deallocated in the meantime.
	(*Namespace)(unsafe.Pointer(nsPtr)).FrefCount++

	// Give anyone interested - notably TclOO - a chance to use this namespace
	// normally despite the fact that the namespace is going to go. Allows the
	// calling of destructors. Will only be called once (unless re-established
	// by the called function). [Bug 2950259]
	//
	// Note that setting this field requires access to the internal definition
	// of namespaces, so it should only be accessed by code that knows about
	// being careful with reentrancy.

	if (*Namespace)(unsafe.Pointer(nsPtr)).FearlyDeleteProc != uintptr(0) {
		var earlyDeleteProc uintptr = (*Namespace)(unsafe.Pointer(nsPtr)).FearlyDeleteProc

		(*Namespace)(unsafe.Pointer(nsPtr)).FearlyDeleteProc = uintptr(0)
		(*Namespace)(unsafe.Pointer(nsPtr)).FactivationCount++
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{earlyDeleteProc})).f(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FclientData)
		(*Namespace)(unsafe.Pointer(nsPtr)).FactivationCount--
	}

	// Delete all coroutine commands now: break the circular ref cycle between
	// the namespace and the coroutine command [Bug 2724403]. This code is
	// essentially duplicated in TclTeardownNamespace() for all other
	// commands. Don't optimize to Tcl_NextHashEntry() because of traces.
	//
	// NOTE: we could avoid traversing the ns's command list by keeping a
	// separate list of coros.

	for entryPtr = XTcl_FirstHashEntry(tls, nsPtr+160, bp); entryPtr != uintptr(0); {
		cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
		if (*Command)(unsafe.Pointer(cmdPtr)).FnreProc == *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclNRInterpCoroutine})) {
			XTcl_DeleteCommandFromToken(tls, iPtr,
				cmdPtr)
			entryPtr = XTcl_FirstHashEntry(tls, nsPtr+160, bp)
		} else {
			entryPtr = XTcl_NextHashEntry(tls, bp)
		}
	}

	// If the namespace has associated ensemble commands, delete them first.
	// This leaves the actual contents of the namespace alone (unless they are
	// linked ensemble commands, of course). Note that this code is actually
	// reentrant so command delete traces won't purturb things badly.

	for (*Namespace)(unsafe.Pointer(nsPtr)).Fensembles != uintptr(0) {
		var ensemblePtr uintptr = (*Namespace)(unsafe.Pointer(nsPtr)).Fensembles

		// Splice out and link to indicate that we've already been killed.

		(*Namespace)(unsafe.Pointer(nsPtr)).Fensembles = (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fnext
		(*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fnext = ensemblePtr
		XTcl_DeleteCommandFromToken(tls, (*Namespace)(unsafe.Pointer(nsPtr)).Finterp, (*EnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken)
	}

	// If the namespace has a registered unknown handler (TIP 181), then free
	// it here.

	if (*Namespace)(unsafe.Pointer(nsPtr)).FunknownHandlerPtr != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Namespace)(unsafe.Pointer(nsPtr)).FunknownHandlerPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Namespace)(unsafe.Pointer(nsPtr)).FunknownHandlerPtr = uintptr(0)
	}

	// If the namespace is on the call frame stack, it is marked as "dying"
	// (NS_DYING is OR'd into its flags): the namespace can't be looked up by
	// name but its commands and variables are still usable by those active
	// call frames. When all active call frames referring to the namespace
	// have been popped from the Tcl stack, Tcl_PopCallFrame will call this
	// function again to delete everything in the namespace. If no nsName
	// objects refer to the namespace (i.e., if its refCount is zero), its
	// commands and variables are deleted and the storage for its namespace
	// structure is freed. Otherwise, if its refCount is nonzero, the
	// namespace's commands and variables are deleted but the structure isn't
	// freed. Instead, NS_DEAD is OR'd into the structure's flags to allow the
	// namespace resolution code to recognize that the namespace is "deleted".
	// The structure's storage is freed by FreeNsNameInternalRep when its
	// refCount reaches 0.

	if (*Namespace)(unsafe.Pointer(nsPtr)).FactivationCount-libc.Bool32(nsPtr == globalNsPtr) > 0 {
		*(*int32)(unsafe.Pointer(nsPtr + 144)) |= NS_DYING
		if (*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr != uintptr(0) {
			entryPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(XTclGetNamespaceChildTable(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr))).FfindProc})).f(tls, XTclGetNamespaceChildTable(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr), (*Namespace)(unsafe.Pointer(nsPtr)).Fname)
			if entryPtr != uintptr(0) {
				XTcl_DeleteHashEntry(tls, entryPtr)
			}
		}
		(*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr = uintptr(0)
	} else if !((*Namespace)(unsafe.Pointer(nsPtr)).Fflags&NS_KILLED != 0) {
		// Delete the namespace and everything in it. If this is the global
		// namespace, then clear it but don't free its storage unless the
		// interpreter is being torn down. Set the NS_KILLED flag to avoid
		// recursive calls here - if the namespace is really in the process of
		// being deleted, ignore any second call.

		*(*int32)(unsafe.Pointer(nsPtr + 144)) |= NS_DYING | NS_KILLED

		XTclTeardownNamespace(tls, nsPtr)

		if nsPtr != globalNsPtr || (*Interp)(unsafe.Pointer(iPtr)).Fflags&DELETED != 0 {
			// If this is the global namespace, then it may have residual
			// "errorInfo" and "errorCode" variables for errors that occurred
			// while it was being torn down. Try to clear the variable list
			// one last time.

			XTclDeleteNamespaceVars(tls, nsPtr)

			XTcl_DeleteHashTable(tls, nsPtr+40)
			XTcl_DeleteHashTable(tls, nsPtr+160)

			*(*int32)(unsafe.Pointer(nsPtr + 144)) |= NS_DEAD
		} else {
			// Restore the ::errorInfo and ::errorCode traces.

			sEstablishErrorInfoTraces(tls, uintptr(0), (*Namespace)(unsafe.Pointer(nsPtr)).Finterp, uintptr(0), uintptr(0), 0)
			sEstablishErrorCodeTraces(tls, uintptr(0), (*Namespace)(unsafe.Pointer(nsPtr)).Finterp, uintptr(0), uintptr(0), 0)

			// We didn't really kill it, so remove the KILLED marks, so it can
			// get killed later, avoiding mem leaks.

			*(*int32)(unsafe.Pointer(nsPtr + 144)) &= libc.CplInt32(NS_DYING | NS_KILLED)
		}
	}
	XTclNsDecrRefCount(tls, nsPtr)
}

func XTclNamespaceDeleted(tls *libc.TLS, nsPtr uintptr) int32 { /* tclNamesp.c:1076:1: */
	if (*Namespace)(unsafe.Pointer(nsPtr)).Fflags&NS_DYING != 0 {
		return 1
	}
	return 0
}

//----------------------------------------------------------------------
//
// TclTeardownNamespace --
//
//	Used internally to dismantle and unlink a namespace when it is
//	deleted. Divorces the namespace from its parent, and deletes all
//	commands, variables, and child namespaces.
//
//	This is kept separate from Tcl_DeleteNamespace so that the global
//	namespace can be handled specially.
//
// Results:
//	None.
//
// Side effects:
//	Removes this namespace from its parent's child namespace hashtable.
//	Deletes all commands, variables and namespaces in this namespace.
//
//----------------------------------------------------------------------

func XTclTeardownNamespace(tls *libc.TLS, nsPtr uintptr) { /* tclNamesp.c:1105:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var iPtr uintptr = (*Namespace)(unsafe.Pointer(nsPtr)).Finterp
	var entryPtr uintptr
	// var search Tcl_HashSearch at bp, 24

	var i int32

	// Start by destroying the namespace's variable table, since variables
	// might trigger traces. Variable table should be cleared but not freed!
	// TclDeleteNamespaceVars frees it, so we reinitialize it afterwards.

	XTclDeleteNamespaceVars(tls, nsPtr)
	XTclInitVarHashTable(tls, nsPtr+248, nsPtr)

	// Delete all commands in this namespace. Be careful when traversing the
	// hash table: when each command is deleted, it removes itself from the
	// command table. Because of traces (and the desire to avoid the quadratic
	// problems of just using Tcl_FirstHashEntry over and over, [Bug
	// f97d4ee020]) we copy to a temporary array and then delete all those
	// commands.

	for (*Namespace)(unsafe.Pointer(nsPtr)).FcmdTable.FnumEntries > 0 {
		var length int32 = (*Namespace)(unsafe.Pointer(nsPtr)).FcmdTable.FnumEntries
		var cmds uintptr = XTclStackAlloc(tls, iPtr,
			int32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(length)))

		i = 0
		for entryPtr = XTcl_FirstHashEntry(tls, nsPtr+160, bp); entryPtr != uintptr(0); entryPtr = XTcl_NextHashEntry(tls, bp) {
			*(*uintptr)(unsafe.Pointer(cmds + uintptr(i)*8)) = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
			(*Command)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cmds + uintptr(i)*8)))).FrefCount++
			i++
		}
		for i = 0; i < length; i++ {
			XTcl_DeleteCommandFromToken(tls, iPtr,
				*(*uintptr)(unsafe.Pointer(cmds + uintptr(i)*8)))
			if libc.PostDecInt32(&(*Command)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cmds + uintptr(i)*8)))).FrefCount, 1) <= 1 {
				XTclpFree(tls, *(*uintptr)(unsafe.Pointer(cmds + uintptr(i)*8)))
			}

		}
		XTclStackFree(tls, iPtr, cmds)
	}
	XTcl_DeleteHashTable(tls, nsPtr+160)
	XTcl_InitHashTable(tls, nsPtr+160, 0)

	// Remove the namespace from its parent's child hashtable.

	if (*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr != uintptr(0) {
		entryPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(XTclGetNamespaceChildTable(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr))).FfindProc})).f(tls, XTclGetNamespaceChildTable(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr), (*Namespace)(unsafe.Pointer(nsPtr)).Fname)
		if entryPtr != uintptr(0) {
			XTcl_DeleteHashEntry(tls, entryPtr)
		}
	}
	(*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr = uintptr(0)

	// Delete the namespace path if one is installed.

	if (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength != 0 {
		sUnlinkNsPath(tls, nsPtr)
		(*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength = 0
	}
	if (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathSourceList != uintptr(0) {
		var nsPathPtr uintptr = (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathSourceList

		for ok := true; ok; ok = nsPathPtr != uintptr(0) {
			if (*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnsPtr != uintptr(0) && (*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FcreatorNsPtr != uintptr(0) {
				(*Namespace)(unsafe.Pointer((*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FcreatorNsPtr)).FcmdRefEpoch++
			}
			(*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnsPtr = uintptr(0)
			nsPathPtr = (*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnextPtr
		}
		(*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathSourceList = uintptr(0)
	}

	// Delete all the child namespaces.
	//
	// BE CAREFUL: When each child is deleted, it will divorce itself from its
	// parent. You can't traverse a hash table properly if its elements are
	// being deleted.  Because of traces (and the desire to avoid the
	// quadratic problems of just using Tcl_FirstHashEntry over and over, [Bug
	// f97d4ee020]) we copy to a temporary array and then delete all those
	// namespaces.
	//
	// Important: leave the hash table itself still live.

	for (*Namespace)(unsafe.Pointer(nsPtr)).FchildTable.FnumEntries > 0 {
		var length int32 = (*Namespace)(unsafe.Pointer(nsPtr)).FchildTable.FnumEntries
		var children uintptr = XTclStackAlloc(tls, iPtr,
			int32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(length)))

		i = 0
		for entryPtr = XTcl_FirstHashEntry(tls, nsPtr+40, bp); entryPtr != uintptr(0); entryPtr = XTcl_NextHashEntry(tls, bp) {
			*(*uintptr)(unsafe.Pointer(children + uintptr(i)*8)) = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
			(*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(children + uintptr(i)*8)))).FrefCount++
			i++
		}
		for i = 0; i < length; i++ {
			XTcl_DeleteNamespace(tls, *(*uintptr)(unsafe.Pointer(children + uintptr(i)*8)))
			XTclNsDecrRefCount(tls, *(*uintptr)(unsafe.Pointer(children + uintptr(i)*8)))
		}
		XTclStackFree(tls, iPtr, children)
	}

	// Free the namespace's export pattern array.

	if (*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr != uintptr(0) {
		for i = 0; i < (*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns; i++ {
			XTclpFree(tls, *(*uintptr)(unsafe.Pointer((*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr + uintptr(i)*8)))
		}
		XTclpFree(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr)
		(*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr = uintptr(0)
		(*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns = 0
		(*Namespace)(unsafe.Pointer(nsPtr)).FmaxExportPatterns = 0
	}

	// Free any client data associated with the namespace.

	if (*Namespace)(unsafe.Pointer(nsPtr)).FdeleteProc != uintptr(0) {
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Namespace)(unsafe.Pointer(nsPtr)).FdeleteProc})).f(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FclientData)
	}
	(*Namespace)(unsafe.Pointer(nsPtr)).FdeleteProc = uintptr(0)
	(*Namespace)(unsafe.Pointer(nsPtr)).FclientData = uintptr(0)

	// Reset the namespace's id field to ensure that this namespace won't be
	// interpreted as valid by, e.g., the cache validation code for cached
	// command references in Tcl_GetCommandFromObj.

	(*Namespace)(unsafe.Pointer(nsPtr)).FnsId = int64(0)
}

//----------------------------------------------------------------------
//
// NamespaceFree --
//
//	Called after a namespace has been deleted, when its reference count
//	reaches 0. Frees the data structure representing the namespace.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sNamespaceFree(tls *libc.TLS, nsPtr uintptr) { /* tclNamesp.c:1298:1: */
	// Most of the namespace's contents are freed when the namespace is
	// deleted by Tcl_DeleteNamespace. All that remains is to free its names
	// (for error messages), and the structure itself.

	XTclpFree(tls, (*Namespace)(unsafe.Pointer(nsPtr)).Fname)
	XTclpFree(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FfullName)
	XTclpFree(tls, nsPtr)
}

//----------------------------------------------------------------------
//
// TclNsDecrRefCount --
//
//	Drops a reference to a namespace and frees it if the namespace has
//	been deleted and the last reference has just been dropped.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclNsDecrRefCount(tls *libc.TLS, nsPtr uintptr) { /* tclNamesp.c:1330:1: */
	(*Namespace)(unsafe.Pointer(nsPtr)).FrefCount--
	if (*Namespace)(unsafe.Pointer(nsPtr)).FrefCount == 0 && (*Namespace)(unsafe.Pointer(nsPtr)).Fflags&NS_DEAD != 0 {
		sNamespaceFree(tls, nsPtr)
	}
}

//----------------------------------------------------------------------
//
// Tcl_Export --
//
//	Makes all the commands matching a pattern available to later be
//	imported from the namespace specified by namespacePtr (or the current
//	namespace if namespacePtr is NULL). The specified pattern is appended
//	onto the namespace's export pattern list, which is optionally cleared
//	beforehand.
//
// Results:
//	Returns TCL_OK if successful, or TCL_ERROR (along with an error
//	message in the interpreter's result) if something goes wrong.
//
// Side effects:
//	Appends the export pattern onto the namespace's export list.
//	Optionally reset the namespace's export pattern list.
//
//----------------------------------------------------------------------

func XTcl_Export(tls *libc.TLS, interp uintptr, namespacePtr uintptr, pattern uintptr, resetListFirst int32) int32 { /* tclNamesp.c:1362:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	var nsPtr uintptr
	// var exportNsPtr uintptr at bp+40, 8

	// var dummyPtr uintptr at bp+48, 8

	var currNsPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	// var simplePattern uintptr at bp+56, 8

	var patternCpy uintptr
	var neededElems int32
	var len int32
	var i int32

	// If the specified namespace is NULL, use the current namespace.

	if namespacePtr == uintptr(0) {
		nsPtr = currNsPtr
	} else {
		nsPtr = namespacePtr
	}

	// If resetListFirst is true (nonzero), clear the namespace's export
	// pattern list.

	if resetListFirst != 0 {
		if (*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr != uintptr(0) {
			for i = 0; i < (*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns; i++ {
				XTclpFree(tls, *(*uintptr)(unsafe.Pointer((*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr + uintptr(i)*8)))
			}
			XTclpFree(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr)
			(*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr = uintptr(0)
			if (*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns != 0 {
				(*Namespace)(unsafe.Pointer(nsPtr)).FexportLookupEpoch++
			}
			if (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength != 0 {
				(*Namespace)(unsafe.Pointer(nsPtr)).FcmdRefEpoch++
			}

			(*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns = 0
			(*Namespace)(unsafe.Pointer(nsPtr)).FmaxExportPatterns = 0
		}
	}

	// Check that the pattern doesn't have namespace qualifiers.

	XTclGetNamespaceForQualName(tls, interp, pattern, nsPtr, TCL_NAMESPACE_ONLY,
		bp+40, bp+48, bp+48, bp+56)

	if *(*uintptr)(unsafe.Pointer(bp + 40)) != nsPtr || libc.Xstrcmp(tls, pattern, *(*uintptr)(unsafe.Pointer(bp + 56))) != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+45951, libc.VaList(bp, pattern)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+46014, ts+10011, uintptr(0)))
		return TCL_ERROR
	}

	// Make sure that we don't already have the pattern in the array

	if (*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr != uintptr(0) {
		for i = 0; i < (*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns; i++ {
			if libc.Xstrcmp(tls, pattern, *(*uintptr)(unsafe.Pointer((*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr + uintptr(i)*8))) == 0 {
				// The pattern already exists in the list.

				return TCL_OK
			}
		}
	}

	// Make sure there is room in the namespace's pattern array for the new
	// pattern.

	neededElems = (*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns + 1
	if neededElems > (*Namespace)(unsafe.Pointer(nsPtr)).FmaxExportPatterns {
		(*Namespace)(unsafe.Pointer(nsPtr)).FmaxExportPatterns = func() int32 {
			if (*Namespace)(unsafe.Pointer(nsPtr)).FmaxExportPatterns != 0 {
				return 2 * (*Namespace)(unsafe.Pointer(nsPtr)).FmaxExportPatterns
			}
			return 5
		}()
		(*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr = XTcl_Realloc(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Namespace)(unsafe.Pointer(nsPtr)).FmaxExportPatterns)))
	}

	// Add the pattern to the namespace's array of export patterns.

	len = int32(libc.Xstrlen(tls, pattern))
	patternCpy = XTcl_Alloc(tls, uint32(len+1))
	libc.Xmemcpy(tls, patternCpy, pattern, uint64(len+1))

	*(*uintptr)(unsafe.Pointer((*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr + uintptr((*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns)*8)) = patternCpy
	(*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns++

	// The list of commands actually exported from the namespace might have
	// changed (probably will have!) However, we do not need to recompute this
	// just yet; next time we need the info will be soon enough.

	if (*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns != 0 {
		(*Namespace)(unsafe.Pointer(nsPtr)).FexportLookupEpoch++
	}
	if (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength != 0 {
		(*Namespace)(unsafe.Pointer(nsPtr)).FcmdRefEpoch++
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_AppendExportList --
//
//	Appends onto the argument object the list of export patterns for the
//	specified namespace.
//
// Results:
//	The return value is normally TCL_OK; in this case the object
//	referenced by objPtr has each export pattern appended to it. If an
//	error occurs, TCL_ERROR is returned and the interpreter's result holds
//	an error message.
//
// Side effects:
//	If necessary, the object referenced by objPtr is converted into a list
//	object.
//
//----------------------------------------------------------------------

func XTcl_AppendExportList(tls *libc.TLS, interp uintptr, namespacePtr uintptr, objPtr uintptr) int32 { /* tclNamesp.c:1497:1: */
	var nsPtr uintptr
	var i int32
	var result int32

	// If the specified namespace is NULL, use the current namespace.

	if namespacePtr == uintptr(0) {
		nsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	} else {
		nsPtr = namespacePtr
	}

	// Append the export pattern list onto objPtr.

	for i = 0; i < (*Namespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns; i++ {
		result = XTcl_ListObjAppendElement(tls, interp, objPtr,
			XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer((*Namespace)(unsafe.Pointer(nsPtr)).FexportArrayPtr + uintptr(i)*8)), -1))
		if result != TCL_OK {
			return result
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_Import --
//
//	Imports all of the commands matching a pattern into the namespace
//	specified by namespacePtr (or the current namespace if contextNsPtr is
//	NULL). This is done by creating a new command (the "imported command")
//	that points to the real command in its original namespace.
//
//	If matching commands are on the autoload path but haven't been loaded
//	yet, this command forces them to be loaded, then creates the links to
//	them.
//
// Results:
//	Returns TCL_OK if successful, or TCL_ERROR (along with an error
//	message in the interpreter's result) if something goes wrong.
//
// Side effects:
//	Creates new commands in the importing namespace. These indirect calls
//	back to the real command and are deleted if the real commands are
//	deleted.
//
//----------------------------------------------------------------------

func XTcl_Import(tls *libc.TLS, interp uintptr, namespacePtr uintptr, pattern uintptr, allowOverwrite int32) int32 { /* tclNamesp.c:1559:1: */
	bp := tls.Alloc(232)
	defer tls.Free(232)

	var nsPtr uintptr
	// var importNsPtr uintptr at bp+184, 8

	// var dummyPtr uintptr at bp+192, 8

	// var simplePattern uintptr at bp+200, 8

	var hPtr uintptr
	// var search Tcl_HashSearch at bp+208, 24

	// If the specified namespace is NULL, use the current namespace.

	if namespacePtr == uintptr(0) {
		nsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	} else {
		nsPtr = namespacePtr
	}

	// First, invoke the "auto_import" command with the pattern being
	// imported. This command is part of the Tcl library. It looks for
	// imported commands in autoloaded libraries and loads them in. That way,
	// they will be found when we try to create links below.
	//
	// Note that we don't just call Tcl_EvalObjv() directly because we do not
	// want absence of the command to be a failure case.

	if XTcl_FindCommand(tls, interp, ts+46021, uintptr(0), TCL_GLOBAL_ONLY) != uintptr(0) {
		// var objv [2]uintptr at bp+168, 16

		var result int32

		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 168)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 168)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)))).Fbytes, ts+46021, uint64(int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)))).Fbytes + 11)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)))).Flength = int32(uint64(unsafe.Sizeof([12]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)))).FtypePtr = uintptr(0)
			{
			}
		}
		*(*uintptr)(unsafe.Pointer(bp + 168 + 1*8)) = XTcl_NewStringObj(tls, pattern, -1)

		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)))).FrefCount++
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168 + 1*8)))).FrefCount++
		result = XTcl_EvalObjv(tls, interp, 2, bp+168, TCL_GLOBAL_ONLY)
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 168))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 168 + 1*8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}

		if result != TCL_OK {
			return TCL_ERROR
		}
		XTcl_ResetResult(tls, interp)
	}

	// From the pattern, find the namespace from which we are importing and
	// get the simple pattern (no namespace qualifiers or ::'s) at the end.

	if libc.Xstrlen(tls, pattern) == uint64(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+46033, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+46054, ts+19736, uintptr(0)))
		return TCL_ERROR
	}
	XTclGetNamespaceForQualName(tls, interp, pattern, nsPtr, TCL_NAMESPACE_ONLY,
		bp+184, bp+192, bp+192, bp+200)

	if *(*uintptr)(unsafe.Pointer(bp + 184)) == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+46061, libc.VaList(bp+32, pattern)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7170, ts+9231, pattern, uintptr(0)))
		return TCL_ERROR
	}
	if *(*uintptr)(unsafe.Pointer(bp + 184)) == nsPtr {
		if pattern == *(*uintptr)(unsafe.Pointer(bp + 200)) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+46102,
				libc.VaList(bp+80, pattern)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, ts+3593, ts+46054, ts+46148, uintptr(0)))
		} else {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

				ts+46155, libc.VaList(bp+120, pattern, (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 184 /* importNsPtr */)))).Fname)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+136, ts+3593, ts+46054, ts+43453, uintptr(0)))
		}
		return TCL_ERROR
	}

	// Scan through the command table in the source namespace and look for
	// exported commands that match the string pattern. Create an "imported
	// command" in the current namespace for each imported command; these
	// commands redirect their invocations to the "real" command.

	if *(*uintptr)(unsafe.Pointer(bp + 200)) != uintptr(0) && libc.Xstrpbrk(tls, *(*uintptr)(unsafe.Pointer(bp + 200)), ts+13556) == uintptr(0) {
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 184 /* importNsPtr */)) + 160 /* &.cmdTable */)).FfindProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 184 /* importNsPtr */))+160 /* &.cmdTable */, *(*uintptr)(unsafe.Pointer(bp + 200 /* simplePattern */)))
		if hPtr == uintptr(0) {
			return TCL_OK
		}
		return sDoImport(tls, interp, nsPtr, hPtr, *(*uintptr)(unsafe.Pointer(bp + 200 /* simplePattern */)), pattern,
			*(*uintptr)(unsafe.Pointer(bp + 184 /* importNsPtr */)), allowOverwrite)
	}
	for hPtr = XTcl_FirstHashEntry(tls, *(*uintptr)(unsafe.Pointer(bp + 184))+160, bp+208); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp+208) {
		var cmdName uintptr = func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 184))+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 184))+160)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(hPtr + 32))
			}
			return hPtr + 32
		}()

		if XTcl_StringMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp + 200))) != 0 && sDoImport(tls, interp, nsPtr, hPtr, cmdName, pattern, *(*uintptr)(unsafe.Pointer(bp + 184)),
			allowOverwrite) == TCL_ERROR {
			return TCL_ERROR
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// DoImport --
//
//	Import a particular command from one namespace into another. Helper
//	for Tcl_Import().
//
// Results:
//	Standard Tcl result code. If TCL_ERROR, appends an error message to
//	the interpreter result.
//
// Side effects:
//	A new command is created in the target namespace unless this is a
//	reimport of exactly the same command as before.
//
//----------------------------------------------------------------------

func sDoImport(tls *libc.TLS, interp uintptr, nsPtr uintptr, hPtr uintptr, cmdName uintptr, pattern uintptr, importNsPtr uintptr, allowOverwrite int32) int32 { /* tclNamesp.c:1699:1: */
	bp := tls.Alloc(304)
	defer tls.Free(304)

	var i int32 = 0
	var exported int32 = 0
	var found uintptr

	// The command cmdName in the source namespace matches the pattern. Check
	// whether it was exported. If it wasn't, we ignore it.

	for !(exported != 0) && i < (*Namespace)(unsafe.Pointer(importNsPtr)).FnumExportPatterns {
		exported = exported | XTcl_StringMatch(tls, cmdName,
			*(*uintptr)(unsafe.Pointer((*Namespace)(unsafe.Pointer(importNsPtr)).FexportArrayPtr + uintptr(libc.PostIncInt32(&i, 1))*8)))
	}
	if !(exported != 0) {
		return TCL_OK
	}

	// Unless there is a name clash, create an imported command in the current
	// namespace that refers to cmdPtr.

	found = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(nsPtr + 160 /* &.cmdTable */)).FfindProc})).f(tls, nsPtr+160 /* &.cmdTable */, cmdName)
	if found == uintptr(0) || allowOverwrite != 0 {
		// Create the imported command and its client data. To create the new
		// command in the current namespace, generate a fully qualified name
		// for it.

		// var ds Tcl_DString at bp+88, 216

		var importedCmd Tcl_Command
		var dataPtr uintptr
		var cmdPtr uintptr
		var refPtr uintptr

		XTcl_DStringInit(tls, bp+88)
		XTcl_DStringAppend(tls, bp+88, (*Namespace)(unsafe.Pointer(nsPtr)).FfullName, -1)
		if nsPtr != (*Interp)(unsafe.Pointer(interp)).FglobalNsPtr {
			XTcl_DStringAppend(tls, bp+88, ts+6847, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
		}
		XTcl_DStringAppend(tls, bp+88, cmdName, -1)

		// Check whether creating the new imported command in the current
		// namespace would create a cycle of imported command references.

		cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		if found != uintptr(0) && (*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc == *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteImportedCmd})) {
			var overwrite uintptr = (*Tcl_HashEntry)(unsafe.Pointer(found)).FclientData
			var linkCmd uintptr = cmdPtr

			for (*Command)(unsafe.Pointer(linkCmd)).FdeleteProc == *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteImportedCmd})) {
				dataPtr = (*Command)(unsafe.Pointer(linkCmd)).FobjClientData
				linkCmd = (*ImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr
				if overwrite == linkCmd {
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

						ts+46223,
						libc.VaList(bp, pattern, (*Tcl_DString)(unsafe.Pointer(bp+88)).Fstring)))
					XTcl_DStringFree(tls, bp+88)
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+46054, ts+46287, uintptr(0)))
					return TCL_ERROR
				}
			}
		}

		dataPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ImportedCmdData{})))
		importedCmd = XTcl_NRCreateCommand(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp+88)).Fstring,
			*(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
			}{sInvokeImportedCmd})), *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
			}{sInvokeImportedNRCmd})), dataPtr,
			*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteImportedCmd})))
		(*ImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr = cmdPtr
		(*ImportedCmdData)(unsafe.Pointer(dataPtr)).FselfPtr = importedCmd
		(*Command1)(unsafe.Pointer((*ImportedCmdData)(unsafe.Pointer(dataPtr)).FselfPtr)).FcompileProc = (*Command)(unsafe.Pointer(cmdPtr)).FcompileProc
		XTcl_DStringFree(tls, bp+88)

		// Create an ImportRef structure describing this new import command
		// and add it to the import ref list in the "real" command.

		refPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ImportRef{})))
		(*ImportRef)(unsafe.Pointer(refPtr)).FimportedCmdPtr = importedCmd
		(*ImportRef)(unsafe.Pointer(refPtr)).FnextPtr = (*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr
		(*Command)(unsafe.Pointer(cmdPtr)).FimportRefPtr = refPtr
	} else {
		var overwrite uintptr = (*Tcl_HashEntry)(unsafe.Pointer(found)).FclientData

		if (*Command)(unsafe.Pointer(overwrite)).FdeleteProc == *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteImportedCmd})) {
			var dataPtr uintptr = (*Command)(unsafe.Pointer(overwrite)).FobjClientData

			if (*ImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr == (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData {
				// Repeated import of same command is acceptable.

				return TCL_OK
			}
		}
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+46292, libc.VaList(bp+48, cmdName)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+3593, ts+46054, ts+46334, uintptr(0)))
		return TCL_ERROR
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ForgetImport --
//
//	Deletes commands previously imported into the namespace indicated.
//	The by namespacePtr, or the current namespace of interp, when
//	namespacePtr is NULL. The pattern controls which imported commands are
//	deleted. A simple pattern, one without namespace separators, matches
//	the current command names of imported commands in the namespace.
//	Matching imported commands are deleted. A qualified pattern is
//	interpreted as deletion selection on the basis of where the command is
//	imported from. The original command and "first link" command for each
//	imported command are determined, and they are matched against the
//	pattern. A match leads to deletion of the imported command.
//
// Results:
//	Returns TCL_ERROR and records an error message in the interp result if
//	a namespace qualified pattern refers to a namespace that does not
//	exist. Otherwise, returns TCL_OK.
//
// Side effects:
//	May delete commands.
//
//----------------------------------------------------------------------

func XTcl_ForgetImport(tls *libc.TLS, interp uintptr, namespacePtr uintptr, pattern uintptr) int32 { /* tclNamesp.c:1843:1: */
	bp := tls.Alloc(160)
	defer tls.Free(160)

	var nsPtr uintptr
	// var sourceNsPtr uintptr at bp+48, 8

	// var dummyPtr uintptr at bp+56, 8

	// var simplePattern uintptr at bp+64, 8

	var cmdName uintptr
	var hPtr uintptr
	// var search Tcl_HashSearch at bp+72, 24

	// If the specified namespace is NULL, use the current namespace.

	if namespacePtr == uintptr(0) {
		nsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	} else {
		nsPtr = namespacePtr
	}

	// Parse the pattern into its namespace-qualification (if any) and the
	// simple pattern.

	XTclGetNamespaceForQualName(tls, interp, pattern, nsPtr, TCL_NAMESPACE_ONLY,
		bp+48, bp+56, bp+56, bp+64)

	if *(*uintptr)(unsafe.Pointer(bp + 48)) == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+46344,
			libc.VaList(bp, pattern)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+9231, pattern, uintptr(0)))
		return TCL_ERROR
	}

	if libc.Xstrcmp(tls, pattern, *(*uintptr)(unsafe.Pointer(bp + 64))) == 0 {
		// The pattern is simple. Delete any imported commands that match it.

		if libc.Xstrpbrk(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), ts+13556) == uintptr(0) {
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(nsPtr + 160 /* &.cmdTable */)).FfindProc})).f(tls, nsPtr+160 /* &.cmdTable */, *(*uintptr)(unsafe.Pointer(bp + 64 /* simplePattern */)))
			if hPtr != uintptr(0) {
				var cmdPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

				if cmdPtr != 0 && (*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc == *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteImportedCmd})) {
					XTcl_DeleteCommandFromToken(tls, interp, cmdPtr)
				}
			}
			return TCL_OK
		}
		for hPtr = XTcl_FirstHashEntry(tls, nsPtr+160, bp+72); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp+72) {
			var cmdPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

			if (*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc != *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteImportedCmd})) {
				continue
			}
			cmdName = func() uintptr {
				if (*Tcl_HashTable)(unsafe.Pointer(nsPtr+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(nsPtr+160)).FkeyType == -1 {
					return *(*uintptr)(unsafe.Pointer(hPtr + 32))
				}
				return hPtr + 32
			}()
			if XTcl_StringMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp + 64))) != 0 {
				XTcl_DeleteCommandFromToken(tls, interp, cmdPtr)
			}
		}
		return TCL_OK
	}

	// The pattern was namespace-qualified.

	for hPtr = XTcl_FirstHashEntry(tls, nsPtr+160, bp+72); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp+72) {
		// var info Tcl_CmdInfo at bp+96, 64

		var token Tcl_Command = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		var origin Tcl_Command = XTclGetOriginalCommand(tls, token)

		if XTcl_GetCommandInfoFromToken(tls, origin, bp+96) == 0 {
			continue // Not an imported command.
		}
		if (*Tcl_CmdInfo)(unsafe.Pointer(bp+96)).FnamespacePtr != *(*uintptr)(unsafe.Pointer(bp + 48)) {
			// Original not in namespace we're matching. Check the first link
			// in the import chain.

			var cmdPtr uintptr = token
			var dataPtr uintptr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
			var firstToken Tcl_Command = (*ImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr

			if firstToken == origin {
				continue
			}
			XTcl_GetCommandInfoFromToken(tls, firstToken, bp+96)
			if (*Tcl_CmdInfo)(unsafe.Pointer(bp+96)).FnamespacePtr != *(*uintptr)(unsafe.Pointer(bp + 48)) {
				continue
			}
			origin = firstToken
		}
		if XTcl_StringMatch(tls, XTcl_GetCommandName(tls, uintptr(0), origin), *(*uintptr)(unsafe.Pointer(bp + 64))) != 0 {
			XTcl_DeleteCommandFromToken(tls, interp, token)
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclGetOriginalCommand --
//
//	An imported command is created in an namespace when a "real" command
//	is imported from another namespace. If the specified command is an
//	imported command, this function returns the original command it refers
//	to.
//
// Results:
//	If the command was imported into a sequence of namespaces a, b,...,n
//	where each successive namespace just imports the command from the
//	previous namespace, this function returns the Tcl_Command token in the
//	first namespace, a. Otherwise, if the specified command is not an
//	imported command, the function returns NULL.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetOriginalCommand(tls *libc.TLS, command Tcl_Command) Tcl_Command { /* tclNamesp.c:1977:1: */
	var cmdPtr uintptr = command
	var dataPtr uintptr

	if (*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc != *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteImportedCmd})) {
		return uintptr(0)
	}

	for (*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc == *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteImportedCmd})) {
		dataPtr = (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
		cmdPtr = (*ImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr
	}
	return cmdPtr
}

//----------------------------------------------------------------------
//
// InvokeImportedCmd --
//
//	Invoked by Tcl whenever the user calls an imported command that was
//	created by Tcl_Import. Finds the "real" command (in another
//	namespace), and passes control to it.
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Returns a result in the interpreter's result object. If anything goes
//	wrong, the result object is set to an error message.
//
//----------------------------------------------------------------------

func sInvokeImportedNRCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:2015:1: */
	var dataPtr uintptr = clientData
	var realCmdPtr uintptr = (*ImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr

	XTclSkipTailcall(tls, interp)
	return XTclNREvalObjv(tls, interp, objc, objv, TCL_EVAL_NOERR, realCmdPtr)
}

func sInvokeImportedCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:2030:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sInvokeImportedNRCmd})), clientData,
		objc, objv)
}

//----------------------------------------------------------------------
//
// DeleteImportedCmd --
//
//	Invoked by Tcl whenever an imported command is deleted. The "real"
//	command keeps a list of all the imported commands that refer to it, so
//	those imported commands can be deleted when the real command is
//	deleted. This function removes the imported command reference from the
//	real command's list, and frees up the memory associated with the
//	imported command.
//
// Results:
//	None.
//
// Side effects:
//	Removes the imported command from the real command's import list.
//
//----------------------------------------------------------------------

func sDeleteImportedCmd(tls *libc.TLS, clientData ClientData) { /* tclNamesp.c:2063:1: */
	var dataPtr uintptr = clientData
	var realCmdPtr uintptr = (*ImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr
	var selfPtr uintptr = (*ImportedCmdData)(unsafe.Pointer(dataPtr)).FselfPtr
	var refPtr uintptr
	var prevPtr uintptr

	prevPtr = uintptr(0)
	for refPtr = (*Command)(unsafe.Pointer(realCmdPtr)).FimportRefPtr; refPtr != uintptr(0); refPtr = (*ImportRef)(unsafe.Pointer(refPtr)).FnextPtr {
		if (*ImportRef)(unsafe.Pointer(refPtr)).FimportedCmdPtr == selfPtr {
			// Remove *refPtr from real command's list of imported commands
			// that refer to it.

			if prevPtr == uintptr(0) { // refPtr is first in list.
				(*Command)(unsafe.Pointer(realCmdPtr)).FimportRefPtr = (*ImportRef)(unsafe.Pointer(refPtr)).FnextPtr
			} else {
				(*ImportRef)(unsafe.Pointer(prevPtr)).FnextPtr = (*ImportRef)(unsafe.Pointer(refPtr)).FnextPtr
			}
			XTclpFree(tls, refPtr)
			XTclpFree(tls, dataPtr)
			return
		}
		prevPtr = refPtr
	}

	XTcl_Panic(tls, ts+46395, 0)
}

//----------------------------------------------------------------------
//
// TclGetNamespaceForQualName --
//
//	Given a qualified name specifying a command, variable, or namespace,
//	and a namespace in which to resolve the name, this function returns a
//	pointer to the namespace that contains the item. A qualified name
//	consists of the "simple" name of an item qualified by the names of an
//	arbitrary number of containing namespace separated by "::"s. If the
//	qualified name starts with "::", it is interpreted absolutely from the
//	global namespace. Otherwise, it is interpreted relative to the
//	namespace specified by cxtNsPtr if it is non-NULL. If cxtNsPtr is
//	NULL, the name is interpreted relative to the current namespace.
//
//	A relative name like "foo::bar::x" can be found starting in either the
//	current namespace or in the global namespace. So each search usually
//	follows two tracks, and two possible namespaces are returned. If the
//	function sets either *nsPtrPtr or *altNsPtrPtr to NULL, then that path
//	failed.
//
//	If "flags" contains TCL_GLOBAL_ONLY, the relative qualified name is
//	sought only in the global :: namespace. The alternate search (also)
//	starting from the global namespace is ignored and *altNsPtrPtr is set
//	NULL.
//
//	If "flags" contains TCL_NAMESPACE_ONLY, the relative qualified name is
//	sought only in the namespace specified by cxtNsPtr. The alternate
//	search starting from the global namespace is ignored and *altNsPtrPtr
//	is set NULL. If both TCL_GLOBAL_ONLY and TCL_NAMESPACE_ONLY are
//	specified, TCL_GLOBAL_ONLY is ignored and the search starts from the
//	namespace specified by cxtNsPtr.
//
//	If "flags" contains TCL_CREATE_NS_IF_UNKNOWN, all namespace components
//	of the qualified name that cannot be found are automatically created
//	within their specified parent. This makes sure that functions like
//	Tcl_CreateCommand always succeed. There is no alternate search path,
//	so *altNsPtrPtr is set NULL.
//
//	If "flags" contains TCL_FIND_ONLY_NS, the qualified name is treated as
//	a reference to a namespace, and the entire qualified name is followed.
//	If the name is relative, the namespace is looked up only in the
//	current namespace. A pointer to the namespace is stored in *nsPtrPtr
//	and NULL is stored in *simpleNamePtr. Otherwise, if TCL_FIND_ONLY_NS
//	is not specified, only the leading components are treated as namespace
//	names, and a pointer to the simple name of the final component is
//	stored in *simpleNamePtr.
//
// Results:
//	It sets *nsPtrPtr and *altNsPtrPtr to point to the two possible
//	namespaces which represent the last (containing) namespace in the
//	qualified name. If the function sets either *nsPtrPtr or *altNsPtrPtr
//	to NULL, then the search along that path failed. The function also
//	stores a pointer to the simple name of the final component in
//	*simpleNamePtr. If the qualified name is "::" or was treated as a
//	namespace reference (TCL_FIND_ONLY_NS), the function stores a pointer
//	to the namespace in *nsPtrPtr, NULL in *altNsPtrPtr, and sets
//	*simpleNamePtr to point to an empty string.
//
//	If there is an error, this function returns TCL_ERROR. If "flags"
//	contains TCL_LEAVE_ERR_MSG, an error message is returned in the
//	interpreter's result object. Otherwise, the interpreter's result
//	object is left unchanged.
//
//	*actualCxtPtrPtr is set to the actual context namespace. It is set to
//	the input context namespace pointer in cxtNsPtr. If cxtNsPtr is NULL,
//	it is set to the current namespace context.
//
//	For backwards compatibility with the TclPro byte code loader, this
//	function always returns TCL_OK.
//
// Side effects:
//	If "flags" contains TCL_CREATE_NS_IF_UNKNOWN, new namespaces may be
//	created.
//
//----------------------------------------------------------------------

func XTclGetNamespaceForQualName(tls *libc.TLS, interp uintptr, qualName uintptr, cxtNsPtr uintptr, flags int32, nsPtrPtr uintptr, altNsPtrPtr uintptr, actualCxtPtrPtr uintptr, simpleNamePtr uintptr) int32 { /* tclNamesp.c:2175:1: */
	bp := tls.Alloc(232)
	defer tls.Free(232)

	var iPtr uintptr = interp
	var nsPtr uintptr = cxtNsPtr
	var altNsPtr uintptr
	var globalNsPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr
	var start uintptr
	var end uintptr
	var nsName uintptr
	var entryPtr uintptr
	// var buffer Tcl_DString at bp+8, 216

	var len int32

	// Determine the context namespace nsPtr in which to start the primary
	// search. If the qualName name starts with a "::" or TCL_GLOBAL_ONLY was
	// specified, search from the global namespace. Otherwise, use the
	// namespace given in cxtNsPtr, or if that is NULL, use the current
	// namespace context. Note that we always treat two or more adjacent ":"s
	// as a namespace separator.

	if flags&TCL_GLOBAL_ONLY != 0 {
		nsPtr = globalNsPtr
	} else if nsPtr == uintptr(0) {
		nsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr
	}

	start = qualName // Points to start of qualifying
	// namespace.
	if int32(*(*int8)(unsafe.Pointer(qualName))) == ':' && int32(*(*int8)(unsafe.Pointer(qualName + uintptr(1)))) == ':' {
		start = qualName + uintptr(2) // Skip over the initial ::
		for int32(*(*int8)(unsafe.Pointer(start))) == ':' {
			start++ // Skip over a subsequent :
		}
		nsPtr = globalNsPtr
		if int32(*(*int8)(unsafe.Pointer(start))) == 0 { // qualName is just two or more
			// ":"s.
			*(*uintptr)(unsafe.Pointer(nsPtrPtr)) = globalNsPtr
			*(*uintptr)(unsafe.Pointer(altNsPtrPtr)) = uintptr(0)
			*(*uintptr)(unsafe.Pointer(actualCxtPtrPtr)) = globalNsPtr
			*(*uintptr)(unsafe.Pointer(simpleNamePtr)) = start // Points to empty string.
			return TCL_OK
		}
	}
	*(*uintptr)(unsafe.Pointer(actualCxtPtrPtr)) = nsPtr

	// Start an alternate search path starting with the global namespace.
	// However, if the starting context is the global namespace, or if the
	// flag is set to search only the namespace *cxtNsPtr, ignore the
	// alternate search path.

	altNsPtr = globalNsPtr
	if nsPtr == globalNsPtr ||
		flags&(TCL_NAMESPACE_ONLY|TCL_FIND_ONLY_NS) != 0 {
		altNsPtr = uintptr(0)
	}

	// Loop to resolve each namespace qualifier in qualName.

	XTcl_DStringInit(tls, bp+8)
	end = start
	for int32(*(*int8)(unsafe.Pointer(start))) != 0 {
		// Find the next namespace qualifier (i.e., a name ending in "::") or
		// the end of the qualified name (i.e., a name ending in "\0"). Set
		// len to the number of characters, starting from start, in the name;
		// set end to point after the "::"s or at the "\0".

		len = 0
		for end = start; int32(*(*int8)(unsafe.Pointer(end))) != 0; end++ {
			if int32(*(*int8)(unsafe.Pointer(end))) == ':' && int32(*(*int8)(unsafe.Pointer(end + uintptr(1)))) == ':' {
				end += uintptr(2) // Skip over the initial ::
				for int32(*(*int8)(unsafe.Pointer(end))) == ':' {
					end++ // Skip over the subsequent :
				}
				break // Exit for loop; end is after ::'s
			}
			len++
		}

		if int32(*(*int8)(unsafe.Pointer(end))) == 0 && !((int64(end)-int64(start))/1 >= int64(2) && int32(*(*int8)(unsafe.Pointer(end - uintptr(1)))) == ':' && int32(*(*int8)(unsafe.Pointer(end - uintptr(2)))) == ':') {
			// qualName ended with a simple name at start. If TCL_FIND_ONLY_NS
			// was specified, look this up as a namespace. Otherwise, start is
			// the name of a cmd or var and we are done.

			if flags&TCL_FIND_ONLY_NS != 0 {
				nsName = start
			} else {
				*(*uintptr)(unsafe.Pointer(nsPtrPtr)) = nsPtr
				*(*uintptr)(unsafe.Pointer(altNsPtrPtr)) = altNsPtr
				*(*uintptr)(unsafe.Pointer(simpleNamePtr)) = start
				XTcl_DStringFree(tls, bp+8)
				return TCL_OK
			}
		} else {
			// start points to the beginning of a namespace qualifier ending
			// in "::". end points to the start of a name in that namespace
			// that might be empty. Copy the namespace qualifier to a buffer
			// so it can be null terminated. We can't modify the incoming
			// qualName since it may be a string constant.

			XTcl_DStringSetLength(tls, bp+8, 0)
			XTcl_DStringAppend(tls, bp+8, start, len)
			nsName = (*Tcl_DString)(unsafe.Pointer(bp + 8)).Fstring
		}

		// Look up the namespace qualifier nsName in the current namespace
		// context. If it isn't found but TCL_CREATE_NS_IF_UNKNOWN is set,
		// create that qualifying namespace. This is needed for functions like
		// Tcl_CreateCommand that cannot fail.

		if nsPtr != uintptr(0) {
			entryPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(nsPtr + 40 /* &.childTable */)).FfindProc})).f(tls, nsPtr+40 /* &.childTable */, nsName)
			if entryPtr != uintptr(0) {
				nsPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
			} else if flags&TCL_CREATE_NS_IF_UNKNOWN != 0 {
				// var framePtr uintptr at bp+224, 8

				XTclPushStackFrame(tls, interp, bp+224,
					nsPtr /*isProcCallFrame*/, 0)

				nsPtr = XTcl_CreateNamespace(tls, interp, nsName, uintptr(0), uintptr(0))
				XTclPopStackFrame(tls, interp)

				if nsPtr == uintptr(0) {
					XTcl_Panic(tls, ts+46471, libc.VaList(bp, nsName))
				}
			} else { // Namespace not found and was not
				// created.
				nsPtr = uintptr(0)
			}
		}

		// Look up the namespace qualifier in the alternate search path too.

		if altNsPtr != uintptr(0) {
			entryPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(altNsPtr + 40 /* &.childTable */)).FfindProc})).f(tls, altNsPtr+40 /* &.childTable */, nsName)
			if entryPtr != uintptr(0) {
				altNsPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
			} else {
				altNsPtr = uintptr(0)
			}
		}

		// If both search paths have failed, return NULL results.

		if nsPtr == uintptr(0) && altNsPtr == uintptr(0) {
			*(*uintptr)(unsafe.Pointer(nsPtrPtr)) = uintptr(0)
			*(*uintptr)(unsafe.Pointer(altNsPtrPtr)) = uintptr(0)
			*(*uintptr)(unsafe.Pointer(simpleNamePtr)) = uintptr(0)
			XTcl_DStringFree(tls, bp+8)
			return TCL_OK
		}

		start = end
	}

	// We ignore trailing "::"s in a namespace name, but in a command or
	// variable name, trailing "::"s refer to the cmd or var named {}.

	if flags&TCL_FIND_ONLY_NS != 0 || end > start && int32(*(*int8)(unsafe.Pointer(end - uintptr(1)))) != ':' {
		*(*uintptr)(unsafe.Pointer(simpleNamePtr)) = uintptr(0) // Found namespace name.
	} else {
		*(*uintptr)(unsafe.Pointer(simpleNamePtr)) = end // Found cmd/var: points to empty
		// string.
	}

	// As a special case, if we are looking for a namespace and qualName is ""
	// and the current active namespace (nsPtr) is not the global namespace,
	// return NULL (no namespace was found). This is because namespaces can
	// not have empty names except for the global namespace.

	if flags&TCL_FIND_ONLY_NS != 0 && int32(*(*int8)(unsafe.Pointer(qualName))) == 0 &&
		nsPtr != globalNsPtr {
		nsPtr = uintptr(0)
	}

	*(*uintptr)(unsafe.Pointer(nsPtrPtr)) = nsPtr
	*(*uintptr)(unsafe.Pointer(altNsPtrPtr)) = altNsPtr
	XTcl_DStringFree(tls, bp+8)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclEnsureNamespace --
//
//	Provide a namespace that is not deleted.
//
// Value
//
//	namespacePtr, if it is not scheduled for deletion, or a pointer to a
//	new namespace with the same name otherwise.
//
// Effect
//	None.
//
//----------------------------------------------------------------------
func XTclEnsureNamespace(tls *libc.TLS, interp uintptr, namespacePtr uintptr) uintptr { /* tclNamesp.c:2446:15: */
	var nsPtr uintptr = namespacePtr
	if !((*Namespace)(unsafe.Pointer(nsPtr)).Fflags&NS_DYING != 0) {
		return namespacePtr
	}
	return XTcl_CreateNamespace(tls, interp, (*Namespace)(unsafe.Pointer(nsPtr)).FfullName, uintptr(0), uintptr(0))
}

//----------------------------------------------------------------------
//
// Tcl_FindNamespace --
//
//	Searches for a namespace.
//
// Results:
//	Returns a pointer to the namespace if it is found. Otherwise, returns
//	NULL and leaves an error message in the interpreter's result object if
//	"flags" contains TCL_LEAVE_ERR_MSG.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_FindNamespace(tls *libc.TLS, interp uintptr, name uintptr, contextNsPtr uintptr, flags int32) uintptr { /* tclNamesp.c:2476:15: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	// var nsPtr uintptr at bp+48, 8

	// var dummy1Ptr uintptr at bp+56, 8

	// var dummy2Ptr uintptr at bp+64, 8

	// var dummy uintptr at bp+72, 8

	// Find the namespace(s) that contain the specified namespace name. Add
	// the TCL_FIND_ONLY_NS flag to resolve the name all the way down to its
	// last component, a namespace.

	XTclGetNamespaceForQualName(tls, interp, name, contextNsPtr,
		flags|TCL_FIND_ONLY_NS, bp+48, bp+56, bp+64, bp+72)

	if *(*uintptr)(unsafe.Pointer(bp + 48)) != uintptr(0) {
		return *(*uintptr)(unsafe.Pointer(bp + 48 /* nsPtr */))
	}

	if flags&TCL_LEAVE_ERR_MSG != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+46503, libc.VaList(bp, name)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+9231, name, uintptr(0)))
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_FindCommand --
//
//	Searches for a command.
//
// Results:
//	Returns a token for the command if it is found. Otherwise, if it can't
//	be found or there is an error, returns NULL and leaves an error
//	message in the interpreter's result object if "flags" contains
//	TCL_LEAVE_ERR_MSG.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_FindCommand(tls *libc.TLS, interp uintptr, name uintptr, contextNsPtr uintptr, flags int32) Tcl_Command { /* tclNamesp.c:2538:1: */
	bp := tls.Alloc(104)
	defer tls.Free(104)

	var iPtr uintptr = interp
	// var cxtNsPtr uintptr at bp+96, 8

	var entryPtr uintptr
	var cmdPtr uintptr
	// var simpleName uintptr at bp+72, 8

	var result int32

	// If this namespace has a command resolver, then give it first crack at
	// the command resolution. If the interpreter has any command resolvers,
	// consult them next. The command resolver functions may return a
	// Tcl_Command value, they may signal to continue onward, or they may
	// signal an error.

	if flags&TCL_GLOBAL_ONLY != 0 || !(libc.Xstrncmp(tls, name, ts+6847, uint64(2)) != 0) {
		*(*uintptr)(unsafe.Pointer(bp + 96 /* cxtNsPtr */)) = (*Interp)(unsafe.Pointer(interp)).FglobalNsPtr
	} else if contextNsPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(bp + 96 /* cxtNsPtr */)) = contextNsPtr
	} else {
		*(*uintptr)(unsafe.Pointer(bp + 96 /* cxtNsPtr */)) = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	}

	if (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FcmdResProc != uintptr(0) || (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr != uintptr(0) {
		var resPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr
		// var cmd Tcl_Command at bp+48, 8

		if (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FcmdResProc != 0 {
			result = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
			})(unsafe.Pointer(&struct{ uintptr }{(*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* cxtNsPtr */)))).FcmdResProc})).f(tls, interp, name,
				*(*uintptr)(unsafe.Pointer(bp + 96 /* cxtNsPtr */)), flags, bp+48)
		} else {
			result = TCL_CONTINUE
		}

		for result == TCL_CONTINUE && resPtr != 0 {
			if (*ResolverScheme)(unsafe.Pointer(resPtr)).FcmdResProc != 0 {
				result = (*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
				})(unsafe.Pointer(&struct{ uintptr }{(*ResolverScheme)(unsafe.Pointer(resPtr)).FcmdResProc})).f(tls, interp, name,
					*(*uintptr)(unsafe.Pointer(bp + 96 /* cxtNsPtr */)), flags, bp+48 /* &cmd */)
			}
			resPtr = (*ResolverScheme)(unsafe.Pointer(resPtr)).FnextPtr
		}

		if result == TCL_OK {
			*(*int32)(unsafe.Pointer(*(*Tcl_Command)(unsafe.Pointer(bp + 48)) + 80)) |= CMD_VIA_RESOLVER
			return *(*Tcl_Command)(unsafe.Pointer(bp + 48 /* cmd */))

		} else if result != TCL_CONTINUE {
			return uintptr(0)
		}
	}

	// Find the namespace(s) that contain the command.

	cmdPtr = uintptr(0)
	if (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FcommandPathLength != 0 && libc.Xstrncmp(tls, name, ts+6847, uint64(2)) != 0 &&
		!(flags&TCL_NAMESPACE_ONLY != 0) {
		var i int32
		var pathNsPtr uintptr
		// var realNsPtr uintptr at bp+56, 8

		// var dummyNsPtr uintptr at bp+64, 8

		XTclGetNamespaceForQualName(tls, interp, name, *(*uintptr)(unsafe.Pointer(bp + 96 /* cxtNsPtr */)),
			TCL_NAMESPACE_ONLY, bp+56, bp+64, bp+64,
			bp+72)
		if *(*uintptr)(unsafe.Pointer(bp + 56)) != uintptr(0) && *(*uintptr)(unsafe.Pointer(bp + 72)) != uintptr(0) {
			if *(*uintptr)(unsafe.Pointer(bp + 96)) == *(*uintptr)(unsafe.Pointer(bp + 56)) ||
				!((*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56)))).Fflags&NS_DYING != 0) {
				entryPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* realNsPtr */)) + 160 /* &.cmdTable */)).FfindProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* realNsPtr */))+160 /* &.cmdTable */, *(*uintptr)(unsafe.Pointer(bp + 72 /* simpleName */)))
				if entryPtr != uintptr(0) {
					cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
				}
			}
		}

		// Next, check along the path.

		for i = 0; i < (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* cxtNsPtr */)))).FcommandPathLength && cmdPtr == uintptr(0); i++ {
			pathNsPtr = (*NamespacePathEntry)(unsafe.Pointer((*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* cxtNsPtr */)))).FcommandPathArray + uintptr(i)*32)).FnsPtr
			if pathNsPtr == uintptr(0) {
				continue
			}
			XTclGetNamespaceForQualName(tls, interp, name, pathNsPtr,
				TCL_NAMESPACE_ONLY, bp+56, bp+64, bp+64,
				bp+72)
			if *(*uintptr)(unsafe.Pointer(bp + 56)) != uintptr(0) && *(*uintptr)(unsafe.Pointer(bp + 72)) != uintptr(0) &&
				!((*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56)))).Fflags&NS_DYING != 0) {
				entryPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* realNsPtr */)) + 160 /* &.cmdTable */)).FfindProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* realNsPtr */))+160 /* &.cmdTable */, *(*uintptr)(unsafe.Pointer(bp + 72 /* simpleName */)))
				if entryPtr != uintptr(0) {
					cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
				}
			}
		}

		// If we've still not found the command, look in the global namespace
		// as a last resort.

		if cmdPtr == uintptr(0) {
			XTclGetNamespaceForQualName(tls, interp, name, uintptr(0),
				TCL_GLOBAL_ONLY, bp+56, bp+64, bp+64,
				bp+72)
			if *(*uintptr)(unsafe.Pointer(bp + 56)) != uintptr(0) && *(*uintptr)(unsafe.Pointer(bp + 72)) != uintptr(0) &&
				!((*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56)))).Fflags&NS_DYING != 0) {
				entryPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* realNsPtr */)) + 160 /* &.cmdTable */)).FfindProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* realNsPtr */))+160 /* &.cmdTable */, *(*uintptr)(unsafe.Pointer(bp + 72 /* simpleName */)))
				if entryPtr != uintptr(0) {
					cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
				}
			}
		}
	} else {
		// var nsPtr [2]uintptr at bp+80, 16

		var search int32

		XTclGetNamespaceForQualName(tls, interp, name, *(*uintptr)(unsafe.Pointer(bp + 96 /* cxtNsPtr */)),
			flags, bp+80, bp+80+1*8, bp+96, bp+72)

		// Look for the command in the command table of its namespace. Be sure
		// to check both possible search paths: from the specified namespace
		// context and from the global namespace.

		for search = 0; search < 2 && cmdPtr == uintptr(0); search++ {
			if *(*uintptr)(unsafe.Pointer(bp + 80 + uintptr(search)*8)) != uintptr(0) && *(*uintptr)(unsafe.Pointer(bp + 72)) != uintptr(0) {
				entryPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &nsPtr[0] */ + uintptr(search)*8)) + 160 /* &.cmdTable */)).FfindProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* &nsPtr[0] */ + uintptr(search)*8))+160 /* &.cmdTable */, *(*uintptr)(unsafe.Pointer(bp + 72 /* simpleName */)))
				if entryPtr != uintptr(0) {
					cmdPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
				}
			}
		}
	}

	if cmdPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(cmdPtr + 80)) &= libc.CplInt32(CMD_VIA_RESOLVER)
		return cmdPtr
	}

	if flags&TCL_LEAVE_ERR_MSG != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+46526, libc.VaList(bp, name)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+7328, name, uintptr(0)))
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// TclResetShadowedCmdRefs --
//
//	Called when a command is added to a namespace to check for existing
//	command references that the new command may invalidate. Consider the
//	following cases that could happen when you add a command "foo" to a
//	namespace "b":
//	   1. It could shadow a command named "foo" at the global scope. If
//	      it does, all command references in the namespace "b" are
//	      suspect.
//	   2. Suppose the namespace "b" resides in a namespace "a". Then to
//	      "a" the new command "b::foo" could shadow another command
//	      "b::foo" in the global namespace. If so, then all command
//	      references in "a" * are suspect.
//	The same checks are applied to all parent namespaces, until we reach
//	the global :: namespace.
//
// Results:
//	None.
//
// Side effects:
//	If the new command shadows an existing command, the cmdRefEpoch
//	counter is incremented in each namespace that sees the shadow. This
//	invalidates all command references that were previously cached in that
//	namespace. The next time the commands are used, they are resolved from
//	scratch.
//
//----------------------------------------------------------------------

func XTclResetShadowedCmdRefs(tls *libc.TLS, interp uintptr, newCmdPtr uintptr) { /* tclNamesp.c:2741:1: */
	var cmdName uintptr
	var hPtr uintptr
	var nsPtr uintptr
	var trailNsPtr uintptr
	var shadowNsPtr uintptr
	var globalNsPtr uintptr = (*Interp)(unsafe.Pointer(interp)).FglobalNsPtr
	var found int32
	var i int32
	var trailFront int32 = -1
	var trailSize int32 = 5 // Formerly NUM_TRAIL_ELEMS.
	var trailPtr uintptr = XTclStackAlloc(tls, interp,
		int32(uint64(trailSize)*uint64(unsafe.Sizeof(uintptr(0)))))

	// Start at the namespace containing the new command, and work up through
	// the list of parents. Stop just before the global namespace, since the
	// global namespace can't "shadow" its own entries.
	//
	// The namespace "trail" list we build consists of the names of each
	// namespace that encloses the new command, in order from outermost to
	// innermost: for example, "a" then "b". Each iteration of this loop
	// eventually extends the trail upwards by one namespace, nsPtr. We use
	// this trail list to see if nsPtr (e.g. "a" in 2. above) could have
	// now-invalid cached command references. This will happen if nsPtr
	// (e.g. "a") contains a sequence of child namespaces (e.g. "b") such that
	// there is a identically-named sequence of child namespaces starting from
	// :: (e.g. "::b") whose tail namespace contains a command also named
	// cmdName.

	cmdName = func() uintptr {
		if (*Tcl_HashTable)(unsafe.Pointer((*Tcl_HashEntry)(unsafe.Pointer((*Command)(unsafe.Pointer(newCmdPtr)).FhPtr)).FtablePtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Tcl_HashEntry)(unsafe.Pointer((*Command)(unsafe.Pointer(newCmdPtr)).FhPtr)).FtablePtr)).FkeyType == -1 {
			return *(*uintptr)(unsafe.Pointer((*Command)(unsafe.Pointer(newCmdPtr)).FhPtr + 32))
		}
		return (*Command)(unsafe.Pointer(newCmdPtr)).FhPtr + 32
	}()
	for nsPtr = (*Command)(unsafe.Pointer(newCmdPtr)).FnsPtr; nsPtr != uintptr(0) && nsPtr != globalNsPtr; nsPtr = (*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr {
		// Find the maximal sequence of child namespaces contained in nsPtr
		// such that there is a identically-named sequence of child namespaces
		// starting from ::. shadowNsPtr will be the tail of this sequence, or
		// the deepest namespace under :: that might contain a command now
		// shadowed by cmdName. We check below if shadowNsPtr actually
		// contains a command cmdName.

		found = 1
		shadowNsPtr = globalNsPtr

		for i = trailFront; i >= 0; i-- {
			trailNsPtr = *(*uintptr)(unsafe.Pointer(trailPtr + uintptr(i)*8))
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(shadowNsPtr + 40 /* &.childTable */)).FfindProc})).f(tls, shadowNsPtr+40 /* &.childTable */, (*Namespace)(unsafe.Pointer(trailNsPtr)).Fname)
			if hPtr != uintptr(0) {
				shadowNsPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
			} else {
				found = 0
				break
			}
		}

		// If shadowNsPtr contains a command named cmdName, we invalidate all
		// of the command refs cached in nsPtr. As a boundary case,
		// shadowNsPtr is initially :: and we check for case 1. above.

		if found != 0 {
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(shadowNsPtr + 160 /* &.cmdTable */)).FfindProc})).f(tls, shadowNsPtr+160 /* &.cmdTable */, cmdName)
			if hPtr != uintptr(0) {
				(*Namespace)(unsafe.Pointer(nsPtr)).FcmdRefEpoch++
				XTclInvalidateNsPath(tls, nsPtr)

				// If the shadowed command was compiled to bytecodes, we
				// invalidate all the bytecodes in nsPtr, to force a new
				// compilation. We use the resolverEpoch to signal the need
				// for a fresh compilation of every bytecode.

				if (*Command)(unsafe.Pointer((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)).FcompileProc != uintptr(0) {
					(*Namespace)(unsafe.Pointer(nsPtr)).FresolverEpoch++
				}
			}
		}

		// Insert nsPtr at the front of the trail list: i.e., at the end of
		// the trailPtr array.

		trailFront++
		if trailFront == trailSize {
			var newSize int32 = 2 * trailSize

			trailPtr = XTclStackRealloc(tls, interp, trailPtr,
				int32(uint64(newSize)*uint64(unsafe.Sizeof(uintptr(0)))))
			trailSize = newSize
		}
		*(*uintptr)(unsafe.Pointer(trailPtr + uintptr(trailFront)*8)) = nsPtr
	}
	XTclStackFree(tls, interp, trailPtr)
}

//----------------------------------------------------------------------
//
// TclGetNamespaceFromObj, GetNamespaceFromObj --
//
//	Gets the namespace specified by the name in a Tcl_Obj.
//
// Results:
//	Returns TCL_OK if the namespace was resolved successfully, and stores
//	a pointer to the namespace in the location specified by nsPtrPtr. If
//	the namespace can't be found, or anything else goes wrong, this
//	function returns TCL_ERROR and writes an error message to interp,
//	if non-NULL.
//
// Side effects:
//	May update the internal representation for the object, caching the
//	namespace reference. The next time this function is called, the
//	namespace value can be found quickly.
//
//----------------------------------------------------------------------

func XTclGetNamespaceFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, nsPtrPtr uintptr) int32 { /* tclNamesp.c:2875:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	if sGetNamespaceFromObj(tls, interp, objPtr, nsPtrPtr) == TCL_ERROR {
		var name uintptr = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}
			return XTcl_GetString(tls, objPtr)
		}()

		if int32(*(*int8)(unsafe.Pointer(name))) == ':' && int32(*(*int8)(unsafe.Pointer(name + 1))) == ':' {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+46547, libc.VaList(bp, name)))
		} else {
			// Get the current namespace name.

			sNamespaceCurrentCmd(tls, uintptr(0), interp, 1, uintptr(0))
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+46572, libc.VaList(bp+8, name,
					XTcl_GetStringResult(tls, interp))))
		}
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+3593, ts+7170, ts+9231, name, uintptr(0)))
		return TCL_ERROR
	}
	return TCL_OK
}

func sGetNamespaceFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, nsPtrPtr uintptr) int32 { /* tclNamesp.c:2904:1: */
	var resNamePtr uintptr
	var nsPtr uintptr
	var refNsPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&nsNameType)) {
		// Check that the ResolvedNsName is still valid; avoid letting the ref
		// cross interps.

		resNamePtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		nsPtr = (*ResolvedNsName)(unsafe.Pointer(resNamePtr)).FnsPtr
		refNsPtr = (*ResolvedNsName)(unsafe.Pointer(resNamePtr)).FrefNsPtr
		if !((*Namespace)(unsafe.Pointer(nsPtr)).Fflags&NS_DYING != 0) && interp == (*Namespace)(unsafe.Pointer(nsPtr)).Finterp && (!(refNsPtr != 0) || interp == (*Namespace)(unsafe.Pointer(refNsPtr)).Finterp && refNsPtr == XTcl_GetCurrentNamespace(tls, interp)) {
			*(*uintptr)(unsafe.Pointer(nsPtrPtr)) = nsPtr
			return TCL_OK
		}
	}
	if sSetNsNameFromAny(tls, interp, objPtr) == TCL_OK {
		resNamePtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		*(*uintptr)(unsafe.Pointer(nsPtrPtr)) = (*ResolvedNsName)(unsafe.Pointer(resNamePtr)).FnsPtr
		return TCL_OK
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclInitNamespaceCmd --
//
//	This function is called to create the "namespace" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	Handle for the namespace command, or NULL on failure.
//
// Side effects:
//	none
//
//----------------------------------------------------------------------

func XTclInitNamespaceCmd(tls *libc.TLS, interp uintptr) Tcl_Command { /* tclNamesp.c:2955:1: */
	return XTclMakeEnsemble(tls, interp, ts+18781, uintptr(unsafe.Pointer(&defaultNamespaceMap)))
}

//----------------------------------------------------------------------
//
// NamespaceChildrenCmd --
//
//	Invoked to implement the "namespace children" command that returns a
//	list containing the fully-qualified names of the child namespaces of a
//	given namespace. Handles the following syntax:
//
//	    namespace children ?name? ?pattern?
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Returns a result in the interpreter's result object. If anything goes
//	wrong, the result is an error message.
//
//----------------------------------------------------------------------

func sNamespaceChildrenCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:2983:1: */
	bp := tls.Alloc(248)
	defer tls.Free(248)

	// var namespacePtr uintptr at bp, 8

	var nsPtr uintptr
	var childNsPtr uintptr
	var globalNsPtr uintptr
	var pattern uintptr
	// var buffer Tcl_DString at bp+8, 216

	var entryPtr uintptr
	// var search Tcl_HashSearch at bp+224, 24

	var listPtr uintptr
	var elemPtr uintptr
	var name uintptr
	var length uint32
	globalNsPtr = (*Interp)(unsafe.Pointer(interp)).FglobalNsPtr
	pattern = uintptr(0)

	// Get a pointer to the specified namespace, or the current namespace.

	if !(objc == 1) {
		goto __1
	}
	nsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	goto __2
__1:
	if !(objc == 2 || objc == 3) {
		goto __3
	}
	if !(XTclGetNamespaceFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK) {
		goto __5
	}
	return TCL_ERROR
__5:
	;
	nsPtr = *(*uintptr)(unsafe.Pointer(bp /* namespacePtr */))
	goto __4
__3:
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+46605)
	return TCL_ERROR
__4:
	;
__2:
	;

	// Get the glob-style pattern, if any, used to narrow the search.

	XTcl_DStringInit(tls, bp+8)
	if !(objc == 3) {
		goto __6
	}
	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()

	if !(int32(*(*int8)(unsafe.Pointer(name))) == ':' && int32(*(*int8)(unsafe.Pointer(name + uintptr(1)))) == ':') {
		goto __7
	}
	pattern = name
	goto __8
__7:
	XTcl_DStringAppend(tls, bp+8, (*Namespace)(unsafe.Pointer(nsPtr)).FfullName, -1)
	if !(nsPtr != globalNsPtr) {
		goto __9
	}
	XTcl_DStringAppend(tls, bp+8, ts+6847, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
__9:
	;
	XTcl_DStringAppend(tls, bp+8, name, -1)
	pattern = (*Tcl_DString)(unsafe.Pointer(bp + 8)).Fstring
__8:
	;
__6:
	;

	// Create a list containing the full names of all child namespaces whose
	// names match the specified pattern, if any.

	listPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	if !(pattern != uintptr(0) && libc.Xstrpbrk(tls, pattern, ts+13556) == uintptr(0)) {
		goto __10
	}
	length = uint32(libc.Xstrlen(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FfullName))

	if !(libc.Xstrncmp(tls, pattern, (*Namespace)(unsafe.Pointer(nsPtr)).FfullName, uint64(length)) != 0) {
		goto __11
	}
	goto searchDone
__11:
	;
	if !((*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(nsPtr + 40)).FfindProc})).f(tls, nsPtr+40, pattern+uintptr(length)) != uintptr(0)) {
		goto __12
	}
	XTcl_ListObjAppendElement(tls, interp, listPtr,
		XTcl_NewStringObj(tls, pattern, -1))
__12:
	;
	goto searchDone
__10:
	;
	entryPtr = XTcl_FirstHashEntry(tls, nsPtr+40, bp+224)
__13:
	if !(entryPtr != uintptr(0)) {
		goto __14
	}
	childNsPtr = (*Tcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData
	if !(pattern == uintptr(0) ||
		XTcl_StringMatch(tls, (*Namespace)(unsafe.Pointer(childNsPtr)).FfullName, pattern) != 0) {
		goto __15
	}
	elemPtr = XTcl_NewStringObj(tls, (*Namespace)(unsafe.Pointer(childNsPtr)).FfullName, -1)
	XTcl_ListObjAppendElement(tls, interp, listPtr, elemPtr)
__15:
	;
	entryPtr = XTcl_NextHashEntry(tls, bp+224)
	goto __13
__14:
	;

searchDone:
	XTcl_SetObjResult(tls, interp, listPtr)
	XTcl_DStringFree(tls, bp+8)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceCodeCmd --
//
//	Invoked to implement the "namespace code" command to capture the
//	namespace context of a command. Handles the following syntax:
//
//	    namespace code arg
//
//	Here "arg" can be a list. "namespace code arg" produces a result
//	equivalent to that produced by the command
//
//	    list ::namespace inscope [namespace current] $arg
//
//	However, if "arg" is itself a scoped value starting with "::namespace
//	inscope", then the result is just "arg".
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	If anything goes wrong, this function returns an error message as the
//	result in the interpreter's result object.
//
//----------------------------------------------------------------------

func sNamespaceCodeCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3112:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var currNsPtr uintptr
	var listPtr uintptr
	var objPtr uintptr
	var arg uintptr
	// var length int32 at bp, 4

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25077)
		return TCL_ERROR
	}

	//
	//  If "arg" is already a scoped value, then return it directly.
	//  Take care to only check for scoping in precisely the style that
	//  [::namespace code] generates it.  Anything more forgiving can have
	//  the effect of failing in namespaces that contain their own custom
	//      " "namespace" command.  [Bug 3202171].
	//

	arg = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	}()
	if int32(*(*int8)(unsafe.Pointer(arg))) == ':' && *(*int32)(unsafe.Pointer(bp)) > 20 &&
		libc.Xstrncmp(tls, arg, ts+18723, uint64(20)) == 0 {
		XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		return TCL_OK
	}

	// Otherwise, construct a scoped command by building a list with
	// "namespace inscope", the full name of the current namespace, and the
	// argument "arg". By constructing a list, we ensure that scoped commands
	// are interpreted properly when they are executed later, by the
	// "namespace inscope" command.

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			listPtr = XTclThreadAllocObj(tls)
		} else {
			listPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr = uintptr(0)
	{
	}

	for ok1 := true; ok1; ok1 = 0 != 0 {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				objPtr = XTclThreadAllocObj(tls)
			} else {
				objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, ts+18744, uint64(int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + 11)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = int32(uint64(unsafe.Sizeof([12]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		{
		}
	}
	XTcl_ListObjAppendElement(tls, interp, listPtr, objPtr)
	for ok3 := true; ok3; ok3 = 0 != 0 {
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				objPtr = XTclThreadAllocObj(tls)
			} else {
				objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, ts+18756, uint64(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + 7)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = int32(uint64(unsafe.Sizeof([8]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		{
		}
	}
	XTcl_ListObjAppendElement(tls, interp, listPtr, objPtr)

	currNsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	if currNsPtr == (*Interp)(unsafe.Pointer(interp)).FglobalNsPtr {
		for ok5 := true; ok5; ok5 = 0 != 0 {
			for ok6 := true; ok6; ok6 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					objPtr = XTclThreadAllocObj(tls)
				} else {
					objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, ts+6847, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + 2)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
			{
			}
		}
	} else {
		objPtr = XTcl_NewStringObj(tls, (*Namespace)(unsafe.Pointer(currNsPtr)).FfullName, -1)
	}
	XTcl_ListObjAppendElement(tls, interp, listPtr, objPtr)

	XTcl_ListObjAppendElement(tls, interp, listPtr, *(*uintptr)(unsafe.Pointer(objv + 1*8)))

	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceCurrentCmd --
//
//	Invoked to implement the "namespace current" command which returns the
//	fully-qualified name of the current namespace. Handles the following
//	syntax:
//
//	    namespace current
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Returns a result in the interpreter's result object. If anything goes
//	wrong, the result is an error message.
//
//----------------------------------------------------------------------

func sNamespaceCurrentCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3193:1: */
	var currNsPtr uintptr

	if objc != 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, uintptr(0))
		return TCL_ERROR
	}

	// The "real" name of the global namespace ("::") is the null string, but
	// we return "::" for it as a convenience to programmers. Note that "" and
	// "::" are treated as synonyms by the namespace code so that it is still
	// easy to do things like:
	//
	//    namespace [namespace current]::bar { ... }

	currNsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	if currNsPtr == (*Interp)(unsafe.Pointer(interp)).FglobalNsPtr {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+6847, 2))
	} else {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, (*Namespace)(unsafe.Pointer(currNsPtr)).FfullName, -1))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceDeleteCmd --
//
//	Invoked to implement the "namespace delete" command to delete
//	namespace(s). Handles the following syntax:
//
//	    namespace delete ?name name...?
//
//	Each name identifies a namespace. It may include a sequence of
//	namespace qualifiers separated by "::"s. If a namespace is found, it
//	is deleted: all variables and procedures contained in that namespace
//	are deleted. If that namespace is being used on the call stack, it is
//	kept alive (but logically deleted) until it is removed from the call
//	stack: that is, it can no longer be referenced by name but any
//	currently executing procedure that refers to it is allowed to do so
//	until the procedure returns. If the namespace can't be found, this
//	function returns an error. If no namespaces are specified, this
//	command does nothing.
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Deletes the specified namespaces. If anything goes wrong, this
//	function returns an error message in the interpreter's result object.
//
//----------------------------------------------------------------------

func sNamespaceDeleteCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3256:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var namespacePtr uintptr
	var name uintptr
	var i int32

	if objc < 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+46622)
		return TCL_ERROR
	}

	// Destroying one namespace may cause another to be destroyed. Break this
	// into two passes: first check to make sure that all namespaces on the
	// command line are valid, and report any errors.

	for i = 1; i < objc; i++ {
		name = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		}()
		namespacePtr = XTcl_FindNamespace(tls, interp, name, uintptr(0), 0)
		if namespacePtr == uintptr(0) ||
			(*Namespace)(unsafe.Pointer(namespacePtr)).Fflags&NS_KILLED != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+46637,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
				}())))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+9231,
				func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
				}(), uintptr(0)))
			return TCL_ERROR
		}
	}

	// Okay, now delete each namespace.

	for i = 1; i < objc; i++ {
		name = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		}()
		namespacePtr = XTcl_FindNamespace(tls, interp, name, uintptr(0), 0)
		if namespacePtr != 0 {
			XTcl_DeleteNamespace(tls, namespacePtr)
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceEvalCmd --
//
//	Invoked to implement the "namespace eval" command. Executes commands
//	in a namespace. If the namespace does not already exist, it is
//	created. Handles the following syntax:
//
//	    namespace eval name arg ?arg...?
//
//	If more than one arg argument is specified, the command that is
//	executed is the result of concatenating the arguments together with a
//	space between each argument.
//
// Results:
//	Returns TCL_OK if the namespace is found and the commands are executed
//	successfully. Returns TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Returns the result of the command in the interpreter's result object.
//	If anything goes wrong, this function returns an error message as the
//	result.
//
//----------------------------------------------------------------------

func sNamespaceEvalCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3333:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNRNamespaceEvalCmd})), clientData, objc,
		objv)
}

func sNRNamespaceEvalCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3344:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var iPtr uintptr = interp
	// var invoker uintptr at bp+16, 8

	// var word int32 at bp+24, 4

	// var namespacePtr uintptr at bp, 8

	// var framePtr uintptr at bp+8, 8

	var framePtrPtr uintptr
	var objPtr uintptr
	var result int32

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+46688)
		return TCL_ERROR
	}

	// Try to resolve the namespace reference, caching the result in the
	// namespace object along the way.

	result = sGetNamespaceFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)

	// If the namespace wasn't found, try to create it.

	if result == TCL_ERROR {
		var name uintptr = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}()

		*(*uintptr)(unsafe.Pointer(bp /* namespacePtr */)) = XTcl_CreateNamespace(tls, interp, name, uintptr(0), uintptr(0))
		if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
			return TCL_ERROR
		}
	}

	// Make the specified namespace the current namespace and evaluate the
	// command(s).

	// This is needed to satisfy GCC 3.3's strict aliasing rules
	framePtrPtr = bp + 8 /* &framePtr */
	XTclPushStackFrame(tls, interp, framePtrPtr,
		*(*uintptr)(unsafe.Pointer(bp /* namespacePtr */)) /*isProcCallFrame*/, 0)

	(*CallFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* framePtr */)))).Fobjv = XTclFetchEnsembleRoot(tls, interp, objv, objc, *(*uintptr)(unsafe.Pointer(bp + 8))+12)

	if objc == 3 {
		// TIP #280: Make actual argument location available to eval'd script.

		objPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8))
		*(*uintptr)(unsafe.Pointer(bp + 16 /* invoker */)) = (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr
		*(*int32)(unsafe.Pointer(bp + 24 /* word */)) = 3
		XTclArgumentGet(tls, interp, objPtr, bp+16, bp+24)
	} else {
		// More than one argument: concatenate them together with spaces
		// between, then evaluate the result. Tcl_EvalObjEx will delete the
		// object when it decrements its refcount after eval'ing it.

		objPtr = XTcl_ConcatObj(tls, objc-2, objv+uintptr(2)*8)
		*(*uintptr)(unsafe.Pointer(bp + 16 /* invoker */)) = uintptr(0)
		*(*int32)(unsafe.Pointer(bp + 24 /* word */)) = 0
	}

	// TIP #280: Make invoking context available to eval'd script.

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sNsEval_Callback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = *(*uintptr)(unsafe.Pointer(bp))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = ts + 2409
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return XTclNREvalObjEx(tls, interp, objPtr, 0, *(*uintptr)(unsafe.Pointer(bp + 16 /* invoker */)), *(*int32)(unsafe.Pointer(bp + 24 /* word */)))
}

func sNsEval_Callback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclNamesp.c:3426:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var namespacePtr uintptr = *(*ClientData)(unsafe.Pointer(data))

	if result == TCL_ERROR {
		var length int32 = int32(libc.Xstrlen(tls, (*Tcl_Namespace)(unsafe.Pointer(namespacePtr)).FfullName))
		var limit int32 = 200
		var overflow int32 = libc.Bool32(length > limit)
		var cmd uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))

		XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
			ts+46706,
			libc.VaList(bp, cmd,
				func() int32 {
					if overflow != 0 {
						return limit
					}
					return length
				}(), (*Tcl_Namespace)(unsafe.Pointer(namespacePtr)).FfullName,
				func() uintptr {
					if overflow != 0 {
						return ts + 7891 /* "..." */
					}
					return ts + 2046 /* "" */
				}(), XTcl_GetErrorLine(tls, interp))))
	}

	// Restore the previous "current" namespace.

	XTclPopStackFrame(tls, interp)
	return result
}

//----------------------------------------------------------------------
//
// NamespaceExistsCmd --
//
//	Invoked to implement the "namespace exists" command that returns true
//	if the given namespace currently exists, and false otherwise. Handles
//	the following syntax:
//
//	    namespace exists name
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Returns a result in the interpreter's result object. If anything goes
//	wrong, the result is an error message.
//
//----------------------------------------------------------------------

func sNamespaceExistsCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3476:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var namespacePtr uintptr at bp, 8

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(libc.Bool32(sGetNamespaceFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) == TCL_OK) != 0)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceExportCmd --
//
//	Invoked to implement the "namespace export" command that specifies
//	which commands are exported from a namespace. The exported commands
//	are those that can be imported into another namespace using "namespace
//	import". Both commands defined in a namespace and commands the
//	namespace has imported can be exported by a namespace. This command
//	has the following syntax:
//
//	    namespace export ?-clear? ?pattern pattern...?
//
//	Each pattern may contain "string match"-style pattern matching special
//	characters, but the pattern may not include any namespace qualifiers:
//	that is, the pattern must specify commands in the current (exporting)
//	namespace. The specified patterns are appended onto the namespace's
//	list of export patterns.
//
//	To reset the namespace's export pattern list, specify the "-clear"
//	flag.
//
//	If there are no export patterns and the "-clear" flag isn't given,
//	this command returns the namespace's current export list.
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Returns a result in the interpreter's result object. If anything goes
//	wrong, the result is an error message.
//
//----------------------------------------------------------------------

func sNamespaceExportCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3531:1: */
	var firstArg int32
	var i int32

	if objc < 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+46753)
		return TCL_ERROR
	}

	// If no pattern arguments are given, and "-clear" isn't specified, return
	// the namespace's current export pattern list.

	if objc == 1 {
		var listPtr uintptr

		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				listPtr = XTclThreadAllocObj(tls)
			} else {
				listPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(listPtr)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr = uintptr(0)
		{
		}

		XTcl_AppendExportList(tls, interp, uintptr(0), listPtr)
		XTcl_SetObjResult(tls, interp, listPtr)
		return TCL_OK
	}

	// Process the optional "-clear" argument.

	firstArg = 1
	if libc.Xstrcmp(tls, ts+46783, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(firstArg)*8)))) == 0 {
		XTcl_Export(tls, interp, uintptr(0), ts+6847, 1)
		XTcl_ResetResult(tls, interp)
		firstArg++
	}

	// Add each pattern to the namespace's export pattern list.

	for i = firstArg; i < objc; i++ {
		var result int32 = XTcl_Export(tls, interp, uintptr(0), XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))), 0)
		if result != TCL_OK {
			return result
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceForgetCmd --
//
//	Invoked to implement the "namespace forget" command to remove imported
//	commands from a namespace. Handles the following syntax:
//
//	    namespace forget ?pattern pattern...?
//
//	Each pattern is a name like "foo::*" or "a::b::x*". That is, the
//	pattern may include the special pattern matching characters recognized
//	by the "string match" command, but only in the command name at the end
//	of the qualified name; the special pattern characters may not appear
//	in a namespace name. All of the commands that match that pattern are
//	checked to see if they have an imported command in the current
//	namespace that refers to the matched command. If there is an alias, it
//	is removed.
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Imported commands are removed from the current namespace. If anything
//	goes wrong, this function returns an error message in the
//	interpreter's result object.
//
//----------------------------------------------------------------------

func sNamespaceForgetCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3613:1: */
	var pattern uintptr
	var i int32
	var result int32

	if objc < 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+46790)
		return TCL_ERROR
	}

	for i = 1; i < objc; i++ {
		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		}()
		result = XTcl_ForgetImport(tls, interp, uintptr(0), pattern)
		if result != TCL_OK {
			return result
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceImportCmd --
//
//	Invoked to implement the "namespace import" command that imports
//	commands into a namespace. Handles the following syntax:
//
//	    namespace import ?-force? ?pattern pattern...?
//
//	Each pattern is a namespace-qualified name like "foo::*", "a::b::x*",
//	or "bar::p". That is, the pattern may include the special pattern
//	matching characters recognized by the "string match" command, but only
//	in the command name at the end of the qualified name; the special
//	pattern characters may not appear in a namespace name. All of the
//	commands that match the pattern and which are exported from their
//	namespace are made accessible from the current namespace context. This
//	is done by creating a new "imported command" in the current namespace
//	that points to the real command in its original namespace; when the
//	imported command is called, it invokes the real command.
//
//	If an imported command conflicts with an existing command, it is
//	treated as an error. But if the "-force" option is included, then
//	existing commands are overwritten by the imported commands.
//
//	If there are no pattern arguments and the "-force" flag isn't given,
//	this command returns the list of commands currently imported in
//	the current namespace.
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Adds imported commands to the current namespace. If anything goes
//	wrong, this function returns an error message in the interpreter's
//	result object.
//
//----------------------------------------------------------------------

func sNamespaceImportCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3678:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var allowOverwrite int32 = 0
	var string uintptr
	var pattern uintptr
	var i int32
	var result int32
	var firstArg int32

	if objc < 1 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+46811)
		return TCL_ERROR
	}

	// Skip over the optional "-force" as the first argument.

	firstArg = 1
	if firstArg < objc {
		string = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(firstArg)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(firstArg)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(firstArg)*8)))
		}()
		if int32(*(*int8)(unsafe.Pointer(string))) == '-' && libc.Xstrcmp(tls, string, ts+30201) == 0 {
			allowOverwrite = 1
			firstArg++
		}
	} else {
		// When objc == 1, command is just [namespace import]. Introspection
		// form to return list of imported commands.

		var hPtr uintptr
		// var search Tcl_HashSearch at bp, 24

		var nsPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
		var listPtr uintptr

		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				listPtr = XTclThreadAllocObj(tls)
			} else {
				listPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(listPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(listPtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(listPtr)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr = uintptr(0)
		{
		}

		for hPtr = XTcl_FirstHashEntry(tls, nsPtr+160, bp); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
			var cmdPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

			if (*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc == *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeleteImportedCmd})) {
				XTcl_ListObjAppendElement(tls, uintptr(0), listPtr, XTcl_NewStringObj(tls,
					func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer(nsPtr+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(nsPtr+160)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}(), -1))
			}
		}
		XTcl_SetObjResult(tls, interp, listPtr)
		return TCL_OK
	}

	// Handle the imports for each of the patterns.

	for i = firstArg; i < objc; i++ {
		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		}()
		result = XTcl_Import(tls, interp, uintptr(0), pattern, allowOverwrite)
		if result != TCL_OK {
			return result
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceInscopeCmd --
//
//	Invoked to implement the "namespace inscope" command that executes a
//	script in the context of a particular namespace. This command is not
//	expected to be used directly by programmers; calls to it are generated
//	implicitly when programs use "namespace code" commands to register
//	callback scripts. Handles the following syntax:
//
//	    namespace inscope name arg ?arg...?
//
//	The "namespace inscope" command is much like the "namespace eval"
//	command except that it has lappend semantics and the namespace must
//	already exist. It treats the first argument as a list, and appends any
//	arguments after the first onto the end as proper list elements. For
//	example,
//
//	    namespace inscope ::foo {a b} c d e
//
//	is equivalent to
//
//	    namespace eval ::foo [concat {a b} [list c d e]]
//
//	This lappend semantics is important because many callback scripts are
//	actually prefixes.
//
// Results:
//	Returns TCL_OK to indicate success, or TCL_ERROR to indicate failure.
//
// Side effects:
//	Returns a result in the Tcl interpreter's result object.
//
//----------------------------------------------------------------------

func sNamespaceInscopeCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3782:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sNRNamespaceInscopeCmd})), clientData, objc,
		objv)
}

func sNRNamespaceInscopeCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3793:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// var namespacePtr uintptr at bp, 8

	// var framePtr uintptr at bp+8, 8

	var framePtrPtr uintptr
	var i int32
	var cmdObjPtr uintptr

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+46688)
		return TCL_ERROR
	}

	// Resolve the namespace reference.

	if XTclGetNamespaceFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK {
		return TCL_ERROR
	}

	// Make the specified namespace the current namespace.

	framePtrPtr = bp + 8 /* &framePtr */ // This is needed to satisfy GCC's
	// strict aliasing rules.
	XTclPushStackFrame(tls, interp, framePtrPtr,
		*(*uintptr)(unsafe.Pointer(bp /* namespacePtr */)) /*isProcCallFrame*/, 0)

	(*CallFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* framePtr */)))).Fobjv = XTclFetchEnsembleRoot(tls, interp, objv, objc, *(*uintptr)(unsafe.Pointer(bp + 8))+12)

	// Execute the command. If there is just one argument, just treat it as a
	// script and evaluate it. Otherwise, create a list from the arguments
	// after the first one, then concatenate the first argument and the list
	// of extra arguments to form the command to evaluate.

	if objc == 3 {
		cmdObjPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	} else {
		// var concatObjv [2]uintptr at bp+16, 16

		var listPtr uintptr

		listPtr = XTcl_NewListObj(tls, 0, uintptr(0))
		for i = 3; i < objc; i++ {
			if XTcl_ListObjAppendElement(tls, interp, listPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) != TCL_OK {
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = listPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				} // Free unneeded obj.
				return TCL_ERROR
			}
		}

		*(*uintptr)(unsafe.Pointer(bp + 16)) = *(*uintptr)(unsafe.Pointer(objv + 2*8))
		*(*uintptr)(unsafe.Pointer(bp + 16 + 1*8)) = listPtr
		cmdObjPtr = XTcl_ConcatObj(tls, 2, bp+16)
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = listPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		} // We're done with the list object.
	}

	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _callbackPtr uintptr
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sNsEval_Callback}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = *(*uintptr)(unsafe.Pointer(bp))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = ts + 18756
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return XTclNREvalObjEx(tls, interp, cmdObjPtr, 0, uintptr(0), 0)
}

//----------------------------------------------------------------------
//
// NamespaceOriginCmd --
//
//	Invoked to implement the "namespace origin" command to return the
//	fully-qualified name of the "real" command to which the specified
//	"imported command" refers. Handles the following syntax:
//
//	    namespace origin name
//
// Results:
//	An imported command is created in an namespace when that namespace
//	imports a command from another namespace. If a command is imported
//	into a sequence of namespaces a, b,...,n where each successive
//	namespace just imports the command from the previous namespace, this
//	command returns the fully-qualified name of the original command in
//	the first namespace, a. If "name" does not refer to an alias, its
//	fully-qualified name is returned. The returned name is stored in the
//	interpreter's result object. This function returns TCL_OK if
//	successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	If anything goes wrong, this function returns an error message in the
//	interpreter's result object.
//
//----------------------------------------------------------------------

func sNamespaceOriginCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3890:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var command Tcl_Command
	var origCommand Tcl_Command
	var resultPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3660)
		return TCL_ERROR
	}

	command = XTcl_GetCommandFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if command == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+7842, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+7328,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}(), uintptr(0)))
		return TCL_ERROR
	}
	origCommand = XTclGetOriginalCommand(tls, command)
	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultPtr = XTclThreadAllocObj(tls)
		} else {
			resultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = uintptr(0)
	{
	}

	if origCommand == uintptr(0) {
		// The specified command isn't an imported command. Return the
		// command's name qualified by the full name of the namespace it was
		// defined in.

		XTcl_GetCommandFullName(tls, interp, command, resultPtr)
	} else {
		XTcl_GetCommandFullName(tls, interp, origCommand, resultPtr)
	}
	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceParentCmd --
//
//	Invoked to implement the "namespace parent" command that returns the
//	fully-qualified name of the parent namespace for a specified
//	namespace. Handles the following syntax:
//
//	    namespace parent ?name?
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Returns a result in the interpreter's result object. If anything goes
//	wrong, the result is an error message.
//
//----------------------------------------------------------------------

func sNamespaceParentCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:3951:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var nsPtr uintptr at bp, 8

	if objc == 1 {
		*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)) = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	} else if objc == 2 {
		if XTclGetNamespaceFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK {
			return TCL_ERROR
		}
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12739)
		return TCL_ERROR
	}

	// Report the parent of the specified namespace.

	if (*Tcl_Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FparentPtr != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			(*Tcl_Namespace1)(unsafe.Pointer((*Tcl_Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)))).FparentPtr)).FfullName, -1))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespacePathCmd --
//
//	Invoked to implement the "namespace path" command that reads and
//	writes the current namespace's command resolution path. Has one
//	optional argument: if present, it is a list of named namespaces to set
//	the path to, and if absent, the current path should be returned.
//	Handles the following syntax:
//
//	    namespace path ?nsList?
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong
//	(most notably if the namespace list contains the name of something
//	other than a namespace). In the successful-exit case, may set the
//	interpreter result to the list of names of the namespaces on the
//	current namespace's path.
//
// Side effects:
//	May update the namespace path (triggering a recomputing of all command
//	names that depend on the namespace for resolution).
//
//----------------------------------------------------------------------

func sNamespacePathCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:4009:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var nsPtr uintptr
	var i int32
	// var nsObjc int32 at bp+8, 4

	var result int32
	// var nsObjv uintptr at bp, 8

	var namespaceList uintptr
	var cachePtr uintptr
	var resultObj uintptr
	nsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	result = TCL_ERROR
	namespaceList = uintptr(0)

	if !(objc > 2) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+46841)
	return TCL_ERROR
__1:
	;

	// If no path is given, return the current path.

	if !(objc == 1) {
		goto __2
	}

__3:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __6
	}
	resultObj = XTclThreadAllocObj(tls)
	goto __7
__6:
	resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__7:
	;
	goto __4
__4:
	if 0 != 0 {
		goto __3
	}
	goto __5
__5:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)

	i = 0
__8:
	if !(i < (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength) {
		goto __10
	}
	if !((*NamespacePathEntry)(unsafe.Pointer((*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathArray+uintptr(i)*32)).FnsPtr != uintptr(0)) {
		goto __11
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, XTcl_NewStringObj(tls,
		(*Namespace)(unsafe.Pointer((*NamespacePathEntry)(unsafe.Pointer((*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathArray+uintptr(i)*32)).FnsPtr)).FfullName, -1))
__11:
	;
	goto __9
__9:
	i++
	goto __8
	goto __10
__10:
	;
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
__2:
	;

	// There is a path given, so parse it into an array of namespace pointers.

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 8)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp)
	}() != TCL_OK) {
		goto __12
	}
	goto badNamespace
__12:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		goto __13
	}
	namespaceList = XTclStackAlloc(tls, interp,
		int32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 8)))))

	i = 0
__14:
	if !(i < *(*int32)(unsafe.Pointer(bp + 8))) {
		goto __16
	}
	if !(XTclGetNamespaceFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i)*8)),
		namespaceList+uintptr(i)*8) != TCL_OK) {
		goto __17
	}
	goto badNamespace
__17:
	;
	goto __15
__15:
	i++
	goto __14
	goto __16
__16:
	;
__13:
	;

	// Now we have the list of valid namespaces, install it as the path.

	XTclSetNsPath(tls, nsPtr, *(*int32)(unsafe.Pointer(bp + 8 /* nsObjc */)), namespaceList)

	result = TCL_OK
badNamespace:
	if !(namespaceList != uintptr(0)) {
		goto __18
	}
	XTclStackFree(tls, interp, namespaceList)
__18:
	;
	return result
}

//----------------------------------------------------------------------
//
// TclSetNsPath --
//
//	Sets the namespace command name resolution path to the given list of
//	namespaces. If the list is empty (of zero length) the path is set to
//	empty and the default old-style behaviour of command name resolution
//	is used.
//
// Results:
//	nothing
//
// Side effects:
//	Invalidates the command name resolution caches for any command
//	resolved in the given namespace.
//
//----------------------------------------------------------------------

func XTclSetNsPath(tls *libc.TLS, nsPtr uintptr, pathLength int32, pathAry uintptr) { /* tclNamesp.c:4097:1: */
	if pathLength != 0 {
		var tmpPathArray uintptr = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(NamespacePathEntry{}))*uint64(pathLength)))
		var i int32

		for i = 0; i < pathLength; i++ {
			(*NamespacePathEntry)(unsafe.Pointer(tmpPathArray + uintptr(i)*32)).FnsPtr = *(*uintptr)(unsafe.Pointer(pathAry + uintptr(i)*8))
			(*NamespacePathEntry)(unsafe.Pointer(tmpPathArray + uintptr(i)*32)).FcreatorNsPtr = nsPtr
			(*NamespacePathEntry)(unsafe.Pointer(tmpPathArray + uintptr(i)*32)).FprevPtr = uintptr(0)
			(*NamespacePathEntry)(unsafe.Pointer(tmpPathArray + uintptr(i)*32)).FnextPtr = (*Namespace)(unsafe.Pointer((*NamespacePathEntry)(unsafe.Pointer(tmpPathArray + uintptr(i)*32)).FnsPtr)).FcommandPathSourceList
			if (*NamespacePathEntry)(unsafe.Pointer(tmpPathArray+uintptr(i)*32)).FnextPtr != uintptr(0) {
				(*NamespacePathEntry)(unsafe.Pointer((*NamespacePathEntry)(unsafe.Pointer(tmpPathArray + uintptr(i)*32)).FnextPtr)).FprevPtr = tmpPathArray + uintptr(i)*32
			}
			(*Namespace)(unsafe.Pointer((*NamespacePathEntry)(unsafe.Pointer(tmpPathArray + uintptr(i)*32)).FnsPtr)).FcommandPathSourceList = tmpPathArray + uintptr(i)*32
		}
		if (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength != 0 {
			sUnlinkNsPath(tls, nsPtr)
		}
		(*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathArray = tmpPathArray
	} else {
		if (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength != 0 {
			sUnlinkNsPath(tls, nsPtr)
		}
	}

	(*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength = pathLength
	(*Namespace)(unsafe.Pointer(nsPtr)).FcmdRefEpoch++
	(*Namespace)(unsafe.Pointer(nsPtr)).FresolverEpoch++
}

//----------------------------------------------------------------------
//
// UnlinkNsPath --
//
//	Delete the given namespace's command name resolution path. Only call
//	if the path is non-empty. Caller must reset the counter containing the
//	path size.
//
// Results:
//	nothing
//
// Side effects:
//	Deletes the array of path entries and unlinks those path entries from
//	the target namespace's list of interested namespaces.
//
//----------------------------------------------------------------------

func sUnlinkNsPath(tls *libc.TLS, nsPtr uintptr) { /* tclNamesp.c:4153:1: */
	var i int32
	for i = 0; i < (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathLength; i++ {
		var nsPathPtr uintptr = (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathArray + uintptr(i)*32

		if (*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FprevPtr != uintptr(0) {
			(*NamespacePathEntry)(unsafe.Pointer((*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FprevPtr)).FnextPtr = (*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnextPtr
		}
		if (*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnextPtr != uintptr(0) {
			(*NamespacePathEntry)(unsafe.Pointer((*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnextPtr)).FprevPtr = (*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FprevPtr
		}
		if (*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnsPtr != uintptr(0) {
			if (*Namespace)(unsafe.Pointer((*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnsPtr)).FcommandPathSourceList == nsPathPtr {
				(*Namespace)(unsafe.Pointer((*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnsPtr)).FcommandPathSourceList = (*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnextPtr
			}
		}
	}
	XTclpFree(tls, (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathArray)
}

//----------------------------------------------------------------------
//
// TclInvalidateNsPath --
//
//	Invalidate the name resolution caches for all names looked up in
//	namespaces whose name path includes the given namespace.
//
// Results:
//	nothing
//
// Side effects:
//	Increments the command reference epoch in each namespace whose path
//	includes the given namespace. This causes any cached resolved names
//	whose root cacheing context starts at that namespace to be recomputed
//	the next time they are used.
//
//----------------------------------------------------------------------

func XTclInvalidateNsPath(tls *libc.TLS, nsPtr uintptr) { /* tclNamesp.c:4196:1: */
	var nsPathPtr uintptr = (*Namespace)(unsafe.Pointer(nsPtr)).FcommandPathSourceList

	for nsPathPtr != uintptr(0) {
		if (*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnsPtr != uintptr(0) {
			(*Namespace)(unsafe.Pointer((*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FcreatorNsPtr)).FcmdRefEpoch++
		}
		nsPathPtr = (*NamespacePathEntry)(unsafe.Pointer(nsPathPtr)).FnextPtr
	}
}

//----------------------------------------------------------------------
//
// NamespaceQualifiersCmd --
//
//	Invoked to implement the "namespace qualifiers" command that returns
//	any leading namespace qualifiers in a string. These qualifiers are
//	namespace names separated by "::"s. For example, for "::foo::p" this
//	command returns "::foo", and for "::" it returns "". This command is
//	the complement of the "namespace tail" command. Note that this command
//	does not check whether the "namespace" names are, in fact, the names
//	of currently defined namespaces. Handles the following syntax:
//
//	    namespace qualifiers string
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Returns a result in the interpreter's result object. If anything goes
//	wrong, the result is an error message.
//
//----------------------------------------------------------------------

func sNamespaceQualifiersCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:4235:1: */
	var name uintptr
	var p uintptr
	var length int32

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16446)
		return TCL_ERROR
	}

	// Find the end of the string, then work backward and find the start of
	// the last "::" qualifier.

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	for p = name; int32(*(*int8)(unsafe.Pointer(p))) != 0; p++ {
		// empty body
	}
	for libc.PreDecUintptr(&p, 1) >= name {
		if int32(*(*int8)(unsafe.Pointer(p))) == ':' && p > name && int32(*(*int8)(unsafe.Pointer(p - uintptr(1)))) == ':' {
			p -= uintptr(2) // Back up over the ::
			for p >= name && int32(*(*int8)(unsafe.Pointer(p))) == ':' {
				p-- // Back up over the preceeding :
			}
			break
		}
	}

	if p >= name {
		length = int32((int64(p)-int64(name))/1 + int64(1))
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, name, length))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceUnknownCmd --
//
//	Invoked to implement the "namespace unknown" command (TIP 181) that
//	sets or queries a per-namespace unknown command handler. This handler
//	is called when command lookup fails (current and global ns). The
//	default handler for the global namespace is ::unknown. The default
//	handler for other namespaces is to call the global namespace unknown
//	handler. Passing an empty list results in resetting the handler to its
//	default.
//
//	    namespace unknown ?handler?
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	If no handler is specified, returns a result in the interpreter's
//	result object, otherwise it sets the unknown handler pointer in the
//	current namespace to the script fragment provided. If anything goes
//	wrong, the result is an error message.
//
//----------------------------------------------------------------------

func sNamespaceUnknownCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:4303:1: */
	var currNsPtr uintptr
	var resultPtr uintptr
	var rc int32

	if objc > 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+46852)
		return TCL_ERROR
	}

	currNsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr

	if objc == 1 {
		// Introspection - return the current namespace handler.

		resultPtr = XTcl_GetNamespaceUnknownHandler(tls, interp, currNsPtr)
		if resultPtr == uintptr(0) {
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					resultPtr = XTclThreadAllocObj(tls)
				} else {
					resultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0
			(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = uintptr(0)
			{
			}

		}
		XTcl_SetObjResult(tls, interp, resultPtr)
	} else {
		rc = XTcl_SetNamespaceUnknownHandler(tls, interp, currNsPtr, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		if rc == TCL_OK {
			XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}
		return rc
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetNamespaceUnknownHandler --
//
//	Returns the unknown command handler registered for the given
//	namespace.
//
// Results:
//	Returns the current unknown command handler, or NULL if none exists
//	for the namespace.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetNamespaceUnknownHandler(tls *libc.TLS, interp uintptr, nsPtr uintptr) uintptr { /* tclNamesp.c:4358:9: */
	var currNsPtr uintptr = nsPtr

	if (*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr == uintptr(0) && currNsPtr == (*Interp)(unsafe.Pointer(interp)).FglobalNsPtr {
		// Default handler for global namespace is "::unknown". For all other
		// namespaces, it is NULL (which falls back on the global unknown
		// handler).

		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					(*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr = XTclThreadAllocObj(tls)
				} else {
					(*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes, ts+7832, uint64(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes + 9)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Flength = int32(uint64(unsafe.Sizeof([10]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).FtypePtr = uintptr(0)
			{
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).FrefCount++
	}
	return (*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr
}

//----------------------------------------------------------------------
//
// Tcl_SetNamespaceUnknownHandler --
//
//	Sets the unknown command handler for the given namespace to the
//	command prefix passed.
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Sets the namespace unknown command handler. If the passed in handler
//	is NULL or an empty list, then the handler is reset to its default. If
//	an error occurs, then an error message is left in the interpreter
//	result.
//
//----------------------------------------------------------------------

func XTcl_SetNamespaceUnknownHandler(tls *libc.TLS, interp uintptr, nsPtr uintptr, handlerPtr uintptr) int32 { /* tclNamesp.c:4401:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	*(*int32)(unsafe.Pointer(bp /* lstlen */)) = 0
	var currNsPtr uintptr = nsPtr

	// Ensure that we check for errors *first* before we change anything.

	if handlerPtr != uintptr(0) {
		if func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(handlerPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(handlerPtr + 32)))).FelemCount
					return TCL_OK
				}()
			}
			return XTcl_ListObjLength(tls, interp, handlerPtr, bp)
		}() != TCL_OK {
			// Not a list.

			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp)) > 0 {
			// We are going to be saving this handler. Increment the reference
			// count before decrementing the refcount on the previous handler,
			// so that nothing strange can happen if we are told to set the
			// handler to the previous value.

			(*Tcl_Obj)(unsafe.Pointer(handlerPtr)).FrefCount++
		}
	}

	// Remove old handler next.

	if (*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	// Install the new handler.

	if *(*int32)(unsafe.Pointer(bp)) > 0 {
		// Just store the handler. It already has the correct reference count.

		(*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr = handlerPtr
	} else {
		// If NULL or an empty list is passed, this resets to the default
		// handler.

		(*Namespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr = uintptr(0)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceTailCmd --
//
//	Invoked to implement the "namespace tail" command that returns the
//	trailing name at the end of a string with "::" namespace qualifiers.
//	These qualifiers are namespace names separated by "::"s. For example,
//	for "::foo::p" this command returns "p", and for "::" it returns "".
//	This command is the complement of the "namespace qualifiers" command.
//	Note that this command does not check whether the "namespace" names
//	are, in fact, the names of currently defined namespaces. Handles the
//	following syntax:
//
//	    namespace tail string
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Returns a result in the interpreter's result object. If anything goes
//	wrong, the result is an error message.
//
//----------------------------------------------------------------------

func sNamespaceTailCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:4490:1: */
	var name uintptr
	var p uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16446)
		return TCL_ERROR
	}

	// Find the end of the string, then work backward and find the last "::"
	// qualifier.

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	for p = name; int32(*(*int8)(unsafe.Pointer(p))) != 0; p++ {
		// empty body
	}
	for libc.PreDecUintptr(&p, 1) > name {
		if int32(*(*int8)(unsafe.Pointer(p))) == ':' && int32(*(*int8)(unsafe.Pointer(p - uintptr(1)))) == ':' {
			p++ // Just after the last "::"
			break
		}
	}

	if p >= name {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, p, -1))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceUpvarCmd --
//
//	Invoked to implement the "namespace upvar" command, that creates
//	variables in the current scope linked to variables in another
//	namespace. Handles the following syntax:
//
//	    namespace upvar ns otherVar myVar ?otherVar myVar ...?
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Creates new variables in the current scope, linked to the
//	corresponding variables in the stipulated nmamespace. If anything goes
//	wrong, the result is an error message.
//
//----------------------------------------------------------------------

func sNamespaceUpvarCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:4548:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var iPtr uintptr = interp
	// var nsPtr uintptr at bp, 8

	var savedNsPtr uintptr
	var otherPtr uintptr
	// var arrayPtr uintptr at bp+8, 8

	var myName uintptr

	if objc < 2 || objc&1 != 0 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+46861)
		return TCL_ERROR
	}

	if XTclGetNamespaceFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK {
		return TCL_ERROR
	}

	objc = objc - 2
	objv += 8 * uintptr(2)

__1:
	if !(objc > 0) {
		goto __3
	}
	{
		// Locate the other variable.

		savedNsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr
		(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr = *(*uintptr)(unsafe.Pointer(bp /* nsPtr */))
		otherPtr = XTclObjLookupVarEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0),
			TCL_NAMESPACE_ONLY|TCL_LEAVE_ERR_MSG|TCL_AVOID_RESOLVERS,
			ts+28407, 1 /*createPart2*/, 1, bp+8)
		(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr = savedNsPtr
		if otherPtr == uintptr(0) {
			return TCL_ERROR
		}

		// Create the new variable and link it to otherPtr.

		myName = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}()
		if XTclPtrMakeUpvar(tls, interp, otherPtr, myName, 0, -1) != TCL_OK {
			return TCL_ERROR
		}

	}
	goto __2
__2:
	objc = objc - 2
	objv += 8 * uintptr(2)
	goto __1
	goto __3
__3:
	;

	return TCL_OK
}

//----------------------------------------------------------------------
//
// NamespaceWhichCmd --
//
//	Invoked to implement the "namespace which" command that returns the
//	fully-qualified name of a command or variable. If the specified
//	command or variable does not exist, it returns "". Handles the
//	following syntax:
//
//	    namespace which ?-command? ?-variable? name
//
// Results:
//	Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
//
// Side effects:
//	Returns a result in the interpreter's result object. If anything goes
//	wrong, the result is an error message.
//
//----------------------------------------------------------------------

func sNamespaceWhichCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclNamesp.c:4622:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var lookupType int32 at bp, 4

	var resultPtr uintptr
	var cachePtr uintptr // -command
	var cmd Tcl_Command  // -variable
	var var1 Tcl_Var
	*(*int32)(unsafe.Pointer(bp /* lookupType */)) = 0

	if !(objc < 2 || objc > 3) {
		goto __1
	}
badArgs:
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+46885)
	return TCL_ERROR
	goto __2
__1:
	if !(objc == 3) {
		goto __3
	}
	// Look for a flag controlling the lookup.

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&opts)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp) != TCL_OK) {
		goto __4
	}
	// Preserve old style of error message!

	XTcl_ResetResult(tls, interp)
	goto badArgs
__4:
	;
__3:
	;
__2:
	;

__5:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __8
	}
	resultPtr = XTclThreadAllocObj(tls)
	goto __9
__8:
	resultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__9:
	;
	goto __6
__6:
	if 0 != 0 {
		goto __5
	}
	goto __7
__7:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = uintptr(0)

	switch *(*int32)(unsafe.Pointer(bp /* lookupType */)) {
	case 0:
		goto __11
	case 1:
		goto __12
	}
	goto __10
__11: // -command
	cmd = XTcl_GetCommandFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))

	if !(cmd != uintptr(0)) {
		goto __13
	}
	XTcl_GetCommandFullName(tls, interp, cmd, resultPtr)
__13:
	;
	goto __10

__12: // -variable
	var1 = XTcl_FindNamespaceVar(tls, interp,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)))
		}(), uintptr(0), 0)

	if !(var1 != uintptr(0)) {
		goto __14
	}
	XTcl_GetVariableFullName(tls, interp, var1, resultPtr)
__14:
	;
	goto __10

__10:
	;
	XTcl_SetObjResult(tls, interp, resultPtr)
	return TCL_OK
}

var opts = [3]uintptr{
	ts + 15408, ts + 46913, uintptr(0),
} /* tclNamesp.c:4628:23 */

//----------------------------------------------------------------------
//
// FreeNsNameInternalRep --
//
//	Frees the resources associated with a nsName object's internal
//	representation.
//
// Results:
//	None.
//
// Side effects:
//	Decrements the ref count of any Namespace structure pointed to by the
//	nsName's internal representation. If there are no more references to
//	the namespace, it's structure will be freed.
//
//----------------------------------------------------------------------

func sFreeNsNameInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclNamesp.c:4698:1: */
	var resNamePtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	// Decrement the reference count of the namespace. If there are no more
	// references, free it up.

	(*ResolvedNsName)(unsafe.Pointer(resNamePtr)).FrefCount--
	if (*ResolvedNsName)(unsafe.Pointer(resNamePtr)).FrefCount == 0 {
		// Decrement the reference count for the cached namespace. If the
		// namespace is dead, and there are no more references to it, free
		// it.

		XTclNsDecrRefCount(tls, (*ResolvedNsName)(unsafe.Pointer(resNamePtr)).FnsPtr)
		XTclpFree(tls, resNamePtr)
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// DupNsNameInternalRep --
//
//	Initializes the internal representation of a nsName object to a copy
//	of the internal representation of another nsName object.
//
// Results:
//	None.
//
// Side effects:
//	copyPtr's internal rep is set to refer to the same namespace
//	referenced by srcPtr's internal rep. Increments the ref count of the
//	ResolvedNsName structure used to hold the namespace reference.
//
//----------------------------------------------------------------------

func sDupNsNameInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclNamesp.c:4743:1: */
	var resNamePtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))

	*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = resNamePtr
	(*ResolvedNsName)(unsafe.Pointer(resNamePtr)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&nsNameType))
}

//----------------------------------------------------------------------
//
// SetNsNameFromAny --
//
//	Attempt to generate a nsName internal representation for a Tcl object.
//
// Results:
//	Returns TCL_OK if the value could be converted to a proper namespace
//	reference. Otherwise, it returns TCL_ERROR, along with an error
//	message in the interpreter's result object.
//
// Side effects:
//	If successful, the object is made a nsName object. Its internal rep is
//	set to point to a ResolvedNsName, which contains a cached pointer to
//	the Namespace. Reference counts are kept on both the ResolvedNsName
//	and the Namespace, so we can keep track of their usage and free them
//	when appropriate.
//
//----------------------------------------------------------------------

func sSetNsNameFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclNamesp.c:4777:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// var dummy uintptr at bp+24, 8

	// var nsPtr uintptr at bp, 8

	// var dummy1Ptr uintptr at bp+8, 8

	// var dummy2Ptr uintptr at bp+16, 8

	var resNamePtr uintptr
	var name uintptr

	if interp == uintptr(0) {
		return TCL_ERROR
	}

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()
	XTclGetNamespaceForQualName(tls, interp, name, uintptr(0), TCL_FIND_ONLY_NS,
		bp, bp+8, bp+16, bp+24)

	// If we found a namespace, then create a new ResolvedNsName structure
	// that holds a reference to it.

	if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags&NS_DYING != 0 {
		// Our failed lookup proves any previously cached nsName internalrep is no
		// longer valid. Get rid of it so we no longer waste memory storing
		// it, nor time determining its invalidity again and again.

		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&nsNameType)) {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
				if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
					(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
				}
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
			}

		}
		return TCL_ERROR
	}

	(*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)))).FrefCount++
	resNamePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ResolvedNsName{})))
	(*ResolvedNsName)(unsafe.Pointer(resNamePtr)).FnsPtr = *(*uintptr)(unsafe.Pointer(bp /* nsPtr */))
	if int32(*(*int8)(unsafe.Pointer(name))) == ':' && int32(*(*int8)(unsafe.Pointer(name + 1))) == ':' {
		(*ResolvedNsName)(unsafe.Pointer(resNamePtr)).FrefNsPtr = uintptr(0)
	} else {
		(*ResolvedNsName)(unsafe.Pointer(resNamePtr)).FrefNsPtr = XTcl_GetCurrentNamespace(tls, interp)
	}
	(*ResolvedNsName)(unsafe.Pointer(resNamePtr)).FrefCount = 1
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	}

	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = resNamePtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&nsNameType))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclGetNamespaceCommandTable --
//
//	Returns the hash table of commands.
//
// Results:
//	Pointer to the hash table.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetNamespaceCommandTable(tls *libc.TLS, nsPtr uintptr) uintptr { /* tclNamesp.c:4845:15: */
	return nsPtr + 160
}

//----------------------------------------------------------------------
//
// TclGetNamespaceChildTable --
//
//	Returns the hash table of child namespaces.
//
// Results:
//	Pointer to the hash table.
//
// Side effects:
//	Might allocate memory.
//
//----------------------------------------------------------------------

func XTclGetNamespaceChildTable(tls *libc.TLS, nsPtr uintptr) uintptr { /* tclNamesp.c:4868:15: */
	var nPtr uintptr = nsPtr
	return nPtr + 40
}

//----------------------------------------------------------------------
//
// TclLogCommandInfo --
//
//	This function is invoked after an error occurs in an interpreter. It
//	adds information to iPtr->errorInfo/errorStack fields to describe the
//	command that was being executed when the error occurred. When pc and
//	tosPtr are non-NULL, conveying a bytecode execution "inner context",
//	and the offending instruction is suitable, that inner context is
//	recorded in errorStack.
//
// Results:
//	None.
//
// Side effects:
//	Information about the command is added to errorInfo/errorStack and the
//	line number stored internally in the interpreter is set.
//
//----------------------------------------------------------------------

func XTclLogCommandInfo(tls *libc.TLS, interp uintptr, script uintptr, command uintptr, length int32, pc uintptr, tosPtr uintptr) { /* tclNamesp.c:4907:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var p uintptr
	var iPtr uintptr = interp
	var overflow int32
	var limit int32 = 150
	var varPtr uintptr
	// var arrayPtr uintptr at bp+32, 8

	if (*Interp)(unsafe.Pointer(iPtr)).Fflags&ERR_ALREADY_LOGGED != 0 {
		// Someone else has already logged error information for this command;
		// we shouldn't add anything more.

		return
	}

	if command != uintptr(0) {
		// Compute the line number where the error occurred.

		(*Interp)(unsafe.Pointer(iPtr)).FerrorLine = 1
		for p = script; p != command; p++ {
			if int32(*(*int8)(unsafe.Pointer(p))) == '\n' {
				(*Interp)(unsafe.Pointer(iPtr)).FerrorLine++
			}
		}

		if length < 0 {
			length = int32(libc.Xstrlen(tls, command))
		}
		overflow = libc.Bool32(length > limit)
		XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
			ts+46923, libc.VaList(bp, func() uintptr {
				if (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo == uintptr(0) {
					return ts + 46940 /* "while executing" */
				}
				return ts + 46956 /* "invoked from wit..." */
			}(),
				func() int32 {
					if overflow != 0 {
						return limit
					}
					return length
				}(), command,
				func() uintptr {
					if overflow != 0 {
						return ts + 7891 /* "..." */
					}
					return ts + 2046 /* "" */
				}())))

		varPtr = XTclObjLookupVarEx(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FeiVar, uintptr(0), TCL_GLOBAL_ONLY,
			uintptr(0), 0, 0, bp+32)
		if varPtr == uintptr(0) || !((*Var)(unsafe.Pointer(varPtr)).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0) {
			// Should not happen.

			return
		} else {
			var hPtr uintptr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1024 /* &.varTraces */)).FfindProc})).f(tls, iPtr+1024 /* &.varTraces */, varPtr)
			var tracePtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

			if (*VarTrace)(unsafe.Pointer(tracePtr)).FtraceProc != *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
			}{sEstablishErrorInfoTraces})) {
				// The most recent trace set on ::errorInfo is not the one the
				// core itself puts on last. This means some other code is
				// tracing the variable, and the additional trace(s) might be
				// write traces that expect the timing of writes to
				// ::errorInfo that existed Tcl releases before 8.5. To
				// satisfy that compatibility need, we write the current
				// -errorinfo value to the ::errorInfo variable.

				XTcl_ObjSetVar2(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FeiVar, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo,
					TCL_GLOBAL_ONLY)
			}
		}
	}

	// TIP #348

	if (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorStack)).FrefCount > 1 {
		var newObj uintptr

		newObj = XTcl_DuplicateObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FerrorStack)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorStack
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(newObj)).FrefCount++
		(*Interp)(unsafe.Pointer(iPtr)).FerrorStack = newObj
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FresetErrorStack != 0 {
		// var len int32 at bp+40, 4

		(*Interp)(unsafe.Pointer(iPtr)).FresetErrorStack = 0
		XTcl_ListObjLength(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, bp+40)

		// Reset while keeping the list internalrep as much as possible.

		XTcl_ListObjReplace(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, 0, *(*int32)(unsafe.Pointer(bp + 40 /* len */)), 0, uintptr(0))
		if pc != uintptr(0) {
			var innerContext uintptr

			innerContext = XTclGetInnerContext(tls, interp, pc, tosPtr)
			if innerContext != uintptr(0) {
				XTcl_ListObjAppendElement(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FerrorStack,
					(*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)
				XTcl_ListObjAppendElement(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, innerContext)
			}
		} else if command != uintptr(0) {
			XTcl_ListObjAppendElement(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FerrorStack,
				(*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)
			XTcl_ListObjAppendElement(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FerrorStack,
				XTcl_NewStringObj(tls, command, length))
		}
	}

	if !((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FframePtr)).Fobjc != 0) {
		// Special frame, nothing to report.
	} else if (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr != (*Interp)(unsafe.Pointer(iPtr)).FframePtr {
		// uplevel case, [lappend errorstack UP $relativelevel]

		XTcl_ListObjAppendElement(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, (*Interp)(unsafe.Pointer(iPtr)).FupLiteral)
		XTcl_ListObjAppendElement(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, XTcl_NewIntObj(tls,
			(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FframePtr)).Flevel-(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Flevel))
	} else if (*Interp)(unsafe.Pointer(iPtr)).FframePtr != (*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr {
		// normal case, [lappend errorstack CALL [info level 0]]

		XTcl_ListObjAppendElement(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, (*Interp)(unsafe.Pointer(iPtr)).FcallLiteral)
		XTcl_ListObjAppendElement(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, XTcl_NewListObj(tls,
			(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FframePtr)).Fobjc, (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FframePtr)).Fobjv))
	}
}

//----------------------------------------------------------------------
//
// TclErrorStackResetIf --
//
//	The TIP 348 reset/no-bc part of TLCI, for specific use by
//	TclCompileSyntaxError.
//
// Results:
//	None.
//
// Side effects:
//	Reset errorstack if it needs be, and in that case remember the
//	passed-in error message as inner context.
//
//----------------------------------------------------------------------

func XTclErrorStackResetIf(tls *libc.TLS, interp uintptr, msg uintptr, length int32) { /* tclNamesp.c:5067:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp

	if (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorStack)).FrefCount > 1 {
		var newObj uintptr

		newObj = XTcl_DuplicateObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FerrorStack)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorStack
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(newObj)).FrefCount++
		(*Interp)(unsafe.Pointer(iPtr)).FerrorStack = newObj
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FresetErrorStack != 0 {
		// var len int32 at bp, 4

		(*Interp)(unsafe.Pointer(iPtr)).FresetErrorStack = 0
		XTcl_ListObjLength(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, bp)

		// Reset while keeping the list internalrep as much as possible.

		XTcl_ListObjReplace(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, 0, *(*int32)(unsafe.Pointer(bp /* len */)), 0, uintptr(0))
		XTcl_ListObjAppendElement(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, (*Interp)(unsafe.Pointer(iPtr)).FinnerLiteral)
		XTcl_ListObjAppendElement(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FerrorStack,
			XTcl_NewStringObj(tls, msg, length))
	}
}

//----------------------------------------------------------------------
//
// Tcl_LogCommandInfo --
//
//	This function is invoked after an error occurs in an interpreter. It
//	adds information to iPtr->errorInfo/errorStack fields to describe the
//	command that was being executed when the error occurred.
//
// Results:
//	None.
//
// Side effects:
//	Information about the command is added to errorInfo/errorStack and the
//	line number stored internally in the interpreter is set.
//
//----------------------------------------------------------------------

func XTcl_LogCommandInfo(tls *libc.TLS, interp uintptr, script uintptr, command uintptr, length int32) { /* tclNamesp.c:5119:1: */
	XTclLogCommandInfo(tls, interp, script, command, length, uintptr(0), uintptr(0))
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Module-scope struct of notifier hooks that are checked in the default
// notifier functions (for overriding via Tcl_SetNotifier).

var XtclNotifierHooks = Tcl_NotifierProcs{} /* tclNotify.c:25:19 */

// For each event source (created with Tcl_CreateEventSource) there is a
// structure of the following type:

type EventSource1 = struct {
	FsetupProc  uintptr
	FcheckProc  uintptr
	FclientData ClientData
	FnextPtr    uintptr
} /* tclNotify.c:34:9 */

// For each event source (created with Tcl_CreateEventSource) there is a
// structure of the following type:

type EventSource = EventSource1 /* tclNotify.c:39:3 */

// The following structure keeps track of the state of the notifier on a
// per-thread basis. The first three elements keep track of the event queue.
// In addition to the first (next to be serviced) and last events in the
// queue, we keep track of a "marker" event. This provides a simple priority
// mechanism whereby events can be inserted at the front of the queue but
// behind all other high-priority events already in the queue (this is used
// for things like a sequence of Enter and Leave events generated during a
// grab in Tk). These elements are protected by the queueMutex so that any
// thread can queue an event on any notifier. Note that all of the values in
// this structure will be initialized to 0.

type ThreadSpecificData9 = struct {
	FfirstEventPtr       uintptr
	FlastEventPtr        uintptr
	FmarkerEventPtr      uintptr
	FqueueMutex          Tcl_Mutex
	FserviceMode         int32
	FblockTimeSet        int32
	FblockTime           Tcl_Time
	FinTraversal         int32
	F__ccgo_pad1         [4]byte
	FfirstEventSourcePtr uintptr
	FthreadId            Tcl_ThreadId
	FclientData          ClientData
	Finitialized         int32
	F__ccgo_pad2         [4]byte
	FnextPtr             uintptr
} /* tclNotify.c:80:3 */

var dataKey8 Tcl_ThreadDataKey /* tclNotify.c:82:26: */

// Global list of notifiers. Access to this list is controlled by the listLock
// mutex. If this becomes a performance bottleneck, this could be replaced
// with a hashtable.

var firstNotifierPtr uintptr = uintptr(0) /* tclNotify.c:90:27 */
var listLock Tcl_Mutex                    /* tclNotify.c:91:1: */

//----------------------------------------------------------------------
//
// TclInitNotifier --
//
//	Initialize the thread local data structures for the notifier
//	subsystem.
//
// Results:
//	None.
//
// Side effects:
//	Adds the current thread to the global list of notifiers.
//
//----------------------------------------------------------------------

func XTclInitNotifier(tls *libc.TLS) { /* tclNotify.c:118:1: */
	var tsdPtr uintptr
	var threadId Tcl_ThreadId = XTcl_GetCurrentThread(tls)

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&listLock)))
	for tsdPtr = firstNotifierPtr; tsdPtr != 0 && (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FthreadId != threadId; tsdPtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FnextPtr {
		// Empty loop body.
	}

	if uintptr(0) == tsdPtr {
		// Notifier not yet initialized in this thread.

		tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))
		(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FthreadId = threadId
		(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FclientData = XTcl_InitNotifier(tls)
		(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).Finitialized = 1
		(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FnextPtr = firstNotifierPtr
		firstNotifierPtr = tsdPtr
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&listLock)))
}

//----------------------------------------------------------------------
//
// TclFinalizeNotifier --
//
//	Finalize the thread local data structures for the notifier subsystem.
//
// Results:
//	None.
//
// Side effects:
//	Removes the notifier associated with the current thread from the
//	global notifier list. This is done only if the notifier was
//	initialized for this thread by call to TclInitNotifier(). This is
//	always true for threads which have been seeded with an Tcl
//	interpreter, since the call to Tcl_CreateInterp will, among other
//	things, call TclInitializeSubsystems() and this one will, in turn,
//	call the TclInitNotifier() for the thread. For threads created without
//	the Tcl interpreter, though, nobody is explicitly nor implicitly
//	calling the TclInitNotifier hence, TclFinalizeNotifier should not be
//	performed at all.
//
//----------------------------------------------------------------------

func XTclFinalizeNotifier(tls *libc.TLS) { /* tclNotify.c:170:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))
	var prevPtrPtr uintptr
	var evPtr uintptr
	var hold uintptr

	if !((*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).Finitialized != 0) {
		return // Notifier not initialized for the current thread
	}

	XTcl_MutexLock(tls, tsdPtr+24)
	for evPtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr; evPtr != uintptr(0); {
		hold = evPtr
		evPtr = (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr
		XTclpFree(tls, hold)
	}
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr = uintptr(0)
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FlastEventPtr = uintptr(0)
	XTcl_MutexUnlock(tls, tsdPtr+24)

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&listLock)))

	XTcl_FinalizeNotifier(tls, (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FclientData)
	XTcl_MutexFinalize(tls, tsdPtr+24)
	for prevPtrPtr = uintptr(unsafe.Pointer(&firstNotifierPtr)); *(*uintptr)(unsafe.Pointer(prevPtrPtr)) != uintptr(0); prevPtrPtr = *(*uintptr)(unsafe.Pointer(prevPtrPtr)) + 96 {
		if *(*uintptr)(unsafe.Pointer(prevPtrPtr)) == tsdPtr {
			*(*uintptr)(unsafe.Pointer(prevPtrPtr)) = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FnextPtr
			break
		}
	}
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).Finitialized = 0

	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&listLock)))
}

//----------------------------------------------------------------------
//
// Tcl_SetNotifier --
//
//	Install a set of alternate functions for use with the notifier. In
//	particular, this can be used to install the Xt-based notifier for use
//	with the Browser plugin.
//
// Results:
//	None.
//
// Side effects:
//	Set the tclNotifierHooks global, which is checked in the default
//	notifier functions.
//
//----------------------------------------------------------------------

func XTcl_SetNotifier(tls *libc.TLS, notifierProcPtr uintptr) { /* tclNotify.c:226:1: */
	XtclNotifierHooks = *(*Tcl_NotifierProcs)(unsafe.Pointer(notifierProcPtr))
}

//----------------------------------------------------------------------
//
// Tcl_CreateEventSource --
//
//	This function is invoked to create a new source of events. The source
//	is identified by a function that gets invoked during Tcl_DoOneEvent to
//	check for events on that source and queue them.
//
//
// Results:
//	None.
//
// Side effects:
//	SetupProc and checkProc will be invoked each time that Tcl_DoOneEvent
//	runs out of things to do. SetupProc will be invoked before
//	Tcl_DoOneEvent calls select or whatever else it uses to wait for
//	events. SetupProc typically calls functions like Tcl_SetMaxBlockTime
//	to indicate what to wait for.
//
//	CheckProc is called after select or whatever operation was actually
//	used to wait. It figures out whether anything interesting actually
//	happened (e.g. by calling Tcl_AsyncReady), and then calls
//	Tcl_QueueEvent to queue any events that are ready.
//
//	Each of these functions is passed two arguments, e.g.
//		(*checkProc)(ClientData clientData, int flags));
//	ClientData is the same as the clientData argument here, and flags is a
//	combination of things like TCL_FILE_EVENTS that indicates what events
//	are of interest: setupProc and checkProc use flags to figure out
//	whether their events are relevant or not.
//
//----------------------------------------------------------------------

func XTcl_CreateEventSource(tls *libc.TLS, setupProc uintptr, checkProc uintptr, clientData ClientData) { /* tclNotify.c:268:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))
	var sourcePtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(EventSource{})))

	(*EventSource)(unsafe.Pointer(sourcePtr)).FsetupProc = setupProc
	(*EventSource)(unsafe.Pointer(sourcePtr)).FcheckProc = checkProc
	(*EventSource)(unsafe.Pointer(sourcePtr)).FclientData = clientData
	(*EventSource)(unsafe.Pointer(sourcePtr)).FnextPtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventSourcePtr
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventSourcePtr = sourcePtr
}

//----------------------------------------------------------------------
//
// Tcl_DeleteEventSource --
//
//	This function is invoked to delete the source of events given by proc
//	and clientData.
//
// Results:
//	None.
//
// Side effects:
//	The given event source is canceled, so its function will never again
//	be called. If no such source exists, nothing happens.
//
//----------------------------------------------------------------------

func XTcl_DeleteEventSource(tls *libc.TLS, setupProc uintptr, checkProc uintptr, clientData ClientData) { /* tclNotify.c:307:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))
	var sourcePtr uintptr
	var prevPtr uintptr

	sourcePtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventSourcePtr
	prevPtr = uintptr(0)
__1:
	if !(sourcePtr != uintptr(0)) {
		goto __3
	}
	{
		if (*EventSource)(unsafe.Pointer(sourcePtr)).FsetupProc != setupProc ||
			(*EventSource)(unsafe.Pointer(sourcePtr)).FcheckProc != checkProc ||
			(*EventSource)(unsafe.Pointer(sourcePtr)).FclientData != clientData {
			goto __2
		}
		if prevPtr == uintptr(0) {
			(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventSourcePtr = (*EventSource)(unsafe.Pointer(sourcePtr)).FnextPtr
		} else {
			(*EventSource)(unsafe.Pointer(prevPtr)).FnextPtr = (*EventSource)(unsafe.Pointer(sourcePtr)).FnextPtr
		}
		XTclpFree(tls, sourcePtr)
		return

	}
	goto __2
__2:
	prevPtr = sourcePtr
	sourcePtr = (*EventSource)(unsafe.Pointer(sourcePtr)).FnextPtr
	goto __1
	goto __3
__3:
}

//----------------------------------------------------------------------
//
// Tcl_QueueEvent --
//
//	Queue an event on the event queue associated with the current thread.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_QueueEvent(tls *libc.TLS, evPtr uintptr, position Tcl_QueuePosition) { /* tclNotify.c:355:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))

	sQueueEvent(tls, tsdPtr, evPtr, position)
}

//----------------------------------------------------------------------
//
// Tcl_ThreadQueueEvent --
//
//	Queue an event on the specified thread's event queue.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ThreadQueueEvent(tls *libc.TLS, threadId Tcl_ThreadId, evPtr uintptr, position Tcl_QueuePosition) { /* tclNotify.c:386:1: */
	var tsdPtr uintptr

	// Find the notifier associated with the specified thread.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&listLock)))
	for tsdPtr = firstNotifierPtr; tsdPtr != 0 && (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FthreadId != threadId; tsdPtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FnextPtr {
		// Empty loop body.
	}

	// Queue the event if there was a notifier associated with the thread.

	if tsdPtr != 0 {
		sQueueEvent(tls, tsdPtr, evPtr, position)
	} else {
		XTclpFree(tls, evPtr)
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&listLock)))
}

//----------------------------------------------------------------------
//
// QueueEvent --
//
//	Insert an event into the specified thread's event queue at one of
//	three positions: the head, the tail, or before a floating marker.
//	Events inserted before the marker will be processed in first-in-
//	first-out order, but before any events inserted at the tail of the
//	queue. Events inserted at the head of the queue will be processed in
//	last-in-first-out order.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sQueueEvent(tls *libc.TLS, tsdPtr uintptr, evPtr uintptr, position Tcl_QueuePosition) { /* tclNotify.c:442:1: */
	XTcl_MutexLock(tls, tsdPtr+24)
	if position == TCL_QUEUE_TAIL {
		// Append the event on the end of the queue.

		(*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr = uintptr(0)
		if (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr == uintptr(0) {
			(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr = evPtr
		} else {
			(*Tcl_Event)(unsafe.Pointer((*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FlastEventPtr)).FnextPtr = evPtr
		}
		(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FlastEventPtr = evPtr
	} else if position == TCL_QUEUE_HEAD {
		// Push the event on the head of the queue.

		(*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr
		if (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr == uintptr(0) {
			(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FlastEventPtr = evPtr
		}
		(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr = evPtr
	} else if position == TCL_QUEUE_MARK {
		// Insert the event after the current marker event and advance the
		// marker to the new event.

		if (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FmarkerEventPtr == uintptr(0) {
			(*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr
			(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr = evPtr
		} else {
			(*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr = (*Tcl_Event)(unsafe.Pointer((*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FmarkerEventPtr)).FnextPtr
			(*Tcl_Event)(unsafe.Pointer((*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FmarkerEventPtr)).FnextPtr = evPtr
		}
		(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FmarkerEventPtr = evPtr
		if (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr == uintptr(0) {
			(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FlastEventPtr = evPtr
		}
	}
	XTcl_MutexUnlock(tls, tsdPtr+24)
}

//----------------------------------------------------------------------
//
// Tcl_DeleteEvents --
//
//	Calls a function for each event in the queue and deletes those for
//	which the function returns 1. Events for which the function returns 0
//	are left in the queue. Operates on the queue associated with the
//	current thread.
//
// Results:
//	None.
//
// Side effects:
//	Potentially removes one or more events from the event queue.
//
//----------------------------------------------------------------------

func XTcl_DeleteEvents(tls *libc.TLS, proc uintptr, clientData ClientData) { /* tclNotify.c:517:1: */
	var evPtr uintptr   // Pointer to the event being examined
	var prevPtr uintptr // Pointer to evPtr's predecessor, or NULL if
	// evPtr designates the first event in the
	// queue for the thread.
	var hold uintptr
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))

	XTcl_MutexLock(tls, tsdPtr+24)

	// Walk the queue of events for the thread, applying 'proc' to each to
	// decide whether to eliminate the event.

	prevPtr = uintptr(0)
	evPtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr
	for evPtr != uintptr(0) {
		if (*struct {
			f func(*libc.TLS, uintptr, ClientData) int32
		})(unsafe.Pointer(&struct{ uintptr }{proc})).f(tls, evPtr, clientData) == 1 {
			// This event should be deleted. Unlink it.

			if prevPtr == uintptr(0) {
				(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr = (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr
			} else {
				(*Tcl_Event)(unsafe.Pointer(prevPtr)).FnextPtr = (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr
			}

			// Update 'last' and 'marker' events if either has been deleted.

			if (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr == uintptr(0) {
				(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FlastEventPtr = prevPtr
			}
			if (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FmarkerEventPtr == evPtr {
				(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FmarkerEventPtr = prevPtr
			}

			// Delete the event data structure.

			hold = evPtr
			evPtr = (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr
			XTclpFree(tls, hold)
		} else {
			// Event is to be retained.

			prevPtr = evPtr
			evPtr = (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr
		}
	}
	XTcl_MutexUnlock(tls, tsdPtr+24)
}

//----------------------------------------------------------------------
//
// Tcl_ServiceEvent --
//
//	Process one event from the event queue, or invoke an asynchronous
//	event handler. Operates on event queue for current thread.
//
// Results:
//	The return value is 1 if the function actually found an event to
//	process. If no processing occurred, then 0 is returned.
//
// Side effects:
//	Invokes all of the event handlers for the highest priority event in
//	the event queue. May collapse some events into a single event or
//	discard stale events.
//
//----------------------------------------------------------------------

func XTcl_ServiceEvent(tls *libc.TLS, flags int32) int32 { /* tclNotify.c:600:1: */
	var evPtr uintptr
	var prevPtr uintptr
	var proc uintptr
	var result int32
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))

	// Asynchronous event handlers are considered to be the highest priority
	// events, and so must be invoked before we process events on the event
	// queue.

	if XTcl_AsyncReady(tls) != 0 {
		XTcl_AsyncInvoke(tls, uintptr(0), 0)
		return 1
	}

	// No event flags is equivalent to TCL_ALL_EVENTS.

	if flags&libc.CplInt32(int32(1)<<1) == 0 {
		flags = flags | libc.CplInt32(int32(1)<<1)
	}

	// Loop through all the events in the queue until we find one that can
	// actually be handled.

	XTcl_MutexLock(tls, tsdPtr+24)
	for evPtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr; evPtr != uintptr(0); evPtr = (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr {
		// Call the handler for the event. If it actually handles the event
		// then free the storage for the event. There are two tricky things
		// here, both stemming from the fact that the event code may be
		// re-entered while servicing the event:
		//
		// 1. Set the "proc" field to NULL.  This is a signal to ourselves
		//    that we shouldn't reexecute the handler if the event loop is
		//    re-entered.
		// 2. When freeing the event, must search the queue again from the
		//    front to find it. This is because the event queue could change
		//    almost arbitrarily while handling the event, so we can't depend
		//    on pointers found now still being valid when the handler
		//    returns.

		proc = (*Tcl_Event)(unsafe.Pointer(evPtr)).Fproc
		if proc == uintptr(0) {
			continue
		}
		(*Tcl_Event)(unsafe.Pointer(evPtr)).Fproc = uintptr(0)

		// Release the lock before calling the event function. This allows
		// other threads to post events if we enter a recursive event loop in
		// this thread. Note that we are making the assumption that if the
		// proc returns 0, the event is still in the list.

		XTcl_MutexUnlock(tls, tsdPtr+24)
		result = (*struct {
			f func(*libc.TLS, uintptr, int32) int32
		})(unsafe.Pointer(&struct{ uintptr }{proc})).f(tls, evPtr, flags)
		XTcl_MutexLock(tls, tsdPtr+24)

		if result != 0 {
			// The event was processed, so remove it from the queue.

			if (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr == evPtr {
				(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr = (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr
				if (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr == uintptr(0) {
					(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FlastEventPtr = uintptr(0)
				}
				if (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FmarkerEventPtr == evPtr {
					(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FmarkerEventPtr = uintptr(0)
				}
			} else {
				for prevPtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventPtr; prevPtr != 0 && (*Tcl_Event)(unsafe.Pointer(prevPtr)).FnextPtr != evPtr; prevPtr = (*Tcl_Event)(unsafe.Pointer(prevPtr)).FnextPtr {
					// Empty loop body.
				}
				if prevPtr != 0 {
					(*Tcl_Event)(unsafe.Pointer(prevPtr)).FnextPtr = (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr
					if (*Tcl_Event)(unsafe.Pointer(evPtr)).FnextPtr == uintptr(0) {
						(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FlastEventPtr = prevPtr
					}
					if (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FmarkerEventPtr == evPtr {
						(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FmarkerEventPtr = prevPtr
					}
				} else {
					evPtr = uintptr(0)
				}
			}
			if evPtr != 0 {
				XTclpFree(tls, evPtr)
			}
			XTcl_MutexUnlock(tls, tsdPtr+24)
			return 1
		} else {
			// The event wasn't actually handled, so we have to restore the
			// proc field to allow the event to be attempted again.

			(*Tcl_Event)(unsafe.Pointer(evPtr)).Fproc = proc
		}
	}
	XTcl_MutexUnlock(tls, tsdPtr+24)
	return 0
}

//----------------------------------------------------------------------
//
// Tcl_GetServiceMode --
//
//	This routine returns the current service mode of the notifier.
//
// Results:
//	Returns either TCL_SERVICE_ALL or TCL_SERVICE_NONE.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetServiceMode(tls *libc.TLS) int32 { /* tclNotify.c:739:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))

	return (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FserviceMode
}

//----------------------------------------------------------------------
//
// Tcl_SetServiceMode --
//
//	This routine sets the current service mode of the tsdPtr->
//
// Results:
//	Returns the previous service mode.
//
// Side effects:
//	Invokes the notifier service mode hook function.
//
//----------------------------------------------------------------------

func XTcl_SetServiceMode(tls *libc.TLS, mode int32) int32 { /* tclNotify.c:763:1: */
	var oldMode int32
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))

	oldMode = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FserviceMode
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FserviceMode = mode
	XTcl_ServiceModeHook(tls, mode)
	return oldMode
}

//----------------------------------------------------------------------
//
// Tcl_SetMaxBlockTime --
//
//	This function is invoked by event sources to tell the notifier how
//	long it may block the next time it blocks. The timePtr argument gives
//	a maximum time; the actual time may be less if some other event source
//	requested a smaller time.
//
// Results:
//	None.
//
// Side effects:
//	May reduce the length of the next sleep in the tsdPtr->
//
//----------------------------------------------------------------------

func XTcl_SetMaxBlockTime(tls *libc.TLS, timePtr uintptr) { /* tclNotify.c:796:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))

	if !((*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTimeSet != 0) || (*Tcl_Time)(unsafe.Pointer(timePtr)).Fsec < (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTime.Fsec ||
		(*Tcl_Time)(unsafe.Pointer(timePtr)).Fsec == (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTime.Fsec &&
			(*Tcl_Time)(unsafe.Pointer(timePtr)).Fusec < (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTime.Fusec {
		(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTime = *(*Tcl_Time)(unsafe.Pointer(timePtr))
		(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTimeSet = 1
	}

	// If we are called outside an event source traversal, set the timeout
	// immediately.

	if !((*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FinTraversal != 0) {
		XTcl_SetTimer(tls, tsdPtr+40)
	}
}

//----------------------------------------------------------------------
//
// Tcl_DoOneEvent --
//
//	Process a single event of some sort. If there's no work to do, wait
//	for an event to occur, then process it.
//
// Results:
//	The return value is 1 if the function actually found an event to
//	process. If no processing occurred, then 0 is returned (this can
//	happen if the TCL_DONT_WAIT flag is set or if there are no event
//	handlers to wait for in the set specified by flags).
//
// Side effects:
//	May delay execution of process while waiting for an event, unless
//	TCL_DONT_WAIT is set in the flags argument. Event sources are invoked
//	to check for and queue events. Event handlers may produce arbitrary
//	side effects.
//
//----------------------------------------------------------------------

func XTcl_DoOneEvent(tls *libc.TLS, flags int32) int32 { /* tclNotify.c:844:1: */
	var result int32
	var oldMode int32
	var sourcePtr uintptr
	var timePtr uintptr
	var tsdPtr uintptr
	result = 0
	tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))

	// The first thing we do is to service any asynchronous event handlers.

	if !(XTcl_AsyncReady(tls) != 0) {
		goto __1
	}
	XTcl_AsyncInvoke(tls, uintptr(0), 0)
	return 1
__1:
	;

	// No event flags is equivalent to TCL_ALL_EVENTS.

	if !(flags&libc.CplInt32(int32(1)<<1) == 0) {
		goto __2
	}
	flags = flags | libc.CplInt32(int32(1)<<1)
__2:
	;

	// Set the service mode to none so notifier event routines won't try to
	// service events recursively.

	oldMode = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FserviceMode
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FserviceMode = TCL_SERVICE_NONE

	// The core of this function is an infinite loop, even though we only
	// service one event. The reason for this is that we may be processing
	// events that don't do anything inside of Tcl.

__3:
	if !(1 != 0) {
		goto __4
	}
	// If idle events are the only things to service, skip the main part
	// of the loop and go directly to handle idle events (i.e. don't wait
	// even if TCL_DONT_WAIT isn't set).

	if !(flags&libc.CplInt32(int32(1)<<1) == int32(1)<<5) {
		goto __5
	}
	flags = int32(1)<<5 | int32(1)<<1
	goto idleEvents
__5:
	;

	// Ask Tcl to service a queued event, if there are any.

	if !(XTcl_ServiceEvent(tls, flags) != 0) {
		goto __6
	}
	result = 1
	goto __4
__6:
	;

	// If TCL_DONT_WAIT is set, be sure to poll rather than blocking,
	// otherwise reset the block time to infinity.

	if !(flags&(int32(1)<<1) != 0) {
		goto __7
	}
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTime.Fsec = int64(0)
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTime.Fusec = int64(0)
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTimeSet = 1
	goto __8
__7:
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTimeSet = 0
__8:
	;

	// Set up all the event sources for new events. This will cause the
	// block time to be updated if necessary.

	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FinTraversal = 1
	sourcePtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventSourcePtr
__9:
	if !(sourcePtr != uintptr(0)) {
		goto __11
	}
	if !((*EventSource)(unsafe.Pointer(sourcePtr)).FsetupProc != 0) {
		goto __12
	}
	(*struct {
		f func(*libc.TLS, ClientData, int32)
	})(unsafe.Pointer(&struct{ uintptr }{(*EventSource)(unsafe.Pointer(sourcePtr)).FsetupProc})).f(tls, (*EventSource)(unsafe.Pointer(sourcePtr)).FclientData, flags)
__12:
	;
	goto __10
__10:
	sourcePtr = (*EventSource)(unsafe.Pointer(sourcePtr)).FnextPtr
	goto __9
	goto __11
__11:
	;
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FinTraversal = 0

	if !(flags&(int32(1)<<1) != 0 || (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTimeSet != 0) {
		goto __13
	}
	timePtr = tsdPtr + 40
	goto __14
__13:
	timePtr = uintptr(0)
__14:
	;

	// Wait for a new event or a timeout. If Tcl_WaitForEvent returns -1,
	// we should abort Tcl_DoOneEvent.

	result = XTcl_WaitForEvent(tls, timePtr)
	if !(result < 0) {
		goto __15
	}
	result = 0
	goto __4
__15:
	;

	// Check all the event sources for new events.

	sourcePtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventSourcePtr
__16:
	if !(sourcePtr != uintptr(0)) {
		goto __18
	}
	if !((*EventSource)(unsafe.Pointer(sourcePtr)).FcheckProc != 0) {
		goto __19
	}
	(*struct {
		f func(*libc.TLS, ClientData, int32)
	})(unsafe.Pointer(&struct{ uintptr }{(*EventSource)(unsafe.Pointer(sourcePtr)).FcheckProc})).f(tls, (*EventSource)(unsafe.Pointer(sourcePtr)).FclientData, flags)
__19:
	;
	goto __17
__17:
	sourcePtr = (*EventSource)(unsafe.Pointer(sourcePtr)).FnextPtr
	goto __16
	goto __18
__18:
	;

	// Check for events queued by the notifier or event sources.

	if !(XTcl_ServiceEvent(tls, flags) != 0) {
		goto __20
	}
	result = 1
	goto __4
__20:
	;

	// We've tried everything at this point, but nobody we know about had
	// anything to do. Check for idle events. If none, either quit or go
	// back to the top and try again.

idleEvents:
	if !(flags&(int32(1)<<5) != 0) {
		goto __21
	}
	if !(XTclServiceIdle(tls) != 0) {
		goto __22
	}
	result = 1
	goto __4
__22:
	;
__21:
	;
	if !(flags&(int32(1)<<1) != 0) {
		goto __23
	}
	goto __4
__23:
	;

	// If Tcl_WaitForEvent has returned 1, indicating that one system
	// event has been dispatched (and thus that some Tcl code might have
	// been indirectly executed), we break out of the loop. We do this to
	// give VwaitCmd for instance a chance to check if that system event
	// had the side effect of changing the variable (so the vwait can
	// return and unwind properly).
	//
	// NB: We will process idle events if any first, because otherwise we
	//     might never do the idle events if the notifier always gets
	//     system events.

	if !(result != 0) {
		goto __24
	}
	goto __4
__24:
	;
	goto __3
__4:
	;

	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FserviceMode = oldMode
	return result
}

//----------------------------------------------------------------------
//
// Tcl_ServiceAll --
//
//	This routine checks all of the event sources, processes events that
//	are on the Tcl event queue, and then calls the any idle handlers.
//	Platform specific notifier callbacks that generate events should call
//	this routine before returning to the system in order to ensure that
//	Tcl gets a chance to process the new events.
//
// Results:
//	Returns 1 if an event or idle handler was invoked, else 0.
//
// Side effects:
//	Anything that an event or idle handler may do.
//
//----------------------------------------------------------------------

func XTcl_ServiceAll(tls *libc.TLS) int32 { /* tclNotify.c:1032:1: */
	var result int32 = 0
	var sourcePtr uintptr
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey8)), int32(unsafe.Sizeof(ThreadSpecificData9{})))

	if (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FserviceMode == TCL_SERVICE_NONE {
		return result
	}

	// We need to turn off event servicing like we to in Tcl_DoOneEvent, to
	// avoid recursive calls.

	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FserviceMode = TCL_SERVICE_NONE

	// Check async handlers first.

	if XTcl_AsyncReady(tls) != 0 {
		XTcl_AsyncInvoke(tls, uintptr(0), 0)
	}

	// Make a single pass through all event sources, queued events, and idle
	// handlers. Note that we wait to update the notifier timer until the end
	// so we can avoid multiple changes.

	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FinTraversal = 1
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTimeSet = 0

	for sourcePtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventSourcePtr; sourcePtr != uintptr(0); sourcePtr = (*EventSource)(unsafe.Pointer(sourcePtr)).FnextPtr {
		if (*EventSource)(unsafe.Pointer(sourcePtr)).FsetupProc != 0 {
			(*struct {
				f func(*libc.TLS, ClientData, int32)
			})(unsafe.Pointer(&struct{ uintptr }{(*EventSource)(unsafe.Pointer(sourcePtr)).FsetupProc})).f(tls, (*EventSource)(unsafe.Pointer(sourcePtr)).FclientData, libc.CplInt32(int32(1)<<1))
		}
	}
	for sourcePtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FfirstEventSourcePtr; sourcePtr != uintptr(0); sourcePtr = (*EventSource)(unsafe.Pointer(sourcePtr)).FnextPtr {
		if (*EventSource)(unsafe.Pointer(sourcePtr)).FcheckProc != 0 {
			(*struct {
				f func(*libc.TLS, ClientData, int32)
			})(unsafe.Pointer(&struct{ uintptr }{(*EventSource)(unsafe.Pointer(sourcePtr)).FcheckProc})).f(tls, (*EventSource)(unsafe.Pointer(sourcePtr)).FclientData, libc.CplInt32(int32(1)<<1))
		}
	}

	for XTcl_ServiceEvent(tls, 0) != 0 {
		result = 1
	}
	if XTclServiceIdle(tls) != 0 {
		result = 1
	}

	if !((*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FblockTimeSet != 0) {
		XTcl_SetTimer(tls, uintptr(0))
	} else {
		XTcl_SetTimer(tls, tsdPtr+40)
	}
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FinTraversal = 0
	(*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FserviceMode = TCL_SERVICE_ALL
	return result
}

//----------------------------------------------------------------------
//
// Tcl_ThreadAlert --
//
//	This function wakes up the notifier associated with the specified
//	thread (if there is one).
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ThreadAlert(tls *libc.TLS, threadId Tcl_ThreadId) { /* tclNotify.c:1114:1: */
	var tsdPtr uintptr

	// Find the notifier associated with the specified thread. Note that we
	// need to hold the listLock while calling Tcl_AlertNotifier to avoid a
	// race condition where the specified thread might destroy its notifier.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&listLock)))
	for tsdPtr = firstNotifierPtr; tsdPtr != 0; tsdPtr = (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FnextPtr {
		if (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FthreadId == threadId {
			XTcl_AlertNotifier(tls, (*ThreadSpecificData9)(unsafe.Pointer(tsdPtr)).FclientData)
			break
		}
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&listLock)))
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// !END!: Do not edit above this line.

// Alternatives to Tcl_Preserve/Tcl_EventuallyFree/Tcl_Release.

// A convenience macro for iterating through the lists used in the internal
// memory management of objects.
// REQUIRES DECLARATION: int i;

// Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
// sets up the declarations needed for the main macro, FOREACH_HASH, which
// does the actual iteration. FOREACH_HASH_VALUE is a restricted version that
// only iterates over values.

// Convenience macro for duplicating a list. Needs no external declaration,
// but all arguments are used multiple times and so must have no side effects.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Commands in oo::define.

var defineCmds = [10]struct {
	Fname        uintptr
	FobjProc     uintptr
	Fflag        int32
	F__ccgo_pad1 [4]byte
}{
	{Fname: ts + 25887 /* "constructor" */, FobjProc: 0},
	{Fname: ts + 46976 /* "deletemethod" */, FobjProc: 0},
	{Fname: ts + 25899 /* "destructor" */, FobjProc: 0},
	{Fname: ts + 45710 /* "export" */, FobjProc: 0},
	{Fname: ts + 46989 /* "forward" */, FobjProc: 0},
	{Fname: ts + 25917 /* "method" */, FobjProc: 0},
	{Fname: ts + 46997 /* "renamemethod" */, FobjProc: 0},
	{Fname: ts + 47010 /* "self" */, FobjProc: 0},
	{Fname: ts + 47015 /* "unexport" */, FobjProc: 0},
	{},
} /* tclOO.c:27:3 */
var objdefCmds = [8]struct {
	Fname        uintptr
	FobjProc     uintptr
	Fflag        int32
	F__ccgo_pad1 [4]byte
}{
	{Fname: ts + 16064 /* "class" */, FobjProc: 0, Fflag: 1},
	{Fname: ts + 46976 /* "deletemethod" */, FobjProc: 0, Fflag: 1},
	{Fname: ts + 45710 /* "export" */, FobjProc: 0, Fflag: 1},
	{Fname: ts + 46989 /* "forward" */, FobjProc: 0, Fflag: 1},
	{Fname: ts + 25917 /* "method" */, FobjProc: 0, Fflag: 1},
	{Fname: ts + 46997 /* "renamemethod" */, FobjProc: 0, Fflag: 1},
	{Fname: ts + 47015 /* "unexport" */, FobjProc: 0, Fflag: 1},
	{},
} /* tclOO.c:38:4 */

// Methods in the oo::object and oo::class classes. First, we define a helper
// macro that makes building the method type declaration structure a lot
// easier. No point in making life harder than it has to be!
//
// Note that the core methods don't need clone or free proc callbacks.

var objMethods = [6]DeclaredClassMethod{
	{Fname: ts + 47024, FisPublic: 1, Fdefinition: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 47032, FcallProc: 0}},
	{Fname: ts + 2409, Fdefinition: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 47055, FcallProc: 0}},
	{Fname: ts + 12865, Fdefinition: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 47075, FcallProc: 0}},
	{Fname: ts + 3432, Fdefinition: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 47098, FcallProc: 0}},
	{Fname: ts + 3696, Fdefinition: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 47122, FcallProc: 0}},
	{}} /* tclOO.c:110:34 */
var clsMethods = [4]DeclaredClassMethod{
	{Fname: ts + 23142, FisPublic: 1, Fdefinition: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 47145, FcallProc: 0}},
	{Fname: ts + 47167, FisPublic: 1, Fdefinition: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 47171, FcallProc: 0}},
	{Fname: ts + 47190, Fdefinition: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 47210, FcallProc: 0}},
	{}} /* tclOO.c:117:4 */

// And for the oo::class constructor...

var classConstructor = Tcl_MethodType{
	Fversion:  TCL_OO_METHOD_VERSION_CURRENT,
	Fname:     ts + 47245,
	FcallProc: 0,
} /* tclOO.c:128:29 */

// Scripted parts of TclOO. First, the main script (cannot be outside this
// file).

var initScript uintptr = ts + 47267 /* "package ifneeded..." */ /* tclOO.c:139:19 */
// "tcl_findLibrary tcloo $oo::version $oo::version"
// " tcloo.tcl OO_LIBRARY oo::library;";

// The scripted part of the definitions of slots.

var slotScript uintptr = ts + 47419 /* "::oo::define ::o..." */ /* tclOO.c:150:19 */

// The body of the <cloned> method of oo::object.

var clonedBody uintptr = ts + 48502 /* "foreach p [info ..." */ /* tclOO.c:183:19 */

// Convenience macro for getting the foundation from an interpreter.

// Macros to make inspecting into the guts of an object cleaner.
//
// The ocPtr parameter (only in these macros) is assumed to work fine with
// either an oPtr or a classPtr. Note that the roots oo::object and oo::class
// have _both_ their object and class flags tagged with ROOT_OBJECT and
// ROOT_CLASS respectively.

// ----------------------------------------------------------------------
//
// TclOOInit --
//
//	Called to initialise the OO system within an interpreter.
//
// Result:
//	TCL_OK if the setup succeeded. Currently assumed to always work.
//
// Side effects:
//	Creates namespaces, commands, several classes and a number of
//	callbacks. Upon return, the OO system is ready for use.
//
// ----------------------------------------------------------------------

func XTclOOInit(tls *libc.TLS, interp uintptr) int32 { /* tclOO.c:258:1: */
	// Build the core of the OO system.

	if sInitFoundation(tls, interp) != TCL_OK {
		return TCL_ERROR
	}

	// Run our initialization script and, if that works, declare the package
	// to be fully provided.

	if XTcl_Eval(tls, interp, initScript) != TCL_OK {
		return TCL_ERROR
	}

	return XTcl_PkgProvideEx(tls, interp, ts+49138, ts+49144,
		uintptr(unsafe.Pointer(&XtclOOStubs)))
}

// ----------------------------------------------------------------------
//
// TclOOGetFoundation --
//
//	Get a reference to the OO core class system.
//
// ----------------------------------------------------------------------

func XTclOOGetFoundation(tls *libc.TLS, interp uintptr) uintptr { /* tclOO.c:292:12: */
	return (*Interp)(unsafe.Pointer(interp)).FobjectFoundation
}

// ----------------------------------------------------------------------
//
// InitFoundation --
//
//	Set up the core of the OO core class system. This is a structure
//	holding references to the magical bits that need to be known about in
//	other places, plus the oo::object and oo::class classes.
//
// ----------------------------------------------------------------------

func sInitFoundation(tls *libc.TLS, interp uintptr) int32 { /* tclOO.c:312:1: */
	bp := tls.Alloc(632)
	defer tls.Free(632)

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&tsdKey)), int32(unsafe.Sizeof(ThreadLocalData{})))
	var fPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Foundation{})))
	var namePtr uintptr
	var argsPtr uintptr
	var bodyPtr uintptr
	// var fakeCls Class at bp+216, 264

	// var fakeObject Object at bp+480, 152

	// var buffer Tcl_DString at bp, 216

	var cmdPtr uintptr
	var i int32

	// Initialize the structure that holds the OO system core. This is
	// attached to the interpreter via an assocData entry; not very efficient,
	// but the best we can do without hacking the core more.

	libc.Xmemset(tls, fPtr, 0, uint64(unsafe.Sizeof(Foundation{})))
	(*Interp)(unsafe.Pointer(interp)).FobjectFoundation = fPtr
	(*Foundation)(unsafe.Pointer(fPtr)).Finterp = interp
	(*Foundation)(unsafe.Pointer(fPtr)).FooNs = XTcl_CreateNamespace(tls, interp, ts+49150, fPtr, uintptr(0))
	XTcl_Export(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FooNs, ts+49155, 1)
	(*Foundation)(unsafe.Pointer(fPtr)).FdefineNs = XTcl_CreateNamespace(tls, interp, ts+49162, fPtr,
		*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeletedDefineNamespace})))
	(*Foundation)(unsafe.Pointer(fPtr)).FobjdefNs = XTcl_CreateNamespace(tls, interp, ts+49175, fPtr,
		*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeletedObjdefNamespace})))
	(*Foundation)(unsafe.Pointer(fPtr)).FhelpersNs = XTcl_CreateNamespace(tls, interp, ts+49191, fPtr,
		*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sDeletedHelpersNamespace})))
	(*Foundation)(unsafe.Pointer(fPtr)).Fepoch = 0
	(*Foundation)(unsafe.Pointer(fPtr)).FtsdPtr = tsdPtr
	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				(*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj = XTclThreadAllocObj(tls)
			} else {
				(*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).Fbytes, ts+12865, uint64(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).Fbytes + 7)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).Flength = int32(uint64(unsafe.Sizeof([8]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).FtypePtr = uintptr(0)
		{
		}
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				(*Foundation)(unsafe.Pointer(fPtr)).FconstructorName = XTclThreadAllocObj(tls)
			} else {
				(*Foundation)(unsafe.Pointer(fPtr)).FconstructorName = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([14]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([14]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).Fbytes, ts+49205, uint64(int32(uint64(unsafe.Sizeof([14]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).Fbytes + 13)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).Flength = int32(uint64(unsafe.Sizeof([14]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).FtypePtr = uintptr(0)
		{
		}
	}
	for ok4 := true; ok4; ok4 = 0 != 0 {
		for ok5 := true; ok5; ok5 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				(*Foundation)(unsafe.Pointer(fPtr)).FdestructorName = XTclThreadAllocObj(tls)
			} else {
				(*Foundation)(unsafe.Pointer(fPtr)).FdestructorName = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).Fbytes, ts+49219, uint64(int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).Fbytes + 12)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).Flength = int32(uint64(unsafe.Sizeof([13]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).FtypePtr = uintptr(0)
		{
		}
	}
	for ok6 := true; ok6; ok6 = 0 != 0 {
		for ok7 := true; ok7; ok7 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				(*Foundation)(unsafe.Pointer(fPtr)).FclonedName = XTclThreadAllocObj(tls)
			} else {
				(*Foundation)(unsafe.Pointer(fPtr)).FclonedName = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).Fbytes, ts+49232, uint64(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).Fbytes + 8)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).Flength = int32(uint64(unsafe.Sizeof([9]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).FtypePtr = uintptr(0)
		{
		}
	}
	for ok8 := true; ok8; ok8 = 0 != 0 {
		for ok9 := true; ok9; ok9 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				(*Foundation)(unsafe.Pointer(fPtr)).FdefineName = XTclThreadAllocObj(tls)
			} else {
				(*Foundation)(unsafe.Pointer(fPtr)).FdefineName = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).Fbytes, ts+49162, uint64(int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).Fbytes + 12)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).Flength = int32(uint64(unsafe.Sizeof([13]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).FrefCount++
	XTcl_CreateObjCommand(tls, interp, ts+49241,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclOOUnknownDefinition})), uintptr(0), uintptr(0))
	for ok10 := true; ok10; ok10 = 0 != 0 {
		for ok11 := true; ok11; ok11 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				namePtr = XTclThreadAllocObj(tls)
			} else {
				namePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(namePtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(namePtr)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([24]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(namePtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([24]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes, ts+49241, uint64(int32(uint64(unsafe.Sizeof([24]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes + 23)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(namePtr)).Flength = int32(uint64(unsafe.Sizeof([24]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(namePtr)).FtypePtr = uintptr(0)
		{
		}
	}
	XTcl_SetNamespaceUnknownHandler(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FdefineNs, namePtr)
	XTcl_SetNamespaceUnknownHandler(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FobjdefNs, namePtr)

	// Create the subcommands in the oo::define and oo::objdefine spaces.

	XTcl_DStringInit(tls, bp)
	for i = 0; defineCmds[i].Fname != 0; i++ {
		XTcl_DStringAppend(tls, bp, ts+49265, int32(uint64(unsafe.Sizeof([15]int8{}))-uint64(1)))
		XTcl_DStringAppend(tls, bp, defineCmds[i].Fname, -1)
		XTcl_CreateObjCommand(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring,
			defineCmds[i].FobjProc, uintptr(Intptr_t(defineCmds[i].Fflag)), uintptr(0))
		XTcl_DStringFree(tls, bp)
	}
	for i = 0; objdefCmds[i].Fname != 0; i++ {
		XTcl_DStringAppend(tls, bp, ts+49280, int32(uint64(unsafe.Sizeof([18]int8{}))-uint64(1)))
		XTcl_DStringAppend(tls, bp, objdefCmds[i].Fname, -1)
		XTcl_CreateObjCommand(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring,
			objdefCmds[i].FobjProc, uintptr(Intptr_t(objdefCmds[i].Fflag)), uintptr(0))
		XTcl_DStringFree(tls, bp)
	}

	XTcl_CallWhenDeleted(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr)
	}{sKillFoundation})), uintptr(0))

	// Create the objects at the core of the object system. These need to be
	// spliced manually.

	// Stand up a phony class for bootstrapping.

	(*Foundation)(unsafe.Pointer(fPtr)).FobjectCls = bp + 216 /* &fakeCls */

	// Referenced in TclOOAllocClass to increment the refCount.

	(*Class)(unsafe.Pointer(bp + 216 /* &fakeCls */)).FthisPtr = bp + 480 /* &fakeObject */

	(*Foundation)(unsafe.Pointer(fPtr)).FobjectCls = XTclOOAllocClass(tls, interp,
		sAllocObject(tls, interp, ts+18716, (*Foundation)(unsafe.Pointer(fPtr)).FooNs, uintptr(0)))
	// Corresponding TclOODecrRefCount in KillFoudation.

	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)).FthisPtr)).FrefCount++

	// This is why it is unnecessary in this routine to replace the
	// incremented reference count of fPtr->objectCls that was swallowed by
	// fakeObject.

	(*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)).Fsuperclasses.Fnum = 0
	XTclpFree(tls, (*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)).Fsuperclasses.Flist)
	(*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)).Fsuperclasses.Flist = uintptr(0)

	// Special initialization for the primordial objects.

	*(*int32)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)).FthisPtr + 92)) |= ROOT_OBJECT
	*(*int32)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls + 8)) |= ROOT_OBJECT

	(*Foundation)(unsafe.Pointer(fPtr)).FclassCls = XTclOOAllocClass(tls, interp,
		sAllocObject(tls, interp, ts+16064, (*Foundation)(unsafe.Pointer(fPtr)).FooNs, uintptr(0)))

	// Corresponding TclOODecrRefCount in KillFoudation.

	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls)).FthisPtr)).FrefCount++

	// Increment reference counts for each reference because these
	// relationships can be dynamically changed.
	//
	// Corresponding TclOODecrRefCount for all incremented refcounts is in
	// KillFoundation.

	// Rewire bootstrapped objects.

	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)).FthisPtr)).FselfCls = (*Foundation)(unsafe.Pointer(fPtr)).FclassCls
	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls)).FthisPtr)).FrefCount++
	XTclOOAddToInstances(tls, (*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)).FthisPtr, (*Foundation)(unsafe.Pointer(fPtr)).FclassCls)

	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls)).FthisPtr)).FselfCls = (*Foundation)(unsafe.Pointer(fPtr)).FclassCls
	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls)).FthisPtr)).FrefCount++
	XTclOOAddToInstances(tls, (*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls)).FthisPtr, (*Foundation)(unsafe.Pointer(fPtr)).FclassCls)

	*(*int32)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls)).FthisPtr + 92)) |= ROOT_CLASS
	*(*int32)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls + 8)) |= ROOT_CLASS

	// Standard initialization for new Objects.

	XTclOOAddToSubclasses(tls, (*Foundation)(unsafe.Pointer(fPtr)).FclassCls, (*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)

	// Basic method declarations for the core classes.

	for i = 0; objMethods[i].Fname != 0; i++ {
		XTclOONewBasicMethod(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FobjectCls, uintptr(unsafe.Pointer(&objMethods))+uintptr(i)*56)
	}
	for i = 0; clsMethods[i].Fname != 0; i++ {
		XTclOONewBasicMethod(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FclassCls, uintptr(unsafe.Pointer(&clsMethods))+uintptr(i)*56)
	}

	// Create the default <cloned> method implementation, used when 'oo::copy'
	// is called to finish the copying of one object to another.

	for ok12 := true; ok12; ok12 = 0 != 0 {
		for ok13 := true; ok13; ok13 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				argsPtr = XTclThreadAllocObj(tls)
			} else {
				argsPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(argsPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(argsPtr)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(argsPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(argsPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(argsPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(argsPtr)).Fbytes, ts+49298, uint64(int32(uint64(unsafe.Sizeof([13]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(argsPtr)).Fbytes + 12)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(argsPtr)).Flength = int32(uint64(unsafe.Sizeof([13]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(argsPtr)).FtypePtr = uintptr(0)
		{
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(argsPtr)).FrefCount++
	bodyPtr = XTcl_NewStringObj(tls, clonedBody, -1)
	XTclOONewProcMethod(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FobjectCls, 0, (*Foundation)(unsafe.Pointer(fPtr)).FclonedName, argsPtr,
		bodyPtr, uintptr(0))
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(argsPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(argsPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(argsPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(argsPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(argsPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(argsPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(argsPtr)).Flength = -1
			for ok14 := true; ok14; ok14 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, argsPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(argsPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = argsPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, argsPtr)
		}
	}

	// Finish setting up the class of classes by marking the 'new' method as
	// private; classes, unlike general objects, must have explicit names. We
	// also need to create the constructor for classes.

	for ok15 := true; ok15; ok15 = 0 != 0 {
		for ok16 := true; ok16; ok16 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				namePtr = XTclThreadAllocObj(tls)
			} else {
				namePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(namePtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(namePtr)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(namePtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes, ts+47167, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes + 3)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(namePtr)).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(namePtr)).FtypePtr = uintptr(0)
		{
		}
	}
	XTcl_NewInstanceMethod(tls, interp, (*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls)).FthisPtr,
		namePtr, 0, uintptr(0), uintptr(0))
	(*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls)).FconstructorPtr = XTcl_NewMethod(tls, interp,
		(*Foundation)(unsafe.Pointer(fPtr)).FclassCls, uintptr(0), 0, uintptr(unsafe.Pointer(&classConstructor)), uintptr(0))

	// Create non-object commands and plug ourselves into the Tcl [info]
	// ensemble.

	cmdPtr = XTcl_NRCreateCommand(tls, interp, ts+49311,
		uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclOONextObjCmd})), uintptr(0), uintptr(0))
	(*Command)(unsafe.Pointer(cmdPtr)).FcompileProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
	}{XTclCompileObjectNextCmd}))
	cmdPtr = XTcl_NRCreateCommand(tls, interp, ts+49331,
		uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclOONextToObjCmd})), uintptr(0), uintptr(0))
	(*Command)(unsafe.Pointer(cmdPtr)).FcompileProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
	}{XTclCompileObjectNextToCmd}))
	cmdPtr = XTcl_CreateObjCommand(tls, interp, ts+49353,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclOOSelfObjCmd})), uintptr(0), uintptr(0))
	(*Command)(unsafe.Pointer(cmdPtr)).FcompileProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
	}{XTclCompileObjectSelfCmd}))
	XTcl_CreateObjCommand(tls, interp, ts+49162, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclOODefineObjCmd})), uintptr(0),
		uintptr(0))
	XTcl_CreateObjCommand(tls, interp, ts+49175, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclOOObjDefObjCmd})), uintptr(0),
		uintptr(0))
	XTcl_CreateObjCommand(tls, interp, ts+49373, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclOOCopyObjectCmd})), uintptr(0), uintptr(0))
	XTclOOInitInfo(tls, interp)

	// Now make the class of slots.

	if XTclOODefineSlots(tls, fPtr) != TCL_OK {
		return TCL_ERROR
	}
	return XTcl_Eval(tls, interp, slotScript)
}

var tsdKey Tcl_ThreadDataKey /* tclOO.c:315:30: */

// ----------------------------------------------------------------------
//
// DeletedDefineNamespace, DeletedObjdefNamespace, DeletedHelpersNamespace --
//
//	Simple helpers used to clear fields of the foundation when they no
//	longer hold useful information.
//
// ----------------------------------------------------------------------

func sDeletedDefineNamespace(tls *libc.TLS, clientData ClientData) { /* tclOO.c:543:1: */
	var fPtr uintptr = clientData

	(*Foundation)(unsafe.Pointer(fPtr)).FdefineNs = uintptr(0)
}

func sDeletedObjdefNamespace(tls *libc.TLS, clientData ClientData) { /* tclOO.c:552:1: */
	var fPtr uintptr = clientData

	(*Foundation)(unsafe.Pointer(fPtr)).FobjdefNs = uintptr(0)
}

func sDeletedHelpersNamespace(tls *libc.TLS, clientData ClientData) { /* tclOO.c:561:1: */
	var fPtr uintptr = clientData

	(*Foundation)(unsafe.Pointer(fPtr)).FhelpersNs = uintptr(0)
}

// ----------------------------------------------------------------------
//
// KillFoundation --
//
//	Delete those parts of the OO core that are not deleted automatically
//	when the objects and classes themselves are destroyed.
//
// ----------------------------------------------------------------------

func sKillFoundation(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclOO.c:581:1: */
	var fPtr uintptr = (*Interp)(unsafe.Pointer(interp)).FobjectFoundation

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, (*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)
				} else {
					*(*uintptr)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, (*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj)
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)).Flength = -1
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, (*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)
				} else {
					*(*uintptr)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FconstructorName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*Foundation)(unsafe.Pointer(fPtr)).FconstructorName
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, (*Foundation)(unsafe.Pointer(fPtr)).FconstructorName)
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)).Flength = -1
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, (*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)
				} else {
					*(*uintptr)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdestructorName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*Foundation)(unsafe.Pointer(fPtr)).FdestructorName
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, (*Foundation)(unsafe.Pointer(fPtr)).FdestructorName)
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName)).Flength = -1
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, (*Foundation)(unsafe.Pointer(fPtr)).FclonedName)
				} else {
					*(*uintptr)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclonedName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*Foundation)(unsafe.Pointer(fPtr)).FclonedName
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, (*Foundation)(unsafe.Pointer(fPtr)).FclonedName)
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName)).Flength = -1
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, (*Foundation)(unsafe.Pointer(fPtr)).FdefineName)
				} else {
					*(*uintptr)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FdefineName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*Foundation)(unsafe.Pointer(fPtr)).FdefineName
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, (*Foundation)(unsafe.Pointer(fPtr)).FdefineName)
		}
	}

	XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)).FthisPtr)
	XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls)).FthisPtr)

	XTclpFree(tls, fPtr)
}

// ----------------------------------------------------------------------
//
// AllocObject --
//
//	Allocate an object of basic type. Does not splice the object into its
//	class's instance list.  The caller must set the classPtr on the object
//	to either a class or NULL, call TclOOAddToInstances to add the object
//	to the class's instance list, and if the object itself is a class, use
//	call TclOOAddToSubclasses() to add it to the right class's list of
//	subclasses.
//
// ----------------------------------------------------------------------

func sAllocObject(tls *libc.TLS, interp uintptr, nameStr uintptr, nsPtr uintptr, nsNameStr uintptr) uintptr { /* tclOO.c:615:15: */
	bp := tls.Alloc(42)
	defer tls.Free(42)

	var fPtr uintptr
	var oPtr uintptr
	var cmdPtr uintptr
	var tracePtr uintptr
	var creationEpoch int32
	// var objName [34]int8 at bp+8, 34
	fPtr = (*Interp)(unsafe.Pointer(interp)).FobjectFoundation

	oPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Object{})))
	libc.Xmemset(tls, oPtr, 0, uint64(unsafe.Sizeof(Object{})))

	// Every object has a namespace; make one. Note that this also normally
	// computes the creation epoch value for the object, a sequence number
	// that is unique to the object (and which allows us to manage method
	// caching without comparing pointers).
	//
	// When creating a namespace, we first check to see if the caller
	// specified the name for the namespace. If not, we generate namespace
	// names using the epoch until such time as a new namespace is actually
	// created.

	if !(nsNameStr != uintptr(0)) {
		goto __1
	}
	(*Object)(unsafe.Pointer(oPtr)).FnamespacePtr = XTcl_CreateNamespace(tls, interp, nsNameStr, oPtr, uintptr(0))
	if !((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr != uintptr(0)) {
		goto __2
	}
	creationEpoch = libc.PreIncInt32(&(*ThreadLocalData)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FtsdPtr)).FnsCount, 1)
	goto configNamespace
__2:
	;
	XTcl_ResetResult(tls, interp)
__1:
	;

__3:
	if !(1 != 0) {
		goto __4
	}

	libc.Xsprintf(tls, bp+8, ts+49384, libc.VaList(bp, libc.PreIncInt32(&(*ThreadLocalData)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FtsdPtr)).FnsCount, 1)))
	(*Object)(unsafe.Pointer(oPtr)).FnamespacePtr = XTcl_CreateNamespace(tls, interp, bp+8, oPtr, uintptr(0))
	if !((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr != uintptr(0)) {
		goto __5
	}
	creationEpoch = (*ThreadLocalData)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FtsdPtr)).FnsCount
	goto __4
__5:
	;

	// Could not make that namespace, so we make another. But first we
	// have to get rid of the error message from Tcl_CreateNamespace,
	// since that's something that should not be exposed to the user.

	XTcl_ResetResult(tls, interp)
	goto __3
__4:
	;

configNamespace:
	(*Namespace)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)).FrefCount++

	// Make the namespace know about the helper commands. This grants access
	// to the [self] and [next] commands.

	if !((*Foundation)(unsafe.Pointer(fPtr)).FhelpersNs != uintptr(0)) {
		goto __6
	}
	XTclSetNsPath(tls, (*Object)(unsafe.Pointer(oPtr)).FnamespacePtr, 1, fPtr+48)
__6:
	;
	XTclOOSetupVariableResolver(tls, (*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)

	// Suppress use of compiled versions of the commands in this object's
	// namespace and its children; causes wrong behaviour without expensive
	// recompilation. [Bug 2037727]

	*(*int32)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr + 144)) |= NS_SUPPRESS_COMPILATION

	// Set up a callback to get notification of the deletion of a namespace
	// when enough of the namespace still remains to execute commands and
	// access variables in it. [Bug 2950259]

	(*Namespace)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)).FearlyDeleteProc = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sObjectNamespaceDeleted}))

	// Fill in the rest of the non-zero/NULL parts of the structure.

	(*Object)(unsafe.Pointer(oPtr)).FfPtr = fPtr
	(*Object)(unsafe.Pointer(oPtr)).FcreationEpoch = creationEpoch

	// An object starts life with a refCount of 2 to mark the two stages of
	// destruction it occur:  A call to ObjectRenamedTrace(), and a call to
	// ObjectNamespaceDeleted().
	(*Object)(unsafe.Pointer(oPtr)).FrefCount = 2

	(*Object)(unsafe.Pointer(oPtr)).Fflags = USE_CLASS_CACHE

	// Finally, create the object commands and initialize the trace on the
	// public command (so that the object structures are deleted when the
	// command is deleted).

	if !!(nameStr != 0) {
		goto __7
	}
	nameStr = (*Tcl_Namespace)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)).Fname
	nsPtr = (*Object)(unsafe.Pointer(oPtr)).FnamespacePtr
	if !((*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr != uintptr(0)) {
		goto __8
	}
	nsPtr = (*Namespace)(unsafe.Pointer(nsPtr)).FparentPtr
__8:
	;

__7:
	;
	(*Object)(unsafe.Pointer(oPtr)).Fcommand = XTclCreateObjCommandInNs(tls, interp, nameStr,
		nsPtr, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sPublicObjectCmd})), oPtr, uintptr(0))

	// Add the NRE command and trace directly. While this breaks a number of
	// abstractions, it is faster and we're inside Tcl here so we're allowed.

	cmdPtr = (*Object)(unsafe.Pointer(oPtr)).Fcommand
	(*Command)(unsafe.Pointer(cmdPtr)).FnreProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sPublicNRObjectCmd}))
	(*Command)(unsafe.Pointer(cmdPtr)).FtracePtr = libc.AssignUintptr(&tracePtr, XTcl_Alloc(tls, uint32(unsafe.Sizeof(CommandTrace{}))))
	(*CommandTrace)(unsafe.Pointer(tracePtr)).FtraceProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
	}{sObjectRenamedTrace}))
	(*CommandTrace)(unsafe.Pointer(tracePtr)).FclientData = oPtr
	(*CommandTrace)(unsafe.Pointer(tracePtr)).Fflags = TCL_TRACE_RENAME | TCL_TRACE_DELETE
	(*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr = uintptr(0)
	(*CommandTrace)(unsafe.Pointer(tracePtr)).FrefCount = 1

	(*Object)(unsafe.Pointer(oPtr)).FmyCommand = XTclNRCreateCommandInNs(tls, interp, ts+49396, (*Object)(unsafe.Pointer(oPtr)).FnamespacePtr,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sPrivateObjectCmd})), *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sPrivateNRObjectCmd})), oPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sMyDeleted})))
	return oPtr
}

// ----------------------------------------------------------------------
//
// SquelchCachedName --
//
//	Encapsulates how to throw away a cached object name. Called from
//	object rename traces and at object destruction.
//
// ----------------------------------------------------------------------

func sSquelchCachedName(tls *libc.TLS, oPtr uintptr) { /* tclOO.c:773:1: */
	if (*Object)(unsafe.Pointer(oPtr)).FcachedNameObj != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Object)(unsafe.Pointer(oPtr)).FcachedNameObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Object)(unsafe.Pointer(oPtr)).FcachedNameObj = uintptr(0)
	}
}

// ----------------------------------------------------------------------
//
// MyDeleted --
//
//	This callback is triggered when the object's [my] command is deleted
//	by any mechanism. It just marks the object as not having a [my]
//	command, and so prevents cleanup of that when the object itself is
//	deleted.
//
// ----------------------------------------------------------------------

func sMyDeleted(tls *libc.TLS, clientData ClientData) { /* tclOO.c:796:1: */
	var oPtr uintptr = clientData

	(*Object)(unsafe.Pointer(oPtr)).FmyCommand = uintptr(0)
}

// ----------------------------------------------------------------------
//
// ObjectRenamedTrace --
//
//	This callback is triggered when the object is deleted by any
//	mechanism. It runs the destructors and arranges for the actual cleanup
//	of the object's namespace, which in turn triggers cleansing of the
//	object data structures.
//
// ----------------------------------------------------------------------

func sObjectRenamedTrace(tls *libc.TLS, clientData ClientData, interp uintptr, oldName uintptr, newName uintptr, flags int32) { /* tclOO.c:819:1: */
	var oPtr uintptr = clientData
	// If this is a rename and not a delete of the object, we just flush the
	// cache of the object name.

	if flags&TCL_TRACE_RENAME != 0 {
		sSquelchCachedName(tls, oPtr)
		return
	}

	// The namespace is only deleted if it hasn't already been deleted. [Bug
	// 2950259].

	if !((*Object)(unsafe.Pointer(oPtr)).Fflags&OBJECT_DESTRUCTING != 0) {
		XTcl_DeleteNamespace(tls, (*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)
	}
	(*Object)(unsafe.Pointer(oPtr)).Fcommand = uintptr(0)
	XTclOODecrRefCount(tls, oPtr)
	return
}

// ----------------------------------------------------------------------
//
// TclOODeleteDescendants --
//
//	Delete all descendants of a particular class.
//
// ----------------------------------------------------------------------

func XTclOODeleteDescendants(tls *libc.TLS, interp uintptr, oPtr uintptr) { /* tclOO.c:861:1: */
	var clsPtr uintptr = (*Object)(unsafe.Pointer(oPtr)).FclassPtr
	var subclassPtr uintptr
	var mixinSubclassPtr uintptr
	var instancePtr uintptr

	// Squelch classes that this class has been mixed into.

	if (*Class)(unsafe.Pointer(clsPtr)).FmixinSubs.Fnum > 0 {
		for (*Class)(unsafe.Pointer(clsPtr)).FmixinSubs.Fnum > 0 {
			mixinSubclassPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FmixinSubs.Flist + uintptr((*Class)(unsafe.Pointer(clsPtr)).FmixinSubs.Fnum-1)*8))

			// This condition also covers the case where mixinSubclassPtr ==
			// clsPtr

			if !((*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(mixinSubclassPtr)).FthisPtr)).Fflags&OBJECT_DESTRUCTING != 0) &&
				!((*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(mixinSubclassPtr)).FthisPtr)).Fflags&DONT_DELETE != 0) {
				XTcl_DeleteCommandFromToken(tls, interp,
					(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(mixinSubclassPtr)).FthisPtr)).Fcommand)
			}
			XTclOORemoveFromMixinSubs(tls, mixinSubclassPtr, clsPtr)
		}
	}
	if (*Class)(unsafe.Pointer(clsPtr)).FmixinSubs.Fsize > 0 {
		XTclpFree(tls, (*Class)(unsafe.Pointer(clsPtr)).FmixinSubs.Flist)
		(*Class)(unsafe.Pointer(clsPtr)).FmixinSubs.Fsize = 0
	}
	// Squelch subclasses of this class.

	if (*Class)(unsafe.Pointer(clsPtr)).Fsubclasses.Fnum > 0 {
		for (*Class)(unsafe.Pointer(clsPtr)).Fsubclasses.Fnum > 0 {
			subclassPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsubclasses.Flist + uintptr((*Class)(unsafe.Pointer(clsPtr)).Fsubclasses.Fnum-1)*8))
			if !((*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(subclassPtr)).FthisPtr)).Fflags&OBJECT_DESTRUCTING != 0) && !((*Class)(unsafe.Pointer(subclassPtr)).Fflags&(ROOT_OBJECT|ROOT_CLASS) != 0) &&
				!((*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(subclassPtr)).FthisPtr)).Fflags&DONT_DELETE != 0) {
				XTcl_DeleteCommandFromToken(tls, interp,
					(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(subclassPtr)).FthisPtr)).Fcommand)
			}
			XTclOORemoveFromSubclasses(tls, subclassPtr, clsPtr)
		}
	}
	if (*Class)(unsafe.Pointer(clsPtr)).Fsubclasses.Fsize > 0 {
		XTclpFree(tls, (*Class)(unsafe.Pointer(clsPtr)).Fsubclasses.Flist)
		(*Class)(unsafe.Pointer(clsPtr)).Fsubclasses.Flist = uintptr(0)
		(*Class)(unsafe.Pointer(clsPtr)).Fsubclasses.Fsize = 0
	}

	// Squelch instances of this class (includes objects we're mixed into).

	if (*Class)(unsafe.Pointer(clsPtr)).Finstances.Fnum > 0 {
		for (*Class)(unsafe.Pointer(clsPtr)).Finstances.Fnum > 0 {
			instancePtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist + uintptr((*Class)(unsafe.Pointer(clsPtr)).Finstances.Fnum-1)*8))

			// This condition also covers the case where instancePtr == oPtr

			if !((*Object)(unsafe.Pointer(instancePtr)).Fflags&OBJECT_DESTRUCTING != 0) && !((*Object)(unsafe.Pointer(instancePtr)).Fflags&(ROOT_OBJECT|ROOT_CLASS) != 0) && !((*Object)(unsafe.Pointer(instancePtr)).Fflags&DONT_DELETE != 0) {
				XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer(instancePtr)).Fcommand)
			}
			XTclOORemoveFromInstances(tls, instancePtr, clsPtr)
		}
	}
	if (*Class)(unsafe.Pointer(clsPtr)).Finstances.Fsize > 0 {
		XTclpFree(tls, (*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist)
		(*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist = uintptr(0)
		(*Class)(unsafe.Pointer(clsPtr)).Finstances.Fsize = 0
	}
}

// ----------------------------------------------------------------------
//
// TclOOReleaseClassContents --
//
//	Tear down the special class data structure, including deleting all
//	dependent classes and objects.
//
// ----------------------------------------------------------------------

func XTclOOReleaseClassContents(tls *libc.TLS, interp uintptr, oPtr uintptr) { /* tclOO.c:953:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var hPtr uintptr
	// var search Tcl_HashSearch at bp+16, 24

	var i int32
	var clsPtr uintptr = (*Object)(unsafe.Pointer(oPtr)).FclassPtr
	var tmpClsPtr uintptr
	var mPtr uintptr
	var fPtr uintptr = (*Object)(unsafe.Pointer(oPtr)).FfPtr
	var variableObj uintptr

	// Sanity check!

	if !((*Object)(unsafe.Pointer(oPtr)).Fflags&OBJECT_DESTRUCTING != 0) {
		if (*Object)(unsafe.Pointer(oPtr)).Fflags&ROOT_CLASS != 0 {
			XTcl_Panic(tls, ts+49399,
				libc.VaList(bp, ts+49443))
		} else if (*Object)(unsafe.Pointer(oPtr)).Fflags&ROOT_OBJECT != 0 {
			XTcl_Panic(tls, ts+49399,
				libc.VaList(bp+8, ts+49455))
		}
	}

	// Squelch method implementation chain caches.

	if (*Class)(unsafe.Pointer(clsPtr)).FconstructorChainPtr != 0 {
		XTclOODeleteChain(tls, (*Class)(unsafe.Pointer(clsPtr)).FconstructorChainPtr)
		(*Class)(unsafe.Pointer(clsPtr)).FconstructorChainPtr = uintptr(0)
	}
	if (*Class)(unsafe.Pointer(clsPtr)).FdestructorChainPtr != 0 {
		XTclOODeleteChain(tls, (*Class)(unsafe.Pointer(clsPtr)).FdestructorChainPtr)
		(*Class)(unsafe.Pointer(clsPtr)).FdestructorChainPtr = uintptr(0)
	}
	if (*Class)(unsafe.Pointer(clsPtr)).FclassChainCache != 0 {
		var callPtr uintptr

		for hPtr = XTcl_FirstHashEntry(tls, (*Class)(unsafe.Pointer(clsPtr)).FclassChainCache, bp+16); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 { callPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData; return 1 }()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+16) {
			XTclOODeleteChain(tls, callPtr)
		}
		XTcl_DeleteHashTable(tls, (*Class)(unsafe.Pointer(clsPtr)).FclassChainCache)
		XTclpFree(tls, (*Class)(unsafe.Pointer(clsPtr)).FclassChainCache)
		(*Class)(unsafe.Pointer(clsPtr)).FclassChainCache = uintptr(0)
	}

	// Squelch our filter list.

	if (*Class)(unsafe.Pointer(clsPtr)).Ffilters.Fnum != 0 {
		var filterObj uintptr

		for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Ffilters.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Ffilters.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				filterObj = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Ffilters.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(filterObj)).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer(filterObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(filterObj)).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer(filterObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(filterObj)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(filterObj)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer(filterObj)).Flength = -1
						for ok := true; ok; ok = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, filterObj)
							} else {
								*(*uintptr)(unsafe.Pointer(filterObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = filterObj
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, filterObj)
					}
				}

			}
		}
		XTclpFree(tls, (*Class)(unsafe.Pointer(clsPtr)).Ffilters.Flist)
		(*Class)(unsafe.Pointer(clsPtr)).Ffilters.Flist = uintptr(0)
		(*Class)(unsafe.Pointer(clsPtr)).Ffilters.Fnum = 0
	}

	// Squelch our metadata.

	if (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr != uintptr(0) {
		var metadataTypePtr uintptr
		var value ClientData

		for hPtr = XTcl_FirstHashEntry(tls, (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr, bp+16); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					metadataTypePtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					value = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+16) {
			(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjectMetadataType)(unsafe.Pointer(metadataTypePtr)).FdeleteProc})).f(tls, value)
		}
		XTcl_DeleteHashTable(tls, (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr)
		XTclpFree(tls, (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr)
		(*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr = uintptr(0)
	}

	if (*Class)(unsafe.Pointer(clsPtr)).Fmixins.Fnum != 0 {
		for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Fmixins.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				tmpClsPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				XTclOORemoveFromMixinSubs(tls, clsPtr, tmpClsPtr)
				XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(tmpClsPtr)).FthisPtr)
			}
		}
		XTclpFree(tls, (*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist)
		(*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist = uintptr(0)
		(*Class)(unsafe.Pointer(clsPtr)).Fmixins.Fnum = 0
	}

	if (*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum > 0 {
		for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				tmpClsPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				XTclOORemoveFromSubclasses(tls, clsPtr, tmpClsPtr)
				XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(tmpClsPtr)).FthisPtr)
			}
		}
		XTclpFree(tls, (*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist)
		(*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum = 0
		(*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist = uintptr(0)
	}

	for hPtr = XTcl_FirstHashEntry(tls, clsPtr+112, bp+16); func() int32 {
		if hPtr != uintptr(0) {
			return func() int32 { mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData; return 1 }()
		}
		return 0
	}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+16) {
		XTclOODelMethodRef(tls, mPtr)
	}
	XTcl_DeleteHashTable(tls, clsPtr+112)
	XTclOODelMethodRef(tls, (*Class)(unsafe.Pointer(clsPtr)).FconstructorPtr)
	XTclOODelMethodRef(tls, (*Class)(unsafe.Pointer(clsPtr)).FdestructorPtr)

	for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Fvariables.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			variableObj = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fvariables.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(variableObj)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(variableObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(variableObj)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(variableObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(variableObj)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(variableObj)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(variableObj)).Flength = -1
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, variableObj)
						} else {
							*(*uintptr)(unsafe.Pointer(variableObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = variableObj
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, variableObj)
				}
			}

		}
	}
	if i != 0 {
		XTclpFree(tls, (*Class)(unsafe.Pointer(clsPtr)).Fvariables.Flist)
	}

	if (*Object)(unsafe.Pointer(oPtr)).Fflags&ROOT_CLASS != 0 && !((*Object)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)).FthisPtr)).Fflags&OBJECT_DESTRUCTING != 0) {
		XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)).FthisPtr)).Fcommand)
	}
}

// ----------------------------------------------------------------------
//
// ObjectNamespaceDeleted --
//
//	Callback when the object's namespace is deleted. Used to clean up the
//	data structures associated with the object. The complicated bit is
//	that this can sometimes happen before the object's command is deleted
//	(interpreter teardown is complex!)
//
// ----------------------------------------------------------------------

func sObjectNamespaceDeleted(tls *libc.TLS, clientData ClientData) { /* tclOO.c:1085:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var oPtr uintptr = clientData
	var fPtr uintptr = (*Object)(unsafe.Pointer(oPtr)).FfPtr
	var hPtr uintptr
	// var search Tcl_HashSearch at bp, 24

	var mixinPtr uintptr
	var mPtr uintptr
	var filterObj uintptr
	var variableObj uintptr
	var interp uintptr = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).Finterp
	var i int32

	if (*Object)(unsafe.Pointer(oPtr)).Fflags&OBJECT_DESTRUCTING != 0 {
		// TODO:  Can ObjectNamespaceDeleted ever be called twice?  If not,
		// this guard could be removed.
		return
	}

	// One rule for the teardown routines is that if an object is in the
	// process of being deleted, nothing else may modify its bookeeping
	// records.  This is the flag that
	*(*int32)(unsafe.Pointer(oPtr + 92)) |= OBJECT_DESTRUCTING

	// Let the dominoes fall!

	if (*Object)(unsafe.Pointer(oPtr)).FclassPtr != 0 {
		XTclOODeleteDescendants(tls, interp, oPtr)
	}

	// We do not run destructors on the core class objects when the
	// interpreter is being deleted; their incestuous nature causes problems
	// in that case when the destructor is partially deleted before the uses
	// of it have gone. [Bug 2949397]

	if !(XTcl_InterpDeleted(tls, interp) != 0) && !((*Object)(unsafe.Pointer(oPtr)).Fflags&DESTRUCTOR_CALLED != 0) {
		var contextPtr uintptr = XTclOOGetCallContext(tls, oPtr, uintptr(0), DESTRUCTOR, uintptr(0))
		var result int32
		var state Tcl_InterpState

		*(*int32)(unsafe.Pointer(oPtr + 92)) |= DESTRUCTOR_CALLED

		if contextPtr != uintptr(0) {
			*(*int32)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr + 12)) |= DESTRUCTOR
			(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = 0
			state = XTcl_SaveInterpState(tls, interp, TCL_OK)
			result = XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
			}{XTclOOInvokeContext})),
				contextPtr, 0, uintptr(0))
			if result != TCL_OK {
				XTcl_BackgroundException(tls, interp, result)
			}
			XTcl_RestoreInterpState(tls, interp, state)
			XTclOODeleteContext(tls, contextPtr)
		}
	}

	// Instruct everyone to no longer use any allocated fields of the object.
	// Also delete the command that refers to the object at this point (if it
	// still exists) because otherwise its pointer to the object points into
	// freed memory.

	if (*Command)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fcommand)).Fflags != 0 && 0x01 != 0 {
		// Something has already started the command deletion process. We can
		// go ahead and clean up the the namespace,
	} else {
		// The namespace must have been deleted directly.  Delete the command
		// as well.

		XTcl_DeleteCommandFromToken(tls, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).Finterp, (*Object)(unsafe.Pointer(oPtr)).Fcommand)
	}

	if (*Object)(unsafe.Pointer(oPtr)).FmyCommand != 0 {
		XTcl_DeleteCommandFromToken(tls, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).Finterp, (*Object)(unsafe.Pointer(oPtr)).FmyCommand)
	}

	// Splice the object out of its context. After this, we must *not* call
	// methods on the object.

	// TODO: Should this be protected with a !IsRoot() condition?
	XTclOORemoveFromInstances(tls, oPtr, (*Object)(unsafe.Pointer(oPtr)).FselfCls)

	if (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum > 0 {
		for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				XTclOORemoveFromInstances(tls, oPtr, mixinPtr)
				XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(mixinPtr)).FthisPtr)
			}
		}
		if (*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist != uintptr(0) {
			XTclpFree(tls, (*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist)
		}
	}

	for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Ffilters.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			filterObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(filterObj)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(filterObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(filterObj)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(filterObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(filterObj)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(filterObj)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(filterObj)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, filterObj)
						} else {
							*(*uintptr)(unsafe.Pointer(filterObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = filterObj
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, filterObj)
				}
			}

		}
	}
	if i != 0 {
		XTclpFree(tls, (*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist)
	}

	if (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr != 0 {
		for hPtr = XTcl_FirstHashEntry(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, bp); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 { mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData; return 1 }()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp) {
			XTclOODelMethodRef(tls, mPtr)
		}
		XTcl_DeleteHashTable(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)
		XTclpFree(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)
	}

	for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fvariables.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			variableObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(variableObj)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(variableObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(variableObj)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(variableObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(variableObj)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(variableObj)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(variableObj)).Flength = -1
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, variableObj)
						} else {
							*(*uintptr)(unsafe.Pointer(variableObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = variableObj
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, variableObj)
				}
			}

		}
	}
	if i != 0 {
		XTclpFree(tls, (*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist)
	}

	if (*Object)(unsafe.Pointer(oPtr)).FchainCache != 0 {
		XTclOODeleteChainCache(tls, (*Object)(unsafe.Pointer(oPtr)).FchainCache)
	}

	sSquelchCachedName(tls, oPtr)

	if (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr != uintptr(0) {
		var metadataTypePtr uintptr
		var value ClientData

		for hPtr = XTcl_FirstHashEntry(tls, (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr, bp); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					metadataTypePtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmetadataPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmetadataPtr)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					value = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp) {
			(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjectMetadataType)(unsafe.Pointer(metadataTypePtr)).FdeleteProc})).f(tls, value)
		}
		XTcl_DeleteHashTable(tls, (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr)
		XTclpFree(tls, (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr)
		(*Object)(unsafe.Pointer(oPtr)).FmetadataPtr = uintptr(0)
	}

	// Because an object can be a class that is an instance of itself, the
	// class object's class structure should only be cleaned after most of
	// the cleanup on the object is done.
	//
	// The class of objects needs some special care; if it is deleted (and
	// we're not killing the whole interpreter) we force the delete of the
	// class of classes now as well. Due to the incestuous nature of those two
	// classes, if one goes the other must too and yet the tangle can
	// sometimes not go away automatically; we force it here. [Bug 2962664]

	if (*Object)(unsafe.Pointer(oPtr)).Fflags&ROOT_OBJECT != 0 && !((*Object)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls)).FthisPtr)).Fflags&OBJECT_DESTRUCTING != 0) &&
		!(XTcl_InterpDeleted(tls, interp) != 0) {

		XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FclassCls)).FthisPtr)).Fcommand)
	}

	if (*Object)(unsafe.Pointer(oPtr)).FclassPtr != uintptr(0) {
		XTclOOReleaseClassContents(tls, interp, oPtr)
	}

	// Delete the object structure itself.

	XTclNsDecrRefCount(tls, (*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)
	(*Object)(unsafe.Pointer(oPtr)).FnamespacePtr = uintptr(0)
	XTclOODecrRefCount(tls, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FthisPtr)
	(*Object)(unsafe.Pointer(oPtr)).FselfCls = uintptr(0)
	XTclOODecrRefCount(tls, oPtr)
	return
}

// ----------------------------------------------------------------------
//
// TclOODecrRef --
//
//	Decrement the refcount of an object and deallocate storage then object
//	is no longer referenced.  Returns 1 if storage was deallocated, and 0
//	otherwise.
//
// ----------------------------------------------------------------------
func XTclOODecrRefCount(tls *libc.TLS, oPtr uintptr) int32 { /* tclOO.c:1278:5: */
	if libc.PostDecInt32(&(*Object)(unsafe.Pointer(oPtr)).FrefCount, 1) <= 1 {
		if (*Object)(unsafe.Pointer(oPtr)).FclassPtr != uintptr(0) {
			XTclpFree(tls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr)
		}
		XTclpFree(tls, oPtr)
		return 1
	}
	return 0
}

// ----------------------------------------------------------------------
//
// TclOOObjectDestroyed --
//
//	Returns TCL_OK if an object is entirely deleted, i.e. the destruction
//	sequence has completed.
//
// ----------------------------------------------------------------------
func XTclOOObjectDestroyed(tls *libc.TLS, oPtr uintptr) int32 { /* tclOO.c:1299:5: */
	return libc.Bool32((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr == uintptr(0))
}

// Setting the "empty" location to NULL makes debugging a little easier.

func XRemoveClass(tls *libc.TLS, list uintptr, num int32, idx int32) { /* tclOO.c:1314:6: */
	for ; idx < num-1; idx++ {
		*(*uintptr)(unsafe.Pointer(list + uintptr(idx)*8)) = *(*uintptr)(unsafe.Pointer(list + uintptr(idx+1)*8))
	}
	*(*uintptr)(unsafe.Pointer(list + uintptr(idx)*8)) = uintptr(0)
	return
}

func XRemoveObject(tls *libc.TLS, list uintptr, num int32, idx int32) { /* tclOO.c:1316:6: */
	for ; idx < num-1; idx++ {
		*(*uintptr)(unsafe.Pointer(list + uintptr(idx)*8)) = *(*uintptr)(unsafe.Pointer(list + uintptr(idx+1)*8))
	}
	*(*uintptr)(unsafe.Pointer(list + uintptr(idx)*8)) = uintptr(0)
	return
}

// ----------------------------------------------------------------------
//
// TclOORemoveFromInstances --
//
//	Utility function to remove an object from the list of instances within
//	a class.
//
// ----------------------------------------------------------------------

func XTclOORemoveFromInstances(tls *libc.TLS, oPtr uintptr, clsPtr uintptr) int32 { /* tclOO.c:1330:1: */
	var i int32
	var res int32 = 0
	var instPtr uintptr

	for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Finstances.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			instPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			if oPtr == instPtr {
				for ok := true; ok; ok = 0 != 0 {
					XRemoveObject(tls, (*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist, (*Class)(unsafe.Pointer(clsPtr)).Finstances.Fnum, i)
					(*Class)(unsafe.Pointer(clsPtr)).Finstances.Fnum--
				}
				XTclOODecrRefCount(tls, oPtr)
				res++
				break
			}
		}
	}
	return res
}

// ----------------------------------------------------------------------
//
// TclOOAddToInstances --
//
//	Utility function to add an object to the list of instances within a
//	class.
//
// ----------------------------------------------------------------------

func XTclOOAddToInstances(tls *libc.TLS, oPtr uintptr, clsPtr uintptr) { /* tclOO.c:1361:1: */
	if (*Class)(unsafe.Pointer(clsPtr)).Finstances.Fnum >= (*Class)(unsafe.Pointer(clsPtr)).Finstances.Fsize {
		*(*int32)(unsafe.Pointer(clsPtr + 48 + 4)) += ALLOC_CHUNK
		if (*Class)(unsafe.Pointer(clsPtr)).Finstances.Fsize == ALLOC_CHUNK {
			(*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(ALLOC_CHUNK)))
		} else {
			(*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist = XTcl_Realloc(tls, (*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Class)(unsafe.Pointer(clsPtr)).Finstances.Fsize)))
		}
	}
	*(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist + uintptr(libc.PostIncInt32(&(*Class)(unsafe.Pointer(clsPtr)).Finstances.Fnum, 1))*8)) = oPtr
	(*Object)(unsafe.Pointer(oPtr)).FrefCount++
}

// ----------------------------------------------------------------------
//
// TclOORemoveFromMixins --
//
//	Utility function to remove a class from the list of mixins within an
//	object.
//
// ----------------------------------------------------------------------

func XTclOORemoveFromMixins(tls *libc.TLS, mixinPtr uintptr, oPtr uintptr) int32 { /* tclOO.c:1392:1: */
	var i int32
	var res int32 = 0
	var mixPtr uintptr

	for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			mixPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			if mixinPtr == mixPtr {
				for ok := true; ok; ok = 0 != 0 {
					XRemoveClass(tls, (*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist, (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum, i)
					(*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum--
				}
				XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(mixPtr)).FthisPtr)
				res++
				break
			}
		}
	}
	if (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum == 0 {
		XTclpFree(tls, (*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist)
		(*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist = uintptr(0)
	}
	return res
}

// ----------------------------------------------------------------------
//
// TclOORemoveFromSubclasses --
//
//	Utility function to remove a class from the list of subclasses within
//	another class. Returns the number of removals performed.
//
// ----------------------------------------------------------------------

func XTclOORemoveFromSubclasses(tls *libc.TLS, subPtr uintptr, superPtr uintptr) int32 { /* tclOO.c:1427:1: */
	var i int32
	var res int32 = 0
	var subclsPtr uintptr

	for i = 0; i < (*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			subclsPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			if subPtr == subclsPtr {
				for ok := true; ok; ok = 0 != 0 {
					XRemoveClass(tls, (*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Flist, (*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Fnum, i)
					(*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Fnum--
				}
				XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(subPtr)).FthisPtr)
				res++
			}
		}
	}
	return res
}

// ----------------------------------------------------------------------
//
// TclOOAddToSubclasses --
//
//	Utility function to add a class to the list of subclasses within
//	another class.
//
// ----------------------------------------------------------------------

func XTclOOAddToSubclasses(tls *libc.TLS, subPtr uintptr, superPtr uintptr) { /* tclOO.c:1457:1: */
	if (*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(superPtr)).FthisPtr)).Fflags&OBJECT_DESTRUCTING != 0 {
		return
	}
	if (*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Fnum >= (*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Fsize {
		*(*int32)(unsafe.Pointer(superPtr + 32 + 4)) += ALLOC_CHUNK
		if (*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Fsize == ALLOC_CHUNK {
			(*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Flist = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(ALLOC_CHUNK)))
		} else {
			(*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Flist = XTcl_Realloc(tls, (*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Flist, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Fsize)))
		}
	}
	*(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Flist + uintptr(libc.PostIncInt32(&(*Class)(unsafe.Pointer(superPtr)).Fsubclasses.Fnum, 1))*8)) = subPtr
	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(subPtr)).FthisPtr)).FrefCount++
}

// ----------------------------------------------------------------------
//
// TclOORemoveFromMixinSubs --
//
//	Utility function to remove a class from the list of mixinSubs within
//	another class.
//
// ----------------------------------------------------------------------

func XTclOORemoveFromMixinSubs(tls *libc.TLS, subPtr uintptr, superPtr uintptr) int32 { /* tclOO.c:1491:1: */
	var i int32
	var res int32 = 0
	var subclsPtr uintptr

	for i = 0; i < (*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			subclsPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			if subPtr == subclsPtr {
				for ok := true; ok; ok = 0 != 0 {
					XRemoveClass(tls, (*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Flist, (*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Fnum, i)
					(*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Fnum--
				}
				XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(subPtr)).FthisPtr)
				res++
				break
			}
		}
	}
	return res
}

// ----------------------------------------------------------------------
//
// TclOOAddToMixinSubs --
//
//	Utility function to add a class to the list of mixinSubs within
//	another class.
//
// ----------------------------------------------------------------------

func XTclOOAddToMixinSubs(tls *libc.TLS, subPtr uintptr, superPtr uintptr) { /* tclOO.c:1522:1: */
	if (*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(superPtr)).FthisPtr)).Fflags&OBJECT_DESTRUCTING != 0 {
		return
	}
	if (*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Fnum >= (*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Fsize {
		*(*int32)(unsafe.Pointer(superPtr + 96 + 4)) += ALLOC_CHUNK
		if (*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Fsize == ALLOC_CHUNK {
			(*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Flist = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(ALLOC_CHUNK)))
		} else {
			(*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Flist = XTcl_Realloc(tls, (*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Flist, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Fsize)))
		}
	}
	*(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Flist + uintptr(libc.PostIncInt32(&(*Class)(unsafe.Pointer(superPtr)).FmixinSubs.Fnum, 1))*8)) = subPtr
	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(subPtr)).FthisPtr)).FrefCount++
}

// ----------------------------------------------------------------------
//
// TclOOAllocClass --
//
//	Allocate a basic class. Does not add class to its class's instance
//	list.
//
// ----------------------------------------------------------------------

func XTclOOAllocClass(tls *libc.TLS, interp uintptr, useThisObj uintptr) uintptr { /* tclOO.c:1555:7: */
	var fPtr uintptr = (*Interp)(unsafe.Pointer(interp)).FobjectFoundation
	var clsPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Class{})))

	libc.Xmemset(tls, clsPtr, 0, uint64(unsafe.Sizeof(Class{})))
	(*Class)(unsafe.Pointer(clsPtr)).FthisPtr = useThisObj

	// Configure the namespace path for the class's object.
	initClassPath(tls, interp, clsPtr)

	// Classes are subclasses of oo::object, i.e. the objects they create are
	// objects.

	(*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum = 1
	(*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist = XTcl_Alloc(tls, uint32(unsafe.Sizeof(uintptr(0))))
	*(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist)) = (*Foundation)(unsafe.Pointer(fPtr)).FobjectCls
	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)).FthisPtr)).FrefCount++

	// Finish connecting the class structure to the object structure.

	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FthisPtr)).FclassPtr = clsPtr

	// That's the complicated bit. Now fill in the rest of the non-zero/NULL
	// fields.

	XTcl_InitObjHashTable(tls, clsPtr+112)
	return clsPtr
}

func initClassPath(tls *libc.TLS, interp uintptr, clsPtr uintptr) { /* tclOO.c:1598:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var fPtr uintptr = (*Interp)(unsafe.Pointer(interp)).FobjectFoundation
	if (*Foundation)(unsafe.Pointer(fPtr)).FhelpersNs != uintptr(0) {
		// var path [2]uintptr at bp, 16

		*(*uintptr)(unsafe.Pointer(bp)) = (*Foundation)(unsafe.Pointer(fPtr)).FhelpersNs
		*(*uintptr)(unsafe.Pointer(bp + 1*8)) = (*Foundation)(unsafe.Pointer(fPtr)).FooNs
		XTclSetNsPath(tls, (*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FthisPtr)).FnamespacePtr, 2, bp)
	} else {
		XTclSetNsPath(tls, (*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FthisPtr)).FnamespacePtr, 1,
			fPtr+24)
	}
}

// ----------------------------------------------------------------------
//
// Tcl_NewObjectInstance --
//
//	Allocate a new instance of an object.
//
// ----------------------------------------------------------------------
func XTcl_NewObjectInstance(tls *libc.TLS, interp uintptr, cls Tcl_Class, nameStr uintptr, nsNameStr uintptr, objc int32, objv uintptr, skip int32) Tcl_Object { /* tclOO.c:1621:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var classPtr uintptr = cls
	// var oPtr uintptr at bp+32, 8

	// var clientData [4]ClientData at bp, 32

	*(*uintptr)(unsafe.Pointer(bp + 32 /* oPtr */)) = XTclNewObjectInstanceCommon(tls, interp, classPtr, nameStr, nsNameStr)
	if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) {
		return uintptr(0)
	}

	// Run constructors, except when objc < 0, which is a special flag case
	// used for object cloning only.

	if objc >= 0 {
		var contextPtr uintptr = XTclOOGetCallContext(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* oPtr */)), uintptr(0), CONSTRUCTOR, uintptr(0))

		if contextPtr != uintptr(0) {
			var isRoot int32
			var result int32
			var state Tcl_InterpState

			state = XTcl_SaveInterpState(tls, interp, TCL_OK)
			*(*int32)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr + 12)) |= CONSTRUCTOR
			(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = skip

			// Adjust the ensemble tracking record if necessary. [Bug 3514761]

			isRoot = XTclInitRewriteEnsemble(tls, interp, skip, skip, objv)
			result = XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
			}{XTclOOInvokeContext})), contextPtr,
				objc, objv)

			if isRoot != 0 {
				XTclResetRewriteEnsemble(tls, interp, 1)
			}

			*(*ClientData)(unsafe.Pointer(bp)) = contextPtr
			*(*ClientData)(unsafe.Pointer(bp + 1*8)) = *(*uintptr)(unsafe.Pointer(bp + 32 /* oPtr */))
			*(*ClientData)(unsafe.Pointer(bp + 2*8)) = state
			*(*ClientData)(unsafe.Pointer(bp + 3*8)) = bp + 32 /* &oPtr */

			result = sFinalizeAlloc(tls, bp, interp, result)
			if result != TCL_OK {
				return uintptr(0)
			}
		}
	}

	return *(*uintptr)(unsafe.Pointer(bp + 32 /* oPtr */))
}

func XTclNRNewObjectInstance(tls *libc.TLS, interp uintptr, cls Tcl_Class, nameStr uintptr, nsNameStr uintptr, objc int32, objv uintptr, skip int32, objectPtr uintptr) int32 { /* tclOO.c:1687:1: */
	var classPtr uintptr = cls
	var contextPtr uintptr
	var state Tcl_InterpState
	var oPtr uintptr

	oPtr = XTclNewObjectInstanceCommon(tls, interp, classPtr, nameStr, nsNameStr)
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Run constructors, except when objc < 0 (a special flag case used for
	// object cloning only). If there aren't any constructors, we do nothing.

	if objc < 0 {
		*(*Tcl_Object)(unsafe.Pointer(objectPtr)) = oPtr
		return TCL_OK
	}
	contextPtr = XTclOOGetCallContext(tls, oPtr, uintptr(0), CONSTRUCTOR, uintptr(0))
	if contextPtr == uintptr(0) {
		*(*Tcl_Object)(unsafe.Pointer(objectPtr)) = oPtr
		return TCL_OK
	}

	state = XTcl_SaveInterpState(tls, interp, TCL_OK)
	*(*int32)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr + 12)) |= CONSTRUCTOR
	(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = skip

	// Adjust the ensemble tracking record if necessary. [Bug 3514761]

	if XTclInitRewriteEnsemble(tls, interp, skip, skip, objv) != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{XTclClearRootEnsemble}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	}

	// Fire off the constructors non-recursively.

	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _callbackPtr uintptr
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sFinalizeAlloc}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = contextPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = oPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = state
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = objectPtr
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	XTclPushTailcallPoint(tls, interp)
	return XTclOOInvokeContext(tls, contextPtr, interp, objc, objv)
}

func XTclNewObjectInstanceCommon(tls *libc.TLS, interp uintptr, classPtr uintptr, nameStr uintptr, nsNameStr uintptr) uintptr { /* tclOO.c:1748:8: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	var hPtr uintptr
	var fPtr uintptr = (*Interp)(unsafe.Pointer(interp)).FobjectFoundation
	var oPtr uintptr
	*(*uintptr)(unsafe.Pointer(bp + 56 /* simpleName */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 40 /* nsPtr */)) = uintptr(0)
	// var dummy uintptr at bp+48, 8

	var inNsPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr

	if nameStr != 0 {
		XTclGetNamespaceForQualName(tls, interp, nameStr, inNsPtr,
			TCL_CREATE_NS_IF_UNKNOWN, bp+40, bp+48, bp+48, bp+56)

		// Disallow creation of an object over an existing command.

		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* nsPtr */)) + 160 /* &.cmdTable */)).FfindProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* nsPtr */))+160 /* &.cmdTable */, *(*uintptr)(unsafe.Pointer(bp + 56 /* simpleName */)))
		if hPtr != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

				ts+49468, libc.VaList(bp, nameStr)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+28514, ts+49532, uintptr(0)))
			return uintptr(0)
		}
	}

	// Create the object.

	oPtr = sAllocObject(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 56 /* simpleName */)), *(*uintptr)(unsafe.Pointer(bp + 40 /* nsPtr */)), nsNameStr)
	(*Object)(unsafe.Pointer(oPtr)).FselfCls = classPtr
	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).FthisPtr)).FrefCount++
	XTclOOAddToInstances(tls, oPtr, classPtr)

	// Check to see if we're really creating a class. If so, allocate the
	// class structure as well.

	if XTclOOIsReachable(tls, (*Foundation)(unsafe.Pointer(fPtr)).FclassCls, classPtr) != 0 {
		// Is a class, so attach a class structure. Note that the
		// TclOOAllocClass function splices the structure into the object, so
		// we don't have to. Once that's done, we need to repatch the object
		// to have the right class since TclOOAllocClass interferes with that.

		XTclOOAllocClass(tls, interp, oPtr)
		XTclOOAddToSubclasses(tls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr, (*Foundation)(unsafe.Pointer(fPtr)).FobjectCls)
	} else {
		(*Object)(unsafe.Pointer(oPtr)).FclassPtr = uintptr(0)
	}
	return oPtr
}

func sFinalizeAlloc(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOO.c:1811:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var contextPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var oPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))
	var state Tcl_InterpState = *(*ClientData)(unsafe.Pointer(data + 2*8))
	var objectPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 3*8))

	// Ensure an error if the object was deleted in the constructor.
	// Don't want to lose errors by accident. [Bug 2903011]

	if result != TCL_ERROR && (*Object)(unsafe.Pointer(oPtr)).Fflags&OBJECT_DESTRUCTING != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+49549, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+49579, uintptr(0)))
		result = TCL_ERROR
	}
	if result != TCL_OK {
		XTcl_DiscardInterpState(tls, state)

		// Take care to not delete a deleted object; that would be bad. [Bug
		// 2903011] Also take care to make sure that we have the name of the
		// command before we delete it. [Bug 9dd1bd7a74]

		if !((*Object)(unsafe.Pointer(oPtr)).Fflags&OBJECT_DESTRUCTING != 0) {
			XTclOOObjectName(tls, interp, oPtr)
			XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer(oPtr)).Fcommand)
		}

		// This decrements the refcount of oPtr.

		XTclOODeleteContext(tls, contextPtr)
		return TCL_ERROR
	}
	XTcl_RestoreInterpState(tls, interp, state)
	*(*Tcl_Object)(unsafe.Pointer(objectPtr)) = oPtr

	// This decrements the refcount of oPtr.

	XTclOODeleteContext(tls, contextPtr)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// Tcl_CopyObjectInstance --
//
//	Creates a copy of an object. Does not copy the backing namespace,
//	since the correct way to do that (e.g., shallow/deep) depends on the
//	object/class's own policies.
//
// ----------------------------------------------------------------------

func XTcl_CopyObjectInstance(tls *libc.TLS, interp uintptr, sourceObject Tcl_Object, targetName uintptr, targetNamespaceName uintptr) Tcl_Object { /* tclOO.c:1877:1: */
	bp := tls.Alloc(96)
	defer tls.Free(96)

	var oPtr uintptr = sourceObject
	var o2Ptr uintptr
	var hPtr uintptr
	// var search Tcl_HashSearch at bp+32, 24

	var mPtr uintptr
	var mixinPtr uintptr
	var contextPtr uintptr
	var keyPtr uintptr
	var filterObj uintptr
	var variableObj uintptr
	// var args [3]uintptr at bp+72, 24

	var i int32
	var result int32

	// Sanity check.

	if (*Object)(unsafe.Pointer(oPtr)).Fflags&ROOT_CLASS != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+49589, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+49624, uintptr(0)))
		return uintptr(0)
	}

	// Build the instance. Note that this does not run any constructors.

	o2Ptr = XTcl_NewObjectInstance(tls, interp,
		(*Object)(unsafe.Pointer(oPtr)).FselfCls, targetName, targetNamespaceName, -1,
		uintptr(0), -1)
	if o2Ptr == uintptr(0) {
		return uintptr(0)
	}

	// Copy the object-local methods to the new object.

	if (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr != 0 {
		for hPtr = XTcl_FirstHashEntry(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, bp+32); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					keyPtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+32) {
			if sCloneObjectMethod(tls, interp, o2Ptr, mPtr, keyPtr) != TCL_OK {
				XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer(o2Ptr)).Fcommand)
				return uintptr(0)
			}
		}
	}

	// Copy the object's mixin references to the new object.

	if (*Object)(unsafe.Pointer(o2Ptr)).Fmixins.Fnum != 0 {
		for i = 0; i < (*Object)(unsafe.Pointer(o2Ptr)).Fmixins.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(o2Ptr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(o2Ptr)).Fmixins.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				if mixinPtr != 0 && mixinPtr != (*Object)(unsafe.Pointer(o2Ptr)).FselfCls {
					XTclOORemoveFromInstances(tls, o2Ptr, mixinPtr)
				}
				XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(mixinPtr)).FthisPtr)
			}
		}
		XTclpFree(tls, (*Object)(unsafe.Pointer(o2Ptr)).Fmixins.Flist)
	}
	for ok := true; ok; ok = 0 != 0 {
		var len Size_t = uint64(unsafe.Sizeof(uintptr(0))) * uint64(libc.AssignPtrInt32(o2Ptr+48, (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum))
		if len != uint64(0) {
			libc.Xmemcpy(tls, libc.AssignPtrUintptr(o2Ptr+48+8, XTcl_Alloc(tls, uint32(len))), (*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist, len)
		} else {
			(*Object)(unsafe.Pointer(o2Ptr)).Fmixins.Flist = uintptr(0)
		}
	}
	for i = 0; i < (*Object)(unsafe.Pointer(o2Ptr)).Fmixins.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(o2Ptr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(o2Ptr)).Fmixins.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			if mixinPtr != 0 && mixinPtr != (*Object)(unsafe.Pointer(o2Ptr)).FselfCls {
				XTclOOAddToInstances(tls, o2Ptr, mixinPtr)
			}

			// For the reference just created in DUPLICATE.

			(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(mixinPtr)).FthisPtr)).FrefCount++
		}
	}

	// Copy the object's filter list to the new object.

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var len Size_t = uint64(unsafe.Sizeof(uintptr(0))) * uint64(libc.AssignPtrInt32(o2Ptr+64, (*Object)(unsafe.Pointer(oPtr)).Ffilters.Fnum))
		if len != uint64(0) {
			libc.Xmemcpy(tls, libc.AssignPtrUintptr(o2Ptr+64+8, XTcl_Alloc(tls, uint32(len))), (*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist, len)
		} else {
			(*Object)(unsafe.Pointer(o2Ptr)).Ffilters.Flist = uintptr(0)
		}
	}
	for i = 0; i < (*Object)(unsafe.Pointer(o2Ptr)).Ffilters.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(o2Ptr)).Ffilters.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			filterObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(o2Ptr)).Ffilters.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			(*Tcl_Obj)(unsafe.Pointer(filterObj)).FrefCount++
		}
	}

	// Copy the object's variable resolution list to the new object.

	for ok2 := true; ok2; ok2 = 0 != 0 {
		var len Size_t = uint64(unsafe.Sizeof(uintptr(0))) * uint64(libc.AssignPtrInt32(o2Ptr+136, (*Object)(unsafe.Pointer(oPtr)).Fvariables.Fnum))
		if len != uint64(0) {
			libc.Xmemcpy(tls, libc.AssignPtrUintptr(o2Ptr+136+8, XTcl_Alloc(tls, uint32(len))), (*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist, len)
		} else {
			(*Object)(unsafe.Pointer(o2Ptr)).Fvariables.Flist = uintptr(0)
		}
	}
	for i = 0; i < (*Object)(unsafe.Pointer(o2Ptr)).Fvariables.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(o2Ptr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			variableObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(o2Ptr)).Fvariables.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			(*Tcl_Obj)(unsafe.Pointer(variableObj)).FrefCount++
		}
	}

	// Copy the object's flags to the new object, clearing those that must be
	// kept object-local. The duplicate is never deleted at this point, nor is
	// it the root of the object system or in the midst of processing a filter
	// call.

	(*Object)(unsafe.Pointer(o2Ptr)).Fflags = (*Object)(unsafe.Pointer(oPtr)).Fflags & libc.CplInt32(OBJECT_DESTRUCTING|ROOT_OBJECT|ROOT_CLASS|FILTER_HANDLING)

	// Copy the object's metadata.

	if (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr != uintptr(0) {
		var metadataTypePtr uintptr
		var value ClientData
		// var duplicate ClientData at bp+56, 8

		for hPtr = XTcl_FirstHashEntry(tls, (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr, bp+32); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					metadataTypePtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmetadataPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmetadataPtr)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					value = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+32) {
			if (*Tcl_ObjectMetadataType)(unsafe.Pointer(metadataTypePtr)).FcloneProc == uintptr(0) {
				*(*ClientData)(unsafe.Pointer(bp + 56 /* duplicate */)) = value
			} else {
				if (*struct {
					f func(*libc.TLS, uintptr, ClientData, uintptr) int32
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjectMetadataType)(unsafe.Pointer(metadataTypePtr)).FcloneProc})).f(tls, interp, value,
					bp+56) != TCL_OK {
					XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer(o2Ptr)).Fcommand)
					return uintptr(0)
				}
			}
			if *(*ClientData)(unsafe.Pointer(bp + 56)) != uintptr(0) {
				XTcl_ObjectSetMetadata(tls, o2Ptr, metadataTypePtr,
					*(*ClientData)(unsafe.Pointer(bp + 56 /* duplicate */)))
			}
		}
	}

	// Copy the class, if present. Note that if there is a class present in
	// the source object, there must also be one in the copy.

	if (*Object)(unsafe.Pointer(oPtr)).FclassPtr != uintptr(0) {
		var clsPtr uintptr = (*Object)(unsafe.Pointer(oPtr)).FclassPtr
		var cls2Ptr uintptr = (*Object)(unsafe.Pointer(o2Ptr)).FclassPtr
		var superPtr uintptr

		// Copy the class flags across.

		(*Class)(unsafe.Pointer(cls2Ptr)).Fflags = (*Class)(unsafe.Pointer(clsPtr)).Fflags

		// Ensure that the new class's superclass structure is the same as the
		// old class's.

		for i = 0; i < (*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				superPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				XTclOORemoveFromSubclasses(tls, cls2Ptr, superPtr)
				XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(superPtr)).FthisPtr)
			}
		}
		if (*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Fnum != 0 {
			(*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Flist = XTcl_Realloc(tls, (*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Flist, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum)))
		} else {
			(*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Flist = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum)))
		}
		libc.Xmemcpy(tls, (*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Flist, (*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist,
			uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum))
		(*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Fnum = (*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum
		for i = 0; i < (*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				superPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Fsuperclasses.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				XTclOOAddToSubclasses(tls, cls2Ptr, superPtr)

				// For the new item in cls2Ptr->superclasses that memcpy just
				// created.

				(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(superPtr)).FthisPtr)).FrefCount++
			}
		}

		// Duplicate the source class's filters.

		for ok3 := true; ok3; ok3 = 0 != 0 {
			var len Size_t = uint64(unsafe.Sizeof(uintptr(0))) * uint64(libc.AssignPtrInt32(cls2Ptr+64, (*Class)(unsafe.Pointer(clsPtr)).Ffilters.Fnum))
			if len != uint64(0) {
				libc.Xmemcpy(tls, libc.AssignPtrUintptr(cls2Ptr+64+8, XTcl_Alloc(tls, uint32(len))), (*Class)(unsafe.Pointer(clsPtr)).Ffilters.Flist, len)
			} else {
				(*Class)(unsafe.Pointer(cls2Ptr)).Ffilters.Flist = uintptr(0)
			}
		}
		for i = 0; i < (*Class)(unsafe.Pointer(cls2Ptr)).Ffilters.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Ffilters.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				filterObj = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Ffilters.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				(*Tcl_Obj)(unsafe.Pointer(filterObj)).FrefCount++
			}
		}

		// Copy the source class's variable resolution list.

		for ok4 := true; ok4; ok4 = 0 != 0 {
			var len Size_t = uint64(unsafe.Sizeof(uintptr(0))) * uint64(libc.AssignPtrInt32(cls2Ptr+248, (*Class)(unsafe.Pointer(clsPtr)).Fvariables.Fnum))
			if len != uint64(0) {
				libc.Xmemcpy(tls, libc.AssignPtrUintptr(cls2Ptr+248+8, XTcl_Alloc(tls, uint32(len))), (*Class)(unsafe.Pointer(clsPtr)).Fvariables.Flist, len)
			} else {
				(*Class)(unsafe.Pointer(cls2Ptr)).Fvariables.Flist = uintptr(0)
			}
		}
		for i = 0; i < (*Class)(unsafe.Pointer(cls2Ptr)).Fvariables.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				variableObj = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Fvariables.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				(*Tcl_Obj)(unsafe.Pointer(variableObj)).FrefCount++
			}
		}

		// Duplicate the source class's mixins (which cannot be circular
		// references to the duplicate).

		if (*Class)(unsafe.Pointer(cls2Ptr)).Fmixins.Fnum != 0 {
			for i = 0; i < (*Class)(unsafe.Pointer(cls2Ptr)).Fmixins.Fnum; i++ {
				if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
					continue
				} else if func() bool {
					mixinPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Fmixins.Flist + uintptr(i)*8))
					return 1 != 0
				}() {
					XTclOORemoveFromMixinSubs(tls, cls2Ptr, mixinPtr)
					XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(mixinPtr)).FthisPtr)
				}
			}
			XTclpFree(tls, (*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist)
		}
		for ok5 := true; ok5; ok5 = 0 != 0 {
			var len Size_t = uint64(unsafe.Sizeof(uintptr(0))) * uint64(libc.AssignPtrInt32(cls2Ptr+80, (*Class)(unsafe.Pointer(clsPtr)).Fmixins.Fnum))
			if len != uint64(0) {
				libc.Xmemcpy(tls, libc.AssignPtrUintptr(cls2Ptr+80+8, XTcl_Alloc(tls, uint32(len))), (*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist, len)
			} else {
				(*Class)(unsafe.Pointer(cls2Ptr)).Fmixins.Flist = uintptr(0)
			}
		}
		for i = 0; i < (*Class)(unsafe.Pointer(cls2Ptr)).Fmixins.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				mixinPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(cls2Ptr)).Fmixins.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				XTclOOAddToMixinSubs(tls, cls2Ptr, mixinPtr)

				// For the copy just created in DUPLICATE.

				(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(mixinPtr)).FthisPtr)).FrefCount++
			}
		}

		// Duplicate the source class's methods, constructor and destructor.

		for hPtr = XTcl_FirstHashEntry(tls, clsPtr+112, bp+32); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					keyPtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer(clsPtr+112)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(clsPtr+112)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+32) {
			if sCloneClassMethod(tls, interp, cls2Ptr, mPtr, keyPtr,
				uintptr(0)) != TCL_OK {
				XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer(o2Ptr)).Fcommand)
				return uintptr(0)
			}
		}
		if (*Class)(unsafe.Pointer(clsPtr)).FconstructorPtr != 0 {
			if sCloneClassMethod(tls, interp, cls2Ptr, (*Class)(unsafe.Pointer(clsPtr)).FconstructorPtr,
				uintptr(0), cls2Ptr+200) != TCL_OK {
				XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer(o2Ptr)).Fcommand)
				return uintptr(0)
			}
		}
		if (*Class)(unsafe.Pointer(clsPtr)).FdestructorPtr != 0 {
			if sCloneClassMethod(tls, interp, cls2Ptr, (*Class)(unsafe.Pointer(clsPtr)).FdestructorPtr, uintptr(0),
				cls2Ptr+208) != TCL_OK {
				XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer(o2Ptr)).Fcommand)
				return uintptr(0)
			}
		}

		// Duplicate the class's metadata.

		if (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr != uintptr(0) {
			var metadataTypePtr uintptr
			var value ClientData
			// var duplicate ClientData at bp+64, 8

			for hPtr = XTcl_FirstHashEntry(tls, (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr, bp+32); func() int32 {
				if hPtr != uintptr(0) {
					return func() int32 {
						metadataTypePtr = func() uintptr {
							if (*Tcl_HashTable)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr)).FkeyType == -1 {
								return *(*uintptr)(unsafe.Pointer(hPtr + 32))
							}
							return hPtr + 32
						}()
						value = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
						return 1
					}()
				}
				return 0
			}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+32) {
				if (*Tcl_ObjectMetadataType)(unsafe.Pointer(metadataTypePtr)).FcloneProc == uintptr(0) {
					*(*ClientData)(unsafe.Pointer(bp + 64 /* duplicate */)) = value
				} else {
					if (*struct {
						f func(*libc.TLS, uintptr, ClientData, uintptr) int32
					})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjectMetadataType)(unsafe.Pointer(metadataTypePtr)).FcloneProc})).f(tls, interp, value,
						bp+64) != TCL_OK {
						XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer(o2Ptr)).Fcommand)
						return uintptr(0)
					}
				}
				if *(*ClientData)(unsafe.Pointer(bp + 64)) != uintptr(0) {
					XTcl_ClassSetMetadata(tls, cls2Ptr, metadataTypePtr,
						*(*ClientData)(unsafe.Pointer(bp + 64 /* duplicate */)))
				}
			}
		}
	}

	XTclResetRewriteEnsemble(tls, interp, 1)
	contextPtr = XTclOOGetCallContext(tls, o2Ptr, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).FclonedName, 0, uintptr(0))
	if contextPtr != 0 {
		*(*uintptr)(unsafe.Pointer(bp + 72)) = XTclOOObjectName(tls, interp, o2Ptr)
		*(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)) = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).FclonedName
		*(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)) = XTclOOObjectName(tls, interp, oPtr)
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FrefCount++
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)))).FrefCount++
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)))).FrefCount++
		result = XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclOOInvokeContext})), contextPtr, 3,
			bp+72)
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Flength = -1
				for ok6 := true; ok6; ok6 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 72)))
					} else {
						*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 72))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 72)))
			}
		}

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)))).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)))).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)))).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)))).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)))).Flength = -1
				for ok7 := true; ok7; ok7 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)))
					} else {
						*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 72 + 1*8))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 72 + 1*8)))
			}
		}

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)))).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)))).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)))).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)))).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)))).Flength = -1
				for ok8 := true; ok8; ok8 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)))
					} else {
						*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 72 + 2*8))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 72 + 2*8)))
			}
		}

		XTclOODeleteContext(tls, contextPtr)
		if result == TCL_ERROR {
			XTcl_AddErrorInfo(tls, interp,
				ts+49638)
		}
		if result != TCL_OK {
			XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer(o2Ptr)).Fcommand)
			return uintptr(0)
		}
	}

	return o2Ptr
}

// ----------------------------------------------------------------------
//
// CloneObjectMethod, CloneClassMethod --
//
//	Helper functions used for cloning methods. They work identically to
//	each other, except for the difference between them in how they
//	register the cloned method on a successful clone.
//
// ----------------------------------------------------------------------

func sCloneObjectMethod(tls *libc.TLS, interp uintptr, oPtr uintptr, mPtr uintptr, namePtr uintptr) int32 { /* tclOO.c:2185:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if (*Method)(unsafe.Pointer(mPtr)).FtypePtr == uintptr(0) {
		XTcl_NewInstanceMethod(tls, interp, oPtr, namePtr,
			(*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD, uintptr(0), uintptr(0))
	} else if (*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FcloneProc != 0 {
		// var newClientData ClientData at bp, 8

		if (*struct {
			f func(*libc.TLS, uintptr, ClientData, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FcloneProc})).f(tls, interp, (*Method)(unsafe.Pointer(mPtr)).FclientData,
			bp) != TCL_OK {
			return TCL_ERROR
		}
		XTcl_NewInstanceMethod(tls, interp, oPtr, namePtr,
			(*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD, (*Method)(unsafe.Pointer(mPtr)).FtypePtr, *(*ClientData)(unsafe.Pointer(bp /* newClientData */)))
	} else {
		XTcl_NewInstanceMethod(tls, interp, oPtr, namePtr,
			(*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD, (*Method)(unsafe.Pointer(mPtr)).FtypePtr, (*Method)(unsafe.Pointer(mPtr)).FclientData)
	}
	return TCL_OK
}

func sCloneClassMethod(tls *libc.TLS, interp uintptr, clsPtr uintptr, mPtr uintptr, namePtr uintptr, m2PtrPtr uintptr) int32 { /* tclOO.c:2211:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var m2Ptr uintptr

	if (*Method)(unsafe.Pointer(mPtr)).FtypePtr == uintptr(0) {
		m2Ptr = XTcl_NewMethod(tls, interp, clsPtr,
			namePtr, (*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD, uintptr(0), uintptr(0))
	} else if (*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FcloneProc != 0 {
		// var newClientData ClientData at bp, 8

		if (*struct {
			f func(*libc.TLS, uintptr, ClientData, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FcloneProc})).f(tls, interp, (*Method)(unsafe.Pointer(mPtr)).FclientData,
			bp) != TCL_OK {
			return TCL_ERROR
		}
		m2Ptr = XTcl_NewMethod(tls, interp, clsPtr,
			namePtr, (*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD, (*Method)(unsafe.Pointer(mPtr)).FtypePtr,
			*(*ClientData)(unsafe.Pointer(bp /* newClientData */)))
	} else {
		m2Ptr = XTcl_NewMethod(tls, interp, clsPtr,
			namePtr, (*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD, (*Method)(unsafe.Pointer(mPtr)).FtypePtr,
			(*Method)(unsafe.Pointer(mPtr)).FclientData)
	}
	if m2PtrPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(m2PtrPtr)) = m2Ptr
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// Tcl_ClassGetMetadata, Tcl_ClassSetMetadata, Tcl_ObjectGetMetadata,
// Tcl_ObjectSetMetadata --
//
//	Metadata management API. The metadata system allows code in extensions
//	to attach arbitrary non-NULL pointers to objects and classes without
//	the different things that might be interested being able to interfere
//	with each other. Apart from non-NULL-ness, these routines attach no
//	interpretation to the meaning of the metadata pointers.
//
//	The Tcl_*GetMetadata routines get the metadata pointer attached that
//	has been related with a particular type, or NULL if no metadata
//	associated with the given type has been attached.
//
//	The Tcl_*SetMetadata routines set or delete the metadata pointer that
//	is related to a particular type. The value associated with the type is
//	deleted (if present; no-op otherwise) if the value is NULL, and
//	attached (replacing the previous value, which is deleted if present)
//	otherwise. This means it is impossible to attach a NULL value for any
//	metadata type.
//
// ----------------------------------------------------------------------

func XTcl_ClassGetMetadata(tls *libc.TLS, clazz Tcl_Class, typePtr uintptr) ClientData { /* tclOO.c:2271:1: */
	var clsPtr uintptr = clazz
	var hPtr uintptr

	// If there's no metadata store attached, the type in question has
	// definitely not been attached either!

	if (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr == uintptr(0) {
		return uintptr(0)
	}

	// There is a metadata store, so look in it for the given type.

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr)).FfindProc})).f(tls, (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr, typePtr)

	// Return the metadata value if we found it, otherwise NULL.

	if hPtr == uintptr(0) {
		return uintptr(0)
	}
	return (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
}

func XTcl_ClassSetMetadata(tls *libc.TLS, clazz Tcl_Class, typePtr uintptr, metadata ClientData) { /* tclOO.c:2304:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var clsPtr uintptr = clazz
	var hPtr uintptr
	// var isNew int32 at bp, 4

	// Attach the metadata store if not done already.

	if (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr == uintptr(0) {
		if metadata == uintptr(0) {
			return
		}
		(*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
		XTcl_InitHashTable(tls, (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr, 1)
	}

	// If the metadata is NULL, we're deleting the metadata for the type.

	if metadata == uintptr(0) {
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr)).FfindProc})).f(tls, (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr, typePtr)
		if hPtr != uintptr(0) {
			(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjectMetadataType)(unsafe.Pointer(typePtr)).FdeleteProc})).f(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
			XTcl_DeleteHashEntry(tls, hPtr)
		}
		return
	}

	// Otherwise we're attaching the metadata. Note that if there was already
	// some metadata attached of this type, we delete that first.

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr)).FcreateProc})).f(tls, (*Class)(unsafe.Pointer(clsPtr)).FmetadataPtr, typePtr, bp /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjectMetadataType)(unsafe.Pointer(typePtr)).FdeleteProc})).f(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	}
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = metadata
}

func XTcl_ObjectGetMetadata(tls *libc.TLS, object Tcl_Object, typePtr uintptr) ClientData { /* tclOO.c:2351:1: */
	var oPtr uintptr = object
	var hPtr uintptr

	// If there's no metadata store attached, the type in question has
	// definitely not been attached either!

	if (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr == uintptr(0) {
		return uintptr(0)
	}

	// There is a metadata store, so look in it for the given type.

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmetadataPtr)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr, typePtr)

	// Return the metadata value if we found it, otherwise NULL.

	if hPtr == uintptr(0) {
		return uintptr(0)
	}
	return (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
}

func XTcl_ObjectSetMetadata(tls *libc.TLS, object Tcl_Object, typePtr uintptr, metadata ClientData) { /* tclOO.c:2384:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var oPtr uintptr = object
	var hPtr uintptr
	// var isNew int32 at bp, 4

	// Attach the metadata store if not done already.

	if (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr == uintptr(0) {
		if metadata == uintptr(0) {
			return
		}
		(*Object)(unsafe.Pointer(oPtr)).FmetadataPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
		XTcl_InitHashTable(tls, (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr, 1)
	}

	// If the metadata is NULL, we're deleting the metadata for the type.

	if metadata == uintptr(0) {
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmetadataPtr)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr, typePtr)
		if hPtr != uintptr(0) {
			(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjectMetadataType)(unsafe.Pointer(typePtr)).FdeleteProc})).f(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
			XTcl_DeleteHashEntry(tls, hPtr)
		}
		return
	}

	// Otherwise we're attaching the metadata. Note that if there was already
	// some metadata attached of this type, we delete that first.

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmetadataPtr)).FcreateProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmetadataPtr, typePtr, bp /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjectMetadataType)(unsafe.Pointer(typePtr)).FdeleteProc})).f(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	}
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = metadata
}

// ----------------------------------------------------------------------
//
// PublicObjectCmd, PrivateObjectCmd, TclOOInvokeObject --
//
//	Main entry point for object invocations. The Public* and Private*
//	wrapper functions (implementations of both object instance commands
//	and [my]) are just thin wrappers round the main TclOOObjectCmdCore
//	function. Note that the core is function is NRE-aware.
//
// ----------------------------------------------------------------------

func sPublicObjectCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOO.c:2444:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sPublicNRObjectCmd})), clientData, objc, objv)
}

func sPublicNRObjectCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOO.c:2454:1: */
	return XTclOOObjectCmdCore(tls, clientData, interp, objc, objv, PUBLIC_METHOD,
		uintptr(0))
}

func sPrivateObjectCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOO.c:2465:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sPrivateNRObjectCmd})), clientData, objc, objv)
}

func sPrivateNRObjectCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOO.c:2475:1: */
	return XTclOOObjectCmdCore(tls, clientData, interp, objc, objv, 0, uintptr(0))
}

func XTclOOInvokeObject(tls *libc.TLS, interp uintptr, object Tcl_Object, startCls Tcl_Class, publicPrivate int32, objc int32, objv uintptr) int32 { /* tclOO.c:2485:1: */
	switch publicPrivate {
	case PUBLIC_METHOD:
		return XTclOOObjectCmdCore(tls, object, interp, objc, objv,
			PUBLIC_METHOD, startCls)
	case PRIVATE_METHOD:
		return XTclOOObjectCmdCore(tls, object, interp, objc, objv,
			PRIVATE_METHOD, startCls)
	default:
		return XTclOOObjectCmdCore(tls, object, interp, objc, objv, 0,
			startCls)
	}
	return int32(0)
}

// ----------------------------------------------------------------------
//
// TclOOObjectCmdCore, FinalizeObjectCall --
//
//	Main function for object invocations. Does call chain creation,
//	management and invocation. The function FinalizeObjectCall exists to
//	clean up after the non-recursive processing of TclOOObjectCmdCore.
//
// ----------------------------------------------------------------------

func XTclOOObjectCmdCore(tls *libc.TLS, oPtr uintptr, interp uintptr, objc int32, objv uintptr, flags int32, startCls uintptr) int32 { /* tclOO.c:2528:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)
	*(*uintptr)(unsafe.Pointer(bp + 136)) = startCls

	var contextPtr uintptr
	var methodNamePtr uintptr
	var result int32
	var cachePtr uintptr
	var cachePtr1 uintptr
	var startClsPtr uintptr
	var mappedMethodName uintptr
	var miPtr uintptr
	var cachePtr2 uintptr
	var _objPtr uintptr
	var _callbackPtr uintptr

	// If we've no method name, throw this directly into the unknown
	// processing.

	if !(objc < 2) {
		goto __1
	}
	flags = flags | FORCE_UNKNOWN
	methodNamePtr = uintptr(0)
	goto noMapping
__1:
	;

	// Give plugged in code a chance to remap the method name.

	methodNamePtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if !((*Object)(unsafe.Pointer(oPtr)).FmapMethodNameProc != uintptr(0)) {
		goto __2
	}
	startClsPtr = bp + 136 /* &startCls */
	mappedMethodName = XTcl_DuplicateObj(tls, methodNamePtr)

	result = (*struct {
		f func(*libc.TLS, uintptr, Tcl_Object, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Object)(unsafe.Pointer(oPtr)).FmapMethodNameProc})).f(tls, interp, oPtr,
		startClsPtr, mappedMethodName)
	if !(result != TCL_OK) {
		goto __4
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).FrefCount, 1) > 1) {
		goto __5
	}
	goto __6
__5:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __7
	}

	if !((*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).Fbytes != XtclEmptyStringRep) {
		goto __9
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).Fbytes)
__9:
	;
	(*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).Flength = -1
__10:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __13
	}
	XTclThreadFreeObj(tls, mappedMethodName)
	goto __14
__13:
	*(*uintptr)(unsafe.Pointer(mappedMethodName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = mappedMethodName
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__14:
	;
	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
	goto __8
__7:
	XTclFreeObj(tls, mappedMethodName)
__8:
	;
__6:
	;

	if !(result == TCL_BREAK) {
		goto __15
	}
	goto noMapping
	goto __16
__15:
	if !(result == TCL_ERROR) {
		goto __17
	}
	XTcl_AddErrorInfo(tls, interp, ts+49681)
__17:
	;
__16:
	;
	return result
__4:
	;

	// Get the call chain for the remapped name.

	(*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).FrefCount++
	contextPtr = XTclOOGetCallContext(tls, oPtr, mappedMethodName,
		flags|(*Object)(unsafe.Pointer(oPtr)).Fflags&FILTER_HANDLING, methodNamePtr)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).FrefCount, 1) > 1) {
		goto __18
	}
	goto __19
__18:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __20
	}

	if !((*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).Fbytes != XtclEmptyStringRep) {
		goto __22
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).Fbytes)
__22:
	;
	(*Tcl_Obj)(unsafe.Pointer(mappedMethodName)).Flength = -1
__23:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __26
	}
	XTclThreadFreeObj(tls, mappedMethodName)
	goto __27
__26:
	*(*uintptr)(unsafe.Pointer(mappedMethodName + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = mappedMethodName
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__27:
	;
	goto __24
__24:
	if 0 != 0 {
		goto __23
	}
	goto __25
__25:
	;
	goto __21
__20:
	XTclFreeObj(tls, mappedMethodName)
__21:
	;
__19:
	;

	if !(contextPtr == uintptr(0)) {
		goto __28
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+49714, libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(methodNamePtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(methodNamePtr)).Fbytes
			}
			return XTcl_GetString(tls, methodNamePtr)
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+49784,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(methodNamePtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(methodNamePtr)).Fbytes
			}
			return XTcl_GetString(tls, methodNamePtr)
		}(), uintptr(0)))
	return TCL_ERROR
__28:
	;
	goto __3
__2:
	// Get the call chain.

noMapping:
	contextPtr = XTclOOGetCallContext(tls, oPtr, methodNamePtr,
		flags|(*Object)(unsafe.Pointer(oPtr)).Fflags&FILTER_HANDLING, uintptr(0))
	if !(contextPtr == uintptr(0)) {
		goto __29
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+49714, libc.VaList(bp+48, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(methodNamePtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(methodNamePtr)).Fbytes
			}
			return XTcl_GetString(tls, methodNamePtr)
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+3593, ts+7170, ts+25775,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(methodNamePtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(methodNamePtr)).Fbytes
			}
			return XTcl_GetString(tls, methodNamePtr)
		}(), uintptr(0)))
	return TCL_ERROR
__29:
	;
__3:
	;

	// Check to see if we need to apply magical tricks to start part way
	// through the call chain.

	if !(*(*uintptr)(unsafe.Pointer(bp + 136)) != uintptr(0)) {
		goto __30
	}
__31:
	if !((*CallContext)(unsafe.Pointer(contextPtr)).Findex < (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain) {
		goto __33
	}
	miPtr =
		(*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24

	if !((*MInvoke)(unsafe.Pointer(miPtr)).FisFilter != 0) {
		goto __34
	}
	goto __32
__34:
	;
	if !((*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer(miPtr)).FmPtr)).FdeclaringClassPtr == *(*uintptr)(unsafe.Pointer(bp + 136))) {
		goto __35
	}
	goto __33
__35:
	;
	goto __32
__32:
	(*CallContext)(unsafe.Pointer(contextPtr)).Findex++
	goto __31
	goto __33
__33:
	;
	if !((*CallContext)(unsafe.Pointer(contextPtr)).Findex >= (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain) {
		goto __36
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+49798, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+7170, ts+25775,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(methodNamePtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(methodNamePtr)).Fbytes
			}
			return XTcl_GetString(tls, methodNamePtr)
		}(), uintptr(0)))
	XTclOODeleteContext(tls, contextPtr)
	return TCL_ERROR
__36:
	;
__30:
	;

	// Invoke the call chain, locking the object structure against deletion
	// for the duration.

__37:
__40:
	;
__43:
	if !(interp == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __46
	}
	_objPtr = XTclThreadAllocObj(tls)
	goto __47
__46:
	_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__47:
	;
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;
	_callbackPtr = _objPtr
	goto __41
__41:
	if 0 != 0 {
		goto __40
	}
	goto __42
__42:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sFinalizeObjectCall}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = contextPtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __38
__38:
	if 0 != 0 {
		goto __37
	}
	goto __39
__39:
	;
	return XTclOOInvokeContext(tls, contextPtr, interp, objc, objv)
}

func sFinalizeObjectCall(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOO.c:2648:1: */
	// Dispose of the call chain, which drops the lock on the object's
	// structure.

	XTclOODeleteContext(tls, *(*ClientData)(unsafe.Pointer(data)))
	return result
}

// ----------------------------------------------------------------------
//
// Tcl_ObjectContextInvokeNext, TclNRObjectContextInvokeNext, FinalizeNext --
//
//	Invokes the next stage of the call chain described in an object
//	context. This is the core of the implementation of the [next] command.
//	Does not do management of the call-frame stack. Available in public
//	(standard API) and private (NRE-aware) forms. FinalizeNext is a
//	private function used to clean up in the NRE case.
//
// ----------------------------------------------------------------------

func XTcl_ObjectContextInvokeNext(tls *libc.TLS, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr, skip int32) int32 { /* tclOO.c:2677:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var contextPtr uintptr = context
	var savedIndex int32 = (*CallContext)(unsafe.Pointer(contextPtr)).Findex
	var savedSkip int32 = (*CallContext)(unsafe.Pointer(contextPtr)).Fskip
	var result int32

	if (*CallContext)(unsafe.Pointer(contextPtr)).Findex+1 >= (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain {
		// We're at the end of the chain; generate an error message unless the
		// interpreter is being torn down, in which case we might be getting
		// here because of methods/destructors doing a [next] (or equivalent)
		// unexpectedly.

		var methodType uintptr

		if XTcl_InterpDeleted(tls, interp) != 0 {
			return TCL_OK
		}

		if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&CONSTRUCTOR != 0 {
			methodType = ts + 25887 /* "constructor" */
		} else if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&DESTRUCTOR != 0 {
			methodType = ts + 25899 /* "destructor" */
		} else {
			methodType = ts + 25917 /* "method" */
		}

		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+28771, libc.VaList(bp, methodType)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+28514, ts+28797, uintptr(0)))
		return TCL_ERROR
	}

	// Advance to the next method implementation in the chain in the method
	// call context while we process the body. However, need to adjust the
	// argument-skip control because we're guaranteed to have a single prefix
	// arg (i.e., 'next') and not the variable amount that can happen because
	// method invocations (i.e., '$obj meth' and 'my meth'), constructors
	// (i.e., '$cls new' and '$cls create obj') and destructors (no args at
	// all) come through the same code.

	(*CallContext)(unsafe.Pointer(contextPtr)).Findex++
	(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = skip

	// Invoke the (advanced) method call context in the caller context.

	result = XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclOOInvokeContext})), contextPtr, objc,
		objv)

	// Restore the call chain context index as we've finished the inner invoke
	// and want to operate in the outer context again.

	(*CallContext)(unsafe.Pointer(contextPtr)).Findex = savedIndex
	(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = savedSkip

	return result
}

func XTclNRObjectContextInvokeNext(tls *libc.TLS, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr, skip int32) int32 { /* tclOO.c:2749:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var contextPtr uintptr = context

	if (*CallContext)(unsafe.Pointer(contextPtr)).Findex+1 >= (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain {
		// We're at the end of the chain; generate an error message unless the
		// interpreter is being torn down, in which case we might be getting
		// here because of methods/destructors doing a [next] (or equivalent)
		// unexpectedly.

		var methodType uintptr

		if XTcl_InterpDeleted(tls, interp) != 0 {
			return TCL_OK
		}

		if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&CONSTRUCTOR != 0 {
			methodType = ts + 25887 /* "constructor" */
		} else if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&DESTRUCTOR != 0 {
			methodType = ts + 25899 /* "destructor" */
		} else {
			methodType = ts + 25917 /* "method" */
		}

		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+28771, libc.VaList(bp, methodType)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+28514, ts+28797, uintptr(0)))
		return TCL_ERROR
	}

	// Advance to the next method implementation in the chain in the method
	// call context while we process the body. However, need to adjust the
	// argument-skip control because we're guaranteed to have a single prefix
	// arg (i.e., 'next') and not the variable amount that can happen because
	// method invocations (i.e., '$obj meth' and 'my meth'), constructors
	// (i.e., '$cls new' and '$cls create obj') and destructors (no args at
	// all) come through the same code.

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sFinalizeNext}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = contextPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(Intptr_t((*CallContext)(unsafe.Pointer(contextPtr)).Findex))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(Intptr_t((*CallContext)(unsafe.Pointer(contextPtr)).Fskip))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	(*CallContext)(unsafe.Pointer(contextPtr)).Findex++
	(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = skip

	// Invoke the (advanced) method call context in the caller context.

	return XTclOOInvokeContext(tls, contextPtr, interp, objc, objv)
}

func sFinalizeNext(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOO.c:2809:1: */
	var contextPtr uintptr = *(*ClientData)(unsafe.Pointer(data))

	// Restore the call chain context index as we've finished the inner invoke
	// and want to operate in the outer context again.

	(*CallContext)(unsafe.Pointer(contextPtr)).Findex = int32(*(*ClientData)(unsafe.Pointer(data + 1*8)))
	(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = int32(*(*ClientData)(unsafe.Pointer(data + 2*8)))
	return result
}

// ----------------------------------------------------------------------
//
// Tcl_GetObjectFromObj --
//
//	Utility function to get an object from a Tcl_Obj containing its name.
//
// ----------------------------------------------------------------------

func XTcl_GetObjectFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr) Tcl_Object { /* tclOO.c:2837:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var cmdPtr uintptr
	cmdPtr = XTcl_GetCommandFromObj(tls, interp, objPtr)

	if !(cmdPtr == uintptr(0)) {
		goto __1
	}
	goto notAnObject
__1:
	;
	if !((*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sPublicObjectCmd}))) {
		goto __2
	}
	cmdPtr = XTclGetOriginalCommand(tls, cmdPtr)
	if !(cmdPtr == uintptr(0) || (*Command)(unsafe.Pointer(cmdPtr)).FobjProc != *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sPublicObjectCmd}))) {
		goto __3
	}
	goto notAnObject
__3:
	;
__2:
	;
	return (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData

notAnObject:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+49829, libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}
			return XTcl_GetString(tls, objPtr)
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+49860, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}(),
		uintptr(0)))
	return uintptr(0)
}

// ----------------------------------------------------------------------
//
// TclOOIsReachable --
//
//	Utility function that tests whether a class is a subclass (whether
//	directly or indirectly) of another class.
//
// ----------------------------------------------------------------------

func XTclOOIsReachable(tls *libc.TLS, targetPtr uintptr, startPtr uintptr) int32 { /* tclOO.c:2877:1: */
	var i int32
	var superPtr uintptr

tailRecurse:
	if !(startPtr == targetPtr) {
		goto __1
	}
	return 1
__1:
	;
	if !((*Class)(unsafe.Pointer(startPtr)).Fsuperclasses.Fnum == 1 && (*Class)(unsafe.Pointer(startPtr)).Fmixins.Fnum == 0) {
		goto __2
	}
	startPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(startPtr)).Fsuperclasses.Flist))
	goto tailRecurse
__2:
	;
	i = 0
__3:
	if !(i < (*Class)(unsafe.Pointer(startPtr)).Fsuperclasses.Fnum) {
		goto __5
	}
	if !(*(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(startPtr)).Fsuperclasses.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __6
	}
	goto __4
	goto __7
__6:
	if !func() bool {
		superPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(startPtr)).Fsuperclasses.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __8
	}
	if !(XTclOOIsReachable(tls, targetPtr, superPtr) != 0) {
		goto __9
	}
	return 1
__9:
	;
__8:
	;
__7:
	;
	goto __4
__4:
	i++
	goto __3
	goto __5
__5:
	;
	i = 0
__10:
	if !(i < (*Class)(unsafe.Pointer(startPtr)).Fmixins.Fnum) {
		goto __12
	}
	if !(*(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(startPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __13
	}
	goto __11
	goto __14
__13:
	if !func() bool {
		superPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(startPtr)).Fmixins.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __15
	}
	if !(XTclOOIsReachable(tls, targetPtr, superPtr) != 0) {
		goto __16
	}
	return 1
__16:
	;
__15:
	;
__14:
	;
	goto __11
__11:
	i++
	goto __10
	goto __12
__12:
	;
	return 0
}

// ----------------------------------------------------------------------
//
// TclOOObjectName, Tcl_GetObjectName --
//
//	Utility function that returns the name of the object. Note that this
//	simplifies cache management by keeping the code to do it in one place
//	and not sprayed all over. The value returned always has a reference
//	count of at least one.
//
// ----------------------------------------------------------------------

func XTclOOObjectName(tls *libc.TLS, interp uintptr, oPtr uintptr) uintptr { /* tclOO.c:2918:9: */
	var namePtr uintptr

	if (*Object)(unsafe.Pointer(oPtr)).FcachedNameObj != 0 {
		return (*Object)(unsafe.Pointer(oPtr)).FcachedNameObj
	}
	namePtr = XTcl_NewObj(tls)
	XTcl_GetCommandFullName(tls, interp, (*Object)(unsafe.Pointer(oPtr)).Fcommand, namePtr)
	(*Tcl_Obj)(unsafe.Pointer(namePtr)).FrefCount++
	(*Object)(unsafe.Pointer(oPtr)).FcachedNameObj = namePtr
	return namePtr
}

func XTcl_GetObjectName(tls *libc.TLS, interp uintptr, object Tcl_Object) uintptr { /* tclOO.c:2935:9: */
	return XTclOOObjectName(tls, interp, object)
}

// ----------------------------------------------------------------------
//
// assorted trivial 'getter' functions
//
// ----------------------------------------------------------------------

func XTcl_ObjectContextMethod(tls *libc.TLS, context Tcl_ObjectContext) Tcl_Method { /* tclOO.c:2952:1: */
	var contextPtr uintptr = context
	return (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr
}

func XTcl_ObjectContextIsFiltering(tls *libc.TLS, context Tcl_ObjectContext) int32 { /* tclOO.c:2960:1: */
	var contextPtr uintptr = context
	return (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FisFilter
}

func XTcl_ObjectContextObject(tls *libc.TLS, context Tcl_ObjectContext) Tcl_Object { /* tclOO.c:2968:1: */
	return (*CallContext)(unsafe.Pointer(context)).FoPtr
}

func XTcl_ObjectContextSkippedArgs(tls *libc.TLS, context Tcl_ObjectContext) int32 { /* tclOO.c:2975:1: */
	return (*CallContext)(unsafe.Pointer(context)).Fskip
}

func XTcl_GetObjectNamespace(tls *libc.TLS, object Tcl_Object) uintptr { /* tclOO.c:2981:15: */
	return (*Object)(unsafe.Pointer(object)).FnamespacePtr
}

func XTcl_GetObjectCommand(tls *libc.TLS, object Tcl_Object) Tcl_Command { /* tclOO.c:2989:1: */
	return (*Object)(unsafe.Pointer(object)).Fcommand
}

func XTcl_GetObjectAsClass(tls *libc.TLS, object Tcl_Object) Tcl_Class { /* tclOO.c:2996:1: */
	return (*Object)(unsafe.Pointer(object)).FclassPtr
}

func XTcl_ObjectDeleted(tls *libc.TLS, object Tcl_Object) int32 { /* tclOO.c:3003:1: */
	return libc.Bool32((*Object)(unsafe.Pointer(object)).Fcommand == uintptr(0))
}

func XTcl_GetClassAsObject(tls *libc.TLS, clazz Tcl_Class) Tcl_Object { /* tclOO.c:3010:1: */
	return (*Class)(unsafe.Pointer(clazz)).FthisPtr
}

func XTcl_ObjectGetMethodNameMapper(tls *libc.TLS, object Tcl_Object) uintptr { /* tclOO.c:3016:29: */
	return (*Object)(unsafe.Pointer(object)).FmapMethodNameProc
}

func XTcl_ObjectSetMethodNameMapper(tls *libc.TLS, object Tcl_Object, mapMethodNameProc uintptr) { /* tclOO.c:3024:1: */
	(*Object)(unsafe.Pointer(object)).FmapMethodNameProc = mapMethodNameProc
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// ----------------------------------------------------------------------
//
// AddCreateCallback, FinalizeConstruction --
//
//	Special version of TclNRAddCallback that allows the caller to splice
//	the object created later on. Always calls FinalizeConstruction, which
//	converts the object into its name and stores that in the interpreter
//	result. This is shared by all the construction methods (create,
//	createWithNamespace, new).
//
//	Note that this is the only code in this file (or, indeed, the whole of
//	TclOO) that uses NRE internals; it is the only code that does
//	non-standard poking in the NRE guts.
//
// ----------------------------------------------------------------------

func sAddConstructionFinalizer(tls *libc.TLS, interp uintptr) uintptr { /* tclOOBasic.c:44:26: */
	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sFinalizeConstruction}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr + 8
}

func sFinalizeConstruction(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOOBasic.c:53:1: */
	var oPtr uintptr = *(*ClientData)(unsafe.Pointer(data))

	if result != TCL_OK {
		return result
	}
	XTcl_SetObjResult(tls, interp, XTclOOObjectName(tls, interp, oPtr))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOO_Class_Constructor --
//
//	Implementation for oo::class constructor.
//
// ----------------------------------------------------------------------

func XTclOO_Class_Constructor(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOOBasic.c:78:1: */
	var oPtr uintptr = XTcl_ObjectContextObject(tls, context)
	var invoke uintptr

	if objc-1 > XTcl_ObjectContextSkippedArgs(tls, context) {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			ts+49867)
		return TCL_ERROR
	} else if objc == XTcl_ObjectContextSkippedArgs(tls, context) {
		return TCL_OK
	}

	// Delegate to [oo::define] to do the work.

	invoke = XTcl_Alloc(tls, uint32(uint64(3)*uint64(unsafe.Sizeof(uintptr(0)))))
	*(*uintptr)(unsafe.Pointer(invoke)) = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).FdefineName
	*(*uintptr)(unsafe.Pointer(invoke + 1*8)) = XTclOOObjectName(tls, interp, oPtr)
	*(*uintptr)(unsafe.Pointer(invoke + 2*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))

	// Must add references or errors in configuration script will cause
	// trouble.

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke)))).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 1*8)))).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 2*8)))).FrefCount++
	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sDecrRefsPostClassConstructor}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = invoke
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}

	// Tricky point: do not want the extra reported level in the Tcl stack
	// trace, so use TCL_EVAL_NOERR.

	return XTclNREvalObjv(tls, interp, 3, invoke, TCL_EVAL_NOERR, uintptr(0))
}

func sDecrRefsPostClassConstructor(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOOBasic.c:125:1: */
	var invoke uintptr = *(*ClientData)(unsafe.Pointer(data))

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke)))).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke)))).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke)))).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke)))).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke)))).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(invoke)))
				} else {
					*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(invoke))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(invoke)))
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 1*8)))).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 1*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 1*8)))).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 1*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 1*8)))).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 1*8)))).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 1*8)))).Flength = -1
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(invoke + 1*8)))
				} else {
					*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 1*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(invoke + 1*8))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(invoke + 1*8)))
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 2*8)))).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 2*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 2*8)))).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 2*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 2*8)))).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 2*8)))).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 2*8)))).Flength = -1
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(invoke + 2*8)))
				} else {
					*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(invoke + 2*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(invoke + 2*8))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(invoke + 2*8)))
		}
	}

	XTclpFree(tls, invoke)
	return result
}

// ----------------------------------------------------------------------
//
// TclOO_Class_Create --
//
//	Implementation for oo::class->create method.
//
// ----------------------------------------------------------------------

func XTclOO_Class_Create(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOOBasic.c:150:1: */
	bp := tls.Alloc(76)
	defer tls.Free(76)

	var oPtr uintptr = XTcl_ObjectContextObject(tls, context)
	var objName uintptr
	// var len int32 at bp+72, 4

	// Sanity check; should not be possible to invoke this method on a
	// non-class.

	if (*Object)(unsafe.Pointer(oPtr)).FclassPtr == uintptr(0) {
		var cmdnameObj uintptr = XTclOOObjectName(tls, interp, oPtr)

		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+49886, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(cmdnameObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(cmdnameObj)).Fbytes
				}
				return XTcl_GetString(tls, cmdnameObj)
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+28514, ts+49913, uintptr(0)))
		return TCL_ERROR
	}

	// Check we have the right number of (sensible) arguments.

	if objc-XTcl_ObjectContextSkippedArgs(tls, context) < 1 {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			ts+49934)
		return TCL_ERROR
	}
	objName = XTcl_GetStringFromObj(tls,
		*(*uintptr)(unsafe.Pointer(objv + uintptr(XTcl_ObjectContextSkippedArgs(tls, context))*8)), bp+72)
	if *(*int32)(unsafe.Pointer(bp + 72)) == 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+49955, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+28514, ts+49985, uintptr(0)))
		return TCL_ERROR
	}

	// Make the object and return its name.

	return XTclNRNewObjectInstance(tls, interp, (*Object)(unsafe.Pointer(oPtr)).FclassPtr,
		objName, uintptr(0), objc, objv,
		XTcl_ObjectContextSkippedArgs(tls, context)+1,
		sAddConstructionFinalizer(tls, interp))
}

// ----------------------------------------------------------------------
//
// TclOO_Class_CreateNs --
//
//	Implementation for oo::class->createWithNamespace method.
//
// ----------------------------------------------------------------------

func XTclOO_Class_CreateNs(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOOBasic.c:215:1: */
	bp := tls.Alloc(108)
	defer tls.Free(108)

	var oPtr uintptr = XTcl_ObjectContextObject(tls, context)
	var objName uintptr
	var nsName uintptr
	// var len int32 at bp+104, 4

	// Sanity check; should not be possible to invoke this method on a
	// non-class.

	if (*Object)(unsafe.Pointer(oPtr)).FclassPtr == uintptr(0) {
		var cmdnameObj uintptr = XTclOOObjectName(tls, interp, oPtr)

		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+49886, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(cmdnameObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(cmdnameObj)).Fbytes
				}
				return XTcl_GetString(tls, cmdnameObj)
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+28514, ts+49913, uintptr(0)))
		return TCL_ERROR
	}

	// Check we have the right number of (sensible) arguments.

	if objc-XTcl_ObjectContextSkippedArgs(tls, context) < 2 {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			ts+49996)
		return TCL_ERROR
	}
	objName = XTcl_GetStringFromObj(tls,
		*(*uintptr)(unsafe.Pointer(objv + uintptr(XTcl_ObjectContextSkippedArgs(tls, context))*8)), bp+104)
	if *(*int32)(unsafe.Pointer(bp + 104)) == 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+49955, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+28514, ts+49985, uintptr(0)))
		return TCL_ERROR
	}
	nsName = XTcl_GetStringFromObj(tls,
		*(*uintptr)(unsafe.Pointer(objv + uintptr(XTcl_ObjectContextSkippedArgs(tls, context)+1)*8)), bp+104)
	if *(*int32)(unsafe.Pointer(bp + 104)) == 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+50031, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+28514, ts+49985, uintptr(0)))
		return TCL_ERROR
	}

	// Make the object and return its name.

	return XTclNRNewObjectInstance(tls, interp, (*Object)(unsafe.Pointer(oPtr)).FclassPtr,
		objName, nsName, objc, objv,
		XTcl_ObjectContextSkippedArgs(tls, context)+2,
		sAddConstructionFinalizer(tls, interp))
}

// ----------------------------------------------------------------------
//
// TclOO_Class_New --
//
//	Implementation for oo::class->new method.
//
// ----------------------------------------------------------------------

func XTclOO_Class_New(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOOBasic.c:288:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var oPtr uintptr = XTcl_ObjectContextObject(tls, context)

	// Sanity check; should not be possible to invoke this method on a
	// non-class.

	if (*Object)(unsafe.Pointer(oPtr)).FclassPtr == uintptr(0) {
		var cmdnameObj uintptr = XTclOOObjectName(tls, interp, oPtr)

		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+49886, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(cmdnameObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(cmdnameObj)).Fbytes
				}
				return XTcl_GetString(tls, cmdnameObj)
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+28514, ts+49913, uintptr(0)))
		return TCL_ERROR
	}

	// Make the object and return its name.

	return XTclNRNewObjectInstance(tls, interp, (*Object)(unsafe.Pointer(oPtr)).FclassPtr,
		uintptr(0), uintptr(0), objc, objv, XTcl_ObjectContextSkippedArgs(tls, context),
		sAddConstructionFinalizer(tls, interp))
}

// ----------------------------------------------------------------------
//
// TclOO_Object_Destroy --
//
//	Implementation for oo::object->destroy method.
//
// ----------------------------------------------------------------------

func XTclOO_Object_Destroy(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOOBasic.c:332:1: */
	var oPtr uintptr = XTcl_ObjectContextObject(tls, context)
	var contextPtr uintptr

	if objc != XTcl_ObjectContextSkippedArgs(tls, context) {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			uintptr(0))
		return TCL_ERROR
	}
	if !((*Object)(unsafe.Pointer(oPtr)).Fflags&DESTRUCTOR_CALLED != 0) {
		*(*int32)(unsafe.Pointer(oPtr + 92)) |= DESTRUCTOR_CALLED
		contextPtr = XTclOOGetCallContext(tls, oPtr, uintptr(0), DESTRUCTOR, uintptr(0))
		if contextPtr != uintptr(0) {
			*(*int32)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr + 12)) |= DESTRUCTOR
			(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = 0
			for ok := true; ok; ok = 0 != 0 {
				var _callbackPtr uintptr
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _objPtr uintptr
					{
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if interp == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							_objPtr = XTclThreadAllocObj(tls)
						} else {
							_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					_callbackPtr = _objPtr
				}
				(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, uintptr, uintptr, int32) int32
				}{sAfterNRDestructor}))
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = contextPtr
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
				(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
				(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
			}
			XTclPushTailcallPoint(tls, interp)
			return XTclOOInvokeContext(tls, contextPtr, interp, 0, uintptr(0))
		}
	}
	if (*Object)(unsafe.Pointer(oPtr)).Fcommand != 0 {
		XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer(oPtr)).Fcommand)
	}
	return TCL_OK
}

func sAfterNRDestructor(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOOBasic.c:367:1: */
	var contextPtr uintptr = *(*ClientData)(unsafe.Pointer(data))

	if (*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).Fcommand != 0 {
		XTcl_DeleteCommandFromToken(tls, interp, (*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).Fcommand)
	}
	XTclOODeleteContext(tls, contextPtr)
	return result
}

// ----------------------------------------------------------------------
//
// TclOO_Object_Eval --
//
//	Implementation for oo::object->eval method.
//
// ----------------------------------------------------------------------

func XTclOO_Object_Eval(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOOBasic.c:392:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var contextPtr uintptr = context
	var object Tcl_Object = XTcl_ObjectContextObject(tls, context)
	var skip int32 = XTcl_ObjectContextSkippedArgs(tls, context)
	// var framePtr uintptr at bp, 8

	var framePtrPtr uintptr = bp /* &framePtr */
	var scriptPtr uintptr
	var invoker uintptr

	if objc-1 < skip {
		XTcl_WrongNumArgs(tls, interp, skip, objv, ts+12083)
		return TCL_ERROR
	}

	// Make the object's namespace the current namespace and evaluate the
	// command(s).

	XTclPushStackFrame(tls, interp, framePtrPtr,
		XTcl_GetObjectNamespace(tls, object), 0)
	(*CallFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* framePtr */)))).Fobjc = objc
	(*CallFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* framePtr */)))).Fobjv = objv // Reference counts do not need to be
	// incremented here.

	if !((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&PUBLIC_METHOD != 0) {
		object = uintptr(0) // Now just for error mesage printing.
	}

	// Work out what script we are actually going to evaluate.
	//
	// When there's more than one argument, we concatenate them together with
	// spaces between, then evaluate the result. Tcl_EvalObjEx will delete the
	// object when it decrements its refcount after eval'ing it.

	if objc != skip+1 {
		scriptPtr = XTcl_ConcatObj(tls, objc-skip, objv+uintptr(skip)*8)
		invoker = uintptr(0)
	} else {
		scriptPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8))
		invoker = (*Interp)(unsafe.Pointer(interp)).FcmdFramePtr
	}

	// Evaluate the script now, with FinalizeEval to do the processing after
	// the script completes.

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sFinalizeEval}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = object
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return XTclNREvalObjEx(tls, interp, scriptPtr, 0, invoker, skip)
}

func sFinalizeEval(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOOBasic.c:453:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	if result == TCL_ERROR {
		var oPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
		var namePtr uintptr

		if oPtr != 0 {
			namePtr = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(XTclOOObjectName(tls, interp, oPtr))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(XTclOOObjectName(tls, interp, oPtr))).Fbytes
				}
				return XTcl_GetString(tls, XTclOOObjectName(tls, interp, oPtr))
			}()
		} else {
			namePtr = ts + 49396 /* "my" */
		}

		XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
			ts+50064,
			libc.VaList(bp, namePtr, XTcl_GetErrorLine(tls, interp))))
	}

	// Restore the previous "current" namespace.

	XTclPopStackFrame(tls, interp)
	return result
}

// ----------------------------------------------------------------------
//
// TclOO_Object_Unknown --
//
//	Default unknown method handler method (defined in oo::object). This
//	just creates a suitable error message.
//
// ----------------------------------------------------------------------

func XTclOO_Object_Unknown(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOOBasic.c:493:1: */
	bp := tls.Alloc(112)
	defer tls.Free(112)

	var contextPtr uintptr = context
	var oPtr uintptr = (*CallContext)(unsafe.Pointer(contextPtr)).FoPtr
	// var methodNames uintptr at bp+104, 8

	var numMethodNames int32
	var i int32
	var skip int32 = XTcl_ObjectContextSkippedArgs(tls, context)
	var errorMsg uintptr

	// If no method name, generate an error asking for a method name. (Only by
	// overriding *this* method can an object handle the absence of a method
	// name without an error).

	if objc < skip+1 {
		XTcl_WrongNumArgs(tls, interp, skip, objv, ts+50099)
		return TCL_ERROR
	}

	// Get the list of methods that we want to know about.

	numMethodNames = XTclOOGetSortedMethodList(tls, oPtr,
		(*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&PUBLIC_METHOD, bp+104)

	// Special message when there are no visible methods at all.

	if numMethodNames == 0 {
		var tmpBuf uintptr = XTclOOObjectName(tls, interp, oPtr)
		var piece uintptr

		if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&PUBLIC_METHOD != 0 {
			piece = ts + 50116 /* "visible methods" */
		} else {
			piece = ts + 50132 /* "methods" */
		}
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+50140, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(tmpBuf)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(tmpBuf)).Fbytes
				}
				return XTcl_GetString(tls, tmpBuf)
			}(), piece)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+7170, ts+25775,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))
			}(), uintptr(0)))
		return TCL_ERROR
	}

	errorMsg = XTcl_ObjPrintf(tls, ts+50162,
		libc.VaList(bp+56, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))
		}()))
	for i = 0; i < numMethodNames-1; i++ {
		if i != 0 {
			XTcl_AppendToObj(tls, errorMsg, ts+18549, -1)
		}
		XTcl_AppendToObj(tls, errorMsg, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104 /* methodNames */)) + uintptr(i)*8)), -1)
	}
	if i != 0 {
		XTcl_AppendToObj(tls, errorMsg, ts+38523, -1)
	}
	XTcl_AppendToObj(tls, errorMsg, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104 /* methodNames */)) + uintptr(i)*8)), -1)
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 104)))
	XTcl_SetObjResult(tls, interp, errorMsg)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+7170, ts+25775,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(skip)*8)))
		}(), uintptr(0)))
	return TCL_ERROR
}

// ----------------------------------------------------------------------
//
// TclOO_Object_LinkVar --
//
//	Implementation of oo::object->variable method.
//
// ----------------------------------------------------------------------

func XTclOO_Object_LinkVar(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOOBasic.c:575:1: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	var iPtr uintptr = interp
	var object Tcl_Object = XTcl_ObjectContextObject(tls, context)
	var savedNsPtr uintptr
	var i int32

	if objc-XTcl_ObjectContextSkippedArgs(tls, context) < 0 {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			ts+50192)
		return TCL_ERROR
	}

	// A sanity check. Shouldn't ever happen. (This is all that remains of a
	// more complex check inherited from [global] after we have applied the
	// fix for [Bug 2903811]; note that the fix involved *removing* code.)

	if (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr == uintptr(0) {
		return TCL_OK
	}

	for i = XTcl_ObjectContextSkippedArgs(tls, context); i < objc; i++ {
		var varPtr uintptr
		// var aryPtr uintptr at bp+72, 8

		var varName uintptr = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
		}()

		// The variable name must not contain a '::' since that's illegal in
		// local names.

		if libc.Xstrstr(tls, varName, ts+6847) != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

				ts+50206, libc.VaList(bp, varName)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+50271, ts+50277, uintptr(0)))
			return TCL_ERROR
		}

		// Switch to the object's namespace for the duration of this call.
		// Like this, the variable is looked up in the namespace of the
		// object, and not in the namespace of the caller. Otherwise this
		// would only work if the caller was a method of the object itself,
		// which might not be true if the method was exported. This is a bit
		// of a hack, but the simplest way to do this (pushing a stack frame
		// would be horribly expensive by comparison).

		savedNsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr
		(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr = XTcl_GetObjectNamespace(tls, object)
		varPtr = XTclObjLookupVar(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(0), TCL_NAMESPACE_ONLY,
			ts+50286, 1, 0, bp+72)
		(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr = savedNsPtr

		if varPtr == uintptr(0) || *(*uintptr)(unsafe.Pointer(bp + 72)) != uintptr(0) {
			// Variable cannot be an element in an array. If aryPtr is not
			// NULL, it is an element, so throw up an error and return.

			XTclVarErrMsg(tls, interp, varName, uintptr(0), ts+50286,
				ts+50293)
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+50271, ts+50331, uintptr(0)))
			return TCL_ERROR
		}

		// Arrange for the lifetime of the variable to be correctly managed.
		// This is copied out of Tcl_VariableObjCmd...

		if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_NAMESPACE_VAR != 0) {
			if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_NAMESPACE_VAR != 0) {
				*(*int32)(unsafe.Pointer(varPtr)) |= VAR_NAMESPACE_VAR
				if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
					(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount++
				}
			}

		}

		if XTclPtrMakeUpvar(tls, interp, varPtr, varName, 0, -1) != TCL_OK {
			return TCL_ERROR
		}
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOO_Object_VarName --
//
//	Implementation of the oo::object->varname method.
//
// ----------------------------------------------------------------------

func XTclOO_Object_VarName(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOOBasic.c:677:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var varPtr uintptr
	// var aryVar uintptr at bp+40, 8

	var varNamePtr uintptr
	var argPtr uintptr
	var arg uintptr

	if XTcl_ObjectContextSkippedArgs(tls, context)+1 != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			ts+13653)
		return TCL_ERROR
	}
	argPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))
	arg = XTcl_GetString(tls, argPtr)

	// Convert the variable name to fully-qualified form if it wasn't already.
	// This has to be done prior to lookup because we can run into problems
	// with resolvers otherwise. [Bug 3603695]
	//
	// We still need to do the lookup; the variable could be linked to another
	// variable and we want the target's name.

	if int32(*(*int8)(unsafe.Pointer(arg))) == ':' && int32(*(*int8)(unsafe.Pointer(arg + 1))) == ':' {
		varNamePtr = argPtr
	} else {
		var namespacePtr uintptr = XTcl_GetObjectNamespace(tls, XTcl_ObjectContextObject(tls, context))

		varNamePtr = XTcl_NewStringObj(tls, (*Tcl_Namespace)(unsafe.Pointer(namespacePtr)).FfullName, -1)
		XTcl_AppendToObj(tls, varNamePtr, ts+6847, 2)
		XTcl_AppendObjToObj(tls, varNamePtr, argPtr)
	}
	(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).FrefCount++
	varPtr = XTclObjLookupVar(tls, interp, varNamePtr, uintptr(0),
		TCL_NAMESPACE_ONLY|TCL_LEAVE_ERR_MSG, ts+50345, 1, 1, bp+40)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = varNamePtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if varPtr == uintptr(0) {
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7170, ts+14261, arg, uintptr(0)))
		return TCL_ERROR
	}

	// Now that we've pinned down what variable we're really talking about
	// (including traversing variable links), convert back to a name.

	varNamePtr = XTcl_NewObj(tls)
	if *(*uintptr)(unsafe.Pointer(bp + 40)) != uintptr(0) {
		var hPtr uintptr
		// var search Tcl_HashSearch at bp+48, 24

		XTcl_GetVariableFullName(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 40 /* aryVar */)), varNamePtr)

		// WARNING! This code pokes inside the implementation of hash tables!

		hPtr = XTcl_FirstHashEntry(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 8)),
			bp+48)
		for hPtr != uintptr(0) {
			if varPtr == (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData {
				XTcl_AppendToObj(tls, varNamePtr, ts+50354, -1)
				XTcl_AppendObjToObj(tls, varNamePtr, *(*uintptr)(unsafe.Pointer(hPtr + 32)))
				XTcl_AppendToObj(tls, varNamePtr, ts+3493, -1)
				break
			}
			hPtr = XTcl_NextHashEntry(tls, bp+48)
		}
	} else {
		XTcl_GetVariableFullName(tls, interp, varPtr, varNamePtr)
	}
	XTcl_SetObjResult(tls, interp, varNamePtr)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOONextObjCmd, TclOONextToObjCmd --
//
//	Implementation of the [next] and [nextto] commands. Note that these
//	commands are only ever to be used inside the body of a procedure-like
//	method.
//
// ----------------------------------------------------------------------

func XTclOONextObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOBasic.c:772:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var iPtr uintptr = interp
	var framePtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	var context Tcl_ObjectContext

	// Start with sanity checks on the calling context to make sure that we
	// are invoked from a suitable method context. If so, we can safely
	// retrieve the handle to the object call context.

	if framePtr == uintptr(0) || !((*CallFrame)(unsafe.Pointer(framePtr)).FisProcCallFrame&FRAME_IS_METHOD != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+50356,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+28514, ts+28517, uintptr(0)))
		return TCL_ERROR
	}
	context = (*CallFrame)(unsafe.Pointer(framePtr)).FclientData

	// Invoke the (advanced) method call context in the caller context. Note
	// that this is like [uplevel 1] and not [eval].

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sNextRestoreFrame}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = framePtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = (*CallFrame)(unsafe.Pointer(framePtr)).FcallerVarPtr
	return XTclNRObjectContextInvokeNext(tls, interp, context, objc, objv, 1)
}

func XTclOONextToObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOBasic.c:808:1: */
	bp := tls.Alloc(176)
	defer tls.Free(176)

	var iPtr uintptr = interp
	var framePtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	var classPtr uintptr
	var contextPtr uintptr
	var i int32
	var object Tcl_Object
	var methodType uintptr

	// Start with sanity checks on the calling context to make sure that we
	// are invoked from a suitable method context. If so, we can safely
	// retrieve the handle to the object call context.

	if framePtr == uintptr(0) || !((*CallFrame)(unsafe.Pointer(framePtr)).FisProcCallFrame&FRAME_IS_METHOD != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+50356,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+28514, ts+28517, uintptr(0)))
		return TCL_ERROR
	}
	contextPtr = (*CallFrame)(unsafe.Pointer(framePtr)).FclientData

	// Sanity check the arguments; we need the first one to refer to a class.

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+50399)
		return TCL_ERROR
	}
	object = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if object == uintptr(0) {
		return TCL_ERROR
	}
	classPtr = (*Object)(unsafe.Pointer(object)).FclassPtr
	if classPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+25445, libc.VaList(bp+40, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+28514, ts+28581, uintptr(0)))
		return TCL_ERROR
	}

	// Search for an implementation of a method associated with the current
	// call on the call chain past the point where we currently are. Do not
	// allow jumping backwards!

	for i = (*CallContext)(unsafe.Pointer(contextPtr)).Findex + 1; i < (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain; i++ {
		var miPtr uintptr = (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr(i)*24

		if !((*MInvoke)(unsafe.Pointer(miPtr)).FisFilter != 0) && (*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer(miPtr)).FmPtr)).FdeclaringClassPtr == classPtr {
			// Invoke the (advanced) method call context in the caller
			// context. Note that this is like [uplevel 1] and not [eval].

			for ok := true; ok; ok = 0 != 0 {
				var _callbackPtr uintptr
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _objPtr uintptr
					{
					}
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if interp == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							_objPtr = XTclThreadAllocObj(tls)
						} else {
							_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					_callbackPtr = _objPtr
				}
				(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, uintptr, uintptr, int32) int32
				}{sNextRestoreFrame}))
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = framePtr
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = contextPtr
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(Intptr_t((*CallContext)(unsafe.Pointer(contextPtr)).Findex))
				*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
				(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
				(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
			}
			(*CallContext)(unsafe.Pointer(contextPtr)).Findex = i - 1
			(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = (*CallFrame)(unsafe.Pointer(framePtr)).FcallerVarPtr
			return XTclNRObjectContextInvokeNext(tls, interp,
				contextPtr, objc, objv, 2)
		}
	}

	// Generate an appropriate error message, depending on whether the value
	// is on the chain but unreachable, or not on the chain at all.

	if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&CONSTRUCTOR != 0 {
		methodType = ts + 25887 /* "constructor" */
	} else if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&DESTRUCTOR != 0 {
		methodType = ts + 25899 /* "destructor" */
	} else {
		methodType = ts + 25917 /* "method" */
	}

	for i = (*CallContext)(unsafe.Pointer(contextPtr)).Findex; i >= 0; i-- {
		var miPtr uintptr = (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr(i)*24

		if !((*MInvoke)(unsafe.Pointer(miPtr)).FisFilter != 0) && (*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer(miPtr)).FmPtr)).FdeclaringClassPtr == classPtr {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+28596,
				libc.VaList(bp+80, methodType, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
					}
					return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
				}())))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+28514, ts+28646,
				uintptr(0)))
			return TCL_ERROR
		}
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+28666,
		libc.VaList(bp+128, methodType, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+144, ts+3593, ts+28514, ts+28710, uintptr(0)))
	return TCL_ERROR
}

func sNextRestoreFrame(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOOBasic.c:914:1: */
	var iPtr uintptr = interp
	var contextPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 1*8))

	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = *(*ClientData)(unsafe.Pointer(data))
	if contextPtr != uintptr(0) {
		(*CallContext)(unsafe.Pointer(contextPtr)).Findex = int32(*(*ClientData)(unsafe.Pointer(data + 2*8)))
	}
	return result
}

// ----------------------------------------------------------------------
//
// TclOOSelfObjCmd --
//
//	Implementation of the [self] command, which provides introspection of
//	the call context.
//
// ----------------------------------------------------------------------

func XTclOOSelfObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOBasic.c:941:1: */
	bp := tls.Alloc(200)
	defer tls.Free(200)

	var iPtr uintptr = interp
	var framePtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	var contextPtr uintptr
	// var result [3]uintptr at bp+176, 24

	// var index int32 at bp+168, 4

	// Start with sanity checks on the calling context and the method context.

	if framePtr == uintptr(0) || !((*CallFrame)(unsafe.Pointer(framePtr)).FisProcCallFrame&FRAME_IS_METHOD != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+50356,
			libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+28514, ts+28517, uintptr(0)))
		return TCL_ERROR
	}

	contextPtr = (*CallFrame)(unsafe.Pointer(framePtr)).FclientData

	// Now we do "conventional" argument parsing for a while. Note that no
	// subcommand takes arguments.

	if objc > 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+21897)
		return TCL_ERROR
	} else if objc == 1 {
		*(*int32)(unsafe.Pointer(bp + 168 /* index */)) = 7 /* SELF_OBJECT */
	} else if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&subcmds)), int32(unsafe.Sizeof(uintptr(0))), ts+21897, 0, bp+168) != TCL_OK {
		return TCL_ERROR
	}

	switch uint32(*(*int32)(unsafe.Pointer(bp + 168 /* index */))) {
	case uint32(7) /* SELF_OBJECT */ :
		XTcl_SetObjResult(tls, interp, XTclOOObjectName(tls, interp, (*CallContext)(unsafe.Pointer(contextPtr)).FoPtr))
		return TCL_OK
	case uint32(5) /* SELF_NS */ :
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			(*Tcl_Namespace)(unsafe.Pointer((*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).FnamespacePtr)).FfullName, -1))
		return TCL_OK
	case uint32(2) /* SELF_CLASS */ :
		{
			var clsPtr uintptr = (*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr)).FdeclaringClassPtr

			if clsPtr == uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+50414, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+28514, ts+50444, uintptr(0)))
				return TCL_ERROR
			}

			XTcl_SetObjResult(tls, interp, XTclOOObjectName(tls, interp, (*Class)(unsafe.Pointer(clsPtr)).FthisPtr))
			return TCL_OK

		}
	case uint32(4) /* SELF_METHOD */ :
		if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&CONSTRUCTOR != 0 {
			XTcl_SetObjResult(tls, interp, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).FfPtr)).FconstructorName)
		} else if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&DESTRUCTOR != 0 {
			XTcl_SetObjResult(tls, interp, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).FfPtr)).FdestructorName)
		} else {
			XTcl_SetObjResult(tls, interp,
				(*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain+uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr)).FnamePtr)
		}
		return TCL_OK
	case uint32(3) /* SELF_FILTER */ :
		if !((*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain+uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FisFilter != 0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+50462, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+28514, ts+50444, uintptr(0)))
			return TCL_ERROR
		} else {
			var miPtr uintptr = (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24
			var oPtr uintptr
			var type1 uintptr

			if (*MInvoke)(unsafe.Pointer(miPtr)).FfilterDeclarer != uintptr(0) {
				oPtr = (*Class)(unsafe.Pointer((*MInvoke)(unsafe.Pointer(miPtr)).FfilterDeclarer)).FthisPtr
				type1 = ts + 16064 /* "class" */
			} else {
				oPtr = (*CallContext)(unsafe.Pointer(contextPtr)).FoPtr
				type1 = ts + 18716 /* "object" */
			}

			*(*uintptr)(unsafe.Pointer(bp + 176)) = XTclOOObjectName(tls, interp, oPtr)
			*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)) = XTcl_NewStringObj(tls, type1, -1)
			*(*uintptr)(unsafe.Pointer(bp + 176 + 2*8)) = (*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer(miPtr)).FmPtr)).FnamePtr
			XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, 3, bp+176))
			return TCL_OK
		}
		fallthrough
	case uint32(1) /* SELF_CALLER */ :
		if (*CallFrame)(unsafe.Pointer(framePtr)).FcallerVarPtr == uintptr(0) || !((*CallFrame1)(unsafe.Pointer((*CallFrame)(unsafe.Pointer(framePtr)).FcallerVarPtr)).FisProcCallFrame&FRAME_IS_METHOD != 0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+50493, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+104, ts+3593, ts+28514, ts+28517, uintptr(0)))
			return TCL_ERROR
		} else {
			var callerPtr uintptr = (*CallFrame1)(unsafe.Pointer((*CallFrame)(unsafe.Pointer(framePtr)).FcallerVarPtr)).FclientData
			var mPtr uintptr = (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(callerPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(callerPtr)).Findex)*24)).FmPtr
			var declarerPtr uintptr

			if (*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr != uintptr(0) {
				declarerPtr = (*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr)).FthisPtr
			} else if (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr != uintptr(0) {
				declarerPtr = (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr
			} else {
				// This should be unreachable code.

				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+50517, -1))
				return TCL_ERROR
			}

			*(*uintptr)(unsafe.Pointer(bp + 176)) = XTclOOObjectName(tls, interp, declarerPtr)
			*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)) = XTclOOObjectName(tls, interp, (*CallContext)(unsafe.Pointer(callerPtr)).FoPtr)
			if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(callerPtr)).FcallPtr)).Fflags&CONSTRUCTOR != 0 {
				*(*uintptr)(unsafe.Pointer(bp + 176 + 2*8)) = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(declarerPtr)).FfPtr)).FconstructorName
			} else if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(callerPtr)).FcallPtr)).Fflags&DESTRUCTOR != 0 {
				*(*uintptr)(unsafe.Pointer(bp + 176 + 2*8)) = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(declarerPtr)).FfPtr)).FdestructorName
			} else {
				*(*uintptr)(unsafe.Pointer(bp + 176 + 2*8)) = (*Method)(unsafe.Pointer(mPtr)).FnamePtr
			}
			XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, 3, bp+176))
			return TCL_OK
		}
		fallthrough
	case uint32(6) /* SELF_NEXT */ :
		if (*CallContext)(unsafe.Pointer(contextPtr)).Findex < (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain-1 {
			var mPtr uintptr = (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex+1)*24)).FmPtr
			var declarerPtr uintptr

			if (*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr != uintptr(0) {
				declarerPtr = (*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr)).FthisPtr
			} else if (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr != uintptr(0) {
				declarerPtr = (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr
			} else {
				// This should be unreachable code.

				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+50517, -1))
				return TCL_ERROR
			}

			*(*uintptr)(unsafe.Pointer(bp + 176)) = XTclOOObjectName(tls, interp, declarerPtr)
			if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&CONSTRUCTOR != 0 {
				*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)) = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(declarerPtr)).FfPtr)).FconstructorName
			} else if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&DESTRUCTOR != 0 {
				*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)) = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(declarerPtr)).FfPtr)).FdestructorName
			} else {
				*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)) = (*Method)(unsafe.Pointer(mPtr)).FnamePtr
			}
			XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, 2, bp+176))
		}
		return TCL_OK
	case uint32(8) /* SELF_TARGET */ :
		if !((*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain+uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FisFilter != 0) {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
				ts+50462, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+136, ts+3593, ts+28514, ts+50444, uintptr(0)))
			return TCL_ERROR
		} else {
			var mPtr uintptr
			var declarerPtr uintptr
			var i int32

			for i = (*CallContext)(unsafe.Pointer(contextPtr)).Findex; i < (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain; i++ {
				if !((*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain+uintptr(i)*24)).FisFilter != 0) {
					break
				}
			}
			if i == (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain {
				XTcl_Panic(tls, ts+50542, 0)
			}
			mPtr = (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr(i)*24)).FmPtr
			if (*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr != uintptr(0) {
				declarerPtr = (*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr)).FthisPtr
			} else if (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr != uintptr(0) {
				declarerPtr = (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr
			} else {
				// This should be unreachable code.

				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+50517, -1))
				return TCL_ERROR
			}
			*(*uintptr)(unsafe.Pointer(bp + 176)) = XTclOOObjectName(tls, interp, declarerPtr)
			*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)) = (*Method)(unsafe.Pointer(mPtr)).FnamePtr
			XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, 2, bp+176))
			return TCL_OK
		}
		fallthrough
	case uint32(0) /* SELF_CALL */ :
		*(*uintptr)(unsafe.Pointer(bp + 176)) = XTclOORenderCallChain(tls, interp, (*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)))).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)))).Fbytes = uintptr(0)
			*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)) + 32)) = int64((*CallContext)(unsafe.Pointer(contextPtr)).Findex)
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176 + 1*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
			{
			}
		}
		XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, 2, bp+176))
		return TCL_OK
	}
	return TCL_ERROR
}

var subcmds = [10]uintptr{
	ts + 50591, ts + 50596, ts + 16064, ts + 23149, ts + 25917, ts + 18781, ts + 22470,
	ts + 18716, ts + 42059, uintptr(0),
} /* tclOOBasic.c:947:23 */

// ----------------------------------------------------------------------
//
// CopyObjectCmd --
//
//	Implementation of the [oo::copy] command, which clones an object (but
//	not its namespace). Note that no constructors are called during this
//	process.
//
// ----------------------------------------------------------------------

func XTclOOCopyObjectCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOBasic.c:1178:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var oPtr Tcl_Object
	var o2Ptr Tcl_Object

	if objc < 2 || objc > 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv,
			ts+50603)
		return TCL_ERROR
	}

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Create a cloned object of the correct class. Note that constructors are
	// not called. Also note that we must resolve the object name ourselves
	// because we do not want to create the object in the current namespace,
	// but rather in the context of the namespace of the caller of the overall
	// [oo::define] command.

	if objc == 2 {
		o2Ptr = XTcl_CopyObjectInstance(tls, interp, oPtr, uintptr(0), uintptr(0))
	} else {
		var name uintptr
		var namespaceName uintptr

		name = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}()
		if int32(*(*int8)(unsafe.Pointer(name))) == 0 {
			name = uintptr(0)
		}

		// Choose a unique namespace name if the user didn't supply one.

		namespaceName = uintptr(0)
		if objc == 4 {
			namespaceName = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
			}()

			if int32(*(*int8)(unsafe.Pointer(namespaceName))) == 0 {
				namespaceName = uintptr(0)
			} else if XTcl_FindNamespace(tls, interp, namespaceName, uintptr(0),
				0) != uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+50645, libc.VaList(bp, namespaceName)))
				return TCL_ERROR
			}
		}

		o2Ptr = XTcl_CopyObjectInstance(tls, interp, oPtr, name, namespaceName)
	}

	if o2Ptr == uintptr(0) {
		return TCL_ERROR
	}

	// Return the name of the cloned object.

	XTcl_SetObjResult(tls, interp, XTclOOObjectName(tls, interp, o2Ptr))
	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// !END!: Do not edit above this line.

// Alternatives to Tcl_Preserve/Tcl_EventuallyFree/Tcl_Release.

// A convenience macro for iterating through the lists used in the internal
// memory management of objects.
// REQUIRES DECLARATION: int i;

// Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
// sets up the declarations needed for the main macro, FOREACH_HASH, which
// does the actual iteration. FOREACH_HASH_VALUE is a restricted version that
// only iterates over values.

// Convenience macro for duplicating a list. Needs no external declaration,
// but all arguments are used multiple times and so must have no side effects.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Structure containing a CallContext and any other values needed only during
// the construction of the CallContext.

type ChainBuilder = struct {
	FcallChainPtr uintptr
	FfilterLength int32
	F__ccgo_pad1  [4]byte
	FoPtr         uintptr
} /* tclOOCall.c:24:1 */

// Object type used to manage type caches attached to method names.

var methodNameType = Tcl_ObjType{
	Fname:           ts + 50680,
	FfreeIntRepProc: 0,
	FdupIntRepProc:  0,
} /* tclOOCall.c:86:26 */

// ----------------------------------------------------------------------
//
// TclOODeleteContext --
//
//	Destroys a method call-chain context, which should not be in use.
//
// ----------------------------------------------------------------------

func XTclOODeleteContext(tls *libc.TLS, contextPtr uintptr) { /* tclOOCall.c:105:1: */
	var oPtr uintptr = (*CallContext)(unsafe.Pointer(contextPtr)).FoPtr

	XTclOODeleteChain(tls, (*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)
	if oPtr != uintptr(0) {
		XTclStackFree(tls, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).Finterp, contextPtr)

		// Corresponding AddRef() in TclOO.c/TclOOObjectCmdCore

		XTclOODecrRefCount(tls, oPtr)
	}
}

// ----------------------------------------------------------------------
//
// TclOODeleteChainCache --
//
//	Destroy the cache of method call-chains.
//
// ----------------------------------------------------------------------

func XTclOODeleteChainCache(tls *libc.TLS, tablePtr uintptr) { /* tclOOCall.c:133:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var hPtr uintptr
	// var search Tcl_HashSearch at bp, 24

	var callPtr uintptr

	for hPtr = XTcl_FirstHashEntry(tls, tablePtr, bp); func() int32 {
		if hPtr != uintptr(0) {
			return func() int32 { callPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData; return 1 }()
		}
		return 0
	}() != 0; hPtr = XTcl_NextHashEntry(tls, bp) {
		if callPtr != 0 {
			XTclOODeleteChain(tls, callPtr)
		}
	}
	XTcl_DeleteHashTable(tls, tablePtr)
	XTclpFree(tls, tablePtr)
}

// ----------------------------------------------------------------------
//
// TclOODeleteChain --
//
//	Destroys a method call-chain.
//
// ----------------------------------------------------------------------

func XTclOODeleteChain(tls *libc.TLS, callPtr uintptr) { /* tclOOCall.c:159:1: */
	if callPtr == uintptr(0) || libc.PostDecInt32(&(*CallChain)(unsafe.Pointer(callPtr)).FrefCount, 1) > 1 {
		return
	}
	if (*CallChain)(unsafe.Pointer(callPtr)).Fchain != callPtr+32 {
		XTclpFree(tls, (*CallChain)(unsafe.Pointer(callPtr)).Fchain)
	}
	XTclpFree(tls, callPtr)
}

// ----------------------------------------------------------------------
//
// TclOOStashContext --
//
//	Saves a reference to a method call context in a Tcl_Obj's internal
//	representation.
//
// ----------------------------------------------------------------------

func sStashCallChain(tls *libc.TLS, objPtr uintptr, callPtr uintptr) { /* tclOOCall.c:183:1: */
	(*CallChain)(unsafe.Pointer(callPtr)).FrefCount++
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0) {
		XTcl_GetString(tls, objPtr)
	}
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	}

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&methodNameType))
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = callPtr
}

func XTclOOStashContext(tls *libc.TLS, objPtr uintptr, contextPtr uintptr) { /* tclOOCall.c:195:1: */
	sStashCallChain(tls, objPtr, (*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)
}

// ----------------------------------------------------------------------
//
// DupMethodNameRep, FreeMethodNameRep --
//
//	Functions to implement the required parts of the Tcl_Obj guts needed
//	for caching of method contexts in Tcl_Objs.
//
// ----------------------------------------------------------------------

func sDupMethodNameRep(tls *libc.TLS, srcPtr uintptr, dstPtr uintptr) { /* tclOOCall.c:214:1: */
	var callPtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))

	(*Tcl_Obj)(unsafe.Pointer(dstPtr)).FtypePtr = uintptr(unsafe.Pointer(&methodNameType))
	*(*uintptr)(unsafe.Pointer(dstPtr + 32)) = callPtr
	(*CallChain)(unsafe.Pointer(callPtr)).FrefCount++
}

func sFreeMethodNameRep(tls *libc.TLS, objPtr uintptr) { /* tclOOCall.c:226:1: */
	var callPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	XTclOODeleteChain(tls, callPtr)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

// ----------------------------------------------------------------------
//
// TclOOInvokeContext --
//
//	Invokes a single step along a method call-chain context. Note that the
//	invocation of a step along the chain can cause further steps along the
//	chain to be invoked. Note that this function is written to be as light
//	in stack usage as possible.
//
// ----------------------------------------------------------------------

func XTclOOInvokeContext(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOCall.c:249:1: */
	var contextPtr uintptr = clientData
	var mPtr uintptr = (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr
	var isFilter int32 = (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FisFilter

	// If this is the first step along the chain, we preserve the method
	// entries in the chain so that they do not get deleted out from under our
	// feet.

	if (*CallContext)(unsafe.Pointer(contextPtr)).Findex == 0 {
		var i int32

		for i = 0; i < (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain; i++ {
			(*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain+uintptr(i)*24)).FmPtr)).FrefCount++
		}

		// Ensure that the method name itself is part of the arguments when
		// we're doing unknown processing.

		if (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&OO_UNKNOWN_METHOD != 0 {
			(*CallContext)(unsafe.Pointer(contextPtr)).Fskip--
		}

		// Add a callback to ensure that method references are dropped once
		// this call is finished.

		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sFinalizeMethodRefs}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = contextPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	}

	// Save whether we were in a filter and set up whether we are now.

	if (*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).Fflags&FILTER_HANDLING != 0 {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _callbackPtr uintptr
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sSetFilterFlags}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = contextPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	} else {
		for ok6 := true; ok6; ok6 = 0 != 0 {
			var _callbackPtr uintptr
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok8 := true; ok8; ok8 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sResetFilterFlags}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = contextPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	}
	if isFilter != 0 || (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&FILTER_HANDLING != 0 {
		*(*int32)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr + 92)) |= FILTER_HANDLING
	} else {
		*(*int32)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr + 92)) &= libc.CplInt32(FILTER_HANDLING)
	}

	// Run the method implementation.

	return (*struct {
		f func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FcallProc})).f(tls, (*Method)(unsafe.Pointer(mPtr)).FclientData, interp,
		contextPtr, objc, objv)
}

func sSetFilterFlags(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOOCall.c:318:1: */
	var contextPtr uintptr = *(*ClientData)(unsafe.Pointer(data))

	*(*int32)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr + 92)) |= FILTER_HANDLING
	return result
}

func sResetFilterFlags(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOOCall.c:330:1: */
	var contextPtr uintptr = *(*ClientData)(unsafe.Pointer(data))

	*(*int32)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr + 92)) &= libc.CplInt32(FILTER_HANDLING)
	return result
}

func sFinalizeMethodRefs(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOOCall.c:342:1: */
	var contextPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var i int32

	for i = 0; i < (*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).FnumChain; i++ {
		XTclOODelMethodRef(tls, (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain+uintptr(i)*24)).FmPtr)
	}
	return result
}

// ----------------------------------------------------------------------
//
// TclOOGetSortedMethodList, TclOOGetSortedClassMethodList --
//
//	Discovers the list of method names supported by an object or class.
//
// ----------------------------------------------------------------------

func XTclOOGetSortedMethodList(tls *libc.TLS, oPtr uintptr, flags int32, stringsPtr uintptr) int32 { /* tclOOCall.c:367:1: */
	bp := tls.Alloc(208)
	defer tls.Free(208)

	// var names Tcl_HashTable at bp, 88
	// Tcl_Obj* method name to "wanted in list"
	// mapping.
	// var examinedClasses Tcl_HashTable at bp+88, 88

	// Used to track what classes have been looked
	// at. Is set-like in nature and keyed by
	// pointer to class.
	var hPtr uintptr
	// var search Tcl_HashSearch at bp+176, 24

	var i int32
	var mixinPtr uintptr
	var namePtr uintptr
	var mPtr uintptr
	var isWantedIn int32
	var isWanted uintptr

	XTcl_InitObjHashTable(tls, bp)
	XTcl_InitHashTable(tls, bp+88, 1)

	// Name the bits used in the names table values.

	// Process method names due to the object.

	if (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr != 0 {
		for hPtr = XTcl_FirstHashEntry(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, bp+176); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					namePtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+176) {
			// var isNew int32 at bp+200, 4

			if (*Method)(unsafe.Pointer(mPtr)).Fflags&PRIVATE_METHOD != 0 && !(flags&PRIVATE_METHOD != 0) {
				continue
			}
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &names */)).FcreateProc})).f(tls, bp /* &names */, namePtr, bp+200 /* &isNew */)
			if *(*int32)(unsafe.Pointer(bp + 200)) != 0 {
				isWantedIn = func() int32 {
					if !(flags&PUBLIC_METHOD != 0) ||
						(*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD != 0 {
						return 1
					}
					return 0
				}()
				isWantedIn = isWantedIn | func() int32 {
					if (*Method)(unsafe.Pointer(mPtr)).FtypePtr == uintptr(0) {
						return NO_IMPLEMENTATION
					}
					return 0
				}()
				(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(Intptr_t(isWantedIn))
			}
		}
	}

	// Process method names due to private methods on the object's class.

	if flags&PRIVATE_METHOD != 0 {
		for hPtr = XTcl_FirstHashEntry(tls, (*Object)(unsafe.Pointer(oPtr)).FselfCls+112, bp+176); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					namePtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls+112)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls+112)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+176) {
			if (*Method)(unsafe.Pointer(mPtr)).Fflags&PRIVATE_METHOD != 0 {
				// var isNew int32 at bp+204, 4

				hPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &names */)).FcreateProc})).f(tls, bp /* &names */, namePtr, bp+204 /* &isNew */)
				if *(*int32)(unsafe.Pointer(bp + 204)) != 0 {
					isWantedIn = /* IN_LIST */ 1
					if (*Method)(unsafe.Pointer(mPtr)).FtypePtr == uintptr(0) {
						isWantedIn = isWantedIn | NO_IMPLEMENTATION
					}
					(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(Intptr_t(isWantedIn))
				} else if (*Method)(unsafe.Pointer(mPtr)).FtypePtr != uintptr(0) {
					isWantedIn = int32((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
					if isWantedIn&NO_IMPLEMENTATION != 0 {
						isWantedIn = isWantedIn & libc.CplInt32(NO_IMPLEMENTATION)
						(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(Intptr_t(isWantedIn))
					}
				}
			}
		}
	}

	// Process (normal) method names from the class hierarchy and the mixin
	// hierarchy.

	sAddClassMethodNames(tls, (*Object)(unsafe.Pointer(oPtr)).FselfCls, flags, bp, bp+88)
	for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			sAddClassMethodNames(tls, mixinPtr, flags|TRAVERSED_MIXIN, bp,
				bp+88)
		}
	}

	XTcl_DeleteHashTable(tls, bp+88)

	// See how many (visible) method names there are. If none, we do not (and
	// should not) try to sort the list of them.

	i = 0
	if (*Tcl_HashTable)(unsafe.Pointer(bp)).FnumEntries != 0 {
		var strings uintptr

		// We need to build the list of methods to sort. We will be using
		// qsort() for this, because it is very unlikely that the list will be
		// heavily sorted when it is long enough to matter.

		strings = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Tcl_HashTable)(unsafe.Pointer(bp)).FnumEntries)))
		for hPtr = XTcl_FirstHashEntry(tls, bp, bp+176); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					namePtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer(bp)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(bp)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					isWanted = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+176) {
			if !(flags&PUBLIC_METHOD != 0) || int32(isWanted)&1 != 0 {
				if int32(isWanted)&NO_IMPLEMENTATION != 0 {
					continue
				}
				*(*uintptr)(unsafe.Pointer(strings + uintptr(libc.PostIncInt32(&i, 1))*8)) = func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes
					}
					return XTcl_GetString(tls, namePtr)
				}()
			}
		}

		// Note that 'i' may well be less than names.numEntries when we are
		// dealing with public method names.

		if i > 0 {
			if i > 1 {
				libc.Xqsort(tls, strings, uint64(i), uint64(unsafe.Sizeof(uintptr(0))), *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, uintptr, uintptr) int32
				}{sCmpStr})))
			}
			*(*uintptr)(unsafe.Pointer(stringsPtr)) = strings
		} else {
			XTclpFree(tls, strings)
		}
	}

	XTcl_DeleteHashTable(tls, bp)
	return i
}

func XTclOOGetSortedClassMethodList(tls *libc.TLS, clsPtr uintptr, flags int32, stringsPtr uintptr) int32 { /* tclOOCall.c:503:1: */
	bp := tls.Alloc(200)
	defer tls.Free(200)

	// var names Tcl_HashTable at bp, 88
	// Tcl_Obj* method name to "wanted in list"
	// mapping.
	// var examinedClasses Tcl_HashTable at bp+88, 88

	// Used to track what classes have been looked
	// at. Is set-like in nature and keyed by
	// pointer to class.
	var hPtr uintptr
	// var search Tcl_HashSearch at bp+176, 24

	var i int32
	var namePtr uintptr
	var isWanted uintptr

	XTcl_InitObjHashTable(tls, bp)
	XTcl_InitHashTable(tls, bp+88, 1)

	// Process method names from the class hierarchy and the mixin hierarchy.

	sAddClassMethodNames(tls, clsPtr, flags, bp, bp+88)
	XTcl_DeleteHashTable(tls, bp+88)

	// See how many (visible) method names there are. If none, we do not (and
	// should not) try to sort the list of them.

	i = 0
	if (*Tcl_HashTable)(unsafe.Pointer(bp)).FnumEntries != 0 {
		var strings uintptr

		// We need to build the list of methods to sort. We will be using
		// qsort() for this, because it is very unlikely that the list will be
		// heavily sorted when it is long enough to matter.

		strings = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Tcl_HashTable)(unsafe.Pointer(bp)).FnumEntries)))
		for hPtr = XTcl_FirstHashEntry(tls, bp, bp+176); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					namePtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer(bp)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(bp)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					isWanted = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+176) {
			if !(flags&PUBLIC_METHOD != 0) || int32(isWanted)&1 != 0 {
				if int32(isWanted)&NO_IMPLEMENTATION != 0 {
					continue
				}
				*(*uintptr)(unsafe.Pointer(strings + uintptr(libc.PostIncInt32(&i, 1))*8)) = func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes
					}
					return XTcl_GetString(tls, namePtr)
				}()
			}
		}

		// Note that 'i' may well be less than names.numEntries when we are
		// dealing with public method names.

		if i > 0 {
			if i > 1 {
				libc.Xqsort(tls, strings, uint64(i), uint64(unsafe.Sizeof(uintptr(0))), *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, uintptr, uintptr) int32
				}{sCmpStr})))
			}
			*(*uintptr)(unsafe.Pointer(stringsPtr)) = strings
		} else {
			XTclpFree(tls, strings)
		}
	}

	XTcl_DeleteHashTable(tls, bp)
	return i
}

// Comparator for GetSortedMethodList

func sCmpStr(tls *libc.TLS, ptr1 uintptr, ptr2 uintptr) int32 { /* tclOOCall.c:580:1: */
	var strPtr1 uintptr = ptr1
	var strPtr2 uintptr = ptr2

	return XTclpUtfNcmp2(tls, *(*uintptr)(unsafe.Pointer(strPtr1)), *(*uintptr)(unsafe.Pointer(strPtr2)), libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(strPtr1)))+uint64(1))
}

// ----------------------------------------------------------------------
//
// AddClassMethodNames --
//
//	Adds the method names defined by a class (or its superclasses) to the
//	collection being built. The collection is built in a hash table to
//	ensure that duplicates are excluded. Helper for GetSortedMethodList().
//
// ----------------------------------------------------------------------

func sAddClassMethodNames(tls *libc.TLS, clsPtr uintptr, flags int32, namesPtr uintptr, examinedClassesPtr uintptr) { /* tclOOCall.c:603:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// If we've already started looking at this class, stop working on it now
	// to prevent repeated work.

	if (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(examinedClassesPtr)).FfindProc})).f(tls, examinedClassesPtr, clsPtr) != 0 {
		return
	}

	// Scope all declarations so that the compiler can stand a good chance of
	// making the recursive step highly efficient. We also hand-implement the
	// tail-recursive case using a while loop; C compilers typically cannot do
	// tail-recursion optimization usefully.

	for 1 != 0 {
		var hPtr uintptr
		// var search Tcl_HashSearch at bp+8, 24

		var namePtr uintptr
		var mPtr uintptr
		// var isNew int32 at bp, 4

		(*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(examinedClassesPtr)).FcreateProc})).f(tls, examinedClassesPtr, clsPtr, bp /* &isNew */)
		if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
			break
		}

		if (*Class)(unsafe.Pointer(clsPtr)).Fmixins.Fnum != 0 {
			var mixinPtr uintptr
			var i int32

			for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Fmixins.Fnum; i++ {
				if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
					continue
				} else if func() bool {
					mixinPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist + uintptr(i)*8))
					return 1 != 0
				}() {
					if mixinPtr != clsPtr {
						sAddClassMethodNames(tls, mixinPtr, flags|TRAVERSED_MIXIN,
							namesPtr, examinedClassesPtr)
					}
				}
			}
		}

		for hPtr = XTcl_FirstHashEntry(tls, clsPtr+112, bp+8); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					namePtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer(clsPtr+112)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(clsPtr+112)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+8) {
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(namesPtr)).FcreateProc})).f(tls, namesPtr, namePtr, bp /* &isNew */)
			if *(*int32)(unsafe.Pointer(bp)) != 0 {
				var isWanted int32
				if !(flags&PUBLIC_METHOD != 0) ||
					(*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD != 0 {
					isWanted = /* IN_LIST */ 1
				} else {
					isWanted = 0
				}

				isWanted = isWanted | func() int32 {
					if (*Method)(unsafe.Pointer(mPtr)).FtypePtr == uintptr(0) {
						return NO_IMPLEMENTATION
					}
					return 0
				}()
				(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(Intptr_t(isWanted))
			} else if int32((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)&NO_IMPLEMENTATION != 0 &&
				(*Method)(unsafe.Pointer(mPtr)).FtypePtr != uintptr(0) {
				var isWanted int32 = int32((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)

				isWanted = isWanted & libc.CplInt32(NO_IMPLEMENTATION)
				(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(Intptr_t(isWanted))
			}
		}

		if (*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum != 1 {
			break
		}
		clsPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist))
	}
	if (*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum != 0 {
		var superPtr uintptr
		var i int32

		for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				superPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				sAddClassMethodNames(tls, superPtr, flags, namesPtr,
					examinedClassesPtr)
			}
		}
	}
}

// ----------------------------------------------------------------------
//
// AddSimpleChainToCallContext --
//
//	The core of the call-chain construction engine, this handles calling a
//	particular method on a particular object. Note that filters and
//	unknown handling are already handled by the logic that uses this
//	function.
//
// ----------------------------------------------------------------------

func sAddSimpleChainToCallContext(tls *libc.TLS, oPtr uintptr, methodNameObj uintptr, cbPtr uintptr, doneFilters uintptr, flags int32, filterDecl uintptr) { /* tclOOCall.c:707:1: */
	var i int32

	if !(flags&(DEFINITE_PROTECTED|DEFINITE_PUBLIC|(CONSTRUCTOR|DESTRUCTOR|FORCE_UNKNOWN)) != 0) && (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr != 0 {
		var hPtr uintptr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, methodNameObj)

		if hPtr != uintptr(0) {
			var mPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

			if flags&PUBLIC_METHOD != 0 {
				if !((*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD != 0) {
					return
				} else {
					flags = flags | DEFINITE_PUBLIC
				}
			} else {
				flags = flags | DEFINITE_PROTECTED
			}
		}
	}
	if !(flags&(CONSTRUCTOR|DESTRUCTOR|FORCE_UNKNOWN) != 0) {
		var hPtr uintptr
		var mixinPtr uintptr

		for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				sAddSimpleClassChainToCallContext(tls, mixinPtr, methodNameObj, cbPtr,
					doneFilters, flags|TRAVERSED_MIXIN, filterDecl)
			}
		}
		if (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr != 0 {
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, methodNameObj)
			if hPtr != uintptr(0) {
				sAddMethodToCallChain(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData, cbPtr,
					doneFilters, filterDecl, flags)
			}
		}
	}
	sAddSimpleClassChainToCallContext(tls, (*Object)(unsafe.Pointer(oPtr)).FselfCls, methodNameObj, cbPtr,
		doneFilters, flags, filterDecl)
}

// ----------------------------------------------------------------------
//
// AddMethodToCallChain --
//
//	Utility method that manages the adding of a particular method
//	implementation to a call-chain.
//
// ----------------------------------------------------------------------

func sAddMethodToCallChain(tls *libc.TLS, mPtr uintptr, cbPtr uintptr, doneFilters uintptr, filterDecl uintptr, flags int32) { /* tclOOCall.c:774:1: */
	var callPtr uintptr = (*ChainBuilder)(unsafe.Pointer(cbPtr)).FcallChainPtr
	var i int32

	// Return if this is just an entry used to record whether this is a public
	// method. If so, there's nothing real to call and so nothing to add to
	// the call chain.
	//
	// This is also where we enforce mixin-consistency.

	if mPtr == uintptr(0) || (*Method)(unsafe.Pointer(mPtr)).FtypePtr == uintptr(0) || !(flags&OBJECT_MIXIN != 0 || libc.BoolInt32(!(flags&BUILDING_MIXINS != 0)) == libc.BoolInt32(!(flags&TRAVERSED_MIXIN != 0))) {
		return
	}

	// Enforce real private method handling here. We will skip adding this
	// method IF
	//  1) we are not allowing private methods, AND
	//  2) this is a private method, AND
	//  3) this is a class method, AND
	//  4) this method was not declared by the class of the current object.
	//
	// This does mean that only classes really handle private methods. This
	// should be sufficient for [incr Tcl] support though.

	if !((*CallChain)(unsafe.Pointer(callPtr)).Fflags&PRIVATE_METHOD != 0) &&
		(*Method)(unsafe.Pointer(mPtr)).Fflags&PRIVATE_METHOD != 0 &&
		(*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr != uintptr(0) &&
		(*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr != (*Object)(unsafe.Pointer((*ChainBuilder)(unsafe.Pointer(cbPtr)).FoPtr)).FselfCls {
		return
	}

	// First test whether the method is already in the call chain. Skip over
	// any leading filters.

	for i = (*ChainBuilder)(unsafe.Pointer(cbPtr)).FfilterLength; i < (*CallChain)(unsafe.Pointer(callPtr)).FnumChain; i++ {
		if (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer(callPtr)).Fchain+uintptr(i)*24)).FmPtr == mPtr && (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer(callPtr)).Fchain+uintptr(i)*24)).FisFilter == libc.Bool32(doneFilters != uintptr(0)) {
			// Call chain semantics states that methods come as *late* in the
			// call chain as possible. This is done by copying down the
			// following methods. Note that this does not change the number of
			// method invocations in the call chain; it just rearranges them.

			var declCls uintptr = (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer(callPtr)).Fchain + uintptr(i)*24)).FfilterDeclarer

			for ; i+1 < (*CallChain)(unsafe.Pointer(callPtr)).FnumChain; i++ {
				*(*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer(callPtr)).Fchain + uintptr(i)*24)) = *(*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer(callPtr)).Fchain + uintptr(i+1)*24))
			}
			(*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer(callPtr)).Fchain + uintptr(i)*24)).FmPtr = mPtr
			(*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer(callPtr)).Fchain + uintptr(i)*24)).FisFilter = libc.Bool32(doneFilters != uintptr(0))
			(*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer(callPtr)).Fchain + uintptr(i)*24)).FfilterDeclarer = declCls
			return
		}
	}

	// Need to really add the method. This is made a bit more complex by the
	// fact that we are using some "static" space initially, and only start
	// realloc-ing if the chain gets long.

	if (*CallChain)(unsafe.Pointer(callPtr)).FnumChain == CALL_CHAIN_STATIC_SIZE {
		(*CallChain)(unsafe.Pointer(callPtr)).Fchain = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(MInvoke{}))*uint64((*CallChain)(unsafe.Pointer(callPtr)).FnumChain+1)))
		libc.Xmemcpy(tls, (*CallChain)(unsafe.Pointer(callPtr)).Fchain, callPtr+32,
			uint64(unsafe.Sizeof(MInvoke{}))*uint64((*CallChain)(unsafe.Pointer(callPtr)).FnumChain))
	} else if (*CallChain)(unsafe.Pointer(callPtr)).FnumChain > CALL_CHAIN_STATIC_SIZE {
		(*CallChain)(unsafe.Pointer(callPtr)).Fchain = XTcl_Realloc(tls, (*CallChain)(unsafe.Pointer(callPtr)).Fchain, uint32(uint64(unsafe.Sizeof(MInvoke{}))*uint64((*CallChain)(unsafe.Pointer(callPtr)).FnumChain+1)))
	}
	(*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer(callPtr)).Fchain + uintptr(i)*24)).FmPtr = mPtr
	(*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer(callPtr)).Fchain + uintptr(i)*24)).FisFilter = libc.Bool32(doneFilters != uintptr(0))
	(*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer(callPtr)).Fchain + uintptr(i)*24)).FfilterDeclarer = filterDecl
	(*CallChain)(unsafe.Pointer(callPtr)).FnumChain++
}

// ----------------------------------------------------------------------
//
// InitCallChain --
//	Encoding of the policy of how to set up a call chain. Doesn't populate
//	the chain with the method implementation data.
//
// ----------------------------------------------------------------------

func sInitCallChain(tls *libc.TLS, callPtr uintptr, oPtr uintptr, flags int32) { /* tclOOCall.c:888:1: */
	(*CallChain)(unsafe.Pointer(callPtr)).Fflags = flags & (PUBLIC_METHOD | PRIVATE_METHOD | (CONSTRUCTOR | DESTRUCTOR | FORCE_UNKNOWN) | FILTER_HANDLING)
	if (*Object)(unsafe.Pointer(oPtr)).Fflags&USE_CLASS_CACHE != 0 {
		oPtr = (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FthisPtr
		*(*int32)(unsafe.Pointer(callPtr + 12)) |= USE_CLASS_CACHE
	}
	(*CallChain)(unsafe.Pointer(callPtr)).Fepoch = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).Fepoch
	(*CallChain)(unsafe.Pointer(callPtr)).FobjectCreationEpoch = (*Object)(unsafe.Pointer(oPtr)).FcreationEpoch
	(*CallChain)(unsafe.Pointer(callPtr)).FobjectEpoch = (*Object)(unsafe.Pointer(oPtr)).Fepoch
	(*CallChain)(unsafe.Pointer(callPtr)).FrefCount = 1
	(*CallChain)(unsafe.Pointer(callPtr)).FnumChain = 0
	(*CallChain)(unsafe.Pointer(callPtr)).Fchain = callPtr + 32 /* &.staticChain */
}

// ----------------------------------------------------------------------
//
// IsStillValid --
//	Calculates whether the given call chain can be used for executing a
//	method for the given object. The condition on a chain from a cached
//	location being reusable is:
//	- Refers to the same object (same creation epoch), and
//	- Still across the same class structure (same global epoch), and
//	- Still across the same object strucutre (same local epoch), and
//	- No public/private/filter magic leakage (same flags, modulo the fact
//	  that a public chain will satisfy a non-public call).
//
// ----------------------------------------------------------------------

func sIsStillValid(tls *libc.TLS, callPtr uintptr, oPtr uintptr, flags int32, mask int32) int32 { /* tclOOCall.c:924:1: */
	if (*Object)(unsafe.Pointer(oPtr)).Fflags&USE_CLASS_CACHE != 0 {
		oPtr = (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FthisPtr
		flags = flags | USE_CLASS_CACHE
	}
	return libc.Bool32((*CallChain)(unsafe.Pointer(callPtr)).FobjectCreationEpoch == (*Object)(unsafe.Pointer(oPtr)).FcreationEpoch &&
		(*CallChain)(unsafe.Pointer(callPtr)).Fepoch == (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).Fepoch &&
		(*CallChain)(unsafe.Pointer(callPtr)).FobjectEpoch == (*Object)(unsafe.Pointer(oPtr)).Fepoch &&
		(*CallChain)(unsafe.Pointer(callPtr)).Fflags&mask == flags&mask)
}

// ----------------------------------------------------------------------
//
// TclOOGetCallContext --
//
//	Responsible for constructing the call context, an ordered list of all
//	method implementations to be called as part of a method invocation.
//	This method is central to the whole operation of the OO system.
//
// ----------------------------------------------------------------------

func XTclOOGetCallContext(tls *libc.TLS, oPtr uintptr, methodNameObj uintptr, flags int32, cacheInThisObj uintptr) uintptr { /* tclOOCall.c:952:13: */
	bp := tls.Alloc(116)
	defer tls.Free(116)

	var contextPtr uintptr
	var callPtr uintptr
	// var cb ChainBuilder at bp, 24

	// var i int32 at bp+112, 4

	var count int32
	var doFilters int32
	var hPtr uintptr
	// var doneFilters Tcl_HashTable at bp+24, 88

	// Check if we can get the chain out of the Tcl_Obj method name or out
	// of the cache. This is made a bit more complex by the fact that
	// there are multiple different layers of cache (in the Tcl_Obj, in
	// the object, and in the class).

	var reuseMask int32
	var filterObj uintptr
	var mixinPtr uintptr

	if !(cacheInThisObj == uintptr(0)) {
		goto __1
	}
	cacheInThisObj = methodNameObj
__1:
	;
	if !(flags&(CONSTRUCTOR|DESTRUCTOR|FORCE_UNKNOWN|FILTER_HANDLING) != 0 || (*Object)(unsafe.Pointer(oPtr)).Fflags&FILTER_HANDLING != 0) {
		goto __2
	}
	hPtr = uintptr(0)
	doFilters = 0

	// Check if we have a cached valid constructor or destructor.

	if !(flags&CONSTRUCTOR != 0) {
		goto __4
	}
	callPtr = (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FconstructorChainPtr
	if !(callPtr != uintptr(0) &&
		(*CallChain)(unsafe.Pointer(callPtr)).FobjectEpoch == (*Object)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FthisPtr)).Fepoch &&
		(*CallChain)(unsafe.Pointer(callPtr)).Fepoch == (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).Fepoch) {
		goto __6
	}
	(*CallChain)(unsafe.Pointer(callPtr)).FrefCount++
	goto returnContext
__6:
	;
	goto __5
__4:
	if !(flags&DESTRUCTOR != 0) {
		goto __7
	}
	callPtr = (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FdestructorChainPtr
	if !((*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum == 0 && callPtr != uintptr(0) &&
		(*CallChain)(unsafe.Pointer(callPtr)).FobjectEpoch == (*Object)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FthisPtr)).Fepoch &&
		(*CallChain)(unsafe.Pointer(callPtr)).Fepoch == (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).Fepoch) {
		goto __8
	}
	(*CallChain)(unsafe.Pointer(callPtr)).FrefCount++
	goto returnContext
__8:
	;
__7:
	;
__5:
	;
	goto __3
__2:
	// Check if we can get the chain out of the Tcl_Obj method name or out
	// of the cache. This is made a bit more complex by the fact that
	// there are multiple different layers of cache (in the Tcl_Obj, in
	// the object, and in the class).

	reuseMask = func() int32 {
		if flags&PUBLIC_METHOD != 0 {
			return libc.CplInt32(0)
		}
		return libc.CplInt32(PUBLIC_METHOD)
	}()

	if !((*Tcl_Obj)(unsafe.Pointer(cacheInThisObj)).FtypePtr == uintptr(unsafe.Pointer(&methodNameType))) {
		goto __9
	}
	callPtr = *(*uintptr)(unsafe.Pointer(cacheInThisObj + 32))
	if !(sIsStillValid(tls, callPtr, oPtr, flags, reuseMask) != 0) {
		goto __10
	}
	(*CallChain)(unsafe.Pointer(callPtr)).FrefCount++
	goto returnContext
__10:
	;
	sFreeMethodNameRep(tls, cacheInThisObj)
__9:
	;

	if !((*Object)(unsafe.Pointer(oPtr)).Fflags&USE_CLASS_CACHE != 0) {
		goto __11
	}
	if !((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FclassChainCache != uintptr(0)) {
		goto __13
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FclassChainCache)).FfindProc})).f(tls, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FclassChainCache, methodNameObj)
	goto __14
__13:
	hPtr = uintptr(0)
__14:
	;
	goto __12
__11:
	if !((*Object)(unsafe.Pointer(oPtr)).FchainCache != uintptr(0)) {
		goto __15
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FchainCache)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FchainCache, methodNameObj)
	goto __16
__15:
	hPtr = uintptr(0)
__16:
	;
__12:
	;

	if !(hPtr != uintptr(0) && (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData != uintptr(0)) {
		goto __17
	}
	callPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !(sIsStillValid(tls, callPtr, oPtr, flags, reuseMask) != 0) {
		goto __18
	}
	(*CallChain)(unsafe.Pointer(callPtr)).FrefCount++
	goto returnContext
__18:
	;
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(0)
	XTclOODeleteChain(tls, callPtr)
__17:
	;

	doFilters = 1
__3:
	;

	callPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CallChain{})))
	sInitCallChain(tls, callPtr, oPtr, flags)

	(*ChainBuilder)(unsafe.Pointer(bp /* &cb */)).FcallChainPtr = callPtr
	(*ChainBuilder)(unsafe.Pointer(bp /* &cb */)).FfilterLength = 0
	(*ChainBuilder)(unsafe.Pointer(bp /* &cb */)).FoPtr = oPtr

	// If we're working with a forced use of unknown, do that now.

	if !(flags&FORCE_UNKNOWN != 0) {
		goto __19
	}
	sAddSimpleChainToCallContext(tls, oPtr, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).FunknownMethodNameObj,
		bp, uintptr(0), BUILDING_MIXINS, uintptr(0))
	sAddSimpleChainToCallContext(tls, oPtr, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).FunknownMethodNameObj,
		bp, uintptr(0), 0, uintptr(0))
	*(*int32)(unsafe.Pointer(callPtr + 12)) |= OO_UNKNOWN_METHOD
	(*CallChain)(unsafe.Pointer(callPtr)).Fepoch = -1
	if !((*CallChain)(unsafe.Pointer(callPtr)).FnumChain == 0) {
		goto __20
	}
	XTclOODeleteChain(tls, callPtr)
	return uintptr(0)
__20:
	;
	goto returnContext
__19:
	;

	// Add all defined filters (if any, and if we're going to be processing
	// them; they're not processed for constructors, destructors or when we're
	// in the middle of processing a filter).

	if !(doFilters != 0) {
		goto __21
	}

	doFilters = 1
	XTcl_InitObjHashTable(tls, bp+24)
	*(*int32)(unsafe.Pointer(bp + 112 /* i */)) = 0
__22:
	if !(*(*int32)(unsafe.Pointer(bp + 112)) < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum) {
		goto __24
	}
	if !(*(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(*(*int32)(unsafe.Pointer(bp + 112)))*8)) == uintptr(0)) {
		goto __25
	}
	goto __23
	goto __26
__25:
	if !func() bool {
		mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(*(*int32)(unsafe.Pointer(bp + 112)))*8))
		return 1 != 0
	}() {
		goto __27
	}
	sAddClassFiltersToCallContext(tls, oPtr, mixinPtr, bp, bp+24,
		TRAVERSED_MIXIN|BUILDING_MIXINS|OBJECT_MIXIN)
	sAddClassFiltersToCallContext(tls, oPtr, mixinPtr, bp, bp+24,
		OBJECT_MIXIN)
__27:
	;
__26:
	;
	goto __23
__23:
	*(*int32)(unsafe.Pointer(bp + 112 /* i */))++
	goto __22
	goto __24
__24:
	;
	*(*int32)(unsafe.Pointer(bp + 112 /* i */)) = 0
__28:
	if !(*(*int32)(unsafe.Pointer(bp + 112)) < (*Object)(unsafe.Pointer(oPtr)).Ffilters.Fnum) {
		goto __30
	}
	if !(*(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist + uintptr(*(*int32)(unsafe.Pointer(bp + 112)))*8)) == uintptr(0)) {
		goto __31
	}
	goto __29
	goto __32
__31:
	if !func() bool {
		filterObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist + uintptr(*(*int32)(unsafe.Pointer(bp + 112)))*8))
		return 1 != 0
	}() {
		goto __33
	}
	sAddSimpleChainToCallContext(tls, oPtr, filterObj, bp, bp+24,
		BUILDING_MIXINS, uintptr(0))
	sAddSimpleChainToCallContext(tls, oPtr, filterObj, bp, bp+24, 0,
		uintptr(0))
__33:
	;
__32:
	;
	goto __29
__29:
	*(*int32)(unsafe.Pointer(bp + 112 /* i */))++
	goto __28
	goto __30
__30:
	;
	sAddClassFiltersToCallContext(tls, oPtr, (*Object)(unsafe.Pointer(oPtr)).FselfCls, bp, bp+24,
		BUILDING_MIXINS)
	sAddClassFiltersToCallContext(tls, oPtr, (*Object)(unsafe.Pointer(oPtr)).FselfCls, bp, bp+24,
		0)
	XTcl_DeleteHashTable(tls, bp+24)
__21:
	;
	count = libc.AssignPtrInt32(bp+8, (*CallChain)(unsafe.Pointer(callPtr)).FnumChain)

	// Add the actual method implementations. We have to do this twice to
	// handle class mixins right.

	sAddSimpleChainToCallContext(tls, oPtr, methodNameObj, bp, uintptr(0),
		flags|BUILDING_MIXINS, uintptr(0))
	sAddSimpleChainToCallContext(tls, oPtr, methodNameObj, bp, uintptr(0), flags, uintptr(0))

	// Check to see if the method has no implementation. If so, we probably
	// need to add in a call to the unknown method. Otherwise, set up the
	// cacheing of the method implementation (if relevant).

	if !(count == (*CallChain)(unsafe.Pointer(callPtr)).FnumChain) {
		goto __34
	}
	// Method does not actually exist. If we're dealing with constructors
	// or destructors, this isn't a problem.

	if !(flags&(CONSTRUCTOR|DESTRUCTOR|FORCE_UNKNOWN) != 0) {
		goto __36
	}
	XTclOODeleteChain(tls, callPtr)
	return uintptr(0)
__36:
	;
	sAddSimpleChainToCallContext(tls, oPtr, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).FunknownMethodNameObj,
		bp, uintptr(0), BUILDING_MIXINS, uintptr(0))
	sAddSimpleChainToCallContext(tls, oPtr, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).FunknownMethodNameObj,
		bp, uintptr(0), 0, uintptr(0))
	*(*int32)(unsafe.Pointer(callPtr + 12)) |= OO_UNKNOWN_METHOD
	(*CallChain)(unsafe.Pointer(callPtr)).Fepoch = -1
	if !(count == (*CallChain)(unsafe.Pointer(callPtr)).FnumChain) {
		goto __37
	}
	XTclOODeleteChain(tls, callPtr)
	return uintptr(0)
__37:
	;
	goto __35
__34:
	if !(doFilters != 0) {
		goto __38
	}
	if !(hPtr == uintptr(0)) {
		goto __40
	}
	if !((*Object)(unsafe.Pointer(oPtr)).Fflags&USE_CLASS_CACHE != 0) {
		goto __41
	}
	if !((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FclassChainCache == uintptr(0)) {
		goto __43
	}
	(*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FclassChainCache = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))

	XTcl_InitObjHashTable(tls, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FclassChainCache)
__43:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FclassChainCache)).FcreateProc})).f(tls, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FclassChainCache, methodNameObj, bp+112 /* &i */)
	goto __42
__41:
	if !((*Object)(unsafe.Pointer(oPtr)).FchainCache == uintptr(0)) {
		goto __44
	}
	(*Object)(unsafe.Pointer(oPtr)).FchainCache = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))

	XTcl_InitObjHashTable(tls, (*Object)(unsafe.Pointer(oPtr)).FchainCache)
__44:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FchainCache)).FcreateProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FchainCache, methodNameObj, bp+112 /* &i */)
__42:
	;
__40:
	;
	(*CallChain)(unsafe.Pointer(callPtr)).FrefCount++
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = callPtr
	sStashCallChain(tls, cacheInThisObj, callPtr)
	goto __39
__38:
	if !(flags&CONSTRUCTOR != 0) {
		goto __45
	}
	if !((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FconstructorChainPtr != 0) {
		goto __47
	}
	XTclOODeleteChain(tls, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FconstructorChainPtr)
__47:
	;
	(*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FconstructorChainPtr = callPtr
	(*CallChain)(unsafe.Pointer(callPtr)).FrefCount++
	goto __46
__45:
	if !(flags&DESTRUCTOR != 0 && (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum == 0) {
		goto __48
	}
	if !((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FdestructorChainPtr != 0) {
		goto __49
	}
	XTclOODeleteChain(tls, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FdestructorChainPtr)
__49:
	;
	(*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FdestructorChainPtr = callPtr
	(*CallChain)(unsafe.Pointer(callPtr)).FrefCount++
__48:
	;
__46:
	;
__39:
	;
__35:
	;

returnContext:
	contextPtr = XTclStackAlloc(tls, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).Finterp, int32(unsafe.Sizeof(CallContext{})))
	(*CallContext)(unsafe.Pointer(contextPtr)).FoPtr = oPtr

	// Corresponding TclOODecrRefCount() in TclOODeleteContext

	(*Object)(unsafe.Pointer(oPtr)).FrefCount++
	(*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr = callPtr
	(*CallContext)(unsafe.Pointer(contextPtr)).Fskip = 2
	(*CallContext)(unsafe.Pointer(contextPtr)).Findex = 0
	return contextPtr
}

// ----------------------------------------------------------------------
//
// TclOOGetStereotypeCallChain --
//
//	Construct a call-chain for a method that would be used by a
//	stereotypical instance of the given class (i.e., where the object has
//	no definitions special to itself).
//
// ----------------------------------------------------------------------

func XTclOOGetStereotypeCallChain(tls *libc.TLS, clsPtr uintptr, methodNameObj uintptr, flags int32) uintptr { /* tclOOCall.c:1206:11: */
	bp := tls.Alloc(268)
	defer tls.Free(268)

	var callPtr uintptr
	// var cb ChainBuilder at bp+240, 24

	// var i int32 at bp+264, 4

	var count int32
	var fPtr uintptr = (*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FthisPtr)).FfPtr
	var hPtr uintptr
	// var doneFilters Tcl_HashTable at bp+152, 88

	// var obj Object at bp, 152

	// Synthesize a temporary stereotypical object so that we can use existing
	// machinery to produce the stereotypical call chain.

	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Object{})))
	(*Object)(unsafe.Pointer(bp /* &obj */)).FfPtr = fPtr
	(*Object)(unsafe.Pointer(bp /* &obj */)).FselfCls = clsPtr
	(*Object)(unsafe.Pointer(bp /* &obj */)).FrefCount = 1
	(*Object)(unsafe.Pointer(bp /* &obj */)).Fflags = USE_CLASS_CACHE

	// Check if we can get the chain out of the Tcl_Obj method name or out of
	// the cache. This is made a bit more complex by the fact that there are
	// multiple different layers of cache (in the Tcl_Obj, in the object, and
	// in the class).

	if (*Class)(unsafe.Pointer(clsPtr)).FclassChainCache != uintptr(0) {
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FclassChainCache)).FfindProc})).f(tls, (*Class)(unsafe.Pointer(clsPtr)).FclassChainCache, methodNameObj)
		if hPtr != uintptr(0) && (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData != uintptr(0) {
			var reuseMask int32 = func() int32 {
				if flags&PUBLIC_METHOD != 0 {
					return libc.CplInt32(0)
				}
				return libc.CplInt32(PUBLIC_METHOD)
			}()

			callPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
			if sIsStillValid(tls, callPtr, bp, flags, reuseMask) != 0 {
				(*CallChain)(unsafe.Pointer(callPtr)).FrefCount++
				return callPtr
			}
			(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(0)
			XTclOODeleteChain(tls, callPtr)
		}
	} else {
		hPtr = uintptr(0)
	}

	callPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CallChain{})))
	libc.Xmemset(tls, callPtr, 0, uint64(unsafe.Sizeof(CallChain{})))
	(*CallChain)(unsafe.Pointer(callPtr)).Fflags = flags & (PUBLIC_METHOD | PRIVATE_METHOD | FILTER_HANDLING)
	(*CallChain)(unsafe.Pointer(callPtr)).Fepoch = (*Foundation)(unsafe.Pointer(fPtr)).Fepoch
	(*CallChain)(unsafe.Pointer(callPtr)).FobjectCreationEpoch = (*ThreadLocalData)(unsafe.Pointer((*Foundation)(unsafe.Pointer(fPtr)).FtsdPtr)).FnsCount
	(*CallChain)(unsafe.Pointer(callPtr)).FobjectEpoch = (*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FthisPtr)).Fepoch
	(*CallChain)(unsafe.Pointer(callPtr)).FrefCount = 1
	(*CallChain)(unsafe.Pointer(callPtr)).Fchain = callPtr + 32 /* &.staticChain */

	(*ChainBuilder)(unsafe.Pointer(bp + 240 /* &cb */)).FcallChainPtr = callPtr
	(*ChainBuilder)(unsafe.Pointer(bp + 240 /* &cb */)).FfilterLength = 0
	(*ChainBuilder)(unsafe.Pointer(bp + 240 /* &cb */)).FoPtr = bp /* &obj */

	// Add all defined filters (if any, and if we're going to be processing
	// them; they're not processed for constructors, destructors or when we're
	// in the middle of processing a filter).

	XTcl_InitObjHashTable(tls, bp+152)
	sAddClassFiltersToCallContext(tls, bp, clsPtr, bp+240, bp+152,
		BUILDING_MIXINS)
	sAddClassFiltersToCallContext(tls, bp, clsPtr, bp+240, bp+152, 0)
	XTcl_DeleteHashTable(tls, bp+152)
	count = libc.AssignPtrInt32(bp+240+8, (*CallChain)(unsafe.Pointer(callPtr)).FnumChain)

	// Add the actual method implementations.

	sAddSimpleChainToCallContext(tls, bp, methodNameObj, bp+240, uintptr(0),
		flags|BUILDING_MIXINS, uintptr(0))
	sAddSimpleChainToCallContext(tls, bp, methodNameObj, bp+240, uintptr(0), flags, uintptr(0))

	// Check to see if the method has no implementation. If so, we probably
	// need to add in a call to the unknown method. Otherwise, set up the
	// cacheing of the method implementation (if relevant).

	if count == (*CallChain)(unsafe.Pointer(callPtr)).FnumChain {
		sAddSimpleChainToCallContext(tls, bp, (*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj, bp+240,
			uintptr(0), BUILDING_MIXINS, uintptr(0))
		sAddSimpleChainToCallContext(tls, bp, (*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj, bp+240,
			uintptr(0), 0, uintptr(0))
		*(*int32)(unsafe.Pointer(callPtr + 12)) |= OO_UNKNOWN_METHOD
		(*CallChain)(unsafe.Pointer(callPtr)).Fepoch = -1
		if count == (*CallChain)(unsafe.Pointer(callPtr)).FnumChain {
			XTclOODeleteChain(tls, callPtr)
			return uintptr(0)
		}
	} else {
		if hPtr == uintptr(0) {
			if (*Class)(unsafe.Pointer(clsPtr)).FclassChainCache == uintptr(0) {
				(*Class)(unsafe.Pointer(clsPtr)).FclassChainCache = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
				XTcl_InitObjHashTable(tls, (*Class)(unsafe.Pointer(clsPtr)).FclassChainCache)
			}
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FclassChainCache)).FcreateProc})).f(tls, (*Class)(unsafe.Pointer(clsPtr)).FclassChainCache, methodNameObj, bp+264 /* &i */)
		}
		(*CallChain)(unsafe.Pointer(callPtr)).FrefCount++
		(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = callPtr
		sStashCallChain(tls, methodNameObj, callPtr)
	}
	return callPtr
}

// ----------------------------------------------------------------------
//
// AddClassFiltersToCallContext --
//
//	Logic to make extracting all the filters from the class context much
//	easier.
//
// ----------------------------------------------------------------------

func sAddClassFiltersToCallContext(tls *libc.TLS, oPtr uintptr, clsPtr uintptr, cbPtr uintptr, doneFilters uintptr, flags int32) { /* tclOOCall.c:1341:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var i int32
	var clearedFlags int32
	var superPtr uintptr
	var mixinPtr uintptr
	var filterObj uintptr
	// var isNew int32 at bp, 4
	clearedFlags =
		flags & libc.CplInt32(TRAVERSED_MIXIN|OBJECT_MIXIN|BUILDING_MIXINS)

tailRecurse:
	if !(clsPtr == uintptr(0)) {
		goto __1
	}
	return
__1:
	;

	// Add all the filters defined by classes mixed into the main class
	// hierarchy.

	i = 0
__2:
	if !(i < (*Class)(unsafe.Pointer(clsPtr)).Fmixins.Fnum) {
		goto __4
	}
	if !(*(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __5
	}
	goto __3
	goto __6
__5:
	if !func() bool {
		mixinPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __7
	}
	sAddClassFiltersToCallContext(tls, oPtr, mixinPtr, cbPtr, doneFilters,
		flags|TRAVERSED_MIXIN)
__7:
	;
__6:
	;
	goto __3
__3:
	i++
	goto __2
	goto __4
__4:
	;

	// Add all the class filters from the current class. Note that the filters
	// are added starting at the object root, as this allows the object to
	// override how filters work to extend their behaviour.

	if !(flags&OBJECT_MIXIN != 0 || libc.BoolInt32(!(flags&BUILDING_MIXINS != 0)) == libc.BoolInt32(!(flags&TRAVERSED_MIXIN != 0))) {
		goto __8
	}
	i = 0
__9:
	if !(i < (*Class)(unsafe.Pointer(clsPtr)).Ffilters.Fnum) {
		goto __11
	}
	if !(*(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Ffilters.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __12
	}
	goto __10
	goto __13
__12:
	if !func() bool {
		filterObj = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Ffilters.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __14
	}

	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(doneFilters)).FcreateProc})).f(tls, doneFilters, filterObj, bp /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
		goto __15
	}
	sAddSimpleChainToCallContext(tls, oPtr, filterObj, cbPtr,
		doneFilters, clearedFlags|BUILDING_MIXINS, clsPtr)
	sAddSimpleChainToCallContext(tls, oPtr, filterObj, cbPtr,
		doneFilters, clearedFlags, clsPtr)
__15:
	;
__14:
	;
__13:
	;
	goto __10
__10:
	i++
	goto __9
	goto __11
__11:
	;
__8:
	;

	// Now process the recursive case. Notice the tail-call optimization.

	switch (*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum {
	case 1:
		goto __17
	default:
		goto __18
	case 0:
		goto __19
	}
	goto __16
__17:
	clsPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist))
	goto tailRecurse
__18:
	i = 0
__20:
	if !(i < (*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum) {
		goto __22
	}
	if !(*(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __23
	}
	goto __21
	goto __24
__23:
	if !func() bool {
		superPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __25
	}
	sAddClassFiltersToCallContext(tls, oPtr, superPtr, cbPtr, doneFilters,
		flags)
__25:
	;
__24:
	;
	goto __21
__21:
	i++
	goto __20
	goto __22
__22:
	;
__19:
	return
__16:
}

// ----------------------------------------------------------------------
//
// AddSimpleClassChainToCallContext --
//
//	Construct a call-chain from a class hierarchy.
//
// ----------------------------------------------------------------------

func sAddSimpleClassChainToCallContext(tls *libc.TLS, classPtr uintptr, methodNameObj uintptr, cbPtr uintptr, doneFilters uintptr, flags int32, filterDecl uintptr) { /* tclOOCall.c:1423:1: */
	var i int32
	var superPtr uintptr
	var mPtr uintptr
	var hPtr uintptr

	// We hard-code the tail-recursive form. It's by far the most common case
	// *and* it is much more gentle on the stack.
	//
	// Note that mixins must be processed before the main class hierarchy.
	// [Bug 1998221]

tailRecurse:
	i = 0
__1:
	if !(i < (*Class)(unsafe.Pointer(classPtr)).Fmixins.Fnum) {
		goto __3
	}
	if !(*(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __4
	}
	goto __2
	goto __5
__4:
	if !func() bool {
		superPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __6
	}
	sAddSimpleClassChainToCallContext(tls, superPtr, methodNameObj, cbPtr,
		doneFilters, flags|TRAVERSED_MIXIN, filterDecl)
__6:
	;
__5:
	;
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;

	if !(flags&CONSTRUCTOR != 0) {
		goto __7
	}
	sAddMethodToCallChain(tls, (*Class)(unsafe.Pointer(classPtr)).FconstructorPtr, cbPtr, doneFilters,
		filterDecl, flags)
	goto __8
__7:
	if !(flags&DESTRUCTOR != 0) {
		goto __9
	}
	sAddMethodToCallChain(tls, (*Class)(unsafe.Pointer(classPtr)).FdestructorPtr, cbPtr, doneFilters,
		filterDecl, flags)
	goto __10
__9:
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(classPtr + 112 /* &.classMethods */)).FfindProc})).f(tls, classPtr+112 /* &.classMethods */, methodNameObj)

	if !(hPtr != uintptr(0)) {
		goto __11
	}
	mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

	if !!(flags&(DEFINITE_PROTECTED|DEFINITE_PUBLIC) != 0) {
		goto __12
	}
	if !(flags&PUBLIC_METHOD != 0) {
		goto __13
	}
	if !((*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD != 0) {
		goto __15
	}
	flags = flags | DEFINITE_PUBLIC
	goto __16
__15:
	return
__16:
	;
	goto __14
__13:
	flags = flags | DEFINITE_PROTECTED
__14:
	;
__12:
	;
	sAddMethodToCallChain(tls, mPtr, cbPtr, doneFilters, filterDecl, flags)
__11:
	;
__10:
	;
__8:
	;

	switch (*Class)(unsafe.Pointer(classPtr)).Fsuperclasses.Fnum {
	case 1:
		goto __18
	default:
		goto __19
	case 0:
		goto __20
	}
	goto __17
__18:
	classPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Fsuperclasses.Flist))
	goto tailRecurse
__19:
	i = 0
__21:
	if !(i < (*Class)(unsafe.Pointer(classPtr)).Fsuperclasses.Fnum) {
		goto __23
	}
	if !(*(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Fsuperclasses.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __24
	}
	goto __22
	goto __25
__24:
	if !func() bool {
		superPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Fsuperclasses.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __26
	}
	sAddSimpleClassChainToCallContext(tls, superPtr, methodNameObj, cbPtr,
		doneFilters, flags, filterDecl)
__26:
	;
__25:
	;
	goto __22
__22:
	i++
	goto __21
	goto __23
__23:
	;
__20:
	return
__17:
}

// ----------------------------------------------------------------------
//
// TclOORenderCallChain --
//
//	Create a description of a call chain. Used in [info object call],
//	[info class call], and [self call].
//
// ----------------------------------------------------------------------

func XTclOORenderCallChain(tls *libc.TLS, interp uintptr, callPtr uintptr) uintptr { /* tclOOCall.c:1508:9: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var filterLiteral uintptr
	var methodLiteral uintptr
	var objectLiteral uintptr
	var resultObj uintptr
	// var descObjs [4]uintptr at bp, 32

	var objv uintptr
	var fPtr uintptr = XTclOOGetFoundation(tls, interp)
	var i int32

	// Allocate the literals (potentially) used in our description.

	filterLiteral = XTcl_NewStringObj(tls, ts+23149, -1)
	(*Tcl_Obj)(unsafe.Pointer(filterLiteral)).FrefCount++
	methodLiteral = XTcl_NewStringObj(tls, ts+25917, -1)
	(*Tcl_Obj)(unsafe.Pointer(methodLiteral)).FrefCount++
	objectLiteral = XTcl_NewStringObj(tls, ts+18716, -1)
	(*Tcl_Obj)(unsafe.Pointer(objectLiteral)).FrefCount++

	// Do the actual construction of the descriptions. They consist of a list
	// of triples that describe the details of how a method is understood. For
	// each triple, the first word is the type of invocation ("method" is
	// normal, "unknown" is special because it adds the method name as an
	// extra argument when handled by some method types, and "filter" is
	// special because it's a filter method). The second word is the name of
	// the method in question (which differs for "unknown" and "filter" types)
	// and the third word is the full name of the class that declares the
	// method (or "object" if it is declared on the instance).

	objv = XTclStackAlloc(tls, interp, int32(uint64((*CallChain)(unsafe.Pointer(callPtr)).FnumChain)*uint64(unsafe.Sizeof(uintptr(0)))))
	for i = 0; i < (*CallChain)(unsafe.Pointer(callPtr)).FnumChain; i++ {
		var miPtr uintptr = (*CallChain)(unsafe.Pointer(callPtr)).Fchain + uintptr(i)*24

		*(*uintptr)(unsafe.Pointer(bp)) = func() uintptr {
			if (*MInvoke)(unsafe.Pointer(miPtr)).FisFilter != 0 {
				return filterLiteral
			}
			return func() uintptr {
				if (*CallChain)(unsafe.Pointer(callPtr)).Fflags&OO_UNKNOWN_METHOD != 0 {
					return (*Foundation)(unsafe.Pointer(fPtr)).FunknownMethodNameObj
				}
				return methodLiteral
			}()
		}()
		*(*uintptr)(unsafe.Pointer(bp + 1*8)) = func() uintptr {
			if (*CallChain)(unsafe.Pointer(callPtr)).Fflags&CONSTRUCTOR != 0 {
				return (*Foundation)(unsafe.Pointer(fPtr)).FconstructorName
			}
			return func() uintptr {
				if (*CallChain)(unsafe.Pointer(callPtr)).Fflags&DESTRUCTOR != 0 {
					return (*Foundation)(unsafe.Pointer(fPtr)).FdestructorName
				}
				return (*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer(miPtr)).FmPtr)).FnamePtr
			}()
		}()
		*(*uintptr)(unsafe.Pointer(bp + 2*8)) = func() uintptr {
			if (*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer(miPtr)).FmPtr)).FdeclaringClassPtr != 0 {
				return XTcl_GetObjectName(tls, interp,
					(*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer(miPtr)).FmPtr)).FdeclaringClassPtr)).FthisPtr)
			}
			return objectLiteral
		}()
		*(*uintptr)(unsafe.Pointer(bp + 3*8)) = XTcl_NewStringObj(tls, (*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer(miPtr)).FmPtr)).FtypePtr)).Fname, -1)

		*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) = XTcl_NewListObj(tls, 4, bp)
	}

	// Drop the local references to the literals; if they're actually used,
	// they'll live on the description itself.

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = filterLiteral
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = methodLiteral
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = objectLiteral
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	// Finish building the description and return it.

	resultObj = XTcl_NewListObj(tls, (*CallChain)(unsafe.Pointer(callPtr)).FnumChain, objv)
	XTclStackFree(tls, interp, objv)
	return resultObj
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// !END!: Do not edit above this line.

// Alternatives to Tcl_Preserve/Tcl_EventuallyFree/Tcl_Release.

// A convenience macro for iterating through the lists used in the internal
// memory management of objects.
// REQUIRES DECLARATION: int i;

// Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
// sets up the declarations needed for the main macro, FOREACH_HASH, which
// does the actual iteration. FOREACH_HASH_VALUE is a restricted version that
// only iterates over values.

// Convenience macro for duplicating a list. Needs no external declaration,
// but all arguments are used multiple times and so must have no side effects.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The maximum length of fully-qualified object name to use in an errorinfo
// message. Longer than this will be curtailed.

// Some things that make it easier to declare a slot.

type DeclaredSlot = struct {
	Fname       uintptr
	FgetterType Tcl_MethodType
	FsetterType Tcl_MethodType
} /* tclOODefineCmds.c:30:1 */

// Now define the slots used in declarations.

var slots = [8]DeclaredSlot{
	{Fname: ts + 50698, FgetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 50719, FcallProc: 0}, FsetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 50754, FcallProc: 0}},
	{Fname: ts + 50789, FgetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 50809, FcallProc: 0}, FsetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 50843, FcallProc: 0}},
	{Fname: ts + 50877, FgetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 50902, FcallProc: 0}, FsetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 50941, FcallProc: 0}},
	{Fname: ts + 50980, FgetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 51003, FcallProc: 0}, FsetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 51040, FcallProc: 0}},
	{Fname: ts + 51077, FgetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 51101, FcallProc: 0}, FsetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 51139, FcallProc: 0}},
	{Fname: ts + 51177, FgetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 51200, FcallProc: 0}, FsetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 51237, FcallProc: 0}},
	{Fname: ts + 51274, FgetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 51300, FcallProc: 0}, FsetterType: Tcl_MethodType{Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 51340, FcallProc: 0}},
	{}} /* tclOODefineCmds.c:117:34 */

// ----------------------------------------------------------------------
//
// BumpGlobalEpoch --
//	Utility that ensures that call chains that are invalid will get thrown
//	away at an appropriate time. Note that exactly which epoch gets
//	advanced will depend on exactly what the class is tangled up in; in
//	the worst case, the simplest option is to advance the global epoch,
//	causing *everything* to be thrown away on next usage.
//
// ----------------------------------------------------------------------

func sBumpGlobalEpoch(tls *libc.TLS, interp uintptr, classPtr uintptr) { /* tclOODefineCmds.c:142:1: */
	if classPtr != uintptr(0) &&
		(*Class)(unsafe.Pointer(classPtr)).Fsubclasses.Fnum == 0 &&
		(*Class)(unsafe.Pointer(classPtr)).Finstances.Fnum == 0 &&
		(*Class)(unsafe.Pointer(classPtr)).FmixinSubs.Fnum == 0 {
		// If a class has no subclasses or instances, and is not mixed into
		// anything, a change to its structure does not require us to
		// invalidate any call chains. Note that we still bump our object's
		// epoch if it has any mixins; the relation between a class and its
		// representative object is special. But it won't hurt.

		if (*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).FthisPtr)).Fmixins.Fnum > 0 {
			(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).FthisPtr)).Fepoch++
		}
		return
	}

	// Either there's no class (?!) or we're reconfiguring something that is
	// in use. Force regeneration of call chains.

	(*Foundation)(unsafe.Pointer(XTclOOGetFoundation(tls, interp))).Fepoch++
}

// ----------------------------------------------------------------------
//
// RecomputeClassCacheFlag --
//	Determine whether the object is prototypical of its class, and hence
//	able to use the class's method chain cache.
//
// ----------------------------------------------------------------------

func sRecomputeClassCacheFlag(tls *libc.TLS, oPtr uintptr) { /* tclOODefineCmds.c:183:1: */
	if ((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr == uintptr(0) || (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FnumEntries == 0) &&
		(*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum == 0 && (*Object)(unsafe.Pointer(oPtr)).Ffilters.Fnum == 0 {
		*(*int32)(unsafe.Pointer(oPtr + 92)) |= USE_CLASS_CACHE
	} else {
		*(*int32)(unsafe.Pointer(oPtr + 92)) &= libc.CplInt32(USE_CLASS_CACHE)
	}
}

// ----------------------------------------------------------------------
//
// TclOOObjectSetFilters --
//	Install a list of filter method names into an object.
//
// ----------------------------------------------------------------------

func XTclOOObjectSetFilters(tls *libc.TLS, oPtr uintptr, numFilters int32, filters uintptr) { /* tclOODefineCmds.c:204:1: */
	var i int32

	if (*Object)(unsafe.Pointer(oPtr)).Ffilters.Fnum != 0 {
		var filterObj uintptr

		for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Ffilters.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				filterObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = filterObj
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
		}
	}

	if numFilters == 0 {
		// No list of filters was supplied, so we're deleting filters.

		XTclpFree(tls, (*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist)
		(*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist = uintptr(0)
		(*Object)(unsafe.Pointer(oPtr)).Ffilters.Fnum = 0
		sRecomputeClassCacheFlag(tls, oPtr)
	} else {
		// We've got a list of filters, so we're creating filters.

		var filtersList uintptr
		var size int32 = int32(uint64(unsafe.Sizeof(uintptr(0))) * uint64(numFilters)) // should be size_t

		if (*Object)(unsafe.Pointer(oPtr)).Ffilters.Fnum == 0 {
			filtersList = XTcl_Alloc(tls, uint32(size))
		} else {
			filtersList = XTcl_Realloc(tls, (*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist, uint32(size))
		}
		for i = 0; i < numFilters; i++ {
			*(*uintptr)(unsafe.Pointer(filtersList + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(filters + uintptr(i)*8))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(filters + uintptr(i)*8)))).FrefCount++
		}
		(*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist = filtersList
		(*Object)(unsafe.Pointer(oPtr)).Ffilters.Fnum = numFilters
		*(*int32)(unsafe.Pointer(oPtr + 92)) &= libc.CplInt32(USE_CLASS_CACHE)
	}
	(*Object)(unsafe.Pointer(oPtr)).Fepoch++ // Only this object can be affected.
}

// ----------------------------------------------------------------------
//
// TclOOClassSetFilters --
//	Install a list of filter method names into a class.
//
// ----------------------------------------------------------------------

func XTclOOClassSetFilters(tls *libc.TLS, interp uintptr, classPtr uintptr, numFilters int32, filters uintptr) { /* tclOODefineCmds.c:262:1: */
	var i int32

	if (*Class)(unsafe.Pointer(classPtr)).Ffilters.Fnum != 0 {
		var filterObj uintptr

		for i = 0; i < (*Class)(unsafe.Pointer(classPtr)).Ffilters.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Ffilters.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				filterObj = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Ffilters.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = filterObj
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
		}
	}

	if numFilters == 0 {
		// No list of filters was supplied, so we're deleting filters.

		XTclpFree(tls, (*Class)(unsafe.Pointer(classPtr)).Ffilters.Flist)
		(*Class)(unsafe.Pointer(classPtr)).Ffilters.Flist = uintptr(0)
		(*Class)(unsafe.Pointer(classPtr)).Ffilters.Fnum = 0
	} else {
		// We've got a list of filters, so we're creating filters.

		var filtersList uintptr
		var size int32 = int32(uint64(unsafe.Sizeof(uintptr(0))) * uint64(numFilters)) // should be size_t

		if (*Class)(unsafe.Pointer(classPtr)).Ffilters.Fnum == 0 {
			filtersList = XTcl_Alloc(tls, uint32(size))
		} else {
			filtersList = XTcl_Realloc(tls, (*Class)(unsafe.Pointer(classPtr)).Ffilters.Flist, uint32(size))
		}
		for i = 0; i < numFilters; i++ {
			*(*uintptr)(unsafe.Pointer(filtersList + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(filters + uintptr(i)*8))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(filters + uintptr(i)*8)))).FrefCount++
		}
		(*Class)(unsafe.Pointer(classPtr)).Ffilters.Flist = filtersList
		(*Class)(unsafe.Pointer(classPtr)).Ffilters.Fnum = numFilters
	}

	// There may be many objects affected, so bump the global epoch.

	sBumpGlobalEpoch(tls, interp, classPtr)
}

// ----------------------------------------------------------------------
//
// TclOOObjectSetMixins --
//	Install a list of mixin classes into an object.
//
// ----------------------------------------------------------------------

func XTclOOObjectSetMixins(tls *libc.TLS, oPtr uintptr, numMixins int32, mixins uintptr) { /* tclOODefineCmds.c:324:1: */
	var mixinPtr uintptr
	var i int32

	if numMixins == 0 {
		if (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum != 0 {
			for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum; i++ {
				if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
					continue
				} else if func() bool {
					mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8))
					return 1 != 0
				}() {
					XTclOORemoveFromInstances(tls, oPtr, mixinPtr)
					XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(mixinPtr)).FthisPtr)
				}
			}
			XTclpFree(tls, (*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist)
			(*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum = 0
		}
		sRecomputeClassCacheFlag(tls, oPtr)
	} else {
		if (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum != 0 {
			for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum; i++ {
				if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
					continue
				} else if func() bool {
					mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8))
					return 1 != 0
				}() {
					if mixinPtr != 0 && mixinPtr != (*Object)(unsafe.Pointer(oPtr)).FselfCls {
						XTclOORemoveFromInstances(tls, oPtr, mixinPtr)
					}
					XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(mixinPtr)).FthisPtr)
				}
			}
			(*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist = XTcl_Realloc(tls, (*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(numMixins)))
		} else {
			(*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(numMixins)))
			*(*int32)(unsafe.Pointer(oPtr + 92)) &= libc.CplInt32(USE_CLASS_CACHE)
		}
		(*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum = numMixins
		libc.Xmemcpy(tls, (*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist, mixins, uint64(unsafe.Sizeof(uintptr(0)))*uint64(numMixins))
		for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				if mixinPtr != (*Object)(unsafe.Pointer(oPtr)).FselfCls {
					XTclOOAddToInstances(tls, oPtr, mixinPtr)

					// For the new copy created by memcpy().

					(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(mixinPtr)).FthisPtr)).FrefCount++
				}
			}
		}
	}
	(*Object)(unsafe.Pointer(oPtr)).Fepoch++
}

// ----------------------------------------------------------------------
//
// TclOOClassSetMixins --
//	Install a list of mixin classes into a class.
//
// ----------------------------------------------------------------------

func XTclOOClassSetMixins(tls *libc.TLS, interp uintptr, classPtr uintptr, numMixins int32, mixins uintptr) { /* tclOODefineCmds.c:383:1: */
	var mixinPtr uintptr
	var i int32

	if numMixins == 0 {
		if (*Class)(unsafe.Pointer(classPtr)).Fmixins.Fnum != 0 {
			for i = 0; i < (*Class)(unsafe.Pointer(classPtr)).Fmixins.Fnum; i++ {
				if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
					continue
				} else if func() bool {
					mixinPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist + uintptr(i)*8))
					return 1 != 0
				}() {
					XTclOORemoveFromMixinSubs(tls, classPtr, mixinPtr)
					XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(mixinPtr)).FthisPtr)
				}
			}
			XTclpFree(tls, (*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist)
			(*Class)(unsafe.Pointer(classPtr)).Fmixins.Fnum = 0
		}
	} else {
		if (*Class)(unsafe.Pointer(classPtr)).Fmixins.Fnum != 0 {
			for i = 0; i < (*Class)(unsafe.Pointer(classPtr)).Fmixins.Fnum; i++ {
				if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
					continue
				} else if func() bool {
					mixinPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist + uintptr(i)*8))
					return 1 != 0
				}() {
					XTclOORemoveFromMixinSubs(tls, classPtr, mixinPtr)
					XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(mixinPtr)).FthisPtr)
				}
			}
			(*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist = XTcl_Realloc(tls, (*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(numMixins)))
		} else {
			(*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(numMixins)))
		}
		(*Class)(unsafe.Pointer(classPtr)).Fmixins.Fnum = numMixins
		libc.Xmemcpy(tls, (*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist, mixins, uint64(unsafe.Sizeof(uintptr(0)))*uint64(numMixins))
		for i = 0; i < (*Class)(unsafe.Pointer(classPtr)).Fmixins.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				mixinPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(classPtr)).Fmixins.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				XTclOOAddToMixinSubs(tls, classPtr, mixinPtr)

				// For the new copy created by memcpy.

				(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(mixinPtr)).FthisPtr)).FrefCount++
			}
		}
	}
	sBumpGlobalEpoch(tls, interp, classPtr)
}

// ----------------------------------------------------------------------
//
// RenameDeleteMethod --
//	Core of the code to rename and delete methods.
//
// ----------------------------------------------------------------------

func sRenameDeleteMethod(tls *libc.TLS, interp uintptr, oPtr uintptr, useClass int32, fromPtr uintptr, toPtr uintptr) int32 { /* tclOODefineCmds.c:437:1: */
	bp := tls.Alloc(124)
	defer tls.Free(124)

	var hPtr uintptr
	var newHPtr uintptr
	var mPtr uintptr
	// var isNew int32 at bp+120, 4

	var _objPtr uintptr
	newHPtr = uintptr(0)

	if !!(useClass != 0) {
		goto __1
	}
	if !!(int32((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr) != 0) {
		goto __3
	}
noSuchMethod:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+51380, libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(fromPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(fromPtr)).Fbytes
			}
			return XTcl_GetString(tls, fromPtr)
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+25775,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(fromPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(fromPtr)).Fbytes
			}
			return XTcl_GetString(tls, fromPtr)
		}(), uintptr(0)))
	return TCL_ERROR
__3:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, fromPtr)
	if !(hPtr == uintptr(0)) {
		goto __4
	}
	goto noSuchMethod
__4:
	;
	if !(toPtr != 0) {
		goto __5
	}
	newHPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FcreateProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, toPtr, bp+120 /* &isNew */)
	if !(hPtr == newHPtr) {
		goto __6
	}
renameToSelf:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+51405, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+28514, ts+51436, uintptr(0)))
	return TCL_ERROR
	goto __7
__6:
	if !!(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
		goto __8
	}
renameToExisting:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+51451,
		libc.VaList(bp+80, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(toPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(toPtr)).Fbytes
			}
			return XTcl_GetString(tls, toPtr)
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, ts+3593, ts+28514, ts+51483, uintptr(0)))
	return TCL_ERROR
__8:
	;
__7:
	;
__5:
	;
	goto __2
__1:
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr + 112 /* &.classMethods */)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr+112 /* &.classMethods */, fromPtr)
	if !(hPtr == uintptr(0)) {
		goto __9
	}
	goto noSuchMethod
__9:
	;
	if !(toPtr != 0) {
		goto __10
	}
	newHPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr + 112 /* &.classMethods */)).FcreateProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr+112 /* &.classMethods */, toPtr, bp+120 /* &isNew */)
	if !(hPtr == newHPtr) {
		goto __11
	}
	goto renameToSelf
	goto __12
__11:
	if !!(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
		goto __13
	}
	goto renameToExisting
__13:
	;
__12:
	;
__10:
	;
__2:
	;

	// Complete the splicing by changing the method's name.

	mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !(toPtr != 0) {
		goto __14
	}
	(*Tcl_Obj)(unsafe.Pointer(toPtr)).FrefCount++
__16:
	_objPtr = (*Method)(unsafe.Pointer(mPtr)).FnamePtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __19
	}
	XTclFreeObj(tls, _objPtr)
__19:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	(*Method)(unsafe.Pointer(mPtr)).FnamePtr = toPtr
	(*Tcl_HashEntry)(unsafe.Pointer(newHPtr)).FclientData = mPtr
	goto __15
__14:
	if !!(useClass != 0) {
		goto __20
	}
	sRecomputeClassCacheFlag(tls, oPtr)
__20:
	;
	XTclOODelMethodRef(tls, mPtr)
__15:
	;
	XTcl_DeleteHashEntry(tls, hPtr)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOOUnknownDefinition --
//	Handles what happens when an unknown command is encountered during the
//	processing of a definition script. Works by finding a command in the
//	operating definition namespace that the requested command is a unique
//	prefix of.
//
// ----------------------------------------------------------------------

func XTclOOUnknownDefinition(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:529:1: */
	bp := tls.Alloc(112)
	defer tls.Free(112)

	var nsPtr uintptr
	// var search Tcl_HashSearch at bp+88, 24

	var hPtr uintptr
	// var soughtLen int32 at bp+80, 4

	var soughtStr uintptr
	var matchedStr uintptr
	var nameStr uintptr
	var _objPtr uintptr
	// Got one match, and only one match!

	var newObjv uintptr
	var result int32
	nsPtr = XTcl_GetCurrentNamespace(tls, interp)
	matchedStr = uintptr(0)

	if !(objc < 2) {
		goto __1
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+51495, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51523, uintptr(0)))
	return TCL_ERROR
__1:
	;
	if !(XTclOOGetDefineCmdContext(tls, interp) == uintptr(0)) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	soughtStr = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+80)
	if !(*(*int32)(unsafe.Pointer(bp + 80)) == 0) {
		goto __3
	}
	goto noMatch
__3:
	;
	hPtr = XTcl_FirstHashEntry(tls, nsPtr+160, bp+88)
__4:
	if !(hPtr != uintptr(0)) {
		goto __5
	}
	nameStr = func() uintptr {
		if (*Tcl_HashTable)(unsafe.Pointer(nsPtr+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(nsPtr+160)).FkeyType == -1 {
			return *(*uintptr)(unsafe.Pointer(hPtr + 32))
		}
		return hPtr + 32
	}()

	if !(libc.Xstrncmp(tls, soughtStr, nameStr, uint64(*(*int32)(unsafe.Pointer(bp + 80)))) == 0) {
		goto __6
	}
	if !(matchedStr != uintptr(0)) {
		goto __7
	}
	goto noMatch
__7:
	;
	matchedStr = nameStr
__6:
	;
	hPtr = XTcl_NextHashEntry(tls, bp+88)
	goto __4
__5:
	;

	if !(matchedStr != uintptr(0)) {
		goto __8
	}
	// Got one match, and only one match!

	newObjv =
		XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(objc-1)))

	*(*uintptr)(unsafe.Pointer(newObjv)) = XTcl_NewStringObj(tls, matchedStr, -1)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(newObjv)))).FrefCount++
	if !(objc > 2) {
		goto __9
	}
	libc.Xmemcpy(tls, newObjv+uintptr(1)*8, objv+uintptr(2)*8, uint64(unsafe.Sizeof(uintptr(0)))*uint64(objc-2))
__9:
	;
	result = XTcl_EvalObjv(tls, interp, objc-1, newObjv, 0)
__10:
	_objPtr = *(*uintptr)(unsafe.Pointer(newObjv))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __13
	}
	XTclFreeObj(tls, _objPtr)
__13:
	;
	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
	XTclStackFree(tls, interp, newObjv)
	return result
__8:
	;

noMatch:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+7842, libc.VaList(bp+32, soughtStr)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7170, ts+7328, soughtStr, uintptr(0)))
	return TCL_ERROR
}

// ----------------------------------------------------------------------
//
// FindCommand --
//	Specialized version of Tcl_FindCommand that handles command prefixes
//	and disallows namespace magic.
//
// ----------------------------------------------------------------------

func sFindCommand(tls *libc.TLS, interp uintptr, stringObj uintptr, namespacePtr uintptr) Tcl_Command { /* tclOODefineCmds.c:606:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// var length int32 at bp, 4

	var nameStr uintptr
	var string uintptr = XTcl_GetStringFromObj(tls, stringObj, bp)
	var nsPtr uintptr = namespacePtr
	var hPtr uintptr
	// var search Tcl_HashSearch at bp+8, 24

	var cmd Tcl_Command
	var cmd2 Tcl_Command

	// If someone is playing games, we stop playing right now.

	if int32(*(*int8)(unsafe.Pointer(string))) == 0 || libc.Xstrstr(tls, string, ts+6847) != uintptr(0) {
		return uintptr(0)
	}

	// Do the exact lookup first.

	cmd = XTcl_FindCommand(tls, interp, string, namespacePtr, TCL_NAMESPACE_ONLY)
	if cmd != uintptr(0) {
		return cmd
	}

	// Bother, need to perform an approximate match. Iterate across the hash
	// table of commands in the namespace.

	for hPtr = XTcl_FirstHashEntry(tls, nsPtr+160, bp+8); func() int32 {
		if hPtr != uintptr(0) {
			return func() int32 {
				nameStr = func() uintptr {
					if (*Tcl_HashTable)(unsafe.Pointer(nsPtr+160)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(nsPtr+160)).FkeyType == -1 {
						return *(*uintptr)(unsafe.Pointer(hPtr + 32))
					}
					return hPtr + 32
				}()
				cmd2 = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
				return 1
			}()
		}
		return 0
	}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+8) {
		if libc.Xstrncmp(tls, string, nameStr, uint64(*(*int32)(unsafe.Pointer(bp)))) == 0 {
			if cmd != uintptr(0) {
				return uintptr(0)
			}
			cmd = cmd2
		}
	}

	// Either we found one thing or we found nothing. Either way, return it.

	return cmd
}

// ----------------------------------------------------------------------
//
// InitDefineContext --
//	Does the magic incantations necessary to push the special stack frame
//	used when processing object definitions. It is up to the caller to
//	dispose of the frame (with TclPopStackFrame) when finished.
//
// ----------------------------------------------------------------------

func sInitDefineContext(tls *libc.TLS, interp uintptr, namespacePtr uintptr, oPtr uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:667:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	// var framePtr uintptr at bp+32, 8

	var framePtrPtr uintptr = bp + 32 /* &framePtr */

	if namespacePtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+51535,
			-1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}

	// framePtrPtr is needed to satisfy GCC 3.3's strict aliasing rules.

	XTclPushStackFrame(tls, interp, framePtrPtr,
		namespacePtr, FRAME_IS_OO_DEFINE)
	(*CallFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* framePtr */)))).FclientData = oPtr
	(*CallFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* framePtr */)))).Fobjc = objc
	(*CallFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* framePtr */)))).Fobjv = objv // Reference counts do not need to be
	// incremented here.
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOOGetDefineCmdContext --
//	Extracts the magic token from the current stack frame, or returns NULL
//	(and leaves an error message) otherwise.
//
// ----------------------------------------------------------------------

func XTclOOGetDefineCmdContext(tls *libc.TLS, interp uintptr) Tcl_Object { /* tclOODefineCmds.c:708:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	var iPtr uintptr = interp
	var object Tcl_Object

	if (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr == uintptr(0) ||
		(*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FisProcCallFrame != FRAME_IS_OO_DEFINE {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

			ts+51605, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return uintptr(0)
	}
	object = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FclientData
	if XTcl_ObjectDeleted(tls, object) != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

			ts+51707, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return uintptr(0)
	}
	return object
}

// ----------------------------------------------------------------------
//
// GetClassInOuterContext --
//	Wrapper round Tcl_GetObjectFromObj to perform the lookup in the
//	context that called oo::define (or equivalent). Note that this may
//	have to go up multiple levels to get the level that we started doing
//	definitions at.
//
// ----------------------------------------------------------------------

func sGetClassInOuterContext(tls *libc.TLS, interp uintptr, className uintptr, errMsg uintptr) uintptr { /* tclOODefineCmds.c:745:21: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var iPtr uintptr = interp
	var oPtr uintptr
	var savedFramePtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr

	for (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FisProcCallFrame == FRAME_IS_OO_DEFINE {
		if (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FcallerVarPtr == uintptr(0) {
			XTcl_Panic(tls, ts+51770, 0)
		}
		(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FcallerVarPtr
	}
	oPtr = XTcl_GetObjectFromObj(tls, interp, className)
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = savedFramePtr
	if oPtr == uintptr(0) {
		return uintptr(0)
	}
	if (*Object)(unsafe.Pointer(oPtr)).FclassPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, errMsg, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7170, ts+25465,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(className)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(className)).Fbytes
				}
				return XTcl_GetString(tls, className)
			}(), uintptr(0)))
		return uintptr(0)
	}
	return (*Object)(unsafe.Pointer(oPtr)).FclassPtr
}

// ----------------------------------------------------------------------
//
// GenerateErrorInfo --
//	Factored out code to generate part of the error trace messages.
//
// ----------------------------------------------------------------------

func sGenerateErrorInfo(tls *libc.TLS, interp uintptr, oPtr uintptr, savedNameObj uintptr, typeOfSubject uintptr) { /* tclOODefineCmds.c:785:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	// var length int32 at bp+40, 4

	var realNameObj uintptr
	if XTcl_ObjectDeleted(tls, oPtr) != 0 {
		realNameObj = savedNameObj
	} else {
		realNameObj = XTclOOObjectName(tls, interp, oPtr)
	}
	var objName uintptr = XTcl_GetStringFromObj(tls, realNameObj, bp+40)
	var limit int32 = OBJNAME_LENGTH_IN_ERRORINFO_LIMIT
	var overflow int32 = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 40)) > limit)

	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+51823,
		libc.VaList(bp, typeOfSubject, func() int32 {
			if overflow != 0 {
				return limit
			}
			return *(*int32)(unsafe.Pointer(bp + 40))
		}(), objName,
			func() uintptr {
				if overflow != 0 {
					return ts + 7891 /* "..." */
				}
				return ts + 2046 /* "" */
			}(), XTcl_GetErrorLine(tls, interp))))
}

// ----------------------------------------------------------------------
//
// MagicDefinitionInvoke --
//	Part of the implementation of the "oo::define" and "oo::objdefine"
//	commands that is used to implement the more-than-one-argument case,
//	applying ensemble-like tricks with dispatch so that error messages are
//	clearer. Doesn't handle the management of the stack frame.
//
// ----------------------------------------------------------------------

func sMagicDefinitionInvoke(tls *libc.TLS, interp uintptr, nsPtr uintptr, cmdIndex int32, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:826:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var objPtr uintptr
	var obj2Ptr uintptr
	// var objs uintptr at bp+8, 8

	var cmd Tcl_Command
	var isRoot int32
	// var dummy int32 at bp, 4

	var result int32
	var offset int32 = cmdIndex + 1

	// More than one argument: fire them through the ensemble processing
	// engine so that everything appears to be good and proper in error
	// messages. Note that we cannot just concatenate and send through
	// Tcl_EvalObjEx, as that doesn't do ensemble processing, and we cannot go
	// through Tcl_EvalObjv without the extra work to pre-find the command, as
	// that finds command names in the wrong namespace at the moment. Ugly!

	isRoot = XTclInitRewriteEnsemble(tls, interp, offset, 1, objv)

	// Build the list of arguments using a Tcl_Obj as a workspace. See
	// comments above for why these contortions are necessary.

	objPtr = XTcl_NewObj(tls)
	obj2Ptr = XTcl_NewObj(tls)
	cmd = sFindCommand(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(cmdIndex)*8)), nsPtr)
	if cmd == uintptr(0) {
		// Punt this case!

		XTcl_AppendObjToObj(tls, obj2Ptr, *(*uintptr)(unsafe.Pointer(objv + uintptr(cmdIndex)*8)))
	} else {
		XTcl_GetCommandFullName(tls, interp, cmd, obj2Ptr)
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), objPtr, obj2Ptr)
	// TODO: overflow?
	XTcl_ListObjReplace(tls, uintptr(0), objPtr, 1, 0, objc-offset, objv+uintptr(offset)*8)
	XTcl_ListObjGetElements(tls, uintptr(0), objPtr, bp, bp+8)

	result = XTcl_EvalObjv(tls, interp, objc-cmdIndex, *(*uintptr)(unsafe.Pointer(bp + 8 /* objs */)), TCL_EVAL_INVOKE)
	if isRoot != 0 {
		XTclResetRewriteEnsemble(tls, interp, 1)
	}
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = objPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	return result
}

// ----------------------------------------------------------------------
//
// TclOODefineObjCmd --
//	Implementation of the "oo::define" command. Works by effectively doing
//	the same as 'namespace eval', but with extra magic applied so that the
//	object to be modified is known to the commands in the target
//	namespace. Also does ensemble-like tricks with dispatch so that error
//	messages are clearer.
//
// ----------------------------------------------------------------------

func XTclOODefineObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:893:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var fPtr uintptr = XTclOOGetFoundation(tls, interp)
	var oPtr uintptr
	var result int32

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+51875)
		return TCL_ERROR
	}

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	if (*Object)(unsafe.Pointer(oPtr)).FclassPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+51899, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+25465,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
			}(), uintptr(0)))
		return TCL_ERROR
	}

	// Make the oo::define namespace the current namespace and evaluate the
	// command(s).

	if sInitDefineContext(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FdefineNs, oPtr, objc, objv) != TCL_OK {
		return TCL_ERROR
	}

	(*Object)(unsafe.Pointer(oPtr)).FrefCount++
	if objc == 3 {
		var objNameObj uintptr = XTclOOObjectName(tls, interp, oPtr)

		(*Tcl_Obj)(unsafe.Pointer(objNameObj)).FrefCount++
		result = XTclEvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), 0,
			(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr, 2)
		if result == TCL_ERROR {
			sGenerateErrorInfo(tls, interp, oPtr, objNameObj, ts+16064)
		}
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objNameObj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(objNameObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objNameObj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(objNameObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objNameObj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objNameObj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(objNameObj)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, objNameObj)
					} else {
						*(*uintptr)(unsafe.Pointer(objNameObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objNameObj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, objNameObj)
			}
		}

	} else {
		result = sMagicDefinitionInvoke(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FdefineNs, 2, objc, objv)
	}
	XTclOODecrRefCount(tls, oPtr)

	// Restore the previous "current" namespace.

	XTclPopStackFrame(tls, interp)
	return result
}

// ----------------------------------------------------------------------
//
// TclOOObjDefObjCmd --
//	Implementation of the "oo::objdefine" command. Works by effectively
//	doing the same as 'namespace eval', but with extra magic applied so
//	that the object to be modified is known to the commands in the target
//	namespace. Also does ensemble-like tricks with dispatch so that error
//	messages are clearer.
//
// ----------------------------------------------------------------------

func XTclOOObjDefObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:967:1: */
	var fPtr uintptr = XTclOOGetFoundation(tls, interp)
	var oPtr uintptr
	var result int32

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+51928)
		return TCL_ERROR
	}

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Make the oo::objdefine namespace the current namespace and evaluate the
	// command(s).

	if sInitDefineContext(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FobjdefNs, oPtr, objc, objv) != TCL_OK {
		return TCL_ERROR
	}

	(*Object)(unsafe.Pointer(oPtr)).FrefCount++
	if objc == 3 {
		var objNameObj uintptr = XTclOOObjectName(tls, interp, oPtr)

		(*Tcl_Obj)(unsafe.Pointer(objNameObj)).FrefCount++
		result = XTclEvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), 0,
			(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr, 2)
		if result == TCL_ERROR {
			sGenerateErrorInfo(tls, interp, oPtr, objNameObj, ts+18716)
		}
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objNameObj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(objNameObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objNameObj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(objNameObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objNameObj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objNameObj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(objNameObj)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, objNameObj)
					} else {
						*(*uintptr)(unsafe.Pointer(objNameObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objNameObj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, objNameObj)
			}
		}

	} else {
		result = sMagicDefinitionInvoke(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FobjdefNs, 2, objc, objv)
	}
	XTclOODecrRefCount(tls, oPtr)

	// Restore the previous "current" namespace.

	XTclPopStackFrame(tls, interp)
	return result
}

// ----------------------------------------------------------------------
//
// TclOODefineSelfObjCmd --
//	Implementation of the "self" subcommand of the "oo::define" command.
//	Works by effectively doing the same as 'namespace eval', but with
//	extra magic applied so that the object to be modified is known to the
//	commands in the target namespace. Also does ensemble-like tricks with
//	dispatch so that error messages are clearer.
//
// ----------------------------------------------------------------------

func XTclOODefineSelfObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1034:1: */
	var fPtr uintptr = XTclOOGetFoundation(tls, interp)
	var oPtr uintptr
	var result int32

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12083)
		return TCL_ERROR
	}

	oPtr = XTclOOGetDefineCmdContext(tls, interp)
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Make the oo::objdefine namespace the current namespace and evaluate the
	// command(s).

	if sInitDefineContext(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FobjdefNs, oPtr, objc, objv) != TCL_OK {
		return TCL_ERROR
	}

	(*Object)(unsafe.Pointer(oPtr)).FrefCount++
	if objc == 2 {
		var objNameObj uintptr = XTclOOObjectName(tls, interp, oPtr)

		(*Tcl_Obj)(unsafe.Pointer(objNameObj)).FrefCount++
		result = XTclEvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), 0,
			(*Interp)(unsafe.Pointer(interp)).FcmdFramePtr, 2)
		if result == TCL_ERROR {
			sGenerateErrorInfo(tls, interp, oPtr, objNameObj, ts+51953)
		}
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objNameObj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(objNameObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objNameObj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(objNameObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objNameObj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objNameObj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(objNameObj)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, objNameObj)
					} else {
						*(*uintptr)(unsafe.Pointer(objNameObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objNameObj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, objNameObj)
			}
		}

	} else {
		result = sMagicDefinitionInvoke(tls, interp, (*Foundation)(unsafe.Pointer(fPtr)).FobjdefNs, 1, objc, objv)
	}
	XTclOODecrRefCount(tls, oPtr)

	// Restore the previous "current" namespace.

	XTclPopStackFrame(tls, interp)
	return result
}

// ----------------------------------------------------------------------
//
// TclOODefineClassObjCmd --
//	Implementation of the "class" subcommand of the "oo::objdefine"
//	command.
//
// ----------------------------------------------------------------------

func XTclOODefineClassObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1098:1: */
	bp := tls.Alloc(96)
	defer tls.Free(96)

	var oPtr uintptr
	var clsPtr uintptr
	var fPtr uintptr = XTclOOGetFoundation(tls, interp)
	var wasClass int32
	var willBeClass int32

	// Parse the context to get the object to operate on.

	oPtr = XTclOOGetDefineCmdContext(tls, interp)
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	if (*Object)(unsafe.Pointer(oPtr)).Fflags&ROOT_OBJECT != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+51966, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}
	if (*Object)(unsafe.Pointer(oPtr)).Fflags&ROOT_CLASS != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52016, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}

	// Parse the argument to get the class to set the object's class to.

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25435)
		return TCL_ERROR
	}
	clsPtr = sGetClassInOuterContext(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)),
		ts+52065)
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}
	if oPtr == (*Class)(unsafe.Pointer(clsPtr)).FthisPtr {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52104, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}

	// Set the object's class.

	wasClass = libc.Bool32((*Object)(unsafe.Pointer(oPtr)).FclassPtr != uintptr(0))
	willBeClass = XTclOOIsReachable(tls, (*Foundation)(unsafe.Pointer(fPtr)).FclassCls, clsPtr)

	if (*Object)(unsafe.Pointer(oPtr)).FselfCls != clsPtr {
		XTclOORemoveFromInstances(tls, oPtr, (*Object)(unsafe.Pointer(oPtr)).FselfCls)
		XTclOODecrRefCount(tls, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FthisPtr)
		(*Object)(unsafe.Pointer(oPtr)).FselfCls = clsPtr
		(*Object)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FthisPtr)).FrefCount++
		XTclOOAddToInstances(tls, oPtr, (*Object)(unsafe.Pointer(oPtr)).FselfCls)

		// Create or delete the class guts if necessary.

		if wasClass != 0 && !(willBeClass != 0) {
			// This is the most global of all epochs. Bump it! No cache can be
			// trusted!

			XTclOORemoveFromMixins(tls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr, oPtr)
			(*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).Fepoch++
			*(*int32)(unsafe.Pointer(oPtr + 92)) |= DONT_DELETE
			XTclOODeleteDescendants(tls, interp, oPtr)
			*(*int32)(unsafe.Pointer(oPtr + 92)) &= libc.CplInt32(DONT_DELETE)
			XTclOOReleaseClassContents(tls, interp, oPtr)
			XTclpFree(tls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr)
			(*Object)(unsafe.Pointer(oPtr)).FclassPtr = uintptr(0)
		} else if !(wasClass != 0) && willBeClass != 0 {
			XTclOOAllocClass(tls, interp, oPtr)
		}

		if (*Object)(unsafe.Pointer(oPtr)).FclassPtr != uintptr(0) {
			sBumpGlobalEpoch(tls, interp, (*Object)(unsafe.Pointer(oPtr)).FclassPtr)
		} else {
			(*Object)(unsafe.Pointer(oPtr)).Fepoch++
		}
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOODefineConstructorObjCmd --
//	Implementation of the "constructor" subcommand of the "oo::define"
//	command.
//
// ----------------------------------------------------------------------

func XTclOODefineConstructorObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1206:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var oPtr uintptr
	var clsPtr uintptr
	var method Tcl_Method
	// var bodyLength int32 at bp, 4

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52158)
		return TCL_ERROR
	}

	// Extract and validate the context, which is the class that we wish to
	// modify.

	oPtr = XTclOOGetDefineCmdContext(tls, interp)
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	clsPtr = (*Object)(unsafe.Pointer(oPtr)).FclassPtr

	XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp)
	if *(*int32)(unsafe.Pointer(bp)) > 0 {
		// Create the method structure.

		method = XTclOONewProcMethod(tls, interp, clsPtr,
			PUBLIC_METHOD, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(0))
		if method == uintptr(0) {
			return TCL_ERROR
		}
	} else {
		// Delete the constructor method record and set the field in the
		// class record to NULL.

		method = uintptr(0)
	}

	// Place the method structure in the class record. Note that we might not
	// immediately delete the constructor as this might be being done during
	// execution of the constructor itself.

	XTcl_ClassSetConstructor(tls, interp, clsPtr, method)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOODefineDeleteMethodObjCmd --
//	Implementation of the "deletemethod" subcommand of the "oo::define"
//	and "oo::objdefine" commands.
//
// ----------------------------------------------------------------------

func XTclOODefineDeleteMethodObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1274:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var isInstanceDeleteMethod int32 = libc.Bool32(clientData != uintptr(0))
	var oPtr uintptr
	var i int32

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12624)
		return TCL_ERROR
	}

	oPtr = XTclOOGetDefineCmdContext(tls, interp)
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	if !(isInstanceDeleteMethod != 0) && !(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}

	for i = 1; i < objc; i++ {
		// Delete the method structure from the appropriate hash table.

		if sRenameDeleteMethod(tls, interp, oPtr, libc.BoolInt32(!(isInstanceDeleteMethod != 0)),
			*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(0)) != TCL_OK {
			return TCL_ERROR
		}
	}

	if isInstanceDeleteMethod != 0 {
		(*Object)(unsafe.Pointer(oPtr)).Fepoch++
	} else {
		sBumpGlobalEpoch(tls, interp, (*Object)(unsafe.Pointer(oPtr)).FclassPtr)
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOODefineDestructorObjCmd --
//	Implementation of the "destructor" subcommand of the "oo::define"
//	command.
//
// ----------------------------------------------------------------------

func XTclOODefineDestructorObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1330:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var oPtr uintptr
	var clsPtr uintptr
	var method Tcl_Method
	// var bodyLength int32 at bp, 4

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13131)
		return TCL_ERROR
	}

	oPtr = XTclOOGetDefineCmdContext(tls, interp)
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	clsPtr = (*Object)(unsafe.Pointer(oPtr)).FclassPtr

	XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	if *(*int32)(unsafe.Pointer(bp)) > 0 {
		// Create the method structure.

		method = XTclOONewProcMethod(tls, interp, clsPtr,
			PUBLIC_METHOD, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0))
		if method == uintptr(0) {
			return TCL_ERROR
		}
	} else {
		// Delete the destructor method record and set the field in the class
		// record to NULL.

		method = uintptr(0)
	}

	// Place the method structure in the class record. Note that we might not
	// immediately delete the destructor as this might be being done during
	// execution of the destructor itself. Also note that setting a
	// destructor during a destructor is fairly dumb anyway.

	XTcl_ClassSetDestructor(tls, interp, clsPtr, method)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOODefineExportObjCmd --
//	Implementation of the "export" subcommand of the "oo::define" and
//	"oo::objdefine" commands.
//
// ----------------------------------------------------------------------

func XTclOODefineExportObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1394:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var isInstanceExport int32 = libc.Bool32(clientData != uintptr(0))
	var oPtr uintptr
	var mPtr uintptr
	var hPtr uintptr
	var clsPtr uintptr
	var i int32
	// var isNew int32 at bp+32, 4

	var changed int32 = 0

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12624)
		return TCL_ERROR
	}

	oPtr = XTclOOGetDefineCmdContext(tls, interp)
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	clsPtr = (*Object)(unsafe.Pointer(oPtr)).FclassPtr
	if !(isInstanceExport != 0) && !(clsPtr != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}

	for i = 1; i < objc; i++ {
		// Exporting is done by adding the PUBLIC_METHOD flag to the method
		// record. If there is no such method in this object or class (i.e.
		// the method comes from something inherited from or that we're an
		// instance of) then we put in a blank record with that flag; such
		// records are skipped over by the call chain engine *except* for
		// their flags member.

		if isInstanceExport != 0 {
			if !(int32((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr) != 0) {
				(*Object)(unsafe.Pointer(oPtr)).FmethodsPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
				XTcl_InitObjHashTable(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)
				*(*int32)(unsafe.Pointer(oPtr + 92)) &= libc.CplInt32(USE_CLASS_CACHE)
			}
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FcreateProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+32 /* &isNew */)
		} else {
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(clsPtr + 112 /* &.classMethods */)).FcreateProc})).f(tls, clsPtr+112 /* &.classMethods */, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+32 /* &isNew */)
		}

		if *(*int32)(unsafe.Pointer(bp + 32)) != 0 {
			mPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Method{})))
			libc.Xmemset(tls, mPtr, 0, uint64(unsafe.Sizeof(Method{})))
			(*Method)(unsafe.Pointer(mPtr)).FrefCount = 1
			(*Method)(unsafe.Pointer(mPtr)).FnamePtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FrefCount++
			(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = mPtr
		} else {
			mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		}
		if *(*int32)(unsafe.Pointer(bp + 32)) != 0 || !((*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD != 0) {
			*(*int32)(unsafe.Pointer(mPtr + 48)) |= PUBLIC_METHOD
			changed = 1
		}
	}

	// Bump the right epoch if we actually changed anything.

	if changed != 0 {
		if isInstanceExport != 0 {
			(*Object)(unsafe.Pointer(oPtr)).Fepoch++
		} else {
			sBumpGlobalEpoch(tls, interp, clsPtr)
		}
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOODefineForwardObjCmd --
//	Implementation of the "forward" subcommand of the "oo::define" and
//	"oo::objdefine" commands.
//
// ----------------------------------------------------------------------

func XTclOODefineForwardObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1488:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var isInstanceForward int32 = libc.Bool32(clientData != uintptr(0))
	var oPtr uintptr
	var mPtr uintptr
	var isPublic int32
	var prefixObj uintptr

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52195)
		return TCL_ERROR
	}

	oPtr = XTclOOGetDefineCmdContext(tls, interp)
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	if !(isInstanceForward != 0) && !(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}
	if XTcl_StringMatch(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}(), ts+49155) != 0 {
		isPublic = PUBLIC_METHOD
	} else {
		isPublic = 0
	}

	// Create the method structure.

	prefixObj = XTcl_NewListObj(tls, objc-2, objv+uintptr(2)*8)
	if isInstanceForward != 0 {
		mPtr = XTclOONewForwardInstanceMethod(tls, interp, oPtr, isPublic, *(*uintptr)(unsafe.Pointer(objv + 1*8)),
			prefixObj)
	} else {
		mPtr = XTclOONewForwardMethod(tls, interp, (*Object)(unsafe.Pointer(oPtr)).FclassPtr, isPublic,
			*(*uintptr)(unsafe.Pointer(objv + 1*8)), prefixObj)
	}
	if mPtr == uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = prefixObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return TCL_ERROR
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOODefineMethodObjCmd --
//	Implementation of the "method" subcommand of the "oo::define" and
//	"oo::objdefine" commands.
//
// ----------------------------------------------------------------------

func XTclOODefineMethodObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1548:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var isInstanceMethod int32 = libc.Bool32(clientData != uintptr(0))
	var oPtr uintptr
	var isPublic int32

	if objc != 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52218)
		return TCL_ERROR
	}

	oPtr = XTclOOGetDefineCmdContext(tls, interp)
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	if !(isInstanceMethod != 0) && !(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}
	if XTcl_StringMatch(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}(), ts+49155) != 0 {
		isPublic = PUBLIC_METHOD
	} else {
		isPublic = 0
	}

	// Create the method by using the right back-end API.

	if isInstanceMethod != 0 {
		if XTclOONewProcInstanceMethod(tls, interp, oPtr, isPublic, *(*uintptr)(unsafe.Pointer(objv + 1*8)),
			*(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(objv + 3*8)), uintptr(0)) == uintptr(0) {
			return TCL_ERROR
		}
	} else {
		if XTclOONewProcMethod(tls, interp, (*Object)(unsafe.Pointer(oPtr)).FclassPtr, isPublic, *(*uintptr)(unsafe.Pointer(objv + 1*8)),
			*(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(objv + 3*8)), uintptr(0)) == uintptr(0) {
			return TCL_ERROR
		}
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOODefineRenameMethodObjCmd --
//	Implementation of the "renamemethod" subcommand of the "oo::define"
//	and "oo::objdefine" commands.
//
// ----------------------------------------------------------------------

func XTclOODefineRenameMethodObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1605:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var isInstanceRenameMethod int32 = libc.Bool32(clientData != uintptr(0))
	var oPtr uintptr

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15892)
		return TCL_ERROR
	}

	oPtr = XTclOOGetDefineCmdContext(tls, interp)
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	if !(isInstanceRenameMethod != 0) && !(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}

	// Delete the method entry from the appropriate hash table, and transfer
	// the thing it points to to its new entry. To do this, we first need to
	// get the entries from the appropriate hash tables (this can generate a
	// range of errors...)

	if sRenameDeleteMethod(tls, interp, oPtr, libc.BoolInt32(!(isInstanceRenameMethod != 0)),
		*(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(objv + 2*8))) != TCL_OK {
		return TCL_ERROR
	}

	if isInstanceRenameMethod != 0 {
		(*Object)(unsafe.Pointer(oPtr)).Fepoch++
	} else {
		sBumpGlobalEpoch(tls, interp, (*Object)(unsafe.Pointer(oPtr)).FclassPtr)
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOODefineUnexportObjCmd --
//	Implementation of the "unexport" subcommand of the "oo::define" and
//	"oo::objdefine" commands.
//
// ----------------------------------------------------------------------

func XTclOODefineUnexportObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1661:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var isInstanceUnexport int32 = libc.Bool32(clientData != uintptr(0))
	var oPtr uintptr
	var mPtr uintptr
	var hPtr uintptr
	var clsPtr uintptr
	var i int32
	// var isNew int32 at bp+32, 4

	var changed int32 = 0

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12624)
		return TCL_ERROR
	}

	oPtr = XTclOOGetDefineCmdContext(tls, interp)
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	clsPtr = (*Object)(unsafe.Pointer(oPtr)).FclassPtr
	if !(isInstanceUnexport != 0) && !(clsPtr != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}

	for i = 1; i < objc; i++ {
		// Unexporting is done by removing the PUBLIC_METHOD flag from the
		// method record. If there is no such method in this object or class
		// (i.e. the method comes from something inherited from or that we're
		// an instance of) then we put in a blank record without that flag;
		// such records are skipped over by the call chain engine *except* for
		// their flags member.

		if isInstanceUnexport != 0 {
			if !(int32((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr) != 0) {
				(*Object)(unsafe.Pointer(oPtr)).FmethodsPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
				XTcl_InitObjHashTable(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)
				*(*int32)(unsafe.Pointer(oPtr + 92)) &= libc.CplInt32(USE_CLASS_CACHE)
			}
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FcreateProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+32 /* &isNew */)
		} else {
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(clsPtr + 112 /* &.classMethods */)).FcreateProc})).f(tls, clsPtr+112 /* &.classMethods */, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+32 /* &isNew */)
		}

		if *(*int32)(unsafe.Pointer(bp + 32)) != 0 {
			mPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Method{})))
			libc.Xmemset(tls, mPtr, 0, uint64(unsafe.Sizeof(Method{})))
			(*Method)(unsafe.Pointer(mPtr)).FrefCount = 1
			(*Method)(unsafe.Pointer(mPtr)).FnamePtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FrefCount++
			(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = mPtr
		} else {
			mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		}
		if *(*int32)(unsafe.Pointer(bp + 32)) != 0 || (*Method)(unsafe.Pointer(mPtr)).Fflags&PUBLIC_METHOD != 0 {
			*(*int32)(unsafe.Pointer(mPtr + 48)) &= libc.CplInt32(PUBLIC_METHOD)
			changed = 1
		}
	}

	// Bump the right epoch if we actually changed anything.

	if changed != 0 {
		if isInstanceUnexport != 0 {
			(*Object)(unsafe.Pointer(oPtr)).Fepoch++
		} else {
			sBumpGlobalEpoch(tls, interp, clsPtr)
		}
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// Tcl_ClassSetConstructor, Tcl_ClassSetDestructor --
//	How to install a constructor or destructor into a class; API to call
//	from C.
//
// ----------------------------------------------------------------------

func XTcl_ClassSetConstructor(tls *libc.TLS, interp uintptr, clazz Tcl_Class, method Tcl_Method) { /* tclOODefineCmds.c:1755:1: */
	var clsPtr uintptr = clazz

	if method != (*Class)(unsafe.Pointer(clsPtr)).FconstructorPtr {
		XTclOODelMethodRef(tls, (*Class)(unsafe.Pointer(clsPtr)).FconstructorPtr)
		(*Class)(unsafe.Pointer(clsPtr)).FconstructorPtr = method

		// Remember to invalidate the cached constructor chain for this class.
		// [Bug 2531577]

		if (*Class)(unsafe.Pointer(clsPtr)).FconstructorChainPtr != 0 {
			XTclOODeleteChain(tls, (*Class)(unsafe.Pointer(clsPtr)).FconstructorChainPtr)
			(*Class)(unsafe.Pointer(clsPtr)).FconstructorChainPtr = uintptr(0)
		}
		sBumpGlobalEpoch(tls, interp, clsPtr)
	}
}

func XTcl_ClassSetDestructor(tls *libc.TLS, interp uintptr, clazz Tcl_Class, method Tcl_Method) { /* tclOODefineCmds.c:1780:1: */
	var clsPtr uintptr = clazz

	if method != (*Class)(unsafe.Pointer(clsPtr)).FdestructorPtr {
		XTclOODelMethodRef(tls, (*Class)(unsafe.Pointer(clsPtr)).FdestructorPtr)
		(*Class)(unsafe.Pointer(clsPtr)).FdestructorPtr = method
		if (*Class)(unsafe.Pointer(clsPtr)).FdestructorChainPtr != 0 {
			XTclOODeleteChain(tls, (*Class)(unsafe.Pointer(clsPtr)).FdestructorChainPtr)
			(*Class)(unsafe.Pointer(clsPtr)).FdestructorChainPtr = uintptr(0)
		}
		sBumpGlobalEpoch(tls, interp, clsPtr)
	}
}

// ----------------------------------------------------------------------
//
// TclOODefineSlots --
//	Create the "::oo::Slot" class and its standard instances. Class
//	definition is empty at the stage (added by scripting).
//
// ----------------------------------------------------------------------

func XTclOODefineSlots(tls *libc.TLS, fPtr uintptr) int32 { /* tclOODefineCmds.c:1809:1: */
	var slotInfoPtr uintptr
	var getName uintptr = XTcl_NewStringObj(tls, ts+52233, -1)
	var setName uintptr = XTcl_NewStringObj(tls, ts+52237, -1)
	var slotCls uintptr

	slotCls = (*Object)(unsafe.Pointer(XTcl_NewObjectInstance(tls, (*Foundation)(unsafe.Pointer(fPtr)).Finterp, (*Foundation)(unsafe.Pointer(fPtr)).FclassCls, ts+52241, uintptr(0), -1, uintptr(0), 0))).FclassPtr
	if slotCls == uintptr(0) {
		return TCL_ERROR
	}
	(*Tcl_Obj)(unsafe.Pointer(getName)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(setName)).FrefCount++
	for slotInfoPtr = uintptr(unsafe.Pointer(&slots)); (*DeclaredSlot)(unsafe.Pointer(slotInfoPtr)).Fname != 0; slotInfoPtr += 88 {
		var slotObject Tcl_Object = XTcl_NewObjectInstance(tls, (*Foundation)(unsafe.Pointer(fPtr)).Finterp,
			slotCls, (*DeclaredSlot)(unsafe.Pointer(slotInfoPtr)).Fname, uintptr(0), -1, uintptr(0), 0)

		if slotObject == uintptr(0) {
			continue
		}
		XTcl_NewInstanceMethod(tls, (*Foundation)(unsafe.Pointer(fPtr)).Finterp, slotObject, getName, 0,
			slotInfoPtr+8, uintptr(0))
		XTcl_NewInstanceMethod(tls, (*Foundation)(unsafe.Pointer(fPtr)).Finterp, slotObject, setName, 0,
			slotInfoPtr+48, uintptr(0))
	}
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = getName
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = setName
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// ClassFilterGet, ClassFilterSet --
//	Implementation of the "filter" slot accessors of the "oo::define"
//	command.
//
// ----------------------------------------------------------------------

func sClassFilterGet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1852:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	var resultObj uintptr
	var filterObj uintptr
	var i int32

	if XTcl_ObjectContextSkippedArgs(tls, context) != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			uintptr(0))
		return TCL_ERROR
	}
	if oPtr == uintptr(0) {
		return TCL_ERROR
	} else if !(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Ffilters.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Ffilters.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			filterObj = *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Ffilters.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, filterObj)
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

func sClassFilterSet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1886:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	// var filterc int32 at bp+32, 4

	// var filterv uintptr at bp+40, 8

	if XTcl_ObjectContextSkippedArgs(tls, context)+1 != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			ts+52252)
		return TCL_ERROR
	}
	objv += 8 * uintptr(XTcl_ObjectContextSkippedArgs(tls, context))

	if oPtr == uintptr(0) {
		return TCL_ERROR
	} else if !(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	} else if XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp+32,
		bp+40) != TCL_OK {
		return TCL_ERROR
	}

	XTclOOClassSetFilters(tls, interp, (*Object)(unsafe.Pointer(oPtr)).FclassPtr, *(*int32)(unsafe.Pointer(bp + 32 /* filterc */)), *(*uintptr)(unsafe.Pointer(bp + 40 /* filterv */)))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// ClassMixinGet, ClassMixinSet --
//	Implementation of the "mixin" slot accessors of the "oo::define"
//	command.
//
// ----------------------------------------------------------------------

func sClassMixinGet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1931:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	var resultObj uintptr
	var mixinPtr uintptr
	var i int32

	if XTcl_ObjectContextSkippedArgs(tls, context) != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			uintptr(0))
		return TCL_ERROR
	}
	if oPtr == uintptr(0) {
		return TCL_ERROR
	} else if !(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fmixins.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			mixinPtr = *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fmixins.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj,
				XTclOOObjectName(tls, interp, (*Class)(unsafe.Pointer(mixinPtr)).FthisPtr))
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK

}

func sClassMixinSet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:1968:1: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	var oPtr uintptr
	// var mixinc int32 at bp+64, 4

	var i int32
	// var mixinv uintptr at bp+72, 8

	var mixins uintptr
	oPtr = XTclOOGetDefineCmdContext(tls, interp)

	if !(XTcl_ObjectContextSkippedArgs(tls, context)+1 != objc) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
		ts+52263)
	return TCL_ERROR
__1:
	;
	objv += 8 * uintptr(XTcl_ObjectContextSkippedArgs(tls, context))

	if !(oPtr == uintptr(0)) {
		goto __2
	}
	return TCL_ERROR
	goto __3
__2:
	if !!(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		goto __4
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+52173, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
	return TCL_ERROR
	goto __5
__4:
	if !(XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp+64,
		bp+72) != TCL_OK) {
		goto __6
	}
	return TCL_ERROR
__6:
	;
__5:
	;
__3:
	;

	mixins = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 64)))))

	i = 0
__7:
	if !(i < *(*int32)(unsafe.Pointer(bp + 64))) {
		goto __9
	}
	*(*uintptr)(unsafe.Pointer(mixins + uintptr(i)*8)) = sGetClassInOuterContext(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 /* mixinv */)) + uintptr(i)*8)),
		ts+52273)
	if !(*(*uintptr)(unsafe.Pointer(mixins + uintptr(i)*8)) == uintptr(0)) {
		goto __10
	}
	i--
	goto freeAndError
__10:
	;
	if !(XTclOOIsReachable(tls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr, *(*uintptr)(unsafe.Pointer(mixins + uintptr(i)*8))) != 0) {
		goto __11
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+52297, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+28514, ts+52329, uintptr(0)))
	goto freeAndError
__11:
	;
	goto __8
__8:
	i++
	goto __7
	goto __9
__9:
	;

	XTclOOClassSetMixins(tls, interp, (*Object)(unsafe.Pointer(oPtr)).FclassPtr, *(*int32)(unsafe.Pointer(bp + 64 /* mixinc */)), mixins)
	XTclStackFree(tls, interp, mixins)
	return TCL_OK

freeAndError:
	XTclStackFree(tls, interp, mixins)
	return TCL_ERROR
}

// ----------------------------------------------------------------------
//
// ClassSuperGet, ClassSuperSet --
//	Implementation of the "superclass" slot accessors of the "oo::define"
//	command.
//
// ----------------------------------------------------------------------

func sClassSuperGet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:2036:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	var resultObj uintptr
	var superPtr uintptr
	var i int32

	if XTcl_ObjectContextSkippedArgs(tls, context) != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			uintptr(0))
		return TCL_ERROR
	}
	if oPtr == uintptr(0) {
		return TCL_ERROR
	} else if !(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			superPtr = *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj,
				XTclOOObjectName(tls, interp, (*Class)(unsafe.Pointer(superPtr)).FthisPtr))
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

func sClassSuperSet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:2072:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	var oPtr uintptr
	// var superc int32 at bp+128, 4

	var i int32
	var j int32
	// var superv uintptr at bp+136, 8

	var superclasses uintptr
	var superPtr uintptr
	oPtr = XTclOOGetDefineCmdContext(tls, interp)

	if !(XTcl_ObjectContextSkippedArgs(tls, context)+1 != objc) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
		ts+52340)
	return TCL_ERROR
__1:
	;
	objv += 8 * uintptr(XTcl_ObjectContextSkippedArgs(tls, context))

	if !(oPtr == uintptr(0)) {
		goto __2
	}
	return TCL_ERROR
	goto __3
__2:
	if !!(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		goto __4
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+52173, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
	return TCL_ERROR
	goto __5
__4:
	if !(oPtr == (*Class)(unsafe.Pointer((*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).FobjectCls)).FthisPtr) {
		goto __6
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+52355, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+28514, ts+51589, uintptr(0)))
	return TCL_ERROR
	goto __7
__6:
	if !(XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp+128,
		bp+136) != TCL_OK) {
		goto __8
	}
	return TCL_ERROR
__8:
	;
__7:
	;
__5:
	;
__3:
	;

	// Allocate some working space.

	superclasses = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 128)))))

	// Parse the arguments to get the class to use as superclasses.
	//
	// Note that zero classes is special, as it is equivalent to just the
	// class of objects. [Bug 9d61624b3d]

	if !(*(*int32)(unsafe.Pointer(bp + 128)) == 0) {
		goto __9
	}
	superclasses = XTcl_Realloc(tls, superclasses, uint32(unsafe.Sizeof(uintptr(0))))
	if !(XTclOOIsReachable(tls, (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).FclassCls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		goto __11
	}
	*(*uintptr)(unsafe.Pointer(superclasses)) = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).FclassCls
	goto __12
__11:
	*(*uintptr)(unsafe.Pointer(superclasses)) = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FfPtr)).FobjectCls
__12:
	;
	*(*int32)(unsafe.Pointer(bp + 128 /* superc */)) = 1
	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(superclasses)))).FthisPtr)).FrefCount++
	goto __10
__9:
	i = 0
__13:
	if !(i < *(*int32)(unsafe.Pointer(bp + 128))) {
		goto __15
	}
	*(*uintptr)(unsafe.Pointer(superclasses + uintptr(i)*8)) = sGetClassInOuterContext(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136 /* superv */)) + uintptr(i)*8)),
		ts+52404)
	if !(*(*uintptr)(unsafe.Pointer(superclasses + uintptr(i)*8)) == uintptr(0)) {
		goto __16
	}
	goto failedAfterAlloc
__16:
	;
	j = 0
__17:
	if !(j < i) {
		goto __19
	}
	if !(*(*uintptr)(unsafe.Pointer(superclasses + uintptr(j)*8)) == *(*uintptr)(unsafe.Pointer(superclasses + uintptr(i)*8))) {
		goto __20
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+52437,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+28514, ts+52483, uintptr(0)))
	goto failedAfterAlloc
__20:
	;
	goto __18
__18:
	j++
	goto __17
	goto __19
__19:
	;
	if !(XTclOOIsReachable(tls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr, *(*uintptr)(unsafe.Pointer(superclasses + uintptr(i)*8))) != 0) {
		goto __21
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+52495, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+28514, ts+52537, uintptr(0)))
failedAfterAlloc:
	;
__22:
	if !(libc.PostDecInt32(&i, 1) > 0) {
		goto __24
	}
	XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(superclasses + uintptr(i)*8)))).FthisPtr)
	goto __23
__23:
	;
	goto __22
	goto __24
__24:
	;
	XTclpFree(tls, superclasses)
	return TCL_ERROR
__21:
	;

	// Corresponding TclOODecrRefCount() is near the end of this
	// function.

	(*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(superclasses + uintptr(i)*8)))).FthisPtr)).FrefCount++
	goto __14
__14:
	i++
	goto __13
	goto __15
__15:
	;
__10:
	;

	// Install the list of superclasses into the class. Note that this also
	// involves splicing the class out of the superclasses' subclass list that
	// it used to be a member of and splicing it into the new superclasses'
	// subclass list.

	if !((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Fnum != 0) {
		goto __25
	}
	i = 0
__26:
	if !(i < (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Fnum) {
		goto __28
	}
	if !(*(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __29
	}
	goto __27
	goto __30
__29:
	if !func() bool {
		superPtr = *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __31
	}
	XTclOORemoveFromSubclasses(tls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr, superPtr)
	XTclOODecrRefCount(tls, (*Class)(unsafe.Pointer(superPtr)).FthisPtr)
__31:
	;
__30:
	;
	goto __27
__27:
	i++
	goto __26
	goto __28
__28:
	;
	XTclpFree(tls, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Flist)
__25:
	;
	(*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Flist = superclasses
	(*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Fnum = *(*int32)(unsafe.Pointer(bp + 128 /* superc */))
	i = 0
__32:
	if !(i < (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Fnum) {
		goto __34
	}
	if !(*(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __35
	}
	goto __33
	goto __36
__35:
	if !func() bool {
		superPtr = *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fsuperclasses.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __37
	}
	XTclOOAddToSubclasses(tls, (*Object)(unsafe.Pointer(oPtr)).FclassPtr, superPtr)
__37:
	;
__36:
	;
	goto __33
__33:
	i++
	goto __32
	goto __34
__34:
	;
	sBumpGlobalEpoch(tls, interp, (*Object)(unsafe.Pointer(oPtr)).FclassPtr)

	return TCL_OK
}

// ----------------------------------------------------------------------
//
// ClassVarsGet, ClassVarsSet --
//	Implementation of the "variable" slot accessors of the "oo::define"
//	command.
//
// ----------------------------------------------------------------------

func sClassVarsGet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:2202:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	var resultObj uintptr
	var variableObj uintptr
	var i int32

	if XTcl_ObjectContextSkippedArgs(tls, context) != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			uintptr(0))
		return TCL_ERROR
	}
	if oPtr == uintptr(0) {
		return TCL_ERROR
	} else if !(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			variableObj = *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, variableObj)
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

func sClassVarsSet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:2236:1: */
	bp := tls.Alloc(236)
	defer tls.Free(236)

	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	// var varc int32 at bp+128, 4

	// var varv uintptr at bp+136, 8

	var variableObj uintptr
	var i int32

	if XTcl_ObjectContextSkippedArgs(tls, context)+1 != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			ts+52252)
		return TCL_ERROR
	}
	objv += 8 * uintptr(XTcl_ObjectContextSkippedArgs(tls, context))

	if oPtr == uintptr(0) {
		return TCL_ERROR
	} else if !(int32((*Object)(unsafe.Pointer(oPtr)).FclassPtr) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52173, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+51589, uintptr(0)))
		return TCL_ERROR
	} else if XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp+128,
		bp+136) != TCL_OK {
		return TCL_ERROR
	}

	for i = 0; i < *(*int32)(unsafe.Pointer(bp + 128 /* varc */)); i++ {
		var varName uintptr = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136 /* varv */)) + uintptr(i)*8)))

		if libc.Xstrstr(tls, varName, ts+6847) != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+52549,
				libc.VaList(bp+32, varName, ts+52598)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+28514, ts+52627, uintptr(0)))
			return TCL_ERROR
		}
		if XTcl_StringMatch(tls, varName, ts+52639) != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+52549,
				libc.VaList(bp+80, varName, ts+52644)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+28514, ts+52627, uintptr(0)))
			return TCL_ERROR
		}
	}

	for i = 0; i < *(*int32)(unsafe.Pointer(bp + 128 /* varc */)); i++ {
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)) + uintptr(i)*8)))).FrefCount++
	}
	for i = 0; i < (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			variableObj = *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = variableObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
	}
	if i != *(*int32)(unsafe.Pointer(bp + 128)) {
		if *(*int32)(unsafe.Pointer(bp + 128)) == 0 {
			XTclpFree(tls, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Flist)
		} else if i != 0 {
			(*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Flist = XTcl_Realloc(tls, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Flist, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 128)))))
		} else {
			(*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Flist = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 128)))))
		}
	}

	(*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Fnum = 0
	if *(*int32)(unsafe.Pointer(bp + 128)) > 0 {
		// var created int32 at bp+232, 4

		var n int32
		// var uniqueTable Tcl_HashTable at bp+144, 88

		XTcl_InitObjHashTable(tls, bp+144)
		for i = libc.AssignInt32(&n, 0); i < *(*int32)(unsafe.Pointer(bp + 128 /* varc */)); i++ {
			(*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp + 144 /* &uniqueTable */)).FcreateProc})).f(tls, bp+144 /* &uniqueTable */, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136 /* varv */)) + uintptr(i)*8)), bp+232 /* &created */)
			if *(*int32)(unsafe.Pointer(bp + 232)) != 0 {
				*(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Flist + uintptr(libc.PostIncInt32(&n, 1))*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136 /* varv */)) + uintptr(i)*8))
			} else {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)) + uintptr(i)*8))
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
		}
		(*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Fnum = n

		// Shouldn't be necessary, but maintain num/list invariant.

		(*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Flist = XTcl_Realloc(tls, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FclassPtr)).Fvariables.Flist, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(n)))
		XTcl_DeleteHashTable(tls, bp+144)
	}
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// ObjectFilterGet, ObjectFilterSet --
//	Implementation of the "filter" slot accessors of the "oo::objdefine"
//	command.
//
// ----------------------------------------------------------------------

func sObjFilterGet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:2344:1: */
	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	var resultObj uintptr
	var filterObj uintptr
	var i int32

	if XTcl_ObjectContextSkippedArgs(tls, context) != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			uintptr(0))
		return TCL_ERROR
	} else if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Ffilters.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			filterObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, filterObj)
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

func sObjFilterSet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:2372:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	// var filterc int32 at bp, 4

	// var filterv uintptr at bp+8, 8

	if XTcl_ObjectContextSkippedArgs(tls, context)+1 != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			ts+52252)
		return TCL_ERROR
	} else if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	objv += 8 * uintptr(XTcl_ObjectContextSkippedArgs(tls, context))
	if XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp,
		bp+8) != TCL_OK {
		return TCL_ERROR
	}

	XTclOOObjectSetFilters(tls, oPtr, *(*int32)(unsafe.Pointer(bp /* filterc */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* filterv */)))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// ObjectMixinGet, ObjectMixinSet --
//	Implementation of the "mixin" slot accessors of the "oo::objdefine"
//	command.
//
// ----------------------------------------------------------------------

func sObjMixinGet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:2411:1: */
	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	var resultObj uintptr
	var mixinPtr uintptr
	var i int32

	if XTcl_ObjectContextSkippedArgs(tls, context) != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			uintptr(0))
		return TCL_ERROR
	} else if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			if mixinPtr != 0 {
				XTcl_ListObjAppendElement(tls, uintptr(0), resultObj,
					XTclOOObjectName(tls, interp, (*Class)(unsafe.Pointer(mixinPtr)).FthisPtr))
			}
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

func sObjMixinSet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:2443:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	// var mixinc int32 at bp, 4

	// var mixinv uintptr at bp+8, 8

	var mixins uintptr
	var i int32

	if XTcl_ObjectContextSkippedArgs(tls, context)+1 != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			ts+52263)
		return TCL_ERROR
	} else if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	objv += 8 * uintptr(XTcl_ObjectContextSkippedArgs(tls, context))
	if XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp,
		bp+8) != TCL_OK {
		return TCL_ERROR
	}

	mixins = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp)))))

	for i = 0; i < *(*int32)(unsafe.Pointer(bp /* mixinc */)); i++ {
		*(*uintptr)(unsafe.Pointer(mixins + uintptr(i)*8)) = sGetClassInOuterContext(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* mixinv */)) + uintptr(i)*8)),
			ts+52273)
		if *(*uintptr)(unsafe.Pointer(mixins + uintptr(i)*8)) == uintptr(0) {
			XTclStackFree(tls, interp, mixins)
			return TCL_ERROR
		}
	}

	XTclOOObjectSetMixins(tls, oPtr, *(*int32)(unsafe.Pointer(bp /* mixinc */)), mixins)
	XTclStackFree(tls, interp, mixins)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// ObjectVarsGet, ObjectVarsSet --
//	Implementation of the "variable" slot accessors of the "oo::objdefine"
//	command.
//
// ----------------------------------------------------------------------

func sObjVarsGet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:2496:1: */
	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	var resultObj uintptr
	var variableObj uintptr
	var i int32

	if XTcl_ObjectContextSkippedArgs(tls, context) != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			uintptr(0))
		return TCL_ERROR
	} else if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fvariables.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			variableObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, variableObj)
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

func sObjVarsSet(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOODefineCmds.c:2524:1: */
	bp := tls.Alloc(204)
	defer tls.Free(204)

	var oPtr uintptr = XTclOOGetDefineCmdContext(tls, interp)
	// var varc int32 at bp+96, 4

	var i int32
	// var varv uintptr at bp+104, 8

	var variableObj uintptr

	if XTcl_ObjectContextSkippedArgs(tls, context)+1 != objc {
		XTcl_WrongNumArgs(tls, interp, XTcl_ObjectContextSkippedArgs(tls, context), objv,
			ts+52670)
		return TCL_ERROR
	} else if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	objv += 8 * uintptr(XTcl_ObjectContextSkippedArgs(tls, context))
	if XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp+96,
		bp+104) != TCL_OK {
		return TCL_ERROR
	}

	for i = 0; i < *(*int32)(unsafe.Pointer(bp + 96 /* varc */)); i++ {
		var varName uintptr = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104 /* varv */)) + uintptr(i)*8)))

		if libc.Xstrstr(tls, varName, ts+6847) != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+52549,
				libc.VaList(bp, varName, ts+52598)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+28514, ts+52627, uintptr(0)))
			return TCL_ERROR
		}
		if XTcl_StringMatch(tls, varName, ts+52639) != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+52549,
				libc.VaList(bp+48, varName, ts+52644)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+28514, ts+52627, uintptr(0)))
			return TCL_ERROR
		}
	}
	for i = 0; i < *(*int32)(unsafe.Pointer(bp + 96 /* varc */)); i++ {
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104)) + uintptr(i)*8)))).FrefCount++
	}

	for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fvariables.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			variableObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = variableObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
	}
	if i != *(*int32)(unsafe.Pointer(bp + 96)) {
		if *(*int32)(unsafe.Pointer(bp + 96)) == 0 {
			XTclpFree(tls, (*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist)
		} else if i != 0 {
			(*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist = XTcl_Realloc(tls, (*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 96)))))
		} else {
			(*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 96)))))
		}
	}
	(*Object)(unsafe.Pointer(oPtr)).Fvariables.Fnum = 0
	if *(*int32)(unsafe.Pointer(bp + 96)) > 0 {
		// var created int32 at bp+200, 4

		var n int32
		// var uniqueTable Tcl_HashTable at bp+112, 88

		XTcl_InitObjHashTable(tls, bp+112)
		for i = libc.AssignInt32(&n, 0); i < *(*int32)(unsafe.Pointer(bp + 96 /* varc */)); i++ {
			(*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp + 112 /* &uniqueTable */)).FcreateProc})).f(tls, bp+112 /* &uniqueTable */, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104 /* varv */)) + uintptr(i)*8)), bp+200 /* &created */)
			if *(*int32)(unsafe.Pointer(bp + 200)) != 0 {
				*(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist + uintptr(libc.PostIncInt32(&n, 1))*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104 /* varv */)) + uintptr(i)*8))
			} else {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104)) + uintptr(i)*8))
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
		}
		(*Object)(unsafe.Pointer(oPtr)).Fvariables.Fnum = n

		// Shouldn't be necessary, but maintain num/list invariant.

		(*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist = XTcl_Realloc(tls, (*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(n)))
		XTcl_DeleteHashTable(tls, bp+112)
	}
	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// List of commands that are used to implement the [info object] subcommands.

var infoObjectCmds = [13]EnsembleImplMap{
	{Fname: ts + 50591, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 16064, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52683, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52694, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 46989, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52702, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 50132, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52706, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52717, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 18781, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 18558, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 13299, Fproc: 0, FcompileProc: 0},
	{},
} /* tclOOInfo.c:50:30 */

// List of commands that are used to implement the [info class] subcommands.

var infoClassCmds = [14]EnsembleImplMap{
	{Fname: ts + 50591, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 25887, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52683, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 25899, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52694, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 46989, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52724, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 50132, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52706, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52717, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52734, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 52745, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 18558, Fproc: 0, FcompileProc: 0},
	{},
} /* tclOOInfo.c:70:30 */

// ----------------------------------------------------------------------
//
// TclOOInitInfo --
//
//	Adjusts the Tcl core [info] command to contain subcommands ("object"
//	and "class") for introspection of objects and classes.
//
// ----------------------------------------------------------------------

func XTclOOInitInfo(tls *libc.TLS, interp uintptr) { /* tclOOInfo.c:99:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var infoCmd Tcl_Command
	// var mapDict uintptr at bp, 8

	// Build the ensembles used to implement [info object] and [info class].

	XTclMakeEnsemble(tls, interp, ts+52758, uintptr(unsafe.Pointer(&infoObjectCmds)))
	XTclMakeEnsemble(tls, interp, ts+52775, uintptr(unsafe.Pointer(&infoClassCmds)))

	// Install into the [info] ensemble.

	infoCmd = XTcl_FindCommand(tls, interp, ts+13499, uintptr(0), TCL_GLOBAL_ONLY)
	if infoCmd != 0 {
		XTcl_GetEnsembleMappingDict(tls, uintptr(0), infoCmd, bp)
		XTcl_DictObjPut(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp /* mapDict */)), XTcl_NewStringObj(tls, ts+18716, -1),
			XTcl_NewStringObj(tls, ts+52758, -1))
		XTcl_DictObjPut(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp /* mapDict */)), XTcl_NewStringObj(tls, ts+16064, -1),
			XTcl_NewStringObj(tls, ts+52775, -1))
		XTcl_SetEnsembleMappingDict(tls, interp, infoCmd, *(*uintptr)(unsafe.Pointer(bp /* mapDict */)))
	}
}

// ----------------------------------------------------------------------
//
// GetClassFromObj --
//
//	How to correctly get a class from a Tcl_Obj. Just a wrapper round
//	Tcl_GetObjectFromObj, but this is an idiom that was used heavily.
//
// ----------------------------------------------------------------------

func sGetClassFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr) uintptr { /* tclOOInfo.c:138:21: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var oPtr uintptr = XTcl_GetObjectFromObj(tls, interp, objPtr)

	if oPtr == uintptr(0) {
		return uintptr(0)
	}
	if (*Object)(unsafe.Pointer(oPtr)).FclassPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+25445, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
				}
				return XTcl_GetString(tls, objPtr)
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+25465,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
				}
				return XTcl_GetString(tls, objPtr)
			}(), uintptr(0)))
		return uintptr(0)
	}
	return (*Object)(unsafe.Pointer(oPtr)).FclassPtr
}

// ----------------------------------------------------------------------
//
// InfoObjectClassCmd --
//
//	Implements [info object class $objName ?$className?]
//
// ----------------------------------------------------------------------

func sInfoObjectClassCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:169:1: */
	var oPtr uintptr

	if objc != 2 && objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52791)
		return TCL_ERROR
	}

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	if objc == 2 {
		XTcl_SetObjResult(tls, interp,
			XTclOOObjectName(tls, interp, (*Class1)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FselfCls)).FthisPtr))
		return TCL_OK
	} else {
		var mixinPtr uintptr
		var o2clsPtr uintptr
		var i int32

		o2clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		if o2clsPtr == uintptr(0) {
			return TCL_ERROR
		}

		for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
				continue
			} else if func() bool {
				mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8))
				return 1 != 0
			}() {
				if !(mixinPtr != 0) {
					continue
				}
				if XTclOOIsReachable(tls, o2clsPtr, mixinPtr) != 0 {
					XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, 1))
					return TCL_OK
				}
			}
		}
		XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls,
			XTclOOIsReachable(tls, o2clsPtr, (*Object)(unsafe.Pointer(oPtr)).FselfCls)))
		return TCL_OK
	}
	return int32(0)
}

// ----------------------------------------------------------------------
//
// InfoObjectDefnCmd --
//
//	Implements [info object definition $objName $methodName]
//
// ----------------------------------------------------------------------

func sInfoObjectDefnCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:226:1: */
	bp := tls.Alloc(104)
	defer tls.Free(104)

	var oPtr uintptr
	var hPtr uintptr
	var procPtr uintptr
	var localPtr uintptr
	// var resultObjs [2]uintptr at bp+88, 16

	var argObj uintptr

	if !(objc != 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52811)
	return TCL_ERROR
__1:
	;

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if !(oPtr == uintptr(0)) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	if !!(int32((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr) != 0) {
		goto __3
	}
	goto unknownMethod
__3:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(hPtr == uintptr(0)) {
		goto __4
	}
unknownMethod:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+25755, libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+25775,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}(), uintptr(0)))
	return TCL_ERROR
__4:
	;
	procPtr = XTclOOGetProcFromMethod(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	if !(procPtr == uintptr(0)) {
		goto __5
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+52830, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+7170, ts+25775,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}(), uintptr(0)))
	return TCL_ERROR
__5:
	;

	*(*uintptr)(unsafe.Pointer(bp + 88)) = XTcl_NewObj(tls)
	localPtr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr
__6:
	if !(localPtr != uintptr(0)) {
		goto __8
	}
	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_ARGUMENT != 0) {
		goto __9
	}

	argObj = XTcl_NewObj(tls)
	XTcl_ListObjAppendElement(tls, uintptr(0), argObj,
		XTcl_NewStringObj(tls, localPtr+40, -1))
	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr != uintptr(0)) {
		goto __10
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), argObj, (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr)
__10:
	;
	XTcl_ListObjAppendElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 88)), argObj)
__9:
	;
	goto __7
__7:
	localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr
	goto __6
	goto __8
__8:
	;
	*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)) = XTclOOGetMethodBody(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, 2, bp+88))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoObjectFiltersCmd --
//
//	Implements [info object filters $objName]
//
// ----------------------------------------------------------------------

func sInfoObjectFiltersCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:300:1: */
	var i int32
	var filterObj uintptr
	var resultObj uintptr
	var oPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52879)
		return TCL_ERROR
	}

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	resultObj = XTcl_NewObj(tls)

	for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Ffilters.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			filterObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Ffilters.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, filterObj)
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoObjectForwardCmd --
//
//	Implements [info object forward $objName $methodName]
//
// ----------------------------------------------------------------------

func sInfoObjectForwardCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:339:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	var oPtr uintptr
	var hPtr uintptr
	var prefixObj uintptr

	if !(objc != 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52811)
	return TCL_ERROR
__1:
	;

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if !(oPtr == uintptr(0)) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	if !!(int32((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr) != 0) {
		goto __3
	}
	goto unknownMethod
__3:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(hPtr == uintptr(0)) {
		goto __4
	}
unknownMethod:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+25755, libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+25775,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}(), uintptr(0)))
	return TCL_ERROR
__4:
	;
	prefixObj = XTclOOGetFwdFromMethod(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	if !(prefixObj == uintptr(0)) {
		goto __5
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+52887,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+7170, ts+25775,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}(), uintptr(0)))
	return TCL_ERROR
__5:
	;

	XTcl_SetObjResult(tls, interp, prefixObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoObjectIsACmd --
//
//	Implements [info object isa $category $objName ...]
//
// ----------------------------------------------------------------------

func sInfoObjectIsACmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:396:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var oPtr uintptr
	var o2Ptr uintptr
	// var idx int32 at bp, 4

	var i int32
	var result int32
	var mixinPtr uintptr
	result = 0

	if !(objc < 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52946)
	return TCL_ERROR
__1:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&categories)), int32(unsafe.Sizeof(uintptr(0))), ts+52973, 0, bp) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	// Now we know what test we are doing, we can check we've got the right
	// number of arguments.

	switch uint32(*(*int32)(unsafe.Pointer(bp /* idx */))) {
	case uint32(3) /* IsObject */ :
		goto __4
	case uint32(0) /* IsClass */ :
		goto __5
	case uint32(1) /* IsMetaclass */ :
		goto __6
	case uint32(2) /* IsMixin */ :
		goto __7
	case uint32(4) /* IsType */ :
		goto __8
	}
	goto __3
__4:
__5:
__6:
	if !(objc != 3) {
		goto __9
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+52879)
	return TCL_ERROR
__9:
	;
	goto __3
__7:
__8:
	if !(objc != 4) {
		goto __10
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+52982)
	return TCL_ERROR
__10:
	;
	goto __3
__3:
	;

	// Perform the check. Note that we can guarantee that we will not fail
	// from here on; "failures" result in a false-TCL_OK result.

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(oPtr == uintptr(0)) {
		goto __11
	}
	goto failPrecondition
__11:
	;

	switch uint32(*(*int32)(unsafe.Pointer(bp /* idx */))) {
	case uint32(3) /* IsObject */ :
		goto __13
	case uint32(0) /* IsClass */ :
		goto __14
	case uint32(1) /* IsMetaclass */ :
		goto __15
	case uint32(2) /* IsMixin */ :
		goto __16
	case uint32(4) /* IsType */ :
		goto __17
	}
	goto __12
__13:
	result = 1
	goto __12
__14:
	result = libc.Bool32((*Object)(unsafe.Pointer(oPtr)).FclassPtr != uintptr(0))
	goto __12
__15:
	if !((*Object)(unsafe.Pointer(oPtr)).FclassPtr != uintptr(0)) {
		goto __18
	}
	result = XTclOOIsReachable(tls, (*Foundation)(unsafe.Pointer(XTclOOGetFoundation(tls, interp))).FclassCls,
		(*Object)(unsafe.Pointer(oPtr)).FclassPtr)
__18:
	;
	goto __12
__16:
	o2Ptr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	if !(o2Ptr == uintptr(0)) {
		goto __19
	}
	goto failPrecondition
__19:
	;
	if !((*Object)(unsafe.Pointer(o2Ptr)).FclassPtr != uintptr(0)) {
		goto __20
	}

	i = 0
__21:
	if !(i < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum) {
		goto __23
	}
	if !(*(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __24
	}
	goto __22
	goto __25
__24:
	if !func() bool {
		mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __26
	}
	if !!(mixinPtr != 0) {
		goto __27
	}
	goto __22
__27:
	;
	if !(XTclOOIsReachable(tls, (*Object)(unsafe.Pointer(o2Ptr)).FclassPtr, mixinPtr) != 0) {
		goto __28
	}
	result = 1
	goto __23
__28:
	;
__26:
	;
__25:
	;
	goto __22
__22:
	i++
	goto __21
	goto __23
__23:
	;
__20:
	;
	goto __12
__17:
	o2Ptr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	if !(o2Ptr == uintptr(0)) {
		goto __29
	}
	goto failPrecondition
__29:
	;
	if !((*Object)(unsafe.Pointer(o2Ptr)).FclassPtr != uintptr(0)) {
		goto __30
	}
	result = XTclOOIsReachable(tls, (*Object)(unsafe.Pointer(o2Ptr)).FclassPtr, (*Object)(unsafe.Pointer(oPtr)).FselfCls)
__30:
	;
	goto __12
__12:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(result != 0)))
	return TCL_OK

failPrecondition:
	XTcl_ResetResult(tls, interp)
	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(0 != 0)))
	return TCL_OK
}

var categories = [6]uintptr{
	ts + 16064, ts + 53000, ts + 53010, ts + 18716, ts + 53016, uintptr(0),
} /* tclOOInfo.c:402:23 */

// ----------------------------------------------------------------------
//
// InfoObjectMethodsCmd --
//
//	Implements [info object methods $objName ?$option ...?]
//
// ----------------------------------------------------------------------

func sInfoObjectMethodsCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:515:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var oPtr uintptr
	var flag int32 = PUBLIC_METHOD
	var recurse int32 = 0
	var hPtr uintptr
	// var search Tcl_HashSearch at bp+16, 24

	var namePtr uintptr
	var resultObj uintptr
	var mPtr uintptr

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+53023)
		return TCL_ERROR
	}
	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	if objc != 2 {
		var i int32
		// var idx int32 at bp, 4

		for i = 2; i < objc; i++ {
			if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options17)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp) != TCL_OK {
				return TCL_ERROR
			}
			switch uint32(*(*int32)(unsafe.Pointer(bp /* idx */))) {
			case uint32(0) /* OPT_ALL */ :
				recurse = 1
				break
				fallthrough
			case uint32(1) /* OPT_LOCALPRIVATE */ :
				flag = PRIVATE_METHOD
				break
				fallthrough
			case uint32(2) /* OPT_PRIVATE */ :
				flag = 0
				break
			}
		}
	}

	resultObj = XTcl_NewObj(tls)
	if recurse != 0 {
		// var names uintptr at bp+8, 8

		var i int32
		var numNames int32 = XTclOOGetSortedMethodList(tls, oPtr, flag, bp+8)

		for i = 0; i < numNames; i++ {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj,
				XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* names */)) + uintptr(i)*8)), -1))
		}
		if numNames > 0 {
			XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
		}
	} else if (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr != 0 {
		for hPtr = XTcl_FirstHashEntry(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, bp+16); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					namePtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+16) {
			if (*Method)(unsafe.Pointer(mPtr)).FtypePtr != uintptr(0) && (*Method)(unsafe.Pointer(mPtr)).Fflags&flag == flag {
				XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, namePtr)
			}
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

var options17 = [4]uintptr{
	ts + 14862, ts + 53051, ts + 53065, uintptr(0),
} /* tclOOInfo.c:526:23 */

// ----------------------------------------------------------------------
//
// InfoObjectMethodTypeCmd --
//
//	Implements [info object methodtype $objName $methodName]
//
// ----------------------------------------------------------------------

func sInfoObjectMethodTypeCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:597:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var oPtr uintptr
	var hPtr uintptr
	var mPtr uintptr

	if !(objc != 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52811)
	return TCL_ERROR
__1:
	;

	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if !(oPtr == uintptr(0)) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	if !!(int32((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr) != 0) {
		goto __3
	}
	goto unknownMethod
__3:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FfindProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(hPtr == uintptr(0)) {
		goto __4
	}
unknownMethod:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+25755, libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+25775,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}(), uintptr(0)))
	return TCL_ERROR
__4:
	;
	mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !((*Method)(unsafe.Pointer(mPtr)).FtypePtr == uintptr(0)) {
		goto __5
	}
	// Special entry for visibility control: pretend the method doesnt
	// exist.

	goto unknownMethod
__5:
	;

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, (*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).Fname, -1))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoObjectMixinsCmd --
//
//	Implements [info object mixins $objName]
//
// ----------------------------------------------------------------------

func sInfoObjectMixinsCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:654:1: */
	var mixinPtr uintptr
	var oPtr uintptr
	var resultObj uintptr
	var i int32

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52879)
		return TCL_ERROR
	}
	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fmixins.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			mixinPtr = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fmixins.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			if !(mixinPtr != 0) {
				continue
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj,
				XTclOOObjectName(tls, interp, (*Class)(unsafe.Pointer(mixinPtr)).FthisPtr))
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoObjectNsCmd --
//
//	Implements [info object namespace $objName]
//
// ----------------------------------------------------------------------

func sInfoObjectNsCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:697:1: */
	var oPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52879)
		return TCL_ERROR
	}
	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp,
		XTcl_NewStringObj(tls, (*Tcl_Namespace)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FnamespacePtr)).FfullName, -1))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoObjectVariablesCmd --
//
//	Implements [info object variables $objName]
//
// ----------------------------------------------------------------------

func sInfoObjectVariablesCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:730:1: */
	var oPtr uintptr
	var variableObj uintptr
	var resultObj uintptr
	var i int32

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52879)
		return TCL_ERROR
	}
	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Object)(unsafe.Pointer(oPtr)).Fvariables.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			variableObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).Fvariables.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, variableObj)
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoObjectVarsCmd --
//
//	Implements [info object vars $objName ?$pattern?]
//
// ----------------------------------------------------------------------

func sInfoObjectVarsCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:768:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var oPtr uintptr
	var pattern uintptr = uintptr(0)
	var hPtr uintptr
	// var search Tcl_HashSearch at bp, 24

	var vihPtr uintptr
	var nameObj uintptr
	var resultObj uintptr

	if objc != 2 && objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+53074)
		return TCL_ERROR
	}
	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}
	if objc == 3 {
		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}()
	}
	resultObj = XTcl_NewObj(tls)

	// Extract the information we need from the object's namespace's table of
	// variables. Note that this involves horrific knowledge of the guts of
	// tclVar.c, so we can't leverage our hash-iteration macros properly.

	for hPtr = XTcl_FirstHashEntry(tls, (*Object)(unsafe.Pointer(oPtr)).FnamespacePtr+248, bp); func() int32 {
		if hPtr != uintptr(0) {
			return func() int32 { vihPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData; return 1 }()
		}
		return 0
	}() != 0; hPtr = XTcl_NextHashEntry(tls, bp) {
		nameObj = *(*uintptr)(unsafe.Pointer(vihPtr + 24 + 32))

		if *(*uintptr)(unsafe.Pointer(vihPtr + 8)) == uintptr(0) ||
			!((*Var)(unsafe.Pointer(vihPtr)).Fflags&VAR_NAMESPACE_VAR != 0) {
			continue
		}
		if pattern != uintptr(0) &&
			!(XTcl_StringMatch(tls, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes
				}
				return XTcl_GetString(tls, nameObj)
			}(), pattern) != 0) {
			continue
		}
		XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, nameObj)
	}

	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassConstrCmd --
//
//	Implements [info class constructor $clsName]
//
// ----------------------------------------------------------------------

func sInfoClassConstrCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:829:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var procPtr uintptr
	var localPtr uintptr
	// var resultObjs [2]uintptr at bp+32, 16

	var clsPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25435)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}
	if (*Class)(unsafe.Pointer(clsPtr)).FconstructorPtr == uintptr(0) {
		return TCL_OK
	}
	procPtr = XTclOOGetProcFromMethod(tls, (*Class)(unsafe.Pointer(clsPtr)).FconstructorPtr)
	if procPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52830, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+53092, uintptr(0)))
		return TCL_ERROR
	}

	*(*uintptr)(unsafe.Pointer(bp + 32)) = XTcl_NewObj(tls)
	for localPtr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr; localPtr != uintptr(0); localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr {
		if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_ARGUMENT != 0 {
			var argObj uintptr

			argObj = XTcl_NewObj(tls)
			XTcl_ListObjAppendElement(tls, uintptr(0), argObj,
				XTcl_NewStringObj(tls, localPtr+40, -1))
			if (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr != uintptr(0) {
				XTcl_ListObjAppendElement(tls, uintptr(0), argObj, (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr)
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 32)), argObj)
		}
	}
	*(*uintptr)(unsafe.Pointer(bp + 32 + 1*8)) = XTclOOGetMethodBody(tls, (*Class)(unsafe.Pointer(clsPtr)).FconstructorPtr)
	XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, 2, bp+32))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassDefnCmd --
//
//	Implements [info class definition $clsName $methodName]
//
// ----------------------------------------------------------------------

func sInfoClassDefnCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:890:1: */
	bp := tls.Alloc(104)
	defer tls.Free(104)

	var hPtr uintptr
	var procPtr uintptr
	var localPtr uintptr
	// var resultObjs [2]uintptr at bp+88, 16

	var clsPtr uintptr

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25712)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(clsPtr + 112 /* &.classMethods */)).FfindProc})).f(tls, clsPtr+112 /* &.classMethods */, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if hPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+25755, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+25775,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
			}(), uintptr(0)))
		return TCL_ERROR
	}
	procPtr = XTclOOGetProcFromMethod(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	if procPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52830, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+7170, ts+25775,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
			}(), uintptr(0)))
		return TCL_ERROR
	}

	*(*uintptr)(unsafe.Pointer(bp + 88)) = XTcl_NewObj(tls)
	for localPtr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr; localPtr != uintptr(0); localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr {
		if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_ARGUMENT != 0 {
			var argObj uintptr

			argObj = XTcl_NewObj(tls)
			XTcl_ListObjAppendElement(tls, uintptr(0), argObj,
				XTcl_NewStringObj(tls, localPtr+40, -1))
			if (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr != uintptr(0) {
				XTcl_ListObjAppendElement(tls, uintptr(0), argObj, (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr)
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 88)), argObj)
		}
	}
	*(*uintptr)(unsafe.Pointer(bp + 88 + 1*8)) = XTclOOGetMethodBody(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, 2, bp+88))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassDestrCmd --
//
//	Implements [info class destructor $clsName]
//
// ----------------------------------------------------------------------

func sInfoClassDestrCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:958:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var procPtr uintptr
	var clsPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25435)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}

	if (*Class)(unsafe.Pointer(clsPtr)).FdestructorPtr == uintptr(0) {
		return TCL_OK
	}
	procPtr = XTclOOGetProcFromMethod(tls, (*Class)(unsafe.Pointer(clsPtr)).FdestructorPtr)
	if procPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52830, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+53092, uintptr(0)))
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, XTclOOGetMethodBody(tls, (*Class)(unsafe.Pointer(clsPtr)).FdestructorPtr))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassFiltersCmd --
//
//	Implements [info class filters $clsName]
//
// ----------------------------------------------------------------------

func sInfoClassFiltersCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:1002:1: */
	var i int32
	var filterObj uintptr
	var resultObj uintptr
	var clsPtr uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25435)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Ffilters.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Ffilters.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			filterObj = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Ffilters.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, filterObj)
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassForwardCmd --
//
//	Implements [info class forward $clsName $methodName]
//
// ----------------------------------------------------------------------

func sInfoClassForwardCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:1040:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	var hPtr uintptr
	var prefixObj uintptr
	var clsPtr uintptr

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25712)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(clsPtr + 112 /* &.classMethods */)).FfindProc})).f(tls, clsPtr+112 /* &.classMethods */, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if hPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+25755, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+25775,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
			}(), uintptr(0)))
		return TCL_ERROR
	}
	prefixObj = XTclOOGetFwdFromMethod(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	if prefixObj == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+52887,
			-1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+7170, ts+25775,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
			}(), uintptr(0)))
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, prefixObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassInstancesCmd --
//
//	Implements [info class instances $clsName ?$pattern?]
//
// ----------------------------------------------------------------------

func sInfoClassInstancesCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:1091:1: */
	var oPtr uintptr
	var clsPtr uintptr
	var i int32
	var pattern uintptr = uintptr(0)
	var resultObj uintptr

	if objc != 2 && objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+53104)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}
	if objc == 3 {
		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}()
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Finstances.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			oPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Finstances.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			var tmpObj uintptr = XTclOOObjectName(tls, interp, oPtr)

			if pattern != 0 && !(XTcl_StringMatch(tls, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes
				}
				return XTcl_GetString(tls, tmpObj)
			}(), pattern) != 0) {
				continue
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, tmpObj)
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassMethodsCmd --
//
//	Implements [info class methods $clsName ?-private?]
//
// ----------------------------------------------------------------------

func sInfoClassMethodsCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:1139:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var flag int32 = PUBLIC_METHOD
	var recurse int32 = 0
	var namePtr uintptr
	var resultObj uintptr
	var mPtr uintptr
	var clsPtr uintptr

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+53124)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}
	if objc != 2 {
		var i int32
		// var idx int32 at bp, 4

		for i = 2; i < objc; i++ {
			if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&options18)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp) != TCL_OK {
				return TCL_ERROR
			}
			switch uint32(*(*int32)(unsafe.Pointer(bp /* idx */))) {
			case uint32(0) /* OPT_ALL */ :
				recurse = 1
				break
				fallthrough
			case uint32(1) /* OPT_LOCALPRIVATE */ :
				flag = PRIVATE_METHOD
				break
				fallthrough
			case uint32(2) /* OPT_PRIVATE */ :
				flag = 0
				break
			}
		}
	}

	resultObj = XTcl_NewObj(tls)
	if recurse != 0 {
		// var names uintptr at bp+8, 8

		var i int32
		var numNames int32 = XTclOOGetSortedClassMethodList(tls, clsPtr, flag, bp+8)

		for i = 0; i < numNames; i++ {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj,
				XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* names */)) + uintptr(i)*8)), -1))
		}
		if numNames > 0 {
			XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
		}
	} else {
		var hPtr uintptr
		// var search Tcl_HashSearch at bp+16, 24

		for hPtr = XTcl_FirstHashEntry(tls, clsPtr+112, bp+16); func() int32 {
			if hPtr != uintptr(0) {
				return func() int32 {
					namePtr = func() uintptr {
						if (*Tcl_HashTable)(unsafe.Pointer(clsPtr+112)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(clsPtr+112)).FkeyType == -1 {
							return *(*uintptr)(unsafe.Pointer(hPtr + 32))
						}
						return hPtr + 32
					}()
					mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
					return 1
				}()
			}
			return 0
		}() != 0; hPtr = XTcl_NextHashEntry(tls, bp+16) {
			if (*Method)(unsafe.Pointer(mPtr)).FtypePtr != uintptr(0) && (*Method)(unsafe.Pointer(mPtr)).Fflags&flag == flag {
				XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, namePtr)
			}
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

var options18 = [4]uintptr{
	ts + 14862, ts + 53051, ts + 53065, uintptr(0),
} /* tclOOInfo.c:1149:23 */

// ----------------------------------------------------------------------
//
// InfoClassMethodTypeCmd --
//
//	Implements [info class methodtype $clsName $methodName]
//
// ----------------------------------------------------------------------

func sInfoClassMethodTypeCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:1222:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var hPtr uintptr
	var mPtr uintptr
	var clsPtr uintptr

	if !(objc != 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25712)
	return TCL_ERROR
__1:
	;
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if !(clsPtr == uintptr(0)) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(clsPtr + 112 /* &.classMethods */)).FfindProc})).f(tls, clsPtr+112 /* &.classMethods */, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	if !(hPtr == uintptr(0)) {
		goto __3
	}
unknownMethod:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+25755, libc.VaList(bp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+25775,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}(), uintptr(0)))
	return TCL_ERROR
__3:
	;
	mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !((*Method)(unsafe.Pointer(mPtr)).FtypePtr == uintptr(0)) {
		goto __4
	}
	// Special entry for visibility control: pretend the method doesnt
	// exist.

	goto unknownMethod
__4:
	;
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, (*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).Fname, -1))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassMixinsCmd --
//
//	Implements [info class mixins $clsName]
//
// ----------------------------------------------------------------------

func sInfoClassMixinsCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:1274:1: */
	var clsPtr uintptr
	var mixinPtr uintptr
	var resultObj uintptr
	var i int32

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25435)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Fmixins.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			mixinPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fmixins.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			if !(mixinPtr != 0) {
				continue
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj,
				XTclOOObjectName(tls, interp, (*Class)(unsafe.Pointer(mixinPtr)).FthisPtr))
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassSubsCmd --
//
//	Implements [info class subclasses $clsName ?$pattern?]
//
// ----------------------------------------------------------------------

func sInfoClassSubsCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:1316:1: */
	var clsPtr uintptr
	var subclassPtr uintptr
	var resultObj uintptr
	var i int32
	var pattern uintptr = uintptr(0)

	if objc != 2 && objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+53104)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}
	if objc == 3 {
		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		}()
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Fsubclasses.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsubclasses.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			subclassPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsubclasses.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			var tmpObj uintptr = XTclOOObjectName(tls, interp, (*Class)(unsafe.Pointer(subclassPtr)).FthisPtr)

			if pattern != 0 && !(XTcl_StringMatch(tls, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes
				}
				return XTcl_GetString(tls, tmpObj)
			}(), pattern) != 0) {
				continue
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, tmpObj)
		}
	}
	for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).FmixinSubs.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FmixinSubs.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			subclassPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FmixinSubs.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			var tmpObj uintptr = XTclOOObjectName(tls, interp, (*Class)(unsafe.Pointer(subclassPtr)).FthisPtr)

			if pattern != 0 && !(XTcl_StringMatch(tls, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes
				}
				return XTcl_GetString(tls, tmpObj)
			}(), pattern) != 0) {
				continue
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, tmpObj)
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassSupersCmd --
//
//	Implements [info class superclasses $clsName]
//
// ----------------------------------------------------------------------

func sInfoClassSupersCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:1371:1: */
	var clsPtr uintptr
	var superPtr uintptr
	var resultObj uintptr
	var i int32

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25435)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			superPtr = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fsuperclasses.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj,
				XTclOOObjectName(tls, interp, (*Class)(unsafe.Pointer(superPtr)).FthisPtr))
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassVariablesCmd --
//
//	Implements [info class variables $clsName]
//
// ----------------------------------------------------------------------

func sInfoClassVariablesCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:1410:1: */
	var clsPtr uintptr
	var variableObj uintptr
	var resultObj uintptr
	var i int32

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25435)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}

	resultObj = XTcl_NewObj(tls)
	for i = 0; i < (*Class)(unsafe.Pointer(clsPtr)).Fvariables.Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0) {
			continue
		} else if func() bool {
			variableObj = *(*uintptr)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).Fvariables.Flist + uintptr(i)*8))
			return 1 != 0
		}() {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, variableObj)
		}
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoObjectCallCmd --
//
//	Implements [info object call $objName $methodName]
//
// ----------------------------------------------------------------------

func sInfoObjectCallCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:1448:1: */
	var oPtr uintptr
	var contextPtr uintptr

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52811)
		return TCL_ERROR
	}
	oPtr = XTcl_GetObjectFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if oPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Get the call context and render its call chain.

	contextPtr = XTclOOGetCallContext(tls, oPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), PUBLIC_METHOD, uintptr(0))
	if contextPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+53154, -1))
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp,
		XTclOORenderCallChain(tls, interp, (*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr))
	XTclOODeleteContext(tls, contextPtr)
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// InfoClassCallCmd --
//
//	Implements [info class call $clsName $methodName]
//
// ----------------------------------------------------------------------

func sInfoClassCallCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclOOInfo.c:1493:1: */
	var clsPtr uintptr
	var callPtr uintptr

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25712)
		return TCL_ERROR
	}
	clsPtr = sGetClassFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	if clsPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Get an render the stereotypical call chain.

	callPtr = XTclOOGetStereotypeCallChain(tls, clsPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), PUBLIC_METHOD)
	if callPtr == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+53154, -1))
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTclOORenderCallChain(tls, interp, callPtr))
	XTclOODeleteChain(tls, callPtr)
	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------
// Macros and flag values used by Tcl bytecode compilation and execution
// modules inside the Tcl core but not used outside.
//----------------------------------------------------------------

// Simplified form to access AuxData.
//
// ClientData TclFetchAuxData(CompileEng *envPtr, int index);

// Form of TclRegisterLiteral with flags == 0. In that case, it is safe to
// cast away constness, and it is cleanest to do that here, all in one place.
//
// int TclRegisterNewLiteral(CompileEnv *envPtr, const char *bytes,
//			     int length);

// Form of TclRegisterLiteral with flags == LITERAL_CMD_NAME. In that case, it
// is safe to cast away constness, and it is cleanest to do that here, all in
// one place.
//
// int TclRegisterNewNSLiteral(CompileEnv *envPtr, const char *bytes,
//			       int length);

// Macro used to manually adjust the stack requirements; used in cases where
// the stack effect cannot be computed from the opcode and its operands, but
// is still known at compile time.
//
// void TclAdjustStackDepth(int delta, CompileEnv *envPtr);

// Macro used to update the stack requirements. It is called by the macros
// TclEmitOpCode, TclEmitInst1 and TclEmitInst4.
// Remark that the very last instruction of a bytecode always reduces the
// stack level: INST_DONE or INST_POP, so that the maxStackdepth is always
// updated.
//
// void TclUpdateStackReqs(unsigned char op, int i, CompileEnv *envPtr);

// Macros used to update the flag that indicates if we are at the start of a
// command, based on whether the opcode is INST_START_COMMAND.
//
// void TclUpdateAtCmdStart(unsigned char op, CompileEnv *envPtr);

// Macro to emit an opcode byte into a CompileEnv's code array. The ANSI C
// "prototype" for this macro is:
//
// void TclEmitOpcode(unsigned char op, CompileEnv *envPtr);

// Macros to emit an integer operand. The ANSI C "prototype" for these macros
// are:
//
// void TclEmitInt1(int i, CompileEnv *envPtr);
// void TclEmitInt4(int i, CompileEnv *envPtr);

// Macros to emit an instruction with signed or unsigned integer operands.
// Four byte integers are stored in "big-endian" order with the high order
// byte stored at the lowest address. The ANSI C "prototypes" for these macros
// are:
//
// void TclEmitInstInt1(unsigned char op, int i, CompileEnv *envPtr);
// void TclEmitInstInt4(unsigned char op, int i, CompileEnv *envPtr);

// Macro to push a Tcl object onto the Tcl evaluation stack. It emits the
// object's one or four byte array index into the CompileEnv's code array.
// These support, respectively, a maximum of 256 (2**8) and 2**32 objects in a
// CompileEnv. The ANSI C "prototype" for this macro is:
//
// void	TclEmitPush(int objIndex, CompileEnv *envPtr);

// Macros to update a (signed or unsigned) integer starting at a pointer. The
// two variants depend on the number of bytes. The ANSI C "prototypes" for
// these macros are:
//
// void TclStoreInt1AtPtr(int i, unsigned char *p);
// void TclStoreInt4AtPtr(int i, unsigned char *p);

// Macros to update instructions at a particular pc with a new op code and a
// (signed or unsigned) int operand. The ANSI C "prototypes" for these macros
// are:
//
// void TclUpdateInstInt1AtPc(unsigned char op, int i, unsigned char *pc);
// void TclUpdateInstInt4AtPc(unsigned char op, int i, unsigned char *pc);

// Macro to fix up a forward jump to point to the current code-generation
// position in the bytecode being created (the most common case). The ANSI C
// "prototypes" for this macro is:
//
// int TclFixupForwardJumpToHere(CompileEnv *envPtr, JumpFixup *fixupPtr,
//				 int threshold);

// Macros to get a signed integer (GET_INT{1,2}) or an unsigned int
// (GET_UINT{1,2}) from a pointer. There are two variants for each return type
// that depend on the number of bytes fetched. The ANSI C "prototypes" for
// these macros are:
//
// int TclGetInt1AtPtr(unsigned char *p);
// int TclGetInt4AtPtr(unsigned char *p);
// unsigned int TclGetUInt1AtPtr(unsigned char *p);
// unsigned int TclGetUInt4AtPtr(unsigned char *p);

// The TclGetInt1AtPtr macro is tricky because we want to do sign extension on
// the 1-byte value. Unfortunately the "char" type isn't signed on all
// platforms so sign-extension doesn't always happen automatically. Sometimes
// we can explicitly declare the pointer to be signed, but other times we have
// to explicitly sign-extend the value in software.

// Macros used to compute the minimum and maximum of two integers. The ANSI C
// "prototypes" for these macros are:
//
// int TclMin(int i, int j);
// int TclMax(int i, int j);

// Convenience macros for use when compiling bodies of commands. The ANSI C
// "prototype" for these macros are:
//
// static void		BODY(Tcl_Token *tokenPtr, int word);

// Convenience macro for use when compiling tokens to be pushed. The ANSI C
// "prototype" for this macro is:
//
// static void		CompileTokens(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp);

// Convenience macros for use when pushing literals. The ANSI C "prototype" for
// these macros are:
//
// static void		PushLiteral(CompileEnv *envPtr,
//			    const char *string, int length);
// static void		PushStringLiteral(CompileEnv *envPtr,
//			    const char *string);

// Macro to advance to the next token; it is more mnemonic than the address
// arithmetic that it replaces. The ANSI C "prototype" for this macro is:
//
// static Tcl_Token *	TokenAfter(Tcl_Token *tokenPtr);

// Macro to get the offset to the next instruction to be issued. The ANSI C
// "prototype" for this macro is:
//
// static int	CurrentOffset(CompileEnv *envPtr);

// Note: the exceptDepth is a bit of a misnomer: TEBC only needs the
// maximal depth of nested CATCH ranges in order to alloc runtime
// memory. These macros should compute precisely that? OTOH, the nesting depth
// of LOOP ranges is an interesting datum for debugging purposes, and that is
// what we compute now.
//
// static int	ExceptionRangeStarts(CompileEnv *envPtr, int index);
// static void	ExceptionRangeEnds(CompileEnv *envPtr, int index);
// static void	ExceptionRangeTarget(CompileEnv *envPtr, int index, LABEL);

// Check if there is an LVT for compiled locals

// Macros for making it easier to deal with tokens and DStrings.

// Macro that encapsulates an efficiency trick that avoids a function call for
// the simplest of compiles. The ANSI C "prototype" for this macro is:
//
// static void		CompileWord(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp, int word);

// TIP #280: Remember the per-word line information of the current command. An
// index is used instead of a pointer as recursive compilation may reallocate,
// i.e. move, the array. This is also the reason to save the nuloc now, it may
// change during the course of the function.
//
// Macro to encapsulate the variable definition and setup.

// Often want to issue one of two versions of an instruction based on whether
// the argument will fit in a single byte or not. This makes it much clearer.

// How to get an anonymous local variable (used for holding temporary values
// off the stack) or a local simple scalar.

// Flags bits used by TclPushVarName.

// DTrace probe macros (NOPs if DTrace support is not enabled).

// Define the following macros to enable debug logging of the DTrace proc,
// cmd, and inst probes. Note that this does _not_ require a platform with
// DTrace, it simply logs all probe output to /tmp/tclDTraceDebug-[pid].log.
//
// If the second macro is defined, logging to file starts immediately,
// otherwise only after the first call to [tcl::dtrace]. Note that the debug
// probe data is always computed, even when it is not logged to file.
//
// Defining the third macro enables debug logging of inst probes (disabled
// by default due to the significant performance impact).

//
// #define TCL_DTRACE_DEBUG 1
// #define TCL_DTRACE_DEBUG_LOG_ENABLED 1
// #define TCL_DTRACE_DEBUG_INST_PROBES 1

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Structure used to help delay computing names of objects or classes for
// [info frame] until needed, making invokation faster in the normal case.

type PNI = struct {
	Finterp uintptr
	Fmethod Tcl_Method
} /* tclOOMethod.c:24:1 */

// Structure used to contain all the information needed about a call frame
// used in a procedure-like method.

type PMFrameData = struct {
	FframePtr  uintptr
	FerrProc   uintptr
	FnameObj   uintptr
	Fcmd       Command
	Fefi       ExtraFrameInfo
	FoldCmdPtr uintptr
	Fpni       PNI
} /* tclOOMethod.c:46:3 */

// Structure used to pass information about variable resolution to the
// on-the-ground resolvers used when working with resolved compiled variables.

type OOResVarInfo = struct {
	Finfo            Tcl_ResolvedVarInfo
	FvariableObj     uintptr
	FcachedObjectVar Tcl_Var
} /* tclOOMethod.c:60:3 */

// The types of methods defined by the core OO system.

var procMethodType = Tcl_MethodType{
	Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 25917,
	FcallProc: 0, FdeleteProc: 0, FcloneProc: 0,
} /* tclOOMethod.c:108:29 */
var fwdMethodType = Tcl_MethodType{
	Fversion: TCL_OO_METHOD_VERSION_CURRENT, Fname: ts + 46989,
	FcallProc: 0, FdeleteProc: 0, FcloneProc: 0,
} /* tclOOMethod.c:112:29 */

// Helper macros (derived from things private to tclVar.c)

// ----------------------------------------------------------------------
//
// Tcl_NewInstanceMethod --
//
//	Attach a method to an object instance.
//
// ----------------------------------------------------------------------

func XTcl_NewInstanceMethod(tls *libc.TLS, interp uintptr, object Tcl_Object, nameObj uintptr, flags int32, typePtr uintptr, clientData ClientData) Tcl_Method { /* tclOOMethod.c:137:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var oPtr uintptr
	var mPtr uintptr
	var hPtr uintptr
	// var isNew int32 at bp, 4
	oPtr = object

	if !(nameObj == uintptr(0)) {
		goto __1
	}
	mPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Method{})))
	(*Method)(unsafe.Pointer(mPtr)).FnamePtr = uintptr(0)
	(*Method)(unsafe.Pointer(mPtr)).FrefCount = 1
	goto populate
__1:
	;
	if !!(int32((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr) != 0) {
		goto __2
	}
	(*Object)(unsafe.Pointer(oPtr)).FmethodsPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
	XTcl_InitObjHashTable(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)
	*(*int32)(unsafe.Pointer(oPtr + 92)) &= libc.CplInt32(USE_CLASS_CACHE)
__2:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer(oPtr)).FmethodsPtr)).FcreateProc})).f(tls, (*Object)(unsafe.Pointer(oPtr)).FmethodsPtr, nameObj, bp /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
		goto __3
	}
	mPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Method{})))
	(*Method)(unsafe.Pointer(mPtr)).FnamePtr = nameObj
	(*Method)(unsafe.Pointer(mPtr)).FrefCount = 1
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).FrefCount++
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = mPtr
	goto __4
__3:
	mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !((*Method)(unsafe.Pointer(mPtr)).FtypePtr != uintptr(0) && (*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FdeleteProc != uintptr(0)) {
		goto __5
	}
	(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FdeleteProc})).f(tls, (*Method)(unsafe.Pointer(mPtr)).FclientData)
__5:
	;
__4:
	;

populate:
	(*Method)(unsafe.Pointer(mPtr)).FtypePtr = typePtr
	(*Method)(unsafe.Pointer(mPtr)).FclientData = clientData
	(*Method)(unsafe.Pointer(mPtr)).Fflags = 0
	(*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr = oPtr
	(*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr = uintptr(0)
	if !(flags != 0) {
		goto __6
	}
	*(*int32)(unsafe.Pointer(mPtr + 48)) |= flags & (PUBLIC_METHOD | PRIVATE_METHOD)
__6:
	;
	(*Object)(unsafe.Pointer(oPtr)).Fepoch++
	return mPtr
}

// ----------------------------------------------------------------------
//
// Tcl_NewMethod --
//
//	Attach a method to a class.
//
// ----------------------------------------------------------------------

func XTcl_NewMethod(tls *libc.TLS, interp uintptr, cls Tcl_Class, nameObj uintptr, flags int32, typePtr uintptr, clientData ClientData) Tcl_Method { /* tclOOMethod.c:206:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var clsPtr uintptr
	var mPtr uintptr
	var hPtr uintptr
	// var isNew int32 at bp, 4
	clsPtr = cls

	if !(nameObj == uintptr(0)) {
		goto __1
	}
	mPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Method{})))
	(*Method)(unsafe.Pointer(mPtr)).FnamePtr = uintptr(0)
	(*Method)(unsafe.Pointer(mPtr)).FrefCount = 1
	goto populate
__1:
	;
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(clsPtr + 112 /* &.classMethods */)).FcreateProc})).f(tls, clsPtr+112 /* &.classMethods */, nameObj, bp /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
		goto __2
	}
	mPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Method{})))
	(*Method)(unsafe.Pointer(mPtr)).FrefCount = 1
	(*Method)(unsafe.Pointer(mPtr)).FnamePtr = nameObj
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).FrefCount++
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = mPtr
	goto __3
__2:
	mPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !((*Method)(unsafe.Pointer(mPtr)).FtypePtr != uintptr(0) && (*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FdeleteProc != uintptr(0)) {
		goto __4
	}
	(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FdeleteProc})).f(tls, (*Method)(unsafe.Pointer(mPtr)).FclientData)
__4:
	;
__3:
	;

populate:
	(*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer((*Class)(unsafe.Pointer(clsPtr)).FthisPtr)).FfPtr)).Fepoch++
	(*Method)(unsafe.Pointer(mPtr)).FtypePtr = typePtr
	(*Method)(unsafe.Pointer(mPtr)).FclientData = clientData
	(*Method)(unsafe.Pointer(mPtr)).Fflags = 0
	(*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr = uintptr(0)
	(*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr = clsPtr
	if !(flags != 0) {
		goto __5
	}
	*(*int32)(unsafe.Pointer(mPtr + 48)) |= flags & (PUBLIC_METHOD | PRIVATE_METHOD)
__5:
	;

	return mPtr
}

// ----------------------------------------------------------------------
//
// TclOODelMethodRef --
//
//	How to delete a method.
//
// ----------------------------------------------------------------------

func XTclOODelMethodRef(tls *libc.TLS, mPtr uintptr) { /* tclOOMethod.c:270:1: */
	if mPtr != uintptr(0) && libc.PostDecInt32(&(*Method)(unsafe.Pointer(mPtr)).FrefCount, 1) <= 1 {
		if (*Method)(unsafe.Pointer(mPtr)).FtypePtr != uintptr(0) && (*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FdeleteProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_MethodType)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FtypePtr)).FdeleteProc})).f(tls, (*Method)(unsafe.Pointer(mPtr)).FclientData)
		}
		if (*Method)(unsafe.Pointer(mPtr)).FnamePtr != uintptr(0) {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = (*Method)(unsafe.Pointer(mPtr)).FnamePtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}

		XTclpFree(tls, mPtr)
	}
}

// ----------------------------------------------------------------------
//
// TclOONewBasicMethod --
//
//	Helper that makes it cleaner to create very simple methods during
//	basic system initialization. Not suitable for general use.
//
// ----------------------------------------------------------------------

func XTclOONewBasicMethod(tls *libc.TLS, interp uintptr, clsPtr uintptr, dcm uintptr) { /* tclOOMethod.c:297:1: */
	var namePtr uintptr = XTcl_NewStringObj(tls, (*DeclaredClassMethod)(unsafe.Pointer(dcm)).Fname, -1)

	(*Tcl_Obj)(unsafe.Pointer(namePtr)).FrefCount++
	XTcl_NewMethod(tls, interp, clsPtr, namePtr,
		func() int32 {
			if (*DeclaredClassMethod)(unsafe.Pointer(dcm)).FisPublic != 0 {
				return PUBLIC_METHOD
			}
			return 0
		}(), dcm+16, uintptr(0))
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = namePtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
}

// ----------------------------------------------------------------------
//
// TclOONewProcInstanceMethod --
//
//	Create a new procedure-like method for an object.
//
// ----------------------------------------------------------------------

func XTclOONewProcInstanceMethod(tls *libc.TLS, interp uintptr, oPtr uintptr, flags int32, nameObj uintptr, argsObj uintptr, bodyObj uintptr, pmPtrPtr uintptr) uintptr { /* tclOOMethod.c:322:8: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var argsLen int32 at bp, 4

	var pmPtr uintptr
	var method Tcl_Method

	if XTcl_ListObjLength(tls, interp, argsObj, bp) != TCL_OK {
		return uintptr(0)
	}
	pmPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ProcedureMethod{})))
	libc.Xmemset(tls, pmPtr, 0, uint64(unsafe.Sizeof(ProcedureMethod{})))
	(*ProcedureMethod)(unsafe.Pointer(pmPtr)).Fversion = TCLOO_PROCEDURE_METHOD_VERSION
	(*ProcedureMethod)(unsafe.Pointer(pmPtr)).Fflags = flags & USE_DECLARER_NS
	(*ProcedureMethod)(unsafe.Pointer(pmPtr)).FrefCount = 1

	method = XTclOOMakeProcInstanceMethod(tls, interp, oPtr, flags, nameObj,
		argsObj, bodyObj, uintptr(unsafe.Pointer(&procMethodType)), pmPtr, pmPtr+8)
	if method == uintptr(0) {
		XTclpFree(tls, pmPtr)
	} else if pmPtrPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(pmPtrPtr)) = pmPtr
	}
	return method
}

// ----------------------------------------------------------------------
//
// TclOONewProcMethod --
//
//	Create a new procedure-like method for a class.
//
// ----------------------------------------------------------------------

func XTclOONewProcMethod(tls *libc.TLS, interp uintptr, clsPtr uintptr, flags int32, nameObj uintptr, argsObj uintptr, bodyObj uintptr, pmPtrPtr uintptr) uintptr { /* tclOOMethod.c:371:8: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var argsLen int32 at bp, 4
	// -1 => delete argsObj before exit
	var pmPtr uintptr
	var procName uintptr
	var method Tcl_Method

	if argsObj == uintptr(0) {
		*(*int32)(unsafe.Pointer(bp /* argsLen */)) = -1
		argsObj = XTcl_NewObj(tls)
		(*Tcl_Obj)(unsafe.Pointer(argsObj)).FrefCount++
		procName = ts + 49219 /* "<destructor>" */
	} else if XTcl_ListObjLength(tls, interp, argsObj, bp) != TCL_OK {
		return uintptr(0)
	} else {
		procName = func() uintptr {
			if nameObj == uintptr(0) {
				return ts + 49205
			}
			return func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes
				}
				return XTcl_GetString(tls, nameObj)
			}()
		}()
	}

	pmPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ProcedureMethod{})))
	libc.Xmemset(tls, pmPtr, 0, uint64(unsafe.Sizeof(ProcedureMethod{})))
	(*ProcedureMethod)(unsafe.Pointer(pmPtr)).Fversion = TCLOO_PROCEDURE_METHOD_VERSION
	(*ProcedureMethod)(unsafe.Pointer(pmPtr)).Fflags = flags & USE_DECLARER_NS
	(*ProcedureMethod)(unsafe.Pointer(pmPtr)).FrefCount = 1

	method = XTclOOMakeProcMethod(tls, interp, clsPtr, flags, nameObj, procName,
		argsObj, bodyObj, uintptr(unsafe.Pointer(&procMethodType)), pmPtr, pmPtr+8)

	if *(*int32)(unsafe.Pointer(bp)) == -1 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = argsObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if method == uintptr(0) {
		XTclpFree(tls, pmPtr)
	} else if pmPtrPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(pmPtrPtr)) = pmPtr
	}

	return method
}

// ----------------------------------------------------------------------
//
// TclOOMakeProcInstanceMethod --
//
//	The guts of the code to make a procedure-like method for an object.
//	Split apart so that it is easier for other extensions to reuse (in
//	particular, it frees them from having to pry so deeply into Tcl's
//	guts).
//
// ----------------------------------------------------------------------

func XTclOOMakeProcInstanceMethod(tls *libc.TLS, interp uintptr, oPtr uintptr, flags int32, nameObj uintptr, argsObj uintptr, bodyObj uintptr, typePtr uintptr, clientData ClientData, procPtrPtr uintptr) Tcl_Method { /* tclOOMethod.c:441:1: */
	bp := tls.Alloc(92)
	defer tls.Free(92)

	var iPtr uintptr = interp
	var procPtr uintptr

	if XTclCreateProc(tls, interp, uintptr(0), func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes
		}
		return XTcl_GetString(tls, nameObj)
	}(), argsObj, bodyObj,
		procPtrPtr) != TCL_OK {
		return uintptr(0)
	}
	procPtr = *(*uintptr)(unsafe.Pointer(procPtrPtr))
	(*Proc)(unsafe.Pointer(procPtr)).FcmdPtr = uintptr(0)

	if (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr != 0 {
		*(*CmdFrame)(unsafe.Pointer(bp /* context */)) = *(*CmdFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr))

		if (*CmdFrame)(unsafe.Pointer(bp)).Ftype == 2 {
			// Retrieve source information from the bytecode, if possible. If
			// the information is retrieved successfully, context.type will be
			// TCL_LOCATION_SOURCE and the reference held by
			// context.data.eval.path will be counted.

			XTclGetSrcInfoForPc(tls, bp)
		} else if (*CmdFrame)(unsafe.Pointer(bp)).Ftype == 4 {
			// The copy into 'context' up above has created another reference
			// to 'context.data.eval.path'; account for it.

			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FrefCount++
		}

		if (*CmdFrame)(unsafe.Pointer(bp)).Ftype == 4 {
			// We can account for source location within a proc only if the
			// proc body was not created by substitution.
			// (FIXME: check that this is sane and correct!)

			if (*CmdFrame)(unsafe.Pointer(bp)).Fline != 0 &&
				(*CmdFrame)(unsafe.Pointer(bp)).Fnline >= 4 && *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(bp)).Fline + 3*4)) >= 0 {
				// var isNew int32 at bp+88, 4

				var cfPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CmdFrame{})))
				var hPtr uintptr

				(*CmdFrame)(unsafe.Pointer(cfPtr)).Flevel = -1
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Ftype = (*CmdFrame)(unsafe.Pointer(bp /* &context */)).Ftype
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Fline = XTcl_Alloc(tls, uint32(unsafe.Sizeof(int32(0))))
				*(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(cfPtr)).Fline)) = *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(bp /* &context */)).Fline + 3*4))
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Fnline = 1
				(*CmdFrame)(unsafe.Pointer(cfPtr)).FframePtr = uintptr(0)
				(*CmdFrame)(unsafe.Pointer(cfPtr)).FnextPtr = uintptr(0)

				*(*uintptr)(unsafe.Pointer(cfPtr + 40)) = *(*uintptr)(unsafe.Pointer(bp + 40))
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cfPtr + 40)))).FrefCount++

				(*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd = uintptr(0)
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Flen = 0

				hPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)).FcreateProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr, procPtr, bp+88 /* &isNew */)
				(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cfPtr
			}

			// 'context' is going out of scope; account for the reference that
			// it's holding to the path name.

			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			*(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0)
		}
	}

	return XTcl_NewInstanceMethod(tls, interp, oPtr, nameObj, flags,
		typePtr, clientData)
}

// ----------------------------------------------------------------------
//
// TclOOMakeProcMethod --
//
//	The guts of the code to make a procedure-like method for a class.
//	Split apart so that it is easier for other extensions to reuse (in
//	particular, it frees them from having to pry so deeply into Tcl's
//	guts).
//
// ----------------------------------------------------------------------

func XTclOOMakeProcMethod(tls *libc.TLS, interp uintptr, clsPtr uintptr, flags int32, nameObj uintptr, namePtr uintptr, argsObj uintptr, bodyObj uintptr, typePtr uintptr, clientData ClientData, procPtrPtr uintptr) Tcl_Method { /* tclOOMethod.c:550:1: */
	bp := tls.Alloc(92)
	defer tls.Free(92)

	var iPtr uintptr = interp
	var procPtr uintptr

	if XTclCreateProc(tls, interp, uintptr(0), namePtr, argsObj, bodyObj,
		procPtrPtr) != TCL_OK {
		return uintptr(0)
	}
	procPtr = *(*uintptr)(unsafe.Pointer(procPtrPtr))
	(*Proc)(unsafe.Pointer(procPtr)).FcmdPtr = uintptr(0)

	if (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr != 0 {
		*(*CmdFrame)(unsafe.Pointer(bp /* context */)) = *(*CmdFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr))

		if (*CmdFrame)(unsafe.Pointer(bp)).Ftype == 2 {
			// Retrieve source information from the bytecode, if possible. If
			// the information is retrieved successfully, context.type will be
			// TCL_LOCATION_SOURCE and the reference held by
			// context.data.eval.path will be counted.

			XTclGetSrcInfoForPc(tls, bp)
		} else if (*CmdFrame)(unsafe.Pointer(bp)).Ftype == 4 {
			// The copy into 'context' up above has created another reference
			// to 'context.data.eval.path'; account for it.

			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FrefCount++
		}

		if (*CmdFrame)(unsafe.Pointer(bp)).Ftype == 4 {
			// We can account for source location within a proc only if the
			// proc body was not created by substitution.
			// (FIXME: check that this is sane and correct!)

			if (*CmdFrame)(unsafe.Pointer(bp)).Fline != 0 &&
				(*CmdFrame)(unsafe.Pointer(bp)).Fnline >= 4 && *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(bp)).Fline + 3*4)) >= 0 {
				// var isNew int32 at bp+88, 4

				var cfPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CmdFrame{})))
				var hPtr uintptr

				(*CmdFrame)(unsafe.Pointer(cfPtr)).Flevel = -1
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Ftype = (*CmdFrame)(unsafe.Pointer(bp /* &context */)).Ftype
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Fline = XTcl_Alloc(tls, uint32(unsafe.Sizeof(int32(0))))
				*(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(cfPtr)).Fline)) = *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(bp /* &context */)).Fline + 3*4))
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Fnline = 1
				(*CmdFrame)(unsafe.Pointer(cfPtr)).FframePtr = uintptr(0)
				(*CmdFrame)(unsafe.Pointer(cfPtr)).FnextPtr = uintptr(0)

				*(*uintptr)(unsafe.Pointer(cfPtr + 40)) = *(*uintptr)(unsafe.Pointer(bp + 40))
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cfPtr + 40)))).FrefCount++

				(*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd = uintptr(0)
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Flen = 0

				hPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)).FcreateProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr, procPtr, bp+88 /* &isNew */)
				(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cfPtr
			}

			// 'context' is going out of scope; account for the reference that
			// it's holding to the path name.

			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 40))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			*(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0)
		}
	}

	return XTcl_NewMethod(tls, interp, clsPtr, nameObj, flags, typePtr,
		clientData)
}

// ----------------------------------------------------------------------
//
// InvokeProcedureMethod, PushMethodCallFrame --
//
//	How to invoke a procedure-like method.
//
// ----------------------------------------------------------------------

func sInvokeProcedureMethod(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOOMethod.c:660:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var pmPtr uintptr = clientData
	var result int32
	var fdPtr uintptr // Important data that has to have a lifetime
	// matched by this function (or rather, by the
	// call frame's lifetime).

	// If the object namespace (or interpreter) were deleted, we just skip to
	// the next thing in the chain.

	if XTclOOObjectDestroyed(tls, (*CallContext)(unsafe.Pointer(context)).FoPtr) != 0 || XTcl_InterpDeleted(tls, interp) != 0 {
		return XTclNRObjectContextInvokeNext(tls, interp, context, objc, objv,
			XTcl_ObjectContextSkippedArgs(tls, context))
	}

	// Allocate the special frame data.

	fdPtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(PMFrameData{})))

	// Create a call frame for this method.

	result = sPushMethodCallFrame(tls, interp, context, pmPtr,
		objc, objv, fdPtr)
	if result != TCL_OK {
		XTclStackFree(tls, interp, fdPtr)
		return result
	}
	(*ProcedureMethod)(unsafe.Pointer(pmPtr)).FrefCount++

	// Give the pre-call callback a chance to do some setup and, possibly,
	// veto the call.

	if (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FpreCallProc != uintptr(0) {
		// var isFinished int32 at bp, 4

		result = (*struct {
			f func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*ProcedureMethod)(unsafe.Pointer(pmPtr)).FpreCallProc})).f(tls, (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FclientData, interp, context,
			(*PMFrameData)(unsafe.Pointer(fdPtr)).FframePtr, bp)
		if *(*int32)(unsafe.Pointer(bp)) != 0 || result != TCL_OK {
			// Restore the old cmdPtr so that a subsequent use of [info frame]
			// won't crash on us. [Bug 3001438]

			(*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FcmdPtr = (*PMFrameData)(unsafe.Pointer(fdPtr)).FoldCmdPtr

			XTcl_PopCallFrame(tls, interp)
			XTclStackFree(tls, interp, (*PMFrameData)(unsafe.Pointer(fdPtr)).FframePtr)
			if libc.PostDecInt32(&(*ProcedureMethod)(unsafe.Pointer(pmPtr)).FrefCount, 1) <= 1 {
				sDeleteProcedureMethodRecord(tls, pmPtr)
			}
			XTclStackFree(tls, interp, fdPtr)
			return result
		}
	}

	// Now invoke the body of the method.

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sFinalizePMCall}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = pmPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = context
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = fdPtr
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return XTclNRInterpProcCore(tls, interp, (*PMFrameData)(unsafe.Pointer(fdPtr)).FnameObj,
		XTcl_ObjectContextSkippedArgs(tls, context), (*PMFrameData)(unsafe.Pointer(fdPtr)).FerrProc)
}

func sFinalizePMCall(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOOMethod.c:741:1: */
	var pmPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var context Tcl_ObjectContext = *(*ClientData)(unsafe.Pointer(data + 1*8))
	var fdPtr uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))

	// Give the post-call callback a chance to do some cleanup. Note that at
	// this point the call frame itself is invalid; it's already been popped.

	if (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FpostCallProc != 0 {
		result = (*struct {
			f func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, uintptr, int32) int32
		})(unsafe.Pointer(&struct{ uintptr }{(*ProcedureMethod)(unsafe.Pointer(pmPtr)).FpostCallProc})).f(tls, (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FclientData, interp, context,
			XTcl_GetObjectNamespace(tls, XTcl_ObjectContextObject(tls, context)),
			result)
	}

	// Restore the old cmdPtr so that a subsequent use of [info frame] won't
	// crash on us. [Bug 3001438]

	(*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FcmdPtr = (*PMFrameData)(unsafe.Pointer(fdPtr)).FoldCmdPtr

	// Scrap the special frame data now that we're done with it. Note that we
	// are inlining DeleteProcedureMethod() here; this location is highly
	// sensitive when it comes to performance!

	if libc.PostDecInt32(&(*ProcedureMethod)(unsafe.Pointer(pmPtr)).FrefCount, 1) <= 1 {
		sDeleteProcedureMethodRecord(tls, pmPtr)
	}
	XTclStackFree(tls, interp, fdPtr)
	return result
}

func sPushMethodCallFrame(tls *libc.TLS, interp uintptr, contextPtr uintptr, pmPtr uintptr, objc int32, objv uintptr, fdPtr uintptr) int32 { /* tclOOMethod.c:782:1: */
	var nsPtr uintptr
	var result int32
	var namePtr uintptr
	var framePtrPtr uintptr
	var mPtr uintptr
	var codePtr uintptr
	var method Tcl_Method
	nsPtr = (*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).FnamespacePtr
	framePtrPtr = fdPtr

	// Compute basic information on the basis of the type of method it is.

	if !((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&CONSTRUCTOR != 0) {
		goto __1
	}
	namePtr = ts + 49205 /* "<constructor>" */
	(*PMFrameData)(unsafe.Pointer(fdPtr)).FnameObj = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).FfPtr)).FconstructorName
	(*PMFrameData)(unsafe.Pointer(fdPtr)).FerrProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr)
	}{sConstructorErrorHandler}))
	goto __2
__1:
	if !((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fflags&DESTRUCTOR != 0) {
		goto __3
	}
	namePtr = ts + 49219 /* "<destructor>" */
	(*PMFrameData)(unsafe.Pointer(fdPtr)).FnameObj = (*Foundation1)(unsafe.Pointer((*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).FfPtr)).FdestructorName
	(*PMFrameData)(unsafe.Pointer(fdPtr)).FerrProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr)
	}{sDestructorErrorHandler}))
	goto __4
__3:
	(*PMFrameData)(unsafe.Pointer(fdPtr)).FnameObj = XTcl_MethodName(tls,
		XTcl_ObjectContextMethod(tls, contextPtr))
	namePtr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer((*PMFrameData)(unsafe.Pointer(fdPtr)).FnameObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer((*PMFrameData)(unsafe.Pointer(fdPtr)).FnameObj)).Fbytes
		}
		return XTcl_GetString(tls, (*PMFrameData)(unsafe.Pointer(fdPtr)).FnameObj)
	}()
	(*PMFrameData)(unsafe.Pointer(fdPtr)).FerrProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr)
	}{sMethodErrorHandler}))
__4:
	;
__2:
	;
	if !((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FerrProc != uintptr(0)) {
		goto __5
	}
	(*PMFrameData)(unsafe.Pointer(fdPtr)).FerrProc = (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FerrProc
__5:
	;

	// Magic to enable things like [incr Tcl], which wants methods to run in
	// their class's namespace.

	if !((*ProcedureMethod)(unsafe.Pointer(pmPtr)).Fflags&USE_DECLARER_NS != 0) {
		goto __6
	}
	mPtr =
		(*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr

	if !((*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr != uintptr(0)) {
		goto __7
	}
	nsPtr = (*Object)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr)).FthisPtr)).FnamespacePtr
	goto __8
__7:
	nsPtr = (*Object1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr)).FnamespacePtr
__8:
	;
__6:
	;

	// Save the old cmdPtr so that when this recursive call returns, we can
	// restore it. To do otherwise causes crashes in [info frame] after we
	// return from a recursive call. [Bug 3001438]

	(*PMFrameData)(unsafe.Pointer(fdPtr)).FoldCmdPtr = (*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FcmdPtr

	// Compile the body. This operation may fail.

	(*PMFrameData)(unsafe.Pointer(fdPtr)).Fefi.Flength = 2
	libc.Xmemset(tls, fdPtr+24, 0, uint64(unsafe.Sizeof(Command{})))
	(*PMFrameData)(unsafe.Pointer(fdPtr)).Fcmd.FnsPtr = nsPtr
	(*PMFrameData)(unsafe.Pointer(fdPtr)).Fcmd.FclientData = fdPtr + 136
	(*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FcmdPtr = fdPtr + 24

	// [Bug 2037727] Always call TclProcCompileProc so that we check not only
	// that we have bytecode, but also that it remains valid. Note that we set
	// the namespace of the code here directly; this is a hack, but the
	// alternative is *so* slow...

	if !((*Tcl_Obj)(unsafe.Pointer((*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FbodyPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteCodeType))) {
		goto __9
	}
	codePtr =
		*(*uintptr)(unsafe.Pointer((*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FbodyPtr + 32))

	(*ByteCode)(unsafe.Pointer(codePtr)).FnsPtr = nsPtr
__9:
	;
	result = XTclProcCompileProc(tls, interp, (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr,
		(*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FbodyPtr, nsPtr, ts+25825, namePtr)
	if !(result != TCL_OK) {
		goto __10
	}
	goto failureReturn
__10:
	;

	// Make the stack frame and fill it out with information about this call.
	// This operation may fail.

	XTclPushStackFrame(tls, interp, framePtrPtr,
		nsPtr, FRAME_IS_PROC|FRAME_IS_METHOD)

	(*CallFrame)(unsafe.Pointer((*PMFrameData)(unsafe.Pointer(fdPtr)).FframePtr)).FclientData = contextPtr
	(*CallFrame)(unsafe.Pointer((*PMFrameData)(unsafe.Pointer(fdPtr)).FframePtr)).Fobjc = objc
	(*CallFrame)(unsafe.Pointer((*PMFrameData)(unsafe.Pointer(fdPtr)).FframePtr)).Fobjv = objv
	(*CallFrame)(unsafe.Pointer((*PMFrameData)(unsafe.Pointer(fdPtr)).FframePtr)).FprocPtr = (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr

	// Finish filling out the extra frame info so that [info frame] works.

	(*ExtraFrameInfoField)(unsafe.Pointer(fdPtr + 136 + 8)).Fname = ts + 25917 /* "method" */
	(*ExtraFrameInfoField)(unsafe.Pointer(fdPtr + 136 + 8)).Fproc = uintptr(0)
	(*ExtraFrameInfoField)(unsafe.Pointer(fdPtr + 136 + 8)).FclientData = (*PMFrameData)(unsafe.Pointer(fdPtr)).FnameObj
	if !((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FgfivProc != uintptr(0)) {
		goto __11
	}
	(*ExtraFrameInfoField)(unsafe.Pointer(fdPtr + 136 + 8 + 1*24)).Fname = ts + 2046 /* "" */
	(*ExtraFrameInfoField)(unsafe.Pointer(fdPtr + 136 + 8 + 1*24)).Fproc = (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FgfivProc
	(*ExtraFrameInfoField)(unsafe.Pointer(fdPtr + 136 + 8 + 1*24)).FclientData = pmPtr
	goto __12
__11:
	method =
		XTcl_ObjectContextMethod(tls, contextPtr)

	if !(XTcl_MethodDeclarerObject(tls, method) != uintptr(0)) {
		goto __13
	}
	(*ExtraFrameInfoField)(unsafe.Pointer(fdPtr + 136 + 8 + 1*24)).Fname = ts + 18716 /* "object" */
	goto __14
__13:
	(*ExtraFrameInfoField)(unsafe.Pointer(fdPtr + 136 + 8 + 1*24)).Fname = ts + 16064 /* "class" */
__14:
	;
	(*ExtraFrameInfoField)(unsafe.Pointer(fdPtr + 136 + 8 + 1*24)).Fproc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData) uintptr
	}{sRenderDeclarerName}))
	(*ExtraFrameInfoField)(unsafe.Pointer(fdPtr + 136 + 8 + 1*24)).FclientData = fdPtr + 200
	(*PMFrameData)(unsafe.Pointer(fdPtr)).Fpni.Finterp = interp
	(*PMFrameData)(unsafe.Pointer(fdPtr)).Fpni.Fmethod = method
__12:
	;

	return TCL_OK

	// Restore the old cmdPtr so that a subsequent use of [info frame] won't
	// crash on us. [Bug 3001438]

failureReturn:
	(*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FcmdPtr = (*PMFrameData)(unsafe.Pointer(fdPtr)).FoldCmdPtr
	return result
}

// ----------------------------------------------------------------------
//
// TclOOSetupVariableResolver, etc. --
//
//	Variable resolution engine used to connect declared variables to local
//	variables used in methods. The compiled variable resolver is more
//	important, but both are needed as it is possible to have a variable
//	that is only referred to in ways that aren't compilable and we can't
//	force LVT presence. [TIP #320]
//
// ----------------------------------------------------------------------

func XTclOOSetupVariableResolver(tls *libc.TLS, nsPtr uintptr) { /* tclOOMethod.c:939:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var info Tcl_ResolverInfo at bp, 24

	XTcl_GetNamespaceResolvers(tls, nsPtr, bp)
	if (*Tcl_ResolverInfo)(unsafe.Pointer(bp)).FcompiledVarResProc == uintptr(0) {
		XTcl_SetNamespaceResolvers(tls, nsPtr, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
		}{sProcedureMethodVarResolver})),
			*(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32
			}{sProcedureMethodCompiledVarResolver})))
	}
}

func sProcedureMethodVarResolver(tls *libc.TLS, interp uintptr, varName uintptr, contextNs uintptr, flags int32, varPtr uintptr) int32 { /* tclOOMethod.c:952:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var result int32
	*(*uintptr)(unsafe.Pointer(bp /* rPtr */)) = uintptr(0)

	result = sProcedureMethodCompiledVarResolver(tls, interp, varName,
		int32(libc.Xstrlen(tls, varName)), contextNs, bp)

	if result != TCL_OK {
		return result
	}

	*(*Tcl_Var)(unsafe.Pointer(varPtr)) = (*struct {
		f func(*libc.TLS, uintptr, uintptr) Tcl_Var
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ResolvedVarInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* rPtr */)))).FfetchProc})).f(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* rPtr */)))

	// Must not retain reference to resolved information. [Bug 3105999]

	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ResolvedVarInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* rPtr */)))).FdeleteProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp /* rPtr */)))
	return func() int32 {
		if *(*Tcl_Var)(unsafe.Pointer(varPtr)) != 0 {
			return TCL_OK
		}
		return TCL_CONTINUE
	}()
}

func sProcedureMethodCompiledVarConnect(tls *libc.TLS, interp uintptr, rPtr uintptr) Tcl_Var { /* tclOOMethod.c:980:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var infoPtr uintptr
	var iPtr uintptr
	var framePtr uintptr
	var contextPtr uintptr
	var variableObj uintptr
	var hPtr uintptr
	var i int32
	// var isNew int32 at bp+8, 4

	var cacheIt int32
	// var varLen int32 at bp, 4

	// var len int32 at bp+4, 4

	var match uintptr
	var varName uintptr
	infoPtr = rPtr
	iPtr = interp
	framePtr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr

	// Check that the variable is being requested in a context that is also a
	// method call; if not (i.e. we're evaluating in the object's namespace or
	// in a procedure of that namespace) then we do nothing.

	if !(framePtr == uintptr(0) || !((*CallFrame)(unsafe.Pointer(framePtr)).FisProcCallFrame&FRAME_IS_METHOD != 0)) {
		goto __1
	}
	return uintptr(0)
__1:
	;
	contextPtr = (*CallFrame)(unsafe.Pointer(framePtr)).FclientData

	// If we've done the work before (in a comparable context) then reuse that
	// rather than performing resolution ourselves.

	if !((*OOResVarInfo)(unsafe.Pointer(infoPtr)).FcachedObjectVar != 0) {
		goto __2
	}
	return (*OOResVarInfo)(unsafe.Pointer(infoPtr)).FcachedObjectVar
__2:
	;

	// Check if the variable is one we want to resolve at all (i.e. whether it
	// is in the list provided by the user). If not, we mustn't do anything
	// either.

	varName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer((*OOResVarInfo)(unsafe.Pointer(infoPtr)).FvariableObj)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer((*OOResVarInfo)(unsafe.Pointer(infoPtr)).FvariableObj)).Flength
				return (*Tcl_Obj)(unsafe.Pointer((*OOResVarInfo)(unsafe.Pointer(infoPtr)).FvariableObj)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, (*OOResVarInfo)(unsafe.Pointer(infoPtr)).FvariableObj, bp)
	}()
	if !((*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain+uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr)).FdeclaringClassPtr != uintptr(0)) {
		goto __3
	}
	i = 0
__5:
	if !(i < (*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain+uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr)).FdeclaringClassPtr)).Fvariables.Fnum) {
		goto __7
	}
	if !(*(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain+uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr)).FdeclaringClassPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __8
	}
	goto __6
	goto __9
__8:
	if !func() bool {
		variableObj = *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer((*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain+uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr)).FdeclaringClassPtr)).Fvariables.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __10
	}
	match = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(variableObj)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 4)) = (*Tcl_Obj)(unsafe.Pointer(variableObj)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(variableObj)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, variableObj, bp+4)
	}()
	if !(*(*int32)(unsafe.Pointer(bp + 4)) == *(*int32)(unsafe.Pointer(bp)) && !(libc.Xmemcmp(tls, match, varName, uint64(*(*int32)(unsafe.Pointer(bp + 4)))) != 0)) {
		goto __11
	}
	cacheIt = 0
	goto gotMatch
__11:
	;
__10:
	;
__9:
	;
	goto __6
__6:
	i++
	goto __5
	goto __7
__7:
	;
	goto __4
__3:
	i = 0
__12:
	if !(i < (*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).Fvariables.Fnum) {
		goto __14
	}
	if !(*(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __15
	}
	goto __13
	goto __16
__15:
	if !func() bool {
		variableObj = *(*uintptr)(unsafe.Pointer((*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).Fvariables.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __17
	}
	match = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(variableObj)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 4)) = (*Tcl_Obj)(unsafe.Pointer(variableObj)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(variableObj)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, variableObj, bp+4)
	}()
	if !(*(*int32)(unsafe.Pointer(bp + 4)) == *(*int32)(unsafe.Pointer(bp)) && !(libc.Xmemcmp(tls, match, varName, uint64(*(*int32)(unsafe.Pointer(bp + 4)))) != 0)) {
		goto __18
	}
	cacheIt = 1
	goto gotMatch
__18:
	;
__17:
	;
__16:
	;
	goto __13
__13:
	i++
	goto __12
	goto __14
__14:
	;
__4:
	;
	return uintptr(0)

	// It is a variable we want to resolve, so resolve it.

gotMatch:
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).FnamespacePtr + 248 /* &.varTable */)).FcreateProc})).f(tls, (*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).FnamespacePtr+248 /* &.varTable */, variableObj, bp+8 /* &isNew */)
	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		goto __19
	}
	if !!((*Var)(unsafe.Pointer(hPtr-uintptr(int32(uintptr(0)+24)))).Fflags&VAR_NAMESPACE_VAR != 0) {
		goto __20
	}
	*(*int32)(unsafe.Pointer(hPtr - uintptr(int32(uintptr(0)+24)))) |= VAR_NAMESPACE_VAR
	if !((*Var)(unsafe.Pointer(hPtr-uintptr(int32(uintptr(0)+24)))).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __21
	}
	(*VarInHash)(unsafe.Pointer(hPtr-uintptr(int32(uintptr(0)+24)))).FrefCount++
__21:
	;
__20:
	;

__19:
	;
	if !(cacheIt != 0) {
		goto __22
	}
	(*OOResVarInfo)(unsafe.Pointer(infoPtr)).FcachedObjectVar = hPtr - uintptr(int32(uintptr(0)+24))

	// We must keep a reference to the variable so everything will
	// continue to work correctly even if it is unset; being unset does
	// not end the life of the variable at this level. [Bug 3185009]

	(*VarInHash)(unsafe.Pointer((*OOResVarInfo)(unsafe.Pointer(infoPtr)).FcachedObjectVar)).FrefCount++
__22:
	;
	return hPtr - uintptr(int32(uintptr(0)+24))
}

func sProcedureMethodCompiledVarDelete(tls *libc.TLS, rPtr uintptr) { /* tclOOMethod.c:1066:1: */
	var infoPtr uintptr = rPtr

	// Release the reference to the variable if we were holding it.

	if (*OOResVarInfo)(unsafe.Pointer(infoPtr)).FcachedObjectVar != 0 {
		(*VarInHash)(unsafe.Pointer((*OOResVarInfo)(unsafe.Pointer(infoPtr)).FcachedObjectVar)).FrefCount--
		XTclCleanupVar(tls, (*OOResVarInfo)(unsafe.Pointer(infoPtr)).FcachedObjectVar, uintptr(0))
	}
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = (*OOResVarInfo)(unsafe.Pointer(infoPtr)).FvariableObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTclpFree(tls, infoPtr)
}

func sProcedureMethodCompiledVarResolver(tls *libc.TLS, interp uintptr, varName uintptr, length int32, contextNs uintptr, rPtrPtr uintptr) int32 { /* tclOOMethod.c:1084:1: */
	var infoPtr uintptr
	var variableObj uintptr = XTcl_NewStringObj(tls, varName, length)

	// Do not create resolvers for cases that contain namespace separators or
	// which look like array accesses. Both will lead us astray.

	if libc.Xstrstr(tls, XTcl_GetString(tls, variableObj), ts+6847) != uintptr(0) || XTcl_StringMatch(tls, XTcl_GetString(tls, variableObj), ts+52639) != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = variableObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return TCL_CONTINUE
	}

	infoPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(OOResVarInfo{})))
	(*OOResVarInfo)(unsafe.Pointer(infoPtr)).Finfo.FfetchProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr) Tcl_Var
	}{sProcedureMethodCompiledVarConnect}))
	(*OOResVarInfo)(unsafe.Pointer(infoPtr)).Finfo.FdeleteProc = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sProcedureMethodCompiledVarDelete}))
	(*OOResVarInfo)(unsafe.Pointer(infoPtr)).FcachedObjectVar = uintptr(0)
	(*OOResVarInfo)(unsafe.Pointer(infoPtr)).FvariableObj = variableObj
	(*Tcl_Obj)(unsafe.Pointer(variableObj)).FrefCount++
	*(*uintptr)(unsafe.Pointer(rPtrPtr)) = infoPtr
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// RenderDeclarerName --
//
//	Returns the name of the entity (object or class) which declared a
//	method. Used for producing information for [info frame] in such a way
//	that the expensive part of this (generating the object or class name
//	itself) isn't done until it is needed.
//
// ----------------------------------------------------------------------

func sRenderDeclarerName(tls *libc.TLS, clientData ClientData) uintptr { /* tclOOMethod.c:1128:16: */
	var pni uintptr = clientData
	var object Tcl_Object = XTcl_MethodDeclarerObject(tls, (*PNI)(unsafe.Pointer(pni)).Fmethod)

	if object == uintptr(0) {
		object = XTcl_GetClassAsObject(tls, XTcl_MethodDeclarerClass(tls, (*PNI)(unsafe.Pointer(pni)).Fmethod))
	}
	return XTclOOObjectName(tls, (*PNI)(unsafe.Pointer(pni)).Finterp, object)
}

// ----------------------------------------------------------------------
//
// MethodErrorHandler, ConstructorErrorHandler, DestructorErrorHandler --
//
//	How to fill in the stack trace correctly upon error in various forms
//	of procedure-like methods. LIMIT is how long the inserted strings in
//	the error traces should get before being converted to have ellipses,
//	and ELLIPSIFY is a macro to do the conversion (with the help of a
//	%.*s%s format field). Note that ELLIPSIFY is only safe for use in
//	suitable formatting contexts.
//
// ----------------------------------------------------------------------

func sMethodErrorHandler(tls *libc.TLS, interp uintptr, methodNameObj uintptr) { /* tclOOMethod.c:1161:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	// var nameLen int32 at bp+64, 4

	// var objectNameLen int32 at bp+68, 4

	var contextPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FclientData
	var mPtr uintptr = (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr
	var objectName uintptr
	var kindName uintptr
	var methodName uintptr = XTcl_GetStringFromObj(tls, (*Method)(unsafe.Pointer(mPtr)).FnamePtr, bp+64)
	var declarerPtr uintptr

	if (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr != uintptr(0) {
		declarerPtr = (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr
		kindName = ts + 18716 /* "object" */
	} else {
		if (*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr == uintptr(0) {
			XTcl_Panic(tls, ts+53186, 0)
		}
		declarerPtr = (*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr)).FthisPtr
		kindName = ts + 16064 /* "class" */
	}

	objectName = XTcl_GetStringFromObj(tls, XTclOOObjectName(tls, interp, declarerPtr),
		bp+68)
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+53225,
		libc.VaList(bp, kindName, func() int32 {
			if *(*int32)(unsafe.Pointer(bp + 68)) > LIMIT {
				return LIMIT
			}
			return *(*int32)(unsafe.Pointer(bp + 68))
		}(), objectName, func() uintptr {
			if *(*int32)(unsafe.Pointer(bp + 68)) > LIMIT {
				return ts + 7891 /* "..." */
			}
			return ts + 2046 /* "" */
		}(),
			func() int32 {
				if *(*int32)(unsafe.Pointer(bp + 64)) > LIMIT {
					return LIMIT
				}
				return *(*int32)(unsafe.Pointer(bp + 64))
			}(), methodName, func() uintptr {
				if *(*int32)(unsafe.Pointer(bp + 64)) > LIMIT {
					return ts + 7891 /* "..." */
				}
				return ts + 2046 /* "" */
			}(), XTcl_GetErrorLine(tls, interp))))
}

func sConstructorErrorHandler(tls *libc.TLS, interp uintptr, methodNameObj uintptr) { /* tclOOMethod.c:1192:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var contextPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FclientData
	var mPtr uintptr = (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr
	var declarerPtr uintptr
	var objectName uintptr
	var kindName uintptr
	// var objectNameLen int32 at bp+40, 4

	if (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr != uintptr(0) {
		declarerPtr = (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr
		kindName = ts + 18716 /* "object" */
	} else {
		if (*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr == uintptr(0) {
			XTcl_Panic(tls, ts+53186, 0)
		}
		declarerPtr = (*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr)).FthisPtr
		kindName = ts + 16064 /* "class" */
	}

	objectName = XTcl_GetStringFromObj(tls, XTclOOObjectName(tls, interp, declarerPtr),
		bp+40)
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+53268, libc.VaList(bp, kindName,
			func() int32 {
				if *(*int32)(unsafe.Pointer(bp + 40)) > LIMIT {
					return LIMIT
				}
				return *(*int32)(unsafe.Pointer(bp + 40))
			}(), objectName, func() uintptr {
				if *(*int32)(unsafe.Pointer(bp + 40)) > LIMIT {
					return ts + 7891 /* "..." */
				}
				return ts + 2046 /* "" */
			}(), XTcl_GetErrorLine(tls, interp))))
}

func sDestructorErrorHandler(tls *libc.TLS, interp uintptr, methodNameObj uintptr) { /* tclOOMethod.c:1221:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var contextPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FclientData
	var mPtr uintptr = (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr
	var declarerPtr uintptr
	var objectName uintptr
	var kindName uintptr
	// var objectNameLen int32 at bp+40, 4

	if (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr != uintptr(0) {
		declarerPtr = (*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr
		kindName = ts + 18716 /* "object" */
	} else {
		if (*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr == uintptr(0) {
			XTcl_Panic(tls, ts+53186, 0)
		}
		declarerPtr = (*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr)).FthisPtr
		kindName = ts + 16064 /* "class" */
	}

	objectName = XTcl_GetStringFromObj(tls, XTclOOObjectName(tls, interp, declarerPtr),
		bp+40)
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+53307, libc.VaList(bp, kindName,
			func() int32 {
				if *(*int32)(unsafe.Pointer(bp + 40)) > LIMIT {
					return LIMIT
				}
				return *(*int32)(unsafe.Pointer(bp + 40))
			}(), objectName, func() uintptr {
				if *(*int32)(unsafe.Pointer(bp + 40)) > LIMIT {
					return ts + 7891 /* "..." */
				}
				return ts + 2046 /* "" */
			}(), XTcl_GetErrorLine(tls, interp))))
}

// ----------------------------------------------------------------------
//
// DeleteProcedureMethod, CloneProcedureMethod --
//
//	How to delete and clone procedure-like methods.
//
// ----------------------------------------------------------------------

func sDeleteProcedureMethodRecord(tls *libc.TLS, pmPtr uintptr) { /* tclOOMethod.c:1260:1: */
	XTclProcDeleteProc(tls, (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)
	if (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FdeleteClientdataProc != 0 {
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*ProcedureMethod)(unsafe.Pointer(pmPtr)).FdeleteClientdataProc})).f(tls, (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FclientData)
	}
	XTclpFree(tls, pmPtr)
}

func sDeleteProcedureMethod(tls *libc.TLS, clientData ClientData) { /* tclOOMethod.c:1271:1: */
	var pmPtr uintptr = clientData

	if libc.PostDecInt32(&(*ProcedureMethod)(unsafe.Pointer(pmPtr)).FrefCount, 1) <= 1 {
		sDeleteProcedureMethodRecord(tls, pmPtr)
	}
}

func sCloneProcedureMethod(tls *libc.TLS, interp uintptr, clientData ClientData, newClientData uintptr) int32 { /* tclOOMethod.c:1282:1: */
	var pmPtr uintptr = clientData
	var pm2Ptr uintptr
	var bodyObj uintptr
	var argsObj uintptr
	var localPtr uintptr

	// Copy the argument list.

	argsObj = XTcl_NewObj(tls)
	for localPtr = (*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FfirstLocalPtr; localPtr != uintptr(0); localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr {
		if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_ARGUMENT != 0 {
			var argObj uintptr = XTcl_NewObj(tls)

			XTcl_ListObjAppendElement(tls, uintptr(0), argObj,
				XTcl_NewStringObj(tls, localPtr+40, -1))
			if (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr != uintptr(0) {
				XTcl_ListObjAppendElement(tls, uintptr(0), argObj, (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr)
			}
			XTcl_ListObjAppendElement(tls, uintptr(0), argsObj, argObj)
		}
	}

	// Must strip the internal representation in order to ensure that any
	// bound references to instance variables are removed. [Bug 3609693]

	bodyObj = XTcl_DuplicateObj(tls, (*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FbodyPtr)
	XTcl_GetString(tls, bodyObj)
	if (*Tcl_Obj)(unsafe.Pointer(bodyObj)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bodyObj)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bodyObj)).FtypePtr)).FfreeIntRepProc})).f(tls, bodyObj)
		}
		(*Tcl_Obj)(unsafe.Pointer(bodyObj)).FtypePtr = uintptr(0)
	}

	// Create the actual copy of the method record, manufacturing a new proc
	// record.

	pm2Ptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ProcedureMethod{})))
	libc.Xmemcpy(tls, pm2Ptr, pmPtr, uint64(unsafe.Sizeof(ProcedureMethod{})))
	(*ProcedureMethod)(unsafe.Pointer(pm2Ptr)).FrefCount = 1
	(*Tcl_Obj)(unsafe.Pointer(argsObj)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(bodyObj)).FrefCount++
	if XTclCreateProc(tls, interp, uintptr(0), ts+2046, argsObj, bodyObj,
		pm2Ptr+8) != TCL_OK {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = argsObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = bodyObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		XTclpFree(tls, pm2Ptr)
		return TCL_ERROR
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = argsObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok3 := true; ok3; ok3 = 0 != 0 {
		var _objPtr uintptr = bodyObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	if (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FcloneClientdataProc != 0 {
		(*ProcedureMethod)(unsafe.Pointer(pm2Ptr)).FclientData = (*struct {
			f func(*libc.TLS, ClientData) ClientData
		})(unsafe.Pointer(&struct{ uintptr }{(*ProcedureMethod)(unsafe.Pointer(pmPtr)).FcloneClientdataProc})).f(tls, (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FclientData)
	}
	*(*ClientData)(unsafe.Pointer(newClientData)) = pm2Ptr
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOONewForwardInstanceMethod --
//
//	Create a forwarded method for an object.
//
// ----------------------------------------------------------------------

func XTclOONewForwardInstanceMethod(tls *libc.TLS, interp uintptr, oPtr uintptr, flags int32, nameObj uintptr, prefixObj uintptr) uintptr { /* tclOOMethod.c:1357:8: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	// var prefixLen int32 at bp+32, 4

	var fmPtr uintptr

	if XTcl_ListObjLength(tls, interp, prefixObj, bp+32) != TCL_OK {
		return uintptr(0)
	}
	if *(*int32)(unsafe.Pointer(bp + 32)) < 1 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+53345, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+53385, uintptr(0)))
		return uintptr(0)
	}

	fmPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ForwardMethod{})))
	(*ForwardMethod)(unsafe.Pointer(fmPtr)).FprefixObj = prefixObj
	(*Tcl_Obj)(unsafe.Pointer(prefixObj)).FrefCount++
	return XTcl_NewInstanceMethod(tls, interp, oPtr,
		nameObj, flags, uintptr(unsafe.Pointer(&fwdMethodType)), fmPtr)
}

// ----------------------------------------------------------------------
//
// TclOONewForwardMethod --
//
//	Create a new forwarded method for a class.
//
// ----------------------------------------------------------------------

func XTclOONewForwardMethod(tls *libc.TLS, interp uintptr, clsPtr uintptr, flags int32, nameObj uintptr, prefixObj uintptr) uintptr { /* tclOOMethod.c:1396:8: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	// var prefixLen int32 at bp+32, 4

	var fmPtr uintptr

	if XTcl_ListObjLength(tls, interp, prefixObj, bp+32) != TCL_OK {
		return uintptr(0)
	}
	if *(*int32)(unsafe.Pointer(bp + 32)) < 1 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+53345, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+28514, ts+53385, uintptr(0)))
		return uintptr(0)
	}

	fmPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ForwardMethod{})))
	(*ForwardMethod)(unsafe.Pointer(fmPtr)).FprefixObj = prefixObj
	(*Tcl_Obj)(unsafe.Pointer(prefixObj)).FrefCount++
	return XTcl_NewMethod(tls, interp, clsPtr, nameObj,
		flags, uintptr(unsafe.Pointer(&fwdMethodType)), fmPtr)
}

// ----------------------------------------------------------------------
//
// InvokeForwardMethod --
//
//	How to invoke a forwarded method. Works by doing some ensemble-like
//	command rearranging and then invokes some other Tcl command.
//
// ----------------------------------------------------------------------

func sInvokeForwardMethod(tls *libc.TLS, clientData ClientData, interp uintptr, context Tcl_ObjectContext, objc int32, objv uintptr) int32 { /* tclOOMethod.c:1437:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var contextPtr uintptr = context
	var fmPtr uintptr = clientData
	var argObjs uintptr
	// var prefixObjs uintptr at bp+8, 8

	// var numPrefixes int32 at bp, 4

	// var len int32 at bp+16, 4

	var skip int32 = (*CallContext)(unsafe.Pointer(contextPtr)).Fskip

	// Build the real list of arguments to use. Note that we know that the
	// prefixObj field of the ForwardMethod structure holds a reference to a
	// non-empty list, so there's a whole class of failures ("not a list") we
	// can ignore here.

	XTcl_ListObjGetElements(tls, uintptr(0), (*ForwardMethod)(unsafe.Pointer(fmPtr)).FprefixObj, bp, bp+8)
	argObjs = sInitEnsembleRewrite(tls, interp, objc, objv, skip,
		*(*int32)(unsafe.Pointer(bp /* numPrefixes */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* prefixObjs */)), bp+16)
	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sFinalizeForwardCall})), argObjs, uintptr(0), uintptr(0), uintptr(0))
	// NOTE: The combination of direct set of iPtr->lookupNsPtr and the use
	// of the TCL_EVAL_NOERR flag results in an evaluation configuration
	// very much like TCL_EVAL_INVOKE.
	(*Interp)(unsafe.Pointer(interp)).FlookupNsPtr = (*Object)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FoPtr)).FnamespacePtr
	return XTclNREvalObjv(tls, interp, *(*int32)(unsafe.Pointer(bp + 16 /* len */)), argObjs, TCL_EVAL_NOERR, uintptr(0))
}

func sFinalizeForwardCall(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclOOMethod.c:1471:1: */
	var argObjs uintptr = *(*ClientData)(unsafe.Pointer(data))

	XTclStackFree(tls, interp, argObjs)
	return result
}

// ----------------------------------------------------------------------
//
// DeleteForwardMethod, CloneForwardMethod --
//
//	How to delete and clone forwarded methods.
//
// ----------------------------------------------------------------------

func sDeleteForwardMethod(tls *libc.TLS, clientData ClientData) { /* tclOOMethod.c:1493:1: */
	var fmPtr uintptr = clientData

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = (*ForwardMethod)(unsafe.Pointer(fmPtr)).FprefixObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTclpFree(tls, fmPtr)
}

func sCloneForwardMethod(tls *libc.TLS, interp uintptr, clientData ClientData, newClientData uintptr) int32 { /* tclOOMethod.c:1503:1: */
	var fmPtr uintptr = clientData
	var fm2Ptr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ForwardMethod{})))

	(*ForwardMethod)(unsafe.Pointer(fm2Ptr)).FprefixObj = (*ForwardMethod)(unsafe.Pointer(fmPtr)).FprefixObj
	(*Tcl_Obj)(unsafe.Pointer((*ForwardMethod)(unsafe.Pointer(fm2Ptr)).FprefixObj)).FrefCount++
	*(*ClientData)(unsafe.Pointer(newClientData)) = fm2Ptr
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclOOGetProcFromMethod, TclOOGetFwdFromMethod --
//
//	Utility functions used for procedure-like and forwarding method
//	introspection.
//
// ----------------------------------------------------------------------

func XTclOOGetProcFromMethod(tls *libc.TLS, mPtr uintptr) uintptr { /* tclOOMethod.c:1528:6: */
	if (*Method)(unsafe.Pointer(mPtr)).FtypePtr == uintptr(unsafe.Pointer(&procMethodType)) {
		var pmPtr uintptr = (*Method)(unsafe.Pointer(mPtr)).FclientData

		return (*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr
	}
	return uintptr(0)
}

func XTclOOGetMethodBody(tls *libc.TLS, mPtr uintptr) uintptr { /* tclOOMethod.c:1540:9: */
	if (*Method)(unsafe.Pointer(mPtr)).FtypePtr == uintptr(unsafe.Pointer(&procMethodType)) {
		var pmPtr uintptr = (*Method)(unsafe.Pointer(mPtr)).FclientData

		if (*Tcl_Obj)(unsafe.Pointer((*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FbodyPtr)).Fbytes == uintptr(0) {
			XTcl_GetString(tls, (*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FbodyPtr)
		}
		return (*Proc)(unsafe.Pointer((*ProcedureMethod)(unsafe.Pointer(pmPtr)).FprocPtr)).FbodyPtr
	}
	return uintptr(0)
}

func XTclOOGetFwdFromMethod(tls *libc.TLS, mPtr uintptr) uintptr { /* tclOOMethod.c:1555:9: */
	if (*Method)(unsafe.Pointer(mPtr)).FtypePtr == uintptr(unsafe.Pointer(&fwdMethodType)) {
		var fwPtr uintptr = (*Method)(unsafe.Pointer(mPtr)).FclientData

		return (*ForwardMethod)(unsafe.Pointer(fwPtr)).FprefixObj
	}
	return uintptr(0)
}

// ----------------------------------------------------------------------
//
// InitEnsembleRewrite --
//
//	Utility function that wraps up a lot of the complexity involved in
//	doing ensemble-like command forwarding. Here is a picture of memory
//	management plan:
//
//                    <-----------------objc---------------------->
//      objv:        |=============|===============================|
//                    <-toRewrite->           |
//                                              *                    <-rewriteLength->          *      rewriteObjs: |=================|          *                           |                    |
//                           V                    V
//      argObjs:     |=================|===============================|
//                    <------------------*lengthPtr------------------->
//
// ----------------------------------------------------------------------

func sInitEnsembleRewrite(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, toRewrite int32, rewriteLength int32, rewriteObjs uintptr, lengthPtr uintptr) uintptr { /* tclOOMethod.c:1590:16: */
	var len uint32 = uint32(rewriteLength + objc - toRewrite)
	var argObjs uintptr = XTclStackAlloc(tls, interp, int32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(len)))

	libc.Xmemcpy(tls, argObjs, rewriteObjs, uint64(rewriteLength)*uint64(unsafe.Sizeof(uintptr(0))))
	libc.Xmemcpy(tls, argObjs+uintptr(rewriteLength)*8, objv+uintptr(toRewrite)*8,
		uint64(unsafe.Sizeof(uintptr(0)))*uint64(objc-toRewrite))

	// Now plumb this into the core ensemble rewrite logging system so that
	// Tcl_WrongNumArgs() can rewrite its result appropriately. The rules for
	// how to store the rewrite rules get complex solely because of the case
	// where an ensemble rewrites itself out of the picture; when that
	// happens, the quality of the error message rewrite falls drastically
	// (and unavoidably).

	if XTclInitRewriteEnsemble(tls, interp, toRewrite, rewriteLength, objv) != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{XTclClearRootEnsemble}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
	}
	*(*int32)(unsafe.Pointer(lengthPtr)) = int32(len)
	return argObjs
}

// ----------------------------------------------------------------------
//
// assorted trivial 'getter' functions
//
// ----------------------------------------------------------------------

func XTcl_MethodDeclarerObject(tls *libc.TLS, method Tcl_Method) Tcl_Object { /* tclOOMethod.c:1633:1: */
	return (*Method)(unsafe.Pointer(method)).FdeclaringObjectPtr
}

func XTcl_MethodDeclarerClass(tls *libc.TLS, method Tcl_Method) Tcl_Class { /* tclOOMethod.c:1640:1: */
	return (*Method)(unsafe.Pointer(method)).FdeclaringClassPtr
}

func XTcl_MethodName(tls *libc.TLS, method Tcl_Method) uintptr { /* tclOOMethod.c:1646:9: */
	return (*Method)(unsafe.Pointer(method)).FnamePtr
}

func XTcl_MethodIsType(tls *libc.TLS, method Tcl_Method, typePtr uintptr, clientDataPtr uintptr) int32 { /* tclOOMethod.c:1654:1: */
	var mPtr uintptr = method

	if (*Method)(unsafe.Pointer(mPtr)).FtypePtr == typePtr {
		if clientDataPtr != uintptr(0) {
			*(*ClientData)(unsafe.Pointer(clientDataPtr)) = (*Method)(unsafe.Pointer(mPtr)).FclientData
		}
		return 1
	}
	return 0
}

func XTcl_MethodIsPublic(tls *libc.TLS, method Tcl_Method) int32 { /* tclOOMethod.c:1671:1: */
	if (*Method)(unsafe.Pointer(method)).Fflags&PUBLIC_METHOD != 0 {
		return 1
	}
	return 0
}

// Extended method construction for itcl-ng.

func XTclOONewProcInstanceMethodEx(tls *libc.TLS, interp uintptr, oPtr Tcl_Object, preCallPtr uintptr, postCallPtr uintptr, errProc uintptr, clientData ClientData, nameObj uintptr, argsObj uintptr, bodyObj uintptr, flags int32, internalTokenPtr uintptr) Tcl_Method { /* tclOOMethod.c:1682:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var pmPtr uintptr at bp, 8

	var method Tcl_Method = XTclOONewProcInstanceMethod(tls, interp,
		oPtr, flags, nameObj, argsObj, bodyObj, bp)

	if method == uintptr(0) {
		return uintptr(0)
	}
	(*ProcedureMethod)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pmPtr */)))).Fflags = flags & USE_DECLARER_NS
	(*ProcedureMethod)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pmPtr */)))).FpreCallProc = preCallPtr
	(*ProcedureMethod)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pmPtr */)))).FpostCallProc = postCallPtr
	(*ProcedureMethod)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pmPtr */)))).FerrProc = errProc
	(*ProcedureMethod)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pmPtr */)))).FclientData = clientData
	if internalTokenPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(internalTokenPtr)) = *(*uintptr)(unsafe.Pointer(bp /* pmPtr */))
	}
	return method
}

func XTclOONewProcMethodEx(tls *libc.TLS, interp uintptr, clsPtr Tcl_Class, preCallPtr uintptr, postCallPtr uintptr, errProc uintptr, clientData ClientData, nameObj uintptr, argsObj uintptr, bodyObj uintptr, flags int32, internalTokenPtr uintptr) Tcl_Method { /* tclOOMethod.c:1719:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var pmPtr uintptr at bp, 8

	var method Tcl_Method = XTclOONewProcMethod(tls, interp,
		clsPtr, flags, nameObj, argsObj, bodyObj, bp)

	if method == uintptr(0) {
		return uintptr(0)
	}
	(*ProcedureMethod)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pmPtr */)))).Fflags = flags & USE_DECLARER_NS
	(*ProcedureMethod)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pmPtr */)))).FpreCallProc = preCallPtr
	(*ProcedureMethod)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pmPtr */)))).FpostCallProc = postCallPtr
	(*ProcedureMethod)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pmPtr */)))).FerrProc = errProc
	(*ProcedureMethod)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pmPtr */)))).FclientData = clientData
	if internalTokenPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(internalTokenPtr)) = *(*uintptr)(unsafe.Pointer(bp /* pmPtr */))
	}
	return method
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// !BEGIN!: Do not edit below this line.

var tclOOIntStubs = TclOOIntStubs{
	Fmagic:                         libc.Int32FromUint32(0xFCA3BACF),
	FtclOOGetDefineCmdContext:      0, // 0
	FtclOOMakeProcInstanceMethod:   0, // 1
	FtclOOMakeProcMethod:           0, // 2
	FtclOONewProcInstanceMethod:    0, // 3
	FtclOONewProcMethod:            0, // 4
	FtclOOObjectCmdCore:            0, // 5
	FtclOOIsReachable:              0, // 6
	FtclOONewForwardMethod:         0, // 7
	FtclOONewForwardInstanceMethod: 0, // 8
	FtclOONewProcInstanceMethodEx:  0, // 9
	FtclOONewProcMethodEx:          0, // 10
	FtclOOInvokeObject:             0, // 11
	FtclOOObjectSetFilters:         0, // 12
	FtclOOClassSetFilters:          0, // 13
	FtclOOObjectSetMixins:          0, // 14
	FtclOOClassSetMixins:           0, // 15
} /* tclOOStubInit.c:21:28 */

var tclOOStubHooks = TclOOStubHooks{
	FtclOOIntStubs: 0,
} /* tclOOStubInit.c:42:29 */

var XtclOOStubs = TclOOStubs{
	Fmagic:                         libc.Int32FromUint32(0xFCA3BACF),
	Fhooks:                         0,
	Ftcl_CopyObjectInstance:        0, // 0
	Ftcl_GetClassAsObject:          0, // 1
	Ftcl_GetObjectAsClass:          0, // 2
	Ftcl_GetObjectCommand:          0, // 3
	Ftcl_GetObjectFromObj:          0, // 4
	Ftcl_GetObjectNamespace:        0, // 5
	Ftcl_MethodDeclarerClass:       0, // 6
	Ftcl_MethodDeclarerObject:      0, // 7
	Ftcl_MethodIsPublic:            0, // 8
	Ftcl_MethodIsType:              0, // 9
	Ftcl_MethodName:                0, // 10
	Ftcl_NewInstanceMethod:         0, // 11
	Ftcl_NewMethod:                 0, // 12
	Ftcl_NewObjectInstance:         0, // 13
	Ftcl_ObjectDeleted:             0, // 14
	Ftcl_ObjectContextIsFiltering:  0, // 15
	Ftcl_ObjectContextMethod:       0, // 16
	Ftcl_ObjectContextObject:       0, // 17
	Ftcl_ObjectContextSkippedArgs:  0, // 18
	Ftcl_ClassGetMetadata:          0, // 19
	Ftcl_ClassSetMetadata:          0, // 20
	Ftcl_ObjectGetMetadata:         0, // 21
	Ftcl_ObjectSetMetadata:         0, // 22
	Ftcl_ObjectContextInvokeNext:   0, // 23
	Ftcl_ObjectGetMethodNameMapper: 0, // 24
	Ftcl_ObjectSetMethodNameMapper: 0, // 25
	Ftcl_ClassSetConstructor:       0, // 26
	Ftcl_ClassSetDestructor:        0, // 27
	Ftcl_GetObjectName:             0, // 31
} /* tclOOStubInit.c:46:18 */

// !END!: Do not edit above this line.

var XtclOOStubsPtr uintptr = uintptr(0)    /* tclOOStubLib.c:10:18 */
var XtclOOIntStubsPtr uintptr = uintptr(0) /* tclOOStubLib.c:11:21 */

//----------------------------------------------------------------------
//
// TclOOInitializeStubs --
//	Load the tclOO package, initialize stub table pointer. Do not call
//	this function directly, use Tcl_OOInitStubs() macro instead.
//
// Results:
//	The actual version of the package that satisfies the request, or NULL
//	to indicate that an error occurred.
//
// Side effects:
//	Sets the stub table pointers.
//
//----------------------------------------------------------------------

func XTclOOInitializeStubs(tls *libc.TLS, interp uintptr, version uintptr) uintptr { /* tclOOStubLib.c:32:25: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	var exact int32 = 0
	var packageName uintptr = ts + 49138 /* "TclOO" */
	var errMsg uintptr = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 72 /* stubsPtr */)) = uintptr(0)
	var actualVersion uintptr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*TclStubs)(unsafe.Pointer(XtclStubsPtr)).Ftcl_PkgRequireEx})).f(tls, interp,
		packageName, version, exact, bp+72 /* &stubsPtr */)

	if actualVersion == uintptr(0) {
		return uintptr(0)
	}
	if *(*uintptr)(unsafe.Pointer(bp + 72)) == uintptr(0) {
		errMsg = ts + 53397 /* "missing stub tab..." */
	} else {
		XtclOOStubsPtr = *(*uintptr)(unsafe.Pointer(bp + 72 /* stubsPtr */))
		if (*TclOOStubs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).Fhooks != 0 {
			XtclOOIntStubsPtr = (*TclOOStubHooks)(unsafe.Pointer((*TclOOStubs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 /* stubsPtr */)))).Fhooks)).FtclOOIntStubs
		} else {
			XtclOOIntStubsPtr = uintptr(0)
		}
		return actualVersion
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*TclStubs)(unsafe.Pointer(XtclStubsPtr)).Ftcl_ResetResult})).f(tls, interp)
	(*struct {
		f func(*libc.TLS, uintptr, uintptr)
	})(unsafe.Pointer(&struct{ uintptr }{(*TclStubs)(unsafe.Pointer(XtclStubsPtr)).Ftcl_AppendResult})).f(tls, interp, libc.VaList(bp, ts+53424 /* "Error loading " */, packageName,
		ts+53439, version, ts+53460,
		actualVersion, ts+53478, errMsg, uintptr(0)))
	return uintptr(0)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// GCC bug 66462 means we cannot use the math builtins with -fsignaling-nan,
//    so disable builtins if this is enabled.  When fixed in a newer GCC,
//    the __SUPPORT_SNAN__ check may be skipped for those versions.

// Return number of classification appropriate for X.
// The check for __cplusplus allows the use of the builtin, even
// 	when optimization for size is on.  This is provided for
// 	libstdc++, only to let its configure test work when it is built
// 	with -Os.  No further use of this definition of fpclassify is
// 	expected in C++ mode, since libstdc++ provides its own version
// 	of fpclassify in cmath (which undefines fpclassify).

// Return nonzero value if sign of X is negative.

// Return nonzero value if X is not +-Inf or NaN.

// Return nonzero value if X is neither zero, subnormal, Inf, nor NaN.

// Return nonzero value if X is a NaN.  We could use `fpclassify' but
//    we already have this functions `__isnan' and it is faster.

// Return nonzero value if X is positive or negative infinity.

// Bitmasks for the math_errhandling macro.

// By default all math functions support both errno and exception handling
//    (except for soft floating point implementations which may only support
//    errno handling).  If errno handling is disabled, exceptions are still
//    supported by GLIBC.  Set math_errhandling to 0 with -ffast-math (this is
//    nonconforming but it is more useful than leaving it undefined).

// Some useful constants.

// The above constants are not adequate for computation using `long double's.
//    Therefore we provide as an extension constants with similar names as a
//    GNU extension.  Provide enough digits for the 128-bit IEEE quad.

// When compiling in strict ISO C compatible mode we must not use the
//    inline functions since they, among other things, do not set the
//    `errno' variable correctly.

// ISO C99 defines some macros to compare number while taking care for
//    unordered numbers.  Many FPUs provide special instructions to support
//    these operations.  Generic support in GCC for these as builtins went
//    in 2.97, but not all cpus added their patterns until 3.1.  Therefore
//    we enable the builtins from 3.1 onwards and use a generic implementation
//    othwerwise.

// Get machine-dependent inline versions (if there are any).

// Table of all object types.

var typeTable Tcl_HashTable        /* tclObj.c:25:22: */
var typeTableInitialized int32 = 0 /* tclObj.c:26:12 */ // 0 means not yet initialized.
var tableMutex Tcl_Mutex           /* tclObj.c:27:1: */

// Head of the list of free Tcl_Obj structs we maintain.

var XtclFreeObjList uintptr = uintptr(0) /* tclObj.c:33:9 */
var XtclObjMutex Tcl_Mutex               /* tclObj.c:42:11: */

// Pointer to a heap-allocated string of length zero that the Tcl core uses as
// the value of an empty string representation for an object. This value is
// shared by all new objects allocated by Tcl_NewObj.

var XtclEmptyString int8 = int8(0) /* tclObj.c:51:6 */
var XtclEmptyStringRep uintptr = 0 /* tclObj.c:52:6 */

// All static variables used in this file are collected into a single instance
// of the following structure.  For multi-threaded implementations, there is
// one instance of this structure for each thread.
//
// Notice that different structures with the same name appear in other files.
// The structure defined below is used in this file only.

type ThreadSpecificData10 = struct{ FlineCLPtr uintptr } /* tclObj.c:96:3 */

var dataKey9 Tcl_ThreadDataKey /* tclObj.c:98:26: */

// Nested Tcl_Obj deletion management support
//
// All context references used in the object freeing code are pointers to this
// structure; every thread will have its own structure instance. The purpose
// of this structure is to allow deeply nested collections of Tcl_Objs to be
// freed without taking a vast depth of C stack (which could cause all sorts
// of breakage.)

type PendingObjData1 = struct {
	FdeletionCount int32
	F__ccgo_pad1   [4]byte
	FdeletionStack uintptr
} /* tclObj.c:113:9 */

// Nested Tcl_Obj deletion management support
//
// All context references used in the object freeing code are pointers to this
// structure; every thread will have its own structure instance. The purpose
// of this structure is to allow deeply nested collections of Tcl_Objs to be
// freed without taking a vast depth of C stack (which could cause all sorts
// of breakage.)

type PendingObjData = PendingObjData1 /* tclObj.c:138:3 */

// These are separated out so that some semantic content is attached
// to them.

// Macro to set up the local reference to the deletion context.
var pendingObjDataKey Tcl_ThreadDataKey /* tclObj.c:169:26: */

// The structures below defines the Tcl object types defined in this file by
// means of functions that can be invoked by generic object code. See also
// tclStringObj.c, tclListObj.c, tclByteCode.c for other type manager
// implementations.

var oldBooleanType = Tcl_ObjType{
	Fname:           ts + 3541,
	FsetFromAnyProc: 0, // setFromAnyProc
} /* tclObj.c:246:26 */
var XtclBooleanType = Tcl_ObjType{
	Fname:           ts + 53482,
	FsetFromAnyProc: 0, // setFromAnyProc
} /* tclObj.c:253:19 */
var XtclDoubleType = Tcl_ObjType{
	Fname:             ts + 5570,
	FupdateStringProc: 0, // updateStringProc
	FsetFromAnyProc:   0, // setFromAnyProc
} /* tclObj.c:260:19 */
var XtclIntType = Tcl_ObjType{
	Fname:             ts + 5605,
	FupdateStringProc: 0, // updateStringProc
	FsetFromAnyProc:   0, // setFromAnyProc
} /* tclObj.c:267:19 */
var XtclBignumType = Tcl_ObjType{
	Fname:             ts + 53496,
	FfreeIntRepProc:   0, // freeIntRepProc
	FdupIntRepProc:    0, // dupIntRepProc
	FupdateStringProc: 0, // setFromAnyProc
} /* tclObj.c:283:19 */

// The structure below defines the Tcl obj hash key type.

var XtclObjHashKeyType = Tcl_HashKeyType{
	Fversion:         TCL_HASH_KEY_TYPE_VERSION, // flags
	FhashKeyProc:     0,                         // hashKeyProc
	FcompareKeysProc: 0,                         // compareKeysProc
	FallocEntryProc:  0,                         // allocEntryProc
	FfreeEntryProc:   0,                         // freeEntryProc
} /* tclObj.c:295:23 */

// The structure below defines the command name Tcl object type by means of
// functions that can be invoked by generic object code. Objects of this type
// cache the Command pointer that results from looking up command names in the
// command hashtable. Such objects appear as the zeroth ("command name")
// argument in a Tcl command.
//
// NOTE: the ResolvedCmdName that gets cached is stored in the
// twoPtrValue.ptr1 field, and the twoPtrValue.ptr2 field is unused. You might
// think you could use the simpler otherValuePtr field to store the single
// ResolvedCmdName pointer, but DO NOT DO THIS. It seems that some extensions
// use the second internal pointer field of the twoPtrValue field for their
// own purposes.
//
// TRICKY POINT! Some extensions update this structure! (Notably, these
// include TclBlend and TCom). This is highly ill-advised on their part, but
// does allow them to delete a command when references to it are gone, which
// is fragile but useful given their somewhat-OO style. Because of this, this
// structure MUST NOT be const so that the C compiler puts the data in
// writable memory. [Bug 2558422] [Bug 07d13d99b0a9]
// TODO: Provide a better API for those extensions so that they can coexist...

var XtclCmdNameType = Tcl_ObjType{
	Fname:           ts + 53503,
	FfreeIntRepProc: 0, // freeIntRepProc
	FdupIntRepProc:  0, // updateStringProc
	FsetFromAnyProc: 0, // setFromAnyProc
} /* tclObj.c:327:13 */

// Structure containing a cached pointer to a command that is the result of
// resolving the command's name in some namespace. It is the internal
// representation for a cmdName object. It contains the pointer along with
// some information that is used to check the pointer's validity.

type ResolvedCmdName1 = struct {
	FcmdPtr        uintptr
	FrefNsPtr      uintptr
	FrefNsId       int64
	FrefNsCmdEpoch int32
	FcmdEpoch      int32
	FrefCount      int32
	F__ccgo_pad1   [4]byte
} /* tclObj.c:342:9 */

// Structure containing a cached pointer to a command that is the result of
// resolving the command's name in some namespace. It is the internal
// representation for a cmdName object. It contains the pointer along with
// some information that is used to check the pointer's validity.

type ResolvedCmdName = ResolvedCmdName1 /* tclObj.c:369:3 */

//-------------------------------------------------------------------------
//
// TclInitObjectSubsystem --
//
//	This function is invoked to perform once-only initialization of the
//	type table. It also registers the object types defined in this file.
//
// Results:
//	None.
//
// Side effects:
//	Initializes the table of defined object types "typeTable" with builtin
//	object types defined in this file.
//
//-------------------------------------------------------------------------

func XTclInitObjSubsystem(tls *libc.TLS) { /* tclObj.c:390:1: */
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&tableMutex)))
	typeTableInitialized = 1
	XTcl_InitHashTable(tls, uintptr(unsafe.Pointer(&typeTable)), 0)
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&tableMutex)))

	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclByteArrayType)))
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclDoubleType)))
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclEndOffsetType)))
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclIntType)))
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclStringType)))
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclListType)))
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclDictType)))
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclByteCodeType)))
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclArraySearchType)))
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclCmdNameType)))
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclRegexpType)))
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&XtclProcBodyType)))

	// For backward compatibility only ...
	XTcl_RegisterObjType(tls, uintptr(unsafe.Pointer(&oldBooleanType)))

}

//----------------------------------------------------------------------
//
// TclFinalizeThreadObjects --
//
//	This function is called by Tcl_FinalizeThread to clean up thread
//	specific Tcl_Obj information.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFinalizeThreadObjects(tls *libc.TLS) { /* tclObj.c:449:1: */
}

//----------------------------------------------------------------------
//
// TclFinalizeObjects --
//
//	This function is called by Tcl_Finalize to clean up all registered
//	Tcl_ObjType's and to reset the tclFreeObjList.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFinalizeObjects(tls *libc.TLS) { /* tclObj.c:492:1: */
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&tableMutex)))
	if typeTableInitialized != 0 {
		XTcl_DeleteHashTable(tls, uintptr(unsafe.Pointer(&typeTable)))
		typeTableInitialized = 0
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&tableMutex)))

	// All we do here is reset the head pointer of the linked list of free
	// Tcl_Obj's to NULL; the memory finalization will take care of releasing
	// memory for us.
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&XtclObjMutex)))
	XtclFreeObjList = uintptr(0)
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&XtclObjMutex)))
}

//----------------------------------------------------------------------
//
// TclGetContLineTable --
//
//	This procedure is a helper which returns the thread-specific
//	hash-table used to track continuation line information associated with
//	Tcl_Obj*, and the objThreadMap, etc.
//
// Results:
//	A reference to the thread-data.
//
// Side effects:
//	May allocate memory for the thread-data.
//
// TIP #280
//----------------------------------------------------------------------

func sTclGetContLineTable(tls *libc.TLS) uintptr { /* tclObj.c:530:27: */
	// Initialize the hashtable tracking invisible continuation lines.  For
	// the release we use a thread exit handler to ensure that this is done
	// before TSD blocks are made invalid. The TclFinalizeObjects() which
	// would be the natural place for this is invoked afterwards, meaning that
	// we try to operate on a data structure already gone.

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey9)), int32(unsafe.Sizeof(ThreadSpecificData10{})))

	if !(int32((*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr) != 0) {
		(*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
		XTcl_InitHashTable(tls, (*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr, 1)
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sTclThreadFinalizeContLines})), uintptr(0))
	}
	return tsdPtr
}

//----------------------------------------------------------------------
//
// TclContinuationsEnter --
//
//	This procedure is a helper which saves the continuation line
//	information associated with a Tcl_Obj*.
//
// Results:
//	A reference to the newly created continuation line location table.
//
// Side effects:
//	Allocates memory for the table of continuation line locations.
//
// TIP #280
//----------------------------------------------------------------------

func XTclContinuationsEnter(tls *libc.TLS, objPtr uintptr, num int32, loc uintptr) uintptr { /* tclObj.c:569:13: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var newEntry int32 at bp, 4

	var tsdPtr uintptr = sTclGetContLineTable(tls)
	var hPtr uintptr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr)).FcreateProc})).f(tls, (*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr, objPtr, bp /* &newEntry */)
	var clLocPtr uintptr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+4))+uint64(num+1)*uint64(unsafe.Sizeof(int32(0)))))

	if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
		// We're entering ContLineLoc data for the same value more than one
		// time. Taking care not to leak the old entry.
		//
		// This can happen when literals in a proc body are shared. See for
		// example test info-30.19 where the action (code) for all branches of
		// the switch command is identical, mapping them all to the same
		// literal. An interesting result of this is that the number and
		// locations (offset) of invisible continuation lines in the literal
		// are the same for all occurences.
		//
		// Note that while reusing the existing entry is possible it requires
		// the same actions as for a new entry because we have to copy the
		// incoming num/loc data even so. Because we are called from
		// TclContinuationsEnterDerived for this case, which modified the
		// stored locations (Rebased to the proper relative offset). Just
		// returning the stored entry would rebase them a second time, or
		// more, hosing the data. It is easier to simply replace, as we are
		// doing.

		XTclpFree(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
	}

	(*ContLineLoc)(unsafe.Pointer(clLocPtr)).Fnum = num
	libc.Xmemcpy(tls, clLocPtr+4, loc, uint64(num)*uint64(unsafe.Sizeof(int32(0))))
	*(*int32)(unsafe.Pointer(clLocPtr + 4 + uintptr(num)*4)) = -1 // Sentinel
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = clLocPtr

	return clLocPtr
}

//----------------------------------------------------------------------
//
// TclContinuationsEnterDerived --
//
//	This procedure is a helper which computes the continuation line
//	information associated with a Tcl_Obj* cut from the middle of a
//	script.
//
// Results:
//	None.
//
// Side effects:
//	Allocates memory for the table of continuation line locations.
//
// TIP #280
//----------------------------------------------------------------------

func XTclContinuationsEnterDerived(tls *libc.TLS, objPtr uintptr, start int32, clNext uintptr) { /* tclObj.c:634:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var length int32 at bp, 4

	var end int32
	var num int32
	var wordCLLast uintptr = clNext

	// We have to handle invisible continuations lines here as well, despite
	// the code we have in TclSubstTokens (TST) for that. Why ?  Nesting. If
	// our script is the sole argument to an 'eval' command, for example, the
	// scriptCLLocPtr we are using was generated by a previous call to TST,
	// and while the words we have here may contain continuation lines they
	// are invisible already, and the inner call to TST had no bs+nl sequences
	// to trigger its code.
	//
	// Luckily for us, the table we have to create here for the current word
	// has to be a slice of the table currently in use, with the locations
	// suitably modified to be relative to the start of the word instead of
	// relative to the script.
	//
	// That is what we are doing now. Determine the slice we need, and if not
	// empty, wrap it into a new table, and save the result into our
	// thread-global hashtable, as usual.

	// First compute the range of the word within the script. (Is there a
	// better way which doesn't shimmer?)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
		*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
		_ = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
	} else {
		XTcl_GetStringFromObj(tls, objPtr, bp)
	}
	end = start + *(*int32)(unsafe.Pointer(bp)) // First char after the word

	// Then compute the table slice covering the range of the word.

	for *(*int32)(unsafe.Pointer(wordCLLast)) >= 0 && *(*int32)(unsafe.Pointer(wordCLLast)) < end {
		wordCLLast += 4
	}

	// And generate the table from the slice, if it was not empty.

	num = int32((int64(wordCLLast) - int64(clNext)) / 4)
	if num != 0 {
		var i int32
		var clLocPtr uintptr = XTclContinuationsEnter(tls, objPtr, num, clNext)

		// Re-base the locations.

		for i = 0; i < num; i++ {
			*(*int32)(unsafe.Pointer(clLocPtr + 4 + uintptr(i)*4)) -= start

			// Continuation lines coming before the string and affecting us
			// should not happen, due to the proper maintenance of clNext
			// during compilation.

			if *(*int32)(unsafe.Pointer(clLocPtr + 4 + uintptr(i)*4)) < 0 {
				XTcl_Panic(tls, ts+53511, 0)
			}
		}
	}
}

//----------------------------------------------------------------------
//
// TclContinuationsCopy --
//
//	This procedure is a helper which copies the continuation line
//	information associated with a Tcl_Obj* to another Tcl_Obj*. It is
//	assumed that both contain the same string/script. Use this when a
//	script is duplicated because it was shared.
//
// Results:
//	None.
//
// Side effects:
//	Allocates memory for the table of continuation line locations.
//
// TIP #280
//----------------------------------------------------------------------

func XTclContinuationsCopy(tls *libc.TLS, objPtr uintptr, originObjPtr uintptr) { /* tclObj.c:727:1: */
	var tsdPtr uintptr = sTclGetContLineTable(tls)
	var hPtr uintptr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr)).FfindProc})).f(tls, (*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr, originObjPtr)

	if hPtr != 0 {
		var clLocPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		XTclContinuationsEnter(tls, objPtr, (*ContLineLoc)(unsafe.Pointer(clLocPtr)).Fnum, clLocPtr+4)
	}
}

//----------------------------------------------------------------------
//
// TclContinuationsGet --
//
//	This procedure is a helper which retrieves the continuation line
//	information associated with a Tcl_Obj*, if it has any.
//
// Results:
//	A reference to the continuation line location table, or NULL if the
//	Tcl_Obj* has no such information associated with it.
//
// Side effects:
//	None.
//
// TIP #280
//----------------------------------------------------------------------

func XTclContinuationsGet(tls *libc.TLS, objPtr uintptr) uintptr { /* tclObj.c:761:13: */
	var tsdPtr uintptr = sTclGetContLineTable(tls)
	var hPtr uintptr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr)).FfindProc})).f(tls, (*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr, objPtr)

	if !(hPtr != 0) {
		return uintptr(0)
	}
	return (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
}

//----------------------------------------------------------------------
//
// TclThreadFinalizeContLines --
//
//	This procedure is a helper which releases all continuation line
//	information currently known. It is run as a thread exit handler.
//
// Results:
//	None.
//
// Side effects:
//	Releases memory.
//
// TIP #280
//----------------------------------------------------------------------

func sTclThreadFinalizeContLines(tls *libc.TLS, clientData ClientData) { /* tclObj.c:794:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// Release the hashtable tracking invisible continuation lines.

	var tsdPtr uintptr = sTclGetContLineTable(tls)
	var hPtr uintptr
	// var hSearch Tcl_HashSearch at bp, 24

	for hPtr = XTcl_FirstHashEntry(tls, (*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr, bp); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
		XTclpFree(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
		XTcl_DeleteHashEntry(tls, hPtr)
	}
	XTcl_DeleteHashTable(tls, (*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr)
	XTclpFree(tls, (*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr)
	(*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr = uintptr(0)
}

//--------------------------------------------------------------
//
// Tcl_RegisterObjType --
//
//	This function is called to register a new Tcl object type in the table
//	of all object types supported by Tcl.
//
// Results:
//	None.
//
// Side effects:
//	The type is registered in the Tcl type table. If there was already a
//	type with the same name as in typePtr, it is replaced with the new
//	type.
//
//--------------------------------------------------------------

func XTcl_RegisterObjType(tls *libc.TLS, typePtr uintptr) { /* tclObj.c:835:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var isNew int32 at bp, 4

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&tableMutex)))
	(*Tcl_HashEntry)(unsafe.Pointer((*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&typeTable)))).FcreateProc})).f(tls, uintptr(unsafe.Pointer(&typeTable)), (*Tcl_ObjType)(unsafe.Pointer(typePtr)).Fname, bp))).FclientData = typePtr
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&tableMutex)))
}

//----------------------------------------------------------------------
//
// Tcl_AppendAllObjTypes --
//
//	This function appends onto the argument object the name of each object
//	type as a list element. This includes the builtin object types (e.g.
//	int, list) as well as those added using Tcl_NewObj. These names can be
//	used, for example, with Tcl_GetObjType to get pointers to the
//	corresponding Tcl_ObjType structures.
//
// Results:
//	The return value is normally TCL_OK; in this case the object
//	referenced by objPtr has each type name appended to it. If an error
//	occurs, TCL_ERROR is returned and the interpreter's result holds an
//	error message.
//
// Side effects:
//	If necessary, the object referenced by objPtr is converted into a list
//	object.
//
//----------------------------------------------------------------------

func XTcl_AppendAllObjTypes(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclObj.c:873:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var hPtr uintptr
	// var search Tcl_HashSearch at bp+8, 24

	// var numElems int32 at bp, 4

	// Get the test for a valid list out of the way first.

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjLength(tls, interp, objPtr, bp)
	}() != TCL_OK {
		return TCL_ERROR
	}

	// Type names are NUL-terminated, not counted strings. This code relies on
	// that.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&tableMutex)))
	for hPtr = XTcl_FirstHashEntry(tls, uintptr(unsafe.Pointer(&typeTable)), bp+8); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp+8) {
		XTcl_ListObjAppendElement(tls, uintptr(0), objPtr,
			XTcl_NewStringObj(tls, func() uintptr {
				if (*Tcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&typeTable)))).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&typeTable)))).FkeyType == -1 {
					return *(*uintptr)(unsafe.Pointer(hPtr + 32))
				}
				return hPtr + 32
			}(), -1))
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&tableMutex)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_GetObjType --
//
//	This function looks up an object type by name.
//
// Results:
//	If an object type with name matching "typeName" is found, a pointer to
//	its Tcl_ObjType structure is returned; otherwise, NULL is returned.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetObjType(tls *libc.TLS, typeName uintptr) uintptr { /* tclObj.c:923:19: */
	var hPtr uintptr
	var typePtr uintptr = uintptr(0)

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&tableMutex)))
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&typeTable)))).FfindProc})).f(tls, uintptr(unsafe.Pointer(&typeTable)), typeName)
	if hPtr != uintptr(0) {
		typePtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&tableMutex)))
	return typePtr
}

//----------------------------------------------------------------------
//
// Tcl_ConvertToType --
//
//	Convert the Tcl object "objPtr" to have type "typePtr" if possible.
//
// Results:
//	The return value is TCL_OK on success and TCL_ERROR on failure. If
//	TCL_ERROR is returned, then the interpreter's result contains an error
//	message unless "interp" is NULL. Passing a NULL "interp" allows this
//	function to be used as a test whether the conversion could be done
//	(and in fact was done).
//
// Side effects:
//	Any internal representation for the old type is freed.
//
//----------------------------------------------------------------------

func XTcl_ConvertToType(tls *libc.TLS, interp uintptr, objPtr uintptr, typePtr uintptr) int32 { /* tclObj.c:960:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == typePtr {
		return TCL_OK
	}

	// Use the target type's Tcl_SetFromAnyProc to set "objPtr"s internal form
	// as appropriate for the target type. This frees the old internal
	// representation.

	if (*Tcl_ObjType)(unsafe.Pointer(typePtr)).FsetFromAnyProc == uintptr(0) {
		if interp != 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+53576, libc.VaList(bp, (*Tcl_ObjType)(unsafe.Pointer(typePtr)).Fname)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+53607, uintptr(0)))
		}
		return TCL_ERROR
	}

	return (*struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer(typePtr)).FsetFromAnyProc})).f(tls, interp, objPtr)
}

//--------------------------------------------------------------
//
// TclDbDumpActiveObjects --
//
//	This function is called to dump all of the active Tcl_Obj structs this
//	allocator knows about.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//--------------------------------------------------------------

func XTclDbDumpActiveObjects(tls *libc.TLS, outFile uintptr) { /* tclObj.c:1005:1: */
}

//----------------------------------------------------------------------
//
// TclDbInitNewObj --
//
//	Called via the TclNewObj or TclDbNewObj macros when TCL_MEM_DEBUG is
//	enabled. This function will initialize the members of a Tcl_Obj
//	struct. Initilization would be done inline via the TclNewObj macro
//	when compiling without TCL_MEM_DEBUG.
//
// Results:
//	The Tcl_Obj struct members are initialized.
//
// Side effects:
//	None.
//----------------------------------------------------------------------

//----------------------------------------------------------------------
//
// Tcl_NewObj --
//
//	This function is normally called when not debugging: i.e., when
//	TCL_MEM_DEBUG is not defined. It creates new Tcl objects that denote
//	the empty string. These objects have a NULL object type and NULL
//	string representation byte pointer. Type managers call this routine to
//	allocate new objects that they further initialize.
//
//	When TCL_MEM_DEBUG is defined, this function just returns the result
//	of calling the debugging version Tcl_DbNewObj.
//
// Results:
//	The result is a newly allocated object that represents the empty
//	string. The new object's typePtr is set NULL and its ref count is set
//	to 0.
//
// Side effects:
//	If compiling with TCL_COMPILE_STATS, this function increments the
//	global count of allocated objects (tclObjsAlloced).
//
//----------------------------------------------------------------------

func XTcl_NewObj(tls *libc.TLS) uintptr { /* tclObj.c:1142:9: */
	var objPtr uintptr

	// Use the macro defined in tclInt.h - it will use the correct allocator.

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	return objPtr
}

//----------------------------------------------------------------------
//
// Tcl_DbNewObj --
//
//	This function is normally called when debugging: i.e., when
//	TCL_MEM_DEBUG is defined. It creates new Tcl objects that denote the
//	empty string. It is the same as the Tcl_NewObj function above except
//	that it calls Tcl_DbCkalloc directly with the file name and line
//	number from its caller. This simplifies debugging since then the
//	[memory active] command will report the correct file name and line
//	number when reporting objects that haven't been freed.
//
//	When TCL_MEM_DEBUG is not defined, this function just returns the
//	result of calling Tcl_NewObj.
//
// Results:
//	The result is a newly allocated that represents the empty string. The
//	new object's typePtr is set NULL and its ref count is set to 0.
//
// Side effects:
//	If compiling with TCL_COMPILE_STATS, this function increments the
//	global count of allocated objects (tclObjsAlloced).
//
//----------------------------------------------------------------------

func XTcl_DbNewObj(tls *libc.TLS, file uintptr, line int32) uintptr { /* tclObj.c:1203:9: */
	return XTcl_NewObj(tls)
}

//----------------------------------------------------------------------
//
// TclAllocateFreeObjects --
//
//	Function to allocate a number of free Tcl_Objs. This is done using a
//	single ckalloc to reduce the overhead for Tcl_Obj allocation.
//
//	Assumes mutex is held.
//
// Results:
//	None.
//
// Side effects:
//	tclFreeObjList, the head of the list of free Tcl_Objs, is set to the
//	first of a number of free Tcl_Obj's linked together by their
//	internalRep.twoPtrValue.ptr1's.
//
//----------------------------------------------------------------------

func XTclAllocateFreeObjects(tls *libc.TLS) { /* tclObj.c:1238:1: */
	var bytesToAlloc Size_t = uint64(100) * uint64(unsafe.Sizeof(Tcl_Obj{}))
	var basePtr uintptr
	var prevPtr uintptr
	var objPtr uintptr
	var i int32

	// This has been noted by Purify to be a potential leak. The problem is
	// that Tcl, when not TCL_MEM_DEBUG compiled, keeps around all allocated
	// Tcl_Obj's, pointed to by tclFreeObjList, when freed instead of actually
	// freeing the memory. TclFinalizeObjects() does not ckfree() this memory,
	// but leaves it to Tcl's memory subsystem finalization to release it.
	// Purify apparently can't figure that out, and fires a false alarm.

	basePtr = XTcl_Alloc(tls, uint32(bytesToAlloc))

	prevPtr = uintptr(0)
	objPtr = basePtr
	for i = 0; i < 100; i++ {
		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = prevPtr
		prevPtr = objPtr
		objPtr += 48
	}
	XtclFreeObjList = prevPtr
}

//----------------------------------------------------------------------
//
// TclFreeObj --
//
//	This function frees the memory associated with the argument object.
//	It is called by the tcl.h macro Tcl_DecrRefCount when an object's ref
//	count is zero. It is only "public" since it must be callable by that
//	macro wherever the macro is used. It should not be directly called by
//	clients.
//
// Results:
//	None.
//
// Side effects:
//	Deallocates the storage for the object's Tcl_Obj structure after
//	deallocating the string representation and calling the type-specific
//	Tcl_FreeInternalRepProc to deallocate the object's internal
//	representation. If compiling with TCL_COMPILE_STATS, this function
//	increments the global count of freed objects (tclObjsFreed).
//
//----------------------------------------------------------------------

func XTclFreeObj(tls *libc.TLS, objPtr uintptr) { /* tclObj.c:1418:1: */
	// Invalidate the string rep first so we can use the bytes value for our
	// pointer chain, and signal an obj deletion (as opposed to shimmering)
	// with 'length == -1'.

	for ok := true; ok; ok = 0 != 0 {
		var _isobjPtr uintptr = objPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1

	if !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
		/*
		 * objPtr can be freed safely, as it will not attempt to free any
		 * other objects: it will not cause recursive calls to this function.
		 */

		{
		}

		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
			}() {
				XTclThreadFreeObj(tls, objPtr)
			} else {
				*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
			}
		}

	} else {
		// This macro declares a variable, so must come here...

		var context uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&pendingObjDataKey)), int32(unsafe.Sizeof(PendingObjData{})))

		if (*PendingObjData)(unsafe.Pointer(context)).FdeletionCount > 0 {
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = (*PendingObjData)(unsafe.Pointer(context)).FdeletionStack
			(*PendingObjData)(unsafe.Pointer(context)).FdeletionStack = objPtr
		} else {
			/*
			 * Note that the contents of the while loop assume that the string
			 * rep has already been freed and we don't want to do anything
			 * fancy with adding to the queue inside ourselves. Must take care
			 * to unstack the object first since freeing the internal rep can
			 * add further objects to the stack. The code assumes that it is
			 * the first thing in a block; all current usages in the core
			 * satisfy this.
			 */

			{
			}

			(*PendingObjData)(unsafe.Pointer(context)).FdeletionCount++
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
			(*PendingObjData)(unsafe.Pointer(context)).FdeletionCount--

			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, objPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}

			(*PendingObjData)(unsafe.Pointer(context)).FdeletionCount++
			for (*PendingObjData)(unsafe.Pointer(context)).FdeletionStack != uintptr(0) {
				var objToFree uintptr

				objToFree = (*PendingObjData)(unsafe.Pointer(context)).FdeletionStack
				(*PendingObjData)(unsafe.Pointer(context)).FdeletionStack = (*Tcl_Obj)(unsafe.Pointer(objToFree)).Fbytes
				{
				}

				if (*Tcl_Obj)(unsafe.Pointer(objToFree)).FtypePtr != uintptr(0) &&
					(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objToFree)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
					(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objToFree)).FtypePtr)).FfreeIntRepProc})).f(tls, objToFree)
				}
				for ok3 := true; ok3; ok3 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, objToFree)
					} else {
						*(*uintptr)(unsafe.Pointer(objToFree + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objToFree
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}

			}
			(*PendingObjData)(unsafe.Pointer(context)).FdeletionCount--
		}
	}

	/*
	 * We cannot use TclGetContinuationTable() here, because that may
	 * re-initialize the thread-data for calls coming after the finalization.
	 * We have to access it using the low-level call and then check for
	 * validity. This function can be called after TclFinalizeThreadData() has
	 * already killed the thread-global data structures. Performing
	 * TCL_TSD_INIT will leave us with an un-initialized memory block upon
	 * which we crash (if we where to access the uninitialized hashtable).
	 */

	{
		var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey9)), int32(unsafe.Sizeof(ThreadSpecificData10{})))
		var hPtr uintptr

		if (*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr != 0 {
			hPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr)).FfindProc})).f(tls, (*ThreadSpecificData10)(unsafe.Pointer(tsdPtr)).FlineCLPtr, objPtr)
			if hPtr != 0 {
				XTclpFree(tls, (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)
				XTcl_DeleteHashEntry(tls, hPtr)
			}
		}

	}
}

//----------------------------------------------------------------------
//
// TclObjBeingDeleted --
//
//	This function returns 1 when the Tcl_Obj is being deleted. It is
//	provided for the rare cases where the reason for the loss of an
//	internal rep might be relevant. [FR 1512138]
//
// Results:
//	1 if being deleted, 0 otherwise.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclObjBeingDeleted(tls *libc.TLS, objPtr uintptr) int32 { /* tclObj.c:1527:1: */
	return libc.Bool32((*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == -1)
}

//----------------------------------------------------------------------
//
// Tcl_DuplicateObj --
//
//	Create and return a new object that is a duplicate of the argument
//	object.
//
// Results:
//	The return value is a pointer to a newly created Tcl_Obj. This object
//	has reference count 0 and the same type, if any, as the source object
//	objPtr. Also:
//	  1) If the source object has a valid string rep, we copy it;
//	     otherwise, the duplicate's string rep is set NULL to mark it
//	     invalid.
//	  2) If the source object has an internal representation (i.e. its
//	     typePtr is non-NULL), the new object's internal rep is set to a
//	     copy; otherwise the new internal rep is marked invalid.
//
// Side effects:
//	What constitutes "copying" the internal representation depends on the
//	type. For example, if the argument object is a list, the element
//	objects it points to will not actually be copied but will be shared
//	with the duplicate list. That is, the ref counts of the element
//	objects will be incremented.
//
//----------------------------------------------------------------------

func XTcl_DuplicateObj(tls *libc.TLS, objPtr uintptr) uintptr { /* tclObj.c:1581:9: */
	var dupPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			dupPtr = XTclThreadAllocObj(tls)
		} else {
			dupPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(dupPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(dupPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(dupPtr)).FtypePtr = uintptr(0)
	{
	}

	{
		var typePtr uintptr = (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr
		var bytes uintptr = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		if bytes != 0 {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == 0 {
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Fbytes = XTcl_Alloc(tls, uint32((*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(dupPtr)).Fbytes, bytes, uint64((*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dupPtr)).Fbytes + uintptr((*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength))) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Flength = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
			}
		} else {
			(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Fbytes = uintptr(0)
		}
		if typePtr != 0 {
			if (*Tcl_ObjType)(unsafe.Pointer(typePtr)).FdupIntRepProc != 0 {
				(*struct {
					f func(*libc.TLS, uintptr, uintptr)
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer(typePtr)).FdupIntRepProc})).f(tls, objPtr, dupPtr)
			} else {
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).FinternalRep = (*Tcl_Obj)(unsafe.Pointer(objPtr)).FinternalRep
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).FtypePtr = typePtr
			}
		}
	}

	return dupPtr
}

func XTclSetDuplicateObj(tls *libc.TLS, dupPtr uintptr, objPtr uintptr) { /* tclObj.c:1593:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if (*Tcl_Obj)(unsafe.Pointer(dupPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+53617))
	}
	for ok := true; ok; ok = 0 != 0 {
		var _isobjPtr uintptr = dupPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	if (*Tcl_Obj)(unsafe.Pointer(dupPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dupPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dupPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, dupPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(dupPtr)).FtypePtr = uintptr(0)
	}

	{
		var typePtr uintptr = (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr
		var bytes uintptr = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		if bytes != 0 {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == 0 {
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Fbytes = XTcl_Alloc(tls, uint32((*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(dupPtr)).Fbytes, bytes, uint64((*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dupPtr)).Fbytes + uintptr((*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength))) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Flength = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
			}
		} else {
			(*Tcl_Obj)(unsafe.Pointer(dupPtr)).Fbytes = uintptr(0)
		}
		if typePtr != 0 {
			if (*Tcl_ObjType)(unsafe.Pointer(typePtr)).FdupIntRepProc != 0 {
				(*struct {
					f func(*libc.TLS, uintptr, uintptr)
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer(typePtr)).FdupIntRepProc})).f(tls, objPtr, dupPtr)
			} else {
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).FinternalRep = (*Tcl_Obj)(unsafe.Pointer(objPtr)).FinternalRep
				(*Tcl_Obj)(unsafe.Pointer(dupPtr)).FtypePtr = typePtr
			}
		}
	}

}

//----------------------------------------------------------------------
//
// Tcl_GetString --
//
//	Returns the string representation byte array pointer for an object.
//
// Results:
//	Returns a pointer to the string representation of objPtr. The byte
//	array referenced by the returned pointer must not be modified by the
//	caller. Furthermore, the caller must copy the bytes if they need to
//	retain them since the object's string rep can change as a result of
//	other operations.
//
// Side effects:
//	May call the object's updateStringProc to update the string
//	representation from the internal representation.
//
//----------------------------------------------------------------------

func XTcl_GetString(tls *libc.TLS, objPtr uintptr) uintptr { /* tclObj.c:1626:6: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != uintptr(0) {
		return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
	}

	// Note we do not check for objPtr->typePtr == NULL.  An invariant of
	// a properly maintained Tcl_Obj is that at least  one of objPtr->bytes
	// and objPtr->typePtr must not be NULL.  If broken extensions fail to
	// maintain that invariant, we can crash here.

	if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FupdateStringProc == uintptr(0) {
		// Those Tcl_ObjTypes which choose not to define an updateStringProc
		// must be written in such a way that (objPtr->bytes) never becomes
		// NULL.  This panic was added in Tcl 8.1.

		XTcl_Panic(tls, ts+53636,
			libc.VaList(bp, (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).Fname))
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FupdateStringProc})).f(tls, objPtr)
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) || (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength < 0 ||
		int32(*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr((*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength)))) != 0 {
		XTcl_Panic(tls,
			ts+53687, libc.VaList(bp+8, (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).Fname))
	}
	return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
}

//----------------------------------------------------------------------
//
// Tcl_GetStringFromObj --
//
//	Returns the string representation's byte array pointer and length for
//	an object.
//
// Results:
//	Returns a pointer to the string representation of objPtr. If lengthPtr
//	isn't NULL, the length of the string representation is stored at
//	*lengthPtr. The byte array referenced by the returned pointer must not
//	be modified by the caller. Furthermore, the caller must copy the bytes
//	if they need to retain them since the object's string rep can change
//	as a result of other operations.
//
// Side effects:
//	May call the object's updateStringProc to update the string
//	representation from the internal representation.
//
//----------------------------------------------------------------------

func XTcl_GetStringFromObj(tls *libc.TLS, objPtr uintptr, lengthPtr uintptr) uintptr { /* tclObj.c:1684:6: */
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0) {
		XTcl_GetString(tls, objPtr)
	}

	if lengthPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(lengthPtr)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
	}
	return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
}

//----------------------------------------------------------------------
//
// Tcl_InvalidateStringRep --
//
//	This function is called to invalidate an object's string
//	representation.
//
// Results:
//	None.
//
// Side effects:
//	Deallocates the storage for any old string representation, then sets
//	the string representation NULL to mark it invalid.
//
//----------------------------------------------------------------------

func XTcl_InvalidateStringRep(tls *libc.TLS, objPtr uintptr) { /* tclObj.c:1719:1: */
	for ok := true; ok; ok = 0 != 0 {
		var _isobjPtr uintptr = objPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_NewBooleanObj --
//
//	This function is normally called when not debugging: i.e., when
//	TCL_MEM_DEBUG is not defined. It creates a new Tcl_Obj and
//	initializes it from the argument boolean value. A nonzero "boolValue"
//	is coerced to 1.
//
//	When TCL_MEM_DEBUG is defined, this function just returns the result
//	of calling the debugging version Tcl_DbNewBooleanObj.
//
// Results:
//	The newly created object is returned. This object will have an invalid
//	string representation. The returned object has ref count 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_NewBooleanObj(tls *libc.TLS, boolValue int32) uintptr { /* tclObj.c:1761:9: */
	var objPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				objPtr = XTclThreadAllocObj(tls)
			} else {
				objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)
		*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(libc.Bool32(boolValue != 0))
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
		{
		}
	}
	return objPtr
}

//----------------------------------------------------------------------
//
// Tcl_DbNewBooleanObj --
//
//	This function is normally called when debugging: i.e., when
//	TCL_MEM_DEBUG is defined. It creates new boolean objects. It is the
//	same as the Tcl_NewBooleanObj function above except that it calls
//	Tcl_DbCkalloc directly with the file name and line number from its
//	caller. This simplifies debugging since then the [memory active]
//	command will report the correct file name and line number when
//	reporting objects that haven't been freed.
//
//	When TCL_MEM_DEBUG is not defined, this function just returns the
//	result of calling Tcl_NewBooleanObj.
//
// Results:
//	The newly created object is returned. This object will have an invalid
//	string representation. The returned object has ref count 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_DbNewBooleanObj(tls *libc.TLS, boolValue int32, file uintptr, line int32) uintptr { /* tclObj.c:1821:9: */
	return XTcl_NewBooleanObj(tls, boolValue)
}

//----------------------------------------------------------------------
//
// Tcl_SetBooleanObj --
//
//	Modify an object to be a boolean object and to have the specified
//	boolean value. A nonzero "boolValue" is coerced to 1.
//
// Results:
//	None.
//
// Side effects:
//	The object's old string rep, if any, is freed. Also, any old internal
//	rep is freed.
//
//----------------------------------------------------------------------

func XTcl_SetBooleanObj(tls *libc.TLS, objPtr uintptr, boolValue int32) { /* tclObj.c:1853:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+53754))
	}

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _isobjPtr uintptr = objPtr
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
			}
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		}
		*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(libc.Bool32(boolValue != 0))
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	}

}

//----------------------------------------------------------------------
//
// Tcl_GetBooleanFromObj --
//
//	Attempt to return a boolean from the Tcl object "objPtr". This
//	includes conversion from any of Tcl's numeric types.
//
// Results:
//	The return value is a standard Tcl object result. If an error occurs
//	during conversion, an error message is left in the interpreter's
//	result unless "interp" is NULL.
//
// Side effects:
//	The internalrep of *objPtr may be changed.
//
//----------------------------------------------------------------------

func XTcl_GetBooleanFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, boolPtr uintptr) int32 { /* tclObj.c:1884:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	for ok := true; ok; ok = sParseBoolean(tls, objPtr) == TCL_OK || TCL_OK == XTclParseNumber(tls, interp, objPtr, ts+53772, uintptr(0), -1, uintptr(0), 0) {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			*(*int32)(unsafe.Pointer(boolPtr)) = libc.Bool32(*(*int64)(unsafe.Pointer(objPtr + 32)) != int64(0))
			return TCL_OK
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBooleanType)) {
			*(*int32)(unsafe.Pointer(boolPtr)) = int32(*(*int64)(unsafe.Pointer(objPtr + 32)))
			return TCL_OK
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
			// Caution: Don't be tempted to check directly for the "double"
			// Tcl_ObjType and then compare the internalrep to 0.0. This isn't
			// reliable because a "double" Tcl_ObjType can hold the NaN value.
			// Use the API Tcl_GetDoubleFromObj, which does the checking and
			// sets the proper error message for us.

			// var d float64 at bp, 8

			if XTcl_GetDoubleFromObj(tls, interp, objPtr, bp) != TCL_OK {
				return TCL_ERROR
			}
			*(*int32)(unsafe.Pointer(boolPtr)) = libc.Bool32(*(*float64)(unsafe.Pointer(bp)) != 0.0)
			return TCL_OK
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType)) {
			*(*int32)(unsafe.Pointer(boolPtr)) = 1
			return TCL_OK
		}
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclSetBooleanFromAny --
//
//	Attempt to generate a boolean internal form for the Tcl object
//	"objPtr".
//
// Results:
//	The return value is a standard Tcl result. If an error occurs during
//	conversion, an error message is left in the interpreter's result
//	unless "interp" is NULL.
//
// Side effects:
//	If no error occurs, an integer 1 or 0 is stored as "objPtr"s internal
//	representation and the type of "objPtr" is set to boolean.
//
//----------------------------------------------------------------------

func XTclSetBooleanFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclObj.c:1951:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var cachePtr uintptr
	// var length int32 at bp+32, 4

	var str uintptr
	var msg uintptr
	// For some "pure" numeric Tcl_ObjTypes (no string rep), we can determine
	// whether a boolean conversion is possible without generating the string
	// rep.

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0)) {
		goto __1
	}
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType))) {
		goto __2
	}
	switch *(*int64)(unsafe.Pointer(objPtr + 32)) {
	case 0:
		goto __4
	case 1:
		goto __5
	}
	goto __3
__4:
__5:
	return TCL_OK
__3:
	;
	goto badBoolean
__2:
	;

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType))) {
		goto __6
	}
	goto badBoolean
__6:
	;

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType))) {
		goto __7
	}
	goto badBoolean
__7:
	;
__1:
	;

	if !(sParseBoolean(tls, objPtr) == TCL_OK) {
		goto __8
	}
	return TCL_OK
__8:
	;

badBoolean:
	if !(interp != uintptr(0)) {
		goto __9
	}
	str = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 32)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp+32)
	}()

__10:
	;
__13:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __16
	}
	msg = XTclThreadAllocObj(tls)
	goto __17
__16:
	msg = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(msg + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__17:
	;
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([33]int8{}))-uint64(1)) == 0) {
		goto __18
	}
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = 0
	goto __19
__18:
	(*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([33]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes, ts+53786, uint64(int32(uint64(unsafe.Sizeof([33]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(msg)).Fbytes + 32)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(msg)).Flength = int32(uint64(unsafe.Sizeof([33]int8{})) - uint64(1))
__19:
	;
	(*Tcl_Obj)(unsafe.Pointer(msg)).FtypePtr = uintptr(0)

	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
	XTcl_AppendLimitedToObj(tls, msg, str, *(*int32)(unsafe.Pointer(bp + 32 /* length */)), 50, ts+2046)
	XTcl_AppendToObj(tls, msg, ts+25027, -1)
	XTcl_SetObjResult(tls, interp, msg)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+6915, ts+53819, uintptr(0)))
__9:
	;
	return TCL_ERROR
}

func sParseBoolean(tls *libc.TLS, objPtr uintptr) int32 { /* tclObj.c:2005:1: */
	bp := tls.Alloc(10)
	defer tls.Free(10)

	var i int32
	// var length int32 at bp, 4

	var newBool int32
	// var lowerCase [6]int8 at bp+4, 6

	var str uintptr
	var c int8
	str = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp)
	}()

	if !(*(*int32)(unsafe.Pointer(bp)) == 0 || *(*int32)(unsafe.Pointer(bp)) > 5) {
		goto __1
	}
	// Longest valid boolean string rep. is "false".

	return TCL_ERROR
__1:
	;

	switch int32(*(*int8)(unsafe.Pointer(str))) {
	case '0':
		goto __3
	case '1':
		goto __4
	}
	goto __2
__3:
	if !(*(*int32)(unsafe.Pointer(bp)) == 1) {
		goto __5
	}
	newBool = 0
	goto numericBoolean
__5:
	;
	return TCL_ERROR
__4:
	if !(*(*int32)(unsafe.Pointer(bp)) == 1) {
		goto __6
	}
	newBool = 1
	goto numericBoolean
__6:
	;
	return TCL_ERROR
__2:
	;

	// Force to lower case for case-insensitive detection. Filter out known
	// invalid characters at the same time.

	i = 0
__7:
	if !(i < *(*int32)(unsafe.Pointer(bp))) {
		goto __9
	}
	c = *(*int8)(unsafe.Pointer(str + uintptr(i)))

	switch int32(c) {
	case 'A':
		goto __11
	case 'E':
		goto __12
	case 'F':
		goto __13
	case 'L':
		goto __14
	case 'N':
		goto __15
	case 'O':
		goto __16
	case 'R':
		goto __17
	case 'S':
		goto __18
	case 'T':
		goto __19
	case 'U':
		goto __20
	case 'Y':
		goto __21
	case 'a':
		goto __22
	case 'e':
		goto __23
	case 'f':
		goto __24
	case 'l':
		goto __25
	case 'n':
		goto __26
	case 'o':
		goto __27
	case 'r':
		goto __28
	case 's':
		goto __29
	case 't':
		goto __30
	case 'u':
		goto __31
	case 'y':
		goto __32
	default:
		goto __33
	}
	goto __10
__11:
__12:
__13:
__14:
__15:
__16:
__17:
__18:
__19:
__20:
__21:
	*(*int8)(unsafe.Pointer(bp + 4 + uintptr(i))) = int8(int32(c) + int32(int8('a'-'A')))
	goto __10
__22:
__23:
__24:
__25:
__26:
__27:
__28:
__29:
__30:
__31:
__32:
	*(*int8)(unsafe.Pointer(bp + 4 + uintptr(i))) = c
	goto __10
__33:
	return TCL_ERROR
__10:
	;
	goto __8
__8:
	i++
	goto __7
	goto __9
__9:
	;
	*(*int8)(unsafe.Pointer(bp + 4 + uintptr(*(*int32)(unsafe.Pointer(bp /* length */))))) = int8(0)
	switch int32(*(*int8)(unsafe.Pointer(bp + 4))) {
	case 'y':
		goto __35
	case 'n':
		goto __36
	case 't':
		goto __37
	case 'f':
		goto __38
	case 'o':
		goto __39
	default:
		goto __40
	}
	goto __34
__35:
	// Checking the 'y' is redundant, but makes the code clearer.
	if !(libc.Xstrncmp(tls, bp+4, ts+53827, uint64(*(*int32)(unsafe.Pointer(bp)))) == 0) {
		goto __41
	}
	newBool = 1
	goto goodBoolean
__41:
	;
	return TCL_ERROR
__36:
	if !(libc.Xstrncmp(tls, bp+4, ts+53831, uint64(*(*int32)(unsafe.Pointer(bp)))) == 0) {
		goto __42
	}
	newBool = 0
	goto goodBoolean
__42:
	;
	return TCL_ERROR
__37:
	if !(libc.Xstrncmp(tls, bp+4, ts+16115, uint64(*(*int32)(unsafe.Pointer(bp)))) == 0) {
		goto __43
	}
	newBool = 1
	goto goodBoolean
__43:
	;
	return TCL_ERROR
__38:
	if !(libc.Xstrncmp(tls, bp+4, ts+16109, uint64(*(*int32)(unsafe.Pointer(bp)))) == 0) {
		goto __44
	}
	newBool = 0
	goto goodBoolean
__44:
	;
	return TCL_ERROR
__39:
	if !(*(*int32)(unsafe.Pointer(bp)) < 2) {
		goto __45
	}
	return TCL_ERROR
__45:
	;
	if !(libc.Xstrncmp(tls, bp+4, ts+18162, uint64(*(*int32)(unsafe.Pointer(bp)))) == 0) {
		goto __46
	}
	newBool = 1
	goto goodBoolean
	goto __47
__46:
	if !(libc.Xstrncmp(tls, bp+4, ts+53834, uint64(*(*int32)(unsafe.Pointer(bp)))) == 0) {
		goto __48
	}
	newBool = 0
	goto goodBoolean
__48:
	;
__47:
	;
	return TCL_ERROR
__40:
	return TCL_ERROR
__34:
	;

	// Free the old internalRep before setting the new one. We do this as late
	// as possible to allow the conversion code, in particular
	// Tcl_GetStringFromObj, to use that old internalRep.

goodBoolean:
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __49
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __50
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__50:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__49:
	;

	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(newBool)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclBooleanType))
	return TCL_OK

numericBoolean:
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __51
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __52
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__52:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__51:
	;

	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(newBool)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_NewDoubleObj --
//
//	This function is normally called when not debugging: i.e., when
//	TCL_MEM_DEBUG is not defined. It creates a new double object and
//	initializes it from the argument double value.
//
//	When TCL_MEM_DEBUG is defined, this function just returns the result
//	of calling the debugging version Tcl_DbNewDoubleObj.
//
// Results:
//	The newly created object is returned. This object will have an
//	invalid string representation. The returned object has ref count 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_NewDoubleObj(tls *libc.TLS, dblValue float64) uintptr { /* tclObj.c:2154:9: */
	var objPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				objPtr = XTclThreadAllocObj(tls)
			} else {
				objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)
		*(*float64)(unsafe.Pointer(objPtr + 32)) = dblValue
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType))
		{
		}
	}
	return objPtr
}

//----------------------------------------------------------------------
//
// Tcl_DbNewDoubleObj --
//
//	This function is normally called when debugging: i.e., when
//	TCL_MEM_DEBUG is defined. It creates new double objects. It is the
//	same as the Tcl_NewDoubleObj function above except that it calls
//	Tcl_DbCkalloc directly with the file name and line number from its
//	caller. This simplifies debugging since then the [memory active]
//	command will report the correct file name and line number when
//	reporting objects that haven't been freed.
//
//	When TCL_MEM_DEBUG is not defined, this function just returns the
//	result of calling Tcl_NewDoubleObj.
//
// Results:
//	The newly created object is returned. This object will have an invalid
//	string representation. The returned object has ref count 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_DbNewDoubleObj(tls *libc.TLS, dblValue float64, file uintptr, line int32) uintptr { /* tclObj.c:2213:9: */
	return XTcl_NewDoubleObj(tls, dblValue)
}

//----------------------------------------------------------------------
//
// Tcl_SetDoubleObj --
//
//	Modify an object to be a double object and to have the specified
//	double value.
//
// Results:
//	None.
//
// Side effects:
//	The object's old string rep, if any, is freed. Also, any old internal
//	rep is freed.
//
//----------------------------------------------------------------------

func XTcl_SetDoubleObj(tls *libc.TLS, objPtr uintptr, dblValue float64) { /* tclObj.c:2244:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+53838))
	}

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _isobjPtr uintptr = objPtr
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
			}
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		}
		*(*float64)(unsafe.Pointer(objPtr + 32)) = dblValue
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType))
	}
}

//----------------------------------------------------------------------
//
// Tcl_GetDoubleFromObj --
//
//	Attempt to return a double from the Tcl object "objPtr". If the object
//	is not already a double, an attempt will be made to convert it to one.
//
// Results:
//	The return value is a standard Tcl object result. If an error occurs
//	during conversion, an error message is left in the interpreter's
//	result unless "interp" is NULL.
//
// Side effects:
//	If the object is not already a double, the conversion will free any
//	old internal representation.
//
//----------------------------------------------------------------------

func XTcl_GetDoubleFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, dblPtr uintptr) int32 { /* tclObj.c:2276:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	for ok := true; ok; ok = sSetDoubleFromAny(tls, interp, objPtr) == TCL_OK {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
			if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(objPtr + 32))) != 0 {
				if interp != uintptr(0) {
					XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
						ts+53855, -1))
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+6915, ts+53892, ts+53899,
						uintptr(0)))
				}
				return TCL_ERROR
			}
			*(*float64)(unsafe.Pointer(dblPtr)) = *(*float64)(unsafe.Pointer(objPtr + 32))
			return TCL_OK
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			*(*float64)(unsafe.Pointer(dblPtr)) = float64(*(*int64)(unsafe.Pointer(objPtr + 32)))
			return TCL_OK
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType)) {
			// var big Mp_int at bp+40, 24

			if *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) == libc.UintptrFromInt64(int64(-1)) {
				*(*Mp_int)(unsafe.Pointer(bp + 40)) = *(*Mp_int)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32))))
			} else {
				(*Mp_int)(unsafe.Pointer(bp + 40 /* &big */)).Fdp = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*Mp_int)(unsafe.Pointer(bp + 40 /* &big */)).Fsign = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 30
				(*Mp_int)(unsafe.Pointer(bp + 40 /* &big */)).Falloc = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 15 & 0x7FFF
				(*Mp_int)(unsafe.Pointer(bp + 40 /* &big */)).Fused = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) & 0x7FFF
			}

			*(*float64)(unsafe.Pointer(dblPtr)) = XTclBignumToDouble(tls, bp+40)
			return TCL_OK
		}
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// SetDoubleFromAny --
//
//	Attempt to generate an double-precision floating point internal form
//	for the Tcl object "objPtr".
//
// Results:
//	The return value is a standard Tcl object result. If an error occurs
//	during conversion, an error message is left in the interpreter's
//	result unless "interp" is NULL.
//
// Side effects:
//	If no error occurs, a double is stored as "objPtr"s internal
//	representation.
//
//----------------------------------------------------------------------

func sSetDoubleFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclObj.c:2337:1: */
	return XTclParseNumber(tls, interp, objPtr, ts+53903, uintptr(0), -1,
		uintptr(0), 0)
}

//----------------------------------------------------------------------
//
// UpdateStringOfDouble --
//
//	Update the string representation for a double-precision floating point
//	object. This must obey the current tcl_precision value for
//	double-to-string conversions. Note: This function does not free an
//	existing old string rep so storage will be lost if this has not
//	already been done.
//
// Results:
//	None.
//
// Side effects:
//	The object's string is set to a valid string that results from the
//	double-to-string conversion.
//
//----------------------------------------------------------------------

func sUpdateStringOfDouble(tls *libc.TLS, objPtr uintptr) { /* tclObj.c:2367:1: */
	bp := tls.Alloc(27)
	defer tls.Free(27)

	// var buffer [27]int8 at bp, 27

	var len int32

	XTcl_PrintDouble(tls, uintptr(0), *(*float64)(unsafe.Pointer(objPtr + 32)), bp)
	len = int32(libc.Xstrlen(tls, bp))

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(len+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, bp, uint64(len+1))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = len
}

//----------------------------------------------------------------------
//
// Tcl_NewIntObj --
//
//	If a client is compiled with TCL_MEM_DEBUG defined, calls to
//	Tcl_NewIntObj to create a new integer object end up calling the
//	debugging function Tcl_DbNewLongObj instead.
//
//	Otherwise, if the client is compiled without TCL_MEM_DEBUG defined,
//	calls to Tcl_NewIntObj result in a call to one of the two
//	Tcl_NewIntObj implementations below. We provide two implementations so
//	that the Tcl core can be compiled to do memory debugging of the core
//	even if a client does not request it for itself.
//
//	Integer and long integer objects share the same "integer" type
//	implementation. We store all integers as longs and Tcl_GetIntFromObj
//	checks whether the current value of the long can be represented by an
//	int.
//
// Results:
//	The newly created object is returned. This object will have an invalid
//	string representation. The returned object has ref count 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_NewIntObj(tls *libc.TLS, intValue int32) uintptr { /* tclObj.c:2423:9: */
	var objPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				objPtr = XTclThreadAllocObj(tls)
			} else {
				objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)
		*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(intValue)
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
		{
		}
	}
	return objPtr
}

//----------------------------------------------------------------------
//
// Tcl_SetIntObj --
//
//	Modify an object to be an integer and to have the specified integer
//	value.
//
// Results:
//	None.
//
// Side effects:
//	The object's old string rep, if any, is freed. Also, any old internal
//	rep is freed.
//
//----------------------------------------------------------------------

func XTcl_SetIntObj(tls *libc.TLS, objPtr uintptr, intValue int32) { /* tclObj.c:2454:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+53925))
	}

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _isobjPtr uintptr = objPtr
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
			}
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		}
		*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(intValue)
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	}
}

//----------------------------------------------------------------------
//
// Tcl_GetIntFromObj --
//
//	Retrieve the integer value of 'objPtr'.
//
// Value
//
//	TCL_OK
//
//	    Success.
//
//	TCL_ERROR
//
//	    An error occurred during conversion or the integral value can not
//	    be represented as an integer (it might be too large). An error
//	    message is left in the interpreter's result if 'interp' is not
//	    NULL.
//
// Effect
//
//	'objPtr' is converted to an integer if necessary if it is not one
//	already.  The conversion frees any previously-existing internal
//	representation.
//
//----------------------------------------------------------------------

func XTcl_GetIntFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, intPtr uintptr) int32 { /* tclObj.c:2495:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	// var l int64 at bp+32, 8

	if func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int64)(unsafe.Pointer(bp + 32)) = *(*int64)(unsafe.Pointer(objPtr + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetLongFromObj(tls, interp, objPtr, bp+32)
	}() != TCL_OK {
		return TCL_ERROR
	}
	if uint64(0x7fffffffffffffff)*2+1 > uint64(uint32(0x7fffffff)*2+1) && (*(*int64)(unsafe.Pointer(bp + 32)) > int64(uint32(0x7fffffff)*2+1) || *(*int64)(unsafe.Pointer(bp + 32)) < -int64(uint32(0x7fffffff)*2+1)) {
		if interp != uintptr(0) {
			var s uintptr = ts + 53939 /* "integer value to..." */
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, s, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+8249, ts+53996, s, uintptr(0)))
		}
		return TCL_ERROR
	}
	*(*int32)(unsafe.Pointer(intPtr)) = int32(*(*int64)(unsafe.Pointer(bp + 32 /* l */)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// SetIntFromAny --
//
//	Attempts to force the internal representation for a Tcl object to
//	tclIntType, specifically.
//
// Results:
//	The return value is a standard object Tcl result. If an error occurs
//	during conversion, an error message is left in the interpreter's
//	result unless "interp" is NULL.
//
//----------------------------------------------------------------------

func sSetIntFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclObj.c:2539:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var l int64 at bp, 8

	return func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 { *(*int64)(unsafe.Pointer(bp)) = *(*int64)(unsafe.Pointer(objPtr + 32)); return TCL_OK }()
		}
		return XTcl_GetLongFromObj(tls, interp, objPtr, bp)
	}()
}

//----------------------------------------------------------------------
//
// UpdateStringOfInt --
//
//	Update the string representation for an integer object. Note: This
//	function does not free an existing old string rep so storage will be
//	lost if this has not already been done.
//
// Results:
//	None.
//
// Side effects:
//	The object's string is set to a valid string that results from the
//	int-to-string conversion.
//
//----------------------------------------------------------------------

func sUpdateStringOfInt(tls *libc.TLS, objPtr uintptr) { /* tclObj.c:2568:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var buffer [24]int8 at bp, 24

	var len int32

	len = XTclFormatInt(tls, bp, *(*int64)(unsafe.Pointer(objPtr + 32)))

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(len+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, bp, uint64(len+1))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = len
}

//----------------------------------------------------------------------
//
// Tcl_NewLongObj --
//
//	If a client is compiled with TCL_MEM_DEBUG defined, calls to
//	Tcl_NewLongObj to create a new long integer object end up calling the
//	debugging function Tcl_DbNewLongObj instead.
//
//	Otherwise, if the client is compiled without TCL_MEM_DEBUG defined,
//	calls to Tcl_NewLongObj result in a call to one of the two
//	Tcl_NewLongObj implementations below. We provide two implementations
//	so that the Tcl core can be compiled to do memory debugging of the
//	core even if a client does not request it for itself.
//
//	Integer and long integer objects share the same "integer" type
//	implementation. We store all integers as longs and Tcl_GetIntFromObj
//	checks whether the current value of the long can be represented by an
//	int.
//
// Results:
//	The newly created object is returned. This object will have an invalid
//	string representation. The returned object has ref count 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_NewLongObj(tls *libc.TLS, longValue int64) uintptr { /* tclObj.c:2624:9: */
	var objPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				objPtr = XTclThreadAllocObj(tls)
			} else {
				objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)
		*(*int64)(unsafe.Pointer(objPtr + 32)) = longValue
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
		{
		}
	}
	return objPtr
}

//----------------------------------------------------------------------
//
// Tcl_DbNewLongObj --
//
//	If a client is compiled with TCL_MEM_DEBUG defined, calls to
//	Tcl_NewIntObj and Tcl_NewLongObj to create new integer or long integer
//	objects end up calling the debugging function Tcl_DbNewLongObj
//	instead. We provide two implementations of Tcl_DbNewLongObj so that
//	whether the Tcl core is compiled to do memory debugging of the core is
//	independent of whether a client requests debugging for itself.
//
//	When the core is compiled with TCL_MEM_DEBUG defined, Tcl_DbNewLongObj
//	calls Tcl_DbCkalloc directly with the file name and line number from
//	its caller. This simplifies debugging since then the [memory active]
//	command will report the caller's file name and line number when
//	reporting objects that haven't been freed.
//
//	Otherwise, when the core is compiled without TCL_MEM_DEBUG defined,
//	this function just returns the result of calling Tcl_NewLongObj.
//
// Results:
//	The newly created long integer object is returned. This object will
//	have an invalid string representation. The returned object has ref
//	count 0.
//
// Side effects:
//	Allocates memory.
//
//----------------------------------------------------------------------

func XTcl_DbNewLongObj(tls *libc.TLS, longValue int64, file uintptr, line int32) uintptr { /* tclObj.c:2691:9: */
	return XTcl_NewLongObj(tls, longValue)
}

//----------------------------------------------------------------------
//
// Tcl_SetLongObj --
//
//	Modify an object to be an integer object and to have the specified
//	long integer value.
//
// Results:
//	None.
//
// Side effects:
//	The object's old string rep, if any, is freed. Also, any old internal
//	rep is freed.
//
//----------------------------------------------------------------------

func XTcl_SetLongObj(tls *libc.TLS, objPtr uintptr, longValue int64) { /* tclObj.c:2723:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+54006))
	}

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _isobjPtr uintptr = objPtr
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
			}
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		}
		*(*int64)(unsafe.Pointer(objPtr + 32)) = longValue
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	}
}

//----------------------------------------------------------------------
//
// Tcl_GetLongFromObj --
//
//	Attempt to return an long integer from the Tcl object "objPtr". If the
//	object is not already an int object, an attempt will be made to
//	convert it to one.
//
// Results:
//	The return value is a standard Tcl object result. If an error occurs
//	during conversion, an error message is left in the interpreter's
//	result unless "interp" is NULL.
//
// Side effects:
//	If the object is not already an int object, the conversion will free
//	any old internal representation.
//
//----------------------------------------------------------------------

func XTcl_GetLongFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, longPtr uintptr) int32 { /* tclObj.c:2757:1: */
	bp := tls.Alloc(112)
	defer tls.Free(112)

	for ok := true; ok; ok = XTclParseNumber(tls, interp, objPtr, ts+5676, uintptr(0), -1, uintptr(0),
		TCL_PARSE_INTEGER_ONLY) == TCL_OK {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			*(*int64)(unsafe.Pointer(longPtr)) = *(*int64)(unsafe.Pointer(objPtr + 32))
			return TCL_OK
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+54021,
					libc.VaList(bp, func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
						}
						return XTcl_GetString(tls, objPtr)
					}())))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+6915, ts+54051, uintptr(0)))
			}
			return TCL_ERROR
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType)) {
			// Must check for those bignum values that can fit in a long, even
			// when auto-narrowing is enabled. Only those values in the signed
			// long range get auto-narrowed to tclIntType, while all the
			// values in the unsigned long range will fit in a long.

			// var big Mp_int at bp+80, 24

			if *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) == libc.UintptrFromInt64(int64(-1)) {
				*(*Mp_int)(unsafe.Pointer(bp + 80)) = *(*Mp_int)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32))))
			} else {
				(*Mp_int)(unsafe.Pointer(bp + 80 /* &big */)).Fdp = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*Mp_int)(unsafe.Pointer(bp + 80 /* &big */)).Fsign = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 30
				(*Mp_int)(unsafe.Pointer(bp + 80 /* &big */)).Falloc = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 15 & 0x7FFF
				(*Mp_int)(unsafe.Pointer(bp + 80 /* &big */)).Fused = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) & 0x7FFF
			}

			if Size_t((*Mp_int)(unsafe.Pointer(bp+80)).Fused) <= (uint64(8)*uint64(unsafe.Sizeof(int64(0)))+uint64(MP_DIGIT_BIT)-uint64(1))/
				uint64(MP_DIGIT_BIT) {
				var value uint64 = uint64(0)
				// var numBytes Size_t at bp+104, 8

				// var scratch int64 at bp+72, 8

				var bytes uintptr = bp + 72 /* &scratch */

				if XTclBN_mp_to_ubin(tls, bp+80, bytes, uint64(unsafe.Sizeof(int64(0))), bp+104) == MP_OKAY {
					for libc.PostDecUint64(&*(*Size_t)(unsafe.Pointer(bp + 104)), 1) > uint64(0) {
						value = value<<8 | uint64(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bytes, 1))))
					}
					if (*Mp_int)(unsafe.Pointer(bp+80)).Fsign != 0 {
						*(*int64)(unsafe.Pointer(longPtr)) = -int64(value)
					} else {
						*(*int64)(unsafe.Pointer(longPtr)) = int64(value)
					}
					return TCL_OK
				}
			}
			if interp != uintptr(0) {
				var s uintptr = ts + 10555 /* "integer value to..." */
				var msg uintptr = XTcl_NewStringObj(tls, s, -1)

				XTcl_SetObjResult(tls, interp, msg)
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+8249, ts+53996, s, uintptr(0)))
			}
			return TCL_ERROR
		}
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_NewWideIntObj --
//
//	If a client is compiled with TCL_MEM_DEBUG defined, calls to
//	Tcl_NewWideIntObj to create a new 64-bit integer object end up calling
//	the debugging function Tcl_DbNewWideIntObj instead.
//
//	Otherwise, if the client is compiled without TCL_MEM_DEBUG defined,
//	calls to Tcl_NewWideIntObj result in a call to one of the two
//	Tcl_NewWideIntObj implementations below. We provide two
//	implementations so that the Tcl core can be compiled to do memory
//	debugging of the core even if a client does not request it for itself.
//
// Results:
//	The newly created object is returned. This object will have an invalid
//	string representation. The returned object has ref count 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_NewWideIntObj(tls *libc.TLS, wideValue Tcl_WideInt) uintptr { /* tclObj.c:2925:9: */
	var objPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	XTcl_SetWideIntObj(tls, objPtr, wideValue)
	return objPtr
}

//----------------------------------------------------------------------
//
// Tcl_DbNewWideIntObj --
//
//	If a client is compiled with TCL_MEM_DEBUG defined, calls to
//	Tcl_NewWideIntObj to create new wide integer end up calling the
//	debugging function Tcl_DbNewWideIntObj instead. We provide two
//	implementations of Tcl_DbNewWideIntObj so that whether the Tcl core is
//	compiled to do memory debugging of the core is independent of whether
//	a client requests debugging for itself.
//
//	When the core is compiled with TCL_MEM_DEBUG defined,
//	Tcl_DbNewWideIntObj calls Tcl_DbCkalloc directly with the file name
//	and line number from its caller. This simplifies debugging since then
//	the checkmem command will report the caller's file name and line
//	number when reporting objects that haven't been freed.
//
//	Otherwise, when the core is compiled without TCL_MEM_DEBUG defined,
//	this function just returns the result of calling Tcl_NewWideIntObj.
//
// Results:
//	The newly created wide integer object is returned. This object will
//	have an invalid string representation. The returned object has ref
//	count 0.
//
// Side effects:
//	Allocates memory.
//
//----------------------------------------------------------------------

func XTcl_DbNewWideIntObj(tls *libc.TLS, wideValue Tcl_WideInt, file uintptr, line int32) uintptr { /* tclObj.c:2992:9: */
	return XTcl_NewWideIntObj(tls, wideValue)
}

//----------------------------------------------------------------------
//
// Tcl_SetWideIntObj --
//
//	Modify an object to be a wide integer object and to have the specified
//	wide integer value.
//
// Results:
//	None.
//
// Side effects:
//	The object's old string rep, if any, is freed. Also, any old internal
//	rep is freed.
//
//----------------------------------------------------------------------

func XTcl_SetWideIntObj(tls *libc.TLS, objPtr uintptr, wideValue Tcl_WideInt) { /* tclObj.c:3025:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+54059))
	}

	if wideValue >= -0x7fffffffffffffff-1 &&
		wideValue <= 0x7fffffffffffffff {
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _isobjPtr uintptr = objPtr
				if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
					if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
				}
			}
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
				if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
					(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
				}
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
			}
			*(*int64)(unsafe.Pointer(objPtr + 32)) = wideValue
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
		}
	} else {
		// var big Mp_int at bp+8, 24

		XTclBNInitBignumFromWideInt(tls, bp+8, wideValue)
		XTcl_SetBignumObj(tls, objPtr, bp+8)
	}
}

//----------------------------------------------------------------------
//
// Tcl_GetWideIntFromObj --
//
//	Attempt to return a wide integer from the Tcl object "objPtr". If the
//	object is not already a wide int object, an attempt will be made to
//	convert it to one.
//
// Results:
//	The return value is a standard Tcl object result. If an error occurs
//	during conversion, an error message is left in the interpreter's
//	result unless "interp" is NULL.
//
// Side effects:
//	If the object is not already an int object, the conversion will free
//	any old internal representation.
//
//----------------------------------------------------------------------

func XTcl_GetWideIntFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, wideIntPtr uintptr) int32 { /* tclObj.c:3072:1: */
	bp := tls.Alloc(112)
	defer tls.Free(112)

	for ok := true; ok; ok = XTclParseNumber(tls, interp, objPtr, ts+5676, uintptr(0), -1, uintptr(0),
		TCL_PARSE_INTEGER_ONLY) == TCL_OK {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			*(*Tcl_WideInt)(unsafe.Pointer(wideIntPtr)) = *(*int64)(unsafe.Pointer(objPtr + 32))
			return TCL_OK
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+54021,
					libc.VaList(bp, func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
						}
						return XTcl_GetString(tls, objPtr)
					}())))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+6915, ts+54051, uintptr(0)))
			}
			return TCL_ERROR
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType)) {
			// Must check for those bignum values that can fit in a
			// Tcl_WideInt, even when auto-narrowing is enabled.

			// var big Mp_int at bp+80, 24

			if *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) == libc.UintptrFromInt64(int64(-1)) {
				*(*Mp_int)(unsafe.Pointer(bp + 80)) = *(*Mp_int)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32))))
			} else {
				(*Mp_int)(unsafe.Pointer(bp + 80 /* &big */)).Fdp = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*Mp_int)(unsafe.Pointer(bp + 80 /* &big */)).Fsign = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 30
				(*Mp_int)(unsafe.Pointer(bp + 80 /* &big */)).Falloc = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 15 & 0x7FFF
				(*Mp_int)(unsafe.Pointer(bp + 80 /* &big */)).Fused = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) & 0x7FFF
			}

			if Size_t((*Mp_int)(unsafe.Pointer(bp+80)).Fused) <= (uint64(8)*uint64(unsafe.Sizeof(Tcl_WideInt(0)))+
				uint64(MP_DIGIT_BIT)-uint64(1))/uint64(MP_DIGIT_BIT) {
				var value Tcl_WideUInt = uint64(0)
				// var numBytes Size_t at bp+104, 8

				// var scratch Tcl_WideInt at bp+72, 8

				var bytes uintptr = bp + 72 /* &scratch */

				if XTclBN_mp_to_ubin(tls, bp+80, bytes, uint64(unsafe.Sizeof(Tcl_WideInt(0))), bp+104) == MP_OKAY {
					for libc.PostDecUint64(&*(*Size_t)(unsafe.Pointer(bp + 104)), 1) > uint64(0) {
						value = value<<8 | Tcl_WideUInt(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bytes, 1))))
					}
					if (*Mp_int)(unsafe.Pointer(bp+80)).Fsign != 0 {
						*(*Tcl_WideInt)(unsafe.Pointer(wideIntPtr)) = -Tcl_WideInt(value)
					} else {
						*(*Tcl_WideInt)(unsafe.Pointer(wideIntPtr)) = Tcl_WideInt(value)
					}
					return TCL_OK
				}
			}
			if interp != uintptr(0) {
				var s uintptr = ts + 10555 /* "integer value to..." */
				var msg uintptr = XTcl_NewStringObj(tls, s, -1)

				XTcl_SetObjResult(tls, interp, msg)
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+8249, ts+53996, s, uintptr(0)))
			}
			return TCL_ERROR
		}
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// FreeBignum --
//
//	This function frees the internal rep of a bignum.
//
// Results:
//	None.
//
//----------------------------------------------------------------------

func sFreeBignum(tls *libc.TLS, objPtr uintptr) { /* tclObj.c:3181:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var toFree Mp_int at bp, 24
	// Bignum to free

	if *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) == libc.UintptrFromInt64(int64(-1)) {
		*(*Mp_int)(unsafe.Pointer(bp)) = *(*Mp_int)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32))))
	} else {
		(*Mp_int)(unsafe.Pointer(bp /* &toFree */)).Fdp = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		(*Mp_int)(unsafe.Pointer(bp /* &toFree */)).Fsign = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 30
		(*Mp_int)(unsafe.Pointer(bp /* &toFree */)).Falloc = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 15 & 0x7FFF
		(*Mp_int)(unsafe.Pointer(bp /* &toFree */)).Fused = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) & 0x7FFF
	}

	XTclBN_mp_clear(tls, bp)
	if int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) < 0 {
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(objPtr + 32)))
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// DupBignum --
//
//	This function duplicates the internal rep of a bignum.
//
// Results:
//	None.
//
// Side effects:
//	The destination object receies a copy of the source object
//
//----------------------------------------------------------------------

func sDupBignum(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclObj.c:3211:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	// var bignumVal Mp_int at bp+24, 24

	// var bignumCopy Mp_int at bp, 24

	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclBignumType))
	if *(*uintptr)(unsafe.Pointer(srcPtr + 32 + 8)) == libc.UintptrFromInt64(int64(-1)) {
		*(*Mp_int)(unsafe.Pointer(bp + 24)) = *(*Mp_int)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(srcPtr + 32))))
	} else {
		(*Mp_int)(unsafe.Pointer(bp + 24 /* &bignumVal */)).Fdp = *(*uintptr)(unsafe.Pointer(srcPtr + 32))
		(*Mp_int)(unsafe.Pointer(bp + 24 /* &bignumVal */)).Fsign = int32(*(*uintptr)(unsafe.Pointer(srcPtr + 32 + 8))) >> 30
		(*Mp_int)(unsafe.Pointer(bp + 24 /* &bignumVal */)).Falloc = int32(*(*uintptr)(unsafe.Pointer(srcPtr + 32 + 8))) >> 15 & 0x7FFF
		(*Mp_int)(unsafe.Pointer(bp + 24 /* &bignumVal */)).Fused = int32(*(*uintptr)(unsafe.Pointer(srcPtr + 32 + 8))) & 0x7FFF
	}

	if XTclBN_mp_init_copy(tls, bp, bp+24) != MP_OKAY {
		XTcl_Panic(tls, ts+54077, 0)
	}
	if (*Mp_int)(unsafe.Pointer(bp)).Fused > 0x7FFF {
		var temp uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Mp_int{})))
		*(*Mp_int)(unsafe.Pointer(temp)) = *(*Mp_int)(unsafe.Pointer(bp /* bignumCopy */))
		*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = temp
		*(*uintptr)(unsafe.Pointer(copyPtr + 32 + 8 /* &.ptr2 */)) = libc.UintptrFromInt64(int64(-1))
	} else {
		if (*Mp_int)(unsafe.Pointer(bp)).Falloc > 0x7FFF {
			XTclBN_mp_shrink(tls, bp)
		}
		*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = (*Mp_int)(unsafe.Pointer(bp /* &bignumCopy */)).Fdp
		*(*uintptr)(unsafe.Pointer(copyPtr + 32 + 8 /* &.ptr2 */)) = uintptr(Intptr_t((*Mp_int)(unsafe.Pointer(bp)).Fsign<<30 | (*Mp_int)(unsafe.Pointer(bp)).Falloc<<15 | (*Mp_int)(unsafe.Pointer(bp)).Fused))
	}

}

//----------------------------------------------------------------------
//
// UpdateStringOfBignum --
//
//	This function updates the string representation of a bignum object.
//
// Results:
//	None.
//
// Side effects:
//	The object's string is set to whatever results from the bignum-
//	to-string conversion.
//
// The object's existing string representation is NOT freed; memory will leak
// if the string rep is still valid at the time this function is called.
//
//----------------------------------------------------------------------

func sUpdateStringOfBignum(tls *libc.TLS, objPtr uintptr) { /* tclObj.c:3247:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	// var bignumVal Mp_int at bp, 24

	// var size int32 at bp+24, 4

	var status int32
	var stringVal uintptr

	if *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) == libc.UintptrFromInt64(int64(-1)) {
		*(*Mp_int)(unsafe.Pointer(bp)) = *(*Mp_int)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32))))
	} else {
		(*Mp_int)(unsafe.Pointer(bp /* &bignumVal */)).Fdp = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		(*Mp_int)(unsafe.Pointer(bp /* &bignumVal */)).Fsign = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 30
		(*Mp_int)(unsafe.Pointer(bp /* &bignumVal */)).Falloc = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 15 & 0x7FFF
		(*Mp_int)(unsafe.Pointer(bp /* &bignumVal */)).Fused = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) & 0x7FFF
	}

	status = XTclBN_mp_radix_size(tls, bp, 10, bp+24)
	if status != MP_OKAY {
		XTcl_Panic(tls, ts+54113, 0)
	}
	if *(*int32)(unsafe.Pointer(bp + 24)) < 2 {
		// mp_radix_size() returns < 2 when more than INT_MAX bytes would be
		// needed to hold the string rep (because mp_radix_size ignores
		// integer overflow issues).
		//
		// Note that so long as we enforce our bignums to the size that fits
		// in a packed bignum, this branch will never be taken.

		XTcl_Panic(tls, ts+54156, 0)
	}
	stringVal = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 24))))
	status = XTclBN_mp_to_radix(tls, bp, stringVal, uint64(*(*int32)(unsafe.Pointer(bp + 24 /* size */))), uintptr(0), 10)
	if status != MP_OKAY {
		XTcl_Panic(tls, ts+54207, 0)
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = stringVal
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = *(*int32)(unsafe.Pointer(bp + 24)) - 1 // size includes a trailing NUL byte.
}

//----------------------------------------------------------------------
//
// Tcl_NewBignumObj --
//
//	Creates an initializes a bignum object.
//
// Results:
//	Returns the newly created object.
//
// Side effects:
//	The bignum value is cleared, since ownership has transferred to Tcl.
//
//----------------------------------------------------------------------

func XTcl_NewBignumObj(tls *libc.TLS, bignumValue uintptr) uintptr { /* tclObj.c:3307:9: */
	var objPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	XTcl_SetBignumObj(tls, objPtr, bignumValue)
	return objPtr
}

//----------------------------------------------------------------------
//
// Tcl_DbNewBignumObj --
//
//	This function is normally called when debugging: that is, when
//	TCL_MEM_DEBUG is defined. It constructs a bignum object, recording the
//	creation point so that [memory active] can report it.
//
// Results:
//	Returns the newly created object.
//
// Side effects:
//	The bignum value is cleared, since ownership has transferred to Tcl.
//
//----------------------------------------------------------------------

func XTcl_DbNewBignumObj(tls *libc.TLS, bignumValue uintptr, file uintptr, line int32) uintptr { /* tclObj.c:3351:9: */
	return XTcl_NewBignumObj(tls, bignumValue)
}

//----------------------------------------------------------------------
//
// GetBignumFromObj --
//
//	This function retrieves a 'bignum' value from a Tcl object, converting
//	the object if necessary. Either copies or transfers the mp_int value
//	depending on the copy flag value passed in.
//
// Results:
//	Returns TCL_OK if the conversion is successful, TCL_ERROR otherwise.
//
// Side effects:
//	A copy of bignum is stored in *bignumValue, which is expected to be
//	uninitialized or cleared. If conversion fails, and the 'interp'
//	argument is not NULL, an error message is stored in the interpreter
//	result.
//
//----------------------------------------------------------------------

func sGetBignumFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, copy int32, bignumValue uintptr) int32 { /* tclObj.c:3383:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	for ok := true; ok; ok = XTclParseNumber(tls, interp, objPtr, ts+5676, uintptr(0), -1, uintptr(0),
		TCL_PARSE_INTEGER_ONLY) == TCL_OK {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType)) {
			if copy != 0 || (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
				// var temp Mp_int at bp+64, 24

				if *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) == libc.UintptrFromInt64(int64(-1)) {
					*(*Mp_int)(unsafe.Pointer(bp + 64)) = *(*Mp_int)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32))))
				} else {
					(*Mp_int)(unsafe.Pointer(bp + 64 /* &temp */)).Fdp = *(*uintptr)(unsafe.Pointer(objPtr + 32))
					(*Mp_int)(unsafe.Pointer(bp + 64 /* &temp */)).Fsign = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 30
					(*Mp_int)(unsafe.Pointer(bp + 64 /* &temp */)).Falloc = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 15 & 0x7FFF
					(*Mp_int)(unsafe.Pointer(bp + 64 /* &temp */)).Fused = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) & 0x7FFF
				}

				if XTclBN_mp_init_copy(tls, bignumValue, bp+64) != MP_OKAY {
					if interp != uintptr(0) {
						XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
							ts+54250, -1))
						XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+14496, uintptr(0)))
					}
					return TCL_ERROR
				}
			} else {
				if *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) == libc.UintptrFromInt64(int64(-1)) {
					*(*Mp_int)(unsafe.Pointer(bignumValue)) = *(*Mp_int)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32))))
				} else {
					(*(*Mp_int)(unsafe.Pointer(bignumValue))).Fdp = *(*uintptr)(unsafe.Pointer(objPtr + 32))
					(*(*Mp_int)(unsafe.Pointer(bignumValue))).Fsign = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 30
					(*(*Mp_int)(unsafe.Pointer(bignumValue))).Falloc = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 15 & 0x7FFF
					(*(*Mp_int)(unsafe.Pointer(bignumValue))).Fused = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) & 0x7FFF
				}

				*(*uintptr)(unsafe.Pointer(objPtr + 32)) = uintptr(0)
				*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
				if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) {
					if 0 == 0 {
						(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
					} else {
						(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(0+1))
						libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, XtclEmptyStringRep, uint64(0))
						*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)) = int8(0)
						(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
					}

				}
			}
			return TCL_OK
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			XTclBNInitBignumFromLong(tls, bignumValue, *(*int64)(unsafe.Pointer(objPtr + 32)))
			return TCL_OK
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+54021,
					libc.VaList(bp+24, func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
						}
						return XTcl_GetString(tls, objPtr)
					}())))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+6915, ts+54051, uintptr(0)))
			}
			return TCL_ERROR
		}
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_GetBignumFromObj --
//
//	This function retrieves a 'bignum' value from a Tcl object, converting
//	the object if necessary.
//
// Results:
//	Returns TCL_OK if the conversion is successful, TCL_ERROR otherwise.
//
// Side effects:
//	A copy of bignum is stored in *bignumValue, which is expected to be
//	uninitialized or cleared. If conversion fails, an the 'interp'
//	argument is not NULL, an error message is stored in the interpreter
//	result.
//
//	It is expected that the caller will NOT have invoked mp_init on the
//	bignum value before passing it in. Tcl will initialize the mp_int as
//	it sets the value. The value is a copy of the value in objPtr, so it
//	becomes the responsibility of the caller to call mp_clear on it.
//
//----------------------------------------------------------------------

func XTcl_GetBignumFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, bignumValue uintptr) int32 { /* tclObj.c:3465:1: */
	return sGetBignumFromObj(tls, interp, objPtr, 1, bignumValue)
}

//----------------------------------------------------------------------
//
// Tcl_TakeBignumFromObj --
//
//	This function retrieves a 'bignum' value from a Tcl object, converting
//	the object if necessary.
//
// Results:
//	Returns TCL_OK if the conversion is successful, TCL_ERROR otherwise.
//
// Side effects:
//	A copy of bignum is stored in *bignumValue, which is expected to be
//	uninitialized or cleared. If conversion fails, an the 'interp'
//	argument is not NULL, an error message is stored in the interpreter
//	result.
//
//	It is expected that the caller will NOT have invoked mp_init on the
//	bignum value before passing it in. Tcl will initialize the mp_int as
//	it sets the value. The value is transferred from the internals of
//	objPtr to the caller, passing responsibility of the caller to call
//	mp_clear on it. The objPtr is cleared to hold an empty value.
//
//----------------------------------------------------------------------

func XTcl_TakeBignumFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, bignumValue uintptr) int32 { /* tclObj.c:3500:1: */
	return sGetBignumFromObj(tls, interp, objPtr, 0, bignumValue)
}

//----------------------------------------------------------------------
//
// Tcl_SetBignumObj --
//
//	This function sets the value of a Tcl_Obj to a large integer.
//
// Results:
//	None.
//
// Side effects:
//	Object value is stored. The bignum value is cleared, since ownership
//	has transferred to Tcl.
//
//----------------------------------------------------------------------

func XTcl_SetBignumObj(tls *libc.TLS, objPtr uintptr, bignumValue uintptr) { /* tclObj.c:3526:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var _isobjPtr uintptr
	var _isobjPtr1 uintptr
	var value uint64
	// var numBytes Size_t at bp+16, 8

	// var scratch int64 at bp+8, 8

	var bytes uintptr
	var _isobjPtr2 uintptr
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1) {
		goto __1
	}
	XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+54287))
__1:
	;
	if !(Size_t((*Mp_int)(unsafe.Pointer(bignumValue)).Fused) <=
		(uint64(8)*uint64(unsafe.Sizeof(int64(0)))+uint64(MP_DIGIT_BIT)-uint64(1))/uint64(MP_DIGIT_BIT)) {
		goto __2
	}
	value = uint64(0)
	bytes = bp + 8 /* &scratch */

	if !(XTclBN_mp_to_ubin(tls, bignumValue, bytes, uint64(unsafe.Sizeof(int64(0))), bp+16) != MP_OKAY) {
		goto __3
	}
	goto tooLargeForLong
__3:
	;
__4:
	if !(libc.PostDecUint64(&*(*Size_t)(unsafe.Pointer(bp + 16)), 1) > uint64(0)) {
		goto __5
	}
	value = value<<8 | uint64(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bytes, 1))))
	goto __4
__5:
	;
	if !(value > uint64(libc.CplUint64(uint64(0)))>>1+uint64((*Mp_int)(unsafe.Pointer(bignumValue)).Fsign)) {
		goto __6
	}
	goto tooLargeForLong
__6:
	;
	if !((*Mp_int)(unsafe.Pointer(bignumValue)).Fsign != 0) {
		goto __7
	}
__9:
__12:
	_isobjPtr = objPtr
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0)) {
		goto __15
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep) {
		goto __16
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
__16:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
__15:
	;
	goto __13
__13:
	if 0 != 0 {
		goto __12
	}
	goto __14
__14:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __17
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __18
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__18:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__17:
	;
	*(*int64)(unsafe.Pointer(objPtr + 32)) = -int64(value)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	goto __10
__10:
	if 0 != 0 {
		goto __9
	}
	goto __11
__11:
	;
	goto __8
__7:
__19:
__22:
	_isobjPtr1 = objPtr
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes != uintptr(0)) {
		goto __25
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes != XtclEmptyStringRep) {
		goto __26
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes)
__26:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes = uintptr(0)
__25:
	;
	goto __23
__23:
	if 0 != 0 {
		goto __22
	}
	goto __24
__24:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __27
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __28
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__28:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__27:
	;
	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(value)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	goto __20
__20:
	if 0 != 0 {
		goto __19
	}
	goto __21
__21:
	;
__8:
	;
	XTclBN_mp_clear(tls, bignumValue)
	return
__2:
	;
tooLargeForLong:
__29:
	_isobjPtr2 = objPtr
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes != uintptr(0)) {
		goto __32
	}
	if !((*Tcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes != XtclEmptyStringRep) {
		goto __33
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes)
__33:
	;
	(*Tcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes = uintptr(0)
__32:
	;
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __34
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __35
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__35:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__34:
	;

	XTclSetBignumInternalRep(tls, objPtr, bignumValue)
}

//----------------------------------------------------------------------
//
// TclSetBignumInternalRep --
//
//	Install a bignum into the internal representation of an object.
//
// Results:
//	None.
//
// Side effects:
//	Object internal representation is updated and object type is set. The
//	bignum value is cleared, since ownership has transferred to the
//	object.
//
//----------------------------------------------------------------------

func XTclSetBignumInternalRep(tls *libc.TLS, objPtr uintptr, bignumValue uintptr) { /* tclObj.c:3609:1: */
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclBignumType))
	if (*(*Mp_int)(unsafe.Pointer(bignumValue))).Fused > 0x7FFF {
		var temp uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Mp_int{})))
		*(*Mp_int)(unsafe.Pointer(temp)) = *(*Mp_int)(unsafe.Pointer(bignumValue))
		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = temp
		*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = libc.UintptrFromInt64(int64(-1))
	} else {
		if (*(*Mp_int)(unsafe.Pointer(bignumValue))).Falloc > 0x7FFF {
			XTclBN_mp_shrink(tls, bignumValue)
		}
		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*(*Mp_int)(unsafe.Pointer(bignumValue))).Fdp
		*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr(Intptr_t((*(*Mp_int)(unsafe.Pointer(bignumValue))).Fsign<<30 | (*(*Mp_int)(unsafe.Pointer(bignumValue))).Falloc<<15 | (*(*Mp_int)(unsafe.Pointer(bignumValue))).Fused))
	}

	// Clear the mp_int value.
	//
	// Don't call mp_clear() because it would free the digit array we just
	// packed into the Tcl_Obj.

	(*Mp_int)(unsafe.Pointer(bignumValue)).Fdp = uintptr(0)
	(*Mp_int)(unsafe.Pointer(bignumValue)).Falloc = libc.AssignPtrInt32(bignumValue, 0)
	(*Mp_int)(unsafe.Pointer(bignumValue)).Fsign = MP_NEG
}

//----------------------------------------------------------------------
//
// TclGetNumberFromObj --
//
//      Extracts a number (of any possible numeric type) from an object.
//
// Results:
//      Whether the extraction worked. The type is stored in the variable
//      referred to by the typePtr argument, and a pointer to the
//      representation is stored in the variable referred to by the
//      clientDataPtr.
//
// Side effects:
//      Can allocate thread-specific data for handling the copy-out space for
//      bignums; this space is shared within a thread.
//
//----------------------------------------------------------------------

func XTclGetNumberFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, clientDataPtr uintptr, typePtr uintptr) int32 { /* tclObj.c:3649:1: */
	for ok := true; ok; ok = TCL_OK == XTclParseNumber(tls, interp, objPtr, ts+54304, uintptr(0), -1, uintptr(0), 0) {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
			if libc.X__builtin_isnan(tls, *(*float64)(unsafe.Pointer(objPtr + 32))) != 0 {
				*(*int32)(unsafe.Pointer(typePtr)) = TCL_NUMBER_NAN
			} else {
				*(*int32)(unsafe.Pointer(typePtr)) = TCL_NUMBER_DOUBLE
			}
			*(*ClientData)(unsafe.Pointer(clientDataPtr)) = objPtr + 32
			return TCL_OK
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			*(*int32)(unsafe.Pointer(typePtr)) = TCL_NUMBER_LONG
			*(*ClientData)(unsafe.Pointer(clientDataPtr)) = objPtr + 32
			return TCL_OK
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType)) {
			var bigPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&bignumKey)),
				int32(unsafe.Sizeof(Mp_int{})))

			if *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) == libc.UintptrFromInt64(int64(-1)) {
				*(*Mp_int)(unsafe.Pointer(bigPtr)) = *(*Mp_int)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32))))
			} else {
				(*(*Mp_int)(unsafe.Pointer(bigPtr))).Fdp = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*(*Mp_int)(unsafe.Pointer(bigPtr))).Fsign = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 30
				(*(*Mp_int)(unsafe.Pointer(bigPtr))).Falloc = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) >> 15 & 0x7FFF
				(*(*Mp_int)(unsafe.Pointer(bigPtr))).Fused = int32(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8))) & 0x7FFF
			}

			*(*int32)(unsafe.Pointer(typePtr)) = TCL_NUMBER_BIG
			*(*ClientData)(unsafe.Pointer(clientDataPtr)) = bigPtr
			return TCL_OK
		}
	}
	return TCL_ERROR
}

var bignumKey Tcl_ThreadDataKey /* tclObj.c:3678:31: */

//----------------------------------------------------------------------
//
// Tcl_DbIncrRefCount --
//
//	This function is normally called when debugging: i.e., when
//	TCL_MEM_DEBUG is defined. This checks to see whether or not the memory
//	has been freed before incrementing the ref count.
//
//	When TCL_MEM_DEBUG is not defined, this function just increments the
//	reference count of the object.
//
// Results:
//	None.
//
// Side effects:
//	The object's ref count is incremented.
//
//----------------------------------------------------------------------

func XTcl_DbIncrRefCount(tls *libc.TLS, objPtr uintptr, file uintptr, line int32) { /* tclObj.c:3714:1: */
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
}

//----------------------------------------------------------------------
//
// Tcl_DbDecrRefCount --
//
//	This function is normally called when debugging: i.e., when
//	TCL_MEM_DEBUG is defined. This checks to see whether or not the memory
//	has been freed before decrementing the ref count.
//
//	When TCL_MEM_DEBUG is not defined, this function just decrements the
//	reference count of the object.
//
// Results:
//	None.
//
// Side effects:
//	The object's ref count is incremented.
//
//----------------------------------------------------------------------

func XTcl_DbDecrRefCount(tls *libc.TLS, objPtr uintptr, file uintptr, line int32) { /* tclObj.c:3777:1: */

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) <= 1 {
		XTclFreeObj(tls, objPtr)
	}
}

//----------------------------------------------------------------------
//
// Tcl_DbIsShared --
//
//	This function is normally called when debugging: i.e., when
//	TCL_MEM_DEBUG is defined. It tests whether the object has a ref count
//	greater than one.
//
//	When TCL_MEM_DEBUG is not defined, this function just tests if the
//	object has a ref count greater than one.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_DbIsShared(tls *libc.TLS, objPtr uintptr, file uintptr, line int32) int32 { /* tclObj.c:3843:1: */

	return libc.Bool32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1)
}

//----------------------------------------------------------------------
//
// Tcl_InitObjHashTable --
//
//	Given storage for a hash table, set up the fields to prepare the hash
//	table for use, the keys are Tcl_Obj *.
//
// Results:
//	None.
//
// Side effects:
//	TablePtr is now ready to be passed to Tcl_FindHashEntry and
//	Tcl_CreateHashEntry.
//
//----------------------------------------------------------------------

func XTcl_InitObjHashTable(tls *libc.TLS, tablePtr uintptr) { /* tclObj.c:3915:1: */
	XTcl_InitCustomHashTable(tls, tablePtr, -1,
		uintptr(unsafe.Pointer(&XtclObjHashKeyType)))
}

//----------------------------------------------------------------------
//
// AllocObjEntry --
//
//	Allocate space for a Tcl_HashEntry containing the Tcl_Obj * key.
//
// Results:
//	The return value is a pointer to the created entry.
//
// Side effects:
//	Increments the reference count on the object.
//
//----------------------------------------------------------------------

func sAllocObjEntry(tls *libc.TLS, tablePtr uintptr, keyPtr uintptr) uintptr { /* tclObj.c:3940:22: */
	var objPtr uintptr = keyPtr
	var hPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashEntry{})))

	*(*uintptr)(unsafe.Pointer(hPtr + 32)) = objPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(0)

	return hPtr
}

//----------------------------------------------------------------------
//
// TclCompareObjKeys --
//
//	Compares two Tcl_Obj * keys.
//
// Results:
//	The return value is 0 if they are different and 1 if they are the
//	same.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclCompareObjKeys(tls *libc.TLS, keyPtr uintptr, hPtr uintptr) int32 { /* tclObj.c:3973:1: */
	var objPtr1 uintptr = keyPtr
	var objPtr2 uintptr = *(*uintptr)(unsafe.Pointer(hPtr + 32))
	var p1 uintptr
	var p2 uintptr
	var l1 Size_t
	var l2 Size_t

	//
	//  If the object pointers are the same then they match.
	//  OPT: this comparison was moved to the caller
	//
	//        if (objPtr1 == objPtr2) return 1;
	//

	// Don't use Tcl_GetStringFromObj as it would prevent l1 and l2 being
	// in a register.

	p1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes
		}
		return XTcl_GetString(tls, objPtr1)
	}()
	l1 = Size_t((*Tcl_Obj)(unsafe.Pointer(objPtr1)).Flength)
	p2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr2)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr2)).Fbytes
		}
		return XTcl_GetString(tls, objPtr2)
	}()
	l2 = Size_t((*Tcl_Obj)(unsafe.Pointer(objPtr2)).Flength)

	// Only compare if the string representations are of the same length.

	if l1 == l2 {
	__1:
		;
		{
			if int32(*(*int8)(unsafe.Pointer(p1))) != int32(*(*int8)(unsafe.Pointer(p2))) {
				goto __3
			}
			if l1 == uint64(0) {
				return 1
			}

		}
		goto __2
	__2:
		p1++
		p2++
		l1--
		goto __1
		goto __3
	__3:
	}

	return 0
}

//----------------------------------------------------------------------
//
// TclFreeObjEntry --
//
//	Frees space for a Tcl_HashEntry containing the Tcl_Obj * key.
//
// Results:
//	The return value is a pointer to the created entry.
//
// Side effects:
//	Decrements the reference count of the object.
//
//----------------------------------------------------------------------

func XTclFreeObjEntry(tls *libc.TLS, hPtr uintptr) { /* tclObj.c:4034:1: */
	var objPtr uintptr = *(*uintptr)(unsafe.Pointer(hPtr + 32))

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = objPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTclpFree(tls, hPtr)
}

//----------------------------------------------------------------------
//
// TclHashObjKey --
//
//	Compute a one-word summary of the string representation of the
//	Tcl_Obj, which can be used to generate a hash index.
//
// Results:
//	The return value is a one-word summary of the information in the
//	string representation of the Tcl_Obj.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclHashObjKey(tls *libc.TLS, tablePtr uintptr, keyPtr uintptr) uint32 { /* tclObj.c:4062:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var objPtr uintptr = keyPtr
	// var length int32 at bp, 4

	var string uintptr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp)
	}()
	var result uint32 = uint32(0)

	// I tried a zillion different hash functions and asked many other people
	// for advice. Many people had their own favorite functions, all
	// different, but no-one had much idea why they were good ones. I chose
	// the one below (multiply by 9 and add new character) because of the
	// following reasons:
	//
	// 1. Multiplying by 10 is perfect for keys that are decimal strings, and
	//    multiplying by 9 is just about as good.
	// 2. Times-9 is (shift-left-3) plus (old). This means that each
	//    character's bits hang around in the low-order bits of the hash value
	//    for ever, plus they spread fairly rapidly up to the high-order bits
	//    to fill out the hash value. This seems works well both for decimal
	//    and non-decimal strings.
	//
	// Note that this function is very weak against malicious strings; it's
	// very easy to generate multiple keys that have the same hashcode. On the
	// other hand, that hardly ever actually occurs and this function *is*
	// very cheap, even by comparison with industry-standard hashes like FNV.
	// If real strength of hash is required though, use a custom hash based on
	// Bob Jenkins's lookup3(), but be aware that it's significantly slower.
	// Tcl does not use that level of strength because it typically does not
	// need it (and some of the aspects of that strength are genuinely
	// unnecessary given the rest of Tcl's hash machinery, and the fact that
	// we do not either transfer hashes to another machine, use them as a true
	// substitute for equality, or attempt to minimize work in rebuilding the
	// hash table).
	//
	// See also HashStringKey in tclHash.c.
	// See also HashString in tclLiteral.c.
	//
	// See [tcl-Feature Request #2958832]

	if *(*int32)(unsafe.Pointer(bp)) > 0 {
		result = uint32(uint8(*(*int8)(unsafe.Pointer(string))))
		for libc.PreDecInt32(&*(*int32)(unsafe.Pointer(bp)), 1) != 0 {
			result = result + (result<<3 + uint32(uint8(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&string, 1))))))
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_GetCommandFromObj --
//
//	Returns the command specified by the name in a Tcl_Obj.
//
// Results:
//	Returns a token for the command if it is found. Otherwise, if it can't
//	be found or there is an error, returns NULL.
//
// Side effects:
//	May update the internal representation for the object, caching the
//	command reference so that the next time this function is called with
//	the same object, the command can be found quickly.
//
//----------------------------------------------------------------------

func XTcl_GetCommandFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr) Tcl_Command { /* tclObj.c:4134:1: */
	var resPtr uintptr

	// Get the internal representation, converting to a command type if
	// needed. The internal representation is a ResolvedCmdName that points to
	// the actual command.
	//
	// Check the context namespace and the namespace epoch of the resolved
	// symbol to make sure that it is fresh. Note that we verify that the
	// namespace id of the context namespace is the same as the one we cached;
	// this insures that the namespace wasn't deleted and a new one created at
	// the same address with the same command epoch. Note that fully qualified
	// names have a NULL refNsPtr, these checks needn't be made.
	//
	// Check also that the command's epoch is up to date, and that the command
	// is not deleted.
	//
	// If any check fails, then force another conversion to the command type,
	// to discard the old rep and create a new one.

	resPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclCmdNameType)) && resPtr != uintptr(0) {
		var cmdPtr uintptr = (*ResolvedCmdName)(unsafe.Pointer(resPtr)).FcmdPtr

		if (*Command)(unsafe.Pointer(cmdPtr)).FcmdEpoch == (*ResolvedCmdName)(unsafe.Pointer(resPtr)).FcmdEpoch &&
			!((*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_IS_DELETED != 0) &&
			interp == (*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).Finterp &&
			!((*Namespace)(unsafe.Pointer((*Command)(unsafe.Pointer(cmdPtr)).FnsPtr)).Fflags&NS_DYING != 0) {
			var refNsPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr

			if (*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsPtr == uintptr(0) ||
				refNsPtr == (*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsPtr &&
					(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsId == (*Namespace)(unsafe.Pointer(refNsPtr)).FnsId &&
					(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsCmdEpoch == (*Namespace)(unsafe.Pointer(refNsPtr)).FcmdRefEpoch {
				return cmdPtr
			}
		}
	}

	// OK, must create a new internal representation (or fail) as any cache we
	// had is invalid one way or another.

	// See [] why we cannot call SetCmdNameFromAny() directly here.
	if (*struct {
		f func(*libc.TLS, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{XtclCmdNameType.FsetFromAnyProc})).f(tls, interp, objPtr) != TCL_OK {
		return uintptr(0)
	}
	resPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	return func() uintptr {
		if resPtr != 0 {
			return (*ResolvedCmdName)(unsafe.Pointer(resPtr)).FcmdPtr
		}
		return uintptr(0)
	}()
}

//----------------------------------------------------------------------
//
// TclSetCmdNameObj --
//
//	Modify an object to be an CmdName object that refers to the argument
//	Command structure.
//
// Results:
//	None.
//
// Side effects:
//	The object's old internal rep is freed. It's string rep is not
//	changed. The refcount in the Command structure is incremented to keep
//	it from being freed if the command is later deleted until
//	TclNRExecuteByteCode has a chance to recognize that it was deleted.
//
//----------------------------------------------------------------------

func XTclSetCmdNameObj(tls *libc.TLS, interp uintptr, objPtr uintptr, cmdPtr uintptr) { /* tclObj.c:4218:1: */
	var iPtr uintptr = interp
	var resPtr uintptr
	var currNsPtr uintptr
	var name uintptr

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclCmdNameType)) {
		resPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		if resPtr != uintptr(0) && (*ResolvedCmdName)(unsafe.Pointer(resPtr)).FcmdPtr == cmdPtr {
			return
		}
	}

	(*Command)(unsafe.Pointer(cmdPtr)).FrefCount++
	resPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ResolvedCmdName{})))
	(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FcmdPtr = cmdPtr
	(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FcmdEpoch = (*Command)(unsafe.Pointer(cmdPtr)).FcmdEpoch
	(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefCount = 1

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()
	if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&name, 1)))) == ':' && int32(*(*int8)(unsafe.Pointer(name))) == ':' {
		// The name is fully qualified: set the referring namespace to
		// NULL.

		(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsPtr = uintptr(0)
	} else {
		// Get the current namespace.

		currNsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr

		(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsPtr = currNsPtr
		(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsId = (*Namespace)(unsafe.Pointer(currNsPtr)).FnsId
		(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsCmdEpoch = (*Namespace)(unsafe.Pointer(currNsPtr)).FcmdRefEpoch
	}

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	}

	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = resPtr
	*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclCmdNameType))
}

//----------------------------------------------------------------------
//
// FreeCmdNameInternalRep --
//
//	Frees the resources associated with a cmdName object's internal
//	representation.
//
// Results:
//	None.
//
// Side effects:
//	Decrements the ref count of any cached ResolvedCmdName structure
//	pointed to by the cmdName's internal representation. If this is the
//	last use of the ResolvedCmdName, it is freed. This in turn decrements
//	the ref count of the Command structure pointed to by the
//	ResolvedSymbol, which may free the Command structure.
//
//----------------------------------------------------------------------

func sFreeCmdNameInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclObj.c:4292:1: */
	var resPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if resPtr != uintptr(0) {
		// Decrement the reference count of the ResolvedCmdName structure. If
		// there are no more uses, free the ResolvedCmdName structure.

		if libc.PostDecInt32(&(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefCount, 1) == 1 {
			// Now free the cached command, unless it is still in its hash
			// table or if there are other references to it from other cmdName
			// objects.

			var cmdPtr uintptr = (*ResolvedCmdName)(unsafe.Pointer(resPtr)).FcmdPtr

			if libc.PostDecInt32(&(*Command)(unsafe.Pointer(cmdPtr)).FrefCount, 1) <= 1 {
				XTclpFree(tls, cmdPtr)
			}

			XTclpFree(tls, resPtr)
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// DupCmdNameInternalRep --
//
//	Initialize the internal representation of an cmdName Tcl_Obj to a copy
//	of the internal representation of an existing cmdName object.
//
// Results:
//	None.
//
// Side effects:
//	"copyPtr"s internal rep is set to point to the ResolvedCmdName
//	structure corresponding to "srcPtr"s internal rep. Increments the ref
//	count of the ResolvedCmdName structure pointed to by the cmdName's
//	internal representation.
//
//----------------------------------------------------------------------

func sDupCmdNameInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclObj.c:4341:1: */
	var resPtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))

	*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = resPtr
	*(*uintptr)(unsafe.Pointer(copyPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
	if resPtr != uintptr(0) {
		(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefCount++
	}
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclCmdNameType))
}

//----------------------------------------------------------------------
//
// SetCmdNameFromAny --
//
//	Generate an cmdName internal form for the Tcl object "objPtr".
//
// Results:
//	The return value is a standard Tcl result. The conversion always
//	succeeds and TCL_OK is returned.
//
// Side effects:
//	A pointer to a ResolvedCmdName structure that holds a cached pointer
//	to the command with a name that matches objPtr's string rep is stored
//	as objPtr's internal representation. This ResolvedCmdName pointer will
//	be NULL if no matching command was found. The ref count of the cached
//	Command's structure (if any) is also incremented.
//
//----------------------------------------------------------------------

func sSetCmdNameFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclObj.c:4377:1: */
	var iPtr uintptr = interp
	var name uintptr
	var cmdPtr uintptr
	var currNsPtr uintptr
	var resPtr uintptr

	if interp == uintptr(0) {
		return TCL_ERROR
	}

	// Find the Command structure, if any, that describes the command called
	// "name". Build a ResolvedCmdName that holds a cached pointer to this
	// Command, and bump the reference count in the referenced Command
	// structure. A Command structure will not be deleted as long as it is
	// referenced from a CmdName object.

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()
	cmdPtr = XTcl_FindCommand(tls, interp, name /*ns*/, uintptr(0), 0)

	// Free the old internalRep before setting the new one. Do this after
	// getting the string rep to allow the conversion code (in particular,
	// Tcl_GetStringFromObj) to use that old internalRep.

	if cmdPtr != 0 {
		(*Command)(unsafe.Pointer(cmdPtr)).FrefCount++
		resPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclCmdNameType)) &&
			resPtr != 0 && (*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefCount == 1 {
			// Reuse the old ResolvedCmdName struct instead of freeing it

			var oldCmdPtr uintptr = (*ResolvedCmdName)(unsafe.Pointer(resPtr)).FcmdPtr

			if libc.PreDecInt32(&(*Command)(unsafe.Pointer(oldCmdPtr)).FrefCount, 1) == 0 {
				if libc.PostDecInt32(&(*Command)(unsafe.Pointer(oldCmdPtr)).FrefCount, 1) <= 1 {
					XTclpFree(tls, oldCmdPtr)
				}

			}
		} else {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
				if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
					(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
				}
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
			}

			resPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ResolvedCmdName{})))
			(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefCount = 1
			*(*uintptr)(unsafe.Pointer(objPtr + 32)) = resPtr
			*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclCmdNameType))
		}
		(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FcmdPtr = cmdPtr
		(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FcmdEpoch = (*Command)(unsafe.Pointer(cmdPtr)).FcmdEpoch
		if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&name, 1)))) == ':' && int32(*(*int8)(unsafe.Pointer(name))) == ':' {
			// The name is fully qualified: set the referring namespace to
			// NULL.

			(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsPtr = uintptr(0)
		} else {
			// Get the current namespace.

			currNsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr

			(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsPtr = currNsPtr
			(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsId = (*Namespace)(unsafe.Pointer(currNsPtr)).FnsId
			(*ResolvedCmdName)(unsafe.Pointer(resPtr)).FrefNsCmdEpoch = (*Namespace)(unsafe.Pointer(currNsPtr)).FcmdRefEpoch
		}
	} else {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		}

		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = uintptr(0)
		*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclCmdNameType))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_RepresentationCmd --
//
//	Implementation of the "tcl::unsupported::representation" command.
//
// Results:
//	Reports the current representation (Tcl_Obj type) of its argument.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_RepresentationCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclObj.c:4477:1: */
	bp := tls.Alloc(110)
	defer tls.Free(110)

	// var ptrBuffer [54]int8 at bp+56, 54

	var descObj uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+3535)
		return TCL_ERROR
	}

	// Value is a bignum with a refcount of 14, object pointer at 0x12345678,
	// internal representation 0x45671234:0x98765432, string representation
	// "1872361827361287"

	libc.Xsprintf(tls, bp+56, ts+359, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(objv + 1*8))))
	descObj = XTcl_ObjPrintf(tls,
		ts+54311,
		libc.VaList(bp+8, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr != 0 {
				return (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr)).Fname
			}
			return ts + 54369 /* "pure string" */
		}(),
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FrefCount, bp+56 /* &ptrBuffer[0] */))

	// This is a workaround to silence reports from `make valgrind`
	// on 64-bit systems.  The problem is that the test suite
	// includes calling the [represenation] command on values of
	// &tclDoubleType.  When these values are created, the "doubleValue"
	// is set, but when the "twoPtrValue" is examined, its "ptr2"
	// field has never been initialized.  Since [representation]
	// presents the value of the ptr2 value in its output, valgrind
	// alerts about the read of uninitialized memory.
	//
	// The general problem with [representation], that it can read
	// and report uninitialized fields, is still present.  This is
	// just the minimal workaround to silence one particular test.

	if uint64(unsafe.Sizeof(uintptr(0))) > uint64(4) && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) {
		*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32 + 8 /* &.ptr2 */)) = uintptr(0)
	}
	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr != 0 {
		libc.Xsprintf(tls, bp+56, ts+54381,
			libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32)),
				*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32 + 8 /* &.ptr2 */))))
		XTcl_AppendPrintfToObj(tls, descObj, ts+54387,
			libc.VaList(bp+48, bp+56))
	}

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
		XTcl_AppendToObj(tls, descObj, ts+54416, -1)
		XTcl_AppendLimitedToObj(tls, descObj, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength,
			16, ts+7891)
		XTcl_AppendToObj(tls, descObj, ts+25027, -1)
	} else {
		XTcl_AppendToObj(tls, descObj, ts+54442, -1)
	}

	XTcl_SetObjResult(tls, interp, descObj)
	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// indent-tabs-mode: nil
// End:

// Helper macros.

// ----------------------------------------------------------------------
//
// LocateTargetAddresses --
//
//	Populate a hash table with places that we need to be careful around
//	because they're the targets of various kinds of jumps and other
//	non-local behavior.
//
// ----------------------------------------------------------------------

func sLocateTargetAddresses(tls *libc.TLS, envPtr uintptr, tablePtr uintptr) { /* tclOptimize.c:52:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var currentInstPtr uintptr
	var targetInstPtr uintptr
	// var isNew int32 at bp, 4

	var i int32
	var hPtr uintptr
	// var hSearch Tcl_HashSearch at bp+8, 24

	var rangePtr uintptr

	XTcl_InitHashTable(tls, tablePtr, 1)

	// The starts of commands represent target addresses.

	i = 0
__1:
	if !(i < (*CompileEnv)(unsafe.Pointer(envPtr)).FnumCommands) {
		goto __3
	}
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})).f(tls, tablePtr, (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart+uintptr((*CmdLocation)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr+uintptr(i)*16)).FcodeOffset), bp /* &isNew */)
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;

	// Find places where we should be careful about replacing instructions
	// because they are the targets of various types of jumps.

	currentInstPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart
__4:
	if !(currentInstPtr < (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) {
		goto __6
	}
	switch int32(*(*uint8)(unsafe.Pointer(currentInstPtr))) {
	case INST_JUMP1:
		goto __8
	case INST_JUMP_TRUE1:
		goto __9
	case INST_JUMP_FALSE1:
		goto __10
	case INST_JUMP4:
		goto __11
	case INST_JUMP_TRUE4:
		goto __12
	case INST_JUMP_FALSE4:
		goto __13
	case INST_START_CMD:
		goto __14
	case INST_BEGIN_CATCH4:
		goto __15
	case INST_JUMP_TABLE:
		goto __16
	case INST_RETURN_CODE_BRANCH:
		goto __17
	}
	goto __7
__8:
__9:
__10:
	targetInstPtr = currentInstPtr + uintptr(int32(*(*int8)(unsafe.Pointer(currentInstPtr + uintptr(1)))))
	goto storeTarget
__11:
__12:
__13:
__14:
	targetInstPtr = currentInstPtr + uintptr(int32(uint32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1))))<<24)|int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(1))))<<16|int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(2))))<<8|int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(3)))))
	goto storeTarget
__15:
	targetInstPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*ExceptionRange)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(uint32(int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1))))<<24)|uint32(int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(1))))<<16)|uint32(int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(2))))<<8)|uint32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(3)))))*28)).FcodeOffset)
storeTarget:
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})).f(tls, tablePtr, targetInstPtr, bp /* &isNew */)
	goto __7
__16:
	hPtr = XTcl_FirstHashEntry(tls,
		(*AuxData)(unsafe.Pointer((*CompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr+uintptr(uint32(int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1))))<<24)|uint32(int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(1))))<<16)|uint32(int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(2))))<<8)|uint32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(3)))))*16)).FclientData,
		bp+8)
__18:
	if !(hPtr != 0) {
		goto __20
	}
	targetInstPtr = currentInstPtr + uintptr(int32((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData))
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})).f(tls, tablePtr, targetInstPtr, bp /* &isNew */)
	goto __19
__19:
	hPtr = XTcl_NextHashEntry(tls, bp+8)
	goto __18
	goto __20
__20:
	;
	goto __7
__17:
	i = TCL_ERROR
__21:
	if !(i < TCL_CONTINUE+1) {
		goto __23
	}
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})).f(tls, tablePtr, currentInstPtr+uintptr(2*i)-uintptr(1), bp /* &isNew */)
	goto __22
__22:
	i++
	goto __21
	goto __23
__23:
	;
	goto __7
__7:
	;
	goto __5
__5:
	currentInstPtr += uintptr(XtclInstructionTable[*(*uint8)(unsafe.Pointer(currentInstPtr))].FnumBytes)
	goto __4
	goto __6
__6:
	;

	// Add a marker *after* the last bytecode instruction. WARNING: points to
	// one past the end!

	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})).f(tls, tablePtr, currentInstPtr, bp /* &isNew */)

	// Enter in the targets of exception ranges.

	i = 0
__24:
	if !(i < (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext) {
		goto __26
	}
	rangePtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(i)*28

	if !((*ExceptionRange)(unsafe.Pointer(rangePtr)).Ftype == CATCH_EXCEPTION_RANGE) {
		goto __27
	}
	targetInstPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*ExceptionRange)(unsafe.Pointer(rangePtr)).FcatchOffset)
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})).f(tls, tablePtr, targetInstPtr, bp /* &isNew */)
	goto __28
__27:
	targetInstPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*ExceptionRange)(unsafe.Pointer(rangePtr)).FbreakOffset)
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})).f(tls, tablePtr, targetInstPtr, bp /* &isNew */)
	if !((*ExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset >= 0) {
		goto __29
	}
	targetInstPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*ExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset)
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})).f(tls, tablePtr, targetInstPtr, bp /* &isNew */)
__29:
	;
__28:
	;
	goto __25
__25:
	i++
	goto __24
	goto __26
__26:
}

// ----------------------------------------------------------------------
//
// TrimUnreachable --
//
//	Converts code that provably can't be executed into NOPs and reduces
//	the overall reported length of the bytecode where that is possible.
//
// ----------------------------------------------------------------------

func sTrimUnreachable(tls *libc.TLS, envPtr uintptr) { /* tclOptimize.c:156:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	var currentInstPtr uintptr
	// var targets Tcl_HashTable at bp, 88

	sLocateTargetAddresses(tls, envPtr, bp)

	for currentInstPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart; currentInstPtr < (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext-uintptr(1); currentInstPtr += uintptr(XtclInstructionTable[*(*uint8)(unsafe.Pointer(currentInstPtr))].FnumBytes) {
		var clear int32 = 0

		if int32(*(*uint8)(unsafe.Pointer(currentInstPtr))) != INST_DONE {
			continue
		}

		for !((*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp)).FfindProc})).f(tls, bp, currentInstPtr+uintptr(1)+uintptr(clear)) != uintptr(0)) {
			clear = clear + XtclInstructionTable[*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(clear)))].FnumBytes
		}
		if currentInstPtr+uintptr(1)+uintptr(clear) == (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext {
			*(*uintptr)(unsafe.Pointer(envPtr + 120)) -= uintptr(clear)
		} else {
			for libc.PostDecInt32(&clear, 1) > 0 {
				*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(clear))) = uint8(INST_NOP)
			}
		}
	}

	XTcl_DeleteHashTable(tls, bp)
}

// ----------------------------------------------------------------------
//
// ConvertZeroEffectToNOP --
//
//	Replace PUSH/POP sequences (when non-hazardous) with NOPs. Also
//	replace PUSH empty/STR_CONCAT and TRY_CVT_NUMERIC (when followed by an
//	operation that guarantees the check for arithmeticity) and eliminate
//	LNOT when we can invert the following JUMP condition.
//
// ----------------------------------------------------------------------

func sConvertZeroEffectToNOP(tls *libc.TLS, envPtr uintptr) { /* tclOptimize.c:202:1: */
	bp := tls.Alloc(96)
	defer tls.Free(96)

	var currentInstPtr uintptr
	var size int32
	// var targets Tcl_HashTable at bp, 88

	sLocateTargetAddresses(tls, envPtr, bp)
	for currentInstPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart; currentInstPtr < (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext; currentInstPtr += uintptr(size) {
		var blank int32 = 0
		var i int32
		var nextInst int32

		size = XtclInstructionTable[*(*uint8)(unsafe.Pointer(currentInstPtr))].FnumBytes
		for currentInstPtr+uintptr(size) < (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext &&
			int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(size)))) == INST_NOP {
			if (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp)).FfindProc})).f(tls, bp, currentInstPtr+uintptr(size)) != uintptr(0) {
				break
			}
			size = size + XtclInstructionTable[uint8(INST_NOP)].FnumBytes
		}
		if (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp)).FfindProc})).f(tls, bp, currentInstPtr+uintptr(size)) != uintptr(0) {
			continue
		}
		nextInst = int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(size))))
		switch int32(*(*uint8)(unsafe.Pointer(currentInstPtr))) {
		case INST_PUSH1:
			if nextInst == INST_POP {
				blank = size + XtclInstructionTable[uint8(nextInst)].FnumBytes
			} else if nextInst == INST_STR_CONCAT1 &&
				uint32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(size) + uintptr(1)))) == uint32(2) {
				var litPtr uintptr = XTclFetchLiteral(tls, envPtr,
					uint32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1)))))
				// var numBytes int32 at bp+88, 4

				XTcl_GetStringFromObj(tls, litPtr, bp+88)
				if *(*int32)(unsafe.Pointer(bp + 88)) == 0 {
					blank = size + XtclInstructionTable[uint8(nextInst)].FnumBytes
				}
			}
			break
		case INST_PUSH4:
			if nextInst == INST_POP {
				blank = size + 1
			} else if nextInst == INST_STR_CONCAT1 &&
				uint32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(size) + uintptr(1)))) == uint32(2) {
				var litPtr uintptr = XTclFetchLiteral(tls, envPtr,
					uint32(int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1))))<<24)|uint32(int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(1))))<<16)|uint32(int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(2))))<<8)|uint32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(3)))))
				// var numBytes int32 at bp+92, 4

				XTcl_GetStringFromObj(tls, litPtr, bp+92)
				if *(*int32)(unsafe.Pointer(bp + 92)) == 0 {
					blank = size + XtclInstructionTable[uint8(nextInst)].FnumBytes
				}
			}
			break

		case INST_LNOT:
			switch nextInst {
			case INST_JUMP_TRUE1:
				blank = size
				*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(size))) = uint8(INST_JUMP_FALSE1)
				break
			case INST_JUMP_FALSE1:
				blank = size
				*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(size))) = uint8(INST_JUMP_TRUE1)
				break
			case INST_JUMP_TRUE4:
				blank = size
				*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(size))) = uint8(INST_JUMP_FALSE4)
				break
			case INST_JUMP_FALSE4:
				blank = size
				*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(size))) = uint8(INST_JUMP_TRUE4)
				break
			}
			break

		case INST_TRY_CVT_TO_NUMERIC:
			switch nextInst {
			case INST_JUMP_TRUE1:
				fallthrough
			case INST_JUMP_TRUE4:
				fallthrough
			case INST_JUMP_FALSE1:
				fallthrough
			case INST_JUMP_FALSE4:
				fallthrough
			case INST_INCR_SCALAR1:
				fallthrough
			case INST_INCR_ARRAY1:
				fallthrough
			case INST_INCR_ARRAY_STK:
				fallthrough
			case INST_INCR_SCALAR_STK:
				fallthrough
			case INST_INCR_STK:
				fallthrough
			case INST_LOR:
				fallthrough
			case INST_LAND:
				fallthrough
			case INST_EQ:
				fallthrough
			case INST_NEQ:
				fallthrough
			case INST_LT:
				fallthrough
			case INST_LE:
				fallthrough
			case INST_GT:
				fallthrough
			case INST_GE:
				fallthrough
			case INST_MOD:
				fallthrough
			case INST_LSHIFT:
				fallthrough
			case INST_RSHIFT:
				fallthrough
			case INST_BITOR:
				fallthrough
			case INST_BITXOR:
				fallthrough
			case INST_BITAND:
				fallthrough
			case INST_EXPON:
				fallthrough
			case INST_ADD:
				fallthrough
			case INST_SUB:
				fallthrough
			case INST_DIV:
				fallthrough
			case INST_MULT:
				fallthrough
			case INST_LNOT:
				fallthrough
			case INST_BITNOT:
				fallthrough
			case INST_UMINUS:
				fallthrough
			case INST_UPLUS:
				fallthrough
			case INST_TRY_CVT_TO_NUMERIC:
				blank = size
				break
			}
			break
		}

		if blank > 0 {
			for i = 0; i < blank; i++ {
				*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(i))) = uint8(INST_NOP)
			}
			size = blank
		}
	}
	XTcl_DeleteHashTable(tls, bp)
}

// ----------------------------------------------------------------------
//
// AdvanceJumps --
//
//	Advance jumps past NOPs and chained JUMPs. After this runs, the only
//	JUMPs that jump to a NOP or a JUMP will be length-1 ones that run out
//	of room in their opcode to be targeted to where they really belong.
//
// ----------------------------------------------------------------------

func sAdvanceJumps(tls *libc.TLS, envPtr uintptr) { /* tclOptimize.c:343:1: */
	bp := tls.Alloc(92)
	defer tls.Free(92)

	var currentInstPtr uintptr
	// var jumps Tcl_HashTable at bp, 88

	for currentInstPtr = (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeStart; currentInstPtr < (*CompileEnv)(unsafe.Pointer(envPtr)).FcodeNext-uintptr(1); currentInstPtr += uintptr(XtclInstructionTable[*(*uint8)(unsafe.Pointer(currentInstPtr))].FnumBytes) {
		var offset int32
		var delta int32
		// var isNew int32 at bp+88, 4

		switch int32(*(*uint8)(unsafe.Pointer(currentInstPtr))) {
		case INST_JUMP1:
			fallthrough
		case INST_JUMP_TRUE1:
			fallthrough
		case INST_JUMP_FALSE1:
			offset = int32(*(*int8)(unsafe.Pointer(currentInstPtr + uintptr(1))))
			XTcl_InitHashTable(tls, bp, 1)
			for delta = 0; offset+delta != 0; {
				if offset+delta < -128 || offset+delta > 127 {
					break
				}
				(*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &jumps */)).FcreateProc})).f(tls, bp /* &jumps */, uintptr(Intptr_t(offset)), bp+88 /* &isNew */)
				if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
					offset = int32(*(*int8)(unsafe.Pointer(currentInstPtr + uintptr(1))))
					break
				}
				offset = offset + delta
				switch int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(offset)))) {
				case INST_NOP:
					delta = XtclInstructionTable[uint8(INST_NOP)].FnumBytes
					continue
				case INST_JUMP1:
					delta = int32(*(*int8)(unsafe.Pointer(currentInstPtr + uintptr(offset) + uintptr(1))))
					continue
				case INST_JUMP4:
					delta = int32(uint32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(offset) + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(offset) + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(offset) + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(offset) + uintptr(1) + uintptr(3))))
					continue
				}
				break
			}
			XTcl_DeleteHashTable(tls, bp)
			*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1))) = uint8(uint32(offset))
			continue

		case INST_JUMP4:
			fallthrough
		case INST_JUMP_TRUE4:
			fallthrough
		case INST_JUMP_FALSE4:
			XTcl_InitHashTable(tls, bp, 1)
			(*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &jumps */)).FcreateProc})).f(tls, bp /* &jumps */, uintptr(int64(0)), bp+88 /* &isNew */)
			for offset = int32(uint32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(3)))); offset != 0; {
				(*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &jumps */)).FcreateProc})).f(tls, bp /* &jumps */, uintptr(Intptr_t(offset)), bp+88 /* &isNew */)
				if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
					offset = int32(uint32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(3))))
					break
				}
				switch int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(offset)))) {
				case INST_NOP:
					offset = offset + XtclInstructionTable[uint8(INST_NOP)].FnumBytes
					continue
				case INST_JUMP1:
					offset = offset + int32(*(*int8)(unsafe.Pointer(currentInstPtr + uintptr(offset) + uintptr(1))))
					continue
				case INST_JUMP4:
					offset = offset + (int32(uint32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(offset) + uintptr(1))))<<24) | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(offset) + uintptr(1) + uintptr(1))))<<16 | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(offset) + uintptr(1) + uintptr(2))))<<8 | int32(*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(offset) + uintptr(1) + uintptr(3)))))
					continue
				}
				break
			}
			XTcl_DeleteHashTable(tls, bp)
			for ok := true; ok; ok = 0 != 0 {
				*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1))) = uint8(uint32(offset) >> 24)
				*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(1))) = uint8(uint32(offset) >> 16)
				*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(2))) = uint8(uint32(offset) >> 8)
				*(*uint8)(unsafe.Pointer(currentInstPtr + uintptr(1) + uintptr(3))) = uint8(uint32(offset))
			}
			continue
		}
	}
}

// ----------------------------------------------------------------------
//
// TclOptimizeBytecode --
//
//	A very simple peephole optimizer for bytecode.
//
// ----------------------------------------------------------------------

func XTclOptimizeBytecode(tls *libc.TLS, envPtr uintptr) { /* tclOptimize.c:429:1: */
	sConvertZeroEffectToNOP(tls, envPtr)
	sAdvanceJumps(tls, envPtr)
	sTrimUnreachable(tls, envPtr)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The panicProc variable contains a pointer to an application specific panic
// procedure.

var panicProc uintptr = uintptr(0) /* tclPanic.c:29:36 */

//----------------------------------------------------------------------
//
// Tcl_SetPanicProc --
//
//	Replace the default panic behavior with the specified function.
//
// Results:
//	None.
//
// Side effects:
//	Sets the panicProc variable.
//
//----------------------------------------------------------------------

func XTcl_SetPanicProc(tls *libc.TLS, proc uintptr) { /* tclPanic.c:49:1: */
	panicProc = proc
}

//----------------------------------------------------------------------
//
// Tcl_PanicVA --
//
//	Print an error message and kill the process.
//
// Results:
//	None.
//
// Side effects:
//	The process dies, entering the debugger if possible.
//
//----------------------------------------------------------------------

func XTcl_PanicVA(tls *libc.TLS, format uintptr, argList Va_list) { /* tclPanic.c:80:1: */
	bp := tls.Alloc(128)
	defer tls.Free(128)

	var arg1 uintptr
	var arg2 uintptr
	var arg3 uintptr // Additional arguments (variable in number)
	// to pass to fprintf.
	var arg4 uintptr
	var arg5 uintptr
	var arg6 uintptr
	var arg7 uintptr
	var arg8 uintptr

	arg1 = libc.VaUintptr(&argList)
	arg2 = libc.VaUintptr(&argList)
	arg3 = libc.VaUintptr(&argList)
	arg4 = libc.VaUintptr(&argList)
	arg5 = libc.VaUintptr(&argList)
	arg6 = libc.VaUintptr(&argList)
	arg7 = libc.VaUintptr(&argList)
	arg8 = libc.VaUintptr(&argList)

	if panicProc != uintptr(0) {
		(*struct {
			f func(*libc.TLS, uintptr, uintptr)
		})(unsafe.Pointer(&struct{ uintptr }{panicProc})).f(tls, format, libc.VaList(bp, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8))
	} else {
		libc.Xfprintf(tls, libc.Xstderr, format, libc.VaList(bp+64, arg1, arg2, arg3, arg4, arg5, arg6, arg7,
			arg8))
		libc.Xfprintf(tls, libc.Xstderr, ts+350, 0)
		libc.Xfflush(tls, libc.Xstderr)
		libc.Xabort(tls)
	}
}

//----------------------------------------------------------------------
//
// Tcl_Panic --
//
//	Print an error message and kill the process.
//
// Results:
//	None.
//
// Side effects:
//	The process dies, entering the debugger if possible.
//
//----------------------------------------------------------------------

// ARGSUSED

// The following comment is here so that Coverity's static analizer knows that
// a Tcl_Panic() call can never return and avoids lots of false positives.

// coverity[+kill]
func XTcl_Panic(tls *libc.TLS, format uintptr, va uintptr) { /* tclPanic.c:153:1: */
	var argList Va_list
	_ = argList

	argList = va
	XTcl_PanicVA(tls, format, argList)
	_ = argList
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.2 Diagnostics	<assert.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// void assert (int expression);
//
//    If NDEBUG is defined, do nothing.
//    If not, and EXPRESSION is zero, print an error message and abort.

// void assert_perror (int errnum);
//
//    If NDEBUG is defined, do nothing.  If not, and ERRNUM is not zero, print an
//    error message with the error text for ERRNUM and abort.
//    (This is a GNU extension.)

// The following table provides parsing information about each possible 8-bit
// character. The table is designed to be referenced with either signed or
// unsigned characters, so it has 384 entries. The first 128 entries
// correspond to negative character values, the next 256 correspond to
// positive character values. The last 128 entries are identical to the first
// 128. The table is always indexed with a 128-byte offset (the 128th entry
// corresponds to a character value of 0).
//
// The macro CHAR_TYPE is used to index into the table and return information
// about its character argument. The following return values are defined.
//
// TYPE_NORMAL -	All characters that don't have special significance to
//			the Tcl parser.
// TYPE_SPACE -		The character is a whitespace character other than
//			newline.
// TYPE_COMMAND_END -	Character is newline or semicolon.
// TYPE_SUBS -		Character begins a substitution or has other special
//			meaning in ParseTokens: backslash, dollar sign, or
//			open bracket.
// TYPE_QUOTE -		Character is a double quote.
// TYPE_CLOSE_PAREN -	Character is a right parenthesis.
// TYPE_CLOSE_BRACK -	Character is a right square bracket.
// TYPE_BRACE -		Character is a curly brace (either left or right).

var XtclCharTypeTable = [384]int8{
	// Negative character values, from -128 to -1:

	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),

	// Positive character values, from 0-127:

	int8(TYPE_SUBS), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_SPACE), int8(TYPE_COMMAND_END), int8(TYPE_SPACE),
	int8(TYPE_SPACE), int8(TYPE_SPACE), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_SPACE), int8(TYPE_NORMAL), int8(TYPE_QUOTE), int8(TYPE_NORMAL),
	int8(TYPE_SUBS), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_CLOSE_PAREN), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_COMMAND_END),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_SUBS),
	int8(TYPE_SUBS), int8(TYPE_CLOSE_BRACK), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_BRACE),
	int8(TYPE_NORMAL), int8(TYPE_BRACE), int8(TYPE_NORMAL), int8(TYPE_NORMAL),

	// Large unsigned character values, from 128-255:

	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
	int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL), int8(TYPE_NORMAL),
} /* tclParse.c:46:12 */

//----------------------------------------------------------------------
//
// TclParseInit --
//
//	Initialize the fields of a Tcl_Parse struct.
//
// Results:
//	None.
//
// Side effects:
//	The Tcl_Parse struct pointed to by parsePtr gets initialized.
//
//----------------------------------------------------------------------

func XTclParseInit(tls *libc.TLS, interp uintptr, start uintptr, numBytes int32, parsePtr uintptr) { /* tclParse.c:190:1: */
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords = 0
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = parsePtr + 96 /* &.staticTokens */
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens = 0
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = NUM_STATIC_TOKENS
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fstring = start
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend = start + uintptr(numBytes)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp = interp
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = 0
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_SUCCESS
}

//----------------------------------------------------------------------
//
// Tcl_ParseCommand --
//
//	Given a string, this function parses the first Tcl command in the
//	string and returns information about the structure of the command.
//
// Results:
//	The return value is TCL_OK if the command was parsed successfully and
//	TCL_ERROR otherwise. If an error occurs and interp isn't NULL then an
//	error message is left in its result. On a successful return, parsePtr
//	is filled in with information about the command that was parsed.
//
// Side effects:
//	If there is insufficient space in parsePtr to hold all the information
//	about the command, then additional space is malloc-ed. If the function
//	returns TCL_OK then the caller must eventually invoke Tcl_FreeParse to
//	release any additional space that was allocated.
//
//----------------------------------------------------------------------

func XTcl_ParseCommand(tls *libc.TLS, interp uintptr, start uintptr, numBytes int32, nested int32, parsePtr uintptr) int32 { /* tclParse.c:234:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	var src uintptr // Points to current character in the
	// command.
	// var type1 int8 at bp+16, 1
	// Result returned by CHAR_TYPE(*src).
	var tokenPtr uintptr  // Pointer to token being filled in.
	var wordIndex int32   // Index of word token for current word.
	var terminators int32 // CHAR_TYPE bits that indicate the end of a
	// command.
	// var termPtr uintptr at bp+24, 8
	// Set by Tcl_ParseBraces/QuotedString to
	// point to char after terminating one.
	var scanned int32
	var allocated int32
	var oldPtr uintptr
	var newPtr uintptr
	var _needed int32
	var expIdx int32
	var expPtr uintptr
	// var size int32 at bp+48, 4

	var allocated1 int32
	var oldPtr1 uintptr
	var newPtr1 uintptr
	var _needed1 int32
	var quoted int32
	// Recalculate the number of Tcl_Tokens needed to store
	// tokens representing the expanded list.

	var listStart uintptr
	var growthNeeded int32
	var elemCount int32
	var code int32
	// var literal int32 at bp+52, 4

	// var nextElem uintptr at bp+40, 8

	var listEnd uintptr
	// var elemStart uintptr at bp+32, 8

	var i int32
	var isLiteral int32
	var expandWord int32

	if !(numBytes < 0 && start != 0) {
		goto __1
	}
	numBytes = int32(libc.Xstrlen(tls, start))
__1:
	;
	XTclParseInit(tls, interp, start, numBytes, parsePtr)
	if !(start == uintptr(0) && numBytes != 0) {
		goto __2
	}
	if !(interp != uintptr(0)) {
		goto __3
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+54469, -1))
__3:
	;
	return TCL_ERROR
__2:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommentStart = uintptr(0)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommentSize = 0
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart = uintptr(0)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize = 0
	if !(nested != 0) {
		goto __4
	}
	terminators = TYPE_COMMAND_END | TYPE_CLOSE_BRACK
	goto __5
__4:
	terminators = TYPE_COMMAND_END
__5:
	;

	// Parse any leading space and comments before the first word of the
	// command.

	scanned = sParseComment(tls, start, numBytes, parsePtr)
	src = start + uintptr(scanned)
	numBytes = numBytes - scanned
	if !(numBytes == 0) {
		goto __6
	}
	if !(nested != 0) {
		goto __7
	}
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = nested
__7:
	;
__6:
	;

	// The following loop parses the words of the command, one word in each
	// iteration through the loop.

	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart = src
__8:
	if !(1 != 0) {
		goto __9
	}
	expandWord = 0

	// Create the token for the word.

__10:
	_needed = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + 1
	if !(_needed > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __13
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__13:
	;
	if !(_needed > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __14
	}
	allocated = 2 * _needed
	oldPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr == parsePtr+96) {
		goto __15
	}
	oldPtr = uintptr(0)
__15:
	;
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __16
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__16:
	;
	newPtr = XTclpRealloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr == uintptr(0)) {
		goto __17
	}
	allocated = int32(uint64(_needed+1) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __18
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__18:
	;
	newPtr = XTcl_Realloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__17:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated
	if !(oldPtr == uintptr(0)) {
		goto __19
	}
	libc.Xmemcpy(tls, newPtr, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__19:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr
__14:
	;
	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
	wordIndex = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(wordIndex)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_WORD

	// Skip white space before the word. Also skip a backslash-newline
	// sequence: it should be treated just like white space.

	scanned = sParseWhiteSpace(tls, src, numBytes, parsePtr+88, bp+16)
	src += uintptr(scanned)
	numBytes = numBytes - scanned
	if !(numBytes == 0) {
		goto __20
	}
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = src
	goto __9
__20:
	;
	if !(int32(*(*int8)(unsafe.Pointer(bp + 16)))&terminators != 0) {
		goto __21
	}
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = src
	src++
	goto __9
__21:
	;
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = src
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords++

	// At this point the word can have one of four forms: something
	// enclosed in quotes, something enclosed in braces, and expanding
	// word, or an unquoted word (anything else).

parseWord:
	if !(int32(*(*int8)(unsafe.Pointer(src))) == '"') {
		goto __22
	}
	if !(XTcl_ParseQuotedString(tls, interp, src, numBytes, parsePtr, 1,
		bp+24) != TCL_OK) {
		goto __24
	}
	goto error
__24:
	;
	src = *(*uintptr)(unsafe.Pointer(bp + 24 /* termPtr */))
	numBytes = int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend) - int64(src)) / 1)
	goto __23
__22:
	if !(int32(*(*int8)(unsafe.Pointer(src))) == '{') {
		goto __25
	}
	expIdx = wordIndex + 1

	if !(XTcl_ParseBraces(tls, interp, src, numBytes, parsePtr, 1,
		bp+24) != TCL_OK) {
		goto __27
	}
	goto error
__27:
	;
	src = *(*uintptr)(unsafe.Pointer(bp + 24 /* termPtr */))
	numBytes = int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend) - int64(src)) / 1)

	// Check whether the braces contained the word expansion prefix
	// {*}

	expPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(expIdx)*24
	if !(0 == expandWord &&

		1 == (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens-expIdx &&

		(uint64(1) == Size_t((*Tcl_Token)(unsafe.Pointer(expPtr)).Fsize) &&

			int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(expPtr)).Fstart))) == '*') &&

		numBytes > 0 && 0 == sParseWhiteSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 24)),
		numBytes, parsePtr+88, bp+16) &&
		int32(*(*int8)(unsafe.Pointer(bp + 16))) != TYPE_COMMAND_END) {
		goto __28
	}
	expandWord = 1
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens--
	goto parseWord
__28:
	;
	goto __26
__25:
	// This is an unquoted word. Call ParseTokens and let it do all of
	// the work.

	if !(sParseTokens(tls, src, numBytes, TYPE_SPACE|terminators,
		TCL_SUBST_ALL, parsePtr) != TCL_OK) {
		goto __29
	}
	goto error
__29:
	;
	src = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm
	numBytes = int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend) - int64(src)) / 1)
__26:
	;
__23:
	;

	// Finish filling in the token for the word and check for the special
	// case of a word consisting of a single range of literal text.

	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(wordIndex)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = int32((int64(src) - int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)) / 1)
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens - (wordIndex + 1)
	if !(expandWord != 0) {
		goto __30
	}
	isLiteral = 1

	// When a command includes a word that is an expanded literal; for
	// example, {*}{1 2 3}, the parser performs that expansion
	// immediately, generating several TCL_TOKEN_SIMPLE_WORDs instead
	// of a single TCL_TOKEN_EXPAND_WORD that the Tcl_ParseCommand()
	// caller might have to expand. This notably makes it simpler for
	// those callers that wish to track line endings, such as those
	// that implement key parts of TIP 280.
	//
	// First check whether the thing to be expanded is a literal,
	// in the sense of being composed entirely of TCL_TOKEN_TEXT
	// tokens.

	i = 1
__32:
	if !(i <= (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents) {
		goto __34
	}
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr+uintptr(i)*24)).Ftype != TCL_TOKEN_TEXT) {
		goto __35
	}
	isLiteral = 0
	goto __34
__35:
	;
	goto __33
__33:
	i++
	goto __32
	goto __34
__34:
	;

	if !(isLiteral != 0) {
		goto __36
	}
	elemCount = 0
	code = TCL_OK
	*(*int32)(unsafe.Pointer(bp + 52 /* literal */)) = 1

	// The word to be expanded is a literal, so determine the
	// boundaries of the literal string to be treated as a list
	// and expanded. That literal string starts at
	// tokenPtr[1].start, and includes all bytes up to, but not
	// including (tokenPtr[tokenPtr->numComponents].start +
	// tokenPtr[tokenPtr->numComponents].size)

	listEnd = (*Tcl_Token)(unsafe.Pointer(tokenPtr+uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents)*24)).Fstart + uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr+uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents)*24)).Fsize)
	*(*uintptr)(unsafe.Pointer(bp + 40 /* nextElem */)) = (*Tcl_Token)(unsafe.Pointer(tokenPtr + 1*24)).Fstart

	// Step through the literal string, parsing and counting list
	// elements.

__38:
	if !(*(*uintptr)(unsafe.Pointer(bp + 40)) < listEnd) {
		goto __39
	}

	code = XTclFindElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 40 /* nextElem */)), int32((int64(listEnd)-int64(*(*uintptr)(unsafe.Pointer(bp + 40))))/1),
		bp+32, bp+40, bp+48, bp+52)
	if !(code != TCL_OK || !(*(*int32)(unsafe.Pointer(bp + 52)) != 0)) {
		goto __40
	}
	goto __39
__40:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 32)) < listEnd) {
		goto __41
	}
	elemCount++
__41:
	;
	goto __38
__39:
	;

	if !(code != TCL_OK || !(*(*int32)(unsafe.Pointer(bp + 52)) != 0)) {
		goto __42
	}
	// Some list element could not be parsed, or is not
	// present as a literal substring of the script.  The
	// compiler cannot handle list elements that get generated
	// by a call to TclCopyAndCollapse(). Defer  the
	// handling of  this to  compile/eval time, where  code is
	// already  in place to  report the  "attempt to  expand a
	// non-list" error or expand lists that require
	// substitution.

	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_EXPAND_WORD
	goto __43
__42:
	if !(elemCount == 0) {
		goto __44
	}
	// We are expanding a literal empty list. This means that
	// the expanding word completely disappears, leaving no
	// word generated this pass through the loop. Adjust
	// accounting appropriately.

	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords--
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens = wordIndex
	goto __45
__44:
	growthNeeded = wordIndex + 2*elemCount -
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens

	*(*int32)(unsafe.Pointer(parsePtr + 28)) += elemCount - 1
	if !(growthNeeded > 0) {
		goto __46
	}
__47:
	_needed1 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + growthNeeded
	if !(_needed1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __50
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp+8, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__50:
	;
	if !(_needed1 > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __51
	}
	allocated1 = 2 * _needed1
	oldPtr1 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr1 == parsePtr+96) {
		goto __52
	}
	oldPtr1 = uintptr(0)
__52:
	;
	if !(allocated1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __53
	}
	allocated1 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__53:
	;
	newPtr1 = XTclpRealloc(tls, oldPtr1, uint32(uint64(allocated1)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr1 == uintptr(0)) {
		goto __54
	}
	allocated1 = int32(uint64(_needed1+growthNeeded) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __55
	}
	allocated1 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__55:
	;
	newPtr1 = XTcl_Realloc(tls, oldPtr1, uint32(uint64(allocated1)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__54:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated1
	if !(oldPtr1 == uintptr(0)) {
		goto __56
	}
	libc.Xmemcpy(tls, newPtr1, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__56:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr1
__51:
	;
	goto __48
__48:
	if 0 != 0 {
		goto __47
	}
	goto __49
__49:
	;
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(wordIndex)*24
__46:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens = wordIndex + 2*elemCount

	// Generate a TCL_TOKEN_SIMPLE_WORD token sequence for
	// each element of the literal list we are expanding in
	// place. Take care with the start and size fields of each
	// token so they point to the right literal characters in
	// the original script to represent the right expanded
	// word value.

	listStart = libc.AssignPtrUintptr(bp+40 /* nextElem */, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart)
__57:
	if !(*(*uintptr)(unsafe.Pointer(bp + 40)) < listEnd) {
		goto __58
	}

	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_SIMPLE_WORD
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 1

	tokenPtr += 24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0
	XTclFindElement(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 40 /* nextElem */)), int32((int64(listEnd)-int64(*(*uintptr)(unsafe.Pointer(bp + 40))))/1),
		tokenPtr+8, bp+40,
		tokenPtr+16, uintptr(0))

	quoted = libc.Bool32((int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart + libc.UintptrFromInt32(-1)))) == '{' ||
		int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart + libc.UintptrFromInt32(-1)))) == '"') &&
		(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart > listStart)
	(*Tcl_Token)(unsafe.Pointer(tokenPtr + libc.UintptrFromInt32(-1)*24)).Fstart = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart - uintptr(quoted)
	(*Tcl_Token)(unsafe.Pointer(tokenPtr + libc.UintptrFromInt32(-1)*24)).Fsize = int32((int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize))-
		int64((*Tcl_Token)(unsafe.Pointer(tokenPtr+libc.UintptrFromInt32(-1)*24)).Fstart))/1 + int64(quoted))

	tokenPtr += 24
	goto __57
__58:
	;
__45:
	;
__43:
	;
	goto __37
__36:
	// The word to be expanded is not a literal, so defer
	// expansion to compile/eval time by marking with a
	// TCL_TOKEN_EXPAND_WORD token.

	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_EXPAND_WORD
__37:
	;
	goto __31
__30:
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents == 1 &&
		(*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Ftype == TCL_TOKEN_TEXT) {
		goto __59
	}
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_SIMPLE_WORD
__59:
	;
__31:
	;

	// Do two additional checks: (a) make sure we're really at the end of
	// a word (there might have been garbage left after a quoted or braced
	// word), and (b) check for the end of the command.

	scanned = sParseWhiteSpace(tls, src, numBytes, parsePtr+88, bp+16)
	if !(scanned != 0) {
		goto __60
	}
	src += uintptr(scanned)
	numBytes = numBytes - scanned
	goto __8
__60:
	;

	if !(numBytes == 0) {
		goto __61
	}
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = src
	goto __9
__61:
	;
	if !(int32(*(*int8)(unsafe.Pointer(bp + 16)))&terminators != 0) {
		goto __62
	}
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = src
	src++
	goto __9
__62:
	;
	if !(int32(*(*int8)(unsafe.Pointer(src + libc.UintptrFromInt32(-1)))) == '"') {
		goto __63
	}
	if !(interp != uintptr(0)) {
		goto __65
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+54496, -1))
__65:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_QUOTE_EXTRA
	goto __64
__63:
	if !(interp != uintptr(0)) {
		goto __66
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+54531, -1))
__66:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_BRACE_EXTRA
__64:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = src
	goto error
	goto __8
__9:
	;

	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize = int32((int64(src) - int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)) / 1)
	return TCL_OK

error:
	XTcl_FreeParse(tls, parsePtr)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize = int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend) - int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)) / 1)
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclIsSpaceProc --
//
//	Report whether byte is in the set of whitespace characters used by
//	Tcl to separate words in scripts or elements in lists.
//
// Results:
//	Returns 1, if byte is in the set, 0 otherwise.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclIsSpaceProc(tls *libc.TLS, byte int32) int32 { /* tclParse.c:617:1: */
	return libc.Bool32(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCharTypeTable)) + uintptr(128) + uintptr(uint8(byte)))))&TYPE_SPACE != 0 || byte == '\n')
}

//----------------------------------------------------------------------
//
// TclIsBareword--
//
//	Report whether byte is one that can be part of a "bareword".
//	This concept is named in expression parsing, where it determines
//	what can be a legal function name, but is the same definition used
//	in determining what variable names can be parsed as variable
//	substitutions without the benefit of enclosing braces.  The set of
//	ASCII chars that are accepted are the numeric chars ('0'-'9'),
//	the alphabetic chars ('a'-'z', 'A'-'Z')	and underscore ('_').
//
// Results:
//	Returns 1, if byte is in the accepted set of chars, 0 otherwise.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclIsBareword(tls *libc.TLS, byte int32) int32 { /* tclParse.c:646:1: */
	if byte < '0' || byte > 'z' {
		return 0
	}
	if byte <= '9' || byte >= 'a' {
		return 1
	}
	if byte == '_' {
		return 1
	}
	if byte < 'A' || byte > 'Z' {
		return 0
	}
	return 1
}

//----------------------------------------------------------------------
//
// ParseWhiteSpace --
//
//	Scans up to numBytes bytes starting at src, consuming white space
//	between words as defined by Tcl's parsing rules.
//
// Results:
//	Returns the number of bytes recognized as white space. Records at
//	parsePtr, information about the parse. Records at typePtr the
//	character type of the non-whitespace character that terminated the
//	scan.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sParseWhiteSpace(tls *libc.TLS, src uintptr, numBytes int32, incompletePtr uintptr, typePtr uintptr) int32 { /* tclParse.c:685:1: */
	var type1 int8 = int8(TYPE_NORMAL)
	var p uintptr = src

	for 1 != 0 {
		for numBytes != 0 && int32(libc.AssignInt8(&type1, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCharTypeTable)) + uintptr(128) + uintptr(uint8(*(*int8)(unsafe.Pointer(p))))))))&TYPE_SPACE != 0 {
			numBytes--
			p++
		}
		if numBytes != 0 && int32(type1)&TYPE_SUBS != 0 {
			if int32(*(*int8)(unsafe.Pointer(p))) != '\\' {
				break
			}
			if libc.PreDecInt32(&numBytes, 1) == 0 {
				break
			}
			if int32(*(*int8)(unsafe.Pointer(p + 1))) != '\n' {
				break
			}
			p += uintptr(2)
			if libc.PreDecInt32(&numBytes, 1) == 0 {
				*(*int32)(unsafe.Pointer(incompletePtr)) = 1
				break
			}
			continue
		}
		break
	}
	*(*int8)(unsafe.Pointer(typePtr)) = type1
	return int32((int64(p) - int64(src)) / 1)
}

//----------------------------------------------------------------------
//
// TclParseAllWhiteSpace --
//
//	Scans up to numBytes bytes starting at src, consuming all white space
//	including the command-terminating newline characters.
//
// Results:
//	Returns the number of bytes recognized as white space.
//
//----------------------------------------------------------------------

func XTclParseAllWhiteSpace(tls *libc.TLS, src uintptr, numBytes int32) int32 { /* tclParse.c:739:1: */
	bp := tls.Alloc(5)
	defer tls.Free(5)

	// var dummy int32 at bp, 4

	// var type1 int8 at bp+4, 1

	var p uintptr = src

	for ok := true; ok; ok = numBytes != 0 && int32(*(*int8)(unsafe.Pointer(p))) == '\n' && func() bool { p++; return libc.PreDecInt32(&numBytes, 1) != 0 }() {
		var scanned int32 = sParseWhiteSpace(tls, p, numBytes, bp, bp+4)

		p += uintptr(scanned)
		numBytes = numBytes - scanned
	}
	return int32((int64(p) - int64(src)) / 1)
}

//----------------------------------------------------------------------
//
// ParseHex --
//
//	Scans a hexadecimal number as a Tcl_UniChar value (e.g., for parsing
//	\x and \u escape sequences). At most numBytes bytes are scanned.
//
// Results:
//	The numeric value is stored in *resultPtr. Returns the number of bytes
//	consumed.
//
// Notes:
//	Relies on the following properties of the ASCII character set, with
//	which UTF-8 is compatible:
//
//	The digits '0' .. '9' and the letters 'A' .. 'Z' and 'a' .. 'z' occupy
//	consecutive code points, and '0' < 'A' < 'a'.
//
//----------------------------------------------------------------------

func XParseHex(tls *libc.TLS, src uintptr, numBytes int32, resultPtr uintptr) int32 { /* tclParse.c:779:1: */
	var result int32 = 0
	var p uintptr = src

	for libc.PostDecInt32(&numBytes, 1) != 0 {
		var digit uint8 = uint8(*(*int8)(unsafe.Pointer(p)))

		if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(digit))*2)))&int32(X_ISxdigit) != 0) || result > 0x10FFF {
			break
		}

		p++
		result <<= 4

		if int32(digit) >= 'a' {
			result = result | (10 + int32(digit) - 'a')
		} else if int32(digit) >= 'A' {
			result = result | (10 + int32(digit) - 'A')
		} else {
			result = result | (int32(digit) - '0')
		}
	}

	*(*int32)(unsafe.Pointer(resultPtr)) = result
	return int32((int64(p) - int64(src)) / 1)
}

//----------------------------------------------------------------------
//
// TclParseBackslash --
//
//	Scans up to numBytes bytes starting at src, consuming a backslash
//	sequence as defined by Tcl's parsing rules.
//
// Results:
//	Records at readPtr the number of bytes making up the backslash
//	sequence. Records at dst the UTF-8 encoded equivalent of that
//	backslash sequence. Returns the number of bytes written to dst, at
//	most TCL_UTF_MAX. Either readPtr or dst may be NULL, if the results
//	are not needed, but the return value is the same either way.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclParseBackslash(tls *libc.TLS, src uintptr, numBytes int32, readPtr uintptr, dst uintptr) int32 { /* tclParse.c:834:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var p uintptr
	// var result int32 at bp+4, 4

	var count int32
	// var buf [3]int8 at bp, 3

	// var utfBytes [8]int8 at bp+8, 8
	p = src + uintptr(1)
	*(*[3]int8)(unsafe.Pointer(bp /* buf */)) = *(*[3]int8)(unsafe.Pointer(ts + 18812))

	if !(numBytes == 0) {
		goto __1
	}
	if !(readPtr != uintptr(0)) {
		goto __2
	}
	*(*int32)(unsafe.Pointer(readPtr)) = 0
__2:
	;
	return 0
__1:
	;

	if !(dst == uintptr(0)) {
		goto __3
	}
	dst = bp /* &buf[0] */
__3:
	;

	if !(numBytes == 1) {
		goto __4
	}
	// Can only scan the backslash, so return it.

	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = '\\'
	count = 1
	goto done
__4:
	;

	count = 2
	switch int32(*(*int8)(unsafe.Pointer(p))) {
	// Note: in the conversions below, use absolute values (e.g., 0xA)
	// rather than symbolic values (e.g. \n) that get converted by the
	// compiler. It's possible that compilers on some platforms will do
	// the symbolic conversions differently, which could result in
	// non-portable Tcl scripts.

	case 'a':
		goto __6
	case 'b':
		goto __7
	case 'f':
		goto __8
	case 'n':
		goto __9
	case 'r':
		goto __10
	case 't':
		goto __11
	case 'v':
		goto __12
	case 'x':
		goto __13
	case 'u':
		goto __14
	case 'U':
		goto __15
	case '\n':
		goto __16
	case 0:
		goto __17
	default:
		goto __18
	}
	goto __5
	// Note: in the conversions below, use absolute values (e.g., 0xA)
	// rather than symbolic values (e.g. \n) that get converted by the
	// compiler. It's possible that compilers on some platforms will do
	// the symbolic conversions differently, which could result in
	// non-portable Tcl scripts.

__6:
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = 0x7
	goto __5
__7:
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = 0x8
	goto __5
__8:
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = 0xC
	goto __5
__9:
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = 0xA
	goto __5
__10:
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = 0xD
	goto __5
__11:
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = 0x9
	goto __5
__12:
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = 0xB
	goto __5
__13:
	count = count + XParseHex(tls, p+uintptr(1), func() int32 {
		if numBytes > 3 {
			return 2
		}
		return numBytes - 2
	}(), bp+4)
	if !(count == 2) {
		goto __19
	}
	// No hexdigits -> This is just "x".

	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = 'x'
	goto __20
__19:
	// Keep only the last byte (2 hex digits).
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = int32(uint8(*(*int32)(unsafe.Pointer(bp + 4))))
__20:
	;
	goto __5
__14:
	count = count + XParseHex(tls, p+uintptr(1), func() int32 {
		if numBytes > 5 {
			return 4
		}
		return numBytes - 2
	}(), bp+4)
	if !(count == 2) {
		goto __21
	}
	// No hexdigits -> This is just "u".
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = 'u'
__21:
	;
	goto __5
__15:
	count = count + XParseHex(tls, p+uintptr(1), func() int32 {
		if numBytes > 9 {
			return 8
		}
		return numBytes - 2
	}(), bp+4)
	if !(count == 2) {
		goto __22
	}
	// No hexdigits -> This is just "U".
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = 'U'
__22:
	;
	goto __5
__16:
	count--
__23:
	p++
	count++
	goto __24
__24:
	if count < numBytes && (int32(*(*int8)(unsafe.Pointer(p))) == ' ' || int32(*(*int8)(unsafe.Pointer(p))) == '\t') {
		goto __23
	}
	goto __25
__25:
	;
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = ' '
	goto __5
__17:
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = '\\'
	count = 1
	goto __5
__18:
	// Check for an octal number \oo?o?

	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(p)))))*2)))&int32(X_ISdigit) != 0 && int32(uint8(*(*int8)(unsafe.Pointer(p)))) < '8') {
		goto __26
	} // INTL: digit
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = int32(*(*int8)(unsafe.Pointer(p))) - '0'
	p++
	if !(numBytes == 2 || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(p)))))*2)))&int32(X_ISdigit) != 0) ||
		int32(uint8(*(*int8)(unsafe.Pointer(p)))) >= '8') {
		goto __27
	}
	goto __5
__27:
	;
	count = 3
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = *(*int32)(unsafe.Pointer(bp + 4))<<3 + (int32(*(*int8)(unsafe.Pointer(p))) - '0')
	p++
	if !(numBytes == 3 || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(p)))))*2)))&int32(X_ISdigit) != 0) ||
		int32(uint8(*(*int8)(unsafe.Pointer(p)))) >= '8' || *(*int32)(unsafe.Pointer(bp + 4)) >= 0x20) {
		goto __28
	}
	goto __5
__28:
	;
	count = 4
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = int32(uint8(*(*int32)(unsafe.Pointer(bp + 4))<<3 + (int32(*(*int8)(unsafe.Pointer(p))) - '0')))
	goto __5
__26:
	;

	// We have to convert here in case the user has put a backslash in
	// front of a multi-byte utf-8 character. While this means nothing
	// special, we shouldn't break up a correct utf-8 character. [Bug
	// #217987] test subst-3.2

	if !(func() int32 {
		if uint32(int32(uint8(*(*int8)(unsafe.Pointer(p))))-0xF0) < uint32(5) {
			return libc.Bool32(numBytes-1 >= 4)
		}
		return func() int32 {
			if int32(uint8(*(*int8)(unsafe.Pointer(p)))) == 0xED {
				return libc.Bool32(numBytes-1 >= 6)
			}
			return XTcl_UtfCharComplete(tls, p, numBytes-1)
		}()
	}() != 0) {
		goto __29
	}
	count = XTclUtfToUCS4(tls, p, bp+4) + 1 // +1 for '\'
	goto __30
__29:

	libc.Xmemcpy(tls, bp+8, p, uint64(numBytes-1))
	*(*int8)(unsafe.Pointer(bp + 8 + uintptr(numBytes-1))) = int8(0)
	count = XTclUtfToUCS4(tls, bp+8, bp+4) + 1
__30:
	;
	goto __5
__5:
	;

done:
	if !(readPtr != uintptr(0)) {
		goto __31
	}
	*(*int32)(unsafe.Pointer(readPtr)) = count
__31:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 4)) > 0xFFFF) {
		goto __32
	}
	*(*int32)(unsafe.Pointer(bp + 4 /* result */)) = 0xFFFD
__32:
	;
	return XTclUCS4ToUtf(tls, *(*int32)(unsafe.Pointer(bp + 4 /* result */)), dst)
}

//----------------------------------------------------------------------
//
// ParseComment --
//
//	Scans up to numBytes bytes starting at src, consuming a Tcl comment as
//	defined by Tcl's parsing rules.
//
// Results:
//	Records in parsePtr information about the parse. Returns the number of
//	bytes consumed.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sParseComment(tls *libc.TLS, src uintptr, numBytes int32, parsePtr uintptr) int32 { /* tclParse.c:1038:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var p uintptr = src

	for numBytes != 0 {
		// var type1 int8 at bp, 1

		// var scanned int32 at bp+4, 4

		for ok := true; ok; ok = numBytes != 0 && int32(*(*int8)(unsafe.Pointer(p))) == '\n' && func() bool { p++; return libc.PostDecInt32(&numBytes, 1) != 0 }() {
			*(*int32)(unsafe.Pointer(bp + 4 /* scanned */)) = sParseWhiteSpace(tls, p, numBytes,
				parsePtr+88, bp)
			p += uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* scanned */)))
			numBytes = numBytes - *(*int32)(unsafe.Pointer(bp + 4))
		}

		if numBytes == 0 || int32(*(*int8)(unsafe.Pointer(p))) != '#' {
			break
		}
		if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommentStart == uintptr(0) {
			(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommentStart = p
		}

		for numBytes != 0 {
			if int32(*(*int8)(unsafe.Pointer(p))) == '\\' {
				*(*int32)(unsafe.Pointer(bp + 4 /* scanned */)) = sParseWhiteSpace(tls, p, numBytes, parsePtr+88,
					bp)
				if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
					p += uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* scanned */)))
					numBytes = numBytes - *(*int32)(unsafe.Pointer(bp + 4))
				} else {
					// General backslash substitution in comments isn't part
					// of the formal spec, but test parse-15.47 and history
					// indicate that it has been the de facto rule. Don't
					// change it now.

					XTclParseBackslash(tls, p, numBytes, bp+4, uintptr(0))
					p += uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* scanned */)))
					numBytes = numBytes - *(*int32)(unsafe.Pointer(bp + 4))
				}
			} else {
				p++
				numBytes--
				if int32(*(*int8)(unsafe.Pointer(p + libc.UintptrFromInt32(-1)))) == '\n' {
					break
				}
			}
		}
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommentSize = int32((int64(p) - int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FcommentStart)) / 1)
	}
	return int32((int64(p) - int64(src)) / 1)
}

//----------------------------------------------------------------------
//
// ParseTokens --
//
//	This function forms the heart of the Tcl parser. It parses one or more
//	tokens from a string, up to a termination point specified by the
//	caller. This function is used to parse unquoted command words (those
//	not in quotes or braces), words in quotes, and array indices for
//	variables. No more than numBytes bytes will be scanned.
//
// Results:
//	Tokens are added to parsePtr and parsePtr->term is filled in with the
//	address of the character that terminated the parse (the first one
//	whose CHAR_TYPE matched mask or the character at parsePtr->end). The
//	return value is TCL_OK if the parse completed successfully and
//	TCL_ERROR otherwise. If a parse error occurs and parsePtr->interp is
//	not NULL, then an error message is left in the interpreter's result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sParseTokens(tls *libc.TLS, src uintptr, numBytes int32, mask int32, flags int32, parsePtr uintptr) int32 { /* tclParse.c:1123:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var type1 int8
	var originalTokens int32
	var noSubstCmds int32
	var noSubstVars int32
	var noSubstBS int32
	var tokenPtr uintptr
	var allocated int32
	var oldPtr uintptr
	var newPtr uintptr
	var _needed int32
	var varToken int32
	var curEnd uintptr
	var nestedPtr uintptr
	var allocated1 int32
	var oldPtr1 uintptr
	var newPtr1 uintptr
	var _needed1 int32
	noSubstCmds = libc.BoolInt32(!(flags&TCL_SUBST_COMMANDS != 0))
	noSubstVars = libc.BoolInt32(!(flags&TCL_SUBST_VARIABLES != 0))
	noSubstBS = libc.BoolInt32(!(flags&TCL_SUBST_BACKSLASHES != 0))

	// Each iteration through the following loop adds one token of type
	// TCL_TOKEN_TEXT, TCL_TOKEN_BS, TCL_TOKEN_COMMAND, or TCL_TOKEN_VARIABLE
	// to parsePtr. For TCL_TOKEN_VARIABLE tokens, additional tokens are added
	// for the parsed variable name.

	originalTokens = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens
__1:
	if !(numBytes != 0 && !(int32(libc.AssignInt8(&type1, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCharTypeTable)) + uintptr(128) + uintptr(uint8(*(*int8)(unsafe.Pointer(src))))))))&mask != 0)) {
		goto __2
	}
__3:
	_needed = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + 1
	if !(_needed > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __6
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__6:
	;
	if !(_needed > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __7
	}
	allocated = 2 * _needed
	oldPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr == parsePtr+96) {
		goto __8
	}
	oldPtr = uintptr(0)
__8:
	;
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __9
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__9:
	;
	newPtr = XTclpRealloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr == uintptr(0)) {
		goto __10
	}
	allocated = int32(uint64(_needed+1) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __11
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__11:
	;
	newPtr = XTcl_Realloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__10:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated
	if !(oldPtr == uintptr(0)) {
		goto __12
	}
	libc.Xmemcpy(tls, newPtr, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__12:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr
__7:
	;
	goto __4
__4:
	if 0 != 0 {
		goto __3
	}
	goto __5
__5:
	;
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = src
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0

	if !(int32(type1)&TYPE_SUBS == 0) {
		goto __13
	}
	// This is a simple range of characters. Scan to find the end of
	// the range.

__15:
	if !(func() bool { src++; return libc.PreDecInt32(&numBytes, 1) != 0 }() &&
		!(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCharTypeTable)) + uintptr(128) + uintptr(uint8(*(*int8)(unsafe.Pointer(src)))))))&(mask|TYPE_SUBS) != 0)) {
		goto __16
	}
	// empty loop
	goto __15
__16:
	;
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = int32((int64(src) - int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)) / 1)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	goto __14
__13:
	if !(int32(*(*int8)(unsafe.Pointer(src))) == '$') {
		goto __17
	}

	if !(noSubstVars != 0) {
		goto __19
	}
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = 1
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	src++
	numBytes--
	goto __1
__19:
	;

	// This is a variable reference. Call Tcl_ParseVarName to do all
	// the dirty work of parsing the name.

	varToken = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens
	if !(XTcl_ParseVarName(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp, src, numBytes, parsePtr,
		1) != TCL_OK) {
		goto __20
	}
	return TCL_ERROR
__20:
	;
	src += uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(varToken)*24)).Fsize)
	numBytes = numBytes - (*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr+uintptr(varToken)*24)).Fsize
	goto __18
__17:
	if !(int32(*(*int8)(unsafe.Pointer(src))) == '[') {
		goto __21
	}

	if !(noSubstCmds != 0) {
		goto __23
	}
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = 1
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	src++
	numBytes--
	goto __1
__23:
	;

	// Command substitution. Call Tcl_ParseCommand recursively (and
	// repeatedly) to parse the nested command(s), then throw away the
	// parse information.

	src++
	numBytes--
	nestedPtr = XTclStackAlloc(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp, int32(unsafe.Sizeof(Tcl_Parse{})))
__24:
	if !(1 != 0) {
		goto __25
	}

	if !(XTcl_ParseCommand(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp, src, numBytes, 1,
		nestedPtr) != TCL_OK) {
		goto __26
	}
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).FerrorType
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fincomplete
	XTclStackFree(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp, nestedPtr)
	return TCL_ERROR
__26:
	;
	curEnd = src + uintptr(numBytes)
	src = (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).FcommandStart + uintptr((*Tcl_Parse)(unsafe.Pointer(nestedPtr)).FcommandSize)
	numBytes = int32((int64(curEnd) - int64(src)) / 1)
	XTcl_FreeParse(tls, nestedPtr)

	// Check for the closing ']' that ends the command
	// substitution. It must have been the last character of the
	// parsed command.

	if !((*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm < (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend &&
		int32(*(*int8)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm))) == ']' &&
		!((*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fincomplete != 0)) {
		goto __27
	}
	goto __25
__27:
	;
	if !(numBytes == 0) {
		goto __28
	}
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp != uintptr(0)) {
		goto __29
	}
	XTcl_SetObjResult(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp, XTcl_NewStringObj(tls,
		ts+19688, -1))
__29:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_MISSING_BRACKET
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = 1
	XTclStackFree(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp, nestedPtr)
	return TCL_ERROR
__28:
	;
	goto __24
__25:
	;
	XTclStackFree(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp, nestedPtr)
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_COMMAND
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = int32((int64(src) - int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)) / 1)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	goto __22
__21:
	if !(int32(*(*int8)(unsafe.Pointer(src))) == '\\') {
		goto __30
	}
	if !(noSubstBS != 0) {
		goto __32
	}
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = 1
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	src++
	numBytes--
	goto __1
__32:
	;

	// Backslash substitution.

	XTclParseBackslash(tls, src, numBytes, tokenPtr+16, uintptr(0))

	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize == 1) {
		goto __33
	}
	// Just a backslash, due to end of string.

	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	src++
	numBytes--
	goto __1
__33:
	;

	if !(int32(*(*int8)(unsafe.Pointer(src + 1))) == '\n') {
		goto __34
	}
	if !(numBytes == 2) {
		goto __35
	}
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = 1
__35:
	;

	// Note: backslash-newline is special in that it is treated
	// the same as a space character would be. This means that it
	// could terminate the token.

	if !(mask&TYPE_SPACE != 0) {
		goto __36
	}
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens == originalTokens) {
		goto __37
	}
	goto finishToken
__37:
	;
	goto __2
__36:
	;
__34:
	;

	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_BS
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	src += uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize)
	numBytes = numBytes - (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize
	goto __31
__30:
	if !(int32(*(*int8)(unsafe.Pointer(src))) == 0) {
		goto __38
	}
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = 1
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	src++
	numBytes--
	goto __39
__38:
	XTcl_Panic(tls, ts+54566, 0)
__39:
	;
__31:
	;
__22:
	;
__18:
	;
__14:
	;
	goto __1
__2:
	;
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens == originalTokens) {
		goto __40
	}
	// There was nothing in this range of text. Add an empty token for the
	// empty range, so that there is always at least one token added.

__41:
	_needed1 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + 1
	if !(_needed1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __44
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp+8, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__44:
	;
	if !(_needed1 > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __45
	}
	allocated1 = 2 * _needed1
	oldPtr1 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr1 == parsePtr+96) {
		goto __46
	}
	oldPtr1 = uintptr(0)
__46:
	;
	if !(allocated1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __47
	}
	allocated1 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__47:
	;
	newPtr1 = XTclpRealloc(tls, oldPtr1, uint32(uint64(allocated1)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr1 == uintptr(0)) {
		goto __48
	}
	allocated1 = int32(uint64(_needed1+1) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __49
	}
	allocated1 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__49:
	;
	newPtr1 = XTcl_Realloc(tls, oldPtr1, uint32(uint64(allocated1)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__48:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated1
	if !(oldPtr1 == uintptr(0)) {
		goto __50
	}
	libc.Xmemcpy(tls, newPtr1, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__50:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr1
__45:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = src
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0

finishToken:
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = 0
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
__40:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = src
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_FreeParse --
//
//	This function is invoked to free any dynamic storage that may have
//	been allocated by a previous call to Tcl_ParseCommand.
//
// Results:
//	None.
//
// Side effects:
//	If there is any dynamically allocated memory in *parsePtr, it is
//	freed.
//
//----------------------------------------------------------------------

func XTcl_FreeParse(tls *libc.TLS, parsePtr uintptr) { /* tclParse.c:1360:1: */
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr != parsePtr+96 {
		XTclpFree(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = parsePtr + 96 /* &.staticTokens */
	}
}

//----------------------------------------------------------------------
//
// Tcl_ParseVarName --
//
//	Given a string starting with a $ sign, parse off a variable name and
//	return information about the parse. No more than numBytes bytes will
//	be scanned.
//
// Results:
//	The return value is TCL_OK if the command was parsed successfully and
//	TCL_ERROR otherwise. If an error occurs and interp isn't NULL then an
//	error message is left in its result. On a successful return, tokenPtr
//	and numTokens fields of parsePtr are filled in with information about
//	the variable name that was parsed. The "size" field of the first new
//	token gives the total number of bytes in the variable name. Other
//	fields in parsePtr are undefined.
//
// Side effects:
//	If there is insufficient space in parsePtr to hold all the information
//	about the command, then additional space is malloc-ed. If the function
//	returns TCL_OK then the caller must eventually invoke Tcl_FreeParse to
//	release any additional space that was allocated.
//
//----------------------------------------------------------------------

func XTcl_ParseVarName(tls *libc.TLS, interp uintptr, start uintptr, numBytes int32, parsePtr uintptr, append int32) int32 { /* tclParse.c:1398:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var tokenPtr uintptr
	var src uintptr
	var varIndex int32
	var array uint32
	var allocated int32
	var oldPtr uintptr
	var newPtr uintptr
	var _needed int32

	if !(numBytes < 0 && start != 0) {
		goto __1
	}
	numBytes = int32(libc.Xstrlen(tls, start))
__1:
	;
	if !!(append != 0) {
		goto __2
	}
	XTclParseInit(tls, interp, start, numBytes, parsePtr)
__2:
	;
	if !(numBytes == 0 || start == uintptr(0)) {
		goto __3
	}
	return TCL_ERROR
__3:
	;

	// Generate one token for the variable, an additional token for the name,
	// plus any number of additional tokens for the index, if there is one.

	src = start
__4:
	_needed = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + 2
	if !(_needed > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __7
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__7:
	;
	if !(_needed > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __8
	}
	allocated = 2 * _needed
	oldPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr == parsePtr+96) {
		goto __9
	}
	oldPtr = uintptr(0)
__9:
	;
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __10
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__10:
	;
	newPtr = XTclpRealloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr == uintptr(0)) {
		goto __11
	}
	allocated = int32(uint64(_needed+2) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __12
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__12:
	;
	newPtr = XTcl_Realloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__11:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated
	if !(oldPtr == uintptr(0)) {
		goto __13
	}
	libc.Xmemcpy(tls, newPtr, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__13:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr
__8:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_VARIABLE
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = src
	varIndex = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	tokenPtr += 24
	src++
	numBytes--
	if !(numBytes == 0) {
		goto __14
	}
	goto justADollarSign
__14:
	;
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = src
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0

	// The name of the variable can have three forms:
	// 1. The $ sign is followed by an open curly brace. Then the variable
	//	  name is everything up to the next close curly brace, and the
	//	  variable is a scalar variable.
	// 2. The $ sign is not followed by an open curly brace. Then the variable
	//	  name is everything up to the next character that isn't a letter,
	//	  digit, or underscore. :: sequences are also considered part of the
	//	  variable name, in order to support namespaces. If the following
	//	  character is an open parenthesis, then the information between
	//	  parentheses is the array element name.
	// 3. The $ sign is followed by something that isn't a letter, digit, or
	//	  underscore: in this case, there is no variable name and the token is
	//	  just "$".

	if !(int32(*(*int8)(unsafe.Pointer(src))) == '{') {
		goto __15
	}
	src++
	numBytes--
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = src
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0

__17:
	if !(numBytes != 0 && int32(*(*int8)(unsafe.Pointer(src))) != '}') {
		goto __18
	}
	numBytes--
	src++
	goto __17
__18:
	;
	if !(numBytes == 0) {
		goto __19
	}
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp != uintptr(0)) {
		goto __20
	}
	XTcl_SetObjResult(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp, XTcl_NewStringObj(tls,
		ts+54608, -1))
__20:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_MISSING_VAR_BRACE
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart - uintptr(1)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = 1
	goto error
__19:
	;
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = int32((int64(src) - int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)) / 1)
	(*Tcl_Token)(unsafe.Pointer(tokenPtr + libc.UintptrFromInt32(-1)*24)).Fsize = int32((int64(src) - int64((*Tcl_Token)(unsafe.Pointer(tokenPtr+libc.UintptrFromInt32(-1)*24)).Fstart)) / 1)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	src++
	goto __16
__15:
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = src
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0

__21:
	if !(numBytes != 0) {
		goto __22
	}
	if !(XTclIsBareword(tls, int32(*(*int8)(unsafe.Pointer(src)))) != 0) {
		goto __23
	}
	src += uintptr(1)
	numBytes = numBytes - 1
	goto __21
__23:
	;
	if !(int32(*(*int8)(unsafe.Pointer(src))) == ':' && numBytes != 1 && int32(*(*int8)(unsafe.Pointer(src + 1))) == ':') {
		goto __24
	}
	src += uintptr(2)
	numBytes = numBytes - 2
__25:
	if !(numBytes != 0 && int32(*(*int8)(unsafe.Pointer(src))) == ':') {
		goto __26
	}
	src++
	numBytes--
	goto __25
__26:
	;
	goto __21
__24:
	;
	goto __22
	goto __21
__22:
	;

	// Support for empty array names here.

	array = uint32(libc.Bool32(numBytes != 0 && int32(*(*int8)(unsafe.Pointer(src))) == '('))
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = int32((int64(src) - int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)) / 1)
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize == 0 && !(array != 0)) {
		goto __27
	}
	goto justADollarSign
__27:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
	if !(array != 0) {
		goto __28
	}
	// This is a reference to an array element. Call ParseTokens
	// recursively to parse the element name, since it could contain
	// any number of substitutions.

	if !(TCL_OK != sParseTokens(tls, src+uintptr(1), numBytes-1, TYPE_CLOSE_PAREN,
		TCL_SUBST_ALL, parsePtr)) {
		goto __29
	}
	goto error
__29:
	;
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm == src+uintptr(numBytes) || int32(*(*int8)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm))) != ')') {
		goto __30
	}
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp != uintptr(0)) {
		goto __31
	}
	XTcl_SetObjResult(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp, XTcl_NewStringObj(tls,
		ts+54646, -1))
__31:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_MISSING_PAREN
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = src
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = 1
	goto error
__30:
	;
	src = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm + uintptr(1)
__28:
	;
__16:
	;
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(varIndex)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = int32((int64(src) - int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)) / 1)
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens - (varIndex + 1)
	return TCL_OK

	// The dollar sign isn't followed by a variable name. Replace the
	// TCL_TOKEN_VARIABLE token with a TCL_TOKEN_TEXT token for the dollar
	// sign.

justADollarSign:
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(varIndex)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = 1
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0
	return TCL_OK

error:
	XTcl_FreeParse(tls, parsePtr)
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_ParseVar --
//
//	Given a string starting with a $ sign, parse off a variable name and
//	return its value.
//
// Results:
//	The return value is the contents of the variable given by the leading
//	characters of string. If termPtr isn't NULL, *termPtr gets filled in
//	with the address of the character just after the last one in the
//	variable specifier. If the variable doesn't exist, then the return
//	value is NULL and an error message will be left in interp's result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ParseVar(tls *libc.TLS, interp uintptr, start uintptr, termPtr uintptr) uintptr { /* tclParse.c:1592:12: */
	var objPtr uintptr
	var code int32
	var parsePtr uintptr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(Tcl_Parse{})))

	if XTcl_ParseVarName(tls, interp, start, -1, parsePtr, 0) != TCL_OK {
		XTclStackFree(tls, interp, parsePtr)
		return uintptr(0)
	}

	if termPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(termPtr)) = start + uintptr((*Tcl_Token)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).Fsize)
	}
	if (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens == 1 {
		// There isn't a variable name after all: the $ is just a $.

		XTclStackFree(tls, interp, parsePtr)
		return ts + 54656 /* "$" */
	}

	code = XTclSubstTokens(tls, interp, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens,
		uintptr(0), 1, uintptr(0), uintptr(0))
	XTcl_FreeParse(tls, parsePtr)
	XTclStackFree(tls, interp, parsePtr)
	if code != TCL_OK {
		return uintptr(0)
	}
	objPtr = XTcl_GetObjResult(tls, interp)

	// At this point we should have an object containing the value of a
	// variable. Just return the string from that object.
	//
	// Since TclSubstTokens above returned TCL_OK, we know that objPtr
	// is shared.  It is in both the interp result and the value of the
	// variable.  Returning the string relies on that to be true.

	XTcl_ResetResult(tls, interp)
	return func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()
}

//----------------------------------------------------------------------
//
// Tcl_ParseBraces --
//
//	Given a string in braces such as a Tcl command argument or a string
//	value in a Tcl expression, this function parses the string and returns
//	information about the parse. No more than numBytes bytes will be
//	scanned.
//
// Results:
//	The return value is TCL_OK if the string was parsed successfully and
//	TCL_ERROR otherwise. If an error occurs and interp isn't NULL then an
//	error message is left in its result. On a successful return, tokenPtr
//	and numTokens fields of parsePtr are filled in with information about
//	the string that was parsed. Other fields in parsePtr are undefined.
//	termPtr is set to point to the character just after the last one in
//	the braced string.
//
// Side effects:
//	If there is insufficient space in parsePtr to hold all the information
//	about the command, then additional space is malloc-ed. If the function
//	returns TCL_OK then the caller must eventually invoke Tcl_FreeParse to
//	release any additional space that was allocated.
//
//----------------------------------------------------------------------

func XTcl_ParseBraces(tls *libc.TLS, interp uintptr, start uintptr, numBytes int32, parsePtr uintptr, append int32, termPtr uintptr) int32 { /* tclParse.c:1675:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var tokenPtr uintptr
	var src uintptr
	var startIndex int32
	var level int32
	// var length int32 at bp+16, 4

	var allocated int32
	var oldPtr uintptr
	var newPtr uintptr
	var _needed int32
	var allocated1 int32
	var oldPtr1 uintptr
	var newPtr1 uintptr
	var _needed1 int32
	var openBrace int32

	if !(numBytes < 0 && start != 0) {
		goto __1
	}
	numBytes = int32(libc.Xstrlen(tls, start))
__1:
	;
	if !!(append != 0) {
		goto __2
	}
	XTclParseInit(tls, interp, start, numBytes, parsePtr)
__2:
	;
	if !(numBytes == 0 || start == uintptr(0)) {
		goto __3
	}
	return TCL_ERROR
__3:
	;

	src = start
	startIndex = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens

__4:
	_needed = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + 1
	if !(_needed > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __7
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__7:
	;
	if !(_needed > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __8
	}
	allocated = 2 * _needed
	oldPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr == parsePtr+96) {
		goto __9
	}
	oldPtr = uintptr(0)
__9:
	;
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __10
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__10:
	;
	newPtr = XTclpRealloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr == uintptr(0)) {
		goto __11
	}
	allocated = int32(uint64(_needed+1) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __12
	}
	allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__12:
	;
	newPtr = XTcl_Realloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__11:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated
	if !(oldPtr == uintptr(0)) {
		goto __13
	}
	libc.Xmemcpy(tls, newPtr, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__13:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr
__8:
	;
	goto __5
__5:
	if 0 != 0 {
		goto __4
	}
	goto __6
__6:
	;
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(startIndex)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = src + uintptr(1)
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0
	level = 1
__14:
	if !(1 != 0) {
		goto __15
	}
__16:
	if !func() bool { src++; return libc.PreDecInt32(&numBytes, 1) != 0 }() {
		goto __17
	}
	if !(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCharTypeTable)) + uintptr(128) + uintptr(uint8(*(*int8)(unsafe.Pointer(src))))))) != TYPE_NORMAL) {
		goto __18
	}
	goto __17
__18:
	;
	goto __16
__17:
	;
	if !(numBytes == 0) {
		goto __19
	}
	goto missingBraceError
__19:
	;

	switch int32(*(*int8)(unsafe.Pointer(src))) {
	case '{':
		goto __21
	case '}':
		goto __22
	case '\\':
		goto __23
	}
	goto __20
__21:
	level++
	goto __20
__22:
	if !(libc.PreDecInt32(&level, 1) == 0) {
		goto __24
	}
	// Decide if we need to finish emitting a partially-finished
	// token. There are 3 cases:
	//     {abc \newline xyz} or {xyz}
	//		- finish emitting "xyz" token
	//     {abc \newline}
	//		- don't emit token after \newline
	//     {}	- finish emitting zero-sized token
	//
	// The last case ensures that there is a token (even if empty)
	// that describes the braced string.

	if !(src != (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart ||
		(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens == startIndex) {
		goto __25
	}
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = int32((int64(src) - int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)) / 1)
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
__25:
	;
	if !(termPtr != uintptr(0)) {
		goto __26
	}
	*(*uintptr)(unsafe.Pointer(termPtr)) = src + uintptr(1)
__26:
	;
	return TCL_OK
__24:
	;
	goto __20
__23:
	XTclParseBackslash(tls, src, numBytes, bp+16, uintptr(0))
	if !(*(*int32)(unsafe.Pointer(bp + 16)) > 1 && int32(*(*int8)(unsafe.Pointer(src + 1))) == '\n') {
		goto __27
	}
	// A backslash-newline sequence must be collapsed, even inside
	// braces, so we have to split the word into multiple tokens
	// so that the backslash-newline can be represented
	// explicitly.

	if !(numBytes == 2) {
		goto __29
	}
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = 1
__29:
	;
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = int32((int64(src) - int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)) / 1)
	if !((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize != 0) {
		goto __30
	}
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
__30:
	;
__31:
	_needed1 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + 2
	if !(_needed1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __34
	}
	XTcl_Panic(tls, ts+19620, libc.VaList(bp+8, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
__34:
	;
	if !(_needed1 > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable) {
		goto __35
	}
	allocated1 = 2 * _needed1
	oldPtr1 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
	if !(oldPtr1 == parsePtr+96) {
		goto __36
	}
	oldPtr1 = uintptr(0)
__36:
	;
	if !(allocated1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __37
	}
	allocated1 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__37:
	;
	newPtr1 = XTclpRealloc(tls, oldPtr1, uint32(uint64(allocated1)*uint64(unsafe.Sizeof(Tcl_Token{}))))
	if !(newPtr1 == uintptr(0)) {
		goto __38
	}
	allocated1 = int32(uint64(_needed1+2) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
	if !(allocated1 > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))) {
		goto __39
	}
	allocated1 = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
__39:
	;
	newPtr1 = XTcl_Realloc(tls, oldPtr1, uint32(uint64(allocated1)*uint64(unsafe.Sizeof(Tcl_Token{}))))
__38:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated1
	if !(oldPtr1 == uintptr(0)) {
		goto __40
	}
	libc.Xmemcpy(tls, newPtr1, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
__40:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr1
__35:
	;
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
	tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_BS
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = src
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = *(*int32)(unsafe.Pointer(bp + 16 /* length */))
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++

	src += uintptr(*(*int32)(unsafe.Pointer(bp + 16)) - 1)
	numBytes = numBytes - (*(*int32)(unsafe.Pointer(bp + 16)) - 1)
	tokenPtr += 24
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_TEXT
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = src + uintptr(1)
	(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0
	goto __28
__27:
	src += uintptr(*(*int32)(unsafe.Pointer(bp + 16)) - 1)
	numBytes = numBytes - (*(*int32)(unsafe.Pointer(bp + 16)) - 1)
__28:
	;
	goto __20
__20:
	;
	goto __14
__15:
	;

missingBraceError:
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_MISSING_BRACE
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = start
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = 1
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp == uintptr(0)) {
		goto __41
	}
	// Skip straight to the exit code since we have no interpreter to put
	// error message in.

	goto error
__41:
	;

	XTcl_SetObjResult(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp, XTcl_NewStringObj(tls,
		ts+54658, -1))

	/*
	 * Guess if the problem is due to comments by searching the source string
	 * for a possible open brace within the context of a comment. Since we
	 * aren't performing a full Tcl parse, just look for an open brace
	 * preceded by a '<whitespace>#' on the same line.
	 */

	openBrace = 0

__42:
	if !(libc.PreDecUintptr(&src, 1) > start) {
		goto __43
	}
	switch int32(*(*int8)(unsafe.Pointer(src))) {
	case '{':
		goto __45
	case '\n':
		goto __46
	case '#':
		goto __47
	}
	goto __44
__45:
	openBrace = 1
	goto __44
__46:
	openBrace = 0
	goto __44
__47:
	if !(openBrace != 0 && func() int32 {
		if int32(*(*int8)(unsafe.Pointer(src + libc.UintptrFromInt32(-1)))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(src + libc.UintptrFromInt32(-1)))))
	}() != 0) {
		goto __48
	}
	XTcl_AppendToObj(tls, XTcl_GetObjResult(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp),
		ts+54678, -1)
	goto error
__48:
	;
	goto __44
__44:
	;
	goto __42
__43:
	;

error:
	XTcl_FreeParse(tls, parsePtr)
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_ParseQuotedString --
//
//	Given a double-quoted string such as a quoted Tcl command argument or
//	a quoted value in a Tcl expression, this function parses the string
//	and returns information about the parse. No more than numBytes bytes
//	will be scanned.
//
// Results:
//	The return value is TCL_OK if the string was parsed successfully and
//	TCL_ERROR otherwise. If an error occurs and interp isn't NULL then an
//	error message is left in its result. On a successful return, tokenPtr
//	and numTokens fields of parsePtr are filled in with information about
//	the string that was parsed. Other fields in parsePtr are undefined.
//	termPtr is set to point to the character just after the quoted
//	string's terminating close-quote.
//
// Side effects:
//	If there is insufficient space in parsePtr to hold all the information
//	about the command, then additional space is malloc-ed. If the function
//	returns TCL_OK then the caller must eventually invoke Tcl_FreeParse to
//	release any additional space that was allocated.
//
//----------------------------------------------------------------------

func XTcl_ParseQuotedString(tls *libc.TLS, interp uintptr, start uintptr, numBytes int32, parsePtr uintptr, append int32, termPtr uintptr) int32 { /* tclParse.c:1876:1: */
	if !(numBytes < 0 && start != 0) {
		goto __1
	}
	numBytes = int32(libc.Xstrlen(tls, start))
__1:
	;
	if !!(append != 0) {
		goto __2
	}
	XTclParseInit(tls, interp, start, numBytes, parsePtr)
__2:
	;
	if !(numBytes == 0 || start == uintptr(0)) {
		goto __3
	}
	return TCL_ERROR
__3:
	;

	if !(TCL_OK != sParseTokens(tls, start+uintptr(1), numBytes-1, TYPE_QUOTE, TCL_SUBST_ALL,
		parsePtr)) {
		goto __4
	}
	goto error
__4:
	;
	if !(int32(*(*int8)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm))) != '"') {
		goto __5
	}
	if !((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp != uintptr(0)) {
		goto __6
	}
	XTcl_SetObjResult(tls, (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Finterp, XTcl_NewStringObj(tls,
		ts+54717, -1))
__6:
	;
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_MISSING_QUOTE
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = start
	(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = 1
	goto error
__5:
	;
	if !(termPtr != uintptr(0)) {
		goto __7
	}
	*(*uintptr)(unsafe.Pointer(termPtr)) = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm + uintptr(1)
__7:
	;
	return TCL_OK

error:
	XTcl_FreeParse(tls, parsePtr)
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclSubstParse --
//
//	Token parser used by the [subst] command. Parses the string made up of
//	'numBytes' bytes starting at 'bytes'. Parsing is controlled by the
//	flags argument to provide support for the -nobackslashes, -nocommands,
//	and -novariables options, as represented by the flag values
//	TCL_SUBST_BACKSLASHES, TCL_SUBST_COMMANDS, TCL_SUBST_VARIABLES.
//
// Results:
//	None.
//
// Side effects:
//	The Tcl_Parse struct '*parsePtr' is filled with parse results.
//	The caller is expected to eventually call Tcl_FreeParse() to properly
//	cleanup the value written there.
//
//	If a parse error occurs, the Tcl_InterpState value '*statePtr' is
//	filled with the state created by that error. When *statePtr is written
//	to, the caller is expected to make the required calls to either
//	Tcl_RestoreInterpState() or Tcl_DiscardInterpState() to dispose of the
//	value written there.
//
//----------------------------------------------------------------------

func XTclSubstParse(tls *libc.TLS, interp uintptr, bytes uintptr, numBytes int32, flags int32, parsePtr uintptr, statePtr uintptr) { /* tclParse.c:1959:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var length int32 = numBytes
	var p uintptr = bytes

	XTclParseInit(tls, interp, p, length, parsePtr)

	// First parse the string rep of objPtr, as if it were enclosed as a
	// "-quoted word in a normal Tcl command. Honor flags that selectively
	// inhibit types of substitution.

	if TCL_OK != sParseTokens(tls, p, length, 0, flags, parsePtr) {
		// There was a parse error. Save the interpreter state for possible
		// error reporting later.

		*(*Tcl_InterpState)(unsafe.Pointer(statePtr)) = XTcl_SaveInterpState(tls, interp, TCL_ERROR)

		// We need to re-parse to get the portion of the string we can [subst]
		// before the parse error. Sadly, all the Tcl_Token's created by the
		// first parse attempt are gone, freed according to the public spec
		// for the Tcl_Parse* routines. The only clue we have is parse.term,
		// which points to either the unmatched opener, or to characters that
		// follow a close brace or close quote.
		//
		// Call ParseTokens again, working on the string up to parse.term.
		// Keep repeating until we get a good parse on a prefix.

		for ok := true; ok; ok = TCL_OK != sParseTokens(tls, p, int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend)-int64(p))/1), 0, flags, parsePtr) {
			(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens = 0
			(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = NUM_STATIC_TOKENS
			(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm
			(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = 0
			(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = TCL_PARSE_SUCCESS
		}

		// The good parse will have to be followed by {, (, or [.

		switch int32(*(*int8)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm))) {
		case '{':
			// Parse error was a missing } in a ${varname} variable
			// substitution at the toplevel. We will subst everything up to
			// that broken variable substitution before reporting the parse
			// error. Substituting the leftover '$' will have no side-effects,
			// so the current token stream is fine.
			break
			fallthrough

		case '(':
			// Parse error was during the parsing of the index part of an
			// array variable substitution at the toplevel.

			if int32(*(*int8)(unsafe.Pointer((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm - uintptr(1)))) == '$' {
				// Special case where removing the array index left us with
				// just a dollar sign (array variable with name the empty
				// string as its name), instead of with a scalar variable
				// reference.
				//
				// As in the previous case, existing token stream is OK.
			} else {
				// The current parse includes a successful parse of a scalar
				// variable substitution where there should have been an array
				// variable substitution. We remove that mistaken part of the
				// parse before moving on. A scalar variable substitution is
				// two tokens.

				var varTokenPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*24 - uintptr(2)*24

				if (*Tcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype != TCL_TOKEN_VARIABLE {
					XTcl_Panic(tls, ts+54727, 0)
				}
				if (*Tcl_Token)(unsafe.Pointer(varTokenPtr+1*24)).Ftype != TCL_TOKEN_TEXT {
					XTcl_Panic(tls, ts+54727, 0)
				}
				*(*int32)(unsafe.Pointer(parsePtr + 40)) -= 2
			}
			break
			fallthrough
		case '[':
			// Parse error occurred during parsing of a toplevel command
			// substitution.

			(*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend = p + uintptr(length)
			p = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm + uintptr(1)
			length = int32((int64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fend) - int64(p)) / 1)
			if length == 0 {
				// No commands, just an unmatched [. As in previous cases,
				// existing token stream is OK.
			} else {
				// We want to add the parsing of as many commands as we can
				// within that substitution until we reach the actual parse
				// error. We'll do additional parsing to determine what length
				// to claim for the final TCL_TOKEN_COMMAND token.

				var tokenPtr uintptr
				var lastTerm uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm
				var nestedPtr uintptr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(Tcl_Parse{})))

				for TCL_OK == XTcl_ParseCommand(tls, uintptr(0), p, length, 0, nestedPtr) {
					XTcl_FreeParse(tls, nestedPtr)
					p = (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm + uintptr(libc.Bool32((*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm < (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fend))
					length = int32((int64((*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fend) - int64(p)) / 1)
					if length == 0 && (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm == (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fend {
						// If we run out of string, blame the missing close
						// bracket on the last command, and do not evaluate it
						// during substitution.

						break
					}
					lastTerm = (*Tcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm
				}
				XTclStackFree(tls, interp, nestedPtr)

				if lastTerm == (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm {
					// Parse error in first command. No commands to subst, add
					// no more tokens.
					break
				}

				// Create a command substitution token for whatever commands
				// got parsed.

				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _needed int32 = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + 1
					if _needed > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{}))) {
						XTcl_Panic(tls, ts+19620, libc.VaList(bp, int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{})))))
					}
					if _needed > (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable {
						var allocated int32 = 2 * _needed
						var oldPtr uintptr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr
						var newPtr uintptr
						if oldPtr == parsePtr+96 {
							oldPtr = uintptr(0)
						}
						if allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{}))) {
							allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
						}
						newPtr = XTclpRealloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
						if newPtr == uintptr(0) {
							allocated = int32(uint64(_needed+1) + uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_Token{})))
							if allocated > int32(uint64(uint32(0x7fffffff)*2+1)/uint64(unsafe.Sizeof(Tcl_Token{}))) {
								allocated = int32(uint64(uint32(0x7fffffff)*2+1) / uint64(unsafe.Sizeof(Tcl_Token{})))
							}
							newPtr = XTcl_Realloc(tls, oldPtr, uint32(uint64(allocated)*uint64(unsafe.Sizeof(Tcl_Token{}))))
						}
						(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated
						if oldPtr == uintptr(0) {
							libc.Xmemcpy(tls, newPtr, parsePtr+96, uint64((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(unsafe.Sizeof(Tcl_Token{})))
						}
						(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr
					}
				}
				tokenPtr = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*24
				(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = (*Tcl_Parse)(unsafe.Pointer(parsePtr)).Fterm
				(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0
				(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype = TCL_TOKEN_COMMAND
				(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = int32((int64(lastTerm)-int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart))/1 + int64(1))
				(*Tcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++
			}
			break
			fallthrough

		default:
			XTcl_Panic(tls, ts+54760, libc.VaList(bp+8, int32(*(*int8)(unsafe.Pointer(p + uintptr(length))))))
		}
	}
}

//----------------------------------------------------------------------
//
// TclSubstTokens --
//
//	Accepts an array of count Tcl_Token's, and creates a result value in
//	the interp from concatenating the results of performing Tcl
//	substitution on each Tcl_Token. Substitution is interrupted if any
//	non-TCL_OK completion code arises.
//
// Results:
//	The return value is a standard Tcl completion code. The result in
//	interp is the substituted value, or an error message if TCL_ERROR is
//	returned. If tokensLeftPtr is not NULL, then it points to an int where
//	the number of tokens remaining to be processed is written.
//
// Side effects:
//	Can be anything, depending on the types of substitution done.
//
//----------------------------------------------------------------------

func XTclSubstTokens(tls *libc.TLS, interp uintptr, tokenPtr uintptr, count int32, tokensLeftPtr uintptr, line int32, clNextOuter uintptr, outerScript uintptr) int32 { /* tclParse.c:2155:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)
	*(*int32)(unsafe.Pointer(bp + 16)) = line
	*(*uintptr)(unsafe.Pointer(bp + 24)) = clNextOuter

	var result uintptr
	var code int32 = TCL_OK
	var isLiteral int32
	var maxNumCL int32
	var numCL int32
	var i int32
	var adjust int32
	var clPosition uintptr = uintptr(0)
	var iPtr uintptr = interp
	var inFile int32 = (*Interp)(unsafe.Pointer(iPtr)).FevalFlags & TCL_EVAL_FILE

	// Each pass through this loop will substitute one token, and its
	// components, if any. The only thing tricky here is that we go to some
	// effort to pass Tcl_Obj's through untouched, to avoid string copying and
	// Tcl_Obj creation if possible, to aid performance and limit shimmering.
	//
	// Further optimization opportunities might be to check for the equivalent
	// of Tcl_SetObjResult(interp, Tcl_GetObjResult(interp)) and omit them.

	// For the handling of continuation lines in literals we first check if
	// this is actually a literal. For if not we can forego the additional
	// processing. Otherwise we pre-allocate a small table to store the
	// locations of all continuation lines we find in this literal, if any.
	// The table is extended if needed.

	numCL = 0
	maxNumCL = 0
	isLiteral = 1
	for i = 0; i < count; i++ {
		if (*Tcl_Token)(unsafe.Pointer(tokenPtr+uintptr(i)*24)).Ftype != TCL_TOKEN_TEXT &&
			(*Tcl_Token)(unsafe.Pointer(tokenPtr+uintptr(i)*24)).Ftype != TCL_TOKEN_BS {
			isLiteral = 0
			break
		}
	}

	if isLiteral != 0 {
		maxNumCL = NUM_STATIC_POS
		clPosition = XTcl_Alloc(tls, uint32(uint64(maxNumCL)*uint64(unsafe.Sizeof(int32(0)))))
	}

	adjust = 0
	result = uintptr(0)
__1:
	if !(count > 0 && code == TCL_OK) {
		goto __3
	}
	{
		var appendObj uintptr = uintptr(0)
		var append uintptr = uintptr(0)
		var appendByteLength int32 = 0
		*(*[3]int8)(unsafe.Pointer(bp + 8 /* utfCharBytes */)) = *(*[3]int8)(unsafe.Pointer(ts + 18812))

		switch (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype {
		case TCL_TOKEN_TEXT:
			append = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart
			appendByteLength = (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize
			break

		case TCL_TOKEN_BS:
			appendByteLength = XTclParseBackslash(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart,
				(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, uintptr(0), bp+8)
			append = bp + 8 /* &utfCharBytes[0] */

			// If the backslash sequence we found is in a literal, and
			// represented a continuation line, we compute and store its
			// location (as char offset to the beginning of the _result_
			// script). We may have to extend the table of locations.
			//
			// Note that the continuation line information is relevant even if
			// the word we are processing is not a literal, as it can affect
			// nested commands. See the branch for TCL_TOKEN_COMMAND below,
			// where the adjustment we are tracking here is taken into
			// account. The good thing is that we do not need a table of
			// everything, just the number of lines we have to add as
			// correction.

			if appendByteLength == 1 && int32(*(*int8)(unsafe.Pointer(bp + 8))) == ' ' &&
				int32(*(*int8)(unsafe.Pointer((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart + 1))) == '\n' {
				if isLiteral != 0 {
					// var clPos int32 at bp+12, 4

					if result == uintptr(0) {
						*(*int32)(unsafe.Pointer(bp + 12 /* clPos */)) = 0
					} else {
						XTcl_GetStringFromObj(tls, result, bp+12)
					}

					if numCL >= maxNumCL {
						maxNumCL = maxNumCL * 2
						clPosition = XTcl_Realloc(tls, clPosition, uint32(uint64(maxNumCL)*uint64(unsafe.Sizeof(int32(0)))))
					}
					*(*int32)(unsafe.Pointer(clPosition + uintptr(numCL)*4)) = *(*int32)(unsafe.Pointer(bp + 12 /* clPos */))
					numCL++
				}
				adjust++
			}
			break

		case TCL_TOKEN_COMMAND:
			{
				// TIP #280: Transfer line information to nested command
				(*Interp)(unsafe.Pointer(iPtr)).FnumLevels++
				code = XTclInterpReady(tls, interp)
				if code == TCL_OK {
					// Test cases: info-30.{6,8,9}

					var theline int32

					XTclAdvanceContinuations(tls, bp+16, bp+24,
						int32((int64((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)-int64(outerScript))/1))
					theline = *(*int32)(unsafe.Pointer(bp + 16)) + adjust
					code = XTclEvalEx(tls, interp, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr(1), (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize-2,
						0, theline, *(*uintptr)(unsafe.Pointer(bp + 24 /* clNextOuter */)), outerScript)

					XTclAdvanceLines(tls, bp+16, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr(1),
						(*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).Fsize)-uintptr(1))

					// Restore flag reset by nested eval for future bracketed
					// commands and their cmdframe setup

					if inFile != 0 {
						*(*int32)(unsafe.Pointer(iPtr + 324)) |= TCL_EVAL_FILE
					}
				}
				(*Interp)(unsafe.Pointer(iPtr)).FnumLevels--
				XTclResetCancellation(tls, interp, 0)
				appendObj = XTcl_GetObjResult(tls, interp)
				break

			}

		case TCL_TOKEN_VARIABLE:
			{
				var arrayIndex uintptr = uintptr(0)
				var varName uintptr = uintptr(0)

				if (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents > 1 {
					// Subst the index part of an array variable reference.

					code = XTclSubstTokens(tls, interp, tokenPtr+uintptr(2)*24,
						(*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents-1, uintptr(0), *(*int32)(unsafe.Pointer(bp + 16 /* line */)), uintptr(0), uintptr(0))
					arrayIndex = XTcl_GetObjResult(tls, interp)
					(*Tcl_Obj)(unsafe.Pointer(arrayIndex)).FrefCount++
				}

				if code == TCL_OK {
					varName = XTcl_NewStringObj(tls, (*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fstart,
						(*Tcl_Token)(unsafe.Pointer(tokenPtr+1*24)).Fsize)
					appendObj = XTcl_ObjGetVar2(tls, interp, varName, arrayIndex,
						TCL_LEAVE_ERR_MSG)
					for ok := true; ok; ok = 0 != 0 {
						var _objPtr uintptr = varName
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
					if appendObj == uintptr(0) {
						code = TCL_ERROR
					}
				}

				switch code {
				case TCL_OK:
					fallthrough // Got value
				case TCL_ERROR:
					fallthrough // Already have error message
				case TCL_BREAK:
					fallthrough // Will not substitute anyway
				case TCL_CONTINUE: // Will not substitute anyway
					break
				default:
					// All other return codes, we will subst the result from the
					// code-throwing evaluation.

					appendObj = XTcl_GetObjResult(tls, interp)
				}

				if arrayIndex != uintptr(0) {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var _objPtr uintptr = arrayIndex
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
				}
				count = count - (*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents
				tokenPtr += 24 * uintptr((*Tcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents)
				break

			}

		default:
			XTcl_Panic(tls, ts+54791,
				libc.VaList(bp, (*Tcl_Token)(unsafe.Pointer(tokenPtr)).Ftype))
		}

		if code == TCL_BREAK || code == TCL_CONTINUE {
			// Inhibit substitution.
			goto __2
		}

		if result == uintptr(0) {
			// First pass through. If we have a Tcl_Obj, just use it. If not,
			// create one from our string.

			if appendObj != uintptr(0) {
				result = appendObj
			} else {
				result = XTcl_NewStringObj(tls, append, appendByteLength)
			}
			(*Tcl_Obj)(unsafe.Pointer(result)).FrefCount++
		} else {
			// Subsequent passes. Append to result.

			if (*Tcl_Obj)(unsafe.Pointer(result)).FrefCount > 1 {
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var _objPtr uintptr = result
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				result = XTcl_DuplicateObj(tls, result)
				(*Tcl_Obj)(unsafe.Pointer(result)).FrefCount++
			}
			if appendObj != uintptr(0) {
				XTcl_AppendObjToObj(tls, result, appendObj)
			} else {
				XTcl_AppendToObj(tls, result, append, appendByteLength)
			}
		}

	}
	goto __2
__2:
	count--
	tokenPtr += 24
	goto __1
	goto __3
__3:
	;

	if code != TCL_ERROR { // Keep error message in result!
		if result != uintptr(0) {
			XTcl_SetObjResult(tls, interp, result)

			// If the code found continuation lines (which implies that this
			// word is a literal), then we store the accumulated table of
			// locations in the thread-global data structure for the bytecode
			// compiler to find later, assuming that the literal is a script
			// which will be compiled.

			if numCL != 0 {
				XTclContinuationsEnter(tls, result, numCL, clPosition)
			}

			// Release the temp table we used to collect the locations of
			// continuation lines, if any.

			if maxNumCL != 0 {
				XTclpFree(tls, clPosition)
			}
		} else {
			XTcl_ResetResult(tls, interp)
		}
	}
	if tokensLeftPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(tokensLeftPtr)) = count
	}
	if result != uintptr(0) {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = result
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return code
}

//----------------------------------------------------------------------
//
// CommandComplete --
//
//	This function is shared by TclCommandComplete and
//	Tcl_ObjCommandComplete; it does all the real work of seeing whether a
//	script is complete
//
// Results:
//	1 is returned if the script is complete, 0 if there are open
//	delimiters such as " or (. 1 is also returned if there is a parse
//	error in the script other than unmatched delimiters.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sCommandComplete(tls *libc.TLS, script uintptr, numBytes int32) int32 { /* tclParse.c:2468:1: */
	bp := tls.Alloc(576)
	defer tls.Free(576)

	// var parse Tcl_Parse at bp, 576

	var p uintptr
	var end uintptr
	var result int32

	p = script
	end = p + uintptr(numBytes)
	for XTcl_ParseCommand(tls, uintptr(0), p, int32((int64(end)-int64(p))/1), 0, bp) == TCL_OK {
		p = (*Tcl_Parse)(unsafe.Pointer(bp)).FcommandStart + uintptr((*Tcl_Parse)(unsafe.Pointer(bp)).FcommandSize)
		if p >= end {
			break
		}
		XTcl_FreeParse(tls, bp)
	}
	if (*Tcl_Parse)(unsafe.Pointer(bp)).Fincomplete != 0 {
		result = 0
	} else {
		result = 1
	}
	XTcl_FreeParse(tls, bp)
	return result
}

//----------------------------------------------------------------------
//
// Tcl_CommandComplete --
//
//	Given a partial or complete Tcl script, this function determines
//	whether the script is complete in the sense of having matched braces
//	and quotes and brackets.
//
// Results:
//	1 is returned if the script is complete, 0 otherwise. 1 is also
//	returned if there is a parse error in the script other than unmatched
//	delimiters.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_CommandComplete(tls *libc.TLS, script uintptr) int32 { /* tclParse.c:2515:1: */
	return sCommandComplete(tls, script, int32(libc.Xstrlen(tls, script)))
}

//----------------------------------------------------------------------
//
// TclObjCommandComplete --
//
//	Given a partial or complete Tcl command in a Tcl object, this function
//	determines whether the command is complete in the sense of having
//	matched braces and quotes and brackets.
//
// Results:
//	1 is returned if the command is complete, 0 otherwise.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclObjCommandComplete(tls *libc.TLS, objPtr uintptr) int32 { /* tclParse.c:2540:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var length int32 at bp, 4

	var script uintptr = XTcl_GetStringFromObj(tls, objPtr, bp)

	return sCommandComplete(tls, script, *(*int32)(unsafe.Pointer(bp /* length */)))
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Define the 'path' object type, which Tcl uses to represent file paths
// internally.

var tclFsPathType = Tcl_ObjType{
	Fname:             ts + 41763,
	FfreeIntRepProc:   0, // freeIntRepProc
	FdupIntRepProc:    0, // dupIntRepProc
	FupdateStringProc: 0, // updateStringProc
	FsetFromAnyProc:   0, // setFromAnyProc
} /* tclPathObj.c:39:26 */

// struct FsPath --
//
// Internal representation of a Tcl_Obj of "path" type. This can be used to
// represent relative or absolute paths, and has certain optimisations when
// used to represent paths which are already normalized and absolute.
//
// Note that both 'translatedPathPtr' and 'normPathPtr' can be a circular
// reference to the container Tcl_Obj of this FsPath.
//
// There are two cases, with the first being the most common:
//
// (i) flags == 0, => Ordinary path.
//
// translatedPathPtr contains the translated path (which may be a circular
// reference to the object itself). If it is NULL then the path is pure
// normalized (and the normPathPtr will be a circular reference). cwdPtr is
// null for an absolute path, and non-null for a relative path (unless the cwd
// has never been set, in which case the cwdPtr may also be null for a
// relative path).
//
// (ii) flags != 0, => Special path, see TclNewFSPathObj
//
// Now, this is a path like 'file join $dir $tail' where, cwdPtr is the $dir
// and normPathPtr is the $tail.
//

type FsPath1 = struct {
	FtranslatedPathPtr uintptr
	FnormPathPtr       uintptr
	FcwdPtr            uintptr
	Fflags             int32
	F__ccgo_pad1       [4]byte
	FnativePathPtr     ClientData
	FfilesystemEpoch   int32
	F__ccgo_pad2       [4]byte
	FfsPtr             uintptr
} /* tclPathObj.c:75:9 */

// struct FsPath --
//
// Internal representation of a Tcl_Obj of "path" type. This can be used to
// represent relative or absolute paths, and has certain optimisations when
// used to represent paths which are already normalized and absolute.
//
// Note that both 'translatedPathPtr' and 'normPathPtr' can be a circular
// reference to the container Tcl_Obj of this FsPath.
//
// There are two cases, with the first being the most common:
//
// (i) flags == 0, => Ordinary path.
//
// translatedPathPtr contains the translated path (which may be a circular
// reference to the object itself). If it is NULL then the path is pure
// normalized (and the normPathPtr will be a circular reference). cwdPtr is
// null for an absolute path, and non-null for a relative path (unless the cwd
// has never been set, in which case the cwdPtr may also be null for a
// relative path).
//
// (ii) flags != 0, => Special path, see TclNewFSPathObj
//
// Now, this is a path like 'file join $dir $tail' where, cwdPtr is the $dir
// and normPathPtr is the $tail.
//

type FsPath = FsPath1 /* tclPathObj.c:99:3 */

// Flag values for FsPath->flags.

// Define some macros to give us convenient access to path-object specific
// fields.

//---------------------------------------------------------------------------
//
// TclFSNormalizeAbsolutePath --
//
//	Takes an absolute path specification and computes a 'normalized' path
//	from it.
//
//	A normalized path is one which has all '../', './' removed. Also it is
//	one which is in the 'standard' format for the native platform. On
//	Unix, this means the path must be free of symbolic links/aliases, and
//	on Windows it means we want the long form, with that long form's
//	case-dependence (which gives us a unique, case-dependent path).
//
//	The behaviour of this function if passed a non-absolute path is NOT
//	defined.
//
//	pathPtr may have a refCount of zero, or may be a shared object.
//
// Results:
//	The result is returned in a Tcl_Obj with a refCount of 1, which is
//	therefore owned by the caller. It must be freed (with
//	Tcl_DecrRefCount) by the caller when no longer needed.
//
// Side effects:
//	None (beyond the memory allocation for the result).
//
// Special note:
//	This code was originally based on code from Matt Newman and
//	Jean-Claude Wippler, but has since been totally rewritten by Vince
//	Darley to deal with symbolic links.
//
//---------------------------------------------------------------------------

func XTclFSNormalizeAbsolutePath(tls *libc.TLS, interp uintptr, pathPtr uintptr) uintptr { /* tclPathObj.c:153:9: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var dirSep uintptr
	var oldDirSep uintptr
	var first int32 // Set to zero once we've passed the first
	// directory separator - we can't use '..' to
	// remove the volume in a path.
	var retVal uintptr
	var path uintptr
	// Need to skip '.' in the path.
	// var curLen int32 at bp, 4

	var path1 uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr
	// We need to follow this link which is relative
	// to retVal's directory. This means concatenating
	// the link onto the directory of the path so far.

	var path2 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var i int32
	var linkObj uintptr
	// var curLen1 int32 at bp+4, 4

	var linkStr uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	// var len int32 at bp+8, 4

	var path3 uintptr
	first = 1
	retVal = uintptr(0)
	dirSep = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
		}
		return XTcl_GetString(tls, pathPtr)
	}()

	if !(XtclPlatform == TCL_PLATFORM_WINDOWS) {
		goto __1
	}
	if !((int32(*(*int8)(unsafe.Pointer(dirSep))) == '/' || int32(*(*int8)(unsafe.Pointer(dirSep))) == '\\') &&
		(int32(*(*int8)(unsafe.Pointer(dirSep + 1))) == '/' || int32(*(*int8)(unsafe.Pointer(dirSep + 1))) == '\\') &&
		int32(*(*int8)(unsafe.Pointer(dirSep + 2))) == '?' &&
		(int32(*(*int8)(unsafe.Pointer(dirSep + 3))) == '/' || int32(*(*int8)(unsafe.Pointer(dirSep + 3))) == '\\')) {
		goto __2
	}
	// NT extended path
	dirSep += uintptr(4)

	if !((int32(*(*int8)(unsafe.Pointer(dirSep))) == 'U' || int32(*(*int8)(unsafe.Pointer(dirSep))) == 'u') &&
		(int32(*(*int8)(unsafe.Pointer(dirSep + 1))) == 'N' || int32(*(*int8)(unsafe.Pointer(dirSep + 1))) == 'n') &&
		(int32(*(*int8)(unsafe.Pointer(dirSep + 2))) == 'C' || int32(*(*int8)(unsafe.Pointer(dirSep + 2))) == 'c') &&
		(int32(*(*int8)(unsafe.Pointer(dirSep + 3))) == '/' || int32(*(*int8)(unsafe.Pointer(dirSep + 3))) == '\\')) {
		goto __3
	}
	// NT extended UNC path
	dirSep += uintptr(4)
__3:
	;
__2:
	;
	if !(int32(*(*int8)(unsafe.Pointer(dirSep))) != 0 && int32(*(*int8)(unsafe.Pointer(dirSep + 1))) == ':' && (int32(*(*int8)(unsafe.Pointer(dirSep + 2))) == '/' || int32(*(*int8)(unsafe.Pointer(dirSep + 2))) == '\\')) {
		goto __4
	}
	// Do nothing
	goto __5
__4:
	if !((int32(*(*int8)(unsafe.Pointer(dirSep))) == '/' || int32(*(*int8)(unsafe.Pointer(dirSep))) == '\\') &&
		(int32(*(*int8)(unsafe.Pointer(dirSep + 1))) == '/' || int32(*(*int8)(unsafe.Pointer(dirSep + 1))) == '\\')) {
		goto __6
	}
	// UNC style path, where we must skip over the first separator,
	// since the first two segments are actually inseparable.

	dirSep += uintptr(2)
	dirSep += uintptr(sFindSplitPos(tls, dirSep, '/'))
	if !(int32(*(*int8)(unsafe.Pointer(dirSep))) != 0) {
		goto __7
	}
	dirSep++
__7:
	;
__6:
	;
__5:
	;
__1:
	;

	// Scan forward from one directory separator to the next, checking for
	// '..' and '.' sequences which must be handled specially. In particular
	// handling of '..' can be complicated if the directory before is a link,
	// since we will have to expand the link to be able to back up one level.

__8:
	if !(int32(*(*int8)(unsafe.Pointer(dirSep))) != 0) {
		goto __9
	}
	oldDirSep = dirSep
	if !!(first != 0) {
		goto __10
	}
	dirSep++
__10:
	;
	dirSep += uintptr(sFindSplitPos(tls, dirSep, '/'))
	if !(int32(*(*int8)(unsafe.Pointer(dirSep))) == 0 || int32(*(*int8)(unsafe.Pointer(dirSep + 1))) == 0) {
		goto __11
	}
	if !(retVal != uintptr(0)) {
		goto __12
	}
	XTcl_AppendToObj(tls, retVal, oldDirSep, int32((int64(dirSep)-int64(oldDirSep))/1))
__12:
	;
	goto __9
__11:
	;
	if !(int32(*(*int8)(unsafe.Pointer(dirSep + 1))) == '.') {
		goto __13
	}
	if !(retVal != uintptr(0)) {
		goto __14
	}
	XTcl_AppendToObj(tls, retVal, oldDirSep, int32((int64(dirSep)-int64(oldDirSep))/1))
	oldDirSep = dirSep
__14:
	;
again:
	if !(sIsSeparatorOrNull(tls, int32(*(*int8)(unsafe.Pointer(dirSep + 2)))) != 0) {
		goto __15
	}

	if !(retVal == uintptr(0)) {
		goto __16
	}
	path = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
		}
		return XTcl_GetString(tls, pathPtr)
	}()
	retVal = XTcl_NewStringObj(tls, path, int32((int64(dirSep)-int64(path))/1))
	(*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount++
__16:
	;
	XTcl_GetStringFromObj(tls, retVal, bp)
	if !(*(*int32)(unsafe.Pointer(bp)) == 0) {
		goto __17
	}
	XTcl_AppendToObj(tls, retVal, dirSep, 1)
__17:
	;
	dirSep += uintptr(2)
	oldDirSep = dirSep
	if !(int32(*(*int8)(unsafe.Pointer(dirSep))) != 0 && int32(*(*int8)(unsafe.Pointer(dirSep + 1))) == '.') {
		goto __18
	}
	goto again
__18:
	;
	goto __8
__15:
	;
	if !(int32(*(*int8)(unsafe.Pointer(dirSep + 2))) == '.' && sIsSeparatorOrNull(tls, int32(*(*int8)(unsafe.Pointer(dirSep + 3)))) != 0) {
		goto __19
	}

	// Have '..' so need to skip previous directory.

	if !(retVal == uintptr(0)) {
		goto __20
	}
	path1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
		}
		return XTcl_GetString(tls, pathPtr)
	}()

	retVal = XTcl_NewStringObj(tls, path1, int32((int64(dirSep)-int64(path1))/1))
	(*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount++
__20:
	;
	XTcl_GetStringFromObj(tls, retVal, bp+4)
	if !(*(*int32)(unsafe.Pointer(bp + 4)) == 0) {
		goto __21
	}
	XTcl_AppendToObj(tls, retVal, dirSep, 1)
__21:
	;
	if !(!(first != 0) || XtclPlatform == TCL_PLATFORM_UNIX) {
		goto __22
	}
	linkObj = XTcl_FSLink(tls, retVal, uintptr(0), 0)

	// Safety check in case driver caused sharing
	if !((*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount > 1) {
		goto __23
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount, 1) > 1) {
		goto __24
	}
	goto __25
__24:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(retVal)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(retVal)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __26
	}

	if !((*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes != XtclEmptyStringRep) {
		goto __28
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes)
__28:
	;
	(*Tcl_Obj)(unsafe.Pointer(retVal)).Flength = -1
__29:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __32
	}
	XTclThreadFreeObj(tls, retVal)
	goto __33
__32:
	*(*uintptr)(unsafe.Pointer(retVal + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = retVal
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__33:
	;
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
	goto __27
__26:
	XTclFreeObj(tls, retVal)
__27:
	;
__25:
	;

	retVal = XTcl_DuplicateObj(tls, retVal)
	(*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount++
__23:
	;

	if !(linkObj != uintptr(0)) {
		goto __34
	}
	// Got a link. Need to check if the link is relative
	// or absolute, for those platforms where relative
	// links exist.

	if !(XtclPlatform != TCL_PLATFORM_WINDOWS &&
		XTcl_FSGetPathType(tls, linkObj) ==
			TCL_PATH_RELATIVE) {
		goto __36
	}
	// We need to follow this link which is relative
	// to retVal's directory. This means concatenating
	// the link onto the directory of the path so far.

	path2 =
		XTcl_GetStringFromObj(tls, retVal, bp+4)

__38:
	if !(libc.PreDecInt32(&*(*int32)(unsafe.Pointer(bp + 4)), 1) >= 0) {
		goto __39
	}
	if !(sIsSeparatorOrNull(tls, int32(*(*int8)(unsafe.Pointer(path2 + uintptr(*(*int32)(unsafe.Pointer(bp + 4))))))) != 0) {
		goto __40
	}
	goto __39
__40:
	;
	goto __38
__39:
	;

	// We want the trailing slash.

	XTcl_SetObjLength(tls, retVal, *(*int32)(unsafe.Pointer(bp + 4))+1)
	XTcl_AppendObjToObj(tls, retVal, linkObj)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(linkObj)).FrefCount, 1) > 1) {
		goto __41
	}
	goto __42
__41:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(linkObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(linkObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __43
	}

	if !((*Tcl_Obj)(unsafe.Pointer(linkObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(linkObj)).Fbytes != XtclEmptyStringRep) {
		goto __45
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(linkObj)).Fbytes)
__45:
	;
	(*Tcl_Obj)(unsafe.Pointer(linkObj)).Flength = -1
__46:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __49
	}
	XTclThreadFreeObj(tls, linkObj)
	goto __50
__49:
	*(*uintptr)(unsafe.Pointer(linkObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = linkObj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__50:
	;
	goto __47
__47:
	if 0 != 0 {
		goto __46
	}
	goto __48
__48:
	;
	goto __44
__43:
	XTclFreeObj(tls, linkObj)
__44:
	;
__42:
	;

	linkStr = XTcl_GetStringFromObj(tls, retVal, bp+4)
	goto __37
__36:
	// Absolute link.

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount, 1) > 1) {
		goto __51
	}
	goto __52
__51:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(retVal)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(retVal)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __53
	}

	if !((*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes != XtclEmptyStringRep) {
		goto __55
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes)
__55:
	;
	(*Tcl_Obj)(unsafe.Pointer(retVal)).Flength = -1
__56:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __59
	}
	XTclThreadFreeObj(tls, retVal)
	goto __60
__59:
	*(*uintptr)(unsafe.Pointer(retVal + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = retVal
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__60:
	;
	goto __57
__57:
	if 0 != 0 {
		goto __56
	}
	goto __58
__58:
	;
	goto __54
__53:
	XTclFreeObj(tls, retVal)
__54:
	;
__52:
	;

	if !((*Tcl_Obj)(unsafe.Pointer(linkObj)).FrefCount > 1) {
		goto __61
	}
	retVal = XTcl_DuplicateObj(tls, linkObj)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(linkObj)).FrefCount, 1) > 1) {
		goto __63
	}
	goto __64
__63:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(linkObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(linkObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __65
	}

	if !((*Tcl_Obj)(unsafe.Pointer(linkObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(linkObj)).Fbytes != XtclEmptyStringRep) {
		goto __67
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(linkObj)).Fbytes)
__67:
	;
	(*Tcl_Obj)(unsafe.Pointer(linkObj)).Flength = -1
__68:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __71
	}
	XTclThreadFreeObj(tls, linkObj)
	goto __72
__71:
	*(*uintptr)(unsafe.Pointer(linkObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = linkObj
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__72:
	;
	goto __69
__69:
	if 0 != 0 {
		goto __68
	}
	goto __70
__70:
	;
	goto __66
__65:
	XTclFreeObj(tls, linkObj)
__66:
	;
__64:
	;

	goto __62
__61:
	retVal = linkObj
__62:
	;
	linkStr = XTcl_GetStringFromObj(tls, retVal, bp+4)

	// Convert to forward-slashes on windows.

	if !(XtclPlatform == TCL_PLATFORM_WINDOWS) {
		goto __73
	}

	i = 0
__74:
	if !(i < *(*int32)(unsafe.Pointer(bp + 4))) {
		goto __76
	}
	if !(int32(*(*int8)(unsafe.Pointer(linkStr + uintptr(i)))) == '\\') {
		goto __77
	}
	*(*int8)(unsafe.Pointer(linkStr + uintptr(i))) = int8('/')
__77:
	;
	goto __75
__75:
	i++
	goto __74
	goto __76
__76:
	;
__73:
	;
__37:
	;
	goto __35
__34:
	linkStr = XTcl_GetStringFromObj(tls, retVal, bp+4)
__35:
	;

	// Either way, we now remove the last path element (but
	// not the first character of the path).

__78:
	if !(libc.PreDecInt32(&*(*int32)(unsafe.Pointer(bp + 4)), 1) >= 0) {
		goto __79
	}
	if !(sIsSeparatorOrNull(tls, int32(*(*int8)(unsafe.Pointer(linkStr + uintptr(*(*int32)(unsafe.Pointer(bp + 4))))))) != 0) {
		goto __80
	}
	if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
		goto __81
	}
	XTcl_SetObjLength(tls, retVal, *(*int32)(unsafe.Pointer(bp + 4 /* curLen1 */)))
	goto __82
__81:
	XTcl_SetObjLength(tls, retVal, 1)
__82:
	;
	goto __79
__80:
	;
	goto __78
__79:
	;
__22:
	;
	dirSep += uintptr(3)
	oldDirSep = dirSep

	if !(*(*int32)(unsafe.Pointer(bp + 4)) == 0 && int32(*(*int8)(unsafe.Pointer(dirSep))) != 0) {
		goto __83
	}
	XTcl_SetObjLength(tls, retVal, 0)
__83:
	;

	if !(int32(*(*int8)(unsafe.Pointer(dirSep))) != 0 && int32(*(*int8)(unsafe.Pointer(dirSep + 1))) == '.') {
		goto __84
	}
	goto again
__84:
	;
	goto __8
__19:
	;
__13:
	;
	first = 0
	if !(retVal != uintptr(0)) {
		goto __85
	}
	XTcl_AppendToObj(tls, retVal, oldDirSep, int32((int64(dirSep)-int64(oldDirSep))/1))
__85:
	;
	goto __8
__9:
	;

	// If we didn't make any changes, just use the input path.

	if !(retVal == uintptr(0)) {
		goto __86
	}
	retVal = pathPtr
	(*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount++

	if !((*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount > 1) {
		goto __87
	}
	// Unfortunately, the platform-specific normalization code which
	// will be called below has no way of dealing with the case where
	// an object is shared. It is expecting to modify an object in
	// place. So, we must duplicate this here to ensure an object with
	// a single ref-count.
	//
	// If that changes in the future (e.g. the normalize proc is given
	// one object and is able to return a different one), then we
	// could remove this code.

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount, 1) > 1) {
		goto __88
	}
	goto __89
__88:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(retVal)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(retVal)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __90
	}

	if !((*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes != XtclEmptyStringRep) {
		goto __92
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes)
__92:
	;
	(*Tcl_Obj)(unsafe.Pointer(retVal)).Flength = -1
__93:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __96
	}
	XTclThreadFreeObj(tls, retVal)
	goto __97
__96:
	*(*uintptr)(unsafe.Pointer(retVal + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = retVal
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++
__97:
	;
	goto __94
__94:
	if 0 != 0 {
		goto __93
	}
	goto __95
__95:
	;
	goto __91
__90:
	XTclFreeObj(tls, retVal)
__91:
	;
__89:
	;

	retVal = XTcl_DuplicateObj(tls, pathPtr)
	(*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount++
__87:
	;
__86:
	;

	// Ensure a windows drive like C:/ has a trailing separator.

	if !(XtclPlatform == TCL_PLATFORM_WINDOWS) {
		goto __98
	}
	path3 = XTcl_GetStringFromObj(tls, retVal, bp+8)

	if !(*(*int32)(unsafe.Pointer(bp + 8)) == 2 && int32(*(*int8)(unsafe.Pointer(path3))) != 0 && int32(*(*int8)(unsafe.Pointer(path3 + 1))) == ':') {
		goto __99
	}
	if !((*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount > 1) {
		goto __100
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount, 1) > 1) {
		goto __101
	}
	goto __102
__101:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(retVal)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(retVal)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __103
	}

	if !((*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes != XtclEmptyStringRep) {
		goto __105
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(retVal)).Fbytes)
__105:
	;
	(*Tcl_Obj)(unsafe.Pointer(retVal)).Flength = -1
__106:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __109
	}
	XTclThreadFreeObj(tls, retVal)
	goto __110
__109:
	*(*uintptr)(unsafe.Pointer(retVal + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = retVal
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++
__110:
	;
	goto __107
__107:
	if 0 != 0 {
		goto __106
	}
	goto __108
__108:
	;
	goto __104
__103:
	XTclFreeObj(tls, retVal)
__104:
	;
__102:
	;

	retVal = XTcl_DuplicateObj(tls, retVal)
	(*Tcl_Obj)(unsafe.Pointer(retVal)).FrefCount++
__100:
	;
	XTcl_AppendToObj(tls, retVal, ts+5792, 1)
__99:
	;
__98:
	;

	// Now we have an absolute path, with no '..', '.' sequences, but it still
	// may not be in 'unique' form, depending on the platform. For instance,
	// Unix is case-sensitive, so the path is ok. Windows is case-insensitive,
	// and also has the weird 'longname/shortname' thing (e.g. C:/Program
	// Files/ and C:/Progra~1/ are equivalent).
	//
	// Virtual file systems which may be registered may have other criteria
	// for normalizing a path.

	XTclFSNormalizeToUniquePath(tls, interp, retVal, 0)

	// Since we know it is a normalized path, we can actually convert this
	// object into an FsPath for greater efficiency

	sMakePathFromNormalized(tls, interp, retVal)

	// This has a refCount of 1 for the caller, unlike many Tcl_Obj APIs.

	return retVal
}

//----------------------------------------------------------------------
//
// Tcl_FSGetPathType --
//
//	Determines whether a given path is relative to the current directory,
//	relative to the current volume, or absolute.
//
// Results:
//	Returns one of TCL_PATH_ABSOLUTE, TCL_PATH_RELATIVE, or
//	TCL_PATH_VOLUME_RELATIVE.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_FSGetPathType(tls *libc.TLS, pathPtr uintptr) Tcl_PathType { /* tclPathObj.c:466:1: */
	return XTclFSGetPathType(tls, pathPtr, uintptr(0), uintptr(0))
}

//----------------------------------------------------------------------
//
// TclFSGetPathType --
//
//	Determines whether a given path is relative to the current directory,
//	relative to the current volume, or absolute. If the caller wishes to
//	know which filesystem claimed the path (in the case for which the path
//	is absolute), then a reference to a filesystem pointer can be passed
//	in (but passing NULL is acceptable).
//
// Results:
//	Returns one of TCL_PATH_ABSOLUTE, TCL_PATH_RELATIVE, or
//	TCL_PATH_VOLUME_RELATIVE. The filesystem reference will be set if and
//	only if it is non-NULL and the function's return value is
//	TCL_PATH_ABSOLUTE.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFSGetPathType(tls *libc.TLS, pathPtr uintptr, filesystemPtrPtr uintptr, driveNameLengthPtr uintptr) Tcl_PathType { /* tclPathObj.c:496:1: */
	var fsPathPtr uintptr

	if XTcl_FSConvertToPathType(tls, uintptr(0), pathPtr) != TCL_OK {
		return XTclGetPathType(tls, pathPtr, filesystemPtrPtr, driveNameLengthPtr,
			uintptr(0))
	}

	fsPathPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))
	if (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr == uintptr(0) {
		return XTclGetPathType(tls, pathPtr, filesystemPtrPtr, driveNameLengthPtr,
			uintptr(0))
	}

	if (*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).Fflags == 0 {
		// The path is not absolute...
		// On other systems, quickly deduce !absolute -> relative
		return TCL_PATH_RELATIVE
	}
	return XTclFSGetPathType(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr, filesystemPtrPtr,
		driveNameLengthPtr)
}

//---------------------------------------------------------------------------
//
// TclPathPart
//
//	This function calculates the requested part of the given path, which
//	can be:
//
//	- the directory above ('file dirname')
//	- the tail            ('file tail')
//	- the extension       ('file extension')
//	- the root            ('file root')
//
//	The 'portion' parameter dictates which of these to calculate. There
//	are a number of special cases both to be more efficient, and because
//	the behaviour when given a path with only a single element is defined
//	to require the expansion of that single element, where possible.
//
//	Should look into integrating 'FileBasename' in tclFCmd.c into this
//	function.
//
// Results:
//	NULL if an error occurred, otherwise a Tcl_Obj owned by the caller
//	(i.e. most likely with refCount 1).
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclPathPart(tls *libc.TLS, interp uintptr, pathPtr uintptr, portion Tcl_PathPart) uintptr { /* tclPathObj.c:561:9: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// Check if the joined-on bit has any directory delimiters in
	// it. If so, the 'dirname' would be a joining of the main
	// part with the dirname of the joined-on bit. We could handle
	// that special case here, but we don't, and instead just use
	// the standardPath code.

	// var numBytes int32 at bp, 4

	var rest uintptr
	// Check if the joined-on bit has any directory delimiters in
	// it. If so, the 'tail' would be only the part following the
	// last delimiter. We could handle that special case here, but
	// we don't, and instead just use the standardPath code.

	// var numBytes1 int32 at bp+4, 4

	var rest1 uintptr
	// Need to return the whole path with the extension
	// suffix removed.  Do that by joining our "head" to
	// our "tail" with the extension suffix removed from
	// the tail.

	var resultPtr uintptr
	var fileName uintptr
	var extension uintptr
	// var length int32 at bp+8, 4

	var fsPathPtr uintptr
	var root uintptr
	// var length1 int32 at bp+12, 4

	var fileName1 uintptr
	var extension1 uintptr
	var cachePtr uintptr
	var norm uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	// var splitElements int32 at bp+16, 4

	var splitPtr uintptr
	// var resultPtr1 uintptr at bp+24, 8

	if !((*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr == uintptr(unsafe.Pointer(&tclFsPathType))) {
		goto __1
	}
	fsPathPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))

	if !((*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).Fflags != 0) {
		goto __3
	}
	switch portion {
	case TCL_PATH_DIRNAME:
		goto __6
	case TCL_PATH_TAIL:
		goto __7
	case TCL_PATH_EXTENSION:
		goto __8
	case TCL_PATH_ROOT:
		goto __9
	default:
		goto __10
	}
	goto __5
__6:
	rest =
		XTcl_GetStringFromObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr, bp)

	if !(libc.Xstrchr(tls, rest, '/') != uintptr(0)) {
		goto __11
	}
	goto standardPath
__11:
	;
	// If the joined-on bit is empty, then [file dirname] is
	// documented to return all but the last non-empty element
	// of the path, so we need to split apart the main part to
	// get the right answer.  We could do that here, but it's
	// simpler to fall back to the standardPath code.
	// [Bug 2710920]
	if !(*(*int32)(unsafe.Pointer(bp)) == 0) {
		goto __12
	}
	goto standardPath
__12:
	;
	if !(XtclPlatform == TCL_PLATFORM_WINDOWS &&
		libc.Xstrchr(tls, rest, '\\') != uintptr(0)) {
		goto __13
	}
	goto standardPath
__13:
	;

	// The joined-on path is simple, so we can just return here.

	(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).FrefCount++
	return (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr

__7:
	rest1 =
		XTcl_GetStringFromObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr, bp+4)

	if !(libc.Xstrchr(tls, rest1, '/') != uintptr(0)) {
		goto __14
	}
	goto standardPath
__14:
	;
	// If the joined-on bit is empty, then [file tail] is
	// documented to return the last non-empty element
	// of the path, so we need to split off the last element
	// of the main part to get the right answer.  We could do
	// that here, but it's simpler to fall back to the
	// standardPath code.  [Bug 2710920]
	if !(*(*int32)(unsafe.Pointer(bp + 4)) == 0) {
		goto __15
	}
	goto standardPath
__15:
	;
	if !(XtclPlatform == TCL_PLATFORM_WINDOWS &&
		libc.Xstrchr(tls, rest1, '\\') != uintptr(0)) {
		goto __16
	}
	goto standardPath
__16:
	;
	(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FrefCount++
	return (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr

__8:
	return sGetExtension(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)
__9:

	fileName = XTcl_GetStringFromObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr,
		bp+8)
	extension = XTclGetExtension(tls, fileName)
	if !(extension == uintptr(0)) {
		goto __17
	}
	// There is no extension so the root is the same as the
	// path we were given.

	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount++
	return pathPtr
	goto __18
__17:
	// Need to return the whole path with the extension
	// suffix removed.  Do that by joining our "head" to
	// our "tail" with the extension suffix removed from
	// the tail.

	resultPtr =
		XTclNewFSPathObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr, fileName,
			int32(Size_t(*(*int32)(unsafe.Pointer(bp + 8)))-libc.Xstrlen(tls, extension)))

	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
	return resultPtr
__18:
	;

__10:
	// We should never get here
	XTcl_Panic(tls, ts+54835, 0)
	// For less clever compilers
	return uintptr(0)
__5:
	;
	goto __4
__3:
	if !((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr != uintptr(0)) {
		goto __19
	}
	// Relative path
	goto standardPath
	goto __20
__19:
	// Absolute path
	goto standardPath
__20:
	;
__4:
	;
	goto __2
__1:

standardPath:
	*(*uintptr)(unsafe.Pointer(bp + 24 /* resultPtr1 */)) = uintptr(0)
	if !(portion == TCL_PATH_EXTENSION) {
		goto __21
	}
	return sGetExtension(tls, pathPtr)
	goto __22
__21:
	if !(portion == TCL_PATH_ROOT) {
		goto __23
	}

	fileName1 = XTcl_GetStringFromObj(tls, pathPtr, bp+12)
	extension1 = XTclGetExtension(tls, fileName1)
	if !(extension1 == uintptr(0)) {
		goto __24
	}
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount++
	return pathPtr
	goto __25
__24:
	root = XTcl_NewStringObj(tls, fileName1,
		int32(Size_t(*(*int32)(unsafe.Pointer(bp + 12)))-libc.Xstrlen(tls, extension1)))

	(*Tcl_Obj)(unsafe.Pointer(root)).FrefCount++
	return root
__25:
	;
__23:
	;
__22:
	;

	// The behaviour we want here is slightly different to the standard
	// Tcl_FSSplitPath in the handling of home directories;
	// Tcl_FSSplitPath preserves the "~" while this code computes the
	// actual full path name, if we had just a single component.

	splitPtr = XTcl_FSSplitPath(tls, pathPtr, bp+16)
	(*Tcl_Obj)(unsafe.Pointer(splitPtr)).FrefCount++
	if !(*(*int32)(unsafe.Pointer(bp + 16)) == 1 && int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
		}
		return XTcl_GetString(tls, pathPtr)
	}()))) == '~') {
		goto __26
	}

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(splitPtr)).FrefCount, 1) > 1) {
		goto __27
	}
	goto __28
__27:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(splitPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(splitPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __29
	}

	if !((*Tcl_Obj)(unsafe.Pointer(splitPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(splitPtr)).Fbytes != XtclEmptyStringRep) {
		goto __31
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(splitPtr)).Fbytes)
__31:
	;
	(*Tcl_Obj)(unsafe.Pointer(splitPtr)).Flength = -1
__32:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __35
	}
	XTclThreadFreeObj(tls, splitPtr)
	goto __36
__35:
	*(*uintptr)(unsafe.Pointer(splitPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = splitPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__36:
	;
	goto __33
__33:
	if 0 != 0 {
		goto __32
	}
	goto __34
__34:
	;
	goto __30
__29:
	XTclFreeObj(tls, splitPtr)
__30:
	;
__28:
	;

	norm = XTcl_FSGetNormalizedPath(tls, interp, pathPtr)
	if !(norm == uintptr(0)) {
		goto __37
	}
	return uintptr(0)
__37:
	;
	splitPtr = XTcl_FSSplitPath(tls, norm, bp+16)
	(*Tcl_Obj)(unsafe.Pointer(splitPtr)).FrefCount++
__26:
	;
	if !(portion == TCL_PATH_TAIL) {
		goto __38
	}
	// Return the last component, unless it is the only component, and
	// it is the root of an absolute path.

	if !(*(*int32)(unsafe.Pointer(bp + 16)) > 0 && (*(*int32)(unsafe.Pointer(bp + 16)) > 1 || XTcl_FSGetPathType(tls, pathPtr) == TCL_PATH_RELATIVE)) {
		goto __40
	}
	XTcl_ListObjIndex(tls, uintptr(0), splitPtr, *(*int32)(unsafe.Pointer(bp + 16))-1, bp+24)
	goto __41
__40:
	*(*uintptr)(unsafe.Pointer(bp + 24 /* resultPtr1 */)) = XTcl_NewObj(tls)
__41:
	;
	goto __39
__38:
	// Return all but the last component. If there is only one
	// component, return it if the path was non-relative, otherwise
	// return the current directory.

	if !(*(*int32)(unsafe.Pointer(bp + 16)) > 1) {
		goto __42
	}
	*(*uintptr)(unsafe.Pointer(bp + 24 /* resultPtr1 */)) = XTcl_FSJoinPath(tls, splitPtr, *(*int32)(unsafe.Pointer(bp + 16))-1)
	goto __43
__42:
	if !(*(*int32)(unsafe.Pointer(bp + 16)) == 0 || XTcl_FSGetPathType(tls, pathPtr) == TCL_PATH_RELATIVE) {
		goto __44
	}
__46:
	;
__49:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __52
	}
	*(*uintptr)(unsafe.Pointer(bp + 24)) = XTclThreadAllocObj(tls)
	goto __53
__52:
	*(*uintptr)(unsafe.Pointer(bp + 24)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__53:
	;
	goto __50
__50:
	if 0 != 0 {
		goto __49
	}
	goto __51
__51:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)) == 0) {
		goto __54
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Flength = 0
	goto __55
__54:
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes, ts+31477, uint64(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes + 1)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Flength = int32(uint64(unsafe.Sizeof([2]int8{})) - uint64(1))
__55:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FtypePtr = uintptr(0)

	goto __47
__47:
	if 0 != 0 {
		goto __46
	}
	goto __48
__48:
	;
	goto __45
__44:
	XTcl_ListObjIndex(tls, uintptr(0), splitPtr, 0, bp+24)
__45:
	;
__43:
	;
__39:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FrefCount++
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(splitPtr)).FrefCount, 1) > 1) {
		goto __56
	}
	goto __57
__56:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(splitPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(splitPtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __58
	}

	if !((*Tcl_Obj)(unsafe.Pointer(splitPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(splitPtr)).Fbytes != XtclEmptyStringRep) {
		goto __60
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(splitPtr)).Fbytes)
__60:
	;
	(*Tcl_Obj)(unsafe.Pointer(splitPtr)).Flength = -1
__61:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __64
	}
	XTclThreadFreeObj(tls, splitPtr)
	goto __65
__64:
	*(*uintptr)(unsafe.Pointer(splitPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = splitPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__65:
	;
	goto __62
__62:
	if 0 != 0 {
		goto __61
	}
	goto __63
__63:
	;
	goto __59
__58:
	XTclFreeObj(tls, splitPtr)
__59:
	;
__57:
	;

	return *(*uintptr)(unsafe.Pointer(bp + 24 /* resultPtr1 */))
__2:
	;
	return uintptr(0)
}

// Simple helper function

func sGetExtension(tls *libc.TLS, pathPtr uintptr) uintptr { /* tclPathObj.c:774:16: */
	var tail uintptr
	var extension uintptr
	var ret uintptr

	tail = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
		}
		return XTcl_GetString(tls, pathPtr)
	}()
	extension = XTclGetExtension(tls, tail)
	if extension == uintptr(0) {
		ret = XTcl_NewObj(tls)
	} else {
		ret = XTcl_NewStringObj(tls, extension, -1)
	}
	(*Tcl_Obj)(unsafe.Pointer(ret)).FrefCount++
	return ret
}

//---------------------------------------------------------------------------
//
// Tcl_FSJoinPath --
//
//	This function takes the given Tcl_Obj, which should be a valid list,
//	and returns the path object given by considering the first 'elements'
//	elements as valid path segments (each path segment may be a complete
//	path, a partial path or just a single possible directory or file
//	name). If any path segment is actually an absolute path, then all
//	prior path segments are discarded.
//
//	If elements < 0, we use the entire list that was given.
//
//	It is possible that the returned object is actually an element of the
//	given list, so the caller should be careful to store a refCount to it
//	before freeing the list.
//
// Results:
//	Returns object with refCount of zero, (or if non-zero, it has
//	references elsewhere in Tcl). Either way, the caller must increment
//	its refCount before use. Note that in the case where the caller has
//	asked to join zero elements of the list, the return value will be an
//	empty-string Tcl_Obj.
//
//	If the given listObj was invalid, then the calling routine has a bug,
//	and this function will just return NULL.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_FSJoinPath(tls *libc.TLS, listObj uintptr, elements int32) uintptr { /* tclPathObj.c:826:9: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var res uintptr
	// var objc int32 at bp, 4

	// var objv uintptr at bp+8, 8

	if XTcl_ListObjLength(tls, uintptr(0), listObj, bp) != TCL_OK {
		return uintptr(0)
	}

	if elements >= 0 && elements <= *(*int32)(unsafe.Pointer(bp)) {
		elements = elements
	} else {
		elements = *(*int32)(unsafe.Pointer(bp /* objc */))
	}
	XTcl_ListObjGetElements(tls, uintptr(0), listObj, bp, bp+8)
	res = XTclJoinPath(tls, elements, *(*uintptr)(unsafe.Pointer(bp + 8 /* objv */)), 0)
	return res
}

func XTclJoinPath(tls *libc.TLS, elements int32, objv uintptr, forceRelative int32) uintptr { /* tclPathObj.c:846:9: */
	bp := tls.Alloc(37)
	defer tls.Free(37)

	var res uintptr
	var i int32
	// var fsPtr uintptr at bp+8, 8

	var str uintptr
	// var len int32 at bp, 4

	var str1 uintptr
	var tailObj uintptr
	var type1 Tcl_PathType
	var elt uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr
	var _objPtr uintptr
	var cachePtr2 uintptr
	var _objPtr1 uintptr
	var cachePtr3 uintptr
	var sep uintptr
	// var separator int8 at bp+36, 1

	var needsSep int32
	// var driveNameLength int32 at bp+16, 4

	// var strEltLen int32 at bp+4, 4

	// var length int32 at bp+32, 4

	var type2 Tcl_PathType
	var strElt uintptr
	var ptr uintptr
	// var driveName uintptr at bp+24, 8

	var elt1 uintptr
	res = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 8 /* fsPtr */)) = uintptr(0)

	if !(elements == 0) {
		goto __1
	}
	return XTcl_NewObj(tls)
__1:
	;

	if !(elements == 2) {
		goto __2
	}
	elt = *(*uintptr)(unsafe.Pointer(objv))

	// This is a special case where we can be much more efficient, where
	// we are joining a single relative path onto an object that is
	// already of path type. The 'TclNewFSPathObj' call below creates an
	// object which can be normalized more efficiently. Currently we only
	// use the special case when we have exactly two elements, but we
	// could expand that in the future.
	//
	// Bugfix [a47641a0]. TclNewFSPathObj requires first argument
	// to be an absolute path. Added a check for that elt is absolute.

	if !((*Tcl_Obj)(unsafe.Pointer(elt)).FtypePtr == uintptr(unsafe.Pointer(&tclFsPathType)) &&
		!((*Tcl_Obj)(unsafe.Pointer(elt)).Fbytes != uintptr(0) && int32(*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(elt)).Fbytes))) == 0) &&
		XTclGetPathType(tls, elt, uintptr(0), uintptr(0), uintptr(0)) == TCL_PATH_ABSOLUTE) {
		goto __3
	}
	tailObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))

	// if forceRelative - second path is relative
	if forceRelative != 0 {
		type1 = TCL_PATH_RELATIVE
	} else {
		type1 = XTclGetPathType(tls, tailObj, uintptr(0), uintptr(0), uintptr(0))
	}
	if !(type1 == TCL_PATH_RELATIVE) {
		goto __4
	}

	str = XTcl_GetStringFromObj(tls, tailObj, bp)
	if !(*(*int32)(unsafe.Pointer(bp)) == 0) {
		goto __6
	}
	// This happens if we try to handle the root volume '/'.
	// There's no need to return a special path object, when
	// the base itself is just fine!

	return elt
__6:
	;

	// If it doesn't begin with '.' and is a unix path or it a
	// windows path without backslashes, then we can be very
	// efficient here. (In fact even a windows path with
	// backslashes can be joined efficiently, but the path object
	// would not have forward slashes only, and this would
	// therefore contradict our 'file join' documentation).

	if !(int32(*(*int8)(unsafe.Pointer(str))) != '.' && (XtclPlatform != TCL_PLATFORM_WINDOWS ||
		libc.Xstrchr(tls, str, '\\') == uintptr(0))) {
		goto __7
	}
	// Finally, on Windows, 'file join' is defined to convert
	// all backslashes to forward slashes, so the base part
	// cannot have backslashes either.

	if !(XtclPlatform != TCL_PLATFORM_WINDOWS ||
		libc.Xstrchr(tls, XTcl_GetString(tls, elt), '\\') == uintptr(0)) {
		goto __8
	}

	if !((*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elt + 32)))).Fflags != 0) {
		goto __9
	}
	return XTclNewFSPathObj(tls, elt, str, *(*int32)(unsafe.Pointer(bp /* len */)))
__9:
	;
	if !(TCL_PATH_ABSOLUTE != XTcl_FSGetPathType(tls, elt)) {
		goto __10
	}
	return XTclNewFSPathObj(tls, elt, str, *(*int32)(unsafe.Pointer(bp /* len */)))
__10:
	;
	XTcl_FSGetNormalizedPath(tls, uintptr(0), elt)
	if !(elt == (*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(elt + 32)))).FnormPathPtr) {
		goto __11
	}
	return XTclNewFSPathObj(tls, elt, str, *(*int32)(unsafe.Pointer(bp /* len */)))
__11:
	;
__8:
	;
__7:
	;

	// Otherwise we don't have an easy join, and we must let the
	// more general code below handle things.
	goto __5
__4:
	if !(XtclPlatform == TCL_PLATFORM_UNIX) {
		goto __12
	}
	return tailObj
	goto __13
__12:
	str1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(tailObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(tailObj)).Fbytes
		}
		return XTcl_GetString(tls, tailObj)
	}()

	if !(XtclPlatform == TCL_PLATFORM_WINDOWS) {
		goto __14
	}
	if !(libc.Xstrchr(tls, str1, '\\') == uintptr(0)) {
		goto __15
	}
	return tailObj
__15:
	;
__14:
	;
__13:
	;
__5:
	;
__3:
	;
__2:
	;

	i = 0
__16:
	if !(i < elements) {
		goto __18
	}
	*(*uintptr)(unsafe.Pointer(bp + 24 /* driveName */)) = uintptr(0)
	elt1 = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))

	strElt = XTcl_GetStringFromObj(tls, elt1, bp+4)
	*(*int32)(unsafe.Pointer(bp + 16 /* driveNameLength */)) = 0
	// if forceRelative - all paths excepting first one are relative
	if forceRelative != 0 && i > 0 {
		type2 = TCL_PATH_RELATIVE
	} else {
		type2 = XTclGetPathType(tls, elt1, bp+8, bp+16, bp+24)
	}
	if !(type2 != TCL_PATH_RELATIVE) {
		goto __19
	}
	// Zero out the current result.

	if !(res != uintptr(0)) {
		goto __21
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(res)).FrefCount, 1) > 1) {
		goto __22
	}
	goto __23
__22:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(res)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(res)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __24
	}

	if !((*Tcl_Obj)(unsafe.Pointer(res)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(res)).Fbytes != XtclEmptyStringRep) {
		goto __26
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(res)).Fbytes)
__26:
	;
	(*Tcl_Obj)(unsafe.Pointer(res)).Flength = -1
__27:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __30
	}
	XTclThreadFreeObj(tls, res)
	goto __31
__30:
	*(*uintptr)(unsafe.Pointer(res + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = res
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
__31:
	;
	goto __28
__28:
	if 0 != 0 {
		goto __27
	}
	goto __29
__29:
	;
	goto __25
__24:
	XTclFreeObj(tls, res)
__25:
	;
__23:
	;

__21:
	;

	if !(*(*uintptr)(unsafe.Pointer(bp + 24)) != uintptr(0)) {
		goto __32
	}
	// We've been given a separate drive-name object, because the
	// prefix in 'elt' is not in a suitable format for us (e.g. it
	// may contain irrelevant multiple separators, like
	// C://///foo).

	res = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* driveName */)))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FrefCount, 1) > 1) {
		goto __34
	}
	goto __35
__34:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __36
	}

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes != XtclEmptyStringRep) {
		goto __38
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes)
__38:
	;
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Flength = -1
__39:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __42
	}
	XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
	goto __43
__42:
	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 24))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__43:
	;
	goto __40
__40:
	if 0 != 0 {
		goto __39
	}
	goto __41
__41:
	;
	goto __37
__36:
	XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* driveName */)))
__37:
	;
__35:
	;

	// Do not set driveName to NULL, because we will check its
	// value below (but we won't access the contents, since those
	// have been cleaned-up).
	goto __33
__32:
	res = XTcl_NewStringObj(tls, strElt, *(*int32)(unsafe.Pointer(bp + 16 /* driveNameLength */)))
__33:
	;
	strElt += uintptr(*(*int32)(unsafe.Pointer(bp + 16 /* driveNameLength */)))
	goto __20
__19:
	if !(*(*uintptr)(unsafe.Pointer(bp + 24)) != uintptr(0)) {
		goto __44
	}
__45:
	_objPtr = *(*uintptr)(unsafe.Pointer(bp + 24))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __48
	}
	XTclFreeObj(tls, _objPtr)
__48:
	;
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
__44:
	;
__20:
	;

	// Optimisation block: if this is the last element to be examined, and
	// it is absolute or the only element, and the drive-prefix was ok (if
	// there is one), it might be that the path is already in a suitable
	// form to be returned. Then we can short-cut the rest of this
	// function.

	if !(*(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) && i == elements-1 &&
		(type2 != TCL_PATH_RELATIVE || res == uintptr(0))) {
		goto __49
	}
	// It's the last path segment. Perform a quick check if the path
	// is already in a suitable form.

	if !(XtclPlatform == TCL_PLATFORM_WINDOWS) {
		goto __50
	}
	if !(libc.Xstrchr(tls, strElt, '\\') != uintptr(0)) {
		goto __51
	}
	goto noQuickReturn
__51:
	;
__50:
	;
	ptr = strElt
	// [Bug f34cf83dd0]
	if !(*(*int32)(unsafe.Pointer(bp + 16)) > 0) {
		goto __52
	}
	if !(int32(*(*int8)(unsafe.Pointer(ptr))) == '/' && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(-1)))) == '/') {
		goto __53
	}
	goto noQuickReturn
__53:
	;
__52:
	;
__54:
	if !(int32(*(*int8)(unsafe.Pointer(ptr))) != 0) {
		goto __55
	}
	if !(int32(*(*int8)(unsafe.Pointer(ptr))) == '/' && (int32(*(*int8)(unsafe.Pointer(ptr + 1))) == '/' || int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0)) {
		goto __56
	}
	// We have a repeated file separator, which means the path
	// is not in normalized form

	goto noQuickReturn
__56:
	;
	ptr++
	goto __54
__55:
	;
	if !(res != uintptr(0)) {
		goto __57
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(res)).FrefCount, 1) > 1) {
		goto __58
	}
	goto __59
__58:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(res)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(res)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __60
	}

	if !((*Tcl_Obj)(unsafe.Pointer(res)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(res)).Fbytes != XtclEmptyStringRep) {
		goto __62
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(res)).Fbytes)
__62:
	;
	(*Tcl_Obj)(unsafe.Pointer(res)).Flength = -1
__63:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __66
	}
	XTclThreadFreeObj(tls, res)
	goto __67
__66:
	*(*uintptr)(unsafe.Pointer(res + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = res
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__67:
	;
	goto __64
__64:
	if 0 != 0 {
		goto __63
	}
	goto __65
__65:
	;
	goto __61
__60:
	XTclFreeObj(tls, res)
__61:
	;
__59:
	;

__57:
	;

	// This element is just what we want to return already; no further
	// manipulation is requred.

	return elt1
__49:
	;

	// The path element was not of a suitable form to be returned as is.
	// We need to perform a more complex operation here.

noQuickReturn:
	if !(res == uintptr(0)) {
		goto __68
	}
	res = XTcl_NewObj(tls)
	ptr = XTcl_GetStringFromObj(tls, res, bp+32)
	goto __69
__68:
	ptr = XTcl_GetStringFromObj(tls, res, bp+32)
__69:
	;

	// Strip off any './' before a tilde, unless this is the beginning of
	// the path.

	if !(*(*int32)(unsafe.Pointer(bp + 32)) > 0 && *(*int32)(unsafe.Pointer(bp + 4)) > 0 && int32(*(*int8)(unsafe.Pointer(strElt))) == '.' && int32(*(*int8)(unsafe.Pointer(strElt + 1))) == '/' && int32(*(*int8)(unsafe.Pointer(strElt + 2))) == '~') {
		goto __70
	}
	strElt += uintptr(2)
__70:
	;

	// A NULL value for fsPtr at this stage basically means we're trying
	// to join a relative path onto something which is also relative (or
	// empty). There's nothing particularly wrong with that.

	if !(int32(*(*int8)(unsafe.Pointer(strElt))) == 0) {
		goto __71
	}
	goto __17
__71:
	;

	if !(*(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(unsafe.Pointer(&XtclNativeFilesystem)) || *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0)) {
		goto __72
	}
	XTclpNativeJoinPath(tls, res, strElt)
	goto __73
__72:
	*(*int8)(unsafe.Pointer(bp + 36 /* separator */)) = int8('/')
	needsSep = 0

	if !((*Tcl_Filesystem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FfilesystemSeparatorProc != uintptr(0)) {
		goto __74
	}
	sep = (*struct {
		f func(*libc.TLS, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* fsPtr */)))).FfilesystemSeparatorProc})).f(tls, res)

	if !(sep != uintptr(0)) {
		goto __75
	}
	*(*int8)(unsafe.Pointer(bp + 36 /* separator */)) = *(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(sep)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(sep)).Fbytes
		}
		return XTcl_GetString(tls, sep)
	}()))
__76:
	_objPtr1 = sep
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __79
	}
	XTclFreeObj(tls, _objPtr1)
__79:
	;
	goto __77
__77:
	if 0 != 0 {
		goto __76
	}
	goto __78
__78:
	;
__75:
	;
	// Safety check in case the VFS driver caused sharing
	if !((*Tcl_Obj)(unsafe.Pointer(res)).FrefCount > 1) {
		goto __80
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(res)).FrefCount, 1) > 1) {
		goto __81
	}
	goto __82
__81:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(res)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(res)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __83
	}

	if !((*Tcl_Obj)(unsafe.Pointer(res)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(res)).Fbytes != XtclEmptyStringRep) {
		goto __85
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(res)).Fbytes)
__85:
	;
	(*Tcl_Obj)(unsafe.Pointer(res)).Flength = -1
__86:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __89
	}
	XTclThreadFreeObj(tls, res)
	goto __90
__89:
	*(*uintptr)(unsafe.Pointer(res + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = res
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__90:
	;
	goto __87
__87:
	if 0 != 0 {
		goto __86
	}
	goto __88
__88:
	;
	goto __84
__83:
	XTclFreeObj(tls, res)
__84:
	;
__82:
	;

	res = XTcl_DuplicateObj(tls, res)
	(*Tcl_Obj)(unsafe.Pointer(res)).FrefCount++
__80:
	;
__74:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 32)) > 0 && int32(*(*int8)(unsafe.Pointer(ptr + uintptr(*(*int32)(unsafe.Pointer(bp + 32))-1)))) != '/') {
		goto __91
	}
	XTcl_AppendToObj(tls, res, bp+36, 1)
	XTcl_GetStringFromObj(tls, res, bp+32)
__91:
	;
	XTcl_SetObjLength(tls, res, *(*int32)(unsafe.Pointer(bp + 32))+int32(libc.Xstrlen(tls, strElt)))

	ptr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(res)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(res)).Fbytes
		}
		return XTcl_GetString(tls, res)
	}() + uintptr(*(*int32)(unsafe.Pointer(bp + 32)))
__92:
	if !(int32(*(*int8)(unsafe.Pointer(strElt))) != 0) {
		goto __94
	}
	if !(int32(*(*int8)(unsafe.Pointer(strElt))) == int32(*(*int8)(unsafe.Pointer(bp + 36)))) {
		goto __95
	}
__97:
	if !(int32(*(*int8)(unsafe.Pointer(strElt + 1))) == int32(*(*int8)(unsafe.Pointer(bp + 36)))) {
		goto __98
	}
	strElt++
	goto __97
__98:
	;
	if !(int32(*(*int8)(unsafe.Pointer(strElt + 1))) != 0) {
		goto __99
	}
	if !(needsSep != 0) {
		goto __100
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ptr, 1))) = *(*int8)(unsafe.Pointer(bp + 36 /* separator */))
__100:
	;
__99:
	;
	goto __96
__95:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ptr, 1))) = *(*int8)(unsafe.Pointer(strElt))
	needsSep = 1
__96:
	;
	goto __93
__93:
	strElt++
	goto __92
	goto __94
__94:
	;
	*(*int32)(unsafe.Pointer(bp + 32 /* length */)) = int32((int64(ptr) - func() int64 {
		if (*Tcl_Obj)(unsafe.Pointer(res)).Fbytes != 0 {
			return int64((*Tcl_Obj)(unsafe.Pointer(res)).Fbytes)
		}
		return int64(XTcl_GetString(tls, res))
	}()) / 1)
	XTcl_SetObjLength(tls, res, *(*int32)(unsafe.Pointer(bp + 32 /* length */)))
__73:
	;
	goto __17
__17:
	i++
	goto __16
	goto __18
__18:
	;

	return res
}

//---------------------------------------------------------------------------
//
// Tcl_FSConvertToPathType --
//
//	This function tries to convert the given Tcl_Obj to a valid Tcl path
//	type, taking account of the fact that the cwd may have changed even if
//	this object is already supposedly of the correct type.
//
//	The filename may begin with "~" (to indicate current user's home
//	directory) or "~<user>" (to indicate any user's home directory).
//
// Results:
//	Standard Tcl error code.
//
// Side effects:
//	The old representation may be freed, and new memory allocated.
//
//---------------------------------------------------------------------------

func XTcl_FSConvertToPathType(tls *libc.TLS, interp uintptr, pathPtr uintptr) int32 { /* tclPathObj.c:1158:1: */
	// While it is bad practice to examine an object's type directly, this is
	// actually the best thing to do here. The reason is that if we are
	// converting this object to FsPath type for the first time, we don't need
	// to worry whether the 'cwd' has changed. On the other hand, if this
	// object is already of FsPath type, and is a relative path, we do have to
	// worry about the cwd. If the cwd has changed, we must recompute the
	// path.

	if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr == uintptr(unsafe.Pointer(&tclFsPathType)) {
		if XTclFSEpochOk(tls, uint64((*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).FfilesystemEpoch)) != 0 {
			return TCL_OK
		}

		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes == uintptr(0) {
			sUpdateStringOfFsPath(tls, pathPtr)
		}
		sFreeFsPathInternalRep(tls, pathPtr)
	}

	return sSetFsPathFromAny(tls, interp, pathPtr)

	// We used to have more complex code here:
	//
	// FsPath *fsPathPtr = PATHOBJ(pathPtr);
	// if (fsPathPtr->cwdPtr == NULL || PATHFLAGS(pathPtr) != 0) {
	//     return TCL_OK;
	// } else {
	//     if (TclFSCwdPointerEquals(&fsPathPtr->cwdPtr)) {
	//         return TCL_OK;
	//     } else {
	//         if (pathPtr->bytes == NULL) {
	//             UpdateStringOfFsPath(pathPtr);
	//         }
	//         FreeFsPathInternalRep(pathPtr);
	//         return Tcl_ConvertToType(interp, pathPtr, &tclFsPathType);
	//     }
	// }
	//
	// But we no longer believe this is necessary.
}

// Helper function for normalization.

func sIsSeparatorOrNull(tls *libc.TLS, ch int32) int32 { /* tclPathObj.c:1214:1: */
	if ch == 0 {
		return 1
	}
	switch XtclPlatform {
	case TCL_PLATFORM_UNIX:
		return func() int32 {
			if ch == '/' {
				return 1
			}
			return 0
		}()
	case TCL_PLATFORM_WINDOWS:
		return func() int32 {
			if ch == '/' || ch == '\\' {
				return 1
			}
			return 0
		}()
	}
	return 0
}

// Helper function for SetFsPathFromAny. Returns position of first directory
// delimiter in the path. If no separator is found, then returns the position
// of the end of the string.

func sFindSplitPos(tls *libc.TLS, path uintptr, separator int32) int32 { /* tclPathObj.c:1236:1: */
	var count int32 = 0
	switch XtclPlatform {
	case TCL_PLATFORM_UNIX:
		for int32(*(*int8)(unsafe.Pointer(path + uintptr(count)))) != 0 {
			if int32(*(*int8)(unsafe.Pointer(path + uintptr(count)))) == separator {
				return count
			}
			count++
		}
		break

	case TCL_PLATFORM_WINDOWS:
		for int32(*(*int8)(unsafe.Pointer(path + uintptr(count)))) != 0 {
			if int32(*(*int8)(unsafe.Pointer(path + uintptr(count)))) == separator || int32(*(*int8)(unsafe.Pointer(path + uintptr(count)))) == '\\' {
				return count
			}
			count++
		}
		break
	}
	return count
}

//---------------------------------------------------------------------------
//
// TclNewFSPathObj --
//
//	Creates a path object whose string representation is '[file join
//	dirPtr addStrRep]', but does so in a way that allows for more
//	efficient creation and caching of normalized paths, and more efficient
//	'file dirname', 'file tail', etc.
//
// Assumptions:
//	'dirPtr' must be an absolute path. 'len' may not be zero.
//
// Results:
//	The new Tcl object, with refCount zero.
//
// Side effects:
//	Memory is allocated. 'dirPtr' gets an additional refCount.
//
//---------------------------------------------------------------------------

func XTclNewFSPathObj(tls *libc.TLS, dirPtr uintptr, addStrRep uintptr, len int32) uintptr { /* tclPathObj.c:1285:9: */
	var fsPathPtr uintptr
	var pathPtr uintptr
	var p uintptr
	var state int32 = 0
	var count int32 = 0

	// [Bug 2806250] - this is only a partial solution of the problem.
	// The PATHFLAGS != 0 representation assumes in many places that
	// the "tail" part stored in the normPathPtr field is itself a
	// relative path.  Strings that begin with "~" are not relative paths,
	// so we must prevent their storage in the normPathPtr field.
	//
	// More generally we ought to be testing "addStrRep" for any value
	// that is not a relative path, but in an unconstrained VFS world
	// that could be just about anything, and testing could be expensive.
	// Since this routine plays a big role in [glob], anything that slows
	// it down would be unwelcome.  For now, continue the risk of further
	// bugs when some Tcl_Filesystem uses otherwise relative path strings
	// as absolute path strings.  Sensible Tcl_Filesystems will avoid
	// that by mounting on path prefixes like foo:// which cannot be the
	// name of a file or directory read from a native [glob] operation.
	if int32(*(*int8)(unsafe.Pointer(addStrRep))) == '~' {
		var tail uintptr = XTcl_NewStringObj(tls, addStrRep, len)

		pathPtr = sAppendPath(tls, dirPtr, tail)
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = tail
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return pathPtr
	}

	pathPtr = XTcl_NewObj(tls)
	fsPathPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FsPath{})))

	// Set up the path.

	(*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr = uintptr(0)
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr = XTcl_NewStringObj(tls, addStrRep, len)
	(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FrefCount++
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr = dirPtr
	(*Tcl_Obj)(unsafe.Pointer(dirPtr)).FrefCount++
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FnativePathPtr = uintptr(0)
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FfsPtr = uintptr(0)
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FfilesystemEpoch = 0

	*(*uintptr)(unsafe.Pointer(pathPtr + 32)) = fsPathPtr
	(*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).Fflags = TCLPATH_APPENDED
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr = uintptr(unsafe.Pointer(&tclFsPathType))
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes = uintptr(0)
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).Flength = 0

	// Look for path components made up of only "."
	// This is overly conservative analysis to keep simple. It may mark some
	// things as needing more aggressive normalization that don't actually
	// need it. No harm done.
	p = addStrRep
__1:
	if !(len > 0) {
		goto __3
	}
	{
		switch state {
		case 0: // So far only "." since last dirsep or start
			switch int32(*(*int8)(unsafe.Pointer(p))) {
			case '.':
				count++
				break
			case '/':
				fallthrough
			case '\\':
				fallthrough
			case ':':
				if count != 0 {
					*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)) + 24)) |= TCLPATH_NEEDNORM
					len = 0
				}
				break
			default:
				count = 0
				state = 1
			}
			break
		case 1: // Scanning for next dirsep
			switch int32(*(*int8)(unsafe.Pointer(p))) {
			case '/':
				fallthrough
			case '\\':
				fallthrough
			case ':':
				state = 0
				break
			}
		}

	}
	goto __2
__2:
	p++
	len--
	goto __1
	goto __3
__3:
	;
	if len == 0 && count != 0 {
		*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)) + 24)) |= TCLPATH_NEEDNORM
	}

	return pathPtr
}

func sAppendPath(tls *libc.TLS, head uintptr, tail uintptr) uintptr { /* tclPathObj.c:1385:16: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var numBytes int32 at bp, 4

	var bytes uintptr
	var copy uintptr = XTcl_DuplicateObj(tls, head)

	// This is likely buggy when dealing with virtual filesystem drivers
	// that use some character other than "/" as a path separator.  I know
	// of no evidence that such a foolish thing exists.  This solution was
	// chosen so that "JoinPath" operations that pass through either path
	// internalrep produce the same results; that is, bugward compatibility.  If
	// we need to fix that bug here, it needs fixing in TclJoinPath() too.
	bytes = XTcl_GetStringFromObj(tls, tail, bp)
	if *(*int32)(unsafe.Pointer(bp)) == 0 {
		XTcl_AppendToObj(tls, copy, ts+5792, 1)
	} else {
		XTclpNativeJoinPath(tls, copy, bytes)
	}
	return copy
}

//---------------------------------------------------------------------------
//
// TclFSMakePathRelative --
//
//	Only for internal use.
//
//	Takes a path and a directory, where we _assume_ both path and
//	directory are absolute, normalized and that the path lies inside the
//	directory. Returns a Tcl_Obj representing filename of the path
//	relative to the directory.
//
// Results:
//	NULL on error, otherwise a valid object, typically with refCount of
//	zero, which it is assumed the caller will increment.
//
// Side effects:
//	The old representation may be freed, and new memory allocated.
//
//---------------------------------------------------------------------------

func XTclFSMakePathRelative(tls *libc.TLS, interp uintptr, pathPtr uintptr, cwdPtr uintptr) uintptr { /* tclPathObj.c:1433:9: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var cwdLen int32 at bp, 4

	// var len int32 at bp+4, 4

	var tempStr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr == uintptr(unsafe.Pointer(&tclFsPathType)) {
		var fsPathPtr uintptr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))

		if (*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).Fflags != 0 && (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr == cwdPtr {
			return (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr
		}
	}

	// We know the cwd is a normalised object which does not end in a
	// directory delimiter, unless the cwd is the name of a volume, in which
	// case it will end in a delimiter! We handle this situation here. A
	// better test than the '!= sep' might be to simply check if 'cwd' is a
	// root volume.
	//
	// Note that if we get this wrong, we will strip off either too much or
	// too little below, leading to wrong answers returned by glob.

	tempStr = XTcl_GetStringFromObj(tls, cwdPtr, bp)

	// Should we perhaps use 'Tcl_FSPathSeparator'? But then what about the
	// Windows special case? Perhaps we should just check if cwd is a root
	// volume.

	switch XtclPlatform {
	case TCL_PLATFORM_UNIX:
		if int32(*(*int8)(unsafe.Pointer(tempStr + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) != '/' {
			*(*int32)(unsafe.Pointer(bp /* cwdLen */))++
		}
		break
	case TCL_PLATFORM_WINDOWS:
		if int32(*(*int8)(unsafe.Pointer(tempStr + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) != '/' && int32(*(*int8)(unsafe.Pointer(tempStr + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) != '\\' {
			*(*int32)(unsafe.Pointer(bp /* cwdLen */))++
		}
		break
	}
	tempStr = XTcl_GetStringFromObj(tls, pathPtr, bp+4)

	return XTcl_NewStringObj(tls, tempStr+uintptr(*(*int32)(unsafe.Pointer(bp))), *(*int32)(unsafe.Pointer(bp + 4))-*(*int32)(unsafe.Pointer(bp)))
}

//---------------------------------------------------------------------------
//
// MakePathFromNormalized --
//
//	Like SetFsPathFromAny, but assumes the given object is an absolute
//	normalized path. Only for internal use.
//
// Results:
//	Standard Tcl error code.
//
// Side effects:
//	The old representation may be freed, and new memory allocated.
//
//---------------------------------------------------------------------------

func sMakePathFromNormalized(tls *libc.TLS, interp uintptr, pathPtr uintptr) int32 { /* tclPathObj.c:1504:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var fsPathPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr == uintptr(unsafe.Pointer(&tclFsPathType)) {
		return TCL_OK
	}

	// Free old representation

	if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes == uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr)).FupdateStringProc == uintptr(0) {
				if interp != uintptr(0) {
					XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
						ts+54862, -1))
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+6915, ts+54902, ts+54907,
						uintptr(0)))
				}
				return TCL_ERROR
			}
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr)).FupdateStringProc})).f(tls, pathPtr)
		}
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, pathPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr = uintptr(0)
		}

	}

	fsPathPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FsPath{})))

	// It's a pure normalized absolute path.

	(*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr = uintptr(0)

	// Circular reference by design.

	(*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr = pathPtr
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr = uintptr(0)
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FnativePathPtr = uintptr(0)
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FfsPtr = uintptr(0)
	// Remember the epoch under which we decided pathPtr was normalized
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FfilesystemEpoch = int32(XTclFSEpoch(tls))

	*(*uintptr)(unsafe.Pointer(pathPtr + 32)) = fsPathPtr
	(*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).Fflags = 0
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr = uintptr(unsafe.Pointer(&tclFsPathType))

	return TCL_OK
}

//---------------------------------------------------------------------------
//
// Tcl_FSNewNativePath --
//
//	This function performs the something like the reverse of the usual
//	obj->path->nativerep conversions. If some code retrieves a path in
//	native form (from, e.g. readlink or a native dialog), and that path is
//	to be used at the Tcl level, then calling this function is an
//	efficient way of creating the appropriate path object type.
//
//	Any memory which is allocated for 'clientData' should be retained
//	until clientData is passed to the filesystem's freeInternalRepProc
//	when it can be freed. The built in platform-specific filesystems use
//	'ckalloc' to allocate clientData, and ckfree to free it.
//
// Results:
//	NULL or a valid path object pointer, with refCount zero.
//
// Side effects:
//	New memory may be allocated.
//
//---------------------------------------------------------------------------

func XTcl_FSNewNativePath(tls *libc.TLS, fromFilesystem uintptr, clientData ClientData) uintptr { /* tclPathObj.c:1585:9: */
	var pathPtr uintptr = uintptr(0)
	var fsPathPtr uintptr

	if (*Tcl_Filesystem)(unsafe.Pointer(fromFilesystem)).FinternalToNormalizedProc != uintptr(0) {
		pathPtr = (*struct {
			f func(*libc.TLS, ClientData) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_Filesystem)(unsafe.Pointer(fromFilesystem)).FinternalToNormalizedProc})).f(tls, clientData)
	}
	if pathPtr == uintptr(0) {
		return uintptr(0)
	}

	// Free old representation; shouldn't normally be any, but best to be
	// safe.

	if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes == uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr)).FupdateStringProc == uintptr(0) {
				return uintptr(0)
			}
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr)).FupdateStringProc})).f(tls, pathPtr)
		}
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, pathPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr = uintptr(0)
		}

	}

	fsPathPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FsPath{})))

	(*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr = uintptr(0)

	// Circular reference, by design.

	(*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr = pathPtr
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr = uintptr(0)
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FnativePathPtr = clientData
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FfsPtr = fromFilesystem
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FfilesystemEpoch = int32(XTclFSEpoch(tls))

	*(*uintptr)(unsafe.Pointer(pathPtr + 32)) = fsPathPtr
	(*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).Fflags = 0
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr = uintptr(unsafe.Pointer(&tclFsPathType))

	return pathPtr
}

//---------------------------------------------------------------------------
//
// Tcl_FSGetTranslatedPath --
//
//	This function attempts to extract the translated path from the given
//	Tcl_Obj. If the translation succeeds (i.e. the object is a valid
//	path), then it is returned. Otherwise NULL will be returned, and an
//	error message may be left in the interpreter (if it is non-NULL)
//
// Results:
//	NULL or a valid Tcl_Obj pointer.
//
// Side effects:
//	Only those of 'Tcl_FSConvertToPathType'
//
//---------------------------------------------------------------------------

func XTcl_FSGetTranslatedPath(tls *libc.TLS, interp uintptr, pathPtr uintptr) uintptr { /* tclPathObj.c:1656:9: */
	var retObj uintptr = uintptr(0)
	var srcFsPathPtr uintptr

	if XTcl_FSConvertToPathType(tls, interp, pathPtr) != TCL_OK {
		return uintptr(0)
	}
	srcFsPathPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))
	if (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FtranslatedPathPtr == uintptr(0) {
		if (*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).Fflags != 0 {
			// We lack a translated path result, but we have a directory
			// (cwdPtr) and a tail (normPathPtr), and if we join the
			// translated version of cwdPtr to normPathPtr, we'll get the
			// translated result we need, and can store it for future use.

			var translatedCwdPtr uintptr = XTcl_FSGetTranslatedPath(tls, interp,
				(*FsPath)(unsafe.Pointer(srcFsPathPtr)).FcwdPtr)
			if translatedCwdPtr == uintptr(0) {
				return uintptr(0)
			}

			retObj = XTcl_FSJoinToPath(tls, translatedCwdPtr, 1,
				srcFsPathPtr+8)
			(*FsPath)(unsafe.Pointer(srcFsPathPtr)).FtranslatedPathPtr = retObj
			if (*Tcl_Obj)(unsafe.Pointer(translatedCwdPtr)).FtypePtr == uintptr(unsafe.Pointer(&tclFsPathType)) {
				(*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfilesystemEpoch = (*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(translatedCwdPtr + 32)))).FfilesystemEpoch
			} else {
				(*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfilesystemEpoch = 0
			}
			(*Tcl_Obj)(unsafe.Pointer(retObj)).FrefCount++
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = translatedCwdPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		} else {
			// It is a pure absolute, normalized path object. This is
			// something like being a 'pure list'. The object's string,
			// translatedPath and normalizedPath are all identical.

			retObj = (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FnormPathPtr
		}
	} else {
		// It is an ordinary path object.

		retObj = (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FtranslatedPathPtr
	}

	if retObj != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer(retObj)).FrefCount++
	}
	return retObj
}

//---------------------------------------------------------------------------
//
// Tcl_FSGetTranslatedStringPath --
//
//	This function attempts to extract the translated path from the given
//	Tcl_Obj. If the translation succeeds (i.e. the object is a valid
//	path), then the path is returned. Otherwise NULL will be returned, and
//	an error message may be left in the interpreter (if it is non-NULL)
//
// Results:
//	NULL or a valid string.
//
// Side effects:
//	Only those of 'Tcl_FSConvertToPathType'
//
//---------------------------------------------------------------------------

func XTcl_FSGetTranslatedStringPath(tls *libc.TLS, interp uintptr, pathPtr uintptr) uintptr { /* tclPathObj.c:1736:12: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var transPtr uintptr = XTcl_FSGetTranslatedPath(tls, interp, pathPtr)

	if transPtr != uintptr(0) {
		// var len int32 at bp, 4

		var orig uintptr = XTcl_GetStringFromObj(tls, transPtr, bp)
		var result uintptr = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp))+1))

		libc.Xmemcpy(tls, result, orig, uint64(*(*int32)(unsafe.Pointer(bp))+1))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(transPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(transPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(transPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(transPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(transPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(transPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(transPtr)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, transPtr)
					} else {
						*(*uintptr)(unsafe.Pointer(transPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = transPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, transPtr)
			}
		}

		return result
	}

	return uintptr(0)
}

//---------------------------------------------------------------------------
//
// Tcl_FSGetNormalizedPath --
//
//	This important function attempts to extract from the given Tcl_Obj a
//	unique normalised path representation, whose string value can be used
//	as a unique identifier for the file.
//
// Results:
//	NULL or a valid path object pointer.
//
// Side effects:
//	New memory may be allocated. The Tcl 'errno' may be modified in the
//	process of trying to examine various path possibilities.
//
//---------------------------------------------------------------------------

func XTcl_FSGetNormalizedPath(tls *libc.TLS, interp uintptr, pathPtr uintptr) uintptr { /* tclPathObj.c:1775:9: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var fsPathPtr uintptr

	if XTcl_FSConvertToPathType(tls, interp, pathPtr) != TCL_OK {
		return uintptr(0)
	}
	fsPathPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))

	if (*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).Fflags != 0 {
		// This is a special path object which is the result of something like
		// 'file join'

		var dir uintptr
		var copy uintptr
		// var tailLen int32 at bp, 4

		// var cwdLen int32 at bp+4, 4

		var pathType int32

		pathType = int32(XTcl_FSGetPathType(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr))
		dir = XTcl_FSGetNormalizedPath(tls, interp, (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)
		if dir == uintptr(0) {
			return uintptr(0)
		}
		// TODO: Figure out why this is needed.
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes == uintptr(0) {
			sUpdateStringOfFsPath(tls, pathPtr)
		}

		XTcl_GetStringFromObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr, bp)
		if *(*int32)(unsafe.Pointer(bp)) != 0 {
			copy = sAppendPath(tls, dir, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)
		} else {
			copy = XTcl_DuplicateObj(tls, dir)
		}
		(*Tcl_Obj)(unsafe.Pointer(dir)).FrefCount++
		(*Tcl_Obj)(unsafe.Pointer(copy)).FrefCount++

		// We now own a reference on both 'dir' and 'copy'

		XTcl_GetStringFromObj(tls, dir, bp+4)

		// Normalize the combined string.

		if (*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).Fflags&TCLPATH_NEEDNORM != 0 {
			// If the "tail" part has components (like /../) that cause the
			// combined path to need more complete normalizing, call on the
			// more powerful routine to accomplish that so we avoid [Bug
			// 2385549] ...

			var newCopy uintptr = XTclFSNormalizeAbsolutePath(tls, interp, copy)

			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = copy
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			copy = newCopy
		} else {
			// ... but in most cases where we join a trouble free tail to a
			// normalized head, we can more efficiently normalize the combined
			// path by passing over only the unnormalized tail portion. When
			// this is sufficient, prior developers claim this should be much
			// faster. We use 'cwdLen' so that we are already pointing at
			// the dir-separator that we know about. The normalization code
			// will actually start off directly after that separator.

			XTclFSNormalizeToUniquePath(tls, interp, copy, *(*int32)(unsafe.Pointer(bp + 4 /* cwdLen */)))
		}

		// Now we need to construct the new path object.

		if pathType == TCL_PATH_RELATIVE {
			var origDir uintptr = (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr

			// NOTE: here we are (dangerously?) assuming that origDir points
			// to a Tcl_Obj with Tcl_ObjType == &tclFsPathType. The
			//     pathType = Tcl_FSGetPathType(fsPathPtr->cwdPtr);
			// above that set the pathType value should have established that,
			// but it's far less clear on what basis we know there's been no
			// shimmering since then.

			var origDirFsPathPtr uintptr = *(*uintptr)(unsafe.Pointer(origDir + 32))

			(*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr = (*FsPath)(unsafe.Pointer(origDirFsPathPtr)).FcwdPtr
			(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).FrefCount++

			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Flength = -1
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)
						} else {
							*(*uintptr)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)
				}
			}

			(*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr = copy

			// That's our reference to copy used.

			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dir)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(dir)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dir)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(dir)).Flength = -1
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, dir)
						} else {
							*(*uintptr)(unsafe.Pointer(dir + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dir
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, dir)
				}
			}

			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(origDir)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(origDir)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(origDir)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(origDir)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(origDir)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(origDir)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(origDir)).Flength = -1
					for ok3 := true; ok3; ok3 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, origDir)
						} else {
							*(*uintptr)(unsafe.Pointer(origDir + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = origDir
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, origDir)
				}
			}

		} else {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).Flength = -1
					for ok4 := true; ok4; ok4 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)
						} else {
							*(*uintptr)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)
				}
			}

			(*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr = uintptr(0)
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Flength = -1
					for ok5 := true; ok5; ok5 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)
						} else {
							*(*uintptr)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)
				}
			}

			(*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr = copy

			// That's our reference to copy used.

			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(dir)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(dir)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(dir)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(dir)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(dir)).Flength = -1
					for ok6 := true; ok6; ok6 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, dir)
						} else {
							*(*uintptr)(unsafe.Pointer(dir + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dir
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, dir)
				}
			}

		}
		(*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).Fflags = 0
	}

	// Ensure cwd hasn't changed.

	if (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr != uintptr(0) {
		if !(XTclFSCwdPointerEquals(tls, fsPathPtr+16) != 0) {
			if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes == uintptr(0) {
				sUpdateStringOfFsPath(tls, pathPtr)
			}
			sFreeFsPathInternalRep(tls, pathPtr)
			if sSetFsPathFromAny(tls, interp, pathPtr) != TCL_OK {
				return uintptr(0)
			}
			fsPathPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))
		} else if (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr == uintptr(0) {
			// var cwdLen int32 at bp+8, 4

			var copy uintptr

			copy = sAppendPath(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr, pathPtr)

			XTcl_GetStringFromObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr, bp+8)
			*(*int32)(unsafe.Pointer(bp + 8 /* cwdLen */)) += libc.Bool32(int32(*(*int8)(unsafe.Pointer(XTcl_GetString(tls, copy) + uintptr(*(*int32)(unsafe.Pointer(bp + 8)))))) == '/')

			// Normalize the combined string, but only starting after the end
			// of the previously normalized 'dir'. This should be much faster!

			XTclFSNormalizeToUniquePath(tls, interp, copy, *(*int32)(unsafe.Pointer(bp + 8))-1)
			(*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr = copy
			(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FrefCount++
		}
	}
	if (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr == uintptr(0) {
		var useThisCwd uintptr = uintptr(0)
		var pureNormalized int32 = 1

		// Since normPathPtr is NULL, but this is a valid path object, we know
		// that the translatedPathPtr cannot be NULL.

		*(*uintptr)(unsafe.Pointer(bp + 16 /* absolutePath */)) = (*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr
		var path uintptr = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
		}()

		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++

		// We have to be a little bit careful here to avoid infinite loops
		// we're asking Tcl_FSGetPathType to return the path's type, but that
		// call can actually result in a lot of other filesystem action, which
		// might loop back through here.

		if int32(*(*int8)(unsafe.Pointer(path))) == 0 {
			// Special handling for the empty string value. This one is very
			// weird with [file normalize {}] => {}. (The reasoning supporting
			// this is unknown to DGP, but he fears changing it.) Attempt here
			// to keep the expectations of other parts of Tcl_Filesystem code
			// about state of the FsPath fields satisfied.
			//
			// In particular, capture the cwd value and save so it can be
			// stored in the cwdPtr field below.

			useThisCwd = XTcl_FSGetCwd(tls, interp)
		} else {
			// We don't ask for the type of 'pathPtr' here, because that is
			// not correct for our purposes when we have a path like '~'. Tcl
			// has a bit of a contradiction in that '~' paths are defined as
			// 'absolute', but in reality can be just about anything,
			// depending on how env(HOME) is set.

			var type1 Tcl_PathType = XTcl_FSGetPathType(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* absolutePath */)))

			if type1 == TCL_PATH_RELATIVE {
				useThisCwd = XTcl_FSGetCwd(tls, interp)

				if useThisCwd == uintptr(0) {
					return uintptr(0)
				}

				pureNormalized = 0
				for ok7 := true; ok7; ok7 = 0 != 0 {
					var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 16))
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				*(*uintptr)(unsafe.Pointer(bp + 16 /* absolutePath */)) = XTcl_FSJoinToPath(tls, useThisCwd, 1, bp+16)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++

				// We have a refCount on the cwd.
			}
		}

		// Already has refCount incremented.

		(*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr = XTclFSNormalizeAbsolutePath(tls, interp,
			*(*uintptr)(unsafe.Pointer(bp + 16 /* absolutePath */)))

		// Check if path is pure normalized (this can only be the case if it
		// is an absolute path).

		if pureNormalized != 0 {
			// var normPathLen int32 at bp+28, 4

			// var pathLen int32 at bp+24, 4

			var normPath uintptr

			path = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
					return func() uintptr {
						*(*int32)(unsafe.Pointer(bp + 24)) = (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Flength
						return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
					}()
				}
				return XTcl_GetStringFromObj(tls, pathPtr, bp+24)
			}()
			normPath = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes != 0 {
					return func() uintptr {
						*(*int32)(unsafe.Pointer(bp + 28)) = (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Flength
						return (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes
					}()
				}
				return XTcl_GetStringFromObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr, bp+28)
			}()
			if *(*int32)(unsafe.Pointer(bp + 24)) == *(*int32)(unsafe.Pointer(bp + 28)) && !(libc.Xmemcmp(tls, path, normPath, uint64(*(*int32)(unsafe.Pointer(bp + 24)))) != 0) {
				// The path was already normalized. Get rid of the duplicate.

				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Flength = -1
						for ok8 := true; ok8; ok8 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)
							} else {
								*(*uintptr)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)
					}
				}

				// We do *not* increment the refCount for this circular
				// reference.

				(*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr = pathPtr
			}
		}
		if useThisCwd != uintptr(0) {
			// We just need to free an object we allocated above for relative
			// paths (this was returned by Tcl_FSJoinToPath above), and then
			// of course store the cwd.

			(*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr = useThisCwd
		}
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = -1
				for ok9 := true; ok9; ok9 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
					} else {
						*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* absolutePath */)))
			}
		}

	}

	return (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr
}

//---------------------------------------------------------------------------
//
// Tcl_FSGetInternalRep --
//
//	Extract the internal representation of a given path object, in the
//	given filesystem. If the path object belongs to a different
//	filesystem, we return NULL.
//
//	If the internal representation is currently NULL, we attempt to
//	generate it, by calling the filesystem's
//	'Tcl_FSCreateInternalRepProc'.
//
// Results:
//	NULL or a valid internal representation.
//
// Side effects:
//	An attempt may be made to convert the object.
//
//---------------------------------------------------------------------------

func XTcl_FSGetInternalRep(tls *libc.TLS, pathPtr uintptr, fsPtr uintptr) ClientData { /* tclPathObj.c:2073:1: */
	var srcFsPathPtr uintptr

	if XTcl_FSConvertToPathType(tls, uintptr(0), pathPtr) != TCL_OK {
		return uintptr(0)
	}
	srcFsPathPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))

	// We will only return the native representation for the caller's
	// filesystem. Otherwise we will simply return NULL. This means that there
	// must be a unique bi-directional mapping between paths and filesystems,
	// and that this mapping will not allow 'remapped' files -- files which
	// are in one filesystem but mapped into another. Another way of putting
	// this is that 'stacked' filesystems are not allowed. We recognise that
	// this is a potentially useful feature for the future.
	//
	// Even something simple like a 'pass through' filesystem which logs all
	// activity and passes the calls onto the native system would be nice, but
	// not easily achievable with the current implementation.

	if (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfsPtr == uintptr(0) {
		// This only usually happens in wrappers like TclpStat which create a
		// string object and pass it to TclpObjStat. Code which calls the
		// Tcl_FS.. functions should always have a filesystem already set.
		// Whether this code path is legal or not depends on whether we decide
		// to allow external code to call the native filesystem directly. It
		// is at least safer to allow this sub-optimal routing.

		XTcl_FSGetFileSystemForPath(tls, pathPtr)

		// If we fail through here, then the path is probably not a valid path
		// in the filesystsem, and is most likely to be a use of the empty
		// path "" via a direct call to one of the objectified interfaces
		// (e.g. from the Tcl testsuite).

		srcFsPathPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))
		if (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfsPtr == uintptr(0) {
			return uintptr(0)
		}
	}

	// There is still one possibility we should consider; if the file belongs
	// to a different filesystem, perhaps it is actually linked through to a
	// file in our own filesystem which we do care about. The way we can check
	// for this is we ask what filesystem this path belongs to.

	if fsPtr != (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfsPtr {
		var actualFs uintptr = XTcl_FSGetFileSystemForPath(tls, pathPtr)

		if actualFs == fsPtr {
			return XTcl_FSGetInternalRep(tls, pathPtr, fsPtr)
		}
		return uintptr(0)
	}

	if (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FnativePathPtr == uintptr(0) {
		var proc uintptr
		var nativePathPtr uintptr

		proc = (*Tcl_Filesystem)(unsafe.Pointer((*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfsPtr)).FcreateInternalRepProc
		if proc == uintptr(0) {
			return uintptr(0)
		}

		nativePathPtr = (*struct {
			f func(*libc.TLS, uintptr) ClientData
		})(unsafe.Pointer(&struct{ uintptr }{proc})).f(tls, pathPtr)
		srcFsPathPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))
		(*FsPath)(unsafe.Pointer(srcFsPathPtr)).FnativePathPtr = nativePathPtr
		(*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfilesystemEpoch = int32(XTclFSEpoch(tls))
	}

	return (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FnativePathPtr
}

//---------------------------------------------------------------------------
//
// TclFSEnsureEpochOk --
//
//	This will ensure the pathPtr is up to date and can be converted into a
//	"path" type, and that we are able to generate a complete normalized
//	path which is used to determine the filesystem match.
//
// Results:
//	Standard Tcl return code.
//
// Side effects:
//	An attempt may be made to convert the object.
//
//---------------------------------------------------------------------------

func XTclFSEnsureEpochOk(tls *libc.TLS, pathPtr uintptr, fsPtrPtr uintptr) int32 { /* tclPathObj.c:2176:1: */
	var srcFsPathPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr != uintptr(unsafe.Pointer(&tclFsPathType)) {
		return TCL_OK
	}

	srcFsPathPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))

	// Check if the filesystem has changed in some way since this object's
	// internal representation was calculated.

	if !(XTclFSEpochOk(tls, uint64((*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfilesystemEpoch)) != 0) {
		// We have to discard the stale representation and recalculate it.

		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes == uintptr(0) {
			sUpdateStringOfFsPath(tls, pathPtr)
		}
		sFreeFsPathInternalRep(tls, pathPtr)
		if sSetFsPathFromAny(tls, uintptr(0), pathPtr) != TCL_OK {
			return TCL_ERROR
		}
		srcFsPathPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))
	}

	// Check whether the object is already assigned to a fs.

	if (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfsPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(fsPtrPtr)) = (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfsPtr
	}
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// TclFSSetPathDetails --
//
//	???
//
// Results:
//	None
//
// Side effects:
//	???
//
//---------------------------------------------------------------------------

func XTclFSSetPathDetails(tls *libc.TLS, pathPtr uintptr, fsPtr uintptr, clientData ClientData) { /* tclPathObj.c:2235:1: */
	var srcFsPathPtr uintptr

	// Make sure pathPtr is of the correct type.

	if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr != uintptr(unsafe.Pointer(&tclFsPathType)) {
		if sSetFsPathFromAny(tls, uintptr(0), pathPtr) != TCL_OK {
			return
		}
	}

	srcFsPathPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))
	(*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfsPtr = fsPtr
	(*FsPath)(unsafe.Pointer(srcFsPathPtr)).FnativePathPtr = clientData
	(*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfilesystemEpoch = int32(XTclFSEpoch(tls))
}

//---------------------------------------------------------------------------
//
// Tcl_FSEqualPaths --
//
//	This function tests whether the two paths given are equal path
//	objects. If either or both is NULL, 0 is always returned.
//
// Results:
//	1 or 0.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_FSEqualPaths(tls *libc.TLS, firstPtr uintptr, secondPtr uintptr) int32 { /* tclPathObj.c:2276:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var firstStr uintptr
	var secondStr uintptr
	// var firstLen int32 at bp, 4

	// var secondLen int32 at bp+4, 4

	var tempErrno int32

	if firstPtr == secondPtr {
		return 1
	}

	if firstPtr == uintptr(0) || secondPtr == uintptr(0) {
		return 0
	}
	firstStr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(firstPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(firstPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(firstPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, firstPtr, bp)
	}()
	secondStr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(secondPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 4)) = (*Tcl_Obj)(unsafe.Pointer(secondPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(secondPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, secondPtr, bp+4)
	}()
	if *(*int32)(unsafe.Pointer(bp)) == *(*int32)(unsafe.Pointer(bp + 4)) && !(libc.Xmemcmp(tls, firstStr, secondStr, uint64(*(*int32)(unsafe.Pointer(bp)))) != 0) {
		return 1
	}

	// Try the most thorough, correct method of comparing fully normalized
	// paths.

	tempErrno = XTcl_GetErrno(tls)
	firstPtr = XTcl_FSGetNormalizedPath(tls, uintptr(0), firstPtr)
	secondPtr = XTcl_FSGetNormalizedPath(tls, uintptr(0), secondPtr)
	XTcl_SetErrno(tls, tempErrno)

	if firstPtr == uintptr(0) || secondPtr == uintptr(0) {
		return 0
	}

	firstStr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(firstPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(firstPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(firstPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, firstPtr, bp)
	}()
	secondStr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(secondPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 4)) = (*Tcl_Obj)(unsafe.Pointer(secondPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(secondPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, secondPtr, bp+4)
	}()
	return libc.Bool32(*(*int32)(unsafe.Pointer(bp)) == *(*int32)(unsafe.Pointer(bp + 4)) && !(libc.Xmemcmp(tls, firstStr, secondStr, uint64(*(*int32)(unsafe.Pointer(bp)))) != 0))
}

//---------------------------------------------------------------------------
//
// SetFsPathFromAny --
//
//	This function tries to convert the given Tcl_Obj to a valid Tcl path
//	type.
//
//	The filename may begin with "~" (to indicate current user's home
//	directory) or "~<user>" (to indicate any user's home directory).
//
// Results:
//	Standard Tcl error code.
//
// Side effects:
//	The old representation may be freed, and new memory allocated.
//
//---------------------------------------------------------------------------

func sSetFsPathFromAny(tls *libc.TLS, interp uintptr, pathPtr uintptr) int32 { /* tclPathObj.c:2336:1: */
	bp := tls.Alloc(792)
	defer tls.Free(792)
	*(*uintptr)(unsafe.Pointer(bp + 784)) = pathPtr

	// var len int32 at bp+88, 4

	var fsPathPtr uintptr
	var transPtr uintptr
	var name uintptr

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 784)))).FtypePtr == uintptr(unsafe.Pointer(&tclFsPathType)) {
		return TCL_OK
	}

	// First step is to translate the filename. This is similar to
	// Tcl_TranslateFilename, but shouldn't convert everything to windows
	// backslashes on that platform. The current implementation of this piece
	// is a slightly optimised version of the various Tilde/Split/Join stuff
	// to avoid multiple split/join operations.
	//
	// We remove any trailing directory separator.
	//
	// However, the split/join routines are quite complex, and one has to make
	// sure not to break anything on Unix or Win (fCmd.test, fileName.test and
	// cmdAH.test exercise most of the code).

	name = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 784 /* pathPtr */)), bp+88)

	// Handle tilde substitutions, if needed.

	if *(*int32)(unsafe.Pointer(bp + 88)) != 0 && int32(*(*int8)(unsafe.Pointer(name))) == '~' {
		// var temp Tcl_DString at bp+312, 216

		var split int32
		var separator int8 = int8('/')

		// We have multiple cases '~/foo/bar...', '~user/foo/bar...', etc.
		// split becomes value 1 for '~/...' as well as for '~'.
		split = sFindSplitPos(tls, name, int32(separator))

		// Do some tilde substitution.

		if split == 1 {
			// We have just '~' (or '~/...')

			// var dir uintptr at bp+528, 8

			// var dirString Tcl_DString at bp+96, 216

			*(*uintptr)(unsafe.Pointer(bp + 528 /* dir */)) = XTclGetEnv(tls, ts+27235, bp+96)
			if *(*uintptr)(unsafe.Pointer(bp + 528)) == uintptr(0) {
				if interp != 0 {
					XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

						ts+30769, -1))
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+6915, ts+54902,
						ts+54911, uintptr(0)))
				}
				return TCL_ERROR
			}
			XTcl_DStringInit(tls, bp+312)
			XTcl_JoinPath(tls, 1, bp+528, bp+312)
			XTcl_DStringFree(tls, bp+96)
		} else {
			// We have a user name '~user'

			var expandedUser uintptr
			// var userName Tcl_DString at bp+536, 216

			XTcl_DStringInit(tls, bp+536)
			XTcl_DStringAppend(tls, bp+536, name+uintptr(1), split-1)
			expandedUser = (*Tcl_DString)(unsafe.Pointer(bp + 536)).Fstring

			XTcl_DStringInit(tls, bp+312)
			if XTclpGetUserHome(tls, expandedUser, bp+312) == uintptr(0) {
				if interp != uintptr(0) {
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
						ts+30841, libc.VaList(bp+40, expandedUser)))
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+6915, ts+54902, ts+54920,
						uintptr(0)))
				}
				XTcl_DStringFree(tls, bp+536)
				XTcl_DStringFree(tls, bp+312)
				return TCL_ERROR
			}
			XTcl_DStringFree(tls, bp+536)
		}

		transPtr = XTclDStringToObj(tls, bp+312)

		if split != *(*int32)(unsafe.Pointer(bp + 88)) {
			// Join up the tilde substitution with the rest.

			if int32(*(*int8)(unsafe.Pointer(name + uintptr(split+1)))) == int32(separator) {
				// Somewhat tricky case like ~//foo/bar. Make use of
				// Split/Join machinery to get it right. Assumes all paths
				// beginning with ~ are part of the native filesystem.

				// var objc int32 at bp+752, 4

				// var objv uintptr at bp+760, 8

				var parts uintptr = XTclpNativeSplitPath(tls, *(*uintptr)(unsafe.Pointer(bp + 784 /* pathPtr */)), uintptr(0))

				XTcl_ListObjGetElements(tls, uintptr(0), parts, bp+752, bp+760)

				// Skip '~'. It's replaced by its expansion.

				*(*int32)(unsafe.Pointer(bp + 752 /* objc */))--
				*(*uintptr)(unsafe.Pointer(bp + 760 /* objv */)) += 8
				for libc.PostDecInt32(&*(*int32)(unsafe.Pointer(bp + 752)), 1) != 0 {
					XTclpNativeJoinPath(tls, transPtr, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 760 /* objv */)), 8)))))
				}
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(parts)).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer(parts)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(parts)).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer(parts)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(parts)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(parts)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer(parts)).Flength = -1
						for ok := true; ok; ok = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, parts)
							} else {
								*(*uintptr)(unsafe.Pointer(parts + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = parts
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, parts)
					}
				}

			} else {
				// var pair [2]uintptr at bp+768, 16

				*(*uintptr)(unsafe.Pointer(bp + 768)) = transPtr
				*(*uintptr)(unsafe.Pointer(bp + 768 + 1*8)) = XTcl_NewStringObj(tls, name+uintptr(split)+uintptr(1), -1)
				transPtr = XTclJoinPath(tls, 2, bp+768, 1)
				if transPtr != *(*uintptr)(unsafe.Pointer(bp + 768)) {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 768))
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
				}
				if transPtr != *(*uintptr)(unsafe.Pointer(bp + 768 + 1*8)) {
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 768 + 1*8))
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
				}
			}
		}
	} else {
		transPtr = XTclJoinPath(tls, 1, bp+784, 1)
	}

	// Now we have a translated filename in 'transPtr'. This will have forward
	// slashes on Windows, and will not contain any ~user sequences.

	fsPathPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FsPath{})))

	(*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr = transPtr
	if transPtr != *(*uintptr)(unsafe.Pointer(bp + 784)) {
		(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr)).FrefCount++
		// Redo translation when $env(HOME) changes
		(*FsPath)(unsafe.Pointer(fsPathPtr)).FfilesystemEpoch = int32(XTclFSEpoch(tls))
	} else {
		(*FsPath)(unsafe.Pointer(fsPathPtr)).FfilesystemEpoch = 0
	}
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr = uintptr(0)
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr = uintptr(0)
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FnativePathPtr = uintptr(0)
	(*FsPath)(unsafe.Pointer(fsPathPtr)).FfsPtr = uintptr(0)

	// Free old representation before installing our new one.

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 784)))).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 784)))).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 784 /* pathPtr */)))).FtypePtr)).FfreeIntRepProc})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 784 /* pathPtr */)))
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 784 /* pathPtr */)))).FtypePtr = uintptr(0)
	}

	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 784)) + 32)) = fsPathPtr
	(*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 784)) + 32)))).Fflags = 0
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 784 /* pathPtr */)))).FtypePtr = uintptr(unsafe.Pointer(&tclFsPathType))
	return TCL_OK
}

func sFreeFsPathInternalRep(tls *libc.TLS, pathPtr uintptr) { /* tclPathObj.c:2512:1: */
	var fsPathPtr uintptr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))

	if (*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr != uintptr(0) {
		if (*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr != pathPtr {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr)
						} else {
							*(*uintptr)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FtranslatedPathPtr)
				}
			}

		}
	}
	if (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr != uintptr(0) {
		if (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr != pathPtr {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)).Flength = -1
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)
						} else {
							*(*uintptr)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)
				}
			}

		}
		(*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr = uintptr(0)
	}
	if (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr != uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)).Flength = -1
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)
					} else {
						*(*uintptr)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr)
			}
		}

	}
	if (*FsPath)(unsafe.Pointer(fsPathPtr)).FnativePathPtr != uintptr(0) && (*FsPath)(unsafe.Pointer(fsPathPtr)).FfsPtr != uintptr(0) {
		var freeProc uintptr = (*Tcl_Filesystem)(unsafe.Pointer((*FsPath)(unsafe.Pointer(fsPathPtr)).FfsPtr)).FfreeInternalRepProc

		if freeProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{freeProc})).f(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnativePathPtr)
			(*FsPath)(unsafe.Pointer(fsPathPtr)).FnativePathPtr = uintptr(0)
		}
	}

	XTclpFree(tls, fsPathPtr)
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr = uintptr(0)
}

func sDupFsPathInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclPathObj.c:2546:1: */
	var srcFsPathPtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))
	var copyFsPathPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FsPath{})))

	*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = copyFsPathPtr

	if (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FtranslatedPathPtr == srcPtr {
		// Cycle in src -> make cycle in copy.
		(*FsPath)(unsafe.Pointer(copyFsPathPtr)).FtranslatedPathPtr = copyPtr
	} else {
		(*FsPath)(unsafe.Pointer(copyFsPathPtr)).FtranslatedPathPtr = (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FtranslatedPathPtr
		if (*FsPath)(unsafe.Pointer(copyFsPathPtr)).FtranslatedPathPtr != uintptr(0) {
			(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(copyFsPathPtr)).FtranslatedPathPtr)).FrefCount++
		}
	}

	if (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FnormPathPtr == srcPtr {
		// Cycle in src -> make cycle in copy.
		(*FsPath)(unsafe.Pointer(copyFsPathPtr)).FnormPathPtr = copyPtr
	} else {
		(*FsPath)(unsafe.Pointer(copyFsPathPtr)).FnormPathPtr = (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FnormPathPtr
		if (*FsPath)(unsafe.Pointer(copyFsPathPtr)).FnormPathPtr != uintptr(0) {
			(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(copyFsPathPtr)).FnormPathPtr)).FrefCount++
		}
	}

	(*FsPath)(unsafe.Pointer(copyFsPathPtr)).FcwdPtr = (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FcwdPtr
	if (*FsPath)(unsafe.Pointer(copyFsPathPtr)).FcwdPtr != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer((*FsPath)(unsafe.Pointer(copyFsPathPtr)).FcwdPtr)).FrefCount++
	}

	(*FsPath)(unsafe.Pointer(copyFsPathPtr)).Fflags = (*FsPath)(unsafe.Pointer(srcFsPathPtr)).Fflags

	if (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfsPtr != uintptr(0) &&
		(*FsPath)(unsafe.Pointer(srcFsPathPtr)).FnativePathPtr != uintptr(0) {
		var dupProc uintptr = (*Tcl_Filesystem)(unsafe.Pointer((*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfsPtr)).FdupInternalRepProc

		if dupProc != uintptr(0) {
			(*FsPath)(unsafe.Pointer(copyFsPathPtr)).FnativePathPtr = (*struct {
				f func(*libc.TLS, ClientData) ClientData
			})(unsafe.Pointer(&struct{ uintptr }{dupProc})).f(tls, (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FnativePathPtr)
		} else {
			(*FsPath)(unsafe.Pointer(copyFsPathPtr)).FnativePathPtr = uintptr(0)
		}
	} else {
		(*FsPath)(unsafe.Pointer(copyFsPathPtr)).FnativePathPtr = uintptr(0)
	}
	(*FsPath)(unsafe.Pointer(copyFsPathPtr)).FfsPtr = (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfsPtr
	(*FsPath)(unsafe.Pointer(copyFsPathPtr)).FfilesystemEpoch = (*FsPath)(unsafe.Pointer(srcFsPathPtr)).FfilesystemEpoch

	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&tclFsPathType))
}

//---------------------------------------------------------------------------
//
// UpdateStringOfFsPath --
//
//	Gives an object a valid string rep.
//
// Results:
//	None.
//
// Side effects:
//	Memory may be allocated.
//
//---------------------------------------------------------------------------

func sUpdateStringOfFsPath(tls *libc.TLS, pathPtr uintptr) { /* tclPathObj.c:2619:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var fsPathPtr uintptr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))
	// var cwdLen int32 at bp, 4

	var copy uintptr

	if (*FsPath)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pathPtr + 32)))).Fflags == 0 || (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr == uintptr(0) {
		XTcl_Panic(tls, ts+54927, 0)
	}

	copy = sAppendPath(tls, (*FsPath)(unsafe.Pointer(fsPathPtr)).FcwdPtr, (*FsPath)(unsafe.Pointer(fsPathPtr)).FnormPathPtr)

	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes = XTcl_GetStringFromObj(tls, copy, bp)
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).Flength = *(*int32)(unsafe.Pointer(bp /* cwdLen */))
	(*Tcl_Obj)(unsafe.Pointer(copy)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(copy)).Flength = 0
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(copy)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(copy)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(copy)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(copy)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(copy)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(copy)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(copy)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, copy)
				} else {
					*(*uintptr)(unsafe.Pointer(copy + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = copy
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, copy)
		}
	}

}

//---------------------------------------------------------------------------
//
// TclNativePathInFilesystem --
//
//	Any path object is acceptable to the native filesystem, by default (we
//	will throw errors when illegal paths are actually tried to be used).
//
//	However, this behavior means the native filesystem must be the last
//	filesystem in the lookup list (otherwise it will claim all files
//	belong to it, and other filesystems will never get a look in).
//
// Results:
//	TCL_OK, to indicate 'yes', -1 to indicate no.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclNativePathInFilesystem(tls *libc.TLS, pathPtr uintptr, clientDataPtr uintptr) int32 { /* tclPathObj.c:2661:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// A special case is required to handle the empty path "". This is a valid
	// path (i.e. the user should be able to do 'file exists ""' without
	// throwing an error), but equally the path doesn't exist. Those are the
	// semantics of Tcl (at present anyway), so we have to abide by them here.

	if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr == uintptr(unsafe.Pointer(&tclFsPathType)) {
		if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != uintptr(0) && int32(*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes))) == 0 {
			// We reject the empty path "".

			return -1
		}

		// Otherwise there is no way this path can be empty.
	} else {
		// It is somewhat unusual to reach this code path without the object
		// being of tclFsPathType. However, we do our best to deal with the
		// situation.

		// var len int32 at bp, 4

		XTcl_GetStringFromObj(tls, pathPtr, bp)
		if *(*int32)(unsafe.Pointer(bp)) == 0 {
			// We reject the empty path "".

			return -1
		}
	}

	// Path is of correct type, or is of non-zero length, so we accept it.

	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// A linked list of the following structures is used to keep track of child
// processes that have been detached but haven't exited yet, so we can make
// sure that they're properly "reaped" (officially waited for) and don't lie
// around as zombies cluttering the system.

type Detached1 = struct {
	Fpid     Tcl_Pid
	FnextPtr uintptr
} /* tclPipe.c:22:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// A linked list of the following structures is used to keep track of child
// processes that have been detached but haven't exited yet, so we can make
// sure that they're properly "reaped" (officially waited for) and don't lie
// around as zombies cluttering the system.

type Detached = Detached1 /* tclPipe.c:26:3 */

var detList uintptr = uintptr(0) /* tclPipe.c:28:17 */ // List of all detached proceses.
var pipeMutex Tcl_Mutex          /* tclPipe.c:29:1: */

//----------------------------------------------------------------------
//
// FileForRedirect --
//
//	This function does much of the work of parsing redirection operators.
//	It handles "@" if specified and allowed, and a file name, and opens
//	the file if necessary.
//
// Results:
//	The return value is the descriptor number for the file. If an error
//	occurs then NULL is returned and an error message is left in the
//	interp's result. Several arguments are side-effected; see the argument
//	list below for details.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFileForRedirect(tls *libc.TLS, interp uintptr, spec uintptr, atOK int32, arg uintptr, nextArg uintptr, flags int32, skipPtr uintptr, closePtr uintptr, releasePtr uintptr) TclFile { /* tclPipe.c:62:1: */
	bp := tls.Alloc(352)
	defer tls.Free(352)

	var writing int32
	var chan1 Tcl_Channel
	var file TclFile
	// var msg uintptr at bp+128, 8

	var name uintptr
	// var nameString Tcl_DString at bp+136, 216
	writing = flags & O_WRONLY

	*(*int32)(unsafe.Pointer(skipPtr)) = 1
	if !(atOK != 0 && int32(*(*int8)(unsafe.Pointer(spec))) == '@') {
		goto __1
	}
	spec++
	if !(int32(*(*int8)(unsafe.Pointer(spec))) == 0) {
		goto __3
	}
	spec = nextArg
	if !(spec == uintptr(0)) {
		goto __4
	}
	goto badLastArg
__4:
	;
	*(*int32)(unsafe.Pointer(skipPtr)) = 2
__3:
	;
	chan1 = XTcl_GetChannel(tls, interp, spec, uintptr(0))
	if !(chan1 == uintptr(0)) {
		goto __5
	}
	return uintptr(0)
__5:
	;
	file = XTclpMakeFile(tls, chan1, func() int32 {
		if writing != 0 {
			return int32(1) << 2
		}
		return int32(1) << 1
	}())
	if !(file == uintptr(0)) {
		goto __6
	}

	XTcl_GetChannelError(tls, chan1, bp+128)
	if !(*(*uintptr)(unsafe.Pointer(bp + 128)) != 0) {
		goto __7
	}
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 128 /* msg */)))
	goto __8
__7:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+54975,
		libc.VaList(bp, XTcl_GetChannelName(tls, chan1),
			func() uintptr {
				if writing != 0 {
					return ts + 55009 /* "writing" */
				}
				return ts + 55017 /* "reading" */
			}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+7420, ts+55025,
		ts+55030, uintptr(0)))
__8:
	;
	return uintptr(0)
__6:
	;
	*(*int32)(unsafe.Pointer(releasePtr)) = 1
	if !(writing != 0) {
		goto __9
	}
	// Be sure to flush output to the file, so that anything written
	// by the child appears after stuff we've already written.

	XTcl_Flush(tls, chan1)
__9:
	;
	goto __2
__1:

	if !(int32(*(*int8)(unsafe.Pointer(spec))) == 0) {
		goto __10
	}
	spec = nextArg
	if !(spec == uintptr(0)) {
		goto __11
	}
	goto badLastArg
__11:
	;
	*(*int32)(unsafe.Pointer(skipPtr)) = 2
__10:
	;
	name = XTcl_TranslateFileName(tls, interp, spec, bp+136)
	if !(name == uintptr(0)) {
		goto __12
	}
	return uintptr(0)
__12:
	;
	file = XTclpOpenFile(tls, name, flags)
	XTcl_DStringFree(tls, bp+136)
	if !(file == uintptr(0)) {
		goto __13
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+55038,
		libc.VaList(bp+56, func() uintptr {
			if writing != 0 {
				return ts + 33034 /* "write" */
			}
			return ts + 5472 /* "read" */
		}(), spec,
			XTcl_PosixError(tls, interp))))
	return uintptr(0)
__13:
	;
	*(*int32)(unsafe.Pointer(closePtr)) = 1
__2:
	;
	return file

badLastArg:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+55064, libc.VaList(bp+80, arg)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, ts+3593, ts+7420, ts+55025, ts+23708, uintptr(0)))
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_DetachPids --
//
//	This function is called to indicate that one or more child processes
//	have been placed in background and will never be waited for; they
//	should eventually be reaped by Tcl_ReapDetachedProcs.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_DetachPids(tls *libc.TLS, numPids int32, pidPtr uintptr) { /* tclPipe.c:181:1: */
	var detPtr uintptr
	var i int32

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&pipeMutex)))
	for i = 0; i < numPids; i++ {
		detPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Detached{})))
		(*Detached)(unsafe.Pointer(detPtr)).Fpid = *(*Tcl_Pid)(unsafe.Pointer(pidPtr + uintptr(i)*8))
		(*Detached)(unsafe.Pointer(detPtr)).FnextPtr = detList
		detList = detPtr
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&pipeMutex)))

}

//----------------------------------------------------------------------
//
// Tcl_ReapDetachedProcs --
//
//	This function checks to see if any detached processes have exited and,
//	if so, it "reaps" them by officially waiting on them. It should be
//	called "occasionally" to make sure that all detached processes are
//	eventually reaped.
//
// Results:
//	None.
//
// Side effects:
//	Processes are waited on, so that they can be reaped by the system.
//
//----------------------------------------------------------------------

func XTcl_ReapDetachedProcs(tls *libc.TLS) { /* tclPipe.c:220:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var detPtr uintptr
	var nextPtr uintptr
	var prevPtr uintptr
	// var status int32 at bp, 4

	var pid Tcl_Pid

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&pipeMutex)))
	detPtr = detList
	prevPtr = uintptr(0)
	for detPtr != uintptr(0) {
		pid = XTcl_WaitPid(tls, (*Detached)(unsafe.Pointer(detPtr)).Fpid, bp, WNOHANG)
		if pid == uintptr(0) || pid == libc.UintptrFromInt32(-1) && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != ECHILD {
			prevPtr = detPtr
			detPtr = (*Detached)(unsafe.Pointer(detPtr)).FnextPtr
			continue
		}
		nextPtr = (*Detached)(unsafe.Pointer(detPtr)).FnextPtr
		if prevPtr == uintptr(0) {
			detList = (*Detached)(unsafe.Pointer(detPtr)).FnextPtr
		} else {
			(*Detached)(unsafe.Pointer(prevPtr)).FnextPtr = (*Detached)(unsafe.Pointer(detPtr)).FnextPtr
		}
		XTclpFree(tls, detPtr)
		detPtr = nextPtr
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&pipeMutex)))
}

//----------------------------------------------------------------------
//
// TclCleanupChildren --
//
//	This is a utility function used to wait for child processes to exit,
//	record information about abnormal exits, and then collect any stderr
//	output generated by them.
//
// Results:
//	The return value is a standard Tcl result. If anything at weird
//	happened with the child processes, TCL_ERROR is returned and a message
//	is left in the interp's result.
//
// Side effects:
//	If the last character of the interp's result is a newline, then it is
//	removed unless keepNewline is non-zero. File errorId gets closed, and
//	pidPtr is freed back to the storage allocator.
//
//----------------------------------------------------------------------

func XTclCleanupChildren(tls *libc.TLS, interp uintptr, numPids int32, pidPtr uintptr, errorChan Tcl_Channel) int32 { /* tclPipe.c:270:1: */
	bp := tls.Alloc(260)
	defer tls.Free(260)

	var result int32 = TCL_OK
	var i int32
	var abnormalExit int32
	var anyErrorInfo int32
	var pid Tcl_Pid
	// var waitStatus int32 at bp+208, 4

	var msg uintptr
	var resolvedPid uint64

	abnormalExit = 0
	for i = 0; i < numPids; i++ {
		// We need to get the resolved pid before we wait on it as the windows
		// implementation of Tcl_WaitPid deletes the information such that any
		// following calls to TclpGetPid fail.

		resolvedPid = uint64(*(*Tcl_Pid)(unsafe.Pointer(pidPtr + uintptr(i)*8)))
		pid = XTcl_WaitPid(tls, *(*Tcl_Pid)(unsafe.Pointer(pidPtr + uintptr(i)*8)), bp+208, 0)
		if pid == libc.UintptrFromInt32(-1) {
			result = TCL_ERROR
			if interp != uintptr(0) {
				msg = XTcl_PosixError(tls, interp)
				if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ECHILD {
					// This changeup in message suggested by Mark Diekhans to
					// remind people that ECHILD errors can occur on some
					// systems if SIGCHLD isn't in its default state.

					msg = ts + 55107 /* "child process lo..." */
				}
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+55159, libc.VaList(bp, msg)))
			}
			continue
		}

		// Create error messages for unusual process exits. An extra newline
		// gets appended to each error message, but it gets removed below (in
		// the same fashion that an extra newline in the command's output is
		// removed).

		if !(*(*int32)(unsafe.Pointer(bp + 208))&0x7f == 0) || *(*int32)(unsafe.Pointer(bp + 208))&0xff00>>8 != 0 {
			// var msg1 [24]int8 at bp+212, 24

			// var msg2 [24]int8 at bp+236, 24

			result = TCL_ERROR
			libc.Xsprintf(tls, bp+212, ts+55197, libc.VaList(bp+8, resolvedPid))
			if *(*int32)(unsafe.Pointer(bp + 208))&0x7f == 0 {
				if interp != uintptr(0) {
					libc.Xsprintf(tls, bp+236, ts+55201, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(bp + 208))&0xff00>>8))
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+55204, bp+212, bp+236, uintptr(0)))
				}
				abnormalExit = 1
			} else if interp != uintptr(0) {
				var p uintptr

				if int32(int8(*(*int32)(unsafe.Pointer(bp + 208))&0x7f+1))>>1 > 0 {
					p = XTcl_SignalMsg(tls, *(*int32)(unsafe.Pointer(bp + 208))&0x7f)
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+55216, bp+212,
						XTcl_SignalId(tls, *(*int32)(unsafe.Pointer(bp + 208))&0x7f), p, uintptr(0)))
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
						ts+55228, libc.VaList(bp+96, p)))
				} else if *(*int32)(unsafe.Pointer(bp + 208))&0xff == 0x7f {
					p = XTcl_SignalMsg(tls, *(*int32)(unsafe.Pointer(bp + 208))&0xff00>>8)
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp+104, ts+55246, bp+212,
						XTcl_SignalId(tls, *(*int32)(unsafe.Pointer(bp + 208))&0xff00>>8), p, uintptr(0)))
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
						ts+55256, libc.VaList(bp+144, p)))
				} else {
					XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
						ts+55277, -1))
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp+152, ts+3593, ts+7420, ts+55025,
						ts+55314, bp+212, uintptr(0)))
				}
			}
		}
	}

	// Read the standard error file. If there's anything there, then return an
	// error and add the file's contents to the result string.

	anyErrorInfo = 0
	if errorChan != uintptr(0) {
		// Make sure we start at the beginning of the file.

		if interp != uintptr(0) {
			var count int32
			var objPtr uintptr

			XTcl_Seek(tls, errorChan, int64(0), SEEK_SET)
			objPtr = XTcl_NewObj(tls)
			count = XTcl_ReadChars(tls, errorChan, objPtr, -1, 0)
			if count < 0 {
				result = TCL_ERROR
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = objPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				XTcl_ResetResult(tls, interp)
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+55328,
					libc.VaList(bp+200, XTcl_PosixError(tls, interp))))
			} else if count > 0 {
				anyErrorInfo = 1
				XTcl_SetObjResult(tls, interp, objPtr)
				result = TCL_ERROR
			} else {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _objPtr uintptr = objPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
		}
		XTcl_Close(tls, uintptr(0), errorChan)
	}

	// If a child exited abnormally but didn't output any error information at
	// all, generate an error message here.

	if abnormalExit != 0 && anyErrorInfo == 0 && interp != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+55365, -1))
	}
	return result
}

//----------------------------------------------------------------------
//
// TclCreatePipeline --
//
//	Given an argc/argv array, instantiate a pipeline of processes as
//	described by the argv.
//
//	This function is unofficially exported for use by BLT.
//
// Results:
//	The return value is a count of the number of new processes created, or
//	-1 if an error occurred while creating the pipeline. *pidArrayPtr is
//	filled in with the address of a dynamically allocated array giving the
//	ids of all of the processes. It is up to the caller to free this array
//	when it isn't needed anymore. If inPipePtr is non-NULL, *inPipePtr is
//	filled in with the file id for the input pipe for the pipeline (if
//	any): the caller must eventually close this file. If outPipePtr isn't
//	NULL, then *outPipePtr is filled in with the file id for the output
//	pipe from the pipeline: the caller must close this file. If errFilePtr
//	isn't NULL, then *errFilePtr is filled with a file id that may be used
//	to read error output after the pipeline completes.
//
// Side effects:
//	Processes and pipes are created.
//
//----------------------------------------------------------------------

func XTclCreatePipeline(tls *libc.TLS, interp uintptr, argc int32, argv uintptr, pidArrayPtr uintptr, inPipePtr uintptr, outPipePtr uintptr, errFilePtr uintptr) int32 { /* tclPipe.c:436:1: */
	bp := tls.Alloc(504)
	defer tls.Free(504)

	var pidPtr uintptr // Points to malloc-ed array holding all the
	// pids of child processes.
	var numPids int32 // Actual number of processes that exist at
	// *pidPtr right now.
	var cmdCount int32 // Count of number of distinct commands found
	// in argc/argv.
	var inputLiteral uintptr
	// If non-null, then this points to a string
	// containing input data (specified via <<) to
	// be piped to the first process in the
	// pipeline.
	// var inputFile TclFile at bp+464, 8
	// If != NULL, gives file to use as input for
	// first process in pipeline (specified via <
	// or <@).
	// var inputClose int32 at bp+436, 4
	// If non-zero, then inputFile should be
	// closed when cleaning up.
	// var inputRelease int32 at bp+440, 4

	// var outputFile TclFile at bp+472, 8
	// Writable file for output from last command
	// in pipeline (could be file or pipe). NULL
	// means use stdout.
	// var outputClose int32 at bp+444, 4
	// If non-zero, then outputFile should be
	// closed when cleaning up.
	// var outputRelease int32 at bp+448, 4

	var errorFile TclFile // Writable file for error output from all
	// commands in pipeline. NULL means use
	// stderr.
	// var errorClose int32 at bp+452, 4
	// If non-zero, then errorFile should be
	// closed when cleaning up.
	// var errorRelease int32 at bp+456, 4

	var p uintptr
	var nextArg uintptr
	// var skip int32 at bp+432, 4

	var lastBar int32
	var lastArg int32
	var i int32
	var j int32
	var atOK int32
	var flags int32
	var needCmd int32
	var errorToOutput int32
	// var execBuffer Tcl_DString at bp+216, 216

	// var pipeIn TclFile at bp+480, 8

	var curInFile TclFile
	// var curOutFile TclFile at bp+488, 8

	var curErrFile TclFile
	var channel Tcl_Channel
	var result int32
	var joinThisError int32
	// var pid Tcl_Pid at bp+496, 8

	var oldName uintptr
	pidPtr = uintptr(0)
	inputLiteral = uintptr(0)
	*(*TclFile)(unsafe.Pointer(bp + 464 /* inputFile */)) = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 436 /* inputClose */)) = 0
	*(*int32)(unsafe.Pointer(bp + 440 /* inputRelease */)) = 0
	*(*TclFile)(unsafe.Pointer(bp + 472 /* outputFile */)) = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 444 /* outputClose */)) = 0
	*(*int32)(unsafe.Pointer(bp + 448 /* outputRelease */)) = 0
	errorFile = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 452 /* errorClose */)) = 0
	*(*int32)(unsafe.Pointer(bp + 456 /* errorRelease */)) = 0
	errorToOutput = 0

	if !(inPipePtr != uintptr(0)) {
		goto __1
	}
	*(*TclFile)(unsafe.Pointer(inPipePtr)) = uintptr(0)
__1:
	;
	if !(outPipePtr != uintptr(0)) {
		goto __2
	}
	*(*TclFile)(unsafe.Pointer(outPipePtr)) = uintptr(0)
__2:
	;
	if !(errFilePtr != uintptr(0)) {
		goto __3
	}
	*(*TclFile)(unsafe.Pointer(errFilePtr)) = uintptr(0)
__3:
	;

	XTcl_DStringInit(tls, bp+216)

	*(*TclFile)(unsafe.Pointer(bp + 480 /* pipeIn */)) = uintptr(0)
	curInFile = uintptr(0)
	*(*TclFile)(unsafe.Pointer(bp + 488 /* curOutFile */)) = uintptr(0)
	numPids = 0

	// First, scan through all the arguments to figure out the structure of
	// the pipeline. Process all of the input and output redirection arguments
	// and remove them from the argument list in the pipeline. Count the
	// number of distinct processes (it's the number of "|" arguments plus
	// one) but don't remove the "|" arguments because they'll be used in the
	// second pass to seperate the individual child processes. Cannot start
	// the child processes in this pass because the redirection symbols may
	// appear anywhere in the command line - e.g., the '<' that specifies the
	// input to the entire pipe may appear at the very end of the argument
	// list.

	lastBar = -1
	cmdCount = 1
	needCmd = 1
	i = 0
__4:
	if !(i < argc) {
		goto __6
	}
	errorToOutput = 0
	*(*int32)(unsafe.Pointer(bp + 432 /* skip */)) = 0
	p = *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))
	switch int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) {
	case '|':
		goto __8

	case '<':
		goto __9

	case '>':
		goto __10

	case '2':
		goto __11

	default:
		goto __12
	}
	goto __7
__8:
	if !(int32(*(*int8)(unsafe.Pointer(p))) == '&') {
		goto __13
	}
	p++
__13:
	;
	if !(int32(*(*int8)(unsafe.Pointer(p))) == 0) {
		goto __14
	}
	if !(i == lastBar+1 || i == argc-1) {
		goto __15
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+55397, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+55025,
		ts+55431, uintptr(0)))
	goto error
__15:
	;
__14:
	;
	lastBar = i
	cmdCount++
	needCmd = 1
	goto __7

__9:
	if !(*(*int32)(unsafe.Pointer(bp + 436)) != 0) {
		goto __16
	}
	*(*int32)(unsafe.Pointer(bp + 436 /* inputClose */)) = 0
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(bp + 464 /* inputFile */)))
__16:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 440)) != 0) {
		goto __17
	}
	*(*int32)(unsafe.Pointer(bp + 440 /* inputRelease */)) = 0

__17:
	;
	if !(int32(*(*int8)(unsafe.Pointer(p))) == '<') {
		goto __18
	}
	*(*TclFile)(unsafe.Pointer(bp + 464 /* inputFile */)) = uintptr(0)
	inputLiteral = p + uintptr(1)
	*(*int32)(unsafe.Pointer(bp + 432 /* skip */)) = 1
	if !(int32(*(*int8)(unsafe.Pointer(inputLiteral))) == 0) {
		goto __20
	}
	if i+1 == argc {
		inputLiteral = uintptr(0)
	} else {
		inputLiteral = *(*uintptr)(unsafe.Pointer(argv + uintptr(i+1)*8))
	}
	if !(inputLiteral == uintptr(0)) {
		goto __21
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+55064,
		libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+7420, ts+55025,
		ts+55431, uintptr(0)))
	goto error
__21:
	;
	*(*int32)(unsafe.Pointer(bp + 432 /* skip */)) = 2
__20:
	;
	goto __19
__18:
	if i+1 == argc {
		nextArg = uintptr(0)
	} else {
		nextArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(i+1)*8))
	}
	inputLiteral = uintptr(0)
	*(*TclFile)(unsafe.Pointer(bp + 464 /* inputFile */)) = sFileForRedirect(tls, interp, p, 1, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), nextArg,
		O_RDONLY, bp+432, bp+436, bp+440)
	if !(*(*TclFile)(unsafe.Pointer(bp + 464)) == uintptr(0)) {
		goto __22
	}
	goto error
__22:
	;
__19:
	;
	goto __7

__10:
	atOK = 1
	flags = O_WRONLY | O_CREAT | O_TRUNC
	if !(int32(*(*int8)(unsafe.Pointer(p))) == '>') {
		goto __23
	}
	p++
	atOK = 0

	// Note that the O_APPEND flag only has an effect on POSIX
	// platforms. On Windows, we just have to carry on regardless.

	flags = O_WRONLY | O_CREAT | O_APPEND
__23:
	;
	if !(int32(*(*int8)(unsafe.Pointer(p))) == '&') {
		goto __24
	}
	if !(*(*int32)(unsafe.Pointer(bp + 452)) != 0) {
		goto __25
	}
	*(*int32)(unsafe.Pointer(bp + 452 /* errorClose */)) = 0
	XTclpCloseFile(tls, errorFile)
__25:
	;
	errorToOutput = 1
	p++
__24:
	;

	// Close the old output file, but only if the error file is not
	// also using it.

	if !(*(*int32)(unsafe.Pointer(bp + 444)) != 0) {
		goto __26
	}
	*(*int32)(unsafe.Pointer(bp + 444 /* outputClose */)) = 0
	if !(errorFile == *(*TclFile)(unsafe.Pointer(bp + 472))) {
		goto __27
	}
	*(*int32)(unsafe.Pointer(bp + 452 /* errorClose */)) = 1
	goto __28
__27:
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(bp + 472 /* outputFile */)))
__28:
	;
__26:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 448)) != 0) {
		goto __29
	}
	*(*int32)(unsafe.Pointer(bp + 448 /* outputRelease */)) = 0
	if !(errorFile == *(*TclFile)(unsafe.Pointer(bp + 472))) {
		goto __30
	}
	*(*int32)(unsafe.Pointer(bp + 456 /* errorRelease */)) = 1
	goto __31
__30:
	;
__31:
	;
__29:
	;
	if i+1 == argc {
		nextArg = uintptr(0)
	} else {
		nextArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(i+1)*8))
	}
	*(*TclFile)(unsafe.Pointer(bp + 472 /* outputFile */)) = sFileForRedirect(tls, interp, p, atOK, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), nextArg,
		flags, bp+432, bp+444, bp+448)
	if !(*(*TclFile)(unsafe.Pointer(bp + 472)) == uintptr(0)) {
		goto __32
	}
	goto error
__32:
	;
	if !(errorToOutput != 0) {
		goto __33
	}
	if !(*(*int32)(unsafe.Pointer(bp + 452)) != 0) {
		goto __34
	}
	*(*int32)(unsafe.Pointer(bp + 452 /* errorClose */)) = 0
	XTclpCloseFile(tls, errorFile)
__34:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 456)) != 0) {
		goto __35
	}
	*(*int32)(unsafe.Pointer(bp + 456 /* errorRelease */)) = 0

__35:
	;
	errorFile = *(*TclFile)(unsafe.Pointer(bp + 472 /* outputFile */))
__33:
	;
	goto __7

__11:
	if !(int32(*(*int8)(unsafe.Pointer(p))) != '>') {
		goto __36
	}
	goto __7
__36:
	;
	p++
	atOK = 1
	flags = O_WRONLY | O_CREAT | O_TRUNC
	if !(int32(*(*int8)(unsafe.Pointer(p))) == '>') {
		goto __37
	}
	p++
	atOK = 0

	// Note that the O_APPEND flag only has an effect on POSIX
	// platforms. On Windows, we just have to carry on regardless.

	flags = O_WRONLY | O_CREAT | O_APPEND
__37:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 452)) != 0) {
		goto __38
	}
	*(*int32)(unsafe.Pointer(bp + 452 /* errorClose */)) = 0
	XTclpCloseFile(tls, errorFile)
__38:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 456)) != 0) {
		goto __39
	}
	*(*int32)(unsafe.Pointer(bp + 456 /* errorRelease */)) = 0

__39:
	;
	if !(atOK != 0 && int32(*(*int8)(unsafe.Pointer(p))) == '@' && int32(*(*int8)(unsafe.Pointer(p + 1))) == '1' && int32(*(*int8)(unsafe.Pointer(p + 2))) == 0) {
		goto __40
	}
	// Special case handling of 2>@1 to redirect stderr to the
	// exec/open output pipe as well. This is meant for the end of
	// the command string, otherwise use |& between commands.

	if !(i != argc-1) {
		goto __42
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+55442,
		libc.VaList(bp+88, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+7420, ts+55025,
		ts+55431, uintptr(0)))
	goto error
__42:
	;
	errorFile = *(*TclFile)(unsafe.Pointer(bp + 472 /* outputFile */))
	errorToOutput = 2
	*(*int32)(unsafe.Pointer(bp + 432 /* skip */)) = 1
	goto __41
__40:
	if i+1 == argc {
		nextArg = uintptr(0)
	} else {
		nextArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(i+1)*8))
	}
	errorFile = sFileForRedirect(tls, interp, p, atOK, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)),
		nextArg, flags, bp+432, bp+452, bp+456)
	if !(errorFile == uintptr(0)) {
		goto __43
	}
	goto error
__43:
	;
__41:
	;
	goto __7

__12:
	// Got a command word, not a redirection.

	needCmd = 0
	goto __7
__7:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 432)) != 0) {
		goto __44
	}
	j = i + *(*int32)(unsafe.Pointer(bp + 432))
__45:
	if !(j < argc) {
		goto __47
	}
	*(*uintptr)(unsafe.Pointer(argv + uintptr(j-*(*int32)(unsafe.Pointer(bp + 432)))*8)) = *(*uintptr)(unsafe.Pointer(argv + uintptr(j)*8))
	goto __46
__46:
	j++
	goto __45
	goto __47
__47:
	;
	argc = argc - *(*int32)(unsafe.Pointer(bp + 432))
	i = i - 1
__44:
	;
	goto __5
__5:
	i++
	goto __4
	goto __6
__6:
	;

	if !(needCmd != 0) {
		goto __48
	}
	// We had a bar followed only by redirections.

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+55397, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+136, ts+3593, ts+7420, ts+55025, ts+55431,
		uintptr(0)))
	goto error
__48:
	;

	if !(*(*TclFile)(unsafe.Pointer(bp + 464)) == uintptr(0)) {
		goto __49
	}
	if !(inputLiteral != uintptr(0)) {
		goto __50
	}
	// The input for the first process is immediate data coming from
	// Tcl. Create a temporary file for it and put the data into the
	// file.

	*(*TclFile)(unsafe.Pointer(bp + 464 /* inputFile */)) = XTclpCreateTempFile(tls, inputLiteral)
	if !(*(*TclFile)(unsafe.Pointer(bp + 464)) == uintptr(0)) {
		goto __52
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+55484,
		libc.VaList(bp+176, XTcl_PosixError(tls, interp))))
	goto error
__52:
	;
	*(*int32)(unsafe.Pointer(bp + 436 /* inputClose */)) = 1
	goto __51
__50:
	if !(inPipePtr != uintptr(0)) {
		goto __53
	}
	// The input for the first process in the pipeline is to come from
	// a pipe that can be written from by the caller.

	if !(XTclpCreatePipe(tls, bp+464, inPipePtr) == 0) {
		goto __55
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+55527,
		libc.VaList(bp+184, XTcl_PosixError(tls, interp))))
	goto error
__55:
	;
	*(*int32)(unsafe.Pointer(bp + 436 /* inputClose */)) = 1
	goto __54
__53:
	// The input for the first process comes from stdin.

	channel = XTcl_GetStdChannel(tls, int32(1)<<1)
	if !(channel != uintptr(0)) {
		goto __56
	}
	*(*TclFile)(unsafe.Pointer(bp + 464 /* inputFile */)) = XTclpMakeFile(tls, channel, int32(1)<<1)
	if !(*(*TclFile)(unsafe.Pointer(bp + 464)) != uintptr(0)) {
		goto __57
	}
	*(*int32)(unsafe.Pointer(bp + 440 /* inputRelease */)) = 1
__57:
	;
__56:
	;
__54:
	;
__51:
	;
__49:
	;

	if !(*(*TclFile)(unsafe.Pointer(bp + 472)) == uintptr(0)) {
		goto __58
	}
	if !(outPipePtr != uintptr(0)) {
		goto __59
	}
	// Output from the last process in the pipeline is to go to a pipe
	// that can be read by the caller.

	if !(XTclpCreatePipe(tls, outPipePtr, bp+472) == 0) {
		goto __61
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+55570,
		libc.VaList(bp+192, XTcl_PosixError(tls, interp))))
	goto error
__61:
	;
	*(*int32)(unsafe.Pointer(bp + 444 /* outputClose */)) = 1
	goto __60
__59:
	// The output for the last process goes to stdout.

	channel = XTcl_GetStdChannel(tls, int32(1)<<2)
	if !(channel != 0) {
		goto __62
	}
	*(*TclFile)(unsafe.Pointer(bp + 472 /* outputFile */)) = XTclpMakeFile(tls, channel, int32(1)<<2)
	if !(*(*TclFile)(unsafe.Pointer(bp + 472)) != uintptr(0)) {
		goto __63
	}
	*(*int32)(unsafe.Pointer(bp + 448 /* outputRelease */)) = 1
__63:
	;
__62:
	;
__60:
	;
__58:
	;

	if !(errorFile == uintptr(0)) {
		goto __64
	}
	if !(errorToOutput == 2) {
		goto __65
	}
	// Handle 2>@1 special case at end of cmd line.

	errorFile = *(*TclFile)(unsafe.Pointer(bp + 472 /* outputFile */))
	goto __66
__65:
	if !(errFilePtr != uintptr(0)) {
		goto __67
	}
	// Set up the standard error output sink for the pipeline, if
	// requested. Use a temporary file which is opened, then deleted.
	// Could potentially just use pipe, but if it filled up it could
	// cause the pipeline to deadlock: we'd be waiting for processes
	// to complete before reading stderr, and processes couldn't
	// complete because stderr was backed up.

	errorFile = XTclpCreateTempFile(tls, uintptr(0))
	if !(errorFile == uintptr(0)) {
		goto __69
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+55614,
		libc.VaList(bp+200, XTcl_PosixError(tls, interp))))
	goto error
__69:
	;
	*(*TclFile)(unsafe.Pointer(errFilePtr)) = errorFile
	goto __68
__67:
	// Errors from the pipeline go to stderr.

	channel = XTcl_GetStdChannel(tls, int32(1)<<3)
	if !(channel != 0) {
		goto __70
	}
	errorFile = XTclpMakeFile(tls, channel, int32(1)<<2)
	if !(errorFile != uintptr(0)) {
		goto __71
	}
	*(*int32)(unsafe.Pointer(bp + 456 /* errorRelease */)) = 1
__71:
	;
__70:
	;
__68:
	;
__66:
	;
__64:
	;

	// Scan through the argc array, creating a process for each group of
	// arguments between the "|" characters.

	XTcl_ReapDetachedProcs(tls)
	pidPtr = XTcl_Alloc(tls, uint32(uint64(cmdCount)*uint64(unsafe.Sizeof(Tcl_Pid(0)))))

	curInFile = *(*TclFile)(unsafe.Pointer(bp + 464 /* inputFile */))

	i = 0
__72:
	if !(i < argc) {
		goto __74
	}

	// Convert the program name into native form.

	if !(XTcl_TranslateFileName(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), bp+216) == uintptr(0)) {
		goto __75
	}
	goto error
__75:
	;

	// Find the end of the current segment of the pipeline.

	joinThisError = 0
	lastArg = i
__76:
	if !(lastArg < argc) {
		goto __78
	}
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(lastArg)*8))))) != '|') {
		goto __79
	}
	goto __77
__79:
	;
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(lastArg)*8)) + 1))) == 0) {
		goto __80
	}
	goto __78
__80:
	;
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(lastArg)*8)) + 1))) == '&' && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(lastArg)*8)) + 2))) == 0) {
		goto __81
	}
	joinThisError = 1
	goto __78
__81:
	;
	goto __77
__77:
	lastArg++
	goto __76
	goto __78
__78:
	;

	// If this is the last segment, use the specified outputFile.
	// Otherwise create an intermediate pipe. pipeIn will become the
	// curInFile for the next segment of the pipe.

	if !(lastArg == argc) {
		goto __82
	}
	*(*TclFile)(unsafe.Pointer(bp + 488 /* curOutFile */)) = *(*TclFile)(unsafe.Pointer(bp + 472 /* outputFile */))
	goto __83
__82:
	*(*uintptr)(unsafe.Pointer(argv + uintptr(lastArg)*8)) = uintptr(0)
	if !(XTclpCreatePipe(tls, bp+480, bp+488) == 0) {
		goto __84
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+55657, libc.VaList(bp+208, XTcl_PosixError(tls, interp))))
	goto error
__84:
	;
__83:
	;

	if !(joinThisError != 0) {
		goto __85
	}
	curErrFile = *(*TclFile)(unsafe.Pointer(bp + 488 /* curOutFile */))
	goto __86
__85:
	curErrFile = errorFile
__86:
	;

	// Restore argv[i], since a caller wouldn't expect the contents of
	// argv to be modified.

	oldName = *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))
	*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) = (*Tcl_DString)(unsafe.Pointer(bp + 216)).Fstring
	result = XTclpCreateProcess(tls, interp, lastArg-i, argv+uintptr(i)*8,
		curInFile, *(*TclFile)(unsafe.Pointer(bp + 488 /* curOutFile */)), curErrFile, bp+496)
	*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) = oldName
	if !(result != TCL_OK) {
		goto __87
	}
	goto error
__87:
	;
	XTcl_DStringFree(tls, bp+216)

	*(*Tcl_Pid)(unsafe.Pointer(pidPtr + uintptr(numPids)*8)) = *(*Tcl_Pid)(unsafe.Pointer(bp + 496 /* pid */))
	numPids++

	// Close off our copies of file descriptors that were set up for this
	// child, then set up the input for the next child.

	if !(curInFile != uintptr(0) && curInFile != *(*TclFile)(unsafe.Pointer(bp + 464))) {
		goto __88
	}
	XTclpCloseFile(tls, curInFile)
__88:
	;
	curInFile = *(*TclFile)(unsafe.Pointer(bp + 480 /* pipeIn */))
	*(*TclFile)(unsafe.Pointer(bp + 480 /* pipeIn */)) = uintptr(0)

	if !(*(*TclFile)(unsafe.Pointer(bp + 488)) != uintptr(0) && *(*TclFile)(unsafe.Pointer(bp + 488)) != *(*TclFile)(unsafe.Pointer(bp + 472))) {
		goto __89
	}
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(bp + 488 /* curOutFile */)))
__89:
	;
	*(*TclFile)(unsafe.Pointer(bp + 488 /* curOutFile */)) = uintptr(0)
	goto __73
__73:
	i = lastArg + 1
	goto __72
	goto __74
__74:
	;

	*(*uintptr)(unsafe.Pointer(pidArrayPtr)) = pidPtr

	// All done. Cleanup open files lying around and then return.

cleanup:
	XTcl_DStringFree(tls, bp+216)

	if !(*(*int32)(unsafe.Pointer(bp + 436)) != 0) {
		goto __90
	}
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(bp + 464 /* inputFile */)))
	goto __91
__90:
	if !(*(*int32)(unsafe.Pointer(bp + 440)) != 0) {
		goto __92
	}

__92:
	;
__91:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 444)) != 0) {
		goto __93
	}
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(bp + 472 /* outputFile */)))
	goto __94
__93:
	if !(*(*int32)(unsafe.Pointer(bp + 448)) != 0) {
		goto __95
	}

__95:
	;
__94:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 452)) != 0) {
		goto __96
	}
	XTclpCloseFile(tls, errorFile)
	goto __97
__96:
	if !(*(*int32)(unsafe.Pointer(bp + 456)) != 0) {
		goto __98
	}

__98:
	;
__97:
	;
	return numPids

	// An error occurred. There could have been extra files open, such as
	// pipes between children. Clean them all up. Detach any child processes
	// that have been created.

error:
	if !(*(*TclFile)(unsafe.Pointer(bp + 480)) != uintptr(0)) {
		goto __99
	}
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(bp + 480 /* pipeIn */)))
__99:
	;
	if !(*(*TclFile)(unsafe.Pointer(bp + 488)) != uintptr(0) && *(*TclFile)(unsafe.Pointer(bp + 488)) != *(*TclFile)(unsafe.Pointer(bp + 472))) {
		goto __100
	}
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(bp + 488 /* curOutFile */)))
__100:
	;
	if !(curInFile != uintptr(0) && curInFile != *(*TclFile)(unsafe.Pointer(bp + 464))) {
		goto __101
	}
	XTclpCloseFile(tls, curInFile)
__101:
	;
	if !(inPipePtr != uintptr(0) && *(*TclFile)(unsafe.Pointer(inPipePtr)) != uintptr(0)) {
		goto __102
	}
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(inPipePtr)))
	*(*TclFile)(unsafe.Pointer(inPipePtr)) = uintptr(0)
__102:
	;
	if !(outPipePtr != uintptr(0) && *(*TclFile)(unsafe.Pointer(outPipePtr)) != uintptr(0)) {
		goto __103
	}
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(outPipePtr)))
	*(*TclFile)(unsafe.Pointer(outPipePtr)) = uintptr(0)
__103:
	;
	if !(errFilePtr != uintptr(0) && *(*TclFile)(unsafe.Pointer(errFilePtr)) != uintptr(0)) {
		goto __104
	}
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(errFilePtr)))
	*(*TclFile)(unsafe.Pointer(errFilePtr)) = uintptr(0)
__104:
	;
	if !(pidPtr != uintptr(0)) {
		goto __105
	}
	i = 0
__106:
	if !(i < numPids) {
		goto __108
	}
	if !(*(*Tcl_Pid)(unsafe.Pointer(pidPtr + uintptr(i)*8)) != libc.UintptrFromInt32(-1)) {
		goto __109
	}
	XTcl_DetachPids(tls, 1, pidPtr+uintptr(i)*8)
__109:
	;
	goto __107
__107:
	i++
	goto __106
	goto __108
__108:
	;
	XTclpFree(tls, pidPtr)
__105:
	;
	numPids = -1
	goto cleanup
	return int32(0)
}

//----------------------------------------------------------------------
//
// Tcl_OpenCommandChannel --
//
//	Opens an I/O channel to one or more subprocesses specified by argc and
//	argv. The flags argument determines the disposition of the stdio
//	handles. If the TCL_STDIN flag is set then the standard input for the
//	first subprocess will be tied to the channel: writing to the channel
//	will provide input to the subprocess. If TCL_STDIN is not set, then
//	standard input for the first subprocess will be the same as this
//	application's standard input. If TCL_STDOUT is set then standard
//	output from the last subprocess can be read from the channel;
//	otherwise it goes to this application's standard output. If TCL_STDERR
//	is set, standard error output for all subprocesses is returned to the
//	channel and results in an error when the channel is closed; otherwise
//	it goes to this application's standard error. If TCL_ENFORCE_MODE is
//	not set, then argc and argv can redirect the stdio handles to override
//	TCL_STDIN, TCL_STDOUT, and TCL_STDERR; if it is set, then it is an
//	error for argc and argv to override stdio channels for which
//	TCL_STDIN, TCL_STDOUT, and TCL_STDERR have been set.
//
// Results:
//	A new command channel, or NULL on failure with an error message left
//	in interp.
//
// Side effects:
//	Creates processes, opens pipes.
//
//----------------------------------------------------------------------

func XTcl_OpenCommandChannel(tls *libc.TLS, interp uintptr, argc int32, argv uintptr, flags int32) Tcl_Channel { /* tclPipe.c:1056:1: */
	bp := tls.Alloc(152)
	defer tls.Free(152)

	var inPipePtr uintptr
	var outPipePtr uintptr
	var errFilePtr uintptr
	// var inPipe TclFile at bp+120, 8

	// var outPipe TclFile at bp+128, 8

	// var errFile TclFile at bp+136, 8

	var numPids int32
	// var pidPtr uintptr at bp+144, 8

	var channel Tcl_Channel

	*(*TclFile)(unsafe.Pointer(bp + 120 /* inPipe */)) = libc.AssignPtrUintptr(bp+128 /* outPipe */, libc.AssignPtrUintptr(bp+136 /* errFile */, uintptr(0)))

	if flags&(int32(1)<<1) != 0 {
		inPipePtr = bp + 120 /* &inPipe */
	} else {
		inPipePtr = uintptr(0)
	}
	if flags&(int32(1)<<2) != 0 {
		outPipePtr = bp + 128 /* &outPipe */
	} else {
		outPipePtr = uintptr(0)
	}
	if flags&(int32(1)<<3) != 0 {
		errFilePtr = bp + 136 /* &errFile */
	} else {
		errFilePtr = uintptr(0)
	}

	numPids = XTclCreatePipeline(tls, interp, argc, argv, bp+144, inPipePtr,
		outPipePtr, errFilePtr)

	if !(numPids < 0) {
		goto __1
	}
	goto error
__1:
	;

	// Verify that the pipes that were created satisfy the readable/writable
	// constraints.

	if !(flags&(int32(1)<<4) != 0) {
		goto __2
	}
	if !(flags&(int32(1)<<2) != 0 && *(*TclFile)(unsafe.Pointer(bp + 128)) == uintptr(0)) {
		goto __3
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+55682, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+55025,
		ts+55745, uintptr(0)))
	goto error
__3:
	;
	if !(flags&(int32(1)<<1) != 0 && *(*TclFile)(unsafe.Pointer(bp + 120)) == uintptr(0)) {
		goto __4
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+55757, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7420, ts+55025,
		ts+55745, uintptr(0)))
	goto error
__4:
	;
__2:
	;

	channel = XTclpCreateCommandChannel(tls, *(*TclFile)(unsafe.Pointer(bp + 128 /* outPipe */)), *(*TclFile)(unsafe.Pointer(bp + 120 /* inPipe */)), *(*TclFile)(unsafe.Pointer(bp + 136 /* errFile */)),
		numPids, *(*uintptr)(unsafe.Pointer(bp + 144 /* pidPtr */)))

	if !(channel == uintptr(0)) {
		goto __5
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+55817, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, ts+3593, ts+7420, ts+55025, ts+55855, uintptr(0)))
	goto error
__5:
	;
	return channel

error:
	if !(numPids > 0) {
		goto __6
	}
	XTcl_DetachPids(tls, numPids, *(*uintptr)(unsafe.Pointer(bp + 144 /* pidPtr */)))
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 144)))
__6:
	;
	if !(*(*TclFile)(unsafe.Pointer(bp + 120)) != uintptr(0)) {
		goto __7
	}
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(bp + 120 /* inPipe */)))
__7:
	;
	if !(*(*TclFile)(unsafe.Pointer(bp + 128)) != uintptr(0)) {
		goto __8
	}
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(bp + 128 /* outPipe */)))
__8:
	;
	if !(*(*TclFile)(unsafe.Pointer(bp + 136)) != uintptr(0)) {
		goto __9
	}
	XTclpCloseFile(tls, *(*TclFile)(unsafe.Pointer(bp + 136 /* errFile */)))
__9:
	;
	return uintptr(0)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Each invocation of the "package ifneeded" command creates a structure of
// the following type, which is used to load the package into the interpreter
// if it is requested with a "package require" command.

type PkgAvail1 = struct {
	Fversion uintptr
	Fscript  uintptr
	FnextPtr uintptr
} /* tclPkg.c:26:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Each invocation of the "package ifneeded" command creates a structure of
// the following type, which is used to load the package into the interpreter
// if it is requested with a "package require" command.

type PkgAvail = PkgAvail1 /* tclPkg.c:33:3 */

// For each package that is known in any way to an interpreter, there is one
// record of the following type. These records are stored in the
// "packageTable" hash table in the interpreter, keyed by package name such as
// "Tk" (no version number).

type Package1 = struct {
	Fversion    uintptr
	FavailPtr   uintptr
	FclientData uintptr
} /* tclPkg.c:42:9 */

// For each package that is known in any way to an interpreter, there is one
// record of the following type. These records are stored in the
// "packageTable" hash table in the interpreter, keyed by package name such as
// "Tk" (no version number).

type Package = Package1 /* tclPkg.c:47:3 */

type Require1 = struct {
	FclientDataPtr    uintptr
	Fname             uintptr
	FpkgPtr           uintptr
	FversionToProvide uintptr
} /* tclPkg.c:49:9 */

type Require = Require1 /* tclPkg.c:54:3 */

type RequireProcArgs1 = struct {
	Fname          uintptr
	FclientDataPtr uintptr
} /* tclPkg.c:56:9 */

type RequireProcArgs = RequireProcArgs1 /* tclPkg.c:59:3 */

// Helper macros.

//----------------------------------------------------------------------
//
// Tcl_PkgProvide / Tcl_PkgProvideEx --
//
//	This function is invoked to declare that a particular version of a
//	particular package is now present in an interpreter. There must not be
//	any other version of this package already provided in the interpreter.
//
// Results:
//	Normally returns TCL_OK; if there is already another version of the
//	package loaded then TCL_ERROR is returned and an error message is left
//	in the interp's result.
//
// Side effects:
//	The interpreter remembers that this package is available, so that no
//	other version of the package may be provided for the interpreter.
//
//----------------------------------------------------------------------

func XTcl_PkgProvide(tls *libc.TLS, interp uintptr, name uintptr, version uintptr) int32 { /* tclPkg.c:126:1: */
	return XTcl_PkgProvideEx(tls, interp, name, version, uintptr(0))
}

func XTcl_PkgProvideEx(tls *libc.TLS, interp uintptr, name uintptr, version uintptr, clientData uintptr) int32 { /* tclPkg.c:136:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var pkgPtr uintptr
	// var pvi uintptr at bp+56, 8

	// var vi uintptr at bp+64, 8

	var res int32

	pkgPtr = sFindPackage(tls, interp, name)
	if (*Package)(unsafe.Pointer(pkgPtr)).Fversion == uintptr(0) {
		(*Package)(unsafe.Pointer(pkgPtr)).Fversion = XTcl_NewStringObj(tls, version, -1)
		(*Tcl_Obj)(unsafe.Pointer((*Package)(unsafe.Pointer(pkgPtr)).Fversion)).FrefCount++
		(*Package)(unsafe.Pointer(pkgPtr)).FclientData = clientData
		return TCL_OK
	}

	if sCheckVersionAndConvert(tls, interp, XTcl_GetString(tls, (*Package)(unsafe.Pointer(pkgPtr)).Fversion), bp+56,
		uintptr(0)) != TCL_OK {
		return TCL_ERROR
	} else if sCheckVersionAndConvert(tls, interp, version, bp+64, uintptr(0)) != TCL_OK {
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 56)))
		return TCL_ERROR
	}

	res = sCompareVersions(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pvi */)), *(*uintptr)(unsafe.Pointer(bp + 64 /* vi */)), uintptr(0))
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 56)))
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))

	if res == 0 {
		if clientData != uintptr(0) {
			(*Package)(unsafe.Pointer(pkgPtr)).FclientData = clientData
		}
		return TCL_OK
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+55862,
		libc.VaList(bp, name, XTcl_GetString(tls, (*Package)(unsafe.Pointer(pkgPtr)).Fversion), version)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+3593, ts+55922, ts+55930, uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_PkgRequire / Tcl_PkgRequireEx / Tcl_PkgRequireProc --
//
//	This function is called by code that depends on a particular version
//	of a particular package. If the package is not already provided in the
//	interpreter, this function invokes a Tcl script to provide it. If the
//	package is already provided, this function makes sure that the
//	caller's needs don't conflict with the version that is present.
//
// Results:
//	If successful, returns the version string for the currently provided
//	version of the package, which may be different from the "version"
//	argument. If the caller's requirements cannot be met (e.g. the version
//	requested conflicts with a currently provided version, or the required
//	version cannot be found, or the script to provide the required version
//	generates an error), NULL is returned and an error message is left in
//	the interp's result.
//
// Side effects:
//	The script from some previous "package ifneeded" command may be
//	invoked to provide the package.
//
//----------------------------------------------------------------------

func XTcl_PkgRequire(tls *libc.TLS, interp uintptr, name uintptr, version uintptr, exact int32) uintptr { /* tclPkg.c:209:12: */
	return XTcl_PkgRequireEx(tls, interp, name, version, exact, uintptr(0))
}

func XTcl_PkgRequireEx(tls *libc.TLS, interp uintptr, name uintptr, version uintptr, exact int32, clientDataPtr uintptr) uintptr { /* tclPkg.c:223:12: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	// var ov uintptr at bp+64, 8

	var result uintptr = uintptr(0)

	// If an attempt is being made to load this into a standalone executable
	// on a platform where backlinking is not supported then this must be a
	// shared version of Tcl (Otherwise the load would have failed). Detect
	// this situation by checking that this library has been correctly
	// initialised. If it has not been then return immediately as nothing will
	// work.

	if XtclEmptyStringRep == uintptr(0) {
		// OK, so what's going on here?
		//
		// First, what are we doing? We are performing a check on behalf of
		// one particular caller, Tcl_InitStubs(). When a package is stub-
		// enabled, it is statically linked to libtclstub.a, which contains a
		// copy of Tcl_InitStubs(). When a stub-enabled package is loaded, its
		// *_Init() function is supposed to call Tcl_InitStubs() before
		// calling any other functions in the Tcl library. The first Tcl
		// function called by Tcl_InitStubs() through the stub table is
		// Tcl_PkgRequireEx(), so this code right here is the first code that
		// is part of the original Tcl library in the executable that gets
		// executed on behalf of a newly loaded stub-enabled package.
		//
		// One easy error for the developer/builder of a stub-enabled package
		// to make is to forget to define USE_TCL_STUBS when compiling the
		// package. When that happens, the package will contain symbols that
		// are references to the Tcl library, rather than function pointers
		// referencing the stub table. On platforms that lack backlinking,
		// those unresolved references may cause the loading of the package to
		// also load a second copy of the Tcl library, leading to all kinds of
		// trouble. We would like to catch that error and report a useful
		// message back to the user. That's what we're doing.
		//
		// Second, how does this work? If we reach this point, then the global
		// variable tclEmptyStringRep has the value NULL. Compare that with
		// the definition of tclEmptyStringRep near the top of the file
		// generic/tclObj.c. It clearly should not have the value NULL; it
		// should point to the char tclEmptyString. If we see it having the
		// value NULL, then somehow we are seeing a Tcl library that isn't
		// completely initialized, and that's an indicator for the error
		// condition described above. (Further explanation is welcome.)
		//
		// Third, so what do we do about it? This situation indicates the
		// package we just loaded wasn't properly compiled to be stub-enabled,
		// yet it thinks it is stub-enabled (it called Tcl_InitStubs()). We
		// want to report that the package just loaded is broken, so we want
		// to place an error message in the interpreter result and return NULL
		// to indicate failure to Tcl_InitStubs() so that it will also fail.
		// (Further explanation why we don't want to Tcl_Panic() is welcome.
		// After all, two Tcl libraries can't be a good thing!)
		//
		// Trouble is that's going to be tricky. We're now using a Tcl library
		// that's not fully initialized. In particular, it doesn't have a
		// proper value for tclEmptyStringRep. The Tcl_Obj system heavily
		// depends on the value of tclEmptyStringRep and all of Tcl depends
		// (increasingly) on the Tcl_Obj system, we need to correct that flaw
		// before making the calls to set the interpreter result to the error
		// message. That's the only flaw corrected; other problems with
		// initialization of the Tcl library are not remedied, so be very
		// careful about adding any other calls here without checking how they
		// behave when initialization is incomplete.

		XtclEmptyStringRep = uintptr(unsafe.Pointer(&XtclEmptyString))
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

			ts+55946, libc.VaList(bp, name)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+55922, ts+56044, uintptr(0)))
		return uintptr(0)
	}

	// Translate between old and new API, and defer to the new function.

	if version == uintptr(0) {
		if XTcl_PkgRequireProc(tls, interp, name, 0, uintptr(0), clientDataPtr) == TCL_OK {
			result = XTcl_GetString(tls, XTcl_GetObjResult(tls, interp))
			XTcl_ResetResult(tls, interp)
		}
	} else {
		if exact != 0 && TCL_OK !=
			sCheckVersionAndConvert(tls, interp, version, uintptr(0), uintptr(0)) {
			return uintptr(0)
		}
		*(*uintptr)(unsafe.Pointer(bp + 64 /* ov */)) = XTcl_NewStringObj(tls, version, -1)
		if exact != 0 {
			XTcl_AppendStringsToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* ov */)), libc.VaList(bp+40, ts+5772, version, uintptr(0)))
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FrefCount++
		if XTcl_PkgRequireProc(tls, interp, name, 1, bp+64, clientDataPtr) == TCL_OK {
			result = XTcl_GetString(tls, XTcl_GetObjResult(tls, interp))
			XTcl_ResetResult(tls, interp)
		}
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
					} else {
						*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 64))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* ov */)))
			}
		}

	}
	return result
}

func XTcl_PkgRequireProc(tls *libc.TLS, interp uintptr, name uintptr, reqc int32, reqv uintptr, clientDataPtr uintptr) int32 { /* tclPkg.c:342:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var args RequireProcArgs at bp, 16

	(*RequireProcArgs)(unsafe.Pointer(bp /* &args */)).Fname = name
	(*RequireProcArgs)(unsafe.Pointer(bp /* &args */)).FclientDataPtr = clientDataPtr
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sTclNRPkgRequireProc})), bp /* &args */, reqc, reqv)
}

func sTclNRPkgRequireProc(tls *libc.TLS, clientData ClientData, interp uintptr, reqc int32, reqv uintptr) int32 { /* tclPkg.c:359:1: */
	var args uintptr = clientData
	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sPkgRequireCore})), (*RequireProcArgs)(unsafe.Pointer(args)).Fname, uintptr(Intptr_t(reqc)), reqv, (*RequireProcArgs)(unsafe.Pointer(args)).FclientDataPtr)
	return TCL_OK
}

func sPkgRequireCore(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclPkg.c:370:1: */
	var name uintptr = *(*ClientData)(unsafe.Pointer(data))
	var reqc int32 = int32(*(*ClientData)(unsafe.Pointer(data + 1*8)))
	var reqv uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))
	var code int32 = sCheckAllRequirements(tls, interp, reqc, reqv)
	var reqPtr uintptr
	if code != TCL_OK {
		return code
	}
	reqPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Require{})))
	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sPkgRequireCoreCleanup})), reqPtr, uintptr(0), uintptr(0), uintptr(0))
	(*Require)(unsafe.Pointer(reqPtr)).FclientDataPtr = *(*ClientData)(unsafe.Pointer(data + 3*8))
	(*Require)(unsafe.Pointer(reqPtr)).Fname = name
	(*Require)(unsafe.Pointer(reqPtr)).FpkgPtr = sFindPackage(tls, interp, name)
	if (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion == uintptr(0) {
		XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sSelectPackage})), reqPtr, uintptr(Intptr_t(reqc)), reqv, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sPkgRequireCoreStep1})))
	} else {
		XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sPkgRequireCoreFinal})), reqPtr, uintptr(Intptr_t(reqc)), reqv, uintptr(0))
	}
	return TCL_OK
}

func sPkgRequireCoreStep1(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclPkg.c:394:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	// var command Tcl_DString at bp, 216

	var script uintptr
	var reqPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var reqc int32 = int32(*(*ClientData)(unsafe.Pointer(data + 1*8)))
	var reqv uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))
	var name uintptr = (*Require)(unsafe.Pointer(reqPtr)).Fname
	if (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion == uintptr(0) {
		// The package is not in the database. If there is a "package unknown"
		// command, invoke it.

		script = (*Interp)(unsafe.Pointer(interp)).FpackageUnknown
		if script == uintptr(0) {
			XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sPkgRequireCoreFinal})), reqPtr, uintptr(Intptr_t(reqc)), reqv, uintptr(0))
		} else {
			XTcl_DStringInit(tls, bp)
			XTcl_DStringAppend(tls, bp, script, -1)
			XTcl_DStringAppendElement(tls, bp, name)
			sAddRequirementsToDString(tls, bp, reqc, reqv)

			XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sPkgRequireCoreStep2})), reqPtr, uintptr(Intptr_t(reqc)), reqv, uintptr(0))
			XTcl_NREvalObj(tls, interp,
				XTcl_NewStringObj(tls, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring, (*Tcl_DString)(unsafe.Pointer(bp)).Flength),
				TCL_EVAL_GLOBAL)
			XTcl_DStringFree(tls, bp)
		}
		return TCL_OK
	} else {
		XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sPkgRequireCoreFinal})), reqPtr, uintptr(Intptr_t(reqc)), reqv, uintptr(0))
	}
	return TCL_OK
}

func sPkgRequireCoreStep2(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclPkg.c:431:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var reqPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var reqc int32 = int32(*(*ClientData)(unsafe.Pointer(data + 1*8)))
	var reqv uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))
	var name uintptr = (*Require)(unsafe.Pointer(reqPtr)).Fname
	if result != TCL_OK && result != TCL_ERROR {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+56054, libc.VaList(bp, result)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+55922, ts+56074, uintptr(0)))
		result = TCL_ERROR
	}
	if result == TCL_ERROR {
		XTcl_AddErrorInfo(tls, interp,
			ts+56084)
		return result
	}
	XTcl_ResetResult(tls, interp)
	// pkgPtr may now be invalid, so refresh it.
	(*Require)(unsafe.Pointer(reqPtr)).FpkgPtr = sFindPackage(tls, interp, name)
	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sSelectPackage})), reqPtr, uintptr(Intptr_t(reqc)), reqv, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sPkgRequireCoreFinal})))
	return TCL_OK
}

func sPkgRequireCoreFinal(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclPkg.c:455:1: */
	bp := tls.Alloc(96)
	defer tls.Free(96)

	var reqPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var reqc int32 = int32(*(*ClientData)(unsafe.Pointer(data + 1*8)))
	var satisfies int32
	var reqv uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))
	// var pkgVersionI uintptr at bp+88, 8

	var clientDataPtr uintptr = (*Require)(unsafe.Pointer(reqPtr)).FclientDataPtr
	var name uintptr = (*Require)(unsafe.Pointer(reqPtr)).Fname
	if (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+56116, libc.VaList(bp, name)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+55922, ts+56138, uintptr(0)))
		sAddRequirementsToResult(tls, interp, reqc, reqv)
		return TCL_ERROR
	}

	// Ensure that the provided version meets the current requirements.

	if reqc != 0 {
		sCheckVersionAndConvert(tls, interp, XTcl_GetString(tls, (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion),
			bp+88, uintptr(0))
		satisfies = sSomeRequirementSatisfied(tls, *(*uintptr)(unsafe.Pointer(bp + 88 /* pkgVersionI */)), reqc, reqv)

		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 88)))

		if !(satisfies != 0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+56146,
				libc.VaList(bp+40, name, XTcl_GetString(tls, (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion))))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+3593, ts+55922, ts+55930,
				uintptr(0)))
			sAddRequirementsToResult(tls, interp, reqc, reqv)
			return TCL_ERROR
		}
	}

	if clientDataPtr != 0 {
		var ptr uintptr = clientDataPtr

		*(*uintptr)(unsafe.Pointer(ptr)) = (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).FclientData
	}
	XTcl_SetObjResult(tls, interp, (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion)
	return TCL_OK
}

func sPkgRequireCoreCleanup(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclPkg.c:502:1: */
	XTclpFree(tls, *(*ClientData)(unsafe.Pointer(data)))
	return result
}

func sSelectPackage(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclPkg.c:509:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	var availPtr uintptr
	var bestPtr uintptr
	var bestStablePtr uintptr
	// var availVersion uintptr at bp+56, 8

	// var bestVersion uintptr at bp+72, 8

	// var bestStableVersion uintptr at bp+80, 8

	// Internal rep. of versions
	// var availStable int32 at bp+64, 4

	var satisfies int32
	var reqPtr uintptr
	var reqc int32
	var reqv uintptr
	var name uintptr
	var pkgPtr uintptr
	var iPtr uintptr
	var res int32
	var res1 int32
	// We found an ifneeded script for the package. Be careful while
	// executing it: this could cause reentrancy, so (a) protect the
	// script itself from deletion and (b) don't assume that bestPtr
	// will still exist when the script completes.

	var versionToProvide uintptr
	reqPtr = *(*ClientData)(unsafe.Pointer(data))
	reqc = int32(*(*ClientData)(unsafe.Pointer(data + 1*8)))
	reqv = *(*ClientData)(unsafe.Pointer(data + 2*8))
	name = (*Require)(unsafe.Pointer(reqPtr)).Fname
	pkgPtr = (*Require)(unsafe.Pointer(reqPtr)).FpkgPtr
	iPtr = interp

	// Check whether we're already attempting to load some version of this
	// package (circular dependency detection).

	if !((*Package)(unsafe.Pointer(pkgPtr)).FclientData != uintptr(0)) {
		goto __1
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+56195,
		libc.VaList(bp, name, (*Package)(unsafe.Pointer(pkgPtr)).FclientData, name)))
	sAddRequirementsToResult(tls, interp, reqc, reqv)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+3593, ts+55922, ts+52537, uintptr(0)))
	return TCL_ERROR
__1:
	;

	// The package isn't yet present. Search the list of available
	// versions and invoke the script for the best available version. We
	// are actually locating the best, and the best stable version. One of
	// them is then chosen based on the selection mode.

	bestPtr = uintptr(0)
	bestStablePtr = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 72 /* bestVersion */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 80 /* bestStableVersion */)) = uintptr(0)

	availPtr = (*Package)(unsafe.Pointer(pkgPtr)).FavailPtr
__2:
	if !(availPtr != uintptr(0)) {
		goto __4
	}
	if !(sCheckVersionAndConvert(tls, interp, (*PkgAvail)(unsafe.Pointer(availPtr)).Fversion,
		bp+56, bp+64) != TCL_OK) {
		goto __5
	}
	// The provided version number has invalid syntax. This
	// should not happen. This should have been caught by the
	// 'package ifneeded' registering the package.

	goto __3
__5:
	;

	// Check satisfaction of requirements before considering the current version further.
	if !(reqc > 0) {
		goto __6
	}
	satisfies = sSomeRequirementSatisfied(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* availVersion */)), reqc, reqv)
	if !!(satisfies != 0) {
		goto __7
	}
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 56)))
	*(*uintptr)(unsafe.Pointer(bp + 56 /* availVersion */)) = uintptr(0)
	goto __3
__7:
	;
__6:
	;

	if !(bestPtr != uintptr(0)) {
		goto __8
	}
	res = sCompareVersions(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* availVersion */)), *(*uintptr)(unsafe.Pointer(bp + 72 /* bestVersion */)), uintptr(0))

	// Note: Used internal reps in the comparison!

	if !(res > 0) {
		goto __10
	}
	// The version of the package sought is better than the
	// currently selected version.
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 72)))
	*(*uintptr)(unsafe.Pointer(bp + 72 /* bestVersion */)) = uintptr(0)
	goto newbest
__10:
	;
	goto __9
__8:
newbest:
	// We have found a version which is better than our max.

	bestPtr = availPtr
	sCheckVersionAndConvert(tls, interp, (*PkgAvail)(unsafe.Pointer(bestPtr)).Fversion, bp+72, uintptr(0))
__9:
	;

	if !!(*(*int32)(unsafe.Pointer(bp + 64)) != 0) {
		goto __11
	}
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 56)))
	*(*uintptr)(unsafe.Pointer(bp + 56 /* availVersion */)) = uintptr(0)
	goto __3
__11:
	;

	if !(bestStablePtr != uintptr(0)) {
		goto __12
	}
	res1 = sCompareVersions(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* availVersion */)), *(*uintptr)(unsafe.Pointer(bp + 80 /* bestStableVersion */)), uintptr(0))

	// Note: Used internal reps in the comparison!

	if !(res1 > 0) {
		goto __14
	}
	// This stable version of the package sought is better
	// than the currently selected stable version.
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 80)))
	*(*uintptr)(unsafe.Pointer(bp + 80 /* bestStableVersion */)) = uintptr(0)
	goto newstable
__14:
	;
	goto __13
__12:
newstable:
	// We have found a stable version which is better than our max stable.
	bestStablePtr = availPtr
	sCheckVersionAndConvert(tls, interp, (*PkgAvail)(unsafe.Pointer(bestStablePtr)).Fversion, bp+80, uintptr(0))
__13:
	;

	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 56)))
	*(*uintptr)(unsafe.Pointer(bp + 56 /* availVersion */)) = uintptr(0)
	goto __3
__3:
	availPtr = (*PkgAvail)(unsafe.Pointer(availPtr)).FnextPtr
	goto __2
	goto __4
__4:
	; // end for

	// Clean up memorized internal reps, if any.

	if !(*(*uintptr)(unsafe.Pointer(bp + 72)) != uintptr(0)) {
		goto __15
	}
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 72)))
	*(*uintptr)(unsafe.Pointer(bp + 72 /* bestVersion */)) = uintptr(0)
__15:
	;

	if !(*(*uintptr)(unsafe.Pointer(bp + 80)) != uintptr(0)) {
		goto __16
	}
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 80)))
	*(*uintptr)(unsafe.Pointer(bp + 80 /* bestStableVersion */)) = uintptr(0)
__16:
	;

	// Now choose a version among the two best. For 'latest' we simply
	// take (actually keep) the best. For 'stable' we take the best
	// stable, if there is any, or the best if there is nothing stable.

	if !((*Interp)(unsafe.Pointer(iPtr)).FpackagePrefer == PKG_PREFER_STABLE &&
		bestStablePtr != uintptr(0)) {
		goto __17
	}
	bestPtr = bestStablePtr
__17:
	;

	if !(bestPtr == uintptr(0)) {
		goto __18
	}
	XTcl_NRAddCallback(tls, interp, *(*ClientData)(unsafe.Pointer(data + 3*8)), reqPtr, uintptr(Intptr_t(reqc)), reqv, uintptr(0))
	goto __19
__18:
	// We found an ifneeded script for the package. Be careful while
	// executing it: this could cause reentrancy, so (a) protect the
	// script itself from deletion and (b) don't assume that bestPtr
	// will still exist when the script completes.

	versionToProvide = (*PkgAvail)(unsafe.Pointer(bestPtr)).Fversion

	(*Package)(unsafe.Pointer(pkgPtr)).FclientData = versionToProvide
	XTcl_Preserve(tls, versionToProvide)
	(*Require)(unsafe.Pointer(reqPtr)).FversionToProvide = versionToProvide
	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sSelectPackageFinal})), reqPtr, uintptr(Intptr_t(reqc)), reqv, *(*ClientData)(unsafe.Pointer(data + 3*8)))
	XTcl_NREvalObj(tls, interp, XTcl_NewStringObj(tls, (*PkgAvail)(unsafe.Pointer(bestPtr)).Fscript, -1), TCL_EVAL_GLOBAL)
__19:
	;
	return TCL_OK
}

func sSelectPackageFinal(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclPkg.c:675:1: */
	bp := tls.Alloc(208)
	defer tls.Free(208)

	var reqPtr uintptr = *(*ClientData)(unsafe.Pointer(data))
	var reqc int32 = int32(*(*ClientData)(unsafe.Pointer(data + 1*8)))
	var reqv uintptr = *(*ClientData)(unsafe.Pointer(data + 2*8))
	var name uintptr = (*Require)(unsafe.Pointer(reqPtr)).Fname
	var versionToProvide uintptr = (*Require)(unsafe.Pointer(reqPtr)).FversionToProvide

	(*Require)(unsafe.Pointer(reqPtr)).FpkgPtr = sFindPackage(tls, interp, name)
	if result == TCL_OK {
		XTcl_ResetResult(tls, interp)
		if (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion == uintptr(0) {
			result = TCL_ERROR
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

				ts+56261,
				libc.VaList(bp, name, versionToProvide, name)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+3593, ts+55922, ts+56336,
				uintptr(0)))
		} else {
			// var pvi uintptr at bp+192, 8

			// var vi uintptr at bp+200, 8

			if TCL_OK != sCheckVersionAndConvert(tls, interp,
				XTcl_GetString(tls, (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion), bp+192, uintptr(0)) {
				result = TCL_ERROR
			} else if sCheckVersionAndConvert(tls, interp,
				versionToProvide, bp+200, uintptr(0)) != TCL_OK {
				XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 192)))
				result = TCL_ERROR
			} else {
				var res int32 = sCompareVersions(tls, *(*uintptr)(unsafe.Pointer(bp + 192 /* pvi */)), *(*uintptr)(unsafe.Pointer(bp + 200 /* vi */)), uintptr(0))

				XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 192)))
				XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 200)))
				if res != 0 {
					result = TCL_ERROR
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

						ts+56347,
						libc.VaList(bp+56, name, versionToProvide,
							name, XTcl_GetString(tls, (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion))))
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, ts+3593, ts+55922,
						ts+56419, uintptr(0)))
				}
			}
		}
	} else if result != TCL_ERROR {
		var codePtr uintptr

		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					codePtr = XTclThreadAllocObj(tls)
				} else {
					codePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(codePtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(codePtr)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(codePtr)).Fbytes = uintptr(0)
			*(*int64)(unsafe.Pointer(codePtr + 32)) = int64(result)
			(*Tcl_Obj)(unsafe.Pointer(codePtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
			{
			}
		}
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

			ts+56432,
			libc.VaList(bp+120, name, versionToProvide, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(codePtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(codePtr)).Fbytes
				}
				return XTcl_GetString(tls, codePtr)
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+144, ts+3593, ts+55922, ts+56074, uintptr(0)))
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(codePtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(codePtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(codePtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(codePtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(codePtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(codePtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(codePtr)).Flength = -1
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, codePtr)
					} else {
						*(*uintptr)(unsafe.Pointer(codePtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = codePtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, codePtr)
			}
		}

		result = TCL_ERROR
	}

	if result == TCL_ERROR {
		XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
			ts+56493,
			libc.VaList(bp+176, name, versionToProvide)))
	}
	XTcl_Release(tls, versionToProvide)

	if result != TCL_OK {
		// Take a non-TCL_OK code from the script as an indication the
		// package wasn't loaded properly, so the package system
		// should not remember an improper load.
		//
		// This is consistent with our returning NULL. If we're not
		// willing to tell our caller we got a particular version, we
		// shouldn't store that version for telling future callers
		// either.

		if (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion != uintptr(0) {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var _objPtr uintptr = (*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			(*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).Fversion = uintptr(0)
		}
		(*Package)(unsafe.Pointer((*Require)(unsafe.Pointer(reqPtr)).FpkgPtr)).FclientData = uintptr(0)
		return result
	}

	XTcl_NRAddCallback(tls, interp, *(*ClientData)(unsafe.Pointer(data + 3*8)), reqPtr, uintptr(Intptr_t(reqc)), reqv, uintptr(0))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_PkgPresent / Tcl_PkgPresentEx --
//
//	Checks to see whether the specified package is present. If it is not
//	then no additional action is taken.
//
// Results:
//	If successful, returns the version string for the currently provided
//	version of the package, which may be different from the "version"
//	argument. If the caller's requirements cannot be met (e.g. the version
//	requested conflicts with a currently provided version), NULL is
//	returned and an error message is left in interp->result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_PkgPresent(tls *libc.TLS, interp uintptr, name uintptr, version uintptr, exact int32) uintptr { /* tclPkg.c:786:12: */
	return XTcl_PkgPresentEx(tls, interp, name, version, exact, uintptr(0))
}

func XTcl_PkgPresentEx(tls *libc.TLS, interp uintptr, name uintptr, version uintptr, exact int32, clientDataPtr uintptr) uintptr { /* tclPkg.c:800:12: */
	bp := tls.Alloc(104)
	defer tls.Free(104)

	var iPtr uintptr = interp
	var hPtr uintptr
	var pkgPtr uintptr

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 224 /* &.packageTable */)).FfindProc})).f(tls, iPtr+224 /* &.packageTable */, name)
	if hPtr != 0 {
		pkgPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		if (*Package)(unsafe.Pointer(pkgPtr)).Fversion != uintptr(0) {
			// At this point we know that the package is present. Make sure
			// that the provided version meets the current requirement by
			// calling Tcl_PkgRequireEx() to check for us.

			var foundVersion uintptr = XTcl_PkgRequireEx(tls, interp, name, version,
				exact, clientDataPtr)

			if foundVersion == uintptr(0) {
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7170, ts+55922, name,
					uintptr(0)))
			}
			return foundVersion
		}
	}

	if version != uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+56532, libc.VaList(bp+40, name, version)))
	} else {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+56561, libc.VaList(bp+56, name)))
	}
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+7170, ts+55922, name, uintptr(0)))
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_PackageObjCmd --
//
//	This function is invoked to process the "package" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------
func XTcl_PackageObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclPkg.c:868:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRPackageObjCmd})), uintptr(0), objc, objv)
}

// ARGSUSED
func XTclNRPackageObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclPkg.c:879:1: */
	bp := tls.Alloc(128)
	defer tls.Free(128)

	var iPtr uintptr
	// var optionIndex int32 at bp+24, 4

	var exact int32
	var i int32
	// var newobjc int32 at bp+80, 4

	var satisfies int32
	var availPtr uintptr
	var prevPtr uintptr
	var pkgPtr uintptr
	var hPtr uintptr
	// var search Tcl_HashSearch at bp+56, 24

	var tablePtr uintptr
	var version uintptr
	var argv2 uintptr
	var argv3 uintptr
	var argv4 uintptr
	// var iva uintptr at bp+104, 8

	// var ivb uintptr at bp+112, 8

	var objvListPtr uintptr
	// var newObjvPtr uintptr at bp+88, 8

	var _objPtr uintptr
	var keyString uintptr
	// var length int32 at bp+40, 4

	var res int32
	// var argv3i uintptr at bp+32, 8

	// var avi uintptr at bp+48, 8

	var resultObj uintptr
	var name uintptr
	var ov uintptr
	var newobjv uintptr
	// var length1 int32 at bp+96, 4

	// Seting the value.

	// var newPref int32 at bp+100, 4

	var resultObj1 uintptr
	// var argv2i uintptr at bp+120, 8
	iPtr = interp
	*(*uintptr)(unsafe.Pointer(bp + 104 /* iva */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 112 /* ivb */)) = uintptr(0)

	if !(objc < 2) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+56587)
	return TCL_ERROR
__1:
	;

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&pkgOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+24) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 24 /* optionIndex */))) {
	case uint32(0) /* PKG_FORGET */ :
		goto __4
	case uint32(1) /* PKG_IFNEEDED */ :
		goto __5
	case uint32(2) /* PKG_NAMES */ :
		goto __6
	case uint32(4) /* PKG_PRESENT */ :
		goto __7
	case uint32(5) /* PKG_PROVIDE */ :
		goto __8
	case uint32(6) /* PKG_REQUIRE */ :
		goto __9
	case uint32(7) /* PKG_UNKNOWN */ :
		goto __10
	case uint32(3) /* PKG_PREFER */ :
		goto __11
	case uint32(8) /* PKG_VCOMPARE */ :
		goto __12
	case uint32(9) /* PKG_VERSIONS */ :
		goto __13
	case uint32(10) /* PKG_VSATISFIES */ :
		goto __14
	default:
		goto __15
	}
	goto __3
__4:

	i = 2
__16:
	if !(i < objc) {
		goto __18
	}
	keyString = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}()
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 224 /* &.packageTable */)).FfindProc})).f(tls, iPtr+224 /* &.packageTable */, keyString)
	if !(hPtr == uintptr(0)) {
		goto __19
	}
	goto __17
__19:
	;
	pkgPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	XTcl_DeleteHashEntry(tls, hPtr)
	if !((*Package)(unsafe.Pointer(pkgPtr)).Fversion != uintptr(0)) {
		goto __20
	}
__21:
	_objPtr = (*Package)(unsafe.Pointer(pkgPtr)).Fversion
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __24
	}
	XTclFreeObj(tls, _objPtr)
__24:
	;
	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
__20:
	;
__25:
	if !((*Package)(unsafe.Pointer(pkgPtr)).FavailPtr != uintptr(0)) {
		goto __26
	}
	availPtr = (*Package)(unsafe.Pointer(pkgPtr)).FavailPtr
	(*Package)(unsafe.Pointer(pkgPtr)).FavailPtr = (*PkgAvail)(unsafe.Pointer(availPtr)).FnextPtr
	XTcl_EventuallyFree(tls, (*PkgAvail)(unsafe.Pointer(availPtr)).Fversion, uintptr(3))
	XTcl_EventuallyFree(tls, (*PkgAvail)(unsafe.Pointer(availPtr)).Fscript, uintptr(3))
	XTclpFree(tls, availPtr)
	goto __25
__26:
	;
	XTclpFree(tls, pkgPtr)
	goto __17
__17:
	i++
	goto __16
	goto __18
__18:
	;
	goto __3

__5:

	if !(objc != 4 && objc != 5) {
		goto __27
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+56604)
	return TCL_ERROR
__27:
	;
	argv3 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}()
	if !(sCheckVersionAndConvert(tls, interp, argv3, bp+32, uintptr(0)) != TCL_OK) {
		goto __28
	}
	return TCL_ERROR
__28:
	;
	argv2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()
	if !(objc == 4) {
		goto __29
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 224 /* &.packageTable */)).FfindProc})).f(tls, iPtr+224 /* &.packageTable */, argv2)
	if !(hPtr == uintptr(0)) {
		goto __31
	}
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 32)))
	return TCL_OK
__31:
	;
	pkgPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	goto __30
__29:
	pkgPtr = sFindPackage(tls, interp, argv2)
__30:
	;
	argv3 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+40)

	availPtr = (*Package)(unsafe.Pointer(pkgPtr)).FavailPtr
	prevPtr = uintptr(0)
__32:
	if !(availPtr != uintptr(0)) {
		goto __34
	}
	if !(sCheckVersionAndConvert(tls, interp, (*PkgAvail)(unsafe.Pointer(availPtr)).Fversion, bp+48,
		uintptr(0)) != TCL_OK) {
		goto __35
	}
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 32)))
	return TCL_ERROR
__35:
	;

	res = sCompareVersions(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* avi */)), *(*uintptr)(unsafe.Pointer(bp + 32 /* argv3i */)), uintptr(0))
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 48)))

	if !(res == 0) {
		goto __36
	}
	if !(objc == 4) {
		goto __37
	}
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 32)))
	XTcl_SetObjResult(tls, interp,
		XTcl_NewStringObj(tls, (*PkgAvail)(unsafe.Pointer(availPtr)).Fscript, -1))
	return TCL_OK
__37:
	;
	XTcl_EventuallyFree(tls, (*PkgAvail)(unsafe.Pointer(availPtr)).Fscript, uintptr(3))
	goto __34
__36:
	;
	goto __33
__33:
	prevPtr = availPtr
	availPtr = (*PkgAvail)(unsafe.Pointer(availPtr)).FnextPtr
	goto __32
	goto __34
__34:
	;
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 32)))

	if !(objc == 4) {
		goto __38
	}
	return TCL_OK
__38:
	;
	if !(availPtr == uintptr(0)) {
		goto __39
	}
	availPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(PkgAvail{})))
	(*PkgAvail)(unsafe.Pointer(availPtr)).Fversion = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 40)))+uint32(1))
	libc.Xmemcpy(tls, (*PkgAvail)(unsafe.Pointer(availPtr)).Fversion, argv3, uint64(uint32(*(*int32)(unsafe.Pointer(bp + 40)))+uint32(1)))

	if !(prevPtr == uintptr(0)) {
		goto __40
	}
	(*PkgAvail)(unsafe.Pointer(availPtr)).FnextPtr = (*Package)(unsafe.Pointer(pkgPtr)).FavailPtr
	(*Package)(unsafe.Pointer(pkgPtr)).FavailPtr = availPtr
	goto __41
__40:
	(*PkgAvail)(unsafe.Pointer(availPtr)).FnextPtr = (*PkgAvail)(unsafe.Pointer(prevPtr)).FnextPtr
	(*PkgAvail)(unsafe.Pointer(prevPtr)).FnextPtr = availPtr
__41:
	;
__39:
	;
	argv4 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 4*8)), bp+40)
	(*PkgAvail)(unsafe.Pointer(availPtr)).Fscript = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 40)))+uint32(1))
	libc.Xmemcpy(tls, (*PkgAvail)(unsafe.Pointer(availPtr)).Fscript, argv4, uint64(uint32(*(*int32)(unsafe.Pointer(bp + 40)))+uint32(1)))
	goto __3

__6:
	if !(objc != 2) {
		goto __42
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
	return TCL_ERROR
	goto __43
__42:

	resultObj = XTcl_NewObj(tls)
	tablePtr = iPtr + 224
	hPtr = XTcl_FirstHashEntry(tls, tablePtr, bp+56)
__44:
	if !(hPtr != uintptr(0)) {
		goto __46
	}
	pkgPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !((*Package)(unsafe.Pointer(pkgPtr)).Fversion != uintptr(0) || (*Package)(unsafe.Pointer(pkgPtr)).FavailPtr != uintptr(0)) {
		goto __47
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, XTcl_NewStringObj(tls,
		func() uintptr {
			if (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == 1 || (*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == -1 {
				return *(*uintptr)(unsafe.Pointer(hPtr + 32))
			}
			return hPtr + 32
		}(), -1))
__47:
	;
	goto __45
__45:
	hPtr = XTcl_NextHashEntry(tls, bp+56)
	goto __44
	goto __46
__46:
	;
	XTcl_SetObjResult(tls, interp, resultObj)
__43:
	;
	goto __3
__7:

	if !(objc < 3) {
		goto __48
	}
	goto require
__48:
	;
	argv2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()
	if !(int32(*(*int8)(unsafe.Pointer(argv2))) == '-' && libc.Xstrcmp(tls, argv2, ts+14906) == 0) {
		goto __49
	}
	if !(objc != 5) {
		goto __51
	}
	goto requireSyntax
__51:
	;
	exact = 1
	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}()
	goto __50
__49:
	exact = 0
	name = argv2
__50:
	;

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 224 /* &.packageTable */)).FfindProc})).f(tls, iPtr+224 /* &.packageTable */, name)
	if !(hPtr != uintptr(0)) {
		goto __52
	}
	pkgPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !((*Package)(unsafe.Pointer(pkgPtr)).Fversion != uintptr(0)) {
		goto __53
	}
	goto require
__53:
	;
__52:
	;

	version = uintptr(0)
	if !(exact != 0) {
		goto __54
	}
	version = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 4*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 4*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 4*8)))
	}()
	if !(sCheckVersionAndConvert(tls, interp, version, uintptr(0),
		uintptr(0)) != TCL_OK) {
		goto __56
	}
	return TCL_ERROR
__56:
	;
	goto __55
__54:
	if !(sCheckAllRequirements(tls, interp, objc-3, objv+uintptr(3)*8) != TCL_OK) {
		goto __57
	}
	return TCL_ERROR
__57:
	;
	if !(objc > 3 && sCheckVersionAndConvert(tls, interp,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
		}(), uintptr(0), uintptr(0)) == TCL_OK) {
		goto __58
	}
	version = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}()
__58:
	;
__55:
	;
	XTcl_PkgPresentEx(tls, interp, name, version, exact, uintptr(0))
	return TCL_ERROR
	goto __3

__8:
	if !(objc != 3 && objc != 4) {
		goto __59
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+56629)
	return TCL_ERROR
__59:
	;
	argv2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()
	if !(objc == 3) {
		goto __60
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 224 /* &.packageTable */)).FfindProc})).f(tls, iPtr+224 /* &.packageTable */, argv2)
	if !(hPtr != uintptr(0)) {
		goto __61
	}
	pkgPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	if !((*Package)(unsafe.Pointer(pkgPtr)).Fversion != uintptr(0)) {
		goto __62
	}
	XTcl_SetObjResult(tls, interp, (*Package)(unsafe.Pointer(pkgPtr)).Fversion)
__62:
	;
__61:
	;
	return TCL_OK
__60:
	;
	argv3 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}()
	if !(sCheckVersionAndConvert(tls, interp, argv3, uintptr(0), uintptr(0)) != TCL_OK) {
		goto __63
	}
	return TCL_ERROR
__63:
	;
	return XTcl_PkgProvideEx(tls, interp, argv2, argv3, uintptr(0))
__9:
require:
	if !(objc < 3) {
		goto __64
	}
requireSyntax:
	XTcl_WrongNumArgs(tls, interp, 2, objv,
		ts+56647)
	return TCL_ERROR
__64:
	;

	version = uintptr(0)

	argv2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()
	if !(int32(*(*int8)(unsafe.Pointer(argv2))) == '-' && libc.Xstrcmp(tls, argv2, ts+14906) == 0) {
		goto __65
	}

	if !(objc != 5) {
		goto __67
	}
	goto requireSyntax
__67:
	;

	version = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 4*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 4*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 4*8)))
	}()
	if !(sCheckVersionAndConvert(tls, interp, version, uintptr(0),
		uintptr(0)) != TCL_OK) {
		goto __68
	}
	return TCL_ERROR
__68:
	;

	// Create a new-style requirement for the exact version.

	ov = XTcl_NewStringObj(tls, version, -1)
	XTcl_AppendStringsToObj(tls, ov, libc.VaList(bp, ts+5772, version, uintptr(0)))
	version = uintptr(0)
	argv3 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}()
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FrefCount++

	objvListPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	(*Tcl_Obj)(unsafe.Pointer(objvListPtr)).FrefCount++
	XTcl_ListObjAppendElement(tls, interp, objvListPtr, ov)
	XTcl_ListObjGetElements(tls, interp, objvListPtr, bp+80, bp+88)

	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTclNRPackageObjCmdCleanup})), *(*uintptr)(unsafe.Pointer(objv + 3*8)), objvListPtr, uintptr(0), uintptr(0))
	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sPkgRequireCore})), argv3, uintptr(Intptr_t(*(*int32)(unsafe.Pointer(bp + 80 /* newobjc */)))), *(*uintptr)(unsafe.Pointer(bp + 88 /* newObjvPtr */)), uintptr(0))
	return TCL_OK
	goto __66
__65:
	newobjv = objv + uintptr(3)*8
	*(*int32)(unsafe.Pointer(bp + 80 /* newobjc */)) = objc - 3

	if !(sCheckAllRequirements(tls, interp, objc-3, objv+uintptr(3)*8) != TCL_OK) {
		goto __69
	}
	return TCL_ERROR
__69:
	;
	objvListPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	(*Tcl_Obj)(unsafe.Pointer(objvListPtr)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FrefCount++
	i = 0
__70:
	if !(i < *(*int32)(unsafe.Pointer(bp + 80))) {
		goto __72
	}

	// Tcl_Obj structures may have come from another interpreter,
	// so duplicate them.

	XTcl_ListObjAppendElement(tls, interp, objvListPtr, XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(newobjv + uintptr(i)*8))))
	goto __71
__71:
	i++
	goto __70
	goto __72
__72:
	;
	XTcl_ListObjGetElements(tls, interp, objvListPtr, bp+80, bp+88)
	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sTclNRPackageObjCmdCleanup})), *(*uintptr)(unsafe.Pointer(objv + 2*8)), objvListPtr, uintptr(0), uintptr(0))
	XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sPkgRequireCore})), argv2, uintptr(Intptr_t(*(*int32)(unsafe.Pointer(bp + 80 /* newobjc */)))), *(*uintptr)(unsafe.Pointer(bp + 88 /* newObjvPtr */)), uintptr(0))
	return TCL_OK
__66:
	;
	goto __3
__10:

	if !(objc == 2) {
		goto __73
	}
	if !((*Interp)(unsafe.Pointer(iPtr)).FpackageUnknown != uintptr(0)) {
		goto __75
	}
	XTcl_SetObjResult(tls, interp,
		XTcl_NewStringObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FpackageUnknown, -1))
__75:
	;
	goto __74
__73:
	if !(objc == 3) {
		goto __76
	}
	if !((*Interp)(unsafe.Pointer(iPtr)).FpackageUnknown != uintptr(0)) {
		goto __78
	}
	XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).FpackageUnknown)
__78:
	;
	argv2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+96)
	if !(int32(*(*int8)(unsafe.Pointer(argv2))) == 0) {
		goto __79
	}
	(*Interp)(unsafe.Pointer(iPtr)).FpackageUnknown = uintptr(0)
	goto __80
__79:
	(*Interp)(unsafe.Pointer(iPtr)).FpackageUnknown = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 96)))+uint32(1))
	libc.Xmemcpy(tls, (*Interp)(unsafe.Pointer(iPtr)).FpackageUnknown, argv2, uint64(uint32(*(*int32)(unsafe.Pointer(bp + 96)))+uint32(1)))
__80:
	;
	goto __77
__76:
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+56682)
	return TCL_ERROR
__77:
	;
__74:
	;
	goto __3

__11:

	// See tclInt.h for the enum, just before Interp.

	if !(objc > 3) {
		goto __81
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+56692)
	return TCL_ERROR
	goto __82
__81:
	if !(objc == 3) {
		goto __83
	}

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&pkgPreferOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+56708, 0, bp+100) != TCL_OK) {
		goto __84
	}
	return TCL_ERROR
__84:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 100)) < (*Interp)(unsafe.Pointer(iPtr)).FpackagePrefer) {
		goto __85
	}
	(*Interp)(unsafe.Pointer(iPtr)).FpackagePrefer = *(*int32)(unsafe.Pointer(bp + 100 /* newPref */))
__85:
	;
__83:
	;
__82:
	;

	// Always return current value.

	XTcl_SetObjResult(tls, interp,
		XTcl_NewStringObj(tls, pkgPreferOptions[(*Interp)(unsafe.Pointer(iPtr)).FpackagePrefer], -1))
	goto __3

__12:
	if !(objc != 4) {
		goto __86
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+56719)
	return TCL_ERROR
__86:
	;
	argv3 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	}()
	argv2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()
	if !(sCheckVersionAndConvert(tls, interp, argv2, bp+104, uintptr(0)) != TCL_OK || sCheckVersionAndConvert(tls, interp, argv3, bp+112, uintptr(0)) != TCL_OK) {
		goto __87
	}
	if !(*(*uintptr)(unsafe.Pointer(bp + 104)) != uintptr(0)) {
		goto __88
	}
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 104)))
__88:
	;

	// ivb cannot be set in this branch.

	return TCL_ERROR
__87:
	;

	// Comparison is done on the internal representation.

	XTcl_SetObjResult(tls, interp,
		XTcl_NewIntObj(tls, sCompareVersions(tls, *(*uintptr)(unsafe.Pointer(bp + 104 /* iva */)), *(*uintptr)(unsafe.Pointer(bp + 112 /* ivb */)), uintptr(0))))
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 104)))
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 112)))
	goto __3
__13:
	if !(objc != 3) {
		goto __89
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+5264)
	return TCL_ERROR
	goto __90
__89:
	resultObj1 = XTcl_NewObj(tls)

	argv2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 224 /* &.packageTable */)).FfindProc})).f(tls, iPtr+224 /* &.packageTable */, argv2)
	if !(hPtr != uintptr(0)) {
		goto __91
	}
	pkgPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	availPtr = (*Package)(unsafe.Pointer(pkgPtr)).FavailPtr
__92:
	if !(availPtr != uintptr(0)) {
		goto __94
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj1,
		XTcl_NewStringObj(tls, (*PkgAvail)(unsafe.Pointer(availPtr)).Fversion, -1))
	goto __93
__93:
	availPtr = (*PkgAvail)(unsafe.Pointer(availPtr)).FnextPtr
	goto __92
	goto __94
__94:
	;
__91:
	;
	XTcl_SetObjResult(tls, interp, resultObj1)
__90:
	;
	goto __3
__14:
	*(*uintptr)(unsafe.Pointer(bp + 120 /* argv2i */)) = uintptr(0)

	if !(objc < 4) {
		goto __95
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+56737)
	return TCL_ERROR
__95:
	;

	argv2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()
	if !(sCheckVersionAndConvert(tls, interp, argv2, bp+120, uintptr(0)) != TCL_OK) {
		goto __96
	}
	return TCL_ERROR
	goto __97
__96:
	if !(sCheckAllRequirements(tls, interp, objc-3, objv+uintptr(3)*8) != TCL_OK) {
		goto __98
	}
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 120)))
	return TCL_ERROR
__98:
	;
__97:
	;

	satisfies = sSomeRequirementSatisfied(tls, *(*uintptr)(unsafe.Pointer(bp + 120 /* argv2i */)), objc-3, objv+uintptr(3)*8)
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 120)))

	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, libc.Bool32(satisfies != 0)))
	goto __3

__15:
	XTcl_Panic(tls, ts+56763, 0)
__3:
	;
	return TCL_OK
}

var pkgOptions = [12]uintptr{
	ts + 45717, ts + 56813, ts + 11701, ts + 56822, ts + 56829,
	ts + 56837, ts + 56845, ts + 12865, ts + 56853, ts + 56862,
	ts + 56871, uintptr(0),
} /* tclPkg.c:885:23 */
var pkgPreferOptions = [3]uintptr{
	ts + 56882, ts + 56889, uintptr(0),
} /* tclPkg.c:1190:20 */

func sTclNRPackageObjCmdCleanup(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclPkg.c:1304:1: */
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data)))).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data)))).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data)))).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data)))).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data)))).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, *(*ClientData)(unsafe.Pointer(data)))
				} else {
					*(*uintptr)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*ClientData)(unsafe.Pointer(data))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, *(*ClientData)(unsafe.Pointer(data)))
		}
	}

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data + 1*8)))).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data + 1*8)))).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data + 1*8)))).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data + 1*8)))).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data + 1*8)))).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data + 1*8)))).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data + 1*8)))).Flength = -1
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, *(*ClientData)(unsafe.Pointer(data + 1*8)))
				} else {
					*(*uintptr)(unsafe.Pointer(*(*ClientData)(unsafe.Pointer(data + 1*8)) + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*ClientData)(unsafe.Pointer(data + 1*8))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, *(*ClientData)(unsafe.Pointer(data + 1*8)))
		}
	}

	return result
}

//----------------------------------------------------------------------
//
// FindPackage --
//
//	This function finds the Package record for a particular package in a
//	particular interpreter, creating a record if one doesn't already
//	exist.
//
// Results:
//	The return value is a pointer to the Package record for the package.
//
// Side effects:
//	A new Package record may be created.
//
//----------------------------------------------------------------------

func sFindPackage(tls *libc.TLS, interp uintptr, name uintptr) uintptr { /* tclPkg.c:1328:16: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp
	var hPtr uintptr
	// var isNew int32 at bp, 4

	var pkgPtr uintptr

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 224 /* &.packageTable */)).FcreateProc})).f(tls, iPtr+224 /* &.packageTable */, name, bp /* &isNew */)
	if *(*int32)(unsafe.Pointer(bp)) != 0 {
		pkgPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Package{})))
		(*Package)(unsafe.Pointer(pkgPtr)).Fversion = uintptr(0)
		(*Package)(unsafe.Pointer(pkgPtr)).FavailPtr = uintptr(0)
		(*Package)(unsafe.Pointer(pkgPtr)).FclientData = uintptr(0)
		(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = pkgPtr
	} else {
		pkgPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	}
	return pkgPtr
}

//----------------------------------------------------------------------
//
// TclFreePackageInfo --
//
//	This function is called during interpreter deletion to free all of the
//	package-related information for the interpreter.
//
// Results:
//	None.
//
// Side effects:
//	Memory is freed.
//
//----------------------------------------------------------------------

func XTclFreePackageInfo(tls *libc.TLS, iPtr uintptr) { /* tclPkg.c:1369:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var pkgPtr uintptr
	// var search Tcl_HashSearch at bp, 24

	var hPtr uintptr
	var availPtr uintptr

	for hPtr = XTcl_FirstHashEntry(tls, iPtr+224, bp); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
		pkgPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
		if (*Package)(unsafe.Pointer(pkgPtr)).Fversion != uintptr(0) {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = (*Package)(unsafe.Pointer(pkgPtr)).Fversion
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		for (*Package)(unsafe.Pointer(pkgPtr)).FavailPtr != uintptr(0) {
			availPtr = (*Package)(unsafe.Pointer(pkgPtr)).FavailPtr
			(*Package)(unsafe.Pointer(pkgPtr)).FavailPtr = (*PkgAvail)(unsafe.Pointer(availPtr)).FnextPtr
			XTcl_EventuallyFree(tls, (*PkgAvail)(unsafe.Pointer(availPtr)).Fversion, uintptr(3))
			XTcl_EventuallyFree(tls, (*PkgAvail)(unsafe.Pointer(availPtr)).Fscript, uintptr(3))
			XTclpFree(tls, availPtr)
		}
		XTclpFree(tls, pkgPtr)
	}
	XTcl_DeleteHashTable(tls, iPtr+224)
	if (*Interp)(unsafe.Pointer(iPtr)).FpackageUnknown != uintptr(0) {
		XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).FpackageUnknown)
	}
}

//----------------------------------------------------------------------
//
// CheckVersionAndConvert --
//
//	This function checks to see whether a version number has valid syntax.
//	It also generates a semi-internal representation (string rep of a list
//	of numbers).
//
// Results:
//	If string is a properly formed version number the TCL_OK is returned.
//	Otherwise TCL_ERROR is returned and an error message is left in the
//	interp's result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sCheckVersionAndConvert(tls *libc.TLS, interp uintptr, string uintptr, internal uintptr, stable uintptr) int32 { /* tclPkg.c:1419:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var p uintptr
	var prevChar int8
	var hasunstable int32
	// 4* assuming that each char is a separator (a,b become ' -x ').
	// 4+ to have spce for an additional -2 at the end
	var ibuf uintptr
	var ip uintptr
	p = string
	hasunstable = 0
	ibuf = XTcl_Alloc(tls, uint32(uint64(4)+uint64(4)*libc.Xstrlen(tls, string)))
	ip = ibuf

	// Basic rules
	// (1) First character has to be a digit.
	// (2) All other characters have to be a digit or '.'
	// (3) Two '.'s may not follow each other.
	//
	// TIP 268, Modified rules
	// (1) s.a.
	// (2) All other characters have to be a digit, 'a', 'b', or '.'
	// (3) s.a.
	// (4) Only one of 'a' or 'b' may occur.
	// (5) Neither 'a', nor 'b' may occur before or after a '.'

	if !!(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(p)))))*2)))&int32(X_ISdigit) != 0) {
		goto __1
	} // INTL: digit
	goto error
__1:
	;

	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = *(*int8)(unsafe.Pointer(p))

	prevChar = *(*int8)(unsafe.Pointer(p))
	p++
__2:
	if !(int32(*(*int8)(unsafe.Pointer(p))) != 0) {
		goto __4
	}
	if !(!(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(p)))))*2)))&int32(X_ISdigit) != 0) && (int32(*(*int8)(unsafe.Pointer(p))) != '.' && int32(*(*int8)(unsafe.Pointer(p))) != 'a' && int32(*(*int8)(unsafe.Pointer(p))) != 'b' || (hasunstable != 0 && (int32(*(*int8)(unsafe.Pointer(p))) == 'a' || int32(*(*int8)(unsafe.Pointer(p))) == 'b') || (int32(prevChar) == 'a' || int32(prevChar) == 'b' || int32(prevChar) == '.') &&
		int32(*(*int8)(unsafe.Pointer(p))) == '.' || (int32(*(*int8)(unsafe.Pointer(p))) == 'a' || int32(*(*int8)(unsafe.Pointer(p))) == 'b' || int32(*(*int8)(unsafe.Pointer(p))) == '.') && int32(prevChar) == '.'))) {
		goto __5
	}
	goto error
__5:
	;

	if !(int32(*(*int8)(unsafe.Pointer(p))) == 'a' || int32(*(*int8)(unsafe.Pointer(p))) == 'b') {
		goto __6
	}
	hasunstable = 1
__6:
	;

	// Translation to the internal rep. Regular version chars are copied
	// as is. The separators are translated to numerics. The new separator
	// for all parts is space.

	if !(int32(*(*int8)(unsafe.Pointer(p))) == '.') {
		goto __7
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = int8(' ')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = int8('0')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = int8(' ')
	goto __8
__7:
	if !(int32(*(*int8)(unsafe.Pointer(p))) == 'a') {
		goto __9
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = int8(' ')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = int8('-')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = int8('2')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = int8(' ')
	goto __10
__9:
	if !(int32(*(*int8)(unsafe.Pointer(p))) == 'b') {
		goto __11
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = int8(' ')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = int8('-')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = int8('1')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = int8(' ')
	goto __12
__11:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&ip, 1))) = *(*int8)(unsafe.Pointer(p))
__12:
	;
__10:
	;
__8:
	;

	prevChar = *(*int8)(unsafe.Pointer(p))
	goto __3
__3:
	p++
	goto __2
	goto __4
__4:
	;
	if !(int32(prevChar) != '.' && int32(prevChar) != 'a' && int32(prevChar) != 'b') {
		goto __13
	}
	*(*int8)(unsafe.Pointer(ip)) = int8(0)
	if !(internal != uintptr(0)) {
		goto __14
	}
	*(*uintptr)(unsafe.Pointer(internal)) = ibuf
	goto __15
__14:
	XTclpFree(tls, ibuf)
__15:
	;
	if !(stable != uintptr(0)) {
		goto __16
	}
	*(*int32)(unsafe.Pointer(stable)) = libc.BoolInt32(!(hasunstable != 0))
__16:
	;
	return TCL_OK
__13:
	;

error:
	XTclpFree(tls, ibuf)
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+56896, libc.VaList(bp, string)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+6915, ts+56933, uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// CompareVersions --
//
//	This function compares two version numbers (in internal rep).
//
// Results:
//	The return value is -1 if v1 is less than v2, 0 if the two version
//	numbers are the same, and 1 if v1 is greater than v2. If *satPtr is
//	non-NULL, the word it points to is filled in with 1 if v2 >= v1 and
//	both numbers have the same major number or 0 otherwise.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sCompareVersions(tls *libc.TLS, v1 uintptr, v2 uintptr, isMajorPtr uintptr) int32 { /* tclPkg.c:1538:1: */
	var thisIsMajor int32
	var res int32
	var flip int32
	var s1 uintptr
	var e1 uintptr
	var s2 uintptr
	var e2 uintptr
	var o1 int8
	var o2 int8

	// Each iteration of the following loop processes one number from each
	// string, terminated by a " " (space). If those numbers don't match then
	// the comparison is over; otherwise, we loop back for the next number.
	//
	// TIP 268.
	// This is identical the function 'ComparePkgVersion', but using the new
	// space separator as used by the internal rep of version numbers. The
	// special separators 'a' and 'b' have already been dealt with in
	// 'CheckVersionAndConvert', they were translated into numbers as well.
	// This keeps the comparison sane. Otherwise we would have to compare
	// numerics, the separators, and also deal with the special case of
	// end-of-string compared to separators. The semi-list rep we get here is
	// much easier to handle, as it is still regular.
	//
	// Rewritten to not compute a numeric value for the extracted version
	// number, but do string comparison. Skip any leading zeros for that to
	// work. This change breaks through the 32bit-limit on version numbers.

	thisIsMajor = 1
	s1 = v1
	s2 = v2

	for 1 != 0 {
		// Parse one decimal number from the front of each string. Skip
		// leading zeros. Terminate found number for upcoming string-wise
		// comparison, if needed.

		for int32(*(*int8)(unsafe.Pointer(s1))) != 0 && int32(*(*int8)(unsafe.Pointer(s1))) == '0' {
			s1++
		}
		for int32(*(*int8)(unsafe.Pointer(s2))) != 0 && int32(*(*int8)(unsafe.Pointer(s2))) == '0' {
			s2++
		}

		// s1, s2 now point to the beginnings of the numbers to compare. Test
		// for their signs first, as shortcut to the result (different signs),
		// or determines if result has to be flipped (both negative). If there
		// is no shortcut we have to insert terminators later to limit the
		// strcmp.

		if int32(*(*int8)(unsafe.Pointer(s1))) == '-' && int32(*(*int8)(unsafe.Pointer(s2))) != '-' {
			// s1 < 0, s2 >= 0 => s1 < s2
			res = -1
			break
		}
		if int32(*(*int8)(unsafe.Pointer(s1))) != '-' && int32(*(*int8)(unsafe.Pointer(s2))) == '-' {
			// s1 >= 0, s2 < 0 => s1 > s2
			res = 1
			break
		}

		if int32(*(*int8)(unsafe.Pointer(s1))) == '-' && int32(*(*int8)(unsafe.Pointer(s2))) == '-' {
			// a < b => -a > -b, etc.
			s1++
			s2++
			flip = 1
		} else {
			flip = 0
		}

		// The string comparison is needed, so now we determine where the
		// numbers end.

		e1 = s1
		for int32(*(*int8)(unsafe.Pointer(e1))) != 0 && int32(*(*int8)(unsafe.Pointer(e1))) != ' ' {
			e1++
		}
		e2 = s2
		for int32(*(*int8)(unsafe.Pointer(e2))) != 0 && int32(*(*int8)(unsafe.Pointer(e2))) != ' ' {
			e2++
		}

		// s1 .. e1 and s2 .. e2 now bracket the numbers to compare. Insert
		// terminators, compare, and restore actual contents. First however
		// another shortcut. Compare lengths. Shorter string is smaller
		// number! Thus we strcmp only strings of identical length.

		if (int64(e1)-int64(s1))/1 < (int64(e2)-int64(s2))/1 {
			res = -1
		} else if (int64(e2)-int64(s2))/1 < (int64(e1)-int64(s1))/1 {
			res = 1
		} else {
			o1 = *(*int8)(unsafe.Pointer(e1))
			*(*int8)(unsafe.Pointer(e1)) = int8(0)
			o2 = *(*int8)(unsafe.Pointer(e2))
			*(*int8)(unsafe.Pointer(e2)) = int8(0)

			res = libc.Xstrcmp(tls, s1, s2)
			if res < 0 {
				res = -1
			} else {
				res = func() int32 {
					if res != 0 {
						return 1
					}
					return 0
				}()
			}

			*(*int8)(unsafe.Pointer(e1)) = o1
			*(*int8)(unsafe.Pointer(e2)) = o2
		}

		// Stop comparing segments when a difference has been found. Here we
		// may have to flip the result to account for signs.

		if res != 0 {
			if flip != 0 {
				res = -res
			}
			break
		}

		// Go on to the next version number if the current numbers match.
		// However stop processing if the end of both numbers has been
		// reached.

		s1 = e1
		s2 = e2

		if int32(*(*int8)(unsafe.Pointer(s1))) != 0 {
			s1++
		} else if int32(*(*int8)(unsafe.Pointer(s2))) == 0 {
			// s1, s2 both at the end => identical

			res = 0
			break
		}
		if int32(*(*int8)(unsafe.Pointer(s2))) != 0 {
			s2++
		}
		thisIsMajor = 0
	}

	if isMajorPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(isMajorPtr)) = thisIsMajor
	}

	return res
}

//----------------------------------------------------------------------
//
// CheckAllRequirements --
//
//	This function checks to see whether all requirements in a set have
//	valid syntax.
//
// Results:
//	TCL_OK is returned if all requirements are valid. Otherwise TCL_ERROR
//	is returned and an error message is left in the interp's result.
//
// Side effects:
//	May modify the interpreter result.
//
//----------------------------------------------------------------------

func sCheckAllRequirements(tls *libc.TLS, interp uintptr, reqc int32, reqv uintptr) int32 { /* tclPkg.c:1715:1: */
	var i int32

	for i = 0; i < reqc; i++ {
		if sCheckRequirement(tls, interp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(reqv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(reqv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(reqv + uintptr(i)*8)))
		}()) != TCL_OK {
			return TCL_ERROR
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// CheckRequirement --
//
//	This function checks to see whether a requirement has valid syntax.
//
// Results:
//	If string is a properly formed requirement then TCL_OK is returned.
//	Otherwise TCL_ERROR is returned and an error message is left in the
//	interp's result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sCheckRequirement(tls *libc.TLS, interp uintptr, string uintptr) int32 { /* tclPkg.c:1749:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	// Syntax of requirement = version
	//			     = version-version
	//			     = version-

	var dash uintptr = uintptr(0)
	var buf uintptr

	dash = libc.Xstrchr(tls, string, '-')
	if dash == uintptr(0) {
		// No dash found, has to be a simple version.

		return sCheckVersionAndConvert(tls, interp, string, uintptr(0), uintptr(0))
	}

	if libc.Xstrchr(tls, dash+uintptr(1), '-') != uintptr(0) {
		// More dashes found after the first. This is wrong.

		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+56941, libc.VaList(bp, string)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+6915, ts+56985, uintptr(0)))
		return TCL_ERROR
	}

	// Exactly one dash is present. Copy the string, split at the location of
	// dash and check that both parts are versions. Note that the max part can
	// be empty. Also note that the string allocated with strdup() must be
	// freed with free() and not ckfree().

	for ok := true; ok; ok = 0 != 0 {
		var local__len uint32 = uint32(libc.Xstrlen(tls, string) + uint64(1))
		buf = XTcl_Alloc(tls, local__len)
		libc.Xmemcpy(tls, buf, string, uint64(local__len))
	}
	dash = buf + uintptr((int64(dash)-int64(string))/1)
	*(*int8)(unsafe.Pointer(dash)) = int8(0) // buf now <=> min part
	dash++                                   // dash now <=> max part

	if sCheckVersionAndConvert(tls, interp, buf, uintptr(0), uintptr(0)) != TCL_OK || int32(*(*int8)(unsafe.Pointer(dash))) != 0 && sCheckVersionAndConvert(tls, interp, dash, uintptr(0), uintptr(0)) != TCL_OK {
		XTclpFree(tls, buf)
		return TCL_ERROR
	}

	XTclpFree(tls, buf)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// AddRequirementsToResult --
//
//	This function accumulates requirements in the interpreter result.
//
// Results:
//	None.
//
// Side effects:
//	The interpreter result is extended.
//
//----------------------------------------------------------------------

func sAddRequirementsToResult(tls *libc.TLS, interp uintptr, reqc int32, reqv uintptr) { /* tclPkg.c:1821:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	var result uintptr = XTcl_GetObjResult(tls, interp)
	var i int32
	// var length int32 at bp+16, 4

	for i = 0; i < reqc; i++ {
		var v uintptr = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(reqv + uintptr(i)*8)), bp+16)

		if *(*int32)(unsafe.Pointer(bp + 16))&0x1 != 0 && int32(*(*int8)(unsafe.Pointer(v + uintptr(*(*int32)(unsafe.Pointer(bp + 16))/2)))) == '-' &&
			libc.Xstrncmp(tls, v, v+uintptr((*(*int32)(unsafe.Pointer(bp + 16))+1)/2), uint64(*(*int32)(unsafe.Pointer(bp + 16))/2)) == 0 {
			XTcl_AppendPrintfToObj(tls, result, ts+56998, libc.VaList(bp, v+uintptr((*(*int32)(unsafe.Pointer(bp + 16))+1)/2)))
		} else {
			XTcl_AppendPrintfToObj(tls, result, ts+57010, libc.VaList(bp+8, v))
		}
	}
}

//----------------------------------------------------------------------
//
// AddRequirementsToDString --
//
//	This function accumulates requirements in a DString.
//
// Results:
//	None.
//
// Side effects:
//	The DString argument is extended.
//
//----------------------------------------------------------------------

func sAddRequirementsToDString(tls *libc.TLS, dsPtr uintptr, reqc int32, reqv uintptr) { /* tclPkg.c:1860:1: */
	var i int32

	if reqc > 0 {
		for i = 0; i < reqc; i++ {
			XTcl_DStringAppend(tls, dsPtr, ts+14299, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
			XTclDStringAppendObj(tls, dsPtr, *(*uintptr)(unsafe.Pointer(reqv + uintptr(i)*8)))
		}
	} else {
		XTcl_DStringAppend(tls, dsPtr, ts+57014, int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)))
	}
}

//----------------------------------------------------------------------
//
// SomeRequirementSatisfied --
//
//	This function checks to see whether a version satisfies at least one
//	of a set of requirements.
//
// Results:
//	If the requirements are satisfied 1 is returned. Otherwise 0 is
//	returned. The function assumes that all pieces have valid syntax. And
//	is allowed to make that assumption.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sSomeRequirementSatisfied(tls *libc.TLS, availVersionI uintptr, reqc int32, reqv uintptr) int32 { /* tclPkg.c:1899:1: */
	var i int32

	for i = 0; i < reqc; i++ {
		if sRequirementSatisfied(tls, availVersionI, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(reqv + uintptr(i)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(reqv + uintptr(i)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(reqv + uintptr(i)*8)))
		}()) != 0 {
			return 1
		}
	}
	return 0
}

//----------------------------------------------------------------------
//
// RequirementSatisfied --
//
//	This function checks to see whether a version satisfies a requirement.
//
// Results:
//	If the requirement is satisfied 1 is returned. Otherwise 0 is
//	returned. The function assumes that all pieces have valid syntax, and
//	is allowed to make that assumption.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sRequirementSatisfied(tls *libc.TLS, havei uintptr, req uintptr) int32 { /* tclPkg.c:1936:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// The have candidate is already in internal rep.

	var satisfied int32
	var res int32
	var dash uintptr = uintptr(0)
	var buf uintptr
	// var min uintptr at bp+16, 8

	// var max uintptr at bp+24, 8

	dash = libc.Xstrchr(tls, req, '-')
	if dash == uintptr(0) {
		// No dash found, is a simple version, fallback to regular check. The
		// 'CheckVersionAndConvert' cannot fail. We pad the requirement with
		// 'a0', i.e '-2' before doing the comparison to properly accept
		// unstables as well.

		*(*uintptr)(unsafe.Pointer(bp /* reqi */)) = uintptr(0)
		// var thisIsMajor int32 at bp+8, 4

		sCheckVersionAndConvert(tls, uintptr(0), req, bp, uintptr(0))
		libc.Xstrcat(tls, *(*uintptr)(unsafe.Pointer(bp /* reqi */)), ts+57018)
		res = sCompareVersions(tls, havei, *(*uintptr)(unsafe.Pointer(bp /* reqi */)), bp+8)
		satisfied = libc.Bool32(res == 0 || res == 1 && !(*(*int32)(unsafe.Pointer(bp + 8)) != 0))
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp)))
		return satisfied
	}

	// Exactly one dash is present (Assumption of valid syntax). Copy the req,
	// split at the location of dash and check that both parts are versions.
	// Note that the max part can be empty.

	for ok := true; ok; ok = 0 != 0 {
		var local__len uint32 = uint32(libc.Xstrlen(tls, req) + uint64(1))
		buf = XTcl_Alloc(tls, local__len)
		libc.Xmemcpy(tls, buf, req, uint64(local__len))
	}
	dash = buf + uintptr((int64(dash)-int64(req))/1)
	*(*int8)(unsafe.Pointer(dash)) = int8(0) // buf now <=> min part
	dash++                                   // dash now <=> max part

	if int32(*(*int8)(unsafe.Pointer(dash))) == 0 {
		// We have a min, but no max. For the comparison we generate the
		// internal rep, padded with 'a0' i.e. '-2'.

		sCheckVersionAndConvert(tls, uintptr(0), buf, bp+16, uintptr(0))
		libc.Xstrcat(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* min */)), ts+57018)
		satisfied = libc.Bool32(sCompareVersions(tls, havei, *(*uintptr)(unsafe.Pointer(bp + 16)), uintptr(0)) >= 0)
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
		XTclpFree(tls, buf)
		return satisfied
	}

	// We have both min and max, and generate their internal reps. When
	// identical we compare as is, otherwise we pad with 'a0' to ove the range
	// a bit.

	sCheckVersionAndConvert(tls, uintptr(0), buf, bp+16, uintptr(0))
	sCheckVersionAndConvert(tls, uintptr(0), dash, bp+24, uintptr(0))

	if sCompareVersions(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 24)), uintptr(0)) == 0 {
		satisfied = libc.Bool32(sCompareVersions(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), havei, uintptr(0)) == 0)
	} else {
		libc.Xstrcat(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* min */)), ts+57018)
		libc.Xstrcat(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* max */)), ts+57018)
		satisfied = libc.Bool32(sCompareVersions(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), havei, uintptr(0)) <= 0 && sCompareVersions(tls, havei, *(*uintptr)(unsafe.Pointer(bp + 24)), uintptr(0)) < 0)
	}

	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
	XTclpFree(tls, buf)
	return satisfied
}

//----------------------------------------------------------------------
//
// Tcl_PkgInitStubsCheck --
//
//	This is a replacement routine for Tcl_InitStubs() that is called
//	from code where -DUSE_TCL_STUBS has not been enabled.
//
// Results:
//	Returns the version of a conforming stubs table, or NULL, if
//	the table version doesn't satisfy the requested requirements,
//	according to historical practice.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_PkgInitStubsCheck(tls *libc.TLS, interp uintptr, version uintptr, exact int32) uintptr { /* tclPkg.c:2037:12: */
	var actualVersion uintptr = XTcl_PkgPresent(tls, interp, ts+6496, version, 0)

	if exact != 0 && actualVersion != 0 {
		var p uintptr = version
		var count int32 = 0

		for *(*int8)(unsafe.Pointer(p)) != 0 {
			count = count + libc.BoolInt32(!(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))))))*2)))&int32(X_ISdigit) != 0))
		}
		if count == 1 {
			if 0 != libc.Xstrncmp(tls, version, actualVersion, libc.Xstrlen(tls, version)) {
				// Construct error message
				XTcl_PkgPresent(tls, interp, ts+6496, version, 1)
				return uintptr(0)
			}
		} else {
			return XTcl_PkgPresent(tls, interp, ts+6496, version, 1)
		}
	}
	return actualVersion
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Use C preprocessor statements to define the various values for the embedded
// configuration information.

var cfg = [19]Tcl_Config{
	{Fkey: ts + 41975, Fvalue: ts + 18333},
	{Fkey: ts + 6606, Fvalue: ts + 6615},
	{Fkey: ts + 57022, Fvalue: ts + 18333},
	{Fkey: ts + 57031, Fvalue: ts + 18333},
	{Fkey: ts + 57037, Fvalue: ts + 6615},
	{Fkey: ts + 57047, Fvalue: ts + 18333},
	{Fkey: ts + 57057, Fvalue: ts + 18333},
	{Fkey: ts + 57071, Fvalue: ts + 18333},

	// Runtime paths to various stuff

	{Fkey: ts + 57085, Fvalue: ts + 57100},
	{Fkey: ts + 57115, Fvalue: ts + 57130},
	{Fkey: ts + 57145, Fvalue: ts + 57163},
	{Fkey: ts + 57185, Fvalue: ts + 57204},
	{Fkey: ts + 57223, Fvalue: ts + 57238},

	// Installation paths to various stuff

	{Fkey: ts + 57253, Fvalue: ts + 57100},
	{Fkey: ts + 57268, Fvalue: ts + 57130},
	{Fkey: ts + 57283, Fvalue: ts + 57163},
	{Fkey: ts + 57301, Fvalue: ts + 57204},
	{Fkey: ts + 57320, Fvalue: ts + 57238},

	// Last entry, closes the array
	{},
} /* tclPkgConfig.c:99:25 */

func XTclInitEmbeddedConfigurationInformation(tls *libc.TLS, interp uintptr) { /* tclPkgConfig.c:130:1: */
	XTcl_RegisterConfig(tls, interp, ts+57335, uintptr(unsafe.Pointer(&cfg)), ts+25963)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------------
//
// Tcl_ErrnoId --
//
//	Return a textual identifier for the current errno value.
//
// Results:
//	This procedure returns a machine-readable textual identifier that
//	corresponds to the current errno value (e.g. "EPERM"). The identifier
//	is the same as the #define name in errno.h.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ErrnoId(tls *libc.TLS) uintptr { /* tclPosixStr.c:34:12: */
	switch *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) {
	case E2BIG:
		return ts + 57339 /* "E2BIG" */
	case EACCES:
		return ts + 57345 /* "EACCES" */
	case EADDRINUSE:
		return ts + 57352 /* "EADDRINUSE" */
	case EADDRNOTAVAIL:
		return ts + 57363 /* "EADDRNOTAVAIL" */
	case EADV:
		return ts + 57377 /* "EADV" */
	case EAFNOSUPPORT:
		return ts + 57382 /* "EAFNOSUPPORT" */
	case EAGAIN:
		return ts + 37039 /* "EAGAIN" */
	case EALREADY:
		return ts + 57395 /* "EALREADY" */
	case EBADE:
		return ts + 57404 /* "EBADE" */
	case EBADF:
		return ts + 57410 /* "EBADF" */
	case EBADFD:
		return ts + 57416 /* "EBADFD" */
	case EBADMSG:
		return ts + 57423 /* "EBADMSG" */
	case ECANCELED:
		return ts + 57431 /* "ECANCELED" */
	case EBADR:
		return ts + 57441 /* "EBADR" */
	case EBADRQC:
		return ts + 57447 /* "EBADRQC" */
	case EBADSLT:
		return ts + 57455 /* "EBADSLT" */
	case EBFONT:
		return ts + 57463 /* "EBFONT" */
	case EBUSY:
		return ts + 57470 /* "EBUSY" */
	case ECHILD:
		return ts + 57476 /* "ECHILD" */
	case ECHRNG:
		return ts + 57483 /* "ECHRNG" */
	case ECOMM:
		return ts + 57490 /* "ECOMM" */
	case ECONNABORTED:
		return ts + 57496 /* "ECONNABORTED" */
	case ECONNREFUSED:
		return ts + 57509 /* "ECONNREFUSED" */
	case ECONNRESET:
		return ts + 57522 /* "ECONNRESET" */
	case EDEADLK:
		return ts + 57533 /* "EDEADLK" */
	case EDESTADDRREQ:
		return ts + 57541 /* "EDESTADDRREQ" */
	case EDOM:
		return ts + 57554 /* "EDOM" */
	case EDOTDOT:
		return ts + 57559 /* "EDOTDOT" */
	case EDQUOT:
		return ts + 57567 /* "EDQUOT" */
	case EEXIST:
		return ts + 57574 /* "EEXIST" */
	case EFAULT:
		return ts + 57581 /* "EFAULT" */
	case EFBIG:
		return ts + 57588 /* "EFBIG" */
	case EHOSTDOWN:
		return ts + 57594 /* "EHOSTDOWN" */
	case EHOSTUNREACH:
		return ts + 57604 /* "EHOSTUNREACH" */
	case EIDRM:
		return ts + 57617 /* "EIDRM" */
	case EILSEQ:
		return ts + 57623 /* "EILSEQ" */
	case EINPROGRESS:
		return ts + 57630 /* "EINPROGRESS" */
	case EINTR:
		return ts + 57642 /* "EINTR" */
	case EINVAL:
		return ts + 57648 /* "EINVAL" */
	case EIO:
		return ts + 57655 /* "EIO" */
	case EISCONN:
		return ts + 57659 /* "EISCONN" */
	case EISDIR:
		return ts + 57667 /* "EISDIR" */
	case EL2HLT:
		return ts + 57674 /* "EL2HLT" */
	case EL2NSYNC:
		return ts + 57681 /* "EL2NSYNC" */
	case EL3HLT:
		return ts + 57690 /* "EL3HLT" */
	case EL3RST:
		return ts + 57697 /* "EL3RST" */
	case ELIBACC:
		return ts + 57704 /* "ELIBACC" */
	case ELIBBAD:
		return ts + 57712 /* "ELIBBAD" */
	case ELIBEXEC:
		return ts + 57720 /* "ELIBEXEC" */
	case ELIBMAX:
		return ts + 57729 /* "ELIBMAX" */
	case ELIBSCN:
		return ts + 57737 /* "ELIBSCN" */
	case ELNRNG:
		return ts + 57745 /* "ELNRNG" */
	case ELOOP:
		return ts + 57752 /* "ELOOP" */
	case EMFILE:
		return ts + 57758 /* "EMFILE" */
	case EMLINK:
		return ts + 57765 /* "EMLINK" */
	case EMSGSIZE:
		return ts + 57772 /* "EMSGSIZE" */
	case EMULTIHOP:
		return ts + 57781 /* "EMULTIHOP" */
	case ENAMETOOLONG:
		return ts + 57791 /* "ENAMETOOLONG" */
	case ENAVAIL:
		return ts + 57804 /* "ENAVAIL" */
	case ENETDOWN:
		return ts + 57812 /* "ENETDOWN" */
	case ENETRESET:
		return ts + 57821 /* "ENETRESET" */
	case ENETUNREACH:
		return ts + 57831 /* "ENETUNREACH" */
	case ENFILE:
		return ts + 57843 /* "ENFILE" */
	case ENOANO:
		return ts + 57850 /* "ENOANO" */
	case ENOBUFS:
		return ts + 57857 /* "ENOBUFS" */
	case ENOCSI:
		return ts + 57865 /* "ENOCSI" */
	case ENODATA:
		return ts + 57872 /* "ENODATA" */
	case ENODEV:
		return ts + 57880 /* "ENODEV" */
	case ENOENT:
		return ts + 57887 /* "ENOENT" */
	case ENOEXEC:
		return ts + 57894 /* "ENOEXEC" */
	case ENOLCK:
		return ts + 57902 /* "ENOLCK" */
	case ENOLINK:
		return ts + 57909 /* "ENOLINK" */
	case ENOMEM:
		return ts + 57917 /* "ENOMEM" */
	case ENOMSG:
		return ts + 57924 /* "ENOMSG" */
	case ENONET:
		return ts + 57931 /* "ENONET" */
	case ENOPKG:
		return ts + 57938 /* "ENOPKG" */
	case ENOPROTOOPT:
		return ts + 57945 /* "ENOPROTOOPT" */
	case ENOSPC:
		return ts + 57957 /* "ENOSPC" */
	case ENOSR:
		return ts + 57964 /* "ENOSR" */
	case ENOSTR:
		return ts + 57970 /* "ENOSTR" */
	case ENOSYS:
		return ts + 57977 /* "ENOSYS" */
	case ENOTBLK:
		return ts + 57984 /* "ENOTBLK" */
	case ENOTCONN:
		return ts + 57992 /* "ENOTCONN" */
	case ENOTRECOVERABLE:
		return ts + 58001 /* "ENOTRECOVERABLE" */
	case ENOTDIR:
		return ts + 58017 /* "ENOTDIR" */
	case ENOTEMPTY:
		return ts + 58025 /* "ENOTEMPTY" */
	case ENOTNAM:
		return ts + 58035 /* "ENOTNAM" */
	case ENOTSOCK:
		return ts + 58043 /* "ENOTSOCK" */
	case EOPNOTSUPP:
		return ts + 58052 /* "ENOTSUP" */
	case ENOTTY:
		return ts + 58060 /* "ENOTTY" */
	case ENOTUNIQ:
		return ts + 58067 /* "ENOTUNIQ" */
	case ENXIO:
		return ts + 58076 /* "ENXIO" */
	case EOVERFLOW:
		return ts + 58082 /* "EOVERFLOW" */
	case EOWNERDEAD:
		return ts + 58092 /* "EOWNERDEAD" */
	case EPERM:
		return ts + 58103 /* "EPERM" */
	case EPFNOSUPPORT:
		return ts + 58109 /* "EPFNOSUPPORT" */
	case EPIPE:
		return ts + 58122 /* "EPIPE" */
	case EPROTO:
		return ts + 58128 /* "EPROTO" */
	case EPROTONOSUPPORT:
		return ts + 58135 /* "EPROTONOSUPPORT" */
	case EPROTOTYPE:
		return ts + 58151 /* "EPROTOTYPE" */
	case ERANGE:
		return ts + 58162 /* "ERANGE" */
	case EREMCHG:
		return ts + 58169 /* "EREMCHG" */
	case EREMOTE:
		return ts + 58177 /* "EREMOTE" */
	case EREMOTEIO:
		return ts + 58185 /* "EREMOTEIO" */
	case EROFS:
		return ts + 58195 /* "EROFS" */
	case ESHUTDOWN:
		return ts + 58201 /* "ESHUTDOWN" */
	case ESOCKTNOSUPPORT:
		return ts + 58211 /* "ESOCKTNOSUPPORT" */
	case ESPIPE:
		return ts + 58227 /* "ESPIPE" */
	case ESRCH:
		return ts + 58234 /* "ESRCH" */
	case ESRMNT:
		return ts + 58240 /* "ESRMNT" */
	case ESTALE:
		return ts + 58247 /* "ESTALE" */
	case ETIME:
		return ts + 58254 /* "ETIME" */
	case ETIMEDOUT:
		return ts + 58260 /* "ETIMEDOUT" */
	case ETOOMANYREFS:
		return ts + 58270 /* "ETOOMANYREFS" */
	case ETXTBSY:
		return ts + 58283 /* "ETXTBSY" */
	case EUCLEAN:
		return ts + 58291 /* "EUCLEAN" */
	case EUNATCH:
		return ts + 58299 /* "EUNATCH" */
	case EUSERS:
		return ts + 58307 /* "EUSERS" */
	case EXDEV:
		return ts + 58314 /* "EXDEV" */
	case EXFULL:
		return ts + 58320 /* "EXFULL" */
	}
	return ts + 58327 /* "unknown error" */
}

//----------------------------------------------------------------------
//
// Tcl_ErrnoMsg --
//
//	Return a human-readable message corresponding to a given errno value.
//
// Results:
//	The return value is the standard POSIX error message for errno.  This
//	procedure is used instead of strerror because strerror returns
//	slightly different values on different machines (e.g. different
//	capitalizations), which cause problems for things such as regression
//	tests. This procedure provides messages for most standard errors, then
//	it calls strerror for things it doesn't understand.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ErrnoMsg(tls *libc.TLS, err int32) uintptr { /* tclPosixStr.c:495:12: */
	switch err {
	case E2BIG:
		return ts + 58341 /* "argument list to..." */
	case EACCES:
		return ts + 58364 /* "permission denie..." */
	case EADDRINUSE:
		return ts + 58382 /* "address already ..." */
	case EADDRNOTAVAIL:
		return ts + 58405 /* "cannot assign re..." */
	case EADV:
		return ts + 58437 /* "advertise error" */
	case EAFNOSUPPORT:
		return ts + 58453 /* "address family n..." */
	case EAGAIN:
		return ts + 58494 /* "resource tempora..." */
	case EALREADY:
		return ts + 58527 /* "operation alread..." */
	case EBADE:
		return ts + 58557 /* "bad exchange des..." */
	case EBADF:
		return ts + 58581 /* "bad file number" */
	case EBADFD:
		return ts + 58597 /* "file descriptor ..." */
	case EBADMSG:
		return ts + 58626 /* "not a data messa..." */
	case ECANCELED:
		return ts + 58645 /* "operation cancel..." */
	case EBADR:
		return ts + 58664 /* "bad request desc..." */
	case EBADRQC:
		return ts + 58687 /* "bad request code" */
	case EBADSLT:
		return ts + 58704 /* "invalid slot" */
	case EBFONT:
		return ts + 58717 /* "bad font file fo..." */
	case EBUSY:
		return ts + 58738 /* "file busy" */
	case ECHILD:
		return ts + 58748 /* "no children" */
	case ECHRNG:
		return ts + 58760 /* "channel number o..." */
	case ECOMM:
		return ts + 58788 /* "communication er..." */
	case ECONNABORTED:
		return ts + 58816 /* "software caused ..." */
	case ECONNREFUSED:
		return ts + 58849 /* "connection refus..." */
	case ECONNRESET:
		return ts + 58868 /* "connection reset..." */
	case EDEADLK:
		return ts + 58893 /* "resource deadloc..." */
	case EDESTADDRREQ:
		return ts + 58919 /* "destination addr..." */
	case EDOM:
		return ts + 58948 /* "math argument ou..." */
	case EDOTDOT:
		return ts + 58975 /* "cross mount poin..." */
	case EDQUOT:
		return ts + 58993 /* "disk quota excee..." */
	case EEXIST:
		return ts + 59013 /* "file already exi..." */
	case EFAULT:
		return ts + 59033 /* "bad address in s..." */
	case EFBIG:
		return ts + 59069 /* "file too large" */
	case EHOSTDOWN:
		return ts + 59084 /* "host is down" */
	case EHOSTUNREACH:
		return ts + 59097 /* "host is unreacha..." */
	case EIDRM:
		return ts + 59117 /* "identifier remov..." */
	case EILSEQ:
		return ts + 59136 /* "illegal byte seq..." */
	case EINPROGRESS:
		return ts + 59158 /* "operation now in..." */
	case EINTR:
		return ts + 59184 /* "interrupted syst..." */
	case EINVAL:
		return ts + 59208 /* "invalid argument" */
	case EIO:
		return ts + 59225 /* "I/O error" */
	case EISCONN:
		return ts + 59235 /* "socket is alread..." */
	case EISDIR:
		return ts + 59263 /* "illegal operatio..." */
	case EL2HLT:
		return ts + 59296 /* "level 2 halted" */
	case EL2NSYNC:
		return ts + 59311 /* "level 2 not sync..." */
	case EL3HLT:
		return ts + 59336 /* "level 3 halted" */
	case EL3RST:
		return ts + 59351 /* "level 3 reset" */
	case ELIBACC:
		return ts + 59365 /* "cannot access a ..." */
	case ELIBBAD:
		return ts + 59403 /* "accessing a corr..." */
	case ELIBEXEC:
		return ts + 59440 /* "cannot exec a sh..." */
	case ELIBMAX:
		return ts + 59478 /* "attempting to li..." */
	case ELIBSCN:
		return ts + 59540 /* ".lib section in ..." */
	case ELNRNG:
		return ts + 59572 /* "link number out ..." */
	case ELOOP:
		return ts + 59597 /* "too many levels ..." */
	case EMFILE:
		return ts + 59631 /* "too many open fi..." */
	case EMLINK:
		return ts + 59651 /* "too many links" */
	case EMSGSIZE:
		return ts + 59666 /* "message too long" */
	case EMULTIHOP:
		return ts + 59683 /* "multihop attempt..." */
	case ENAMETOOLONG:
		return ts + 59702 /* "file name too lo..." */
	case ENAVAIL:
		return ts + 59721 /* "not available" */
	case ENETDOWN:
		return ts + 59735 /* "network is down" */
	case ENETRESET:
		return ts + 59751 /* "network dropped ..." */
	case ENETUNREACH:
		return ts + 59787 /* "network is unrea..." */
	case ENFILE:
		return ts + 59810 /* "file table overf..." */
	case ENOANO:
		return ts + 59830 /* "anode table over..." */
	case ENOBUFS:
		return ts + 59851 /* "no buffer space ..." */
	case ENOCSI:
		return ts + 59877 /* "no CSI structure..." */
	case ENODATA:
		return ts + 59904 /* "no data availabl..." */
	case ENODEV:
		return ts + 59922 /* "no such device" */
	case ENOENT:
		return ts + 59937 /* "no such file or ..." */
	case ENOEXEC:
		return ts + 59963 /* "exec format erro..." */
	case ENOLCK:
		return ts + 59981 /* "no locks availab..." */
	case ENOLINK:
		return ts + 60000 /* "link has been se..." */
	case ENOMEM:
		return ts + 60022 /* "not enough memor..." */
	case ENOMSG:
		return ts + 60040 /* "no message of de..." */
	case ENONET:
		return ts + 60067 /* "machine is not o..." */
	case ENOPKG:
		return ts + 60097 /* "package not inst..." */
	case ENOPROTOOPT:
		return ts + 60119 /* "bad protocol opt..." */
	case ENOSPC:
		return ts + 60139 /* "no space left on..." */
	case ENOSR:
		return ts + 60163 /* "out of stream re..." */
	case ENOSTR:
		return ts + 60187 /* "not a stream dev..." */
	case ENOSYS:
		return ts + 60207 /* "function not imp..." */
	case ENOTBLK:
		return ts + 60232 /* "block device req..." */
	case ENOTCONN:
		return ts + 60254 /* "socket is not co..." */
	case ENOTRECOVERABLE:
		return ts + 60278 /* "state not recove..." */
	case ENOTDIR:
		return ts + 60300 /* "not a directory" */
	case ENOTEMPTY:
		return ts + 60316 /* "directory not em..." */
	case ENOTNAM:
		return ts + 60336 /* "not a name file" */
	case ENOTSOCK:
		return ts + 60352 /* "socket operation..." */
	case EOPNOTSUPP:
		return ts + 60383 /* "operation not su..." */
	case ENOTTY:
		return ts + 60407 /* "inappropriate de..." */
	case ENOTUNIQ:
		return ts + 60438 /* "name not unique ..." */
	case ENXIO:
		return ts + 60465 /* "no such device o..." */
	case EOVERFLOW:
		return ts + 60491 /* "file too big" */
	case EOWNERDEAD:
		return ts + 60504 /* "owner died" */
	case EPERM:
		return ts + 60515 /* "not owner" */
	case EPFNOSUPPORT:
		return ts + 60525 /* "protocol family ..." */
	case EPIPE:
		return ts + 60555 /* "broken pipe" */
	case EPROTO:
		return ts + 60567 /* "protocol error" */
	case EPROTONOSUPPORT:
		return ts + 60582 /* "protocol not sup..." */
	case EPROTOTYPE:
		return ts + 60605 /* "protocol wrong t..." */
	case ERANGE:
		return ts + 60636 /* "math result unre..." */
	case EREMCHG:
		return ts + 60664 /* "remote address c..." */
	case EREMOTE:
		return ts + 60687 /* "pathname hit rem..." */
	case EREMOTEIO:
		return ts + 60719 /* "remote i/o error" */
	case EROFS:
		return ts + 60736 /* "read-only file s..." */
	case ESHUTDOWN:
		return ts + 60758 /* "cannot send afte..." */
	case ESOCKTNOSUPPORT:
		return ts + 60792 /* "socket type not ..." */
	case ESPIPE:
		return ts + 60818 /* "invalid seek" */
	case ESRCH:
		return ts + 60831 /* "no such process" */
	case ESRMNT:
		return ts + 60847 /* "srmount error" */
	case ESTALE:
		return ts + 60861 /* "stale remote fil..." */
	case ETIME:
		return ts + 60886 /* "timer expired" */
	case ETIMEDOUT:
		return ts + 60900 /* "connection timed..." */
	case ETOOMANYREFS:
		return ts + 60921 /* "too many referen..." */
	case ETXTBSY:
		return ts + 60956 /* "text file or pse..." */
	case EUCLEAN:
		return ts + 60988 /* "structure needs ..." */
	case EUNATCH:
		return ts + 61013 /* "protocol driver ..." */
	case EUSERS:
		return ts + 61042 /* "too many users" */
	case EXDEV:
		return ts + 61057 /* "cross-domain lin..." */
	case EXFULL:
		return ts + 61075 /* "message tables f..." */
	default:
		return libc.Xstrerror(tls, err)
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_SignalId --
//
//	Return a textual identifier for a signal number.
//
// Results:
//	This procedure returns a machine-readable textual identifier that
//	corresponds to sig.  The identifier is the same as the #define name in
//	signal.h.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_SignalId(tls *libc.TLS, sig int32) uintptr { /* tclPosixStr.c:960:12: */
	switch sig {
	case SIGABRT:
		return ts + 61095 /* "SIGABRT" */
	case SIGALRM:
		return ts + 61103 /* "SIGALRM" */
	case SIGBUS:
		return ts + 61111 /* "SIGBUS" */
	case SIGCHLD:
		return ts + 61118 /* "SIGCHLD" */
	case SIGCONT:
		return ts + 61126 /* "SIGCONT" */
	case SIGFPE:
		return ts + 61134 /* "SIGFPE" */
	case SIGHUP:
		return ts + 61141 /* "SIGHUP" */
	case SIGILL:
		return ts + 61148 /* "SIGILL" */
	case SIGINT:
		return ts + 61155 /* "SIGINT" */
	case SIGPOLL:
		return ts + 61162 /* "SIGIO" */
	case SIGKILL:
		return ts + 61168 /* "SIGKILL" */
	case SIGPIPE:
		return ts + 61176 /* "SIGPIPE" */
	case SIGPROF:
		return ts + 61184 /* "SIGPROF" */
	case SIGPWR:
		return ts + 61192 /* "SIGPWR" */
	case SIGQUIT:
		return ts + 61199 /* "SIGQUIT" */
	case SIGSEGV:
		return ts + 61207 /* "SIGSEGV" */
	case SIGSTOP:
		return ts + 61215 /* "SIGSTOP" */
	case SIGSYS:
		return ts + 61223 /* "SIGSYS" */
	case SIGTERM:
		return ts + 61230 /* "SIGTERM" */
	case SIGTRAP:
		return ts + 61238 /* "SIGTRAP" */
	case SIGTSTP:
		return ts + 61246 /* "SIGTSTP" */
	case SIGTTIN:
		return ts + 61254 /* "SIGTTIN" */
	case SIGTTOU:
		return ts + 61262 /* "SIGTTOU" */
	case SIGURG:
		return ts + 61270 /* "SIGURG" */
	case SIGUSR1:
		return ts + 61277 /* "SIGUSR1" */
	case SIGUSR2:
		return ts + 61285 /* "SIGUSR2" */
	case SIGVTALRM:
		return ts + 61293 /* "SIGVTALRM" */
	case SIGWINCH:
		return ts + 61303 /* "SIGWINCH" */
	case SIGXCPU:
		return ts + 61312 /* "SIGXCPU" */
	case SIGXFSZ:
		return ts + 61320 /* "SIGXFSZ" */
	}
	return ts + 61328 /* "unknown signal" */
}

//----------------------------------------------------------------------
//
// Tcl_SignalMsg --
//
//	Return a human-readable message describing a signal.
//
// Results:
//	This procedure returns a string describing sig that should make sense
//	to a human.  It may not be easy for a machine to parse.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_SignalMsg(tls *libc.TLS, sig int32) uintptr { /* tclPosixStr.c:1094:12: */
	switch sig {
	case SIGABRT:
		return ts + 61095 /* "SIGABRT" */
	case SIGALRM:
		return ts + 61343 /* "alarm clock" */
	case SIGBUS:
		return ts + 61355 /* "bus error" */
	case SIGCHLD:
		return ts + 61365 /* "child status cha..." */
	case SIGCONT:
		return ts + 61386 /* "continue after s..." */
	case SIGFPE:
		return ts + 61406 /* "floating-point e..." */
	case SIGHUP:
		return ts + 61431 /* "hangup" */
	case SIGILL:
		return ts + 61438 /* "illegal instruct..." */
	case SIGINT:
		return ts + 61458 /* "interrupt" */
	case SIGPOLL:
		return ts + 61468 /* "input/output pos..." */
	case SIGKILL:
		return ts + 61498 /* "kill signal" */
	case SIGPIPE:
		return ts + 61510 /* "write on pipe wi..." */
	case SIGPROF:
		return ts + 61540 /* "profiling alarm" */
	case SIGPWR:
		return ts + 61556 /* "power-fail resta..." */
	case SIGQUIT:
		return ts + 61575 /* "quit signal" */
	case SIGSEGV:
		return ts + 61587 /* "segmentation vio..." */
	case SIGSTOP:
		return ts + 61610 /* "stop" */
	case SIGSYS:
		return ts + 61615 /* "bad argument to ..." */
	case SIGTERM:
		return ts + 61643 /* "software termina..." */
	case SIGTRAP:
		return ts + 61671 /* "trace trap" */
	case SIGTSTP:
		return ts + 61682 /* "stop signal from..." */
	case SIGTTIN:
		return ts + 61703 /* "background tty r..." */
	case SIGTTOU:
		return ts + 61723 /* "background tty w..." */
	case SIGURG:
		return ts + 61744 /* "urgent I/O condi..." */
	case SIGUSR1:
		return ts + 61765 /* "user-defined sig..." */
	case SIGUSR2:
		return ts + 61787 /* "user-defined sig..." */
	case SIGVTALRM:
		return ts + 61809 /* "virtual time ala..." */
	case SIGWINCH:
		return ts + 61828 /* "window changed" */
	case SIGXCPU:
		return ts + 61843 /* "exceeded CPU tim..." */
	case SIGXFSZ:
		return ts + 61867 /* "exceeded file si..." */
	}
	return ts + 61328 /* "unknown signal" */
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The following data structure is used to keep track of all the Tcl_Preserve
// calls that are still in effect. It grows as needed to accommodate any
// number of calls in effect.

type Reference = struct {
	FclientData ClientData
	FrefCount   int32
	FmustFree   int32
	FfreeProc   uintptr
} /* tclPreserve.c:32:3 */

// Global data structures used to hold the list of preserved data references.
// These variables are protected by "preserveMutex".

var refArray uintptr = uintptr(0) /* tclPreserve.c:39:18 */ // First in array of references.
var spaceAvl int32 = 0            /* tclPreserve.c:40:12 */ // Total number of structures available at
// *firstRefPtr.
var inUse int32 = 0 /* tclPreserve.c:42:12 */ // Count of structures currently in use in
// refArray.
var preserveMutex Tcl_Mutex /* tclPreserve.c:44:1: */ // To protect the above statics

// The following data structure is used to keep track of whether an arbitrary
// block of memory has been deleted. This is used by the TclHandle code to
// avoid the more time-expensive algorithm of Tcl_Preserve(). This mechanism
// is mainly used when we have lots of references to a few big, expensive
// objects that we don't want to live any longer than necessary.

type HandleStruct1 = struct {
	Fptr         uintptr
	FrefCount    int32
	F__ccgo_pad1 [4]byte
} /* tclPreserve.c:56:9 */

// To protect the above statics

// The following data structure is used to keep track of whether an arbitrary
// block of memory has been deleted. This is used by the TclHandle code to
// avoid the more time-expensive algorithm of Tcl_Preserve(). This mechanism
// is mainly used when we have lots of references to a few big, expensive
// objects that we don't want to live any longer than necessary.

type HandleStruct = HandleStruct1 /* tclPreserve.c:68:3 */

//----------------------------------------------------------------------
//
// TclFinalizePreserve --
//
//	Called during exit processing to clean up the reference array.
//
// Results:
//	None.
//
// Side effects:
//	Frees the storage of the reference array.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTclFinalizePreserve(tls *libc.TLS) { /* tclPreserve.c:88:1: */
	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&preserveMutex)))
	if spaceAvl != 0 {
		XTclpFree(tls, refArray)
		refArray = uintptr(0)
		inUse = 0
		spaceAvl = 0
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&preserveMutex)))
}

//----------------------------------------------------------------------
//
// Tcl_Preserve --
//
//	This function is used by a function to declare its interest in a
//	particular block of memory, so that the block will not be reallocated
//	until a matching call to Tcl_Release has been made.
//
// Results:
//	None.
//
// Side effects:
//	Information is retained so that the block of memory will not be freed
//	until at least the matching call to Tcl_Release.
//
//----------------------------------------------------------------------

func XTcl_Preserve(tls *libc.TLS, clientData ClientData) { /* tclPreserve.c:120:1: */
	var refPtr uintptr
	var i int32

	// See if there is already a reference for this pointer. If so, just
	// increment its reference count.

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&preserveMutex)))
	i = 0
	refPtr = refArray
__1:
	if !(i < inUse) {
		goto __3
	}
	{
		if (*Reference)(unsafe.Pointer(refPtr)).FclientData == clientData {
			(*Reference)(unsafe.Pointer(refPtr)).FrefCount++
			XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&preserveMutex)))
			return
		}

	}
	goto __2
__2:
	i++
	refPtr += 24
	goto __1
	goto __3
__3:
	;

	// Make a reference array if it doesn't already exist, or make it bigger
	// if it is full.

	if inUse == spaceAvl {
		if spaceAvl != 0 {
			spaceAvl = 2 * spaceAvl
		} else {
			spaceAvl = INITIAL_SIZE
		}
		refArray = XTcl_Realloc(tls, refArray, uint32(uint64(spaceAvl)*uint64(unsafe.Sizeof(Reference{}))))
	}

	// Make a new entry for the new reference.

	refPtr = refArray + uintptr(inUse)*24
	(*Reference)(unsafe.Pointer(refPtr)).FclientData = clientData
	(*Reference)(unsafe.Pointer(refPtr)).FrefCount = 1
	(*Reference)(unsafe.Pointer(refPtr)).FmustFree = 0
	(*Reference)(unsafe.Pointer(refPtr)).FfreeProc = uintptr(0)
	inUse = inUse + 1
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&preserveMutex)))
}

//----------------------------------------------------------------------
//
// Tcl_Release --
//
//	This function is called to cancel a previous call to Tcl_Preserve,
//	thereby allowing a block of memory to be freed (if no one else cares
//	about it).
//
// Results:
//	None.
//
// Side effects:
//	If Tcl_EventuallyFree has been called for clientData, and if no other
//	call to Tcl_Preserve is still in effect, the block of memory is freed.
//
//----------------------------------------------------------------------

func XTcl_Release(tls *libc.TLS, clientData ClientData) { /* tclPreserve.c:183:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var refPtr uintptr
	var i int32

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&preserveMutex)))
	i = 0
	refPtr = refArray
__1:
	if !(i < inUse) {
		goto __3
	}
	{
		var mustFree int32
		var freeProc uintptr

		if (*Reference)(unsafe.Pointer(refPtr)).FclientData != clientData {
			goto __2
		}

		if libc.PreDecInt32(&(*Reference)(unsafe.Pointer(refPtr)).FrefCount, 1) != 0 {
			XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&preserveMutex)))
			return
		}

		// Must remove information from the slot before calling freeProc to
		// avoid reentrancy problems if the freeProc calls Tcl_Preserve on the
		// same clientData. Copy down the last reference in the array to
		// overwrite the current slot.

		freeProc = (*Reference)(unsafe.Pointer(refPtr)).FfreeProc
		mustFree = (*Reference)(unsafe.Pointer(refPtr)).FmustFree
		inUse--
		if i < inUse {
			*(*Reference)(unsafe.Pointer(refArray + uintptr(i)*24)) = *(*Reference)(unsafe.Pointer(refArray + uintptr(inUse)*24))
		}

		// Now committed to disposing the data. But first, we've patched up
		// all the global data structures so we should release the mutex now.
		// Only then should we dabble around with potentially-slow memory
		// managers...

		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&preserveMutex)))
		if mustFree != 0 {
			if freeProc == uintptr(3) {
				XTclpFree(tls, clientData)
			} else {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{freeProc})).f(tls, clientData)
			}
		}
		return

	}
	goto __2
__2:
	i++
	refPtr += 24
	goto __1
	goto __3
__3:
	;
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&preserveMutex)))

	// Reference not found. This is a bug in the caller.

	XTcl_Panic(tls, ts+61892, libc.VaList(bp, clientData))
}

//----------------------------------------------------------------------
//
// Tcl_EventuallyFree --
//
//	Free up a block of memory, unless a call to Tcl_Preserve is in effect
//	for that block. In this case, defer the free until all calls to
//	Tcl_Preserve have been undone by matching calls to Tcl_Release.
//
// Results:
//	None.
//
// Side effects:
//	Ptr may be released by calling free().
//
//----------------------------------------------------------------------

func XTcl_EventuallyFree(tls *libc.TLS, clientData ClientData, freeProc uintptr) { /* tclPreserve.c:262:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var refPtr uintptr
	var i int32

	// See if there is a reference for this pointer. If so, set its "mustFree"
	// flag (the flag had better not be set already!).

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&preserveMutex)))
	i = 0
	refPtr = refArray
__1:
	if !(i < inUse) {
		goto __3
	}
	{
		if (*Reference)(unsafe.Pointer(refPtr)).FclientData != clientData {
			goto __2
		}
		if (*Reference)(unsafe.Pointer(refPtr)).FmustFree != 0 {
			XTcl_Panic(tls, ts+61935, libc.VaList(bp, clientData))
		}
		(*Reference)(unsafe.Pointer(refPtr)).FmustFree = 1
		(*Reference)(unsafe.Pointer(refPtr)).FfreeProc = freeProc
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&preserveMutex)))
		return

	}
	goto __2
__2:
	i++
	refPtr += 24
	goto __1
	goto __3
__3:
	;
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&preserveMutex)))

	// No reference for this block.  Free it now.

	if freeProc == uintptr(3) {
		XTclpFree(tls, clientData)
	} else {
		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{freeProc})).f(tls, clientData)
	}
}

//---------------------------------------------------------------------------
//
// TclHandleCreate --
//
//	Allocate a handle that contains enough information to determine if an
//	arbitrary malloc'd block has been deleted. This is used to avoid the
//	more time-expensive algorithm of Tcl_Preserve().
//
// Results:
//	The return value is a TclHandle that refers to the given malloc'd
//	block. Doubly dereferencing the returned handle will give back the
//	pointer to the block, or will give NULL if the block has been deleted.
//
// Side effects:
//	The caller must keep track of this handle (generally by storing it in
//	a field in the malloc'd block) and call TclHandleFree() on this handle
//	when the block is deleted. Everything else that wishes to keep track
//	of whether the malloc'd block has been deleted should use calls to
//	TclHandlePreserve() and TclHandleRelease() on the associated handle.
//
//---------------------------------------------------------------------------

func XTclHandleCreate(tls *libc.TLS, ptr uintptr) TclHandle { /* tclPreserve.c:325:1: */
	var handlePtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(HandleStruct{})))

	(*HandleStruct)(unsafe.Pointer(handlePtr)).Fptr = ptr
	(*HandleStruct)(unsafe.Pointer(handlePtr)).FrefCount = 0
	return handlePtr
}

//---------------------------------------------------------------------------
//
// TclHandleFree --
//
//	Called when the arbitrary malloc'd block associated with the handle is
//	being deleted. Modifies the handle so that doubly dereferencing it
//	will give NULL. This informs any user of the handle that the block of
//	memory formerly referenced by the handle has been freed.
//
// Results:
//	None.
//
// Side effects:
//	If nothing is referring to the handle, the handle will be reclaimed.
//
//---------------------------------------------------------------------------

func XTclHandleFree(tls *libc.TLS, handle TclHandle) { /* tclPreserve.c:360:1: */
	var handlePtr uintptr

	handlePtr = handle
	(*HandleStruct)(unsafe.Pointer(handlePtr)).Fptr = uintptr(0)
	if (*HandleStruct)(unsafe.Pointer(handlePtr)).FrefCount == 0 {
		XTclpFree(tls, handlePtr)
	}
}

//---------------------------------------------------------------------------
//
// TclHandlePreserve --
//
//	Declare an interest in the arbitrary malloc'd block associated with
//	the handle.
//
// Results:
//	The return value is the handle argument, with its ref count
//	incremented.
//
// Side effects:
//	For each call to TclHandlePreserve(), there should be a matching call
//	to TclHandleRelease() when the caller is no longer interested in the
//	malloc'd block associated with the handle.
//
//---------------------------------------------------------------------------

func XTclHandlePreserve(tls *libc.TLS, handle TclHandle) TclHandle { /* tclPreserve.c:405:1: */
	var handlePtr uintptr

	handlePtr = handle
	(*HandleStruct)(unsafe.Pointer(handlePtr)).FrefCount++

	return handle
}

//---------------------------------------------------------------------------
//
// TclHandleRelease --
//
//	This function is called to release an interest in the malloc'd block
//	associated with the handle.
//
// Results:
//	None.
//
// Side effects:
//	The ref count of the handle is decremented. If the malloc'd block has
//	been freed and if no one is using the handle any more, the handle will
//	be reclaimed.
//
//---------------------------------------------------------------------------

func XTclHandleRelease(tls *libc.TLS, handle TclHandle) { /* tclPreserve.c:446:1: */
	var handlePtr uintptr

	handlePtr = handle
	if libc.PreDecInt32(&(*HandleStruct)(unsafe.Pointer(handlePtr)).FrefCount, 1) == 0 && (*HandleStruct)(unsafe.Pointer(handlePtr)).Fptr == uintptr(0) {
		XTclpFree(tls, handlePtr)
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------
// Macros and flag values used by Tcl bytecode compilation and execution
// modules inside the Tcl core but not used outside.
//----------------------------------------------------------------

// Simplified form to access AuxData.
//
// ClientData TclFetchAuxData(CompileEng *envPtr, int index);

// Form of TclRegisterLiteral with flags == 0. In that case, it is safe to
// cast away constness, and it is cleanest to do that here, all in one place.
//
// int TclRegisterNewLiteral(CompileEnv *envPtr, const char *bytes,
//			     int length);

// Form of TclRegisterLiteral with flags == LITERAL_CMD_NAME. In that case, it
// is safe to cast away constness, and it is cleanest to do that here, all in
// one place.
//
// int TclRegisterNewNSLiteral(CompileEnv *envPtr, const char *bytes,
//			       int length);

// Macro used to manually adjust the stack requirements; used in cases where
// the stack effect cannot be computed from the opcode and its operands, but
// is still known at compile time.
//
// void TclAdjustStackDepth(int delta, CompileEnv *envPtr);

// Macro used to update the stack requirements. It is called by the macros
// TclEmitOpCode, TclEmitInst1 and TclEmitInst4.
// Remark that the very last instruction of a bytecode always reduces the
// stack level: INST_DONE or INST_POP, so that the maxStackdepth is always
// updated.
//
// void TclUpdateStackReqs(unsigned char op, int i, CompileEnv *envPtr);

// Macros used to update the flag that indicates if we are at the start of a
// command, based on whether the opcode is INST_START_COMMAND.
//
// void TclUpdateAtCmdStart(unsigned char op, CompileEnv *envPtr);

// Macro to emit an opcode byte into a CompileEnv's code array. The ANSI C
// "prototype" for this macro is:
//
// void TclEmitOpcode(unsigned char op, CompileEnv *envPtr);

// Macros to emit an integer operand. The ANSI C "prototype" for these macros
// are:
//
// void TclEmitInt1(int i, CompileEnv *envPtr);
// void TclEmitInt4(int i, CompileEnv *envPtr);

// Macros to emit an instruction with signed or unsigned integer operands.
// Four byte integers are stored in "big-endian" order with the high order
// byte stored at the lowest address. The ANSI C "prototypes" for these macros
// are:
//
// void TclEmitInstInt1(unsigned char op, int i, CompileEnv *envPtr);
// void TclEmitInstInt4(unsigned char op, int i, CompileEnv *envPtr);

// Macro to push a Tcl object onto the Tcl evaluation stack. It emits the
// object's one or four byte array index into the CompileEnv's code array.
// These support, respectively, a maximum of 256 (2**8) and 2**32 objects in a
// CompileEnv. The ANSI C "prototype" for this macro is:
//
// void	TclEmitPush(int objIndex, CompileEnv *envPtr);

// Macros to update a (signed or unsigned) integer starting at a pointer. The
// two variants depend on the number of bytes. The ANSI C "prototypes" for
// these macros are:
//
// void TclStoreInt1AtPtr(int i, unsigned char *p);
// void TclStoreInt4AtPtr(int i, unsigned char *p);

// Macros to update instructions at a particular pc with a new op code and a
// (signed or unsigned) int operand. The ANSI C "prototypes" for these macros
// are:
//
// void TclUpdateInstInt1AtPc(unsigned char op, int i, unsigned char *pc);
// void TclUpdateInstInt4AtPc(unsigned char op, int i, unsigned char *pc);

// Macro to fix up a forward jump to point to the current code-generation
// position in the bytecode being created (the most common case). The ANSI C
// "prototypes" for this macro is:
//
// int TclFixupForwardJumpToHere(CompileEnv *envPtr, JumpFixup *fixupPtr,
//				 int threshold);

// Macros to get a signed integer (GET_INT{1,2}) or an unsigned int
// (GET_UINT{1,2}) from a pointer. There are two variants for each return type
// that depend on the number of bytes fetched. The ANSI C "prototypes" for
// these macros are:
//
// int TclGetInt1AtPtr(unsigned char *p);
// int TclGetInt4AtPtr(unsigned char *p);
// unsigned int TclGetUInt1AtPtr(unsigned char *p);
// unsigned int TclGetUInt4AtPtr(unsigned char *p);

// The TclGetInt1AtPtr macro is tricky because we want to do sign extension on
// the 1-byte value. Unfortunately the "char" type isn't signed on all
// platforms so sign-extension doesn't always happen automatically. Sometimes
// we can explicitly declare the pointer to be signed, but other times we have
// to explicitly sign-extend the value in software.

// Macros used to compute the minimum and maximum of two integers. The ANSI C
// "prototypes" for these macros are:
//
// int TclMin(int i, int j);
// int TclMax(int i, int j);

// Convenience macros for use when compiling bodies of commands. The ANSI C
// "prototype" for these macros are:
//
// static void		BODY(Tcl_Token *tokenPtr, int word);

// Convenience macro for use when compiling tokens to be pushed. The ANSI C
// "prototype" for this macro is:
//
// static void		CompileTokens(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp);

// Convenience macros for use when pushing literals. The ANSI C "prototype" for
// these macros are:
//
// static void		PushLiteral(CompileEnv *envPtr,
//			    const char *string, int length);
// static void		PushStringLiteral(CompileEnv *envPtr,
//			    const char *string);

// Macro to advance to the next token; it is more mnemonic than the address
// arithmetic that it replaces. The ANSI C "prototype" for this macro is:
//
// static Tcl_Token *	TokenAfter(Tcl_Token *tokenPtr);

// Macro to get the offset to the next instruction to be issued. The ANSI C
// "prototype" for this macro is:
//
// static int	CurrentOffset(CompileEnv *envPtr);

// Note: the exceptDepth is a bit of a misnomer: TEBC only needs the
// maximal depth of nested CATCH ranges in order to alloc runtime
// memory. These macros should compute precisely that? OTOH, the nesting depth
// of LOOP ranges is an interesting datum for debugging purposes, and that is
// what we compute now.
//
// static int	ExceptionRangeStarts(CompileEnv *envPtr, int index);
// static void	ExceptionRangeEnds(CompileEnv *envPtr, int index);
// static void	ExceptionRangeTarget(CompileEnv *envPtr, int index, LABEL);

// Check if there is an LVT for compiled locals

// Macros for making it easier to deal with tokens and DStrings.

// Macro that encapsulates an efficiency trick that avoids a function call for
// the simplest of compiles. The ANSI C "prototype" for this macro is:
//
// static void		CompileWord(CompileEnv *envPtr, Tcl_Token *tokenPtr,
//			    Tcl_Interp *interp, int word);

// TIP #280: Remember the per-word line information of the current command. An
// index is used instead of a pointer as recursive compilation may reallocate,
// i.e. move, the array. This is also the reason to save the nuloc now, it may
// change during the course of the function.
//
// Macro to encapsulate the variable definition and setup.

// Often want to issue one of two versions of an instruction based on whether
// the argument will fit in a single byte or not. This makes it much clearer.

// How to get an anonymous local variable (used for holding temporary values
// off the stack) or a local simple scalar.

// Flags bits used by TclPushVarName.

// DTrace probe macros (NOPs if DTrace support is not enabled).

// Define the following macros to enable debug logging of the DTrace proc,
// cmd, and inst probes. Note that this does _not_ require a platform with
// DTrace, it simply logs all probe output to /tmp/tclDTraceDebug-[pid].log.
//
// If the second macro is defined, logging to file starts immediately,
// otherwise only after the first call to [tcl::dtrace]. Note that the debug
// probe data is always computed, even when it is not logged to file.
//
// Defining the third macro enables debug logging of inst probes (disabled
// by default due to the significant performance impact).

//
// #define TCL_DTRACE_DEBUG 1
// #define TCL_DTRACE_DEBUG_LOG_ENABLED 1
// #define TCL_DTRACE_DEBUG_INST_PROBES 1

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Variables that are part of the [apply] command implementation and which
// have to be passed to the other side of the NRE call.

type ApplyExtraData = struct {
	Fcmd Command
	Fefi ExtraFrameInfo
} /* tclProc.c:27:3 */

// The ProcBodyObjType type

var XtclProcBodyType = Tcl_ObjType{
	Fname:           ts + 61974,
	FfreeIntRepProc: 0, // FreeInternalRep function
	FdupIntRepProc:  0, // SetFromAny function; Tcl_ConvertToType
	// should panic instead.
} /* tclProc.c:59:19 */

// The [upvar]/[uplevel] level reference type. Uses the longValue field
// to remember the integer value of a parsed #<integer> format.
//
// Uses the default behaviour throughout, and never disposes of the string
// rep; it's just a cache type.

var levelReferenceType = Tcl_ObjType{
	Fname: ts + 61983,
} /* tclProc.c:78:26 */

// The type of lambdas. Note that every lambda will *always* have a string
// representation.
//
// Internally, ptr1 is a pointer to a Proc instance that is not bound to a
// command name, and ptr2 is a pointer to the namespace that the Proc instance
// will execute within. IF YOU CHANGE THIS, CHECK IN tclDisassemble.c TOO.

var XtclLambdaType = Tcl_ObjType{
	Fname:           ts + 61998,
	FfreeIntRepProc: 0, // freeIntRepProc
	FdupIntRepProc:  0, // updateStringProc
	FsetFromAnyProc: 0, // setFromAnyProc
} /* tclProc.c:92:19 */

//----------------------------------------------------------------------
//
// Tcl_ProcObjCmd --
//
//	This object-based function is invoked to process the "proc" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	A new procedure gets created.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ProcObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclProc.c:119:1: */
	bp := tls.Alloc(128)
	defer tls.Free(128)

	var iPtr uintptr
	// var procPtr uintptr at bp+112, 8

	var procName uintptr
	// var simpleName uintptr at bp+104, 8

	var procArgs uintptr
	var procBody uintptr
	// var nsPtr uintptr at bp+80, 8

	// var altNsPtr uintptr at bp+88, 8

	// var cxtNsPtr uintptr at bp+96, 8

	var cmd Tcl_Command
	var _objPtr uintptr
	// Get the old command frame and release it. See also
	// TclProcCleanupProc in this file. Currently it seems as
	// if only the procbodytest::proc command of the testsuite
	// is able to trigger this situation.

	var cfOldPtr uintptr
	// var isNew int32 at bp+120, 4

	var hePtr uintptr
	var cfPtr uintptr
	var _objPtr1 uintptr
	var contextPtr uintptr
	// var numBytes int32 at bp+124, 4
	iPtr = interp

	if !(objc != 4) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+52218)
	return TCL_ERROR
__1:
	;

	// Determine the namespace where the procedure should reside. Unless the
	// command name includes namespace qualifiers, this will be the current
	// namespace.

	procName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	XTclGetNamespaceForQualName(tls, interp, procName, uintptr(0), 0,
		bp+80, bp+88, bp+96, bp+104)

	if !(*(*uintptr)(unsafe.Pointer(bp + 80)) == uintptr(0)) {
		goto __2
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+9184,
		libc.VaList(bp, procName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+6915, ts+7328, uintptr(0)))
	return TCL_ERROR
__2:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 104)) == uintptr(0)) {
		goto __3
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+9241,
		libc.VaList(bp+40, procName)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+6915, ts+7328, uintptr(0)))
	return TCL_ERROR
__3:
	;

	// Create the data structure to represent the procedure.

	if !(XTclCreateProc(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 80)), *(*uintptr)(unsafe.Pointer(bp + 104)), *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(objv + 3*8)),
		bp+112) != TCL_OK) {
		goto __4
	}
	XTcl_AddErrorInfo(tls, interp, ts+62009)
	XTcl_AddErrorInfo(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 104 /* simpleName */)))
	XTcl_AddErrorInfo(tls, interp, ts+7895)
	return TCL_ERROR
__4:
	;

	cmd = XTclNRCreateCommandInNs(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 104 /* simpleName */)), *(*uintptr)(unsafe.Pointer(bp + 80 /* nsPtr */)),
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclObjInterpProc})), *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{XTclNRInterpProc})), *(*uintptr)(unsafe.Pointer(bp + 112 /* procPtr */)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{XTclProcDeleteProc})))

	// Now initialize the new procedure's cmdPtr field. This will be used
	// later when the procedure is called to determine what namespace the
	// procedure will run in. This will be different than the current
	// namespace if the proc was renamed into a different namespace.

	(*Proc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112 /* procPtr */)))).FcmdPtr = cmd

	// TIP #280: Remember the line the procedure body is starting on. In a
	// bytecode context we ask the engine to provide us with the necessary
	// information. This is for the initialization of the byte code compiler
	// when the body is used for the first time.
	//
	// This code is nearly identical to the #280 code in SetLambdaFromAny, see
	// this file. The differences are the different index of the body in the
	// line array of the context, and the lambda code requires some special
	// processing. Find a way to factor the common elements into a single
	// function.

	if !((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr != 0) {
		goto __5
	}
	contextPtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(CmdFrame{})))

	*(*CmdFrame)(unsafe.Pointer(contextPtr)) = *(*CmdFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr))

	if !((*CmdFrame)(unsafe.Pointer(contextPtr)).Ftype == 2) {
		goto __6
	}
	// Retrieve source information from the bytecode, if possible. If
	// the information is retrieved successfully, context.type will be
	// TCL_LOCATION_SOURCE and the reference held by
	// context.data.eval.path will be counted.

	XTclGetSrcInfoForPc(tls, contextPtr)
	goto __7
__6:
	if !((*CmdFrame)(unsafe.Pointer(contextPtr)).Ftype == 4) {
		goto __8
	}
	// The copy into 'context' up above has created another reference
	// to 'context.data.eval.path'; account for it.

	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(contextPtr + 40)))).FrefCount++
__8:
	;
__7:
	;

	if !((*CmdFrame)(unsafe.Pointer(contextPtr)).Ftype == 4) {
		goto __9
	}
	// We can account for source location within a proc only if the
	// proc body was not created by substitution.

	if !((*CmdFrame)(unsafe.Pointer(contextPtr)).Fline != 0 &&
		(*CmdFrame)(unsafe.Pointer(contextPtr)).Fnline >= 4 && *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(contextPtr)).Fline + 3*4)) >= 0) {
		goto __10
	}
	cfPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CmdFrame{})))

	(*CmdFrame)(unsafe.Pointer(cfPtr)).Flevel = -1
	(*CmdFrame)(unsafe.Pointer(cfPtr)).Ftype = (*CmdFrame)(unsafe.Pointer(contextPtr)).Ftype
	(*CmdFrame)(unsafe.Pointer(cfPtr)).Fline = XTcl_Alloc(tls, uint32(unsafe.Sizeof(int32(0))))
	*(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(cfPtr)).Fline)) = *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(contextPtr)).Fline + 3*4))
	(*CmdFrame)(unsafe.Pointer(cfPtr)).Fnline = 1
	(*CmdFrame)(unsafe.Pointer(cfPtr)).FframePtr = uintptr(0)
	(*CmdFrame)(unsafe.Pointer(cfPtr)).FnextPtr = uintptr(0)

	*(*uintptr)(unsafe.Pointer(cfPtr + 40)) = *(*uintptr)(unsafe.Pointer(contextPtr + 40))
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cfPtr + 40)))).FrefCount++

	(*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd = uintptr(0)
	(*CmdFrame)(unsafe.Pointer(cfPtr)).Flen = 0

	hePtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)).FcreateProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr, *(*uintptr)(unsafe.Pointer(bp + 112 /* procPtr */)), bp+120 /* &isNew */)
	if !!(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
		goto __11
	}
	// Get the old command frame and release it. See also
	// TclProcCleanupProc in this file. Currently it seems as
	// if only the procbodytest::proc command of the testsuite
	// is able to trigger this situation.

	cfOldPtr = (*Tcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData

	if !((*CmdFrame)(unsafe.Pointer(cfOldPtr)).Ftype == 4) {
		goto __12
	}
__13:
	_objPtr = *(*uintptr)(unsafe.Pointer(cfOldPtr + 40))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __16
	}
	XTclFreeObj(tls, _objPtr)
__16:
	;
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
	*(*uintptr)(unsafe.Pointer(cfOldPtr + 40)) = uintptr(0)
__12:
	;
	XTclpFree(tls, (*CmdFrame)(unsafe.Pointer(cfOldPtr)).Fline)
	(*CmdFrame)(unsafe.Pointer(cfOldPtr)).Fline = uintptr(0)
	XTclpFree(tls, cfOldPtr)
__11:
	;
	(*Tcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData = cfPtr
__10:
	;

	// 'contextPtr' is going out of scope; account for the reference
	// that it's holding to the path name.

__17:
	_objPtr1 = *(*uintptr)(unsafe.Pointer(contextPtr + 40))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __20
	}
	XTclFreeObj(tls, _objPtr1)
__20:
	;
	goto __18
__18:
	if 0 != 0 {
		goto __17
	}
	goto __19
__19:
	;
	*(*uintptr)(unsafe.Pointer(contextPtr + 40)) = uintptr(0)
__9:
	;
	XTclStackFree(tls, interp, contextPtr)
__5:
	;

	// Optimize for no-op procs: if the body is not precompiled (like a TclPro
	// procbody), and the argument list is just "args" and the body is empty,
	// define a compileProc to compile a no-op.
	//
	// Notes:
	//	 - cannot be done for any argument list without having different
	//	   compiled/not-compiled behaviour in the "wrong argument #" case, or
	//	   making this code much more complicated. In any case, it doesn't
	//	   seem to make a lot of sense to verify the number of arguments we
	//	   are about to ignore ...
	//	 - could be enhanced to handle also non-empty bodies that contain only
	//	   comments; however, parsing the body will slow down the compilation
	//	   of all procs whose argument list is just _args_

	if !((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclProcBodyType))) {
		goto __21
	}
	goto done
__21:
	;

	procArgs = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	}()

__22:
	if !(int32(*(*int8)(unsafe.Pointer(procArgs))) == ' ') {
		goto __23
	}
	procArgs++
	goto __22
__23:
	;

	if !(int32(*(*int8)(unsafe.Pointer(procArgs))) == 'a' && libc.Xstrncmp(tls, procArgs, ts+13126, uint64(4)) == 0) {
		goto __24
	}

	procArgs += uintptr(4)
__25:
	if !(int32(*(*int8)(unsafe.Pointer(procArgs))) != 0) {
		goto __26
	}
	if !(int32(*(*int8)(unsafe.Pointer(procArgs))) != ' ') {
		goto __27
	}
	goto done
__27:
	;
	procArgs++
	goto __25
__26:
	;

	// The argument list is just "args"; check the body

	procBody = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+124)
	if !(XTclParseAllWhiteSpace(tls, procBody, *(*int32)(unsafe.Pointer(bp + 124))) < *(*int32)(unsafe.Pointer(bp + 124))) {
		goto __28
	}
	goto done
__28:
	;

	// The body is just spaces: link the compileProc

	(*Command)(unsafe.Pointer(cmd)).FcompileProc = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
	}{XTclCompileNoOp}))
__24:
	;

done:
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCreateProc --
//
//	Creates the data associated with a Tcl procedure definition. This
//	function knows how to handle two types of body objects: strings and
//	procbody. Strings are the traditional (and common) value for bodies,
//	procbody are values created by extensions that have loaded a
//	previously compiled script.
//
// Results:
//	Returns TCL_OK on success, along with a pointer to a Tcl procedure
//	definition in procPtrPtr where the cmdPtr field is not initialised.
//	This definition should be freed by calling TclProcCleanupProc() when
//	it is no longer needed. Returns TCL_ERROR if anything goes wrong.
//
// Side effects:
//	If anything goes wrong, this function returns an error message in the
//	interpreter.
//
//----------------------------------------------------------------------

func XTclCreateProc(tls *libc.TLS, interp uintptr, nsPtr uintptr, procName uintptr, argsPtr uintptr, bodyPtr uintptr, procPtrPtr uintptr) int32 { /* tclProc.c:364:1: */
	bp := tls.Alloc(380)
	defer tls.Free(380)

	var iPtr uintptr
	var procPtr uintptr
	var i int32
	var result int32
	// var numArgs int32 at bp+340, 4

	var localPtr uintptr
	// var argArray uintptr at bp+344, 8

	var precompiled int32
	var bytes uintptr
	// var length int32 at bp+336, 4

	var sharedBodyPtr uintptr
	var errorObj uintptr
	var errorObj1 uintptr
	var errorObj2 uintptr
	// var tmpLength int32 at bp+372, 4

	// var valueLength int32 at bp+376, 4

	var tmpPtr uintptr
	var value uintptr
	var argname uintptr
	var p uintptr
	var last uintptr
	// var fieldCount int32 at bp+352, 4

	// var nameLength int32 at bp+368, 4

	// var fieldValues uintptr at bp+360, 8

	var _objPtr uintptr
	var _objPtr1 uintptr
	iPtr = interp
	localPtr = uintptr(0)
	precompiled = 0

	if !((*Tcl_Obj)(unsafe.Pointer(bodyPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclProcBodyType))) {
		goto __1
	}
	// Because the body is a TclProProcBody, the actual body is already
	// compiled, and it is not shared with anyone else, so it's OK not to
	// unshare it (as a matter of fact, it is bad to unshare it, because
	// there may be no source code).
	//
	// We don't create and initialize a Proc structure for the procedure;
	// rather, we use what is in the body object. We increment the ref
	// count of the Proc struct since the command (soon to be created)
	// will be holding a reference to it.

	procPtr = *(*uintptr)(unsafe.Pointer(bodyPtr + 32))
	(*Proc)(unsafe.Pointer(procPtr)).FiPtr = iPtr
	(*Proc)(unsafe.Pointer(procPtr)).FrefCount++
	precompiled = 1
	goto __2
__1:
	// If the procedure's body object is shared because its string value
	// is identical to, e.g., the body of another procedure, we must
	// create a private copy for this procedure to use. Such sharing of
	// procedure bodies is rare but can cause problems. A procedure body
	// is compiled in a context that includes the number of "slots"
	// allocated by the compiler for local variables. There is a local
	// variable slot for each formal parameter (the
	// "procPtr->numCompiledLocals = numArgs" assignment below). This
	// means that the same code can not be shared by two procedures that
	// have a different number of arguments, even if their bodies are
	// identical. Note that we don't use Tcl_DuplicateObj since we would
	// not want any bytecode internal representation.

	if !((*Tcl_Obj)(unsafe.Pointer(bodyPtr)).FrefCount > 1) {
		goto __3
	}
	sharedBodyPtr = bodyPtr

	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(bodyPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 336)) = (*Tcl_Obj)(unsafe.Pointer(bodyPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(bodyPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, bodyPtr, bp+336)
	}()
	bodyPtr = XTcl_NewStringObj(tls, bytes, *(*int32)(unsafe.Pointer(bp + 336 /* length */)))

	// TIP #280.
	// Ensure that the continuation line data for the original body is
	// not lost and applies to the new body as well.

	XTclContinuationsCopy(tls, bodyPtr, sharedBodyPtr)
__3:
	;

	// Create and initialize a Proc structure for the procedure. We
	// increment the ref count of the procedure's body object since there
	// will be a reference to it in the Proc structure.

	(*Tcl_Obj)(unsafe.Pointer(bodyPtr)).FrefCount++

	procPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Proc{})))
	(*Proc)(unsafe.Pointer(procPtr)).FiPtr = iPtr
	(*Proc)(unsafe.Pointer(procPtr)).FrefCount = 1
	(*Proc)(unsafe.Pointer(procPtr)).FbodyPtr = bodyPtr
	(*Proc)(unsafe.Pointer(procPtr)).FnumArgs = 0 // Actual argument count is set below.
	(*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals = 0
	(*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr = uintptr(0)
	(*Proc)(unsafe.Pointer(procPtr)).FlastLocalPtr = uintptr(0)
__2:
	;

	// Break up the argument list into argument specifiers, then process each
	// argument specifier. If the body is precompiled, processing is limited
	// to checking that the parsed argument is consistent with the one stored
	// in the Proc.

	result = XTcl_ListObjGetElements(tls, interp, argsPtr, bp+340, bp+344)
	if !(result != TCL_OK) {
		goto __4
	}
	goto procError
__4:
	;

	if !(precompiled != 0) {
		goto __5
	}
	if !(*(*int32)(unsafe.Pointer(bp + 340)) > (*Proc)(unsafe.Pointer(procPtr)).FnumArgs) {
		goto __7
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+62031, libc.VaList(bp, procName, *(*int32)(unsafe.Pointer(bp + 340 /* numArgs */)),
			(*Proc)(unsafe.Pointer(procPtr)).FnumArgs)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+3593, ts+7420, ts+25430,
		ts+62107, uintptr(0)))
	goto procError
__7:
	;
	localPtr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr
	goto __6
__5:
	(*Proc)(unsafe.Pointer(procPtr)).FnumArgs = *(*int32)(unsafe.Pointer(bp + 340 /* numArgs */))
	(*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals = *(*int32)(unsafe.Pointer(bp + 340 /* numArgs */))
__6:
	;

	i = 0
__8:
	if !(i < *(*int32)(unsafe.Pointer(bp + 340))) {
		goto __10
	}

	// Now divide the specifier up into name and default.

	result = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 344 /* argArray */)) + uintptr(i)*8)), bp+352,
		bp+360)
	if !(result != TCL_OK) {
		goto __11
	}
	goto procError
__11:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 352)) > 2) {
		goto __12
	}
	errorObj = XTcl_NewStringObj(tls,
		ts+62120, -1)
	XTcl_AppendObjToObj(tls, errorObj, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 344 /* argArray */)) + uintptr(i)*8)))
	XTcl_AppendToObj(tls, errorObj, ts+25027, -1)
	XTcl_SetObjResult(tls, interp, errorObj)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+7420, ts+25430,
		ts+62160, uintptr(0)))
	goto procError
__12:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 352)) == 0 || XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360))))) == 0) {
		goto __13
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+62181, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+104, ts+3593, ts+7420, ts+25430,
		ts+62160, uintptr(0)))
	goto procError
__13:
	;

	// Check that the formal parameter name is a scalar.

	p = libc.AssignUintptr(&argname, XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360 /* fieldValues */)))), bp+368))
	last = argname + uintptr(*(*int32)(unsafe.Pointer(bp + 368)))
__14:
	if !(p < last) {
		goto __15
	}
	if !(int32(*(*int8)(unsafe.Pointer(p))) == '(') {
		goto __16
	}
	if !(int32(*(*int8)(unsafe.Pointer(last + libc.UintptrFromInt32(-1)))) == ')') {
		goto __18
	} // We have an array element.
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+62203,
		libc.VaList(bp+144, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360 /* fieldValues */))))))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+152, ts+3593, ts+7420, ts+25430,
		ts+62160, uintptr(0)))
	goto procError
__18:
	;
	goto __17
__16:
	if !(int32(*(*int8)(unsafe.Pointer(p))) == ':' && int32(*(*int8)(unsafe.Pointer(p + 1))) == ':') {
		goto __19
	}
	errorObj1 = XTcl_NewStringObj(tls,
		ts+62245, -1)
	XTcl_AppendObjToObj(tls, errorObj1, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360 /* fieldValues */)))))
	XTcl_AppendToObj(tls, errorObj1, ts+62264, -1)
	XTcl_SetObjResult(tls, interp, errorObj1)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+192, ts+3593, ts+7420, ts+25430,
		ts+62160, uintptr(0)))
	goto procError
__19:
	;
__17:
	;
	p++
	goto __14
__15:
	;

	if !(precompiled != 0) {
		goto __20
	}
	// Compare the parsed argument with the stored one. Note that the
	// only flag value that makes sense at this point is VAR_ARGUMENT
	// (its value was kept the same as pre VarReform to simplify
	// tbcload's processing of older byetcodes).
	//
	// The only other flag vlaue that is important to retrieve from
	// precompiled procs is VAR_TEMPORARY (also unchanged). It is
	// needed later when retrieving the variable names.

	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).FnameLength != *(*int32)(unsafe.Pointer(bp + 368)) ||
		libc.Xmemcmp(tls, localPtr+40, argname, uint64(*(*int32)(unsafe.Pointer(bp + 368)))) != 0 ||
		(*CompiledLocal)(unsafe.Pointer(localPtr)).FframeIndex != i ||
		!((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_ARGUMENT != 0) ||
		(*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr == uintptr(0) && *(*int32)(unsafe.Pointer(bp + 352)) == 2 ||
		(*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr != uintptr(0) && *(*int32)(unsafe.Pointer(bp + 352)) != 2) {
		goto __22
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+62287, libc.VaList(bp+232, procName, i)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+248, ts+3593, ts+7420, ts+25430,
		ts+62107, uintptr(0)))
	goto procError
__22:
	;

	// Compare the default value if any.

	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr != uintptr(0)) {
		goto __23
	}
	tmpPtr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer((*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 372)) = (*Tcl_Obj)(unsafe.Pointer((*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer((*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr, bp+372)
	}()
	value = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)) + 1*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 376)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)) + 1*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)) + 1*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)) + 1*8)), bp+376)
	}()

	if !(*(*int32)(unsafe.Pointer(bp + 376)) != *(*int32)(unsafe.Pointer(bp + 372)) ||
		libc.Xmemcmp(tls, value, tmpPtr, uint64(*(*int32)(unsafe.Pointer(bp + 372)))) != 0) {
		goto __24
	}
	errorObj2 = XTcl_ObjPrintf(tls,
		ts+62361, libc.VaList(bp+288, procName))
	XTcl_AppendObjToObj(tls, errorObj2, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360 /* fieldValues */)))))
	XTcl_AppendToObj(tls, errorObj2,
		ts+62396, -1)
	XTcl_SetObjResult(tls, interp, errorObj2)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+296, ts+3593, ts+7420, ts+25430,
		ts+62107, uintptr(0)))
	goto procError
__24:
	;
__23:
	;
	if !(i == *(*int32)(unsafe.Pointer(bp + 340))-1 &&
		(*CompiledLocal)(unsafe.Pointer(localPtr)).FnameLength == 4 &&
		int32(*(*int8)(unsafe.Pointer(localPtr + 40))) == 'a' &&
		libc.Xstrcmp(tls, localPtr+40, ts+13126) == 0) {
		goto __25
	}
	*(*int32)(unsafe.Pointer(localPtr + 16)) |= VAR_IS_ARGS
__25:
	;

	localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr
	goto __21
__20:
	// Allocate an entry in the runtime procedure frame's array of
	// local variables for the argument.

	localPtr = XTcl_Alloc(tls, uint32(int32(uintptr(0)+40)+(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))))).Flength+1))
	if !((*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr == uintptr(0)) {
		goto __26
	}
	(*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr = libc.AssignPtrUintptr(procPtr+48, localPtr)
	goto __27
__26:
	(*CompiledLocal)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FlastLocalPtr)).FnextPtr = localPtr
	(*Proc)(unsafe.Pointer(procPtr)).FlastLocalPtr = localPtr
__27:
	;
	(*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr = uintptr(0)
	(*CompiledLocal)(unsafe.Pointer(localPtr)).FnameLength = *(*int32)(unsafe.Pointer(bp + 368 /* nameLength */))
	(*CompiledLocal)(unsafe.Pointer(localPtr)).FframeIndex = i
	(*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags = VAR_ARGUMENT
	(*CompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo = uintptr(0)

	if !(*(*int32)(unsafe.Pointer(bp + 352)) == 2) {
		goto __28
	}
	(*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360 /* fieldValues */)) + 1*8))
	(*Tcl_Obj)(unsafe.Pointer((*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr)).FrefCount++
	goto __29
__28:
	(*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr = uintptr(0)
__29:
	;
	libc.Xmemcpy(tls, localPtr+40, argname, uint64((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 360)))))).Flength+1))
	if !(i == *(*int32)(unsafe.Pointer(bp + 340))-1 &&
		(*CompiledLocal)(unsafe.Pointer(localPtr)).FnameLength == 4 &&
		int32(*(*int8)(unsafe.Pointer(localPtr + 40))) == 'a' &&
		libc.Xmemcmp(tls, localPtr+40, ts+13126, uint64(4)) == 0) {
		goto __30
	}
	*(*int32)(unsafe.Pointer(localPtr + 16)) |= VAR_IS_ARGS
__30:
	;
__21:
	;
	goto __9
__9:
	i++
	goto __8
	goto __10
__10:
	;

	*(*uintptr)(unsafe.Pointer(procPtrPtr)) = procPtr
	return TCL_OK

procError:
	if !(precompiled != 0) {
		goto __31
	}
	(*Proc)(unsafe.Pointer(procPtr)).FrefCount--
	goto __32
__31:
__33:
	_objPtr = bodyPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __36
	}
	XTclFreeObj(tls, _objPtr)
__36:
	;
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
__37:
	if !((*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr != uintptr(0)) {
		goto __38
	}
	localPtr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr
	(*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr

	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr != uintptr(0)) {
		goto __39
	}
__40:
	_objPtr1 = (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __43
	}
	XTclFreeObj(tls, _objPtr1)
__43:
	;
	goto __41
__41:
	if 0 != 0 {
		goto __40
	}
	goto __42
__42:
	;
__39:
	;

	XTclpFree(tls, localPtr)
	goto __37
__38:
	;
	XTclpFree(tls, procPtr)
__32:
	;
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclGetFrame --
//
//	Given a description of a procedure frame, such as the first argument
//	to an "uplevel" or "upvar" command, locate the call frame for the
//	appropriate level of procedure.
//
// Results:
//	The return value is -1 if an error occurred in finding the frame (in
//	this case an error message is left in the interp's result). 1 is
//	returned if string was either a number or a number preceded by "#" and
//	it specified a valid frame. 0 is returned if string isn't one of the
//	two things above (in this case, the lookup acts as if string were
//	"1"). The variable pointed to by framePtrPtr is filled in with the
//	address of the desired frame (unless an error occurs, in which case it
//	isn't modified).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetFrame(tls *libc.TLS, interp uintptr, name uintptr, framePtrPtr uintptr) int32 { /* tclProc.c:681:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var iPtr uintptr
	var curLevel int32
	// var level int32 at bp+40, 4

	var result int32
	var framePtr uintptr
	iPtr = interp

	// Parse string to figure out which level number to go to.

	result = 1
	curLevel = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Flevel
	if !(int32(*(*int8)(unsafe.Pointer(name))) == '#') {
		goto __1
	}
	if !(XTcl_GetInt(tls, uintptr(0), name+uintptr(1), bp+40) != TCL_OK || *(*int32)(unsafe.Pointer(bp + 40)) < 0) {
		goto __3
	}
	goto levelError
__3:
	;
	goto __2
__1:
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(name)))))*2)))&int32(X_ISdigit) != 0) {
		goto __4
	} // INTL: digit
	if !(XTcl_GetInt(tls, uintptr(0), name, bp+40) != TCL_OK) {
		goto __6
	}
	goto levelError
__6:
	;
	*(*int32)(unsafe.Pointer(bp + 40 /* level */)) = curLevel - *(*int32)(unsafe.Pointer(bp + 40))
	goto __5
__4:
	// (historical, TODO) If name does not contain a level (#0 or 1),
	// TclGetFrame and Tcl_UpVar2 uses current level - 1
	*(*int32)(unsafe.Pointer(bp + 40 /* level */)) = curLevel - 1
	result = 0
	name = ts + 6615 /* "1" */ // be more consistent with TclObjGetFrame (error at top - 1)
__5:
	;
__2:
	;

	// Figure out which frame to use, and return it to the caller.

	framePtr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
__7:
	if !(framePtr != uintptr(0)) {
		goto __9
	}
	if !((*CallFrame)(unsafe.Pointer(framePtr)).Flevel == *(*int32)(unsafe.Pointer(bp + 40))) {
		goto __10
	}
	goto __9
__10:
	;
	goto __8
__8:
	framePtr = (*CallFrame)(unsafe.Pointer(framePtr)).FcallerVarPtr
	goto __7
	goto __9
__9:
	;
	if !(framePtr == uintptr(0)) {
		goto __11
	}
	goto levelError
__11:
	;

	*(*uintptr)(unsafe.Pointer(framePtrPtr)) = framePtr
	return result

levelError:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+13701, libc.VaList(bp, name)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+6915, ts+62451, uintptr(0)))
	return -1
}

//----------------------------------------------------------------------
//
// TclObjGetFrame --
//
//	Given a description of a procedure frame, such as the first argument
//	to an "uplevel" or "upvar" command, locate the call frame for the
//	appropriate level of procedure.
//
// Results:
//	The return value is -1 if an error occurred in finding the frame (in
//	this case an error message is left in the interp's result). 1 is
//	returned if objPtr was either an int or an int preceded by "#" and
//	it specified a valid frame. 0 is returned if objPtr isn't one of the
//	two things above (in this case, the lookup acts as if objPtr were
//	"1"). The variable pointed to by framePtrPtr is filled in with the
//	address of the desired frame (unless an error occurs, in which case it
//	isn't modified).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclObjGetFrame(tls *libc.TLS, interp uintptr, objPtr uintptr, framePtrPtr uintptr) int32 { /* tclProc.c:765:1: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	var iPtr uintptr = interp
	var curLevel int32
	// var level int32 at bp+48, 4

	var result int32
	var name uintptr = uintptr(0)

	// Parse object to figure out which level number to go to.

	result = 0
	curLevel = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Flevel

	// Check for integer first, since that has potential to spare us
	// a generation of a stringrep.

	if objPtr == uintptr(0) {
		// Do nothing
	} else if TCL_OK == XTcl_GetIntFromObj(tls, uintptr(0), objPtr, bp+48) &&
		*(*int32)(unsafe.Pointer(bp + 48)) >= 0 {
		*(*int32)(unsafe.Pointer(bp + 48 /* level */)) = curLevel - *(*int32)(unsafe.Pointer(bp + 48))
		result = 1
	} else if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&levelReferenceType)) {
		*(*int32)(unsafe.Pointer(bp + 48 /* level */)) = int32(*(*int64)(unsafe.Pointer(objPtr + 32)))
		result = 1
	} else {
		name = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}
			return XTcl_GetString(tls, objPtr)
		}()
		if int32(*(*int8)(unsafe.Pointer(name))) == '#' {
			if TCL_OK == XTcl_GetInt(tls, uintptr(0), name+uintptr(1), bp+48) && *(*int32)(unsafe.Pointer(bp + 48)) >= 0 {
				if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
					if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
						(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
					}
					(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
				}

				(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&levelReferenceType))
				*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(*(*int32)(unsafe.Pointer(bp + 48 /* level */)))
				result = 1
			} else {
				result = -1
			}
		} else if int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(name)))))*2)))&int32(X_ISdigit) != 0 { // INTL: digit
			// If this were an integer, we'd have succeeded already.
			// Docs say we have to treat this as a 'bad level'  error.
			result = -1
		}
	}

	if result == 0 {
		*(*int32)(unsafe.Pointer(bp + 48 /* level */)) = curLevel - 1
		name = ts + 6615 /* "1" */
	}
	if result != -1 {
		if *(*int32)(unsafe.Pointer(bp + 48)) >= 0 {
			var framePtr uintptr
			for framePtr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr; framePtr != uintptr(0); framePtr = (*CallFrame)(unsafe.Pointer(framePtr)).FcallerVarPtr {
				if (*CallFrame)(unsafe.Pointer(framePtr)).Flevel == *(*int32)(unsafe.Pointer(bp + 48)) {
					*(*uintptr)(unsafe.Pointer(framePtrPtr)) = framePtr
					return result
				}
			}
		}
		if name == uintptr(0) {
			name = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
				}
				return XTcl_GetString(tls, objPtr)
			}()
		}
	}

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+13701, libc.VaList(bp, name)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+13716, name, uintptr(0)))
	return -1
}

//----------------------------------------------------------------------
//
// Tcl_UplevelObjCmd --
//
//	This object function is invoked to process the "uplevel" Tcl command.
//	See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sUplevel_Callback(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclProc.c:859:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var savedVarFramePtr uintptr = *(*ClientData)(unsafe.Pointer(data))

	if result == TCL_ERROR {
		XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
			ts+62462, libc.VaList(bp, XTcl_GetErrorLine(tls, interp))))
	}

	// Restore the variable frame, and return.

	(*Interp)(unsafe.Pointer(interp)).FvarFramePtr = savedVarFramePtr
	return result
}

// ARGSUSED
func XTcl_UplevelObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclProc.c:881:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRUplevelObjCmd})), dummy, objc, objv)
}

func XTclNRUplevelObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclProc.c:891:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var iPtr uintptr
	// var invoker uintptr at bp+16, 8

	// var word int32 at bp+24, 4

	var result int32
	var savedVarFramePtr uintptr
	// var framePtr uintptr at bp+8, 8

	var objPtr uintptr
	var status int32
	// var llength int32 at bp, 4

	var cachePtr uintptr
	var _objPtr uintptr
	var _callbackPtr uintptr
	iPtr = interp
	*(*uintptr)(unsafe.Pointer(bp + 16 /* invoker */)) = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 24 /* word */)) = 0

	if !(objc < 2) {
		goto __1
	}
	// to do
	//    simplify things by interpreting the argument as a command when there
	//    is only one argument.  This requires a TIP since currently a single
	//    argument is interpreted as a level indicator if possible.
uplevelSyntax:
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+62492)
	return TCL_ERROR
	goto __2
__1:
	if !(!((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != uintptr(0)) && objc == 2) {
		goto __3
	}
	status = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp)
	if !(status == TCL_OK && *(*int32)(unsafe.Pointer(bp)) > 1) {
		goto __4
	}
	// the first argument can't interpreted as a level. Avoid
	// generating a string representation of the script.
	result = XTclGetFrame(tls, interp, ts+6615, bp+8)
	if !(result == -1) {
		goto __5
	}
	return TCL_ERROR
__5:
	;
	objc = objc - 1
	objv += 8 * uintptr(1)
	goto havelevel
__4:
	;
__3:
	;
__2:
	;

	// Find the level to use for executing the command.

	result = XTclObjGetFrame(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8)
	if !(result == -1) {
		goto __6
	}
	return TCL_ERROR
__6:
	;
	objc = objc - (result + 1)
	if !(objc == 0) {
		goto __7
	}
	goto uplevelSyntax
__7:
	;
	objv += 8 * uintptr(result+1)

havelevel:

	// Modify the interpreter state to execute in the given frame.

	savedVarFramePtr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = *(*uintptr)(unsafe.Pointer(bp + 8 /* framePtr */))

	// Execute the residual arguments as a command.

	if !(objc == 1) {
		goto __8
	}
	// TIP #280. Make actual argument location available to eval'd script

	XTclArgumentGet(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp+16, bp+24)
	objPtr = *(*uintptr)(unsafe.Pointer(objv))

	goto __9
__8:
	// More than one argument: concatenate them together with spaces
	// between, then evaluate the result. Tcl_EvalObjEx will delete the
	// object when it decrements its refcount after eval'ing it.

	objPtr = XTcl_ConcatObj(tls, objc, objv)
__9:
	;

__10:
__13:
	;
__16:
	if !(interp == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __19
	}
	_objPtr = XTclThreadAllocObj(tls)
	goto __20
__19:
	_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__20:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	_callbackPtr = _objPtr
	goto __14
__14:
	if 0 != 0 {
		goto __13
	}
	goto __15
__15:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{sUplevel_Callback}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = savedVarFramePtr
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __11
__11:
	if 0 != 0 {
		goto __10
	}
	goto __12
__12:
	;
	return XTclNREvalObjEx(tls, interp, objPtr, 0, *(*uintptr)(unsafe.Pointer(bp + 16 /* invoker */)), *(*int32)(unsafe.Pointer(bp + 24 /* word */)))
}

//----------------------------------------------------------------------
//
// TclFindProc --
//
//	Given the name of a procedure, return a pointer to the record
//	describing the procedure. The procedure will be looked up using the
//	usual rules: first in the current namespace and then in the global
//	namespace.
//
// Results:
//	NULL is returned if the name doesn't correspond to any procedure.
//	Otherwise, the return value is a pointer to the procedure's record. If
//	the name is found but refers to an imported command that points to a
//	"real" procedure defined in another namespace, a pointer to that
//	"real" procedure's structure is returned.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFindProc(tls *libc.TLS, iPtr uintptr, procName uintptr) uintptr { /* tclProc.c:1003:6: */
	var cmd Tcl_Command
	var cmdPtr uintptr

	cmd = XTcl_FindCommand(tls, iPtr, procName, uintptr(0), 0)
	if cmd == uintptr(0) {
		return uintptr(0)
	}
	cmdPtr = cmd

	return XTclIsProc(tls, cmdPtr)
}

//----------------------------------------------------------------------
//
// TclIsProc --
//
//	Tells whether a command is a Tcl procedure or not.
//
// Results:
//	If the given command is actually a Tcl procedure, the return value is
//	the address of the record describing the procedure. Otherwise the
//	return value is 0.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclIsProc(tls *libc.TLS, cmdPtr uintptr) uintptr { /* tclProc.c:1038:6: */
	var origCmd Tcl_Command = XTclGetOriginalCommand(tls, cmdPtr)

	if origCmd != uintptr(0) {
		cmdPtr = origCmd
	}
	if (*Command)(unsafe.Pointer(cmdPtr)).FdeleteProc == *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{XTclProcDeleteProc})) {
		return (*Command)(unsafe.Pointer(cmdPtr)).FobjClientData
	}
	return uintptr(0)
}

func sProcWrongNumArgs(tls *libc.TLS, interp uintptr, skip int32) int32 { /* tclProc.c:1054:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var framePtr uintptr = (*Interp)(unsafe.Pointer(interp)).FvarFramePtr
	var procPtr uintptr = (*CallFrame)(unsafe.Pointer(framePtr)).FprocPtr
	var localCt int32 = (*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals
	var numArgs int32
	var i int32
	var desiredObjs uintptr
	var final uintptr = uintptr(0)

	// Build up desired argument list for Tcl_WrongNumArgs

	numArgs = (*Proc)(unsafe.Pointer((*CallFrame)(unsafe.Pointer(framePtr)).FprocPtr)).FnumArgs
	desiredObjs = XTclStackAlloc(tls, interp,
		int32(unsafe.Sizeof(uintptr(0)))*(numArgs+1))

	if (*CallFrame)(unsafe.Pointer(framePtr)).FisProcCallFrame&FRAME_IS_LAMBDA != 0 {
		*(*uintptr)(unsafe.Pointer(desiredObjs)) = XTcl_NewStringObj(tls, ts+61998, -1)
	} else {
		*(*uintptr)(unsafe.Pointer(desiredObjs)) = XTcl_NewListObj(tls, 1, (*CallFrame)(unsafe.Pointer(framePtr)).Fobjv+uintptr(skip)*8-uintptr(1)*8)
	}
	(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(desiredObjs)))).FrefCount++

	if localCt > 0 {
		var defPtr uintptr = (*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr + 8 + uintptr(localCt)*8

		i = 1
	__1:
		if !(i <= numArgs) {
			goto __3
		}
		{
			var argObj uintptr
			var namePtr uintptr = *(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr + 8 + uintptr(i-1)*8))

			if *(*uintptr)(unsafe.Pointer(defPtr + 8)) != uintptr(0) {
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						argObj = XTclThreadAllocObj(tls)
					} else {
						argObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(argObj + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(argObj)).FrefCount = 0
				(*Tcl_Obj)(unsafe.Pointer(argObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(argObj)).Flength = 0
				(*Tcl_Obj)(unsafe.Pointer(argObj)).FtypePtr = uintptr(0)
				{
				}

				XTcl_AppendStringsToObj(tls, argObj, libc.VaList(bp, ts+62518, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes
					}
					return XTcl_GetString(tls, namePtr)
				}(), ts+62518, uintptr(0)))
			} else if (*Var)(unsafe.Pointer(defPtr)).Fflags&VAR_IS_ARGS != 0 {
				numArgs--
				final = ts + 62520 /* "?arg ...?" */
				goto __3
			} else {
				argObj = namePtr
				(*Tcl_Obj)(unsafe.Pointer(namePtr)).FrefCount++
			}
			*(*uintptr)(unsafe.Pointer(desiredObjs + uintptr(i)*8)) = argObj

		}
		goto __2
	__2:
		i++
		defPtr += 16
		goto __1
		goto __3
	__3:
	}

	XTcl_ResetResult(tls, interp)
	XTcl_WrongNumArgs(tls, interp, numArgs+1, desiredObjs, final)

	for i = 0; i <= numArgs; i++ {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(desiredObjs + uintptr(i)*8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	XTclStackFree(tls, interp, desiredObjs)
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclInitCompiledLocals --
//
//	This routine is invoked in order to initialize the compiled locals
//	table for a new call frame.
//
//	DEPRECATED: functionality has been inlined elsewhere; this function
//	remains to insure binary compatibility with Itcl.
//
// Results:
//	None.
//
// Side effects:
//	May invoke various name resolvers in order to determine which
//	variables are being referenced at runtime.
//
//----------------------------------------------------------------------

func XTclInitCompiledLocals(tls *libc.TLS, interp uintptr, framePtr uintptr, nsPtr uintptr) { /* tclProc.c:1137:1: */
	var varPtr uintptr = (*CallFrame)(unsafe.Pointer(framePtr)).FcompiledLocals
	var bodyPtr uintptr
	var codePtr uintptr

	bodyPtr = (*Proc)(unsafe.Pointer((*CallFrame)(unsafe.Pointer(framePtr)).FprocPtr)).FbodyPtr
	if (*Tcl_Obj)(unsafe.Pointer(bodyPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclByteCodeType)) {
		XTcl_Panic(tls, ts+62530, 0)
	}
	codePtr = *(*uintptr)(unsafe.Pointer(bodyPtr + 32))

	if (*CallFrame)(unsafe.Pointer(framePtr)).FnumCompiledLocals != 0 {
		if !(int32((*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr) != 0) {
			sInitLocalCache(tls, (*CallFrame)(unsafe.Pointer(framePtr)).FprocPtr)
		}
		(*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr = (*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr
		(*LocalCache)(unsafe.Pointer((*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr)).FrefCount++
	}

	sInitResolvedLocals(tls, interp, codePtr, varPtr, nsPtr)
}

//----------------------------------------------------------------------
//
// InitResolvedLocals --
//
//	This routine is invoked in order to initialize the compiled locals
//	table for a new call frame.
//
// Results:
//	None.
//
// Side effects:
//	May invoke various name resolvers in order to determine which
//	variables are being referenced at runtime.
//
//----------------------------------------------------------------------

func sInitResolvedLocals(tls *libc.TLS, interp uintptr, codePtr uintptr, varPtr uintptr, nsPtr uintptr) { /* tclProc.c:1182:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var iPtr uintptr
	var haveResolvers int32
	var firstLocalPtr uintptr
	var localPtr uintptr
	var varNum int32
	var resVarInfo uintptr
	var resPtr uintptr
	// var vinfo uintptr at bp, 8

	var result int32
	var resolvedVarPtr uintptr
	iPtr = interp
	haveResolvers = libc.Bool32((*Namespace)(unsafe.Pointer(nsPtr)).FcompiledVarResProc != 0 || (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr != 0)

	// Find the localPtr corresponding to varPtr

	varNum = int32((int64(varPtr) - int64((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FframePtr)).FcompiledLocals)) / 16)
	localPtr = (*Proc)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FframePtr)).FprocPtr)).FfirstLocalPtr
__1:
	if !(libc.PostDecInt32(&varNum, 1) != 0) {
		goto __2
	}
	localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr
	goto __1
__2:
	;

	if !!(haveResolvers != 0 && (*ByteCode)(unsafe.Pointer(codePtr)).Fflags&uint32(TCL_BYTECODE_RESOLVE_VARS) != 0) {
		goto __3
	}
	goto doInitResolvedLocals
__3:
	;

	// This is the first run after a recompile, or else the resolver epoch
	// has changed: update the resolver cache.

	firstLocalPtr = localPtr
__4:
	if !(localPtr != uintptr(0)) {
		goto __6
	}
	if !((*CompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo != 0) {
		goto __7
	}
	if !((*Tcl_ResolvedVarInfo)(unsafe.Pointer((*CompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo)).FdeleteProc != 0) {
		goto __8
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ResolvedVarInfo)(unsafe.Pointer((*CompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo)).FdeleteProc})).f(tls, (*CompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo)
	goto __9
__8:
	XTclpFree(tls, (*CompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo)
__9:
	;
	(*CompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo = uintptr(0)
__7:
	;
	*(*int32)(unsafe.Pointer(localPtr + 16)) &= libc.CplInt32(VAR_RESOLVED)

	if !(haveResolvers != 0 && !((*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&(VAR_ARGUMENT|VAR_TEMPORARY) != 0)) {
		goto __10
	}
	resPtr = (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr

	if !((*Namespace)(unsafe.Pointer(nsPtr)).FcompiledVarResProc != 0) {
		goto __11
	}
	result = (*struct {
		f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Namespace)(unsafe.Pointer(nsPtr)).FcompiledVarResProc})).f(tls, (*Namespace)(unsafe.Pointer(nsPtr)).Finterp,
		localPtr+40, (*CompiledLocal)(unsafe.Pointer(localPtr)).FnameLength,
		nsPtr, bp)
	goto __12
__11:
	result = TCL_CONTINUE
__12:
	;

__13:
	if !(result == TCL_CONTINUE && resPtr != 0) {
		goto __14
	}
	if !((*ResolverScheme)(unsafe.Pointer(resPtr)).FcompiledVarResProc != 0) {
		goto __15
	}
	result = (*struct {
		f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*ResolverScheme)(unsafe.Pointer(resPtr)).FcompiledVarResProc})).f(tls, (*Namespace)(unsafe.Pointer(nsPtr)).Finterp,
		localPtr+40, (*CompiledLocal)(unsafe.Pointer(localPtr)).FnameLength,
		nsPtr, bp)
__15:
	;
	resPtr = (*ResolverScheme)(unsafe.Pointer(resPtr)).FnextPtr
	goto __13
__14:
	;
	if !(result == TCL_OK) {
		goto __16
	}
	(*CompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo = *(*uintptr)(unsafe.Pointer(bp /* vinfo */))
	*(*int32)(unsafe.Pointer(localPtr + 16)) |= VAR_RESOLVED
__16:
	;
__10:
	;
	goto __5
__5:
	localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr
	goto __4
	goto __6
__6:
	;
	localPtr = firstLocalPtr
	*(*uint32)(unsafe.Pointer(codePtr + 32)) &= libc.Uint32FromInt32(libc.CplInt32(TCL_BYTECODE_RESOLVE_VARS))

	// Initialize the array of local variables stored in the call frame. Some
	// variables may have special resolution rules. In that case, we call
	// their "resolver" procs to get our hands on the variable, and we make
	// the compiled local a link to the real variable.

doInitResolvedLocals:
	;
__17:
	if !(localPtr != uintptr(0)) {
		goto __19
	}
	(*Var)(unsafe.Pointer(varPtr)).Fflags = 0
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = uintptr(0)

	// Now invoke the resolvers to determine the exact variables that
	// should be used.

	resVarInfo = (*CompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo
	if !(resVarInfo != 0 && (*Tcl_ResolvedVarInfo)(unsafe.Pointer(resVarInfo)).FfetchProc != 0) {
		goto __20
	}
	resolvedVarPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) Tcl_Var
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ResolvedVarInfo)(unsafe.Pointer(resVarInfo)).FfetchProc})).f(tls, interp, resVarInfo)

	if !(resolvedVarPtr != 0) {
		goto __21
	}
	if !((*Var)(unsafe.Pointer(resolvedVarPtr)).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __22
	}
	(*VarInHash)(unsafe.Pointer(resolvedVarPtr)).FrefCount++
__22:
	;
	(*Var)(unsafe.Pointer(varPtr)).Fflags = VAR_LINK
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = resolvedVarPtr
__21:
	;
__20:
	;
	goto __18
__18:
	varPtr += 16
	localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr
	goto __17
	goto __19
__19:
}

func XTclFreeLocalCache(tls *libc.TLS, interp uintptr, localCachePtr uintptr) { /* tclProc.c:1290:1: */
	var i int32
	var namePtrPtr uintptr = localCachePtr + 8

	i = 0
__1:
	if !(i < (*LocalCache)(unsafe.Pointer(localCachePtr)).FnumVars) {
		goto __3
	}
	{
		var objPtr uintptr = *(*uintptr)(unsafe.Pointer(namePtrPtr))

		if objPtr != 0 {
			// TclReleaseLiteral calls Tcl_DecrRefCount for us
			XTclReleaseLiteral(tls, interp, objPtr)
		}

	}
	goto __2
__2:
	i++
	namePtrPtr += 8
	goto __1
	goto __3
__3:
	;
	XTclpFree(tls, localCachePtr)
}

func sInitLocalCache(tls *libc.TLS, procPtr uintptr) { /* tclProc.c:1309:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = (*Proc)(unsafe.Pointer(procPtr)).FiPtr
	var codePtr uintptr = *(*uintptr)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FbodyPtr + 32))
	var localCt int32 = (*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals
	var numArgs int32 = (*Proc)(unsafe.Pointer(procPtr)).FnumArgs
	var i int32 = 0
	var namePtr uintptr
	var varPtr uintptr
	var localCachePtr uintptr
	var localPtr uintptr
	// var new int32 at bp, 4

	// Cache the names and initial values of local variables; store the
	// cache in both the framePtr for this execution and in the codePtr
	// for future calls.

	localCachePtr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+8))+uint64(localCt)*uint64(unsafe.Sizeof(uintptr(0)))+uint64(numArgs)*uint64(unsafe.Sizeof(Var{}))))

	namePtr = localCachePtr + 8
	varPtr = namePtr + uintptr(localCt)*8
	localPtr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr
	for localPtr != 0 {
		if (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags&VAR_TEMPORARY != 0 {
			*(*uintptr)(unsafe.Pointer(namePtr)) = uintptr(0)
		} else {
			*(*uintptr)(unsafe.Pointer(namePtr)) = XTclCreateLiteral(tls, iPtr, localPtr+40,
				(*CompiledLocal)(unsafe.Pointer(localPtr)).FnameLength /* hash */, libc.Uint32(libc.Uint32FromInt32(-1)),
				bp, uintptr(0), 0, uintptr(0))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(namePtr)))).FrefCount++
		}

		if i < numArgs {
			(*Var)(unsafe.Pointer(varPtr)).Fflags = (*CompiledLocal)(unsafe.Pointer(localPtr)).Fflags & VAR_IS_ARGS
			*(*uintptr)(unsafe.Pointer(varPtr + 8)) = (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr
			varPtr += 16
			i++
		}
		namePtr += 8
		localPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr
	}
	(*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr = localCachePtr
	(*LocalCache)(unsafe.Pointer(localCachePtr)).FrefCount = 1
	(*LocalCache)(unsafe.Pointer(localCachePtr)).FnumVars = localCt
}

//----------------------------------------------------------------------
//
// InitArgsAndLocals --
//
//	This routine is invoked in order to initialize the arguments and other
//	compiled locals table for a new call frame.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Allocates memory on the stack for the compiled local variables, the
//	caller is responsible for freeing them. Initialises all variables. May
//	invoke various name resolvers in order to determine which variables
//	are being referenced at runtime.
//
//----------------------------------------------------------------------

func sInitArgsAndLocals(tls *libc.TLS, interp uintptr, procNameObj uintptr, skip int32) int32 { /* tclProc.c:1381:1: */
	var framePtr uintptr
	var procPtr uintptr
	var codePtr uintptr
	var varPtr uintptr
	var defPtr uintptr
	var localCt int32
	var numArgs int32
	var argCt int32
	var i int32
	var imax int32
	var argObjs uintptr
	// "Normal" arguments; last formal is special, depends on it being
	// 'args'.

	var objPtr uintptr
	// This loop is entered if argCt < (numArgs-1). Set default values;
	// last formal is special.

	var objPtr1 uintptr
	var listPtr uintptr
	var objPtr2 uintptr
	var objPtr3 uintptr
	var cachePtr uintptr
	var _objPtr uintptr
	var _callbackPtr uintptr
	framePtr = (*Interp)(unsafe.Pointer(interp)).FvarFramePtr
	procPtr = (*CallFrame)(unsafe.Pointer(framePtr)).FprocPtr
	codePtr = *(*uintptr)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FbodyPtr + 32))
	localCt = (*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals

	// Make sure that the local cache of variable names and initial values has
	// been initialised properly .

	if !(localCt != 0) {
		goto __1
	}
	if !!(int32((*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr) != 0) {
		goto __3
	}
	sInitLocalCache(tls, procPtr)
__3:
	;
	(*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr = (*ByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr
	(*LocalCache)(unsafe.Pointer((*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr)).FrefCount++
	defPtr = (*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr + 8 + uintptr(localCt)*8
	goto __2
__1:
	defPtr = uintptr(0)
__2:
	;

	// Create the "compiledLocals" array. Make sure it is large enough to hold
	// all the procedure's compiled local variables, including its formal
	// parameters.

	varPtr = XTclStackAlloc(tls, interp, int32(uint64(localCt)*uint64(unsafe.Sizeof(Var{}))))
	(*CallFrame)(unsafe.Pointer(framePtr)).FcompiledLocals = varPtr
	(*CallFrame)(unsafe.Pointer(framePtr)).FnumCompiledLocals = localCt

	// Match and assign the call's actual parameters to the procedure's formal
	// arguments. The formal arguments are described by the first numArgs
	// entries in both the Proc structure's local variable list and the call
	// frame's local variable array.

	numArgs = (*Proc)(unsafe.Pointer(procPtr)).FnumArgs
	argCt = (*CallFrame)(unsafe.Pointer(framePtr)).Fobjc - skip // Set it to the number of args to the
	// procedure.
	argObjs = (*CallFrame)(unsafe.Pointer(framePtr)).Fobjv + uintptr(skip)*8
	if !(numArgs == 0) {
		goto __4
	}
	if !(argCt != 0) {
		goto __5
	}
	goto incorrectArgs
	goto __6
__5:
	goto correctArgs
__6:
	;
__4:
	;
	imax = func() int32 {
		if argCt < numArgs-1 {
			return argCt
		}
		return numArgs - 1
	}()
	i = 0
__7:
	if !(i < imax) {
		goto __9
	}
	// "Normal" arguments; last formal is special, depends on it being
	// 'args'.

	objPtr = *(*uintptr)(unsafe.Pointer(argObjs + uintptr(i)*8))

	(*Var)(unsafe.Pointer(varPtr)).Fflags = 0
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = objPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ // Local var is a reference.
	goto __8
__8:
	i++
	varPtr += 16
	if defPtr != 0 {
		defPtr += 16
	} else {
		_ = defPtr
	}
	goto __7
	goto __9
__9:
	;
__10:
	if !(i < numArgs-1) {
		goto __12
	}
	// This loop is entered if argCt < (numArgs-1). Set default values;
	// last formal is special.

	if defPtr != 0 {
		objPtr1 = *(*uintptr)(unsafe.Pointer(defPtr + 8))
	} else {
		objPtr1 = uintptr(0)
	}

	if !!(objPtr1 != 0) {
		goto __13
	}
	goto incorrectArgs
__13:
	;
	(*Var)(unsafe.Pointer(varPtr)).Fflags = 0
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = objPtr1
	(*Tcl_Obj)(unsafe.Pointer(objPtr1)).FrefCount++ // Local var reference.
	goto __11
__11:
	i++
	varPtr += 16
	if defPtr != 0 {
		defPtr += 16
	} else {
		_ = defPtr
	}
	goto __10
	goto __12
__12:
	;

	// When we get here, the last formal argument remains to be defined:
	// defPtr and varPtr point to the last argument to be initialized.

	(*Var)(unsafe.Pointer(varPtr)).Fflags = 0
	if !(defPtr != 0 && (*Var)(unsafe.Pointer(defPtr)).Fflags&VAR_IS_ARGS != 0) {
		goto __14
	}
	listPtr = XTcl_NewListObj(tls, argCt-i, argObjs+uintptr(i)*8)

	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = listPtr
	(*Tcl_Obj)(unsafe.Pointer(listPtr)).FrefCount++ // Local var is a reference.
	goto __15
__14:
	if !(argCt == numArgs) {
		goto __16
	}
	objPtr2 = *(*uintptr)(unsafe.Pointer(argObjs + uintptr(i)*8))

	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = objPtr2
	(*Tcl_Obj)(unsafe.Pointer(objPtr2)).FrefCount++ // Local var is a reference.
	goto __17
__16:
	if !(argCt < numArgs && defPtr != 0 && *(*uintptr)(unsafe.Pointer(defPtr + 8)) != 0) {
		goto __18
	}
	objPtr3 = *(*uintptr)(unsafe.Pointer(defPtr + 8))

	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = objPtr3
	(*Tcl_Obj)(unsafe.Pointer(objPtr3)).FrefCount++ // Local var is a reference.
	goto __19
__18:
	goto incorrectArgs
__19:
	;
__17:
	;
__15:
	;
	varPtr += 16

	// Initialise and resolve the remaining compiledLocals. In the absence of
	// resolvers, they are undefined local vars: (flags=0, value=NULL).

correctArgs:
	if !(numArgs < localCt) {
		goto __20
	}
	if !(!(int32((*Namespace)(unsafe.Pointer((*CallFrame)(unsafe.Pointer(framePtr)).FnsPtr)).FcompiledVarResProc) != 0) &&
		!(int32((*Interp)(unsafe.Pointer(interp)).FresolverPtr) != 0)) {
		goto __21
	}
	libc.Xmemset(tls, varPtr, 0, uint64(localCt-numArgs)*uint64(unsafe.Sizeof(Var{})))
	goto __22
__21:
	sInitResolvedLocals(tls, interp, codePtr, varPtr, (*CallFrame)(unsafe.Pointer(framePtr)).FnsPtr)
__22:
	;
__20:
	;

	return TCL_OK

	// Initialise all compiled locals to avoid problems at DeleteLocalVars.

incorrectArgs:
	if !(skip != 1 && XTclInitRewriteEnsemble(tls, interp, skip-1, 0, (*CallFrame)(unsafe.Pointer(framePtr)).Fobjv) != 0) {
		goto __23
	}
__24:
__27:
	;
__30:
	if !(interp == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __33
	}
	_objPtr = XTclThreadAllocObj(tls)
	goto __34
__33:
	_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__34:
	;
	goto __31
__31:
	if 0 != 0 {
		goto __30
	}
	goto __32
__32:
	;
	_callbackPtr = _objPtr
	goto __28
__28:
	if 0 != 0 {
		goto __27
	}
	goto __29
__29:
	;
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, int32) int32
	}{XTclClearRootEnsemble}))
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
	*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
	(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
	(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
__23:
	;
	libc.Xmemset(tls, varPtr, 0,
		uint64((int64((*CallFrame)(unsafe.Pointer(framePtr)).FcompiledLocals+uintptr(localCt)*16)-int64(varPtr))/16)*uint64(unsafe.Sizeof(Var{})))
	return sProcWrongNumArgs(tls, interp, skip)
}

//----------------------------------------------------------------------
//
// TclPushProcCallFrame --
//
//	Compiles a proc body if necessary, then pushes a CallFrame suitable
//	for executing it.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	The proc's body may be recompiled. A CallFrame is pushed, it will have
//	to be popped by the caller.
//
//----------------------------------------------------------------------

func XTclPushProcCallFrame(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr, isLambda int32) int32 { /* tclProc.c:1544:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var procPtr uintptr
	var nsPtr uintptr
	// var framePtr uintptr at bp, 8

	var framePtrPtr uintptr
	var result int32
	var codePtr uintptr
	var iPtr uintptr
	procPtr = clientData
	nsPtr = (*Command1)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FcmdPtr)).FnsPtr

	// If necessary (i.e. if we haven't got a suitable compilation already
	// cached) compile the procedure's body. The compiler will allocate frame
	// slots for the procedure's non-argument local variables. Note that
	// compiling the body might increase procPtr->numCompiledLocals if new
	// local variables are found while compiling.

	if !((*Tcl_Obj)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FbodyPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteCodeType))) {
		goto __1
	}
	iPtr = interp

	// When we've got bytecode, this is the check for validity. That is,
	// the bytecode must be for the right interpreter (no cross-leaks!),
	// the code must be from the current epoch (so subcommand compilation
	// is up-to-date), the namespace must match (so variable handling
	// is right) and the resolverEpoch must match (so that new shadowed
	// commands and/or resolver changes are considered).

	codePtr = *(*uintptr)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FbodyPtr + 32))
	if !(*(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) != iPtr ||
		(*ByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch != (*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch ||
		(*ByteCode)(unsafe.Pointer(codePtr)).FnsPtr != nsPtr ||
		(*ByteCode)(unsafe.Pointer(codePtr)).FnsEpoch != (*Namespace)(unsafe.Pointer(nsPtr)).FresolverEpoch) {
		goto __3
	}
	goto doCompilation
__3:
	;
	goto __2
__1:
doCompilation:
	result = XTclProcCompileProc(tls, interp, procPtr, (*Proc)(unsafe.Pointer(procPtr)).FbodyPtr, nsPtr,
		func() uintptr {
			if isLambda != 0 {
				return ts + 62593 /* "body of lambda t..." */
			}
			return ts + 62613 /* "body of proc" */
		}(),
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(isLambda)*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(isLambda)*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(isLambda)*8)))
		}())
	if !(result != TCL_OK) {
		goto __4
	}
	return result
__4:
	;
__2:
	;

	// Set up and push a new call frame for the new procedure invocation.
	// This call frame will execute in the proc's namespace, which might be
	// different than the current namespace. The proc's namespace is that of
	// its command, which can change if the command is renamed from one
	// namespace to another.

	framePtrPtr = bp /* &framePtr */
	XTclPushStackFrame(tls, interp, framePtrPtr,
		nsPtr,
		func() int32 {
			if isLambda != 0 {
				return FRAME_IS_PROC | FRAME_IS_LAMBDA
			}
			return FRAME_IS_PROC
		}())

	(*CallFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* framePtr */)))).Fobjc = objc
	(*CallFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* framePtr */)))).Fobjv = objv
	(*CallFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* framePtr */)))).FprocPtr = procPtr

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclObjInterpProc --
//
//	When a Tcl procedure gets invoked during bytecode evaluation, this
//	object-based routine gets invoked to interpret the procedure.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	Depends on the commands in the procedure.
//
//----------------------------------------------------------------------

func XTclObjInterpProc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclProc.c:1636:1: */
	// Not used much in the core; external interface for iTcl

	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRInterpProc})), clientData, objc, objv)
}

func XTclNRInterpProc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclProc.c:1653:1: */
	var result int32 = XTclPushProcCallFrame(tls, clientData, interp, objc, objv,
		/*isLambda*/ 0)

	if result != TCL_OK {
		return TCL_ERROR
	}
	return XTclNRInterpProcCore(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), 1, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr)
	}{sMakeProcError})))
}

//----------------------------------------------------------------------
//
// TclNRInterpProcCore --
//
//	When a Tcl procedure, lambda term or anything else that works like a
//	procedure gets invoked during bytecode evaluation, this object-based
//	routine gets invoked to interpret the body.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	Nearly anything; depends on the commands in the procedure body.
//
//----------------------------------------------------------------------

func XTclNRInterpProcCore(tls *libc.TLS, interp uintptr, procNameObj uintptr, skip int32, errorProc uintptr) int32 { /* tclProc.c:1690:1: */
	var iPtr uintptr = interp
	var procPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FprocPtr
	var result int32
	var freePtr uintptr
	var codePtr uintptr

	result = sInitArgsAndLocals(tls, interp, procNameObj, skip)
	if result != TCL_OK {
		freePtr = (*Interp)(unsafe.Pointer(iPtr)).FframePtr
		XTcl_PopCallFrame(tls, interp) // Pop but do not free.
		XTclStackFree(tls, interp, (*CallFrame)(unsafe.Pointer(freePtr)).FcompiledLocals)
		// Free compiledLocals.
		XTclStackFree(tls, interp, freePtr) // Free CallFrame.
		return TCL_ERROR
	}

	// Invoke the commands in the procedure's body.

	(*Proc)(unsafe.Pointer(procPtr)).FrefCount++
	codePtr = *(*uintptr)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FbodyPtr + 32))

	for ok := true; ok; ok = 0 != 0 {
		var _callbackPtr uintptr
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr
			{
			}
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if interp == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					_objPtr = XTclThreadAllocObj(tls)
				} else {
					_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			_callbackPtr = _objPtr
		}
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, int32) int32
		}{sInterpProcNR2}))
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = procNameObj
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = errorProc
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
		*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
		(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
		(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
	}
	return XTclNRExecuteByteCode(tls, interp, codePtr)
}

func sInterpProcNR2(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclProc.c:1787:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var iPtr uintptr
	var procPtr uintptr
	var freePtr uintptr
	var procNameObj uintptr
	var errorProc uintptr
	var l int32
	var l1 int32
	var r uintptr
	iPtr = interp
	procPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FprocPtr
	procNameObj = *(*ClientData)(unsafe.Pointer(data))
	errorProc = *(*ClientData)(unsafe.Pointer(data + 1*8))

	if !(0 != 0) {
		goto __1
	}
	if (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FisProcCallFrame&FRAME_IS_LAMBDA != 0 {
		l = 1
	} else {
		l = 0
	}

	if !(func() uintptr {
		if l < (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Fobjc {
			return func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Fobjv + uintptr(l)*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Fobjv + uintptr(l)*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Fobjv + uintptr(l)*8)))
			}()
		}
		return uintptr(0)
	}() != 0) {
		goto __2
	}
__2:
	;

__1:
	;
	if !(libc.PostDecInt32(&(*Proc)(unsafe.Pointer(procPtr)).FrefCount, 1) <= 1) {
		goto __3
	}
	XTclProcCleanupProc(tls, procPtr)
__3:
	;

	// Free the stack-allocated compiled locals and CallFrame. It is important
	// to pop the call frame without freeing it first: the compiledLocals
	// cannot be freed before the frame is popped, as the local variables must
	// be deleted. But the compiledLocals must be freed first, as they were
	// allocated later on the stack.

	if !(result != TCL_OK) {
		goto __4
	}
	goto process
__4:
	;

done:
	if !(0 != 0) {
		goto __5
	}
	if (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FisProcCallFrame&FRAME_IS_LAMBDA != 0 {
		l1 = 1
	} else {
		l1 = 0
	}
	r = XTcl_GetObjResult(tls, interp)

	if !(func() uintptr {
		if l1 < (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Fobjc {
			return func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Fobjv + uintptr(l1)*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Fobjv + uintptr(l1)*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Fobjv + uintptr(l1)*8)))
			}()
		}
		return uintptr(0)
	}() != 0) {
		goto __6
	}
__6:
	;
	if !(r != 0) {
		goto __7
	}
__7:
	;

__5:
	;

	freePtr = (*Interp)(unsafe.Pointer(iPtr)).FframePtr
	XTcl_PopCallFrame(tls, interp) // Pop but do not free.
	XTclStackFree(tls, interp, (*CallFrame)(unsafe.Pointer(freePtr)).FcompiledLocals)
	// Free compiledLocals.
	XTclStackFree(tls, interp, freePtr) // Free CallFrame.
	return result

	// Process any non-TCL_OK result code.

process:
	switch result {
	case TCL_RETURN:
		goto __9

	case TCL_CONTINUE:
		goto __10
	case TCL_BREAK:
		goto __11

		// FALLTHRU

	case TCL_ERROR:
		goto __12
	}
	goto __8
__9:
	// If it is a 'return', do the TIP#90 processing now.

	result = XTclUpdateReturnInfo(tls, interp)
	goto __8

__10:
__11:
	// It's an error to get to this point from a 'break' or 'continue', so
	// transform to an error now.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+62626,
		libc.VaList(bp, func() uintptr {
			if result == TCL_BREAK {
				return ts + 5100 /* "break" */
			}
			return ts + 5117 /* "continue" */
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+39193, ts+62657, uintptr(0)))
	result = TCL_ERROR

	// FALLTHRU

__12:
	// Now it _must_ be an error, so we need to log it as such. This means
	// filling out the error trace. Luckily, we just hand this off to the
	// function handed to us as an argument.

	(*struct {
		f func(*libc.TLS, uintptr, uintptr)
	})(unsafe.Pointer(&struct{ uintptr }{errorProc})).f(tls, interp, procNameObj)
__8:
	;
	goto done
	return int32(0)
}

//----------------------------------------------------------------------
//
// TclProcCompileProc --
//
//	Called just before a procedure is executed to compile the body to byte
//	codes. If the type of the body is not "byte code" or if the compile
//	conditions have changed (namespace context, epoch counters, etc.) then
//	the body is recompiled. Otherwise, this function does nothing.
//
// Results:
//	None.
//
// Side effects:
//	May change the internal representation of the body object to compiled
//	code.
//
//----------------------------------------------------------------------

func XTclProcCompileProc(tls *libc.TLS, interp uintptr, procPtr uintptr, bodyPtr uintptr, nsPtr uintptr, description uintptr, procName uintptr) int32 { /* tclProc.c:1899:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var iPtr uintptr = interp
	// var framePtr uintptr at bp+40, 8

	var codePtr uintptr = *(*uintptr)(unsafe.Pointer(bodyPtr + 32))

	// If necessary, compile the procedure's body. The compiler will allocate
	// frame slots for the procedure's non-argument local variables. If the
	// ByteCode already exists, make sure it hasn't been invalidated by
	// someone redefining a core command (this might make the compiled code
	// wrong). Also, if the code was compiled in/for a different interpreter,
	// we recompile it. Note that compiling the body might increase
	// procPtr->numCompiledLocals if new local variables are found while
	// compiling.
	//
	// Precompiled procedure bodies, however, are immutable and therefore they
	// are not recompiled, even if things have changed.

	if (*Tcl_Obj)(unsafe.Pointer(bodyPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteCodeType)) {
		if *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) == iPtr &&
			(*ByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch == (*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch &&
			(*ByteCode)(unsafe.Pointer(codePtr)).FnsPtr == nsPtr &&
			(*ByteCode)(unsafe.Pointer(codePtr)).FnsEpoch == (*Namespace)(unsafe.Pointer(nsPtr)).FresolverEpoch {
			return TCL_OK
		}

		if (*ByteCode)(unsafe.Pointer(codePtr)).Fflags&uint32(TCL_BYTECODE_PRECOMPILED) != 0 {
			if *(*uintptr)(unsafe.Pointer((*ByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) != iPtr {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+62668, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+25430,
					ts+62704, uintptr(0)))
				return TCL_ERROR
			}
			(*ByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch = (*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch
			(*ByteCode)(unsafe.Pointer(codePtr)).FnsPtr = nsPtr
		} else {
			if (*Tcl_Obj)(unsafe.Pointer(bodyPtr)).FtypePtr != uintptr(0) {
				if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bodyPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
					(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(bodyPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, bodyPtr)
				}
				(*Tcl_Obj)(unsafe.Pointer(bodyPtr)).FtypePtr = uintptr(0)
			}

		}
	}

	if (*Tcl_Obj)(unsafe.Pointer(bodyPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclByteCodeType)) {
		var hePtr uintptr

		// Plug the current procPtr into the interpreter and coerce the code
		// body to byte codes. The interpreter needs to know which proc it's
		// compiling so that it can access its list of compiled locals.
		//
		// TRICKY NOTE: Be careful to push a call frame with the proper
		//   namespace context, so that the byte codes are compiled in the
		//   appropriate class context.

		(*Interp)(unsafe.Pointer(iPtr)).FcompiledProcPtr = procPtr

		if (*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals > (*Proc)(unsafe.Pointer(procPtr)).FnumArgs {
			var clPtr uintptr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr
			var lastPtr uintptr = uintptr(0)
			var i int32
			var numArgs int32 = (*Proc)(unsafe.Pointer(procPtr)).FnumArgs

			for i = 0; i < numArgs; i++ {
				lastPtr = clPtr
				clPtr = (*CompiledLocal)(unsafe.Pointer(clPtr)).FnextPtr
			}

			if lastPtr != 0 {
				(*CompiledLocal)(unsafe.Pointer(lastPtr)).FnextPtr = uintptr(0)
			} else {
				(*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr = uintptr(0)
			}
			(*Proc)(unsafe.Pointer(procPtr)).FlastLocalPtr = lastPtr
			for clPtr != 0 {
				var toFree uintptr = clPtr

				clPtr = (*CompiledLocal)(unsafe.Pointer(clPtr)).FnextPtr
				if (*CompiledLocal)(unsafe.Pointer(toFree)).FresolveInfo != 0 {
					if (*Tcl_ResolvedVarInfo)(unsafe.Pointer((*CompiledLocal)(unsafe.Pointer(toFree)).FresolveInfo)).FdeleteProc != 0 {
						(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ResolvedVarInfo)(unsafe.Pointer((*CompiledLocal)(unsafe.Pointer(toFree)).FresolveInfo)).FdeleteProc})).f(tls, (*CompiledLocal)(unsafe.Pointer(toFree)).FresolveInfo)
					} else {
						XTclpFree(tls, (*CompiledLocal)(unsafe.Pointer(toFree)).FresolveInfo)
					}
				}
				XTclpFree(tls, toFree)
			}
			(*Proc)(unsafe.Pointer(procPtr)).FnumCompiledLocals = (*Proc)(unsafe.Pointer(procPtr)).FnumArgs
		}

		XTclPushStackFrame(tls, interp, bp+40, nsPtr,
			/* isProcCallFrame */ 0)

		// TIP #280: We get the invoking context from the cmdFrame which
		// was saved by 'Tcl_ProcObjCmd' (using linePBodyPtr).

		hePtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr, procPtr)

		// Constructed saved frame has body as word 0. See Tcl_ProcObjCmd.

		(*Interp)(unsafe.Pointer(iPtr)).FinvokeWord = 0
		(*Interp)(unsafe.Pointer(iPtr)).FinvokeCmdFramePtr = func() uintptr {
			if hePtr != 0 {
				return (*Tcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData
			}
			return uintptr(0)
		}()
		XTclSetByteCodeFromAny(tls, interp, bodyPtr, uintptr(0), uintptr(0))
		(*Interp)(unsafe.Pointer(iPtr)).FinvokeCmdFramePtr = uintptr(0)
		XTclPopStackFrame(tls, interp)
	} else if (*ByteCode)(unsafe.Pointer(codePtr)).FnsEpoch != (*Namespace)(unsafe.Pointer(nsPtr)).FresolverEpoch {
		// The resolver epoch has changed, but we only need to invalidate the
		// resolver cache.

		(*ByteCode)(unsafe.Pointer(codePtr)).FnsEpoch = (*Namespace)(unsafe.Pointer(nsPtr)).FresolverEpoch
		*(*uint32)(unsafe.Pointer(codePtr + 32)) |= uint32(TCL_BYTECODE_RESOLVE_VARS)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// MakeProcError --
//
//	Function called by TclObjInterpProc to create the stack information
//	upon an error from a procedure.
//
// Results:
//	The interpreter's error info trace is set to a value that supplements
//	the error code.
//
// Side effects:
//	none.
//
//----------------------------------------------------------------------

func sMakeProcError(tls *libc.TLS, interp uintptr, procNameObj uintptr) { /* tclProc.c:2065:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var overflow int32
	var limit int32 = 60
	// var nameLen int32 at bp+32, 4

	var procName uintptr = XTcl_GetStringFromObj(tls, procNameObj, bp+32)

	overflow = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 32)) > limit)
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+62724,
		libc.VaList(bp, func() int32 {
			if overflow != 0 {
				return limit
			}
			return *(*int32)(unsafe.Pointer(bp + 32))
		}(), procName,
			func() uintptr {
				if overflow != 0 {
					return ts + 7891 /* "..." */
				}
				return ts + 2046 /* "" */
			}(), XTcl_GetErrorLine(tls, interp))))
}

//----------------------------------------------------------------------
//
// TclProcDeleteProc --
//
//	This function is invoked just before a command procedure is removed
//	from an interpreter. Its job is to release all the resources allocated
//	to the procedure.
//
// Results:
//	None.
//
// Side effects:
//	Memory gets freed, unless the procedure is actively being executed.
//	In this case the cleanup is delayed until the last call to the current
//	procedure completes.
//
//----------------------------------------------------------------------

func XTclProcDeleteProc(tls *libc.TLS, clientData ClientData) { /* tclProc.c:2102:1: */
	var procPtr uintptr = clientData

	if libc.PostDecInt32(&(*Proc)(unsafe.Pointer(procPtr)).FrefCount, 1) <= 1 {
		XTclProcCleanupProc(tls, procPtr)
	}
}

//----------------------------------------------------------------------
//
// TclProcCleanupProc --
//
//	This function does all the real work of freeing up a Proc structure.
//	It's called only when the structure's reference count becomes zero.
//
// Results:
//	None.
//
// Side effects:
//	Memory gets freed.
//
//----------------------------------------------------------------------

func XTclProcCleanupProc(tls *libc.TLS, procPtr uintptr) { /* tclProc.c:2130:1: */
	var localPtr uintptr
	var bodyPtr uintptr = (*Proc)(unsafe.Pointer(procPtr)).FbodyPtr
	var defPtr uintptr
	var resVarInfo uintptr
	var hePtr uintptr = uintptr(0)
	var cfPtr uintptr = uintptr(0)
	var iPtr uintptr = (*Proc)(unsafe.Pointer(procPtr)).FiPtr

	if bodyPtr != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = bodyPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	for localPtr = (*Proc)(unsafe.Pointer(procPtr)).FfirstLocalPtr; localPtr != uintptr(0); {
		var nextPtr uintptr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr

		resVarInfo = (*CompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo
		if resVarInfo != 0 {
			if (*Tcl_ResolvedVarInfo)(unsafe.Pointer(resVarInfo)).FdeleteProc != 0 {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ResolvedVarInfo)(unsafe.Pointer(resVarInfo)).FdeleteProc})).f(tls, resVarInfo)
			} else {
				XTclpFree(tls, resVarInfo)
			}
		}

		if (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr != uintptr(0) {
			defPtr = (*CompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr = defPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		XTclpFree(tls, localPtr)
		localPtr = nextPtr
	}
	XTclpFree(tls, procPtr)

	// TIP #280: Release the location data associated with this Proc
	// structure, if any. The interpreter may not exist (For example for
	// procbody structures created by tbcload.

	if iPtr == uintptr(0) {
		return
	}

	hePtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)).FfindProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr, procPtr)
	if !(hePtr != 0) {
		return
	}

	cfPtr = (*Tcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData

	if cfPtr != 0 {
		if (*CmdFrame)(unsafe.Pointer(cfPtr)).Ftype == 4 {
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(cfPtr + 40))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			*(*uintptr)(unsafe.Pointer(cfPtr + 40)) = uintptr(0)
		}
		XTclpFree(tls, (*CmdFrame)(unsafe.Pointer(cfPtr)).Fline)
		(*CmdFrame)(unsafe.Pointer(cfPtr)).Fline = uintptr(0)
		XTclpFree(tls, cfPtr)
	}
	XTcl_DeleteHashEntry(tls, hePtr)
}

//----------------------------------------------------------------------
//
// TclUpdateReturnInfo --
//
//	This function is called when procedures return, and at other points
//	where the TCL_RETURN code is used. It examines the returnLevel and
//	returnCode to determine the real return status.
//
// Results:
//	The return value is the true completion code to use for the procedure
//	or script, instead of TCL_RETURN.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclUpdateReturnInfo(tls *libc.TLS, iPtr uintptr) int32 { /* tclProc.c:2214:1: */
	var code int32 = TCL_RETURN

	(*Interp)(unsafe.Pointer(iPtr)).FreturnLevel--
	if (*Interp)(unsafe.Pointer(iPtr)).FreturnLevel < 0 {
		XTcl_Panic(tls, ts+62758, 0)
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FreturnLevel == 0 {
		// Now we've reached the level to return the requested -code.
		// Since iPtr->returnLevel and iPtr->returnCode have completed
		// their task, we now reset them to default values so that any
		// bare "return TCL_RETURN" that may follow will work [Bug 2152286].

		code = (*Interp)(unsafe.Pointer(iPtr)).FreturnCode
		(*Interp)(unsafe.Pointer(iPtr)).FreturnLevel = 1
		(*Interp)(unsafe.Pointer(iPtr)).FreturnCode = TCL_OK
		if code == TCL_ERROR {
			*(*int32)(unsafe.Pointer(iPtr + 424)) |= ERR_LEGACY_COPY
		}
	}
	return code
}

//----------------------------------------------------------------------
//
// TclGetObjInterpProc --
//
//	Returns a pointer to the TclObjInterpProc function; this is different
//	from the value obtained from the TclObjInterpProc reference on systems
//	like Windows where import and export versions of a function exported
//	by a DLL exist.
//
// Results:
//	Returns the internal address of the TclObjInterpProc function.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetObjInterpProc(tls *libc.TLS) TclObjCmdProcType { /* tclProc.c:2262:1: */
	return *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclObjInterpProc}))
}

//----------------------------------------------------------------------
//
// TclNewProcBodyObj --
//
//	Creates a new object, of type "procbody", whose internal
//	representation is the given Proc struct. The newly created object's
//	reference count is 0.
//
// Results:
//	Returns a pointer to a newly allocated Tcl_Obj, NULL on error.
//
// Side effects:
//	The reference count in the ByteCode attached to the Proc is bumped up
//	by one, since the internal rep stores a pointer to it.
//
//----------------------------------------------------------------------

func XTclNewProcBodyObj(tls *libc.TLS, procPtr uintptr) uintptr { /* tclProc.c:2286:9: */
	var objPtr uintptr

	if !(procPtr != 0) {
		return uintptr(0)
	}

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	if objPtr != 0 {
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclProcBodyType))
		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = procPtr

		(*Proc)(unsafe.Pointer(procPtr)).FrefCount++
	}

	return objPtr
}

//----------------------------------------------------------------------
//
// ProcBodyDup --
//
//	Tcl_ObjType's Dup function for the proc body object. Bumps the
//	reference count on the Proc stored in the internal representation.
//
// Results:
//	None.
//
// Side effects:
//	Sets up the object in dupPtr to be a duplicate of the one in srcPtr.
//
//----------------------------------------------------------------------

func sProcBodyDup(tls *libc.TLS, srcPtr uintptr, dupPtr uintptr) { /* tclProc.c:2326:1: */
	var procPtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))

	(*Tcl_Obj)(unsafe.Pointer(dupPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclProcBodyType))
	*(*uintptr)(unsafe.Pointer(dupPtr + 32)) = procPtr
	(*Proc)(unsafe.Pointer(procPtr)).FrefCount++
}

//----------------------------------------------------------------------
//
// ProcBodyFree --
//
//	Tcl_ObjType's Free function for the proc body object. The reference
//	count on its Proc struct is decreased by 1; if the count reaches 0,
//	the proc is freed.
//
// Results:
//	None.
//
// Side effects:
//	If the reference count on the Proc struct reaches 0, the struct is
//	freed.
//
//----------------------------------------------------------------------

func sProcBodyFree(tls *libc.TLS, objPtr uintptr) { /* tclProc.c:2357:1: */
	var procPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if libc.PostDecInt32(&(*Proc)(unsafe.Pointer(procPtr)).FrefCount, 1) <= 1 {
		XTclProcCleanupProc(tls, procPtr)
	}
}

//----------------------------------------------------------------------
//
// DupLambdaInternalRep, FreeLambdaInternalRep, SetLambdaFromAny --
//
//	How to manage the internal representations of lambda term objects.
//	Syntactically they look like a two- or three-element list, where the
//	first element is the formal arguments, the second is the the body, and
//	the (optional) third is the namespace to execute the lambda term
//	within (the global namespace is assumed if it is absent).
//
//----------------------------------------------------------------------

func sDupLambdaInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclProc.c:2382:1: */
	var procPtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))
	var nsObjPtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32 + 8 /* &.ptr2 */))

	*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = procPtr
	*(*uintptr)(unsafe.Pointer(copyPtr + 32 + 8 /* &.ptr2 */)) = nsObjPtr

	(*Proc)(unsafe.Pointer(procPtr)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).FrefCount++
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclLambdaType))
}

func sFreeLambdaInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclProc.c:2398:1: */
	var procPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	var nsObjPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */))

	if libc.PostDecInt32(&(*Proc)(unsafe.Pointer(procPtr)).FrefCount, 1) == 1 {
		XTclProcCleanupProc(tls, procPtr)
	}
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, nsObjPtr)
				} else {
					*(*uintptr)(unsafe.Pointer(nsObjPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = nsObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, nsObjPtr)
		}
	}

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

func sSetLambdaFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclProc.c:2413:1: */
	bp := tls.Alloc(84)
	defer tls.Free(84)

	var iPtr uintptr = interp
	var name uintptr
	var argsPtr uintptr
	var bodyPtr uintptr
	var nsObjPtr uintptr
	// var objv uintptr at bp+48, 8

	// var isNew int32 at bp+80, 4

	// var objc int32 at bp+56, 4

	var result int32
	var cfPtr uintptr = uintptr(0)
	// var procPtr uintptr at bp+64, 8

	if interp == uintptr(0) {
		return TCL_ERROR
	}

	// Convert objPtr to list type first; if it cannot be converted, or if its
	// length is not 2, then it cannot be converted to tclLambdaType.

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 48)) = *(*uintptr)(unsafe.Pointer(objPtr + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 56)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, uintptr(0), objPtr, bp+56, bp+48)
	}()
	if result != TCL_OK || *(*int32)(unsafe.Pointer(bp + 56)) != 2 && *(*int32)(unsafe.Pointer(bp + 56)) != 3 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+62801,
			libc.VaList(bp, XTcl_GetString(tls, objPtr))))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+6915, ts+62845, uintptr(0)))
		return TCL_ERROR
	}

	argsPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* objv */))))
	bodyPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* objv */)) + 1*8))

	// Create and initialize the Proc struct. The cmdPtr field is set to NULL
	// to signal that this is an anonymous function.

	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()

	if XTclCreateProc(tls, interp, uintptr(0), name, argsPtr, bodyPtr,
		bp+64) != TCL_OK {
		XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
			ts+62852, libc.VaList(bp+40, name)))
		return TCL_ERROR
	}

	// CAREFUL: TclCreateProc returns refCount==1! [Bug 1578454]
	// procPtr->refCount = 1;

	(*Proc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64 /* procPtr */)))).FcmdPtr = uintptr(0)

	// TIP #280: Remember the line the apply body is starting on. In a Byte
	// code context we ask the engine to provide us with the necessary
	// information. This is for the initialization of the byte code compiler
	// when the body is used for the first time.
	//
	// NOTE: The body is the second word in the 'objPtr'. Its location,
	// accessible through 'context.line[1]' (see below) is therefore only the
	// first approximation of the actual line the body is on. We have to use
	// the string rep of the 'objPtr' to determine the exact line. This is
	// available already through 'name'. Use 'TclListLines', see 'switch'
	// (tclCmdMZ.c).
	//
	// This code is nearly identical to the #280 code in Tcl_ProcObjCmd, see
	// this file. The differences are the different index of the body in the
	// line array of the context, and the special processing mentioned in the
	// previous paragraph to track into the list. Find a way to factor the
	// common elements into a single function.

	if (*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr != 0 {
		var contextPtr uintptr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(CmdFrame{})))

		*(*CmdFrame)(unsafe.Pointer(contextPtr)) = *(*CmdFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FcmdFramePtr))
		if (*CmdFrame)(unsafe.Pointer(contextPtr)).Ftype == 2 {
			// Retrieve the source context from the bytecode. This call
			// accounts for the reference to the source file, if any, held in
			// 'context.data.eval.path'.

			XTclGetSrcInfoForPc(tls, contextPtr)
		} else if (*CmdFrame)(unsafe.Pointer(contextPtr)).Ftype == 4 {
			// We created a new reference to the source file path name when we
			// created 'context' above. Account for the reference.

			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(contextPtr + 40)))).FrefCount++

		}

		if (*CmdFrame)(unsafe.Pointer(contextPtr)).Ftype == 4 {
			// We can record source location within a lambda only if the body
			// was not created by substitution.

			if (*CmdFrame)(unsafe.Pointer(contextPtr)).Fline != 0 &&
				(*CmdFrame)(unsafe.Pointer(contextPtr)).Fnline >= 2 && *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(contextPtr)).Fline + 1*4)) >= 0 {
				// var buf [2]int32 at bp+72, 8

				// Move from approximation (line of list cmd word) to actual
				// location (line of 2nd list element).

				cfPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CmdFrame{})))
				XTclListLines(tls, objPtr, *(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(contextPtr)).Fline + 1*4)), 2, bp+72, uintptr(0))

				(*CmdFrame)(unsafe.Pointer(cfPtr)).Flevel = -1
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Ftype = (*CmdFrame)(unsafe.Pointer(contextPtr)).Ftype
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Fline = XTcl_Alloc(tls, uint32(unsafe.Sizeof(int32(0))))
				*(*int32)(unsafe.Pointer((*CmdFrame)(unsafe.Pointer(cfPtr)).Fline)) = *(*int32)(unsafe.Pointer(bp + 72 + 1*4))
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Fnline = 1
				(*CmdFrame)(unsafe.Pointer(cfPtr)).FframePtr = uintptr(0)
				(*CmdFrame)(unsafe.Pointer(cfPtr)).FnextPtr = uintptr(0)

				*(*uintptr)(unsafe.Pointer(cfPtr + 40)) = *(*uintptr)(unsafe.Pointer(contextPtr + 40))
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cfPtr + 40)))).FrefCount++

				(*CmdFrame)(unsafe.Pointer(cfPtr)).Fcmd = uintptr(0)
				(*CmdFrame)(unsafe.Pointer(cfPtr)).Flen = 0
			}

			// 'contextPtr' is going out of scope. Release the reference that
			// it's holding to the source file path

			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(contextPtr + 40))
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		XTclStackFree(tls, interp, contextPtr)
	}
	(*Tcl_HashEntry)(unsafe.Pointer((*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)).FcreateProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FlinePBodyPtr, *(*uintptr)(unsafe.Pointer(bp + 64)), bp+80))).FclientData = cfPtr

	// Set the namespace for this lambda: given by objv[2] understood as a
	// global reference, or else global per default.

	if *(*int32)(unsafe.Pointer(bp + 56)) == 2 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					nsObjPtr = XTclThreadAllocObj(tls)
				} else {
					nsObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(nsObjPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Fbytes, ts+6847, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Fbytes + 2)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).FtypePtr = uintptr(0)
			{
			}
		}
	} else {
		var nsName uintptr = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + 2*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + 2*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + 2*8)))
		}()

		if int32(*(*int8)(unsafe.Pointer(nsName))) != ':' || int32(*(*int8)(unsafe.Pointer(nsName + uintptr(1)))) != ':' {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				for ok4 := true; ok4; ok4 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						nsObjPtr = XTclThreadAllocObj(tls)
					} else {
						nsObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(nsObjPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).FrefCount = 0
				if int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0 {
					(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Flength = 0
				} else {
					(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
					libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Fbytes, ts+6847, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
					*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Fbytes + 2)) = int8(0)
					(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
				}
				(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).FtypePtr = uintptr(0)
				{
				}
			}
			XTcl_AppendObjToObj(tls, nsObjPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* objv */)) + 2*8)))
		} else {
			nsObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* objv */)) + 2*8))
		}
	}

	(*Tcl_Obj)(unsafe.Pointer(nsObjPtr)).FrefCount++

	// Free the list internalrep of objPtr - this will free argsPtr, but
	// bodyPtr retains a reference from the Proc structure. Then finish the
	// conversion to tclLambdaType.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	}

	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = *(*uintptr)(unsafe.Pointer(bp + 64 /* procPtr */))
	*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = nsObjPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclLambdaType))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ApplyObjCmd --
//
//	This object-based function is invoked to process the "apply" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	Depends on the content of the lambda term (i.e., objv[1]).
//
//----------------------------------------------------------------------

func XTcl_ApplyObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclProc.c:2605:1: */
	return XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{XTclNRApplyObjCmd})), dummy, objc, objv)
}

func XTclNRApplyObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclProc.c:2615:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var iPtr uintptr = interp
	var procPtr uintptr = uintptr(0)
	var lambdaPtr uintptr
	var nsObjPtr uintptr
	var result int32
	// var nsPtr uintptr at bp, 8

	var extraPtr uintptr

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+62890)
		return TCL_ERROR
	}

	// Set lambdaPtr, convert it to tclLambdaType in the current interp if
	// necessary.

	lambdaPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	if (*Tcl_Obj)(unsafe.Pointer(lambdaPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclLambdaType)) {
		procPtr = *(*uintptr)(unsafe.Pointer(lambdaPtr + 32))
	}

	// Note: this code is NOT FUNCTIONAL due to the NR implementation; DO NOT
	// ENABLE! Leaving here as reminder to (a) TIP the suggestion, and (b) adapt
	// the code. (MS)

	if procPtr == uintptr(0) || (*Proc)(unsafe.Pointer(procPtr)).FiPtr != iPtr {
		result = sSetLambdaFromAny(tls, interp, lambdaPtr)
		if result != TCL_OK {
			return result
		}
		procPtr = *(*uintptr)(unsafe.Pointer(lambdaPtr + 32))
	}

	// Find the namespace where this lambda should run, and push a call frame
	// for that namespace. Note that TclObjInterpProc() will pop it.

	nsObjPtr = *(*uintptr)(unsafe.Pointer(lambdaPtr + 32 + 8 /* &.ptr2 */))
	result = XTclGetNamespaceFromObj(tls, interp, nsObjPtr, bp)
	if result != TCL_OK {
		return TCL_ERROR
	}

	extraPtr = XTclStackAlloc(tls, interp, int32(unsafe.Sizeof(ApplyExtraData{})))
	libc.Xmemset(tls, extraPtr, 0, uint64(unsafe.Sizeof(Command{})))
	(*Proc)(unsafe.Pointer(procPtr)).FcmdPtr = extraPtr
	(*ApplyExtraData)(unsafe.Pointer(extraPtr)).Fcmd.FnsPtr = *(*uintptr)(unsafe.Pointer(bp /* nsPtr */))

	// TIP#280 (semi-)HACK!
	//
	// Using cmd.clientData to tell [info frame] how to render the lambdaPtr.
	// The InfoFrameCmd will detect this case by testing cmd.hPtr for NULL.
	// This condition holds here because of the memset() above, and nowhere
	// else (in the core). Regular commands always have a valid hPtr, and
	// lambda's never.

	(*ApplyExtraData)(unsafe.Pointer(extraPtr)).Fefi.Flength = 1
	(*ExtraFrameInfoField)(unsafe.Pointer(extraPtr + 112 + 8)).Fname = ts + 25910 /* "lambda" */
	(*ExtraFrameInfoField)(unsafe.Pointer(extraPtr + 112 + 8)).Fproc = uintptr(0)
	(*ExtraFrameInfoField)(unsafe.Pointer(extraPtr + 112 + 8)).FclientData = lambdaPtr
	(*ApplyExtraData)(unsafe.Pointer(extraPtr)).Fcmd.FclientData = extraPtr + 112

	result = XTclPushProcCallFrame(tls, procPtr, interp, objc, objv, 1)
	if result == TCL_OK {
		for ok := true; ok; ok = 0 != 0 {
			var _callbackPtr uintptr
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr
				{
				}
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if interp == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(interp)).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						_objPtr = XTclThreadAllocObj(tls)
					} else {
						_objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(_objPtr + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				_callbackPtr = _objPtr
			}
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FprocPtr = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, uintptr, int32) int32
			}{sApplyNR2}))
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8)) = extraPtr
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 1*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 2*8)) = uintptr(0)
			*(*ClientData)(unsafe.Pointer(_callbackPtr + 8 + 3*8)) = uintptr(0)
			(*NRE_callback)(unsafe.Pointer(_callbackPtr)).FnextPtr = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr
			(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = _callbackPtr
		}
		result = XTclNRInterpProcCore(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), 2, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr)
		}{sMakeLambdaError})))
	}
	return result
}

func sApplyNR2(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclProc.c:2716:1: */
	var extraPtr uintptr = *(*ClientData)(unsafe.Pointer(data))

	XTclStackFree(tls, interp, extraPtr)
	return result
}

//----------------------------------------------------------------------
//
// MakeLambdaError --
//
//	Function called by TclObjInterpProc to create the stack information
//	upon an error from a lambda term.
//
// Results:
//	The interpreter's error info trace is set to a value that supplements
//	the error code.
//
// Side effects:
//	none.
//
//----------------------------------------------------------------------

func sMakeLambdaError(tls *libc.TLS, interp uintptr, procNameObj uintptr) { /* tclProc.c:2746:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var overflow int32
	var limit int32 = 60
	// var nameLen int32 at bp+32, 4

	var procName uintptr = XTcl_GetStringFromObj(tls, procNameObj, bp+32)

	overflow = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 32)) > limit)
	XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls,
		ts+62911,
		libc.VaList(bp, func() int32 {
			if overflow != 0 {
				return limit
			}
			return *(*int32)(unsafe.Pointer(bp + 32))
		}(), procName,
			func() uintptr {
				if overflow != 0 {
					return ts + 7891 /* "..." */
				}
				return ts + 2046 /* "" */
			}(), XTcl_GetErrorLine(tls, interp))))
}

//----------------------------------------------------------------------
//
// TclGetCmdFrameForProcedure --
//
//	How to get the CmdFrame information for a procedure.
//
// Results:
//	A pointer to the CmdFrame (only guaranteed to be valid until the next
//	Tcl command is processed or the interpreter's state is otherwise
//	modified) or a NULL if the information is not available.
//
// Side effects:
//	none.
//
//----------------------------------------------------------------------

func XTclGetCmdFrameForProcedure(tls *libc.TLS, procPtr uintptr) uintptr { /* tclProc.c:2780:10: */
	var hePtr uintptr

	if procPtr == uintptr(0) || (*Proc)(unsafe.Pointer(procPtr)).FiPtr == uintptr(0) {
		return uintptr(0)
	}
	hePtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer((*Interp1)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FiPtr)).FlinePBodyPtr)).FfindProc})).f(tls, (*Interp1)(unsafe.Pointer((*Proc)(unsafe.Pointer(procPtr)).FiPtr)).FlinePBodyPtr, procPtr)
	if hePtr == uintptr(0) {
		return uintptr(0)
	}
	return (*Tcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------------
// The routines in this file use Henry Spencer's regular expression package
// contained in the following additional source files:
//
//	regc_color.c	regc_cvec.c	regc_lex.c
//	regc_nfa.c	regcomp.c	regcustom.h
//	rege_dfa.c	regerror.c	regerrs.h
//	regex.h		regexec.c	regfree.c
//	regfronts.c	regguts.h
//
// Copyright (c) 1998 Henry Spencer.  All rights reserved.
//
// Development of this software was funded, in part, by Cray Research Inc.,
// UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
// Corporation, none of whom are responsible for the results. The author
// thanks all of them.
//
// Redistribution and use in source and binary forms -- with or without
// modification -- are permitted for any purpose, provided that
// redistributions in source form retain this entire copyright notice and
// indicate the origin and nature of any modifications.
//
// I'd appreciate being given credit for this package in the documentation of
// software which uses it, but that is not a requirement.
//
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// *** NOTE: this code has been altered slightly for use in Tcl: ***
// *** 1. Names have been changed, e.g. from re_comp to		 ***
// ***    TclRegComp, to avoid clashes with other		 ***
// ***    regexp implementations used by applications.		 ***

// Thread local storage used to maintain a per-thread cache of compiled
// regular expressions.

type ThreadSpecificData11 = struct {
	Finitialized int32
	F__ccgo_pad1 [4]byte
	Fpatterns    [30]uintptr
	FpatLengths  [30]int32
	Fregexps     [30]uintptr
} /* tclRegexp.c:78:3 */

var dataKey10 Tcl_ThreadDataKey /* tclRegexp.c:80:26: */

// The regular expression Tcl object type. This serves as a cache of the
// compiled form of the regular expression.

var XtclRegexpType = Tcl_ObjType{
	Fname:           ts + 3046,
	FfreeIntRepProc: 0, // freeIntRepProc
	FdupIntRepProc:  0, // updateStringProc
	FsetFromAnyProc: 0, // setFromAnyProc
} /* tclRegexp.c:103:19 */

//----------------------------------------------------------------------
//
// Tcl_RegExpCompile --
//
//	Compile a regular expression into a form suitable for fast matching.
//	This function is DEPRECATED in favor of the object version of the
//	command.
//
// Results:
//	The return value is a pointer to the compiled form of string, suitable
//	for passing to Tcl_RegExpExec. This compiled form is only valid up
//	until the next call to this function, so don't keep these around for a
//	long time! If an error occurred while compiling the pattern, then NULL
//	is returned and an error message is left in the interp's result.
//
// Side effects:
//	Updates the cache of compiled regexps.
//
//----------------------------------------------------------------------

func XTcl_RegExpCompile(tls *libc.TLS, interp uintptr, pattern uintptr) Tcl_RegExp { /* tclRegexp.c:134:1: */
	return sCompileRegexp(tls, interp, pattern, int32(libc.Xstrlen(tls, pattern)),
		REG_ADVANCED)
}

//----------------------------------------------------------------------
//
// Tcl_RegExpExec --
//
//	Execute the regular expression matcher using a compiled form of a
//	regular expression and save information about any match that is found.
//
// Results:
//	If an error occurs during the matching operation then -1 is returned
//	and the interp's result contains an error message. Otherwise the
//	return value is 1 if a matching range is found and 0 if there is no
//	matching range.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_RegExpExec(tls *libc.TLS, interp uintptr, re Tcl_RegExp, text uintptr, start uintptr) int32 { /* tclRegexp.c:165:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var flags int32
	var result int32
	var numChars int32
	var regexp uintptr = re
	// var ds Tcl_DString at bp, 216

	var ustr uintptr

	// If the starting point is offset from the beginning of the buffer, then
	// we need to tell the regexp engine not to match "^".

	if text > start {
		flags = REG_NOTBOL
	} else {
		flags = 0
	}

	// Remember the string for use by Tcl_RegExpRange().

	(*TclRegexp)(unsafe.Pointer(regexp)).Fstring = text
	(*TclRegexp)(unsafe.Pointer(regexp)).FobjPtr = uintptr(0)

	// Convert the string to Unicode and perform the match.

	XTcl_DStringInit(tls, bp)
	ustr = XTcl_UtfToUniCharDString(tls, text, -1, bp)
	numChars = int32(uint64((*Tcl_DString)(unsafe.Pointer(bp)).Flength) / uint64(unsafe.Sizeof(Tcl_UniChar(0))))
	result = sRegExpExecUniChar(tls, interp, re, ustr, numChars, -1,
		flags)
	XTcl_DStringFree(tls, bp)

	return result
}

//---------------------------------------------------------------------------
//
// Tcl_RegExpRange --
//
//	Returns pointers describing the range of a regular expression match,
//	or one of the subranges within the match.
//
// Results:
//	The variables at *startPtr and *endPtr are modified to hold the
//	addresses of the endpoints of the range given by index. If the
//	specified range doesn't exist then NULLs are returned.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_RegExpRange(tls *libc.TLS, re Tcl_RegExp, index int32, startPtr uintptr, endPtr uintptr) { /* tclRegexp.c:232:1: */
	var regexpPtr uintptr = re
	var string uintptr

	if Size_t(index) > (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fre.Fre_nsub {
		*(*uintptr)(unsafe.Pointer(startPtr)) = libc.AssignPtrUintptr(endPtr, uintptr(0))
	} else if (*Regmatch_t)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).Fmatches+uintptr(index)*16)).Frm_so == int64(-1) {
		*(*uintptr)(unsafe.Pointer(startPtr)) = libc.AssignPtrUintptr(endPtr, uintptr(0))
	} else {
		if (*TclRegexp)(unsafe.Pointer(regexpPtr)).FobjPtr != 0 {
			string = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).FobjPtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).FobjPtr)).Fbytes
				}
				return XTcl_GetString(tls, (*TclRegexp)(unsafe.Pointer(regexpPtr)).FobjPtr)
			}()
		} else {
			string = (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fstring
		}
		*(*uintptr)(unsafe.Pointer(startPtr)) = XTcl_UtfAtIndex(tls, string, int32((*Regmatch_t)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).Fmatches+uintptr(index)*16)).Frm_so))
		*(*uintptr)(unsafe.Pointer(endPtr)) = XTcl_UtfAtIndex(tls, string, int32((*Regmatch_t)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).Fmatches+uintptr(index)*16)).Frm_eo))
	}
}

//---------------------------------------------------------------------------
//
// RegExpExecUniChar --
//
//	Execute the regular expression matcher using a compiled form of a
//	regular expression and save information about any match that is found.
//
// Results:
//	If an error occurs during the matching operation then -1 is returned
//	and an error message is left in interp's result. Otherwise the return
//	value is 1 if a matching range was found or 0 if there was no matching
//	range.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sRegExpExecUniChar(tls *libc.TLS, interp uintptr, re Tcl_RegExp, wString uintptr, numChars int32, nmatches int32, flags int32) int32 { /* tclRegexp.c:282:1: */
	var status int32
	var regexpPtr uintptr = re
	var last Size_t = (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fre.Fre_nsub + uint64(1)
	var nm Size_t = last

	if nmatches >= 0 && Size_t(nmatches) < nm {
		nm = Size_t(nmatches)
	}

	status = XTclReExec(tls, regexpPtr+8, wString, Size_t(numChars),
		regexpPtr+96, nm, (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fmatches, flags)

	// Check for errors.

	if status != REG_OKAY {
		if status == REG_NOMATCH {
			return 0
		}
		if interp != uintptr(0) {
			XTclRegError(tls, interp, ts+62947,
				status)
		}
		return -1
	}
	return 1
}

//---------------------------------------------------------------------------
//
// TclRegExpRangeUniChar --
//
//	Returns pointers describing the range of a regular expression match,
//	or one of the subranges within the match, or the hypothetical range
//	represented by the rm_extend field of the rm_detail_t.
//
// Results:
//	The variables at *startPtr and *endPtr are modified to hold the
//	offsets of the endpoints of the range given by index. If the specified
//	range doesn't exist then -1s are supplied.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclRegExpRangeUniChar(tls *libc.TLS, re Tcl_RegExp, index int32, startPtr uintptr, endPtr uintptr) { /* tclRegexp.c:344:1: */
	var regexpPtr uintptr = re

	if (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fflags&REG_EXPECT != 0 && index == -1 {
		*(*int32)(unsafe.Pointer(startPtr)) = int32((*TclRegexp)(unsafe.Pointer(regexpPtr)).Fdetails.Frm_extend.Frm_so)
		*(*int32)(unsafe.Pointer(endPtr)) = int32((*TclRegexp)(unsafe.Pointer(regexpPtr)).Fdetails.Frm_extend.Frm_eo)
	} else if Size_t(index) > (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fre.Fre_nsub {
		*(*int32)(unsafe.Pointer(startPtr)) = -1
		*(*int32)(unsafe.Pointer(endPtr)) = -1
	} else {
		*(*int32)(unsafe.Pointer(startPtr)) = int32((*Regmatch_t)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).Fmatches + uintptr(index)*16)).Frm_so)
		*(*int32)(unsafe.Pointer(endPtr)) = int32((*Regmatch_t)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).Fmatches + uintptr(index)*16)).Frm_eo)
	}
}

//----------------------------------------------------------------------
//
// Tcl_RegExpMatch --
//
//	See if a string matches a regular expression.
//
// Results:
//	If an error occurs during the matching operation then -1 is returned
//	and the interp's result contains an error message. Otherwise the
//	return value is 1 if "text" matches "pattern" and 0 otherwise.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_RegExpMatch(tls *libc.TLS, interp uintptr, text uintptr, pattern uintptr) int32 { /* tclRegexp.c:389:1: */
	var re Tcl_RegExp = XTcl_RegExpCompile(tls, interp, pattern)

	if re == uintptr(0) {
		return -1
	}
	return XTcl_RegExpExec(tls, interp, re, text, text)
}

//----------------------------------------------------------------------
//
// Tcl_RegExpExecObj --
//
//	Execute a precompiled regexp against the given object.
//
// Results:
//	If an error occurs during the matching operation then -1 is returned
//	and the interp's result contains an error message. Otherwise the
//	return value is 1 if "string" matches "pattern" and 0 otherwise.
//
// Side effects:
//	Converts the object to a Unicode object.
//
//----------------------------------------------------------------------

func XTcl_RegExpExecObj(tls *libc.TLS, interp uintptr, re Tcl_RegExp, textObj uintptr, offset int32, nmatches int32, flags int32) int32 { /* tclRegexp.c:421:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var regexpPtr uintptr = re
	var udata uintptr
	// var length int32 at bp, 4

	var reflags int32 = (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fflags

	// Take advantage of the equivalent glob pattern, if one exists.
	// This is possible based only on the right mix of incoming flags (0)
	// and regexp compile flags.
	if offset == 0 && nmatches == 0 && flags == 0 &&
		!(reflags&libc.CplInt32(TCL_REG_ADVANCED|TCL_REG_NOSUB|TCL_REG_NOCASE) != 0) &&
		(*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr != uintptr(0) {
		var nocase int32
		if reflags&TCL_REG_NOCASE != 0 {
			nocase = int32(1) << 0
		} else {
			nocase = 0
		}

		// Pass to TclStringMatchObj for obj-specific handling.
		// XXX: Currently doesn't take advantage of exact-ness that
		// XXX: TclReToGlob tells us about

		return XTclStringMatchObj(tls, textObj, (*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr, nocase)
	}

	// Save the target object so we can extract strings from it later.

	(*TclRegexp)(unsafe.Pointer(regexpPtr)).Fstring = uintptr(0)
	(*TclRegexp)(unsafe.Pointer(regexpPtr)).FobjPtr = textObj

	udata = XTcl_GetUnicodeFromObj(tls, textObj, bp)

	if offset > *(*int32)(unsafe.Pointer(bp)) {
		offset = *(*int32)(unsafe.Pointer(bp /* length */))
	}
	udata += 2 * uintptr(offset)
	*(*int32)(unsafe.Pointer(bp /* length */)) -= offset

	return sRegExpExecUniChar(tls, interp, re, udata, *(*int32)(unsafe.Pointer(bp /* length */)), nmatches, flags)
}

//----------------------------------------------------------------------
//
// Tcl_RegExpMatchObj --
//
//	See if an object matches a regular expression.
//
// Results:
//	If an error occurs during the matching operation then -1 is returned
//	and the interp's result contains an error message. Otherwise the
//	return value is 1 if "text" matches "pattern" and 0 otherwise.
//
// Side effects:
//	Changes the internal rep of the pattern and string objects.
//
//----------------------------------------------------------------------

func XTcl_RegExpMatchObj(tls *libc.TLS, interp uintptr, textObj uintptr, patternObj uintptr) int32 { /* tclRegexp.c:497:1: */
	var re Tcl_RegExp

	// For performance reasons, first try compiling the RE without support for
	// subexpressions. On failure, try again without TCL_REG_NOSUB in case the
	// RE has backreferences in it. Closely related to [Bug 1366683]. If this
	// still fails, an error message will be left in the interpreter.

	if !(int32(libc.AssignUintptr(&re, XTcl_GetRegExpFromObj(tls, interp, patternObj,
		TCL_REG_ADVANCED|TCL_REG_NOSUB))) != 0) &&
		!(int32(libc.AssignUintptr(&re, XTcl_GetRegExpFromObj(tls, interp, patternObj, TCL_REG_ADVANCED))) != 0) {
		return -1
	}
	return XTcl_RegExpExecObj(tls, interp, re, textObj, 0,
		0, 0)
}

//----------------------------------------------------------------------
//
// Tcl_RegExpGetInfo --
//
//	Retrieve information about the current match.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_RegExpGetInfo(tls *libc.TLS, regexp Tcl_RegExp, infoPtr uintptr) { /* tclRegexp.c:538:1: */
	var regexpPtr uintptr = regexp

	(*Tcl_RegExpInfo)(unsafe.Pointer(infoPtr)).Fnsubs = int32((*TclRegexp)(unsafe.Pointer(regexpPtr)).Fre.Fre_nsub)
	(*Tcl_RegExpInfo)(unsafe.Pointer(infoPtr)).Fmatches = (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fmatches
	(*Tcl_RegExpInfo)(unsafe.Pointer(infoPtr)).FextendStart = (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fdetails.Frm_extend.Frm_so
}

//----------------------------------------------------------------------
//
// Tcl_GetRegExpFromObj --
//
//	Compile a regular expression into a form suitable for fast matching.
//	This function caches the result in a Tcl_Obj.
//
// Results:
//	The return value is a pointer to the compiled form of string, suitable
//	for passing to Tcl_RegExpExec. If an error occurred while compiling
//	the pattern, then NULL is returned and an error message is left in the
//	interp's result.
//
// Side effects:
//	Updates the native rep of the Tcl_Obj.
//
//----------------------------------------------------------------------

func XTcl_GetRegExpFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32) Tcl_RegExp { /* tclRegexp.c:570:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var length int32 at bp, 4

	var regexpPtr uintptr
	var pattern uintptr

	// This is OK because we only actually interpret this value properly as a
	// TclRegexp* when the type is tclRegexpType.

	regexpPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclRegexpType)) || (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fflags != flags {
		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, objPtr, bp)
		}()

		regexpPtr = sCompileRegexp(tls, interp, pattern, *(*int32)(unsafe.Pointer(bp /* length */)), flags)
		if regexpPtr == uintptr(0) {
			return uintptr(0)
		}

		// Add a reference to the regexp so it will persist even if it is
		// pushed out of the current thread's regexp cache. This reference
		// will be removed when the object's internal rep is freed.

		(*TclRegexp)(unsafe.Pointer(regexpPtr)).FrefCount++

		// Free the old representation and set our type.

		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		}

		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = regexpPtr
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclRegexpType))
	}
	return regexpPtr
}

//----------------------------------------------------------------------
//
// TclRegAbout --
//
//	Return information about a compiled regular expression.
//
// Results:
//	The return value is -1 for failure, 0 for success, although at the
//	moment there's nothing that could fail. On success, a list is left in
//	the interp's result: first element is the subexpression count, second
//	is a list of re_info bit names.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclRegAbout(tls *libc.TLS, interp uintptr, re Tcl_RegExp) int32 { /* tclRegexp.c:637:1: */
	var regexpPtr uintptr = re
	var inf uintptr
	var infoObj uintptr
	var resultObj uintptr

	// The reset here guarantees that the interpreter result is empty and
	// unshared. This means that we can use Tcl_ListObjAppendElement on the
	// result object quite safely.

	XTcl_ResetResult(tls, interp)

	// Assume that there will never be more than INT_MAX subexpressions. This
	// is a pretty reasonable assumption; the RE engine doesn't scale _that_
	// well and Tcl has other limits that constrain things as well...

	resultObj = XTcl_NewObj(tls)
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj,
		XTcl_NewIntObj(tls, int32((*TclRegexp)(unsafe.Pointer(regexpPtr)).Fre.Fre_nsub)))

	// Now append a list of all the bit-flags set for the RE.

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			infoObj = XTclThreadAllocObj(tls)
		} else {
			infoObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(infoObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(infoObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(infoObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(infoObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(infoObj)).FtypePtr = uintptr(0)
	{
	}

	for inf = uintptr(unsafe.Pointer(&infonames)); (*Infoname)(unsafe.Pointer(inf)).Fbit != 0; inf += 16 {
		if (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fre.Fre_info&int64((*Infoname)(unsafe.Pointer(inf)).Fbit) != 0 {
			XTcl_ListObjAppendElement(tls, uintptr(0), infoObj,
				XTcl_NewStringObj(tls, (*Infoname)(unsafe.Pointer(inf)).Ftext, -1))
		}
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, infoObj)
	XTcl_SetObjResult(tls, interp, resultObj)

	return 0
}

type Infoname = struct {
	Fbit         int32
	F__ccgo_pad1 [4]byte
	Ftext        uintptr
} /* tclRegexp.c:642:5 */

var infonames = [15]Infoname{
	{Fbit: REG_UBACKREF, Ftext: ts + 62989},
	{Fbit: REG_ULOOKAHEAD, Ftext: ts + 63002},
	{Fbit: REG_UBOUNDS, Ftext: ts + 63017},
	{Fbit: REG_UBRACES, Ftext: ts + 63029},
	{Fbit: REG_UBSALNUM, Ftext: ts + 63041},
	{Fbit: REG_UPBOTCH, Ftext: ts + 63054},
	{Fbit: REG_UBBS, Ftext: ts + 63066},
	{Fbit: REG_UNONPOSIX, Ftext: ts + 63075},
	{Fbit: REG_UUNSPEC, Ftext: ts + 63089},
	{Fbit: REG_UUNPORT, Ftext: ts + 63101},
	{Fbit: REG_ULOCALE, Ftext: ts + 63113},
	{Fbit: REG_UEMPTYMATCH, Ftext: ts + 63125},
	{Fbit: REG_UIMPOSSIBLE, Ftext: ts + 63141},
	{Fbit: REG_USHORTEST, Ftext: ts + 63157},
	{},
} /* tclRegexp.c:646:34 */

//----------------------------------------------------------------------
//
// TclRegError --
//
//	Generate an error message based on the regexp status code.
//
// Results:
//	Places an error in the interpreter.
//
// Side effects:
//	Sets errorCode as well.
//
//----------------------------------------------------------------------

func XTclRegError(tls *libc.TLS, interp uintptr, msg uintptr, status int32) { /* tclRegexp.c:718:1: */
	bp := tls.Alloc(188)
	defer tls.Free(188)

	// var buf [100]int8 at bp+64, 100
	// ample in practice
	// var cbuf [24]int8 at bp+164, 24

	var n Size_t
	var p uintptr

	XTcl_ResetResult(tls, interp)
	n = XTclReError(tls, status, bp+64, uint64(unsafe.Sizeof([100]int8{})))
	if n > Size_t(unsafe.Sizeof([100]int8{})) {
		p = ts + 7891 /* "..." */
	} else {
		p = ts + 2046 /* "" */
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+63171, libc.VaList(bp, msg, bp+64, p)))

	libc.Xsprintf(tls, bp+164, ts+324, libc.VaList(bp+24, status))
	XTclReError(tls, REG_ITOA, bp+164, uint64(unsafe.Sizeof([24]int8{})))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+15761, bp+164, bp+64, uintptr(0)))
}

//----------------------------------------------------------------------
//
// FreeRegexpInternalRep --
//
//	Deallocate the storage associated with a regexp object's internal
//	representation.
//
// Results:
//	None.
//
// Side effects:
//	Frees the compiled regular expression.
//
//----------------------------------------------------------------------

func sFreeRegexpInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclRegexp.c:756:1: */
	var regexpRepPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	// If this is the last reference to the regexp, free it.

	if libc.PostDecInt32(&(*TclRegexp)(unsafe.Pointer(regexpRepPtr)).FrefCount, 1) <= 1 {
		sFreeRegexp(tls, regexpRepPtr)
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

//----------------------------------------------------------------------
//
// DupRegexpInternalRep --
//
//	We copy the reference to the compiled regexp and bump its reference
//	count.
//
// Results:
//	None.
//
// Side effects:
//	Increments the reference count of the regexp.
//
//----------------------------------------------------------------------

func sDupRegexpInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclRegexp.c:789:1: */
	var regexpPtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))

	(*TclRegexp)(unsafe.Pointer(regexpPtr)).FrefCount++
	*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = *(*uintptr)(unsafe.Pointer(srcPtr + 32))
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclRegexpType))
}

//----------------------------------------------------------------------
//
// SetRegexpFromAny --
//
//	Attempt to generate a compiled regular expression for the Tcl object
//	"objPtr".
//
// Results:
//	The return value is TCL_OK or TCL_ERROR. If an error occurs during
//	conversion, an error message is left in the interpreter's result
//	unless "interp" is NULL.
//
// Side effects:
//	If no error occurs, a regular expression is stored as "objPtr"s
//	internal representation.
//
//----------------------------------------------------------------------

func sSetRegexpFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclRegexp.c:821:1: */
	if XTcl_GetRegExpFromObj(tls, interp, objPtr, REG_ADVANCED) == uintptr(0) {
		return TCL_ERROR
	}
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// CompileRegexp --
//
//	Attempt to compile the given regexp pattern. If the compiled regular
//	expression can be found in the per-thread cache, it will be used
//	instead of compiling a new copy.
//
// Results:
//	The return value is a pointer to a newly allocated TclRegexp that
//	represents the compiled pattern, or NULL if the pattern could not be
//	compiled. If NULL is returned, an error message is left in the
//	interp's result.
//
// Side effects:
//	The thread-local regexp cache is updated and a new TclRegexp may be
//	allocated.
//
//----------------------------------------------------------------------

func sCompileRegexp(tls *libc.TLS, interp uintptr, string uintptr, length int32, flags int32) uintptr { /* tclRegexp.c:853:18: */
	bp := tls.Alloc(220)
	defer tls.Free(220)

	var regexpPtr uintptr
	var uniString uintptr
	var numChars int32
	var status int32
	var i int32
	// var exact int32 at bp+216, 4

	// var stringBuf Tcl_DString at bp, 216

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey10)), int32(unsafe.Sizeof(ThreadSpecificData11{})))

	if !((*ThreadSpecificData11)(unsafe.Pointer(tsdPtr)).Finitialized != 0) {
		(*ThreadSpecificData11)(unsafe.Pointer(tsdPtr)).Finitialized = 1
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFinalizeRegexp})), uintptr(0))
	}

	// This routine maintains a second-level regular expression cache in
	// addition to the per-object regexp cache. The per-thread cache is needed
	// to handle the case where for various reasons the object is lost between
	// invocations of the regexp command, but the literal pattern is the same.

	// Check the per-thread compiled regexp cache. We can only reuse a regexp
	// if it has the same pattern and the same flags.

	for i = 0; i < NUM_REGEXPS && *(*uintptr)(unsafe.Pointer(tsdPtr + 8 /* &.patterns */ + uintptr(i)*8)) != uintptr(0); i++ {
		if length == *(*int32)(unsafe.Pointer(tsdPtr + 248 + uintptr(i)*4)) &&
			(*TclRegexp1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tsdPtr + 368 + uintptr(i)*8)))).Fflags == flags &&
			libc.Xstrcmp(tls, string, *(*uintptr)(unsafe.Pointer(tsdPtr + 8 + uintptr(i)*8))) == 0 {
			// Move the matched pattern to the first slot in the cache and
			// shift the other patterns down one position.

			if i != 0 {
				var j int32
				var cachedString uintptr

				cachedString = *(*uintptr)(unsafe.Pointer(tsdPtr + 8 + uintptr(i)*8))
				regexpPtr = *(*uintptr)(unsafe.Pointer(tsdPtr + 368 + uintptr(i)*8))
				for j = i - 1; j >= 0; j-- {
					*(*uintptr)(unsafe.Pointer(tsdPtr + 8 + uintptr(j+1)*8)) = *(*uintptr)(unsafe.Pointer(tsdPtr + 8 + uintptr(j)*8))
					*(*int32)(unsafe.Pointer(tsdPtr + 248 + uintptr(j+1)*4)) = *(*int32)(unsafe.Pointer(tsdPtr + 248 + uintptr(j)*4))
					*(*uintptr)(unsafe.Pointer(tsdPtr + 368 + uintptr(j+1)*8)) = *(*uintptr)(unsafe.Pointer(tsdPtr + 368 + uintptr(j)*8))
				}
				*(*uintptr)(unsafe.Pointer(tsdPtr + 8)) = cachedString
				*(*int32)(unsafe.Pointer(tsdPtr + 248)) = length
				*(*uintptr)(unsafe.Pointer(tsdPtr + 368)) = regexpPtr
			}
			return *(*uintptr)(unsafe.Pointer(tsdPtr + 368))
		}
	}

	// This is a new expression, so compile it and add it to the cache.

	regexpPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TclRegexp{})))
	(*TclRegexp)(unsafe.Pointer(regexpPtr)).FobjPtr = uintptr(0)
	(*TclRegexp)(unsafe.Pointer(regexpPtr)).Fstring = uintptr(0)
	(*TclRegexp)(unsafe.Pointer(regexpPtr)).Fdetails.Frm_extend.Frm_so = int64(-1)
	(*TclRegexp)(unsafe.Pointer(regexpPtr)).Fdetails.Frm_extend.Frm_eo = int64(-1)

	// Get the up-to-date string representation and map to unicode.

	XTcl_DStringInit(tls, bp)
	uniString = XTcl_UtfToUniCharDString(tls, string, length, bp)
	numChars = int32(uint64((*Tcl_DString)(unsafe.Pointer(bp)).Flength) / uint64(unsafe.Sizeof(Tcl_UniChar(0))))

	// Compile the string and check for errors.

	(*TclRegexp)(unsafe.Pointer(regexpPtr)).Fflags = flags
	status = XTclReComp(tls, regexpPtr+8, uniString, Size_t(numChars), flags)
	XTcl_DStringFree(tls, bp)

	if status != REG_OKAY {
		// Clean up and report errors in the interpreter, if possible.

		XTclpFree(tls, regexpPtr)
		if interp != 0 {
			XTclRegError(tls, interp,
				ts+63178, status)
		}
		return uintptr(0)
	}

	// Convert RE to a glob pattern equivalent, if any, and cache it.  If this
	// is not possible, then globObjPtr will be NULL.  This is used by
	// Tcl_RegExpExecObj to optionally do a fast match (avoids RE engine).

	if XTclReToGlob(tls, uintptr(0), string, length, bp, bp+216,
		uintptr(0)) == TCL_OK {
		(*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr = XTclDStringToObj(tls, bp)
		(*Tcl_Obj)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr)).FrefCount++
	} else {
		(*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr = uintptr(0)
	}

	// Allocate enough space for all of the subexpressions, plus one extra for
	// the entire pattern.

	(*TclRegexp)(unsafe.Pointer(regexpPtr)).Fmatches = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(Regmatch_t{}))*((*TclRegexp)(unsafe.Pointer(regexpPtr)).Fre.Fre_nsub+uint64(1))))

	// Initialize the refcount to one initially, since it is in the cache.

	(*TclRegexp)(unsafe.Pointer(regexpPtr)).FrefCount = 1

	// Free the last regexp, if necessary, and make room at the head of the
	// list for the new regexp.

	if *(*uintptr)(unsafe.Pointer(tsdPtr + 8 + 29*8)) != uintptr(0) {
		var oldRegexpPtr uintptr = *(*uintptr)(unsafe.Pointer(tsdPtr + 368 + 29*8))

		if libc.PostDecInt32(&(*TclRegexp)(unsafe.Pointer(oldRegexpPtr)).FrefCount, 1) <= 1 {
			sFreeRegexp(tls, oldRegexpPtr)
		}
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(tsdPtr + 8 + 29*8)))
	}
	for i = NUM_REGEXPS - 2; i >= 0; i-- {
		*(*uintptr)(unsafe.Pointer(tsdPtr + 8 + uintptr(i+1)*8)) = *(*uintptr)(unsafe.Pointer(tsdPtr + 8 + uintptr(i)*8))
		*(*int32)(unsafe.Pointer(tsdPtr + 248 + uintptr(i+1)*4)) = *(*int32)(unsafe.Pointer(tsdPtr + 248 + uintptr(i)*4))
		*(*uintptr)(unsafe.Pointer(tsdPtr + 368 + uintptr(i+1)*8)) = *(*uintptr)(unsafe.Pointer(tsdPtr + 368 + uintptr(i)*8))
	}
	*(*uintptr)(unsafe.Pointer(tsdPtr + 8)) = XTcl_Alloc(tls, uint32(length+1))
	libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(tsdPtr + 8)), string, uint64(length+1))
	*(*int32)(unsafe.Pointer(tsdPtr + 248)) = length
	*(*uintptr)(unsafe.Pointer(tsdPtr + 368)) = regexpPtr

	return regexpPtr
}

//----------------------------------------------------------------------
//
// FreeRegexp --
//
//	Release the storage associated with a TclRegexp.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFreeRegexp(tls *libc.TLS, regexpPtr uintptr) { /* tclRegexp.c:1021:1: */
	XTclReFree(tls, regexpPtr+8)
	if (*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr != 0 {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, (*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr)
					} else {
						*(*uintptr)(unsafe.Pointer((*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, (*TclRegexp)(unsafe.Pointer(regexpPtr)).FglobObjPtr)
			}
		}

	}
	if (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fmatches != 0 {
		XTclpFree(tls, (*TclRegexp)(unsafe.Pointer(regexpPtr)).Fmatches)
	}
	XTclpFree(tls, regexpPtr)
}

//----------------------------------------------------------------------
//
// FinalizeRegexp --
//
//	Release the storage associated with the per-thread regexp cache.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFinalizeRegexp(tls *libc.TLS, clientData ClientData) { /* tclRegexp.c:1051:1: */
	var i int32
	var regexpPtr uintptr
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey10)), int32(unsafe.Sizeof(ThreadSpecificData11{})))

	for i = 0; i < NUM_REGEXPS && *(*uintptr)(unsafe.Pointer(tsdPtr + 8 /* &.patterns */ + uintptr(i)*8)) != uintptr(0); i++ {
		regexpPtr = *(*uintptr)(unsafe.Pointer(tsdPtr + 368 + uintptr(i)*8))
		if libc.PostDecInt32(&(*TclRegexp)(unsafe.Pointer(regexpPtr)).FrefCount, 1) <= 1 {
			sFreeRegexp(tls, regexpPtr)
		}
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(tsdPtr + 8 + uintptr(i)*8)))
		*(*uintptr)(unsafe.Pointer(tsdPtr + 8 + uintptr(i)*8)) = uintptr(0)
	}

	// We may find ourselves reinitialized if another finalization routine
	// invokes regexps.

	(*ThreadSpecificData11)(unsafe.Pointer(tsdPtr)).Finitialized = 0
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------------
//
// Tcl_AddInterpResolvers --
//
//	Adds a set of command/variable resolution functions to an interpreter.
//	These functions are consulted when commands are resolved in
//	Tcl_FindCommand, and when variables are resolved in TclLookupVar and
//	LookupCompiledLocal. Each namespace may also have its own set of
//	resolution functions which take precedence over those for the
//	interpreter.
//
//	When a name is resolved, it is handled as follows. First, the name is
//	passed to the resolution functions for the namespace. If not resolved,
//	the name is passed to each of the resolution functions added to the
//	interpreter. Finally, if still not resolved, the name is handled using
//	the default Tcl rules for name resolution.
//
// Results:
//	Returns pointers to the current name resolution functions in the
//	cmdProcPtr, varProcPtr and compiledVarProcPtr arguments.
//
// Side effects:
//	If a compiledVarProc is specified, this function bumps the
//	compileEpoch for the interpreter, forcing all code to be recompiled.
//	If a cmdProc is specified, this function bumps the cmdRefEpoch in all
//	namespaces, forcing commands to be resolved again using the new rules.
//
//----------------------------------------------------------------------

func XTcl_AddInterpResolvers(tls *libc.TLS, interp uintptr, name uintptr, cmdProc uintptr, varProc uintptr, compiledVarProc uintptr) { /* tclResolve.c:55:1: */
	var iPtr uintptr = interp
	var resPtr uintptr
	var len uint32

	// Since we're adding a new name resolution scheme, we must force all code
	// to be recompiled to use the new scheme. If there are new compiled
	// variable resolution rules, bump the compiler epoch to invalidate
	// compiled code. If there are new command resolution rules, bump the
	// cmdRefEpoch in all namespaces.

	if compiledVarProc != 0 {
		(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch++
	}
	if cmdProc != 0 {
		sBumpCmdRefEpochs(tls, (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr)
	}

	// Look for an existing scheme with the given name. If found, then replace
	// its rules.

	for resPtr = (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr; resPtr != uintptr(0); resPtr = (*ResolverScheme)(unsafe.Pointer(resPtr)).FnextPtr {
		if int32(*(*int8)(unsafe.Pointer(name))) == int32(*(*int8)(unsafe.Pointer((*ResolverScheme)(unsafe.Pointer(resPtr)).Fname))) && libc.Xstrcmp(tls, name, (*ResolverScheme)(unsafe.Pointer(resPtr)).Fname) == 0 {
			(*ResolverScheme)(unsafe.Pointer(resPtr)).FcmdResProc = cmdProc
			(*ResolverScheme)(unsafe.Pointer(resPtr)).FvarResProc = varProc
			(*ResolverScheme)(unsafe.Pointer(resPtr)).FcompiledVarResProc = compiledVarProc
			return
		}
	}

	// Otherwise, this is a new scheme. Add it to the FRONT of the linked
	// list, so that it overrides existing schemes.

	resPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ResolverScheme{})))
	len = uint32(libc.Xstrlen(tls, name) + uint64(1))
	(*ResolverScheme)(unsafe.Pointer(resPtr)).Fname = XTcl_Alloc(tls, len)
	libc.Xmemcpy(tls, (*ResolverScheme)(unsafe.Pointer(resPtr)).Fname, name, uint64(len))
	(*ResolverScheme)(unsafe.Pointer(resPtr)).FcmdResProc = cmdProc
	(*ResolverScheme)(unsafe.Pointer(resPtr)).FvarResProc = varProc
	(*ResolverScheme)(unsafe.Pointer(resPtr)).FcompiledVarResProc = compiledVarProc
	(*ResolverScheme)(unsafe.Pointer(resPtr)).FnextPtr = (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr
	(*Interp)(unsafe.Pointer(iPtr)).FresolverPtr = resPtr
}

//----------------------------------------------------------------------
//
// Tcl_GetInterpResolvers --
//
//	Looks for a set of command/variable resolution functions with the
//	given name in an interpreter. These functions are registered by
//	calling Tcl_AddInterpResolvers.
//
// Results:
//	If the name is recognized, this function returns non-zero, along with
//	pointers to the name resolution functions in the Tcl_ResolverInfo
//	structure. If the name is not recognized, this function returns zero.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetInterpResolvers(tls *libc.TLS, interp uintptr, name uintptr, resInfoPtr uintptr) int32 { /* tclResolve.c:136:1: */
	var iPtr uintptr = interp
	var resPtr uintptr

	// Look for an existing scheme with the given name. If found, then return
	// pointers to its functions.

	for resPtr = (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr; resPtr != uintptr(0); resPtr = (*ResolverScheme)(unsafe.Pointer(resPtr)).FnextPtr {
		if int32(*(*int8)(unsafe.Pointer(name))) == int32(*(*int8)(unsafe.Pointer((*ResolverScheme)(unsafe.Pointer(resPtr)).Fname))) && libc.Xstrcmp(tls, name, (*ResolverScheme)(unsafe.Pointer(resPtr)).Fname) == 0 {
			(*Tcl_ResolverInfo)(unsafe.Pointer(resInfoPtr)).FcmdResProc = (*ResolverScheme)(unsafe.Pointer(resPtr)).FcmdResProc
			(*Tcl_ResolverInfo)(unsafe.Pointer(resInfoPtr)).FvarResProc = (*ResolverScheme)(unsafe.Pointer(resPtr)).FvarResProc
			(*Tcl_ResolverInfo)(unsafe.Pointer(resInfoPtr)).FcompiledVarResProc = (*ResolverScheme)(unsafe.Pointer(resPtr)).FcompiledVarResProc
			return 1
		}
	}

	return 0
}

//----------------------------------------------------------------------
//
// Tcl_RemoveInterpResolvers --
//
//	Removes a set of command/variable resolution functions previously
//	added by Tcl_AddInterpResolvers. The next time a command/variable name
//	is resolved, these functions won't be consulted.
//
// Results:
//	Returns non-zero if the name was recognized and the resolution scheme
//	was deleted. Returns zero otherwise.
//
// Side effects:
//	If a scheme with a compiledVarProc was deleted, this function bumps
//	the compileEpoch for the interpreter, forcing all code to be
//	recompiled. If a scheme with a cmdProc was deleted, this function
//	bumps the cmdRefEpoch in all namespaces, forcing commands to be
//	resolved again using the new rules.
//
//----------------------------------------------------------------------

func XTcl_RemoveInterpResolvers(tls *libc.TLS, interp uintptr, name uintptr) int32 { /* tclResolve.c:188:1: */
	var iPtr uintptr = interp
	var prevPtrPtr uintptr
	var resPtr uintptr

	// Look for an existing scheme with the given name.

	prevPtrPtr = iPtr + 408
	for resPtr = (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr; resPtr != uintptr(0); resPtr = (*ResolverScheme)(unsafe.Pointer(resPtr)).FnextPtr {
		if int32(*(*int8)(unsafe.Pointer(name))) == int32(*(*int8)(unsafe.Pointer((*ResolverScheme)(unsafe.Pointer(resPtr)).Fname))) && libc.Xstrcmp(tls, name, (*ResolverScheme)(unsafe.Pointer(resPtr)).Fname) == 0 {
			break
		}
		prevPtrPtr = resPtr + 32
	}

	// If we found the scheme, delete it.

	if resPtr != 0 {
		// If we're deleting a scheme with compiled variable resolution rules,
		// bump the compiler epoch to invalidate compiled code. If we're
		// deleting a scheme with command resolution rules, bump the
		// cmdRefEpoch in all namespaces.

		if (*ResolverScheme)(unsafe.Pointer(resPtr)).FcompiledVarResProc != 0 {
			(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch++
		}
		if (*ResolverScheme)(unsafe.Pointer(resPtr)).FcmdResProc != 0 {
			sBumpCmdRefEpochs(tls, (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr)
		}

		*(*uintptr)(unsafe.Pointer(prevPtrPtr)) = (*ResolverScheme)(unsafe.Pointer(resPtr)).FnextPtr
		XTclpFree(tls, (*ResolverScheme)(unsafe.Pointer(resPtr)).Fname)
		XTclpFree(tls, resPtr)

		return 1
	}
	return 0
}

//----------------------------------------------------------------------
//
// BumpCmdRefEpochs --
//
//	This function is used to bump the cmdRefEpoch counters in the
//	specified namespace and all of its child namespaces. It is used
//	whenever name resolution schemes are added/removed from an
//	interpreter, to invalidate all command references.
//
// Results:
//	None.
//
// Side effects:
//	Bumps the cmdRefEpoch in the specified namespace and its children,
//	recursively.
//
//----------------------------------------------------------------------

func sBumpCmdRefEpochs(tls *libc.TLS, nsPtr uintptr) { /* tclResolve.c:257:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var entry uintptr
	// var search Tcl_HashSearch at bp, 24

	(*Namespace)(unsafe.Pointer(nsPtr)).FcmdRefEpoch++

	for entry = XTcl_FirstHashEntry(tls, nsPtr+40, bp); entry != uintptr(0); entry = XTcl_NextHashEntry(tls, bp) {
		var childNsPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(entry)).FclientData

		sBumpCmdRefEpochs(tls, childNsPtr)
	}
	XTclInvalidateNsPath(tls, nsPtr)
}

//----------------------------------------------------------------------
//
// Tcl_SetNamespaceResolvers --
//
//	Sets the command/variable resolution functions for a namespace,
//	thereby changing the way that command/variable names are interpreted.
//	This allows extension writers to support different name resolution
//	schemes, such as those for object-oriented packages.
//
//	Command resolution is handled by a function of the following type:
//
//	  typedef int (Tcl_ResolveCmdProc)(Tcl_Interp *interp,
//		  const char *name, Tcl_Namespace *context,
//		  int flags, Tcl_Command *rPtr);
//
//	Whenever a command is executed or Tcl_FindCommand is invoked within
//	the namespace, this function is called to resolve the command name. If
//	this function is able to resolve the name, it should return the status
//	code TCL_OK, along with the corresponding Tcl_Command in the rPtr
//	argument. Otherwise, the function can return TCL_CONTINUE, and the
//	command will be treated under the usual name resolution rules. Or, it
//	can return TCL_ERROR, and the command will be considered invalid.
//
//	Variable resolution is handled by two functions. The first is called
//	whenever a variable needs to be resolved at compile time:
//
//	  typedef int (Tcl_ResolveCompiledVarProc)(Tcl_Interp *interp,
//		  const char *name, Tcl_Namespace *context,
//		  Tcl_ResolvedVarInfo *rPtr);
//
//	If this function is able to resolve the name, it should return the
//	status code TCL_OK, along with variable resolution info in the rPtr
//	argument; this info will be used to set up compiled locals in the call
//	frame at runtime. The function may also return TCL_CONTINUE, and the
//	variable will be treated under the usual name resolution rules. Or, it
//	can return TCL_ERROR, and the variable will be considered invalid.
//
//	Another function is used whenever a variable needs to be resolved at
//	runtime but it is not recognized as a compiled local. (For example,
//	the variable may be requested via Tcl_FindNamespaceVar.) This function
//	has the following type:
//
//	  typedef int (Tcl_ResolveVarProc)(Tcl_Interp *interp,
//		  const char *name, Tcl_Namespace *context,
//		  int flags, Tcl_Var *rPtr);
//
//	This function is quite similar to the compile-time version. It returns
//	the same status codes, but if variable resolution succeeds, this
//	function returns a Tcl_Var directly via the rPtr argument.
//
// Results:
//	Nothing.
//
// Side effects:
//	Bumps the command epoch counter for the namespace, invalidating all
//	command references in that namespace. Also bumps the resolver epoch
//	counter for the namespace, forcing all code in the namespace to be
//	recompiled.
//
//----------------------------------------------------------------------

func XTcl_SetNamespaceResolvers(tls *libc.TLS, namespacePtr uintptr, cmdProc uintptr, varProc uintptr, compiledVarProc uintptr) { /* tclResolve.c:349:1: */
	var nsPtr uintptr = namespacePtr

	// Plug in the new command resolver, and bump the epoch counters so that
	// all code will have to be recompiled and all commands will have to be
	// resolved again using the new policy.

	(*Namespace)(unsafe.Pointer(nsPtr)).FcmdResProc = cmdProc
	(*Namespace)(unsafe.Pointer(nsPtr)).FvarResProc = varProc
	(*Namespace)(unsafe.Pointer(nsPtr)).FcompiledVarResProc = compiledVarProc

	(*Namespace)(unsafe.Pointer(nsPtr)).FcmdRefEpoch++
	(*Namespace)(unsafe.Pointer(nsPtr)).FresolverEpoch++
	XTclInvalidateNsPath(tls, nsPtr)
}

//----------------------------------------------------------------------
//
// Tcl_GetNamespaceResolvers --
//
//	Returns the current command/variable resolution functions for a
//	namespace. By default, these functions are NULL. New functions can be
//	installed by calling Tcl_SetNamespaceResolvers, to provide new name
//	resolution rules.
//
// Results:
//	Returns non-zero if any name resolution functions have been assigned
//	to this namespace; also returns pointers to the functions in the
//	Tcl_ResolverInfo structure. Returns zero otherwise.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetNamespaceResolvers(tls *libc.TLS, namespacePtr uintptr, resInfoPtr uintptr) int32 { /* tclResolve.c:398:1: */
	var nsPtr uintptr = namespacePtr

	(*Tcl_ResolverInfo)(unsafe.Pointer(resInfoPtr)).FcmdResProc = (*Namespace)(unsafe.Pointer(nsPtr)).FcmdResProc
	(*Tcl_ResolverInfo)(unsafe.Pointer(resInfoPtr)).FvarResProc = (*Namespace)(unsafe.Pointer(nsPtr)).FvarResProc
	(*Tcl_ResolverInfo)(unsafe.Pointer(resInfoPtr)).FcompiledVarResProc = (*Namespace)(unsafe.Pointer(nsPtr)).FcompiledVarResProc

	if (*Namespace)(unsafe.Pointer(nsPtr)).FcmdResProc != uintptr(0) || (*Namespace)(unsafe.Pointer(nsPtr)).FvarResProc != uintptr(0) || (*Namespace)(unsafe.Pointer(nsPtr)).FcompiledVarResProc != uintptr(0) {
		return 1
	}
	return 0
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// This structure is used to take a snapshot of the interpreter state in
// Tcl_SaveInterpState. You can snapshot the state, execute a command, and
// then back up to the result or the error that was previously in progress.

type InterpState1 = struct {
	Fstatus          int32
	Fflags           int32
	FreturnLevel     int32
	FreturnCode      int32
	FerrorInfo       uintptr
	FerrorCode       uintptr
	FreturnOpts      uintptr
	FobjResult       uintptr
	FerrorStack      uintptr
	FresetErrorStack int32
	F__ccgo_pad1     [4]byte
} /* tclResult.c:38:9 */

// This structure is used to take a snapshot of the interpreter state in
// Tcl_SaveInterpState. You can snapshot the state, execute a command, and
// then back up to the result or the error that was previously in progress.

type InterpState = InterpState1 /* tclResult.c:49:3 */

//----------------------------------------------------------------------
//
// Tcl_SaveInterpState --
//
//	Fills a token with a snapshot of the current state of the interpreter.
//	The snapshot can be restored at any point by TclRestoreInterpState.
//
//	The token returned must be eventally passed to one of the routines
//	TclRestoreInterpState or TclDiscardInterpState, or there will be a
//	memory leak.
//
// Results:
//	Returns a token representing the interp state.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_SaveInterpState(tls *libc.TLS, interp uintptr, status int32) Tcl_InterpState { /* tclResult.c:73:1: */
	var iPtr uintptr = interp
	var statePtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(InterpState{})))

	(*InterpState)(unsafe.Pointer(statePtr)).Fstatus = status
	(*InterpState)(unsafe.Pointer(statePtr)).Fflags = (*Interp)(unsafe.Pointer(iPtr)).Fflags & ERR_ALREADY_LOGGED
	(*InterpState)(unsafe.Pointer(statePtr)).FreturnLevel = (*Interp)(unsafe.Pointer(iPtr)).FreturnLevel
	(*InterpState)(unsafe.Pointer(statePtr)).FreturnCode = (*Interp)(unsafe.Pointer(iPtr)).FreturnCode
	(*InterpState)(unsafe.Pointer(statePtr)).FerrorInfo = (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo
	(*InterpState)(unsafe.Pointer(statePtr)).FerrorStack = (*Interp)(unsafe.Pointer(iPtr)).FerrorStack
	(*InterpState)(unsafe.Pointer(statePtr)).FresetErrorStack = (*Interp)(unsafe.Pointer(iPtr)).FresetErrorStack
	if (*InterpState)(unsafe.Pointer(statePtr)).FerrorInfo != 0 {
		(*Tcl_Obj)(unsafe.Pointer((*InterpState)(unsafe.Pointer(statePtr)).FerrorInfo)).FrefCount++
	}
	(*InterpState)(unsafe.Pointer(statePtr)).FerrorCode = (*Interp)(unsafe.Pointer(iPtr)).FerrorCode
	if (*InterpState)(unsafe.Pointer(statePtr)).FerrorCode != 0 {
		(*Tcl_Obj)(unsafe.Pointer((*InterpState)(unsafe.Pointer(statePtr)).FerrorCode)).FrefCount++
	}
	(*InterpState)(unsafe.Pointer(statePtr)).FreturnOpts = (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts
	if (*InterpState)(unsafe.Pointer(statePtr)).FreturnOpts != 0 {
		(*Tcl_Obj)(unsafe.Pointer((*InterpState)(unsafe.Pointer(statePtr)).FreturnOpts)).FrefCount++
	}
	if (*InterpState)(unsafe.Pointer(statePtr)).FerrorStack != 0 {
		(*Tcl_Obj)(unsafe.Pointer((*InterpState)(unsafe.Pointer(statePtr)).FerrorStack)).FrefCount++
	}
	(*InterpState)(unsafe.Pointer(statePtr)).FobjResult = XTcl_GetObjResult(tls, interp)
	(*Tcl_Obj)(unsafe.Pointer((*InterpState)(unsafe.Pointer(statePtr)).FobjResult)).FrefCount++
	return statePtr
}

//----------------------------------------------------------------------
//
// Tcl_RestoreInterpState --
//
//	Accepts an interp and a token previously returned by
//	Tcl_SaveInterpState. Restore the state of the interp to what it was at
//	the time of the Tcl_SaveInterpState call.
//
// Results:
//	Returns the status value originally passed in to Tcl_SaveInterpState.
//
// Side effects:
//	Restores the interp state and frees memory held by token.
//
//----------------------------------------------------------------------

func XTcl_RestoreInterpState(tls *libc.TLS, interp uintptr, state Tcl_InterpState) int32 { /* tclResult.c:125:1: */
	var iPtr uintptr = interp
	var statePtr uintptr = state
	var status int32 = (*InterpState)(unsafe.Pointer(statePtr)).Fstatus

	*(*int32)(unsafe.Pointer(iPtr + 424)) &= libc.CplInt32(ERR_ALREADY_LOGGED)
	*(*int32)(unsafe.Pointer(iPtr + 424)) |= (*InterpState)(unsafe.Pointer(statePtr)).Fflags & ERR_ALREADY_LOGGED

	(*Interp)(unsafe.Pointer(iPtr)).FreturnLevel = (*InterpState)(unsafe.Pointer(statePtr)).FreturnLevel
	(*Interp)(unsafe.Pointer(iPtr)).FreturnCode = (*InterpState)(unsafe.Pointer(statePtr)).FreturnCode
	(*Interp)(unsafe.Pointer(iPtr)).FresetErrorStack = (*InterpState)(unsafe.Pointer(statePtr)).FresetErrorStack
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FerrorInfo = (*InterpState)(unsafe.Pointer(statePtr)).FerrorInfo
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo != 0 {
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorInfo)).FrefCount++
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorCode != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorCode
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FerrorCode = (*InterpState)(unsafe.Pointer(statePtr)).FerrorCode
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorCode != 0 {
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorCode)).FrefCount++
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorStack != 0 {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorStack
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FerrorStack = (*InterpState)(unsafe.Pointer(statePtr)).FerrorStack
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorStack != 0 {
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorStack)).FrefCount++
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts != 0 {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FreturnOpts = (*InterpState)(unsafe.Pointer(statePtr)).FreturnOpts
	if (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts != 0 {
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FreturnOpts)).FrefCount++
	}
	XTcl_SetObjResult(tls, interp, (*InterpState)(unsafe.Pointer(statePtr)).FobjResult)
	XTcl_DiscardInterpState(tls, state)
	return status
}

//----------------------------------------------------------------------
//
// Tcl_DiscardInterpState --
//
//	Accepts a token previously returned by Tcl_SaveInterpState. Frees the
//	memory it uses.
//
// Results:
//	None.
//
// Side effects:
//	Frees memory.
//
//----------------------------------------------------------------------

func XTcl_DiscardInterpState(tls *libc.TLS, state Tcl_InterpState) { /* tclResult.c:190:1: */
	var statePtr uintptr = state

	if (*InterpState)(unsafe.Pointer(statePtr)).FerrorInfo != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*InterpState)(unsafe.Pointer(statePtr)).FerrorInfo
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*InterpState)(unsafe.Pointer(statePtr)).FerrorCode != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*InterpState)(unsafe.Pointer(statePtr)).FerrorCode
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*InterpState)(unsafe.Pointer(statePtr)).FreturnOpts != 0 {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = (*InterpState)(unsafe.Pointer(statePtr)).FreturnOpts
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*InterpState)(unsafe.Pointer(statePtr)).FerrorStack != 0 {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = (*InterpState)(unsafe.Pointer(statePtr)).FerrorStack
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	for ok4 := true; ok4; ok4 = 0 != 0 {
		var _objPtr uintptr = (*InterpState)(unsafe.Pointer(statePtr)).FobjResult
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTclpFree(tls, statePtr)
}

//----------------------------------------------------------------------
//
// Tcl_SaveResult --
//
//	Takes a snapshot of the current result state of the interpreter. The
//	snapshot can be restored at any point by Tcl_RestoreResult. Note that
//	this routine does not preserve the errorCode, errorInfo, or flags
//	fields so it should not be used if an error is in progress.
//
//	Once a snapshot is saved, it must be restored by calling
//	Tcl_RestoreResult, or discarded by calling Tcl_DiscardResult.
//
// Results:
//	None.
//
// Side effects:
//	Resets the interpreter result.
//
//----------------------------------------------------------------------

func XTcl_SaveResult(tls *libc.TLS, interp uintptr, statePtr uintptr) { /* tclResult.c:235:1: */
	var iPtr uintptr = interp

	// Move the result object into the save state. Note that we don't need to
	// change its refcount because we're moving it, not adding a new
	// reference. Put an empty object into the interpreter.

	(*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr = (*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr
	(*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr = XTcl_NewObj(tls)
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).FrefCount++

	// Save the string result.

	(*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FfreeProc = (*Interp)(unsafe.Pointer(iPtr)).FfreeProc
	if (*Interp)(unsafe.Pointer(iPtr)).Fresult == iPtr+472 {
		// Copy the static string data out of the interp buffer.

		(*Tcl_SavedResult)(unsafe.Pointer(statePtr)).Fresult = statePtr + 40 /* &.resultSpace */
		libc.Xstrcpy(tls, (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).Fresult, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
		(*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendResult = uintptr(0)
	} else if (*Interp)(unsafe.Pointer(iPtr)).Fresult == (*Interp)(unsafe.Pointer(iPtr)).FappendResult {
		// Move the append buffer out of the interp.

		(*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendResult = (*Interp)(unsafe.Pointer(iPtr)).FappendResult
		(*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendAvl = (*Interp)(unsafe.Pointer(iPtr)).FappendAvl
		(*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendUsed = (*Interp)(unsafe.Pointer(iPtr)).FappendUsed
		(*Tcl_SavedResult)(unsafe.Pointer(statePtr)).Fresult = (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendResult
		(*Interp)(unsafe.Pointer(iPtr)).FappendResult = uintptr(0)
		(*Interp)(unsafe.Pointer(iPtr)).FappendAvl = 0
		(*Interp)(unsafe.Pointer(iPtr)).FappendUsed = 0
	} else {
		// Move the dynamic or static string out of the interpreter.

		(*Tcl_SavedResult)(unsafe.Pointer(statePtr)).Fresult = (*Interp)(unsafe.Pointer(iPtr)).Fresult
		(*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendResult = uintptr(0)
	}

	(*Interp)(unsafe.Pointer(iPtr)).Fresult = iPtr + 472 /* &.resultSpace */
	*(*int8)(unsafe.Pointer(iPtr + 472)) = int8(0)
	(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_RestoreResult --
//
//	Restores the state of the interpreter to a snapshot taken by
//	Tcl_SaveResult. After this call, the token for the interpreter state
//	is no longer valid.
//
// Results:
//	None.
//
// Side effects:
//	Restores the interpreter result.
//
//----------------------------------------------------------------------

func XTcl_RestoreResult(tls *libc.TLS, interp uintptr, statePtr uintptr) { /* tclResult.c:310:1: */
	var iPtr uintptr = interp

	XTcl_ResetResult(tls, interp)

	// Restore the string result.

	(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FfreeProc
	if (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).Fresult == statePtr+40 {
		// Copy the static string data into the interp buffer.

		(*Interp)(unsafe.Pointer(iPtr)).Fresult = iPtr + 472 /* &.resultSpace */
		libc.Xstrcpy(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult, (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).Fresult)
	} else if (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).Fresult == (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendResult {
		// Move the append buffer back into the interp.

		if (*Interp)(unsafe.Pointer(iPtr)).FappendResult != uintptr(0) {
			XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).FappendResult)
		}

		(*Interp)(unsafe.Pointer(iPtr)).FappendResult = (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendResult
		(*Interp)(unsafe.Pointer(iPtr)).FappendAvl = (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendAvl
		(*Interp)(unsafe.Pointer(iPtr)).FappendUsed = (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendUsed
		(*Interp)(unsafe.Pointer(iPtr)).Fresult = (*Interp)(unsafe.Pointer(iPtr)).FappendResult
	} else {
		// Move the dynamic or static string back into the interpreter.

		(*Interp)(unsafe.Pointer(iPtr)).Fresult = (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).Fresult
	}

	// Restore the object result.

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr = (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr
}

//----------------------------------------------------------------------
//
// Tcl_DiscardResult --
//
//	Frees the memory associated with an interpreter snapshot taken by
//	Tcl_SaveResult. If the snapshot is not restored, this function must be
//	called to discard it, or the memory will be lost.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_DiscardResult(tls *libc.TLS, statePtr uintptr) { /* tclResult.c:379:1: */
	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer((*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer((*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer((*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr)
				} else {
					*(*uintptr)(unsafe.Pointer((*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FobjResultPtr)
		}
	}

	if (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).Fresult == (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendResult {
		XTclpFree(tls, (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FappendResult)
	} else if (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FfreeProc == uintptr(3) {
		XTclpFree(tls, (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).Fresult)
	} else if (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FfreeProc != 0 {
		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_SavedResult)(unsafe.Pointer(statePtr)).FfreeProc})).f(tls, (*Tcl_SavedResult)(unsafe.Pointer(statePtr)).Fresult)
	}
}

//----------------------------------------------------------------------
//
// Tcl_SetResult --
//
//	Arrange for "result" to be the Tcl return value.
//
// Results:
//	None.
//
// Side effects:
//	interp->result is left pointing either to "result" or to a copy of it.
//	Also, the object result is reset.
//
//----------------------------------------------------------------------

func XTcl_SetResult(tls *libc.TLS, interp uintptr, result uintptr, freeProc uintptr) { /* tclResult.c:411:1: */
	var iPtr uintptr = interp
	var oldFreeProc uintptr = (*Interp)(unsafe.Pointer(iPtr)).FfreeProc
	var oldResult uintptr = (*Interp)(unsafe.Pointer(iPtr)).Fresult

	if result == uintptr(0) {
		*(*int8)(unsafe.Pointer(iPtr + 472)) = int8(0)
		(*Interp)(unsafe.Pointer(iPtr)).Fresult = iPtr + 472 /* &.resultSpace */
		(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = uintptr(0)
	} else if freeProc == uintptr(1) {
		var length int32 = int32(libc.Xstrlen(tls, result))

		if length > TCL_RESULT_SIZE {
			(*Interp)(unsafe.Pointer(iPtr)).Fresult = XTcl_Alloc(tls, uint32(length+1))
			(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = uintptr(3)
		} else {
			(*Interp)(unsafe.Pointer(iPtr)).Fresult = iPtr + 472 /* &.resultSpace */
			(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = uintptr(0)
		}
		libc.Xmemcpy(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult, result, uint64(length+1))
	} else {
		(*Interp)(unsafe.Pointer(iPtr)).Fresult = result
		(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = freeProc
	}

	// If the old result was dynamically-allocated, free it up. Do it here,
	// rather than at the beginning, in case the new result value was part of
	// the old result value.

	if oldFreeProc != uintptr(0) {
		if oldFreeProc == uintptr(3) {
			XTclpFree(tls, oldResult)
		} else {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{oldFreeProc})).f(tls, oldResult)
		}
	}

	// Reset the object result since we just set the string result.

	sResetObjResult(tls, iPtr)
}

//----------------------------------------------------------------------
//
// Tcl_GetStringResult --
//
//	Returns an interpreter's result value as a string.
//
// Results:
//	The interpreter's result as a string.
//
// Side effects:
//	If the string result is empty, the object result is moved to the
//	string result, then the object result is reset.
//
//----------------------------------------------------------------------

func XTcl_GetStringResult(tls *libc.TLS, interp uintptr) uintptr { /* tclResult.c:482:12: */
	// If the string result is empty, move the object result to the string
	// result, then reset the object result.

	var iPtr uintptr = interp

	if int32(*(*int8)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).Fresult))) == 0 {
		XTcl_SetResult(tls, interp, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(XTcl_GetObjResult(tls, interp))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(XTcl_GetObjResult(tls, interp))).Fbytes
			}
			return XTcl_GetString(tls, XTcl_GetObjResult(tls, interp))
		}(),
			uintptr(1))
	}
	return (*Interp)(unsafe.Pointer(iPtr)).Fresult
}

//----------------------------------------------------------------------
//
// Tcl_SetObjResult --
//
//	Arrange for objPtr to be an interpreter's result value.
//
// Results:
//	None.
//
// Side effects:
//	interp->objResultPtr is left pointing to the object referenced by
//	objPtr. The object's reference count is incremented since there is now
//	a new reference to it. The reference count for any old objResultPtr
//	value is decremented. Also, the string result is reset.
//
//----------------------------------------------------------------------

func XTcl_SetObjResult(tls *libc.TLS, interp uintptr, objPtr uintptr) { /* tclResult.c:520:1: */
	var iPtr uintptr = interp
	var oldObjResult uintptr = (*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr

	(*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr = objPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ // since interp result is a reference

	// We wait until the end to release the old object result, in case we are
	// setting the result to itself.

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldObjResult)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(oldObjResult)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldObjResult)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(oldObjResult)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldObjResult)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldObjResult)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(oldObjResult)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, oldObjResult)
				} else {
					*(*uintptr)(unsafe.Pointer(oldObjResult + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldObjResult
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, oldObjResult)
		}
	}

	// Reset the string result since we just set the result object.

	if (*Interp)(unsafe.Pointer(iPtr)).FfreeProc != uintptr(0) {
		if (*Interp)(unsafe.Pointer(iPtr)).FfreeProc == uintptr(3) {
			XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
		} else {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Interp)(unsafe.Pointer(iPtr)).FfreeProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
		}
		(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = uintptr(0)
	}
	(*Interp)(unsafe.Pointer(iPtr)).Fresult = iPtr + 472 /* &.resultSpace */
	*(*int8)(unsafe.Pointer(iPtr + 472)) = int8(0)
}

//----------------------------------------------------------------------
//
// Tcl_GetObjResult --
//
//	Returns an interpreter's result value as a Tcl object. The object's
//	reference count is not modified; the caller must do that if it needs
//	to hold on to a long-term reference to it.
//
// Results:
//	The interpreter's result as an object.
//
// Side effects:
//	If the interpreter has a non-empty string result, the result object is
//	either empty or stale because some function set interp->result
//	directly. If so, the string result is moved to the result object then
//	the string result is reset.
//
//----------------------------------------------------------------------

func XTcl_GetObjResult(tls *libc.TLS, interp uintptr) uintptr { /* tclResult.c:576:9: */
	var iPtr uintptr = interp
	var objResultPtr uintptr
	var length int32

	// If the string result is non-empty, move the string result to the object
	// result, then reset the string result.

	if int32(*(*int8)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).Fresult))) != 0 {
		sResetObjResult(tls, iPtr)

		objResultPtr = (*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr
		length = int32(libc.Xstrlen(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult))
		if length == 0 {
			(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = XTcl_Alloc(tls, uint32(length+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes, (*Interp)(unsafe.Pointer(iPtr)).Fresult, uint64(length))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes + uintptr(length))) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Flength = length
		}

		if (*Interp)(unsafe.Pointer(iPtr)).FfreeProc != uintptr(0) {
			if (*Interp)(unsafe.Pointer(iPtr)).FfreeProc == uintptr(3) {
				XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
			} else {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Interp)(unsafe.Pointer(iPtr)).FfreeProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
			}
			(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = uintptr(0)
		}
		(*Interp)(unsafe.Pointer(iPtr)).Fresult = iPtr + 472 /* &.resultSpace */
		*(*int8)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).Fresult)) = int8(0)
	}
	return (*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr
}

//----------------------------------------------------------------------
//
// Tcl_AppendResultVA --
//
//	Append a variable number of strings onto the interpreter's result.
//
// Results:
//	None.
//
// Side effects:
//	The result of the interpreter given by the first argument is extended
//	by the strings in the va_list (up to a terminating NULL argument).
//
//	If the string result is non-empty, the object result forced to be a
//	duplicate of it first. There will be a string result afterwards.
//
//----------------------------------------------------------------------

func XTcl_AppendResultVA(tls *libc.TLS, interp uintptr, argList Va_list) { /* tclResult.c:631:1: */
	var objPtr uintptr = XTcl_GetObjResult(tls, interp)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		objPtr = XTcl_DuplicateObj(tls, objPtr)
	}
	XTcl_AppendStringsToObjVA(tls, objPtr, argList)
	XTcl_SetObjResult(tls, interp, objPtr)

	// Strictly we should call Tcl_GetStringResult(interp) here to make sure
	// that interp->result is correct according to the old contract, but that
	// makes the performance of much code (e.g. in Tk) absolutely awful. So we
	// leave it out; code that really wants interp->result can just insert the
	// calls to Tcl_GetStringResult() itself. [Patch 1041072 discussion]

}

//----------------------------------------------------------------------
//
// Tcl_AppendResult --
//
//	Append a variable number of strings onto the interpreter's result.
//
// Results:
//	None.
//
// Side effects:
//	The result of the interpreter given by the first argument is extended
//	by the strings given by the second and following arguments (up to a
//	terminating NULL argument).
//
//	If the string result is non-empty, the object result forced to be a
//	duplicate of it first. There will be a string result afterwards.
//
//----------------------------------------------------------------------

func XTcl_AppendResult(tls *libc.TLS, interp uintptr, va uintptr) { /* tclResult.c:684:1: */
	var argList Va_list
	_ = argList

	argList = va
	XTcl_AppendResultVA(tls, interp, argList)
	_ = argList
}

//----------------------------------------------------------------------
//
// Tcl_AppendElement --
//
//	Convert a string to a valid Tcl list element and append it to the
//	result (which is ostensibly a list).
//
// Results:
//	None.
//
// Side effects:
//	The result in the interpreter given by the first argument is extended
//	with a list element converted from string. A separator space is added
//	before the converted list element unless the current result is empty,
//	contains the single character "{", or ends in " {".
//
//	If the string result is empty, the object result is moved to the
//	string result, then the object result is reset.
//
//----------------------------------------------------------------------

func XTcl_AppendElement(tls *libc.TLS, interp uintptr, element uintptr) { /* tclResult.c:718:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp
	var dst uintptr
	var size int32
	// var flags int32 at bp, 4

	var quoteHash int32 = 1

	// If the string result is empty, move the object result to the string
	// result, then reset the object result.

	XTcl_GetStringResult(tls, interp)

	// See how much space is needed, and grow the append buffer if needed to
	// accommodate the list element.

	size = XTcl_ScanElement(tls, element, bp) + 1
	if (*Interp)(unsafe.Pointer(iPtr)).Fresult != (*Interp)(unsafe.Pointer(iPtr)).FappendResult ||
		int32(*(*int8)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FappendResult + uintptr((*Interp)(unsafe.Pointer(iPtr)).FappendUsed)))) != 0 ||
		size+(*Interp)(unsafe.Pointer(iPtr)).FappendUsed >= (*Interp)(unsafe.Pointer(iPtr)).FappendAvl {
		sSetupAppendBuffer(tls, iPtr, size+(*Interp)(unsafe.Pointer(iPtr)).FappendUsed)
	}

	// Convert the string into a list element and copy it to the buffer that's
	// forming, with a space separator if needed.

	dst = (*Interp)(unsafe.Pointer(iPtr)).FappendResult + uintptr((*Interp)(unsafe.Pointer(iPtr)).FappendUsed)
	if XTclNeedSpace(tls, (*Interp)(unsafe.Pointer(iPtr)).FappendResult, dst) != 0 {
		(*Interp)(unsafe.Pointer(iPtr)).FappendUsed++
		*(*int8)(unsafe.Pointer(dst)) = int8(' ')
		dst++

		// If we need a space to separate this element from preceding stuff,
		// then this element will not lead a list, and need not have it's
		// leading '#' quoted.
		quoteHash = 0
	} else {
		for libc.PreDecUintptr(&dst, 1) >= (*Interp)(unsafe.Pointer(iPtr)).FappendResult && func() int32 {
			if int32(*(*int8)(unsafe.Pointer(dst))) > 0x20 {
				return 0
			}
			return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(dst))))
		}() != 0 {
		}
		quoteHash = libc.BoolInt32(!(XTclNeedSpace(tls, (*Interp)(unsafe.Pointer(iPtr)).FappendResult, dst+uintptr(1)) != 0))
	}
	dst = (*Interp)(unsafe.Pointer(iPtr)).FappendResult + uintptr((*Interp)(unsafe.Pointer(iPtr)).FappendUsed)
	if !(quoteHash != 0) {
		*(*int32)(unsafe.Pointer(bp /* flags */)) |= TCL_DONT_QUOTE_HASH
	}

	*(*int32)(unsafe.Pointer(iPtr + 220)) += XTcl_ConvertElement(tls, element, dst, *(*int32)(unsafe.Pointer(bp)))
}

//----------------------------------------------------------------------
//
// SetupAppendBuffer --
//
//	This function makes sure that there is an append buffer properly
//	initialized, if necessary, from the interpreter's result, and that it
//	has at least enough room to accommodate newSpace new bytes of
//	information.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sSetupAppendBuffer(tls *libc.TLS, iPtr uintptr, newSpace int32) { /* tclResult.c:799:1: */
	var totalSpace int32

	// Make the append buffer larger, if that's necessary, then copy the
	// result into the append buffer and make the append buffer the official
	// Tcl result.

	if (*Interp)(unsafe.Pointer(iPtr)).Fresult != (*Interp)(unsafe.Pointer(iPtr)).FappendResult {
		// If an oversized buffer was used recently, then free it up so we go
		// back to a smaller buffer. This avoids tying up memory forever after
		// a large operation.

		if (*Interp)(unsafe.Pointer(iPtr)).FappendAvl > 500 {
			XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).FappendResult)
			(*Interp)(unsafe.Pointer(iPtr)).FappendResult = uintptr(0)
			(*Interp)(unsafe.Pointer(iPtr)).FappendAvl = 0
		}
		(*Interp)(unsafe.Pointer(iPtr)).FappendUsed = int32(libc.Xstrlen(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult))
	} else if int32(*(*int8)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).Fresult + uintptr((*Interp)(unsafe.Pointer(iPtr)).FappendUsed)))) != 0 {
		// Most likely someone has modified a result created by
		// Tcl_AppendResult et al. so that it has a different size. Just
		// recompute the size.

		(*Interp)(unsafe.Pointer(iPtr)).FappendUsed = int32(libc.Xstrlen(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult))
	}

	totalSpace = newSpace + (*Interp)(unsafe.Pointer(iPtr)).FappendUsed
	if totalSpace >= (*Interp)(unsafe.Pointer(iPtr)).FappendAvl {
		var new uintptr

		if totalSpace < 100 {
			totalSpace = 200
		} else {
			totalSpace = totalSpace * 2
		}
		new = XTcl_Alloc(tls, uint32(totalSpace))
		libc.Xstrcpy(tls, new, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
		if (*Interp)(unsafe.Pointer(iPtr)).FappendResult != uintptr(0) {
			XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).FappendResult)
		}
		(*Interp)(unsafe.Pointer(iPtr)).FappendResult = new
		(*Interp)(unsafe.Pointer(iPtr)).FappendAvl = totalSpace
	} else if (*Interp)(unsafe.Pointer(iPtr)).Fresult != (*Interp)(unsafe.Pointer(iPtr)).FappendResult {
		libc.Xstrcpy(tls, (*Interp)(unsafe.Pointer(iPtr)).FappendResult, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
	}

	XTcl_FreeResult(tls, iPtr)
	(*Interp)(unsafe.Pointer(iPtr)).Fresult = (*Interp)(unsafe.Pointer(iPtr)).FappendResult
}

//----------------------------------------------------------------------
//
// Tcl_FreeResult --
//
//	This function frees up the memory associated with an interpreter's
//	string result. It also resets the interpreter's result object.
//	Tcl_FreeResult is most commonly used when a function is about to
//	replace one result value with another.
//
// Results:
//	None.
//
// Side effects:
//	Frees the memory associated with interp's string result and sets
//	interp->freeProc to zero, but does not change interp->result or clear
//	error state. Resets interp's result object to an unshared empty
//	object.
//
//----------------------------------------------------------------------

func XTcl_FreeResult(tls *libc.TLS, interp uintptr) { /* tclResult.c:882:1: */
	var iPtr uintptr = interp

	if (*Interp)(unsafe.Pointer(iPtr)).FfreeProc != uintptr(0) {
		if (*Interp)(unsafe.Pointer(iPtr)).FfreeProc == uintptr(3) {
			XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
		} else {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Interp)(unsafe.Pointer(iPtr)).FfreeProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
		}
		(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = uintptr(0)
	}

	sResetObjResult(tls, iPtr)
}

//----------------------------------------------------------------------
//
// Tcl_ResetResult --
//
//	This function resets both the interpreter's string and object results.
//
// Results:
//	None.
//
// Side effects:
//	It resets the result object to an unshared empty object. It then
//	restores the interpreter's string result area to its default
//	initialized state, freeing up any memory that may have been allocated.
//	It also clears any error information for the interpreter.
//
//----------------------------------------------------------------------

func XTcl_ResetResult(tls *libc.TLS, interp uintptr) { /* tclResult.c:919:1: */
	var iPtr uintptr = interp

	sResetObjResult(tls, iPtr)
	if (*Interp)(unsafe.Pointer(iPtr)).FfreeProc != uintptr(0) {
		if (*Interp)(unsafe.Pointer(iPtr)).FfreeProc == uintptr(3) {
			XTclpFree(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
		} else {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Interp)(unsafe.Pointer(iPtr)).FfreeProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
		}
		(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = uintptr(0)
	}
	(*Interp)(unsafe.Pointer(iPtr)).Fresult = iPtr + 472 /* &.resultSpace */
	*(*int8)(unsafe.Pointer(iPtr + 472)) = int8(0)
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorCode != 0 {
		// Legacy support
		if (*Interp)(unsafe.Pointer(iPtr)).Fflags&ERR_LEGACY_COPY != 0 {
			XTcl_ObjSetVar2(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FecVar, uintptr(0),
				(*Interp)(unsafe.Pointer(iPtr)).FerrorCode, TCL_GLOBAL_ONLY)
		}
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorCode
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Interp)(unsafe.Pointer(iPtr)).FerrorCode = uintptr(0)
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo != 0 {
		// Legacy support
		if (*Interp)(unsafe.Pointer(iPtr)).Fflags&ERR_LEGACY_COPY != 0 {
			XTcl_ObjSetVar2(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FeiVar, uintptr(0),
				(*Interp)(unsafe.Pointer(iPtr)).FerrorInfo, TCL_GLOBAL_ONLY)
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Interp)(unsafe.Pointer(iPtr)).FerrorInfo = uintptr(0)
	}
	(*Interp)(unsafe.Pointer(iPtr)).FresetErrorStack = 1
	(*Interp)(unsafe.Pointer(iPtr)).FreturnLevel = 1
	(*Interp)(unsafe.Pointer(iPtr)).FreturnCode = TCL_OK
	if (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts != 0 {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*Interp)(unsafe.Pointer(iPtr)).FreturnOpts = uintptr(0)
	}
	*(*int32)(unsafe.Pointer(iPtr + 424)) &= libc.CplInt32(ERR_ALREADY_LOGGED | ERR_LEGACY_COPY)
}

//----------------------------------------------------------------------
//
// ResetObjResult --
//
//	Function used to reset an interpreter's Tcl result object.
//
// Results:
//	None.
//
// Side effects:
//	Resets the interpreter's result object to an unshared empty string
//	object with ref count one. It does not clear any error information in
//	the interpreter.
//
//----------------------------------------------------------------------

func sResetObjResult(tls *libc.TLS, iPtr uintptr) { /* tclResult.c:982:1: */
	var objResultPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr

	if (*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount > 1 {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, objResultPtr)
					} else {
						*(*uintptr)(unsafe.Pointer(objResultPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objResultPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, objResultPtr)
			}
		}

		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				objResultPtr = XTclThreadAllocObj(tls)
			} else {
				objResultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objResultPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr = uintptr(0)
		{
		}

		(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FrefCount++
		(*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr = objResultPtr
	} else {
		if (*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes != XtclEmptyStringRep {
			if (*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes != 0 {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).Flength = 0
		}
		if (*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objResultPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(objResultPtr)).FtypePtr = uintptr(0)
		}

	}
}

//----------------------------------------------------------------------
//
// Tcl_SetErrorCodeVA --
//
//	This function is called to record machine-readable information about
//	an error that is about to be returned.
//
// Results:
//	None.
//
// Side effects:
//	The errorCode field of the interp is modified to hold all of the
//	arguments to this function, in a list form with each argument becoming
//	one element of the list.
//
//----------------------------------------------------------------------

func XTcl_SetErrorCodeVA(tls *libc.TLS, interp uintptr, argList Va_list) { /* tclResult.c:1025:1: */
	var errorObj uintptr = XTcl_NewObj(tls)

	// Scan through the arguments one at a time, appending them to the
	// errorCode field as list elements.

	for 1 != 0 {
		var elem uintptr = libc.VaUintptr(&argList)

		if elem == uintptr(0) {
			break
		}
		XTcl_ListObjAppendElement(tls, uintptr(0), errorObj, XTcl_NewStringObj(tls, elem, -1))
	}
	XTcl_SetObjErrorCode(tls, interp, errorObj)
}

//----------------------------------------------------------------------
//
// Tcl_SetErrorCode --
//
//	This function is called to record machine-readable information about
//	an error that is about to be returned.
//
// Results:
//	None.
//
// Side effects:
//	The errorCode field of the interp is modified to hold all of the
//	arguments to this function, in a list form with each argument becoming
//	one element of the list.
//
//----------------------------------------------------------------------

func XTcl_SetErrorCode(tls *libc.TLS, interp uintptr, va uintptr) { /* tclResult.c:1067:1: */
	var argList Va_list
	_ = argList

	// Scan through the arguments one at a time, appending them to the
	// errorCode field as list elements.

	argList = va
	XTcl_SetErrorCodeVA(tls, interp, argList)
	_ = argList
}

//----------------------------------------------------------------------
//
// Tcl_SetObjErrorCode --
//
//	This function is called to record machine-readable information about
//	an error that is about to be returned. The caller should build a list
//	object up and pass it to this routine.
//
// Results:
//	None.
//
// Side effects:
//	The errorCode field of the interp is set to the new value.
//
//----------------------------------------------------------------------

func XTcl_SetObjErrorCode(tls *libc.TLS, interp uintptr, errorObjPtr uintptr) { /* tclResult.c:1101:1: */
	var iPtr uintptr = interp

	if (*Interp)(unsafe.Pointer(iPtr)).FerrorCode != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorCode
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FerrorCode = errorObjPtr
	(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorCode)).FrefCount++
}

//----------------------------------------------------------------------
//
// Tcl_GetErrorLine --
//
//      Returns the line number associated with the current error.
//
//----------------------------------------------------------------------

func XTcl_GetErrorLine(tls *libc.TLS, interp uintptr) int32 { /* tclResult.c:1126:1: */
	return (*Interp)(unsafe.Pointer(interp)).FerrorLine
}

//----------------------------------------------------------------------
//
// Tcl_SetErrorLine --
//
//      Sets the line number associated with the current error.
//
//----------------------------------------------------------------------

func XTcl_SetErrorLine(tls *libc.TLS, interp uintptr, value int32) { /* tclResult.c:1144:1: */
	(*Interp)(unsafe.Pointer(interp)).FerrorLine = value
}

//----------------------------------------------------------------------
//
// GetKeys --
//
//	Returns a Tcl_Obj * array of the standard keys used in the return
//	options dictionary.
//
//	Broadly sharing one copy of these key values helps with both memory
//	efficiency and dictionary lookup times.
//
// Results:
//	A Tcl_Obj * array.
//
// Side effects:
//	First time called in a thread, creates the keys (allocating memory)
//	and arranges for their cleanup at thread exit.
//
//----------------------------------------------------------------------

func sGetKeys(tls *libc.TLS) uintptr { /* tclResult.c:1172:16: */
	var keys uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&returnKeysKey)),
		int32(KEY_LAST*uint64(unsafe.Sizeof(uintptr(0)))))

	if *(*uintptr)(unsafe.Pointer(keys)) == uintptr(0) {
		// First call in this thread, create the keys...

		var i int32

		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(keys)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(keys)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys)))).Fbytes, ts+27354, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys)))).Fbytes + 5)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys)))).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys)))).FtypePtr = uintptr(0)
			{
			}
		}
		for ok2 := true; ok2; ok2 = 0 != 0 {
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(keys + 1*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(keys + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 1*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 1*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 1*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 1*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 1*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 1*8)))).Fbytes, ts+12045, uint64(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 1*8)))).Fbytes + 10)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 1*8)))).Flength = int32(uint64(unsafe.Sizeof([11]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 1*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		for ok4 := true; ok4; ok4 = 0 != 0 {
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(keys + 2*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(keys + 2*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 2*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 2*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 2*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 2*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 2*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 2*8)))).Fbytes, ts+12034, uint64(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 2*8)))).Fbytes + 10)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 2*8)))).Flength = int32(uint64(unsafe.Sizeof([11]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 2*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		for ok6 := true; ok6; ok6 = 0 != 0 {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(keys + 3*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(keys + 3*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 3*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 3*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 3*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 3*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 3*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 3*8)))).Fbytes, ts+63224, uint64(int32(uint64(unsafe.Sizeof([11]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 3*8)))).Fbytes + 10)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 3*8)))).Flength = int32(uint64(unsafe.Sizeof([11]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 3*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		for ok8 := true; ok8; ok8 = 0 != 0 {
			for ok9 := true; ok9; ok9 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(keys + 6*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(keys + 6*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 6*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 6*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 6*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 6*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 6*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 6*8)))).Fbytes, ts+63235, uint64(int32(uint64(unsafe.Sizeof([12]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 6*8)))).Fbytes + 11)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 6*8)))).Flength = int32(uint64(unsafe.Sizeof([12]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 6*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		for ok10 := true; ok10; ok10 = 0 != 0 {
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(keys + 4*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(keys + 4*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 4*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 4*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 4*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 4*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 4*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 4*8)))).Fbytes, ts+27316, uint64(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 4*8)))).Fbytes + 6)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 4*8)))).Flength = int32(uint64(unsafe.Sizeof([7]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 4*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		for ok12 := true; ok12; ok12 = 0 != 0 {
			for ok13 := true; ok13; ok13 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(keys + 5*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(keys + 5*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)))).Fbytes, ts+18772, uint64(int32(uint64(unsafe.Sizeof([9]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)))).Fbytes + 8)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)))).Flength = int32(uint64(unsafe.Sizeof([9]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)))).FtypePtr = uintptr(0)
			{
			}
		}

		for i = KEY_CODE; i < KEY_LAST; i++ {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + uintptr(i)*8)))).FrefCount++
		}

		// ... and arrange for their clenaup.

		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sReleaseKeys})), keys)
	}
	return keys
}

var returnKeysKey Tcl_ThreadDataKey /* tclResult.c:1175:30: */

//----------------------------------------------------------------------
//
// ReleaseKeys --
//
//	Called as a thread exit handler to cleanup return options dictionary
//	keys.
//
// Results:
//	None.
//
// Side effects:
//	Frees memory.
//
//----------------------------------------------------------------------

func sReleaseKeys(tls *libc.TLS, clientData ClientData) { /* tclResult.c:1225:1: */
	var keys uintptr = clientData
	var i int32

	for i = KEY_CODE; i < KEY_LAST; i++ {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(keys + uintptr(i)*8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		*(*uintptr)(unsafe.Pointer(keys + uintptr(i)*8)) = uintptr(0)
	}
}

//----------------------------------------------------------------------
//
// TclProcessReturn --
//
//	Does the work of the [return] command based on the code, level, and
//	returnOpts arguments. Note that the code argument must agree with the
//	-code entry in returnOpts and the level argument must agree with the
//	-level entry in returnOpts, as is the case for values returned from
//	TclMergeReturnOptions.
//
// Results:
//	Returns the return code the [return] command should return.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclProcessReturn(tls *libc.TLS, interp uintptr, code int32, level int32, returnOpts uintptr) int32 { /* tclResult.c:1258:1: */
	bp := tls.Alloc(44)
	defer tls.Free(44)

	var iPtr uintptr = interp
	// var valuePtr uintptr at bp+16, 8

	var keys uintptr = sGetKeys(tls)

	// Store the merged return options.

	if (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts != returnOpts {
		if (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts != 0 {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		(*Interp)(unsafe.Pointer(iPtr)).FreturnOpts = returnOpts
		(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FreturnOpts)).FrefCount++
	}

	if code == TCL_ERROR {
		if (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			(*Interp)(unsafe.Pointer(iPtr)).FerrorInfo = uintptr(0)
		}
		XTcl_DictObjGet(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts, *(*uintptr)(unsafe.Pointer(keys + 2*8)),
			bp+16)
		if *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0) {
			// var infoLen int32 at bp+24, 4

			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 {
				*(*int32)(unsafe.Pointer(bp + 24)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength
				_ = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes
			} else {
				XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+24)
			}
			if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
				(*Interp)(unsafe.Pointer(iPtr)).FerrorInfo = *(*uintptr)(unsafe.Pointer(bp + 16 /* valuePtr */))
				(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorInfo)).FrefCount++
				*(*int32)(unsafe.Pointer(iPtr + 424)) |= ERR_ALREADY_LOGGED
			}
		}
		XTcl_DictObjGet(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts, *(*uintptr)(unsafe.Pointer(keys + 6*8)),
			bp+16)
		if *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0) {
			// var len int32 at bp+40, 4

			// var valueObjc int32 at bp+28, 4

			// var valueObjv uintptr at bp+32, 8

			if (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FerrorStack)).FrefCount > 1 {
				var newObj uintptr

				newObj = XTcl_DuplicateObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FerrorStack)
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var _objPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FerrorStack
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(newObj)).FrefCount++
				(*Interp)(unsafe.Pointer(iPtr)).FerrorStack = newObj
			}

			// List extraction done after duplication to avoid moving the rug
			// if someone does [return -errorstack [info errorstack]]

			if XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+28,
				bp+32) == TCL_ERROR {
				return TCL_ERROR
			}
			(*Interp)(unsafe.Pointer(iPtr)).FresetErrorStack = 0
			XTcl_ListObjLength(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, bp+40)

			// Reset while keeping the list internalrep as much as possible.

			XTcl_ListObjReplace(tls, interp, (*Interp)(unsafe.Pointer(iPtr)).FerrorStack, 0, *(*int32)(unsafe.Pointer(bp + 40 /* len */)), *(*int32)(unsafe.Pointer(bp + 28 /* valueObjc */)),
				*(*uintptr)(unsafe.Pointer(bp + 32 /* valueObjv */)))
		}
		XTcl_DictObjGet(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts, *(*uintptr)(unsafe.Pointer(keys + 1*8)),
			bp+16)
		if *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0) {
			XTcl_SetObjErrorCode(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 16 /* valuePtr */)))
		} else {
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+8211, uintptr(0)))
		}

		XTcl_DictObjGet(tls, uintptr(0), (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts, *(*uintptr)(unsafe.Pointer(keys + 3*8)),
			bp+16)
		if *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
				*(*int32)(unsafe.Pointer(iPtr + 16)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32)))
			} else {
				XTcl_GetIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 16)), iPtr+16)
			}
		}
	}
	if level != 0 {
		(*Interp)(unsafe.Pointer(iPtr)).FreturnLevel = level
		(*Interp)(unsafe.Pointer(iPtr)).FreturnCode = code
		return TCL_RETURN
	}
	if code == TCL_ERROR {
		*(*int32)(unsafe.Pointer(iPtr + 424)) |= ERR_LEGACY_COPY
	}
	return code
}

//----------------------------------------------------------------------
//
// TclMergeReturnOptions --
//
//	Parses, checks, and stores the options to the [return] command.
//
// Results:
//	Returns TCL_ERROR if any of the option values are invalid. Otherwise,
//	returns TCL_OK, and writes the returnOpts, code, and level values to
//	the pointers provided.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclMergeReturnOptions(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, optionsPtrPtr uintptr, codePtr uintptr, levelPtr uintptr) int32 { /* tclResult.c:1375:1: */
	bp := tls.Alloc(276)
	defer tls.Free(276)

	// var code int32 at bp+260, 4

	// var level int32 at bp+264, 4

	// var valuePtr uintptr at bp+248, 8

	var returnOpts uintptr
	var keys uintptr
	// var search Tcl_DictSearch at bp+216, 24

	// var done int32 at bp+256, 4

	// var keyPtr uintptr at bp+240, 8

	var dict uintptr
	// var optLen int32 at bp+208, 4

	var opt uintptr
	// var compareLen int32 at bp+212, 4

	var compare uintptr
	// var length int32 at bp+268, 4

	// var length1 int32 at bp+272, 4

	var _objPtr uintptr
	var _objPtr1 uintptr
	*(*int32)(unsafe.Pointer(bp + 260 /* code */)) = TCL_OK
	*(*int32)(unsafe.Pointer(bp + 264 /* level */)) = 1
	returnOpts = XTcl_NewObj(tls)
	keys = sGetKeys(tls)

__1:
	if !(objc > 1) {
		goto __3
	}
	opt = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 208)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), bp+208)
	}()
	compare =
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)))).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(bp + 212)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)))).Flength
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keys + 5*8)))).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(keys + 5*8)), bp+212)
		}()

	if !(*(*int32)(unsafe.Pointer(bp + 208)) == *(*int32)(unsafe.Pointer(bp + 212)) && libc.Xmemcmp(tls, opt, compare, uint64(*(*int32)(unsafe.Pointer(bp + 208)))) == 0) {
		goto __4
	}
	*(*int32)(unsafe.Pointer(bp + 256 /* done */)) = 0
	dict = *(*uintptr)(unsafe.Pointer(objv + 1*8))

nestedOptions:
	if !(TCL_ERROR == XTcl_DictObjFirst(tls, uintptr(0), dict, bp+216,
		bp+240, bp+248, bp+256)) {
		goto __6
	}
	// Value is not a legal dictionary.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+63247,
		libc.VaList(bp, compare, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+39193, ts+63294,
		uintptr(0)))
	goto error
__6:
	;

__7:
	if !!(*(*int32)(unsafe.Pointer(bp + 256)) != 0) {
		goto __8
	}
	XTcl_DictObjPut(tls, uintptr(0), returnOpts, *(*uintptr)(unsafe.Pointer(bp + 240 /* keyPtr */)), *(*uintptr)(unsafe.Pointer(bp + 248 /* valuePtr */)))
	XTcl_DictObjNext(tls, bp+216, bp+240, bp+248, bp+256)
	goto __7
__8:
	;

	XTcl_DictObjGet(tls, uintptr(0), returnOpts, *(*uintptr)(unsafe.Pointer(keys + 5*8)), bp+248)
	if !(*(*uintptr)(unsafe.Pointer(bp + 248)) != uintptr(0)) {
		goto __9
	}
	dict = *(*uintptr)(unsafe.Pointer(bp + 248 /* valuePtr */))
	XTcl_DictObjRemove(tls, uintptr(0), returnOpts, *(*uintptr)(unsafe.Pointer(keys + 5*8)))
	goto nestedOptions
__9:
	;

	goto __5
__4:
	XTcl_DictObjPut(tls, uintptr(0), returnOpts, *(*uintptr)(unsafe.Pointer(objv)), *(*uintptr)(unsafe.Pointer(objv + 1*8)))
__5:
	;
	goto __2
__2:
	objv += 8 * uintptr(2)
	objc = objc - 2
	goto __1
	goto __3
__3:
	;

	// Check for bogus -code value.

	XTcl_DictObjGet(tls, uintptr(0), returnOpts, *(*uintptr)(unsafe.Pointer(keys)), bp+248)
	if !(*(*uintptr)(unsafe.Pointer(bp + 248)) != uintptr(0)) {
		goto __10
	}
	if !(XTclGetCompletionCodeFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 248)),
		bp+260) == TCL_ERROR) {
		goto __11
	}
	goto error
__11:
	;
	XTcl_DictObjRemove(tls, uintptr(0), returnOpts, *(*uintptr)(unsafe.Pointer(keys)))
__10:
	;

	// Check for bogus -level value.

	XTcl_DictObjGet(tls, uintptr(0), returnOpts, *(*uintptr)(unsafe.Pointer(keys + 4*8)), bp+248)
	if !(*(*uintptr)(unsafe.Pointer(bp + 248)) != uintptr(0)) {
		goto __12
	}
	if !(TCL_ERROR == func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 264)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 248)), bp+264)
	}() ||
		*(*int32)(unsafe.Pointer(bp + 264)) < 0) {
		goto __13
	}
	// Value is not a legal level.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+63310, libc.VaList(bp+48, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 248)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+3593, ts+39193, ts+63371, uintptr(0)))
	goto error
__13:
	;
	XTcl_DictObjRemove(tls, uintptr(0), returnOpts, *(*uintptr)(unsafe.Pointer(keys + 4*8)))
__12:
	;

	// Check for bogus -errorcode value.

	XTcl_DictObjGet(tls, uintptr(0), returnOpts, *(*uintptr)(unsafe.Pointer(keys + 1*8)), bp+248)
	if !(*(*uintptr)(unsafe.Pointer(bp + 248)) != uintptr(0)) {
		goto __14
	}

	if !(TCL_ERROR == XTcl_ListObjLength(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 248)), bp+268)) {
		goto __15
	}
	// Value is not a list, which is illegal for -errorcode.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+63385,
		libc.VaList(bp+88, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 248)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+39193, ts+63436,
		uintptr(0)))
	goto error
__15:
	;
__14:
	;

	// Check for bogus -errorstack value.

	XTcl_DictObjGet(tls, uintptr(0), returnOpts, *(*uintptr)(unsafe.Pointer(keys + 6*8)), bp+248)
	if !(*(*uintptr)(unsafe.Pointer(bp + 248)) != uintptr(0)) {
		goto __16
	}

	if !(TCL_ERROR == XTcl_ListObjLength(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 248)), bp+272)) {
		goto __17
	}
	// Value is not a list, which is illegal for -errorstack.

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+63454,
		libc.VaList(bp+128, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 248)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+136, ts+3593, ts+39193, ts+63506,
		uintptr(0)))
	goto error
__17:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 272))%2 != 0) {
		goto __18
	}
	// Errorstack must always be an even-sized list

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+63525,
		libc.VaList(bp+168, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 248)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 248)))
		}())))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, ts+3593, ts+39193,
		ts+63572, uintptr(0)))
	goto error
__18:
	;
__16:
	;

	// Convert [return -code return -level X] to [return -code ok -level X+1]

	if !(*(*int32)(unsafe.Pointer(bp + 260)) == TCL_RETURN) {
		goto __19
	}
	*(*int32)(unsafe.Pointer(bp + 264 /* level */))++
	*(*int32)(unsafe.Pointer(bp + 260 /* code */)) = TCL_OK
__19:
	;

	if !(codePtr != uintptr(0)) {
		goto __20
	}
	*(*int32)(unsafe.Pointer(codePtr)) = *(*int32)(unsafe.Pointer(bp + 260 /* code */))
__20:
	;
	if !(levelPtr != uintptr(0)) {
		goto __21
	}
	*(*int32)(unsafe.Pointer(levelPtr)) = *(*int32)(unsafe.Pointer(bp + 264 /* level */))
__21:
	;

	if !(optionsPtrPtr == uintptr(0)) {
		goto __22
	}
	// Not passing back the options (?!), so clean them up.

__24:
	_objPtr = returnOpts
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __27
	}
	XTclFreeObj(tls, _objPtr)
__27:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
	goto __23
__22:
	*(*uintptr)(unsafe.Pointer(optionsPtrPtr)) = returnOpts
__23:
	;
	return TCL_OK

error:
__28:
	_objPtr1 = returnOpts
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __31
	}
	XTclFreeObj(tls, _objPtr1)
__31:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	return TCL_ERROR
}

//-------------------------------------------------------------------------
//
// Tcl_GetReturnOptions --
//
//	Packs up the interp state into a dictionary of return options.
//
// Results:
//	A dictionary of return options.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func XTcl_GetReturnOptions(tls *libc.TLS, interp uintptr, result int32) uintptr { /* tclResult.c:1576:9: */
	var iPtr uintptr = interp
	var options uintptr
	var keys uintptr = sGetKeys(tls)

	if (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts != 0 {
		options = XTcl_DuplicateObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FreturnOpts)
	} else {
		options = XTcl_NewObj(tls)
	}

	if result == TCL_RETURN {
		XTcl_DictObjPut(tls, uintptr(0), options, *(*uintptr)(unsafe.Pointer(keys)),
			XTcl_NewIntObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FreturnCode))
		XTcl_DictObjPut(tls, uintptr(0), options, *(*uintptr)(unsafe.Pointer(keys + 4*8)),
			XTcl_NewIntObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FreturnLevel))
	} else {
		XTcl_DictObjPut(tls, uintptr(0), options, *(*uintptr)(unsafe.Pointer(keys)),
			XTcl_NewIntObj(tls, result))
		XTcl_DictObjPut(tls, uintptr(0), options, *(*uintptr)(unsafe.Pointer(keys + 4*8)),
			XTcl_NewIntObj(tls, 0))
	}

	if result == TCL_ERROR {
		XTcl_AddErrorInfo(tls, interp, ts+2046)
		XTcl_DictObjPut(tls, uintptr(0), options, *(*uintptr)(unsafe.Pointer(keys + 6*8)), (*Interp)(unsafe.Pointer(iPtr)).FerrorStack)
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorCode != 0 {
		XTcl_DictObjPut(tls, uintptr(0), options, *(*uintptr)(unsafe.Pointer(keys + 1*8)), (*Interp)(unsafe.Pointer(iPtr)).FerrorCode)
	}
	if (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo != 0 {
		XTcl_DictObjPut(tls, uintptr(0), options, *(*uintptr)(unsafe.Pointer(keys + 2*8)), (*Interp)(unsafe.Pointer(iPtr)).FerrorInfo)
		XTcl_DictObjPut(tls, uintptr(0), options, *(*uintptr)(unsafe.Pointer(keys + 3*8)),
			XTcl_NewIntObj(tls, (*Interp)(unsafe.Pointer(iPtr)).FerrorLine))
	}
	return options
}

//-------------------------------------------------------------------------
//
// TclNoErrorStack --
//
//	Removes the -errorstack entry from an options dict to avoid reference
//	cycles.
//
// Results:
//	The (unshared) argument options dict, modified in -place.
//
//-------------------------------------------------------------------------

func XTclNoErrorStack(tls *libc.TLS, interp uintptr, options uintptr) uintptr { /* tclResult.c:1632:9: */
	var keys uintptr = sGetKeys(tls)

	XTcl_DictObjRemove(tls, interp, options, *(*uintptr)(unsafe.Pointer(keys + 6*8)))
	return options
}

//-------------------------------------------------------------------------
//
// Tcl_SetReturnOptions --
//
//	Accepts an interp and a dictionary of return options, and sets the
//	return options of the interp to match the dictionary.
//
// Results:
//	A standard status code. Usually TCL_OK, but TCL_ERROR if an invalid
//	option value was found in the dictionary. If a -level value of 0 is in
//	the dictionary, then the -code value in the dictionary will be
//	returned (TCL_OK default).
//
// Side effects:
//	Sets the state of the interp.
//
//-------------------------------------------------------------------------

func XTcl_SetReturnOptions(tls *libc.TLS, interp uintptr, options uintptr) int32 { /* tclResult.c:1664:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	// var objc int32 at bp+48, 4

	// var level int32 at bp+68, 4

	// var code int32 at bp+64, 4

	// var objv uintptr at bp+40, 8

	// var mergedOpts uintptr at bp+56, 8

	(*Tcl_Obj)(unsafe.Pointer(options)).FrefCount++
	if TCL_ERROR == func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(options)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(options + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 48)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(options + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, options, bp+48, bp+40)
	}() ||
		*(*int32)(unsafe.Pointer(bp + 48))%2 != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+63596, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(options)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(options)).Fbytes
				}
				return XTcl_GetString(tls, options)
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+39193, ts+63294, uintptr(0)))
		*(*int32)(unsafe.Pointer(bp + 64 /* code */)) = TCL_ERROR
	} else if TCL_ERROR == XTclMergeReturnOptions(tls, interp, *(*int32)(unsafe.Pointer(bp + 48)), *(*uintptr)(unsafe.Pointer(bp + 40)),
		bp+56, bp+64, bp+68) {
		*(*int32)(unsafe.Pointer(bp + 64 /* code */)) = TCL_ERROR
	} else {
		*(*int32)(unsafe.Pointer(bp + 64 /* code */)) = XTclProcessReturn(tls, interp, *(*int32)(unsafe.Pointer(bp + 64 /* code */)), *(*int32)(unsafe.Pointer(bp + 68 /* level */)), *(*uintptr)(unsafe.Pointer(bp + 56 /* mergedOpts */)))
	}

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = options
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return *(*int32)(unsafe.Pointer(bp + 64 /* code */))
}

//-------------------------------------------------------------------------
//
// Tcl_TransferResult --
//
//	Transfer the result (and error information) from one interp to another.
//	Used when one interp has caused another interp to evaluate a script
//	and then wants to transfer the results back to itself.
//
// Results:
//	The result of targetInterp is set to the result read from sourceInterp.
//	The return options dictionary of sourceInterp is transferred to
//	targetInterp as appropriate for the return code value code.
//
// Side effects:
//	None.
//
//-------------------------------------------------------------------------

func XTcl_TransferResult(tls *libc.TLS, sourceInterp uintptr, code int32, targetInterp uintptr) { /* tclResult.c:1710:1: */
	var tiPtr uintptr = targetInterp
	var siPtr uintptr = sourceInterp

	if sourceInterp == targetInterp {
		return
	}

	if code == TCL_OK && (*Interp)(unsafe.Pointer(siPtr)).FreturnOpts == uintptr(0) {
		// Special optimization for the common case of normal command return
		// code and no explicit return options.

		if (*Interp)(unsafe.Pointer(tiPtr)).FreturnOpts != 0 {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = (*Interp)(unsafe.Pointer(tiPtr)).FreturnOpts
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			(*Interp)(unsafe.Pointer(tiPtr)).FreturnOpts = uintptr(0)
		}
	} else {
		XTcl_SetReturnOptions(tls, targetInterp,
			XTcl_GetReturnOptions(tls, sourceInterp, code))
		*(*int32)(unsafe.Pointer(tiPtr + 424)) &= libc.CplInt32(ERR_ALREADY_LOGGED)
	}
	XTcl_SetObjResult(tls, targetInterp, XTcl_GetObjResult(tls, sourceInterp))
	XTcl_ResetResult(tls, sourceInterp)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// indent-tabs-mode: nil
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Flag values used by Tcl_ScanObjCmd.

// The following structure contains the information associated with a
// character set.

type CharSet1 = struct {
	Fexclude     int32
	Fnchars      int32
	Fchars       uintptr
	Fnranges     int32
	F__ccgo_pad1 [4]byte
	Franges      uintptr
} /* tclScan.c:31:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Flag values used by Tcl_ScanObjCmd.

// The following structure contains the information associated with a
// character set.

type Range = struct {
	Fstart Tcl_UniChar
	Fend   Tcl_UniChar
} /* tclScan.c:31:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Flag values used by Tcl_ScanObjCmd.

// The following structure contains the information associated with a
// character set.

type CharSet = CharSet1 /* tclScan.c:40:3 */

//----------------------------------------------------------------------
//
// BuildCharSet --
//
//	This function examines a character set format specification and builds
//	a CharSet containing the individual characters and character ranges
//	specified.
//
// Results:
//	Returns the next format position.
//
// Side effects:
//	Initializes the charset.
//
//----------------------------------------------------------------------

func sBuildCharSet(tls *libc.TLS, cset uintptr, format uintptr) uintptr { /* tclScan.c:70:19: */
	bp := tls.Alloc(2)
	defer tls.Free(2)

	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)) = Tcl_UniChar(0)
	var start Tcl_UniChar
	var offset int32
	var nranges int32
	var end uintptr

	libc.Xmemset(tls, cset, 0, uint64(unsafe.Sizeof(CharSet{})))

	offset = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp)
	}()
	if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) == '^' {
		(*CharSet)(unsafe.Pointer(cset)).Fexclude = 1
		format += uintptr(offset)
		offset = func() int32 {
			if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
				return func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
					return 1
				}()
			}
			return XTcl_UtfToUniChar(tls, format, bp)
		}()
	}
	end = format + uintptr(offset)

	// Find the close bracket so we can overallocate the set.

	if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) == ']' {
		end += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(end)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(end))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, end, bp))
		}()
	}
	nranges = 0
	for int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) != ']' {
		if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) == '-' {
			nranges++
		}
		end += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(end)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(end))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, end, bp))
		}()
	}

	(*CharSet)(unsafe.Pointer(cset)).Fchars = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(Tcl_UniChar(0)))*uint64((int64(end)-int64(format))/1-int64(1))))
	if nranges > 0 {
		(*CharSet)(unsafe.Pointer(cset)).Franges = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(Range{}))*uint64(nranges)))
	} else {
		(*CharSet)(unsafe.Pointer(cset)).Franges = uintptr(0)
	}

	// Now build the character set.

	(*CharSet)(unsafe.Pointer(cset)).Fnchars = libc.AssignPtrInt32(cset+16, 0)
	format += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, format, bp))
	}()
	start = *(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */))
	if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) == ']' || int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) == '-' {
		*(*Tcl_UniChar)(unsafe.Pointer((*CharSet)(unsafe.Pointer(cset)).Fchars + uintptr(libc.PostIncInt32(&(*CharSet)(unsafe.Pointer(cset)).Fnchars, 1))*2)) = *(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */))
		format += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, format, bp))
		}()
	}
	for int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) != ']' {
		if int32(*(*int8)(unsafe.Pointer(format))) == '-' {
			// This may be the first character of a range, so don't add it
			// yet.

			start = *(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */))
		} else if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) == '-' {
			// Check to see if this is the last character in the set, in which
			// case it is not a range and we should add the previous character
			// as well as the dash.

			if int32(*(*int8)(unsafe.Pointer(format))) == ']' || !(int32((*CharSet)(unsafe.Pointer(cset)).Franges) != 0) {
				*(*Tcl_UniChar)(unsafe.Pointer((*CharSet)(unsafe.Pointer(cset)).Fchars + uintptr(libc.PostIncInt32(&(*CharSet)(unsafe.Pointer(cset)).Fnchars, 1))*2)) = start
				*(*Tcl_UniChar)(unsafe.Pointer((*CharSet)(unsafe.Pointer(cset)).Fchars + uintptr(libc.PostIncInt32(&(*CharSet)(unsafe.Pointer(cset)).Fnchars, 1))*2)) = *(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */))
			} else {
				format += func() uintptr {
					if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
						return uintptr(func() int32 {
							*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
							return 1
						}())
					}
					return uintptr(XTcl_UtfToUniChar(tls, format, bp))
				}()

				// Check to see if the range is in reverse order.

				if int32(start) < int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) {
					(*Range)(unsafe.Pointer((*CharSet)(unsafe.Pointer(cset)).Franges + uintptr((*CharSet)(unsafe.Pointer(cset)).Fnranges)*4)).Fstart = start
					(*Range)(unsafe.Pointer((*CharSet)(unsafe.Pointer(cset)).Franges + uintptr((*CharSet)(unsafe.Pointer(cset)).Fnranges)*4)).Fend = *(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */))
				} else {
					(*Range)(unsafe.Pointer((*CharSet)(unsafe.Pointer(cset)).Franges + uintptr((*CharSet)(unsafe.Pointer(cset)).Fnranges)*4)).Fstart = *(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */))
					(*Range)(unsafe.Pointer((*CharSet)(unsafe.Pointer(cset)).Franges + uintptr((*CharSet)(unsafe.Pointer(cset)).Fnranges)*4)).Fend = start
				}
				(*CharSet)(unsafe.Pointer(cset)).Fnranges++
			}
		} else {
			*(*Tcl_UniChar)(unsafe.Pointer((*CharSet)(unsafe.Pointer(cset)).Fchars + uintptr(libc.PostIncInt32(&(*CharSet)(unsafe.Pointer(cset)).Fnchars, 1))*2)) = *(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */))
		}
		format += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, format, bp))
		}()
	}
	return format
}

//----------------------------------------------------------------------
//
// CharInSet --
//
//	Check to see if a character matches the given set.
//
// Results:
//	Returns non-zero if the character matches the given set.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sCharInSet(tls *libc.TLS, cset uintptr, c int32) int32 { /* tclScan.c:181:1: */
	var ch Tcl_UniChar = Tcl_UniChar(c)
	var i int32
	var match int32 = 0

	for i = 0; i < (*CharSet)(unsafe.Pointer(cset)).Fnchars; i++ {
		if int32(*(*Tcl_UniChar)(unsafe.Pointer((*CharSet)(unsafe.Pointer(cset)).Fchars + uintptr(i)*2))) == int32(ch) {
			match = 1
			break
		}
	}
	if !(match != 0) {
		for i = 0; i < (*CharSet)(unsafe.Pointer(cset)).Fnranges; i++ {
			if int32((*Range)(unsafe.Pointer((*CharSet)(unsafe.Pointer(cset)).Franges+uintptr(i)*4)).Fstart) <= int32(ch) && int32(ch) <= int32((*Range)(unsafe.Pointer((*CharSet)(unsafe.Pointer(cset)).Franges+uintptr(i)*4)).Fend) {
				match = 1
				break
			}
		}
	}
	return func() int32 {
		if (*CharSet)(unsafe.Pointer(cset)).Fexclude != 0 {
			return libc.BoolInt32(!(match != 0))
		}
		return match
	}()
}

//----------------------------------------------------------------------
//
// ReleaseCharSet --
//
//	Free the storage associated with a character set.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sReleaseCharSet(tls *libc.TLS, cset uintptr) { /* tclScan.c:223:1: */
	XTclpFree(tls, (*CharSet)(unsafe.Pointer(cset)).Fchars)
	if (*CharSet)(unsafe.Pointer(cset)).Franges != 0 {
		XTclpFree(tls, (*CharSet)(unsafe.Pointer(cset)).Franges)
	}
}

//----------------------------------------------------------------------
//
// ValidateFormat --
//
//	Parse the format string and verify that it is properly formed and that
//	there are exactly enough variables on the command line.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	May place an error in the interpreter result.
//
//----------------------------------------------------------------------

func sValidateFormat(tls *libc.TLS, interp uintptr, format uintptr, numVars int32, totalSubs uintptr) int32 { /* tclScan.c:250:1: */
	bp := tls.Alloc(348)
	defer tls.Free(348)
	*(*uintptr)(unsafe.Pointer(bp + 336)) = format

	var gotXpg int32
	var gotSequential int32
	var value int32
	var i int32
	var flags int32
	// var end uintptr at bp+328, 8

	// var ch Tcl_UniChar at bp+320, 2

	var objIndex int32
	var xpgSize int32
	var nspace int32
	var nassign uintptr
	// var buf [4]int8 at bp+344, 4

	var errorMsg uintptr
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 320 /* ch */)) = Tcl_UniChar(0)
	nspace = numVars
	nassign = XTclStackAlloc(tls, interp, int32(uint64(nspace)*uint64(unsafe.Sizeof(int32(0)))))
	*(*[4]int8)(unsafe.Pointer(bp + 344 /* buf */)) = *(*[4]int8)(unsafe.Pointer(ts + 63623)) // Place to build an error messages. Note that
	// these are messy operations because we do
	// not want to use the formatting engine;
	// we're inside there!

	// Initialize an array that records the number of times a variable is
	// assigned to by the format string. We use this to detect if a variable
	// is multiply assigned or left unassigned.

	i = 0
__1:
	if !(i < nspace) {
		goto __3
	}
	*(*int32)(unsafe.Pointer(nassign + uintptr(i)*4)) = 0
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;

	xpgSize = libc.AssignInt32(&objIndex, libc.AssignInt32(&gotXpg, libc.AssignInt32(&gotSequential, 0)))

__4:
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))) != 0) {
		goto __5
	}
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 336)), bp+320))
	}()

	flags = 0

	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320))) != '%') {
		goto __6
	}
	goto __4
__6:
	;
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 336)), bp+320))
	}()
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320))) == '%') {
		goto __7
	}
	goto __4
__7:
	;
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320))) == '*') {
		goto __8
	}
	flags = flags | SCAN_SUPPRESS
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 336)), bp+320))
	}()
	goto xpgCheckDone
__8:
	;

	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320))) < 0x80 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)))))*2)))&int32(X_ISdigit) != 0) {
		goto __9
	} // INTL: "C" locale.
	// Check for an XPG3-style %n$ specification. Note: there must
	// not be a mixture of XPG3 specs and non-XPG3 specs in the same
	// format string.

	value = int32(libc.Xstrtoul(tls, *(*uintptr)(unsafe.Pointer(bp + 336))-uintptr(1), bp+328, 10)) // INTL: "C" locale.
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 328))))) != '$') {
		goto __10
	}
	goto notXpg
__10:
	;
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) = *(*uintptr)(unsafe.Pointer(bp + 328)) + uintptr(1)
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 336)), bp+320))
	}()
	gotXpg = 1
	if !(gotSequential != 0) {
		goto __11
	}
	goto mixedXPG
__11:
	;
	objIndex = value - 1
	if !(objIndex < 0 || numVars != 0 && objIndex >= numVars) {
		goto __12
	}
	goto badIndex
	goto __13
__12:
	if !(numVars == 0) {
		goto __14
	}
	// In the case where no vars are specified, the user can
	// specify %9999$ legally, so we have to consider special
	// rules for growing the assign array. 'value' is guaranteed
	// to be > 0.
	if xpgSize > value {
		xpgSize = xpgSize
	} else {
		xpgSize = value
	}
__14:
	;
__13:
	;
	goto xpgCheckDone
__9:
	;

notXpg:
	gotSequential = 1
	if !(gotXpg != 0) {
		goto __15
	}
mixedXPG:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+63627,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+63674, ts+63681, uintptr(0)))
	goto error
__15:
	;

xpgCheckDone:
	// Parse any width specifier.

	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320))) < 0x80 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)))))*2)))&int32(X_ISdigit) != 0) {
		goto __16
	} // INTL: "C" locale.
	value = int32(libc.Xstrtoul(tls, *(*uintptr)(unsafe.Pointer(bp + 336))-uintptr(1), bp+336, 10)) // INTL: "C" locale.
	flags = flags | SCAN_WIDTH
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 336)), bp+320))
	}()
__16:
	;

	// Handle any size specifier.

	switch int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320 /* ch */))) {
	case 'l':
		goto __18
		// FALLTHRU
	case 'L':
		goto __19
		// FALLTHRU
	case 'h':
		goto __20
	}
	goto __17
__18:
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))) == 'l') {
		goto __21
	}
	flags = flags | SCAN_BIG
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += uintptr(1)
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 336)), bp+320))
	}()
	goto __17
__21:
	;
	// FALLTHRU
__19:
	flags = flags | SCAN_LONGER
	// FALLTHRU
__20:
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 336)), bp+320))
	}()
__17:
	;

	if !(!(flags&SCAN_SUPPRESS != 0) && numVars != 0 && objIndex >= numVars) {
		goto __22
	}
	goto badIndex
__22:
	;

	// Handle the various field types.

	switch int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320 /* ch */))) {
	case 'c':
		goto __24
		// FALLTHRU
	case 'n':
		goto __25
	case 's':
		goto __26
		// Fall through!
	case 'd':
		goto __27
	case 'e':
		goto __28
	case 'E':
		goto __29
	case 'f':
		goto __30
	case 'g':
		goto __31
	case 'G':
		goto __32
	case 'i':
		goto __33
	case 'o':
		goto __34
	case 'x':
		goto __35
	case 'X':
		goto __36
	case 'b':
		goto __37
	case 'u':
		goto __38
		// Bracket terms need special checking
	case '[':
		goto __39
	default:
		goto __40
	}
	goto __23
__24:
	if !(flags&SCAN_WIDTH != 0) {
		goto __41
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+63696,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+63674, ts+63746, uintptr(0)))
	goto error
__41:
	;
	// FALLTHRU
__25:
__26:
	if !(flags&(SCAN_LONGER|SCAN_BIG) != 0) {
		goto __42
	}
invalidFieldSize:
	*(*int8)(unsafe.Pointer(bp + 344 + uintptr(XTcl_UniCharToUtf(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320 /* ch */))), bp+344)))) = int8(0)
	errorMsg = XTcl_NewStringObj(tls,
		ts+63755, -1)
	XTcl_AppendToObj(tls, errorMsg, bp+344, -1)
	XTcl_AppendToObj(tls, errorMsg, ts+63801, -1)
	XTcl_SetObjResult(tls, interp, errorMsg)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+63674, ts+63813, uintptr(0)))
	goto error
__42:
	;
	// Fall through!
__27:
__28:
__29:
__30:
__31:
__32:
__33:
__34:
__35:
__36:
__37:
	goto __23
__38:
	if !(flags&SCAN_BIG != 0) {
		goto __43
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+63821, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+63674, ts+63855, uintptr(0)))
	goto error
__43:
	;
	goto __23
	// Bracket terms need special checking
__39:
	if !(flags&(SCAN_LONGER|SCAN_BIG) != 0) {
		goto __44
	}
	goto invalidFieldSize
__44:
	;
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))) == 0) {
		goto __45
	}
	goto badSet
__45:
	;
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 336)), bp+320))
	}()
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320))) == '^') {
		goto __46
	}
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))) == 0) {
		goto __47
	}
	goto badSet
__47:
	;
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 336)), bp+320))
	}()
__46:
	;
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320))) == ']') {
		goto __48
	}
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))) == 0) {
		goto __49
	}
	goto badSet
__49:
	;
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 336)), bp+320))
	}()
__48:
	;
__50:
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320))) != ']') {
		goto __51
	}
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))) == 0) {
		goto __52
	}
	goto badSet
__52:
	;
	*(*uintptr)(unsafe.Pointer(bp + 336 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 320)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 336))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 336)), bp+320))
	}()
	goto __50
__51:
	;
	goto __23
badSet:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+63867, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+128, ts+3593, ts+63674, ts+63896, uintptr(0)))
	goto error
__40:
	*(*int8)(unsafe.Pointer(bp + 344 + uintptr(XTcl_UniCharToUtf(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 320 /* ch */))), bp+344)))) = int8(0)
	errorMsg = XTcl_NewStringObj(tls,
		ts+63904, -1)
	XTcl_AppendToObj(tls, errorMsg, bp+344, -1)
	XTcl_AppendToObj(tls, errorMsg, ts+25027, -1)
	XTcl_SetObjResult(tls, interp, errorMsg)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+160, ts+3593, ts+63674, ts+63936, uintptr(0)))
	goto error
__23:
	;
	if !!(flags&SCAN_SUPPRESS != 0) {
		goto __53
	}
	if !(objIndex >= nspace) {
		goto __54
	}
	// Expand the nassign buffer. If we are using XPG specifiers,
	// make sure that we grow to a large enough size. xpgSize is
	// guaranteed to be at least one larger than objIndex.

	value = nspace
	if !(xpgSize != 0) {
		goto __55
	}
	nspace = xpgSize
	goto __56
__55:
	nspace = nspace + 16 // formerly STATIC_LIST_SIZE
__56:
	;
	nassign = XTclStackRealloc(tls, interp, nassign,
		int32(uint64(nspace)*uint64(unsafe.Sizeof(int32(0)))))
	i = value
__57:
	if !(i < nspace) {
		goto __59
	}
	*(*int32)(unsafe.Pointer(nassign + uintptr(i)*4)) = 0
	goto __58
__58:
	i++
	goto __57
	goto __59
__59:
	;
__54:
	;
	*(*int32)(unsafe.Pointer(nassign + uintptr(objIndex)*4))++
	objIndex++
__53:
	;
	goto __4
__5:
	;

	// Verify that all of the variable were assigned exactly once.

	if !(numVars == 0) {
		goto __60
	}
	if !(xpgSize != 0) {
		goto __61
	}
	numVars = xpgSize
	goto __62
__61:
	numVars = objIndex
__62:
	;
__60:
	;
	if !(totalSubs != 0) {
		goto __63
	}
	*(*int32)(unsafe.Pointer(totalSubs)) = numVars
__63:
	;
	i = 0
__64:
	if !(i < numVars) {
		goto __66
	}
	if !(*(*int32)(unsafe.Pointer(nassign + uintptr(i)*4)) > 1) {
		goto __67
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+63944,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+192, ts+3593, ts+63674, ts+64005, uintptr(0)))
	goto error
	goto __68
__67:
	if !(!(xpgSize != 0) && *(*int32)(unsafe.Pointer(nassign + uintptr(i)*4)) == 0) {
		goto __69
	}
	// If the space is empty, and xpgSize is 0 (means XPG wasn't used,
	// and/or numVars != 0), then too many vars were given

	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+64018,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+224, ts+3593, ts+63674, ts+64072, uintptr(0)))
	goto error
__69:
	;
__68:
	;
	goto __65
__65:
	i++
	goto __64
	goto __66
__66:
	;

	XTclStackFree(tls, interp, nassign)
	return TCL_OK

badIndex:
	if !(gotXpg != 0) {
		goto __70
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+64083, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+256, ts+3593, ts+63674, ts+64117, uintptr(0)))
	goto __71
__70:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+64128,
		-1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+288, ts+3593, ts+63674, ts+64185, uintptr(0)))
__71:
	;

error:
	XTclStackFree(tls, interp, nassign)
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_ScanObjCmd --
//
//	This function is invoked to process the "scan" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_ScanObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclScan.c:571:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	// var format uintptr at bp+16, 8

	var numVars int32
	var nconversions int32
	// var totalVars int32 at bp, 4

	var objIndex int32
	var offset int32
	// var i int32 at bp+56, 4

	var result int32
	var code int32
	// var value int64 at bp+104, 8

	var string uintptr
	// var end uintptr at bp+64, 8

	var baseString uintptr
	var op int8
	var width int32
	var underflow int32
	// var wideValue Tcl_WideInt at bp+72, 8

	// var ch Tcl_UniChar at bp+4, 2

	// var sch Tcl_UniChar at bp+6, 2

	var objs uintptr
	var objPtr uintptr
	var flags int32 // INTL: "C" locale.
	// var formatEnd uintptr at bp+8, 8

	var cachePtr uintptr
	// var cset CharSet at bp+24, 32

	var cachePtr1 uintptr
	var _objPtr uintptr
	var _objPtr1 uintptr
	// var big Mp_int at bp+80, 24

	// var big1 Mp_int at bp+112, 24

	var _objPtr2 uintptr
	var _objPtr3 uintptr
	var _objPtr4 uintptr
	// var dvalue float64 at bp+136, 8

	var parseFlag int32
	var _objPtr5 uintptr
	var cachePtr2 uintptr
	var _objPtr6 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	*(*int32)(unsafe.Pointer(bp /* totalVars */)) = -1
	op = int8(0)
	underflow = 0
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */)) = Tcl_UniChar(0)
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 6 /* sch */)) = Tcl_UniChar(0)
	objs = uintptr(0)
	objPtr = uintptr(0)

	if !(objc < 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv,
		ts+64202)
	return TCL_ERROR
__1:
	;

	*(*uintptr)(unsafe.Pointer(bp + 16 /* format */)) = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	numVars = objc - 3

	// Check for errors in the format string.

	if !(sValidateFormat(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 16)), numVars, bp) == TCL_ERROR) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	// Allocate space for the result objects.

	if !(*(*int32)(unsafe.Pointer(bp)) > 0) {
		goto __3
	}
	objs = XTcl_Alloc(tls, uint32(uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp)))))
	*(*int32)(unsafe.Pointer(bp + 56 /* i */)) = 0
__4:
	if !(*(*int32)(unsafe.Pointer(bp + 56)) < *(*int32)(unsafe.Pointer(bp))) {
		goto __6
	}
	*(*uintptr)(unsafe.Pointer(objs + uintptr(*(*int32)(unsafe.Pointer(bp + 56 /* i */)))*8)) = uintptr(0)
	goto __5
__5:
	*(*int32)(unsafe.Pointer(bp + 56 /* i */))++
	goto __4
	goto __6
__6:
	;
__3:
	;

	string = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	baseString = string

	// Iterate over the format string filling in the result objects until we
	// reach the end of input, the end of the format string, or there is a
	// mismatch.

	objIndex = 0
	nconversions = 0
__7:
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))) != 0) {
		goto __8
	}
	parseFlag = TCL_PARSE_NO_WHITESPACE
	*(*uintptr)(unsafe.Pointer(bp + 16 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+4))
	}()

	flags = 0

	// If we see whitespace in the format, skip whitespace in the string.

	if !(XTcl_UniCharIsSpace(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)))) != 0) {
		goto __9
	}
	offset = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(string)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 6)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(string))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, string, bp+6)
	}()
__10:
	if !(XTcl_UniCharIsSpace(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 6)))) != 0) {
		goto __11
	}
	if !(int32(*(*int8)(unsafe.Pointer(string))) == 0) {
		goto __12
	}
	goto done
__12:
	;
	string += uintptr(offset)
	offset = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(string)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 6)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(string))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, string, bp+6)
	}()
	goto __10
__11:
	;
	goto __7
__9:
	;

	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4))) != '%') {
		goto __13
	}
literal:
	if !(int32(*(*int8)(unsafe.Pointer(string))) == 0) {
		goto __14
	}
	underflow = 1
	goto done
__14:
	;
	string += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(string)))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 6)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(string))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, string, bp+6))
	}()
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4))) != int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 6)))) {
		goto __15
	}
	goto done
__15:
	;
	goto __7
__13:
	;

	*(*uintptr)(unsafe.Pointer(bp + 16 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+4))
	}()
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4))) == '%') {
		goto __16
	}
	goto literal
__16:
	;

	// Check for assignment suppression ('*') or an XPG3-style assignment
	// ('%n$').

	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4))) == '*') {
		goto __17
	}
	flags = flags | SCAN_SUPPRESS
	*(*uintptr)(unsafe.Pointer(bp + 16 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+4))
	}()
	goto __18
__17:
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4))) < 0x80 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)))))*2)))&int32(X_ISdigit) != 0) {
		goto __19
	}
	*(*int64)(unsafe.Pointer(bp + 104 /* value */)) = int64(libc.Xstrtoul(tls, *(*uintptr)(unsafe.Pointer(bp + 16))-uintptr(1), bp+8, 10)) // INTL: "C" locale.
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) == '$') {
		goto __20
	}
	*(*uintptr)(unsafe.Pointer(bp + 16 /* format */)) = *(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(1)
	*(*uintptr)(unsafe.Pointer(bp + 16 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+4))
	}()
	objIndex = int32(*(*int64)(unsafe.Pointer(bp + 104))) - 1
__20:
	;
__19:
	;
__18:
	;

	// Parse any width specifier.

	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4))) < 0x80 && int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)))))*2)))&int32(X_ISdigit) != 0) {
		goto __21
	} // INTL: "C" locale.
	width = int32(libc.Xstrtoul(tls, *(*uintptr)(unsafe.Pointer(bp + 16))-uintptr(1), bp+16, 10)) // INTL: "C" locale.
	*(*uintptr)(unsafe.Pointer(bp + 16 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+4))
	}()
	goto __22
__21:
	width = 0
__22:
	;

	// Handle any size specifier.

	switch int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */))) {
	case 'l':
		goto __24
		// FALLTHRU
	case 'L':
		goto __25
		// FALLTHRU
	case 'h':
		goto __26
	}
	goto __23
__24:
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))) == 'l') {
		goto __27
	}
	flags = flags | SCAN_BIG
	*(*uintptr)(unsafe.Pointer(bp + 16 /* format */)) += uintptr(1)
	*(*uintptr)(unsafe.Pointer(bp + 16 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+4))
	}()
	goto __23
__27:
	;
	// FALLTHRU
__25:
	flags = flags | SCAN_LONGER
	// FALLTHRU
__26:
	*(*uintptr)(unsafe.Pointer(bp + 16 /* format */)) += func() uintptr {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))))) < 0x80 {
			return uintptr(func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))))
				return 1
			}())
		}
		return uintptr(XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+4))
	}()
__23:
	;

	// Handle the various field types.

	switch int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */))) {
	case 'n':
		goto __29

	case 'd':
		goto __30
	case 'i':
		goto __31
	case 'o':
		goto __32
	case 'x':
		goto __33
	case 'X':
		goto __34
	case 'b':
		goto __35
	case 'u':
		goto __36

	case 'f':
		goto __37
	case 'e':
		goto __38
	case 'E':
		goto __39
	case 'g':
		goto __40
	case 'G':
		goto __41

	case 's':
		goto __42

	case 'c':
		goto __43
	case '[':
		goto __44
	}
	goto __28
__29:
	if !!(flags&SCAN_SUPPRESS != 0) {
		goto __45
	}
__46:
	;
__49:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __52
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __53
__52:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__53:
	;
	goto __50
__50:
	if 0 != 0 {
		goto __49
	}
	goto __51
__51:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objPtr + 32)) = (int64(string) - int64(baseString)) / 1
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __47
__47:
	if 0 != 0 {
		goto __46
	}
	goto __48
__48:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++

	*(*uintptr)(unsafe.Pointer(objs + uintptr(libc.PostIncInt32(&objIndex, 1))*8)) = objPtr
__45:
	;
	nconversions++
	goto __7

__30:
	op = int8('i')
	parseFlag = parseFlag | TCL_PARSE_DECIMAL_ONLY
	goto __28
__31:
	op = int8('i')
	parseFlag = parseFlag | TCL_PARSE_SCAN_PREFIXES
	goto __28
__32:
	op = int8('i')
	parseFlag = parseFlag | (TCL_PARSE_OCTAL_ONLY | TCL_PARSE_SCAN_PREFIXES)
	goto __28
__33:
__34:
	op = int8('i')
	parseFlag = parseFlag | TCL_PARSE_HEXADECIMAL_ONLY
	goto __28
__35:
	op = int8('i')
	parseFlag = parseFlag | TCL_PARSE_BINARY_ONLY
	goto __28
__36:
	op = int8('i')
	parseFlag = parseFlag | TCL_PARSE_DECIMAL_ONLY
	flags = flags | SCAN_UNSIGNED
	goto __28

__37:
__38:
__39:
__40:
__41:
	op = int8('f')
	goto __28

__42:
	op = int8('s')
	goto __28

__43:
	op = int8('c')
	flags = flags | SCAN_NOSKIP
	goto __28
__44:
	op = int8('[')
	flags = flags | SCAN_NOSKIP
	goto __28
__28:
	;

	// At this point, we will need additional characters from the string
	// to proceed.

	if !(int32(*(*int8)(unsafe.Pointer(string))) == 0) {
		goto __54
	}
	underflow = 1
	goto done
__54:
	;

	// Skip any leading whitespace at the beginning of a field unless the
	// format suppresses this behavior.

	if !!(flags&SCAN_NOSKIP != 0) {
		goto __55
	}
__56:
	if !(int32(*(*int8)(unsafe.Pointer(string))) != 0) {
		goto __57
	}
	offset = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(string)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 6)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(string))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, string, bp+6)
	}()
	if !!(XTcl_UniCharIsSpace(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 6)))) != 0) {
		goto __58
	}
	goto __57
__58:
	;
	string += uintptr(offset)
	goto __56
__57:
	;
	if !(int32(*(*int8)(unsafe.Pointer(string))) == 0) {
		goto __59
	}
	underflow = 1
	goto done
__59:
	;
__55:
	;

	// Perform the requested scanning operation.

	switch int32(op) {
	case 's':
		goto __61

	case '[':
		goto __62
	case 'c':
		goto __63

	case 'i':
		goto __64

	case 'f':
		goto __65
	}
	goto __60
__61:
	// Scan a string up to width characters or whitespace.

	if !(width == 0) {
		goto __66
	}
	width = libc.CplInt32(0)
__66:
	;
	*(*uintptr)(unsafe.Pointer(bp + 64 /* end */)) = string
__67:
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64))))) != 0) {
		goto __68
	}
	offset = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 6)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64))))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), bp+6)
	}()
	if !(XTcl_UniCharIsSpace(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 6)))) != 0) {
		goto __69
	}
	goto __68
__69:
	;
	*(*uintptr)(unsafe.Pointer(bp + 64 /* end */)) += uintptr(offset)
	if !(libc.PreDecInt32(&width, 1) == 0) {
		goto __70
	}
	goto __68
__70:
	;
	goto __67
__68:
	;
	if !!(flags&SCAN_SUPPRESS != 0) {
		goto __71
	}
	objPtr = XTcl_NewStringObj(tls, string, int32((int64(*(*uintptr)(unsafe.Pointer(bp + 64)))-int64(string))/1))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++

	*(*uintptr)(unsafe.Pointer(objs + uintptr(libc.PostIncInt32(&objIndex, 1))*8)) = objPtr
__71:
	;
	string = *(*uintptr)(unsafe.Pointer(bp + 64 /* end */))
	goto __60

__62:

	if !(width == 0) {
		goto __72
	}
	width = libc.CplInt32(0)
__72:
	;
	*(*uintptr)(unsafe.Pointer(bp + 64 /* end */)) = string

	*(*uintptr)(unsafe.Pointer(bp + 16 /* format */)) = sBuildCharSet(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 16 /* format */)))
__73:
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64))))) != 0) {
		goto __74
	}
	offset = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 6)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64))))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), bp+6)
	}()
	if !!(sCharInSet(tls, bp+24, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 6)))) != 0) {
		goto __75
	}
	goto __74
__75:
	;
	*(*uintptr)(unsafe.Pointer(bp + 64 /* end */)) += uintptr(offset)
	if !(libc.PreDecInt32(&width, 1) == 0) {
		goto __76
	}
	goto __74
__76:
	;
	goto __73
__74:
	;
	sReleaseCharSet(tls, bp+24)

	if !(string == *(*uintptr)(unsafe.Pointer(bp + 64))) {
		goto __77
	}
	// Nothing matched the range, stop processing.
	goto done
__77:
	;
	if !!(flags&SCAN_SUPPRESS != 0) {
		goto __78
	}
	objPtr = XTcl_NewStringObj(tls, string, int32((int64(*(*uintptr)(unsafe.Pointer(bp + 64)))-int64(string))/1))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	*(*uintptr)(unsafe.Pointer(objs + uintptr(libc.PostIncInt32(&objIndex, 1))*8)) = objPtr
__78:
	;
	string = *(*uintptr)(unsafe.Pointer(bp + 64 /* end */))

	goto __60

__63:
	// Scan a single Unicode character.

	offset = XTclUtfToUCS4(tls, string, bp+56)
	string += uintptr(offset)
	if !!(flags&SCAN_SUPPRESS != 0) {
		goto __79
	}
__80:
	;
__83:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __86
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __87
__86:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__87:
	;
	goto __84
__84:
	if 0 != 0 {
		goto __83
	}
	goto __85
__85:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(*(*int32)(unsafe.Pointer(bp + 56)))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __81
__81:
	if 0 != 0 {
		goto __80
	}
	goto __82
__82:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++

	*(*uintptr)(unsafe.Pointer(objs + uintptr(libc.PostIncInt32(&objIndex, 1))*8)) = objPtr
__79:
	;
	goto __60

__64:
	// Scan an unsigned or signed integer.
	objPtr = XTcl_NewLongObj(tls, int64(0))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	if !(width == 0) {
		goto __88
	}
	width = libc.CplInt32(0)
__88:
	;
	if !(TCL_OK != XTclParseNumber(tls, uintptr(0), objPtr, uintptr(0), string, width,
		bp+64, TCL_PARSE_INTEGER_ONLY|parseFlag)) {
		goto __89
	}
__90:
	_objPtr = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __93
	}
	XTclFreeObj(tls, _objPtr)
__93:
	;
	goto __91
__91:
	if 0 != 0 {
		goto __90
	}
	goto __92
__92:
	;
	if !(width < 0) {
		goto __94
	}
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64))))) == 0) {
		goto __96
	}
	underflow = 1
__96:
	;
	goto __95
__94:
	if !(*(*uintptr)(unsafe.Pointer(bp + 64)) == string+uintptr(width)) {
		goto __97
	}
	underflow = 1
__97:
	;
__95:
	;
	goto done
__89:
	;
	string = *(*uintptr)(unsafe.Pointer(bp + 64 /* end */))
	if !(flags&SCAN_SUPPRESS != 0) {
		goto __98
	}
__99:
	_objPtr1 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __102
	}
	XTclFreeObj(tls, _objPtr1)
__102:
	;
	goto __100
__100:
	if 0 != 0 {
		goto __99
	}
	goto __101
__101:
	;
	goto __60
__98:
	;
	if !(flags&SCAN_LONGER != 0) {
		goto __103
	}
	if !(XTcl_GetWideIntFromObj(tls, uintptr(0), objPtr, bp+72) != TCL_OK) {
		goto __105
	}
	*(*Tcl_WideInt)(unsafe.Pointer(bp + 72 /* wideValue */)) = int64(Tcl_WideUInt(libc.CplUint64(uint64(0))) >> 1) // WIDE_MAX
	if !(int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()))) == '-') {
		goto __106
	}
	*(*Tcl_WideInt)(unsafe.Pointer(bp + 72 /* wideValue */))++ // WIDE_MAX + 1 = WIDE_MIN
__106:
	;
__105:
	;
	if !(flags&SCAN_UNSIGNED != 0 && *(*Tcl_WideInt)(unsafe.Pointer(bp + 72)) < int64(0)) {
		goto __107
	}
	XTclBNInitBignumFromWideUInt(tls, bp+80, Tcl_WideUInt(*(*Tcl_WideInt)(unsafe.Pointer(bp + 72 /* wideValue */))))
	XTcl_SetBignumObj(tls, objPtr, bp+80)
	goto __108
__107:
	XTcl_SetWideIntObj(tls, objPtr, *(*Tcl_WideInt)(unsafe.Pointer(bp + 72 /* wideValue */)))
__108:
	;
	goto __104
__103:
	if !!(flags&SCAN_BIG != 0) {
		goto __109
	}
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int64)(unsafe.Pointer(bp + 104)) = *(*int64)(unsafe.Pointer(objPtr + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetLongFromObj(tls, uintptr(0), objPtr, bp+104)
	}() != TCL_OK) {
		goto __110
	}
	if !(int32(*(*int8)(unsafe.Pointer(func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()))) == '-') {
		goto __111
	}
	*(*int64)(unsafe.Pointer(bp + 104 /* value */)) = -0x7fffffffffffffff - 1
	goto __112
__111:
	*(*int64)(unsafe.Pointer(bp + 104 /* value */)) = 0x7fffffffffffffff
__112:
	;
__110:
	;
	if !(flags&SCAN_UNSIGNED != 0 && *(*int64)(unsafe.Pointer(bp + 104)) < int64(0)) {
		goto __113
	}
	XTclBNInitBignumFromWideUInt(tls, bp+112, uint64(*(*int64)(unsafe.Pointer(bp + 104 /* value */))))
	XTcl_SetBignumObj(tls, objPtr, bp+112)
	goto __114
__113:
	XTcl_SetLongObj(tls, objPtr, *(*int64)(unsafe.Pointer(bp + 104 /* value */)))
__114:
	;
__109:
	;
__104:
	;
	*(*uintptr)(unsafe.Pointer(objs + uintptr(libc.PostIncInt32(&objIndex, 1))*8)) = objPtr
	goto __60

__65:
	// Scan a floating point number

	objPtr = XTcl_NewDoubleObj(tls, 0.0)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	if !(width == 0) {
		goto __115
	}
	width = libc.CplInt32(0)
__115:
	;
	if !(TCL_OK != XTclParseNumber(tls, uintptr(0), objPtr, uintptr(0), string, width,
		bp+64, TCL_PARSE_DECIMAL_ONLY|TCL_PARSE_NO_WHITESPACE)) {
		goto __116
	}
__118:
	_objPtr2 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __121
	}
	XTclFreeObj(tls, _objPtr2)
__121:
	;
	goto __119
__119:
	if 0 != 0 {
		goto __118
	}
	goto __120
__120:
	;
	if !(width < 0) {
		goto __122
	}
	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64))))) == 0) {
		goto __124
	}
	underflow = 1
__124:
	;
	goto __123
__122:
	if !(*(*uintptr)(unsafe.Pointer(bp + 64)) == string+uintptr(width)) {
		goto __125
	}
	underflow = 1
__125:
	;
__123:
	;
	goto done
	goto __117
__116:
	if !(flags&SCAN_SUPPRESS != 0) {
		goto __126
	}
__128:
	_objPtr3 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __131
	}
	XTclFreeObj(tls, _objPtr3)
__131:
	;
	goto __129
__129:
	if 0 != 0 {
		goto __128
	}
	goto __130
__130:
	;
	string = *(*uintptr)(unsafe.Pointer(bp + 64 /* end */))
	goto __127
__126:
	if !(XTcl_GetDoubleFromObj(tls, uintptr(0), objPtr, bp+136) != TCL_OK) {
		goto __132
	}

__133:
	_objPtr4 = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __136
	}
	XTclFreeObj(tls, _objPtr4)
__136:
	;
	goto __134
__134:
	if 0 != 0 {
		goto __133
	}
	goto __135
__135:
	;
	goto done

__132:
	;
	XTcl_SetDoubleObj(tls, objPtr, *(*float64)(unsafe.Pointer(bp + 136 /* dvalue */)))

	*(*uintptr)(unsafe.Pointer(objs + uintptr(libc.PostIncInt32(&objIndex, 1))*8)) = objPtr
	string = *(*uintptr)(unsafe.Pointer(bp + 64 /* end */))
__127:
	;
__117:
	;
__60:
	;
	nconversions++
	goto __7
__8:
	;

done:
	result = 0
	code = TCL_OK

	if !(numVars != 0) {
		goto __137
	}
	// In this case, variables were specified (classic scan).

	*(*int32)(unsafe.Pointer(bp + 56 /* i */)) = 0
__139:
	if !(*(*int32)(unsafe.Pointer(bp + 56)) < *(*int32)(unsafe.Pointer(bp))) {
		goto __141
	}
	if !(*(*uintptr)(unsafe.Pointer(objs + uintptr(*(*int32)(unsafe.Pointer(bp + 56)))*8)) == uintptr(0)) {
		goto __142
	}
	goto __140
__142:
	;
	result++

	// In case of multiple errors in setting variables, just report
	// the first one.

	if !(XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(*(*int32)(unsafe.Pointer(bp + 56))+3)*8)), uintptr(0), *(*uintptr)(unsafe.Pointer(objs + uintptr(*(*int32)(unsafe.Pointer(bp + 56)))*8)),
		func() int32 {
			if code == TCL_OK {
				return TCL_LEAVE_ERR_MSG
			}
			return 0
		}()) == uintptr(0)) {
		goto __143
	}
	code = TCL_ERROR
__143:
	;
__144:
	_objPtr5 = *(*uintptr)(unsafe.Pointer(objs + uintptr(*(*int32)(unsafe.Pointer(bp + 56)))*8))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr5)).FrefCount, 1) <= 1) {
		goto __147
	}
	XTclFreeObj(tls, _objPtr5)
__147:
	;
	goto __145
__145:
	if 0 != 0 {
		goto __144
	}
	goto __146
__146:
	;
	goto __140
__140:
	*(*int32)(unsafe.Pointer(bp + 56 /* i */))++
	goto __139
	goto __141
__141:
	;
	goto __138
__137:
	// Here no vars were specified, we want a list returned (inline scan)

	;
__148:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __151
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __152
__151:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__152:
	;
	goto __149
__149:
	if 0 != 0 {
		goto __148
	}
	goto __150
__150:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)

	*(*int32)(unsafe.Pointer(bp + 56 /* i */)) = 0
__153:
	if !(*(*int32)(unsafe.Pointer(bp + 56)) < *(*int32)(unsafe.Pointer(bp))) {
		goto __155
	}
	if !(*(*uintptr)(unsafe.Pointer(objs + uintptr(*(*int32)(unsafe.Pointer(bp + 56)))*8)) != uintptr(0)) {
		goto __156
	}
	XTcl_ListObjAppendElement(tls, uintptr(0), objPtr, *(*uintptr)(unsafe.Pointer(objs + uintptr(*(*int32)(unsafe.Pointer(bp + 56 /* i */)))*8)))
__158:
	_objPtr6 = *(*uintptr)(unsafe.Pointer(objs + uintptr(*(*int32)(unsafe.Pointer(bp + 56)))*8))
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr6)).FrefCount, 1) <= 1) {
		goto __161
	}
	XTclFreeObj(tls, _objPtr6)
__161:
	;
	goto __159
__159:
	if 0 != 0 {
		goto __158
	}
	goto __160
__160:
	;
	goto __157
__156:
	// More %-specifiers than matching chars, so we just spit out
	// empty strings for these.

	XTcl_ListObjAppendElement(tls, uintptr(0), objPtr, XTcl_NewObj(tls))
__157:
	;
	goto __154
__154:
	*(*int32)(unsafe.Pointer(bp + 56 /* i */))++
	goto __153
	goto __155
__155:
	;
__138:
	;
	if !(objs != uintptr(0)) {
		goto __162
	}
	XTclpFree(tls, objs)
__162:
	;
	if !(code == TCL_OK) {
		goto __163
	}
	if !(underflow != 0 && nconversions == 0) {
		goto __164
	}
	if !(numVars != 0) {
		goto __166
	}
__168:
	;
__171:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __174
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __175
__174:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__175:
	;
	goto __172
__172:
	if 0 != 0 {
		goto __171
	}
	goto __173
__173:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(-1)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __169
__169:
	if 0 != 0 {
		goto __168
	}
	goto __170
__170:
	;
	goto __167
__166:
	if !(objPtr != 0) {
		goto __176
	}
	XTcl_SetListObj(tls, objPtr, 0, uintptr(0))
	goto __177
__176:
	;
__178:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0
	}()) {
		goto __181
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __182
__181:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects--
__182:
	;
	goto __179
__179:
	if 0 != 0 {
		goto __178
	}
	goto __180
__180:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)

__177:
	;
__167:
	;
	goto __165
__164:
	if !(numVars != 0) {
		goto __183
	}
__184:
	;
__187:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0
	}()) {
		goto __190
	}
	objPtr = XTclThreadAllocObj(tls)
	goto __191
__190:
	objPtr = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects--
__191:
	;
	goto __188
__188:
	if 0 != 0 {
		goto __187
	}
	goto __189
__189:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(result)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __185
__185:
	if 0 != 0 {
		goto __184
	}
	goto __186
__186:
	;
__183:
	;
__165:
	;
	XTcl_SetObjResult(tls, interp, objPtr)
__163:
	;
	return code
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// GCC bug 66462 means we cannot use the math builtins with -fsignaling-nan,
//    so disable builtins if this is enabled.  When fixed in a newer GCC,
//    the __SUPPORT_SNAN__ check may be skipped for those versions.

// Return number of classification appropriate for X.
// The check for __cplusplus allows the use of the builtin, even
// 	when optimization for size is on.  This is provided for
// 	libstdc++, only to let its configure test work when it is built
// 	with -Os.  No further use of this definition of fpclassify is
// 	expected in C++ mode, since libstdc++ provides its own version
// 	of fpclassify in cmath (which undefines fpclassify).

// Return nonzero value if sign of X is negative.

// Return nonzero value if X is not +-Inf or NaN.

// Return nonzero value if X is neither zero, subnormal, Inf, nor NaN.

// Return nonzero value if X is a NaN.  We could use `fpclassify' but
//    we already have this functions `__isnan' and it is faster.

// Return nonzero value if X is positive or negative infinity.

// Bitmasks for the math_errhandling macro.

// By default all math functions support both errno and exception handling
//    (except for soft floating point implementations which may only support
//    errno handling).  If errno handling is disabled, exceptions are still
//    supported by GLIBC.  Set math_errhandling to 0 with -ffast-math (this is
//    nonconforming but it is more useful than leaving it undefined).

// Some useful constants.

// The above constants are not adequate for computation using `long double's.
//    Therefore we provide as an extension constants with similar names as a
//    GNU extension.  Provide enough digits for the 128-bit IEEE quad.

// When compiling in strict ISO C compatible mode we must not use the
//    inline functions since they, among other things, do not set the
//    `errno' variable correctly.

// ISO C99 defines some macros to compare number while taking care for
//    unordered numbers.  Many FPUs provide special instructions to support
//    these operations.  Generic support in GCC for these as builtins went
//    in 2.97, but not all cpus added their patterns until 3.1.  Therefore
//    we enable the builtins from 3.1 onwards and use a generic implementation
//    othwerwise.

// Get machine-dependent inline versions (if there are any).

// Define KILL_OCTAL to suppress interpretation of numbers with leading zero
// as octal. (Ceterum censeo: numeros octonarios delendos esse.)

// This code supports (at least hypothetically), IBM, Cray, VAX and IEEE-754
// floating point; of these, only IEEE-754 can represent NaN. IEEE-754 can be
// uniquely determined by radix and by the widths of significand and exponent.

// Rounding controls. (Thanks a lot, Intel!)

// MIPS floating-point units need special settings in control registers to use
// gradual underflow as we expect.  This fix is for the MIPSpro compiler.

// HP's PA_RISC architecture uses 7ff4000000000000 to represent a quiet NaN.
// Everyone else uses 7ff8000000000000. (Why, HP, why?)

// Constants used by this file (most of which are only ever calculated at
// runtime).

// Magic constants

// Definitions of the parts of an IEEE754-format floating point number.

// Mask for the sign bit in the first word of
// a double.
// Mask for the exponent field in the first
// word of a double.
// Hidden 1 bit for the significand.
// Mask for the high-order part of the
// significand in the first word of a
// double.
// Mask for the 52-bit significand.

// Derived quantities.

// Union used to dismantle floating point numbers.

type Double1 = struct {
	F__ccgo_pad1 [0]uint64
	Fw           struct {
		Fword1 int32
		Fword0 int32
	}
} /* tclStrToD.c:166:9 */

// GCC bug 66462 means we cannot use the math builtins with -fsignaling-nan,
//    so disable builtins if this is enabled.  When fixed in a newer GCC,
//    the __SUPPORT_SNAN__ check may be skipped for those versions.

// Return number of classification appropriate for X.
// The check for __cplusplus allows the use of the builtin, even
// 	when optimization for size is on.  This is provided for
// 	libstdc++, only to let its configure test work when it is built
// 	with -Os.  No further use of this definition of fpclassify is
// 	expected in C++ mode, since libstdc++ provides its own version
// 	of fpclassify in cmath (which undefines fpclassify).

// Return nonzero value if sign of X is negative.

// Return nonzero value if X is not +-Inf or NaN.

// Return nonzero value if X is neither zero, subnormal, Inf, nor NaN.

// Return nonzero value if X is a NaN.  We could use `fpclassify' but
//    we already have this functions `__isnan' and it is faster.

// Return nonzero value if X is positive or negative infinity.

// Bitmasks for the math_errhandling macro.

// By default all math functions support both errno and exception handling
//    (except for soft floating point implementations which may only support
//    errno handling).  If errno handling is disabled, exceptions are still
//    supported by GLIBC.  Set math_errhandling to 0 with -ffast-math (this is
//    nonconforming but it is more useful than leaving it undefined).

// Some useful constants.

// The above constants are not adequate for computation using `long double's.
//    Therefore we provide as an extension constants with similar names as a
//    GNU extension.  Provide enough digits for the 128-bit IEEE quad.

// When compiling in strict ISO C compatible mode we must not use the
//    inline functions since they, among other things, do not set the
//    `errno' variable correctly.

// ISO C99 defines some macros to compare number while taking care for
//    unordered numbers.  Many FPUs provide special instructions to support
//    these operations.  Generic support in GCC for these as builtins went
//    in 2.97, but not all cpus added their patterns until 3.1.  Therefore
//    we enable the builtins from 3.1 onwards and use a generic implementation
//    othwerwise.

// Get machine-dependent inline versions (if there are any).

// Define KILL_OCTAL to suppress interpretation of numbers with leading zero
// as octal. (Ceterum censeo: numeros octonarios delendos esse.)

// This code supports (at least hypothetically), IBM, Cray, VAX and IEEE-754
// floating point; of these, only IEEE-754 can represent NaN. IEEE-754 can be
// uniquely determined by radix and by the widths of significand and exponent.

// Rounding controls. (Thanks a lot, Intel!)

// MIPS floating-point units need special settings in control registers to use
// gradual underflow as we expect.  This fix is for the MIPSpro compiler.

// HP's PA_RISC architecture uses 7ff4000000000000 to represent a quiet NaN.
// Everyone else uses 7ff8000000000000. (Why, HP, why?)

// Constants used by this file (most of which are only ever calculated at
// runtime).

// Magic constants

// Definitions of the parts of an IEEE754-format floating point number.

// Mask for the sign bit in the first word of
// a double.
// Mask for the exponent field in the first
// word of a double.
// Hidden 1 bit for the significand.
// Mask for the high-order part of the
// significand in the first word of a
// double.
// Mask for the 52-bit significand.

// Derived quantities.

// Union used to dismantle floating point numbers.

type Double = Double1 /* tclStrToD.c:178:3 */

var maxpow10_wide int32 /* tclStrToD.c:180:12: */ // The powers of ten that can be represented
// exactly as wide integers.
var pow10_wide uintptr    /* tclStrToD.c:182:21: */
var pow10vals [23]float64 /* tclStrToD.c:184:15: */
// The powers of ten that can be represented
// exactly as IEEE754 doubles.
var mmaxpow int32 /* tclStrToD.c:187:12: */ // Largest power of ten that can be
// represented exactly in a 'double'.
var log10_DIGIT_MAX int32 /* tclStrToD.c:189:12: */ // The number of decimal digits that fit in an
// mp_digit.
var log2FLT_RADIX int32 /* tclStrToD.c:191:12: */ // Logarithm of the floating point radix.
var mantBits int32      /* tclStrToD.c:192:12: */ // Number of bits in a double's significand
var pow5 [9]Mp_int      /* tclStrToD.c:193:15: */ // Table of powers of 5**(2**n), up to
// 5**256
var tiny float64 = 0.0 /* tclStrToD.c:195:15 */  // The smallest representable double.
var maxDigits int32    /* tclStrToD.c:196:12: */ // The maximum number of digits to the left of
// the decimal point of a double.
var minDigits int32 /* tclStrToD.c:198:12: */ // The maximum number of digits to the right
// of the decimal point in a double.
var pow_10_2_n = [9]float64{ // Inexact higher powers of ten.
	1.0,
	100.0,
	10000.0,
	1.0e+8,
	1.0e+16,
	1.0e+32,
	1.0e+64,
	1.0e+128,
	1.0e+256,
} /* tclStrToD.c:200:21 */

var n770_fp int32 /* tclStrToD.c:212:12: */ // Flag is 1 on Nokia N770 floating point.
// Nokia's floating point has the words
// reversed: if big-endian is 7654 3210,
// and little-endian is       0123 4567,
// then Nokia's FP is         4567 0123;
// little-endian within the 32-bit words but
// big-endian between them.

// Table of powers of 5 that are small enough to fit in an mp_digit.

var dpow5 = [13]Mp_digit{
	Mp_digit(1), Mp_digit(5), Mp_digit(25), Mp_digit(125),
	Mp_digit(625), Mp_digit(3125), Mp_digit(15625), Mp_digit(78125),
	Mp_digit(390625), Mp_digit(1953125), Mp_digit(9765625), Mp_digit(48828125),
	Mp_digit(244140625),
} /* tclStrToD.c:224:23 */

// Table of powers: pow5_13[n] = 5**(13*2**(n+1))

var pow5_13 [5]Mp_int /* tclStrToD.c:235:15: */ // Table of powers: 5**13, 5**26, 5**52,
// 5**104, 5**208
var tens = [23]float64{
	1e00, 1e01, 1e02, 1e03, 1e04, 1e05, 1e06, 1e07, 1e08, 1e09,
	1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
	1e20, 1e21, 1e22,
} /* tclStrToD.c:237:21 */

var itens = [9]int32{
	1,
	10,
	100,
	1000,
	10000,
	100000,
	1000000,
	10000000,
	100000000,
} /* tclStrToD.c:243:18 */

var bigtens = [5]float64{
	1e016, 1e032, 1e064, 1e128, 1e256,
} /* tclStrToD.c:255:21 */

var log2pow5 = [27]int32{
	01, 3, 5, 7, 10, 12, 14, 17, 19, 21,
	24, 26, 28, 31, 33, 35, 38, 40, 42, 45,
	47, 49, 52, 54, 56, 59, 61,
} /* tclStrToD.c:260:18 */

var wuipow5 = [27]Tcl_WideUInt{
	uint64(1), // 5**0
	uint64(5),
	uint64(25),
	uint64(125),
	uint64(625),
	uint64(3125), // 5**5
	uint64(3125) * uint64(5),
	uint64(3125) * uint64(25),
	uint64(3125) * uint64(125),
	uint64(3125) * uint64(625),
	uint64(3125) * uint64(3125),
	uint64(3125) * uint64(3125) * uint64(5),
	uint64(3125) * uint64(3125) * uint64(25),
	uint64(3125) * uint64(3125) * uint64(125),
	uint64(3125) * uint64(3125) * uint64(625),
	uint64(3125) * uint64(3125) * uint64(3125),
	uint64(3125) * uint64(3125) * uint64(3125) * uint64(5),
	uint64(3125) * uint64(3125) * uint64(3125) * uint64(25),
	uint64(3125) * uint64(3125) * uint64(3125) * uint64(125),
	uint64(3125) * uint64(3125) * uint64(3125) * uint64(625),
	uint64(3125) * uint64(3125) * uint64(3125) * uint64(3125),
	uint64(3125) * uint64(3125) * uint64(3125) * uint64(3125) * uint64(5),
	uint64(3125) * uint64(3125) * uint64(3125) * uint64(3125) * uint64(25),
	uint64(3125) * uint64(3125) * uint64(3125) * uint64(3125) * uint64(125),
	uint64(3125) * uint64(3125) * uint64(3125) * uint64(3125) * uint64(625),
	uint64(3125) * uint64(3125) * uint64(3125) * uint64(3125) * uint64(3125),
	uint64(3125) * uint64(3125) * uint64(3125) * uint64(3125) * uint64(3125) * uint64(5),
} /* tclStrToD.c:267:27 */

//----------------------------------------------------------------------
//
// TclParseNumber --
//
//	Scans bytes, interpreted as characters in Tcl's internal encoding, and
//	parses the longest prefix that is the string representation of a
//	number in a format recognized by Tcl.
//
//	The arguments bytes, numBytes, and objPtr are the inputs which
//	determine the string to be parsed. If bytes is non-NULL, it points to
//	the first byte to be scanned. If bytes is NULL, then objPtr must be
//	non-NULL, and the string representation of objPtr will be scanned
//	(generated first, if necessary). The numBytes argument determines the
//	number of bytes to be scanned. If numBytes is negative, the first NUL
//	byte encountered will terminate the scan. If numBytes is non-negative,
//	then no more than numBytes bytes will be scanned.
//
//	The argument flags is an input that controls the numeric formats
//	recognized by the parser. The flag bits are:
//
//	- TCL_PARSE_INTEGER_ONLY:	accept only integer values; reject
//		strings that denote floating point values (or accept only the
//		leading portion of them that are integer values).
//	- TCL_PARSE_SCAN_PREFIXES:	ignore the prefixes 0b and 0o that are
//		not part of the [scan] command's vocabulary. Use only in
//		combination with TCL_PARSE_INTEGER_ONLY.
//	- TCL_PARSE_BINARY_ONLY:	parse only in the binary format, whether
//		or not a prefix is present that would lead to binary parsing.
//		Use only in combination with TCL_PARSE_INTEGER_ONLY.
//	- TCL_PARSE_OCTAL_ONLY:		parse only in the octal format, whether
//		or not a prefix is present that would lead to octal parsing.
//		Use only in combination with TCL_PARSE_INTEGER_ONLY.
//	- TCL_PARSE_HEXADECIMAL_ONLY:	parse only in the hexadecimal format,
//		whether or not a prefix is present that would lead to
//		hexadecimal parsing. Use only in combination with
//		TCL_PARSE_INTEGER_ONLY.
//	- TCL_PARSE_DECIMAL_ONLY:	parse only in the decimal format, no
//		matter whether a 0 prefix would normally force a different
//		base.
//	- TCL_PARSE_NO_WHITESPACE:	reject any leading/trailing whitespace
//
//	The arguments interp and expected are inputs that control error
//	message generation. If interp is NULL, no error message will be
//	generated. If interp is non-NULL, then expected must also be non-NULL.
//	When TCL_ERROR is returned, an error message will be left in the
//	result of interp, and the expected argument will appear in the error
//	message as the thing TclParseNumber expected, but failed to find in
//	the string.
//
//	The arguments objPtr and endPtrPtr as well as the return code are the
//	outputs.
//
//	When the parser cannot find any prefix of the string that matches a
//	format it is looking for, TCL_ERROR is returned and an error message
//	may be generated and returned as described above. The contents of
//	objPtr will not be changed. If endPtrPtr is non-NULL, a pointer to the
//	character in the string that terminated the scan will be written to
//	*endPtrPtr.
//
//	When the parser determines that the entire string matches a format it
//	is looking for, TCL_OK is returned, and if objPtr is non-NULL, then
//	the internal rep and Tcl_ObjType of objPtr are set to the "canonical"
//	numeric value that matches the scanned string. If endPtrPtr is not
//	NULL, a pointer to the end of the string will be written to *endPtrPtr
//	(that is, either bytes+numBytes or a pointer to a terminating NUL
//	byte).
//
//	When the parser determines that a partial string matches a format it
//	is looking for, the value of endPtrPtr determines what happens:
//
//	- If endPtrPtr is NULL, then TCL_ERROR is returned, with error message
//		generation as above.
//
//	- If endPtrPtr is non-NULL, then TCL_OK is returned and objPtr
//		internals are set as above. Also, a pointer to the first
//		character following the parsed numeric string is written to
//		*endPtrPtr.
//
//	In some cases where the string being scanned is the string rep of
//	objPtr, this routine can leave objPtr in an inconsistent state where
//	its string rep and its internal rep do not agree. In these cases the
//	internal rep will be in agreement with only some substring of the
//	string rep. This might happen if the caller passes in a non-NULL bytes
//	value that points somewhere into the string rep. It might happen if
//	the caller passes in a numBytes value that limits the scan to only a
//	prefix of the string rep. Or it might happen if a non-NULL value of
//	endPtrPtr permits a TCL_OK return from only a partial string match. It
//	is the responsibility of the caller to detect and correct such
//	inconsistencies when they can and do arise.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	The string representaton of objPtr may be generated.
//
//	The internal representation and Tcl_ObjType of objPtr may be changed.
//	This may involve allocation and/or freeing of memory.
//
//----------------------------------------------------------------------

func XTclParseNumber(tls *libc.TLS, interp uintptr, objPtr uintptr, expected uintptr, bytes uintptr, numBytes int32, endPtrPtr uintptr, flags int32) int32 { /* tclStrToD.c:481:1: */
	bp := tls.Alloc(112)
	defer tls.Free(112)

	var state uint32
	var acceptState uint32
	var signum int32 // Sign of the number being parsed.
	// var significandWide Tcl_WideUInt at bp+56, 8

	// Significand of the number being parsed (if
	// no overflow).
	// var significandBig Mp_int at bp+64, 24
	// Significand of the number being parsed (if
	// it overflows significandWide).
	var significandOverflow int32 // Flag==1 iff significandBig is used.
	var octalSignificandWide Tcl_WideUInt
	// Significand of an octal number; needed
	// because we don't know whether a number with
	// a leading zero is octal or decimal until
	// we've scanned forward to a '.' or 'e'.
	// var octalSignificandBig Mp_int at bp+88, 24
	// Significand of octal number once
	// octalSignificandWide overflows.
	var octalSignificandOverflow int32
	// Flag==1 if octalSignificandBig is used.
	var numSigDigs int32 // Number of significant digits in the decimal
	// significand.
	var numTrailZeros int32 // Number of trailing zeroes at the current
	// point in the parse.
	var numDigitsAfterDp int32 // Number of digits scanned after the decimal
	// point.
	var exponentSignum int32 // Signum of the exponent of a floating point
	// number.
	var exponent int64      // Exponent of a floating point number.
	var p uintptr           // Pointer to next character to scan.
	var len Size_t          // Number of characters remaining after p.
	var acceptPoint uintptr // Pointer to position after last character in
	// an acceptable number.
	var acceptLen Size_t // Number of characters following that
	// point.
	var status int32 // Status to return to caller.
	var d int8       // Last hexadecimal digit scanned; initialized
	// to avoid a compiler warning.
	var shift int32 // Amount to shift when accumulating binary
	var explicitOctal int32
	var c int8
	var msg uintptr
	state = uint32(0)       /* INITIAL */
	acceptState = uint32(0) /* INITIAL */
	signum = 0
	*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)) = uint64(0)
	significandOverflow = 0
	octalSignificandWide = uint64(0)
	octalSignificandOverflow = 0
	numSigDigs = 0
	numTrailZeros = 0
	numDigitsAfterDp = 0
	exponentSignum = 0
	exponent = int64(0)
	status = TCL_OK
	d = int8(0)
	shift = 0
	explicitOctal = 0

	// Initialize bytes to start of the object's string rep if the caller
	// didn't pass anything else.

	if !(bytes == uintptr(0)) {
		goto __1
	}
	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()
__1:
	;

	p = bytes
	len = Size_t(numBytes)
	acceptPoint = p
	acceptLen = len
__2:
	if !(1 != 0) {
		goto __3
	}
	if len != 0 {
		c = *(*int8)(unsafe.Pointer(p))
	} else {
		c = int8(0)
	}
	switch state {

	case uint32(0) /* INITIAL */ :
		goto __5
		// FALLTHROUGH

	case uint32(1) /* SIGNUM */ :
		goto __6

	case uint32(2) /* ZERO */ :
		goto __7
		// FALLTHROUGH

	case uint32(8) /* OCTAL */ :
		goto __8
		// FALLTHROUGH
	case uint32(4) /* ZERO_O */ :
		goto __9
		// FALLTHROUGH

	case uint32(9) /* BAD_OCTAL */ :
		goto __10

		// Scanned 0x. If state is HEXADECIMAL, scanned at least one
		// character following the 0x. The only acceptable inputs are
		// hexadecimal digits.

	case uint32(7) /* HEXADECIMAL */ :
		goto __11
		// FALLTHROUGH

	case uint32(3) /* ZERO_X */ :
		goto __12

	case uint32(6) /* BINARY */ :
		goto __13
		// FALLTHRU
	case uint32(5) /* ZERO_B */ :
		goto __14

	case uint32(10) /* DECIMAL */ :
		goto __15

		// Found a decimal point. If no digits have yet been scanned, E is
		// not allowed; otherwise, it introduces the exponent. If at least
		// one digit has been found, we have a possible complete number.

	case uint32(12) /* FRACTION */ :
		goto __16
		// FALLTHROUGH

	case uint32(11) /* LEADING_RADIX_POINT */ :
		goto __17

	case uint32(13) /* EXPONENT_START */ :
		goto __18
		// FALLTHROUGH

	case uint32(14) /* EXPONENT_SIGNUM */ :
		goto __19

	case uint32(15) /* EXPONENT */ :
		goto __20

		// Parse out INFINITY by simply spelling it out. INF is accepted
		// as an abbreviation; other prefices are not.

	case uint32(16) /* sI */ :
		goto __21
	case uint32(17) /* sIN */ :
		goto __22
	case uint32(18) /* sINF */ :
		goto __23
	case uint32(19) /* sINFI */ :
		goto __24
	case uint32(20) /* sINFIN */ :
		goto __25
	case uint32(21) /* sINFINI */ :
		goto __26
	case uint32(22) /* sINFINIT */ :
		goto __27

		// Parse NaN's.
	case uint32(24) /* sN */ :
		goto __28
	case uint32(25) /* sNA */ :
		goto __29
	case uint32(26) /* sNAN */ :
		goto __30

		// Parse NaN(hexdigits)
	case uint32(28) /* sNANHEX */ :
		goto __31
		// FALLTHROUGH
	case uint32(27) /* sNANPAREN */ :
		goto __32
	case uint32(29) /* sNANFINISH */ :
		goto __33

	case uint32(23) /* sINFINITY */ :
		goto __34
	}
	goto __4

__5:
	// Initial state. Acceptable characters are +, -, digits, period,
	// I, N, and whitespace.

	if !(func() int32 {
		if int32(c) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(c))
	}() != 0) {
		goto __35
	}
	if !(flags&TCL_PARSE_NO_WHITESPACE != 0) {
		goto __37
	}
	goto endgame
__37:
	;
	goto __4
	goto __36
__35:
	if !(int32(c) == '+') {
		goto __38
	}
	state = uint32(1) /* SIGNUM */
	goto __4
	goto __39
__38:
	if !(int32(c) == '-') {
		goto __40
	}
	signum = 1
	state = uint32(1) /* SIGNUM */
	goto __4
__40:
	;
__39:
	;
__36:
	;
	// FALLTHROUGH

__6:
	// Scanned a leading + or -. Acceptable characters are digits,
	// period, I, and N.

	if !(int32(c) == '0') {
		goto __41
	}
	if !(flags&TCL_PARSE_DECIMAL_ONLY != 0) {
		goto __43
	}
	state = uint32(10) /* DECIMAL */
	goto __44
__43:
	state = uint32(2) /* ZERO */
__44:
	;
	goto __4
	goto __42
__41:
	if !(flags&TCL_PARSE_HEXADECIMAL_ONLY != 0) {
		goto __45
	}
	goto zerox
	goto __46
__45:
	if !(flags&TCL_PARSE_BINARY_ONLY != 0) {
		goto __47
	}
	goto zerob
	goto __48
__47:
	if !(flags&TCL_PARSE_OCTAL_ONLY != 0) {
		goto __49
	}
	goto zeroo
	goto __50
__49:
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(X_ISdigit) != 0) {
		goto __51
	}
	*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)) = Tcl_WideUInt(int32(c) - '0')
	numSigDigs = 1
	state = uint32(10) /* DECIMAL */
	goto __4
	goto __52
__51:
	if !(flags&TCL_PARSE_INTEGER_ONLY != 0) {
		goto __53
	}
	goto endgame
	goto __54
__53:
	if !(int32(c) == '.') {
		goto __55
	}
	state = uint32(11) /* LEADING_RADIX_POINT */
	goto __4
	goto __56
__55:
	if !(int32(c) == 'I' || int32(c) == 'i') {
		goto __57
	}
	state = uint32(16) /* sI */
	goto __4
	goto __58
__57:
	if !(int32(c) == 'N' || int32(c) == 'n') {
		goto __59
	}
	state = uint32(24) /* sN */
	goto __4
__59:
	;
__58:
	;
__56:
	;
__54:
	;
__52:
	;
__50:
	;
__48:
	;
__46:
	;
__42:
	;
	goto endgame

__7:
	// Scanned a leading zero (perhaps with a + or -). Acceptable
	// inputs are digits, period, X, b, and E. If 8 or 9 is
	// encountered, the number can't be octal. This state and the
	// OCTAL state differ only in whether they recognize 'X' and 'b'.

	acceptState = uint32(state)
	acceptPoint = p
	acceptLen = len
	if !(int32(c) == 'x' || int32(c) == 'X') {
		goto __60
	}
	if !(flags&(TCL_PARSE_OCTAL_ONLY|TCL_PARSE_BINARY_ONLY) != 0) {
		goto __61
	}
	goto endgame
__61:
	;
	state = uint32(3) /* ZERO_X */
	goto __4
__60:
	;
	if !(flags&TCL_PARSE_HEXADECIMAL_ONLY != 0) {
		goto __62
	}
	goto zerox
__62:
	;
	if !(flags&TCL_PARSE_SCAN_PREFIXES != 0) {
		goto __63
	}
	goto zeroo
__63:
	;
	if !(int32(c) == 'b' || int32(c) == 'B') {
		goto __64
	}
	if !(flags&TCL_PARSE_OCTAL_ONLY != 0) {
		goto __65
	}
	goto endgame
__65:
	;
	state = uint32(5) /* ZERO_B */
	goto __4
__64:
	;
	if !(flags&TCL_PARSE_BINARY_ONLY != 0) {
		goto __66
	}
	goto zerob
__66:
	;
	if !(int32(c) == 'o' || int32(c) == 'O') {
		goto __67
	}
	explicitOctal = 1
	state = uint32(4) /* ZERO_O */
	goto __4
__67:
	;
	// FALLTHROUGH

__8:
	// Scanned an optional + or -, followed by a string of octal
	// digits. Acceptable inputs are more digits, period, or E. If 8
	// or 9 is encountered, commit to floating point.

	acceptState = uint32(state)
	acceptPoint = p
	acceptLen = len
	// FALLTHROUGH
__9:
zeroo:
	if !(int32(c) == '0') {
		goto __68
	}
	numTrailZeros++
	state = uint32(8) /* OCTAL */
	goto __4
	goto __69
__68:
	if !(int32(c) >= '1' && int32(c) <= '7') {
		goto __70
	}
	if !(objPtr != uintptr(0)) {
		goto __71
	}
	shift = 3 * (numTrailZeros + 1)
	significandOverflow = sAccumulateDecimalDigit(tls,
		uint32(int32(c)-'0'), numTrailZeros,
		bp+56, bp+64,
		significandOverflow)

	if !!(octalSignificandOverflow != 0) {
		goto __72
	}
	// Shifting by more bits than are in the value being
	// shifted is at least de facto nonportable. Check for
	// too large shifts first.

	if !(octalSignificandWide != uint64(0) &&
		(Size_t(shift) >= uint64(8)*uint64(unsafe.Sizeof(Tcl_WideUInt(0))) ||
			octalSignificandWide > Tcl_WideUInt(libc.CplUint64(uint64(0)))>>shift)) {
		goto __73
	}
	octalSignificandOverflow = 1
	XTclBNInitBignumFromWideUInt(tls, bp+88,
		octalSignificandWide)
__73:
	;
__72:
	;
	if !!(octalSignificandOverflow != 0) {
		goto __74
	}
	octalSignificandWide = octalSignificandWide<<shift + Tcl_WideUInt(int32(c)-'0')
	goto __75
__74:
	XTclBN_mp_mul_2d(tls, bp+88, shift,
		bp+88)
	XTclBN_mp_add_d(tls, bp+88, Mp_digit(int32(c)-'0'),
		bp+88)
__75:
	;
__71:
	;
	if !(numSigDigs != 0) {
		goto __76
	}
	numSigDigs = numSigDigs + (numTrailZeros + 1)
	goto __77
__76:
	numSigDigs = 1
__77:
	;
	numTrailZeros = 0
	state = uint32(8) /* OCTAL */
	goto __4
__70:
	;
__69:
	;
	// FALLTHROUGH

__10:
	if !(explicitOctal != 0) {
		goto __78
	}
	// No forgiveness for bad digits in explicitly octal numbers.

	goto endgame
__78:
	;
	if !(flags&TCL_PARSE_INTEGER_ONLY != 0) {
		goto __79
	}
	// No seeking floating point when parsing only integer.

	goto endgame
__79:
	;

	// Scanned a number with a leading zero that contains an 8, 9,
	// radix point or E. This is an invalid octal number, but might
	// still be floating point.

	if !(int32(c) == '0') {
		goto __80
	}
	numTrailZeros++
	state = uint32(9) /* BAD_OCTAL */
	goto __4
	goto __81
__80:
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(X_ISdigit) != 0) {
		goto __82
	}
	if !(objPtr != uintptr(0)) {
		goto __84
	}
	significandOverflow = sAccumulateDecimalDigit(tls,
		uint32(int32(c)-'0'), numTrailZeros,
		bp+56, bp+64,
		significandOverflow)
__84:
	;
	if !(numSigDigs != 0) {
		goto __85
	}
	numSigDigs = numSigDigs + (numTrailZeros + 1)
	goto __86
__85:
	numSigDigs = 1
__86:
	;
	numTrailZeros = 0
	state = uint32(9) /* BAD_OCTAL */
	goto __4
	goto __83
__82:
	if !(int32(c) == '.') {
		goto __87
	}
	state = uint32(12) /* FRACTION */
	goto __4
	goto __88
__87:
	if !(int32(c) == 'E' || int32(c) == 'e') {
		goto __89
	}
	state = uint32(13) /* EXPONENT_START */
	goto __4
__89:
	;
__88:
	;
__83:
	;
__81:
	;
	goto endgame

	// Scanned 0x. If state is HEXADECIMAL, scanned at least one
	// character following the 0x. The only acceptable inputs are
	// hexadecimal digits.

__11:
	acceptState = uint32(state)
	acceptPoint = p
	acceptLen = len
	// FALLTHROUGH

__12:
zerox:
	if !(int32(c) == '0') {
		goto __90
	}
	numTrailZeros++
	state = uint32(7) /* HEXADECIMAL */
	goto __4
	goto __91
__90:
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(X_ISdigit) != 0) {
		goto __92
	}
	d = int8(int32(c) - '0')
	goto __93
__92:
	if !(int32(c) >= 'A' && int32(c) <= 'F') {
		goto __94
	}
	d = int8(int32(c) - 'A' + 10)
	goto __95
__94:
	if !(int32(c) >= 'a' && int32(c) <= 'f') {
		goto __96
	}
	d = int8(int32(c) - 'a' + 10)
	goto __97
__96:
	goto endgame
__97:
	;
__95:
	;
__93:
	;
__91:
	;
	if !(objPtr != uintptr(0)) {
		goto __98
	}
	shift = 4 * (numTrailZeros + 1)
	if !!(significandOverflow != 0) {
		goto __99
	}
	// Shifting by more bits than are in the value being
	// shifted is at least de facto nonportable. Check for too
	// large shifts first.

	if !(*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56)) != uint64(0) && (Size_t(shift) >= uint64(8)*uint64(unsafe.Sizeof(Tcl_WideUInt(0))) || *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56)) > Tcl_WideUInt(libc.CplUint64(uint64(0)))>>shift)) {
		goto __100
	}
	significandOverflow = 1
	XTclBNInitBignumFromWideUInt(tls, bp+64,
		*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)))
__100:
	;
__99:
	;
	if !!(significandOverflow != 0) {
		goto __101
	}
	*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)) = *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56))<<shift + Tcl_WideUInt(d)
	goto __102
__101:
	XTclBN_mp_mul_2d(tls, bp+64, shift, bp+64)
	XTclBN_mp_add_d(tls, bp+64, Mp_digit(d), bp+64)
__102:
	;
__98:
	;
	numTrailZeros = 0
	state = uint32(7) /* HEXADECIMAL */
	goto __4

__13:
	acceptState = uint32(state)
	acceptPoint = p
	acceptLen = len
	// FALLTHRU
__14:
zerob:
	if !(int32(c) == '0') {
		goto __103
	}
	numTrailZeros++
	state = uint32(6) /* BINARY */
	goto __4
	goto __104
__103:
	if !(int32(c) != '1') {
		goto __105
	}
	goto endgame
__105:
	;
__104:
	;
	if !(objPtr != uintptr(0)) {
		goto __106
	}
	shift = numTrailZeros + 1
	if !!(significandOverflow != 0) {
		goto __107
	}
	// Shifting by more bits than are in the value being
	// shifted is at least de facto nonportable. Check for too
	// large shifts first.

	if !(*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56)) != uint64(0) && (Size_t(shift) >= uint64(8)*uint64(unsafe.Sizeof(Tcl_WideUInt(0))) || *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56)) > Tcl_WideUInt(libc.CplUint64(uint64(0)))>>shift)) {
		goto __108
	}
	significandOverflow = 1
	XTclBNInitBignumFromWideUInt(tls, bp+64,
		*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)))
__108:
	;
__107:
	;
	if !!(significandOverflow != 0) {
		goto __109
	}
	*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)) = *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56))<<shift + uint64(1)
	goto __110
__109:
	XTclBN_mp_mul_2d(tls, bp+64, shift, bp+64)
	XTclBN_mp_add_d(tls, bp+64, Mp_digit(1), bp+64)
__110:
	;
__106:
	;
	numTrailZeros = 0
	state = uint32(6) /* BINARY */
	goto __4

__15:
	// Scanned an optional + or - followed by a string of decimal
	// digits.

	acceptState = uint32(state)
	acceptPoint = p
	acceptLen = len
	if !(int32(c) == '0') {
		goto __111
	}
	numTrailZeros++
	state = uint32(10) /* DECIMAL */
	goto __4
	goto __112
__111:
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(X_ISdigit) != 0) {
		goto __113
	}
	if !(objPtr != uintptr(0)) {
		goto __115
	}
	significandOverflow = sAccumulateDecimalDigit(tls,
		uint32(int32(c)-'0'), numTrailZeros,
		bp+56, bp+64,
		significandOverflow)
__115:
	;
	numSigDigs = numSigDigs + (numTrailZeros + 1)
	numTrailZeros = 0
	state = uint32(10) /* DECIMAL */
	goto __4
	goto __114
__113:
	if !(flags&TCL_PARSE_INTEGER_ONLY != 0) {
		goto __116
	}
	goto endgame
	goto __117
__116:
	if !(int32(c) == '.') {
		goto __118
	}
	state = uint32(12) /* FRACTION */
	goto __4
	goto __119
__118:
	if !(int32(c) == 'E' || int32(c) == 'e') {
		goto __120
	}
	state = uint32(13) /* EXPONENT_START */
	goto __4
__120:
	;
__119:
	;
__117:
	;
__114:
	;
__112:
	;
	goto endgame

	// Found a decimal point. If no digits have yet been scanned, E is
	// not allowed; otherwise, it introduces the exponent. If at least
	// one digit has been found, we have a possible complete number.

__16:
	acceptState = uint32(state)
	acceptPoint = p
	acceptLen = len
	if !(int32(c) == 'E' || int32(c) == 'e') {
		goto __121
	}
	state = uint32(13) /* EXPONENT_START */
	goto __4
__121:
	;
	// FALLTHROUGH

__17:
	if !(int32(c) == '0') {
		goto __122
	}
	numDigitsAfterDp++
	numTrailZeros++
	state = uint32(12) /* FRACTION */
	goto __4
	goto __123
__122:
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(X_ISdigit) != 0) {
		goto __124
	}
	numDigitsAfterDp++
	if !(objPtr != uintptr(0)) {
		goto __125
	}
	significandOverflow = sAccumulateDecimalDigit(tls,
		uint32(int32(c)-'0'), numTrailZeros,
		bp+56, bp+64,
		significandOverflow)
__125:
	;
	if !(numSigDigs != 0) {
		goto __126
	}
	numSigDigs = numSigDigs + (numTrailZeros + 1)
	goto __127
__126:
	numSigDigs = 1
__127:
	;
	numTrailZeros = 0
	state = uint32(12) /* FRACTION */
	goto __4
__124:
	;
__123:
	;
	goto endgame

__18:
	// Scanned the E at the start of an exponent. Make sure a legal
	// character follows before using the C library strtol routine,
	// which allows whitespace.

	if !(int32(c) == '+') {
		goto __128
	}
	state = uint32(14) /* EXPONENT_SIGNUM */
	goto __4
	goto __129
__128:
	if !(int32(c) == '-') {
		goto __130
	}
	exponentSignum = 1
	state = uint32(14) /* EXPONENT_SIGNUM */
	goto __4
__130:
	;
__129:
	;
	// FALLTHROUGH

__19:
	// Found the E at the start of the exponent, followed by a sign
	// character.

	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(X_ISdigit) != 0) {
		goto __131
	}
	exponent = int64(int32(c) - '0')
	state = uint32(15) /* EXPONENT */
	goto __4
__131:
	;
	goto endgame

__20:
	// Found an exponent with at least one digit. Accumulate it,
	// making sure to hard-pin it to LONG_MAX on overflow.

	acceptState = uint32(state)
	acceptPoint = p
	acceptLen = len
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(c)))*2)))&int32(X_ISdigit) != 0) {
		goto __132
	}
	if !(exponent < (0x7fffffffffffffff-int64(9))/int64(10)) {
		goto __133
	}
	exponent = int64(10)*exponent + int64(int32(c)-'0')
	goto __134
__133:
	exponent = 0x7fffffffffffffff
__134:
	;
	state = uint32(15) /* EXPONENT */
	goto __4
__132:
	;
	goto endgame

	// Parse out INFINITY by simply spelling it out. INF is accepted
	// as an abbreviation; other prefices are not.

__21:
	if !(int32(c) == 'n' || int32(c) == 'N') {
		goto __135
	}
	state = uint32(17) /* sIN */
	goto __4
__135:
	;
	goto endgame
__22:
	if !(int32(c) == 'f' || int32(c) == 'F') {
		goto __136
	}
	state = uint32(18) /* sINF */
	goto __4
__136:
	;
	goto endgame
__23:
	acceptState = uint32(state)
	acceptPoint = p
	acceptLen = len
	if !(int32(c) == 'i' || int32(c) == 'I') {
		goto __137
	}
	state = uint32(19) /* sINFI */
	goto __4
__137:
	;
	goto endgame
__24:
	if !(int32(c) == 'n' || int32(c) == 'N') {
		goto __138
	}
	state = uint32(20) /* sINFIN */
	goto __4
__138:
	;
	goto endgame
__25:
	if !(int32(c) == 'i' || int32(c) == 'I') {
		goto __139
	}
	state = uint32(21) /* sINFINI */
	goto __4
__139:
	;
	goto endgame
__26:
	if !(int32(c) == 't' || int32(c) == 'T') {
		goto __140
	}
	state = uint32(22) /* sINFINIT */
	goto __4
__140:
	;
	goto endgame
__27:
	if !(int32(c) == 'y' || int32(c) == 'Y') {
		goto __141
	}
	state = uint32(23) /* sINFINITY */
	goto __4
__141:
	;
	goto endgame

	// Parse NaN's.
__28:
	if !(int32(c) == 'a' || int32(c) == 'A') {
		goto __142
	}
	state = uint32(25) /* sNA */
	goto __4
__142:
	;
	goto endgame
__29:
	if !(int32(c) == 'n' || int32(c) == 'N') {
		goto __143
	}
	state = uint32(26) /* sNAN */
	goto __4
__143:
	;
	goto endgame
__30:
	acceptState = uint32(state)
	acceptPoint = p
	acceptLen = len
	if !(int32(c) == '(') {
		goto __144
	}
	state = uint32(27) /* sNANPAREN */
	goto __4
__144:
	;
	goto endgame

	// Parse NaN(hexdigits)
__31:
	if !(int32(c) == ')') {
		goto __145
	}
	state = uint32(29) /* sNANFINISH */
	goto __4
__145:
	;
	// FALLTHROUGH
__32:
	if !(func() int32 {
		if int32(c) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(c))
	}() != 0) {
		goto __146
	}
	goto __4
__146:
	;
	if !(numSigDigs < 13) {
		goto __147
	}
	if !(int32(c) >= '0' && int32(c) <= '9') {
		goto __148
	}
	d = int8(int32(c) - '0')
	goto __149
__148:
	if !(int32(c) >= 'a' && int32(c) <= 'f') {
		goto __150
	}
	d = int8(10 + int32(c) - 'a')
	goto __151
__150:
	if !(int32(c) >= 'A' && int32(c) <= 'F') {
		goto __152
	}
	d = int8(10 + int32(c) - 'A')
	goto __153
__152:
	goto endgame
__153:
	;
__151:
	;
__149:
	;
	numSigDigs++
	*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)) = *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56))<<4 + Tcl_WideUInt(d)
	state = uint32(28) /* sNANHEX */
	goto __4
__147:
	;
	goto endgame
__33:

__34:
	acceptState = uint32(state)
	acceptPoint = p
	acceptLen = len
	goto endgame
__4:
	;
	p++
	len--
	goto __2
__3:
	;

endgame:
	if !(int32(acceptState) == 0) {
		goto __154
	}
	// No numeric string at all found.

	status = TCL_ERROR
	if !(endPtrPtr != uintptr(0)) {
		goto __156
	}
	*(*uintptr)(unsafe.Pointer(endPtrPtr)) = p
__156:
	;
	goto __155
__154:
	// Back up to the last accepting state in the lexer.

	p = acceptPoint
	len = acceptLen
	if !!(flags&TCL_PARSE_NO_WHITESPACE != 0) {
		goto __157
	}
	// Accept trailing whitespace.

__158:
	if !(len != uint64(0) && func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
	}() != 0) {
		goto __159
	}
	p++
	len--
	goto __158
__159:
	;
__157:
	;
	if !(endPtrPtr == uintptr(0)) {
		goto __160
	}
	if !(len != uint64(0) && (numBytes > 0 || int32(*(*int8)(unsafe.Pointer(p))) != 0)) {
		goto __162
	}
	status = TCL_ERROR
__162:
	;
	goto __161
__160:
	*(*uintptr)(unsafe.Pointer(endPtrPtr)) = p
__161:
	;
__155:
	;

	// Generate and store the appropriate internal rep.

	if !(status == TCL_OK && objPtr != uintptr(0)) {
		goto __163
	}
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __164
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __165
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__165:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__164:
	;

	switch acceptState {
	case uint32(1) /* SIGNUM */ :
		goto __167
	case uint32(9) /* BAD_OCTAL */ :
		goto __168
	case uint32(3) /* ZERO_X */ :
		goto __169
	case uint32(4) /* ZERO_O */ :
		goto __170
	case uint32(5) /* ZERO_B */ :
		goto __171
	case uint32(11) /* LEADING_RADIX_POINT */ :
		goto __172
	case uint32(13) /* EXPONENT_START */ :
		goto __173
	case uint32(14) /* EXPONENT_SIGNUM */ :
		goto __174
	case uint32(16) /* sI */ :
		goto __175
	case uint32(17) /* sIN */ :
		goto __176
	case uint32(19) /* sINFI */ :
		goto __177
	case uint32(20) /* sINFIN */ :
		goto __178
	case uint32(21) /* sINFINI */ :
		goto __179
	case uint32(22) /* sINFINIT */ :
		goto __180
	case uint32(24) /* sN */ :
		goto __181
	case uint32(25) /* sNA */ :
		goto __182
	case uint32(27) /* sNANPAREN */ :
		goto __183
	case uint32(28) /* sNANHEX */ :
		goto __184
	case uint32(6) /* BINARY */ :
		goto __185

	case uint32(7) /* HEXADECIMAL */ :
		goto __186

	case uint32(8) /* OCTAL */ :
		goto __187

	case uint32(2) /* ZERO */ :
		goto __188
	case uint32(10) /* DECIMAL */ :
		goto __189

	case uint32(12) /* FRACTION */ :
		goto __190
	case uint32(15) /* EXPONENT */ :
		goto __191

	case uint32(18) /* sINF */ :
		goto __192
	case uint32(23) /* sINFINITY */ :
		goto __193

	case uint32(26) /* sNAN */ :
		goto __194
	case uint32(29) /* sNANFINISH */ :
		goto __195
	case uint32(0) /* INITIAL */ :
		goto __196
	}
	goto __166
__167:
__168:
__169:
__170:
__171:
__172:
__173:
__174:
__175:
__176:
__177:
__178:
__179:
__180:
__181:
__182:
__183:
__184:
	XTcl_Panic(tls, ts+64230,
		libc.VaList(bp, acceptState, bytes))
__185:
	shift = numTrailZeros
	if !(!(significandOverflow != 0) && *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56)) != uint64(0) && (Size_t(shift) >= uint64(8)*uint64(unsafe.Sizeof(Tcl_WideUInt(0))) || *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56)) > (Tcl_WideUInt(libc.CplUint64(uint64(0)))>>1+Tcl_WideUInt(signum))>>shift)) {
		goto __197
	}
	significandOverflow = 1
	XTclBNInitBignumFromWideUInt(tls, bp+64, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)))
__197:
	;
	if !(shift != 0) {
		goto __198
	}
	if !!(significandOverflow != 0) {
		goto __199
	}
	*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)) <<= shift
	goto __200
__199:
	XTclBN_mp_mul_2d(tls, bp+64, shift, bp+64)
__200:
	;
__198:
	;
	goto returnInteger

__186:
	// Returning a hex integer. Final scaling step.

	shift = 4 * numTrailZeros
	if !(!(significandOverflow != 0) && *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56)) != uint64(0) && (Size_t(shift) >= uint64(8)*uint64(unsafe.Sizeof(Tcl_WideUInt(0))) || *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56)) > (Tcl_WideUInt(libc.CplUint64(uint64(0)))>>1+Tcl_WideUInt(signum))>>shift)) {
		goto __201
	}
	significandOverflow = 1
	XTclBNInitBignumFromWideUInt(tls, bp+64, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)))
__201:
	;
	if !(shift != 0) {
		goto __202
	}
	if !!(significandOverflow != 0) {
		goto __203
	}
	*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)) <<= shift
	goto __204
__203:
	XTclBN_mp_mul_2d(tls, bp+64, shift, bp+64)
__204:
	;
__202:
	;
	goto returnInteger

__187:
	// Returning an octal integer. Final scaling step.

	shift = 3 * numTrailZeros
	if !(!(octalSignificandOverflow != 0) && octalSignificandWide != uint64(0) && (Size_t(shift) >= uint64(8)*uint64(unsafe.Sizeof(Tcl_WideUInt(0))) || octalSignificandWide > (Tcl_WideUInt(libc.CplUint64(uint64(0)))>>1+Tcl_WideUInt(signum))>>shift)) {
		goto __205
	}
	octalSignificandOverflow = 1
	XTclBNInitBignumFromWideUInt(tls, bp+88,
		octalSignificandWide)
__205:
	;
	if !(shift != 0) {
		goto __206
	}
	if !!(octalSignificandOverflow != 0) {
		goto __207
	}
	octalSignificandWide <<= shift
	goto __208
__207:
	XTclBN_mp_mul_2d(tls, bp+88, shift,
		bp+88)
__208:
	;
__206:
	;
	if !!(octalSignificandOverflow != 0) {
		goto __209
	}
	if !(octalSignificandWide > uint64(libc.CplUint64(uint64(0)))>>1+uint64(signum)) {
		goto __210
	}
	XTclBNInitBignumFromWideUInt(tls, bp+88,
		octalSignificandWide)
	octalSignificandOverflow = 1
	goto __211
__210:
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	if !(signum != 0) {
		goto __212
	}
	*(*int64)(unsafe.Pointer(objPtr + 32)) = -int64(octalSignificandWide)
	goto __213
__212:
	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(octalSignificandWide)
__213:
	;
__211:
	;
__209:
	;
	if !(octalSignificandOverflow != 0) {
		goto __214
	}
	if !(signum != 0) {
		goto __215
	}
	XTclBN_mp_neg(tls, bp+88, bp+88)
__215:
	;
	XTclSetBignumInternalRep(tls, objPtr, bp+88)
__214:
	;
	goto __166

__188:
__189:
	significandOverflow = sAccumulateDecimalDigit(tls, uint32(0), numTrailZeros-1,
		bp+56, bp+64, significandOverflow)
	if !(!(significandOverflow != 0) && *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56)) > Tcl_WideUInt(libc.CplUint64(uint64(0)))>>1+Tcl_WideUInt(signum)) {
		goto __216
	}
	significandOverflow = 1
	XTclBNInitBignumFromWideUInt(tls, bp+64, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)))
__216:
	;
returnInteger:
	if !!(significandOverflow != 0) {
		goto __217
	}
	if !(*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56)) > uint64(libc.CplUint64(uint64(0)))>>1+uint64(signum)) {
		goto __218
	}
	XTclBNInitBignumFromWideUInt(tls, bp+64,
		*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)))
	significandOverflow = 1
	goto __219
__218:
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
	if !(signum != 0) {
		goto __220
	}
	*(*int64)(unsafe.Pointer(objPtr + 32)) = -int64(*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)))
	goto __221
__220:
	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(*(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)))
__221:
	;
__219:
	;
__217:
	;
	if !(significandOverflow != 0) {
		goto __222
	}
	if !(signum != 0) {
		goto __223
	}
	XTclBN_mp_neg(tls, bp+64, bp+64)
__223:
	;
	XTclSetBignumInternalRep(tls, objPtr, bp+64)
__222:
	;
	goto __166

__190:
__191:

	// Here, we're parsing a floating-point number. 'significandWide'
	// or 'significandBig' contains the exact significand, according
	// to whether 'significandOverflow' is set. The desired floating
	// point value is significand * 10**k, where
	// k = numTrailZeros+exponent-numDigitsAfterDp.

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType))
	if !(exponentSignum != 0) {
		goto __224
	}
	// At this point exponent>=0, so the following calculation
	// cannot underflow.
	exponent = -exponent
__224:
	;

	// Adjust the exponent for the number of trailing zeros that
	// have not been accumulated, and the number of digits after
	// the decimal point. Pin any overflow to LONG_MAX/LONG_MIN
	// respectively.

	if !(exponent >= int64(0)) {
		goto __225
	}
	if !(exponent-int64(numDigitsAfterDp) > 0x7fffffffffffffff-int64(numTrailZeros)) {
		goto __227
	}
	exponent = 0x7fffffffffffffff
	goto __228
__227:
	exponent = exponent - int64(numDigitsAfterDp) + int64(numTrailZeros)
__228:
	;
	goto __226
__225:
	if !(exponent+int64(numTrailZeros) < -0x7fffffffffffffff-1+int64(numDigitsAfterDp)) {
		goto __229
	}
	exponent = -0x7fffffffffffffff - 1
	goto __230
__229:
	exponent = exponent + int64(numTrailZeros) - int64(numDigitsAfterDp)
__230:
	;
__226:
	;

	// The desired number is now significandWide * 10**exponent
	// or significandBig * 10**exponent, depending on whether
	// the significand has overflowed a wide int.
	if !!(significandOverflow != 0) {
		goto __231
	}
	*(*float64)(unsafe.Pointer(objPtr + 32)) = sMakeLowPrecisionDouble(tls,
		signum, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)), numSigDigs, exponent)
	goto __232
__231:
	*(*float64)(unsafe.Pointer(objPtr + 32)) = sMakeHighPrecisionDouble(tls,
		signum, bp+64, numSigDigs, exponent)
__232:
	;
	goto __166

__192:
__193:
	if !(signum != 0) {
		goto __233
	}
	*(*float64)(unsafe.Pointer(objPtr + 32)) = -libc.X__builtin_huge_val(tls)
	goto __234
__233:
	*(*float64)(unsafe.Pointer(objPtr + 32)) = libc.X__builtin_huge_val(tls)
__234:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType))
	goto __166

__194:
__195:
	*(*float64)(unsafe.Pointer(objPtr + 32)) = sMakeNaN(tls, signum, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 56 /* significandWide */)))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType))
	goto __166
__196:
	// This case only to silence compiler warning.
	XTcl_Panic(tls, ts+64278, 0)
__166:
	;
__163:
	;

	// Format an error message when an invalid number is encountered.

	if !(status != TCL_OK) {
		goto __235
	}
	if !(interp != uintptr(0)) {
		goto __236
	}
	msg = XTcl_ObjPrintf(tls, ts+64326,
		libc.VaList(bp+16, expected))

	XTcl_AppendLimitedToObj(tls, msg, bytes, numBytes, 50, ts+2046)
	XTcl_AppendToObj(tls, msg, ts+25027, -1)
	if !(state == uint32(9)) {
		goto __237
	}
	XTcl_AppendToObj(tls, msg, ts+64348, -1)
__237:
	;
	XTcl_SetObjResult(tls, interp, msg)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+3593, ts+6915, ts+34643, uintptr(0)))
__236:
	;
__235:
	;

	// Free memory.

	if !(octalSignificandOverflow != 0) {
		goto __238
	}
	XTclBN_mp_clear(tls, bp+88)
__238:
	;
	if !(significandOverflow != 0) {
		goto __239
	}
	XTclBN_mp_clear(tls, bp+64)
__239:
	;
	return status
}

//----------------------------------------------------------------------
//
// AccumulateDecimalDigit --
//
//	Consume a decimal digit in a number being scanned.
//
// Results:
//	Returns 1 if the number has overflowed to a bignum, 0 if it still fits
//	in a wide integer.
//
// Side effects:
//	Updates either the wide or bignum representation.
//
//----------------------------------------------------------------------

func sAccumulateDecimalDigit(tls *libc.TLS, digit uint32, numZeros int32, wideRepPtr uintptr, bignumRepPtr uintptr, bignumFlag int32) int32 { /* tclStrToD.c:1467:1: */
	var i int32
	var n int32
	var w Tcl_WideUInt

	// Try wide multiplication first.

	if !(bignumFlag != 0) {
		w = *(*Tcl_WideUInt)(unsafe.Pointer(wideRepPtr))
		if w == uint64(0) {
			// There's no need to multiply if the multiplicand is zero.

			*(*Tcl_WideUInt)(unsafe.Pointer(wideRepPtr)) = Tcl_WideUInt(digit)
			return 0
		} else if numZeros >= maxpow10_wide ||
			w > (libc.CplUint64(uint64(0))-Tcl_WideUInt(digit)) / *(*Tcl_WideUInt)(unsafe.Pointer(pow10_wide + uintptr(numZeros+1)*8)) {
			// Wide multiplication will overflow.  Expand the number to a
			// bignum and fall through into the bignum case.

			XTclBNInitBignumFromWideUInt(tls, bignumRepPtr, w)
		} else {
			// Wide multiplication.

			*(*Tcl_WideUInt)(unsafe.Pointer(wideRepPtr)) = w**(*Tcl_WideUInt)(unsafe.Pointer(pow10_wide + uintptr(numZeros+1)*8)) + Tcl_WideUInt(digit)
			return 0
		}
	}

	// Bignum multiplication.

	if numZeros < log10_DIGIT_MAX {
		// Up to about 8 zeros - single digit multiplication.

		XTclBN_mp_mul_d(tls, bignumRepPtr, Mp_digit(*(*Tcl_WideUInt)(unsafe.Pointer(pow10_wide + uintptr(numZeros+1)*8))),
			bignumRepPtr)
		XTclBN_mp_add_d(tls, bignumRepPtr, digit, bignumRepPtr)
	} else {
		// More than single digit multiplication. Multiply by the appropriate
		// small powers of 5, and then shift. Large strings of zeroes are
		// eaten 256 at a time; this is less efficient than it could be, but
		// seems implausible. We presume that MP_DIGIT_BIT is at least 27. The
		// first multiplication, by up to 10**7, is done with a one-DIGIT
		// multiply (this presumes that MP_DIGIT_BIT >= 24).

		n = numZeros + 1
		XTclBN_mp_mul_d(tls, bignumRepPtr, Mp_digit(*(*Tcl_WideUInt)(unsafe.Pointer(pow10_wide + uintptr(n&0x7)*8))), bignumRepPtr)
		for i = 3; i <= 7; i++ {
			if n&(int32(1)<<i) != 0 {
				XTclBN_mp_mul(tls, bignumRepPtr, uintptr(unsafe.Pointer(&pow5))+uintptr(i)*24, bignumRepPtr)
			}
		}
		for n >= 256 {
			XTclBN_mp_mul(tls, bignumRepPtr, uintptr(unsafe.Pointer(&pow5))+uintptr(8)*24, bignumRepPtr)
			n = n - 256
		}
		XTclBN_mp_mul_2d(tls, bignumRepPtr, (numZeros+1)&libc.CplInt32(0x7), bignumRepPtr)
		XTclBN_mp_add_d(tls, bignumRepPtr, digit, bignumRepPtr)
	}

	return 1
}

//----------------------------------------------------------------------
//
// MakeLowPrecisionDouble --
//
//	Makes the double precision number, signum*significand*10**exponent.
//
// Results:
//	Returns the constructed number.
//
//	Common cases, where there are few enough digits that the number can be
//	represented with at most roundoff, are handled specially here. If the
//	number requires more than one rounded operation to compute, the code
//	promotes the significand to a bignum and calls MakeHighPrecisionDouble
//	to do it instead.
//
//----------------------------------------------------------------------

func sMakeLowPrecisionDouble(tls *libc.TLS, signum int32, significand Tcl_WideUInt, numSigDigs int32, exponent int64) float64 { /* tclStrToD.c:1572:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var retval float64 // Value of the number.
	// var significandBig Mp_int at bp, 24

	// 10**exponent is not an exact integer, but
	// 10**(exponent-diff) is exact, and so is
	// significand*10**diff, so we can still compute the value
	// with only one roundoff.

	var factor float64
	var diff int32 // Significand expressed as a bignum.

	// With gcc on x86, the floating point rounding mode is double-extended.
	// This causes the result of double-precision calculations to be rounded
	// twice: once to the precision of double-extended and then again to the
	// precision of double. Double-rounding introduces gratuitous errors of 1
	// ulp, so we need to change rounding mode to 53-bits.

	// Test for the easy cases.

	if !(significand == uint64(0)) {
		goto __1
	}
	return libc.Xcopysign(tls, 0.0, float64(-signum))
__1:
	;
	if !(numSigDigs <= QUICK_MAX) {
		goto __2
	}
	if !(exponent >= int64(0)) {
		goto __3
	}
	if !(exponent <= int64(mmaxpow)) {
		goto __5
	}
	// The significand is an exact integer, and so is
	// 10**exponent. The product will be correct to within 1/2 ulp
	// without special handling.

	retval = float64(Tcl_WideInt(significand)) * pow10vals[exponent]
	goto returnValue
	goto __6
__5:
	diff = QUICK_MAX - numSigDigs

	if !(exponent-int64(diff) <= int64(mmaxpow)) {
		goto __7
	}
	// 10**exponent is not an exact integer, but
	// 10**(exponent-diff) is exact, and so is
	// significand*10**diff, so we can still compute the value
	// with only one roundoff.

	factor = float64(Tcl_WideInt(significand)) * pow10vals[diff]
	retval = factor * pow10vals[exponent-int64(diff)]
	goto returnValue
__7:
	;
__6:
	;
	goto __4
__3:
	if !(exponent >= int64(-mmaxpow)) {
		goto __8
	}
	// 10**-exponent is an exact integer, and so is the
	// significand. Compute the result by one division, again with
	// only one rounding.

	retval = float64(Tcl_WideInt(significand)) / pow10vals[-exponent]
	goto returnValue
__8:
	;
__4:
	;
__2:
	;

	// All the easy cases have failed. Promote ths significand to bignum and
	// call MakeHighPrecisionDouble to do it the hard way.

	XTclBNInitBignumFromWideUInt(tls, bp, significand)
	retval = sMakeHighPrecisionDouble(tls, 0, bp, numSigDigs,
		exponent)
	XTclBN_mp_clear(tls, bp)

	// Come here to return the computed value.

returnValue:
	if !(signum != 0) {
		goto __9
	}
	retval = -retval
__9:
	;

	// On gcc on x86, restore the floating point mode word.

	return retval
}

//----------------------------------------------------------------------
//
// MakeHighPrecisionDouble --
//
//	Makes the double precision number, signum*significand*10**exponent.
//
// Results:
//	Returns the constructed number.
//
//	MakeHighPrecisionDouble is used when arbitrary-precision arithmetic is
//	needed to ensure correct rounding. It begins by calculating a
//	low-precision approximation to the desired number, and then refines
//	the answer in high precision.
//
//----------------------------------------------------------------------

func sMakeHighPrecisionDouble(tls *libc.TLS, signum int32, significand uintptr, numSigDigs int32, exponent int64) float64 { /* tclStrToD.c:1689:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var retval float64
	// var machexp int32 at bp, 4
	// Machine exponent of a power of 10.

	// With gcc on x86, the floating point rounding mode is double-extended.
	// This causes the result of double-precision calculations to be rounded
	// twice: once to the precision of double-extended and then again to the
	// precision of double. Double-rounding introduces gratuitous errors of 1
	// ulp, so we need to change rounding mode to 53-bits.

	// Quick checks for zero, and over/underflow. Be careful to avoid
	// integer overflow when calculating with 'exponent'.

	if !(func() int32 {
		if (*Mp_int)(unsafe.Pointer(significand)).Fused == 0 {
			return MP_YES
		}
		return MP_NO
	}() != 0) {
		goto __1
	}
	return libc.Xcopysign(tls, 0.0, float64(-signum))
__1:
	;
	if !(exponent >= int64(0) && exponent-int64(1) > int64(maxDigits-numSigDigs)) {
		goto __2
	}
	retval = libc.X__builtin_huge_val(tls)
	goto returnValue
	goto __3
__2:
	if !(exponent < int64(0) && int64(numSigDigs)+exponent < int64(minDigits+1)) {
		goto __4
	}
	retval = 0.0
	goto returnValue
__4:
	;
__3:
	;

	// Develop a first approximation to the significand. It is tempting simply
	// to force bignum to double, but that will overflow on input numbers like
	// 1.[string repeat 0 1000]1; while this is a not terribly likely
	// scenario, we still have to deal with it. Use fraction and exponent
	// instead. Once we have the significand, multiply by 10**exponent. Test
	// for overflow. Convert back to a double, and test for underflow.

	retval = sBignumToBiasedFrExp(tls, significand, bp)
	retval = sPow10TimesFrExp(tls, int32(exponent), retval, bp)
	if !(*(*int32)(unsafe.Pointer(bp)) > 1024*log2FLT_RADIX) {
		goto __5
	}
	retval = libc.X__builtin_huge_val(tls)
	goto returnValue
__5:
	;
	retval = sSafeLdExp(tls, retval, *(*int32)(unsafe.Pointer(bp /* machexp */)))
	if !(tiny == 0.0) {
		goto __6
	}
	tiny = sSafeLdExp(tls, 1.0, -1021*log2FLT_RADIX-mantBits)
__6:
	;
	if !(retval < tiny) {
		goto __7
	}
	retval = tiny
__7:
	;

	// Refine the result twice. (The second refinement should be necessary
	// only if the best approximation is a power of 2 minus 1/2 ulp).

	retval = sRefineApproximation(tls, retval, significand, int32(exponent))
	retval = sRefineApproximation(tls, retval, significand, int32(exponent))

	// Come here to return the computed value.

returnValue:
	if !(signum != 0) {
		goto __8
	}
	retval = -retval
__8:
	;

	// On gcc on x86, restore the floating point mode word.

	return retval
}

//----------------------------------------------------------------------
//
// MakeNaN --
//
//	Makes a "Not a Number" given a set of bits to put in the tag bits
//
//	Note that a signalling NaN is never returned.
//
//----------------------------------------------------------------------

func sMakeNaN(tls *libc.TLS, signum int32, tags Tcl_WideUInt) float64 { /* tclStrToD.c:1787:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var theNaN struct {Fiv Tcl_WideUInt;} at bp, 8

	*(*Tcl_WideUInt)(unsafe.Pointer(bp)) = tags
	*(*Tcl_WideUInt)(unsafe.Pointer(bp)) &= Tcl_WideUInt(uint64(1))<<51 - uint64(1)
	if signum != 0 {
		*(*Tcl_WideUInt)(unsafe.Pointer(bp)) |= Tcl_WideUInt(uint64(0x8000|NAN_START)) << 48
	} else {
		*(*Tcl_WideUInt)(unsafe.Pointer(bp)) |= Tcl_WideUInt(uint64(NAN_START)) << 48
	}
	if n770_fp != 0 {
		*(*Tcl_WideUInt)(unsafe.Pointer(bp)) = sNokia770Twiddle(tls, *(*Tcl_WideUInt)(unsafe.Pointer(bp)))
	}
	return *(*float64)(unsafe.Pointer(bp))
}

//----------------------------------------------------------------------
//
// RefineApproximation --
//
//	Given a poor approximation to a floating point number, returns a
//	better one. (The better approximation is correct to within 1 ulp, and
//	is entirely correct if the poor approximation is correct to 1 ulp.)
//
// Results:
//	Returns the improved result.
//
//----------------------------------------------------------------------

func sRefineApproximation(tls *libc.TLS, approxResult float64, exactSignificand uintptr, exponent int32) float64 { /* tclStrToD.c:1826:1: */
	bp := tls.Alloc(60)
	defer tls.Free(60)

	var M2 int32
	var M5 int32 // Powers of 2 and of 5 needed to put the
	// decimal and binary numbers over a common
	// denominator.
	var significand float64 // Sigificand of the binary number.
	// var binExponent int32 at bp, 4
	// Exponent of the binary number.
	var msb int32 // Most significant bit position of an
	// intermediate result.
	var nDigits int32 // Number of mp_digit's in an intermediate
	// result.
	// var twoMv Mp_int at bp+8, 24
	// Approx binary value expressed as an exact
	// integer scaled by the multiplier 2M.
	// var twoMd Mp_int at bp+32, 24
	// Exact decimal value expressed as an exact
	// integer scaled by the multiplier 2M.
	var scale int32      // Scale factor for M.
	var multiplier int32 // Power of two to scale M.
	var num float64
	var den float64 // Numerator and denominator of the correction
	// term.
	var quot float64    // Correction term.
	var minincr float64 // Lower bound on the absolute value of the
	// correction term.
	var roundToEven int32 = 0 // Flag == TRUE if we need to invoke
	// "round to even" functionality
	var rteSignificand float64 // Significand of the round-to-even result
	// var rteExponent int32 at bp+56, 4
	// Exponent of the round-to-even result
	var shift int32 // Shift count for converting numerator
	// and denominator of corrector to floating
	// point
	var rteSigWide Tcl_WideInt // Wide integer version of the significand
	// for testing evenness
	var i int32

	// The first approximation is always low. If we find that it's HUGE_VAL,
	// we're done.

	if approxResult == libc.X__builtin_huge_val(tls) {
		return approxResult
	}
	significand = libc.Xfrexp(tls, approxResult, bp)

	// We are trying to compute a corrector term that, when added to the
	// approximate result, will yield close to the exact result.
	// The exact result is exactSignificand * 10**exponent.
	// The approximate result is significand * 2**binExponent
	// If exponent<0, we need to multiply the exact value by 10**-exponent
	// to make it an integer, plus another factor of 2 to decide on rounding.
	//  Similarly if binExponent<FP_PRECISION, we need
	// to multiply by 2**FP_PRECISION to make the approximate value an integer.
	//
	// Let M = 2**M2 * 5**M5 be the least common multiple of these two
	// multipliers.

	i = mantBits - *(*int32)(unsafe.Pointer(bp))
	if i < 0 {
		M2 = 0
	} else {
		M2 = i
	}
	if exponent > 0 {
		M5 = 0
	} else {
		M5 = -exponent
		if M5-1 > M2 {
			M2 = M5 - 1
		}
	}

	// Compute twoMv as 2*M*v, where v is the approximate value.
	// This is done by bit-whacking to calculate 2**(M2+1)*significand,
	// and then multiplying by 5**M5.

	msb = *(*int32)(unsafe.Pointer(bp)) + M2 // 1008
	nDigits = msb/MP_DIGIT_BIT + 1
	XTclBN_mp_init_size(tls, bp+8, nDigits)
	i = msb%MP_DIGIT_BIT + 1
	(*Mp_int)(unsafe.Pointer(bp + 8 /* &twoMv */)).Fused = nDigits
	significand = significand * sSafeLdExp(tls, 1.0, i)
	for libc.PreDecInt32(&nDigits, 1) >= 0 {
		*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+8 /* &twoMv */)).Fdp + uintptr(nDigits)*4)) = Mp_digit(significand)
		significand = significand - float64(Mp_digit(significand))
		significand = sSafeLdExp(tls, significand, MP_DIGIT_BIT)
	}
	for i = 0; i <= 8; i++ {
		if M5&(int32(1)<<i) != 0 {
			XTclBN_mp_mul(tls, bp+8, uintptr(unsafe.Pointer(&pow5))+uintptr(i)*24, bp+8)
		}
	}

	// Compute twoMd as 2*M*d, where d is the exact value.
	// This is done by multiplying by 5**(M5+exponent) and then multiplying
	// by 2**(M5+exponent+1), which is, of couse, a left shift.

	XTclBN_mp_init_copy(tls, bp+32, exactSignificand)
	for i = 0; i <= 8; i++ {
		if (M5+exponent)&(int32(1)<<i) != 0 {
			XTclBN_mp_mul(tls, bp+32, uintptr(unsafe.Pointer(&pow5))+uintptr(i)*24, bp+32)
		}
	}
	XTclBN_mp_mul_2d(tls, bp+32, M2+exponent+1, bp+32)

	// Now let twoMd = twoMd - twoMv, the difference between the exact and
	// approximate values.

	XTclBN_mp_sub(tls, bp+32, bp+8, bp+32)

	// The result, 2Mv-2Md, needs to be divided by 2M to yield a correction
	// term. Because 2M may well overflow a double, we need to scale the
	// denominator by a factor of 2**binExponent-mantBits. Place that factor
	// times 1/2 ULP into twoMd.

	scale = *(*int32)(unsafe.Pointer(bp)) - mantBits - 1
	XTclBN_mp_set(tls, bp+8, uint32(1))
	for i = 0; i <= 8; i++ {
		if M5&(int32(1)<<i) != 0 {
			XTclBN_mp_mul(tls, bp+8, uintptr(unsafe.Pointer(&pow5))+uintptr(i)*24, bp+8)
		}
	}
	multiplier = M2 + scale + 1
	if multiplier > 0 {
		XTclBN_mp_mul_2d(tls, bp+8, multiplier, bp+8)
	} else if multiplier < 0 {
		XTclBN_mp_div_2d(tls, bp+8, -multiplier, bp+8, uintptr(0))
	}

	// Will the eventual correction term be less than, equal to, or
	// greater than 1/2 ULP?

	switch XTclBN_mp_cmp_mag(tls, bp+32, bp+8) {
	case -1:
		// If the error is less than 1/2 ULP, there's no correction to make.
		XTclBN_mp_clear(tls, bp+32)
		XTclBN_mp_clear(tls, bp+8)
		return approxResult
	case MP_EQ:
		// If the error is exactly 1/2 ULP, we need to round to even.
		roundToEven = 1
		break
	case MP_GT:
		// We need to correct the result if the error exceeds 1/2 ULP.
		break
	}

	// If we're in the 'round to even' case, and the significand is already
	// even, we're done. Return the approximate result.
	if roundToEven != 0 {
		rteSignificand = libc.Xfrexp(tls, approxResult, bp+56)
		rteSigWide = libc.Int64FromFloat64(libc.Xldexp(tls, rteSignificand, FP_PRECISION))
		if rteSigWide&int64(1) == int64(0) {
			XTclBN_mp_clear(tls, bp+32)
			XTclBN_mp_clear(tls, bp+8)
			return approxResult
		}
	}

	// Reduce the numerator and denominator of the corrector term so that
	// they will fit in the floating point precision.
	shift = XTclBN_mp_count_bits(tls, bp+8) - FP_PRECISION - 1
	if shift > 0 {
		XTclBN_mp_div_2d(tls, bp+8, shift, bp+8, uintptr(0))
		XTclBN_mp_div_2d(tls, bp+32, shift, bp+32, uintptr(0))
	}

	// Convert the numerator and denominator of the corrector term accurately
	// to floating point numbers.

	num = XTclBignumToDouble(tls, bp+32)
	den = XTclBignumToDouble(tls, bp+8)

	quot = sSafeLdExp(tls, num/den, scale)
	minincr = sSafeLdExp(tls, 1.0, *(*int32)(unsafe.Pointer(bp))-mantBits)

	if quot < 0. && quot > -minincr {
		quot = -minincr
	} else if quot > 0. && quot < minincr {
		quot = minincr
	}

	XTclBN_mp_clear(tls, bp+32)
	XTclBN_mp_clear(tls, bp+8)

	return approxResult + quot
}

//----------------------------------------------------------------------
//
// MultPow5 --
//
//	Multiply a bignum by a power of 5.
//
// Side effects:
//	Stores base*5**n in result.
//
//----------------------------------------------------------------------

func sMulPow5(tls *libc.TLS, base uintptr, n uint32, result uintptr) { /* tclStrToD.c:2053:1: */
	var p uintptr = base
	var n13 int32 = int32(n / uint32(13))
	var r int32 = int32(n % uint32(13))

	if r != 0 {
		XTclBN_mp_mul_d(tls, p, dpow5[r], result)
		p = result
	}
	r = 0
	for n13 != 0 {
		if n13&1 != 0 {
			XTclBN_mp_mul(tls, p, uintptr(unsafe.Pointer(&pow5_13))+uintptr(r)*24, result)
			p = result
		}
		n13 >>= 1
		r++
	}
	if p != result {
		XTclBN_mp_copy(tls, p, result)
	}
}

//----------------------------------------------------------------------
//
// NormalizeRightward --
//
//	Shifts a number rightward until it is odd (that is, until the least
//	significant bit is nonzero.
//
// Results:
//	Returns the number of bit positions by which the number was shifted.
//
// Side effects:
//	Shifts the number in place; *wPtr is replaced by the shifted number.
//
//----------------------------------------------------------------------

func sNormalizeRightward(tls *libc.TLS, wPtr uintptr) int32 { /* tclStrToD.c:2098:1: */
	var rv int32 = 0
	var w Tcl_WideUInt = *(*Tcl_WideUInt)(unsafe.Pointer(wPtr))

	if !(w&uint64(0xFFFFFFFF) != 0) {
		w >>= 32
		rv = rv + 32
	}
	if !(w&uint64(0xFFFF) != 0) {
		w >>= 16
		rv = rv + 16
	}
	if !(w&uint64(0xFF) != 0) {
		w >>= 8
		rv = rv + 8
	}
	if !(w&uint64(0xF) != 0) {
		w >>= 4
		rv = rv + 4
	}
	if !(w&uint64(0x3) != 0) {
		w >>= 2
		rv = rv + 2
	}
	if !(w&uint64(0x1) != 0) {
		w >>= 1
		rv++
	}
	*(*Tcl_WideUInt)(unsafe.Pointer(wPtr)) = w
	return rv
}

//----------------------------------------------------------------------
//
// RequiredPrecision --
//
//	Determines the number of bits needed to hold an intger.
//
// Results:
//	Returns the position of the most significant bit (0 - 63).  Returns 0
//	if the number is zero.
//
//----------------------------------------------------------------------

func sRequiredPrecision(tls *libc.TLS, w Tcl_WideUInt) int32 { /* tclStrToD.c:2141:1: */
	var rv int32
	var wi uint64

	if w&(Tcl_WideUInt(uint64(0xFFFFFFFF))<<32) != 0 {
		wi = w >> 32
		rv = 32
	} else {
		wi = w
		rv = 0
	}
	if wi&uint64(0xFFFF0000) != 0 {
		wi >>= 16
		rv = rv + 16
	}
	if wi&uint64(0xFF00) != 0 {
		wi >>= 8
		rv = rv + 8
	}
	if wi&uint64(0xF0) != 0 {
		wi >>= 4
		rv = rv + 4
	}
	if wi&uint64(0xC) != 0 {
		wi >>= 2
		rv = rv + 2
	}
	if wi&uint64(0x2) != 0 {
		wi >>= 1
		rv++
	}
	if wi&uint64(0x1) != 0 {
		rv++
	}
	return rv
}

//----------------------------------------------------------------------
//
// DoubleToExpAndSig --
//
//	Separates a 'double' into exponent and significand.
//
// Side effects:
//	Stores the significand in '*significand' and the exponent in '*expon'
//	so that dv == significand * 2.0**expon, and significand is odd.  Also
//	stores the position of the leftmost 1-bit in 'significand' in 'bits'.
//
//----------------------------------------------------------------------

func sDoubleToExpAndSig(tls *libc.TLS, dv float64, significand uintptr, expon uintptr, bits uintptr) { /* tclStrToD.c:2189:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var d Double at bp, 8
	// Number being converted.
	// var z Tcl_WideUInt at bp+8, 8
	// Significand under construction.
	var de int32 // Exponent of the number.
	var k int32  // Bit count.

	*(*float64)(unsafe.Pointer(bp)) = dv

	// Extract exponent and significand.

	de = *(*int32)(unsafe.Pointer(bp + 4)) & EXP_MASK >> EXP_SHIFT
	*(*Tcl_WideUInt)(unsafe.Pointer(bp + 8 /* z */)) = *(*Tcl_WideUInt)(unsafe.Pointer(bp)) & (Tcl_WideUInt(uint64(HI_ORDER_SIG_MASK))<<32 | uint64(0xFFFFFFFF))
	if de != 0 {
		*(*Tcl_WideUInt)(unsafe.Pointer(bp + 8 /* z */)) |= Tcl_WideUInt(uint64(0x00100000)) << 32
		k = sNormalizeRightward(tls, bp+8)
		*(*int32)(unsafe.Pointer(bits)) = FP_PRECISION - k
		*(*int32)(unsafe.Pointer(expon)) = k + (de - EXPONENT_BIAS) - (FP_PRECISION - 1)
	} else {
		k = sNormalizeRightward(tls, bp+8)
		*(*int32)(unsafe.Pointer(expon)) = k + (de - EXPONENT_BIAS) - (FP_PRECISION - 1) + 1
		*(*int32)(unsafe.Pointer(bits)) = sRequiredPrecision(tls, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8 /* z */)))
	}
	*(*Tcl_WideUInt)(unsafe.Pointer(significand)) = *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8 /* z */))
}

//----------------------------------------------------------------------
//
// TakeAbsoluteValue --
//
//	Takes the absolute value of a 'double' including 0, Inf and NaN
//
// Side effects:
//	The 'double' in *d is replaced with its absolute value. The signum is
//	stored in 'sign': 1 for negative, 0 for nonnegative.
//
//----------------------------------------------------------------------

func sTakeAbsoluteValue(tls *libc.TLS, d uintptr, sign uintptr) { /* tclStrToD.c:2237:1: */
	if uint32(*(*int32)(unsafe.Pointer(d + 4)))&SIGN_BIT != 0 {
		*(*int32)(unsafe.Pointer(sign)) = 1
		*(*int32)(unsafe.Pointer(d + 4)) &= int32(libc.CplUint32(SIGN_BIT))
	} else {
		*(*int32)(unsafe.Pointer(sign)) = 0
	}
}

//----------------------------------------------------------------------
//
// FormatInfAndNaN --
//
//	Bailout for formatting infinities and Not-A-Number.
//
// Results:
//	Returns one of the strings 'Infinity' and 'NaN'.  The string returned
//	must be freed by the caller using 'ckfree'.
//
// Side effects:
//	Stores 9999 in *decpt, and sets '*endPtr' to designate the terminating
//	NUL byte of the string if 'endPtr' is not NULL.
//
//----------------------------------------------------------------------

func sFormatInfAndNaN(tls *libc.TLS, d uintptr, decpt uintptr, endPtr uintptr) uintptr { /* tclStrToD.c:2267:20: */
	var retval uintptr

	*(*int32)(unsafe.Pointer(decpt)) = 9999
	if !(*(*int32)(unsafe.Pointer(d)) != 0) && !(*(*int32)(unsafe.Pointer(d + 4))&HI_ORDER_SIG_MASK != 0) {
		retval = XTcl_Alloc(tls, uint32(9))
		libc.Xstrcpy(tls, retval, ts+64383)
		if endPtr != 0 {
			*(*uintptr)(unsafe.Pointer(endPtr)) = retval + uintptr(8)
		}
	} else {
		retval = XTcl_Alloc(tls, uint32(4))
		libc.Xstrcpy(tls, retval, ts+64392)
		if endPtr != 0 {
			*(*uintptr)(unsafe.Pointer(endPtr)) = retval + uintptr(3)
		}
	}
	return retval
}

//----------------------------------------------------------------------
//
// FormatZero --
//
//	Bailout to format a zero floating-point number.
//
// Results:
//	Returns the constant string "0"
//
// Side effects:
//	Stores 1 in '*decpt' and puts a pointer to the NUL byte terminating
//	the string in '*endPtr' if 'endPtr' is not NULL.
//
//----------------------------------------------------------------------

func sFormatZero(tls *libc.TLS, decpt uintptr, endPtr uintptr) uintptr { /* tclStrToD.c:2309:20: */
	var retval uintptr = XTcl_Alloc(tls, uint32(2))

	libc.Xstrcpy(tls, retval, ts+18333)
	if endPtr != 0 {
		*(*uintptr)(unsafe.Pointer(endPtr)) = retval + uintptr(1)
	}
	*(*int32)(unsafe.Pointer(decpt)) = 0
	return retval
}

//----------------------------------------------------------------------
//
// ApproximateLog10 --
//
//	Computes a two-term Taylor series approximation to the common log of a
//	number, and computes the number's binary log.
//
// Results:
//	Return an approximation to floor(log10(bw*2**be)) that is either exact
//	or 1 too high.
//
//----------------------------------------------------------------------

func sApproximateLog10(tls *libc.TLS, bw Tcl_WideUInt, be int32, bbits int32) int32 { /* tclStrToD.c:2340:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var i int32    // Log base 2 of the number.
	var k int32    // Floor(Log base 10 of the number)
	var ds float64 // Mantissa of the number.
	// var d2 Double at bp, 8

	// Compute i and d2 such that d = d2*2**i, and 1 < d2 < 2.
	// Compute an approximation to log10(d),
	//   log10(d) ~ log10(2) * i + log10(1.5)
	//            + (significand-1.5)/(1.5 * log(10))

	*(*Tcl_WideUInt)(unsafe.Pointer(bp)) = bw << (FP_PRECISION - bbits) & (Tcl_WideUInt(uint64(HI_ORDER_SIG_MASK))<<32 | uint64(0xFFFFFFFF))
	*(*int32)(unsafe.Pointer(bp + 4)) |= int32(EXPONENT_BIAS) << EXP_SHIFT
	i = be + bbits - 1
	ds = (*(*float64)(unsafe.Pointer(bp))-1.5)*0.28952965460216784 +
		0.1760912590558 + 0.3010299956639812*float64(i)
	k = int32(ds)
	if float64(k) > ds {
		k--
	}
	return k
}

//----------------------------------------------------------------------
//
// BetterLog10 --
//
//	Improves the result of ApproximateLog10 for numbers in the range
//	1 .. 10**(TEN_PMAX)-1
//
// Side effects:
//	Sets k_check to 0 if the new result is known to be exact, and to 1 if
//	it may still be one too high.
//
// Results:
//	Returns the improved approximation to log10(d).
//
//----------------------------------------------------------------------

func sBetterLog10(tls *libc.TLS, d float64, k int32, k_check uintptr) int32 { /* tclStrToD.c:2388:1: */
	// Performance hack. If k is in the range 0..TEN_PMAX, then we can use a
	// powers-of-ten table to check it.

	if k >= 0 && k <= TEN_PMAX {
		if d < tens[k] {
			k--
		}
		*(*int32)(unsafe.Pointer(k_check)) = 0
	} else {
		*(*int32)(unsafe.Pointer(k_check)) = 1
	}
	return k
}

//----------------------------------------------------------------------
//
// ComputeScale --
//
//	Prepares to format a floating-point number as decimal.
//
// Parameters:
//	floor(log10*x) is k (or possibly k-1).  floor(log2(x) is i.  The
//	significand of x requires bbits bits to represent.
//
// Results:
//	Determines integers b2, b5, s2, s5 so that sig*2**b2*5**b5/2**s2*2**s5
//	exactly represents the value of the x/10**k. This value will lie in
//	the range [1 .. 10), and allows for computing successive digits by
//	multiplying sig%10 by 10.
//
//----------------------------------------------------------------------

func sComputeScale(tls *libc.TLS, be int32, k int32, b2 uintptr, b5 uintptr, s2 uintptr, s5 uintptr) { /* tclStrToD.c:2431:1: */
	// Scale numerator and denominator powers of 2 so that the input binary
	// number is the ratio of integers.

	if be <= 0 {
		*(*int32)(unsafe.Pointer(b2)) = 0
		*(*int32)(unsafe.Pointer(s2)) = -be
	} else {
		*(*int32)(unsafe.Pointer(b2)) = be
		*(*int32)(unsafe.Pointer(s2)) = 0
	}

	// Scale numerator and denominator so that the output decimal number is
	// the ratio of integers.

	if k >= 0 {
		*(*int32)(unsafe.Pointer(b5)) = 0
		*(*int32)(unsafe.Pointer(s5)) = k
		*(*int32)(unsafe.Pointer(s2)) += k
	} else {
		*(*int32)(unsafe.Pointer(b2)) -= k
		*(*int32)(unsafe.Pointer(b5)) = -k
		*(*int32)(unsafe.Pointer(s5)) = 0
	}
}

//----------------------------------------------------------------------
//
// SetPrecisionLimits --
//
//	Determines how many digits of significance should be computed (and,
//	hence, how much memory need be allocated) for formatting a floating
//	point number.
//
// Given that 'k' is floor(log10(x)):
// if 'shortest' format is used, there will be at most 18 digits in the
// result.
// if 'F' format is used, there will be at most 'ndigits' + k + 1 digits
// if 'E' format is used, there will be exactly 'ndigits' digits.
//
// Side effects:
//	Adjusts '*ndigitsPtr' to have a valid value. Stores the maximum memory
//	allocation needed in *iPtr.  Sets '*iLimPtr' to the limiting number of
//	digits to convert if k has been guessed correctly, and '*iLim1Ptr' to
//	the limiting number of digits to convert if k has been guessed to be
//	one too high.
//
//----------------------------------------------------------------------

func sSetPrecisionLimits(tls *libc.TLS, convType int32, k int32, ndigitsPtr uintptr, iPtr uintptr, iLimPtr uintptr, iLim1Ptr uintptr) { /* tclStrToD.c:2494:1: */
	switch convType {
	case TCL_DD_SHORTEST0:
		fallthrough
	case TCL_DD_STEELE0:
		*(*int32)(unsafe.Pointer(iLimPtr)) = libc.AssignPtrInt32(iLim1Ptr, -1)
		*(*int32)(unsafe.Pointer(iPtr)) = 18
		*(*int32)(unsafe.Pointer(ndigitsPtr)) = 0
		break
	case TCL_DD_E_FORMAT:
		if *(*int32)(unsafe.Pointer(ndigitsPtr)) <= 0 {
			*(*int32)(unsafe.Pointer(ndigitsPtr)) = 1
		}
		*(*int32)(unsafe.Pointer(iLimPtr)) = libc.AssignPtrInt32(iLim1Ptr, libc.AssignPtrInt32(iPtr, *(*int32)(unsafe.Pointer(ndigitsPtr))))
		break
	case TCL_DD_F_FORMAT:
		*(*int32)(unsafe.Pointer(iPtr)) = *(*int32)(unsafe.Pointer(ndigitsPtr)) + k + 1
		*(*int32)(unsafe.Pointer(iLimPtr)) = *(*int32)(unsafe.Pointer(iPtr))
		*(*int32)(unsafe.Pointer(iLim1Ptr)) = *(*int32)(unsafe.Pointer(iPtr)) - 1
		if *(*int32)(unsafe.Pointer(iPtr)) <= 0 {
			*(*int32)(unsafe.Pointer(iPtr)) = 1
		}
		break
	default:
		*(*int32)(unsafe.Pointer(iPtr)) = -1
		*(*int32)(unsafe.Pointer(iLimPtr)) = -1
		*(*int32)(unsafe.Pointer(iLim1Ptr)) = -1
		XTcl_Panic(tls, ts+64396, 0)
	}
}

//----------------------------------------------------------------------
//
// BumpUp --
//
//	Increases a string of digits ending in a series of nines to designate
//	the next higher number.  xxxxb9999... -> xxxx(b+1)0000...
//
// Results:
//	Returns a pointer to the end of the adjusted string.
//
// Side effects:
//	In the case that the string consists solely of '999999', sets it to
//	"1" and moves the decimal point (*kPtr) one place to the right.
//
//----------------------------------------------------------------------

func sBumpUp(tls *libc.TLS, s uintptr, retval uintptr, kPtr uintptr) uintptr { /* tclStrToD.c:2554:20: */
	for int32(*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&s, 1)))) == '9' {
		if s == retval {
			*(*int32)(unsafe.Pointer(kPtr))++
			*(*int8)(unsafe.Pointer(s)) = int8('1')
			return s + uintptr(1)
		}
	}
	*(*int8)(unsafe.Pointer(s))++
	s++
	return s
}

//----------------------------------------------------------------------
//
// AdjustRange --
//
//	Rescales a 'double' in preparation for formatting it using the 'quick'
//	double-to-string method.
//
// Results:
//	Returns the precision that has been lost in the prescaling as a count
//	of units in the least significant place.
//
//----------------------------------------------------------------------

func sAdjustRange(tls *libc.TLS, dPtr uintptr, k int32) int32 { /* tclStrToD.c:2589:1: */
	var ieps int32 // Number of roundoff errors that have
	// accumulated.
	var d float64 = *(*float64)(unsafe.Pointer(dPtr)) // Number to adjust.
	var ds float64
	var i int32
	var j int32
	var j1 int32

	ieps = 2

	if k > 0 {
		// The number must be reduced to bring it into range.

		ds = tens[k&0xF]
		j = k >> 4
		if j&BLETCH != 0 {
			j = j & (BLETCH - 1)
			d = d / bigtens[N_BIGTENS-1]
			ieps++
		}
		i = 0
		for ; j != 0; j >>= 1 {
			if j&1 != 0 {
				ds = ds * bigtens[i]
				ieps++
			}
			i++
		}
		d = d / ds
	} else if libc.AssignInt32(&j1, -k) != 0 {
		// The number must be increased to bring it into range.

		d = d * tens[j1&0xF]
		i = 0
		for j = j1 >> 4; j != 0; j >>= 1 {
			if j&1 != 0 {
				ieps++
				d = d * bigtens[i]
			}
			i++
		}
	}

	*(*float64)(unsafe.Pointer(dPtr)) = d
	return ieps
}

//----------------------------------------------------------------------
//
// ShorteningQuickFormat --
//
//	Returns a 'quick' format of a double precision number to a string of
//	digits, preferring a shorter string of digits if the shorter string is
//	still within 1/2 ulp of the number.
//
// Results:
//	Returns the string of digits. Returns NULL if the 'quick' method fails
//	and the bignum method must be used.
//
// Side effects:
//	Stores the position of the decimal point at '*kPtr'.
//
//----------------------------------------------------------------------

func sShorteningQuickFormat(tls *libc.TLS, d float64, k int32, ilim int32, eps float64, retval uintptr, kPtr uintptr) uintptr { /* tclStrToD.c:2661:20: */
	var s uintptr = retval // Cursor in the return value.
	var digit int32        // Current digit.
	var i int32

	eps = 0.5/tens[ilim-1] - eps
	i = 0
	for {
		// Convert a digit.

		digit = int32(d)
		d = d - float64(digit)
		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('0' + digit)

		// Truncate the conversion if the string of digits is within 1/2 ulp
		// of the actual value.

		if d < eps {
			*(*int32)(unsafe.Pointer(kPtr)) = k
			return s
		}
		if 1.-d < eps {
			*(*int32)(unsafe.Pointer(kPtr)) = k
			return sBumpUp(tls, s, retval, kPtr)
		}

		// Bail out if the conversion fails to converge to a sufficiently
		// precise value.

		if libc.PreIncInt32(&i, 1) >= ilim {
			return uintptr(0)
		}

		// Bring the next digit to the integer part.

		eps = eps * float64(10)
		d = d * 10.0
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// StrictQuickFormat --
//
//	Convert a double precision number of a string of a precise number of
//	digits, using the 'quick' double precision method.
//
// Results:
//	Returns the digit string, or NULL if the bignum method must be used to
//	do the formatting.
//
// Side effects:
//	Stores the position of the decimal point in '*kPtr'.
//
//----------------------------------------------------------------------

func sStrictQuickFormat(tls *libc.TLS, d float64, k int32, ilim int32, eps float64, retval uintptr, kPtr uintptr) uintptr { /* tclStrToD.c:2736:20: */
	var s uintptr = retval // Cursor in the return value.
	var digit int32        // Current digit of the answer.
	var i int32

	eps = eps * tens[ilim-1]
	i = 1
	for {
		// Extract a digit.

		digit = int32(d)
		d = d - float64(digit)
		if d == 0.0 {
			ilim = i
		}
		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('0' + digit)

		// When the given digit count is reached, handle trailing strings of 0
		// and 9.

		if i == ilim {
			if d > 0.5+eps {
				*(*int32)(unsafe.Pointer(kPtr)) = k
				return sBumpUp(tls, s, retval, kPtr)
			} else if d < 0.5-eps {
				for int32(*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&s, 1)))) == '0' {
					// do nothing
				}
				s++
				*(*int32)(unsafe.Pointer(kPtr)) = k
				return s
			} else {
				return uintptr(0)
			}
		}

		// Advance to the next digit.

		i++
		d = d * 10.0
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// QuickConversion --
//
//	Converts a floating point number the 'quick' way, when only a limited
//	number of digits is required and floating point arithmetic can
//	therefore be used for the intermediate results.
//
// Results:
//	Returns the converted string, or NULL if the bignum method must be
//	used.
//
//----------------------------------------------------------------------

func sQuickConversion(tls *libc.TLS, e float64, k int32, k_check int32, flags int32, len int32, ilim int32, ilim1 int32, decpt uintptr, endPtr uintptr) uintptr { /* tclStrToD.c:2810:20: */
	bp := tls.Alloc(16)
	defer tls.Free(16)
	*(*float64)(unsafe.Pointer(bp)) = e

	var ieps int32 // Number of 1-ulp roundoff errors that have
	// accumulated in the calculation.
	// var eps Double at bp+8, 8
	// Estimated roundoff error.
	var retval uintptr // Returned string.
	var end uintptr    // Pointer to the terminal null byte in the
	// returned string.
	var d float64 // Workaround for a bug in mingw gcc 3.4.5

	// Bring d into the range [1 .. 10).

	ieps = sAdjustRange(tls, bp, k)
	libc.AtomicStoreFloat64(&d, float64(*(*float64)(unsafe.Pointer(bp /* e */))))

	// If the guessed value of k didn't get d into range, adjust it by one. If
	// that leaves us outside the range in which quick format is accurate,
	// bail out.

	if k_check != 0 && d < 1. && ilim > 0 {
		if ilim1 < 0 {
			return uintptr(0)
		}
		ilim = ilim1
		k--
		libc.AtomicStoreFloat64(&d, float64(d*10.0))
		ieps++
	}

	// Compute estimated roundoff error.

	*(*float64)(unsafe.Pointer(bp + 8)) = float64(ieps)*d + 7.
	*(*int32)(unsafe.Pointer(bp + 8 + 4)) -= int32(FP_PRECISION-1) << EXP_SHIFT

	// Handle the peculiar case where the result has no significant digits.

	retval = XTcl_Alloc(tls, uint32(len+1))
	if ilim == 0 {
		libc.AtomicStoreFloat64(&d, float64(d-5.))
		if d > *(*float64)(unsafe.Pointer(bp + 8)) {
			*(*int8)(unsafe.Pointer(retval)) = int8('1')
			*(*int32)(unsafe.Pointer(decpt)) = k
			return retval
		} else if d < -*(*float64)(unsafe.Pointer(bp + 8)) {
			*(*int32)(unsafe.Pointer(decpt)) = k
			return retval
		} else {
			XTclpFree(tls, retval)
			return uintptr(0)
		}
	}

	// Format the digit string.

	if flags&TCL_DD_SHORTEN_FLAG != 0 {
		end = sShorteningQuickFormat(tls, d, k, ilim, *(*float64)(unsafe.Pointer(bp + 8)), retval, decpt)
	} else {
		end = sStrictQuickFormat(tls, d, k, ilim, *(*float64)(unsafe.Pointer(bp + 8)), retval, decpt)
	}
	if end == uintptr(0) {
		XTclpFree(tls, retval)
		return uintptr(0)
	}
	*(*int8)(unsafe.Pointer(end)) = int8(0)
	if endPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(endPtr)) = end
	}
	return retval
}

//----------------------------------------------------------------------
//
// CastOutPowersOf2 --
//
//	Adjust the factors 'b2', 'm2', and 's2' to cast out common powers of 2
//	from numerator and denominator in preparation for the 'bignum' method
//	of floating point conversion.
//
//----------------------------------------------------------------------

func sCastOutPowersOf2(tls *libc.TLS, b2 uintptr, m2 uintptr, s2 uintptr) { /* tclStrToD.c:2916:1: */
	var i int32

	if *(*int32)(unsafe.Pointer(m2)) > 0 && *(*int32)(unsafe.Pointer(s2)) > 0 { // Find the smallest power of 2 in the
		// numerator.
		if *(*int32)(unsafe.Pointer(m2)) < *(*int32)(unsafe.Pointer(s2)) { // Find the lowest common denominator.
			i = *(*int32)(unsafe.Pointer(m2))
		} else {
			i = *(*int32)(unsafe.Pointer(s2))
		}
		*(*int32)(unsafe.Pointer(b2)) -= i // Reduce to lowest terms.
		*(*int32)(unsafe.Pointer(m2)) -= i
		*(*int32)(unsafe.Pointer(s2)) -= i
	}
}

//----------------------------------------------------------------------
//
// ShorteningInt64Conversion --
//
//	Converts a double-precision number to the shortest string of digits
//	that reconverts exactly to the given number, or to 'ilim' digits if
//	that will yield a shorter result. The numerator and denominator in
//	David Gay's conversion algorithm are known to fit in Tcl_WideUInt,
//	giving considerably faster arithmetic than mp_int's.
//
// Results:
//	Returns the string of significant decimal digits, in newly allocated
//	memory
//
// Side effects:
//	Stores the location of the decimal point in '*decpt' and the location
//	of the terminal null byte in '*endPtr'.
//
//----------------------------------------------------------------------

func sShorteningInt64Conversion(tls *libc.TLS, dPtr uintptr, convType int32, bw Tcl_WideUInt, b2 int32, b5 int32, m2plus int32, m2minus int32, m5 int32, s2 int32, s5 int32, k int32, len int32, ilim int32, ilim1 int32, decpt uintptr, endPtr uintptr) uintptr { /* tclStrToD.c:2959:20: */
	bp := tls.Alloc(4)
	defer tls.Free(4)
	*(*int32)(unsafe.Pointer(bp)) = k

	var retval uintptr = XTcl_Alloc(tls, uint32(len+1))
	// Output buffer.
	var b Tcl_WideUInt = bw * wuipow5[b5] << b2
	// Numerator of the fraction being
	// converted.
	var S Tcl_WideUInt = wuipow5[s5] << s2
	// Denominator of the fraction being
	// converted.
	var mplus Tcl_WideUInt
	var mminus Tcl_WideUInt // Ranges for testing whether the result is
	// within roundoff of being exact.
	var digit int32        // Current output digit.
	var s uintptr = retval // Cursor in the output buffer.
	var i int32            // Current position in the output buffer.

	// Adjust if the logarithm was guessed wrong.

	if b < S {
		b = uint64(10) * b
		m2plus++
		m2minus++
		m5++
		ilim = ilim1
		*(*int32)(unsafe.Pointer(bp /* k */))--
	}

	// Compute roundoff ranges.

	mplus = wuipow5[m5] << m2plus
	mminus = wuipow5[m5] << m2minus

	// Loop through the digits.

	i = 1
	for {
		digit = int32(b / S)
		if digit > 10 {
			XTcl_Panic(tls, ts+64442, 0)
		}
		b = b % S

		// Does the current digit put us on the low side of the exact value
		// but within within roundoff of being exact?

		if b < mplus || b == mplus &&
			convType != TCL_DD_STEELE0 && *(*int32)(unsafe.Pointer(dPtr))&1 == 0 {
			// Make sure we shouldn't be rounding *up* instead, in case the
			// next number above is closer.

			if uint64(2)*b > S || uint64(2)*b == S && digit&1 != 0 {
				digit++
				if digit == 10 {
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('9')
					s = sBumpUp(tls, s, retval, bp)
					break
				}
			}

			// Stash the current digit.

			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('0' + digit)
			break
		}

		// Does one plus the current digit put us within roundoff of the
		// number?

		if b > S-mminus || b == S-mminus &&
			convType != TCL_DD_STEELE0 && *(*int32)(unsafe.Pointer(dPtr))&1 == 0 {
			if digit == 9 {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('9')
				s = sBumpUp(tls, s, retval, bp)
				break
			}
			digit++
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('0' + digit)
			break
		}

		// Have we converted all the requested digits?

		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('0' + digit)
		if i == ilim {
			if uint64(2)*b > S || uint64(2)*b == S && digit&1 != 0 {
				s = sBumpUp(tls, s, retval, bp)
			}
			break
		}

		// Advance to the next digit.

		b = uint64(10) * b
		mplus = uint64(10) * mplus
		mminus = uint64(10) * mminus
		i++
	}

	// Endgame - store the location of the decimal point and the end of the
	// string.

	*(*int8)(unsafe.Pointer(s)) = int8(0)
	*(*int32)(unsafe.Pointer(decpt)) = *(*int32)(unsafe.Pointer(bp /* k */))
	if endPtr != 0 {
		*(*uintptr)(unsafe.Pointer(endPtr)) = s
	}
	return retval
}

//----------------------------------------------------------------------
//
// StrictInt64Conversion --
//
//	Converts a double-precision number to a fixed-length string of 'ilim'
//	digits that reconverts exactly to the given number.  ('ilim' should be
//	replaced with 'ilim1' in the case where log10(d) has been
//	overestimated).  The numerator and denominator in David Gay's
//	conversion algorithm are known to fit in Tcl_WideUInt, giving
//	considerably faster arithmetic than mp_int's.
//
// Results:
//	Returns the string of significant decimal digits, in newly allocated
//	memory
//
// Side effects:
//	Stores the location of the decimal point in '*decpt' and the location
//	of the terminal null byte in '*endPtr'.
//
//----------------------------------------------------------------------

func sStrictInt64Conversion(tls *libc.TLS, dPtr uintptr, convType int32, bw Tcl_WideUInt, b2 int32, b5 int32, s2 int32, s5 int32, k int32, len int32, ilim int32, ilim1 int32, decpt uintptr, endPtr uintptr) uintptr { /* tclStrToD.c:3128:20: */
	bp := tls.Alloc(4)
	defer tls.Free(4)
	*(*int32)(unsafe.Pointer(bp)) = k

	var retval uintptr = XTcl_Alloc(tls, uint32(len+1))
	// Output buffer.
	var b Tcl_WideUInt = bw * wuipow5[b5] << b2
	// Numerator of the fraction being
	// converted.
	var S Tcl_WideUInt = wuipow5[s5] << s2
	// Denominator of the fraction being
	// converted.
	var digit int32        // Current output digit.
	var s uintptr = retval // Cursor in the output buffer.
	var i int32            // Current position in the output buffer.

	// Adjust if the logarithm was guessed wrong.

	if b < S {
		b = uint64(10) * b
		ilim = ilim1
		*(*int32)(unsafe.Pointer(bp /* k */))--
	}

	// Loop through the digits.

	i = 1
	for {
		digit = int32(b / S)
		if digit > 10 {
			XTcl_Panic(tls, ts+64442, 0)
		}
		b = b % S

		// Have we converted all the requested digits?

		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('0' + digit)
		if i == ilim {
			if uint64(2)*b > S || uint64(2)*b == S && digit&1 != 0 {
				s = sBumpUp(tls, s, retval, bp)
			} else {
				for int32(*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&s, 1)))) == '0' {
					// do nothing
				}
				s++
			}
			break
		}

		// Advance to the next digit.

		b = uint64(10) * b
		i++
	}

	// Endgame - store the location of the decimal point and the end of the
	// string.

	*(*int8)(unsafe.Pointer(s)) = int8(0)
	*(*int32)(unsafe.Pointer(decpt)) = *(*int32)(unsafe.Pointer(bp /* k */))
	if endPtr != 0 {
		*(*uintptr)(unsafe.Pointer(endPtr)) = s
	}
	return retval
}

//----------------------------------------------------------------------
//
// ShouldBankerRoundUpPowD --
//
//	Test whether bankers' rounding should round a digit up. Assumption is
//	made that the denominator of the fraction being tested is a power of
//	2**MP_DIGIT_BIT.
//
// Results:
//	Returns 1 iff the fraction is more than 1/2, or if the fraction is
//	exactly 1/2 and the digit is odd.
//
//----------------------------------------------------------------------

func sShouldBankerRoundUpPowD(tls *libc.TLS, b uintptr, sd int32, isodd int32) int32 { /* tclStrToD.c:3235:1: */
	var i int32

	if (*Mp_int)(unsafe.Pointer(b)).Fused < sd || *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(sd-1)*4))&topbit == Mp_digit(0) {
		return 0
	}
	if *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(sd-1)*4)) != topbit {
		return 1
	}
	for i = sd - 2; i >= 0; i-- {
		if *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(b)).Fdp + uintptr(i)*4)) != Mp_digit(0) {
			return 1
		}
	}
	return isodd
}

var topbit Mp_digit = Mp_digit(Mp_digit(1)) << (MP_DIGIT_BIT - 1) /* tclStrToD.c:3241:27 */

//----------------------------------------------------------------------
//
// ShouldBankerRoundUpToNextPowD --
//
//	Tests whether bankers' rounding will round down in the "denominator is
//	a power of 2**MP_DIGIT" case.
//
// Results:
//	Returns 1 if the rounding will be performed - which increases the
//	digit by one - and 0 otherwise.
//
//----------------------------------------------------------------------

func sShouldBankerRoundUpToNextPowD(tls *libc.TLS, b uintptr, m uintptr, sd int32, convType int32, isodd int32, temp uintptr) int32 { /* tclStrToD.c:3273:1: */
	var i int32

	// Compare B and S-m - which is the same as comparing B+m and S - which we
	// do by computing b+m and doing a bitwhack compare against
	// 2**(MP_DIGIT_BIT*sd)

	XTclBN_mp_add(tls, b, m, temp)
	if (*Mp_int)(unsafe.Pointer(temp)).Fused <= sd { // Too few digits to be > s
		return 0
	}
	if (*Mp_int)(unsafe.Pointer(temp)).Fused > sd+1 || *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(temp)).Fdp + uintptr(sd)*4)) > Mp_digit(1) {
		// >= 2s
		return 1
	}
	for i = sd - 1; i >= 0; i-- {
		// Check for ==s
		if *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(temp)).Fdp + uintptr(i)*4)) != Mp_digit(0) { // > s
			return 1
		}
	}
	if convType == TCL_DD_STEELE0 {
		// Biased rounding.
		return 0
	}
	return isodd
}

//----------------------------------------------------------------------
//
// ShorteningBignumConversionPowD --
//
//	Converts a double-precision number to the shortest string of digits
//	that reconverts exactly to the given number, or to 'ilim' digits if
//	that will yield a shorter result. The denominator in David Gay's
//	conversion algorithm is known to be a power of 2**MP_DIGIT_BIT, and hence
//	the division in the main loop may be replaced by a digit shift and
//	mask.
//
// Results:
//	Returns the string of significant decimal digits, in newly allocated
//	memory
//
// Side effects:
//	Stores the location of the decimal point in '*decpt' and the location
//	of the terminal null byte in '*endPtr'.
//
//----------------------------------------------------------------------

func sShorteningBignumConversionPowD(tls *libc.TLS, dPtr uintptr, convType int32, bw Tcl_WideUInt, b2 int32, b5 int32, m2plus int32, m2minus int32, m5 int32, sd int32, k int32, len int32, ilim int32, ilim1 int32, decpt uintptr, endPtr uintptr) uintptr { /* tclStrToD.c:3335:20: */
	bp := tls.Alloc(124)
	defer tls.Free(124)
	*(*int32)(unsafe.Pointer(bp + 120)) = k

	var retval uintptr = XTcl_Alloc(tls, uint32(len+1))
	// Output buffer.
	// var b Mp_int at bp+24, 24
	// Numerator of the fraction being
	// converted.
	// var mplus Mp_int at bp+72, 24

	// var mminus Mp_int at bp+48, 24
	// Bounds for roundoff.
	var digit Mp_digit     // Current output digit.
	var s uintptr = retval // Cursor in the output buffer.
	var i int32            // Index in the output buffer.
	// var temp Mp_int at bp+96, 24

	var r1 int32

	// b = bw * 2**b2 * 5**b5
	// mminus = 5**m5

	XTclBNInitBignumFromWideUInt(tls, bp+24, bw)
	XTclBN_mp_init_set(tls, bp+48, uint32(1))
	sMulPow5(tls, bp+24, uint32(b5), bp+24)
	XTclBN_mp_mul_2d(tls, bp+24, b2, bp+24)

	// Adjust if the logarithm was guessed wrong.

	if (*Mp_int)(unsafe.Pointer(bp+24)).Fused <= sd {
		XTclBN_mp_mul_d(tls, bp+24, uint32(10), bp+24)
		m2plus++
		m2minus++
		m5++
		ilim = ilim1
		*(*int32)(unsafe.Pointer(bp + 120 /* k */))--
	}

	// mminus = 5**m5 * 2**m2minus
	// mplus = 5**m5 * 2**m2plus

	XTclBN_mp_mul_2d(tls, bp+48, m2minus, bp+48)
	sMulPow5(tls, bp+48, uint32(m5), bp+48)
	if m2plus > m2minus {
		XTclBN_mp_init_copy(tls, bp+72, bp+48)
		XTclBN_mp_mul_2d(tls, bp+72, m2plus-m2minus, bp+72)
	}
	XTclBN_mp_init(tls, bp+96)

	// Loop through the digits. Do division and mod by s == 2**(sd*MP_DIGIT_BIT)
	// by mp_digit extraction.

	i = 0
	for {
		if (*Mp_int)(unsafe.Pointer(bp+24)).Fused <= sd {
			digit = Mp_digit(0)
		} else {
			digit = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+24 /* &b */)).Fdp + uintptr(sd)*4))
			if (*Mp_int)(unsafe.Pointer(bp+24)).Fused > sd+1 || digit >= Mp_digit(10) {
				XTcl_Panic(tls, ts+64442, 0)
			}
			(*Mp_int)(unsafe.Pointer(bp+24 /* &b */)).Fused--
			XTclBN_mp_clamp(tls, bp+24)
		}

		// Does the current digit put us on the low side of the exact value
		// but within within roundoff of being exact?

		r1 = XTclBN_mp_cmp_mag(tls, bp+24, func() uintptr {
			if m2plus > m2minus {
				return bp + 72 /* &mplus */
			}
			return bp + 48 /* &mminus */
		}())
		if r1 == -1 || r1 == MP_EQ &&
			convType != TCL_DD_STEELE0 && *(*int32)(unsafe.Pointer(dPtr))&1 == 0 {
			// Make sure we shouldn't be rounding *up* instead, in case the
			// next number above is closer.

			if sShouldBankerRoundUpPowD(tls, bp+24, sd, int32(digit&Mp_digit(1))) != 0 {
				digit++
				if digit == Mp_digit(10) {
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('9')
					s = sBumpUp(tls, s, retval, bp+120)
					break
				}
			}

			// Stash the last digit.

			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8(Mp_digit('0') + digit)
			break
		}

		// Does one plus the current digit put us within roundoff of the
		// number?

		if sShouldBankerRoundUpToNextPowD(tls, bp+24, bp+48, sd, convType,
			*(*int32)(unsafe.Pointer(dPtr))&1, bp+96) != 0 {
			if digit == Mp_digit(9) {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('9')
				s = sBumpUp(tls, s, retval, bp+120)
				break
			}
			digit++
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8(Mp_digit('0') + digit)
			break
		}

		// Have we converted all the requested digits?

		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8(Mp_digit('0') + digit)
		if i == ilim {
			if sShouldBankerRoundUpPowD(tls, bp+24, sd, int32(digit&Mp_digit(1))) != 0 {
				s = sBumpUp(tls, s, retval, bp+120)
			}
			break
		}

		// Advance to the next digit.

		XTclBN_mp_mul_d(tls, bp+24, uint32(10), bp+24)
		XTclBN_mp_mul_d(tls, bp+48, uint32(10), bp+48)
		if m2plus > m2minus {
			XTclBN_mp_mul_2d(tls, bp+48, m2plus-m2minus, bp+72)
		}
		i++
	}

	// Endgame - store the location of the decimal point and the end of the
	// string.

	if m2plus > m2minus {
		XTclBN_mp_clear(tls, bp+72)
	}
	XTclBN_mp_clear_multi(tls, bp+24, libc.VaList(bp, bp+48, bp+96, uintptr(0)))
	*(*int8)(unsafe.Pointer(s)) = int8(0)
	*(*int32)(unsafe.Pointer(decpt)) = *(*int32)(unsafe.Pointer(bp + 120 /* k */))
	if endPtr != 0 {
		*(*uintptr)(unsafe.Pointer(endPtr)) = s
	}
	return retval
}

//----------------------------------------------------------------------
//
// StrictBignumConversionPowD --
//
//	Converts a double-precision number to a fixed-lengt string of 'ilim'
//	digits (or 'ilim1' if log10(d) has been overestimated).  The
//	denominator in David Gay's conversion algorithm is known to be a power
//	of 2**MP_DIGIT_BIT, and hence the division in the main loop may be
//	replaced by a digit shift and mask.
//
// Results:
//	Returns the string of significant decimal digits, in newly allocated
//	memory.
//
// Side effects:
//	Stores the location of the decimal point in '*decpt' and the location
//	of the terminal null byte in '*endPtr'.
//
//----------------------------------------------------------------------

func sStrictBignumConversionPowD(tls *libc.TLS, dPtr uintptr, convType int32, bw Tcl_WideUInt, b2 int32, b5 int32, sd int32, k int32, len int32, ilim int32, ilim1 int32, decpt uintptr, endPtr uintptr) uintptr { /* tclStrToD.c:3528:20: */
	bp := tls.Alloc(68)
	defer tls.Free(68)
	*(*int32)(unsafe.Pointer(bp + 64)) = k

	var retval uintptr = XTcl_Alloc(tls, uint32(len+1))
	// Output buffer.
	// var b Mp_int at bp+16, 24
	// Numerator of the fraction being
	// converted.
	var digit Mp_digit     // Current output digit.
	var s uintptr = retval // Cursor in the output buffer.
	var i int32            // Index in the output buffer.
	// var temp Mp_int at bp+40, 24

	// b = bw * 2**b2 * 5**b5

	XTclBNInitBignumFromWideUInt(tls, bp+16, bw)
	sMulPow5(tls, bp+16, uint32(b5), bp+16)
	XTclBN_mp_mul_2d(tls, bp+16, b2, bp+16)

	// Adjust if the logarithm was guessed wrong.

	if (*Mp_int)(unsafe.Pointer(bp+16)).Fused <= sd {
		XTclBN_mp_mul_d(tls, bp+16, uint32(10), bp+16)
		ilim = ilim1
		*(*int32)(unsafe.Pointer(bp + 64 /* k */))--
	}
	XTclBN_mp_init(tls, bp+40)

	// Loop through the digits. Do division and mod by s == 2**(sd*MP_DIGIT_BIT)
	// by mp_digit extraction.

	i = 1
	for {
		if (*Mp_int)(unsafe.Pointer(bp+16)).Fused <= sd {
			digit = Mp_digit(0)
		} else {
			digit = *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+16 /* &b */)).Fdp + uintptr(sd)*4))
			if (*Mp_int)(unsafe.Pointer(bp+16)).Fused > sd+1 || digit >= Mp_digit(10) {
				XTcl_Panic(tls, ts+64442, 0)
			}
			(*Mp_int)(unsafe.Pointer(bp+16 /* &b */)).Fused--
			XTclBN_mp_clamp(tls, bp+16)
		}

		// Have we converted all the requested digits?

		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8(Mp_digit('0') + digit)
		if i == ilim {
			if sShouldBankerRoundUpPowD(tls, bp+16, sd, int32(digit&Mp_digit(1))) != 0 {
				s = sBumpUp(tls, s, retval, bp+64)
			}
			for int32(*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&s, 1)))) == '0' {
				// do nothing
			}
			s++
			break
		}

		// Advance to the next digit.

		XTclBN_mp_mul_d(tls, bp+16, uint32(10), bp+16)
		i++
	}

	// Endgame - store the location of the decimal point and the end of the
	// string.

	XTclBN_mp_clear_multi(tls, bp+16, libc.VaList(bp, bp+40, uintptr(0)))
	*(*int8)(unsafe.Pointer(s)) = int8(0)
	*(*int32)(unsafe.Pointer(decpt)) = *(*int32)(unsafe.Pointer(bp + 64 /* k */))
	if endPtr != 0 {
		*(*uintptr)(unsafe.Pointer(endPtr)) = s
	}
	return retval
}

//----------------------------------------------------------------------
//
// ShouldBankerRoundUp --
//
//	Tests whether a digit should be rounded up or down when finishing
//	bignum-based floating point conversion.
//
// Results:
//	Returns 1 if the number needs to be rounded up, 0 otherwise.
//
//----------------------------------------------------------------------

func sShouldBankerRoundUp(tls *libc.TLS, twor uintptr, S uintptr, isodd int32) int32 { /* tclStrToD.c:3645:1: */
	var r int32 = XTclBN_mp_cmp_mag(tls, twor, S)

	switch r {
	case -1:
		return 0
	case MP_EQ:
		return isodd
	case MP_GT:
		return 1
	}
	XTcl_Panic(tls, ts+64455, 0)
	return 0
}

//----------------------------------------------------------------------
//
// ShouldBankerRoundUpToNext --
//
//	Tests whether the remainder is great enough to force rounding to the
//	next higher digit.
//
// Results:
//	Returns 1 if the number should be rounded up, 0 otherwise.
//
//----------------------------------------------------------------------

func sShouldBankerRoundUpToNext(tls *libc.TLS, b uintptr, m uintptr, S uintptr, convType int32, isodd int32, temp uintptr) int32 { /* tclStrToD.c:3680:1: */
	var r int32

	// Compare b and S-m: this is the same as comparing B+m and S.

	XTclBN_mp_add(tls, b, m, temp)
	r = XTclBN_mp_cmp_mag(tls, temp, S)
	switch r {
	case -1:
		return 0
	case MP_EQ:
		if convType == TCL_DD_STEELE0 {
			return 0
		} else {
			return isodd
		}
		fallthrough
	case MP_GT:
		return 1
	}
	XTcl_Panic(tls, ts+64497, 0)
	return 0
}

//----------------------------------------------------------------------
//
// ShorteningBignumConversion --
//
//	Convert a floating point number to a variable-length digit string
//	using the multiprecision method.
//
// Results:
//	Returns the string of digits.
//
// Side effects:
//	Stores the position of the decimal point in *decpt.  Stores a pointer
//	to the end of the number in *endPtr.
//
//----------------------------------------------------------------------

func sShorteningBignumConversion(tls *libc.TLS, dPtr uintptr, convType int32, bw Tcl_WideUInt, b2 int32, m2plus int32, m2minus int32, s2 int32, s5 int32, k int32, len int32, ilim int32, ilim1 int32, decpt uintptr, endPtr uintptr) uintptr { /* tclStrToD.c:3733:20: */
	bp := tls.Alloc(188)
	defer tls.Free(188)
	*(*int32)(unsafe.Pointer(bp + 184)) = k

	var retval uintptr = XTcl_Alloc(tls, uint32(len+1))
	// Buffer of digits to return.
	var s uintptr = retval // Cursor in the return value.
	// var b Mp_int at bp+40, 24
	// Numerator of the result.
	// var mminus Mp_int at bp+88, 24
	// 1/2 ulp below the result.
	// var mplus Mp_int at bp+112, 24
	// 1/2 ulp above the result.
	// var S Mp_int at bp+64, 24
	// Denominator of the result.
	// var dig Mp_int at bp+160, 24
	// Current digit of the result.
	var digit int32 // Current digit of the result.
	// var temp Mp_int at bp+136, 24
	// Work area.
	var minit int32 = 1 // Fudge factor for when we misguess k.
	var i int32
	var r1 int32

	// b = bw * 2**b2 * 5**b5
	// S = 2**s2 * 5*s5

	XTclBNInitBignumFromWideUInt(tls, bp+40, bw)
	XTclBN_mp_mul_2d(tls, bp+40, b2, bp+40)
	XTclBN_mp_init_set(tls, bp+64, uint32(1))
	sMulPow5(tls, bp+64, uint32(s5), bp+64)
	XTclBN_mp_mul_2d(tls, bp+64, s2, bp+64)

	// Handle the case where we guess the position of the decimal point wrong.

	if XTclBN_mp_cmp_mag(tls, bp+40, bp+64) == -1 {
		XTclBN_mp_mul_d(tls, bp+40, uint32(10), bp+40)
		minit = 10
		ilim = ilim1
		*(*int32)(unsafe.Pointer(bp + 184 /* k */))--
	}

	// mminus = 2**m2minus * 5**m5

	XTclBN_mp_init_set(tls, bp+88, uint32(minit))
	XTclBN_mp_mul_2d(tls, bp+88, m2minus, bp+88)
	if m2plus > m2minus {
		XTclBN_mp_init_copy(tls, bp+112, bp+88)
		XTclBN_mp_mul_2d(tls, bp+112, m2plus-m2minus, bp+112)
	}
	XTclBN_mp_init(tls, bp+136)

	// Loop through the digits.

	XTclBN_mp_init(tls, bp+160)
	i = 1
	for {
		XTclBN_mp_div(tls, bp+40, bp+64, bp+160, bp+40)
		if (*Mp_int)(unsafe.Pointer(bp+160)).Fused > 1 || *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp + 160)).Fdp)) >= Mp_digit(10) {
			XTcl_Panic(tls, ts+64442, 0)
		}
		digit = int32(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp + 160 /* &dig */)).Fdp)))

		// Does the current digit leave us with a remainder small enough to
		// round to it?

		r1 = XTclBN_mp_cmp_mag(tls, bp+40, func() uintptr {
			if m2plus > m2minus {
				return bp + 112 /* &mplus */
			}
			return bp + 88 /* &mminus */
		}())
		if r1 == -1 || r1 == MP_EQ &&
			convType != TCL_DD_STEELE0 && *(*int32)(unsafe.Pointer(dPtr))&1 == 0 {
			XTclBN_mp_mul_2d(tls, bp+40, 1, bp+40)
			if sShouldBankerRoundUp(tls, bp+40, bp+64, digit&1) != 0 {
				digit++
				if digit == 10 {
					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('9')
					s = sBumpUp(tls, s, retval, bp+184)
					break
				}
			}
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('0' + digit)
			break
		}

		// Does the current digit leave us with a remainder large enough to
		// commit to rounding up to the next higher digit?

		if sShouldBankerRoundUpToNext(tls, bp+40, bp+88, bp+64, convType,
			*(*int32)(unsafe.Pointer(dPtr))&1, bp+136) != 0 {
			digit++
			if digit == 10 {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('9')
				s = sBumpUp(tls, s, retval, bp+184)
				break
			}
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('0' + digit)
			break
		}

		// Have we converted all the requested digits?

		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('0' + digit)
		if i == ilim {
			XTclBN_mp_mul_2d(tls, bp+40, 1, bp+40)
			if sShouldBankerRoundUp(tls, bp+40, bp+64, digit&1) != 0 {
				s = sBumpUp(tls, s, retval, bp+184)
			}
			break
		}

		// Advance to the next digit.

		if s5 > 0 {
			// Can possibly shorten the denominator.

			XTclBN_mp_mul_2d(tls, bp+40, 1, bp+40)
			XTclBN_mp_mul_2d(tls, bp+88, 1, bp+88)
			if m2plus > m2minus {
				XTclBN_mp_mul_2d(tls, bp+112, 1, bp+112)
			}
			XTclBN_mp_div_d(tls, bp+64, uint32(5), bp+64, uintptr(0))
			s5--

			// IDEA: It might possibly be a win to fall back to int64_t
			//       arithmetic here if S < 2**64/10. But it's a win only for
			//       a fairly narrow range of magnitudes so perhaps not worth
			//       bothering.  We already know that we shorten the
			//       denominator by at least 1 mp_digit, perhaps 2, as we do
			//       the conversion for 17 digits of significance.
			// Possible savings:
			// 10**26   1 trip through loop before fallback possible
			// 10**27   1 trip
			// 10**28   2 trips
			// 10**29   3 trips
			// 10**30   4 trips
			// 10**31   5 trips
			// 10**32   6 trips
			// 10**33   7 trips
			// 10**34   8 trips
			// 10**35   9 trips
			// 10**36  10 trips
			// 10**37  11 trips
			// 10**38  12 trips
			// 10**39  13 trips
			// 10**40  14 trips
			// 10**41  15 trips
			// 10**42  16 trips
			// thereafter no gain.
		} else {
			XTclBN_mp_mul_d(tls, bp+40, uint32(10), bp+40)
			XTclBN_mp_mul_d(tls, bp+88, uint32(10), bp+88)
			if m2plus > m2minus {
				XTclBN_mp_mul_2d(tls, bp+112, 10, bp+112)
			}
		}

		i++
	}

	// Endgame - store the location of the decimal point and the end of the
	// string.

	if m2plus > m2minus {
		XTclBN_mp_clear(tls, bp+112)
	}
	XTclBN_mp_clear_multi(tls, bp+40, libc.VaList(bp, bp+88, bp+136, bp+160, bp+64, uintptr(0)))
	*(*int8)(unsafe.Pointer(s)) = int8(0)
	*(*int32)(unsafe.Pointer(decpt)) = *(*int32)(unsafe.Pointer(bp + 184 /* k */))
	if endPtr != 0 {
		*(*uintptr)(unsafe.Pointer(endPtr)) = s
	}
	return retval
}

//----------------------------------------------------------------------
//
// StrictBignumConversion --
//
//	Convert a floating point number to a fixed-length digit string using
//	the multiprecision method.
//
// Results:
//	Returns the string of digits.
//
// Side effects:
//	Stores the position of the decimal point in *decpt.  Stores a pointer
//	to the end of the number in *endPtr.
//
//----------------------------------------------------------------------

func sStrictBignumConversion(tls *libc.TLS, dPtr uintptr, convType int32, bw Tcl_WideUInt, b2 int32, s2 int32, s5 int32, k int32, len int32, ilim int32, ilim1 int32, decpt uintptr, endPtr uintptr) uintptr { /* tclStrToD.c:3949:20: */
	bp := tls.Alloc(148)
	defer tls.Free(148)
	*(*int32)(unsafe.Pointer(bp + 144)) = k

	var retval uintptr = XTcl_Alloc(tls, uint32(len+1))
	// Buffer of digits to return.
	var s uintptr = retval // Cursor in the return value.
	// var b Mp_int at bp+96, 24
	// Numerator of the result.
	// var S Mp_int at bp+120, 24
	// Denominator of the result.
	// var dig Mp_int at bp+72, 24
	// Current digit of the result.
	var digit int32 // Current digit of the result.
	// var temp Mp_int at bp+48, 24
	// Work area.
	var g int32 // Size of the current digit ground.
	var i int32
	var j int32

	// b = bw * 2**b2 * 5**b5
	// S = 2**s2 * 5*s5

	XTclBN_mp_init_multi(tls, bp+48, libc.VaList(bp, bp+72, uintptr(0)))
	XTclBNInitBignumFromWideUInt(tls, bp+96, bw)
	XTclBN_mp_mul_2d(tls, bp+96, b2, bp+96)
	XTclBN_mp_init_set(tls, bp+120, uint32(1))
	sMulPow5(tls, bp+120, uint32(s5), bp+120)
	XTclBN_mp_mul_2d(tls, bp+120, s2, bp+120)

	// Handle the case where we guess the position of the decimal point wrong.

	if XTclBN_mp_cmp_mag(tls, bp+96, bp+120) == -1 {
		XTclBN_mp_mul_d(tls, bp+96, uint32(10), bp+96)
		ilim = ilim1
		*(*int32)(unsafe.Pointer(bp + 144 /* k */))--
	}

	// Convert the leading digit.

	i = 0
	XTclBN_mp_div(tls, bp+96, bp+120, bp+72, bp+96)
	if (*Mp_int)(unsafe.Pointer(bp+72)).Fused > 1 || *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp + 72)).Fdp)) >= Mp_digit(10) {
		XTcl_Panic(tls, ts+64442, 0)
	}
	digit = int32(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp + 72 /* &dig */)).Fdp)))

	// Is a single digit all that was requested?

	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8('0' + digit)
	if libc.PreIncInt32(&i, 1) >= ilim {
		XTclBN_mp_mul_2d(tls, bp+96, 1, bp+96)
		if sShouldBankerRoundUp(tls, bp+96, bp+120, digit&1) != 0 {
			s = sBumpUp(tls, s, retval, bp+144)
		}
	} else {
		for {
			// Shift by a group of digits.

			g = ilim - i
			if g > DIGIT_GROUP {
				g = DIGIT_GROUP
			}
			if s5 >= g {
				XTclBN_mp_div_d(tls, bp+120, dpow5[g], bp+120, uintptr(0))
				s5 = s5 - g
			} else if s5 > 0 {
				XTclBN_mp_div_d(tls, bp+120, dpow5[s5], bp+120, uintptr(0))
				XTclBN_mp_mul_d(tls, bp+96, dpow5[g-s5], bp+96)
				s5 = 0
			} else {
				XTclBN_mp_mul_d(tls, bp+96, dpow5[g], bp+96)
			}
			XTclBN_mp_mul_2d(tls, bp+96, g, bp+96)

			// As with the shortening bignum conversion, it's possible at this
			// point that we will have reduced the denominator to less than
			// 2**64/10, at which point it would be possible to fall back to
			// to int64_t arithmetic. But the potential payoff is tremendously
			// less - unless we're working in F format - because we know that
			// three groups of digits will always suffice for %#.17e, the
			// longest format that doesn't introduce empty precision.
			//
			// Extract the next group of digits.

			XTclBN_mp_div(tls, bp+96, bp+120, bp+72, bp+96)
			if (*Mp_int)(unsafe.Pointer(bp+72)).Fused > 1 {
				XTcl_Panic(tls, ts+64442, 0)
			}
			digit = int32(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp + 72 /* &dig */)).Fdp)))
			for j = g - 1; j >= 0; j-- {
				var t int32 = itens[j]

				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&s, 1))) = int8(digit/t + '0')
				digit = digit % t
			}
			i = i + g

			// Have we converted all the requested digits?

			if i == ilim {
				XTclBN_mp_mul_2d(tls, bp+96, 1, bp+96)
				if sShouldBankerRoundUp(tls, bp+96, bp+120, digit&1) != 0 {
					s = sBumpUp(tls, s, retval, bp+144)
				}
				break
			}
		}
	}
	for int32(*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&s, 1)))) == '0' {
		// do nothing
	}
	s++

	// Endgame - store the location of the decimal point and the end of the
	// string.

	XTclBN_mp_clear_multi(tls, bp+96, libc.VaList(bp+16, bp+120, bp+48, bp+72, uintptr(0)))
	*(*int8)(unsafe.Pointer(s)) = int8(0)
	*(*int32)(unsafe.Pointer(decpt)) = *(*int32)(unsafe.Pointer(bp + 144 /* k */))
	if endPtr != 0 {
		*(*uintptr)(unsafe.Pointer(endPtr)) = s
	}
	return retval
}

//----------------------------------------------------------------------
//
// TclDoubleDigits --
//
//	Core of Tcl's conversion of double-precision floating point numbers to
//	decimal.
//
// Results:
//	Returns a newly-allocated string of digits.
//
// Side effects:
//	Sets *decpt to the index of the character in the string before the
//	place that the decimal point should go. If 'endPtr' is not NULL, sets
//	endPtr to point to the terminating '\0' byte of the string. Sets *sign
//	to 1 if a minus sign should be printed with the number, or 0 if a plus
//	sign (or no sign) should appear.
//
// This function is a service routine that produces the string of digits for
// floating-point-to-decimal conversion. It can do a number of things
// according to the 'flags' argument. Valid values for 'flags' include:
//	TCL_DD_SHORTEST - This is the default for floating point conversion if
//		::tcl_precision is 0. It constructs the shortest string of
//		digits that will reconvert to the given number when scanned.
//		For floating point numbers that are exactly between two
//		decimal numbers, it resolves using the 'round to even' rule.
//		With this value, the 'ndigits' parameter is ignored.
//	TCL_DD_STEELE - This value is not recommended and may be removed in
//		the future. It follows the conversion algorithm outlined in
//		"How to Print Floating-Point Numbers Accurately" by Guy
//		L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90,
//		pp. 112-126]. This rule has the effect of rendering 1e23 as
//		9.9999999999999999e22 - which is a 'better' approximation in
//		the sense that it will reconvert correctly even if a
//		subsequent input conversion is 'round up' or 'round down'
//		rather than 'round to nearest', but is surprising otherwise.
//	TCL_DD_E_FORMAT - This value is used to prepare numbers for %e format
//		conversion (or for default floating->string if tcl_precision
//		is not 0). It constructs a string of at most 'ndigits' digits,
//		choosing the one that is closest to the given number (and
//		resolving ties with 'round to even').  It is allowed to return
//		fewer than 'ndigits' if the number converts exactly; if the
//		TCL_DD_E_FORMAT|TCL_DD_SHORTEN_FLAG is supplied instead, it
//		also returns fewer digits if the shorter string will still
//		reconvert without loss to the given input number. In any case,
//		strings of trailing zeroes are suppressed.
//	TCL_DD_F_FORMAT - This value is used to prepare numbers for %f format
//		conversion. It requests that conversion proceed until
//		'ndigits' digits after the decimal point have been converted.
//		It is possible for this format to result in a zero-length
//		string if the number is sufficiently small. Again, it is
//		permissible for TCL_DD_F_FORMAT to return fewer digits for a
//		number that converts exactly, and changing the argument to
//		TCL_DD_F_FORMAT|TCL_DD_SHORTEN_FLAG will allow the routine
//		also to return fewer digits if the shorter string will still
//		reconvert without loss to the given input number. Strings of
//		trailing zeroes are suppressed.
//
//	To any of these flags may be OR'ed TCL_DD_NO_QUICK; this flag requires
//	all calculations to be done in exact arithmetic. Normally, E and F
//	format with fewer than about 14 digits will be done with a quick
//	floating point approximation and fall back on the exact arithmetic
//	only if the input number is close enough to the midpoint between two
//	decimal strings that more precision is needed to resolve which string
//	is correct.
//
// The value stored in the 'decpt' argument on return may be negative
// (indicating that the decimal point falls to the left of the string) or
// greater than the length of the string. In addition, the value -9999 is used
// as a sentinel to indicate that the string is one of the special values
// "Infinity" and "NaN", and that no decimal point should be inserted.
//
//----------------------------------------------------------------------

func XTclDoubleDigits(tls *libc.TLS, dv float64, ndigits int32, flags int32, decpt uintptr, sign uintptr, endPtr uintptr) uintptr { /* tclStrToD.c:4170:6: */
	bp := tls.Alloc(64)
	defer tls.Free(64)
	*(*int32)(unsafe.Pointer(bp + 44)) = ndigits

	var convType int32 = flags & TCL_DD_CONVERSION_TYPE_MASK
	// Type of conversion being performed:
	// TCL_DD_SHORTEST0, TCL_DD_STEELE0,
	// TCL_DD_E_FORMAT, or TCL_DD_F_FORMAT.
	// var d Double at bp, 8
	// Union for deconstructing doubles.
	// var bw Tcl_WideUInt at bp+8, 8
	// Integer significand.
	// var be int32 at bp+16, 4
	// Power of 2 by which b must be multiplied
	// var bbits int32 at bp+20, 4
	// Number of bits needed to represent b.
	var denorm int32 // Flag == 1 iff the input number was
	// denormalized.
	var k int32 // Estimate of floor(log10(d)).
	// var k_check int32 at bp+24, 4
	// Flag == 1 if d is near enough to a power of
	// ten that k must be checked.
	// var b2 int32 at bp+28, 4

	// var b5 int32 at bp+32, 4

	// var s2 int32 at bp+36, 4

	// var s5 int32 at bp+40, 4
	// Powers of 2 and 5 in the numerator and
	// denominator of intermediate results.
	*(*int32)(unsafe.Pointer(bp + 52 /* ilim */)) = -1
	*(*int32)(unsafe.Pointer(bp + 56 /* ilim1 */)) = -1 // Number of digits to convert, and number to
	// convert if log10(d) has been
	// overestimated.
	var retval uintptr // Return value from this function.
	*(*int32)(unsafe.Pointer(bp + 48 /* i */)) = -1

	// Put the input number into a union for bit-whacking.

	*(*float64)(unsafe.Pointer(bp)) = dv

	// Handle the cases of negative numbers (by taking the absolute value:
	// this includes -Inf and -NaN!), infinity, Not a Number, and zero.

	sTakeAbsoluteValue(tls, bp, sign)
	if *(*int32)(unsafe.Pointer(bp + 4))&EXP_MASK == EXP_MASK {
		return sFormatInfAndNaN(tls, bp, decpt, endPtr)
	}
	if *(*float64)(unsafe.Pointer(bp)) == 0.0 {
		return sFormatZero(tls, decpt, endPtr)
	}

	// Unpack the floating point into a wide integer and an exponent.
	// Determine the number of bits that the big integer requires, and compute
	// a quick approximation (which may be one too high) of ceil(log10(d.d)).

	denorm = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 4))&EXP_MASK == 0)
	sDoubleToExpAndSig(tls, *(*float64)(unsafe.Pointer(bp)), bp+8, bp+16, bp+20)
	k = sApproximateLog10(tls, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8 /* bw */)), *(*int32)(unsafe.Pointer(bp + 16 /* be */)), *(*int32)(unsafe.Pointer(bp + 20 /* bbits */)))
	k = sBetterLog10(tls, *(*float64)(unsafe.Pointer(bp)), k, bp+24)

	// At this point, we have:
	//	  d is the number to convert.
	//    bw are significand and exponent: d == bw*2**be,
	//    bbits is the length of bw: 2**bbits-1 <= bw < 2**bbits
	//	  k is either ceil(log10(d)) or ceil(log10(d))+1. k_check is 0 if we
	//      know that k is exactly ceil(log10(d)) and 1 if we need to check.
	//    We want a rational number
	//      r = b * 10**(1-k) = bw * 2**b2 * 5**b5 / (2**s2 / 5**s5),
	//    with b2, b5, s2, s5 >= 0.  Note that the most significant decimal
	//    digit is floor(r) and that successive digits can be obtained by
	//    setting r <- 10*floor(r) (or b <= 10 * (b % S)).  Find appropriate
	//    b2, b5, s2, s5.

	sComputeScale(tls, *(*int32)(unsafe.Pointer(bp + 16 /* be */)), k, bp+28, bp+32, bp+36, bp+40)

	// Correct an incorrect caller-supplied 'ndigits'.  Also determine:
	//	i = The maximum number of decimal digits that will be returned in the
	//      formatted string.  This is k + 1 + ndigits for F format, 18 for
	//      shortest and Steele, and ndigits for E format.
	//  ilim = The number of significant digits to convert if k has been
	//         guessed correctly. This is -1 for shortest and Steele (which
	//         stop when all significance has been lost), 'ndigits' for E
	//         format, and 'k + 1 + ndigits' for F format.
	//  ilim1 = The minimum number of significant digits to convert if k has
	//	        been guessed 1 too high. This, too, is -1 for shortest and
	//	        Steele, and 'ndigits' for E format, but it's 'ndigits-1' for F
	//	        format.

	sSetPrecisionLimits(tls, convType, k, bp+44, bp+48, bp+52, bp+56)

	// Try to do low-precision conversion in floating point rather than
	// resorting to expensive multiprecision arithmetic.

	if *(*int32)(unsafe.Pointer(bp + 52)) >= 0 && *(*int32)(unsafe.Pointer(bp + 52)) <= QUICK_MAX && !(flags&TCL_DD_NO_QUICK != 0) {
		retval = sQuickConversion(tls, *(*float64)(unsafe.Pointer(bp)), k, *(*int32)(unsafe.Pointer(bp + 24 /* k_check */)), flags, *(*int32)(unsafe.Pointer(bp + 48 /* i */)), *(*int32)(unsafe.Pointer(bp + 52 /* ilim */)), *(*int32)(unsafe.Pointer(bp + 56 /* ilim1 */)),
			decpt, endPtr)
		if retval != uintptr(0) {
			return retval
		}
	}

	// For shortening conversions, determine the upper and lower bounds for
	// the remainder at which we can stop.
	//   m+ = (2**m2plus * 5**m5) / (2**s2 * 5**s5) is the limit on the high
	//        side, and
	//   m- = (2**m2minus * 5**m5) / (2**s2 * 5**s5) is the limit on the low
	//        side.
	// We may need to increase s2 to put m2plus, m2minus, b2 over a common
	// denominator.

	if flags&TCL_DD_SHORTEN_FLAG != 0 {
		*(*int32)(unsafe.Pointer(bp + 60 /* m2minus */)) = *(*int32)(unsafe.Pointer(bp + 28 /* b2 */))
		var m2plus int32
		var m5 int32 = *(*int32)(unsafe.Pointer(bp + 32 /* b5 */))
		var len int32 = *(*int32)(unsafe.Pointer(bp + 48 /* i */))

		// Find the quantity i so that (2**i*5**b5)/(2**s2*5**s5) is 1/2 unit
		// in the least significant place of the floating point number.

		if denorm != 0 {
			*(*int32)(unsafe.Pointer(bp + 48 /* i */)) = *(*int32)(unsafe.Pointer(bp + 16)) + EXPONENT_BIAS + (FP_PRECISION - 1)
		} else {
			*(*int32)(unsafe.Pointer(bp + 48 /* i */)) = 1 + FP_PRECISION - *(*int32)(unsafe.Pointer(bp + 20))
		}
		*(*int32)(unsafe.Pointer(bp + 28 /* b2 */)) += *(*int32)(unsafe.Pointer(bp + 48 /* i */))
		*(*int32)(unsafe.Pointer(bp + 36 /* s2 */)) += *(*int32)(unsafe.Pointer(bp + 48 /* i */))

		// Reduce the fractions to lowest terms, since the above calculation
		// may have left excess powers of 2 in numerator and denominator.

		sCastOutPowersOf2(tls, bp+28, bp+60, bp+36)

		// In the special case where bw==1, the nearest floating point number
		// to it on the low side is 1/4 ulp below it. Adjust accordingly.

		m2plus = *(*int32)(unsafe.Pointer(bp + 60 /* m2minus */))
		if !(denorm != 0) && *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8)) == uint64(1) {
			*(*int32)(unsafe.Pointer(bp + 28 /* b2 */))++
			*(*int32)(unsafe.Pointer(bp + 36 /* s2 */))++
			m2plus++
		}

		if *(*int32)(unsafe.Pointer(bp + 40))+1 < N_LOG2POW5 && *(*int32)(unsafe.Pointer(bp + 36))+1+log2pow5[*(*int32)(unsafe.Pointer(bp + 40))+1] <= 64 {
			// If 10*2**s2*5**s5 == 2**(s2+1)+5**(s5+1) fits in a 64-bit word,
			// then all our intermediate calculations can be done using exact
			// 64-bit arithmetic with no need for expensive multiprecision
			// operations. (This will be true for all numbers in the range
			// [1.0e-3 .. 1.0e+24]).

			return sShorteningInt64Conversion(tls, bp, convType, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8 /* bw */)), *(*int32)(unsafe.Pointer(bp + 28 /* b2 */)), *(*int32)(unsafe.Pointer(bp + 32 /* b5 */)), m2plus,
				*(*int32)(unsafe.Pointer(bp + 60 /* m2minus */)), m5, *(*int32)(unsafe.Pointer(bp + 36 /* s2 */)), *(*int32)(unsafe.Pointer(bp + 40 /* s5 */)), k, len, *(*int32)(unsafe.Pointer(bp + 52 /* ilim */)), *(*int32)(unsafe.Pointer(bp + 56 /* ilim1 */)), decpt, endPtr)
		} else if *(*int32)(unsafe.Pointer(bp + 40)) == 0 {
			// The denominator is a power of 2, so we can replace division by
			// digit shifts. First we round up s2 to a multiple of MP_DIGIT_BIT,
			// and adjust m2 and b2 accordingly. Then we launch into a version
			// of the comparison that's specialized for the 'power of mp_digit
			// in the denominator' case.

			if *(*int32)(unsafe.Pointer(bp + 36))%MP_DIGIT_BIT != 0 {
				var delta int32 = MP_DIGIT_BIT - *(*int32)(unsafe.Pointer(bp + 36))%MP_DIGIT_BIT

				*(*int32)(unsafe.Pointer(bp + 28 /* b2 */)) += delta
				m2plus = m2plus + delta
				*(*int32)(unsafe.Pointer(bp + 60 /* m2minus */)) += delta
				*(*int32)(unsafe.Pointer(bp + 36 /* s2 */)) += delta
			}
			return sShorteningBignumConversionPowD(tls, bp, convType, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8 /* bw */)), *(*int32)(unsafe.Pointer(bp + 28 /* b2 */)), *(*int32)(unsafe.Pointer(bp + 32 /* b5 */)),
				m2plus, *(*int32)(unsafe.Pointer(bp + 60 /* m2minus */)), m5, *(*int32)(unsafe.Pointer(bp + 36))/MP_DIGIT_BIT, k, len, *(*int32)(unsafe.Pointer(bp + 52 /* ilim */)), *(*int32)(unsafe.Pointer(bp + 56 /* ilim1 */)),
				decpt, endPtr)
		} else {
			// Alas, there's no helpful special case; use full-up bignum
			// arithmetic for the conversion.

			return sShorteningBignumConversion(tls, bp, convType, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8 /* bw */)), *(*int32)(unsafe.Pointer(bp + 28 /* b2 */)), m2plus,
				*(*int32)(unsafe.Pointer(bp + 60 /* m2minus */)), *(*int32)(unsafe.Pointer(bp + 36 /* s2 */)), *(*int32)(unsafe.Pointer(bp + 40 /* s5 */)), k, len, *(*int32)(unsafe.Pointer(bp + 52 /* ilim */)), *(*int32)(unsafe.Pointer(bp + 56 /* ilim1 */)), decpt, endPtr)
		}
	} else {
		// Non-shortening conversion.

		var len int32 = *(*int32)(unsafe.Pointer(bp + 48 /* i */))

		// Reduce numerator and denominator to lowest terms.

		if *(*int32)(unsafe.Pointer(bp + 28)) >= *(*int32)(unsafe.Pointer(bp + 36)) && *(*int32)(unsafe.Pointer(bp + 36)) > 0 {
			*(*int32)(unsafe.Pointer(bp + 28 /* b2 */)) -= *(*int32)(unsafe.Pointer(bp + 36 /* s2 */))
			*(*int32)(unsafe.Pointer(bp + 36 /* s2 */)) = 0
		} else if *(*int32)(unsafe.Pointer(bp + 36)) >= *(*int32)(unsafe.Pointer(bp + 28)) && *(*int32)(unsafe.Pointer(bp + 28)) > 0 {
			*(*int32)(unsafe.Pointer(bp + 36 /* s2 */)) -= *(*int32)(unsafe.Pointer(bp + 28 /* b2 */))
			*(*int32)(unsafe.Pointer(bp + 28 /* b2 */)) = 0
		}

		if *(*int32)(unsafe.Pointer(bp + 40))+1 < N_LOG2POW5 && *(*int32)(unsafe.Pointer(bp + 36))+1+log2pow5[*(*int32)(unsafe.Pointer(bp + 40))+1] <= 64 {
			// If 10*2**s2*5**s5 == 2**(s2+1)+5**(s5+1) fits in a 64-bit word,
			// then all our intermediate calculations can be done using exact
			// 64-bit arithmetic with no need for expensive multiprecision
			// operations.

			return sStrictInt64Conversion(tls, bp, convType, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8 /* bw */)), *(*int32)(unsafe.Pointer(bp + 28 /* b2 */)), *(*int32)(unsafe.Pointer(bp + 32 /* b5 */)), *(*int32)(unsafe.Pointer(bp + 36 /* s2 */)), *(*int32)(unsafe.Pointer(bp + 40 /* s5 */)), k,
				len, *(*int32)(unsafe.Pointer(bp + 52 /* ilim */)), *(*int32)(unsafe.Pointer(bp + 56 /* ilim1 */)), decpt, endPtr)
		} else if *(*int32)(unsafe.Pointer(bp + 40)) == 0 {
			// The denominator is a power of 2, so we can replace division by
			// digit shifts. First we round up s2 to a multiple of MP_DIGIT_BIT,
			// and adjust m2 and b2 accordingly. Then we launch into a version
			// of the comparison that's specialized for the 'power of mp_digit
			// in the denominator' case.

			if *(*int32)(unsafe.Pointer(bp + 36))%MP_DIGIT_BIT != 0 {
				var delta int32 = MP_DIGIT_BIT - *(*int32)(unsafe.Pointer(bp + 36))%MP_DIGIT_BIT

				*(*int32)(unsafe.Pointer(bp + 28 /* b2 */)) += delta
				*(*int32)(unsafe.Pointer(bp + 36 /* s2 */)) += delta
			}
			return sStrictBignumConversionPowD(tls, bp, convType, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8 /* bw */)), *(*int32)(unsafe.Pointer(bp + 28 /* b2 */)), *(*int32)(unsafe.Pointer(bp + 32 /* b5 */)),
				*(*int32)(unsafe.Pointer(bp + 36))/MP_DIGIT_BIT, k, len, *(*int32)(unsafe.Pointer(bp + 52 /* ilim */)), *(*int32)(unsafe.Pointer(bp + 56 /* ilim1 */)), decpt, endPtr)
		} else {
			// There are no helpful special cases, but at least we know in
			// advance how many digits we will convert. We can run the
			// conversion in steps of DIGIT_GROUP digits, so as to have many
			// fewer mp_int divisions.

			return sStrictBignumConversion(tls, bp, convType, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8 /* bw */)), *(*int32)(unsafe.Pointer(bp + 28 /* b2 */)), *(*int32)(unsafe.Pointer(bp + 36 /* s2 */)), *(*int32)(unsafe.Pointer(bp + 40 /* s5 */)), k,
				len, *(*int32)(unsafe.Pointer(bp + 52 /* ilim */)), *(*int32)(unsafe.Pointer(bp + 56 /* ilim1 */)), decpt, endPtr)
		}
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// TclInitDoubleConversion --
//
//	Initializes constants that are needed for conversions to and from
//	'double'
//
// Results:
//	None.
//
// Side effects:
//	The log base 2 of the floating point radix, the number of bits in a
//	double mantissa, and a table of the powers of five and ten are
//	computed and stored.
//
//----------------------------------------------------------------------

func XTclInitDoubleConversion(tls *libc.TLS) { /* tclStrToD.c:4445:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var i int32
	var x int32
	var u Tcl_WideUInt
	var d float64
	// var bitwhack struct {Fdv float64;} at bp, 8

	// Initialize table of powers of 10 expressed as wide integers.

	maxpow10_wide = libc.Int32FromFloat64(libc.Xfloor(tls, float64(uint64(unsafe.Sizeof(Tcl_WideUInt(0)))*uint64(8))*libc.Xlog(tls, 2.)/libc.Xlog(tls, 10.)))
	pow10_wide = XTcl_Alloc(tls, uint32(uint64(maxpow10_wide+1)*uint64(unsafe.Sizeof(Tcl_WideUInt(0)))))
	u = uint64(1)
	for i = 0; i < maxpow10_wide; i++ {
		*(*Tcl_WideUInt)(unsafe.Pointer(pow10_wide + uintptr(i)*8)) = u
		u = u * uint64(10)
	}
	*(*Tcl_WideUInt)(unsafe.Pointer(pow10_wide + uintptr(i)*8)) = u

	// Determine how many bits of precision a double has, and how many decimal
	// digits that represents.

	if libc.Xfrexp(tls, float64(2), uintptr(unsafe.Pointer(&log2FLT_RADIX))) != 0.5 {
		XTcl_Panic(tls, ts+64545, 0)
	}
	log2FLT_RADIX--
	mantBits = 53 * log2FLT_RADIX
	d = 1.0

	// Initialize a table of powers of ten that can be exactly represented in
	// a double.

	x = libc.Int32FromFloat64(float64(53) * libc.Xlog(tls, float64(2)) / libc.Xlog(tls, 5.0))
	if x < MAXPOW {
		mmaxpow = x
	} else {
		mmaxpow = MAXPOW
	}
	for i = 0; i <= mmaxpow; i++ {
		pow10vals[i] = d
		d = d * 10.0
	}

	// Initialize a table of large powers of five.

	for i = 0; i < 9; i++ {
		XTclBN_mp_init(tls, uintptr(unsafe.Pointer(&pow5))+uintptr(i)*24)
	}
	XTclBN_mp_set(tls, uintptr(unsafe.Pointer(&pow5)), uint32(5))
	for i = 0; i < 8; i++ {
		XTclBN_mp_sqr(tls, uintptr(unsafe.Pointer(&pow5))+uintptr(i)*24, uintptr(unsafe.Pointer(&pow5))+uintptr(i)*24+uintptr(1)*24)
	}
	XTclBN_mp_init_set_int(tls, uintptr(unsafe.Pointer(&pow5_13)), uint64(1220703125))
	for i = 1; i < 5; i++ {
		XTclBN_mp_init(tls, uintptr(unsafe.Pointer(&pow5_13))+uintptr(i)*24)
		XTclBN_mp_sqr(tls, uintptr(unsafe.Pointer(&pow5_13))+uintptr(i)*24-uintptr(1)*24, uintptr(unsafe.Pointer(&pow5_13))+uintptr(i)*24)
	}

	// Determine the number of decimal digits to the left and right of the
	// decimal point in the largest and smallest double, the smallest double
	// that differs from zero, and the number of mp_digits needed to represent
	// the significand of a double.

	maxDigits = libc.Int32FromFloat64((float64(1024)*libc.Xlog(tls, float64(2)) +
		0.5*libc.Xlog(tls, 10.)) / libc.Xlog(tls, 10.))
	minDigits = libc.Int32FromFloat64(libc.Xfloor(tls, float64(-1021-53)*
		libc.Xlog(tls, float64(2))/libc.Xlog(tls, 10.)))
	log10_DIGIT_MAX = libc.Int32FromFloat64(libc.Xfloor(tls, float64(MP_DIGIT_BIT)*libc.Xlog(tls, 2.)/libc.Xlog(tls, 10.)))

	// Nokia 770's software-emulated floating point is "middle endian": the
	// bytes within a 32-bit word are little-endian (like the native
	// integers), but the two words of a 'double' are presented most
	// significant word first.

	*(*float64)(unsafe.Pointer(bp)) = 1.000000238418579
	// 3ff0 0000 4000 0000
	if *(*Tcl_WideUInt)(unsafe.Pointer(bp))>>32 == uint64(0x3FF00000) {
		n770_fp = 0
	} else if *(*Tcl_WideUInt)(unsafe.Pointer(bp))&uint64(0xFFFFFFFF) == uint64(0x3FF00000) {
		n770_fp = 1
	} else {
		XTcl_Panic(tls, ts+64590, 0)
	}
}

//----------------------------------------------------------------------
//
// TclFinalizeDoubleConversion --
//
//	Cleans up this file on exit.
//
// Results:
//	None
//
// Side effects:
//	Memory allocated by TclInitDoubleConversion is freed.
//
//----------------------------------------------------------------------

func XTclFinalizeDoubleConversion(tls *libc.TLS) { /* tclStrToD.c:4575:1: */
	var i int32

	XTclpFree(tls, pow10_wide)
	for i = 0; i < 9; i++ {
		XTclBN_mp_clear(tls, uintptr(unsafe.Pointer(&pow5))+uintptr(i)*24)
	}
	for i = 0; i < 5; i++ {
		XTclBN_mp_clear(tls, uintptr(unsafe.Pointer(&pow5_13))+uintptr(i)*24)
	}
}

//----------------------------------------------------------------------
//
// Tcl_InitBignumFromDouble --
//
//	Extracts the integer part of a double and converts it to an arbitrary
//	precision integer.
//
// Results:
//	None.
//
// Side effects:
//	Initializes the bignum supplied, and stores the converted number in
//	it.
//
//----------------------------------------------------------------------

func XTcl_InitBignumFromDouble(tls *libc.TLS, interp uintptr, d float64, b uintptr) int32 { /* tclStrToD.c:4607:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var fract float64
	// var expt int32 at bp+32, 4

	// Infinite values can't convert to bignum.

	if d > 1.79769313486231570814527423731704357e+308 || d < -1.79769313486231570814527423731704357e+308 {
		if interp != uintptr(0) {
			var s uintptr = ts + 10555 /* "integer value to..." */

			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, s, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+8249, ts+53996, s, uintptr(0)))
		}
		return TCL_ERROR
	}

	fract = libc.Xfrexp(tls, d, bp+32)
	if *(*int32)(unsafe.Pointer(bp + 32)) <= 0 {
		XTclBN_mp_init(tls, b)
		XTclBN_mp_zero(tls, b)
	} else {
		var w Tcl_WideInt = libc.Int64FromFloat64(libc.Xldexp(tls, fract, mantBits))
		var shift int32 = *(*int32)(unsafe.Pointer(bp + 32)) - mantBits

		XTclBNInitBignumFromWideInt(tls, b, w)
		if shift < 0 {
			XTclBN_mp_div_2d(tls, b, -shift, b, uintptr(0))
		} else if shift > 0 {
			XTclBN_mp_mul_2d(tls, b, shift, b)
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclBignumToDouble --
//
//	Convert an arbitrary-precision integer to a native floating point
//	number.
//
// Results:
//	Returns the converted number. Sets errno to ERANGE if the number is
//	too large to convert.
//
//----------------------------------------------------------------------

func XTclBignumToDouble(tls *libc.TLS, a uintptr) float64 { /* tclStrToD.c:4663:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var b Mp_int at bp, 24

	var bits int32
	var shift int32
	var i int32
	var lsb int32
	var r float64

	// We need a 'mantBits'-bit significand.  Determine what shift will
	// give us that.

	bits = XTclBN_mp_count_bits(tls, a)
	if bits > 1024*log2FLT_RADIX {
		*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = ERANGE
		if func() int32 {
			if (*Mp_int)(unsafe.Pointer(a)).Fsign != MP_ZPOS {
				return MP_YES
			}
			return MP_NO
		}() != 0 {
			return -libc.X__builtin_huge_val(tls)
		} else {
			return libc.X__builtin_huge_val(tls)
		}
	}
	shift = mantBits - bits

	// If shift > 0, shift the significand left by the requisite number of
	// bits.  If shift == 0, the significand is already exactly 'mantBits'
	// in length.  If shift < 0, we will need to shift the significand right
	// by the requisite number of bits, and round it. If the '1-shift'
	// least significant bits are 0, but the 'shift'th bit is nonzero,
	// then the significand lies exactly between two values and must be
	// 'rounded to even'.

	XTclBN_mp_init(tls, bp)
	if shift == 0 {
		XTclBN_mp_copy(tls, a, bp)
	} else if shift > 0 {
		XTclBN_mp_mul_2d(tls, a, shift, bp)
	} else if shift < 0 {
		lsb = XTclBN_mp_cnt_lsb(tls, a)
		if lsb == -1-shift {

			// Round to even

			XTclBN_mp_div_2d(tls, a, -shift, bp, uintptr(0))
			if func() int32 {
				if (*Mp_int)(unsafe.Pointer(bp)).Fused != 0 && *(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp))&Mp_digit(1) == Mp_digit(1) {
					return MP_YES
				}
				return MP_NO
			}() != 0 {
				if func() int32 {
					if (*Mp_int)(unsafe.Pointer(bp)).Fsign != MP_ZPOS {
						return MP_YES
					}
					return MP_NO
				}() != 0 {
					XTclBN_mp_sub_d(tls, bp, uint32(1), bp)
				} else {
					XTclBN_mp_add_d(tls, bp, uint32(1), bp)
				}
			}
		} else {

			// Ordinary rounding

			XTclBN_mp_div_2d(tls, a, -1-shift, bp, uintptr(0))
			if func() int32 {
				if (*Mp_int)(unsafe.Pointer(bp)).Fsign != MP_ZPOS {
					return MP_YES
				}
				return MP_NO
			}() != 0 {
				XTclBN_mp_sub_d(tls, bp, uint32(1), bp)
			} else {
				XTclBN_mp_add_d(tls, bp, uint32(1), bp)
			}
			XTclBN_mp_div_2d(tls, bp, 1, bp, uintptr(0))
		}
	}

	// Accumulate the result, one mp_digit at a time.

	r = 0.0
	for i = (*Mp_int)(unsafe.Pointer(bp)).Fused - 1; i >= 0; i-- {
		r = libc.Xldexp(tls, r, MP_DIGIT_BIT) + float64(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(i)*4)))
	}
	XTclBN_mp_clear(tls, bp)

	// Scale the result to the correct number of bits.

	r = libc.Xldexp(tls, r, bits-mantBits)

	// Return the result with the appropriate sign.

	if func() int32 {
		if (*Mp_int)(unsafe.Pointer(a)).Fsign != MP_ZPOS {
			return MP_YES
		}
		return MP_NO
	}() != 0 {
		return -r
	} else {
		return r
	}
	return float64(0)
}

//----------------------------------------------------------------------
//
// TclCeil --
//
//	Computes the smallest floating point number that is at least the
//	mp_int argument.
//
// Results:
//	Returns the floating point number.
//
//----------------------------------------------------------------------

func XTclCeil(tls *libc.TLS, a uintptr) float64 { /* tclStrToD.c:4776:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var r float64 = 0.0
	// var b Mp_int at bp, 24

	XTclBN_mp_init(tls, bp)
	if XTclBN_mp_cmp_d(tls, a, uint32(0)) == -1 {
		XTclBN_mp_neg(tls, a, bp)
		r = -XTclFloor(tls, bp)
	} else {
		var bits int32 = XTclBN_mp_count_bits(tls, a)

		if bits > 1024*log2FLT_RADIX {
			r = libc.X__builtin_huge_val(tls)
		} else {
			var i int32
			var exact int32 = 1
			var shift int32 = mantBits - bits

			if shift > 0 {
				XTclBN_mp_mul_2d(tls, a, shift, bp)
			} else if shift < 0 {
				// var d Mp_int at bp+24, 24

				XTclBN_mp_init(tls, bp+24)
				XTclBN_mp_div_2d(tls, a, -shift, bp, bp+24)
				exact = func() int32 {
					if (*Mp_int)(unsafe.Pointer(bp+24)).Fused == 0 {
						return MP_YES
					}
					return MP_NO
				}()
				XTclBN_mp_clear(tls, bp+24)
			} else {
				XTclBN_mp_copy(tls, a, bp)
			}
			if !(exact != 0) {
				XTclBN_mp_add_d(tls, bp, uint32(1), bp)
			}
			for i = (*Mp_int)(unsafe.Pointer(bp)).Fused - 1; i >= 0; i-- {
				r = libc.Xldexp(tls, r, MP_DIGIT_BIT) + float64(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(i)*4)))
			}
			r = libc.Xldexp(tls, r, bits-mantBits)
		}
	}
	XTclBN_mp_clear(tls, bp)
	return r
}

//----------------------------------------------------------------------
//
// TclFloor --
//
//	Computes the largest floating point number less than or equal to the
//	mp_int argument.
//
// Results:
//	Returns the floating point value.
//
//----------------------------------------------------------------------

func XTclFloor(tls *libc.TLS, a uintptr) float64 { /* tclStrToD.c:4833:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var r float64 = 0.0
	// var b Mp_int at bp, 24

	XTclBN_mp_init(tls, bp)
	if XTclBN_mp_cmp_d(tls, a, uint32(0)) == -1 {
		XTclBN_mp_neg(tls, a, bp)
		r = -XTclCeil(tls, bp)
	} else {
		var bits int32 = XTclBN_mp_count_bits(tls, a)

		if bits > 1024*log2FLT_RADIX {
			r = 1.79769313486231570814527423731704357e+308
		} else {
			var i int32
			var shift int32 = mantBits - bits

			if shift > 0 {
				XTclBN_mp_mul_2d(tls, a, shift, bp)
			} else if shift < 0 {
				XTclBN_mp_div_2d(tls, a, -shift, bp, uintptr(0))
			} else {
				XTclBN_mp_copy(tls, a, bp)
			}
			for i = (*Mp_int)(unsafe.Pointer(bp)).Fused - 1; i >= 0; i-- {
				r = libc.Xldexp(tls, r, MP_DIGIT_BIT) + float64(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(i)*4)))
			}
			r = libc.Xldexp(tls, r, bits-mantBits)
		}
	}
	XTclBN_mp_clear(tls, bp)
	return r
}

//----------------------------------------------------------------------
//
// BignumToBiasedFrExp --
//
//	Convert an arbitrary-precision integer to a native floating point
//	number in the range [0.5,1) times a power of two. NOTE: Intentionally
//	converts to a number that's a few ulp too small, so that
//	RefineApproximation will not overflow near the high end of the
//	machine's arithmetic range.
//
// Results:
//	Returns the converted number.
//
// Side effects:
//	Stores the exponent of two in 'machexp'.
//
//----------------------------------------------------------------------

func sBignumToBiasedFrExp(tls *libc.TLS, a uintptr, machexp uintptr) float64 { /* tclStrToD.c:4889:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var b Mp_int at bp, 24

	var bits int32
	var shift int32
	var i int32
	var r float64

	// Determine how many bits we need, and extract that many from the input.
	// Round to nearest unit in the last place.

	bits = XTclBN_mp_count_bits(tls, a)
	shift = mantBits - 2 - bits
	XTclBN_mp_init(tls, bp)
	if shift > 0 {
		XTclBN_mp_mul_2d(tls, a, shift, bp)
	} else if shift < 0 {
		XTclBN_mp_div_2d(tls, a, -shift, bp, uintptr(0))
	} else {
		XTclBN_mp_copy(tls, a, bp)
	}

	// Accumulate the result, one mp_digit at a time.

	r = 0.0
	for i = (*Mp_int)(unsafe.Pointer(bp)).Fused - 1; i >= 0; i-- {
		r = libc.Xldexp(tls, r, MP_DIGIT_BIT) + float64(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp)).Fdp + uintptr(i)*4)))
	}
	XTclBN_mp_clear(tls, bp)

	// Return the result with the appropriate sign.

	*(*int32)(unsafe.Pointer(machexp)) = bits - mantBits + 2
	return func() float64 {
		if func() int32 {
			if (*Mp_int)(unsafe.Pointer(a)).Fsign != MP_ZPOS {
				return MP_YES
			}
			return MP_NO
		}() != 0 {
			return -r
		}
		return r
	}()
}

//----------------------------------------------------------------------
//
// Pow10TimesFrExp --
//
//	Multiply a power of ten by a number expressed as fraction and
//	exponent.
//
// Results:
//	Returns the significand of the result.
//
// Side effects:
//	Overwrites the 'machexp' parameter with the exponent of the result.
//
// Assumes that 'exponent' is such that 10**exponent would be a double, even
// though 'fraction*10**(machexp+exponent)' might overflow.
//
//----------------------------------------------------------------------

func sPow10TimesFrExp(tls *libc.TLS, exponent int32, fraction float64, machexp uintptr) float64 { /* tclStrToD.c:4954:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var i int32
	// var j int32 at bp, 4

	var expt int32 = *(*int32)(unsafe.Pointer(machexp))
	var retval float64 = fraction

	if exponent > 0 {
		// Multiply by 10**exponent.

		retval = libc.Xfrexp(tls, retval*pow10vals[exponent&0xF], bp)
		expt = expt + *(*int32)(unsafe.Pointer(bp))
		for i = 4; i < 9; i++ {
			if exponent&(int32(1)<<i) != 0 {
				retval = libc.Xfrexp(tls, retval*pow_10_2_n[i], bp)
				expt = expt + *(*int32)(unsafe.Pointer(bp))
			}
		}
	} else if exponent < 0 {
		// Divide by 10**-exponent.

		retval = libc.Xfrexp(tls, retval/pow10vals[-exponent&0xF], bp)
		expt = expt + *(*int32)(unsafe.Pointer(bp))
		for i = 4; i < 9; i++ {
			if -exponent&(int32(1)<<i) != 0 {
				retval = libc.Xfrexp(tls, retval/pow_10_2_n[i], bp)
				expt = expt + *(*int32)(unsafe.Pointer(bp))
			}
		}
	}

	*(*int32)(unsafe.Pointer(machexp)) = expt
	return retval
}

//----------------------------------------------------------------------
//
// SafeLdExp --
//
//	Do an 'ldexp' operation, but handle denormals gracefully.
//
// Results:
//	Returns the appropriately scaled value.
//
//	On some platforms, 'ldexp' fails when presented with a number too
//	small to represent as a normalized double. This routine does 'ldexp'
//	in two steps for those numbers, to return correctly denormalized
//	values.
//
//----------------------------------------------------------------------

func sSafeLdExp(tls *libc.TLS, fract float64, expt int32) float64 { /* tclStrToD.c:5015:1: */
	var minexpt int32 = -1021 * log2FLT_RADIX
	var a float64
	var b float64
	var retval float64

	if expt < minexpt {
		libc.AtomicStoreFloat64(&a, float64(libc.Xldexp(tls, fract, expt-mantBits-minexpt)))
		libc.AtomicStoreFloat64(&b, float64(libc.Xldexp(tls, 1.0, mantBits+minexpt)))
		libc.AtomicStoreFloat64(&retval, float64(a*b))
	} else {
		libc.AtomicStoreFloat64(&retval, float64(libc.Xldexp(tls, fract, expt)))
	}
	return retval
}

//----------------------------------------------------------------------
//
// TclFormatNaN --
//
//	Makes the string representation of a "Not a Number"
//
// Results:
//	None.
//
// Side effects:
//	Stores the string representation in the supplied buffer, which must be
//	at least TCL_DOUBLE_SPACE characters.
//
//----------------------------------------------------------------------

func XTclFormatNaN(tls *libc.TLS, value float64, buffer uintptr) { /* tclStrToD.c:5050:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var bitwhack struct {Fdv float64;} at bp+8, 8

	*(*float64)(unsafe.Pointer(bp + 8)) = value
	if n770_fp != 0 {
		*(*Tcl_WideUInt)(unsafe.Pointer(bp + 8)) = sNokia770Twiddle(tls, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8)))
	}
	if *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8))&(Tcl_WideUInt(uint64(1))<<63) != 0 {
		*(*Tcl_WideUInt)(unsafe.Pointer(bp + 8)) &= libc.CplUint64(Tcl_WideUInt(uint64(1)) << 63)
		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&buffer, 1))) = int8('-')
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&buffer, 1))) = int8('N')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&buffer, 1))) = int8('a')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&buffer, 1))) = int8('N')
	*(*Tcl_WideUInt)(unsafe.Pointer(bp + 8)) &= Tcl_WideUInt(uint64(1))<<51 - uint64(1)
	if *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8)) != uint64(0) {
		libc.Xsprintf(tls, buffer, ts+64640, libc.VaList(bp, *(*Tcl_WideUInt)(unsafe.Pointer(bp + 8))))
	} else {
		*(*int8)(unsafe.Pointer(buffer)) = int8(0)
	}
}

//----------------------------------------------------------------------
//
// Nokia770Twiddle --
//
//	Transpose the two words of a number for Nokia 770 floating point
//	handling.
//
//----------------------------------------------------------------------
func sNokia770Twiddle(tls *libc.TLS, w Tcl_WideUInt) Tcl_WideUInt { /* tclStrToD.c:5095:1: */
	return w>>32&uint64(0xFFFFFFFF) | w<<32
}

//----------------------------------------------------------------------
//
// TclNokia770Doubles --
//
//	Transpose the two words of a number for Nokia 770 floating point
//	handling.
//
//----------------------------------------------------------------------

func XTclNokia770Doubles(tls *libc.TLS) int32 { /* tclStrToD.c:5114:1: */
	return n770_fp
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// tclInt.h --
//
//	Declarations of things used internally by the Tcl interpreter.
//
// Copyright (c) 1987-1993 The Regents of the University of California.
// Copyright (c) 1993-1997 Lucent Technologies.
// Copyright (c) 1994-1998 Sun Microsystems, Inc.
// Copyright (c) 1998-1999 by Scriptics Corporation.
// Copyright (c) 2001, 2002 by Kevin B. Kenny.  All rights reserved.
// Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
// Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
// Copyright (c) 2008 by Miguel Sofer. All rights reserved.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// tclStringRep.h --
//
//	This file contains the definition of the Unicode string internal
//	representation and macros to access it.
//
//	A Unicode string is an internationalized string. Conceptually, a
//	Unicode string is an array of 16-bit quantities organized as a
//	sequence of properly formed UTF-8 characters. There is a one-to-one
//	map between Unicode and UTF characters. Because Unicode characters
//	have a fixed width, operations such as indexing operate on Unicode
//	data. The String object is optimized for the case where each UTF char
//	in a string is only one byte. In this case, we store the value of
//	numChars, but we don't store the Unicode data (unless Tcl_GetUnicode
//	is explicitly called).
//
//	The String object type stores one or both formats. The default
//	behavior is to store UTF. Once Unicode is calculated by a function, it
//	is stored in the internal rep for future access (without an additional
//	O(n) cost).
//
//	To allow many appends to be done to an object without constantly
//	reallocating the space for the string or Unicode representation, we
//	allocate double the space for the string or Unicode and use the
//	internal representation to keep track of how much space is used vs.
//	allocated.
//
// Copyright (c) 1995-1997 Sun Microsystems, Inc.
// Copyright (c) 1999 by Scriptics Corporation.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// The following structure is the internal rep for a String object. It keeps
// track of how much memory has been used and how much has been allocated for
// the Unicode and UTF string to enable growing and shrinking of the UTF and
// Unicode reps of the String object with fewer mallocs. To optimize string
// length and indexing operations, this structure also stores the number of
// characters (same of UTF and Unicode!) once that value has been computed.
//
// Under normal configurations, what Tcl calls "Unicode" is actually UTF-16
// restricted to the Basic Multilingual Plane (i.e. U+00000 to U+0FFFF). This
// can be officially modified by altering the definition of Tcl_UniChar in
// tcl.h, but do not do that unless you are sure what you're doing!

type String1 = struct {
	F__ccgo_pad1 [0]uint32
	FnumChars    int32
	Fallocated   int32
	FmaxChars    int32
	FhasUnicode  int32
} /* tclStringRep.h:49:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// tclInt.h --
//
//	Declarations of things used internally by the Tcl interpreter.
//
// Copyright (c) 1987-1993 The Regents of the University of California.
// Copyright (c) 1993-1997 Lucent Technologies.
// Copyright (c) 1994-1998 Sun Microsystems, Inc.
// Copyright (c) 1998-1999 by Scriptics Corporation.
// Copyright (c) 2001, 2002 by Kevin B. Kenny.  All rights reserved.
// Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
// Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
// Copyright (c) 2008 by Miguel Sofer. All rights reserved.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// super class file for PK algos

// default ... include all MPI

// RSA only (does not support DH/DSA/ECC)
// #define SC_RSA_1
// #define SC_RSA_1_WITH_TESTS

// For reference.... On an Athlon64 optimizing for speed...
//
//    LTM's mpi.o with all functions [striped] is 142KiB in size.
//

// Works for RSA only, mpi.o is 68KiB
// LibTomMath, multiple-precision integer library -- Tom St Denis
// SPDX-License-Identifier: Unlicense

// tclStringRep.h --
//
//	This file contains the definition of the Unicode string internal
//	representation and macros to access it.
//
//	A Unicode string is an internationalized string. Conceptually, a
//	Unicode string is an array of 16-bit quantities organized as a
//	sequence of properly formed UTF-8 characters. There is a one-to-one
//	map between Unicode and UTF characters. Because Unicode characters
//	have a fixed width, operations such as indexing operate on Unicode
//	data. The String object is optimized for the case where each UTF char
//	in a string is only one byte. In this case, we store the value of
//	numChars, but we don't store the Unicode data (unless Tcl_GetUnicode
//	is explicitly called).
//
//	The String object type stores one or both formats. The default
//	behavior is to store UTF. Once Unicode is calculated by a function, it
//	is stored in the internal rep for future access (without an additional
//	O(n) cost).
//
//	To allow many appends to be done to an object without constantly
//	reallocating the space for the string or Unicode representation, we
//	allocate double the space for the string or Unicode and use the
//	internal representation to keep track of how much space is used vs.
//	allocated.
//
// Copyright (c) 1995-1997 Sun Microsystems, Inc.
// Copyright (c) 1999 by Scriptics Corporation.
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.

// The following structure is the internal rep for a String object. It keeps
// track of how much memory has been used and how much has been allocated for
// the Unicode and UTF string to enable growing and shrinking of the UTF and
// Unicode reps of the String object with fewer mallocs. To optimize string
// length and indexing operations, this structure also stores the number of
// characters (same of UTF and Unicode!) once that value has been computed.
//
// Under normal configurations, what Tcl calls "Unicode" is actually UTF-16
// restricted to the Basic Multilingual Plane (i.e. U+00000 to U+0FFFF). This
// can be officially modified by altering the definition of Tcl_UniChar in
// tcl.h, but do not do that unless you are sure what you're doing!

type String = String1 /* tclStringRep.h:65:3 */

// The structure below defines the string Tcl object type by means of
// functions that can be invoked by generic object code.

var XtclStringType = Tcl_ObjType{
	Fname:             ts + 16446,
	FfreeIntRepProc:   0, // freeIntRepPro
	FdupIntRepProc:    0, // dupIntRepProc
	FupdateStringProc: 0, // updateStringProc
	FsetFromAnyProc:   0, // setFromAnyProc
} /* tclStringObj.c:86:19 */

// TCL STRING GROWTH ALGORITHM
//
// When growing strings (during an append, for example), the following growth
// algorithm is used:
//
//   Attempt to allocate 2 * (originalLength + appendLength)
//   On failure:
//	attempt to allocate originalLength + 2*appendLength + TCL_MIN_GROWTH
//
// This algorithm allows very good performance, as it rapidly increases the
// memory allocated for a given string, which minimizes the number of
// reallocations that must be performed. However, using only the doubling
// algorithm can lead to a significant waste of memory. In particular, it may
// fail even when there is sufficient memory available to complete the append
// request (but there is not 2*totalLength memory available). So when the
// doubling fails (because there is not enough memory available), the
// algorithm requests a smaller amount of memory, which is still enough to
// cover the request, but which hopefully will be less than the total
// available memory.
//
// The addition of TCL_MIN_GROWTH allows for efficient handling of very
// small appends. Without this extra slush factor, a sequence of several small
// appends would cause several memory allocations. As long as
// TCL_MIN_GROWTH is a reasonable size, we can avoid that behavior.
//
// The growth algorithm can be tuned by adjusting the following parameters:
//
// TCL_MIN_GROWTH		Additional space, in bytes, to allocate when
//				the double allocation has failed. Default is
//				1024 (1 kilobyte).  See tclInt.h.

func sGrowStringBuffer(tls *libc.TLS, objPtr uintptr, needed int32, flag int32) { /* tclStringObj.c:132:1: */
	// Pre-conditions:
	//	objPtr->typePtr == &tclStringType
	//	needed > stringPtr->allocated
	//	flag || objPtr->bytes != NULL

	var stringPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	var ptr uintptr = uintptr(0)
	var attempt int32

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == XtclEmptyStringRep {
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(0)
	}
	if flag == 0 || (*String)(unsafe.Pointer(stringPtr)).Fallocated > 0 {
		if needed <= 0x7fffffff/2 {
			attempt = 2 * needed
			ptr = XTclpRealloc(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, uint32(attempt+1))
		}
		if ptr == uintptr(0) {
			// Take care computing the amount of modest growth to avoid
			// overflow into invalid argument values for attempt.

			var limit uint32 = uint32(0x7fffffff - needed)
			var extra uint32 = uint32(needed - (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength + TCL_MIN_GROWTH)
			var growth int32 = func() int32 {
				if extra > limit {
					return int32(limit)
				}
				return int32(extra)
			}()

			attempt = needed + growth
			ptr = XTclpRealloc(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, uint32(attempt+1))
		}
	}
	if ptr == uintptr(0) {
		// First allocation - just big enough; or last chance fallback.

		attempt = needed
		ptr = XTcl_Realloc(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, uint32(attempt+1))
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = ptr
	(*String)(unsafe.Pointer(stringPtr)).Fallocated = attempt
}

func sGrowUnicodeBuffer(tls *libc.TLS, objPtr uintptr, needed int32) { /* tclStringObj.c:183:1: */
	// Pre-conditions:
	//	objPtr->typePtr == &tclStringType
	//	needed > stringPtr->maxChars
	//	needed < STRING_MAXCHARS

	var ptr uintptr = uintptr(0)
	var stringPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	var attempt int32

	if (*String)(unsafe.Pointer(stringPtr)).FmaxChars > 0 {
		// Subsequent appends - apply the growth algorithm.

		if needed <= int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0))))/2 {
			attempt = 2 * needed
			ptr = XTclpRealloc(tls, stringPtr, uint32(uint64(int32(uintptr(0)+16))+uint64(attempt+1)*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))
		}
		if ptr == uintptr(0) {
			// Take care computing the amount of modest growth to avoid
			// overflow into invalid argument values for attempt.

			var limit uint32 = uint32(int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0)))) - needed)
			var extra uint32 = uint32(uint64(needed-(*String)(unsafe.Pointer(stringPtr)).FnumChars) +
				uint64(TCL_MIN_GROWTH)/uint64(unsafe.Sizeof(Tcl_UniChar(0))))
			var growth int32 = func() int32 {
				if extra > limit {
					return int32(limit)
				}
				return int32(extra)
			}()

			attempt = needed + growth
			ptr = XTclpRealloc(tls, stringPtr, uint32(uint64(int32(uintptr(0)+16))+uint64(attempt+1)*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))
		}
	}
	if ptr == uintptr(0) {
		// First allocation - just big enough; or last chance fallback.

		attempt = needed
		ptr = XTcl_Realloc(tls, stringPtr, uint32(uint64(int32(uintptr(0)+16))+uint64(attempt+1)*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))
	}
	stringPtr = ptr
	(*String)(unsafe.Pointer(stringPtr)).FmaxChars = attempt
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = stringPtr
}

//----------------------------------------------------------------------
//
// Tcl_NewStringObj --
//
//	This function is normally called when not debugging: i.e., when
//	TCL_MEM_DEBUG is not defined. It creates a new string object and
//	initializes it from the byte pointer and length arguments.
//
//	When TCL_MEM_DEBUG is defined, this function just returns the result
//	of calling the debugging version Tcl_DbNewStringObj.
//
// Results:
//	A newly created string object is returned that has ref count zero.
//
// Side effects:
//	The new object's internal string representation will be set to a copy
//	of the length bytes starting at "bytes". If "length" is negative, use
//	bytes up to the first NUL byte; i.e., assume "bytes" points to a
//	C-style NUL-terminated string. The object's type is set to NULL. An
//	extra NUL is added to the end of the new object's byte array.
//
//----------------------------------------------------------------------

func XTcl_NewStringObj(tls *libc.TLS, bytes uintptr, length int32) uintptr { /* tclStringObj.c:273:9: */
	var objPtr uintptr

	if length < 0 {
		length = func() int32 {
			if bytes != 0 {
				return int32(libc.Xstrlen(tls, bytes))
			}
			return 0
		}()
	}
	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				objPtr = XTclThreadAllocObj(tls)
			} else {
				objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
		if length == 0 {
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(length+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, bytes, uint64(length))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(length))) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = length
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		{
		}
	}
	return objPtr
}

//----------------------------------------------------------------------
//
// Tcl_DbNewStringObj --
//
//	This function is normally called when debugging: i.e., when
//	TCL_MEM_DEBUG is defined. It creates new string objects. It is the
//	same as the Tcl_NewStringObj function above except that it calls
//	Tcl_DbCkalloc directly with the file name and line number from its
//	caller. This simplifies debugging since then the [memory active]
//	command will report the correct file name and line number when
//	reporting objects that haven't been freed.
//
//	When TCL_MEM_DEBUG is not defined, this function just returns the
//	result of calling Tcl_NewStringObj.
//
// Results:
//	A newly created string object is returned that has ref count zero.
//
// Side effects:
//	The new object's internal string representation will be set to a copy
//	of the length bytes starting at "bytes". If "length" is negative, use
//	bytes up to the first NUL byte; i.e., assume "bytes" points to a
//	C-style NUL-terminated string. The object's type is set to NULL. An
//	extra NUL is added to the end of the new object's byte array.
//
//----------------------------------------------------------------------

func XTcl_DbNewStringObj(tls *libc.TLS, bytes uintptr, length int32, file uintptr, line int32) uintptr { /* tclStringObj.c:345:9: */
	return XTcl_NewStringObj(tls, bytes, length)
}

//---------------------------------------------------------------------------
//
// Tcl_NewUnicodeObj --
//
//	This function is creates a new String object and initializes it from
//	the given Unicode String. If the Utf String is the same size as the
//	Unicode string, don't duplicate the data.
//
// Results:
//	The newly created object is returned. This object will have no initial
//	string representation. The returned object has a ref count of 0.
//
// Side effects:
//	Memory allocated for new object and copy of Unicode argument.
//
//---------------------------------------------------------------------------

func XTcl_NewUnicodeObj(tls *libc.TLS, unicode uintptr, numChars int32) uintptr { /* tclStringObj.c:381:9: */
	var objPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	sSetUnicodeObj(tls, objPtr, unicode, numChars)
	return objPtr
}

//----------------------------------------------------------------------
//
// Tcl_GetCharLength --
//
//	Get the length of the Unicode string from the Tcl object.
//
// Results:
//	Pointer to unicode string representing the unicode object.
//
// Side effects:
//	Frees old internal rep. Allocates memory for new "String" internal
//	rep.
//
//----------------------------------------------------------------------

func XTcl_GetCharLength(tls *libc.TLS, objPtr uintptr) int32 { /* tclStringObj.c:413:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var stringPtr uintptr
	var numChars int32

	// Quick, no-shimmer return for short string reps.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength < 2 {
		// 0 bytes -> 0 chars; 1 byte -> 1 char
		return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
	}

	// Optimize the case where we're really dealing with a bytearray object;
	// we don't need to convert to a string to perform the get-length operation.
	//
	// NOTE that we do not need the bytearray to be "pure".  A ByteArray value
	// with a string rep cannot be trusted to represent the same value as the
	// string rep, but it *can* be trusted to have the same character length
	// as the string rep, which is all this routine cares about.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) {
		// var length int32 at bp, 4

		XTcl_GetByteArrayFromObj(tls, objPtr, bp)
		return *(*int32)(unsafe.Pointer(bp /* length */))
	}

	// OK, need to work with the object as a string.

	sSetStringFromAny(tls, uintptr(0), objPtr)
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	numChars = (*String)(unsafe.Pointer(stringPtr)).FnumChars

	// If numChars is unknown, compute it.

	if numChars == -1 {
		for ok := true; ok; ok = 0 != 0 {
			var _count int32
			var _i int32 = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
			var _str uintptr = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			for _i != 0 && int32(*(*uint8)(unsafe.Pointer(_str))) < 0xC0 {
				_i--
				_str++
			}
			_count = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength - _i
			if _i != 0 {
				_count = _count + XTcl_NumUtfChars(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes+uintptr(_count), _i)
			}
			numChars = _count
		}

		(*String)(unsafe.Pointer(stringPtr)).FnumChars = numChars

	}
	return numChars
}

//----------------------------------------------------------------------
//
// TclCheckEmptyString --
//
//	Determine whether the string value of an object is or would be the
//	empty string, without generating a string representation.
//
// Results:
//	Returns 1 if empty, 0 if not, and -1 if unknown.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------
func XTclCheckEmptyString(tls *libc.TLS, objPtr uintptr) int32 { /* tclStringObj.c:494:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	*(*int32)(unsafe.Pointer(bp /* length */)) = -1

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == XtclEmptyStringRep {
		return TCL_EMPTYSTRING_YES
	}

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		XTcl_ListObjLength(tls, uintptr(0), objPtr, bp)
		return libc.Bool32(*(*int32)(unsafe.Pointer(bp)) == 0)
	}

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) && (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) {
		XTcl_DictObjSize(tls, uintptr(0), objPtr, bp)
		return libc.Bool32(*(*int32)(unsafe.Pointer(bp)) == 0)
	}

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) {
		return TCL_EMPTYSTRING_UNKNOWN
	}
	return libc.Bool32((*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == 0)
}

//----------------------------------------------------------------------
//
// Tcl_GetUniChar/TclGetUCS4 --
//
//	Get the index'th Unicode character from the String object. If index
//	is out of range, the result = 0xFFFD (Tcl_GetUniChar) resp. -1 (TclGetUCS4)
//
// Results:
//	Returns the index'th Unicode character in the Object.
//
// Side effects:
//	Fills unichar with the index'th Unicode character.
//
//----------------------------------------------------------------------

func XTcl_GetUniChar(tls *libc.TLS, objPtr uintptr, index int32) Tcl_UniChar { /* tclStringObj.c:537:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var stringPtr uintptr
	// var length int32 at bp, 4

	if index < 0 {
		return Tcl_UniChar(0xFFFD)
	}

	// Optimize the case where we're really dealing with a bytearray object
	// we don't need to convert to a string to perform the indexing operation.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) {
		var bytes uintptr = XTcl_GetByteArrayFromObj(tls, objPtr, bp)
		if index >= *(*int32)(unsafe.Pointer(bp)) {
			return Tcl_UniChar(0xFFFD)
		}

		return Tcl_UniChar(*(*uint8)(unsafe.Pointer(bytes + uintptr(index))))
	}

	// OK, need to work with the object as a string.

	sSetStringFromAny(tls, uintptr(0), objPtr)
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if (*String)(unsafe.Pointer(stringPtr)).FhasUnicode == 0 {
		// If numChars is unknown, compute it.

		if (*String)(unsafe.Pointer(stringPtr)).FnumChars == -1 {
			for ok := true; ok; ok = 0 != 0 {
				var _count int32
				var _i int32 = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				var _str uintptr = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
				for _i != 0 && int32(*(*uint8)(unsafe.Pointer(_str))) < 0xC0 {
					_i--
					_str++
				}
				_count = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength - _i
				if _i != 0 {
					_count = _count + XTcl_NumUtfChars(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes+uintptr(_count), _i)
				}
				(*String)(unsafe.Pointer(stringPtr)).FnumChars = _count
			}

		}
		if (*String)(unsafe.Pointer(stringPtr)).FnumChars == (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength {
			return Tcl_UniChar(*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(index))))
		}
		sFillUnicodeRep(tls, objPtr)
		stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	}

	if index >= (*String)(unsafe.Pointer(stringPtr)).FnumChars {
		return Tcl_UniChar(0xFFFD)
	}
	return *(*Tcl_UniChar)(unsafe.Pointer(stringPtr + 16 + uintptr(index)*2))
}

//----------------------------------------------------------------------
//
// Tcl_GetUnicode --
//
//	Get the Unicode form of the String object. If the object is not
//	already a String object, it will be converted to one. If the String
//	object does not have a Unicode rep, then one is created from the UTF
//	string format.
//
// Results:
//	Returns a pointer to the object's internal Unicode string.
//
// Side effects:
//	Converts the object to have the String internal rep.
//
//----------------------------------------------------------------------

func XTcl_GetUnicode(tls *libc.TLS, objPtr uintptr) uintptr { /* tclStringObj.c:684:13: */
	return XTcl_GetUnicodeFromObj(tls, objPtr, uintptr(0))
}

//----------------------------------------------------------------------
//
// Tcl_GetUnicodeFromObj --
//
//	Get the Unicode form of the String object with length. If the object
//	is not already a String object, it will be converted to one. If the
//	String object does not have a Unicode rep, then one is create from the
//	UTF string format.
//
// Results:
//	Returns a pointer to the object's internal Unicode string.
//
// Side effects:
//	Converts the object to have the String internal rep.
//
//----------------------------------------------------------------------

func XTcl_GetUnicodeFromObj(tls *libc.TLS, objPtr uintptr, lengthPtr uintptr) uintptr { /* tclStringObj.c:711:13: */
	var stringPtr uintptr

	sSetStringFromAny(tls, uintptr(0), objPtr)
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if (*String)(unsafe.Pointer(stringPtr)).FhasUnicode == 0 {
		sFillUnicodeRep(tls, objPtr)
		stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	}

	if lengthPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(lengthPtr)) = (*String)(unsafe.Pointer(stringPtr)).FnumChars
	}
	return stringPtr + 16 /* &.unicode */
}

//----------------------------------------------------------------------
//
// Tcl_GetRange --
//
//	Create a Tcl Object that contains the chars between first and last of
//	the object indicated by "objPtr". If the object is not already a
//	String object, convert it to one. The first and last indices are
//	assumed to be in the appropriate range.
//
// Results:
//	Returns a new Tcl Object of the String type.
//
// Side effects:
//	Changes the internal rep of "objPtr" to the String type.
//
//----------------------------------------------------------------------

func XTcl_GetRange(tls *libc.TLS, objPtr uintptr, first int32, last int32) uintptr { /* tclStringObj.c:754:9: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var newObjPtr uintptr // The Tcl object to find the range of.
	var stringPtr uintptr
	// var length int32 at bp, 4

	if first < 0 {
		first = 0
	}

	// Optimize the case where we're really dealing with a bytearray object
	// we don't need to convert to a string to perform the substring operation.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) {
		var bytes uintptr = XTcl_GetByteArrayFromObj(tls, objPtr, bp)

		if last >= *(*int32)(unsafe.Pointer(bp)) {
			last = *(*int32)(unsafe.Pointer(bp)) - 1
		}
		if last < first {
			return XTcl_NewObj(tls)
		}
		return XTcl_NewByteArrayObj(tls, bytes+uintptr(first), last-first+1)
	}

	// OK, need to work with the object as a string.

	sSetStringFromAny(tls, uintptr(0), objPtr)
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if (*String)(unsafe.Pointer(stringPtr)).FhasUnicode == 0 {
		// If numChars is unknown, compute it.

		if (*String)(unsafe.Pointer(stringPtr)).FnumChars == -1 {
			for ok := true; ok; ok = 0 != 0 {
				var _count int32
				var _i int32 = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				var _str uintptr = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
				for _i != 0 && int32(*(*uint8)(unsafe.Pointer(_str))) < 0xC0 {
					_i--
					_str++
				}
				_count = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength - _i
				if _i != 0 {
					_count = _count + XTcl_NumUtfChars(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes+uintptr(_count), _i)
				}
				(*String)(unsafe.Pointer(stringPtr)).FnumChars = _count
			}

		}
		if (*String)(unsafe.Pointer(stringPtr)).FnumChars == (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength {
			if last >= (*String)(unsafe.Pointer(stringPtr)).FnumChars {
				last = (*String)(unsafe.Pointer(stringPtr)).FnumChars - 1
			}
			if last < first {
				return XTcl_NewObj(tls)
			}
			newObjPtr = XTcl_NewStringObj(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes+uintptr(first), last-first+1)

			// Since we know the char length of the result, store it.

			sSetStringFromAny(tls, uintptr(0), newObjPtr)
			stringPtr = *(*uintptr)(unsafe.Pointer(newObjPtr + 32))
			(*String)(unsafe.Pointer(stringPtr)).FnumChars = (*Tcl_Obj)(unsafe.Pointer(newObjPtr)).Flength
			return newObjPtr
		}
		sFillUnicodeRep(tls, objPtr)
		stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	}
	if last > (*String)(unsafe.Pointer(stringPtr)).FnumChars {
		last = (*String)(unsafe.Pointer(stringPtr)).FnumChars
	}
	if last < first {
		return XTcl_NewObj(tls)
	}
	return XTcl_NewUnicodeObj(tls, stringPtr+16+uintptr(first)*2, last-first+1)
}

//----------------------------------------------------------------------
//
// Tcl_SetStringObj --
//
//	Modify an object to hold a string that is a copy of the bytes
//	indicated by the byte pointer and length arguments.
//
// Results:
//	None.
//
// Side effects:
//	The object's string representation will be set to a copy of the
//	"length" bytes starting at "bytes". If "length" is negative, use bytes
//	up to the first NUL byte; i.e., assume "bytes" points to a C-style
//	NUL-terminated string. The object's old string and internal
//	representations are freed and the object's type is set NULL.
//
//----------------------------------------------------------------------

func XTcl_SetStringObj(tls *libc.TLS, objPtr uintptr, bytes uintptr, length int32) { /* tclStringObj.c:864:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+64646))
	}

	// Set the type to NULL and free any internal rep for the old type.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	}

	// Free any old string rep, then set the string rep to a copy of the
	// length bytes starting at "bytes".

	for ok := true; ok; ok = 0 != 0 {
		var _isobjPtr uintptr = objPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	if length < 0 {
		length = func() int32 {
			if bytes != 0 {
				return int32(libc.Xstrlen(tls, bytes))
			}
			return 0
		}()
	}
	if length == 0 {
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	} else {
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(length+1))
		libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, bytes, uint64(length))
		*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(length))) = int8(0)
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = length
	}

}

//----------------------------------------------------------------------
//
// Tcl_SetObjLength --
//
//	This function changes the length of the string representation of an
//	object.
//
// Results:
//	None.
//
// Side effects:
//	If the size of objPtr's string representation is greater than length,
//	then it is reduced to length and a new terminating null byte is stored
//	in the strength. If the length of the string representation is greater
//	than length, the storage space is reallocated to the given length; a
//	null byte is stored at the end, but other bytes past the end of the
//	original string representation are undefined. The object's internal
//	representation is changed to "expendable string".
//
//----------------------------------------------------------------------

func XTcl_SetObjLength(tls *libc.TLS, objPtr uintptr, length int32) { /* tclStringObj.c:918:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var stringPtr uintptr

	if length < 0 {
		// Setting to a negative length is nonsense. This is probably the
		// result of overflowing the signed integer range.

		XTcl_Panic(tls,
			ts+64663, libc.VaList(bp, length))
	}
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp+8, ts+64731))
	}

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == length {
		return
	}

	sSetStringFromAny(tls, uintptr(0), objPtr)
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != uintptr(0) {
		// Change length of an existing string rep.
		if length > (*String)(unsafe.Pointer(stringPtr)).Fallocated {
			// Need to enlarge the buffer.
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == XtclEmptyStringRep {
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(length+1))
			} else {
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Realloc(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, uint32(length+1))
			}
			(*String)(unsafe.Pointer(stringPtr)).Fallocated = length
		}

		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = length
		*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(length))) = int8(0)

		// Invalidate the unicode data.

		(*String)(unsafe.Pointer(stringPtr)).FnumChars = -1
		(*String)(unsafe.Pointer(stringPtr)).FhasUnicode = 0
	} else {
		// Changing length of pure unicode string.

		for ok := true; ok; ok = 0 != 0 {
			if length < 0 || length > int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0)))) {
				XTcl_Panic(tls, ts+64748, libc.VaList(bp+16, int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0))))))
			}
		}
		if length > (*String)(unsafe.Pointer(stringPtr)).FmaxChars {
			stringPtr = XTcl_Realloc(tls, stringPtr, uint32(uint64(int32(uintptr(0)+16))+uint64(length+1)*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))
			*(*uintptr)(unsafe.Pointer(objPtr + 32)) = stringPtr
			(*String)(unsafe.Pointer(stringPtr)).FmaxChars = length
		}

		// Mark the new end of the unicode string

		(*String)(unsafe.Pointer(stringPtr)).FnumChars = length
		*(*Tcl_UniChar)(unsafe.Pointer(stringPtr + 16 + uintptr(length)*2)) = Tcl_UniChar(0)
		(*String)(unsafe.Pointer(stringPtr)).FhasUnicode = 1

		// Can only get here when objPtr->bytes == NULL. No need to invalidate
		// the string rep.
	}
}

//----------------------------------------------------------------------
//
// Tcl_AttemptSetObjLength --
//
//	This function changes the length of the string representation of an
//	object. It uses the attempt* (non-panic'ing) memory allocators.
//
// Results:
//	1 if the requested memory was allocated, 0 otherwise.
//
// Side effects:
//	If the size of objPtr's string representation is greater than length,
//	then it is reduced to length and a new terminating null byte is stored
//	in the strength. If the length of the string representation is greater
//	than length, the storage space is reallocated to the given length; a
//	null byte is stored at the end, but other bytes past the end of the
//	original string representation are undefined. The object's internal
//	representation is changed to "expendable string".
//
//----------------------------------------------------------------------

func XTcl_AttemptSetObjLength(tls *libc.TLS, objPtr uintptr, length int32) int32 { /* tclStringObj.c:1023:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var stringPtr uintptr

	if length < 0 {
		// Setting to a negative length is nonsense. This is probably the
		// result of overflowing the signed integer range.

		return 0
	}
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+64803))
	}
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == length {
		return 1
	}

	sSetStringFromAny(tls, uintptr(0), objPtr)
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != uintptr(0) {
		// Change length of an existing string rep.
		if length > (*String)(unsafe.Pointer(stringPtr)).Fallocated {
			// Need to enlarge the buffer.

			var newBytes uintptr

			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == XtclEmptyStringRep {
				newBytes = XTclpAlloc(tls, uint32(length+1))
			} else {
				newBytes = XTclpRealloc(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, uint32(length+1))
			}
			if newBytes == uintptr(0) {
				return 0
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = newBytes
			(*String)(unsafe.Pointer(stringPtr)).Fallocated = length
		}

		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = length
		*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(length))) = int8(0)

		// Invalidate the unicode data.

		(*String)(unsafe.Pointer(stringPtr)).FnumChars = -1
		(*String)(unsafe.Pointer(stringPtr)).FhasUnicode = 0
	} else {
		// Changing length of pure unicode string.

		if length > int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0)))) {
			return 0
		}
		if length > (*String)(unsafe.Pointer(stringPtr)).FmaxChars {
			stringPtr = XTclpRealloc(tls, stringPtr, uint32(uint64(int32(uintptr(0)+16))+uint64(length+1)*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))
			if stringPtr == uintptr(0) {
				return 0
			}
			*(*uintptr)(unsafe.Pointer(objPtr + 32)) = stringPtr
			(*String)(unsafe.Pointer(stringPtr)).FmaxChars = length
		}

		// Mark the new end of the unicode string.

		*(*Tcl_UniChar)(unsafe.Pointer(stringPtr + 16 + uintptr(length)*2)) = Tcl_UniChar(0)
		(*String)(unsafe.Pointer(stringPtr)).FnumChars = length
		(*String)(unsafe.Pointer(stringPtr)).FhasUnicode = 1

		// Can only get here when objPtr->bytes == NULL. No need to invalidate
		// the string rep.
	}
	return 1
}

//---------------------------------------------------------------------------
//
// Tcl_SetUnicodeObj --
//
//	Modify an object to hold the Unicode string indicated by "unicode".
//
// Results:
//	None.
//
// Side effects:
//	Memory allocated for new "String" internal rep.
//
//---------------------------------------------------------------------------

func XTcl_SetUnicodeObj(tls *libc.TLS, objPtr uintptr, unicode uintptr, numChars int32) { /* tclStringObj.c:1132:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+64827))
	}
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
		if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	}

	sSetUnicodeObj(tls, objPtr, unicode, numChars)
}

func sUnicodeLength(tls *libc.TLS, unicode uintptr) int32 { /* tclStringObj.c:1147:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var numChars int32 = 0

	if unicode != 0 {
		for numChars >= 0 && int32(*(*Tcl_UniChar)(unsafe.Pointer(unicode + uintptr(numChars)*2))) != 0 {
			numChars++
		}
	}
	for ok := true; ok; ok = 0 != 0 {
		if numChars < 0 || numChars > int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0)))) {
			XTcl_Panic(tls, ts+64748, libc.VaList(bp, int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0))))))
		}
	}
	return numChars
}

func sSetUnicodeObj(tls *libc.TLS, objPtr uintptr, unicode uintptr, numChars int32) { /* tclStringObj.c:1162:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var stringPtr uintptr

	if numChars < 0 {
		numChars = sUnicodeLength(tls, unicode)
	}

	// Allocate enough space for the String structure + Unicode string.

	for ok := true; ok; ok = 0 != 0 {
		if numChars < 0 || numChars > int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0)))) {
			XTcl_Panic(tls, ts+64748, libc.VaList(bp, int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0))))))
		}
	}
	stringPtr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+16))+uint64(numChars+1)*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = stringPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclStringType))

	(*String)(unsafe.Pointer(stringPtr)).FmaxChars = numChars
	libc.Xmemcpy(tls, stringPtr+16, unicode, uint64(numChars)*uint64(unsafe.Sizeof(Tcl_UniChar(0))))
	*(*Tcl_UniChar)(unsafe.Pointer(stringPtr + 16 + uintptr(numChars)*2)) = Tcl_UniChar(0)
	(*String)(unsafe.Pointer(stringPtr)).FnumChars = numChars
	(*String)(unsafe.Pointer(stringPtr)).FhasUnicode = 1

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _isobjPtr uintptr = objPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	(*String)(unsafe.Pointer(stringPtr)).Fallocated = 0
}

//----------------------------------------------------------------------
//
// Tcl_AppendLimitedToObj --
//
//	This function appends a limited number of bytes from a sequence of
//	bytes to an object, marking any limitation with an ellipsis.
//
// Results:
//	None.
//
// Side effects:
//	The bytes at *bytes are appended to the string representation of
//	objPtr.
//
//----------------------------------------------------------------------

func XTcl_AppendLimitedToObj(tls *libc.TLS, objPtr uintptr, bytes uintptr, length int32, limit int32, ellipsis uintptr) { /* tclStringObj.c:1213:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var stringPtr uintptr
	var toCopy int32 = 0
	var eLen int32 = 0

	if length < 0 {
		length = func() int32 {
			if bytes != 0 {
				return int32(libc.Xstrlen(tls, bytes))
			}
			return 0
		}()
	}
	if length == 0 {
		return
	}
	if limit <= 0 {
		return
	}

	if length <= limit {
		toCopy = length
	} else {
		if ellipsis == uintptr(0) {
			ellipsis = ts + 7891 /* "..." */
		}
		eLen = int32(libc.Xstrlen(tls, ellipsis))
		for eLen > limit {
			eLen = int32((func() int64 {
				if ellipsis+uintptr(eLen) < ellipsis+uintptr(2) {
					return int64(ellipsis)
				}
				return func() int64 {
					if int32(uint8(*(*int8)(unsafe.Pointer(ellipsis + uintptr(eLen) - uintptr(1))))) < 0x80 {
						return int64(ellipsis + uintptr(eLen) - uintptr(1))
					}
					return int64(XTcl_UtfPrev(tls, ellipsis+uintptr(eLen), ellipsis))
				}()
			}() - int64(ellipsis)) / 1)
		}

		toCopy = int32((func() int64 {
			if bytes+uintptr(limit)+uintptr(1)-uintptr(eLen) < bytes+uintptr(2) {
				return int64(bytes)
			}
			return func() int64 {
				if int32(uint8(*(*int8)(unsafe.Pointer(bytes + uintptr(limit) + uintptr(1) - uintptr(eLen) - uintptr(1))))) < 0x80 {
					return int64(bytes + uintptr(limit) + uintptr(1) - uintptr(eLen) - uintptr(1))
				}
				return int64(XTcl_UtfPrev(tls, bytes+uintptr(limit)+uintptr(1)-uintptr(eLen), bytes))
			}()
		}() - int64(bytes)) / 1)
	}

	// If objPtr has a valid Unicode rep, then append the Unicode conversion
	// of "bytes" to the objPtr's Unicode rep, otherwise append "bytes" to
	// objPtr's string rep.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+64845))
	}

	sSetStringFromAny(tls, uintptr(0), objPtr)
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if (*String)(unsafe.Pointer(stringPtr)).FhasUnicode != 0 && (*String)(unsafe.Pointer(stringPtr)).FnumChars > 0 {
		sAppendUtfToUnicodeRep(tls, objPtr, bytes, toCopy)
	} else {
		sAppendUtfToUtfRep(tls, objPtr, bytes, toCopy)
	}

	if length <= limit {
		return
	}

	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	if (*String)(unsafe.Pointer(stringPtr)).FhasUnicode != 0 && (*String)(unsafe.Pointer(stringPtr)).FnumChars > 0 {
		sAppendUtfToUnicodeRep(tls, objPtr, ellipsis, eLen)
	} else {
		sAppendUtfToUtfRep(tls, objPtr, ellipsis, eLen)
	}
}

//----------------------------------------------------------------------
//
// Tcl_AppendToObj --
//
//	This function appends a sequence of bytes to an object.
//
// Results:
//	None.
//
// Side effects:
//	The bytes at *bytes are appended to the string representation of
//	objPtr.
//
//----------------------------------------------------------------------

func XTcl_AppendToObj(tls *libc.TLS, objPtr uintptr, bytes uintptr, length int32) { /* tclStringObj.c:1303:1: */
	XTcl_AppendLimitedToObj(tls, objPtr, bytes, length, 0x7fffffff, uintptr(0))
}

//----------------------------------------------------------------------
//
// Tcl_AppendUnicodeToObj --
//
//	This function appends a Unicode string to an object in the most
//	efficient manner possible. Length must be >= 0.
//
// Results:
//	None.
//
// Side effects:
//	Invalidates the string rep and creates a new Unicode string.
//
//----------------------------------------------------------------------

func XTcl_AppendUnicodeToObj(tls *libc.TLS, objPtr uintptr, unicode uintptr, length int32) { /* tclStringObj.c:1332:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var stringPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+64868))
	}

	if length == 0 {
		return
	}

	sSetStringFromAny(tls, uintptr(0), objPtr)
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	// If objPtr has a valid Unicode rep, then append the "unicode" to the
	// objPtr's Unicode rep, otherwise the UTF conversion of "unicode" to
	// objPtr's string rep.

	if (*String)(unsafe.Pointer(stringPtr)).FhasUnicode != 0 {
		sAppendUnicodeToUnicodeRep(tls, objPtr, unicode, length)
	} else {
		sAppendUnicodeToUtfRep(tls, objPtr, unicode, length)
	}
}

//----------------------------------------------------------------------
//
// Tcl_AppendObjToObj --
//
//	This function appends the string rep of one object to another.
//	"objPtr" cannot be a shared object.
//
// Results:
//	None.
//
// Side effects:
//	The string rep of appendObjPtr is appended to the string
//	representation of objPtr.
//	IMPORTANT: This routine does not and MUST NOT shimmer appendObjPtr.
//	Callers are counting on that.
//
//----------------------------------------------------------------------

func XTcl_AppendObjToObj(tls *libc.TLS, objPtr uintptr, appendObjPtr uintptr) { /* tclStringObj.c:1389:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var stringPtr uintptr
	// var length int32 at bp, 4

	// var numChars int32 at bp+8, 4

	var appendNumChars int32 = -1
	var bytes uintptr

	// Special case: second object is standard-empty is fast case. We know
	// that appending nothing to anything leaves that starting anything...

	if (*Tcl_Obj)(unsafe.Pointer(appendObjPtr)).Fbytes == XtclEmptyStringRep {
		return
	}

	// Handle append of one bytearray object to another as a special case.
	// Note that we only do this when the objects don't have string reps; if
	// it did, then appending the byte arrays together could well lose
	// information; this is a special-case optimization only.

	if ((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) || (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == XtclEmptyStringRep) &&
		((*Tcl_Obj)(unsafe.Pointer(appendObjPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(appendObjPtr)).Fbytes == uintptr(0)) {
		// You might expect the code here to be
		//
		//  bytes = Tcl_GetByteArrayFromObj(appendObjPtr, &length);
		//  TclAppendBytesToByteArray(objPtr, bytes, length);
		//
		// and essentially all of the time that would be fine. However, it
		// would run into trouble in the case where objPtr and appendObjPtr
		// point to the same thing. That may never be a good idea. It seems to
		// violate Copy On Write, and we don't have any tests for the
		// situation, since making any Tcl commands that call
		// Tcl_AppendObjToObj() do that appears impossible (They honor Copy On
		// Write!). For the sake of extensions that go off into that realm,
		// though, here's a more complex approach that can handle all the
		// cases.
		//
		// First, get the lengths.

		// var lengthSrc int32 at bp+4, 4

		XTcl_GetByteArrayFromObj(tls, objPtr, bp)
		XTcl_GetByteArrayFromObj(tls, appendObjPtr, bp+4)

		// Grow buffer enough for the append.

		XTclAppendBytesToByteArray(tls, objPtr, uintptr(0), *(*int32)(unsafe.Pointer(bp + 4 /* lengthSrc */)))

		// Reset objPtr back to the original value.

		XTcl_SetByteArrayLength(tls, objPtr, *(*int32)(unsafe.Pointer(bp /* length */)))

		// Now do the append knowing that buffer growth cannot cause any
		// trouble.

		XTclAppendBytesToByteArray(tls, objPtr,
			XTcl_GetByteArrayFromObj(tls, appendObjPtr, uintptr(0)), *(*int32)(unsafe.Pointer(bp + 4 /* lengthSrc */)))
		return
	}

	// Must append as strings.

	sSetStringFromAny(tls, uintptr(0), objPtr)
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	// If objPtr has a valid Unicode rep, then get a Unicode string from
	// appendObjPtr and append it.

	if (*String)(unsafe.Pointer(stringPtr)).FhasUnicode != 0 {
		// If appendObjPtr is not of the "String" type, don't convert it.

		if (*Tcl_Obj)(unsafe.Pointer(appendObjPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclStringType)) {
			var unicode uintptr = XTcl_GetUnicodeFromObj(tls, appendObjPtr, bp+8)

			sAppendUnicodeToUnicodeRep(tls, objPtr, unicode, *(*int32)(unsafe.Pointer(bp + 8 /* numChars */)))
		} else {
			bytes = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(appendObjPtr)).Fbytes != 0 {
					return func() uintptr {
						*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(appendObjPtr)).Flength
						return (*Tcl_Obj)(unsafe.Pointer(appendObjPtr)).Fbytes
					}()
				}
				return XTcl_GetStringFromObj(tls, appendObjPtr, bp)
			}()
			sAppendUtfToUnicodeRep(tls, objPtr, bytes, *(*int32)(unsafe.Pointer(bp /* length */)))
		}
		return
	}

	// Append to objPtr's UTF string rep. If we know the number of characters
	// in both objects before appending, then set the combined number of
	// characters in the final (appended-to) object.

	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(appendObjPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(appendObjPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(appendObjPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, appendObjPtr, bp)
	}()

	*(*int32)(unsafe.Pointer(bp + 8 /* numChars */)) = (*String)(unsafe.Pointer(stringPtr)).FnumChars
	if *(*int32)(unsafe.Pointer(bp + 8)) >= 0 && (*Tcl_Obj)(unsafe.Pointer(appendObjPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclStringType)) {
		var appendStringPtr uintptr = *(*uintptr)(unsafe.Pointer(appendObjPtr + 32))

		appendNumChars = (*String)(unsafe.Pointer(appendStringPtr)).FnumChars
	}

	sAppendUtfToUtfRep(tls, objPtr, bytes, *(*int32)(unsafe.Pointer(bp /* length */)))

	if *(*int32)(unsafe.Pointer(bp + 8)) >= 0 && appendNumChars >= 0 {
		(*String)(unsafe.Pointer(stringPtr)).FnumChars = *(*int32)(unsafe.Pointer(bp + 8)) + appendNumChars
	}
}

//----------------------------------------------------------------------
//
// AppendUnicodeToUnicodeRep --
//
//	This function appends the contents of "unicode" to the Unicode rep of
//	"objPtr". objPtr must already have a valid Unicode rep.
//
// Results:
//	None.
//
// Side effects:
//	objPtr's internal rep is reallocated.
//
//----------------------------------------------------------------------

func sAppendUnicodeToUnicodeRep(tls *libc.TLS, objPtr uintptr, unicode uintptr, appendNumChars int32) { /* tclStringObj.c:1538:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var stringPtr uintptr
	var numChars int32

	if appendNumChars < 0 {
		appendNumChars = sUnicodeLength(tls, unicode)
	}
	if appendNumChars == 0 {
		return
	}

	sSetStringFromAny(tls, uintptr(0), objPtr)
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	// If not enough space has been allocated for the unicode rep, reallocate
	// the internal rep object with additional space. First try to double the
	// required allocation; if that fails, try a more modest increase. See the
	// "TCL STRING GROWTH ALGORITHM" comment at the top of this file for an
	// explanation of this growth algorithm.

	numChars = (*String)(unsafe.Pointer(stringPtr)).FnumChars + appendNumChars
	for ok := true; ok; ok = 0 != 0 {
		if numChars < 0 || numChars > int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0)))) {
			XTcl_Panic(tls, ts+64748, libc.VaList(bp, int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0))))))
		}
	}

	if numChars > (*String)(unsafe.Pointer(stringPtr)).FmaxChars {
		var offset int32 = -1

		// Protect against case where unicode points into the existing
		// stringPtr->unicode array. Force it to follow any relocations due to
		// the reallocs below.

		if unicode != 0 && unicode >= stringPtr+16 &&
			unicode <= stringPtr+16+uintptr((*String)(unsafe.Pointer(stringPtr)).FmaxChars)*2 {
			offset = int32(int64((unicode - (stringPtr + 16)) / 2))
		}

		sGrowUnicodeBuffer(tls, objPtr, numChars)
		stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

		// Relocate unicode if needed; see above.

		if offset >= 0 {
			unicode = stringPtr + 16 + uintptr(offset)*2
		}
	}

	// Copy the new string onto the end of the old string, then add the
	// trailing null.

	if unicode != 0 {
		libc.Xmemmove(tls, stringPtr+16+uintptr((*String)(unsafe.Pointer(stringPtr)).FnumChars)*2, unicode,
			uint64(appendNumChars)*uint64(unsafe.Sizeof(Tcl_UniChar(0))))
	}
	*(*Tcl_UniChar)(unsafe.Pointer(stringPtr + 16 + uintptr(numChars)*2)) = Tcl_UniChar(0)
	(*String)(unsafe.Pointer(stringPtr)).FnumChars = numChars
	(*String)(unsafe.Pointer(stringPtr)).Fallocated = 0

	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _isobjPtr uintptr = objPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
}

//----------------------------------------------------------------------
//
// AppendUnicodeToUtfRep --
//
//	This function converts the contents of "unicode" to UTF and appends
//	the UTF to the string rep of "objPtr".
//
// Results:
//	None.
//
// Side effects:
//	objPtr's internal rep is reallocated.
//
//----------------------------------------------------------------------

func sAppendUnicodeToUtfRep(tls *libc.TLS, objPtr uintptr, unicode uintptr, numChars int32) { /* tclStringObj.c:1627:1: */
	var stringPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	numChars = sExtendStringRepWithUnicode(tls, objPtr, unicode, numChars)

	if (*String)(unsafe.Pointer(stringPtr)).FnumChars != -1 {
		*(*int32)(unsafe.Pointer(stringPtr)) += numChars
	}

}

//----------------------------------------------------------------------
//
// AppendUtfToUnicodeRep --
//
//	This function converts the contents of "bytes" to Unicode and appends
//	the Unicode to the Unicode rep of "objPtr". objPtr must already have a
//	valid Unicode rep. numBytes must be non-negative.
//
// Results:
//	None.
//
// Side effects:
//	objPtr's internal rep is reallocated.
//
//----------------------------------------------------------------------

func sAppendUtfToUnicodeRep(tls *libc.TLS, objPtr uintptr, bytes uintptr, numBytes int32) { /* tclStringObj.c:1668:1: */
	var stringPtr uintptr

	if numBytes == 0 {
		return
	}

	sExtendUnicodeRepWithString(tls, objPtr, bytes, numBytes, -1)
	for ok := true; ok; ok = 0 != 0 {
		var _isobjPtr uintptr = objPtr
		if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(0) {
			if (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = uintptr(0)
		}
	}
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*String)(unsafe.Pointer(stringPtr)).Fallocated = 0
}

//----------------------------------------------------------------------
//
// AppendUtfToUtfRep --
//
//	This function appends "numBytes" bytes of "bytes" to the UTF string
//	rep of "objPtr". objPtr must already have a valid String rep.
//	numBytes must be non-negative.
//
// Results:
//	None.
//
// Side effects:
//	objPtr's internal rep is reallocated.
//
//----------------------------------------------------------------------

func sAppendUtfToUtfRep(tls *libc.TLS, objPtr uintptr, bytes uintptr, numBytes int32) { /* tclStringObj.c:1704:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var stringPtr uintptr
	var newLength int32
	var oldLength int32

	if numBytes == 0 {
		return
	}

	// Copy the new string onto the end of the old string, then add the
	// trailing null.

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	}
	oldLength = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
	newLength = numBytes + oldLength
	if newLength < 0 {
		XTcl_Panic(tls, ts+9405, libc.VaList(bp, 0x7fffffff))
	}

	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	if newLength > (*String)(unsafe.Pointer(stringPtr)).Fallocated {
		var offset int32 = -1

		// Protect against case where unicode points into the existing
		// stringPtr->unicode array. Force it to follow any relocations due to
		// the reallocs below.

		if bytes != 0 && bytes >= (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes &&
			bytes <= (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes+uintptr((*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength) {
			offset = int32((int64(bytes) - int64((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)) / 1)
		}

		// TODO: consider passing flag=1: no overalloc on first append. This
		// would make test stringObj-8.1 fail.

		sGrowStringBuffer(tls, objPtr, newLength, 0)

		// Relocate bytes if needed; see above.

		if offset >= 0 {
			bytes = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(offset)
		}
	}

	// Invalidate the unicode data.

	(*String)(unsafe.Pointer(stringPtr)).FnumChars = -1
	(*String)(unsafe.Pointer(stringPtr)).FhasUnicode = 0

	if bytes != 0 {
		libc.Xmemmove(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes+uintptr(oldLength), bytes, uint64(numBytes))
	}
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(newLength))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = newLength
}

//----------------------------------------------------------------------
//
// Tcl_AppendStringsToObjVA --
//
//	This function appends one or more null-terminated strings to an
//	object.
//
// Results:
//	None.
//
// Side effects:
//	The contents of all the string arguments are appended to the string
//	representation of objPtr.
//
//----------------------------------------------------------------------

func XTcl_AppendStringsToObjVA(tls *libc.TLS, objPtr uintptr, argList Va_list) { /* tclStringObj.c:1794:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
		XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+64891))
	}

	for 1 != 0 {
		var bytes uintptr = libc.VaUintptr(&argList)

		if bytes == uintptr(0) {
			break
		}
		XTcl_AppendToObj(tls, objPtr, bytes, -1)
	}
}

//----------------------------------------------------------------------
//
// Tcl_AppendStringsToObj --
//
//	This function appends one or more null-terminated strings to an
//	object.
//
// Results:
//	None.
//
// Side effects:
//	The contents of all the string arguments are appended to the string
//	representation of objPtr.
//
//----------------------------------------------------------------------

func XTcl_AppendStringsToObj(tls *libc.TLS, objPtr uintptr, va uintptr) { /* tclStringObj.c:1831:1: */
	var argList Va_list
	_ = argList

	argList = va
	XTcl_AppendStringsToObjVA(tls, objPtr, argList)
	_ = argList
}

//----------------------------------------------------------------------
//
// Tcl_AppendFormatToObj --
//
//	This function appends a list of Tcl_Obj's to a Tcl_Obj according to
//	the formatting instructions embedded in the format string. The
//	formatting instructions are inspired by sprintf(). Returns TCL_OK when
//	successful. If there's an error in the arguments, TCL_ERROR is
//	returned, and an error message is written to the interp, if non-NULL.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_AppendFormatToObj(tls *libc.TLS, interp uintptr, appendObj uintptr, format uintptr, objc int32, objv uintptr) int32 { /* tclStringObj.c:1863:1: */
	bp := tls.Alloc(252)
	defer tls.Free(252)

	var span uintptr
	var msg uintptr
	var errCode uintptr
	var numBytes int32
	var objIndex int32
	var gotXpg int32
	var gotSequential int32
	// var originalLength int32 at bp+104, 4

	var limit int32
	// var ch Tcl_UniChar at bp+108, 2

	var position int32
	// var buf [4]int8 at bp+132, 4

	// var code int32 at bp+128, 4

	var length int32
	var _objPtr uintptr
	var objPtr uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr
	var _objPtr1 uintptr
	// var length1 int32 at bp+176, 4

	var pure uintptr
	var bytes uintptr
	var us uint16
	var leftover int32
	var mask Mp_digit
	var ul uint64
	var cachePtr2 uintptr
	var digitOffset int32
	var _objPtr2 uintptr
	var bits Tcl_WideUInt
	var numDigits Tcl_WideInt
	var length2 int32
	var numBits int32
	var base int32
	var index int32
	var shift int32
	var pure1 uintptr
	var bytes1 uintptr
	var s int16 // Silence compiler warning; only defined and
	// used when useShort is true.
	// var l int64 at bp+160, 8

	// var w Tcl_WideInt at bp+168, 8

	// var big Mp_int at bp+136, 24

	var toAppend int32
	var isNegative int32
	var cachePtr3 uintptr
	// var spec [57]int8 at bp+180, 57

	var p uintptr
	// var d float64 at bp+240, 8

	var length3 int32
	var bytes2 uintptr
	var _objPtr3 uintptr
	var _objPtr4 uintptr
	// var end uintptr at bp+112, 8

	var gotMinus int32
	var gotHash int32
	var gotZero int32
	var gotSpace int32
	var gotPlus int32
	// var width int32 at bp+120, 4

	var gotPrecision int32
	// var precision int32 at bp+124, 4

	var sawFlag int32
	var useShort int32
	var useBig int32
	var newXpg int32
	var numChars int32
	var allocSegment int32
	var segmentLimit int32
	// var segmentNumBytes int32 at bp+248, 4

	var segment uintptr
	var step int32
	span = format
	numBytes = 0
	objIndex = 0
	gotXpg = 0
	gotSequential = 0
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 108 /* ch */)) = Tcl_UniChar(0)

	if !((*Tcl_Obj)(unsafe.Pointer(appendObj)).FrefCount > 1) {
		goto __1
	}
	XTcl_Panic(tls, ts+9333, libc.VaList(bp, ts+64914))
__1:
	;
	if (*Tcl_Obj)(unsafe.Pointer(appendObj)).Fbytes != 0 {
		*(*int32)(unsafe.Pointer(bp + 104)) = (*Tcl_Obj)(unsafe.Pointer(appendObj)).Flength
		_ = (*Tcl_Obj)(unsafe.Pointer(appendObj)).Fbytes
	} else {
		XTcl_GetStringFromObj(tls, appendObj, bp+104)
	}
	limit = 0x7fffffff - *(*int32)(unsafe.Pointer(bp + 104))

	// Format string is NUL-terminated.

__2:
	if !(int32(*(*int8)(unsafe.Pointer(format))) != 0) {
		goto __3
	}
	gotMinus = 0
	gotHash = 0
	gotZero = 0
	gotSpace = 0
	gotPlus = 0
	useShort = 0
	useBig = 0
	allocSegment = 0
	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()

	format += uintptr(step)
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) != '%') {
		goto __4
	}
	numBytes = numBytes + step
	goto __2
__4:
	;
	if !(numBytes != 0) {
		goto __5
	}
	if !(numBytes > limit) {
		goto __6
	}
	msg = overflow
	errCode = ts + 29643 /* "OVERFLOW" */
	goto errorMsg
__6:
	;
	XTcl_AppendToObj(tls, appendObj, span, numBytes)
	limit = limit - numBytes
	numBytes = 0
__5:
	;

	// Saw a % : process the format specifier.
	//
	// Step 0. Handle special case of escaped format marker (i.e., %%).

	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == '%') {
		goto __7
	}
	span = format
	numBytes = step
	format += uintptr(step)
	goto __2
__7:
	;

	// Step 1. XPG3 position specifier

	newXpg = 0
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)))))*2)))&int32(X_ISdigit) != 0) {
		goto __8
	}
	position = int32(libc.Xstrtoul(tls, format, bp+112, 10))

	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112))))) == '$') {
		goto __9
	}
	newXpg = 1
	objIndex = position - 1
	format = *(*uintptr)(unsafe.Pointer(bp + 112)) + uintptr(1)
	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()
__9:
	;
__8:
	;
	if !(newXpg != 0) {
		goto __10
	}
	if !(gotSequential != 0) {
		goto __12
	}
	msg = mixedXPG
	errCode = ts + 63681 /* "MIXEDSPECTYPES" */
	goto errorMsg
__12:
	;
	gotXpg = 1
	goto __11
__10:
	if !(gotXpg != 0) {
		goto __13
	}
	msg = mixedXPG
	errCode = ts + 63681 /* "MIXEDSPECTYPES" */
	goto errorMsg
__13:
	;
	gotSequential = 1
__11:
	;
	if !(objIndex < 0 || objIndex >= objc) {
		goto __14
	}
	msg = badIndex[gotXpg]
	if gotXpg != 0 {
		errCode = ts + 64117 /* "INDEXRANGE" */
	} else {
		errCode = ts + 64185 /* "FIELDVARMISMATCH" */
	}
	goto errorMsg
__14:
	;

	// Step 2. Set of flags.

	sawFlag = 1
__15:
	switch int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108 /* ch */))) {
	case '-':
		goto __19
	case '#':
		goto __20
	case '0':
		goto __21
	case ' ':
		goto __22
	case '+':
		goto __23
	default:
		goto __24
	}
	goto __18
__19:
	gotMinus = 1
	goto __18
__20:
	gotHash = 1
	goto __18
__21:
	gotZero = 1
	goto __18
__22:
	gotSpace = 1
	goto __18
__23:
	gotPlus = 1
	goto __18
__24:
	sawFlag = 0
__18:
	;
	if !(sawFlag != 0) {
		goto __25
	}
	format += uintptr(step)
	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()
__25:
	;
	goto __16
__16:
	if sawFlag != 0 {
		goto __15
	}
	goto __17
__17:
	;

	// Step 3. Minimum field width.

	*(*int32)(unsafe.Pointer(bp + 120 /* width */)) = 0
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)))))*2)))&int32(X_ISdigit) != 0) {
		goto __26
	}
	*(*int32)(unsafe.Pointer(bp + 120 /* width */)) = int32(libc.Xstrtoul(tls, format, bp+112, 10))
	if !(*(*int32)(unsafe.Pointer(bp + 120)) < 0) {
		goto __28
	}
	msg = overflow
	errCode = ts + 29643 /* "OVERFLOW" */
	goto errorMsg
__28:
	;
	format = *(*uintptr)(unsafe.Pointer(bp + 112 /* end */))
	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()
	goto __27
__26:
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == '*') {
		goto __29
	}
	if !(objIndex >= objc-1) {
		goto __30
	}
	msg = badIndex[gotXpg]
	if gotXpg != 0 {
		errCode = ts + 64117 /* "INDEXRANGE" */
	} else {
		errCode = ts + 64185 /* "FIELDVARMISMATCH" */
	}
	goto errorMsg
__30:
	;
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objIndex)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objIndex)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objIndex)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 120)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objIndex)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objIndex)*8)), bp+120)
	}() != TCL_OK) {
		goto __31
	}
	goto error
__31:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 120)) < 0) {
		goto __32
	}
	*(*int32)(unsafe.Pointer(bp + 120 /* width */)) = -*(*int32)(unsafe.Pointer(bp + 120 /* width */))
	gotMinus = 1
__32:
	;
	objIndex++
	format += uintptr(step)
	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()
__29:
	;
__27:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 120)) > limit) {
		goto __33
	}
	msg = overflow
	errCode = ts + 29643 /* "OVERFLOW" */
	goto errorMsg
__33:
	;

	// Step 4. Precision.

	gotPrecision = libc.AssignPtrInt32(bp+124 /* precision */, 0)
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == '.') {
		goto __34
	}
	gotPrecision = 1
	format += uintptr(step)
	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()
__34:
	;
	if !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)))))*2)))&int32(X_ISdigit) != 0) {
		goto __35
	}
	*(*int32)(unsafe.Pointer(bp + 124 /* precision */)) = int32(libc.Xstrtoul(tls, format, bp+112, 10))
	format = *(*uintptr)(unsafe.Pointer(bp + 112 /* end */))
	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()
	goto __36
__35:
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == '*') {
		goto __37
	}
	if !(objIndex >= objc-1) {
		goto __38
	}
	msg = badIndex[gotXpg]
	if gotXpg != 0 {
		errCode = ts + 64117 /* "INDEXRANGE" */
	} else {
		errCode = ts + 64185 /* "FIELDVARMISMATCH" */
	}
	goto errorMsg
__38:
	;
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objIndex)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objIndex)*8)) + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objIndex)*8)) + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 124)) = int32(*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objIndex)*8)) + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objIndex)*8)), bp+124)
	}() !=
		TCL_OK) {
		goto __39
	}
	goto error
__39:
	;

	// TODO: Check this truncation logic.

	if !(*(*int32)(unsafe.Pointer(bp + 124)) < 0) {
		goto __40
	}
	*(*int32)(unsafe.Pointer(bp + 124 /* precision */)) = 0
__40:
	;
	objIndex++
	format += uintptr(step)
	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()
__37:
	;
__36:
	;

	// Step 5. Length modifier.

	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == 'h') {
		goto __41
	}
	useShort = 1
	format += uintptr(step)
	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()
	goto __42
__41:
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == 'l') {
		goto __43
	}
	format += uintptr(step)
	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == 'l') {
		goto __44
	}
	useBig = 1
	format += uintptr(step)
	step = func() int32 {
		if int32(uint8(*(*int8)(unsafe.Pointer(format)))) < 0x80 {
			return func() int32 {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 108)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(format))))
				return 1
			}()
		}
		return XTcl_UtfToUniChar(tls, format, bp+108)
	}()
__44:
	;
__43:
	;
__42:
	;

	format += uintptr(step)
	span = format

	// Step 6. The actual conversion character.

	segment = *(*uintptr)(unsafe.Pointer(objv + uintptr(objIndex)*8))
	numChars = -1
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == 'i') {
		goto __45
	}
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 108 /* ch */)) = Tcl_UniChar('d')
__45:
	;
	switch int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108 /* ch */))) {
	case 0:
		goto __47
	case 's':
		goto __48
	case 'c':
		goto __49

	case 'u':
		goto __50
		// FALLTHRU
	case 'd':
		goto __51
	case 'o':
		goto __52
	case 'x':
		goto __53
	case 'X':
		goto __54
	case 'b':
		goto __55

	case 'e':
		goto __56
	case 'E':
		goto __57
	case 'f':
		goto __58
	case 'g':
		goto __59
	case 'G':
		goto __60
	default:
		goto __61
	}
	goto __46
__47:
	msg = ts + 64936     /* "format string en..." */
	errCode = ts + 64985 /* "INCOMPLETE" */
	goto errorMsg
__48:
	if !(gotPrecision != 0) {
		goto __62
	}
	numChars = XTcl_GetCharLength(tls, segment)
	if !(*(*int32)(unsafe.Pointer(bp + 124)) < numChars) {
		goto __63
	}
	segment = XTcl_GetRange(tls, segment, 0, *(*int32)(unsafe.Pointer(bp + 124))-1)
	numChars = *(*int32)(unsafe.Pointer(bp + 124 /* precision */))
	(*Tcl_Obj)(unsafe.Pointer(segment)).FrefCount++
	allocSegment = 1
__63:
	;
__62:
	;
	goto __46
__49:
	*(*[4]int8)(unsafe.Pointer(bp + 132 /* buf */)) = *(*[4]int8)(unsafe.Pointer(ts + 63623))

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(segment)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(segment + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(segment + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp + 128)) = int32(*(*int64)(unsafe.Pointer(segment + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, interp, segment, bp+128)
	}() != TCL_OK) {
		goto __64
	}
	goto error
__64:
	;
	length = XTcl_UniCharToUtf(tls, *(*int32)(unsafe.Pointer(bp + 128 /* code */)), bp+132)
	segment = XTcl_NewStringObj(tls, bp+132, length)
	(*Tcl_Obj)(unsafe.Pointer(segment)).FrefCount++
	allocSegment = 1
	goto __46

__50:
	if !(useBig != 0) {
		goto __65
	}
	msg = ts + 64996     /* "unsigned bignum ..." */
	errCode = ts + 63855 /* "BADUNSIGNED" */
	goto errorMsg
__65:
	;
	// FALLTHRU
__51:
__52:
__53:
__54:
__55:
	s = int16(0)
	isNegative = 0

	if !(useBig != 0) {
		goto __66
	}
	if !(XTcl_GetBignumFromObj(tls, interp, segment, bp+136) != TCL_OK) {
		goto __68
	}
	goto error
__68:
	;
	isNegative = libc.Bool32(XTclBN_mp_cmp_d(tls, bp+136, uint32(0)) == -1)
	goto __67
__66:
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(segment)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
			return func() int32 {
				*(*int64)(unsafe.Pointer(bp + 160)) = *(*int64)(unsafe.Pointer(segment + 32))
				return TCL_OK
			}()
		}
		return XTcl_GetLongFromObj(tls, uintptr(0), segment, bp+160)
	}() != TCL_OK) {
		goto __69
	}
	if !(XTcl_GetWideIntFromObj(tls, uintptr(0), segment, bp+168) != TCL_OK) {
		goto __71
	}

	if !(XTcl_GetBignumFromObj(tls, interp, segment, bp+136) != TCL_OK) {
		goto __73
	}
	goto error
__73:
	;
	XTclBN_mp_mod_2d(tls, bp+136, int32(uint64(8)*uint64(unsafe.Sizeof(int64(0)))), bp+136)
	objPtr = XTcl_NewBignumObj(tls, bp+136)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) {
		*(*int64)(unsafe.Pointer(bp + 160)) = *(*int64)(unsafe.Pointer(objPtr + 32))
	} else {
		XTcl_GetLongFromObj(tls, uintptr(0), objPtr, bp+160)
	}
__74:
	_objPtr = objPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __77
	}
	XTclFreeObj(tls, _objPtr)
__77:
	;
	goto __75
__75:
	if 0 != 0 {
		goto __74
	}
	goto __76
__76:
	;
	goto __72
__71:
	*(*int64)(unsafe.Pointer(bp + 160 /* l */)) = *(*Tcl_WideInt)(unsafe.Pointer(bp + 168))
__72:
	;
	if !(useShort != 0) {
		goto __78
	}
	s = int16(*(*int64)(unsafe.Pointer(bp + 160 /* l */)))
	isNegative = libc.Bool32(int32(s) < int32(int16(0)))
	goto __79
__78:
	isNegative = libc.Bool32(*(*int64)(unsafe.Pointer(bp + 160)) < int64(0))
__79:
	;
	goto __70
__69:
	if !(useShort != 0) {
		goto __80
	}
	s = int16(*(*int64)(unsafe.Pointer(bp + 160 /* l */)))
	isNegative = libc.Bool32(int32(s) < int32(int16(0)))
	goto __81
__80:
	isNegative = libc.Bool32(*(*int64)(unsafe.Pointer(bp + 160)) < int64(0))
__81:
	;
__70:
	;
__67:
	;

__82:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __85
	}
	segment = XTclThreadAllocObj(tls)
	goto __86
__85:
	segment = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(segment + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__86:
	;
	goto __83
__83:
	if 0 != 0 {
		goto __82
	}
	goto __84
__84:
	;
	(*Tcl_Obj)(unsafe.Pointer(segment)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(segment)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(segment)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(segment)).FtypePtr = uintptr(0)

	allocSegment = 1
	segmentLimit = 0x7fffffff
	(*Tcl_Obj)(unsafe.Pointer(segment)).FrefCount++

	if !((isNegative != 0 || gotPlus != 0 || gotSpace != 0) && (useBig != 0 || int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == 'd')) {
		goto __87
	}
	XTcl_AppendToObj(tls, segment,
		func() uintptr {
			if isNegative != 0 {
				return ts + 5772 /* "-" */
			}
			return func() uintptr {
				if gotPlus != 0 {
					return ts + 5686 /* "+" */
				}
				return ts + 14299 /* " " */
			}()
		}(), 1)
	segmentLimit = segmentLimit - 1
__87:
	;

	if !(gotHash != 0) {
		goto __88
	}
	switch int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108 /* ch */))) {
	case 'o':
		goto __90
	case 'X':
		goto __91
	case 'x':
		goto __92
	case 'b':
		goto __93
	}
	goto __89
__90:
	XTcl_AppendToObj(tls, segment, ts+18333, 1)
	segmentLimit = segmentLimit - 1
	*(*int32)(unsafe.Pointer(bp + 124 /* precision */))--
	goto __89
__91:
	XTcl_AppendToObj(tls, segment, ts+65030, 2)
	segmentLimit = segmentLimit - 2
	goto __89
__92:
	XTcl_AppendToObj(tls, segment, ts+65033, 2)
	segmentLimit = segmentLimit - 2
	goto __89
__93:
	XTcl_AppendToObj(tls, segment, ts+65036, 2)
	segmentLimit = segmentLimit - 2
	goto __89
__89:
	;
__88:
	;

	switch int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108 /* ch */))) {
	case 'd':
		goto __95

	case 'u':
		goto __96
	case 'o':
		goto __97
	case 'x':
		goto __98
	case 'X':
		goto __99
	case 'b':
		goto __100
	}
	goto __94
__95:

	if !(useShort != 0) {
		goto __101
	}
__103:
	;
__106:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __109
	}
	pure = XTclThreadAllocObj(tls)
	goto __110
__109:
	pure = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(pure + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__110:
	;
	goto __107
__107:
	if 0 != 0 {
		goto __106
	}
	goto __108
__108:
	;
	(*Tcl_Obj)(unsafe.Pointer(pure)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(pure)).Fbytes = uintptr(0)
	*(*int64)(unsafe.Pointer(pure + 32)) = int64(int32(s))
	(*Tcl_Obj)(unsafe.Pointer(pure)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))

	goto __104
__104:
	if 0 != 0 {
		goto __103
	}
	goto __105
__105:
	;
	goto __102
__101:
	if !(useBig != 0) {
		goto __111
	}
	pure = XTcl_NewBignumObj(tls, bp+136)
	goto __112
__111:
	pure = XTcl_NewLongObj(tls, *(*int64)(unsafe.Pointer(bp + 160 /* l */)))
__112:
	;
__102:
	;
	(*Tcl_Obj)(unsafe.Pointer(pure)).FrefCount++
	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(pure)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 176)) = (*Tcl_Obj)(unsafe.Pointer(pure)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(pure)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, pure, bp+176)
	}()

	// Already did the sign above.

	if !(int32(*(*int8)(unsafe.Pointer(bytes))) == '-') {
		goto __113
	}
	*(*int32)(unsafe.Pointer(bp + 176 /* length1 */))--
	bytes++
__113:
	;
	toAppend = *(*int32)(unsafe.Pointer(bp + 176 /* length1 */))

	// Canonical decimal string reps for integers are composed
	// entirely of one-byte encoded characters, so "length" is the
	// number of chars.

	if !(gotPrecision != 0) {
		goto __114
	}
	if !(*(*int32)(unsafe.Pointer(bp + 176)) < *(*int32)(unsafe.Pointer(bp + 124))) {
		goto __115
	}
	segmentLimit = segmentLimit - (*(*int32)(unsafe.Pointer(bp + 124)) - *(*int32)(unsafe.Pointer(bp + 176)))
__115:
	;
__116:
	if !(*(*int32)(unsafe.Pointer(bp + 176)) < *(*int32)(unsafe.Pointer(bp + 124))) {
		goto __117
	}
	XTcl_AppendToObj(tls, segment, ts+18333, 1)
	*(*int32)(unsafe.Pointer(bp + 176 /* length1 */))++
	goto __116
__117:
	;
	gotZero = 0
__114:
	;
	if !(gotZero != 0) {
		goto __118
	}
	*(*int32)(unsafe.Pointer(bp + 176 /* length1 */)) += XTcl_GetCharLength(tls, segment)
	if !(*(*int32)(unsafe.Pointer(bp + 176)) < *(*int32)(unsafe.Pointer(bp + 120))) {
		goto __119
	}
	segmentLimit = segmentLimit - (*(*int32)(unsafe.Pointer(bp + 120)) - *(*int32)(unsafe.Pointer(bp + 176)))
__119:
	;
__120:
	if !(*(*int32)(unsafe.Pointer(bp + 176)) < *(*int32)(unsafe.Pointer(bp + 120))) {
		goto __121
	}
	XTcl_AppendToObj(tls, segment, ts+18333, 1)
	*(*int32)(unsafe.Pointer(bp + 176 /* length1 */))++
	goto __120
__121:
	;
__118:
	;
	if !(toAppend > segmentLimit) {
		goto __122
	}
	msg = overflow
	errCode = ts + 29643 /* "OVERFLOW" */
	goto errorMsg
__122:
	;
	XTcl_AppendToObj(tls, segment, bytes, toAppend)
__123:
	_objPtr1 = pure
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __126
	}
	XTclFreeObj(tls, _objPtr1)
__126:
	;
	goto __124
__124:
	if 0 != 0 {
		goto __123
	}
	goto __125
__125:
	;
	goto __94

__96:
__97:
__98:
__99:
__100:
	bits = uint64(0)
	numDigits = int64(0)
	numBits = 4
	base = 16
	index = 0
	shift = 0

	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == 'u') {
		goto __127
	}
	base = 10
	goto __128
__127:
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == 'o') {
		goto __129
	}
	base = 8
	numBits = 3
	goto __130
__129:
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == 'b') {
		goto __131
	}
	base = 2
	numBits = 1
__131:
	;
__130:
	;
__128:
	;
	if !(useShort != 0) {
		goto __132
	}
	us = uint16(s)

	bits = Tcl_WideUInt(us)
__134:
	if !(us != 0) {
		goto __135
	}
	numDigits++
	us = uint16(int32(us) / base)
	goto __134
__135:
	;
	goto __133
__132:
	if !(useBig != 0 && (*Mp_int)(unsafe.Pointer(bp+136)).Fused != 0) {
		goto __136
	}
	leftover = (*Mp_int)(unsafe.Pointer(bp+136)).Fused * MP_DIGIT_BIT % numBits
	mask = Mp_digit(libc.CplUint32(Mp_digit(0))) << (MP_DIGIT_BIT - leftover)

	numDigits = int64(1) + Tcl_WideInt((*Mp_int)(unsafe.Pointer(bp+136)).Fused)*int64(MP_DIGIT_BIT)/Tcl_WideInt(numBits)
__138:
	if !(mask&*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+136)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(bp+136)).Fused-1)*4)) == Mp_digit(0)) {
		goto __139
	}
	numDigits--
	mask >>= numBits
	goto __138
__139:
	;
	if !(numDigits > int64(0x7fffffff)) {
		goto __140
	}
	msg = overflow
	errCode = ts + 29643 /* "OVERFLOW" */
	goto errorMsg
__140:
	;
	goto __137
__136:
	if !!(useBig != 0) {
		goto __141
	}
	ul = uint64(*(*int64)(unsafe.Pointer(bp + 160 /* l */)))

	bits = ul
__142:
	if !(ul != 0) {
		goto __143
	}
	numDigits++
	ul = ul / uint64(base)
	goto __142
__143:
	;
__141:
	;
__137:
	;
__133:
	;

	// Need to be sure zero becomes "0", not "".

	if !(numDigits == int64(0) && !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == 'o' && gotHash != 0)) {
		goto __144
	}
	numDigits = int64(1)
__144:
	;
__145:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __148
	}
	pure1 = XTclThreadAllocObj(tls)
	goto __149
__148:
	pure1 = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(pure1 + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__149:
	;
	goto __146
__146:
	if 0 != 0 {
		goto __145
	}
	goto __147
__147:
	;
	(*Tcl_Obj)(unsafe.Pointer(pure1)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(pure1)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(pure1)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(pure1)).FtypePtr = uintptr(0)

	XTcl_SetObjLength(tls, pure1, int32(numDigits))
	bytes1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(pure1)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(pure1)).Fbytes
		}
		return XTcl_GetString(tls, pure1)
	}()
	toAppend = libc.AssignInt32(&length2, int32(numDigits))
__150:
	if !(libc.PostDecInt64(&numDigits, 1) != 0) {
		goto __151
	}

	if !(useBig != 0 && (*Mp_int)(unsafe.Pointer(bp+136)).Fused != 0) {
		goto __152
	}
	if !(index < (*Mp_int)(unsafe.Pointer(bp+136)).Fused && Size_t(shift) < uint64(8)*uint64(unsafe.Sizeof(Tcl_WideUInt(0)))-uint64(MP_DIGIT_BIT)) {
		goto __153
	}
	bits = bits | Tcl_WideUInt(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(bp+136)).Fdp + uintptr(libc.PostIncInt32(&index, 1))*4)))<<shift
	shift = shift + MP_DIGIT_BIT
__153:
	;
	shift = shift - numBits
__152:
	;
	digitOffset = int32(bits % Tcl_WideUInt(base))
	if !(digitOffset > 9) {
		goto __154
	}
	if !(int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108))) == 'X') {
		goto __156
	}
	*(*int8)(unsafe.Pointer(bytes1 + uintptr(numDigits))) = int8('A' + digitOffset - 10)
	goto __157
__156:
	*(*int8)(unsafe.Pointer(bytes1 + uintptr(numDigits))) = int8('a' + digitOffset - 10)
__157:
	;
	goto __155
__154:
	*(*int8)(unsafe.Pointer(bytes1 + uintptr(numDigits))) = int8('0' + digitOffset)
__155:
	;
	bits = bits / Tcl_WideUInt(base)
	goto __150
__151:
	;
	if !(useBig != 0) {
		goto __158
	}
	XTclBN_mp_clear(tls, bp+136)
__158:
	;
	if !(gotPrecision != 0) {
		goto __159
	}
	if !(length2 < *(*int32)(unsafe.Pointer(bp + 124))) {
		goto __160
	}
	segmentLimit = segmentLimit - (*(*int32)(unsafe.Pointer(bp + 124)) - length2)
__160:
	;
__161:
	if !(length2 < *(*int32)(unsafe.Pointer(bp + 124))) {
		goto __162
	}
	XTcl_AppendToObj(tls, segment, ts+18333, 1)
	length2++
	goto __161
__162:
	;
	gotZero = 0
__159:
	;
	if !(gotZero != 0) {
		goto __163
	}
	length2 = length2 + XTcl_GetCharLength(tls, segment)
	if !(length2 < *(*int32)(unsafe.Pointer(bp + 120))) {
		goto __164
	}
	segmentLimit = segmentLimit - (*(*int32)(unsafe.Pointer(bp + 120)) - length2)
__164:
	;
__165:
	if !(length2 < *(*int32)(unsafe.Pointer(bp + 120))) {
		goto __166
	}
	XTcl_AppendToObj(tls, segment, ts+18333, 1)
	length2++
	goto __165
__166:
	;
__163:
	;
	if !(toAppend > segmentLimit) {
		goto __167
	}
	msg = overflow
	errCode = ts + 29643 /* "OVERFLOW" */
	goto errorMsg
__167:
	;
	XTcl_AppendObjToObj(tls, segment, pure1)
__168:
	_objPtr2 = pure1
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __171
	}
	XTclFreeObj(tls, _objPtr2)
__171:
	;
	goto __169
__169:
	if 0 != 0 {
		goto __168
	}
	goto __170
__170:
	;
	goto __94

__94:
	;
	goto __46

__56:
__57:
__58:
__59:
__60:
	p = bp + 180 /* spec */
	length3 = MAX_FLOAT_SIZE

	if !(XTcl_GetDoubleFromObj(tls, interp, segment, bp+240) != TCL_OK) {
		goto __172
	}
	// TODO: Figure out ACCEPT_NAN here
	goto error
__172:
	;
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8('%')
	if !(gotMinus != 0) {
		goto __173
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8('-')
__173:
	;
	if !(gotHash != 0) {
		goto __174
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8('#')
__174:
	;
	if !(gotZero != 0) {
		goto __175
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8('0')
__175:
	;
	if !(gotSpace != 0) {
		goto __176
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8(' ')
__176:
	;
	if !(gotPlus != 0) {
		goto __177
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8('+')
__177:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
		goto __178
	}
	p += uintptr(libc.Xsprintf(tls, p, ts+324, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(bp + 120 /* width */)))))
	if !(*(*int32)(unsafe.Pointer(bp + 120)) > length3) {
		goto __179
	}
	length3 = *(*int32)(unsafe.Pointer(bp + 120 /* width */))
__179:
	;
__178:
	;
	if !(gotPrecision != 0) {
		goto __180
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8('.')
	p += uintptr(libc.Xsprintf(tls, p, ts+324, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(bp + 124 /* precision */)))))
	if !(*(*int32)(unsafe.Pointer(bp + 124)) > 0x7fffffff-length3) {
		goto __181
	}
	msg = overflow
	errCode = ts + 29643 /* "OVERFLOW" */
	goto errorMsg
__181:
	;
	length3 = length3 + *(*int32)(unsafe.Pointer(bp + 124))
__180:
	;

	// Don't pass length modifiers!

	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108 /* ch */)))
	*(*int8)(unsafe.Pointer(p)) = int8(0)

__182:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __185
	}
	segment = XTclThreadAllocObj(tls)
	goto __186
__185:
	segment = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(segment + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__186:
	;
	goto __183
__183:
	if 0 != 0 {
		goto __182
	}
	goto __184
__184:
	;
	(*Tcl_Obj)(unsafe.Pointer(segment)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(segment)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(segment)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(segment)).FtypePtr = uintptr(0)

	allocSegment = 1
	if !!(XTcl_AttemptSetObjLength(tls, segment, length3) != 0) {
		goto __187
	}
	msg = overflow
	errCode = ts + 29643 /* "OVERFLOW" */
	goto errorMsg
__187:
	;
	bytes2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(segment)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(segment)).Fbytes
		}
		return XTcl_GetString(tls, segment)
	}()
	if !!(XTcl_AttemptSetObjLength(tls, segment, libc.Xsprintf(tls, bytes2, bp+180, libc.VaList(bp+24, *(*float64)(unsafe.Pointer(bp + 240))))) != 0) {
		goto __188
	}
	msg = overflow
	errCode = ts + 29643 /* "OVERFLOW" */
	goto errorMsg
__188:
	;
	goto __46

__61:
	if !(interp != uintptr(0)) {
		goto __189
	}
	XTcl_SetObjResult(tls, interp,
		XTcl_ObjPrintf(tls, ts+65039, libc.VaList(bp+32, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 108 /* ch */))))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+63674, ts+63936, uintptr(0)))
__189:
	;
	goto error
__46:
	;

	if !(*(*int32)(unsafe.Pointer(bp + 120)) > 0 && numChars < 0) {
		goto __190
	}
	numChars = XTcl_GetCharLength(tls, segment)
__190:
	;
	if !(!(gotMinus != 0) && *(*int32)(unsafe.Pointer(bp + 120)) > 0) {
		goto __191
	}
	if !(numChars < *(*int32)(unsafe.Pointer(bp + 120))) {
		goto __192
	}
	limit = limit - (*(*int32)(unsafe.Pointer(bp + 120)) - numChars)
__192:
	;
__193:
	if !(numChars < *(*int32)(unsafe.Pointer(bp + 120))) {
		goto __194
	}
	XTcl_AppendToObj(tls, appendObj, func() uintptr {
		if gotZero != 0 {
			return ts + 18333 /* "0" */
		}
		return ts + 14299 /* " " */
	}(), 1)
	numChars++
	goto __193
__194:
	;
__191:
	;

	if (*Tcl_Obj)(unsafe.Pointer(segment)).Fbytes != 0 {
		*(*int32)(unsafe.Pointer(bp + 248)) = (*Tcl_Obj)(unsafe.Pointer(segment)).Flength
		_ = (*Tcl_Obj)(unsafe.Pointer(segment)).Fbytes
	} else {
		XTcl_GetStringFromObj(tls, segment, bp+248)
	}
	if !(*(*int32)(unsafe.Pointer(bp + 248)) > limit) {
		goto __195
	}
	if !(allocSegment != 0) {
		goto __196
	}
__197:
	_objPtr3 = segment
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr3)).FrefCount, 1) <= 1) {
		goto __200
	}
	XTclFreeObj(tls, _objPtr3)
__200:
	;
	goto __198
__198:
	if 0 != 0 {
		goto __197
	}
	goto __199
__199:
	;
__196:
	;
	msg = overflow
	errCode = ts + 29643 /* "OVERFLOW" */
	goto errorMsg
__195:
	;
	XTcl_AppendObjToObj(tls, appendObj, segment)
	limit = limit - *(*int32)(unsafe.Pointer(bp + 248))
	if !(allocSegment != 0) {
		goto __201
	}
__202:
	_objPtr4 = segment
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr4)).FrefCount, 1) <= 1) {
		goto __205
	}
	XTclFreeObj(tls, _objPtr4)
__205:
	;
	goto __203
__203:
	if 0 != 0 {
		goto __202
	}
	goto __204
__204:
	;
__201:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 120)) > 0) {
		goto __206
	}
	if !(numChars < *(*int32)(unsafe.Pointer(bp + 120))) {
		goto __207
	}
	limit = limit - (*(*int32)(unsafe.Pointer(bp + 120)) - numChars)
__207:
	;
__208:
	if !(numChars < *(*int32)(unsafe.Pointer(bp + 120))) {
		goto __209
	}
	XTcl_AppendToObj(tls, appendObj, func() uintptr {
		if gotZero != 0 {
			return ts + 18333 /* "0" */
		}
		return ts + 14299 /* " " */
	}(), 1)
	numChars++
	goto __208
__209:
	;
__206:
	;

	objIndex = objIndex + gotSequential
	goto __2
__3:
	;
	if !(numBytes != 0) {
		goto __210
	}
	if !(numBytes > limit) {
		goto __211
	}
	msg = overflow
	errCode = ts + 29643 /* "OVERFLOW" */
	goto errorMsg
__211:
	;
	XTcl_AppendToObj(tls, appendObj, span, numBytes)
	limit = limit - numBytes
	numBytes = 0
__210:
	;

	return TCL_OK

errorMsg:
	if !(interp != uintptr(0)) {
		goto __212
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, msg, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+63674, errCode, uintptr(0)))
__212:
	;
error:
	XTcl_SetObjLength(tls, appendObj, *(*int32)(unsafe.Pointer(bp + 104 /* originalLength */)))
	return TCL_ERROR
}

var mixedXPG uintptr = ts + 63627 /* "cannot mix \"%\" a..." */ /* tclStringObj.c:1874:23 */
var badIndex = [2]uintptr{
	ts + 9771,
	ts + 64083,
}                                 /* tclStringObj.c:1876:23 */
var overflow uintptr = ts + 65064 /* "max size for a T..." */ /* tclStringObj.c:1880:23 */

//---------------------------------------------------------------------------
//
// Tcl_Format --
//
// Results:
//	A refcount zero Tcl_Obj.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_Format(tls *libc.TLS, interp uintptr, format uintptr, objc int32, objv uintptr) uintptr { /* tclStringObj.c:2600:9: */
	var result int32
	var objPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	result = XTcl_AppendFormatToObj(tls, interp, objPtr, format, objc, objv)
	if result != TCL_OK {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return uintptr(0)
	}
	return objPtr
}

//---------------------------------------------------------------------------
//
// AppendPrintfToObjVA --
//
// Results:
//
// Side effects:
//
//---------------------------------------------------------------------------

func sAppendPrintfToObjVA(tls *libc.TLS, objPtr uintptr, format uintptr, argList Va_list) { /* tclStringObj.c:2632:1: */
	bp := tls.Alloc(36)
	defer tls.Free(36)

	var code int32
	// var objc int32 at bp+32, 4

	// var objv uintptr at bp+24, 8

	var list uintptr
	var p uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			list = XTclThreadAllocObj(tls)
		} else {
			list = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(list + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(list)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(list)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(list)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(list)).FtypePtr = uintptr(0)
	{
	}

	p = format
	(*Tcl_Obj)(unsafe.Pointer(list)).FrefCount++
	for int32(*(*int8)(unsafe.Pointer(p))) != 0 {
		var size int32 = 0
		var seekingConversion int32 = 1
		var gotPrecision int32 = 0
		var lastNum int32 = -1

		if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) != '%' {
			continue
		}
		if int32(*(*int8)(unsafe.Pointer(p))) == '%' {
			p++
			continue
		}
		for ok1 := true; ok1; ok1 = seekingConversion != 0 {
			switch int32(*(*int8)(unsafe.Pointer(p))) {
			case 0:
				seekingConversion = 0
				break
			case 's':
				{
					var q uintptr
					var end uintptr
					var bytes uintptr = libc.VaUintptr(&argList)
					seekingConversion = 0

					// The buffer to copy characters from starts at bytes and ends
					// at either the first NUL byte, or after lastNum bytes, when
					// caller has indicated a limit.

					end = bytes
					for (!(gotPrecision != 0) || libc.PostDecInt32(&lastNum, 1) != 0) && int32(*(*int8)(unsafe.Pointer(end))) != 0 {
						end++
					}

					// Within that buffer, we trim both ends if needed so that we
					// copy only whole characters, and avoid copying any partial
					// multi-byte characters.

					q = func() uintptr {
						if end < bytes+uintptr(2) {
							return bytes
						}
						return func() uintptr {
							if int32(uint8(*(*int8)(unsafe.Pointer(end - uintptr(1))))) < 0x80 {
								return end - uintptr(1)
							}
							return XTcl_UtfPrev(tls, end, bytes)
						}()
					}()
					if !(XTcl_UtfCharComplete(tls, q, int32((int64(end)-int64(q))/1)) != 0) {
						end = q
					}

					q = bytes + uintptr(TCL_UTF_MAX)
					for bytes < end && bytes < q &&
						int32(*(*int8)(unsafe.Pointer(bytes)))&0xC0 == 0x80 {
						bytes++
					}

					XTcl_ListObjAppendElement(tls, uintptr(0), list,
						XTcl_NewStringObj(tls, bytes, int32((int64(end)-int64(bytes))/1)))

					break

				}
			case 'c':
				fallthrough
			case 'i':
				fallthrough
			case 'u':
				fallthrough
			case 'd':
				fallthrough
			case 'o':
				fallthrough
			case 'x':
				fallthrough
			case 'X':
				seekingConversion = 0
				switch size {
				case -1:
					fallthrough
				case 0:
					XTcl_ListObjAppendElement(tls, uintptr(0), list, XTcl_NewLongObj(tls,
						int64(libc.VaInt32(&argList))))
					break
				case 1:
					XTcl_ListObjAppendElement(tls, uintptr(0), list, XTcl_NewLongObj(tls,
						int64(libc.VaInt64(&argList))))
					break
				}
				break
			case 'e':
				fallthrough
			case 'E':
				fallthrough
			case 'f':
				fallthrough
			case 'g':
				fallthrough
			case 'G':
				XTcl_ListObjAppendElement(tls, uintptr(0), list, XTcl_NewDoubleObj(tls,
					float64(libc.VaFloat64(&argList))))
				seekingConversion = 0
				break
			case '*':
				lastNum = int32(libc.VaInt32(&argList))
				XTcl_ListObjAppendElement(tls, uintptr(0), list, XTcl_NewIntObj(tls, lastNum))
				p++
				break
			case '0':
				fallthrough
			case '1':
				fallthrough
			case '2':
				fallthrough
			case '3':
				fallthrough
			case '4':
				fallthrough
			case '5':
				fallthrough
			case '6':
				fallthrough
			case '7':
				fallthrough
			case '8':
				fallthrough
			case '9':
				{
					// var end uintptr at bp+16, 8

					lastNum = int32(libc.Xstrtoul(tls, p, bp+16, 10))
					p = *(*uintptr)(unsafe.Pointer(bp + 16 /* end */))
					break

				}
			case '.':
				gotPrecision = 1
				p++
				break
			// TODO: support for wide (and bignum?) arguments
			case 'l':
				size = 1
				p++
				break
			case 'h':
				size = -1
				fallthrough
				// FALLTHRU
			default:
				p++
			}
		}
	}
	if (*Tcl_Obj)(unsafe.Pointer(list)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
		*(*uintptr)(unsafe.Pointer(bp + 24)) = *(*uintptr)(unsafe.Pointer(list + 32)) + 16
		*(*int32)(unsafe.Pointer(bp + 32)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(list + 32)))).FelemCount
	} else {
		XTcl_ListObjGetElements(tls, uintptr(0), list, bp+32, bp+24)
	}
	code = XTcl_AppendFormatToObj(tls, uintptr(0), objPtr, format, *(*int32)(unsafe.Pointer(bp + 32 /* objc */)), *(*uintptr)(unsafe.Pointer(bp + 24 /* objv */)))
	if code != TCL_OK {
		XTcl_AppendPrintfToObj(tls, objPtr,
			ts+65098,
			libc.VaList(bp, format, XTcl_GetString(tls, list)))
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = list
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
}

//---------------------------------------------------------------------------
//
// Tcl_AppendPrintfToObj --
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_AppendPrintfToObj(tls *libc.TLS, objPtr uintptr, format uintptr, va uintptr) { /* tclStringObj.c:2781:1: */
	var argList Va_list
	_ = argList

	argList = va
	sAppendPrintfToObjVA(tls, objPtr, format, argList)
	_ = argList
}

//---------------------------------------------------------------------------
//
// Tcl_ObjPrintf --
//
// Results:
//	A refcount zero Tcl_Obj.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_ObjPrintf(tls *libc.TLS, format uintptr, va uintptr) uintptr { /* tclStringObj.c:2807:9: */
	var argList Va_list
	_ = argList
	var objPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	argList = va
	sAppendPrintfToObjVA(tls, objPtr, format, argList)
	_ = argList
	return objPtr
}

//---------------------------------------------------------------------------
//
// TclGetStringStorage --
//
//	Returns the string storage space of a Tcl_Obj.
//
// Results:
//	The pointer value objPtr->bytes is returned and the number of bytes
//	allocated there is written to *sizePtr (if known).
//
// Side effects:
//	May set objPtr->bytes.
//
//---------------------------------------------------------------------------

func XTclGetStringStorage(tls *libc.TLS, objPtr uintptr, sizePtr uintptr) uintptr { /* tclStringObj.c:2839:6: */
	var stringPtr uintptr

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclStringType)) || (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) {
		return func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
				return func() uintptr {
					*(*int32)(unsafe.Pointer(sizePtr)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
					return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
				}()
			}
			return XTcl_GetStringFromObj(tls, objPtr, sizePtr)
		}()
	}

	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	*(*uint32)(unsafe.Pointer(sizePtr)) = uint32((*String)(unsafe.Pointer(stringPtr)).Fallocated)
	return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
}

//---------------------------------------------------------------------------
//
// TclStringReverse --
//
//	Implements the [string reverse] operation.
//
// Results:
//	An unshared Tcl value which is the [string reverse] of the argument
//	supplied. When sharing rules permit, the returned value might be the
//	argument with modifications done in place.
//
// Side effects:
//	May allocate a new Tcl_Obj.
//
//---------------------------------------------------------------------------

func sReverseBytes(tls *libc.TLS, to uintptr, from uintptr, count int32) { /* tclStringObj.c:2873:1: */
	var src uintptr = from + uintptr(count)

	if to == from {
		// Reversing in place
		for libc.PreDecUintptr(&src, 1) > to {
			var c uint8 = *(*uint8)(unsafe.Pointer(src))

			*(*uint8)(unsafe.Pointer(src)) = *(*uint8)(unsafe.Pointer(to))
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&to, 1))) = c
		}
	} else {
		for libc.PreDecUintptr(&src, 1) >= from {
			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&to, 1))) = *(*uint8)(unsafe.Pointer(src))
		}
	}
}

func XTclStringReverse(tls *libc.TLS, objPtr uintptr) uintptr { /* tclStringObj.c:2896:9: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var stringPtr uintptr
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */)) = Tcl_UniChar(0)
	var needFlip int32 = 0

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) {
		// var numBytes int32 at bp, 4

		var from uintptr = XTcl_GetByteArrayFromObj(tls, objPtr, bp)

		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
			objPtr = XTcl_NewByteArrayObj(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp /* numBytes */)))
		}
		sReverseBytes(tls, XTcl_GetByteArrayFromObj(tls, objPtr, uintptr(0)), from, *(*int32)(unsafe.Pointer(bp /* numBytes */)))
		return objPtr
	}

	sSetStringFromAny(tls, uintptr(0), objPtr)
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if (*String)(unsafe.Pointer(stringPtr)).FhasUnicode != 0 {
		var from uintptr = XTcl_GetUnicode(tls, objPtr)
		var src uintptr = from + uintptr((*String)(unsafe.Pointer(stringPtr)).FnumChars)*2
		var to uintptr

		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
			// Create a non-empty, pure unicode value, so we can coax
			// Tcl_SetObjLength into growing the unicode rep buffer.

			objPtr = XTcl_NewUnicodeObj(tls, bp+4, 1)
			XTcl_SetObjLength(tls, objPtr, (*String)(unsafe.Pointer(stringPtr)).FnumChars)
			to = XTcl_GetUnicode(tls, objPtr)
			for libc.PreDecUintptr(&src, 2) >= from {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */)) = *(*Tcl_UniChar)(unsafe.Pointer(src))
				if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)))&0xF800 == 0xD800 {
					needFlip = 1
				}
				*(*Tcl_UniChar)(unsafe.Pointer(libc.PostIncUintptr(&to, 2))) = *(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */))
			}
		} else {
			// Reversing in place.

			to = src
			for libc.PreDecUintptr(&src, 2) > from {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */)) = *(*Tcl_UniChar)(unsafe.Pointer(src))
				if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)))&0xF800 == 0xD800 {
					needFlip = 1
				}
				*(*Tcl_UniChar)(unsafe.Pointer(src)) = *(*Tcl_UniChar)(unsafe.Pointer(from))
				*(*Tcl_UniChar)(unsafe.Pointer(libc.PostIncUintptr(&from, 2))) = *(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */))
			}
		}
		if needFlip != 0 {
			// Flip back surrogate pairs.

			from = to - uintptr((*String)(unsafe.Pointer(stringPtr)).FnumChars)*2
			for libc.PreDecUintptr(&to, 2) >= from {
				*(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */)) = *(*Tcl_UniChar)(unsafe.Pointer(to))
				if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)))&0xFC00 == 0xD800 {
					if to-uintptr(1)*2 >= from && int32(*(*Tcl_UniChar)(unsafe.Pointer(to + libc.UintptrFromInt32(-1)*2)))&0xFC00 == 0xDC00 {
						*(*Tcl_UniChar)(unsafe.Pointer(to)) = *(*Tcl_UniChar)(unsafe.Pointer(to + libc.UintptrFromInt32(-1)*2))
						*(*Tcl_UniChar)(unsafe.Pointer(to + libc.UintptrFromInt32(-1)*2)) = *(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */))
						to -= 2
					}
				}
			}
		}
	}

	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
		var numChars int32 = (*String)(unsafe.Pointer(stringPtr)).FnumChars
		var numBytes int32 = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
		var to uintptr
		var from uintptr = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes

		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > 1 {
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					objPtr = XTclThreadAllocObj(tls)
				} else {
					objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
			{
			}

			XTcl_SetObjLength(tls, objPtr, numBytes)
		}
		to = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes

		if numChars < numBytes {
			// Either numChars == -1 and we don't know how many chars are
			// represented by objPtr->bytes and we need Pass 1 just in case,
			// or numChars >= 0 and we know we have fewer chars than bytes, so
			// we know there's a multibyte character needing Pass 1.
			//
			// Pass 1. Reverse the bytes of each multi-byte character.

			var bytesLeft int32 = numBytes
			// var chw int32 at bp+8, 4

			for bytesLeft != 0 {
				// NOTE: We know that the from buffer is NUL-terminated. It's
				// part of the contract for objPtr->bytes values. Thus, we can
				// skip calling Tcl_UtfCharComplete() here.

				var bytesInChar int32 = XTclUtfToUCS4(tls, from, bp+8)

				sReverseBytes(tls, to, from,
					bytesInChar)
				to += uintptr(bytesInChar)
				from += uintptr(bytesInChar)
				bytesLeft = bytesLeft - bytesInChar
			}

			from = libc.AssignUintptr(&to, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
		}
		// Pass 2. Reverse all the bytes.
		sReverseBytes(tls, to, from, numBytes)
	}

	return objPtr
}

//---------------------------------------------------------------------------
//
// FillUnicodeRep --
//
//	Populate the Unicode internal rep with the Unicode form of its string
//	rep. The object must alread have a "String" internal rep.
//
// Results:
//	None.
//
// Side effects:
//	Reallocates the String internal rep.
//
//---------------------------------------------------------------------------

func sFillUnicodeRep(tls *libc.TLS, objPtr uintptr) { /* tclStringObj.c:3052:1: */
	var stringPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	sExtendUnicodeRepWithString(tls, objPtr, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength,
		(*String)(unsafe.Pointer(stringPtr)).FnumChars)
}

func sExtendUnicodeRepWithString(tls *libc.TLS, objPtr uintptr, bytes uintptr, numBytes int32, numAppendChars int32) { /* tclStringObj.c:3063:1: */
	bp := tls.Alloc(10)
	defer tls.Free(10)

	var stringPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	var needed int32
	var numOrigChars int32 = 0
	var dst uintptr
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 8 /* unichar */)) = Tcl_UniChar(0)

	if (*String)(unsafe.Pointer(stringPtr)).FhasUnicode != 0 {
		numOrigChars = (*String)(unsafe.Pointer(stringPtr)).FnumChars
	}
	if numAppendChars == -1 {
		for ok := true; ok; ok = 0 != 0 {
			var _count int32
			var _i int32 = numBytes
			var _str uintptr = bytes
			for _i != 0 && int32(*(*uint8)(unsafe.Pointer(_str))) < 0xC0 {
				_i--
				_str++
			}
			_count = numBytes - _i
			if _i != 0 {
				_count = _count + XTcl_NumUtfChars(tls, bytes+uintptr(_count), _i)
			}
			numAppendChars = _count
		}

	}
	needed = numOrigChars + numAppendChars
	for ok1 := true; ok1; ok1 = 0 != 0 {
		if needed < 0 || needed > int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0)))) {
			XTcl_Panic(tls, ts+64748, libc.VaList(bp, int32((uint64(uint32(0x7fffffff)*2+1)-uint64(1)-Size_t(int32(uintptr(0)+16)))/Size_t(unsafe.Sizeof(Tcl_UniChar(0))))))
		}
	}

	if needed > (*String)(unsafe.Pointer(stringPtr)).FmaxChars {
		sGrowUnicodeBuffer(tls, objPtr, needed)
		stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	}

	(*String)(unsafe.Pointer(stringPtr)).FhasUnicode = 1
	if bytes != 0 {
		(*String)(unsafe.Pointer(stringPtr)).FnumChars = needed
	} else {
		numAppendChars = 0
	}
	for dst = stringPtr + 16 + uintptr(numOrigChars)*2; libc.PostDecInt32(&numAppendChars, 1) > 0; dst += 2 {
		bytes += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(bytes)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp + 8)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(bytes))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, bytes, bp+8))
		}()
		*(*Tcl_UniChar)(unsafe.Pointer(dst)) = *(*Tcl_UniChar)(unsafe.Pointer(bp + 8 /* unichar */))
	}
	*(*Tcl_UniChar)(unsafe.Pointer(dst)) = Tcl_UniChar(0)
}

//----------------------------------------------------------------------
//
// DupStringInternalRep --
//
//	Initialize the internal representation of a new Tcl_Obj to a copy of
//	the internal representation of an existing string object.
//
// Results:
//	None.
//
// Side effects:
//	copyPtr's internal rep is set to a copy of srcPtr's internal
//	representation.
//
//----------------------------------------------------------------------

func sDupStringInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* tclStringObj.c:3119:1: */
	var srcStringPtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))
	var copyStringPtr uintptr = uintptr(0)

	if (*String)(unsafe.Pointer(srcStringPtr)).FnumChars == -1 {
		// The String struct in the source value holds zero useful data. Don't
		// bother copying it. Don't even bother allocating space in which to
		// copy it. Just let the copy be untyped.

		return
	}

	if (*String)(unsafe.Pointer(srcStringPtr)).FhasUnicode != 0 {
		var copyMaxChars int32

		if (*String)(unsafe.Pointer(srcStringPtr)).FmaxChars/2 >= (*String)(unsafe.Pointer(srcStringPtr)).FnumChars {
			copyMaxChars = 2 * (*String)(unsafe.Pointer(srcStringPtr)).FnumChars
		} else {
			copyMaxChars = (*String)(unsafe.Pointer(srcStringPtr)).FmaxChars
		}
		copyStringPtr = XTclpAlloc(tls, uint32(uint64(int32(uintptr(0)+16))+uint64(copyMaxChars+1)*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))
		if copyStringPtr == uintptr(0) {
			copyMaxChars = (*String)(unsafe.Pointer(srcStringPtr)).FnumChars
			copyStringPtr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+16))+uint64(copyMaxChars+1)*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))
		}
		(*String)(unsafe.Pointer(copyStringPtr)).FmaxChars = copyMaxChars
		libc.Xmemcpy(tls, copyStringPtr+16, srcStringPtr+16,
			uint64((*String)(unsafe.Pointer(srcStringPtr)).FnumChars)*uint64(unsafe.Sizeof(Tcl_UniChar(0))))
		*(*Tcl_UniChar)(unsafe.Pointer(copyStringPtr + 16 + uintptr((*String)(unsafe.Pointer(srcStringPtr)).FnumChars)*2)) = Tcl_UniChar(0)
	} else {
		copyStringPtr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+16))+uint64(0+1)*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))
		(*String)(unsafe.Pointer(copyStringPtr)).FmaxChars = 0
		*(*Tcl_UniChar)(unsafe.Pointer(copyStringPtr + 16)) = Tcl_UniChar(0)
	}
	(*String)(unsafe.Pointer(copyStringPtr)).FhasUnicode = (*String)(unsafe.Pointer(srcStringPtr)).FhasUnicode
	(*String)(unsafe.Pointer(copyStringPtr)).FnumChars = (*String)(unsafe.Pointer(srcStringPtr)).FnumChars

	// Tricky point: the string value was copied by generic object management
	// code, so it doesn't contain any extra bytes that might exist in the
	// source object.

	(*String)(unsafe.Pointer(copyStringPtr)).Fallocated = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(copyPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(copyPtr)).Flength
		}
		return 0
	}()

	*(*uintptr)(unsafe.Pointer(copyPtr + 32)) = copyStringPtr
	(*Tcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclStringType))
}

//----------------------------------------------------------------------
//
// SetStringFromAny --
//
//	Create an internal representation of type "String" for an object.
//
// Results:
//	This operation always succeeds and returns TCL_OK.
//
// Side effects:
//	Any old internal reputation for objPtr is freed and the internal
//	representation is set to "String".
//
//----------------------------------------------------------------------

func sSetStringFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclStringObj.c:3229:1: */
	if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&XtclStringType)) {
		var stringPtr uintptr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+16))+uint64(0+1)*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))

		// Convert whatever we have into an untyped value. Just A String.

		if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0) {
			XTcl_GetString(tls, objPtr)
		}
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0) {
			if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
			}
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		}

		// Create a basic String internalrep that just points to the UTF-8 string
		// already in place at objPtr->bytes.

		(*String)(unsafe.Pointer(stringPtr)).FnumChars = -1
		(*String)(unsafe.Pointer(stringPtr)).Fallocated = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
		(*String)(unsafe.Pointer(stringPtr)).FmaxChars = 0
		(*String)(unsafe.Pointer(stringPtr)).FhasUnicode = 0
		*(*uintptr)(unsafe.Pointer(objPtr + 32)) = stringPtr
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclStringType))
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// UpdateStringOfString --
//
//	Update the string representation for an object whose internal
//	representation is "String".
//
// Results:
//	None.
//
// Side effects:
//	The object's string may be set by converting its Unicode represention
//	to UTF format.
//
//----------------------------------------------------------------------

func sUpdateStringOfString(tls *libc.TLS, objPtr uintptr) { /* tclStringObj.c:3277:1: */
	var stringPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	// This routine is only called when we need to generate the
	// string rep objPtr->bytes because it does not exist -- it is NULL.
	// In that circumstance, any lingering claim about the size of
	// memory pointed to by that NULL pointer is clearly bogus, and
	// needs a reset.

	(*String)(unsafe.Pointer(stringPtr)).Fallocated = 0

	if (*String)(unsafe.Pointer(stringPtr)).FnumChars == 0 {
		if 0 == 0 {
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(0+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, XtclEmptyStringRep, uint64(0))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
		}

	} else {
		sExtendStringRepWithUnicode(tls, objPtr, stringPtr+16,
			(*String)(unsafe.Pointer(stringPtr)).FnumChars)
	}
}

func sExtendStringRepWithUnicode(tls *libc.TLS, objPtr uintptr, unicode uintptr, numChars int32) int32 { /* tclStringObj.c:3301:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// Pre-condition: this is the "string" Tcl_ObjType.

	var i int32
	var origLength int32
	var size int32
	var dst uintptr
	// var buf [4]int8 at bp+8, 4

	var stringPtr uintptr
	size = 0
	*(*[4]int8)(unsafe.Pointer(bp + 8 /* buf */)) = *(*[4]int8)(unsafe.Pointer(ts + 63623))
	stringPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if !(numChars < 0) {
		goto __1
	}
	numChars = sUnicodeLength(tls, unicode)
__1:
	;

	if !(numChars == 0) {
		goto __2
	}
	return 0
__2:
	;

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0)) {
		goto __3
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
__3:
	;
	size = libc.AssignInt32(&origLength, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength)

	// Quick cheap check in case we have more than enough room.

	if !(numChars <= (0x7fffffff-size)/TCL_UTF_MAX &&
		(*String)(unsafe.Pointer(stringPtr)).Fallocated >= size+numChars*TCL_UTF_MAX) {
		goto __4
	}
	goto copyBytes
__4:
	;

	i = 0
__5:
	if !(i < numChars && size >= 0) {
		goto __7
	}
	size = size + XTcl_UniCharToUtf(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(unicode + uintptr(i)*2))), bp+8)
	goto __6
__6:
	i++
	goto __5
	goto __7
__7:
	;
	if !(size < 0) {
		goto __8
	}
	XTcl_Panic(tls, ts+9405, libc.VaList(bp, 0x7fffffff))
__8:
	;

	// Grow space if needed.

	if !(size > (*String)(unsafe.Pointer(stringPtr)).Fallocated) {
		goto __9
	}
	sGrowStringBuffer(tls, objPtr, size, 1)
__9:
	;

copyBytes:
	dst = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(origLength)
	i = 0
__10:
	if !(i < numChars) {
		goto __12
	}
	dst += uintptr(XTcl_UniCharToUtf(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(unicode + uintptr(i)*2))), dst))
	goto __11
__11:
	i++
	goto __10
	goto __12
__12:
	;
	*(*int8)(unsafe.Pointer(dst)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = int32((int64(dst) - int64((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)) / 1)
	return numChars
}

//----------------------------------------------------------------------
//
// FreeStringInternalRep --
//
//	Deallocate the storage associated with a String data object's internal
//	representation.
//
// Results:
//	None.
//
// Side effects:
//	Frees memory.
//
//----------------------------------------------------------------------

func sFreeStringInternalRep(tls *libc.TLS, objPtr uintptr) { /* tclStringObj.c:3379:1: */
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(objPtr + 32)))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// deprecated functions

// code-generating macros

// Remove macros that will interfere with the definitions below.

// See bug 510001: TclSockMinimumBuffers needs plat imp
func sockMinimumBuffersOld(tls *libc.TLS, sock int32, size int32) int32 { /* tclStubInit.c:68:12: */
	return XTclSockMinimumBuffers(tls, uintptr(Intptr_t(sock)), size)
}

func XTclBN_mp_set_ull(tls *libc.TLS, a uintptr, b Tcl_WideUInt) { /* tclStubInit.c:74:1: */
	var i int32 = 0
	for b != uint64(0) {
		*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(libc.PostIncInt32(&i, 1))*4)) = Mp_digit(b) & (Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT) - Mp_digit(1))
		if uint64(8)*Size_t(unsafe.Sizeof(Tcl_WideUInt(0))) <= uint64(MP_DIGIT_BIT) {
			break
		}
		b >>= func() int32 {
			if uint64(8)*Size_t(unsafe.Sizeof(Tcl_WideUInt(0))) <= uint64(MP_DIGIT_BIT) {
				return 0
			}
			return MP_DIGIT_BIT
		}()
	}
	(*Mp_int)(unsafe.Pointer(a)).Fused = i
	(*Mp_int)(unsafe.Pointer(a)).Fsign = MP_ZPOS
	for ok := true; ok; ok = 0 != 0 {
		var zd_ int32 = (*Mp_int)(unsafe.Pointer(a)).Falloc - (*Mp_int)(unsafe.Pointer(a)).Fused
		var zm_ uintptr = (*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr((*Mp_int)(unsafe.Pointer(a)).Fused)*4
		for libc.PostDecInt32(&zd_, 1) > 0 {
			*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&zm_, 4))) = Mp_digit(0)
		}
	}
}

func XTclBN_mp_get_mag_ull(tls *libc.TLS, a uintptr) Tcl_WideUInt { /* tclStubInit.c:75:1: */
	var i uint32 = func() uint32 {
		if uint32((*Mp_int)(unsafe.Pointer(a)).Fused) < uint32((uint64(8)*Size_t(unsafe.Sizeof(Tcl_WideUInt(0)))+uint64(MP_DIGIT_BIT)-uint64(1))/uint64(MP_DIGIT_BIT)) {
			return uint32((*Mp_int)(unsafe.Pointer(a)).Fused)
		}
		return uint32((uint64(8)*Size_t(unsafe.Sizeof(Tcl_WideUInt(0))) + uint64(MP_DIGIT_BIT) - uint64(1)) / uint64(MP_DIGIT_BIT))
	}()
	var res Tcl_WideUInt = uint64(0)
	for libc.PostDecUint32(&i, 1) > 0 {
		res <<= func() int32 {
			if uint64(8)*Size_t(unsafe.Sizeof(Tcl_WideUInt(0))) <= uint64(MP_DIGIT_BIT) {
				return 0
			}
			return MP_DIGIT_BIT
		}()
		res = res | Tcl_WideUInt(*(*Mp_digit)(unsafe.Pointer((*Mp_int)(unsafe.Pointer(a)).Fdp + uintptr(i)*4)))
		if uint64(8)*Size_t(unsafe.Sizeof(Tcl_WideUInt(0))) <= uint64(MP_DIGIT_BIT) {
			break
		}
	}
	return res
}

func XTclBN_mp_set_ll(tls *libc.TLS, a uintptr, b Tcl_WideInt) { /* tclStubInit.c:76:1: */
	XTclBN_mp_set_ull(tls, a, func() uint64 {
		if b < int64(0) {
			return -Tcl_WideUInt(b)
		}
		return Tcl_WideUInt(b)
	}())
	if b < int64(0) {
		(*Mp_int)(unsafe.Pointer(a)).Fsign = MP_NEG
	}
}

func XTclBN_mp_set_int(tls *libc.TLS, a uintptr, i uint64) Mp_err { /* tclStubInit.c:79:8: */
	XTclBN_mp_set_ull(tls, a, i)
	return MP_OKAY
}

func XTclBN_mp_init_set_int(tls *libc.TLS, a uintptr, i uint64) Mp_err { /* tclStubInit.c:85:8: */
	var result Mp_err = XTclBN_mp_init(tls, a)
	if result == MP_OKAY {
		XTclBN_mp_set_ull(tls, a, i)
	}
	return result
}

func XTclBN_mp_expt_d_ex(tls *libc.TLS, a uintptr, b Mp_digit, c uintptr, fast int32) int32 { /* tclStubInit.c:94:5: */
	return XTclBN_mp_expt_d(tls, a, b, c)
}

func sTclBNMpDivLd(tls *libc.TLS, a uintptr, b Tcl_WideUInt, c uintptr, d uintptr) Mp_err { /* tclStubInit.c:100:15: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var result Mp_err
	// var d2 Mp_digit at bp, 4

	if b|libc.Uint64FromUint32(libc.Uint32FromInt32(-1)) != libc.Uint64FromUint32(libc.Uint32FromInt32(-1)) {
		return -3
	}
	result = XTclBN_mp_div_d(tls, a, Mp_digit(b), c, func() uintptr {
		if d != 0 {
			return bp
		}
		return uintptr(0)
	}())
	if d != 0 {
		*(*Tcl_WideUInt)(unsafe.Pointer(d)) = Tcl_WideUInt(*(*Mp_digit)(unsafe.Pointer(bp /* d2 */)))
	}
	return result
}

func setStartupScriptPath(tls *libc.TLS, path uintptr) { /* tclStubInit.c:115:13: */
	XTcl_SetStartupScript(tls, path, uintptr(0))
}

func getStartupScriptPath(tls *libc.TLS) uintptr { /* tclStubInit.c:120:16: */
	return XTcl_GetStartupScript(tls, uintptr(0))
}

func setStartupScriptFileName(tls *libc.TLS, fileName uintptr) { /* tclStubInit.c:125:13: */
	XTcl_SetStartupScript(tls, XTcl_NewStringObj(tls, fileName, -1), uintptr(0))
}

func getStartupScriptFileName(tls *libc.TLS) uintptr { /* tclStubInit.c:131:19: */
	var path uintptr = XTcl_GetStartupScript(tls, uintptr(0))
	if path == uintptr(0) {
		return uintptr(0)
	}
	return XTcl_GetString(tls, path)
}

func XTclBN_mp_to_unsigned_bin(tls *libc.TLS, a uintptr, b uintptr) Mp_err { /* tclStubInit.c:448:8: */
	return XTclBN_mp_to_ubin(tls, a, b, uint64(0x7fffffff), uintptr(0))
}

func XTclBN_mp_to_unsigned_bin_n(tls *libc.TLS, a uintptr, b uintptr, outlen uintptr) Mp_err { /* tclStubInit.c:453:8: */
	var n Size_t = XTclBN_mp_unsigned_bin_size(tls, a)
	if *(*uint64)(unsafe.Pointer(outlen)) < n {
		return -3
	}
	*(*uint64)(unsafe.Pointer(outlen)) = n
	return XTclBN_mp_to_ubin(tls, a, b, n, uintptr(0))
}

func XTclBN_mp_toradix_n(tls *libc.TLS, a uintptr, str uintptr, radix int32, maxlen int32) Mp_err { /* tclStubInit.c:463:8: */
	if maxlen < 0 {
		return -3
	}
	return XTclBN_mp_to_radix(tls, a, str, uint64(maxlen), uintptr(0), radix)
}

func XTclBN_reverse(tls *libc.TLS, s uintptr, len int32) { /* tclStubInit.c:471:6: */
	if len > 0 {
		XTclBN_s_mp_reverse(tls, s, Size_t(len))
	}
}

// !BEGIN!: Do not edit below this line.

var tclIntStubs = TclIntStubs{
	Fmagic:                        libc.Int32FromUint32(0xFCA3BACF),
	FtclAllocateFreeObjects:       0, // 4
	FtclCleanupChildren:           0, // 5
	FtclCleanupCommand:            0, // 6
	FtclCopyAndCollapse:           0, // 7
	FtclCopyChannelOld:            0, // 8
	FtclCreatePipeline:            0, // 9
	FtclCreateProc:                0, // 10
	FtclDeleteCompiledLocalVars:   0, // 11
	FtclDeleteVars:                0, // 13
	FtclDumpMemoryInfo:            0, // 15
	FtclExprFloatError:            0, // 21
	FtclFindElement:               0, // 22
	FtclFindProc:                  0, // 23
	FtclFormatInt:                 0, // 24
	FtclFreePackageInfo:           0, // 27
	FtclpGetDefaultStdChannel:     0, // 30
	FtclGetExtension:              0, // 31
	FtclGetFrame:                  0, // 33
	FtclGetIntForIndex:            0, // 36
	FtclGetLoadedPackages:         0, // 37
	FtclGetNamespaceForQualName:   0, // 38
	FtclGetObjInterpProc:          0, // 39
	FtclGetOpenMode:               0, // 40
	FtclGetOriginalCommand:        0, // 41
	FtclpGetUserHome:              0, // 43
	FtclGuessPackageName:          0, // 44
	FtclHideUnsafeCommands:        0, // 45
	FtclInExit:                    0, // 49
	FtclInitCompiledLocals:        0, // 50
	FtclInterpInit:                0, // 52
	FtclInvokeObjectCommand:       0, // 53
	FtclInvokeStringCommand:       0, // 54
	FtclIsProc:                    0, // 57
	FtclLookupVar:                 0, // 59
	FtclNeedSpace:                 0, // 60
	FtclNewProcBodyObj:            0, // 61
	FtclObjCommandComplete:        0, // 62
	FtclObjInterpProc:             0, // 63
	FtclObjInvoke:                 0, // 68
	FtclpAlloc:                    0, // 73
	FtclpFree:                     0, // 74
	FtclpGetClicks:                0, // 75
	FtclpGetSeconds:               0, // 76
	FtclpGetTime:                  0, // 80
	FtclpRealloc:                  0, // 87
	FtclPrecTraceProc:             0, // 88
	FtclPreventAliasLoop:          0, // 90
	FtclProcCleanupProc:           0, // 91
	FtclProcCompileProc:           0, // 92
	FtclProcDeleteProc:            0, // 95
	FtclRenameCommand:             0, // 96
	FtclResetShadowedCmdRefs:      0, // 97
	FtclServiceIdle:               0, // 100
	FtclSetPreInitScript:          0, // 101
	FtclSetupEnv:                  0, // 102
	FtclSockGetPort:               0, // 103
	FtclSockMinimumBuffersOld:     0, // 107
	FtclTeardownNamespace:         0, // 108
	FtclUpdateReturnInfo:          0, // 109
	FtclSockMinimumBuffers:        0, // 110
	Ftcl_AddInterpResolvers:       0, // 111
	Ftcl_AppendExportList:         0, // 112
	Ftcl_CreateNamespace:          0, // 113
	Ftcl_DeleteNamespace:          0, // 114
	Ftcl_Export:                   0, // 115
	Ftcl_FindCommand:              0, // 116
	Ftcl_FindNamespace:            0, // 117
	Ftcl_GetInterpResolvers:       0, // 118
	Ftcl_GetNamespaceResolvers:    0, // 119
	Ftcl_FindNamespaceVar:         0, // 120
	Ftcl_ForgetImport:             0, // 121
	Ftcl_GetCommandFromObj:        0, // 122
	Ftcl_GetCommandFullName:       0, // 123
	Ftcl_GetCurrentNamespace:      0, // 124
	Ftcl_GetGlobalNamespace:       0, // 125
	Ftcl_GetVariableFullName:      0, // 126
	Ftcl_Import:                   0, // 127
	Ftcl_PopCallFrame:             0, // 128
	Ftcl_PushCallFrame:            0, // 129
	Ftcl_RemoveInterpResolvers:    0, // 130
	Ftcl_SetNamespaceResolvers:    0, // 131
	FtclpHasSockets:               0, // 132
	FtclpGetDate:                  0, // 137
	FtclGetEnv:                    0, // 140
	FtclpGetCwd:                   0, // 141
	FtclSetByteCodeFromAny:        0, // 142
	FtclAddLiteralObj:             0, // 143
	FtclHideLiteral:               0, // 144
	FtclGetAuxDataType:            0, // 145
	FtclHandleCreate:              0, // 146
	FtclHandleFree:                0, // 147
	FtclHandlePreserve:            0, // 148
	FtclHandleRelease:             0, // 149
	FtclRegAbout:                  0, // 150
	FtclRegExpRangeUniChar:        0, // 151
	FtclSetLibraryPath:            0, // 152
	FtclGetLibraryPath:            0, // 155
	FtclRegError:                  0, // 156
	FtclVarTraceExists:            0, // 157
	FtclSetStartupScriptFileName:  0, // 158
	FtclGetStartupScriptFileName:  0, // 160
	FtclChannelTransform:          0, // 161
	FtclChannelEventScriptInvoker: 0, // 162
	FtclGetInstructionTable:       0, // 163
	FtclExpandCodeArray:           0, // 164
	FtclpSetInitialEncodings:      0, // 165
	FtclListObjSetElement:         0, // 166
	FtclSetStartupScriptPath:      0, // 167
	FtclGetStartupScriptPath:      0, // 168
	FtclpUtfNcmp2:                 0, // 169
	FtclCheckInterpTraces:         0, // 170
	FtclCheckExecutionTraces:      0, // 171
	FtclInThreadExit:              0, // 172
	FtclUniCharMatch:              0, // 174
	FtclCallVarTraces:             0, // 175
	FtclCleanupVar:                0, // 176
	FtclVarErrMsg:                 0, // 177
	Ftcl_SetStartupScript:         0, // 178
	Ftcl_GetStartupScript:         0, // 181
	FtclpLocaltime:                0, // 182
	FtclpGmtime:                   0, // 197
	FtclObjGetFrame:               0, // 199
	FtclpObjRemoveDirectory:       0, // 200
	FtclpObjCopyDirectory:         0, // 201
	FtclpObjCreateDirectory:       0, // 202
	FtclpObjDeleteFile:            0, // 203
	FtclpObjCopyFile:              0, // 204
	FtclpObjRenameFile:            0, // 205
	FtclpObjStat:                  0, // 206
	FtclpObjAccess:                0, // 207
	FtclpOpenFileChannel:          0, // 211
	FtclpFindExecutable:           0, // 212
	FtclGetObjNameOfExecutable:    0, // 213
	FtclSetObjNameOfExecutable:    0, // 214
	FtclStackAlloc:                0, // 215
	FtclStackFree:                 0, // 216
	FtclPushStackFrame:            0, // 217
	FtclPopStackFrame:             0, // 223
	FtclGetPlatform:               0, // 224
	FtclTraceDictPath:             0, // 225
	FtclObjBeingDeleted:           0, // 226
	FtclSetNsPath:                 0, // 228
	FtclPtrMakeUpvar:              0, // 229
	FtclObjLookupVar:              0, // 230
	FtclGetNamespaceFromObj:       0, // 231
	FtclEvalObjEx:                 0, // 232
	FtclGetSrcInfoForPc:           0, // 233
	FtclVarHashCreateVar:          0, // 234
	FtclInitVarHashTable:          0, // 235
	FtclBackgroundException:       0, // 236
	FtclResetCancellation:         0, // 237
	FtclNRInterpProc:              0, // 238
	FtclNRInterpProcCore:          0, // 239
	FtclNRRunCallbacks:            0, // 240
	FtclNREvalObjEx:               0, // 241
	FtclNREvalObjv:                0, // 242
	FtclDbDumpActiveObjects:       0, // 243
	FtclGetNamespaceChildTable:    0, // 244
	FtclGetNamespaceCommandTable:  0, // 245
	FtclInitRewriteEnsemble:       0, // 246
	FtclResetRewriteEnsemble:      0, // 247
	FtclCopyChannel:               0, // 248
	FtclDoubleDigits:              0, // 249
	FtclSetSlaveCancelFlags:       0, // 250
	FtclRegisterLiteral:           0, // 251
	FtclPtrGetVar:                 0, // 252
	FtclPtrSetVar:                 0, // 253
	FtclPtrIncrObjVar:             0, // 254
	FtclPtrObjMakeUpvar:           0, // 255
	FtclPtrUnsetVar:               0, // 256
	FtclStaticPackage:             0, // 260
} /* tclStubInit.c:489:26 */

var tclIntPlatStubs = TclIntPlatStubs{
	Fmagic:                           libc.Int32FromUint32(0xFCA3BACF),
	FtclGetAndDetachPids:             0, // 0
	FtclpCloseFile:                   0, // 1
	FtclpCreateCommandChannel:        0, // 2
	FtclpCreatePipe:                  0, // 3
	FtclpCreateProcess:               0, // 4
	FtclUnixWaitForFile_:             0, // 5
	FtclpMakeFile:                    0, // 6
	FtclpOpenFile:                    0, // 7
	FtclUnixWaitForFile:              0, // 8
	FtclpCreateTempFile:              0, // 9
	FtclpReaddir:                     0, // 10
	FtclpLocaltime_unix:              0, // 11
	FtclpGmtime_unix:                 0, // 12
	FtclpInetNtoa:                    0, // 13
	FtclUnixCopyFile:                 0, // 14
	FtclMacOSXGetFileAttribute:       0, // 15
	FtclMacOSXSetFileAttribute:       0, // 16
	FtclMacOSXCopyFileAttributes:     0, // 17
	FtclMacOSXMatchType:              0, // 18
	FtclMacOSXNotifierAddRunLoopMode: 0, // 21
	FtclpCreateTempFile_:             0, // 28
	FtclWinCPUID:                     0, // 29
	FtclUnixOpenTemporaryFile:        0, // 30
} /* tclStubInit.c:755:30 */

var tclPlatStubs = TclPlatStubs{
	Fmagic: libc.Int32FromUint32(0xFCA3BACF),
} /* tclStubInit.c:859:27 */

var XtclTomMathStubs = TclTomMathStubs{
	Fmagic:                       libc.Int32FromUint32(0xFCA3BACF),
	FtclBN_epoch:                 0, // 0
	FtclBN_revision:              0, // 1
	FtclBN_mp_add:                0, // 2
	FtclBN_mp_add_d:              0, // 3
	FtclBN_mp_and:                0, // 4
	FtclBN_mp_clamp:              0, // 5
	FtclBN_mp_clear:              0, // 6
	FtclBN_mp_clear_multi:        0, // 7
	FtclBN_mp_cmp:                0, // 8
	FtclBN_mp_cmp_d:              0, // 9
	FtclBN_mp_cmp_mag:            0, // 10
	FtclBN_mp_copy:               0, // 11
	FtclBN_mp_count_bits:         0, // 12
	FtclBN_mp_div:                0, // 13
	FtclBN_mp_div_d:              0, // 14
	FtclBN_mp_div_2:              0, // 15
	FtclBN_mp_div_2d:             0, // 16
	FtclBN_mp_div_3:              0, // 17
	FtclBN_mp_exch:               0, // 18
	FtclBN_mp_expt_d:             0, // 19
	FtclBN_mp_grow:               0, // 20
	FtclBN_mp_init:               0, // 21
	FtclBN_mp_init_copy:          0, // 22
	FtclBN_mp_init_multi:         0, // 23
	FtclBN_mp_init_set:           0, // 24
	FtclBN_mp_init_size:          0, // 25
	FtclBN_mp_lshd:               0, // 26
	FtclBN_mp_mod:                0, // 27
	FtclBN_mp_mod_2d:             0, // 28
	FtclBN_mp_mul:                0, // 29
	FtclBN_mp_mul_d:              0, // 30
	FtclBN_mp_mul_2:              0, // 31
	FtclBN_mp_mul_2d:             0, // 32
	FtclBN_mp_neg:                0, // 33
	FtclBN_mp_or:                 0, // 34
	FtclBN_mp_radix_size:         0, // 35
	FtclBN_mp_read_radix:         0, // 36
	FtclBN_mp_rshd:               0, // 37
	FtclBN_mp_shrink:             0, // 38
	FtclBN_mp_set:                0, // 39
	FtclBN_mp_sqr:                0, // 40
	FtclBN_mp_sqrt:               0, // 41
	FtclBN_mp_sub:                0, // 42
	FtclBN_mp_sub_d:              0, // 43
	FtclBN_mp_to_unsigned_bin:    0, // 44
	FtclBN_mp_to_unsigned_bin_n:  0, // 45
	FtclBN_mp_toradix_n:          0, // 46
	FtclBN_mp_unsigned_bin_size:  0, // 47
	FtclBN_mp_xor:                0, // 48
	FtclBN_mp_zero:               0, // 49
	FtclBN_reverse:               0, // 50
	FtclBN_fast_s_mp_mul_digs:    0, // 51
	FtclBN_fast_s_mp_sqr:         0, // 52
	FtclBN_mp_karatsuba_mul:      0, // 53
	FtclBN_mp_karatsuba_sqr:      0, // 54
	FtclBN_mp_toom_mul:           0, // 55
	FtclBN_mp_toom_sqr:           0, // 56
	FtclBN_s_mp_add:              0, // 57
	FtclBN_s_mp_mul_digs:         0, // 58
	FtclBN_s_mp_sqr:              0, // 59
	FtclBN_s_mp_sub:              0, // 60
	FtclBN_mp_init_set_int:       0, // 61
	FtclBN_mp_set_int:            0, // 62
	FtclBN_mp_cnt_lsb:            0, // 63
	FtclBNInitBignumFromLong:     0, // 64
	FtclBNInitBignumFromWideInt:  0, // 65
	FtclBNInitBignumFromWideUInt: 0, // 66
	FtclBN_mp_expt_d_ex:          0, // 67
	FtclBN_mp_set_ull:            0, // 68
	FtclBN_mp_get_mag_ull:        0, // 69
	FtclBN_mp_set_ll:             0, // 72
	FtclBN_mp_tc_and:             0, // 73
	FtclBN_mp_tc_or:              0, // 74
	FtclBN_mp_tc_xor:             0, // 75
	FtclBN_mp_signed_rsh:         0, // 77
	FtclBN_mp_to_ubin:            0, // 78
	FtclBN_mp_div_ld:             0, // 79
	FtclBN_mp_to_radix:           0, // 80
} /* tclStubInit.c:873:23 */

var tclStubHooks = TclStubHooks{
	FtclPlatStubs:    0,
	FtclIntStubs:     0,
	FtclIntPlatStubs: 0,
} /* tclStubInit.c:959:27 */

var XtclStubs = TclStubs{
	Fmagic:                                  libc.Int32FromUint32(0xFCA3BACF),
	Fhooks:                                  0,
	Ftcl_PkgProvideEx:                       0, // 0
	Ftcl_PkgRequireEx:                       0, // 1
	Ftcl_Panic:                              0, // 2
	Ftcl_Alloc:                              0, // 3
	Ftcl_Free:                               0, // 4
	Ftcl_Realloc:                            0, // 5
	Ftcl_DbCkalloc:                          0, // 6
	Ftcl_DbCkfree:                           0, // 7
	Ftcl_DbCkrealloc:                        0, // 8
	Ftcl_CreateFileHandler:                  0, // 9
	Ftcl_DeleteFileHandler:                  0, // 10
	Ftcl_SetTimer:                           0, // 11
	Ftcl_Sleep:                              0, // 12
	Ftcl_WaitForEvent:                       0, // 13
	Ftcl_AppendAllObjTypes:                  0, // 14
	Ftcl_AppendStringsToObj:                 0, // 15
	Ftcl_AppendToObj:                        0, // 16
	Ftcl_ConcatObj:                          0, // 17
	Ftcl_ConvertToType:                      0, // 18
	Ftcl_DbDecrRefCount:                     0, // 19
	Ftcl_DbIncrRefCount:                     0, // 20
	Ftcl_DbIsShared:                         0, // 21
	Ftcl_DbNewBooleanObj:                    0, // 22
	Ftcl_DbNewByteArrayObj:                  0, // 23
	Ftcl_DbNewDoubleObj:                     0, // 24
	Ftcl_DbNewListObj:                       0, // 25
	Ftcl_DbNewLongObj:                       0, // 26
	Ftcl_DbNewObj:                           0, // 27
	Ftcl_DbNewStringObj:                     0, // 28
	Ftcl_DuplicateObj:                       0, // 29
	FtclFreeObj:                             0, // 30
	Ftcl_GetBoolean:                         0, // 31
	Ftcl_GetBooleanFromObj:                  0, // 32
	Ftcl_GetByteArrayFromObj:                0, // 33
	Ftcl_GetDouble:                          0, // 34
	Ftcl_GetDoubleFromObj:                   0, // 35
	Ftcl_GetIndexFromObj:                    0, // 36
	Ftcl_GetInt:                             0, // 37
	Ftcl_GetIntFromObj:                      0, // 38
	Ftcl_GetLongFromObj:                     0, // 39
	Ftcl_GetObjType:                         0, // 40
	Ftcl_GetStringFromObj:                   0, // 41
	Ftcl_InvalidateStringRep:                0, // 42
	Ftcl_ListObjAppendList:                  0, // 43
	Ftcl_ListObjAppendElement:               0, // 44
	Ftcl_ListObjGetElements:                 0, // 45
	Ftcl_ListObjIndex:                       0, // 46
	Ftcl_ListObjLength:                      0, // 47
	Ftcl_ListObjReplace:                     0, // 48
	Ftcl_NewBooleanObj:                      0, // 49
	Ftcl_NewByteArrayObj:                    0, // 50
	Ftcl_NewDoubleObj:                       0, // 51
	Ftcl_NewIntObj:                          0, // 52
	Ftcl_NewListObj:                         0, // 53
	Ftcl_NewLongObj:                         0, // 54
	Ftcl_NewObj:                             0, // 55
	Ftcl_NewStringObj:                       0, // 56
	Ftcl_SetBooleanObj:                      0, // 57
	Ftcl_SetByteArrayLength:                 0, // 58
	Ftcl_SetByteArrayObj:                    0, // 59
	Ftcl_SetDoubleObj:                       0, // 60
	Ftcl_SetIntObj:                          0, // 61
	Ftcl_SetListObj:                         0, // 62
	Ftcl_SetLongObj:                         0, // 63
	Ftcl_SetObjLength:                       0, // 64
	Ftcl_SetStringObj:                       0, // 65
	Ftcl_AddErrorInfo:                       0, // 66
	Ftcl_AddObjErrorInfo:                    0, // 67
	Ftcl_AllowExceptions:                    0, // 68
	Ftcl_AppendElement:                      0, // 69
	Ftcl_AppendResult:                       0, // 70
	Ftcl_AsyncCreate:                        0, // 71
	Ftcl_AsyncDelete:                        0, // 72
	Ftcl_AsyncInvoke:                        0, // 73
	Ftcl_AsyncMark:                          0, // 74
	Ftcl_AsyncReady:                         0, // 75
	Ftcl_BackgroundError:                    0, // 76
	Ftcl_Backslash:                          0, // 77
	Ftcl_BadChannelOption:                   0, // 78
	Ftcl_CallWhenDeleted:                    0, // 79
	Ftcl_CancelIdleCall:                     0, // 80
	Ftcl_Close:                              0, // 81
	Ftcl_CommandComplete:                    0, // 82
	Ftcl_Concat:                             0, // 83
	Ftcl_ConvertElement:                     0, // 84
	Ftcl_ConvertCountedElement:              0, // 85
	Ftcl_CreateAlias:                        0, // 86
	Ftcl_CreateAliasObj:                     0, // 87
	Ftcl_CreateChannel:                      0, // 88
	Ftcl_CreateChannelHandler:               0, // 89
	Ftcl_CreateCloseHandler:                 0, // 90
	Ftcl_CreateCommand:                      0, // 91
	Ftcl_CreateEventSource:                  0, // 92
	Ftcl_CreateExitHandler:                  0, // 93
	Ftcl_CreateInterp:                       0, // 94
	Ftcl_CreateMathFunc:                     0, // 95
	Ftcl_CreateObjCommand:                   0, // 96
	Ftcl_CreateSlave:                        0, // 97
	Ftcl_CreateTimerHandler:                 0, // 98
	Ftcl_CreateTrace:                        0, // 99
	Ftcl_DeleteAssocData:                    0, // 100
	Ftcl_DeleteChannelHandler:               0, // 101
	Ftcl_DeleteCloseHandler:                 0, // 102
	Ftcl_DeleteCommand:                      0, // 103
	Ftcl_DeleteCommandFromToken:             0, // 104
	Ftcl_DeleteEvents:                       0, // 105
	Ftcl_DeleteEventSource:                  0, // 106
	Ftcl_DeleteExitHandler:                  0, // 107
	Ftcl_DeleteHashEntry:                    0, // 108
	Ftcl_DeleteHashTable:                    0, // 109
	Ftcl_DeleteInterp:                       0, // 110
	Ftcl_DetachPids:                         0, // 111
	Ftcl_DeleteTimerHandler:                 0, // 112
	Ftcl_DeleteTrace:                        0, // 113
	Ftcl_DontCallWhenDeleted:                0, // 114
	Ftcl_DoOneEvent:                         0, // 115
	Ftcl_DoWhenIdle:                         0, // 116
	Ftcl_DStringAppend:                      0, // 117
	Ftcl_DStringAppendElement:               0, // 118
	Ftcl_DStringEndSublist:                  0, // 119
	Ftcl_DStringFree:                        0, // 120
	Ftcl_DStringGetResult:                   0, // 121
	Ftcl_DStringInit:                        0, // 122
	Ftcl_DStringResult:                      0, // 123
	Ftcl_DStringSetLength:                   0, // 124
	Ftcl_DStringStartSublist:                0, // 125
	Ftcl_Eof:                                0, // 126
	Ftcl_ErrnoId:                            0, // 127
	Ftcl_ErrnoMsg:                           0, // 128
	Ftcl_Eval:                               0, // 129
	Ftcl_EvalFile:                           0, // 130
	Ftcl_EvalObj:                            0, // 131
	Ftcl_EventuallyFree:                     0, // 132
	Ftcl_Exit:                               0, // 133
	Ftcl_ExposeCommand:                      0, // 134
	Ftcl_ExprBoolean:                        0, // 135
	Ftcl_ExprBooleanObj:                     0, // 136
	Ftcl_ExprDouble:                         0, // 137
	Ftcl_ExprDoubleObj:                      0, // 138
	Ftcl_ExprLong:                           0, // 139
	Ftcl_ExprLongObj:                        0, // 140
	Ftcl_ExprObj:                            0, // 141
	Ftcl_ExprString:                         0, // 142
	Ftcl_Finalize:                           0, // 143
	Ftcl_FindExecutable:                     0, // 144
	Ftcl_FirstHashEntry:                     0, // 145
	Ftcl_Flush:                              0, // 146
	Ftcl_FreeResult:                         0, // 147
	Ftcl_GetAlias:                           0, // 148
	Ftcl_GetAliasObj:                        0, // 149
	Ftcl_GetAssocData:                       0, // 150
	Ftcl_GetChannel:                         0, // 151
	Ftcl_GetChannelBufferSize:               0, // 152
	Ftcl_GetChannelHandle:                   0, // 153
	Ftcl_GetChannelInstanceData:             0, // 154
	Ftcl_GetChannelMode:                     0, // 155
	Ftcl_GetChannelName:                     0, // 156
	Ftcl_GetChannelOption:                   0, // 157
	Ftcl_GetChannelType:                     0, // 158
	Ftcl_GetCommandInfo:                     0, // 159
	Ftcl_GetCommandName:                     0, // 160
	Ftcl_GetErrno:                           0, // 161
	Ftcl_GetHostName:                        0, // 162
	Ftcl_GetInterpPath:                      0, // 163
	Ftcl_GetMaster:                          0, // 164
	Ftcl_GetNameOfExecutable:                0, // 165
	Ftcl_GetObjResult:                       0, // 166
	Ftcl_GetOpenFile:                        0, // 167
	Ftcl_GetPathType:                        0, // 168
	Ftcl_Gets:                               0, // 169
	Ftcl_GetsObj:                            0, // 170
	Ftcl_GetServiceMode:                     0, // 171
	Ftcl_GetSlave:                           0, // 172
	Ftcl_GetStdChannel:                      0, // 173
	Ftcl_GetStringResult:                    0, // 174
	Ftcl_GetVar:                             0, // 175
	Ftcl_GetVar2:                            0, // 176
	Ftcl_GlobalEval:                         0, // 177
	Ftcl_GlobalEvalObj:                      0, // 178
	Ftcl_HideCommand:                        0, // 179
	Ftcl_Init:                               0, // 180
	Ftcl_InitHashTable:                      0, // 181
	Ftcl_InputBlocked:                       0, // 182
	Ftcl_InputBuffered:                      0, // 183
	Ftcl_InterpDeleted:                      0, // 184
	Ftcl_IsSafe:                             0, // 185
	Ftcl_JoinPath:                           0, // 186
	Ftcl_LinkVar:                            0, // 188
	Ftcl_MakeFileChannel:                    0, // 189
	Ftcl_MakeSafe:                           0, // 190
	Ftcl_MakeTcpClientChannel:               0, // 191
	Ftcl_Merge:                              0, // 192
	Ftcl_NextHashEntry:                      0, // 193
	Ftcl_NotifyChannel:                      0, // 194
	Ftcl_ObjGetVar2:                         0, // 195
	Ftcl_ObjSetVar2:                         0, // 196
	Ftcl_OpenCommandChannel:                 0, // 197
	Ftcl_OpenFileChannel:                    0, // 198
	Ftcl_OpenTcpClient:                      0, // 199
	Ftcl_OpenTcpServer:                      0, // 200
	Ftcl_Preserve:                           0, // 201
	Ftcl_PrintDouble:                        0, // 202
	Ftcl_PutEnv:                             0, // 203
	Ftcl_PosixError:                         0, // 204
	Ftcl_QueueEvent:                         0, // 205
	Ftcl_Read:                               0, // 206
	Ftcl_ReapDetachedProcs:                  0, // 207
	Ftcl_RecordAndEval:                      0, // 208
	Ftcl_RecordAndEvalObj:                   0, // 209
	Ftcl_RegisterChannel:                    0, // 210
	Ftcl_RegisterObjType:                    0, // 211
	Ftcl_RegExpCompile:                      0, // 212
	Ftcl_RegExpExec:                         0, // 213
	Ftcl_RegExpMatch:                        0, // 214
	Ftcl_RegExpRange:                        0, // 215
	Ftcl_Release:                            0, // 216
	Ftcl_ResetResult:                        0, // 217
	Ftcl_ScanElement:                        0, // 218
	Ftcl_ScanCountedElement:                 0, // 219
	Ftcl_SeekOld:                            0, // 220
	Ftcl_ServiceAll:                         0, // 221
	Ftcl_ServiceEvent:                       0, // 222
	Ftcl_SetAssocData:                       0, // 223
	Ftcl_SetChannelBufferSize:               0, // 224
	Ftcl_SetChannelOption:                   0, // 225
	Ftcl_SetCommandInfo:                     0, // 226
	Ftcl_SetErrno:                           0, // 227
	Ftcl_SetErrorCode:                       0, // 228
	Ftcl_SetMaxBlockTime:                    0, // 229
	Ftcl_SetPanicProc:                       0, // 230
	Ftcl_SetRecursionLimit:                  0, // 231
	Ftcl_SetResult:                          0, // 232
	Ftcl_SetServiceMode:                     0, // 233
	Ftcl_SetObjErrorCode:                    0, // 234
	Ftcl_SetObjResult:                       0, // 235
	Ftcl_SetStdChannel:                      0, // 236
	Ftcl_SetVar:                             0, // 237
	Ftcl_SetVar2:                            0, // 238
	Ftcl_SignalId:                           0, // 239
	Ftcl_SignalMsg:                          0, // 240
	Ftcl_SourceRCFile:                       0, // 241
	Ftcl_SplitList:                          0, // 242
	Ftcl_SplitPath:                          0, // 243
	Ftcl_StaticPackage:                      0, // 244
	Ftcl_StringMatch:                        0, // 245
	Ftcl_TellOld:                            0, // 246
	Ftcl_TraceVar:                           0, // 247
	Ftcl_TraceVar2:                          0, // 248
	Ftcl_TranslateFileName:                  0, // 249
	Ftcl_Ungets:                             0, // 250
	Ftcl_UnlinkVar:                          0, // 251
	Ftcl_UnregisterChannel:                  0, // 252
	Ftcl_UnsetVar:                           0, // 253
	Ftcl_UnsetVar2:                          0, // 254
	Ftcl_UntraceVar:                         0, // 255
	Ftcl_UntraceVar2:                        0, // 256
	Ftcl_UpdateLinkedVar:                    0, // 257
	Ftcl_UpVar:                              0, // 258
	Ftcl_UpVar2:                             0, // 259
	Ftcl_VarEval:                            0, // 260
	Ftcl_VarTraceInfo:                       0, // 261
	Ftcl_VarTraceInfo2:                      0, // 262
	Ftcl_Write:                              0, // 263
	Ftcl_WrongNumArgs:                       0, // 264
	Ftcl_DumpActiveMemory:                   0, // 265
	Ftcl_ValidateAllMemory:                  0, // 266
	Ftcl_AppendResultVA:                     0, // 267
	Ftcl_AppendStringsToObjVA:               0, // 268
	Ftcl_HashStats:                          0, // 269
	Ftcl_ParseVar:                           0, // 270
	Ftcl_PkgPresent:                         0, // 271
	Ftcl_PkgPresentEx:                       0, // 272
	Ftcl_PkgProvide:                         0, // 273
	Ftcl_PkgRequire:                         0, // 274
	Ftcl_SetErrorCodeVA:                     0, // 275
	Ftcl_VarEvalVA:                          0, // 276
	Ftcl_WaitPid:                            0, // 277
	Ftcl_PanicVA:                            0, // 278
	Ftcl_GetVersion:                         0, // 279
	Ftcl_InitMemory:                         0, // 280
	Ftcl_StackChannel:                       0, // 281
	Ftcl_UnstackChannel:                     0, // 282
	Ftcl_GetStackedChannel:                  0, // 283
	Ftcl_SetMainLoop:                        0, // 285
	Ftcl_AppendObjToObj:                     0, // 286
	Ftcl_CreateEncoding:                     0, // 287
	Ftcl_CreateThreadExitHandler:            0, // 288
	Ftcl_DeleteThreadExitHandler:            0, // 289
	Ftcl_DiscardResult:                      0, // 290
	Ftcl_EvalEx:                             0, // 291
	Ftcl_EvalObjv:                           0, // 292
	Ftcl_EvalObjEx:                          0, // 293
	Ftcl_ExitThread:                         0, // 294
	Ftcl_ExternalToUtf:                      0, // 295
	Ftcl_ExternalToUtfDString:               0, // 296
	Ftcl_FinalizeThread:                     0, // 297
	Ftcl_FinalizeNotifier:                   0, // 298
	Ftcl_FreeEncoding:                       0, // 299
	Ftcl_GetCurrentThread:                   0, // 300
	Ftcl_GetEncoding:                        0, // 301
	Ftcl_GetEncodingName:                    0, // 302
	Ftcl_GetEncodingNames:                   0, // 303
	Ftcl_GetIndexFromObjStruct:              0, // 304
	Ftcl_GetThreadData:                      0, // 305
	Ftcl_GetVar2Ex:                          0, // 306
	Ftcl_InitNotifier:                       0, // 307
	Ftcl_MutexLock:                          0, // 308
	Ftcl_MutexUnlock:                        0, // 309
	Ftcl_ConditionNotify:                    0, // 310
	Ftcl_ConditionWait:                      0, // 311
	Ftcl_NumUtfChars:                        0, // 312
	Ftcl_ReadChars:                          0, // 313
	Ftcl_RestoreResult:                      0, // 314
	Ftcl_SaveResult:                         0, // 315
	Ftcl_SetSystemEncoding:                  0, // 316
	Ftcl_SetVar2Ex:                          0, // 317
	Ftcl_ThreadAlert:                        0, // 318
	Ftcl_ThreadQueueEvent:                   0, // 319
	Ftcl_UniCharAtIndex:                     0, // 320
	Ftcl_UniCharToLower:                     0, // 321
	Ftcl_UniCharToTitle:                     0, // 322
	Ftcl_UniCharToUpper:                     0, // 323
	Ftcl_UniCharToUtf:                       0, // 324
	Ftcl_UtfAtIndex:                         0, // 325
	Ftcl_UtfCharComplete:                    0, // 326
	Ftcl_UtfBackslash:                       0, // 327
	Ftcl_UtfFindFirst:                       0, // 328
	Ftcl_UtfFindLast:                        0, // 329
	Ftcl_UtfNext:                            0, // 330
	Ftcl_UtfPrev:                            0, // 331
	Ftcl_UtfToExternal:                      0, // 332
	Ftcl_UtfToExternalDString:               0, // 333
	Ftcl_UtfToLower:                         0, // 334
	Ftcl_UtfToTitle:                         0, // 335
	Ftcl_UtfToUniChar:                       0, // 336
	Ftcl_UtfToUpper:                         0, // 337
	Ftcl_WriteChars:                         0, // 338
	Ftcl_WriteObj:                           0, // 339
	Ftcl_GetString:                          0, // 340
	Ftcl_GetDefaultEncodingDir:              0, // 341
	Ftcl_SetDefaultEncodingDir:              0, // 342
	Ftcl_AlertNotifier:                      0, // 343
	Ftcl_ServiceModeHook:                    0, // 344
	Ftcl_UniCharIsAlnum:                     0, // 345
	Ftcl_UniCharIsAlpha:                     0, // 346
	Ftcl_UniCharIsDigit:                     0, // 347
	Ftcl_UniCharIsLower:                     0, // 348
	Ftcl_UniCharIsSpace:                     0, // 349
	Ftcl_UniCharIsUpper:                     0, // 350
	Ftcl_UniCharIsWordChar:                  0, // 351
	Ftcl_UniCharLen:                         0, // 352
	Ftcl_UniCharNcmp:                        0, // 353
	Ftcl_UniCharToUtfDString:                0, // 354
	Ftcl_UtfToUniCharDString:                0, // 355
	Ftcl_GetRegExpFromObj:                   0, // 356
	Ftcl_EvalTokens:                         0, // 357
	Ftcl_FreeParse:                          0, // 358
	Ftcl_LogCommandInfo:                     0, // 359
	Ftcl_ParseBraces:                        0, // 360
	Ftcl_ParseCommand:                       0, // 361
	Ftcl_ParseExpr:                          0, // 362
	Ftcl_ParseQuotedString:                  0, // 363
	Ftcl_ParseVarName:                       0, // 364
	Ftcl_GetCwd:                             0, // 365
	Ftcl_Chdir:                              0, // 366
	Ftcl_Access:                             0, // 367
	Ftcl_Stat:                               0, // 368
	Ftcl_UtfNcmp:                            0, // 369
	Ftcl_UtfNcasecmp:                        0, // 370
	Ftcl_StringCaseMatch:                    0, // 371
	Ftcl_UniCharIsControl:                   0, // 372
	Ftcl_UniCharIsGraph:                     0, // 373
	Ftcl_UniCharIsPrint:                     0, // 374
	Ftcl_UniCharIsPunct:                     0, // 375
	Ftcl_RegExpExecObj:                      0, // 376
	Ftcl_RegExpGetInfo:                      0, // 377
	Ftcl_NewUnicodeObj:                      0, // 378
	Ftcl_SetUnicodeObj:                      0, // 379
	Ftcl_GetCharLength:                      0, // 380
	Ftcl_GetUniChar:                         0, // 381
	Ftcl_GetUnicode:                         0, // 382
	Ftcl_GetRange:                           0, // 383
	Ftcl_AppendUnicodeToObj:                 0, // 384
	Ftcl_RegExpMatchObj:                     0, // 385
	Ftcl_SetNotifier:                        0, // 386
	Ftcl_GetAllocMutex:                      0, // 387
	Ftcl_GetChannelNames:                    0, // 388
	Ftcl_GetChannelNamesEx:                  0, // 389
	Ftcl_ProcObjCmd:                         0, // 390
	Ftcl_ConditionFinalize:                  0, // 391
	Ftcl_MutexFinalize:                      0, // 392
	Ftcl_CreateThread:                       0, // 393
	Ftcl_ReadRaw:                            0, // 394
	Ftcl_WriteRaw:                           0, // 395
	Ftcl_GetTopChannel:                      0, // 396
	Ftcl_ChannelBuffered:                    0, // 397
	Ftcl_ChannelName:                        0, // 398
	Ftcl_ChannelVersion:                     0, // 399
	Ftcl_ChannelBlockModeProc:               0, // 400
	Ftcl_ChannelCloseProc:                   0, // 401
	Ftcl_ChannelClose2Proc:                  0, // 402
	Ftcl_ChannelInputProc:                   0, // 403
	Ftcl_ChannelOutputProc:                  0, // 404
	Ftcl_ChannelSeekProc:                    0, // 405
	Ftcl_ChannelSetOptionProc:               0, // 406
	Ftcl_ChannelGetOptionProc:               0, // 407
	Ftcl_ChannelWatchProc:                   0, // 408
	Ftcl_ChannelGetHandleProc:               0, // 409
	Ftcl_ChannelFlushProc:                   0, // 410
	Ftcl_ChannelHandlerProc:                 0, // 411
	Ftcl_JoinThread:                         0, // 412
	Ftcl_IsChannelShared:                    0, // 413
	Ftcl_IsChannelRegistered:                0, // 414
	Ftcl_CutChannel:                         0, // 415
	Ftcl_SpliceChannel:                      0, // 416
	Ftcl_ClearChannelHandlers:               0, // 417
	Ftcl_IsChannelExisting:                  0, // 418
	Ftcl_UniCharNcasecmp:                    0, // 419
	Ftcl_UniCharCaseMatch:                   0, // 420
	Ftcl_FindHashEntry:                      0, // 421
	Ftcl_CreateHashEntry:                    0, // 422
	Ftcl_InitCustomHashTable:                0, // 423
	Ftcl_InitObjHashTable:                   0, // 424
	Ftcl_CommandTraceInfo:                   0, // 425
	Ftcl_TraceCommand:                       0, // 426
	Ftcl_UntraceCommand:                     0, // 427
	Ftcl_AttemptAlloc:                       0, // 428
	Ftcl_AttemptDbCkalloc:                   0, // 429
	Ftcl_AttemptRealloc:                     0, // 430
	Ftcl_AttemptDbCkrealloc:                 0, // 431
	Ftcl_AttemptSetObjLength:                0, // 432
	Ftcl_GetChannelThread:                   0, // 433
	Ftcl_GetUnicodeFromObj:                  0, // 434
	Ftcl_GetMathFuncInfo:                    0, // 435
	Ftcl_ListMathFuncs:                      0, // 436
	Ftcl_SubstObj:                           0, // 437
	Ftcl_DetachChannel:                      0, // 438
	Ftcl_IsStandardChannel:                  0, // 439
	Ftcl_FSCopyFile:                         0, // 440
	Ftcl_FSCopyDirectory:                    0, // 441
	Ftcl_FSCreateDirectory:                  0, // 442
	Ftcl_FSDeleteFile:                       0, // 443
	Ftcl_FSLoadFile:                         0, // 444
	Ftcl_FSMatchInDirectory:                 0, // 445
	Ftcl_FSLink:                             0, // 446
	Ftcl_FSRemoveDirectory:                  0, // 447
	Ftcl_FSRenameFile:                       0, // 448
	Ftcl_FSLstat:                            0, // 449
	Ftcl_FSUtime:                            0, // 450
	Ftcl_FSFileAttrsGet:                     0, // 451
	Ftcl_FSFileAttrsSet:                     0, // 452
	Ftcl_FSFileAttrStrings:                  0, // 453
	Ftcl_FSStat:                             0, // 454
	Ftcl_FSAccess:                           0, // 455
	Ftcl_FSOpenFileChannel:                  0, // 456
	Ftcl_FSGetCwd:                           0, // 457
	Ftcl_FSChdir:                            0, // 458
	Ftcl_FSConvertToPathType:                0, // 459
	Ftcl_FSJoinPath:                         0, // 460
	Ftcl_FSSplitPath:                        0, // 461
	Ftcl_FSEqualPaths:                       0, // 462
	Ftcl_FSGetNormalizedPath:                0, // 463
	Ftcl_FSJoinToPath:                       0, // 464
	Ftcl_FSGetInternalRep:                   0, // 465
	Ftcl_FSGetTranslatedPath:                0, // 466
	Ftcl_FSEvalFile:                         0, // 467
	Ftcl_FSNewNativePath:                    0, // 468
	Ftcl_FSGetNativePath:                    0, // 469
	Ftcl_FSFileSystemInfo:                   0, // 470
	Ftcl_FSPathSeparator:                    0, // 471
	Ftcl_FSListVolumes:                      0, // 472
	Ftcl_FSRegister:                         0, // 473
	Ftcl_FSUnregister:                       0, // 474
	Ftcl_FSData:                             0, // 475
	Ftcl_FSGetTranslatedStringPath:          0, // 476
	Ftcl_FSGetFileSystemForPath:             0, // 477
	Ftcl_FSGetPathType:                      0, // 478
	Ftcl_OutputBuffered:                     0, // 479
	Ftcl_FSMountsChanged:                    0, // 480
	Ftcl_EvalTokensStandard:                 0, // 481
	Ftcl_GetTime:                            0, // 482
	Ftcl_CreateObjTrace:                     0, // 483
	Ftcl_GetCommandInfoFromToken:            0, // 484
	Ftcl_SetCommandInfoFromToken:            0, // 485
	Ftcl_DbNewWideIntObj:                    0, // 486
	Ftcl_GetWideIntFromObj:                  0, // 487
	Ftcl_NewWideIntObj:                      0, // 488
	Ftcl_SetWideIntObj:                      0, // 489
	Ftcl_AllocStatBuf:                       0, // 490
	Ftcl_Seek:                               0, // 491
	Ftcl_Tell:                               0, // 492
	Ftcl_ChannelWideSeekProc:                0, // 493
	Ftcl_DictObjPut:                         0, // 494
	Ftcl_DictObjGet:                         0, // 495
	Ftcl_DictObjRemove:                      0, // 496
	Ftcl_DictObjSize:                        0, // 497
	Ftcl_DictObjFirst:                       0, // 498
	Ftcl_DictObjNext:                        0, // 499
	Ftcl_DictObjDone:                        0, // 500
	Ftcl_DictObjPutKeyList:                  0, // 501
	Ftcl_DictObjRemoveKeyList:               0, // 502
	Ftcl_NewDictObj:                         0, // 503
	Ftcl_DbNewDictObj:                       0, // 504
	Ftcl_RegisterConfig:                     0, // 505
	Ftcl_CreateNamespace:                    0, // 506
	Ftcl_DeleteNamespace:                    0, // 507
	Ftcl_AppendExportList:                   0, // 508
	Ftcl_Export:                             0, // 509
	Ftcl_Import:                             0, // 510
	Ftcl_ForgetImport:                       0, // 511
	Ftcl_GetCurrentNamespace:                0, // 512
	Ftcl_GetGlobalNamespace:                 0, // 513
	Ftcl_FindNamespace:                      0, // 514
	Ftcl_FindCommand:                        0, // 515
	Ftcl_GetCommandFromObj:                  0, // 516
	Ftcl_GetCommandFullName:                 0, // 517
	Ftcl_FSEvalFileEx:                       0, // 518
	Ftcl_SetExitProc:                        0, // 519
	Ftcl_LimitAddHandler:                    0, // 520
	Ftcl_LimitRemoveHandler:                 0, // 521
	Ftcl_LimitReady:                         0, // 522
	Ftcl_LimitCheck:                         0, // 523
	Ftcl_LimitExceeded:                      0, // 524
	Ftcl_LimitSetCommands:                   0, // 525
	Ftcl_LimitSetTime:                       0, // 526
	Ftcl_LimitSetGranularity:                0, // 527
	Ftcl_LimitTypeEnabled:                   0, // 528
	Ftcl_LimitTypeExceeded:                  0, // 529
	Ftcl_LimitTypeSet:                       0, // 530
	Ftcl_LimitTypeReset:                     0, // 531
	Ftcl_LimitGetCommands:                   0, // 532
	Ftcl_LimitGetTime:                       0, // 533
	Ftcl_LimitGetGranularity:                0, // 534
	Ftcl_SaveInterpState:                    0, // 535
	Ftcl_RestoreInterpState:                 0, // 536
	Ftcl_DiscardInterpState:                 0, // 537
	Ftcl_SetReturnOptions:                   0, // 538
	Ftcl_GetReturnOptions:                   0, // 539
	Ftcl_IsEnsemble:                         0, // 540
	Ftcl_CreateEnsemble:                     0, // 541
	Ftcl_FindEnsemble:                       0, // 542
	Ftcl_SetEnsembleSubcommandList:          0, // 543
	Ftcl_SetEnsembleMappingDict:             0, // 544
	Ftcl_SetEnsembleUnknownHandler:          0, // 545
	Ftcl_SetEnsembleFlags:                   0, // 546
	Ftcl_GetEnsembleSubcommandList:          0, // 547
	Ftcl_GetEnsembleMappingDict:             0, // 548
	Ftcl_GetEnsembleUnknownHandler:          0, // 549
	Ftcl_GetEnsembleFlags:                   0, // 550
	Ftcl_GetEnsembleNamespace:               0, // 551
	Ftcl_SetTimeProc:                        0, // 552
	Ftcl_QueryTimeProc:                      0, // 553
	Ftcl_ChannelThreadActionProc:            0, // 554
	Ftcl_NewBignumObj:                       0, // 555
	Ftcl_DbNewBignumObj:                     0, // 556
	Ftcl_SetBignumObj:                       0, // 557
	Ftcl_GetBignumFromObj:                   0, // 558
	Ftcl_TakeBignumFromObj:                  0, // 559
	Ftcl_TruncateChannel:                    0, // 560
	Ftcl_ChannelTruncateProc:                0, // 561
	Ftcl_SetChannelErrorInterp:              0, // 562
	Ftcl_GetChannelErrorInterp:              0, // 563
	Ftcl_SetChannelError:                    0, // 564
	Ftcl_GetChannelError:                    0, // 565
	Ftcl_InitBignumFromDouble:               0, // 566
	Ftcl_GetNamespaceUnknownHandler:         0, // 567
	Ftcl_SetNamespaceUnknownHandler:         0, // 568
	Ftcl_GetEncodingFromObj:                 0, // 569
	Ftcl_GetEncodingSearchPath:              0, // 570
	Ftcl_SetEncodingSearchPath:              0, // 571
	Ftcl_GetEncodingNameFromEnvironment:     0, // 572
	Ftcl_PkgRequireProc:                     0, // 573
	Ftcl_AppendObjToErrorInfo:               0, // 574
	Ftcl_AppendLimitedToObj:                 0, // 575
	Ftcl_Format:                             0, // 576
	Ftcl_AppendFormatToObj:                  0, // 577
	Ftcl_ObjPrintf:                          0, // 578
	Ftcl_AppendPrintfToObj:                  0, // 579
	Ftcl_CancelEval:                         0, // 580
	Ftcl_Canceled:                           0, // 581
	Ftcl_CreatePipe:                         0, // 582
	Ftcl_NRCreateCommand:                    0, // 583
	Ftcl_NREvalObj:                          0, // 584
	Ftcl_NREvalObjv:                         0, // 585
	Ftcl_NRCmdSwap:                          0, // 586
	Ftcl_NRAddCallback:                      0, // 587
	Ftcl_NRCallObjProc:                      0, // 588
	Ftcl_GetFSDeviceFromStat:                0, // 589
	Ftcl_GetFSInodeFromStat:                 0, // 590
	Ftcl_GetModeFromStat:                    0, // 591
	Ftcl_GetLinkCountFromStat:               0, // 592
	Ftcl_GetUserIdFromStat:                  0, // 593
	Ftcl_GetGroupIdFromStat:                 0, // 594
	Ftcl_GetDeviceTypeFromStat:              0, // 595
	Ftcl_GetAccessTimeFromStat:              0, // 596
	Ftcl_GetModificationTimeFromStat:        0, // 597
	Ftcl_GetChangeTimeFromStat:              0, // 598
	Ftcl_GetSizeFromStat:                    0, // 599
	Ftcl_GetBlocksFromStat:                  0, // 600
	Ftcl_GetBlockSizeFromStat:               0, // 601
	Ftcl_SetEnsembleParameterList:           0, // 602
	Ftcl_GetEnsembleParameterList:           0, // 603
	Ftcl_ParseArgsObjv:                      0, // 604
	Ftcl_GetErrorLine:                       0, // 605
	Ftcl_SetErrorLine:                       0, // 606
	Ftcl_TransferResult:                     0, // 607
	Ftcl_InterpActive:                       0, // 608
	Ftcl_BackgroundException:                0, // 609
	Ftcl_ZlibDeflate:                        0, // 610
	Ftcl_ZlibInflate:                        0, // 611
	Ftcl_ZlibCRC32:                          0, // 612
	Ftcl_ZlibAdler32:                        0, // 613
	Ftcl_ZlibStreamInit:                     0, // 614
	Ftcl_ZlibStreamGetCommandName:           0, // 615
	Ftcl_ZlibStreamEof:                      0, // 616
	Ftcl_ZlibStreamChecksum:                 0, // 617
	Ftcl_ZlibStreamPut:                      0, // 618
	Ftcl_ZlibStreamGet:                      0, // 619
	Ftcl_ZlibStreamClose:                    0, // 620
	Ftcl_ZlibStreamReset:                    0, // 621
	Ftcl_SetStartupScript:                   0, // 622
	Ftcl_GetStartupScript:                   0, // 623
	Ftcl_CloseEx:                            0, // 624
	Ftcl_NRExprObj:                          0, // 625
	Ftcl_NRSubstObj:                         0, // 626
	Ftcl_LoadFile:                           0, // 627
	Ftcl_FindSymbol:                         0, // 628
	Ftcl_FSUnloadFile:                       0, // 629
	Ftcl_ZlibStreamSetCompressionDictionary: 0, // 660
} /* tclStubInit.c:965:16 */

// !END!: Do not edit above this line.

var XtclStubsPtr uintptr = uintptr(0)        /* tclStubLib.c:21:16 */
var XtclPlatStubsPtr uintptr = uintptr(0)    /* tclStubLib.c:22:20 */
var XtclIntStubsPtr uintptr = uintptr(0)     /* tclStubLib.c:23:19 */
var XtclIntPlatStubsPtr uintptr = uintptr(0) /* tclStubLib.c:24:23 */

// Use our own isDigit to avoid linking to libc on windows

func isDigit(tls *libc.TLS, c int32) int32 { /* tclStubLib.c:30:12: */
	return libc.Bool32(c >= '0' && c <= '9')
}

//----------------------------------------------------------------------
//
// Tcl_InitStubs --
//
//	Tries to initialise the stub table pointers and ensures that the
//	correct version of Tcl is loaded.
//
// Results:
//	The actual version of Tcl that satisfies the request, or NULL to
//	indicate that an error occurred.
//
// Side effects:
//	Sets the stub table pointers.
//
//----------------------------------------------------------------------
func XTcl_InitStubs(tls *libc.TLS, interp uintptr, version uintptr, exact int32) uintptr { /* tclStubLib.c:53:25: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var iPtr uintptr = interp
	var actualVersion uintptr = uintptr(0)
	*(*ClientData)(unsafe.Pointer(bp /* pkgData */)) = uintptr(0)
	var stubsPtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FstubTable

	// We can't optimize this check by caching tclStubsPtr because that
	// prevents apps from being able to load/unload Tcl dynamically multiple
	// times. [Bug 615304]

	if !(stubsPtr != 0) || (*TclStubs)(unsafe.Pointer(stubsPtr)).Fmagic != libc.Int32FromUint32(0xFCA3BACF) {
		(*Interp)(unsafe.Pointer(iPtr)).Fresult = ts + 65148 /* "interpreter uses..." */
		(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = uintptr(0)
		return uintptr(0)
	}

	actualVersion = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*TclStubs)(unsafe.Pointer(stubsPtr)).Ftcl_PkgRequireEx})).f(tls, interp, ts+6496 /* "Tcl" */, version, 0, bp /* &pkgData */)
	if actualVersion == uintptr(0) {
		return uintptr(0)
	}
	if exact != 0 {
		var p uintptr = version
		var count int32 = 0

		for *(*int8)(unsafe.Pointer(p)) != 0 {
			count = count + libc.BoolInt32(!(isDigit(tls, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))))) != 0))
		}
		if count == 1 {
			var q uintptr = actualVersion

			p = version
			for *(*int8)(unsafe.Pointer(p)) != 0 && int32(*(*int8)(unsafe.Pointer(p))) == int32(*(*int8)(unsafe.Pointer(q))) {
				p++
				q++
			}
			if *(*int8)(unsafe.Pointer(p)) != 0 || isDigit(tls, int32(*(*int8)(unsafe.Pointer(q)))) != 0 {
				// Construct error message
				(*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*TclStubs)(unsafe.Pointer(stubsPtr)).Ftcl_PkgRequireEx})).f(tls, interp, ts+6496 /* "Tcl" */, version, 1, uintptr(0))
				return uintptr(0)
			}
		} else {
			actualVersion = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*TclStubs)(unsafe.Pointer(stubsPtr)).Ftcl_PkgRequireEx})).f(tls, interp, ts+6496 /* "Tcl" */, version, 1, uintptr(0))
			if actualVersion == uintptr(0) {
				return uintptr(0)
			}
		}
	}
	XtclStubsPtr = *(*ClientData)(unsafe.Pointer(bp /* pkgData */))

	if (*TclStubs)(unsafe.Pointer(XtclStubsPtr)).Fhooks != 0 {
		XtclPlatStubsPtr = (*TclStubHooks)(unsafe.Pointer((*TclStubs)(unsafe.Pointer(XtclStubsPtr)).Fhooks)).FtclPlatStubs
		XtclIntStubsPtr = (*TclStubHooks)(unsafe.Pointer((*TclStubs)(unsafe.Pointer(XtclStubsPtr)).Fhooks)).FtclIntStubs
		XtclIntPlatStubsPtr = (*TclStubHooks)(unsafe.Pointer((*TclStubs)(unsafe.Pointer(XtclStubsPtr)).Fhooks)).FtclIntPlatStubs
	} else {
		XtclPlatStubsPtr = uintptr(0)
		XtclIntStubsPtr = uintptr(0)
		XtclIntPlatStubsPtr = uintptr(0)
	}

	return actualVersion
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// There are three classes of synchronization objects: mutexes, thread data
// keys, and condition variables. The following are used to record the memory
// used for these objects so they can be finalized.
//
// These statics are guarded by the mutex in the caller of
// TclRememberThreadData, e.g., TclpThreadDataKeyInit

type SyncObjRecord = struct {
	Fnum  int32
	Fmax  int32
	Flist uintptr
} /* tclThread.c:29:3 */

var keyRecord = SyncObjRecord{}   /* tclThread.c:31:22 */
var mutexRecord = SyncObjRecord{} /* tclThread.c:32:22 */
var condRecord = SyncObjRecord{}  /* tclThread.c:33:22 */

// Several functions are #defined to nothing in tcl.h if TCL_THREADS is not
// specified. Here we undo that so the functions are defined in the stubs
// table.

//----------------------------------------------------------------------
//
// Tcl_GetThreadData --
//
//	This function allocates and initializes a chunk of thread local
//	storage.
//
// Results:
//	A thread-specific pointer to the data structure.
//
// Side effects:
//	Will allocate memory the first time this thread calls for this chunk
//	of storage.
//
//----------------------------------------------------------------------

func XTcl_GetThreadData(tls *libc.TLS, keyPtr uintptr, size int32) uintptr { /* tclThread.c:76:6: */
	var result uintptr
	// Initialize the key for this thread.

	result = XTclThreadStorageKeyGet(tls, keyPtr)

	if result == uintptr(0) {
		result = XTcl_Alloc(tls, uint32(size))
		libc.Xmemset(tls, result, 0, uint64(size))
		XTclThreadStorageKeySet(tls, keyPtr, result)
	}
	return result
}

//----------------------------------------------------------------------
//
// TclThreadDataKeyGet --
//
//	This function returns a pointer to a block of thread local storage.
//
// Results:
//	A thread-specific pointer to the data structure, or NULL if the memory
//	has not been assigned to this key for this thread.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclThreadDataKeyGet(tls *libc.TLS, keyPtr uintptr) uintptr { /* tclThread.c:124:6: */
	return XTclThreadStorageKeyGet(tls, keyPtr)
}

//----------------------------------------------------------------------
//
// RememberSyncObject
//
//	Keep a list of (mutexes/condition variable/data key) used during
//	finalization.
//
//	Assume global lock is held.
//
// Results:
//	None.
//
// Side effects:
//	Add to the appropriate list.
//
//----------------------------------------------------------------------

func sRememberSyncObject(tls *libc.TLS, objPtr uintptr, recPtr uintptr) { /* tclThread.c:156:1: */
	var newList uintptr
	var i int32
	var j int32

	// Reuse any free slot in the list.

	for i = 0; i < (*SyncObjRecord)(unsafe.Pointer(recPtr)).Fnum; i++ {
		if *(*uintptr)(unsafe.Pointer((*SyncObjRecord)(unsafe.Pointer(recPtr)).Flist + uintptr(i)*8)) == uintptr(0) {
			*(*uintptr)(unsafe.Pointer((*SyncObjRecord)(unsafe.Pointer(recPtr)).Flist + uintptr(i)*8)) = objPtr
			return
		}
	}

	// Grow the list of pointers if necessary, copying only non-NULL
	// pointers to the new list.

	if (*SyncObjRecord)(unsafe.Pointer(recPtr)).Fnum >= (*SyncObjRecord)(unsafe.Pointer(recPtr)).Fmax {
		*(*int32)(unsafe.Pointer(recPtr + 4)) += 8
		newList = XTcl_Alloc(tls, uint32(uint64((*SyncObjRecord)(unsafe.Pointer(recPtr)).Fmax)*uint64(unsafe.Sizeof(uintptr(0)))))
		i = 0
		j = 0
		for ; i < (*SyncObjRecord)(unsafe.Pointer(recPtr)).Fnum; i++ {
			if *(*uintptr)(unsafe.Pointer((*SyncObjRecord)(unsafe.Pointer(recPtr)).Flist + uintptr(i)*8)) != uintptr(0) {
				*(*uintptr)(unsafe.Pointer(newList + uintptr(libc.PostIncInt32(&j, 1))*8)) = *(*uintptr)(unsafe.Pointer((*SyncObjRecord)(unsafe.Pointer(recPtr)).Flist + uintptr(i)*8))
			}
		}
		if (*SyncObjRecord)(unsafe.Pointer(recPtr)).Flist != uintptr(0) {
			XTclpFree(tls, (*SyncObjRecord)(unsafe.Pointer(recPtr)).Flist)
		}
		(*SyncObjRecord)(unsafe.Pointer(recPtr)).Flist = newList
		(*SyncObjRecord)(unsafe.Pointer(recPtr)).Fnum = j
	}

	*(*uintptr)(unsafe.Pointer((*SyncObjRecord)(unsafe.Pointer(recPtr)).Flist + uintptr((*SyncObjRecord)(unsafe.Pointer(recPtr)).Fnum)*8)) = objPtr
	(*SyncObjRecord)(unsafe.Pointer(recPtr)).Fnum++
}

//----------------------------------------------------------------------
//
// ForgetSyncObject
//
//	Remove a single object from the list.
//	Assume global lock is held.
//
// Results:
//	None.
//
// Side effects:
//	Remove from the appropriate list.
//
//----------------------------------------------------------------------

func sForgetSyncObject(tls *libc.TLS, objPtr uintptr, recPtr uintptr) { /* tclThread.c:217:1: */
	var i int32

	for i = 0; i < (*SyncObjRecord)(unsafe.Pointer(recPtr)).Fnum; i++ {
		if objPtr == *(*uintptr)(unsafe.Pointer((*SyncObjRecord)(unsafe.Pointer(recPtr)).Flist + uintptr(i)*8)) {
			*(*uintptr)(unsafe.Pointer((*SyncObjRecord)(unsafe.Pointer(recPtr)).Flist + uintptr(i)*8)) = uintptr(0)
			return
		}
	}
}

//----------------------------------------------------------------------
//
// TclRememberMutex
//
//	Keep a list of mutexes used during finalization.
//	Assume global lock is held.
//
// Results:
//	None.
//
// Side effects:
//	Add to the mutex list.
//
//----------------------------------------------------------------------

func XTclRememberMutex(tls *libc.TLS, mutexPtr uintptr) { /* tclThread.c:249:1: */
	sRememberSyncObject(tls, mutexPtr, uintptr(unsafe.Pointer(&mutexRecord)))
}

//----------------------------------------------------------------------
//
// Tcl_MutexFinalize --
//
//	Finalize a single mutex and remove it from the list of remembered
//	objects.
//
// Results:
//	None.
//
// Side effects:
//	Remove the mutex from the list.
//
//----------------------------------------------------------------------

func XTcl_MutexFinalize(tls *libc.TLS, mutexPtr uintptr) { /* tclThread.c:273:1: */
	XTclpFinalizeMutex(tls, mutexPtr)
	XTclpGlobalLock(tls)
	sForgetSyncObject(tls, mutexPtr, uintptr(unsafe.Pointer(&mutexRecord)))
	XTclpGlobalUnlock(tls)
}

//----------------------------------------------------------------------
//
// TclRememberCondition
//
//	Keep a list of condition variables used during finalization.
//	Assume global lock is held.
//
// Results:
//	None.
//
// Side effects:
//	Add to the condition variable list.
//
//----------------------------------------------------------------------

func XTclRememberCondition(tls *libc.TLS, condPtr uintptr) { /* tclThread.c:302:1: */
	sRememberSyncObject(tls, condPtr, uintptr(unsafe.Pointer(&condRecord)))
}

//----------------------------------------------------------------------
//
// Tcl_ConditionFinalize --
//
//	Finalize a single condition variable and remove it from the list of
//	remembered objects.
//
// Results:
//	None.
//
// Side effects:
//	Remove the condition variable from the list.
//
//----------------------------------------------------------------------

func XTcl_ConditionFinalize(tls *libc.TLS, condPtr uintptr) { /* tclThread.c:326:1: */
	XTclpFinalizeCondition(tls, condPtr)
	XTclpGlobalLock(tls)
	sForgetSyncObject(tls, condPtr, uintptr(unsafe.Pointer(&condRecord)))
	XTclpGlobalUnlock(tls)
}

//----------------------------------------------------------------------
//
// TclFinalizeThreadData --
//
//	This function cleans up the thread-local storage. Secondary, it cleans
//	thread alloc cache.
//	This is called once for each thread before thread exits.
//
// Results:
//	None.
//
// Side effects:
//	Frees up all thread local storage.
//
//----------------------------------------------------------------------

func XTclFinalizeThreadData(tls *libc.TLS, quick int32) { /* tclThread.c:356:1: */
	XTclFinalizeThreadDataThread(tls)
	if !(quick != 0) {
		// Quick exit principle makes it useless to terminate allocators
		XTclFinalizeThreadAllocThread(tls)
	}
}

//----------------------------------------------------------------------
//
// TclFinalizeSynchronization --
//
//	This function cleans up all synchronization objects: mutexes,
//	condition variables, and thread-local storage.
//
// Results:
//	None.
//
// Side effects:
//	Frees up the memory.
//
//----------------------------------------------------------------------

func XTclFinalizeSynchronization(tls *libc.TLS) { /* tclThread.c:387:1: */
	var i int32
	var blockPtr uintptr
	var keyPtr uintptr
	var mutexPtr uintptr
	var condPtr uintptr

	XTclpGlobalLock(tls)

	// If we're running unthreaded, the TSD blocks are simply stored inside
	// their thread data keys. Free them here.

	if keyRecord.Flist != uintptr(0) {
		for i = 0; i < keyRecord.Fnum; i++ {
			keyPtr = *(*uintptr)(unsafe.Pointer(keyRecord.Flist + uintptr(i)*8))
			blockPtr = *(*Tcl_ThreadDataKey)(unsafe.Pointer(keyPtr))
			XTclpFree(tls, blockPtr)
		}
		XTclpFree(tls, keyRecord.Flist)
		keyRecord.Flist = uintptr(0)
	}
	keyRecord.Fmax = 0
	keyRecord.Fnum = 0

	// Call thread storage global cleanup.

	XTclFinalizeThreadStorage(tls)

	for i = 0; i < mutexRecord.Fnum; i++ {
		mutexPtr = *(*uintptr)(unsafe.Pointer(mutexRecord.Flist + uintptr(i)*8))
		if mutexPtr != uintptr(0) {
			XTclpFinalizeMutex(tls, mutexPtr)
		}
	}
	if mutexRecord.Flist != uintptr(0) {
		XTclpFree(tls, mutexRecord.Flist)
		mutexRecord.Flist = uintptr(0)
	}
	mutexRecord.Fmax = 0
	mutexRecord.Fnum = 0

	for i = 0; i < condRecord.Fnum; i++ {
		condPtr = *(*uintptr)(unsafe.Pointer(condRecord.Flist + uintptr(i)*8))
		if condPtr != uintptr(0) {
			XTclpFinalizeCondition(tls, condPtr)
		}
	}
	if condRecord.Flist != uintptr(0) {
		XTclpFree(tls, condRecord.Flist)
		condRecord.Flist = uintptr(0)
	}
	condRecord.Fmax = 0
	condRecord.Fnum = 0

	XTclpGlobalUnlock(tls)
}

//----------------------------------------------------------------------
//
// Tcl_ExitThread --
//
//	This function is called to terminate the current thread. This should
//	be used by extensions that create threads with additional interpreters
//	in them.
//
// Results:
//	None.
//
// Side effects:
//	All thread exit handlers are invoked, then the thread dies.
//
//----------------------------------------------------------------------

func XTcl_ExitThread(tls *libc.TLS, status int32) { /* tclThread.c:472:1: */
	XTcl_FinalizeThread(tls)
	XTclpThreadExit(tls, status)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// If range checking is enabled, an additional byte will be allocated to store
// the magic number at the end of the requested memory.

// The following define the number of Tcl_Obj's to allocate/move at a time and
// the high water mark to prune a per-thread cache. On a 32 bit system,
// sizeof(Tcl_Obj) = 24 so 800 * 24 = ~16k.

// Actual definition moved to tclInt.h

// The following union stores accounting information for each block including
// two small magic numbers and a bucket number when in use or a next pointer
// when free. The original requested size (not including the Block overhead)
// is also maintained.

type Block1 = struct {
	Fb struct {
		Fu       struct{ Fnext uintptr }
		FreqSize Size_t
	}
} /* tclInt.h:1752:5 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// If range checking is enabled, an additional byte will be allocated to store
// the magic number at the end of the requested memory.

// The following define the number of Tcl_Obj's to allocate/move at a time and
// the high water mark to prune a per-thread cache. On a 32 bit system,
// sizeof(Tcl_Obj) = 24 so 800 * 24 = ~16k.

// Actual definition moved to tclInt.h

// The following union stores accounting information for each block including
// two small magic numbers and a bucket number when in use or a next pointer
// when free. The original requested size (not including the Block overhead)
// is also maintained.

type Block = Block1 /* tclThreadAlloc.c:63:3 */

// The following defines the minimum and and maximum block sizes and the number
// of buckets in the bucket cache.

// The following structure defines a bucket of blocks with various accounting
// and statistics information.

type Bucket1 = struct {
	FfirstPtr      uintptr
	FlastPtr       uintptr
	FnumFree       int64
	FnumRemoves    int64
	FnumInserts    int64
	FnumWaits      int64
	FnumLocks      int64
	FtotalAssigned int64
} /* tclInt.h:1752:5 */

// The following defines the minimum and and maximum block sizes and the number
// of buckets in the bucket cache.

// The following structure defines a bucket of blocks with various accounting
// and statistics information.

type Bucket = Bucket1 /* tclThreadAlloc.c:97:3 */

// The following structure defines a cache of buckets and objs, of which there
// will be (at most) one per thread. Any changes need to be reflected in the
// struct AllocCache defined in tclInt.h, possibly also in the initialisation
// code in Tcl_CreateInterp().

type Cache = Cache1 /* tclThreadAlloc.c:114:3 */

// The following array specifies various per-bucket limits and locks. The
// values are statically initialized to avoid calculating them repeatedly.

var bucketInfo [10]struct {
	FblockSize Size_t
	FmaxBlocks int32
	FnumMove   int32
	FlockPtr   uintptr
} /* tclThreadAlloc.c:126:3: */

// Local variables defined in this file and initialized at startup.

var listLockPtr uintptr       /* tclThreadAlloc.c:146:18: */
var objLockPtr uintptr        /* tclThreadAlloc.c:147:18: */
var sharedCache Cache         /* tclThreadAlloc.c:148:14: */
var sharedPtr uintptr = 0     /* tclThreadAlloc.c:149:14 */
var firstCachePtr uintptr = 0 /* tclThreadAlloc.c:150:14 */

//----------------------------------------------------------------------
//
// GetCache ---
//
//	Gets per-thread memory cache, allocating it if necessary.
//
// Results:
//	Pointer to cache.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sGetCache(tls *libc.TLS) uintptr { /* tclThreadAlloc.c:188:14: */
	var cachePtr uintptr

	// Check for first-time initialization.

	if listLockPtr == uintptr(0) {
		var initLockPtr uintptr
		var i uint32

		initLockPtr = XTcl_GetAllocMutex(tls)
		XTcl_MutexLock(tls, initLockPtr)
		if listLockPtr == uintptr(0) {
			listLockPtr = XTclpNewAllocMutex(tls)
			objLockPtr = XTclpNewAllocMutex(tls)
			for i = uint32(0); uint64(i) < uint64(11)-uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5; i++ {
				bucketInfo[i].FblockSize = uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1))) << i
				bucketInfo[i].FmaxBlocks = int32(1) << (uint64(11) - uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5 - uint64(1) - uint64(i))
				bucketInfo[i].FnumMove = func() int32 {
					if uint64(i) < uint64(11)-uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5-uint64(1) {
						return int32(1) << (uint64(11) - uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5 - uint64(2) - uint64(i))
					}
					return 1
				}()
				bucketInfo[i].FlockPtr = XTclpNewAllocMutex(tls)
			}
		}
		XTcl_MutexUnlock(tls, initLockPtr)
	}

	// Get this thread's cache, allocating if necessary.

	cachePtr = XTclpGetAllocCache(tls)
	if cachePtr == uintptr(0) {
		cachePtr = libc.Xmalloc(tls, Size_t(unsafe.Sizeof(Cache{})))
		if cachePtr == uintptr(0) {
			XTcl_Panic(tls, ts+65197, 0)
		}
		libc.Xmemset(tls, cachePtr, 0, uint64(unsafe.Sizeof(Cache{})))
		XTcl_MutexLock(tls, listLockPtr)
		(*Cache)(unsafe.Pointer(cachePtr)).FnextPtr = firstCachePtr
		firstCachePtr = cachePtr
		XTcl_MutexUnlock(tls, listLockPtr)
		(*Cache)(unsafe.Pointer(cachePtr)).Fowner = XTcl_GetCurrentThread(tls)
		XTclpSetAllocCache(tls, cachePtr)
	}
	return cachePtr
}

//----------------------------------------------------------------------
//
// TclFreeAllocCache --
//
//	Flush and delete a cache, removing from list of caches.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFreeAllocCache(tls *libc.TLS, arg uintptr) { /* tclThreadAlloc.c:255:1: */
	var cachePtr uintptr = arg
	var nextPtrPtr uintptr
	var bucket uint32

	// Flush blocks.

	for bucket = uint32(0); uint64(bucket) < uint64(11)-uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5; bucket++ {
		if (*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumFree > int64(0) {
			sPutBlocks(tls, cachePtr, int32(bucket), int32((*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumFree))
		}
	}

	// Flush objs.

	if (*Cache)(unsafe.Pointer(cachePtr)).FnumObjects > 0 {
		sPutObjs(tls, cachePtr, (*Cache)(unsafe.Pointer(cachePtr)).FnumObjects)
	}

	// Remove from pool list.

	XTcl_MutexLock(tls, listLockPtr)
	nextPtrPtr = uintptr(unsafe.Pointer(&firstCachePtr))
	for *(*uintptr)(unsafe.Pointer(nextPtrPtr)) != cachePtr {
		nextPtrPtr = *(*uintptr)(unsafe.Pointer(nextPtrPtr))
	}
	*(*uintptr)(unsafe.Pointer(nextPtrPtr)) = (*Cache)(unsafe.Pointer(cachePtr)).FnextPtr
	(*Cache)(unsafe.Pointer(cachePtr)).FnextPtr = uintptr(0)
	XTcl_MutexUnlock(tls, listLockPtr)
	libc.Xfree(tls, cachePtr)
}

//----------------------------------------------------------------------
//
// TclpAlloc --
//
//	Allocate memory.
//
// Results:
//	Pointer to memory just beyond Block pointer.
//
// Side effects:
//	May allocate more blocks for a bucket.
//
//----------------------------------------------------------------------

func XTclpAlloc(tls *libc.TLS, reqSize uint32) uintptr { /* tclThreadAlloc.c:311:6: */
	var cachePtr uintptr
	var blockPtr uintptr
	var bucket int32
	var size Size_t

	for ok := true; ok; ok = 0 != 0 {
		cachePtr = XTclpGetAllocCache(tls)
		if cachePtr == uintptr(0) {
			cachePtr = sGetCache(tls)
		}
	}

	// Increment the requested size to include room for the Block structure.
	// Call TclpSysAlloc() directly if the required amount is greater than the
	// largest block, otherwise pop the smallest block large enough,
	// allocating more blocks if necessary.

	blockPtr = uintptr(0)
	size = uint64(reqSize) + uint64(unsafe.Sizeof(Block{}))
	if size > uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))<<(uint64(11)-uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5-uint64(1)) {
		bucket = int32(uint64(11) - uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5)
		blockPtr = libc.Xmalloc(tls, size)
		if blockPtr != uintptr(0) {
			*(*int32)(unsafe.Pointer(cachePtr + 40)) += int32(reqSize)
		}
	} else {
		bucket = 0
		for bucketInfo[bucket].FblockSize < size {
			bucket++
		}
		if (*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumFree != 0 || sGetBlocks(tls, cachePtr, bucket) != 0 {
			blockPtr = (*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FfirstPtr
			(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FfirstPtr = *(*uintptr)(unsafe.Pointer(blockPtr))
			(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumFree--
			(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumRemoves++
			*(*int64)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64 + 56)) += int64(reqSize)
		}
	}
	if blockPtr == uintptr(0) {
		return uintptr(0)
	}
	return sBlock2Ptr(tls, blockPtr, bucket, reqSize)
}

//----------------------------------------------------------------------
//
// TclpFree --
//
//	Return blocks to the thread block cache.
//
// Results:
//	None.
//
// Side effects:
//	May move blocks to shared cache.
//
//----------------------------------------------------------------------

func XTclpFree(tls *libc.TLS, ptr uintptr) { /* tclThreadAlloc.c:389:1: */
	var cachePtr uintptr
	var blockPtr uintptr
	var bucket int32

	if ptr == uintptr(0) {
		return
	}

	for ok := true; ok; ok = 0 != 0 {
		cachePtr = XTclpGetAllocCache(tls)
		if cachePtr == uintptr(0) {
			cachePtr = sGetCache(tls)
		}
	}

	// Get the block back from the user pointer and call system free directly
	// for large blocks. Otherwise, push the block back on the bucket and move
	// blocks to the shared cache if there are now too many free.

	blockPtr = sPtr2Block(tls, ptr)
	bucket = int32(*(*uint8)(unsafe.Pointer(blockPtr + 1 /* &.bucket */)))
	if uint64(bucket) == uint64(11)-uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5 {
		*(*int32)(unsafe.Pointer(cachePtr + 40)) -= int32(*(*Size_t)(unsafe.Pointer(blockPtr + 8)))
		libc.Xfree(tls, blockPtr)
		return
	}

	*(*int64)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64 + 56)) -= int64(*(*Size_t)(unsafe.Pointer(blockPtr + 8)))
	*(*uintptr)(unsafe.Pointer(blockPtr)) = (*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FfirstPtr
	(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FfirstPtr = blockPtr
	if (*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumFree == int64(0) {
		(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FlastPtr = blockPtr
	}
	(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumFree++
	(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumInserts++

	if cachePtr != sharedPtr && (*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumFree > int64(bucketInfo[bucket].FmaxBlocks) {
		sPutBlocks(tls, cachePtr, bucket, bucketInfo[bucket].FnumMove)
	}
}

//----------------------------------------------------------------------
//
// TclpRealloc --
//
//	Re-allocate memory to a larger or smaller size.
//
// Results:
//	Pointer to memory just beyond Block pointer.
//
// Side effects:
//	Previous memory, if any, may be freed.
//
//----------------------------------------------------------------------

func XTclpRealloc(tls *libc.TLS, ptr uintptr, reqSize uint32) uintptr { /* tclThreadAlloc.c:447:6: */
	var cachePtr uintptr
	var blockPtr uintptr
	var newPtr uintptr
	var size Size_t
	var min Size_t
	var bucket int32

	if ptr == uintptr(0) {
		return XTclpAlloc(tls, reqSize)
	}

	for ok := true; ok; ok = 0 != 0 {
		cachePtr = XTclpGetAllocCache(tls)
		if cachePtr == uintptr(0) {
			cachePtr = sGetCache(tls)
		}
	}

	// If the block is not a system block and fits in place, simply return the
	// existing pointer. Otherwise, if the block is a system block and the new
	// size would also require a system block, call TclpSysRealloc() directly.

	blockPtr = sPtr2Block(tls, ptr)
	size = uint64(reqSize) + uint64(unsafe.Sizeof(Block{}))
	bucket = int32(*(*uint8)(unsafe.Pointer(blockPtr + 1 /* &.bucket */)))
	if uint64(bucket) != uint64(11)-uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5 {
		if bucket > 0 {
			min = bucketInfo[bucket-1].FblockSize
		} else {
			min = uint64(0)
		}
		if size > min && size <= bucketInfo[bucket].FblockSize {
			*(*int64)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64 + 56)) -= int64(*(*Size_t)(unsafe.Pointer(blockPtr + 8)))
			*(*int64)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64 + 56)) += int64(reqSize)
			return sBlock2Ptr(tls, blockPtr, bucket, reqSize)
		}
	} else if size > uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))<<(uint64(11)-uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5-uint64(1)) {
		*(*int32)(unsafe.Pointer(cachePtr + 40)) -= int32(*(*Size_t)(unsafe.Pointer(blockPtr + 8)))
		*(*int32)(unsafe.Pointer(cachePtr + 40)) += int32(reqSize)
		blockPtr = libc.Xrealloc(tls, blockPtr, size)
		if blockPtr == uintptr(0) {
			return uintptr(0)
		}
		return sBlock2Ptr(tls, blockPtr, int32(uint64(11)-uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5), reqSize)
	}

	// Finally, perform an expensive malloc/copy/free.

	newPtr = XTclpAlloc(tls, reqSize)
	if newPtr != uintptr(0) {
		if Size_t(reqSize) > *(*Size_t)(unsafe.Pointer(blockPtr + 8)) {
			reqSize = uint32(*(*Size_t)(unsafe.Pointer(blockPtr + 8 /* &.reqSize */)))
		}
		libc.Xmemcpy(tls, newPtr, ptr, uint64(reqSize))
		XTclpFree(tls, ptr)
	}
	return newPtr
}

//----------------------------------------------------------------------
//
// TclThreadAllocObj --
//
//	Allocate a Tcl_Obj from the per-thread cache.
//
// Results:
//	Pointer to uninitialized Tcl_Obj.
//
// Side effects:
//	May move Tcl_Obj's from shared cached or allocate new Tcl_Obj's if
//	list is empty.
//
// Note:
//	If this code is updated, the changes need to be reflected in the macro
//	TclAllocObjStorageEx() defined in tclInt.h
//
//----------------------------------------------------------------------

func XTclThreadAllocObj(tls *libc.TLS) uintptr { /* tclThreadAlloc.c:546:9: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var cachePtr uintptr
	var objPtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		cachePtr = XTclpGetAllocCache(tls)
		if cachePtr == uintptr(0) {
			cachePtr = sGetCache(tls)
		}
	}

	// Get this thread's obj list structure and move or allocate new objs if
	// necessary.

	if (*Cache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 {
		var numMove int32

		XTcl_MutexLock(tls, objLockPtr)
		numMove = (*Cache)(unsafe.Pointer(sharedPtr)).FnumObjects
		if numMove > 0 {
			if numMove > NOBJALLOC {
				numMove = NOBJALLOC
			}
			sMoveObjs(tls, sharedPtr, cachePtr, numMove)
		}
		XTcl_MutexUnlock(tls, objLockPtr)
		if (*Cache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 {
			var newObjsPtr uintptr

			(*Cache)(unsafe.Pointer(cachePtr)).FnumObjects = libc.AssignInt32(&numMove, NOBJALLOC)
			newObjsPtr = libc.Xmalloc(tls, uint64(unsafe.Sizeof(Tcl_Obj{}))*uint64(numMove))
			if newObjsPtr == uintptr(0) {
				XTcl_Panic(tls, ts+65233, libc.VaList(bp, numMove))
			}
			(*Cache)(unsafe.Pointer(cachePtr)).FlastPtr = newObjsPtr + uintptr(numMove)*48 - uintptr(1)*48
			objPtr = (*Cache)(unsafe.Pointer(cachePtr)).FfirstObjPtr // NULL
			for libc.PreDecInt32(&numMove, 1) >= 0 {
				*(*uintptr)(unsafe.Pointer(newObjsPtr + uintptr(numMove)*48 + 32)) = objPtr
				objPtr = newObjsPtr + uintptr(numMove)*48
			}
			(*Cache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = newObjsPtr
		}
	}

	// Pop the first object.

	objPtr = (*Cache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*Cache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	(*Cache)(unsafe.Pointer(cachePtr)).FnumObjects--
	return objPtr
}

//----------------------------------------------------------------------
//
// TclThreadFreeObj --
//
//	Return a free Tcl_Obj to the per-thread cache.
//
// Results:
//	None.
//
// Side effects:
//	May move free Tcl_Obj's to shared list upon hitting high water mark.
//
// Note:
//	If this code is updated, the changes need to be reflected in the macro
//	TclAllocObjStorageEx() defined in tclInt.h
//
//----------------------------------------------------------------------

func XTclThreadFreeObj(tls *libc.TLS, objPtr uintptr) { /* tclThreadAlloc.c:620:1: */
	var cachePtr uintptr

	for ok := true; ok; ok = 0 != 0 {
		cachePtr = XTclpGetAllocCache(tls)
		if cachePtr == uintptr(0) {
			cachePtr = sGetCache(tls)
		}
	}

	// Get this thread's list and push on the free Tcl_Obj.

	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*Cache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*Cache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
	if (*Cache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 {
		(*Cache)(unsafe.Pointer(cachePtr)).FlastPtr = objPtr
	}
	(*Cache)(unsafe.Pointer(cachePtr)).FnumObjects++

	// If the number of free objects has exceeded the high water mark, move
	// some blocks to the shared list.

	if (*Cache)(unsafe.Pointer(cachePtr)).FnumObjects > ALLOC_NOBJHIGH {
		sPutObjs(tls, cachePtr, NOBJALLOC)
	}
}

//----------------------------------------------------------------------
//
// Tcl_GetMemoryInfo --
//
//	Return a list-of-lists of memory stats.
//
// Results:
//	None.
//
// Side effects:
//	List appended to given dstring.
//
//----------------------------------------------------------------------

func XTcl_GetMemoryInfo(tls *libc.TLS, dsPtr uintptr) { /* tclThreadAlloc.c:665:1: */
	bp := tls.Alloc(264)
	defer tls.Free(264)

	var cachePtr uintptr
	// var buf [200]int8 at bp+64, 200

	var n uint32

	XTcl_MutexLock(tls, listLockPtr)
	cachePtr = firstCachePtr
	for cachePtr != uintptr(0) {
		XTcl_DStringStartSublist(tls, dsPtr)
		if cachePtr == sharedPtr {
			XTcl_DStringAppendElement(tls, dsPtr, ts+65274)
		} else {
			libc.Xsprintf(tls, bp+64, ts+65281, libc.VaList(bp, (*Cache)(unsafe.Pointer(cachePtr)).Fowner))
			XTcl_DStringAppendElement(tls, dsPtr, bp+64)
		}
		for n = uint32(0); uint64(n) < uint64(11)-uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5; n++ {
			libc.Xsprintf(tls, bp+64, ts+65290,
				libc.VaList(bp+8, bucketInfo[n].FblockSize,
					(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(n)*64)).FnumFree,
					(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(n)*64)).FnumRemoves,
					(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(n)*64)).FnumInserts,
					(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(n)*64)).FtotalAssigned,
					(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(n)*64)).FnumLocks,
					(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(n)*64)).FnumWaits))
			XTcl_DStringAppendElement(tls, dsPtr, bp+64)
		}
		XTcl_DStringEndSublist(tls, dsPtr)
		cachePtr = (*Cache)(unsafe.Pointer(cachePtr)).FnextPtr
	}
	XTcl_MutexUnlock(tls, listLockPtr)
}

//----------------------------------------------------------------------
//
// MoveObjs --
//
//	Move Tcl_Obj's between caches.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sMoveObjs(tls *libc.TLS, fromPtr uintptr, toPtr uintptr, numMove int32) { /* tclThreadAlloc.c:716:1: */
	var objPtr uintptr = (*Cache)(unsafe.Pointer(fromPtr)).FfirstObjPtr
	var fromFirstObjPtr uintptr = objPtr

	*(*int32)(unsafe.Pointer(toPtr + 24)) += numMove
	*(*int32)(unsafe.Pointer(fromPtr + 24)) -= numMove

	// Find the last object to be moved; set the next one (the first one not
	// to be moved) as the first object in the 'from' cache.

	for libc.PreDecInt32(&numMove, 1) != 0 {
		objPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	}
	(*Cache)(unsafe.Pointer(fromPtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	// Move all objects as a block - they are already linked to each other, we
	// just have to update the first and last.

	(*Cache)(unsafe.Pointer(toPtr)).FlastPtr = objPtr
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*Cache)(unsafe.Pointer(toPtr)).FfirstObjPtr // NULL
	(*Cache)(unsafe.Pointer(toPtr)).FfirstObjPtr = fromFirstObjPtr
}

//----------------------------------------------------------------------
//
// PutObjs --
//
//	Move Tcl_Obj's from thread cache to shared cache.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPutObjs(tls *libc.TLS, fromPtr uintptr, numMove int32) { /* tclThreadAlloc.c:764:1: */
	var keep int32 = (*Cache)(unsafe.Pointer(fromPtr)).FnumObjects - numMove
	var firstPtr uintptr
	var lastPtr uintptr = uintptr(0)

	(*Cache)(unsafe.Pointer(fromPtr)).FnumObjects = keep
	firstPtr = (*Cache)(unsafe.Pointer(fromPtr)).FfirstObjPtr
	if keep == 0 {
		(*Cache)(unsafe.Pointer(fromPtr)).FfirstObjPtr = uintptr(0)
	} else {
		for ok := true; ok; ok = libc.PreDecInt32(&keep, 1) > 0 {
			lastPtr = firstPtr
			firstPtr = *(*uintptr)(unsafe.Pointer(firstPtr + 32))
		}
		*(*uintptr)(unsafe.Pointer(lastPtr + 32)) = uintptr(0)
	}

	// Move all objects as a block - they are already linked to each other, we
	// just have to update the first and last.

	XTcl_MutexLock(tls, objLockPtr)
	*(*uintptr)(unsafe.Pointer((*Cache)(unsafe.Pointer(fromPtr)).FlastPtr + 32)) = (*Cache)(unsafe.Pointer(sharedPtr)).FfirstObjPtr
	(*Cache)(unsafe.Pointer(sharedPtr)).FfirstObjPtr = firstPtr
	if (*Cache)(unsafe.Pointer(sharedPtr)).FnumObjects == 0 {
		(*Cache)(unsafe.Pointer(sharedPtr)).FlastPtr = (*Cache)(unsafe.Pointer(fromPtr)).FlastPtr
	}
	*(*int32)(unsafe.Pointer(sharedPtr + 24)) += numMove
	XTcl_MutexUnlock(tls, objLockPtr)

	(*Cache)(unsafe.Pointer(fromPtr)).FlastPtr = lastPtr
}

//----------------------------------------------------------------------
//
// Block2Ptr, Ptr2Block --
//
//	Convert between internal blocks and user pointers.
//
// Results:
//	User pointer or internal block.
//
// Side effects:
//	Invalid blocks will abort the server.
//
//----------------------------------------------------------------------

func sBlock2Ptr(tls *libc.TLS, blockPtr uintptr, bucket int32, reqSize uint32) uintptr { /* tclThreadAlloc.c:816:13: */
	var ptr uintptr

	*(*uint8)(unsafe.Pointer(blockPtr)) = libc.AssignPtrUint8(blockPtr+3, uint8(MAGIC))
	*(*uint8)(unsafe.Pointer(blockPtr + 1 /* &.bucket */)) = uint8(bucket)
	*(*Size_t)(unsafe.Pointer(blockPtr + 8 /* &.reqSize */)) = Size_t(reqSize)
	ptr = blockPtr + uintptr(1)*16
	return ptr
}

func sPtr2Block(tls *libc.TLS, ptr uintptr) uintptr { /* tclThreadAlloc.c:834:14: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var blockPtr uintptr

	blockPtr = ptr - uintptr(1)*16
	if int32(*(*uint8)(unsafe.Pointer(blockPtr))) != MAGIC || int32(*(*uint8)(unsafe.Pointer(blockPtr + 3))) != MAGIC {
		XTcl_Panic(tls, ts+65318,
			libc.VaList(bp, blockPtr, int32(*(*uint8)(unsafe.Pointer(blockPtr))), int32(*(*uint8)(unsafe.Pointer(blockPtr + 3 /* &.magic2 */)))))
	}
	return blockPtr
}

//----------------------------------------------------------------------
//
// LockBucket, UnlockBucket --
//
//	Set/unset the lock to access a bucket in the shared cache.
//
// Results:
//	None.
//
// Side effects:
//	Lock activity and contention are monitored globally and on a per-cache
//	basis.
//
//----------------------------------------------------------------------

func sLockBucket(tls *libc.TLS, cachePtr uintptr, bucket int32) { /* tclThreadAlloc.c:873:1: */
	XTcl_MutexLock(tls, bucketInfo[bucket].FlockPtr)
	(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumLocks++
	(*Bucket)(unsafe.Pointer(sharedPtr+48+uintptr(bucket)*64)).FnumLocks++
}

func sUnlockBucket(tls *libc.TLS, cachePtr uintptr, bucket int32) { /* tclThreadAlloc.c:883:1: */
	XTcl_MutexUnlock(tls, bucketInfo[bucket].FlockPtr)
}

//----------------------------------------------------------------------
//
// PutBlocks --
//
//	Return unused blocks to the shared cache.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPutBlocks(tls *libc.TLS, cachePtr uintptr, bucket int32, numMove int32) { /* tclThreadAlloc.c:907:1: */
	// We have numFree.  Want to shed numMove. So compute how many
	// Blocks to keep.

	var keep int32 = int32((*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumFree - int64(numMove))
	var lastPtr uintptr = uintptr(0)
	var firstPtr uintptr

	(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FnumFree = int64(keep)
	firstPtr = (*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FfirstPtr
	if keep == 0 {
		(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FfirstPtr = uintptr(0)
	} else {
		for ok := true; ok; ok = libc.PreDecInt32(&keep, 1) > 0 {
			lastPtr = firstPtr
			firstPtr = *(*uintptr)(unsafe.Pointer(firstPtr))
		}
		*(*uintptr)(unsafe.Pointer(lastPtr)) = uintptr(0)
	}

	// Aquire the lock and place the list of blocks at the front of the shared
	// cache bucket.

	sLockBucket(tls, cachePtr, bucket)
	*(*uintptr)(unsafe.Pointer((*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FlastPtr)) = (*Bucket)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64)).FfirstPtr
	(*Bucket)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64)).FfirstPtr = firstPtr
	if (*Bucket)(unsafe.Pointer(sharedPtr+48+uintptr(bucket)*64)).FnumFree == int64(0) {
		(*Bucket)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64)).FlastPtr = (*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FlastPtr
	}
	*(*int64)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64 + 16)) += int64(numMove)
	sUnlockBucket(tls, cachePtr, bucket)

	(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FlastPtr = lastPtr
}

//----------------------------------------------------------------------
//
// GetBlocks --
//
//	Get more blocks for a bucket.
//
// Results:
//	1 if blocks where allocated, 0 otherwise.
//
// Side effects:
//	Cache may be filled with available blocks.
//
//----------------------------------------------------------------------

func sGetBlocks(tls *libc.TLS, cachePtr uintptr, bucket int32) int32 { /* tclThreadAlloc.c:968:1: */
	var blockPtr uintptr
	var n int32

	// First, atttempt to move blocks from the shared cache. Note the
	// potentially dirty read of numFree before acquiring the lock which is a
	// slight performance enhancement. The value is verified after the lock is
	// actually acquired.

	if cachePtr != sharedPtr && (*Bucket)(unsafe.Pointer(sharedPtr+48+uintptr(bucket)*64)).FnumFree > int64(0) {
		sLockBucket(tls, cachePtr, bucket)
		if (*Bucket)(unsafe.Pointer(sharedPtr+48+uintptr(bucket)*64)).FnumFree > int64(0) {

			// Either move the entire list or walk the list to find the last
			// block to move.

			n = bucketInfo[bucket].FnumMove
			if int64(n) >= (*Bucket)(unsafe.Pointer(sharedPtr+48+uintptr(bucket)*64)).FnumFree {
				(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FfirstPtr = (*Bucket)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64)).FfirstPtr
				(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FlastPtr = (*Bucket)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64)).FlastPtr
				(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FnumFree = (*Bucket)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64)).FnumFree
				(*Bucket)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64)).FfirstPtr = uintptr(0)
				(*Bucket)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64)).FnumFree = int64(0)
			} else {
				blockPtr = (*Bucket)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64)).FfirstPtr
				(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FfirstPtr = blockPtr
				*(*int64)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64 + 16)) -= int64(n)
				(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FnumFree = int64(n)
				for libc.PreDecInt32(&n, 1) > 0 {
					blockPtr = *(*uintptr)(unsafe.Pointer(blockPtr))
				}
				(*Bucket)(unsafe.Pointer(sharedPtr + 48 + uintptr(bucket)*64)).FfirstPtr = *(*uintptr)(unsafe.Pointer(blockPtr))
				(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FlastPtr = blockPtr
				*(*uintptr)(unsafe.Pointer(blockPtr)) = uintptr(0)
			}
		}
		sUnlockBucket(tls, cachePtr, bucket)
	}

	if (*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(bucket)*64)).FnumFree == int64(0) {
		var size Size_t

		// If no blocks could be moved from shared, first look for a larger
		// block in this cache to split up.

		blockPtr = uintptr(0)
		n = int32(uint64(11) - uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5)
		size = uint64(0) // lint
		for libc.PreDecInt32(&n, 1) > bucket {
			if (*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(n)*64)).FnumFree > int64(0) {
				size = bucketInfo[n].FblockSize
				blockPtr = (*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(n)*64)).FfirstPtr
				(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(n)*64)).FfirstPtr = *(*uintptr)(unsafe.Pointer(blockPtr))
				(*Bucket)(unsafe.Pointer(cachePtr+48+uintptr(n)*64)).FnumFree--
				break
			}
		}

		// Otherwise, allocate a big new block directly.

		if blockPtr == uintptr(0) {
			size = uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1))) << (uint64(11) - uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5 - uint64(1))
			blockPtr = libc.Xmalloc(tls, size)
			if blockPtr == uintptr(0) {
				return 0
			}
		}

		// Split the larger block into smaller blocks for this bucket.

		n = int32(size / bucketInfo[bucket].FblockSize)
		(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FnumFree = int64(n)
		(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FfirstPtr = blockPtr
		for libc.PreDecInt32(&n, 1) > 0 {
			*(*uintptr)(unsafe.Pointer(blockPtr)) = blockPtr + uintptr(bucketInfo[bucket].FblockSize)
			blockPtr = *(*uintptr)(unsafe.Pointer(blockPtr))
		}
		(*Bucket)(unsafe.Pointer(cachePtr + 48 + uintptr(bucket)*64)).FlastPtr = blockPtr
		*(*uintptr)(unsafe.Pointer(blockPtr)) = uintptr(0)
	}
	return 1
}

//----------------------------------------------------------------------
//
// TclFinalizeThreadAlloc --
//
//	This procedure is used to destroy all private resources used in this
//	file.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFinalizeThreadAlloc(tls *libc.TLS) { /* tclThreadAlloc.c:1086:1: */
	var i uint32

	for i = uint32(0); uint64(i) < uint64(11)-uint64((uint64(unsafe.Sizeof(Block{}))+uint64(8)+(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))&libc.CplUint64(uint64(2)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(1)))>>5; i++ {
		XTclpFreeAllocMutex(tls, bucketInfo[i].FlockPtr)
		bucketInfo[i].FlockPtr = uintptr(0)
	}

	XTclpFreeAllocMutex(tls, objLockPtr)
	objLockPtr = uintptr(0)

	XTclpFreeAllocMutex(tls, listLockPtr)
	listLockPtr = uintptr(0)

	XTclpFreeAllocCache(tls, uintptr(0))
}

//----------------------------------------------------------------------
//
// TclFinalizeThreadAllocThread --
//
//	This procedure is used to destroy single thread private resources
//	defined in this file. Called either during Tcl_FinalizeThread() or
//	Tcl_Finalize().
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFinalizeThreadAllocThread(tls *libc.TLS) { /* tclThreadAlloc.c:1123:1: */
	var cachePtr uintptr = XTclpGetAllocCache(tls)
	if cachePtr != uintptr(0) {
		XTclpFreeAllocCache(tls, cachePtr)
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.14 Signal handling <signal.h>

// IMPLEMENTATION NOTES:
//
// The primary idea is that we create one platform-specific TSD slot, and use
// it for storing a table pointer. Each Tcl_ThreadDataKey has an offset into
// the table of TSD values. We don't use more than 1 platform-specific TSD
// slot, because there is a hard limit on the number of TSD slots. Valid key
// offsets are greater than 0; 0 is for the initialized Tcl_ThreadDataKey.

// The global collection of information about TSDs. This is shared across the
// whole process, and includes the mutex used to protect it.

var tsdGlobal = struct {
	Fkey         uintptr
	Fcounter     Sig_atomic_t
	F__ccgo_pad1 [4]byte
	Fmutex       Tcl_Mutex
}{} /* tclThreadStorage.c:44:3 */

// The type of the data held per thread in a system TSD.

type TSDTable = struct {
	FtablePtr    uintptr
	Fallocated   Sig_atomic_t
	F__ccgo_pad1 [4]byte
} /* tclThreadStorage.c:54:3 */

// The actual type of Tcl_ThreadDataKey.

type TSDUnion = struct {
	F__ccgo_pad1 [0]uint64
	Foffset      Sig_atomic_t
	F__ccgo_pad2 [4]byte
} /* tclThreadStorage.c:67:3 */

// Allocator and deallocator for a TSDTable structure.

func sTSDTableCreate(tls *libc.TLS) uintptr { /* tclThreadStorage.c:82:17: */
	var tsdTablePtr uintptr
	var i Sig_atomic_t

	tsdTablePtr = libc.Xmalloc(tls, Size_t(unsafe.Sizeof(TSDTable{})))
	if tsdTablePtr == uintptr(0) {
		XTcl_Panic(tls, ts+65350, 0)
	}

	(*TSDTable)(unsafe.Pointer(tsdTablePtr)).Fallocated = 8
	(*TSDTable)(unsafe.Pointer(tsdTablePtr)).FtablePtr = libc.Xmalloc(tls, uint64(unsafe.Sizeof(uintptr(0)))*uint64((*TSDTable)(unsafe.Pointer(tsdTablePtr)).Fallocated))
	if (*TSDTable)(unsafe.Pointer(tsdTablePtr)).FtablePtr == uintptr(0) {
		XTcl_Panic(tls, ts+65350, 0)
	}

	for i = 0; i < (*TSDTable)(unsafe.Pointer(tsdTablePtr)).Fallocated; i++ {
		*(*ClientData)(unsafe.Pointer((*TSDTable)(unsafe.Pointer(tsdTablePtr)).FtablePtr + uintptr(i)*8)) = uintptr(0)
	}

	return tsdTablePtr
}

func sTSDTableDelete(tls *libc.TLS, tsdTablePtr uintptr) { /* tclThreadStorage.c:108:1: */
	var i Sig_atomic_t

	for i = 0; i < (*TSDTable)(unsafe.Pointer(tsdTablePtr)).Fallocated; i++ {
		if *(*ClientData)(unsafe.Pointer((*TSDTable)(unsafe.Pointer(tsdTablePtr)).FtablePtr + uintptr(i)*8)) != uintptr(0) {
			// These values were allocated in Tcl_GetThreadData in tclThread.c
			// and must now be deallocated or they will leak.

			XTclpFree(tls, *(*ClientData)(unsafe.Pointer((*TSDTable)(unsafe.Pointer(tsdTablePtr)).FtablePtr + uintptr(i)*8)))
		}
	}

	libc.Xfree(tls, (*TSDTable)(unsafe.Pointer(tsdTablePtr)).FtablePtr)
	libc.Xfree(tls, tsdTablePtr)
}

//----------------------------------------------------------------------
//
// TSDTableGrow --
//
//	This procedure makes the passed TSDTable grow to fit the atLeast
//	value.
//
// Results:
//	None.
//
// Side effects:
//	The table is enlarged.
//
//----------------------------------------------------------------------

func sTSDTableGrow(tls *libc.TLS, tsdTablePtr uintptr, atLeast Sig_atomic_t) { /* tclThreadStorage.c:146:1: */
	var newAllocated Sig_atomic_t = (*TSDTable)(unsafe.Pointer(tsdTablePtr)).Fallocated * 2
	var newTablePtr uintptr
	var i Sig_atomic_t

	if newAllocated <= atLeast {
		newAllocated = atLeast + 10
	}

	newTablePtr = libc.Xrealloc(tls, (*TSDTable)(unsafe.Pointer(tsdTablePtr)).FtablePtr, uint64(unsafe.Sizeof(ClientData(0)))*uint64(newAllocated))
	if newTablePtr == uintptr(0) {
		XTcl_Panic(tls, ts+65378, 0)
	}

	for i = (*TSDTable)(unsafe.Pointer(tsdTablePtr)).Fallocated; i < newAllocated; i++ {
		*(*ClientData)(unsafe.Pointer(newTablePtr + uintptr(i)*8)) = uintptr(0)
	}

	(*TSDTable)(unsafe.Pointer(tsdTablePtr)).Fallocated = newAllocated
	(*TSDTable)(unsafe.Pointer(tsdTablePtr)).FtablePtr = newTablePtr
}

//----------------------------------------------------------------------
//
// TclThreadStorageKeyGet --
//
//    This procedure gets the value associated with the passed key.
//
// Results:
//	A pointer value associated with the Tcl_ThreadDataKey or NULL.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclThreadStorageKeyGet(tls *libc.TLS, dataKeyPtr uintptr) uintptr { /* tclThreadStorage.c:188:6: */
	var tsdTablePtr uintptr = XTclpThreadGetGlobalTSD(tls, tsdGlobal.Fkey)
	var resultPtr ClientData = uintptr(0)
	var keyPtr uintptr = dataKeyPtr
	var offset Sig_atomic_t = *(*Sig_atomic_t)(unsafe.Pointer(keyPtr /* .Foffset */))

	if tsdTablePtr != uintptr(0) && offset > 0 &&
		offset < (*TSDTable)(unsafe.Pointer(tsdTablePtr)).Fallocated {
		resultPtr = *(*ClientData)(unsafe.Pointer((*TSDTable)(unsafe.Pointer(tsdTablePtr)).FtablePtr + uintptr(offset)*8))
	}
	return resultPtr
}

//----------------------------------------------------------------------
//
// TclThreadStorageKeySet --
//
//	This procedure set an association of value with the key passed. The
//	associated value may be retrieved with TclThreadDataKeyGet().
//
// Results:
//	None.
//
// Side effects:
//	The thread-specific table may be created or reallocated.
//
//----------------------------------------------------------------------

func XTclThreadStorageKeySet(tls *libc.TLS, dataKeyPtr uintptr, value uintptr) { /* tclThreadStorage.c:222:1: */
	var tsdTablePtr uintptr = XTclpThreadGetGlobalTSD(tls, tsdGlobal.Fkey)
	var keyPtr uintptr = dataKeyPtr

	if tsdTablePtr == uintptr(0) {
		tsdTablePtr = sTSDTableCreate(tls)
		XTclpThreadSetGlobalTSD(tls, tsdGlobal.Fkey, tsdTablePtr)
	}

	// Get the lock while we check if this TSD is new or not. Note that this
	// is the only place where Tcl_ThreadDataKey values are set. We use a
	// double-checked lock to try to avoid having to grab this lock a lot,
	// since it is on quite a few critical paths and will only get set once in
	// each location.

	if *(*Sig_atomic_t)(unsafe.Pointer(keyPtr)) == 0 {
		XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&tsdGlobal))+16)
		if *(*Sig_atomic_t)(unsafe.Pointer(keyPtr)) == 0 {
			// The Tcl_ThreadDataKey hasn't been used yet. Make a new one.

			*(*Sig_atomic_t)(unsafe.Pointer(keyPtr)) = libc.PreIncInt32(&tsdGlobal.Fcounter, 1)
		}
		XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&tsdGlobal))+16)
	}

	// Check if this is the first time this Tcl_ThreadDataKey has been used
	// with the current thread. Note that we don't need to hold a lock when
	// doing this, as we are *definitely* the only point accessing this
	// tsdTablePtr right now; it's thread-local.

	if *(*Sig_atomic_t)(unsafe.Pointer(keyPtr)) >= (*TSDTable)(unsafe.Pointer(tsdTablePtr)).Fallocated {
		sTSDTableGrow(tls, tsdTablePtr, *(*Sig_atomic_t)(unsafe.Pointer(keyPtr /* .Foffset */)))
	}

	// Set the value in the Tcl thread-local variable.

	*(*ClientData)(unsafe.Pointer((*TSDTable)(unsafe.Pointer(tsdTablePtr)).FtablePtr + uintptr(*(*Sig_atomic_t)(unsafe.Pointer(keyPtr /* .Foffset */)))*8)) = value
}

//----------------------------------------------------------------------
//
// TclFinalizeThreadDataThread --
//
//	This procedure finalizes the data for a single thread.
//
// Results:
//	None.
//
// Side effects:
//	The TSDTable is deleted/freed.
//
//----------------------------------------------------------------------

func XTclFinalizeThreadDataThread(tls *libc.TLS) { /* tclThreadStorage.c:289:1: */
	var tsdTablePtr uintptr = XTclpThreadGetGlobalTSD(tls, tsdGlobal.Fkey)

	if tsdTablePtr != uintptr(0) {
		sTSDTableDelete(tls, tsdTablePtr)
		XTclpThreadSetGlobalTSD(tls, tsdGlobal.Fkey, uintptr(0))
	}
}

//----------------------------------------------------------------------
//
// TclInitializeThreadStorage --
//
//	This procedure initializes the TSD subsystem with per-platform code.
//	This should be called before any Tcl threads are created.
//
// Results:
//	None.
//
// Side effects:
//	Allocates a system TSD.
//
//----------------------------------------------------------------------

func XTclInitThreadStorage(tls *libc.TLS) { /* tclThreadStorage.c:317:1: */
	tsdGlobal.Fkey = XTclpThreadCreateKey(tls)
}

//----------------------------------------------------------------------
//
// TclFinalizeThreadStorage --
//
//	This procedure cleans up the thread storage data key for all threads.
//	IMPORTANT: All Tcl threads must be finalized before calling this!
//
// Results:
//	None.
//
// Side effects:
//	Releases the thread data key.
//
//----------------------------------------------------------------------

func XTclFinalizeThreadStorage(tls *libc.TLS) { /* tclThreadStorage.c:340:1: */
	XTclpThreadDeleteKey(tls, tsdGlobal.Fkey)
	tsdGlobal.Fkey = uintptr(0)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// For each timer callback that's pending there is one record of the following
// type. The normal handlers (created by Tcl_CreateTimerHandler) are chained
// together in a list sorted by time (earliest event first).

type TimerHandler1 = struct {
	Ftime       Tcl_Time
	Fproc       uintptr
	FclientData ClientData
	Ftoken      Tcl_TimerToken
	FnextPtr    uintptr
} /* tclTimer.c:21:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// For each timer callback that's pending there is one record of the following
// type. The normal handlers (created by Tcl_CreateTimerHandler) are chained
// together in a list sorted by time (earliest event first).

type TimerHandler = TimerHandler1 /* tclTimer.c:29:3 */

// The data structure below is used by the "after" command to remember the
// command to be executed later. All of the pending "after" commands for an
// interpreter are linked together in a list.

type AfterInfo1 = struct {
	FassocPtr    uintptr
	FcommandPtr  uintptr
	Fid          int32
	F__ccgo_pad1 [4]byte
	Ftoken       Tcl_TimerToken
	FnextPtr     uintptr
} /* tclTimer.c:37:9 */

// The data structure below is used by the "after" command to remember the
// command to be executed later. All of the pending "after" commands for an
// interpreter are linked together in a list.

type AfterAssocData1 = struct {
	Finterp        uintptr
	FfirstAfterPtr uintptr
} /* tclTimer.c:37:9 */

// The data structure below is used by the "after" command to remember the
// command to be executed later. All of the pending "after" commands for an
// interpreter are linked together in a list.

type AfterInfo = AfterInfo1 /* tclTimer.c:52:3 */

// One of the following structures is associated with each interpreter for
// which an "after" command has ever been invoked. A pointer to this structure
// is stored in the AssocData for the "tclAfter" key.

type AfterAssocData = AfterAssocData1 /* tclTimer.c:66:3 */

// There is one of the following structures for each of the handlers declared
// in a call to Tcl_DoWhenIdle. All of the currently-active handlers are
// linked together into a list.

type IdleHandler1 = struct {
	Fproc        uintptr
	FclientData  ClientData
	Fgeneration  int32
	F__ccgo_pad1 [4]byte
	FnextPtr     uintptr
} /* tclTimer.c:74:9 */

// There is one of the following structures for each of the handlers declared
// in a call to Tcl_DoWhenIdle. All of the currently-active handlers are
// linked together into a list.

type IdleHandler = IdleHandler1 /* tclTimer.c:80:3 */

// The timer and idle queues are per-thread because they are associated with
// the notifier, which is also per-thread.
//
// All static variables used in this file are collected into a single instance
// of the following structure. For multi-threaded implementations, there is
// one instance of this structure for each thread.
//
// Notice that different structures with the same name appear in other files.
// The structure defined below is used in this file only.

type ThreadSpecificData12 = struct {
	FfirstTimerHandlerPtr uintptr
	FlastTimerId          int32
	FtimerPending         int32
	FidleList             uintptr
	FlastIdlePtr          uintptr
	FidleGeneration       int32
	FafterId              int32
} /* tclTimer.c:108:3 */

var dataKey11 Tcl_ThreadDataKey /* tclTimer.c:110:26: */

//----------------------------------------------------------------------
//
// InitTimer --
//
//	This function initializes the timer module.
//
// Results:
//	A pointer to the thread specific data.
//
// Side effects:
//	Registers the idle and timer event sources.
//
//----------------------------------------------------------------------

func sInitTimer(tls *libc.TLS) uintptr { /* tclTimer.c:182:27: */
	var tsdPtr uintptr = XTclThreadDataKeyGet(tls, uintptr(unsafe.Pointer(&dataKey11)))

	if tsdPtr == uintptr(0) {
		tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey11)), int32(unsafe.Sizeof(ThreadSpecificData12{})))
		XTcl_CreateEventSource(tls, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, int32)
		}{sTimerSetupProc})), *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, int32)
		}{sTimerCheckProc})), uintptr(0))
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sTimerExitProc})), uintptr(0))
	}
	return tsdPtr
}

//----------------------------------------------------------------------
//
// TimerExitProc --
//
//	This function is call at exit or unload time to remove the timer and
//	idle event sources.
//
// Results:
//	None.
//
// Side effects:
//	Removes the timer and idle event sources and remaining events.
//
//----------------------------------------------------------------------

func sTimerExitProc(tls *libc.TLS, clientData ClientData) { /* tclTimer.c:213:1: */
	var tsdPtr uintptr = XTclThreadDataKeyGet(tls, uintptr(unsafe.Pointer(&dataKey11)))

	XTcl_DeleteEventSource(tls, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sTimerSetupProc})), *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sTimerCheckProc})), uintptr(0))
	if tsdPtr != uintptr(0) {
		var timerHandlerPtr uintptr

		timerHandlerPtr = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr
		for timerHandlerPtr != uintptr(0) {
			(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr = (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).FnextPtr
			XTclpFree(tls, timerHandlerPtr)
			timerHandlerPtr = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr
		}
	}
}

//--------------------------------------------------------------
//
// Tcl_CreateTimerHandler --
//
//	Arrange for a given function to be invoked at a particular time in the
//	future.
//
// Results:
//	The return value is a token for the timer event, which may be used to
//	delete the event before it fires.
//
// Side effects:
//	When milliseconds have elapsed, proc will be invoked exactly once.
//
//--------------------------------------------------------------

func XTcl_CreateTimerHandler(tls *libc.TLS, milliseconds int32, proc uintptr, clientData ClientData) Tcl_TimerToken { /* tclTimer.c:250:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var time Tcl_Time at bp, 16

	// Compute when the event should fire.

	XTcl_GetTime(tls, bp)
	*(*int64)(unsafe.Pointer(bp)) += int64(milliseconds / 1000)
	*(*int64)(unsafe.Pointer(bp + 8)) += int64(milliseconds % 1000 * 1000)
	if (*Tcl_Time)(unsafe.Pointer(bp)).Fusec >= int64(1000000) {
		*(*int64)(unsafe.Pointer(bp + 8)) -= int64(1000000)
		*(*int64)(unsafe.Pointer(bp)) += int64(1)
	}
	return XTclCreateAbsoluteTimerHandler(tls, bp, proc, clientData)
}

//--------------------------------------------------------------
//
// TclCreateAbsoluteTimerHandler --
//
//	Arrange for a given function to be invoked at a particular time in the
//	future.
//
// Results:
//	The return value is a token for the timer event, which may be used to
//	delete the event before it fires.
//
// Side effects:
//	When the time in timePtr has been reached, proc will be invoked
//	exactly once.
//
//--------------------------------------------------------------

func XTclCreateAbsoluteTimerHandler(tls *libc.TLS, timePtr uintptr, proc uintptr, clientData ClientData) Tcl_TimerToken { /* tclTimer.c:292:1: */
	var timerHandlerPtr uintptr
	var tPtr2 uintptr
	var prevPtr uintptr
	var tsdPtr uintptr = sInitTimer(tls)

	timerHandlerPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TimerHandler{})))

	// Fill in fields for the event.

	libc.Xmemcpy(tls, timerHandlerPtr, timePtr, uint64(unsafe.Sizeof(Tcl_Time{})))
	(*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Fproc = proc
	(*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).FclientData = clientData
	(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FlastTimerId++
	(*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Ftoken = uintptr(Intptr_t((*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FlastTimerId))

	// Add the event to the queue in the correct position (ordered by event
	// firing time).

	tPtr2 = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr
	prevPtr = uintptr(0)
__1:
	if !(tPtr2 != uintptr(0)) {
		goto __3
	}
	{
		if (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Ftime.Fsec < (*TimerHandler)(unsafe.Pointer(tPtr2)).Ftime.Fsec || (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Ftime.Fsec == (*TimerHandler)(unsafe.Pointer(tPtr2)).Ftime.Fsec && (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Ftime.Fusec < (*TimerHandler)(unsafe.Pointer(tPtr2)).Ftime.Fusec {
			goto __3
		}

	}
	goto __2
__2:
	prevPtr = tPtr2
	tPtr2 = (*TimerHandler)(unsafe.Pointer(tPtr2)).FnextPtr
	goto __1
	goto __3
__3:
	;
	(*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).FnextPtr = tPtr2
	if prevPtr == uintptr(0) {
		(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr = timerHandlerPtr
	} else {
		(*TimerHandler)(unsafe.Pointer(prevPtr)).FnextPtr = timerHandlerPtr
	}

	sTimerSetupProc(tls, uintptr(0), libc.CplInt32(int32(1)<<1))

	return (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Ftoken
}

//--------------------------------------------------------------
//
// Tcl_DeleteTimerHandler --
//
//	Delete a previously-registered timer handler.
//
// Results:
//	None.
//
// Side effects:
//	Destroy the timer callback identified by TimerToken, so that its
//	associated function will not be called. If the callback has already
//	fired, or if the given token doesn't exist, then nothing happens.
//
//--------------------------------------------------------------

func XTcl_DeleteTimerHandler(tls *libc.TLS, token Tcl_TimerToken) { /* tclTimer.c:354:1: */
	var timerHandlerPtr uintptr
	var prevPtr uintptr
	var tsdPtr uintptr = sInitTimer(tls)

	if token == uintptr(0) {
		return
	}

	timerHandlerPtr = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr
	prevPtr = uintptr(0)
__1:
	if !(timerHandlerPtr != uintptr(0)) {
		goto __3
	}
	{
		if (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Ftoken != token {
			goto __2
		}
		if prevPtr == uintptr(0) {
			(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr = (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).FnextPtr
		} else {
			(*TimerHandler)(unsafe.Pointer(prevPtr)).FnextPtr = (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).FnextPtr
		}
		XTclpFree(tls, timerHandlerPtr)
		return

	}
	goto __2
__2:
	prevPtr = timerHandlerPtr
	timerHandlerPtr = (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).FnextPtr
	goto __1
	goto __3
__3:
}

//----------------------------------------------------------------------
//
// TimerSetupProc --
//
//	This function is called by Tcl_DoOneEvent to setup the timer event
//	source for before blocking. This routine checks both the idle and
//	after timer lists.
//
// Results:
//	None.
//
// Side effects:
//	May update the maximum notifier block time.
//
//----------------------------------------------------------------------

func sTimerSetupProc(tls *libc.TLS, data ClientData, flags int32) { /* tclTimer.c:400:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var blockTime Tcl_Time at bp, 16

	var tsdPtr uintptr = sInitTimer(tls)

	if flags&(int32(1)<<5) != 0 && (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleList != 0 ||
		flags&(int32(1)<<4) != 0 && (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FtimerPending != 0 {
		// There is an idle handler or a pending timer event, so just poll.

		(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fsec = int64(0)
		(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fusec = int64(0)
	} else if flags&(int32(1)<<4) != 0 && (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr != 0 {
		// Compute the timeout for the next timer on the list.

		XTcl_GetTime(tls, bp)
		(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fsec = (*TimerHandler)(unsafe.Pointer((*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr)).Ftime.Fsec - (*Tcl_Time)(unsafe.Pointer(bp)).Fsec
		(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fusec = (*TimerHandler)(unsafe.Pointer((*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr)).Ftime.Fusec - (*Tcl_Time)(unsafe.Pointer(bp)).Fusec
		if (*Tcl_Time)(unsafe.Pointer(bp)).Fusec < int64(0) {
			*(*int64)(unsafe.Pointer(bp)) -= int64(1)
			*(*int64)(unsafe.Pointer(bp + 8)) += int64(1000000)
		}
		if (*Tcl_Time)(unsafe.Pointer(bp)).Fsec < int64(0) {
			(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fsec = int64(0)
			(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fusec = int64(0)
		}
	} else {
		return
	}

	XTcl_SetMaxBlockTime(tls, bp)
}

//----------------------------------------------------------------------
//
// TimerCheckProc --
//
//	This function is called by Tcl_DoOneEvent to check the timer event
//	source for events. This routine checks both the idle and after timer
//	lists.
//
// Results:
//	None.
//
// Side effects:
//	May queue an event and update the maximum notifier block time.
//
//----------------------------------------------------------------------

func sTimerCheckProc(tls *libc.TLS, data ClientData, flags int32) { /* tclTimer.c:458:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var timerEvPtr uintptr
	// var blockTime Tcl_Time at bp, 16

	var tsdPtr uintptr = sInitTimer(tls)

	if flags&(int32(1)<<4) != 0 && (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr != 0 {
		// Compute the timeout for the next timer on the list.

		XTcl_GetTime(tls, bp)
		(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fsec = (*TimerHandler)(unsafe.Pointer((*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr)).Ftime.Fsec - (*Tcl_Time)(unsafe.Pointer(bp)).Fsec
		(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fusec = (*TimerHandler)(unsafe.Pointer((*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr)).Ftime.Fusec - (*Tcl_Time)(unsafe.Pointer(bp)).Fusec
		if (*Tcl_Time)(unsafe.Pointer(bp)).Fusec < int64(0) {
			*(*int64)(unsafe.Pointer(bp)) -= int64(1)
			*(*int64)(unsafe.Pointer(bp + 8)) += int64(1000000)
		}
		if (*Tcl_Time)(unsafe.Pointer(bp)).Fsec < int64(0) {
			(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fsec = int64(0)
			(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fusec = int64(0)
		}

		// If the first timer has expired, stick an event on the queue.

		if (*Tcl_Time)(unsafe.Pointer(bp)).Fsec == int64(0) && (*Tcl_Time)(unsafe.Pointer(bp)).Fusec == int64(0) && !((*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FtimerPending != 0) {
			(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FtimerPending = 1
			timerEvPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_Event{})))
			(*Tcl_Event)(unsafe.Pointer(timerEvPtr)).Fproc = *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, uintptr, int32) int32
			}{sTimerHandlerEventProc}))
			XTcl_QueueEvent(tls, timerEvPtr, TCL_QUEUE_TAIL)
		}
	}
}

//----------------------------------------------------------------------
//
// TimerHandlerEventProc --
//
//	This function is called by Tcl_ServiceEvent when a timer event reaches
//	the front of the event queue. This function handles the event by
//	invoking the callbacks for all timers that are ready.
//
// Results:
//	Returns 1 if the event was handled, meaning it should be removed from
//	the queue. Returns 0 if the event was not handled, meaning it should
//	stay on the queue. The only time the event isn't handled is if the
//	TCL_TIMER_EVENTS flag bit isn't set.
//
// Side effects:
//	Whatever the timer handler callback functions do.
//
//----------------------------------------------------------------------

func sTimerHandlerEventProc(tls *libc.TLS, evPtr uintptr, flags int32) int32 { /* tclTimer.c:520:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var timerHandlerPtr uintptr
	var nextPtrPtr uintptr
	// var time Tcl_Time at bp, 16

	var currentTimerId int32
	var tsdPtr uintptr = sInitTimer(tls)

	// Do nothing if timers aren't enabled. This leaves the event on the
	// queue, so we will get to it as soon as ServiceEvents() is called with
	// timers enabled.

	if !(flags&(int32(1)<<4) != 0) {
		return 0
	}

	// The code below is trickier than it may look, for the following reasons:
	//
	// 1. New handlers can get added to the list while the current one is
	//	  being processed. If new ones get added, we don't want to process
	//	  them during this pass through the list to avoid starving other event
	//	  sources. This is implemented using the token number in the handler:
	//	  new handlers will have a newer token than any of the ones currently
	//	  on the list.
	// 2. The handler can call Tcl_DoOneEvent, so we have to remove the
	//	  handler from the list before calling it. Otherwise an infinite loop
	//	  could result.
	// 3. Tcl_DeleteTimerHandler can be called to remove an element from the
	//	  list while a handler is executing, so the list could change
	//	  structure during the call.
	// 4. Because we only fetch the current time before entering the loop, the
	//	  only way a new timer will even be considered runnable is if its
	//	  expiration time is within the same millisecond as the current time.
	//	  This is fairly likely on Windows, since it has a course granularity
	//	  clock. Since timers are placed on the queue in time order with the
	//	  most recently created handler appearing after earlier ones with the
	//	  same expiration time, we don't have to worry about newer generation
	//	  timers appearing before later ones.

	(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FtimerPending = 0
	currentTimerId = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FlastTimerId
	XTcl_GetTime(tls, bp)
	for 1 != 0 {
		nextPtrPtr = tsdPtr
		timerHandlerPtr = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FfirstTimerHandlerPtr
		if timerHandlerPtr == uintptr(0) {
			break
		}

		if (*Tcl_Time)(unsafe.Pointer(bp)).Fsec < (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Ftime.Fsec || (*Tcl_Time)(unsafe.Pointer(bp)).Fsec == (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Ftime.Fsec && (*Tcl_Time)(unsafe.Pointer(bp)).Fusec < (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Ftime.Fusec {
			break
		}

		// Bail out if the next timer is of a newer generation.

		if currentTimerId-int32((*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Ftoken) < 0 {
			break
		}

		// Remove the handler from the queue before invoking it, to avoid
		// potential reentrancy problems.

		*(*uintptr)(unsafe.Pointer(nextPtrPtr)) = (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).FnextPtr
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).Fproc})).f(tls, (*TimerHandler)(unsafe.Pointer(timerHandlerPtr)).FclientData)
		XTclpFree(tls, timerHandlerPtr)
	}
	sTimerSetupProc(tls, uintptr(0), int32(1)<<4)
	return 1
}

//--------------------------------------------------------------
//
// Tcl_DoWhenIdle --
//
//	Arrange for proc to be invoked the next time the system is idle (i.e.,
//	just before the next time that Tcl_DoOneEvent would have to wait for
//	something to happen).
//
// Results:
//	None.
//
// Side effects:
//	Proc will eventually be called, with clientData as argument. See the
//	manual entry for details.
//
//--------------------------------------------------------------

func XTcl_DoWhenIdle(tls *libc.TLS, proc uintptr, clientData ClientData) { /* tclTimer.c:620:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var idlePtr uintptr
	// var blockTime Tcl_Time at bp, 16

	var tsdPtr uintptr = sInitTimer(tls)

	idlePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(IdleHandler{})))
	(*IdleHandler)(unsafe.Pointer(idlePtr)).Fproc = proc
	(*IdleHandler)(unsafe.Pointer(idlePtr)).FclientData = clientData
	(*IdleHandler)(unsafe.Pointer(idlePtr)).Fgeneration = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleGeneration
	(*IdleHandler)(unsafe.Pointer(idlePtr)).FnextPtr = uintptr(0)
	if (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FlastIdlePtr == uintptr(0) {
		(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleList = idlePtr
	} else {
		(*IdleHandler)(unsafe.Pointer((*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FlastIdlePtr)).FnextPtr = idlePtr
	}
	(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FlastIdlePtr = idlePtr

	(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fsec = int64(0)
	(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fusec = int64(0)
	XTcl_SetMaxBlockTime(tls, bp)
}

//----------------------------------------------------------------------
//
// Tcl_CancelIdleCall --
//
//	If there are any when-idle calls requested to a given function with
//	given clientData, cancel all of them.
//
// Results:
//	None.
//
// Side effects:
//	If the proc/clientData combination were on the when-idle list, they
//	are removed so that they will never be called.
//
//----------------------------------------------------------------------

func XTcl_CancelIdleCall(tls *libc.TLS, proc uintptr, clientData ClientData) { /* tclTimer.c:664:1: */
	var idlePtr uintptr
	var prevPtr uintptr
	var nextPtr uintptr
	var tsdPtr uintptr = sInitTimer(tls)

	prevPtr = uintptr(0)
	idlePtr = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleList
__1:
	if !(idlePtr != uintptr(0)) {
		goto __3
	}
	{
		for (*IdleHandler)(unsafe.Pointer(idlePtr)).Fproc == proc &&
			(*IdleHandler)(unsafe.Pointer(idlePtr)).FclientData == clientData {
			nextPtr = (*IdleHandler)(unsafe.Pointer(idlePtr)).FnextPtr
			XTclpFree(tls, idlePtr)
			idlePtr = nextPtr
			if prevPtr == uintptr(0) {
				(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleList = idlePtr
			} else {
				(*IdleHandler)(unsafe.Pointer(prevPtr)).FnextPtr = idlePtr
			}
			if idlePtr == uintptr(0) {
				(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FlastIdlePtr = prevPtr
				return
			}
		}

	}
	goto __2
__2:
	prevPtr = idlePtr
	idlePtr = (*IdleHandler)(unsafe.Pointer(idlePtr)).FnextPtr
	goto __1
	goto __3
__3:
}

//----------------------------------------------------------------------
//
// TclServiceIdle --
//
//	This function is invoked by the notifier when it becomes idle. It will
//	invoke all idle handlers that are present at the time the call is
//	invoked, but not those added during idle processing.
//
// Results:
//	The return value is 1 if TclServiceIdle found something to do,
//	otherwise return value is 0.
//
// Side effects:
//	Invokes all pending idle handlers.
//
//----------------------------------------------------------------------

func XTclServiceIdle(tls *libc.TLS) int32 { /* tclTimer.c:712:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var idlePtr uintptr
	var oldGeneration int32
	// var blockTime Tcl_Time at bp, 16

	var tsdPtr uintptr = sInitTimer(tls)

	if (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleList == uintptr(0) {
		return 0
	}

	oldGeneration = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleGeneration
	(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleGeneration++

	// The code below is trickier than it may look, for the following reasons:
	//
	// 1. New handlers can get added to the list while the current one is
	//	  being processed. If new ones get added, we don't want to process
	//	  them during this pass through the list (want to check for other work
	//	  to do first). This is implemented using the generation number in the
	//	  handler: new handlers will have a different generation than any of
	//	  the ones currently on the list.
	// 2. The handler can call Tcl_DoOneEvent, so we have to remove the
	//	  handler from the list before calling it. Otherwise an infinite loop
	//	  could result.
	// 3. Tcl_CancelIdleCall can be called to remove an element from the list
	//	  while a handler is executing, so the list could change structure
	//	  during the call.

	for idlePtr = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleList; idlePtr != uintptr(0) &&
		oldGeneration-(*IdleHandler)(unsafe.Pointer(idlePtr)).Fgeneration >= 0; idlePtr = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleList {
		(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleList = (*IdleHandler)(unsafe.Pointer(idlePtr)).FnextPtr
		if (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleList == uintptr(0) {
			(*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FlastIdlePtr = uintptr(0)
		}
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*IdleHandler)(unsafe.Pointer(idlePtr)).Fproc})).f(tls, (*IdleHandler)(unsafe.Pointer(idlePtr)).FclientData)
		XTclpFree(tls, idlePtr)
	}
	if (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FidleList != 0 {
		(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fsec = int64(0)
		(*Tcl_Time)(unsafe.Pointer(bp /* &blockTime */)).Fusec = int64(0)
		XTcl_SetMaxBlockTime(tls, bp)
	}
	return 1
}

//----------------------------------------------------------------------
//
// Tcl_AfterObjCmd --
//
//	This function is invoked to process the "after" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_AfterObjCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclTimer.c:781:1: */
	bp := tls.Alloc(168)
	defer tls.Free(168)

	*(*Tcl_WideInt)(unsafe.Pointer(bp + 136 /* ms */)) = int64(0) // Number of milliseconds to wait
	// var wakeup Tcl_Time at bp+144, 16

	var afterPtr uintptr
	var assocPtr uintptr
	// var length int32 at bp+160, 4

	// var index int32 at bp+128, 4

	var tsdPtr uintptr = sInitTimer(tls)

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+56587)
		return TCL_ERROR
	}

	// Create the "after" information associated for this interpreter, if it
	// doesn't already exist.

	assocPtr = XTcl_GetAssocData(tls, interp, ts+65408, uintptr(0))
	if assocPtr == uintptr(0) {
		assocPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(AfterAssocData{})))
		(*AfterAssocData)(unsafe.Pointer(assocPtr)).Finterp = interp
		(*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr = uintptr(0)
		XTcl_SetAssocData(tls, interp, ts+65408, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr)
		}{sAfterCleanupProc})), assocPtr)
	}

	// First lets see if the command was passed a number as the first argument.

	if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) ||
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType)) ||
		XTcl_GetIndexFromObjStruct(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&afterSubCmds)), int32(unsafe.Sizeof(uintptr(0))), ts+2046, 0, bp+128) != TCL_OK {
		*(*int32)(unsafe.Pointer(bp + 128 /* index */)) = -1
		if XTcl_GetWideIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+136) != TCL_OK {
			var arg uintptr = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))

			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

				ts+65417, libc.VaList(bp, arg)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+16210, ts+65478,
				arg, uintptr(0)))
			return TCL_ERROR
		}
	}

	// At this point, either index = -1 and ms contains the number of ms
	// to wait, or else index is the index of a subcommand.

	switch *(*int32)(unsafe.Pointer(bp + 128 /* index */)) {
	case -1:
		{
			if *(*Tcl_WideInt)(unsafe.Pointer(bp + 136)) < int64(0) {
				*(*Tcl_WideInt)(unsafe.Pointer(bp + 136 /* ms */)) = int64(0)
			}
			if objc == 2 {
				return sAfterDelay(tls, interp, *(*Tcl_WideInt)(unsafe.Pointer(bp + 136 /* ms */)))
			}
			afterPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(AfterInfo{})))
			(*AfterInfo)(unsafe.Pointer(afterPtr)).FassocPtr = assocPtr
			if objc == 3 {
				(*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8))
			} else {
				(*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr = XTcl_ConcatObj(tls, objc-2, objv+uintptr(2)*8)
			}
			(*Tcl_Obj)(unsafe.Pointer((*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr)).FrefCount++

			// The variable below is used to generate unique identifiers for after
			// commands. This id can wrap around, which can potentially cause
			// problems. However, there are not likely to be problems in practice,
			// because after commands can only be requested to about a month in
			// the future, and wrap-around is unlikely to occur in less than about
			// 1-10 years. Thus it's unlikely that any old ids will still be
			// around when wrap-around occurs.

			(*AfterInfo)(unsafe.Pointer(afterPtr)).Fid = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FafterId
			*(*int32)(unsafe.Pointer(tsdPtr + 36)) += 1
			XTcl_GetTime(tls, bp+144)
			*(*int64)(unsafe.Pointer(bp + 144)) += *(*Tcl_WideInt)(unsafe.Pointer(bp + 136)) / int64(1000)
			*(*int64)(unsafe.Pointer(bp + 144 + 8)) += *(*Tcl_WideInt)(unsafe.Pointer(bp + 136)) % int64(1000) * int64(1000)
			if (*Tcl_Time)(unsafe.Pointer(bp+144)).Fusec > int64(1000000) {
				(*Tcl_Time)(unsafe.Pointer(bp+144 /* &wakeup */)).Fsec++
				*(*int64)(unsafe.Pointer(bp + 144 + 8)) -= int64(1000000)
			}
			(*AfterInfo)(unsafe.Pointer(afterPtr)).Ftoken = XTclCreateAbsoluteTimerHandler(tls, bp+144,
				*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sAfterProc})), afterPtr)
			(*AfterInfo)(unsafe.Pointer(afterPtr)).FnextPtr = (*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr
			(*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr = afterPtr
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+65487, libc.VaList(bp+56, (*AfterInfo)(unsafe.Pointer(afterPtr)).Fid)))
			return TCL_OK

		}
	case 0 /* AFTER_CANCEL */ :
		{
			var commandPtr uintptr
			var command uintptr
			var tempCommand uintptr
			// var tempLength int32 at bp+164, 4

			if objc < 3 {
				XTcl_WrongNumArgs(tls, interp, 2, objv, ts+65496)
				return TCL_ERROR
			}
			if objc == 3 {
				commandPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8))
			} else {
				commandPtr = XTcl_ConcatObj(tls, objc-2, objv+uintptr(2)*8)
			}
			command = XTcl_GetStringFromObj(tls, commandPtr, bp+160)
			for afterPtr = (*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr; afterPtr != uintptr(0); afterPtr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FnextPtr {
				tempCommand = XTcl_GetStringFromObj(tls, (*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr,
					bp+164)
				if *(*int32)(unsafe.Pointer(bp + 160)) == *(*int32)(unsafe.Pointer(bp + 164)) &&
					!(libc.Xmemcmp(tls, command, tempCommand, uint64(*(*int32)(unsafe.Pointer(bp + 160)))) != 0) {
					break
				}
			}
			if afterPtr == uintptr(0) {
				afterPtr = sGetAfterEvent(tls, assocPtr, commandPtr)
			}
			if objc != 3 {
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = commandPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}
			if afterPtr != uintptr(0) {
				if (*AfterInfo)(unsafe.Pointer(afterPtr)).Ftoken != uintptr(0) {
					XTcl_DeleteTimerHandler(tls, (*AfterInfo)(unsafe.Pointer(afterPtr)).Ftoken)
				} else {
					XTcl_CancelIdleCall(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sAfterProc})), afterPtr)
				}
				sFreeAfterPtr(tls, afterPtr)
			}
			break

		}
	case 1 /* AFTER_IDLE */ :
		if objc < 3 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, ts+65507)
			return TCL_ERROR
		}
		afterPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(AfterInfo{})))
		(*AfterInfo)(unsafe.Pointer(afterPtr)).FassocPtr = assocPtr
		if objc == 3 {
			(*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8))
		} else {
			(*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr = XTcl_ConcatObj(tls, objc-2, objv+uintptr(2)*8)
		}
		(*Tcl_Obj)(unsafe.Pointer((*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr)).FrefCount++
		(*AfterInfo)(unsafe.Pointer(afterPtr)).Fid = (*ThreadSpecificData12)(unsafe.Pointer(tsdPtr)).FafterId
		*(*int32)(unsafe.Pointer(tsdPtr + 36)) += 1
		(*AfterInfo)(unsafe.Pointer(afterPtr)).Ftoken = uintptr(0)
		(*AfterInfo)(unsafe.Pointer(afterPtr)).FnextPtr = (*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr
		(*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr = afterPtr
		XTcl_DoWhenIdle(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sAfterProc})), afterPtr)
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+65487, libc.VaList(bp+64, (*AfterInfo)(unsafe.Pointer(afterPtr)).Fid)))
		break
	case 2 /* AFTER_INFO */ :
		if objc == 2 {
			var resultObj uintptr = XTcl_NewObj(tls)

			for afterPtr = (*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr; afterPtr != uintptr(0); afterPtr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FnextPtr {
				if (*AfterAssocData)(unsafe.Pointer(assocPtr)).Finterp == interp {
					XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, XTcl_ObjPrintf(tls,
						ts+65487, libc.VaList(bp+72, (*AfterInfo)(unsafe.Pointer(afterPtr)).Fid)))
				}
			}
			XTcl_SetObjResult(tls, interp, resultObj)
			return TCL_OK
		}
		if objc != 3 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, ts+65527)
			return TCL_ERROR
		}
		afterPtr = sGetAfterEvent(tls, assocPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
		if afterPtr == uintptr(0) {
			var eventStr uintptr = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
			}()

			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+65532, libc.VaList(bp+80, eventStr)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, ts+3593, ts+7170, ts+27708, eventStr, uintptr(0)))
			return TCL_ERROR
		} else {
			var resultListPtr uintptr = XTcl_NewObj(tls)

			XTcl_ListObjAppendElement(tls, interp, resultListPtr,
				(*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr)
			XTcl_ListObjAppendElement(tls, interp, resultListPtr, XTcl_NewStringObj(tls,
				func() uintptr {
					if (*AfterInfo)(unsafe.Pointer(afterPtr)).Ftoken == uintptr(0) {
						return ts + 22741 /* "idle" */
					}
					return ts + 65557 /* "timer" */
				}(), -1))
			XTcl_SetObjResult(tls, interp, resultListPtr)
		}
		break
	default:
		XTcl_Panic(tls, ts+65563, 0)
	}
	return TCL_OK
}

var afterSubCmds = [4]uintptr{
	ts + 41959, ts + 22741, ts + 13499, uintptr(0),
} /* tclTimer.c:793:23 */

//----------------------------------------------------------------------
//
// AfterDelay --
//
//	Implements the blocking delay behaviour of [after $time]. Tricky
//	because it has to take into account any time limit that has been set.
//
// Results:
//	Standard Tcl result code (with error set if an error occurred due to a
//	time limit being exceeded or being canceled).
//
// Side effects:
//	May adjust the time limit granularity marker.
//
//----------------------------------------------------------------------

func sAfterDelay(tls *libc.TLS, interp uintptr, ms Tcl_WideInt) int32 { /* tclTimer.c:1011:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var iPtr uintptr = interp
	// var endTime Tcl_Time at bp+16, 16

	// var now Tcl_Time at bp, 16

	var diff Tcl_WideInt

	XTcl_GetTime(tls, bp)
	*(*Tcl_Time)(unsafe.Pointer(bp + 16 /* endTime */)) = *(*Tcl_Time)(unsafe.Pointer(bp /* now */))
	*(*int64)(unsafe.Pointer(bp + 16)) += ms / int64(1000)
	*(*int64)(unsafe.Pointer(bp + 16 + 8)) += int64(int32(ms%int64(1000)) * 1000)
	if (*Tcl_Time)(unsafe.Pointer(bp+16)).Fusec >= int64(1000000) {
		(*Tcl_Time)(unsafe.Pointer(bp+16 /* &endTime */)).Fsec++
		*(*int64)(unsafe.Pointer(bp + 16 + 8)) -= int64(1000000)
	}

	for ok := true; ok; ok = (*Tcl_Time)(unsafe.Pointer(bp)).Fsec < (*Tcl_Time)(unsafe.Pointer(bp+16)).Fsec || (*Tcl_Time)(unsafe.Pointer(bp)).Fsec == (*Tcl_Time)(unsafe.Pointer(bp+16)).Fsec && (*Tcl_Time)(unsafe.Pointer(bp)).Fusec < (*Tcl_Time)(unsafe.Pointer(bp+16)).Fusec {
		if XTcl_AsyncReady(tls) != 0 {
			if XTcl_AsyncInvoke(tls, interp, TCL_OK) != TCL_OK {
				return TCL_ERROR
			}
		}
		if XTcl_Canceled(tls, interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR {
			return TCL_ERROR
		}
		if (*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeEvent != uintptr(0) &&
			((*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fsec < (*Tcl_Time)(unsafe.Pointer(bp)).Fsec || (*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fsec == (*Tcl_Time)(unsafe.Pointer(bp)).Fsec && (*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fusec < (*Tcl_Time)(unsafe.Pointer(bp)).Fusec) {
			(*Interp)(unsafe.Pointer(iPtr)).Flimit.FgranularityTicker = 0
			if XTcl_LimitCheck(tls, interp) != TCL_OK {
				return TCL_ERROR
			}
		}
		if (*Interp)(unsafe.Pointer(iPtr)).Flimit.FtimeEvent == uintptr(0) ||
			((*Tcl_Time)(unsafe.Pointer(bp+16)).Fsec < (*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fsec || (*Tcl_Time)(unsafe.Pointer(bp+16)).Fsec == (*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fsec && (*Tcl_Time)(unsafe.Pointer(bp+16)).Fusec < (*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fusec) {
			diff = int64(1000)*((*Tcl_Time)(unsafe.Pointer(bp+16)).Fsec-(*Tcl_Time)(unsafe.Pointer(bp)).Fsec) + ((*Tcl_Time)(unsafe.Pointer(bp+16)).Fusec-(*Tcl_Time)(unsafe.Pointer(bp)).Fusec+int64(999))/int64(1000)
			if diff > int64(TCL_TIME_MAXIMUM_SLICE) {
				diff = int64(TCL_TIME_MAXIMUM_SLICE)
			}
			if diff == int64(0) && ((*Tcl_Time)(unsafe.Pointer(bp)).Fsec < (*Tcl_Time)(unsafe.Pointer(bp+16)).Fsec || (*Tcl_Time)(unsafe.Pointer(bp)).Fsec == (*Tcl_Time)(unsafe.Pointer(bp+16)).Fsec && (*Tcl_Time)(unsafe.Pointer(bp)).Fusec < (*Tcl_Time)(unsafe.Pointer(bp+16)).Fusec) {
				diff = int64(1)
			}
			if diff > int64(0) {
				XTcl_Sleep(tls, int32(diff))
				if diff < int64(SLEEP_OFFLOAD_GETTIMEOFDAY) {
					break
				}
			} else {
				break
			}
		} else {
			diff = int64(1000)*((*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fsec-(*Tcl_Time)(unsafe.Pointer(bp)).Fsec) + ((*Interp)(unsafe.Pointer(iPtr)).Flimit.Ftime.Fusec-(*Tcl_Time)(unsafe.Pointer(bp)).Fusec)/int64(1000)
			if diff > int64(TCL_TIME_MAXIMUM_SLICE) {
				diff = int64(TCL_TIME_MAXIMUM_SLICE)
			}
			if diff > int64(0) {
				XTcl_Sleep(tls, int32(diff))
			}
			if XTcl_AsyncReady(tls) != 0 {
				if XTcl_AsyncInvoke(tls, interp, TCL_OK) != TCL_OK {
					return TCL_ERROR
				}
			}
			if XTcl_Canceled(tls, interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR {
				return TCL_ERROR
			}
			if XTcl_LimitCheck(tls, interp) != TCL_OK {
				return TCL_ERROR
			}
		}
		XTcl_GetTime(tls, bp)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// GetAfterEvent --
//
//	This function parses an "after" id such as "after#4" and returns a
//	pointer to the AfterInfo structure.
//
// Results:
//	The return value is either a pointer to an AfterInfo structure, if one
//	is found that corresponds to "cmdString" and is for interp, or NULL if
//	no corresponding after event can be found.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sGetAfterEvent(tls *libc.TLS, assocPtr uintptr, commandPtr uintptr) uintptr { /* tclTimer.c:1116:18: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var cmdString uintptr // Textual identifier for after event, such as
	// "after#6".
	var afterPtr uintptr
	var id int32
	// var end uintptr at bp, 8

	cmdString = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(commandPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(commandPtr)).Fbytes
		}
		return XTcl_GetString(tls, commandPtr)
	}()
	if libc.Xstrncmp(tls, cmdString, ts+65617, uint64(6)) != 0 {
		return uintptr(0)
	}
	cmdString += uintptr(6)
	id = int32(libc.Xstrtoul(tls, cmdString, bp, 10))
	if *(*uintptr)(unsafe.Pointer(bp)) == cmdString || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != 0 {
		return uintptr(0)
	}
	for afterPtr = (*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr; afterPtr != uintptr(0); afterPtr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FnextPtr {
		if (*AfterInfo)(unsafe.Pointer(afterPtr)).Fid == id {
			return afterPtr
		}
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// AfterProc --
//
//	Timer callback to execute commands registered with the "after"
//	command.
//
// Results:
//	None.
//
// Side effects:
//	Executes whatever command was specified. If the command returns an
//	error, then the command "bgerror" is invoked to process the error; if
//	bgerror fails then information about the error is output on stderr.
//
//----------------------------------------------------------------------

func sAfterProc(tls *libc.TLS, clientData ClientData) { /* tclTimer.c:1166:1: */
	var afterPtr uintptr = clientData
	var assocPtr uintptr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FassocPtr
	var prevPtr uintptr
	var result int32
	var interp uintptr

	// First remove the callback from our list of callbacks; otherwise someone
	// could delete the callback while it's being executed, which could cause
	// a core dump.

	if (*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr == afterPtr {
		(*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FnextPtr
	} else {
		for prevPtr = (*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr; (*AfterInfo)(unsafe.Pointer(prevPtr)).FnextPtr != afterPtr; prevPtr = (*AfterInfo)(unsafe.Pointer(prevPtr)).FnextPtr {
			// Empty loop body.
		}
		(*AfterInfo)(unsafe.Pointer(prevPtr)).FnextPtr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FnextPtr
	}

	// Execute the callback.

	interp = (*AfterAssocData)(unsafe.Pointer(assocPtr)).Finterp
	XTcl_Preserve(tls, interp)
	result = XTcl_EvalObjEx(tls, interp, (*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr, TCL_EVAL_GLOBAL)
	if result != TCL_OK {
		XTcl_AddErrorInfo(tls, interp, ts+65624)
		XTcl_BackgroundException(tls, interp, result)
	}
	XTcl_Release(tls, interp)

	// Free the memory for the callback.

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTclpFree(tls, afterPtr)
}

//----------------------------------------------------------------------
//
// FreeAfterPtr --
//
//	This function removes an "after" command from the list of those that
//	are pending and frees its resources. This function does *not* cancel
//	the timer handler; if that's needed, the caller must do it.
//
// Results:
//	None.
//
// Side effects:
//	The memory associated with afterPtr is released.
//
//----------------------------------------------------------------------

func sFreeAfterPtr(tls *libc.TLS, afterPtr uintptr) { /* tclTimer.c:1231:1: */
	var prevPtr uintptr
	var assocPtr uintptr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FassocPtr

	if (*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr == afterPtr {
		(*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FnextPtr
	} else {
		for prevPtr = (*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr; (*AfterInfo)(unsafe.Pointer(prevPtr)).FnextPtr != afterPtr; prevPtr = (*AfterInfo)(unsafe.Pointer(prevPtr)).FnextPtr {
			// Empty loop body.
		}
		(*AfterInfo)(unsafe.Pointer(prevPtr)).FnextPtr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FnextPtr
	}
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	XTclpFree(tls, afterPtr)
}

//----------------------------------------------------------------------
//
// AfterCleanupProc --
//
//	This function is invoked whenever an interpreter is deleted
//	to cleanup the AssocData for "tclAfter".
//
// Results:
//	None.
//
// Side effects:
//	After commands are removed.
//
//----------------------------------------------------------------------

// ARGSUSED
func sAfterCleanupProc(tls *libc.TLS, clientData ClientData, interp uintptr) { /* tclTimer.c:1269:1: */
	var assocPtr uintptr = clientData
	var afterPtr uintptr

	for (*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr != uintptr(0) {
		afterPtr = (*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr
		(*AfterAssocData)(unsafe.Pointer(assocPtr)).FfirstAfterPtr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FnextPtr
		if (*AfterInfo)(unsafe.Pointer(afterPtr)).Ftoken != uintptr(0) {
			XTcl_DeleteTimerHandler(tls, (*AfterInfo)(unsafe.Pointer(afterPtr)).Ftoken)
		} else {
			XTcl_CancelIdleCall(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sAfterProc})), afterPtr)
		}
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*AfterInfo)(unsafe.Pointer(afterPtr)).FcommandPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		XTclpFree(tls, afterPtr)
	}
	XTclpFree(tls, assocPtr)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// indent-tabs-mode: nil
// End:

//----------------------------------------------------------------------
//
// TclTommath_Init --
//
//	Initializes the TclTomMath 'package', which exists as a
//	placeholder so that the package data can be used to hold
//	a stub table pointer.
//
// Results:
//	Returns a standard Tcl result.
//
// Side effects:
//	Installs the stub table for tommath.
//
//----------------------------------------------------------------------

func XTclTommath_Init(tls *libc.TLS, interp uintptr) int32 { /* tclTomMathInterface.c:39:1: */
	// TIP #268: Full patchlevel instead of just major.minor

	if XTcl_PkgProvideEx(tls, interp, ts+65646, ts+6569,
		uintptr(unsafe.Pointer(&XtclTomMathStubs))) != TCL_OK {
		return TCL_ERROR
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclBN_epoch --
//
//	Return the epoch number of the TclTomMath stubs table
//
// Results:
//	Returns an arbitrary integer that does not decrease with
//	release.  Stubs tables with different epochs are incompatible.
//
//----------------------------------------------------------------------

func XTclBN_epoch(tls *libc.TLS) int32 { /* tclTomMathInterface.c:66:1: */
	return TCLTOMMATH_EPOCH
}

//----------------------------------------------------------------------
//
// TclBN_revision --
//
//	Returns the revision level of the TclTomMath stubs table
//
// Results:
//	Returns an arbitrary integer that increases with revisions.
//	If a client requires a given epoch and revision, any Stubs table
//	with the same epoch and an equal or higher revision satisfies
//	the request.
//
//----------------------------------------------------------------------

func XTclBN_revision(tls *libc.TLS) int32 { /* tclTomMathInterface.c:88:1: */
	return TCLTOMMATH_REVISION
}

//----------------------------------------------------------------------
//
// TclBNInitBignumFromLong --
//
//	Allocate and initialize a 'bignum' from a native 'long'.
//
// Results:
//	None.
//
// Side effects:
//	The 'bignum' is constructed.
//
//----------------------------------------------------------------------

func XTclBNInitBignumFromLong(tls *libc.TLS, a uintptr, initVal int64) int32 { /* tclTomMathInterface.c:110:1: */
	var v uint64
	var p uintptr

	// Allocate enough memory to hold the largest possible long

	if XTclBN_mp_init(tls, a) != MP_OKAY {
		XTcl_Panic(tls, ts+65659, 0)
	}

	// Convert arg to sign and magnitude.

	if initVal < int64(0) {
		(*Mp_int)(unsafe.Pointer(a)).Fsign = MP_NEG
		v = -uint64(initVal)
	} else {
		(*Mp_int)(unsafe.Pointer(a)).Fsign = MP_ZPOS
		v = uint64(initVal)
	}

	// Store the magnitude in the bignum.

	p = (*Mp_int)(unsafe.Pointer(a)).Fdp
	for v != 0 {
		*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&p, 4))) = Mp_digit(v & uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1)))
		v >>= MP_DIGIT_BIT
	}
	(*Mp_int)(unsafe.Pointer(a)).Fused = int32((int64(p) - int64((*Mp_int)(unsafe.Pointer(a)).Fdp)) / 4)
	return MP_OKAY
}

//----------------------------------------------------------------------
//
// TclBNInitBignumFromWideInt --
//
//	Allocate and initialize a 'bignum' from a Tcl_WideInt
//
// Results:
//	None.
//
// Side effects:
//	The 'bignum' is constructed.
//
//----------------------------------------------------------------------

func XTclBNInitBignumFromWideInt(tls *libc.TLS, a uintptr, v Tcl_WideInt) int32 { /* tclTomMathInterface.c:167:1: */
	if v < int64(0) {
		XTclBNInitBignumFromWideUInt(tls, a, -Tcl_WideUInt(v))
		return XTclBN_mp_neg(tls, a, a)
	}
	XTclBNInitBignumFromWideUInt(tls, a, Tcl_WideUInt(v))
	return MP_OKAY
}

//----------------------------------------------------------------------
//
// TclBNInitBignumFromWideUInt --
//
//	Allocate and initialize a 'bignum' from a Tcl_WideUInt
//
// Results:
//	None.
//
// Side effects:
//	The 'bignum' is constructed.
//
//----------------------------------------------------------------------

func XTclBNInitBignumFromWideUInt(tls *libc.TLS, a uintptr, v Tcl_WideUInt) int32 { /* tclTomMathInterface.c:196:1: */
	var p uintptr

	// Allocate enough memory to hold the largest possible Tcl_WideUInt.

	if XTclBN_mp_init(tls, a) != MP_OKAY {
		XTcl_Panic(tls, ts+65709, 0)
	}

	(*Mp_int)(unsafe.Pointer(a)).Fsign = 0

	// Store the magnitude in the bignum.

	p = (*Mp_int)(unsafe.Pointer(a)).Fdp
	for v != 0 {
		*(*Mp_digit)(unsafe.Pointer(libc.PostIncUintptr(&p, 4))) = Mp_digit(v & uint64(Mp_digit(Mp_digit(1))<<Mp_digit(MP_DIGIT_BIT)-Mp_digit(1)))
		v >>= MP_DIGIT_BIT
	}
	(*Mp_int)(unsafe.Pointer(a)).Fused = int32((int64(p) - int64((*Mp_int)(unsafe.Pointer(a)).Fdp)) / 4)
	return MP_OKAY
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

var XtclTomMathStubsPtr uintptr = uintptr(0) /* tclTomMathStubLib.c:18:23 */

//----------------------------------------------------------------------
//
// TclTomMathInitStubs --
//
//	Initializes the Stubs table for Tcl's subset of libtommath
//
// Results:
//	Returns a standard Tcl result.
//
// This procedure should not be called directly, but rather through
// the TclTomMath_InitStubs macro, to insure that the Stubs table
// matches the header files used in compilation.
//
//----------------------------------------------------------------------

func XTclTomMathInitializeStubs(tls *libc.TLS, interp uintptr, version uintptr, epoch int32, revision int32) uintptr { /* tclTomMathStubLib.c:38:25: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	var exact int32 = 0
	var packageName uintptr = ts + 65646 /* "tcl::tommath" */
	var errMsg uintptr = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 72 /* stubsPtr */)) = uintptr(0)
	var actualVersion uintptr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*TclStubs)(unsafe.Pointer(XtclStubsPtr)).Ftcl_PkgRequireEx})).f(tls, interp,
		packageName, version, exact, bp+72 /* &stubsPtr */)

	if actualVersion == uintptr(0) {
		return uintptr(0)
	}
	if *(*uintptr)(unsafe.Pointer(bp + 72)) == uintptr(0) {
		errMsg = ts + 53397 /* "missing stub tab..." */
	} else if (*struct{ f func(*libc.TLS) int32 })(unsafe.Pointer(&struct{ uintptr }{(*TclTomMathStubs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FtclBN_epoch})).f(tls) != epoch {
		errMsg = ts + 65763 /* "epoch number mis..." */
	} else if (*struct{ f func(*libc.TLS) int32 })(unsafe.Pointer(&struct{ uintptr }{(*TclTomMathStubs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FtclBN_revision})).f(tls) != revision {
		errMsg = ts + 65785 /* "requires a later..." */
	} else {
		XtclTomMathStubsPtr = *(*uintptr)(unsafe.Pointer(bp + 72 /* stubsPtr */))
		return actualVersion
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*TclStubs)(unsafe.Pointer(XtclStubsPtr)).Ftcl_ResetResult})).f(tls, interp)
	(*struct {
		f func(*libc.TLS, uintptr, uintptr)
	})(unsafe.Pointer(&struct{ uintptr }{(*TclStubs)(unsafe.Pointer(XtclStubsPtr)).Ftcl_AppendResult})).f(tls, interp, libc.VaList(bp, ts+53424 /* "Error loading " */, packageName,
		ts+53439, version, ts+53460,
		actualVersion, ts+53478, errMsg, uintptr(0)))
	return uintptr(0)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Structures used to hold information about variable traces:

type TraceVarInfo = struct {
	Fflags       int32
	F__ccgo_pad1 [4]byte
	Flength      Size_t
	Fcommand     [1]int8
	F__ccgo_pad2 [7]byte
} /* tclTrace.c:30:3 */

type CombinedTraceVarInfo = struct {
	FtraceInfo    VarTrace
	FtraceCmdInfo TraceVarInfo
} /* tclTrace.c:35:3 */

// Structure used to hold information about command traces:

type TraceCommandInfo = struct {
	Fflags       int32
	F__ccgo_pad1 [4]byte
	Flength      Size_t
	FstepTrace   Tcl_Trace
	FstartLevel  int32
	F__ccgo_pad2 [4]byte
	FstartCmd    uintptr
	FcurFlags    int32
	FcurCode     int32
	FrefCount    int32
	Fcommand     [1]int8
	F__ccgo_pad3 [3]byte
} /* tclTrace.c:64:3 */

// Each subcommand has a number of 'types' to which it can apply. Currently
// 'execution', 'command' and 'variable' are the only types supported. These
// three arrays MUST be kept in sync! In the future we may provide an API to
// add to the list of supported trace types.

var traceTypeOptions = [4]uintptr{
	ts + 65811, ts + 13561, ts + 3432, uintptr(0),
} /* tclTrace.c:110:19 */
var traceSubCmds = [3]uintptr{
	0,
	0,
	0,
} /* tclTrace.c:113:28 */

// The following structure holds the client data for string-based
// trace procs

type StringTraceData1 = struct {
	FclientData ClientData
	Fproc       uintptr
} /* tclTrace.c:146:9 */

// The following structure holds the client data for string-based
// trace procs

type StringTraceData = StringTraceData1 /* tclTrace.c:149:3 */

// Convenience macros for iterating over the list of traces. Note that each of
// these *must* be treated as a command, and *must* have a block following it.

//----------------------------------------------------------------------
//
// Tcl_TraceObjCmd --
//
//	This function is invoked to process the "trace" Tcl command. See the
//	user documentation for details on what it does.
//
//	Standard syntax as of Tcl 8.4 is:
//	    trace {add|info|remove} {command|variable} name ops cmd
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_TraceObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclTrace.c:187:1: */
	bp := tls.Alloc(117)
	defer tls.Free(117)

	// var optionIndex int32 at bp+48, 4

	var name uintptr
	var flagOps uintptr
	var p uintptr
	// All sub commands of trace add/remove must take at least one more
	// argument. Beyond that we let the subcommand itself control the
	// argument structure.

	// var typeIndex int32 at bp+52, 4

	// All sub commands of trace info must take exactly two more arguments
	// which name the type of thing being traced and the name of the thing
	// being traced.

	// var typeIndex1 int32 at bp+56, 4

	var cachePtr uintptr
	var _objPtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var _objPtr1 uintptr
	var opObj uintptr
	var _objPtr2 uintptr
	// var copyObjv [6]uintptr at bp+64, 48

	var opsList uintptr
	var code int32
	// var numFlags int32 at bp+60, 4

	var cachePtr5 uintptr
	var tvarPtr uintptr
	var q uintptr
	var clientData ClientData
	// var ops [5]int8 at bp+112, 5

	var resultListPtr uintptr
	var pairObjPtr uintptr
	var elemObjPtr uintptr

	if !(objc < 2) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+56587)
	return TCL_ERROR
__1:
	;

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&traceOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+48) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 48 /* optionIndex */))) {
	case uint32(0) /* TRACE_ADD */ :
		goto __4
	case uint32(2) /* TRACE_REMOVE */ :
		goto __5
	case uint32(1) /* TRACE_INFO */ :
		goto __6

	case uint32(3) /* TRACE_OLD_VARIABLE */ :
		goto __7
	case uint32(4) /* TRACE_OLD_VDELETE */ :
		goto __8
	case uint32(5) /* TRACE_OLD_VINFO */ :
		goto __9
	}
	goto __3
__4:
__5:

	if !(objc < 3) {
		goto __10
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+65821)
	return TCL_ERROR
__10:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&traceTypeOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+52) != TCL_OK) {
		goto __11
	}
	return TCL_ERROR
__11:
	;
	return (*struct {
		f func(*libc.TLS, uintptr, int32, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{traceSubCmds[*(*int32)(unsafe.Pointer(bp + 52 /* typeIndex */))]})).f(tls, interp, *(*int32)(unsafe.Pointer(bp + 48 /* optionIndex */)), objc, objv)

__6:
	if !(objc < 3) {
		goto __12
	}
	// Delegate other complaints to the type-specific code which can
	// give a better error message.

	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+65836)
	return TCL_ERROR
__12:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&traceTypeOptions)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+56) != TCL_OK) {
		goto __13
	}
	return TCL_ERROR
__13:
	;
	return (*struct {
		f func(*libc.TLS, uintptr, int32, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{traceSubCmds[*(*int32)(unsafe.Pointer(bp + 56 /* typeIndex1 */))]})).f(tls, interp, *(*int32)(unsafe.Pointer(bp + 48 /* optionIndex */)), objc, objv)
	goto __3

__7:
__8:

	if !(objc != 5) {
		goto __14
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+65846)
	return TCL_ERROR
__14:
	;

__15:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __18
	}
	opsList = XTclThreadAllocObj(tls)
	goto __19
__18:
	opsList = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opsList + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__19:
	;
	goto __16
__16:
	if 0 != 0 {
		goto __15
	}
	goto __17
__17:
	;
	(*Tcl_Obj)(unsafe.Pointer(opsList)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(opsList)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(opsList)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(opsList)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(opsList)).FrefCount++
	flagOps = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+60)
	if !(*(*int32)(unsafe.Pointer(bp + 60)) == 0) {
		goto __20
	}
__21:
	_objPtr = opsList
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __24
	}
	XTclFreeObj(tls, _objPtr)
__24:
	;
	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
	goto badVarOps
__20:
	;
	p = flagOps
__25:
	if !(int32(*(*int8)(unsafe.Pointer(p))) != 0) {
		goto __27
	}

	if !(int32(*(*int8)(unsafe.Pointer(p))) == 'r') {
		goto __28
	}
__30:
	;
__33:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __36
	}
	opObj = XTclThreadAllocObj(tls)
	goto __37
__36:
	opObj = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__37:
	;
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0) {
		goto __38
	}
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
	goto __39
__38:
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+5472, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 4)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
__39:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)

	goto __31
__31:
	if 0 != 0 {
		goto __30
	}
	goto __32
__32:
	;
	goto __29
__28:
	if !(int32(*(*int8)(unsafe.Pointer(p))) == 'w') {
		goto __40
	}
__42:
	;
__45:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0
	}()) {
		goto __48
	}
	opObj = XTclThreadAllocObj(tls)
	goto __49
__48:
	opObj = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects--
__49:
	;
	goto __46
__46:
	if 0 != 0 {
		goto __45
	}
	goto __47
__47:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0) {
		goto __50
	}
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
	goto __51
__50:
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+33034, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 5)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
__51:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)

	goto __43
__43:
	if 0 != 0 {
		goto __42
	}
	goto __44
__44:
	;
	goto __41
__40:
	if !(int32(*(*int8)(unsafe.Pointer(p))) == 'u') {
		goto __52
	}
__54:
	;
__57:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __60
	}
	opObj = XTclThreadAllocObj(tls)
	goto __61
__60:
	opObj = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__61:
	;
	goto __58
__58:
	if 0 != 0 {
		goto __57
	}
	goto __59
__59:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0) {
		goto __62
	}
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
	goto __63
__62:
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+3380, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 5)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
__63:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)

	goto __55
__55:
	if 0 != 0 {
		goto __54
	}
	goto __56
__56:
	;
	goto __53
__52:
	if !(int32(*(*int8)(unsafe.Pointer(p))) == 'a') {
		goto __64
	}
__66:
	;
__69:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0
	}()) {
		goto __72
	}
	opObj = XTclThreadAllocObj(tls)
	goto __73
__72:
	opObj = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects--
__73:
	;
	goto __70
__70:
	if 0 != 0 {
		goto __69
	}
	goto __71
__71:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
	if !(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0) {
		goto __74
	}
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
	goto __75
__74:
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+25071, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 5)) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
__75:
	;
	(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)

	goto __67
__67:
	if 0 != 0 {
		goto __66
	}
	goto __68
__68:
	;
	goto __65
__64:
__76:
	_objPtr1 = opsList
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __79
	}
	XTclFreeObj(tls, _objPtr1)
__79:
	;
	goto __77
__77:
	if 0 != 0 {
		goto __76
	}
	goto __78
__78:
	;
	goto badVarOps
__65:
	;
__53:
	;
__41:
	;
__29:
	;
	XTcl_ListObjAppendElement(tls, uintptr(0), opsList, opObj)
	goto __26
__26:
	p++
	goto __25
	goto __27
__27:
	;
	*(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0)
	libc.Xmemcpy(tls, bp+64+uintptr(1)*8, objv, uint64(objc)*uint64(unsafe.Sizeof(uintptr(0))))
	*(*uintptr)(unsafe.Pointer(bp + 64 + 4*8)) = opsList
	if !(*(*int32)(unsafe.Pointer(bp + 48)) == 3) {
		goto __80
	}
	code = (*struct {
		f func(*libc.TLS, uintptr, int32, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{traceSubCmds[2]})).f(tls, interp, 0 /* TRACE_ADD */, objc+1, bp+64 /* &copyObjv[0] */)
	goto __81
__80:
	code = (*struct {
		f func(*libc.TLS, uintptr, int32, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{traceSubCmds[2]})).f(tls, interp, 2 /* TRACE_REMOVE */, objc+1, bp+64 /* &copyObjv[0] */)
__81:
	;
__82:
	_objPtr2 = opsList
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr2)).FrefCount, 1) <= 1) {
		goto __85
	}
	XTclFreeObj(tls, _objPtr2)
__85:
	;
	goto __83
__83:
	if 0 != 0 {
		goto __82
	}
	goto __84
__84:
	;
	return code

__9:

	if !(objc != 3) {
		goto __86
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+3660)
	return TCL_ERROR
__86:
	;
__87:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0
	}()) {
		goto __90
	}
	resultListPtr = XTclThreadAllocObj(tls)
	goto __91
__90:
	resultListPtr = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultListPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects--
__91:
	;
	goto __88
__88:
	if 0 != 0 {
		goto __87
	}
	goto __89
__89:
	;
	(*Tcl_Obj)(unsafe.Pointer(resultListPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultListPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultListPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultListPtr)).FtypePtr = uintptr(0)

	name = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)))
	clientData = uintptr(0)
__92:
	if !(libc.AssignUintptr(&clientData, XTcl_VarTraceInfo2(tls, interp, name, uintptr(0), 0, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
	}{sTraceVarProc})), clientData)) != uintptr(0)) {
		goto __93
	}
	tvarPtr = clientData
	q = bp + 112 /* ops */

	pairObjPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	if !((*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&TCL_TRACE_READS != 0) {
		goto __94
	}
	*(*int8)(unsafe.Pointer(q)) = int8('r')
	q++
__94:
	;
	if !((*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&TCL_TRACE_WRITES != 0) {
		goto __95
	}
	*(*int8)(unsafe.Pointer(q)) = int8('w')
	q++
__95:
	;
	if !((*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&TCL_TRACE_UNSETS != 0) {
		goto __96
	}
	*(*int8)(unsafe.Pointer(q)) = int8('u')
	q++
__96:
	;
	if !((*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&TCL_TRACE_ARRAY != 0) {
		goto __97
	}
	*(*int8)(unsafe.Pointer(q)) = int8('a')
	q++
__97:
	;
	*(*int8)(unsafe.Pointer(q)) = int8(0)

	// Build a pair (2-item list) with the ops string as the first obj
	// element and the tvarPtr->command string as the second obj
	// element. Append the pair (as an element) to the end of the
	// result object list.

	elemObjPtr = XTcl_NewStringObj(tls, bp+112, -1)
	XTcl_ListObjAppendElement(tls, uintptr(0), pairObjPtr, elemObjPtr)
	elemObjPtr = XTcl_NewStringObj(tls, tvarPtr+16, -1)
	XTcl_ListObjAppendElement(tls, uintptr(0), pairObjPtr, elemObjPtr)
	XTcl_ListObjAppendElement(tls, interp, resultListPtr, pairObjPtr)
	goto __92
__93:
	;
	XTcl_SetObjResult(tls, interp, resultListPtr)
	goto __3

__3:
	;
	return TCL_OK

badVarOps:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+65863,
		libc.VaList(bp, flagOps)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7420, ts+65914, ts+65920, uintptr(0)))
	return TCL_ERROR
}

var traceOptions = [7]uintptr{
	ts + 2077, ts + 13499, ts + 23167,
	ts + 3432, ts + 65927, ts + 65935,
	uintptr(0),
} /* tclTrace.c:199:23 */

//----------------------------------------------------------------------
//
// TraceExecutionObjCmd --
//
//	Helper function for Tcl_TraceObjCmd; implements the [trace
//	{add|remove|info} execution ...] subcommands. See the user
//	documentation for details on what these do.
//
// Results:
//	Standard Tcl result.
//
// Side effects:
//	Depends on the operation (add, remove, or info) being performed; may
//	add or remove command traces on a command.
//
//----------------------------------------------------------------------

func sTraceExecutionObjCmd(tls *libc.TLS, interp uintptr, optionIndex int32, objc int32, objv uintptr) int32 { /* tclTrace.c:400:1: */
	bp := tls.Alloc(68)
	defer tls.Free(68)

	// var commandLength int32 at bp+60, 4

	// var index int32 at bp+56, 4

	var name uintptr
	var command uintptr
	var length Size_t

	switch uint32(optionIndex) {
	case uint32(0) /* TRACE_ADD */ :
		fallthrough
	case uint32(2) /* TRACE_REMOVE */ :
		{
			var flags int32 = 0
			var i int32
			// var listLen int32 at bp+40, 4

			var result int32
			// var elemPtrs uintptr at bp+48, 8

			if objc != 6 {
				XTcl_WrongNumArgs(tls, interp, 3, objv, ts+65941)
				return TCL_ERROR
			}

			// Make sure the ops argument is a list object; get its length and a
			// pointer to its array of element pointers.

			result = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 4*8)), bp+40, bp+48)
			if result != TCL_OK {
				return result
			}
			if *(*int32)(unsafe.Pointer(bp + 40)) == 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+65961, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+65914, ts+66045,
					uintptr(0)))
				return TCL_ERROR
			}
			for i = 0; i < *(*int32)(unsafe.Pointer(bp + 40 /* listLen */)); i++ {
				if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + uintptr(i)*8)), uintptr(unsafe.Pointer(&opStrings)), int32(unsafe.Sizeof(uintptr(0))), ts+66051, TCL_EXACT, bp+56) != TCL_OK {
					return TCL_ERROR
				}
				switch uint32(*(*int32)(unsafe.Pointer(bp + 56 /* index */))) {
				case uint32(0) /* TRACE_EXEC_ENTER */ :
					flags = flags | TCL_TRACE_ENTER_EXEC
					break
				case uint32(1) /* TRACE_EXEC_LEAVE */ :
					flags = flags | TCL_TRACE_LEAVE_EXEC
					break
				case uint32(2) /* TRACE_EXEC_ENTER_STEP */ :
					flags = flags | TCL_TRACE_ENTER_DURING_EXEC
					break
				case uint32(3) /* TRACE_EXEC_LEAVE_STEP */ :
					flags = flags | TCL_TRACE_LEAVE_DURING_EXEC
					break
				}
			}
			command = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 5*8)), bp+60)
			length = Size_t(*(*int32)(unsafe.Pointer(bp + 60 /* commandLength */)))
			if int32(uint32(optionIndex)) == 0 {
				var tcmdPtr uintptr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+52)+1)+length))

				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags = flags
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace = uintptr(0)
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartLevel = 0
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartCmd = uintptr(0)
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Flength = length
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount = 1
				flags = flags | TCL_TRACE_DELETE
				if flags&(TCL_TRACE_ENTER_DURING_EXEC|TCL_TRACE_LEAVE_DURING_EXEC) != 0 {
					flags = flags | (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC)
				}
				libc.Xmemcpy(tls, tcmdPtr+52, command, length+uint64(1))
				name = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
				if XTcl_TraceCommand(tls, interp, name, flags, *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
				}{sTraceCommandProc})),
					tcmdPtr) != TCL_OK {
					XTclpFree(tls, tcmdPtr)
					return TCL_ERROR
				}
			} else {
				// Search through all of our traces on this command to see if
				// there's one with the given command. If so, then delete the
				// first one that matches.

				var clientData ClientData

				// First ensure the name given is valid.

				name = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
				if XTcl_FindCommand(tls, interp, name, uintptr(0), TCL_LEAVE_ERR_MSG) == uintptr(0) {
					return TCL_ERROR
				}

				clientData = uintptr(0)
				for libc.AssignUintptr(&clientData, XTcl_CommandTraceInfo(tls, interp, name, 0, *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
				}{sTraceCommandProc})), clientData)) != uintptr(0) {
					var tcmdPtr uintptr = clientData

					// In checking the 'flags' field we must remove any extraneous
					// flags which may have been temporarily added by various
					// pieces of the trace mechanism.

					if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Flength == length &&
						(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&(TCL_TRACE_ANY_EXEC|TCL_TRACE_RENAME|TCL_TRACE_DELETE) == flags &&
						libc.Xstrncmp(tls, command, tcmdPtr+52,
							length) == 0 {
						flags = flags | TCL_TRACE_DELETE
						if flags&(TCL_TRACE_ENTER_DURING_EXEC|TCL_TRACE_LEAVE_DURING_EXEC) != 0 {
							flags = flags | (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC)
						}
						XTcl_UntraceCommand(tls, interp, name, flags,
							*(*uintptr)(unsafe.Pointer(&struct {
								f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
							}{sTraceCommandProc})), clientData)
						if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace != uintptr(0) {
							// We need to remove the interpreter-wide trace which
							// we created to allow 'step' traces.

							XTcl_DeleteTrace(tls, interp, (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace)
							(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace = uintptr(0)
							XTclpFree(tls, (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartCmd)
						}
						if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&TCL_TRACE_EXEC_IN_PROGRESS != 0 {
							// Postpone deletion.

							(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags = 0
						}
						if libc.PostDecInt32(&(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount, 1) <= 1 {
							XTclpFree(tls, tcmdPtr)
						}
						break
					}
				}
			}
			break

		}
	case uint32(1) /* TRACE_INFO */ :
		{
			var clientData ClientData
			var resultListPtr uintptr

			if objc != 4 {
				XTcl_WrongNumArgs(tls, interp, 3, objv, ts+3660)
				return TCL_ERROR
			}

			name = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))

			// First ensure the name given is valid.

			if XTcl_FindCommand(tls, interp, name, uintptr(0), TCL_LEAVE_ERR_MSG) == uintptr(0) {
				return TCL_ERROR
			}

			resultListPtr = XTcl_NewListObj(tls, 0, uintptr(0))
			clientData = uintptr(0)
			for libc.AssignUintptr(&clientData, XTcl_CommandTraceInfo(tls, interp, name, 0, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
			}{sTraceCommandProc})), clientData)) != uintptr(0) {
				*(*int32)(unsafe.Pointer(bp + 64 /* numOps */)) = 0
				var opObj uintptr
				var eachTraceObjPtr uintptr
				var elemObjPtr uintptr
				var tcmdPtr uintptr = clientData

				// Build a list with the ops list as the first obj element and the
				// tcmdPtr->command string as the second obj element. Append this
				// list (as an element) to the end of the result object list.

				elemObjPtr = XTcl_NewListObj(tls, 0, uintptr(0))
				(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount++
				if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&TCL_TRACE_ENTER_EXEC != 0 {
					for ok := true; ok; ok = 0 != 0 {
						for ok1 := true; ok1; ok1 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								opObj = XTclThreadAllocObj(tls)
							} else {
								opObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+66061, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 5)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)
						{
						}
					}
					XTcl_ListObjAppendElement(tls, uintptr(0), elemObjPtr, opObj)
				}
				if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&TCL_TRACE_LEAVE_EXEC != 0 {
					for ok2 := true; ok2; ok2 = 0 != 0 {
						for ok3 := true; ok3; ok3 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								opObj = XTclThreadAllocObj(tls)
							} else {
								opObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+66067, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 5)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)
						{
						}
					}
					XTcl_ListObjAppendElement(tls, uintptr(0), elemObjPtr, opObj)
				}
				if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&TCL_TRACE_ENTER_DURING_EXEC != 0 {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						for ok5 := true; ok5; ok5 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								opObj = XTclThreadAllocObj(tls)
							} else {
								opObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+66073, uint64(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 9)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([10]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)
						{
						}
					}
					XTcl_ListObjAppendElement(tls, uintptr(0), elemObjPtr, opObj)
				}
				if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&TCL_TRACE_LEAVE_DURING_EXEC != 0 {
					for ok6 := true; ok6; ok6 = 0 != 0 {
						for ok7 := true; ok7; ok7 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								opObj = XTclThreadAllocObj(tls)
							} else {
								opObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+66083, uint64(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 9)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([10]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)
						{
						}
					}
					XTcl_ListObjAppendElement(tls, uintptr(0), elemObjPtr, opObj)
				}
				XTcl_ListObjLength(tls, uintptr(0), elemObjPtr, bp+64)
				if 0 == *(*int32)(unsafe.Pointer(bp + 64)) {
					for ok8 := true; ok8; ok8 = 0 != 0 {
						var _objPtr uintptr = elemObjPtr
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
					continue
				}
				eachTraceObjPtr = XTcl_NewListObj(tls, 0, uintptr(0))
				XTcl_ListObjAppendElement(tls, uintptr(0), eachTraceObjPtr, elemObjPtr)
				for ok9 := true; ok9; ok9 = 0 != 0 {
					var _objPtr uintptr = elemObjPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				elemObjPtr = uintptr(0)

				XTcl_ListObjAppendElement(tls, uintptr(0), eachTraceObjPtr,
					XTcl_NewStringObj(tls, tcmdPtr+52, -1))
				XTcl_ListObjAppendElement(tls, interp, resultListPtr, eachTraceObjPtr)
			}
			XTcl_SetObjResult(tls, interp, resultListPtr)
			break

		}
	}
	return TCL_OK
}

var opStrings = [5]uintptr{
	ts + 66061, ts + 66067, ts + 66073, ts + 66083, uintptr(0),
} /* tclTrace.c:412:23 */

//----------------------------------------------------------------------
//
// TraceCommandObjCmd --
//
//	Helper function for Tcl_TraceObjCmd; implements the [trace
//	{add|info|remove} command ...] subcommands. See the user documentation
//	for details on what these do.
//
// Results:
//	Standard Tcl result.
//
// Side effects:
//	Depends on the operation (add, remove, or info) being performed; may
//	add or remove command traces on a command.
//
//----------------------------------------------------------------------

func sTraceCommandObjCmd(tls *libc.TLS, interp uintptr, optionIndex int32, objc int32, objv uintptr) int32 { /* tclTrace.c:648:1: */
	bp := tls.Alloc(68)
	defer tls.Free(68)

	// var commandLength int32 at bp+60, 4

	// var index int32 at bp+56, 4

	var name uintptr
	var command uintptr
	var length Size_t

	switch uint32(optionIndex) {
	case uint32(0) /* TRACE_ADD */ :
		fallthrough
	case uint32(2) /* TRACE_REMOVE */ :
		{
			var flags int32 = 0
			var i int32
			// var listLen int32 at bp+40, 4

			var result int32
			// var elemPtrs uintptr at bp+48, 8

			if objc != 6 {
				XTcl_WrongNumArgs(tls, interp, 3, objv, ts+65941)
				return TCL_ERROR
			}

			// Make sure the ops argument is a list object; get its length and a
			// pointer to its array of element pointers.

			result = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 4*8)), bp+40, bp+48)
			if result != TCL_OK {
				return result
			}
			if *(*int32)(unsafe.Pointer(bp + 40)) == 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+66093, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+65914, ts+66045,
					uintptr(0)))
				return TCL_ERROR
			}

			for i = 0; i < *(*int32)(unsafe.Pointer(bp + 40 /* listLen */)); i++ {
				if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + uintptr(i)*8)), uintptr(unsafe.Pointer(&opStrings1)), int32(unsafe.Sizeof(uintptr(0))), ts+66051, TCL_EXACT, bp+56) != TCL_OK {
					return TCL_ERROR
				}
				switch uint32(*(*int32)(unsafe.Pointer(bp + 56 /* index */))) {
				case uint32(1) /* TRACE_CMD_RENAME */ :
					flags = flags | TCL_TRACE_RENAME
					break
				case uint32(0) /* TRACE_CMD_DELETE */ :
					flags = flags | TCL_TRACE_DELETE
					break
				}
			}

			command = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 5*8)), bp+60)
			length = Size_t(*(*int32)(unsafe.Pointer(bp + 60 /* commandLength */)))
			if int32(uint32(optionIndex)) == 0 {
				var tcmdPtr uintptr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+52)+1)+length))

				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags = flags
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace = uintptr(0)
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartLevel = 0
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartCmd = uintptr(0)
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Flength = length
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount = 1
				flags = flags | TCL_TRACE_DELETE
				libc.Xmemcpy(tls, tcmdPtr+52, command, length+uint64(1))
				name = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
				if XTcl_TraceCommand(tls, interp, name, flags, *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
				}{sTraceCommandProc})),
					tcmdPtr) != TCL_OK {
					XTclpFree(tls, tcmdPtr)
					return TCL_ERROR
				}
			} else {
				// Search through all of our traces on this command to see if
				// there's one with the given command. If so, then delete the
				// first one that matches.

				var clientData ClientData

				// First ensure the name given is valid.

				name = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
				if XTcl_FindCommand(tls, interp, name, uintptr(0), TCL_LEAVE_ERR_MSG) == uintptr(0) {
					return TCL_ERROR
				}

				clientData = uintptr(0)
				for libc.AssignUintptr(&clientData, XTcl_CommandTraceInfo(tls, interp, name, 0, *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
				}{sTraceCommandProc})), clientData)) != uintptr(0) {
					var tcmdPtr uintptr = clientData

					if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Flength == length && (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags == flags &&
						libc.Xstrncmp(tls, command, tcmdPtr+52,
							length) == 0 {
						XTcl_UntraceCommand(tls, interp, name, flags|TCL_TRACE_DELETE,
							*(*uintptr)(unsafe.Pointer(&struct {
								f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
							}{sTraceCommandProc})), clientData)
						*(*int32)(unsafe.Pointer(tcmdPtr)) |= TCL_TRACE_DESTROYED
						if libc.PostDecInt32(&(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount, 1) <= 1 {
							XTclpFree(tls, tcmdPtr)
						}
						break
					}
				}
			}
			break

		}
	case uint32(1) /* TRACE_INFO */ :
		{
			var clientData ClientData
			var resultListPtr uintptr

			if objc != 4 {
				XTcl_WrongNumArgs(tls, interp, 3, objv, ts+3660)
				return TCL_ERROR
			}

			// First ensure the name given is valid.

			name = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
			if XTcl_FindCommand(tls, interp, name, uintptr(0), TCL_LEAVE_ERR_MSG) == uintptr(0) {
				return TCL_ERROR
			}

			resultListPtr = XTcl_NewListObj(tls, 0, uintptr(0))
			clientData = uintptr(0)
			for libc.AssignUintptr(&clientData, XTcl_CommandTraceInfo(tls, interp, name, 0, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
			}{sTraceCommandProc})), clientData)) != uintptr(0) {
				*(*int32)(unsafe.Pointer(bp + 64 /* numOps */)) = 0
				var opObj uintptr
				var eachTraceObjPtr uintptr
				var elemObjPtr uintptr
				var tcmdPtr uintptr = clientData

				// Build a list with the ops list as the first obj element and the
				// tcmdPtr->command string as the second obj element. Append this
				// list (as an element) to the end of the result object list.

				elemObjPtr = XTcl_NewListObj(tls, 0, uintptr(0))
				(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount++
				if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&TCL_TRACE_RENAME != 0 {
					for ok := true; ok; ok = 0 != 0 {
						for ok1 := true; ok1; ok1 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								opObj = XTclThreadAllocObj(tls)
							} else {
								opObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+5284, uint64(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 6)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([7]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)
						{
						}
					}
					XTcl_ListObjAppendElement(tls, uintptr(0), elemObjPtr, opObj)
				}
				if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&TCL_TRACE_DELETE != 0 {
					for ok2 := true; ok2; ok2 = 0 != 0 {
						for ok3 := true; ok3; ok3 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								opObj = XTclThreadAllocObj(tls)
							} else {
								opObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObj + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes, ts+7321, uint64(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObj)).Fbytes + 6)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(opObj)).Flength = int32(uint64(unsafe.Sizeof([7]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(opObj)).FtypePtr = uintptr(0)
						{
						}
					}
					XTcl_ListObjAppendElement(tls, uintptr(0), elemObjPtr, opObj)
				}
				XTcl_ListObjLength(tls, uintptr(0), elemObjPtr, bp+64)
				if 0 == *(*int32)(unsafe.Pointer(bp + 64)) {
					for ok4 := true; ok4; ok4 = 0 != 0 {
						var _objPtr uintptr = elemObjPtr
						if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
							XTclFreeObj(tls, _objPtr)
						}
					}
					continue
				}
				eachTraceObjPtr = XTcl_NewListObj(tls, 0, uintptr(0))
				XTcl_ListObjAppendElement(tls, uintptr(0), eachTraceObjPtr, elemObjPtr)
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var _objPtr uintptr = elemObjPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}

				elemObjPtr = XTcl_NewStringObj(tls, tcmdPtr+52, -1)
				XTcl_ListObjAppendElement(tls, uintptr(0), eachTraceObjPtr, elemObjPtr)
				XTcl_ListObjAppendElement(tls, interp, resultListPtr, eachTraceObjPtr)
			}
			XTcl_SetObjResult(tls, interp, resultListPtr)
			break

		}
	}
	return TCL_OK
}

var opStrings1 = [3]uintptr{ts + 7321, ts + 5284, uintptr(0)} /* tclTrace.c:658:23 */

//----------------------------------------------------------------------
//
// TraceVariableObjCmd --
//
//	Helper function for Tcl_TraceObjCmd; implements the [trace
//	{add|info|remove} variable ...] subcommands. See the user
//	documentation for details on what these do.
//
// Results:
//	Standard Tcl result.
//
// Side effects:
//	Depends on the operation (add, remove, or info) being performed; may
//	add or remove variable traces on a variable.
//
//----------------------------------------------------------------------

func sTraceVariableObjCmd(tls *libc.TLS, interp uintptr, optionIndex int32, objc int32, objv uintptr) int32 { /* tclTrace.c:842:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	// var commandLength int32 at bp+60, 4

	// var index int32 at bp+56, 4

	var name uintptr
	var command uintptr
	var length Size_t
	var clientData ClientData

	switch uint32(optionIndex) {
	case uint32(0) /* TRACE_ADD */ :
		fallthrough
	case uint32(2) /* TRACE_REMOVE */ :
		{
			var flags int32 = 0
			var i int32
			// var listLen int32 at bp+40, 4

			var result int32
			// var elemPtrs uintptr at bp+48, 8

			if objc != 6 {
				XTcl_WrongNumArgs(tls, interp, 3, objv, ts+65941)
				return TCL_ERROR
			}

			// Make sure the ops argument is a list object; get its length and a
			// pointer to its array of element pointers.

			result = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 4*8)), bp+40, bp+48)
			if result != TCL_OK {
				return result
			}
			if *(*int32)(unsafe.Pointer(bp + 40)) == 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+66156, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7420, ts+65914, ts+66045,
					uintptr(0)))
				return TCL_ERROR
			}
			for i = 0; i < *(*int32)(unsafe.Pointer(bp + 40 /* listLen */)); i++ {
				if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + uintptr(i)*8)), uintptr(unsafe.Pointer(&opStrings2)), int32(unsafe.Sizeof(uintptr(0))), ts+66051, TCL_EXACT, bp+56) != TCL_OK {
					return TCL_ERROR
				}
				switch uint32(*(*int32)(unsafe.Pointer(bp + 56 /* index */))) {
				case uint32(0) /* TRACE_VAR_ARRAY */ :
					flags = flags | TCL_TRACE_ARRAY
					break
				case uint32(1) /* TRACE_VAR_READ */ :
					flags = flags | TCL_TRACE_READS
					break
				case uint32(2) /* TRACE_VAR_UNSET */ :
					flags = flags | TCL_TRACE_UNSETS
					break
				case uint32(3) /* TRACE_VAR_WRITE */ :
					flags = flags | TCL_TRACE_WRITES
					break
				}
			}
			command = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 5*8)), bp+60)
			length = Size_t(*(*int32)(unsafe.Pointer(bp + 60 /* commandLength */)))
			if int32(uint32(optionIndex)) == 0 {
				var ctvarPtr uintptr = XTcl_Alloc(tls, uint32(uint64(int32(uintptr(0)+32+16)+1)+length))

				(*CombinedTraceVarInfo)(unsafe.Pointer(ctvarPtr)).FtraceCmdInfo.Fflags = flags
				if *(*uintptr)(unsafe.Pointer(objv)) == uintptr(0) {
					*(*int32)(unsafe.Pointer(ctvarPtr + 32)) |= TCL_TRACE_OLD_STYLE
				}
				(*CombinedTraceVarInfo)(unsafe.Pointer(ctvarPtr)).FtraceCmdInfo.Flength = length
				flags = flags | (TCL_TRACE_UNSETS | TCL_TRACE_RESULT_OBJECT)
				libc.Xmemcpy(tls, ctvarPtr+32+16, command, length+uint64(1))
				(*CombinedTraceVarInfo)(unsafe.Pointer(ctvarPtr)).FtraceInfo.FtraceProc = *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
				}{sTraceVarProc}))
				(*CombinedTraceVarInfo)(unsafe.Pointer(ctvarPtr)).FtraceInfo.FclientData = ctvarPtr + 32
				(*CombinedTraceVarInfo)(unsafe.Pointer(ctvarPtr)).FtraceInfo.Fflags = flags
				name = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
				if sTraceVarEx(tls, interp, name, uintptr(0), ctvarPtr) !=
					TCL_OK {
					XTclpFree(tls, ctvarPtr)
					return TCL_ERROR
				}
			} else {
				// Search through all of our traces on this variable to see if
				// there's one with the given command. If so, then delete the
				// first one that matches.

				name = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
				clientData = uintptr(0)
				for libc.AssignUintptr(&clientData, XTcl_VarTraceInfo2(tls, interp, name, uintptr(0), 0, *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
				}{sTraceVarProc})), clientData)) != uintptr(0) {
					var tvarPtr uintptr = clientData

					if (*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Flength == length &&
						(*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&
							libc.CplInt32(TCL_TRACE_OLD_STYLE) == flags &&
						libc.Xstrncmp(tls, command, tvarPtr+16,
							length) == 0 {
						XTcl_UntraceVar2(tls, interp, name, uintptr(0),
							flags|TCL_TRACE_UNSETS|TCL_TRACE_RESULT_OBJECT,
							*(*uintptr)(unsafe.Pointer(&struct {
								f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
							}{sTraceVarProc})), clientData)
						break
					}
				}
			}
			break

		}
	case uint32(1) /* TRACE_INFO */ :
		{
			var resultListPtr uintptr

			if objc != 4 {
				XTcl_WrongNumArgs(tls, interp, 3, objv, ts+3660)
				return TCL_ERROR
			}

			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					resultListPtr = XTclThreadAllocObj(tls)
				} else {
					resultListPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultListPtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(resultListPtr)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(resultListPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(resultListPtr)).Flength = 0
			(*Tcl_Obj)(unsafe.Pointer(resultListPtr)).FtypePtr = uintptr(0)
			{
			}

			name = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
			clientData = uintptr(0)
			for libc.AssignUintptr(&clientData, XTcl_VarTraceInfo2(tls, interp, name, uintptr(0), 0, *(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
			}{sTraceVarProc})), clientData)) != uintptr(0) {
				var opObjPtr uintptr
				var eachTraceObjPtr uintptr
				var elemObjPtr uintptr
				var tvarPtr uintptr = clientData

				// Build a list with the ops list as the first obj element and the
				// tcmdPtr->command string as the second obj element. Append this
				// list (as an element) to the end of the result object list.

				elemObjPtr = XTcl_NewListObj(tls, 0, uintptr(0))
				if (*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&TCL_TRACE_ARRAY != 0 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								opObjPtr = XTclThreadAllocObj(tls)
							} else {
								opObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObjPtr + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes, ts+25071, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes + 5)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).FtypePtr = uintptr(0)
						{
						}
					}
					XTcl_ListObjAppendElement(tls, uintptr(0), elemObjPtr, opObjPtr)
				}
				if (*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&TCL_TRACE_READS != 0 {
					for ok3 := true; ok3; ok3 = 0 != 0 {
						for ok4 := true; ok4; ok4 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								opObjPtr = XTclThreadAllocObj(tls)
							} else {
								opObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObjPtr + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes, ts+5472, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes + 4)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).FtypePtr = uintptr(0)
						{
						}
					}
					XTcl_ListObjAppendElement(tls, uintptr(0), elemObjPtr, opObjPtr)
				}
				if (*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&TCL_TRACE_WRITES != 0 {
					for ok5 := true; ok5; ok5 = 0 != 0 {
						for ok6 := true; ok6; ok6 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								opObjPtr = XTclThreadAllocObj(tls)
							} else {
								opObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObjPtr + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes, ts+33034, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes + 5)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).FtypePtr = uintptr(0)
						{
						}
					}
					XTcl_ListObjAppendElement(tls, uintptr(0), elemObjPtr, opObjPtr)
				}
				if (*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&TCL_TRACE_UNSETS != 0 {
					for ok7 := true; ok7; ok7 = 0 != 0 {
						for ok8 := true; ok8; ok8 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								opObjPtr = XTclThreadAllocObj(tls)
							} else {
								opObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(opObjPtr + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).FrefCount = 0
						if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Flength = 0
						} else {
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
							libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes, ts+3380, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
							*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Fbytes + 5)) = int8(0)
							(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
						}
						(*Tcl_Obj)(unsafe.Pointer(opObjPtr)).FtypePtr = uintptr(0)
						{
						}
					}
					XTcl_ListObjAppendElement(tls, uintptr(0), elemObjPtr, opObjPtr)
				}
				eachTraceObjPtr = XTcl_NewListObj(tls, 0, uintptr(0))
				XTcl_ListObjAppendElement(tls, uintptr(0), eachTraceObjPtr, elemObjPtr)

				elemObjPtr = XTcl_NewStringObj(tls, tvarPtr+16, -1)
				XTcl_ListObjAppendElement(tls, uintptr(0), eachTraceObjPtr, elemObjPtr)
				XTcl_ListObjAppendElement(tls, interp, resultListPtr,
					eachTraceObjPtr)
			}
			XTcl_SetObjResult(tls, interp, resultListPtr)
			break

		}
	}
	return TCL_OK
}

var opStrings2 = [5]uintptr{
	ts + 25071, ts + 5472, ts + 3380, ts + 33034, uintptr(0),
} /* tclTrace.c:853:23 */

//----------------------------------------------------------------------
//
// Tcl_CommandTraceInfo --
//
//	Return the clientData value associated with a trace on a command.
//	This function can also be used to step through all of the traces on a
//	particular command that have the same trace function.
//
// Results:
//	The return value is the clientData value associated with a trace on
//	the given command. Information will only be returned for a trace with
//	proc as trace function. If the clientData argument is NULL then the
//	first such trace is returned; otherwise, the next relevant one after
//	the one given by clientData will be returned. If the command doesn't
//	exist then an error message is left in the interpreter and NULL is
//	returned. Also, if there are no (more) traces for the given command,
//	NULL is returned.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_CommandTraceInfo(tls *libc.TLS, interp uintptr, cmdName uintptr, flags int32, proc uintptr, prevClientData ClientData) ClientData { /* tclTrace.c:1040:1: */
	var cmdPtr uintptr
	var tracePtr uintptr

	cmdPtr = XTcl_FindCommand(tls, interp, cmdName, uintptr(0),
		TCL_LEAVE_ERR_MSG)
	if cmdPtr == uintptr(0) {
		return uintptr(0)
	}

	// Find the relevant trace, if any, and return its clientData.

	tracePtr = (*Command)(unsafe.Pointer(cmdPtr)).FtracePtr
	if prevClientData != uintptr(0) {
		for ; tracePtr != uintptr(0); tracePtr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr {
			if (*CommandTrace)(unsafe.Pointer(tracePtr)).FclientData == prevClientData &&
				(*CommandTrace)(unsafe.Pointer(tracePtr)).FtraceProc == proc {
				tracePtr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr
				break
			}
		}
	}
	for ; tracePtr != uintptr(0); tracePtr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr {
		if (*CommandTrace)(unsafe.Pointer(tracePtr)).FtraceProc == proc {
			return (*CommandTrace)(unsafe.Pointer(tracePtr)).FclientData
		}
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_TraceCommand --
//
//	Arrange for rename/deletes to a command to cause a function to be
//	invoked, which can monitor the operations.
//
//	Also optionally arrange for execution of that command to cause a
//	function to be invoked.
//
// Results:
//	A standard Tcl return value.
//
// Side effects:
//	A trace is set up on the command given by cmdName, such that future
//	changes to the command will be intermediated by proc. See the manual
//	entry for complete details on the calling sequence for proc.
//
//----------------------------------------------------------------------

func XTcl_TraceCommand(tls *libc.TLS, interp uintptr, cmdName uintptr, flags int32, proc uintptr, clientData ClientData) int32 { /* tclTrace.c:1105:1: */
	var cmdPtr uintptr
	var tracePtr uintptr

	cmdPtr = XTcl_FindCommand(tls, interp, cmdName, uintptr(0),
		TCL_LEAVE_ERR_MSG)
	if cmdPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Set up trace information.

	tracePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(CommandTrace{})))
	(*CommandTrace)(unsafe.Pointer(tracePtr)).FtraceProc = proc
	(*CommandTrace)(unsafe.Pointer(tracePtr)).FclientData = clientData
	(*CommandTrace)(unsafe.Pointer(tracePtr)).Fflags = flags & (TCL_TRACE_RENAME | TCL_TRACE_DELETE | TCL_TRACE_ANY_EXEC)
	(*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr = (*Command)(unsafe.Pointer(cmdPtr)).FtracePtr
	(*CommandTrace)(unsafe.Pointer(tracePtr)).FrefCount = 1
	(*Command)(unsafe.Pointer(cmdPtr)).FtracePtr = tracePtr
	if (*CommandTrace)(unsafe.Pointer(tracePtr)).Fflags&TCL_TRACE_ANY_EXEC != 0 {
		// Bug 3484621: up the interp's epoch if this is a BC'ed command

		if (*Command)(unsafe.Pointer(cmdPtr)).FcompileProc != uintptr(0) && !((*Command)(unsafe.Pointer(cmdPtr)).Fflags&CMD_HAS_EXEC_TRACES != 0) {
			var iPtr uintptr = interp
			(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch++
		}
		*(*int32)(unsafe.Pointer(cmdPtr + 80)) |= CMD_HAS_EXEC_TRACES
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_UntraceCommand --
//
//	Remove a previously-created trace for a command.
//
// Results:
//	None.
//
// Side effects:
//	If there exists a trace for the command given by cmdName with the
//	given flags, proc, and clientData, then that trace is removed.
//
//----------------------------------------------------------------------

func XTcl_UntraceCommand(tls *libc.TLS, interp uintptr, cmdName uintptr, flags int32, proc uintptr, clientData ClientData) { /* tclTrace.c:1171:1: */
	var tracePtr uintptr
	var prevPtr uintptr
	var cmdPtr uintptr
	var iPtr uintptr = interp
	var activePtr uintptr
	var hasExecTraces int32 = 0

	cmdPtr = XTcl_FindCommand(tls, interp, cmdName, uintptr(0),
		TCL_LEAVE_ERR_MSG)
	if cmdPtr == uintptr(0) {
		return
	}

	flags = flags & (TCL_TRACE_RENAME | TCL_TRACE_DELETE | TCL_TRACE_ANY_EXEC)

	tracePtr = (*Command)(unsafe.Pointer(cmdPtr)).FtracePtr
	prevPtr = uintptr(0)
__1:
	;
	{
		if tracePtr == uintptr(0) {
			return
		}
		if (*CommandTrace)(unsafe.Pointer(tracePtr)).FtraceProc == proc &&
			(*CommandTrace)(unsafe.Pointer(tracePtr)).Fflags&(TCL_TRACE_RENAME|TCL_TRACE_DELETE|TCL_TRACE_ANY_EXEC) == flags &&
			(*CommandTrace)(unsafe.Pointer(tracePtr)).FclientData == clientData {
			if (*CommandTrace)(unsafe.Pointer(tracePtr)).Fflags&TCL_TRACE_ANY_EXEC != 0 {
				hasExecTraces = 1
			}
			goto __3
		}

	}
	goto __2
__2:
	prevPtr = tracePtr
	tracePtr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr
	goto __1
	goto __3
__3:
	;

	// The code below makes it possible to delete traces while traces are
	// active: it makes sure that the deleted trace won't be processed by
	// CallCommandTraces.

	for activePtr = (*Interp)(unsafe.Pointer(iPtr)).FactiveCmdTracePtr; activePtr != uintptr(0); activePtr = (*ActiveCommandTrace)(unsafe.Pointer(activePtr)).FnextPtr {
		if (*ActiveCommandTrace)(unsafe.Pointer(activePtr)).FnextTracePtr == tracePtr {
			if (*ActiveCommandTrace)(unsafe.Pointer(activePtr)).FreverseScan != 0 {
				(*ActiveCommandTrace)(unsafe.Pointer(activePtr)).FnextTracePtr = prevPtr
			} else {
				(*ActiveCommandTrace)(unsafe.Pointer(activePtr)).FnextTracePtr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr
			}
		}
	}
	if prevPtr == uintptr(0) {
		(*Command)(unsafe.Pointer(cmdPtr)).FtracePtr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr
	} else {
		(*CommandTrace)(unsafe.Pointer(prevPtr)).FnextPtr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr
	}
	(*CommandTrace)(unsafe.Pointer(tracePtr)).Fflags = 0

	if libc.PostDecInt32(&(*CommandTrace)(unsafe.Pointer(tracePtr)).FrefCount, 1) <= 1 {
		XTclpFree(tls, tracePtr)
	}

	if hasExecTraces != 0 {
		tracePtr = (*Command)(unsafe.Pointer(cmdPtr)).FtracePtr
		prevPtr = uintptr(0)
	__4:
		if !(tracePtr != uintptr(0)) {
			goto __6
		}
		{
			if (*CommandTrace)(unsafe.Pointer(tracePtr)).Fflags&TCL_TRACE_ANY_EXEC != 0 {
				return
			}

		}
		goto __5
	__5:
		prevPtr = tracePtr
		tracePtr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr
		goto __4
		goto __6
	__6:
		;

		// None of the remaining traces on this command are execution traces.
		// We therefore remove this flag:

		*(*int32)(unsafe.Pointer(cmdPtr + 80)) &= libc.CplInt32(CMD_HAS_EXEC_TRACES)

		// Bug 3484621: up the interp's epoch if this is a BC'ed command

		if (*Command)(unsafe.Pointer(cmdPtr)).FcompileProc != uintptr(0) {
			(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch++
		}
	}
}

//----------------------------------------------------------------------
//
// TraceCommandProc --
//
//	This function is called to handle command changes that have been
//	traced using the "trace" command, when using the 'rename' or 'delete'
//	options.
//
// Results:
//	None.
//
// Side effects:
//	Depends on the command associated with the trace.
//
//----------------------------------------------------------------------

// ARGSUSED
func sTraceCommandProc(tls *libc.TLS, clientData ClientData, interp uintptr, oldName uintptr, newName uintptr, flags int32) { /* tclTrace.c:1283:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var tcmdPtr uintptr = clientData
	var code int32
	// var cmd Tcl_DString at bp, 216

	(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount++

	if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&flags != 0 && !(XTcl_InterpDeleted(tls, interp) != 0) &&
		!(XTcl_LimitExceeded(tls, interp) != 0) {
		// Generate a command to execute by appending list elements for the
		// old and new command name and the operation.

		XTcl_DStringInit(tls, bp)
		XTcl_DStringAppend(tls, bp, tcmdPtr+52, int32((*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Flength))
		XTcl_DStringAppendElement(tls, bp, oldName)
		XTcl_DStringAppendElement(tls, bp, func() uintptr {
			if newName != 0 {
				return newName
			}
			return ts + 2046
		}())
		if flags&TCL_TRACE_RENAME != 0 {
			XTcl_DStringAppend(tls, bp, ts+66231, int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)))
		} else if flags&TCL_TRACE_DELETE != 0 {
			XTcl_DStringAppend(tls, bp, ts+66239, int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)))
		}

		// Execute the command. We discard any object result the command
		// returns.
		//
		// Add the TCL_TRACE_DESTROYED flag to tcmdPtr to indicate to other
		// areas that this will be destroyed by us, otherwise a double-free
		// might occur depending on what the eval does.

		if flags&TCL_TRACE_DESTROYED != 0 {
			*(*int32)(unsafe.Pointer(tcmdPtr)) |= TCL_TRACE_DESTROYED
		}
		code = XTcl_EvalEx(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring,
			(*Tcl_DString)(unsafe.Pointer(bp)).Flength, 0)
		if code != TCL_OK {
			// We ignore errors in these traced commands
			//** QUESTION: Use Tcl_BackgroundException(interp, code); instead? **
		}
		XTcl_DStringFree(tls, bp)
	}

	// We delete when the trace was destroyed or if this is a delete trace,
	// because command deletes are unconditional, so the trace must go away.

	if flags&(TCL_TRACE_DESTROYED|TCL_TRACE_DELETE) != 0 {
		var untraceFlags int32 = (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags
		var state Tcl_InterpState

		if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace != uintptr(0) {
			XTcl_DeleteTrace(tls, interp, (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace)
			(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace = uintptr(0)
			XTclpFree(tls, (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartCmd)
		}
		if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&TCL_TRACE_EXEC_IN_PROGRESS != 0 {
			// Postpone deletion, until exec trace returns.

			(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags = 0
		}

		// We need to construct the same flags for Tcl_UntraceCommand as were
		// passed to Tcl_TraceCommand. Reproduce the processing of [trace add
		// execution/command]. Be careful to keep this code in sync with that.

		if untraceFlags&TCL_TRACE_ANY_EXEC != 0 {
			untraceFlags = untraceFlags | TCL_TRACE_DELETE
			if untraceFlags&(TCL_TRACE_ENTER_DURING_EXEC|
				TCL_TRACE_LEAVE_DURING_EXEC) != 0 {
				untraceFlags = untraceFlags | (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC)
			}
		} else if untraceFlags&TCL_TRACE_RENAME != 0 {
			untraceFlags = untraceFlags | TCL_TRACE_DELETE
		}

		// Remove the trace since TCL_TRACE_DESTROYED tells us to, or the
		// command we're tracing has just gone away. Then decrement the
		// clientData refCount that was set up by trace creation.
		//
		// Note that we save the (return) state of the interpreter to prevent
		// bizarre error messages.

		state = XTcl_SaveInterpState(tls, interp, TCL_OK)
		XTcl_UntraceCommand(tls, interp, oldName, untraceFlags,
			*(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
			}{sTraceCommandProc})), clientData)
		XTcl_RestoreInterpState(tls, interp, state)
		(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount--
	}
	if libc.PostDecInt32(&(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount, 1) <= 1 {
		XTclpFree(tls, tcmdPtr)
	}
}

//----------------------------------------------------------------------
//
// TclCheckExecutionTraces --
//
//	Checks on all current command execution traces, and invokes functions
//	which have been registered. This function can be used by other code
//	which performs execution to unify the tracing system, so that
//	execution traces will function for that other code.
//
//	For instance extensions like [incr Tcl] which use their own execution
//	technique can make use of Tcl's tracing.
//
//	This function is called by 'TclEvalObjvInternal'
//
// Results:
//	The return value is a standard Tcl completion code such as TCL_OK or
//	TCL_ERROR, etc.
//
// Side effects:
//	Those side effects made by any trace functions called.
//
//----------------------------------------------------------------------

func XTclCheckExecutionTraces(tls *libc.TLS, interp uintptr, command uintptr, numChars int32, cmdPtr uintptr, code int32, traceFlags int32, objc int32, objv uintptr) int32 { /* tclTrace.c:1421:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var iPtr uintptr = interp
	var tracePtr uintptr
	var lastTracePtr uintptr
	// var active ActiveCommandTrace at bp, 32

	var curLevel int32
	var traceCode int32 = TCL_OK
	var state Tcl_InterpState = uintptr(0)

	if (*Command)(unsafe.Pointer(cmdPtr)).FtracePtr == uintptr(0) {
		return traceCode
	}

	curLevel = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Flevel

	(*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FnextPtr = (*Interp)(unsafe.Pointer(iPtr)).FactiveCmdTracePtr
	(*Interp)(unsafe.Pointer(iPtr)).FactiveCmdTracePtr = bp /* &active */

	(*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FcmdPtr = cmdPtr
	lastTracePtr = uintptr(0)
	for tracePtr = (*Command)(unsafe.Pointer(cmdPtr)).FtracePtr; traceCode == TCL_OK && tracePtr != uintptr(0); tracePtr = (*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr {
		if traceFlags&TCL_TRACE_LEAVE_EXEC != 0 {
			// Execute the trace command in order of creation for "leave".

			(*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FreverseScan = 1
			(*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr = uintptr(0)
			tracePtr = (*Command)(unsafe.Pointer(cmdPtr)).FtracePtr
			for (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr != lastTracePtr {
				(*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr = tracePtr
				tracePtr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr
			}
		} else {
			(*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FreverseScan = 0
			(*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr
		}
		if (*CommandTrace)(unsafe.Pointer(tracePtr)).FtraceProc == *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32)
		}{sTraceCommandProc})) {
			var tcmdPtr uintptr = (*CommandTrace)(unsafe.Pointer(tracePtr)).FclientData

			if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags != 0 {
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FcurFlags = traceFlags | TCL_TRACE_EXEC_DIRECT
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FcurCode = code
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount++
				if state == uintptr(0) {
					state = XTcl_SaveInterpState(tls, interp, code)
				}
				traceCode = sTraceExecutionProc(tls, tcmdPtr, interp, curLevel,
					command, cmdPtr, objc, objv)
				if libc.PostDecInt32(&(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount, 1) <= 1 {
					XTclpFree(tls, tcmdPtr)
				}
			}
		}
		if (*ActiveCommandTrace)(unsafe.Pointer(bp)).FnextTracePtr != 0 {
			lastTracePtr = (*CommandTrace)(unsafe.Pointer((*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr)).FnextPtr
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FactiveCmdTracePtr = (*ActiveCommandTrace)(unsafe.Pointer(bp /* &active */)).FnextPtr
	if state != 0 {
		if traceCode == TCL_OK {
			XTcl_RestoreInterpState(tls, interp, state)
		} else {
			XTcl_DiscardInterpState(tls, state)
		}
	}

	return traceCode
}

//----------------------------------------------------------------------
//
// TclCheckInterpTraces --
//
//	Checks on all current traces, and invokes functions which have been
//	registered. This function can be used by other code which performs
//	execution to unify the tracing system. For instance extensions like
//	[incr Tcl] which use their own execution technique can make use of
//	Tcl's tracing.
//
//	This function is called by 'TclEvalObjvInternal'
//
// Results:
//	The return value is a standard Tcl completion code such as TCL_OK or
//	TCL_ERROR, etc.
//
// Side effects:
//	Those side effects made by any trace functions called.
//
//----------------------------------------------------------------------

func XTclCheckInterpTraces(tls *libc.TLS, interp uintptr, command uintptr, numChars int32, cmdPtr uintptr, code int32, traceFlags int32, objc int32, objv uintptr) int32 { /* tclTrace.c:1527:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var iPtr uintptr = interp
	var tracePtr uintptr
	var lastTracePtr uintptr
	// var active ActiveInterpTrace at bp, 24

	var curLevel int32
	var traceCode int32 = TCL_OK
	var state Tcl_InterpState = uintptr(0)

	if (*Interp)(unsafe.Pointer(iPtr)).FtracePtr == uintptr(0) ||
		(*Interp)(unsafe.Pointer(iPtr)).Fflags&INTERP_TRACE_IN_PROGRESS != 0 {
		return traceCode
	}

	curLevel = (*Interp)(unsafe.Pointer(iPtr)).FnumLevels

	(*ActiveInterpTrace)(unsafe.Pointer(bp /* &active */)).FnextPtr = (*Interp)(unsafe.Pointer(iPtr)).FactiveInterpTracePtr
	(*Interp)(unsafe.Pointer(iPtr)).FactiveInterpTracePtr = bp /* &active */

	lastTracePtr = uintptr(0)
	for tracePtr = (*Interp)(unsafe.Pointer(iPtr)).FtracePtr; traceCode == TCL_OK && tracePtr != uintptr(0); tracePtr = (*ActiveInterpTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr {
		if traceFlags&TCL_TRACE_ENTER_EXEC != 0 {
			// Execute the trace command in reverse order of creation for
			// "enterstep" operation. The order is changed for "enterstep"
			// instead of for "leavestep" as was done in
			// TclCheckExecutionTraces because for step traces,
			// Tcl_CreateObjTrace creates one more linked list of traces which
			// results in one more reversal of trace invocation.

			(*ActiveInterpTrace)(unsafe.Pointer(bp /* &active */)).FreverseScan = 1
			(*ActiveInterpTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr = uintptr(0)
			tracePtr = (*Interp)(unsafe.Pointer(iPtr)).FtracePtr
			for (*Trace)(unsafe.Pointer(tracePtr)).FnextPtr != lastTracePtr {
				(*ActiveInterpTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr = tracePtr
				tracePtr = (*Trace)(unsafe.Pointer(tracePtr)).FnextPtr
			}
			if (*ActiveInterpTrace)(unsafe.Pointer(bp)).FnextTracePtr != 0 {
				lastTracePtr = (*Trace)(unsafe.Pointer((*ActiveInterpTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr)).FnextPtr
			}
		} else {
			(*ActiveInterpTrace)(unsafe.Pointer(bp /* &active */)).FreverseScan = 0
			(*ActiveInterpTrace)(unsafe.Pointer(bp /* &active */)).FnextTracePtr = (*Trace)(unsafe.Pointer(tracePtr)).FnextPtr
		}

		if (*Trace)(unsafe.Pointer(tracePtr)).Flevel > 0 && curLevel > (*Trace)(unsafe.Pointer(tracePtr)).Flevel {
			continue
		}

		if !((*Trace)(unsafe.Pointer(tracePtr)).Fflags&TCL_TRACE_EXEC_IN_PROGRESS != 0) {
			// The proc invoked might delete the traced command which which
			// might try to free tracePtr. We want to use tracePtr until the
			// end of this if section, so we use Tcl_Preserve() and
			// Tcl_Release() to be sure it is not freed while we still need
			// it.

			XTcl_Preserve(tls, tracePtr)
			*(*int32)(unsafe.Pointer(tracePtr + 32)) |= TCL_TRACE_EXEC_IN_PROGRESS
			if state == uintptr(0) {
				state = XTcl_SaveInterpState(tls, interp, code)
			}

			if (*Trace)(unsafe.Pointer(tracePtr)).Fflags&(TCL_TRACE_ENTER_EXEC|TCL_TRACE_LEAVE_EXEC) != 0 {
				// New style trace.

				if (*Trace)(unsafe.Pointer(tracePtr)).Fflags&traceFlags != 0 {
					if (*Trace)(unsafe.Pointer(tracePtr)).Fproc == *(*uintptr)(unsafe.Pointer(&struct {
						f func(*libc.TLS, ClientData, uintptr, int32, uintptr, Tcl_Command, int32, uintptr) int32
					}{sTraceExecutionProc})) {
						var tcmdPtr uintptr = (*Trace)(unsafe.Pointer(tracePtr)).FclientData

						(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FcurFlags = traceFlags
						(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FcurCode = code
					}
					traceCode = (*struct {
						f func(*libc.TLS, ClientData, uintptr, int32, uintptr, Tcl_Command, int32, uintptr) int32
					})(unsafe.Pointer(&struct{ uintptr }{(*Trace)(unsafe.Pointer(tracePtr)).Fproc})).f(tls, (*Trace)(unsafe.Pointer(tracePtr)).FclientData, interp,
						curLevel, command, cmdPtr, objc,
						objv)
				}
			} else {
				// Old-style trace.

				if traceFlags&TCL_TRACE_ENTER_EXEC != 0 {
					// Old-style interpreter-wide traces only trigger before
					// the command is executed.

					traceCode = sCallTraceFunction(tls, interp, tracePtr, cmdPtr,
						command, numChars, objc, objv)
				}
			}
			*(*int32)(unsafe.Pointer(tracePtr + 32)) &= libc.CplInt32(TCL_TRACE_EXEC_IN_PROGRESS)
			XTcl_Release(tls, tracePtr)
		}
	}
	(*Interp)(unsafe.Pointer(iPtr)).FactiveInterpTracePtr = (*ActiveInterpTrace)(unsafe.Pointer(bp /* &active */)).FnextPtr
	if state != 0 {
		if traceCode == TCL_OK {
			XTcl_RestoreInterpState(tls, interp, state)
		} else {
			XTcl_DiscardInterpState(tls, state)
		}
	}

	return traceCode
}

//----------------------------------------------------------------------
//
// CallTraceFunction --
//
//	Invokes a trace function registered with an interpreter. These
//	functions trace command execution. Currently this trace function is
//	called with the address of the string-based Tcl_CmdProc for the
//	command, not the Tcl_ObjCmdProc.
//
// Results:
//	None.
//
// Side effects:
//	Those side effects made by the trace function.
//
//----------------------------------------------------------------------

func sCallTraceFunction(tls *libc.TLS, interp uintptr, tracePtr uintptr, cmdPtr uintptr, command uintptr, numChars int32, objc int32, objv uintptr) int32 { /* tclTrace.c:1672:1: */
	var iPtr uintptr = interp
	var commandCopy uintptr
	var traceCode int32

	// Copy the command characters into a new string.

	commandCopy = XTclStackAlloc(tls, interp, numChars+1)
	libc.Xmemcpy(tls, commandCopy, command, uint64(numChars))
	*(*int8)(unsafe.Pointer(commandCopy + uintptr(numChars))) = int8(0)

	// Call the trace function then free allocated storage.

	traceCode = (*struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr, Tcl_Command, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{(*Trace)(unsafe.Pointer(tracePtr)).Fproc})).f(tls, (*Trace)(unsafe.Pointer(tracePtr)).FclientData, iPtr,
		(*Interp)(unsafe.Pointer(iPtr)).FnumLevels, commandCopy, cmdPtr, objc, objv)

	XTclStackFree(tls, interp, commandCopy)
	return traceCode
}

//----------------------------------------------------------------------
//
// CommandObjTraceDeleted --
//
//	Ensure the trace is correctly deleted by decrementing its refCount and
//	only deleting if no other references exist.
//
// Results:
//	None.
//
// Side effects:
//	May release memory.
//
//----------------------------------------------------------------------

func sCommandObjTraceDeleted(tls *libc.TLS, clientData ClientData) { /* tclTrace.c:1724:1: */
	var tcmdPtr uintptr = clientData

	if libc.PostDecInt32(&(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount, 1) <= 1 {
		XTclpFree(tls, tcmdPtr)
	}
}

//----------------------------------------------------------------------
//
// TraceExecutionProc --
//
//	This function is invoked whenever code relevant to a 'trace execution'
//	command is executed. It is called in one of two ways in Tcl's core:
//
//	(i) by the TclCheckExecutionTraces, when an execution trace has been
//	triggered.
//	(ii) by TclCheckInterpTraces, when a prior execution trace has created
//	a trace of the internals of a procedure, passing in this function as
//	the one to be called.
//
// Results:
//	The return value is a standard Tcl completion code such as TCL_OK or
//	TCL_ERROR, etc.
//
// Side effects:
//	May invoke an arbitrary Tcl procedure, and may create or delete an
//	interpreter-wide trace.
//
//----------------------------------------------------------------------

func sTraceExecutionProc(tls *libc.TLS, clientData ClientData, interp uintptr, level int32, command uintptr, cmdInfo Tcl_Command, objc int32, objv uintptr) int32 { /* tclTrace.c:1760:1: */
	bp := tls.Alloc(432)
	defer tls.Free(432)

	var call int32 = 0
	var iPtr uintptr = interp
	var tcmdPtr uintptr = clientData
	var flags int32 = (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FcurFlags
	var code int32 = (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FcurCode
	var traceCode int32 = TCL_OK

	if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&TCL_TRACE_EXEC_IN_PROGRESS != 0 {
		// Inside any kind of execution trace callback, we do not allow any
		// further execution trace callbacks to be called for the same trace.

		return traceCode
	}

	if !(XTcl_InterpDeleted(tls, interp) != 0) && !(XTcl_LimitExceeded(tls, interp) != 0) {
		// Check whether the current call is going to eval arbitrary Tcl code
		// with a generated trace, or whether we are only going to setup
		// interpreter-wide traces to implement the 'step' traces. This latter
		// situation can happen if we create a command trace without either
		// before or after operations, but with either of the step operations.

		if flags&TCL_TRACE_EXEC_DIRECT != 0 {
			call = flags & (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags & (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC)
		} else {
			call = 1
		}

		// First, if we have returned back to the level at which we created an
		// interpreter trace for enterstep and/or leavestep execution traces,
		// we remove it here.

		if flags&TCL_TRACE_LEAVE_EXEC != 0 && (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace != uintptr(0) &&
			level == (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartLevel &&
			libc.Xstrcmp(tls, command, (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartCmd) == 0 {
			XTcl_DeleteTrace(tls, interp, (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace)
			(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace = uintptr(0)
			XTclpFree(tls, (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartCmd)
		}

		// Second, create the tcl callback, if required.

		if call != 0 {
			// var cmd Tcl_DString at bp, 216

			// var sub Tcl_DString at bp+216, 216

			var i int32
			var saveInterpFlags int32

			XTcl_DStringInit(tls, bp)
			XTcl_DStringAppend(tls, bp, tcmdPtr+52, int32((*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Flength))

			// Append command with arguments.

			XTcl_DStringInit(tls, bp+216)
			for i = 0; i < objc; i++ {
				XTcl_DStringAppendElement(tls, bp+216, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))))
			}
			XTcl_DStringAppendElement(tls, bp, (*Tcl_DString)(unsafe.Pointer(bp+216)).Fstring)
			XTcl_DStringFree(tls, bp+216)

			if flags&TCL_TRACE_ENTER_EXEC != 0 {
				// Append trace operation.

				if flags&TCL_TRACE_EXEC_DIRECT != 0 {
					XTcl_DStringAppendElement(tls, bp, ts+66061)
				} else {
					XTcl_DStringAppendElement(tls, bp, ts+66073)
				}
			} else if flags&TCL_TRACE_LEAVE_EXEC != 0 {
				var resultCode uintptr
				var resultCodeStr uintptr

				// Append result code.

				for ok := true; ok; ok = 0 != 0 {
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
						}() {
							resultCode = XTclThreadAllocObj(tls)
						} else {
							resultCode = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultCode + 32))
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
						}
					}
					(*Tcl_Obj)(unsafe.Pointer(resultCode)).FrefCount = 0
					(*Tcl_Obj)(unsafe.Pointer(resultCode)).Fbytes = uintptr(0)
					*(*int64)(unsafe.Pointer(resultCode + 32)) = int64(code)
					(*Tcl_Obj)(unsafe.Pointer(resultCode)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
					{
					}
				}
				resultCodeStr = XTcl_GetString(tls, resultCode)
				XTcl_DStringAppendElement(tls, bp, resultCodeStr)
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var _objPtr uintptr = resultCode
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}

				// Append result string.

				XTcl_DStringAppendElement(tls, bp, XTcl_GetStringResult(tls, interp))

				// Append trace operation.

				if flags&TCL_TRACE_EXEC_DIRECT != 0 {
					XTcl_DStringAppendElement(tls, bp, ts+66067)
				} else {
					XTcl_DStringAppendElement(tls, bp, ts+66083)
				}
			} else {
				XTcl_Panic(tls, ts+66247, 0)
			}

			// Execute the command. We discard any object result the command
			// returns.

			saveInterpFlags = (*Interp)(unsafe.Pointer(iPtr)).Fflags
			*(*int32)(unsafe.Pointer(iPtr + 424)) |= INTERP_TRACE_IN_PROGRESS
			*(*int32)(unsafe.Pointer(tcmdPtr)) |= TCL_TRACE_EXEC_IN_PROGRESS
			(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount++

			// This line can have quite arbitrary side-effects, including
			// deleting the trace, the command being traced, or even the
			// interpreter.

			traceCode = XTcl_EvalEx(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring,
				(*Tcl_DString)(unsafe.Pointer(bp)).Flength, 0)
			*(*int32)(unsafe.Pointer(tcmdPtr)) &= libc.CplInt32(TCL_TRACE_EXEC_IN_PROGRESS)

			// Restore the interp tracing flag to prevent cmd traces from
			// affecting interp traces.

			(*Interp)(unsafe.Pointer(iPtr)).Fflags = saveInterpFlags
			if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags == 0 {
				flags = flags | TCL_TRACE_DESTROYED
			}
			XTcl_DStringFree(tls, bp)
		}

		// Third, if there are any step execution traces for this proc, we
		// register an interpreter trace to invoke enterstep and/or leavestep
		// traces. We also need to save the current stack level and the proc
		// string in startLevel and startCmd so that we can delete this
		// interpreter trace when it reaches the end of this proc.

		if flags&TCL_TRACE_ENTER_EXEC != 0 && (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace == uintptr(0) &&
			(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&(TCL_TRACE_ENTER_DURING_EXEC|TCL_TRACE_LEAVE_DURING_EXEC) != 0 {
			var len uint32 = uint32(libc.Xstrlen(tls, command) + uint64(1))

			(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartLevel = level
			(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartCmd = XTcl_Alloc(tls, len)
			libc.Xmemcpy(tls, (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartCmd, command, uint64(len))
			(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount++
			(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace = XTcl_CreateObjTrace(tls, interp, 0,
				(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).Fflags&TCL_TRACE_ANY_EXEC>>2,
				*(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, uintptr, int32, uintptr, Tcl_Command, int32, uintptr) int32
				}{sTraceExecutionProc})), tcmdPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sCommandObjTraceDeleted})))
		}
	}
	if flags&TCL_TRACE_DESTROYED != 0 {
		if (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace != uintptr(0) {
			XTcl_DeleteTrace(tls, interp, (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace)
			(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstepTrace = uintptr(0)
			XTclpFree(tls, (*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FstartCmd)
		}
	}
	if call != 0 {
		if libc.PostDecInt32(&(*TraceCommandInfo)(unsafe.Pointer(tcmdPtr)).FrefCount, 1) <= 1 {
			XTclpFree(tls, tcmdPtr)
		}
	}
	return traceCode
}

//----------------------------------------------------------------------
//
// TraceVarProc --
//
//	This function is called to handle variable accesses that have been
//	traced using the "trace" command.
//
// Results:
//	Normally returns NULL. If the trace command returns an error, then
//	this function returns an error string.
//
// Side effects:
//	Depends on the command associated with the trace.
//
//----------------------------------------------------------------------

// ARGSUSED
func sTraceVarProc(tls *libc.TLS, clientData ClientData, interp uintptr, name1 uintptr, name2 uintptr, flags int32) uintptr { /* tclTrace.c:1967:13: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var tvarPtr uintptr = clientData
	var result uintptr
	var code int32
	var destroy int32 = 0
	// var cmd Tcl_DString at bp, 216

	var rewind int32 = (*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).Frewind

	// We might call Tcl_Eval() below, and that might evaluate [trace vdelete]
	// which might try to free tvarPtr. We want to use tvarPtr until the end
	// of this function, so we use Tcl_Preserve() and Tcl_Release() to be sure
	// it is not freed while we still need it.

	result = uintptr(0)
	if (*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&flags != 0 && !(XTcl_InterpDeleted(tls, interp) != 0) &&
		!(XTcl_LimitExceeded(tls, interp) != 0) {
		if (*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Flength != uint64(0) {
			// Generate a command to execute by appending list elements for
			// the two variable names and the operation.

			XTcl_DStringInit(tls, bp)
			XTcl_DStringAppend(tls, bp, tvarPtr+16, int32((*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Flength))
			XTcl_DStringAppendElement(tls, bp, name1)
			XTcl_DStringAppendElement(tls, bp, func() uintptr {
				if name2 != 0 {
					return name2
				}
				return ts + 2046
			}())
			if (*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&TCL_TRACE_OLD_STYLE != 0 {
				if flags&TCL_TRACE_ARRAY != 0 {
					XTcl_DStringAppend(tls, bp, ts+66288, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
				} else if flags&TCL_TRACE_READS != 0 {
					XTcl_DStringAppend(tls, bp, ts+66291, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
				} else if flags&TCL_TRACE_WRITES != 0 {
					XTcl_DStringAppend(tls, bp, ts+66294, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
				} else if flags&TCL_TRACE_UNSETS != 0 {
					XTcl_DStringAppend(tls, bp, ts+66297, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
				}
			} else {
				if flags&TCL_TRACE_ARRAY != 0 {
					XTcl_DStringAppend(tls, bp, ts+66300, int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)))
				} else if flags&TCL_TRACE_READS != 0 {
					XTcl_DStringAppend(tls, bp, ts+66307, int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)))
				} else if flags&TCL_TRACE_WRITES != 0 {
					XTcl_DStringAppend(tls, bp, ts+66313, int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)))
				} else if flags&TCL_TRACE_UNSETS != 0 {
					XTcl_DStringAppend(tls, bp, ts+66320, int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)))
				}
			}

			// Execute the command. We discard any object result the command
			// returns.
			//
			// Add the TCL_TRACE_DESTROYED flag to tvarPtr to indicate to
			// other areas that this will be destroyed by us, otherwise a
			// double-free might occur depending on what the eval does.

			if flags&TCL_TRACE_DESTROYED != 0 &&
				!((*TraceVarInfo)(unsafe.Pointer(tvarPtr)).Fflags&TCL_TRACE_DESTROYED != 0) {
				destroy = 1
				*(*int32)(unsafe.Pointer(tvarPtr)) |= TCL_TRACE_DESTROYED
			}

			// Make sure that unset traces are rune even if the execEnv is
			// rewinding (coroutine deletion, [Bug 2093947]

			if rewind != 0 && flags&TCL_TRACE_UNSETS != 0 {
				(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).Frewind = 0
			}
			code = XTcl_EvalEx(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring,
				(*Tcl_DString)(unsafe.Pointer(bp)).Flength, 0)
			if rewind != 0 {
				(*ExecEnv1)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FexecEnvPtr)).Frewind = rewind
			}
			if code != TCL_OK { // copy error msg to result
				var errMsgObj uintptr = XTcl_GetObjResult(tls, interp)

				(*Tcl_Obj)(unsafe.Pointer(errMsgObj)).FrefCount++
				result = errMsgObj
			}
			XTcl_DStringFree(tls, bp)
		}
	}
	if destroy != 0 && result != uintptr(0) {
		var errMsgObj uintptr = result

		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = errMsgObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		result = uintptr(0)
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_CreateObjTrace --
//
//	Arrange for a function to be called to trace command execution.
//
// Results:
//	The return value is a token for the trace, which may be passed to
//	Tcl_DeleteTrace to eliminate the trace.
//
// Side effects:
//	From now on, proc will be called just before a command function is
//	called to execute a Tcl command. Calls to proc will have the following
//	form:
//
//	void proc(ClientData	 clientData,
//		  Tcl_Interp *	 interp,
//		  int		 level,
//		  const char *	 command,
//		  Tcl_Command	 commandInfo,
//		  int		 objc,
//		  Tcl_Obj *const objv[]);
//
//	The 'clientData' and 'interp' arguments to 'proc' will be the same as
//	the arguments to Tcl_CreateObjTrace. The 'level' argument gives the
//	nesting depth of command interpretation within the interpreter. The
//	'command' argument is the ASCII text of the command being evaluated -
//	before any substitutions are performed. The 'commandInfo' argument
//	gives a handle to the command procedure that will be evaluated. The
//	'objc' and 'objv' parameters give the parameter vector that will be
//	passed to the command procedure. Proc does not return a value.
//
//	It is permissible for 'proc' to call Tcl_SetCommandTokenInfo to change
//	the command procedure or client data for the command being evaluated,
//	and these changes will take effect with the current evaluation.
//
//	The 'level' argument specifies the maximum nesting level of calls to
//	be traced. If the execution depth of the interpreter exceeds 'level',
//	the trace callback is not executed.
//
//	The 'flags' argument is either zero or the value,
//	TCL_ALLOW_INLINE_COMPILATION. If the TCL_ALLOW_INLINE_COMPILATION flag
//	is not present, the bytecode compiler will not generate inline code
//	for Tcl's built-in commands. This behavior will have a significant
//	impact on performance, but will ensure that all command evaluations
//	are traced. If the TCL_ALLOW_INLINE_COMPILATION flag is present, the
//	bytecode compiler will have its normal behavior of compiling in-line
//	code for some of Tcl's built-in commands. In this case, the tracing
//	will be imprecise - in-line code will not be traced - but run-time
//	performance will be improved. The latter behavior is desired for many
//	applications such as profiling of run time.
//
//	When the trace is deleted, the 'delProc' function will be invoked,
//	passing it the original client data.
//
//----------------------------------------------------------------------

func XTcl_CreateObjTrace(tls *libc.TLS, interp uintptr, level int32, flags int32, proc uintptr, clientData ClientData, delProc uintptr) Tcl_Trace { /* tclTrace.c:2135:1: */
	var tracePtr uintptr
	var iPtr uintptr = interp

	// Test if this trace allows inline compilation of commands.

	if !(flags&TCL_ALLOW_INLINE_COMPILATION != 0) {
		if (*Interp)(unsafe.Pointer(iPtr)).FtracesForbiddingInline == 0 {
			// When the first trace forbidding inline compilation is created,
			// invalidate existing compiled code for this interpreter and
			// arrange (by setting the DONT_COMPILE_CMDS_INLINE flag) that
			// when compiling new code, no commands will be compiled inline
			// (i.e., into an inline sequence of instructions). We do this
			// because commands that were compiled inline will never result in
			// a command trace being called.

			(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch++
			*(*int32)(unsafe.Pointer(iPtr + 424)) |= DONT_COMPILE_CMDS_INLINE
		}
		(*Interp)(unsafe.Pointer(iPtr)).FtracesForbiddingInline++
	}

	tracePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Trace{})))
	(*Trace)(unsafe.Pointer(tracePtr)).Flevel = level
	(*Trace)(unsafe.Pointer(tracePtr)).Fproc = proc
	(*Trace)(unsafe.Pointer(tracePtr)).FclientData = clientData
	(*Trace)(unsafe.Pointer(tracePtr)).FdelProc = delProc
	(*Trace)(unsafe.Pointer(tracePtr)).FnextPtr = (*Interp)(unsafe.Pointer(iPtr)).FtracePtr
	(*Trace)(unsafe.Pointer(tracePtr)).Fflags = flags
	(*Interp)(unsafe.Pointer(iPtr)).FtracePtr = tracePtr

	return tracePtr
}

//----------------------------------------------------------------------
//
// Tcl_CreateTrace --
//
//	Arrange for a function to be called to trace command execution.
//
// Results:
//	The return value is a token for the trace, which may be passed to
//	Tcl_DeleteTrace to eliminate the trace.
//
// Side effects:
//	From now on, proc will be called just before a command procedure is
//	called to execute a Tcl command. Calls to proc will have the following
//	form:
//
//	void
//	proc(clientData, interp, level, command, cmdProc, cmdClientData,
//		argc, argv)
//	    ClientData clientData;
//	    Tcl_Interp *interp;
//	    int level;
//	    char *command;
//	    int (*cmdProc)();
//	    ClientData cmdClientData;
//	    int argc;
//	    char **argv;
//	{
//	}
//
//	The clientData and interp arguments to proc will be the same as the
//	corresponding arguments to this function. Level gives the nesting
//	level of command interpretation for this interpreter (0 corresponds to
//	top level). Command gives the ASCII text of the raw command, cmdProc
//	and cmdClientData give the function that will be called to process the
//	command and the ClientData value it will receive, and argc and argv
//	give the arguments to the command, after any argument parsing and
//	substitution. Proc does not return a value.
//
//----------------------------------------------------------------------

func XTcl_CreateTrace(tls *libc.TLS, interp uintptr, level int32, proc uintptr, clientData ClientData) Tcl_Trace { /* tclTrace.c:2224:1: */
	var data uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(StringTraceData{})))

	(*StringTraceData)(unsafe.Pointer(data)).FclientData = clientData
	(*StringTraceData)(unsafe.Pointer(data)).Fproc = proc
	return XTcl_CreateObjTrace(tls, interp, level, 0, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr, Tcl_Command, int32, uintptr) int32
	}{sStringTraceProc})),
		data, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sStringTraceDeleteProc})))
}

//----------------------------------------------------------------------
//
// StringTraceProc --
//
//	Invoke a string-based trace function from an object-based callback.
//
// Results:
//	None.
//
// Side effects:
//	Whatever the string-based trace function does.
//
//----------------------------------------------------------------------

func sStringTraceProc(tls *libc.TLS, clientData ClientData, interp uintptr, level int32, command uintptr, commandInfo Tcl_Command, objc int32, objv uintptr) int32 { /* tclTrace.c:2257:1: */
	var data uintptr = clientData
	var cmdPtr uintptr = commandInfo
	var argv uintptr // Args to pass to string trace proc
	var i int32

	// This is a bit messy because we have to emulate the old trace interface,
	// which uses strings for everything.

	argv = XTclStackAlloc(tls, interp,
		int32(uint32(uint64(objc+1)*uint64(unsafe.Sizeof(uintptr(0))))))
	for i = 0; i < objc; i++ {
		*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) = XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}
	*(*uintptr)(unsafe.Pointer(argv + uintptr(objc)*8)) = uintptr(0)

	// Invoke the command function. Note that we cast away const-ness on two
	// parameters for compatibility with legacy code; the code MUST NOT modify
	// either command or argv.

	(*struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr, uintptr, ClientData, int32, uintptr)
	})(unsafe.Pointer(&struct{ uintptr }{(*StringTraceData)(unsafe.Pointer(data)).Fproc})).f(tls, (*StringTraceData)(unsafe.Pointer(data)).FclientData, interp, level, command,
		(*Command)(unsafe.Pointer(cmdPtr)).Fproc, (*Command)(unsafe.Pointer(cmdPtr)).FclientData, objc, argv)
	XTclStackFree(tls, interp, argv)

	return TCL_OK
}

//----------------------------------------------------------------------
//
// StringTraceDeleteProc --
//
//	Clean up memory when a string-based trace is deleted.
//
// Results:
//	None.
//
// Side effects:
//	Allocated memory is returned to the system.
//
//----------------------------------------------------------------------

func sStringTraceDeleteProc(tls *libc.TLS, clientData ClientData) { /* tclTrace.c:2313:1: */
	XTclpFree(tls, clientData)
}

//----------------------------------------------------------------------
//
// Tcl_DeleteTrace --
//
//	Remove a trace.
//
// Results:
//	None.
//
// Side effects:
//	From now on there will be no more calls to the function given in
//	trace.
//
//----------------------------------------------------------------------

func XTcl_DeleteTrace(tls *libc.TLS, interp uintptr, trace Tcl_Trace) { /* tclTrace.c:2337:1: */
	var iPtr uintptr = interp
	var prevPtr uintptr
	var tracePtr uintptr = trace
	var tracePtr2 uintptr = iPtr + 440
	var activePtr uintptr

	// Locate the trace entry in the interpreter's trace list, and remove it
	// from the list.

	prevPtr = uintptr(0)
	for *(*uintptr)(unsafe.Pointer(tracePtr2)) != uintptr(0) && *(*uintptr)(unsafe.Pointer(tracePtr2)) != tracePtr {
		prevPtr = *(*uintptr)(unsafe.Pointer(tracePtr2))
		tracePtr2 = prevPtr + 24
	}
	if *(*uintptr)(unsafe.Pointer(tracePtr2)) == uintptr(0) {
		return
	}
	*(*uintptr)(unsafe.Pointer(tracePtr2)) = (*Trace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tracePtr2)))).FnextPtr

	// The code below makes it possible to delete traces while traces are
	// active: it makes sure that the deleted trace won't be processed by
	// TclCheckInterpTraces.

	for activePtr = (*Interp)(unsafe.Pointer(iPtr)).FactiveInterpTracePtr; activePtr != uintptr(0); activePtr = (*ActiveInterpTrace)(unsafe.Pointer(activePtr)).FnextPtr {
		if (*ActiveInterpTrace)(unsafe.Pointer(activePtr)).FnextTracePtr == tracePtr {
			if (*ActiveInterpTrace)(unsafe.Pointer(activePtr)).FreverseScan != 0 {
				(*ActiveInterpTrace)(unsafe.Pointer(activePtr)).FnextTracePtr = prevPtr
			} else {
				(*ActiveInterpTrace)(unsafe.Pointer(activePtr)).FnextTracePtr = (*Trace)(unsafe.Pointer(tracePtr)).FnextPtr
			}
		}
	}

	// If the trace forbids bytecode compilation, change the interpreter's
	// state. If bytecode compilation is now permitted, flag the fact and
	// advance the compilation epoch so that procs will be recompiled to take
	// advantage of it.

	if !((*Trace)(unsafe.Pointer(tracePtr)).Fflags&TCL_ALLOW_INLINE_COMPILATION != 0) {
		(*Interp)(unsafe.Pointer(iPtr)).FtracesForbiddingInline--
		if (*Interp)(unsafe.Pointer(iPtr)).FtracesForbiddingInline == 0 {
			*(*int32)(unsafe.Pointer(iPtr + 424)) &= libc.CplInt32(DONT_COMPILE_CMDS_INLINE)
			(*Interp)(unsafe.Pointer(iPtr)).FcompileEpoch++
		}
	}

	// Execute any delete callback.

	if (*Trace)(unsafe.Pointer(tracePtr)).FdelProc != uintptr(0) {
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{(*Trace)(unsafe.Pointer(tracePtr)).FdelProc})).f(tls, (*Trace)(unsafe.Pointer(tracePtr)).FclientData)
	}

	// Delete the trace object.

	XTcl_EventuallyFree(tls, tracePtr, uintptr(3))
}

//----------------------------------------------------------------------
//
// TclTraceVarExists --
//
//	This is called from info exists. We need to trigger read and/or array
//	traces because they may end up creating a variable that doesn't
//	currently exist.
//
// Results:
//	A pointer to the Var structure, or NULL.
//
// Side effects:
//	May fill in error messages in the interp.
//
//----------------------------------------------------------------------

func XTclVarTraceExists(tls *libc.TLS, interp uintptr, varName uintptr) uintptr { /* tclTrace.c:2427:5: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var varPtr uintptr
	// var arrayPtr uintptr at bp, 8

	// The choice of "create" flag values is delicate here, and matches the
	// semantics of GetVar. Things are still not perfect, however, because if
	// you do "info exists x" you get a varPtr and therefore trigger traces.
	// However, if you do "info exists x(i)", then you only get a varPtr if x
	// is already known to be an array. Otherwise you get NULL, and no trace
	// is triggered. This matches Tcl 7.6 semantics.

	varPtr = XTclLookupVar(tls, interp, varName, uintptr(0), 0, ts+28407,
		/*createPart1*/ 0 /*createPart2*/, 1, bp)

	if varPtr == uintptr(0) {
		return uintptr(0)
	}

	if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_TRACED_READ != 0 ||
		*(*uintptr)(unsafe.Pointer(bp)) != 0 && (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags&VAR_TRACED_READ != 0 {
		XTclCallVarTraces(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* arrayPtr */)), varPtr, varName, uintptr(0),
			TCL_TRACE_READS /* leaveErrMsg */, 0)
	}

	// If the variable doesn't exist anymore and no-one's using it, then free
	// up the relevant structures and hash table entries.

	if *(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0) {
		XTclCleanupVar(tls, varPtr, *(*uintptr)(unsafe.Pointer(bp /* arrayPtr */)))
		return uintptr(0)
	}

	return varPtr
}

//----------------------------------------------------------------------
//
// TclCheckArrayTraces --
//
//	This function is invoked to when we operate on an array variable,
//	to allow any array traces to fire.
//
// Results:
//	Returns TCL_OK to indicate normal operation. Returns TCL_ERROR if
//	invocation of a trace function indicated an error. When TCL_ERROR is
//	returned, then error information is left in interp.
//
// Side effects:
//	Almost anything can happen, depending on trace; this function itself
//	doesn't have any side effects.
//
//----------------------------------------------------------------------

func XTclCheckArrayTraces(tls *libc.TLS, interp uintptr, varPtr uintptr, arrayPtr uintptr, name uintptr, index int32) int32 { /* tclTrace.c:2490:1: */
	var code int32 = TCL_OK

	if varPtr != 0 && (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_TRACED_ARRAY != 0 &&
		((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_ARRAY != 0 || *(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) {
		var iPtr uintptr = interp

		code = XTclObjCallVarTraces(tls, iPtr, arrayPtr, varPtr, name, uintptr(0),
			TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY|TCL_TRACE_ARRAY,
			/* leaveErrMsg */ 1, index)
	}
	return code
}

//----------------------------------------------------------------------
//
// TclCallVarTraces --
//
//	This function is invoked to find and invoke relevant trace functions
//	associated with a particular operation on a variable. This function
//	invokes traces both on the variable and on its containing array (where
//	relevant).
//
// Results:
//	Returns TCL_OK to indicate normal operation. Returns TCL_ERROR if
//	invocation of a trace function indicated an error. When TCL_ERROR is
//	returned and leaveErrMsg is true, then the errorInfo field of iPtr has
//	information about the error placed in it.
//
// Side effects:
//	Almost anything can happen, depending on trace; this function itself
//	doesn't have any side effects.
//
//----------------------------------------------------------------------

func XTclObjCallVarTraces(tls *libc.TLS, iPtr uintptr, arrayPtr uintptr, varPtr uintptr, part1Ptr uintptr, part2Ptr uintptr, flags int32, leaveErrMsg int32, index int32) int32 { /* tclTrace.c:2534:1: */
	var part1 uintptr
	var part2 uintptr

	if !(part1Ptr != 0) {
		part1Ptr = *(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr + 8 + uintptr(index)*8))
	}
	if !(part1Ptr != 0) {
		XTcl_Panic(tls, ts+66327, 0)
	}
	part1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes
		}
		return XTcl_GetString(tls, part1Ptr)
	}()
	if part2Ptr != 0 {
		part2 = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(part2Ptr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(part2Ptr)).Fbytes
			}
			return XTcl_GetString(tls, part2Ptr)
		}()
	} else {
		part2 = uintptr(0)
	}

	return XTclCallVarTraces(tls, iPtr, arrayPtr, varPtr, part1, part2, flags,
		leaveErrMsg)
}

func XTclCallVarTraces(tls *libc.TLS, iPtr uintptr, arrayPtr uintptr, varPtr uintptr, part1 uintptr, part2 uintptr, flags int32, leaveErrMsg int32) int32 { /* tclTrace.c:2568:1: */
	bp := tls.Alloc(280)
	defer tls.Free(280)

	var tracePtr uintptr
	// var active ActiveVarTrace at bp+256, 24

	var result uintptr
	var openParen uintptr
	var p uintptr
	// var nameCopy Tcl_DString at bp+40, 216

	var copiedName int32
	var code int32
	var disposeFlags int32
	var state Tcl_InterpState
	var hPtr uintptr
	var traceflags int32
	var offset int32
	var newPart1 uintptr
	var verb uintptr
	var type1 uintptr
	code = TCL_OK
	disposeFlags = 0
	state = uintptr(0)
	traceflags = flags & (VAR_TRACED_READ | VAR_TRACED_WRITE | VAR_TRACED_ARRAY | VAR_TRACED_UNSET)

	// If there are already similar trace functions active for the variable,
	// don't call them again.

	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_TRACE_ACTIVE != 0) {
		goto __1
	}
	return code
__1:
	;
	*(*int32)(unsafe.Pointer(varPtr)) |= VAR_TRACE_ACTIVE
	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __2
	}
	(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount++
__2:
	;
	if !(arrayPtr != 0 && (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __3
	}
	(*VarInHash)(unsafe.Pointer(arrayPtr)).FrefCount++
__3:
	;

	// If the variable name hasn't been parsed into array name and element, do
	// it here. If there really is an array element, make a copy of the
	// original name so that NULLs can be inserted into it to separate the
	// names (can't modify the name string in place, because the string might
	// get used by the callbacks we invoke).

	copiedName = 0
	if !(part2 == uintptr(0)) {
		goto __4
	}
	p = part1
__5:
	if !(*(*int8)(unsafe.Pointer(p)) != 0) {
		goto __7
	}
	if !(int32(*(*int8)(unsafe.Pointer(p))) == '(') {
		goto __8
	}
	openParen = p
__9:
	p++
	goto __10
__10:
	if int32(*(*int8)(unsafe.Pointer(p))) != 0 {
		goto __9
	}
	goto __11
__11:
	;
	p--
	if !(int32(*(*int8)(unsafe.Pointer(p))) == ')') {
		goto __12
	}
	offset = int32((int64(openParen) - int64(part1)) / 1)

	XTcl_DStringInit(tls, bp+40)
	XTcl_DStringAppend(tls, bp+40, part1, int32((int64(p)-int64(part1))/1))
	newPart1 = (*Tcl_DString)(unsafe.Pointer(bp + 40)).Fstring
	*(*int8)(unsafe.Pointer(newPart1 + uintptr(offset))) = int8(0)
	part1 = newPart1
	part2 = newPart1 + uintptr(offset) + uintptr(1)
	copiedName = 1
__12:
	;
	goto __7
__8:
	;
	goto __6
__6:
	p++
	goto __5
	goto __7
__7:
	;
__4:
	;

	// Ignore any caller-provided TCL_INTERP_DESTROYED flag.  Only we can
	// set it correctly.

	flags = flags & libc.CplInt32(TCL_INTERP_DESTROYED)

	// Invoke traces on the array containing the variable, if relevant.

	result = uintptr(0)
	(*ActiveVarTrace)(unsafe.Pointer(bp + 256 /* &active */)).FnextPtr = (*Interp)(unsafe.Pointer(iPtr)).FactiveVarTracePtr
	(*Interp)(unsafe.Pointer(iPtr)).FactiveVarTracePtr = bp + 256 /* &active */
	XTcl_Preserve(tls, iPtr)
	if !(arrayPtr != 0 && !((*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_TRACE_ACTIVE != 0) &&
		(*Var)(unsafe.Pointer(arrayPtr)).Fflags&traceflags != 0) {
		goto __13
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1024 /* &.varTraces */)).FfindProc})).f(tls, iPtr+1024 /* &.varTraces */, arrayPtr)
	(*ActiveVarTrace)(unsafe.Pointer(bp + 256 /* &active */)).FvarPtr = arrayPtr
	tracePtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
__14:
	if !(tracePtr != uintptr(0)) {
		goto __16
	}
	(*ActiveVarTrace)(unsafe.Pointer(bp + 256 /* &active */)).FnextTracePtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr
	if !!((*VarTrace)(unsafe.Pointer(tracePtr)).Fflags&flags != 0) {
		goto __17
	}
	goto __15
__17:
	;
	XTcl_Preserve(tls, tracePtr)
	if !(state == uintptr(0)) {
		goto __18
	}
	state = XTcl_SaveInterpState(tls, iPtr, code)
__18:
	;
	if !(XTcl_InterpDeleted(tls, iPtr) != 0) {
		goto __19
	}
	flags = flags | TCL_INTERP_DESTROYED
__19:
	;
	result = (*struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*VarTrace)(unsafe.Pointer(tracePtr)).FtraceProc})).f(tls, (*VarTrace)(unsafe.Pointer(tracePtr)).FclientData,
		iPtr, part1, part2, flags)
	if !(result != uintptr(0)) {
		goto __20
	}
	if !(flags&TCL_TRACE_UNSETS != 0) {
		goto __21
	}
	// Ignore errors in unset traces.

	sDisposeTraceResult(tls, (*VarTrace)(unsafe.Pointer(tracePtr)).Fflags, result)
	goto __22
__21:
	disposeFlags = (*VarTrace)(unsafe.Pointer(tracePtr)).Fflags
	code = TCL_ERROR
__22:
	;
__20:
	;
	XTcl_Release(tls, tracePtr)
	if !(code == TCL_ERROR) {
		goto __23
	}
	goto done
__23:
	;
	goto __15
__15:
	tracePtr = (*ActiveVarTrace)(unsafe.Pointer(bp + 256 /* &active */)).FnextTracePtr
	goto __14
	goto __16
__16:
	;
__13:
	;

	// Invoke traces on the variable itself.

	if !(flags&TCL_TRACE_UNSETS != 0) {
		goto __24
	}
	flags = flags | TCL_TRACE_DESTROYED
__24:
	;
	(*ActiveVarTrace)(unsafe.Pointer(bp + 256 /* &active */)).FvarPtr = varPtr
	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&traceflags != 0) {
		goto __25
	}
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1024 /* &.varTraces */)).FfindProc})).f(tls, iPtr+1024 /* &.varTraces */, varPtr)
	tracePtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
__26:
	if !(tracePtr != uintptr(0)) {
		goto __28
	}
	(*ActiveVarTrace)(unsafe.Pointer(bp + 256 /* &active */)).FnextTracePtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr
	if !!((*VarTrace)(unsafe.Pointer(tracePtr)).Fflags&flags != 0) {
		goto __29
	}
	goto __27
__29:
	;
	XTcl_Preserve(tls, tracePtr)
	if !(state == uintptr(0)) {
		goto __30
	}
	state = XTcl_SaveInterpState(tls, iPtr, code)
__30:
	;
	if !(XTcl_InterpDeleted(tls, iPtr) != 0) {
		goto __31
	}
	flags = flags | TCL_INTERP_DESTROYED
__31:
	;
	result = (*struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*VarTrace)(unsafe.Pointer(tracePtr)).FtraceProc})).f(tls, (*VarTrace)(unsafe.Pointer(tracePtr)).FclientData,
		iPtr, part1, part2, flags)
	if !(result != uintptr(0)) {
		goto __32
	}
	if !(flags&TCL_TRACE_UNSETS != 0) {
		goto __33
	}
	// Ignore errors in unset traces.

	sDisposeTraceResult(tls, (*VarTrace)(unsafe.Pointer(tracePtr)).Fflags, result)
	goto __34
__33:
	disposeFlags = (*VarTrace)(unsafe.Pointer(tracePtr)).Fflags
	code = TCL_ERROR
__34:
	;
__32:
	;
	XTcl_Release(tls, tracePtr)
	if !(code == TCL_ERROR) {
		goto __35
	}
	goto done
__35:
	;
	goto __27
__27:
	tracePtr = (*ActiveVarTrace)(unsafe.Pointer(bp + 256 /* &active */)).FnextTracePtr
	goto __26
	goto __28
__28:
	;
__25:
	;

	// Restore the variable's flags, remove the record of our active traces,
	// and then return.

done:
	if !(code == TCL_ERROR) {
		goto __36
	}
	if !(leaveErrMsg != 0) {
		goto __38
	}
	verb = ts + 2046  /* "" */
	type1 = ts + 2046 /* "" */

	switch flags & (TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_ARRAY) {
	case TCL_TRACE_READS:
		goto __41
	case TCL_TRACE_WRITES:
		goto __42
	case TCL_TRACE_ARRAY:
		goto __43
	}
	goto __40
__41:
	verb = ts + 5472 /* "read" */
	type1 = verb
	goto __40
__42:
	verb = ts + 5303   /* "set" */
	type1 = ts + 33034 /* "write" */
	goto __40
__43:
	verb = ts + 66364  /* "trace array" */
	type1 = ts + 25071 /* "array" */
	goto __40
__40:
	;

	if !(disposeFlags&TCL_TRACE_RESULT_OBJECT != 0) {
		goto __44
	}
	XTcl_SetObjResult(tls, iPtr, result)
	goto __45
__44:
	XTcl_SetObjResult(tls, iPtr,
		XTcl_NewStringObj(tls, result, -1))
__45:
	;
	XTcl_AddErrorInfo(tls, iPtr, ts+2046)

	XTcl_AppendObjToErrorInfo(tls, iPtr, XTcl_ObjPrintf(tls,
		ts+66376, libc.VaList(bp, type1, part1,
			func() uintptr {
				if part2 != 0 {
					return ts + 50354 /* "(" */
				}
				return ts + 2046 /* "" */
			}(), func() uintptr {
				if part2 != 0 {
					return part2
				}
				return ts + 2046
			}(),
			func() uintptr {
				if part2 != 0 {
					return ts + 3493 /* ")" */
				}
				return ts + 2046 /* "" */
			}())))
	if !(disposeFlags&TCL_TRACE_RESULT_OBJECT != 0) {
		goto __46
	}
	XTclVarErrMsg(tls, iPtr, part1, part2, verb,
		XTcl_GetString(tls, result))
	goto __47
__46:
	XTclVarErrMsg(tls, iPtr, part1, part2, verb, result)
__47:
	;
	*(*int32)(unsafe.Pointer(iPtr + 424)) &= libc.CplInt32(ERR_ALREADY_LOGGED)
	XTcl_DiscardInterpState(tls, state)
	goto __39
__38:
	XTcl_RestoreInterpState(tls, iPtr, state)
__39:
	;
	sDisposeTraceResult(tls, disposeFlags, result)
	goto __37
__36:
	if !(state != 0) {
		goto __48
	}
	if !(code == TCL_OK) {
		goto __49
	}
	code = XTcl_RestoreInterpState(tls, iPtr, state)
	goto __50
__49:
	XTcl_DiscardInterpState(tls, state)
__50:
	;
__48:
	;
__37:
	;

	if !(arrayPtr != 0 && (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __51
	}
	(*VarInHash)(unsafe.Pointer(arrayPtr)).FrefCount--
__51:
	;
	if !(copiedName != 0) {
		goto __52
	}
	XTcl_DStringFree(tls, bp+40)
__52:
	;
	*(*int32)(unsafe.Pointer(varPtr)) &= libc.CplInt32(VAR_TRACE_ACTIVE)
	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __53
	}
	(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount--
__53:
	;
	(*Interp)(unsafe.Pointer(iPtr)).FactiveVarTracePtr = (*ActiveVarTrace)(unsafe.Pointer(bp + 256 /* &active */)).FnextPtr
	XTcl_Release(tls, iPtr)
	return code
}

//----------------------------------------------------------------------
//
// DisposeTraceResult--
//
//	This function is called to dispose of the result returned from a trace
//	function. The disposal method appropriate to the type of result is
//	determined by flags.
//
// Results:
//	None.
//
// Side effects:
//	The memory allocated for the trace result may be freed.
//
//----------------------------------------------------------------------

func sDisposeTraceResult(tls *libc.TLS, flags int32, result uintptr) { /* tclTrace.c:2834:1: */
	if flags&TCL_TRACE_RESULT_DYNAMIC != 0 {
		XTclpFree(tls, result)
	} else if flags&TCL_TRACE_RESULT_OBJECT != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = result
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_UntraceVar --
//
//	Remove a previously-created trace for a variable.
//
// Results:
//	None.
//
// Side effects:
//	If there exists a trace for the variable given by varName with the
//	given flags, proc, and clientData, then that trace is removed.
//
//----------------------------------------------------------------------

func XTcl_UntraceVar(tls *libc.TLS, interp uintptr, varName uintptr, flags int32, proc uintptr, clientData ClientData) { /* tclTrace.c:2866:1: */
	XTcl_UntraceVar2(tls, interp, varName, uintptr(0), flags, proc, clientData)
}

//----------------------------------------------------------------------
//
// Tcl_UntraceVar2 --
//
//	Remove a previously-created trace for a variable.
//
// Results:
//	None.
//
// Side effects:
//	If there exists a trace for the variable given by part1 and part2 with
//	the given flags, proc, and clientData, then that trace is removed.
//
//----------------------------------------------------------------------

func XTcl_UntraceVar2(tls *libc.TLS, interp uintptr, part1 uintptr, part2 uintptr, flags int32, proc uintptr, clientData ClientData) { /* tclTrace.c:2898:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var tracePtr uintptr
	var prevPtr uintptr
	var nextPtr uintptr
	var varPtr uintptr
	// var arrayPtr uintptr at bp, 8

	var iPtr uintptr
	var activePtr uintptr
	var flagMask int32
	var allFlags int32
	var hPtr uintptr
	iPtr = interp
	allFlags = 0

	// Set up a mask to mask out the parts of the flags that we are not
	// interested in now.

	flagMask = TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY
	varPtr = XTclLookupVar(tls, interp, part1, part2, flags&flagMask, uintptr(0),
		/*createPart1*/ 0 /*createPart2*/, 0, bp)
	if !(varPtr == uintptr(0) || !((*Var)(unsafe.Pointer(varPtr)).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET)&flags != 0)) {
		goto __1
	}
	return
__1:
	;

	// Set up a mask to mask out the parts of the flags that we are not
	// interested in now.

	flagMask = TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS | TCL_TRACE_ARRAY | TCL_TRACE_RESULT_DYNAMIC | TCL_TRACE_RESULT_OBJECT
	flagMask = flagMask | TCL_TRACE_OLD_STYLE
	flags = flags & flagMask

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1024 /* &.varTraces */)).FfindProc})).f(tls, iPtr+1024 /* &.varTraces */, varPtr)
	tracePtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	prevPtr = uintptr(0)
__2:
	;
	if !(tracePtr == uintptr(0)) {
		goto __5
	}
	goto updateFlags
__5:
	;
	if !((*VarTrace)(unsafe.Pointer(tracePtr)).FtraceProc == proc && (*VarTrace)(unsafe.Pointer(tracePtr)).Fflags == flags &&
		(*VarTrace)(unsafe.Pointer(tracePtr)).FclientData == clientData) {
		goto __6
	}
	goto __4
__6:
	;
	allFlags = allFlags | (*VarTrace)(unsafe.Pointer(tracePtr)).Fflags
	goto __3
__3:
	prevPtr = tracePtr
	tracePtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr
	goto __2
	goto __4
__4:
	;

	// The code below makes it possible to delete traces while traces are
	// active: it makes sure that the deleted trace won't be processed by
	// TclCallVarTraces.
	//
	// Caveat (Bug 3062331): When an unset trace handler on a variable
	// tries to delete a different unset trace handler on the same variable,
	// the results may be surprising.  When variable unset traces fire, the
	// traced variable is already gone.  So the TclLookupVar() call above
	// will not find that variable, and not finding it will never reach here
	// to perform the deletion.  This means callers of Tcl_UntraceVar*()
	// attempting to delete unset traces from within the handler of another
	// unset trace have to account for the possibility that their call to
	// Tcl_UntraceVar*() is a no-op.

	activePtr = (*Interp)(unsafe.Pointer(iPtr)).FactiveVarTracePtr
__7:
	if !(activePtr != uintptr(0)) {
		goto __9
	}
	if !((*ActiveVarTrace)(unsafe.Pointer(activePtr)).FnextTracePtr == tracePtr) {
		goto __10
	}
	(*ActiveVarTrace)(unsafe.Pointer(activePtr)).FnextTracePtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr
__10:
	;
	goto __8
__8:
	activePtr = (*ActiveVarTrace)(unsafe.Pointer(activePtr)).FnextPtr
	goto __7
	goto __9
__9:
	;
	nextPtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr
	if !(prevPtr == uintptr(0)) {
		goto __11
	}
	if !(nextPtr != 0) {
		goto __13
	}
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = nextPtr
	goto __14
__13:
	XTcl_DeleteHashEntry(tls, hPtr)
__14:
	;
	goto __12
__11:
	(*VarTrace)(unsafe.Pointer(prevPtr)).FnextPtr = nextPtr
__12:
	;
	(*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr = uintptr(0)
	XTcl_EventuallyFree(tls, tracePtr, uintptr(3))

	tracePtr = nextPtr
__15:
	if !(tracePtr != uintptr(0)) {
		goto __17
	}
	allFlags = allFlags | (*VarTrace)(unsafe.Pointer(tracePtr)).Fflags
	goto __16
__16:
	tracePtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr
	goto __15
	goto __17
__17:
	;

updateFlags:
	*(*int32)(unsafe.Pointer(varPtr)) &= libc.CplInt32(VAR_TRACED_READ | VAR_TRACED_WRITE | VAR_TRACED_ARRAY | VAR_TRACED_UNSET)
	if !(allFlags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0) {
		goto __18
	}
	*(*int32)(unsafe.Pointer(varPtr)) |= allFlags & (VAR_TRACED_READ | VAR_TRACED_WRITE | VAR_TRACED_ARRAY | VAR_TRACED_UNSET)
	goto __19
__18:
	if !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) {
		goto __20
	}
	// If this is the last trace on the variable, and the variable is
	// unset and unused, then free up the variable.

	XTclCleanupVar(tls, varPtr, uintptr(0))
__20:
	;
__19:
}

//----------------------------------------------------------------------
//
// Tcl_VarTraceInfo --
//
//	Return the clientData value associated with a trace on a variable.
//	This function can also be used to step through all of the traces on a
//	particular variable that have the same trace function.
//
// Results:
//	The return value is the clientData value associated with a trace on
//	the given variable. Information will only be returned for a trace with
//	proc as trace function. If the clientData argument is NULL then the
//	first such trace is returned; otherwise, the next relevant one after
//	the one given by clientData will be returned. If the variable doesn't
//	exist, or if there are no (more) traces for it, then NULL is returned.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_VarTraceInfo(tls *libc.TLS, interp uintptr, varName uintptr, flags int32, proc uintptr, prevClientData ClientData) ClientData { /* tclTrace.c:3035:1: */
	return XTcl_VarTraceInfo2(tls, interp, varName, uintptr(0), flags, proc,
		prevClientData)
}

//----------------------------------------------------------------------
//
// Tcl_VarTraceInfo2 --
//
//	Same as Tcl_VarTraceInfo, except takes name in two pieces instead of
//	one.
//
// Results:
//	Same as Tcl_VarTraceInfo.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_VarTraceInfo2(tls *libc.TLS, interp uintptr, part1 uintptr, part2 uintptr, flags int32, proc uintptr, prevClientData ClientData) ClientData { /* tclTrace.c:3069:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var iPtr uintptr = interp
	var varPtr uintptr
	// var arrayPtr uintptr at bp, 8

	var hPtr uintptr

	varPtr = XTclLookupVar(tls, interp, part1, part2,
		flags&(TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY), uintptr(0),
		/*createPart1*/ 0 /*createPart2*/, 0, bp)
	if varPtr == uintptr(0) {
		return uintptr(0)
	}

	// Find the relevant trace, if any, and return its clientData.

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1024 /* &.varTraces */)).FfindProc})).f(tls, iPtr+1024 /* &.varTraces */, varPtr)

	if hPtr != 0 {
		var tracePtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		if prevClientData != uintptr(0) {
			for ; tracePtr != uintptr(0); tracePtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr {
				if (*VarTrace)(unsafe.Pointer(tracePtr)).FclientData == prevClientData &&
					(*VarTrace)(unsafe.Pointer(tracePtr)).FtraceProc == proc {
					tracePtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr
					break
				}
			}
		}
		for ; tracePtr != uintptr(0); tracePtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr {
			if (*VarTrace)(unsafe.Pointer(tracePtr)).FtraceProc == proc {
				return (*VarTrace)(unsafe.Pointer(tracePtr)).FclientData
			}
		}
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_TraceVar --
//
//	Arrange for reads and/or writes to a variable to cause a function to
//	be invoked, which can monitor the operations and/or change their
//	actions.
//
// Results:
//	A standard Tcl return value.
//
// Side effects:
//	A trace is set up on the variable given by varName, such that future
//	references to the variable will be intermediated by proc. See the
//	manual entry for complete details on the calling sequence for proc.
//     The variable's flags are updated.
//
//----------------------------------------------------------------------

func XTcl_TraceVar(tls *libc.TLS, interp uintptr, varName uintptr, flags int32, proc uintptr, clientData ClientData) int32 { /* tclTrace.c:3144:1: */
	return XTcl_TraceVar2(tls, interp, varName, uintptr(0), flags, proc, clientData)
}

//----------------------------------------------------------------------
//
// Tcl_TraceVar2 --
//
//	Arrange for reads and/or writes to a variable to cause a function to
//	be invoked, which can monitor the operations and/or change their
//	actions.
//
// Results:
//	A standard Tcl return value.
//
// Side effects:
//	A trace is set up on the variable given by part1 and part2, such that
//	future references to the variable will be intermediated by proc. See
//	the manual entry for complete details on the calling sequence for
//	proc. The variable's flags are updated.
//
//----------------------------------------------------------------------

func XTcl_TraceVar2(tls *libc.TLS, interp uintptr, part1 uintptr, part2 uintptr, flags int32, proc uintptr, clientData ClientData) int32 { /* tclTrace.c:3182:1: */
	var tracePtr uintptr
	var result int32

	tracePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(VarTrace{})))
	(*VarTrace)(unsafe.Pointer(tracePtr)).FtraceProc = proc
	(*VarTrace)(unsafe.Pointer(tracePtr)).FclientData = clientData
	(*VarTrace)(unsafe.Pointer(tracePtr)).Fflags = flags

	result = sTraceVarEx(tls, interp, part1, part2, tracePtr)

	if result != TCL_OK {
		XTclpFree(tls, tracePtr)
	}
	return result
}

//----------------------------------------------------------------------
//
// TraceVarEx --
//
//	Arrange for reads and/or writes to a variable to cause a function to
//	be invoked, which can monitor the operations and/or change their
//	actions.
//
// Results:
//	A standard Tcl return value.
//
// Side effects:
//	A trace is set up on the variable given by part1 and part2, such that
//	future references to the variable will be intermediated by the
//	traceProc listed in tracePtr. See the manual entry for complete
//	details on the calling sequence for proc.
//
//----------------------------------------------------------------------

func sTraceVarEx(tls *libc.TLS, interp uintptr, part1 uintptr, part2 uintptr, tracePtr uintptr) int32 { /* tclTrace.c:3235:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var iPtr uintptr = interp
	var varPtr uintptr
	// var arrayPtr uintptr at bp, 8

	var flagMask int32
	// var isNew int32 at bp+8, 4

	var hPtr uintptr

	// We strip 'flags' down to just the parts which are relevant to
	// TclLookupVar, to avoid conflicts between trace flags and internal
	// namespace flags such as 'TCL_FIND_ONLY_NS'. This can now occur since we
	// have trace flags with values 0x1000 and higher.

	flagMask = TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY
	varPtr = XTclLookupVar(tls, interp, part1, part2,
		(*VarTrace)(unsafe.Pointer(tracePtr)).Fflags&flagMask|TCL_LEAVE_ERR_MSG,
		ts+5341, 1 /*createPart2*/, 1, bp)
	if varPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Check for a nonsense flag combination. Note that this is a Tcl_Panic()
	// because there should be no code path that ever sets both flags.

	if (*VarTrace)(unsafe.Pointer(tracePtr)).Fflags&TCL_TRACE_RESULT_DYNAMIC != 0 &&
		(*VarTrace)(unsafe.Pointer(tracePtr)).Fflags&TCL_TRACE_RESULT_OBJECT != 0 {
		XTcl_Panic(tls, ts+66406, 0)
	}

	// Set up trace information.

	flagMask = TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS | TCL_TRACE_ARRAY | TCL_TRACE_RESULT_DYNAMIC | TCL_TRACE_RESULT_OBJECT
	flagMask = flagMask | TCL_TRACE_OLD_STYLE
	(*VarTrace)(unsafe.Pointer(tracePtr)).Fflags = (*VarTrace)(unsafe.Pointer(tracePtr)).Fflags & flagMask

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1024 /* &.varTraces */)).FcreateProc})).f(tls, iPtr+1024 /* &.varTraces */, varPtr, bp+8 /* &isNew */)
	if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
		(*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr = uintptr(0)
	} else {
		(*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	}
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = tracePtr

	// Mark the variable as traced so we know to call them.

	*(*int32)(unsafe.Pointer(varPtr)) |= (*VarTrace)(unsafe.Pointer(tracePtr)).Fflags & (VAR_TRACED_READ | VAR_TRACED_WRITE | VAR_TRACED_ARRAY | VAR_TRACED_UNSET)

	return TCL_OK
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Values for the flags field in Channel. Any ORed combination of the
// following flags can be stored in the field. These flags record various
// options and state bits about the channel. In addition to the flags below,
// the channel can also have TCL_READABLE (1<<1) and TCL_WRITABLE (1<<2) set.

// The length of time to wait between synthetic timer events. Must be zero or
// bad things tend to happen.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 7.1-2 General Terminal Interface	<termios.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// We need `pid_t'.
// bits/types.h -- definitions of __*_t types underlying *_t types.
//    Copyright (C) 2002-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Never include this file directly; use <sys/types.h> instead.

// Get the system-dependent definitions of `struct termios', `tcflag_t',
//    `cc_t', `speed_t', and all the macros specifying the flag bits.
// termios type and macro definitions.  Linux version.
//    Copyright (C) 1993-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

type Cc_t = uint8      /* termios.h:23:23 */
type Speed_t = uint32  /* termios.h:24:22 */
type Tcflag_t = uint32 /* termios.h:25:22 */

// struct termios definition.  Linux/generic version.
//    Copyright (C) 2019-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library.  If not, see
//    <https://www.gnu.org/licenses/>.

type Termios = struct {
	Fc_iflag     Tcflag_t
	Fc_oflag     Tcflag_t
	Fc_cflag     Tcflag_t
	Fc_lflag     Tcflag_t
	Fc_line      Cc_t
	Fc_cc        [32]Cc_t
	F__ccgo_pad1 [3]byte
	Fc_ispeed    Speed_t
	Fc_ospeed    Speed_t
} /* termios-struct.h:24:1 */

// -
// Copyright (c) 1982, 1986, 1993
//	The Regents of the University of California.  All rights reserved.
// (c) UNIX System Laboratories, Inc.
// All or some portions of this file are derived from material licensed
// to the University of California by American Telephone and Telegraph
// Co. or Unix System Laboratories, Inc. and are reproduced herein with
// the permission of UNIX System Laboratories, Inc.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
// 4. Neither the name of the University nor the names of its contributors
//    may be used to endorse or promote products derived from this software
//    without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
//	@(#)ttydefaults.h	8.4 (Berkeley) 1/21/94

// System wide defaults for terminal state.  Linux version.

// Defaults on "first" open.

// Control Character Defaults
// compat

// PROTECTED INCLUSION ENDS HERE

// #define TTYDEFCHARS to include an array of default control characters.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Get the list of `ioctl' requests and related constants.
// Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Use the definitions from the kernel header files.
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// ioctl command encoding: 32 bits total, command in lower 16 bits,
// size of the parameter structure in the lower 14 bits of the
// upper 16 bits.
// Encoding the size of the parameter structure in the ioctl request
// is useful for catching programs compiled with old versions
// and to avoid overwriting user space outside the user buffer area.
// The highest 2 bits are reserved for indicating the ``access mode''.
// NOTE: This limits the max parameter size to 16kB -1 !

// The following is for compatibility across the various Linux
// platforms.  The generic ioctl numbering scheme doesn't really enforce
// a type field.  De facto, however, the top 8 bits of the lower 16
// bits are indeed used as a type field, so we might just as well make
// this explicit here.  Please be sure to use the decoding macros
// below from now on.

// Let any architecture override either of the following before
// including this file.

// Direction bits, which any architecture can choose to override
// before including this file.
//
// NOTE: _IOC_WRITE means userland is writing and kernel is
// reading. _IOC_READ means userland is reading and kernel is writing.

// Used to create numbers.
//
// NOTE: _IOW means userland is writing and kernel is reading. _IOR
// means userland is reading and kernel is writing.

// used to decode ioctl numbers..

// ...and for the drivers/sound files...

// These are the most common definitions for tty ioctl numbers.
// Most of them do not use the recommended _IOC(), but there is
// probably some source code out there hardcoding the number,
// so we might as well use them for all new platforms.
//
// The architectures that use different values here typically
// try to be compatible with some Unix variants for the same
// architecture.

// 0x54 is just a magic number to make these relatively unique ('T')

// Some arches already define FIOQSIZE due to a historical
// conflict with a Hayes modem-specific ioctl value.

// Used for packet mode

// Routing table calls.

// Socket configuration controls.

// ARP cache control calls.
//  0x8950 - 0x8952  * obsolete calls, don't re-use

// RARP cache control calls.

// Driver configuration calls

// DLCI configuration calls

// Device private ioctl calls.

// These 16 ioctls are available to devices via the do_ioctl() device
//    vector.  Each device should include this file and redefine these
//    names as their own. Because these are device dependent it is a good
//    idea _NOT_ to issue them to random objects and hope.

//	These 16 ioctl calls are protocol private

// Define some types used by `ioctl' requests.
// Structure types for pre-termios terminal ioctls.  Linux version.
//    Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Get definition of constants for use with `ioctl'.
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

type Winsize = struct {
	Fws_row    uint16
	Fws_col    uint16
	Fws_xpixel uint16
	Fws_ypixel uint16
} /* ioctl-types.h:27:1 */

type Termio = struct {
	Fc_iflag     uint16
	Fc_oflag     uint16
	Fc_cflag     uint16
	Fc_lflag     uint16
	Fc_line      uint8
	Fc_cc        [8]uint8
	F__ccgo_pad1 [1]byte
} /* ioctl-types.h:36:1 */

// Helper macros to make parts of this file clearer. The macros do exactly
// what they say on the tin. :-) They also only ever refer to their arguments
// once, and so can be used without regard to side effects.

// This structure describes per-instance state of a file based channel.

type FileState1 = struct {
	Fchannel   Tcl_Channel
	Ffd        int32
	FvalidMask int32
} /* tclUnixChan.c:64:9 */

// Helper macros to make parts of this file clearer. The macros do exactly
// what they say on the tin. :-) They also only ever refer to their arguments
// once, and so can be used without regard to side effects.

// This structure describes per-instance state of a file based channel.

type FileState = FileState1 /* tclUnixChan.c:70:3 */

// The following structure is used to set or get the serial port attributes in
// a platform-independent manner.

type TtyAttrs1 = struct {
	Fbaud   int32
	Fparity int32
	Fdata   int32
	Fstop   int32
} /* tclUnixChan.c:79:9 */

// The following structure is used to set or get the serial port attributes in
// a platform-independent manner.

type TtyAttrs = TtyAttrs1 /* tclUnixChan.c:84:3 */

// This structure describes the channel type structure for file based IO:

var fileChannelType = Tcl_ChannelType{
	FtypeName:      ts + 12110,
	Fversion:       uintptr(0x5),
	FcloseProc:     0, // Close proc.
	FinputProc:     0, // Input proc.
	FoutputProc:    0, // Output proc.
	FseekProc:      0, // Get option proc.
	FwatchProc:     0, // Initialize notifier.
	FgetHandleProc: 0, // Get OS handles out of channel.
	Fclose2Proc:    0, // close2proc.
	FblockModeProc: 0, // handler proc.
	FwideSeekProc:  0,
	FtruncateProc:  0, // truncate proc.
} /* tclUnixChan.c:138:30 */

// This structure describes the channel type structure for serial IO.
// Note that this type is a subclass of the "file" type.

var ttyChannelType = Tcl_ChannelType{
	FtypeName:      ts + 66434,
	Fversion:       uintptr(0x5),
	FcloseProc:     0, // Close proc.
	FinputProc:     0, // Input proc.
	FoutputProc:    0, // Seek proc.
	FsetOptionProc: 0, // Set option proc.
	FgetOptionProc: 0, // Get option proc.
	FwatchProc:     0, // Initialize notifier.
	FgetHandleProc: 0, // Get OS handles out of channel.
	Fclose2Proc:    0, // close2proc.
	FblockModeProc: 0, // truncate proc.
} /* tclUnixChan.c:164:30 */

//----------------------------------------------------------------------
//
// FileBlockModeProc --
//
//	Helper function to set blocking and nonblocking modes on a file based
//	channel. Invoked by generic IO level code.
//
// Results:
//	0 if successful, errno when failed.
//
// Side effects:
//	Sets the device into blocking or non-blocking mode.
//
//----------------------------------------------------------------------

func sFileBlockModeProc(tls *libc.TLS, instanceData ClientData, mode int32) int32 { /* tclUnixChan.c:203:1: */
	var fsPtr uintptr = instanceData

	if XTclUnixSetBlockingMode(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, mode) < 0 {
		return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	}

	return 0
}

//----------------------------------------------------------------------
//
// FileInputProc --
//
//	This function is invoked from the generic IO level to read input from
//	a file based channel.
//
// Results:
//	The number of bytes read is returned or -1 on error. An output
//	argument contains a POSIX error code if an error occurs, or zero.
//
// Side effects:
//	Reads input from the input device of the channel.
//
//----------------------------------------------------------------------

func sFileInputProc(tls *libc.TLS, instanceData ClientData, buf uintptr, toRead int32, errorCodePtr uintptr) int32 { /* tclUnixChan.c:236:1: */
	var fsPtr uintptr = instanceData
	var bytesRead int32 // How many bytes were actually read from the
	// input device?

	*(*int32)(unsafe.Pointer(errorCodePtr)) = 0

	// Assume there is always enough input available. This will block
	// appropriately, and read will unblock as soon as a short read is
	// possible, if the channel is in blocking mode. If the channel is
	// nonblocking, the read will never block.

	for ok := true; ok; ok = bytesRead < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EINTR {
		bytesRead = int32(libc.Xread(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, buf, Size_t(toRead)))
	}

	if bytesRead < 0 {
		*(*int32)(unsafe.Pointer(errorCodePtr)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
		return -1
	}
	return bytesRead
}

//----------------------------------------------------------------------
//
// FileOutputProc--
//
//	This function is invoked from the generic IO level to write output to
//	a file channel.
//
// Results:
//	The number of bytes written is returned or -1 on error. An output
//	argument contains a POSIX error code if an error occurred, or zero.
//
// Side effects:
//	Writes output on the output device of the channel.
//
//----------------------------------------------------------------------

func sFileOutputProc(tls *libc.TLS, instanceData ClientData, buf uintptr, toWrite int32, errorCodePtr uintptr) int32 { /* tclUnixChan.c:286:1: */
	var fsPtr uintptr = instanceData
	var written int32

	*(*int32)(unsafe.Pointer(errorCodePtr)) = 0

	if toWrite == 0 {
		// SF Tcl Bug 465765. Do not try to write nothing into a file. STREAM
		// based implementations will considers this as EOF (if there is a
		// pipe behind the file).

		return 0
	}
	written = int32(libc.Xwrite(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, buf, Size_t(toWrite)))
	if written > -1 {
		return written
	}
	*(*int32)(unsafe.Pointer(errorCodePtr)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	return -1
}

//----------------------------------------------------------------------
//
// FileCloseProc --
//
//	This function is called from the generic IO level to perform
//	channel-type-specific cleanup when a file based channel is closed.
//
// Results:
//	0 if successful, errno if failed.
//
// Side effects:
//	Closes the device of the channel.
//
//----------------------------------------------------------------------

func sFileCloseProc(tls *libc.TLS, instanceData ClientData, interp uintptr) int32 { /* tclUnixChan.c:332:1: */
	var fsPtr uintptr = instanceData
	var errorCode int32 = 0

	XTcl_DeleteFileHandler(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd)

	// Do not close standard channels while in thread-exit.

	if !(XTclInThreadExit(tls) != 0) ||
		(*FileState)(unsafe.Pointer(fsPtr)).Ffd != 0 && (*FileState)(unsafe.Pointer(fsPtr)).Ffd != 1 && (*FileState)(unsafe.Pointer(fsPtr)).Ffd != 2 {
		if libc.Xclose(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd) < 0 {
			errorCode = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
		}
	}
	XTclpFree(tls, fsPtr)
	return errorCode
}

func sFileClose2Proc(tls *libc.TLS, instanceData ClientData, interp uintptr, flags int32) int32 { /* tclUnixChan.c:355:1: */
	if flags&(int32(1)<<1|int32(1)<<2) == 0 {
		return sFileCloseProc(tls, instanceData, interp)
	}
	return EINVAL
}

//----------------------------------------------------------------------
//
// FileSeekProc --
//
//	This function is called by the generic IO level to move the access
//	point in a file based channel.
//
// Results:
//	-1 if failed, the new position if successful. An output argument
//	contains the POSIX error code if an error occurred, or zero.
//
// Side effects:
//	Moves the location at which the channel will be accessed in future
//	operations.
//
//----------------------------------------------------------------------

func sFileSeekProc(tls *libc.TLS, instanceData ClientData, offset int64, mode int32, errorCodePtr uintptr) int32 { /* tclUnixChan.c:386:1: */
	var fsPtr uintptr = instanceData
	var oldLoc Tcl_WideInt
	var newLoc Tcl_WideInt

	// Save our current place in case we need to roll-back the seek.

	oldLoc = libc.Xlseek(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, int64(0), SEEK_CUR)
	if oldLoc == int64(-1) {
		// Bad things are happening. Error out...

		*(*int32)(unsafe.Pointer(errorCodePtr)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
		return -1
	}

	newLoc = libc.Xlseek(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, offset, mode)

	// Check for expressability in our return type, and roll-back otherwise.

	if newLoc > int64(0x7fffffff) {
		*(*int32)(unsafe.Pointer(errorCodePtr)) = EOVERFLOW
		libc.Xlseek(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, oldLoc, SEEK_SET)
		return -1
	} else {
		*(*int32)(unsafe.Pointer(errorCodePtr)) = func() int32 {
			if newLoc == int64(-1) {
				return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
			}
			return 0
		}()
	}
	return int32(newLoc)
}

//----------------------------------------------------------------------
//
// FileWideSeekProc --
//
//	This function is called by the generic IO level to move the access
//	point in a file based channel, with offsets expressed as wide
//	integers.
//
// Results:
//	-1 if failed, the new position if successful. An output argument
//	contains the POSIX error code if an error occurred, or zero.
//
// Side effects:
//	Moves the location at which the channel will be accessed in future
//	operations.
//
//----------------------------------------------------------------------

func sFileWideSeekProc(tls *libc.TLS, instanceData ClientData, offset Tcl_WideInt, mode int32, errorCodePtr uintptr) Tcl_WideInt { /* tclUnixChan.c:447:1: */
	var fsPtr uintptr = instanceData
	var newLoc Tcl_WideInt

	newLoc = libc.Xlseek(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, offset, mode)

	*(*int32)(unsafe.Pointer(errorCodePtr)) = func() int32 {
		if newLoc == int64(-1) {
			return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
		}
		return 0
	}()
	return newLoc
}

//----------------------------------------------------------------------
//
// FileWatchProc --
//
//	Initialize the notifier to watch the fd from this channel.
//
// Results:
//	None.
//
// Side effects:
//	Sets up the notifier so that a future event on the channel will
//	be seen by Tcl.
//
//----------------------------------------------------------------------

func sFileWatchProc(tls *libc.TLS, instanceData ClientData, mask int32) { /* tclUnixChan.c:481:1: */
	var fsPtr uintptr = instanceData

	// Make sure we only register for events that are valid on this file. Note
	// that we are passing Tcl_NotifyChannel directly to Tcl_CreateFileHandler
	// with the channel pointer as the client data.

	mask = mask & (*FileState)(unsafe.Pointer(fsPtr)).FvalidMask
	if mask != 0 {
		XTcl_CreateFileHandler(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, mask,
			*(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, Tcl_Channel, int32)
			}{XTcl_NotifyChannel})), (*FileState)(unsafe.Pointer(fsPtr)).Fchannel)
	} else {
		XTcl_DeleteFileHandler(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd)
	}
}

//----------------------------------------------------------------------
//
// FileGetHandleProc --
//
//	Called from Tcl_GetChannelHandle to retrieve OS handles from a file
//	based channel.
//
// Results:
//	Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no
//	handle for the specified direction.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sFileGetHandleProc(tls *libc.TLS, instanceData ClientData, direction int32, handlePtr uintptr) int32 { /* tclUnixChan.c:523:1: */
	var fsPtr uintptr = instanceData

	if direction&(*FileState)(unsafe.Pointer(fsPtr)).FvalidMask != 0 {
		*(*ClientData)(unsafe.Pointer(handlePtr)) = uintptr(Intptr_t((*FileState)(unsafe.Pointer(fsPtr)).Ffd))
		return TCL_OK
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TtyModemStatusStr --
//
//	Converts a RS232 modem status list of readable flags
//
//----------------------------------------------------------------------

func sTtyModemStatusStr(tls *libc.TLS, status int32, dsPtr uintptr) { /* tclUnixChan.c:549:1: */
	XTcl_DStringAppendElement(tls, dsPtr, ts+66438)
	XTcl_DStringAppendElement(tls, dsPtr, func() uintptr {
		if status&TIOCM_CTS != 0 {
			return ts + 6615 /* "1" */
		}
		return ts + 18333 /* "0" */
	}())
	XTcl_DStringAppendElement(tls, dsPtr, ts+66442)
	XTcl_DStringAppendElement(tls, dsPtr, func() uintptr {
		if status&TIOCM_DSR != 0 {
			return ts + 6615 /* "1" */
		}
		return ts + 18333 /* "0" */
	}())
	XTcl_DStringAppendElement(tls, dsPtr, ts+66446)
	XTcl_DStringAppendElement(tls, dsPtr, func() uintptr {
		if status&TIOCM_RNG != 0 {
			return ts + 6615 /* "1" */
		}
		return ts + 18333 /* "0" */
	}())
	XTcl_DStringAppendElement(tls, dsPtr, ts+66451)
	XTcl_DStringAppendElement(tls, dsPtr, func() uintptr {
		if status&TIOCM_CAR != 0 {
			return ts + 6615 /* "1" */
		}
		return ts + 18333 /* "0" */
	}())
}

//----------------------------------------------------------------------
//
// TtySetOptionProc --
//
//	Sets an option on a channel.
//
// Results:
//	A standard Tcl result. Also sets the interp's result on error if
//	interp is not NULL.
//
// Side effects:
//	May modify an option on a device. Sets Error message if needed (by
//	calling Tcl_BadChannelOption).
//
//----------------------------------------------------------------------

func sTtySetOptionProc(tls *libc.TLS, instanceData ClientData, interp uintptr, optionName uintptr, value uintptr) int32 { /* tclUnixChan.c:590:1: */
	bp := tls.Alloc(548)
	defer tls.Free(548)

	var fsPtr uintptr = instanceData
	var len uint32
	var vlen uint32
	// var tty TtyAttrs at bp+232, 16

	// var argc int32 at bp+308, 4

	// var argv uintptr at bp+312, 8

	// var iostate Termios at bp+248, 60

	len = uint32(libc.Xstrlen(tls, optionName))
	vlen = uint32(libc.Xstrlen(tls, value))

	// Option -mode baud,parity,databits,stopbits

	if len > uint32(2) && libc.Xstrncmp(tls, optionName, ts+66455, uint64(len)) == 0 {
		if sTtyParseMode(tls, interp, value, bp+232) != TCL_OK {
			return TCL_ERROR
		}

		// system calls results should be checked there. - dl

		sTtySetAttributes(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, bp+232)
		return TCL_OK
	}

	// Option -handshake none|xonxoff|rtscts|dtrdsr

	if len > uint32(1) && libc.Xstrncmp(tls, optionName, ts+66461, uint64(len)) == 0 {
		// Reset all handshake options. DTR and RTS are ON by default.

		libc.Xtcgetattr(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, bp+248)
		*(*Tcflag_t)(unsafe.Pointer(bp + 248)) &= libc.Uint32FromInt32(libc.CplInt32(IXON | IXOFF | IXANY))
		*(*Tcflag_t)(unsafe.Pointer(bp + 248 + 8)) &= libc.CplUint32(CRTSCTS)
		if XTcl_UtfNcasecmp(tls, value, ts+8211, uint64(vlen)) == 0 {
			// Leave all handshake options disabled.
		} else if XTcl_UtfNcasecmp(tls, value, ts+66472, uint64(vlen)) == 0 {
			*(*Tcflag_t)(unsafe.Pointer(bp + 248)) |= Tcflag_t(IXON | IXOFF | IXANY)
		} else if XTcl_UtfNcasecmp(tls, value, ts+66480, uint64(vlen)) == 0 {
			*(*Tcflag_t)(unsafe.Pointer(bp + 248 + 8)) |= CRTSCTS
		} else if XTcl_UtfNcasecmp(tls, value, ts+66487, uint64(vlen)) == 0 {
			if interp != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+66494, libc.VaList(bp, ts+66529)))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+66547, uintptr(0)))
			}

			return TCL_ERROR
		} else {
			if interp != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+66559, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+7420, ts+66632,
					ts+6915, uintptr(0)))
			}
			return TCL_ERROR
		}
		libc.Xtcsetattr(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, TCSADRAIN, bp+248)
		return TCL_OK
	}

	// Option -xchar {\x11 \x13}

	if len > uint32(1) && libc.Xstrncmp(tls, optionName, ts+66643, uint64(len)) == 0 {
		// var ds Tcl_DString at bp+320, 216

		if XTcl_SplitList(tls, interp, value, bp+308, bp+312) == TCL_ERROR {
			return TCL_ERROR
		} else if *(*int32)(unsafe.Pointer(bp + 308)) != 2 {
			if interp != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+66650, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+7420, ts+66632,
					ts+6915, uintptr(0)))
			}
			XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 312)))
			return TCL_ERROR
		}

		libc.Xtcgetattr(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, bp+248)

		XTcl_UtfToExternalDString(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312 /* argv */)))), -1, bp+320)
		*(*Cc_t)(unsafe.Pointer(bp + 248 + 17 + 8)) = *(*Cc_t)(unsafe.Pointer((*Tcl_DString)(unsafe.Pointer(bp + 320)).Fstring))
		XTcl_DStringSetLength(tls, bp+320, 0)

		XTcl_UtfToExternalDString(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312 /* argv */)) + 1*8)), -1, bp+320)
		*(*Cc_t)(unsafe.Pointer(bp + 248 + 17 + 9)) = *(*Cc_t)(unsafe.Pointer((*Tcl_DString)(unsafe.Pointer(bp + 320)).Fstring))
		XTcl_DStringFree(tls, bp+320)
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 312)))

		libc.Xtcsetattr(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, TCSADRAIN, bp+248)
		return TCL_OK
	}

	// Option -timeout msec

	if len > uint32(2) && libc.Xstrncmp(tls, optionName, ts+66705, uint64(len)) == 0 {
		// var msec int32 at bp+536, 4

		libc.Xtcgetattr(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, bp+248)
		if XTcl_GetInt(tls, interp, value, bp+536) != TCL_OK {
			return TCL_ERROR
		}
		*(*Cc_t)(unsafe.Pointer(bp + 248 + 17 + 6)) = Cc_t(0)
		*(*Cc_t)(unsafe.Pointer(bp + 248 + 17 + 5)) = func() uint8 {
			if *(*int32)(unsafe.Pointer(bp + 536)) == 0 {
				return uint8(0)
			}
			return func() uint8 {
				if *(*int32)(unsafe.Pointer(bp + 536)) < 100 {
					return uint8(1)
				}
				return uint8((*(*int32)(unsafe.Pointer(bp + 536)) + 50) / 100)
			}()
		}()
		libc.Xtcsetattr(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, TCSADRAIN, bp+248)
		return TCL_OK
	}

	// Option -ttycontrol {DTR 1 RTS 0 BREAK 0}
	if len > uint32(4) && libc.Xstrncmp(tls, optionName, ts+66714, uint64(len)) == 0 {
		var i int32
		// var control int32 at bp+540, 4

		// var flag int32 at bp+544, 4

		if XTcl_SplitList(tls, interp, value, bp+308, bp+312) == TCL_ERROR {
			return TCL_ERROR
		}
		if *(*int32)(unsafe.Pointer(bp + 308))%2 == 1 {
			if interp != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+66726, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+112, ts+3593, ts+7420, ts+66632,
					ts+6915, uintptr(0)))
			}
			XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 312)))
			return TCL_ERROR
		}

		libc.Xioctl(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, uint64(TIOCMGET), libc.VaList(bp+152, bp+540))
		for i = 0; i < *(*int32)(unsafe.Pointer(bp + 308 /* argc */))-1; i = i + 2 {
			if XTcl_GetBoolean(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + uintptr(i+1)*8)), bp+544) == TCL_ERROR {
				XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 312)))
				return TCL_ERROR
			}
			if XTcl_UtfNcasecmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + uintptr(i)*8)), ts+66792, libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + uintptr(i)*8)))) == 0 {
				if *(*int32)(unsafe.Pointer(bp + 544)) != 0 {
					*(*int32)(unsafe.Pointer(bp + 540 /* control */)) |= TIOCM_DTR
				} else {
					*(*int32)(unsafe.Pointer(bp + 540 /* control */)) &= libc.CplInt32(TIOCM_DTR)
				}
			} else if XTcl_UtfNcasecmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + uintptr(i)*8)), ts+66796, libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + uintptr(i)*8)))) == 0 {
				if *(*int32)(unsafe.Pointer(bp + 544)) != 0 {
					*(*int32)(unsafe.Pointer(bp + 540 /* control */)) |= TIOCM_RTS
				} else {
					*(*int32)(unsafe.Pointer(bp + 540 /* control */)) &= libc.CplInt32(TIOCM_RTS)
				}
			} else if XTcl_UtfNcasecmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + uintptr(i)*8)), ts+66800, libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + uintptr(i)*8)))) == 0 {
				if *(*int32)(unsafe.Pointer(bp + 544)) != 0 {
					libc.Xioctl(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, uint64(TIOCSBRK), libc.VaList(bp+160, uintptr(0)))
				} else {
					libc.Xioctl(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, uint64(TIOCCBRK), libc.VaList(bp+168, uintptr(0)))
				}
			} else {
				if interp != 0 {
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

						ts+66806, libc.VaList(bp+176, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312 /* argv */)) + uintptr(i)*8)))))
					XTcl_SetErrorCode(tls, interp, libc.VaList(bp+184, ts+3593, ts+7420, ts+66632,
						ts+6915, uintptr(0)))
				}
				XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 312)))
				return TCL_ERROR
			}
		} // -ttycontrol options loop

		libc.Xioctl(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, uint64(TIOCMSET), libc.VaList(bp+224, bp+540))
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 312)))
		return TCL_OK
	}

	return XTcl_BadChannelOption(tls, interp, optionName,
		ts+66865)
}

//----------------------------------------------------------------------
//
// TtyGetOptionProc --
//
//	Gets a mode associated with an IO channel. If the optionName arg is
//	non-NULL, retrieves the value of that option. If the optionName arg is
//	NULL, retrieves a list of alternating option names and values for the
//	given channel.
//
// Results:
//	A standard Tcl result. Also sets the supplied DString to the string
//	value of the option(s) returned.  Sets error message if needed
//	(by calling Tcl_BadChannelOption).
//
//----------------------------------------------------------------------

func sTtyGetOptionProc(tls *libc.TLS, instanceData ClientData, interp uintptr, optionName uintptr, dsPtr uintptr) int32 { /* tclUnixChan.c:817:1: */
	bp := tls.Alloc(468)
	defer tls.Free(468)

	var fsPtr uintptr = instanceData
	var len uint32
	// var buf [88]int8 at bp+88, 88

	var valid int32 = 0 // Flag if valid option parsed.

	if optionName == uintptr(0) {
		len = uint32(0)
	} else {
		len = uint32(libc.Xstrlen(tls, optionName))
	}
	if len == uint32(0) {
		XTcl_DStringAppendElement(tls, dsPtr, ts+66455)
	}
	if len == uint32(0) || len > uint32(2) && libc.Xstrncmp(tls, optionName, ts+66455, uint64(len)) == 0 {
		// var tty TtyAttrs at bp+72, 16

		valid = 1
		sTtyGetAttributes(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, bp+72)
		libc.Xsprintf(tls, bp+88, ts+66905, libc.VaList(bp, (*TtyAttrs)(unsafe.Pointer(bp+72 /* &tty */)).Fbaud, (*TtyAttrs)(unsafe.Pointer(bp+72 /* &tty */)).Fparity, (*TtyAttrs)(unsafe.Pointer(bp+72 /* &tty */)).Fdata, (*TtyAttrs)(unsafe.Pointer(bp+72 /* &tty */)).Fstop))
		XTcl_DStringAppendElement(tls, dsPtr, bp+88)
	}

	// Get option -xchar

	if len == uint32(0) {
		XTcl_DStringAppendElement(tls, dsPtr, ts+66643)
		XTcl_DStringStartSublist(tls, dsPtr)
	}
	if len == uint32(0) || len > uint32(1) && libc.Xstrncmp(tls, optionName, ts+66643, uint64(len)) == 0 {
		// var iostate Termios at bp+176, 60

		// var ds Tcl_DString at bp+240, 216

		valid = 1
		libc.Xtcgetattr(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, bp+176)
		XTcl_DStringInit(tls, bp+240)

		XTcl_ExternalToUtfDString(tls, uintptr(0), bp+176+17+8, 1, bp+240)
		XTcl_DStringAppendElement(tls, dsPtr, (*Tcl_DString)(unsafe.Pointer(bp+240)).Fstring)
		XTcl_DStringSetLength(tls, bp+240, 0)

		XTcl_ExternalToUtfDString(tls, uintptr(0), bp+176+17+9, 1, bp+240)
		XTcl_DStringAppendElement(tls, dsPtr, (*Tcl_DString)(unsafe.Pointer(bp+240)).Fstring)
		XTcl_DStringFree(tls, bp+240)
	}
	if len == uint32(0) {
		XTcl_DStringEndSublist(tls, dsPtr)
	}

	// Get option -queue
	// Option is readonly and returned by [fconfigure chan -queue] but not
	// returned by unnamed [fconfigure chan].

	if len > uint32(1) && libc.Xstrncmp(tls, optionName, ts+66917, uint64(len)) == 0 {
		*(*int32)(unsafe.Pointer(bp + 456 /* inQueue */)) = 0
		*(*int32)(unsafe.Pointer(bp + 460 /* outQueue */)) = 0
		var inBuffered int32
		var outBuffered int32

		valid = 1
		libc.Xioctl(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, uint64(FIONREAD), libc.VaList(bp+32, bp+456))
		libc.Xioctl(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, uint64(TIOCOUTQ), libc.VaList(bp+40, bp+460))
		inBuffered = XTcl_InputBuffered(tls, (*FileState)(unsafe.Pointer(fsPtr)).Fchannel)
		outBuffered = XTcl_OutputBuffered(tls, (*FileState)(unsafe.Pointer(fsPtr)).Fchannel)

		libc.Xsprintf(tls, bp+88, ts+324, libc.VaList(bp+48, inBuffered+*(*int32)(unsafe.Pointer(bp + 456))))
		XTcl_DStringAppendElement(tls, dsPtr, bp+88)
		libc.Xsprintf(tls, bp+88, ts+324, libc.VaList(bp+56, outBuffered+*(*int32)(unsafe.Pointer(bp + 460))))
		XTcl_DStringAppendElement(tls, dsPtr, bp+88)
	}

	// Get option -ttystatus
	// Option is readonly and returned by [fconfigure chan -ttystatus] but not
	// returned by unnamed [fconfigure chan].
	if len > uint32(4) && libc.Xstrncmp(tls, optionName, ts+66924, uint64(len)) == 0 {
		// var status int32 at bp+464, 4

		valid = 1
		libc.Xioctl(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, uint64(TIOCMGET), libc.VaList(bp+64, bp+464))
		sTtyModemStatusStr(tls, *(*int32)(unsafe.Pointer(bp + 464 /* status */)), dsPtr)
	}

	if valid != 0 {
		return TCL_OK
	}
	return XTcl_BadChannelOption(tls, interp, optionName,
		ts+66935)
}

var speeds = [34]struct {
	Fbaud  int32
	Fspeed Speed_t
}{
	{},
	{Fbaud: 50, Fspeed: Speed_t(B50)},
	{Fbaud: 75, Fspeed: Speed_t(B75)},
	{Fbaud: 110, Fspeed: Speed_t(B110)},
	{Fbaud: 134, Fspeed: Speed_t(B134)},
	{Fbaud: 150, Fspeed: Speed_t(B150)},
	{Fbaud: 200, Fspeed: Speed_t(B200)},
	{Fbaud: 300, Fspeed: Speed_t(B300)},
	{Fbaud: 600, Fspeed: Speed_t(B600)},
	{Fbaud: 1200, Fspeed: Speed_t(B1200)},
	{Fbaud: 1800, Fspeed: Speed_t(B1800)},
	{Fbaud: 2400, Fspeed: Speed_t(B2400)},
	{Fbaud: 4800, Fspeed: Speed_t(B4800)},
	{Fbaud: 9600, Fspeed: Speed_t(B9600)},
	{Fbaud: 19200, Fspeed: Speed_t(B19200)},
	{Fbaud: 19200, Fspeed: Speed_t(B19200)},
	{Fbaud: 38400, Fspeed: Speed_t(B38400)},
	{Fbaud: 38400, Fspeed: Speed_t(B38400)},
	{Fbaud: 57600, Fspeed: Speed_t(B57600)},
	{Fbaud: 115200, Fspeed: Speed_t(B115200)},
	{Fbaud: 230400, Fspeed: Speed_t(B230400)},
	{Fbaud: 460800, Fspeed: Speed_t(B460800)},
	{Fbaud: 500000, Fspeed: Speed_t(B500000)},
	{Fbaud: 576000, Fspeed: Speed_t(B576000)},
	{Fbaud: 921600, Fspeed: Speed_t(B921600)},
	{Fbaud: 1000000, Fspeed: Speed_t(B1000000)},
	{Fbaud: 1152000, Fspeed: Speed_t(B1152000)},
	{Fbaud: 1500000, Fspeed: Speed_t(B1500000)},
	{Fbaud: 2000000, Fspeed: Speed_t(B2000000)},
	{Fbaud: 2500000, Fspeed: Speed_t(B2500000)},
	{Fbaud: 3000000, Fspeed: Speed_t(B3000000)},
	{Fbaud: 3500000, Fspeed: Speed_t(B3500000)},
	{Fbaud: 4000000, Fspeed: Speed_t(B4000000)},
	{Fbaud: -1},
} /* tclUnixChan.c:918:48 */

//---------------------------------------------------------------------------
//
// TtyGetSpeed --
//
//	Given an integer baud rate, get the speed_t value that should be
//	used to select that baud rate.
//
// Results:
//	As above.
//
//---------------------------------------------------------------------------

func sTtyGetSpeed(tls *libc.TLS, baud int32) Speed_t { /* tclUnixChan.c:1057:1: */
	var bestIdx int32
	var bestDiff int32
	var i int32
	var diff int32

	bestIdx = 0
	bestDiff = 1000000

	// If the baud rate does not correspond to one of the known mask values,
	// choose the mask value whose baud rate is closest to the specified baud
	// rate.

	for i = 0; speeds[i].Fbaud >= 0; i++ {
		diff = speeds[i].Fbaud - baud
		if diff < 0 {
			diff = -diff
		}
		if diff < bestDiff {
			bestIdx = i
			bestDiff = diff
		}
	}
	return speeds[bestIdx].Fspeed
}

//---------------------------------------------------------------------------
//
// TtyGetBaud --
//
//	Return the integer baud rate corresponding to a given speed_t value.
//
// Results:
//	As above. If the mask value was not recognized, 0 is returned.
//
//---------------------------------------------------------------------------

func sTtyGetBaud(tls *libc.TLS, speed Speed_t) int32 { /* tclUnixChan.c:1098:1: */
	var i int32

	for i = 0; speeds[i].Fbaud >= 0; i++ {
		if speeds[i].Fspeed == speed {
			return speeds[i].Fbaud
		}
	}
	return 0
}

//---------------------------------------------------------------------------
//
// TtyGetAttributes --
//
//	Get the current attributes of the specified serial device.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sTtyGetAttributes(tls *libc.TLS, fd int32, ttyPtr uintptr) { /* tclUnixChan.c:1128:1: */
	bp := tls.Alloc(60)
	defer tls.Free(60)

	// var iostate Termios at bp, 60

	var baud int32
	var parity int32
	var data int32
	var stop int32

	libc.Xtcgetattr(tls, fd, bp)

	baud = sTtyGetBaud(tls, libc.Xcfgetospeed(tls, bp))

	parity = 'n'
	switch int32((*Termios)(unsafe.Pointer(bp)).Fc_cflag & Tcflag_t(PARENB|PARODD|CMSPAR)) {
	case PARENB:
		parity = 'e'
		break
	case PARENB | PARODD:
		parity = 'o'
		break
	case PARENB | CMSPAR:
		parity = 's'
		break
	case PARENB | PARODD | CMSPAR:
		parity = 'm'
		break
	}

	data = int32((*Termios)(unsafe.Pointer(bp)).Fc_cflag & Tcflag_t(CSIZE))
	if data == CS5 {
		data = 5
	} else {
		if data == CS6 {
			data = 6
		} else {
			if data == CS7 {
				data = 7
			} else {
				data = 8
			}
		}
	}

	if (*Termios)(unsafe.Pointer(bp)).Fc_cflag&Tcflag_t(CSTOPB) != 0 {
		stop = 2
	} else {
		stop = 1
	}

	(*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fbaud = baud
	(*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fparity = parity
	(*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fdata = data
	(*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fstop = stop
}

//---------------------------------------------------------------------------
//
// TtySetAttributes --
//
//	Set the current attributes of the specified serial device.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sTtySetAttributes(tls *libc.TLS, fd int32, ttyPtr uintptr) { /* tclUnixChan.c:1184:1: */
	bp := tls.Alloc(60)
	defer tls.Free(60)

	// var iostate Termios at bp, 60

	var parity int32
	var data int32
	var flag int32

	libc.Xtcgetattr(tls, fd, bp)
	libc.Xcfsetospeed(tls, bp, sTtyGetSpeed(tls, (*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fbaud))
	libc.Xcfsetispeed(tls, bp, sTtyGetSpeed(tls, (*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fbaud))

	flag = 0
	parity = (*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fparity
	if parity != 'n' {
		flag = flag | PARENB
		*(*Tcflag_t)(unsafe.Pointer(bp + 8)) &= libc.Uint32FromInt32(libc.CplInt32(CMSPAR))
		if parity == 'm' || parity == 's' {
			flag = flag | CMSPAR
		}
		if parity == 'm' || parity == 'o' {
			flag = flag | PARODD
		}
	}
	data = (*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fdata
	flag = flag | func() int32 {
		if data == 5 {
			return CS5
		}
		return func() int32 {
			if data == 6 {
				return CS6
			}
			return func() int32 {
				if data == 7 {
					return CS7
				}
				return CS8
			}()
		}()
	}()
	if (*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fstop == 2 {
		flag = flag | CSTOPB
	}

	*(*Tcflag_t)(unsafe.Pointer(bp + 8)) &= libc.Uint32FromInt32(libc.CplInt32(PARENB | PARODD | CSIZE | CSTOPB))
	*(*Tcflag_t)(unsafe.Pointer(bp + 8)) |= Tcflag_t(flag)

	libc.Xtcsetattr(tls, fd, TCSADRAIN, bp)
}

//---------------------------------------------------------------------------
//
// TtyParseMode --
//
//	Parse the "-mode" argument to the fconfigure command. The argument is
//	of the form baud,parity,data,stop.
//
// Results:
//	The return value is TCL_OK if the argument was successfully parsed,
//	TCL_ERROR otherwise. If TCL_ERROR is returned, an error message is
//	left in the interp's result (if interp is non-NULL).
//
//---------------------------------------------------------------------------

func sTtyParseMode(tls *libc.TLS, interp uintptr, mode uintptr, ttyPtr uintptr) int32 { /* tclUnixChan.c:1243:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var i int32
	// var end int32 at bp+212, 4

	// var parity int8 at bp+208, 1

	var bad uintptr = ts + 66962 /* "bad value for -m..." */

	i = libc.Xsscanf(tls, mode, ts+66982,
		libc.VaList(bp, ttyPtr,
			bp+208,
			ttyPtr+8,
			ttyPtr+12, bp+212))
	if i != 4 || int32(*(*int8)(unsafe.Pointer(mode + uintptr(*(*int32)(unsafe.Pointer(bp + 212)))))) != 0 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+66996, libc.VaList(bp+40, bad)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+6915, ts+67032, uintptr(0)))
		}
		return TCL_ERROR
	}

	// Only allow setting mark/space parity on platforms that support it Make
	// sure to allow for the case where strchr is a macro. [Bug: 5089]
	//
	// We cannot if/else/endif the strchr arguments, it has to be the whole
	// function. On AIX this function is apparently a macro, and macros do
	// not allow pre-processor directives in their arguments.

	if libc.Xstrchr(tls, ts+67043, int32(*(*int8)(unsafe.Pointer(bp + 208)))) ==
		uintptr(0) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+67049, libc.VaList(bp+80, bad,
					ts+67073)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+6915, ts+67032, uintptr(0)))
		}
		return TCL_ERROR
	}
	(*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fparity = int32(*(*int8)(unsafe.Pointer(bp + 208 /* parity */)))
	if (*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fdata < 5 || (*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fdata > 8 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+67090, libc.VaList(bp+128, bad)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+136, ts+3593, ts+6915, ts+67032, uintptr(0)))
		}
		return TCL_ERROR
	}
	if (*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fstop < 0 || (*TtyAttrs)(unsafe.Pointer(ttyPtr)).Fstop > 2 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+67123, libc.VaList(bp+168, bad)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, ts+3593, ts+6915, ts+67032, uintptr(0)))
		}
		return TCL_ERROR
	}
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// TtyInit --
//
//	Given file descriptor that refers to a serial port, initialize the
//	serial port to a set of sane values so that Tcl can talk to a device
//	located on the serial port.
//
// Side effects:
//	Serial device initialized to non-blocking raw mode, similar to sockets
//	All other modes can be simulated on top of this in Tcl.
//
//---------------------------------------------------------------------------

func sTtyInit(tls *libc.TLS, fd int32) { /* tclUnixChan.c:1332:1: */
	bp := tls.Alloc(60)
	defer tls.Free(60)

	// var iostate Termios at bp, 60

	libc.Xtcgetattr(tls, fd, bp)

	if (*Termios)(unsafe.Pointer(bp)).Fc_iflag != Tcflag_t(IGNBRK) ||
		(*Termios)(unsafe.Pointer(bp)).Fc_oflag != Tcflag_t(0) ||
		(*Termios)(unsafe.Pointer(bp)).Fc_lflag != Tcflag_t(0) ||
		(*Termios)(unsafe.Pointer(bp)).Fc_cflag&Tcflag_t(CREAD) != 0 ||
		int32(*(*Cc_t)(unsafe.Pointer(bp + 17 + 6))) != 1 ||
		int32(*(*Cc_t)(unsafe.Pointer(bp + 17 + 5))) != 0 {
		(*Termios)(unsafe.Pointer(bp /* &iostate */)).Fc_iflag = Tcflag_t(IGNBRK)
		(*Termios)(unsafe.Pointer(bp /* &iostate */)).Fc_oflag = Tcflag_t(0)
		(*Termios)(unsafe.Pointer(bp /* &iostate */)).Fc_lflag = Tcflag_t(0)
		*(*Tcflag_t)(unsafe.Pointer(bp + 8)) |= Tcflag_t(CREAD)
		*(*Cc_t)(unsafe.Pointer(bp + 17 + 6)) = Cc_t(1)
		*(*Cc_t)(unsafe.Pointer(bp + 17 + 5)) = Cc_t(0)

		libc.Xtcsetattr(tls, fd, TCSADRAIN, bp)
	}
}

//----------------------------------------------------------------------
//
// TclpOpenFileChannel --
//
//	Open an file based channel on Unix systems.
//
// Results:
//	The new channel or NULL. If NULL, the output argument errorCodePtr is
//	set to a POSIX error and an error message is left in the interp's
//	result if interp is not NULL.
//
// Side effects:
//	May open the channel and may cause creation of a file on the file
//	system.
//
//----------------------------------------------------------------------

func XTclpOpenFileChannel(tls *libc.TLS, interp uintptr, pathPtr uintptr, mode int32, permissions int32) Tcl_Channel { /* tclUnixChan.c:1377:1: */
	bp := tls.Alloc(112)
	defer tls.Free(112)

	var fd int32
	var channelPermissions int32
	var fsPtr uintptr
	var native uintptr
	var translation uintptr
	// var channelName [40]int8 at bp+72, 40

	var channelTypePtr uintptr

	switch mode & (O_RDONLY | O_WRONLY | O_RDWR) {
	case O_RDONLY:
		channelPermissions = int32(1) << 1
		break
	case O_WRONLY:
		channelPermissions = int32(1) << 2
		break
	case O_RDWR:
		channelPermissions = int32(1)<<1 | int32(1)<<2
		break
	default:
		// This may occurr if modeString was "", for example.

		XTcl_Panic(tls, ts+67149, 0)
		return uintptr(0)
	}

	native = XTcl_FSGetNativePath(tls, pathPtr)
	if native == uintptr(0) {
		if interp != uintptr(0) {
			XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+67189,
				func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
					}
					return XTcl_GetString(tls, pathPtr)
				}(), ts+67205,
				uintptr(0)))
		}
		return uintptr(0)
	}

	fd = libc.Xopen(tls, native, mode, libc.VaList(bp+32, permissions))

	if fd < 0 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+38136,
				libc.VaList(bp+40, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes
					}
					return XTcl_GetString(tls, pathPtr)
				}(), XTcl_PosixError(tls, interp))))
		}
		return uintptr(0)
	}

	// Set close-on-exec flag on the fd so that child processes will not
	// inherit this fd.

	libc.Xfcntl(tls, fd, F_SETFD, libc.VaList(bp+56, FD_CLOEXEC))

	libc.Xsprintf(tls, bp+72, ts+67245, libc.VaList(bp+64, fd))

	if libc.Xstrcmp(tls, native, ts+67252) != 0 && libc.Xisatty(tls, fd) != 0 {
		// Initialize the serial port to a set of sane parameters. Especially
		// important if the remote device is set to echo and the serial port
		// driver was also set to echo -- as soon as a char were sent to the
		// serial port, the remote device would echo it, then the serial
		// driver would echo it back to the device, etc.
		//
		// Note that we do not do this if we're dealing with /dev/tty itself,
		// as that tends to cause Bad Things To Happen when you're working
		// interactively. Strictly a better check would be to see if the FD
		// being set up is a device and has the same major/minor as the
		// initial std FDs (beware reopening!) but that's nearly as messy.

		translation = ts + 67261 /* "auto crlf" */
		channelTypePtr = uintptr(unsafe.Pointer(&ttyChannelType))
		sTtyInit(tls, fd)
	} else {
		translation = uintptr(0)
		channelTypePtr = uintptr(unsafe.Pointer(&fileChannelType))
	}

	fsPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FileState{})))
	(*FileState)(unsafe.Pointer(fsPtr)).FvalidMask = channelPermissions | int32(1)<<3
	(*FileState)(unsafe.Pointer(fsPtr)).Ffd = fd

	(*FileState)(unsafe.Pointer(fsPtr)).Fchannel = XTcl_CreateChannel(tls, channelTypePtr, bp+72,
		fsPtr, channelPermissions)

	if translation != uintptr(0) {
		// Gotcha. Most modems need a "\r" at the end of the command sequence.
		// If you just send "at\n", the modem will not respond with "OK"
		// because it never got a "\r" to actually invoke the command. So, by
		// default, newlines are translated to "\r\n" on output to avoid "bug"
		// reports that the serial port isn't working.

		if XTcl_SetChannelOption(tls, interp, (*FileState)(unsafe.Pointer(fsPtr)).Fchannel, ts+33606,
			translation) != TCL_OK {
			XTcl_Close(tls, uintptr(0), (*FileState)(unsafe.Pointer(fsPtr)).Fchannel)
			return uintptr(0)
		}
	}

	return (*FileState)(unsafe.Pointer(fsPtr)).Fchannel
}

//----------------------------------------------------------------------
//
// Tcl_MakeFileChannel --
//
//	Makes a Tcl_Channel from an existing OS level file handle.
//
// Results:
//	The Tcl_Channel created around the preexisting OS level file handle.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_MakeFileChannel(tls *libc.TLS, handle ClientData, mode int32) Tcl_Channel { /* tclUnixChan.c:1513:1: */
	bp := tls.Alloc(76)
	defer tls.Free(76)

	var fsPtr uintptr
	// var channelName [40]int8 at bp+16, 40

	var fd int32 = int32(handle)
	var channelTypePtr uintptr
	// var sockaddr Sockaddr at bp+56, 16

	*(*Socklen_t)(unsafe.Pointer(bp + 72 /* sockaddrLen */)) = Socklen_t(unsafe.Sizeof(Sockaddr{}))

	if mode == 0 {
		return uintptr(0)
	}

	(*Sockaddr)(unsafe.Pointer(bp + 56 /* &sockaddr */)).Fsa_family = Sa_family_t(PF_UNSPEC)

	if libc.Xisatty(tls, fd) != 0 {
		channelTypePtr = uintptr(unsafe.Pointer(&ttyChannelType))
		libc.Xsprintf(tls, bp+16, ts+67271, libc.VaList(bp, fd))
	} else if libc.Xgetsockname(tls, fd, bp+56, bp+72) == 0 &&
		*(*Socklen_t)(unsafe.Pointer(bp + 72)) > Socklen_t(0) &&
		(int32((*Sockaddr)(unsafe.Pointer(bp+56)).Fsa_family) == PF_INET || int32((*Sockaddr)(unsafe.Pointer(bp+56)).Fsa_family) == PF_INET6) {
		return XTclpMakeTcpClientChannelMode(tls, uintptr(Intptr_t(fd)), mode)
	} else {
		channelTypePtr = uintptr(unsafe.Pointer(&fileChannelType))
		libc.Xsprintf(tls, bp+16, ts+67245, libc.VaList(bp+8, fd))
	}

	fsPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FileState{})))
	(*FileState)(unsafe.Pointer(fsPtr)).Ffd = fd
	(*FileState)(unsafe.Pointer(fsPtr)).FvalidMask = mode | int32(1)<<3
	(*FileState)(unsafe.Pointer(fsPtr)).Fchannel = XTcl_CreateChannel(tls, channelTypePtr, bp+16,
		fsPtr, mode)

	return (*FileState)(unsafe.Pointer(fsPtr)).Fchannel
}

//----------------------------------------------------------------------
//
// TclpGetDefaultStdChannel --
//
//	Creates channels for standard input, standard output or standard error
//	output if they do not already exist.
//
// Results:
//	Returns the specified default standard channel, or NULL.
//
// Side effects:
//	May cause the creation of a standard channel and the underlying file.
//
//----------------------------------------------------------------------

func XTclpGetDefaultStdChannel(tls *libc.TLS, type1 int32) Tcl_Channel { /* tclUnixChan.c:1573:1: */
	var channel Tcl_Channel = uintptr(0)
	var fd int32 = 0   // Initializations needed to prevent
	var mode int32 = 0 // compiler warning (used before set).
	var bufMode uintptr = uintptr(0)

	// Some #def's to make the code a little clearer!

	switch type1 {
	case int32(1) << 1:
		if libc.Xlseek(tls, 0, int64(0), SEEK_CUR) == int64(-1) &&
			*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EBADF {
			return uintptr(0)
		}
		fd = 0
		mode = int32(1) << 1
		bufMode = ts + 13722 /* "line" */
		break
	case int32(1) << 2:
		if libc.Xlseek(tls, 1, int64(0), SEEK_CUR) == int64(-1) &&
			*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EBADF {
			return uintptr(0)
		}
		fd = 1
		mode = int32(1) << 2
		bufMode = ts + 13722 /* "line" */
		break
	case int32(1) << 3:
		if libc.Xlseek(tls, 2, int64(0), SEEK_CUR) == int64(-1) &&
			*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EBADF {
			return uintptr(0)
		}
		fd = 2
		mode = int32(1) << 2
		bufMode = ts + 33575 /* "none" */
		break
	default:
		XTcl_Panic(tls, ts+67280, 0)
		break
	}

	channel = XTcl_MakeFileChannel(tls, uintptr(Intptr_t(fd)), mode)
	if channel == uintptr(0) {
		return uintptr(0)
	}

	// Set up the normal channel options for stdio handles.

	if XTcl_GetChannelType(tls, channel) == uintptr(unsafe.Pointer(&fileChannelType)) {
		XTcl_SetChannelOption(tls, uintptr(0), channel, ts+33606, ts+33619)
	} else {
		XTcl_SetChannelOption(tls, uintptr(0), channel, ts+33606, ts+67261)
	}
	XTcl_SetChannelOption(tls, uintptr(0), channel, ts+33564, bufMode)
	return channel
}

//----------------------------------------------------------------------
//
// Tcl_GetOpenFile --
//
//	Given a name of a channel registered in the given interpreter, returns
//	a FILE * for it.
//
// Results:
//	A standard Tcl result. If the channel is registered in the given
//	interpreter and it is managed by the "file" channel driver, and it is
//	open for the requested mode, then the output parameter filePtr is set
//	to a FILE * for the underlying file. On error, the filePtr is not set,
//	TCL_ERROR is returned and an error message is left in the interp's
//	result.
//
// Side effects:
//	May invoke fdopen to create the FILE * for the requested file.
//
//----------------------------------------------------------------------

func XTcl_GetOpenFile(tls *libc.TLS, interp uintptr, chanID uintptr, forWriting int32, checkUsage int32, filePtr uintptr) int32 { /* tclUnixChan.c:1665:1: */
	bp := tls.Alloc(208)
	defer tls.Free(208)

	var chan1 Tcl_Channel
	// var chanMode int32 at bp+192, 4

	var fd int32
	var chanTypePtr uintptr
	// var data ClientData at bp+200, 8

	var f uintptr

	chan1 = XTcl_GetChannel(tls, interp, chanID, bp+192)
	if chan1 == uintptr(0) {
		return TCL_ERROR
	}
	if forWriting != 0 && !(*(*int32)(unsafe.Pointer(bp + 192))&(int32(1)<<2) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+67329, libc.VaList(bp, chanID)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+6915, ts+32157, ts+67360,
			uintptr(0)))
		return TCL_ERROR
	} else if !(forWriting != 0) && !(*(*int32)(unsafe.Pointer(bp + 192))&(int32(1)<<1) != 0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+67373, libc.VaList(bp+48, chanID)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, ts+3593, ts+6915, ts+32157, ts+67404,
			uintptr(0)))
		return TCL_ERROR
	}

	// We allow creating a FILE * out of file based, pipe based and socket
	// based channels. We currently do not allow any other channel types,
	// because it is likely that stdio will not know what to do with them.

	chanTypePtr = XTcl_GetChannelType(tls, chan1)
	if chanTypePtr == uintptr(unsafe.Pointer(&fileChannelType)) ||
		chanTypePtr == uintptr(unsafe.Pointer(&ttyChannelType)) ||
		libc.Xstrcmp(tls, (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FtypeName, ts+34036) == 0 ||
		libc.Xstrcmp(tls, (*Tcl_ChannelType)(unsafe.Pointer(chanTypePtr)).FtypeName, ts+35642) == 0 {
		if XTcl_GetChannelHandle(tls, chan1,
			func() int32 {
				if forWriting != 0 {
					return int32(1) << 2
				}
				return int32(1) << 1
			}(), bp+200) == TCL_OK {
			fd = int32(*(*ClientData)(unsafe.Pointer(bp + 200)))

			// The call to fdopen below is probably dangerous, since it will
			// truncate an existing file if the file is being opened for
			// writing....

			f = libc.Xfdopen(tls, fd, func() uintptr {
				if forWriting != 0 {
					return ts + 22792 /* "w" */
				}
				return ts + 22782 /* "r" */
			}())
			if f == uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+67417, libc.VaList(bp+96, chanID)))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+104, ts+3593, ts+6915, ts+32157,
					ts+67446, uintptr(0)))
				return TCL_ERROR
			}
			*(*ClientData)(unsafe.Pointer(filePtr)) = f
			return TCL_OK
		}
	}

	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+67459, libc.VaList(bp+144, chanID)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+152, ts+3593, ts+6915, ts+32157, ts+67495,
		uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclUnixWaitForFile --
//
//	This function waits synchronously for a file to become readable or
//	writable, with an optional timeout.
//
// Results:
//	The return value is an OR'ed combination of TCL_READABLE,
//	TCL_WRITABLE, and TCL_EXCEPTION, indicating the conditions that are
//	present on file at the time of the return. This function will not
//	return until either "timeout" milliseconds have elapsed or at least
//	one of the conditions given by mask has occurred for file (a return
//	value of 0 means that a timeout occurred). No normal events will be
//	serviced during the execution of this function.
//
// Side effects:
//	Time passes.
//
//----------------------------------------------------------------------

func XTclUnixWaitForFile(tls *libc.TLS, fd int32, mask int32, timeout int32) int32 { /* tclUnixChan.c:1770:1: */
	bp := tls.Alloc(440)
	defer tls.Free(440)

	*(*Tcl_Time)(unsafe.Pointer(bp + 24 /* abortTime */)) = Tcl_Time{}
	// var now Tcl_Time at bp+8, 16
	// silence gcc 4 warning
	// var blockTime Timeval at bp+40, 16

	var timeoutPtr uintptr
	var numFound int32
	var result int32 = 0
	// var readableMask Fd_set at bp+56, 128

	// var writableMask Fd_set at bp+184, 128

	// var exceptionMask Fd_set at bp+312, 128

	// Sanity check fd.

	if fd >= 1024 {
		XTcl_Panic(tls, ts+67509, libc.VaList(bp, fd))
		// must never get here, or select masks overrun will occur below
	}

	// If there is a non-zero finite timeout, compute the time when we give
	// up.

	if timeout > 0 {
		XTcl_GetTime(tls, bp+8)
		(*Tcl_Time)(unsafe.Pointer(bp + 24 /* &abortTime */)).Fsec = (*Tcl_Time)(unsafe.Pointer(bp+8)).Fsec + int64(timeout/1000)
		(*Tcl_Time)(unsafe.Pointer(bp + 24 /* &abortTime */)).Fusec = (*Tcl_Time)(unsafe.Pointer(bp+8)).Fusec + int64(timeout%1000*1000)
		if (*Tcl_Time)(unsafe.Pointer(bp+24)).Fusec >= int64(1000000) {
			*(*int64)(unsafe.Pointer(bp + 24 + 8)) -= int64(1000000)
			*(*int64)(unsafe.Pointer(bp + 24)) += int64(1)
		}
		timeoutPtr = bp + 40 /* &blockTime */
	} else if timeout == 0 {
		timeoutPtr = bp + 40 /* &blockTime */
		(*Timeval)(unsafe.Pointer(bp + 40 /* &blockTime */)).Ftv_sec = int64(0)
		(*Timeval)(unsafe.Pointer(bp + 40 /* &blockTime */)).Ftv_usec = int64(0)
	} else {
		timeoutPtr = uintptr(0)
	}

	// Initialize the select masks.

	libc.X__builtin_memset(tls, bp+56, 0, uint64(unsafe.Sizeof(Fd_set{})))
	libc.X__builtin_memset(tls, bp+184, 0, uint64(unsafe.Sizeof(Fd_set{})))
	libc.X__builtin_memset(tls, bp+312, 0, uint64(unsafe.Sizeof(Fd_set{})))

	// Loop in a mini-event loop of our own, waiting for either the file to
	// become ready or a timeout to occur.

	for 1 != 0 {
		if timeout > 0 {
			(*Timeval)(unsafe.Pointer(bp + 40 /* &blockTime */)).Ftv_sec = (*Tcl_Time)(unsafe.Pointer(bp+24)).Fsec - (*Tcl_Time)(unsafe.Pointer(bp+8)).Fsec
			(*Timeval)(unsafe.Pointer(bp + 40 /* &blockTime */)).Ftv_usec = (*Tcl_Time)(unsafe.Pointer(bp+24)).Fusec - (*Tcl_Time)(unsafe.Pointer(bp+8)).Fusec
			if (*Timeval)(unsafe.Pointer(bp+40)).Ftv_usec < int64(0) {
				*(*X__time_t)(unsafe.Pointer(bp + 40)) -= int64(1)
				*(*X__suseconds_t)(unsafe.Pointer(bp + 40 + 8)) += int64(1000000)
			}
			if (*Timeval)(unsafe.Pointer(bp+40)).Ftv_sec < int64(0) {
				(*Timeval)(unsafe.Pointer(bp + 40 /* &blockTime */)).Ftv_sec = int64(0)
				(*Timeval)(unsafe.Pointer(bp + 40 /* &blockTime */)).Ftv_usec = int64(0)
			}
		}

		// Setup the select masks for the fd.

		if mask&(int32(1)<<1) != 0 {
			*(*X__fd_mask)(unsafe.Pointer(bp + 56 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		}
		if mask&(int32(1)<<2) != 0 {
			*(*X__fd_mask)(unsafe.Pointer(bp + 184 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		}
		if mask&(int32(1)<<3) != 0 {
			*(*X__fd_mask)(unsafe.Pointer(bp + 312 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		}

		// Wait for the event or a timeout.

		numFound = libc.Xselect(tls, fd+1, bp+56, bp+184,
			bp+312, timeoutPtr)
		if numFound == 1 {
			if *(*X__fd_mask)(unsafe.Pointer(bp + 56 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(fd%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
				result = result | int32(1)<<1
			}
			if *(*X__fd_mask)(unsafe.Pointer(bp + 184 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(fd%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
				result = result | int32(1)<<2
			}
			if *(*X__fd_mask)(unsafe.Pointer(bp + 312 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(fd%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
				result = result | int32(1)<<3
			}
			result = result & mask
			if result != 0 {
				break
			}
		}
		if timeout == 0 {
			break
		}
		if timeout < 0 {
			continue
		}

		// The select returned early, so we need to recompute the timeout.

		XTcl_GetTime(tls, bp+8)
		if (*Tcl_Time)(unsafe.Pointer(bp+24)).Fsec < (*Tcl_Time)(unsafe.Pointer(bp+8)).Fsec ||
			(*Tcl_Time)(unsafe.Pointer(bp+24)).Fsec == (*Tcl_Time)(unsafe.Pointer(bp+8)).Fsec && (*Tcl_Time)(unsafe.Pointer(bp+24)).Fusec <= (*Tcl_Time)(unsafe.Pointer(bp+8)).Fusec {
			break
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// FileTruncateProc --
//
//	Truncates a file to a given length.
//
// Results:
//	0 if the operation succeeded, and -1 if it failed (in which case
//	*errorCodePtr will be set to errno).
//
// Side effects:
//	The underlying file is potentially truncated. This can have a wide
//	variety of side effects, including moving file pointers that point at
//	places later in the file than the truncate point.
//
//----------------------------------------------------------------------

func sFileTruncateProc(tls *libc.TLS, instanceData ClientData, length Tcl_WideInt) int32 { /* tclUnixChan.c:1924:1: */
	var fsPtr uintptr = instanceData
	var result int32

	result = libc.Xftruncate(tls, (*FileState)(unsafe.Pointer(fsPtr)).Ffd, length)
	if result != 0 {
		return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	}
	return 0
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 9.2.2 User Database Access	<pwd.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 9.2.1 Group Database Access	<grp.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.5 Errors	<errno.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.21 String handling	<string.h>

// See also: SC_BLOCKING_STYLE in unix/tcl.m4

// Used to pad structures at size'd boundaries
//
// This macro assumes that the pointer 'buffer' was created from an aligned
// pointer by adding the 'length'. If this 'length' was not a multiple of the
// 'size' the result is unaligned and PadBuffer corrects both the pointer,
// _and_ the 'length'. The latter means that future increments of 'buffer' by
// 'length' stay aligned.

// Per-thread private storage used to store values returned from MT-unsafe
// library calls.

type ThreadSpecificData13 = struct {
	Fpwd         Passwd
	Fpbuf        uintptr
	Fpbuflen     int32
	F__ccgo_pad1 [4]byte
	Fgrp         Group
	Fgbuf        uintptr
	Fgbuflen     int32
	F__ccgo_pad2 [4]byte
	Fhent        Hostent
	Fhbuf        [2048]int8
}                               /* tclUnixCompat.c:75:4 */
var dataKey12 Tcl_ThreadDataKey /* tclUnixCompat.c:76:26: */

//---------------------------------------------------------------------------
//
// TclUnixSetBlockingMode --
//
//	Set the blocking mode of a file descriptor.
//
// Results:
//
//	0 on success, -1 (with errno set) on error.
//
//---------------------------------------------------------------------------

func XTclUnixSetBlockingMode(tls *libc.TLS, fd int32, mode int32) int32 { /* tclUnixCompat.c:143:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var flags int32 = libc.Xfcntl(tls, fd, F_GETFL, 0)

	if mode == TCL_MODE_BLOCKING {
		flags = flags & libc.CplInt32(O_NONBLOCK)
	} else {
		flags = flags | O_NONBLOCK
	}
	return libc.Xfcntl(tls, fd, F_SETFL, libc.VaList(bp, flags))
}

//---------------------------------------------------------------------------
//
// TclpGetPwNam --
//
//      Thread-safe wrappers for getpwnam(). See "man getpwnam" for more
//      details.
//
// Results:
//      Pointer to struct passwd on success or NULL on error.
//
// Side effects:
//      None.
//
//---------------------------------------------------------------------------

func XTclpGetPwNam(tls *libc.TLS, name uintptr) uintptr { /* tclUnixCompat.c:181:15: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey12)), int32(unsafe.Sizeof(ThreadSpecificData13{})))

	*(*uintptr)(unsafe.Pointer(bp /* pwPtr */)) = uintptr(0)

	// How to allocate a buffer of the right initial size. If you want the
	// gory detail, see http://www.opengroup.org/austin/docs/austin_328.txt
	// and weep.

	if (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuf == uintptr(0) {
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen = int32(libc.Xsysconf(tls, X_SC_GETPW_R_SIZE_MAX))
		if (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen < 1 {
			(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen = 1024
		}
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuf = XTcl_Alloc(tls, uint32((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen))
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFreePwBuf})), uintptr(0))
	}
	for 1 != 0 {
		var e int32 = libc.Xgetpwnam_r(tls, name, tsdPtr, (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuf, uint64((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen),
			bp)

		if e == 0 {
			break
		} else if e != ERANGE {
			return uintptr(0)
		}
		*(*int32)(unsafe.Pointer(tsdPtr + 56)) *= 2
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuf = XTcl_Realloc(tls, (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuf, uint32((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen))
	}
	return func() uintptr {
		if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			return tsdPtr
		}
		return uintptr(0)
	}()

	return uintptr(0) // Not reached.
}

//---------------------------------------------------------------------------
//
// TclpGetPwUid --
//
//      Thread-safe wrappers for getpwuid(). See "man getpwuid" for more
//      details.
//
// Results:
//      Pointer to struct passwd on success or NULL on error.
//
// Side effects:
//      None.
//
//---------------------------------------------------------------------------

func XTclpGetPwUid(tls *libc.TLS, uid Uid_t) uintptr { /* tclUnixCompat.c:261:15: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey12)), int32(unsafe.Sizeof(ThreadSpecificData13{})))

	*(*uintptr)(unsafe.Pointer(bp /* pwPtr */)) = uintptr(0)

	// How to allocate a buffer of the right initial size. If you want the
	// gory detail, see http://www.opengroup.org/austin/docs/austin_328.txt
	// and weep.

	if (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuf == uintptr(0) {
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen = int32(libc.Xsysconf(tls, X_SC_GETPW_R_SIZE_MAX))
		if (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen < 1 {
			(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen = 1024
		}
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuf = XTcl_Alloc(tls, uint32((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen))
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFreePwBuf})), uintptr(0))
	}
	for 1 != 0 {
		var e int32 = libc.Xgetpwuid_r(tls, uid, tsdPtr, (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuf, uint64((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen),
			bp)

		if e == 0 {
			break
		} else if e != ERANGE {
			return uintptr(0)
		}
		*(*int32)(unsafe.Pointer(tsdPtr + 56)) *= 2
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuf = XTcl_Realloc(tls, (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuf, uint32((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuflen))
	}
	return func() uintptr {
		if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			return tsdPtr
		}
		return uintptr(0)
	}()

	return uintptr(0) // Not reached.
}

//---------------------------------------------------------------------------
//
// FreePwBuf --
//
//	Helper that is used to dispose of space allocated and referenced from
//	the ThreadSpecificData for user entries. (Darn that baroque POSIX
//	reentrant interface.)
//
//---------------------------------------------------------------------------

func sFreePwBuf(tls *libc.TLS, dummy ClientData) { /* tclUnixCompat.c:338:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey12)), int32(unsafe.Sizeof(ThreadSpecificData13{})))
	_ = dummy

	XTclpFree(tls, (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fpbuf)
}

//---------------------------------------------------------------------------
//
// TclpGetGrNam --
//
//      Thread-safe wrappers for getgrnam(). See "man getgrnam" for more
//      details.
//
// Results:
//      Pointer to struct group on success or NULL on error.
//
// Side effects:
//      None.
//
//---------------------------------------------------------------------------

func XTclpGetGrNam(tls *libc.TLS, name uintptr) uintptr { /* tclUnixCompat.c:365:14: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey12)), int32(unsafe.Sizeof(ThreadSpecificData13{})))

	*(*uintptr)(unsafe.Pointer(bp /* grPtr */)) = uintptr(0)

	// How to allocate a buffer of the right initial size. If you want the
	// gory detail, see http://www.opengroup.org/austin/docs/austin_328.txt
	// and weep.

	if (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuf == uintptr(0) {
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen = int32(libc.Xsysconf(tls, X_SC_GETGR_R_SIZE_MAX))
		if (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen < 1 {
			(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen = 1024
		}
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuf = XTcl_Alloc(tls, uint32((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen))
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFreeGrBuf})), uintptr(0))
	}
	for 1 != 0 {
		var e int32 = libc.Xgetgrnam_r(tls, name, tsdPtr+64, (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuf, uint64((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen),
			bp)

		if e == 0 {
			break
		} else if e != ERANGE {
			return uintptr(0)
		}
		*(*int32)(unsafe.Pointer(tsdPtr + 104)) *= 2
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuf = XTcl_Realloc(tls, (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuf, uint32((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen))
	}
	return func() uintptr {
		if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			return tsdPtr + 64
		}
		return uintptr(0)
	}()

	return uintptr(0) // Not reached.
}

//---------------------------------------------------------------------------
//
// TclpGetGrGid --
//
//      Thread-safe wrappers for getgrgid(). See "man getgrgid" for more
//      details.
//
// Results:
//      Pointer to struct group on success or NULL on error.
//
// Side effects:
//      None.
//
//---------------------------------------------------------------------------

func XTclpGetGrGid(tls *libc.TLS, gid Gid_t) uintptr { /* tclUnixCompat.c:445:14: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey12)), int32(unsafe.Sizeof(ThreadSpecificData13{})))

	*(*uintptr)(unsafe.Pointer(bp /* grPtr */)) = uintptr(0)

	// How to allocate a buffer of the right initial size. If you want the
	// gory detail, see http://www.opengroup.org/austin/docs/austin_328.txt
	// and weep.

	if (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuf == uintptr(0) {
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen = int32(libc.Xsysconf(tls, X_SC_GETGR_R_SIZE_MAX))
		if (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen < 1 {
			(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen = 1024
		}
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuf = XTcl_Alloc(tls, uint32((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen))
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFreeGrBuf})), uintptr(0))
	}
	for 1 != 0 {
		var e int32 = libc.Xgetgrgid_r(tls, gid, tsdPtr+64, (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuf, uint64((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen),
			bp)

		if e == 0 {
			break
		} else if e != ERANGE {
			return uintptr(0)
		}
		*(*int32)(unsafe.Pointer(tsdPtr + 104)) *= 2
		(*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuf = XTcl_Realloc(tls, (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuf, uint32((*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuflen))
	}
	return func() uintptr {
		if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
			return tsdPtr + 64
		}
		return uintptr(0)
	}()

	return uintptr(0) // Not reached.
}

//---------------------------------------------------------------------------
//
// FreeGrBuf --
//
//	Helper that is used to dispose of space allocated and referenced from
//	the ThreadSpecificData for group entries. (Darn that baroque POSIX
//	reentrant interface.)
//
//---------------------------------------------------------------------------

func sFreeGrBuf(tls *libc.TLS, dummy ClientData) { /* tclUnixCompat.c:522:1: */
	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey12)), int32(unsafe.Sizeof(ThreadSpecificData13{})))
	_ = dummy

	XTclpFree(tls, (*ThreadSpecificData13)(unsafe.Pointer(tsdPtr)).Fgbuf)
}

//---------------------------------------------------------------------------
//
// TclpGetHostByName --
//
//      Thread-safe wrappers for gethostbyname(). See "man gethostbyname" for
//      more details.
//
// Results:
//      Pointer to struct hostent on success or NULL on error.
//
// Side effects:
//      None.
//
//---------------------------------------------------------------------------

func XTclpGetHostByName(tls *libc.TLS, name uintptr) uintptr { /* tclUnixCompat.c:549:16: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey12)), int32(unsafe.Sizeof(ThreadSpecificData13{})))

	*(*uintptr)(unsafe.Pointer(bp /* hePtr */)) = uintptr(0)
	// var local_errno int32 at bp+8, 4

	var result int32

	result = libc.Xgethostbyname_r(tls, name, tsdPtr+112, tsdPtr+144,
		uint64(unsafe.Sizeof([2048]int8{})), bp, bp+8)
	if result == 0 {
		return *(*uintptr)(unsafe.Pointer(bp /* hePtr */))
	}
	return uintptr(0)

	return uintptr(0) // Not reached.
}

//---------------------------------------------------------------------------
//
// TclpGetHostByAddr --
//
//      Thread-safe wrappers for gethostbyaddr(). See "man gethostbyaddr" for
//      more details.
//
// Results:
//      Pointer to struct hostent on success or NULL on error.
//
// Side effects:
//      None.
//
//---------------------------------------------------------------------------

func XTclpGetHostByAddr(tls *libc.TLS, addr uintptr, length int32, type1 int32) uintptr { /* tclUnixCompat.c:617:16: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey12)), int32(unsafe.Sizeof(ThreadSpecificData13{})))
	// var hePtr uintptr at bp, 8

	// var local_errno int32 at bp+8, 4

	if libc.Xgethostbyaddr_r(tls, addr, uint32(length), type1, tsdPtr+112, tsdPtr+144,
		uint64(unsafe.Sizeof([2048]int8{})), bp, bp+8) == 0 {
		return tsdPtr + 112
	}
	return uintptr(0)

	return uintptr(0) // Not reached.
}

//---------------------------------------------------------------------------
//
// CopyGrp --
//
//      Copies string fields of the group structure to the private buffer,
//      honouring the size of the buffer.
//
// Results:
//      0 on success or -1 on error (errno = ERANGE).
//
// Side effects:
//      None.
//
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
//
// CopyHostent --
//
//      Copies string fields of the hostnent structure to the private buffer,
//      honouring the size of the buffer.
//
// Results:
//      Number of bytes copied on success or -1 on error (errno = ERANGE)
//
// Side effects:
//      None
//
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
//
// CopyPwd --
//
//      Copies string fields of the passwd structure to the private buffer,
//      honouring the size of the buffer.
//
// Results:
//      0 on success or -1 on error (errno = ERANGE).
//
// Side effects:
//      We are not copying the gecos field as it may not be supported on all
//      platforms.
//
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
//
// CopyArray --
//
//      Copies array of NULL-terminated or fixed-length strings to the private
//      buffer, honouring the size of the buffer.
//
// Results:
//      Number of bytes copied on success or -1 on error (errno = ERANGE)
//
// Side effects:
//      None.
//
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
//
// CopyString --
//
//      Copies a NULL-terminated string to the private buffer, honouring the
//      size of the buffer
//
// Results:
//      0 success or -1 on error (errno = ERANGE)
//
// Side effects:
//      None
//
//---------------------------------------------------------------------------

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//------------------------------------------------------------------------
//
// TclWinCPUID --
//
//	Get CPU ID information on an Intel box under UNIX (either Linux or Cygwin)
//
// Results:
//	Returns TCL_OK if successful, TCL_ERROR if CPUID is not supported.
//
// Side effects:
//	If successful, stores EAX, EBX, ECX and EDX registers after the CPUID
//	instruction in the four integers designated by 'regsPtr'
//
//----------------------------------------------------------------------

func XTclWinCPUID(tls *libc.TLS, index uint32, regsPtr uintptr) int32 { /* tclUnixCompat.c:992:1: */
	var status int32 = TCL_ERROR

	// See: <http://en.wikipedia.org/wiki/CPUID>
	return status
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//----------------------------------------------------------------------
//
// Tcl_Sleep --
//
//	Delay execution for the specified number of milliseconds.
//
// Results:
//	None.
//
// Side effects:
//	Time passes.
//
//----------------------------------------------------------------------

func XTcl_Sleep(tls *libc.TLS, ms int32) { /* tclUnixEvent.c:33:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	// var delay Timeval at bp+48, 16

	// var before Tcl_Time at bp, 16

	// var after Tcl_Time at bp+16, 16

	// var vdelay Tcl_Time at bp+32, 16

	// The only trick here is that select appears to return early under some
	// conditions, so we have to check to make sure that the right amount of
	// time really has elapsed.  If it's too early, go back to sleep again.

	XTcl_GetTime(tls, bp)
	*(*Tcl_Time)(unsafe.Pointer(bp + 16 /* after */)) = *(*Tcl_Time)(unsafe.Pointer(bp /* before */))
	*(*int64)(unsafe.Pointer(bp + 16)) += int64(ms / 1000)
	*(*int64)(unsafe.Pointer(bp + 16 + 8)) += int64(ms % 1000 * 1000)
	if (*Tcl_Time)(unsafe.Pointer(bp+16)).Fusec > int64(1000000) {
		*(*int64)(unsafe.Pointer(bp + 16 + 8)) -= int64(1000000)
		*(*int64)(unsafe.Pointer(bp + 16)) += int64(1)
	}
	for 1 != 0 {
		// TIP #233: Scale from virtual time to real-time for select.

		(*Tcl_Time)(unsafe.Pointer(bp + 32 /* &vdelay */)).Fsec = (*Tcl_Time)(unsafe.Pointer(bp+16)).Fsec - (*Tcl_Time)(unsafe.Pointer(bp)).Fsec
		(*Tcl_Time)(unsafe.Pointer(bp + 32 /* &vdelay */)).Fusec = (*Tcl_Time)(unsafe.Pointer(bp+16)).Fusec - (*Tcl_Time)(unsafe.Pointer(bp)).Fusec

		if (*Tcl_Time)(unsafe.Pointer(bp+32)).Fusec < int64(0) {
			*(*int64)(unsafe.Pointer(bp + 32 + 8)) += int64(1000000)
			*(*int64)(unsafe.Pointer(bp + 32)) -= int64(1)
		}

		if (*Tcl_Time)(unsafe.Pointer(bp+32)).Fsec != int64(0) || (*Tcl_Time)(unsafe.Pointer(bp+32)).Fusec != int64(0) {
			(*struct {
				f func(*libc.TLS, uintptr, ClientData)
			})(unsafe.Pointer(&struct{ uintptr }{XtclScaleTimeProcPtr})).f(tls, bp+32 /* &vdelay */, XtclTimeClientData)
		}

		(*Timeval)(unsafe.Pointer(bp + 48 /* &delay */)).Ftv_sec = (*Tcl_Time)(unsafe.Pointer(bp + 32 /* &vdelay */)).Fsec
		(*Timeval)(unsafe.Pointer(bp + 48 /* &delay */)).Ftv_usec = (*Tcl_Time)(unsafe.Pointer(bp + 32 /* &vdelay */)).Fusec

		// Special note: must convert delay.tv_sec to int before comparing to
		// zero, since delay.tv_usec is unsigned on some platforms.

		if int32((*Timeval)(unsafe.Pointer(bp+48)).Ftv_sec) < 0 ||
			(*Timeval)(unsafe.Pointer(bp+48)).Ftv_usec == int64(0) && (*Timeval)(unsafe.Pointer(bp+48)).Ftv_sec == int64(0) {
			break
		}
		libc.Xselect(tls, 0, uintptr(0), uintptr(0),
			uintptr(0), bp+48)
		XTcl_GetTime(tls, bp)
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 5.6.6 Set File Access and Modification Times  <utime.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 9.2.1 Group Database Access	<grp.h>

// File tree traversal functions declarations.
//    Copyright (C) 1994-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (c) 1989, 1993
//	The Regents of the University of California.  All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
// 4. Neither the name of the University nor the names of its contributors
//    may be used to endorse or promote products derived from this software
//    without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
//	@(#)fts.h	8.3 (Berkeley) 8/14/94

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 2.6 Primitive System Data Types	<sys/types.h>

type X_ftsent = struct {
	Ffts_cycle   uintptr
	Ffts_parent  uintptr
	Ffts_link    uintptr
	Ffts_number  int64
	Ffts_pointer uintptr
	Ffts_accpath uintptr
	Ffts_path    uintptr
	Ffts_errno   int32
	Ffts_symfd   int32
	Ffts_pathlen uint16
	Ffts_namelen uint16
	F__ccgo_pad1 [4]byte
	Ffts_ino     Ino_t
	Ffts_dev     Dev_t
	Ffts_nlink   Nlink_t
	Ffts_level   int16
	Ffts_info    uint16
	Ffts_flags   uint16
	Ffts_instr   uint16
	Ffts_statp   uintptr
	Ffts_name    [1]int8
	F__ccgo_pad2 [7]byte
} /* fts.h:58:2 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 5.6.6 Set File Access and Modification Times  <utime.h>

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 9.2.1 Group Database Access	<grp.h>

// File tree traversal functions declarations.
//    Copyright (C) 1994-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (c) 1989, 1993
//	The Regents of the University of California.  All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
// 4. Neither the name of the University nor the names of its contributors
//    may be used to endorse or promote products derived from this software
//    without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
//	@(#)fts.h	8.3 (Berkeley) 8/14/94

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 2.6 Primitive System Data Types	<sys/types.h>

type FTS = struct {
	Ffts_cur     uintptr
	Ffts_child   uintptr
	Ffts_array   uintptr
	Ffts_dev     Dev_t
	Ffts_path    uintptr
	Ffts_rfd     int32
	Ffts_pathlen int32
	Ffts_nitems  int32
	F__ccgo_pad1 [4]byte
	Ffts_compar  uintptr
	Ffts_options int32
	F__ccgo_pad2 [4]byte
} /* fts.h:81:3 */

type X_ftsent64 = struct {
	Ffts_cycle   uintptr
	Ffts_parent  uintptr
	Ffts_link    uintptr
	Ffts_number  int64
	Ffts_pointer uintptr
	Ffts_accpath uintptr
	Ffts_path    uintptr
	Ffts_errno   int32
	Ffts_symfd   int32
	Ffts_pathlen uint16
	Ffts_namelen uint16
	F__ccgo_pad1 [4]byte
	Ffts_ino     Ino64_t
	Ffts_dev     Dev_t
	Ffts_nlink   Nlink_t
	Ffts_level   int16
	Ffts_info    uint16
	Ffts_flags   uint16
	Ffts_instr   uint16
	Ffts_statp   uintptr
	Ffts_name    [1]int8
	F__ccgo_pad2 [7]byte
} /* fts.h:85:2 */

type FTS64 = struct {
	Ffts_cur     uintptr
	Ffts_child   uintptr
	Ffts_array   uintptr
	Ffts_dev     Dev_t
	Ffts_path    uintptr
	Ffts_rfd     int32
	Ffts_pathlen int32
	Ffts_nitems  int32
	F__ccgo_pad1 [4]byte
	Ffts_compar  uintptr
	Ffts_options int32
	F__ccgo_pad2 [4]byte
} /* fts.h:95:3 */

type FTSENT = X_ftsent /* fts.h:147:3 */

type FTSENT64 = X_ftsent64 /* fts.h:177:3 */
var XtclpFileAttrStrings = [4]uintptr{
	ts + 67552,
	ts + 67559, ts + 30023,
	uintptr(0),
} /* tclUnixFCmd.c:149:12 */
var XtclpFileAttrProcs = [3]TclFileAttrProcs{
	{FgetProc: 0, FsetProc: 0},
	{FgetProc: 0, FsetProc: 0},
	{FgetProc: 0, FsetProc: 0},
} /* tclUnixFCmd.c:171:24 */

//---------------------------------------------------------------------------
//
// TclpObjRenameFile, DoRenameFile --
//
//	Changes the name of an existing file or directory, from src to dst. If
//	src and dst refer to the same file or directory, does nothing and
//	returns success. Otherwise if dst already exists, it will be deleted
//	and replaced by src subject to the following conditions:
//	    If src is a directory, dst may be an empty directory.
//	    If src is a file, dst may be a file.
//	In any other situation where dst already exists, the rename will fail.
//
// Results:
//	If the directory was successfully created, returns TCL_OK. Otherwise
//	the return value is TCL_ERROR and errno is set to indicate the error.
//	Some possible values for errno are:
//
//	EACCES:	    src or dst parent directory can't be read and/or written.
//	EEXIST:	    dst is a non-empty directory.
//	EINVAL:	    src is a root directory or dst is a subdirectory of src.
//	EISDIR:	    dst is a directory, but src is not.
//	ENOENT:	    src doesn't exist, or src or dst is "".
//	ENOTDIR:    src is a directory, but dst is not.
//	EXDEV:	    src and dst are on different filesystems.
//
// Side effects:
//	The implementation of rename may allow cross-filesystem renames, but
//	the caller should be prepared to emulate it with copy and delete if
//	errno is EXDEV.
//
//---------------------------------------------------------------------------

func XTclpObjRenameFile(tls *libc.TLS, srcPathPtr uintptr, destPathPtr uintptr) int32 { /* tclUnixFCmd.c:330:1: */
	return sDoRenameFile(tls, XTcl_FSGetNativePath(tls, srcPathPtr),
		XTcl_FSGetNativePath(tls, destPathPtr))
}

func sDoRenameFile(tls *libc.TLS, src uintptr, dst uintptr) int32 { /* tclUnixFCmd.c:339:1: */
	bp := tls.Alloc(8192)
	defer tls.Free(8192)

	if libc.Xrename(tls, src, dst) == 0 { // INTL: Native.
		return TCL_OK
	}
	if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ENOTEMPTY {
		*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EEXIST
	}

	// IRIX returns EIO when you attept to move a directory into itself. We
	// just map EIO to EINVAL get the right message on SGI. Most platforms
	// don't return EIO except in really strange cases.

	if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EIO {
		*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EINVAL
	}

	// SunOS 4.1.4 reports overwriting a non-empty directory with a directory
	// as EINVAL instead of EEXIST (first rule out the correct EINVAL result
	// code for moving a directory into itself). Must be conditionally
	// compiled because realpath() not defined on all systems.

	if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EINVAL && 1 != 0 {
		// var srcPath [4096]int8 at bp, 4096

		// var dstPath [4096]int8 at bp+4096, 4096

		var dirPtr uintptr
		var dirEntPtr uintptr

		if libc.Xrealpath(tls, src, bp) != uintptr(0) &&
			libc.Xrealpath(tls, dst, bp+4096) != uintptr(0) &&
			libc.Xstrncmp(tls, bp, bp+4096, libc.Xstrlen(tls, bp)) != 0 {
			dirPtr = libc.Xopendir(tls, dst) // INTL: Native.
			if dirPtr != uintptr(0) {
				for 1 != 0 {
					dirEntPtr = libc.Xreaddir(tls, dirPtr) // INTL: Native.
					if dirEntPtr == uintptr(0) {
						break
					}
					if libc.Xstrcmp(tls, dirEntPtr+19, ts+31477) != 0 && libc.Xstrcmp(tls, dirEntPtr+19, ts+67566) != 0 {
						*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EEXIST
						libc.Xclosedir(tls, dirPtr)
						return TCL_ERROR
					}
				}
				libc.Xclosedir(tls, dirPtr)
			}
		}
		*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EINVAL
	}

	if libc.Xstrcmp(tls, src, ts+5792) == 0 {
		// Alpha reports renaming / as EBUSY and Linux reports it as EACCES,
		// instead of EINVAL.

		*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EINVAL
	}

	// DEC Alpha OSF1 V3.0 returns EACCES when attempting to move a file
	// across filesystems and the parent directory of that file is not
	// writable. Most other systems return EXDEV. Does nothing to correct this
	// behavior.

	return TCL_ERROR
}

//---------------------------------------------------------------------------
//
// TclpObjCopyFile, DoCopyFile --
//
//	Copy a single file (not a directory). If dst already exists and is not
//	a directory, it is removed.
//
// Results:
//	If the file was successfully copied, returns TCL_OK. Otherwise the
//	return value is TCL_ERROR and errno is set to indicate the error. Some
//	possible values for errno are:
//
//	EACCES:	    src or dst parent directory can't be read and/or written.
//	EISDIR:	    src or dst is a directory.
//	ENOENT:	    src doesn't exist. src or dst is "".
//
// Side effects:
//	This procedure will also copy symbolic links, block, and character
//	devices, and fifos. For symbolic links, the links themselves will be
//	copied and not what they point to. For the other special file types,
//	the directory entry will be copied and not the contents of the device
//	that it refers to.
//
//---------------------------------------------------------------------------

func XTclpObjCopyFile(tls *libc.TLS, srcPathPtr uintptr, destPathPtr uintptr) int32 { /* tclUnixFCmd.c:446:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	var src uintptr = XTcl_FSGetNativePath(tls, srcPathPtr)
	// var srcStatBuf Tcl_StatBuf at bp, 144

	if libc.Xlstat(tls, src, bp) != 0 { // INTL: Native.
		return TCL_ERROR
	}

	return sDoCopyFile(tls, src, XTcl_FSGetNativePath(tls, destPathPtr), bp)
}

func sDoCopyFile(tls *libc.TLS, src uintptr, dst uintptr, statBufPtr uintptr) int32 { /* tclUnixFCmd.c:461:1: */
	bp := tls.Alloc(4241)
	defer tls.Free(4241)

	// var dstStatBuf Tcl_StatBuf at bp, 144

	if (*Tcl_StatBuf)(unsafe.Pointer(statBufPtr)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000) {
		*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EISDIR
		return TCL_ERROR
	}

	// Symlink, and some of the other calls will fail if the target exists, so
	// we remove it first.

	if libc.Xlstat(tls, dst, bp) == 0 { // INTL: Native.
		if (*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000) {
			*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EISDIR
			return TCL_ERROR
		}
	}
	if libc.Xunlink(tls, dst) != 0 { // INTL: Native.
		if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != ENOENT {
			return TCL_ERROR
		}
	}

	switch int32((*Tcl_StatBuf)(unsafe.Pointer(statBufPtr)).Fst_mode & X__mode_t(0170000)) {
	case 0120000:
		{
			// var linkBuf [4097]int8 at bp+144, 4097

			var length int32

			length = int32(libc.Xreadlink(tls, src, bp+144, uint64(PATH_MAX)))
			// INTL: Native.
			if length == -1 {
				return TCL_ERROR
			}
			*(*int8)(unsafe.Pointer(bp + 144 + uintptr(length))) = int8(0)
			if libc.Xsymlink(tls, bp+144, dst) < 0 { // INTL: Native.
				return TCL_ERROR
			}
			break

		}
	case 0060000:
		fallthrough
	case 0020000:
		if libc.Xmknod(tls, dst, (*Tcl_StatBuf)(unsafe.Pointer(statBufPtr)).Fst_mode,
			(*Tcl_StatBuf)(unsafe.Pointer(statBufPtr)).Fst_rdev) < 0 {
			return TCL_ERROR
		}
		return sCopyFileAtts(tls, src, dst, statBufPtr)
	case 0010000:
		if libc.Xmkfifo(tls, dst, (*Tcl_StatBuf)(unsafe.Pointer(statBufPtr)).Fst_mode) < 0 { // INTL: Native.
			return TCL_ERROR
		}
		return sCopyFileAtts(tls, src, dst, statBufPtr)
	default:
		return XTclUnixCopyFile(tls, src, dst, statBufPtr, 0)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclUnixCopyFile -
//
//	Helper function for TclpCopyFile. Copies one regular file, using
//	read() and write().
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	A file is copied. Dst will be overwritten if it exists.
//
//----------------------------------------------------------------------

func XTclUnixCopyFile(tls *libc.TLS, src uintptr, dst uintptr, statBufPtr uintptr, dontCopyAtts int32) int32 { /* tclUnixFCmd.c:548:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var srcFd int32
	var dstFd int32
	var blockSize uint32 // Optimal I/O blocksize for filesystem
	var buffer uintptr   // Data buffer for copy
	var nread Size_t

	if libc.AssignInt32(&srcFd, libc.Xopen(tls, src, O_RDONLY, libc.VaList(bp, 0))) < 0 { // INTL: Native
		return TCL_ERROR
	}

	dstFd = libc.Xopen(tls, dst, O_CREAT|O_TRUNC|O_WRONLY,
		libc.VaList(bp+8, (*Tcl_StatBuf)(unsafe.Pointer(statBufPtr)).Fst_mode))
	if dstFd < 0 {
		libc.Xclose(tls, srcFd)
		return TCL_ERROR
	}

	// Try to work out the best size of buffer to use for copying. If we
	// can't, it's no big deal as we can just use a (32-bit) page, since
	// that's likely to be fairly efficient anyway.

	blockSize = uint32((*Tcl_StatBuf)(unsafe.Pointer(statBufPtr)).Fst_blksize)

	// [SF Tcl Bug 1586470] Even if we HAVE_STRUCT_STAT_ST_BLKSIZE, there are
	// filesystems which report a bogus value for the blocksize. An example
	// is the Andrew Filesystem (afs), reporting a blocksize of 0. When
	// detecting such a situation we now simply fall back to a hardwired
	// default size.

	if blockSize <= uint32(0) {
		blockSize = uint32(DEFAULT_COPY_BLOCK_SIZE)
	}
	buffer = XTcl_Alloc(tls, blockSize)
	for 1 != 0 {
		nread = Size_t(libc.Xread(tls, srcFd, buffer, uint64(blockSize)))
		if nread == libc.Uint64(libc.Uint64FromInt32(-1)) || nread == uint64(0) {
			break
		}
		if Size_t(libc.Xwrite(tls, dstFd, buffer, nread)) != nread {
			nread = libc.Uint64(libc.Uint64FromInt32(-1))
			break
		}
	}

	XTclpFree(tls, buffer)
	libc.Xclose(tls, srcFd)
	if libc.Xclose(tls, dstFd) != 0 || nread == libc.Uint64(libc.Uint64FromInt32(-1)) {
		libc.Xunlink(tls, dst) // INTL: Native.
		return TCL_ERROR
	}
	if !(dontCopyAtts != 0) && sCopyFileAtts(tls, src, dst, statBufPtr) == TCL_ERROR {
		// The copy succeeded, but setting the permissions failed, so be in a
		// consistent state, we remove the file that was created by the copy.

		libc.Xunlink(tls, dst) // INTL: Native.
		return TCL_ERROR
	}
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// TclpObjDeleteFile, TclpDeleteFile --
//
//	Removes a single file (not a directory).
//
// Results:
//	If the file was successfully deleted, returns TCL_OK. Otherwise the
//	return value is TCL_ERROR and errno is set to indicate the error. Some
//	possible values for errno are:
//
//	EACCES:	    a parent directory can't be read and/or written.
//	EISDIR:	    path is a directory.
//	ENOENT:	    path doesn't exist or is "".
//
// Side effects:
//	The file is deleted, even if it is read-only.
//
//---------------------------------------------------------------------------

func XTclpObjDeleteFile(tls *libc.TLS, pathPtr uintptr) int32 { /* tclUnixFCmd.c:666:1: */
	return XTclpDeleteFile(tls, XTcl_FSGetNativePath(tls, pathPtr))
}

func XTclpDeleteFile(tls *libc.TLS, path uintptr) int32 { /* tclUnixFCmd.c:673:1: */
	if libc.Xunlink(tls, path) != 0 {
		return TCL_ERROR
	}
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// TclpCreateDirectory, DoCreateDirectory --
//
//	Creates the specified directory. All parent directories of the
//	specified directory must already exist. The directory is automatically
//	created with permissions so that user can access the new directory and
//	create new files or subdirectories in it.
//
// Results:
//	If the directory was successfully created, returns TCL_OK. Otherwise
//	the return value is TCL_ERROR and errno is set to indicate the error.
//	Some possible values for errno are:
//
//	EACCES:	    a parent directory can't be read and/or written.
//	EEXIST:	    path already exists.
//	ENOENT:	    a parent directory doesn't exist.
//
// Side effects:
//	A directory is created with the current umask, except that permission
//	for u+rwx will always be added.
//
//---------------------------------------------------------------------------

func XTclpObjCreateDirectory(tls *libc.TLS, pathPtr uintptr) int32 { /* tclUnixFCmd.c:709:1: */
	return sDoCreateDirectory(tls, XTcl_FSGetNativePath(tls, pathPtr))
}

func sDoCreateDirectory(tls *libc.TLS, path uintptr) int32 { /* tclUnixFCmd.c:716:1: */
	var mode Mode_t

	mode = libc.Xumask(tls, uint32(0))
	libc.Xumask(tls, mode)

	// umask return value is actually the inverse of the permissions.

	mode = Mode_t(0777) & ^mode | Mode_t(0400) | Mode_t(0200) | Mode_t(0100)

	if libc.Xmkdir(tls, path, mode) != 0 { // INTL: Native.
		return TCL_ERROR
	}
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// TclpObjCopyDirectory --
//
//	Recursively copies a directory. The target directory dst must not
//	already exist. Note that this function does not merge two directory
//	hierarchies, even if the target directory is an an empty directory.
//
// Results:
//	If the directory was successfully copied, returns TCL_OK. Otherwise
//	the return value is TCL_ERROR, errno is set to indicate the error, and
//	the pathname of the file that caused the error is stored in errorPtr.
//	See TclpObjCreateDirectory and TclpObjCopyFile for a description of
//	possible values for errno.
//
// Side effects:
//	An exact copy of the directory hierarchy src will be created with the
//	name dst. If an error occurs, the error will be returned immediately,
//	and remaining files will not be processed.
//
//---------------------------------------------------------------------------

func XTclpObjCopyDirectory(tls *libc.TLS, srcPathPtr uintptr, destPathPtr uintptr, errorPtr uintptr) int32 { /* tclUnixFCmd.c:761:1: */
	bp := tls.Alloc(648)
	defer tls.Free(648)

	// var ds Tcl_DString at bp+432, 216

	// var srcString Tcl_DString at bp, 216

	// var dstString Tcl_DString at bp+216, 216

	var ret int32
	var transPtr uintptr

	transPtr = XTcl_FSGetTranslatedPath(tls, uintptr(0), srcPathPtr)
	XTcl_UtfToExternalDString(tls, uintptr(0),
		func() uintptr {
			if transPtr != uintptr(0) {
				return func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(transPtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(transPtr)).Fbytes
					}
					return XTcl_GetString(tls, transPtr)
				}()
			}
			return uintptr(0)
		}(),
		-1, bp)
	if transPtr != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = transPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	transPtr = XTcl_FSGetTranslatedPath(tls, uintptr(0), destPathPtr)
	XTcl_UtfToExternalDString(tls, uintptr(0),
		func() uintptr {
			if transPtr != uintptr(0) {
				return func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(transPtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(transPtr)).Fbytes
					}
					return XTcl_GetString(tls, transPtr)
				}()
			}
			return uintptr(0)
		}(),
		-1, bp+216)
	if transPtr != uintptr(0) {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = transPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	ret = sTraverseUnixTree(tls, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
	}{sTraversalCopy})), bp /* &srcString */, bp+216 /* &dstString */, bp+432 /* &ds */, 0)

	XTcl_DStringFree(tls, bp)
	XTcl_DStringFree(tls, bp+216)

	if ret != TCL_OK {
		*(*uintptr)(unsafe.Pointer(errorPtr)) = XTcl_NewStringObj(tls, (*Tcl_DString)(unsafe.Pointer(bp+432)).Fstring, -1)
		XTcl_DStringFree(tls, bp+432)
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(errorPtr)))).FrefCount++
	}
	return ret
}

//---------------------------------------------------------------------------
//
// TclpRemoveDirectory, DoRemoveDirectory --
//
//	Removes directory (and its contents, if the recursive flag is set).
//
// Results:
//	If the directory was successfully removed, returns TCL_OK. Otherwise
//	the return value is TCL_ERROR, errno is set to indicate the error, and
//	the pathname of the file that caused the error is stored in errorPtr.
//	Some possible values for errno are:
//
//	EACCES:	    path directory can't be read and/or written.
//	EEXIST:	    path is a non-empty directory.
//	EINVAL:	    path is a root directory.
//	ENOENT:	    path doesn't exist or is "".
// 	ENOTDIR:    path is not a directory.
//
// Side effects:
//	Directory removed. If an error occurs, the error will be returned
//	immediately, and remaining files will not be deleted.
//
//---------------------------------------------------------------------------

func XTclpObjRemoveDirectory(tls *libc.TLS, pathPtr uintptr, recursive int32, errorPtr uintptr) int32 { /* tclUnixFCmd.c:826:1: */
	bp := tls.Alloc(432)
	defer tls.Free(432)

	// var ds Tcl_DString at bp+216, 216

	// var pathString Tcl_DString at bp, 216

	var ret int32
	var transPtr uintptr = XTcl_FSGetTranslatedPath(tls, uintptr(0), pathPtr)

	XTcl_UtfToExternalDString(tls, uintptr(0),
		func() uintptr {
			if transPtr != uintptr(0) {
				return func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(transPtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(transPtr)).Fbytes
					}
					return XTcl_GetString(tls, transPtr)
				}()
			}
			return uintptr(0)
		}(),
		-1, bp)
	if transPtr != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = transPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	ret = sDoRemoveDirectory(tls, bp, recursive, bp+216)
	XTcl_DStringFree(tls, bp)

	if ret != TCL_OK {
		*(*uintptr)(unsafe.Pointer(errorPtr)) = XTcl_NewStringObj(tls, (*Tcl_DString)(unsafe.Pointer(bp+216)).Fstring, -1)
		XTcl_DStringFree(tls, bp+216)
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(errorPtr)))).FrefCount++
	}
	return ret
}

func sDoRemoveDirectory(tls *libc.TLS, pathPtr uintptr, recursive int32, errorPtr uintptr) int32 { /* tclUnixFCmd.c:854:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	var path uintptr
	var oldPerm Mode_t = Mode_t(0)
	var result int32

	path = (*Tcl_DString)(unsafe.Pointer(pathPtr)).Fstring

	if recursive != 0 {
		// We should try to change permissions so this can be deleted.

		// var statBuf Tcl_StatBuf at bp, 144

		var newPerm int32

		if libc.Xstat(tls, path, bp) == 0 {
			oldPerm = (*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode & X__mode_t(0x00007FFF)
		}

		newPerm = int32(oldPerm | Mode_t(64+128+256))
		libc.Xchmod(tls, path, Mode_t(newPerm))
	}

	if libc.Xrmdir(tls, path) == 0 { // INTL: Native.
		return TCL_OK
	}
	if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ENOTEMPTY {
		*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EEXIST
	}

	result = TCL_OK
	if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != EEXIST || recursive == 0 {
		if errorPtr != uintptr(0) {
			XTcl_ExternalToUtfDString(tls, uintptr(0), path, -1, errorPtr)
		}
		result = TCL_ERROR
	}

	// The directory is nonempty, but the recursive flag has been specified,
	// so we recursively remove all the files in the directory.

	if result == TCL_OK {
		result = sTraverseUnixTree(tls, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
		}{sTraversalDelete})), pathPtr, uintptr(0), errorPtr, 1)
	}

	if result != TCL_OK && recursive != 0 {
		// Try to restore permissions.

		libc.Xchmod(tls, path, oldPerm)
	}
	return result
}

//---------------------------------------------------------------------------
//
// TraverseUnixTree --
//
//	Traverse directory tree specified by sourcePtr, calling the function
//	traverseProc for each file and directory encountered. If destPtr is
//	non-null, each of name in the sourcePtr directory is appended to the
//	directory specified by destPtr and passed as the second argument to
//	traverseProc().
//
// Results:
//	Standard Tcl result.
//
// Side effects:
//	None caused by TraverseUnixTree, however the user specified
//	traverseProc() may change state. If an error occurs, the error will be
//	returned immediately, and remaining files will not be processed.
//
//---------------------------------------------------------------------------

func sTraverseUnixTree(tls *libc.TLS, traverseProc uintptr, sourcePtr uintptr, targetPtr uintptr, errorPtr uintptr, doRewind int32) int32 { /* tclUnixFCmd.c:943:1: */
	bp := tls.Alloc(160)
	defer tls.Free(160)

	// var statBuf Tcl_StatBuf at bp, 144

	var source uintptr
	var errfile uintptr
	var result int32
	var sourceLen int32
	var targetLen int32
	// var paths [2]uintptr at bp+144, 16

	var fts uintptr
	var ent uintptr
	var info uint16
	var path uintptr
	var pathlen uint16
	var type1 int32
	var statBufPtr uintptr
	*(*[2]uintptr)(unsafe.Pointer(bp + 144 /* paths */)) = [2]uintptr{uintptr(0), uintptr(0)}
	fts = uintptr(0)

	errfile = uintptr(0)
	result = TCL_OK
	targetLen = 0 // lint.

	source = (*Tcl_DString)(unsafe.Pointer(sourcePtr)).Fstring
	if !(libc.Xlstat(tls, source, bp) != 0) {
		goto __1
	} // INTL: Native.
	errfile = source
	goto end
__1:
	;
	if !!((*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000)) {
		goto __2
	}
	// Process the regular file

	return (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{traverseProc})).f(tls, sourcePtr, targetPtr, bp /* &statBuf */, DOTREE_F,
		errorPtr)
__2:
	;
	*(*uintptr)(unsafe.Pointer(bp + 144)) = source
	fts = libc.Xfts_open(tls, bp+144, FTS_PHYSICAL|FTS_NOCHDIR|func() int32 {
		if 0 != 0 || doRewind != 0 {
			return FTS_NOSTAT
		}
		return 0
	}(), uintptr(0))
	if !(fts == uintptr(0)) {
		goto __3
	}
	errfile = source
	goto end
__3:
	;

	sourceLen = (*Tcl_DString)(unsafe.Pointer(sourcePtr)).Flength
	if !(targetPtr != uintptr(0)) {
		goto __4
	}
	targetLen = (*Tcl_DString)(unsafe.Pointer(targetPtr)).Flength
__4:
	;

__5:
	if !(libc.AssignUintptr(&ent, libc.Xfts_read(tls, fts)) != uintptr(0)) {
		goto __6
	}
	info = (*FTSENT)(unsafe.Pointer(ent)).Ffts_info
	path = (*FTSENT)(unsafe.Pointer(ent)).Ffts_path + uintptr(sourceLen)
	pathlen = uint16(int32((*FTSENT)(unsafe.Pointer(ent)).Ffts_pathlen) - sourceLen)
	statBufPtr = uintptr(0)

	if !(int32(info) == FTS_DNR || int32(info) == FTS_ERR || int32(info) == FTS_NS) {
		goto __7
	}
	errfile = (*FTSENT)(unsafe.Pointer(ent)).Ffts_path
	goto __6
__7:
	;
	XTcl_DStringAppend(tls, sourcePtr, path, int32(pathlen))
	if !(targetPtr != uintptr(0)) {
		goto __8
	}
	XTcl_DStringAppend(tls, targetPtr, path, int32(pathlen))
__8:
	;
	switch int32(info) {
	case FTS_D:
		goto __10
	case FTS_DP:
		goto __11
	default:
		goto __12
	}
	goto __9
__10:
	type1 = DOTREE_PRED
	goto __9
__11:
	type1 = DOTREE_POSTD
	goto __9
__12:
	type1 = DOTREE_F
	goto __9
__9:
	;
	if !!(doRewind != 0) {
		goto __13
	} // no need to stat for delete
	if !(0 != 0) {
		goto __14
	}
	statBufPtr = bp /* &statBuf */
	if !(libc.Xlstat(tls, (*FTSENT)(unsafe.Pointer(ent)).Ffts_path, statBufPtr) != 0) {
		goto __16
	}
	errfile = (*FTSENT)(unsafe.Pointer(ent)).Ffts_path
	goto __6
__16:
	;
	goto __15
__14:
	statBufPtr = (*FTSENT)(unsafe.Pointer(ent)).Ffts_statp
__15:
	;
__13:
	;
	result = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{traverseProc})).f(tls, sourcePtr, targetPtr, statBufPtr, type1,
		errorPtr)
	if !(result != TCL_OK) {
		goto __17
	}
	goto __6
__17:
	;
	XTcl_DStringSetLength(tls, sourcePtr, sourceLen)
	if !(targetPtr != uintptr(0)) {
		goto __18
	}
	XTcl_DStringSetLength(tls, targetPtr, targetLen)
__18:
	;
	goto __5
__6:
	;

end:
	if !(errfile != uintptr(0)) {
		goto __19
	}
	if !(errorPtr != uintptr(0)) {
		goto __20
	}
	XTcl_ExternalToUtfDString(tls, uintptr(0), errfile, -1, errorPtr)
__20:
	;
	result = TCL_ERROR
__19:
	;
	if !(fts != uintptr(0)) {
		goto __21
	}
	libc.Xfts_close(tls, fts)
__21:
	;

	return result
}

//----------------------------------------------------------------------
//
// TraversalCopy
//
//	Called from TraverseUnixTree in order to execute a recursive copy of a
//	directory.
//
// Results:
//	Standard Tcl result.
//
// Side effects:
//	The file or directory src may be copied to dst, depending on the value
//	of type.
//
//----------------------------------------------------------------------

func sTraversalCopy(tls *libc.TLS, srcPtr uintptr, dstPtr uintptr, statBufPtr uintptr, type1 int32, errorPtr uintptr) int32 { /* tclUnixFCmd.c:1177:1: */
	switch type1 {
	case DOTREE_F:
		if sDoCopyFile(tls, (*Tcl_DString)(unsafe.Pointer(srcPtr)).Fstring, (*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring,
			statBufPtr) == TCL_OK {
			return TCL_OK
		}
		break

	case DOTREE_PRED:
		if sDoCreateDirectory(tls, (*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring) == TCL_OK {
			return TCL_OK
		}
		break

	case DOTREE_POSTD:
		if sCopyFileAtts(tls, (*Tcl_DString)(unsafe.Pointer(srcPtr)).Fstring,
			(*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring, statBufPtr) == TCL_OK {
			return TCL_OK
		}
		break
	}

	// There shouldn't be a problem with src, because we already checked it to
	// get here.

	if errorPtr != uintptr(0) {
		XTcl_ExternalToUtfDString(tls, uintptr(0), (*Tcl_DString)(unsafe.Pointer(dstPtr)).Fstring,
			(*Tcl_DString)(unsafe.Pointer(dstPtr)).Flength, errorPtr)
	}
	return TCL_ERROR
}

//---------------------------------------------------------------------------
//
// TraversalDelete --
//
//	Called by procedure TraverseUnixTree for every file and directory that
//	it encounters in a directory hierarchy. This procedure unlinks files,
//	and removes directories after all the containing files have been
//	processed.
//
// Results:
//	Standard Tcl result.
//
// Side effects:
//	Files or directory specified by src will be deleted.
//
//----------------------------------------------------------------------

func sTraversalDelete(tls *libc.TLS, srcPtr uintptr, ignore uintptr, statBufPtr uintptr, type1 int32, errorPtr uintptr) int32 { /* tclUnixFCmd.c:1241:1: */
	switch type1 {
	case DOTREE_F:
		if XTclpDeleteFile(tls, (*Tcl_DString)(unsafe.Pointer(srcPtr)).Fstring) == 0 {
			return TCL_OK
		}
		break
	case DOTREE_PRED:
		return TCL_OK
	case DOTREE_POSTD:
		if sDoRemoveDirectory(tls, srcPtr, 0, uintptr(0)) == 0 {
			return TCL_OK
		}
		break
	}
	if errorPtr != uintptr(0) {
		XTcl_ExternalToUtfDString(tls, uintptr(0), (*Tcl_DString)(unsafe.Pointer(srcPtr)).Fstring,
			(*Tcl_DString)(unsafe.Pointer(srcPtr)).Flength, errorPtr)
	}
	return TCL_ERROR
}

//---------------------------------------------------------------------------
//
// CopyFileAtts --
//
//	Copy the file attributes such as owner, group, permissions, and
//	modification date from one file to another.
//
// Results:
//	Standard Tcl result.
//
// Side effects:
//	User id, group id, permission bits, last modification time, and last
//	access time are updated in the new file to reflect the old file.
//
//---------------------------------------------------------------------------

func sCopyFileAtts(tls *libc.TLS, src uintptr, dst uintptr, statBufPtr uintptr) int32 { /* tclUnixFCmd.c:1291:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var tval Utimbuf at bp, 16

	var newMode Mode_t

	newMode = (*Tcl_StatBuf)(unsafe.Pointer(statBufPtr)).Fst_mode &
		X__mode_t(04000|02000|(0400|0200|0100)|int32(0400|0200|0100)>>3|int32(int32(0400|0200|0100)>>3)>>3)

	// Note that if you copy a setuid file that is owned by someone else, and
	// you are not root, then the copy will be setuid to you. The most correct
	// implementation would probably be to have the copy not setuid to anyone
	// if the original file was owned by someone else, but this corner case
	// isn't currently handled. It would require another lstat(), or getuid().

	if libc.Xchmod(tls, dst, newMode) != 0 { // INTL: Native.
		newMode = newMode & libc.Uint32FromInt32(libc.CplInt32(04000|02000))
		if libc.Xchmod(tls, dst, newMode) != 0 { // INTL: Native.
			return TCL_ERROR
		}
	}

	(*Utimbuf)(unsafe.Pointer(bp /* &tval */)).Factime = (*Tcl_StatBuf)(unsafe.Pointer(statBufPtr)).Fst_atim.Ftv_sec
	(*Utimbuf)(unsafe.Pointer(bp /* &tval */)).Fmodtime = (*Tcl_StatBuf)(unsafe.Pointer(statBufPtr)).Fst_mtim.Ftv_sec

	if libc.Xutime(tls, dst, bp) != 0 { // INTL: Native.
		return TCL_ERROR
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// GetGroupAttribute
//
//	Gets the group attribute of a file.
//
// Results:
//	Standard TCL result. Returns a new Tcl_Obj in attributePtrPtr if there
//	is no error.
//
// Side effects:
//	A new object is allocated.
//
//----------------------------------------------------------------------

func sGetGroupAttribute(tls *libc.TLS, interp uintptr, objIndex int32, fileName uintptr, attributePtrPtr uintptr) int32 { /* tclUnixFCmd.c:1348:1: */
	bp := tls.Alloc(376)
	defer tls.Free(376)

	// var statBuf Tcl_StatBuf at bp+16, 144

	var groupPtr uintptr
	var result int32

	result = XTclpObjStat(tls, fileName, bp+16)

	if result != 0 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+12748,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes
					}
					return XTcl_GetString(tls, fileName)
				}(), XTcl_PosixError(tls, interp))))
		}
		return TCL_ERROR
	}

	groupPtr = XTclpGetGrGid(tls, (*Tcl_StatBuf)(unsafe.Pointer(bp+16 /* &statBuf */)).Fst_gid)

	if groupPtr == uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(attributePtrPtr)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(attributePtrPtr)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(attributePtrPtr)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(attributePtrPtr)))).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(attributePtrPtr)))).Fbytes = uintptr(0)
			*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(attributePtrPtr)) + 32)) = int64(int32((*Tcl_StatBuf)(unsafe.Pointer(bp + 16)).Fst_gid))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(attributePtrPtr)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
			{
			}
		}
	} else {
		// var ds Tcl_DString at bp+160, 216

		var utf uintptr

		utf = XTcl_ExternalToUtfDString(tls, uintptr(0), (*Group)(unsafe.Pointer(groupPtr)).Fgr_name, -1, bp+160)
		*(*uintptr)(unsafe.Pointer(attributePtrPtr)) = XTcl_NewStringObj(tls, utf, -1)
		XTcl_DStringFree(tls, bp+160)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// GetOwnerAttribute
//
//	Gets the owner attribute of a file.
//
// Results:
//	Standard TCL result. Returns a new Tcl_Obj in attributePtrPtr if there
//	is no error.
//
// Side effects:
//	A new object is allocated.
//
//----------------------------------------------------------------------

func sGetOwnerAttribute(tls *libc.TLS, interp uintptr, objIndex int32, fileName uintptr, attributePtrPtr uintptr) int32 { /* tclUnixFCmd.c:1402:1: */
	bp := tls.Alloc(376)
	defer tls.Free(376)

	// var statBuf Tcl_StatBuf at bp+16, 144

	var pwPtr uintptr
	var result int32

	result = XTclpObjStat(tls, fileName, bp+16)

	if result != 0 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+12748,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes
					}
					return XTcl_GetString(tls, fileName)
				}(), XTcl_PosixError(tls, interp))))
		}
		return TCL_ERROR
	}

	pwPtr = XTclpGetPwUid(tls, (*Tcl_StatBuf)(unsafe.Pointer(bp+16 /* &statBuf */)).Fst_uid)

	if pwPtr == uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(attributePtrPtr)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(attributePtrPtr)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(attributePtrPtr)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(attributePtrPtr)))).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(attributePtrPtr)))).Fbytes = uintptr(0)
			*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(attributePtrPtr)) + 32)) = int64(int32((*Tcl_StatBuf)(unsafe.Pointer(bp + 16)).Fst_uid))
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(attributePtrPtr)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
			{
			}
		}
	} else {
		// var ds Tcl_DString at bp+160, 216

		XTcl_ExternalToUtfDString(tls, uintptr(0), (*Passwd)(unsafe.Pointer(pwPtr)).Fpw_name, -1, bp+160)
		*(*uintptr)(unsafe.Pointer(attributePtrPtr)) = XTclDStringToObj(tls, bp+160)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// GetPermissionsAttribute
//
//	Gets the group attribute of a file.
//
// Results:
//	Standard TCL result. Returns a new Tcl_Obj in attributePtrPtr if there
//	is no error. The object will have ref count 0.
//
// Side effects:
//	A new object is allocated.
//
//----------------------------------------------------------------------

func sGetPermissionsAttribute(tls *libc.TLS, interp uintptr, objIndex int32, fileName uintptr, attributePtrPtr uintptr) int32 { /* tclUnixFCmd.c:1454:1: */
	bp := tls.Alloc(168)
	defer tls.Free(168)

	// var statBuf Tcl_StatBuf at bp+24, 144

	var result int32

	result = XTclpObjStat(tls, fileName, bp+24)

	if result != 0 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+12748,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes
					}
					return XTcl_GetString(tls, fileName)
				}(), XTcl_PosixError(tls, interp))))
		}
		return TCL_ERROR
	}

	*(*uintptr)(unsafe.Pointer(attributePtrPtr)) = XTcl_ObjPrintf(tls,
		ts+67569, libc.VaList(bp+16, int64((*Tcl_StatBuf)(unsafe.Pointer(bp+24)).Fst_mode&X__mode_t(0x00007FFF))))
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// SetGroupAttribute --
//
//	Sets the group of the file to the specified group.
//
// Results:
//	Standard TCL result.
//
// Side effects:
//	As above.
//
//---------------------------------------------------------------------------

func sSetGroupAttribute(tls *libc.TLS, interp uintptr, objIndex int32, fileName uintptr, attributePtr uintptr) int32 { /* tclUnixFCmd.c:1496:1: */
	bp := tls.Alloc(304)
	defer tls.Free(304)

	// var gid int64 at bp+72, 8

	var result int32
	var native uintptr

	if XTcl_GetLongFromObj(tls, uintptr(0), attributePtr, bp+72) != TCL_OK {
		// var ds Tcl_DString at bp+88, 216

		var groupPtr uintptr = uintptr(0)
		var string uintptr
		// var length int32 at bp+80, 4

		string = XTcl_GetStringFromObj(tls, attributePtr, bp+80)

		native = XTcl_UtfToExternalDString(tls, uintptr(0), string, *(*int32)(unsafe.Pointer(bp + 80 /* length */)), bp+88)
		groupPtr = XTclpGetGrNam(tls, native) // INTL: Native.
		XTcl_DStringFree(tls, bp+88 /* &ds */)

		if groupPtr == uintptr(0) {
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

					ts+67576,
					libc.VaList(bp, func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes
						}
						return XTcl_GetString(tls, fileName)
					}(), string)))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+7420, ts+67637,
					ts+67644, uintptr(0)))
			}
			return TCL_ERROR
		}
		*(*int64)(unsafe.Pointer(bp + 72 /* gid */)) = int64((*Group)(unsafe.Pointer(groupPtr)).Fgr_gid)
	}

	native = XTcl_FSGetNativePath(tls, fileName)
	result = libc.Xchown(tls, native, libc.Uint32(libc.Uint32FromInt32(-1)), Gid_t(*(*int64)(unsafe.Pointer(bp + 72 /* gid */)))) // INTL: Native.

	if result != 0 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+67653,
				libc.VaList(bp+56, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes
					}
					return XTcl_GetString(tls, fileName)
				}(), XTcl_PosixError(tls, interp))))
		}
		return TCL_ERROR
	}
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// SetOwnerAttribute --
//
//	Sets the owner of the file to the specified owner.
//
// Results:
//	Standard TCL result.
//
// Side effects:
//	As above.
//
//---------------------------------------------------------------------------

func sSetOwnerAttribute(tls *libc.TLS, interp uintptr, objIndex int32, fileName uintptr, attributePtr uintptr) int32 { /* tclUnixFCmd.c:1563:1: */
	bp := tls.Alloc(304)
	defer tls.Free(304)

	// var uid int64 at bp+72, 8

	var result int32
	var native uintptr

	if XTcl_GetLongFromObj(tls, uintptr(0), attributePtr, bp+72) != TCL_OK {
		// var ds Tcl_DString at bp+88, 216

		var pwPtr uintptr = uintptr(0)
		var string uintptr
		// var length int32 at bp+80, 4

		string = XTcl_GetStringFromObj(tls, attributePtr, bp+80)

		native = XTcl_UtfToExternalDString(tls, uintptr(0), string, *(*int32)(unsafe.Pointer(bp + 80 /* length */)), bp+88)
		pwPtr = XTclpGetPwNam(tls, native) // INTL: Native.
		XTcl_DStringFree(tls, bp+88 /* &ds */)

		if pwPtr == uintptr(0) {
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

					ts+67691,
					libc.VaList(bp, func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes
						}
						return XTcl_GetString(tls, fileName)
					}(), string)))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+7420, ts+67751,
					ts+67758, uintptr(0)))
			}
			return TCL_ERROR
		}
		*(*int64)(unsafe.Pointer(bp + 72 /* uid */)) = int64((*Passwd)(unsafe.Pointer(pwPtr)).Fpw_uid)
	}

	native = XTcl_FSGetNativePath(tls, fileName)
	result = libc.Xchown(tls, native, Uid_t(*(*int64)(unsafe.Pointer(bp + 72 /* uid */))), libc.Uint32(libc.Uint32FromInt32(-1))) // INTL: Native.

	if result != 0 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+67766,
				libc.VaList(bp+56, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes
					}
					return XTcl_GetString(tls, fileName)
				}(), XTcl_PosixError(tls, interp))))
		}
		return TCL_ERROR
	}
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// SetPermissionsAttribute
//
//	Sets the file to the given permission.
//
// Results:
//	Standard TCL result.
//
// Side effects:
//	The permission of the file is changed.
//
//---------------------------------------------------------------------------

func sSetPermissionsAttribute(tls *libc.TLS, interp uintptr, objIndex int32, fileName uintptr, attributePtr uintptr) int32 { /* tclUnixFCmd.c:1630:1: */
	bp := tls.Alloc(228)
	defer tls.Free(228)

	// var mode int64 at bp+72, 8

	// var newMode Mode_t at bp+224, 4

	var result int32 = TCL_ERROR
	var native uintptr
	var modeStringPtr uintptr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(attributePtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(attributePtr)).Fbytes
		}
		return XTcl_GetString(tls, attributePtr)
	}()
	var scanned int32 = XTclParseAllWhiteSpace(tls, modeStringPtr, -1)

	// First supply support for octal number format

	if int32(*(*int8)(unsafe.Pointer(modeStringPtr + uintptr(scanned)))) == '0' &&
		int32(*(*int8)(unsafe.Pointer(modeStringPtr + uintptr(scanned+1)))) >= '0' &&
		int32(*(*int8)(unsafe.Pointer(modeStringPtr + uintptr(scanned+1)))) <= '7' {
		// Leading zero - attempt octal interpretation
		var modeObj uintptr

		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					modeObj = XTclThreadAllocObj(tls)
				} else {
					modeObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(modeObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(modeObj)).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(modeObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(modeObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(modeObj)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(modeObj)).Fbytes, ts+34914, uint64(int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(modeObj)).Fbytes + 2)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(modeObj)).Flength = int32(uint64(unsafe.Sizeof([3]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(modeObj)).FtypePtr = uintptr(0)
			{
			}
		}
		XTcl_AppendToObj(tls, modeObj, modeStringPtr+uintptr(scanned)+uintptr(1), -1)
		result = XTcl_GetLongFromObj(tls, uintptr(0), modeObj, bp+72)
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = modeObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if result == TCL_OK ||
		XTcl_GetLongFromObj(tls, uintptr(0), attributePtr, bp+72) == TCL_OK {
		*(*Mode_t)(unsafe.Pointer(bp + 224 /* newMode */)) = Mode_t(*(*int64)(unsafe.Pointer(bp + 72)) & int64(0x00007FFF))
	} else {
		// var buf Tcl_StatBuf at bp+80, 144

		// Try the forms "rwxrwxrwx" and "ugo=rwx"
		//
		// We get the current mode of the file, in order to allow for ug+-=rwx
		// style chmod strings.

		result = XTclpObjStat(tls, fileName, bp+80)
		if result != 0 {
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+12748,
					libc.VaList(bp, func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes
						}
						return XTcl_GetString(tls, fileName)
					}(), XTcl_PosixError(tls, interp))))
			}
			return TCL_ERROR
		}
		*(*Mode_t)(unsafe.Pointer(bp + 224 /* newMode */)) = (*Tcl_StatBuf)(unsafe.Pointer(bp+80)).Fst_mode & X__mode_t(0x00007FFF)

		if sGetModeFromPermString(tls, uintptr(0), modeStringPtr, bp+224) != TCL_OK {
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+67804,
					libc.VaList(bp+16, modeStringPtr)))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+3593, ts+6915, ts+67842, uintptr(0)))
			}
			return TCL_ERROR
		}
	}

	native = XTcl_FSGetNativePath(tls, fileName)
	result = libc.Xchmod(tls, native, *(*Mode_t)(unsafe.Pointer(bp + 224 /* newMode */))) // INTL: Native.
	if result != 0 {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+67853,
				libc.VaList(bp+56, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(fileName)).Fbytes
					}
					return XTcl_GetString(tls, fileName)
				}(), XTcl_PosixError(tls, interp))))
		}
		return TCL_ERROR
	}
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// TclpObjListVolumes --
//
//	Lists the currently mounted volumes, which on UNIX is just /.
//
// Results:
//	The list of volumes.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclpObjListVolumes(tls *libc.TLS) uintptr { /* tclUnixFCmd.c:1723:9: */
	var resultPtr uintptr
	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				resultPtr = XTclThreadAllocObj(tls)
			} else {
				resultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes, ts+5792, uint64(int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes + 1)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = int32(uint64(unsafe.Sizeof([2]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = uintptr(0)
		{
		}
	}

	(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++
	return resultPtr
}

//----------------------------------------------------------------------
//
// GetModeFromPermString --
//
//	This procedure is invoked to process the "file permissions" Tcl
//	command, to check for a "rwxrwxrwx" or "ugoa+-=rwxst" string. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func sGetModeFromPermString(tls *libc.TLS, interp uintptr, modeStringPtr uintptr, modePtr uintptr) int32 { /* tclUnixFCmd.c:1753:1: */
	var newMode Mode_t
	var oldMode Mode_t // Storage for the value of the old mode (that
	// is passed in), to allow for the chmod style
	// manipulation.
	var i int32
	var n int32
	var who int32
	var op int32
	var what int32
	var op_found int32
	var who_found int32

	// We start off checking for an "rwxrwxrwx" style permissions string

	if !(libc.Xstrlen(tls, modeStringPtr) != uint64(9)) {
		goto __1
	}
	goto chmodStyleCheck
__1:
	;

	newMode = Mode_t(0)
	i = 0
__2:
	if !(i < 9) {
		goto __4
	}
	switch int32(*(*int8)(unsafe.Pointer(modeStringPtr + uintptr(i)))) {
	case 'r':
		goto __6
	case 'w':
		goto __7
	case 'x':
		goto __8
	case 's':
		goto __9
	case 'S':
		goto __10
	case 't':
		goto __11
	case 'T':
		goto __12
	case '-':
		goto __13
	default:
		goto __14
	}
	goto __5
__6:
	if !(i%3 != 0) {
		goto __15
	}
	goto chmodStyleCheck
__15:
	;
	newMode = newMode | Mode_t(int32(1)<<(8-i))
	goto __5
__7:
	if !(i%3 != 1) {
		goto __16
	}
	goto chmodStyleCheck
__16:
	;
	newMode = newMode | Mode_t(int32(1)<<(8-i))
	goto __5
__8:
	if !(i%3 != 2) {
		goto __17
	}
	goto chmodStyleCheck
__17:
	;
	newMode = newMode | Mode_t(int32(1)<<(8-i))
	goto __5
__9:
	if !(i%3 != 2 || i > 5) {
		goto __18
	}
	goto chmodStyleCheck
__18:
	;
	newMode = newMode | Mode_t(int32(1)<<(8-i))
	newMode = newMode | Mode_t(int32(1)<<(11-i/3))
	goto __5
__10:
	if !(i%3 != 2 || i > 5) {
		goto __19
	}
	goto chmodStyleCheck
__19:
	;
	newMode = newMode | Mode_t(int32(1)<<(11-i/3))
	goto __5
__11:
	if !(i != 8) {
		goto __20
	}
	goto chmodStyleCheck
__20:
	;
	newMode = newMode | Mode_t(int32(1)<<(8-i))
	newMode = newMode | Mode_t(int32(1)<<9)
	goto __5
__12:
	if !(i != 8) {
		goto __21
	}
	goto chmodStyleCheck
__21:
	;
	newMode = newMode | Mode_t(int32(1)<<9)
	goto __5
__13:
	goto __5
__14:
	// Oops, not what we thought it was, so go on
	goto chmodStyleCheck
__5:
	;
	goto __3
__3:
	i++
	goto __2
	goto __4
__4:
	;
	*(*Mode_t)(unsafe.Pointer(modePtr)) = newMode
	return TCL_OK

chmodStyleCheck:
	// We now check for an "ugoa+-=rwxst" style permissions string

	n = 0
__22:
	if !(int32(*(*int8)(unsafe.Pointer(modeStringPtr + uintptr(n)))) != 0) {
		goto __24
	}
	oldMode = *(*Mode_t)(unsafe.Pointer(modePtr))
	who = libc.AssignInt32(&op, libc.AssignInt32(&what, libc.AssignInt32(&op_found, libc.AssignInt32(&who_found, 0))))
	i = 0
__25:
	if !(int32(*(*int8)(unsafe.Pointer(modeStringPtr + uintptr(n) + uintptr(i)))) != 0) {
		goto __27
	}
	if !!(who_found != 0) {
		goto __28
	}
	// who
	switch int32(*(*int8)(unsafe.Pointer(modeStringPtr + uintptr(n) + uintptr(i)))) {
	case 'u':
		goto __30
	case 'g':
		goto __31
	case 'o':
		goto __32
	case 'a':
		goto __33
	}
	goto __29
__30:
	who = who | 0x9C0
	goto __26
__31:
	who = who | 0x438
	goto __26
__32:
	who = who | 0x207
	goto __26
__33:
	who = who | 0xFFF
	goto __26
__29:
	;
__28:
	;
	who_found = 1
	if !(who == 0) {
		goto __34
	}
	who = 0xFFF
__34:
	;
	if !!(op_found != 0) {
		goto __35
	}
	// op
	switch int32(*(*int8)(unsafe.Pointer(modeStringPtr + uintptr(n) + uintptr(i)))) {
	case '+':
		goto __37
	case '-':
		goto __38
	case '=':
		goto __39
	default:
		goto __40
	}
	goto __36
__37:
	op = 1
	op_found = 1
	goto __26
__38:
	op = 2
	op_found = 1
	goto __26
__39:
	op = 3
	op_found = 1
	goto __26
__40:
	return TCL_ERROR
__36:
	;
__35:
	;
	// what
	switch int32(*(*int8)(unsafe.Pointer(modeStringPtr + uintptr(n) + uintptr(i)))) {
	case 'r':
		goto __42
	case 'w':
		goto __43
	case 'x':
		goto __44
	case 's':
		goto __45
	case 't':
		goto __46
	case ',':
		goto __47
	default:
		goto __48
	}
	goto __41
__42:
	what = what | 0x124
	goto __26
__43:
	what = what | 0x92
	goto __26
__44:
	what = what | 0x49
	goto __26
__45:
	what = what | 0xC00
	goto __26
__46:
	what = what | 0x200
	goto __26
__47:
	goto __41
__48:
	return TCL_ERROR
__41:
	;
	if !(int32(*(*int8)(unsafe.Pointer(modeStringPtr + uintptr(n) + uintptr(i)))) == ',') {
		goto __49
	}
	i++
	goto __27
__49:
	;
	goto __26
__26:
	i++
	goto __25
	goto __27
__27:
	;
	switch op {
	case 1:
		goto __51
	case 2:
		goto __52
	case 3:
		goto __53
	}
	goto __50
__51:
	*(*Mode_t)(unsafe.Pointer(modePtr)) = oldMode | Mode_t(who&what)
	goto __23
__52:
	*(*Mode_t)(unsafe.Pointer(modePtr)) = oldMode & Mode_t(^(who & what))
	goto __23
__53:
	*(*Mode_t)(unsafe.Pointer(modePtr)) = oldMode&Mode_t(^who) | Mode_t(who&what)
	goto __23
__50:
	;
	goto __23
__23:
	n = n + i
	goto __22
	goto __24
__24:
	;
	return TCL_OK
}

//---------------------------------------------------------------------------
//
// TclpObjNormalizePath --
//
//	This function scans through a path specification and replaces it, in
//	place, with a normalized version. A normalized version is one in which
//	all symlinks in the path are replaced with their expanded form (except
//	a symlink at the very end of the path).
//
// Results:
//	The new 'nextCheckpoint' value, giving as far as we could understand
//	in the path.
//
// Side effects:
//	The pathPtr string, is modified.
//
//---------------------------------------------------------------------------

func XTclpObjNormalizePath(tls *libc.TLS, interp uintptr, pathPtr uintptr, nextCheckpoint int32) int32 { /* tclUnixFCmd.c:1943:1: */
	bp := tls.Alloc(4320)
	defer tls.Free(4320)

	var currentPathEndPosition uintptr
	// var pathLen int32 at bp, 4

	var cur int8
	var path uintptr
	// var ds Tcl_DString at bp+8, 216

	var nativePath uintptr
	// var normPath [4096]int8 at bp+224, 4096

	var lastDir uintptr
	// Reached directory separator.

	var accessOk int32
	// Not at end, append remaining path.

	var normLen int32
	var newNormLen int32
	path = XTcl_GetStringFromObj(tls, pathPtr, bp)

	// We add '1' here because if nextCheckpoint is zero we know that '/'
	// exists, and if it isn't zero, it must point at a directory separator
	// which we also know exists.

	currentPathEndPosition = path + uintptr(nextCheckpoint)
	if !(int32(*(*int8)(unsafe.Pointer(currentPathEndPosition))) == '/') {
		goto __1
	}
	currentPathEndPosition++
__1:
	;

	// For speed, try to get the entire path in one go.

	if !(nextCheckpoint == 0 && 1 != 0) {
		goto __2
	}
	lastDir = libc.Xstrrchr(tls, currentPathEndPosition, '/')

	if !(lastDir != uintptr(0)) {
		goto __3
	}
	nativePath = XTcl_UtfToExternalDString(tls, uintptr(0), path,
		int32((int64(lastDir)-int64(path))/1), bp+8)
	if !(libc.Xrealpath(tls, nativePath, bp+224) != uintptr(0)) {
		goto __4
	}
	if !(int32(*(*int8)(unsafe.Pointer(nativePath))) != '/' && int32(*(*int8)(unsafe.Pointer(bp + 224))) == '/') {
		goto __5
	}
	// realpath has transformed a relative path into an
	// absolute path, we do not know how to handle this.
	goto __6
__5:
	nextCheckpoint = int32((int64(lastDir) - int64(path)) / 1)
	goto wholeStringOk
__6:
	;
__4:
	;
	XTcl_DStringFree(tls, bp+8)
__3:
	;
__2:
	;

	// Else do it the slow way.

__7:
	if !(1 != 0) {
		goto __8
	}
	cur = *(*int8)(unsafe.Pointer(currentPathEndPosition))
	if !(int32(cur) == '/' && path != currentPathEndPosition) {
		goto __9
	}

	nativePath = XTcl_UtfToExternalDString(tls, uintptr(0), path,
		int32((int64(currentPathEndPosition)-int64(path))/1), bp+8)
	accessOk = libc.Xaccess(tls, nativePath, F_OK)
	XTcl_DStringFree(tls, bp+8)

	if !(accessOk != 0) {
		goto __11
	}
	// File doesn't exist.

	goto __8
__11:
	;

	// Update the acceptable point.

	nextCheckpoint = int32((int64(currentPathEndPosition) - int64(path)) / 1)
	goto __10
__9:
	if !(int32(cur) == 0) {
		goto __12
	}
	// Reached end of string.

	goto __8
__12:
	;
__10:
	;
	currentPathEndPosition++
	goto __7
__8:
	;

	// We should really now convert this to a canonical path. We do that with
	// 'realpath' if we have it available. Otherwise we could step through
	// every single path component, checking whether it is a symlink, but that
	// would be a lot of work, and most modern OSes have 'realpath'.

	if !(1 != 0) {
		goto __13
	}
	// If we only had '/foo' or '/' then we never increment nextCheckpoint
	// and we don't need or want to go through 'Realpath'. Also, on some
	// platforms, passing an empty string to 'Realpath' will give us the
	// normalized pwd, which is not what we want at all!

	if !(nextCheckpoint == 0) {
		goto __14
	}
	return 0
__14:
	;

	nativePath = XTcl_UtfToExternalDString(tls, uintptr(0), path, nextCheckpoint, bp+8)
	if !(libc.Xrealpath(tls, nativePath, bp+224) != uintptr(0)) {
		goto __15
	}

wholeStringOk:
	newNormLen = int32(libc.Xstrlen(tls, bp+224))
	if !(newNormLen == (*Tcl_DString)(unsafe.Pointer(bp+8)).Flength &&
		libc.Xstrcmp(tls, bp+224, nativePath) == 0) {
		goto __16
	}
	// String is unchanged.

	XTcl_DStringFree(tls, bp+8)

	//
	//  Enable this to have the native FS claim normalization of
	//  the whole path for existing files. That would permit the
	//  caller to declare normalization complete without calls to
	//  additional filesystems. Saving lots of calls is probably
	//  worth the extra access() time here. When no other FS's are
	//  registered though, things are less clear.
	//
	// 		if (0 == access(normPath, F_OK)) {
	// 		    return pathLen;
	// 		}
	//

	return nextCheckpoint
__16:
	;

	// Free up the native path and put in its place the converted,
	// normalized path.

	XTcl_DStringFree(tls, bp+8)
	XTcl_ExternalToUtfDString(tls, uintptr(0), bp+224, newNormLen, bp+8)

	if !(int32(*(*int8)(unsafe.Pointer(path + uintptr(nextCheckpoint)))) != 0) {
		goto __17
	}
	// Not at end, append remaining path.

	normLen = (*Tcl_DString)(unsafe.Pointer(bp + 8)).Flength

	XTcl_DStringAppend(tls, bp+8, path+uintptr(nextCheckpoint),
		*(*int32)(unsafe.Pointer(bp))-nextCheckpoint)

	// We recognise up to and including the directory separator.

	nextCheckpoint = normLen + 1
	goto __18
__17:
	// We recognise the whole string.

	nextCheckpoint = (*Tcl_DString)(unsafe.Pointer(bp + 8)).Flength
__18:
	;

	// Overwrite with the normalized path.

	XTcl_SetStringObj(tls, pathPtr, (*Tcl_DString)(unsafe.Pointer(bp+8)).Fstring,
		(*Tcl_DString)(unsafe.Pointer(bp+8)).Flength)
__15:
	;
	XTcl_DStringFree(tls, bp+8)
__13:
	;

	return nextCheckpoint
}

//----------------------------------------------------------------------
//
// TclpOpenTemporaryFile, TclUnixOpenTemporaryFile --
//
//	Creates a temporary file, possibly based on the supplied bits and
//	pieces of template supplied in the first three arguments. If the
//	fourth argument is non-NULL, it contains a Tcl_Obj to store the name
//	of the temporary file in (and it is caller's responsibility to clean
//	up). If the fourth argument is NULL, try to arrange for the temporary
//	file to go away once it is no longer needed.
//
// Results:
//	A read-write Tcl Channel open on the file for TclpOpenTemporaryFile,
//	or a file descriptor (or -1 on failure) for TclUnixOpenTemporaryFile.
//
// Side effects:
//	Accesses the filesystem. Will set the contents of the Tcl_Obj fourth
//	argument (if that is non-NULL).
//
//----------------------------------------------------------------------

func XTclpOpenTemporaryFile(tls *libc.TLS, dirObj uintptr, basenameObj uintptr, extensionObj uintptr, resultingNameObj uintptr) Tcl_Channel { /* tclUnixFCmd.c:2156:1: */
	var fd int32 = XTclUnixOpenTemporaryFile(tls, dirObj, basenameObj, extensionObj,
		resultingNameObj)

	if fd == -1 {
		return uintptr(0)
	}
	return XTcl_MakeFileChannel(tls, uintptr(Intptr_t(fd)), int32(1)<<1|int32(1)<<2)
}

func XTclUnixOpenTemporaryFile(tls *libc.TLS, dirObj uintptr, basenameObj uintptr, extensionObj uintptr, resultingNameObj uintptr) int32 { /* tclUnixFCmd.c:2172:1: */
	bp := tls.Alloc(440)
	defer tls.Free(440)

	// var template Tcl_DString at bp+8, 216

	// var tmp Tcl_DString at bp+224, 216

	var string uintptr
	// var len int32 at bp, 4

	var fd int32

	// We should also check against making more then TMP_MAX of these.

	if dirObj != 0 {
		string = XTcl_GetStringFromObj(tls, dirObj, bp)
		XTcl_UtfToExternalDString(tls, uintptr(0), string, *(*int32)(unsafe.Pointer(bp /* len */)), bp+8)
	} else {
		XTcl_DStringInit(tls, bp+8)
		XTcl_DStringAppend(tls, bp+8, sDefaultTempDir(tls), -1) // INTL: native
	}

	XTcl_DStringAppend(tls, bp+8, ts+5792, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))

	if basenameObj != 0 {
		string = XTcl_GetStringFromObj(tls, basenameObj, bp)
		XTcl_UtfToExternalDString(tls, uintptr(0), string, *(*int32)(unsafe.Pointer(bp /* len */)), bp+224)
		XTclDStringAppendDString(tls, bp+8, bp+224)
		XTcl_DStringFree(tls, bp+224)
	} else {
		XTcl_DStringAppend(tls, bp+8, ts+57335, int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)))
	}

	XTcl_DStringAppend(tls, bp+8, ts+67897, int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)))

	if extensionObj != 0 {
		string = XTcl_GetStringFromObj(tls, extensionObj, bp)
		XTcl_UtfToExternalDString(tls, uintptr(0), string, *(*int32)(unsafe.Pointer(bp /* len */)), bp+224)
		XTclDStringAppendDString(tls, bp+8, bp+224)
		fd = libc.Xmkstemps(tls, (*Tcl_DString)(unsafe.Pointer(bp+8)).Fstring, (*Tcl_DString)(unsafe.Pointer(bp+224)).Flength)
		XTcl_DStringFree(tls, bp+224)
	} else {
		fd = libc.Xmkstemp(tls, (*Tcl_DString)(unsafe.Pointer(bp+8)).Fstring)
	}

	if fd == -1 {
		XTcl_DStringFree(tls, bp+8)
		return -1
	}

	if resultingNameObj != 0 {
		XTcl_ExternalToUtfDString(tls, uintptr(0), (*Tcl_DString)(unsafe.Pointer(bp+8)).Fstring,
			(*Tcl_DString)(unsafe.Pointer(bp+8)).Flength, bp+224)
		XTcl_SetStringObj(tls, resultingNameObj, (*Tcl_DString)(unsafe.Pointer(bp+224)).Fstring,
			(*Tcl_DString)(unsafe.Pointer(bp+224)).Flength)
		XTcl_DStringFree(tls, bp+224)
	} else {
		// Try to delete the file immediately since we're not reporting the
		// name to anyone. Note that we're *not* handling any errors from
		// this!

		libc.Xunlink(tls, (*Tcl_DString)(unsafe.Pointer(bp+8)).Fstring)
		*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
	}
	XTcl_DStringFree(tls, bp+8)

	return fd
}

// Helper that does *part* of what tempnam() does.

func sDefaultTempDir(tls *libc.TLS) uintptr { /* tclUnixFCmd.c:2250:19: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	var dir uintptr
	// var buf Stat at bp, 144

	dir = libc.Xgetenv(tls, ts+67905)
	if dir != 0 && *(*int8)(unsafe.Pointer(dir)) != 0 && libc.Xstat(tls, dir, bp) == 0 && (*Stat)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000) &&
		libc.Xaccess(tls, dir, W_OK) == 0 {
		return dir
	}

	dir = ts + 67912 /* "/tmp" */
	if libc.Xstat(tls, dir, bp) == 0 && (*Stat)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000) && libc.Xaccess(tls, dir, W_OK) == 0 {
		return dir
	}

	// Assume that the default location ("/tmp" if not overridden) is always
	// an existing writable directory; we've no recovery mechanism if it
	// isn't.

	return ts + 67912 /* "/tmp" */
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

//---------------------------------------------------------------------------
//
// TclpFindExecutable --
//
//	This function computes the absolute path name of the current
//	application, given its argv[0] value. For Cygwin, argv[0] is
//	ignored and the path is determined the same as under win32.
//
// Results:
//	None.
//
// Side effects:
//	The computed path name is stored as a ProcessGlobalValue.
//
//---------------------------------------------------------------------------

func XTclpFindExecutable(tls *libc.TLS, argv0 uintptr) { /* tclUnixFile.c:38:1: */
	bp := tls.Alloc(1008)
	defer tls.Free(1008)

	var encoding Tcl_Encoding
	var name uintptr
	var p uintptr
	// var statBuf Tcl_StatBuf at bp+216, 144

	// var buffer Tcl_DString at bp, 216

	// var nameString Tcl_DString at bp+792, 216

	// var cwd Tcl_DString at bp+576, 216

	// var utfName Tcl_DString at bp+360, 216

	if !(argv0 == uintptr(0)) {
		goto __1
	}
	return
__1:
	;
	XTcl_DStringInit(tls, bp)

	name = argv0
	p = name
__2:
	if !(int32(*(*int8)(unsafe.Pointer(p))) != 0) {
		goto __4
	}
	if !(int32(*(*int8)(unsafe.Pointer(p))) == '/') {
		goto __5
	}
	// The name contains a slash, so use the name directly without
	// doing a path search.

	goto gotName
__5:
	;
	goto __3
__3:
	p++
	goto __2
	goto __4
__4:
	;

	p = libc.Xgetenv(tls, ts+54902) // INTL: Native.
	if !(p == uintptr(0)) {
		goto __6
	}
	// There's no PATH environment variable; use the default that is used
	// by sh.

	p = ts + 67917 /* ":/bin:/usr/bin" */
	goto __7
__6:
	if !(int32(*(*int8)(unsafe.Pointer(p))) == 0) {
		goto __8
	}
	// An empty path is equivalent to ".".

	p = ts + 30762 /* "./" */
__8:
	;
__7:
	;

	// Search through all the directories named in the PATH variable to see if
	// argv[0] is in one of them. If so, use that file name.

__9:
	if !(1 != 0) {
		goto __10
	}
__11:
	if !(func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
	}() != 0) {
		goto __12
	}
	p++
	goto __11
__12:
	;
	name = p
__13:
	if !(int32(*(*int8)(unsafe.Pointer(p))) != ':' && int32(*(*int8)(unsafe.Pointer(p))) != 0) {
		goto __14
	}
	p++
	goto __13
__14:
	;
	XTcl_DStringSetLength(tls, bp, 0)
	if !(p != name) {
		goto __15
	}
	XTcl_DStringAppend(tls, bp, name, int32((int64(p)-int64(name))/1))
	if !(int32(*(*int8)(unsafe.Pointer(p + libc.UintptrFromInt32(-1)))) != '/') {
		goto __16
	}
	XTcl_DStringAppend(tls, bp, ts+5792, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
__16:
	;
__15:
	;
	name = XTcl_DStringAppend(tls, bp, argv0, -1)

	// INTL: The following calls to access() and stat() should not be
	// converted to Tclp routines because they need to operate on native
	// strings directly.

	if !(libc.Xaccess(tls, name, X_OK) == 0 &&
		libc.Xstat(tls, name, bp+216) == 0 &&
		(*Tcl_StatBuf)(unsafe.Pointer(bp+216)).Fst_mode&X__mode_t(0170000) == X__mode_t(0100000)) {
		goto __17
	}
	goto gotName
__17:
	;
	if !(int32(*(*int8)(unsafe.Pointer(p))) == 0) {
		goto __18
	}
	goto __10
	goto __19
__18:
	if !(int32(*(*int8)(unsafe.Pointer(p + uintptr(1)))) == 0) {
		goto __20
	}
	p = ts + 30762 /* "./" */
	goto __21
__20:
	p++
__21:
	;
__19:
	;
	goto __9
__10:
	;
	XTclSetObjNameOfExecutable(tls, XTcl_NewObj(tls), uintptr(0))
	goto done

	// If the name starts with "/" then just store it

gotName:
	if !(int32(*(*int8)(unsafe.Pointer(name))) == '/') {
		goto __22
	}

	encoding = XTcl_GetEncoding(tls, uintptr(0), uintptr(0))
	XTcl_ExternalToUtfDString(tls, encoding, name, -1, bp+360)
	XTclSetObjNameOfExecutable(tls,
		XTcl_NewStringObj(tls, (*Tcl_DString)(unsafe.Pointer(bp+360)).Fstring, -1), encoding)
	XTcl_DStringFree(tls, bp+360)
	goto done
__22:
	;

	if !(XTclpGetCwd(tls, uintptr(0), bp+576) == uintptr(0)) {
		goto __23
	}
	XTclSetObjNameOfExecutable(tls, XTcl_NewObj(tls), uintptr(0))
	goto done
__23:
	;

	// The name is relative to the current working directory. First strip off
	// a leading "./", if any, then add the full path name of the current
	// working directory.

	if !(int32(*(*int8)(unsafe.Pointer(name))) == '.' && int32(*(*int8)(unsafe.Pointer(name + 1))) == '/') {
		goto __24
	}
	name += uintptr(2)
__24:
	;

	XTcl_DStringInit(tls, bp+792)
	XTcl_DStringAppend(tls, bp+792, name, -1)

	XTcl_DStringFree(tls, bp)
	XTcl_UtfToExternalDString(tls, uintptr(0), (*Tcl_DString)(unsafe.Pointer(bp+576)).Fstring,
		(*Tcl_DString)(unsafe.Pointer(bp+576)).Flength, bp)
	if !(int32(*(*int8)(unsafe.Pointer((*Tcl_DString)(unsafe.Pointer(bp+576)).Fstring + uintptr((*Tcl_DString)(unsafe.Pointer(bp+576)).Flength-1)))) != '/') {
		goto __25
	}
	XTcl_DStringAppend(tls, bp, ts+5792, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
__25:
	;
	XTcl_DStringFree(tls, bp+576)
	XTclDStringAppendDString(tls, bp, bp+792)
	XTcl_DStringFree(tls, bp+792)

	encoding = XTcl_GetEncoding(tls, uintptr(0), uintptr(0))
	XTcl_ExternalToUtfDString(tls, encoding, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring, -1,
		bp+360)
	XTclSetObjNameOfExecutable(tls,
		XTcl_NewStringObj(tls, (*Tcl_DString)(unsafe.Pointer(bp+360)).Fstring, -1), encoding)
	XTcl_DStringFree(tls, bp+360)

done:
	XTcl_DStringFree(tls, bp)
}

//----------------------------------------------------------------------
//
// TclpMatchInDirectory --
//
//	This routine is used by the globbing code to search a directory for
//	all files which match a given pattern.
//
// Results:
//	The return value is a standard Tcl result indicating whether an error
//	occurred in globbing. Errors are left in interp, good results are
//	[lappend]ed to resultPtr (which must be a valid object).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpMatchInDirectory(tls *libc.TLS, interp uintptr, resultPtr uintptr, pathPtr uintptr, pattern uintptr, types1 uintptr) int32 { /* tclUnixFile.c:219:1: */
	bp := tls.Alloc(816)
	defer tls.Free(816)

	var native uintptr
	var fileNamePtr uintptr
	var matchResult int32 = 0

	if types1 != uintptr(0) && (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype == int32(1)<<7 {
		// The native filesystem never adds mounts.

		return TCL_OK
	}

	fileNamePtr = XTcl_FSGetTranslatedPath(tls, interp, pathPtr)
	if fileNamePtr == uintptr(0) {
		return TCL_ERROR
	}

	if pattern == uintptr(0) || int32(*(*int8)(unsafe.Pointer(pattern))) == 0 {
		// Match a file directly.

		var tailPtr uintptr
		var nativeTail uintptr

		native = XTcl_FSGetNativePath(tls, pathPtr)
		tailPtr = XTclPathPart(tls, interp, pathPtr, TCL_PATH_TAIL)
		nativeTail = XTcl_FSGetNativePath(tls, tailPtr)
		matchResult = sNativeMatchType(tls, interp, native, nativeTail, types1)
		if matchResult == 1 {
			XTcl_ListObjAppendElement(tls, interp, resultPtr, pathPtr)
		}
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = tailPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = fileNamePtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	} else {
		var d uintptr
		var entryPtr uintptr
		var dirName uintptr
		// var dirLength int32 at bp+232, 4

		var nativeDirLen int32
		var matchHidden int32
		var matchHiddenPat int32
		// var statBuf Tcl_StatBuf at bp+456, 144

		// var ds Tcl_DString at bp+240, 216
		// native encoding of dir
		// var dsOrig Tcl_DString at bp+16, 216
		// utf-8 encoding of dir

		XTcl_DStringInit(tls, bp+16)
		dirName = XTcl_GetStringFromObj(tls, fileNamePtr, bp+232)
		XTcl_DStringAppend(tls, bp+16, dirName, *(*int32)(unsafe.Pointer(bp + 232 /* dirLength */)))

		// Make sure that the directory part of the name really is a
		// directory. If the directory name is "", use the name "." instead,
		// because some UNIX systems don't treat "" like "." automatically.
		// Keep the "" for use in generating file names, otherwise "glob
		// foo.c" would return "./foo.c".

		if *(*int32)(unsafe.Pointer(bp + 232)) == 0 {
			dirName = ts + 31477 /* "." */
		} else {
			dirName = (*Tcl_DString)(unsafe.Pointer(bp + 16)).Fstring

			// Make sure we have a trailing directory delimiter.

			if int32(*(*int8)(unsafe.Pointer(dirName + uintptr(*(*int32)(unsafe.Pointer(bp + 232))-1)))) != '/' {
				dirName = XTcl_DStringAppend(tls, bp+16, ts+5792, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
				*(*int32)(unsafe.Pointer(bp + 232 /* dirLength */))++
			}
		}

		// Now open the directory for reading and iterate over the contents.

		native = XTcl_UtfToExternalDString(tls, uintptr(0), dirName, -1, bp+240)

		if libc.Xstat(tls, native, bp+456) != 0 ||
			!((*Tcl_StatBuf)(unsafe.Pointer(bp+456)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000)) {
			XTcl_DStringFree(tls, bp+16)
			XTcl_DStringFree(tls, bp+240)
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = fileNamePtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			return TCL_OK
		}

		d = libc.Xopendir(tls, native) // INTL: Native.
		if d == uintptr(0) {
			XTcl_DStringFree(tls, bp+240)
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+67932,
					libc.VaList(bp, (*Tcl_DString)(unsafe.Pointer(bp+16)).Fstring, XTcl_PosixError(tls, interp))))
			}
			XTcl_DStringFree(tls, bp+16)
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var _objPtr uintptr = fileNamePtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			return TCL_ERROR
		}

		nativeDirLen = (*Tcl_DString)(unsafe.Pointer(bp + 240)).Flength

		// Check to see if -type or the pattern requests hidden files.

		matchHiddenPat = libc.Bool32(int32(*(*int8)(unsafe.Pointer(pattern))) == '.' ||
			int32(*(*int8)(unsafe.Pointer(pattern))) == '\\' && int32(*(*int8)(unsafe.Pointer(pattern + 1))) == '.')
		matchHidden = libc.Bool32(matchHiddenPat != 0 ||
			types1 != 0 && (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Fperm&(int32(1)<<1) != 0)
		for libc.AssignUintptr(&entryPtr, libc.Xreaddir(tls, d)) != uintptr(0) { // INTL: Native.
			// var utfDs Tcl_DString at bp+600, 216

			var utfname uintptr

			// Skip this file if it doesn't agree with the hidden parameters
			// requested by the user (via -type or pattern).

			if int32(*(*int8)(unsafe.Pointer(entryPtr + 19))) == '.' {
				if !(matchHidden != 0) {
					continue
				}
			} else {
				if matchHidden != 0 {
					continue
				}
			}

			// Now check to see if the file matches, according to both type
			// and pattern. If so, add the file to the result.

			utfname = XTcl_ExternalToUtfDString(tls, uintptr(0), entryPtr+19, -1,
				bp+600)
			if XTcl_StringCaseMatch(tls, utfname, pattern, 0) != 0 {
				var typeOk int32 = 1

				if types1 != uintptr(0) {
					XTcl_DStringSetLength(tls, bp+240, nativeDirLen)
					native = XTcl_DStringAppend(tls, bp+240, entryPtr+19, -1)
					matchResult = sNativeMatchType(tls, interp, native,
						entryPtr+19, types1)
					typeOk = libc.Bool32(matchResult == 1)
				}
				if typeOk != 0 {
					XTcl_ListObjAppendElement(tls, interp, resultPtr,
						XTclNewFSPathObj(tls, pathPtr, utfname,
							(*Tcl_DString)(unsafe.Pointer(bp+600)).Flength))
				}
			}
			XTcl_DStringFree(tls, bp+600)
			if matchResult < 0 {
				break
			}
		}

		libc.Xclosedir(tls, d)
		XTcl_DStringFree(tls, bp+240)
		XTcl_DStringFree(tls, bp+16)
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var _objPtr uintptr = fileNamePtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if matchResult < 0 {
		return TCL_ERROR
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// NativeMatchType --
//
//	This routine is used by the globbing code to check if a file matches a
//	given type description.
//
// Results:
//	The return value is 1, 0 or -1 indicating whether the file matches the
//	given criteria, does not match them, or an error occurred (in which
//	case an error is left in interp).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sNativeMatchType(tls *libc.TLS, interp uintptr, nativeEntry uintptr, nativeName uintptr, types1 uintptr) int32 { /* tclUnixFile.c:422:1: */
	bp := tls.Alloc(144)
	defer tls.Free(144)

	// var buf Tcl_StatBuf at bp, 144

	if !(types1 == uintptr(0)) {
		goto __1
	}
	// Simply check for the file's existence, but do it with lstat, in
	// case it is a link to a file which doesn't exist (since that case
	// would not show up if we used 'access' or 'stat')

	if !(libc.Xlstat(tls, nativeEntry, bp) != 0) {
		goto __2
	}
	return 0
__2:
	;
	return 1
__1:
	;

	if !((*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Fperm != 0) {
		goto __3
	}
	if !(libc.Xstat(tls, nativeEntry, bp) != 0) {
		goto __4
	}
	// Either the file has disappeared between the 'readdir' call and
	// the 'stat' call, or the file is a link to a file which doesn't
	// exist (which we could ascertain with lstat), or there is some
	// other strange problem. In all these cases, we define this to
	// mean the file does not match any defined permission, and
	// therefore it is not added to the list of files to return.

	return 0
__4:
	;

	// readonly means that there are NO write permissions (even for user),
	// but execute is OK for anybody OR that the user immutable flag is
	// set (where supported).

	if !((*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Fperm&(int32(1)<<0) != 0 && (*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(int32(int32(0200)>>3)>>3|int32(0200)>>3|0200) != 0 || (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Fperm&(int32(1)<<2) != 0 && libc.Xaccess(tls, nativeEntry, R_OK) != 0 || (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Fperm&(int32(1)<<3) != 0 && libc.Xaccess(tls, nativeEntry, W_OK) != 0 || (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Fperm&(int32(1)<<4) != 0 && libc.Xaccess(tls, nativeEntry, X_OK) != 0 ||
		(*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Fperm&(int32(1)<<1) != 0 && int32(*(*int8)(unsafe.Pointer(nativeName))) != '.') {
		goto __5
	}
	return 0
__5:
	;
__3:
	;
	if !((*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype != 0) {
		goto __6
	}
	if !((*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Fperm == 0) {
		goto __7
	}
	// We haven't yet done a stat on the file.

	if !(libc.Xstat(tls, nativeEntry, bp) != 0) {
		goto __8
	}
	// Posix error occurred. The only ok case is if this is a link
	// to a nonexistent file, and the user did 'glob -l'. So we
	// check that here:

	if !((*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype&(int32(1)<<5) != 0 &&
		libc.Xlstat(tls, nativeEntry, bp) == 0 &&
		(*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0120000)) {
		goto __9
	}
	return 1
__9:
	;
	return 0
__8:
	;
__7:
	;

	// In order bcdpsfl as in 'find -t'

	if !((*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype&(int32(1)<<0) != 0 && (*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0060000) || (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype&(int32(1)<<1) != 0 && (*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0020000) || (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype&(int32(1)<<2) != 0 && (*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000) || (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype&(int32(1)<<3) != 0 && (*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0010000) || (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype&(int32(1)<<6) != 0 && (*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0140000) || (*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype&(int32(1)<<4) != 0 && (*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0100000)) {
		goto __10
	}
	// Do nothing - this file is ok.
	goto __11
__10:
	if !((*Tcl_GlobTypeData)(unsafe.Pointer(types1)).Ftype&(int32(1)<<5) != 0 &&
		libc.Xlstat(tls, nativeEntry, bp) == 0 &&
		(*Tcl_StatBuf)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0120000)) {
		goto __12
	}
	goto filetypeOK
__12:
	;
	return 0
__11:
	;
__6:
	;
filetypeOK:

	// If we're on OSX, we also have to worry about matching the file creator
	// code (if specified). Do that now.

	return 1
}

//---------------------------------------------------------------------------
//
// TclpGetUserHome --
//
//	This function takes the specified user name and finds their home
//	directory.
//
// Results:
//	The result is a pointer to a string specifying the user's home
//	directory, or NULL if the user's home directory could not be
//	determined. Storage for the result string is allocated in bufferPtr;
//	the caller must call Tcl_DStringFree() when the result is no longer
//	needed.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpGetUserHome(tls *libc.TLS, name uintptr, bufferPtr uintptr) uintptr { /* tclUnixFile.c:584:12: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var pwPtr uintptr
	// var ds Tcl_DString at bp, 216

	var native uintptr = XTcl_UtfToExternalDString(tls, uintptr(0), name, -1, bp)

	pwPtr = XTclpGetPwNam(tls, native) // INTL: Native.
	XTcl_DStringFree(tls, bp /* &ds */)

	if pwPtr == uintptr(0) {
		return uintptr(0)
	}
	XTcl_ExternalToUtfDString(tls, uintptr(0), (*Passwd)(unsafe.Pointer(pwPtr)).Fpw_dir, -1, bufferPtr)
	return (*Tcl_DString)(unsafe.Pointer(bufferPtr)).Fstring
}

//---------------------------------------------------------------------------
//
// TclpObjAccess --
//
//	This function replaces the library version of access().
//
// Results:
//	See access() documentation.
//
// Side effects:
//	See access() documentation.
//
//---------------------------------------------------------------------------

func XTclpObjAccess(tls *libc.TLS, pathPtr uintptr, mode int32) int32 { /* tclUnixFile.c:621:1: */
	var path uintptr = XTcl_FSGetNativePath(tls, pathPtr)

	if path == uintptr(0) {
		return -1
	}
	return libc.Xaccess(tls, path, mode)
}

//---------------------------------------------------------------------------
//
// TclpObjChdir --
//
//	This function replaces the library version of chdir().
//
// Results:
//	See chdir() documentation.
//
// Side effects:
//	See chdir() documentation.
//
//---------------------------------------------------------------------------

func XTclpObjChdir(tls *libc.TLS, pathPtr uintptr) int32 { /* tclUnixFile.c:650:1: */
	var path uintptr = XTcl_FSGetNativePath(tls, pathPtr)

	if path == uintptr(0) {
		return -1
	}
	return libc.Xchdir(tls, path)
}

//----------------------------------------------------------------------
//
// TclpObjLstat --
//
//	This function replaces the library version of lstat().
//
// Results:
//	See lstat() documentation.
//
// Side effects:
//	See lstat() documentation.
//
//----------------------------------------------------------------------

func XTclpObjLstat(tls *libc.TLS, pathPtr uintptr, bufPtr uintptr) int32 { /* tclUnixFile.c:678:1: */
	return libc.Xlstat(tls, XTcl_FSGetNativePath(tls, pathPtr), bufPtr)
}

//---------------------------------------------------------------------------
//
// TclpGetNativeCwd --
//
//	This function replaces the library version of getcwd().
//
// Results:
//	The input and output are filesystem paths in native form. The result
//	is either the given clientData, if the working directory hasn't
//	changed, or a new clientData (owned by our caller), giving the new
//	native path, or NULL if the current directory could not be determined.
//	If NULL is returned, the caller can examine the standard posix error
//	codes to determine the cause of the problem.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpGetNativeCwd(tls *libc.TLS, clientData ClientData) ClientData { /* tclUnixFile.c:707:1: */
	bp := tls.Alloc(4097)
	defer tls.Free(4097)

	// var buffer [4097]int8 at bp, 4097

	if libc.Xgetcwd(tls, bp, uint64(PATH_MAX+1)) == uintptr(0) { // INTL: Native.
		return uintptr(0)
	}

	if clientData == uintptr(0) || libc.Xstrcmp(tls, bp, clientData) != 0 {
		var newCd uintptr = XTcl_Alloc(tls, uint32(libc.Xstrlen(tls, bp)+uint64(1)))

		libc.Xstrcpy(tls, newCd, bp)
		return newCd
	}

	// No change to pwd.

	return clientData
}

//---------------------------------------------------------------------------
//
// TclpGetCwd --
//
//	This function replaces the library version of getcwd(). (Obsolete
//	function, only retained for old extensions which may call it
//	directly).
//
// Results:
//	The result is a pointer to a string specifying the current directory,
//	or NULL if the current directory could not be determined. If NULL is
//	returned, an error message is left in the interp's result. Storage for
//	the result string is allocated in bufferPtr; the caller must call
//	Tcl_DStringFree() when the result is no longer needed.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpGetCwd(tls *libc.TLS, interp uintptr, bufferPtr uintptr) uintptr { /* tclUnixFile.c:758:12: */
	bp := tls.Alloc(4105)
	defer tls.Free(4105)

	// var buffer [4097]int8 at bp+8, 4097

	if libc.Xgetcwd(tls, bp+8, uint64(PATH_MAX+1)) == uintptr(0) {
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+38159,
				libc.VaList(bp, XTcl_PosixError(tls, interp))))
		}
		return uintptr(0)
	}
	return XTcl_ExternalToUtfDString(tls, uintptr(0), bp+8, -1, bufferPtr)
}

//---------------------------------------------------------------------------
//
// TclpReadlink --
//
//	This function replaces the library version of readlink().
//
// Results:
//	The result is a pointer to a string specifying the contents of the
//	symbolic link given by 'path', or NULL if the symbolic link could not
//	be read. Storage for the result string is allocated in bufferPtr; the
//	caller must call Tcl_DStringFree() when the result is no longer
//	needed.
//
// Side effects:
//	See readlink() documentation.
//
//---------------------------------------------------------------------------

func XTclpReadlink(tls *libc.TLS, path uintptr, linkPtr uintptr) uintptr { /* tclUnixFile.c:802:6: */
	bp := tls.Alloc(4312)
	defer tls.Free(4312)

	// var link [4096]int8 at bp+216, 4096

	var length int32
	var native uintptr
	// var ds Tcl_DString at bp, 216

	native = XTcl_UtfToExternalDString(tls, uintptr(0), path, -1, bp)
	length = int32(libc.Xreadlink(tls, native, bp+216, uint64(unsafe.Sizeof([4096]int8{})))) // INTL: Native.
	XTcl_DStringFree(tls, bp /* &ds */)

	if length < 0 {
		return uintptr(0)
	}

	XTcl_ExternalToUtfDString(tls, uintptr(0), bp+216, length, linkPtr)
	return (*Tcl_DString)(unsafe.Pointer(linkPtr)).Fstring
}

//----------------------------------------------------------------------
//
// TclpObjStat --
//
//	This function replaces the library version of stat().
//
// Results:
//	See stat() documentation.
//
// Side effects:
//	See stat() documentation.
//
//----------------------------------------------------------------------

func XTclpObjStat(tls *libc.TLS, pathPtr uintptr, bufPtr uintptr) int32 { /* tclUnixFile.c:846:1: */
	var path uintptr = XTcl_FSGetNativePath(tls, pathPtr)

	if path == uintptr(0) {
		return -1
	}
	return libc.Xstat(tls, path, bufPtr)
}

func XTclpObjLink(tls *libc.TLS, pathPtr uintptr, toPtr uintptr, linkAction int32) uintptr { /* tclUnixFile.c:860:9: */
	bp := tls.Alloc(4544)
	defer tls.Free(4544)
	*(*uintptr)(unsafe.Pointer(bp)) = toPtr

	if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
		var src uintptr = XTcl_FSGetNativePath(tls, pathPtr)
		var target uintptr = uintptr(0)

		if src == uintptr(0) {
			return uintptr(0)
		}

		// If we're making a symbolic link and the path is relative, then we
		// must check whether it exists _relative_ to the directory in which
		// the src is found (not relative to the current cwd which is just not
		// relevant in this case).
		//
		// If we're making a hard link, then a relative path is just converted
		// to absolute relative to the cwd.

		if linkAction&TCL_CREATE_SYMBOLIC_LINK != 0 &&
			XTcl_FSGetPathType(tls, *(*uintptr)(unsafe.Pointer(bp))) == TCL_PATH_RELATIVE {
			var dirPtr uintptr
			var absPtr uintptr

			dirPtr = XTclPathPart(tls, uintptr(0), pathPtr, TCL_PATH_DIRNAME)
			if dirPtr == uintptr(0) {
				return uintptr(0)
			}
			absPtr = XTcl_FSJoinToPath(tls, dirPtr, 1, bp)
			(*Tcl_Obj)(unsafe.Pointer(absPtr)).FrefCount++
			if XTcl_FSAccess(tls, absPtr, F_OK) == -1 {
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = absPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _objPtr uintptr = dirPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}

				// Target doesn't exist.

				*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = ENOENT
				return uintptr(0)
			}

			// Target exists; we'll construct the relative path we want below.

			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = absPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			for ok3 := true; ok3; ok3 = 0 != 0 {
				var _objPtr uintptr = dirPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		} else {
			target = XTcl_FSGetNativePath(tls, *(*uintptr)(unsafe.Pointer(bp /* toPtr */)))
			if target == uintptr(0) {
				return uintptr(0)
			}
			if libc.Xaccess(tls, target, F_OK) == -1 {
				// Target doesn't exist.

				*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = ENOENT
				return uintptr(0)
			}
		}

		if libc.Xaccess(tls, src, F_OK) != -1 {
			// Src exists.

			*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EEXIST
			return uintptr(0)
		}

		// Check symbolic link flag first, since we prefer to create these.

		if linkAction&TCL_CREATE_SYMBOLIC_LINK != 0 {
			// var targetLen int32 at bp+8, 4

			// var ds Tcl_DString at bp+16, 216

			var transPtr uintptr

			// Now we don't want to link to the absolute, normalized path.
			// Relative links are quite acceptable (but links to ~user are not
			// -- these must be expanded first).

			transPtr = XTcl_FSGetTranslatedPath(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp /* toPtr */)))
			if transPtr == uintptr(0) {
				return uintptr(0)
			}
			target = XTcl_GetStringFromObj(tls, transPtr, bp+8)
			target = XTcl_UtfToExternalDString(tls, uintptr(0), target, *(*int32)(unsafe.Pointer(bp + 8 /* targetLen */)), bp+16)
			for ok4 := true; ok4; ok4 = 0 != 0 {
				var _objPtr uintptr = transPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}

			if libc.Xsymlink(tls, target, src) != 0 {
				*(*uintptr)(unsafe.Pointer(bp /* toPtr */)) = uintptr(0)
			}
			XTcl_DStringFree(tls, bp+16)
		} else if linkAction&TCL_CREATE_HARD_LINK != 0 {
			if libc.Xlink(tls, target, src) != 0 {
				return uintptr(0)
			}
		} else {
			*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = ENODEV
			return uintptr(0)
		}
		return *(*uintptr)(unsafe.Pointer(bp /* toPtr */))
	} else {
		var linkPtr uintptr = uintptr(0)
		// var link [4096]int8 at bp+232, 4096

		var length int32
		// var ds Tcl_DString at bp+4328, 216

		var transPtr uintptr

		transPtr = XTcl_FSGetTranslatedPath(tls, uintptr(0), pathPtr)
		if transPtr == uintptr(0) {
			return uintptr(0)
		}
		for ok5 := true; ok5; ok5 = 0 != 0 {
			var _objPtr uintptr = transPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}

		length = int32(libc.Xreadlink(tls, XTcl_FSGetNativePath(tls, pathPtr), bp+232, uint64(unsafe.Sizeof([4096]int8{}))))
		if length < 0 {
			return uintptr(0)
		}

		XTcl_ExternalToUtfDString(tls, uintptr(0), bp+232, length, bp+4328)
		linkPtr = XTclDStringToObj(tls, bp+4328)
		(*Tcl_Obj)(unsafe.Pointer(linkPtr)).FrefCount++
		return linkPtr
	}
	return uintptr(0)
}

//---------------------------------------------------------------------------
//
// TclpFilesystemPathType --
//
//	This function is part of the native filesystem support, and returns
//	the path type of the given path. Right now it simply returns NULL. In
//	the future it could return specific path types, like 'nfs', 'samba',
//	'FAT32', etc.
//
// Results:
//	NULL at present.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclpFilesystemPathType(tls *libc.TLS, pathPtr uintptr) uintptr { /* tclUnixFile.c:1018:9: */
	// All native paths are of the same type.

	return uintptr(0)
}

//---------------------------------------------------------------------------
//
// TclpNativeToNormalized --
//
//	Convert native format to a normalized path object, with refCount of
//	zero.
//
//	Currently assumes all native paths are actually normalized already, so
//	if the path given is not normalized this will actually just convert to
//	a valid string path, but not necessarily a normalized one.
//
// Results:
//	A valid normalized path.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclpNativeToNormalized(tls *libc.TLS, clientData ClientData) uintptr { /* tclUnixFile.c:1050:9: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	// var ds Tcl_DString at bp, 216

	XTcl_ExternalToUtfDString(tls, uintptr(0), clientData, -1, bp)
	return XTclDStringToObj(tls, bp)
}

//---------------------------------------------------------------------------
//
// TclNativeCreateNativeRep --
//
//	Create a native representation for the given path.
//
// Results:
//	The nativePath representation.
//
// Side effects:
//	Memory will be allocated. The path may need to be normalized.
//
//---------------------------------------------------------------------------

func XTclNativeCreateNativeRep(tls *libc.TLS, pathPtr uintptr) ClientData { /* tclUnixFile.c:1077:1: */
	bp := tls.Alloc(224)
	defer tls.Free(224)

	var nativePathPtr uintptr
	var str uintptr
	// var ds Tcl_DString at bp+8, 216

	var validPathPtr uintptr
	// var len int32 at bp, 4

	if XTclFSCwdIsNative(tls) != 0 {
		// The cwd is native, which means we can use the translated path
		// without worrying about normalization (this will also usually be
		// shorter so the utf-to-external conversion will be somewhat faster).

		validPathPtr = XTcl_FSGetTranslatedPath(tls, uintptr(0), pathPtr)
		if validPathPtr == uintptr(0) {
			return uintptr(0)
		}
	} else {
		// Make sure the normalized path is set.

		validPathPtr = XTcl_FSGetNormalizedPath(tls, uintptr(0), pathPtr)
		if validPathPtr == uintptr(0) {
			return uintptr(0)
		}
		(*Tcl_Obj)(unsafe.Pointer(validPathPtr)).FrefCount++
	}

	str = XTcl_GetStringFromObj(tls, validPathPtr, bp)
	XTcl_UtfToExternalDString(tls, uintptr(0), str, *(*int32)(unsafe.Pointer(bp /* len */)), bp+8)
	*(*int32)(unsafe.Pointer(bp /* len */)) = int32(uint64((*Tcl_DString)(unsafe.Pointer(bp+8)).Flength) + uint64(unsafe.Sizeof(int8(0))))
	if libc.Xstrlen(tls, (*Tcl_DString)(unsafe.Pointer(bp+8)).Fstring) < uint64(*(*int32)(unsafe.Pointer(bp)))-uint64(unsafe.Sizeof(int8(0))) {
		// See bug [3118489]: NUL in filenames
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = validPathPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		XTcl_DStringFree(tls, bp+8)
		return uintptr(0)
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = validPathPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	nativePathPtr = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp))))
	libc.Xmemcpy(tls, nativePathPtr, (*Tcl_DString)(unsafe.Pointer(bp+8)).Fstring, uint64(*(*int32)(unsafe.Pointer(bp /* len */))))

	XTcl_DStringFree(tls, bp+8)
	return nativePathPtr
}

//---------------------------------------------------------------------------
//
// TclNativeDupInternalRep --
//
//	Duplicate the native representation.
//
// Results:
//	The copied native representation, or NULL if it is not possible to
//	copy the representation.
//
// Side effects:
//	Memory will be allocated for the copy.
//
//---------------------------------------------------------------------------

func XTclNativeDupInternalRep(tls *libc.TLS, clientData ClientData) ClientData { /* tclUnixFile.c:1144:1: */
	var copy uintptr
	var len Size_t

	if clientData == uintptr(0) {
		return uintptr(0)
	}

	// ASCII representation when running on Unix.

	len = (libc.Xstrlen(tls, clientData) + uint64(1)) * Size_t(unsafe.Sizeof(int8(0)))

	copy = XTcl_Alloc(tls, uint32(len))
	libc.Xmemcpy(tls, copy, clientData, len)
	return copy
}

//---------------------------------------------------------------------------
//
// TclpUtime --
//
//	Set the modification date for a file.
//
// Results:
//	0 on success, -1 on error.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclpUtime(tls *libc.TLS, pathPtr uintptr, tval uintptr) int32 { /* tclUnixFile.c:1182:1: */
	return libc.Xutime(tls, XTcl_FSGetNativePath(tls, pathPtr), tval)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// This value can be passed to `uselocale' and may be returned by it.
//    Passing this value to any other function has undefined behavior.

// Access to locale-dependent parameters.
//    Copyright (C) 1995-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Get the type definition.
// Copyright (C) 1996-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

// The default message set used by the gencat program.

// Value for FLAG parameter of `catgets' to say we want XPG4 compliance.

// Message catalog descriptor type.
type Nl_catd = uintptr /* nl_types.h:33:14 */

// Type used by `nl_langinfo'.
type Nl_item = int32 /* nl_types.h:36:13 */

// Value to indicate that there is no limit.

// We can represent all limits.

// Type for resource quantity measurement.
type Rlim_t = X__rlim64_t   /* resource.h:133:20 */
type Rlim64_t = X__rlim64_t /* resource.h:136:20 */

type Rlimit = struct {
	Frlim_cur Rlim_t
	Frlim_max Rlim_t
} /* resource.h:139:1 */

type Rlimit64 = struct {
	Frlim_cur Rlim64_t
	Frlim_max Rlim64_t
} /* resource.h:148:1 */

// The X/Open standard defines that all the functions below must use
//    `int' as the type for the first argument.  When we are compiling with
//    GNU extensions we change this slightly to provide better error
//    checking.
type X__rlimit_resource_t = int32 /* resource.h:42:13 */
type X__rusage_who_t = int32      /* resource.h:43:13 */
type X__priority_which_t = int32  /* resource.h:44:13 */

// Tcl tries to use standard and homebrew methods to guess the right encoding
// on the platform. However, there is always a final fallback, and this value
// is it. Make sure it is a real Tcl encoding.

// Default directory in which to look for Tcl library scripts. The symbol is
// defined by Makefile.

var defaultLibraryDir = *(*[222]int8)(unsafe.Pointer(ts + 67965)) /* tclUnixInit.c:105:13 */

// Directory in which to look for packages (each package is typically
// installed as a subdirectory of this directory). The symbol is defined by
// Makefile.

var pkgPath = *(*[218]int8)(unsafe.Pointer(ts + 68187)) /* tclUnixInit.c:113:13 */

// The following table is used to map from Unix locale strings to encoding
// files. If HAVE_LANGINFO is defined, then this is a fallback table when the
// result from nl_langinfo isn't a recognized encoding. Otherwise this is the
// first list checked for a mapping from env encoding to Tcl encoding name.

type LocaleTable = struct {
	Flang     uintptr
	Fencoding uintptr
} /* tclUnixInit.c:125:3 */

// The table below is sorted for the sake of doing binary searches on it. The
// indenting reflects different categories of data. The leftmost data
// represent the encoding names directly implemented by data files in Tcl's
// default encoding directory. Indented by one TAB are the encoding names that
// are common alternative spellings. Indented by two TABs are the accumulated
// "bug fixes" that have been added to deal with the wide variability seen
// among existing platforms.

var localeTable = [174]LocaleTable{
	{Flang: ts + 2046, Fencoding: ts + 25963},
	{Flang: ts + 68405, Fencoding: ts + 68415},
	{Flang: ts + 68422, Fencoding: ts + 25963},
	{Flang: ts + 1195, Fencoding: ts + 1195},
	{Flang: ts + 68437, Fencoding: ts + 68437},
	{Flang: ts + 68442, Fencoding: ts + 68442},
	{Flang: ts + 68415, Fencoding: ts + 68415},
	{Flang: ts + 68449, Fencoding: ts + 68449},
	{Flang: ts + 68456, Fencoding: ts + 68456},
	{Flang: ts + 68463, Fencoding: ts + 68463},
	{Flang: ts + 68470, Fencoding: ts + 68470},
	{Flang: ts + 68477, Fencoding: ts + 68477},
	{Flang: ts + 68484, Fencoding: ts + 68484},
	{Flang: ts + 68491, Fencoding: ts + 68491},
	{Flang: ts + 68498, Fencoding: ts + 68498},
	{Flang: ts + 68504, Fencoding: ts + 68504},
	{Flang: ts + 68510, Fencoding: ts + 68510},
	{Flang: ts + 68516, Fencoding: ts + 68516},
	{Flang: ts + 68522, Fencoding: ts + 68522},
	{Flang: ts + 68528, Fencoding: ts + 68528},
	{Flang: ts + 68534, Fencoding: ts + 68534},
	{Flang: ts + 68540, Fencoding: ts + 68540},
	{Flang: ts + 68546, Fencoding: ts + 68546},
	{Flang: ts + 68552, Fencoding: ts + 68552},
	{Flang: ts + 68558, Fencoding: ts + 68558},
	{Flang: ts + 68564, Fencoding: ts + 68564},
	{Flang: ts + 68570, Fencoding: ts + 68570},
	{Flang: ts + 68576, Fencoding: ts + 68576},
	{Flang: ts + 68582, Fencoding: ts + 68582},
	{Flang: ts + 68588, Fencoding: ts + 68588},
	{Flang: ts + 68594, Fencoding: ts + 68594},
	{Flang: ts + 68600, Fencoding: ts + 68600},
	{Flang: ts + 68606, Fencoding: ts + 68606},
	{Flang: ts + 68612, Fencoding: ts + 68612},
	{Flang: ts + 68618, Fencoding: ts + 68618},
	{Flang: ts + 68627, Fencoding: ts + 68627},
	{Flang: ts + 68634, Fencoding: ts + 68634},
	{Flang: ts + 68641, Fencoding: ts + 68641},
	{Flang: ts + 68648, Fencoding: ts + 68648},
	{Flang: ts + 68655, Fencoding: ts + 68641},
	{Flang: ts + 68661, Fencoding: ts + 68648},
	{Flang: ts + 68667, Fencoding: ts + 68634},
	{Flang: ts + 68673, Fencoding: ts + 68673},
	{Flang: ts + 68681, Fencoding: ts + 68681},
	{Flang: ts + 68688, Fencoding: ts + 68688},
	{Flang: ts + 68695, Fencoding: ts + 68688},
	{Flang: ts + 68707, Fencoding: ts + 68707},
	{Flang: ts + 68718, Fencoding: ts + 68582},
	{Flang: ts + 68725, Fencoding: ts + 68442},
	{Flang: ts + 68733, Fencoding: ts + 68415},
	{Flang: ts + 68741, Fencoding: ts + 68449},
	{Flang: ts + 68749, Fencoding: ts + 68456},
	{Flang: ts + 68757, Fencoding: ts + 68463},
	{Flang: ts + 68765, Fencoding: ts + 68470},
	{Flang: ts + 68773, Fencoding: ts + 68477},
	{Flang: ts + 68781, Fencoding: ts + 68484},
	{Flang: ts + 68789, Fencoding: ts + 68491},
	{Flang: ts + 68797, Fencoding: ts + 68498},
	{Flang: ts + 68804, Fencoding: ts + 68504},
	{Flang: ts + 68811, Fencoding: ts + 68510},
	{Flang: ts + 68818, Fencoding: ts + 68516},
	{Flang: ts + 68825, Fencoding: ts + 68522},
	{Flang: ts + 68832, Fencoding: ts + 68528},
	{Flang: ts + 68839, Fencoding: ts + 68534},
	{Flang: ts + 68846, Fencoding: ts + 68540},
	{Flang: ts + 68853, Fencoding: ts + 68546},
	{Flang: ts + 68860, Fencoding: ts + 68552},
	{Flang: ts + 68867, Fencoding: ts + 68558},
	{Flang: ts + 68874, Fencoding: ts + 68564},
	{Flang: ts + 68881, Fencoding: ts + 68570},
	{Flang: ts + 68888, Fencoding: ts + 68576},
	{Flang: ts + 68895, Fencoding: ts + 68582},
	{Flang: ts + 68902, Fencoding: ts + 68588},
	{Flang: ts + 68909, Fencoding: ts + 68594},
	{Flang: ts + 68916, Fencoding: ts + 68600},
	{Flang: ts + 68923, Fencoding: ts + 68606},
	{Flang: ts + 68930, Fencoding: ts + 68612},
	{Flang: ts + 68937, Fencoding: ts + 68946},
	{Flang: ts + 68954, Fencoding: ts + 68966},
	{Flang: ts + 68977, Fencoding: ts + 68989},
	{Flang: ts + 69000, Fencoding: ts + 25963},
	{Flang: ts + 69011, Fencoding: ts + 69023},
	{Flang: ts + 69034, Fencoding: ts + 69046},
	{Flang: ts + 69057, Fencoding: ts + 69069},
	{Flang: ts + 69080, Fencoding: ts + 69092},
	{Flang: ts + 69103, Fencoding: ts + 69115},
	{Flang: ts + 69126, Fencoding: ts + 69137},
	{Flang: ts + 69147, Fencoding: ts + 69158},
	{Flang: ts + 69168, Fencoding: ts + 69179},
	{Flang: ts + 69189, Fencoding: ts + 69200},
	{Flang: ts + 69210, Fencoding: ts + 69221},
	{Flang: ts + 69231, Fencoding: ts + 69242},
	{Flang: ts + 69252, Fencoding: ts + 69263},
	{Flang: ts + 69273, Fencoding: ts + 69284},
	{Flang: ts + 68946, Fencoding: ts + 68946},
	{Flang: ts + 68966, Fencoding: ts + 68966},
	{Flang: ts + 68989, Fencoding: ts + 68989},
	{Flang: ts + 25963, Fencoding: ts + 25963},
	{Flang: ts + 69023, Fencoding: ts + 69023},
	{Flang: ts + 69046, Fencoding: ts + 69046},
	{Flang: ts + 69069, Fencoding: ts + 69069},
	{Flang: ts + 69092, Fencoding: ts + 69092},
	{Flang: ts + 69115, Fencoding: ts + 69115},
	{Flang: ts + 69137, Fencoding: ts + 69137},
	{Flang: ts + 69158, Fencoding: ts + 69158},
	{Flang: ts + 69179, Fencoding: ts + 69179},
	{Flang: ts + 69200, Fencoding: ts + 69200},
	{Flang: ts + 69221, Fencoding: ts + 69221},
	{Flang: ts + 69242, Fencoding: ts + 69242},
	{Flang: ts + 69263, Fencoding: ts + 69263},
	{Flang: ts + 69284, Fencoding: ts + 69284},
	{Flang: ts + 69294, Fencoding: ts + 25963},
	{Flang: ts + 69303, Fencoding: ts + 69092},
	{Flang: ts + 69313, Fencoding: ts + 69137},
	{Flang: ts + 69322, Fencoding: ts + 69200},
	{Flang: ts + 69331, Fencoding: ts + 69221},
	{Flang: ts + 69340, Fencoding: ts + 69242},
	{Flang: ts + 69349, Fencoding: ts + 69263},
	{Flang: ts + 69358, Fencoding: ts + 69284},
	{Flang: ts + 69367, Fencoding: ts + 68641},
	{Flang: ts + 69370, Fencoding: ts + 68641},
	{Flang: ts + 69376, Fencoding: ts + 68641},
	{Flang: ts + 69386, Fencoding: ts + 68641},
	{Flang: ts + 69398, Fencoding: ts + 68966},
	{Flang: ts + 69408, Fencoding: ts + 69421},
	{Flang: ts + 69430, Fencoding: ts + 69421},
	{Flang: ts + 69441, Fencoding: ts + 68641},
	{Flang: ts + 69452, Fencoding: ts + 68641},
	{Flang: ts + 69458, Fencoding: ts + 68641},
	{Flang: ts + 69467, Fencoding: ts + 69421},
	{Flang: ts + 69481, Fencoding: ts + 68641},
	{Flang: ts + 69495, Fencoding: ts + 68641},
	{Flang: ts + 69508, Fencoding: ts + 69421},
	{Flang: ts + 69522, Fencoding: ts + 69522},
	{Flang: ts + 69530, Fencoding: ts + 69530},
	{Flang: ts + 69538, Fencoding: ts + 69538},
	{Flang: ts + 69546, Fencoding: ts + 69421},
	{Flang: ts + 69552, Fencoding: ts + 68648},
	{Flang: ts + 69555, Fencoding: ts + 68648},
	{Flang: ts + 69561, Fencoding: ts + 68648},
	{Flang: ts + 69571, Fencoding: ts + 68648},
	{Flang: ts + 69583, Fencoding: ts + 69583},
	{Flang: ts + 69590, Fencoding: ts + 69590},
	{Flang: ts + 69597, Fencoding: ts + 68648},
	{Flang: ts + 69604, Fencoding: ts + 69604},
	{Flang: ts + 69612, Fencoding: ts + 69624},
	{Flang: ts + 69636, Fencoding: ts + 69648},
	{Flang: ts + 69660, Fencoding: ts + 69672},
	{Flang: ts + 69684, Fencoding: ts + 69696},
	{Flang: ts + 69708, Fencoding: ts + 69717},
	{Flang: ts + 69726, Fencoding: ts + 69737},
	{Flang: ts + 69748, Fencoding: ts + 69757},
	{Flang: ts + 69766, Fencoding: ts + 69775},
	{Flang: ts + 69784, Fencoding: ts + 69795},
	{Flang: ts + 69806, Fencoding: ts + 69814},
	{Flang: ts + 69822, Fencoding: ts + 69833},
	{Flang: ts + 69844, Fencoding: ts + 69855},
	{Flang: ts + 69866, Fencoding: ts + 25963},
	{Flang: ts + 69873, Fencoding: ts + 69200},
	{Flang: ts + 69876, Fencoding: ts + 69200},
	{Flang: ts + 69882, Fencoding: ts + 69200},
	{Flang: ts + 69421, Fencoding: ts + 69421},
	{Flang: ts + 69888, Fencoding: ts + 69421},
	{Flang: ts + 69893, Fencoding: ts + 69893},
	{Flang: ts + 69900, Fencoding: ts + 69900},
	{Flang: ts + 69908, Fencoding: ts + 69900},
	{Flang: ts + 69915, Fencoding: ts + 68534},
	{Flang: ts + 69924, Fencoding: ts + 25949},
	{Flang: ts + 69929, Fencoding: ts + 68600},
	{Flang: ts + 69932, Fencoding: ts + 68634},
	{Flang: ts + 69945, Fencoding: ts + 68634},
	{Flang: ts + 69955, Fencoding: ts + 68634},
	{Flang: ts + 69968, Fencoding: ts + 69974},
	{Flang: ts + 69981, Fencoding: ts + 68437},
} /* tclUnixInit.c:137:26 */

//---------------------------------------------------------------------------
//
// TclpInitPlatform --
//
//	Initialize all the platform-dependent things like signals and
//	floating-point error handling.
//
//	Called at process initialization time.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclpInitPlatform(tls *libc.TLS) { /* tclUnixInit.c:362:1: */
	XtclPlatform = TCL_PLATFORM_UNIX

	// Make sure, that the standard FDs exist. [Bug 772288]

	if libc.Xlseek(tls, 0, int64(0), SEEK_CUR) == int64(-1) && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EBADF {
		libc.Xopen(tls, ts+69992, O_RDONLY, 0)
	}
	if libc.Xlseek(tls, 1, int64(0), SEEK_CUR) == int64(-1) && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EBADF {
		libc.Xopen(tls, ts+69992, O_WRONLY, 0)
	}
	if libc.Xlseek(tls, 2, int64(0), SEEK_CUR) == int64(-1) && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EBADF {
		libc.Xopen(tls, ts+69992, O_WRONLY, 0)
	}

	// The code below causes SIGPIPE (broken pipe) errors to be ignored. This
	// is needed so that Tcl processes don't die if they create child
	// processes (e.g. using "exec" or "open") that terminate prematurely.
	// The signal handler is only set up when the first interpreter is
	// created; after this the application can override the handler with a
	// different one of its own, if it wants.

	libc.Xsignal(tls, SIGPIPE, uintptr(1))

	// Initialize the C library's locale subsystem. This is required for input
	// methods to work properly on X11. We only do this for LC_CTYPE because
	// that's the necessary one, and we don't want to affect LC_TIME here.
	// The side effect of setting the default locale should be to load any
	// locale specific modules that are needed by X. [BUG: 5422 3345 4236 2522
	// 2521].

	libc.Xsetlocale(tls, 0, ts+2046)

	// In case the initial locale is not "C", ensure that the numeric
	// processing is done in "C" locale regardless. This is needed because Tcl
	// relies on routines like strtod, but should not have locale dependent
	// behavior.

	libc.Xsetlocale(tls, 1, ts+10457)

}

//---------------------------------------------------------------------------
//
// TclpInitLibraryPath --
//
//	This is the fallback routine that sets the library path if the
//	application has not set one by the first time it is needed.
//
// Results:
//	None.
//
// Side effects:
//	Sets the library path to an initial value.
//
//-------------------------------------------------------------------------

func XTclpInitLibraryPath(tls *libc.TLS, valuePtr uintptr, lengthPtr uintptr, encodingPtr uintptr) { /* tclUnixInit.c:466:1: */
	bp := tls.Alloc(488)
	defer tls.Free(488)

	var pathPtr uintptr
	var objPtr uintptr
	var str uintptr
	// var buffer Tcl_DString at bp+8, 216

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			pathPtr = XTclThreadAllocObj(tls)
		} else {
			pathPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(pathPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr = uintptr(0)
	{
	}

	// Look for the library relative to the TCL_LIBRARY env variable. If the
	// last dirname in the TCL_LIBRARY path does not match the last dirname in
	// the installLib variable, use the last dir name of installLib in
	// addition to the orginal TCL_LIBRARY path.

	str = libc.Xgetenv(tls, ts+70002) // INTL: Native.
	XTcl_ExternalToUtfDString(tls, uintptr(0), str, -1, bp+8)
	str = (*Tcl_DString)(unsafe.Pointer(bp + 8)).Fstring

	if str != uintptr(0) && int32(*(*int8)(unsafe.Pointer(str))) != 0 {
		// var ds Tcl_DString at bp+224, 216

		// var pathc int32 at bp+472, 4

		// var pathv uintptr at bp+480, 8

		// var installLib [32]int8 at bp+440, 32

		XTcl_DStringInit(tls, bp+224)

		// Initialize the substrings used when locating an executable. The
		// installLib variable computes the path as though the executable is
		// installed.

		libc.Xsprintf(tls, bp+440, ts+70014, libc.VaList(bp, ts+6588))

		// If TCL_LIBRARY is set, search there.

		XTcl_ListObjAppendElement(tls, uintptr(0), pathPtr, XTcl_NewStringObj(tls, str, -1))

		XTcl_SplitPath(tls, str, bp+472, bp+480)
		if *(*int32)(unsafe.Pointer(bp + 472)) > 0 && libc.Xstrcasecmp(tls, bp+440+uintptr(4), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 480)) + uintptr(*(*int32)(unsafe.Pointer(bp + 472))-1)*8))) != 0 {
			// If TCL_LIBRARY is set but refers to a different tcl
			// installation than the current version, try fiddling with the
			// specified directory to make it refer to this installation by
			// removing the old "tclX.Y" and substituting the current version
			// string.

			*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 480 /* pathv */)) + uintptr(*(*int32)(unsafe.Pointer(bp + 472))-1)*8)) = bp + 440 + uintptr(4)
			str = XTcl_JoinPath(tls, *(*int32)(unsafe.Pointer(bp + 472 /* pathc */)), *(*uintptr)(unsafe.Pointer(bp + 480 /* pathv */)), bp+224)
			XTcl_ListObjAppendElement(tls, uintptr(0), pathPtr, XTclDStringToObj(tls, bp+224))
		}
		XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 480)))
	}

	/*
	 * Finally, look for the library relative to the compiled-in path. This is
	 * needed when users install Tcl with an exec-prefix that is different
	 * from the prefix.
	 */

	{
		{
			// TODO: Pull this value from the TIP 59 table.

			str = uintptr(unsafe.Pointer(&defaultLibraryDir))

		}
		if int32(*(*int8)(unsafe.Pointer(str))) != 0 {
			objPtr = XTcl_NewStringObj(tls, str, -1)
			XTcl_ListObjAppendElement(tls, uintptr(0), pathPtr, objPtr)
		}

	}
	XTcl_DStringFree(tls, bp+8)

	*(*Tcl_Encoding)(unsafe.Pointer(encodingPtr)) = XTcl_GetEncoding(tls, uintptr(0), uintptr(0))
	str = XTcl_GetStringFromObj(tls, pathPtr, lengthPtr)
	*(*uintptr)(unsafe.Pointer(valuePtr)) = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(lengthPtr))+1))
	libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(valuePtr)), str, uint64(*(*int32)(unsafe.Pointer(lengthPtr))+1))
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = pathPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
}

//---------------------------------------------------------------------------
//
// TclpSetInitialEncodings --
//
//	Based on the locale, determine the encoding of the operating system
//	and the default encoding for newly opened files.
//
//	Called at process initialization time, and part way through startup,
//	we verify that the initial encodings were correctly setup. Depending
//	on Tcl's environment, there may not have been enough information first
//	time through (above).
//
// Results:
//	None.
//
// Side effects:
//	The Tcl library path is converted from native encoding to UTF-8, on
//	the first call, and the encodings may be changed on first or second
//	call.
//
//---------------------------------------------------------------------------

func XTclpSetInitialEncodings(tls *libc.TLS) { /* tclUnixInit.c:588:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	// var encodingName Tcl_DString at bp, 216

	XTcl_SetSystemEncoding(tls, uintptr(0),
		XTcl_GetEncodingNameFromEnvironment(tls, bp))
	XTcl_DStringFree(tls, bp)
}

func sSearchKnownEncodings(tls *libc.TLS, encoding uintptr) uintptr { /* tclUnixInit.c:596:19: */
	var left int32 = 0
	var right int32 = int32(uint64(unsafe.Sizeof(localeTable)) / uint64(unsafe.Sizeof(LocaleTable{})))

	for left < right {
		var test int32 = (left + right) / 2
		var code int32 = libc.Xstrcmp(tls, localeTable[test].Flang, encoding)

		if code == 0 {
			return localeTable[test].Fencoding
		}
		if code < 0 {
			left = test + 1
		} else {
			right = test - 1
		}
	}
	return uintptr(0)
}

func XTcl_GetEncodingNameFromEnvironment(tls *libc.TLS, bufPtr uintptr) uintptr { /* tclUnixInit.c:619:12: */
	bp := tls.Alloc(432)
	defer tls.Free(432)

	var encoding uintptr
	var knownEncoding uintptr

	XTcl_DStringInit(tls, bufPtr)

	// Determine the current encoding from the LC_* or LANG environment
	// variables. We previously used setlocale() to determine the locale, but
	// this does not work on some systems (e.g. Linux/i386 RH 5.0).

	if libc.Xsetlocale(tls, 0, ts+2046) != uintptr(0) {
		// var ds Tcl_DString at bp, 216

		// Use a DString so we can modify case.

		XTcl_DStringInit(tls, bp)
		encoding = XTcl_DStringAppend(tls, bp, libc.Xnl_langinfo(tls, CODESET), -1)
		XTcl_UtfToLower(tls, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring)
		knownEncoding = sSearchKnownEncodings(tls, encoding)
		if knownEncoding != uintptr(0) {
			XTcl_DStringAppend(tls, bufPtr, knownEncoding, -1)
		} else if uintptr(0) != XTcl_GetEncoding(tls, uintptr(0), encoding) {
			XTcl_DStringAppend(tls, bufPtr, encoding, -1)
		}
		XTcl_DStringFree(tls, bp)
		if (*Tcl_DString)(unsafe.Pointer(bufPtr)).Flength != 0 {
			return (*Tcl_DString)(unsafe.Pointer(bufPtr)).Fstring
		}
	}

	// Classic fallback check. This tries a homebrew algorithm to determine
	// what encoding should be used based on env vars.

	encoding = libc.Xgetenv(tls, ts+70024)

	if encoding == uintptr(0) || int32(*(*int8)(unsafe.Pointer(encoding))) == 0 {
		encoding = libc.Xgetenv(tls, ts+70031)
	}
	if encoding == uintptr(0) || int32(*(*int8)(unsafe.Pointer(encoding))) == 0 {
		encoding = libc.Xgetenv(tls, ts+70040)
	}
	if encoding == uintptr(0) || int32(*(*int8)(unsafe.Pointer(encoding))) == 0 {
		encoding = uintptr(0)
	}

	if encoding != uintptr(0) {
		var p uintptr
		// var ds Tcl_DString at bp+216, 216

		XTcl_DStringInit(tls, bp+216)
		p = encoding
		encoding = XTcl_DStringAppend(tls, bp+216, p, -1)
		XTcl_UtfToLower(tls, (*Tcl_DString)(unsafe.Pointer(bp+216)).Fstring)

		knownEncoding = sSearchKnownEncodings(tls, encoding)
		if knownEncoding != uintptr(0) {
			XTcl_DStringAppend(tls, bufPtr, knownEncoding, -1)
		} else if uintptr(0) != XTcl_GetEncoding(tls, uintptr(0), encoding) {
			XTcl_DStringAppend(tls, bufPtr, encoding, -1)
		}
		if (*Tcl_DString)(unsafe.Pointer(bufPtr)).Flength != 0 {
			XTcl_DStringFree(tls, bp+216)
			return (*Tcl_DString)(unsafe.Pointer(bufPtr)).Fstring
		}

		// We didn't recognize the full value as an encoding name. If there is
		// an encoding subfield, we can try to guess from that.

		for p = encoding; int32(*(*int8)(unsafe.Pointer(p))) != 0; p++ {
			if int32(*(*int8)(unsafe.Pointer(p))) == '.' {
				p++
				break
			}
		}
		if int32(*(*int8)(unsafe.Pointer(p))) != 0 {
			knownEncoding = sSearchKnownEncodings(tls, p)
			if knownEncoding != uintptr(0) {
				XTcl_DStringAppend(tls, bufPtr, knownEncoding, -1)
			} else if uintptr(0) != XTcl_GetEncoding(tls, uintptr(0), p) {
				XTcl_DStringAppend(tls, bufPtr, p, -1)
			}
		}
		XTcl_DStringFree(tls, bp+216)
		if (*Tcl_DString)(unsafe.Pointer(bufPtr)).Flength != 0 {
			return (*Tcl_DString)(unsafe.Pointer(bufPtr)).Fstring
		}
	}
	return XTcl_DStringAppend(tls, bufPtr, ts+25963, -1)
}

//---------------------------------------------------------------------------
//
// TclpSetVariables --
//
//	Performs platform-specific interpreter initialization related to the
//	tcl_library and tcl_platform variables, and other platform-specific
//	things.
//
// Results:
//	None.
//
// Side effects:
//	Sets "tclDefaultLibrary", "tcl_pkgPath", and "tcl_platform" Tcl
//	variables.
//
//----------------------------------------------------------------------

func XTclpSetVariables(tls *libc.TLS, interp uintptr) { /* tclUnixInit.c:783:1: */
	bp := tls.Alloc(608)
	defer tls.Free(608)

	// var name Utsname at bp, 390

	var unameOK int32
	// var ds Tcl_DString at bp+392, 216

	{
		XTcl_SetVar2(tls, interp, ts+43185, uintptr(0), uintptr(unsafe.Pointer(&pkgPath)), TCL_GLOBAL_ONLY)

	}

	XTcl_SetVar2(tls, interp, ts+6476, ts+33944, ts+70045, TCL_GLOBAL_ONLY)

	unameOK = 0
	if libc.Xuname(tls, bp) >= 0 {
		var native uintptr

		unameOK = 1

		native = XTcl_ExternalToUtfDString(tls, uintptr(0), bp, -1, bp+392)
		XTcl_SetVar2(tls, interp, ts+6476, ts+43141, native, TCL_GLOBAL_ONLY)
		XTcl_DStringFree(tls, bp+392)

		// The following code is a special hack to handle differences in the
		// way version information is returned by uname. On most systems the
		// full version number is available in name.release. However, under
		// AIX the major version number is in name.version and the minor
		// version number is in name.release.

		if libc.Xstrchr(tls, bp+130, '.') != uintptr(0) ||
			!(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(bp + 195)))))*2)))&int32(X_ISdigit) != 0) { // INTL: digit
			XTcl_SetVar2(tls, interp, ts+6476, ts+43144, bp+130,
				TCL_GLOBAL_ONLY)
		} else {
			XTcl_SetVar2(tls, interp, ts+6476, ts+43144, bp+195,
				TCL_GLOBAL_ONLY)
			XTcl_SetVar2(tls, interp, ts+6476, ts+43144, ts+31477,
				TCL_GLOBAL_ONLY|TCL_APPEND_VALUE)
			XTcl_SetVar2(tls, interp, ts+6476, ts+43144, bp+130,
				TCL_GLOBAL_ONLY|TCL_APPEND_VALUE)

		}
		XTcl_SetVar2(tls, interp, ts+6476, ts+43154, bp+260,
			TCL_GLOBAL_ONLY)
	}
	if !(unameOK != 0) {
		XTcl_SetVar2(tls, interp, ts+6476, ts+43141, ts+2046, TCL_GLOBAL_ONLY)
		XTcl_SetVar2(tls, interp, ts+6476, ts+43144, ts+2046, TCL_GLOBAL_ONLY)
		XTcl_SetVar2(tls, interp, ts+6476, ts+43154, ts+2046, TCL_GLOBAL_ONLY)
	}

	/*
	 * Copy the username of the real user (according to getuid()) into
	 * tcl_platform(user).
	 */

	{
		var pwEnt uintptr = XTclpGetPwUid(tls, libc.Xgetuid(tls))
		var user uintptr

		if pwEnt == uintptr(0) {
			user = ts + 2046              /* "" */
			XTcl_DStringInit(tls, bp+392) // ensure cleanliness
		} else {
			user = XTcl_ExternalToUtfDString(tls, uintptr(0), (*Passwd)(unsafe.Pointer(pwEnt)).Fpw_name, -1, bp+392)
		}

		XTcl_SetVar2(tls, interp, ts+6476, ts+43162, user, TCL_GLOBAL_ONLY)
		XTcl_DStringFree(tls, bp+392)

	}

	// Define what the platform PATH separator is. [TIP #315]

	XTcl_SetVar2(tls, interp, ts+6476, ts+70050, ts+18764, TCL_GLOBAL_ONLY)
}

//----------------------------------------------------------------------
//
// TclpFindVariable --
//
//	Locate the entry in environ for a given name. On Unix this routine is
//	case sensetive, on Windows this matches mixed case.
//
// Results:
//	The return value is the index in environ of an entry with the name
//	"name", or -1 if there is no such entry. The integer at *lengthPtr is
//	filled in with the length of name (if a matching entry is found) or
//	the length of the environ array (if no matching entry is found).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpFindVariable(tls *libc.TLS, name uintptr, lengthPtr uintptr) int32 { /* tclUnixInit.c:1011:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var i int32
	var result int32
	var env uintptr
	var p1 uintptr
	var p2 uintptr
	// var envString Tcl_DString at bp, 216
	result = -1

	XTcl_DStringInit(tls, bp)
	i = 0
	env = *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(i)*8))
__1:
	if !(env != uintptr(0)) {
		goto __3
	}
	p1 = XTcl_ExternalToUtfDString(tls, uintptr(0), env, -1, bp)
	p2 = name

__4:
	if !(int32(*(*int8)(unsafe.Pointer(p2))) == int32(*(*int8)(unsafe.Pointer(p1)))) {
		goto __6
	}
	// NULL loop body.
	goto __5
__5:
	p1++
	p2++
	goto __4
	goto __6
__6:
	;
	if !(int32(*(*int8)(unsafe.Pointer(p1))) == '=' && int32(*(*int8)(unsafe.Pointer(p2))) == 0) {
		goto __7
	}
	*(*int32)(unsafe.Pointer(lengthPtr)) = int32((int64(p2) - int64(name)) / 1)
	result = i
	goto done
__7:
	;

	XTcl_DStringFree(tls, bp)
	goto __2
__2:
	i++
	env = *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(i)*8))
	goto __1
	goto __3
__3:
	;

	*(*int32)(unsafe.Pointer(lengthPtr)) = i

done:
	XTcl_DStringFree(tls, bp)
	return result
}

//----------------------------------------------------------------------
//
// MacOSXGetLibraryPath --
//
//	If we have a bundle structure for the Tcl installation, then check
//	there first to see if we can find the libraries there.
//
// Results:
//	TCL_OK if we have found the tcl library; TCL_ERROR otherwise.
//
// Side effects:
//	Same as for Tcl_MacOSXOpenVersionedBundleResources.
//
//----------------------------------------------------------------------

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.14 Signal handling <signal.h>

// This structure is used to keep track of the notifier info for a registered
// file.

type FileHandler1 = struct {
	Ffd          int32
	Fmask        int32
	FreadyMask   int32
	F__ccgo_pad1 [4]byte
	Fproc        uintptr
	FclientData  uintptr
	FnextPtr     uintptr
} /* tclUnixNotfy.c:26:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	ISO C99 Standard: 7.14 Signal handling <signal.h>

// This structure is used to keep track of the notifier info for a registered
// file.

type FileHandler = FileHandler1 /* tclUnixNotfy.c:37:3 */

// The following structure is what is added to the Tcl event queue when file
// handlers are ready to fire.

type FileHandlerEvent1 = struct {
	Fheader      Tcl_Event
	Ffd          int32
	F__ccgo_pad1 [4]byte
} /* tclUnixNotfy.c:44:9 */

// The following structure is what is added to the Tcl event queue when file
// handlers are ready to fire.

type FileHandlerEvent = FileHandlerEvent1 /* tclUnixNotfy.c:52:3 */

// The following structure contains a set of select() masks to track readable,
// writable, and exception conditions.

type SelectMasks1 = struct {
	Freadable  Fd_set
	Fwritable  Fd_set
	Fexception Fd_set
} /* tclUnixNotfy.c:59:9 */

// The following structure contains a set of select() masks to track readable,
// writable, and exception conditions.

type SelectMasks = SelectMasks1 /* tclUnixNotfy.c:63:3 */

// The following static structure contains the state information for the
// select based implementation of the Tcl notifier. One of these structures is
// created for each thread that is using the notifier.

type ThreadSpecificData14 = struct {
	FfirstFileHandlerPtr uintptr
	FcheckMasks          SelectMasks
	FreadyMasks          SelectMasks
	FnumFdBits           int32
	FonList              int32
	FpollState           uint32
	F__ccgo_pad1         [4]byte
	FnextPtr             uintptr
	FprevPtr             uintptr
	FwaitCV              Pthread_cond_t
	FwaitCVinitialized   int32
	FeventReady          int32
} /* tclUnixNotfy.c:112:3 */

var dataKey13 Tcl_ThreadDataKey /* tclUnixNotfy.c:114:26: */

// The following static indicates the number of threads that have initialized
// notifiers.
//
// You must hold the notifierMutex lock before accessing this variable.

var notifierCount int32 = 0 /* tclUnixNotfy.c:124:12 */

// The following variable points to the head of a doubly-linked list of
// ThreadSpecificData structures for all threads that are currently waiting on
// an event.
//
// You must hold the notifierMutex lock before accessing this list.

var waitingListPtr uintptr = uintptr(0) /* tclUnixNotfy.c:134:27 */

// The notifier thread spends all its time in select() waiting for a file
// descriptor associated with one of the threads on the waitingListPtr list to
// do something interesting. But if the contents of the waitingListPtr list
// ever changes, we need to wake up and restart the select() system call. You
// can wake up the notifier thread by writing a single byte to the file
// descriptor defined below. This file descriptor is the input-end of a pipe
// and the notifier thread is listening for data on the output-end of the same
// pipe. Hence writing to this file descriptor will cause the select() system
// call to return and wake up the notifier thread.
//
// You must hold the notifierMutex lock before writing to the pipe.

var triggerPipe int32 = -1 /* tclUnixNotfy.c:150:12 */

// The notifierMutex locks access to all of the global notifier state.

var notifierInitMutex = Pthread_mutex_t{} /* tclUnixNotfy.c:156:24 */
var notifierMutex = Pthread_mutex_t{}     /* tclUnixNotfy.c:157:24 */
// The following static indicates if the notifier thread is running.
//
// You must hold the notifierInitMutex before accessing this variable.

var notifierThreadRunning int32 = 0 /* tclUnixNotfy.c:164:12 */

// The notifier thread signals the notifierCV when it has finished
// initializing the triggerPipe and right before the notifier thread
// terminates.

var notifierCV = Pthread_cond_t{} /* tclUnixNotfy.c:172:23 */

// The pollState bits:
//
// POLL_WANT is set by each thread before it waits on its condition variable.
//	It is checked by the notifier before it does select.
//
// POLL_DONE is set by the notifier if it goes into select after seeing
//	POLL_WANT. The idea is to ensure it tries a select with the same bits
//	the initial thread had set.

// This is the thread ID of the notifier thread that does select.

var notifierThread Tcl_ThreadId /* tclUnixNotfy.c:192:21: */

// Import of Windows API when building threaded with Cygwin.

//----------------------------------------------------------------------
//
// StartNotifierThread --
//
//	Start a notfier thread and wait for the notifier pipe to be created.
//
// Results:
//	None.
//
// Side effects:
//	Running Thread.
//
//----------------------------------------------------------------------
func sStartNotifierThread(tls *libc.TLS, proc uintptr) { /* tclUnixNotfy.c:284:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	if !(notifierThreadRunning != 0) {
		libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&notifierInitMutex)))
		if !(notifierThreadRunning != 0) {
			if XTclpThreadCreate(tls, uintptr(unsafe.Pointer(&notifierThread)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sNotifierThreadProc})), uintptr(0),
				0, 0001) != TCL_OK {
				XTcl_Panic(tls, ts+70064, libc.VaList(bp, proc))
			}

			libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&notifierMutex)))
			// Wait for the notifier pipe to be created.

			for triggerPipe < 0 {
				libc.Xpthread_cond_wait(tls, uintptr(unsafe.Pointer(&notifierCV)), uintptr(unsafe.Pointer(&notifierMutex)))
			}
			libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&notifierMutex)))

			notifierThreadRunning = 1
		}
		libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&notifierInitMutex)))
	}
}

//----------------------------------------------------------------------
//
// Tcl_InitNotifier --
//
//	Initializes the platform specific notifier state.
//
// Results:
//	Returns a handle to the notifier state for this thread.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_InitNotifier(tls *libc.TLS) uintptr { /* tclUnixNotfy.c:327:6: */
	if XtclNotifierHooks.FinitNotifierProc != 0 {
		return (*struct{ f func(*libc.TLS) ClientData })(unsafe.Pointer(&struct{ uintptr }{XtclNotifierHooks.FinitNotifierProc})).f(tls)
	} else {
		var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey13)), int32(unsafe.Sizeof(ThreadSpecificData14{})))

		(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FeventReady = 0

		// Initialize thread specific condition variable for this thread.
		if (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FwaitCVinitialized == 0 {
			libc.Xpthread_cond_init(tls, tsdPtr+808, uintptr(0))
			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FwaitCVinitialized = 1
		}

		libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&notifierInitMutex)))

		notifierCount++
		libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&notifierInitMutex)))

		return tsdPtr
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_FinalizeNotifier --
//
//	This function is called to cleanup the notifier state before a thread
//	is terminated.
//
// Results:
//	None.
//
// Side effects:
//	May terminate the background notifier thread if this is the last
//	notifier instance.
//
//----------------------------------------------------------------------

func XTcl_FinalizeNotifier(tls *libc.TLS, clientData uintptr) { /* tclUnixNotfy.c:412:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	if XtclNotifierHooks.FfinalizeNotifierProc != 0 {
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{XtclNotifierHooks.FfinalizeNotifierProc})).f(tls, clientData)
		return
	} else {
		var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey13)), int32(unsafe.Sizeof(ThreadSpecificData14{})))

		libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&notifierInitMutex)))
		notifierCount--

		// If this is the last thread to use the notifier, close the notifier
		// pipe and wait for the background thread to terminate.

		if notifierCount == 0 && triggerPipe != -1 {
			if libc.Xwrite(tls, triggerPipe, ts+22780, uint64(1)) != int64(1) {
				XTcl_Panic(tls, ts+70100,
					libc.VaList(bp, ts+70125))
			}
			libc.Xclose(tls, triggerPipe)
			libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&notifierMutex)))
			for triggerPipe != -1 {
				libc.Xpthread_cond_wait(tls, uintptr(unsafe.Pointer(&notifierCV)), uintptr(unsafe.Pointer(&notifierMutex)))
			}
			libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&notifierMutex)))
			if notifierThreadRunning != 0 {
				var result int32 = libc.Xpthread_join(tls, uint64(notifierThread), uintptr(0))

				if result != 0 {
					XTcl_Panic(tls, ts+70100,
						libc.VaList(bp+8, ts+70160))
				}
				notifierThreadRunning = 0
			}
		}

		// Clean up any synchronization objects in the thread local storage.

		libc.Xpthread_cond_destroy(tls, tsdPtr+808)
		(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FwaitCVinitialized = 0

		libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&notifierInitMutex)))
	}
}

//----------------------------------------------------------------------
//
// Tcl_AlertNotifier --
//
//	Wake up the specified notifier from any thread. This routine is called
//	by the platform independent notifier code whenever the Tcl_ThreadAlert
//	routine is called. This routine is guaranteed not to be called on a
//	given notifier after Tcl_FinalizeNotifier is called for that notifier.
//
// Results:
//	None.
//
// Side effects:
//	Signals the notifier condition variable for the specified notifier.
//
//----------------------------------------------------------------------

func XTcl_AlertNotifier(tls *libc.TLS, clientData uintptr) { /* tclUnixNotfy.c:489:1: */
	if XtclNotifierHooks.FalertNotifierProc != 0 {
		(*struct{ f func(*libc.TLS, ClientData) })(unsafe.Pointer(&struct{ uintptr }{XtclNotifierHooks.FalertNotifierProc})).f(tls, clientData)
		return
	} else {
		var tsdPtr uintptr = clientData

		libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&notifierMutex)))
		(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FeventReady = 1

		libc.Xpthread_cond_broadcast(tls, tsdPtr+808)
		libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&notifierMutex)))
	}
}

//----------------------------------------------------------------------
//
// Tcl_SetTimer --
//
//	This function sets the current notifier timer value. This interface is
//	not implemented in this notifier because we are always running inside
//	of Tcl_DoOneEvent.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_SetTimer(tls *libc.TLS, timePtr uintptr) { /* tclUnixNotfy.c:531:1: */
	if XtclNotifierHooks.FsetTimerProc != 0 {
		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{XtclNotifierHooks.FsetTimerProc})).f(tls, timePtr)
		return
	} else {
		// The interval timer doesn't do anything in this implementation,
		// because the only event loop is via Tcl_DoOneEvent, which passes
		// timeout values to Tcl_WaitForEvent.
	}
}

//----------------------------------------------------------------------
//
// Tcl_ServiceModeHook --
//
//	This function is invoked whenever the service mode changes.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ServiceModeHook(tls *libc.TLS, mode int32) { /* tclUnixNotfy.c:563:1: */
	if XtclNotifierHooks.FserviceModeHookProc != 0 {
		(*struct{ f func(*libc.TLS, int32) })(unsafe.Pointer(&struct{ uintptr }{XtclNotifierHooks.FserviceModeHookProc})).f(tls, mode)
		return
	} else if mode == TCL_SERVICE_ALL {
		sStartNotifierThread(tls, ts+70191)
	}
}

//----------------------------------------------------------------------
//
// Tcl_CreateFileHandler --
//
//	This function registers a file handler with the select notifier.
//
// Results:
//	None.
//
// Side effects:
//	Creates a new file handler structure.
//
//----------------------------------------------------------------------

func XTcl_CreateFileHandler(tls *libc.TLS, fd int32, mask int32, proc uintptr, clientData uintptr) { /* tclUnixNotfy.c:594:1: */
	if XtclNotifierHooks.FcreateFileHandlerProc != 0 {
		(*struct {
			f func(*libc.TLS, int32, int32, uintptr, ClientData)
		})(unsafe.Pointer(&struct{ uintptr }{XtclNotifierHooks.FcreateFileHandlerProc})).f(tls, fd, mask, proc, clientData)
		return
	} else {
		var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey13)), int32(unsafe.Sizeof(ThreadSpecificData14{})))
		var filePtr uintptr

		for filePtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FfirstFileHandlerPtr; filePtr != uintptr(0); filePtr = (*FileHandler)(unsafe.Pointer(filePtr)).FnextPtr {
			if (*FileHandler)(unsafe.Pointer(filePtr)).Ffd == fd {
				break
			}
		}
		if filePtr == uintptr(0) {
			filePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FileHandler{})))
			(*FileHandler)(unsafe.Pointer(filePtr)).Ffd = fd
			(*FileHandler)(unsafe.Pointer(filePtr)).FreadyMask = 0
			(*FileHandler)(unsafe.Pointer(filePtr)).FnextPtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FfirstFileHandlerPtr
			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FfirstFileHandlerPtr = filePtr
		}
		(*FileHandler)(unsafe.Pointer(filePtr)).Fproc = proc
		(*FileHandler)(unsafe.Pointer(filePtr)).FclientData = clientData
		(*FileHandler)(unsafe.Pointer(filePtr)).Fmask = mask

		// Update the check masks for this file.

		if mask&(int32(1)<<1) != 0 {
			*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		} else {
			*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) &= ^X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		}
		if mask&(int32(1)<<2) != 0 {
			*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 128 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		} else {
			*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 128 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) &= ^X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		}
		if mask&(int32(1)<<3) != 0 {
			*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 256 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		} else {
			*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 256 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) &= ^X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		}
		if (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnumFdBits <= fd {
			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnumFdBits = fd + 1
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_DeleteFileHandler --
//
//	Cancel a previously-arranged callback arrangement for a file.
//
// Results:
//	None.
//
// Side effects:
//	If a callback was previously registered on file, remove it.
//
//----------------------------------------------------------------------

func XTcl_DeleteFileHandler(tls *libc.TLS, fd int32) { /* tclUnixNotfy.c:670:1: */
	if XtclNotifierHooks.FdeleteFileHandlerProc != 0 {
		(*struct{ f func(*libc.TLS, int32) })(unsafe.Pointer(&struct{ uintptr }{XtclNotifierHooks.FdeleteFileHandlerProc})).f(tls, fd)
		return
	} else {
		var filePtr uintptr
		var prevPtr uintptr
		var i int32
		var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey13)), int32(unsafe.Sizeof(ThreadSpecificData14{})))

		// Find the entry for the given file (and return if there isn't one).

		prevPtr = uintptr(0)
		filePtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FfirstFileHandlerPtr
	__1:
		;
		{
			if filePtr == uintptr(0) {
				return
			}
			if (*FileHandler)(unsafe.Pointer(filePtr)).Ffd == fd {
				goto __3
			}

		}
		goto __2
	__2:
		prevPtr = filePtr
		filePtr = (*FileHandler)(unsafe.Pointer(filePtr)).FnextPtr
		goto __1
		goto __3
	__3:
		;

		// Update the check masks for this file.

		if (*FileHandler)(unsafe.Pointer(filePtr)).Fmask&(int32(1)<<1) != 0 {
			*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) &= ^X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		}
		if (*FileHandler)(unsafe.Pointer(filePtr)).Fmask&(int32(1)<<2) != 0 {
			*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 128 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) &= ^X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		}
		if (*FileHandler)(unsafe.Pointer(filePtr)).Fmask&(int32(1)<<3) != 0 {
			*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 256 + uintptr(fd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) &= ^X__fd_mask(uint64(1) << (fd % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
		}

		// Find current max fd.

		if fd+1 == (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnumFdBits {
			var numFdBits int32 = 0

			for i = fd - 1; i >= 0; i-- {
				if *(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) ||
					*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 128 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) ||
					*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 256 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
					numFdBits = i + 1
					break
				}
			}
			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnumFdBits = numFdBits
		}

		// Clean up information in the callback record.

		if prevPtr == uintptr(0) {
			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FfirstFileHandlerPtr = (*FileHandler)(unsafe.Pointer(filePtr)).FnextPtr
		} else {
			(*FileHandler)(unsafe.Pointer(prevPtr)).FnextPtr = (*FileHandler)(unsafe.Pointer(filePtr)).FnextPtr
		}
		XTclpFree(tls, filePtr)
	}
}

//----------------------------------------------------------------------
//
// FileHandlerEventProc --
//
//	This function is called by Tcl_ServiceEvent when a file event reaches
//	the front of the event queue. This function is responsible for
//	actually handling the event by invoking the callback for the file
//	handler.
//
// Results:
//	Returns 1 if the event was handled, meaning it should be removed from
//	the queue. Returns 0 if the event was not handled, meaning it should
//	stay on the queue. The only time the event isn't handled is if the
//	TCL_FILE_EVENTS flag bit isn't set.
//
// Side effects:
//	Whatever the file handler's callback function does.
//
//----------------------------------------------------------------------

func sFileHandlerEventProc(tls *libc.TLS, evPtr uintptr, flags int32) int32 { /* tclUnixNotfy.c:764:1: */
	var mask int32
	var filePtr uintptr
	var fileEvPtr uintptr = evPtr
	var tsdPtr uintptr

	if !(flags&(int32(1)<<3) != 0) {
		return 0
	}

	// Search through the file handlers to find the one whose handle matches
	// the event. We do this rather than keeping a pointer to the file handler
	// directly in the event, so that the handler can be deleted while the
	// event is queued without leaving a dangling pointer.

	tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey13)), int32(unsafe.Sizeof(ThreadSpecificData14{})))

	for filePtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FfirstFileHandlerPtr; filePtr != uintptr(0); filePtr = (*FileHandler)(unsafe.Pointer(filePtr)).FnextPtr {
		if (*FileHandler)(unsafe.Pointer(filePtr)).Ffd != (*FileHandlerEvent)(unsafe.Pointer(fileEvPtr)).Ffd {
			continue
		}

		// The code is tricky for two reasons:
		// 1. The file handler's desired events could have changed since the
		//    time when the event was queued, so AND the ready mask with the
		//    desired mask.
		// 2. The file could have been closed and re-opened since the time
		//    when the event was queued. This is why the ready mask is stored
		//    in the file handler rather than the queued event: it will be
		//    zeroed when a new file handler is created for the newly opened
		//    file.

		mask = (*FileHandler)(unsafe.Pointer(filePtr)).FreadyMask & (*FileHandler)(unsafe.Pointer(filePtr)).Fmask
		(*FileHandler)(unsafe.Pointer(filePtr)).FreadyMask = 0
		if mask != 0 {
			(*struct {
				f func(*libc.TLS, ClientData, int32)
			})(unsafe.Pointer(&struct{ uintptr }{(*FileHandler)(unsafe.Pointer(filePtr)).Fproc})).f(tls, (*FileHandler)(unsafe.Pointer(filePtr)).FclientData, mask)
		}
		break
	}
	return 1
}

//----------------------------------------------------------------------
//
// Tcl_WaitForEvent --
//
//	This function is called by Tcl_DoOneEvent to wait for new events on
//	the message queue. If the block time is 0, then Tcl_WaitForEvent just
//	polls without blocking.
//
// Results:
//	Returns -1 if the select would block forever, otherwise returns 0.
//
// Side effects:
//	Queues file events that are detected by the select.
//
//----------------------------------------------------------------------

func XTcl_WaitForEvent(tls *libc.TLS, timePtr uintptr) int32 { /* tclUnixNotfy.c:859:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	if XtclNotifierHooks.FwaitForEventProc != 0 {
		return (*struct {
			f func(*libc.TLS, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{XtclNotifierHooks.FwaitForEventProc})).f(tls, timePtr)
	} else {
		var filePtr uintptr
		var mask int32
		// var vTime Tcl_Time at bp+16, 16

		var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey13)), int32(unsafe.Sizeof(ThreadSpecificData14{})))
		var waitForFiles int32

		// Set up the timeout structure. Note that if there are no events to
		// check for, we return with a negative result rather than blocking
		// forever.

		if timePtr != uintptr(0) {
			// TIP #233 (Virtualized Time). Is virtual time in effect? And do
			// we actually have something to scale? If yes to both then we
			// call the handler to do this scaling.

			if (*Tcl_Time)(unsafe.Pointer(timePtr)).Fsec != int64(0) || (*Tcl_Time)(unsafe.Pointer(timePtr)).Fusec != int64(0) {
				*(*Tcl_Time)(unsafe.Pointer(bp + 16 /* vTime */)) = *(*Tcl_Time)(unsafe.Pointer(timePtr))
				(*struct {
					f func(*libc.TLS, uintptr, ClientData)
				})(unsafe.Pointer(&struct{ uintptr }{XtclScaleTimeProcPtr})).f(tls, bp+16 /* &vTime */, XtclTimeClientData)
				timePtr = bp + 16 /* &vTime */
			}
		}

		// Start notifier thread and place this thread on the list of
		// interested threads, signal the notifier thread, and wait for a
		// response or a timeout.
		sStartNotifierThread(tls, ts+70211)

		libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&notifierMutex)))

		if timePtr != uintptr(0) && (*Tcl_Time)(unsafe.Pointer(timePtr)).Fsec == int64(0) && (*Tcl_Time)(unsafe.Pointer(timePtr)).Fusec == int64(0) {
			// Cannot emulate a polling select with a polling condition
			// variable. Instead, pretend to wait for files and tell the
			// notifier thread what we are doing. The notifier thread makes
			// sure it goes through select with its select mask in the same
			// state as ours currently is. We block until that happens.

			waitForFiles = 1
			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FpollState = uint32(POLL_WANT)
			timePtr = uintptr(0)
		} else {
			waitForFiles = libc.Bool32((*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnumFdBits > 0)
			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FpollState = uint32(0)
		}

		if waitForFiles != 0 {
			// Add the ThreadSpecificData structure of this thread to the list
			// of ThreadSpecificData structures of all threads that are
			// waiting on file events.

			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr = waitingListPtr
			if waitingListPtr != 0 {
				(*ThreadSpecificData14)(unsafe.Pointer(waitingListPtr)).FprevPtr = tsdPtr
			}
			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FprevPtr = uintptr(0)
			waitingListPtr = tsdPtr
			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FonList = 1

			if libc.Xwrite(tls, triggerPipe, ts+2046, uint64(1)) == int64(-1) && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != EAGAIN {
				XTcl_Panic(tls, ts+70228,
					libc.VaList(bp, ts+70249))
			}
		}

		libc.X__builtin_memset(tls, tsdPtr+392, 0, uint64(unsafe.Sizeof(Fd_set{})))
		libc.X__builtin_memset(tls, tsdPtr+392+128, 0, uint64(unsafe.Sizeof(Fd_set{})))
		libc.X__builtin_memset(tls, tsdPtr+392+256, 0, uint64(unsafe.Sizeof(Fd_set{})))

		if !((*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FeventReady != 0) {
			if timePtr != uintptr(0) {
				// var now Tcl_Time at bp+32, 16

				// var ptime Timespec at bp+48, 16

				XTcl_GetTime(tls, bp+32)
				(*Timespec)(unsafe.Pointer(bp + 48 /* &ptime */)).Ftv_sec = (*Tcl_Time)(unsafe.Pointer(timePtr)).Fsec + (*Tcl_Time)(unsafe.Pointer(bp+32)).Fsec + ((*Tcl_Time)(unsafe.Pointer(timePtr)).Fusec+(*Tcl_Time)(unsafe.Pointer(bp+32)).Fusec)/int64(1000000)
				(*Timespec)(unsafe.Pointer(bp + 48 /* &ptime */)).Ftv_nsec = int64(1000) * (((*Tcl_Time)(unsafe.Pointer(timePtr)).Fusec + (*Tcl_Time)(unsafe.Pointer(bp+32)).Fusec) % int64(1000000))

				libc.Xpthread_cond_timedwait(tls, tsdPtr+808, uintptr(unsafe.Pointer(&notifierMutex)), bp+48)
			} else {
				libc.Xpthread_cond_wait(tls, tsdPtr+808, uintptr(unsafe.Pointer(&notifierMutex)))
			}
		}
		(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FeventReady = 0

		if waitForFiles != 0 && (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FonList != 0 {
			// Remove the ThreadSpecificData structure of this thread from the
			// waiting list. Alert the notifier thread to recompute its select
			// masks - skipping this caused a hang when trying to close a pipe
			// which the notifier thread was still doing a select on.

			if (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FprevPtr != 0 {
				(*struct {
					FfirstFileHandlerPtr uintptr
					FcheckMasks          SelectMasks
					FreadyMasks          SelectMasks
					FnumFdBits           int32
					FonList              int32
					FpollState           uint32
					F__ccgo_pad1         [4]byte
					FnextPtr             uintptr
					FprevPtr             uintptr
					FwaitCV              Pthread_cond_t
					FwaitCVinitialized   int32
					FeventReady          int32
				})(unsafe.Pointer((*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FprevPtr)).FnextPtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr
			} else {
				waitingListPtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr
			}
			if (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr != 0 {
				(*struct {
					FfirstFileHandlerPtr uintptr
					FcheckMasks          SelectMasks
					FreadyMasks          SelectMasks
					FnumFdBits           int32
					FonList              int32
					FpollState           uint32
					F__ccgo_pad1         [4]byte
					FnextPtr             uintptr
					FprevPtr             uintptr
					FwaitCV              Pthread_cond_t
					FwaitCVinitialized   int32
					FeventReady          int32
				})(unsafe.Pointer((*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr)).FprevPtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FprevPtr
			}
			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr = libc.AssignPtrUintptr(tsdPtr+800, uintptr(0))
			(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FonList = 0
			if libc.Xwrite(tls, triggerPipe, ts+2046, uint64(1)) == int64(-1) && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != EAGAIN {
				XTcl_Panic(tls, ts+70228,
					libc.VaList(bp+8, ts+70249))
			}
		}

		// Queue all detected file events before returning.

		for filePtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FfirstFileHandlerPtr; filePtr != uintptr(0); filePtr = (*FileHandler)(unsafe.Pointer(filePtr)).FnextPtr {
			mask = 0
			if *(*X__fd_mask)(unsafe.Pointer(tsdPtr + 392 + uintptr((*FileHandler)(unsafe.Pointer(filePtr)).Ffd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<((*FileHandler)(unsafe.Pointer(filePtr)).Ffd%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
				mask = mask | int32(1)<<1
			}
			if *(*X__fd_mask)(unsafe.Pointer(tsdPtr + 392 + 128 + uintptr((*FileHandler)(unsafe.Pointer(filePtr)).Ffd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<((*FileHandler)(unsafe.Pointer(filePtr)).Ffd%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
				mask = mask | int32(1)<<2
			}
			if *(*X__fd_mask)(unsafe.Pointer(tsdPtr + 392 + 256 + uintptr((*FileHandler)(unsafe.Pointer(filePtr)).Ffd/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<((*FileHandler)(unsafe.Pointer(filePtr)).Ffd%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
				mask = mask | int32(1)<<3
			}

			if !(mask != 0) {
				continue
			}

			// Don't bother to queue an event if the mask was previously
			// non-zero since an event must still be on the queue.

			if (*FileHandler)(unsafe.Pointer(filePtr)).FreadyMask == 0 {
				var fileEvPtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(FileHandlerEvent{})))

				(*FileHandlerEvent)(unsafe.Pointer(fileEvPtr)).Fheader.Fproc = *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, uintptr, int32) int32
				}{sFileHandlerEventProc}))
				(*FileHandlerEvent)(unsafe.Pointer(fileEvPtr)).Ffd = (*FileHandler)(unsafe.Pointer(filePtr)).Ffd
				XTcl_QueueEvent(tls, fileEvPtr, TCL_QUEUE_TAIL)
			}
			(*FileHandler)(unsafe.Pointer(filePtr)).FreadyMask = mask
		}
		libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&notifierMutex)))
		return 0
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// NotifierThreadProc --
//
//	This routine is the initial (and only) function executed by the
//	special notifier thread. Its job is to wait for file descriptors to
//	become readable or writable or to have an exception condition and then
//	to notify other threads who are interested in this information by
//	signalling a condition variable. Other threads can signal this
//	notifier thread of a change in their interests by writing a single
//	byte to a special pipe that the notifier thread is monitoring.
//
// Result:
//	None. Once started, this routine never exits. It dies with the overall
//	process.
//
// Side effects:
//	The trigger pipe used to signal the notifier thread is created when
//	the notifier thread first starts.
//
//----------------------------------------------------------------------

func sNotifierThreadProc(tls *libc.TLS, dummy uintptr) { /* tclUnixNotfy.c:1146:1: */
	bp := tls.Alloc(466)
	defer tls.Free(466)

	var tsdPtr uintptr
	// var readableMask Fd_set at bp+64, 128

	// var writableMask Fd_set at bp+192, 128

	// var exceptionMask Fd_set at bp+320, 128

	var i int32
	// var fds [2]int32 at bp+56, 8

	var receivePipe int32
	var found int64
	*(*Timeval)(unsafe.Pointer(bp + 448 /* poll */)) = Timeval{}
	var timePtr uintptr
	// var buf [2]int8 at bp+464, 2

	var numFdBits int32 = 0
	_ = dummy

	if libc.Xpipe(tls, bp+56) != 0 {
		XTcl_Panic(tls, ts+70280, libc.VaList(bp, ts+70303))
	}

	receivePipe = *(*int32)(unsafe.Pointer(bp + 56))

	if XTclUnixSetBlockingMode(tls, receivePipe, TCL_MODE_NONBLOCKING) < 0 {
		XTcl_Panic(tls, ts+70280,
			libc.VaList(bp+8, ts+70333))
	}
	if XTclUnixSetBlockingMode(tls, *(*int32)(unsafe.Pointer(bp + 56 + 1*4)), TCL_MODE_NONBLOCKING) < 0 {
		XTcl_Panic(tls, ts+70280,
			libc.VaList(bp+16, ts+70374))
	}
	if libc.Xfcntl(tls, receivePipe, F_SETFD, libc.VaList(bp+24, FD_CLOEXEC)) < 0 {
		XTcl_Panic(tls, ts+70280,
			libc.VaList(bp+32, ts+70415))
	}
	if libc.Xfcntl(tls, *(*int32)(unsafe.Pointer(bp + 56 + 1*4)), F_SETFD, libc.VaList(bp+40, FD_CLOEXEC)) < 0 {
		XTcl_Panic(tls, ts+70280,
			libc.VaList(bp+48, ts+70457))
	}

	// Install the write end of the pipe into the global variable.

	libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&notifierMutex)))
	triggerPipe = *(*int32)(unsafe.Pointer(bp + 56 + 1*4))

	// Signal any threads that are waiting.

	libc.Xpthread_cond_broadcast(tls, uintptr(unsafe.Pointer(&notifierCV)))
	libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&notifierMutex)))

	// Look for file events and report them to interested threads.

	for 1 != 0 {
		libc.X__builtin_memset(tls, bp+64, 0, uint64(unsafe.Sizeof(Fd_set{})))
		libc.X__builtin_memset(tls, bp+192, 0, uint64(unsafe.Sizeof(Fd_set{})))
		libc.X__builtin_memset(tls, bp+320, 0, uint64(unsafe.Sizeof(Fd_set{})))

		// Compute the logical OR of the masks from all the waiting
		// notifiers.

		libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&notifierMutex)))
		timePtr = uintptr(0)
		for tsdPtr = waitingListPtr; tsdPtr != 0; tsdPtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr {
			for i = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnumFdBits - 1; i >= 0; i-- {
				if *(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
					*(*X__fd_mask)(unsafe.Pointer(bp + 64 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (i % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
				}
				if *(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 128 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
					*(*X__fd_mask)(unsafe.Pointer(bp + 192 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (i % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
				}
				if *(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 256 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
					*(*X__fd_mask)(unsafe.Pointer(bp + 320 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (i % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
				}
			}
			if (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnumFdBits > numFdBits {
				numFdBits = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnumFdBits
			}
			if (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FpollState&uint32(POLL_WANT) != 0 {
				// Here we make sure we go through select() with the same mask
				// bits that were present when the thread tried to poll.

				*(*uint32)(unsafe.Pointer(tsdPtr + 784)) |= uint32(POLL_DONE)
				timePtr = bp + 448 /* &poll */
			}
		}
		libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&notifierMutex)))

		// Set up the select mask to include the receive pipe.

		if receivePipe >= numFdBits {
			numFdBits = receivePipe + 1
		}
		*(*X__fd_mask)(unsafe.Pointer(bp + 64 + uintptr(receivePipe/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (receivePipe % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))

		if libc.Xselect(tls, numFdBits, bp+64, bp+192, bp+320,
			timePtr) == -1 {
			// Try again immediately on an error.

			continue
		}

		// Alert any threads that are waiting on a ready file descriptor.

		libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&notifierMutex)))
		for tsdPtr = waitingListPtr; tsdPtr != 0; tsdPtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr {
			found = int64(0)

			for i = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnumFdBits - 1; i >= 0; i-- {
				if *(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) &&
					*(*X__fd_mask)(unsafe.Pointer(bp + 64 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
					*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 392 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (i % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
					found = int64(1)
				}
				if *(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 128 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) &&
					*(*X__fd_mask)(unsafe.Pointer(bp + 192 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
					*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 392 + 128 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (i % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
					found = int64(1)
				}
				if *(*X__fd_mask)(unsafe.Pointer(tsdPtr + 8 + 256 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) &&
					*(*X__fd_mask)(unsafe.Pointer(bp + 320 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(i%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
					*(*X__fd_mask)(unsafe.Pointer(tsdPtr + 392 + 256 + uintptr(i/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8)) |= X__fd_mask(uint64(1) << (i % (8 * int32(unsafe.Sizeof(X__fd_mask(0))))))
					found = int64(1)
				}
			}

			if found != 0 || (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FpollState&uint32(POLL_DONE) != 0 {
				(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FeventReady = 1
				if (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FonList != 0 {
					// Remove the ThreadSpecificData structure of this thread
					// from the waiting list. This prevents us from
					// continuously spining on select until the other threads
					// runs and services the file event.

					if (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FprevPtr != 0 {
						(*struct {
							FfirstFileHandlerPtr uintptr
							FcheckMasks          SelectMasks
							FreadyMasks          SelectMasks
							FnumFdBits           int32
							FonList              int32
							FpollState           uint32
							F__ccgo_pad1         [4]byte
							FnextPtr             uintptr
							FprevPtr             uintptr
							FwaitCV              Pthread_cond_t
							FwaitCVinitialized   int32
							FeventReady          int32
						})(unsafe.Pointer((*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FprevPtr)).FnextPtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr
					} else {
						waitingListPtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr
					}
					if (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr != 0 {
						(*struct {
							FfirstFileHandlerPtr uintptr
							FcheckMasks          SelectMasks
							FreadyMasks          SelectMasks
							FnumFdBits           int32
							FonList              int32
							FpollState           uint32
							F__ccgo_pad1         [4]byte
							FnextPtr             uintptr
							FprevPtr             uintptr
							FwaitCV              Pthread_cond_t
							FwaitCVinitialized   int32
							FeventReady          int32
						})(unsafe.Pointer((*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr)).FprevPtr = (*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FprevPtr
					}
					(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FnextPtr = libc.AssignPtrUintptr(tsdPtr+800, uintptr(0))
					(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FonList = 0
					(*ThreadSpecificData14)(unsafe.Pointer(tsdPtr)).FpollState = uint32(0)
				}
				libc.Xpthread_cond_broadcast(tls, tsdPtr+808)
			}
		}
		libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&notifierMutex)))

		// Consume the next byte from the notifier pipe if the pipe was
		// readable. Note that there may be multiple bytes pending, but to
		// avoid a race condition we only read one at a time.

		if *(*X__fd_mask)(unsafe.Pointer(bp + 64 + uintptr(receivePipe/(8*int32(unsafe.Sizeof(X__fd_mask(0)))))*8))&X__fd_mask(uint64(1)<<(receivePipe%(8*int32(unsafe.Sizeof(X__fd_mask(0)))))) != int64(0) {
			i = int32(libc.Xread(tls, receivePipe, bp+464, uint64(1)))

			if i == 0 || i == 1 && int32(*(*int8)(unsafe.Pointer(bp + 464))) == 'q' {
				// Someone closed the write end of the pipe or sent us a Quit
				// message [Bug: 4139] and then closed the write end of the
				// pipe so we need to shut down the notifier thread.

				break
			}
		}
	}

	// Clean up the read end of the pipe and signal any threads waiting on
	// termination of the notifier thread.

	libc.Xclose(tls, receivePipe)
	libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&notifierMutex)))
	triggerPipe = -1
	libc.Xpthread_cond_broadcast(tls, uintptr(unsafe.Pointer(&notifierCV)))
	libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&notifierMutex)))

	XTclpThreadExit(tls, 0)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The following macros convert between TclFile's and fd's. The conversion
// simple involves shifting fd's up by one to ensure that no valid fd is ever
// the same as NULL.

// This structure describes per-instance state of a pipe based channel.

type PipeState1 = struct {
	Fchannel       Tcl_Channel
	FinFile        TclFile
	FoutFile       TclFile
	FerrorFile     TclFile
	FnumPids       int32
	F__ccgo_pad1   [4]byte
	FpidPtr        uintptr
	FisNonBlocking int32
	F__ccgo_pad2   [4]byte
} /* tclUnixPipe.c:33:9 */

// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The following macros convert between TclFile's and fd's. The conversion
// simple involves shifting fd's up by one to ensure that no valid fd is ever
// the same as NULL.

// This structure describes per-instance state of a pipe based channel.

type PipeState = PipeState1 /* tclUnixPipe.c:45:3 */

// This structure describes the channel type structure for command pipe based
// I/O:

var pipeChannelType = Tcl_ChannelType{
	FtypeName:      ts + 35642,
	Fversion:       uintptr(0x5),
	FcloseProc:     uintptr(1),
	FinputProc:     0, // Input proc.
	FoutputProc:    0, // Get option proc.
	FwatchProc:     0, // Initialize notifier.
	FgetHandleProc: 0, // Get OS handles out of channel.
	Fclose2Proc:    0, // close2proc.
	FblockModeProc: 0, // truncation
} /* tclUnixPipe.c:69:30 */

//----------------------------------------------------------------------
//
// TclpMakeFile --
//
//	Make a TclFile from a channel.
//
// Results:
//	Returns a new TclFile or NULL on failure.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpMakeFile(tls *libc.TLS, channel Tcl_Channel, direction int32) TclFile { /* tclUnixPipe.c:106:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var data ClientData at bp, 8

	if XTcl_GetChannelHandle(tls, channel, direction, bp) != TCL_OK {
		return uintptr(0)
	}

	return uintptr(Intptr_t(int32(*(*ClientData)(unsafe.Pointer(bp))) + 1))
}

//----------------------------------------------------------------------
//
// TclpOpenFile --
//
//	Open a file for use in a pipeline.
//
// Results:
//	Returns a new TclFile handle or NULL on failure.
//
// Side effects:
//	May cause a file to be created on the file system.
//
//----------------------------------------------------------------------

func XTclpOpenFile(tls *libc.TLS, fname uintptr, mode int32) TclFile { /* tclUnixPipe.c:136:1: */
	bp := tls.Alloc(232)
	defer tls.Free(232)

	var fd int32
	var native uintptr
	// var ds Tcl_DString at bp+16, 216

	native = XTcl_UtfToExternalDString(tls, uintptr(0), fname, -1, bp+16)
	fd = libc.Xopen(tls, native, mode, libc.VaList(bp, 0666)) // INTL: Native.
	XTcl_DStringFree(tls, bp+16)
	if fd != -1 {
		libc.Xfcntl(tls, fd, F_SETFD, libc.VaList(bp+8, FD_CLOEXEC))

		// If the file is being opened for writing, seek to the end so we can
		// append to any data already in the file.

		if mode&O_WRONLY != 0 && !(mode&O_APPEND != 0) {
			libc.Xlseek(tls, fd, int64(0), SEEK_END)
		}

		// Increment the fd so it can't be 0, which would conflict with the
		// NULL return for errors.

		return uintptr(Intptr_t(fd + 1))
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// TclpCreateTempFile --
//
//	This function creates a temporary file initialized with an optional
//	string, and returns a file handle with the file pointer at the
//	beginning of the file.
//
// Results:
//	A handle to a file.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpCreateTempFile(tls *libc.TLS, contents uintptr) TclFile { /* tclUnixPipe.c:188:1: */
	bp := tls.Alloc(224)
	defer tls.Free(224)

	var fd int32 = XTclUnixOpenTemporaryFile(tls, uintptr(0), uintptr(0), uintptr(0), uintptr(0))

	if fd == -1 {
		return uintptr(0)
	}
	libc.Xfcntl(tls, fd, F_SETFD, libc.VaList(bp, FD_CLOEXEC))
	if contents != uintptr(0) {
		// var dstring Tcl_DString at bp+8, 216

		var native uintptr

		native = XTcl_UtfToExternalDString(tls, uintptr(0), contents, -1, bp+8)
		if libc.Xwrite(tls, fd, native, uint64((*Tcl_DString)(unsafe.Pointer(bp+8)).Flength)) == int64(-1) {
			libc.Xclose(tls, fd)
			XTcl_DStringFree(tls, bp+8)
			return uintptr(0)
		}
		XTcl_DStringFree(tls, bp+8)
		libc.Xlseek(tls, fd, int64(0), SEEK_SET)
	}
	return uintptr(Intptr_t(fd + 1))
}

//----------------------------------------------------------------------
//
// TclpTempFileName --
//
//	This function returns unique filename.
//
// Results:
//	Returns a valid Tcl_Obj* with refCount 0, or NULL on failure.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpTempFileName(tls *libc.TLS) uintptr { /* tclUnixPipe.c:229:9: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var retVal uintptr
	var nameObj uintptr
	var fd int32

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			nameObj = XTclThreadAllocObj(tls)
		} else {
			nameObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(nameObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(nameObj)).FtypePtr = uintptr(0)
	{
	}

	(*Tcl_Obj)(unsafe.Pointer(nameObj)).FrefCount++
	fd = XTclUnixOpenTemporaryFile(tls, uintptr(0), uintptr(0), uintptr(0), nameObj)
	if fd == -1 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = nameObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		return uintptr(0)
	}

	libc.Xfcntl(tls, fd, F_SETFD, libc.VaList(bp, FD_CLOEXEC))
	XTclpObjDeleteFile(tls, nameObj)
	libc.Xclose(tls, fd)
	retVal = XTcl_DuplicateObj(tls, nameObj)
	for ok2 := true; ok2; ok2 = 0 != 0 {
		var _objPtr uintptr = nameObj
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return retVal
}

//----------------------------------------------------------------------------
//
// TclpTempFileNameForLibrary --
//
//	Constructs a file name in the native file system where a dynamically
//	loaded library may be placed.
//
// Results:
//	Returns the constructed file name. If an error occurs, returns NULL
//	and leaves an error message in the interpreter result.
//
// On Unix, it works to load a shared object from a file of any name, so this
// function is merely a thin wrapper around TclpTempFileName().
//
//----------------------------------------------------------------------------

func XTclpTempFileNameForLibrary(tls *libc.TLS, interp uintptr, path uintptr) uintptr { /* tclUnixPipe.c:269:9: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var retval uintptr = XTclpTempFileName(tls)

	if retval == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+70499,
			libc.VaList(bp, XTcl_PosixError(tls, interp))))
	}
	return retval
}

//----------------------------------------------------------------------
//
// TclpCreatePipe --
//
//	Creates a pipe - simply calls the pipe() function.
//
// Results:
//	Returns 1 on success, 0 on failure.
//
// Side effects:
//	Creates a pipe.
//
//----------------------------------------------------------------------

func XTclpCreatePipe(tls *libc.TLS, readPipe uintptr, writePipe uintptr) int32 { /* tclUnixPipe.c:301:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var pipeIds [2]int32 at bp+16, 8

	if libc.Xpipe(tls, bp+16) != 0 {
		return 0
	}

	libc.Xfcntl(tls, *(*int32)(unsafe.Pointer(bp + 16)), F_SETFD, libc.VaList(bp, FD_CLOEXEC))
	libc.Xfcntl(tls, *(*int32)(unsafe.Pointer(bp + 16 + 1*4)), F_SETFD, libc.VaList(bp+8, FD_CLOEXEC))

	*(*TclFile)(unsafe.Pointer(readPipe)) = uintptr(Intptr_t(*(*int32)(unsafe.Pointer(bp + 16)) + 1))
	*(*TclFile)(unsafe.Pointer(writePipe)) = uintptr(Intptr_t(*(*int32)(unsafe.Pointer(bp + 16 + 1*4)) + 1))
	return 1
}

//----------------------------------------------------------------------
//
// TclpCloseFile --
//
//	Implements a mechanism to close a UNIX file.
//
// Results:
//	Returns 0 on success, or -1 on error, setting errno.
//
// Side effects:
//	The file is closed.
//
//----------------------------------------------------------------------

func XTclpCloseFile(tls *libc.TLS, file TclFile) int32 { /* tclUnixPipe.c:338:1: */
	var fd int32 = int32(file) - 1

	// Refuse to close the fds for stdin, stdout and stderr.

	if fd == 0 || fd == 1 || fd == 2 {
		return 0
	}

	XTcl_DeleteFileHandler(tls, fd)
	return libc.Xclose(tls, fd)
}

//----------------------------------------------------------------------
//
// RestoreSignals --
//
//	This function is invoked in a forked child process just before
//	exec-ing a new program to restore all signals to their default
//	settings.
//
// Results:
//	None.
//
// Side effects:
//	Signal settings get changed.
//
//----------------------------------------------------------------------

func sRestoreSignals(tls *libc.TLS) { /* tclUnixPipe.c:582:1: */
	libc.Xsignal(tls, SIGABRT, uintptr(0))
	libc.Xsignal(tls, SIGALRM, uintptr(0))
	libc.Xsignal(tls, SIGFPE, uintptr(0))
	libc.Xsignal(tls, SIGHUP, uintptr(0))
	libc.Xsignal(tls, SIGILL, uintptr(0))
	libc.Xsignal(tls, SIGINT, uintptr(0))
	libc.Xsignal(tls, SIGPIPE, uintptr(0))
	libc.Xsignal(tls, SIGQUIT, uintptr(0))
	libc.Xsignal(tls, SIGSEGV, uintptr(0))
	libc.Xsignal(tls, SIGTERM, uintptr(0))
	libc.Xsignal(tls, SIGUSR1, uintptr(0))
	libc.Xsignal(tls, SIGUSR2, uintptr(0))
	libc.Xsignal(tls, SIGCHLD, uintptr(0))
	libc.Xsignal(tls, SIGCONT, uintptr(0))
	libc.Xsignal(tls, SIGTSTP, uintptr(0))
	libc.Xsignal(tls, SIGTTIN, uintptr(0))
	libc.Xsignal(tls, SIGTTOU, uintptr(0))
}

//----------------------------------------------------------------------
//
// SetupStdFile --
//
//	Set up stdio file handles for the child process, using the current
//	standard channels if no other files are specified. If no standard
//	channel is defined, or if no file is associated with the channel, then
//	the corresponding standard fd is closed.
//
// Results:
//	Returns 1 on success, or 0 on failure.
//
// Side effects:
//	Replaces stdio fds.
//
//----------------------------------------------------------------------

func sSetupStdFile(tls *libc.TLS, file TclFile, type1 int32) int32 { /* tclUnixPipe.c:657:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var channel Tcl_Channel
	var fd int32
	var targetFd int32 = 0  // Initializations here needed only to
	var direction int32 = 0 // prevent warnings about using uninitialized
	// variables.

	switch type1 {
	case int32(1) << 1:
		targetFd = 0
		direction = int32(1) << 1
		break
	case int32(1) << 2:
		targetFd = 1
		direction = int32(1) << 2
		break
	case int32(1) << 3:
		targetFd = 2
		direction = int32(1) << 2
		break
	}

	if !(file != 0) {
		channel = XTcl_GetStdChannel(tls, type1)
		if channel != 0 {
			file = XTclpMakeFile(tls, channel, direction)
		}
	}
	if file != 0 {
		fd = int32(file) - 1
		if fd != targetFd {
			if libc.Xdup2(tls, fd, targetFd) == -1 {
				return 0
			}

			// Must clear the close-on-exec flag for the target FD, since some
			// systems (e.g. Ultrix) do not clear the CLOEXEC flag on the
			// target FD.

			libc.Xfcntl(tls, targetFd, F_SETFD, libc.VaList(bp, 0))
		} else {
			// Since we aren't dup'ing the file, we need to explicitly clear
			// the close-on-exec flag.

			libc.Xfcntl(tls, fd, F_SETFD, libc.VaList(bp+8, 0))
		}
	} else {
		libc.Xclose(tls, targetFd)
	}
	return 1
}

//----------------------------------------------------------------------
//
// TclpCreateCommandChannel --
//
//	This function is called by the generic IO level to perform the
//	platform specific channel initialization for a command channel.
//
// Results:
//	Returns a new channel or NULL on failure.
//
// Side effects:
//	Allocates a new channel.
//
//----------------------------------------------------------------------

func XTclpCreateCommandChannel(tls *libc.TLS, readFile TclFile, writeFile TclFile, errorFile TclFile, numPids int32, pidPtr uintptr) Tcl_Channel { /* tclUnixPipe.c:734:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	// var channelName [40]int8 at bp+8, 40

	var channelId int32
	var statePtr uintptr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(PipeState{})))
	var mode int32

	(*PipeState)(unsafe.Pointer(statePtr)).FinFile = readFile
	(*PipeState)(unsafe.Pointer(statePtr)).FoutFile = writeFile
	(*PipeState)(unsafe.Pointer(statePtr)).FerrorFile = errorFile
	(*PipeState)(unsafe.Pointer(statePtr)).FnumPids = numPids
	(*PipeState)(unsafe.Pointer(statePtr)).FpidPtr = pidPtr
	(*PipeState)(unsafe.Pointer(statePtr)).FisNonBlocking = 0

	mode = 0
	if readFile != 0 {
		mode = mode | int32(1)<<1
	}
	if writeFile != 0 {
		mode = mode | int32(1)<<2
	}

	// Use one of the fds associated with the channel as the channel id.

	if readFile != 0 {
		channelId = int32(readFile) - 1
	} else if writeFile != 0 {
		channelId = int32(writeFile) - 1
	} else if errorFile != 0 {
		channelId = int32(errorFile) - 1
	} else {
		channelId = 0
	}

	// For backward compatibility with previous versions of Tcl, we use
	// "file%d" as the base name for pipes even though it would be more
	// natural to use "pipe%d".

	libc.Xsprintf(tls, bp+8, ts+67245, libc.VaList(bp, channelId))
	(*PipeState)(unsafe.Pointer(statePtr)).Fchannel = XTcl_CreateChannel(tls, uintptr(unsafe.Pointer(&pipeChannelType)), bp+8,
		statePtr, mode)
	return (*PipeState)(unsafe.Pointer(statePtr)).Fchannel
}

//----------------------------------------------------------------------
//
// Tcl_CreatePipe --
//
//	System dependent interface to create a pipe for the [chan pipe]
//	command. Stolen from TclX.
//
// Results:
//	TCL_OK or TCL_ERROR.
//
// Side effects:
//	Registers two channels.
//
//----------------------------------------------------------------------

func XTcl_CreatePipe(tls *libc.TLS, interp uintptr, rchan uintptr, wchan uintptr, flags int32) int32 { /* tclUnixPipe.c:809:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// var fileNums [2]int32 at bp+24, 8

	if libc.Xpipe(tls, bp+24) < 0 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+70534,
			libc.VaList(bp, XTcl_PosixError(tls, interp))))
		return TCL_ERROR
	}

	libc.Xfcntl(tls, *(*int32)(unsafe.Pointer(bp + 24)), F_SETFD, libc.VaList(bp+8, FD_CLOEXEC))
	libc.Xfcntl(tls, *(*int32)(unsafe.Pointer(bp + 24 + 1*4)), F_SETFD, libc.VaList(bp+16, FD_CLOEXEC))

	*(*Tcl_Channel)(unsafe.Pointer(rchan)) = XTcl_MakeFileChannel(tls, uintptr(Intptr_t(*(*int32)(unsafe.Pointer(bp + 24)))), int32(1)<<1)
	XTcl_RegisterChannel(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(rchan)))
	*(*Tcl_Channel)(unsafe.Pointer(wchan)) = XTcl_MakeFileChannel(tls, uintptr(Intptr_t(*(*int32)(unsafe.Pointer(bp + 24 + 1*4)))), int32(1)<<2)
	XTcl_RegisterChannel(tls, interp, *(*Tcl_Channel)(unsafe.Pointer(wchan)))

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclGetAndDetachPids --
//
//	This function is invoked in the generic implementation of a
//	background "exec" (an exec when invoked with a terminating "&") to
//	store a list of the PIDs for processes in a command pipeline in the
//	interp's result and to detach the processes.
//
// Results:
//	None.
//
// Side effects:
//	Modifies the interp's result. Detaches processes.
//
//----------------------------------------------------------------------

func XTclGetAndDetachPids(tls *libc.TLS, interp uintptr, chan1 Tcl_Channel) { /* tclUnixPipe.c:854:1: */
	var pipePtr uintptr
	var chanTypePtr uintptr
	var pidsObj uintptr
	var i int32

	// Punt if the channel is not a command channel.

	chanTypePtr = XTcl_GetChannelType(tls, chan1)
	if chanTypePtr != uintptr(unsafe.Pointer(&pipeChannelType)) {
		return
	}

	pipePtr = XTcl_GetChannelInstanceData(tls, chan1)
	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			pidsObj = XTclThreadAllocObj(tls)
		} else {
			pidsObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(pidsObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(pidsObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(pidsObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(pidsObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(pidsObj)).FtypePtr = uintptr(0)
	{
	}

	for i = 0; i < (*PipeState)(unsafe.Pointer(pipePtr)).FnumPids; i++ {
		XTcl_ListObjAppendElement(tls, uintptr(0), pidsObj, XTcl_NewIntObj(tls,
			int32(*(*Tcl_Pid)(unsafe.Pointer((*PipeState)(unsafe.Pointer(pipePtr)).FpidPtr + uintptr(i)*8)))))
		XTcl_DetachPids(tls, 1, (*PipeState)(unsafe.Pointer(pipePtr)).FpidPtr+uintptr(i)*8)
	}
	XTcl_SetObjResult(tls, interp, pidsObj)
	if (*PipeState)(unsafe.Pointer(pipePtr)).FnumPids > 0 {
		XTclpFree(tls, (*PipeState)(unsafe.Pointer(pipePtr)).FpidPtr)
		(*PipeState)(unsafe.Pointer(pipePtr)).FnumPids = 0
	}
}

//----------------------------------------------------------------------
//
// PipeBlockModeProc --
//
//	Helper function to set blocking and nonblocking modes on a pipe based
//	channel. Invoked by generic IO level code.
//
// Results:
//	0 if successful, errno when failed.
//
// Side effects:
//	Sets the device into blocking or non-blocking mode.
//
//----------------------------------------------------------------------

func sPipeBlockModeProc(tls *libc.TLS, instanceData ClientData, mode int32) int32 { /* tclUnixPipe.c:904:1: */
	var psPtr uintptr = instanceData

	if (*PipeState)(unsafe.Pointer(psPtr)).FinFile != 0 &&
		XTclUnixSetBlockingMode(tls, int32((*PipeState)(unsafe.Pointer(psPtr)).FinFile)-1, mode) < 0 {
		return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	}
	if (*PipeState)(unsafe.Pointer(psPtr)).FoutFile != 0 &&
		XTclUnixSetBlockingMode(tls, int32((*PipeState)(unsafe.Pointer(psPtr)).FoutFile)-1, mode) < 0 {
		return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	}

	(*PipeState)(unsafe.Pointer(psPtr)).FisNonBlocking = libc.Bool32(mode == TCL_MODE_NONBLOCKING)

	return 0
}

//----------------------------------------------------------------------
//
// PipeClose2Proc
//
//	This function is invoked by the generic IO level to perform
//	pipeline-type-specific half or full-close.
//
// Results:
//	0 on success, errno otherwise.
//
// Side effects:
//	Closes the command pipeline channel.
//
//----------------------------------------------------------------------

func sPipeClose2Proc(tls *libc.TLS, instanceData ClientData, interp uintptr, flags int32) int32 { /* tclUnixPipe.c:944:1: */
	var pipePtr uintptr = instanceData
	var errChan Tcl_Channel
	var errorCode int32
	var result int32

	errorCode = 0
	result = 0

	if (!(flags != 0) || flags&(int32(1)<<1) != 0) && (*PipeState)(unsafe.Pointer(pipePtr)).FinFile != uintptr(0) {
		if XTclpCloseFile(tls, (*PipeState)(unsafe.Pointer(pipePtr)).FinFile) < 0 {
			errorCode = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
		} else {
			(*PipeState)(unsafe.Pointer(pipePtr)).FinFile = uintptr(0)
		}
	}
	if (!(flags != 0) || flags&(int32(1)<<2) != 0) && (*PipeState)(unsafe.Pointer(pipePtr)).FoutFile != uintptr(0) &&
		errorCode == 0 {
		if XTclpCloseFile(tls, (*PipeState)(unsafe.Pointer(pipePtr)).FoutFile) < 0 {
			errorCode = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
		} else {
			(*PipeState)(unsafe.Pointer(pipePtr)).FoutFile = uintptr(0)
		}
	}

	// If half-closing, stop here.

	if flags != 0 {
		return errorCode
	}

	if (*PipeState)(unsafe.Pointer(pipePtr)).FisNonBlocking != 0 || XTclInExit(tls) != 0 {
		// If the channel is non-blocking or Tcl is being cleaned up, just
		// detach the children PIDs, reap them (important if we are in a
		// dynamic load module), and discard the errorFile.

		XTcl_DetachPids(tls, (*PipeState)(unsafe.Pointer(pipePtr)).FnumPids, (*PipeState)(unsafe.Pointer(pipePtr)).FpidPtr)
		XTcl_ReapDetachedProcs(tls)

		if (*PipeState)(unsafe.Pointer(pipePtr)).FerrorFile != 0 {
			XTclpCloseFile(tls, (*PipeState)(unsafe.Pointer(pipePtr)).FerrorFile)
		}
	} else {
		// Wrap the error file into a channel and give it to the cleanup
		// routine.

		if (*PipeState)(unsafe.Pointer(pipePtr)).FerrorFile != 0 {
			errChan = XTcl_MakeFileChannel(tls,
				uintptr(Intptr_t(int32((*PipeState)(unsafe.Pointer(pipePtr)).FerrorFile)-1)),
				int32(1)<<1)
		} else {
			errChan = uintptr(0)
		}
		result = XTclCleanupChildren(tls, interp, (*PipeState)(unsafe.Pointer(pipePtr)).FnumPids, (*PipeState)(unsafe.Pointer(pipePtr)).FpidPtr,
			errChan)
	}

	if (*PipeState)(unsafe.Pointer(pipePtr)).FnumPids != 0 {
		XTclpFree(tls, (*PipeState)(unsafe.Pointer(pipePtr)).FpidPtr)
	}
	XTclpFree(tls, pipePtr)
	if errorCode == 0 {
		return result
	}
	return errorCode
}

//----------------------------------------------------------------------
//
// PipeInputProc --
//
//	This function is invoked from the generic IO level to read input from
//	a command pipeline based channel.
//
// Results:
//	The number of bytes read is returned or -1 on error. An output
//	argument contains a POSIX error code if an error occurs, or zero.
//
// Side effects:
//	Reads input from the input device of the channel.
//
//----------------------------------------------------------------------

func sPipeInputProc(tls *libc.TLS, instanceData ClientData, buf uintptr, toRead int32, errorCodePtr uintptr) int32 { /* tclUnixPipe.c:1039:1: */
	var psPtr uintptr = instanceData
	var bytesRead int32 // How many bytes were actually read from the
	// input device?

	*(*int32)(unsafe.Pointer(errorCodePtr)) = 0

	// Assume there is always enough input available. This will block
	// appropriately, and read will unblock as soon as a short read is
	// possible, if the channel is in blocking mode. If the channel is
	// nonblocking, the read will never block. Some OSes can throw an
	// interrupt error, for which we should immediately retry. [Bug #415131]

	for ok := true; ok; ok = bytesRead < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EINTR {
		bytesRead = int32(libc.Xread(tls, int32((*PipeState)(unsafe.Pointer(psPtr)).FinFile)-1, buf, Size_t(toRead)))
	}

	if bytesRead < 0 {
		*(*int32)(unsafe.Pointer(errorCodePtr)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
		return -1
	}
	return bytesRead
}

//----------------------------------------------------------------------
//
// PipeOutputProc--
//
//	This function is invoked from the generic IO level to write output to
//	a command pipeline based channel.
//
// Results:
//	The number of bytes written is returned or -1 on error. An output
//	argument contains a POSIX error code if an error occurred, or zero.
//
// Side effects:
//	Writes output on the output device of the channel.
//
//----------------------------------------------------------------------

func sPipeOutputProc(tls *libc.TLS, instanceData ClientData, buf uintptr, toWrite int32, errorCodePtr uintptr) int32 { /* tclUnixPipe.c:1090:1: */
	var psPtr uintptr = instanceData
	var written int32

	*(*int32)(unsafe.Pointer(errorCodePtr)) = 0

	// Some OSes can throw an interrupt error, for which we should immediately
	// retry. [Bug #415131]

	for ok := true; ok; ok = written < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EINTR {
		written = int32(libc.Xwrite(tls, int32((*PipeState)(unsafe.Pointer(psPtr)).FoutFile)-1, buf, Size_t(toWrite)))
	}

	if written < 0 {
		*(*int32)(unsafe.Pointer(errorCodePtr)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
		return -1
	}
	return written
}

//----------------------------------------------------------------------
//
// PipeWatchProc --
//
//	Initialize the notifier to watch the fds from this channel.
//
// Results:
//	None.
//
// Side effects:
//	Sets up the notifier so that a future event on the channel will be
//	seen by Tcl.
//
//----------------------------------------------------------------------

func sPipeWatchProc(tls *libc.TLS, instanceData ClientData, mask int32) { /* tclUnixPipe.c:1135:1: */
	var psPtr uintptr = instanceData
	var newmask int32

	if (*PipeState)(unsafe.Pointer(psPtr)).FinFile != 0 {
		newmask = mask & (int32(1)<<1 | int32(1)<<3)
		if newmask != 0 {
			XTcl_CreateFileHandler(tls, int32((*PipeState)(unsafe.Pointer(psPtr)).FinFile)-1, newmask,
				*(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, Tcl_Channel, int32)
				}{XTcl_NotifyChannel})), (*PipeState)(unsafe.Pointer(psPtr)).Fchannel)
		} else {
			XTcl_DeleteFileHandler(tls, int32((*PipeState)(unsafe.Pointer(psPtr)).FinFile)-1)
		}
	}
	if (*PipeState)(unsafe.Pointer(psPtr)).FoutFile != 0 {
		newmask = mask & (int32(1)<<2 | int32(1)<<3)
		if newmask != 0 {
			XTcl_CreateFileHandler(tls, int32((*PipeState)(unsafe.Pointer(psPtr)).FoutFile)-1, newmask,
				*(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, Tcl_Channel, int32)
				}{XTcl_NotifyChannel})), (*PipeState)(unsafe.Pointer(psPtr)).Fchannel)
		} else {
			XTcl_DeleteFileHandler(tls, int32((*PipeState)(unsafe.Pointer(psPtr)).FoutFile)-1)
		}
	}
}

//----------------------------------------------------------------------
//
// PipeGetHandleProc --
//
//	Called from Tcl_GetChannelHandle to retrieve OS handles from inside a
//	command pipeline based channel.
//
// Results:
//	Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no
//	handle for the specified direction.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sPipeGetHandleProc(tls *libc.TLS, instanceData ClientData, direction int32, handlePtr uintptr) int32 { /* tclUnixPipe.c:1183:1: */
	var psPtr uintptr = instanceData

	if direction == int32(1)<<1 && (*PipeState)(unsafe.Pointer(psPtr)).FinFile != 0 {
		*(*ClientData)(unsafe.Pointer(handlePtr)) = uintptr(Intptr_t(int32((*PipeState)(unsafe.Pointer(psPtr)).FinFile) - 1))
		return TCL_OK
	}
	if direction == int32(1)<<2 && (*PipeState)(unsafe.Pointer(psPtr)).FoutFile != 0 {
		*(*ClientData)(unsafe.Pointer(handlePtr)) = uintptr(Intptr_t(int32((*PipeState)(unsafe.Pointer(psPtr)).FoutFile) - 1))
		return TCL_OK
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_WaitPid --
//
//	Implements the waitpid system call on Unix systems.
//
// Results:
//	Result of calling waitpid.
//
// Side effects:
//	Waits for a process to terminate.
//
//----------------------------------------------------------------------

func XTcl_WaitPid(tls *libc.TLS, pid Tcl_Pid, statPtr uintptr, options int32) Tcl_Pid { /* tclUnixPipe.c:1218:1: */
	var result int32
	var real_pid Pid_t = int32(pid)

	for 1 != 0 {
		result = libc.Xwaitpid(tls, real_pid, statPtr, options)
		if result != -1 || *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != EINTR {
			return uintptr(Intptr_t(result))
		}
	}
	return Tcl_Pid(0)
}

//----------------------------------------------------------------------
//
// Tcl_PidObjCmd --
//
//	This function is invoked to process the "pid" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_PidObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclUnixPipe.c:1252:1: */
	var chan1 Tcl_Channel
	var pipePtr uintptr
	var i int32
	var resultPtr uintptr

	if objc > 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+70559)
		return TCL_ERROR
	}

	if objc == 1 {
		XTcl_SetObjResult(tls, interp, XTcl_NewLongObj(tls, int64(libc.Xgetpid(tls))))
	} else {
		// Get the channel and make sure that it refers to a pipe.

		chan1 = XTcl_GetChannel(tls, interp, XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))
		if chan1 == uintptr(0) {
			return TCL_ERROR
		}
		if XTcl_GetChannelType(tls, chan1) != uintptr(unsafe.Pointer(&pipeChannelType)) {
			return TCL_OK
		}

		// Extract the process IDs from the pipe structure.

		pipePtr = XTcl_GetChannelInstanceData(tls, chan1)
		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				resultPtr = XTclThreadAllocObj(tls)
			} else {
				resultPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = uintptr(0)
		{
		}

		for i = 0; i < (*PipeState)(unsafe.Pointer(pipePtr)).FnumPids; i++ {
			XTcl_ListObjAppendElement(tls, uintptr(0), resultPtr,
				XTcl_NewIntObj(tls, int32(Intptr_t(*(*Tcl_Pid)(unsafe.Pointer((*PipeState)(unsafe.Pointer(pipePtr)).FpidPtr + uintptr(i)*8))))))
		}
		XTcl_SetObjResult(tls, interp, resultPtr)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclpFinalizePipes --
//
//	Cleans up the pipe subsystem from Tcl_FinalizeThread
//
// Results:
//	None.
//
// Notes:
//	This function carries out no operation on Unix.
//
//----------------------------------------------------------------------

func XTclpFinalizePipes(tls *libc.TLS) { /* tclUnixPipe.c:1315:1: */
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Helper macros to make parts of this file clearer. The macros do exactly
// what they say on the tin. :-) They also only ever refer to their arguments
// once, and so can be used without regard to side effects.

// "sock" + a pointer in hex + \0

// This is needed to comply with the strict aliasing rules of GCC, but it also
// simplifies casting between the different sockaddr types.

type Address = struct {
	F__ccgo_pad1 [0]uint64
	Fsa          Sockaddr
	F__ccgo_pad2 [112]byte
} /* tclUnixSock.c:40:3 */

// This structure describes per-instance state of a tcp based channel.

type TcpState1 = struct {
	Fchannel        Tcl_Channel
	Ffds            TcpFdList
	Fflags          int32
	Finterest       int32
	FacceptProc     uintptr
	FacceptProcData ClientData
	Faddrlist       uintptr
	Faddr           uintptr
	Fmyaddrlist     uintptr
	Fmyaddr         uintptr
	Ffilehandlers   int32
	FconnectError   int32
	FcachedBlocking int32
	F__ccgo_pad1    [4]byte
} /* tclUnixSock.c:46:9 */

// This structure describes per-instance state of a tcp based channel.

type TcpState = TcpState1 /* tclUnixSock.c:46:25 */

type TcpFdList1 = struct {
	FstatePtr    uintptr
	Ffd          int32
	F__ccgo_pad1 [4]byte
	Fnext        uintptr
} /* tclUnixSock.c:46:9 */

type TcpFdList = TcpFdList1 /* tclUnixSock.c:52:3 */

// This structure describes the channel type structure for TCP socket
// based IO:

var tcpChannelType = Tcl_ChannelType{
	FtypeName:         ts + 34036,
	Fversion:          uintptr(0x5),
	FcloseProc:        0, // Close proc.
	FinputProc:        0, // Input proc.
	FoutputProc:       0, // Set option proc.
	FgetOptionProc:    0, // Get option proc.
	FwatchProc:        0, // Initialize notifier.
	FgetHandleProc:    0, // Get OS handles out of channel.
	Fclose2Proc:       0, // Close2 proc.
	FblockModeProc:    0, // wide seek proc.
	FthreadActionProc: 0, // truncate proc.
}                                           /* tclUnixSock.c:148:30 */
var hostName = ProcessGlobalValue{Fproc: 0} /* tclUnixSock.c:173:27 */

// ----------------------------------------------------------------------
//
// InitializeHostName --
//
// 	This routine sets the process global value of the name of the local
// 	host on which the process is running.
//
// Results:
//	None.
//
// ----------------------------------------------------------------------

func sInitializeHostName(tls *libc.TLS, valuePtr uintptr, lengthPtr uintptr, encodingPtr uintptr) { /* tclUnixSock.c:209:1: */
	bp := tls.Alloc(390)
	defer tls.Free(390)

	var native uintptr = uintptr(0)
	// var u Utsname at bp, 390

	var hp uintptr

	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Utsname{})))
	if libc.Xuname(tls, bp) > -1 { // INTL: Native.
		hp = XTclpGetHostByName(tls, bp+65) // INTL: Native.
		if hp == uintptr(0) {
			// Sometimes the nodename is fully qualified, but gets truncated
			// as it exceeds SYS_NMLN. See if we can just get the immediate
			// nodename and get a proper answer that way.

			var dot uintptr = libc.Xstrchr(tls, bp+65, '.')

			if dot != uintptr(0) {
				var node uintptr = XTcl_Alloc(tls, uint32(int64((dot-(bp+65))/1)+int64(1)))

				libc.Xmemcpy(tls, node, bp+65, uint64(int64((dot-(bp+65))/1)))
				*(*int8)(unsafe.Pointer(node + uintptr(int64((dot-(bp+65))/1)))) = int8(0)
				hp = XTclpGetHostByName(tls, node)
				XTclpFree(tls, node)
			}
		}
		if hp != uintptr(0) {
			native = (*Hostent)(unsafe.Pointer(hp)).Fh_name
		} else {
			native = bp + 65
		}
	}
	if native == uintptr(0) {
		native = XtclEmptyStringRep
	}

	*(*Tcl_Encoding)(unsafe.Pointer(encodingPtr)) = XTcl_GetEncoding(tls, uintptr(0), uintptr(0))
	*(*int32)(unsafe.Pointer(lengthPtr)) = int32(libc.Xstrlen(tls, native))
	*(*uintptr)(unsafe.Pointer(valuePtr)) = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(lengthPtr))+1))
	libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(valuePtr)), native, uint64(*(*int32)(unsafe.Pointer(lengthPtr))+1))
}

// ----------------------------------------------------------------------
//
// Tcl_GetHostName --
//
//	Returns the name of the local host.
//
// Results:
//	A string containing the network name for this machine, or an empty
//	string if we can't figure out the name. The caller must not modify or
//	free this string.
//
// Side effects:
//	Caches the name to return for future calls.
//
// ----------------------------------------------------------------------

func XTcl_GetHostName(tls *libc.TLS) uintptr { /* tclUnixSock.c:301:12: */
	return XTcl_GetString(tls, XTclGetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&hostName))))
}

// ----------------------------------------------------------------------
//
// TclpHasSockets --
//
//	Detect if sockets are available on this platform.
//
// Results:
//	Returns TCL_OK.
//
// Side effects:
//	None.
//
// ----------------------------------------------------------------------

func XTclpHasSockets(tls *libc.TLS, dummy uintptr) int32 { /* tclUnixSock.c:324:1: */
	_ = dummy

	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TclpFinalizeSockets --
//
//	Performs per-thread socket subsystem finalization.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
// ----------------------------------------------------------------------

func XTclpFinalizeSockets(tls *libc.TLS) { /* tclUnixSock.c:349:1: */
	return
}

// ----------------------------------------------------------------------
//
// TcpBlockModeProc --
//
//	This function is invoked by the generic IO level to set blocking and
//	nonblocking mode on a TCP socket based channel.
//
// Results:
//	0 if successful, errno when failed.
//
// Side effects:
//	Sets the device into blocking or nonblocking mode.
//
// ----------------------------------------------------------------------

func sTcpBlockModeProc(tls *libc.TLS, instanceData ClientData, mode int32) int32 { /* tclUnixSock.c:372:1: */
	var statePtr uintptr = instanceData

	if mode == TCL_MODE_BLOCKING {
		*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(int32(1) << 0)
	} else {
		*(*int32)(unsafe.Pointer(statePtr + 32)) |= int32(1) << 0
	}
	if (*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0 {
		(*TcpState)(unsafe.Pointer(statePtr)).FcachedBlocking = mode
		return 0
	}
	if XTclUnixSetBlockingMode(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, mode) < 0 {
		return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	}
	return 0
}

// ----------------------------------------------------------------------
//
// WaitForConnect --
//
//	Check the state of an async connect process. If a connection attempt
//	terminated, process it, which may finalize it or may start the next
//	attempt. If a connect error occures, it is saved in
//	statePtr->connectError to be reported by 'fconfigure -error'.
//
//	There are two modes of operation, defined by errorCodePtr:
//	 *  non-NULL: Called by explicite read/write command. Blocks if the
//	    socket is blocking.
//	    May return two error codes:
//	     *	EWOULDBLOCK: if connect is still in progress
//	     *	ENOTCONN: if connect failed. This would be the error message
//		of a rect or sendto syscall so this is emulated here.
//	 *  NULL: Called by a backround operation. Do not block and do not
//	    return any error code.
//
// Results:
// 	0 if the connection has completed, -1 if still in progress or there is
// 	an error.
//
// Side effects:
//	Processes socket events off the system queue. May process
//	asynchroneous connects.
//
//----------------------------------------------------------------------

func sWaitForConnect(tls *libc.TLS, statePtr uintptr, errorCodePtr uintptr) int32 { /* tclUnixSock.c:427:1: */
	var timeout int32

	// Check if an async connect failed already and error reporting is
	// demanded, return the error ENOTCONN

	if errorCodePtr != uintptr(0) && (*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<5) != 0 {
		*(*int32)(unsafe.Pointer(errorCodePtr)) = ENOTCONN
		return -1
	}

	// Check if an async connect is running. If not return ok

	if !((*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<4) != 0) {
		return 0
	}

	if errorCodePtr == uintptr(0) || (*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<0) != 0 {
		timeout = 0
	} else {
		timeout = -1
	}
	for ok := true; ok; ok = timeout == -1 && (*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0 {
		if XTclUnixWaitForFile(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd,
			int32(1)<<2|int32(1)<<3, timeout) != 0 {
			sTcpConnect(tls, uintptr(0), statePtr)
		}

		// Do this only once in the nonblocking case and repeat it until the
		// socket is final when blocking.
	}

	if errorCodePtr != uintptr(0) {
		if (*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<4) != 0 {
			*(*int32)(unsafe.Pointer(errorCodePtr)) = EAGAIN
			return -1
		} else if (*TcpState)(unsafe.Pointer(statePtr)).FconnectError != 0 {
			*(*int32)(unsafe.Pointer(errorCodePtr)) = ENOTCONN
			return -1
		}
	}
	return 0
}

//----------------------------------------------------------------------
//
// TcpInputProc --
//
//	This function is invoked by the generic IO level to read input from a
//	TCP socket based channel.
//
//	NOTE: We cannot share code with FilePipeInputProc because here we must
//	use recv to obtain the input from the channel, not read.
//
// Results:
//	The number of bytes read is returned or -1 on error. An output
//	argument contains the POSIX error code on error, or zero if no error
//	occurred.
//
// Side effects:
//	Reads input from the input device of the channel.
//
//----------------------------------------------------------------------

func sTcpInputProc(tls *libc.TLS, instanceData ClientData, buf uintptr, bufSize int32, errorCodePtr uintptr) int32 { /* tclUnixSock.c:503:1: */
	var statePtr uintptr = instanceData
	var bytesRead int32

	*(*int32)(unsafe.Pointer(errorCodePtr)) = 0
	if sWaitForConnect(tls, statePtr, errorCodePtr) != 0 {
		return -1
	}
	bytesRead = int32(libc.Xrecv(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, buf, Size_t(bufSize), 0))
	if bytesRead > -1 {
		return bytesRead
	}
	if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ECONNRESET {
		// Turn ECONNRESET into a soft EOF condition.

		return 0
	}
	*(*int32)(unsafe.Pointer(errorCodePtr)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	return -1
}

//----------------------------------------------------------------------
//
// TcpOutputProc --
//
//	This function is invoked by the generic IO level to write output to a
//	TCP socket based channel.
//
//	NOTE: We cannot share code with FilePipeOutputProc because here we
//	must use send, not write, to get reliable error reporting.
//
// Results:
//	The number of bytes written is returned. An output argument is set to
//	a POSIX error code if an error occurred, or zero.
//
// Side effects:
//	Writes output on the output device of the channel.
//
//----------------------------------------------------------------------

func sTcpOutputProc(tls *libc.TLS, instanceData ClientData, buf uintptr, toWrite int32, errorCodePtr uintptr) int32 { /* tclUnixSock.c:554:1: */
	var statePtr uintptr = instanceData
	var written int32

	*(*int32)(unsafe.Pointer(errorCodePtr)) = 0
	if sWaitForConnect(tls, statePtr, errorCodePtr) != 0 {
		return -1
	}
	written = int32(libc.Xsend(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, buf, Size_t(toWrite), 0))

	if written > -1 {
		return written
	}
	*(*int32)(unsafe.Pointer(errorCodePtr)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	return -1
}

//----------------------------------------------------------------------
//
// TcpCloseProc --
//
//	This function is invoked by the generic IO level to perform
//	channel-type-specific cleanup when a TCP socket based channel is
//	closed.
//
// Results:
//	0 if successful, the value of errno if failed.
//
// Side effects:
//	Closes the socket of the channel.
//
//----------------------------------------------------------------------

func sTcpCloseProc(tls *libc.TLS, instanceData ClientData, dummy uintptr) int32 { /* tclUnixSock.c:595:1: */
	var statePtr uintptr = instanceData
	var errorCode int32 = 0
	var fds uintptr
	_ = dummy

	// Delete a file handler that may be active for this socket if this is a
	// server socket - the file handler was created automatically by Tcl as
	// part of the mechanism to accept new client connections. Channel
	// handlers are already deleted in the generic IO channel closing code
	// that called this function, so we do not have to delete them here.

	for fds = statePtr + 8; fds != uintptr(0); fds = (*TcpFdList)(unsafe.Pointer(fds)).Fnext {
		if (*TcpFdList)(unsafe.Pointer(fds)).Ffd < 0 {
			continue
		}
		XTcl_DeleteFileHandler(tls, (*TcpFdList)(unsafe.Pointer(fds)).Ffd)
		if libc.Xclose(tls, (*TcpFdList)(unsafe.Pointer(fds)).Ffd) < 0 {
			errorCode = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
		}

	}
	fds = (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Fnext
	for fds != uintptr(0) {
		var next uintptr = (*TcpFdList)(unsafe.Pointer(fds)).Fnext

		XTclpFree(tls, fds)
		fds = next
	}
	if (*TcpState)(unsafe.Pointer(statePtr)).Faddrlist != uintptr(0) {
		libc.Xfreeaddrinfo(tls, (*TcpState)(unsafe.Pointer(statePtr)).Faddrlist)
	}
	if (*TcpState)(unsafe.Pointer(statePtr)).Fmyaddrlist != uintptr(0) {
		libc.Xfreeaddrinfo(tls, (*TcpState)(unsafe.Pointer(statePtr)).Fmyaddrlist)
	}
	XTclpFree(tls, statePtr)
	return errorCode
}

//----------------------------------------------------------------------
//
// TcpClose2Proc --
//
//	This function is called by the generic IO level to perform the channel
//	type specific part of a half-close: namely, a shutdown() on a socket.
//
// Results:
//	0 if successful, the value of errno if failed.
//
// Side effects:
//	Shuts down one side of the socket.
//
//----------------------------------------------------------------------

func sTcpClose2Proc(tls *libc.TLS, instanceData ClientData, dummy uintptr, flags int32) int32 { /* tclUnixSock.c:657:1: */
	var statePtr uintptr = instanceData
	var readError int32 = 0
	var writeError int32 = 0
	_ = dummy

	// Shutdown the OS socket handle.
	if flags&(int32(1)<<1|int32(1)<<2) == 0 {
		return sTcpCloseProc(tls, instanceData, uintptr(0))
	}
	if flags&(int32(1)<<1) != 0 && libc.Xshutdown(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, SHUT_RD) < 0 {
		readError = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	}
	if flags&(int32(1)<<2) != 0 && libc.Xshutdown(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, SHUT_WR) < 0 {
		writeError = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	}
	if readError != 0 {
		return readError
	}
	return writeError
}

//----------------------------------------------------------------------
//
// TcpHostPortList --
//
//	This function is called by the -gethostname and -getpeername switches
//	of TcpGetOptionProc() to add three list elements with the textual
//	representation of the given address to the given DString.
//
// Results:
//	None.
//
// Side effects:
//	Adds three elements do dsPtr
//
//----------------------------------------------------------------------

func sIPv6AddressNeedsNumericRendering(tls *libc.TLS, addr In6_addr) int32 { /* tclUnixSock.c:706:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)
	*(*In6_addr)(unsafe.Pointer(bp)) = addr

	if func() int32 {
		var __a uintptr = bp
		var __b uintptr = libc.X__ccgo_in6addr_anyp(tls)
		return libc.Bool32(*(*Uint32_t)(unsafe.Pointer(__a)) == *(*Uint32_t)(unsafe.Pointer(__b)) && *(*Uint32_t)(unsafe.Pointer(__a + 1*4)) == *(*Uint32_t)(unsafe.Pointer(__b + 1*4)) && *(*Uint32_t)(unsafe.Pointer(__a + 2*4)) == *(*Uint32_t)(unsafe.Pointer(__b + 2*4)) && *(*Uint32_t)(unsafe.Pointer(__a + 3*4)) == *(*Uint32_t)(unsafe.Pointer(__b + 3*4)))
	}() != 0 {
		return 1
	}

	// The IN6_IS_ADDR_V4MAPPED macro has a problem with aliasing warnings on
	// at least some versions of OSX.

	if !(func() int32 {
		var __a uintptr = bp
		return libc.Bool32(*(*Uint32_t)(unsafe.Pointer(__a)) == Uint32_t(0) && *(*Uint32_t)(unsafe.Pointer(__a + 1*4)) == Uint32_t(0) && *(*Uint32_t)(unsafe.Pointer(__a + 2*4)) == libc.Xhtonl(tls, uint32(0xffff)))
	}() != 0) {
		return 0
	}

	return libc.Bool32(int32(*(*Uint8_t)(unsafe.Pointer(bp + 12))) == 0 && int32(*(*Uint8_t)(unsafe.Pointer(bp + 13))) == 0 &&
		int32(*(*Uint8_t)(unsafe.Pointer(bp + 14))) == 0 && int32(*(*Uint8_t)(unsafe.Pointer(bp + 15))) == 0)
}

func sTcpHostPortList(tls *libc.TLS, interp uintptr, dsPtr uintptr, addr Address, salen Socklen_t) { /* tclUnixSock.c:731:1: */
	bp := tls.Alloc(2210)
	defer tls.Free(2210)
	*(*Address)(unsafe.Pointer(bp)) = addr

	// var host [1025]int8 at bp+1185, 1025

	// var nhost [1025]int8 at bp+128, 1025

	// var nport [32]int8 at bp+1153, 32

	var flags int32 = 0

	libc.Xgetnameinfo(tls, bp, salen, bp+128, uint32(unsafe.Sizeof([1025]int8{})), bp+1153, uint32(unsafe.Sizeof([32]int8{})),
		NI_NUMERICHOST|NI_NUMERICSERV)
	XTcl_DStringAppendElement(tls, dsPtr, bp+128)

	// We don't want to resolve INADDR_ANY and sin6addr_any; they can
	// sometimes cause problems (and never have a name).

	if int32((*Sockaddr)(unsafe.Pointer(bp)).Fsa_family) == PF_INET {
		if (*Sockaddr_in)(unsafe.Pointer(bp)).Fsin_addr.Fs_addr == In_addr_t(0x00000000) {
			flags = flags | NI_NUMERICHOST
		}
	} else if int32((*Sockaddr)(unsafe.Pointer(bp)).Fsa_family) == PF_INET6 {
		if sIPv6AddressNeedsNumericRendering(tls, (*Sockaddr_in6)(unsafe.Pointer(bp)).Fsin6_addr) != 0 {
			flags = flags | NI_NUMERICHOST
		}
	}

	// Check if reverse DNS has been switched off globally.

	if interp != uintptr(0) && XTcl_GetVar2(tls, interp, ts+70571, uintptr(0), 0) != uintptr(0) {
		flags = flags | NI_NUMERICHOST
	}
	if libc.Xgetnameinfo(tls, bp, salen, bp+1185, uint32(unsafe.Sizeof([1025]int8{})), uintptr(0), uint32(0),
		flags) == 0 {
		// Reverse mapping worked.

		XTcl_DStringAppendElement(tls, dsPtr, bp+1185)
	} else {
		// Reverse mapping failed - use the numeric rep once more.

		XTcl_DStringAppendElement(tls, dsPtr, bp+128)
	}
	XTcl_DStringAppendElement(tls, dsPtr, bp+1153)
}

//----------------------------------------------------------------------
//
// TcpGetOptionProc --
//
//	Computes an option value for a TCP socket based channel, or a list of
//	all options and their values.
//
//	Note: This code is based on code contributed by John Haxby.
//
// Results:
//	A standard Tcl result. The value of the specified option or a list of
//	all options and their values is returned in the supplied DString. Sets
//	Error message if needed.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sTcpGetOptionProc(tls *libc.TLS, instanceData ClientData, interp uintptr, optionName uintptr, dsPtr uintptr) int32 { /* tclUnixSock.c:809:1: */
	bp := tls.Alloc(292)
	defer tls.Free(292)

	var statePtr uintptr = instanceData
	var len Size_t = uint64(0)

	sWaitForConnect(tls, statePtr, uintptr(0))

	if optionName != uintptr(0) {
		len = libc.Xstrlen(tls, optionName)
	}

	if len > uint64(1) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == 'e' && libc.Xstrncmp(tls, optionName, ts+38693, len) == 0 {
		*(*Socklen_t)(unsafe.Pointer(bp + 20 /* optlen */)) = Socklen_t(unsafe.Sizeof(int32(0)))

		if (*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0 {
			// Suppress errors as long as we are not done.

			*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
		} else if (*TcpState)(unsafe.Pointer(statePtr)).FconnectError != 0 {
			*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = (*TcpState)(unsafe.Pointer(statePtr)).FconnectError
			(*TcpState)(unsafe.Pointer(statePtr)).FconnectError = 0
		} else {
			// var err int32 at bp+16, 4

			libc.Xgetsockopt(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, SOL_SOCKET, SO_ERROR, bp+16,
				bp+20)
			*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = *(*int32)(unsafe.Pointer(bp + 16 /* err */))
		}
		if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != 0 {
			XTcl_DStringAppend(tls, dsPtr, XTcl_ErrnoMsg(tls, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))), -1)
		}
		return TCL_OK
	}

	if len > uint64(1) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == 'c' && libc.Xstrncmp(tls, optionName, ts+70604, len) == 0 {
		XTcl_DStringAppend(tls, dsPtr,
			func() uintptr {
				if (*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0 {
					return ts + 6615 /* "1" */
				}
				return ts + 18333 /* "0" */
			}(), -1)
		return TCL_OK
	}

	if len == uint64(0) || len > uint64(1) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == 'p' && libc.Xstrncmp(tls, optionName, ts+70616, len) == 0 {
		// var peername Address at bp+24, 128

		*(*Socklen_t)(unsafe.Pointer(bp + 152 /* size */)) = Socklen_t(unsafe.Sizeof(Address{}))

		if (*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0 {
			// In async connect output an empty string

			if len == uint64(0) {
				XTcl_DStringAppendElement(tls, dsPtr, ts+70616)
				XTcl_DStringAppendElement(tls, dsPtr, ts+2046)
			} else {
				return TCL_OK
			}
		} else if libc.Xgetpeername(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, bp+24, bp+152) >= 0 {
			// Peername fetch succeeded - output list

			if len == uint64(0) {
				XTcl_DStringAppendElement(tls, dsPtr, ts+70616)
				XTcl_DStringStartSublist(tls, dsPtr)
			}
			sTcpHostPortList(tls, interp, dsPtr, *(*Address)(unsafe.Pointer(bp + 24 /* peername */)), *(*Socklen_t)(unsafe.Pointer(bp + 152 /* size */)))
			if len != 0 {
				return TCL_OK
			}
			XTcl_DStringEndSublist(tls, dsPtr)
		} else {
			// getpeername failed - but if we were asked for all the options
			// (len==0), don't flag an error at that point because it could be
			// an fconfigure request on a server socket (which have no peer).
			// Same must be done on win&mac.

			if len != 0 {
				if interp != 0 {
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
						ts+70626,
						libc.VaList(bp, XTcl_PosixError(tls, interp))))
				}
				return TCL_ERROR
			}
		}
	}

	if len == uint64(0) || len > uint64(1) && int32(*(*int8)(unsafe.Pointer(optionName + 1))) == 's' && libc.Xstrncmp(tls, optionName, ts+70649, len) == 0 {
		var fds uintptr
		// var sockname Address at bp+160, 128

		// var size Socklen_t at bp+288, 4

		var found int32 = 0

		if len == uint64(0) {
			XTcl_DStringAppendElement(tls, dsPtr, ts+70649)
			XTcl_DStringStartSublist(tls, dsPtr)
		}
		if (*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0 {
			// In async connect output an empty string

			found = 1
		} else {
			for fds = statePtr + 8; fds != uintptr(0); fds = (*TcpFdList)(unsafe.Pointer(fds)).Fnext {
				*(*Socklen_t)(unsafe.Pointer(bp + 288 /* size */)) = Socklen_t(unsafe.Sizeof(Address{}))
				if libc.Xgetsockname(tls, (*TcpFdList)(unsafe.Pointer(fds)).Ffd, bp+160, bp+288) >= 0 {
					found = 1
					sTcpHostPortList(tls, interp, dsPtr, *(*Address)(unsafe.Pointer(bp + 160 /* sockname */)), *(*Socklen_t)(unsafe.Pointer(bp + 288 /* size */)))
				}
			}
		}
		if found != 0 {
			if len != 0 {
				return TCL_OK
			}
			XTcl_DStringEndSublist(tls, dsPtr)
		} else {
			if interp != 0 {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+70659, libc.VaList(bp+8, XTcl_PosixError(tls, interp))))
			}
			return TCL_ERROR
		}
	}

	if len > uint64(0) {
		return XTcl_BadChannelOption(tls, interp, optionName,
			ts+70682)
	}

	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TcpThreadActionProc --
//
//	Handles detach/attach for asynchronously connecting socket.
//
//	Reassigning the file handler associated with thread-related channel
//	notification, responsible for callbacks (signaling that asynchronous
//	connection attempt has succeeded or failed).
//
// Results:
//	None.
//
// ----------------------------------------------------------------------

func sTcpThreadActionProc(tls *libc.TLS, instanceData ClientData, action int32) { /* tclUnixSock.c:975:1: */
	var statePtr uintptr = instanceData

	if (*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0 {
		// Async-connecting socket must get reassigned handler if it have been
		// transferred to another thread. Remove the handler if the socket is
		// not managed by this thread anymore and create new handler (TSD related)
		// so the callback will run in the correct thread, bug [f583715154].
		switch action {
		case 1:
			*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(int32(1) << 4)
			XTcl_DeleteFileHandler(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd)
			break
			fallthrough
		case 0:
			XTcl_CreateFileHandler(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd,
				int32(1)<<2|int32(1)<<3, *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, int32)
				}{sTcpAsyncCallback})), statePtr)
			*(*int32)(unsafe.Pointer(statePtr + 32)) |= int32(1) << 4
			break
		}
	}
}

// ----------------------------------------------------------------------
//
// TcpWatchProc --
//
//	Initialize the notifier to watch the fd from this channel.
//
// Results:
//	None.
//
// Side effects:
//	Sets up the notifier so that a future event on the channel will be
//	seen by Tcl.
//
// ----------------------------------------------------------------------

func sWrapNotify(tls *libc.TLS, clientData ClientData, mask int32) { /* tclUnixSock.c:1020:1: */
	var statePtr uintptr = clientData
	var newmask int32 = mask & (*TcpState)(unsafe.Pointer(statePtr)).Finterest

	if newmask == 0 {
		// There was no overlap between the states the channel is interested
		// in notifications for, and the states that are reported present on
		// the file descriptor by select().  The only way that can happen is
		// when the channel is interested in a writable condition, and only a
		// readable state is reported present (see TcpWatchProc() below).  In
		// that case, signal back to the caller the writable state, which is
		// really an error condition.  As an extra check on that assumption,
		// check for a non-zero value of errno before reporting an artificial
		// writable state.

		if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == 0 {
			return
		}
		newmask = int32(1) << 2
	}
	XTcl_NotifyChannel(tls, (*TcpState)(unsafe.Pointer(statePtr)).Fchannel, newmask)
}

func sTcpWatchProc(tls *libc.TLS, instanceData ClientData, mask int32) { /* tclUnixSock.c:1049:1: */
	var statePtr uintptr = instanceData

	if (*TcpState)(unsafe.Pointer(statePtr)).FacceptProc != uintptr(0) {
		// Make sure we don't mess with server sockets since they will never
		// be readable or writable at the Tcl level. This keeps Tcl scripts
		// from interfering with the -accept behavior (bug #3394732).

		return
	}

	if (*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<4) != 0 {
		// Async sockets use a FileHandler internally while connecting, so we
		// need to cache this request until the connection has succeeded.

		(*TcpState)(unsafe.Pointer(statePtr)).Ffilehandlers = mask
	} else if mask != 0 {

		// Whether it is a bug or feature or otherwise, it is a fact of life
		// that on at least some Linux kernels select() fails to report that a
		// socket file descriptor is writable when the other end of the socket
		// is closed.  This is in contrast to the guarantees Tcl makes that
		// its channels become writable and fire writable events on an error
		// conditon.  This has caused a leak of file descriptors in a state of
		// background flushing.  See Tcl ticket 1758a0b603.
		//
		// As a workaround, when our caller indicates an interest in writable
		// notifications, we must tell the notifier built around select() that
		// we are interested in the readable state of the file descriptor as
		// well, as that is the only reliable means to get notified of error
		// conditions.  Then it is the task of WrapNotify() above to untangle
		// the meaning of these channel states and report the chan events as
		// best it can.  We save a copy of the mask passed in to assist with
		// that.

		(*TcpState)(unsafe.Pointer(statePtr)).Finterest = mask
		XTcl_CreateFileHandler(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, mask|int32(1)<<1,
			*(*uintptr)(unsafe.Pointer(&struct {
				f func(*libc.TLS, ClientData, int32)
			}{sWrapNotify})), statePtr)
	} else {
		XTcl_DeleteFileHandler(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd)
	}
}

// ----------------------------------------------------------------------
//
// TcpGetHandleProc --
//
//	Called from Tcl_GetChannelHandle to retrieve OS handles from inside a
//	TCP socket based channel.
//
// Results:
//	Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no
//	handle for the specified direction.
//
// Side effects:
//	None.
//
// ----------------------------------------------------------------------

func sTcpGetHandleProc(tls *libc.TLS, instanceData ClientData, direction int32, handlePtr uintptr) int32 { /* tclUnixSock.c:1122:1: */
	var statePtr uintptr = instanceData
	_ = direction

	*(*ClientData)(unsafe.Pointer(handlePtr)) = uintptr(Intptr_t((*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd))
	return TCL_OK
}

// ----------------------------------------------------------------------
//
// TcpAsyncCallback --
//
//	Called by the event handler that TcpConnect sets up internally for
//	[socket -async] to get notified when the asynchronous connection
//	attempt has succeeded or failed.
//
// ----------------------------------------------------------------------

func sTcpAsyncCallback(tls *libc.TLS, clientData ClientData, mask int32) { /* tclUnixSock.c:1147:1: */
	_ = mask

	sTcpConnect(tls, uintptr(0), clientData)
}

// ----------------------------------------------------------------------
//
// TcpConnect --
//
//	This function opens a new socket in client mode.
//
// Results:
//      TCL_OK, if the socket was successfully connected or an asynchronous
//      connection is in progress. If an error occurs, TCL_ERROR is returned
//      and an error message is left in interp.
//
// Side effects:
//	Opens a socket.
//
// Remarks:
//	A single host name may resolve to more than one IP address, e.g. for
//	an IPv4/IPv6 dual stack host. For handling asynchronously connecting
//	sockets in the background for such hosts, this function can act as a
//	coroutine. On the first call, it sets up the control variables for the
//	two nested loops over the local and remote addresses. Once the first
//	connection attempt is in progress, it sets up itself as a writable
//	event handler for that socket, and returns. When the callback occurs,
//	control is transferred to the "reenter" label, right after the initial
//	return and the loops resume as if they had never been interrupted.
//	For synchronously connecting sockets, the loops work the usual way.
//
// ----------------------------------------------------------------------

func sTcpConnect(tls *libc.TLS, interp uintptr, statePtr uintptr) int32 { /* tclUnixSock.c:1189:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	// var optlen Socklen_t at bp+24, 4

	var async_callback int32
	var ret int32
	// var error int32 at bp+20, 4

	var async int32
	// var reuseaddr int32 at bp+16, 4
	async_callback = libc.Bool32((*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<4) != 0)
	ret = -1
	*(*int32)(unsafe.Pointer(bp + 20 /* error */)) = EHOSTUNREACH
	async = libc.Bool32((*TcpState)(unsafe.Pointer(statePtr)).Fflags&(int32(1)<<1) != 0)

	if !(async_callback != 0) {
		goto __1
	}
	goto reenter
__1:
	;

	(*TcpState)(unsafe.Pointer(statePtr)).Faddr = (*TcpState)(unsafe.Pointer(statePtr)).Faddrlist
__2:
	if !((*TcpState)(unsafe.Pointer(statePtr)).Faddr != uintptr(0)) {
		goto __4
	}
	(*TcpState)(unsafe.Pointer(statePtr)).Fmyaddr = (*TcpState)(unsafe.Pointer(statePtr)).Fmyaddrlist
__5:
	if !((*TcpState)(unsafe.Pointer(statePtr)).Fmyaddr != uintptr(0)) {
		goto __7
	}
	*(*int32)(unsafe.Pointer(bp + 16 /* reuseaddr */)) = 1

	// No need to try combinations of local and remote addresses of
	// different families.

	if !((*Addrinfo)(unsafe.Pointer((*TcpState)(unsafe.Pointer(statePtr)).Fmyaddr)).Fai_family != (*Addrinfo)(unsafe.Pointer((*TcpState)(unsafe.Pointer(statePtr)).Faddr)).Fai_family) {
		goto __8
	}
	goto __6
__8:
	;

	// Close the socket if it is still open from the last unsuccessful
	// iteration.

	if !((*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd >= 0) {
		goto __9
	}
	libc.Xclose(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd)
	(*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd = -1
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
__9:
	;

	(*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd = libc.Xsocket(tls, (*Addrinfo)(unsafe.Pointer((*TcpState)(unsafe.Pointer(statePtr)).Faddr)).Fai_family, SOCK_STREAM,
		0)
	if !((*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd < 0) {
		goto __10
	}
	goto __6
__10:
	;

	// Set the close-on-exec flag so that the socket will not get
	// inherited by child processes.

	libc.Xfcntl(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, F_SETFD, libc.VaList(bp, FD_CLOEXEC))

	// Set kernel space buffering

	XTclSockMinimumBuffers(tls, uintptr(Intptr_t((*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd)), SOCKET_BUFSIZE)

	if !(async != 0) {
		goto __11
	}
	ret = XTclUnixSetBlockingMode(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd,
		TCL_MODE_NONBLOCKING)
	if !(ret < 0) {
		goto __12
	}
	goto __6
__12:
	;
__11:
	;

	// Must reset the error variable here, before we use it for the
	// first time in this iteration.

	*(*int32)(unsafe.Pointer(bp + 20 /* error */)) = 0

	libc.Xsetsockopt(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, SOL_SOCKET, SO_REUSEADDR,
		bp+16, uint32(unsafe.Sizeof(int32(0))))
	ret = libc.Xbind(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, (*Addrinfo)(unsafe.Pointer((*TcpState)(unsafe.Pointer(statePtr)).Fmyaddr)).Fai_addr,
		(*Addrinfo)(unsafe.Pointer((*TcpState)(unsafe.Pointer(statePtr)).Fmyaddr)).Fai_addrlen)
	if !(ret < 0) {
		goto __13
	}
	*(*int32)(unsafe.Pointer(bp + 20 /* error */)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	goto __6
__13:
	;

	// Attempt to connect. The connect may fail at present with an
	// EINPROGRESS but at a later time it will complete. The caller
	// will set up a file handler on the socket if she is interested
	// in being informed when the connect completes.

	ret = libc.Xconnect(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, (*Addrinfo)(unsafe.Pointer((*TcpState)(unsafe.Pointer(statePtr)).Faddr)).Fai_addr,
		(*Addrinfo)(unsafe.Pointer((*TcpState)(unsafe.Pointer(statePtr)).Faddr)).Fai_addrlen)
	if !(ret < 0) {
		goto __14
	}
	*(*int32)(unsafe.Pointer(bp + 20 /* error */)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
__14:
	;
	if !(ret < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EINPROGRESS) {
		goto __15
	}
	XTcl_CreateFileHandler(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd,
		int32(1)<<2|int32(1)<<3, *(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, int32)
		}{sTcpAsyncCallback})),
		statePtr)
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = EAGAIN
	*(*int32)(unsafe.Pointer(statePtr + 32)) |= int32(1) << 4
	return TCL_OK

reenter:
	*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(int32(1) << 4)
	XTcl_DeleteFileHandler(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd)

	// Read the error state from the socket to see if the async
	// connection has succeeded or failed. As this clears the
	// error condition, we cache the status in the socket state
	// struct for later retrieval by [fconfigure -error].

	*(*Socklen_t)(unsafe.Pointer(bp + 24 /* optlen */)) = Socklen_t(unsafe.Sizeof(int32(0)))

	libc.Xgetsockopt(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, SOL_SOCKET, SO_ERROR,
		bp+20, bp+24)
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = *(*int32)(unsafe.Pointer(bp + 20 /* error */))
__15:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 20)) == 0) {
		goto __16
	}
	goto out
__16:
	;
	goto __6
__6:
	(*TcpState)(unsafe.Pointer(statePtr)).Fmyaddr = (*Addrinfo)(unsafe.Pointer((*TcpState)(unsafe.Pointer(statePtr)).Fmyaddr)).Fai_next
	goto __5
	goto __7
__7:
	;
	goto __3
__3:
	(*TcpState)(unsafe.Pointer(statePtr)).Faddr = (*Addrinfo)(unsafe.Pointer((*TcpState)(unsafe.Pointer(statePtr)).Faddr)).Fai_next
	goto __2
	goto __4
__4:
	;

out:
	(*TcpState)(unsafe.Pointer(statePtr)).FconnectError = *(*int32)(unsafe.Pointer(bp + 20 /* error */))
	*(*int32)(unsafe.Pointer(statePtr + 32)) &= libc.CplInt32(int32(1) << 1)
	if !(async_callback != 0) {
		goto __17
	}
	// An asynchonous connection has finally succeeded or failed.

	sTcpWatchProc(tls, statePtr, (*TcpState)(unsafe.Pointer(statePtr)).Ffilehandlers)
	XTclUnixSetBlockingMode(tls, (*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd, (*TcpState)(unsafe.Pointer(statePtr)).FcachedBlocking)

	if !(*(*int32)(unsafe.Pointer(bp + 20)) != 0) {
		goto __18
	}
	*(*int32)(unsafe.Pointer(statePtr + 32)) |= int32(1) << 5
__18:
	;

	// We need to forward the writable event that brought us here, bcasue
	// upon reading of getsockopt(SO_ERROR), at least some OSes clear the
	// writable state from the socket, and so a subsequent select() on
	// behalf of a script level [fileevent] would not fire. It doesn't
	// hurt that this is also called in the successful case and will save
	// the event mechanism one roundtrip through select().

	if !((*TcpState)(unsafe.Pointer(statePtr)).FcachedBlocking == TCL_MODE_NONBLOCKING) {
		goto __19
	}
	XTcl_NotifyChannel(tls, (*TcpState)(unsafe.Pointer(statePtr)).Fchannel, int32(1)<<2)
__19:
	;
__17:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 20)) != 0) {
		goto __20
	}
	// Failure for either a synchronous connection, or an async one that
	// failed before it could enter background mode, e.g. because an
	// invalid -myaddr was given.

	if !(interp != uintptr(0)) {
		goto __21
	}
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = *(*int32)(unsafe.Pointer(bp + 20 /* error */))
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+70711, libc.VaList(bp+8, XTcl_PosixError(tls, interp))))
__21:
	;
	return TCL_ERROR
__20:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_OpenTcpClient --
//
//	Opens a TCP client socket and creates a channel around it.
//
// Results:
//	The channel or NULL if failed. An error message is returned in the
//	interpreter on failure.
//
// Side effects:
//	Opens a client socket and creates a new channel.
//
//----------------------------------------------------------------------

func XTcl_OpenTcpClient(tls *libc.TLS, interp uintptr, port int32, host uintptr, myaddr uintptr, myport int32, async int32) Tcl_Channel { /* tclUnixSock.c:1378:1: */
	bp := tls.Alloc(61)
	defer tls.Free(61)

	var statePtr uintptr
	*(*uintptr)(unsafe.Pointer(bp + 24 /* errorMsg */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 16 /* addrlist */)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 32 /* myaddrlist */)) = uintptr(0)
	// var channelName [21]int8 at bp+40, 21

	// Do the name lookups for the local and remote addresses.

	if !(XTclCreateSocketAddress(tls, interp, bp+16, host, port, 0, bp+24) != 0) ||
		!(XTclCreateSocketAddress(tls, interp, bp+32, myaddr, myport, 1,
			bp+24) != 0) {
		if *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0) {
			libc.Xfreeaddrinfo(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* addrlist */)))
		}
		if interp != uintptr(0) {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+70711, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 24 /* errorMsg */)))))
		}
		return uintptr(0)
	}

	// Allocate a new TcpState for this socket.

	statePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TcpState{})))
	libc.Xmemset(tls, statePtr, 0, uint64(unsafe.Sizeof(TcpState{})))
	(*TcpState)(unsafe.Pointer(statePtr)).Fflags = func() int32 {
		if async != 0 {
			return int32(1) << 1
		}
		return 0
	}()
	(*TcpState)(unsafe.Pointer(statePtr)).FcachedBlocking = TCL_MODE_BLOCKING
	(*TcpState)(unsafe.Pointer(statePtr)).Faddrlist = *(*uintptr)(unsafe.Pointer(bp + 16 /* addrlist */))
	(*TcpState)(unsafe.Pointer(statePtr)).Fmyaddrlist = *(*uintptr)(unsafe.Pointer(bp + 32 /* myaddrlist */))
	(*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd = -1

	// Create a new client socket and wrap it in a channel.

	if sTcpConnect(tls, interp, statePtr) != TCL_OK {
		sTcpCloseProc(tls, statePtr, uintptr(0))
		return uintptr(0)
	}

	libc.Xsprintf(tls, bp+40, ts+70736, libc.VaList(bp+8, int64(statePtr)))

	(*TcpState)(unsafe.Pointer(statePtr)).Fchannel = XTcl_CreateChannel(tls, uintptr(unsafe.Pointer(&tcpChannelType)), bp+40,
		statePtr, int32(1)<<1|int32(1)<<2)
	if XTcl_SetChannelOption(tls, interp, (*TcpState)(unsafe.Pointer(statePtr)).Fchannel, ts+33606,
		ts+67261) == TCL_ERROR {
		XTcl_Close(tls, uintptr(0), (*TcpState)(unsafe.Pointer(statePtr)).Fchannel)
		return uintptr(0)
	}
	return (*TcpState)(unsafe.Pointer(statePtr)).Fchannel
}

//----------------------------------------------------------------------
//
// Tcl_MakeTcpClientChannel --
//
//	Creates a Tcl_Channel from an existing client TCP socket.
//
// Results:
//	The Tcl_Channel wrapped around the preexisting TCP socket.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_MakeTcpClientChannel(tls *libc.TLS, sock ClientData) Tcl_Channel { /* tclUnixSock.c:1460:1: */
	return XTclpMakeTcpClientChannelMode(tls, sock,
		int32(1)<<1|int32(1)<<2)
}

//----------------------------------------------------------------------
//
// TclpMakeTcpClientChannelMode --
//
//	Creates a Tcl_Channel from an existing client TCP socket
//	with given mode.
//
// Results:
//	The Tcl_Channel wrapped around the preexisting TCP socket.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpMakeTcpClientChannelMode(tls *libc.TLS, sock uintptr, mode int32) uintptr { /* tclUnixSock.c:1484:6: */
	bp := tls.Alloc(29)
	defer tls.Free(29)

	var statePtr uintptr
	// var channelName [21]int8 at bp+8, 21

	statePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TcpState{})))
	libc.Xmemset(tls, statePtr, 0, uint64(unsafe.Sizeof(TcpState{})))
	(*TcpState)(unsafe.Pointer(statePtr)).Ffds.Ffd = int32(sock)
	(*TcpState)(unsafe.Pointer(statePtr)).Fflags = 0

	libc.Xsprintf(tls, bp+8, ts+70736, libc.VaList(bp, int64(statePtr)))

	(*TcpState)(unsafe.Pointer(statePtr)).Fchannel = XTcl_CreateChannel(tls, uintptr(unsafe.Pointer(&tcpChannelType)), bp+8,
		statePtr, mode)
	if XTcl_SetChannelOption(tls, uintptr(0), (*TcpState)(unsafe.Pointer(statePtr)).Fchannel, ts+33606,
		ts+67261) == TCL_ERROR {
		XTcl_Close(tls, uintptr(0), (*TcpState)(unsafe.Pointer(statePtr)).Fchannel)
		return uintptr(0)
	}
	return (*TcpState)(unsafe.Pointer(statePtr)).Fchannel
}

//----------------------------------------------------------------------
//
// Tcl_OpenTcpServer --
//
//	Opens a TCP server socket and creates a channel around it.
//
// Results:
//	The channel or NULL if failed. If an error occurred, an error message
//	is left in the interp's result if interp is not NULL.
//
// Side effects:
//	Opens a server socket and creates a new channel.
//
//----------------------------------------------------------------------

func XTcl_OpenTcpServer(tls *libc.TLS, interp uintptr, port int32, myHost uintptr, acceptProc uintptr, acceptProcData ClientData) Tcl_Channel { /* tclUnixSock.c:1528:1: */
	bp := tls.Alloc(193)
	defer tls.Free(193)

	var status int32
	var sock int32
	// var reuseaddr int32 at bp+32, 4

	var chosenport int32
	// var addrlist uintptr at bp+16, 8

	var addrPtr uintptr // socket address
	var statePtr uintptr
	// var channelName [21]int8 at bp+172, 21

	// var errorMsg uintptr at bp+24, 8

	var fds uintptr
	var newfds uintptr

	// Try to record and return the most meaningful error message, i.e. the
	// one from the first socket that went the farthest before it failed.

	var howfar uint32
	var my_errno int32
	// var v6only int32 at bp+36, 4

	// var sockname Address at bp+40, 128

	// var namelen Socklen_t at bp+168, 4

	var errorObj uintptr
	status = 0
	sock = -1
	*(*int32)(unsafe.Pointer(bp + 32 /* reuseaddr */)) = 1
	chosenport = 0
	*(*uintptr)(unsafe.Pointer(bp + 16 /* addrlist */)) = uintptr(0)
	statePtr = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 24 /* errorMsg */)) = uintptr(0)
	fds = uintptr(0)
	howfar = uint32(0) /* LOOKUP */
	my_errno = 0

	if !!(XTclCreateSocketAddress(tls, interp, bp+16, myHost, port, 1, bp+24) != 0) {
		goto __1
	}
	my_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
	goto error
__1:
	;

	addrPtr = *(*uintptr)(unsafe.Pointer(bp + 16 /* addrlist */))
__2:
	if !(addrPtr != uintptr(0)) {
		goto __4
	}
	sock = libc.Xsocket(tls, (*Addrinfo)(unsafe.Pointer(addrPtr)).Fai_family, (*Addrinfo)(unsafe.Pointer(addrPtr)).Fai_socktype,
		(*Addrinfo)(unsafe.Pointer(addrPtr)).Fai_protocol)
	if !(sock == -1) {
		goto __5
	}
	if !(howfar < uint32(1)) {
		goto __6
	}
	howfar = uint32(1) /* SOCKET */
	my_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
__6:
	;
	goto __3
__5:
	;

	// Set the close-on-exec flag so that the socket will not get
	// inherited by child processes.

	libc.Xfcntl(tls, sock, F_SETFD, libc.VaList(bp, FD_CLOEXEC))

	// Set kernel space buffering

	XTclSockMinimumBuffers(tls, uintptr(Intptr_t(sock)), SOCKET_BUFSIZE)

	// Set up to reuse server addresses automatically and bind to the
	// specified port.

	libc.Xsetsockopt(tls, sock, SOL_SOCKET, SO_REUSEADDR,
		bp+32, uint32(unsafe.Sizeof(int32(0))))

	// Make sure we use the same port number when opening two server
	// sockets for IPv4 and IPv6 on a random port.
	//
	// As sockaddr_in6 uses the same offset and size for the port member
	// as sockaddr_in, we can handle both through the IPv4 API.

	if !(port == 0 && chosenport != 0) {
		goto __7
	}
	(*Sockaddr_in)(unsafe.Pointer((*Addrinfo)(unsafe.Pointer(addrPtr)).Fai_addr)).Fsin_port = libc.Xhtons(tls, uint16(chosenport))
__7:
	;

	// Missing on: Solaris 2.8

	if !((*Addrinfo)(unsafe.Pointer(addrPtr)).Fai_family == PF_INET6) {
		goto __8
	}
	*(*int32)(unsafe.Pointer(bp + 36 /* v6only */)) = 1

	libc.Xsetsockopt(tls, sock, IPPROTO_IPV6, IPV6_V6ONLY,
		bp+36, uint32(unsafe.Sizeof(int32(0))))
__8:
	;

	status = libc.Xbind(tls, sock, (*Addrinfo)(unsafe.Pointer(addrPtr)).Fai_addr, (*Addrinfo)(unsafe.Pointer(addrPtr)).Fai_addrlen)
	if !(status == -1) {
		goto __9
	}
	if !(howfar < uint32(2)) {
		goto __10
	}
	howfar = uint32(2) /* BIND */
	my_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
__10:
	;
	libc.Xclose(tls, sock)
	sock = -1
	goto __3
__9:
	;
	if !(port == 0 && chosenport == 0) {
		goto __11
	}
	*(*Socklen_t)(unsafe.Pointer(bp + 168 /* namelen */)) = Socklen_t(unsafe.Sizeof(Address{}))

	// Synchronize port numbers when binding to port 0 of multiple
	// addresses.

	if !(libc.Xgetsockname(tls, sock, bp+40, bp+168) >= 0) {
		goto __12
	}
	chosenport = int32(libc.Xntohs(tls, (*Sockaddr_in)(unsafe.Pointer(bp+40)).Fsin_port))
__12:
	;
__11:
	;
	status = libc.Xlisten(tls, sock, SOMAXCONN)
	if !(status < 0) {
		goto __13
	}
	if !(howfar < uint32(3)) {
		goto __14
	}
	howfar = uint32(3) /* LISTEN */
	my_errno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
__14:
	;
	libc.Xclose(tls, sock)
	sock = -1
	goto __3
__13:
	;
	if !(statePtr == uintptr(0)) {
		goto __15
	}
	// Allocate a new TcpState for this socket.

	statePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TcpState{})))
	libc.Xmemset(tls, statePtr, 0, uint64(unsafe.Sizeof(TcpState{})))
	(*TcpState)(unsafe.Pointer(statePtr)).FacceptProc = acceptProc
	(*TcpState)(unsafe.Pointer(statePtr)).FacceptProcData = acceptProcData
	libc.Xsprintf(tls, bp+172, ts+70736, libc.VaList(bp+8, int64(statePtr)))
	newfds = statePtr + 8
	goto __16
__15:
	newfds = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TcpFdList{})))
	libc.Xmemset(tls, newfds, 0, uint64(unsafe.Sizeof(TcpFdList{})))
	(*TcpFdList)(unsafe.Pointer(fds)).Fnext = newfds
__16:
	;
	(*TcpFdList)(unsafe.Pointer(newfds)).Ffd = sock
	(*TcpFdList)(unsafe.Pointer(newfds)).FstatePtr = statePtr
	fds = newfds

	// Set up the callback mechanism for accepting connections from new
	// clients.

	XTcl_CreateFileHandler(tls, sock, int32(1)<<1, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, int32)
	}{sTcpAccept})), fds)
	goto __3
__3:
	addrPtr = (*Addrinfo)(unsafe.Pointer(addrPtr)).Fai_next
	goto __2
	goto __4
__4:
	;

error:
	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0)) {
		goto __17
	}
	libc.Xfreeaddrinfo(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* addrlist */)))
__17:
	;
	if !(statePtr != uintptr(0)) {
		goto __18
	}
	(*TcpState)(unsafe.Pointer(statePtr)).Fchannel = XTcl_CreateChannel(tls, uintptr(unsafe.Pointer(&tcpChannelType)), bp+172,
		statePtr, 0)
	return (*TcpState)(unsafe.Pointer(statePtr)).Fchannel
__18:
	;
	if !(interp != uintptr(0)) {
		goto __19
	}
	errorObj = XTcl_NewStringObj(tls, ts+70744, -1)

	if !(*(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0)) {
		goto __20
	}
	*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = my_errno
	XTcl_AppendToObj(tls, errorObj, XTcl_PosixError(tls, interp), -1)
	goto __21
__20:
	XTcl_AppendToObj(tls, errorObj, *(*uintptr)(unsafe.Pointer(bp + 24 /* errorMsg */)), -1)
__21:
	;
	XTcl_SetObjResult(tls, interp, errorObj)
__19:
	;
	if !(sock != -1) {
		goto __22
	}
	libc.Xclose(tls, sock)
__22:
	;
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// TcpAccept --
//	Accept a TCP socket connection.	 This is called by the event loop.
//
// Results:
//	None.
//
// Side effects:
//	Creates a new connection socket. Calls the registered callback for the
//	connection acceptance mechanism.
//
//----------------------------------------------------------------------

func sTcpAccept(tls *libc.TLS, data ClientData, mask int32) { /* tclUnixSock.c:1719:1: */
	bp := tls.Alloc(1226)
	defer tls.Free(1226)

	var fds uintptr = data   // Client data of server socket.
	var newsock int32        // The new client socket
	var newSockState uintptr // State for new socket.
	// var addr Address at bp+16, 128
	// The remote address
	// var len Socklen_t at bp+144, 4
	// For accept interface
	// var channelName [21]int8 at bp+148, 21

	// var host [1025]int8 at bp+169, 1025

	// var port [32]int8 at bp+1194, 32

	_ = mask

	*(*Socklen_t)(unsafe.Pointer(bp + 144 /* len */)) = Socklen_t(unsafe.Sizeof(Address{}))
	newsock = libc.Xaccept(tls, (*TcpFdList)(unsafe.Pointer(fds)).Ffd, bp+16, bp+144)
	if newsock < 0 {
		return
	}

	// Set close-on-exec flag to prevent the newly accepted socket from being
	// inherited by child processes.

	libc.Xfcntl(tls, newsock, F_SETFD, libc.VaList(bp, FD_CLOEXEC))

	newSockState = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TcpState{})))
	libc.Xmemset(tls, newSockState, 0, uint64(unsafe.Sizeof(TcpState{})))
	(*TcpState)(unsafe.Pointer(newSockState)).Fflags = 0
	(*TcpState)(unsafe.Pointer(newSockState)).Ffds.Ffd = newsock

	libc.Xsprintf(tls, bp+148, ts+70736, libc.VaList(bp+8, int64(newSockState)))
	(*TcpState)(unsafe.Pointer(newSockState)).Fchannel = XTcl_CreateChannel(tls, uintptr(unsafe.Pointer(&tcpChannelType)), bp+148,
		newSockState, int32(1)<<1|int32(1)<<2)

	XTcl_SetChannelOption(tls, uintptr(0), (*TcpState)(unsafe.Pointer(newSockState)).Fchannel, ts+33606,
		ts+67261)

	if (*TcpState)(unsafe.Pointer((*TcpFdList)(unsafe.Pointer(fds)).FstatePtr)).FacceptProc != uintptr(0) {
		libc.Xgetnameinfo(tls, bp+16, *(*Socklen_t)(unsafe.Pointer(bp + 144 /* len */)), bp+169, uint32(unsafe.Sizeof([1025]int8{})), bp+1194, uint32(unsafe.Sizeof([32]int8{})),
			NI_NUMERICHOST|NI_NUMERICSERV)
		(*struct {
			f func(*libc.TLS, ClientData, Tcl_Channel, uintptr, int32)
		})(unsafe.Pointer(&struct{ uintptr }{(*TcpState)(unsafe.Pointer((*TcpFdList)(unsafe.Pointer(fds)).FstatePtr)).FacceptProc})).f(tls, (*TcpState)(unsafe.Pointer((*TcpFdList)(unsafe.Pointer(fds)).FstatePtr)).FacceptProcData,
			(*TcpState)(unsafe.Pointer(newSockState)).Fchannel, bp+169, libc.Xatoi(tls, bp+1194 /* &port[0] */))
	}
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// tab-width: 8
// indent-tabs-mode: nil
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

type ThreadSpecificData15 = struct{ Fnabuf [16]int8 } /* tclUnixThrd.c:20:3 */

var dataKey14 Tcl_ThreadDataKey /* tclUnixThrd.c:22:26: */

// globalLock is used to serialize creation of mutexes, condition variables,
// and thread local storage. This is the only place that can count on the
// ability to statically initialize the mutex.

var globalLock = Pthread_mutex_t{} /* tclUnixThrd.c:30:24 */

// initLock is used to serialize initialization and finalization of Tcl. It
// cannot use any dynamically allocated storage.

var initLock = Pthread_mutex_t{} /* tclUnixThrd.c:37:24 */

// allocLock is used by Tcl's version of malloc for synchronization. For
// obvious reasons, cannot use any dynamically allocated storage.

var allocLock = Pthread_mutex_t{} /* tclUnixThrd.c:44:24 */
var allocLockPtr uintptr = 0      /* tclUnixThrd.c:45:24 */

// These are for the critical sections inside this file.

//----------------------------------------------------------------------
//
// TclpThreadCreate --
//
//	This procedure creates a new thread.
//
// Results:
//	TCL_OK if the thread could be created. The thread ID is returned in a
//	parameter.
//
// Side effects:
//	A new thread is created.
//
//----------------------------------------------------------------------

func XTclpThreadCreate(tls *libc.TLS, idPtr uintptr, proc uintptr, clientData ClientData, stackSize int32, flags int32) int32 { /* tclUnixThrd.c:74:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	// var attr Pthread_attr_t at bp, 56

	// var theThread Pthread_t at bp+56, 8

	var result int32

	libc.Xpthread_attr_init(tls, bp)
	libc.Xpthread_attr_setscope(tls, bp, PTHREAD_SCOPE_SYSTEM)

	if stackSize != 0 {
		libc.Xpthread_attr_setstacksize(tls, bp, uint64(stackSize))
	}

	if !(flags&0001 != 0) {
		libc.Xpthread_attr_setdetachstate(tls, bp, PTHREAD_CREATE_DETACHED)
	}

	if libc.Xpthread_create(tls, bp+56, bp,
		proc, clientData) != 0 && libc.Xpthread_create(tls, bp+56, uintptr(0),
		proc, clientData) != 0 {
		result = TCL_ERROR
	} else {
		*(*Tcl_ThreadId)(unsafe.Pointer(idPtr)) = Tcl_ThreadId(*(*Pthread_t)(unsafe.Pointer(bp + 56 /* theThread */)))
		result = TCL_OK
	}
	libc.Xpthread_attr_destroy(tls, bp)
	return result
}

//----------------------------------------------------------------------
//
// Tcl_JoinThread --
//
//	This procedure waits upon the exit of the specified thread.
//
// Results:
//	TCL_OK if the wait was successful, TCL_ERROR else.
//
// Side effects:
//	The result area is set to the exit code of the thread we waited upon.
//
//----------------------------------------------------------------------

func XTcl_JoinThread(tls *libc.TLS, threadId Tcl_ThreadId, state uintptr) int32 { /* tclUnixThrd.c:154:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var result int32
	// var retcode uint64 at bp, 8

	var retcodePtr uintptr = bp /* &retcode */

	result = libc.Xpthread_join(tls, uint64(threadId), retcodePtr)
	if state != 0 {
		*(*int32)(unsafe.Pointer(state)) = int32(*(*uint64)(unsafe.Pointer(bp /* retcode */)))
	}
	if result == 0 {
		return TCL_OK
	}
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclpThreadExit --
//
//	This procedure terminates the current thread.
//
// Results:
//	None.
//
// Side effects:
//	This procedure terminates the current thread.
//
//----------------------------------------------------------------------

func XTclpThreadExit(tls *libc.TLS, status int32) { /* tclUnixThrd.c:192:1: */
	libc.Xpthread_exit(tls, uintptr(Intptr_t(status)))
}

//----------------------------------------------------------------------
//
// Tcl_GetCurrentThread --
//
//	This procedure returns the ID of the currently running thread.
//
// Results:
//	A thread ID.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetCurrentThread(tls *libc.TLS) Tcl_ThreadId { /* tclUnixThrd.c:216:1: */
	return Tcl_ThreadId(libc.Xpthread_self(tls))
}

//----------------------------------------------------------------------
//
// TclpInitLock
//
//	This procedure is used to grab a lock that serializes initialization
//	and finalization of Tcl. On some platforms this may also initialize
//	the mutex used to serialize creation of more mutexes and thread local
//	storage keys.
//
// Results:
//	None.
//
// Side effects:
//	Acquire the initialization mutex.
//
//----------------------------------------------------------------------

func XTclpInitLock(tls *libc.TLS) { /* tclUnixThrd.c:245:1: */
	libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&initLock)))
}

//----------------------------------------------------------------------
//
// TclFinalizeLock
//
//	This procedure is used to destroy all private resources used in this
//	file.
//
// Results:
//	None.
//
// Side effects:
//	Destroys everything private. TclpInitLock must be held entering this
//	function.
//
//----------------------------------------------------------------------

func XTclFinalizeLock(tls *libc.TLS) { /* tclUnixThrd.c:271:1: */
	// You do not need to destroy mutexes that were created with the
	// PTHREAD_MUTEX_INITIALIZER macro. These mutexes do not need any
	// destruction: globalLock, allocLock, and initLock.

	libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&initLock)))
}

//----------------------------------------------------------------------
//
// TclpInitUnlock
//
//	This procedure is used to release a lock that serializes
//	initialization and finalization of Tcl.
//
// Results:
//	None.
//
// Side effects:
//	Release the initialization mutex.
//
//----------------------------------------------------------------------

func XTclpInitUnlock(tls *libc.TLS) { /* tclUnixThrd.c:302:1: */
	libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&initLock)))
}

//----------------------------------------------------------------------
//
// TclpGlobalLock
//
//	This procedure is used to grab a lock that serializes creation and
//	finalization of serialization objects. This interface is only needed
//	in finalization; it is hidden during creation of the objects.
//
//	This lock must be different than the initLock because the initLock is
//	held during creation of synchronization objects.
//
// Results:
//	None.
//
// Side effects:
//	Acquire the global mutex.
//
//----------------------------------------------------------------------

func XTclpGlobalLock(tls *libc.TLS) { /* tclUnixThrd.c:331:1: */
	libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&globalLock)))
}

//----------------------------------------------------------------------
//
// TclpGlobalUnlock
//
//	This procedure is used to release a lock that serializes creation and
//	finalization of synchronization objects.
//
// Results:
//	None.
//
// Side effects:
//	Release the global mutex.
//
//----------------------------------------------------------------------

func XTclpGlobalUnlock(tls *libc.TLS) { /* tclUnixThrd.c:356:1: */
	libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&globalLock)))
}

//----------------------------------------------------------------------
//
// Tcl_GetAllocMutex
//
//	This procedure returns a pointer to a statically initialized mutex for
//	use by the memory allocator. The allocator must use this lock, because
//	all other locks are allocated...
//
// Results:
//	A pointer to a mutex that is suitable for passing to Tcl_MutexLock and
//	Tcl_MutexUnlock.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetAllocMutex(tls *libc.TLS) uintptr { /* tclUnixThrd.c:382:11: */
	var allocLockPtrPtr uintptr = uintptr(unsafe.Pointer(&allocLockPtr))
	return allocLockPtrPtr
}

//----------------------------------------------------------------------
//
// Tcl_MutexLock --
//
//	This procedure is invoked to lock a mutex. This procedure handles
//	initializing the mutex, if necessary. The caller can rely on the fact
//	that Tcl_Mutex is an opaque pointer. This routine will change that
//	pointer from NULL after first use.
//
// Results:
//	None.
//
// Side effects:
//	May block the current thread. The mutex is acquired when this returns.
//	Will allocate memory for a pthread_mutex_t and initialize this the
//	first time this Tcl_Mutex is used.
//
//----------------------------------------------------------------------

func XTcl_MutexLock(tls *libc.TLS, mutexPtr uintptr) { /* tclUnixThrd.c:417:1: */
	var pmutexPtr uintptr

	if *(*Tcl_Mutex)(unsafe.Pointer(mutexPtr)) == uintptr(0) {
		libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&globalLock)))
		if *(*Tcl_Mutex)(unsafe.Pointer(mutexPtr)) == uintptr(0) {
			// Double inside global lock check to avoid a race condition.

			pmutexPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Pthread_mutex_t{})))
			libc.Xpthread_mutex_init(tls, pmutexPtr, uintptr(0))
			*(*Tcl_Mutex)(unsafe.Pointer(mutexPtr)) = pmutexPtr
			XTclRememberMutex(tls, mutexPtr)
		}
		libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&globalLock)))
	}
	pmutexPtr = *(*uintptr)(unsafe.Pointer(mutexPtr))
	libc.Xpthread_mutex_lock(tls, pmutexPtr)
}

//----------------------------------------------------------------------
//
// Tcl_MutexUnlock --
//
//	This procedure is invoked to unlock a mutex. The mutex must have been
//	locked by Tcl_MutexLock.
//
// Results:
//	None.
//
// Side effects:
//	The mutex is released when this returns.
//
//----------------------------------------------------------------------

func XTcl_MutexUnlock(tls *libc.TLS, mutexPtr uintptr) { /* tclUnixThrd.c:458:1: */
	var pmutexPtr uintptr = *(*uintptr)(unsafe.Pointer(mutexPtr))

	libc.Xpthread_mutex_unlock(tls, pmutexPtr)
}

//----------------------------------------------------------------------
//
// TclpFinalizeMutex --
//
//	This procedure is invoked to clean up one mutex. This is only safe to
//	call at the end of time.
//
//	This assumes the Global Lock is held.
//
// Results:
//	None.
//
// Side effects:
//	The mutex list is deallocated.
//
//----------------------------------------------------------------------

func XTclpFinalizeMutex(tls *libc.TLS, mutexPtr uintptr) { /* tclUnixThrd.c:486:1: */
	var pmutexPtr uintptr = *(*uintptr)(unsafe.Pointer(mutexPtr))

	if pmutexPtr != uintptr(0) {
		libc.Xpthread_mutex_destroy(tls, pmutexPtr)
		XTclpFree(tls, pmutexPtr)
		*(*Tcl_Mutex)(unsafe.Pointer(mutexPtr)) = uintptr(0)
	}
}

//----------------------------------------------------------------------
//
// Tcl_ConditionWait --
//
//	This procedure is invoked to wait on a condition variable. The mutex
//	is automically released as part of the wait, and automatically grabbed
//	when the condition is signaled.
//
//	The mutex must be held when this procedure is called.
//
// Results:
//	None.
//
// Side effects:
//	May block the current thread. The mutex is acquired when this returns.
//	Will allocate memory for a pthread_mutex_t and initialize this the
//	first time this Tcl_Mutex is used.
//
//----------------------------------------------------------------------

func XTcl_ConditionWait(tls *libc.TLS, condPtr uintptr, mutexPtr uintptr, timePtr uintptr) { /* tclUnixThrd.c:521:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var pcondPtr uintptr
	var pmutexPtr uintptr
	// var ptime Timespec at bp+16, 16

	if *(*Tcl_Condition)(unsafe.Pointer(condPtr)) == uintptr(0) {
		libc.Xpthread_mutex_lock(tls, uintptr(unsafe.Pointer(&globalLock)))

		// Double check inside mutex to avoid race, then initialize condition
		// variable if necessary.

		if *(*Tcl_Condition)(unsafe.Pointer(condPtr)) == uintptr(0) {
			pcondPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Pthread_cond_t{})))
			libc.Xpthread_cond_init(tls, pcondPtr, uintptr(0))
			*(*Tcl_Condition)(unsafe.Pointer(condPtr)) = pcondPtr
			XTclRememberCondition(tls, condPtr)
		}
		libc.Xpthread_mutex_unlock(tls, uintptr(unsafe.Pointer(&globalLock)))
	}
	pmutexPtr = *(*uintptr)(unsafe.Pointer(mutexPtr))
	pcondPtr = *(*uintptr)(unsafe.Pointer(condPtr))
	if timePtr == uintptr(0) {
		libc.Xpthread_cond_wait(tls, pcondPtr, pmutexPtr)
	} else {
		// var now Tcl_Time at bp, 16

		// Make sure to take into account the microsecond component of the
		// current time, including possible overflow situations. [Bug #411603]

		XTcl_GetTime(tls, bp)
		(*Timespec)(unsafe.Pointer(bp + 16 /* &ptime */)).Ftv_sec = (*Tcl_Time)(unsafe.Pointer(timePtr)).Fsec + (*Tcl_Time)(unsafe.Pointer(bp)).Fsec + ((*Tcl_Time)(unsafe.Pointer(timePtr)).Fusec+(*Tcl_Time)(unsafe.Pointer(bp)).Fusec)/int64(1000000)
		(*Timespec)(unsafe.Pointer(bp + 16 /* &ptime */)).Ftv_nsec = int64(1000) * (((*Tcl_Time)(unsafe.Pointer(timePtr)).Fusec + (*Tcl_Time)(unsafe.Pointer(bp)).Fusec) % int64(1000000))
		libc.Xpthread_cond_timedwait(tls, pcondPtr, pmutexPtr, bp+16)
	}
}

//----------------------------------------------------------------------
//
// Tcl_ConditionNotify --
//
//	This procedure is invoked to signal a condition variable.
//
//	The mutex must be held during this call to avoid races, but this
//	interface does not enforce that.
//
// Results:
//	None.
//
// Side effects:
//	May unblock another thread.
//
//----------------------------------------------------------------------

func XTcl_ConditionNotify(tls *libc.TLS, condPtr uintptr) { /* tclUnixThrd.c:586:1: */
	var pcondPtr uintptr = *(*uintptr)(unsafe.Pointer(condPtr))

	if pcondPtr != uintptr(0) {
		libc.Xpthread_cond_broadcast(tls, pcondPtr)
	} else {
		// No-one has used the condition variable, so there are no waiters.
	}
}

//----------------------------------------------------------------------
//
// TclpFinalizeCondition --
//
//	This procedure is invoked to clean up a condition variable. This is
//	only safe to call at the end of time.
//
//	This assumes the Global Lock is held.
//
// Results:
//	None.
//
// Side effects:
//	The condition variable is deallocated.
//
//----------------------------------------------------------------------

func XTclpFinalizeCondition(tls *libc.TLS, condPtr uintptr) { /* tclUnixThrd.c:620:1: */
	var pcondPtr uintptr = *(*uintptr)(unsafe.Pointer(condPtr))

	if pcondPtr != uintptr(0) {
		libc.Xpthread_cond_destroy(tls, pcondPtr)
		XTclpFree(tls, pcondPtr)
		*(*Tcl_Condition)(unsafe.Pointer(condPtr)) = uintptr(0)
	}
}

//----------------------------------------------------------------------
//
// TclpReaddir, TclpInetNtoa --
//
//	These procedures replace core C versions to be used in a threaded
//	environment.
//
// Results:
//	See documentation of C functions.
//
// Side effects:
//	See documentation of C functions.
//
// Notes:
//	TclpReaddir is no longer used by the core (see 1095909), but it
//	appears in the internal stubs table (see #589526).
//
//----------------------------------------------------------------------

func XTclpReaddir(tls *libc.TLS, dir uintptr) uintptr { /* tclUnixThrd.c:654:14: */
	return libc.Xreaddir(tls, dir)
}

func XTclpInetNtoa(tls *libc.TLS, addr In_addr) uintptr { /* tclUnixThrd.c:662:6: */
	bp := tls.Alloc(36)
	defer tls.Free(36)
	*(*In_addr)(unsafe.Pointer(bp + 32)) = addr

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&dataKey14)), int32(unsafe.Sizeof(ThreadSpecificData15{})))
	var b uintptr = bp + 32

	libc.Xsprintf(tls, tsdPtr, ts+70767, libc.VaList(bp, int32(*(*uint8)(unsafe.Pointer(b))), int32(*(*uint8)(unsafe.Pointer(b + 1))), int32(*(*uint8)(unsafe.Pointer(b + 2))), int32(*(*uint8)(unsafe.Pointer(b + 3)))))
	return tsdPtr /* &.nabuf */
}

// Additions by AOL for specialized thread memory allocator.

var initialized int32 = 0 /* tclUnixThrd.c:683:21 */
var key Pthread_key_t     /* tclUnixThrd.c:684:22: */

type AllocMutex = struct {
	Ftlock Tcl_Mutex
	Fplock Pthread_mutex_t
} /* tclUnixThrd.c:689:3 */

func XTclpNewAllocMutex(tls *libc.TLS) uintptr { /* tclUnixThrd.c:691:11: */
	var lockPtr uintptr
	var plockPtr uintptr

	lockPtr = libc.Xmalloc(tls, uint64(unsafe.Sizeof(AllocMutex{})))
	if lockPtr == uintptr(0) {
		XTcl_Panic(tls, ts+70779, 0)
	}
	plockPtr = lockPtr + 8
	(*AllocMutex)(unsafe.Pointer(lockPtr)).Ftlock = plockPtr
	libc.Xpthread_mutex_init(tls, lockPtr+8, uintptr(0))
	return lockPtr
}

func XTclpFreeAllocMutex(tls *libc.TLS, mutex uintptr) { /* tclUnixThrd.c:708:1: */
	var lockPtr uintptr = mutex

	if !(lockPtr != 0) {
		return
	}
	libc.Xpthread_mutex_destroy(tls, lockPtr+8)
	libc.Xfree(tls, lockPtr)
}

func XTclpFreeAllocCache(tls *libc.TLS, ptr uintptr) { /* tclUnixThrd.c:721:1: */
	if ptr != uintptr(0) {
		// Called by TclFinalizeThreadAllocThread() during the thread
		// finalization initiated from Tcl_FinalizeThread()

		XTclFreeAllocCache(tls, ptr)
		libc.Xpthread_setspecific(tls, key, uintptr(0))

	} else if libc.AtomicLoadInt32(&initialized) != 0 {
		// Called by TclFinalizeThreadAlloc() during the process
		// finalization initiated from Tcl_Finalize()

		libc.Xpthread_key_delete(tls, key)
		libc.AtomicStoreInt32(&initialized, int32(0))
	}
}

func XTclpGetAllocCache(tls *libc.TLS) uintptr { /* tclUnixThrd.c:744:6: */
	if !(libc.AtomicLoadInt32(&initialized) != 0) {
		libc.Xpthread_mutex_lock(tls, allocLockPtr)
		if !(libc.AtomicLoadInt32(&initialized) != 0) {
			libc.Xpthread_key_create(tls, uintptr(unsafe.Pointer(&key)), uintptr(0))
			libc.AtomicStoreInt32(&initialized, int32(1))
		}
		libc.Xpthread_mutex_unlock(tls, allocLockPtr)
	}
	return libc.Xpthread_getspecific(tls, key)
}

func XTclpSetAllocCache(tls *libc.TLS, arg uintptr) { /* tclUnixThrd.c:759:1: */
	libc.Xpthread_setspecific(tls, key, arg)
}

func XTclpThreadCreateKey(tls *libc.TLS) uintptr { /* tclUnixThrd.c:766:6: */
	var ptkeyPtr uintptr

	ptkeyPtr = libc.Xmalloc(tls, Size_t(unsafe.Sizeof(Pthread_key_t(0))))
	if uintptr(0) == ptkeyPtr {
		XTcl_Panic(tls, ts+70803, 0)
	}

	if libc.Xpthread_key_create(tls, ptkeyPtr, uintptr(0)) != 0 {
		XTcl_Panic(tls, ts+70834, 0)
	}

	return ptkeyPtr
}

func XTclpThreadDeleteKey(tls *libc.TLS, keyPtr uintptr) { /* tclUnixThrd.c:784:1: */
	var ptkeyPtr uintptr = keyPtr

	if libc.Xpthread_key_delete(tls, *(*Pthread_key_t)(unsafe.Pointer(ptkeyPtr))) != 0 {
		XTcl_Panic(tls, ts+70864, 0)
	}

	libc.Xfree(tls, keyPtr)
}

func XTclpThreadSetGlobalTSD(tls *libc.TLS, tsdKeyPtr uintptr, ptr uintptr) { /* tclUnixThrd.c:797:1: */
	var ptkeyPtr uintptr = tsdKeyPtr

	if libc.Xpthread_setspecific(tls, *(*Pthread_key_t)(unsafe.Pointer(ptkeyPtr)), ptr) != 0 {
		XTcl_Panic(tls, ts+70886, 0)
	}
}

func XTclpThreadGetGlobalTSD(tls *libc.TLS, tsdKeyPtr uintptr) uintptr { /* tclUnixThrd.c:808:6: */
	var ptkeyPtr uintptr = tsdKeyPtr

	return libc.Xpthread_getspecific(tls, *(*Pthread_key_t)(unsafe.Pointer(ptkeyPtr)))
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// This value can be passed to `uselocale' and may be returned by it.
//    Passing this value to any other function has undefined behavior.

// TclpGetDate is coded to return a pointer to a 'struct tm'. For thread
// safety, this structure must be in thread-specific data. The 'tmKey'
// variable is the key to this buffer.

var tmKey1 Tcl_ThreadDataKey /* tclUnixTime.c:25:26: */
type ThreadSpecificData16 = struct {
	Fgmtime_buf    Tm
	Flocaltime_buf Tm
} /* tclUnixTime.c:29:3 */

// If we fall back on the thread-unsafe versions of gmtime and localtime, use
// this mutex to try to protect them.

var tmMutex Tcl_Mutex /* tclUnixTime.c:36:1: */

var lastTZ uintptr = uintptr(0) /* tclUnixTime.c:38:13 */

// TIP #233 (Virtualized Time): Data for the time hooks, if any.

var XtclGetTimeProcPtr uintptr = 0             /* tclUnixTime.c:57:17 */
var XtclScaleTimeProcPtr uintptr = 0           /* tclUnixTime.c:58:19 */
var XtclTimeClientData ClientData = uintptr(0) /* tclUnixTime.c:59:12 */

//----------------------------------------------------------------------
//
// TclpGetSeconds --
//
//	This procedure returns the number of seconds from the epoch. On most
//	Unix systems the epoch is Midnight Jan 1, 1970 GMT.
//
// Results:
//	Number of seconds from the epoch.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpGetSeconds(tls *libc.TLS) uint64 { /* tclUnixTime.c:79:1: */
	return uint64(libc.Xtime(tls, uintptr(0)))
}

//----------------------------------------------------------------------
//
// TclpGetMicroseconds --
//
//	This procedure returns the number of microseconds from the epoch.
//	On most Unix systems the epoch is Midnight Jan 1, 1970 GMT.
//
// Results:
//	Number of microseconds from the epoch.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpGetMicroseconds(tls *libc.TLS) Tcl_WideInt { /* tclUnixTime.c:102:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var time Tcl_Time at bp, 16

	(*struct {
		f func(*libc.TLS, uintptr, ClientData)
	})(unsafe.Pointer(&struct{ uintptr }{XtclGetTimeProcPtr})).f(tls, bp /* &time */, XtclTimeClientData)
	return (*Tcl_Time)(unsafe.Pointer(bp)).Fsec*int64(1000000) + (*Tcl_Time)(unsafe.Pointer(bp)).Fusec
}

//----------------------------------------------------------------------
//
// TclpGetClicks --
//
//	This procedure returns a value that represents the highest resolution
//	clock available on the system. There are no garantees on what the
//	resolution will be. In Tcl we will call this value a "click". The
//	start time is also system dependent.
//
// Results:
//	Number of clicks from some start time.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpGetClicks(tls *libc.TLS) uint64 { /* tclUnixTime.c:130:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var now uint64
	// var time Tcl_Time at bp, 16

	(*struct {
		f func(*libc.TLS, uintptr, ClientData)
	})(unsafe.Pointer(&struct{ uintptr }{XtclGetTimeProcPtr})).f(tls, bp /* &time */, XtclTimeClientData)
	now = uint64((*Tcl_Time)(unsafe.Pointer(bp)).Fsec*int64(1000000) + (*Tcl_Time)(unsafe.Pointer(bp)).Fusec)

	return now
}

//----------------------------------------------------------------------
//
// Tcl_GetTime --
//
//	Gets the current system time in seconds and microseconds since the
//	beginning of the epoch: 00:00 UCT, January 1, 1970.
//
//	This function is hooked, allowing users to specify their own virtual
//	system time.
//
// Results:
//	Returns the current time in timePtr.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetTime(tls *libc.TLS, timePtr uintptr) { /* tclUnixTime.c:313:1: */
	(*struct {
		f func(*libc.TLS, uintptr, ClientData)
	})(unsafe.Pointer(&struct{ uintptr }{XtclGetTimeProcPtr})).f(tls, timePtr, XtclTimeClientData)
}

//----------------------------------------------------------------------
//
// TclpGetDate --
//
//	This function converts between seconds and struct tm. If useGMT is
//	true, then the returned date will be in Greenwich Mean Time (GMT).
//	Otherwise, it will be in the local time zone.
//
// Results:
//	Returns a static tm structure.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpGetDate(tls *libc.TLS, time uintptr, useGMT int32) uintptr { /* tclUnixTime.c:337:11: */
	if useGMT != 0 {
		return XTclpGmtime(tls, time)
	} else {
		return XTclpLocaltime(tls, time)
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// TclpGmtime --
//
//	Wrapper around the 'gmtime' library function to make it thread safe.
//
// Results:
//	Returns a pointer to a 'struct tm' in thread-specific data.
//
// Side effects:
//	Invokes gmtime or gmtime_r as appropriate.
//
//----------------------------------------------------------------------

func XTclpGmtime(tls *libc.TLS, timePtr uintptr) uintptr { /* tclUnixTime.c:365:11: */
	// Get a thread-local buffer to hold the returned time.

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&tmKey1)), int32(unsafe.Sizeof(ThreadSpecificData16{})))

	libc.Xgmtime_r(tls, timePtr, tsdPtr)

	return tsdPtr
}

//----------------------------------------------------------------------
//
// TclpLocaltime --
//
//	Wrapper around the 'localtime' library function to make it thread
//	safe.
//
// Results:
//	Returns a pointer to a 'struct tm' in thread-specific data.
//
// Side effects:
//	Invokes localtime or localtime_r as appropriate.
//
//----------------------------------------------------------------------

func XTclpLocaltime(tls *libc.TLS, timePtr uintptr) uintptr { /* tclUnixTime.c:404:11: */
	// Get a thread-local buffer to hold the returned time.

	var tsdPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&tmKey1)), int32(unsafe.Sizeof(ThreadSpecificData16{})))

	sSetTZIfNecessary(tls)
	libc.Xlocaltime_r(tls, timePtr, tsdPtr+56)

	return tsdPtr + 56
}

//----------------------------------------------------------------------
//
// Tcl_SetTimeProc --
//
//	TIP #233 (Virtualized Time): Registers two handlers for the
//	virtualization of Tcl's access to time information.
//
// Results:
//	None.
//
// Side effects:
//	Remembers the handlers, alters core behaviour.
//
//----------------------------------------------------------------------

func XTcl_SetTimeProc(tls *libc.TLS, getProc uintptr, scaleProc uintptr, clientData ClientData) { /* tclUnixTime.c:445:1: */
	XtclGetTimeProcPtr = getProc
	XtclScaleTimeProcPtr = scaleProc
	XtclTimeClientData = clientData
}

//----------------------------------------------------------------------
//
// Tcl_QueryTimeProc --
//
//	TIP #233 (Virtualized Time): Query which time handlers are registered.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_QueryTimeProc(tls *libc.TLS, getProc uintptr, scaleProc uintptr, clientData uintptr) { /* tclUnixTime.c:472:1: */
	if getProc != 0 {
		*(*uintptr)(unsafe.Pointer(getProc)) = XtclGetTimeProcPtr
	}
	if scaleProc != 0 {
		*(*uintptr)(unsafe.Pointer(scaleProc)) = XtclScaleTimeProcPtr
	}
	if clientData != 0 {
		*(*ClientData)(unsafe.Pointer(clientData)) = XtclTimeClientData
	}
}

//----------------------------------------------------------------------
//
// NativeScaleTime --
//
//	TIP #233: Scale from virtual time to the real-time. For native scaling
//	the relationship is 1:1 and nothing has to be done.
//
// Results:
//	Scales the time in timePtr.
//
// Side effects:
//	See above.
//
//----------------------------------------------------------------------

func sNativeScaleTime(tls *libc.TLS, timePtr uintptr, clientData ClientData) { /* tclUnixTime.c:506:1: */
	// Native scale is 1:1. Nothing is done
}

//----------------------------------------------------------------------
//
// NativeGetTime --
//
//	TIP #233: Gets the current system time in seconds and microseconds
//	since the beginning of the epoch: 00:00 UCT, January 1, 1970.
//
// Results:
//	Returns the current time in timePtr.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sNativeGetTime(tls *libc.TLS, timePtr uintptr, clientData ClientData) { /* tclUnixTime.c:531:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	// var tv Timeval at bp, 16

	libc.Xgettimeofday(tls, bp, uintptr(0))
	(*Tcl_Time)(unsafe.Pointer(timePtr)).Fsec = (*Timeval)(unsafe.Pointer(bp /* &tv */)).Ftv_sec
	(*Tcl_Time)(unsafe.Pointer(timePtr)).Fusec = (*Timeval)(unsafe.Pointer(bp /* &tv */)).Ftv_usec
}

//----------------------------------------------------------------------
//
// SetTZIfNecessary --
//
//	Determines whether a call to 'tzset' is needed prior to the next call
//	to 'localtime' or examination of the 'timezone' variable.
//
// Results:
//	None.
//
// Side effects:
//	If 'tzset' has never been called in the current process, or if the
//	value of the environment variable TZ has changed since the last call
//	to 'tzset', then 'tzset' is called again.
//
//----------------------------------------------------------------------

func sSetTZIfNecessary(tls *libc.TLS) { /* tclUnixTime.c:561:1: */
	var newTZ uintptr = libc.Xgetenv(tls, ts+11426)

	XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&tmMutex)))
	if newTZ == uintptr(0) {
		newTZ = ts + 2046 /* "" */
	}
	if lastTZ == uintptr(0) || libc.Xstrcmp(tls, lastTZ, newTZ) != 0 {
		libc.Xtzset(tls)
		if lastTZ == uintptr(0) {
			XTcl_CreateExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sCleanupMemory})), uintptr(0))
		} else {
			XTclpFree(tls, lastTZ)
		}
		lastTZ = XTcl_Alloc(tls, uint32(libc.Xstrlen(tls, newTZ)+uint64(1)))
		libc.Xstrcpy(tls, lastTZ, newTZ)
	}
	XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&tmMutex)))
}

//----------------------------------------------------------------------
//
// CleanupMemory --
//
//	Releases the private copy of the TZ environment variable upon exit
//	from Tcl.
//
// Results:
//	None.
//
// Side effects:
//	Frees allocated memory.
//
//----------------------------------------------------------------------

func sCleanupMemory(tls *libc.TLS, ignored ClientData) { /* tclUnixTime.c:600:1: */
	XTclpFree(tls, lastTZ)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// Include the static character classification tables and macros.

// tclUniData.c --
//
//	Declarations of Unicode character information tables.  This file is
//	automatically generated by the tools/uniParse.tcl script.  Do not
//	modify this file by hand.
//
// Copyright (c) 1998 by Scriptics Corporation.
// All rights reserved.

// A 16-bit Unicode character is split into two parts in order to index
// into the following tables.  The lower OFFSET_BITS comprise an offset
// into a page of characters.  The upper bits comprise the page number.

// The pageMap is indexed by page number and returns an alternate page number
// that identifies a unique page of characters.  Many Unicode characters map
// to the same alternate page number.

var pageMap = [2048]uint16{
	uint16(0), uint16(32), uint16(64), uint16(96), uint16(0), uint16(128), uint16(160), uint16(192), uint16(224), uint16(256), uint16(288), uint16(320), uint16(352), uint16(384), uint16(416),
	uint16(448), uint16(224), uint16(480), uint16(512), uint16(544), uint16(576), uint16(608), uint16(640), uint16(672), uint16(704), uint16(704), uint16(736), uint16(768), uint16(800),
	uint16(832), uint16(864), uint16(896), uint16(928), uint16(960), uint16(992), uint16(224), uint16(1024), uint16(224), uint16(1056), uint16(224), uint16(224), uint16(1088),
	uint16(1120), uint16(1152), uint16(1184), uint16(1216), uint16(1248), uint16(1280), uint16(1312), uint16(1344), uint16(1376), uint16(1408), uint16(1344), uint16(1344),
	uint16(1440), uint16(1472), uint16(1504), uint16(1536), uint16(1568), uint16(1344), uint16(1344), uint16(1600), uint16(1632), uint16(1664), uint16(1696), uint16(1728),
	uint16(1760), uint16(1792), uint16(1824), uint16(1344), uint16(1856), uint16(1888), uint16(1920), uint16(1952), uint16(1984), uint16(2016), uint16(2048), uint16(2080),
	uint16(2112), uint16(2144), uint16(2176), uint16(2208), uint16(2240), uint16(2272), uint16(2304), uint16(2336), uint16(2368), uint16(2400), uint16(2432), uint16(2464),
	uint16(2496), uint16(2528), uint16(2560), uint16(2592), uint16(2624), uint16(2656), uint16(2688), uint16(2720), uint16(2752), uint16(2784), uint16(2816), uint16(2848),
	uint16(2880), uint16(2912), uint16(2944), uint16(2976), uint16(3008), uint16(3040), uint16(3072), uint16(3104), uint16(3136), uint16(3168), uint16(3200), uint16(3232),
	uint16(3264), uint16(3296), uint16(3328), uint16(3360), uint16(3392), uint16(3296), uint16(3424), uint16(3456), uint16(3488), uint16(3520), uint16(3552), uint16(3584),
	uint16(3616), uint16(3296), uint16(1344), uint16(3648), uint16(3680), uint16(3712), uint16(3744), uint16(3776), uint16(3808), uint16(3840), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(3872), uint16(1344), uint16(3904), uint16(3936),
	uint16(3968), uint16(1344), uint16(4000), uint16(1344), uint16(4032), uint16(4064), uint16(4096), uint16(4128), uint16(4128), uint16(4160), uint16(4192), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(4224), uint16(4256), uint16(1344), uint16(1344), uint16(4288), uint16(4320), uint16(4352),
	uint16(4384), uint16(4416), uint16(1344), uint16(4448), uint16(4480), uint16(4512), uint16(4544), uint16(1344), uint16(4576), uint16(4608), uint16(4640), uint16(4672),
	uint16(1344), uint16(4704), uint16(4736), uint16(4768), uint16(4800), uint16(4832), uint16(1344), uint16(4864), uint16(4896), uint16(4928), uint16(4960), uint16(1344),
	uint16(4992), uint16(5024), uint16(5056), uint16(5088), uint16(5120), uint16(3296), uint16(5152), uint16(5184), uint16(5216), uint16(5248), uint16(5280), uint16(5312),
	uint16(1344), uint16(5344), uint16(1344), uint16(5376), uint16(5408), uint16(5440), uint16(5472), uint16(5504), uint16(5536), uint16(5568), uint16(5600), uint16(5632),
	uint16(5664), uint16(5696), uint16(5728), uint16(5664), uint16(704), uint16(704), uint16(224), uint16(224), uint16(224), uint16(224), uint16(5760), uint16(224), uint16(224),
	uint16(224), uint16(5792), uint16(5824), uint16(5856), uint16(5888), uint16(5920), uint16(5952), uint16(5984), uint16(6016), uint16(6048), uint16(6080), uint16(6112),
	uint16(6144), uint16(6176), uint16(6208), uint16(6240), uint16(6272), uint16(6304), uint16(6336), uint16(6368), uint16(6400), uint16(6432), uint16(6464), uint16(6496),
	uint16(6528), uint16(6560), uint16(6560), uint16(6560), uint16(6560), uint16(6560), uint16(6560), uint16(6560), uint16(6560), uint16(6592), uint16(6624), uint16(4928),
	uint16(6656), uint16(6688), uint16(6720), uint16(6752), uint16(6784), uint16(4928), uint16(6816), uint16(6848), uint16(6880), uint16(6912), uint16(6944), uint16(6976),
	uint16(7008), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(7040), uint16(7072), uint16(7104), uint16(4928), uint16(4928), uint16(4928),
	uint16(7136), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(7168), uint16(7200), uint16(4928), uint16(7232),
	uint16(7264), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(6560), uint16(6560), uint16(6560),
	uint16(6560), uint16(7296), uint16(6560), uint16(7328), uint16(7360), uint16(6560), uint16(6560), uint16(6560), uint16(6560), uint16(6560), uint16(6560), uint16(6560),
	uint16(6560), uint16(4928), uint16(7392), uint16(7424), uint16(7456), uint16(7488), uint16(4928), uint16(4928), uint16(4928), uint16(7520), uint16(7552), uint16(7584),
	uint16(7616), uint16(224), uint16(224), uint16(224), uint16(7648), uint16(7680), uint16(7712), uint16(1344), uint16(7744), uint16(7776), uint16(7808), uint16(7808),
	uint16(704), uint16(7840), uint16(7872), uint16(7904), uint16(3296), uint16(7936), uint16(4928), uint16(4928), uint16(7968), uint16(4928), uint16(4928), uint16(4928),
	uint16(4928), uint16(4928), uint16(4928), uint16(8000), uint16(8032), uint16(8064), uint16(8096), uint16(3200), uint16(1344), uint16(8128), uint16(4192), uint16(1344),
	uint16(8160), uint16(8192), uint16(8224), uint16(1344), uint16(1344), uint16(8256), uint16(1344), uint16(4928), uint16(8288), uint16(8320), uint16(8352), uint16(8384),
	uint16(4928), uint16(8352), uint16(8416), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928), uint16(4928),
	uint16(4928), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(4928), uint16(4928), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(8448), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(8480), uint16(4928), uint16(8512), uint16(5440), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(8544), uint16(8576), uint16(224), uint16(8608), uint16(8640), uint16(1344), uint16(1344), uint16(8672), uint16(8704), uint16(8736), uint16(224),
	uint16(8768), uint16(8800), uint16(8832), uint16(8864), uint16(8896), uint16(8928), uint16(8960), uint16(1344), uint16(8992), uint16(9024), uint16(9056), uint16(9088),
	uint16(9120), uint16(1632), uint16(9152), uint16(9184), uint16(9216), uint16(1920), uint16(9248), uint16(9280), uint16(9312), uint16(1344), uint16(9344), uint16(9376),
	uint16(9408), uint16(1344), uint16(9440), uint16(9472), uint16(9504), uint16(9536), uint16(9568), uint16(9600), uint16(9632), uint16(9664), uint16(9664), uint16(1344),
	uint16(9696), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(9728), uint16(9760), uint16(9792), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824),
	uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824),
	uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824),
	uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824),
	uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824),
	uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9824), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856),
	uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(9856), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(9888), uint16(1344), uint16(1344), uint16(9920), uint16(3296), uint16(9952), uint16(9984), uint16(10016),
	uint16(1344), uint16(1344), uint16(10048), uint16(10080), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344), uint16(1344),
	uint16(1344), uint16(1344), uint16(1344), uint16(10112), uint16(10144), uint16(1344), uint16(10176), uint16(1344), uint16(10208), uint16(10240), uint16(10272),
	uint16(10304), uint16(10336), uint16(10368), uint16(1344), uint16(1344), uint16(1344), uint16(10400), uint16(10432), uint16(64), uint16(10464), uint16(10496),
	uint16(10528), uint16(4736), uint16(10560), uint16(10592),
} /* tclUniData.c:26:29 */

// The groupMap is indexed by combining the alternate page number with
// the page offset and returns a group number that identifies a unique
// set of character attributes.

var groupMap = [10624]uint8{
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(2), uint8(3), uint8(3), uint8(3), uint8(4), uint8(3), uint8(3), uint8(3), uint8(5), uint8(6), uint8(3), uint8(7), uint8(3), uint8(8),
	uint8(3), uint8(3), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(3), uint8(3), uint8(7), uint8(7), uint8(7), uint8(3), uint8(3), uint8(10), uint8(10), uint8(10),
	uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10),
	uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(5), uint8(3), uint8(6), uint8(11), uint8(12), uint8(11), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13),
	uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13),
	uint8(13), uint8(13), uint8(13), uint8(5), uint8(7), uint8(6), uint8(7), uint8(1), uint8(2), uint8(3), uint8(4), uint8(4), uint8(4), uint8(4), uint8(14), uint8(3), uint8(11), uint8(14), uint8(15), uint8(16),
	uint8(7), uint8(17), uint8(14), uint8(11), uint8(14), uint8(7), uint8(18), uint8(18), uint8(11), uint8(19), uint8(3), uint8(3), uint8(11), uint8(18), uint8(15), uint8(20), uint8(18), uint8(18),
	uint8(18), uint8(3), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10),
	uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(7), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(21),
	uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13),
	uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(7), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(22), uint8(23), uint8(24),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(25), uint8(26), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(21), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(21), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(27),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(28), uint8(29), uint8(30), uint8(23), uint8(24), uint8(23), uint8(24), uint8(31), uint8(23), uint8(24), uint8(32),
	uint8(32), uint8(23), uint8(24), uint8(21), uint8(33), uint8(34), uint8(35), uint8(23), uint8(24), uint8(32), uint8(36), uint8(37), uint8(38), uint8(39), uint8(23), uint8(24), uint8(40),
	uint8(21), uint8(38), uint8(41), uint8(42), uint8(43), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(44), uint8(23), uint8(24), uint8(44), uint8(21), uint8(21),
	uint8(23), uint8(24), uint8(44), uint8(23), uint8(24), uint8(45), uint8(45), uint8(23), uint8(24), uint8(23), uint8(24), uint8(46), uint8(23), uint8(24), uint8(21), uint8(15), uint8(23),
	uint8(24), uint8(21), uint8(47), uint8(15), uint8(15), uint8(15), uint8(15), uint8(48), uint8(49), uint8(50), uint8(48), uint8(49), uint8(50), uint8(48), uint8(49), uint8(50), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(51), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24),
	uint8(21), uint8(48), uint8(49), uint8(50), uint8(23), uint8(24), uint8(52), uint8(53), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(54),
	uint8(21), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24),
	uint8(23), uint8(24), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(55), uint8(23), uint8(24), uint8(56), uint8(57), uint8(58), uint8(58), uint8(23), uint8(24),
	uint8(59), uint8(60), uint8(61), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(62), uint8(63), uint8(64), uint8(65),
	uint8(66), uint8(21), uint8(67), uint8(67), uint8(21), uint8(68), uint8(21), uint8(69), uint8(70), uint8(21), uint8(21), uint8(21), uint8(67), uint8(71), uint8(21), uint8(72), uint8(21),
	uint8(73), uint8(74), uint8(21), uint8(75), uint8(76), uint8(74), uint8(77), uint8(78), uint8(21), uint8(21), uint8(76), uint8(21), uint8(79), uint8(80), uint8(21), uint8(21), uint8(81),
	uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(82), uint8(21), uint8(21), uint8(83), uint8(21), uint8(84), uint8(83), uint8(21), uint8(21), uint8(21),
	uint8(85), uint8(83), uint8(86), uint8(87), uint8(87), uint8(88), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(89), uint8(21), uint8(15), uint8(21), uint8(21), uint8(21),
	uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(90), uint8(91), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21),
	uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92),
	uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(11), uint8(11), uint8(11), uint8(11), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92),
	uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11),
	uint8(11), uint8(11), uint8(11), uint8(11), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(92),
	uint8(11), uint8(92), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11),
	uint8(11), uint8(11), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(94), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(92), uint8(11), uint8(23), uint8(24), uint8(0), uint8(0), uint8(92), uint8(42), uint8(42), uint8(42), uint8(3), uint8(95), uint8(0), uint8(0), uint8(0), uint8(0), uint8(11), uint8(11),
	uint8(96), uint8(3), uint8(97), uint8(97), uint8(97), uint8(0), uint8(98), uint8(0), uint8(99), uint8(99), uint8(21), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10),
	uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(0), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10),
	uint8(10), uint8(10), uint8(10), uint8(100), uint8(101), uint8(101), uint8(101), uint8(21), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13),
	uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(102), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13),
	uint8(13), uint8(13), uint8(103), uint8(104), uint8(104), uint8(105), uint8(106), uint8(107), uint8(108), uint8(108), uint8(108), uint8(109), uint8(110), uint8(111),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(112), uint8(113), uint8(114), uint8(115), uint8(116), uint8(117), uint8(7), uint8(23), uint8(24),
	uint8(118), uint8(23), uint8(24), uint8(21), uint8(54), uint8(54), uint8(54), uint8(119), uint8(119), uint8(119), uint8(119), uint8(119), uint8(119), uint8(119), uint8(119),
	uint8(119), uint8(119), uint8(119), uint8(119), uint8(119), uint8(119), uint8(119), uint8(119), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10),
	uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10),
	uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(10), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13),
	uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13),
	uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(113), uint8(113), uint8(113), uint8(113), uint8(113), uint8(113), uint8(113), uint8(113), uint8(113),
	uint8(113), uint8(113), uint8(113), uint8(113), uint8(113), uint8(113), uint8(113), uint8(23), uint8(24), uint8(14), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(120), uint8(120), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(121), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(122), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(0), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123),
	uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123),
	uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123),
	uint8(0), uint8(0), uint8(92), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(21), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124),
	uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124),
	uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124),
	uint8(124), uint8(124), uint8(124), uint8(21), uint8(21), uint8(3), uint8(8), uint8(0), uint8(0), uint8(14), uint8(14), uint8(4), uint8(0), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(8), uint8(93), uint8(3), uint8(93), uint8(93), uint8(3), uint8(93), uint8(93), uint8(3), uint8(93), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(3), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(17), uint8(17), uint8(17),
	uint8(17), uint8(17), uint8(17), uint8(7), uint8(7), uint8(7), uint8(3), uint8(3), uint8(4), uint8(3), uint8(3), uint8(14), uint8(14), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(3), uint8(17), uint8(3), uint8(3), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(92), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(3), uint8(3), uint8(3), uint8(3), uint8(15), uint8(15),
	uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(3), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(17), uint8(14), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(92), uint8(92), uint8(93), uint8(93), uint8(14), uint8(93), uint8(93), uint8(93), uint8(93), uint8(15), uint8(15), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(15), uint8(15), uint8(15), uint8(14), uint8(14), uint8(15), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(0), uint8(17), uint8(15), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(15),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9),
	uint8(9), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(92), uint8(92), uint8(14), uint8(3), uint8(3), uint8(3), uint8(92), uint8(0), uint8(0),
	uint8(93), uint8(4), uint8(4), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(92), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(92), uint8(93), uint8(93), uint8(93), uint8(92), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(0), uint8(0), uint8(3), uint8(3),
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(93), uint8(93), uint8(93), uint8(0), uint8(0), uint8(3), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(11), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(0), uint8(17), uint8(17), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(92), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(17), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(125),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(93), uint8(125), uint8(93), uint8(15), uint8(125), uint8(125), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(125), uint8(125), uint8(125), uint8(125), uint8(93), uint8(125), uint8(125), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(3), uint8(3), uint8(9), uint8(9), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(3), uint8(92), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(125), uint8(125), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(0), uint8(0), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(0), uint8(15), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(93), uint8(15), uint8(125), uint8(125), uint8(125), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(0), uint8(0), uint8(125), uint8(125), uint8(0), uint8(0), uint8(125), uint8(125), uint8(93), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(125), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(0), uint8(0), uint8(9), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(15), uint8(15), uint8(4), uint8(4), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(14), uint8(4),
	uint8(15), uint8(3), uint8(93), uint8(0), uint8(0), uint8(93), uint8(93), uint8(125), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15),
	uint8(15), uint8(0), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(0), uint8(0), uint8(93), uint8(0), uint8(125), uint8(125), uint8(125), uint8(93), uint8(93), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(93), uint8(93), uint8(0), uint8(0), uint8(93), uint8(93), uint8(93), uint8(0), uint8(0), uint8(0), uint8(93), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9),
	uint8(9), uint8(93), uint8(93), uint8(15), uint8(15), uint8(15), uint8(93), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93), uint8(93),
	uint8(125), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(0), uint8(0), uint8(93), uint8(15), uint8(125), uint8(125), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(0), uint8(93), uint8(93),
	uint8(125), uint8(0), uint8(125), uint8(125), uint8(93), uint8(0), uint8(0), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(93), uint8(93), uint8(0), uint8(0), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(3), uint8(4),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(0), uint8(93), uint8(125), uint8(125), uint8(0),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(0), uint8(0), uint8(93), uint8(15), uint8(125), uint8(93), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(0), uint8(0), uint8(125), uint8(125), uint8(0), uint8(0), uint8(125),
	uint8(125), uint8(93), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93), uint8(93), uint8(125), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(0), uint8(15),
	uint8(15), uint8(15), uint8(93), uint8(93), uint8(0), uint8(0), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(14), uint8(15), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(18), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15),
	uint8(0), uint8(15), uint8(0), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(125), uint8(125), uint8(93),
	uint8(125), uint8(125), uint8(0), uint8(0), uint8(0), uint8(125), uint8(125), uint8(125), uint8(0), uint8(125), uint8(125), uint8(125), uint8(93), uint8(0), uint8(0), uint8(15), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(125), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(9), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(18), uint8(18), uint8(18), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(4), uint8(14),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93), uint8(125), uint8(125), uint8(125), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(0), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(93), uint8(15), uint8(93), uint8(93), uint8(93), uint8(125),
	uint8(125), uint8(125), uint8(125), uint8(0), uint8(93), uint8(93), uint8(93), uint8(0), uint8(93), uint8(93), uint8(93), uint8(93), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(93), uint8(93), uint8(0), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(93), uint8(93), uint8(0), uint8(0), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(3), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(14), uint8(15), uint8(93), uint8(125), uint8(125), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(0), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(93), uint8(15), uint8(125), uint8(93), uint8(125),
	uint8(125), uint8(125), uint8(125), uint8(125), uint8(0), uint8(93), uint8(125), uint8(125), uint8(0), uint8(125), uint8(125), uint8(93), uint8(93), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(125), uint8(125), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(93), uint8(93),
	uint8(0), uint8(0), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(0), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93), uint8(93), uint8(125), uint8(125), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(15), uint8(125), uint8(125),
	uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(0), uint8(125), uint8(125), uint8(125), uint8(0), uint8(125), uint8(125), uint8(125), uint8(93), uint8(15), uint8(14),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(125), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(15), uint8(15), uint8(15),
	uint8(93), uint8(93), uint8(0), uint8(0), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(14), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(93), uint8(125), uint8(125), uint8(0), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0),
	uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(0), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(93), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(125), uint8(125), uint8(125), uint8(93), uint8(93), uint8(93), uint8(0), uint8(93), uint8(0), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125),
	uint8(125), uint8(125), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(0), uint8(0), uint8(125),
	uint8(125), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(0), uint8(0), uint8(0), uint8(0), uint8(4), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(92), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(3), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(3), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(0), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(93), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(0), uint8(92), uint8(0), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(0), uint8(0), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(14), uint8(14), uint8(14), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(14), uint8(3), uint8(14), uint8(14), uint8(14), uint8(93), uint8(93), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(14), uint8(93), uint8(14), uint8(93), uint8(14), uint8(93), uint8(5), uint8(6), uint8(5), uint8(6), uint8(125), uint8(125), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(3), uint8(93), uint8(93),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(0),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(0), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(93), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(0), uint8(14), uint8(14), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(14), uint8(14), uint8(14), uint8(14), uint8(3), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(125), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(125), uint8(93), uint8(93), uint8(125), uint8(125), uint8(93), uint8(93), uint8(15), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(125), uint8(125), uint8(93), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(15), uint8(125), uint8(125), uint8(125), uint8(15),
	uint8(15), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(125), uint8(125), uint8(93),
	uint8(93), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(93), uint8(15), uint8(125), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(125), uint8(125), uint8(125), uint8(93), uint8(14), uint8(14), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126),
	uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126),
	uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126), uint8(126),
	uint8(126), uint8(126), uint8(126), uint8(0), uint8(126), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(126), uint8(0), uint8(0), uint8(127), uint8(127), uint8(127), uint8(127),
	uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127),
	uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127),
	uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(127), uint8(3), uint8(92), uint8(127),
	uint8(127), uint8(127), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0),
	uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0),
	uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(93), uint8(93),
	uint8(93), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128),
	uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128),
	uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128),
	uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128), uint8(128),
	uint8(105), uint8(105), uint8(105), uint8(105), uint8(105), uint8(105), uint8(0), uint8(0), uint8(111), uint8(111), uint8(111), uint8(111), uint8(111), uint8(111), uint8(0),
	uint8(0), uint8(8), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(14), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(2), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(5), uint8(6), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(3), uint8(3), uint8(3), uint8(129), uint8(129), uint8(129), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(125), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(125), uint8(3), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(0), uint8(93), uint8(93), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(93), uint8(125), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(3), uint8(3), uint8(3), uint8(92), uint8(3), uint8(3), uint8(3), uint8(4), uint8(15), uint8(93), uint8(0), uint8(0),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(8), uint8(3), uint8(3), uint8(3),
	uint8(3), uint8(93), uint8(93), uint8(93), uint8(17), uint8(93), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(15), uint8(15), uint8(15), uint8(92), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(93), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(93), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0),
	uint8(93), uint8(93), uint8(93), uint8(125), uint8(125), uint8(125), uint8(125), uint8(93), uint8(93), uint8(125), uint8(125), uint8(125), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(125), uint8(125), uint8(93), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(93), uint8(93), uint8(93), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(14), uint8(0), uint8(0), uint8(0), uint8(3), uint8(3), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(18), uint8(0), uint8(0), uint8(0), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(93), uint8(93), uint8(125), uint8(125), uint8(93), uint8(0), uint8(0), uint8(3), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(125), uint8(93), uint8(125), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(0), uint8(93), uint8(125), uint8(93), uint8(125), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(0), uint8(0), uint8(93), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(92),
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(0), uint8(0), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(120), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(125), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(93), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(125), uint8(93), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(93),
	uint8(125), uint8(125), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(3), uint8(3), uint8(0), uint8(93), uint8(93), uint8(125), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(125), uint8(125), uint8(93), uint8(93), uint8(125), uint8(93), uint8(93), uint8(93),
	uint8(15), uint8(15), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(125), uint8(93), uint8(93), uint8(125), uint8(125), uint8(125), uint8(93), uint8(125), uint8(93), uint8(93), uint8(93),
	uint8(125), uint8(125), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(3), uint8(3), uint8(3), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15), uint8(125),
	uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(125), uint8(125), uint8(93), uint8(93), uint8(0), uint8(0), uint8(0), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9),
	uint8(9), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(3), uint8(3), uint8(130),
	uint8(131), uint8(132), uint8(133), uint8(133), uint8(134), uint8(135), uint8(136), uint8(137), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(138), uint8(138),
	uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138),
	uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138),
	uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(138), uint8(0),
	uint8(0), uint8(138), uint8(138), uint8(138), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93),
	uint8(93), uint8(93), uint8(3), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(125),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(93), uint8(15), uint8(15), uint8(125), uint8(93), uint8(93), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21),
	uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21),
	uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21),
	uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92),
	uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92),
	uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92),
	uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92),
	uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(92), uint8(139), uint8(21), uint8(21),
	uint8(21), uint8(140), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21),
	uint8(21), uint8(141), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(92), uint8(92), uint8(92),
	uint8(92), uint8(92), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(142), uint8(21), uint8(21), uint8(143), uint8(21),
	uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(145), uint8(145), uint8(145), uint8(145), uint8(145), uint8(145),
	uint8(145), uint8(145), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(0), uint8(0), uint8(145), uint8(145), uint8(145), uint8(145), uint8(145),
	uint8(145), uint8(0), uint8(0), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(145), uint8(145), uint8(145), uint8(145),
	uint8(145), uint8(145), uint8(145), uint8(145), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(145), uint8(145),
	uint8(145), uint8(145), uint8(145), uint8(145), uint8(145), uint8(145), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(0), uint8(0), uint8(145),
	uint8(145), uint8(145), uint8(145), uint8(145), uint8(145), uint8(0), uint8(0), uint8(21), uint8(144), uint8(21), uint8(144), uint8(21), uint8(144), uint8(21), uint8(144),
	uint8(0), uint8(145), uint8(0), uint8(145), uint8(0), uint8(145), uint8(0), uint8(145), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144),
	uint8(144), uint8(145), uint8(145), uint8(145), uint8(145), uint8(145), uint8(145), uint8(145), uint8(145), uint8(146), uint8(146), uint8(147), uint8(147), uint8(147),
	uint8(147), uint8(148), uint8(148), uint8(149), uint8(149), uint8(150), uint8(150), uint8(151), uint8(151), uint8(0), uint8(0), uint8(144), uint8(144), uint8(144), uint8(144),
	uint8(144), uint8(144), uint8(144), uint8(144), uint8(152), uint8(152), uint8(152), uint8(152), uint8(152), uint8(152), uint8(152), uint8(152), uint8(144), uint8(144),
	uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(152), uint8(152), uint8(152), uint8(152), uint8(152), uint8(152), uint8(152), uint8(152),
	uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(144), uint8(152), uint8(152), uint8(152), uint8(152), uint8(152), uint8(152),
	uint8(152), uint8(152), uint8(144), uint8(144), uint8(21), uint8(153), uint8(21), uint8(0), uint8(21), uint8(21), uint8(145), uint8(145), uint8(154), uint8(154), uint8(155),
	uint8(11), uint8(156), uint8(11), uint8(11), uint8(11), uint8(21), uint8(153), uint8(21), uint8(0), uint8(21), uint8(21), uint8(157), uint8(157), uint8(157), uint8(157), uint8(155),
	uint8(11), uint8(11), uint8(11), uint8(144), uint8(144), uint8(21), uint8(21), uint8(0), uint8(0), uint8(21), uint8(21), uint8(145), uint8(145), uint8(158), uint8(158), uint8(0),
	uint8(11), uint8(11), uint8(11), uint8(144), uint8(144), uint8(21), uint8(21), uint8(21), uint8(114), uint8(21), uint8(21), uint8(145), uint8(145), uint8(159), uint8(159),
	uint8(118), uint8(11), uint8(11), uint8(11), uint8(0), uint8(0), uint8(21), uint8(153), uint8(21), uint8(0), uint8(21), uint8(21), uint8(160), uint8(160), uint8(161), uint8(161),
	uint8(155), uint8(11), uint8(11), uint8(0), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(17), uint8(17), uint8(17), uint8(17), uint8(17),
	uint8(8), uint8(8), uint8(8), uint8(8), uint8(8), uint8(8), uint8(3), uint8(3), uint8(16), uint8(20), uint8(5), uint8(16), uint8(16), uint8(20), uint8(5), uint8(16), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(3), uint8(3), uint8(3), uint8(162), uint8(163), uint8(17), uint8(17), uint8(17), uint8(17), uint8(17), uint8(2), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(16), uint8(20), uint8(3), uint8(3), uint8(3), uint8(3), uint8(12), uint8(12), uint8(3), uint8(3), uint8(3), uint8(7), uint8(5), uint8(6), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(7), uint8(3), uint8(12), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(2), uint8(17), uint8(17), uint8(17),
	uint8(17), uint8(17), uint8(0), uint8(17), uint8(17), uint8(17), uint8(17), uint8(17), uint8(17), uint8(17), uint8(17), uint8(17), uint8(17), uint8(18), uint8(92), uint8(0), uint8(0), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(7), uint8(7), uint8(7), uint8(5), uint8(6), uint8(92), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(7), uint8(7), uint8(7), uint8(5), uint8(6), uint8(0), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92),
	uint8(92), uint8(92), uint8(92), uint8(0), uint8(0), uint8(0), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4),
	uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(4), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(120), uint8(120), uint8(120), uint8(120), uint8(93), uint8(120), uint8(120), uint8(120), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(14), uint8(14), uint8(108), uint8(14), uint8(14), uint8(14), uint8(14), uint8(108), uint8(14), uint8(14), uint8(21), uint8(108), uint8(108), uint8(108),
	uint8(21), uint8(21), uint8(108), uint8(108), uint8(108), uint8(21), uint8(14), uint8(108), uint8(14), uint8(14), uint8(7), uint8(108), uint8(108), uint8(108), uint8(108),
	uint8(108), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(108), uint8(14), uint8(164), uint8(14), uint8(108), uint8(14), uint8(165), uint8(166), uint8(108),
	uint8(108), uint8(14), uint8(21), uint8(108), uint8(108), uint8(167), uint8(108), uint8(21), uint8(15), uint8(15), uint8(15), uint8(15), uint8(21), uint8(14), uint8(14), uint8(21),
	uint8(21), uint8(108), uint8(108), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(108), uint8(21), uint8(21), uint8(21), uint8(21), uint8(14), uint8(7), uint8(14), uint8(14), uint8(168),
	uint8(14), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(169), uint8(169), uint8(169), uint8(169), uint8(169), uint8(169), uint8(169), uint8(169), uint8(169), uint8(169), uint8(169), uint8(169), uint8(169), uint8(169),
	uint8(169), uint8(169), uint8(170), uint8(170), uint8(170), uint8(170), uint8(170), uint8(170), uint8(170), uint8(170), uint8(170), uint8(170), uint8(170), uint8(170),
	uint8(170), uint8(170), uint8(170), uint8(170), uint8(129), uint8(129), uint8(129), uint8(23), uint8(24), uint8(129), uint8(129), uint8(129), uint8(129), uint8(18),
	uint8(14), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7), uint8(7), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(7), uint8(14), uint8(14), uint8(7), uint8(14), uint8(14), uint8(7), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7), uint8(7), uint8(14), uint8(14), uint8(7),
	uint8(14), uint8(7), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7),
	uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7),
	uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(5), uint8(6), uint8(5), uint8(6), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7), uint8(7), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(5), uint8(6), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(7), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7),
	uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7),
	uint8(7), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171),
	uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171),
	uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(171), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172),
	uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172), uint8(172),
	uint8(172), uint8(172), uint8(172), uint8(172), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7),
	uint8(7), uint8(7), uint8(7), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(7), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6),
	uint8(5), uint8(6), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(5), uint8(6), uint8(7), uint8(7), uint8(7), uint8(7),
	uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7),
	uint8(7), uint8(7), uint8(7), uint8(7), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7),
	uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5),
	uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7),
	uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(5), uint8(6), uint8(5), uint8(6), uint8(7), uint8(7),
	uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7),
	uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(5), uint8(6), uint8(7), uint8(7), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7),
	uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(14), uint8(14), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(7), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(0), uint8(0), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(0),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123),
	uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123),
	uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123),
	uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(123), uint8(124),
	uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124),
	uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124),
	uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(124),
	uint8(124), uint8(124), uint8(124), uint8(124), uint8(124), uint8(23), uint8(24), uint8(173), uint8(174), uint8(175), uint8(176), uint8(177), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(178), uint8(179), uint8(180), uint8(181), uint8(21), uint8(23), uint8(24), uint8(21), uint8(23), uint8(24), uint8(21), uint8(21), uint8(21),
	uint8(21), uint8(21), uint8(92), uint8(92), uint8(182), uint8(182), uint8(23), uint8(24), uint8(23), uint8(24), uint8(21), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(93), uint8(93), uint8(93), uint8(23), uint8(24), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(3), uint8(3), uint8(3), uint8(3), uint8(18),
	uint8(3), uint8(3), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183),
	uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183),
	uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(183), uint8(0), uint8(183), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(183), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(92), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(3), uint8(3), uint8(16), uint8(20), uint8(16), uint8(20), uint8(3), uint8(3), uint8(3), uint8(16), uint8(20), uint8(3), uint8(16), uint8(20),
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(8), uint8(3), uint8(3), uint8(8), uint8(3), uint8(16), uint8(20), uint8(3), uint8(3), uint8(16), uint8(20), uint8(5),
	uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(92), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(3), uint8(8), uint8(8), uint8(3), uint8(3), uint8(3), uint8(3), uint8(8), uint8(3), uint8(5), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(14), uint8(14), uint8(3), uint8(3), uint8(3), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(8), uint8(0), uint8(0), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(0), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0), uint8(2), uint8(3), uint8(3), uint8(3), uint8(14), uint8(92), uint8(15),
	uint8(129), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(14), uint8(14), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6),
	uint8(8), uint8(5), uint8(6), uint8(6), uint8(14), uint8(129), uint8(129), uint8(129), uint8(129), uint8(129), uint8(129), uint8(129), uint8(129), uint8(129), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(125), uint8(125), uint8(8), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(14), uint8(14), uint8(129), uint8(129), uint8(129), uint8(92),
	uint8(15), uint8(3), uint8(14), uint8(14), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(93), uint8(93), uint8(11), uint8(11), uint8(92), uint8(92),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(3), uint8(92), uint8(92), uint8(92), uint8(15), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(14), uint8(14), uint8(18), uint8(18), uint8(18), uint8(18), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(0), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(14), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(18), uint8(18), uint8(18),
	uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(92),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(92), uint8(3),
	uint8(3), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(15), uint8(93), uint8(120), uint8(120), uint8(120), uint8(3), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(3), uint8(92), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(92),
	uint8(92), uint8(93), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(129), uint8(129), uint8(129), uint8(129), uint8(129), uint8(129), uint8(129),
	uint8(129), uint8(129), uint8(129), uint8(93), uint8(93), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(11),
	uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11),
	uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(92), uint8(11), uint8(11), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(21), uint8(21), uint8(23), uint8(24),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(92), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21),
	uint8(21), uint8(21), uint8(21), uint8(23), uint8(24), uint8(23), uint8(24), uint8(184), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(92), uint8(11), uint8(11), uint8(23), uint8(24), uint8(185), uint8(21), uint8(15), uint8(23), uint8(24), uint8(23), uint8(24), uint8(186), uint8(21), uint8(23), uint8(24),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23),
	uint8(24), uint8(187), uint8(188), uint8(189), uint8(190), uint8(187), uint8(21), uint8(191), uint8(192), uint8(193), uint8(194), uint8(23), uint8(24), uint8(23), uint8(24),
	uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(23), uint8(24), uint8(195), uint8(196), uint8(197), uint8(23),
	uint8(24), uint8(23), uint8(24), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(23), uint8(24), uint8(0), uint8(21), uint8(0), uint8(21), uint8(23), uint8(24), uint8(23), uint8(24), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(92), uint8(92), uint8(92), uint8(23), uint8(24), uint8(15), uint8(92), uint8(92), uint8(21), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93),
	uint8(15), uint8(15), uint8(15), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(125), uint8(125),
	uint8(93), uint8(93), uint8(125), uint8(14), uint8(14), uint8(14), uint8(14), uint8(93), uint8(0), uint8(0), uint8(0), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(18), uint8(14),
	uint8(14), uint8(4), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(3), uint8(3), uint8(3), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(125), uint8(125), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(125),
	uint8(125), uint8(125), uint8(125), uint8(125), uint8(125), uint8(93), uint8(93), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(3), uint8(3), uint8(9), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(3), uint8(3), uint8(3), uint8(15), uint8(3), uint8(15), uint8(15), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(3), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(125), uint8(125), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(3), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(125),
	uint8(125), uint8(93), uint8(93), uint8(93), uint8(93), uint8(125), uint8(125), uint8(93), uint8(93), uint8(125), uint8(125), uint8(125), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(0), uint8(92), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(3), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(92), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(125), uint8(125), uint8(93), uint8(93),
	uint8(125), uint8(125), uint8(93), uint8(93), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(93), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(125), uint8(0), uint8(0), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9),
	uint8(0), uint8(0), uint8(3), uint8(3), uint8(3), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(92), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(14), uint8(14), uint8(14), uint8(15), uint8(125), uint8(93), uint8(125),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(93), uint8(15), uint8(93), uint8(93), uint8(93), uint8(15), uint8(15), uint8(93), uint8(93), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(93), uint8(93),
	uint8(15), uint8(93), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(92), uint8(3), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(125), uint8(93), uint8(93), uint8(125), uint8(125), uint8(3), uint8(3), uint8(15), uint8(92), uint8(92), uint8(125), uint8(93), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(21), uint8(21), uint8(21),
	uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21),
	uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(198), uint8(21),
	uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(11), uint8(92), uint8(92), uint8(92), uint8(92), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21),
	uint8(21), uint8(21), uint8(21), uint8(92), uint8(11), uint8(11), uint8(0), uint8(0), uint8(0), uint8(0), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199),
	uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199),
	uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199),
	uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(199), uint8(15),
	uint8(15), uint8(15), uint8(125), uint8(125), uint8(93), uint8(125), uint8(125), uint8(93), uint8(125), uint8(125), uint8(3), uint8(125), uint8(93), uint8(0), uint8(0), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200),
	uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200), uint8(200),
	uint8(200), uint8(200), uint8(200), uint8(200), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201),
	uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201),
	uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(201), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(21), uint8(21), uint8(21), uint8(21), uint8(21), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(93), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(7), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(0), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15),
	uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11),
	uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(11), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(6), uint8(5), uint8(14),
	uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(14), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(4), uint8(14), uint8(14), uint8(14), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(3), uint8(3), uint8(5), uint8(6), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93),
	uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(93), uint8(3), uint8(8), uint8(8), uint8(12), uint8(12), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6),
	uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(3), uint8(3), uint8(5), uint8(6), uint8(3), uint8(3), uint8(3), uint8(3), uint8(12), uint8(12), uint8(12), uint8(3), uint8(3), uint8(3),
	uint8(0), uint8(3), uint8(3), uint8(3), uint8(3), uint8(8), uint8(5), uint8(6), uint8(5), uint8(6), uint8(5), uint8(6), uint8(3), uint8(3), uint8(3), uint8(7), uint8(8), uint8(7), uint8(7), uint8(7), uint8(0), uint8(3), uint8(4),
	uint8(3), uint8(3), uint8(0), uint8(0), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(17),
	uint8(0), uint8(3), uint8(3), uint8(3), uint8(4), uint8(3), uint8(3), uint8(3), uint8(5), uint8(6), uint8(3), uint8(7), uint8(3), uint8(8), uint8(3), uint8(3), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9), uint8(9),
	uint8(9), uint8(9), uint8(9), uint8(3), uint8(3), uint8(7), uint8(7), uint8(7), uint8(3), uint8(11), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13),
	uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13), uint8(13),
	uint8(5), uint8(7), uint8(6), uint8(7), uint8(5), uint8(6), uint8(3), uint8(5), uint8(6), uint8(3), uint8(3), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(92), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(92), uint8(92), uint8(0), uint8(0), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15),
	uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(15), uint8(15), uint8(15), uint8(0), uint8(0), uint8(0), uint8(4), uint8(4), uint8(7), uint8(11), uint8(14), uint8(4), uint8(4), uint8(0), uint8(14),
	uint8(7), uint8(7), uint8(7), uint8(7), uint8(14), uint8(14), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(17), uint8(17), uint8(17), uint8(14), uint8(14),
	uint8(0), uint8(0),
} /* tclUniData.c:569:28 */

// Each group represents a unique set of character attributes.  The attributes
// are encoded into a 32-bit value as follows:
//
// Bits 0-4	Character category: see the constants listed below.
//
// Bits 5-7	Case delta type: 000 = identity
//				 010 = add delta for lower
//				 011 = add delta for lower, add 1 for title
//				 100 = subtract delta for title/upper
//				 101 = sub delta for upper, sub 1 for title
//				 110 = sub delta for upper, add delta for lower
//				 111 = subtract delta for upper
//
// Bits 8-31	Case delta: delta for case conversions.  This should be the
//			    highest field so we can easily sign extend.

var groups = [208]int32{
	0, 15, 12, 25, 27, 21, 22, 26, 20, 9, 8257, 28, 19, 8322, 29,
	5, 23, 16, 11, -190078, 24, 2, -30846, 321, 386, -50879, 59522,
	-30911, 76930, -49790, 53825, 52801, 52545, 20289, 51777, 52033,
	53057, -24702, 54081, 53569, -41598, 54593, -33150, 54849, 55873,
	55617, 56129, -14206, 609, 451, 674, 20354, -24767, -14271, -33215,
	2763585, -41663, 2762817, -2768510, -49855, 17729, 18241, -2760318,
	-2759550, -2760062, 53890, 52866, 52610, 51842, 52098, -10833534,
	-10832510, 53122, -10823550, -10830718, 53634, 54146, -2750078,
	-10829950, -2751614, 54658, 54914, -2745982, 55938, -10830462,
	-10824062, 17794, 55682, 18306, 56194, -10818686, -10817918, 4,
	6, -21370, 29761, 9793, 9537, 16449, 16193, 9858, 9602, 8066,
	16514, 16258, 2113, 16002, 14722, 1, 12162, 13954, 2178, 22146,
	20610, -1662, 29826, -15295, 24706, -1727, 20545, 7, 3905, 3970,
	12353, 12418, 8, 1859649, -769822, 9949249, 10, 1601154, 1600898,
	1598594, 1598082, 1598338, 1596546, 1582466, -9027966, -769983,
	-9044862, -976254, -9058174, 15234, -1949375, -1918, -1983, -18814,
	-21886, -25470, -32638, -28542, -32126, -1981, -2174, -18879,
	-2237, 1844610, -21951, -25535, -28607, -32703, -32191, 13, 14,
	-1924287, -2145983, -2115007, 7233, 7298, 4170, 4234, 6749, 6813,
	-2750143, -976319, -2746047, 2763650, 2762882, -2759615, -2751679,
	-2760383, -2760127, -2768575, 1859714, -9044927, -10823615, -12158,
	-10830783, -10833599, -10832575, -10830015, -10817983, -10824127,
	-10818751, 237633, -12223, -10830527, -9058239, 237698, 9949314,
	18, 17, 10305, 10370, 10049, 10114, 8769, 8834,
} /* tclUniData.c:1647:18 */

// The following macros extract the fields of the character info.  The
// GetDelta() macro is complicated because we can't rely on the C compiler
// to do sign extension on right shifts.

// This macro extracts the information about a character from the
// Unicode character tables.

// The following macros are used for fast character category tests. The x_BITS
// values are shifted right by the category value to determine whether the
// given category is included in the set.

// Unicode characters less than this value are represented by themselves in
// UTF-8 strings.

// The following structures are used when mapping between Unicode (UCS-2) and
// UTF-8.

var totalBytes = [256]uint8{
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	uint8(2), uint8(1), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2),
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
} /* tclUtf.c:62:28 */

var complete = [256]uint8{
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
	// Tcl_UtfCharComplete() might point to 2nd byte of valid 4-byte sequence
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	// End of "continuation byte section"
	uint8(2), uint8(1), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2),
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	// Tcl_UtfToUniChar() accesses src[1] and src[2] to check whether
	// the UTF-8 sequence is valid, so we cannot use 1 here.
	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
} /* tclUtf.c:79:28 */

//---------------------------------------------------------------------------
//
// UtfCount --
//
//	Find the number of bytes in the Utf character "ch".
//
// Results:
//	The return values is the number of bytes in the Utf character "ch".
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func sUtfCount(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:126:1: */
	if uint32(ch-1) < uint32(UNICODE_SELF-1) {
		return 1
	}
	if ch <= 0x7FF {
		return 2
	}
	return 3
}

//---------------------------------------------------------------------------
//
// Invalid --
//
//	Given a pointer to a two-byte prefix of a well-formed UTF-8 byte
//	sequence (a lead byte followed by a trail byte) this routine
//	examines those two bytes to determine whether the sequence is
//	invalid in UTF-8.  This might be because it is an overlong
//	encoding, or because it encodes something out of the proper range.
//
//	Given a pointer to the bytes \xF8 or \xFC , this routine will
//	try to read beyond the end of the "bounds" table.  Callers must
//	prevent this.
//
//	Given a pointer to something else (an ASCII byte, a trail byte,
//	or another byte	that can never begin a valid byte sequence such
//	as \xF5) this routine returns false.  That makes the routine poorly
//	named, as it does not detect and report all invalid sequences.
//
//	Callers have to take care that this routine does something useful
//	for their needs.
//
// Results:
//	A boolean.
//---------------------------------------------------------------------------

var bounds = [28]uint8{
	uint8(0x80), uint8(0x80), // \xC0 accepts \x80 only
	uint8(0x80), uint8(0xBF), uint8(0x80), uint8(0xBF), uint8(0x80), uint8(0xBF), uint8(0x80), uint8(0xBF), uint8(0x80), uint8(0xBF), uint8(0x80), uint8(0xBF),
	uint8(0x80), uint8(0xBF), // (\xC4 - \xDC) -- all sequences valid
	uint8(0xA0), uint8(0xBF), // \xE0\x80 through \xE0\x9F are invalid prefixes
	uint8(0x80), uint8(0xBF), uint8(0x80), uint8(0xBF), uint8(0x80), uint8(0xBF), // (\xE4 - \xEC) -- all valid
	uint8(0xC0), uint8(0xBF), // Not used, but reject all again for safety.
	uint8(0xC0), uint8(0xBF), // Not used, but reject all again for safety.
} /* tclUtf.c:171:28 */

func sInvalid(tls *libc.TLS, src uintptr) int32 { /* tclUtf.c:187:1: */
	var byte uint8 = uint8(*(*int8)(unsafe.Pointer(src)))
	var index int32

	if int32(byte)&0xC3 == 0xC0 {
		// Only lead bytes 0xC0, 0xE0, 0xF0, 0xF4 need examination
		index = (int32(byte) - 0xC0) >> 1
		if int32(uint8(*(*int8)(unsafe.Pointer(src + 1)))) < int32(bounds[index]) || int32(uint8(*(*int8)(unsafe.Pointer(src + 1)))) > int32(bounds[index+1]) {
			// Out of bounds - report invalid.
			return 1
		}
	}
	return 0
}

//---------------------------------------------------------------------------
//
// Tcl_UniCharToUtf --
//
//	Store the given Tcl_UniChar as a sequence of UTF-8 bytes in the
//	provided buffer. Equivalent to Plan 9 runetochar().
//
// Results:
//	The return values is the number of bytes in the buffer that were
//	consumed.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_UniCharToUtf(tls *libc.TLS, ch int32, buf uintptr) int32 { /* tclUtf.c:223:1: */
	if !(uint32(ch-1) < uint32(UNICODE_SELF-1)) {
		goto __1
	}
	*(*int8)(unsafe.Pointer(buf)) = int8(ch)
	return 1
__1:
	;
	if !(ch >= 0) {
		goto __2
	}
	if !(ch <= 0x7FF) {
		goto __3
	}
	*(*int8)(unsafe.Pointer(buf + 1)) = int8((ch | 0x80) & 0xBF)
	*(*int8)(unsafe.Pointer(buf)) = int8(ch>>6 | 0xC0)
	return 2
__3:
	;
	if !(ch <= 0xFFFF) {
		goto __4
	}
	goto three
__4:
	;

__2:
	;

	ch = 0xFFFD
three:
	*(*int8)(unsafe.Pointer(buf + 2)) = int8((ch | 0x80) & 0xBF)
	*(*int8)(unsafe.Pointer(buf + 1)) = int8((ch>>6 | 0x80) & 0xBF)
	*(*int8)(unsafe.Pointer(buf)) = int8(ch>>12 | 0xE0)
	return 3
}

//---------------------------------------------------------------------------
//
// Tcl_UniCharToUtfDString --
//
//	Convert the given Unicode string to UTF-8.
//
// Results:
//	The return value is a pointer to the UTF-8 representation of the
//	Unicode string. Storage for the return value is appended to the end of
//	dsPtr.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_UniCharToUtfDString(tls *libc.TLS, uniStr uintptr, uniLength int32, dsPtr uintptr) uintptr { /* tclUtf.c:315:6: */
	var w uintptr
	var wEnd uintptr
	var p uintptr
	var string uintptr
	var oldLength int32

	// UTF-8 string length in bytes will be <= Unicode string length *
	// TCL_UTF_MAX.

	oldLength = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength
	XTcl_DStringSetLength(tls, dsPtr, oldLength+(uniLength+1)*TCL_UTF_MAX)
	string = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring + uintptr(oldLength)

	p = string
	wEnd = uniStr + uintptr(uniLength)*2
	for w = uniStr; w < wEnd; {
		p += uintptr(XTcl_UniCharToUtf(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(w))), p))
		w += 2
	}
	XTcl_DStringSetLength(tls, dsPtr, int32(int64(oldLength)+(int64(p)-int64(string))/1))

	return string
}

//---------------------------------------------------------------------------
//
// Tcl_UtfToUniChar --
//
//	Extract the Tcl_UniChar represented by the UTF-8 string. Bad UTF-8
//	sequences are converted to valid Tcl_UniChars and processing
//	continues. Equivalent to Plan 9 chartorune().
//
//	The caller must ensure that the source buffer is long enough that this
//	routine does not run off the end and dereference non-existent memory
//	looking for trail bytes. If the source buffer is known to be '\0'
//	terminated, this cannot happen. Otherwise, the caller should call
//	Tcl_UtfCharComplete() before calling this routine to ensure that
//	enough bytes remain in the string.
//
//	If TCL_UTF_MAX <= 4, special handling of Surrogate pairs is done:
//	For any UTF-8 string containing a character outside of the BMP, the
//	first call to this function will fill *chPtr with the high surrogate
//	and generate a return value of 1. Calling Tcl_UtfToUniChar again
//	will produce the low surrogate and a return value of 3. Because *chPtr
//	is used to remember whether the high surrogate is already produced, it
//	is recommended to initialize the variable it points to as 0 before
//	the first call to Tcl_UtfToUniChar is done.
//
// Results:
//	*chPtr is filled with the Tcl_UniChar, and the return value is the
//	number of bytes from the UTF-8 string that were consumed.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_UtfToUniChar(tls *libc.TLS, src uintptr, chPtr uintptr) int32 { /* tclUtf.c:383:1: */
	var byte Tcl_UniChar

	// Unroll 1 to 3 (or 4) byte UTF-8 sequences.

	byte = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
	if int32(byte) < 0xC0 {
		// Handles properly formed UTF-8 characters between 0x01 and 0x7F.
		// Also treats \0 and naked trail bytes 0x80 to 0xBF as valid
		// characters representing themselves.

		// If *chPtr contains a high surrogate (produced by a previous
		// Tcl_UtfToUniChar() call) and the next 3 bytes are UTF-8 continuation
		// bytes, then we must produce a follow-up low surrogate. We only
		// do that if the high surrogate matches the bits we encounter.
		if int32(byte)&0xC0 == 0x80 &&
			int32(*(*int8)(unsafe.Pointer(src + 1)))&0xC0 == 0x80 && int32(*(*int8)(unsafe.Pointer(src + 2)))&0xC0 == 0x80 &&
			(int32(byte)-0x10)<<2&0xFC|0xD800 == int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr)))&0xFCFC &&
			int32(*(*int8)(unsafe.Pointer(src + 1)))&0xF0 == int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr)))<<4&0x30|0x80 {
			*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(int32(*(*int8)(unsafe.Pointer(src + 1)))&0x0F<<6 + int32(*(*int8)(unsafe.Pointer(src + 2)))&0x3F + 0xDC00)
			return 3
		}
		*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = byte
		return 1
	} else if int32(byte) < 0xE0 {
		if int32(*(*int8)(unsafe.Pointer(src + 1)))&0xC0 == 0x80 {
			// Two-byte-character lead-byte followed by a trail-byte.

			*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(int32(byte)&0x1F<<6 | int32(*(*int8)(unsafe.Pointer(src + 1)))&0x3F)
			if uint32(int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr)))-1) >= uint32(UNICODE_SELF-1) {
				return 2
			}
		}

		// A two-byte-character lead-byte not followed by trail-byte
		// represents itself.
	} else if int32(byte) < 0xF0 {
		if int32(*(*int8)(unsafe.Pointer(src + 1)))&0xC0 == 0x80 && int32(*(*int8)(unsafe.Pointer(src + 2)))&0xC0 == 0x80 {
			// Three-byte-character lead byte followed by two trail bytes.

			*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(int32(byte)&0x0F<<12 |
				int32(*(*int8)(unsafe.Pointer(src + 1)))&0x3F<<6 | int32(*(*int8)(unsafe.Pointer(src + 2)))&0x3F)
			if int32(*(*Tcl_UniChar)(unsafe.Pointer(chPtr))) > 0x7FF {
				return 3
			}
		}

		// A three-byte-character lead-byte not followed by two trail-bytes
		// represents itself.
	} else if int32(byte) < 0xF5 {
		if int32(*(*int8)(unsafe.Pointer(src + 1)))&0xC0 == 0x80 && int32(*(*int8)(unsafe.Pointer(src + 2)))&0xC0 == 0x80 {
			// Four-byte-character lead byte followed by at least two trail bytes.
			// We don't test the validity of 3th trail byte, see [ed29806ba]
			var high Tcl_UniChar = Tcl_UniChar(int32(byte)&0x07<<8 | int32(*(*int8)(unsafe.Pointer(src + 1)))&0x3F<<2 |
				int32(*(*int8)(unsafe.Pointer(src + 2)))&0x3F>>4 - 0x40)
			if int32(high) < 0x400 {
				// produce high surrogate, advance source pointer
				*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = Tcl_UniChar(0xD800 + int32(high))
				return 1
			}
			// out of range, < 0x10000 or > 0x10FFFF
		}

		// A four-byte-character lead-byte not followed by three trail-bytes
		// represents itself.
	}

	*(*Tcl_UniChar)(unsafe.Pointer(chPtr)) = byte
	return 1
}

//---------------------------------------------------------------------------
//
// Tcl_UtfToUniCharDString --
//
//	Convert the UTF-8 string to Unicode.
//
// Results:
//	The return value is a pointer to the Unicode representation of the
//	UTF-8 string. Storage for the return value is appended to the end of
//	dsPtr. The Unicode string is terminated with a Unicode NULL character.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_UtfToUniCharDString(tls *libc.TLS, src uintptr, length int32, dsPtr uintptr) uintptr { /* tclUtf.c:506:13: */
	bp := tls.Alloc(2)
	defer tls.Free(2)

	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)) = Tcl_UniChar(0)
	var w uintptr
	var wString uintptr
	var p uintptr
	var oldLength int32
	// Pointer to the end of string. Never read endPtr[0]
	var endPtr uintptr = src + uintptr(length)
	// Pointer to last byte where optimization still can be used
	var optPtr uintptr = endPtr - uintptr(TCL_UTF_MAX)

	if length < 0 {
		length = int32(libc.Xstrlen(tls, src))
	}

	// Unicode string length in Tcl_UniChars will be <= UTF-8 string length in
	// bytes.

	oldLength = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength

	XTcl_DStringSetLength(tls, dsPtr,
		int32(uint64(oldLength)+uint64(length+1)*uint64(unsafe.Sizeof(Tcl_UniChar(0)))))
	wString = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring + uintptr(oldLength)

	w = wString
	p = src
	endPtr = src + uintptr(length)
	optPtr = endPtr - uintptr(func() int32 {
		if TCL_UTF_MAX > 3 {
			return 4
		}
		return 3
	}())
	for p <= optPtr {
		p += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(p)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(p))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, p, bp))
		}()
		*(*Tcl_UniChar)(unsafe.Pointer(libc.PostIncUintptr(&w, 2))) = *(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */))
	}
	for p < endPtr {
		if XTcl_UtfCharComplete(tls, p, int32((int64(endPtr)-int64(p))/1)) != 0 {
			p += func() uintptr {
				if int32(uint8(*(*int8)(unsafe.Pointer(p)))) < 0x80 {
					return uintptr(func() int32 {
						*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(p))))
						return 1
					}())
				}
				return uintptr(XTcl_UtfToUniChar(tls, p, bp))
			}()
			*(*Tcl_UniChar)(unsafe.Pointer(libc.PostIncUintptr(&w, 2))) = *(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */))
		} else {
			*(*Tcl_UniChar)(unsafe.Pointer(libc.PostIncUintptr(&w, 2))) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))))
		}
	}
	*(*Tcl_UniChar)(unsafe.Pointer(w)) = Tcl_UniChar(0)
	XTcl_DStringSetLength(tls, dsPtr,
		int32(int64(oldLength)+(int64(w)-int64(wString))/1))

	return wString
}

//---------------------------------------------------------------------------
//
// Tcl_UtfCharComplete --
//
//	Determine if the UTF-8 string of the given length is long enough to be
//	decoded by Tcl_UtfToUniChar(). This does not ensure that the UTF-8
//	string is properly formed. Equivalent to Plan 9 fullrune().
//
// Results:
//	The return value is 0 if the string is not long enough, non-zero
//	otherwise.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_UtfCharComplete(tls *libc.TLS, src uintptr, length int32) int32 { /* tclUtf.c:581:1: */
	return libc.Bool32(length >= int32(complete[uint8(*(*int8)(unsafe.Pointer(src)))]))
}

//---------------------------------------------------------------------------
//
// Tcl_NumUtfChars --
//
//	Returns the number of characters (not bytes) in the UTF-8 string, not
//	including the terminating NULL byte. This is equivalent to Plan 9
//	utflen() and utfnlen().
//
// Results:
//	As above.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_NumUtfChars(tls *libc.TLS, src uintptr, length int32) int32 { /* tclUtf.c:608:1: */
	bp := tls.Alloc(2)
	defer tls.Free(2)

	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)) = Tcl_UniChar(0)
	var i int32 = 0

	if length < 0 {
		// string is NUL-terminated, so TclUtfToUniChar calls are safe.
		for int32(*(*int8)(unsafe.Pointer(src))) != 0 && i < 0x7fffffff {
			src += func() uintptr {
				if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 {
					return uintptr(func() int32 {
						*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
						return 1
					}())
				}
				return uintptr(XTcl_UtfToUniChar(tls, src, bp))
			}()
			i++
		}
	} else {
		// Will return value between 0 and length. No overflow checks.

		// Pointer to the end of string. Never read endPtr[0]
		var endPtr uintptr = src + uintptr(length)
		// Pointer to last byte where optimization still can be used
		var optPtr uintptr = endPtr - uintptr(func() int32 {
			if TCL_UTF_MAX > 3 {
				return 4
			}
			return 3
		}())

		// Optimize away the call in this loop. Justified because...
		// when (src <= optPtr), (endPtr - src) >= (endPtr - optPtr)
		// By initialization above (endPtr - optPtr) = TCL_UTF_MAX
		// So (endPtr - src) >= TCL_UTF_MAX, and passing that to
		// Tcl_UtfCharComplete we know will cause return of 1.
		for src <= optPtr {
			src += func() uintptr {
				if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 {
					return uintptr(func() int32 {
						*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
						return 1
					}())
				}
				return uintptr(XTcl_UtfToUniChar(tls, src, bp))
			}()
			i++
		}
		// Loop over the remaining string where call must happen
		for src < endPtr {
			if XTcl_UtfCharComplete(tls, src, int32((int64(endPtr)-int64(src))/1)) != 0 {
				src += func() uintptr {
					if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 {
						return uintptr(func() int32 {
							*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
							return 1
						}())
					}
					return uintptr(XTcl_UtfToUniChar(tls, src, bp))
				}()
			} else {
				// src points to incomplete UTF-8 sequence
				// Treat first byte as character and count it
				src++
			}
			i++
		}
	}
	return i
}

//---------------------------------------------------------------------------
//
// Tcl_UtfFindFirst --
//
//	Returns a pointer to the first occurrence of the given Unicode character
//	in the NULL-terminated UTF-8 string. The NULL terminator is considered
//	part of the UTF-8 string. Equivalent to Plan 9 utfrune().
//
// Results:
//	As above. If the Unicode character does not exist in the given string,
//	the return value is NULL.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_UtfFindFirst(tls *libc.TLS, src uintptr, ch int32) uintptr { /* tclUtf.c:678:12: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	for 1 != 0 {
		// var find int32 at bp, 4

		var len int32 = XTclUtfToUCS4(tls, src, bp)

		if *(*int32)(unsafe.Pointer(bp)) == ch {
			return src
		}
		if int32(*(*int8)(unsafe.Pointer(src))) == 0 {
			return uintptr(0)
		}
		src += uintptr(len)
	}
	return uintptr(0)
}

//---------------------------------------------------------------------------
//
// Tcl_UtfFindLast --
//
//	Returns a pointer to the last occurrence of the given Unicode character
//	in the NULL-terminated UTF-8 string. The NULL terminator is considered
//	part of the UTF-8 string. Equivalent to Plan 9 utfrrune().
//
// Results:
//	As above. If the Unicode character does not exist in the given string, the
//	return value is NULL.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_UtfFindLast(tls *libc.TLS, src uintptr, ch int32) uintptr { /* tclUtf.c:715:12: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var last uintptr = uintptr(0)

	for 1 != 0 {
		// var find int32 at bp, 4

		var len int32 = XTclUtfToUCS4(tls, src, bp)

		if *(*int32)(unsafe.Pointer(bp)) == ch {
			last = src
		}
		if int32(*(*int8)(unsafe.Pointer(src))) == 0 {
			break
		}
		src += uintptr(len)
	}
	return last
}

//---------------------------------------------------------------------------
//
// Tcl_UtfNext --
//
//	Given a pointer to some location in a UTF-8 string, Tcl_UtfNext
//	returns a pointer to the next UTF-8 character in the string.
//	The caller must not ask for the next character after the last
//	character in the string if the string is not terminated by a null
//	character.
//
// Results:
//	The return value is the pointer to the next character in the UTF-8
//	string.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_UtfNext(tls *libc.TLS, src uintptr) uintptr { /* tclUtf.c:757:12: */
	var left int32
	var next uintptr

	left = int32(totalBytes[uint8(*(*int8)(unsafe.Pointer(src)))])
	next = src + uintptr(1)
	for libc.PreDecInt32(&left, 1) != 0 {
		if int32(*(*int8)(unsafe.Pointer(next)))&0xC0 != 0x80 {
			// src points to non-trail byte; We ran out of trail bytes
			// before the needs of the lead byte were satisfied.
			// Let the (malformed) lead byte alone be a character
			return src + uintptr(1)
		}
		next++
	}
	// Call Invalid() here only if required conditions are met:
	//    src[0] is known a lead byte.
	//    src[1] is known a trail byte.
	// Especially important to prevent calls when src[0] == '\xF8' or '\xFC'
	// See tests utf-6.37 through utf-6.43 through valgrind or similar tool.
	if next == src+uintptr(1) || sInvalid(tls, src) != 0 {
		return src + uintptr(1)
	}
	return next
}

//---------------------------------------------------------------------------
//
// Tcl_UtfPrev --
//
//	Given a pointer to some current location in a UTF-8 string, move
//	backwards one character. This works correctly when the pointer is in
//	the middle of a UTF-8 character.
//
// Results:
//	The return value is a pointer to the previous character in the UTF-8
//	string. If the current location was already at the beginning of the
//	string, the return value will also be a pointer to the beginning of
//	the string.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_UtfPrev(tls *libc.TLS, src uintptr, start uintptr) uintptr { /* tclUtf.c:824:12: */
	var trailBytesSeen int32 = 0 // How many trail bytes have been verified?
	var fallback uintptr = src - uintptr(1)
	// If we cannot find a lead byte that might
	// start a prefix of a valid UTF byte sequence,
	// we will fallback to a one-byte back step
	var look uintptr = fallback
	// Start search at the fallback position

	// Quick boundary case exit.
	if fallback <= start {
		return start
	}

	for ok := true; ok; ok = trailBytesSeen < func() int32 {
		if TCL_UTF_MAX < 4 {
			return 3
		}
		return 4
	}() {
		var byte uint8 = uint8(*(*int8)(unsafe.Pointer(look)))

		if int32(byte) < 0x80 {
			// Single byte character. Either this is a correct previous
			// character, or it is followed by at least one trail byte
			// which indicates a malformed sequence. In either case the
			// correct result is to return the fallback.
			return fallback
		}
		if int32(byte) >= 0xC0 {
			// Non-trail byte; May be multibyte lead.

			if trailBytesSeen == 0 ||

				trailBytesSeen >= int32(totalBytes[byte]) {
				// That is, (1 + trailBytesSeen > needed).
				// We've examined more bytes than needed to complete
				// this lead byte. No matter about well-formedness or
				// validity, the sequence starting with this lead byte
				// will never include the fallback location, so we must
				// return the fallback location. See test utf-7.17
				return fallback
			}

			// trailBytesSeen > 0, so we can examine look[1] safely.
			// Use that capability to screen out invalid sequences.

			if sInvalid(tls, look) != 0 {
				// Reject
				return fallback
			}
			return look
		}

		// We saw a trail byte.
		trailBytesSeen++

		if look == start {
			// Do not read before the start of the string
			//
			// If we get here, we've examined bytes at every location
			// >= start and < src and all of them are trail bytes,
			// including (*start).  We need to return our fallback
			// and exit this loop before we run past the start of the string.
			return fallback
		}

		// Continue the search backwards...
		look--
	}

	// We've seen 3 trail bytes, so we know there will not be a
	// properly formed byte sequence to find, and we can stop looking,
	// accepting the fallback.
	return fallback
}

//---------------------------------------------------------------------------
//
// Tcl_UniCharAtIndex --
//
//	Returns the Tcl_UniChar represented at the specified character
//	(not byte) position in the UTF-8 string.
//
// Results:
//	As above.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_UniCharAtIndex(tls *libc.TLS, src uintptr, index int32) Tcl_UniChar { /* tclUtf.c:934:1: */
	bp := tls.Alloc(2)
	defer tls.Free(2)

	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)) = Tcl_UniChar(0)

	for libc.PostDecInt32(&index, 1) >= 0 {
		src += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, src, bp))
		}()
	}
	return *(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */))
}

//---------------------------------------------------------------------------
//
// Tcl_UtfAtIndex --
//
//	Returns a pointer to the specified character (not byte) position in
//	the UTF-8 string.
//
// Results:
//	As above.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTcl_UtfAtIndex(tls *libc.TLS, src uintptr, index int32) uintptr { /* tclUtf.c:963:12: */
	bp := tls.Alloc(2)
	defer tls.Free(2)

	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)) = Tcl_UniChar(0)
	var len int32 = 0

	for libc.PostDecInt32(&index, 1) > 0 {
		len = func() int32 {
			if int32(uint8(*(*int8)(unsafe.Pointer(src)))) < 0x80 {
				return func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(src))))
					return 1
				}()
			}
			return XTcl_UtfToUniChar(tls, src, bp)
		}()
		src += uintptr(len)
	}
	return src
}

//---------------------------------------------------------------------------
//
// Tcl_UtfBackslash --
//
//	Figure out how to handle a backslash sequence.
//
// Results:
//	Stores the bytes represented by the backslash sequence in dst and
//	returns the number of bytes written to dst. At most TCL_UTF_MAX bytes
//	are written to dst; dst must have been large enough to accept those
//	bytes. If readPtr isn't NULL then it is filled in with a count of the
//	number of bytes in the backslash sequence.
//
// Side effects:
//	The maximum number of bytes it takes to represent a Unicode character
//	in UTF-8 is guaranteed to be less than the number of bytes used to
//	express the backslash sequence that represents that Unicode character.
//	If the target buffer into which the caller is going to store the bytes
//	that represent the Unicode character is at least as large as the
//	source buffer from which the backslashed sequence was extracted, no
//	buffer overruns should occur.
//
//---------------------------------------------------------------------------

func XTcl_UtfBackslash(tls *libc.TLS, src uintptr, readPtr uintptr, dst uintptr) int32 { /* tclUtf.c:1011:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var numRead int32 at bp, 4

	var result int32

	result = XTclParseBackslash(tls, src, LINE_LENGTH, bp, dst)
	if *(*int32)(unsafe.Pointer(bp)) == LINE_LENGTH {
		// We ate a whole line. Pay the price of a strlen()

		result = XTclParseBackslash(tls, src, int32(libc.Xstrlen(tls, src)), bp, dst)
	}
	if readPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(readPtr)) = *(*int32)(unsafe.Pointer(bp /* numRead */))
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_UtfToUpper --
//
//	Convert lowercase characters to uppercase characters in a UTF string
//	in place. The conversion may shrink the UTF string.
//
// Results:
//	Returns the number of bytes in the resulting string excluding the
//	trailing null.
//
// Side effects:
//	Writes a terminating null after the last converted character.
//
//----------------------------------------------------------------------

func XTcl_UtfToUpper(tls *libc.TLS, str uintptr) int32 { /* tclUtf.c:1056:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var ch int32 at bp, 4

	var upChar int32
	var src uintptr
	var dst uintptr
	var len int32

	// Iterate over the string until we hit the terminating null.

	src = libc.AssignUintptr(&dst, str)
	for *(*int8)(unsafe.Pointer(src)) != 0 {
		len = XTclUtfToUCS4(tls, src, bp)
		upChar = sUCS4ToUpper(tls, *(*int32)(unsafe.Pointer(bp /* ch */)))

		// To keep badly formed Utf strings from getting inflated by the
		// conversion (thereby causing a segfault), only copy the upper case
		// char to dst if its size is <= the original char.

		if len < sUtfCount(tls, upChar) {
			libc.Xmemmove(tls, dst, src, uint64(len))
			dst += uintptr(len)
		} else {
			dst += uintptr(XTclUCS4ToUtf(tls, upChar, dst))
		}
		src += uintptr(len)
	}
	*(*int8)(unsafe.Pointer(dst)) = int8(0)
	return int32((int64(dst) - int64(str)) / 1)
}

//----------------------------------------------------------------------
//
// Tcl_UtfToLower --
//
//	Convert uppercase characters to lowercase characters in a UTF string
//	in place. The conversion may shrink the UTF string.
//
// Results:
//	Returns the number of bytes in the resulting string excluding the
//	trailing null.
//
// Side effects:
//	Writes a terminating null after the last converted character.
//
//----------------------------------------------------------------------

func XTcl_UtfToLower(tls *libc.TLS, str uintptr) int32 { /* tclUtf.c:1109:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var ch int32 at bp, 4

	var lowChar int32
	var src uintptr
	var dst uintptr
	var len int32

	// Iterate over the string until we hit the terminating null.

	src = libc.AssignUintptr(&dst, str)
	for *(*int8)(unsafe.Pointer(src)) != 0 {
		len = XTclUtfToUCS4(tls, src, bp)
		lowChar = XTclUCS4ToLower(tls, *(*int32)(unsafe.Pointer(bp /* ch */)))

		// To keep badly formed Utf strings from getting inflated by the
		// conversion (thereby causing a segfault), only copy the lower case
		// char to dst if its size is <= the original char.

		if len < sUtfCount(tls, lowChar) {
			libc.Xmemmove(tls, dst, src, uint64(len))
			dst += uintptr(len)
		} else {
			dst += uintptr(XTclUCS4ToUtf(tls, lowChar, dst))
		}
		src += uintptr(len)
	}
	*(*int8)(unsafe.Pointer(dst)) = int8(0)
	return int32((int64(dst) - int64(str)) / 1)
}

//----------------------------------------------------------------------
//
// Tcl_UtfToTitle --
//
//	Changes the first character of a UTF string to title case or uppercase
//	and the rest of the string to lowercase. The conversion happens in
//	place and may shrink the UTF string.
//
// Results:
//	Returns the number of bytes in the resulting string excluding the
//	trailing null.
//
// Side effects:
//	Writes a terminating null after the last converted character.
//
//----------------------------------------------------------------------

func XTcl_UtfToTitle(tls *libc.TLS, str uintptr) int32 { /* tclUtf.c:1163:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var ch int32 at bp, 4

	var titleChar int32
	var lowChar int32
	var src uintptr
	var dst uintptr
	var len int32

	// Capitalize the first character and then lowercase the rest of the
	// characters until we get to a null.

	src = libc.AssignUintptr(&dst, str)

	if *(*int8)(unsafe.Pointer(src)) != 0 {
		len = XTclUtfToUCS4(tls, src, bp)
		titleChar = sUCS4ToTitle(tls, *(*int32)(unsafe.Pointer(bp /* ch */)))

		if len < sUtfCount(tls, titleChar) {
			libc.Xmemmove(tls, dst, src, uint64(len))
			dst += uintptr(len)
		} else {
			dst += uintptr(XTclUCS4ToUtf(tls, titleChar, dst))
		}
		src += uintptr(len)
	}
	for *(*int8)(unsafe.Pointer(src)) != 0 {
		len = XTclUtfToUCS4(tls, src, bp)
		lowChar = *(*int32)(unsafe.Pointer(bp /* ch */))
		// Special exception for Georgian Asomtavruli chars, no titlecase.
		if uint32(lowChar-0x1C90) >= uint32(0x30) {
			lowChar = XTclUCS4ToLower(tls, lowChar)
		}

		if len < sUtfCount(tls, lowChar) {
			libc.Xmemmove(tls, dst, src, uint64(len))
			dst += uintptr(len)
		} else {
			dst += uintptr(XTclUCS4ToUtf(tls, lowChar, dst))
		}
		src += uintptr(len)
	}
	*(*int8)(unsafe.Pointer(dst)) = int8(0)
	return int32((int64(dst) - int64(str)) / 1)
}

//----------------------------------------------------------------------
//
// TclpUtfNcmp2 --
//
//	Compare at most numBytes bytes of utf-8 strings cs and ct. Both cs and
//	ct are assumed to be at least numBytes bytes long.
//
// Results:
//	Return <0 if cs < ct, 0 if cs == ct, or >0 if cs > ct.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclpUtfNcmp2(tls *libc.TLS, cs uintptr, ct uintptr, numBytes uint64) int32 { /* tclUtf.c:1227:1: */
	// We can't simply call 'memcmp(cs, ct, numBytes);' because we need to
	// check for Tcl's \xC0\x80 non-utf-8 null encoding. Otherwise utf-8 lexes
	// fine in the strcmp manner.

	var result int32 = 0

__1:
	if !(numBytes != uint64(0)) {
		goto __3
	}
	{
		if int32(*(*int8)(unsafe.Pointer(cs))) != int32(*(*int8)(unsafe.Pointer(ct))) {
			result = int32(uint8(*(*int8)(unsafe.Pointer(cs)))) - int32(uint8(*(*int8)(unsafe.Pointer(ct))))
			goto __3
		}

	}
	goto __2
__2:
	numBytes--
	cs++
	ct++
	goto __1
	goto __3
__3:
	;
	if numBytes != 0 && (int32(uint8(*(*int8)(unsafe.Pointer(cs)))) == 0xC0 || int32(uint8(*(*int8)(unsafe.Pointer(ct)))) == 0xC0) {
		var c1 uint8
		var c2 uint8

		if int32(uint8(*(*int8)(unsafe.Pointer(cs)))) == 0xC0 && int32(uint8(*(*int8)(unsafe.Pointer(cs + 1)))) == 0x80 {
			c1 = uint8(0)
		} else {
			c1 = uint8(*(*int8)(unsafe.Pointer(cs)))
		}
		if int32(uint8(*(*int8)(unsafe.Pointer(ct)))) == 0xC0 && int32(uint8(*(*int8)(unsafe.Pointer(ct + 1)))) == 0x80 {
			c2 = uint8(0)
		} else {
			c2 = uint8(*(*int8)(unsafe.Pointer(ct)))
		}
		result = int32(c1) - int32(c2)
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_UtfNcmp --
//
//	Compare at most numChars UTF chars of string cs to string ct. Both cs
//	and ct are assumed to be at least numChars UTF chars long.
//
// Results:
//	Return <0 if cs < ct, 0 if cs == ct, or >0 if cs > ct.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UtfNcmp(tls *libc.TLS, cs uintptr, ct uintptr, numChars uint64) int32 { /* tclUtf.c:1274:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch1 */)) = Tcl_UniChar(0)
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 2 /* ch2 */)) = Tcl_UniChar(0)

	// Cannot use 'memcmp(cs, ct, n);' as byte representation of \u0000 (the
	// pair of bytes 0xC0,0x80) is larger than byte representation of \u0001
	// (the byte 0x01.)

	for libc.PostDecUint64(&numChars, 1) > uint64(0) {
		// n must be interpreted as chars, not bytes. This should be called
		// only when both strings are of at least n chars long (no need for \0
		// check)

		cs += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(cs)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(cs))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, cs, bp))
		}()
		ct += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(ct)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp + 2)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(ct))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, ct, bp+2))
		}()
		if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) != int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2))) {
			return int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) - int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2)))
		}
	}
	return 0
}

//----------------------------------------------------------------------
//
// Tcl_UtfNcasecmp --
//
//	Compare at most numChars UTF chars of string cs to string ct case
//	insensitive. Both cs and ct are assumed to be at least numChars UTF
//	chars long.
//
// Results:
//	Return <0 if cs < ct, 0 if cs == ct, or >0 if cs > ct.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UtfNcasecmp(tls *libc.TLS, cs uintptr, ct uintptr, numChars uint64) int32 { /* tclUtf.c:1332:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch1 */)) = Tcl_UniChar(0)
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 2 /* ch2 */)) = Tcl_UniChar(0)

	for libc.PostDecUint64(&numChars, 1) > uint64(0) {
		// n must be interpreted as chars, not bytes.
		// This should be called only when both strings are of
		// at least n chars long (no need for \0 check)
		cs += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(cs)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(cs))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, cs, bp))
		}()
		ct += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(ct)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp + 2)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(ct))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, ct, bp+2))
		}()
		if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) != int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2))) {
			*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch1 */)) = XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch1 */))))
			*(*Tcl_UniChar)(unsafe.Pointer(bp + 2 /* ch2 */)) = XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2 /* ch2 */))))
			if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) != int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2))) {
				return int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) - int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2)))
			}
		}
	}
	return 0
}

//----------------------------------------------------------------------
//
// TclUtfCasecmp --
//
//	Compare UTF chars of string cs to string ct case insensitively.
//	Replacement for strcasecmp in Tcl core, in places where UTF-8 should
//	be handled.
//
// Results:
//	Return <0 if cs < ct, 0 if cs == ct, or >0 if cs > ct.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclUtfCasecmp(tls *libc.TLS, cs uintptr, ct uintptr) int32 { /* tclUtf.c:1387:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch1 */)) = Tcl_UniChar(0)
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 2 /* ch2 */)) = Tcl_UniChar(0)

	for *(*int8)(unsafe.Pointer(cs)) != 0 && *(*int8)(unsafe.Pointer(ct)) != 0 {
		cs += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(cs)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(cs))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, cs, bp))
		}()
		ct += func() uintptr {
			if int32(uint8(*(*int8)(unsafe.Pointer(ct)))) < 0x80 {
				return uintptr(func() int32 {
					*(*Tcl_UniChar)(unsafe.Pointer(bp + 2)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(ct))))
					return 1
				}())
			}
			return uintptr(XTcl_UtfToUniChar(tls, ct, bp+2))
		}()
		if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) != int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2))) {
			*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch1 */)) = XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch1 */))))
			*(*Tcl_UniChar)(unsafe.Pointer(bp + 2 /* ch2 */)) = XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2 /* ch2 */))))
			if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) != int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2))) {
				return int32(*(*Tcl_UniChar)(unsafe.Pointer(bp))) - int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2)))
			}
		}
	}
	return int32(uint8(*(*int8)(unsafe.Pointer(cs)))) - int32(uint8(*(*int8)(unsafe.Pointer(ct))))
}

//----------------------------------------------------------------------
//
// Tcl_UniCharToUpper --
//
//	Compute the uppercase equivalent of the given Unicode character.
//
// Results:
//	Returns the uppercase Unicode character.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sUCS4ToUpper(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1435:1: */
	if !(ch&0x1F0000 != 0) {
		var info int32 = groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]]

		if info&0xE0>>5&0x04 != 0 {
			ch = ch - info>>8
		}
	}
	// Clear away extension bits, if any
	return ch & 0x1FFFFF
}

func XTcl_UniCharToUpper(tls *libc.TLS, ch int32) Tcl_UniChar { /* tclUtf.c:1450:1: */
	return Tcl_UniChar(sUCS4ToUpper(tls, ch))
}

//----------------------------------------------------------------------
//
// Tcl_UniCharToLower --
//
//	Compute the lowercase equivalent of the given Unicode character.
//
// Results:
//	Returns the lowercase Unicode character.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclUCS4ToLower(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1473:1: */
	if !(ch&0x1F0000 != 0) {
		var info int32 = groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]]
		var mode int32 = info & 0xE0 >> 5

		if mode&0x02 != 0 && mode != 0x7 {
			ch = ch + info>>8
		}
	}
	// Clear away extension bits, if any
	return ch & 0x1FFFFF
}

func XTcl_UniCharToLower(tls *libc.TLS, ch int32) Tcl_UniChar { /* tclUtf.c:1489:1: */
	return Tcl_UniChar(XTclUCS4ToLower(tls, ch))
}

//----------------------------------------------------------------------
//
// Tcl_UniCharToTitle --
//
//	Compute the titlecase equivalent of the given Unicode character.
//
// Results:
//	Returns the titlecase Unicode character.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sUCS4ToTitle(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1512:1: */
	if !(ch&0x1F0000 != 0) {
		var info int32 = groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]]
		var mode int32 = info & 0xE0 >> 5

		if mode&0x1 != 0 {
			// Subtract or add one depending on the original case.

			if mode != 0x7 {
				ch = ch + func() int32 {
					if mode&0x4 != 0 {
						return -1
					}
					return 1
				}()
			}
		} else if mode == 0x4 {
			ch = ch - info>>8
		}
	}
	// Clear away extension bits, if any
	return ch & 0x1FFFFF
}

func XTcl_UniCharToTitle(tls *libc.TLS, ch int32) Tcl_UniChar { /* tclUtf.c:1536:1: */
	return Tcl_UniChar(sUCS4ToTitle(tls, ch))
}

//----------------------------------------------------------------------
//
// Tcl_UniCharLen --
//
//	Find the length of a UniChar string. The str input must be null
//	terminated.
//
// Results:
//	Returns the length of str in UniChars (not bytes).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharLen(tls *libc.TLS, uniStr uintptr) int32 { /* tclUtf.c:1560:1: */
	var len int32 = 0

	for int32(*(*Tcl_UniChar)(unsafe.Pointer(uniStr))) != 0 {
		len++
		uniStr += 2
	}
	return len
}

//----------------------------------------------------------------------
//
// Tcl_UniCharNcmp --
//
//	Compare at most numChars unichars of string ucs to string uct.
//	Both ucs and uct are assumed to be at least numChars unichars long.
//
// Results:
//	Return <0 if ucs < uct, 0 if ucs == uct, or >0 if ucs > uct.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharNcmp(tls *libc.TLS, ucs uintptr, uct uintptr, numChars uint64) int32 { /* tclUtf.c:1590:1: */
	// We can't simply call memcmp() because that is not lexically correct.

__1:
	if !(numChars != uint64(0)) {
		goto __3
	}
	{
		if int32(*(*Tcl_UniChar)(unsafe.Pointer(ucs))) != int32(*(*Tcl_UniChar)(unsafe.Pointer(uct))) {
			return int32(*(*Tcl_UniChar)(unsafe.Pointer(ucs))) - int32(*(*Tcl_UniChar)(unsafe.Pointer(uct)))
		}

	}
	goto __2
__2:
	ucs += 2
	uct += 2
	numChars--
	goto __1
	goto __3
__3:
	;
	return 0
}

//----------------------------------------------------------------------
//
// Tcl_UniCharNcasecmp --
//
//	Compare at most numChars unichars of string ucs to string uct case
//	insensitive. Both ucs and uct are assumed to be at least numChars
//	unichars long.
//
// Results:
//	Return <0 if ucs < uct, 0 if ucs == uct, or >0 if ucs > uct.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharNcasecmp(tls *libc.TLS, ucs uintptr, uct uintptr, numChars uint64) int32 { /* tclUtf.c:1643:1: */
__1:
	if !(numChars != uint64(0)) {
		goto __3
	}
	{
		if int32(*(*Tcl_UniChar)(unsafe.Pointer(ucs))) != int32(*(*Tcl_UniChar)(unsafe.Pointer(uct))) {
			var lcs Tcl_UniChar = XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(ucs))))
			var lct Tcl_UniChar = XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(uct))))

			if int32(lcs) != int32(lct) {
				return int32(lcs) - int32(lct)
			}
		}

	}
	goto __2
__2:
	numChars--
	ucs += 2
	uct += 2
	goto __1
	goto __3
__3:
	;
	return 0
}

//----------------------------------------------------------------------
//
// Tcl_UniCharIsAlnum --
//
//	Test if a character is an alphanumeric Unicode character.
//
// Results:
//	Returns 1 if character is alphanumeric.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharIsAlnum(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1686:1: */
	return int32(int32(1)<<UPPERCASE_LETTER|int32(1)<<LOWERCASE_LETTER|int32(1)<<TITLECASE_LETTER|int32(1)<<MODIFIER_LETTER|int32(1)<<OTHER_LETTER|int32(1)<<DECIMAL_DIGIT_NUMBER) >> (groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]] & 0x1F) & 1
}

//----------------------------------------------------------------------
//
// Tcl_UniCharIsAlpha --
//
//	Test if a character is an alphabetic Unicode character.
//
// Results:
//	Returns 1 if character is alphabetic.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharIsAlpha(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1714:1: */
	return int32(int32(1)<<UPPERCASE_LETTER|int32(1)<<LOWERCASE_LETTER|int32(1)<<TITLECASE_LETTER|int32(1)<<MODIFIER_LETTER|int32(1)<<OTHER_LETTER) >> (groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]] & 0x1F) & 1
}

//----------------------------------------------------------------------
//
// Tcl_UniCharIsControl --
//
//	Test if a character is a Unicode control character.
//
// Results:
//	Returns non-zero if character is a control.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharIsControl(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1742:1: */
	return int32(int32(1)<<CONTROL|int32(1)<<FORMAT|int32(1)<<PRIVATE_USE) >> (groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]] & 0x1F) & 1
}

//----------------------------------------------------------------------
//
// Tcl_UniCharIsDigit --
//
//	Test if a character is a numeric Unicode character.
//
// Results:
//	Returns non-zero if character is a digit.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharIsDigit(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1778:1: */
	return libc.Bool32(groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]]&0x1F == DECIMAL_DIGIT_NUMBER)
}

//----------------------------------------------------------------------
//
// Tcl_UniCharIsGraph --
//
//	Test if a character is any Unicode print character except space.
//
// Results:
//	Returns non-zero if character is printable, but not space.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharIsGraph(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1806:1: */
	return int32(int32(1)<<UPPERCASE_LETTER|int32(1)<<LOWERCASE_LETTER|int32(1)<<TITLECASE_LETTER|int32(1)<<MODIFIER_LETTER|int32(1)<<OTHER_LETTER|int32(1)<<DECIMAL_DIGIT_NUMBER|int32(1)<<CONNECTOR_PUNCTUATION|(int32(1)<<CONNECTOR_PUNCTUATION|int32(1)<<DASH_PUNCTUATION|int32(1)<<OPEN_PUNCTUATION|int32(1)<<CLOSE_PUNCTUATION|int32(1)<<INITIAL_QUOTE_PUNCTUATION|int32(1)<<FINAL_QUOTE_PUNCTUATION|int32(1)<<OTHER_PUNCTUATION)|int32(1)<<NON_SPACING_MARK|int32(1)<<ENCLOSING_MARK|int32(1)<<COMBINING_SPACING_MARK|int32(1)<<LETTER_NUMBER|int32(1)<<OTHER_NUMBER|int32(1)<<MATH_SYMBOL|int32(1)<<CURRENCY_SYMBOL|int32(1)<<MODIFIER_SYMBOL|int32(1)<<OTHER_SYMBOL) >> (groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]] & 0x1F) & 1
}

//----------------------------------------------------------------------
//
// Tcl_UniCharIsLower --
//
//	Test if a character is a lowercase Unicode character.
//
// Results:
//	Returns non-zero if character is lowercase.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharIsLower(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1834:1: */
	return libc.Bool32(groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]]&0x1F == LOWERCASE_LETTER)
}

//----------------------------------------------------------------------
//
// Tcl_UniCharIsPrint --
//
//	Test if a character is a Unicode print character.
//
// Results:
//	Returns non-zero if character is printable.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharIsPrint(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1862:1: */
	return int32(int32(1)<<UPPERCASE_LETTER|int32(1)<<LOWERCASE_LETTER|int32(1)<<TITLECASE_LETTER|int32(1)<<MODIFIER_LETTER|int32(1)<<OTHER_LETTER|int32(1)<<DECIMAL_DIGIT_NUMBER|int32(1)<<CONNECTOR_PUNCTUATION|(int32(1)<<CONNECTOR_PUNCTUATION|int32(1)<<DASH_PUNCTUATION|int32(1)<<OPEN_PUNCTUATION|int32(1)<<CLOSE_PUNCTUATION|int32(1)<<INITIAL_QUOTE_PUNCTUATION|int32(1)<<FINAL_QUOTE_PUNCTUATION|int32(1)<<OTHER_PUNCTUATION)|int32(1)<<NON_SPACING_MARK|int32(1)<<ENCLOSING_MARK|int32(1)<<COMBINING_SPACING_MARK|int32(1)<<LETTER_NUMBER|int32(1)<<OTHER_NUMBER|int32(1)<<MATH_SYMBOL|int32(1)<<CURRENCY_SYMBOL|int32(1)<<MODIFIER_SYMBOL|int32(1)<<OTHER_SYMBOL|(int32(1)<<SPACE_SEPARATOR|int32(1)<<LINE_SEPARATOR|int32(1)<<PARAGRAPH_SEPARATOR)) >> (groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]] & 0x1F) & 1
}

//----------------------------------------------------------------------
//
// Tcl_UniCharIsPunct --
//
//	Test if a character is a Unicode punctuation character.
//
// Results:
//	Returns non-zero if character is punct.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharIsPunct(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1890:1: */
	return int32(int32(1)<<CONNECTOR_PUNCTUATION|int32(1)<<DASH_PUNCTUATION|int32(1)<<OPEN_PUNCTUATION|int32(1)<<CLOSE_PUNCTUATION|int32(1)<<INITIAL_QUOTE_PUNCTUATION|int32(1)<<FINAL_QUOTE_PUNCTUATION|int32(1)<<OTHER_PUNCTUATION) >> (groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]] & 0x1F) & 1
}

//----------------------------------------------------------------------
//
// Tcl_UniCharIsSpace --
//
//	Test if a character is a whitespace Unicode character.
//
// Results:
//	Returns non-zero if character is a space.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharIsSpace(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1918:1: */
	// Ignore upper 16 bits.
	ch = ch & 0xFFFF

	// If the character is within the first 127 characters, just use the
	// standard C function, otherwise consult the Unicode table.

	if ch < 0x80 {
		return func() int32 {
			if int32(int8(ch)) > 0x20 {
				return 0
			}
			return XTclIsSpaceProc(tls, int32(int8(ch)))
		}()
	} else if ch == 0x0085 || ch == 0x180E || ch == 0x200B ||
		ch == 0x202F || ch == 0x2060 || ch == 0xFEFF {
		return 1
	} else {
		return int32(int32(1)<<SPACE_SEPARATOR|int32(1)<<LINE_SEPARATOR|int32(1)<<PARAGRAPH_SEPARATOR) >> (groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]] & 0x1F) & 1
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// Tcl_UniCharIsUpper --
//
//	Test if a character is a uppercase Unicode character.
//
// Results:
//	Returns non-zero if character is uppercase.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharIsUpper(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1965:1: */
	return libc.Bool32(groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]]&0x1F == UPPERCASE_LETTER)
}

//----------------------------------------------------------------------
//
// Tcl_UniCharIsWordChar --
//
//	Test if a character is alphanumeric or a connector punctuation mark.
//
// Results:
//	Returns 1 if character is a word character.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharIsWordChar(tls *libc.TLS, ch int32) int32 { /* tclUtf.c:1993:1: */
	return int32(int32(1)<<UPPERCASE_LETTER|int32(1)<<LOWERCASE_LETTER|int32(1)<<TITLECASE_LETTER|int32(1)<<MODIFIER_LETTER|int32(1)<<OTHER_LETTER|int32(1)<<DECIMAL_DIGIT_NUMBER|int32(1)<<CONNECTOR_PUNCTUATION) >> (groups[groupMap[int32(pageMap[ch&0xFFFF>>OFFSET_BITS])|ch&(int32(1)<<OFFSET_BITS-1)]] & 0x1F) & 1
}

//----------------------------------------------------------------------
//
// Tcl_UniCharCaseMatch --
//
//	See if a particular Unicode string matches a particular pattern.
//	Allows case insensitivity. This is the Unicode equivalent of the char*
//	Tcl_StringCaseMatch. The UniChar strings must be NULL-terminated.
//	This has no provision for counted UniChar strings, thus should not be
//	used where NULLs are expected in the UniChar string. Use
//	TclUniCharMatch where possible.
//
// Results:
//	The return value is 1 if string matches pattern, and 0 otherwise. The
//	matching operation permits the following special characters in the
//	pattern: *?\[] (see the manual entry for details on what these mean).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_UniCharCaseMatch(tls *libc.TLS, uniStr uintptr, uniPattern uintptr, nocase int32) int32 { /* tclUtf.c:2028:1: */
	var ch1 Tcl_UniChar = Tcl_UniChar(0)
	var p Tcl_UniChar

	for 1 != 0 {
		p = *(*Tcl_UniChar)(unsafe.Pointer(uniPattern))

		// See if we're at the end of both the pattern and the string. If so,
		// we succeeded. If we're at the end of the pattern but not at the end
		// of the string, we failed.

		if int32(p) == 0 {
			return libc.Bool32(int32(*(*Tcl_UniChar)(unsafe.Pointer(uniStr))) == 0)
		}
		if int32(*(*Tcl_UniChar)(unsafe.Pointer(uniStr))) == 0 && int32(p) != '*' {
			return 0
		}

		// Check for a "*" as the next pattern character. It matches any
		// substring. We handle this by skipping all the characters up to the
		// next matching one in the pattern, and then calling ourselves
		// recursively for each postfix of string, until either we match or we
		// reach the end of the string.

		if int32(p) == '*' {
			// Skip all successive *'s in the pattern

			for int32(*(*Tcl_UniChar)(unsafe.Pointer(libc.PreIncUintptr(&uniPattern, 2)))) == '*' {
				// empty body
			}
			p = *(*Tcl_UniChar)(unsafe.Pointer(uniPattern))
			if int32(p) == 0 {
				return 1
			}
			if nocase != 0 {
				p = XTcl_UniCharToLower(tls, int32(p))
			}
			for 1 != 0 {
				// Optimization for matching - cruise through the string
				// quickly if the next char in the pattern isn't a special
				// character

				if int32(p) != '[' && int32(p) != '?' && int32(p) != '\\' {
					if nocase != 0 {
						for *(*Tcl_UniChar)(unsafe.Pointer(uniStr)) != 0 && int32(p) != int32(*(*Tcl_UniChar)(unsafe.Pointer(uniStr))) &&
							int32(p) != int32(XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(uniStr))))) {
							uniStr += 2
						}
					} else {
						for *(*Tcl_UniChar)(unsafe.Pointer(uniStr)) != 0 && int32(p) != int32(*(*Tcl_UniChar)(unsafe.Pointer(uniStr))) {
							uniStr += 2
						}
					}
				}
				if XTcl_UniCharCaseMatch(tls, uniStr, uniPattern, nocase) != 0 {
					return 1
				}
				if int32(*(*Tcl_UniChar)(unsafe.Pointer(uniStr))) == 0 {
					return 0
				}
				uniStr += 2
			}
		}

		// Check for a "?" as the next pattern character. It matches any
		// single character.

		if int32(p) == '?' {
			uniPattern += 2
			uniStr += 2
			continue
		}

		// Check for a "[" as the next pattern character. It is followed by a
		// list of characters that are acceptable, or by a range (two
		// characters separated by "-").

		if int32(p) == '[' {
			var startChar Tcl_UniChar
			var endChar Tcl_UniChar

			uniPattern += 2
			ch1 = func() uint16 {
				if nocase != 0 {
					return XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(uniStr))))
				}
				return *(*Tcl_UniChar)(unsafe.Pointer(uniStr))
			}()
			uniStr += 2
			for 1 != 0 {
				if int32(*(*Tcl_UniChar)(unsafe.Pointer(uniPattern))) == ']' || int32(*(*Tcl_UniChar)(unsafe.Pointer(uniPattern))) == 0 {
					return 0
				}
				startChar = func() uint16 {
					if nocase != 0 {
						return XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(uniPattern))))
					}
					return *(*Tcl_UniChar)(unsafe.Pointer(uniPattern))
				}()
				uniPattern += 2
				if int32(*(*Tcl_UniChar)(unsafe.Pointer(uniPattern))) == '-' {
					uniPattern += 2
					if int32(*(*Tcl_UniChar)(unsafe.Pointer(uniPattern))) == 0 {
						return 0
					}
					endChar = func() uint16 {
						if nocase != 0 {
							return XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(uniPattern))))
						}
						return *(*Tcl_UniChar)(unsafe.Pointer(uniPattern))
					}()
					uniPattern += 2
					if int32(startChar) <= int32(ch1) && int32(ch1) <= int32(endChar) ||
						int32(endChar) <= int32(ch1) && int32(ch1) <= int32(startChar) {
						// Matches ranges of form [a-z] or [z-a].
						break
					}
				} else if int32(startChar) == int32(ch1) {
					break
				}
			}
			for int32(*(*Tcl_UniChar)(unsafe.Pointer(uniPattern))) != ']' {
				if int32(*(*Tcl_UniChar)(unsafe.Pointer(uniPattern))) == 0 {
					uniPattern -= 2
					break
				}
				uniPattern += 2
			}
			uniPattern += 2
			continue
		}

		// If the next pattern character is '\', just strip off the '\' so we
		// do exact matching on the character that follows.

		if int32(p) == '\\' {
			if int32(*(*Tcl_UniChar)(unsafe.Pointer(libc.PreIncUintptr(&uniPattern, 2)))) == 0 {
				return 0
			}
		}

		// There's no special character. Just make sure that the next bytes of
		// each string match.

		if nocase != 0 {
			if int32(XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(uniStr))))) != int32(XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(uniPattern))))) {
				return 0
			}
		} else if int32(*(*Tcl_UniChar)(unsafe.Pointer(uniStr))) != int32(*(*Tcl_UniChar)(unsafe.Pointer(uniPattern))) {
			return 0
		}
		uniStr += 2
		uniPattern += 2
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// TclUniCharMatch --
//
//	See if a particular Unicode string matches a particular pattern.
//	Allows case insensitivity. This is the Unicode equivalent of the char*
//	Tcl_StringCaseMatch. This variant of Tcl_UniCharCaseMatch uses counted
//	Strings, so embedded NULLs are allowed.
//
// Results:
//	The return value is 1 if string matches pattern, and 0 otherwise. The
//	matching operation permits the following special characters in the
//	pattern: *?\[] (see the manual entry for details on what these mean).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclUniCharMatch(tls *libc.TLS, string uintptr, strLen int32, pattern uintptr, ptnLen int32, nocase int32) int32 { /* tclUtf.c:2216:1: */
	var stringEnd uintptr
	var patternEnd uintptr
	var p Tcl_UniChar

	stringEnd = string + uintptr(strLen)*2
	patternEnd = pattern + uintptr(ptnLen)*2

	for 1 != 0 {
		// See if we're at the end of both the pattern and the string. If so,
		// we succeeded. If we're at the end of the pattern but not at the end
		// of the string, we failed.

		if pattern == patternEnd {
			return libc.Bool32(string == stringEnd)
		}
		p = *(*Tcl_UniChar)(unsafe.Pointer(pattern))
		if string == stringEnd && int32(p) != '*' {
			return 0
		}

		// Check for a "*" as the next pattern character. It matches any
		// substring. We handle this by skipping all the characters up to the
		// next matching one in the pattern, and then calling ourselves
		// recursively for each postfix of string, until either we match or we
		// reach the end of the string.

		if int32(p) == '*' {
			// Skip all successive *'s in the pattern.

			for int32(*(*Tcl_UniChar)(unsafe.Pointer(libc.PreIncUintptr(&pattern, 2)))) == '*' {
				// empty body
			}
			if pattern == patternEnd {
				return 1
			}
			p = *(*Tcl_UniChar)(unsafe.Pointer(pattern))
			if nocase != 0 {
				p = XTcl_UniCharToLower(tls, int32(p))
			}
			for 1 != 0 {
				// Optimization for matching - cruise through the string
				// quickly if the next char in the pattern isn't a special
				// character.

				if int32(p) != '[' && int32(p) != '?' && int32(p) != '\\' {
					if nocase != 0 {
						for string < stringEnd && int32(p) != int32(*(*Tcl_UniChar)(unsafe.Pointer(string))) &&
							int32(p) != int32(XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(string))))) {
							string += 2
						}
					} else {
						for string < stringEnd && int32(p) != int32(*(*Tcl_UniChar)(unsafe.Pointer(string))) {
							string += 2
						}
					}
				}
				if XTclUniCharMatch(tls, string, int32((int64(stringEnd)-int64(string))/2),
					pattern, int32((int64(patternEnd)-int64(pattern))/2), nocase) != 0 {
					return 1
				}
				if string == stringEnd {
					return 0
				}
				string += 2
			}
		}

		// Check for a "?" as the next pattern character. It matches any
		// single character.

		if int32(p) == '?' {
			pattern += 2
			string += 2
			continue
		}

		// Check for a "[" as the next pattern character. It is followed by a
		// list of characters that are acceptable, or by a range (two
		// characters separated by "-").

		if int32(p) == '[' {
			var ch1 Tcl_UniChar
			var startChar Tcl_UniChar
			var endChar Tcl_UniChar

			pattern += 2
			ch1 = func() uint16 {
				if nocase != 0 {
					return XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(string))))
				}
				return *(*Tcl_UniChar)(unsafe.Pointer(string))
			}()
			string += 2
			for 1 != 0 {
				if int32(*(*Tcl_UniChar)(unsafe.Pointer(pattern))) == ']' || pattern == patternEnd {
					return 0
				}
				startChar = func() uint16 {
					if nocase != 0 {
						return XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(pattern))))
					}
					return *(*Tcl_UniChar)(unsafe.Pointer(pattern))
				}()
				pattern += 2
				if int32(*(*Tcl_UniChar)(unsafe.Pointer(pattern))) == '-' {
					pattern += 2
					if pattern == patternEnd {
						return 0
					}
					endChar = func() uint16 {
						if nocase != 0 {
							return XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(pattern))))
						}
						return *(*Tcl_UniChar)(unsafe.Pointer(pattern))
					}()
					pattern += 2
					if int32(startChar) <= int32(ch1) && int32(ch1) <= int32(endChar) ||
						int32(endChar) <= int32(ch1) && int32(ch1) <= int32(startChar) {
						// Matches ranges of form [a-z] or [z-a].
						break
					}
				} else if int32(startChar) == int32(ch1) {
					break
				}
			}
			for int32(*(*Tcl_UniChar)(unsafe.Pointer(pattern))) != ']' {
				if pattern == patternEnd {
					pattern -= 2
					break
				}
				pattern += 2
			}
			pattern += 2
			continue
		}

		// If the next pattern character is '\', just strip off the '\' so we
		// do exact matching on the character that follows.

		if int32(p) == '\\' {
			if libc.PreIncUintptr(&pattern, 2) == patternEnd {
				return 0
			}
		}

		// There's no special character. Just make sure that the next bytes of
		// each string match.

		if nocase != 0 {
			if int32(XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(string))))) != int32(XTcl_UniCharToLower(tls, int32(*(*Tcl_UniChar)(unsafe.Pointer(pattern))))) {
				return 0
			}
		} else if int32(*(*Tcl_UniChar)(unsafe.Pointer(string))) != int32(*(*Tcl_UniChar)(unsafe.Pointer(pattern))) {
			return 0
		}
		string += 2
		pattern += 2
	}
	return int32(0)
}

//---------------------------------------------------------------------------
//
// TclUtfToUCS4 --
//
//	Extract the 4-byte codepoint from the leading bytes of the
//	Modified UTF-8 string "src".  This is a utility routine to
//	contain the surrogate gymnastics in one place.
//
//	The caller must ensure that the source buffer is long enough that this
//	routine does not run off the end and dereference non-existent memory
//	looking for trail bytes. If the source buffer is known to be '\0'
//	terminated, this cannot happen. Otherwise, the caller should call
//	TclUCS4Complete() before calling this routine to ensure that
//	enough bytes remain in the string.
//
// Results:
//	*usc4Ptr is filled with the UCS4 code point, and the return value is
//	the number of bytes from the UTF-8 string that were consumed.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclUtfToUCS4(tls *libc.TLS, src uintptr, ucs4Ptr uintptr) int32 { /* tclUtf.c:2412:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)) = Tcl_UniChar(0)
	var len int32 = XTcl_UtfToUniChar(tls, src, bp)

	if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp)))&libc.CplInt32(0x3FF) == 0xD800 {
		*(*Tcl_UniChar)(unsafe.Pointer(bp + 2 /* low */)) = *(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */))
		var len2 int32 = XTcl_UtfToUniChar(tls, src+uintptr(len), bp+2)
		if int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2)))&libc.CplInt32(0x3FF) == 0xDC00 {
			*(*int32)(unsafe.Pointer(ucs4Ptr)) = int32(*(*Tcl_UniChar)(unsafe.Pointer(bp)))&0x3FF<<10 | int32(*(*Tcl_UniChar)(unsafe.Pointer(bp + 2)))&0x3FF + 0x10000
			return len + len2
		}
	}
	*(*int32)(unsafe.Pointer(ucs4Ptr)) = int32(*(*Tcl_UniChar)(unsafe.Pointer(bp /* ch */)))
	return len
}

//---------------------------------------------------------------------------
//
// TclUCS4ToUtf --
//
//	Store the given Unicode character as a sequence of UTF-8 bytes in the
//	provided buffer. Might output 6 bytes, if the code point > 0xFFFF.
//
// Results:
//	The return values is the number of bytes in the buffer that were
//	consumed. If ch == -1, this function outputs 0 bytes (empty string),
//	since TclGetUCS4 returns -1 for out-of-range indices.
//
// Side effects:
//	None.
//
//---------------------------------------------------------------------------

func XTclUCS4ToUtf(tls *libc.TLS, ch int32, buf uintptr) int32 { /* tclUtf.c:2470:1: */
	if uint32(ch-0x10000) <= uint32(0xFFFFF) {
		// Spit out a 4-byte UTF-8 character or 2 x 3-byte UTF-8 characters, depending on Tcl
		// version and/or TCL_UTF_MAX build value
		var len int32 = XTcl_UniCharToUtf(tls, 0xD800|(ch-0x10000)>>10, buf)
		return len + XTcl_UniCharToUtf(tls, 0xDC00|ch&0x7FF, buf+uintptr(len))
	}
	if ch&libc.CplInt32(0x7FF) == 0xD800 {
		*(*int8)(unsafe.Pointer(buf + 2)) = int8((ch | 0x80) & 0xBF)
		*(*int8)(unsafe.Pointer(buf + 1)) = int8((ch>>6 | 0x80) & 0xBF)
		*(*int8)(unsafe.Pointer(buf)) = int8(ch>>12 | 0xE0)
		return 3
	}
	if ch == -1 {
		return 0
	}
	return XTcl_UniCharToUtf(tls, ch, buf)
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// GCC bug 66462 means we cannot use the math builtins with -fsignaling-nan,
//    so disable builtins if this is enabled.  When fixed in a newer GCC,
//    the __SUPPORT_SNAN__ check may be skipped for those versions.

// Return number of classification appropriate for X.
// The check for __cplusplus allows the use of the builtin, even
// 	when optimization for size is on.  This is provided for
// 	libstdc++, only to let its configure test work when it is built
// 	with -Os.  No further use of this definition of fpclassify is
// 	expected in C++ mode, since libstdc++ provides its own version
// 	of fpclassify in cmath (which undefines fpclassify).

// Return nonzero value if sign of X is negative.

// Return nonzero value if X is not +-Inf or NaN.

// Return nonzero value if X is neither zero, subnormal, Inf, nor NaN.

// Return nonzero value if X is a NaN.  We could use `fpclassify' but
//    we already have this functions `__isnan' and it is faster.

// Return nonzero value if X is positive or negative infinity.

// Bitmasks for the math_errhandling macro.

// By default all math functions support both errno and exception handling
//    (except for soft floating point implementations which may only support
//    errno handling).  If errno handling is disabled, exceptions are still
//    supported by GLIBC.  Set math_errhandling to 0 with -ffast-math (this is
//    nonconforming but it is more useful than leaving it undefined).

// Some useful constants.

// The above constants are not adequate for computation using `long double's.
//    Therefore we provide as an extension constants with similar names as a
//    GNU extension.  Provide enough digits for the 128-bit IEEE quad.

// When compiling in strict ISO C compatible mode we must not use the
//    inline functions since they, among other things, do not set the
//    `errno' variable correctly.

// ISO C99 defines some macros to compare number while taking care for
//    unordered numbers.  Many FPUs provide special instructions to support
//    these operations.  Generic support in GCC for these as builtins went
//    in 2.97, but not all cpus added their patterns until 3.1.  Therefore
//    we enable the builtins from 3.1 onwards and use a generic implementation
//    othwerwise.

// Get machine-dependent inline versions (if there are any).

// The absolute pathname of the executable in which this Tcl library is
// running.

var executableName = ProcessGlobalValue{} /* tclUtil.c:25:27 */

//
//  The following values are used in the flags arguments of Tcl*Scan*Element
//  and Tcl*Convert*Element.  The values TCL_DONT_USE_BRACES and
//  TCL_DONT_QUOTE_HASH are defined in tcl.h, like so:
//
// #define TCL_DONT_USE_BRACES     1
// #define TCL_DONT_QUOTE_HASH     8
//  *
//  * Those are public flag bits which callers of the public routines
//  * Tcl_Convert*Element() can use to indicate:
//  *
//  * TCL_DONT_USE_BRACES -	1 means the caller is insisting that brace
//  *				quoting not be used when converting the list
//  *				element.
//  * TCL_DONT_QUOTE_HASH -	1 means the caller insists that a leading hash
//  *				character ('#') should *not* be quoted. This
//  *				is appropriate when the caller can guarantee
//  *				the element is not the first element of a
//  *				list, so [eval] cannot mis-parse the element
//  *				as a comment.
//  *
//  * The remaining values which can be carried by the flags of these routines
//  * are for internal use only.  Make sure they do not overlap with the public
//  * values above.
//  *
//  * The Tcl*Scan*Element() routines make a determination which of 4 modes of
//  * conversion is most appropriate for Tcl*Convert*Element() to perform, and
//  * sets two bits of the flags value to indicate the mode selected.
//  *
//  * CONVERT_NONE		The element needs no quoting. Its literal string is
//  *			suitable as is.
//  * CONVERT_BRACE	The conversion should be enclosing the literal string
//  *			in braces.
//  * CONVERT_ESCAPE	The conversion should be using backslashes to escape
//  *			any characters in the string that require it.
//  * CONVERT_MASK		A mask value used to extract the conversion mode from
//  *			the flags argument.
//  *			Also indicates a strange conversion mode where all
//  *			special characters are escaped with backslashes
//  *			*except for braces*. This is a strange and unnecessary
//  *			case, but it's part of the historical way in which
//  *			lists have been formatted in Tcl. To experiment with
//  *			removing this case, set the value of COMPAT to 0.
//  *
//  * One last flag value is used only by callers of TclScanElement(). The flag
//  * value produced by a call to Tcl*Scan*Element() will never leave this bit
//  * set.
//  *
//  * CONVERT_ANY		The caller of TclScanElement() declares it can make no
//  *			promise about what public flags will be passed to the
//  *			matching call of TclConvertElement(). As such,
//  *			TclScanElement() has to determine the worst case
//  *			destination buffer length over all possibilities, and
//  *			in other cases this means an overestimate of the
//  *			required size.
//  *
//  * For more details, see the comments on the Tcl*Scan*Element and
//  * Tcl*Convert*Element routines.
//

// The following key is used by Tcl_PrintDouble and TclPrecTraceProc to
// access the precision to be used for double formatting.

var precisionKey Tcl_ThreadDataKey /* tclUtil.c:101:26: */
// The following is the Tcl object type definition for an object that
// represents a list index in the form, "end-offset". It is used as a
// performance optimization in TclGetIntForIndex. The internal rep is an
// integer, so no memory management is required for it.

var XtclEndOffsetType = Tcl_ObjType{
	Fname:             ts + 70917,
	FupdateStringProc: 0, // updateStringProc
	FsetFromAnyProc:   0,
} /* tclUtil.c:128:19 */

//	*	STRING REPRESENTATION OF LISTS	*	*	*
//
// The next several routines implement the conversions of strings to and from
// Tcl lists. To understand their operation, the rules of parsing and
// generating the string representation of lists must be known.  Here we
// describe them in one place.
//
// A list is made up of zero or more elements. Any string is a list if it is
// made up of alternating substrings of element-separating ASCII whitespace
// and properly formatted elements.
//
// The ASCII characters which can make up the whitespace between list elements
// are:
//
//	\u0009	\t	TAB
//	\u000A	\n	NEWLINE
//	\u000B	\v	VERTICAL TAB
//	\u000C	\f	FORM FEED
// 	\u000D	\r	CARRIAGE RETURN
//	\u0020		SPACE
//
// NOTE: differences between this and other places where Tcl defines a role
// for "whitespace".
//
//	* Unlike command parsing, here NEWLINE is just another whitespace
//	  character; its role as a command terminator in a script has no
//	  importance here.
//
//	* Unlike command parsing, the BACKSLASH NEWLINE sequence is not
//	  considered to be a whitespace character.
//
//	* Other Unicode whitespace characters (recognized by [string is space]
//	  or Tcl_UniCharIsSpace()) do not play any role as element separators
//	  in Tcl lists.
//
//	* The NUL byte ought not appear, as it is not in strings properly
//	  encoded for Tcl, but if it is present, it is not treated as
//	  separating whitespace, or a string terminator. It is just another
//	  character in a list element.
//
// The interpretation of a formatted substring as a list element follows rules
// similar to the parsing of the words of a command in a Tcl script. Backslash
// substitution plays a key role, and is defined exactly as it is in command
// parsing. The same routine, TclParseBackslash() is used in both command
// parsing and list parsing.
//
// NOTE: This means that if and when backslash substitution rules ever change
// for command parsing, the interpretation of strings as lists also changes.
//
// Backslash substitution replaces an "escape sequence" of one or more
// characters starting with
//		\u005c	\	BACKSLASH
// with a single character. The one character escape sequence case happens only
// when BACKSLASH is the last character in the string. In all other cases, the
// escape sequence is at least two characters long.
//
// The formatted substrings are interpreted as element values according to the
// following cases:
//
// * If the first character of a formatted substring is
//		\u007b	{	OPEN BRACE
//   then the end of the substring is the matching
//		\u007d	}	CLOSE BRACE
//   character, where matching is determined by counting nesting levels, and
//   not including any brace characters that are contained within a backslash
//   escape sequence in the nesting count. Having found the matching brace,
//   all characters between the braces are the string value of the element.
//   If no matching close brace is found before the end of the string, the
//   string is not a Tcl list. If the character following the close brace is
//   not an element separating whitespace character, or the end of the string,
//   then the string is not a Tcl list.
//
//   NOTE: this differs from a brace-quoted word in the parsing of a Tcl
//   command only in its treatment of the backslash-newline sequence. In a
//   list element, the literal characters in the backslash-newline sequence
//   become part of the element value. In a script word, conversion to a
//   single SPACE character is done.
//
//   NOTE: Most list element values can be represented by a formatted
//   substring using brace quoting. The exceptions are any element value that
//   includes an unbalanced brace not in a backslash escape sequence, and any
//   value that ends with a backslash not itself in a backslash escape
//   sequence.
//
// * If the first character of a formatted substring is
//		\u0022	"	QUOTE
//   then the end of the substring is the next QUOTE character, not counting
//   any QUOTE characters that are contained within a backslash escape
//   sequence. If no next QUOTE is found before the end of the string, the
//   string is not a Tcl list. If the character following the closing QUOTE is
//   not an element separating whitespace character, or the end of the string,
//   then the string is not a Tcl list. Having found the limits of the
//   substring, the element value is produced by performing backslash
//   substitution on the character sequence between the open and close QUOTEs.
//
//   NOTE: Any element value can be represented by this style of formatting,
//   given suitable choice of backslash escape sequences.
//
// * All other formatted substrings are terminated by the next element
//   separating whitespace character in the string.  Having found the limits
//   of the substring, the element value is produced by performing backslash
//   substitution on it.
//
//   NOTE: Any element value can be represented by this style of formatting,
//   given suitable choice of backslash escape sequences, with one exception.
//   The empty string cannot be represented as a list element without the use
//   of either braces or quotes to delimit it.
//
// This collection of parsing rules is implemented in the routine
// FindElement().
//
// In order to produce lists that can be parsed by these rules, we need the
// ability to distinguish between characters that are part of a list element
// value from characters providing syntax that define the structure of the
// list. This means that our code that generates lists must at a minimum be
// able to produce escape sequences for the 10 characters identified above
// that have significance to a list parser.
//
//	*	*	CANONICAL LISTS	*	*	*	*	*
//
// In addition to the basic rules for parsing strings into Tcl lists, there
// are additional properties to be met by the set of list values that are
// generated by Tcl.  Such list values are often said to be in "canonical
// form":
//
// * When any canonical list is evaluated as a Tcl script, it is a script of
//   either zero commands (an empty list) or exactly one command. The command
//   word is exactly the first element of the list, and each argument word is
//   exactly one of the following elements of the list. This means that any
//   characters that have special meaning during script evaluation need
//   special treatment when canonical lists are produced:
//
//	* Whitespace between elements may not include NEWLINE.
//	* The command terminating character,
//		\u003b	;	SEMICOLON
//	  must be BRACEd, QUOTEd, or escaped so that it does not terminate the
// 	  command prematurely.
//	* Any of the characters that begin substitutions in scripts,
//		\u0024	$	DOLLAR
//		\u005b	[	OPEN BRACKET
//		\u005c	\	BACKSLASH
//	  need to be BRACEd or escaped.
//	* In any list where the first character of the first element is
//		\u0023	#	HASH
//	  that HASH character must be BRACEd, QUOTEd, or escaped so that it
//	  does not convert the command into a comment.
//	* Any list element that contains the character sequence BACKSLASH
//	  NEWLINE cannot be formatted with BRACEs. The BACKSLASH character
//	  must be represented by an escape sequence, and unless QUOTEs are
//	  used, the NEWLINE must be as well.
//
// * It is also guaranteed that one can use a canonical list as a building
//   block of a larger script within command substitution, as in this example:
//	set script "puts \[[list $cmd $arg]]"; eval $script
//   To support this usage, any appearance of the character
//		\u005d	]	CLOSE BRACKET
//   in a list element must be BRACEd, QUOTEd, or escaped.
//
// * Finally it is guaranteed that enclosing a canonical list in braces
//   produces a new value that is also a canonical list.  This new list has
//   length 1, and its only element is the original canonical list.  This same
//   guarantee also makes it possible to construct scripts where an argument
//   word is given a list value by enclosing the canonical form of that list
//   in braces:
//	set script "puts {[list $one $two $three]}"; eval $script
//   This sort of coding was once fairly common, though it's become more
//   idiomatic to see the following instead:
//	set script [list puts [list $one $two $three]]; eval $script
//   In order to support this guarantee, every canonical list must have
//   balance when counting those braces that are not in escape sequences.
//
// Within these constraints, the canonical list generation routines
// TclScanElement() and TclConvertElement() attempt to generate the string for
// any list that is easiest to read. When an element value is itself
// acceptable as the formatted substring, it is usually used (CONVERT_NONE).
// When some quoting or escaping is required, use of BRACEs (CONVERT_BRACE) is
// usually preferred over the use of escape sequences (CONVERT_ESCAPE). There
// are some exceptions to both of these preferences for reasons of code
// simplicity, efficiency, and continuation of historical habits. Canonical
// lists never use the QUOTE formatting to delimit their elements because that
// form of quoting does not nest, which makes construction of nested lists far
// too much trouble.  Canonical lists always use only a single SPACE character
// for element-separating whitespace.
//
//	*	*	FUTURE CONSIDERATIONS	*	*	*
//
// When a list element requires quoting or escaping due to a CLOSE BRACKET
// character or an internal QUOTE character, a strange formatting mode is
// recommended. For example, if the value "a{b]c}d" is converted by the usual
// modes:
//
//	CONVERT_BRACE:	a{b]c}d		=> {a{b]c}d}
//	CONVERT_ESCAPE:	a{b]c}d		=> a\{b\]c\}d
//
// we get perfectly usable formatted list elements. However, this is not what
// Tcl releases have been producing. Instead, we have:
//
//	CONVERT_MASK:	a{b]c}d		=> a{b\]c}d
//
// where the CLOSE BRACKET is escaped, but the BRACEs are not. The same effect
// can be seen replacing ] with " in this example. There does not appear to be
// any functional or aesthetic purpose for this strange additional mode. The
// sole purpose I can see for preserving it is to keep generating the same
// formatted lists programmers have become accustomed to, and perhaps written
// tests to expect. That is, compatibility only. The additional code
// complexity required to support this mode is significant. The lines of code
// supporting it are delimited in the routines below with #if COMPAT
// directives. This makes it easy to experiment with eliminating this
// formatting mode simply with "#define COMPAT 0" above. I believe this is
// worth considering.
//
// Another consideration is the treatment of QUOTE characters in list
// elements. TclConvertElement() must have the ability to produce the escape
// sequence \" so that when a list element begins with a QUOTE we do not
// confuse that first character with a QUOTE used as list syntax to define
// list structure. However, that is the only place where QUOTE characters need
// quoting. In this way, handling QUOTE could really be much more like the way
// we handle HASH which also needs quoting and escaping only in particular
// situations. Following up this could increase the set of list elements that
// can use the CONVERT_NONE formatting mode.
//
// More speculative is that the demands of canonical list form require brace
// balance for the list as a whole, while the current implementation achieves
// this by establishing brace balance for every element.
//
// Finally, a reminder that the rules for parsing and formatting lists are
// closely tied together with the rules for parsing and evaluating scripts,
// and will need to evolve in sync.

//----------------------------------------------------------------------
//
// TclMaxListLength --
//
//	Given 'bytes' pointing to 'numBytes' bytes, scan through them and
//	count the number of whitespace runs that could be list element
//	separators. If 'numBytes' is -1, scan to the terminating '\0'. Not a
//	full list parser. Typically used to get a quick and dirty overestimate
//	of length size in order to allocate space for an actual list parser to
//	operate with.
//
// Results:
//	Returns the largest number of list elements that could possibly be in
//	this string, interpreted as a Tcl list. If 'endPtr' is not NULL,
//	writes a pointer to the end of the string scanned there.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclMaxListLength(tls *libc.TLS, bytes uintptr, numBytes int32, endPtr uintptr) int32 { /* tclUtil.c:391:1: */
	var count int32
	count = 0

	if !(numBytes == 0 || numBytes == -1 && int32(*(*int8)(unsafe.Pointer(bytes))) == 0) {
		goto __1
	}
	// Empty string case - quick exit
	goto done
__1:
	;

	// No list element before leading white space.

	count = count + (1 - func() int32 {
		if int32(*(*int8)(unsafe.Pointer(bytes))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(bytes))))
	}())

	// Count white space runs as potential element separators.

__2:
	if !(numBytes != 0) {
		goto __3
	}
	if !(numBytes == -1 && int32(*(*int8)(unsafe.Pointer(bytes))) == 0) {
		goto __4
	}
	goto __3
__4:
	;
	if !(func() int32 {
		if int32(*(*int8)(unsafe.Pointer(bytes))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(bytes))))
	}() != 0) {
		goto __5
	}
	// Space run started; bump count.

	count++
__6:
	bytes++
	numBytes = numBytes - libc.Bool32(numBytes != -1)
	goto __7
__7:
	if numBytes != 0 && func() int32 {
		if int32(*(*int8)(unsafe.Pointer(bytes))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(bytes))))
	}() != 0 {
		goto __6
	}
	goto __8
__8:
	;
	if !(numBytes == 0 || numBytes == -1 && int32(*(*int8)(unsafe.Pointer(bytes))) == 0) {
		goto __9
	}
	goto __3
__9:
	;

	// (*bytes) is non-space; return to counting state.
__5:
	;
	bytes++
	numBytes = numBytes - libc.Bool32(numBytes != -1)
	goto __2
__3:
	;

	// No list element following trailing white space.

	count = count - func() int32 {
		if int32(*(*int8)(unsafe.Pointer(bytes + libc.UintptrFromInt32(-1)))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(bytes + libc.UintptrFromInt32(-1)))))
	}()

done:
	if !(endPtr != 0) {
		goto __10
	}
	*(*uintptr)(unsafe.Pointer(endPtr)) = bytes
__10:
	;
	return count
}

//----------------------------------------------------------------------
//
// TclFindElement --
//
//	Given a pointer into a Tcl list, locate the first (or next) element in
//	the list.
//
// Results:
//	The return value is normally TCL_OK, which means that the element was
//	successfully located. If TCL_ERROR is returned it means that list
//	didn't have proper list structure; the interp's result contains a more
//	detailed error message.
//
//	If TCL_OK is returned, then *elementPtr will be set to point to the
//	first element of list, and *nextPtr will be set to point to the
//	character just after any white space following the last character
//	that's part of the element. If this is the last argument in the list,
//	then *nextPtr will point just after the last character in the list
//	(i.e., at the character at list+listLength). If sizePtr is non-NULL,
//	*sizePtr is filled in with the number of bytes in the element. If the
//	element is in braces, then *elementPtr will point to the character
//	after the opening brace and *sizePtr will not include either of the
//	braces. If there isn't an element in the list, *sizePtr will be zero,
//	and both *elementPtr and *nextPtr will point just after the last
//	character in the list. If literalPtr is non-NULL, *literalPtr is set
//	to a boolean value indicating whether the substring returned as the
//	values of **elementPtr and *sizePtr is the literal value of a list
//	element. If not, a call to TclCopyAndCollapse() is needed to produce
//	the actual value of the list element. Note: this function does NOT
//	collapse backslash sequences, but uses *literalPtr to tell callers
//	when it is required for them to do so.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclFindElement(tls *libc.TLS, interp uintptr, list uintptr, listLength int32, elementPtr uintptr, nextPtr uintptr, sizePtr uintptr, literalPtr uintptr) int32 { /* tclUtil.c:492:1: */
	return sFindElement(tls, interp, list, listLength, ts+2810, ts+70928, elementPtr,
		nextPtr, sizePtr, literalPtr)
}

func XTclFindDictElement(tls *libc.TLS, interp uintptr, dict uintptr, dictLength int32, elementPtr uintptr, nextPtr uintptr, sizePtr uintptr, literalPtr uintptr) int32 { /* tclUtil.c:519:1: */
	return sFindElement(tls, interp, dict, dictLength, ts+23186, ts+23220,
		elementPtr, nextPtr, sizePtr, literalPtr)
}

func sFindElement(tls *libc.TLS, interp uintptr, string uintptr, stringLength int32, typeStr uintptr, typeCode uintptr, elementPtr uintptr, nextPtr uintptr, sizePtr uintptr, literalPtr uintptr) int32 { /* tclUtil.c:548:1: */
	bp := tls.Alloc(228)
	defer tls.Free(228)

	var p uintptr
	var elemStart uintptr // Points to first byte of first element.
	var limit uintptr     // Points just after list/dict's last byte.
	var openBraces int32  // Brace nesting level during parse.
	var inQuotes int32
	var size int32
	// var numChars int32 at bp+224, 4

	var literal int32
	var p2 uintptr
	p = string
	openBraces = 0
	inQuotes = 0
	size = 0
	literal = 1

	// Skim off leading white space and check for an opening brace or quote.
	// We treat embedded NULLs in the list/dict as bytes belonging to a list
	// element (or dictionary key or value).

	limit = string + uintptr(stringLength)
__1:
	if !(p < limit && func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
	}() != 0) {
		goto __2
	}
	p++
	goto __1
__2:
	;
	if !(p == limit) {
		goto __3
	} // no element found
	elemStart = limit
	goto done
__3:
	;

	if !(int32(*(*int8)(unsafe.Pointer(p))) == '{') {
		goto __4
	}
	openBraces = 1
	p++
	goto __5
__4:
	if !(int32(*(*int8)(unsafe.Pointer(p))) == '"') {
		goto __6
	}
	inQuotes = 1
	p++
__6:
	;
__5:
	;
	elemStart = p

	// Find element's end (a space, close brace, or the end of the string).

__7:
	if !(p < limit) {
		goto __8
	}
	switch int32(*(*int8)(unsafe.Pointer(p))) {
	// Open brace: don't treat specially unless the element is in
	// braces. In this case, keep a nesting count.

	case '{':
		goto __10

		// Close brace: if element is in braces, keep nesting count and
		// quit when the last close brace is seen.

	case '}':
		goto __11

		// Backslash: skip over everything up to the end of the backslash
		// sequence.

	case '\\':
		goto __12

		// Double-quote: if element is in quotes then terminate it.

	case '"':
		goto __13

	default:
		goto __14
	}
	goto __9
	// Open brace: don't treat specially unless the element is in
	// braces. In this case, keep a nesting count.

__10:
	if !(openBraces != 0) {
		goto __15
	}
	openBraces++
__15:
	;
	goto __9

	// Close brace: if element is in braces, keep nesting count and
	// quit when the last close brace is seen.

__11:
	if !(openBraces > 1) {
		goto __16
	}
	openBraces--
	goto __17
__16:
	if !(openBraces == 1) {
		goto __18
	}
	size = int32((int64(p) - int64(elemStart)) / 1)
	p++
	if !(p >= limit || func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
	}() != 0) {
		goto __19
	}
	goto done
__19:
	;

	// Garbage after the closing brace; return an error.

	if !(interp != uintptr(0)) {
		goto __20
	}
	p2 = p
__21:
	if !(p2 < limit && !(func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p2))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p2))))
	}() != 0) &&
		p2 < p+uintptr(20)) {
		goto __22
	}
	p2++
	goto __21
__22:
	;
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+70933, libc.VaList(bp, typeStr, int32((int64(p2)-int64(p))/1), p)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+3593, ts+6915, typeCode, ts+70990,
		uintptr(0)))
__20:
	;
	return TCL_ERROR
__18:
	;
__17:
	;
	goto __9

	// Backslash: skip over everything up to the end of the backslash
	// sequence.

__12:
	if !(openBraces == 0) {
		goto __23
	}
	// A backslash sequence not within a brace quoted element
	// means the value of the element is different from the
	// substring we are parsing. A call to TclCopyAndCollapse() is
	// needed to produce the element value. Inform the caller.

	literal = 0
__23:
	;
	XTclParseBackslash(tls, p, int32((int64(limit)-int64(p))/1), bp+224, uintptr(0))
	p += uintptr(*(*int32)(unsafe.Pointer(bp + 224)) - 1)
	goto __9

	// Double-quote: if element is in quotes then terminate it.

__13:
	if !(inQuotes != 0) {
		goto __24
	}
	size = int32((int64(p) - int64(elemStart)) / 1)
	p++
	if !(p >= limit || func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
	}() != 0) {
		goto __25
	}
	goto done
__25:
	;

	// Garbage after the closing quote; return an error.

	if !(interp != uintptr(0)) {
		goto __26
	}
	p2 = p
__27:
	if !(p2 < limit && !(func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p2))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p2))))
	}() != 0) &&
		p2 < p+uintptr(20)) {
		goto __28
	}
	p2++
	goto __27
__28:
	;
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+70995, libc.VaList(bp+64, typeStr, int32((int64(p2)-int64(p))/1), p)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, ts+3593, ts+6915, typeCode, ts+70990,
		uintptr(0)))
__26:
	;
	return TCL_ERROR
__24:
	;
	goto __9

__14:
	if !(func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
	}() != 0) {
		goto __29
	}
	// Space: ignore if element is in braces or quotes;
	// otherwise terminate element.
	if !(openBraces == 0 && !(inQuotes != 0)) {
		goto __30
	}
	size = int32((int64(p) - int64(elemStart)) / 1)
	goto done
__30:
	;
__29:
	;
	goto __9

__9:
	;
	p++
	goto __7
__8:
	;

	// End of list/dict: terminate element.

	if !(p == limit) {
		goto __31
	}
	if !(openBraces != 0) {
		goto __32
	}
	if !(interp != uintptr(0)) {
		goto __34
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+71052, libc.VaList(bp+128, typeStr)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+136, ts+3593, ts+6915, typeCode, ts+71079,
		uintptr(0)))
__34:
	;
	return TCL_ERROR
	goto __33
__32:
	if !(inQuotes != 0) {
		goto __35
	}
	if !(interp != uintptr(0)) {
		goto __36
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+71085, libc.VaList(bp+176, typeStr)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+184, ts+3593, ts+6915, typeCode, ts+71112,
		uintptr(0)))
__36:
	;
	return TCL_ERROR
__35:
	;
__33:
	;
	size = int32((int64(p) - int64(elemStart)) / 1)
__31:
	;

done:
__37:
	if !(p < limit && func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
	}() != 0) {
		goto __38
	}
	p++
	goto __37
__38:
	;
	*(*uintptr)(unsafe.Pointer(elementPtr)) = elemStart
	*(*uintptr)(unsafe.Pointer(nextPtr)) = p
	if !(sizePtr != uintptr(0)) {
		goto __39
	}
	*(*int32)(unsafe.Pointer(sizePtr)) = size
__39:
	;
	if !(literalPtr != uintptr(0)) {
		goto __40
	}
	*(*int32)(unsafe.Pointer(literalPtr)) = literal
__40:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclCopyAndCollapse --
//
//	Copy a string and substitute all backslash escape sequences
//
// Results:
//	Count bytes get copied from src to dst. Along the way, backslash
//	sequences are substituted in the copy. After scanning count bytes from
//	src, a null character is placed at the end of dst. Returns the number
//	of bytes that got written to dst.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclCopyAndCollapse(tls *libc.TLS, count int32, src uintptr, dst uintptr) int32 { /* tclUtil.c:790:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var newCount int32 = 0

	for count > 0 {
		var c int8 = *(*int8)(unsafe.Pointer(src))

		if int32(c) == '\\' {
			// var numRead int32 at bp, 4

			var backslashCount int32 = XTclParseBackslash(tls, src, count, bp, dst)

			dst += uintptr(backslashCount)
			newCount = newCount + backslashCount
			src += uintptr(*(*int32)(unsafe.Pointer(bp /* numRead */)))
			count = count - *(*int32)(unsafe.Pointer(bp))
		} else {
			*(*int8)(unsafe.Pointer(dst)) = c
			dst++
			newCount++
			src++
			count--
		}
	}
	*(*int8)(unsafe.Pointer(dst)) = int8(0)
	return newCount
}

//----------------------------------------------------------------------
//
// Tcl_SplitList --
//
//	Splits a list up into its constituent fields.
//
// Results
//	The return value is normally TCL_OK, which means that the list was
//	successfully split up. If TCL_ERROR is returned, it means that "list"
//	didn't have proper list structure; the interp's result will contain a
//	more detailed error message.
//
//	*argvPtr will be filled in with the address of an array whose elements
//	point to the elements of list, in order. *argcPtr will get filled in
//	with the number of valid elements in the array. A single block of
//	memory is dynamically allocated to hold both the argv array and a copy
//	of the list (with backslashes and braces removed in the standard way).
//	The caller must eventually free this memory by calling free() on
//	*argvPtr. Note: *argvPtr and *argcPtr are only modified if the
//	function returns normally.
//
// Side effects:
//	Memory is allocated.
//
//----------------------------------------------------------------------

func XTcl_SplitList(tls *libc.TLS, interp uintptr, list uintptr, argcPtr uintptr, argvPtr uintptr) int32 { /* tclUtil.c:849:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)
	*(*uintptr)(unsafe.Pointer(bp + 48)) = list

	var argv uintptr
	// var end uintptr at bp+32, 8

	// var element uintptr at bp+40, 8

	var p uintptr
	var length int32
	var size int32
	var i int32
	var result int32
	// var elSize int32 at bp+56, 4

	// Allocate enough space to work in. A (const char *) for each (possible)
	// list element plus one more for terminating NULL, plus as many bytes as
	// in the original string value, plus one more for a terminating '\0'.
	// Space used to hold element separating white space in the original
	// string gets re-purposed to hold '\0' characters in the argv array.

	size = XTclMaxListLength(tls, *(*uintptr)(unsafe.Pointer(bp + 48)), -1, bp+32) + 1
	length = int32((int64(*(*uintptr)(unsafe.Pointer(bp + 32))) - int64(*(*uintptr)(unsafe.Pointer(bp + 48)))) / 1)
	argv = XTcl_Alloc(tls, uint32(uint64(size)*uint64(unsafe.Sizeof(uintptr(0)))+uint64(length)+uint64(1)))

	i = 0
	p = argv + uintptr(uint64(size)*uint64(unsafe.Sizeof(uintptr(0))))
	for ; int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48))))) != 0; i++ {
		var prevList uintptr = *(*uintptr)(unsafe.Pointer(bp + 48 /* list */))
		// var literal int32 at bp+60, 4

		result = XTclFindElement(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 48 /* list */)), length, bp+40, bp+48,
			bp+56, bp+60)
		length = int32(int64(length) - (int64(*(*uintptr)(unsafe.Pointer(bp + 48)))-int64(prevList))/1)
		if result != TCL_OK {
			XTclpFree(tls, argv)
			return result
		}
		if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40))))) == 0 {
			break
		}
		if i >= size {
			XTclpFree(tls, argv)
			if interp != uintptr(0) {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+71118, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+71150, ts+71159,
					uintptr(0)))
			}
			return TCL_ERROR
		}
		*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) = p
		if *(*int32)(unsafe.Pointer(bp + 60)) != 0 {
			libc.Xmemcpy(tls, p, *(*uintptr)(unsafe.Pointer(bp + 40 /* element */)), uint64(*(*int32)(unsafe.Pointer(bp + 56 /* elSize */))))
			p += uintptr(*(*int32)(unsafe.Pointer(bp + 56 /* elSize */)))
			*(*int8)(unsafe.Pointer(p)) = int8(0)
			p++
		} else {
			p += uintptr(1 + XTclCopyAndCollapse(tls, *(*int32)(unsafe.Pointer(bp + 56)), *(*uintptr)(unsafe.Pointer(bp + 40)), p))
		}
	}

	*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(argvPtr)) = argv
	*(*int32)(unsafe.Pointer(argcPtr)) = i
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ScanElement --
//
//	This function is a companion function to Tcl_ConvertElement. It scans
//	a string to see what needs to be done to it (e.g. add backslashes or
//	enclosing braces) to make the string into a valid Tcl list element.
//
// Results:
//	The return value is an overestimate of the number of bytes that will
//	be needed by Tcl_ConvertElement to produce a valid list element from
//	src. The word at *flagPtr is filled in with a value needed by
//	Tcl_ConvertElement when doing the actual conversion.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ScanElement(tls *libc.TLS, src uintptr, flagPtr uintptr) int32 { /* tclUtil.c:938:1: */
	return XTcl_ScanCountedElement(tls, src, -1, flagPtr)
}

//----------------------------------------------------------------------
//
// Tcl_ScanCountedElement --
//
//	This function is a companion function to Tcl_ConvertCountedElement. It
//	scans a string to see what needs to be done to it (e.g. add
//	backslashes or enclosing braces) to make the string into a valid Tcl
//	list element. If length is -1, then the string is scanned from src up
//	to the first null byte.
//
// Results:
//	The return value is an overestimate of the number of bytes that will
//	be needed by Tcl_ConvertCountedElement to produce a valid list element
//	from src. The word at *flagPtr is filled in with a value needed by
//	Tcl_ConvertCountedElement when doing the actual conversion.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ScanCountedElement(tls *libc.TLS, src uintptr, length int32, flagPtr uintptr) int32 { /* tclUtil.c:970:1: */
	bp := tls.Alloc(1)
	defer tls.Free(1)

	*(*int8)(unsafe.Pointer(bp /* flags */)) = int8(CONVERT_ANY)
	var numBytes int32 = XTclScanElement(tls, src, length, bp)

	*(*int32)(unsafe.Pointer(flagPtr)) = int32(*(*int8)(unsafe.Pointer(bp /* flags */)))
	return numBytes
}

//----------------------------------------------------------------------
//
// TclScanElement --
//
//	This function is a companion function to TclConvertElement. It scans a
//	string to see what needs to be done to it (e.g. add backslashes or
//	enclosing braces) to make the string into a valid Tcl list element. If
//	length is -1, then the string is scanned from src up to the first null
//	byte. A NULL value for src is treated as an empty string. The incoming
//	value of *flagPtr is a report from the caller what additional flags it
//	will pass to TclConvertElement().
//
// Results:
//	The recommended formatting mode for the element is determined and a
//	value is written to *flagPtr indicating that recommendation. This
//	recommendation is combined with the incoming flag values in *flagPtr
//	set by the caller to determine how many bytes will be needed by
//	TclConvertElement() in which to write the formatted element following
//	the recommendation modified by the flag values. This number of bytes
//	is the return value of the routine.  In some situations it may be an
//	overestimate, but so long as the caller passes the same flags to
//	TclConvertElement(), it will be large enough.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclScanElement(tls *libc.TLS, src uintptr, length int32, flagPtr uintptr) int32 { /* tclUtil.c:1014:1: */
	var p uintptr
	var nestingLevel int32 // Brace nesting count
	var forbidNone int32   // Do not permit CONVERT_NONE mode. Something
	// needs protection or escape.
	var requireEscape int32 // Force use of CONVERT_ESCAPE mode.  For some
	// reason bare or brace-quoted form fails.
	var extra int32 // Count of number of extra bytes needed for
	// formatted element, assuming we use escape
	// sequences in formatting.
	var bytesNeeded int32 // Buffer length computed to complete the
	// element formatting in the selected mode.
	var preferEscape int32 // Use preferences to track whether to use
	var preferBrace int32  // CONVERT_MASK mode.
	var braceCount int32
	p = src
	nestingLevel = 0
	forbidNone = 0
	requireEscape = 0
	extra = 0
	preferEscape = 0
	preferBrace = 0
	braceCount = 0 // Count of all braces '{' '}' seen.

	if !(p == uintptr(0) || length == 0 || int32(*(*int8)(unsafe.Pointer(p))) == 0 && length == -1) {
		goto __1
	}
	// Empty string element must be brace quoted.

	*(*int8)(unsafe.Pointer(flagPtr)) = int8(CONVERT_BRACE)
	return 2
__1:
	;

	// We have an established history in TclConvertElement() when quoting
	// because of a leading hash character to force what would be the
	// CONVERT_MASK mode into the CONVERT_BRACE mode. That is, we format
	// the element #{a"b} like this:
	//			{#{a"b}}
	// and not like this:
	//			\#{a\"b}
	// This is inconsistent with [list x{a"b}], but we will not change that now.
	// Set that preference here so that we compute a tight size requirement.
	if !(int32(*(*int8)(unsafe.Pointer(src))) == '#' && !(int32(*(*int8)(unsafe.Pointer(flagPtr)))&TCL_DONT_QUOTE_HASH != 0)) {
		goto __2
	}
	preferBrace = 1
__2:
	;

	if !(int32(*(*int8)(unsafe.Pointer(p))) == '{' || int32(*(*int8)(unsafe.Pointer(p))) == '"') {
		goto __3
	}
	// Must escape or protect so leading character of value is not
	// misinterpreted as list element delimiting syntax.

	forbidNone = 1
	preferBrace = 1
__3:
	;

__4:
	if !(length != 0) {
		goto __5
	}
	if !(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCharTypeTable)) + uintptr(128) + uintptr(uint8(*(*int8)(unsafe.Pointer(p))))))) != TYPE_NORMAL) {
		goto __6
	}
	switch int32(*(*int8)(unsafe.Pointer(p))) {
	case '{':
		goto __8
	case '}':
		goto __9
	case ']':
		goto __10 // TYPE_CLOSE_BRACK
	case '"':
		goto __11
	case '[':
		goto __12 // TYPE_SUBS
	case '$':
		goto __13 // TYPE_SUBS
	case ';':
		goto __14
	case '\\':
		goto __15
	case 0:
		goto __16
	default:
		goto __17
	}
	goto __7
__8: // TYPE_BRACE
	braceCount++
	extra++ // Escape '{' => '\{'
	nestingLevel++
	goto __7
__9: // TYPE_BRACE
	braceCount++
	extra++ // Escape '}' => '\}'
	nestingLevel--
	if !(nestingLevel < 0) {
		goto __18
	}
	// Unbalanced braces!  Cannot format with brace quoting.

	requireEscape = 1
__18:
	;
	goto __7
__10: // TYPE_CLOSE_BRACK
__11: // TYPE_SPACE
	forbidNone = 1
	extra++ // Escapes all just prepend a backslash
	preferEscape = 1
	goto __7
__12: // TYPE_SUBS
__13: // TYPE_SUBS
__14: // TYPE_COMMAND_END
	forbidNone = 1
	extra++ // Escape sequences all one byte longer.
	preferBrace = 1
	goto __7
__15: // TYPE_SUBS
	extra++ // Escape '\' => '\\'
	if !(length == 1 || length == -1 && int32(*(*int8)(unsafe.Pointer(p + 1))) == 0) {
		goto __19
	}
	// Final backslash. Cannot format with brace quoting.

	requireEscape = 1
	goto __7
__19:
	;
	if !(int32(*(*int8)(unsafe.Pointer(p + 1))) == '\n') {
		goto __20
	}
	extra++ // Escape newline => '\n', one byte longer

	// Backslash newline sequence.  Brace quoting not permitted.

	requireEscape = 1
	length = length - libc.Bool32(length > 0)
	p++
	goto __7
__20:
	;
	if !(int32(*(*int8)(unsafe.Pointer(p + 1))) == '{' || int32(*(*int8)(unsafe.Pointer(p + 1))) == '}' || int32(*(*int8)(unsafe.Pointer(p + 1))) == '\\') {
		goto __21
	}
	extra++ // Escape sequences all one byte longer.
	length = length - libc.Bool32(length > 0)
	p++
__21:
	;
	forbidNone = 1
	preferBrace = 1
	goto __7
__16: // TYPE_SUBS
	if !(length == -1) {
		goto __22
	}
	goto endOfString
__22:
	;
	// TODO: Panic on improper encoding?
	goto __7
__17:
	if !(func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
	}() != 0) {
		goto __23
	}
	forbidNone = 1
	extra++ // Escape sequences all one byte longer.
	preferBrace = 1
__23:
	;
	goto __7
__7:
	;
__6:
	;
	length = length - libc.Bool32(length > 0)
	p++
	goto __4
__5:
	;

endOfString:
	if !(nestingLevel != 0) {
		goto __24
	}
	// Unbalanced braces!  Cannot format with brace quoting.

	requireEscape = 1
__24:
	;

	// We need at least as many bytes as are in the element value...

	bytesNeeded = int32((int64(p) - int64(src)) / 1)

	if !(requireEscape != 0) {
		goto __25
	}
	// We must use escape sequences.  Add all the extra bytes needed to
	// have room to create them.

	bytesNeeded = bytesNeeded + extra

	// Make room to escape leading #, if needed.

	if !(int32(*(*int8)(unsafe.Pointer(src))) == '#' && !(int32(*(*int8)(unsafe.Pointer(flagPtr)))&TCL_DONT_QUOTE_HASH != 0)) {
		goto __26
	}
	bytesNeeded++
__26:
	;
	*(*int8)(unsafe.Pointer(flagPtr)) = int8(CONVERT_ESCAPE)
	goto overflowCheck
__25:
	;
	if !(int32(*(*int8)(unsafe.Pointer(flagPtr)))&CONVERT_ANY != 0) {
		goto __27
	}
	// The caller has not let us know what flags it will pass to
	// TclConvertElement() so compute the max size we might need for any
	// possible choice.  Normally the formatting using escape sequences is
	// the longer one, and a minimum "extra" value of 2 makes sure we
	// don't request too small a buffer in those edge cases where that's
	// not true.

	if !(extra < 2) {
		goto __28
	}
	extra = 2
__28:
	;
	*(*int8)(unsafe.Pointer(flagPtr)) &= int8(libc.CplInt32(CONVERT_ANY))
	*(*int8)(unsafe.Pointer(flagPtr)) |= int8(TCL_DONT_USE_BRACES)
__27:
	;
	if !(forbidNone != 0) {
		goto __29
	}
	// We must request some form of quoting of escaping...

	if !(preferEscape != 0 && !(preferBrace != 0)) {
		goto __30
	}
	// If we are quoting solely due to ] or internal " characters use
	// the CONVERT_MASK mode where we escape all special characters
	// except for braces. "extra" counted space needed to escape
	// braces too, so substract "braceCount" to get our actual needs.

	bytesNeeded = bytesNeeded + (extra - braceCount)
	// Make room to escape leading #, if needed.
	if !(int32(*(*int8)(unsafe.Pointer(src))) == '#' && !(int32(*(*int8)(unsafe.Pointer(flagPtr)))&TCL_DONT_QUOTE_HASH != 0)) {
		goto __31
	}
	bytesNeeded++
__31:
	;

	// If the caller reports it will direct TclConvertElement() to
	// use full escapes on the element, add back the bytes needed to
	// escape the braces.

	if !(int32(*(*int8)(unsafe.Pointer(flagPtr)))&TCL_DONT_USE_BRACES != 0) {
		goto __32
	}
	bytesNeeded = bytesNeeded + braceCount
__32:
	;
	*(*int8)(unsafe.Pointer(flagPtr)) = int8(CONVERT_BRACE | CONVERT_ESCAPE)
	goto overflowCheck
__30:
	;
	if !(int32(*(*int8)(unsafe.Pointer(flagPtr)))&TCL_DONT_USE_BRACES != 0) {
		goto __33
	}
	// If the caller reports it will direct TclConvertElement() to
	// use escapes, add the extra bytes needed to have room for them.

	bytesNeeded = bytesNeeded + extra

	// Make room to escape leading #, if needed.

	if !(int32(*(*int8)(unsafe.Pointer(src))) == '#' && !(int32(*(*int8)(unsafe.Pointer(flagPtr)))&TCL_DONT_QUOTE_HASH != 0)) {
		goto __35
	}
	bytesNeeded++
__35:
	;
	goto __34
__33:
	// Add 2 bytes for room for the enclosing braces.

	bytesNeeded = bytesNeeded + 2
__34:
	;
	*(*int8)(unsafe.Pointer(flagPtr)) = int8(CONVERT_BRACE)
	goto overflowCheck
__29:
	;

	// So far, no need to quote or escape anything.

	if !(int32(*(*int8)(unsafe.Pointer(src))) == '#' && !(int32(*(*int8)(unsafe.Pointer(flagPtr)))&TCL_DONT_QUOTE_HASH != 0)) {
		goto __36
	}
	// If we need to quote a leading #, make room to enclose in braces.

	bytesNeeded = bytesNeeded + 2
__36:
	;
	*(*int8)(unsafe.Pointer(flagPtr)) = int8(CONVERT_NONE)

overflowCheck:
	if !(bytesNeeded < 0) {
		goto __37
	}
	XTcl_Panic(tls, ts+71173, 0)
__37:
	;
	return bytesNeeded
}

//----------------------------------------------------------------------
//
// Tcl_ConvertElement --
//
//	This is a companion function to Tcl_ScanElement. Given the information
//	produced by Tcl_ScanElement, this function converts a string to a list
//	element equal to that string.
//
// Results:
//	Information is copied to *dst in the form of a list element identical
//	to src (i.e. if Tcl_SplitList is applied to dst it will produce a
//	string identical to src). The return value is a count of the number of
//	characters copied (not including the terminating NULL character).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ConvertElement(tls *libc.TLS, src uintptr, dst uintptr, flags int32) int32 { /* tclUtil.c:1321:1: */
	return XTcl_ConvertCountedElement(tls, src, -1, dst, flags)
}

//----------------------------------------------------------------------
//
// Tcl_ConvertCountedElement --
//
//	This is a companion function to Tcl_ScanCountedElement. Given the
//	information produced by Tcl_ScanCountedElement, this function converts
//	a string to a list element equal to that string.
//
// Results:
//	Information is copied to *dst in the form of a list element identical
//	to src (i.e. if Tcl_SplitList is applied to dst it will produce a
//	string identical to src). The return value is a count of the number of
//	characters copied (not including the terminating NULL character).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ConvertCountedElement(tls *libc.TLS, src uintptr, length int32, dst uintptr, flags int32) int32 { /* tclUtil.c:1351:1: */
	var numBytes int32 = XTclConvertElement(tls, src, length, dst, flags)
	*(*int8)(unsafe.Pointer(dst + uintptr(numBytes))) = int8(0)
	return numBytes
}

//----------------------------------------------------------------------
//
// TclConvertElement --
//
//	This is a companion function to TclScanElement. Given the information
//	produced by TclScanElement, this function converts a string to a list
//	element equal to that string.
//
// Results:
//	Information is copied to *dst in the form of a list element identical
//	to src (i.e. if Tcl_SplitList is applied to dst it will produce a
//	string identical to src). The return value is a count of the number of
//	characters copied (not including the terminating NULL character).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclConvertElement(tls *libc.TLS, src uintptr, length int32, dst uintptr, flags int32) int32 { /* tclUtil.c:1384:1: */
	var conversion int32 = flags & (CONVERT_BRACE | CONVERT_ESCAPE)
	var p uintptr = dst

	// Let the caller demand we use escape sequences rather than braces.

	if flags&TCL_DONT_USE_BRACES != 0 && conversion&CONVERT_BRACE != 0 {
		conversion = CONVERT_ESCAPE
	}

	// No matter what the caller demands, empty string must be braced!

	if src == uintptr(0) || length == 0 || int32(*(*int8)(unsafe.Pointer(src))) == 0 && length == -1 {
		src = XtclEmptyStringRep
		length = 0
		conversion = CONVERT_BRACE
	}

	// Escape leading hash as needed and requested.

	if int32(*(*int8)(unsafe.Pointer(src))) == '#' && !(flags&TCL_DONT_QUOTE_HASH != 0) {
		if conversion == CONVERT_ESCAPE {
			*(*int8)(unsafe.Pointer(p)) = int8('\\')
			*(*int8)(unsafe.Pointer(p + 1)) = int8('#')
			p += uintptr(2)
			src++
			length = length - libc.Bool32(length > 0)
		} else {
			conversion = CONVERT_BRACE
		}
	}

	// No escape or quoting needed.  Copy the literal string value.

	if conversion == CONVERT_NONE {
		if length == -1 {
			// TODO: INT_MAX overflow?
			for *(*int8)(unsafe.Pointer(src)) != 0 {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&src, 1)))
			}
			return int32((int64(p) - int64(dst)) / 1)
		} else {
			libc.Xmemcpy(tls, dst, src, uint64(length))
			return length
		}
	}

	// Formatted string is original string enclosed in braces.

	if conversion == CONVERT_BRACE {
		*(*int8)(unsafe.Pointer(p)) = int8('{')
		p++
		if length == -1 {
			// TODO: INT_MAX overflow?
			for *(*int8)(unsafe.Pointer(src)) != 0 {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&src, 1)))
			}
		} else {
			libc.Xmemcpy(tls, p, src, uint64(length))
			p += uintptr(length)
		}
		*(*int8)(unsafe.Pointer(p)) = int8('}')
		p++
		return int32((int64(p) - int64(dst)) / 1)
	}

	// conversion == CONVERT_ESCAPE or CONVERT_MASK

	// Formatted string is original string converted to escape sequences.

__1:
	if !(length != 0) {
		goto __3
	}
	{
		switch int32(*(*int8)(unsafe.Pointer(src))) {
		case ']':
			fallthrough
		case '[':
			fallthrough
		case '$':
			fallthrough
		case ';':
			fallthrough
		case ' ':
			fallthrough
		case '\\':
			fallthrough
		case '"':
			*(*int8)(unsafe.Pointer(p)) = int8('\\')
			p++
			break
		case '{':
			fallthrough
		case '}':
			if conversion == CONVERT_ESCAPE {
				*(*int8)(unsafe.Pointer(p)) = int8('\\')
				p++
			}
			break
		case '\f':
			*(*int8)(unsafe.Pointer(p)) = int8('\\')
			p++
			*(*int8)(unsafe.Pointer(p)) = int8('f')
			p++
			goto __2
		case '\n':
			*(*int8)(unsafe.Pointer(p)) = int8('\\')
			p++
			*(*int8)(unsafe.Pointer(p)) = int8('n')
			p++
			goto __2
		case '\r':
			*(*int8)(unsafe.Pointer(p)) = int8('\\')
			p++
			*(*int8)(unsafe.Pointer(p)) = int8('r')
			p++
			goto __2
		case '\t':
			*(*int8)(unsafe.Pointer(p)) = int8('\\')
			p++
			*(*int8)(unsafe.Pointer(p)) = int8('t')
			p++
			goto __2
		case '\v':
			*(*int8)(unsafe.Pointer(p)) = int8('\\')
			p++
			*(*int8)(unsafe.Pointer(p)) = int8('v')
			p++
			goto __2
		case 0:
			if length == -1 {
				return int32((int64(p) - int64(dst)) / 1)
			}

			// If we reach this point, there's an embedded NULL in the string
			// range being processed, which should not happen when the
			// encoding rules for Tcl strings are properly followed.  If the
			// day ever comes when we stop tolerating such things, this is
			// where to put the Tcl_Panic().

			break
		}
		*(*int8)(unsafe.Pointer(p)) = *(*int8)(unsafe.Pointer(src))
		p++

	}
	goto __2
__2:
	src++
	length = length - libc.Bool32(length > 0)
	goto __1
	goto __3
__3:
	;
	return int32((int64(p) - int64(dst)) / 1)
}

//----------------------------------------------------------------------
//
// Tcl_Merge --
//
//	Given a collection of strings, merge them together into a single
//	string that has proper Tcl list structured (i.e. Tcl_SplitList may be
//	used to retrieve strings equal to the original elements, and Tcl_Eval
//	will parse the string back into its original elements).
//
// Results:
//	The return value is the address of a dynamically-allocated string
//	containing the merged list.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_Merge(tls *libc.TLS, argc int32, argv uintptr) uintptr { /* tclUtil.c:1564:6: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	// var localFlags [64]int8 at bp+16, 64

	var flagPtr uintptr = uintptr(0)
	var i int32
	var bytesNeeded int32 = 0
	var result uintptr
	var dst uintptr

	// Handle empty list case first, so logic of the general case can be
	// simpler.

	if argc == 0 {
		result = XTcl_Alloc(tls, uint32(1))
		*(*int8)(unsafe.Pointer(result)) = int8(0)
		return result
	}

	// Pass 1: estimate space, gather flags.

	if argc <= LOCAL_SIZE {
		flagPtr = bp + 16 /* &localFlags[0] */
	} else {
		flagPtr = XTcl_Alloc(tls, uint32(argc))
	}
	for i = 0; i < argc; i++ {
		*(*int8)(unsafe.Pointer(flagPtr + uintptr(i))) = func() int8 {
			if i != 0 {
				return int8(TCL_DONT_QUOTE_HASH)
			}
			return int8(0)
		}()
		bytesNeeded = bytesNeeded + XTclScanElement(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), -1, flagPtr+uintptr(i))
		if bytesNeeded < 0 {
			XTcl_Panic(tls, ts+9405, libc.VaList(bp, 0x7fffffff))
		}
	}
	if bytesNeeded > 0x7fffffff-argc+1 {
		XTcl_Panic(tls, ts+9405, libc.VaList(bp+8, 0x7fffffff))
	}
	bytesNeeded = bytesNeeded + argc

	// Pass two: copy into the result area.

	result = XTcl_Alloc(tls, uint32(bytesNeeded))
	dst = result
	for i = 0; i < argc; i++ {
		*(*int8)(unsafe.Pointer(flagPtr + uintptr(i))) |= int8(func() int32 {
			if i != 0 {
				return TCL_DONT_QUOTE_HASH
			}
			return 0
		}())
		dst += uintptr(XTclConvertElement(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), -1, dst, int32(*(*int8)(unsafe.Pointer(flagPtr + uintptr(i))))))
		*(*int8)(unsafe.Pointer(dst)) = int8(' ')
		dst++
	}
	*(*int8)(unsafe.Pointer(dst + libc.UintptrFromInt32(-1))) = int8(0)

	if flagPtr != bp+16 {
		XTclpFree(tls, flagPtr)
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_Backslash --
//
//	Figure out how to handle a backslash sequence.
//
// Results:
//	The return value is the character that should be substituted in place
//	of the backslash sequence that starts at src. If readPtr isn't NULL
//	then it is filled in with a count of the number of characters in the
//	backslash sequence.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_Backslash(tls *libc.TLS, src uintptr, readPtr uintptr) int8 { /* tclUtil.c:1646:1: */
	bp := tls.Alloc(6)
	defer tls.Free(6)

	*(*[4]int8)(unsafe.Pointer(bp /* buf */)) = *(*[4]int8)(unsafe.Pointer(ts + 63623))
	*(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */)) = Tcl_UniChar(0)

	XTcl_UtfBackslash(tls, src, readPtr, bp)
	if int32(uint8(*(*int8)(unsafe.Pointer(bp)))) < 0x80 {
		*(*Tcl_UniChar)(unsafe.Pointer(bp + 4)) = Tcl_UniChar(uint8(*(*int8)(unsafe.Pointer(bp))))
	} else {
		XTcl_UtfToUniChar(tls, bp, bp+4)
	}
	return int8(*(*Tcl_UniChar)(unsafe.Pointer(bp + 4 /* ch */)))
}

//----------------------------------------------------------------------
//
// TclTrimRight --
//	Takes two counted strings in the Tcl encoding.  Conceptually
//	finds the sub string (offset) to trim from the right side of the
//	first string all characters found in the second string.
//
// Results:
//	The number of bytes to be removed from the end of the string.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclTrimRight(tls *libc.TLS, bytes uintptr, numBytes int32, trim uintptr, numTrim int32) int32 { /* tclUtil.c:1678:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var pp uintptr
	var p uintptr = bytes + uintptr(numBytes)
	// var ch1 int32 at bp, 4

	// var ch2 int32 at bp+4, 4

	// Empty strings -> nothing to do
	if numBytes == 0 || numTrim == 0 {
		return 0
	}

	// Outer loop: iterate over string to be trimmed.

	for ok := true; ok; ok = p > bytes {
		var q uintptr = trim
		var pInc int32 = 0
		var bytesLeft int32 = numTrim

		pp = func() uintptr {
			if p < bytes+uintptr(2) {
				return bytes
			}
			return func() uintptr {
				if int32(uint8(*(*int8)(unsafe.Pointer(p - uintptr(1))))) < 0x80 {
					return p - uintptr(1)
				}
				return XTcl_UtfPrev(tls, p, bytes)
			}()
		}()
		pp = func() uintptr {
			if pp < bytes+uintptr(2) {
				return bytes
			}
			return func() uintptr {
				if int32(uint8(*(*int8)(unsafe.Pointer(pp - uintptr(1))))) < 0x80 {
					return pp - uintptr(1)
				}
				return XTcl_UtfPrev(tls, pp, bytes)
			}()
		}()
		for ok1 := true; ok1; ok1 = pp+uintptr(pInc) < p {
			pp += uintptr(pInc)
			pInc = XTclUtfToUCS4(tls, pp, bp)
		}

		// Inner loop: scan trim string for match to current character.

		for ok2 := true; ok2; ok2 = bytesLeft != 0 {
			pInc = XTclUtfToUCS4(tls, q, bp+4)

			if *(*int32)(unsafe.Pointer(bp)) == *(*int32)(unsafe.Pointer(bp + 4)) {
				break
			}

			q += uintptr(pInc)
			bytesLeft = bytesLeft - pInc
		}

		if bytesLeft == 0 {
			// No match; trim task done; *p is last non-trimmed char.

			break
		}
		p = pp
	}

	return int32(int64(numBytes) - (int64(p)-int64(bytes))/1)
}

//----------------------------------------------------------------------
//
// TclTrimLeft --
//
//	Takes two counted strings in the Tcl encoding.  Conceptually
//	finds the sub string (offset) to trim from the left side of the
//	first string all characters found in the second string.
//
// Results:
//	The number of bytes to be removed from the start of the string.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclTrimLeft(tls *libc.TLS, bytes uintptr, numBytes int32, trim uintptr, numTrim int32) int32 { /* tclUtil.c:1760:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var p uintptr = bytes
	// var ch1 int32 at bp, 4

	// var ch2 int32 at bp+4, 4

	// Empty strings -> nothing to do
	if numBytes == 0 || numTrim == 0 {
		return 0
	}

	// Outer loop: iterate over string to be trimmed.

	for ok := true; ok; ok = numBytes > 0 {
		var pInc int32 = XTclUtfToUCS4(tls, p, bp)
		var q uintptr = trim
		var bytesLeft int32 = numTrim

		// Inner loop: scan trim string for match to current character.

		for ok1 := true; ok1; ok1 = bytesLeft != 0 {
			var qInc int32 = XTclUtfToUCS4(tls, q, bp+4)

			if *(*int32)(unsafe.Pointer(bp)) == *(*int32)(unsafe.Pointer(bp + 4)) {
				break
			}

			q += uintptr(qInc)
			bytesLeft = bytesLeft - qInc
		}

		if bytesLeft == 0 {
			// No match; trim task done; *p is first non-trimmed char.

			break
		}

		p += uintptr(pInc)
		numBytes = numBytes - pInc
	}

	return int32((int64(p) - int64(bytes)) / 1)
}

//----------------------------------------------------------------------
//
// TclTrim --
//	Finds the sub string (offset) to trim from both sides of the
//	first string all characters found in the second string.
//
// Results:
//	The number of bytes to be removed from the start of the string
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclTrim(tls *libc.TLS, bytes uintptr, numBytes int32, trim uintptr, numTrim int32, trimRightPtr uintptr) int32 { /* tclUtil.c:1834:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var trimLeft int32 = 0
	var trimRight int32 = 0

	// Empty strings -> nothing to do
	if numBytes > 0 && numTrim > 0 {

		// When bytes is NUL-terminated, returns 0 <= trimLeft <= numBytes
		trimLeft = XTclTrimLeft(tls, bytes, numBytes, trim, numTrim)
		numBytes = numBytes - trimLeft

		// If we did not trim the whole string, it starts with a character
		// that we will not trim. Skip over it.
		if numBytes > 0 {
			// var ch int32 at bp, 4

			var first uintptr = bytes + uintptr(trimLeft)
			bytes += uintptr(XTclUtfToUCS4(tls, first, bp))
			numBytes = int32(int64(numBytes) - (int64(bytes)-int64(first))/1)

			if numBytes > 0 {
				// When bytes is NUL-terminated, returns
				// 0 <= trimRight <= numBytes
				trimRight = XTclTrimRight(tls, bytes, numBytes, trim, numTrim)
			}
		}
	}
	*(*int32)(unsafe.Pointer(trimRightPtr)) = trimRight
	return trimLeft
}

//----------------------------------------------------------------------
//
// Tcl_Concat --
//
//	Concatenate a set of strings into a single large string.
//
// Results:
//	The return value is dynamically-allocated string containing a
//	concatenation of all the strings in argv, with spaces between the
//	original argv elements.
//
// Side effects:
//	Memory is allocated for the result; the caller is responsible for
//	freeing the memory.
//
//----------------------------------------------------------------------

// The whitespace characters trimmed during [concat] operations

func XTcl_Concat(tls *libc.TLS, argc int32, argv uintptr) uintptr { /* tclUtil.c:1895:6: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var i int32
	var needSpace int32 = 0
	var bytesNeeded int32 = 0
	var result uintptr
	var p uintptr

	// Dispose of the empty result corner case first to simplify later code.

	if argc == 0 {
		result = XTcl_Alloc(tls, uint32(1))
		*(*int8)(unsafe.Pointer(result)) = int8(0)
		return result
	}

	// First allocate the result buffer at the size required.

	for i = 0; i < argc; i++ {
		bytesNeeded = int32(Size_t(bytesNeeded) + libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
		if bytesNeeded < 0 {
			XTcl_Panic(tls, ts+71212, 0)
		}
	}
	if bytesNeeded+argc-1 < 0 {
		// Panic test could be tighter, but not going to bother for this
		// legacy routine.

		XTcl_Panic(tls, ts+71212, 0)
	}

	// All element bytes + (argc - 1) spaces + 1 terminating NULL.

	result = XTcl_Alloc(tls, uint32(bytesNeeded+argc))

	p = result
	i = 0
	for ; i < argc; i++ {
		var triml int32
		// var trimr int32 at bp, 4

		var elemLength int32
		var element uintptr

		element = *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))
		elemLength = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))

		// Trim away the leading/trailing whitespace.
		triml = XTclTrim(tls, element, elemLength, ts+71255,
			int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)), bp)
		element += uintptr(triml)
		elemLength = elemLength - (triml + *(*int32)(unsafe.Pointer(bp)))

		// Do not permit trimming to expose a final backslash character.
		elemLength = elemLength + libc.Bool32(*(*int32)(unsafe.Pointer(bp)) != 0 && int32(*(*int8)(unsafe.Pointer(element + uintptr(elemLength-1)))) == '\\')

		// If we're left with empty element after trimming, do nothing.

		if elemLength == 0 {
			continue
		}

		// Append to the result with space if needed.

		if needSpace != 0 {
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8(' ')
		}
		libc.Xmemcpy(tls, p, element, uint64(elemLength))
		p += uintptr(elemLength)
		needSpace = 1
	}
	*(*int8)(unsafe.Pointer(p)) = int8(0)
	return result
}

//----------------------------------------------------------------------
//
// Tcl_ConcatObj --
//
//	Concatenate the strings from a set of objects into a single string
//	object with spaces between the original strings.
//
// Results:
//	The return value is a new string object containing a concatenation of
//	the strings in objv. Its ref count is zero.
//
// Side effects:
//	A new object is created.
//
//----------------------------------------------------------------------

func XTcl_ConcatObj(tls *libc.TLS, objc int32, objv uintptr) uintptr { /* tclUtil.c:1995:9: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var i int32
	// var elemLength int32 at bp+16, 4

	var needSpace int32
	var bytesNeeded int32
	var element uintptr
	var objPtr uintptr
	var resPtr uintptr
	// var length int32 at bp, 4

	var _objPtr uintptr
	// var elemPtr uintptr at bp+8, 8

	var cachePtr uintptr
	var cachePtr1 uintptr
	var triml int32
	// var trimr int32 at bp+20, 4
	needSpace = 0
	bytesNeeded = 0

	// Check first to see if all the items are of list type or empty. If so,
	// we will concat them together as lists, and return a list object. This
	// is only valid when the lists are in canonical form.

	i = 0
__1:
	if !(i < objc) {
		goto __3
	}

	objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return libc.Bool32((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == uintptr(0) || (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32)))).FcanonicalFlag != 0)
		}
		return 0
	}() != 0) {
		goto __4
	}
	goto __2
__4:
	;
	XTcl_GetStringFromObj(tls, objPtr, bp)
	if !(*(*int32)(unsafe.Pointer(bp)) > 0) {
		goto __5
	}
	goto __3
__5:
	;
	goto __2
__2:
	i++
	goto __1
	goto __3
__3:
	;
	if !(i == objc) {
		goto __6
	}
	resPtr = uintptr(0)
	i = 0
__7:
	if !(i < objc) {
		goto __9
	}
	objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength == 0) {
		goto __10
	}
	goto __8
__10:
	;
	if !(resPtr != 0) {
		goto __11
	}
	*(*uintptr)(unsafe.Pointer(bp + 8 /* elemPtr */)) = uintptr(0)

	XTcl_ListObjIndex(tls, uintptr(0), objPtr, 0, bp+8)
	if !(*(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0)) {
		goto __13
	}
	goto __8
__13:
	;
	if !(int32(*(*int8)(unsafe.Pointer(XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))))) == '#' || TCL_OK !=
		XTcl_ListObjAppendList(tls, uintptr(0), resPtr, objPtr)) {
		goto __14
	}
	// Abandon ship!
__15:
	_objPtr = resPtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __18
	}
	XTclFreeObj(tls, _objPtr)
__18:
	;
	goto __16
__16:
	if 0 != 0 {
		goto __15
	}
	goto __17
__17:
	;
	goto slow
__14:
	;
	goto __12
__11:
	resPtr = XTclListObjCopy(tls, uintptr(0), objPtr)
__12:
	;
	goto __8
__8:
	i++
	goto __7
	goto __9
__9:
	;
	if !!(resPtr != 0) {
		goto __19
	}
__20:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __23
	}
	resPtr = XTclThreadAllocObj(tls)
	goto __24
__23:
	resPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__24:
	;
	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	(*Tcl_Obj)(unsafe.Pointer(resPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resPtr)).FtypePtr = uintptr(0)

__19:
	;
	return resPtr
__6:
	;

slow:
	// Something cannot be determined to be safe, so build the concatenation
	// the slow way, using the string representations.
	//
	// First try to pre-allocate the size required.

	i = 0
__25:
	if !(i < objc) {
		goto __27
	}
	element = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 16)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+16)
	}()
	bytesNeeded = bytesNeeded + *(*int32)(unsafe.Pointer(bp + 16))
	if !(bytesNeeded < 0) {
		goto __28
	}
	goto __27
__28:
	;
	goto __26
__26:
	i++
	goto __25
	goto __27
__27:
	;

	// Does not matter if this fails, will simply try later to build up the
	// string with each Append reallocating as needed with the usual string
	// append algorithm.  When that fails it will report the error.

__29:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0
	}()) {
		goto __32
	}
	resPtr = XTclThreadAllocObj(tls)
	goto __33
__32:
	resPtr = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resPtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects--
__33:
	;
	goto __30
__30:
	if 0 != 0 {
		goto __29
	}
	goto __31
__31:
	;
	(*Tcl_Obj)(unsafe.Pointer(resPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resPtr)).FtypePtr = uintptr(0)

	XTcl_AttemptSetObjLength(tls, resPtr, bytesNeeded+objc-1)
	XTcl_SetObjLength(tls, resPtr, 0)

	i = 0
__34:
	if !(i < objc) {
		goto __36
	}

	element = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 16)) = (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Flength
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+16)
	}()

	// Trim away the leading/trailing whitespace.
	triml = XTclTrim(tls, element, *(*int32)(unsafe.Pointer(bp + 16 /* elemLength */)), ts+71255,
		int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)), bp+20)
	element += uintptr(triml)
	*(*int32)(unsafe.Pointer(bp + 16 /* elemLength */)) -= triml + *(*int32)(unsafe.Pointer(bp + 20))

	// Do not permit trimming to expose a final backslash character.
	*(*int32)(unsafe.Pointer(bp + 16 /* elemLength */)) += libc.Bool32(*(*int32)(unsafe.Pointer(bp + 20)) != 0 && int32(*(*int8)(unsafe.Pointer(element + uintptr(*(*int32)(unsafe.Pointer(bp + 16))-1)))) == '\\')

	// If we're left with empty element after trimming, do nothing.

	if !(*(*int32)(unsafe.Pointer(bp + 16)) == 0) {
		goto __37
	}
	goto __35
__37:
	;

	// Append to the result with space if needed.

	if !(needSpace != 0) {
		goto __38
	}
	XTcl_AppendToObj(tls, resPtr, ts+14299, 1)
__38:
	;
	XTcl_AppendToObj(tls, resPtr, element, *(*int32)(unsafe.Pointer(bp + 16 /* elemLength */)))
	needSpace = 1
	goto __35
__35:
	i++
	goto __34
	goto __36
__36:
	;
	return resPtr
}

//----------------------------------------------------------------------
//
// Tcl_StringMatch --
//
//	See if a particular string matches a particular pattern.
//
// Results:
//	The return value is 1 if string matches pattern, and 0 otherwise. The
//	matching operation permits the following special characters in the
//	pattern: *?\[] (see the manual entry for details on what these mean).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_StringMatch(tls *libc.TLS, str uintptr, pattern uintptr) int32 { /* tclUtil.c:2132:1: */
	return XTcl_StringCaseMatch(tls, str, pattern, 0)
}

//----------------------------------------------------------------------
//
// Tcl_StringCaseMatch --
//
//	See if a particular string matches a particular pattern. Allows case
//	insensitivity.
//
// Results:
//	The return value is 1 if string matches pattern, and 0 otherwise. The
//	matching operation permits the following special characters in the
//	pattern: *?\[] (see the manual entry for details on what these mean).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_StringCaseMatch(tls *libc.TLS, str uintptr, pattern uintptr, nocase int32) int32 { /* tclUtil.c:2160:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var p int32
	var charLen int32
	*(*int32)(unsafe.Pointer(bp + 4 /* ch1 */)) = 0
	*(*int32)(unsafe.Pointer(bp /* ch2 */)) = 0

	for 1 != 0 {
		p = int32(*(*int8)(unsafe.Pointer(pattern)))

		// See if we're at the end of both the pattern and the string. If so,
		// we succeeded. If we're at the end of the pattern but not at the end
		// of the string, we failed.

		if p == 0 {
			return libc.Bool32(int32(*(*int8)(unsafe.Pointer(str))) == 0)
		}
		if int32(*(*int8)(unsafe.Pointer(str))) == 0 && p != '*' {
			return 0
		}

		// Check for a "*" as the next pattern character. It matches any
		// substring. We handle this by calling ourselves recursively for each
		// postfix of string, until either we match or we reach the end of the
		// string.

		if p == '*' {
			// Skip all successive *'s in the pattern

			for int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&pattern, 1)))) == '*' {
			}
			p = int32(*(*int8)(unsafe.Pointer(pattern)))
			if p == 0 {
				return 1
			}

			// This is a special case optimization for single-byte utf.

			if int32(uint8(*(*int8)(unsafe.Pointer(pattern)))) < 0x80 {
				*(*int32)(unsafe.Pointer(bp /* ch2 */)) = func() int32 {
					if nocase != 0 {
						return libc.Xtolower(tls, int32(uint8(*(*int8)(unsafe.Pointer(pattern)))))
					}
					return int32(uint8(*(*int8)(unsafe.Pointer(pattern))))
				}()
			} else {
				XTclUtfToUCS4(tls, pattern, bp)
				if nocase != 0 {
					*(*int32)(unsafe.Pointer(bp /* ch2 */)) = XTclUCS4ToLower(tls, *(*int32)(unsafe.Pointer(bp /* ch2 */)))
				}
			}

			for 1 != 0 {
				// Optimization for matching - cruise through the string
				// quickly if the next char in the pattern isn't a special
				// character

				if p != '[' && p != '?' && p != '\\' {
					if nocase != 0 {
						for *(*int8)(unsafe.Pointer(str)) != 0 {
							charLen = XTclUtfToUCS4(tls, str, bp+4)
							if *(*int32)(unsafe.Pointer(bp)) == *(*int32)(unsafe.Pointer(bp + 4)) || *(*int32)(unsafe.Pointer(bp)) == XTclUCS4ToLower(tls, *(*int32)(unsafe.Pointer(bp + 4))) {
								break
							}
							str += uintptr(charLen)
						}
					} else {
						// There's no point in trying to make this code
						// shorter, as the number of bytes you want to compare
						// each time is non-constant.

						for *(*int8)(unsafe.Pointer(str)) != 0 {
							charLen = XTclUtfToUCS4(tls, str, bp+4)
							if *(*int32)(unsafe.Pointer(bp)) == *(*int32)(unsafe.Pointer(bp + 4)) {
								break
							}
							str += uintptr(charLen)
						}
					}
				}
				if XTcl_StringCaseMatch(tls, str, pattern, nocase) != 0 {
					return 1
				}
				if int32(*(*int8)(unsafe.Pointer(str))) == 0 {
					return 0
				}
				str += uintptr(XTclUtfToUCS4(tls, str, bp+4))
			}
		}

		// Check for a "?" as the next pattern character. It matches any
		// single character.

		if p == '?' {
			pattern++
			str += uintptr(XTclUtfToUCS4(tls, str, bp+4))
			continue
		}

		// Check for a "[" as the next pattern character. It is followed by a
		// list of characters that are acceptable, or by a range (two
		// characters separated by "-").

		if p == '[' {
			*(*int32)(unsafe.Pointer(bp + 8 /* startChar */)) = 0
			*(*int32)(unsafe.Pointer(bp + 12 /* endChar */)) = 0

			pattern++
			if int32(uint8(*(*int8)(unsafe.Pointer(str)))) < 0x80 {
				*(*int32)(unsafe.Pointer(bp + 4 /* ch1 */)) = func() int32 {
					if nocase != 0 {
						return libc.Xtolower(tls, int32(uint8(*(*int8)(unsafe.Pointer(str)))))
					}
					return int32(uint8(*(*int8)(unsafe.Pointer(str))))
				}()
				str++
			} else {
				str += uintptr(XTclUtfToUCS4(tls, str, bp+4))
				if nocase != 0 {
					*(*int32)(unsafe.Pointer(bp + 4 /* ch1 */)) = XTclUCS4ToLower(tls, *(*int32)(unsafe.Pointer(bp + 4 /* ch1 */)))
				}
			}
			for 1 != 0 {
				if int32(*(*int8)(unsafe.Pointer(pattern))) == ']' || int32(*(*int8)(unsafe.Pointer(pattern))) == 0 {
					return 0
				}
				if int32(uint8(*(*int8)(unsafe.Pointer(pattern)))) < 0x80 {
					*(*int32)(unsafe.Pointer(bp + 8 /* startChar */)) = func() int32 {
						if nocase != 0 {
							return libc.Xtolower(tls, int32(uint8(*(*int8)(unsafe.Pointer(pattern)))))
						}
						return int32(uint8(*(*int8)(unsafe.Pointer(pattern))))
					}()
					pattern++
				} else {
					pattern += uintptr(XTclUtfToUCS4(tls, pattern, bp+8))
					if nocase != 0 {
						*(*int32)(unsafe.Pointer(bp + 8 /* startChar */)) = XTclUCS4ToLower(tls, *(*int32)(unsafe.Pointer(bp + 8 /* startChar */)))
					}
				}
				if int32(*(*int8)(unsafe.Pointer(pattern))) == '-' {
					pattern++
					if int32(*(*int8)(unsafe.Pointer(pattern))) == 0 {
						return 0
					}
					if int32(uint8(*(*int8)(unsafe.Pointer(pattern)))) < 0x80 {
						*(*int32)(unsafe.Pointer(bp + 12 /* endChar */)) = func() int32 {
							if nocase != 0 {
								return libc.Xtolower(tls, int32(uint8(*(*int8)(unsafe.Pointer(pattern)))))
							}
							return int32(uint8(*(*int8)(unsafe.Pointer(pattern))))
						}()
						pattern++
					} else {
						pattern += uintptr(XTclUtfToUCS4(tls, pattern, bp+12))
						if nocase != 0 {
							*(*int32)(unsafe.Pointer(bp + 12 /* endChar */)) = XTclUCS4ToLower(tls, *(*int32)(unsafe.Pointer(bp + 12 /* endChar */)))
						}
					}
					if *(*int32)(unsafe.Pointer(bp + 8)) <= *(*int32)(unsafe.Pointer(bp + 4)) && *(*int32)(unsafe.Pointer(bp + 4)) <= *(*int32)(unsafe.Pointer(bp + 12)) ||
						*(*int32)(unsafe.Pointer(bp + 12)) <= *(*int32)(unsafe.Pointer(bp + 4)) && *(*int32)(unsafe.Pointer(bp + 4)) <= *(*int32)(unsafe.Pointer(bp + 8)) {
						// Matches ranges of form [a-z] or [z-a].

						break
					}
				} else if *(*int32)(unsafe.Pointer(bp + 8)) == *(*int32)(unsafe.Pointer(bp + 4)) {
					break
				}
			}
			// If we reach here, we matched. Need to move past closing ]
			for int32(*(*int8)(unsafe.Pointer(pattern))) != ']' {
				if int32(*(*int8)(unsafe.Pointer(pattern))) == 0 {
					// We ran out of pattern after matching something in
					// (unclosed!) brackets. So long as we ran out of string
					// at the same time, we have a match. Otherwise, not.
					return libc.Bool32(int32(*(*int8)(unsafe.Pointer(str))) == 0)
				}
				pattern++
			}
			pattern++
			continue
		}

		// If the next pattern character is '\', just strip off the '\' so we
		// do exact matching on the character that follows.

		if p == '\\' {
			pattern++
			if int32(*(*int8)(unsafe.Pointer(pattern))) == 0 {
				return 0
			}
		}

		// There's no special character. Just make sure that the next bytes of
		// each string match.

		str += uintptr(XTclUtfToUCS4(tls, str, bp+4))
		pattern += uintptr(XTclUtfToUCS4(tls, pattern, bp))
		if nocase != 0 {
			if XTclUCS4ToLower(tls, *(*int32)(unsafe.Pointer(bp + 4))) != XTclUCS4ToLower(tls, *(*int32)(unsafe.Pointer(bp))) {
				return 0
			}
		} else if *(*int32)(unsafe.Pointer(bp + 4)) != *(*int32)(unsafe.Pointer(bp)) {
			return 0
		}
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// TclByteArrayMatch --
//
//	See if a particular string matches a particular pattern.  Does not
//	allow for case insensitivity.
//	Parallels tclUtf.c:TclUniCharMatch, adjusted for char* and sans nocase.
//
// Results:
//	The return value is 1 if string matches pattern, and 0 otherwise. The
//	matching operation permits the following special characters in the
//	pattern: *?\[] (see the manual entry for details on what these mean).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclByteArrayMatch(tls *libc.TLS, string uintptr, strLen int32, pattern uintptr, ptnLen int32, flags int32) int32 { /* tclUtil.c:2395:1: */
	var stringEnd uintptr
	var patternEnd uintptr
	var p uint8

	stringEnd = string + uintptr(strLen)
	patternEnd = pattern + uintptr(ptnLen)

	for 1 != 0 {
		// See if we're at the end of both the pattern and the string. If so,
		// we succeeded. If we're at the end of the pattern but not at the end
		// of the string, we failed.

		if pattern == patternEnd {
			return libc.Bool32(string == stringEnd)
		}
		p = *(*uint8)(unsafe.Pointer(pattern))
		if string == stringEnd && int32(p) != '*' {
			return 0
		}

		// Check for a "*" as the next pattern character. It matches any
		// substring. We handle this by skipping all the characters up to the
		// next matching one in the pattern, and then calling ourselves
		// recursively for each postfix of string, until either we match or we
		// reach the end of the string.

		if int32(p) == '*' {
			// Skip all successive *'s in the pattern.

			for libc.PreIncUintptr(&pattern, 1) < patternEnd && int32(*(*uint8)(unsafe.Pointer(pattern))) == '*' {
				// empty body
			}
			if pattern == patternEnd {
				return 1
			}
			p = *(*uint8)(unsafe.Pointer(pattern))
			for 1 != 0 {
				// Optimization for matching - cruise through the string
				// quickly if the next char in the pattern isn't a special
				// character.

				if int32(p) != '[' && int32(p) != '?' && int32(p) != '\\' {
					for string < stringEnd && int32(p) != int32(*(*uint8)(unsafe.Pointer(string))) {
						string++
					}
				}
				if XTclByteArrayMatch(tls, string, int32((int64(stringEnd)-int64(string))/1),
					pattern, int32((int64(patternEnd)-int64(pattern))/1), 0) != 0 {
					return 1
				}
				if string == stringEnd {
					return 0
				}
				string++
			}
		}

		// Check for a "?" as the next pattern character. It matches any
		// single character.

		if int32(p) == '?' {
			pattern++
			string++
			continue
		}

		// Check for a "[" as the next pattern character. It is followed by a
		// list of characters that are acceptable, or by a range (two
		// characters separated by "-").

		if int32(p) == '[' {
			var ch1 uint8
			var startChar uint8
			var endChar uint8

			pattern++
			ch1 = *(*uint8)(unsafe.Pointer(string))
			string++
			for 1 != 0 {
				if int32(*(*uint8)(unsafe.Pointer(pattern))) == ']' || pattern == patternEnd {
					return 0
				}
				startChar = *(*uint8)(unsafe.Pointer(pattern))
				pattern++
				if int32(*(*uint8)(unsafe.Pointer(pattern))) == '-' {
					pattern++
					if pattern == patternEnd {
						return 0
					}
					endChar = *(*uint8)(unsafe.Pointer(pattern))
					pattern++
					if int32(startChar) <= int32(ch1) && int32(ch1) <= int32(endChar) ||
						int32(endChar) <= int32(ch1) && int32(ch1) <= int32(startChar) {
						// Matches ranges of form [a-z] or [z-a].

						break
					}
				} else if int32(startChar) == int32(ch1) {
					break
				}
			}
			for int32(*(*uint8)(unsafe.Pointer(pattern))) != ']' {
				if pattern == patternEnd {
					pattern--
					break
				}
				pattern++
			}
			pattern++
			continue
		}

		// If the next pattern character is '\', just strip off the '\' so we
		// do exact matching on the character that follows.

		if int32(p) == '\\' {
			if libc.PreIncUintptr(&pattern, 1) == patternEnd {
				return 0
			}
		}

		// There's no special character. Just make sure that the next bytes of
		// each string match.

		if int32(*(*uint8)(unsafe.Pointer(string))) != int32(*(*uint8)(unsafe.Pointer(pattern))) {
			return 0
		}
		string++
		pattern++
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// TclStringMatchObj --
//
//	See if a particular string matches a particular pattern. Allows case
//	insensitivity. This is the generic multi-type handler for the various
//	matching algorithms.
//
// Results:
//	The return value is 1 if string matches pattern, and 0 otherwise. The
//	matching operation permits the following special characters in the
//	pattern: *?\[] (see the manual entry for details on what these mean).
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclStringMatchObj(tls *libc.TLS, strObj uintptr, ptnObj uintptr, flags int32) int32 { /* tclUtil.c:2572:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var match int32
	// var length int32 at bp, 4

	// var plen int32 at bp+4, 4

	//
	//  Promote based on the type of incoming object.
	//  XXX: Currently doesn't take advantage of exact-ness that
	//  XXX: TclReToGlob tells us about
	//     trivial = nocase ? 0 : TclMatchIsTrivial(TclGetString(ptnObj));
	//

	if (*Tcl_Obj)(unsafe.Pointer(strObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclStringType)) || (*Tcl_Obj)(unsafe.Pointer(strObj)).FtypePtr == uintptr(0) {
		var udata uintptr
		var uptn uintptr

		udata = XTcl_GetUnicodeFromObj(tls, strObj, bp)
		uptn = XTcl_GetUnicodeFromObj(tls, ptnObj, bp+4)
		match = XTclUniCharMatch(tls, udata, *(*int32)(unsafe.Pointer(bp /* length */)), uptn, *(*int32)(unsafe.Pointer(bp + 4 /* plen */)), flags)
	} else if (*Tcl_Obj)(unsafe.Pointer(strObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(strObj)).Fbytes == uintptr(0) && ((*Tcl_Obj)(unsafe.Pointer(ptnObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteArrayType)) && (*Tcl_Obj)(unsafe.Pointer(ptnObj)).Fbytes == uintptr(0)) &&
		!(flags != 0) {
		var data uintptr
		var ptn uintptr

		data = XTcl_GetByteArrayFromObj(tls, strObj, bp)
		ptn = XTcl_GetByteArrayFromObj(tls, ptnObj, bp+4)
		match = XTclByteArrayMatch(tls, data, *(*int32)(unsafe.Pointer(bp /* length */)), ptn, *(*int32)(unsafe.Pointer(bp + 4 /* plen */)), 0)
	} else {
		match = XTcl_StringCaseMatch(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(strObj)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(strObj)).Fbytes
			}
			return XTcl_GetString(tls, strObj)
		}(),
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(ptnObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(ptnObj)).Fbytes
				}
				return XTcl_GetString(tls, ptnObj)
			}(), flags)
	}
	return match
}

//----------------------------------------------------------------------
//
// Tcl_DStringInit --
//
//	Initializes a dynamic string, discarding any previous contents of the
//	string (Tcl_DStringFree should have been called already if the dynamic
//	string was previously in use).
//
// Results:
//	None.
//
// Side effects:
//	The dynamic string is initialized to be empty.
//
//----------------------------------------------------------------------

func XTcl_DStringInit(tls *libc.TLS, dsPtr uintptr) { /* tclUtil.c:2626:1: */
	(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = dsPtr + 16 /* &.staticSpace */
	(*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength = 0
	(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = TCL_DSTRING_STATIC_SIZE
	*(*int8)(unsafe.Pointer(dsPtr + 16)) = int8(0)
}

//----------------------------------------------------------------------
//
// Tcl_DStringAppend --
//
//	Append more bytes to the current value of a dynamic string.
//
// Results:
//	The return value is a pointer to the dynamic string's new value.
//
// Side effects:
//	Length bytes from "bytes" (or all of "bytes" if length is less than
//	zero) are added to the current value of the string. Memory gets
//	reallocated if needed to accomodate the string's new size.
//
//----------------------------------------------------------------------

func XTcl_DStringAppend(tls *libc.TLS, dsPtr uintptr, bytes uintptr, length int32) uintptr { /* tclUtil.c:2653:6: */
	var newSize int32

	if length < 0 {
		length = int32(libc.Xstrlen(tls, bytes))
	}
	newSize = length + (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength

	// Allocate a larger buffer for the string if the current one isn't large
	// enough. Allocate extra space in the new buffer so that there will be
	// room to grow before we have to allocate again.

	if newSize >= (*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl {
		(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = newSize * 2
		if (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring == dsPtr+16 {
			var newString uintptr = XTcl_Alloc(tls, uint32((*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl))

			libc.Xmemcpy(tls, newString, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, uint64((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength))
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = newString
		} else {
			var offset int32 = -1

			// See [16896d49fd]
			if bytes >= (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring &&
				bytes <= (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring+uintptr((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength) {
				offset = int32((int64(bytes) - int64((*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring)) / 1)
			}

			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = XTcl_Realloc(tls, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, uint32((*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl))

			if offset >= 0 {
				bytes = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring + uintptr(offset)
			}
		}
	}

	// Copy the new string into the buffer at the end of the old one.

	libc.Xmemcpy(tls, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring+uintptr((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength), bytes, uint64(length))
	*(*int32)(unsafe.Pointer(dsPtr + 8)) += length
	*(*int8)(unsafe.Pointer((*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring + uintptr((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength))) = int8(0)
	return (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring
}

//----------------------------------------------------------------------
//
// TclDStringAppendObj, TclDStringAppendDString --
//
//	Simple wrappers round Tcl_DStringAppend that make it easier to append
//	from particular sources of strings.
//
//----------------------------------------------------------------------

func XTclDStringAppendObj(tls *libc.TLS, dsPtr uintptr, objPtr uintptr) uintptr { /* tclUtil.c:2720:6: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var length int32 at bp, 4

	var bytes uintptr = XTcl_GetStringFromObj(tls, objPtr, bp)

	return XTcl_DStringAppend(tls, dsPtr, bytes, *(*int32)(unsafe.Pointer(bp /* length */)))
}

func XTclDStringAppendDString(tls *libc.TLS, dsPtr uintptr, toAppendPtr uintptr) uintptr { /* tclUtil.c:2731:6: */
	return XTcl_DStringAppend(tls, dsPtr, (*Tcl_DString)(unsafe.Pointer(toAppendPtr)).Fstring,
		(*Tcl_DString)(unsafe.Pointer(toAppendPtr)).Flength)
}

//----------------------------------------------------------------------
//
// Tcl_DStringAppendElement --
//
//	Append a list element to the current value of a dynamic string.
//
// Results:
//	The return value is a pointer to the dynamic string's new value.
//
// Side effects:
//	String is reformatted as a list element and added to the current value
//	of the string. Memory gets reallocated if needed to accomodate the
//	string's new size.
//
//----------------------------------------------------------------------

func XTcl_DStringAppendElement(tls *libc.TLS, dsPtr uintptr, element uintptr) uintptr { /* tclUtil.c:2758:6: */
	bp := tls.Alloc(1)
	defer tls.Free(1)

	var dst uintptr = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring + uintptr((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength)
	var needSpace int32 = XTclNeedSpace(tls, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, dst)
	*(*int8)(unsafe.Pointer(bp /* flags */)) = int8(0)
	var quoteHash int32 = 1
	var newSize int32

	if needSpace != 0 {
		// If we need a space to separate the new element from something
		// already ending the string, we're not appending the first element
		// of any list, so we need not quote any leading hash character.
		quoteHash = 0
	} else {
		// We don't need a space, maybe because there's some already there.
		// Checking whether we might be appending a first element is a bit
		// more involved.
		//
		// Backtrack over all whitespace.
		for libc.PreDecUintptr(&dst, 1) >= (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring && func() int32 {
			if int32(*(*int8)(unsafe.Pointer(dst))) > 0x20 {
				return 0
			}
			return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(dst))))
		}() != 0 {
		}

		// Call again without whitespace to confound things.
		quoteHash = libc.BoolInt32(!(XTclNeedSpace(tls, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, dst+uintptr(1)) != 0))
	}
	if !(quoteHash != 0) {
		*(*int8)(unsafe.Pointer(bp /* flags */)) |= int8(TCL_DONT_QUOTE_HASH)
	}
	newSize = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength + needSpace + XTclScanElement(tls, element, -1, bp)
	if !(quoteHash != 0) {
		*(*int8)(unsafe.Pointer(bp /* flags */)) |= int8(TCL_DONT_QUOTE_HASH)
	}

	// Allocate a larger buffer for the string if the current one isn't large
	// enough. Allocate extra space in the new buffer so that there will be
	// room to grow before we have to allocate again. SPECIAL NOTE: must use
	// memcpy, not strcpy, to copy the string to a larger buffer, since there
	// may be embedded NULLs in the string in some cases.

	if newSize >= (*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl {
		(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = newSize * 2
		if (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring == dsPtr+16 {
			var newString uintptr = XTcl_Alloc(tls, uint32((*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl))

			libc.Xmemcpy(tls, newString, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, uint64((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength))
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = newString
		} else {
			var offset int32 = -1

			// See [16896d49fd]
			if element >= (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring &&
				element <= (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring+uintptr((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength) {
				offset = int32((int64(element) - int64((*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring)) / 1)
			}

			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = XTcl_Realloc(tls, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, uint32((*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl))

			if offset >= 0 {
				element = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring + uintptr(offset)
			}
		}
	}
	dst = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring + uintptr((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength)

	// Convert the new string to a list element and copy it into the buffer at
	// the end, with a space, if needed.

	if needSpace != 0 {
		*(*int8)(unsafe.Pointer(dst)) = int8(' ')
		dst++
		(*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength++
	}

	*(*int32)(unsafe.Pointer(dsPtr + 8)) += XTclConvertElement(tls, element, -1, dst, int32(*(*int8)(unsafe.Pointer(bp))))
	*(*int8)(unsafe.Pointer((*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring + uintptr((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength))) = int8(0)
	return (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring
}

//----------------------------------------------------------------------
//
// Tcl_DStringSetLength --
//
//	Change the length of a dynamic string. This can cause the string to
//	either grow or shrink, depending on the value of length.
//
// Results:
//	None.
//
// Side effects:
//	The length of dsPtr is changed to length and a null byte is stored at
//	that position in the string. If length is larger than the space
//	allocated for dsPtr, then a panic occurs.
//
//----------------------------------------------------------------------

func XTcl_DStringSetLength(tls *libc.TLS, dsPtr uintptr, length int32) { /* tclUtil.c:2867:1: */
	var newsize int32

	if length < 0 {
		length = 0
	}
	if length >= (*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl {
		// There are two interesting cases here. In the first case, the user
		// may be trying to allocate a large buffer of a specific size. It
		// would be wasteful to overallocate that buffer, so we just allocate
		// enough for the requested size plus the trailing null byte. In the
		// second case, we are growing the buffer incrementally, so we need
		// behavior similar to Tcl_DStringAppend. The requested length will
		// usually be a small delta above the current spaceAvl, so we'll end
		// up doubling the old size. This won't grow the buffer quite as
		// quickly, but it should be close enough.

		newsize = (*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl * 2
		if length < newsize {
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = newsize
		} else {
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = length + 1
		}
		if (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring == dsPtr+16 {
			var newString uintptr = XTcl_Alloc(tls, uint32((*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl))

			libc.Xmemcpy(tls, newString, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, uint64((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength))
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = newString
		} else {
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = XTcl_Realloc(tls, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, uint32((*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl))
		}
	}
	(*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength = length
	*(*int8)(unsafe.Pointer((*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring + uintptr(length))) = int8(0)
}

//----------------------------------------------------------------------
//
// Tcl_DStringFree --
//
//	Frees up any memory allocated for the dynamic string and reinitializes
//	the string to an empty state.
//
// Results:
//	None.
//
// Side effects:
//	The previous contents of the dynamic string are lost, and the new
//	value is an empty string.
//
//----------------------------------------------------------------------

func XTcl_DStringFree(tls *libc.TLS, dsPtr uintptr) { /* tclUtil.c:2927:1: */
	if (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring != dsPtr+16 {
		XTclpFree(tls, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring)
	}
	(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = dsPtr + 16 /* &.staticSpace */
	(*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength = 0
	(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = TCL_DSTRING_STATIC_SIZE
	*(*int8)(unsafe.Pointer(dsPtr + 16)) = int8(0)
}

//----------------------------------------------------------------------
//
// Tcl_DStringResult --
//
//	This function moves the value of a dynamic string into an interpreter
//	as its string result. Afterwards, the dynamic string is reset to an
//	empty string.
//
// Results:
//	None.
//
// Side effects:
//	The string is "moved" to interp's result, and any existing string
//	result for interp is freed. dsPtr is reinitialized to an empty string.
//
//----------------------------------------------------------------------

func XTcl_DStringResult(tls *libc.TLS, interp uintptr, dsPtr uintptr) { /* tclUtil.c:2959:1: */
	XTcl_ResetResult(tls, interp)
	XTcl_SetObjResult(tls, interp, XTclDStringToObj(tls, dsPtr))
}

//----------------------------------------------------------------------
//
// Tcl_DStringGetResult --
//
//	This function moves an interpreter's result into a dynamic string.
//
// Results:
//	None.
//
// Side effects:
//	The interpreter's string result is cleared, and the previous contents
//	of dsPtr are freed.
//
//	If the string result is empty, the object result is moved to the
//	string result, then the object result is reset.
//
//----------------------------------------------------------------------

func XTcl_DStringGetResult(tls *libc.TLS, interp uintptr, dsPtr uintptr) { /* tclUtil.c:2989:1: */
	var iPtr uintptr = interp

	if (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring != dsPtr+16 {
		XTclpFree(tls, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring)
	}

	//
	//  Do more efficient transfer when we know the result is a Tcl_Obj. When
	//  there's no string result, we only have to deal with two cases:
	//
	//   1. When the string rep is the empty string, when we don't copy but
	//      instead use the staticSpace in the DString to hold an empty string.
	//
	//      *  2. When the string rep is not there or there's a real string rep, when
	//      *     we use Tcl_GetString to fetch (or generate) the string rep - which
	//      *     we know to have been allocated with ckalloc() - and use it to
	//      *     populate the DString space. Then, we free the internal rep. and set
	//      *     the object's string representation back to the canonical empty
	//      *     string.
	//

	if !(int32(*(*int8)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).Fresult))) != 0) && (*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr != 0 &&
		!((*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).FrefCount > 1) {
		if (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).Fbytes == XtclEmptyStringRep {
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = dsPtr + 16 /* &.staticSpace */
			*(*int8)(unsafe.Pointer((*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring)) = int8(0)
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength = 0
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = TCL_DSTRING_STATIC_SIZE
		} else {
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).Fbytes
				}
				return XTcl_GetString(tls, (*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)
			}()
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength = (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).Flength
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength + 1
			if (*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).FtypePtr != uintptr(0) {
				if (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0) {
					(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)
				}
				(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).FtypePtr = uintptr(0)
			}

			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FobjResultPtr)).Flength = 0
		}
		return
	}

	// If the string result is empty, move the object result to the string
	// result, then reset the object result.

	XTcl_GetStringResult(tls, interp)

	(*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength = int32(libc.Xstrlen(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult))
	if (*Interp)(unsafe.Pointer(iPtr)).FfreeProc != uintptr(0) {
		if (*Interp)(unsafe.Pointer(iPtr)).FfreeProc == uintptr(3) {
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = (*Interp)(unsafe.Pointer(iPtr)).Fresult
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength + 1
		} else {
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = XTcl_Alloc(tls, uint32((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength+1))
			libc.Xmemcpy(tls, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, (*Interp)(unsafe.Pointer(iPtr)).Fresult, uint64((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength+1))
			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Interp)(unsafe.Pointer(iPtr)).FfreeProc})).f(tls, (*Interp)(unsafe.Pointer(iPtr)).Fresult)
		}
		(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength + 1
		(*Interp)(unsafe.Pointer(iPtr)).FfreeProc = uintptr(0)
	} else {
		if (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength < TCL_DSTRING_STATIC_SIZE {
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = dsPtr + 16 /* &.staticSpace */
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = TCL_DSTRING_STATIC_SIZE
		} else {
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = XTcl_Alloc(tls, uint32((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength+1))
			(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength + 1
		}
		libc.Xmemcpy(tls, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, (*Interp)(unsafe.Pointer(iPtr)).Fresult, uint64((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength+1))
	}

	(*Interp)(unsafe.Pointer(iPtr)).Fresult = iPtr + 472 /* &.resultSpace */
	*(*int8)(unsafe.Pointer(iPtr + 472)) = int8(0)
}

//----------------------------------------------------------------------
//
// TclDStringToObj --
//
//	This function moves a dynamic string's contents to a new Tcl_Obj. Be
//	aware that this function does *not* check that the encoding of the
//	contents of the dynamic string is correct; this is the caller's
//	responsibility to enforce.
//
// Results:
//	The newly-allocated untyped (i.e., typePtr==NULL) Tcl_Obj with a
//	reference count of zero.
//
// Side effects:
//	The string is "moved" to the object. dsPtr is reinitialized to an
//	empty string; it does not need to be Tcl_DStringFree'd after this if
//	not used further.
//
//----------------------------------------------------------------------

func XTclDStringToObj(tls *libc.TLS, dsPtr uintptr) uintptr { /* tclUtil.c:3089:9: */
	var result uintptr

	if (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring == dsPtr+16 {
		if (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength == 0 {
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					result = XTclThreadAllocObj(tls)
				} else {
					result = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(result + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(result)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(result)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(result)).Flength = 0
			(*Tcl_Obj)(unsafe.Pointer(result)).FtypePtr = uintptr(0)
			{
			}

		} else {
			// Static buffer, so must copy.

			for ok1 := true; ok1; ok1 = 0 != 0 {
				for ok2 := true; ok2; ok2 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
					}() {
						result = XTclThreadAllocObj(tls)
					} else {
						result = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(result + 32))
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
					}
				}
				(*Tcl_Obj)(unsafe.Pointer(result)).FrefCount = 0
				if (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength == 0 {
					(*Tcl_Obj)(unsafe.Pointer(result)).Fbytes = XtclEmptyStringRep
					(*Tcl_Obj)(unsafe.Pointer(result)).Flength = 0
				} else {
					(*Tcl_Obj)(unsafe.Pointer(result)).Fbytes = XTcl_Alloc(tls, uint32((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength+1))
					libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(result)).Fbytes, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, uint64((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength))
					*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(result)).Fbytes + uintptr((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength))) = int8(0)
					(*Tcl_Obj)(unsafe.Pointer(result)).Flength = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength
				}
				(*Tcl_Obj)(unsafe.Pointer(result)).FtypePtr = uintptr(0)
				{
				}
			}
		}
	} else {
		// Dynamic buffer, so transfer ownership and reset.

		for ok3 := true; ok3; ok3 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				result = XTclThreadAllocObj(tls)
			} else {
				result = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(result + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(result)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(result)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(result)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(result)).FtypePtr = uintptr(0)
		{
		}

		(*Tcl_Obj)(unsafe.Pointer(result)).Fbytes = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring
		(*Tcl_Obj)(unsafe.Pointer(result)).Flength = (*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength
	}

	// Re-establish the DString as empty with no buffer allocated.

	(*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring = dsPtr + 16 /* &.staticSpace */
	(*Tcl_DString)(unsafe.Pointer(dsPtr)).FspaceAvl = TCL_DSTRING_STATIC_SIZE
	(*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength = 0
	*(*int8)(unsafe.Pointer(dsPtr + 16)) = int8(0)

	return result
}

//----------------------------------------------------------------------
//
// Tcl_DStringStartSublist --
//
//	This function adds the necessary information to a dynamic string
//	(e.g. " {") to start a sublist. Future element appends will be in the
//	sublist rather than the main list.
//
// Results:
//	None.
//
// Side effects:
//	Characters get added to the dynamic string.
//
//----------------------------------------------------------------------

func XTcl_DStringStartSublist(tls *libc.TLS, dsPtr uintptr) { /* tclUtil.c:3146:1: */
	if XTclNeedSpace(tls, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring+uintptr((*Tcl_DString)(unsafe.Pointer(dsPtr)).Flength)) != 0 {
		XTcl_DStringAppend(tls, dsPtr, ts+71262, int32(uint64(unsafe.Sizeof([3]int8{}))-uint64(1)))
	} else {
		XTcl_DStringAppend(tls, dsPtr, ts+71265, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
	}
}

//----------------------------------------------------------------------
//
// Tcl_DStringEndSublist --
//
//	This function adds the necessary characters to a dynamic string to end
//	a sublist (e.g. "}"). Future element appends will be in the enclosing
//	(sub)list rather than the current sublist.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_DStringEndSublist(tls *libc.TLS, dsPtr uintptr) { /* tclUtil.c:3175:1: */
	XTcl_DStringAppend(tls, dsPtr, ts+327, int32(uint64(unsafe.Sizeof([2]int8{}))-uint64(1)))
}

//----------------------------------------------------------------------
//
// Tcl_PrintDouble --
//
//	Given a floating-point value, this function converts it to an ASCII
//	string using.
//
// Results:
//	The ASCII equivalent of "value" is written at "dst". It is written
//	using the current precision, and it is guaranteed to contain a decimal
//	point or exponent, so that it looks like a floating-point value and
//	not an integer.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_PrintDouble(tls *libc.TLS, interp uintptr, value float64, dst uintptr) { /* tclUtil.c:3202:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var p uintptr
	var c int8
	// var exponent int32 at bp+16, 4

	// var signum int32 at bp+20, 4

	var digits uintptr
	// var end uintptr at bp+24, 8

	var precisionPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&precisionKey)), int32(unsafe.Sizeof(int32(0))))

	// Handle NaN.

	if libc.X__builtin_isnan(tls, value) != 0 {
		XTclFormatNaN(tls, value, dst)
		return
	}

	// Handle infinities.

	if value > 1.79769313486231570814527423731704357e+308 || value < -1.79769313486231570814527423731704357e+308 {
		// Remember to copy the terminating NUL too.

		if value < float64(0) {
			libc.Xmemcpy(tls, dst, ts+71267, uint64(5))
		} else {
			libc.Xmemcpy(tls, dst, ts+71272, uint64(4))
		}
		return
	}

	// Ordinary (normal and denormal) values.

	if *(*int32)(unsafe.Pointer(precisionPtr)) == 0 {
		digits = XTclDoubleDigits(tls, value, -1, TCL_DD_SHORTEST,
			bp+16, bp+20, bp+24)
	} else {
		// There are at least two possible interpretations for tcl_precision.
		//
		// The first is, "choose the decimal representation having
		// $tcl_precision digits of significance that is nearest to the given
		// number, breaking ties by rounding to even, and then trimming
		// trailing zeros." This gives the greatest possible precision in the
		// decimal string, but offers the anomaly that [expr 0.1] will be
		// "0.10000000000000001".
		//
		// The second is "choose the decimal representation having at most
		// $tcl_precision digits of significance that is nearest to the given
		// number. If no such representation converts exactly to the given
		// number, choose the one that is closest, breaking ties by rounding
		// to even. If more than one such representation converts exactly to
		// the given number, choose the shortest, breaking ties in favour of
		// the nearest, breaking remaining ties in favour of the one ending in
		// an even digit."
		//
		// Tcl 8.4 implements the first of these, which gives rise to
		// anomalies in formatting:
		//
		//	% expr 0.1
		//	0.10000000000000001
		//	% expr 0.01
		//	0.01
		//	% expr 1e-7
		//	9.9999999999999995e-08
		//
		// For human readability, it appears better to choose the second rule,
		// and let [expr 0.1] return 0.1. But for 8.4 compatibility, we prefer
		// the first (the recommended zero value for tcl_precision avoids the
		// problem entirely).
		//
		// Uncomment TCL_DD_SHORTEN_FLAG in the next call to prefer the method
		// that allows floating point values to be shortened if it can be done
		// without loss of precision.

		digits = XTclDoubleDigits(tls, value, *(*int32)(unsafe.Pointer(precisionPtr)),
			TCL_DD_E_FORMAT,
			bp+16, bp+20, bp+24)
	}
	if *(*int32)(unsafe.Pointer(bp + 20)) != 0 {
		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8('-')
	}
	p = digits
	if *(*int32)(unsafe.Pointer(bp + 16)) < -4 || *(*int32)(unsafe.Pointer(bp + 16)) > 16 {
		// E format for numbers < 1e-3 or >= 1e17.

		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))
		c = *(*int8)(unsafe.Pointer(p))
		if int32(c) != 0 {
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8('.')
			for int32(c) != 0 {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = c
				c = *(*int8)(unsafe.Pointer(libc.PreIncUintptr(&p, 1)))
			}
		}

		// Tcl 8.4 appears to format with at least a two-digit exponent;
		// preserve that behaviour when tcl_precision != 0

		if *(*int32)(unsafe.Pointer(precisionPtr)) == 0 {
			libc.Xsprintf(tls, dst, ts+71276, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 16 /* exponent */))))
		} else {
			libc.Xsprintf(tls, dst, ts+71281, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(bp + 16 /* exponent */))))
		}
	} else {
		// F format for others.

		if *(*int32)(unsafe.Pointer(bp + 16)) < 0 {
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8('0')
		}
		c = *(*int8)(unsafe.Pointer(p))
		for libc.PostDecInt32(&*(*int32)(unsafe.Pointer(bp + 16)), 1) >= 0 {
			if int32(c) != 0 {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = c
				c = *(*int8)(unsafe.Pointer(libc.PreIncUintptr(&p, 1)))
			} else {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8('0')
			}
		}
		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8('.')
		if int32(c) == 0 {
			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8('0')
		} else {
			for libc.PreIncInt32(&*(*int32)(unsafe.Pointer(bp + 16)), 1) < -1 {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8('0')
			}
			for int32(c) != 0 {
				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = c
				c = *(*int8)(unsafe.Pointer(libc.PreIncUintptr(&p, 1)))
			}
		}
		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dst, 1))) = int8(0)
	}
	XTclpFree(tls, digits)
}

//----------------------------------------------------------------------
//
// TclPrecTraceProc --
//
//	This function is invoked whenever the variable "tcl_precision" is
//	written.
//
// Results:
//	Returns NULL if all went well, or an error message if the new value
//	for the variable doesn't make sense.
//
// Side effects:
//	If the new value doesn't make sense then this function undoes the
//	effect of the variable modification. Otherwise it modifies the format
//	string that's used by Tcl_PrintDouble.
//
//----------------------------------------------------------------------

func XTclPrecTraceProc(tls *libc.TLS, clientData ClientData, interp uintptr, name1 uintptr, name2 uintptr, flags int32) uintptr { /* tclUtil.c:3377:6: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var value uintptr
	// var prec int32 at bp, 4

	var precisionPtr uintptr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&precisionKey)), int32(unsafe.Sizeof(int32(0))))

	// If the variable is unset, then recreate the trace.

	if flags&TCL_TRACE_UNSETS != 0 {
		if flags&TCL_TRACE_DESTROYED != 0 && !(XTcl_InterpDeleted(tls, interp) != 0) {
			XTcl_TraceVar2(tls, interp, name1, name2,
				TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|
					TCL_TRACE_UNSETS, *(*uintptr)(unsafe.Pointer(&struct {
					f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr
				}{XTclPrecTraceProc})), clientData)
		}
		return uintptr(0)
	}

	// When the variable is read, reset its value from our shared value. This
	// is needed in case the variable was modified in some other interpreter
	// so that this interpreter's value is out of date.

	if flags&TCL_TRACE_READS != 0 {
		XTcl_SetVar2Ex(tls, interp, name1, name2, XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(precisionPtr))),
			flags&TCL_GLOBAL_ONLY)
		return uintptr(0)
	}

	// The variable is being written. Check the new value and disallow it if
	// it isn't reasonable or if this is a safe interpreter (we don't want
	// safe interpreters messing up the precision of other interpreters).

	if XTcl_IsSafe(tls, interp) != 0 {
		return ts + 71288 /* "can't modify pre..." */
	}
	value = XTcl_GetVar2Ex(tls, interp, name1, name2, flags&TCL_GLOBAL_ONLY)
	if value == uintptr(0) ||
		XTcl_GetIntFromObj(tls, uintptr(0), value, bp) != TCL_OK ||
		*(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > TCL_MAX_PREC {
		return ts + 71335 /* "improper value f..." */
	}
	*(*int32)(unsafe.Pointer(precisionPtr)) = *(*int32)(unsafe.Pointer(bp /* prec */))
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// TclNeedSpace --
//
//	This function checks to see whether it is appropriate to add a space
//	before appending a new list element to an existing string.
//
// Results:
//	The return value is 1 if a space is appropriate, 0 otherwise.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclNeedSpace(tls *libc.TLS, start uintptr, end uintptr) int32 { /* tclUtil.c:3452:1: */
	//
	//  A space is needed unless either:
	//  (a) we're at the start of the string, or
	//
	//  (NOTE: This check is now absorbed into the loop below.)
	//
	//
	//     if (end == start) {
	// 	return 0;
	//     }
	//
	//      *
	//

	//
	//  (b) we're at the start of a nested list-element, quoted with an open
	// 	   curly brace; we can be nested arbitrarily deep, so long as the
	// 	   first curly brace starts an element, so backtrack over open curly
	// 	   braces that are trailing characters of the string; and
	//
	//   (NOTE: Every character our parser is looking for is a proper
	//   single-byte encoding of an ASCII value. It does not accept
	//   overlong encodings.  Given that, there's no benefit using
	//   Tcl_UtfPrev. If it would find what we seek, so would byte-by-byte
	//   backward scan. Save routine call overhead and risk of wrong
	//   results should the behavior of Tcl_UtfPrev change in unexpected ways.
	// 	Reconsider this if we ever start treating non-ASCII Unicode
	// 	characters as meaningful list syntax, expanded Unicode spaces as
	// 	element separators, for example.)
	//
	//
	//     end = Tcl_UtfPrev(end, start);
	//     while (*end == '{') {
	//         if (end == start) {
	//             return 0;
	//         }
	//         end = Tcl_UtfPrev(end, start);
	//     }
	//
	//      *
	//

	for libc.PreDecUintptr(&end, 1) >= start && int32(*(*int8)(unsafe.Pointer(end))) == '{' {
	}
	if end < start {
		return 0
	}

	// (c) the trailing character of the string is already a list-element
	//	   separator, Use the same testing routine as TclFindElement to
	//	   enforce consistency.

	if func() int32 {
		if int32(*(*int8)(unsafe.Pointer(end))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(end))))
	}() != 0 {
		var result int32 = 0

		// Trailing whitespace might be part of a backslash escape
		// sequence. Handle that possibility.

		for libc.PreDecUintptr(&end, 1) >= start && int32(*(*int8)(unsafe.Pointer(end))) == '\\' {
			result = libc.BoolInt32(!(result != 0))
		}
		return result
	}
	return 1
}

//----------------------------------------------------------------------
//
// TclFormatInt --
//
//	This procedure formats an integer into a sequence of decimal digit
//	characters in a buffer. If the integer is negative, a minus sign is
//	inserted at the start of the buffer. A null character is inserted at
//	the end of the formatted characters. It is the caller's responsibility
//	to ensure that enough storage is available. This procedure has the
//	effect of sprintf(buffer, "%ld", n) but is faster as proven in
//	benchmarks.  This is key to UpdateStringOfInt, which is a common path
//	for a lot of code (e.g. int-indexed arrays).
//
// Results:
//	An integer representing the number of characters formatted, not
//	including the terminating \0.
//
// Side effects:
//	The formatted characters are written into the storage pointer to by
//	the "buffer" argument.
//
//----------------------------------------------------------------------

func XTclFormatInt(tls *libc.TLS, buffer uintptr, n int64) int32 { /* tclUtil.c:3553:1: */
	var intVal uint64
	var i int32 = 0
	var numFormatted int32
	var j int32

	// Generate the characters of the result backwards in the buffer.

	intVal = func() uint64 {
		if n < int64(0) {
			return -uint64(n)
		}
		return uint64(n)
	}()
	for ok := true; ok; ok = intVal > uint64(0) {
		*(*int8)(unsafe.Pointer(buffer + uintptr(libc.PostIncInt32(&i, 1)))) = digits[intVal%uint64(10)]
		intVal = intVal / uint64(10)
	}
	if n < int64(0) {
		*(*int8)(unsafe.Pointer(buffer + uintptr(libc.PostIncInt32(&i, 1)))) = int8('-')
	}
	*(*int8)(unsafe.Pointer(buffer + uintptr(i))) = int8(0)
	numFormatted = libc.PostDecInt32(&i, 1)

	// Now reverse the characters.

	j = 0
__1:
	if !(j < i) {
		goto __3
	}
	{
		var tmp int8 = *(*int8)(unsafe.Pointer(buffer + uintptr(i)))

		*(*int8)(unsafe.Pointer(buffer + uintptr(i))) = *(*int8)(unsafe.Pointer(buffer + uintptr(j)))
		*(*int8)(unsafe.Pointer(buffer + uintptr(j))) = tmp

	}
	goto __2
__2:
	j++
	i--
	goto __1
	goto __3
__3:
	;
	return numFormatted
}

var digits = *(*[11]int8)(unsafe.Pointer(ts + 71364)) /* tclUtil.c:3561:23 */

//----------------------------------------------------------------------
//
// TclGetIntForIndex --
//
//	Provides an integer corresponding to the list index held in a Tcl
//	object. The string value 'objPtr' is expected have the format
//	integer([+-]integer)? or end([+-]integer)?.
//
// Value
// 	TCL_OK
//
// 	    The index is stored at the address given by by 'indexPtr'. If
// 	    'objPtr' has the value "end", the value stored is 'endValue'.
//
// 	TCL_ERROR
//
// 	    The value of 'objPtr' does not have one of the expected formats. If
// 	    'interp' is non-NULL, an error message is left in the interpreter's
// 	    result object.
//
// Effect
//
// 	The object referenced by 'objPtr' is converted, as needed, to an
// 	integer, wide integer, or end-based-index object.
//
//----------------------------------------------------------------------

func XTclGetIntForIndex(tls *libc.TLS, interp uintptr, objPtr uintptr, endValue int32, indexPtr uintptr) int32 { /* tclUtil.c:3621:1: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	// var length int32 at bp+40, 4

	// var opPtr uintptr at bp+48, 8

	var bytes uintptr
	var code int32
	// var first int32 at bp+56, 4

	// var second int32 at bp+60, 4

	var savedOp int8

	if !(func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(objPtr + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(objPtr + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(indexPtr)) = int32(*(*int64)(unsafe.Pointer(objPtr + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, uintptr(0), objPtr, indexPtr)
	}() == TCL_OK) {
		goto __1
	}
	return TCL_OK
__1:
	;

	if !(sGetEndOffsetFromObj(tls, objPtr, endValue, indexPtr) == TCL_OK) {
		goto __2
	}
	return TCL_OK
__2:
	;

	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 40)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp+40)
	}()

	// Leading whitespace is acceptable in an index.

__3:
	if !(*(*int32)(unsafe.Pointer(bp + 40)) != 0 && func() int32 {
		if int32(*(*int8)(unsafe.Pointer(bytes))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(bytes))))
	}() != 0) {
		goto __4
	}
	bytes++
	*(*int32)(unsafe.Pointer(bp + 40 /* length */))--
	goto __3
__4:
	;

	if !(XTclParseNumber(tls, uintptr(0), uintptr(0), uintptr(0), bytes, *(*int32)(unsafe.Pointer(bp + 40)), bp+48,
		TCL_PARSE_INTEGER_ONLY|TCL_PARSE_NO_WHITESPACE) == TCL_OK) {
		goto __5
	}
	savedOp = *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* opPtr */))))

	if !(int32(savedOp) != '+' && int32(savedOp) != '-') {
		goto __6
	}
	goto parseError
__6:
	;
	if !(func() int32 {
		if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + 1))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + 1))))
	}() != 0) {
		goto __7
	}
	goto parseError
__7:
	;
	*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* opPtr */)))) = int8(0)
	code = XTcl_GetInt(tls, interp, bytes, bp+56)
	*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* opPtr */)))) = savedOp
	if !(code == TCL_ERROR) {
		goto __8
	}
	goto parseError
__8:
	;
	if !(TCL_ERROR == XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 48))+uintptr(1), bp+60)) {
		goto __9
	}
	goto parseError
__9:
	;
	if !(int32(savedOp) == '+') {
		goto __10
	}
	*(*int32)(unsafe.Pointer(indexPtr)) = *(*int32)(unsafe.Pointer(bp + 56)) + *(*int32)(unsafe.Pointer(bp + 60))
	goto __11
__10:
	*(*int32)(unsafe.Pointer(indexPtr)) = *(*int32)(unsafe.Pointer(bp + 56)) - *(*int32)(unsafe.Pointer(bp + 60))
__11:
	;
	return TCL_OK
__5:
	;

	// Report a parse error.

parseError:
	if !(interp != uintptr(0)) {
		goto __12
	}
	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,

		ts+71375, libc.VaList(bp, bytes)))
	if !!(libc.Xstrncmp(tls, bytes, ts+71440, uint64(4)) != 0) {
		goto __13
	}
	bytes += uintptr(4)
__13:
	;
	XTclCheckBadOctal(tls, interp, bytes)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+6915, ts+16210, uintptr(0)))
__12:
	;

	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// UpdateStringOfEndOffset --
//
//	Update the string rep of a Tcl object holding an "end-offset"
//	expression.
//
// Results:
//	None.
//
// Side effects:
//	Stores a valid string in the object's string rep.
//
// This function does NOT free any earlier string rep. If it is called on an
// object that already has a valid string rep, it will leak memory.
//
//----------------------------------------------------------------------

func sUpdateStringOfEndOffset(tls *libc.TLS, objPtr uintptr) { /* tclUtil.c:3724:1: */
	bp := tls.Alloc(29)
	defer tls.Free(29)

	// var buffer [29]int8 at bp, 29

	var len int32 = 3

	libc.Xmemcpy(tls, bp, ts+18768, uint64(4))
	if *(*int64)(unsafe.Pointer(objPtr + 32)) != int64(0) {
		*(*int8)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&len, 1)))) = int8('-')
		len = len + XTclFormatInt(tls, bp+uintptr(len), -*(*int64)(unsafe.Pointer(objPtr + 32)))
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, uint32(len+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, bp, uint64(len+1))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = len
}

//----------------------------------------------------------------------
//
// GetEndOffsetFromObj --
//
//	Look for a string of the form "end[+-]offset" and convert it to an
//	internal representation holding the offset.
//
// Results:
//	Tcl return code.
//
// Side effects:
//	May store a Tcl_ObjType.
//
//----------------------------------------------------------------------

func sGetEndOffsetFromObj(tls *libc.TLS, objPtr uintptr, endValue int32, indexPtr uintptr) int32 { /* tclUtil.c:3758:1: */
	if sSetEndOffsetFromAny(tls, uintptr(0), objPtr) != TCL_OK {
		return TCL_ERROR
	}

	// TODO: Handle overflow cases sensibly
	*(*int32)(unsafe.Pointer(indexPtr)) = endValue + int32(*(*int64)(unsafe.Pointer(objPtr + 32)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// SetEndOffsetFromAny --
//
//	Look for a string of the form "end[+-]offset" and convert it to an
//	internal representation holding the offset.
//
// Results:
//	Returns TCL_OK if ok, TCL_ERROR if the string was badly formed.
//
// Side effects:
//	If interp is not NULL, stores an error message in the interpreter
//	result.
//
//----------------------------------------------------------------------

func sSetEndOffsetFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclUtil.c:3794:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	// var offset int32 at bp+84, 4
	// Offset in the "end-offset" expression
	var bytes uintptr // String rep of the object
	// var length int32 at bp+80, 4
	// Length of the object's string rep

	// If it's already the right type, we're fine.

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclEndOffsetType))) {
		goto __1
	}
	return TCL_OK
__1:
	;

	// Check for a string rep of the right form.

	bytes = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 80)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, objPtr, bp+80)
	}()
	if !(int32(*(*int8)(unsafe.Pointer(bytes))) != 'e' || libc.Xstrncmp(tls, bytes, ts+18768,
		func() uint64 {
			if *(*int32)(unsafe.Pointer(bp + 80)) > 3 {
				return uint64(3)
			}
			return uint64(*(*int32)(unsafe.Pointer(bp + 80)))
		}()) != 0) {
		goto __2
	}
	if !(interp != uintptr(0)) {
		goto __3
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+71445, libc.VaList(bp, bytes)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+6915, ts+16210, uintptr(0)))
__3:
	;
	return TCL_ERROR
__2:
	;

	// Convert the string rep.

	if !(*(*int32)(unsafe.Pointer(bp + 80)) <= 3) {
		goto __4
	}
	*(*int32)(unsafe.Pointer(bp + 84 /* offset */)) = 0
	goto __5
__4:
	if !(*(*int32)(unsafe.Pointer(bp + 80)) > 4 && (int32(*(*int8)(unsafe.Pointer(bytes + 3))) == '-' || int32(*(*int8)(unsafe.Pointer(bytes + 3))) == '+')) {
		goto __6
	}
	// This is our limited string expression evaluator. Pass everything
	// after "end-" to Tcl_GetInt, then reverse for offset.

	if !(func() int32 {
		if int32(*(*int8)(unsafe.Pointer(bytes + 4))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(bytes + 4))))
	}() != 0) {
		goto __8
	}
	goto badIndexFormat
__8:
	;
	if !(XTcl_GetInt(tls, interp, bytes+uintptr(4), bp+84) != TCL_OK) {
		goto __9
	}
	return TCL_ERROR
__9:
	;
	if !(int32(*(*int8)(unsafe.Pointer(bytes + 3))) == '-') {
		goto __10
	}

	// TODO: Review overflow concerns here!
	*(*int32)(unsafe.Pointer(bp + 84 /* offset */)) = -*(*int32)(unsafe.Pointer(bp + 84 /* offset */))
__10:
	;
	goto __7
__6:
	// Conversion failed. Report the error.

badIndexFormat:
	if !(interp != uintptr(0)) {
		goto __11
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+71445, libc.VaList(bp+40, bytes)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+6915, ts+16210, uintptr(0)))
__11:
	;
	return TCL_ERROR
__7:
	;
__5:
	;

	// The conversion succeeded. Free the old internal rep and set the new
	// one.

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __12
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __13
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__13:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__12:
	;

	*(*int64)(unsafe.Pointer(objPtr + 32)) = int64(*(*int32)(unsafe.Pointer(bp + 84 /* offset */)))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclEndOffsetType))

	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclIndexEncode --
//
//      Parse objPtr to determine if it is an index value. Two cases
//	are possible.  The value objPtr might be parsed as an absolute
//	index value in the C signed int range.  Note that this includes
//	index values that are integers as presented and it includes index
//      arithmetic expressions. The absolute index values that can be
//	directly meaningful as an index into either a list or a string are
//	those integer values >= TCL_INDEX_START (0)
//	and < TCL_INDEX_AFTER (INT_MAX).
//      The largest string supported in Tcl 8 has bytelength INT_MAX.
//      This means the largest supported character length is also INT_MAX,
//      and the index of the last character in a string of length INT_MAX
//      is INT_MAX-1.
//
//      Any absolute index value parsed outside that range is encoded
//      using the before and after values passed in by the
//      caller as the encoding to use for indices that are either
//      less than or greater than the usable index range. TCL_INDEX_AFTER
//      is available as a good choice for most callers to use for
//      after. Likewise, the value TCL_INDEX_BEFORE is good for
//      most callers to use for before.  Other values are possible
//      when the caller knows it is helpful in producing its own behavior
//      for indices before and after the indexed item.
//
//      A token can also be parsed as an end-relative index expression.
//      All end-relative expressions that indicate an index larger
//      than end (end+2, end--5) point beyond the end of the indexed
//      collection, and can be encoded as after.  The end-relative
//      expressions that indicate an index less than or equal to end
//      are encoded relative to the value TCL_INDEX_END (-2).  The
//      index "end" is encoded as -2, down to the index "end-0x7FFFFFFE"
//      which is encoded as INT_MIN. Since the largest index into a
//      string possible in Tcl 8 is 0x7FFFFFFE, the interpretation of
//      "end-0x7FFFFFFE" for that largest string would be 0.  Thus,
//      if the tokens "end-0x7FFFFFFF" or "end+-0x80000000" are parsed,
//      they can be encoded with the before value.
//
//      These details will require re-examination whenever string and
//      list length limits are increased, but that will likely also
//      mean a revised routine capable of returning Tcl_WideInt values.
//
// Returns:
//      TCL_OK if parsing succeeded, and TCL_ERROR if it failed.
//
// Side effects:
//      When TCL_OK is returned, the encoded index value is written
//      to *indexPtr.
//
//----------------------------------------------------------------------

func XTclIndexEncode(tls *libc.TLS, interp uintptr, objPtr uintptr, before int32, after int32, indexPtr uintptr) int32 { /* tclUtil.c:3930:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var idx int32 at bp, 4

	if !(TCL_OK == func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(objPtr + 32)) >= -int64(uint32(0x7fffffff)*2+1) && *(*int64)(unsafe.Pointer(objPtr + 32)) <= int64(uint32(0x7fffffff)*2+1) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp)) = int32(*(*int64)(unsafe.Pointer(objPtr + 32)))
				return TCL_OK
			}()
		}
		return XTcl_GetIntFromObj(tls, uintptr(0), objPtr, bp)
	}()) {
		goto __1
	}
	// We parsed a value in the range INT_MIN...INT_MAX
integerEncode:
	if !(*(*int32)(unsafe.Pointer(bp)) < 0) {
		goto __3
	}
	// All negative absolute indices are "before the beginning"
	*(*int32)(unsafe.Pointer(bp /* idx */)) = before
	goto __4
__3:
	if !(*(*int32)(unsafe.Pointer(bp)) == 0x7fffffff) {
		goto __5
	}
	// This index value is always "after the end"
	*(*int32)(unsafe.Pointer(bp /* idx */)) = after
__5:
	;
__4:
	;
	// usual case, the absolute index value encodes itself
	goto __2
__1:
	if !(TCL_OK == sGetEndOffsetFromObj(tls, objPtr, 0, bp)) {
		goto __6
	}
	// We parsed an end+offset index value.
	// idx holds the offset value in the range INT_MIN...INT_MAX.
	if !(*(*int32)(unsafe.Pointer(bp)) > 0) {
		goto __8
	}
	// All end+postive or end-negative expressions
	// always indicate "after the end".
	*(*int32)(unsafe.Pointer(bp /* idx */)) = after
	goto __9
__8:
	if !(*(*int32)(unsafe.Pointer(bp)) < -0x7fffffff-1 - -2) {
		goto __10
	}
	// These indices always indicate "before the beginning
	*(*int32)(unsafe.Pointer(bp /* idx */)) = before
	goto __11
__10:
	// Encoded end-positive (or end+negative) are offset
	*(*int32)(unsafe.Pointer(bp /* idx */)) += -2
__11:
	;
__9:
	;

	// TODO: Consider flag to suppress repeated end-offset parse.
	goto __7
__6:
	if !(TCL_OK == func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*int64)(unsafe.Pointer(objPtr + 32)) >= int64(-0x7fffffff-1) && *(*int64)(unsafe.Pointer(objPtr + 32)) <= int64(0x7fffffff) {
			return func() int32 {
				*(*int32)(unsafe.Pointer(bp)) = int32(*(*int64)(unsafe.Pointer(objPtr + 32)))
				return TCL_OK
			}()
		}
		return XTclGetIntForIndex(tls, interp, objPtr, 0, bp)
	}()) {
		goto __12
	}
	// Only reach this case when the index value is a
	// constant index arithmetic expression, and idx
	// holds the result. Treat it the same as if it were
	// parsed as an absolute integer value.
	goto integerEncode
	goto __13
__12:
	return TCL_ERROR
__13:
	;
__7:
	;
__2:
	;
	*(*int32)(unsafe.Pointer(indexPtr)) = *(*int32)(unsafe.Pointer(bp /* idx */))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclIndexDecode --
//
//	Decodes a value previously encoded by TclIndexEncode.  The argument
//	endValue indicates what value of "end" should be used in the
//	decoding.
//
// Results:
//	The decoded index value.
//
//----------------------------------------------------------------------

func XTclIndexDecode(tls *libc.TLS, encoded int32, endValue int32) int32 { /* tclUtil.c:4001:1: */
	if encoded <= -2 {
		return encoded - -2 + endValue
	}
	return encoded
}

//----------------------------------------------------------------------
//
// TclCheckBadOctal --
//
//	This function checks for a bad octal value and appends a meaningful
//	error to the interp's result.
//
// Results:
//	1 if the argument was a bad octal, else 0.
//
// Side effects:
//	The interpreter's result is modified.
//
//----------------------------------------------------------------------

func XTclCheckBadOctal(tls *libc.TLS, interp uintptr, value uintptr) int32 { /* tclUtil.c:4029:1: */
	var p uintptr = value

	// A frequent mistake is invalid octal values due to an unwanted leading
	// zero. Try to generate a meaningful error message.

	for func() int32 {
		if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
			return 0
		}
		return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
	}() != 0 {
		p++
	}
	if int32(*(*int8)(unsafe.Pointer(p))) == '+' || int32(*(*int8)(unsafe.Pointer(p))) == '-' {
		p++
	}
	if int32(*(*int8)(unsafe.Pointer(p))) == '0' {
		if int32(*(*int8)(unsafe.Pointer(p + 1))) == 'o' || int32(*(*int8)(unsafe.Pointer(p + 1))) == 'O' {
			p += uintptr(2)
		}
		for int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(p)))))*2)))&int32(X_ISdigit) != 0 { // INTL: digit.
			p++
		}
		for func() int32 {
			if int32(*(*int8)(unsafe.Pointer(p))) > 0x20 {
				return 0
			}
			return XTclIsSpaceProc(tls, int32(*(*int8)(unsafe.Pointer(p))))
		}() != 0 {
			p++
		}
		if int32(*(*int8)(unsafe.Pointer(p))) == 0 {
			// Reached end of string.

			if interp != uintptr(0) {
				// Don't reset the result here because we want this result to
				// be added to an existing error message as extra info.

				XTcl_AppendToObj(tls, XTcl_GetObjResult(tls, interp),
					ts+64348, -1)
			}
			return 1
		}
	}
	return 0
}

//----------------------------------------------------------------------
//
// ClearHash --
//
//	Remove all the entries in the hash table *tablePtr.
//
//----------------------------------------------------------------------

func sClearHash(tls *libc.TLS, tablePtr uintptr) { /* tclUtil.c:4089:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var search Tcl_HashSearch at bp, 24

	var hPtr uintptr

	for hPtr = XTcl_FirstHashEntry(tls, tablePtr, bp); hPtr != uintptr(0); hPtr = XTcl_NextHashEntry(tls, bp) {
		var objPtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData

		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		XTcl_DeleteHashEntry(tls, hPtr)
	}
}

//----------------------------------------------------------------------
//
// GetThreadHash --
//
//	Get a thread-specific (Tcl_HashTable *) associated with a thread data
//	key.
//
// Results:
//	The Tcl_HashTable * corresponding to *keyPtr.
//
// Side effects:
//	The first call on a keyPtr in each thread creates a new Tcl_HashTable,
//	and registers a thread exit handler to dispose of it.
//
//----------------------------------------------------------------------

func sGetThreadHash(tls *libc.TLS, keyPtr uintptr) uintptr { /* tclUtil.c:4122:22: */
	var tablePtrPtr uintptr = XTcl_GetThreadData(tls, keyPtr, int32(unsafe.Sizeof(uintptr(0))))

	if uintptr(0) == *(*uintptr)(unsafe.Pointer(tablePtrPtr)) {
		*(*uintptr)(unsafe.Pointer(tablePtrPtr)) = XTcl_Alloc(tls, uint32(unsafe.Sizeof(Tcl_HashTable{})))
		XTcl_CreateThreadExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFreeThreadHash})), *(*uintptr)(unsafe.Pointer(tablePtrPtr)))
		XTcl_InitHashTable(tls, *(*uintptr)(unsafe.Pointer(tablePtrPtr)), 1)
	}
	return *(*uintptr)(unsafe.Pointer(tablePtrPtr))
}

//----------------------------------------------------------------------
//
// FreeThreadHash --
//
//	Thread exit handler used by GetThreadHash to dispose of a thread hash
//	table.
//
// Side effects:
//	Frees a Tcl_HashTable.
//
//----------------------------------------------------------------------

func sFreeThreadHash(tls *libc.TLS, clientData ClientData) { /* tclUtil.c:4152:1: */
	var tablePtr uintptr = clientData

	sClearHash(tls, tablePtr)
	XTcl_DeleteHashTable(tls, tablePtr)
	XTclpFree(tls, tablePtr)
}

//----------------------------------------------------------------------
//
// FreeProcessGlobalValue --
//
//	Exit handler used by Tcl(Set|Get)ProcessGlobalValue to cleanup a
//	ProcessGlobalValue at exit.
//
//----------------------------------------------------------------------

func sFreeProcessGlobalValue(tls *libc.TLS, clientData ClientData) { /* tclUtil.c:4174:1: */
	var pgvPtr uintptr = clientData

	(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fepoch++
	(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).FnumBytes = 0
	XTclpFree(tls, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue)
	(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue = uintptr(0)
	if (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fencoding != 0 {
		XTcl_FreeEncoding(tls, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fencoding)
		(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fencoding = uintptr(0)
	}
	XTcl_MutexFinalize(tls, pgvPtr+32)
}

//----------------------------------------------------------------------
//
// TclSetProcessGlobalValue --
//
//	Utility routine to set a global value shared by all threads in the
//	process while keeping a thread-local copy as well.
//
//----------------------------------------------------------------------

func XTclSetProcessGlobalValue(tls *libc.TLS, pgvPtr uintptr, newValue uintptr, encoding Tcl_Encoding) { /* tclUtil.c:4202:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var bytes uintptr
	var cacheMap uintptr
	var hPtr uintptr
	// var dummy int32 at bp, 4

	XTcl_MutexLock(tls, pgvPtr+32)

	// Fill the global string value.

	(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fepoch++
	if uintptr(0) != (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue {
		XTclpFree(tls, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue)
	} else {
		XTcl_CreateExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFreeProcessGlobalValue})), pgvPtr)
	}
	bytes = XTcl_GetStringFromObj(tls, newValue, pgvPtr+4)
	(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue = XTcl_Alloc(tls, uint32((*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).FnumBytes+1))
	libc.Xmemcpy(tls, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue, bytes, uint64((*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).FnumBytes+1))
	if (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fencoding != 0 {
		XTcl_FreeEncoding(tls, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fencoding)
	}
	(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fencoding = encoding

	// Fill the local thread copy directly with the Tcl_Obj value to avoid
	// loss of the internalrep. Increment newValue refCount early to handle case
	// where we set a PGV to itself.

	(*Tcl_Obj)(unsafe.Pointer(newValue)).FrefCount++
	cacheMap = sGetThreadHash(tls, pgvPtr+40)
	sClearHash(tls, cacheMap)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(cacheMap)).FcreateProc})).f(tls, cacheMap, uintptr(Intptr_t((*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fepoch)), bp /* &dummy */)
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = newValue
	XTcl_MutexUnlock(tls, pgvPtr+32)
}

//----------------------------------------------------------------------
//
// TclGetProcessGlobalValue --
//
//	Retrieve a global value shared among all threads of the process,
//	preferring a thread-local copy as long as it remains valid.
//
// Results:
//	Returns a (Tcl_Obj *) that holds a copy of the global value.
//
//----------------------------------------------------------------------

func XTclGetProcessGlobalValue(tls *libc.TLS, pgvPtr uintptr) uintptr { /* tclUtil.c:4260:9: */
	bp := tls.Alloc(436)
	defer tls.Free(436)

	var value uintptr = uintptr(0)
	var cacheMap uintptr
	var hPtr uintptr
	var epoch int32 = (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fepoch

	if (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fencoding != 0 {
		var current Tcl_Encoding = XTcl_GetEncoding(tls, uintptr(0), uintptr(0))

		if (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fencoding != current {
			// The system encoding has changed since the global string value
			// was saved. Convert the global value to be based on the new
			// system encoding.

			// var native Tcl_DString at bp, 216

			// var newValue Tcl_DString at bp+216, 216

			XTcl_MutexLock(tls, pgvPtr+32)
			epoch = libc.PreIncInt32(&(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fepoch, 1)
			XTcl_UtfToExternalDString(tls, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fencoding, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue,
				(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).FnumBytes, bp)
			XTcl_ExternalToUtfDString(tls, current, (*Tcl_DString)(unsafe.Pointer(bp)).Fstring,
				(*Tcl_DString)(unsafe.Pointer(bp)).Flength, bp+216)
			XTcl_DStringFree(tls, bp)
			XTclpFree(tls, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue)
			(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue = XTcl_Alloc(tls, uint32((*Tcl_DString)(unsafe.Pointer(bp+216)).Flength+1))
			libc.Xmemcpy(tls, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue, (*Tcl_DString)(unsafe.Pointer(bp+216)).Fstring,
				uint64((*Tcl_DString)(unsafe.Pointer(bp+216)).Flength+1))
			XTcl_DStringFree(tls, bp+216)
			XTcl_FreeEncoding(tls, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fencoding)
			(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fencoding = current
			XTcl_MutexUnlock(tls, pgvPtr+32)
		} else {
			XTcl_FreeEncoding(tls, current)
		}
	}
	cacheMap = sGetThreadHash(tls, pgvPtr+40)
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(cacheMap)).FfindProc})).f(tls, cacheMap, uintptr(Intptr_t(epoch)))
	if uintptr(0) == hPtr {
		// var dummy int32 at bp+432, 4

		// No cache for the current epoch - must be a new one.
		//
		// First, clear the cacheMap, as anything in it must refer to some
		// expired epoch.

		sClearHash(tls, cacheMap)

		// If no thread has set the shared value, call the initializer.

		XTcl_MutexLock(tls, pgvPtr+32)
		if uintptr(0) == (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue && (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fproc != 0 {
			(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fepoch++
			(*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr)
			})(unsafe.Pointer(&struct{ uintptr }{(*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fproc})).f(tls, pgvPtr+8 /* &.value */, pgvPtr+4 /* &.numBytes */, pgvPtr+16 /* &.encoding */)
			if (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue == uintptr(0) {
				XTcl_Panic(tls, ts+71486, 0)
			}
			XTcl_CreateExitHandler(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sFreeProcessGlobalValue})), pgvPtr)
		}

		// Store a copy of the shared value in our epoch-indexed cache.

		value = XTcl_NewStringObj(tls, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fvalue, (*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).FnumBytes)
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(cacheMap)).FcreateProc})).f(tls, cacheMap, uintptr(Intptr_t((*ProcessGlobalValue)(unsafe.Pointer(pgvPtr)).Fepoch)), bp+432 /* &dummy */)
		XTcl_MutexUnlock(tls, pgvPtr+32)
		(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = value
		(*Tcl_Obj)(unsafe.Pointer(value)).FrefCount++
	}
	return (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
}

//----------------------------------------------------------------------
//
// TclSetObjNameOfExecutable --
//
//	This function stores the absolute pathname of the executable file
//	(normally as computed by TclpFindExecutable).
//
// Results:
//	None.
//
// Side effects:
//	Stores the executable name.
//
//----------------------------------------------------------------------

func XTclSetObjNameOfExecutable(tls *libc.TLS, name uintptr, encoding Tcl_Encoding) { /* tclUtil.c:4360:1: */
	XTclSetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&executableName)), name, encoding)
}

//----------------------------------------------------------------------
//
// TclGetObjNameOfExecutable --
//
//	This function retrieves the absolute pathname of the application in
//	which the Tcl library is running, usually as previously stored by
//	TclpFindExecutable(). This function call is the C API equivalent to
//	the "info nameofexecutable" command.
//
// Results:
//	A pointer to an "fsPath" Tcl_Obj, or to an empty Tcl_Obj if the
//	pathname of the application is unknown.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetObjNameOfExecutable(tls *libc.TLS) uintptr { /* tclUtil.c:4387:9: */
	return XTclGetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&executableName)))
}

//----------------------------------------------------------------------
//
// Tcl_GetNameOfExecutable --
//
//	This function retrieves the absolute pathname of the application in
//	which the Tcl library is running, and returns it in string form.
//
//	The returned string belongs to Tcl and should be copied if the caller
//	plans to keep it, to guard against it becoming invalid.
//
// Results:
//	A pointer to the internal string or NULL if the internal full path
//	name has not been computed or unknown.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetNameOfExecutable(tls *libc.TLS) uintptr { /* tclUtil.c:4414:12: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	// var numBytes int32 at bp, 4

	var bytes uintptr = XTcl_GetStringFromObj(tls, XTclGetObjNameOfExecutable(tls), bp)

	if *(*int32)(unsafe.Pointer(bp)) == 0 {
		return uintptr(0)
	}
	return bytes
}

//----------------------------------------------------------------------
//
// TclpGetTime --
//
//	Deprecated synonym for Tcl_GetTime. This function is provided for the
//	benefit of extensions written before Tcl_GetTime was exported from the
//	library.
//
// Results:
//	None.
//
// Side effects:
//	Stores current time in the buffer designated by "timePtr"
//
//----------------------------------------------------------------------

func XTclpGetTime(tls *libc.TLS, timePtr uintptr) { /* tclUtil.c:4446:1: */
	XTcl_GetTime(tls, timePtr)
}

//----------------------------------------------------------------------
//
// TclGetPlatform --
//
//	This is a kludge that allows the test library to get access the
//	internal tclPlatform variable.
//
// Results:
//	Returns a pointer to the tclPlatform variable.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclGetPlatform(tls *libc.TLS) uintptr { /* tclUtil.c:4469:17: */
	return uintptr(unsafe.Pointer(&XtclPlatform))
}

//----------------------------------------------------------------------
//
// TclReToGlob --
//
//	Attempt to convert a regular expression to an equivalent glob pattern.
//
// Results:
//	Returns TCL_OK on success, TCL_ERROR on failure. If interp is not
//	NULL, an error message is placed in the result. On success, the
//	DString will contain an exact equivalent glob pattern. The caller is
//	responsible for calling Tcl_DStringFree on success. If exactPtr is not
//	NULL, it will be 1 if an exact match qualifies.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTclReToGlob(tls *libc.TLS, interp uintptr, reStr uintptr, reStrLen int32, dsPtr uintptr, exactPtr uintptr, quantifiersFoundPtr uintptr) int32 { /* tclUtil.c:4496:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var anchorLeft int32
	var anchorRight int32
	var lastIsStar int32
	var numStars int32
	var dsStr uintptr
	var dsStrStart uintptr
	var msg uintptr
	var p uintptr
	var strEnd uintptr
	var code uintptr

	strEnd = reStr + uintptr(reStrLen)
	XTcl_DStringInit(tls, dsPtr)
	if !(quantifiersFoundPtr != uintptr(0)) {
		goto __1
	}
	*(*int32)(unsafe.Pointer(quantifiersFoundPtr)) = 0
__1:
	;

	// "***=xxx" == "*xxx*", watch for glob-sensitive chars.

	if !(reStrLen >= 4 && libc.Xmemcmp(tls, ts+71521, reStr, uint64(4)) == 0) {
		goto __2
	}
	// At most, the glob pattern has length 2*reStrLen + 2 to backslash
	// escape every character and have * at each end.

	XTcl_DStringSetLength(tls, dsPtr, reStrLen+2)
	dsStr = libc.AssignUintptr(&dsStrStart, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring)
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('*')
	p = reStr + uintptr(4)
__3:
	if !(p < strEnd) {
		goto __5
	}
	switch int32(*(*int8)(unsafe.Pointer(p))) {
	case '\\':
		goto __7
	case '*':
		goto __8
	case '[':
		goto __9
	case ']':
		goto __10
	case '?':
		goto __11
		// fall through
	default:
		goto __12
	}
	goto __6
__7:
__8:
__9:
__10:
__11:
	// Only add \ where necessary for glob
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('\\')
	// fall through
__12:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = *(*int8)(unsafe.Pointer(p))
	goto __6
__6:
	;
	goto __4
__4:
	p++
	goto __3
	goto __5
__5:
	;
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('*')
	XTcl_DStringSetLength(tls, dsPtr, int32((int64(dsStr)-int64(dsStrStart))/1))
	if !(exactPtr != 0) {
		goto __13
	}
	*(*int32)(unsafe.Pointer(exactPtr)) = 0
__13:
	;
	return TCL_OK
__2:
	;

	// At most, the glob pattern has length reStrLen + 2 to account for
	// possible * at each end.

	XTcl_DStringSetLength(tls, dsPtr, reStrLen+2)
	dsStr = libc.AssignUintptr(&dsStrStart, (*Tcl_DString)(unsafe.Pointer(dsPtr)).Fstring)

	// Check for anchored REs (ie ^foo$), so we can use string equal if
	// possible. Do not alter the start of str so we can free it correctly.
	//
	// Keep track of the last char being an unescaped star to prevent multiple
	// instances.  Simpler than checking that the last star may be escaped.

	msg = uintptr(0)
	code = uintptr(0)
	p = reStr
	anchorRight = 0
	lastIsStar = 0
	numStars = 0

	if !(int32(*(*int8)(unsafe.Pointer(p))) == '^') {
		goto __14
	}
	anchorLeft = 1
	p++
	goto __15
__14:
	anchorLeft = 0
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('*')
	lastIsStar = 1
__15:
	;

__16:
	if !(p < strEnd) {
		goto __18
	}
	switch int32(*(*int8)(unsafe.Pointer(p))) {
	case '\\':
		goto __20
	case '.':
		goto __21
	case '$':
		goto __22
	case '*':
		goto __23
	case '+':
		goto __24
	case '?':
		goto __25
	case '|':
		goto __26
	case '^':
		goto __27
	case '{':
		goto __28
	case '}':
		goto __29
	case '(':
		goto __30
	case ')':
		goto __31
	case '[':
		goto __32
	case ']':
		goto __33
	default:
		goto __34
	}
	goto __19
__20:
	p++
	switch int32(*(*int8)(unsafe.Pointer(p))) {
	case 'a':
		goto __36
	case 'b':
		goto __37
	case 'f':
		goto __38
	case 'n':
		goto __39
	case 'r':
		goto __40
	case 't':
		goto __41
	case 'v':
		goto __42
	case 'B':
		goto __43
	case '\\':
		goto __44
	case '*':
		goto __45
	case '[':
		goto __46
	case ']':
		goto __47
	case '?':
		goto __48 // prevent exact match
		// fall through
	case '{':
		goto __49
	case '}':
		goto __50
	case '(':
		goto __51
	case ')':
		goto __52
	case '+':
		goto __53
	case '.':
		goto __54
	case '|':
		goto __55
	case '^':
		goto __56
	case '$':
		goto __57
	default:
		goto __58
	}
	goto __35
__36:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('\a')
	goto __35
__37:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('\b')
	goto __35
__38:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('\f')
	goto __35
__39:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('\n')
	goto __35
__40:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('\r')
	goto __35
__41:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('\t')
	goto __35
__42:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('\v')
	goto __35
__43:
__44:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('\\')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('\\')
	anchorLeft = 0 // prevent exact match
	goto __35
__45:
__46:
__47:
__48:
	// Only add \ where necessary for glob
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('\\')
	anchorLeft = 0 // prevent exact match
	// fall through
__49:
__50:
__51:
__52:
__53:
__54:
__55:
__56:
__57:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = *(*int8)(unsafe.Pointer(p))
	goto __35
__58:
	msg = ts + 71526  /* "invalid escape s..." */
	code = ts + 71550 /* "BADESCAPE" */
	goto invalidGlob
__35:
	;
	goto __19
__21:
	if !(quantifiersFoundPtr != uintptr(0)) {
		goto __59
	}
	*(*int32)(unsafe.Pointer(quantifiersFoundPtr)) = 1
__59:
	;
	anchorLeft = 0 // prevent exact match
	if !(p+uintptr(1) < strEnd) {
		goto __60
	}
	if !(int32(*(*int8)(unsafe.Pointer(p + 1))) == '*') {
		goto __61
	}
	p++
	if !!(lastIsStar != 0) {
		goto __63
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('*')
	lastIsStar = 1
	numStars++
__63:
	;
	goto __17
	goto __62
__61:
	if !(int32(*(*int8)(unsafe.Pointer(p + 1))) == '+') {
		goto __64
	}
	p++
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('?')
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('*')
	lastIsStar = 1
	numStars++
	goto __17
__64:
	;
__62:
	;
__60:
	;
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('?')
	goto __19
__22:
	if !(p+uintptr(1) != strEnd) {
		goto __65
	}
	msg = ts + 71560  /* "$ not anchor" */
	code = ts + 71573 /* "NONANCHOR" */
	goto invalidGlob
__65:
	;
	anchorRight = 1
	goto __19
__23:
__24:
__25:
__26:
__27:
__28:
__29:
__30:
__31:
__32:
__33:
	msg = ts + 71583  /* "unhandled RE spe..." */
	code = ts + 71609 /* "UNHANDLED" */
	goto invalidGlob
__34:
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = *(*int8)(unsafe.Pointer(p))
	goto __19
__19:
	;
	lastIsStar = 0
	goto __17
__17:
	p++
	goto __16
	goto __18
__18:
	;
	if !(numStars > 1) {
		goto __66
	}
	// Heuristic: if >1 non-anchoring *, the risk is large that glob
	// matching is slower than the RE engine, so report invalid.

	msg = ts + 71619  /* "excessive recurs..." */
	code = ts + 71664 /* "OVERCOMPLEX" */
	goto invalidGlob
__66:
	;

	if !(!(anchorRight != 0) && !(lastIsStar != 0)) {
		goto __67
	}
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&dsStr, 1))) = int8('*')
__67:
	;
	XTcl_DStringSetLength(tls, dsPtr, int32((int64(dsStr)-int64(dsStrStart))/1))

	if !(exactPtr != 0) {
		goto __68
	}
	*(*int32)(unsafe.Pointer(exactPtr)) = libc.Bool32(anchorLeft != 0 && anchorRight != 0)
__68:
	;

	return TCL_OK

invalidGlob:
	if !(interp != uintptr(0)) {
		goto __69
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, msg, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+71676, code, uintptr(0)))
__69:
	;
	XTcl_DStringFree(tls, dsPtr)
	return TCL_ERROR
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

var tclVarHashKeyType = Tcl_HashKeyType{
	Fversion:         TCL_HASH_KEY_TYPE_VERSION, // flags
	FhashKeyProc:     0,                         // hashKeyProc
	FcompareKeysProc: 0,                         // compareKeysProc
	FallocEntryProc:  0,                         // allocEntryProc
	FfreeEntryProc:   0,                         // freeEntryProc
} /* tclVar.c:31:30 */

// NOTE: VarHashCreateVar increments the recount of its key argument.
// All callers that will call Tcl_DecrRefCount on that argument must
// call Tcl_IncrRefCount on it before passing it in.  This requirement
// can bubble up to callers of callers .... etc.

func sVarHashCreateVar1(tls *libc.TLS, tablePtr uintptr, key uintptr, newPtr uintptr) uintptr { /* tclVar.c:57:19: */
	var hPtr uintptr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr /* &.table */)).FcreateProc})).f(tls, tablePtr /* &.table */, key, newPtr)

	if hPtr != 0 {
		return hPtr - uintptr(int32(uintptr(0)+24))
	} else {
		return uintptr(0)
	}
	return uintptr(0)
}

func sVarHashFirstVar(tls *libc.TLS, tablePtr uintptr, searchPtr uintptr) uintptr { /* tclVar.c:88:19: */
	var hPtr uintptr = XTcl_FirstHashEntry(tls, tablePtr, searchPtr)

	if hPtr != 0 {
		return hPtr - uintptr(int32(uintptr(0)+24))
	} else {
		return uintptr(0)
	}
	return uintptr(0)
}

func sVarHashNextVar(tls *libc.TLS, searchPtr uintptr) uintptr { /* tclVar.c:102:19: */
	var hPtr uintptr = XTcl_NextHashEntry(tls, searchPtr)

	if hPtr != 0 {
		return hPtr - uintptr(int32(uintptr(0)+24))
	} else {
		return uintptr(0)
	}
	return uintptr(0)
}

// The strings below are used to indicate what went wrong when a variable
// access is denied.

var sNOSUCHVAR = *(*[17]int8)(unsafe.Pointer(ts + 27240))       /* tclVar.c:126:19 */
var sISARRAY = *(*[18]int8)(unsafe.Pointer(ts + 71684))         /* tclVar.c:127:19 */
var sNEEDARRAY = *(*[21]int8)(unsafe.Pointer(ts + 28424))       /* tclVar.c:128:19 */
var sNOSUCHELEMENT = *(*[25]int8)(unsafe.Pointer(ts + 71702))   /* tclVar.c:129:19 */
var sDANGLINGELEMENT = *(*[41]int8)(unsafe.Pointer(ts + 71727)) /* tclVar.c:130:19 */
var sDANGLINGVAR = *(*[46]int8)(unsafe.Pointer(ts + 71768))     /* tclVar.c:132:19 */
var sBADNAMESPACE = *(*[31]int8)(unsafe.Pointer(ts + 71814))    /* tclVar.c:134:19 */
var sMISSINGNAME = *(*[22]int8)(unsafe.Pointer(ts + 71845))     /* tclVar.c:135:19 */
var sISARRAYELEMENT = *(*[38]int8)(unsafe.Pointer(ts + 50293))  /* tclVar.c:136:19 */

// A test to see if we are in a call frame that has local variables. This is
// true if we are inside a procedure body.

// The following structure describes an enumerative search in progress on an
// array variable; this are invoked with options to the "array" command.

type ArraySearch1 = struct {
	Fid          int32
	F__ccgo_pad1 [4]byte
	FvarPtr      uintptr
	Fsearch      Tcl_HashSearch
	FnextEntry   uintptr
	FnextPtr     uintptr
} /* tclVar.c:151:9 */

// A test to see if we are in a call frame that has local variables. This is
// true if we are inside a procedure body.

// The following structure describes an enumerative search in progress on an
// array variable; this are invoked with options to the "array" command.

type ArraySearch = ArraySearch1 /* tclVar.c:168:3 */

// Types of Tcl_Objs used to cache variable lookups.
//
// localVarName - INTERNALREP DEFINITION:
//   twoPtrValue.ptr1:   pointer to name obj in varFramePtr->localCache
//			  or NULL if it is this same obj
//   twoPtrValue.ptr2: index into locals table
//
// parsedVarName - INTERNALREP DEFINITION:
//   twoPtrValue.ptr1:	pointer to the array name Tcl_Obj, or NULL if it is a
//			scalar variable
//   twoPtrValue.ptr2:	pointer to the element name string (owned by this
//			Tcl_Obj), or NULL if it is a scalar variable

var localVarNameType = Tcl_ObjType{
	Fname:           ts + 71867,
	FfreeIntRepProc: 0, FdupIntRepProc: 0, FupdateStringProc: 0, FsetFromAnyProc: 0,
} /* tclVar.c:232:26 */

var tclParsedVarNameType = Tcl_ObjType{
	Fname:           ts + 71880,
	FfreeIntRepProc: 0, FdupIntRepProc: 0, FupdateStringProc: 0, FsetFromAnyProc: 0,
} /* tclVar.c:237:26 */

// Type of Tcl_Objs used to speed up array searches.
//
// INTERNALREP DEFINITION:
//   twoPtrValue.ptr1:	searchIdNumber (cast to pointer)
//   twoPtrValue.ptr2:	variableNameStartInString (cast to pointer)
//
// Note that the value stored in ptr2 is the offset into the string of the
// start of the variable name and not the address of the variable name itself,
// as this can be safely copied.

var XtclArraySearchType = Tcl_ObjType{
	Fname: ts + 71894, FsetFromAnyProc: 0,
} /* tclVar.c:254:19 */

func XTclVarHashCreateVar(tls *libc.TLS, tablePtr uintptr, key uintptr, newPtr uintptr) uintptr { /* tclVar.c:259:5: */
	var keyPtr uintptr
	var varPtr uintptr

	keyPtr = XTcl_NewStringObj(tls, key, -1)
	(*Tcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount++
	varPtr = sVarHashCreateVar1(tls, tablePtr, keyPtr, newPtr)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = keyPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	return varPtr
}

func sLocateArray(tls *libc.TLS, interp uintptr, name uintptr, varPtrPtr uintptr, isArrayPtr uintptr) int32 { /* tclVar.c:277:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	// var arrayPtr uintptr at bp, 8

	var varPtr uintptr = XTclObjLookupVarEx(tls, interp, name, uintptr(0), 0,
		/*msg*/ uintptr(0) /*createPart1*/, 0 /*createPart2*/, 0, bp)

	if XTclCheckArrayTraces(tls, interp, varPtr, *(*uintptr)(unsafe.Pointer(bp)), name, -1) == TCL_ERROR {
		return TCL_ERROR
	}
	if varPtrPtr != 0 {
		*(*uintptr)(unsafe.Pointer(varPtrPtr)) = varPtr
	}
	if isArrayPtr != 0 {
		*(*int32)(unsafe.Pointer(isArrayPtr)) = libc.Bool32(varPtr != 0 && !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) &&
			(*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_ARRAY != 0)
	}
	return TCL_OK
}

func sNotArrayError(tls *libc.TLS, interp uintptr, name uintptr) int32 { /* tclVar.c:300:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var nameStr uintptr = XTcl_GetString(tls, name)

	XTcl_SetObjResult(tls, interp,
		XTcl_ObjPrintf(tls, ts+71907, libc.VaList(bp, nameStr)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+28451, nameStr, uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// TclCleanupVar --
//
//	This function is called when it looks like it may be OK to free up a
//	variable's storage. If the variable is in a hashtable, its Var
//	structure and hash table entry will be freed along with those of its
//	containing array, if any. This function is called, for example, when
//	a trace on a variable deletes a variable.
//
// Results:
//	None.
//
// Side effects:
//	If the variable (or its containing array) really is dead and in a
//	hashtable, then its Var structure, and possibly its hash table entry,
//	is freed up.
//
//----------------------------------------------------------------------

func sCleanupVar(tls *libc.TLS, varPtr uintptr, arrayPtr uintptr) { /* tclVar.c:335:1: */
	if *(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0) && (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 &&
		!((*Var)(unsafe.Pointer(varPtr)).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0) &&
		(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount == libc.BoolInt32(!((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_DEAD_HASH != 0)) {
		if (*VarInHash)(unsafe.Pointer(varPtr)).FrefCount == 0 {
			XTclpFree(tls, varPtr)
		} else {
			XTcl_DeleteHashEntry(tls, varPtr+24)
		}
	}
	if arrayPtr != uintptr(0) && *(*uintptr)(unsafe.Pointer(arrayPtr + 8)) == uintptr(0) && (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_IN_HASHTABLE != 0 && !((*Var)(unsafe.Pointer(arrayPtr)).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0) && (*VarInHash)(unsafe.Pointer(arrayPtr)).FrefCount == libc.BoolInt32(!((*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_DEAD_HASH != 0)) {
		if (*VarInHash)(unsafe.Pointer(arrayPtr)).FrefCount == 0 {
			XTclpFree(tls, arrayPtr)
		} else {
			XTcl_DeleteHashEntry(tls, arrayPtr+24)
		}
	}
}

func XTclCleanupVar(tls *libc.TLS, varPtr uintptr, arrayPtr uintptr) { /* tclVar.c:362:1: */
	sCleanupVar(tls, varPtr, arrayPtr)
}

//----------------------------------------------------------------------
//
// TclLookupVar --
//
//	This function is used to locate a variable given its name(s). It has
//	been mostly superseded by TclObjLookupVar, it is now only used by the
//	trace code. It is kept in tcl8.5 mainly because it is in the internal
//	stubs table, so that some extension may be calling it.
//
// Results:
//	The return value is a pointer to the variable structure indicated by
//	part1 and part2, or NULL if the variable couldn't be found. If the
//	variable is found, *arrayPtrPtr is filled in with the address of the
//	variable structure for the array that contains the variable (or NULL
//	if the variable is a scalar). If the variable can't be found and
//	either createPart1 or createPart2 are 1, a new as-yet-undefined
//	(VAR_UNDEFINED) variable structure is created, entered into a hash
//	table, and returned.
//
//	If the variable isn't found and creation wasn't specified, or some
//	other error occurs, NULL is returned and an error message is left in
//	the interp's result if TCL_LEAVE_ERR_MSG is set in flags.
//
//	Note: it's possible for the variable returned to be VAR_UNDEFINED even
//	if createPart1 or createPart2 are 1 (these only cause the hash table
//	entry or array to be created). For example, the variable might be a
//	global that has been unset but is still referenced by a procedure, or
//	a variable that has been unset but it only being kept in existence (if
//	VAR_UNDEFINED) by a trace.
//
// Side effects:
//	New hashtable entries may be created if createPart1 or createPart2
//	are 1.
//
//----------------------------------------------------------------------

func XTclLookupVar(tls *libc.TLS, interp uintptr, part1 uintptr, part2 uintptr, flags int32, msg uintptr, createPart1 int32, createPart2 int32, arrayPtrPtr uintptr) uintptr { /* tclVar.c:409:5: */
	var varPtr uintptr
	var part1Ptr uintptr = XTcl_NewStringObj(tls, part1, -1)

	if createPart1 != 0 {
		(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FrefCount++
	}

	varPtr = XTclObjLookupVar(tls, interp, part1Ptr, part2, flags, msg,
		createPart1, createPart2, arrayPtrPtr)

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, part1Ptr)
				} else {
					*(*uintptr)(unsafe.Pointer(part1Ptr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = part1Ptr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, part1Ptr)
		}
	}

	return varPtr
}

//----------------------------------------------------------------------
//
// TclObjLookupVar, TclObjLookupVarEx --
//
//	This function is used by virtually all of the variable code to locate
//	a variable given its name(s). The parsing into array/element
//	components and (if possible) the lookup results are cached in
//	part1Ptr, which is converted to one of the varNameTypes.
//
// Results:
//	The return value is a pointer to the variable structure indicated by
//	part1Ptr and part2, or NULL if the variable couldn't be found. If *
//	the variable is found, *arrayPtrPtr is filled with the address of the
//	variable structure for the array that contains the variable (or NULL
//	if the variable is a scalar). If the variable can't be found and
//	either createPart1 or createPart2 are 1, a new as-yet-undefined
//	(VAR_UNDEFINED) variable structure is created, entered into a hash
//	table, and returned.
//
//	If the variable isn't found and creation wasn't specified, or some
//	other error occurs, NULL is returned and an error message is left in
//	the interp's result if TCL_LEAVE_ERR_MSG is set in flags.
//
//	Note: it's possible for the variable returned to be VAR_UNDEFINED even
//	if createPart1 or createPart2 are 1 (these only cause the hash table
//	entry or array to be created). For example, the variable might be a
//	global that has been unset but is still referenced by a procedure, or
//	a variable that has been unset but it only being kept in existence (if
//	VAR_UNDEFINED) by a trace.
//
// Side effects:
//	New hashtable entries may be created if createPart1 or createPart2
//	are 1. The object part1Ptr is converted to one of localVarNameType,
//	tclNsVarNameType or tclParsedVarNameType and caches as much of the
//	lookup as it can.
//	When createPart1 is 1, callers must IncrRefCount part1Ptr if they
//	plan to DecrRefCount it.
//
//----------------------------------------------------------------------

func XTclObjLookupVar(tls *libc.TLS, interp uintptr, part1Ptr uintptr, part2 uintptr, flags int32, msg uintptr, createPart1 int32, createPart2 int32, arrayPtrPtr uintptr) uintptr { /* tclVar.c:489:5: */
	var part2Ptr uintptr = uintptr(0)
	var resPtr uintptr

	if part2 != 0 {
		part2Ptr = XTcl_NewStringObj(tls, part2, -1)
		if createPart2 != 0 {
			(*Tcl_Obj)(unsafe.Pointer(part2Ptr)).FrefCount++
		}
	}

	resPtr = XTclObjLookupVarEx(tls, interp, part1Ptr, part2Ptr,
		flags, msg, createPart1, createPart2, arrayPtrPtr)

	if part2Ptr != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = part2Ptr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	return resPtr
}

//	When createPart1 is 1, callers must IncrRefCount part1Ptr if they
//	plan to DecrRefCount it.
//	When createPart2 is 1, callers must IncrRefCount part2Ptr if they
//	plan to DecrRefCount it.
func XTclObjLookupVarEx(tls *libc.TLS, interp uintptr, part1Ptr uintptr, part2Ptr uintptr, flags int32, msg uintptr, createPart1 int32, createPart2 int32, arrayPtrPtr uintptr) uintptr { /* tclVar.c:539:5: */
	bp := tls.Alloc(124)
	defer tls.Free(124)

	var iPtr uintptr
	var varPtr uintptr // Points to the variable's in-frame Var
	// structure.
	var part1 uintptr
	// var index int32 at bp+120, 4

	// var len1 int32 at bp+104, 4

	var len2 int32
	var parsed int32
	var objPtr uintptr
	var typePtr uintptr
	// var errMsg uintptr at bp+112, 8

	var varFramePtr uintptr
	var part2 uintptr
	var newPart2 uintptr
	// Use the cached index if the names coincide.

	var namePtr uintptr
	var checkNamePtr uintptr
	var localIndex int32
	var cachePtr uintptr
	// part1Ptr is possibly an unparsed array element.

	var i int32
	var _objPtr uintptr
	// An indexed local variable.
	var cachedNamePtr uintptr
	var _objPtr1 uintptr
	iPtr = interp
	parsed = 0
	typePtr = (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr
	*(*uintptr)(unsafe.Pointer(bp + 112 /* errMsg */)) = uintptr(0)
	varFramePtr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	if part2Ptr != 0 {
		part2 = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(part2Ptr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(part2Ptr)).Fbytes
			}
			return XTcl_GetString(tls, part2Ptr)
		}()
	} else {
		part2 = uintptr(0)
	}
	newPart2 = uintptr(0)
	*(*uintptr)(unsafe.Pointer(arrayPtrPtr)) = uintptr(0)

	if !(typePtr == uintptr(unsafe.Pointer(&localVarNameType))) {
		goto __1
	}

localVarNameTypeHandling:
	localIndex = int32(*(*uintptr)(unsafe.Pointer(part1Ptr + 32 + 8)))
	if !((*CallFrame)(unsafe.Pointer(varFramePtr)).FisProcCallFrame&FRAME_IS_PROC != 0 &&
		!(flags&(TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY) != 0) &&
		localIndex < (*CallFrame)(unsafe.Pointer(varFramePtr)).FnumCompiledLocals) {
		goto __2
	}
	// Use the cached index if the names coincide.

	namePtr = *(*uintptr)(unsafe.Pointer(part1Ptr + 32))
	checkNamePtr = *(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr + 8 + uintptr(localIndex)*8))

	if !(!(namePtr != 0) && checkNamePtr == part1Ptr || namePtr != 0 && checkNamePtr == namePtr) {
		goto __3
	}
	varPtr = (*CallFrame)(unsafe.Pointer(varFramePtr)).FcompiledLocals + uintptr(localIndex)*16
	goto donePart1
__3:
	;
__2:
	;
	goto doneParsing
__1:
	;

	// If part1Ptr is a tclParsedVarNameType, separate it into the pre-parsed
	// parts.

	if !(typePtr == uintptr(unsafe.Pointer(&tclParsedVarNameType))) {
		goto __4
	}
	if !(*(*uintptr)(unsafe.Pointer(part1Ptr + 32)) != uintptr(0)) {
		goto __5
	}
	if !(part2Ptr != uintptr(0)) {
		goto __6
	}
	// ERROR: part1Ptr is already an array element, cannot specify
	// a part2.

	if !(flags&TCL_LEAVE_ERR_MSG != 0) {
		goto __7
	}
	XTclObjVarErrMsg(tls, interp, part1Ptr, part2Ptr, msg,
		uintptr(unsafe.Pointer(&sNOSUCHVAR)), -1)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+6915, ts+71927, uintptr(0)))
__7:
	;
	return uintptr(0)
__6:
	;
	part2 = libc.AssignUintptr(&newPart2, *(*uintptr)(unsafe.Pointer(part1Ptr + 32 + 8 /* &.ptr2 */)))
	if !(newPart2 != 0) {
		goto __8
	}
	part2Ptr = XTcl_NewStringObj(tls, newPart2, -1)
	if !(createPart2 != 0) {
		goto __9
	}
	(*Tcl_Obj)(unsafe.Pointer(part2Ptr)).FrefCount++
__9:
	;
__8:
	;
	part1Ptr = *(*uintptr)(unsafe.Pointer(part1Ptr + 32))
	typePtr = (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr
	if !(typePtr == uintptr(unsafe.Pointer(&localVarNameType))) {
		goto __10
	}
	goto localVarNameTypeHandling
__10:
	;
__5:
	;
	parsed = 1
__4:
	;
	part1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp + 104)) = (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, part1Ptr, bp+104)
	}()

	if !(!(parsed != 0) && *(*int32)(unsafe.Pointer(bp + 104)) != 0 && int32(*(*int8)(unsafe.Pointer(part1 + uintptr(*(*int32)(unsafe.Pointer(bp + 104))) - uintptr(1)))) == ')') {
		goto __11
	}

	len2 = -1
	i = 0
__12:
	if !(i < *(*int32)(unsafe.Pointer(bp + 104))) {
		goto __14
	}
	if !(int32(*(*int8)(unsafe.Pointer(part1 + uintptr(i)))) == '(') {
		goto __15
	}
	if !(part2Ptr != uintptr(0)) {
		goto __16
	}
	if !(flags&TCL_LEAVE_ERR_MSG != 0) {
		goto __17
	}
	XTclObjVarErrMsg(tls, interp, part1Ptr, part2Ptr, msg,
		uintptr(unsafe.Pointer(&sNEEDARRAY)), -1)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+6915, ts+71927,
		uintptr(0)))
__17:
	;
	return uintptr(0)
__16:
	;

	// part1Ptr points to an array element; first copy the element
	// name to a new string part2.

	part2 = part1 + uintptr(i) + uintptr(1)
	len2 = *(*int32)(unsafe.Pointer(bp + 104)) - i - 2
	*(*int32)(unsafe.Pointer(bp + 104 /* len1 */)) = i

	newPart2 = XTcl_Alloc(tls, uint32(len2+1))
	libc.Xmemcpy(tls, newPart2, part2, uint64(len2))
	*(*int8)(unsafe.Pointer(newPart2 + uintptr(len2))) = int8(0)
	part2 = newPart2
	part2Ptr = XTcl_NewStringObj(tls, newPart2, -1)
	if !(createPart2 != 0) {
		goto __18
	}
	(*Tcl_Obj)(unsafe.Pointer(part2Ptr)).FrefCount++
__18:
	;

	// Free the internal rep of the original part1Ptr, now renamed
	// objPtr, and set it to tclParsedVarNameType.

	objPtr = part1Ptr
	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __19
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __20
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__20:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__19:
	;

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&tclParsedVarNameType))

	// Define a new string object to hold the new part1Ptr, i.e.,
	// the array name. Set the internal rep of objPtr, reset
	// typePtr and part1 to contain the references to the array
	// name.

__21:
	;
__24:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __27
	}
	part1Ptr = XTclThreadAllocObj(tls)
	goto __28
__27:
	part1Ptr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(part1Ptr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__28:
	;
	goto __25
__25:
	if 0 != 0 {
		goto __24
	}
	goto __26
__26:
	;
	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FrefCount = 0
	if !(*(*int32)(unsafe.Pointer(bp + 104)) == 0) {
		goto __29
	}
	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Flength = 0
	goto __30
__29:
	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes = XTcl_Alloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 104))+1))
	libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes, part1, uint64(*(*int32)(unsafe.Pointer(bp + 104))))
	*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes + uintptr(*(*int32)(unsafe.Pointer(bp + 104))))) = int8(0)
	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Flength = *(*int32)(unsafe.Pointer(bp + 104))
__30:
	;
	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr = uintptr(0)

	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FrefCount++

	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = part1Ptr
	*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = part2

	typePtr = (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr
	part1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes
		}
		return XTcl_GetString(tls, part1Ptr)
	}()
	goto __14
__15:
	;
	goto __13
__13:
	i++
	goto __12
	goto __14
__14:
	;
__11:
	;

doneParsing:
	// part1Ptr is not an array element; look it up, and convert it to one of
	// the cached types if possible.

	if !((*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr != uintptr(0)) {
		goto __31
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __32
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr)).FfreeIntRepProc})).f(tls, part1Ptr)
__32:
	;
	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr = uintptr(0)
__31:
	;

	varPtr = XTclLookupSimpleVar(tls, interp, part1Ptr, flags, createPart1,
		bp+112, bp+120)
	if !(varPtr == uintptr(0)) {
		goto __33
	}
	if !(*(*uintptr)(unsafe.Pointer(bp + 112)) != uintptr(0) && flags&TCL_LEAVE_ERR_MSG != 0) {
		goto __34
	}
	XTclObjVarErrMsg(tls, interp, part1Ptr, part2Ptr, msg, *(*uintptr)(unsafe.Pointer(bp + 112 /* errMsg */)), -1)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+7170, ts+71927,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes
			}
			return XTcl_GetString(tls, part1Ptr)
		}(), uintptr(0)))
__34:
	;
	if !(newPart2 != 0) {
		goto __35
	}
__36:
	_objPtr = part2Ptr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __39
	}
	XTclFreeObj(tls, _objPtr)
__39:
	;
	goto __37
__37:
	if 0 != 0 {
		goto __36
	}
	goto __38
__38:
	;
__35:
	;
	return uintptr(0)
__33:
	;

	// Cache the newly found variable if possible.

	if !(*(*int32)(unsafe.Pointer(bp + 120)) >= 0) {
		goto __40
	}
	// An indexed local variable.
	cachedNamePtr = *(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr + 8 + uintptr(*(*int32)(unsafe.Pointer(bp + 120)))*8))

	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr = uintptr(unsafe.Pointer(&localVarNameType))
	if !(part1Ptr != cachedNamePtr) {
		goto __42
	}
	*(*uintptr)(unsafe.Pointer(part1Ptr + 32)) = cachedNamePtr
	(*Tcl_Obj)(unsafe.Pointer(cachedNamePtr)).FrefCount++
	if !((*Tcl_Obj)(unsafe.Pointer(cachedNamePtr)).FtypePtr != uintptr(unsafe.Pointer(&localVarNameType)) ||
		*(*uintptr)(unsafe.Pointer(cachedNamePtr + 32)) != uintptr(0)) {
		goto __44
	}
	if !((*Tcl_Obj)(unsafe.Pointer(cachedNamePtr)).FtypePtr != uintptr(0)) {
		goto __45
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(cachedNamePtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __46
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(cachedNamePtr)).FtypePtr)).FfreeIntRepProc})).f(tls, cachedNamePtr)
__46:
	;
	(*Tcl_Obj)(unsafe.Pointer(cachedNamePtr)).FtypePtr = uintptr(0)
__45:
	;

__44:
	;
	goto __43
__42:
	*(*uintptr)(unsafe.Pointer(part1Ptr + 32)) = uintptr(0)
__43:
	;
	*(*uintptr)(unsafe.Pointer(part1Ptr + 32 + 8 /* &.ptr2 */)) = uintptr(Intptr_t(*(*int32)(unsafe.Pointer(bp + 120))))
	goto __41
__40:
	// At least mark part1Ptr as already parsed.

	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FtypePtr = uintptr(unsafe.Pointer(&tclParsedVarNameType))
	*(*uintptr)(unsafe.Pointer(part1Ptr + 32)) = uintptr(0)
	*(*uintptr)(unsafe.Pointer(part1Ptr + 32 + 8 /* &.ptr2 */)) = uintptr(0)
__41:
	;

donePart1:
__47:
	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_LINK != 0) {
		goto __48
	}
	varPtr = *(*uintptr)(unsafe.Pointer(varPtr + 8))
	goto __47
__48:
	;

	if !(part2Ptr != uintptr(0)) {
		goto __49
	}
	// Array element sought: look it up.

	*(*uintptr)(unsafe.Pointer(arrayPtrPtr)) = varPtr
	varPtr = XTclLookupArrayElement(tls, interp, part1Ptr, part2Ptr, flags, msg,
		createPart1, createPart2, varPtr, -1)
	if !(newPart2 != 0) {
		goto __50
	}
__51:
	_objPtr1 = part2Ptr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __54
	}
	XTclFreeObj(tls, _objPtr1)
__54:
	;
	goto __52
__52:
	if 0 != 0 {
		goto __51
	}
	goto __53
__53:
	;
__50:
	;
__49:
	;
	return varPtr
}

//----------------------------------------------------------------------
//
// TclLookupSimpleVar --
//
//	This function is used by to locate a simple variable (i.e., not an
//	array element) given its name.
//
// Results:
//	The return value is a pointer to the variable structure indicated by
//	varName, or NULL if the variable couldn't be found. If the variable
//	can't be found and create is 1, a new as-yet-undefined (VAR_UNDEFINED)
//	variable structure is created, entered into a hash table, and
//	returned.
//
//	If the current CallFrame corresponds to a proc and the variable found
//	is one of the compiledLocals, its index is placed in *indexPtr.
//	Otherwise, *indexPtr will be set to (according to the needs of
//	TclObjLookupVar):
//	    -1 a global reference
//	    -2 a reference to a namespace variable
//	    -3 a non-cachable reference, i.e., one of:
//		. non-indexed local var
//		. a reference of unknown origin;
//		. resolution by a namespace or interp resolver
//
//	If the variable isn't found and creation wasn't specified, or some
//	other error occurs, NULL is returned and the corresponding error
//	message is left in *errMsgPtr.
//
//	Note: it's possible for the variable returned to be VAR_UNDEFINED even
//	if create is 1 (this only causes the hash table entry to be created).
//	For example, the variable might be a global that has been unset but is
//	still referenced by a procedure, or a variable that has been unset but
//	it only being kept in existence (if VAR_UNDEFINED) by a trace.
//
// Side effects:
//	A new hashtable entry may be created if create is 1.
//	Callers must Incr varNamePtr if they plan to Decr it if create is 1.
//
//----------------------------------------------------------------------

func XTclLookupSimpleVar(tls *libc.TLS, interp uintptr, varNamePtr uintptr, flags int32, create int32, errMsgPtr uintptr, indexPtr uintptr) uintptr { /* tclVar.c:822:5: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	var iPtr uintptr = interp
	var varFramePtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	// Points to the procedure call frame whose
	// variables are currently in use. Same as the
	// current procedure's frame, if any, unless
	// an "uplevel" is executing.
	var tablePtr uintptr // Points to the hashtable, if any, in which
	// to look up the variable.
	// var var1 Tcl_Var at bp+8, 8
	// Used to search for global names.
	var varPtr uintptr // Points to the Var structure returned for
	// the variable.
	// var varNsPtr uintptr at bp+16, 8

	var cxtNsPtr uintptr
	// var dummy1Ptr uintptr at bp+24, 8

	// var dummy2Ptr uintptr at bp+32, 8

	var resPtr uintptr
	// var isNew int32 at bp+48, 4

	var i int32
	var result int32
	// var varLen int32 at bp, 4

	var varName uintptr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, varNamePtr, bp)
	}()

	varPtr = uintptr(0)
	*(*uintptr)(unsafe.Pointer(bp + 16 /* varNsPtr */)) = uintptr(0) // Set non-NULL if a nonlocal variable.
	*(*int32)(unsafe.Pointer(indexPtr)) = -3

	if flags&TCL_GLOBAL_ONLY != 0 {
		cxtNsPtr = (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr
	} else {
		cxtNsPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr
	}

	// If this namespace has a variable resolver, then give it first crack at
	// the variable resolution. It may return a Tcl_Var value, it may signal
	// to continue onward, or it may signal an error.

	if ((*Namespace)(unsafe.Pointer(cxtNsPtr)).FvarResProc != uintptr(0) || (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr != uintptr(0)) &&
		!(flags&TCL_AVOID_RESOLVERS != 0) {
		resPtr = (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr
		if (*Namespace)(unsafe.Pointer(cxtNsPtr)).FvarResProc != 0 {
			result = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
			})(unsafe.Pointer(&struct{ uintptr }{(*Namespace)(unsafe.Pointer(cxtNsPtr)).FvarResProc})).f(tls, interp, varName,
				cxtNsPtr, flags, bp+8)
		} else {
			result = TCL_CONTINUE
		}

		for result == TCL_CONTINUE && resPtr != 0 {
			if (*ResolverScheme)(unsafe.Pointer(resPtr)).FvarResProc != 0 {
				result = (*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
				})(unsafe.Pointer(&struct{ uintptr }{(*ResolverScheme)(unsafe.Pointer(resPtr)).FvarResProc})).f(tls, interp, varName,
					cxtNsPtr, flags, bp+8 /* &var1 */)
			}
			resPtr = (*ResolverScheme)(unsafe.Pointer(resPtr)).FnextPtr
		}

		if result == TCL_OK {
			return *(*Tcl_Var)(unsafe.Pointer(bp + 8 /* var1 */))
		} else if result != TCL_CONTINUE {
			return uintptr(0)
		}
	}

	// Look up varName. Look it up as either a namespace variable or as a
	// local variable in a procedure call frame (varFramePtr). Interpret
	// varName as a namespace variable if:
	//    1) so requested by a TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY flag,
	//    2) there is no active frame (we're at the global :: scope),
	//    3) the active frame was pushed to define the namespace context for a
	//	     "namespace eval" or "namespace inscope" command,
	//    4) the name has namespace qualifiers ("::"s).
	// Otherwise, if varName is a local variable, search first in the frame's
	// array of compiler-allocated local variables, then in its hashtable for
	// runtime-created local variables.
	//
	// If create and the variable isn't found, create the variable and, if
	// necessary, create varFramePtr's local var hashtable.

	if flags&(TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY) != 0 ||
		!((*CallFrame)(unsafe.Pointer(varFramePtr)).FisProcCallFrame&FRAME_IS_PROC != 0) ||
		libc.Xstrstr(tls, varName, ts+6847) != uintptr(0) {
		// var tail uintptr at bp+40, 8

		var lookGlobal int32 = libc.Bool32(flags&TCL_GLOBAL_ONLY != 0 ||
			cxtNsPtr == (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr ||
			int32(*(*int8)(unsafe.Pointer(varName))) == ':' && int32(*(*int8)(unsafe.Pointer(varName + uintptr(1)))) == ':')

		if lookGlobal != 0 {
			*(*int32)(unsafe.Pointer(indexPtr)) = -1
			flags = (flags | TCL_GLOBAL_ONLY) & libc.CplInt32(TCL_NAMESPACE_ONLY)
		} else {
			if flags&TCL_AVOID_RESOLVERS != 0 {
				flags = flags | TCL_NAMESPACE_ONLY
			}
			if flags&TCL_NAMESPACE_ONLY != 0 {
				*(*int32)(unsafe.Pointer(indexPtr)) = -2
			}
		}

		// Don't pass TCL_LEAVE_ERR_MSG, we may yet create the variable, or
		// otherwise generate our own error!

		varPtr = sObjFindNamespaceVar(tls, interp, varNamePtr,
			cxtNsPtr,
			(flags|TCL_AVOID_RESOLVERS)&libc.CplInt32(TCL_LEAVE_ERR_MSG))
		if varPtr == uintptr(0) {
			var tailPtr uintptr

			if create != 0 { // Var wasn't found so create it.
				XTclGetNamespaceForQualName(tls, interp, varName, cxtNsPtr,
					flags, bp+16, bp+24, bp+32, bp+40)
				if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) {
					*(*uintptr)(unsafe.Pointer(errMsgPtr)) = uintptr(unsafe.Pointer(&sBADNAMESPACE))
					return uintptr(0)
				} else if *(*uintptr)(unsafe.Pointer(bp + 40)) == uintptr(0) {
					*(*uintptr)(unsafe.Pointer(errMsgPtr)) = uintptr(unsafe.Pointer(&sMISSINGNAME))
					return uintptr(0)
				}
				if *(*uintptr)(unsafe.Pointer(bp + 40)) != varName {
					tailPtr = XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* tail */)), -1)
				} else {
					tailPtr = varNamePtr
				}
				varPtr = sVarHashCreateVar1(tls, *(*uintptr)(unsafe.Pointer(bp + 16))+248, tailPtr,
					bp+48)
				if lookGlobal != 0 {
					// The variable was created starting from the global
					// namespace: a global reference is returned even if it
					// wasn't explicitly requested.

					*(*int32)(unsafe.Pointer(indexPtr)) = -1
				} else {
					*(*int32)(unsafe.Pointer(indexPtr)) = -2
				}
			} else { // Var wasn't found and not to create it.
				*(*uintptr)(unsafe.Pointer(errMsgPtr)) = uintptr(unsafe.Pointer(&sNOSUCHVAR))
				return uintptr(0)
			}
		}
	} else { // Local var: look in frame varFramePtr.
		var localCt int32 = (*CallFrame)(unsafe.Pointer(varFramePtr)).FnumCompiledLocals

		if localCt > 0 {
			var objPtrPtr uintptr = (*CallFrame)(unsafe.Pointer(varFramePtr)).FlocalCachePtr + 8
			var localNameStr uintptr
			// var localLen int32 at bp+52, 4

			i = 0
		__1:
			if !(i < localCt) {
				goto __3
			}
			{
				var objPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtrPtr))

				if objPtr != 0 {
					localNameStr = func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
							return func() uintptr {
								*(*int32)(unsafe.Pointer(bp + 52)) = (*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength
								return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
							}()
						}
						return XTcl_GetStringFromObj(tls, objPtr, bp+52)
					}()

					if *(*int32)(unsafe.Pointer(bp)) == *(*int32)(unsafe.Pointer(bp + 52)) && int32(*(*int8)(unsafe.Pointer(varName))) == int32(*(*int8)(unsafe.Pointer(localNameStr))) &&
						!(libc.Xmemcmp(tls, varName, localNameStr, uint64(*(*int32)(unsafe.Pointer(bp)))) != 0) {
						*(*int32)(unsafe.Pointer(indexPtr)) = i
						return (*CallFrame)(unsafe.Pointer(varFramePtr)).FcompiledLocals + uintptr(i)*16
					}
				}

			}
			goto __2
		__2:
			i++
			objPtrPtr += 8
			goto __1
			goto __3
		__3:
		}
		tablePtr = (*CallFrame)(unsafe.Pointer(varFramePtr)).FvarTablePtr
		if create != 0 {
			if tablePtr == uintptr(0) {
				tablePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TclVarHashTable{})))
				XTclInitVarHashTable(tls, tablePtr, uintptr(0))
				(*CallFrame)(unsafe.Pointer(varFramePtr)).FvarTablePtr = tablePtr
			}
			varPtr = sVarHashCreateVar1(tls, tablePtr, varNamePtr, bp+48)
		} else {
			varPtr = uintptr(0)
			if tablePtr != uintptr(0) {
				varPtr = sVarHashCreateVar1(tls, tablePtr, varNamePtr, uintptr(0))
			}
			if varPtr == uintptr(0) {
				*(*uintptr)(unsafe.Pointer(errMsgPtr)) = uintptr(unsafe.Pointer(&sNOSUCHVAR))
			}
		}
	}
	return varPtr
}

//----------------------------------------------------------------------
//
// TclLookupArrayElement --
//
//	This function is used to locate a variable which is in an array's
//	hashtable given a pointer to the array's Var structure and the
//	element's name.
//
// Results:
//	The return value is a pointer to the variable structure , or NULL if
//	the variable couldn't be found.
//
//	If arrayPtr points to a variable that isn't an array and createPart1
//	is 1, the corresponding variable will be converted to an array.
//	Otherwise, NULL is returned and an error message is left in the
//	interp's result if TCL_LEAVE_ERR_MSG is set in flags.
//
//	If the variable is not found and createPart2 is 1, the variable is
//	created. Otherwise, NULL is returned and an error message is left in
//	the interp's result if TCL_LEAVE_ERR_MSG is set in flags.
//
//	Note: it's possible for the variable returned to be VAR_UNDEFINED even
//	if createPart1 or createPart2 are 1 (these only cause the hash table
//	entry or array to be created). For example, the variable might be a
//	global that has been unset but is still referenced by a procedure, or
//	a variable that has been unset but it only being kept in existence (if
//	VAR_UNDEFINED) by a trace.
//
// Side effects:
//	The variable at arrayPtr may be converted to be an array if
//	createPart1 is 1. A new hashtable entry may be created if createPart2
//	is 1.
//	When createElem is 1, callers must incr elNamePtr if they plan
//	to decr it.
//
//----------------------------------------------------------------------

func XTclLookupArrayElement(tls *libc.TLS, interp uintptr, arrayNamePtr uintptr, elNamePtr uintptr, flags int32, msg uintptr, createArray int32, createElem int32, arrayPtr uintptr, index int32) uintptr { /* tclVar.c:1056:5: */
	bp := tls.Alloc(164)
	defer tls.Free(164)

	// var isNew int32 at bp+160, 4

	var varPtr uintptr
	var tablePtr uintptr
	var nsPtr uintptr

	// We're dealing with an array element. Make sure the variable is an array
	// and look up the element (create the element if desired).

	if *(*uintptr)(unsafe.Pointer(arrayPtr + 8)) == uintptr(0) && !((*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_ARRAY_ELEMENT != 0) {
		if !(createArray != 0) {
			if flags&TCL_LEAVE_ERR_MSG != 0 {
				XTclObjVarErrMsg(tls, interp, arrayNamePtr, elNamePtr, msg,
					uintptr(unsafe.Pointer(&sNOSUCHVAR)), index)
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7170, ts+71927,
					func() uintptr {
						if arrayNamePtr != 0 {
							return func() uintptr {
								if (*Tcl_Obj)(unsafe.Pointer(arrayNamePtr)).Fbytes != 0 {
									return (*Tcl_Obj)(unsafe.Pointer(arrayNamePtr)).Fbytes
								}
								return XTcl_GetString(tls, arrayNamePtr)
							}()
						}
						return uintptr(0)
					}(), uintptr(0)))
			}
			return uintptr(0)
		}

		// Make sure we are not resurrecting a namespace variable from a
		// deleted namespace!

		if (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_DEAD_HASH != 0 {
			if flags&TCL_LEAVE_ERR_MSG != 0 {
				XTclObjVarErrMsg(tls, interp, arrayNamePtr, elNamePtr, msg,
					uintptr(unsafe.Pointer(&sDANGLINGVAR)), index)
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7170, ts+71927,
					func() uintptr {
						if arrayNamePtr != 0 {
							return func() uintptr {
								if (*Tcl_Obj)(unsafe.Pointer(arrayNamePtr)).Fbytes != 0 {
									return (*Tcl_Obj)(unsafe.Pointer(arrayNamePtr)).Fbytes
								}
								return XTcl_GetString(tls, arrayNamePtr)
							}()
						}
						return uintptr(0)
					}(), uintptr(0)))
			}
			return uintptr(0)
		}

		(*Var)(unsafe.Pointer(arrayPtr)).Fflags = (*Var)(unsafe.Pointer(arrayPtr)).Fflags&libc.CplInt32(VAR_LINK) | VAR_ARRAY
		tablePtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TclVarHashTable{})))
		*(*uintptr)(unsafe.Pointer(arrayPtr + 8)) = tablePtr

		if (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_IN_HASHTABLE != 0 && func() uintptr {
			if (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
				return (*TclVarHashTable)(unsafe.Pointer((*VarInHash)(unsafe.Pointer(arrayPtr)).Fentry.FtablePtr)).FnsPtr
			}
			return uintptr(0)
		}() != 0 {
			nsPtr = func() uintptr {
				if (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
					return (*TclVarHashTable)(unsafe.Pointer((*VarInHash)(unsafe.Pointer(arrayPtr)).Fentry.FtablePtr)).FnsPtr
				}
				return uintptr(0)
			}()
		} else {
			nsPtr = uintptr(0)
		}
		XTclInitVarHashTable(tls, *(*uintptr)(unsafe.Pointer(arrayPtr + 8)), nsPtr)
	} else if !((*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_ARRAY != 0) {
		if flags&TCL_LEAVE_ERR_MSG != 0 {
			XTclObjVarErrMsg(tls, interp, arrayNamePtr, elNamePtr, msg, uintptr(unsafe.Pointer(&sNEEDARRAY)),
				index)
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, ts+3593, ts+7170, ts+71927,
				func() uintptr {
					if arrayNamePtr != 0 {
						return func() uintptr {
							if (*Tcl_Obj)(unsafe.Pointer(arrayNamePtr)).Fbytes != 0 {
								return (*Tcl_Obj)(unsafe.Pointer(arrayNamePtr)).Fbytes
							}
							return XTcl_GetString(tls, arrayNamePtr)
						}()
					}
					return uintptr(0)
				}(), uintptr(0)))
		}
		return uintptr(0)
	}

	if createElem != 0 {
		varPtr = sVarHashCreateVar1(tls, *(*uintptr)(unsafe.Pointer(arrayPtr + 8)), elNamePtr,
			bp+160)
		if *(*int32)(unsafe.Pointer(bp + 160)) != 0 {
			if (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_SEARCH_ACTIVE != 0 {
				sDeleteSearches(tls, interp, arrayPtr)
			}
			(*Var)(unsafe.Pointer(varPtr)).Fflags = (*Var)(unsafe.Pointer(varPtr)).Fflags&libc.CplInt32(VAR_ARRAY) | VAR_ARRAY_ELEMENT
		}
	} else {
		varPtr = sVarHashCreateVar1(tls, *(*uintptr)(unsafe.Pointer(arrayPtr + 8)), elNamePtr, uintptr(0))
		if varPtr == uintptr(0) {
			if flags&TCL_LEAVE_ERR_MSG != 0 {
				XTclObjVarErrMsg(tls, interp, arrayNamePtr, elNamePtr, msg,
					uintptr(unsafe.Pointer(&sNOSUCHELEMENT)), index)
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+120, ts+3593, ts+7170, ts+71935,
					func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(elNamePtr)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(elNamePtr)).Fbytes
						}
						return XTcl_GetString(tls, elNamePtr)
					}(), uintptr(0)))
			}
		}
	}
	return varPtr
}

//----------------------------------------------------------------------
//
// Tcl_GetVar --
//
//	Return the value of a Tcl variable as a string.
//
// Results:
//	The return value points to the current value of varName as a string.
//	If the variable is not defined or can't be read because of a clash in
//	array usage then a NULL pointer is returned and an error message is
//	left in the interp's result if the TCL_LEAVE_ERR_MSG flag is set.
//	Note: the return value is only valid up until the next change to the
//	variable; if you depend on the value lasting longer than that, then
//	make yourself a private copy.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetVar(tls *libc.TLS, interp uintptr, varName uintptr, flags int32) uintptr { /* tclVar.c:1178:12: */
	var varNamePtr uintptr = XTcl_NewStringObj(tls, varName, -1)
	var resultPtr uintptr = XTcl_ObjGetVar2(tls, interp, varNamePtr, uintptr(0), flags)

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(varNamePtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(varNamePtr)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, varNamePtr)
				} else {
					*(*uintptr)(unsafe.Pointer(varNamePtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = varNamePtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, varNamePtr)
		}
	}

	if resultPtr == uintptr(0) {
		return uintptr(0)
	}
	return func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes
		}
		return XTcl_GetString(tls, resultPtr)
	}()
}

//----------------------------------------------------------------------
//
// Tcl_GetVar2 --
//
//	Return the value of a Tcl variable as a string, given a two-part name
//	consisting of array name and element within array.
//
// Results:
//	The return value points to the current value of the variable given by
//	part1 and part2 as a string. If the specified variable doesn't exist,
//	or if there is a clash in array usage, then NULL is returned and a
//	message will be left in the interp's result if the TCL_LEAVE_ERR_MSG
//	flag is set. Note: the return value is only valid up until the next
//	change to the variable; if you depend on the value lasting longer than
//	that, then make yourself a private copy.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_GetVar2(tls *libc.TLS, interp uintptr, part1 uintptr, part2 uintptr, flags int32) uintptr { /* tclVar.c:1221:12: */
	var resultPtr uintptr
	var part2Ptr uintptr = uintptr(0)
	var part1Ptr uintptr = XTcl_NewStringObj(tls, part1, -1)

	if part2 != 0 {
		part2Ptr = XTcl_NewStringObj(tls, part2, -1)
		(*Tcl_Obj)(unsafe.Pointer(part2Ptr)).FrefCount++
	}

	resultPtr = XTcl_ObjGetVar2(tls, interp, part1Ptr, part2Ptr, flags)

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = part1Ptr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if part2Ptr != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = part2Ptr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if resultPtr == uintptr(0) {
		return uintptr(0)
	}
	return func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes
		}
		return XTcl_GetString(tls, resultPtr)
	}()
}

//----------------------------------------------------------------------
//
// Tcl_GetVar2Ex --
//
//	Return the value of a Tcl variable as a Tcl object, given a two-part
//	name consisting of array name and element within array.
//
// Results:
//	The return value points to the current object value of the variable
//	given by part1Ptr and part2Ptr. If the specified variable doesn't
//	exist, or if there is a clash in array usage, then NULL is returned
//	and a message will be left in the interpreter's result if the
//	TCL_LEAVE_ERR_MSG flag is set.
//
// Side effects:
//	The ref count for the returned object is _not_ incremented to reflect
//	the returned reference; if you want to keep a reference to the object
//	you must increment its ref count yourself.
//
//----------------------------------------------------------------------

func XTcl_GetVar2Ex(tls *libc.TLS, interp uintptr, part1 uintptr, part2 uintptr, flags int32) uintptr { /* tclVar.c:1276:9: */
	var resPtr uintptr
	var part2Ptr uintptr = uintptr(0)
	var part1Ptr uintptr = XTcl_NewStringObj(tls, part1, -1)

	if part2 != 0 {
		part2Ptr = XTcl_NewStringObj(tls, part2, -1)
		(*Tcl_Obj)(unsafe.Pointer(part2Ptr)).FrefCount++
	}

	resPtr = XTcl_ObjGetVar2(tls, interp, part1Ptr, part2Ptr, flags)

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = part1Ptr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if part2Ptr != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = part2Ptr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	return resPtr
}

//----------------------------------------------------------------------
//
// Tcl_ObjGetVar2 --
//
//	Return the value of a Tcl variable as a Tcl object, given a two-part
//	name consisting of array name and element within array.
//
// Results:
//	The return value points to the current object value of the variable
//	given by part1Ptr and part2Ptr. If the specified variable doesn't
//	exist, or if there is a clash in array usage, then NULL is returned
//	and a message will be left in the interpreter's result if the
//	TCL_LEAVE_ERR_MSG flag is set.
//
// Side effects:
//	The ref count for the returned object is _not_ incremented to reflect
//	the returned reference; if you want to keep a reference to the object
//	you must increment its ref count yourself.
//
//	Callers must incr part2Ptr if they plan to decr it.
//
//----------------------------------------------------------------------

func XTcl_ObjGetVar2(tls *libc.TLS, interp uintptr, part1Ptr uintptr, part2Ptr uintptr, flags int32) uintptr { /* tclVar.c:1329:9: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var varPtr uintptr
	// var arrayPtr uintptr at bp, 8

	// Filter to pass through only the flags this interface supports.

	flags = flags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG)
	varPtr = XTclObjLookupVarEx(tls, interp, part1Ptr, part2Ptr, flags, ts+5472,
		/*createPart1*/ 0 /*createPart2*/, 1, bp)
	if varPtr == uintptr(0) {
		return uintptr(0)
	}

	return XTclPtrGetVarIdx(tls, interp, varPtr, *(*uintptr)(unsafe.Pointer(bp /* arrayPtr */)), part1Ptr, part2Ptr,
		flags, -1)
}

//----------------------------------------------------------------------
//
// TclPtrGetVar --
//
//	Return the value of a Tcl variable as a Tcl object, given the pointers
//	to the variable's (and possibly containing array's) VAR structure.
//
// Results:
//	The return value points to the current object value of the variable
//	given by varPtr. If the specified variable doesn't exist, or if there
//	is a clash in array usage, then NULL is returned and a message will be
//	left in the interpreter's result if the TCL_LEAVE_ERR_MSG flag is set.
//
// Side effects:
//	The ref count for the returned object is _not_ incremented to reflect
//	the returned reference; if you want to keep a reference to the object
//	you must increment its ref count yourself.
//
//----------------------------------------------------------------------

func XTclPtrGetVar(tls *libc.TLS, interp uintptr, varPtr Tcl_Var, arrayPtr Tcl_Var, part1Ptr uintptr, part2Ptr uintptr, flags int32) uintptr { /* tclVar.c:1381:9: */
	if varPtr == uintptr(0) {
		XTcl_Panic(tls, ts+71943, 0)
	}
	if part1Ptr == uintptr(0) {
		XTcl_Panic(tls, ts+71967, 0)
	}
	return XTclPtrGetVarIdx(tls, interp, varPtr, arrayPtr,
		part1Ptr, part2Ptr, flags, -1)
}

//----------------------------------------------------------------------
//
// TclPtrGetVarIdx --
//
//	Return the value of a Tcl variable as a Tcl object, given the pointers
//	to the variable's (and possibly containing array's) VAR structure.
//
// Results:
//	The return value points to the current object value of the variable
//	given by varPtr. If the specified variable doesn't exist, or if there
//	is a clash in array usage, then NULL is returned and a message will be
//	left in the interpreter's result if the TCL_LEAVE_ERR_MSG flag is set.
//
// Side effects:
//	The ref count for the returned object is _not_ incremented to reflect
//	the returned reference; if you want to keep a reference to the object
//	you must increment its ref count yourself.
//
//----------------------------------------------------------------------

func XTclPtrGetVarIdx(tls *libc.TLS, interp uintptr, varPtr uintptr, arrayPtr uintptr, part1Ptr uintptr, part2Ptr uintptr, flags int32, index int32) uintptr { /* tclVar.c:1427:9: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var iPtr uintptr
	var msg uintptr
	iPtr = interp

	// Invoke any read traces that have been set for the variable.

	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_TRACED_READ != 0 ||
		arrayPtr != 0 && (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_TRACED_READ != 0) {
		goto __1
	}
	if !(TCL_ERROR == XTclObjCallVarTraces(tls, iPtr, arrayPtr, varPtr,
		part1Ptr, part2Ptr,
		flags&(TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY)|
			TCL_TRACE_READS, flags&TCL_LEAVE_ERR_MSG, index)) {
		goto __2
	}
	goto errorReturn
__2:
	;
__1:
	;

	// Return the element if it's an existing scalar variable.

	if !(!((*Var)(unsafe.Pointer(varPtr)).Fflags&(VAR_ARRAY|VAR_LINK) != 0) && !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0))) {
		goto __3
	}
	return *(*uintptr)(unsafe.Pointer(varPtr + 8))
__3:
	;

	if !(flags&TCL_LEAVE_ERR_MSG != 0) {
		goto __4
	}
	if !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0) && arrayPtr != 0 &&
		!(*(*uintptr)(unsafe.Pointer(arrayPtr + 8)) == uintptr(0))) {
		goto __5
	}
	msg = uintptr(unsafe.Pointer(&sNOSUCHELEMENT))
	goto __6
__5:
	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_ARRAY != 0) {
		goto __7
	}
	msg = uintptr(unsafe.Pointer(&sISARRAY))
	goto __8
__7:
	msg = uintptr(unsafe.Pointer(&sNOSUCHVAR))
__8:
	;
__6:
	;
	XTclObjVarErrMsg(tls, interp, part1Ptr, part2Ptr, ts+5472, msg, index)
__4:
	;

	// An error. If the variable doesn't exist anymore and no-one's using it,
	// then free up the relevant structures and hash table entries.

errorReturn:
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+71993, ts+71927, uintptr(0)))
	if !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) {
		goto __9
	}
	XTclCleanupVar(tls, varPtr, arrayPtr)
__9:
	;
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_SetObjCmd --
//
//	This function is invoked to process the "set" Tcl command. See the
//	user documentation for details on what it does.
//
// Results:
//	A standard Tcl result value.
//
// Side effects:
//	A variable's value may be changed.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_SetObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:1513:1: */
	var varValueObj uintptr

	if objc == 2 {
		varValueObj = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), TCL_LEAVE_ERR_MSG)
		if varValueObj == uintptr(0) {
			return TCL_ERROR
		}
		XTcl_SetObjResult(tls, interp, varValueObj)
		return TCL_OK
	} else if objc == 3 {
		varValueObj = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 2*8)),
			TCL_LEAVE_ERR_MSG)
		if varValueObj == uintptr(0) {
			return TCL_ERROR
		}
		XTcl_SetObjResult(tls, interp, varValueObj)
		return TCL_OK
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+71998)
		return TCL_ERROR
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// Tcl_SetVar --
//
//	Change the value of a variable.
//
// Results:
//	Returns a pointer to the malloc'ed string which is the character
//	representation of the variable's new value. The caller must not modify
//	this string. If the write operation was disallowed then NULL is
//	returned; if the TCL_LEAVE_ERR_MSG flag is set, then an explanatory
//	message will be left in the interp's result. Note that the returned
//	string may not be the same as newValue; this is because variable
//	traces may modify the variable's value.
//
// Side effects:
//	If varName is defined as a local or global variable in interp, its
//	value is changed to newValue. If varName isn't currently defined, then
//	a new global variable by that name is created.
//
//----------------------------------------------------------------------

func XTcl_SetVar(tls *libc.TLS, interp uintptr, varName uintptr, newValue uintptr, flags int32) uintptr { /* tclVar.c:1567:12: */
	var varValuePtr uintptr
	var varNamePtr uintptr = XTcl_NewStringObj(tls, varName, -1)

	(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).FrefCount++
	varValuePtr = XTcl_ObjSetVar2(tls, interp, varNamePtr, uintptr(0),
		XTcl_NewStringObj(tls, newValue, -1), flags)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = varNamePtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}

	if varValuePtr == uintptr(0) {
		return uintptr(0)
	}
	return func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Fbytes
		}
		return XTcl_GetString(tls, varValuePtr)
	}()
}

//----------------------------------------------------------------------
//
// Tcl_SetVar2 --
//
//	Given a two-part variable name, which may refer either to a scalar
//	variable or an element of an array, change the value of the variable.
//	If the named scalar or array or element doesn't exist then create one.
//
// Results:
//	Returns a pointer to the malloc'ed string which is the character
//	representation of the variable's new value. The caller must not modify
//	this string. If the write operation was disallowed because an array
//	was expected but not found (or vice versa), then NULL is returned; if
//	the TCL_LEAVE_ERR_MSG flag is set, then an explanatory message will be
//	left in the interp's result. Note that the returned string may not be
//	the same as newValue; this is because variable traces may modify the
//	variable's value.
//
// Side effects:
//	The value of the given variable is set. If either the array or the
//	entry didn't exist then a new one is created.
//
//----------------------------------------------------------------------

func XTcl_SetVar2(tls *libc.TLS, interp uintptr, part1 uintptr, part2 uintptr, newValue uintptr, flags int32) uintptr { /* tclVar.c:1617:12: */
	var varValuePtr uintptr = XTcl_SetVar2Ex(tls, interp, part1, part2,
		XTcl_NewStringObj(tls, newValue, -1), flags)

	if varValuePtr == uintptr(0) {
		return uintptr(0)
	}
	return func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Fbytes
		}
		return XTcl_GetString(tls, varValuePtr)
	}()
}

//----------------------------------------------------------------------
//
// Tcl_SetVar2Ex --
//
//	Given a two-part variable name, which may refer either to a scalar
//	variable or an element of an array, change the value of the variable
//	to a new Tcl object value. If the named scalar or array or element
//	doesn't exist then create one.
//
// Results:
//	Returns a pointer to the Tcl_Obj holding the new value of the
//	variable. If the write operation was disallowed because an array was
//	expected but not found (or vice versa), then NULL is returned; if the
//	TCL_LEAVE_ERR_MSG flag is set, then an explanatory message will be
//	left in the interpreter's result. Note that the returned object may
//	not be the same one referenced by newValuePtr; this is because
//	variable traces may modify the variable's value.
//
// Side effects:
//	The value of the given variable is set. If either the array or the
//	entry didn't exist then a new variable is created.
//
//	The reference count is decremented for any old value of the variable
//	and incremented for its new value. If the new value for the variable
//	is not the same one referenced by newValuePtr (perhaps as a result of
//	a variable trace), then newValuePtr's ref count is left unchanged by
//	Tcl_SetVar2Ex. newValuePtr's ref count is also left unchanged if we
//	are appending it as a string value: that is, if "flags" includes
//	TCL_APPEND_VALUE but not TCL_LIST_ELEMENT.
//
//	The reference count for the returned object is _not_ incremented: if
//	you want to keep a reference to the object you must increment its ref
//	count yourself.
//
//----------------------------------------------------------------------

func XTcl_SetVar2Ex(tls *libc.TLS, interp uintptr, part1 uintptr, part2 uintptr, newValuePtr uintptr, flags int32) uintptr { /* tclVar.c:1679:9: */
	var resPtr uintptr
	var part2Ptr uintptr = uintptr(0)
	var part1Ptr uintptr = XTcl_NewStringObj(tls, part1, -1)

	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FrefCount++
	if part2 != 0 {
		part2Ptr = XTcl_NewStringObj(tls, part2, -1)
		(*Tcl_Obj)(unsafe.Pointer(part2Ptr)).FrefCount++
	}

	resPtr = XTcl_ObjSetVar2(tls, interp, part1Ptr, part2Ptr, newValuePtr, flags)

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = part1Ptr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if part2Ptr != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = part2Ptr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}

	return resPtr
}

//----------------------------------------------------------------------
//
// Tcl_ObjSetVar2 --
//
//	This function is the same as Tcl_SetVar2Ex above, except the variable
//	names are passed in Tcl object instead of strings.
//
// Results:
//	Returns a pointer to the Tcl_Obj holding the new value of the
//	variable. If the write operation was disallowed because an array was
//	expected but not found (or vice versa), then NULL is returned; if the
//	TCL_LEAVE_ERR_MSG flag is set, then an explanatory message will be
//	left in the interpreter's result. Note that the returned object may
//	not be the same one referenced by newValuePtr; this is because
//	variable traces may modify the variable's value.
//
// Side effects:
//	The value of the given variable is set. If either the array or the
//	entry didn't exist then a new variable is created.
//	Callers must Incr part1Ptr if they plan to Decr it.
//	Callers must Incr part2Ptr if they plan to Decr it.
//
//----------------------------------------------------------------------

func XTcl_ObjSetVar2(tls *libc.TLS, interp uintptr, part1Ptr uintptr, part2Ptr uintptr, newValuePtr uintptr, flags int32) uintptr { /* tclVar.c:1737:9: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var varPtr uintptr
	// var arrayPtr uintptr at bp, 8

	// Filter to pass through only the flags this interface supports.

	flags = flags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG |
		TCL_APPEND_VALUE | TCL_LIST_ELEMENT)
	varPtr = XTclObjLookupVarEx(tls, interp, part1Ptr, part2Ptr, flags, ts+5303,
		/*createPart1*/ 1 /*createPart2*/, 1, bp)
	if varPtr == uintptr(0) {
		if (*Tcl_Obj)(unsafe.Pointer(newValuePtr)).FrefCount == 0 {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = newValuePtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}
		return uintptr(0)
	}

	return XTclPtrSetVarIdx(tls, interp, varPtr, *(*uintptr)(unsafe.Pointer(bp /* arrayPtr */)), part1Ptr, part2Ptr,
		newValuePtr, flags, -1)
}

//----------------------------------------------------------------------
//
// TclPtrSetVar --
//
//	This function is the same as Tcl_SetVar2Ex above, except that it
//	requires pointers to the variable's Var structs in addition to the
//	variable names.
//
// Results:
//	Returns a pointer to the Tcl_Obj holding the new value of the
//	variable. If the write operation was disallowed because an array was
//	expected but not found (or vice versa), then NULL is returned; if the
//	TCL_LEAVE_ERR_MSG flag is set, then an explanatory message will be
//	left in the interpreter's result. Note that the returned object may
//	not be the same one referenced by newValuePtr; this is because
//	variable traces may modify the variable's value.
//
// Side effects:
//	The value of the given variable is set. If either the array or the
//	entry didn't exist then a new variable is created.
//
//----------------------------------------------------------------------

func XTclPtrSetVar(tls *libc.TLS, interp uintptr, varPtr Tcl_Var, arrayPtr Tcl_Var, part1Ptr uintptr, part2Ptr uintptr, newValuePtr uintptr, flags int32) uintptr { /* tclVar.c:1799:9: */
	if varPtr == uintptr(0) {
		XTcl_Panic(tls, ts+71943, 0)
	}
	if part1Ptr == uintptr(0) {
		XTcl_Panic(tls, ts+71967, 0)
	}
	if newValuePtr == uintptr(0) {
		XTcl_Panic(tls, ts+72017, 0)
	}
	return XTclPtrSetVarIdx(tls, interp, varPtr, arrayPtr,
		part1Ptr, part2Ptr, newValuePtr, flags, -1)
}

//----------------------------------------------------------------------
//
// TclPtrSetVarIdx --
//
//	This function is the same as Tcl_SetVar2Ex above, except that it
//	requires pointers to the variable's Var structs in addition to the
//	variable names.
//
// Results:
//	Returns a pointer to the Tcl_Obj holding the new value of the
//	variable. If the write operation was disallowed because an array was
//	expected but not found (or vice versa), then NULL is returned; if the
//	TCL_LEAVE_ERR_MSG flag is set, then an explanatory message will be
//	left in the interpreter's result. Note that the returned object may
//	not be the same one referenced by newValuePtr; this is because
//	variable traces may modify the variable's value.
//
// Side effects:
//	The value of the given variable is set. If either the array or the
//	entry didn't exist then a new variable is created.
//
//----------------------------------------------------------------------

func XTclPtrSetVarIdx(tls *libc.TLS, interp uintptr, varPtr uintptr, arrayPtr uintptr, part1Ptr uintptr, part2Ptr uintptr, newValuePtr uintptr, flags int32, index int32) uintptr { /* tclVar.c:1853:9: */
	bp := tls.Alloc(128)
	defer tls.Free(128)

	var iPtr uintptr
	var oldValuePtr uintptr
	var resultPtr uintptr
	var result int32
	var cleanupOnEarlyError int32
	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var _objPtr uintptr
	var cachePtr3 uintptr
	var _objPtr1 uintptr
	iPtr = interp
	resultPtr = uintptr(0)
	cleanupOnEarlyError = libc.Bool32((*Tcl_Obj)(unsafe.Pointer(newValuePtr)).FrefCount == 0)

	// If the variable is in a hashtable and its hPtr field is NULL, then we
	// may have an upvar to an array element where the array was deleted or an
	// upvar to a namespace variable whose namespace was deleted. Generate an
	// error (allowing the variable to be reset would screw up our storage
	// allocation and is meaningless anyway).

	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_DEAD_HASH != 0) {
		goto __1
	}
	if !(flags&TCL_LEAVE_ERR_MSG != 0) {
		goto __2
	}
	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_ARRAY_ELEMENT != 0) {
		goto __3
	}
	XTclObjVarErrMsg(tls, interp, part1Ptr, part2Ptr, ts+5303,
		uintptr(unsafe.Pointer(&sDANGLINGELEMENT)), index)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7170, ts+71935, uintptr(0)))
	goto __4
__3:
	XTclObjVarErrMsg(tls, interp, part1Ptr, part2Ptr, ts+5303,
		uintptr(unsafe.Pointer(&sDANGLINGVAR)), index)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+7170, ts+71927, uintptr(0)))
__4:
	;
__2:
	;
	goto earlyError
__1:
	;

	// It's an error to try to set an array variable itself.

	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_ARRAY != 0) {
		goto __5
	}
	if !(flags&TCL_LEAVE_ERR_MSG != 0) {
		goto __6
	}
	XTclObjVarErrMsg(tls, interp, part1Ptr, part2Ptr, ts+5303, uintptr(unsafe.Pointer(&sISARRAY)), index)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, ts+3593, ts+28445, ts+28451, uintptr(0)))
__6:
	;
	goto earlyError
__5:
	;

	// Invoke any read traces that have been set for the variable if it is
	// requested. This was done for INST_LAPPEND_* but that was inconsistent
	// with the non-bc instruction, and would cause failures trying to
	// lappend to any non-existing ::env var, which is inconsistent with
	// documented behavior. [Bug #3057639].

	if !(flags&TCL_TRACE_READS != 0 && ((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_TRACED_READ != 0 ||
		arrayPtr != 0 && (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_TRACED_READ != 0)) {
		goto __7
	}
	if !(TCL_ERROR == XTclObjCallVarTraces(tls, iPtr, arrayPtr, varPtr,
		part1Ptr, part2Ptr,
		TCL_TRACE_READS, flags&TCL_LEAVE_ERR_MSG, index)) {
		goto __8
	}
	goto earlyError
__8:
	;
__7:
	;

	// Set the variable's new value. If appending, append the new value to the
	// variable, either as a list element or as a string. Also, if appending,
	// then if the variable's old value is unshared we can modify it directly,
	// otherwise we must create a new copy to modify: this is "copy on write".

	oldValuePtr = *(*uintptr)(unsafe.Pointer(varPtr + 8))
	if !(flags&TCL_LIST_ELEMENT != 0 && !(flags&TCL_APPEND_VALUE != 0)) {
		goto __9
	}
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = uintptr(0)
__9:
	;
	if !(flags&(TCL_APPEND_VALUE|TCL_LIST_ELEMENT) != 0) {
		goto __10
	}
	if !(flags&TCL_LIST_ELEMENT != 0) {
		goto __12
	} // Append list element.
	if !(oldValuePtr == uintptr(0)) {
		goto __14
	}
__16:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __19
	}
	oldValuePtr = XTclThreadAllocObj(tls)
	goto __20
__19:
	oldValuePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(oldValuePtr + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__20:
	;
	goto __17
__17:
	if 0 != 0 {
		goto __16
	}
	goto __18
__18:
	;
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr = uintptr(0)

	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = oldValuePtr
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FrefCount++ // Since var is referenced.
	goto __15
__14:
	if !((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FrefCount > 1) {
		goto __21
	}
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = XTcl_DuplicateObj(tls, oldValuePtr)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FrefCount, 1) > 1) {
		goto __22
	}
	goto __23
__22:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __24
	}

	if !((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != XtclEmptyStringRep) {
		goto __26
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes)
__26:
	;
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Flength = -1
__27:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __30
	}
	XTclThreadFreeObj(tls, oldValuePtr)
	goto __31
__30:
	*(*uintptr)(unsafe.Pointer(oldValuePtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = oldValuePtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__31:
	;
	goto __28
__28:
	if 0 != 0 {
		goto __27
	}
	goto __29
__29:
	;
	goto __25
__24:
	XTclFreeObj(tls, oldValuePtr)
__25:
	;
__23:
	;

	oldValuePtr = *(*uintptr)(unsafe.Pointer(varPtr + 8))
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FrefCount++ // Since var is referenced.
__21:
	;
__15:
	;
	result = XTcl_ListObjAppendElement(tls, interp, oldValuePtr,
		newValuePtr)
	if !(result != TCL_OK) {
		goto __32
	}
	goto earlyError
__32:
	;
	goto __13
__12: // Append string.
	// We append newValuePtr's bytes but don't change its ref count.

	if !(oldValuePtr == uintptr(0)) {
		goto __33
	}
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = newValuePtr
	(*Tcl_Obj)(unsafe.Pointer(newValuePtr)).FrefCount++
	goto __34
__33:
	if !((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FrefCount > 1) {
		goto __35
	} // Append to copy.
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = XTcl_DuplicateObj(tls, oldValuePtr)

	XTclContinuationsCopy(tls, *(*uintptr)(unsafe.Pointer(varPtr + 8)), oldValuePtr)

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FrefCount, 1) > 1) {
		goto __36
	}
	goto __37
__36:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __38
	}

	if !((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != XtclEmptyStringRep) {
		goto __40
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes)
__40:
	;
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Flength = -1
__41:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __44
	}
	XTclThreadFreeObj(tls, oldValuePtr)
	goto __45
__44:
	*(*uintptr)(unsafe.Pointer(oldValuePtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = oldValuePtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__45:
	;
	goto __42
__42:
	if 0 != 0 {
		goto __41
	}
	goto __43
__43:
	;
	goto __39
__38:
	XTclFreeObj(tls, oldValuePtr)
__39:
	;
__37:
	;

	oldValuePtr = *(*uintptr)(unsafe.Pointer(varPtr + 8))
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FrefCount++ // Since var is ref
__35:
	;
	XTcl_AppendObjToObj(tls, oldValuePtr, newValuePtr)
	if !((*Tcl_Obj)(unsafe.Pointer(newValuePtr)).FrefCount == 0) {
		goto __46
	}
__47:
	_objPtr = newValuePtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __50
	}
	XTclFreeObj(tls, _objPtr)
__50:
	;
	goto __48
__48:
	if 0 != 0 {
		goto __47
	}
	goto __49
__49:
	;
__46:
	;
__34:
	;
__13:
	;
	goto __11
__10:
	if !(newValuePtr != oldValuePtr) {
		goto __51
	}
	// In this case we are replacing the value, so we don't need to do
	// more than swap the objects.

	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = newValuePtr
	(*Tcl_Obj)(unsafe.Pointer(newValuePtr)).FrefCount++ // Var is another ref.
	if !(oldValuePtr != uintptr(0)) {
		goto __52
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FrefCount, 1) > 1) {
		goto __53
	}
	goto __54
__53:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __55
	}

	if !((*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != XtclEmptyStringRep) {
		goto __57
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes)
__57:
	;
	(*Tcl_Obj)(unsafe.Pointer(oldValuePtr)).Flength = -1
__58:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __61
	}
	XTclThreadFreeObj(tls, oldValuePtr)
	goto __62
__61:
	*(*uintptr)(unsafe.Pointer(oldValuePtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = oldValuePtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++
__62:
	;
	goto __59
__59:
	if 0 != 0 {
		goto __58
	}
	goto __60
__60:
	;
	goto __56
__55:
	XTclFreeObj(tls, oldValuePtr)
__56:
	;
__54:
	;
	// Discard old value.
__52:
	;
__51:
	;
__11:
	;

	// Invoke any write traces for the variable.

	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_TRACED_WRITE != 0 ||
		arrayPtr != 0 && (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_TRACED_WRITE != 0) {
		goto __63
	}
	if !(TCL_ERROR == XTclObjCallVarTraces(tls, iPtr, arrayPtr, varPtr, part1Ptr,
		part2Ptr, flags&(TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY)|
			TCL_TRACE_WRITES, flags&TCL_LEAVE_ERR_MSG, index)) {
		goto __64
	}
	goto cleanup
__64:
	;
__63:
	;

	// Return the variable's value unless the variable was changed in some
	// gross way by a trace (e.g. it was unset and then recreated as an
	// array).

	if !(!((*Var)(unsafe.Pointer(varPtr)).Fflags&(VAR_ARRAY|VAR_LINK) != 0) && !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0))) {
		goto __65
	}
	return *(*uintptr)(unsafe.Pointer(varPtr + 8))
__65:
	;

	// A trace changed the value in some gross way. Return an empty string
	// object.

	resultPtr = (*Interp)(unsafe.Pointer(iPtr)).FemptyObjPtr

	// If the variable doesn't exist anymore and no-one's using it, then free
	// up the relevant structures and hash table entries.

cleanup:
	if !(resultPtr == uintptr(0)) {
		goto __66
	}
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, ts+3593, ts+28445, ts+71927, uintptr(0)))
__66:
	;
	if !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) {
		goto __67
	}
	XTclCleanupVar(tls, varPtr, arrayPtr)
__67:
	;
	return resultPtr

earlyError:
	if !(cleanupOnEarlyError != 0) {
		goto __68
	}
__69:
	_objPtr1 = newValuePtr
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr1)).FrefCount, 1) <= 1) {
		goto __72
	}
	XTclFreeObj(tls, _objPtr1)
__72:
	;
	goto __70
__70:
	if 0 != 0 {
		goto __69
	}
	goto __71
__71:
	;
__68:
	;
	goto cleanup
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// TclIncrObjVar2 --
//
//	Given a two-part variable name, which may refer either to a scalar
//	variable or an element of an array, increment the Tcl object value of
//	the variable by a specified Tcl_Obj increment value.
//
// Results:
//	Returns a pointer to the Tcl_Obj holding the new value of the
//	variable. If the specified variable doesn't exist, or there is a clash
//	in array usage, or an error occurs while executing variable traces,
//	then NULL is returned and a message will be left in the interpreter's
//	result.
//
// Side effects:
//	The value of the given variable is incremented by the specified
//	amount. If either the array or the entry didn't exist then a new
//	variable is created. The ref count for the returned object is _not_
//	incremented to reflect the returned reference; if you want to keep a
//	reference to the object you must increment its ref count yourself.
//	Callers must Incr part1Ptr if they plan to Decr it.
//	Callers must Incr part2Ptr if they plan to Decr it.
//
//----------------------------------------------------------------------

func XTclIncrObjVar2(tls *libc.TLS, interp uintptr, part1Ptr uintptr, part2Ptr uintptr, incrPtr uintptr, flags int32) uintptr { /* tclVar.c:2074:9: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var varPtr uintptr
	// var arrayPtr uintptr at bp, 8

	varPtr = XTclObjLookupVarEx(tls, interp, part1Ptr, part2Ptr, flags, ts+5472,
		1, 1, bp)
	if varPtr == uintptr(0) {
		XTcl_AddErrorInfo(tls, interp,
			ts+28361)
		return uintptr(0)
	}
	return XTclPtrIncrObjVarIdx(tls, interp, varPtr, *(*uintptr)(unsafe.Pointer(bp /* arrayPtr */)), part1Ptr, part2Ptr,
		incrPtr, flags, -1)
}

//----------------------------------------------------------------------
//
// TclPtrIncrObjVar --
//
//	Given the pointers to a variable and possible containing array,
//	increment the Tcl object value of the variable by a Tcl_Obj increment.
//
// Results:
//	Returns a pointer to the Tcl_Obj holding the new value of the
//	variable. If the specified variable doesn't exist, or there is a clash
//	in array usage, or an error occurs while executing variable traces,
//	then NULL is returned and a message will be left in the interpreter's
//	result.
//
// Side effects:
//	The value of the given variable is incremented by the specified
//	amount. If either the array or the entry didn't exist then a new
//	variable is created. The ref count for the returned object is _not_
//	incremented to reflect the returned reference; if you want to keep a
//	reference to the object you must increment its ref count yourself.
//
//----------------------------------------------------------------------

func XTclPtrIncrObjVar(tls *libc.TLS, interp uintptr, varPtr Tcl_Var, arrayPtr Tcl_Var, part1Ptr uintptr, part2Ptr uintptr, incrPtr uintptr, flags int32) uintptr { /* tclVar.c:2128:9: */
	if varPtr == uintptr(0) {
		XTcl_Panic(tls, ts+71943, 0)
	}
	if part1Ptr == uintptr(0) {
		XTcl_Panic(tls, ts+71967, 0)
	}
	return XTclPtrIncrObjVarIdx(tls, interp, varPtr, arrayPtr,
		part1Ptr, part2Ptr, incrPtr, flags, -1)
}

//----------------------------------------------------------------------
//
// TclPtrIncrObjVarIdx --
//
//	Given the pointers to a variable and possible containing array,
//	increment the Tcl object value of the variable by a Tcl_Obj increment.
//
// Results:
//	Returns a pointer to the Tcl_Obj holding the new value of the
//	variable. If the specified variable doesn't exist, or there is a clash
//	in array usage, or an error occurs while executing variable traces,
//	then NULL is returned and a message will be left in the interpreter's
//	result.
//
// Side effects:
//	The value of the given variable is incremented by the specified
//	amount. If either the array or the entry didn't exist then a new
//	variable is created. The ref count for the returned object is _not_
//	incremented to reflect the returned reference; if you want to keep a
//	reference to the object you must increment its ref count yourself.
//
//----------------------------------------------------------------------

func XTclPtrIncrObjVarIdx(tls *libc.TLS, interp uintptr, varPtr uintptr, arrayPtr uintptr, part1Ptr uintptr, part2Ptr uintptr, incrPtr uintptr, flags int32, index int32) uintptr { /* tclVar.c:2184:9: */
	var varValuePtr uintptr

	if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
		(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount++
	}
	varValuePtr = XTclPtrGetVarIdx(tls, interp, varPtr, arrayPtr, part1Ptr,
		part2Ptr, flags, index)
	if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
		(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount--
	}
	if varValuePtr == uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					varValuePtr = XTclThreadAllocObj(tls)
				} else {
					varValuePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(varValuePtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Fbytes = uintptr(0)
			*(*int64)(unsafe.Pointer(varValuePtr + 32)) = int64(0)
			(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
			{
			}
		}
	}
	if (*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FrefCount > 1 {
		// Copy on write
		varValuePtr = XTcl_DuplicateObj(tls, varValuePtr)

		if TCL_OK == XTclIncrObj(tls, interp, varValuePtr, incrPtr) {
			return XTclPtrSetVarIdx(tls, interp, varPtr, arrayPtr, part1Ptr,
				part2Ptr, varValuePtr, flags, index)
		} else {
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = varValuePtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			return uintptr(0)
		}
	} else {
		// Unshared - can Incr in place
		if TCL_OK == XTclIncrObj(tls, interp, varValuePtr, incrPtr) {

			// This seems dumb to write the incremeted value into the var
			// after we just adjusted the value in place, but the spec for
			// [incr] requires that write traces fire, and making this call
			// is the way to make that happen.

			return XTclPtrSetVarIdx(tls, interp, varPtr, arrayPtr, part1Ptr,
				part2Ptr, varValuePtr, flags, index)
		} else {
			return uintptr(0)
		}
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// Tcl_UnsetVar --
//
//	Delete a variable, so that it may not be accessed anymore.
//
// Results:
//	Returns TCL_OK if the variable was successfully deleted, TCL_ERROR if
//	the variable can't be unset. In the event of an error, if the
//	TCL_LEAVE_ERR_MSG flag is set then an error message is left in the
//	interp's result.
//
// Side effects:
//	If varName is defined as a local or global variable in interp, it is
//	deleted.
//
//----------------------------------------------------------------------

func XTcl_UnsetVar(tls *libc.TLS, interp uintptr, varName uintptr, flags int32) int32 { /* tclVar.c:2273:1: */
	var result int32
	var varNamePtr uintptr

	varNamePtr = XTcl_NewStringObj(tls, varName, -1)
	(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).FrefCount++

	// Filter to pass through only the flags this interface supports.

	flags = flags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG)
	result = XTclObjUnsetVar2(tls, interp, varNamePtr, uintptr(0), flags)

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = varNamePtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_UnsetVar2 --
//
//	Delete a variable, given a 2-part name.
//
// Results:
//	Returns TCL_OK if the variable was successfully deleted, TCL_ERROR if
//	the variable can't be unset. In the event of an error, if the
//	TCL_LEAVE_ERR_MSG flag is set then an error message is left in the
//	interp's result.
//
// Side effects:
//	If part1 and part2 indicate a local or global variable in interp, it
//	is deleted. If part1 is an array name and part2 is NULL, then the
//	whole array is deleted.
//
//----------------------------------------------------------------------

func XTcl_UnsetVar2(tls *libc.TLS, interp uintptr, part1 uintptr, part2 uintptr, flags int32) int32 { /* tclVar.c:2322:1: */
	var result int32
	var part2Ptr uintptr = uintptr(0)
	var part1Ptr uintptr = XTcl_NewStringObj(tls, part1, -1)

	if part2 != 0 {
		part2Ptr = XTcl_NewStringObj(tls, part2, -1)
	}

	// Filter to pass through only the flags this interface supports.

	flags = flags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG)
	result = XTclObjUnsetVar2(tls, interp, part1Ptr, part2Ptr, flags)

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = part1Ptr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if part2Ptr != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = part2Ptr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// TclObjUnsetVar2 --
//
//	Delete a variable, given a 2-object name.
//
// Results:
//	Returns TCL_OK if the variable was successfully deleted, TCL_ERROR if
//	the variable can't be unset. In the event of an error, if the
//	TCL_LEAVE_ERR_MSG flag is set then an error message is left in the
//	interp's result.
//
// Side effects:
//	If part1ptr and part2Ptr indicate a local or global variable in
//	interp, it is deleted. If part1Ptr is an array name and part2Ptr is
//	NULL, then the whole array is deleted.
//
//----------------------------------------------------------------------

func XTclObjUnsetVar2(tls *libc.TLS, interp uintptr, part1Ptr uintptr, part2Ptr uintptr, flags int32) int32 { /* tclVar.c:2374:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var varPtr uintptr
	// var arrayPtr uintptr at bp, 8

	varPtr = XTclObjLookupVarEx(tls, interp, part1Ptr, part2Ptr, flags, ts+3380,
		/*createPart1*/ 0 /*createPart2*/, 0, bp)
	if varPtr == uintptr(0) {
		return TCL_ERROR
	}

	return XTclPtrUnsetVarIdx(tls, interp, varPtr, *(*uintptr)(unsafe.Pointer(bp /* arrayPtr */)), part1Ptr, part2Ptr,
		flags, -1)
}

//----------------------------------------------------------------------
//
// TclPtrUnsetVar --
//
//	Delete a variable, given the pointers to the variable's (and possibly
//	containing array's) VAR structure.
//
// Results:
//	Returns TCL_OK if the variable was successfully deleted, TCL_ERROR if
//	the variable can't be unset. In the event of an error, if the
//	TCL_LEAVE_ERR_MSG flag is set then an error message is left in the
//	interp's result.
//
// Side effects:
//	If varPtr and arrayPtr indicate a local or global variable in interp,
//	it is deleted. If varPtr is an array reference and part2Ptr is NULL,
//	then the whole array is deleted.
//
//----------------------------------------------------------------------

func XTclPtrUnsetVar(tls *libc.TLS, interp uintptr, varPtr Tcl_Var, arrayPtr Tcl_Var, part1Ptr uintptr, part2Ptr uintptr, flags int32) int32 { /* tclVar.c:2418:1: */
	if varPtr == uintptr(0) {
		XTcl_Panic(tls, ts+71943, 0)
	}
	if part1Ptr == uintptr(0) {
		XTcl_Panic(tls, ts+71967, 0)
	}
	return XTclPtrUnsetVarIdx(tls, interp, varPtr, arrayPtr,
		part1Ptr, part2Ptr, flags, -1)
}

//----------------------------------------------------------------------
//
// TclPtrUnsetVarIdx --
//
//	Delete a variable, given the pointers to the variable's (and possibly
//	containing array's) VAR structure.
//
// Results:
//	Returns TCL_OK if the variable was successfully deleted, TCL_ERROR if
//	the variable can't be unset. In the event of an error, if the
//	TCL_LEAVE_ERR_MSG flag is set then an error message is left in the
//	interp's result.
//
// Side effects:
//	If varPtr and arrayPtr indicate a local or global variable in interp,
//	it is deleted. If varPtr is an array reference and part2Ptr is NULL,
//	then the whole array is deleted.
//
//----------------------------------------------------------------------

func XTclPtrUnsetVarIdx(tls *libc.TLS, interp uintptr, varPtr uintptr, arrayPtr uintptr, part1Ptr uintptr, part2Ptr uintptr, flags int32, index int32) int32 { /* tclVar.c:2465:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var iPtr uintptr = interp
	var result int32 = func() int32 {
		if *(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0) {
			return TCL_ERROR
		}
		return TCL_OK
	}()

	// Keep the variable alive until we're done with it. We used to
	// increase/decrease the refCount for each operation, making it hard to
	// find [Bug 735335] - caused by unsetting the variable whose value was
	// the variable's name.

	if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
		(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount++
	}

	sUnsetVarStruct(tls, varPtr, arrayPtr, iPtr, part1Ptr, part2Ptr, flags, index)

	// It's an error to unset an undefined variable.

	if result != TCL_OK {
		if flags&TCL_LEAVE_ERR_MSG != 0 {
			XTclObjVarErrMsg(tls, interp, part1Ptr, part2Ptr, ts+3380,
				func() uintptr {
					if arrayPtr == uintptr(0) {
						return uintptr(unsafe.Pointer(&sNOSUCHVAR))
					}
					return uintptr(unsafe.Pointer(&sNOSUCHELEMENT))
				}(), index)
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+72046, ts+71927, uintptr(0)))
		}
	}

	// Finally, if the variable is truly not in use then free up its Var
	// structure and remove it from its hash table, if any. The ref count of
	// its value object, if any, was decremented above.

	if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
		(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount--
		sCleanupVar(tls, varPtr, arrayPtr)
	}
	return result
}

//----------------------------------------------------------------------
//
// UnsetVarStruct --
//
//	Unset and delete a variable. This does the internal work for
//	TclObjUnsetVar2 and TclDeleteNamespaceVars, which call here for each
//	variable to be unset and deleted.
//
// Results:
//	None.
//
// Side effects:
//	If the arguments indicate a local or global variable in iPtr, it is
//	unset and deleted.
//
//----------------------------------------------------------------------

func sUnsetVarStruct(tls *libc.TLS, varPtr uintptr, arrayPtr uintptr, iPtr uintptr, part1Ptr uintptr, part2Ptr uintptr, flags int32, index int32) { /* tclVar.c:2543:1: */
	bp := tls.Alloc(20)
	defer tls.Free(20)

	// var dummyVar Var at bp, 16

	var traced int32 = libc.Bool32((*Var)(unsafe.Pointer(varPtr)).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0 ||
		arrayPtr != 0 && (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_TRACED_UNSET != 0)

	if arrayPtr != 0 && (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_SEARCH_ACTIVE != 0 {
		sDeleteSearches(tls, iPtr, arrayPtr)
	} else if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_SEARCH_ACTIVE != 0 {
		sDeleteSearches(tls, iPtr, varPtr)
	}

	// The code below is tricky, because of the possibility that a trace
	// function might try to access a variable being deleted. To handle this
	// situation gracefully, do things in three steps:
	// 1. Copy the contents of the variable to a dummy variable structure, and
	//    mark the original Var structure as undefined.
	// 2. Invoke traces and clean up the variable, using the dummy copy.
	// 3. If at the end of this the original variable is still undefined and
	//    has no outstanding references, then delete it (but it could have
	//    gotten recreated by a trace).

	*(*Var)(unsafe.Pointer(bp /* dummyVar */)) = *(*Var)(unsafe.Pointer(varPtr))
	*(*int32)(unsafe.Pointer(bp)) &= libc.CplInt32(VAR_IN_HASHTABLE | VAR_DEAD_HASH | VAR_NAMESPACE_VAR | VAR_ARRAY_ELEMENT)
	*(*int32)(unsafe.Pointer(varPtr)) &= libc.CplInt32(VAR_ARRAY | VAR_LINK)
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = uintptr(0)

	// Call trace functions for the variable being deleted. Then delete its
	// traces. Be sure to abort any other traces for the variable that are
	// still pending. Special tricks:
	// 1. We need to increment varPtr's refCount around this: TclCallVarTraces
	//    will use dummyVar so it won't increment varPtr's refCount itself.
	// 2. Turn off the VAR_TRACE_ACTIVE flag in dummyVar: we want to call
	//    unset traces even if other traces are pending.

	if traced != 0 {
		var tracePtr uintptr = uintptr(0)
		var tPtr uintptr

		if (*Var)(unsafe.Pointer(bp)).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0 {
			// Transfer any existing traces on var, IF there are unset traces.
			// Otherwise just delete them.

			// var isNew int32 at bp+16, 4

			tPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1024 /* &.varTraces */)).FfindProc})).f(tls, iPtr+1024 /* &.varTraces */, varPtr)
			tracePtr = (*Tcl_HashEntry)(unsafe.Pointer(tPtr)).FclientData
			*(*int32)(unsafe.Pointer(varPtr)) &= libc.CplInt32(VAR_TRACED_READ | VAR_TRACED_WRITE | VAR_TRACED_ARRAY | VAR_TRACED_UNSET)
			XTcl_DeleteHashEntry(tls, tPtr)
			if (*Var)(unsafe.Pointer(bp)).Fflags&VAR_TRACED_UNSET != 0 {
				tPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1024 /* &.varTraces */)).FcreateProc})).f(tls, iPtr+1024 /* &.varTraces */, bp /* &dummyVar */, bp+16 /* &isNew */)
				(*Tcl_HashEntry)(unsafe.Pointer(tPtr)).FclientData = tracePtr
			}
		}

		if (*Var)(unsafe.Pointer(bp)).Fflags&VAR_TRACED_UNSET != 0 ||
			arrayPtr != 0 && (*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_TRACED_UNSET != 0 {
			*(*int32)(unsafe.Pointer(bp)) &= libc.CplInt32(VAR_TRACE_ACTIVE)
			XTclObjCallVarTraces(tls, iPtr, arrayPtr, bp, part1Ptr, part2Ptr,
				flags&(TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY)|
					TCL_TRACE_UNSETS,
				/* leaveErrMsg */ 0, index)

			// The traces that we just called may have triggered a change in
			// the set of traces. If so, reload the traces to manipulate.

			tracePtr = uintptr(0)
			if (*Var)(unsafe.Pointer(bp)).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0 {
				tPtr = (*struct {
					f func(*libc.TLS, uintptr, uintptr) uintptr
				})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1024 /* &.varTraces */)).FfindProc})).f(tls, iPtr+1024 /* &.varTraces */, bp /* &dummyVar */)
				if tPtr != 0 {
					tracePtr = (*Tcl_HashEntry)(unsafe.Pointer(tPtr)).FclientData
					XTcl_DeleteHashEntry(tls, tPtr)
				}
			}
		}

		if tracePtr != 0 {
			var activePtr uintptr

			for tracePtr != 0 {
				var prevPtr uintptr = tracePtr

				tracePtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr
				(*VarTrace)(unsafe.Pointer(prevPtr)).FnextPtr = uintptr(0)
				XTcl_EventuallyFree(tls, prevPtr, uintptr(3))
			}
			for activePtr = (*Interp)(unsafe.Pointer(iPtr)).FactiveVarTracePtr; activePtr != uintptr(0); activePtr = (*ActiveVarTrace)(unsafe.Pointer(activePtr)).FnextPtr {
				if (*ActiveVarTrace)(unsafe.Pointer(activePtr)).FvarPtr == varPtr {
					(*ActiveVarTrace)(unsafe.Pointer(activePtr)).FnextTracePtr = uintptr(0)
				}
			}
			*(*int32)(unsafe.Pointer(bp)) &= libc.CplInt32(VAR_TRACED_READ | VAR_TRACED_WRITE | VAR_TRACED_ARRAY | VAR_TRACED_UNSET)
		}
	}

	if !((*Var)(unsafe.Pointer(bp)).Fflags&(VAR_ARRAY|VAR_LINK) != 0) && *(*uintptr)(unsafe.Pointer(bp + 8)) != uintptr(0) {
		// Decrement the ref count of the var's value.

		var objPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 8))

		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, objPtr)
					} else {
						*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, objPtr)
			}
		}

	} else if (*Var)(unsafe.Pointer(bp)).Fflags&VAR_ARRAY != 0 {
		// If the variable is an array, delete all of its elements. This must
		// be done after calling and deleting the traces on the array, above
		// (that's the way traces are defined). If the array name is not
		// present and is required for a trace on some element, it will be
		// computed at DeleteArray.

		sDeleteArray(tls, iPtr, part1Ptr, bp, flags&
			(TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY)|TCL_TRACE_UNSETS,
			index)
	} else if (*Var)(unsafe.Pointer(bp)).Fflags&VAR_LINK != 0 {
		// For global/upvar variables referenced in procedures, decrement the
		// reference count on the variable referred to, and free the
		// referenced variable if it's no longer needed.

		var linkPtr uintptr = *(*uintptr)(unsafe.Pointer(bp + 8))

		if (*Var)(unsafe.Pointer(linkPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
			(*VarInHash)(unsafe.Pointer(linkPtr)).FrefCount--
			sCleanupVar(tls, linkPtr, uintptr(0))
		}
	}

	// If the variable was a namespace variable, decrement its reference
	// count.

	if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_NAMESPACE_VAR != 0 {
		*(*int32)(unsafe.Pointer(varPtr)) &= libc.CplInt32(VAR_NAMESPACE_VAR)
		if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
			(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount--
		}
	}

}

//----------------------------------------------------------------------
//
// Tcl_UnsetObjCmd --
//
//	This object-based function is invoked to process the "unset" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_UnsetObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:2716:1: */
	var i int32
	var flags int32 = TCL_LEAVE_ERR_MSG
	var name uintptr

	if objc == 1 {
		// Do nothing if no arguments supplied, so as to match command
		// documentation.

		return TCL_OK
	}

	// Simple, restrictive argument parsing. The only options are -- and
	// -nocomplain (which must come first and be given exactly to be an
	// option).

	i = 1
	name = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
	}()
	if int32(*(*int8)(unsafe.Pointer(name))) == '-' {
		if libc.Xstrcmp(tls, ts+19302, name) == 0 {
			i++
			if i == objc {
				return TCL_OK
			}
			flags = 0
			name = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes
				}
				return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
			}()
		}
		if libc.Xstrcmp(tls, ts+15828, name) == 0 {
			i++
		}
	}

	for ; i < objc; i++ {
		if XTclObjUnsetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(0), flags) != TCL_OK &&
			flags == TCL_LEAVE_ERR_MSG {
			return TCL_ERROR
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_AppendObjCmd --
//
//	This object-based function is invoked to process the "append" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	A variable's value may be changed.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_AppendObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:2784:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var varPtr uintptr
	// var arrayPtr uintptr at bp, 8

	var varValuePtr uintptr = uintptr(0)
	// Initialized to avoid compiler warning.
	var i int32

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72052)
		return TCL_ERROR
	}

	if objc == 2 {
		varValuePtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), TCL_LEAVE_ERR_MSG)
		if varValuePtr == uintptr(0) {
			return TCL_ERROR
		}
	} else {
		varPtr = XTclObjLookupVarEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), TCL_LEAVE_ERR_MSG,
			ts+5303, 1 /*createPart2*/, 1, bp)
		if varPtr == uintptr(0) {
			return TCL_ERROR
		}
		for i = 2; i < objc; i++ {
			// Note that we do not need to increase the refCount of the Var
			// pointers: should a trace delete the variable, the return value
			// of TclPtrSetVarIdx will be NULL or emptyObjPtr, and we will not
			// access the variable again.

			varValuePtr = XTclPtrSetVarIdx(tls, interp, varPtr, *(*uintptr)(unsafe.Pointer(bp /* arrayPtr */)), *(*uintptr)(unsafe.Pointer(objv + 1*8)),
				uintptr(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), TCL_APPEND_VALUE|TCL_LEAVE_ERR_MSG, -1)
			if varValuePtr == uintptr(0) || varValuePtr == (*Interp)(unsafe.Pointer(interp)).FemptyObjPtr {
				return TCL_ERROR
			}
		}
	}
	XTcl_SetObjResult(tls, interp, varValuePtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_LappendObjCmd --
//
//	This object-based function is invoked to process the "lappend" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	A variable's value may be changed.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_LappendObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:2850:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var varValuePtr uintptr
	var newValuePtr uintptr
	// var numElems int32 at bp, 4

	var createdNewObj int32
	var varPtr uintptr
	// var arrayPtr uintptr at bp+8, 8

	var result int32

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72052)
		return TCL_ERROR
	}
	if objc == 2 {
		newValuePtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), 0)
		if newValuePtr == uintptr(0) {
			// The variable doesn't exist yet. Just create it with an empty
			// initial value.

			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					varValuePtr = XTclThreadAllocObj(tls)
				} else {
					varValuePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(varValuePtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Flength = 0
			(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FtypePtr = uintptr(0)
			{
			}

			newValuePtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), varValuePtr,
				TCL_LEAVE_ERR_MSG)
			if newValuePtr == uintptr(0) {
				return TCL_ERROR
			}
		} else {
			result = func() int32 {
				if (*Tcl_Obj)(unsafe.Pointer(newValuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
					return func() int32 {
						*(*int32)(unsafe.Pointer(bp)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(newValuePtr + 32)))).FelemCount
						return TCL_OK
					}()
				}
				return XTcl_ListObjLength(tls, interp, newValuePtr, bp)
			}()
			if result != TCL_OK {
				return result
			}
		}
	} else {
		// We have arguments to append. We used to call Tcl_SetVar2 to append
		// each argument one at a time to ensure that traces were run for each
		// append step. We now append the arguments all at once because it's
		// faster. Note that a read trace and a write trace for the variable
		// will now each only be called once. Also, if the variable's old
		// value is unshared we modify it directly, otherwise we create a new
		// copy to modify: this is "copy on write".

		createdNewObj = 0

		// Protect the variable pointers around the TclPtrGetVarIdx call
		// to insure that they remain valid even if the variable was undefined
		// and unused.

		varPtr = XTclObjLookupVarEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), TCL_LEAVE_ERR_MSG,
			ts+5303, 1 /*createPart2*/, 1, bp+8)
		if varPtr == uintptr(0) {
			return TCL_ERROR
		}
		if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
			(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount++
		}
		if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 && (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fflags&VAR_IN_HASHTABLE != 0 {
			(*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++
		}
		varValuePtr = XTclPtrGetVarIdx(tls, interp, varPtr, *(*uintptr)(unsafe.Pointer(bp + 8 /* arrayPtr */)), *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0),
			TCL_LEAVE_ERR_MSG, -1)
		if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
			(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount--
		}
		if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 && (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fflags&VAR_IN_HASHTABLE != 0 {
			(*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount--
		}

		if varValuePtr == uintptr(0) {
			// We couldn't read the old value: either the var doesn't yet
			// exist or it's an array element. If it's new, we will try to
			// create it with Tcl_ObjSetVar2 below.

			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					varValuePtr = XTclThreadAllocObj(tls)
				} else {
					varValuePtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(varValuePtr + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Flength = 0
			(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FtypePtr = uintptr(0)
			{
			}

			createdNewObj = 1
		} else if (*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FrefCount > 1 {
			varValuePtr = XTcl_DuplicateObj(tls, varValuePtr)
			createdNewObj = 1
		}

		result = func() int32 {
			if (*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
				return func() int32 {
					*(*int32)(unsafe.Pointer(bp)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(varValuePtr + 32)))).FelemCount
					return TCL_OK
				}()
			}
			return XTcl_ListObjLength(tls, interp, varValuePtr, bp)
		}()
		if result == TCL_OK {
			result = XTcl_ListObjReplace(tls, interp, varValuePtr, *(*int32)(unsafe.Pointer(bp /* numElems */)), 0,
				objc-2, objv+uintptr(2)*8)
		}
		if result != TCL_OK {
			if createdNewObj != 0 {
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FrefCount, 1) > 1 {
				} else {
					if !(int32((*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(varValuePtr)).FtypePtr)).FfreeIntRepProc) != 0) {
						{
						}
						if (*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Fbytes != XtclEmptyStringRep {
							XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Fbytes)
						}
						(*Tcl_Obj)(unsafe.Pointer(varValuePtr)).Flength = -1
						for ok2 := true; ok2; ok2 = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
							}() {
								XTclThreadFreeObj(tls, varValuePtr)
							} else {
								*(*uintptr)(unsafe.Pointer(varValuePtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = varValuePtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
							}
						}
					} else {
						XTclFreeObj(tls, varValuePtr)
					}
				}
				// Free unneeded obj.
			}
			return result
		}

		// Now store the list object back into the variable. If there is an
		// error setting the new value, decrement its ref count if it was new
		// and we didn't create the variable.

		newValuePtr = XTclPtrSetVarIdx(tls, interp, varPtr, *(*uintptr)(unsafe.Pointer(bp + 8 /* arrayPtr */)), *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0),
			varValuePtr, TCL_LEAVE_ERR_MSG, -1)
		if newValuePtr == uintptr(0) {
			return TCL_ERROR
		}
	}

	// Set the interpreter's object result to refer to the variable's value
	// object.

	XTcl_SetObjResult(tls, interp, newValuePtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ArrayStartSearchCmd --
//
//	This object-based function is invoked to process the "array
//	startsearch" Tcl command. See the user documentation for details on
//	what it does.
//
// Results:
//	A standard Tcl result object.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sArrayStartSearchCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:2992:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var iPtr uintptr = interp
	// var varPtr uintptr at bp+16, 8

	var hPtr uintptr
	// var isNew int32 at bp+28, 4

	// var isArray int32 at bp+24, 4

	var searchPtr uintptr
	var varName uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72072)
		return TCL_ERROR
	}

	if TCL_ERROR == sLocateArray(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16, bp+24) {
		return TCL_ERROR
	}

	if !(*(*int32)(unsafe.Pointer(bp + 24)) != 0) {
		return sNotArrayError(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}

	// Make a new array search with a free name.

	varName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
	}()
	searchPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ArraySearch{})))
	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1112 /* &.varSearches */)).FcreateProc})).f(tls, iPtr+1112 /* &.varSearches */, *(*uintptr)(unsafe.Pointer(bp + 16 /* varPtr */)), bp+28 /* &isNew */)
	if *(*int32)(unsafe.Pointer(bp + 28)) != 0 {
		(*ArraySearch)(unsafe.Pointer(searchPtr)).Fid = 1
		*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) |= VAR_SEARCH_ACTIVE
		(*ArraySearch)(unsafe.Pointer(searchPtr)).FnextPtr = uintptr(0)
	} else {
		(*ArraySearch)(unsafe.Pointer(searchPtr)).Fid = (*ArraySearch)(unsafe.Pointer((*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)).Fid + 1
		(*ArraySearch)(unsafe.Pointer(searchPtr)).FnextPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
	}
	(*ArraySearch)(unsafe.Pointer(searchPtr)).FvarPtr = *(*uintptr)(unsafe.Pointer(bp + 16 /* varPtr */))
	(*ArraySearch)(unsafe.Pointer(searchPtr)).FnextEntry = XTcl_FirstHashEntry(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8)), searchPtr+16)
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = searchPtr
	XTcl_SetObjResult(tls, interp,
		XTcl_ObjPrintf(tls, ts+72082, libc.VaList(bp, (*ArraySearch)(unsafe.Pointer(searchPtr)).Fid, varName)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ArrayAnyMoreCmd --
//
//	This object-based function is invoked to process the "array anymore"
//	Tcl command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result object.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sArrayAnyMoreCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:3061:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var iPtr uintptr = interp
	// var varPtr uintptr at bp, 8

	var varNameObj uintptr
	var searchObj uintptr
	var gotValue int32
	// var isArray int32 at bp+8, 4

	var searchPtr uintptr

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72090)
		return TCL_ERROR
	}
	varNameObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	searchObj = *(*uintptr)(unsafe.Pointer(objv + 2*8))

	if TCL_ERROR == sLocateArray(tls, interp, varNameObj, bp, bp+8) {
		return TCL_ERROR
	}

	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		return sNotArrayError(tls, interp, varNameObj)
	}

	// Get the search.

	searchPtr = sParseSearchId(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* varPtr */)), varNameObj, searchObj)
	if searchPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Scan forward to find if there are any further elements in the array
	// that are defined.

	for 1 != 0 {
		if (*ArraySearch)(unsafe.Pointer(searchPtr)).FnextEntry != uintptr(0) {
			*(*uintptr)(unsafe.Pointer(bp /* varPtr */)) = (*ArraySearch)(unsafe.Pointer(searchPtr)).FnextEntry - uintptr(int32(uintptr(0)+24))
			if !(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) == uintptr(0)) {
				gotValue = 1
				break
			}
		}
		(*ArraySearch)(unsafe.Pointer(searchPtr)).FnextEntry = XTcl_NextHashEntry(tls, searchPtr+16)
		if (*ArraySearch)(unsafe.Pointer(searchPtr)).FnextEntry == uintptr(0) {
			gotValue = 0
			break
		}
	}
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr + 8 + uintptr(gotValue)*8)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ArrayNextElementCmd --
//
//	This object-based function is invoked to process the "array
//	nextelement" Tcl command. See the user documentation for details on
//	what it does.
//
// Results:
//	A standard Tcl result object.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sArrayNextElementCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:3140:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var varPtr uintptr at bp, 8

	var varNameObj uintptr
	var searchObj uintptr
	var searchPtr uintptr
	// var isArray int32 at bp+8, 4

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72090)
		return TCL_ERROR
	}
	varNameObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	searchObj = *(*uintptr)(unsafe.Pointer(objv + 2*8))

	if TCL_ERROR == sLocateArray(tls, interp, varNameObj, bp, bp+8) {
		return TCL_ERROR
	}

	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		return sNotArrayError(tls, interp, varNameObj)
	}

	// Get the search.

	searchPtr = sParseSearchId(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* varPtr */)), varNameObj, searchObj)
	if searchPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Get the next element from the search, or the empty string on
	// exhaustion. Note that the [array anymore] command may well have already
	// pulled a value from the hash enumeration, so we have to check the cache
	// there first.

	for 1 != 0 {
		var hPtr uintptr = (*ArraySearch)(unsafe.Pointer(searchPtr)).FnextEntry

		if hPtr == uintptr(0) {
			hPtr = XTcl_NextHashEntry(tls, searchPtr+16)
			if hPtr == uintptr(0) {
				return TCL_OK
			}
		} else {
			(*ArraySearch)(unsafe.Pointer(searchPtr)).FnextEntry = uintptr(0)
		}
		*(*uintptr)(unsafe.Pointer(bp /* varPtr */)) = hPtr - uintptr(int32(uintptr(0)+24))
		if !(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) == uintptr(0)) {
			XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24 + 32)))
			return TCL_OK
		}
	}
	return int32(0)
}

//----------------------------------------------------------------------
//
// ArrayDoneSearchCmd --
//
//	This object-based function is invoked to process the "array
//	donesearch" Tcl command. See the user documentation for details on
//	what it does.
//
// Results:
//	A standard Tcl result object.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sArrayDoneSearchCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:3221:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var iPtr uintptr = interp
	// var varPtr uintptr at bp, 8

	var hPtr uintptr
	var varNameObj uintptr
	var searchObj uintptr
	var searchPtr uintptr
	var prevPtr uintptr
	// var isArray int32 at bp+8, 4

	if objc != 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72090)
		return TCL_ERROR
	}
	varNameObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	searchObj = *(*uintptr)(unsafe.Pointer(objv + 2*8))

	if TCL_ERROR == sLocateArray(tls, interp, varNameObj, bp, bp+8) {
		return TCL_ERROR
	}

	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		return sNotArrayError(tls, interp, varNameObj)
	}

	// Get the search.

	searchPtr = sParseSearchId(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* varPtr */)), varNameObj, searchObj)
	if searchPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Unhook the search from the list of searches associated with the
	// variable.

	hPtr = (*struct {
		f func(*libc.TLS, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1112 /* &.varSearches */)).FfindProc})).f(tls, iPtr+1112 /* &.varSearches */, *(*uintptr)(unsafe.Pointer(bp /* varPtr */)))
	if searchPtr == (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData {
		if (*ArraySearch)(unsafe.Pointer(searchPtr)).FnextPtr != 0 {
			(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = (*ArraySearch)(unsafe.Pointer(searchPtr)).FnextPtr
		} else {
			*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) &= libc.CplInt32(VAR_SEARCH_ACTIVE)
			XTcl_DeleteHashEntry(tls, hPtr)
		}
	} else {
		for prevPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData; ; prevPtr = (*ArraySearch)(unsafe.Pointer(prevPtr)).FnextPtr {
			if (*ArraySearch)(unsafe.Pointer(prevPtr)).FnextPtr == searchPtr {
				(*ArraySearch)(unsafe.Pointer(prevPtr)).FnextPtr = (*ArraySearch)(unsafe.Pointer(searchPtr)).FnextPtr
				break
			}
		}
	}
	XTclpFree(tls, searchPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ArrayExistsCmd --
//
//	This object-based function is invoked to process the "array exists"
//	Tcl command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result object.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sArrayExistsCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:3302:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var iPtr uintptr = interp
	// var isArray int32 at bp, 4

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72072)
		return TCL_ERROR
	}

	if TCL_ERROR == sLocateArray(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), bp) {
		return TCL_ERROR
	}

	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FexecEnvPtr + 8 + uintptr(*(*int32)(unsafe.Pointer(bp /* isArray */)))*8)))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ArrayGetCmd --
//
//	This object-based function is invoked to process the "array get" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result object.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sArrayGetCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:3343:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	// var varPtr uintptr at bp, 8

	var varPtr2 uintptr
	var varNameObj uintptr
	var nameObj uintptr
	var valueObj uintptr
	var nameLstObj uintptr
	var tmpResObj uintptr
	// var nameObjPtr uintptr at bp+48, 8

	var patternObj uintptr
	// var search Tcl_HashSearch at bp+16, 24

	var pattern uintptr
	var i int32
	// var count int32 at bp+40, 4

	var result int32
	// var isArray int32 at bp+8, 4

	var cachePtr uintptr
	var cachePtr1 uintptr
	var cachePtr2 uintptr
	var cachePtr3 uintptr
	var cachePtr4 uintptr
	var cachePtr5 uintptr
	var cachePtr6 uintptr

	switch objc {
	case 2:
		goto __2
	case 3:
		goto __3
	default:
		goto __4
	}
	goto __1
__2:
	varNameObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	patternObj = uintptr(0)
	goto __1
__3:
	varNameObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	patternObj = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	goto __1
__4:
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72109)
	return TCL_ERROR
__1:
	;

	if !(TCL_ERROR == sLocateArray(tls, interp, varNameObj, bp, bp+8)) {
		goto __5
	}
	return TCL_ERROR
__5:
	;

	// If not an array, it's an empty result.
	if !!(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		goto __6
	}
	return TCL_OK
__6:
	;

	pattern = func() uintptr {
		if patternObj != 0 {
			return func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(patternObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(patternObj)).Fbytes
				}
				return XTcl_GetString(tls, patternObj)
			}()
		}
		return uintptr(0)
	}()

	// Store the array names in a new object.

__7:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __10
	}
	nameLstObj = XTclThreadAllocObj(tls)
	goto __11
__10:
	nameLstObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(nameLstObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__11:
	;
	goto __8
__8:
	if 0 != 0 {
		goto __7
	}
	goto __9
__9:
	;
	(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FtypePtr = uintptr(0)

	(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FrefCount++
	if !(patternObj != uintptr(0) && libc.Xstrpbrk(tls, pattern, ts+13556) == uintptr(0)) {
		goto __12
	}
	varPtr2 = sVarHashCreateVar1(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)), patternObj, uintptr(0))
	if !(varPtr2 == uintptr(0)) {
		goto __13
	}
	goto searchDone
__13:
	;
	if !(*(*uintptr)(unsafe.Pointer(varPtr2 + 8)) == uintptr(0)) {
		goto __14
	}
	goto searchDone
__14:
	;
	result = XTcl_ListObjAppendElement(tls, interp, nameLstObj,
		*(*uintptr)(unsafe.Pointer(varPtr2 + 24 + 32)))
	if !(result != TCL_OK) {
		goto __15
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FrefCount, 1) > 1) {
		goto __16
	}
	goto __17
__16:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __18
	}

	if !((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes != XtclEmptyStringRep) {
		goto __20
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes)
__20:
	;
	(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Flength = -1
__21:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __24
	}
	XTclThreadFreeObj(tls, nameLstObj)
	goto __25
__24:
	*(*uintptr)(unsafe.Pointer(nameLstObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = nameLstObj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__25:
	;
	goto __22
__22:
	if 0 != 0 {
		goto __21
	}
	goto __23
__23:
	;
	goto __19
__18:
	XTclFreeObj(tls, nameLstObj)
__19:
	;
__17:
	;

	return result
__15:
	;
	goto searchDone
__12:
	;

	varPtr2 = sVarHashFirstVar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)), bp+16)
__26:
	if !(varPtr2 != 0) {
		goto __28
	}
	if !(*(*uintptr)(unsafe.Pointer(varPtr2 + 8)) == uintptr(0)) {
		goto __29
	}
	goto __27
__29:
	;
	nameObj = *(*uintptr)(unsafe.Pointer(varPtr2 + 24 + 32))
	if !(patternObj != 0 && !(XTcl_StringMatch(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes
		}
		return XTcl_GetString(tls, nameObj)
	}(), pattern) != 0)) {
		goto __30
	}
	goto __27 // Element name doesn't match pattern.
__30:
	;

	result = XTcl_ListObjAppendElement(tls, interp, nameLstObj, nameObj)
	if !(result != TCL_OK) {
		goto __31
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FrefCount, 1) > 1) {
		goto __32
	}
	goto __33
__32:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __34
	}

	if !((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes != XtclEmptyStringRep) {
		goto __36
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes)
__36:
	;
	(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Flength = -1
__37:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr2 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __40
	}
	XTclThreadFreeObj(tls, nameLstObj)
	goto __41
__40:
	*(*uintptr)(unsafe.Pointer(nameLstObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = nameLstObj
	(*AllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++
__41:
	;
	goto __38
__38:
	if 0 != 0 {
		goto __37
	}
	goto __39
__39:
	;
	goto __35
__34:
	XTclFreeObj(tls, nameLstObj)
__35:
	;
__33:
	;

	return result
__31:
	;
	goto __27
__27:
	varPtr2 = sVarHashNextVar(tls, bp+16)
	goto __26
	goto __28
__28:
	;

	// Make sure the Var structure of the array is not removed by a trace
	// while we're working.

searchDone:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __42
	}
	(*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount++
__42:
	;

	// Get the array values corresponding to each element name.

__43:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr3 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == 0
	}()) {
		goto __46
	}
	tmpResObj = XTclThreadAllocObj(tls)
	goto __47
__46:
	tmpResObj = (*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpResObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects--
__47:
	;
	goto __44
__44:
	if 0 != 0 {
		goto __43
	}
	goto __45
__45:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpResObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpResObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(tmpResObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(tmpResObj)).FtypePtr = uintptr(0)

	result = XTcl_ListObjGetElements(tls, interp, nameLstObj, bp+40, bp+48)
	if !(result != TCL_OK) {
		goto __48
	}
	goto errorInArrayGet
__48:
	;

	i = 0
__49:
	if !(i < *(*int32)(unsafe.Pointer(bp + 40))) {
		goto __51
	}
	nameObj = *(*uintptr)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 48 /* nameObjPtr */)), 8)))
	valueObj = XTcl_ObjGetVar2(tls, interp, varNameObj, nameObj,
		TCL_LEAVE_ERR_MSG)
	if !(valueObj == uintptr(0)) {
		goto __52
	}
	// Some trace played a trick on us; we need to diagnose to adapt
	// our behaviour: was the array element unset, or did the
	// modification modify the complete array?

	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags&VAR_ARRAY != 0) {
		goto __53
	}
	// The array itself looks OK, the variable was undefined:
	// forget it.

	goto __50
__53:
	;
	result = TCL_ERROR
	goto errorInArrayGet
__52:
	;
	result = XTcl_DictObjPut(tls, interp, tmpResObj, nameObj, valueObj)
	if !(result != TCL_OK) {
		goto __54
	}
	goto errorInArrayGet
__54:
	;
	goto __50
__50:
	i++
	goto __49
	goto __51
__51:
	;
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __55
	}
	(*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount--
__55:
	;
	XTcl_SetObjResult(tls, interp, tmpResObj)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FrefCount, 1) > 1) {
		goto __56
	}
	goto __57
__56:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __58
	}

	if !((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes != XtclEmptyStringRep) {
		goto __60
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes)
__60:
	;
	(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Flength = -1
__61:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr4 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __64
	}
	XTclThreadFreeObj(tls, nameLstObj)
	goto __65
__64:
	*(*uintptr)(unsafe.Pointer(nameLstObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = nameLstObj
	(*AllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++
__65:
	;
	goto __62
__62:
	if 0 != 0 {
		goto __61
	}
	goto __63
__63:
	;
	goto __59
__58:
	XTclFreeObj(tls, nameLstObj)
__59:
	;
__57:
	;

	return TCL_OK

errorInArrayGet:
	if !((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags&VAR_IN_HASHTABLE != 0) {
		goto __66
	}
	(*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount--
__66:
	;
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FrefCount, 1) > 1) {
		goto __67
	}
	goto __68
__67:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __69
	}

	if !((*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes != XtclEmptyStringRep) {
		goto __71
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Fbytes)
__71:
	;
	(*Tcl_Obj)(unsafe.Pointer(nameLstObj)).Flength = -1
__72:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr5 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __75
	}
	XTclThreadFreeObj(tls, nameLstObj)
	goto __76
__75:
	*(*uintptr)(unsafe.Pointer(nameLstObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = nameLstObj
	(*AllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++
__76:
	;
	goto __73
__73:
	if 0 != 0 {
		goto __72
	}
	goto __74
__74:
	;
	goto __70
__69:
	XTclFreeObj(tls, nameLstObj)
__70:
	;
__68:
	;

	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(tmpResObj)).FrefCount, 1) > 1) {
		goto __77
	}
	goto __78
__77:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(tmpResObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(tmpResObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __79
	}

	if !((*Tcl_Obj)(unsafe.Pointer(tmpResObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(tmpResObj)).Fbytes != XtclEmptyStringRep) {
		goto __81
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(tmpResObj)).Fbytes)
__81:
	;
	(*Tcl_Obj)(unsafe.Pointer(tmpResObj)).Flength = -1
__82:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr6 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __85
	}
	XTclThreadFreeObj(tls, tmpResObj)
	goto __86
__85:
	*(*uintptr)(unsafe.Pointer(tmpResObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = tmpResObj
	(*AllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++
__86:
	;
	goto __83
__83:
	if 0 != 0 {
		goto __82
	}
	goto __84
__84:
	;
	goto __80
__79:
	XTclFreeObj(tls, tmpResObj)
__80:
	;
__78:
	;
	// Free unneeded temp result.
	return result
}

//----------------------------------------------------------------------
//
// ArrayNamesCmd --
//
//	This object-based function is invoked to process the "array names" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result object.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sArrayNamesCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:3503:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	// var varPtr uintptr at bp, 8

	var varPtr2 uintptr
	var nameObj uintptr
	var resultObj uintptr
	var patternObj uintptr
	// var search Tcl_HashSearch at bp+16, 24

	var pattern uintptr = uintptr(0)
	// var isArray int32 at bp+8, 4

	*(*int32)(unsafe.Pointer(bp + 12 /* mode */)) = 1 /* OPT_GLOB */

	if objc < 2 || objc > 4 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72129)
		return TCL_ERROR
	}
	patternObj = func() uintptr {
		if objc > 2 {
			return *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8))
		}
		return uintptr(0)
	}()

	if TCL_ERROR == sLocateArray(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, bp+8) {
		return TCL_ERROR
	}

	// Finish parsing the arguments.

	if objc == 4 && XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&options19)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+12) != TCL_OK {
		return TCL_ERROR
	}

	// If not an array, the result is empty.

	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		return TCL_OK
	}

	// Check for the trivial cases where we can use a direct lookup.

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultObj = XTclThreadAllocObj(tls)
		} else {
			resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)
	{
	}

	if patternObj != 0 {
		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(patternObj)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(patternObj)).Fbytes
			}
			return XTcl_GetString(tls, patternObj)
		}()
	}
	if *(*int32)(unsafe.Pointer(bp + 12)) == 1 && patternObj != 0 && libc.Xstrpbrk(tls, pattern, ts+13556) == uintptr(0) ||
		*(*int32)(unsafe.Pointer(bp + 12)) == 0 {
		varPtr2 = sVarHashCreateVar1(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)), patternObj, uintptr(0))
		if varPtr2 != uintptr(0) && !(*(*uintptr)(unsafe.Pointer(varPtr2 + 8)) == uintptr(0)) {
			// This can't fail; lappending to an empty object always works.

			XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, *(*uintptr)(unsafe.Pointer(varPtr2 + 24 + 32)))
		}
		XTcl_SetObjResult(tls, interp, resultObj)
		return TCL_OK
	}

	// Must scan the array to select the elements.

	for varPtr2 = sVarHashFirstVar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)), bp+16); varPtr2 != uintptr(0); varPtr2 = sVarHashNextVar(tls, bp+16) {
		if *(*uintptr)(unsafe.Pointer(varPtr2 + 8)) == uintptr(0) {
			continue
		}
		nameObj = *(*uintptr)(unsafe.Pointer(varPtr2 + 24 + 32))
		if patternObj != 0 {
			var name uintptr = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes
				}
				return XTcl_GetString(tls, nameObj)
			}()
			var matched int32 = 0

			switch uint32(*(*int32)(unsafe.Pointer(bp + 12 /* mode */))) {
			case uint32(0) /* OPT_EXACT */ :
				XTcl_Panic(tls, ts+72156, 0)
				fallthrough
			case uint32(1) /* OPT_GLOB */ :
				matched = XTcl_StringMatch(tls, name, pattern)
				break
				fallthrough
			case uint32(2) /* OPT_REGEXP */ :
				matched = XTcl_RegExpMatchObj(tls, interp, nameObj, patternObj)
				if matched < 0 {
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount, 1) > 1 {
					} else {
						if !(int32((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc) != 0) {
							{
							}
							if (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != XtclEmptyStringRep {
								XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes)
							}
							(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = -1
							for ok1 := true; ok1; ok1 = 0 != 0 {
								var cachePtr uintptr
								if uintptr(0) == uintptr(0) || func() bool {
									cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
									return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
								}() {
									XTclThreadFreeObj(tls, resultObj)
								} else {
									*(*uintptr)(unsafe.Pointer(resultObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
									(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = resultObj
									(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
								}
							}
						} else {
							XTclFreeObj(tls, resultObj)
						}
					}

					return TCL_ERROR
				}
				break
			}
			if matched == 0 {
				continue
			}
		}

		XTcl_ListObjAppendElement(tls, uintptr(0), resultObj, nameObj)
	}
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

var options19 = [4]uintptr{
	ts + 14906, ts + 14913, ts + 14974, uintptr(0),
} /* tclVar.c:3509:23 */

//----------------------------------------------------------------------
//
// TclFindArrayPtrElements --
//
//	Fill out a hash table (which *must* use Tcl_Obj* keys) with an entry
//	for each existing element of the given array. The provided hash table
//	is assumed to be initially empty.
//
// Result:
//	none
//
// Side effects:
//	The keys of the array gain an extra reference. The supplied hash table
//	has elements added to it.
//
//----------------------------------------------------------------------

func XTclFindArrayPtrElements(tls *libc.TLS, arrayPtr uintptr, tablePtr uintptr) { /* tclVar.c:3625:1: */
	bp := tls.Alloc(28)
	defer tls.Free(28)

	var varPtr uintptr
	// var search Tcl_HashSearch at bp, 24

	if arrayPtr == uintptr(0) || !((*Var)(unsafe.Pointer(arrayPtr)).Fflags&VAR_ARRAY != 0) ||
		*(*uintptr)(unsafe.Pointer(arrayPtr + 8)) == uintptr(0) {
		return
	}

	for varPtr = sVarHashFirstVar(tls, *(*uintptr)(unsafe.Pointer(arrayPtr + 8)), bp); varPtr != uintptr(0); varPtr = sVarHashNextVar(tls, bp) {
		var hPtr uintptr
		var nameObj uintptr
		// var dummy int32 at bp+24, 4

		if *(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0) {
			continue
		}
		nameObj = *(*uintptr)(unsafe.Pointer(varPtr + 24 + 32))
		hPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})).f(tls, tablePtr, nameObj, bp+24 /* &dummy */)
		(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = nameObj
	}
}

//----------------------------------------------------------------------
//
// ArraySetCmd --
//
//	This object-based function is invoked to process the "array set" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result object.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sArraySetCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:3671:1: */
	bp := tls.Alloc(172)
	defer tls.Free(172)

	var arrayNameObj uintptr
	var arrayElemObj uintptr
	var varPtr uintptr
	// var arrayPtr uintptr at bp+104, 8

	var result int32
	var i int32
	// At this point, it would be nice if the key was directly usable
	// by the array. This isn't the case though.

	var elemVarPtr uintptr
	// var keyPtr uintptr at bp+144, 8

	// var valuePtr uintptr at bp+152, 8

	// var search Tcl_DictSearch at bp+120, 24

	// var done int32 at bp+112, 4

	var elemVarPtr1 uintptr
	var _objPtr uintptr
	// Not a dictionary, so assume (and convert to, for backward-
	// -compatibility reasons) a list.

	// var elemLen int32 at bp+168, 4

	// var elemPtrs uintptr at bp+160, 8

	var copyListObj uintptr

	if !(objc != 3) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72190)
	return TCL_ERROR
__1:
	;

	if !(TCL_ERROR == sLocateArray(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0), uintptr(0))) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	arrayNameObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	varPtr = XTclObjLookupVarEx(tls, interp, arrayNameObj, uintptr(0),
		/*flags*/ TCL_LEAVE_ERR_MSG /*msg*/, ts+5303, 1,
		/*createPart2*/ 1, bp+104)
	if !(varPtr == uintptr(0)) {
		goto __3
	}
	return TCL_ERROR
__3:
	;
	if !(*(*uintptr)(unsafe.Pointer(bp + 104)) != 0) {
		goto __4
	}
	sCleanupVar(tls, varPtr, *(*uintptr)(unsafe.Pointer(bp + 104 /* arrayPtr */)))
	XTclObjVarErrMsg(tls, interp, arrayNameObj, uintptr(0), ts+5303, uintptr(unsafe.Pointer(&sNEEDARRAY)), -1)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+7170, ts+71927,
		func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(arrayNameObj)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(arrayNameObj)).Fbytes
			}
			return XTcl_GetString(tls, arrayNameObj)
		}(), uintptr(0)))
	return TCL_ERROR
__4:
	;

	// Install the contents of the dictionary or list into the array.

	arrayElemObj = *(*uintptr)(unsafe.Pointer(objv + 2*8))
	if !((*Tcl_Obj)(unsafe.Pointer(arrayElemObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) && (*Tcl_Obj)(unsafe.Pointer(arrayElemObj)).Fbytes == uintptr(0)) {
		goto __5
	}

	if !(XTcl_DictObjSize(tls, interp, arrayElemObj, bp+112) != TCL_OK) {
		goto __7
	}
	return TCL_ERROR
__7:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 112)) == 0) {
		goto __8
	}
	// Empty, so we'll just force the array to be properly existing
	// instead.

	goto ensureArray
__8:
	;

	// Don't need to look at result of Tcl_DictObjFirst as we've just
	// successfully used a dictionary operation on the same object.

	XTcl_DictObjFirst(tls, interp, arrayElemObj, bp+120,
		bp+144, bp+152, bp+112)
__9:
	if !!(*(*int32)(unsafe.Pointer(bp + 112)) != 0) {
		goto __11
	}
	// At this point, it would be nice if the key was directly usable
	// by the array. This isn't the case though.

	elemVarPtr = XTclLookupArrayElement(tls, interp, arrayNameObj,
		*(*uintptr)(unsafe.Pointer(bp + 144 /* keyPtr */)), TCL_LEAVE_ERR_MSG, ts+5303, 1, 1, varPtr, -1)

	if !(elemVarPtr == uintptr(0) || XTclPtrSetVarIdx(tls, interp, elemVarPtr, varPtr, arrayNameObj,
		*(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp + 152)), TCL_LEAVE_ERR_MSG, -1) == uintptr(0)) {
		goto __12
	}
	XTcl_DictObjDone(tls, bp+120)
	return TCL_ERROR
__12:
	;
	goto __10
__10:
	XTcl_DictObjNext(tls, bp+120, bp+144, bp+152, bp+112)
	goto __9
	goto __11
__11:
	;
	return TCL_OK
	goto __6
__5:

	result = func() int32 {
		if (*Tcl_Obj)(unsafe.Pointer(arrayElemObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) {
			return func() int32 {
				*(*uintptr)(unsafe.Pointer(bp + 160)) = *(*uintptr)(unsafe.Pointer(arrayElemObj + 32)) + 16
				*(*int32)(unsafe.Pointer(bp + 168)) = (*List)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(arrayElemObj + 32)))).FelemCount
				return TCL_OK
			}()
		}
		return XTcl_ListObjGetElements(tls, interp, arrayElemObj, bp+168, bp+160)
	}()
	if !(result != TCL_OK) {
		goto __13
	}
	return result
__13:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 168))&1 != 0) {
		goto __14
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+18335, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+13635, ts+63674, uintptr(0)))
	return TCL_ERROR
__14:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 168)) == 0) {
		goto __15
	}
	goto ensureArray
__15:
	;

	// We needn't worry about traces invalidating arrayPtr: should that be
	// the case, TclPtrSetVarIdx will return NULL so that we break out of
	// the loop and return an error.

	copyListObj = XTclListObjCopy(tls, uintptr(0), arrayElemObj)
	i = 0
__16:
	if !(i < *(*int32)(unsafe.Pointer(bp + 168))) {
		goto __18
	}
	elemVarPtr1 = XTclLookupArrayElement(tls, interp, arrayNameObj,
		*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 160 /* elemPtrs */)) + uintptr(i)*8)), TCL_LEAVE_ERR_MSG, ts+5303, 1, 1, varPtr, -1)

	if !(elemVarPtr1 == uintptr(0) || XTclPtrSetVarIdx(tls, interp, elemVarPtr1, varPtr, arrayNameObj,
		*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 160)) + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 160)) + uintptr(i+1)*8)), TCL_LEAVE_ERR_MSG, -1) == uintptr(0)) {
		goto __19
	}
	result = TCL_ERROR
	goto __18
__19:
	;
	goto __17
__17:
	i = i + 2
	goto __16
	goto __18
__18:
	;
__20:
	_objPtr = copyListObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __23
	}
	XTclFreeObj(tls, _objPtr)
__23:
	;
	goto __21
__21:
	if 0 != 0 {
		goto __20
	}
	goto __22
__22:
	;
	return result
__6:
	;

	// The list is empty make sure we have an array, or create one if
	// necessary.

ensureArray:
	if !(varPtr != uintptr(0)) {
		goto __24
	}
	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_ARRAY != 0) {
		goto __25
	}
	// Already an array, done.

	return TCL_OK
__25:
	;
	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_ARRAY_ELEMENT != 0 || !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0))) {
		goto __26
	}
	// Either an array element, or a scalar: lose!

	XTclObjVarErrMsg(tls, interp, arrayNameObj, uintptr(0), ts+28414,
		uintptr(unsafe.Pointer(&sNEEDARRAY)), -1)
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+28445, ts+28451, uintptr(0)))
	return TCL_ERROR
__26:
	;
__24:
	;
	(*Var)(unsafe.Pointer(varPtr)).Fflags = (*Var)(unsafe.Pointer(varPtr)).Fflags&libc.CplInt32(VAR_LINK) | VAR_ARRAY
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = XTcl_Alloc(tls, uint32(unsafe.Sizeof(TclVarHashTable{})))
	XTclInitVarHashTable(tls, *(*uintptr)(unsafe.Pointer(varPtr + 8)), func() uintptr {
		if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
			return (*TclVarHashTable)(unsafe.Pointer((*VarInHash)(unsafe.Pointer(varPtr)).Fentry.FtablePtr)).FnsPtr
		}
		return uintptr(0)
	}())
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ArraySizeCmd --
//
//	This object-based function is invoked to process the "array size" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result object.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sArraySizeCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:3848:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	// var varPtr uintptr at bp, 8

	// var search Tcl_HashSearch at bp+16, 24

	var varPtr2 uintptr
	// var isArray int32 at bp+8, 4

	var size int32 = 0

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72072)
		return TCL_ERROR
	}

	if TCL_ERROR == sLocateArray(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, bp+8) {
		return TCL_ERROR
	}

	// We can only iterate over the array if it exists...

	if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
		// Must iterate in order to get chance to check for present but
		// "undefined" entries.

		for varPtr2 = sVarHashFirstVar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)), bp+16); varPtr2 != uintptr(0); varPtr2 = sVarHashNextVar(tls, bp+16) {
			if !(*(*uintptr)(unsafe.Pointer(varPtr2 + 8)) == uintptr(0)) {
				size++
			}
		}
	}

	XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, size))
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ArrayStatsCmd --
//
//	This object-based function is invoked to process the "array
//	statistics" Tcl command. See the user documentation for details on
//	what it does.
//
// Results:
//	A standard Tcl result object.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sArrayStatsCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:3908:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var varPtr uintptr at bp, 8

	var varNameObj uintptr
	var stats uintptr
	// var isArray int32 at bp+8, 4

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72072)
		return TCL_ERROR
	}
	varNameObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))

	if TCL_ERROR == sLocateArray(tls, interp, varNameObj, bp, bp+8) {
		return TCL_ERROR
	}

	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		return sNotArrayError(tls, interp, varNameObj)
	}

	stats = XTcl_HashStats(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)))
	if stats == uintptr(0) {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+72205, -1))
		return TCL_ERROR
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, stats, -1))
	XTclpFree(tls, stats)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ArrayUnsetCmd --
//
//	This object-based function is invoked to process the "array unset" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl result object.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func sArrayUnsetCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:3963:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	// var varPtr uintptr at bp, 8

	var varPtr2 uintptr
	var protectedVarPtr uintptr
	var varNameObj uintptr
	var patternObj uintptr
	var nameObj uintptr
	// var search Tcl_HashSearch at bp+16, 24

	var pattern uintptr
	var unsetFlags int32 = 0 // Should this be TCL_LEAVE_ERR_MSG?
	// var isArray int32 at bp+8, 4

	switch objc {
	case 2:
		varNameObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
		patternObj = uintptr(0)
		break
	case 3:
		varNameObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
		patternObj = *(*uintptr)(unsafe.Pointer(objv + 2*8))
		break
	default:
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+72109)
		return TCL_ERROR
	}

	if TCL_ERROR == sLocateArray(tls, interp, varNameObj, bp, bp+8) {
		return TCL_ERROR
	}

	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
		return TCL_OK
	}

	if !(patternObj != 0) {
		// When no pattern is given, just unset the whole array.

		return XTclObjUnsetVar2(tls, interp, varNameObj, uintptr(0), 0)
	}

	// With a trivial pattern, we can just unset.

	pattern = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(patternObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(patternObj)).Fbytes
		}
		return XTcl_GetString(tls, patternObj)
	}()
	if libc.Xstrpbrk(tls, pattern, ts+13556) == uintptr(0) {
		varPtr2 = sVarHashCreateVar1(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)), patternObj, uintptr(0))
		if !(varPtr2 != 0) || *(*uintptr)(unsafe.Pointer(varPtr2 + 8)) == uintptr(0) {
			return TCL_OK
		}
		return XTclPtrUnsetVarIdx(tls, interp, varPtr2, *(*uintptr)(unsafe.Pointer(bp /* varPtr */)), varNameObj,
			patternObj, unsetFlags, -1)
	}

	// Non-trivial case (well, deeply tricky really). We peek inside the hash
	// iterator in order to allow us to guarantee that the following element
	// in the array will not be scrubbed until we have dealt with it. This
	// stops the overall iterator from ending up pointing into deallocated
	// memory. [Bug 2939073]

	protectedVarPtr = uintptr(0)
	for varPtr2 = sVarHashFirstVar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)), bp+16); varPtr2 != uintptr(0); varPtr2 = sVarHashNextVar(tls, bp+16) {
		// Drop the extra ref immediately. We don't need to free it at this
		// point though; we'll be unsetting it if necessary soon.

		if varPtr2 == protectedVarPtr {
			(*VarInHash)(unsafe.Pointer(varPtr2)).FrefCount--
		}

		// Guard the next (peeked) item in the search chain by incrementing
		// its refcount. This guarantees that the hash table iterator won't be
		// dangling on the next time through the loop.

		if (*Tcl_HashSearch)(unsafe.Pointer(bp+16)).FnextEntryPtr != uintptr(0) {
			protectedVarPtr = (*Tcl_HashSearch)(unsafe.Pointer(bp+16)).FnextEntryPtr - uintptr(int32(uintptr(0)+24))
			(*VarInHash)(unsafe.Pointer(protectedVarPtr)).FrefCount++
		} else {
			protectedVarPtr = uintptr(0)
		}

		// If the variable is undefined, clean it out as it has been hit by
		// something else (i.e., an unset trace).

		if *(*uintptr)(unsafe.Pointer(varPtr2 + 8)) == uintptr(0) {
			sCleanupVar(tls, varPtr2, *(*uintptr)(unsafe.Pointer(bp /* varPtr */)))
			continue
		}

		nameObj = *(*uintptr)(unsafe.Pointer(varPtr2 + 24 + 32))
		if XTcl_StringMatch(tls, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(nameObj)).Fbytes
			}
			return XTcl_GetString(tls, nameObj)
		}(), pattern) != 0 &&
			XTclPtrUnsetVarIdx(tls, interp, varPtr2, *(*uintptr)(unsafe.Pointer(bp)), varNameObj,
				nameObj, unsetFlags, -1) != TCL_OK {
			// If we incremented a refcount, we must decrement it here as we
			// will not be coming back properly due to the error.

			if protectedVarPtr != 0 {
				(*VarInHash)(unsafe.Pointer(protectedVarPtr)).FrefCount--
				sCleanupVar(tls, protectedVarPtr, *(*uintptr)(unsafe.Pointer(bp /* varPtr */)))
			}
			return TCL_ERROR
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclInitArrayCmd --
//
//	This creates the ensemble for the "array" command.
//
// Results:
//	The handle for the created ensemble.
//
// Side effects:
//	Creates a command in the global namespace.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTclInitArrayCmd(tls *libc.TLS, interp uintptr) Tcl_Command { /* tclVar.c:4100:1: */

	return XTclMakeEnsemble(tls, interp, ts+25071, uintptr(unsafe.Pointer(&arrayImplMap)))
}

var arrayImplMap = [12]EnsembleImplMap{
	{Fname: ts + 72236, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 72244, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12165, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 22076, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 11701, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 72255, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 5303, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 12297, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 72267, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 72279, Fproc: 0, FcompileProc: 0},
	{Fname: ts + 3380, Fproc: 0, FcompileProc: 0},
	{},
} /* tclVar.c:4103:34 */

//----------------------------------------------------------------------
//
// ObjMakeUpvar --
//
//	This function does all of the work of the "global" and "upvar"
//	commands.
//
// Results:
//	A standard Tcl completion code. If an error occurs then an error
//	message is left in iPtr->result.
//
// Side effects:
//	The variable given by myName is linked to the variable in framePtr
//	given by otherP1 and otherP2, so that references to myName are
//	redirected to the other variable like a symbolic link.
//	Callers must Incr myNamePtr if they plan to Decr it.
//	Callers must Incr otherP1Ptr if they plan to Decr it.
//
//----------------------------------------------------------------------

func sObjMakeUpvar(tls *libc.TLS, interp uintptr, framePtr uintptr, otherP1Ptr uintptr, otherP2 uintptr, otherFlags int32, myNamePtr uintptr, myFlags int32, index int32) int32 { /* tclVar.c:4144:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	var iPtr uintptr = interp
	var otherPtr uintptr
	// var arrayPtr uintptr at bp+40, 8

	var varFramePtr uintptr

	// Find "other" in "framePtr". If not looking up other in just the current
	// namespace, temporarily replace the current var frame pointer in the
	// interpreter in order to use TclObjLookupVar.

	if framePtr == uintptr(0) {
		framePtr = (*Interp)(unsafe.Pointer(iPtr)).FrootFramePtr
	}

	varFramePtr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	if !(otherFlags&TCL_NAMESPACE_ONLY != 0) {
		(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = framePtr
	}
	otherPtr = XTclObjLookupVar(tls, interp, otherP1Ptr, otherP2,
		otherFlags|TCL_LEAVE_ERR_MSG, ts+28407,
		/*createPart1*/ 1 /*createPart2*/, 1, bp+40)
	if !(otherFlags&TCL_NAMESPACE_ONLY != 0) {
		(*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr = varFramePtr
	}
	if otherPtr == uintptr(0) {
		return TCL_ERROR
	}

	// Check that we are not trying to create a namespace var linked to a
	// local variable in a procedure. If we allowed this, the local
	// variable in the shorter-lived procedure frame could go away leaving
	// the namespace var's reference invalid.

	if index < 0 {
		if !(func() int32 {
			if *(*uintptr)(unsafe.Pointer(bp + 40)) != uintptr(0) {
				return libc.Bool32((*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).Fflags&VAR_IN_HASHTABLE != 0 && func() uintptr {
					if (*Var)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).Fflags&VAR_IN_HASHTABLE != 0 {
						return (*TclVarHashTable)(unsafe.Pointer((*VarInHash)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).Fentry.FtablePtr)).FnsPtr
					}
					return uintptr(0)
				}() != 0)
			}
			return libc.Bool32((*Var)(unsafe.Pointer(otherPtr)).Fflags&VAR_IN_HASHTABLE != 0 && func() uintptr {
				if (*Var)(unsafe.Pointer(otherPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
					return (*TclVarHashTable)(unsafe.Pointer((*VarInHash)(unsafe.Pointer(otherPtr)).Fentry.FtablePtr)).FnsPtr
				}
				return uintptr(0)
			}() != 0)
		}() != 0) &&
			(myFlags&(TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY) != 0 ||
				varFramePtr == uintptr(0) ||
				!((*CallFrame)(unsafe.Pointer(varFramePtr)).FisProcCallFrame&FRAME_IS_PROC != 0) ||
				libc.Xstrstr(tls, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(myNamePtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(myNamePtr)).Fbytes
					}
					return XTcl_GetString(tls, myNamePtr)
				}(), ts+6847) != uintptr(0)) {
			XTcl_SetObjResult(tls, iPtr, XTcl_ObjPrintf(tls,

				ts+72290,
				libc.VaList(bp, func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(myNamePtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(myNamePtr)).Fbytes
					}
					return XTcl_GetString(tls, myNamePtr)
				}())))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+50271, ts+50277, uintptr(0)))
			return TCL_ERROR
		}
	}

	return XTclPtrObjMakeUpvarIdx(tls, interp, otherPtr, myNamePtr, myFlags, index)
}

//----------------------------------------------------------------------
//
// TclPtrMakeUpvar --
//
//	This procedure does all of the work of the "global" and "upvar"
//	commands.
//
// Results:
//	A standard Tcl completion code. If an error occurs then an error
//	message is left in iPtr->result.
//
// Side effects:
//	The variable given by myName is linked to the variable in framePtr
//	given by otherP1 and otherP2, so that references to myName are
//	redirected to the other variable like a symbolic link.
//
//----------------------------------------------------------------------

func XTclPtrMakeUpvar(tls *libc.TLS, interp uintptr, otherPtr uintptr, myName uintptr, myFlags int32, index int32) int32 { /* tclVar.c:4236:1: */
	var myNamePtr uintptr = uintptr(0)
	var result int32

	if myName != 0 {
		myNamePtr = XTcl_NewStringObj(tls, myName, -1)
		(*Tcl_Obj)(unsafe.Pointer(myNamePtr)).FrefCount++
	}
	result = XTclPtrObjMakeUpvarIdx(tls, interp, otherPtr, myNamePtr, myFlags,
		index)
	if myNamePtr != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = myNamePtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	return result
}

func XTclPtrObjMakeUpvar(tls *libc.TLS, interp uintptr, otherPtr Tcl_Var, myNamePtr uintptr, myFlags int32) int32 { /* tclVar.c:4263:1: */
	return XTclPtrObjMakeUpvarIdx(tls, interp, otherPtr, myNamePtr, myFlags,
		-1)
}

// Callers must Incr myNamePtr if they plan to Decr it.

func XTclPtrObjMakeUpvarIdx(tls *libc.TLS, interp uintptr, otherPtr uintptr, myNamePtr uintptr, myFlags int32, index int32) int32 { /* tclVar.c:4279:1: */
	bp := tls.Alloc(204)
	defer tls.Free(204)
	*(*int32)(unsafe.Pointer(bp + 200)) = index

	var iPtr uintptr = interp
	var varFramePtr uintptr = (*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr
	// var errMsg uintptr at bp+192, 8

	var p uintptr
	var myName uintptr
	var varPtr uintptr

	if *(*int32)(unsafe.Pointer(bp + 200)) >= 0 {
		if !((*CallFrame)(unsafe.Pointer(varFramePtr)).FisProcCallFrame&FRAME_IS_PROC != 0) {
			XTcl_Panic(tls, ts+72380, 0)
		}
		varPtr = (*CallFrame)(unsafe.Pointer(varFramePtr)).FcompiledLocals + uintptr(*(*int32)(unsafe.Pointer(bp + 200)))*16
		myNamePtr = *(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr + 8 + uintptr(*(*int32)(unsafe.Pointer(bp + 200)))*8))
		if myNamePtr != 0 {
			myName = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(myNamePtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(myNamePtr)).Fbytes
				}
				return XTcl_GetString(tls, myNamePtr)
			}()
		} else {
			myName = uintptr(0)
		}
	} else {
		// Do not permit the new variable to look like an array reference, as
		// it will not be reachable in that case [Bug 600812, TIP 184]. The
		// "definition" of what "looks like an array reference" is consistent
		// (and must remain consistent) with the code in TclObjLookupVar().

		myName = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(myNamePtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(myNamePtr)).Fbytes
			}
			return XTcl_GetString(tls, myNamePtr)
		}()
		p = libc.Xstrstr(tls, myName, ts+50354)
		if p != uintptr(0) {
			p += uintptr(libc.Xstrlen(tls, p) - uint64(1))
			if int32(*(*int8)(unsafe.Pointer(p))) == ')' {
				// myName looks like an array reference.

				XTcl_SetObjResult(tls, iPtr, XTcl_ObjPrintf(tls,

					ts+72434, libc.VaList(bp, myName)))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+50271, ts+50331,
					uintptr(0)))
				return TCL_ERROR
			}
		}

		// Lookup and eventually create the new variable. Set the flag bit
		// TCL_AVOID_RESOLVERS to indicate the special resolution rules for
		// upvar purposes:
		//   - Bug #696893 - variable is either proc-local or in the current
		//     namespace; never follow the second (global) resolution path.
		//   - Bug #631741 - do not use special namespace or interp resolvers.

		varPtr = XTclLookupSimpleVar(tls, interp, myNamePtr,
			myFlags|TCL_AVOID_RESOLVERS, 1, bp+192, bp+200)
		if varPtr == uintptr(0) {
			XTclObjVarErrMsg(tls, interp, myNamePtr, uintptr(0), ts+23142, *(*uintptr)(unsafe.Pointer(bp + 192 /* errMsg */)), -1)
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+7170, ts+71927,
				func() uintptr {
					if (*Tcl_Obj)(unsafe.Pointer(myNamePtr)).Fbytes != 0 {
						return (*Tcl_Obj)(unsafe.Pointer(myNamePtr)).Fbytes
					}
					return XTcl_GetString(tls, myNamePtr)
				}(), uintptr(0)))
			return TCL_ERROR
		}
	}

	if varPtr == otherPtr {
		XTcl_SetObjResult(tls, iPtr, XTcl_NewStringObj(tls,
			ts+72522, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, ts+3593, ts+50271, ts+43453, uintptr(0)))
		return TCL_ERROR
	}

	if (*Var)(unsafe.Pointer(varPtr)).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0 {
		XTcl_SetObjResult(tls, iPtr, XTcl_ObjPrintf(tls,
			ts+72558, libc.VaList(bp+112, myName)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+120, ts+3593, ts+50271, ts+72604, uintptr(0)))
		return TCL_ERROR
	} else if !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) {
		var linkPtr uintptr

		// The variable already existed. Make sure this variable "varPtr"
		// isn't the same as "otherPtr" (avoid circular links). Also, if it's
		// not an upvar then it's an error. If it is an upvar, then just
		// disconnect it from the thing it currently refers to.

		if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_LINK != 0) {
			XTcl_SetObjResult(tls, iPtr, XTcl_ObjPrintf(tls,
				ts+72611, libc.VaList(bp+152, myName)))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+160, ts+3593, ts+50271, ts+72640, uintptr(0)))
			return TCL_ERROR
		}

		linkPtr = *(*uintptr)(unsafe.Pointer(varPtr + 8))
		if linkPtr == otherPtr {
			return TCL_OK
		}
		if (*Var)(unsafe.Pointer(linkPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
			(*VarInHash)(unsafe.Pointer(linkPtr)).FrefCount--
			if *(*uintptr)(unsafe.Pointer(linkPtr + 8)) == uintptr(0) {
				sCleanupVar(tls, linkPtr, uintptr(0))
			}
		}
	}
	(*Var)(unsafe.Pointer(varPtr)).Fflags = (*Var)(unsafe.Pointer(varPtr)).Fflags&libc.CplInt32(VAR_ARRAY) | VAR_LINK
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = otherPtr
	if (*Var)(unsafe.Pointer(otherPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
		(*VarInHash)(unsafe.Pointer(otherPtr)).FrefCount++
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_UpVar --
//
//	This function links one variable to another, just like the "upvar"
//	command.
//
// Results:
//	A standard Tcl completion code. If an error occurs then an error
//	message is left in the interp's result.
//
// Side effects:
//	The variable in frameName whose name is given by varName becomes
//	accessible under the name localNameStr, so that references to
//	localNameStr are redirected to the other variable like a symbolic
//	link.
//
//----------------------------------------------------------------------

func XTcl_UpVar(tls *libc.TLS, interp uintptr, frameName uintptr, varName uintptr, localNameStr uintptr, flags int32) int32 { /* tclVar.c:4418:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var result int32
	// var framePtr uintptr at bp, 8

	var varNamePtr uintptr
	var localNamePtr uintptr

	if XTclGetFrame(tls, interp, frameName, bp) == -1 {
		return TCL_ERROR
	}

	varNamePtr = XTcl_NewStringObj(tls, varName, -1)
	(*Tcl_Obj)(unsafe.Pointer(varNamePtr)).FrefCount++
	localNamePtr = XTcl_NewStringObj(tls, localNameStr, -1)
	(*Tcl_Obj)(unsafe.Pointer(localNamePtr)).FrefCount++

	result = sObjMakeUpvar(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* framePtr */)), varNamePtr, uintptr(0), 0,
		localNamePtr, flags, -1)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = varNamePtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = localNamePtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_UpVar2 --
//
//	This function links one variable to another, just like the "upvar"
//	command.
//
// Results:
//	A standard Tcl completion code. If an error occurs then an error
//	message is left in the interp's result.
//
// Side effects:
//	The variable in frameName whose name is given by part1 and part2
//	becomes accessible under the name localNameStr, so that references to
//	localNameStr are redirected to the other variable like a symbolic
//	link.
//
//----------------------------------------------------------------------

func XTcl_UpVar2(tls *libc.TLS, interp uintptr, frameName uintptr, part1 uintptr, part2 uintptr, localNameStr uintptr, flags int32) int32 { /* tclVar.c:4472:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var result int32
	// var framePtr uintptr at bp, 8

	var part1Ptr uintptr
	var localNamePtr uintptr

	if XTclGetFrame(tls, interp, frameName, bp) == -1 {
		return TCL_ERROR
	}

	part1Ptr = XTcl_NewStringObj(tls, part1, -1)
	(*Tcl_Obj)(unsafe.Pointer(part1Ptr)).FrefCount++
	localNamePtr = XTcl_NewStringObj(tls, localNameStr, -1)
	(*Tcl_Obj)(unsafe.Pointer(localNamePtr)).FrefCount++

	result = sObjMakeUpvar(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* framePtr */)), part1Ptr, part2, 0,
		localNamePtr, flags, -1)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = part1Ptr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	for ok1 := true; ok1; ok1 = 0 != 0 {
		var _objPtr uintptr = localNamePtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return result
}

//----------------------------------------------------------------------
//
// Tcl_GetVariableFullName --
//
//	Given a Tcl_Var token returned by Tcl_FindNamespaceVar, this function
//	appends to an object the namespace variable's full name, qualified by
//	a sequence of parent namespace names.
//
// Results:
//	None.
//
// Side effects:
//	The variable's fully-qualified name is appended to the string
//	representation of objPtr.
//
//----------------------------------------------------------------------

func XTcl_GetVariableFullName(tls *libc.TLS, interp uintptr, variable Tcl_Var, objPtr uintptr) { /* tclVar.c:4524:1: */
	var iPtr uintptr = interp
	var varPtr uintptr = variable
	var namePtr uintptr
	var nsPtr uintptr

	if !(varPtr != 0) || (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_ARRAY_ELEMENT != 0 {
		return
	}

	// Add the full name of the containing namespace (if any), followed by the
	// "::" separator, then the variable name.

	nsPtr = func() uintptr {
		if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
			return (*TclVarHashTable)(unsafe.Pointer((*VarInHash)(unsafe.Pointer(varPtr)).Fentry.FtablePtr)).FnsPtr
		}
		return uintptr(0)
	}()
	if nsPtr != 0 {
		XTcl_AppendToObj(tls, objPtr, (*Namespace)(unsafe.Pointer(nsPtr)).FfullName, -1)
		if nsPtr != (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr {
			XTcl_AppendToObj(tls, objPtr, ts+6847, 2)
		}
	}
	if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
		if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_DEAD_HASH != 0) {
			namePtr = *(*uintptr)(unsafe.Pointer(varPtr + 24 + 32))
			XTcl_AppendObjToObj(tls, objPtr, namePtr)
		}
	} else if (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FprocPtr != 0 {
		var index int32 = int32((int64(varPtr) - int64((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FcompiledLocals)) / 16)

		if index >= 0 && index < (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnumCompiledLocals {
			namePtr = *(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr + 8 + uintptr(index)*8))
			XTcl_AppendObjToObj(tls, objPtr, namePtr)
		}
	}
}

//----------------------------------------------------------------------
//
// Tcl_GlobalObjCmd --
//
//	This object-based function is invoked to process the "global" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

func XTcl_GlobalObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:4585:1: */
	var iPtr uintptr = interp
	var objPtr uintptr
	var tailPtr uintptr
	var varName uintptr
	var tail uintptr
	var result int32
	var i int32

	// If we are not executing inside a Tcl procedure, just return.

	if !((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FisProcCallFrame&FRAME_IS_PROC != 0) {
		return TCL_OK
	}

	for i = 1; i < objc; i++ {
		// Make a local variable linked to its counterpart in the global ::
		// namespace.

		objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
		varName = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
			}
			return XTcl_GetString(tls, objPtr)
		}()

		// The variable name might have a scope qualifier, but the name for
		// the local "link" variable must be the simple name at the tail.

		for tail = varName; int32(*(*int8)(unsafe.Pointer(tail))) != 0; tail++ {
			// empty body
		}
		for tail > varName && (int32(*(*int8)(unsafe.Pointer(tail))) != ':' || int32(*(*int8)(unsafe.Pointer(tail - uintptr(1)))) != ':') {
			tail--
		}
		if int32(*(*int8)(unsafe.Pointer(tail))) == ':' && tail > varName {
			tail++
		}

		if tail == varName {
			tailPtr = objPtr
		} else {
			tailPtr = XTcl_NewStringObj(tls, tail, -1)
			(*Tcl_Obj)(unsafe.Pointer(tailPtr)).FrefCount++
		}

		// Link to the variable "varName" in the global :: namespace.

		result = sObjMakeUpvar(tls, interp, uintptr(0), objPtr, uintptr(0),
			TCL_GLOBAL_ONLY /*myName*/, tailPtr /*myFlags*/, 0, -1)

		if tail != varName {
			for ok := true; ok; ok = 0 != 0 {
				var _objPtr uintptr = tailPtr
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		}

		if result != TCL_OK {
			return result
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_VariableObjCmd --
//
//	Invoked to implement the "variable" command that creates one or more
//	global variables. Handles the following syntax:
//
//	    variable ?name value...? name ?value?
//
//	One or more variables can be created. The variables are initialized
//	with the specified values. The value for the last variable is
//	optional.
//
//	If the variable does not exist, it is created and given the optional
//	value. If it already exists, it is simply set to the optional value.
//	Normally, "name" is an unqualified name, so it is created in the
//	current namespace. If it includes namespace qualifiers, it can be
//	created in another namespace.
//
//	If the variable command is executed inside a Tcl procedure, it creates
//	a local variable linked to the newly-created namespace variable.
//
// Results:
//	Returns TCL_OK if the variable is found or created. Returns TCL_ERROR
//	if anything goes wrong.
//
// Side effects:
//	If anything goes wrong, this function returns an error message as the
//	result in the interpreter's result object.
//
//----------------------------------------------------------------------

func XTcl_VariableObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:4689:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var iPtr uintptr = interp
	var varName uintptr
	var tail uintptr
	var cp uintptr
	var varPtr uintptr
	// var arrayPtr uintptr at bp+32, 8

	var varValuePtr uintptr
	var i int32
	var result int32
	var varNamePtr uintptr
	var tailPtr uintptr

	for i = 1; i < objc; i = i + 2 {
		// Look up each variable in the current namespace context, creating it
		// if necessary.

		varNamePtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
		varName = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes
			}
			return XTcl_GetString(tls, varNamePtr)
		}()
		varPtr = XTclObjLookupVarEx(tls, interp, varNamePtr, uintptr(0),
			TCL_NAMESPACE_ONLY|TCL_LEAVE_ERR_MSG, ts+50286,
			/*createPart1*/ 1 /*createPart2*/, 0, bp+32)

		if *(*uintptr)(unsafe.Pointer(bp + 32)) != uintptr(0) {
			// Variable cannot be an element in an array. If arrayPtr is
			// non-NULL, it is, so throw up an error and return.

			XTclObjVarErrMsg(tls, interp, varNamePtr, uintptr(0), ts+50286,
				uintptr(unsafe.Pointer(&sISARRAYELEMENT)), -1)
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+50271, ts+50331, uintptr(0)))
			return TCL_ERROR
		}

		if varPtr == uintptr(0) {
			return TCL_ERROR
		}

		// Mark the variable as a namespace variable and increment its
		// reference count so that it will persist until its namespace is
		// destroyed or until the variable is unset.

		if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_NAMESPACE_VAR != 0) {
			*(*int32)(unsafe.Pointer(varPtr)) |= VAR_NAMESPACE_VAR
			if (*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
				(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount++
			}
		}

		// If a value was specified, set the variable to that value.
		// Otherwise, if the variable is new, leave it undefined. (If the
		// variable already exists and no value was specified, leave its value
		// unchanged; just create the local link if we're in a Tcl procedure).

		if i+1 < objc { // A value was specified.
			varValuePtr = XTclPtrSetVarIdx(tls, interp, varPtr, *(*uintptr)(unsafe.Pointer(bp + 32 /* arrayPtr */)),
				varNamePtr, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)),
				TCL_NAMESPACE_ONLY|TCL_LEAVE_ERR_MSG, -1)
			if varValuePtr == uintptr(0) {
				return TCL_ERROR
			}
		}

		// If we are executing inside a Tcl procedure, create a local variable
		// linked to the new namespace variable "varName".

		if (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FisProcCallFrame&FRAME_IS_PROC != 0 {
			// varName might have a scope qualifier, but the name for the
			// local "link" variable must be the simple name at the tail.
			//
			// Locate tail in one pass: drop any prefix after two *or more*
			// consecutive ":" characters).

			for tail = libc.AssignUintptr(&cp, varName); int32(*(*int8)(unsafe.Pointer(cp))) != 0; {
				if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&cp, 1)))) == ':' {
					for int32(*(*int8)(unsafe.Pointer(cp))) == ':' {
						tail = libc.PreIncUintptr(&cp, 1)
					}
				}
			}

			// Create a local link "tail" to the variable "varName" in the
			// current namespace.

			if tail == varName {
				tailPtr = varNamePtr
			} else {
				tailPtr = XTcl_NewStringObj(tls, tail, -1)
				(*Tcl_Obj)(unsafe.Pointer(tailPtr)).FrefCount++
			}

			result = sObjMakeUpvar(tls, interp, uintptr(0), varNamePtr /*otherP2*/, uintptr(0),
				/*otherFlags*/ TCL_NAMESPACE_ONLY,
				/*myName*/ tailPtr /*myFlags*/, 0, -1)

			if tail != varName {
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = tailPtr
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
			}

			if result != TCL_OK {
				return result
			}
		}
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_UpvarObjCmd --
//
//	This object-based function is invoked to process the "upvar" Tcl
//	command. See the user documentation for details on what it does.
//
// Results:
//	A standard Tcl object result value.
//
// Side effects:
//	See the user documentation.
//
//----------------------------------------------------------------------

// ARGSUSED
func XTcl_UpvarObjCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:4823:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	// var framePtr uintptr at bp+48, 8

	var result int32
	var hasLevel int32
	var levelObj uintptr

	if objc < 3 {
		XTcl_WrongNumArgs(tls, interp, 1, objv,
			ts+72647)
		return TCL_ERROR
	}

	if objc&1 != 0 {
		// Even number of arguments, so use the default level of "1" by
		// passing NULL to TclObjGetFrame.

		levelObj = uintptr(0)
		hasLevel = 0
	} else {
		// Odd number of arguments, so objv[1] must contain the level.

		levelObj = *(*uintptr)(unsafe.Pointer(objv + 1*8))
		hasLevel = 1
	}

	// Find the call frame containing each of the "other variables" to be
	// linked to.

	result = XTclObjGetFrame(tls, interp, levelObj, bp+48)
	if result == -1 {
		return TCL_ERROR
	}
	if result == 0 && hasLevel != 0 {
		// Synthesize an error message since TclObjGetFrame doesn't do this
		// for this particular case.

		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+13701, libc.VaList(bp, func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(levelObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(levelObj)).Fbytes
				}
				return XTcl_GetString(tls, levelObj)
			}())))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+13716,
			func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(levelObj)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(levelObj)).Fbytes
				}
				return XTcl_GetString(tls, levelObj)
			}(), uintptr(0)))
		return TCL_ERROR
	}

	// We've now finished with parsing levels; skip to the variable names.

	objc = objc - (hasLevel + 1)
	objv += 8 * uintptr(hasLevel+1)

	// Iterate over each (other variable, local variable) pair. Divide the
	// other variable name into two parts, then call MakeUpvar to do all the
	// work of linking it to the local variable.

__1:
	if !(objc > 0) {
		goto __3
	}
	{
		result = sObjMakeUpvar(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 48 /* framePtr */)) /* othervarName */, *(*uintptr)(unsafe.Pointer(objv)),
			uintptr(0), 0 /* myVarName */, *(*uintptr)(unsafe.Pointer(objv + 1*8)) /*flags*/, 0, -1)
		if result != TCL_OK {
			return TCL_ERROR
		}

	}
	goto __2
__2:
	objc = objc - 2
	objv += 8 * uintptr(2)
	goto __1
	goto __3
__3:
	;
	return TCL_OK
}

//----------------------------------------------------------------------
//
// SetArraySearchObj --
//
//	This function converts the given tcl object into one that has the
//	"array search" internal type.
//
// Results:
//	TCL_OK if the conversion succeeded, and TCL_ERROR if it failed (when
//	an error message will be placed in the interpreter's result.)
//
// Side effects:
//	Updates the internal type and representation of the object to make
//	this an array-search object. See the tclArraySearchType declaration
//	above for details of the internal representation.
//
//----------------------------------------------------------------------

func sSetArraySearchObj(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclVar.c:4922:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	var string uintptr
	// var end uintptr at bp+48, 8
	// Can't be const due to strtoul defn.
	var id int32
	var offset Size_t

	// Get the string representation. Make it up-to-date if necessary.

	string = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes
		}
		return XTcl_GetString(tls, objPtr)
	}()

	// Parse the id into the three parts separated by dashes.

	if !(int32(*(*int8)(unsafe.Pointer(string))) != 's' || int32(*(*int8)(unsafe.Pointer(string + 1))) != '-') {
		goto __1
	}
	goto syntax
__1:
	;
	id = int32(libc.Xstrtoul(tls, string+uintptr(2), bp+48, 10))
	if !(*(*uintptr)(unsafe.Pointer(bp + 48)) == string+uintptr(2) || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48))))) != '-') {
		goto __2
	}
	goto syntax
__2:
	;

	// Can't perform value check in this context, so place reference to place
	// in string to use for the check in the object instead.

	*(*uintptr)(unsafe.Pointer(bp + 48 /* end */))++
	offset = Size_t((int64(*(*uintptr)(unsafe.Pointer(bp + 48))) - int64(string)) / 1)

	if !((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(0)) {
		goto __3
	}
	if !((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != uintptr(0)) {
		goto __4
	}
	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})).f(tls, objPtr)
__4:
	;
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
__3:
	;

	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclArraySearchType))
	*(*uintptr)(unsafe.Pointer(objPtr + 32)) = uintptr(Intptr_t(id))
	*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */)) = uintptr(Intptr_t(offset))
	return TCL_OK

syntax:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+72697, libc.VaList(bp, string)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+72728, string, uintptr(0)))
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// ParseSearchId --
//
//	This function translates from a tcl object to a pointer to an active
//	array search (if there is one that matches the string).
//
// Results:
//	The return value is a pointer to the array search indicated by string,
//	or NULL if there isn't one. If NULL is returned, the interp's result
//	contains an error message.
//
// Side effects:
//	The tcl object might have its internal type and representation
//	modified.
//
//----------------------------------------------------------------------

func sParseSearchId(tls *libc.TLS, interp uintptr, varPtr uintptr, varNamePtr uintptr, handleObj uintptr) uintptr { /* tclVar.c:4990:20: */
	bp := tls.Alloc(64)
	defer tls.Free(64)

	var iPtr uintptr
	var string uintptr
	var offset Size_t
	var id int32
	var searchPtr uintptr
	var varName uintptr
	var hPtr uintptr
	iPtr = interp
	varName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes
		}
		return XTcl_GetString(tls, varNamePtr)
	}()

	// Parse the id.

	if !((*Tcl_Obj)(unsafe.Pointer(handleObj)).FtypePtr != uintptr(unsafe.Pointer(&XtclArraySearchType)) &&
		sSetArraySearchObj(tls, interp, handleObj) != TCL_OK) {
		goto __1
	}
	return uintptr(0)
__1:
	;

	// Extract the information out of the Tcl_Obj.

	id = int32(*(*uintptr)(unsafe.Pointer(handleObj + 32)))
	string = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(handleObj)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(handleObj)).Fbytes
		}
		return XTcl_GetString(tls, handleObj)
	}()
	offset = Size_t(int32(*(*uintptr)(unsafe.Pointer(handleObj + 32 + 8))))

	// This test cannot be placed inside the Tcl_Obj machinery, since it is
	// dependent on the variable context.

	if !(libc.Xstrcmp(tls, string+uintptr(offset), varName) != 0) {
		goto __2
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+72740,
		libc.VaList(bp, string, varName)))
	goto badLookup
__2:
	;

	// Search through the list of active searches on the interpreter to see if
	// the desired one exists.
	//
	// Note that we cannot store the searchPtr directly in the Tcl_Obj as that
	// would run into trouble when DeleteSearches() was called so we must scan
	// this list every time.

	if !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_SEARCH_ACTIVE != 0) {
		goto __3
	}
	hPtr =
		(*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1112 /* &.varSearches */)).FfindProc})).f(tls, iPtr+1112 /* &.varSearches */, varPtr)

	searchPtr = (*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData
__4:
	if !(searchPtr != uintptr(0)) {
		goto __6
	}
	if !((*ArraySearch)(unsafe.Pointer(searchPtr)).Fid == id) {
		goto __7
	}
	return searchPtr
__7:
	;
	goto __5
__5:
	searchPtr = (*ArraySearch)(unsafe.Pointer(searchPtr)).FnextPtr
	goto __4
	goto __6
__6:
	;
__3:
	;
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+72787, libc.VaList(bp+16, string)))
badLookup:
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, ts+3593, ts+7170, ts+72728, string, uintptr(0)))
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// DeleteSearches --
//
//	This function is called to free up all of the searches associated
//	with an array variable.
//
// Results:
//	None.
//
// Side effects:
//	Memory is released to the storage allocator.
//
//----------------------------------------------------------------------

func sDeleteSearches(tls *libc.TLS, iPtr uintptr, arrayVarPtr uintptr) { /* tclVar.c:5082:1: */
	var searchPtr uintptr
	var nextPtr uintptr
	var sPtr uintptr

	if (*Var)(unsafe.Pointer(arrayVarPtr)).Fflags&VAR_SEARCH_ACTIVE != 0 {
		sPtr = (*struct {
			f func(*libc.TLS, uintptr, uintptr) uintptr
		})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1112 /* &.varSearches */)).FfindProc})).f(tls, iPtr+1112 /* &.varSearches */, arrayVarPtr)
		for searchPtr = (*Tcl_HashEntry)(unsafe.Pointer(sPtr)).FclientData; searchPtr != uintptr(0); searchPtr = nextPtr {
			nextPtr = (*ArraySearch)(unsafe.Pointer(searchPtr)).FnextPtr
			XTclpFree(tls, searchPtr)
		}
		*(*int32)(unsafe.Pointer(arrayVarPtr)) &= libc.CplInt32(VAR_SEARCH_ACTIVE)
		XTcl_DeleteHashEntry(tls, sPtr)
	}
}

//----------------------------------------------------------------------
//
// TclDeleteNamespaceVars --
//
//	This function is called to recycle all the storage space associated
//	with a namespace's table of variables.
//
// Results:
//	None.
//
// Side effects:
//	Variables are deleted and trace functions are invoked, if any are
//	declared.
//
//----------------------------------------------------------------------

func XTclDeleteNamespaceVars(tls *libc.TLS, nsPtr uintptr) { /* tclVar.c:5121:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var tablePtr uintptr = nsPtr + 248
	var interp uintptr = (*Namespace)(unsafe.Pointer(nsPtr)).Finterp
	var iPtr uintptr = interp
	// var search Tcl_HashSearch at bp, 24

	var flags int32 = 0
	var varPtr uintptr

	// Determine what flags to pass to the trace callback functions.

	if nsPtr == (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr {
		flags = TCL_GLOBAL_ONLY
	} else if nsPtr == (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr {
		flags = TCL_NAMESPACE_ONLY
	}

	for varPtr = sVarHashFirstVar(tls, tablePtr, bp); varPtr != uintptr(0); varPtr = sVarHashFirstVar(tls, tablePtr, bp) {
		var objPtr uintptr
		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				objPtr = XTclThreadAllocObj(tls)
			} else {
				objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
		{
		}

		(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount++ // Make sure we get to remove from
		// hash.
		XTcl_GetVariableFullName(tls, interp, varPtr, objPtr)
		sUnsetVarStruct(tls, varPtr, uintptr(0), iPtr /* part1 */, objPtr,
			uintptr(0), flags, -1)

		// We just unset the variable. However, an unset trace might
		// have re-set it, or might have re-established traces on it.
		// This namespace and its vartable are going away unconditionally,
		// so we cannot let such things linger. That would be a leak.
		//
		// First we destroy all traces. ...

		if (*Var)(unsafe.Pointer(varPtr)).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0 {
			var tPtr uintptr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1024 /* &.varTraces */)).FfindProc})).f(tls, iPtr+1024 /* &.varTraces */, varPtr)
			var tracePtr uintptr = (*Tcl_HashEntry)(unsafe.Pointer(tPtr)).FclientData
			var activePtr uintptr

			for tracePtr != 0 {
				var prevPtr uintptr = tracePtr

				tracePtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr
				(*VarTrace)(unsafe.Pointer(prevPtr)).FnextPtr = uintptr(0)
				XTcl_EventuallyFree(tls, prevPtr, uintptr(3))
			}
			XTcl_DeleteHashEntry(tls, tPtr)
			*(*int32)(unsafe.Pointer(varPtr)) &= libc.CplInt32(VAR_TRACED_READ | VAR_TRACED_WRITE | VAR_TRACED_ARRAY | VAR_TRACED_UNSET)
			for activePtr = (*Interp)(unsafe.Pointer(iPtr)).FactiveVarTracePtr; activePtr != uintptr(0); activePtr = (*ActiveVarTrace)(unsafe.Pointer(activePtr)).FnextPtr {
				if (*ActiveVarTrace)(unsafe.Pointer(activePtr)).FvarPtr == varPtr {
					(*ActiveVarTrace)(unsafe.Pointer(activePtr)).FnextTracePtr = uintptr(0)
				}
			}
		}

		// ...and then, if the variable still holds a value, we unset it
		// again. This time with no traces left, we're sure it goes away.

		if !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) {
			sUnsetVarStruct(tls, varPtr, uintptr(0), iPtr /* part1 */, objPtr,
				uintptr(0), flags, -1)
		}
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = objPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		} // free no longer needed obj
		(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount--
		XTcl_DeleteHashEntry(tls, varPtr+24)
	}
	XTcl_DeleteHashTable(tls, tablePtr)
}

//----------------------------------------------------------------------
//
// TclDeleteVars --
//
//	This function is called to recycle all the storage space associated
//	with a table of variables. For this function to work correctly, it
//	must not be possible for any of the variables in the table to be
//	accessed from Tcl commands (e.g. from trace functions).
//
// Results:
//	None.
//
// Side effects:
//	Variables are deleted and trace functions are invoked, if any are
//	declared.
//
//----------------------------------------------------------------------

func XTclDeleteVars(tls *libc.TLS, iPtr uintptr, tablePtr uintptr) { /* tclVar.c:5219:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var interp uintptr = iPtr
	// var search Tcl_HashSearch at bp, 24

	var varPtr uintptr
	var flags int32
	var currNsPtr uintptr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr

	// Determine what flags to pass to the trace callback functions.

	flags = TCL_TRACE_UNSETS
	if tablePtr == (*Interp)(unsafe.Pointer(iPtr)).FglobalNsPtr+248 {
		flags = flags | TCL_GLOBAL_ONLY
	} else if tablePtr == currNsPtr+248 {
		flags = flags | TCL_NAMESPACE_ONLY
	}

	for varPtr = sVarHashFirstVar(tls, tablePtr, bp); varPtr != uintptr(0); varPtr = sVarHashFirstVar(tls, tablePtr, bp) {
		sUnsetVarStruct(tls, varPtr, uintptr(0), iPtr, *(*uintptr)(unsafe.Pointer(varPtr + 24 + 32)), uintptr(0), flags,
			-1)
		XTcl_DeleteHashEntry(tls, varPtr+24)
	}
	XTcl_DeleteHashTable(tls, tablePtr)
}

//----------------------------------------------------------------------
//
// TclDeleteCompiledLocalVars --
//
//	This function is called to recycle storage space associated with the
//	compiler-allocated array of local variables in a procedure call frame.
//	This function resembles TclDeleteVars above except that each variable
//	is stored in a call frame and not a hash table. For this function to
//	work correctly, it must not be possible for any of the variable in the
//	table to be accessed from Tcl commands (e.g. from trace functions).
//
// Results:
//	None.
//
// Side effects:
//	Variables are deleted and trace functions are invoked, if any are
//	declared.
//
//----------------------------------------------------------------------

func XTclDeleteCompiledLocalVars(tls *libc.TLS, iPtr uintptr, framePtr uintptr) { /* tclVar.c:5273:1: */
	var varPtr uintptr
	var numLocals int32
	var i int32
	var namePtrPtr uintptr

	numLocals = (*CallFrame)(unsafe.Pointer(framePtr)).FnumCompiledLocals
	varPtr = (*CallFrame)(unsafe.Pointer(framePtr)).FcompiledLocals
	namePtrPtr = (*CallFrame)(unsafe.Pointer(framePtr)).FlocalCachePtr + 8
	i = 0
__1:
	if !(i < numLocals) {
		goto __3
	}
	{
		sUnsetVarStruct(tls, varPtr, uintptr(0), iPtr, *(*uintptr)(unsafe.Pointer(namePtrPtr)), uintptr(0),
			TCL_TRACE_UNSETS, i)

	}
	goto __2
__2:
	i++
	namePtrPtr += 8
	varPtr += 16
	goto __1
	goto __3
__3:
	;
	(*CallFrame)(unsafe.Pointer(framePtr)).FnumCompiledLocals = 0
}

//----------------------------------------------------------------------
//
// DeleteArray --
//
//	This function is called to free up everything in an array variable.
//	It's the caller's responsibility to make sure that the array is no
//	longer accessible before this function is called.
//
// Results:
//	None.
//
// Side effects:
//	All storage associated with varPtr's array elements is deleted
//	(including the array's hash table). Deletion trace functions for
//	array elements are invoked, then deleted. Any pending traces for array
//	elements are also deleted.
//
//----------------------------------------------------------------------

func sDeleteArray(tls *libc.TLS, iPtr uintptr, arrayNamePtr uintptr, varPtr uintptr, flags int32, index int32) { /* tclVar.c:5314:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	// var search Tcl_HashSearch at bp, 24

	var tPtr uintptr
	var elPtr uintptr
	var activePtr uintptr
	var objPtr uintptr
	var tracePtr uintptr

	for elPtr = sVarHashFirstVar(tls, *(*uintptr)(unsafe.Pointer(varPtr + 8)), bp); elPtr != uintptr(0); elPtr = sVarHashNextVar(tls, bp) {
		if !((*Var)(unsafe.Pointer(elPtr)).Fflags&(VAR_ARRAY|VAR_LINK) != 0) && *(*uintptr)(unsafe.Pointer(elPtr + 8)) != uintptr(0) {
			objPtr = *(*uintptr)(unsafe.Pointer(elPtr + 8))
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = -1
					for ok := true; ok; ok = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, objPtr)
						} else {
							*(*uintptr)(unsafe.Pointer(objPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, objPtr)
				}
			}

			*(*uintptr)(unsafe.Pointer(elPtr + 8)) = uintptr(0)
		}

		// Lie about the validity of the hashtable entry. In this way the
		// variables will be deleted by VarHashDeleteTable.

		*(*int32)(unsafe.Pointer(elPtr)) |= VAR_DEAD_HASH
		if (*Var)(unsafe.Pointer(elPtr)).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0 {
			// Compute the array name if it was not supplied.

			if (*Var)(unsafe.Pointer(elPtr)).Fflags&VAR_TRACED_UNSET != 0 {
				var elNamePtr uintptr = *(*uintptr)(unsafe.Pointer(elPtr + 24 + 32))

				*(*int32)(unsafe.Pointer(elPtr)) &= libc.CplInt32(VAR_TRACE_ACTIVE)
				XTclObjCallVarTraces(tls, iPtr, uintptr(0), elPtr, arrayNamePtr,
					elNamePtr, flags /* leaveErrMsg */, 0, index)
			}
			tPtr = (*struct {
				f func(*libc.TLS, uintptr, uintptr) uintptr
			})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(iPtr + 1024 /* &.varTraces */)).FfindProc})).f(tls, iPtr+1024 /* &.varTraces */, elPtr)
			tracePtr = (*Tcl_HashEntry)(unsafe.Pointer(tPtr)).FclientData
			for tracePtr != 0 {
				var prevPtr uintptr = tracePtr

				tracePtr = (*VarTrace)(unsafe.Pointer(tracePtr)).FnextPtr
				(*VarTrace)(unsafe.Pointer(prevPtr)).FnextPtr = uintptr(0)
				XTcl_EventuallyFree(tls, prevPtr, uintptr(3))
			}
			XTcl_DeleteHashEntry(tls, tPtr)
			*(*int32)(unsafe.Pointer(elPtr)) &= libc.CplInt32(VAR_TRACED_READ | VAR_TRACED_WRITE | VAR_TRACED_ARRAY | VAR_TRACED_UNSET)
			for activePtr = (*Interp)(unsafe.Pointer(iPtr)).FactiveVarTracePtr; activePtr != uintptr(0); activePtr = (*ActiveVarTrace)(unsafe.Pointer(activePtr)).FnextPtr {
				if (*ActiveVarTrace)(unsafe.Pointer(activePtr)).FvarPtr == elPtr {
					(*ActiveVarTrace)(unsafe.Pointer(activePtr)).FnextTracePtr = uintptr(0)
				}
			}
		}
		*(*int32)(unsafe.Pointer(elPtr)) &= libc.CplInt32(VAR_ARRAY | VAR_LINK)
		*(*uintptr)(unsafe.Pointer(elPtr + 8)) = uintptr(0)

		// Even though array elements are not supposed to be namespace
		// variables, some combinations of [upvar] and [variable] may create
		// such beasts - see [Bug 604239]. This is necessary to avoid leaking
		// the corresponding Var struct, and is otherwise harmless.

		if (*Var)(unsafe.Pointer(elPtr)).Fflags&VAR_NAMESPACE_VAR != 0 {
			*(*int32)(unsafe.Pointer(elPtr)) &= libc.CplInt32(VAR_NAMESPACE_VAR)
			if (*Var)(unsafe.Pointer(elPtr)).Fflags&VAR_IN_HASHTABLE != 0 {
				(*VarInHash)(unsafe.Pointer(elPtr)).FrefCount--
			}
		}

	}
	XTcl_DeleteHashTable(tls, *(*uintptr)(unsafe.Pointer(varPtr + 8)))
	XTclpFree(tls, *(*uintptr)(unsafe.Pointer(varPtr + 8)))
}

//----------------------------------------------------------------------
//
// TclObjVarErrMsg --
//
//	Generate a reasonable error message describing why a variable
//	operation failed.
//
// Results:
//	None.
//
// Side effects:
//	The interp's result is set to hold a message identifying the variable
//	given by part1 and part2 and describing why the variable operation
//	failed.
//
//----------------------------------------------------------------------

func XTclVarErrMsg(tls *libc.TLS, interp uintptr, part1 uintptr, part2 uintptr, operation uintptr, reason uintptr) { /* tclVar.c:5411:1: */
	var part2Ptr uintptr = uintptr(0)
	var part1Ptr uintptr = XTcl_NewStringObj(tls, part1, -1)

	if part2 != 0 {
		part2Ptr = XTcl_NewStringObj(tls, part2, -1)
	}

	XTclObjVarErrMsg(tls, interp, part1Ptr, part2Ptr, operation, reason, -1)

	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = part1Ptr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	if part2Ptr != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = part2Ptr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
}

func XTclObjVarErrMsg(tls *libc.TLS, interp uintptr, part1Ptr uintptr, part2Ptr uintptr, operation uintptr, reason uintptr, index int32) { /* tclVar.c:5434:1: */
	bp := tls.Alloc(48)
	defer tls.Free(48)

	if !(part1Ptr != 0) {
		if index == -1 {
			XTcl_Panic(tls, ts+72813, 0)
		}
		part1Ptr = *(*uintptr)(unsafe.Pointer((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FlocalCachePtr + 8 + uintptr(index)*8))
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, ts+72857,
		libc.VaList(bp, operation, func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(part1Ptr)).Fbytes
			}
			return XTcl_GetString(tls, part1Ptr)
		}(), func() uintptr {
			if part2Ptr != 0 {
				return ts + 50354 /* "(" */
			}
			return ts + 2046 /* "" */
		}(),
			func() uintptr {
				if part2Ptr != 0 {
					return func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(part2Ptr)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(part2Ptr)).Fbytes
						}
						return XTcl_GetString(tls, part2Ptr)
					}()
				}
				return ts + 2046
			}(), func() uintptr {
				if part2Ptr != 0 {
					return ts + 3493 /* ")" */
				}
				return ts + 2046 /* "" */
			}(),
			reason)))
}

//----------------------------------------------------------------------
//
// Internal functions for variable name object types --
//
//----------------------------------------------------------------------

// Panic functions that should never be called in normal operation.

func sPanicOnUpdateVarName(tls *libc.TLS, objPtr uintptr) { /* tclVar.c:5470:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	XTcl_Panic(tls, ts+72881, libc.VaList(bp, ts+72916,
		(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).Fname))
}

func sPanicOnSetVarName(tls *libc.TLS, interp uintptr, objPtr uintptr) int32 { /* tclVar.c:5478:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	XTcl_Panic(tls, ts+72881, libc.VaList(bp, ts+72933,
		(*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).Fname))
	return TCL_ERROR
}

// localVarName -
//
// INTERNALREP DEFINITION:
//   twoPtrValue.ptr1:   pointer to name obj in varFramePtr->localCache
//			  or NULL if it is this same obj
//   twoPtrValue.ptr2: index into locals table

func sFreeLocalVarName(tls *libc.TLS, objPtr uintptr) { /* tclVar.c:5497:1: */
	var namePtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))

	if namePtr != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = namePtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

func sDupLocalVarName(tls *libc.TLS, srcPtr uintptr, dupPtr uintptr) { /* tclVar.c:5509:1: */
	var namePtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))

	if !(namePtr != 0) {
		namePtr = srcPtr
	}
	*(*uintptr)(unsafe.Pointer(dupPtr + 32)) = namePtr
	(*Tcl_Obj)(unsafe.Pointer(namePtr)).FrefCount++

	*(*uintptr)(unsafe.Pointer(dupPtr + 32 + 8 /* &.ptr2 */)) = *(*uintptr)(unsafe.Pointer(srcPtr + 32 + 8 /* &.ptr2 */))
	(*Tcl_Obj)(unsafe.Pointer(dupPtr)).FtypePtr = uintptr(unsafe.Pointer(&localVarNameType))
}

// parsedVarName -
//
// INTERNALREP DEFINITION:
//   twoPtrValue.ptr1 = pointer to the array name Tcl_Obj (NULL if scalar)
//   twoPtrValue.ptr2 = pointer to the element name string (owned by this
//			Tcl_Obj), or NULL if it is a scalar variable

func sFreeParsedVarName(tls *libc.TLS, objPtr uintptr) { /* tclVar.c:5536:1: */
	var arrayPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	var elem uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */))

	if arrayPtr != uintptr(0) {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(arrayPtr)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(arrayPtr)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(arrayPtr)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(arrayPtr)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(arrayPtr)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(arrayPtr)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(arrayPtr)).Flength = -1
				for ok := true; ok; ok = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, arrayPtr)
					} else {
						*(*uintptr)(unsafe.Pointer(arrayPtr + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = arrayPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, arrayPtr)
			}
		}

		XTclpFree(tls, elem)
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
}

func sDupParsedVarName(tls *libc.TLS, srcPtr uintptr, dupPtr uintptr) { /* tclVar.c:5550:1: */
	var arrayPtr uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32))
	var elem uintptr = *(*uintptr)(unsafe.Pointer(srcPtr + 32 + 8 /* &.ptr2 */))
	var elemCopy uintptr
	var elemLen uint32

	if arrayPtr != uintptr(0) {
		(*Tcl_Obj)(unsafe.Pointer(arrayPtr)).FrefCount++
		elemLen = uint32(libc.Xstrlen(tls, elem))
		elemCopy = XTcl_Alloc(tls, elemLen+uint32(1))
		libc.Xmemcpy(tls, elemCopy, elem, uint64(elemLen))
		*(*int8)(unsafe.Pointer(elemCopy + uintptr(elemLen))) = int8(0)
		elem = elemCopy
	}

	*(*uintptr)(unsafe.Pointer(dupPtr + 32)) = arrayPtr
	*(*uintptr)(unsafe.Pointer(dupPtr + 32 + 8 /* &.ptr2 */)) = elem
	(*Tcl_Obj)(unsafe.Pointer(dupPtr)).FtypePtr = uintptr(unsafe.Pointer(&tclParsedVarNameType))
}

func sUpdateParsedVarName(tls *libc.TLS, objPtr uintptr) { /* tclVar.c:5574:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var arrayPtr uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
	var part2 uintptr = *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8 /* &.ptr2 */))
	var part1 uintptr
	var p uintptr
	// var len1 int32 at bp, 4

	var len2 int32
	var totalLen int32

	if arrayPtr == uintptr(0) {
		// This is a parsed scalar name: what is it doing here?

		XTcl_Panic(tls, ts+72948, 0)
	}

	part1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(arrayPtr)).Fbytes != 0 {
			return func() uintptr {
				*(*int32)(unsafe.Pointer(bp)) = (*Tcl_Obj)(unsafe.Pointer(arrayPtr)).Flength
				return (*Tcl_Obj)(unsafe.Pointer(arrayPtr)).Fbytes
			}()
		}
		return XTcl_GetStringFromObj(tls, arrayPtr, bp)
	}()
	len2 = int32(libc.Xstrlen(tls, part2))

	totalLen = *(*int32)(unsafe.Pointer(bp)) + len2 + 2
	p = XTcl_Alloc(tls, uint32(totalLen+1))
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = p
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = totalLen

	libc.Xmemcpy(tls, p, part1, uint64(*(*int32)(unsafe.Pointer(bp /* len1 */))))
	p += uintptr(*(*int32)(unsafe.Pointer(bp /* len1 */)))
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8('(')
	libc.Xmemcpy(tls, p, part2, uint64(len2))
	p += uintptr(len2)
	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8(')')
	*(*int8)(unsafe.Pointer(p)) = int8(0)
}

//----------------------------------------------------------------------
//
// Tcl_FindNamespaceVar -- MOVED OVER from tclNamesp.c
//
//	Searches for a namespace variable, a variable not local to a
//	procedure. The variable can be either a scalar or an array, but may
//	not be an element of an array.
//
// Results:
//	Returns a token for the variable if it is found. Otherwise, if it
//	can't be found or there is an error, returns NULL and leaves an error
//	message in the interpreter's result object if "flags" contains
//	TCL_LEAVE_ERR_MSG.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_FindNamespaceVar(tls *libc.TLS, interp uintptr, name uintptr, contextNsPtr uintptr, flags int32) Tcl_Var { /* tclVar.c:5630:1: */
	var namePtr uintptr = XTcl_NewStringObj(tls, name, -1)
	var var1 Tcl_Var

	var1 = sObjFindNamespaceVar(tls, interp, namePtr, contextNsPtr, flags)
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = namePtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
	return var1
}

func sObjFindNamespaceVar(tls *libc.TLS, interp uintptr, namePtr uintptr, contextNsPtr uintptr, flags int32) Tcl_Var { /* tclVar.c:5661:1: */
	bp := tls.Alloc(88)
	defer tls.Free(88)

	var iPtr uintptr = interp
	var resPtr uintptr
	// var nsPtr [2]uintptr at bp+56, 16

	// var cxtNsPtr uintptr at bp+72, 8

	// var simpleName uintptr at bp+80, 8

	var varPtr uintptr
	var search int32
	var result int32
	// var var1 Tcl_Var at bp+48, 8

	var simpleNamePtr uintptr
	var name uintptr = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(namePtr)).Fbytes
		}
		return XTcl_GetString(tls, namePtr)
	}()

	// If this namespace has a variable resolver, then give it first crack at
	// the variable resolution. It may return a Tcl_Var value, it may signal
	// to continue onward, or it may signal an error.

	if flags&TCL_GLOBAL_ONLY != 0 {
		*(*uintptr)(unsafe.Pointer(bp + 72 /* cxtNsPtr */)) = (*Interp)(unsafe.Pointer(interp)).FglobalNsPtr
	} else if contextNsPtr != uintptr(0) {
		*(*uintptr)(unsafe.Pointer(bp + 72 /* cxtNsPtr */)) = contextNsPtr
	} else {
		*(*uintptr)(unsafe.Pointer(bp + 72 /* cxtNsPtr */)) = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr
	}

	if !(flags&TCL_AVOID_RESOLVERS != 0) && ((*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FvarResProc != uintptr(0) || (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr != uintptr(0)) {
		resPtr = (*Interp)(unsafe.Pointer(iPtr)).FresolverPtr

		if (*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FvarResProc != 0 {
			result = (*struct {
				f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
			})(unsafe.Pointer(&struct{ uintptr }{(*Namespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 /* cxtNsPtr */)))).FvarResProc})).f(tls, interp, name,
				*(*uintptr)(unsafe.Pointer(bp + 72 /* cxtNsPtr */)), flags, bp+48)
		} else {
			result = TCL_CONTINUE
		}

		for result == TCL_CONTINUE && resPtr != 0 {
			if (*ResolverScheme)(unsafe.Pointer(resPtr)).FvarResProc != 0 {
				result = (*struct {
					f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
				})(unsafe.Pointer(&struct{ uintptr }{(*ResolverScheme)(unsafe.Pointer(resPtr)).FvarResProc})).f(tls, interp, name,
					*(*uintptr)(unsafe.Pointer(bp + 72 /* cxtNsPtr */)), flags, bp+48 /* &var1 */)
			}
			resPtr = (*ResolverScheme)(unsafe.Pointer(resPtr)).FnextPtr
		}

		if result == TCL_OK {
			return *(*Tcl_Var)(unsafe.Pointer(bp + 48 /* var1 */))
		} else if result != TCL_CONTINUE {
			return uintptr(0)
		}
	}

	// Find the namespace(s) that contain the variable.

	XTclGetNamespaceForQualName(tls, interp, name, contextNsPtr,
		flags, bp+56, bp+56+1*8, bp+72, bp+80)

	// Look for the variable in the variable table of its namespace. Be sure
	// to check both possible search paths: from the specified namespace
	// context and from the global namespace.

	varPtr = uintptr(0)
	if *(*uintptr)(unsafe.Pointer(bp + 80)) != name {
		simpleNamePtr = XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* simpleName */)), -1)
	} else {
		simpleNamePtr = namePtr
	}

	for search = 0; search < 2 && varPtr == uintptr(0); search++ {
		if *(*uintptr)(unsafe.Pointer(bp + 56 + uintptr(search)*8)) != uintptr(0) && *(*uintptr)(unsafe.Pointer(bp + 80)) != uintptr(0) {
			varPtr = sVarHashCreateVar1(tls, *(*uintptr)(unsafe.Pointer(bp + 56 + uintptr(search)*8))+248, simpleNamePtr, uintptr(0))
		}
	}
	if *(*uintptr)(unsafe.Pointer(bp + 80)) != name {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = simpleNamePtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if varPtr == uintptr(0) && flags&TCL_LEAVE_ERR_MSG != 0 {
		XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
			ts+72990, libc.VaList(bp, name)))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+7170, ts+14261, name, uintptr(0)))
	}
	return varPtr
}

//----------------------------------------------------------------------
//
// InfoVarsCmd -- (moved over from tclCmdIL.c)
//
//	Called to implement the "info vars" command that returns the list of
//	variables in the interpreter that match an optional pattern. The
//	pattern, if any, consists of an optional sequence of namespace names
//	separated by "::" qualifiers, which is followed by a glob-style
//	pattern that restricts which variables are returned. Handles the
//	following syntax:
//
//	    info vars ?pattern?
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func XTclInfoVarsCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:5795:1: */
	bp := tls.Alloc(56)
	defer tls.Free(56)

	var iPtr uintptr = interp
	var varName uintptr
	var pattern uintptr
	// var simplePattern uintptr at bp+24, 8

	// var search Tcl_HashSearch at bp+32, 24

	var varPtr uintptr
	// var nsPtr uintptr at bp, 8

	var globalNsPtr uintptr = XTcl_GetGlobalNamespace(tls, interp)
	var currNsPtr uintptr = XTcl_GetCurrentNamespace(tls, interp)
	var listPtr uintptr
	var elemObjPtr uintptr
	var varNamePtr uintptr
	var specificNsInPattern int32 = 0 // Init. to avoid compiler warning.
	var simplePatternPtr uintptr = uintptr(0)

	// Get the pattern and find the "effective namespace" in which to list
	// variables. We only use this effective namespace if there's no active
	// Tcl procedure frame.

	if objc == 1 {
		*(*uintptr)(unsafe.Pointer(bp + 24 /* simplePattern */)) = uintptr(0)
		*(*uintptr)(unsafe.Pointer(bp /* nsPtr */)) = currNsPtr
		specificNsInPattern = 0
	} else if objc == 2 {
		// From the pattern, get the effective namespace and the simple
		// pattern (no namespace qualifiers or ::'s) at the end. If an error
		// was found while parsing the pattern, return it. Otherwise, if the
		// namespace wasn't found, just leave nsPtr NULL: we will return an
		// empty list since no variables there can be found.

		// var dummy1NsPtr uintptr at bp+8, 8

		// var dummy2NsPtr uintptr at bp+16, 8

		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}()
		XTclGetNamespaceForQualName(tls, interp, pattern, uintptr(0), 0,
			bp, bp+8, bp+16, bp+24)

		if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) { // We successfully found the pattern's ns.
			specificNsInPattern = libc.Bool32(libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), pattern) != 0)
			if *(*uintptr)(unsafe.Pointer(bp + 24)) == pattern {
				simplePatternPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
			} else {
				simplePatternPtr = XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* simplePattern */)), -1)
			}
			(*Tcl_Obj)(unsafe.Pointer(simplePatternPtr)).FrefCount++
		}
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13546)
		return TCL_ERROR
	}

	// If the namespace specified in the pattern wasn't found, just return.

	if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
		return TCL_OK
	}

	listPtr = XTcl_NewListObj(tls, 0, uintptr(0))

	if !((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FisProcCallFrame&FRAME_IS_PROC != 0) || specificNsInPattern != 0 {
		// There is no frame pointer, the frame pointer was pushed only to
		// activate a namespace, or we are in a procedure call frame but a
		// specific namespace was specified. Create a list containing only the
		// variables in the effective namespace's variable table.

		if *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 && libc.Xstrpbrk(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), ts+13556) == uintptr(0) {
			// If we can just do hash lookups, that simplifies things a lot.

			varPtr = sVarHashCreateVar1(tls, *(*uintptr)(unsafe.Pointer(bp))+248, simplePatternPtr, uintptr(0))
			if varPtr != 0 {
				if !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) ||
					(*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_NAMESPACE_VAR != 0 {
					if specificNsInPattern != 0 {
						for ok := true; ok; ok = 0 != 0 {
							var cachePtr uintptr
							if uintptr(0) == uintptr(0) || func() bool {
								cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
								return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
							}() {
								elemObjPtr = XTclThreadAllocObj(tls)
							} else {
								elemObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
								(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(elemObjPtr + 32))
								(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
							}
						}
						(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount = 0
						(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes = XtclEmptyStringRep
						(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = 0
						(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr = uintptr(0)
						{
						}

						XTcl_GetVariableFullName(tls, interp, varPtr,
							elemObjPtr)
					} else {
						elemObjPtr = *(*uintptr)(unsafe.Pointer(varPtr + 24 + 32))
					}
					XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr)
				}
			} else if *(*uintptr)(unsafe.Pointer(bp)) != globalNsPtr && !(specificNsInPattern != 0) {
				varPtr = sVarHashCreateVar1(tls, globalNsPtr+248, simplePatternPtr, uintptr(0))
				if varPtr != 0 {
					if !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) ||
						(*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_NAMESPACE_VAR != 0 {
						XTcl_ListObjAppendElement(tls, interp, listPtr,
							*(*uintptr)(unsafe.Pointer(varPtr + 24 + 32)))
					}
				}
			}
		} else {
			// Have to scan the tables of variables.

			varPtr = sVarHashFirstVar(tls, *(*uintptr)(unsafe.Pointer(bp))+248, bp+32)
			for varPtr != 0 {
				if !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) ||
					(*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_NAMESPACE_VAR != 0 {
					varNamePtr = *(*uintptr)(unsafe.Pointer(varPtr + 24 + 32))
					varName = func() uintptr {
						if (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes != 0 {
							return (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes
						}
						return XTcl_GetString(tls, varNamePtr)
					}()
					if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) ||
						XTcl_StringMatch(tls, varName, *(*uintptr)(unsafe.Pointer(bp + 24))) != 0 {
						if specificNsInPattern != 0 {
							for ok1 := true; ok1; ok1 = 0 != 0 {
								var cachePtr uintptr
								if uintptr(0) == uintptr(0) || func() bool {
									cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
									return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
								}() {
									elemObjPtr = XTclThreadAllocObj(tls)
								} else {
									elemObjPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
									(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(elemObjPtr + 32))
									(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
								}
							}
							(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount = 0
							(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes = XtclEmptyStringRep
							(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = 0
							(*Tcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr = uintptr(0)
							{
							}

							XTcl_GetVariableFullName(tls, interp, varPtr,
								elemObjPtr)
						} else {
							elemObjPtr = varNamePtr
						}
						XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr)
					}
				}
				varPtr = sVarHashNextVar(tls, bp+32)
			}

			// If the effective namespace isn't the global :: namespace, and a
			// specific namespace wasn't requested in the pattern (i.e., the
			// pattern only specifies variable names), then add in all global
			// :: variables that match the simple pattern. Of course, add in
			// only those variables that aren't hidden by a variable in the
			// effective namespace.

			if *(*uintptr)(unsafe.Pointer(bp)) != globalNsPtr && !(specificNsInPattern != 0) {
				varPtr = sVarHashFirstVar(tls, globalNsPtr+248, bp+32)
				for varPtr != 0 {
					if !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) ||
						(*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_NAMESPACE_VAR != 0 {
						varNamePtr = *(*uintptr)(unsafe.Pointer(varPtr + 24 + 32))
						varName = func() uintptr {
							if (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes != 0 {
								return (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes
							}
							return XTcl_GetString(tls, varNamePtr)
						}()
						if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) ||
							XTcl_StringMatch(tls, varName, *(*uintptr)(unsafe.Pointer(bp + 24))) != 0 {
							if sVarHashCreateVar1(tls, *(*uintptr)(unsafe.Pointer(bp))+248, varNamePtr, uintptr(0)) == uintptr(0) {
								XTcl_ListObjAppendElement(tls, interp, listPtr,
									varNamePtr)
							}
						}
					}
					varPtr = sVarHashNextVar(tls, bp+32)
				}
			}
		}
	} else if (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FprocPtr != uintptr(0) {
		sAppendLocals(tls, interp, listPtr, simplePatternPtr, 1)
	}

	if simplePatternPtr != 0 {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = simplePatternPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// InfoGlobalsCmd -- (moved over from tclCmdIL.c)
//
//	Called to implement the "info globals" command that returns the list
//	of global variables matching an optional pattern. Handles the
//	following syntax:
//
//	    info globals ?pattern?
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func XTclInfoGlobalsCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:5986:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var varName uintptr
	var pattern uintptr
	var globalNsPtr uintptr = XTcl_GetGlobalNamespace(tls, interp)
	// var search Tcl_HashSearch at bp, 24

	var varPtr uintptr
	var listPtr uintptr
	var varNamePtr uintptr
	var patternPtr uintptr

	if objc == 1 {
		pattern = uintptr(0)
	} else if objc == 2 {
		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}()

		// Strip leading global-namespace qualifiers. [Bug 1057461]

		if int32(*(*int8)(unsafe.Pointer(pattern))) == ':' && int32(*(*int8)(unsafe.Pointer(pattern + 1))) == ':' {
			for int32(*(*int8)(unsafe.Pointer(pattern))) == ':' {
				pattern++
			}
		}
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13546)
		return TCL_ERROR
	}

	// Scan through the global :: namespace's variable table and create a list
	// of all global variables that match the pattern.

	listPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	if pattern != uintptr(0) && libc.Xstrpbrk(tls, pattern, ts+13556) == uintptr(0) {
		if pattern == func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes
			}
			return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))
		}() {
			patternPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
		} else {
			patternPtr = XTcl_NewStringObj(tls, pattern, -1)
		}
		(*Tcl_Obj)(unsafe.Pointer(patternPtr)).FrefCount++

		varPtr = sVarHashCreateVar1(tls, globalNsPtr+248, patternPtr, uintptr(0))
		if varPtr != 0 {
			if !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) {
				XTcl_ListObjAppendElement(tls, interp, listPtr,
					*(*uintptr)(unsafe.Pointer(varPtr + 24 + 32)))
			}
		}
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = patternPtr
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	} else {
		for varPtr = sVarHashFirstVar(tls, globalNsPtr+248, bp); varPtr != uintptr(0); varPtr = sVarHashNextVar(tls, bp) {
			if *(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0) {
				continue
			}
			varNamePtr = *(*uintptr)(unsafe.Pointer(varPtr + 24 + 32))
			varName = func() uintptr {
				if (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes != 0 {
					return (*Tcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes
				}
				return XTcl_GetString(tls, varNamePtr)
			}()
			if pattern == uintptr(0) || XTcl_StringMatch(tls, varName, pattern) != 0 {
				XTcl_ListObjAppendElement(tls, interp, listPtr, varNamePtr)
			}
		}
	}
	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// TclInfoLocalsCmd -- (moved over from tclCmdIl.c)
//
//	Called to implement the "info locals" command to return a list of
//	local variables that match an optional pattern. Handles the following
//	syntax:
//
//	    info locals ?pattern?
//
// Results:
//	Returns TCL_OK if successful and TCL_ERROR if there is an error.
//
// Side effects:
//	Returns a result in the interpreter's result object. If there is an
//	error, the result is an error message.
//
//----------------------------------------------------------------------

func XTclInfoLocalsCmd(tls *libc.TLS, dummy ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclVar.c:6079:1: */
	var iPtr uintptr = interp
	var patternPtr uintptr
	var listPtr uintptr

	if objc == 1 {
		patternPtr = uintptr(0)
	} else if objc == 2 {
		patternPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8))
	} else {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13546)
		return TCL_ERROR
	}

	if !((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FisProcCallFrame&FRAME_IS_PROC != 0) {
		return TCL_OK
	}

	// Return a list containing names of first the compiled locals (i.e. the
	// ones stored in the call frame), then the variables in the local hash
	// table (if one exists).

	listPtr = XTcl_NewListObj(tls, 0, uintptr(0))
	sAppendLocals(tls, interp, listPtr, patternPtr, 0)
	XTcl_SetObjResult(tls, interp, listPtr)
	return TCL_OK
}

//----------------------------------------------------------------------
//
// AppendLocals --
//
//	Append the local variables for the current frame to the specified list
//	object.
//
// Results:
//	None.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func sAppendLocals(tls *libc.TLS, interp uintptr, listPtr uintptr, patternPtr uintptr, includeLinks int32) { /* tclVar.c:6131:1: */
	bp := tls.Alloc(120)
	defer tls.Free(120)

	var iPtr uintptr
	var varPtr uintptr
	var i int32
	var localVarCt int32
	// var added int32 at bp+88, 4

	var objNamePtr uintptr
	var varName uintptr
	var localVarTablePtr uintptr
	// var search Tcl_HashSearch at bp+96, 24

	// var addedTable Tcl_HashTable at bp, 88

	var pattern uintptr
	var varNamePtr uintptr
	var contextPtr uintptr
	var mPtr uintptr
	iPtr = interp
	if patternPtr != 0 {
		pattern = func() uintptr {
			if (*Tcl_Obj)(unsafe.Pointer(patternPtr)).Fbytes != 0 {
				return (*Tcl_Obj)(unsafe.Pointer(patternPtr)).Fbytes
			}
			return XTcl_GetString(tls, patternPtr)
		}()
	} else {
		pattern = uintptr(0)
	}

	localVarCt = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnumCompiledLocals
	varPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FcompiledLocals
	localVarTablePtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FvarTablePtr
	if !(includeLinks != 0) {
		goto __1
	}
	XTcl_InitObjHashTable(tls, bp)
__1:
	;

	if !(localVarCt > 0) {
		goto __2
	}
	varNamePtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr + 8

	i = 0
__3:
	if !(i < localVarCt) {
		goto __5
	}
	// Skip nameless (temporary) variables and undefined variables.

	if !(*(*uintptr)(unsafe.Pointer(varNamePtr)) != 0 && !(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) &&
		(includeLinks != 0 || !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_LINK != 0))) {
		goto __6
	}
	varName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(varNamePtr)))).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(varNamePtr)))).Fbytes
		}
		return XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(varNamePtr)))
	}()
	if !(pattern == uintptr(0) || XTcl_StringMatch(tls, varName, pattern) != 0) {
		goto __7
	}
	XTcl_ListObjAppendElement(tls, interp, listPtr, *(*uintptr)(unsafe.Pointer(varNamePtr)))
	if !(includeLinks != 0) {
		goto __8
	}
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &addedTable */)).FcreateProc})).f(tls, bp /* &addedTable */, *(*uintptr)(unsafe.Pointer(varNamePtr)), bp+88 /* &added */)
__8:
	;
__7:
	;
__6:
	;
	varPtr += 16
	goto __4
__4:
	i++
	varNamePtr += 8
	goto __3
	goto __5
__5:
	;
__2:
	;

	// Do nothing if no local variables.

	if !(localVarTablePtr == uintptr(0)) {
		goto __9
	}
	goto objectVars
__9:
	;

	// Check for the simple and fast case.

	if !(pattern != uintptr(0) && libc.Xstrpbrk(tls, pattern, ts+13556) == uintptr(0)) {
		goto __10
	}
	varPtr = sVarHashCreateVar1(tls, localVarTablePtr, patternPtr, uintptr(0))
	if !(varPtr != uintptr(0)) {
		goto __11
	}
	if !(!(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) &&
		(includeLinks != 0 || !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_LINK != 0))) {
		goto __12
	}
	XTcl_ListObjAppendElement(tls, interp, listPtr,
		*(*uintptr)(unsafe.Pointer(varPtr + 24 + 32)))
	if !(includeLinks != 0) {
		goto __13
	}
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &addedTable */)).FcreateProc})).f(tls, bp /* &addedTable */, *(*uintptr)(unsafe.Pointer(varPtr + 24 /* &.entry */ + 32 /* &.key */)), bp+88 /* &added */)
__13:
	;
__12:
	;
__11:
	;
	goto objectVars
__10:
	;

	// Scan over and process all local variables.

	varPtr = sVarHashFirstVar(tls, localVarTablePtr, bp+96)
__14:
	if !(varPtr != uintptr(0)) {
		goto __16
	}
	if !(!(*(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0)) &&
		(includeLinks != 0 || !((*Var)(unsafe.Pointer(varPtr)).Fflags&VAR_LINK != 0))) {
		goto __17
	}
	objNamePtr = *(*uintptr)(unsafe.Pointer(varPtr + 24 + 32))
	varName = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objNamePtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objNamePtr)).Fbytes
		}
		return XTcl_GetString(tls, objNamePtr)
	}()
	if !(pattern == uintptr(0) || XTcl_StringMatch(tls, varName, pattern) != 0) {
		goto __18
	}
	XTcl_ListObjAppendElement(tls, interp, listPtr, objNamePtr)
	if !(includeLinks != 0) {
		goto __19
	}
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &addedTable */)).FcreateProc})).f(tls, bp /* &addedTable */, objNamePtr, bp+88 /* &added */)
__19:
	;
__18:
	;
__17:
	;
	goto __15
__15:
	varPtr = sVarHashNextVar(tls, bp+96)
	goto __14
	goto __16
__16:
	;

objectVars:
	if !!(includeLinks != 0) {
		goto __20
	}
	return
__20:
	;

	if !((*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FisProcCallFrame&FRAME_IS_METHOD != 0) {
		goto __21
	}
	contextPtr = (*CallFrame)(unsafe.Pointer((*Interp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FclientData
	mPtr = (*MInvoke)(unsafe.Pointer((*CallChain)(unsafe.Pointer((*CallContext)(unsafe.Pointer(contextPtr)).FcallPtr)).Fchain + uintptr((*CallContext)(unsafe.Pointer(contextPtr)).Findex)*24)).FmPtr

	if !((*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr != 0) {
		goto __22
	}
	i = 0
__24:
	if !(i < (*Object1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr)).Fvariables.Fnum) {
		goto __26
	}
	if !(*(*uintptr)(unsafe.Pointer((*Object1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __27
	}
	goto __25
	goto __28
__27:
	if !func() bool {
		objNamePtr = *(*uintptr)(unsafe.Pointer((*Object1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringObjectPtr)).Fvariables.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __29
	}
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &addedTable */)).FcreateProc})).f(tls, bp /* &addedTable */, objNamePtr, bp+88 /* &added */)
	if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0 && (!(pattern != 0) || XTcl_StringMatch(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objNamePtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objNamePtr)).Fbytes
		}
		return XTcl_GetString(tls, objNamePtr)
	}(), pattern) != 0)) {
		goto __30
	}
	XTcl_ListObjAppendElement(tls, interp, listPtr, objNamePtr)
__30:
	;
__29:
	;
__28:
	;
	goto __25
__25:
	i++
	goto __24
	goto __26
__26:
	;
	goto __23
__22:
	i = 0
__31:
	if !(i < (*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr)).Fvariables.Fnum) {
		goto __33
	}
	if !(*(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr)).Fvariables.Flist + uintptr(i)*8)) == uintptr(0)) {
		goto __34
	}
	goto __32
	goto __35
__34:
	if !func() bool {
		objNamePtr = *(*uintptr)(unsafe.Pointer((*Class1)(unsafe.Pointer((*Method)(unsafe.Pointer(mPtr)).FdeclaringClassPtr)).Fvariables.Flist + uintptr(i)*8))
		return 1 != 0
	}() {
		goto __36
	}
	(*struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
	})(unsafe.Pointer(&struct{ uintptr }{(*Tcl_HashTable)(unsafe.Pointer(bp /* &addedTable */)).FcreateProc})).f(tls, bp /* &addedTable */, objNamePtr, bp+88 /* &added */)
	if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0 && (!(pattern != 0) || XTcl_StringMatch(tls, func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objNamePtr)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objNamePtr)).Fbytes
		}
		return XTcl_GetString(tls, objNamePtr)
	}(), pattern) != 0)) {
		goto __37
	}
	XTcl_ListObjAppendElement(tls, interp, listPtr, objNamePtr)
__37:
	;
__36:
	;
__35:
	;
	goto __32
__32:
	i++
	goto __31
	goto __33
__33:
	;
__23:
	;
__21:
	;
	XTcl_DeleteHashTable(tls, bp)
}

// Hash table implementation - first, just copy and adapt the obj key stuff

func XTclInitVarHashTable(tls *libc.TLS, tablePtr uintptr, nsPtr uintptr) { /* tclVar.c:6259:1: */
	XTcl_InitCustomHashTable(tls, tablePtr,
		-2, uintptr(unsafe.Pointer(&tclVarHashKeyType)))
	(*TclVarHashTable)(unsafe.Pointer(tablePtr)).FnsPtr = nsPtr
}

func sAllocVarEntry(tls *libc.TLS, tablePtr uintptr, keyPtr uintptr) uintptr { /* tclVar.c:6268:22: */
	var objPtr uintptr = keyPtr
	var hPtr uintptr
	var varPtr uintptr

	varPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(VarInHash{})))
	(*Var)(unsafe.Pointer(varPtr)).Fflags = VAR_IN_HASHTABLE
	*(*uintptr)(unsafe.Pointer(varPtr + 8)) = uintptr(0)
	(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount = 1

	hPtr = varPtr + 24
	(*Tcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = varPtr
	*(*uintptr)(unsafe.Pointer(hPtr + 32)) = objPtr
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++

	return hPtr
}

func sFreeVarEntry(tls *libc.TLS, hPtr uintptr) { /* tclVar.c:6291:1: */
	var varPtr uintptr = hPtr - uintptr(int32(uintptr(0)+24))
	var objPtr uintptr = *(*uintptr)(unsafe.Pointer(hPtr + 32))

	if *(*uintptr)(unsafe.Pointer(varPtr + 8)) == uintptr(0) && !((*Var)(unsafe.Pointer(varPtr)).Fflags&(VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) != 0) &&
		(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount == 1 {
		XTclpFree(tls, varPtr)
	} else {
		*(*int32)(unsafe.Pointer(varPtr)) |= VAR_DEAD_HASH
		*(*int32)(unsafe.Pointer(varPtr)) &= libc.CplInt32(VAR_ARRAY | VAR_LINK)
		*(*uintptr)(unsafe.Pointer(varPtr + 8)) = uintptr(0)
		(*VarInHash)(unsafe.Pointer(varPtr)).FrefCount--
	}
	for ok := true; ok; ok = 0 != 0 {
		var _objPtr uintptr = objPtr
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
			XTclFreeObj(tls, _objPtr)
		}
	}
}

func sCompareVarKeys(tls *libc.TLS, keyPtr uintptr, hPtr uintptr) int32 { /* tclVar.c:6309:1: */
	var objPtr1 uintptr = keyPtr
	var objPtr2 uintptr = *(*uintptr)(unsafe.Pointer(hPtr + 32))
	var p1 uintptr
	var p2 uintptr
	var l1 int32
	var l2 int32

	//
	//  If the object pointers are the same then they match.
	//  OPT: this comparison was moved to the caller
	//
	//        if (objPtr1 == objPtr2) return 1;
	//

	// Don't use Tcl_GetStringFromObj as it would prevent l1 and l2 being in a
	// register.

	p1 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes
		}
		return XTcl_GetString(tls, objPtr1)
	}()
	l1 = (*Tcl_Obj)(unsafe.Pointer(objPtr1)).Flength
	p2 = func() uintptr {
		if (*Tcl_Obj)(unsafe.Pointer(objPtr2)).Fbytes != 0 {
			return (*Tcl_Obj)(unsafe.Pointer(objPtr2)).Fbytes
		}
		return XTcl_GetString(tls, objPtr2)
	}()
	l2 = (*Tcl_Obj)(unsafe.Pointer(objPtr2)).Flength

	// Only compare string representations of the same length.

	return libc.Bool32(l1 == l2 && !(libc.Xmemcmp(tls, p1, p2, uint64(l1)) != 0))
}

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// Epoch of the tcl environment
// (if changed with tcl-env).

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:
// zlib.h -- interface of the 'zlib' general purpose compression library
//   version 1.2.11, January 15th, 2017
//
//   Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
//
//   This software is provided 'as-is', without any express or implied
//   warranty.  In no event will the authors be held liable for any damages
//   arising from the use of this software.
//
//   Permission is granted to anyone to use this software for any purpose,
//   including commercial applications, and to alter it and redistribute it
//   freely, subject to the following restrictions:
//
//   1. The origin of this software must not be misrepresented; you must not
//      claim that you wrote the original software. If you use this software
//      in a product, an acknowledgment in the product documentation would be
//      appreciated but is not required.
//   2. Altered source versions must be plainly marked as such, and must not be
//      misrepresented as being the original software.
//   3. This notice may not be removed or altered from any source distribution.
//
//   Jean-loup Gailly        Mark Adler
//   jloup@gzip.org          madler@alumni.caltech.edu
//
//
//   The data format used by the zlib library is described by RFCs (Request for
//   Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
//   (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).

// zconf.h -- configuration of the zlib compression library
// Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
// For conditions of distribution and use, see copyright notice in zlib.h

// @(#) $Id$

// If you *really* need a unique prefix for all types and library functions,
// compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
// Even better than compiling with -DZ_PREFIX would be to use configure to set
// this permanently in zconf.h using "./configure --zprefix".

// Compile with -DMAXSEG_64K if the alloc function cannot allocate more
// than 64k bytes at a time (needed on systems with 16-bit int).

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.17  Common definitions  <stddef.h>
type Z_size_t = Size_t /* zconf.h:248:21 */

// Maximum value for memLevel in deflateInit2

// Maximum value for windowBits in deflateInit2 and inflateInit2.
// WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
// created by gzip. (Files created by minigzip can still be extracted by
// gzip.)

// The memory requirements for deflate are (in bytes):
//             (1 << (windowBits+2)) +  (1 << (memLevel+9))
//  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
//  plus a few kilobytes for small objects. For example, if you want to reduce
//  the default memory requirements from 256K to 128K, compile with
//      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
//  Of course this will generally degrade compression (there's no free lunch).
//
//    The memory requirements for inflate are (in bytes) 1 << windowBits
//  that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
//  for small objects.

// Type declarations

// The following definitions for FAR are needed only for MSDOS mixed
// model programming (small or medium model with some far allocations).
// This was tested only with MSC; for other MSDOS compilers you may have
// to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
// just define FAR to be empty.

type Byte = uint8   /* zconf.h:391:24 */ // 8 bits
type UInt = uint32  /* zconf.h:393:24 */ // 16 bits or more
type ULong = uint64 /* zconf.h:394:24 */ // 32 bits or more

type Bytef = Byte   /* zconf.h:400:22 */
type Charf = int8   /* zconf.h:402:19 */
type Intf = int32   /* zconf.h:403:19 */
type UIntf = UInt   /* zconf.h:404:19 */
type ULongf = ULong /* zconf.h:405:19 */

type Voidpc = uintptr /* zconf.h:408:23 */
type Voidpf = uintptr /* zconf.h:409:23 */
type Voidp = uintptr  /* zconf.h:410:23 */

// Copyright (C) 1992-2020 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
// <http://www.gnu.org/licenses/>.

// This administrivia gets added to the beginning of limits.h
//    if the system has its own version of limits.h.

// We use _GCC_LIMITS_H_ because we want this not to match
//    any macros that the system's limits.h uses for its own purposes.

type Z_crc_t = uint32 /* zconf.h:429:17 */

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 2.6 Primitive System Data Types	<sys/types.h>

// Copyright (C) 1989-2020 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
// <http://www.gnu.org/licenses/>.

// ISO C Standard:  7.15  Variable arguments  <stdarg.h>

// a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
// "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
// though the former does not conform to the LFS document), but considering
// both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
// equivalently requesting no 64-bit operations

// Copyright (C) 1991-2020 Free Software Foundation, Inc.
//    This file is part of the GNU C Library.
//
//    The GNU C Library is free software; you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//
//    The GNU C Library 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with the GNU C Library; if not, see
//    <https://www.gnu.org/licenses/>.

//	POSIX Standard: 2.10 Symbolic Constants		<unistd.h>

// MVS linker does not support external names larger than 8 bytes

//
//     The 'zlib' compression library provides in-memory compression and
//   decompression functions, including integrity checks of the uncompressed data.
//   This version of the library supports only one compression method (deflation)
//   but other algorithms will be added later and will have the same stream
//   interface.
//
//     Compression can be done in a single step if the buffers are large enough,
//   or can be done by repeated calls of the compression function.  In the latter
//   case, the application must provide more input and/or consume the output
//   (providing more output space) before each call.
//
//     The compressed data format used by default by the in-memory functions is
//   the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
//   around a deflate stream, which is itself documented in RFC 1951.
//
//     The library also supports reading and writing files in gzip (.gz) format
//   with an interface similar to that of stdio using the functions that start
//   with "gz".  The gzip format is different from the zlib format.  gzip is a
//   gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
//
//     This library can optionally read and write gzip and raw deflate streams in
//   memory as well.
//
//     The zlib format was designed to be compact and fast for use in memory
//   and on communications channels.  The gzip format was designed for single-
//   file compression on file systems, has a larger header than zlib to maintain
//   directory information, and uses a different, slower check method than zlib.
//
//     The library does not install any signal handler.  The decoder checks
//   the consistency of the compressed data, so the library should never crash
//   even in the case of corrupted input.

type Alloc_func = uintptr /* zlib.h:81:16 */
type Free_func = uintptr  /* zlib.h:82:16 */

type Z_stream_s = struct {
	Fnext_in     uintptr
	Favail_in    UInt
	F__ccgo_pad1 [4]byte
	Ftotal_in    ULong
	Fnext_out    uintptr
	Favail_out   UInt
	F__ccgo_pad2 [4]byte
	Ftotal_out   ULong
	Fmsg         uintptr
	Fstate       uintptr
	Fzalloc      Alloc_func
	Fzfree       Free_func
	Fopaque      Voidpf
	Fdata_type   int32
	F__ccgo_pad3 [4]byte
	Fadler       ULong
	Freserved    ULong
} /* zlib.h:86:9 */

type Z_stream = Z_stream_s /* zlib.h:106:3 */

type Z_streamp = uintptr /* zlib.h:108:22 */

//
//      gzip header information passed to and from zlib routines.  See RFC 1952
//   for more details on the meanings of these fields.
type Gz_header_s = struct {
	Ftext        int32
	F__ccgo_pad1 [4]byte
	Ftime        ULong
	Fxflags      int32
	Fos          int32
	Fextra       uintptr
	Fextra_len   UInt
	Fextra_max   UInt
	Fname        uintptr
	Fname_max    UInt
	F__ccgo_pad2 [4]byte
	Fcomment     uintptr
	Fcomm_max    UInt
	Fhcrc        int32
	Fdone        int32
	F__ccgo_pad3 [4]byte
} /* zlib.h:114:9 */

//
//      gzip header information passed to and from zlib routines.  See RFC 1952
//   for more details on the meanings of these fields.
type Gz_header = Gz_header_s /* zlib.h:129:3 */

type Gz_headerp = uintptr /* zlib.h:131:23 */
//
//      inflateGetHeader() requests that gzip header information be stored in the
//    provided gz_header structure.  inflateGetHeader() may be called after
//    inflateInit2() or inflateReset(), and before the first call of inflate().
//    As inflate() processes the gzip stream, head->done is zero until the header
//    is completed, at which time head->done is set to one.  If a zlib stream is
//    being decoded, then head->done is set to -1 to indicate that there will be
//    no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be
//    used to force inflate() to return immediately after header processing is
//    complete and before any actual data is decompressed.
//
//      The text, time, xflags, and os fields are filled in with the gzip header
//    contents.  hcrc is set to true if there is a header CRC.  (The header CRC
//    was valid if done is set to one.) If extra is not Z_NULL, then extra_max
//    contains the maximum number of bytes to write to extra.  Once done is true,
//    extra_len contains the actual extra field length, and extra contains the
//    extra field, or that field truncated if extra_max is less than extra_len.
//    If name is not Z_NULL, then up to name_max characters are written there,
//    terminated with a zero unless the length is greater than name_max.  If
//    comment is not Z_NULL, then up to comm_max characters are written there,
//    terminated with a zero unless the length is greater than comm_max.  When any
//    of extra, name, or comment are not Z_NULL and the respective field is not
//    present in the header, then that field is set to Z_NULL to signal its
//    absence.  This allows the use of deflateSetHeader() with the returned
//    structure to duplicate the header.  However if those fields are set to
//    allocated memory, then the application will need to save those pointers
//    elsewhere so that they can be eventually freed.
//
//      If inflateGetHeader is not used, then the header information is simply
//    discarded.  The header is always checked for validity, including the header
//    CRC if present.  inflateReset() will reset the process to discard the header
//    information.  The application would need to call inflateGetHeader() again to
//    retrieve the header from the next gzip stream.
//
//      inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
//    stream state was inconsistent.

//
// ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
//                                         unsigned char FAR *window));
//
//      Initialize the internal stream state for decompression using inflateBack()
//    calls.  The fields zalloc, zfree and opaque in strm must be initialized
//    before the call.  If zalloc and zfree are Z_NULL, then the default library-
//    derived memory allocation routines are used.  windowBits is the base two
//    logarithm of the window size, in the range 8..15.  window is a caller
//    supplied buffer of that size.  Except for special applications where it is
//    assured that deflate was used with small window sizes, windowBits must be 15
//    and a 32K byte window must be supplied to be able to decompress general
//    deflate streams.
//
//      See inflateBack() for the usage of these routines.
//
//      inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
//    the parameters are invalid, Z_MEM_ERROR if the internal state could not be
//    allocated, or Z_VERSION_ERROR if the version of the library does not match
//    the version of the header file.

type In_func = uintptr  /* zlib.h:1092:18 */
type Out_func = uintptr /* zlib.h:1094:13 */
//
//      Same as uncompress, except that sourceLen is a pointer, where the
//    length of the source is *sourceLen.  On return, *sourceLen is the number of
//    source bytes consumed.

// gzip file access functions

//
//      This library supports reading and writing files in gzip (.gz) format with
//    an interface similar to that of stdio, using the functions that start with
//    "gz".  The gzip format is different from the zlib format.  gzip is a gzip
//    wrapper, documented in RFC 1952, wrapped around a deflate stream.

type GzFile_s = struct {
	Fhave        uint32
	F__ccgo_pad1 [4]byte
	Fnext        uintptr
	Fpos         Off64_t
} /* zlib.h:1300:9 */

//
//      Same as uncompress, except that sourceLen is a pointer, where the
//    length of the source is *sourceLen.  On return, *sourceLen is the number of
//    source bytes consumed.

// gzip file access functions

//
//      This library supports reading and writing files in gzip (.gz) format with
//    an interface similar to that of stdio, using the functions that start with
//    "gz".  The gzip format is different from the zlib format.  gzip is a gzip
//    wrapper, documented in RFC 1952, wrapped around a deflate stream.

type GzFile = uintptr /* zlib.h:1300:25 */

// Values for the flags field in Channel. Any ORed combination of the
// following flags can be stored in the field. These flags record various
// options and state bits about the channel. In addition to the flags below,
// the channel can also have TCL_READABLE (1<<1) and TCL_WRITABLE (1<<2) set.

// The length of time to wait between synthetic timer events. Must be zero or
// bad things tend to happen.

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

// The version of the zlib "package" that this implements. Note that this
// thoroughly supersedes the versions included with tclkit, which are "1.1",
// so this is at least "2.0" (there's no general *commitment* to have the same
// interface, even if that is mostly true).

// Magic flags used with wbits fields to indicate that we're handling the gzip
// format or automatic detection of format. Putting it here is slightly less
// gross!

// Structure used for handling gzip headers that are generated from a
// dictionary. It comprises the header structure itself plus some working
// space that it is very convenient to have attached.

type GzipHeader = struct {
	Fheader            Gz_header
	FnativeFilenameBuf [4096]int8
	FnativeCommentBuf  [256]int8
} /* tclZlib.c:54:3 */

// Structure used for the Tcl_ZlibStream* commands and [zlib stream ...]

type ZlibStreamHandle = struct {
	Finterp       uintptr
	Fstream       Z_stream
	FstreamEnd    int32
	F__ccgo_pad1  [4]byte
	FinData       uintptr
	FoutData      uintptr
	FcurrentInput uintptr
	FoutPos       int32
	Fmode         int32
	Fformat       int32
	Flevel        int32
	Fflush        int32
	Fwbits        int32
	Fcmd          Tcl_Command
	FcompDictObj  uintptr
	Fflags        int32
	F__ccgo_pad2  [4]byte
	FgzHeaderPtr  uintptr
} /* tclZlib.c:83:3 */

// Macros to make it clearer in some of the twiddlier accesses what is
// happening.

// Structure used for stacked channel compression and decompression.

type ZlibChannelData = struct {
	Fchan           Tcl_Channel
	Fparent         Tcl_Channel
	Fflags          int32
	Fmode           int32
	Fformat         int32
	FreadAheadLimit int32
	FinStream       Z_stream
	FoutStream      Z_stream
	FinBuffer       uintptr
	FoutBuffer      uintptr
	FinAllocated    int32
	FoutAllocated   int32
	FinHeader       GzipHeader
	FoutHeader      GzipHeader
	Ftimer          Tcl_TimerToken
	FcompDictObj    uintptr
} /* tclZlib.c:130:3 */

// Type of zlib-based compressing and decompressing channels.

var zlibChannelType = Tcl_ChannelType{
	FtypeName:      ts + 73012,
	Fversion:       uintptr(0x5),
	FcloseProc:     0,
	FinputProc:     0,
	FoutputProc:    0, // seekProc
	FsetOptionProc: 0,
	FgetOptionProc: 0,
	FwatchProc:     0,
	FgetHandleProc: 0, // close2Proc
	FblockModeProc: 0, // flushProc
	FhandlerProc:   0,
} /* tclZlib.c:206:30 */

//----------------------------------------------------------------------
//
// ConvertError --
//
//	Utility function for converting a zlib error into a Tcl error.
//
// Results:
//	None.
//
// Side effects:
//	Updates the interpreter result and errorcode.
//
//----------------------------------------------------------------------

func sConvertError(tls *libc.TLS, interp uintptr, code int32, adler ULong) { /* tclZlib.c:243:1: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	var codeStr uintptr
	var codeStr2 uintptr = uintptr(0)
	// var codeStrBuf [24]int8 at bp+56, 24

	if interp == uintptr(0) {
		return
	}

	switch code {
	// Firstly, the case that is *different* because it's really coming
	// from the OS and is just being reported via zlib. It should be
	// really uncommon because Tcl handles all I/O rather than delegating
	// it to zlib, but proving it can't happen is hard.

	case -1:
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, XTcl_PosixError(tls, interp), -1))
		return

		// Normal errors/conditions, some of which have additional detail and
		// some which don't. (This is not defined by array lookup because zlib
		// error codes are sometimes negative.)

	case -2:
		codeStr = ts + 73017 /* "STREAM" */
		break
	case -3:
		codeStr = ts + 73024 /* "DATA" */
		break
	case -4:
		codeStr = ts + 73029 /* "MEM" */
		break
	case -5:
		codeStr = ts + 73033 /* "BUF" */
		break
	case -6:
		codeStr = ts + 56933 /* "VERSION" */
		break
	case Z_NEED_DICT:
		codeStr = ts + 73037 /* "NEED_DICT" */
		codeStr2 = bp + 56   /* &codeStrBuf[0] */
		libc.Xsprintf(tls, bp+56, ts+55197, libc.VaList(bp, adler))
		break

		// These should _not_ happen! This function is for dealing with error
		// cases, not non-errors!

	case Z_OK:
		XTcl_Panic(tls, ts+73047, 0)
		fallthrough
	case Z_STREAM_END:
		XTcl_Panic(tls, ts+73093, 0)
		fallthrough

		// Anything else is bad news; it's unexpected. Convert to generic
		// error.

	default:
		codeStr = ts + 14203 /* "UNKNOWN" */
		codeStr2 = bp + 56   /* &codeStrBuf[0] */
		libc.Xsprintf(tls, bp+56, ts+324, libc.VaList(bp+8, code))
		break
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, z.XzError(tls, code), -1))

	// Tricky point! We might pass NULL twice here (and will when the error
	// type is known).

	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, ts+3593, ts+73147, codeStr, codeStr2, uintptr(0)))
}

func sConvertErrorToList(tls *libc.TLS, code int32, adler ULong) uintptr { /* tclZlib.c:326:16: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// var objv [4]uintptr at bp, 32

	for ok := true; ok; ok = 0 != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				*(*uintptr)(unsafe.Pointer(bp)) = XTclThreadAllocObj(tls)
			} else {
				*(*uintptr)(unsafe.Pointer(bp)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes, ts+3593, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes + 3)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr = uintptr(0)
		{
		}
	}
	for ok2 := true; ok2; ok2 = 0 != 0 {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				*(*uintptr)(unsafe.Pointer(bp + 1*8)) = XTclThreadAllocObj(tls)
			} else {
				*(*uintptr)(unsafe.Pointer(bp + 1*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1*8)) + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1*8)))).FrefCount = 0
		if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1*8)))).Fbytes = XtclEmptyStringRep
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1*8)))).Flength = 0
		} else {
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
			libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1*8)))).Fbytes, ts+73147, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
			*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1*8)))).Fbytes + 4)) = int8(0)
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1*8)))).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
		}
		(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1*8)))).FtypePtr = uintptr(0)
		{
		}
	}
	switch code {
	case -2:
		for ok4 := true; ok4; ok4 = 0 != 0 {
			for ok5 := true; ok5; ok5 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes, ts+73017, uint64(int32(uint64(unsafe.Sizeof([7]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes + 6)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = int32(uint64(unsafe.Sizeof([7]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		return XTcl_NewListObj(tls, 3, bp)
	case -3:
		for ok6 := true; ok6; ok6 = 0 != 0 {
			for ok7 := true; ok7; ok7 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes, ts+73024, uint64(int32(uint64(unsafe.Sizeof([5]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes + 4)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = int32(uint64(unsafe.Sizeof([5]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		return XTcl_NewListObj(tls, 3, bp)
	case -4:
		for ok8 := true; ok8; ok8 = 0 != 0 {
			for ok9 := true; ok9; ok9 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes, ts+73029, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes + 3)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		return XTcl_NewListObj(tls, 3, bp)
	case -5:
		for ok10 := true; ok10; ok10 = 0 != 0 {
			for ok11 := true; ok11; ok11 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes, ts+73033, uint64(int32(uint64(unsafe.Sizeof([4]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes + 3)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = int32(uint64(unsafe.Sizeof([4]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		return XTcl_NewListObj(tls, 3, bp)
	case -6:
		for ok12 := true; ok12; ok12 = 0 != 0 {
			for ok13 := true; ok13; ok13 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes, ts+56933, uint64(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes + 7)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = int32(uint64(unsafe.Sizeof([8]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		return XTcl_NewListObj(tls, 3, bp)
	case -1:
		for ok14 := true; ok14; ok14 = 0 != 0 {
			for ok15 := true; ok15; ok15 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes, ts+38077, uint64(int32(uint64(unsafe.Sizeof([6]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes + 5)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = int32(uint64(unsafe.Sizeof([6]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		*(*uintptr)(unsafe.Pointer(bp + 3*8)) = XTcl_NewStringObj(tls, XTcl_ErrnoId(tls), -1)
		return XTcl_NewListObj(tls, 4, bp)
	case Z_NEED_DICT:
		for ok16 := true; ok16; ok16 = 0 != 0 {
			for ok17 := true; ok17; ok17 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes, ts+73037, uint64(int32(uint64(unsafe.Sizeof([10]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes + 9)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = int32(uint64(unsafe.Sizeof([10]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		*(*uintptr)(unsafe.Pointer(bp + 3*8)) = XTcl_NewWideIntObj(tls, Tcl_WideInt(adler))
		return XTcl_NewListObj(tls, 4, bp)

		// These should _not_ happen! This function is for dealing with error
		// cases, not non-errors!

	case Z_OK:
		XTcl_Panic(tls, ts+73047, 0)
		fallthrough
	case Z_STREAM_END:
		XTcl_Panic(tls, ts+73093, 0)
		fallthrough

		// Catch-all. Should be unreachable because all cases are already
		// listed above.

	default:
		for ok18 := true; ok18; ok18 = 0 != 0 {
			for ok19 := true; ok19; ok19 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 2*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FrefCount = 0
			if int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1)) == 0 {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes = XTcl_Alloc(tls, uint32(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))+1))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes, ts+14203, uint64(int32(uint64(unsafe.Sizeof([8]int8{}))-uint64(1))))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Fbytes + 7)) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).Flength = int32(uint64(unsafe.Sizeof([8]int8{})) - uint64(1))
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 2*8)))).FtypePtr = uintptr(0)
			{
			}
		}
		for ok20 := true; ok20; ok20 = 0 != 0 {
			for ok21 := true; ok21; ok21 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					*(*uintptr)(unsafe.Pointer(bp + 3*8)) = XTclThreadAllocObj(tls)
				} else {
					*(*uintptr)(unsafe.Pointer(bp + 3*8)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 3*8)) + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 3*8)))).FrefCount = 0
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 3*8)))).Fbytes = uintptr(0)
			*(*int64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 3*8)) + 32)) = int64(code)
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 3*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType))
			{
			}
		}
		return XTcl_NewListObj(tls, 4, bp)
	}
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// GenerateHeader --
//
//	Function for creating a gzip header from the contents of a dictionary
//	(as described in the documentation). GetValue is a helper function.
//
// Results:
//	A Tcl result code.
//
// Side effects:
//	Updates the fields of the given gz_header structure. Adds amount of
//	extra space required for the header to the variable referenced by the
//	extraSizePtr argument.
//
//----------------------------------------------------------------------

func sGetValue(tls *libc.TLS, interp uintptr, dictObj uintptr, nameStr uintptr, valuePtrPtr uintptr) int32 { /* tclZlib.c:402:1: */
	var name uintptr = XTcl_NewStringObj(tls, nameStr, -1)
	var result int32 = XTcl_DictObjGet(tls, interp, dictObj, name, valuePtrPtr)

	if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(name)).FrefCount, 1) > 1 {
	} else {
		if !(int32((*Tcl_Obj)(unsafe.Pointer(name)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(name)).FtypePtr)).FfreeIntRepProc) != 0) {
			{
			}
			if (*Tcl_Obj)(unsafe.Pointer(name)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(name)).Fbytes != XtclEmptyStringRep {
				XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(name)).Fbytes)
			}
			(*Tcl_Obj)(unsafe.Pointer(name)).Flength = -1
			for ok := true; ok; ok = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
				}() {
					XTclThreadFreeObj(tls, name)
				} else {
					*(*uintptr)(unsafe.Pointer(name + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = name
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
				}
			}
		} else {
			XTclFreeObj(tls, name)
		}
	}

	return result
}

func sGenerateHeader(tls *libc.TLS, interp uintptr, dictObj uintptr, headerPtr uintptr, extraSizePtr uintptr) int32 { /* tclZlib.c:416:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	// var value uintptr at bp, 8

	// var len int32 at bp+8, 4

	var result int32
	var valueStr uintptr
	var latin1enc Tcl_Encoding
	result = TCL_ERROR

	// RFC 1952 says that header strings are in ISO 8859-1 (LATIN-1).

	latin1enc = XTcl_GetEncoding(tls, uintptr(0), ts+25963)
	if !(latin1enc == uintptr(0)) {
		goto __1
	}
	XTcl_Panic(tls, ts+73152, 0)
__1:
	;

	if !(sGetValue(tls, interp, dictObj, ts+73172, bp) != TCL_OK) {
		goto __2
	}
	goto error
	goto __3
__2:
	if !(*(*uintptr)(unsafe.Pointer(bp)) != uintptr(0)) {
		goto __4
	}
	valueStr = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp /* value */)), bp+8)
	XTcl_UtfToExternal(tls, uintptr(0), latin1enc, valueStr, *(*int32)(unsafe.Pointer(bp + 8 /* len */)), 0, uintptr(0),
		headerPtr+4176, MAX_COMMENT_LEN-1, uintptr(0), bp+8,
		uintptr(0))
	*(*int8)(unsafe.Pointer(headerPtr + 4176 + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* len */))))) = int8(0)
	(*GzipHeader)(unsafe.Pointer(headerPtr)).Fheader.Fcomment = headerPtr + 4176 /* &.nativeCommentBuf */
	if !(extraSizePtr != uintptr(0)) {
		goto __5
	}
	*(*int32)(unsafe.Pointer(extraSizePtr)) += *(*int32)(unsafe.Pointer(bp + 8))
__5:
	;
__4:
	;
__3:
	;

	if !(sGetValue(tls, interp, dictObj, ts+73180, bp) != TCL_OK) {
		goto __6
	}
	goto error
	goto __7
__6:
	if !(*(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) && XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), headerPtr+68) != 0) {
		goto __8
	}
	goto error
__8:
	;
__7:
	;

	if !(sGetValue(tls, interp, dictObj, ts+73184, bp) != TCL_OK) {
		goto __9
	}
	goto error
	goto __10
__9:
	if !(*(*uintptr)(unsafe.Pointer(bp)) != uintptr(0)) {
		goto __11
	}
	valueStr = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp /* value */)), bp+8)
	XTcl_UtfToExternal(tls, uintptr(0), latin1enc, valueStr, *(*int32)(unsafe.Pointer(bp + 8 /* len */)), 0, uintptr(0),
		headerPtr+80, PATH_MAX-1, uintptr(0), bp+8, uintptr(0))
	*(*int8)(unsafe.Pointer(headerPtr + 80 + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* len */))))) = int8(0)
	(*GzipHeader)(unsafe.Pointer(headerPtr)).Fheader.Fname = headerPtr + 80 /* &.nativeFilenameBuf */
	if !(extraSizePtr != uintptr(0)) {
		goto __12
	}
	*(*int32)(unsafe.Pointer(extraSizePtr)) += *(*int32)(unsafe.Pointer(bp + 8))
__12:
	;
__11:
	;
__10:
	;

	if !(sGetValue(tls, interp, dictObj, ts+43141, bp) != TCL_OK) {
		goto __13
	}
	goto error
	goto __14
__13:
	if !(*(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) && XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)),
		headerPtr+20) != TCL_OK) {
		goto __15
	}
	goto error
__15:
	;
__14:
	;

	// Ignore the 'size' field, since that is controlled by the size of the
	// input data.

	if !(sGetValue(tls, interp, dictObj, ts+5501, bp) != TCL_OK) {
		goto __16
	}
	goto error
	goto __17
__16:
	if !(*(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) && XTcl_GetLongFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)),
		headerPtr+8) != TCL_OK) {
		goto __18
	}
	goto error
__18:
	;
__17:
	;

	if !(sGetValue(tls, interp, dictObj, ts+12321, bp) != TCL_OK) {
		goto __19
	}
	goto error
	goto __20
__19:
	if !(*(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) && XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), uintptr(unsafe.Pointer(&types2)), int32(unsafe.Sizeof(uintptr(0))), ts+12321, TCL_EXACT, headerPtr) != TCL_OK) {
		goto __21
	}
	goto error
__21:
	;
__20:
	;

	result = TCL_OK
error:
	XTcl_FreeEncoding(tls, latin1enc)
	return result
}

var types2 = [2]uintptr{
	ts + 9534, ts + 73193,
} /* tclZlib.c:428:23 */

//----------------------------------------------------------------------
//
// ExtractHeader --
//
//	Take the values out of a gzip header and store them in a dictionary.
//	SetValue is a helper macro.
//
// Results:
//	None.
//
// Side effects:
//	Updates the dictionary, which must be writable (i.e. refCount < 2).
//
//----------------------------------------------------------------------

func sExtractHeader(tls *libc.TLS, headerPtr uintptr, dictObj uintptr) { /* tclZlib.c:528:1: */
	bp := tls.Alloc(216)
	defer tls.Free(216)

	var latin1enc Tcl_Encoding = uintptr(0)
	// var tmp Tcl_DString at bp, 216

	if (*Gz_header)(unsafe.Pointer(headerPtr)).Fcomment != uintptr(Z_NULL) {
		if latin1enc == uintptr(0) {
			// RFC 1952 says that header strings are in ISO 8859-1 (LATIN-1).

			latin1enc = XTcl_GetEncoding(tls, uintptr(0), ts+25963)
			if latin1enc == uintptr(0) {
				XTcl_Panic(tls, ts+73152, 0)
			}
		}

		XTcl_ExternalToUtfDString(tls, latin1enc, (*Gz_header)(unsafe.Pointer(headerPtr)).Fcomment, -1,
			bp)
		XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+73172, -1), XTclDStringToObj(tls, bp))
	}
	XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+73180, -1), XTcl_NewIntObj(tls, libc.Bool32((*Gz_header)(unsafe.Pointer(headerPtr)).Fhcrc != 0)))
	if (*Gz_header)(unsafe.Pointer(headerPtr)).Fname != uintptr(Z_NULL) {
		if latin1enc == uintptr(0) {
			// RFC 1952 says that header strings are in ISO 8859-1 (LATIN-1).

			latin1enc = XTcl_GetEncoding(tls, uintptr(0), ts+25963)
			if latin1enc == uintptr(0) {
				XTcl_Panic(tls, ts+73152, 0)
			}
		}

		XTcl_ExternalToUtfDString(tls, latin1enc, (*Gz_header)(unsafe.Pointer(headerPtr)).Fname, -1,
			bp)
		XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+73184, -1), XTclDStringToObj(tls, bp))
	}
	if (*Gz_header)(unsafe.Pointer(headerPtr)).Fos != 255 {
		XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+43141, -1), XTcl_NewIntObj(tls, (*Gz_header)(unsafe.Pointer(headerPtr)).Fos))
	}
	if (*Gz_header)(unsafe.Pointer(headerPtr)).Ftime != uint64(0) {
		XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+5501, -1), XTcl_NewLongObj(tls, int64((*Gz_header)(unsafe.Pointer(headerPtr)).Ftime)))
	}
	if (*Gz_header)(unsafe.Pointer(headerPtr)).Ftext != Z_UNKNOWN {
		XTcl_DictObjPut(tls, uintptr(0), dictObj, XTcl_NewStringObj(tls, ts+12321, -1), XTcl_NewStringObj(tls, func() uintptr {
			if (*Gz_header)(unsafe.Pointer(headerPtr)).Ftext != 0 {
				return ts + 73193
			}
			return ts + 9534
		}(), -1))
	}

	if latin1enc != uintptr(0) {
		XTcl_FreeEncoding(tls, latin1enc)
	}
}

// Disentangle the worst of how the zlib API is used.

func sSetInflateDictionary(tls *libc.TLS, strm Z_streamp, compDictObj uintptr) int32 { /* tclZlib.c:589:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	if compDictObj != uintptr(0) {
		// var length int32 at bp, 4

		var bytes uintptr = XTcl_GetByteArrayFromObj(tls, compDictObj, bp)

		return z.XinflateSetDictionary(tls, strm, bytes, uint32(*(*int32)(unsafe.Pointer(bp /* length */))))
	}
	return Z_OK
}

func sSetDeflateDictionary(tls *libc.TLS, strm Z_streamp, compDictObj uintptr) int32 { /* tclZlib.c:603:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	if compDictObj != uintptr(0) {
		// var length int32 at bp, 4

		var bytes uintptr = XTcl_GetByteArrayFromObj(tls, compDictObj, bp)

		return z.XdeflateSetDictionary(tls, strm, bytes, uint32(*(*int32)(unsafe.Pointer(bp /* length */))))
	}
	return Z_OK
}

func sDeflate(tls *libc.TLS, strm Z_streamp, bufferPtr uintptr, bufferSize int32, flush int32, writtenPtr uintptr) int32 { /* tclZlib.c:617:1: */
	var e int32

	(*Z_stream)(unsafe.Pointer(strm)).Fnext_out = bufferPtr
	(*Z_stream)(unsafe.Pointer(strm)).Favail_out = UInt(bufferSize)
	e = z.Xdeflate(tls, strm, flush)
	if writtenPtr != uintptr(0) {
		*(*int32)(unsafe.Pointer(writtenPtr)) = int32(UInt(bufferSize) - (*Z_stream)(unsafe.Pointer(strm)).Favail_out)
	}
	return e
}

func sAppendByteArray(tls *libc.TLS, listObj uintptr, buffer uintptr, size int32) { /* tclZlib.c:636:1: */
	if size > 0 {
		var baObj uintptr = XTcl_NewByteArrayObj(tls, buffer, size)

		XTcl_ListObjAppendElement(tls, uintptr(0), listObj, baObj)
	}
}

//----------------------------------------------------------------------
//
// Tcl_ZlibStreamInit --
//
//	This command initializes a (de)compression context/handle for
//	(de)compressing data in chunks.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	The variable pointed to by zshandlePtr is initialised and memory
//	allocated for internal state. Additionally, if interp is not null, a
//	Tcl command is created and its name placed in the interp result obj.
//
// Note:
//	At least one of interp and zshandlePtr should be non-NULL or the
//	reference to the stream will be completely lost.
//
//----------------------------------------------------------------------

func XTcl_ZlibStreamInit(tls *libc.TLS, interp uintptr, mode int32, format int32, level int32, dictObj uintptr, zshandlePtr uintptr) int32 { /* tclZlib.c:672:1: */
	bp := tls.Alloc(248)
	defer tls.Free(248)

	var wbits int32
	var e int32
	var zshPtr uintptr
	// var cmdname Tcl_DString at bp+32, 216

	var gzHeaderPtr uintptr
	var _objPtr uintptr
	wbits = 0
	zshPtr = uintptr(0)
	gzHeaderPtr = uintptr(0)

	switch mode {
	case TCL_ZLIB_STREAM_DEFLATE:
		goto __2
	case TCL_ZLIB_STREAM_INFLATE:
		goto __3
	default:
		goto __4
	}
	goto __1
__2:
	// Compressed format is specified by the wbits parameter. See zlib.h
	// for details.

	switch format {
	case TCL_ZLIB_FORMAT_RAW:
		goto __6
	case TCL_ZLIB_FORMAT_GZIP:
		goto __7
	case TCL_ZLIB_FORMAT_ZLIB:
		goto __8
	default:
		goto __9
	}
	goto __5
__6:
	wbits = -MAX_WBITS
	goto __5
__7:
	wbits = MAX_WBITS | 16
	if !(dictObj != 0) {
		goto __10
	}
	gzHeaderPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(GzipHeader{})))
	libc.Xmemset(tls, gzHeaderPtr, 0, uint64(unsafe.Sizeof(GzipHeader{})))
	if !(sGenerateHeader(tls, interp, dictObj, gzHeaderPtr,
		uintptr(0)) != TCL_OK) {
		goto __11
	}
	XTclpFree(tls, gzHeaderPtr)
	return TCL_ERROR
__11:
	;
__10:
	;
	goto __5
__8:
	wbits = MAX_WBITS
	goto __5
__9:
	XTcl_Panic(tls,

		ts+73198, 0)
__5:
	;
	if !(level < -1 || level > 9) {
		goto __12
	}
	XTcl_Panic(tls,

		ts+73300, 0)
__12:
	;
	goto __1
__3:
	// wbits are the same as DEFLATE, but FORMAT_AUTO is valid too.

	switch format {
	case TCL_ZLIB_FORMAT_RAW:
		goto __14
	case TCL_ZLIB_FORMAT_GZIP:
		goto __15
	case TCL_ZLIB_FORMAT_ZLIB:
		goto __16
	case TCL_ZLIB_FORMAT_AUTO:
		goto __17
	default:
		goto __18
	}
	goto __13
__14:
	wbits = -MAX_WBITS
	goto __13
__15:
	wbits = MAX_WBITS | 16
	gzHeaderPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(GzipHeader{})))
	libc.Xmemset(tls, gzHeaderPtr, 0, uint64(unsafe.Sizeof(GzipHeader{})))
	(*GzipHeader)(unsafe.Pointer(gzHeaderPtr)).Fheader.Fname = gzHeaderPtr + 80 /* &.nativeFilenameBuf */
	(*GzipHeader)(unsafe.Pointer(gzHeaderPtr)).Fheader.Fname_max = UInt(PATH_MAX - 1)
	(*GzipHeader)(unsafe.Pointer(gzHeaderPtr)).Fheader.Fcomment = gzHeaderPtr + 4176 /* &.nativeCommentBuf */
	(*GzipHeader)(unsafe.Pointer(gzHeaderPtr)).Fheader.Fname_max = UInt(MAX_COMMENT_LEN - 1)
	goto __13
__16:
	wbits = MAX_WBITS
	goto __13
__17:
	wbits = MAX_WBITS | 32
	goto __13
__18:
	XTcl_Panic(tls,

		ts+73416, 0)
__13:
	;
	goto __1
__4:
	XTcl_Panic(tls,
		ts+73540, 0)
__1:
	;

	zshPtr = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ZlibStreamHandle{})))
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp = interp
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fmode = mode
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fformat = format
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Flevel = level
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fwbits = wbits
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput = uintptr(0)
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FstreamEnd = 0
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj = uintptr(0)
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fflags = 0
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FgzHeaderPtr = gzHeaderPtr
	libc.Xmemset(tls, zshPtr+8, 0, uint64(unsafe.Sizeof(Z_stream{})))
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fadler = uint64(1)

	// No output buffer available yet

	if !(mode == TCL_ZLIB_STREAM_DEFLATE) {
		goto __19
	}
	e = z.XdeflateInit2_(tls, zshPtr+8, level, Z_DEFLATED, wbits, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY, ts+73609, int32(unsafe.Sizeof(Z_stream{})))
	if !(e == Z_OK && (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FgzHeaderPtr != 0) {
		goto __21
	}
	e = z.XdeflateSetHeader(tls, zshPtr+8,
		(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FgzHeaderPtr)
__21:
	;
	goto __20
__19:
	e = z.XinflateInit2_(tls, zshPtr+8, wbits, ts+73609, int32(unsafe.Sizeof(Z_stream{})))
	if !(e == Z_OK && (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FgzHeaderPtr != 0) {
		goto __22
	}
	e = z.XinflateGetHeader(tls, zshPtr+8,
		(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FgzHeaderPtr)
__22:
	;
__20:
	;

	if !(e != Z_OK) {
		goto __23
	}
	sConvertError(tls, interp, e, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fadler)
	goto error
__23:
	;

	// I could do all this in C, but this is easier.

	if !(interp != uintptr(0)) {
		goto __24
	}
	if !(XTcl_EvalEx(tls, interp, ts+73616, -1, 0) != TCL_OK) {
		goto __26
	}
	goto error
__26:
	;
	XTcl_DStringInit(tls, bp+32)
	XTcl_DStringAppend(tls, bp+32, ts+73647, int32(uint64(unsafe.Sizeof([24]int8{}))-uint64(1)))
	XTclDStringAppendObj(tls, bp+32, XTcl_GetObjResult(tls, interp))
	if !(XTcl_FindCommand(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp+32)).Fstring,
		uintptr(0), 0) != uintptr(0)) {
		goto __27
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+73671, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+22960, ts+73711, uintptr(0)))
	XTcl_DStringFree(tls, bp+32)
	goto error
__27:
	;
	XTcl_ResetResult(tls, interp)

	// Create the command.

	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fcmd = XTcl_CreateObjCommand(tls, interp, (*Tcl_DString)(unsafe.Pointer(bp+32)).Fstring,
		*(*uintptr)(unsafe.Pointer(&struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		}{sZlibStreamCmd})), zshPtr, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sZlibStreamCmdDelete})))
	XTcl_DStringFree(tls, bp+32)
	if !((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fcmd == uintptr(0)) {
		goto __28
	}
	goto error
__28:
	;
	goto __25
__24:
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fcmd = uintptr(0)
__25:
	;

	// Prepare the buffers for use.

	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData = XTcl_NewListObj(tls, 0, uintptr(0))
	(*Tcl_Obj)(unsafe.Pointer((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData)).FrefCount++
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData = XTcl_NewListObj(tls, 0, uintptr(0))
	(*Tcl_Obj)(unsafe.Pointer((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData)).FrefCount++

	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutPos = 0

	// Now set the variable pointed to by *zshandlePtr to the pointer to the
	// zsh struct.

	if !(zshandlePtr != 0) {
		goto __29
	}
	*(*Tcl_ZlibStream)(unsafe.Pointer(zshandlePtr)) = zshPtr
__29:
	;

	return TCL_OK

error:
	if !((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj != 0) {
		goto __30
	}
__31:
	_objPtr = (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __34
	}
	XTclFreeObj(tls, _objPtr)
__34:
	;
	goto __32
__32:
	if 0 != 0 {
		goto __31
	}
	goto __33
__33:
	;
__30:
	;
	if !((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FgzHeaderPtr != 0) {
		goto __35
	}
	XTclpFree(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FgzHeaderPtr)
__35:
	;
	XTclpFree(tls, zshPtr)
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// ZlibStreamCmdDelete --
//
//	This is the delete command which Tcl invokes when a zlibstream command
//	is deleted from the interpreter (on stream close, usually).
//
// Results:
//	None
//
// Side effects:
//	Invalidates the zlib stream handle as obtained from Tcl_ZlibStreamInit
//
//----------------------------------------------------------------------

func sZlibStreamCmdDelete(tls *libc.TLS, cd ClientData) { /* tclZlib.c:885:1: */
	var zshPtr uintptr = cd

	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fcmd = uintptr(0)
	XZlibStreamCleanup(tls, zshPtr)
}

//----------------------------------------------------------------------
//
// Tcl_ZlibStreamClose --
//
//	This procedure must be called after (de)compression is done to ensure
//	memory is freed and the command is deleted from the interpreter (if
//	any).
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Invalidates the zlib stream handle as obtained from Tcl_ZlibStreamInit
//
//----------------------------------------------------------------------

func XTcl_ZlibStreamClose(tls *libc.TLS, zshandle Tcl_ZlibStream) int32 { /* tclZlib.c:913:1: */
	var zshPtr uintptr = zshandle

	// If the interp is set, deleting the command will trigger
	// ZlibStreamCleanup in ZlibStreamCmdDelete. If no interp is set, call
	// ZlibStreamCleanup directly.

	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp != 0 && (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fcmd != 0 {
		XTcl_DeleteCommandFromToken(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fcmd)
	} else {
		XZlibStreamCleanup(tls, zshPtr)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ZlibStreamCleanup --
//
//	This procedure is called by either Tcl_ZlibStreamClose or
//	ZlibStreamCmdDelete to cleanup the stream context.
//
// Results:
//	None
//
// Side effects:
//	Invalidates the zlib stream handle.
//
//----------------------------------------------------------------------

func XZlibStreamCleanup(tls *libc.TLS, zshPtr uintptr) { /* tclZlib.c:950:1: */
	if !((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FstreamEnd != 0) {
		if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fmode == TCL_ZLIB_STREAM_DEFLATE {
			z.XdeflateEnd(tls, zshPtr+8)
		} else {
			z.XinflateEnd(tls, zshPtr+8)
		}
	}

	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput != 0 {
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var _objPtr uintptr = (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj != 0 {
		for ok3 := true; ok3; ok3 = 0 != 0 {
			var _objPtr uintptr = (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FgzHeaderPtr != 0 {
		XTclpFree(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FgzHeaderPtr)
	}

	XTclpFree(tls, zshPtr)
}

//----------------------------------------------------------------------
//
// Tcl_ZlibStreamReset --
//
//	This procedure will reinitialize an existing stream handle.
//
// Results:
//	A standard Tcl result.
//
// Side effects:
//	Any data left in the (de)compression buffer is lost.
//
//----------------------------------------------------------------------

func XTcl_ZlibStreamReset(tls *libc.TLS, zshandle Tcl_ZlibStream) int32 { /* tclZlib.c:997:1: */
	var zshPtr uintptr = zshandle
	var e int32

	if !((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FstreamEnd != 0) {
		if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fmode == TCL_ZLIB_STREAM_DEFLATE {
			z.XdeflateEnd(tls, zshPtr+8)
		} else {
			z.XinflateEnd(tls, zshPtr+8)
		}
	}
	XTcl_SetByteArrayLength(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData, 0)
	XTcl_SetByteArrayLength(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData, 0)
	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput != 0 {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput = uintptr(0)
	}

	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutPos = 0
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FstreamEnd = 0
	libc.Xmemset(tls, zshPtr+8, 0, uint64(unsafe.Sizeof(Z_stream{})))

	// No output buffer available yet.

	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fmode == TCL_ZLIB_STREAM_DEFLATE {
		e = z.XdeflateInit2_(tls, zshPtr+8, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Flevel, Z_DEFLATED, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fwbits, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY, ts+73609, int32(unsafe.Sizeof(Z_stream{})))
		if e == Z_OK && (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fflags&DICT_TO_SET != 0 {
			e = sSetDeflateDictionary(tls, zshPtr+8, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj)
			if e == Z_OK {
				*(*int32)(unsafe.Pointer(zshPtr + 192)) |= libc.CplInt32(DICT_TO_SET)
			}
		}
	} else {
		e = z.XinflateInit2_(tls, zshPtr+8, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fwbits, ts+73609, int32(unsafe.Sizeof(Z_stream{})))
		if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fformat == TCL_ZLIB_FORMAT_RAW && (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fflags&DICT_TO_SET != 0 && e == Z_OK {
			e = sSetInflateDictionary(tls, zshPtr+8, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj)
			if e == Z_OK {
				*(*int32)(unsafe.Pointer(zshPtr + 192)) |= libc.CplInt32(DICT_TO_SET)
			}
		}
	}

	if e != Z_OK {
		sConvertError(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, e, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fadler)
		// TODO:cleanup
		return TCL_ERROR
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ZlibStreamGetCommandName --
//
//	This procedure will return the command name associated with the
//	stream.
//
// Results:
//	A Tcl_Obj with the name of the Tcl command or NULL if no command is
//	associated with the stream.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ZlibStreamGetCommandName(tls *libc.TLS, zshandle Tcl_ZlibStream) uintptr { /* tclZlib.c:1071:9: */
	var zshPtr uintptr = zshandle
	var objPtr uintptr

	if !(int32((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp) != 0) {
		return uintptr(0)
	}

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			objPtr = XTclThreadAllocObj(tls)
		} else {
			objPtr = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(0)
	{
	}

	XTcl_GetCommandFullName(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fcmd, objPtr)
	return objPtr
}

//----------------------------------------------------------------------
//
// Tcl_ZlibStreamEof --
//
//	This procedure This function returns 0 or 1 depending on the state of
//	the (de)compressor. For decompression, eof is reached when the entire
//	compressed stream has been decompressed. For compression, eof is
//	reached when the stream has been flushed with TCL_ZLIB_FINALIZE.
//
// Results:
//	Integer.
//
// Side effects:
//	None.
//
//----------------------------------------------------------------------

func XTcl_ZlibStreamEof(tls *libc.TLS, zshandle Tcl_ZlibStream) int32 { /* tclZlib.c:1107:1: */
	var zshPtr uintptr = zshandle

	return (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FstreamEnd
}

//----------------------------------------------------------------------
//
// Tcl_ZlibStreamChecksum --
//
//	Return the checksum of the uncompressed data seen so far by the
//	stream.
//
//----------------------------------------------------------------------

func XTcl_ZlibStreamChecksum(tls *libc.TLS, zshandle Tcl_ZlibStream) int32 { /* tclZlib.c:1127:1: */
	var zshPtr uintptr = zshandle

	return int32((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fadler)
}

//----------------------------------------------------------------------
//
// Tcl_ZlibStreamSetCompressionDictionary --
//
//	Sets the compression dictionary for a stream. This will be used as
//	appropriate for the next compression or decompression action performed
//	on the stream.
//
//----------------------------------------------------------------------

func XTcl_ZlibStreamSetCompressionDictionary(tls *libc.TLS, zshandle Tcl_ZlibStream, compressionDictionaryObj uintptr) { /* tclZlib.c:1148:1: */
	var zshPtr uintptr = zshandle

	if compressionDictionaryObj != uintptr(0) {
		if (*Tcl_Obj)(unsafe.Pointer(compressionDictionaryObj)).FrefCount > 1 {
			compressionDictionaryObj = XTcl_DuplicateObj(tls, compressionDictionaryObj)
		}
		(*Tcl_Obj)(unsafe.Pointer(compressionDictionaryObj)).FrefCount++
		*(*int32)(unsafe.Pointer(zshPtr + 192)) |= DICT_TO_SET
	} else {
		*(*int32)(unsafe.Pointer(zshPtr + 192)) &= libc.CplInt32(DICT_TO_SET)
	}
	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj != uintptr(0) {
		for ok := true; ok; ok = 0 != 0 {
			var _objPtr uintptr = (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
	}
	(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj = compressionDictionaryObj
}

//----------------------------------------------------------------------
//
// Tcl_ZlibStreamPut --
//
//	Add data to the stream for compression or decompression from a
//	bytearray Tcl_Obj.
//
//----------------------------------------------------------------------

func XTcl_ZlibStreamPut(tls *libc.TLS, zshandle Tcl_ZlibStream, data uintptr, flush int32) int32 { /* tclZlib.c:1184:1: */
	bp := tls.Alloc(40)
	defer tls.Free(40)

	var zshPtr uintptr = zshandle
	var dataTmp uintptr = uintptr(0)
	var e int32
	// var size int32 at bp+32, 4

	var outSize int32
	// var toStore int32 at bp+36, 4

	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FstreamEnd != 0 {
		if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp != 0 {
			XTcl_SetObjResult(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, XTcl_NewStringObj(tls,
				ts+73724, -1))
			XTcl_SetErrorCode(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, libc.VaList(bp, ts+3593, ts+73759, ts+73763, uintptr(0)))
		}
		return TCL_ERROR
	}

	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fmode == TCL_ZLIB_STREAM_DEFLATE {
		(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fnext_in = XTcl_GetByteArrayFromObj(tls, data, bp+32)
		(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Favail_in = UInt(*(*int32)(unsafe.Pointer(bp + 32 /* size */)))

		// Must not do a zero-length compress unless finalizing. [Bug 25842c161]

		if *(*int32)(unsafe.Pointer(bp + 32)) == 0 && flush != Z_FINISH {
			return TCL_OK
		}

		if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fflags&DICT_TO_SET != 0 {
			e = sSetDeflateDictionary(tls, zshPtr+8, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj)
			if e != Z_OK {
				sConvertError(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, e, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fadler)
				return TCL_ERROR
			}
			*(*int32)(unsafe.Pointer(zshPtr + 192)) |= libc.CplInt32(DICT_TO_SET)
		}

		// deflateBound() doesn't seem to take various header sizes into
		// account, so we add 100 extra bytes. However, we can also loop
		// around again so we also set an upper bound on the output buffer
		// size.

		outSize = int32(z.XdeflateBound(tls, zshPtr+8, uint64(*(*int32)(unsafe.Pointer(bp + 32)))) + uint64(100))
		if outSize > BUFFER_SIZE_LIMIT {
			outSize = BUFFER_SIZE_LIMIT
		}
		dataTmp = XTcl_Alloc(tls, uint32(outSize))

		for 1 != 0 {
			e = sDeflate(tls, zshPtr+8, dataTmp, outSize, flush, bp+36)

			// Test if we've filled the buffer up and have to ask deflate() to
			// give us some more. Note that the condition for needing to
			// repeat a buffer transfer when the result is Z_OK is whether
			// there is no more space in the buffer we provided; the zlib
			// library does not necessarily return a different code in that
			// case. [Bug b26e38a3e4] [Tk Bug 10f2e7872b]

			if e != -5 && (e != Z_OK || *(*int32)(unsafe.Pointer(bp + 36)) < outSize) {
				if e == Z_OK || flush == Z_FINISH && e == Z_STREAM_END {
					break
				}
				sConvertError(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, e, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fadler)
				return TCL_ERROR
			}

			// Output buffer too small to hold the data being generated or we
			// are doing the end-of-stream flush (which can spit out masses of
			// data). This means we need to put a new buffer into place after
			// saving the old generated data to the outData list.

			sAppendByteArray(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData, dataTmp, outSize)

			if outSize < BUFFER_SIZE_LIMIT {
				outSize = BUFFER_SIZE_LIMIT
				// There may be *lots* of data left to output...
				dataTmp = XTcl_Realloc(tls, dataTmp, uint32(outSize))
			}
		}

		// And append the final data block to the outData list.

		sAppendByteArray(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData, dataTmp, *(*int32)(unsafe.Pointer(bp + 36 /* toStore */)))
		XTclpFree(tls, dataTmp)
	} else {
		// This is easy. Just append to the inData list.

		XTcl_ListObjAppendElement(tls, uintptr(0), (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData, data)

		// and we'll need the flush parameter for the Inflate call.

		(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fflush = flush
	}

	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ZlibStreamGet --
//
//	Retrieve data (now compressed or decompressed) from the stream into a
//	bytearray Tcl_Obj.
//
//----------------------------------------------------------------------

func XTcl_ZlibStreamGet(tls *libc.TLS, zshandle Tcl_ZlibStream, data uintptr, count int32) int32 { /* tclZlib.c:1308:1: */
	bp := tls.Alloc(52)
	defer tls.Free(52)

	var zshPtr uintptr = zshandle
	var e int32
	var i int32
	// var listLen int32 at bp+36, 4

	// var itemLen int32 at bp+48, 4

	var dataPos int32 = 0
	// var itemObj uintptr at bp+40, 8

	var dataPtr uintptr
	var itemPtr uintptr
	// var existing int32 at bp+32, 4

	// Getting beyond the of stream, just return empty string.

	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FstreamEnd != 0 {
		return TCL_OK
	}

	XTcl_GetByteArrayFromObj(tls, data, bp+32)

	if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fmode == TCL_ZLIB_STREAM_INFLATE {
		if count == -1 {
			// The only safe thing to do is restict to 65k. We might cause a
			// panic for out of memory if we just kept growing the buffer.

			count = MAX_BUFFER_SIZE
		}

		// Prepare the place to store the data.

		dataPtr = XTcl_SetByteArrayLength(tls, data, *(*int32)(unsafe.Pointer(bp + 32))+count)
		dataPtr += uintptr(*(*int32)(unsafe.Pointer(bp + 32 /* existing */)))

		(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fnext_out = dataPtr
		(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Favail_out = UInt(count)
		if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Favail_in == UInt(0) {
			// zlib will probably need more data to decompress.

			if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput != 0 {
				for ok := true; ok; ok = 0 != 0 {
					var _objPtr uintptr = (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput = uintptr(0)
			}
			XTcl_ListObjLength(tls, uintptr(0), (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData, bp+36)
			if *(*int32)(unsafe.Pointer(bp + 36)) > 0 {
				// There is more input available, get it from the list and
				// give it to zlib. At this point, the data must not be shared
				// since we require the bytearray representation to not vanish
				// under our feet. [Bug 3081008]

				XTcl_ListObjIndex(tls, uintptr(0), (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData, 0, bp+40)
				if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FrefCount > 1 {
					*(*uintptr)(unsafe.Pointer(bp + 40 /* itemObj */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* itemObj */)))
				}
				itemPtr = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* itemObj */)), bp+48)
				(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FrefCount++
				(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput = *(*uintptr)(unsafe.Pointer(bp + 40 /* itemObj */))
				(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fnext_in = itemPtr
				(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Favail_in = UInt(*(*int32)(unsafe.Pointer(bp + 48 /* itemLen */)))

				// And remove it from the list

				XTcl_ListObjReplace(tls, uintptr(0), (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData, 0, 1, 0, uintptr(0))
			}
		}

		// When dealing with a raw stream, we set the dictionary here, once.
		// (You can't do it in response to getting Z_NEED_DATA as raw streams
		// don't ever issue that.)

		if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fformat == TCL_ZLIB_FORMAT_RAW && (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fflags&DICT_TO_SET != 0 {
			e = sSetInflateDictionary(tls, zshPtr+8, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj)
			if e != Z_OK {
				sConvertError(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, e, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fadler)
				return TCL_ERROR
			}
			*(*int32)(unsafe.Pointer(zshPtr + 192)) |= libc.CplInt32(DICT_TO_SET)
		}
		e = z.Xinflate(tls, zshPtr+8, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fflush)
		if e == Z_NEED_DICT && (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fflags&DICT_TO_SET != 0 {
			e = sSetInflateDictionary(tls, zshPtr+8, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj)
			if e == Z_OK {
				*(*int32)(unsafe.Pointer(zshPtr + 192)) |= libc.CplInt32(DICT_TO_SET)
				e = z.Xinflate(tls, zshPtr+8, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fflush)
			}
		}

		XTcl_ListObjLength(tls, uintptr(0), (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData, bp+36)

		for (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Favail_out > UInt(0) &&
			(e == Z_OK || e == -5) && *(*int32)(unsafe.Pointer(bp + 36)) > 0 {
			// State: We have not satisfied the request yet and there may be
			// more to inflate.

			if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Favail_in > UInt(0) {
				if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp != 0 {
					XTcl_SetObjResult(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, XTcl_NewStringObj(tls,

						ts+73770, -1))
					XTcl_SetErrorCode(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, libc.VaList(bp, ts+3593, ts+73759, ts+73822,
						uintptr(0)))
				}
				XTcl_SetByteArrayLength(tls, data, *(*int32)(unsafe.Pointer(bp + 32 /* existing */)))
				return TCL_ERROR
			}

			if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput != 0 {
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var _objPtr uintptr = (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput = uintptr(0)
			}

			// Get the next block of data to go to inflate. At this point, the
			// data must not be shared since we require the bytearray
			// representation to not vanish under our feet. [Bug 3081008]

			XTcl_ListObjIndex(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData, 0, bp+40)
			if (*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FrefCount > 1 {
				*(*uintptr)(unsafe.Pointer(bp + 40 /* itemObj */)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* itemObj */)))
			}
			itemPtr = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* itemObj */)), bp+48)
			(*Tcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FrefCount++
			(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput = *(*uintptr)(unsafe.Pointer(bp + 40 /* itemObj */))
			(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fnext_in = itemPtr
			(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Favail_in = UInt(*(*int32)(unsafe.Pointer(bp + 48 /* itemLen */)))

			// Remove it from the list.

			XTcl_ListObjReplace(tls, uintptr(0), (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FinData, 0, 1, 0, uintptr(0))
			*(*int32)(unsafe.Pointer(bp + 36 /* listLen */))--

			// And call inflate again.

			for ok2 := true; ok2; ok2 = e == Z_OK {
				e = z.Xinflate(tls, zshPtr+8, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fflush)
				if e != Z_NEED_DICT || !((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fflags&DICT_TO_SET != 0) {
					break
				}
				e = sSetInflateDictionary(tls, zshPtr+8, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcompDictObj)
				*(*int32)(unsafe.Pointer(zshPtr + 192)) |= libc.CplInt32(DICT_TO_SET)
			}
		}
		if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Favail_out > UInt(0) {
			XTcl_SetByteArrayLength(tls, data,
				int32(UInt(*(*int32)(unsafe.Pointer(bp + 32))+count)-(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Favail_out))
		}
		if !(e == Z_OK || e == Z_STREAM_END || e == -5) {
			XTcl_SetByteArrayLength(tls, data, *(*int32)(unsafe.Pointer(bp + 32 /* existing */)))
			sConvertError(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Finterp, e, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fstream.Fadler)
			return TCL_ERROR
		}
		if e == Z_STREAM_END {
			(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FstreamEnd = 1
			if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput != 0 {
				for ok3 := true; ok3; ok3 = 0 != 0 {
					var _objPtr uintptr = (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput
					if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
						XTclFreeObj(tls, _objPtr)
					}
				}
				(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FcurrentInput = uintptr(0)
			}
			z.XinflateEnd(tls, zshPtr+8)
		}
	} else {
		XTcl_ListObjLength(tls, uintptr(0), (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData, bp+36)
		if count == -1 {
			count = 0
			for i = 0; i < *(*int32)(unsafe.Pointer(bp + 36 /* listLen */)); i++ {
				XTcl_ListObjIndex(tls, uintptr(0), (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData, i, bp+40)
				XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* itemObj */)), bp+48)
				if i == 0 {
					count = count + (*(*int32)(unsafe.Pointer(bp + 48)) - (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutPos)
				} else {
					count = count + *(*int32)(unsafe.Pointer(bp + 48))
				}
			}
		}

		// Prepare the place to store the data.

		dataPtr = XTcl_SetByteArrayLength(tls, data, *(*int32)(unsafe.Pointer(bp + 32))+count)
		dataPtr += uintptr(*(*int32)(unsafe.Pointer(bp + 32 /* existing */)))

		for count > dataPos && XTcl_ListObjLength(tls, uintptr(0), (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData, bp+36) == TCL_OK &&
			*(*int32)(unsafe.Pointer(bp + 36)) > 0 {
			// Get the next chunk off our list of chunks and grab the data out
			// of it.

			XTcl_ListObjIndex(tls, uintptr(0), (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData, 0, bp+40)
			itemPtr = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* itemObj */)), bp+48)
			if *(*int32)(unsafe.Pointer(bp + 48))-(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutPos >= count-dataPos {
				var len uint32 = uint32(count - dataPos)

				libc.Xmemcpy(tls, dataPtr+uintptr(dataPos), itemPtr+uintptr((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutPos), uint64(len))
				*(*int32)(unsafe.Pointer(zshPtr + 152)) += int32(len)
				dataPos = int32(uint32(dataPos) + len)
				if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutPos == *(*int32)(unsafe.Pointer(bp + 48)) {
					(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutPos = 0
				}
			} else {
				var len uint32 = uint32(*(*int32)(unsafe.Pointer(bp + 48)) - (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutPos)

				libc.Xmemcpy(tls, dataPtr+uintptr(dataPos), itemPtr+uintptr((*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutPos), uint64(len))
				dataPos = int32(uint32(dataPos) + len)
				(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutPos = 0
			}
			if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutPos == 0 {
				XTcl_ListObjReplace(tls, uintptr(0), (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FoutData, 0, 1, 0, uintptr(0))
				*(*int32)(unsafe.Pointer(bp + 36 /* listLen */))--
			}
		}
		XTcl_SetByteArrayLength(tls, data, *(*int32)(unsafe.Pointer(bp + 32))+dataPos)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// Tcl_ZlibDeflate --
//
//	Compress the contents of Tcl_Obj *data with compression level in
//	output format, producing the compressed data in the interpreter
//	result.
//
//----------------------------------------------------------------------

func XTcl_ZlibDeflate(tls *libc.TLS, interp uintptr, format int32, data uintptr, level int32, gzipHeaderDictObj uintptr) int32 { /* tclZlib.c:1557:1: */
	bp := tls.Alloc(4552)
	defer tls.Free(4552)

	var wbits int32
	// var inLen int32 at bp+4436, 4

	var e int32
	// var extraSize int32 at bp+4432, 4

	var inData uintptr
	// var stream Z_stream at bp+4440, 112

	// var header GzipHeader at bp, 4432

	var headerPtr uintptr
	var obj uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr
	wbits = 0
	*(*int32)(unsafe.Pointer(bp + 4436 /* inLen */)) = 0
	e = 0
	*(*int32)(unsafe.Pointer(bp + 4432 /* extraSize */)) = 0
	inData = uintptr(0)
	headerPtr = uintptr(0)

	if !!(interp != 0) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	// Compressed format is specified by the wbits parameter. See zlib.h for
	// details.

	if !(format == TCL_ZLIB_FORMAT_RAW) {
		goto __2
	}
	wbits = -MAX_WBITS
	goto __3
__2:
	if !(format == TCL_ZLIB_FORMAT_GZIP) {
		goto __4
	}
	wbits = MAX_WBITS | 16

	// Need to allocate extra space for the gzip header and footer. The
	// amount of space is (a bit less than) 32 bytes, plus a byte for each
	// byte of string that we add. Note that over-allocation is not a
	// problem. [Bug 2419061]

	*(*int32)(unsafe.Pointer(bp + 4432 /* extraSize */)) = 32
	if !(gzipHeaderDictObj != 0) {
		goto __6
	}
	headerPtr = bp
	libc.Xmemset(tls, headerPtr, 0, uint64(unsafe.Sizeof(Gz_header{})))
	if !(sGenerateHeader(tls, interp, gzipHeaderDictObj, bp,
		bp+4432) != TCL_OK) {
		goto __7
	}
	return TCL_ERROR
__7:
	;
__6:
	;
	goto __5
__4:
	if !(format == TCL_ZLIB_FORMAT_ZLIB) {
		goto __8
	}
	wbits = MAX_WBITS
	goto __9
__8:
	XTcl_Panic(tls,
		ts+73828, 0)
__9:
	;
__5:
	;
__3:
	;

	if !(level < -1 || level > 9) {
		goto __10
	}
	XTcl_Panic(tls,
		ts+73931, 0)
__10:
	;

	// Allocate some space to store the output.

__11:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __14
	}
	obj = XTclThreadAllocObj(tls)
	goto __15
__14:
	obj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(obj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__15:
	;
	goto __12
__12:
	if 0 != 0 {
		goto __11
	}
	goto __13
__13:
	;
	(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr = uintptr(0)

	// Obtain the pointer to the byte array, we'll pass this pointer straight
	// to the deflate command.

	inData = XTcl_GetByteArrayFromObj(tls, data, bp+4436)
	libc.Xmemset(tls, bp+4440, 0, uint64(unsafe.Sizeof(Z_stream{})))
	(*Z_stream)(unsafe.Pointer(bp + 4440 /* &stream */)).Favail_in = UInt(*(*int32)(unsafe.Pointer(bp + 4436 /* inLen */)))
	(*Z_stream)(unsafe.Pointer(bp + 4440 /* &stream */)).Fnext_in = inData

	// No output buffer available yet, will alloc after deflateInit2.

	e = z.XdeflateInit2_(tls, bp+4440, level, Z_DEFLATED, wbits, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY, ts+73609, int32(unsafe.Sizeof(Z_stream{})))
	if !(e != Z_OK) {
		goto __16
	}
	goto error
__16:
	;

	if !(headerPtr != uintptr(0)) {
		goto __17
	}
	e = z.XdeflateSetHeader(tls, bp+4440, headerPtr)
	if !(e != Z_OK) {
		goto __18
	}
	goto error
__18:
	;
__17:
	;

	// Allocate the output buffer from the value of deflateBound(). This is
	// probably too much space. Before returning to the caller, we will reduce
	// it back to the actual compressed size.

	(*Z_stream)(unsafe.Pointer(bp + 4440 /* &stream */)).Favail_out = UInt(z.XdeflateBound(tls, bp+4440, uint64(*(*int32)(unsafe.Pointer(bp + 4436)))) + ULong(*(*int32)(unsafe.Pointer(bp + 4432))))
	(*Z_stream)(unsafe.Pointer(bp + 4440 /* &stream */)).Fnext_out = XTcl_SetByteArrayLength(tls, obj, int32((*Z_stream)(unsafe.Pointer(bp+4440 /* &stream */)).Favail_out))

	// Perform the compression, Z_FINISH means do it in one go.

	e = z.Xdeflate(tls, bp+4440, Z_FINISH)

	if !(e != Z_STREAM_END) {
		goto __19
	}
	e = z.XdeflateEnd(tls, bp+4440)

	// deflateEnd() returns Z_OK when there are bytes left to compress, at
	// this point we consider that an error, although we could continue by
	// allocating more memory and calling deflate() again.

	if !(e == Z_OK) {
		goto __21
	}
	e = -5
__21:
	;
	goto __20
__19:
	e = z.XdeflateEnd(tls, bp+4440)
__20:
	;

	if !(e != Z_OK) {
		goto __22
	}
	goto error
__22:
	;

	// Reduce the bytearray length to the actual data length produced by
	// deflate.

	XTcl_SetByteArrayLength(tls, obj, int32((*Z_stream)(unsafe.Pointer(bp+4440 /* &stream */)).Ftotal_out))
	XTcl_SetObjResult(tls, interp, obj)
	return TCL_OK

error:
	sConvertError(tls, interp, e, (*Z_stream)(unsafe.Pointer(bp+4440 /* &stream */)).Fadler)
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount, 1) > 1) {
		goto __23
	}
	goto __24
__23:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __25
	}

	if !((*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != XtclEmptyStringRep) {
		goto __27
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes)
__27:
	;
	(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = -1
__28:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __31
	}
	XTclThreadFreeObj(tls, obj)
	goto __32
__31:
	*(*uintptr)(unsafe.Pointer(obj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = obj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__32:
	;
	goto __29
__29:
	if 0 != 0 {
		goto __28
	}
	goto __30
__30:
	;
	goto __26
__25:
	XTclFreeObj(tls, obj)
__26:
	;
__24:
	;

	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_ZlibInflate --
//
//	Decompress data in an object into the interpreter result.
//
//----------------------------------------------------------------------

func XTcl_ZlibInflate(tls *libc.TLS, interp uintptr, format int32, data uintptr, bufferSize int32, gzipHeaderDictObj uintptr) int32 { /* tclZlib.c:1707:1: */
	bp := tls.Alloc(200)
	defer tls.Free(200)

	var wbits int32
	// var inLen int32 at bp+80, 4

	var e int32
	var newBufferSize int32
	var inData uintptr
	var outData uintptr
	var newOutData uintptr
	// var stream Z_stream at bp+88, 112

	// var header Gz_header at bp, 80

	var headerPtr uintptr
	var obj uintptr
	var nameBuf uintptr
	var commentBuf uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr
	wbits = 0
	*(*int32)(unsafe.Pointer(bp + 80 /* inLen */)) = 0
	e = 0
	inData = uintptr(0)
	outData = uintptr(0)
	newOutData = uintptr(0)
	headerPtr = uintptr(0)
	nameBuf = uintptr(0)
	commentBuf = uintptr(0)

	if !!(interp != 0) {
		goto __1
	}
	return TCL_ERROR
__1:
	;

	// Compressed format is specified by the wbits parameter. See zlib.h for
	// details.

	switch format {
	case TCL_ZLIB_FORMAT_RAW:
		goto __3
	case TCL_ZLIB_FORMAT_ZLIB:
		goto __4
	case TCL_ZLIB_FORMAT_GZIP:
		goto __5
	case TCL_ZLIB_FORMAT_AUTO:
		goto __6
	default:
		goto __7
	}
	goto __2
__3:
	wbits = -MAX_WBITS
	gzipHeaderDictObj = uintptr(0)
	goto __2
__4:
	wbits = MAX_WBITS
	gzipHeaderDictObj = uintptr(0)
	goto __2
__5:
	wbits = MAX_WBITS | 16
	goto __2
__6:
	wbits = MAX_WBITS | 32
	goto __2
__7:
	XTcl_Panic(tls,

		ts+73416, 0)
__2:
	;

	if !(gzipHeaderDictObj != 0) {
		goto __8
	}
	headerPtr = bp /* &header */
	libc.Xmemset(tls, headerPtr, 0, uint64(unsafe.Sizeof(Gz_header{})))
	nameBuf = XTcl_Alloc(tls, uint32(PATH_MAX))
	(*Gz_header)(unsafe.Pointer(bp /* &header */)).Fname = nameBuf
	(*Gz_header)(unsafe.Pointer(bp /* &header */)).Fname_max = UInt(PATH_MAX - 1)
	commentBuf = XTcl_Alloc(tls, uint32(MAX_COMMENT_LEN))
	(*Gz_header)(unsafe.Pointer(bp /* &header */)).Fcomment = commentBuf
	(*Gz_header)(unsafe.Pointer(bp /* &header */)).Fcomm_max = UInt(MAX_COMMENT_LEN - 1)
__8:
	;

	inData = XTcl_GetByteArrayFromObj(tls, data, bp+80)
	if !(bufferSize < 1) {
		goto __9
	}
	// Start with a buffer (up to) 3 times the size of the input data.

	if !(*(*int32)(unsafe.Pointer(bp + 80)) < 32*1024*1024) {
		goto __10
	}
	bufferSize = 3 * *(*int32)(unsafe.Pointer(bp + 80))
	goto __11
__10:
	if !(*(*int32)(unsafe.Pointer(bp + 80)) < 256*1024*1024) {
		goto __12
	}
	bufferSize = 2 * *(*int32)(unsafe.Pointer(bp + 80))
	goto __13
__12:
	bufferSize = *(*int32)(unsafe.Pointer(bp + 80 /* inLen */))
__13:
	;
__11:
	;
__9:
	;

__14:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __17
	}
	obj = XTclThreadAllocObj(tls)
	goto __18
__17:
	obj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(obj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__18:
	;
	goto __15
__15:
	if 0 != 0 {
		goto __14
	}
	goto __16
__16:
	;
	(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr = uintptr(0)

	outData = XTcl_SetByteArrayLength(tls, obj, bufferSize)
	libc.Xmemset(tls, bp+88, 0, uint64(unsafe.Sizeof(Z_stream{})))
	(*Z_stream)(unsafe.Pointer(bp + 88 /* &stream */)).Favail_in = UInt(*(*int32)(unsafe.Pointer(bp + 80))) + UInt(1) // +1 because zlib can "over-request"
	// input (but ignore it!)
	(*Z_stream)(unsafe.Pointer(bp + 88 /* &stream */)).Fnext_in = inData
	(*Z_stream)(unsafe.Pointer(bp + 88 /* &stream */)).Favail_out = UInt(bufferSize)
	(*Z_stream)(unsafe.Pointer(bp + 88 /* &stream */)).Fnext_out = outData

	// Initialize zlib for decompression.

	e = z.XinflateInit2_(tls, bp+88, wbits, ts+73609, int32(unsafe.Sizeof(Z_stream{})))
	if !(e != Z_OK) {
		goto __19
	}
	goto error
__19:
	;
	if !(headerPtr != 0) {
		goto __20
	}
	e = z.XinflateGetHeader(tls, bp+88, headerPtr)
	if !(e != Z_OK) {
		goto __21
	}
	z.XinflateEnd(tls, bp+88)
	goto error
__21:
	;
__20:
	;

	// Start the decompression cycle.

__22:
	if !(1 != 0) {
		goto __23
	}
	e = z.Xinflate(tls, bp+88, Z_FINISH)
	if !(e != -5) {
		goto __24
	}
	goto __23
__24:
	;

	// Not enough room in the output buffer. Increase it by five times the
	// bytes still in the input buffer. (Because 3 times didn't do the
	// trick before, 5 times is what we do next.) Further optimization
	// should be done by the user, specify the decompressed size!

	if !((*Z_stream)(unsafe.Pointer(bp+88)).Favail_in == UInt(0) && (*Z_stream)(unsafe.Pointer(bp+88)).Favail_out > UInt(0)) {
		goto __25
	}
	e = -2
	goto __23
__25:
	;
	newBufferSize = int32(UInt(bufferSize) + UInt(5)*(*Z_stream)(unsafe.Pointer(bp+88)).Favail_in)
	if !(newBufferSize == bufferSize) {
		goto __26
	}
	newBufferSize = bufferSize + 1000
__26:
	;
	newOutData = XTcl_SetByteArrayLength(tls, obj, newBufferSize)

	// Set next out to the same offset in the new location.

	(*Z_stream)(unsafe.Pointer(bp + 88 /* &stream */)).Fnext_out = newOutData + uintptr((*Z_stream)(unsafe.Pointer(bp+88)).Ftotal_out)

	// And increase avail_out with the number of new bytes allocated.

	*(*UInt)(unsafe.Pointer(bp + 88 + 32)) += UInt(newBufferSize - bufferSize)
	outData = newOutData
	bufferSize = newBufferSize
	goto __22
__23:
	;

	if !(e != Z_STREAM_END) {
		goto __27
	}
	z.XinflateEnd(tls, bp+88)
	goto error
__27:
	;

	e = z.XinflateEnd(tls, bp+88)
	if !(e != Z_OK) {
		goto __28
	}
	goto error
__28:
	;

	// Reduce the BA length to the actual data length produced by deflate.

	XTcl_SetByteArrayLength(tls, obj, int32((*Z_stream)(unsafe.Pointer(bp+88 /* &stream */)).Ftotal_out))
	if !(headerPtr != uintptr(0)) {
		goto __29
	}
	sExtractHeader(tls, bp, gzipHeaderDictObj)
	XTcl_DictObjPut(tls, uintptr(0), gzipHeaderDictObj, XTcl_NewStringObj(tls, ts+12297, -1), XTcl_NewLongObj(tls, int64((*Z_stream)(unsafe.Pointer(bp+88)).Ftotal_out)))
	XTclpFree(tls, nameBuf)
	XTclpFree(tls, commentBuf)
__29:
	;
	XTcl_SetObjResult(tls, interp, obj)
	return TCL_OK

error:
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount, 1) > 1) {
		goto __30
	}
	goto __31
__30:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __32
	}

	if !((*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != XtclEmptyStringRep) {
		goto __34
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes)
__34:
	;
	(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = -1
__35:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __38
	}
	XTclThreadFreeObj(tls, obj)
	goto __39
__38:
	*(*uintptr)(unsafe.Pointer(obj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = obj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__39:
	;
	goto __36
__36:
	if 0 != 0 {
		goto __35
	}
	goto __37
__37:
	;
	goto __33
__32:
	XTclFreeObj(tls, obj)
__33:
	;
__31:
	;

	sConvertError(tls, interp, e, (*Z_stream)(unsafe.Pointer(bp+88 /* &stream */)).Fadler)
	if !(nameBuf != 0) {
		goto __40
	}
	XTclpFree(tls, nameBuf)
__40:
	;
	if !(commentBuf != 0) {
		goto __41
	}
	XTclpFree(tls, commentBuf)
__41:
	;
	return TCL_ERROR
}

//----------------------------------------------------------------------
//
// Tcl_ZlibCRC32, Tcl_ZlibAdler32 --
//
//	Access to the checksumming engines.
//
//----------------------------------------------------------------------

func XTcl_ZlibCRC32(tls *libc.TLS, crc uint32, buf uintptr, len int32) uint32 { /* tclZlib.c:1892:1: */
	// Nothing much to do, just wrap the crc32().
	return uint32(z.Xcrc32(tls, uint64(crc), buf, uint32(len)))
}

func XTcl_ZlibAdler32(tls *libc.TLS, adler uint32, buf uintptr, len int32) uint32 { /* tclZlib.c:1902:1: */
	return uint32(z.Xadler32(tls, uint64(adler), buf, uint32(len)))
}

//----------------------------------------------------------------------
//
// ZlibCmd --
//
//	Implementation of the [zlib] command.
//
//----------------------------------------------------------------------

func sZlibCmd(tls *libc.TLS, notUsed ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclZlib.c:1921:1: */
	bp := tls.Alloc(104)
	defer tls.Free(104)

	// var command int32 at bp+80, 4

	// var dlen int32 at bp+88, 4

	var i int32
	// var option int32 at bp+96, 4

	// var level int32 at bp+92, 4

	// var start uint32 at bp+84, 4

	// var buffersize uint32 at bp+100, 4

	var data uintptr
	var headerDictObj uintptr
	var extraInfoStr uintptr
	var cachePtr uintptr
	var cachePtr1 uintptr // gunzip gzippeddata ?bufferSize?
	//	-> decompressedData
	var headerVarObj uintptr
	*(*int32)(unsafe.Pointer(bp + 92 /* level */)) = -1
	*(*uint32)(unsafe.Pointer(bp + 100 /* buffersize */)) = uint32(0)
	extraInfoStr = uintptr(0)

	if !(objc < 2) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 1, objv, ts+74045)
	return TCL_ERROR
__1:
	;
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&commands)), int32(unsafe.Sizeof(uintptr(0))), ts+13561, 0, bp+80) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;

	switch uint32(*(*int32)(unsafe.Pointer(bp + 80 /* command */))) {
	case uint32(0) /* CMD_ADLER */ :
		goto __4
	case uint32(2) /* CMD_CRC */ :
		goto __5
	case uint32(4) /* CMD_DEFLATE */ :
		goto __6
	case uint32(1) /* CMD_COMPRESS */ :
		goto __7
	case uint32(6) /* CMD_GZIP */ :
		goto __8
	case uint32(7) /* CMD_INFLATE */ :
		goto __9
	case uint32(3) /* CMD_DECOMPRESS */ :
		goto __10
	case uint32(5) /* CMD_GUNZIP */ :
		goto __11
	case uint32(9) /* CMD_STREAM */ :
		goto __12
	case uint32(8) /* CMD_PUSH */ :
		goto __13
	}
	goto __3
__4: // adler32 str ?startvalue?
	// -> checksum
	if !(objc < 3 || objc > 4) {
		goto __14
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+74063)
	return TCL_ERROR
__14:
	;
	if !(objc > 3 && XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)),
		bp+84) != TCL_OK) {
		goto __15
	}
	return TCL_ERROR
__15:
	;
	if !(objc < 4) {
		goto __16
	}
	*(*uint32)(unsafe.Pointer(bp + 84 /* start */)) = XTcl_ZlibAdler32(tls, uint32(0), uintptr(0), 0)
__16:
	;
	data = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+88)
	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, Tcl_WideInt(ULong(XTcl_ZlibAdler32(tls, *(*uint32)(unsafe.Pointer(bp + 84 /* start */)), data, *(*int32)(unsafe.Pointer(bp + 88 /* dlen */)))))))
	return TCL_OK
__5: // crc32 str ?startvalue?
	// -> checksum
	if !(objc < 3 || objc > 4) {
		goto __17
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+74063)
	return TCL_ERROR
__17:
	;
	if !(objc > 3 && XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)),
		bp+84) != TCL_OK) {
		goto __18
	}
	return TCL_ERROR
__18:
	;
	if !(objc < 4) {
		goto __19
	}
	*(*uint32)(unsafe.Pointer(bp + 84 /* start */)) = XTcl_ZlibCRC32(tls, uint32(0), uintptr(0), 0)
__19:
	;
	data = XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+88)
	XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, Tcl_WideInt(ULong(XTcl_ZlibCRC32(tls, *(*uint32)(unsafe.Pointer(bp + 84 /* start */)), data, *(*int32)(unsafe.Pointer(bp + 88 /* dlen */)))))))
	return TCL_OK
__6: // deflate data ?level?
	// -> rawCompressedData
	if !(objc < 3 || objc > 4) {
		goto __20
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+74081)
	return TCL_ERROR
__20:
	;
	if !(objc > 3) {
		goto __21
	}
	if !(XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+92) != TCL_OK) {
		goto __22
	}
	return TCL_ERROR
__22:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 92)) < 0 || *(*int32)(unsafe.Pointer(bp + 92)) > 9) {
		goto __23
	}
	goto badLevel
__23:
	;
__21:
	;
	return XTcl_ZlibDeflate(tls, interp, TCL_ZLIB_FORMAT_RAW, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp + 92 /* level */)),
		uintptr(0))
__7: // compress data ?level?
	// -> zlibCompressedData
	if !(objc < 3 || objc > 4) {
		goto __24
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+74081)
	return TCL_ERROR
__24:
	;
	if !(objc > 3) {
		goto __25
	}
	if !(XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+92) != TCL_OK) {
		goto __26
	}
	return TCL_ERROR
__26:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 92)) < 0 || *(*int32)(unsafe.Pointer(bp + 92)) > 9) {
		goto __27
	}
	goto badLevel
__27:
	;
__25:
	;
	return XTcl_ZlibDeflate(tls, interp, TCL_ZLIB_FORMAT_ZLIB, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp + 92 /* level */)),
		uintptr(0))
__8: // gzip data ?level?
	// -> gzippedCompressedData
	headerDictObj = uintptr(0)

	// Legacy argument format support.

	if !(objc == 4 &&
		XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+92) == TCL_OK) {
		goto __28
	}
	if !(*(*int32)(unsafe.Pointer(bp + 92)) < 0 || *(*int32)(unsafe.Pointer(bp + 92)) > 9) {
		goto __29
	}
	extraInfoStr = ts + 74094 /* "\n    (in -level ..." */
	goto badLevel
__29:
	;
	return XTcl_ZlibDeflate(tls, interp, TCL_ZLIB_FORMAT_GZIP, *(*uintptr)(unsafe.Pointer(objv + 2*8)),
		*(*int32)(unsafe.Pointer(bp + 92 /* level */)), uintptr(0))
__28:
	;

	if !(objc < 3 || objc > 7 || objc&1 == 0) {
		goto __30
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv,
		ts+74118)
	return TCL_ERROR
__30:
	;
	i = 3
__31:
	if !(i < objc) {
		goto __33
	}

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&gzipopts)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+96) != TCL_OK) {
		goto __34
	}
	return TCL_ERROR
__34:
	;
	switch *(*int32)(unsafe.Pointer(bp + 96 /* option */)) {
	case 0:
		goto __36
	case 1:
		goto __37
	}
	goto __35
__36:
	headerDictObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	goto __35
__37:
	if !(XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)),
		bp+92) != TCL_OK) {
		goto __38
	}
	return TCL_ERROR
__38:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 92)) < 0 || *(*int32)(unsafe.Pointer(bp + 92)) > 9) {
		goto __39
	}
	extraInfoStr = ts + 74094 /* "\n    (in -level ..." */
	goto badLevel
__39:
	;
	goto __35
__35:
	;
	goto __32
__32:
	i = i + 2
	goto __31
	goto __33
__33:
	;
	return XTcl_ZlibDeflate(tls, interp, TCL_ZLIB_FORMAT_GZIP, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp + 92 /* level */)),
		headerDictObj)
__9: // inflate rawcomprdata ?bufferSize?
	//	-> decompressedData
	if !(objc < 3 || objc > 4) {
		goto __40
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+74155)
	return TCL_ERROR
__40:
	;
	if !(objc > 3) {
		goto __41
	}
	if !(XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)),
		bp+100) != TCL_OK) {
		goto __42
	}
	return TCL_ERROR
__42:
	;
	if !(*(*uint32)(unsafe.Pointer(bp + 100)) < uint32(MIN_NONSTREAM_BUFFER_SIZE) ||
		*(*uint32)(unsafe.Pointer(bp + 100)) > uint32(MAX_BUFFER_SIZE)) {
		goto __43
	}
	goto badBuffer
__43:
	;
__41:
	;
	return XTcl_ZlibInflate(tls, interp, TCL_ZLIB_FORMAT_RAW, *(*uintptr)(unsafe.Pointer(objv + 2*8)),
		int32(*(*uint32)(unsafe.Pointer(bp + 100 /* buffersize */))), uintptr(0))
__10: // decompress zlibcomprdata 					 *    ?bufferSize?
	//	-> decompressedData
	if !(objc < 3 || objc > 4) {
		goto __44
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+74155)
	return TCL_ERROR
__44:
	;
	if !(objc > 3) {
		goto __45
	}
	if !(XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)),
		bp+100) != TCL_OK) {
		goto __46
	}
	return TCL_ERROR
__46:
	;
	if !(*(*uint32)(unsafe.Pointer(bp + 100)) < uint32(MIN_NONSTREAM_BUFFER_SIZE) ||
		*(*uint32)(unsafe.Pointer(bp + 100)) > uint32(MAX_BUFFER_SIZE)) {
		goto __47
	}
	goto badBuffer
__47:
	;
__45:
	;
	return XTcl_ZlibInflate(tls, interp, TCL_ZLIB_FORMAT_ZLIB, *(*uintptr)(unsafe.Pointer(objv + 2*8)),
		int32(*(*uint32)(unsafe.Pointer(bp + 100 /* buffersize */))), uintptr(0))
__11:

	if !(objc < 3 || objc > 5 || objc&1 == 0) {
		goto __48
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+74173)
	return TCL_ERROR
__48:
	;
	headerDictObj = libc.AssignUintptr(&headerVarObj, uintptr(0))
	i = 3
__49:
	if !(i < objc) {
		goto __51
	}

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&gunzipopts)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+96) != TCL_OK) {
		goto __52
	}
	return TCL_ERROR
__52:
	;
	switch *(*int32)(unsafe.Pointer(bp + 96 /* option */)) {
	case 0:
		goto __54
	case 1:
		goto __55
	}
	goto __53
__54:
	if !(XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8)),
		bp+100) != TCL_OK) {
		goto __56
	}
	return TCL_ERROR
__56:
	;
	if !(*(*uint32)(unsafe.Pointer(bp + 100)) < uint32(MIN_NONSTREAM_BUFFER_SIZE) ||
		*(*uint32)(unsafe.Pointer(bp + 100)) > uint32(MAX_BUFFER_SIZE)) {
		goto __57
	}
	goto badBuffer
__57:
	;
	goto __53
__55:
	headerVarObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
__58:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
	}()) {
		goto __61
	}
	headerDictObj = XTclThreadAllocObj(tls)
	goto __62
__61:
	headerDictObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(headerDictObj + 32))
	(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
__62:
	;
	goto __59
__59:
	if 0 != 0 {
		goto __58
	}
	goto __60
__60:
	;
	(*Tcl_Obj)(unsafe.Pointer(headerDictObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(headerDictObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(headerDictObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(headerDictObj)).FtypePtr = uintptr(0)

	goto __53
__53:
	;
	goto __50
__50:
	i = i + 2
	goto __49
	goto __51
__51:
	;
	if !(XTcl_ZlibInflate(tls, interp, TCL_ZLIB_FORMAT_GZIP, *(*uintptr)(unsafe.Pointer(objv + 2*8)),
		int32(*(*uint32)(unsafe.Pointer(bp + 100))), headerDictObj) != TCL_OK) {
		goto __63
	}
	if !(headerDictObj != 0) {
		goto __64
	}
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(headerDictObj)).FrefCount, 1) > 1) {
		goto __65
	}
	goto __66
__65:
	if !(!(int32((*Tcl_Obj)(unsafe.Pointer(headerDictObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(headerDictObj)).FtypePtr)).FfreeIntRepProc) != 0)) {
		goto __67
	}

	if !((*Tcl_Obj)(unsafe.Pointer(headerDictObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(headerDictObj)).Fbytes != XtclEmptyStringRep) {
		goto __69
	}
	XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(headerDictObj)).Fbytes)
__69:
	;
	(*Tcl_Obj)(unsafe.Pointer(headerDictObj)).Flength = -1
__70:
	if !(uintptr(0) == uintptr(0) || func() bool {
		cachePtr1 = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
		return (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= ALLOC_NOBJHIGH
	}()) {
		goto __73
	}
	XTclThreadFreeObj(tls, headerDictObj)
	goto __74
__73:
	*(*uintptr)(unsafe.Pointer(headerDictObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = headerDictObj
	(*AllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++
__74:
	;
	goto __71
__71:
	if 0 != 0 {
		goto __70
	}
	goto __72
__72:
	;
	goto __68
__67:
	XTclFreeObj(tls, headerDictObj)
__68:
	;
__66:
	;

__64:
	;
	return TCL_ERROR
__63:
	;
	if !(headerVarObj != uintptr(0) && XTcl_ObjSetVar2(tls, interp, headerVarObj, uintptr(0),
		headerDictObj, TCL_LEAVE_ERR_MSG) == uintptr(0)) {
		goto __75
	}
	return TCL_ERROR
__75:
	;
	return TCL_OK

__12: // stream deflate/inflate/...gunzip 					 *    ?options...?
	//	-> handleCmd
	return sZlibStreamSubcmd(tls, interp, objc, objv)
__13: // push mode channel options...
	//	-> channel
	return sZlibPushSubcmd(tls, interp, objc, objv)
__3:
	;

	return TCL_ERROR

badLevel:
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+74199, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+6915, ts+74220, uintptr(0)))
	if !(extraInfoStr != 0) {
		goto __76
	}
	XTcl_AddErrorInfo(tls, interp, extraInfoStr)
__76:
	;
	return TCL_ERROR
badBuffer:
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+74237,
		libc.VaList(bp+32, MIN_NONSTREAM_BUFFER_SIZE, MAX_BUFFER_SIZE)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, ts+3593, ts+6915, ts+74266, uintptr(0)))
	return TCL_ERROR
}

var commands = [11]uintptr{
	ts + 74277, ts + 74285, ts + 74294, ts + 74300, ts + 74311, ts + 74319,
	ts + 74326, ts + 74331, ts + 2072, ts + 74339,
	uintptr(0),
} /* tclZlib.c:1932:23 */
var gzipopts = [3]uintptr{
	ts + 74346, ts + 27316, uintptr(0),
} /* tclZlib.c:2042:24 */
var gunzipopts = [3]uintptr{
	ts + 33585, ts + 74354, uintptr(0),
} /* tclZlib.c:2115:24 */

//----------------------------------------------------------------------
//
// ZlibStreamSubcmd --
//
//	Implementation of the [zlib stream] subcommand.
//
//----------------------------------------------------------------------

func sZlibStreamSubcmd(tls *libc.TLS, interp uintptr, objc int32, objv uintptr) int32 { /* tclZlib.c:2190:1: */
	bp := tls.Alloc(80)
	defer tls.Free(80)

	var i int32
	// var format int32 at bp+32, 4

	var mode int32 = 0
	// var option int32 at bp+36, 4

	// var level int32 at bp+64, 4

	*(*[3]uintptr)(unsafe.Pointer(bp + 40 /* obj */)) = [3]uintptr{uintptr(0), uintptr(0), uintptr(0)}
	var desc uintptr = uintptr(0)
	// var zh Tcl_ZlibStream at bp+72, 8

	if objc < 3 || !(objc&1 != 0) {
		XTcl_WrongNumArgs(tls, interp, 2, objv, ts+74365)
		return TCL_ERROR
	}
	if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&stream_formats)), int32(unsafe.Sizeof(uintptr(0))), ts+12815, 0, bp+32) != TCL_OK {
		return TCL_ERROR
	}

	// The format determines the compression mode and the options that may be
	// specified.

	switch uint32(*(*int32)(unsafe.Pointer(bp + 32 /* format */))) {
	case uint32(2) /* FMT_DEFLATE */ :
		desc = uintptr(unsafe.Pointer(&compressionOpts))
		mode = TCL_ZLIB_STREAM_DEFLATE
		*(*int32)(unsafe.Pointer(bp + 32 /* format */)) = TCL_ZLIB_FORMAT_RAW
		break
	case uint32(5) /* FMT_INFLATE */ :
		desc = uintptr(unsafe.Pointer(&expansionOpts))
		mode = TCL_ZLIB_STREAM_INFLATE
		*(*int32)(unsafe.Pointer(bp + 32 /* format */)) = TCL_ZLIB_FORMAT_RAW
		break
	case uint32(0) /* FMT_COMPRESS */ :
		desc = uintptr(unsafe.Pointer(&compressionOpts))
		mode = TCL_ZLIB_STREAM_DEFLATE
		*(*int32)(unsafe.Pointer(bp + 32 /* format */)) = TCL_ZLIB_FORMAT_ZLIB
		break
	case uint32(1) /* FMT_DECOMPRESS */ :
		desc = uintptr(unsafe.Pointer(&expansionOpts))
		mode = TCL_ZLIB_STREAM_INFLATE
		*(*int32)(unsafe.Pointer(bp + 32 /* format */)) = TCL_ZLIB_FORMAT_ZLIB
		break
	case uint32(4) /* FMT_GZIP */ :
		desc = uintptr(unsafe.Pointer(&gzipOpts))
		mode = TCL_ZLIB_STREAM_DEFLATE
		*(*int32)(unsafe.Pointer(bp + 32 /* format */)) = TCL_ZLIB_FORMAT_GZIP
		break
	case uint32(3) /* FMT_GUNZIP */ :
		desc = uintptr(unsafe.Pointer(&gunzipOpts))
		mode = TCL_ZLIB_STREAM_INFLATE
		*(*int32)(unsafe.Pointer(bp + 32 /* format */)) = TCL_ZLIB_FORMAT_GZIP
		break
	default:
		XTcl_Panic(tls, ts+74389, 0)
	}

	// Parse the options.

	for i = 3; i < objc; i = i + 2 {
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), desc,
			int32(unsafe.Sizeof(struct {
				Fname        uintptr
				Foffset      int32
				F__ccgo_pad1 [4]byte
			}{})), ts+9944, 0, bp+36) != TCL_OK {
			return TCL_ERROR
		}
		*(*uintptr)(unsafe.Pointer(bp + 40 + uintptr((*struct {
			Fname        uintptr
			Foffset      int32
			F__ccgo_pad1 [4]byte
		})(unsafe.Pointer(desc+uintptr(*(*int32)(unsafe.Pointer(bp + 36)))*16)).Foffset)*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+1)*8))
	}

	// If a compression level was given, parse it (integral: 0..9). Otherwise
	// use the default.

	if *(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)) == uintptr(0) {
		*(*int32)(unsafe.Pointer(bp + 64 /* level */)) = -1
	} else if XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)), bp+64) != TCL_OK {
		return TCL_ERROR
	} else if *(*int32)(unsafe.Pointer(bp + 64)) < 0 || *(*int32)(unsafe.Pointer(bp + 64)) > 9 {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, ts+74199, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+6915, ts+74220, uintptr(0)))
		XTcl_AddErrorInfo(tls, interp, ts+74094)
		return TCL_ERROR
	}

	// Construct the stream now we know its configuration.

	if XTcl_ZlibStreamInit(tls, interp, mode, *(*int32)(unsafe.Pointer(bp + 32)), *(*int32)(unsafe.Pointer(bp + 64)), *(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)),
		bp+72) != TCL_OK {
		return TCL_ERROR
	}
	if *(*uintptr)(unsafe.Pointer(bp + 40)) != uintptr(0) {
		XTcl_ZlibStreamSetCompressionDictionary(tls, *(*Tcl_ZlibStream)(unsafe.Pointer(bp + 72 /* zh */)), *(*uintptr)(unsafe.Pointer(bp + 40)))
	}
	XTcl_SetObjResult(tls, interp, XTcl_ZlibStreamGetCommandName(tls, *(*Tcl_ZlibStream)(unsafe.Pointer(bp + 72 /* zh */))))
	return TCL_OK
}

var stream_formats = [7]uintptr{
	ts + 74285, ts + 74300, ts + 74311, ts + 74319, ts + 74326, ts + 74331,
	uintptr(0),
} /* tclZlib.c:2195:23 */
var compressionOpts = [3]struct {
	Fname        uintptr
	Foffset      int32
	F__ccgo_pad1 [4]byte
}{
	{Fname: ts + 14894 /* "-dictionary" */},
	{Fname: ts + 27316 /* "-level" */, Foffset: 2 /* OPT_COMPRESSION_LEVEL */},
	{Foffset: -1 /* OPT_END */},
} /* tclZlib.c:2218:32 */
var gzipOpts = [3]struct {
	Fname        uintptr
	Foffset      int32
	F__ccgo_pad1 [4]byte
}{
	{Fname: ts + 74346 /* "-header" */, Foffset: 1 /* OPT_GZIP_HEADER */},
	{Fname: ts + 27316 /* "-level" */, Foffset: 2 /* OPT_COMPRESSION_LEVEL */},
	{Foffset: -1 /* OPT_END */},
} /* tclZlib.c:2223:32 */
var expansionOpts = [2]struct {
	Fname        uintptr
	Foffset      int32
	F__ccgo_pad1 [4]byte
}{
	{Fname: ts + 14894 /* "-dictionary" */},
	{Foffset: -1 /* OPT_END */},
} /* tclZlib.c:2228:32 */
var gunzipOpts = [1]struct {
	Fname        uintptr
	Foffset      int32
	F__ccgo_pad1 [4]byte
}{
	{Foffset: -1 /* OPT_END */},
} /* tclZlib.c:2232:32 */

//----------------------------------------------------------------------
//
// ZlibPushSubcmd --
//
//	Implementation of the [zlib push] subcommand.
//
//----------------------------------------------------------------------

func sZlibPushSubcmd(tls *libc.TLS, interp uintptr, objc int32, objv uintptr) int32 { /* tclZlib.c:2344:1: */
	bp := tls.Alloc(244)
	defer tls.Free(244)

	// var chan1 Tcl_Channel at bp+216, 8

	// var chanMode int32 at bp+224, 4

	// var format int32 at bp+208, 4

	var mode int32
	// var level int32 at bp+236, 4

	var i int32
	// var option int32 at bp+228, 4

	var pushOptions uintptr
	var headerObj uintptr
	var compDictObj uintptr
	// var limit int32 at bp+240, 4

	// var dummy int32 at bp+232, 4
	mode = 0
	pushOptions = uintptr(unsafe.Pointer(&pushDecompressOptions))
	headerObj = uintptr(0)
	compDictObj = uintptr(0)
	*(*int32)(unsafe.Pointer(bp + 240 /* limit */)) = DEFAULT_BUFFER_SIZE

	if !(objc < 4) {
		goto __1
	}
	XTcl_WrongNumArgs(tls, interp, 2, objv, ts+74411)
	return TCL_ERROR
__1:
	;

	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&stream_formats1)), int32(unsafe.Sizeof(uintptr(0))), ts+12815, 0, bp+208) != TCL_OK) {
		goto __2
	}
	return TCL_ERROR
__2:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 208 /* format */))) {
	case uint32(2) /* FMT_DEFLATE */ :
		goto __4
	case uint32(5) /* FMT_INFLATE */ :
		goto __5
	case uint32(0) /* FMT_COMPRESS */ :
		goto __6
	case uint32(1) /* FMT_DECOMPRESS */ :
		goto __7
	case uint32(4) /* FMT_GZIP */ :
		goto __8
	case uint32(3) /* FMT_GUNZIP */ :
		goto __9
	default:
		goto __10
	}
	goto __3
__4:
	mode = TCL_ZLIB_STREAM_DEFLATE
	*(*int32)(unsafe.Pointer(bp + 208 /* format */)) = TCL_ZLIB_FORMAT_RAW
	pushOptions = uintptr(unsafe.Pointer(&pushCompressOptions))
	goto __3
__5:
	mode = TCL_ZLIB_STREAM_INFLATE
	*(*int32)(unsafe.Pointer(bp + 208 /* format */)) = TCL_ZLIB_FORMAT_RAW
	goto __3
__6:
	mode = TCL_ZLIB_STREAM_DEFLATE
	*(*int32)(unsafe.Pointer(bp + 208 /* format */)) = TCL_ZLIB_FORMAT_ZLIB
	pushOptions = uintptr(unsafe.Pointer(&pushCompressOptions))
	goto __3
__7:
	mode = TCL_ZLIB_STREAM_INFLATE
	*(*int32)(unsafe.Pointer(bp + 208 /* format */)) = TCL_ZLIB_FORMAT_ZLIB
	goto __3
__8:
	mode = TCL_ZLIB_STREAM_DEFLATE
	*(*int32)(unsafe.Pointer(bp + 208 /* format */)) = TCL_ZLIB_FORMAT_GZIP
	pushOptions = uintptr(unsafe.Pointer(&pushCompressOptions))
	goto __3
__9:
	mode = TCL_ZLIB_STREAM_INFLATE
	*(*int32)(unsafe.Pointer(bp + 208 /* format */)) = TCL_ZLIB_FORMAT_GZIP
	goto __3
__10:
	XTcl_Panic(tls, ts+74389, 0)
__3:
	;

	if !(XTclGetChannelFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+216, bp+224, 0) != TCL_OK) {
		goto __11
	}
	return TCL_ERROR
__11:
	;

	// Sanity checks.

	if !(mode == TCL_ZLIB_STREAM_DEFLATE && !(*(*int32)(unsafe.Pointer(bp + 224))&(int32(1)<<2) != 0)) {
		goto __12
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+74437, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+73759, ts+74490, uintptr(0)))
	return TCL_ERROR
__12:
	;
	if !(mode == TCL_ZLIB_STREAM_INFLATE && !(*(*int32)(unsafe.Pointer(bp + 224))&(int32(1)<<1) != 0)) {
		goto __13
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+74501, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+73759, ts+74556, uintptr(0)))
	return TCL_ERROR
__13:
	;

	// Parse options.

	*(*int32)(unsafe.Pointer(bp + 236 /* level */)) = -1
	i = 4
__14:
	if !(i < objc) {
		goto __16
	}
	if !(XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), pushOptions, int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+228) != TCL_OK) {
		goto __17
	}
	return TCL_ERROR
__17:
	;
	if !(libc.PreIncInt32(&i, 1) > objc-1) {
		goto __18
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+74567, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(pushOptions + uintptr(*(*int32)(unsafe.Pointer(bp + 228 /* option */)))*8)))))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+73759, ts+74595, uintptr(0)))
	return TCL_ERROR
__18:
	;
	switch uint32(*(*int32)(unsafe.Pointer(bp + 228 /* option */))) {
	case uint32(1) /* poHeader */ :
		goto __20
	case uint32(2) /* poLevel */ :
		goto __21
	case uint32(3) /* poLimit */ :
		goto __22
	case uint32(0) /* poDictionary */ :
		goto __23
	}
	goto __19
__20:
	headerObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	if !(XTcl_DictObjSize(tls, interp, headerObj, bp+232) != TCL_OK) {
		goto __24
	}
	goto genericOptionError
__24:
	;
	goto __19
__21:
	if !(XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+236) != TCL_OK) {
		goto __25
	}
	goto genericOptionError
__25:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 236)) < 0 || *(*int32)(unsafe.Pointer(bp + 236)) > 9) {
		goto __26
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
		ts+74199, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+104, ts+3593, ts+6915, ts+74220,
		uintptr(0)))
	goto genericOptionError
__26:
	;
	goto __19
__22:
	if !(XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+240) != TCL_OK) {
		goto __27
	}
	goto genericOptionError
__27:
	;
	if !(*(*int32)(unsafe.Pointer(bp + 240)) < 1 || *(*int32)(unsafe.Pointer(bp + 240)) > MAX_BUFFER_SIZE) {
		goto __28
	}
	XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
		ts+74601,
		libc.VaList(bp+136, MAX_BUFFER_SIZE)))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+144, ts+3593, ts+6915, ts+74266, uintptr(0)))
	goto genericOptionError
__28:
	;
	goto __19
__23:
	if !(*(*int32)(unsafe.Pointer(bp + 208)) == TCL_ZLIB_FORMAT_GZIP) {
		goto __29
	}
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

		ts+74634, -1))
	XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, ts+3593, ts+73759, ts+74693, uintptr(0)))
	goto genericOptionError
__29:
	;
	compDictObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))
	goto __19
__19:
	;
	goto __15
__15:
	i++
	goto __14
	goto __16
__16:
	;

	if !(sZlibStackChannelTransform(tls, interp, mode, *(*int32)(unsafe.Pointer(bp + 208)), *(*int32)(unsafe.Pointer(bp + 236)), *(*int32)(unsafe.Pointer(bp + 240)), *(*Tcl_Channel)(unsafe.Pointer(bp + 216)),
		headerObj, compDictObj) == uintptr(0)) {
		goto __30
	}
	return TCL_ERROR
__30:
	;
	XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)))
	return TCL_OK

genericOptionError:
	XTcl_AddErrorInfo(tls, interp, ts+74700)
	XTcl_AddErrorInfo(tls, interp, *(*uintptr)(unsafe.Pointer(pushOptions + uintptr(*(*int32)(unsafe.Pointer(bp + 228 /* option */)))*8)))
	XTcl_AddErrorInfo(tls, interp, ts+74710)
	return TCL_ERROR
}

var stream_formats1 = [7]uintptr{
	ts + 74285, ts + 74300, ts + 74311, ts + 74319, ts + 74326, ts + 74331,
	uintptr(0),
} /* tclZlib.c:2349:23 */
var pushCompressOptions = [4]uintptr{
	ts + 14894, ts + 74346, ts + 27316, uintptr(0),
} /* tclZlib.c:2359:23 */
var pushDecompressOptions = [5]uintptr{
	ts + 14894, ts + 74346, ts + 27316, ts + 74719, uintptr(0),
} /* tclZlib.c:2362:23 */

//----------------------------------------------------------------------
//
// ZlibStreamCmd --
//
//	Implementation of the commands returned by [zlib stream].
//
//----------------------------------------------------------------------

func sZlibStreamCmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclZlib.c:2517:1: */
	bp := tls.Alloc(8)
	defer tls.Free(8)

	var zstream Tcl_ZlibStream = cd
	// var command int32 at bp, 4

	// var count int32 at bp+4, 4

	var code int32
	var obj uintptr

	if objc < 2 {
		XTcl_WrongNumArgs(tls, interp, 1, objv, ts+74726)
		return TCL_ERROR
	}

	if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&cmds)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp) != TCL_OK {
		return TCL_ERROR
	}

	switch uint32(*(*int32)(unsafe.Pointer(bp /* command */))) {
	case uint32(0) /* zs_add */ : // $strm add ?$flushopt? $data
		return sZlibStreamAddCmd(tls, zstream, interp, objc, objv)
	case uint32(8) /* zs_header */ : // $strm header
		return sZlibStreamHeaderCmd(tls, zstream, interp, objc, objv)
	case uint32(9) /* zs_put */ : // $strm put ?$flushopt? $data
		return sZlibStreamPutCmd(tls, zstream, interp, objc, objv)

	case uint32(7) /* zs_get */ : // $strm get ?count?
		if objc > 3 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, ts+74744)
			return TCL_ERROR
		}

		*(*int32)(unsafe.Pointer(bp + 4 /* count */)) = -1
		if objc >= 3 {
			if XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+4) != TCL_OK {
				return TCL_ERROR
			}
		}
		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				obj = XTclThreadAllocObj(tls)
			} else {
				obj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(obj + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr = uintptr(0)
		{
		}

		code = XTcl_ZlibStreamGet(tls, zstream, obj, *(*int32)(unsafe.Pointer(bp + 4 /* count */)))
		if code == TCL_OK {
			XTcl_SetObjResult(tls, interp, obj)
		} else {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = -1
					for ok1 := true; ok1; ok1 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, obj)
						} else {
							*(*uintptr)(unsafe.Pointer(obj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = obj
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, obj)
				}
			}

		}
		return code
	case uint32(5) /* zs_flush */ : // $strm flush
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}
		for ok2 := true; ok2; ok2 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				obj = XTclThreadAllocObj(tls)
			} else {
				obj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(obj + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr = uintptr(0)
		{
		}

		(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount++
		code = XTcl_ZlibStreamPut(tls, zstream, obj, Z_SYNC_FLUSH)
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = -1
				for ok3 := true; ok3; ok3 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, obj)
					} else {
						*(*uintptr)(unsafe.Pointer(obj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = obj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, obj)
			}
		}

		return code
	case uint32(6) /* zs_fullflush */ : // $strm fullflush
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}
		for ok4 := true; ok4; ok4 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				obj = XTclThreadAllocObj(tls)
			} else {
				obj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(obj + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr = uintptr(0)
		{
		}

		(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount++
		code = XTcl_ZlibStreamPut(tls, zstream, obj, Z_FULL_FLUSH)
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = -1
				for ok5 := true; ok5; ok5 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, obj)
					} else {
						*(*uintptr)(unsafe.Pointer(obj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = obj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, obj)
			}
		}

		return code
	case uint32(4) /* zs_finalize */ : // $strm finalize
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}

		// The flush commands slightly abuse the empty result obj as input
		// data.

		for ok6 := true; ok6; ok6 = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				obj = XTclThreadAllocObj(tls)
			} else {
				obj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(obj + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr = uintptr(0)
		{
		}

		(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount++
		code = XTcl_ZlibStreamPut(tls, zstream, obj, Z_FINISH)
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = -1
				for ok7 := true; ok7; ok7 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, obj)
					} else {
						*(*uintptr)(unsafe.Pointer(obj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = obj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, obj)
			}
		}

		return code
	case uint32(2) /* zs_close */ : // $strm close
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}
		return XTcl_ZlibStreamClose(tls, zstream)
	case uint32(3) /* zs_eof */ : // $strm eof
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}
		XTcl_SetObjResult(tls, interp, XTcl_NewIntObj(tls, XTcl_ZlibStreamEof(tls, zstream)))
		return TCL_OK
	case uint32(1) /* zs_checksum */ : // $strm checksum
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}
		XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, Tcl_WideInt(ULong(XTcl_ZlibStreamChecksum(tls, zstream)))))
		return TCL_OK
	case uint32(10) /* zs_reset */ : // $strm reset
		if objc != 2 {
			XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
			return TCL_ERROR
		}
		return XTcl_ZlibStreamReset(tls, zstream)
	}

	return TCL_OK
}

var cmds = [12]uintptr{
	ts + 2077, ts + 74752, ts + 5382, ts + 5388, ts + 35880, ts + 5438,
	ts + 74761, ts + 22076, ts + 74771, ts + 74778, ts + 74782,
	uintptr(0),
} /* tclZlib.c:2526:23 */

func sZlibStreamAddCmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclZlib.c:2643:1: */
	bp := tls.Alloc(148)
	defer tls.Free(148)

	var zstream Tcl_ZlibStream = cd
	// var index int32 at bp+136, 4

	var code int32
	*(*int32)(unsafe.Pointer(bp + 140 /* buffersize */)) = -1
	var flush int32 = -1
	var i int32
	var obj uintptr
	var compDictObj uintptr = uintptr(0)

	for i = 2; i < objc-1; i++ {
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&add_options)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+136) != TCL_OK {
			return TCL_ERROR
		}

		switch uint32(*(*int32)(unsafe.Pointer(bp + 136 /* index */))) {
		case uint32(3) /* ao_flush */ : // -flush
			if flush >= 0 {
				flush = -2
			} else {
				flush = Z_SYNC_FLUSH
			}
			break
		case uint32(4) /* ao_fullflush */ : // -fullflush
			if flush >= 0 {
				flush = -2
			} else {
				flush = Z_FULL_FLUSH
			}
			break
		case uint32(2) /* ao_finalize */ : // -finalize
			if flush >= 0 {
				flush = -2
			} else {
				flush = Z_FINISH
			}
			break
		case uint32(0) /* ao_buffer */ : // -buffer
			if i == objc-2 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+74788, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+73759, ts+74595, uintptr(0)))
				return TCL_ERROR
			}
			if XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PreIncInt32(&i, 1))*8)), bp+140) != TCL_OK {
				return TCL_ERROR
			}
			if *(*int32)(unsafe.Pointer(bp + 140)) < 1 || *(*int32)(unsafe.Pointer(bp + 140)) > MAX_BUFFER_SIZE {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+74858,
					libc.VaList(bp+32, MAX_BUFFER_SIZE)))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+6915, ts+74266, uintptr(0)))
				return TCL_ERROR
			}
			break
		case uint32(1) /* ao_dictionary */ :
			if i == objc-2 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+74886, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, ts+3593, ts+73759, ts+74595, uintptr(0)))
				return TCL_ERROR
			}
			compDictObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PreIncInt32(&i, 1))*8))
			break
		}

		if flush == -2 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

				ts+74956, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+104, ts+3593, ts+73759, ts+75026, uintptr(0)))
			return TCL_ERROR
		}
	}
	if flush == -1 {
		flush = 0
	}

	// Set the compression dictionary if requested.

	if compDictObj != uintptr(0) {
		// var len int32 at bp+144, 4

		XTcl_GetByteArrayFromObj(tls, compDictObj, bp+144)
		if *(*int32)(unsafe.Pointer(bp + 144)) == 0 {
			compDictObj = uintptr(0)
		}
		XTcl_ZlibStreamSetCompressionDictionary(tls, zstream, compDictObj)
	}

	// Send the data to the stream core, along with any flushing directive.

	if XTcl_ZlibStreamPut(tls, zstream, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), flush) != TCL_OK {
		return TCL_ERROR
	}

	// Get such data out as we can (up to the requested length).

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			obj = XTclThreadAllocObj(tls)
		} else {
			obj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(obj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr = uintptr(0)
	{
	}

	code = XTcl_ZlibStreamGet(tls, zstream, obj, *(*int32)(unsafe.Pointer(bp + 140 /* buffersize */)))
	if code == TCL_OK {
		XTcl_SetObjResult(tls, interp, obj)
	} else {
		if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(obj)).FrefCount, 1) > 1 {
		} else {
			if !(int32((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(obj)).FtypePtr)).FfreeIntRepProc) != 0) {
				{
				}
				if (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes != XtclEmptyStringRep {
					XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer(obj)).Fbytes)
				}
				(*Tcl_Obj)(unsafe.Pointer(obj)).Flength = -1
				for ok1 := true; ok1; ok1 = 0 != 0 {
					var cachePtr uintptr
					if uintptr(0) == uintptr(0) || func() bool {
						cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
						return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
					}() {
						XTclThreadFreeObj(tls, obj)
					} else {
						*(*uintptr)(unsafe.Pointer(obj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
						(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = obj
						(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
					}
				}
			} else {
				XTclFreeObj(tls, obj)
			}
		}

	}
	return code
}

var add_options = [6]uintptr{
	ts + 75036, ts + 14894, ts + 75044, ts + 75054, ts + 75061, uintptr(0),
} /* tclZlib.c:2652:23 */

func sZlibStreamPutCmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclZlib.c:2767:1: */
	bp := tls.Alloc(72)
	defer tls.Free(72)

	var zstream Tcl_ZlibStream = cd
	// var index int32 at bp+64, 4

	var flush int32 = -1
	var i int32
	var compDictObj uintptr = uintptr(0)

	for i = 2; i < objc-1; i++ {
		if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&put_options)), int32(unsafe.Sizeof(uintptr(0))), ts+9944, 0, bp+64) != TCL_OK {
			return TCL_ERROR
		}

		switch uint32(*(*int32)(unsafe.Pointer(bp + 64 /* index */))) {
		case uint32(2) /* po_flush */ : // -flush
			if flush >= 0 {
				flush = -2
			} else {
				flush = Z_SYNC_FLUSH
			}
			break
		case uint32(3) /* po_fullflush */ : // -fullflush
			if flush >= 0 {
				flush = -2
			} else {
				flush = Z_FULL_FLUSH
			}
			break
		case uint32(1) /* po_finalize */ : // -finalize
			if flush >= 0 {
				flush = -2
			} else {
				flush = Z_FINISH
			}
			break
		case uint32(0) /* po_dictionary */ :
			if i == objc-2 {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

					ts+74886, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+73759, ts+74595, uintptr(0)))
				return TCL_ERROR
			}
			compDictObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PreIncInt32(&i, 1))*8))
			break
		}
		if flush == -2 {
			XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,

				ts+74956, -1))
			XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, ts+3593, ts+73759, ts+75026, uintptr(0)))
			return TCL_ERROR
		}
	}
	if flush == -1 {
		flush = 0
	}

	// Set the compression dictionary if requested.

	if compDictObj != uintptr(0) {
		// var len int32 at bp+68, 4

		XTcl_GetByteArrayFromObj(tls, compDictObj, bp+68)
		if *(*int32)(unsafe.Pointer(bp + 68)) == 0 {
			compDictObj = uintptr(0)
		}
		XTcl_ZlibStreamSetCompressionDictionary(tls, zstream, compDictObj)
	}

	// Send the data to the stream core, along with any flushing directive.

	return XTcl_ZlibStreamPut(tls, zstream, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-1)*8)), flush)
}

var put_options = [5]uintptr{
	ts + 14894, ts + 75044, ts + 75054, ts + 75061, uintptr(0),
} /* tclZlib.c:2776:23 */

func sZlibStreamHeaderCmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* tclZlib.c:2856:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	var zshPtr uintptr = cd
	var resultObj uintptr

	if objc != 2 {
		XTcl_WrongNumArgs(tls, interp, 2, objv, uintptr(0))
		return TCL_ERROR
	} else if (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fmode != TCL_ZLIB_STREAM_INFLATE ||
		(*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).Fformat != TCL_ZLIB_FORMAT_GZIP {
		XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
			ts+75072, -1))
		XTcl_SetErrorCode(tls, interp, libc.VaList(bp, ts+3593, ts+73759, ts+75123, uintptr(0)))
		return TCL_ERROR
	}

	for ok := true; ok; ok = 0 != 0 {
		var cachePtr uintptr
		if uintptr(0) == uintptr(0) || func() bool {
			cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
			return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
		}() {
			resultObj = XTclThreadAllocObj(tls)
		} else {
			resultObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
			(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(resultObj + 32))
			(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
		}
	}
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = XtclEmptyStringRep
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0
	(*Tcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = uintptr(0)
	{
	}

	sExtractHeader(tls, (*ZlibStreamHandle)(unsafe.Pointer(zshPtr)).FgzHeaderPtr, resultObj)
	XTcl_SetObjResult(tls, interp, resultObj)
	return TCL_OK
}

//----------------------------------------------------------------------
//	Set of functions to support channel stacking.
//----------------------------------------------------------------------
//
// ZlibTransformClose --
//
//	How to shut down a stacked compressing/decompressing transform.
//
//----------------------------------------------------------------------

func sZlibTransformClose(tls *libc.TLS, instanceData ClientData, interp uintptr) int32 { /* tclZlib.c:2895:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var cd uintptr = instanceData
	var e int32
	// var written int32 at bp+8, 4

	var result int32 = TCL_OK

	// Delete the support timer.

	sZlibTransformEventTimerKill(tls, cd)

	// Flush any data waiting to be compressed.

	if (*ZlibChannelData)(unsafe.Pointer(cd)).Fmode == TCL_ZLIB_STREAM_DEFLATE {
		(*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Favail_in = UInt(0)
		for ok := true; ok; ok = e != Z_STREAM_END {
			e = sDeflate(tls, cd+144, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutAllocated,
				Z_FINISH, bp+8)

			// Can't be sure that deflate() won't declare the buffer to be
			// full (with Z_BUF_ERROR) so handle that case.

			if e == -5 {
				e = Z_OK
				*(*int32)(unsafe.Pointer(bp + 8 /* written */)) = (*ZlibChannelData)(unsafe.Pointer(cd)).FoutAllocated
			}
			if e != Z_OK && e != Z_STREAM_END {
				// TODO: is this the right way to do errors on close?
				if !(XTclInThreadExit(tls) != 0) {
					sConvertError(tls, interp, e, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Fadler)
				}
				result = TCL_ERROR
				break
			}
			if *(*int32)(unsafe.Pointer(bp + 8)) != 0 && XTcl_WriteRaw(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer, *(*int32)(unsafe.Pointer(bp + 8))) < 0 {
				// TODO: is this the right way to do errors on close?
				// Note: when close is called from FinalizeIOSubsystem then
				// interp may be NULL
				if !(XTclInThreadExit(tls) != 0) && interp != 0 {
					XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
						ts+75129,
						libc.VaList(bp, XTcl_PosixError(tls, interp))))
				}
				result = TCL_ERROR
				break
			}
		}
		z.XdeflateEnd(tls, cd+144)
	} else {
		// If we have unused bytes from the read input (overshot by
		// Z_STREAM_END or on possible error), unget them back to the parent
		// channel, so that they appear as not being read yet.
		if (*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Favail_in != 0 {
			XTcl_Ungets(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent, (*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Fnext_in, int32((*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Favail_in), 0)
		}

		z.XinflateEnd(tls, cd+32)
	}

	// Release all memory.

	if (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj != 0 {
		for ok1 := true; ok1; ok1 = 0 != 0 {
			var _objPtr uintptr = (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
				XTclFreeObj(tls, _objPtr)
			}
		}
		(*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj = uintptr(0)
	}

	if (*ZlibChannelData)(unsafe.Pointer(cd)).FinBuffer != 0 {
		XTclpFree(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).FinBuffer)
		(*ZlibChannelData)(unsafe.Pointer(cd)).FinBuffer = uintptr(0)
	}
	if (*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer != 0 {
		XTclpFree(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer)
		(*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer = uintptr(0)
	}
	XTclpFree(tls, cd)
	return result
}

//----------------------------------------------------------------------
//
// ZlibTransformInput --
//
//	Reader filter that does decompression.
//
//----------------------------------------------------------------------

func sZlibTransformInput(tls *libc.TLS, instanceData ClientData, buf uintptr, toRead int32, errorCodePtr uintptr) int32 { /* tclZlib.c:2994:1: */
	var cd uintptr
	var inProc uintptr
	var readBytes int32
	var gotBytes int32
	var n int32
	var decBytes int32
	cd = instanceData
	inProc =
		XTcl_ChannelInputProc(tls, XTcl_GetChannelType(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent))

	if !((*ZlibChannelData)(unsafe.Pointer(cd)).Fmode == TCL_ZLIB_STREAM_DEFLATE) {
		goto __1
	}
	return (*struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{inProc})).f(tls, XTcl_GetChannelInstanceData(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent), buf, toRead,
		errorCodePtr)
__1:
	;

	gotBytes = 0
	readBytes = int32((*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Favail_in) // how many bytes in buffer now
__2:
	if !(!((*ZlibChannelData)(unsafe.Pointer(cd)).Fflags&STREAM_DONE != 0) && toRead > 0) {
		goto __3
	}

	// if starting from scratch or continuation after full decompression
	if !!(int32((*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Favail_in) != 0) {
		goto __4
	}
	// buffer to start, we can read to whole available buffer
	(*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Fnext_in = (*ZlibChannelData)(unsafe.Pointer(cd)).FinBuffer
__4:
	;
	// If done - no read needed anymore, check we have to copy rest of
	// decompressed data, otherwise return with size (or 0 for Eof)
	if !((*ZlibChannelData)(unsafe.Pointer(cd)).Fflags&STREAM_DECOMPRESS != 0) {
		goto __5
	}
	goto copyDecompressed
__5:
	;
	// The buffer is exhausted, but the caller wants even more. We now
	// have to go to the underlying channel, get more bytes and then
	// transform them for delivery. We may not get what we want (full EOF
	// or temporarily out of data).

	// Check free buffer size and adjust size of next chunk to read.
	n = int32(int64((*ZlibChannelData)(unsafe.Pointer(cd)).FinAllocated) - (int64((*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Fnext_in)-int64((*ZlibChannelData)(unsafe.Pointer(cd)).FinBuffer))/1)
	if !(n <= 0) {
		goto __6
	}
	// Normally unreachable: not enough input buffer to uncompress.
	// Todo: firstly try to realloc inBuffer upto MAX_BUFFER_SIZE.
	*(*int32)(unsafe.Pointer(errorCodePtr)) = ENOBUFS
	return -1
__6:
	;
	if !(n > (*ZlibChannelData)(unsafe.Pointer(cd)).FreadAheadLimit) {
		goto __7
	}
	n = (*ZlibChannelData)(unsafe.Pointer(cd)).FreadAheadLimit
__7:
	;
	readBytes = XTcl_ReadRaw(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent, (*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Fnext_in, n)

	// Three cases here:
	//  1.	Got some data from the underlying channel (readBytes > 0) so
	//	it should be fed through the decompression engine.
	//  2.	Got an error (readBytes < 0) which we should report up except
	//	for the case where we can convert it to a short read.
	//  3.	Got an end-of-data from EOF or blocking (readBytes == 0). If
	//	it is EOF, try flushing the data out of the decompressor.

	if !(readBytes < 0) {
		goto __8
	}

	// See ReflectInput() in tclIORTrans.c
	if !(XTcl_InputBlocked(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent) != 0 && gotBytes > 0) {
		goto __9
	}
	goto __3
__9:
	;

	*(*int32)(unsafe.Pointer(errorCodePtr)) = XTcl_GetErrno(tls)
	return -1
__8:
	;

	// more bytes (or Eof if readBytes == 0)
	*(*UInt)(unsafe.Pointer(cd + 32 + 8)) += UInt(readBytes)

copyDecompressed:

	// Transform the read chunk, if not empty. Anything we get
	// back is a transformation result to be put into our buffers, and
	// the next iteration will put it into the result.
	// For the case readBytes is 0 which signaling Eof in parent, the
	// partial data waiting is converted and returned.

	decBytes = sResultDecompress(tls, cd, buf, toRead,
		func() int32 {
			if readBytes != 0 {
				return Z_NO_FLUSH
			}
			return Z_SYNC_FLUSH
		}(),
		errorCodePtr)
	if !(decBytes == -1) {
		goto __10
	}
	return -1
__10:
	;
	gotBytes = gotBytes + decBytes
	buf += uintptr(decBytes)
	toRead = toRead - decBytes

	if !(decBytes == 0 || (*ZlibChannelData)(unsafe.Pointer(cd)).Fflags&STREAM_DECOMPRESS != 0) {
		goto __11
	}
	// The drain delivered nothing (or buffer too small to decompress).
	// Time to deliver what we've got.
	if !(!(gotBytes != 0) && !((*ZlibChannelData)(unsafe.Pointer(cd)).Fflags&STREAM_DONE != 0)) {
		goto __12
	}
	// if no-data, but not ready - avoid signaling Eof,
	// continue in blocking mode, otherwise EAGAIN
	if !(XTcl_InputBlocked(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent) != 0) {
		goto __13
	}
	goto __2
__13:
	;
	*(*int32)(unsafe.Pointer(errorCodePtr)) = EAGAIN
	return -1
__12:
	;
	goto __3
__11:
	;

	// Loop until the request is satisfied (or no data available from
	// above, possibly EOF).
	goto __2
__3:
	;

	return gotBytes
}

//----------------------------------------------------------------------
//
// ZlibTransformOutput --
//
//	Writer filter that does compression.
//
//----------------------------------------------------------------------

func sZlibTransformOutput(tls *libc.TLS, instanceData ClientData, buf uintptr, toWrite int32, errorCodePtr uintptr) int32 { /* tclZlib.c:3129:1: */
	bp := tls.Alloc(4)
	defer tls.Free(4)

	var cd uintptr = instanceData
	var outProc uintptr = XTcl_ChannelOutputProc(tls, XTcl_GetChannelType(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent))
	var e int32
	// var produced int32 at bp, 4

	var errObj uintptr

	if (*ZlibChannelData)(unsafe.Pointer(cd)).Fmode == TCL_ZLIB_STREAM_INFLATE {
		return (*struct {
			f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{outProc})).f(tls, XTcl_GetChannelInstanceData(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent), buf, toWrite,
			errorCodePtr)
	}

	// No zero-length writes. Flushes must be explicit.

	if toWrite == 0 {
		return 0
	}

	(*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Fnext_in = buf
	(*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Favail_in = UInt(toWrite)
	for (*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Favail_in > UInt(0) {
		e = sDeflate(tls, cd+144, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutAllocated,
			Z_NO_FLUSH, bp)
		if e != Z_OK || *(*int32)(unsafe.Pointer(bp)) == 0 {
			break
		}

		if XTcl_WriteRaw(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer, *(*int32)(unsafe.Pointer(bp))) < 0 {
			*(*int32)(unsafe.Pointer(errorCodePtr)) = XTcl_GetErrno(tls)
			return -1
		}
	}

	if e == Z_OK {
		return int32(UInt(toWrite) - (*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Favail_in)
	}

	errObj = XTcl_NewListObj(tls, 0, uintptr(0))
	XTcl_ListObjAppendElement(tls, uintptr(0), errObj, XTcl_NewStringObj(tls, ts+12045, -1))
	XTcl_ListObjAppendElement(tls, uintptr(0), errObj,
		sConvertErrorToList(tls, e, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Fadler))
	XTcl_ListObjAppendElement(tls, uintptr(0), errObj,
		XTcl_NewStringObj(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Fmsg, -1))
	XTcl_SetChannelError(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent, errObj)
	*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
	return -1
}

//----------------------------------------------------------------------
//
// ZlibTransformFlush --
//
//	How to perform a flush of a compressing transform.
//
//----------------------------------------------------------------------

func sZlibTransformFlush(tls *libc.TLS, interp uintptr, cd uintptr, flushType int32) int32 { /* tclZlib.c:3195:1: */
	bp := tls.Alloc(12)
	defer tls.Free(12)

	var e int32
	// var len int32 at bp+8, 4

	(*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Favail_in = UInt(0)
	for ok := true; ok; ok = *(*int32)(unsafe.Pointer(bp + 8)) > 0 && e == -5 {
		// Get the bytes to go out of the compression engine.

		e = sDeflate(tls, cd+144, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutAllocated,
			flushType, bp+8)
		if e != Z_OK && e != -5 {
			sConvertError(tls, interp, e, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Fadler)
			return TCL_ERROR
		}

		// Write the bytes we've received to the next layer.

		if *(*int32)(unsafe.Pointer(bp + 8)) > 0 && XTcl_WriteRaw(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer, *(*int32)(unsafe.Pointer(bp + 8))) < 0 {
			XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
				ts+75161,
				libc.VaList(bp, XTcl_PosixError(tls, interp))))
			return TCL_ERROR
		}

		// If we get to this point, either we're in the Z_OK or the
		// Z_BUF_ERROR state. In the former case, we're done. In the latter
		// case, it's because there's more bytes to go than would fit in the
		// buffer we provided, and we need to go round again to get some more.
		//
		// We also stop the loop if we would have done a zero-length write.
		// Those can cause problems at the OS level.
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ZlibTransformSetOption --
//
//	Writing side of [fconfigure] on our channel.
//
//----------------------------------------------------------------------

func sZlibTransformSetOption(tls *libc.TLS, instanceData ClientData, interp uintptr, optionName uintptr, value uintptr) int32 { /* tclZlib.c:3250:1: */
	bp := tls.Alloc(76)
	defer tls.Free(76)

	var cd uintptr = instanceData
	var setOptionProc uintptr = XTcl_ChannelSetOptionProc(tls, XTcl_GetChannelType(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent))
	var haveFlushOpt int32 = libc.Bool32((*ZlibChannelData)(unsafe.Pointer(cd)).Fmode == TCL_ZLIB_STREAM_DEFLATE)

	if optionName != 0 && libc.Xstrcmp(tls, optionName, ts+14894) == 0 &&
		(*ZlibChannelData)(unsafe.Pointer(cd)).Fformat != TCL_ZLIB_FORMAT_GZIP {
		var compDictObj uintptr
		var code int32

		for ok := true; ok; ok = 0 != 0 {
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var cachePtr uintptr
				if uintptr(0) == uintptr(0) || func() bool {
					cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
					return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
				}() {
					compDictObj = XTclThreadAllocObj(tls)
				} else {
					compDictObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
					(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(compDictObj + 32))
					(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
				}
			}
			(*Tcl_Obj)(unsafe.Pointer(compDictObj)).FrefCount = 0
			if libc.Xstrlen(tls, value) == uint64(0) {
				(*Tcl_Obj)(unsafe.Pointer(compDictObj)).Fbytes = XtclEmptyStringRep
				(*Tcl_Obj)(unsafe.Pointer(compDictObj)).Flength = 0
			} else {
				(*Tcl_Obj)(unsafe.Pointer(compDictObj)).Fbytes = XTcl_Alloc(tls, uint32(libc.Xstrlen(tls, value)+uint64(1)))
				libc.Xmemcpy(tls, (*Tcl_Obj)(unsafe.Pointer(compDictObj)).Fbytes, value, libc.Xstrlen(tls, value))
				*(*int8)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(compDictObj)).Fbytes + uintptr(libc.Xstrlen(tls, value)))) = int8(0)
				(*Tcl_Obj)(unsafe.Pointer(compDictObj)).Flength = int32(libc.Xstrlen(tls, value))
			}
			(*Tcl_Obj)(unsafe.Pointer(compDictObj)).FtypePtr = uintptr(0)
			{
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(compDictObj)).FrefCount++
		XTcl_GetByteArrayFromObj(tls, compDictObj, uintptr(0))
		if (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj != 0 {
			if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj)).FrefCount, 1) > 1 {
			} else {
				if !(int32((*Tcl_Obj)(unsafe.Pointer((*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj)).FtypePtr) != 0) || !(int32((*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer((*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj)).FtypePtr)).FfreeIntRepProc) != 0) {
					{
					}
					if (*Tcl_Obj)(unsafe.Pointer((*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj)).Fbytes != 0 && (*Tcl_Obj)(unsafe.Pointer((*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj)).Fbytes != XtclEmptyStringRep {
						XTclpFree(tls, (*Tcl_Obj)(unsafe.Pointer((*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj)).Fbytes)
					}
					(*Tcl_Obj)(unsafe.Pointer((*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj)).Flength = -1
					for ok2 := true; ok2; ok2 = 0 != 0 {
						var cachePtr uintptr
						if uintptr(0) == uintptr(0) || func() bool {
							cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
							return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0 || (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= ALLOC_NOBJHIGH
						}() {
							XTclThreadFreeObj(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj)
						} else {
							*(*uintptr)(unsafe.Pointer((*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj + 32)) = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
							(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj
							(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++
						}
					}
				} else {
					XTclFreeObj(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj)
				}
			}

		}
		(*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj = compDictObj
		code = Z_OK
		if (*ZlibChannelData)(unsafe.Pointer(cd)).Fmode == TCL_ZLIB_STREAM_DEFLATE {
			code = sSetDeflateDictionary(tls, cd+144, compDictObj)
			if code != Z_OK {
				sConvertError(tls, interp, code, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Fadler)
				return TCL_ERROR
			}
		} else if (*ZlibChannelData)(unsafe.Pointer(cd)).Fformat == TCL_ZLIB_FORMAT_RAW {
			code = sSetInflateDictionary(tls, cd+32, compDictObj)
			if code != Z_OK {
				sConvertError(tls, interp, code, (*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Fadler)
				return TCL_ERROR
			}
		}
		return TCL_OK
	}

	if haveFlushOpt != 0 {
		if optionName != 0 && libc.Xstrcmp(tls, optionName, ts+75054) == 0 {
			var flushType int32

			if int32(*(*int8)(unsafe.Pointer(value))) == 'f' && libc.Xstrcmp(tls, value, ts+33580) == 0 {
				flushType = Z_FULL_FLUSH
			} else if int32(*(*int8)(unsafe.Pointer(value))) == 's' && libc.Xstrcmp(tls, value, ts+75190) == 0 {
				flushType = Z_SYNC_FLUSH
			} else {
				XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls,
					ts+75195,
					libc.VaList(bp, value)))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, ts+3593, ts+6915, ts+75242, uintptr(0)))
				return TCL_ERROR
			}

			// Try to actually do the flush now.

			return sZlibTransformFlush(tls, interp, cd, flushType)
		}
	} else {
		if optionName != 0 && libc.Xstrcmp(tls, optionName, ts+74719) == 0 {
			// var newLimit int32 at bp+72, 4

			if XTcl_GetInt(tls, interp, value, bp+72) != TCL_OK {
				return TCL_ERROR
			} else if *(*int32)(unsafe.Pointer(bp + 72)) < 1 || *(*int32)(unsafe.Pointer(bp + 72)) > MAX_BUFFER_SIZE {
				XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls,
					ts+75248, -1))
				XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, ts+3593, ts+6915, ts+75283, uintptr(0)))
				return TCL_ERROR
			}
		}
	}

	if setOptionProc == uintptr(0) {
		if (*ZlibChannelData)(unsafe.Pointer(cd)).Fformat == TCL_ZLIB_FORMAT_GZIP {
			return XTcl_BadChannelOption(tls, interp, optionName,
				func() uintptr {
					if (*ZlibChannelData)(unsafe.Pointer(cd)).Fmode == TCL_ZLIB_STREAM_DEFLATE {
						return gzipChanOptions
					}
					return gunzipChanOptions
				}())
		} else {
			return XTcl_BadChannelOption(tls, interp, optionName,
				func() uintptr {
					if (*ZlibChannelData)(unsafe.Pointer(cd)).Fmode == TCL_ZLIB_STREAM_DEFLATE {
						return compressChanOptions
					}
					return decompressChanOptions
				}())
		}
	}

	// Pass all unknown options down, to deeper transforms and/or the base
	// channel.

	return (*struct {
		f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32
	})(unsafe.Pointer(&struct{ uintptr }{setOptionProc})).f(tls, XTcl_GetChannelInstanceData(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent), interp,
		optionName, value)
}

var compressChanOptions uintptr = ts + 75293   /* "dictionary flush" */ /* tclZlib.c:3259:23 */
var gzipChanOptions uintptr = ts + 5438        /* "flush" */            /* tclZlib.c:3260:23 */
var decompressChanOptions uintptr = ts + 75310 /* "dictionary limit" */ /* tclZlib.c:3261:23 */
var gunzipChanOptions uintptr = ts + 75327     /* "flush limit" */      /* tclZlib.c:3262:23 */

//----------------------------------------------------------------------
//
// ZlibTransformGetOption --
//
//	Reading side of [fconfigure] on our channel.
//
//----------------------------------------------------------------------

func sZlibTransformGetOption(tls *libc.TLS, instanceData ClientData, interp uintptr, optionName uintptr, dsPtr uintptr) int32 { /* tclZlib.c:3363:1: */
	bp := tls.Alloc(24)
	defer tls.Free(24)

	var cd uintptr = instanceData
	var getOptionProc uintptr = XTcl_ChannelGetOptionProc(tls, XTcl_GetChannelType(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent))

	// The "crc" option reports the current CRC (calculated with the Adler32
	// or CRC32 algorithm according to the format) given the data that has
	// been processed so far.

	if optionName == uintptr(0) || libc.Xstrcmp(tls, optionName, ts+75339) == 0 {
		var crc ULong
		// var buf [12]int8 at bp+8, 12

		if (*ZlibChannelData)(unsafe.Pointer(cd)).Fmode == TCL_ZLIB_STREAM_DEFLATE {
			crc = (*ZlibChannelData)(unsafe.Pointer(cd)).FoutStream.Fadler
		} else {
			crc = (*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Fadler
		}

		libc.Xsprintf(tls, bp+8, ts+55197, libc.VaList(bp, crc))
		if optionName == uintptr(0) {
			XTcl_DStringAppendElement(tls, dsPtr, ts+75339)
			XTcl_DStringAppendElement(tls, dsPtr, bp+8)
		} else {
			XTcl_DStringAppend(tls, dsPtr, bp+8, -1)
			return TCL_OK
		}
	}

	if (*ZlibChannelData)(unsafe.Pointer(cd)).Fformat != TCL_ZLIB_FORMAT_GZIP && (optionName == uintptr(0) || libc.Xstrcmp(tls, optionName, ts+14894) == 0) {
		// Embedded NUL bytes are ok; they'll be C080-encoded.

		if optionName == uintptr(0) {
			XTcl_DStringAppendElement(tls, dsPtr, ts+14894)
			if (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj != 0 {
				XTcl_DStringAppendElement(tls, dsPtr,
					XTcl_GetString(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj))
			} else {
				XTcl_DStringAppendElement(tls, dsPtr, ts+2046)
			}
		} else {
			if (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj != 0 {
				// var len int32 at bp+20, 4

				var str uintptr = XTcl_GetStringFromObj(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj, bp+20)

				XTcl_DStringAppend(tls, dsPtr, str, *(*int32)(unsafe.Pointer(bp + 20 /* len */)))
			}
			return TCL_OK
		}
	}

	// The "header" option, which is only valid on inflating gzip channels,
	// reports the header that has been read from the start of the stream.

	if (*ZlibChannelData)(unsafe.Pointer(cd)).Fflags&IN_HEADER != 0 && (optionName == uintptr(0) || libc.Xstrcmp(tls, optionName, ts+74346) == 0) {
		var tmpObj uintptr

		for ok := true; ok; ok = 0 != 0 {
			var cachePtr uintptr
			if uintptr(0) == uintptr(0) || func() bool {
				cachePtr = (*Interp)(unsafe.Pointer(uintptr(0))).FallocCache
				return (*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == 0
			}() {
				tmpObj = XTclThreadAllocObj(tls)
			} else {
				tmpObj = (*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr
				(*AllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(tmpObj + 32))
				(*AllocCache)(unsafe.Pointer(cachePtr)).FnumObjects--
			}
		}
		(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0
		(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XtclEmptyStringRep
		(*Tcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0
		(*Tcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = uintptr(0)
		{
		}

		sExtractHeader(tls, cd+280, tmpObj)
		if optionName == uintptr(0) {
			XTcl_DStringAppendElement(tls, dsPtr, ts+74346)
			XTcl_DStringAppendElement(tls, dsPtr, XTcl_GetString(tls, tmpObj))
			for ok1 := true; ok1; ok1 = 0 != 0 {
				var _objPtr uintptr = tmpObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
		} else {
			XTclDStringAppendObj(tls, dsPtr, tmpObj)
			for ok2 := true; ok2; ok2 = 0 != 0 {
				var _objPtr uintptr = tmpObj
				if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1 {
					XTclFreeObj(tls, _objPtr)
				}
			}
			return TCL_OK
		}
	}

	// Now we do the standard processing of the stream we wrapped.

	if getOptionProc != 0 {
		return (*struct {
			f func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32
		})(unsafe.Pointer(&struct{ uintptr }{getOptionProc})).f(tls, XTcl_GetChannelInstanceData(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent),
			interp, optionName, dsPtr)
	}
	if optionName == uintptr(0) {
		return TCL_OK
	}
	if (*ZlibChannelData)(unsafe.Pointer(cd)).Fformat == TCL_ZLIB_FORMAT_GZIP {
		return XTcl_BadChannelOption(tls, interp, optionName,
			func() uintptr {
				if (*ZlibChannelData)(unsafe.Pointer(cd)).Fmode == TCL_ZLIB_STREAM_DEFLATE {
					return gzipChanOptions1
				}
				return gunzipChanOptions1
			}())
	} else {
		return XTcl_BadChannelOption(tls, interp, optionName,
			func() uintptr {
				if (*ZlibChannelData)(unsafe.Pointer(cd)).Fmode == TCL_ZLIB_STREAM_DEFLATE {
					return compressChanOptions1
				}
				return decompressChanOptions1
			}())
	}
	return int32(0)
}

var compressChanOptions1 uintptr = ts + 75349   /* "checksum diction..." */ /* tclZlib.c:3372:23 */
var gzipChanOptions1 uintptr = ts + 74752       /* "checksum" */            /* tclZlib.c:3373:23 */
var decompressChanOptions1 uintptr = ts + 75369 /* "checksum diction..." */ /* tclZlib.c:3374:23 */
var gunzipChanOptions1 uintptr = ts + 75395     /* "checksum header ..." */ /* tclZlib.c:3375:23 */

//----------------------------------------------------------------------
//
// ZlibTransformWatch, ZlibTransformEventHandler --
//
//	If we have data pending, trigger a readable event after a short time
//	(in order to allow a real event to catch up).
//
//----------------------------------------------------------------------

func sZlibTransformWatch(tls *libc.TLS, instanceData ClientData, mask int32) { /* tclZlib.c:3484:1: */
	var cd uintptr = instanceData
	var watchProc uintptr

	// This code is based on the code in tclIORTrans.c

	watchProc = XTcl_ChannelWatchProc(tls, XTcl_GetChannelType(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent))
	(*struct {
		f func(*libc.TLS, ClientData, int32)
	})(unsafe.Pointer(&struct{ uintptr }{watchProc})).f(tls, XTcl_GetChannelInstanceData(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent), mask)

	if !(mask&(int32(1)<<1) != 0) || !((*ZlibChannelData)(unsafe.Pointer(cd)).Fflags&STREAM_DECOMPRESS != 0) {
		sZlibTransformEventTimerKill(tls, cd)
	} else if (*ZlibChannelData)(unsafe.Pointer(cd)).Ftimer == uintptr(0) {
		(*ZlibChannelData)(unsafe.Pointer(cd)).Ftimer = XTcl_CreateTimerHandler(tls, SYNTHETIC_EVENT_TIME,
			*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{sZlibTransformTimerRun})), cd)
	}
}

func sZlibTransformEventHandler(tls *libc.TLS, instanceData ClientData, interestMask int32) int32 { /* tclZlib.c:3507:1: */
	var cd uintptr = instanceData

	sZlibTransformEventTimerKill(tls, cd)
	return interestMask
}

func sZlibTransformEventTimerKill(tls *libc.TLS, cd uintptr) { /* tclZlib.c:3518:1: */
	if (*ZlibChannelData)(unsafe.Pointer(cd)).Ftimer != uintptr(0) {
		XTcl_DeleteTimerHandler(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Ftimer)
		(*ZlibChannelData)(unsafe.Pointer(cd)).Ftimer = uintptr(0)
	}
}

func sZlibTransformTimerRun(tls *libc.TLS, clientData ClientData) { /* tclZlib.c:3528:1: */
	var cd uintptr = clientData

	(*ZlibChannelData)(unsafe.Pointer(cd)).Ftimer = uintptr(0)
	XTcl_NotifyChannel(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fchan, int32(1)<<1)
}

//----------------------------------------------------------------------
//
// ZlibTransformGetHandle --
//
//	Anything that needs the OS handle is told to get it from what we are
//	stacked on top of.
//
//----------------------------------------------------------------------

func sZlibTransformGetHandle(tls *libc.TLS, instanceData ClientData, direction int32, handlePtr uintptr) int32 { /* tclZlib.c:3549:1: */
	var cd uintptr = instanceData

	return XTcl_GetChannelHandle(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent, direction, handlePtr)
}

//----------------------------------------------------------------------
//
// ZlibTransformBlockMode --
//
//	We need to keep track of the blocking mode; it changes our behavior.
//
//----------------------------------------------------------------------

func sZlibTransformBlockMode(tls *libc.TLS, instanceData ClientData, mode int32) int32 { /* tclZlib.c:3570:1: */
	var cd uintptr = instanceData

	if mode == TCL_MODE_NONBLOCKING {
		*(*int32)(unsafe.Pointer(cd + 16)) |= ASYNC
	} else {
		*(*int32)(unsafe.Pointer(cd + 16)) &= libc.CplInt32(ASYNC)
	}
	return TCL_OK
}

//----------------------------------------------------------------------
//
// ZlibStackChannelTransform --
//
//	Stacks either compression or decompression onto a channel.
//
// Results:
//	The stacked channel, or NULL if there was an error.
//
//----------------------------------------------------------------------

func sZlibStackChannelTransform(tls *libc.TLS, interp uintptr, mode int32, format int32, level int32, limit int32, channel Tcl_Channel, gzipHeaderDictPtr uintptr, compDictObj uintptr) Tcl_Channel { /* tclZlib.c:3598:1: */
	bp := tls.Alloc(16)
	defer tls.Free(16)

	var cd uintptr
	var chan1 Tcl_Channel
	var wbits int32
	var _objPtr uintptr
	cd = XTcl_Alloc(tls, uint32(unsafe.Sizeof(ZlibChannelData{})))
	wbits = 0

	if !(mode != TCL_ZLIB_STREAM_DEFLATE && mode != TCL_ZLIB_STREAM_INFLATE) {
		goto __1
	}
	XTcl_Panic(tls, ts+75417, libc.VaList(bp, mode))
__1:
	;

	libc.Xmemset(tls, cd, 0, uint64(unsafe.Sizeof(ZlibChannelData{})))
	(*ZlibChannelData)(unsafe.Pointer(cd)).Fmode = mode
	(*ZlibChannelData)(unsafe.Pointer(cd)).Fformat = format
	(*ZlibChannelData)(unsafe.Pointer(cd)).FreadAheadLimit = limit

	if !(format == TCL_ZLIB_FORMAT_GZIP || format == TCL_ZLIB_FORMAT_AUTO) {
		goto __2
	}
	if !(mode == TCL_ZLIB_STREAM_DEFLATE) {
		goto __3
	}
	if !(gzipHeaderDictPtr != 0) {
		goto __5
	}
	*(*int32)(unsafe.Pointer(cd + 16)) |= OUT_HEADER
	if !(sGenerateHeader(tls, interp, gzipHeaderDictPtr, cd+4712,
		uintptr(0)) != TCL_OK) {
		goto __6
	}
	goto error
__6:
	;
__5:
	;
	goto __4
__3:
	*(*int32)(unsafe.Pointer(cd + 16)) |= IN_HEADER
	(*ZlibChannelData)(unsafe.Pointer(cd)).FinHeader.Fheader.Fname = cd + 280 + 80
	(*ZlibChannelData)(unsafe.Pointer(cd)).FinHeader.Fheader.Fname_max = UInt(PATH_MAX - 1)
	(*ZlibChannelData)(unsafe.Pointer(cd)).FinHeader.Fheader.Fcomment = cd + 280 + 4176
	(*ZlibChannelData)(unsafe.Pointer(cd)).FinHeader.Fheader.Fcomm_max = UInt(MAX_COMMENT_LEN - 1)
__4:
	;
__2:
	;

	if !(compDictObj != uintptr(0)) {
		goto __7
	}
	(*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj = XTcl_DuplicateObj(tls, compDictObj)
	(*Tcl_Obj)(unsafe.Pointer((*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj)).FrefCount++
	XTcl_GetByteArrayFromObj(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj, uintptr(0))
__7:
	;

	if !(format == TCL_ZLIB_FORMAT_RAW) {
		goto __8
	}
	wbits = -MAX_WBITS
	goto __9
__8:
	if !(format == TCL_ZLIB_FORMAT_ZLIB) {
		goto __10
	}
	wbits = MAX_WBITS
	goto __11
__10:
	if !(format == TCL_ZLIB_FORMAT_GZIP) {
		goto __12
	}
	wbits = MAX_WBITS | 16
	goto __13
__12:
	if !(format == TCL_ZLIB_FORMAT_AUTO) {
		goto __14
	}
	wbits = MAX_WBITS | 32
	goto __15
__14:
	XTcl_Panic(tls, ts+75434, libc.VaList(bp+8, format))
__15:
	;
__13:
	;
__11:
	;
__9:
	;

	// Initialize input inflater or the output deflater.

	if !(mode == TCL_ZLIB_STREAM_INFLATE) {
		goto __16
	}
	if !(z.XinflateInit2_(tls, cd+32, wbits, ts+73609, int32(unsafe.Sizeof(Z_stream{}))) != Z_OK) {
		goto __18
	}
	goto error
__18:
	;
	(*ZlibChannelData)(unsafe.Pointer(cd)).FinAllocated = DEFAULT_BUFFER_SIZE
	if !((*ZlibChannelData)(unsafe.Pointer(cd)).FinAllocated < (*ZlibChannelData)(unsafe.Pointer(cd)).FreadAheadLimit) {
		goto __19
	}
	(*ZlibChannelData)(unsafe.Pointer(cd)).FinAllocated = (*ZlibChannelData)(unsafe.Pointer(cd)).FreadAheadLimit
__19:
	;
	(*ZlibChannelData)(unsafe.Pointer(cd)).FinBuffer = XTcl_Alloc(tls, uint32((*ZlibChannelData)(unsafe.Pointer(cd)).FinAllocated))
	if !((*ZlibChannelData)(unsafe.Pointer(cd)).Fflags&IN_HEADER != 0) {
		goto __20
	}
	if !(z.XinflateGetHeader(tls, cd+32, cd+280) != Z_OK) {
		goto __21
	}
	goto error
__21:
	;
__20:
	;
	if !((*ZlibChannelData)(unsafe.Pointer(cd)).Fformat == TCL_ZLIB_FORMAT_RAW && (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj != 0) {
		goto __22
	}
	if !(sSetInflateDictionary(tls, cd+32, (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj) != Z_OK) {
		goto __23
	}
	goto error
__23:
	;
__22:
	;
	goto __17
__16:
	if !(z.XdeflateInit2_(tls, cd+144, level, Z_DEFLATED, wbits, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY, ts+73609, int32(unsafe.Sizeof(Z_stream{}))) != Z_OK) {
		goto __24
	}
	goto error
__24:
	;
	(*ZlibChannelData)(unsafe.Pointer(cd)).FoutAllocated = DEFAULT_BUFFER_SIZE
	(*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer = XTcl_Alloc(tls, uint32((*ZlibChannelData)(unsafe.Pointer(cd)).FoutAllocated))
	if !((*ZlibChannelData)(unsafe.Pointer(cd)).Fflags&OUT_HEADER != 0) {
		goto __25
	}
	if !(z.XdeflateSetHeader(tls, cd+144, cd+4712) != Z_OK) {
		goto __26
	}
	goto error
__26:
	;
__25:
	;
	if !((*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj != 0) {
		goto __27
	}
	if !(sSetDeflateDictionary(tls, cd+144, (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj) != Z_OK) {
		goto __28
	}
	goto error
__28:
	;
__27:
	;
__17:
	;

	chan1 = XTcl_StackChannel(tls, interp, uintptr(unsafe.Pointer(&zlibChannelType)), cd,
		XTcl_GetChannelMode(tls, channel), channel)
	if !(chan1 == uintptr(0)) {
		goto __29
	}
	goto error
__29:
	;
	(*ZlibChannelData)(unsafe.Pointer(cd)).Fchan = chan1
	(*ZlibChannelData)(unsafe.Pointer(cd)).Fparent = XTcl_GetStackedChannel(tls, chan1)
	XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, XTcl_GetChannelName(tls, chan1), -1))
	return chan1

error:
	if !((*ZlibChannelData)(unsafe.Pointer(cd)).FinBuffer != 0) {
		goto __30
	}
	XTclpFree(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).FinBuffer)
	z.XinflateEnd(tls, cd+32)
__30:
	;
	if !((*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer != 0) {
		goto __31
	}
	XTclpFree(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).FoutBuffer)
	z.XdeflateEnd(tls, cd+144)
__31:
	;
	if !((*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj != 0) {
		goto __32
	}
__33:
	_objPtr = (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj
	if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer(_objPtr)).FrefCount, 1) <= 1) {
		goto __36
	}
	XTclFreeObj(tls, _objPtr)
__36:
	;
	goto __34
__34:
	if 0 != 0 {
		goto __33
	}
	goto __35
__35:
	;
__32:
	;
	XTclpFree(tls, cd)
	return uintptr(0)
}

//----------------------------------------------------------------------
//
// ResultDecompress --
//
//	Extract uncompressed bytes from the compression engine and store them
//	in our buffer (buf) up to toRead bytes.
//
// Result:
//	Number of bytes decompressed or -1 if error (with *errorCodePtr updated with reason).
//
// Side effects:
//	After execution it updates cd->inStream (next_in, avail_in) to reflect
//	the data that has been decompressed.
//
//----------------------------------------------------------------------

func sResultDecompress(tls *libc.TLS, cd uintptr, buf uintptr, toRead int32, flush int32, errorCodePtr uintptr) int32 { /* tclZlib.c:3762:1: */
	var e int32
	var written int32
	var resBytes int32
	var errObj uintptr
	resBytes = 0

	*(*int32)(unsafe.Pointer(cd + 16)) &= libc.CplInt32(STREAM_DECOMPRESS)
	(*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Fnext_out = buf
	(*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Favail_out = UInt(toRead)
__1:
	if !((*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Favail_out > UInt(0)) {
		goto __2
	}

	e = z.Xinflate(tls, cd+32, flush)
	if !(e == Z_NEED_DICT && (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj != 0) {
		goto __3
	}
	e = sSetInflateDictionary(tls, cd+32, (*ZlibChannelData)(unsafe.Pointer(cd)).FcompDictObj)
	if !(e == Z_OK) {
		goto __4
	}
	// A repetition of Z_NEED_DICT is just an error.
	e = z.Xinflate(tls, cd+32, flush)
__4:
	;
__3:
	;

	// avail_out is now the left over space in the output.  Therefore
	// "toRead - avail_out" is the amount of bytes generated.

	written = int32(UInt(toRead) - (*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Favail_out)

	// The cases where we're definitely done.

	if !(e == Z_STREAM_END) {
		goto __5
	}
	*(*int32)(unsafe.Pointer(cd + 16)) |= STREAM_DONE
	resBytes = resBytes + written
	goto __2
__5:
	;
	if !(e == Z_OK) {
		goto __6
	}
	if !(written == 0) {
		goto __7
	}
	goto __2
__7:
	;
	resBytes = resBytes + written
__6:
	;

	if !(flush == Z_SYNC_FLUSH && e == -5) {
		goto __8
	}
	goto __2
__8:
	;

	// Z_BUF_ERROR can be ignored as per http://www.zlib.net/zlib_how.html
	//
	// Just indicates that the zlib couldn't consume input/produce output,
	// and is fixed by supplying more input.
	//
	// Otherwise, we've got errors and need to report to higher-up.

	if !(e != Z_OK && e != -5) {
		goto __9
	}
	goto handleError
__9:
	;

	// Check if the inflate stopped early.

	if !((*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Favail_in <= UInt(0) && flush != Z_SYNC_FLUSH) {
		goto __10
	}
	goto __2
__10:
	;
	goto __1
__2:
	;

	if !!((*ZlibChannelData)(unsafe.Pointer(cd)).Fflags&STREAM_DONE != 0) {
		goto __11
	}
	// if we have pending input data, but no available output buffer
	if !((*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Favail_in != 0 && !(int32((*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Favail_out) != 0)) {
		goto __12
	}
	// next time try to decompress it got readable (new output buffer)
	*(*int32)(unsafe.Pointer(cd + 16)) |= STREAM_DECOMPRESS
__12:
	;
__11:
	;

	return resBytes

handleError:
	errObj = XTcl_NewListObj(tls, 0, uintptr(0))
	XTcl_ListObjAppendElement(tls, uintptr(0), errObj, XTcl_NewStringObj(tls, ts+12045, -1))
	XTcl_ListObjAppendElement(tls, uintptr(0), errObj,
		sConvertErrorToList(tls, e, (*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Fadler))
	XTcl_ListObjAppendElement(tls, uintptr(0), errObj,
		XTcl_NewStringObj(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).FinStream.Fmsg, -1))
	XTcl_SetChannelError(tls, (*ZlibChannelData)(unsafe.Pointer(cd)).Fparent, errObj)
	*(*int32)(unsafe.Pointer(errorCodePtr)) = EINVAL
	return -1
}

//----------------------------------------------------------------------
//	Finally, the TclZlibInit function. Used to install the zlib API.
//----------------------------------------------------------------------

func XTclZlibInit(tls *libc.TLS, interp uintptr) int32 { /* tclZlib.c:3867:1: */
	bp := tls.Alloc(32)
	defer tls.Free(32)

	// var cfg [2]Tcl_Config at bp, 32

	// This does two things. It creates a counter used in the creation of
	// stream commands, and it creates the namespace that will contain those
	// commands.

	XTcl_EvalEx(tls, interp, ts+75449, -1, 0)

	// Create the public scripted interface to this file's functionality.

	XTcl_CreateObjCommand(tls, interp, ts+73012, *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
	}{sZlibCmd})), uintptr(0), uintptr(0))

	// Store the underlying configuration information.
	//
	// TODO: Describe whether we're using the system version of the library or
	// a compatibility version built into Tcl?

	(*Tcl_Config)(unsafe.Pointer(bp)).Fkey = ts + 75500 /* "zlibVersion" */
	(*Tcl_Config)(unsafe.Pointer(bp)).Fvalue = z.XzlibVersion(tls)
	(*Tcl_Config)(unsafe.Pointer(bp + 1*16)).Fkey = uintptr(0)
	XTcl_RegisterConfig(tls, interp, ts+73012, bp, ts+25963)

	// Formally provide the package as a Tcl built-in.

	return XTcl_PkgProvideEx(tls, interp, ts+73012, ts+75512, uintptr(0))
}

//----------------------------------------------------------------------
//	Stubs used when a suitable zlib installation was not found during
//	configure.
//----------------------------------------------------------------------

// Local Variables:
// mode: c
// c-basic-offset: 4
// fill-column: 78
// End:

func init() {
	*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclArrayHashKeyType)) + 8)) = sHashArrayKey                                     // tclHash.c:85:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclArrayHashKeyType)) + 16)) = sCompareArrayKeys                                 // tclHash.c:86:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclArrayHashKeyType)) + 24)) = sAllocArrayEntry                                // tclHash.c:87:5:
	*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclArrayHashKeyType)) + 8)) = sHashArrayKey                                     // tclHash.c:85:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclArrayHashKeyType)) + 16)) = sCompareArrayKeys                                 // tclHash.c:86:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclArrayHashKeyType)) + 24)) = sAllocArrayEntry                                // tclHash.c:87:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclArraySearchType)) + 32)) = sSetArraySearchObj                                 // tclVar.c:256:23:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclArraySearchType)) + 32)) = sSetArraySearchObj                                 // tclVar.c:256:23:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclBignumType)) + 8)) = sFreeBignum                                                             // tclObj.c:285:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclBignumType)) + 16)) = sDupBignum                                                    // tclObj.c:286:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclBignumType)) + 24)) = sUpdateStringOfBignum                                                  // tclObj.c:287:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclBignumType)) + 8)) = sFreeBignum                                                             // tclObj.c:285:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclBignumType)) + 16)) = sDupBignum                                                    // tclObj.c:286:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclBignumType)) + 24)) = sUpdateStringOfBignum                                                  // tclObj.c:287:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclBooleanType)) + 32)) = XTclSetBooleanFromAny                                  // tclObj.c:258:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclBooleanType)) + 32)) = XTclSetBooleanFromAny                                  // tclObj.c:258:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteArrayType)) + 8)) = sFreeByteArrayInternalRep                                            // tclBinary.c:184:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteArrayType)) + 16)) = sDupByteArrayInternalRep                                   // tclBinary.c:185:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteArrayType)) + 24)) = sUpdateStringOfByteArray                                            // tclBinary.c:186:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteArrayType)) + 32)) = sSetByteArrayFromAny                                 // tclBinary.c:187:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteArrayType)) + 8)) = sFreeByteArrayInternalRep                                            // tclBinary.c:184:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteArrayType)) + 16)) = sDupByteArrayInternalRep                                   // tclBinary.c:185:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteArrayType)) + 24)) = sUpdateStringOfByteArray                                            // tclBinary.c:186:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteArrayType)) + 32)) = sSetByteArrayFromAny                                 // tclBinary.c:187:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteCodeType)) + 8)) = sFreeByteCodeInternalRep                                              // tclCompile.c:708:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteCodeType)) + 16)) = sDupByteCodeInternalRep                                     // tclCompile.c:709:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteCodeType)) + 32)) = sSetByteCodeFromAny                                   // tclCompile.c:711:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteCodeType)) + 8)) = sFreeByteCodeInternalRep                                              // tclCompile.c:708:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteCodeType)) + 16)) = sDupByteCodeInternalRep                                     // tclCompile.c:709:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclByteCodeType)) + 32)) = sSetByteCodeFromAny                                   // tclCompile.c:711:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCmdNameType)) + 8)) = sFreeCmdNameInternalRep                                                // tclObj.c:329:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCmdNameType)) + 16)) = sDupCmdNameInternalRep                                       // tclObj.c:330:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCmdNameType)) + 32)) = sSetCmdNameFromAny                                     // tclObj.c:332:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCmdNameType)) + 8)) = sFreeCmdNameInternalRep                                                // tclObj.c:329:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCmdNameType)) + 16)) = sDupCmdNameInternalRep                                       // tclObj.c:330:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclCmdNameType)) + 32)) = sSetCmdNameFromAny                                     // tclObj.c:332:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDictType)) + 8)) = sFreeDictInternalRep                                                      // tclDictObj.c:165:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDictType)) + 16)) = sDupDictInternalRep                                             // tclDictObj.c:166:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDictType)) + 24)) = sUpdateStringOfDict                                                      // tclDictObj.c:167:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDictType)) + 32)) = sSetDictFromAny                                           // tclDictObj.c:168:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDictType)) + 8)) = sFreeDictInternalRep                                                      // tclDictObj.c:165:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDictType)) + 16)) = sDupDictInternalRep                                             // tclDictObj.c:166:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDictType)) + 24)) = sUpdateStringOfDict                                                      // tclDictObj.c:167:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDictType)) + 32)) = sSetDictFromAny                                           // tclDictObj.c:168:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDoubleType)) + 24)) = sUpdateStringOfDouble                                                  // tclObj.c:264:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDoubleType)) + 32)) = sSetDoubleFromAny                                       // tclObj.c:265:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDoubleType)) + 24)) = sUpdateStringOfDouble                                                  // tclObj.c:264:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclDoubleType)) + 32)) = sSetDoubleFromAny                                       // tclObj.c:265:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclEmptyStringRep)) + 0)) = uintptr(unsafe.Pointer(&XtclEmptyString))                                            // tclObj.c:52:27:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclEmptyStringRep)) + 0)) = uintptr(unsafe.Pointer(&XtclEmptyString))                                            // tclObj.c:52:27:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclEndOffsetType)) + 24)) = sUpdateStringOfEndOffset                                            // tclUtil.c:132:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclEndOffsetType)) + 32)) = sSetEndOffsetFromAny                                 // tclUtil.c:133:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclEndOffsetType)) + 24)) = sUpdateStringOfEndOffset                                            // tclUtil.c:132:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclEndOffsetType)) + 32)) = sSetEndOffsetFromAny                                 // tclUtil.c:133:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclGetTimeProcPtr)) + 0)) = sNativeGetTime                                          // tclUnixTime.c:57:38:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclGetTimeProcPtr)) + 0)) = sNativeGetTime                                          // tclUnixTime.c:57:38:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclIntType)) + 24)) = sUpdateStringOfInt                                                        // tclObj.c:271:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclIntType)) + 32)) = sSetIntFromAny                                             // tclObj.c:272:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclIntType)) + 24)) = sUpdateStringOfInt                                                        // tclObj.c:271:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclIntType)) + 32)) = sSetIntFromAny                                             // tclObj.c:272:5:
	*(*func(*libc.TLS, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclJumptableInfoType)) + 8)) = sDupJumptableInfo                                  // tclCompCmdsSZ.c:76:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclJumptableInfoType)) + 16)) = sFreeJumptableInfo                                           // tclCompCmdsSZ.c:77:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclJumptableInfoType)) + 24)) = sPrintJumptableInfo                // tclCompCmdsSZ.c:78:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclJumptableInfoType)) + 32)) = sDisassembleJumptableInfo          // tclCompCmdsSZ.c:79:5:
	*(*func(*libc.TLS, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclJumptableInfoType)) + 8)) = sDupJumptableInfo                                  // tclCompCmdsSZ.c:76:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclJumptableInfoType)) + 16)) = sFreeJumptableInfo                                           // tclCompCmdsSZ.c:77:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclJumptableInfoType)) + 24)) = sPrintJumptableInfo                // tclCompCmdsSZ.c:78:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclJumptableInfoType)) + 32)) = sDisassembleJumptableInfo          // tclCompCmdsSZ.c:79:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclLambdaType)) + 8)) = sFreeLambdaInternalRep                                                  // tclProc.c:94:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclLambdaType)) + 16)) = sDupLambdaInternalRep                                         // tclProc.c:95:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclLambdaType)) + 32)) = sSetLambdaFromAny                                       // tclProc.c:97:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclLambdaType)) + 8)) = sFreeLambdaInternalRep                                                  // tclProc.c:94:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclLambdaType)) + 16)) = sDupLambdaInternalRep                                         // tclProc.c:95:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclLambdaType)) + 32)) = sSetLambdaFromAny                                       // tclProc.c:97:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclListType)) + 8)) = sFreeListInternalRep                                                      // tclListObj.c:43:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclListType)) + 16)) = sDupListInternalRep                                             // tclListObj.c:44:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclListType)) + 24)) = sUpdateStringOfList                                                      // tclListObj.c:45:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclListType)) + 32)) = sSetListFromAny                                           // tclListObj.c:46:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclListType)) + 8)) = sFreeListInternalRep                                                      // tclListObj.c:43:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclListType)) + 16)) = sDupListInternalRep                                             // tclListObj.c:44:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclListType)) + 24)) = sUpdateStringOfList                                                      // tclListObj.c:45:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclListType)) + 32)) = sSetListFromAny                                           // tclListObj.c:46:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 24)) = XTclNativePathInFilesystem                        // tclIOUtil.c:157:5:
	*(*func(*libc.TLS, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 32)) = XTclNativeDupInternalRep                           // tclIOUtil.c:158:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 40)) = sNativeFreeInternalRep                                        // tclIOUtil.c:159:5:
	*(*func(*libc.TLS, ClientData) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 48)) = XTclpNativeToNormalized                               // tclIOUtil.c:160:5:
	*(*func(*libc.TLS, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 56)) = XTclNativeCreateNativeRep                             // tclIOUtil.c:161:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 64)) = XTclpObjNormalizePath                      // tclIOUtil.c:162:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 72)) = XTclpFilesystemPathType                                  // tclIOUtil.c:163:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 80)) = sNativeFilesystemSeparator                               // tclIOUtil.c:164:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 88)) = XTclpObjStat                                      // tclIOUtil.c:165:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 96)) = XTclpObjAccess                                      // tclIOUtil.c:166:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 104)) = XTclpOpenFileChannel         // tclIOUtil.c:167:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 112)) = XTclpMatchInDirectory // tclIOUtil.c:168:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 120)) = XTclpUtime                                       // tclIOUtil.c:169:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 128)) = XTclpObjLink                            // tclIOUtil.c:173:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 136)) = XTclpObjListVolumes                                              // tclIOUtil.c:175:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 144)) = sNativeFileAttrStrings                         // tclIOUtil.c:176:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 152)) = sNativeFileAttrsGet              // tclIOUtil.c:177:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 160)) = sNativeFileAttrsSet              // tclIOUtil.c:178:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 168)) = XTclpObjCreateDirectory                                   // tclIOUtil.c:179:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 176)) = XTclpObjRemoveDirectory                   // tclIOUtil.c:180:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 184)) = XTclpObjDeleteFile                                        // tclIOUtil.c:181:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 192)) = XTclpObjCopyFile                                 // tclIOUtil.c:182:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 200)) = XTclpObjRenameFile                               // tclIOUtil.c:183:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 208)) = XTclpObjCopyDirectory                   // tclIOUtil.c:184:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 216)) = XTclpObjLstat                                    // tclIOUtil.c:185:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 224 /* .loadFileProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32) int32
	}{XTclpDlopen})) // tclIOUtil.c:187:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 232 /* .getCwdProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData) ClientData
	}{XTclpGetNativeCwd})) // tclIOUtil.c:188:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 240)) = XTclpObjChdir                                             // tclIOUtil.c:189:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 24)) = XTclNativePathInFilesystem                        // tclIOUtil.c:157:5:
	*(*func(*libc.TLS, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 32)) = XTclNativeDupInternalRep                           // tclIOUtil.c:158:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 40)) = sNativeFreeInternalRep                                        // tclIOUtil.c:159:5:
	*(*func(*libc.TLS, ClientData) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 48)) = XTclpNativeToNormalized                               // tclIOUtil.c:160:5:
	*(*func(*libc.TLS, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 56)) = XTclNativeCreateNativeRep                             // tclIOUtil.c:161:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 64)) = XTclpObjNormalizePath                      // tclIOUtil.c:162:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 72)) = XTclpFilesystemPathType                                  // tclIOUtil.c:163:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 80)) = sNativeFilesystemSeparator                               // tclIOUtil.c:164:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 88)) = XTclpObjStat                                      // tclIOUtil.c:165:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 96)) = XTclpObjAccess                                      // tclIOUtil.c:166:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 104)) = XTclpOpenFileChannel         // tclIOUtil.c:167:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 112)) = XTclpMatchInDirectory // tclIOUtil.c:168:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 120)) = XTclpUtime                                       // tclIOUtil.c:169:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 128)) = XTclpObjLink                            // tclIOUtil.c:173:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 136)) = XTclpObjListVolumes                                              // tclIOUtil.c:175:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 144)) = sNativeFileAttrStrings                         // tclIOUtil.c:176:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 152)) = sNativeFileAttrsGet              // tclIOUtil.c:177:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 160)) = sNativeFileAttrsSet              // tclIOUtil.c:178:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 168)) = XTclpObjCreateDirectory                                   // tclIOUtil.c:179:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 176)) = XTclpObjRemoveDirectory                   // tclIOUtil.c:180:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 184)) = XTclpObjDeleteFile                                        // tclIOUtil.c:181:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 192)) = XTclpObjCopyFile                                 // tclIOUtil.c:182:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 200)) = XTclpObjRenameFile                               // tclIOUtil.c:183:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 208)) = XTclpObjCopyDirectory                   // tclIOUtil.c:184:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 216)) = XTclpObjLstat                                    // tclIOUtil.c:185:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 224 /* .loadFileProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32) int32
	}{XTclpDlopen})) // tclIOUtil.c:187:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 232 /* .getCwdProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, ClientData) ClientData
	}{XTclpGetNativeCwd})) // tclIOUtil.c:188:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclNativeFilesystem)) + 240)) = XTclpObjChdir                                                                                     // tclIOUtil.c:189:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 8 /* .hooks */)) = uintptr(unsafe.Pointer(&tclOOStubHooks))                                                                               // tclOOStubInit.c:48:5:
	*(*func(*libc.TLS, uintptr, Tcl_Object, uintptr, uintptr) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 16)) = XTcl_CopyObjectInstance                                                  // tclOOStubInit.c:49:5:
	*(*func(*libc.TLS, Tcl_Class) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 24)) = XTcl_GetClassAsObject                                                                                // tclOOStubInit.c:50:5:
	*(*func(*libc.TLS, Tcl_Object) Tcl_Class)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 32)) = XTcl_GetObjectAsClass                                                                                // tclOOStubInit.c:51:5:
	*(*func(*libc.TLS, Tcl_Object) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 40)) = XTcl_GetObjectCommand                                                                              // tclOOStubInit.c:52:5:
	*(*func(*libc.TLS, uintptr, uintptr) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 48)) = XTcl_GetObjectFromObj                                                                         // tclOOStubInit.c:53:5:
	*(*func(*libc.TLS, Tcl_Object) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 56)) = XTcl_GetObjectNamespace                                                                                // tclOOStubInit.c:54:5:
	*(*func(*libc.TLS, Tcl_Method) Tcl_Class)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 64)) = XTcl_MethodDeclarerClass                                                                             // tclOOStubInit.c:55:5:
	*(*func(*libc.TLS, Tcl_Method) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 72)) = XTcl_MethodDeclarerObject                                                                           // tclOOStubInit.c:56:5:
	*(*func(*libc.TLS, Tcl_Method) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 80)) = XTcl_MethodIsPublic                                                                                      // tclOOStubInit.c:57:5:
	*(*func(*libc.TLS, Tcl_Method, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 88)) = XTcl_MethodIsType                                                                      // tclOOStubInit.c:58:5:
	*(*func(*libc.TLS, Tcl_Method) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 96)) = XTcl_MethodName                                                                                        // tclOOStubInit.c:59:5:
	*(*func(*libc.TLS, uintptr, Tcl_Object, uintptr, int32, uintptr, ClientData) Tcl_Method)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 104)) = XTcl_NewInstanceMethod                               // tclOOStubInit.c:60:5:
	*(*func(*libc.TLS, uintptr, Tcl_Class, uintptr, int32, uintptr, ClientData) Tcl_Method)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 112)) = XTcl_NewMethod                                        // tclOOStubInit.c:61:5:
	*(*func(*libc.TLS, uintptr, Tcl_Class, uintptr, uintptr, int32, uintptr, int32) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 120)) = XTcl_NewObjectInstance                            // tclOOStubInit.c:62:5:
	*(*func(*libc.TLS, Tcl_Object) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 128)) = XTcl_ObjectDeleted                                                                                      // tclOOStubInit.c:63:5:
	*(*func(*libc.TLS, Tcl_ObjectContext) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 136)) = XTcl_ObjectContextIsFiltering                                                                    // tclOOStubInit.c:64:5:
	*(*func(*libc.TLS, Tcl_ObjectContext) Tcl_Method)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 144)) = XTcl_ObjectContextMethod                                                                    // tclOOStubInit.c:65:5:
	*(*func(*libc.TLS, Tcl_ObjectContext) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 152)) = XTcl_ObjectContextObject                                                                    // tclOOStubInit.c:66:5:
	*(*func(*libc.TLS, Tcl_ObjectContext) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 160)) = XTcl_ObjectContextSkippedArgs                                                                    // tclOOStubInit.c:67:5:
	*(*func(*libc.TLS, Tcl_Class, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 168)) = XTcl_ClassGetMetadata                                                                      // tclOOStubInit.c:68:5:
	*(*func(*libc.TLS, Tcl_Class, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 176)) = XTcl_ClassSetMetadata                                                                     // tclOOStubInit.c:69:5:
	*(*func(*libc.TLS, Tcl_Object, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 184)) = XTcl_ObjectGetMetadata                                                                    // tclOOStubInit.c:70:5:
	*(*func(*libc.TLS, Tcl_Object, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 192)) = XTcl_ObjectSetMetadata                                                                   // tclOOStubInit.c:71:5:
	*(*func(*libc.TLS, uintptr, Tcl_ObjectContext, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 200)) = XTcl_ObjectContextInvokeNext                                     // tclOOStubInit.c:72:5:
	*(*func(*libc.TLS, Tcl_Object) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 208)) = XTcl_ObjectGetMethodNameMapper                                                                        // tclOOStubInit.c:73:5:
	*(*func(*libc.TLS, Tcl_Object, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 216)) = XTcl_ObjectSetMethodNameMapper                                                                       // tclOOStubInit.c:74:5:
	*(*func(*libc.TLS, uintptr, Tcl_Class, Tcl_Method))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 224)) = XTcl_ClassSetConstructor                                                                  // tclOOStubInit.c:75:5:
	*(*func(*libc.TLS, uintptr, Tcl_Class, Tcl_Method))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 232)) = XTcl_ClassSetDestructor                                                                   // tclOOStubInit.c:76:5:
	*(*func(*libc.TLS, uintptr, Tcl_Object) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 240)) = XTcl_GetObjectName                                                                           // tclOOStubInit.c:77:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 8 /* .hooks */)) = uintptr(unsafe.Pointer(&tclOOStubHooks))                                                                               // tclOOStubInit.c:48:5:
	*(*func(*libc.TLS, uintptr, Tcl_Object, uintptr, uintptr) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 16)) = XTcl_CopyObjectInstance                                                  // tclOOStubInit.c:49:5:
	*(*func(*libc.TLS, Tcl_Class) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 24)) = XTcl_GetClassAsObject                                                                                // tclOOStubInit.c:50:5:
	*(*func(*libc.TLS, Tcl_Object) Tcl_Class)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 32)) = XTcl_GetObjectAsClass                                                                                // tclOOStubInit.c:51:5:
	*(*func(*libc.TLS, Tcl_Object) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 40)) = XTcl_GetObjectCommand                                                                              // tclOOStubInit.c:52:5:
	*(*func(*libc.TLS, uintptr, uintptr) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 48)) = XTcl_GetObjectFromObj                                                                         // tclOOStubInit.c:53:5:
	*(*func(*libc.TLS, Tcl_Object) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 56)) = XTcl_GetObjectNamespace                                                                                // tclOOStubInit.c:54:5:
	*(*func(*libc.TLS, Tcl_Method) Tcl_Class)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 64)) = XTcl_MethodDeclarerClass                                                                             // tclOOStubInit.c:55:5:
	*(*func(*libc.TLS, Tcl_Method) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 72)) = XTcl_MethodDeclarerObject                                                                           // tclOOStubInit.c:56:5:
	*(*func(*libc.TLS, Tcl_Method) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 80)) = XTcl_MethodIsPublic                                                                                      // tclOOStubInit.c:57:5:
	*(*func(*libc.TLS, Tcl_Method, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 88)) = XTcl_MethodIsType                                                                      // tclOOStubInit.c:58:5:
	*(*func(*libc.TLS, Tcl_Method) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 96)) = XTcl_MethodName                                                                                        // tclOOStubInit.c:59:5:
	*(*func(*libc.TLS, uintptr, Tcl_Object, uintptr, int32, uintptr, ClientData) Tcl_Method)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 104)) = XTcl_NewInstanceMethod                               // tclOOStubInit.c:60:5:
	*(*func(*libc.TLS, uintptr, Tcl_Class, uintptr, int32, uintptr, ClientData) Tcl_Method)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 112)) = XTcl_NewMethod                                        // tclOOStubInit.c:61:5:
	*(*func(*libc.TLS, uintptr, Tcl_Class, uintptr, uintptr, int32, uintptr, int32) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 120)) = XTcl_NewObjectInstance                            // tclOOStubInit.c:62:5:
	*(*func(*libc.TLS, Tcl_Object) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 128)) = XTcl_ObjectDeleted                                                                                      // tclOOStubInit.c:63:5:
	*(*func(*libc.TLS, Tcl_ObjectContext) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 136)) = XTcl_ObjectContextIsFiltering                                                                    // tclOOStubInit.c:64:5:
	*(*func(*libc.TLS, Tcl_ObjectContext) Tcl_Method)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 144)) = XTcl_ObjectContextMethod                                                                    // tclOOStubInit.c:65:5:
	*(*func(*libc.TLS, Tcl_ObjectContext) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 152)) = XTcl_ObjectContextObject                                                                    // tclOOStubInit.c:66:5:
	*(*func(*libc.TLS, Tcl_ObjectContext) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 160)) = XTcl_ObjectContextSkippedArgs                                                                    // tclOOStubInit.c:67:5:
	*(*func(*libc.TLS, Tcl_Class, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 168)) = XTcl_ClassGetMetadata                                                                      // tclOOStubInit.c:68:5:
	*(*func(*libc.TLS, Tcl_Class, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 176)) = XTcl_ClassSetMetadata                                                                     // tclOOStubInit.c:69:5:
	*(*func(*libc.TLS, Tcl_Object, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 184)) = XTcl_ObjectGetMetadata                                                                    // tclOOStubInit.c:70:5:
	*(*func(*libc.TLS, Tcl_Object, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 192)) = XTcl_ObjectSetMetadata                                                                   // tclOOStubInit.c:71:5:
	*(*func(*libc.TLS, uintptr, Tcl_ObjectContext, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 200)) = XTcl_ObjectContextInvokeNext                                     // tclOOStubInit.c:72:5:
	*(*func(*libc.TLS, Tcl_Object) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 208)) = XTcl_ObjectGetMethodNameMapper                                                                        // tclOOStubInit.c:73:5:
	*(*func(*libc.TLS, Tcl_Object, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 216)) = XTcl_ObjectSetMethodNameMapper                                                                       // tclOOStubInit.c:74:5:
	*(*func(*libc.TLS, uintptr, Tcl_Class, Tcl_Method))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 224)) = XTcl_ClassSetConstructor                                                                  // tclOOStubInit.c:75:5:
	*(*func(*libc.TLS, uintptr, Tcl_Class, Tcl_Method))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 232)) = XTcl_ClassSetDestructor                                                                   // tclOOStubInit.c:76:5:
	*(*func(*libc.TLS, uintptr, Tcl_Object) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclOOStubs)) + 240)) = XTcl_GetObjectName                                                                           // tclOOStubInit.c:77:5:
	*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclObjHashKeyType)) + 8)) = XTclHashObjKey                                                                              // tclObj.c:298:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclObjHashKeyType)) + 16)) = XTclCompareObjKeys                                                                          // tclObj.c:299:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclObjHashKeyType)) + 24)) = sAllocObjEntry                                                                            // tclObj.c:300:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclObjHashKeyType)) + 32)) = XTclFreeObjEntry                                                                                           // tclObj.c:301:5:
	*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclObjHashKeyType)) + 8)) = XTclHashObjKey                                                                              // tclObj.c:298:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclObjHashKeyType)) + 16)) = XTclCompareObjKeys                                                                          // tclObj.c:299:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclObjHashKeyType)) + 24)) = sAllocObjEntry                                                                            // tclObj.c:300:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclObjHashKeyType)) + 32)) = XTclFreeObjEntry                                                                                           // tclObj.c:301:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclProcBodyType)) + 8)) = sProcBodyFree                                                                                                 // tclProc.c:61:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclProcBodyType)) + 16)) = sProcBodyDup                                                                                        // tclProc.c:62:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclProcBodyType)) + 8)) = sProcBodyFree                                                                                                 // tclProc.c:61:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclProcBodyType)) + 16)) = sProcBodyDup                                                                                        // tclProc.c:62:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclRegexpType)) + 8)) = sFreeRegexpInternalRep                                                                                          // tclRegexp.c:105:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclRegexpType)) + 16)) = sDupRegexpInternalRep                                                                                 // tclRegexp.c:106:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclRegexpType)) + 32)) = sSetRegexpFromAny                                                                               // tclRegexp.c:108:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclRegexpType)) + 8)) = sFreeRegexpInternalRep                                                                                          // tclRegexp.c:105:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclRegexpType)) + 16)) = sDupRegexpInternalRep                                                                                 // tclRegexp.c:106:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclRegexpType)) + 32)) = sSetRegexpFromAny                                                                               // tclRegexp.c:108:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclScaleTimeProcPtr)) + 0)) = sNativeScaleTime                                                                              // tclUnixTime.c:58:42:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclScaleTimeProcPtr)) + 0)) = sNativeScaleTime                                                                              // tclUnixTime.c:58:42:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 8)) = XTcl_UniCharIsAlnum                                                                                   // tclCompCmdsSZ.c:1361:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 24)) = XTcl_UniCharIsAlpha                                                                                  // tclCompCmdsSZ.c:1362:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 40)) = sUniCharIsAscii1                                                                                     // tclCompCmdsSZ.c:1363:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 56)) = XTcl_UniCharIsControl                                                                                // tclCompCmdsSZ.c:1364:17:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 72)) = XTcl_UniCharIsDigit                                                                                  // tclCompCmdsSZ.c:1365:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 88)) = XTcl_UniCharIsGraph                                                                                  // tclCompCmdsSZ.c:1366:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 104)) = XTcl_UniCharIsLower                                                                                 // tclCompCmdsSZ.c:1367:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 120)) = XTcl_UniCharIsPrint                                                                                 // tclCompCmdsSZ.c:1368:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 136)) = XTcl_UniCharIsPunct                                                                                 // tclCompCmdsSZ.c:1369:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 152)) = XTcl_UniCharIsSpace                                                                                 // tclCompCmdsSZ.c:1370:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 168)) = XTcl_UniCharIsUpper                                                                                 // tclCompCmdsSZ.c:1371:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 184)) = XTcl_UniCharIsWordChar                                                                              // tclCompCmdsSZ.c:1372:14:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 200)) = sUniCharIsHexDigit1                                                                                 // tclCompCmdsSZ.c:1373:16:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 8)) = XTcl_UniCharIsAlnum                                                                                   // tclCompCmdsSZ.c:1361:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 24)) = XTcl_UniCharIsAlpha                                                                                  // tclCompCmdsSZ.c:1362:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 40)) = sUniCharIsAscii1                                                                                     // tclCompCmdsSZ.c:1363:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 56)) = XTcl_UniCharIsControl                                                                                // tclCompCmdsSZ.c:1364:17:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 72)) = XTcl_UniCharIsDigit                                                                                  // tclCompCmdsSZ.c:1365:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 88)) = XTcl_UniCharIsGraph                                                                                  // tclCompCmdsSZ.c:1366:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 104)) = XTcl_UniCharIsLower                                                                                 // tclCompCmdsSZ.c:1367:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 120)) = XTcl_UniCharIsPrint                                                                                 // tclCompCmdsSZ.c:1368:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 136)) = XTcl_UniCharIsPunct                                                                                 // tclCompCmdsSZ.c:1369:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 152)) = XTcl_UniCharIsSpace                                                                                 // tclCompCmdsSZ.c:1370:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 168)) = XTcl_UniCharIsUpper                                                                                 // tclCompCmdsSZ.c:1371:15:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 184)) = XTcl_UniCharIsWordChar                                                                              // tclCompCmdsSZ.c:1372:14:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringClassTable)) + 200)) = sUniCharIsHexDigit1                                                                                 // tclCompCmdsSZ.c:1373:16:
	*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringHashKeyType)) + 8)) = sHashStringKey                                                                           // tclHash.c:103:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringHashKeyType)) + 16)) = sCompareStringKeys                                                                       // tclHash.c:104:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringHashKeyType)) + 24)) = sAllocStringEntry                                                                      // tclHash.c:105:5:
	*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringHashKeyType)) + 8)) = sHashStringKey                                                                           // tclHash.c:103:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringHashKeyType)) + 16)) = sCompareStringKeys                                                                       // tclHash.c:104:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringHashKeyType)) + 24)) = sAllocStringEntry                                                                      // tclHash.c:105:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringType)) + 8)) = sFreeStringInternalRep                                                                                          // tclStringObj.c:88:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringType)) + 16)) = sDupStringInternalRep                                                                                 // tclStringObj.c:89:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringType)) + 24)) = sUpdateStringOfString                                                                                          // tclStringObj.c:90:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringType)) + 32)) = sSetStringFromAny                                                                               // tclStringObj.c:91:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringType)) + 8)) = sFreeStringInternalRep                                                                                          // tclStringObj.c:88:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringType)) + 16)) = sDupStringInternalRep                                                                                 // tclStringObj.c:89:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringType)) + 24)) = sUpdateStringOfString                                                                                          // tclStringObj.c:90:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStringType)) + 32)) = sSetStringFromAny                                                                               // tclStringObj.c:91:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 8 /* .hooks */)) = uintptr(unsafe.Pointer(&tclStubHooks))                                                                                   // tclStubInit.c:967:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 16)) = XTcl_PkgProvideEx                                                                  // tclStubInit.c:968:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 24)) = XTcl_PkgRequireEx                                                         // tclStubInit.c:969:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 32)) = XTcl_Panic                                                                                                 // tclStubInit.c:970:5:
	*(*func(*libc.TLS, uint32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 40)) = XTcl_Alloc                                                                                                   // tclStubInit.c:971:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 48)) = XTcl_Free                                                                                                           // tclStubInit.c:972:5:
	*(*func(*libc.TLS, uintptr, uint32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 56)) = XTcl_Realloc                                                                                        // tclStubInit.c:973:5:
	*(*func(*libc.TLS, uint32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 64)) = XTcl_DbCkalloc                                                                               // tclStubInit.c:974:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 72)) = XTcl_DbCkfree                                                                                       // tclStubInit.c:975:5:
	*(*func(*libc.TLS, uintptr, uint32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 80)) = XTcl_DbCkrealloc                                                                    // tclStubInit.c:976:5:
	*(*func(*libc.TLS, int32, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 88)) = XTcl_CreateFileHandler                                                                    // tclStubInit.c:978:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 96)) = XTcl_DeleteFileHandler                                                                                                // tclStubInit.c:987:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 104)) = XTcl_SetTimer                                                                                                      // tclStubInit.c:995:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 112)) = XTcl_Sleep                                                                                                           // tclStubInit.c:996:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 120)) = XTcl_WaitForEvent                                                                                            // tclStubInit.c:997:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 128)) = XTcl_AppendAllObjTypes                                                                              // tclStubInit.c:998:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 136)) = XTcl_AppendStringsToObj                                                                                   // tclStubInit.c:999:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 144)) = XTcl_AppendToObj                                                                                   // tclStubInit.c:1000:5:
	*(*func(*libc.TLS, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 152)) = XTcl_ConcatObj                                                                                      // tclStubInit.c:1001:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 160)) = XTcl_ConvertToType                                                                         // tclStubInit.c:1002:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 168)) = XTcl_DbDecrRefCount                                                                                // tclStubInit.c:1003:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 176)) = XTcl_DbIncrRefCount                                                                                // tclStubInit.c:1004:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 184)) = XTcl_DbIsShared                                                                              // tclStubInit.c:1005:5:
	*(*func(*libc.TLS, int32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 192)) = XTcl_DbNewBooleanObj                                                                         // tclStubInit.c:1006:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 200)) = XTcl_DbNewByteArrayObj                                                              // tclStubInit.c:1007:5:
	*(*func(*libc.TLS, float64, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 208)) = XTcl_DbNewDoubleObj                                                                        // tclStubInit.c:1008:5:
	*(*func(*libc.TLS, int32, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 216)) = XTcl_DbNewListObj                                                                   // tclStubInit.c:1009:5:
	*(*func(*libc.TLS, int64, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 224)) = XTcl_DbNewLongObj                                                                            // tclStubInit.c:1010:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 232)) = XTcl_DbNewObj                                                                                       // tclStubInit.c:1011:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 240)) = XTcl_DbNewStringObj                                                                 // tclStubInit.c:1012:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 248)) = XTcl_DuplicateObj                                                                                          // tclStubInit.c:1013:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 256)) = XTclFreeObj                                                                                                        // tclStubInit.c:1014:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 264)) = XTcl_GetBoolean                                                                            // tclStubInit.c:1015:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 272)) = XTcl_GetBooleanFromObj                                                                     // tclStubInit.c:1016:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 280)) = XTcl_GetByteArrayFromObj                                                                          // tclStubInit.c:1017:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 288)) = XTcl_GetDouble                                                                             // tclStubInit.c:1018:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 296)) = XTcl_GetDoubleFromObj                                                                      // tclStubInit.c:1019:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 304)) = XTcl_GetIndexFromObj                                              // tclStubInit.c:1020:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 312)) = XTcl_GetInt                                                                                // tclStubInit.c:1021:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 320)) = XTcl_GetIntFromObj                                                                         // tclStubInit.c:1022:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 328)) = XTcl_GetLongFromObj                                                                        // tclStubInit.c:1023:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 336)) = XTcl_GetObjType                                                                                            // tclStubInit.c:1024:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 344)) = XTcl_GetStringFromObj                                                                             // tclStubInit.c:1025:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 352)) = XTcl_InvalidateStringRep                                                                                           // tclStubInit.c:1026:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 360)) = XTcl_ListObjAppendList                                                                     // tclStubInit.c:1027:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 368)) = XTcl_ListObjAppendElement                                                                  // tclStubInit.c:1028:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 376)) = XTcl_ListObjGetElements                                                           // tclStubInit.c:1029:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 384)) = XTcl_ListObjIndex                                                                   // tclStubInit.c:1030:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 392)) = XTcl_ListObjLength                                                                         // tclStubInit.c:1031:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 400)) = XTcl_ListObjReplace                                                   // tclStubInit.c:1032:5:
	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 408)) = XTcl_NewBooleanObj                                                                                           // tclStubInit.c:1033:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 416)) = XTcl_NewByteArrayObj                                                                                // tclStubInit.c:1034:5:
	*(*func(*libc.TLS, float64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 424)) = XTcl_NewDoubleObj                                                                                          // tclStubInit.c:1035:5:
	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 432)) = XTcl_NewIntObj                                                                                               // tclStubInit.c:1036:5:
	*(*func(*libc.TLS, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 440)) = XTcl_NewListObj                                                                                     // tclStubInit.c:1037:5:
	*(*func(*libc.TLS, int64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 448)) = XTcl_NewLongObj                                                                                              // tclStubInit.c:1038:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 456)) = XTcl_NewObj                                                                                                         // tclStubInit.c:1039:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 464)) = XTcl_NewStringObj                                                                                   // tclStubInit.c:1040:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 472)) = XTcl_SetBooleanObj                                                                                          // tclStubInit.c:1041:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 480)) = XTcl_SetByteArrayLength                                                                             // tclStubInit.c:1042:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 488)) = XTcl_SetByteArrayObj                                                                               // tclStubInit.c:1043:5:
	*(*func(*libc.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 496)) = XTcl_SetDoubleObj                                                                                         // tclStubInit.c:1044:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 504)) = XTcl_SetIntObj                                                                                              // tclStubInit.c:1045:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 512)) = XTcl_SetListObj                                                                                    // tclStubInit.c:1046:5:
	*(*func(*libc.TLS, uintptr, int64))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 520)) = XTcl_SetLongObj                                                                                             // tclStubInit.c:1047:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 528)) = XTcl_SetObjLength                                                                                           // tclStubInit.c:1048:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 536)) = XTcl_SetStringObj                                                                                  // tclStubInit.c:1049:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 544)) = XTcl_AddErrorInfo                                                                                         // tclStubInit.c:1050:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 552)) = XTcl_AddObjErrorInfo                                                                               // tclStubInit.c:1051:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 560)) = XTcl_AllowExceptions                                                                                               // tclStubInit.c:1052:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 568)) = XTcl_AppendElement                                                                                        // tclStubInit.c:1053:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 576)) = XTcl_AppendResult                                                                                         // tclStubInit.c:1054:5:
	*(*func(*libc.TLS, uintptr, ClientData) Tcl_AsyncHandler)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 584)) = XTcl_AsyncCreate                                                                      // tclStubInit.c:1055:5:
	*(*func(*libc.TLS, Tcl_AsyncHandler))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 592)) = XTcl_AsyncDelete                                                                                          // tclStubInit.c:1056:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 600)) = XTcl_AsyncInvoke                                                                                      // tclStubInit.c:1057:5:
	*(*func(*libc.TLS, Tcl_AsyncHandler))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 608)) = XTcl_AsyncMark                                                                                            // tclStubInit.c:1058:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 616)) = XTcl_AsyncReady                                                                                                       // tclStubInit.c:1059:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 624)) = XTcl_BackgroundError                                                                                               // tclStubInit.c:1060:5:
	*(*func(*libc.TLS, uintptr, uintptr) int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 632)) = XTcl_Backslash                                                                                       // tclStubInit.c:1061:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 640)) = XTcl_BadChannelOption                                                                      // tclStubInit.c:1062:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 648)) = XTcl_CallWhenDeleted                                                                          // tclStubInit.c:1063:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 656)) = XTcl_CancelIdleCall                                                                                    // tclStubInit.c:1064:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 664)) = XTcl_Close                                                                                      // tclStubInit.c:1065:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 672)) = XTcl_CommandComplete                                                                                         // tclStubInit.c:1066:5:
	*(*func(*libc.TLS, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 680)) = XTcl_Concat                                                                                         // tclStubInit.c:1067:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 688)) = XTcl_ConvertElement                                                                          // tclStubInit.c:1068:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 696)) = XTcl_ConvertCountedElement                                                            // tclStubInit.c:1069:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 704)) = XTcl_CreateAlias                                                  // tclStubInit.c:1070:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 712)) = XTcl_CreateAliasObj                                               // tclStubInit.c:1071:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 720)) = XTcl_CreateChannel                                                         // tclStubInit.c:1072:5:
	*(*func(*libc.TLS, Tcl_Channel, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 728)) = XTcl_CreateChannelHandler                                                          // tclStubInit.c:1073:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 736)) = XTcl_CreateCloseHandler                                                                   // tclStubInit.c:1074:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, ClientData, uintptr) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 744)) = XTcl_CreateCommand                                              // tclStubInit.c:1075:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 752)) = XTcl_CreateEventSource                                                                        // tclStubInit.c:1076:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 760)) = XTcl_CreateExitHandler                                                                                 // tclStubInit.c:1077:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 768)) = XTcl_CreateInterp                                                                                                   // tclStubInit.c:1078:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 776)) = XTcl_CreateMathFunc                                                  // tclStubInit.c:1079:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, ClientData, uintptr) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 784)) = XTcl_CreateObjCommand                                           // tclStubInit.c:1080:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 792)) = XTcl_CreateSlave                                                                           // tclStubInit.c:1081:5:
	*(*func(*libc.TLS, int32, uintptr, ClientData) Tcl_TimerToken)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 800)) = XTcl_CreateTimerHandler                                                          // tclStubInit.c:1082:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, ClientData) Tcl_Trace)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 808)) = XTcl_CreateTrace                                                             // tclStubInit.c:1083:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 816)) = XTcl_DeleteAssocData                                                                                      // tclStubInit.c:1084:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 824)) = XTcl_DeleteChannelHandler                                                                 // tclStubInit.c:1085:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 832)) = XTcl_DeleteCloseHandler                                                                   // tclStubInit.c:1086:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 840)) = XTcl_DeleteCommand                                                                                  // tclStubInit.c:1087:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 848)) = XTcl_DeleteCommandFromToken                                                                     // tclStubInit.c:1088:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 856)) = XTcl_DeleteEvents                                                                                      // tclStubInit.c:1089:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 864)) = XTcl_DeleteEventSource                                                                        // tclStubInit.c:1090:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 872)) = XTcl_DeleteExitHandler                                                                                 // tclStubInit.c:1091:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 880)) = XTcl_DeleteHashEntry                                                                                               // tclStubInit.c:1092:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 888)) = XTcl_DeleteHashTable                                                                                               // tclStubInit.c:1093:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 896)) = XTcl_DeleteInterp                                                                                                  // tclStubInit.c:1094:5:
	*(*func(*libc.TLS, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 904)) = XTcl_DetachPids                                                                                             // tclStubInit.c:1095:5:
	*(*func(*libc.TLS, Tcl_TimerToken))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 912)) = XTcl_DeleteTimerHandler                                                                                     // tclStubInit.c:1096:5:
	*(*func(*libc.TLS, uintptr, Tcl_Trace))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 920)) = XTcl_DeleteTrace                                                                                        // tclStubInit.c:1097:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 928)) = XTcl_DontCallWhenDeleted                                                                      // tclStubInit.c:1098:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 936)) = XTcl_DoOneEvent                                                                                                // tclStubInit.c:1099:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 944)) = XTcl_DoWhenIdle                                                                                        // tclStubInit.c:1100:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 952)) = XTcl_DStringAppend                                                                         // tclStubInit.c:1101:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 960)) = XTcl_DStringAppendElement                                                                         // tclStubInit.c:1102:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 968)) = XTcl_DStringEndSublist                                                                                             // tclStubInit.c:1103:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 976)) = XTcl_DStringFree                                                                                                   // tclStubInit.c:1104:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 984)) = XTcl_DStringGetResult                                                                                     // tclStubInit.c:1105:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 992)) = XTcl_DStringInit                                                                                                   // tclStubInit.c:1106:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1000)) = XTcl_DStringResult                                                                                       // tclStubInit.c:1107:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1008)) = XTcl_DStringSetLength                                                                                      // tclStubInit.c:1108:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1016)) = XTcl_DStringStartSublist                                                                                          // tclStubInit.c:1109:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1024)) = XTcl_Eof                                                                                                // tclStubInit.c:1110:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1032)) = XTcl_ErrnoId                                                                                                       // tclStubInit.c:1111:5:
	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1040)) = XTcl_ErrnoMsg                                                                                               // tclStubInit.c:1112:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1048)) = XTcl_Eval                                                                                          // tclStubInit.c:1113:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1056)) = XTcl_EvalFile                                                                                      // tclStubInit.c:1114:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1064)) = XTcl_EvalObj                                                                                       // tclStubInit.c:1115:5:
	*(*func(*libc.TLS, ClientData, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1072)) = XTcl_EventuallyFree                                                                                   // tclStubInit.c:1116:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1080)) = XTcl_Exit                                                                                                           // tclStubInit.c:1117:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1088)) = XTcl_ExposeCommand                                                                        // tclStubInit.c:1118:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1096)) = XTcl_ExprBoolean                                                                          // tclStubInit.c:1119:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1104)) = XTcl_ExprBooleanObj                                                                       // tclStubInit.c:1120:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1112)) = XTcl_ExprDouble                                                                           // tclStubInit.c:1121:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1120)) = XTcl_ExprDoubleObj                                                                        // tclStubInit.c:1122:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1128)) = XTcl_ExprLong                                                                             // tclStubInit.c:1123:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1136)) = XTcl_ExprLongObj                                                                          // tclStubInit.c:1124:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1144)) = XTcl_ExprObj                                                                              // tclStubInit.c:1125:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1152)) = XTcl_ExprString                                                                                    // tclStubInit.c:1126:5:
	*(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1160)) = XTcl_Finalize                                                                                                              // tclStubInit.c:1127:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1168)) = XTcl_FindExecutable                                                                                               // tclStubInit.c:1128:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1176)) = XTcl_FirstHashEntry                                                                              // tclStubInit.c:1129:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1184)) = XTcl_Flush                                                                                              // tclStubInit.c:1130:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1192)) = XTcl_FreeResult                                                                                                   // tclStubInit.c:1131:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1200)) = XTcl_GetAlias                                                  // tclStubInit.c:1132:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1208)) = XTcl_GetAliasObj                                               // tclStubInit.c:1133:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1216)) = XTcl_GetAssocData                                                                    // tclStubInit.c:1134:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1224)) = XTcl_GetChannel                                                                     // tclStubInit.c:1135:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1232)) = XTcl_GetChannelBufferSize                                                                               // tclStubInit.c:1136:5:
	*(*func(*libc.TLS, Tcl_Channel, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1240)) = XTcl_GetChannelHandle                                                                   // tclStubInit.c:1137:5:
	*(*func(*libc.TLS, Tcl_Channel) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1248)) = XTcl_GetChannelInstanceData                                                                        // tclStubInit.c:1138:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1256)) = XTcl_GetChannelMode                                                                                     // tclStubInit.c:1139:5:
	*(*func(*libc.TLS, Tcl_Channel) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1264)) = XTcl_GetChannelName                                                                                   // tclStubInit.c:1140:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1272)) = XTcl_GetChannelOption                                                        // tclStubInit.c:1141:5:
	*(*func(*libc.TLS, Tcl_Channel) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1280)) = XTcl_GetChannelType                                                                                   // tclStubInit.c:1142:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1288)) = XTcl_GetCommandInfo                                                                       // tclStubInit.c:1143:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1296)) = XTcl_GetCommandName                                                                          // tclStubInit.c:1144:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1304)) = XTcl_GetErrno                                                                                                        // tclStubInit.c:1145:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1312)) = XTcl_GetHostName                                                                                                   // tclStubInit.c:1146:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1320)) = XTcl_GetInterpPath                                                                                 // tclStubInit.c:1147:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1328)) = XTcl_GetMaster                                                                                            // tclStubInit.c:1148:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1336)) = XTcl_GetNameOfExecutable                                                                                           // tclStubInit.c:1149:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1344)) = XTcl_GetObjResult                                                                                         // tclStubInit.c:1150:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1352)) = XTcl_GetOpenFile                                                            // tclStubInit.c:1152:5:
	*(*func(*libc.TLS, uintptr) Tcl_PathType)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1360)) = XTcl_GetPathType                                                                                     // tclStubInit.c:1160:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1368)) = XTcl_Gets                                                                                      // tclStubInit.c:1161:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1376)) = XTcl_GetsObj                                                                                   // tclStubInit.c:1162:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1384)) = XTcl_GetServiceMode                                                                                                  // tclStubInit.c:1163:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1392)) = XTcl_GetSlave                                                                                    // tclStubInit.c:1164:5:
	*(*func(*libc.TLS, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1400)) = XTcl_GetStdChannel                                                                                      // tclStubInit.c:1165:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1408)) = XTcl_GetStringResult                                                                                      // tclStubInit.c:1166:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1416)) = XTcl_GetVar                                                                               // tclStubInit.c:1167:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1424)) = XTcl_GetVar2                                                                     // tclStubInit.c:1168:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1432)) = XTcl_GlobalEval                                                                                    // tclStubInit.c:1169:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1440)) = XTcl_GlobalEvalObj                                                                                 // tclStubInit.c:1170:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1448)) = XTcl_HideCommand                                                                          // tclStubInit.c:1171:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1456)) = XTcl_Init                                                                                                   // tclStubInit.c:1172:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1464)) = XTcl_InitHashTable                                                                                         // tclStubInit.c:1173:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1472)) = XTcl_InputBlocked                                                                                       // tclStubInit.c:1174:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1480)) = XTcl_InputBuffered                                                                                      // tclStubInit.c:1175:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1488)) = XTcl_InterpDeleted                                                                                          // tclStubInit.c:1176:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1496)) = XTcl_IsSafe                                                                                                 // tclStubInit.c:1177:5:
	*(*func(*libc.TLS, int32, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1504)) = XTcl_JoinPath                                                                             // tclStubInit.c:1178:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1512)) = XTcl_LinkVar                                                                       // tclStubInit.c:1179:5:
	*(*func(*libc.TLS, ClientData, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1528)) = XTcl_MakeFileChannel                                                                        // tclStubInit.c:1181:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1536)) = XTcl_MakeSafe                                                                                               // tclStubInit.c:1182:5:
	*(*func(*libc.TLS, ClientData) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1544)) = XTcl_MakeTcpClientChannel                                                                          // tclStubInit.c:1183:5:
	*(*func(*libc.TLS, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1552)) = XTcl_Merge                                                                                         // tclStubInit.c:1184:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1560)) = XTcl_NextHashEntry                                                                                        // tclStubInit.c:1185:5:
	*(*func(*libc.TLS, Tcl_Channel, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1568)) = XTcl_NotifyChannel                                                                                     // tclStubInit.c:1186:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1576)) = XTcl_ObjGetVar2                                                                  // tclStubInit.c:1187:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1584)) = XTcl_ObjSetVar2                                                         // tclStubInit.c:1188:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1592)) = XTcl_OpenCommandChannel                                                        // tclStubInit.c:1189:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1600)) = XTcl_OpenFileChannel                                                         // tclStubInit.c:1190:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, int32, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1608)) = XTcl_OpenTcpClient                                             // tclStubInit.c:1191:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, ClientData) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1616)) = XTcl_OpenTcpServer                                               // tclStubInit.c:1192:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1624)) = XTcl_Preserve                                                                                                  // tclStubInit.c:1193:5:
	*(*func(*libc.TLS, uintptr, float64, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1632)) = XTcl_PrintDouble                                                                                // tclStubInit.c:1194:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1640)) = XTcl_PutEnv                                                                                                 // tclStubInit.c:1195:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1648)) = XTcl_PosixError                                                                                           // tclStubInit.c:1196:5:
	*(*func(*libc.TLS, uintptr, Tcl_QueuePosition))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1656)) = XTcl_QueueEvent                                                                                // tclStubInit.c:1197:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1664)) = XTcl_Read                                                                               // tclStubInit.c:1198:5:
	*(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1672)) = XTcl_ReapDetachedProcs                                                                                                     // tclStubInit.c:1199:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1680)) = XTcl_RecordAndEval                                                                          // tclStubInit.c:1200:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1688)) = XTcl_RecordAndEvalObj                                                                       // tclStubInit.c:1201:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1696)) = XTcl_RegisterChannel                                                                                 // tclStubInit.c:1202:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1704)) = XTcl_RegisterObjType                                                                                              // tclStubInit.c:1203:5:
	*(*func(*libc.TLS, uintptr, uintptr) Tcl_RegExp)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1712)) = XTcl_RegExpCompile                                                                            // tclStubInit.c:1204:5:
	*(*func(*libc.TLS, uintptr, Tcl_RegExp, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1720)) = XTcl_RegExpExec                                                               // tclStubInit.c:1205:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1728)) = XTcl_RegExpMatch                                                                          // tclStubInit.c:1206:5:
	*(*func(*libc.TLS, Tcl_RegExp, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1736)) = XTcl_RegExpRange                                                                      // tclStubInit.c:1207:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1744)) = XTcl_Release                                                                                                   // tclStubInit.c:1208:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1752)) = XTcl_ResetResult                                                                                                  // tclStubInit.c:1209:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1760)) = XTcl_ScanElement                                                                                   // tclStubInit.c:1210:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1768)) = XTcl_ScanCountedElement                                                                     // tclStubInit.c:1211:5:
	*(*func(*libc.TLS, Tcl_Channel, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1776)) = XTcl_SeekOld                                                                              // tclStubInit.c:1212:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1784)) = XTcl_ServiceAll                                                                                                      // tclStubInit.c:1213:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1792)) = XTcl_ServiceEvent                                                                                             // tclStubInit.c:1214:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1800)) = XTcl_SetAssocData                                                                   // tclStubInit.c:1215:5:
	*(*func(*libc.TLS, Tcl_Channel, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1808)) = XTcl_SetChannelBufferSize                                                                              // tclStubInit.c:1216:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1816)) = XTcl_SetChannelOption                                                        // tclStubInit.c:1217:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1824)) = XTcl_SetCommandInfo                                                                       // tclStubInit.c:1218:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1832)) = XTcl_SetErrno                                                                                                       // tclStubInit.c:1219:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1840)) = XTcl_SetErrorCode                                                                                        // tclStubInit.c:1220:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1848)) = XTcl_SetMaxBlockTime                                                                                              // tclStubInit.c:1221:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1856)) = XTcl_SetPanicProc                                                                                                 // tclStubInit.c:1222:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1864)) = XTcl_SetRecursionLimit                                                                               // tclStubInit.c:1223:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1872)) = XTcl_SetResult                                                                                  // tclStubInit.c:1224:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1880)) = XTcl_SetServiceMode                                                                                           // tclStubInit.c:1225:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1888)) = XTcl_SetObjErrorCode                                                                                     // tclStubInit.c:1226:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1896)) = XTcl_SetObjResult                                                                                        // tclStubInit.c:1227:5:
	*(*func(*libc.TLS, Tcl_Channel, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1904)) = XTcl_SetStdChannel                                                                                     // tclStubInit.c:1228:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1912)) = XTcl_SetVar                                                                      // tclStubInit.c:1229:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1920)) = XTcl_SetVar2                                                            // tclStubInit.c:1230:5:
	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1928)) = XTcl_SignalId                                                                                               // tclStubInit.c:1231:5:
	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1936)) = XTcl_SignalMsg                                                                                              // tclStubInit.c:1232:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1944)) = XTcl_SourceRCFile                                                                                                 // tclStubInit.c:1233:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1952)) = XTcl_SplitList                                                                   // tclStubInit.c:1234:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1960)) = XTcl_SplitPath                                                                                  // tclStubInit.c:1235:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1968)) = XTcl_StaticPackage                                                                     // tclStubInit.c:1236:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1976)) = XTcl_StringMatch                                                                                   // tclStubInit.c:1237:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1984)) = XTcl_TellOld                                                                                            // tclStubInit.c:1238:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1992)) = XTcl_TraceVar                                                          // tclStubInit.c:1239:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, ClientData) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2000)) = XTcl_TraceVar2                                                // tclStubInit.c:1240:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2008)) = XTcl_TranslateFileName                                                                  // tclStubInit.c:1241:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2016)) = XTcl_Ungets                                                                      // tclStubInit.c:1242:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2024)) = XTcl_UnlinkVar                                                                                           // tclStubInit.c:1243:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2032)) = XTcl_UnregisterChannel                                                                         // tclStubInit.c:1244:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2040)) = XTcl_UnsetVar                                                                               // tclStubInit.c:1245:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2048)) = XTcl_UnsetVar2                                                                     // tclStubInit.c:1246:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2056)) = XTcl_UntraceVar                                                              // tclStubInit.c:1247:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2064)) = XTcl_UntraceVar2                                                    // tclStubInit.c:1248:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2072)) = XTcl_UpdateLinkedVar                                                                                     // tclStubInit.c:1249:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2080)) = XTcl_UpVar                                                                // tclStubInit.c:1250:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2088)) = XTcl_UpVar2                                                      // tclStubInit.c:1251:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2096)) = XTcl_VarEval                                                                                       // tclStubInit.c:1252:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2104)) = XTcl_VarTraceInfo                                                 // tclStubInit.c:1253:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2112)) = XTcl_VarTraceInfo2                                       // tclStubInit.c:1254:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2120)) = XTcl_Write                                                                              // tclStubInit.c:1255:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2128)) = XTcl_WrongNumArgs                                                                        // tclStubInit.c:1256:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2136)) = XTcl_DumpActiveMemory                                                                                       // tclStubInit.c:1257:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2144)) = XTcl_ValidateAllMemory                                                                                     // tclStubInit.c:1258:5:
	*(*func(*libc.TLS, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2152)) = XTcl_AppendResultVA                                                                                      // tclStubInit.c:1259:5:
	*(*func(*libc.TLS, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2160)) = XTcl_AppendStringsToObjVA                                                                                // tclStubInit.c:1260:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2168)) = XTcl_HashStats                                                                                            // tclStubInit.c:1261:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2176)) = XTcl_ParseVar                                                                           // tclStubInit.c:1262:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2184)) = XTcl_PkgPresent                                                                  // tclStubInit.c:1263:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2192)) = XTcl_PkgPresentEx                                                       // tclStubInit.c:1264:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2200)) = XTcl_PkgProvide                                                                           // tclStubInit.c:1265:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2208)) = XTcl_PkgRequire                                                                  // tclStubInit.c:1266:5:
	*(*func(*libc.TLS, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2216)) = XTcl_SetErrorCodeVA                                                                                      // tclStubInit.c:1267:5:
	*(*func(*libc.TLS, uintptr, Va_list) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2224)) = XTcl_VarEvalVA                                                                                     // tclStubInit.c:1268:5:
	*(*func(*libc.TLS, Tcl_Pid, uintptr, int32) Tcl_Pid)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2232)) = XTcl_WaitPid                                                                              // tclStubInit.c:1269:5:
	*(*func(*libc.TLS, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2240)) = XTcl_PanicVA                                                                                             // tclStubInit.c:1270:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2248)) = XTcl_GetVersion                                                                        // tclStubInit.c:1271:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2256)) = XTcl_InitMemory                                                                                                   // tclStubInit.c:1272:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, int32, Tcl_Channel) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2264)) = XTcl_StackChannel                                            // tclStubInit.c:1273:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2272)) = XTcl_UnstackChannel                                                                            // tclStubInit.c:1274:5:
	*(*func(*libc.TLS, Tcl_Channel) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2280)) = XTcl_GetStackedChannel                                                                            // tclStubInit.c:1275:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2288)) = XTcl_SetMainLoop                                                                                                  // tclStubInit.c:1276:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2304)) = XTcl_AppendObjToObj                                                                                      // tclStubInit.c:1278:5:
	*(*func(*libc.TLS, uintptr) Tcl_Encoding)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2312)) = XTcl_CreateEncoding                                                                                  // tclStubInit.c:1279:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2320)) = XTcl_CreateThreadExitHandler                                                                          // tclStubInit.c:1280:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2328)) = XTcl_DeleteThreadExitHandler                                                                          // tclStubInit.c:1281:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2336)) = XTcl_DiscardResult                                                                                                // tclStubInit.c:1282:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2344)) = XTcl_EvalEx                                                                          // tclStubInit.c:1283:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2352)) = XTcl_EvalObjv                                                                        // tclStubInit.c:1284:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2360)) = XTcl_EvalObjEx                                                                              // tclStubInit.c:1285:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2368)) = XTcl_ExitThread                                                                                                     // tclStubInit.c:1286:5:
	*(*func(*libc.TLS, uintptr, Tcl_Encoding, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2376)) = XTcl_ExternalToUtf // tclStubInit.c:1287:5:
	*(*func(*libc.TLS, Tcl_Encoding, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2384)) = XTcl_ExternalToUtfDString                                                   // tclStubInit.c:1288:5:
	*(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2392)) = XTcl_FinalizeThread                                                                                                        // tclStubInit.c:1289:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2400)) = XTcl_FinalizeNotifier                                                                                          // tclStubInit.c:1290:5:
	*(*func(*libc.TLS, Tcl_Encoding))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2408)) = XTcl_FreeEncoding                                                                                            // tclStubInit.c:1291:5:
	*(*func(*libc.TLS) Tcl_ThreadId)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2416)) = XTcl_GetCurrentThread                                                                                         // tclStubInit.c:1292:5:
	*(*func(*libc.TLS, uintptr, uintptr) Tcl_Encoding)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2424)) = XTcl_GetEncoding                                                                            // tclStubInit.c:1293:5:
	*(*func(*libc.TLS, Tcl_Encoding) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2432)) = XTcl_GetEncodingName                                                                                 // tclStubInit.c:1294:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2440)) = XTcl_GetEncodingNames                                                                                             // tclStubInit.c:1295:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2448)) = XTcl_GetIndexFromObjStruct                                // tclStubInit.c:1296:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2456)) = XTcl_GetThreadData                                                                                 // tclStubInit.c:1297:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2464)) = XTcl_GetVar2Ex                                                                   // tclStubInit.c:1298:5:
	*(*func(*libc.TLS) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2472)) = XTcl_InitNotifier                                                                                               // tclStubInit.c:1299:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2480)) = XTcl_MutexLock                                                                                                    // tclStubInit.c:1300:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2488)) = XTcl_MutexUnlock                                                                                                  // tclStubInit.c:1301:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2496)) = XTcl_ConditionNotify                                                                                              // tclStubInit.c:1302:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2504)) = XTcl_ConditionWait                                                                              // tclStubInit.c:1303:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2512)) = XTcl_NumUtfChars                                                                                     // tclStubInit.c:1304:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2520)) = XTcl_ReadChars                                                                   // tclStubInit.c:1305:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2528)) = XTcl_RestoreResult                                                                                       // tclStubInit.c:1306:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2536)) = XTcl_SaveResult                                                                                          // tclStubInit.c:1307:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2544)) = XTcl_SetSystemEncoding                                                                             // tclStubInit.c:1308:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2552)) = XTcl_SetVar2Ex                                                          // tclStubInit.c:1309:5:
	*(*func(*libc.TLS, Tcl_ThreadId))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2560)) = XTcl_ThreadAlert                                                                                             // tclStubInit.c:1310:5:
	*(*func(*libc.TLS, Tcl_ThreadId, uintptr, Tcl_QueuePosition))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2568)) = XTcl_ThreadQueueEvent                                                            // tclStubInit.c:1311:5:
	*(*func(*libc.TLS, uintptr, int32) Tcl_UniChar)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2576)) = XTcl_UniCharAtIndex                                                                            // tclStubInit.c:1312:5:
	*(*func(*libc.TLS, int32) Tcl_UniChar)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2584)) = XTcl_UniCharToLower                                                                                     // tclStubInit.c:1313:5:
	*(*func(*libc.TLS, int32) Tcl_UniChar)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2592)) = XTcl_UniCharToTitle                                                                                     // tclStubInit.c:1314:5:
	*(*func(*libc.TLS, int32) Tcl_UniChar)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2600)) = XTcl_UniCharToUpper                                                                                     // tclStubInit.c:1315:5:
	*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2608)) = XTcl_UniCharToUtf                                                                                    // tclStubInit.c:1316:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2616)) = XTcl_UtfAtIndex                                                                                    // tclStubInit.c:1317:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2624)) = XTcl_UtfCharComplete                                                                                 // tclStubInit.c:1318:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2632)) = XTcl_UtfBackslash                                                                         // tclStubInit.c:1319:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2640)) = XTcl_UtfFindFirst                                                                                  // tclStubInit.c:1320:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2648)) = XTcl_UtfFindLast                                                                                   // tclStubInit.c:1321:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2656)) = XTcl_UtfNext                                                                                              // tclStubInit.c:1322:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2664)) = XTcl_UtfPrev                                                                                     // tclStubInit.c:1323:5:
	*(*func(*libc.TLS, uintptr, Tcl_Encoding, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2672)) = XTcl_UtfToExternal // tclStubInit.c:1324:5:
	*(*func(*libc.TLS, Tcl_Encoding, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2680)) = XTcl_UtfToExternalDString                                                   // tclStubInit.c:1325:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2688)) = XTcl_UtfToLower                                                                                             // tclStubInit.c:1326:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2696)) = XTcl_UtfToTitle                                                                                             // tclStubInit.c:1327:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2704)) = XTcl_UtfToUniChar                                                                                  // tclStubInit.c:1328:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2712)) = XTcl_UtfToUpper                                                                                             // tclStubInit.c:1329:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2720)) = XTcl_WriteChars                                                                         // tclStubInit.c:1330:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2728)) = XTcl_WriteObj                                                                                  // tclStubInit.c:1331:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2736)) = XTcl_GetString                                                                                            // tclStubInit.c:1332:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2744)) = XTcl_GetDefaultEncodingDir                                                                                         // tclStubInit.c:1333:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2752)) = XTcl_SetDefaultEncodingDir                                                                                        // tclStubInit.c:1334:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2760)) = XTcl_AlertNotifier                                                                                             // tclStubInit.c:1335:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2768)) = XTcl_ServiceModeHook                                                                                                // tclStubInit.c:1336:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2776)) = XTcl_UniCharIsAlnum                                                                                           // tclStubInit.c:1337:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2784)) = XTcl_UniCharIsAlpha                                                                                           // tclStubInit.c:1338:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2792)) = XTcl_UniCharIsDigit                                                                                           // tclStubInit.c:1339:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2800)) = XTcl_UniCharIsLower                                                                                           // tclStubInit.c:1340:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2808)) = XTcl_UniCharIsSpace                                                                                           // tclStubInit.c:1341:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2816)) = XTcl_UniCharIsUpper                                                                                           // tclStubInit.c:1342:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2824)) = XTcl_UniCharIsWordChar                                                                                        // tclStubInit.c:1343:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2832)) = XTcl_UniCharLen                                                                                             // tclStubInit.c:1344:5:
	*(*func(*libc.TLS, uintptr, uintptr, uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2840)) = XTcl_UniCharNcmp                                                                           // tclStubInit.c:1345:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2848)) = XTcl_UniCharToUtfDString                                                                  // tclStubInit.c:1346:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2856)) = XTcl_UtfToUniCharDString                                                                  // tclStubInit.c:1347:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) Tcl_RegExp)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2864)) = XTcl_GetRegExpFromObj                                                                  // tclStubInit.c:1348:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2872)) = XTcl_EvalTokens                                                                           // tclStubInit.c:1349:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2880)) = XTcl_FreeParse                                                                                                    // tclStubInit.c:1350:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2888)) = XTcl_LogCommandInfo                                                                      // tclStubInit.c:1351:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2896)) = XTcl_ParseBraces                                                   // tclStubInit.c:1352:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2904)) = XTcl_ParseCommand                                                           // tclStubInit.c:1353:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2912)) = XTcl_ParseExpr                                                                     // tclStubInit.c:1354:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2920)) = XTcl_ParseQuotedString                                             // tclStubInit.c:1355:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2928)) = XTcl_ParseVarName                                                           // tclStubInit.c:1356:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2936)) = XTcl_GetCwd                                                                                      // tclStubInit.c:1357:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2944)) = XTcl_Chdir                                                                                                  // tclStubInit.c:1358:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2952)) = XTcl_Access                                                                                          // tclStubInit.c:1359:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2960)) = XTcl_Stat                                                                                          // tclStubInit.c:1360:5:
	*(*func(*libc.TLS, uintptr, uintptr, uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2968)) = XTcl_UtfNcmp                                                                               // tclStubInit.c:1361:5:
	*(*func(*libc.TLS, uintptr, uintptr, uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2976)) = XTcl_UtfNcasecmp                                                                           // tclStubInit.c:1362:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2984)) = XTcl_StringCaseMatch                                                                        // tclStubInit.c:1363:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2992)) = XTcl_UniCharIsControl                                                                                         // tclStubInit.c:1364:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3000)) = XTcl_UniCharIsGraph                                                                                           // tclStubInit.c:1365:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3008)) = XTcl_UniCharIsPrint                                                                                           // tclStubInit.c:1366:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3016)) = XTcl_UniCharIsPunct                                                                                           // tclStubInit.c:1367:5:
	*(*func(*libc.TLS, uintptr, Tcl_RegExp, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3024)) = XTcl_RegExpExecObj                                                // tclStubInit.c:1368:5:
	*(*func(*libc.TLS, Tcl_RegExp, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3032)) = XTcl_RegExpGetInfo                                                                                    // tclStubInit.c:1369:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3040)) = XTcl_NewUnicodeObj                                                                                 // tclStubInit.c:1370:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3048)) = XTcl_SetUnicodeObj                                                                                // tclStubInit.c:1371:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3056)) = XTcl_GetCharLength                                                                                          // tclStubInit.c:1372:5:
	*(*func(*libc.TLS, uintptr, int32) Tcl_UniChar)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3064)) = XTcl_GetUniChar                                                                                // tclStubInit.c:1373:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3072)) = XTcl_GetUnicode                                                                                           // tclStubInit.c:1374:5:
	*(*func(*libc.TLS, uintptr, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3080)) = XTcl_GetRange                                                                               // tclStubInit.c:1375:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3088)) = XTcl_AppendUnicodeToObj                                                                           // tclStubInit.c:1376:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3096)) = XTcl_RegExpMatchObj                                                                       // tclStubInit.c:1377:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3104)) = XTcl_SetNotifier                                                                                                  // tclStubInit.c:1378:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3112)) = XTcl_GetAllocMutex                                                                                                 // tclStubInit.c:1379:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3120)) = XTcl_GetChannelNames                                                                                        // tclStubInit.c:1380:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3128)) = XTcl_GetChannelNamesEx                                                                             // tclStubInit.c:1381:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3136)) = XTcl_ProcObjCmd                                                                 // tclStubInit.c:1382:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3144)) = XTcl_ConditionFinalize                                                                                            // tclStubInit.c:1383:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3152)) = XTcl_MutexFinalize                                                                                                // tclStubInit.c:1384:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3160)) = XTcl_CreateThread                                                        // tclStubInit.c:1385:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3168)) = XTcl_ReadRaw                                                                            // tclStubInit.c:1386:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3176)) = XTcl_WriteRaw                                                                           // tclStubInit.c:1387:5:
	*(*func(*libc.TLS, Tcl_Channel) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3184)) = XTcl_GetTopChannel                                                                                // tclStubInit.c:1388:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3192)) = XTcl_ChannelBuffered                                                                                    // tclStubInit.c:1389:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3200)) = XTcl_ChannelName                                                                                          // tclStubInit.c:1390:5:
	*(*func(*libc.TLS, uintptr) Tcl_ChannelTypeVersion)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3208)) = XTcl_ChannelVersion                                                                        // tclStubInit.c:1391:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3216)) = XTcl_ChannelBlockModeProc                                                                                 // tclStubInit.c:1392:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3224)) = XTcl_ChannelCloseProc                                                                                     // tclStubInit.c:1393:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3232)) = XTcl_ChannelClose2Proc                                                                                    // tclStubInit.c:1394:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3240)) = XTcl_ChannelInputProc                                                                                     // tclStubInit.c:1395:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3248)) = XTcl_ChannelOutputProc                                                                                    // tclStubInit.c:1396:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3256)) = XTcl_ChannelSeekProc                                                                                      // tclStubInit.c:1397:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3264)) = XTcl_ChannelSetOptionProc                                                                                 // tclStubInit.c:1398:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3272)) = XTcl_ChannelGetOptionProc                                                                                 // tclStubInit.c:1399:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3280)) = XTcl_ChannelWatchProc                                                                                     // tclStubInit.c:1400:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3288)) = XTcl_ChannelGetHandleProc                                                                                 // tclStubInit.c:1401:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3296)) = XTcl_ChannelFlushProc                                                                                     // tclStubInit.c:1402:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3304)) = XTcl_ChannelHandlerProc                                                                                   // tclStubInit.c:1403:5:
	*(*func(*libc.TLS, Tcl_ThreadId, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3312)) = XTcl_JoinThread                                                                               // tclStubInit.c:1404:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3320)) = XTcl_IsChannelShared                                                                                    // tclStubInit.c:1405:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3328)) = XTcl_IsChannelRegistered                                                                       // tclStubInit.c:1406:5:
	*(*func(*libc.TLS, Tcl_Channel))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3336)) = XTcl_CutChannel                                                                                               // tclStubInit.c:1407:5:
	*(*func(*libc.TLS, Tcl_Channel))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3344)) = XTcl_SpliceChannel                                                                                            // tclStubInit.c:1408:5:
	*(*func(*libc.TLS, Tcl_Channel))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3352)) = XTcl_ClearChannelHandlers                                                                                     // tclStubInit.c:1409:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3360)) = XTcl_IsChannelExisting                                                                                      // tclStubInit.c:1410:5:
	*(*func(*libc.TLS, uintptr, uintptr, uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3368)) = XTcl_UniCharNcasecmp                                                                       // tclStubInit.c:1411:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3376)) = XTcl_UniCharCaseMatch                                                                       // tclStubInit.c:1412:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3384)) = XTcl_FindHashEntry                                                                               // tclStubInit.c:1413:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3392)) = XTcl_CreateHashEntry                                                                    // tclStubInit.c:1414:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3400)) = XTcl_InitCustomHashTable                                                                          // tclStubInit.c:1415:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3408)) = XTcl_InitObjHashTable                                                                                             // tclStubInit.c:1416:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3416)) = XTcl_CommandTraceInfo                                             // tclStubInit.c:1417:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3424)) = XTcl_TraceCommand                                                      // tclStubInit.c:1418:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3432)) = XTcl_UntraceCommand                                                          // tclStubInit.c:1419:5:
	*(*func(*libc.TLS, uint32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3440)) = XTcl_AttemptAlloc                                                                                          // tclStubInit.c:1420:5:
	*(*func(*libc.TLS, uint32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3448)) = XTcl_AttemptDbCkalloc                                                                      // tclStubInit.c:1421:5:
	*(*func(*libc.TLS, uintptr, uint32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3456)) = XTcl_AttemptRealloc                                                                               // tclStubInit.c:1422:5:
	*(*func(*libc.TLS, uintptr, uint32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3464)) = XTcl_AttemptDbCkrealloc                                                           // tclStubInit.c:1423:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3472)) = XTcl_AttemptSetObjLength                                                                             // tclStubInit.c:1424:5:
	*(*func(*libc.TLS, Tcl_Channel) Tcl_ThreadId)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3480)) = XTcl_GetChannelThread                                                                            // tclStubInit.c:1425:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3488)) = XTcl_GetUnicodeFromObj                                                                           // tclStubInit.c:1426:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3496)) = XTcl_GetMathFuncInfo                                           // tclStubInit.c:1427:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3504)) = XTcl_ListMathFuncs                                                                               // tclStubInit.c:1428:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3512)) = XTcl_SubstObj                                                                             // tclStubInit.c:1429:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3520)) = XTcl_DetachChannel                                                                             // tclStubInit.c:1430:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3528)) = XTcl_IsStandardChannel                                                                                  // tclStubInit.c:1431:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3536)) = XTcl_FSCopyFile                                                                                    // tclStubInit.c:1432:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3544)) = XTcl_FSCopyDirectory                                                                      // tclStubInit.c:1433:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3552)) = XTcl_FSCreateDirectory                                                                                      // tclStubInit.c:1434:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3560)) = XTcl_FSDeleteFile                                                                                           // tclStubInit.c:1435:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3568)) = XTcl_FSLoadFile                              // tclStubInit.c:1436:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3576)) = XTcl_FSMatchInDirectory                                                 // tclStubInit.c:1437:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3584)) = XTcl_FSLink                                                                               // tclStubInit.c:1438:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3592)) = XTcl_FSRemoveDirectory                                                                      // tclStubInit.c:1439:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3600)) = XTcl_FSRenameFile                                                                                  // tclStubInit.c:1440:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3608)) = XTcl_FSLstat                                                                                       // tclStubInit.c:1441:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3616)) = XTcl_FSUtime                                                                                       // tclStubInit.c:1442:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3624)) = XTcl_FSFileAttrsGet                                                                // tclStubInit.c:1443:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3632)) = XTcl_FSFileAttrsSet                                                                // tclStubInit.c:1444:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3640)) = XTcl_FSFileAttrStrings                                                                           // tclStubInit.c:1445:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3648)) = XTcl_FSStat                                                                                        // tclStubInit.c:1446:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3656)) = XTcl_FSAccess                                                                                        // tclStubInit.c:1447:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3664)) = XTcl_FSOpenFileChannel                                                       // tclStubInit.c:1448:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3672)) = XTcl_FSGetCwd                                                                                             // tclStubInit.c:1449:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3680)) = XTcl_FSChdir                                                                                                // tclStubInit.c:1450:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3688)) = XTcl_FSConvertToPathType                                                                           // tclStubInit.c:1451:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3696)) = XTcl_FSJoinPath                                                                                    // tclStubInit.c:1452:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3704)) = XTcl_FSSplitPath                                                                                 // tclStubInit.c:1453:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3712)) = XTcl_FSEqualPaths                                                                                  // tclStubInit.c:1454:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3720)) = XTcl_FSGetNormalizedPath                                                                         // tclStubInit.c:1455:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3728)) = XTcl_FSJoinToPath                                                                         // tclStubInit.c:1456:5:
	*(*func(*libc.TLS, uintptr, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3736)) = XTcl_FSGetInternalRep                                                                         // tclStubInit.c:1457:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3744)) = XTcl_FSGetTranslatedPath                                                                         // tclStubInit.c:1458:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3752)) = XTcl_FSEvalFile                                                                                    // tclStubInit.c:1459:5:
	*(*func(*libc.TLS, uintptr, ClientData) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3760)) = XTcl_FSNewNativePath                                                                          // tclStubInit.c:1460:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3768)) = XTcl_FSGetNativePath                                                                                      // tclStubInit.c:1461:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3776)) = XTcl_FSFileSystemInfo                                                                                     // tclStubInit.c:1462:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3784)) = XTcl_FSPathSeparator                                                                                      // tclStubInit.c:1463:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3792)) = XTcl_FSListVolumes                                                                                                 // tclStubInit.c:1464:5:
	*(*func(*libc.TLS, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3800)) = XTcl_FSRegister                                                                                 // tclStubInit.c:1465:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3808)) = XTcl_FSUnregister                                                                                           // tclStubInit.c:1466:5:
	*(*func(*libc.TLS, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3816)) = XTcl_FSData                                                                                            // tclStubInit.c:1467:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3824)) = XTcl_FSGetTranslatedStringPath                                                                   // tclStubInit.c:1468:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3832)) = XTcl_FSGetFileSystemForPath                                                                               // tclStubInit.c:1469:5:
	*(*func(*libc.TLS, uintptr) Tcl_PathType)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3840)) = XTcl_FSGetPathType                                                                                   // tclStubInit.c:1470:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3848)) = XTcl_OutputBuffered                                                                                     // tclStubInit.c:1471:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3856)) = XTcl_FSMountsChanged                                                                                              // tclStubInit.c:1472:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3864)) = XTcl_EvalTokensStandard                                                                     // tclStubInit.c:1473:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3872)) = XTcl_GetTime                                                                                                      // tclStubInit.c:1474:5:
	*(*func(*libc.TLS, uintptr, int32, int32, uintptr, ClientData, uintptr) Tcl_Trace)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3880)) = XTcl_CreateObjTrace                                         // tclStubInit.c:1475:5:
	*(*func(*libc.TLS, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3888)) = XTcl_GetCommandInfoFromToken                                                                   // tclStubInit.c:1476:5:
	*(*func(*libc.TLS, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3896)) = XTcl_SetCommandInfoFromToken                                                                   // tclStubInit.c:1477:5:
	*(*func(*libc.TLS, Tcl_WideInt, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3904)) = XTcl_DbNewWideIntObj                                                                  // tclStubInit.c:1478:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3912)) = XTcl_GetWideIntFromObj                                                                    // tclStubInit.c:1479:5:
	*(*func(*libc.TLS, Tcl_WideInt) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3920)) = XTcl_NewWideIntObj                                                                                    // tclStubInit.c:1480:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideInt))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3928)) = XTcl_SetWideIntObj                                                                                   // tclStubInit.c:1481:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3936)) = XTcl_AllocStatBuf                                                                                                  // tclStubInit.c:1482:5:
	*(*func(*libc.TLS, Tcl_Channel, Tcl_WideInt, int32) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3944)) = XTcl_Seek                                                                     // tclStubInit.c:1483:5:
	*(*func(*libc.TLS, Tcl_Channel) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3952)) = XTcl_Tell                                                                                         // tclStubInit.c:1484:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3960)) = XTcl_ChannelWideSeekProc                                                                                  // tclStubInit.c:1485:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3968)) = XTcl_DictObjPut                                                                  // tclStubInit.c:1486:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3976)) = XTcl_DictObjGet                                                                  // tclStubInit.c:1487:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3984)) = XTcl_DictObjRemove                                                                        // tclStubInit.c:1488:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3992)) = XTcl_DictObjSize                                                                          // tclStubInit.c:1489:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4000)) = XTcl_DictObjFirst                                              // tclStubInit.c:1490:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4008)) = XTcl_DictObjNext                                                                       // tclStubInit.c:1491:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4016)) = XTcl_DictObjDone                                                                                                  // tclStubInit.c:1492:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4024)) = XTcl_DictObjPutKeyList                                                    // tclStubInit.c:1493:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4032)) = XTcl_DictObjRemoveKeyList                                                          // tclStubInit.c:1494:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4040)) = XTcl_NewDictObj                                                                                                    // tclStubInit.c:1495:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4048)) = XTcl_DbNewDictObj                                                                                  // tclStubInit.c:1496:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4056)) = XTcl_RegisterConfig                                                                    // tclStubInit.c:1497:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4064)) = XTcl_CreateNamespace                                                        // tclStubInit.c:1498:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4072)) = XTcl_DeleteNamespace                                                                                              // tclStubInit.c:1499:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4080)) = XTcl_AppendExportList                                                                     // tclStubInit.c:1500:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4088)) = XTcl_Export                                                                        // tclStubInit.c:1501:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4096)) = XTcl_Import                                                                        // tclStubInit.c:1502:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4104)) = XTcl_ForgetImport                                                                         // tclStubInit.c:1503:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4112)) = XTcl_GetCurrentNamespace                                                                                  // tclStubInit.c:1504:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4120)) = XTcl_GetGlobalNamespace                                                                                   // tclStubInit.c:1505:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4128)) = XTcl_FindNamespace                                                               // tclStubInit.c:1506:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4136)) = XTcl_FindCommand                                                             // tclStubInit.c:1507:5:
	*(*func(*libc.TLS, uintptr, uintptr) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4144)) = XTcl_GetCommandFromObj                                                                       // tclStubInit.c:1508:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4152)) = XTcl_GetCommandFullName                                                                     // tclStubInit.c:1509:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4160)) = XTcl_FSEvalFileEx                                                                         // tclStubInit.c:1510:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4168)) = XTcl_SetExitProc                                                                                          // tclStubInit.c:1511:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, ClientData, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4176)) = XTcl_LimitAddHandler                                                         // tclStubInit.c:1512:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4184)) = XTcl_LimitRemoveHandler                                                               // tclStubInit.c:1513:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4192)) = XTcl_LimitReady                                                                                             // tclStubInit.c:1514:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4200)) = XTcl_LimitCheck                                                                                             // tclStubInit.c:1515:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4208)) = XTcl_LimitExceeded                                                                                          // tclStubInit.c:1516:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4216)) = XTcl_LimitSetCommands                                                                                      // tclStubInit.c:1517:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4224)) = XTcl_LimitSetTime                                                                                        // tclStubInit.c:1518:5:
	*(*func(*libc.TLS, uintptr, int32, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4232)) = XTcl_LimitSetGranularity                                                                            // tclStubInit.c:1519:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4240)) = XTcl_LimitTypeEnabled                                                                                // tclStubInit.c:1520:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4248)) = XTcl_LimitTypeExceeded                                                                               // tclStubInit.c:1521:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4256)) = XTcl_LimitTypeSet                                                                                          // tclStubInit.c:1522:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4264)) = XTcl_LimitTypeReset                                                                                        // tclStubInit.c:1523:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4272)) = XTcl_LimitGetCommands                                                                                       // tclStubInit.c:1524:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4280)) = XTcl_LimitGetTime                                                                                        // tclStubInit.c:1525:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4288)) = XTcl_LimitGetGranularity                                                                             // tclStubInit.c:1526:5:
	*(*func(*libc.TLS, uintptr, int32) Tcl_InterpState)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4296)) = XTcl_SaveInterpState                                                                       // tclStubInit.c:1527:5:
	*(*func(*libc.TLS, uintptr, Tcl_InterpState) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4304)) = XTcl_RestoreInterpState                                                                    // tclStubInit.c:1528:5:
	*(*func(*libc.TLS, Tcl_InterpState))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4312)) = XTcl_DiscardInterpState                                                                                   // tclStubInit.c:1529:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4320)) = XTcl_SetReturnOptions                                                                              // tclStubInit.c:1530:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4328)) = XTcl_GetReturnOptions                                                                              // tclStubInit.c:1531:5:
	*(*func(*libc.TLS, Tcl_Command) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4336)) = XTcl_IsEnsemble                                                                                         // tclStubInit.c:1532:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4344)) = XTcl_CreateEnsemble                                                          // tclStubInit.c:1533:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4352)) = XTcl_FindEnsemble                                                                     // tclStubInit.c:1534:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4360)) = XTcl_SetEnsembleSubcommandList                                                        // tclStubInit.c:1535:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4368)) = XTcl_SetEnsembleMappingDict                                                           // tclStubInit.c:1536:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4376)) = XTcl_SetEnsembleUnknownHandler                                                        // tclStubInit.c:1537:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4384)) = XTcl_SetEnsembleFlags                                                                   // tclStubInit.c:1538:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4392)) = XTcl_GetEnsembleSubcommandList                                                        // tclStubInit.c:1539:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4400)) = XTcl_GetEnsembleMappingDict                                                           // tclStubInit.c:1540:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4408)) = XTcl_GetEnsembleUnknownHandler                                                        // tclStubInit.c:1541:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4416)) = XTcl_GetEnsembleFlags                                                                 // tclStubInit.c:1542:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4424)) = XTcl_GetEnsembleNamespace                                                             // tclStubInit.c:1543:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4432)) = XTcl_SetTimeProc                                                                             // tclStubInit.c:1544:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4440)) = XTcl_QueryTimeProc                                                                              // tclStubInit.c:1545:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4448)) = XTcl_ChannelThreadActionProc                                                                              // tclStubInit.c:1546:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4456)) = XTcl_NewBignumObj                                                                                         // tclStubInit.c:1547:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4464)) = XTcl_DbNewBignumObj                                                                       // tclStubInit.c:1548:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4472)) = XTcl_SetBignumObj                                                                                        // tclStubInit.c:1549:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4480)) = XTcl_GetBignumFromObj                                                                     // tclStubInit.c:1550:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4488)) = XTcl_TakeBignumFromObj                                                                    // tclStubInit.c:1551:5:
	*(*func(*libc.TLS, Tcl_Channel, Tcl_WideInt) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4496)) = XTcl_TruncateChannel                                                                       // tclStubInit.c:1552:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4504)) = XTcl_ChannelTruncateProc                                                                                  // tclStubInit.c:1553:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4512)) = XTcl_SetChannelErrorInterp                                                                               // tclStubInit.c:1554:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4520)) = XTcl_GetChannelErrorInterp                                                                               // tclStubInit.c:1555:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4528)) = XTcl_SetChannelError                                                                                 // tclStubInit.c:1556:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4536)) = XTcl_GetChannelError                                                                                 // tclStubInit.c:1557:5:
	*(*func(*libc.TLS, uintptr, float64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4544)) = XTcl_InitBignumFromDouble                                                                 // tclStubInit.c:1558:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4552)) = XTcl_GetNamespaceUnknownHandler                                                                  // tclStubInit.c:1559:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4560)) = XTcl_SetNamespaceUnknownHandler                                                           // tclStubInit.c:1560:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4568)) = XTcl_GetEncodingFromObj                                                                   // tclStubInit.c:1561:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4576)) = XTcl_GetEncodingSearchPath                                                                                         // tclStubInit.c:1562:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4584)) = XTcl_SetEncodingSearchPath                                                                                  // tclStubInit.c:1563:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4592)) = XTcl_GetEncodingNameFromEnvironment                                                                       // tclStubInit.c:1564:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4600)) = XTcl_PkgRequireProc                                                       // tclStubInit.c:1565:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4608)) = XTcl_AppendObjToErrorInfo                                                                                // tclStubInit.c:1566:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4616)) = XTcl_AppendLimitedToObj                                                           // tclStubInit.c:1567:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4624)) = XTcl_Format                                                                      // tclStubInit.c:1568:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4632)) = XTcl_AppendFormatToObj                                                    // tclStubInit.c:1569:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4640)) = XTcl_ObjPrintf                                                                                   // tclStubInit.c:1570:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4648)) = XTcl_AppendPrintfToObj                                                                          // tclStubInit.c:1571:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4656)) = XTcl_CancelEval                                                                 // tclStubInit.c:1572:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4664)) = XTcl_Canceled                                                                                        // tclStubInit.c:1573:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4672)) = XTcl_CreatePipe                                                                    // tclStubInit.c:1574:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, ClientData, uintptr) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4680)) = XTcl_NRCreateCommand                                  // tclStubInit.c:1575:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4688)) = XTcl_NREvalObj                                                                              // tclStubInit.c:1576:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4696)) = XTcl_NREvalObjv                                                                      // tclStubInit.c:1577:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4704)) = XTcl_NRCmdSwap                                                          // tclStubInit.c:1578:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, ClientData, ClientData, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4712)) = XTcl_NRAddCallback                                       // tclStubInit.c:1579:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4720)) = XTcl_NRCallObjProc                                                     // tclStubInit.c:1580:5:
	*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4728)) = XTcl_GetFSDeviceFromStat                                                                                   // tclStubInit.c:1581:5:
	*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4736)) = XTcl_GetFSInodeFromStat                                                                                    // tclStubInit.c:1582:5:
	*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4744)) = XTcl_GetModeFromStat                                                                                       // tclStubInit.c:1583:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4752)) = XTcl_GetLinkCountFromStat                                                                                   // tclStubInit.c:1584:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4760)) = XTcl_GetUserIdFromStat                                                                                      // tclStubInit.c:1585:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4768)) = XTcl_GetGroupIdFromStat                                                                                     // tclStubInit.c:1586:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4776)) = XTcl_GetDeviceTypeFromStat                                                                                  // tclStubInit.c:1587:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4784)) = XTcl_GetAccessTimeFromStat                                                                            // tclStubInit.c:1588:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4792)) = XTcl_GetModificationTimeFromStat                                                                      // tclStubInit.c:1589:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4800)) = XTcl_GetChangeTimeFromStat                                                                            // tclStubInit.c:1590:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideUInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4808)) = XTcl_GetSizeFromStat                                                                                 // tclStubInit.c:1591:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideUInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4816)) = XTcl_GetBlocksFromStat                                                                               // tclStubInit.c:1592:5:
	*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4824)) = XTcl_GetBlockSizeFromStat                                                                                  // tclStubInit.c:1593:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4832)) = XTcl_SetEnsembleParameterList                                                         // tclStubInit.c:1594:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4840)) = XTcl_GetEnsembleParameterList                                                         // tclStubInit.c:1595:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4848)) = XTcl_ParseArgsObjv                                                      // tclStubInit.c:1596:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4856)) = XTcl_GetErrorLine                                                                                           // tclStubInit.c:1597:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4864)) = XTcl_SetErrorLine                                                                                          // tclStubInit.c:1598:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4872)) = XTcl_TransferResult                                                                               // tclStubInit.c:1599:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4880)) = XTcl_InterpActive                                                                                           // tclStubInit.c:1600:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4888)) = XTcl_BackgroundException                                                                                   // tclStubInit.c:1601:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4896)) = XTcl_ZlibDeflate                                                            // tclStubInit.c:1602:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4904)) = XTcl_ZlibInflate                                                            // tclStubInit.c:1603:5:
	*(*func(*libc.TLS, uint32, uintptr, int32) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4912)) = XTcl_ZlibCRC32                                                                              // tclStubInit.c:1604:5:
	*(*func(*libc.TLS, uint32, uintptr, int32) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4920)) = XTcl_ZlibAdler32                                                                            // tclStubInit.c:1605:5:
	*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4928)) = XTcl_ZlibStreamInit                                                  // tclStubInit.c:1606:5:
	*(*func(*libc.TLS, Tcl_ZlibStream) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4936)) = XTcl_ZlibStreamGetCommandName                                                                      // tclStubInit.c:1607:5:
	*(*func(*libc.TLS, Tcl_ZlibStream) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4944)) = XTcl_ZlibStreamEof                                                                                   // tclStubInit.c:1608:5:
	*(*func(*libc.TLS, Tcl_ZlibStream) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4952)) = XTcl_ZlibStreamChecksum                                                                              // tclStubInit.c:1609:5:
	*(*func(*libc.TLS, Tcl_ZlibStream, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4960)) = XTcl_ZlibStreamPut                                                                   // tclStubInit.c:1610:5:
	*(*func(*libc.TLS, Tcl_ZlibStream, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4968)) = XTcl_ZlibStreamGet                                                                   // tclStubInit.c:1611:5:
	*(*func(*libc.TLS, Tcl_ZlibStream) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4976)) = XTcl_ZlibStreamClose                                                                                 // tclStubInit.c:1612:5:
	*(*func(*libc.TLS, Tcl_ZlibStream) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4984)) = XTcl_ZlibStreamReset                                                                                 // tclStubInit.c:1613:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4992)) = XTcl_SetStartupScript                                                                                    // tclStubInit.c:1614:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5000)) = XTcl_GetStartupScript                                                                                     // tclStubInit.c:1615:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5008)) = XTcl_CloseEx                                                                            // tclStubInit.c:1616:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5016)) = XTcl_NRExprObj                                                                            // tclStubInit.c:1617:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5024)) = XTcl_NRSubstObj                                                                             // tclStubInit.c:1618:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5032)) = XTcl_LoadFile                                                    // tclStubInit.c:1619:5:
	*(*func(*libc.TLS, uintptr, Tcl_LoadHandle, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5040)) = XTcl_FindSymbol                                                                  // tclStubInit.c:1620:5:
	*(*func(*libc.TLS, uintptr, Tcl_LoadHandle) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5048)) = XTcl_FSUnloadFile                                                                           // tclStubInit.c:1621:5:
	*(*func(*libc.TLS, Tcl_ZlibStream, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5056)) = XTcl_ZlibStreamSetCompressionDictionary                                                           // tclStubInit.c:1622:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 8 /* .hooks */)) = uintptr(unsafe.Pointer(&tclStubHooks))                                                                                   // tclStubInit.c:967:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 16)) = XTcl_PkgProvideEx                                                                  // tclStubInit.c:968:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 24)) = XTcl_PkgRequireEx                                                         // tclStubInit.c:969:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 32)) = XTcl_Panic                                                                                                 // tclStubInit.c:970:5:
	*(*func(*libc.TLS, uint32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 40)) = XTcl_Alloc                                                                                                   // tclStubInit.c:971:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 48)) = XTcl_Free                                                                                                           // tclStubInit.c:972:5:
	*(*func(*libc.TLS, uintptr, uint32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 56)) = XTcl_Realloc                                                                                        // tclStubInit.c:973:5:
	*(*func(*libc.TLS, uint32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 64)) = XTcl_DbCkalloc                                                                               // tclStubInit.c:974:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 72)) = XTcl_DbCkfree                                                                                       // tclStubInit.c:975:5:
	*(*func(*libc.TLS, uintptr, uint32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 80)) = XTcl_DbCkrealloc                                                                    // tclStubInit.c:976:5:
	*(*func(*libc.TLS, int32, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 88)) = XTcl_CreateFileHandler                                                                    // tclStubInit.c:978:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 96)) = XTcl_DeleteFileHandler                                                                                                // tclStubInit.c:987:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 104)) = XTcl_SetTimer                                                                                                      // tclStubInit.c:995:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 112)) = XTcl_Sleep                                                                                                           // tclStubInit.c:996:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 120)) = XTcl_WaitForEvent                                                                                            // tclStubInit.c:997:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 128)) = XTcl_AppendAllObjTypes                                                                              // tclStubInit.c:998:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 136)) = XTcl_AppendStringsToObj                                                                                   // tclStubInit.c:999:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 144)) = XTcl_AppendToObj                                                                                   // tclStubInit.c:1000:5:
	*(*func(*libc.TLS, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 152)) = XTcl_ConcatObj                                                                                      // tclStubInit.c:1001:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 160)) = XTcl_ConvertToType                                                                         // tclStubInit.c:1002:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 168)) = XTcl_DbDecrRefCount                                                                                // tclStubInit.c:1003:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 176)) = XTcl_DbIncrRefCount                                                                                // tclStubInit.c:1004:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 184)) = XTcl_DbIsShared                                                                              // tclStubInit.c:1005:5:
	*(*func(*libc.TLS, int32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 192)) = XTcl_DbNewBooleanObj                                                                         // tclStubInit.c:1006:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 200)) = XTcl_DbNewByteArrayObj                                                              // tclStubInit.c:1007:5:
	*(*func(*libc.TLS, float64, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 208)) = XTcl_DbNewDoubleObj                                                                        // tclStubInit.c:1008:5:
	*(*func(*libc.TLS, int32, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 216)) = XTcl_DbNewListObj                                                                   // tclStubInit.c:1009:5:
	*(*func(*libc.TLS, int64, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 224)) = XTcl_DbNewLongObj                                                                            // tclStubInit.c:1010:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 232)) = XTcl_DbNewObj                                                                                       // tclStubInit.c:1011:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 240)) = XTcl_DbNewStringObj                                                                 // tclStubInit.c:1012:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 248)) = XTcl_DuplicateObj                                                                                          // tclStubInit.c:1013:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 256)) = XTclFreeObj                                                                                                        // tclStubInit.c:1014:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 264)) = XTcl_GetBoolean                                                                            // tclStubInit.c:1015:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 272)) = XTcl_GetBooleanFromObj                                                                     // tclStubInit.c:1016:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 280)) = XTcl_GetByteArrayFromObj                                                                          // tclStubInit.c:1017:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 288)) = XTcl_GetDouble                                                                             // tclStubInit.c:1018:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 296)) = XTcl_GetDoubleFromObj                                                                      // tclStubInit.c:1019:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 304)) = XTcl_GetIndexFromObj                                              // tclStubInit.c:1020:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 312)) = XTcl_GetInt                                                                                // tclStubInit.c:1021:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 320)) = XTcl_GetIntFromObj                                                                         // tclStubInit.c:1022:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 328)) = XTcl_GetLongFromObj                                                                        // tclStubInit.c:1023:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 336)) = XTcl_GetObjType                                                                                            // tclStubInit.c:1024:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 344)) = XTcl_GetStringFromObj                                                                             // tclStubInit.c:1025:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 352)) = XTcl_InvalidateStringRep                                                                                           // tclStubInit.c:1026:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 360)) = XTcl_ListObjAppendList                                                                     // tclStubInit.c:1027:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 368)) = XTcl_ListObjAppendElement                                                                  // tclStubInit.c:1028:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 376)) = XTcl_ListObjGetElements                                                           // tclStubInit.c:1029:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 384)) = XTcl_ListObjIndex                                                                   // tclStubInit.c:1030:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 392)) = XTcl_ListObjLength                                                                         // tclStubInit.c:1031:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 400)) = XTcl_ListObjReplace                                                   // tclStubInit.c:1032:5:
	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 408)) = XTcl_NewBooleanObj                                                                                           // tclStubInit.c:1033:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 416)) = XTcl_NewByteArrayObj                                                                                // tclStubInit.c:1034:5:
	*(*func(*libc.TLS, float64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 424)) = XTcl_NewDoubleObj                                                                                          // tclStubInit.c:1035:5:
	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 432)) = XTcl_NewIntObj                                                                                               // tclStubInit.c:1036:5:
	*(*func(*libc.TLS, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 440)) = XTcl_NewListObj                                                                                     // tclStubInit.c:1037:5:
	*(*func(*libc.TLS, int64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 448)) = XTcl_NewLongObj                                                                                              // tclStubInit.c:1038:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 456)) = XTcl_NewObj                                                                                                         // tclStubInit.c:1039:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 464)) = XTcl_NewStringObj                                                                                   // tclStubInit.c:1040:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 472)) = XTcl_SetBooleanObj                                                                                          // tclStubInit.c:1041:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 480)) = XTcl_SetByteArrayLength                                                                             // tclStubInit.c:1042:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 488)) = XTcl_SetByteArrayObj                                                                               // tclStubInit.c:1043:5:
	*(*func(*libc.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 496)) = XTcl_SetDoubleObj                                                                                         // tclStubInit.c:1044:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 504)) = XTcl_SetIntObj                                                                                              // tclStubInit.c:1045:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 512)) = XTcl_SetListObj                                                                                    // tclStubInit.c:1046:5:
	*(*func(*libc.TLS, uintptr, int64))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 520)) = XTcl_SetLongObj                                                                                             // tclStubInit.c:1047:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 528)) = XTcl_SetObjLength                                                                                           // tclStubInit.c:1048:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 536)) = XTcl_SetStringObj                                                                                  // tclStubInit.c:1049:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 544)) = XTcl_AddErrorInfo                                                                                         // tclStubInit.c:1050:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 552)) = XTcl_AddObjErrorInfo                                                                               // tclStubInit.c:1051:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 560)) = XTcl_AllowExceptions                                                                                               // tclStubInit.c:1052:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 568)) = XTcl_AppendElement                                                                                        // tclStubInit.c:1053:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 576)) = XTcl_AppendResult                                                                                         // tclStubInit.c:1054:5:
	*(*func(*libc.TLS, uintptr, ClientData) Tcl_AsyncHandler)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 584)) = XTcl_AsyncCreate                                                                      // tclStubInit.c:1055:5:
	*(*func(*libc.TLS, Tcl_AsyncHandler))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 592)) = XTcl_AsyncDelete                                                                                          // tclStubInit.c:1056:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 600)) = XTcl_AsyncInvoke                                                                                      // tclStubInit.c:1057:5:
	*(*func(*libc.TLS, Tcl_AsyncHandler))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 608)) = XTcl_AsyncMark                                                                                            // tclStubInit.c:1058:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 616)) = XTcl_AsyncReady                                                                                                       // tclStubInit.c:1059:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 624)) = XTcl_BackgroundError                                                                                               // tclStubInit.c:1060:5:
	*(*func(*libc.TLS, uintptr, uintptr) int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 632)) = XTcl_Backslash                                                                                       // tclStubInit.c:1061:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 640)) = XTcl_BadChannelOption                                                                      // tclStubInit.c:1062:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 648)) = XTcl_CallWhenDeleted                                                                          // tclStubInit.c:1063:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 656)) = XTcl_CancelIdleCall                                                                                    // tclStubInit.c:1064:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 664)) = XTcl_Close                                                                                      // tclStubInit.c:1065:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 672)) = XTcl_CommandComplete                                                                                         // tclStubInit.c:1066:5:
	*(*func(*libc.TLS, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 680)) = XTcl_Concat                                                                                         // tclStubInit.c:1067:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 688)) = XTcl_ConvertElement                                                                          // tclStubInit.c:1068:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 696)) = XTcl_ConvertCountedElement                                                            // tclStubInit.c:1069:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 704)) = XTcl_CreateAlias                                                  // tclStubInit.c:1070:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 712)) = XTcl_CreateAliasObj                                               // tclStubInit.c:1071:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 720)) = XTcl_CreateChannel                                                         // tclStubInit.c:1072:5:
	*(*func(*libc.TLS, Tcl_Channel, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 728)) = XTcl_CreateChannelHandler                                                          // tclStubInit.c:1073:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 736)) = XTcl_CreateCloseHandler                                                                   // tclStubInit.c:1074:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, ClientData, uintptr) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 744)) = XTcl_CreateCommand                                              // tclStubInit.c:1075:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 752)) = XTcl_CreateEventSource                                                                        // tclStubInit.c:1076:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 760)) = XTcl_CreateExitHandler                                                                                 // tclStubInit.c:1077:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 768)) = XTcl_CreateInterp                                                                                                   // tclStubInit.c:1078:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 776)) = XTcl_CreateMathFunc                                                  // tclStubInit.c:1079:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, ClientData, uintptr) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 784)) = XTcl_CreateObjCommand                                           // tclStubInit.c:1080:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 792)) = XTcl_CreateSlave                                                                           // tclStubInit.c:1081:5:
	*(*func(*libc.TLS, int32, uintptr, ClientData) Tcl_TimerToken)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 800)) = XTcl_CreateTimerHandler                                                          // tclStubInit.c:1082:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, ClientData) Tcl_Trace)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 808)) = XTcl_CreateTrace                                                             // tclStubInit.c:1083:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 816)) = XTcl_DeleteAssocData                                                                                      // tclStubInit.c:1084:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 824)) = XTcl_DeleteChannelHandler                                                                 // tclStubInit.c:1085:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 832)) = XTcl_DeleteCloseHandler                                                                   // tclStubInit.c:1086:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 840)) = XTcl_DeleteCommand                                                                                  // tclStubInit.c:1087:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 848)) = XTcl_DeleteCommandFromToken                                                                     // tclStubInit.c:1088:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 856)) = XTcl_DeleteEvents                                                                                      // tclStubInit.c:1089:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 864)) = XTcl_DeleteEventSource                                                                        // tclStubInit.c:1090:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 872)) = XTcl_DeleteExitHandler                                                                                 // tclStubInit.c:1091:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 880)) = XTcl_DeleteHashEntry                                                                                               // tclStubInit.c:1092:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 888)) = XTcl_DeleteHashTable                                                                                               // tclStubInit.c:1093:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 896)) = XTcl_DeleteInterp                                                                                                  // tclStubInit.c:1094:5:
	*(*func(*libc.TLS, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 904)) = XTcl_DetachPids                                                                                             // tclStubInit.c:1095:5:
	*(*func(*libc.TLS, Tcl_TimerToken))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 912)) = XTcl_DeleteTimerHandler                                                                                     // tclStubInit.c:1096:5:
	*(*func(*libc.TLS, uintptr, Tcl_Trace))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 920)) = XTcl_DeleteTrace                                                                                        // tclStubInit.c:1097:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 928)) = XTcl_DontCallWhenDeleted                                                                      // tclStubInit.c:1098:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 936)) = XTcl_DoOneEvent                                                                                                // tclStubInit.c:1099:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 944)) = XTcl_DoWhenIdle                                                                                        // tclStubInit.c:1100:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 952)) = XTcl_DStringAppend                                                                         // tclStubInit.c:1101:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 960)) = XTcl_DStringAppendElement                                                                         // tclStubInit.c:1102:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 968)) = XTcl_DStringEndSublist                                                                                             // tclStubInit.c:1103:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 976)) = XTcl_DStringFree                                                                                                   // tclStubInit.c:1104:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 984)) = XTcl_DStringGetResult                                                                                     // tclStubInit.c:1105:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 992)) = XTcl_DStringInit                                                                                                   // tclStubInit.c:1106:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1000)) = XTcl_DStringResult                                                                                       // tclStubInit.c:1107:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1008)) = XTcl_DStringSetLength                                                                                      // tclStubInit.c:1108:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1016)) = XTcl_DStringStartSublist                                                                                          // tclStubInit.c:1109:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1024)) = XTcl_Eof                                                                                                // tclStubInit.c:1110:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1032)) = XTcl_ErrnoId                                                                                                       // tclStubInit.c:1111:5:
	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1040)) = XTcl_ErrnoMsg                                                                                               // tclStubInit.c:1112:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1048)) = XTcl_Eval                                                                                          // tclStubInit.c:1113:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1056)) = XTcl_EvalFile                                                                                      // tclStubInit.c:1114:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1064)) = XTcl_EvalObj                                                                                       // tclStubInit.c:1115:5:
	*(*func(*libc.TLS, ClientData, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1072)) = XTcl_EventuallyFree                                                                                   // tclStubInit.c:1116:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1080)) = XTcl_Exit                                                                                                           // tclStubInit.c:1117:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1088)) = XTcl_ExposeCommand                                                                        // tclStubInit.c:1118:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1096)) = XTcl_ExprBoolean                                                                          // tclStubInit.c:1119:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1104)) = XTcl_ExprBooleanObj                                                                       // tclStubInit.c:1120:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1112)) = XTcl_ExprDouble                                                                           // tclStubInit.c:1121:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1120)) = XTcl_ExprDoubleObj                                                                        // tclStubInit.c:1122:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1128)) = XTcl_ExprLong                                                                             // tclStubInit.c:1123:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1136)) = XTcl_ExprLongObj                                                                          // tclStubInit.c:1124:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1144)) = XTcl_ExprObj                                                                              // tclStubInit.c:1125:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1152)) = XTcl_ExprString                                                                                    // tclStubInit.c:1126:5:
	*(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1160)) = XTcl_Finalize                                                                                                              // tclStubInit.c:1127:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1168)) = XTcl_FindExecutable                                                                                               // tclStubInit.c:1128:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1176)) = XTcl_FirstHashEntry                                                                              // tclStubInit.c:1129:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1184)) = XTcl_Flush                                                                                              // tclStubInit.c:1130:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1192)) = XTcl_FreeResult                                                                                                   // tclStubInit.c:1131:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1200)) = XTcl_GetAlias                                                  // tclStubInit.c:1132:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1208)) = XTcl_GetAliasObj                                               // tclStubInit.c:1133:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1216)) = XTcl_GetAssocData                                                                    // tclStubInit.c:1134:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1224)) = XTcl_GetChannel                                                                     // tclStubInit.c:1135:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1232)) = XTcl_GetChannelBufferSize                                                                               // tclStubInit.c:1136:5:
	*(*func(*libc.TLS, Tcl_Channel, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1240)) = XTcl_GetChannelHandle                                                                   // tclStubInit.c:1137:5:
	*(*func(*libc.TLS, Tcl_Channel) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1248)) = XTcl_GetChannelInstanceData                                                                        // tclStubInit.c:1138:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1256)) = XTcl_GetChannelMode                                                                                     // tclStubInit.c:1139:5:
	*(*func(*libc.TLS, Tcl_Channel) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1264)) = XTcl_GetChannelName                                                                                   // tclStubInit.c:1140:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1272)) = XTcl_GetChannelOption                                                        // tclStubInit.c:1141:5:
	*(*func(*libc.TLS, Tcl_Channel) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1280)) = XTcl_GetChannelType                                                                                   // tclStubInit.c:1142:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1288)) = XTcl_GetCommandInfo                                                                       // tclStubInit.c:1143:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1296)) = XTcl_GetCommandName                                                                          // tclStubInit.c:1144:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1304)) = XTcl_GetErrno                                                                                                        // tclStubInit.c:1145:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1312)) = XTcl_GetHostName                                                                                                   // tclStubInit.c:1146:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1320)) = XTcl_GetInterpPath                                                                                 // tclStubInit.c:1147:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1328)) = XTcl_GetMaster                                                                                            // tclStubInit.c:1148:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1336)) = XTcl_GetNameOfExecutable                                                                                           // tclStubInit.c:1149:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1344)) = XTcl_GetObjResult                                                                                         // tclStubInit.c:1150:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1352)) = XTcl_GetOpenFile                                                            // tclStubInit.c:1152:5:
	*(*func(*libc.TLS, uintptr) Tcl_PathType)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1360)) = XTcl_GetPathType                                                                                     // tclStubInit.c:1160:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1368)) = XTcl_Gets                                                                                      // tclStubInit.c:1161:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1376)) = XTcl_GetsObj                                                                                   // tclStubInit.c:1162:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1384)) = XTcl_GetServiceMode                                                                                                  // tclStubInit.c:1163:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1392)) = XTcl_GetSlave                                                                                    // tclStubInit.c:1164:5:
	*(*func(*libc.TLS, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1400)) = XTcl_GetStdChannel                                                                                      // tclStubInit.c:1165:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1408)) = XTcl_GetStringResult                                                                                      // tclStubInit.c:1166:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1416)) = XTcl_GetVar                                                                               // tclStubInit.c:1167:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1424)) = XTcl_GetVar2                                                                     // tclStubInit.c:1168:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1432)) = XTcl_GlobalEval                                                                                    // tclStubInit.c:1169:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1440)) = XTcl_GlobalEvalObj                                                                                 // tclStubInit.c:1170:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1448)) = XTcl_HideCommand                                                                          // tclStubInit.c:1171:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1456)) = XTcl_Init                                                                                                   // tclStubInit.c:1172:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1464)) = XTcl_InitHashTable                                                                                         // tclStubInit.c:1173:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1472)) = XTcl_InputBlocked                                                                                       // tclStubInit.c:1174:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1480)) = XTcl_InputBuffered                                                                                      // tclStubInit.c:1175:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1488)) = XTcl_InterpDeleted                                                                                          // tclStubInit.c:1176:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1496)) = XTcl_IsSafe                                                                                                 // tclStubInit.c:1177:5:
	*(*func(*libc.TLS, int32, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1504)) = XTcl_JoinPath                                                                             // tclStubInit.c:1178:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1512)) = XTcl_LinkVar                                                                       // tclStubInit.c:1179:5:
	*(*func(*libc.TLS, ClientData, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1528)) = XTcl_MakeFileChannel                                                                        // tclStubInit.c:1181:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1536)) = XTcl_MakeSafe                                                                                               // tclStubInit.c:1182:5:
	*(*func(*libc.TLS, ClientData) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1544)) = XTcl_MakeTcpClientChannel                                                                          // tclStubInit.c:1183:5:
	*(*func(*libc.TLS, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1552)) = XTcl_Merge                                                                                         // tclStubInit.c:1184:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1560)) = XTcl_NextHashEntry                                                                                        // tclStubInit.c:1185:5:
	*(*func(*libc.TLS, Tcl_Channel, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1568)) = XTcl_NotifyChannel                                                                                     // tclStubInit.c:1186:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1576)) = XTcl_ObjGetVar2                                                                  // tclStubInit.c:1187:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1584)) = XTcl_ObjSetVar2                                                         // tclStubInit.c:1188:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1592)) = XTcl_OpenCommandChannel                                                        // tclStubInit.c:1189:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1600)) = XTcl_OpenFileChannel                                                         // tclStubInit.c:1190:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, int32, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1608)) = XTcl_OpenTcpClient                                             // tclStubInit.c:1191:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, ClientData) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1616)) = XTcl_OpenTcpServer                                               // tclStubInit.c:1192:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1624)) = XTcl_Preserve                                                                                                  // tclStubInit.c:1193:5:
	*(*func(*libc.TLS, uintptr, float64, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1632)) = XTcl_PrintDouble                                                                                // tclStubInit.c:1194:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1640)) = XTcl_PutEnv                                                                                                 // tclStubInit.c:1195:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1648)) = XTcl_PosixError                                                                                           // tclStubInit.c:1196:5:
	*(*func(*libc.TLS, uintptr, Tcl_QueuePosition))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1656)) = XTcl_QueueEvent                                                                                // tclStubInit.c:1197:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1664)) = XTcl_Read                                                                               // tclStubInit.c:1198:5:
	*(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1672)) = XTcl_ReapDetachedProcs                                                                                                     // tclStubInit.c:1199:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1680)) = XTcl_RecordAndEval                                                                          // tclStubInit.c:1200:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1688)) = XTcl_RecordAndEvalObj                                                                       // tclStubInit.c:1201:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1696)) = XTcl_RegisterChannel                                                                                 // tclStubInit.c:1202:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1704)) = XTcl_RegisterObjType                                                                                              // tclStubInit.c:1203:5:
	*(*func(*libc.TLS, uintptr, uintptr) Tcl_RegExp)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1712)) = XTcl_RegExpCompile                                                                            // tclStubInit.c:1204:5:
	*(*func(*libc.TLS, uintptr, Tcl_RegExp, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1720)) = XTcl_RegExpExec                                                               // tclStubInit.c:1205:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1728)) = XTcl_RegExpMatch                                                                          // tclStubInit.c:1206:5:
	*(*func(*libc.TLS, Tcl_RegExp, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1736)) = XTcl_RegExpRange                                                                      // tclStubInit.c:1207:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1744)) = XTcl_Release                                                                                                   // tclStubInit.c:1208:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1752)) = XTcl_ResetResult                                                                                                  // tclStubInit.c:1209:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1760)) = XTcl_ScanElement                                                                                   // tclStubInit.c:1210:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1768)) = XTcl_ScanCountedElement                                                                     // tclStubInit.c:1211:5:
	*(*func(*libc.TLS, Tcl_Channel, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1776)) = XTcl_SeekOld                                                                              // tclStubInit.c:1212:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1784)) = XTcl_ServiceAll                                                                                                      // tclStubInit.c:1213:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1792)) = XTcl_ServiceEvent                                                                                             // tclStubInit.c:1214:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1800)) = XTcl_SetAssocData                                                                   // tclStubInit.c:1215:5:
	*(*func(*libc.TLS, Tcl_Channel, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1808)) = XTcl_SetChannelBufferSize                                                                              // tclStubInit.c:1216:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1816)) = XTcl_SetChannelOption                                                        // tclStubInit.c:1217:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1824)) = XTcl_SetCommandInfo                                                                       // tclStubInit.c:1218:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1832)) = XTcl_SetErrno                                                                                                       // tclStubInit.c:1219:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1840)) = XTcl_SetErrorCode                                                                                        // tclStubInit.c:1220:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1848)) = XTcl_SetMaxBlockTime                                                                                              // tclStubInit.c:1221:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1856)) = XTcl_SetPanicProc                                                                                                 // tclStubInit.c:1222:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1864)) = XTcl_SetRecursionLimit                                                                               // tclStubInit.c:1223:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1872)) = XTcl_SetResult                                                                                  // tclStubInit.c:1224:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1880)) = XTcl_SetServiceMode                                                                                           // tclStubInit.c:1225:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1888)) = XTcl_SetObjErrorCode                                                                                     // tclStubInit.c:1226:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1896)) = XTcl_SetObjResult                                                                                        // tclStubInit.c:1227:5:
	*(*func(*libc.TLS, Tcl_Channel, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1904)) = XTcl_SetStdChannel                                                                                     // tclStubInit.c:1228:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1912)) = XTcl_SetVar                                                                      // tclStubInit.c:1229:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1920)) = XTcl_SetVar2                                                            // tclStubInit.c:1230:5:
	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1928)) = XTcl_SignalId                                                                                               // tclStubInit.c:1231:5:
	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1936)) = XTcl_SignalMsg                                                                                              // tclStubInit.c:1232:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1944)) = XTcl_SourceRCFile                                                                                                 // tclStubInit.c:1233:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1952)) = XTcl_SplitList                                                                   // tclStubInit.c:1234:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1960)) = XTcl_SplitPath                                                                                  // tclStubInit.c:1235:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1968)) = XTcl_StaticPackage                                                                     // tclStubInit.c:1236:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1976)) = XTcl_StringMatch                                                                                   // tclStubInit.c:1237:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1984)) = XTcl_TellOld                                                                                            // tclStubInit.c:1238:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 1992)) = XTcl_TraceVar                                                          // tclStubInit.c:1239:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, ClientData) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2000)) = XTcl_TraceVar2                                                // tclStubInit.c:1240:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2008)) = XTcl_TranslateFileName                                                                  // tclStubInit.c:1241:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2016)) = XTcl_Ungets                                                                      // tclStubInit.c:1242:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2024)) = XTcl_UnlinkVar                                                                                           // tclStubInit.c:1243:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2032)) = XTcl_UnregisterChannel                                                                         // tclStubInit.c:1244:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2040)) = XTcl_UnsetVar                                                                               // tclStubInit.c:1245:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2048)) = XTcl_UnsetVar2                                                                     // tclStubInit.c:1246:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2056)) = XTcl_UntraceVar                                                              // tclStubInit.c:1247:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2064)) = XTcl_UntraceVar2                                                    // tclStubInit.c:1248:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2072)) = XTcl_UpdateLinkedVar                                                                                     // tclStubInit.c:1249:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2080)) = XTcl_UpVar                                                                // tclStubInit.c:1250:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2088)) = XTcl_UpVar2                                                      // tclStubInit.c:1251:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2096)) = XTcl_VarEval                                                                                       // tclStubInit.c:1252:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2104)) = XTcl_VarTraceInfo                                                 // tclStubInit.c:1253:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2112)) = XTcl_VarTraceInfo2                                       // tclStubInit.c:1254:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2120)) = XTcl_Write                                                                              // tclStubInit.c:1255:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2128)) = XTcl_WrongNumArgs                                                                        // tclStubInit.c:1256:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2136)) = XTcl_DumpActiveMemory                                                                                       // tclStubInit.c:1257:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2144)) = XTcl_ValidateAllMemory                                                                                     // tclStubInit.c:1258:5:
	*(*func(*libc.TLS, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2152)) = XTcl_AppendResultVA                                                                                      // tclStubInit.c:1259:5:
	*(*func(*libc.TLS, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2160)) = XTcl_AppendStringsToObjVA                                                                                // tclStubInit.c:1260:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2168)) = XTcl_HashStats                                                                                            // tclStubInit.c:1261:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2176)) = XTcl_ParseVar                                                                           // tclStubInit.c:1262:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2184)) = XTcl_PkgPresent                                                                  // tclStubInit.c:1263:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2192)) = XTcl_PkgPresentEx                                                       // tclStubInit.c:1264:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2200)) = XTcl_PkgProvide                                                                           // tclStubInit.c:1265:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2208)) = XTcl_PkgRequire                                                                  // tclStubInit.c:1266:5:
	*(*func(*libc.TLS, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2216)) = XTcl_SetErrorCodeVA                                                                                      // tclStubInit.c:1267:5:
	*(*func(*libc.TLS, uintptr, Va_list) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2224)) = XTcl_VarEvalVA                                                                                     // tclStubInit.c:1268:5:
	*(*func(*libc.TLS, Tcl_Pid, uintptr, int32) Tcl_Pid)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2232)) = XTcl_WaitPid                                                                              // tclStubInit.c:1269:5:
	*(*func(*libc.TLS, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2240)) = XTcl_PanicVA                                                                                             // tclStubInit.c:1270:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2248)) = XTcl_GetVersion                                                                        // tclStubInit.c:1271:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2256)) = XTcl_InitMemory                                                                                                   // tclStubInit.c:1272:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, int32, Tcl_Channel) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2264)) = XTcl_StackChannel                                            // tclStubInit.c:1273:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2272)) = XTcl_UnstackChannel                                                                            // tclStubInit.c:1274:5:
	*(*func(*libc.TLS, Tcl_Channel) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2280)) = XTcl_GetStackedChannel                                                                            // tclStubInit.c:1275:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2288)) = XTcl_SetMainLoop                                                                                                  // tclStubInit.c:1276:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2304)) = XTcl_AppendObjToObj                                                                                      // tclStubInit.c:1278:5:
	*(*func(*libc.TLS, uintptr) Tcl_Encoding)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2312)) = XTcl_CreateEncoding                                                                                  // tclStubInit.c:1279:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2320)) = XTcl_CreateThreadExitHandler                                                                          // tclStubInit.c:1280:5:
	*(*func(*libc.TLS, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2328)) = XTcl_DeleteThreadExitHandler                                                                          // tclStubInit.c:1281:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2336)) = XTcl_DiscardResult                                                                                                // tclStubInit.c:1282:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2344)) = XTcl_EvalEx                                                                          // tclStubInit.c:1283:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2352)) = XTcl_EvalObjv                                                                        // tclStubInit.c:1284:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2360)) = XTcl_EvalObjEx                                                                              // tclStubInit.c:1285:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2368)) = XTcl_ExitThread                                                                                                     // tclStubInit.c:1286:5:
	*(*func(*libc.TLS, uintptr, Tcl_Encoding, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2376)) = XTcl_ExternalToUtf // tclStubInit.c:1287:5:
	*(*func(*libc.TLS, Tcl_Encoding, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2384)) = XTcl_ExternalToUtfDString                                                   // tclStubInit.c:1288:5:
	*(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2392)) = XTcl_FinalizeThread                                                                                                        // tclStubInit.c:1289:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2400)) = XTcl_FinalizeNotifier                                                                                          // tclStubInit.c:1290:5:
	*(*func(*libc.TLS, Tcl_Encoding))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2408)) = XTcl_FreeEncoding                                                                                            // tclStubInit.c:1291:5:
	*(*func(*libc.TLS) Tcl_ThreadId)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2416)) = XTcl_GetCurrentThread                                                                                         // tclStubInit.c:1292:5:
	*(*func(*libc.TLS, uintptr, uintptr) Tcl_Encoding)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2424)) = XTcl_GetEncoding                                                                            // tclStubInit.c:1293:5:
	*(*func(*libc.TLS, Tcl_Encoding) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2432)) = XTcl_GetEncodingName                                                                                 // tclStubInit.c:1294:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2440)) = XTcl_GetEncodingNames                                                                                             // tclStubInit.c:1295:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2448)) = XTcl_GetIndexFromObjStruct                                // tclStubInit.c:1296:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2456)) = XTcl_GetThreadData                                                                                 // tclStubInit.c:1297:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2464)) = XTcl_GetVar2Ex                                                                   // tclStubInit.c:1298:5:
	*(*func(*libc.TLS) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2472)) = XTcl_InitNotifier                                                                                               // tclStubInit.c:1299:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2480)) = XTcl_MutexLock                                                                                                    // tclStubInit.c:1300:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2488)) = XTcl_MutexUnlock                                                                                                  // tclStubInit.c:1301:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2496)) = XTcl_ConditionNotify                                                                                              // tclStubInit.c:1302:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2504)) = XTcl_ConditionWait                                                                              // tclStubInit.c:1303:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2512)) = XTcl_NumUtfChars                                                                                     // tclStubInit.c:1304:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2520)) = XTcl_ReadChars                                                                   // tclStubInit.c:1305:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2528)) = XTcl_RestoreResult                                                                                       // tclStubInit.c:1306:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2536)) = XTcl_SaveResult                                                                                          // tclStubInit.c:1307:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2544)) = XTcl_SetSystemEncoding                                                                             // tclStubInit.c:1308:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2552)) = XTcl_SetVar2Ex                                                          // tclStubInit.c:1309:5:
	*(*func(*libc.TLS, Tcl_ThreadId))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2560)) = XTcl_ThreadAlert                                                                                             // tclStubInit.c:1310:5:
	*(*func(*libc.TLS, Tcl_ThreadId, uintptr, Tcl_QueuePosition))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2568)) = XTcl_ThreadQueueEvent                                                            // tclStubInit.c:1311:5:
	*(*func(*libc.TLS, uintptr, int32) Tcl_UniChar)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2576)) = XTcl_UniCharAtIndex                                                                            // tclStubInit.c:1312:5:
	*(*func(*libc.TLS, int32) Tcl_UniChar)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2584)) = XTcl_UniCharToLower                                                                                     // tclStubInit.c:1313:5:
	*(*func(*libc.TLS, int32) Tcl_UniChar)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2592)) = XTcl_UniCharToTitle                                                                                     // tclStubInit.c:1314:5:
	*(*func(*libc.TLS, int32) Tcl_UniChar)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2600)) = XTcl_UniCharToUpper                                                                                     // tclStubInit.c:1315:5:
	*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2608)) = XTcl_UniCharToUtf                                                                                    // tclStubInit.c:1316:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2616)) = XTcl_UtfAtIndex                                                                                    // tclStubInit.c:1317:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2624)) = XTcl_UtfCharComplete                                                                                 // tclStubInit.c:1318:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2632)) = XTcl_UtfBackslash                                                                         // tclStubInit.c:1319:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2640)) = XTcl_UtfFindFirst                                                                                  // tclStubInit.c:1320:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2648)) = XTcl_UtfFindLast                                                                                   // tclStubInit.c:1321:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2656)) = XTcl_UtfNext                                                                                              // tclStubInit.c:1322:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2664)) = XTcl_UtfPrev                                                                                     // tclStubInit.c:1323:5:
	*(*func(*libc.TLS, uintptr, Tcl_Encoding, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2672)) = XTcl_UtfToExternal // tclStubInit.c:1324:5:
	*(*func(*libc.TLS, Tcl_Encoding, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2680)) = XTcl_UtfToExternalDString                                                   // tclStubInit.c:1325:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2688)) = XTcl_UtfToLower                                                                                             // tclStubInit.c:1326:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2696)) = XTcl_UtfToTitle                                                                                             // tclStubInit.c:1327:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2704)) = XTcl_UtfToUniChar                                                                                  // tclStubInit.c:1328:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2712)) = XTcl_UtfToUpper                                                                                             // tclStubInit.c:1329:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2720)) = XTcl_WriteChars                                                                         // tclStubInit.c:1330:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2728)) = XTcl_WriteObj                                                                                  // tclStubInit.c:1331:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2736)) = XTcl_GetString                                                                                            // tclStubInit.c:1332:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2744)) = XTcl_GetDefaultEncodingDir                                                                                         // tclStubInit.c:1333:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2752)) = XTcl_SetDefaultEncodingDir                                                                                        // tclStubInit.c:1334:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2760)) = XTcl_AlertNotifier                                                                                             // tclStubInit.c:1335:5:
	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2768)) = XTcl_ServiceModeHook                                                                                                // tclStubInit.c:1336:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2776)) = XTcl_UniCharIsAlnum                                                                                           // tclStubInit.c:1337:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2784)) = XTcl_UniCharIsAlpha                                                                                           // tclStubInit.c:1338:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2792)) = XTcl_UniCharIsDigit                                                                                           // tclStubInit.c:1339:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2800)) = XTcl_UniCharIsLower                                                                                           // tclStubInit.c:1340:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2808)) = XTcl_UniCharIsSpace                                                                                           // tclStubInit.c:1341:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2816)) = XTcl_UniCharIsUpper                                                                                           // tclStubInit.c:1342:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2824)) = XTcl_UniCharIsWordChar                                                                                        // tclStubInit.c:1343:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2832)) = XTcl_UniCharLen                                                                                             // tclStubInit.c:1344:5:
	*(*func(*libc.TLS, uintptr, uintptr, uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2840)) = XTcl_UniCharNcmp                                                                           // tclStubInit.c:1345:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2848)) = XTcl_UniCharToUtfDString                                                                  // tclStubInit.c:1346:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2856)) = XTcl_UtfToUniCharDString                                                                  // tclStubInit.c:1347:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) Tcl_RegExp)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2864)) = XTcl_GetRegExpFromObj                                                                  // tclStubInit.c:1348:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2872)) = XTcl_EvalTokens                                                                           // tclStubInit.c:1349:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2880)) = XTcl_FreeParse                                                                                                    // tclStubInit.c:1350:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2888)) = XTcl_LogCommandInfo                                                                      // tclStubInit.c:1351:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2896)) = XTcl_ParseBraces                                                   // tclStubInit.c:1352:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2904)) = XTcl_ParseCommand                                                           // tclStubInit.c:1353:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2912)) = XTcl_ParseExpr                                                                     // tclStubInit.c:1354:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2920)) = XTcl_ParseQuotedString                                             // tclStubInit.c:1355:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2928)) = XTcl_ParseVarName                                                           // tclStubInit.c:1356:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2936)) = XTcl_GetCwd                                                                                      // tclStubInit.c:1357:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2944)) = XTcl_Chdir                                                                                                  // tclStubInit.c:1358:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2952)) = XTcl_Access                                                                                          // tclStubInit.c:1359:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2960)) = XTcl_Stat                                                                                          // tclStubInit.c:1360:5:
	*(*func(*libc.TLS, uintptr, uintptr, uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2968)) = XTcl_UtfNcmp                                                                               // tclStubInit.c:1361:5:
	*(*func(*libc.TLS, uintptr, uintptr, uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2976)) = XTcl_UtfNcasecmp                                                                           // tclStubInit.c:1362:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2984)) = XTcl_StringCaseMatch                                                                        // tclStubInit.c:1363:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 2992)) = XTcl_UniCharIsControl                                                                                         // tclStubInit.c:1364:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3000)) = XTcl_UniCharIsGraph                                                                                           // tclStubInit.c:1365:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3008)) = XTcl_UniCharIsPrint                                                                                           // tclStubInit.c:1366:5:
	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3016)) = XTcl_UniCharIsPunct                                                                                           // tclStubInit.c:1367:5:
	*(*func(*libc.TLS, uintptr, Tcl_RegExp, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3024)) = XTcl_RegExpExecObj                                                // tclStubInit.c:1368:5:
	*(*func(*libc.TLS, Tcl_RegExp, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3032)) = XTcl_RegExpGetInfo                                                                                    // tclStubInit.c:1369:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3040)) = XTcl_NewUnicodeObj                                                                                 // tclStubInit.c:1370:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3048)) = XTcl_SetUnicodeObj                                                                                // tclStubInit.c:1371:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3056)) = XTcl_GetCharLength                                                                                          // tclStubInit.c:1372:5:
	*(*func(*libc.TLS, uintptr, int32) Tcl_UniChar)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3064)) = XTcl_GetUniChar                                                                                // tclStubInit.c:1373:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3072)) = XTcl_GetUnicode                                                                                           // tclStubInit.c:1374:5:
	*(*func(*libc.TLS, uintptr, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3080)) = XTcl_GetRange                                                                               // tclStubInit.c:1375:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3088)) = XTcl_AppendUnicodeToObj                                                                           // tclStubInit.c:1376:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3096)) = XTcl_RegExpMatchObj                                                                       // tclStubInit.c:1377:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3104)) = XTcl_SetNotifier                                                                                                  // tclStubInit.c:1378:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3112)) = XTcl_GetAllocMutex                                                                                                 // tclStubInit.c:1379:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3120)) = XTcl_GetChannelNames                                                                                        // tclStubInit.c:1380:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3128)) = XTcl_GetChannelNamesEx                                                                             // tclStubInit.c:1381:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3136)) = XTcl_ProcObjCmd                                                                 // tclStubInit.c:1382:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3144)) = XTcl_ConditionFinalize                                                                                            // tclStubInit.c:1383:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3152)) = XTcl_MutexFinalize                                                                                                // tclStubInit.c:1384:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3160)) = XTcl_CreateThread                                                        // tclStubInit.c:1385:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3168)) = XTcl_ReadRaw                                                                            // tclStubInit.c:1386:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3176)) = XTcl_WriteRaw                                                                           // tclStubInit.c:1387:5:
	*(*func(*libc.TLS, Tcl_Channel) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3184)) = XTcl_GetTopChannel                                                                                // tclStubInit.c:1388:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3192)) = XTcl_ChannelBuffered                                                                                    // tclStubInit.c:1389:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3200)) = XTcl_ChannelName                                                                                          // tclStubInit.c:1390:5:
	*(*func(*libc.TLS, uintptr) Tcl_ChannelTypeVersion)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3208)) = XTcl_ChannelVersion                                                                        // tclStubInit.c:1391:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3216)) = XTcl_ChannelBlockModeProc                                                                                 // tclStubInit.c:1392:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3224)) = XTcl_ChannelCloseProc                                                                                     // tclStubInit.c:1393:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3232)) = XTcl_ChannelClose2Proc                                                                                    // tclStubInit.c:1394:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3240)) = XTcl_ChannelInputProc                                                                                     // tclStubInit.c:1395:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3248)) = XTcl_ChannelOutputProc                                                                                    // tclStubInit.c:1396:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3256)) = XTcl_ChannelSeekProc                                                                                      // tclStubInit.c:1397:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3264)) = XTcl_ChannelSetOptionProc                                                                                 // tclStubInit.c:1398:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3272)) = XTcl_ChannelGetOptionProc                                                                                 // tclStubInit.c:1399:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3280)) = XTcl_ChannelWatchProc                                                                                     // tclStubInit.c:1400:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3288)) = XTcl_ChannelGetHandleProc                                                                                 // tclStubInit.c:1401:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3296)) = XTcl_ChannelFlushProc                                                                                     // tclStubInit.c:1402:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3304)) = XTcl_ChannelHandlerProc                                                                                   // tclStubInit.c:1403:5:
	*(*func(*libc.TLS, Tcl_ThreadId, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3312)) = XTcl_JoinThread                                                                               // tclStubInit.c:1404:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3320)) = XTcl_IsChannelShared                                                                                    // tclStubInit.c:1405:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3328)) = XTcl_IsChannelRegistered                                                                       // tclStubInit.c:1406:5:
	*(*func(*libc.TLS, Tcl_Channel))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3336)) = XTcl_CutChannel                                                                                               // tclStubInit.c:1407:5:
	*(*func(*libc.TLS, Tcl_Channel))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3344)) = XTcl_SpliceChannel                                                                                            // tclStubInit.c:1408:5:
	*(*func(*libc.TLS, Tcl_Channel))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3352)) = XTcl_ClearChannelHandlers                                                                                     // tclStubInit.c:1409:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3360)) = XTcl_IsChannelExisting                                                                                      // tclStubInit.c:1410:5:
	*(*func(*libc.TLS, uintptr, uintptr, uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3368)) = XTcl_UniCharNcasecmp                                                                       // tclStubInit.c:1411:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3376)) = XTcl_UniCharCaseMatch                                                                       // tclStubInit.c:1412:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3384)) = XTcl_FindHashEntry                                                                               // tclStubInit.c:1413:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3392)) = XTcl_CreateHashEntry                                                                    // tclStubInit.c:1414:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3400)) = XTcl_InitCustomHashTable                                                                          // tclStubInit.c:1415:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3408)) = XTcl_InitObjHashTable                                                                                             // tclStubInit.c:1416:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3416)) = XTcl_CommandTraceInfo                                             // tclStubInit.c:1417:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3424)) = XTcl_TraceCommand                                                      // tclStubInit.c:1418:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3432)) = XTcl_UntraceCommand                                                          // tclStubInit.c:1419:5:
	*(*func(*libc.TLS, uint32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3440)) = XTcl_AttemptAlloc                                                                                          // tclStubInit.c:1420:5:
	*(*func(*libc.TLS, uint32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3448)) = XTcl_AttemptDbCkalloc                                                                      // tclStubInit.c:1421:5:
	*(*func(*libc.TLS, uintptr, uint32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3456)) = XTcl_AttemptRealloc                                                                               // tclStubInit.c:1422:5:
	*(*func(*libc.TLS, uintptr, uint32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3464)) = XTcl_AttemptDbCkrealloc                                                           // tclStubInit.c:1423:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3472)) = XTcl_AttemptSetObjLength                                                                             // tclStubInit.c:1424:5:
	*(*func(*libc.TLS, Tcl_Channel) Tcl_ThreadId)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3480)) = XTcl_GetChannelThread                                                                            // tclStubInit.c:1425:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3488)) = XTcl_GetUnicodeFromObj                                                                           // tclStubInit.c:1426:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3496)) = XTcl_GetMathFuncInfo                                           // tclStubInit.c:1427:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3504)) = XTcl_ListMathFuncs                                                                               // tclStubInit.c:1428:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3512)) = XTcl_SubstObj                                                                             // tclStubInit.c:1429:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3520)) = XTcl_DetachChannel                                                                             // tclStubInit.c:1430:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3528)) = XTcl_IsStandardChannel                                                                                  // tclStubInit.c:1431:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3536)) = XTcl_FSCopyFile                                                                                    // tclStubInit.c:1432:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3544)) = XTcl_FSCopyDirectory                                                                      // tclStubInit.c:1433:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3552)) = XTcl_FSCreateDirectory                                                                                      // tclStubInit.c:1434:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3560)) = XTcl_FSDeleteFile                                                                                           // tclStubInit.c:1435:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3568)) = XTcl_FSLoadFile                              // tclStubInit.c:1436:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3576)) = XTcl_FSMatchInDirectory                                                 // tclStubInit.c:1437:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3584)) = XTcl_FSLink                                                                               // tclStubInit.c:1438:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3592)) = XTcl_FSRemoveDirectory                                                                      // tclStubInit.c:1439:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3600)) = XTcl_FSRenameFile                                                                                  // tclStubInit.c:1440:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3608)) = XTcl_FSLstat                                                                                       // tclStubInit.c:1441:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3616)) = XTcl_FSUtime                                                                                       // tclStubInit.c:1442:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3624)) = XTcl_FSFileAttrsGet                                                                // tclStubInit.c:1443:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3632)) = XTcl_FSFileAttrsSet                                                                // tclStubInit.c:1444:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3640)) = XTcl_FSFileAttrStrings                                                                           // tclStubInit.c:1445:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3648)) = XTcl_FSStat                                                                                        // tclStubInit.c:1446:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3656)) = XTcl_FSAccess                                                                                        // tclStubInit.c:1447:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3664)) = XTcl_FSOpenFileChannel                                                       // tclStubInit.c:1448:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3672)) = XTcl_FSGetCwd                                                                                             // tclStubInit.c:1449:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3680)) = XTcl_FSChdir                                                                                                // tclStubInit.c:1450:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3688)) = XTcl_FSConvertToPathType                                                                           // tclStubInit.c:1451:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3696)) = XTcl_FSJoinPath                                                                                    // tclStubInit.c:1452:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3704)) = XTcl_FSSplitPath                                                                                 // tclStubInit.c:1453:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3712)) = XTcl_FSEqualPaths                                                                                  // tclStubInit.c:1454:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3720)) = XTcl_FSGetNormalizedPath                                                                         // tclStubInit.c:1455:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3728)) = XTcl_FSJoinToPath                                                                         // tclStubInit.c:1456:5:
	*(*func(*libc.TLS, uintptr, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3736)) = XTcl_FSGetInternalRep                                                                         // tclStubInit.c:1457:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3744)) = XTcl_FSGetTranslatedPath                                                                         // tclStubInit.c:1458:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3752)) = XTcl_FSEvalFile                                                                                    // tclStubInit.c:1459:5:
	*(*func(*libc.TLS, uintptr, ClientData) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3760)) = XTcl_FSNewNativePath                                                                          // tclStubInit.c:1460:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3768)) = XTcl_FSGetNativePath                                                                                      // tclStubInit.c:1461:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3776)) = XTcl_FSFileSystemInfo                                                                                     // tclStubInit.c:1462:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3784)) = XTcl_FSPathSeparator                                                                                      // tclStubInit.c:1463:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3792)) = XTcl_FSListVolumes                                                                                                 // tclStubInit.c:1464:5:
	*(*func(*libc.TLS, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3800)) = XTcl_FSRegister                                                                                 // tclStubInit.c:1465:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3808)) = XTcl_FSUnregister                                                                                           // tclStubInit.c:1466:5:
	*(*func(*libc.TLS, uintptr) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3816)) = XTcl_FSData                                                                                            // tclStubInit.c:1467:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3824)) = XTcl_FSGetTranslatedStringPath                                                                   // tclStubInit.c:1468:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3832)) = XTcl_FSGetFileSystemForPath                                                                               // tclStubInit.c:1469:5:
	*(*func(*libc.TLS, uintptr) Tcl_PathType)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3840)) = XTcl_FSGetPathType                                                                                   // tclStubInit.c:1470:5:
	*(*func(*libc.TLS, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3848)) = XTcl_OutputBuffered                                                                                     // tclStubInit.c:1471:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3856)) = XTcl_FSMountsChanged                                                                                              // tclStubInit.c:1472:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3864)) = XTcl_EvalTokensStandard                                                                     // tclStubInit.c:1473:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3872)) = XTcl_GetTime                                                                                                      // tclStubInit.c:1474:5:
	*(*func(*libc.TLS, uintptr, int32, int32, uintptr, ClientData, uintptr) Tcl_Trace)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3880)) = XTcl_CreateObjTrace                                         // tclStubInit.c:1475:5:
	*(*func(*libc.TLS, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3888)) = XTcl_GetCommandInfoFromToken                                                                   // tclStubInit.c:1476:5:
	*(*func(*libc.TLS, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3896)) = XTcl_SetCommandInfoFromToken                                                                   // tclStubInit.c:1477:5:
	*(*func(*libc.TLS, Tcl_WideInt, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3904)) = XTcl_DbNewWideIntObj                                                                  // tclStubInit.c:1478:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3912)) = XTcl_GetWideIntFromObj                                                                    // tclStubInit.c:1479:5:
	*(*func(*libc.TLS, Tcl_WideInt) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3920)) = XTcl_NewWideIntObj                                                                                    // tclStubInit.c:1480:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideInt))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3928)) = XTcl_SetWideIntObj                                                                                   // tclStubInit.c:1481:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3936)) = XTcl_AllocStatBuf                                                                                                  // tclStubInit.c:1482:5:
	*(*func(*libc.TLS, Tcl_Channel, Tcl_WideInt, int32) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3944)) = XTcl_Seek                                                                     // tclStubInit.c:1483:5:
	*(*func(*libc.TLS, Tcl_Channel) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3952)) = XTcl_Tell                                                                                         // tclStubInit.c:1484:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3960)) = XTcl_ChannelWideSeekProc                                                                                  // tclStubInit.c:1485:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3968)) = XTcl_DictObjPut                                                                  // tclStubInit.c:1486:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3976)) = XTcl_DictObjGet                                                                  // tclStubInit.c:1487:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3984)) = XTcl_DictObjRemove                                                                        // tclStubInit.c:1488:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 3992)) = XTcl_DictObjSize                                                                          // tclStubInit.c:1489:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4000)) = XTcl_DictObjFirst                                              // tclStubInit.c:1490:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4008)) = XTcl_DictObjNext                                                                       // tclStubInit.c:1491:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4016)) = XTcl_DictObjDone                                                                                                  // tclStubInit.c:1492:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4024)) = XTcl_DictObjPutKeyList                                                    // tclStubInit.c:1493:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4032)) = XTcl_DictObjRemoveKeyList                                                          // tclStubInit.c:1494:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4040)) = XTcl_NewDictObj                                                                                                    // tclStubInit.c:1495:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4048)) = XTcl_DbNewDictObj                                                                                  // tclStubInit.c:1496:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4056)) = XTcl_RegisterConfig                                                                    // tclStubInit.c:1497:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4064)) = XTcl_CreateNamespace                                                        // tclStubInit.c:1498:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4072)) = XTcl_DeleteNamespace                                                                                              // tclStubInit.c:1499:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4080)) = XTcl_AppendExportList                                                                     // tclStubInit.c:1500:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4088)) = XTcl_Export                                                                        // tclStubInit.c:1501:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4096)) = XTcl_Import                                                                        // tclStubInit.c:1502:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4104)) = XTcl_ForgetImport                                                                         // tclStubInit.c:1503:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4112)) = XTcl_GetCurrentNamespace                                                                                  // tclStubInit.c:1504:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4120)) = XTcl_GetGlobalNamespace                                                                                   // tclStubInit.c:1505:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4128)) = XTcl_FindNamespace                                                               // tclStubInit.c:1506:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4136)) = XTcl_FindCommand                                                             // tclStubInit.c:1507:5:
	*(*func(*libc.TLS, uintptr, uintptr) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4144)) = XTcl_GetCommandFromObj                                                                       // tclStubInit.c:1508:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4152)) = XTcl_GetCommandFullName                                                                     // tclStubInit.c:1509:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4160)) = XTcl_FSEvalFileEx                                                                         // tclStubInit.c:1510:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4168)) = XTcl_SetExitProc                                                                                          // tclStubInit.c:1511:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, ClientData, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4176)) = XTcl_LimitAddHandler                                                         // tclStubInit.c:1512:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4184)) = XTcl_LimitRemoveHandler                                                               // tclStubInit.c:1513:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4192)) = XTcl_LimitReady                                                                                             // tclStubInit.c:1514:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4200)) = XTcl_LimitCheck                                                                                             // tclStubInit.c:1515:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4208)) = XTcl_LimitExceeded                                                                                          // tclStubInit.c:1516:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4216)) = XTcl_LimitSetCommands                                                                                      // tclStubInit.c:1517:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4224)) = XTcl_LimitSetTime                                                                                        // tclStubInit.c:1518:5:
	*(*func(*libc.TLS, uintptr, int32, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4232)) = XTcl_LimitSetGranularity                                                                            // tclStubInit.c:1519:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4240)) = XTcl_LimitTypeEnabled                                                                                // tclStubInit.c:1520:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4248)) = XTcl_LimitTypeExceeded                                                                               // tclStubInit.c:1521:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4256)) = XTcl_LimitTypeSet                                                                                          // tclStubInit.c:1522:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4264)) = XTcl_LimitTypeReset                                                                                        // tclStubInit.c:1523:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4272)) = XTcl_LimitGetCommands                                                                                       // tclStubInit.c:1524:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4280)) = XTcl_LimitGetTime                                                                                        // tclStubInit.c:1525:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4288)) = XTcl_LimitGetGranularity                                                                             // tclStubInit.c:1526:5:
	*(*func(*libc.TLS, uintptr, int32) Tcl_InterpState)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4296)) = XTcl_SaveInterpState                                                                       // tclStubInit.c:1527:5:
	*(*func(*libc.TLS, uintptr, Tcl_InterpState) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4304)) = XTcl_RestoreInterpState                                                                    // tclStubInit.c:1528:5:
	*(*func(*libc.TLS, Tcl_InterpState))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4312)) = XTcl_DiscardInterpState                                                                                   // tclStubInit.c:1529:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4320)) = XTcl_SetReturnOptions                                                                              // tclStubInit.c:1530:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4328)) = XTcl_GetReturnOptions                                                                              // tclStubInit.c:1531:5:
	*(*func(*libc.TLS, Tcl_Command) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4336)) = XTcl_IsEnsemble                                                                                         // tclStubInit.c:1532:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4344)) = XTcl_CreateEnsemble                                                          // tclStubInit.c:1533:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4352)) = XTcl_FindEnsemble                                                                     // tclStubInit.c:1534:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4360)) = XTcl_SetEnsembleSubcommandList                                                        // tclStubInit.c:1535:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4368)) = XTcl_SetEnsembleMappingDict                                                           // tclStubInit.c:1536:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4376)) = XTcl_SetEnsembleUnknownHandler                                                        // tclStubInit.c:1537:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4384)) = XTcl_SetEnsembleFlags                                                                   // tclStubInit.c:1538:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4392)) = XTcl_GetEnsembleSubcommandList                                                        // tclStubInit.c:1539:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4400)) = XTcl_GetEnsembleMappingDict                                                           // tclStubInit.c:1540:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4408)) = XTcl_GetEnsembleUnknownHandler                                                        // tclStubInit.c:1541:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4416)) = XTcl_GetEnsembleFlags                                                                 // tclStubInit.c:1542:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4424)) = XTcl_GetEnsembleNamespace                                                             // tclStubInit.c:1543:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4432)) = XTcl_SetTimeProc                                                                             // tclStubInit.c:1544:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4440)) = XTcl_QueryTimeProc                                                                              // tclStubInit.c:1545:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4448)) = XTcl_ChannelThreadActionProc                                                                              // tclStubInit.c:1546:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4456)) = XTcl_NewBignumObj                                                                                         // tclStubInit.c:1547:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4464)) = XTcl_DbNewBignumObj                                                                       // tclStubInit.c:1548:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4472)) = XTcl_SetBignumObj                                                                                        // tclStubInit.c:1549:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4480)) = XTcl_GetBignumFromObj                                                                     // tclStubInit.c:1550:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4488)) = XTcl_TakeBignumFromObj                                                                    // tclStubInit.c:1551:5:
	*(*func(*libc.TLS, Tcl_Channel, Tcl_WideInt) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4496)) = XTcl_TruncateChannel                                                                       // tclStubInit.c:1552:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4504)) = XTcl_ChannelTruncateProc                                                                                  // tclStubInit.c:1553:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4512)) = XTcl_SetChannelErrorInterp                                                                               // tclStubInit.c:1554:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4520)) = XTcl_GetChannelErrorInterp                                                                               // tclStubInit.c:1555:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4528)) = XTcl_SetChannelError                                                                                 // tclStubInit.c:1556:5:
	*(*func(*libc.TLS, Tcl_Channel, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4536)) = XTcl_GetChannelError                                                                                 // tclStubInit.c:1557:5:
	*(*func(*libc.TLS, uintptr, float64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4544)) = XTcl_InitBignumFromDouble                                                                 // tclStubInit.c:1558:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4552)) = XTcl_GetNamespaceUnknownHandler                                                                  // tclStubInit.c:1559:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4560)) = XTcl_SetNamespaceUnknownHandler                                                           // tclStubInit.c:1560:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4568)) = XTcl_GetEncodingFromObj                                                                   // tclStubInit.c:1561:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4576)) = XTcl_GetEncodingSearchPath                                                                                         // tclStubInit.c:1562:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4584)) = XTcl_SetEncodingSearchPath                                                                                  // tclStubInit.c:1563:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4592)) = XTcl_GetEncodingNameFromEnvironment                                                                       // tclStubInit.c:1564:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4600)) = XTcl_PkgRequireProc                                                       // tclStubInit.c:1565:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4608)) = XTcl_AppendObjToErrorInfo                                                                                // tclStubInit.c:1566:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4616)) = XTcl_AppendLimitedToObj                                                           // tclStubInit.c:1567:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4624)) = XTcl_Format                                                                      // tclStubInit.c:1568:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4632)) = XTcl_AppendFormatToObj                                                    // tclStubInit.c:1569:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4640)) = XTcl_ObjPrintf                                                                                   // tclStubInit.c:1570:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4648)) = XTcl_AppendPrintfToObj                                                                          // tclStubInit.c:1571:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4656)) = XTcl_CancelEval                                                                 // tclStubInit.c:1572:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4664)) = XTcl_Canceled                                                                                        // tclStubInit.c:1573:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4672)) = XTcl_CreatePipe                                                                    // tclStubInit.c:1574:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, ClientData, uintptr) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4680)) = XTcl_NRCreateCommand                                  // tclStubInit.c:1575:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4688)) = XTcl_NREvalObj                                                                              // tclStubInit.c:1576:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4696)) = XTcl_NREvalObjv                                                                      // tclStubInit.c:1577:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4704)) = XTcl_NRCmdSwap                                                          // tclStubInit.c:1578:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, ClientData, ClientData, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4712)) = XTcl_NRAddCallback                                       // tclStubInit.c:1579:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4720)) = XTcl_NRCallObjProc                                                     // tclStubInit.c:1580:5:
	*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4728)) = XTcl_GetFSDeviceFromStat                                                                                   // tclStubInit.c:1581:5:
	*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4736)) = XTcl_GetFSInodeFromStat                                                                                    // tclStubInit.c:1582:5:
	*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4744)) = XTcl_GetModeFromStat                                                                                       // tclStubInit.c:1583:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4752)) = XTcl_GetLinkCountFromStat                                                                                   // tclStubInit.c:1584:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4760)) = XTcl_GetUserIdFromStat                                                                                      // tclStubInit.c:1585:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4768)) = XTcl_GetGroupIdFromStat                                                                                     // tclStubInit.c:1586:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4776)) = XTcl_GetDeviceTypeFromStat                                                                                  // tclStubInit.c:1587:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4784)) = XTcl_GetAccessTimeFromStat                                                                            // tclStubInit.c:1588:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4792)) = XTcl_GetModificationTimeFromStat                                                                      // tclStubInit.c:1589:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4800)) = XTcl_GetChangeTimeFromStat                                                                            // tclStubInit.c:1590:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideUInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4808)) = XTcl_GetSizeFromStat                                                                                 // tclStubInit.c:1591:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideUInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4816)) = XTcl_GetBlocksFromStat                                                                               // tclStubInit.c:1592:5:
	*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4824)) = XTcl_GetBlockSizeFromStat                                                                                  // tclStubInit.c:1593:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4832)) = XTcl_SetEnsembleParameterList                                                         // tclStubInit.c:1594:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4840)) = XTcl_GetEnsembleParameterList                                                         // tclStubInit.c:1595:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4848)) = XTcl_ParseArgsObjv                                                      // tclStubInit.c:1596:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4856)) = XTcl_GetErrorLine                                                                                           // tclStubInit.c:1597:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4864)) = XTcl_SetErrorLine                                                                                          // tclStubInit.c:1598:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4872)) = XTcl_TransferResult                                                                               // tclStubInit.c:1599:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4880)) = XTcl_InterpActive                                                                                           // tclStubInit.c:1600:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4888)) = XTcl_BackgroundException                                                                                   // tclStubInit.c:1601:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4896)) = XTcl_ZlibDeflate                                                            // tclStubInit.c:1602:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4904)) = XTcl_ZlibInflate                                                            // tclStubInit.c:1603:5:
	*(*func(*libc.TLS, uint32, uintptr, int32) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4912)) = XTcl_ZlibCRC32                                                                              // tclStubInit.c:1604:5:
	*(*func(*libc.TLS, uint32, uintptr, int32) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4920)) = XTcl_ZlibAdler32                                                                            // tclStubInit.c:1605:5:
	*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4928)) = XTcl_ZlibStreamInit                                                  // tclStubInit.c:1606:5:
	*(*func(*libc.TLS, Tcl_ZlibStream) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4936)) = XTcl_ZlibStreamGetCommandName                                                                      // tclStubInit.c:1607:5:
	*(*func(*libc.TLS, Tcl_ZlibStream) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4944)) = XTcl_ZlibStreamEof                                                                                   // tclStubInit.c:1608:5:
	*(*func(*libc.TLS, Tcl_ZlibStream) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4952)) = XTcl_ZlibStreamChecksum                                                                              // tclStubInit.c:1609:5:
	*(*func(*libc.TLS, Tcl_ZlibStream, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4960)) = XTcl_ZlibStreamPut                                                                   // tclStubInit.c:1610:5:
	*(*func(*libc.TLS, Tcl_ZlibStream, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4968)) = XTcl_ZlibStreamGet                                                                   // tclStubInit.c:1611:5:
	*(*func(*libc.TLS, Tcl_ZlibStream) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4976)) = XTcl_ZlibStreamClose                                                                                 // tclStubInit.c:1612:5:
	*(*func(*libc.TLS, Tcl_ZlibStream) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4984)) = XTcl_ZlibStreamReset                                                                                 // tclStubInit.c:1613:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 4992)) = XTcl_SetStartupScript                                                                                    // tclStubInit.c:1614:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5000)) = XTcl_GetStartupScript                                                                                     // tclStubInit.c:1615:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5008)) = XTcl_CloseEx                                                                            // tclStubInit.c:1616:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5016)) = XTcl_NRExprObj                                                                            // tclStubInit.c:1617:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5024)) = XTcl_NRSubstObj                                                                             // tclStubInit.c:1618:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5032)) = XTcl_LoadFile                                                    // tclStubInit.c:1619:5:
	*(*func(*libc.TLS, uintptr, Tcl_LoadHandle, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5040)) = XTcl_FindSymbol                                                                  // tclStubInit.c:1620:5:
	*(*func(*libc.TLS, uintptr, Tcl_LoadHandle) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5048)) = XTcl_FSUnloadFile                                                                           // tclStubInit.c:1621:5:
	*(*func(*libc.TLS, Tcl_ZlibStream, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclStubs)) + 5056)) = XTcl_ZlibStreamSetCompressionDictionary                                                           // tclStubInit.c:1622:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 16)) = XTclBN_epoch                                                                                                    // tclStubInit.c:876:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 24)) = XTclBN_revision                                                                                                 // tclStubInit.c:877:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 32)) = XTclBN_mp_add                                                                       // tclStubInit.c:878:5:
	*(*func(*libc.TLS, uintptr, Mp_digit, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 40)) = XTclBN_mp_add_d                                                                    // tclStubInit.c:879:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 48)) = XTclBN_mp_and                                                                       // tclStubInit.c:880:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 56)) = XTclBN_mp_clamp                                                                                              // tclStubInit.c:881:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 64)) = XTclBN_mp_clear                                                                                              // tclStubInit.c:882:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 72)) = XTclBN_mp_clear_multi                                                                               // tclStubInit.c:883:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_ord)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 80)) = XTclBN_mp_cmp                                                                                // tclStubInit.c:884:5:
	*(*func(*libc.TLS, uintptr, Mp_digit) Mp_ord)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 88)) = XTclBN_mp_cmp_d                                                                             // tclStubInit.c:885:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_ord)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 96)) = XTclBN_mp_cmp_mag                                                                            // tclStubInit.c:886:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 104)) = XTclBN_mp_copy                                                                              // tclStubInit.c:887:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 112)) = XTclBN_mp_count_bits                                                                                  // tclStubInit.c:888:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 120)) = XTclBN_mp_div                                                             // tclStubInit.c:889:5:
	*(*func(*libc.TLS, uintptr, Mp_digit, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 128)) = XTclBN_mp_div_d                                                          // tclStubInit.c:890:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 136)) = XTclBN_mp_div_2                                                                             // tclStubInit.c:891:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 144)) = XTclBN_mp_div_2d                                                            // tclStubInit.c:892:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 152)) = XTclBN_mp_div_3                                                                    // tclStubInit.c:893:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 160)) = XTclBN_mp_exch                                                                                     // tclStubInit.c:894:5:
	*(*func(*libc.TLS, uintptr, uint32, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 168)) = XTclBN_mp_expt_d                                                                    // tclStubInit.c:895:5:
	*(*func(*libc.TLS, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 176)) = XTclBN_mp_grow                                                                                // tclStubInit.c:896:5:
	*(*func(*libc.TLS, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 184)) = XTclBN_mp_init                                                                                       // tclStubInit.c:897:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 192)) = XTclBN_mp_init_copy                                                                         // tclStubInit.c:898:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 200)) = XTclBN_mp_init_multi                                                                        // tclStubInit.c:899:5:
	*(*func(*libc.TLS, uintptr, Mp_digit) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 208)) = XTclBN_mp_init_set                                                                         // tclStubInit.c:900:5:
	*(*func(*libc.TLS, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 216)) = XTclBN_mp_init_size                                                                           // tclStubInit.c:901:5:
	*(*func(*libc.TLS, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 224)) = XTclBN_mp_lshd                                                                                // tclStubInit.c:902:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 232)) = XTclBN_mp_mod                                                                      // tclStubInit.c:903:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 240)) = XTclBN_mp_mod_2d                                                                     // tclStubInit.c:904:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 248)) = XTclBN_mp_mul                                                                      // tclStubInit.c:905:5:
	*(*func(*libc.TLS, uintptr, Mp_digit, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 256)) = XTclBN_mp_mul_d                                                                   // tclStubInit.c:906:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 264)) = XTclBN_mp_mul_2                                                                             // tclStubInit.c:907:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 272)) = XTclBN_mp_mul_2d                                                                     // tclStubInit.c:908:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 280)) = XTclBN_mp_neg                                                                               // tclStubInit.c:909:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 288)) = XTclBN_mp_or                                                                       // tclStubInit.c:910:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 296)) = XTclBN_mp_radix_size                                                                 // tclStubInit.c:911:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 304)) = XTclBN_mp_read_radix                                                                 // tclStubInit.c:912:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 312)) = XTclBN_mp_rshd                                                                                       // tclStubInit.c:913:5:
	*(*func(*libc.TLS, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 320)) = XTclBN_mp_shrink                                                                                     // tclStubInit.c:914:5:
	*(*func(*libc.TLS, uintptr, Mp_digit))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 328)) = XTclBN_mp_set                                                                                     // tclStubInit.c:915:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 336)) = XTclBN_mp_sqr                                                                               // tclStubInit.c:916:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 344)) = XTclBN_mp_sqrt                                                                              // tclStubInit.c:917:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 352)) = XTclBN_mp_sub                                                                      // tclStubInit.c:918:5:
	*(*func(*libc.TLS, uintptr, Mp_digit, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 360)) = XTclBN_mp_sub_d                                                                   // tclStubInit.c:919:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 368)) = XTclBN_mp_to_unsigned_bin                                                                   // tclStubInit.c:920:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 376)) = XTclBN_mp_to_unsigned_bin_n                                                        // tclStubInit.c:921:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 384)) = XTclBN_mp_toradix_n                                                           // tclStubInit.c:922:5:
	*(*func(*libc.TLS, uintptr) Size_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 392)) = XTclBN_mp_unsigned_bin_size                                                                          // tclStubInit.c:923:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 400)) = XTclBN_mp_xor                                                                      // tclStubInit.c:924:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 408)) = XTclBN_mp_zero                                                                                              // tclStubInit.c:925:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 416)) = XTclBN_reverse                                                                                       // tclStubInit.c:926:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 424)) = XTclBN_fast_s_mp_mul_digs                                                   // tclStubInit.c:927:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 432)) = XTclBN_fast_s_mp_sqr                                                                        // tclStubInit.c:928:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 440)) = XTclBN_mp_karatsuba_mul                                                            // tclStubInit.c:929:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 448)) = XTclBN_mp_karatsuba_sqr                                                                     // tclStubInit.c:930:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 456)) = XTclBN_mp_toom_mul                                                                 // tclStubInit.c:931:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 464)) = XTclBN_mp_toom_sqr                                                                          // tclStubInit.c:932:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 472)) = XTclBN_s_mp_add                                                                    // tclStubInit.c:933:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 480)) = XTclBN_s_mp_mul_digs                                                        // tclStubInit.c:934:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 488)) = XTclBN_s_mp_sqr                                                                             // tclStubInit.c:935:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 496)) = XTclBN_s_mp_sub                                                                    // tclStubInit.c:936:5:
	*(*func(*libc.TLS, uintptr, uint64) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 504)) = XTclBN_mp_init_set_int                                                                       // tclStubInit.c:937:5:
	*(*func(*libc.TLS, uintptr, uint64) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 512)) = XTclBN_mp_set_int                                                                            // tclStubInit.c:938:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 520)) = XTclBN_mp_cnt_lsb                                                                                     // tclStubInit.c:939:5:
	*(*func(*libc.TLS, uintptr, int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 528)) = XTclBNInitBignumFromLong                                                                       // tclStubInit.c:940:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideInt) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 536)) = XTclBNInitBignumFromWideInt                                                              // tclStubInit.c:941:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideUInt) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 544)) = XTclBNInitBignumFromWideUInt                                                            // tclStubInit.c:942:5:
	*(*func(*libc.TLS, uintptr, Mp_digit, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 552)) = XTclBN_mp_expt_d_ex                                                         // tclStubInit.c:943:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideUInt))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 560)) = XTclBN_mp_set_ull                                                                             // tclStubInit.c:944:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideUInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 568)) = XTclBN_mp_get_mag_ull                                                                          // tclStubInit.c:945:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideInt))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 576)) = XTclBN_mp_set_ll                                                                               // tclStubInit.c:946:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 600)) = XTclBN_mp_and                                                                      // tclStubInit.c:949:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 608)) = XTclBN_mp_or                                                                       // tclStubInit.c:950:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 616)) = XTclBN_mp_xor                                                                      // tclStubInit.c:951:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 624)) = XTclBN_mp_signed_rsh                                                                 // tclStubInit.c:952:5:
	*(*func(*libc.TLS, uintptr, uintptr, Size_t, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 640)) = XTclBN_mp_to_ubin                                                           // tclStubInit.c:954:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideUInt, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 648)) = sTclBNMpDivLd                                                        // tclStubInit.c:955:5:
	*(*func(*libc.TLS, uintptr, uintptr, Size_t, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 656)) = XTclBN_mp_to_radix                                                   // tclStubInit.c:956:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 16)) = XTclBN_epoch                                                                                                    // tclStubInit.c:876:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 24)) = XTclBN_revision                                                                                                 // tclStubInit.c:877:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 32)) = XTclBN_mp_add                                                                       // tclStubInit.c:878:5:
	*(*func(*libc.TLS, uintptr, Mp_digit, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 40)) = XTclBN_mp_add_d                                                                    // tclStubInit.c:879:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 48)) = XTclBN_mp_and                                                                       // tclStubInit.c:880:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 56)) = XTclBN_mp_clamp                                                                                              // tclStubInit.c:881:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 64)) = XTclBN_mp_clear                                                                                              // tclStubInit.c:882:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 72)) = XTclBN_mp_clear_multi                                                                               // tclStubInit.c:883:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_ord)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 80)) = XTclBN_mp_cmp                                                                                // tclStubInit.c:884:5:
	*(*func(*libc.TLS, uintptr, Mp_digit) Mp_ord)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 88)) = XTclBN_mp_cmp_d                                                                             // tclStubInit.c:885:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_ord)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 96)) = XTclBN_mp_cmp_mag                                                                            // tclStubInit.c:886:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 104)) = XTclBN_mp_copy                                                                              // tclStubInit.c:887:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 112)) = XTclBN_mp_count_bits                                                                                  // tclStubInit.c:888:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 120)) = XTclBN_mp_div                                                             // tclStubInit.c:889:5:
	*(*func(*libc.TLS, uintptr, Mp_digit, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 128)) = XTclBN_mp_div_d                                                          // tclStubInit.c:890:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 136)) = XTclBN_mp_div_2                                                                             // tclStubInit.c:891:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 144)) = XTclBN_mp_div_2d                                                            // tclStubInit.c:892:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 152)) = XTclBN_mp_div_3                                                                    // tclStubInit.c:893:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 160)) = XTclBN_mp_exch                                                                                     // tclStubInit.c:894:5:
	*(*func(*libc.TLS, uintptr, uint32, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 168)) = XTclBN_mp_expt_d                                                                    // tclStubInit.c:895:5:
	*(*func(*libc.TLS, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 176)) = XTclBN_mp_grow                                                                                // tclStubInit.c:896:5:
	*(*func(*libc.TLS, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 184)) = XTclBN_mp_init                                                                                       // tclStubInit.c:897:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 192)) = XTclBN_mp_init_copy                                                                         // tclStubInit.c:898:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 200)) = XTclBN_mp_init_multi                                                                        // tclStubInit.c:899:5:
	*(*func(*libc.TLS, uintptr, Mp_digit) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 208)) = XTclBN_mp_init_set                                                                         // tclStubInit.c:900:5:
	*(*func(*libc.TLS, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 216)) = XTclBN_mp_init_size                                                                           // tclStubInit.c:901:5:
	*(*func(*libc.TLS, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 224)) = XTclBN_mp_lshd                                                                                // tclStubInit.c:902:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 232)) = XTclBN_mp_mod                                                                      // tclStubInit.c:903:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 240)) = XTclBN_mp_mod_2d                                                                     // tclStubInit.c:904:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 248)) = XTclBN_mp_mul                                                                      // tclStubInit.c:905:5:
	*(*func(*libc.TLS, uintptr, Mp_digit, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 256)) = XTclBN_mp_mul_d                                                                   // tclStubInit.c:906:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 264)) = XTclBN_mp_mul_2                                                                             // tclStubInit.c:907:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 272)) = XTclBN_mp_mul_2d                                                                     // tclStubInit.c:908:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 280)) = XTclBN_mp_neg                                                                               // tclStubInit.c:909:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 288)) = XTclBN_mp_or                                                                       // tclStubInit.c:910:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 296)) = XTclBN_mp_radix_size                                                                 // tclStubInit.c:911:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 304)) = XTclBN_mp_read_radix                                                                 // tclStubInit.c:912:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 312)) = XTclBN_mp_rshd                                                                                       // tclStubInit.c:913:5:
	*(*func(*libc.TLS, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 320)) = XTclBN_mp_shrink                                                                                     // tclStubInit.c:914:5:
	*(*func(*libc.TLS, uintptr, Mp_digit))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 328)) = XTclBN_mp_set                                                                                     // tclStubInit.c:915:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 336)) = XTclBN_mp_sqr                                                                               // tclStubInit.c:916:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 344)) = XTclBN_mp_sqrt                                                                              // tclStubInit.c:917:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 352)) = XTclBN_mp_sub                                                                      // tclStubInit.c:918:5:
	*(*func(*libc.TLS, uintptr, Mp_digit, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 360)) = XTclBN_mp_sub_d                                                                   // tclStubInit.c:919:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 368)) = XTclBN_mp_to_unsigned_bin                                                                   // tclStubInit.c:920:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 376)) = XTclBN_mp_to_unsigned_bin_n                                                        // tclStubInit.c:921:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 384)) = XTclBN_mp_toradix_n                                                           // tclStubInit.c:922:5:
	*(*func(*libc.TLS, uintptr) Size_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 392)) = XTclBN_mp_unsigned_bin_size                                                                          // tclStubInit.c:923:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 400)) = XTclBN_mp_xor                                                                      // tclStubInit.c:924:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 408)) = XTclBN_mp_zero                                                                                              // tclStubInit.c:925:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 416)) = XTclBN_reverse                                                                                       // tclStubInit.c:926:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 424)) = XTclBN_fast_s_mp_mul_digs                                                   // tclStubInit.c:927:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 432)) = XTclBN_fast_s_mp_sqr                                                                        // tclStubInit.c:928:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 440)) = XTclBN_mp_karatsuba_mul                                                            // tclStubInit.c:929:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 448)) = XTclBN_mp_karatsuba_sqr                                                                     // tclStubInit.c:930:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 456)) = XTclBN_mp_toom_mul                                                                 // tclStubInit.c:931:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 464)) = XTclBN_mp_toom_sqr                                                                          // tclStubInit.c:932:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 472)) = XTclBN_s_mp_add                                                                    // tclStubInit.c:933:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 480)) = XTclBN_s_mp_mul_digs                                                        // tclStubInit.c:934:5:
	*(*func(*libc.TLS, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 488)) = XTclBN_s_mp_sqr                                                                             // tclStubInit.c:935:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 496)) = XTclBN_s_mp_sub                                                                    // tclStubInit.c:936:5:
	*(*func(*libc.TLS, uintptr, uint64) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 504)) = XTclBN_mp_init_set_int                                                                       // tclStubInit.c:937:5:
	*(*func(*libc.TLS, uintptr, uint64) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 512)) = XTclBN_mp_set_int                                                                            // tclStubInit.c:938:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 520)) = XTclBN_mp_cnt_lsb                                                                                     // tclStubInit.c:939:5:
	*(*func(*libc.TLS, uintptr, int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 528)) = XTclBNInitBignumFromLong                                                                       // tclStubInit.c:940:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideInt) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 536)) = XTclBNInitBignumFromWideInt                                                              // tclStubInit.c:941:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideUInt) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 544)) = XTclBNInitBignumFromWideUInt                                                            // tclStubInit.c:942:5:
	*(*func(*libc.TLS, uintptr, Mp_digit, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 552)) = XTclBN_mp_expt_d_ex                                                         // tclStubInit.c:943:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideUInt))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 560)) = XTclBN_mp_set_ull                                                                             // tclStubInit.c:944:5:
	*(*func(*libc.TLS, uintptr) Tcl_WideUInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 568)) = XTclBN_mp_get_mag_ull                                                                          // tclStubInit.c:945:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideInt))(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 576)) = XTclBN_mp_set_ll                                                                               // tclStubInit.c:946:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 600)) = XTclBN_mp_and                                                                      // tclStubInit.c:949:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 608)) = XTclBN_mp_or                                                                       // tclStubInit.c:950:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 616)) = XTclBN_mp_xor                                                                      // tclStubInit.c:951:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 624)) = XTclBN_mp_signed_rsh                                                                 // tclStubInit.c:952:5:
	*(*func(*libc.TLS, uintptr, uintptr, Size_t, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 640)) = XTclBN_mp_to_ubin                                                           // tclStubInit.c:954:5:
	*(*func(*libc.TLS, uintptr, Tcl_WideUInt, uintptr, uintptr) Mp_err)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 648)) = sTclBNMpDivLd                                                        // tclStubInit.c:955:5:
	*(*func(*libc.TLS, uintptr, uintptr, Size_t, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclTomMathStubs)) + 656)) = XTclBN_mp_to_radix                                                   // tclStubInit.c:956:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 0)) = sGetGroupAttribute                                                           // tclUnixFCmd.c:175:6:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 8)) = sSetGroupAttribute                                                           // tclUnixFCmd.c:175:25:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 16)) = sGetOwnerAttribute                                                          // tclUnixFCmd.c:179:6:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 24)) = sSetOwnerAttribute                                                          // tclUnixFCmd.c:179:25:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 32)) = sGetPermissionsAttribute                                                    // tclUnixFCmd.c:180:6:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 40)) = sSetPermissionsAttribute                                                    // tclUnixFCmd.c:180:31:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 0)) = sGetGroupAttribute                                                           // tclUnixFCmd.c:175:6:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 8)) = sSetGroupAttribute                                                           // tclUnixFCmd.c:175:25:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 16)) = sGetOwnerAttribute                                                          // tclUnixFCmd.c:179:6:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 24)) = sSetOwnerAttribute                                                          // tclUnixFCmd.c:179:25:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 32)) = sGetPermissionsAttribute                                                    // tclUnixFCmd.c:180:6:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&XtclpFileAttrProcs)) + 40)) = sSetPermissionsAttribute                                                    // tclUnixFCmd.c:180:31:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&allocLockPtr)) + 0)) = uintptr(unsafe.Pointer(&allocLock))                                                                                                // tclUnixThrd.c:45:40:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 8)) = sArrayAnyMoreCmd                                                                // tclVar.c:4104:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 16)) = XTclCompileBasic2ArgCmd                                                         // tclVar.c:4104:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 56)) = sArrayDoneSearchCmd                                                            // tclVar.c:4105:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 64)) = XTclCompileBasic2ArgCmd                                                         // tclVar.c:4105:37:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 104)) = sArrayExistsCmd                                                               // tclVar.c:4106:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 112)) = XTclCompileArrayExistsCmd                                                      // tclVar.c:4106:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 152)) = sArrayGetCmd                                                                  // tclVar.c:4107:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 160)) = XTclCompileBasic1Or2ArgCmd                                                     // tclVar.c:4107:25:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 200)) = sArrayNamesCmd                                                                // tclVar.c:4108:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 208)) = XTclCompileBasic1To3ArgCmd                                                     // tclVar.c:4108:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 248)) = sArrayNextElementCmd                                                          // tclVar.c:4109:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 256)) = XTclCompileBasic2ArgCmd                                                        // tclVar.c:4109:39:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 296)) = sArraySetCmd                                                                  // tclVar.c:4110:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 304)) = XTclCompileArraySetCmd                                                         // tclVar.c:4110:25:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 344)) = sArraySizeCmd                                                                 // tclVar.c:4111:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 352)) = XTclCompileBasic1ArgCmd                                                        // tclVar.c:4111:26:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 392)) = sArrayStartSearchCmd                                                          // tclVar.c:4112:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 400)) = XTclCompileBasic1ArgCmd                                                        // tclVar.c:4112:39:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 440)) = sArrayStatsCmd                                                                // tclVar.c:4113:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 448)) = XTclCompileBasic1ArgCmd                                                        // tclVar.c:4113:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 488)) = sArrayUnsetCmd                                                                // tclVar.c:4114:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&arrayImplMap)) + 496)) = XTclCompileArrayUnsetCmd                                                       // tclVar.c:4114:28:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&assembleCodeType)) + 8)) = sFreeAssembleCodeInternalRep                                                                                  // tclAssembly.c:322:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&assembleCodeType)) + 16)) = sDupAssembleCodeInternalRep                                                                         // tclAssembly.c:323:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&binaryMap)) + 8)) = sBinaryFormatCmd                                                                   // tclBinary.c:138:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&binaryMap)) + 16)) = XTclCompileBasicMin1ArgCmd                                                         // tclBinary.c:138:34:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&binaryMap)) + 56)) = XBinaryScanCmd                                                                    // tclBinary.c:139:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&binaryMap)) + 64)) = XTclCompileBasicMin2ArgCmd                                                         // tclBinary.c:139:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 8)) = XTcl_AppendObjCmd                                                                // tclBasic.c:204:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 16)) = XTclCompileAppendCmd                                                             // tclBasic.c:204:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 48)) = XTcl_ApplyObjCmd                                                                // tclBasic.c:205:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 64)) = XTclNRApplyObjCmd                                                               // tclBasic.c:205:41:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 88)) = XTcl_BreakObjCmd                                                                // tclBasic.c:206:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 96)) = XTclCompileBreakCmd                                                              // tclBasic.c:206:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 128)) = XTcl_CaseObjCmd                                                                // tclBasic.c:208:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 168)) = XTcl_CatchObjCmd                                                               // tclBasic.c:210:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 176)) = XTclCompileCatchCmd                                                             // tclBasic.c:210:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 184)) = XTclNRCatchObjCmd                                                              // tclBasic.c:210:53:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 208)) = XTcl_ConcatObjCmd                                                              // tclBasic.c:211:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 216)) = XTclCompileConcatCmd                                                            // tclBasic.c:211:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 248)) = XTcl_ContinueObjCmd                                                            // tclBasic.c:212:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 256)) = XTclCompileContinueCmd                                                          // tclBasic.c:212:38:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 304)) = XTclNRCoroutineObjCmd                                                          // tclBasic.c:213:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 328)) = XTcl_ErrorObjCmd                                                               // tclBasic.c:214:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 336)) = XTclCompileErrorCmd                                                             // tclBasic.c:214:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 368)) = XTcl_EvalObjCmd                                                                // tclBasic.c:215:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 384)) = XTclNREvalObjCmd                                                               // tclBasic.c:215:40:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 408)) = XTcl_ExprObjCmd                                                                // tclBasic.c:216:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 416)) = XTclCompileExprCmd                                                              // tclBasic.c:216:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 424)) = XTclNRExprObjCmd                                                               // tclBasic.c:216:51:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 448)) = XTcl_ForObjCmd                                                                 // tclBasic.c:217:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 456)) = XTclCompileForCmd                                                               // tclBasic.c:217:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 464)) = XTclNRForObjCmd                                                                // tclBasic.c:217:48:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 488)) = XTcl_ForeachObjCmd                                                             // tclBasic.c:218:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 496)) = XTclCompileForeachCmd                                                           // tclBasic.c:218:37:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 504)) = XTclNRForeachCmd                                                               // tclBasic.c:218:59:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 528)) = XTcl_FormatObjCmd                                                              // tclBasic.c:219:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 536)) = XTclCompileFormatCmd                                                            // tclBasic.c:219:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 568)) = XTcl_GlobalObjCmd                                                              // tclBasic.c:220:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 576)) = XTclCompileGlobalCmd                                                            // tclBasic.c:220:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 608)) = XTcl_IfObjCmd                                                                  // tclBasic.c:221:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 616)) = XTclCompileIfCmd                                                                // tclBasic.c:221:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 624)) = XTclNRIfObjCmd                                                                 // tclBasic.c:221:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 648)) = XTcl_IncrObjCmd                                                                // tclBasic.c:222:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 656)) = XTclCompileIncrCmd                                                              // tclBasic.c:222:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 688)) = XTcl_JoinObjCmd                                                                // tclBasic.c:223:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 728)) = XTcl_LappendObjCmd                                                             // tclBasic.c:224:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 736)) = XTclCompileLappendCmd                                                           // tclBasic.c:224:37:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 768)) = XTcl_LassignObjCmd                                                             // tclBasic.c:225:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 776)) = XTclCompileLassignCmd                                                           // tclBasic.c:225:37:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 808)) = XTcl_LindexObjCmd                                                              // tclBasic.c:226:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 816)) = XTclCompileLindexCmd                                                            // tclBasic.c:226:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 848)) = XTcl_LinsertObjCmd                                                             // tclBasic.c:227:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 856)) = XTclCompileLinsertCmd                                                           // tclBasic.c:227:37:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 888)) = XTcl_ListObjCmd                                                                // tclBasic.c:228:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 896)) = XTclCompileListCmd                                                              // tclBasic.c:228:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 928)) = XTcl_LlengthObjCmd                                                             // tclBasic.c:229:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 936)) = XTclCompileLlengthCmd                                                           // tclBasic.c:229:37:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 968)) = XTcl_LmapObjCmd                                                                // tclBasic.c:230:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 976)) = XTclCompileLmapCmd                                                              // tclBasic.c:230:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 984)) = XTclNRLmapCmd                                                                  // tclBasic.c:230:51:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1008)) = XTcl_LrangeObjCmd                                                             // tclBasic.c:231:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1016)) = XTclCompileLrangeCmd                                                           // tclBasic.c:231:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1048)) = XTcl_LrepeatObjCmd                                                            // tclBasic.c:232:18:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1088)) = XTcl_LreplaceObjCmd                                                           // tclBasic.c:233:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1096)) = XTclCompileLreplaceCmd                                                         // tclBasic.c:233:38:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1128)) = XTcl_LreverseObjCmd                                                           // tclBasic.c:234:18:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1168)) = XTcl_LsearchObjCmd                                                            // tclBasic.c:235:18:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1208)) = XTcl_LsetObjCmd                                                               // tclBasic.c:236:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1216)) = XTclCompileLsetCmd                                                             // tclBasic.c:236:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1248)) = XTcl_LsortObjCmd                                                              // tclBasic.c:237:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1288)) = XTcl_PackageObjCmd                                                            // tclBasic.c:238:18:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1304)) = XTclNRPackageObjCmd                                                           // tclBasic.c:238:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1328)) = XTcl_ProcObjCmd                                                               // tclBasic.c:239:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1368)) = XTcl_RegexpObjCmd                                                             // tclBasic.c:240:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1376)) = XTclCompileRegexpCmd                                                           // tclBasic.c:240:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1408)) = XTcl_RegsubObjCmd                                                             // tclBasic.c:241:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1416)) = XTclCompileRegsubCmd                                                           // tclBasic.c:241:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1448)) = XTcl_RenameObjCmd                                                             // tclBasic.c:242:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1488)) = XTcl_ReturnObjCmd                                                             // tclBasic.c:243:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1496)) = XTclCompileReturnCmd                                                           // tclBasic.c:243:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1528)) = XTcl_ScanObjCmd                                                               // tclBasic.c:244:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1568)) = XTcl_SetObjCmd                                                                // tclBasic.c:245:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1576)) = XTclCompileSetCmd                                                              // tclBasic.c:245:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1608)) = XTcl_SplitObjCmd                                                              // tclBasic.c:246:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1648)) = XTcl_SubstObjCmd                                                              // tclBasic.c:247:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1656)) = XTclCompileSubstCmd                                                            // tclBasic.c:247:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1664)) = XTclNRSubstObjCmd                                                             // tclBasic.c:247:53:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1688)) = XTcl_SwitchObjCmd                                                             // tclBasic.c:248:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1696)) = XTclCompileSwitchCmd                                                           // tclBasic.c:248:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1704)) = XTclNRSwitchObjCmd                                                            // tclBasic.c:248:56:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1736)) = XTclCompileTailcallCmd                                                         // tclBasic.c:249:26:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1744)) = XTclNRTailcallObjCmd                                                          // tclBasic.c:249:49:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1768)) = XTcl_ThrowObjCmd                                                              // tclBasic.c:250:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1776)) = XTclCompileThrowCmd                                                            // tclBasic.c:250:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1808)) = XTcl_TraceObjCmd                                                              // tclBasic.c:251:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1848)) = XTcl_TryObjCmd                                                                // tclBasic.c:252:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1856)) = XTclCompileTryCmd                                                              // tclBasic.c:252:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1864)) = XTclNRTryObjCmd                                                               // tclBasic.c:252:48:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1888)) = XTcl_UnsetObjCmd                                                              // tclBasic.c:253:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1896)) = XTclCompileUnsetCmd                                                            // tclBasic.c:253:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1928)) = XTcl_UplevelObjCmd                                                            // tclBasic.c:254:18:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1944)) = XTclNRUplevelObjCmd                                                           // tclBasic.c:254:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1968)) = XTcl_UpvarObjCmd                                                              // tclBasic.c:255:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 1976)) = XTclCompileUpvarCmd                                                            // tclBasic.c:255:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2008)) = XTcl_VariableObjCmd                                                           // tclBasic.c:256:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2016)) = XTclCompileVariableCmd                                                         // tclBasic.c:256:38:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2048)) = XTcl_WhileObjCmd                                                              // tclBasic.c:257:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2056)) = XTclCompileWhileCmd                                                            // tclBasic.c:257:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2064)) = XTclNRWhileObjCmd                                                             // tclBasic.c:257:53:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2096)) = XTclCompileYieldCmd                                                            // tclBasic.c:258:24:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2104)) = XTclNRYieldObjCmd                                                             // tclBasic.c:258:44:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2136)) = XTclCompileYieldToCmd                                                          // tclBasic.c:259:26:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2144)) = XTclNRYieldToObjCmd                                                           // tclBasic.c:259:48:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2168)) = XTcl_AfterObjCmd                                                              // tclBasic.c:265:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2208)) = XTcl_CdObjCmd                                                                 // tclBasic.c:266:13:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2248)) = XTcl_CloseObjCmd                                                              // tclBasic.c:267:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2288)) = XTcl_EofObjCmd                                                                // tclBasic.c:268:14:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2328)) = XTcl_ExecObjCmd                                                               // tclBasic.c:269:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2368)) = XTcl_ExitObjCmd                                                               // tclBasic.c:270:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2408)) = XTcl_FblockedObjCmd                                                           // tclBasic.c:271:18:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2448)) = XTcl_FconfigureObjCmd                                                         // tclBasic.c:272:20:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2488)) = XTcl_FcopyObjCmd                                                              // tclBasic.c:273:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2528)) = XTcl_FileEventObjCmd                                                          // tclBasic.c:274:19:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2568)) = XTcl_FlushObjCmd                                                              // tclBasic.c:275:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2608)) = XTcl_GetsObjCmd                                                               // tclBasic.c:276:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2648)) = XTcl_GlobObjCmd                                                               // tclBasic.c:277:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2688)) = XTcl_LoadObjCmd                                                               // tclBasic.c:278:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2728)) = XTcl_OpenObjCmd                                                               // tclBasic.c:279:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2768)) = XTcl_PidObjCmd                                                                // tclBasic.c:280:14:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2808)) = XTcl_PutsObjCmd                                                               // tclBasic.c:281:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2848)) = XTcl_PwdObjCmd                                                                // tclBasic.c:282:14:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2888)) = XTcl_ReadObjCmd                                                               // tclBasic.c:283:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2928)) = XTcl_SeekObjCmd                                                               // tclBasic.c:284:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 2968)) = XTcl_SocketObjCmd                                                             // tclBasic.c:285:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 3008)) = XTcl_SourceObjCmd                                                             // tclBasic.c:286:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 3024)) = XTclNRSourceObjCmd                                                            // tclBasic.c:286:43:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 3048)) = XTcl_TellObjCmd                                                               // tclBasic.c:287:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 3088)) = XTcl_TimeObjCmd                                                               // tclBasic.c:288:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 3128)) = XTcl_UnloadObjCmd                                                             // tclBasic.c:292:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 3168)) = XTcl_UpdateObjCmd                                                             // tclBasic.c:293:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&builtInCmds)) + 3208)) = XTcl_VwaitObjCmd                                                              // tclBasic.c:294:16:
	*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&chainHashType)) + 8)) = XTclHashObjKey                                                                                   // tclDictObj.c:184:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&chainHashType)) + 16)) = XTclCompareObjKeys                                                                               // tclDictObj.c:185:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&chainHashType)) + 24)) = sAllocChainEntry                                                                               // tclDictObj.c:186:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&chainHashType)) + 32)) = XTclFreeObjEntry                                                                                                // tclDictObj.c:187:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&chanObjType)) + 8)) = sFreeChannelInternalRep                                                                                            // tclIO.c:332:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&chanObjType)) + 16)) = sDupChannelInternalRep                                                                                   // tclIO.c:333:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&classConstructor)) + 16)) = XTclOO_Class_Constructor                                // tclOO.c:131:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockCommands)) + 8)) = XClockGetenvObjCmd                                                             // tclClock.c:211:19:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockCommands)) + 24)) = XTclClockOldscanObjCmd                                                        // tclClock.c:212:19:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockCommands)) + 40)) = sClockConvertlocaltoutcObjCmd                                                 // tclClock.c:213:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockCommands)) + 56)) = XClockGetdatefieldsObjCmd                                                     // tclClock.c:214:25:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockCommands)) + 72)) = sClockGetjuliandayfromerayearmonthdayObjCmd                                   // tclClock.c:216:3:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockCommands)) + 88)) = sClockGetjuliandayfromerayearweekdayObjCmd                                    // tclClock.c:218:3:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockCommands)) + 104)) = sClockParseformatargsObjCmd                                                  // tclClock.c:219:26:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockImplMap)) + 16)) = XTclCompileBasicMin1ArgCmd                                                      // tclClock.c:255:44:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockImplMap)) + 56)) = XClockClicksObjCmd                                                             // tclClock.c:256:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockImplMap)) + 64)) = XTclCompileClockClicksCmd                                                       // tclClock.c:256:44:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockImplMap)) + 112)) = XTclCompileBasicMin1ArgCmd                                                     // tclClock.c:257:44:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockImplMap)) + 152)) = XClockMicrosecondsObjCmd                                                      // tclClock.c:258:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockImplMap)) + 160)) = XTclCompileClockReadingCmd                                                     // tclClock.c:258:44:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockImplMap)) + 200)) = XClockMillisecondsObjCmd                                                      // tclClock.c:259:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockImplMap)) + 208)) = XTclCompileClockReadingCmd                                                     // tclClock.c:259:44:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockImplMap)) + 256)) = XTclCompileBasicMin1ArgCmd                                                     // tclClock.c:260:44:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockImplMap)) + 296)) = XClockSecondsObjCmd                                                           // tclClock.c:261:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clockImplMap)) + 304)) = XTclCompileClockReadingCmd                                                     // tclClock.c:261:44:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clsMethods)) + 32)) = XTclOO_Class_Create                                           // tclOO.c:118:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clsMethods)) + 88)) = XTclOO_Class_New                                              // tclOO.c:119:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&clsMethods)) + 144)) = XTclOO_Class_CreateNs                                        // tclOO.c:120:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&decodeMap)) + 8)) = sBinaryDecodeHex                                                                   // tclBinary.c:151:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&decodeMap)) + 16)) = XTclCompileBasic1Or2ArgCmd                                                         // tclBinary.c:151:36:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&decodeMap)) + 56)) = sBinaryDecodeUu                                                                   // tclBinary.c:152:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&decodeMap)) + 64)) = XTclCompileBasic1Or2ArgCmd                                                         // tclBinary.c:152:36:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&decodeMap)) + 104)) = sBinaryDecode64                                                                  // tclBinary.c:153:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&decodeMap)) + 112)) = XTclCompileBasic1Or2ArgCmd                                                        // tclBinary.c:153:36:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 8)) = sInfoArgsCmd                                                                  // tclCmdIL.c:156:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 16)) = XTclCompileBasic1ArgCmd                                                       // tclCmdIL.c:156:36:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 56)) = sInfoBodyCmd                                                                 // tclCmdIL.c:157:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 64)) = XTclCompileBasic1ArgCmd                                                       // tclCmdIL.c:157:36:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 104)) = sInfoCmdCountCmd                                                            // tclCmdIL.c:158:21:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 112)) = XTclCompileBasic0ArgCmd                                                      // tclCmdIL.c:158:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 152)) = sInfoCommandsCmd                                                            // tclCmdIL.c:159:21:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 160)) = XTclCompileInfoCommandsCmd                                                   // tclCmdIL.c:159:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 200)) = sInfoCompleteCmd                                                            // tclCmdIL.c:160:21:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 208)) = XTclCompileBasic1ArgCmd                                                      // tclCmdIL.c:160:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 248)) = XTclInfoCoroutineCmd                                                        // tclCmdIL.c:161:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 256)) = XTclCompileInfoCoroutineCmd                                                  // tclCmdIL.c:161:47:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 296)) = sInfoDefaultCmd                                                             // tclCmdIL.c:162:21:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 304)) = XTclCompileBasic3ArgCmd                                                      // tclCmdIL.c:162:41:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 344)) = sInfoErrorStackCmd                                                          // tclCmdIL.c:163:23:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 352)) = XTclCompileBasic0Or1ArgCmd                                                   // tclCmdIL.c:163:46:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 392)) = XTclInfoExistsCmd                                                           // tclCmdIL.c:164:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 400)) = XTclCompileInfoExistsCmd                                                     // tclCmdIL.c:164:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 440)) = sInfoFrameCmd                                                               // tclCmdIL.c:165:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 448)) = XTclCompileBasic0Or1ArgCmd                                                   // tclCmdIL.c:165:37:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 488)) = sInfoFunctionsCmd                                                           // tclCmdIL.c:166:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 496)) = XTclCompileBasic0Or1ArgCmd                                                   // tclCmdIL.c:166:44:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 536)) = XTclInfoGlobalsCmd                                                          // tclCmdIL.c:167:21:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 544)) = XTclCompileBasic0Or1ArgCmd                                                   // tclCmdIL.c:167:44:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 584)) = sInfoHostnameCmd                                                            // tclCmdIL.c:168:21:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 592)) = XTclCompileBasic0ArgCmd                                                      // tclCmdIL.c:168:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 632)) = sInfoLevelCmd                                                               // tclCmdIL.c:169:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 640)) = XTclCompileInfoLevelCmd                                                      // tclCmdIL.c:169:37:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 680)) = sInfoLibraryCmd                                                             // tclCmdIL.c:170:21:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 688)) = XTclCompileBasic0ArgCmd                                                      // tclCmdIL.c:170:41:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 728)) = sInfoLoadedCmd                                                              // tclCmdIL.c:171:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 736)) = XTclCompileBasic0Or1ArgCmd                                                   // tclCmdIL.c:171:39:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 776)) = XTclInfoLocalsCmd                                                           // tclCmdIL.c:172:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 784)) = XTclCompileBasic0Or1ArgCmd                                                   // tclCmdIL.c:172:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 824)) = sInfoNameOfExecutableCmd                                                    // tclCmdIL.c:173:28:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 832)) = XTclCompileBasic0ArgCmd                                                      // tclCmdIL.c:173:53:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 872)) = sInfoPatchLevelCmd                                                          // tclCmdIL.c:174:23:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 880)) = XTclCompileBasic0ArgCmd                                                      // tclCmdIL.c:174:46:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 920)) = sInfoProcsCmd                                                               // tclCmdIL.c:175:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 928)) = XTclCompileBasic0Or1ArgCmd                                                   // tclCmdIL.c:175:37:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 968)) = sInfoScriptCmd                                                              // tclCmdIL.c:176:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 976)) = XTclCompileBasic0Or1ArgCmd                                                   // tclCmdIL.c:176:39:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 1016)) = sInfoSharedlibCmd                                                          // tclCmdIL.c:177:28:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 1024)) = XTclCompileBasic0ArgCmd                                                     // tclCmdIL.c:177:50:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 1064)) = sInfoTclVersionCmd                                                         // tclCmdIL.c:178:23:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 1072)) = XTclCompileBasic0ArgCmd                                                     // tclCmdIL.c:178:46:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 1112)) = XTclInfoVarsCmd                                                            // tclCmdIL.c:179:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultInfoMap)) + 1120)) = XTclCompileBasic0Or1ArgCmd                                                  // tclCmdIL.c:179:38:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 8)) = sNamespaceChildrenCmd                                                    // tclNamesp.c:163:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 16)) = XTclCompileBasic0To2ArgCmd                                               // tclNamesp.c:163:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 56)) = sNamespaceCodeCmd                                                       // tclNamesp.c:164:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 64)) = XTclCompileNamespaceCodeCmd                                              // tclNamesp.c:164:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 104)) = sNamespaceCurrentCmd                                                   // tclNamesp.c:165:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 112)) = XTclCompileNamespaceCurrentCmd                                          // tclNamesp.c:165:41:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 152)) = sNamespaceDeleteCmd                                                    // tclNamesp.c:166:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 160)) = XTclCompileBasicMin0ArgCmd                                              // tclNamesp.c:166:39:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 200)) = XTclNamespaceEnsembleCmd                                               // tclNamesp.c:167:20:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 248)) = sNamespaceEvalCmd                                                      // tclNamesp.c:168:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 264)) = sNRNamespaceEvalCmd                                                    // tclNamesp.c:168:41:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 296)) = sNamespaceExistsCmd                                                    // tclNamesp.c:169:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 304)) = XTclCompileBasic1ArgCmd                                                 // tclNamesp.c:169:39:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 344)) = sNamespaceExportCmd                                                    // tclNamesp.c:170:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 352)) = XTclCompileBasicMin0ArgCmd                                              // tclNamesp.c:170:39:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 392)) = sNamespaceForgetCmd                                                    // tclNamesp.c:171:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 400)) = XTclCompileBasicMin0ArgCmd                                              // tclNamesp.c:171:39:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 440)) = sNamespaceImportCmd                                                    // tclNamesp.c:172:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 448)) = XTclCompileBasicMin0ArgCmd                                              // tclNamesp.c:172:39:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 488)) = sNamespaceInscopeCmd                                                   // tclNamesp.c:173:20:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 504)) = sNRNamespaceInscopeCmd                                                 // tclNamesp.c:173:47:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 536)) = sNamespaceOriginCmd                                                    // tclNamesp.c:174:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 544)) = XTclCompileNamespaceOriginCmd                                           // tclNamesp.c:174:39:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 584)) = sNamespaceParentCmd                                                    // tclNamesp.c:175:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 592)) = XTclCompileBasic0Or1ArgCmd                                              // tclNamesp.c:175:39:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 632)) = sNamespacePathCmd                                                      // tclNamesp.c:176:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 640)) = XTclCompileBasic0Or1ArgCmd                                              // tclNamesp.c:176:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 680)) = sNamespaceQualifiersCmd                                                // tclNamesp.c:177:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 688)) = XTclCompileNamespaceQualifiersCmd                                       // tclNamesp.c:177:44:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 728)) = sNamespaceTailCmd                                                      // tclNamesp.c:178:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 736)) = XTclCompileNamespaceTailCmd                                             // tclNamesp.c:178:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 776)) = sNamespaceUnknownCmd                                                   // tclNamesp.c:179:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 784)) = XTclCompileBasic0Or1ArgCmd                                              // tclNamesp.c:179:41:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 824)) = sNamespaceUpvarCmd                                                     // tclNamesp.c:180:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 832)) = XTclCompileNamespaceUpvarCmd                                            // tclNamesp.c:180:37:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 872)) = sNamespaceWhichCmd                                                     // tclNamesp.c:181:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultNamespaceMap)) + 880)) = XTclCompileNamespaceWhichCmd                                            // tclNamesp.c:181:37:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defineCmds)) + 8)) = XTclOODefineConstructorObjCmd                                                     // tclOO.c:28:21:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defineCmds)) + 32)) = XTclOODefineDeleteMethodObjCmd                                                   // tclOO.c:29:22:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defineCmds)) + 56)) = XTclOODefineDestructorObjCmd                                                     // tclOO.c:30:20:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defineCmds)) + 80)) = XTclOODefineExportObjCmd                                                         // tclOO.c:31:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defineCmds)) + 104)) = XTclOODefineForwardObjCmd                                                       // tclOO.c:32:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defineCmds)) + 128)) = XTclOODefineMethodObjCmd                                                        // tclOO.c:33:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defineCmds)) + 152)) = XTclOODefineRenameMethodObjCmd                                                  // tclOO.c:34:22:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defineCmds)) + 176)) = XTclOODefineSelfObjCmd                                                          // tclOO.c:35:14:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defineCmds)) + 200)) = XTclOODefineUnexportObjCmd                                                      // tclOO.c:36:18:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&dictIteratorType)) + 8)) = sReleaseDictIterator                                                                                          // tclExecute.c:806:5:
	*(*func(*libc.TLS, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&dictUpdateInfoType)) + 8)) = sDupDictUpdateInfo                                                                            // tclCompCmds.c:75:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&dictUpdateInfoType)) + 16)) = sFreeDictUpdateInfo                                                                                     // tclCompCmds.c:76:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&dictUpdateInfoType)) + 24)) = sPrintDictUpdateInfo                                                          // tclCompCmds.c:77:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&dictUpdateInfoType)) + 32)) = sDisassembleDictUpdateInfo                                                    // tclCompCmds.c:78:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodeMap)) + 8)) = sBinaryEncodeHex                                                                   // tclBinary.c:145:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodeMap)) + 16)) = XTclCompileBasic1ArgCmd                                                            // tclBinary.c:145:36:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodeMap)) + 56)) = sBinaryEncodeUu                                                                   // tclBinary.c:146:19:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodeMap)) + 104)) = sBinaryEncode64                                                                  // tclBinary.c:147:19:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingImplMap)) + 8)) = XEncodingConvertfromObjCmd                                                   // tclCmdAH.c:536:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingImplMap)) + 16)) = XTclCompileBasic1Or2ArgCmd                                                   // tclCmdAH.c:536:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingImplMap)) + 56)) = XEncodingConverttoObjCmd                                                    // tclCmdAH.c:537:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingImplMap)) + 64)) = XTclCompileBasic1Or2ArgCmd                                                   // tclCmdAH.c:537:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingImplMap)) + 104)) = XEncodingDirsObjCmd                                                        // tclCmdAH.c:538:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingImplMap)) + 112)) = XTclCompileBasic0Or1ArgCmd                                                  // tclCmdAH.c:538:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingImplMap)) + 152)) = XEncodingNamesObjCmd                                                       // tclCmdAH.c:539:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingImplMap)) + 160)) = XTclCompileBasic0ArgCmd                                                     // tclCmdAH.c:539:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingImplMap)) + 200)) = XEncodingSystemObjCmd                                                      // tclCmdAH.c:540:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingImplMap)) + 208)) = XTclCompileBasic0Or1ArgCmd                                                  // tclCmdAH.c:540:45:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingSearchPath)) + 24)) = sInitializeEncodingSearchPath                                                            // tclEncoding.c:142:23:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingType)) + 8)) = sFreeEncodingInternalRep                                                                                          // tclEncoding.c:270:17:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&encodingType)) + 16)) = sDupEncodingInternalRep                                                                                 // tclEncoding.c:270:42:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&ensembleCmdType)) + 8)) = sFreeEnsembleCmdRep                                                                                            // tclEnsemble.c:83:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&ensembleCmdType)) + 16)) = sDupEnsembleCmdRep                                                                                   // tclEnsemble.c:84:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&exprCodeType)) + 8)) = sFreeExprCodeInternalRep                                                                                          // tclExecute.c:793:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&exprCodeType)) + 16)) = sDupExprCodeInternalRep                                                                                 // tclExecute.c:794:5:
	*(*func(*libc.TLS, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fileChannelType)) + 16)) = sFileCloseProc                                                                              // tclUnixChan.c:141:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fileChannelType)) + 24)) = sFileInputProc                                                              // tclUnixChan.c:142:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fileChannelType)) + 32)) = sFileOutputProc                                                             // tclUnixChan.c:143:5:
	*(*func(*libc.TLS, ClientData, int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fileChannelType)) + 40)) = sFileSeekProc                                                                 // tclUnixChan.c:144:5:
	*(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&fileChannelType)) + 64)) = sFileWatchProc                                                                                      // tclUnixChan.c:147:5:
	*(*func(*libc.TLS, ClientData, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fileChannelType)) + 72)) = sFileGetHandleProc                                                                   // tclUnixChan.c:148:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fileChannelType)) + 80)) = sFileClose2Proc                                                                      // tclUnixChan.c:149:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fileChannelType)) + 88)) = sFileBlockModeProc                                                                            // tclUnixChan.c:150:5:
	*(*func(*libc.TLS, ClientData, Tcl_WideInt, int32, uintptr) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&fileChannelType)) + 112)) = sFileWideSeekProc                                                // tclUnixChan.c:153:5:
	*(*func(*libc.TLS, ClientData, Tcl_WideInt) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fileChannelType)) + 128)) = sFileTruncateProc                                                                      // tclUnixChan.c:155:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&filesystemList)) + 0)) = uintptr(unsafe.Pointer(&nativeFilesystemRecord))                                                                                 // tclIOUtil.c:224:43:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&firstCachePtr)) + 0)) = uintptr(unsafe.Pointer(&sharedCache))                                                                                             // tclThreadAlloc.c:150:31:
	*(*func(*libc.TLS, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&foreachInfoType)) + 8)) = sDupForeachInfo                                                                                  // tclCompCmds.c:59:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&foreachInfoType)) + 16)) = sFreeForeachInfo                                                                                           // tclCompCmds.c:60:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&foreachInfoType)) + 24)) = sPrintForeachInfo                                                                // tclCompCmds.c:61:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&foreachInfoType)) + 32)) = sDisassembleForeachInfo                                                          // tclCompCmds.c:62:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&functions)) + 0)) = rfree                                                                                                                // regcomp.c:272:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fwdMethodType)) + 16)) = sInvokeForwardMethod                                       // tclOOMethod.c:114:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&fwdMethodType)) + 24)) = sDeleteForwardMethod                                                                                         // tclOOMethod.c:114:26:
	*(*func(*libc.TLS, uintptr, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fwdMethodType)) + 32)) = sCloneForwardMethod                                                                  // tclOOMethod.c:114:47:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&hostName)) + 24)) = sInitializeHostName                                                                                // tclUnixSock.c:174:21:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 8)) = sDictAppendCmd                                                             // tclDictObj.c:85:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 16)) = XTclCompileDictAppendCmd                                                   // tclDictObj.c:85:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 56)) = sDictCreateCmd                                                            // tclDictObj.c:86:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 64)) = XTclCompileDictCreateCmd                                                   // tclDictObj.c:86:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 104)) = sDictExistsCmd                                                           // tclDictObj.c:87:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 112)) = XTclCompileDictExistsCmd                                                  // tclDictObj.c:87:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 152)) = sDictFilterCmd                                                           // tclDictObj.c:88:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 208)) = XTclCompileDictForCmd                                                     // tclDictObj.c:89:20:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 216)) = sDictForNRCmd                                                            // tclDictObj.c:89:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 248)) = sDictGetCmd                                                              // tclDictObj.c:90:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 256)) = XTclCompileDictGetCmd                                                     // tclDictObj.c:90:25:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 296)) = sDictIncrCmd                                                             // tclDictObj.c:91:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 304)) = XTclCompileDictIncrCmd                                                    // tclDictObj.c:91:27:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 344)) = sDictInfoCmd                                                             // tclDictObj.c:92:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 352)) = XTclCompileBasic1ArgCmd                                                   // tclDictObj.c:92:27:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 392)) = sDictKeysCmd                                                             // tclDictObj.c:93:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 400)) = XTclCompileBasic1Or2ArgCmd                                                // tclDictObj.c:93:27:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 440)) = sDictLappendCmd                                                          // tclDictObj.c:94:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 448)) = XTclCompileDictLappendCmd                                                 // tclDictObj.c:94:33:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 496)) = XTclCompileDictMapCmd                                                     // tclDictObj.c:95:27:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 504)) = sDictMapNRCmd                                                            // tclDictObj.c:95:49:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 536)) = sDictMergeCmd                                                            // tclDictObj.c:96:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 544)) = XTclCompileDictMergeCmd                                                   // tclDictObj.c:96:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 584)) = sDictRemoveCmd                                                           // tclDictObj.c:97:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 592)) = XTclCompileBasicMin1ArgCmd                                                // tclDictObj.c:97:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 632)) = sDictReplaceCmd                                                          // tclDictObj.c:98:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 680)) = sDictSetCmd                                                              // tclDictObj.c:99:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 688)) = XTclCompileDictSetCmd                                                     // tclDictObj.c:99:25:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 728)) = sDictSizeCmd                                                             // tclDictObj.c:100:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 736)) = XTclCompileBasic1ArgCmd                                                   // tclDictObj.c:100:27:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 776)) = sDictUnsetCmd                                                            // tclDictObj.c:101:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 784)) = XTclCompileDictUnsetCmd                                                   // tclDictObj.c:101:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 824)) = sDictUpdateCmd                                                           // tclDictObj.c:102:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 832)) = XTclCompileDictUpdateCmd                                                  // tclDictObj.c:102:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 872)) = sDictValuesCmd                                                           // tclDictObj.c:103:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 880)) = XTclCompileBasic1Or2ArgCmd                                                // tclDictObj.c:103:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 920)) = sDictWithCmd                                                             // tclDictObj.c:104:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&implementationMap)) + 928)) = XTclCompileDictWithCmd                                                    // tclDictObj.c:104:27:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&indexType)) + 8)) = sFreeIndex                                                                                                           // tclIndexObj.c:47:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&indexType)) + 16)) = sDupIndex                                                                                                  // tclIndexObj.c:48:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&indexType)) + 24)) = sUpdateStringOfIndex                                                                                                // tclIndexObj.c:49:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 8)) = sInfoClassCallCmd                                                              // tclOOInfo.c:71:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 16)) = XTclCompileBasic2ArgCmd                                                        // tclOOInfo.c:71:38:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 56)) = sInfoClassConstrCmd                                                           // tclOOInfo.c:72:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 64)) = XTclCompileBasic1ArgCmd                                                        // tclOOInfo.c:72:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 104)) = sInfoClassDefnCmd                                                            // tclOOInfo.c:73:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 112)) = XTclCompileBasic2ArgCmd                                                       // tclOOInfo.c:73:41:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 152)) = sInfoClassDestrCmd                                                           // tclOOInfo.c:74:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 160)) = XTclCompileBasic1ArgCmd                                                       // tclOOInfo.c:74:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 200)) = sInfoClassFiltersCmd                                                         // tclOOInfo.c:75:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 208)) = XTclCompileBasic1ArgCmd                                                       // tclOOInfo.c:75:43:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 248)) = sInfoClassForwardCmd                                                         // tclOOInfo.c:76:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 256)) = XTclCompileBasic2ArgCmd                                                       // tclOOInfo.c:76:43:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 296)) = sInfoClassInstancesCmd                                                       // tclOOInfo.c:77:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 304)) = XTclCompileBasic1Or2ArgCmd                                                    // tclOOInfo.c:77:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 344)) = sInfoClassMethodsCmd                                                         // tclOOInfo.c:78:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 352)) = XTclCompileBasicMin1ArgCmd                                                    // tclOOInfo.c:78:43:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 392)) = sInfoClassMethodTypeCmd                                                      // tclOOInfo.c:79:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 400)) = XTclCompileBasic2ArgCmd                                                       // tclOOInfo.c:79:46:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 440)) = sInfoClassMixinsCmd                                                          // tclOOInfo.c:80:21:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 448)) = XTclCompileBasic1ArgCmd                                                       // tclOOInfo.c:80:41:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 488)) = sInfoClassSubsCmd                                                            // tclOOInfo.c:81:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 496)) = XTclCompileBasic1Or2ArgCmd                                                    // tclOOInfo.c:81:41:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 536)) = sInfoClassSupersCmd                                                          // tclOOInfo.c:82:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 544)) = XTclCompileBasic1ArgCmd                                                       // tclOOInfo.c:82:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 584)) = sInfoClassVariablesCmd                                                       // tclOOInfo.c:83:22:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoClassCmds)) + 592)) = XTclCompileBasic1ArgCmd                                                       // tclOOInfo.c:83:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 8)) = sInfoObjectCallCmd                                                            // tclOOInfo.c:51:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 16)) = XTclCompileBasic2ArgCmd                                                       // tclOOInfo.c:51:40:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 56)) = sInfoObjectClassCmd                                                          // tclOOInfo.c:52:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 64)) = XTclCompileInfoObjectClassCmd                                                 // tclOOInfo.c:52:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 104)) = sInfoObjectDefnCmd                                                          // tclOOInfo.c:53:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 112)) = XTclCompileBasic2ArgCmd                                                      // tclOOInfo.c:53:43:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 152)) = sInfoObjectFiltersCmd                                                       // tclOOInfo.c:54:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 160)) = XTclCompileBasic1ArgCmd                                                      // tclOOInfo.c:54:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 200)) = sInfoObjectForwardCmd                                                       // tclOOInfo.c:55:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 208)) = XTclCompileBasic2ArgCmd                                                      // tclOOInfo.c:55:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 248)) = sInfoObjectIsACmd                                                           // tclOOInfo.c:56:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 256)) = XTclCompileInfoObjectIsACmd                                                  // tclOOInfo.c:56:38:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 296)) = sInfoObjectMethodsCmd                                                       // tclOOInfo.c:57:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 304)) = XTclCompileBasicMin1ArgCmd                                                   // tclOOInfo.c:57:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 344)) = sInfoObjectMethodTypeCmd                                                    // tclOOInfo.c:58:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 352)) = XTclCompileBasic2ArgCmd                                                      // tclOOInfo.c:58:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 392)) = sInfoObjectMixinsCmd                                                        // tclOOInfo.c:59:19:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 400)) = XTclCompileBasic1ArgCmd                                                      // tclOOInfo.c:59:44:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 440)) = sInfoObjectNsCmd                                                            // tclOOInfo.c:60:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 448)) = XTclCompileInfoObjectNamespaceCmd                                            // tclOOInfo.c:60:41:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 488)) = sInfoObjectVariablesCmd                                                     // tclOOInfo.c:61:20:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 496)) = XTclCompileBasic1ArgCmd                                                      // tclOOInfo.c:61:45:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 536)) = sInfoObjectVarsCmd                                                          // tclOOInfo.c:62:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&infoObjectCmds)) + 544)) = XTclCompileBasic1Or2ArgCmd                                                   // tclOOInfo.c:62:40:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 8)) = sFileAttrAccessTimeCmd                                                               // tclCmdAH.c:1174:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 16)) = XTclCompileBasic1Or2ArgCmd                                                           // tclCmdAH.c:1174:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 56)) = XTclFileAttrsCmd                                                                    // tclCmdAH.c:1175:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 104)) = XTclChannelNamesCmd                                                                // tclCmdAH.c:1176:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 112)) = XTclCompileBasic0Or1ArgCmd                                                          // tclCmdAH.c:1176:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 152)) = XTclFileCopyCmd                                                                    // tclCmdAH.c:1177:11:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 200)) = XTclFileDeleteCmd                                                                  // tclCmdAH.c:1178:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 208)) = XTclCompileBasicMin0ArgCmd                                                          // tclCmdAH.c:1178:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 248)) = sPathDirNameCmd                                                                    // tclCmdAH.c:1179:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 256)) = XTclCompileBasic1ArgCmd                                                             // tclCmdAH.c:1179:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 296)) = sFileAttrIsExecutableCmd                                                           // tclCmdAH.c:1180:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 304)) = XTclCompileBasic1ArgCmd                                                             // tclCmdAH.c:1180:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 344)) = sFileAttrIsExistingCmd                                                             // tclCmdAH.c:1181:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 352)) = XTclCompileBasic1ArgCmd                                                             // tclCmdAH.c:1181:36:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 392)) = sPathExtensionCmd                                                                  // tclCmdAH.c:1182:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 400)) = XTclCompileBasic1ArgCmd                                                             // tclCmdAH.c:1182:34:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 440)) = sFileAttrIsDirectoryCmd                                                            // tclCmdAH.c:1183:18:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 448)) = XTclCompileBasic1ArgCmd                                                             // tclCmdAH.c:1183:42:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 488)) = sFileAttrIsFileCmd                                                                 // tclCmdAH.c:1184:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 496)) = XTclCompileBasic1ArgCmd                                                             // tclCmdAH.c:1184:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 536)) = sPathJoinCmd                                                                       // tclCmdAH.c:1185:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 544)) = XTclCompileBasicMin1ArgCmd                                                          // tclCmdAH.c:1185:25:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 584)) = XTclFileLinkCmd                                                                    // tclCmdAH.c:1186:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 592)) = XTclCompileBasic1To3ArgCmd                                                          // tclCmdAH.c:1186:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 632)) = sFileAttrLinkStatCmd                                                               // tclCmdAH.c:1187:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 640)) = XTclCompileBasic2ArgCmd                                                             // tclCmdAH.c:1187:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 680)) = sFileAttrModifyTimeCmd                                                             // tclCmdAH.c:1188:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 688)) = XTclCompileBasic1Or2ArgCmd                                                          // tclCmdAH.c:1188:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 728)) = XTclFileMakeDirsCmd                                                                // tclCmdAH.c:1189:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 736)) = XTclCompileBasicMin0ArgCmd                                                          // tclCmdAH.c:1189:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 776)) = sPathNativeNameCmd                                                                 // tclCmdAH.c:1190:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 784)) = XTclCompileBasic1ArgCmd                                                             // tclCmdAH.c:1190:36:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 824)) = sPathNormalizeCmd                                                                  // tclCmdAH.c:1191:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 832)) = XTclCompileBasic1ArgCmd                                                             // tclCmdAH.c:1191:34:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 872)) = sFileAttrIsOwnedCmd                                                                // tclCmdAH.c:1192:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 880)) = XTclCompileBasic1ArgCmd                                                             // tclCmdAH.c:1192:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 920)) = sPathTypeCmd                                                                       // tclCmdAH.c:1193:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 928)) = XTclCompileBasic1ArgCmd                                                             // tclCmdAH.c:1193:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 968)) = sFileAttrIsReadableCmd                                                             // tclCmdAH.c:1194:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 976)) = XTclCompileBasic1ArgCmd                                                             // tclCmdAH.c:1194:38:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1016)) = XTclFileReadLinkCmd                                                               // tclCmdAH.c:1195:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1024)) = XTclCompileBasic1ArgCmd                                                            // tclCmdAH.c:1195:35:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1064)) = XTclFileRenameCmd                                                                 // tclCmdAH.c:1196:13:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1112)) = sPathRootNameCmd                                                                  // tclCmdAH.c:1197:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1120)) = XTclCompileBasic1ArgCmd                                                            // tclCmdAH.c:1197:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1160)) = sFilesystemSeparatorCmd                                                           // tclCmdAH.c:1198:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1168)) = XTclCompileBasic0Or1ArgCmd                                                         // tclCmdAH.c:1198:40:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1208)) = sFileAttrSizeCmd                                                                  // tclCmdAH.c:1199:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1216)) = XTclCompileBasic1ArgCmd                                                            // tclCmdAH.c:1199:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1256)) = sPathSplitCmd                                                                     // tclCmdAH.c:1200:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1264)) = XTclCompileBasic1ArgCmd                                                            // tclCmdAH.c:1200:27:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1304)) = sFileAttrStatCmd                                                                  // tclCmdAH.c:1201:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1312)) = XTclCompileBasic2ArgCmd                                                            // tclCmdAH.c:1201:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1352)) = sPathFilesystemCmd                                                                // tclCmdAH.c:1202:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1360)) = XTclCompileBasic0Or1ArgCmd                                                         // tclCmdAH.c:1202:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1400)) = sPathTailCmd                                                                      // tclCmdAH.c:1203:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1408)) = XTclCompileBasic1ArgCmd                                                            // tclCmdAH.c:1203:25:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1448)) = XTclFileTemporaryCmd                                                              // tclCmdAH.c:1204:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1456)) = XTclCompileBasic0To2ArgCmd                                                         // tclCmdAH.c:1204:36:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1496)) = sFileAttrTypeCmd                                                                  // tclCmdAH.c:1205:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1504)) = XTclCompileBasic1ArgCmd                                                            // tclCmdAH.c:1205:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1544)) = sFilesystemVolumesCmd                                                             // tclCmdAH.c:1206:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1552)) = XTclCompileBasic0ArgCmd                                                            // tclCmdAH.c:1206:36:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1592)) = sFileAttrIsWritableCmd                                                            // tclCmdAH.c:1207:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap)) + 1600)) = XTclCompileBasic1ArgCmd                                                            // tclCmdAH.c:1207:38:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 8)) = XTcl_FblockedObjCmd                                                                 // tclIOCmd.c:1978:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 16)) = XTclCompileBasic1ArgCmd                                                             // tclIOCmd.c:1978:34:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 56)) = XTcl_CloseObjCmd                                                                   // tclIOCmd.c:1979:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 64)) = XTclCompileBasic1Or2ArgCmd                                                          // tclIOCmd.c:1979:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 104)) = XTcl_FcopyObjCmd                                                                  // tclIOCmd.c:1980:11:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 152)) = XTclChanCreateObjCmd                                                              // tclIOCmd.c:1981:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 160)) = XTclCompileBasic2ArgCmd                                                            // tclIOCmd.c:1981:34:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 200)) = XTcl_EofObjCmd                                                                    // tclIOCmd.c:1982:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 208)) = XTclCompileBasic1ArgCmd                                                            // tclIOCmd.c:1982:27:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 248)) = XTcl_FileEventObjCmd                                                              // tclIOCmd.c:1983:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 256)) = XTclCompileBasic2Or3ArgCmd                                                         // tclIOCmd.c:1983:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 296)) = XTcl_FlushObjCmd                                                                  // tclIOCmd.c:1984:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 304)) = XTclCompileBasic1ArgCmd                                                            // tclIOCmd.c:1984:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 344)) = XTcl_GetsObjCmd                                                                   // tclIOCmd.c:1985:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 352)) = XTclCompileBasic1Or2ArgCmd                                                         // tclIOCmd.c:1985:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 392)) = XTclChannelNamesCmd                                                               // tclIOCmd.c:1986:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 400)) = XTclCompileBasic0Or1ArgCmd                                                         // tclIOCmd.c:1986:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 440)) = sChanPendingObjCmd                                                                // tclIOCmd.c:1987:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 448)) = XTclCompileBasic2ArgCmd                                                            // tclIOCmd.c:1987:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 488)) = sChanPipeObjCmd                                                                   // tclIOCmd.c:1988:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 496)) = XTclCompileBasic0ArgCmd                                                            // tclIOCmd.c:1988:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 536)) = XTclChanPopObjCmd                                                                 // tclIOCmd.c:1989:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 544)) = XTclCompileBasic1ArgCmd                                                            // tclIOCmd.c:1989:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 584)) = XTclChanPostEventObjCmd                                                           // tclIOCmd.c:1990:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 592)) = XTclCompileBasic2ArgCmd                                                            // tclIOCmd.c:1990:40:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 632)) = XTclChanPushObjCmd                                                                // tclIOCmd.c:1991:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 640)) = XTclCompileBasic2ArgCmd                                                            // tclIOCmd.c:1991:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 680)) = XTcl_PutsObjCmd                                                                   // tclIOCmd.c:1992:11:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 728)) = XTcl_ReadObjCmd                                                                   // tclIOCmd.c:1993:11:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 776)) = XTcl_SeekObjCmd                                                                   // tclIOCmd.c:1994:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 784)) = XTclCompileBasic2Or3ArgCmd                                                         // tclIOCmd.c:1994:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 824)) = XTcl_TellObjCmd                                                                   // tclIOCmd.c:1995:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 832)) = XTclCompileBasic1ArgCmd                                                            // tclIOCmd.c:1995:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 872)) = sChanTruncateObjCmd                                                               // tclIOCmd.c:1996:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&initMap1)) + 880)) = XTclCompileBasic1Or2ArgCmd                                                         // tclIOCmd.c:1996:35:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&libraryPath)) + 24)) = XTclpInitLibraryPath                                                                            // tclEncoding.c:164:23:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&localVarNameType)) + 8)) = sFreeLocalVarName                                                                                             // tclVar.c:234:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&localVarNameType)) + 16)) = sDupLocalVarName                                                                                    // tclVar.c:234:23:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&localVarNameType)) + 24)) = sPanicOnUpdateVarName                                                                                        // tclVar.c:234:40:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&localVarNameType)) + 32)) = sPanicOnSetVarName                                                                            // tclVar.c:234:62:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 8)) = XTclSingleOpCmd                                                                   // tclBasic.c:357:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 16)) = XTclCompileInvertOpCmd                                                            // tclBasic.c:357:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 48)) = XTclSingleOpCmd                                                                  // tclBasic.c:359:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 56)) = XTclCompileNotOpCmd                                                               // tclBasic.c:359:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 88)) = XTclVariadicOpCmd                                                                // tclBasic.c:361:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 96)) = XTclCompileAddOpCmd                                                               // tclBasic.c:361:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 128)) = XTclVariadicOpCmd                                                               // tclBasic.c:363:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 136)) = XTclCompileMulOpCmd                                                              // tclBasic.c:363:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 168)) = XTclVariadicOpCmd                                                               // tclBasic.c:365:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 176)) = XTclCompileAndOpCmd                                                              // tclBasic.c:365:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 208)) = XTclVariadicOpCmd                                                               // tclBasic.c:367:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 216)) = XTclCompileOrOpCmd                                                               // tclBasic.c:367:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 248)) = XTclVariadicOpCmd                                                               // tclBasic.c:369:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 256)) = XTclCompileXorOpCmd                                                              // tclBasic.c:369:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 288)) = XTclVariadicOpCmd                                                               // tclBasic.c:371:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 296)) = XTclCompilePowOpCmd                                                              // tclBasic.c:371:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 328)) = XTclSingleOpCmd                                                                 // tclBasic.c:373:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 336)) = XTclCompileLshiftOpCmd                                                           // tclBasic.c:373:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 368)) = XTclSingleOpCmd                                                                 // tclBasic.c:375:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 376)) = XTclCompileRshiftOpCmd                                                           // tclBasic.c:375:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 408)) = XTclSingleOpCmd                                                                 // tclBasic.c:377:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 416)) = XTclCompileModOpCmd                                                              // tclBasic.c:377:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 448)) = XTclSingleOpCmd                                                                 // tclBasic.c:379:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 456)) = XTclCompileNeqOpCmd                                                              // tclBasic.c:379:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 488)) = XTclSingleOpCmd                                                                 // tclBasic.c:381:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 496)) = XTclCompileStrneqOpCmd                                                           // tclBasic.c:381:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 528)) = XTclSingleOpCmd                                                                 // tclBasic.c:383:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 536)) = XTclCompileInOpCmd                                                               // tclBasic.c:383:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 568)) = XTclSingleOpCmd                                                                 // tclBasic.c:385:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 576)) = XTclCompileNiOpCmd                                                               // tclBasic.c:385:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 608)) = XTclNoIdentOpCmd                                                                // tclBasic.c:387:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 616)) = XTclCompileMinusOpCmd                                                            // tclBasic.c:387:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 648)) = XTclNoIdentOpCmd                                                                // tclBasic.c:389:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 656)) = XTclCompileDivOpCmd                                                              // tclBasic.c:389:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 688)) = XTclSortingOpCmd                                                                // tclBasic.c:391:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 696)) = XTclCompileLessOpCmd                                                             // tclBasic.c:391:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 728)) = XTclSortingOpCmd                                                                // tclBasic.c:393:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 736)) = XTclCompileLeqOpCmd                                                              // tclBasic.c:393:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 768)) = XTclSortingOpCmd                                                                // tclBasic.c:395:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 776)) = XTclCompileGreaterOpCmd                                                          // tclBasic.c:395:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 808)) = XTclSortingOpCmd                                                                // tclBasic.c:397:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 816)) = XTclCompileGeqOpCmd                                                              // tclBasic.c:397:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 848)) = XTclSortingOpCmd                                                                // tclBasic.c:399:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 856)) = XTclCompileEqOpCmd                                                               // tclBasic.c:399:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 888)) = XTclSortingOpCmd                                                                // tclBasic.c:401:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&mathOpCmds)) + 896)) = XTclCompileStreqOpCmd                                                            // tclBasic.c:401:30:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&methodNameType)) + 8)) = sFreeMethodNameRep                                                                                              // tclOOCall.c:88:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&methodNameType)) + 16)) = sDupMethodNameRep                                                                                     // tclOOCall.c:89:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&nativeFilesystemRecord)) + 8 /* .fsPtr */)) = uintptr(unsafe.Pointer(&XtclNativeFilesystem))                                                              // tclIOUtil.c:204:5:
	*(*func(*libc.TLS, ClientData) ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&newForeachInfoType)) + 8)) = sDupForeachInfo                                                                               // tclCompCmds.c:67:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&newForeachInfoType)) + 16)) = sFreeForeachInfo                                                                                        // tclCompCmds.c:68:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&newForeachInfoType)) + 24)) = sPrintNewForeachInfo                                                          // tclCompCmds.c:69:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&newForeachInfoType)) + 32)) = sDisassembleNewForeachInfo                                                    // tclCompCmds.c:70:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&nsNameType)) + 8)) = sFreeNsNameInternalRep                                                                                              // tclNamesp.c:151:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&nsNameType)) + 16)) = sDupNsNameInternalRep                                                                                     // tclNamesp.c:152:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nsNameType)) + 32)) = sSetNsNameFromAny                                                                                   // tclNamesp.c:154:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objMethods)) + 32)) = XTclOO_Object_Destroy                                         // tclOO.c:111:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objMethods)) + 88)) = XTclOO_Object_Eval                                            // tclOO.c:112:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objMethods)) + 144)) = XTclOO_Object_Unknown                                        // tclOO.c:113:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objMethods)) + 200)) = XTclOO_Object_LinkVar                                        // tclOO.c:114:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objMethods)) + 256)) = XTclOO_Object_VarName                                        // tclOO.c:115:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objdefCmds)) + 8)) = XTclOODefineClassObjCmd                                                           // tclOO.c:39:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objdefCmds)) + 32)) = XTclOODefineDeleteMethodObjCmd                                                   // tclOO.c:40:22:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objdefCmds)) + 56)) = XTclOODefineExportObjCmd                                                         // tclOO.c:41:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objdefCmds)) + 80)) = XTclOODefineForwardObjCmd                                                        // tclOO.c:42:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objdefCmds)) + 104)) = XTclOODefineMethodObjCmd                                                        // tclOO.c:43:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objdefCmds)) + 128)) = XTclOODefineRenameMethodObjCmd                                                  // tclOO.c:44:22:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&objdefCmds)) + 152)) = XTclOODefineUnexportObjCmd                                                      // tclOO.c:45:18:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&oldBooleanType)) + 32)) = XTclSetBooleanFromAny                                                                           // tclObj.c:251:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pipeChannelType)) + 24)) = sPipeInputProc                                                              // tclUnixPipe.c:73:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pipeChannelType)) + 32)) = sPipeOutputProc                                                             // tclUnixPipe.c:74:5:
	*(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&pipeChannelType)) + 64)) = sPipeWatchProc                                                                                      // tclUnixPipe.c:78:5:
	*(*func(*libc.TLS, ClientData, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pipeChannelType)) + 72)) = sPipeGetHandleProc                                                                   // tclUnixPipe.c:79:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pipeChannelType)) + 80)) = sPipeClose2Proc                                                                      // tclUnixPipe.c:80:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pipeChannelType)) + 88)) = sPipeBlockModeProc                                                                            // tclUnixPipe.c:81:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixImplMap)) + 8)) = sPrefixAllObjCmd                                                               // tclIndexObj.c:507:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixImplMap)) + 16)) = XTclCompileBasic2ArgCmd                                                        // tclIndexObj.c:507:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixImplMap)) + 56)) = sPrefixLongestObjCmd                                                          // tclIndexObj.c:508:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixImplMap)) + 64)) = XTclCompileBasic2ArgCmd                                                        // tclIndexObj.c:508:34:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixImplMap)) + 104)) = sPrefixMatchObjCmd                                                           // tclIndexObj.c:509:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixImplMap)) + 112)) = XTclCompileBasicMin2ArgCmd                                                    // tclIndexObj.c:509:33:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&procMethodType)) + 16)) = sInvokeProcedureMethod                                    // tclOOMethod.c:110:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&procMethodType)) + 24)) = sDeleteProcedureMethod                                                                                      // tclOOMethod.c:110:28:
	*(*func(*libc.TLS, uintptr, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&procMethodType)) + 32)) = sCloneProcedureMethod                                                               // tclOOMethod.c:110:51:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 8)) = sExprAbsFunc                                                               // tclBasic.c:309:14:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 32)) = sExprUnaryFunc                                                            // tclBasic.c:310:15:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 40 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xacos})) // tclBasic.c:310:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 56)) = sExprUnaryFunc // tclBasic.c:311:15:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 64 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xasin})) // tclBasic.c:311:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 80)) = sExprUnaryFunc // tclBasic.c:312:15:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 88 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xatan})) // tclBasic.c:312:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 104)) = sExprBinaryFunc // tclBasic.c:313:16:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 112 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64, float64) float64
	}{libc.Xatan2})) // tclBasic.c:313:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 128)) = sExprBoolFunc  // tclBasic.c:314:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 152)) = sExprCeilFunc  // tclBasic.c:315:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 176)) = sExprUnaryFunc // tclBasic.c:316:14:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 184 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xcos})) // tclBasic.c:316:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 200)) = sExprUnaryFunc // tclBasic.c:317:15:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 208 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xcosh})) // tclBasic.c:317:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 224)) = sExprDoubleFunc // tclBasic.c:318:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 248)) = sExprEntierFunc // tclBasic.c:319:17:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 272)) = sExprUnaryFunc  // tclBasic.c:320:14:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 280 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xexp})) // tclBasic.c:320:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 296)) = sExprFloorFunc  // tclBasic.c:321:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 320)) = sExprBinaryFunc // tclBasic.c:322:15:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 328 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64, float64) float64
	}{libc.Xfmod})) // tclBasic.c:322:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 344)) = sExprBinaryFunc // tclBasic.c:323:16:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 352 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64, float64) float64
	}{libc.Xhypot})) // tclBasic.c:323:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 368)) = sExprIntFunc   // tclBasic.c:324:14:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 392)) = sExprIsqrtFunc // tclBasic.c:325:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 416)) = sExprUnaryFunc // tclBasic.c:326:14:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 424 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xlog})) // tclBasic.c:326:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 440)) = sExprUnaryFunc // tclBasic.c:327:16:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 448 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xlog10})) // tclBasic.c:327:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 464)) = sExprBinaryFunc // tclBasic.c:328:14:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 472 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64, float64) float64
	}{libc.Xpow})) // tclBasic.c:328:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 488)) = sExprRandFunc  // tclBasic.c:329:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 512)) = sExprRoundFunc // tclBasic.c:330:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 536)) = sExprUnaryFunc // tclBasic.c:331:14:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 544 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xsin})) // tclBasic.c:331:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 560)) = sExprUnaryFunc // tclBasic.c:332:15:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 568 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xsinh})) // tclBasic.c:332:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 584)) = sExprSqrtFunc  // tclBasic.c:333:15:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 608)) = sExprSrandFunc // tclBasic.c:334:16:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 632)) = sExprUnaryFunc // tclBasic.c:335:14:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 640 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xtan})) // tclBasic.c:335:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 656)) = sExprUnaryFunc // tclBasic.c:336:15:
	*(*ClientData)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 664 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, float64) float64
	}{libc.Xtanh})) // tclBasic.c:336:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sBuiltinFuncTable)) + 680)) = sExprWideFunc                           // tclBasic.c:337:15:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sharedPtr)) + 0)) = uintptr(unsafe.Pointer(&sharedCache))                                                                // tclThreadAlloc.c:149:27:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 24)) = sClassFilterGet                   // tclOODefineCmds.c:118:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 64)) = sClassFilterSet                   // tclOODefineCmds.c:118:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 112)) = sClassMixinGet                   // tclOODefineCmds.c:119:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 152)) = sClassMixinSet                   // tclOODefineCmds.c:119:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 200)) = sClassSuperGet                   // tclOODefineCmds.c:120:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 240)) = sClassSuperSet                   // tclOODefineCmds.c:120:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 288)) = sClassVarsGet                    // tclOODefineCmds.c:121:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 328)) = sClassVarsSet                    // tclOODefineCmds.c:121:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 376)) = sObjFilterGet                    // tclOODefineCmds.c:122:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 416)) = sObjFilterSet                    // tclOODefineCmds.c:122:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 464)) = sObjMixinGet                     // tclOODefineCmds.c:123:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 504)) = sObjMixinSet                     // tclOODefineCmds.c:123:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 552)) = sObjVarsGet                      // tclOODefineCmds.c:124:5:
	*(*func(*libc.TLS, ClientData, uintptr, Tcl_ObjectContext, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&slots)) + 592)) = sObjVarsSet                      // tclOODefineCmds.c:124:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 8)) = sStringBytesCmd                               // tclCmdMZ.c:3451:17:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 16)) = XTclCompileBasic1ArgCmd                       // tclCmdMZ.c:3451:33:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 56)) = sStringCatCmd                                // tclCmdMZ.c:3452:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 64)) = XTclCompileStringCatCmd                       // tclCmdMZ.c:3452:25:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 104)) = sStringCmpCmd                               // tclCmdMZ.c:3453:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 112)) = XTclCompileStringCmpCmd                      // tclCmdMZ.c:3453:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 152)) = sStringEqualCmd                             // tclCmdMZ.c:3454:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 160)) = XTclCompileStringEqualCmd                    // tclCmdMZ.c:3454:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 200)) = sStringFirstCmd                             // tclCmdMZ.c:3455:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 208)) = XTclCompileStringFirstCmd                    // tclCmdMZ.c:3455:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 248)) = sStringIndexCmd                             // tclCmdMZ.c:3456:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 256)) = XTclCompileStringIndexCmd                    // tclCmdMZ.c:3456:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 296)) = sStringIsCmd                                // tclCmdMZ.c:3457:10:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 304)) = XTclCompileStringIsCmd                       // tclCmdMZ.c:3457:23:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 344)) = sStringLastCmd                              // tclCmdMZ.c:3458:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 352)) = XTclCompileStringLastCmd                     // tclCmdMZ.c:3458:26:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 392)) = sStringLenCmd                               // tclCmdMZ.c:3459:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 400)) = XTclCompileStringLenCmd                      // tclCmdMZ.c:3459:27:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 440)) = sStringMapCmd                               // tclCmdMZ.c:3460:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 448)) = XTclCompileStringMapCmd                      // tclCmdMZ.c:3460:25:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 488)) = sStringMatchCmd                             // tclCmdMZ.c:3461:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 496)) = XTclCompileStringMatchCmd                    // tclCmdMZ.c:3461:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 536)) = sStringRangeCmd                             // tclCmdMZ.c:3462:12:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 544)) = XTclCompileStringRangeCmd                    // tclCmdMZ.c:3462:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 584)) = sStringReptCmd                              // tclCmdMZ.c:3463:13:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 592)) = XTclCompileBasic2ArgCmd                      // tclCmdMZ.c:3463:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 632)) = sStringRplcCmd                              // tclCmdMZ.c:3464:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 640)) = XTclCompileStringReplaceCmd                  // tclCmdMZ.c:3464:29:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 680)) = sStringRevCmd                               // tclCmdMZ.c:3465:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 688)) = XTclCompileBasic1ArgCmd                      // tclCmdMZ.c:3465:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 728)) = sStringLowerCmd                             // tclCmdMZ.c:3466:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 736)) = XTclCompileStringToLowerCmd                  // tclCmdMZ.c:3466:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 776)) = sStringUpperCmd                             // tclCmdMZ.c:3467:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 784)) = XTclCompileStringToUpperCmd                  // tclCmdMZ.c:3467:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 824)) = sStringTitleCmd                             // tclCmdMZ.c:3468:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 832)) = XTclCompileStringToTitleCmd                  // tclCmdMZ.c:3468:30:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 872)) = sStringTrimCmd                              // tclCmdMZ.c:3469:11:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 880)) = XTclCompileStringTrimCmd                     // tclCmdMZ.c:3469:26:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 920)) = sStringTrimLCmd                             // tclCmdMZ.c:3470:15:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 928)) = XTclCompileStringTrimLCmd                    // tclCmdMZ.c:3470:31:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 968)) = sStringTrimRCmd                             // tclCmdMZ.c:3471:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 976)) = XTclCompileStringTrimRCmd                    // tclCmdMZ.c:3471:32:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 1016)) = sStringEndCmd                              // tclCmdMZ.c:3472:14:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 1024)) = XTclCompileBasic2ArgCmd                     // tclCmdMZ.c:3472:28:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 1064)) = sStringStartCmd                            // tclCmdMZ.c:3473:16:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stringImplMap)) + 1072)) = XTclCompileBasic2ArgCmd                     // tclCmdMZ.c:3473:32:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&substCodeType)) + 8)) = sFreeSubstCodeInternalRep                                                       // tclCompile.c:721:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&substCodeType)) + 16)) = sDupByteCodeInternalRep                                               // tclCompile.c:722:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclFsPathType)) + 8)) = sFreeFsPathInternalRep                                                          // tclPathObj.c:41:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclFsPathType)) + 16)) = sDupFsPathInternalRep                                                 // tclPathObj.c:42:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclFsPathType)) + 24)) = sUpdateStringOfFsPath                                                          // tclPathObj.c:43:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclFsPathType)) + 32)) = sSetFsPathFromAny                                               // tclPathObj.c:44:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclInstNameType)) + 24)) = sUpdateStringOfInstName                                                      // tclDisassemble.c:45:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 16)) = XTclGetAndDetachPids                                            // tclStubInit.c:759:5:
	*(*func(*libc.TLS, TclFile) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 24)) = XTclpCloseFile                                                         // tclStubInit.c:760:5:
	*(*func(*libc.TLS, TclFile, TclFile, TclFile, int32, uintptr) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 32)) = XTclpCreateCommandChannel      // tclStubInit.c:761:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 40)) = XTclpCreatePipe                                               // tclStubInit.c:762:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, TclFile, TclFile, TclFile, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 48)) = XTclpCreateProcess // tclStubInit.c:763:5:
	*(*func(*libc.TLS, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 56)) = XTclUnixWaitForFile                                        // tclStubInit.c:764:5:
	*(*func(*libc.TLS, Tcl_Channel, int32) TclFile)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 64)) = XTclpMakeFile                                             // tclStubInit.c:765:5:
	*(*func(*libc.TLS, uintptr, int32) TclFile)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 72)) = XTclpOpenFile                                                 // tclStubInit.c:766:5:
	*(*func(*libc.TLS, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 80)) = XTclUnixWaitForFile                                        // tclStubInit.c:767:5:
	*(*func(*libc.TLS, uintptr) TclFile)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 88)) = XTclpCreateTempFile                                                  // tclStubInit.c:768:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 96)) = XTclpReaddir                                                         // tclStubInit.c:769:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 104)) = XTclpLocaltime                                                      // tclStubInit.c:770:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 112)) = XTclpGmtime                                                         // tclStubInit.c:771:5:
	*(*func(*libc.TLS, In_addr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 120)) = XTclpInetNtoa                                                       // tclStubInit.c:772:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 128)) = XTclUnixCopyFile                             // tclStubInit.c:773:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 136 /* .tclMacOSXGetFileAttribute */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, int32, uintptr, TclFile, TclFile, TclFile, uintptr) int32
	}{XTclpCreateProcess})) // tclStubInit.c:774:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 144 /* .tclMacOSXSetFileAttribute */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{libc.Xisatty})) // tclStubInit.c:775:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 152 /* .tclMacOSXCopyFileAttributes */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32
	}{XTclUnixCopyFile})) // tclStubInit.c:776:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 160 /* .tclMacOSXMatchType */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, Tcl_Channel, int32) TclFile
	}{XTclpMakeFile})) // tclStubInit.c:777:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 168 /* .tclMacOSXNotifierAddRunLoopMode */)) = *(*uintptr)(unsafe.Pointer(&struct {
		f func(*libc.TLS, uintptr, int32) TclFile
	}{XTclpOpenFile})) // tclStubInit.c:778:5:
	*(*func(*libc.TLS, uintptr) TclFile)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 192)) = XTclpCreateTempFile                                                                                                         // tclStubInit.c:781:5:
	*(*func(*libc.TLS, uint32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 248)) = XTclWinCPUID                                                                                                          // tclStubInit.c:788:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntPlatStubs)) + 256)) = XTclUnixOpenTemporaryFile                                                                          // tclStubInit.c:789:5:
	*(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 40)) = XTclAllocateFreeObjects                                                                                                                           // tclStubInit.c:495:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, Tcl_Channel) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 56)) = XTclCleanupChildren                                                                                   // tclStubInit.c:497:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 64)) = XTclCleanupCommand                                                                                                                       // tclStubInit.c:498:5:
	*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 72)) = XTclCopyAndCollapse                                                                                                // tclStubInit.c:499:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel, Tcl_Channel, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 80)) = XTclCopyChannelOld                                                                       // tclStubInit.c:500:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 88)) = XTclCreatePipeline                                                             // tclStubInit.c:501:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 96)) = XTclCreateProc                                                                        // tclStubInit.c:502:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 104)) = XTclDeleteCompiledLocalVars                                                                                                    // tclStubInit.c:503:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 112)) = XTclDeleteVars                                                                                                                 // tclStubInit.c:504:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 128)) = XTclDumpMemoryInfo                                                                                                      // tclStubInit.c:506:5:
	*(*func(*libc.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 144)) = XTclExprFloatError                                                                                                             // tclStubInit.c:508:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 192)) = XTclFindElement                                                               // tclStubInit.c:514:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 200)) = XTclFindProc                                                                                                           // tclStubInit.c:515:5:
	*(*func(*libc.TLS, uintptr, int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 208)) = XTclFormatInt                                                                                                              // tclStubInit.c:516:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 216)) = XTclFreePackageInfo                                                                                                                     // tclStubInit.c:517:5:
	*(*func(*libc.TLS, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 240)) = XTclpGetDefaultStdChannel                                                                                                     // tclStubInit.c:520:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 264)) = XTclGetExtension                                                                                                                // tclStubInit.c:523:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 272)) = XTclGetFrame                                                                                                    // tclStubInit.c:524:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 288)) = XTclGetIntForIndex                                                                                       // tclStubInit.c:526:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 312)) = XTclGetLoadedPackages                                                                                                    // tclStubInit.c:529:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 320)) = XTclGetNamespaceForQualName                                          // tclStubInit.c:530:5:
	*(*func(*libc.TLS) TclObjCmdProcType)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 328)) = XTclGetObjInterpProc                                                                                                           // tclStubInit.c:531:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 336)) = XTclGetOpenMode                                                                                                 // tclStubInit.c:532:5:
	*(*func(*libc.TLS, Tcl_Command) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 344)) = XTclGetOriginalCommand                                                                                                  // tclStubInit.c:533:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 352)) = XTclpGetUserHome                                                                                                       // tclStubInit.c:534:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 368)) = XTclGuessPackageName                                                                                                     // tclStubInit.c:536:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 376)) = XTclHideUnsafeCommands                                                                                                            // tclStubInit.c:537:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 384)) = XTclInExit                                                                                                                                 // tclStubInit.c:538:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 416)) = XTclInitCompiledLocals                                                                                                // tclStubInit.c:542:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 424)) = XTclInterpInit                                                                                                                    // tclStubInit.c:543:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 440)) = XTclInvokeObjectCommand                                                                               // tclStubInit.c:545:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 448)) = XTclInvokeStringCommand                                                                               // tclStubInit.c:546:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 456)) = XTclIsProc                                                                                                                      // tclStubInit.c:547:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 480)) = XTclLookupVar                                                          // tclStubInit.c:550:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 496)) = XTclNeedSpace                                                                                                            // tclStubInit.c:552:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 504)) = XTclNewProcBodyObj                                                                                                              // tclStubInit.c:553:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 512)) = XTclObjCommandComplete                                                                                                            // tclStubInit.c:554:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 520)) = XTclObjInterpProc                                                                                     // tclStubInit.c:555:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 528)) = XTclObjInvoke                                                                                              // tclStubInit.c:556:5:
	*(*func(*libc.TLS, uint32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 568)) = XTclpAlloc                                                                                                                       // tclStubInit.c:561:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 608)) = XTclpFree                                                                                                                               // tclStubInit.c:566:5:
	*(*func(*libc.TLS) uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 616)) = XTclpGetClicks                                                                                                                            // tclStubInit.c:567:5:
	*(*func(*libc.TLS) uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 624)) = XTclpGetSeconds                                                                                                                           // tclStubInit.c:568:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 632)) = XTclpGetTime                                                                                                                            // tclStubInit.c:569:5:
	*(*func(*libc.TLS, uintptr, uint32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 664)) = XTclpRealloc                                                                                                            // tclStubInit.c:573:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 720)) = XTclPrecTraceProc                                                                          // tclStubInit.c:580:5:
	*(*func(*libc.TLS, uintptr, uintptr, Tcl_Command) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 728)) = XTclPreventAliasLoop                                                                                        // tclStubInit.c:581:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 744)) = XTclProcCleanupProc                                                                                                                     // tclStubInit.c:583:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 752)) = XTclProcCompileProc                                                                  // tclStubInit.c:584:5:
	*(*func(*libc.TLS, ClientData))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 760)) = XTclProcDeleteProc                                                                                                                   // tclStubInit.c:585:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 784)) = XTclRenameCommand                                                                                               // tclStubInit.c:588:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 792)) = XTclResetShadowedCmdRefs                                                                                                       // tclStubInit.c:589:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 800)) = XTclServiceIdle                                                                                                                            // tclStubInit.c:590:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 824)) = XTclSetPreInitScript                                                                                                            // tclStubInit.c:593:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 832)) = XTclSetupEnv                                                                                                                            // tclStubInit.c:594:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 840)) = XTclSockGetPort                                                                                        // tclStubInit.c:595:5:
	*(*func(*libc.TLS, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 848)) = sockMinimumBuffersOld                                                                                                        // tclStubInit.c:596:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 880)) = XTclTeardownNamespace                                                                                                                   // tclStubInit.c:600:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 888)) = XTclUpdateReturnInfo                                                                                                              // tclStubInit.c:601:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 896)) = XTclSockMinimumBuffers                                                                                                     // tclStubInit.c:602:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 904)) = XTcl_AddInterpResolvers                                                                             // tclStubInit.c:603:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 912)) = XTcl_AppendExportList                                                                                           // tclStubInit.c:604:5:
	*(*func(*libc.TLS, uintptr, uintptr, ClientData, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 920)) = XTcl_CreateNamespace                                                                              // tclStubInit.c:605:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 928)) = XTcl_DeleteNamespace                                                                                                                    // tclStubInit.c:606:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 936)) = XTcl_Export                                                                                              // tclStubInit.c:607:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 944)) = XTcl_FindCommand                                                                                   // tclStubInit.c:608:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 952)) = XTcl_FindNamespace                                                                                     // tclStubInit.c:609:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 960)) = XTcl_GetInterpResolvers                                                                                         // tclStubInit.c:610:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 968)) = XTcl_GetNamespaceResolvers                                                                                               // tclStubInit.c:611:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) Tcl_Var)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 976)) = XTcl_FindNamespaceVar                                                                                  // tclStubInit.c:612:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 984)) = XTcl_ForgetImport                                                                                               // tclStubInit.c:613:5:
	*(*func(*libc.TLS, uintptr, uintptr) Tcl_Command)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 992)) = XTcl_GetCommandFromObj                                                                                             // tclStubInit.c:614:5:
	*(*func(*libc.TLS, uintptr, Tcl_Command, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1000)) = XTcl_GetCommandFullName                                                                                          // tclStubInit.c:615:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1008)) = XTcl_GetCurrentNamespace                                                                                                       // tclStubInit.c:616:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1016)) = XTcl_GetGlobalNamespace                                                                                                        // tclStubInit.c:617:5:
	*(*func(*libc.TLS, uintptr, Tcl_Var, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1024)) = XTcl_GetVariableFullName                                                                                             // tclStubInit.c:618:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1032)) = XTcl_Import                                                                                             // tclStubInit.c:619:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1040)) = XTcl_PopCallFrame                                                                                                                      // tclStubInit.c:620:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1048)) = XTcl_PushCallFrame                                                                                      // tclStubInit.c:621:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1056)) = XTcl_RemoveInterpResolvers                                                                                              // tclStubInit.c:622:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1064)) = XTcl_SetNamespaceResolvers                                                                                  // tclStubInit.c:623:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1072)) = XTclpHasSockets                                                                                                                  // tclStubInit.c:624:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1080)) = XTclpGetDate                                                                                                            // tclStubInit.c:625:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1120)) = XTclGetEnv                                                                                                            // tclStubInit.c:630:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1144)) = XTclpGetCwd                                                                                                           // tclStubInit.c:633:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, ClientData) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1152)) = XTclSetByteCodeFromAny                                                                             // tclStubInit.c:634:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1160)) = XTclAddLiteralObj                                                                                              // tclStubInit.c:635:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1168)) = XTclHideLiteral                                                                                                        // tclStubInit.c:636:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1176)) = XTclGetAuxDataType                                                                                                             // tclStubInit.c:637:5:
	*(*func(*libc.TLS, uintptr) TclHandle)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1184)) = XTclHandleCreate                                                                                                             // tclStubInit.c:638:5:
	*(*func(*libc.TLS, TclHandle))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1192)) = XTclHandleFree                                                                                                                       // tclStubInit.c:639:5:
	*(*func(*libc.TLS, TclHandle) TclHandle)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1200)) = XTclHandlePreserve                                                                                                         // tclStubInit.c:640:5:
	*(*func(*libc.TLS, TclHandle))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1208)) = XTclHandleRelease                                                                                                                    // tclStubInit.c:641:5:
	*(*func(*libc.TLS, uintptr, Tcl_RegExp) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1216)) = XTclRegAbout                                                                                                         // tclStubInit.c:642:5:
	*(*func(*libc.TLS, Tcl_RegExp, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1224)) = XTclRegExpRangeUniChar                                                                                     // tclStubInit.c:643:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1232)) = XTclSetLibraryPath                                                                                                                     // tclStubInit.c:644:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1240)) = XTclGetLibraryPath                                                                                                                      // tclStubInit.c:645:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1264)) = XTclRegError                                                                                                           // tclStubInit.c:648:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1272)) = XTclVarTraceExists                                                                                                    // tclStubInit.c:649:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1280)) = setStartupScriptFileName                                                                                                               // tclStubInit.c:650:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1288)) = getStartupScriptFileName                                                                                                                // tclStubInit.c:651:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1304)) = XTclChannelTransform                                                                                       // tclStubInit.c:653:5:
	*(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1312)) = XTclChannelEventScriptInvoker                                                                                                // tclStubInit.c:654:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1320)) = XTclGetInstructionTable                                                                                                                 // tclStubInit.c:655:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1328)) = XTclExpandCodeArray                                                                                                                    // tclStubInit.c:656:5:
	*(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1336)) = XTclpSetInitialEncodings                                                                                                                        // tclStubInit.c:657:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1344)) = XTclListObjSetElement                                                                                   // tclStubInit.c:658:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1352)) = setStartupScriptPath                                                                                                                   // tclStubInit.c:659:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1360)) = getStartupScriptPath                                                                                                                    // tclStubInit.c:660:5:
	*(*func(*libc.TLS, uintptr, uintptr, uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1368)) = XTclpUtfNcmp2                                                                                                   // tclStubInit.c:661:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1376)) = XTclCheckInterpTraces                                                     // tclStubInit.c:662:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1384)) = XTclCheckExecutionTraces                                                  // tclStubInit.c:663:5:
	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1392)) = XTclInThreadExit                                                                                                                          // tclStubInit.c:664:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1400)) = XTclUniCharMatch                                                                                   // tclStubInit.c:665:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1416)) = XTclCallVarTraces                                                              // tclStubInit.c:667:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1424)) = XTclCleanupVar                                                                                                                // tclStubInit.c:668:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1432)) = XTclVarErrMsg                                                                                      // tclStubInit.c:669:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1440)) = XTcl_SetStartupScript                                                                                                         // tclStubInit.c:670:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1448)) = XTcl_GetStartupScript                                                                                                          // tclStubInit.c:671:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1472)) = XTclpLocaltime                                                                                                                 // tclStubInit.c:674:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1480)) = XTclpGmtime                                                                                                                    // tclStubInit.c:675:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1600)) = XTclObjGetFrame                                                                                                // tclStubInit.c:690:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1616)) = XTclpObjRemoveDirectory                                                                                          // tclStubInit.c:692:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1624)) = XTclpObjCopyDirectory                                                                                          // tclStubInit.c:693:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1632)) = XTclpObjCreateDirectory                                                                                                          // tclStubInit.c:694:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1640)) = XTclpObjDeleteFile                                                                                                               // tclStubInit.c:695:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1648)) = XTclpObjCopyFile                                                                                                        // tclStubInit.c:696:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1656)) = XTclpObjRenameFile                                                                                                      // tclStubInit.c:697:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1664)) = XTclpObjStat                                                                                                            // tclStubInit.c:698:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1672)) = XTclpObjAccess                                                                                                            // tclStubInit.c:699:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32) Tcl_Channel)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1680)) = XTclpOpenFileChannel                                                                                // tclStubInit.c:700:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1712)) = XTclpFindExecutable                                                                                                                    // tclStubInit.c:704:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1720)) = XTclGetObjNameOfExecutable                                                                                                              // tclStubInit.c:705:5:
	*(*func(*libc.TLS, uintptr, Tcl_Encoding))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1728)) = XTclSetObjNameOfExecutable                                                                                               // tclStubInit.c:706:5:
	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1736)) = XTclStackAlloc                                                                                                          // tclStubInit.c:707:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1744)) = XTclStackFree                                                                                                                 // tclStubInit.c:708:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1752)) = XTclPushStackFrame                                                                                      // tclStubInit.c:709:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1760)) = XTclPopStackFrame                                                                                                                      // tclStubInit.c:710:5:
	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1808)) = XTclGetPlatform                                                                                                                         // tclStubInit.c:716:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1816)) = XTclTraceDictPath                                                                              // tclStubInit.c:717:5:
	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1824)) = XTclObjBeingDeleted                                                                                                              // tclStubInit.c:718:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1832)) = XTclSetNsPath                                                                                                          // tclStubInit.c:719:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1848)) = XTclPtrMakeUpvar                                                                                 // tclStubInit.c:721:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1856)) = XTclObjLookupVar                                                      // tclStubInit.c:722:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1864)) = XTclGetNamespaceFromObj                                                                                        // tclStubInit.c:723:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1872)) = XTclEvalObjEx                                                                                    // tclStubInit.c:724:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1880)) = XTclGetSrcInfoForPc                                                                                                                    // tclStubInit.c:725:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1888)) = XTclVarHashCreateVar                                                                                         // tclStubInit.c:726:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1896)) = XTclInitVarHashTable                                                                                                          // tclStubInit.c:727:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1904)) = XTcl_BackgroundException                                                                                                        // tclStubInit.c:728:5:
	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1912)) = XTclResetCancellation                                                                                                     // tclStubInit.c:729:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1920)) = XTclNRInterpProc                                                                                     // tclStubInit.c:730:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1928)) = XTclNRInterpProcCore                                                                                    // tclStubInit.c:731:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1936)) = XTclNRRunCallbacks                                                                                               // tclStubInit.c:732:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1944)) = XTclNREvalObjEx                                                                                  // tclStubInit.c:733:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1952)) = XTclNREvalObjv                                                                                   // tclStubInit.c:734:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1960)) = XTclDbDumpActiveObjects                                                                                                                // tclStubInit.c:735:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1968)) = XTclGetNamespaceChildTable                                                                                                     // tclStubInit.c:736:5:
	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1976)) = XTclGetNamespaceCommandTable                                                                                                   // tclStubInit.c:737:5:
	*(*func(*libc.TLS, uintptr, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1984)) = XTclInitRewriteEnsemble                                                                                   // tclStubInit.c:738:5:
	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 1992)) = XTclResetRewriteEnsemble                                                                                                        // tclStubInit.c:739:5:
	*(*func(*libc.TLS, uintptr, Tcl_Channel, Tcl_Channel, Tcl_WideInt, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 2000)) = XTclCopyChannel                                                                  // tclStubInit.c:740:5:
	*(*func(*libc.TLS, float64, int32, int32, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 2008)) = XTclDoubleDigits                                                                      // tclStubInit.c:741:5:
	*(*func(*libc.TLS, uintptr, int32, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 2016)) = XTclSetSlaveCancelFlags                                                                                                  // tclStubInit.c:742:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 2024)) = XTclRegisterLiteral                                                                                       // tclStubInit.c:743:5:
	*(*func(*libc.TLS, uintptr, Tcl_Var, Tcl_Var, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 2032)) = XTclPtrGetVar                                                                       // tclStubInit.c:744:5:
	*(*func(*libc.TLS, uintptr, Tcl_Var, Tcl_Var, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 2040)) = XTclPtrSetVar                                                              // tclStubInit.c:745:5:
	*(*func(*libc.TLS, uintptr, Tcl_Var, Tcl_Var, uintptr, uintptr, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 2048)) = XTclPtrIncrObjVar                                                          // tclStubInit.c:746:5:
	*(*func(*libc.TLS, uintptr, Tcl_Var, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 2056)) = XTclPtrObjMakeUpvar                                                                                     // tclStubInit.c:747:5:
	*(*func(*libc.TLS, uintptr, Tcl_Var, Tcl_Var, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 2064)) = XTclPtrUnsetVar                                                                       // tclStubInit.c:748:5:
	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclIntStubs)) + 2072)) = XTcl_StaticPackage                                                                                          // tclStubInit.c:749:5:
	*(*func(*libc.TLS, uintptr) Tcl_Object)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 16)) = XTclOOGetDefineCmdContext                                                                                                   // tclOOStubInit.c:24:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr, uintptr, ClientData, uintptr) Tcl_Method)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 24)) = XTclOOMakeProcInstanceMethod                       // tclOOStubInit.c:25:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr, uintptr, uintptr, ClientData, uintptr) Tcl_Method)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 32)) = XTclOOMakeProcMethod                      // tclOOStubInit.c:26:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 40)) = XTclOONewProcInstanceMethod                                                // tclOOStubInit.c:27:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 48)) = XTclOONewProcMethod                                                        // tclOOStubInit.c:28:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 56)) = XTclOOObjectCmdCore                                                                     // tclOOStubInit.c:29:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 64)) = XTclOOIsReachable                                                                                                       // tclOOStubInit.c:30:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 72)) = XTclOONewForwardMethod                                                                       // tclOOStubInit.c:31:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 80)) = XTclOONewForwardInstanceMethod                                                               // tclOOStubInit.c:32:5:
	*(*func(*libc.TLS, uintptr, Tcl_Object, uintptr, uintptr, uintptr, ClientData, uintptr, uintptr, uintptr, int32, uintptr) Tcl_Method)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 88)) = XTclOONewProcInstanceMethodEx // tclOOStubInit.c:33:5:
	*(*func(*libc.TLS, uintptr, Tcl_Class, uintptr, uintptr, uintptr, ClientData, uintptr, uintptr, uintptr, int32, uintptr) Tcl_Method)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 96)) = XTclOONewProcMethodEx          // tclOOStubInit.c:34:5:
	*(*func(*libc.TLS, uintptr, Tcl_Object, Tcl_Class, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 104)) = XTclOOInvokeObject                                                                // tclOOStubInit.c:35:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 112)) = XTclOOObjectSetFilters                                                                                                // tclOOStubInit.c:36:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 120)) = XTclOOClassSetFilters                                                                                        // tclOOStubInit.c:37:5:
	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 128)) = XTclOOObjectSetMixins                                                                                                 // tclOOStubInit.c:38:5:
	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOIntStubs)) + 136)) = XTclOOClassSetMixins                                                                                         // tclOOStubInit.c:39:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclOOStubHooks)) + 0 /* .tclOOIntStubs */)) = uintptr(unsafe.Pointer(&tclOOIntStubs))                                                                                            // tclOOStubInit.c:43:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclParsedVarNameType)) + 8)) = sFreeParsedVarName                                                                                                               // tclVar.c:239:5:
	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclParsedVarNameType)) + 16)) = sDupParsedVarName                                                                                                      // tclVar.c:239:24:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclParsedVarNameType)) + 24)) = sUpdateParsedVarName                                                                                                            // tclVar.c:239:42:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclParsedVarNameType)) + 32)) = sPanicOnSetVarName                                                                                               // tclVar.c:239:63:
	*(*func(*libc.TLS, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRChannelType)) + 16)) = sReflectClose                                                                                                      // tclIORChan.c:67:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRChannelType)) + 24)) = sReflectInput                                                                                      // tclIORChan.c:68:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRChannelType)) + 32)) = sReflectOutput                                                                                     // tclIORChan.c:69:5:
	*(*func(*libc.TLS, ClientData, int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRChannelType)) + 40)) = sReflectSeek                                                                                         // tclIORChan.c:70:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRChannelType)) + 48)) = sReflectSetOption                                                                                // tclIORChan.c:71:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRChannelType)) + 56)) = sReflectGetOption                                                                                // tclIORChan.c:72:5:
	*(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRChannelType)) + 64)) = sReflectWatch                                                                                                              // tclIORChan.c:73:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRChannelType)) + 80)) = sReflectClose2                                                                                              // tclIORChan.c:75:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRChannelType)) + 88)) = sReflectBlock                                                                                                        // tclIORChan.c:76:5:
	*(*func(*libc.TLS, ClientData, Tcl_WideInt, int32, uintptr) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRChannelType)) + 112)) = sReflectSeekWide                                                                        // tclIORChan.c:79:5:
	*(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRChannelType)) + 120)) = sReflectThread                                                                                                            // tclIORChan.c:81:5:
	*(*func(*libc.TLS, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 16)) = sReflectClose1                                                                                                   // tclIORTrans.c:65:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 24)) = sReflectInput1                                                                                   // tclIORTrans.c:66:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 32)) = sReflectOutput1                                                                                  // tclIORTrans.c:67:5:
	*(*func(*libc.TLS, ClientData, int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 40)) = sReflectSeek1                                                                                      // tclIORTrans.c:68:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 48)) = sReflectSetOption1                                                                             // tclIORTrans.c:69:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 56)) = sReflectGetOption1                                                                             // tclIORTrans.c:70:5:
	*(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 64)) = sReflectWatch1                                                                                                           // tclIORTrans.c:71:5:
	*(*func(*libc.TLS, ClientData, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 72)) = sReflectHandle                                                                                            // tclIORTrans.c:72:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 80)) = sReflectClose21                                                                                           // tclIORTrans.c:73:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 88)) = sReflectBlock1                                                                                                     // tclIORTrans.c:74:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 104)) = sReflectNotify                                                                                                    // tclIORTrans.c:77:5:
	*(*func(*libc.TLS, ClientData, Tcl_WideInt, int32, uintptr) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclRTransformType)) + 112)) = sReflectSeekWide1                                                                     // tclIORTrans.c:78:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclStubHooks)) + 0 /* .tclPlatStubs */)) = uintptr(unsafe.Pointer(&tclPlatStubs))                                                                                                // tclStubInit.c:960:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclStubHooks)) + 8 /* .tclIntStubs */)) = uintptr(unsafe.Pointer(&tclIntStubs))                                                                                                  // tclStubInit.c:961:5:
	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclStubHooks)) + 16 /* .tclIntPlatStubs */)) = uintptr(unsafe.Pointer(&tclIntPlatStubs))                                                                                         // tclStubInit.c:962:5:
	*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclVarHashKeyType)) + 8)) = XTclHashObjKey                                                                                                      // tclVar.c:34:5:
	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclVarHashKeyType)) + 16)) = sCompareVarKeys                                                                                                     // tclVar.c:35:5:
	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclVarHashKeyType)) + 24)) = sAllocVarEntry                                                                                                    // tclVar.c:36:5:
	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tclVarHashKeyType)) + 32)) = sFreeVarEntry                                                                                                                      // tclVar.c:37:5:
	*(*func(*libc.TLS, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tcpChannelType)) + 16)) = sTcpCloseProc                                                                                                       // tclUnixSock.c:151:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tcpChannelType)) + 24)) = sTcpInputProc                                                                                       // tclUnixSock.c:152:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tcpChannelType)) + 32)) = sTcpOutputProc                                                                                      // tclUnixSock.c:153:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tcpChannelType)) + 56)) = sTcpGetOptionProc                                                                                 // tclUnixSock.c:156:5:
	*(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&tcpChannelType)) + 64)) = sTcpWatchProc                                                                                                               // tclUnixSock.c:157:5:
	*(*func(*libc.TLS, ClientData, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tcpChannelType)) + 72)) = sTcpGetHandleProc                                                                                            // tclUnixSock.c:158:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tcpChannelType)) + 80)) = sTcpClose2Proc                                                                                               // tclUnixSock.c:159:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tcpChannelType)) + 88)) = sTcpBlockModeProc                                                                                                     // tclUnixSock.c:160:5:
	*(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&tcpChannelType)) + 120)) = sTcpThreadActionProc                                                                                                       // tclUnixSock.c:164:5:
	*(*func(*libc.TLS, uintptr, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&traceSubCmds)) + 0)) = sTraceExecutionObjCmd                                                                                       // tclTrace.c:114:5:
	*(*func(*libc.TLS, uintptr, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&traceSubCmds)) + 8)) = sTraceCommandObjCmd                                                                                         // tclTrace.c:115:5:
	*(*func(*libc.TLS, uintptr, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&traceSubCmds)) + 16)) = sTraceVariableObjCmd                                                                                       // tclTrace.c:116:5:
	*(*func(*libc.TLS, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 16)) = sTransformCloseProc                                                                                           // tclIOGT.c:124:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 24)) = sTransformInputProc                                                                           // tclIOGT.c:125:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 32)) = sTransformOutputProc                                                                          // tclIOGT.c:126:5:
	*(*func(*libc.TLS, ClientData, int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 40)) = sTransformSeekProc                                                                              // tclIOGT.c:127:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 48)) = sTransformSetOptionProc                                                                     // tclIOGT.c:128:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 56)) = sTransformGetOptionProc                                                                     // tclIOGT.c:129:5:
	*(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 64)) = sTransformWatchProc                                                                                                   // tclIOGT.c:130:5:
	*(*func(*libc.TLS, ClientData, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 72)) = sTransformGetFileHandleProc                                                                            // tclIOGT.c:131:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 80)) = sTransformClose2Proc                                                                                   // tclIOGT.c:132:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 88)) = sTransformBlockModeProc                                                                                         // tclIOGT.c:133:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 104)) = sTransformNotifyProc                                                                                           // tclIOGT.c:135:5:
	*(*func(*libc.TLS, ClientData, Tcl_WideInt, int32, uintptr) Tcl_WideInt)(unsafe.Pointer(uintptr(unsafe.Pointer(&transformChannelType)) + 112)) = sTransformWideSeekProc                                                             // tclIOGT.c:136:5:
	*(*func(*libc.TLS, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&ttyChannelType)) + 16)) = sFileCloseProc                                                                                                      // tclUnixChan.c:167:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&ttyChannelType)) + 24)) = sFileInputProc                                                                                      // tclUnixChan.c:168:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&ttyChannelType)) + 32)) = sFileOutputProc                                                                                     // tclUnixChan.c:169:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&ttyChannelType)) + 48)) = sTtySetOptionProc                                                                                 // tclUnixChan.c:171:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&ttyChannelType)) + 56)) = sTtyGetOptionProc                                                                                 // tclUnixChan.c:172:5:
	*(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&ttyChannelType)) + 64)) = sFileWatchProc                                                                                                              // tclUnixChan.c:173:5:
	*(*func(*libc.TLS, ClientData, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&ttyChannelType)) + 72)) = sFileGetHandleProc                                                                                           // tclUnixChan.c:174:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&ttyChannelType)) + 80)) = sFileClose2Proc                                                                                              // tclUnixChan.c:175:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&ttyChannelType)) + 88)) = sFileBlockModeProc                                                                                                    // tclUnixChan.c:176:5:
	*(*func(*libc.TLS, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zlibChannelType)) + 16)) = sZlibTransformClose                                                                                                // tclZlib.c:209:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zlibChannelType)) + 24)) = sZlibTransformInput                                                                                // tclZlib.c:210:5:
	*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zlibChannelType)) + 32)) = sZlibTransformOutput                                                                               // tclZlib.c:211:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zlibChannelType)) + 48)) = sZlibTransformSetOption                                                                          // tclZlib.c:213:5:
	*(*func(*libc.TLS, ClientData, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zlibChannelType)) + 56)) = sZlibTransformGetOption                                                                          // tclZlib.c:214:5:
	*(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&zlibChannelType)) + 64)) = sZlibTransformWatch                                                                                                        // tclZlib.c:215:5:
	*(*func(*libc.TLS, ClientData, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zlibChannelType)) + 72)) = sZlibTransformGetHandle                                                                                     // tclZlib.c:216:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zlibChannelType)) + 88)) = sZlibTransformBlockMode                                                                                              // tclZlib.c:218:5:
	*(*func(*libc.TLS, ClientData, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zlibChannelType)) + 104)) = sZlibTransformEventHandler                                                                                          // tclZlib.c:220:5:
}

var ts1 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/\x00\n\n\n========= RAW ==========\n\x00\n\n\n========= TREE FIXED ==========\n\x00\n\n\n========= LA%d ==========\n\x00\n\n\n========= SEARCH ==========\n\x00\n\n\n========= TREE NODE %s ==========\n\x00null tree\n\x00%s. `%c'\x00 longest\x00 shortest\x00 hasmixed\x00 hascapture\x00 hasbackref\x00 UNUSED\x00 (#%d)\x00 {%d,\x00%d\x00}\x00 %ld-%ld\x00 L:%s\x00 R:%s\x00\n\x00unable\x00%p\x00\ninitial cleanup:\n\x00\nempties:\n\x00\nconstraints:\n\x00\nfinal cleanup:\n\x00NUL\x00SOH\x00STX\x00ETX\x00EOT\x00ENQ\x00ACK\x00BEL\x00alert\x00BS\x00backspace\x00HT\x00tab\x00LF\x00newline\x00VT\x00vertical-tab\x00FF\x00form-feed\x00CR\x00carriage-return\x00SO\x00SI\x00DLE\x00DC1\x00DC2\x00DC3\x00DC4\x00NAK\x00SYN\x00ETB\x00CAN\x00EM\x00SUB\x00ESC\x00IS4\x00FS\x00IS3\x00GS\x00IS2\x00RS\x00IS1\x00US\x00space\x00exclamation-mark\x00quotation-mark\x00number-sign\x00dollar-sign\x00percent-sign\x00ampersand\x00apostrophe\x00left-parenthesis\x00right-parenthesis\x00asterisk\x00plus-sign\x00comma\x00hyphen\x00hyphen-minus\x00period\x00full-stop\x00slash\x00solidus\x00zero\x00one\x00two\x00three\x00four\x00five\x00six\x00seven\x00eight\x00nine\x00colon\x00semicolon\x00less-than-sign\x00equals-sign\x00greater-than-sign\x00question-mark\x00commercial-at\x00left-square-bracket\x00backslash\x00reverse-solidus\x00right-square-bracket\x00circumflex\x00circumflex-accent\x00underscore\x00low-line\x00grave-accent\x00left-brace\x00left-curly-bracket\x00vertical-line\x00right-brace\x00right-curly-bracket\x00tilde\x00DEL\x00alnum\x00alpha\x00ascii\x00blank\x00cntrl\x00digit\x00graph\x00lower\x00print\x00punct\x00upper\x00xdigit\x00*** unknown regex error code 0x%x ***\x00REG_OKAY\x00no errors detected\x00REG_NOMATCH\x00failed to match\x00REG_BADPAT\x00invalid regexp (reg version 0.8)\x00REG_ECOLLATE\x00invalid collating element\x00REG_ECTYPE\x00invalid character class\x00REG_EESCAPE\x00invalid escape \\ sequence\x00REG_ESUBREG\x00invalid backreference number\x00REG_EBRACK\x00brackets [] not balanced\x00REG_EPAREN\x00parentheses () not balanced\x00REG_EBRACE\x00braces {} not balanced\x00REG_BADBR\x00invalid repetition count(s)\x00REG_ERANGE\x00invalid character range\x00REG_ESPACE\x00out of memory\x00REG_BADRPT\x00quantifier operand invalid\x00REG_ASSERT\x00\"can't happen\" -- you found a bug\x00REG_INVARG\x00invalid argument to regex function\x00REG_MIXED\x00character widths of regex and string differ\x00REG_BADOPT\x00invalid embedded option\x00REG_ETOOBIG\x00regular expression is too complex\x00REG_ECOLORS\x00too many colors\x00\x00oops\x00REG_%u\x00assemblecode\x00push\x00add\x00append\x00appendArray\x00appendArrayStk\x00appendStk\x00arrayExistsImm\x00arrayExistsStk\x00arrayMakeImm\x00arrayMakeStk\x00beginCatch\x00bitand\x00bitnot\x00bitor\x00bitxor\x00clockRead\x00concat\x00concatStk\x00coroName\x00currentNamespace\x00dictAppend\x00dictExists\x00dictExpand\x00dictGet\x00dictIncrImm\x00dictLappend\x00dictRecombineStk\x00dictRecombineImm\x00dictSet\x00dictUnset\x00div\x00dup\x00endCatch\x00eq\x00eval\x00evalStk\x00exist\x00existArray\x00existArrayStk\x00existStk\x00expon\x00expr\x00exprStk\x00ge\x00gt\x00incr\x00incrArray\x00incrArrayImm\x00incrArrayStk\x00incrArrayStkImm\x00incrImm\x00incrStk\x00incrStkImm\x00infoLevelArgs\x00infoLevelNumber\x00invokeStk\x00jump\x00jump4\x00jumpFalse\x00jumpFalse4\x00jumpTable\x00jumpTrue\x00jumpTrue4\x00label\x00land\x00lappend\x00lappendArray\x00lappendArrayStk\x00lappendList\x00lappendListArray\x00lappendListArrayStk\x00lappendListStk\x00lappendStk\x00le\x00lindexMulti\x00list\x00listConcat\x00listIn\x00listIndex\x00listIndexImm\x00listLength\x00listNotIn\x00load\x00loadArray\x00loadArrayStk\x00loadStk\x00lor\x00lsetFlat\x00lsetList\x00lshift\x00lt\x00mod\x00mult\x00neq\x00nop\x00not\x00nsupvar\x00numericType\x00originCmd\x00over\x00pop\x00pushReturnCode\x00pushReturnOpts\x00pushResult\x00regexp\x00resolveCmd\x00reverse\x00rshift\x00store\x00storeArray\x00storeArrayStk\x00storeStk\x00strcaseLower\x00strcaseTitle\x00strcaseUpper\x00strcmp\x00strcat\x00streq\x00strfind\x00strindex\x00strlen\x00strmap\x00strmatch\x00strneq\x00strrange\x00strreplace\x00strrfind\x00strtrim\x00strtrimLeft\x00strtrimRight\x00sub\x00tclooClass\x00tclooIsObject\x00tclooNamespace\x00tclooSelf\x00tryCvtToBoolean\x00tryCvtToNumeric\x00uminus\x00unset\x00unsetArray\x00unsetArrayStk\x00unsetStk\x00uplus\x00upvar\x00variable\x00verifyDict\x00yield\x00bytecodeList\x00\n    (\"\x00\" body, line \x00)\x00\n    (\"%.*s\" body, line %d)\x00instruction\x00value\x00boolean\x00boolean varName\x00imm8\x00operand must be [0..3]\x00TCL\x00ASSEM\x00OPERAND<0,>3\x00count\x00count varName\x00script\x00expression\x00table\x00name\x00operand must be >=2\x00OPERAND>=2\x00varname\x00varName imm8\x00Instruction \"%s\" could not be found, can't happen\n\x00no ASSEM_EVAL case for %s (%d), can't happen\x00jump table must have an even number of list elements\x00BADJUMPTABLE\x00duplicate entry in jump table for \"%s\"\x00DUPJUMPTABLEENTRY\x00assembly code may not contain substitutions\x00NOSUBST\x00cannot use this instruction to create a variable in a non-proc context\x00LVT\x00variable \"%s\" is not local\x00NONLOCAL\x00operand does not fit in one byte\x001BYTE\x00operand must be nonnegative\x00NONNEGATIVE\x00operand must be positive\x00POSITIVE\x00duplicate definition of label \"%s\"\x00DUPLABEL\x00undefined label \"%s\"\x00NOLABEL\x00\"%s\" instruction may not appear in a context where an exception has been caught and not disposed of.\x00BADTHROW\x00inconsistent stack depths on two execution paths\x00BADSTACK\x00stack underflow\x00code pops stack below level of enclosing catch\x00BADSTACKINCATCH\x00stack is unbalanced on exit from the code (depth=%d)\x00execution reaches an instruction in inconsistent exception contexts\x00BADCATCH\x00endCatch without a corresponding beginCatch\x00BADENDCATCH\x00catch still active on exit from assembly code\x00UNCLOSEDCATCH\x00unclosed catch at end of code in tclAssembly.c:BuildExceptionRanges, can't happen\x00undefined label in tclAssembly.c:BuildExceptionRanges, can't happen\x00\n    in assembly code between lines \x00 and \x00end of assembly code\x00Tcl_AsyncDelete: async handler deleted by the wrong thread\x00Tcl_AsyncDelete: cannot find async handler\x00apply\x00break\x00case\x00catch\x00continue\x00coroutine\x00error\x00for\x00foreach\x00format\x00global\x00if\x00join\x00lassign\x00lindex\x00linsert\x00llength\x00lmap\x00lrange\x00lrepeat\x00lreplace\x00lreverse\x00lsearch\x00lset\x00lsort\x00package\x00proc\x00regsub\x00rename\x00return\x00scan\x00set\x00split\x00subst\x00switch\x00tailcall\x00throw\x00trace\x00try\x00uplevel\x00while\x00yieldto\x00after\x00cd\x00close\x00eof\x00exec\x00exit\x00fblocked\x00fconfigure\x00fcopy\x00fileevent\x00flush\x00gets\x00glob\x00open\x00pid\x00puts\x00pwd\x00read\x00seek\x00socket\x00source\x00tell\x00time\x00unload\x00update\x00vwait\x00abs\x00acos\x00asin\x00atan\x00atan2\x00bool\x00ceil\x00cos\x00cosh\x00double\x00entier\x00exp\x00floor\x00fmod\x00hypot\x00int\x00isqrt\x00log\x00log10\x00pow\x00rand\x00round\x00sin\x00sinh\x00sqrt\x00srand\x00tan\x00tanh\x00wide\x00~\x00integer\x00!\x00+\x00*\x00&\x00|\x00^\x00**\x00<<\x00integer shift\x00>>\x00%\x00integer integer\x00!=\x00value value\x00ne\x00in\x00value list\x00ni\x00-\x00value ?value ...?\x00/\x00<\x00<=\x00>\x00>=\x00==\x00Tcl_CallFrame must not be smaller than CallFrame\x00::errorInfo\x00UP\x00CALL\x00INNER\x00::errorCode\x00TCL_PKG_PREFER_LATEST\x00TCL_INTERP_DEBUG_FRAME\x00Tcl_CreateInterp: can't create global namespace\x00builtin command with NULL object command proc and a NULL compile proc\x00::tcl::Bgerror\x00::tcl::unsupported::disassemble\x00::tcl::unsupported::getbytecode\x00::tcl::unsupported::representation\x00::tcl::unsupported::assemble\x00::tcl::unsupported::inject\x00::tcl::unsupported::corotype\x00::tcl::unsupported::timerate\x00::tcl::unsupported\x00::tcl::mathfunc\x00Can't create math function namespace\x00::tcl::mathfunc::\x00::tcl::mathop\x00can't create math operator namespace\x00::tcl::mathop::\x00failed to create math operator %s\x00tcl_platform\x00engine\x00Tcl\x00byteOrder\x00littleEndian\x00bigEndian\x00wordSize\x00pointerSize\x00tcl_patchLevel\x008.6.12\x00tcl_version\x008.6\x00tcl_precision\x00threaded\x001\x00%s\x00Assoc Data Key #%d\x00DeleteInterpProc called with active evals\x00DeleteInterpProc called on interpreter not marked deleted\x00DeleteInterpProc: popping rootCallFrame with other frames on top\x00Argument location tracking table not empty\x00::\x00cannot use namespace qualifiers in hidden command token (rename)\x00VALUE\x00HIDDENTOKEN\x00can only hide global namespace commands (use rename then hide)\x00HIDE\x00NON_GLOBAL\x00hidden command named \"%s\" already exists\x00ALREADY_HIDDEN\x00cannot expose to a namespace (use expose to toplevel, then rename)\x00EXPOSE\x00unknown hidden command \"%s\"\x00LOOKUP\x00trying to expose a non-global command namespace command\x00exposed command \"%s\" already exists\x00COMMAND_EXISTS\x00can't %s \"%s\": command doesn't exist\x00delete\x00COMMAND\x00can't rename to \"%s\": bad command name\x00can't rename to \"%s\": command already exists\x00OPERATION\x00RENAME\x00TARGET_EXISTS\x00argument to math function didn't have numeric value\x00tcl::mathfunc::\x00unknown math function \"%s\"\x00MATHFUNC\x00::info functions \x00attempt to call eval in deleted interpreter\x00IDELETE\x00too many nested evaluations (infinite loop?)\x00LIMIT\x00STACK\x00IUNWIND\x00eval unwound\x00ICANCEL\x00eval canceled\x00CANCEL\x00attempt to invoke a deleted command\x00EVAL\x00DELETEDCOMMAND\x00Tcl_EvalObjv: NULL global namespace pointer\x00::unknown\x00invalid command name \"%s\"\x00\n    (enter trace on \"\x00...\x00\")\x00\n    (leave trace on \"\x00\n    (expanding word %d)\x00TclArgumentBC Enter/Release Mismatch\x00invoked \"break\" outside of a loop\x00invoked \"continue\" outside of a loop\x00command returned bad code: %d\x00UNEXPECTED_RESULT_CODE\x00illegal argument vector\x00TclObjInvoke: called without TCL_INVOKE_HIDDEN\x00invalid hidden command name \"%s\"\x00NONE\x00square root of negative argument\x00ARITH\x00DOMAIN\x00domain error: argument not in valid range\x00%s arguments for math function \"%s\"\x00not enough\x00too many\x00WRONGARGS\x00tailcall cannot find the right splicing spot: should not happen!\x00?command? ?arg ...?\x00tailcall can only be called from a proc, lambda or method\x00TAILCALL\x00ILLEGAL\x00Adding a callback without an objProc?!\x00?returnValue?\x00yield can only be called in a coroutine\x00COROUTINE\x00ILLEGAL_YIELD\x00command ?arg ...?\x00yieldto can only be called in a coroutine\x00yieldto called in deleted namespace\x00YIELDTO_IN_DELETED\x00cannot yield: C stack busy\x00CANT_YIELD\x00Yield received an option which is not implemented\x00can only get coroutine type of a coroutine\x00active\x00unknown coroutine type\x00BAD_TYPE\x00coroName cmd ?arg1 arg2 ...?\x00can only inject a command into a coroutine\x00can only inject a command into a suspended coroutine\x00ACTIVE\x00coroutine \"%s\" is already running\x00BUSY\x00?arg?\x00wrong coro nargs; how did we get here? not implemented!\x00name cmd ?arg ...?\x00can't create procedure \"%s\": unknown namespace\x00NAMESPACE\x00can't create procedure \"%s\": bad procedure name\x00encode\x00decode\x00hex\x00uuencode\x00base64\x00bytearray\x00%s called with shared object\x00Tcl_SetByteArrayObj\x00Tcl_SetByteArrayLength\x00max size for a Tcl value (%d bytes) exceeded\x00TclAppendBytesToByteArray\x00%s must be called with definite number of bytes to append\x00binary\x00binary encode\x00binary decode\x00formatString ?arg ...?\x00number of elements in list does not match count\x00cannot use \"*\" in format string with \"x\"\x00hexadecimal\x00expected %s string but got \"%s\" instead\x00missing count for \"@\" field specifier\x00not enough arguments for all format specifiers\x00\x00\x00\x00\x00\x00\x00\x00\x00bad field specifier \"%s\"\x00value formatString ?varName ...?\x000123456789abcdef\x00unexpected fallthrough\x00data\x00?options? data\x00option\x00invalid hexadecimal digit \"%c\" at position %d\x00BINARY\x00DECODE\x00INVALID\x00-strict\x00?-maxlen len? ?-wrapchar char? data\x00line length out of range\x00ENCODE\x00LINE_LENGTH\x00limit hit\x00-maxlen\x00-wrapchar\x00invalid wrapchar; will defeat decoding\x00WRAPCHAR\x00short uuencode data\x00SHORT\x00invalid uuencode character \"%c\" at position %d\x00invalid base64 character \"%c\" at position %d\x00unable to alloc %u bytes\x00unable to alloc %u bytes, %s line %d\x00unable to realloc %u bytes\x00unable to realloc %u bytes, %s line %d\x00%a %b %d %H:%M:%S %Z %Y\x00BCE\x00C\x00cannot use -gmt and -timezone in same call\x00CE\x00dayOfMonth\x00dayOfWeek\x00dayOfYear\x00era\x00:GMT\x00gregorian\x00integer value too large to represent\x00iso8601Week\x00iso8601Year\x00julianDay\x00localSeconds\x00month\x00seconds\x00tzName\x00tzOffset\x00year\x00getenv\x00Oldscan\x00ConvertLocalToUTC\x00GetDateFields\x00GetJulianDayFromEraYearMonthDay\x00GetJulianDayFromEraYearWeekDay\x00ParseFormatArgs\x00::tcl::clock::\x00clock\x00clicks\x00microseconds\x00milliseconds\x00dict tzdata changeover\x00key \"localseconds\" not found in dictionary\x00seconds tzdata changeover\x00expected key(s) not found in dictionary\x00dict changeover\x00loop in ConvertLocalToUTCUsingTable\x00time value too large/small to represent\x00number too large to represent as a Posix time\x00CLOCK\x00argTooLarge\x00localtime failed (clock value may be too large/small to represent)\x00localtimeFailed\x00%02d\x00?-switch?\x00-milliseconds\x00-microseconds\x00clock format clockval ?-format string? ?-gmt boolean? ?-locale LOCALE? ?-timezone ZONE?\x00wrongNumArgs\x00badOption\x00gmtWithTimezone\x00-format\x00-gmt\x00-locale\x00-timezone\x00TZ\x00string ?in? ?pattern body ...? ?default body?\x00extra case pattern with no body\x00default\x00\n    (\"%.50s\" arm line %d)\x00script ?resultVarName? ?optionVarName?\x00\n    (\"catch\" body line %d)\x00?dirName?\x00couldn't change working directory to \"%s\": %s\x00encoding\x00convertfrom\x00convertto\x00dirs\x00names\x00system\x00::tcl::encoding::\x00tcl:encoding:\x00___tmp\x00problem making 'encoding %s' safe: %s\x00problem making 'encoding' safe: %s\x00not allowed to invoke subcommand %s of encoding\x00SAFE\x00SUBCOMMAND\x00?encoding? data\x00?dirList?\x00expected directory list but got \"%s\"\x00ENCODING\x00BADPATH\x00?encoding?\x00message ?errorInfo? ?errorCode?\x00-code error -level 0\x00-errorinfo\x00-errorcode\x00\n    (\"eval\" body line %d)\x00arg ?arg ...?\x00?returnCode?\x00file\x00atime\x00attributes\x00channels\x00copy\x00dirname\x00executable\x00exists\x00extension\x00isdirectory\x00isfile\x00link\x00lstat\x00mtime\x00mkdir\x00nativename\x00normalize\x00owned\x00pathtype\x00readable\x00readlink\x00rootname\x00separator\x00size\x00stat\x00tail\x00tempfile\x00type\x00volumes\x00writable\x00::tcl::file::\x00tcl:file:\x00problem making 'file %s' safe: %s\x00problem making 'file' safe: %s\x00not allowed to invoke subcommand %s of file\x00name ?time?\x00could not set access time for file \"%s\": %s\x00could not set modification time for file \"%s\": %s\x00name varName\x00unrecognised path\x00FILESYSTEM\x00name ?name ...?\x00could not read \"%s\": no such file or directory\x00PATHSPLIT\x00NONESUCH\x00absolute\x00relative\x00volumerelative\x00?name?\x00\\\x00could not read \"%s\": %s\x00dev\x00ino\x00nlink\x00uid\x00gid\x00blocks\x00blksize\x00ctime\x00mode\x00directory\x00characterSpecial\x00blockSpecial\x00fifo\x00unknown\x00start test next command\x00\n    (\"for\" body line %d)\x00\n    (\"for\" initial command)\x00\n    (\"for\" loop-end command)\x00varList list ?varList list ...? command\x00%s varlist is empty\x00LMAP\x00FOREACH\x00NEEDVARS\x00\n    (\"%s\" body line %d)\x00\n    (setting %s loop variable \"%s\")\x00args\x00body\x00cmdcount\x00commands\x00complete\x00errorstack\x00frame\x00functions\x00globals\x00hostname\x00level\x00library\x00loaded\x00locals\x00nameofexecutable\x00patchlevel\x00procs\x00sharedlibextension\x00tclversion\x00vars\x00wrong # args: no expression after \"%s\" argument\x00then\x00elseif\x00else\x00wrong # args: extra words after \"else\" clause in \"if\" command\x00wrong # args: no script following \"%s\" argument\x00varName ?increment?\x00info\x00procname\x00\"%s\" isn't a procedure\x00PROCEDURE\x00?pattern?\x00*[?\\\x00command\x00procname arg varname\x00procedure \"%s\" doesn't have an argument \"%s\"\x00ARGUMENT\x00?interp?\x00varName\x00?number?\x00Broken frame level calculation\x00bad level \"%s\"\x00LEVEL\x00line\x00cmd\x00TCL_LOCATION_PROC found in standard frame\x00precompiled\x00\t    ::apply [::list {{pattern *}} {\n\t\t::set cmds {}\n\t\t::foreach cmd [::info commands ::tcl::mathfunc::$pattern] {\n\t\t    ::lappend cmds [::namespace tail $cmd]\n\t\t}\n\t\t::foreach cmd [::info commands tcl::mathfunc::$pattern] {\n\t\t    ::set cmd [::namespace tail $cmd]\n\t\t    ::if {$cmd ni $cmds} {\n\t\t\t::lappend cmds $cmd\n\t\t    }\n\t\t}\n\t\t::return $cmds\n\t    } [::namespace current]] \x00unable to determine name of host\x00HOSTNAME\x00UNKNOWN\x00tcl_library\x00no library has been specified for Tcl\x00VARIABLE\x00?filename?\x00list ?joinString?\x00 \x00list ?varName ...?\x00list ?index ...?\x00list index ?element ...?\x00list first last\x00count ?value ...?\x00bad count \"%d\": must be integer >= 0\x00LREPEAT\x00NEGARG\x00max length of a Tcl list (%d elements) exceeded\x00MEMORY\x00list first last ?element ...?\x00?-option value ...? list pattern\x00missing starting index\x00MISSING\x00\"-index\" option must be followed by list index\x00index \"%s\" cannot select an element from any list\x00INDEXOUTOFRANGE\x00\n    (-index option item number %d)\x00-subindices cannot be used without -index option\x00LSEARCH\x00BAD_OPTION_MIX\x00-bisect is not compatible with -all or -not\x00-all\x00-ascii\x00-bisect\x00-decreasing\x00-dictionary\x00-exact\x00-glob\x00-increasing\x00-index\x00-inline\x00-integer\x00-nocase\x00-not\x00-real\x00-regexp\x00-sorted\x00-start\x00-subindices\x00listVar ?index? ?index ...? value\x00?-option value ...? list\x00\"-command\" option must be followed by comparison command\x00\"-stride\" option must be followed by stride length\x00stride length must be at least 2\x00LSORT\x00BADSTRIDE\x00list size must be a multiple of the stride length\x00when used with \"-stride\", the leading \"-index\" value must be within the group\x00BADINDEX\x00no enough memory to proccess sort of %d items\x00-command\x00-indices\x00-stride\x00-unique\x00\n    (-compare command)\x00-compare command returned non-integer result\x00COMPARISONFAILED\x00element %d missing from sublist \"%s\"\x00INDEXFAILED\x00\t\n\v\f\r \xc0\x80\u0085\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u2060\u3000\ufeff\x00?-option ...? exp string ?matchVar? ?subMatchVar ...?\x00regexp match variables not allowed when using -inline\x00REGEXP\x00MIX_VAR_INLINE\x00-about\x00-expanded\x00-line\x00-linestop\x00-lineanchor\x00--\x00?-option ...? exp string subSpec ?varName?\x00&\\\x00*+?{}()[].\\|^$\x00oldName newName\x00?-encoding name? fileName\x00-encoding\x00 \n\t\r\x00string ?splitChars?\x00needleString haystackString ?startIndex?\x00string charIndex\x00class ?-strict? ?-failindex var? str\x00class\x00?-strict? ?-failindex var? str\x00control\x00false\x00true\x00wideinteger\x00wordchar\x00-failindex\x00?-nocase? charMap string\x00bad option \"%s\": must be -nocase\x00INDEX\x00char map list unbalanced\x00MAP\x00UNBALANCED\x00?-nocase? pattern string\x00string first last\x00string count\x00result exceeds max size for a Tcl value (%d bytes)\x00string size overflow, out of memory allocating %u bytes\x00string first last ?string?\x00string\x00string index\x00?-nocase? ?-length int? string1 string2\x00-length\x00bad option \"%s\": must be -nocase or -length\x00string ?first? ?last?\x00string ?chars?\x00bytelength\x00cat\x00compare\x00equal\x00first\x00index\x00is\x00last\x00length\x00map\x00match\x00range\x00repeat\x00replace\x00tolower\x00toupper\x00totitle\x00trim\x00trimleft\x00trimright\x00wordend\x00wordstart\x00Tcl_SubstObjCmd: bad option index to SubstOptions\x00-nobackslashes\x00-nocommands\x00-novariables\x00?-nobackslashes? ?-nocommands? ?-novariables? string\x00bad option \"%s\": %s option already found\x00SWITCH\x00DOUBLEOPT\x00missing variable name argument to %s option\x00-indexvar\x00NOVAR\x00-matchvar\x00?-option ...? string ?pattern body ...? ?default body?\x00%s option requires -regexp option\x00MODERESTRICTION\x00?-option ...? string {?pattern body ...? ?default body?}\x00extra switch pattern with no body\x00BADARM\x00, this may be due to a comment incorrectly placed outside of a switch body - see the \"switch\" documentation\x00COMMENT?\x00no body specified for pattern \"%s\"\x00FALLTHROUGH\x00fall-out when searching for body to match pattern\x00\n    (\"%.*s%s\" arm line %d)\x00type message\x00type must be non-empty list\x00THROW\x00BADEXCEPTION\x00-code error -level 0 -errorcode\x00command ?count?\x00per\x00iteration\x00?-direct? ?-calibrate? ?-overhead double? command ?time ?max-count??\x00µs/#-overhead\x00%.*f\x00%.3f\x00net-ms\x00µs/#\x00#\x00#/sec\x00-direct\x00-overhead\x00-calibrate\x00body ?handler ...? ?finally script?\x00handler type\x00finally clause must be last\x00TRY\x00FINALLY\x00NONTERMINAL\x00wrong # args to finally clause: must be \"... finally script\"\x00wrong # args to on clause: must be \"... on code variableList script\"\x00ON\x00wrong # args to trap clause: must be \"... trap pattern variableList script\"\x00TRAP\x00bad prefix '%s': must be a list\x00EXNFORMAT\x00last non-finally clause must not have a body of \"-\"\x00BADFALLTHROUGH\x00finally\x00on\x00trap\x00-during\x00\n    (\"%s ... %s\" handler line %d)\x00\n    (\"%s ... finally\" body line %d)\x00test command\x00\n    (\"while\" body line %d)\x00ForeachInfo\x00NewForeachInfo\x00DictUpdateInfo\x000\x00list must have an even number of elements\x00-errorcode {TCL ARGUMENT FORMAT}\x00bad stack depth computations: is %i, should be %i\x00TclCompileCatchCmd: bad jump distance %d\x00TclCompileDictCmd(update): bad jump distance %d\x00, \x00%%v%u\x00variables\x00data=[\x00], loop=%%v%u\x00,\x00\n\t\t it%%v%u\t[\x00]\x00jumpOffset=%+d, vars=\x00[\x00loop\x00assign\x00jumpOffset\x00TclCompileIfCmd: unexpected opcode \"%d\" updating ifFalse jump\x00object\x00::namespace inscope \x00::namespace\x00inscope\x00:\x002\x00end\x00-options\x00namespace\x00JumptableInfo\x003\x00word\x00\x00\x00\x00TclCompileSubstCmd: bad start jump distance %d\x00unexpected token type in TclCompileSubstCmd: %d\x00TclCompileSubstCmd: bad break jump distance %d\x00TclCompileSubstCmd: bad continue jump distance %d\x00TclCompileSubstCmd: bad return jump distance %d\x00TclCompileSubstCmd: bad other jump distance %d\x00TclCompileSubstCmd: bad ok jump distance %d\x00TclCompileSubstCmd: bad end jump distance %d\x00unknown switch mode: %d\x00\n\t\t\x00\"%s\"->pc %d\x00mapping\x00-errorcode {TCL OPERATION THROW BADEXCEPTION}\x00-level 0 -code 0\x00-nocomplain\x00-1\x001.0\x00_@_\x00not enough memory to parse expression\x00NOMEM\x00invalid character \"%.*s\"\x00BADCHAR\x00incomplete operator \"%.*s\"\x00PARTOP\x00invalid bareword \"%.*s%s\"\x00should be \"$%.*s%s\" or \"{%.*s%s}\"\x00 or \"%.*s%s(...)\" or ...\x00BAREWORD\x00 (invalid binary number?)\x00BADNUMBER\x00 (invalid octal number?)\x00OCTAL\x00missing operator at %s\x00max # of tokens for a Tcl parse (%d) exceeded\x00invalid character \"$\"\x00missing close-bracket\x00empty subexpression at %s\x00EMPTY\x00unbalanced open paren\x00missing function argument at %s\x00empty expression\x00unbalanced close paren\x00missing operand at %s\x00missing operator \":\" at %s\x00unexpected operator \":\" without preceding \"?\"\x00SURPRISE\x00unexpected \",\" outside function argument list\x00\nin expression \"%s%.*s%.*s%s%s%.*s%s\"\x00;\n\x00\n    (parsing expression \"%.*s%s\")\x00PARSE\x00EXPR\x00done\x00push1\x00push4\x00invokeStk1\x00invokeStk4\x00loadScalar1\x00loadScalar4\x00loadScalarStk\x00loadArray1\x00loadArray4\x00storeScalar1\x00storeScalar4\x00storeScalarStk\x00storeArray1\x00storeArray4\x00incrScalar1\x00incrScalarStk\x00incrArray1\x00incrScalar1Imm\x00incrScalarStkImm\x00incrArray1Imm\x00jump1\x00jumpTrue1\x00jumpFalse1\x00callBuiltinFunc1\x00callFunc1\x00foreach_start4\x00foreach_step4\x00beginCatch4\x00appendScalar1\x00appendScalar4\x00appendArray1\x00appendArray4\x00lappendScalar1\x00lappendScalar4\x00lappendArray1\x00lappendArray4\x00returnImm\x00expandStart\x00expandStkTop\x00invokeExpanded\x00listRangeImm\x00startCommand\x00returnStk\x00dictFirst\x00dictNext\x00dictDone\x00dictUpdateStart\x00dictUpdateEnd\x00syntax\x00existScalar\x00returnCodeBranch\x00unsetScalar\x00strrangeImm\x00invokeReplace\x00expandDrop\x00foreach_start\x00foreach_step\x00foreach_end\x00lmap_collect\x00tclooNext\x00tclooNextClass\x00yieldToInvoke\x00strclass\x00bytecode\x00substcode\x00::tcl\x00::tcl::\x00TclCompileScript() called on uninitialized CompileEnv\x00too many nested compilations (infinite loop?)\x00Unexpected token type in TclCompileTokens: %d; %.*s\x00TclInitByteCodeObj() called on uninitialized CompileEnv\x00EnterCmdStartData: bad command index %d\x00EnterCmdStartData: cmd map not sorted by code offset\x00EnterCmdExtentData: bad command index %d\x00EnterCmdExtentData: missing start data for command %d\x00trying to add 'break' fixup to full exception range\x00trying to add 'continue' fixup to full exception range\x00trying to finalize a loop exception range\x00TclFixupForwardJump: bad ExceptionRange type %d\x00unexpected opcode\x00GetCmdLocEncodingSize: bad code offset\x00GetCmdLocEncodingSize: bad code length\x00GetCmdLocEncodingSize: bad source length\x00EncodeCmdLocMap: bad code offset\x00EncodeCmdLocMap: bad code length\x00EncodeCmdLocMap: bad source length\x00%s.\n%s: %s\x00Tcl_RegisterConfig\x00Unable to create namespace for package configuration.\x00::pkgconfig\x00%s: %s\x00Unable to create query command for package configuration\x00subcommand ?arg?\x00subcommand\x00package not known\x00FATAL\x00PKGCFG_BASE\x00key\x00key not known\x00CONFIG\x00insufficient memory to create list\x00QueryConfigObjCmd: Unknown subcommand to 'pkgconfig'. This can't happen\x00get\x00tclPackageAboutDict\x00Deleting\x00syntax error\x00Error: discarding\x00Error: popping\x00memory exhausted\x00Cleanup: discarding lookahead\x00Cleanup: popping\x00january\x00february\x00march\x00april\x00may\x00june\x00july\x00august\x00september\x00sept\x00october\x00november\x00december\x00sunday\x00monday\x00tuesday\x00tues\x00wednesday\x00wednes\x00thursday\x00thur\x00thurs\x00friday\x00saturday\x00fortnight\x00week\x00day\x00hour\x00minute\x00min\x00second\x00sec\x00tomorrow\x00yesterday\x00today\x00now\x00this\x00next\x00ago\x00epoch\x00stardate\x00gmt\x00ut\x00utc\x00uct\x00wet\x00bst\x00wat\x00at\x00nft\x00nst\x00ndt\x00ast\x00adt\x00est\x00edt\x00cst\x00cdt\x00mst\x00mdt\x00pst\x00pdt\x00yst\x00ydt\x00hst\x00hdt\x00ahst\x00nt\x00idlw\x00cet\x00cest\x00met\x00mewt\x00mest\x00swt\x00sst\x00fwt\x00fst\x00eet\x00bt\x00it\x00zp4\x00zp5\x00ist\x00zp6\x00wast\x00wadt\x00jt\x00cct\x00jst\x00jdt\x00kst\x00kdt\x00cast\x00cadt\x00east\x00eadt\x00gst\x00nzt\x00nzst\x00nzdt\x00idle\x00dst\x00a\x00b\x00c\x00d\x00e\x00f\x00g\x00h\x00i\x00k\x00l\x00m\x00n\x00o\x00p\x00q\x00r\x00s\x00t\x00u\x00v\x00w\x00x\x00y\x00z\x00 (characters \x00am\x00a.m.\x00pm\x00p.m.\x00stringToParse baseYear baseMonth baseDay\x00DATE\x00Unknown status returned from date parser. Please report this error as a bug in Tcl.\x00BUG\x00more than one date in string\x00MULTIPLE\x00more than one time of day in string\x00more than one time zone in string\x00more than one weekday in string\x00more than one ordinal month in string\x00create\x00filter\x00keys\x00merge\x00remove\x00values\x00with\x00dict\x00missing value to go with key\x00DICTIONARY\x00key \"%s\" not known in dictionary\x00DICT\x00Tcl_DictObjPut\x00Tcl_DictObjRemove\x00concurrent dictionary modification and search\x00Tcl_DictObjPutKeyList\x00%s called with empty key list\x00Tcl_DictObjRemoveKeyList\x00?key value ...?\x00dictionary ?key ...?\x00dictionary ?key value ...?\x00dictionary ?pattern?\x00dictionary\x00dictionary key ?key ...?\x00dictVarName key ?increment?\x00\n    (reading increment)\x00dictVarName key ?value ...?\x00{keyVarName valueVarName} dictionary script\x00must have exactly two variable names\x00SYNTAX\x00\n    (\"dict for\" body line %d)\x00\n    (\"dict map\" body line %d)\x00dictVarName key ?key ...? value\x00dictVarName key ?key ...?\x00dictionary filterType ?arg ...?\x00filterType\x00dictionary script {keyVarName valueVarName} filterScript\x00\n    (\"dict filter\" filter script key variable)\x00\n    (\"dict filter\" filter script value variable)\x00\n    (\"dict filter\" script line %d)\x00dictVarName key varName ?key varName ...? script\x00\n    (body of \"dict update\")\x00dictVarName ?key ...? script\x00\n    (body of \"dict with\")\x00instname\x00ByteCode 0x%s, refCt %u, epoch %u, interp 0x%s (epoch %u)\n\x00  Source \x00\n  File \"%s\" Line %d\x00\n  Cmds %d, src %d, inst %d, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n\x00  Proc 0x%s, refCt %d, args %d, compiled locals %d\n\x00      slot %d%s%s%s%s%s%s\x00, scalar\x00, array\x00, link\x00, arg\x00, temp\x00, resolved\x00, \"%s\"\n\x00  Exception ranges %d, depth %d:\n\x00      %d: level %d, %s, pc %d-%d, \x00continue %d, break %d\n\x00catch %d\n\x00DisassembleByteCodeObj: bad ExceptionRange type %d\x00    \x00  Commands %d:\x00%s%4d: pc %d-%d, src %d-%d\x00     \x00\n   \x00  Command %d: \x00(%u) %s \x00%+d \x00%u \x00, %u cmds start here\x00pc %u\x00next cmd at pc %u\x00%d \x00end \x00end-%d \x00FormatInstruction: bad local var index %u (%u locals)\x00temp var %u\x00var \x00%%v%u \x00%s \x00\t# \x00\t# %s\x00\t\t[\x00]\n\x00InnerContext: bad tos -- appending null object\x00InnerContext: bad tos -- appending freed object %p\x00inst_%d\x00\"\"\x00\"\x00\\\"\x00\\f\x00\\n\x00\\r\x00\\t\x00\\v\x00\\U%08x\x00\\u%04x\x00%c\x00scalar\x00array\x00arg\x00temp\x00resolved\x00pc %d\x00@%d\x00%%%d\x00.%d\x00.end\x00.end-%d\x00?%d\x00=%s\x00opcode %d with more than zero 'no' operands\x00type %s level %d from %d to %d break %d continue %d\x00type %s level %d from %d to %d catch %d\x00codefrom\x00codeto\x00scriptfrom\x00scriptto\x00literals\x00exception\x00instructions\x00auxiliary\x00stackdepth\x00exceptdepth\x00initiallinenumber\x00sourcefile\x00type ...\x00lambdaTerm\x00procName\x00PROC\x00className\x00\"%s\" is not a class\x00CLASS\x00\"%s\" has no defined constructor\x00DISASSEMBLE\x00CONSRUCTOR\x00body not available for this kind of constructor\x00METHODTYPE\x00body of constructor\x00\"%s\" has no defined destructor\x00DESRUCTOR\x00body not available for this kind of destructor\x00body of destructor\x00className methodName\x00objectName methodName\x00unknown method \"%s\"\x00METHOD\x00body not available for this kind of method\x00body of method\x00may not disassemble prebuilt bytecode\x00BYTECODE\x00constructor\x00destructor\x00lambda\x00method\x00objmethod\x00*.enc\x00identity\x00utf-8\x00unicode\x00iso8859-1\x00FreeEncoding: refcount problem !!!\x00.enc\x00unknown encoding \"%s\"\x00invalid encoding file \"%s\"\x00init\x00final\x00EscapeToUtfProc: invalid sub table\x00configure\x00-map\x00-parameters\x00-prefixes\x00-subcommands\x00-unknown\x00-namespace\x00ensembleCommand\x00tried to manipulate ensemble of deleted namespace\x00ENSEMBLE\x00DEAD\x00subcommand ?arg ...?\x00?option value ...?\x00ensemble subcommand implementations must be non-empty lists\x00EMPTY_TARGET\x00cmdname\x00cmdname ?-option value ...? ?arg ...?\x00option -namespace is read-only\x00READ_ONLY\x00unexpected ensemble command\x00command is not an ensemble\x00NOT_ENSEMBLE\x00ensemble target is not a fully-qualified command\x00UNQUALIFIED_TARGET\x00\"%s\" is not an ensemble command\x00tcl:\x00invalid ensemble name '%s'\x00unable to find or create %s namespace!\x00ensemble activated for deleted namespace\x00full name %s not found in supposedly synchronized hash\x00unknown subcommand \"%s\": namespace %s does not export any commands\x00unknown%s subcommand \"%s\": must be \x00 or ambiguous\x00or %s\x00SpellFix: programming error\x00unknown subcommand handler deleted its ensemble\x00UNKNOWN_DELETED\x00\n    while parsing result of ensemble unknown subcommand handler\x00unknown subcommand handler returned bad code: \x00\n    result of ensemble unknown subcommand handler: \x00UNKNOWN_RESULT\x00\n    (ensemble unknown subcommand handler)\x00env\x00HOME\x00no such variable\x00tclBgError\x00error in background error handler:\n\x00msg options\x00-level\x00missing return option \"-level\"\x00-code\x00missing return option \"-code\"\x00bgerror\x00errorInfo\x00bgerror failed to handle background error.\n\x00    Original error: \x00    Error in bgerror: \x00TclSetBgErrorHandler: NULL cmdPrefix argument\x00OS exit failed!\x00TclInitSubsystems called while exiting\x00exit handlers were created during Tcl_Finalize\x00limit exceeded\x00can't wait for variable \"%s\": would wait forever\x00EVENT\x00NO_SOURCES\x00Tcl_UpdateObjCmd: bad option index to UpdateOptions\x00?idletasks?\x00idletasks\x00||\x00&&\x00exprcode\x00dictIterator\x00freeing an execStack which is still in use\x00Deleting execEnv with pending TEOV callbacks!\x00Deleting execEnv with existing coroutine\x00STACK: Reallocating with no previous alloc\x00STACK: Stack after current is in use\x00STACK: Stack after current is not last\x00TclStackFree: incorrect freePtr (%p != %p). Call out of sequence?\x00TclStackRealloc: incorrect ptr. Call out of sequence?\x00Tcl_EvalObj: compiled script jumped interps\x00TclIncrObj\x00tailcall can only be called from a proc or lambda\x00TclNRExecuteByteCode: unrecognized builtin function code %d\x00\n    (reading value of variable to increment)\x00access\x00array set\x00variable isn't array\x00WRITE\x00ARRAY\x00STACK_LEVEL\x00self may only be called from inside a method\x00OO\x00CONTEXT_REQUIRED\x00nextto may only be called from inside a method\x00CLASS_REQUIRED\x00%s implementation by \"%s\" not reachable from here\x00CLASS_NOT_REACHABLE\x00%s has no non-filter implementation by \"%s\"\x00CLASS_NOT_THERE\x00next may only be called from inside a method\x00no next %s implementation\x00NOTHING_NEXT\x00negative shift argument\x00INST_RETURN_CODE_BRANCH: TOS not a return code!\x00INST_RETURN_CODE_BRANCH: TOS is TCL_OK!\x00Should not happen!\x00mis-issued dictFirst!\x00mis-issued dictNext!\x00dictUpdateStart argument length mismatch\x00clockRead instruction with unknown clock#\x00TclNRExecuteByteCode: unrecognized opCode %u\x00divide by zero\x00DIVZERO\x00exponentiation of zero by negative power\x00\nTclNRExecuteByteCode: abnormal return at pc %u: stack top %d < entry stack top %d\n\x00TclNRExecuteByteCode execution failure: end stack top < start stack top\x00exponent too large\x00unexpected number type\x00empty string\x00invalid octal number\x00non-numeric string\x00non-numeric floating-point value\x00floating-point value\x00(big) integer\x00can't use %s as operand of \"%s\"\x00LocSearch failure\x00floating-point value too small to represent\x00UNDERFLOW\x00floating-point value too large to represent\x00OVERFLOW\x00unknown floating-point error, errno = %d\x00?-option value ...? source ?source ...? target\x00error %s: target \"%s\" is not a directory\x00copying\x00renaming\x00can't create directory \"%s\": %s\x00error deleting \"%s\": directory not empty\x00error deleting unknown file: %s\x00error deleting \"%s\": %s\x00can't overwrite file \"%s\" with directory \"%s\"\x00can't overwrite directory \"%s\" with file \"%s\"\x00u+w\x00-permissions\x00error renaming \"%s\" to \"%s\": trying to rename a volume or move a directory into itself\x00::tcl::CopyDirectory\x00can't unlink \"%s\": %s\x00error %s \"%s\"\x00 to \"%s\"\x00: \"%s\"\x00: %s\x00-force\x00name ?-option value ...?\x00must not update objPtrRef's variable and return non-NULL\x00bad option \"%s\", there are no file attributes in this filesystem\x00FATTR\x00value for \"%s\" missing\x00NOVALUE\x00?-linktype? linkname ?target?\x00could not create new link \"%s\": that path already exists\x00could not create new link \"%s\": no such file or directory\x00could not create new link \"%s\": target \"%s\" doesn't exist\x00could not create new link \"%s\" pointing to \"%s\": %s\x00could not read link \"%s\": %s\x00-symbolic\x00-hard\x00?nameVar? ?template?\x00can't create temporary file: %s\x00//?/UNC/\x00//?/\x00//\x00./\x00/\\:\x00couldn't find HOME environment variable to expand path\x00FILENAME\x00NO_HOME\x00user \"%s\" doesn't exist\x00USER\x00missing argument to \"-directory\"\x00\"-directory\" may only be used once\x00\"-directory\" cannot be used with \"-path\"\x00GLOB\x00BADOPTIONCOMBINATION\x00missing argument to \"-path\"\x00\"-path\" may only be used once\x00\"-path\" cannot be used with \"-dictionary\"\x00missing argument to \"-types\"\x00\"-tails\" must be used with either \"-directory\" or \"-path\"\x00\\/\x00\\[]*?{}\x00readonly\x00hidden\x00macintosh\x00creator\x00bad argument to \"-types\": %s\x00BAD\x00only one MacOS type or creator argument to \"-types\" allowed\x00no files matched glob pattern%s \"\x00%s%s\x00NOMATCH\x00-directory\x00-join\x00-path\x00-tails\x00-types\x00/\\\x00Called TclGlob with TCL_GLOBMODE_TAILS and pathPrefix==NULL\x00.\x00unmatched open-brace in file name\x00BALANCE\x00unmatched close-brace in file name\x00*[]?\\\x00invalid sharing of Tcl_Obj on C stack\x00malformed bucket chain in Tcl_DeleteHashEntry\x00%d entries in table, %d buckets\n\x00number of buckets with %d entries: %d\n\x00number of buckets with %d or more entries: %d\n\x00average search distance for entry: %.1f\x00called %s on deleted table\x00Tcl_FindHashEntry\x00Tcl_CreateHashEntry\x00::tcl::HistoryObjs\x00::history\x00channel\x00TCL_FLUSH_NONBLOCKING_ON_EXIT\x00-blocking\x00tclIO\x00Tcl_RegisterChannel: channel without name\x00Tcl_RegisterChannel: duplicate channel names\x00illegal recursive call to close through close-handler of channel\x00stdin\x00stdout\x00stderr\x00can not find channel named \"%s\"\x00CHANNEL\x00channel type %s must define closeProc\x00channel type %s must define inputProc when used for reader channel\x00channel type %s must define outputProc when used for writer channel\x00channel type %s must define watchProc\x00channel type %s must define seekProc if defining wideSeekProc\x00couldn't find state for channel \"%s\"\x00reading and writing both disallowed for channel \"%s\"\x00could not flush channel \"%s\"\x00Channel released more than preserved\x00channel \"%s\" does not support OS handles\x00Reuse of ChannelBuffer! %p\x00unable to access channel: invalid channel\x00TclFlush, closed channel: queued output left\x00FlushChannel: damaged channel list\x00SpliceChannel: trying to add channel used in different list\x00called Tcl_Close on channel with refCount > 0\x00double-close of channels not supported by %ss\x00half-close of channels not supported by %ss\x00half-close not applicable to stack of transformations\x00write\x00Half-close of %s-side not possible, side not opened or already closed\x00ClosechanHalf, closed write-side of channel: queued output left\x00unknown output translation requested\x00\r\n\x00Tcl_GetsObj: gotEOL reached with bufPtr==NULL\x00TclGetsObjBinary: gotEOL reached with bufPtr==NULL\x00binary encoding is not available\x00Buffer Underflow, BUFFER_PADDING not enough\x00unknown input translation %d\x00blocking buffering buffersize encoding eofchar translation\x00malformed option list in channel driver\x00bad option \"%s\": should be one of \x00-%s, \x00or -%s\x00-buffering\x00none\x00full\x00-buffersize\x00-eofchar\x00-translation\x00auto\x00cr\x00crlf\x00lf\x00unable to set channel options: background copy in progress\x00bad value for -buffering: must be one of full, line, or none\x00bad value for -eofchar: must be non-NUL ASCII character\x00bad value for -eofchar: should be a list of zero, one, or two elements\x00bad value for -translation: must be a one or two element list\x00platform\x00bad value for -translation: must be one of auto, binary, cr, lf, crlf, or platform\x00tcp\x00channelId event ?script?\x00event name\x00channel is not %s\x00channel \"%s\" is busy\x00error %sing \"%s\": %s\x00writ\x00error reading \"\x00\": \x00error writing \"\x00error setting blocking mode: %s\x00Tcl_SetChannelError: bad syntax of message\x00Defined newlevel not used in rewrite\x00Defined newcode not used in rewrite\x00-nonewline\x00nonewline\x00?-nonewline? ?channelId? string\x00channel \"%s\" wasn't opened for writing\x00error writing \"%s\": %s\x00channelId\x00error flushing \"%s\": %s\x00channelId ?varName?\x00channel \"%s\" wasn't opened for reading\x00error reading \"%s\": %s\x00channelId ?numChars?\x00?-nonewline? channelId\x00expected non-negative integer but got \"%s\"\x00NUMBER\x00channelId offset ?origin?\x00origin\x00error during seek on \"%s\": %s\x00start\x00current\x00channelId ?direction?\x00direction\x00channelId ?-option value ...?\x00?-option ...? arg ?arg ...?\x00error reading output from command: %s\x00-ignorestderr\x00-keepnewline\x00fileName ?access? ?permissions?\x000o\x00Tcl_OpenCmd: invalid mode value\x00tclTCPAcceptCallbacks\x00RegisterTcpServerCleanup: damaged accept record table\x00cannot set -async option for server sockets\x00no argument given for -myaddr option\x00no argument given for -myport option\x00no argument given for -server option\x00Tcl_SocketObjCmd: bad option index to SocketOptions\x00option -myport is not valid for servers\x00?-myaddr addr? ?-myport myport? ?-async? host port\x00-server command ?-myaddr addr? port\x00-async\x00-myaddr\x00-myport\x00-server\x00input output ?-size size? ?-command callback?\x00-size\x00mode channelId\x00input\x00output\x00channelId ?length?\x00cannot truncate to negative length of file\x00could not determine current location in \"%s\": %s\x00error during truncate on \"%s\": %s\x00chan\x00blocked\x00event\x00pending\x00pipe\x00postevent\x00truncate\x00::fconfigure\x00transform\x00-command value is not a list\x00\nfailed to stack channel \"%s\"\x00create/write\x00create/read\x00delete/write\x00flush/write\x00flush/read\x00delete/read\x00query/maxRead\x00clear/read\x00tclrchannel\x00blocking\x00cget\x00cgetall\x00finalize\x00initialize\x00watch\x00{read delivered more than requested}\x00{write wrote more than requested}\x00{write wrote nothing}\x00{Tried to seek before origin}\x00{Channel thread lost}\x00{Owner lost}\x00-code 1 -level 0 -errorcode NONE -errorinfo {} -errorline 1 {Owner lost}\x00mode cmdprefix\x00chan handler \"%s initialize\" returned non-list: %s\x00chan handler \"\x00 initialize\" returned \x00chan handler \"%s\" does not support all required methods\x00chan handler \"%s\" lacks a \"read\" method\x00chan handler \"%s\" lacks a \"write\" method\x00chan handler \"%s\" supports \"cget\" but not \"cgetall\"\x00chan handler \"%s\" supports \"cgetall\" but not \"cget\"\x00TclChanCreateObjCmd: duplicate channel names\x00channel eventspec\x00can not find reflected channel named \"%s\"\x00TclChanPostEventObjCmd: channel is not a reflected channel\x00TclChanPostEventObjCmd: postevent accepted for call from outside interpreter\x00tried to post events channel \"%s\" is not interested in\x00TclChanCaughtErrorBypass: Bad syntax of caught result\x00Unknown thread action code.\x00Expected list with even number of elements, got %d element%s instead\x00bad %s list: is empty\x00read write\x00rc%lu\x00chan handler returned bad code: %d\x00\n    (chan handler subcommand \"%s\")\x00EAGAIN\x00ReflectedChannelMap\x00{Expected list with even number of elements, got %d %s instead}\x00element\x00elements\x00Bad operation code in ForwardProc\x00tclrtransform\x00clear\x00drain\x00limit?\x00{read not supported by Tcl driver}\x00{write not supported by Tcl driver}\x00channel cmdprefix\x00chan handler \"%s initialize\" returned %s\x00chan handler \"%s\" makes the channel inaccessible\x00chan handler \"%s\" supports \"drain\" but not \"read\"\x00chan handler \"%s\" supports \"flush\" but not \"write\"\x00TclChanPushObjCmd: duplicate transformation handle\x00rt%lu\x00ReflectedTransformMap\x00couldn't open socket: port number too high\x00::tcl::unsupported::socketAF\x00inet\x00inet6\x00native\x00glob couldn't determine the current working directory\x00illegal access mode \"%s\"\x00\n    while processing open access modes \"\x00RDONLY\x00WRONLY\x00RDWR\x00APPEND\x00CREAT\x00EXCL\x00NOCTTY\x00NONBLOCK\x00TRUNC\x00invalid access mode \"%s\": must be RDONLY, WRONLY, RDWR, APPEND, BINARY, CREAT, EXCL, NOCTTY, NONBLOCK, or TRUNC\x00access mode must include either RDONLY, WRONLY, or RDWR\x00couldn't read file \"%s\": %s\x00\x1a {}\x00\ufeff\x00\n    (file \"%.*s%s\" line %d)\x00POSIX\x00could not seek to end of file while opening \"%s\": %s\x00couldn't open \"%s\": %s\x00error getting working directory name: %s\x00TCL_TEMPLOAD_NO_UNLINK\x00couldn't load library \"%s\": %s\x00couldn't load from current filesystem\x000700\x00cannot unload: filesystem does not support unloading\x00wb\x00rb\x00Tcl_FSGetFileSystemForPath called with NULL object\x00Tcl_FSGetFileSystemForPath called with object with refCount == 0\x00ambiguous \x00bad \x00 \"\x00\": no valid options\x00\": must be \x00 or \x00::tcl::prefix\x00prefix\x00all\x00longest\x00?options? table string\x00missing value for -message\x00NOARG\x00missing value for -error\x00error options must have an even number of elements\x00-error\x00-message\x00table string\x00 or \"\x00wrong # args: should be \"\x00ambiguous option \"%s\"\x00unrecognized argument \"%s\"\x00expected integer argument for \"%s\" but got \"%s\"\x00expected floating-point argument for \"%s\" but got \"%s\"\x00bad argument type %d in Tcl_ArgvInfo\x00\"%s\" option requires an additional argument\x00Command-specific options:\x00\n%s\x00\n %s:\x00\n\t\tDefault value: %d\x00\n\t\tDefault value: %g\x00\n\t\tDefault value: \"%s\"\x00                    \x00bad completion code \"%s\": must be ok, error, return, break, continue, or an integer\x00RESULT\x00ILLEGAL_CODE\x00ok\x00if {[namespace which -command tclInit] eq \"\"} {\n  proc tclInit {} {\n    global tcl_libPath tcl_library env tclDefaultLibrary\n    rename tclInit {}\n    if {[info exists tcl_library]} {\n\tset scripts {{set tcl_library}}\n    } else {\n\tset scripts {}\n\tif {[info exists env(TCL_LIBRARY)] && ($env(TCL_LIBRARY) ne {})} {\n\t    lappend scripts {set env(TCL_LIBRARY)}\n\t    lappend scripts {\nif {[regexp ^tcl(.*)$ [file tail $env(TCL_LIBRARY)] -> tail] == 0} continue\nif {$tail eq [info tclversion]} continue\nfile join [file dirname $env(TCL_LIBRARY)] tcl[info tclversion]}\n\t}\n\tif {[info exists tclDefaultLibrary]} {\n\t    lappend scripts {set tclDefaultLibrary}\n\t} else {\n\t    lappend scripts {::tcl::pkgconfig get scriptdir,runtime}\n\t}\n\tlappend scripts {\nset parentDir [file dirname [file dirname [info nameofexecutable]]]\nset grandParentDir [file dirname $parentDir]\nfile join $parentDir lib tcl[info tclversion]} \\\n\t{file join $grandParentDir lib tcl[info tclversion]} \\\n\t{file join $parentDir library} \\\n\t{file join $grandParentDir library} \\\n\t{file join $grandParentDir tcl[info patchlevel] library} \\\n\t{\nfile join [file dirname $grandParentDir] tcl[info patchlevel] library}\n\tif {[info exists tcl_libPath]\n\t\t&& [catch {llength $tcl_libPath} len] == 0} {\n\t    for {set i 0} {$i < $len} {incr i} {\n\t\tlappend scripts [list lindex \\$tcl_libPath $i]\n\t    }\n\t}\n    }\n    set dirs {}\n    set errors {}\n    foreach script $scripts {\n\tlappend dirs [eval $script]\n\tset tcl_library [lindex $dirs end]\n\tset tclfile [file join $tcl_library init.tcl]\n\tif {[file exists $tclfile]} {\n\t    if {[catch {uplevel #0 [list source $tclfile]} msg opts]} {\n\t\tappend errors \"$tclfile: $msg\n\"\n\t\tappend errors \"[dict get $opts -errorinfo]\n\"\n\t\tcontinue\n\t    }\n\t    unset -nocomplain tclDefaultLibrary\n\t    return\n\t}\n    }\n    unset -nocomplain tclDefaultLibrary\n    set msg \"Can't find a usable init.tcl in the following directories: \n\"\n    append msg \"    $dirs\n\n\"\n    append msg \"$errors\n\n\"\n    append msg \"This probably means that Tcl wasn't installed properly.\n\"\n    error $msg\n  }\n}\ntclInit\x00interp\x00InterpInfoDeleteProc: still exist commands\x00InterpInfoDeleteProc: still exist aliases\x00cmd ?arg ...?\x00slavePath slaveCmd ?masterPath masterCmd? ?arg ...?\x00path ?cmdPrefix?\x00?-unwind? ?--? ?path? ?result?\x00?-safe? ?--? ?path?\x00interp%d\x00path ?-frame ?bool??\x00cannot delete the current interpreter\x00INTERP\x00DELETESELF\x00path arg ?arg ...?\x00path hiddenCmdName ?cmdName?\x00path cmdName ?hiddenCmdName?\x00path ?-namespace ns? ?-global? ?--? cmd ?arg ..?\x00path limitType ?-option value ...?\x00limit type\x00path\x00path ?newlimit?\x00srcPath channelId destPath\x00path alias\x00alias \"%s\" in path \"%s\" not found\x00ALIAS\x00target interpreter for alias \"%s\" in path \"%s\" is not my descendant\x00TARGETSHROUDED\x00alias\x00aliases\x00cancel\x00children\x00debug\x00expose\x00hide\x00issafe\x00invokehidden\x00limit\x00marktrusted\x00recursionlimit\x00slaves\x00share\x00target\x00transfer\x00-unwind\x00-safe\x00-global\x00?path?\x00alias \"%s\" not found\x00cannot define or rename alias \"%s\": interpreter deleted\x00cannot define or rename alias \"%s\": would create a loop\x00ALIASLOOP\x00could not find interpreter \"%s\"\x00cmdPrefix must be list of length >= 1\x00BGERRORFORMAT\x00interpreter named \"%s\" already exists, cannot create\x00tcl_interactive\x00ChildObjCmd: interpreter has been deleted\x00aliasName ?targetName? ?arg ...?\x00?cmdPrefix?\x00?-frame ?bool??\x00hiddenCmdName ?cmdName?\x00cmdName ?hiddenCmdName?\x00?-namespace ns? ?-global? ?--? cmd ?arg ..?\x00limitType ?-option value ...?\x00?newlimit?\x00-frame\x00debug option\x00permission denied: safe interpreter cannot expose commands\x00UNSAFE\x00permission denied: safe interpreters cannot change recursion limit\x00recursion limit must be > 0\x00BADLIMIT\x00falling back due to new recursion limit\x00RECURSION\x00permission denied: safe interpreter cannot hide commands\x00not allowed to invoke hidden commands from safe interpreter\x00permission denied: safe interpreter cannot mark trusted\x00namespace eval ::tcl {namespace eval mathfunc {}}\x00::tcl::mathfunc::min\x00::tcl::mathfunc::max\x00os\x00osVersion\x00machine\x00user\x00tclDefaultLibrary\x00tcl_pkgPath\x00command count limit exceeded\x00COMMANDS\x00time limit exceeded\x00TIME\x00unknown type of resource limit\x00\n    (while waiting for event)\x00limit granularity must be positive\x00installing limit callback to the limited interpreter\x00limits on current interpreter inaccessible\x00SELF\x00?-option value ...?\x00granularity must be at least 1\x00BADVALUE\x00command limit value must be at least 0\x00-granularity\x00-value\x00milliseconds must be at least 0\x00seconds must be at least 0\x00may only set -milliseconds if -seconds is not also being reset\x00BADUSAGE\x00may only reset -milliseconds if -seconds is also being reset\x00-seconds\x00variable '%s' is already linked\x00internal error: bad linked variable type\x00linked variable is read-only\x00internal error: linked variable couldn't be read\x00variable must have integer value\x00variable must have real value\x00variable must have boolean value\x00variable must have char value\x00variable must have unsigned char value\x00variable must have short value\x00variable must have unsigned short value\x00variable must have unsigned int value\x00variable must have long value\x00variable must have unsigned long value\x00variable must have unsigned wide int value\x00variable must have float value\x00NULL\x00??\x00invalidReal\x00xXbBoO\x00+-\x00NewListInternalRep: expects postive element count\x00list creation failed: unable to alloc %u bytes\x00Tcl_SetListObj\x00Tcl_ListObjAppendList\x00Tcl_ListObjAppendElement\x00Tcl_ListObjReplace\x00list index out of range\x00LSET\x00TclListObjSetElement\x00max size of Tcl literal array (%d literals) exceeded\x00?-global? ?-lazy? ?--? fileName ?packageName? ?interp?\x00must specify either file name or package name\x00LOAD\x00NOLIBRARY\x00file \"%s\" is already loaded for package \"%s\"\x00SPLITPERSONALITY\x00tclLoad\x00package \"%s\" isn't loaded statically\x00NOTSTATIC\x00couldn't figure out package name for %s\x00WHATPACKAGE\x00_Init\x00_SafeInit\x00_Unload\x00_SafeUnload\x00can't use package in a safe interpreter: no %s_SafeInit procedure\x00can't attach package to interpreter: no %s_Init procedure\x00ENTRYPOINT\x00-lazy\x00?-switch ...? fileName ?packageName? ?interp?\x00UNLOAD\x00package \"%s\" is loaded statically and cannot be unloaded\x00STATIC\x00file \"%s\" has never been loaded\x00NEVERLOADED\x00file \"%s\" has never been loaded in this interpreter\x00file \"%s\" cannot be unloaded under a safe interpreter\x00CANNOT\x00file \"%s\" cannot be unloaded under a trusted interpreter\x00-keeplibrary\x00dynamic loading is not currently available on this system\x00tcl_rcFileName\x00argv0\x00argc\x00argv\x00application-specific initialization failed: \x00exit %d\x00TCL_FINALIZE_ON_EXIT\x00tcl_prompt2\x00tcl_prompt1\x00% \x00\n    (script that generates prompt)\x00nsName\x00code\x00ensemble\x00export\x00forget\x00import\x00parent\x00qualifiers\x00which\x00Trying to push call frame for dead namespace\x00errorCode\x00can't create namespace \"\": only global namespace can have empty name\x00CREATEGLOBAL\x00can't create namespace \"%s\": already exists\x00CREATEEXISTING\x00invalid export pattern \"%s\": pattern can't specify a namespace\x00EXPORT\x00auto_import\x00empty import pattern\x00IMPORT\x00unknown namespace in import pattern \"%s\"\x00no namespace specified in import pattern \"%s\"\x00ORIGIN\x00import pattern \"%s\" tries to import from namespace \"%s\" into itself\x00import pattern \"%s\" would create a loop containing command \"%s\"\x00LOOP\x00can't import command \"%s\": already exists\x00OVERWRITE\x00unknown namespace in namespace forget pattern \"%s\"\x00DeleteImportedCmd: did not find cmd in real cmd's list of import references\x00Could not create namespace '%s'\x00unknown namespace \"%s\"\x00unknown command \"%s\"\x00namespace \"%s\" not found\x00namespace \"%s\" not found in \"%s\"\x00?name? ?pattern?\x00?name name...?\x00unknown namespace \"%s\" in namespace delete command\x00name arg ?arg...?\x00\n    (in namespace %s \"%.*s%s\" script line %d)\x00?-clear? ?pattern pattern...?\x00-clear\x00?pattern pattern...?\x00?-force? ?pattern pattern...?\x00?pathList?\x00?script?\x00ns ?otherVar myVar ...?\x00?-command? ?-variable? name\x00-variable\x00\n    %s\n\"%.*s%s\"\x00while executing\x00invoked from within\x00deletemethod\x00forward\x00renamemethod\x00self\x00unexport\x00destroy\x00core method: \"destroy\"\x00core method: \"eval\"\x00core method: \"unknown\"\x00core method: \"variable\"\x00core method: \"varname\"\x00core method: \"create\"\x00new\x00core method: \"new\"\x00createWithNamespace\x00core method: \"createWithNamespace\"\x00oo::class constructor\x00package ifneeded TclOO 1.1.0 {# Already present, OK?};namespace eval ::oo { variable version 1.1.0 };namespace eval ::oo { variable patchlevel 1.1.0 };\x00::oo::define ::oo::Slot {\n    method Get {} {error unimplemented}\n    method Set list {error unimplemented}\n    method -set args {\n        uplevel 1 [list [namespace which my] Set $args]\n    }\n    method -append args {\n        uplevel 1 [list [namespace which my] Set [list                {*}[uplevel 1 [list [namespace which my] Get]] {*}$args]]\n    }\n    method -clear {} {uplevel 1 [list [namespace which my] Set {}]}\n    forward --default-operation my -append\n    method unknown {args} {\n        set def --default-operation\n        if {[llength $args] == 0} {\n            return [uplevel 1 [list [namespace which my] $def]]\n        } elseif {![string match -* [lindex $args 0]]} {\n            return [uplevel 1 [list [namespace which my] $def {*}$args]]\n        }\n        next {*}$args\n    }\n    export -set -append -clear\n    unexport unknown destroy\n}\n::oo::objdefine ::oo::define::superclass forward --default-operation my -set\n::oo::objdefine ::oo::define::mixin forward --default-operation my -set\n::oo::objdefine ::oo::objdefine::mixin forward --default-operation my -set\n\x00foreach p [info procs [info object namespace $originObject]::*] {    set args [info args $p];    set idx -1;    foreach a $args {        lset args [incr idx]             [if {[info default $p $a d]} {list $a $d} {list $a}]    };    set b [info body $p];    set p [namespace tail $p];    proc $p $args $b;};foreach v [info vars [info object namespace $originObject]::*] {    upvar 0 $v vOrigin;    namespace upvar [namespace current] [namespace tail $v] vNew;    if {[info exists vOrigin]} {        if {[array exists vOrigin]} {            array set vNew [array get vOrigin];        } else {            set vNew $vOrigin;        }    }}\x00TclOO\x001.1.0\x00::oo\x00[a-z]*\x00::oo::define\x00::oo::objdefine\x00::oo::Helpers\x00<constructor>\x00<destructor>\x00<cloned>\x00::oo::UnknownDefinition\x00::oo::define::\x00::oo::objdefine::\x00originObject\x00::oo::Helpers::next\x00::oo::Helpers::nextto\x00::oo::Helpers::self\x00::oo::copy\x00::oo::Obj%d\x00my\x00deleting class structure for non-deleted %s\x00::oo::class\x00::oo::object\x00can't create object \"%s\": command already exists with that name\x00OVERWRITE_OBJECT\x00object deleted in constructor\x00STILLBORN\x00may not clone the class of classes\x00CLONING_CLASS\x00\n    (while performing post-copy callback)\x00\n    (while mapping method name)\x00impossible to invoke method \"%s\": no defined method or unknown method\x00METHOD_MAPPED\x00no valid method implementation\x00%s does not refer to an object\x00OBJECT\x00?definitionScript?\x00object \"%s\" is not a class\x00INSTANTIATE_NONCLASS\x00objectName ?arg ...?\x00object name must not be empty\x00EMPTY_NAME\x00objectName namespaceName ?arg ...?\x00namespace name must not be empty\x00\n    (in \"%s eval\" script line %d)\x00method ?arg ...?\x00visible methods\x00methods\x00object \"%s\" has no %s\x00unknown method \"%s\": must be \x00?varName ...?\x00variable name \"%s\" illegal: must not contain namespace separator\x00UPVAR\x00INVERTED\x00define\x00name refers to an element in an array\x00LOCAL_ELEMENT\x00refer to\x00(\x00%s may only be called from inside a method\x00class ?arg...?\x00method not defined by a class\x00UNMATCHED_CONTEXT\x00not inside a filtering context\x00caller is not an object\x00method without declarer!\x00filtering call chain without terminal non-filter\x00call\x00caller\x00sourceName ?targetName? ?targetNamespace?\x00%s refers to an existing namespace\x00TclOO method name\x00::oo::define::filter\x00core method: define::filter Getter\x00core method: define::filter Setter\x00::oo::define::mixin\x00core method: define::mixin Getter\x00core method: define::mixin Setter\x00::oo::define::superclass\x00core method: define::superclass Getter\x00core method: define::superclass Setter\x00::oo::define::variable\x00core method: define::variable Getter\x00core method: define::variable Setter\x00::oo::objdefine::filter\x00core method: objdefine::filter Getter\x00core method: objdefine::filter Setter\x00::oo::objdefine::mixin\x00core method: objdefine::mixin Getter\x00core method: objdefine::mixin Setter\x00::oo::objdefine::variable\x00core method: objdefine::variable Getter\x00core method: objdefine::variable Setter\x00method %s does not exist\x00cannot rename method to itself\x00RENAME_TO_SELF\x00method called %s already exists\x00RENAME_OVER\x00bad call of unknown handler\x00BAD_UNKNOWN\x00cannot process definitions; support namespace deleted\x00MONKEY_BUSINESS\x00this command may only be called from within the context of an ::oo::define or ::oo::objdefine command\x00this command cannot be called when the object has been deleted\x00getting outer context when already in global context\x00\n    (in definition script for %s \"%.*s%s\" line %d)\x00className arg ?arg ...?\x00%s does not refer to a class\x00objectName arg ?arg ...?\x00class object\x00may not modify the class of the root object class\x00may not modify the class of the class of classes\x00the class of an object must be a class\x00may not change classes into an instance of themselves\x00arguments body\x00attempt to misuse API\x00name cmdName ?arg ...?\x00name args body\x00Get\x00Set\x00::oo::Slot\x00filterList\x00mixinList\x00may only mix in classes\x00may not mix a class into itself\x00SELF_MIXIN\x00superclassList\x00may not modify the superclass of the root object\x00only a class can be a superclass\x00class should only be a direct superclass once\x00REPETITIOUS\x00attempt to form circular dependency graph\x00CIRCULARITY\x00invalid declared variable name \"%s\": must not %s\x00contain namespace separators\x00BAD_DECLVAR\x00*(*)\x00refer to an array element\x00variableList\x00definition\x00filters\x00isa\x00methodtype\x00mixins\x00instances\x00subclasses\x00superclasses\x00::oo::InfoObject\x00::oo::InfoClass\x00objName ?className?\x00objName methodName\x00definition not available for this kind of method\x00objName\x00prefix argument list not available for this kind of method\x00category objName ?arg ...?\x00category\x00objName className\x00metaclass\x00mixin\x00typeof\x00objName ?-option value ...?\x00-localprivate\x00-private\x00objName ?pattern?\x00METHOD_TYPE\x00className ?pattern?\x00className ?-option value ...?\x00cannot construct any call chain\x00method not declared in class or object\x00\n    (%s \"%.*s%s\" method \"%.*s%s\" line %d)\x00\n    (%s \"%.*s%s\" constructor line %d)\x00\n    (%s \"%.*s%s\" destructor line %d)\x00method forward prefix must be non-empty\x00BAD_FORWARD\x00missing stub table pointer\x00Error loading \x00 (requested version \x00, actual version \x00): \x00booleanString\x00bignum\x00cmdName\x00Derived ICL data for object using offsets from before the script\x00can't convert value to type %s\x00API_ABUSE\x00TclSetDuplicateObj\x00UpdateStringProc should not be invoked for type %s\x00UpdateStringProc for type '%s' failed to create a valid string rep\x00Tcl_SetBooleanObj\x00boolean value\x00expected boolean value but got \"\x00BOOLEAN\x00yes\x00no\x00off\x00Tcl_SetDoubleObj\x00floating point value is Not a Number\x00DOUBLE\x00NAN\x00floating-point number\x00Tcl_SetIntObj\x00integer value too large to represent as non-long integer\x00IOVERFLOW\x00Tcl_SetLongObj\x00expected integer but got \"%s\"\x00INTEGER\x00Tcl_SetWideIntObj\x00initialization failure in DupBignum\x00radix size failure in UpdateStringOfBignum\x00UpdateStringOfBignum: string length limit exceeded\x00conversion failure in UpdateStringOfBignum\x00insufficient memory to unpack bignum\x00Tcl_SetBignumObj\x00number\x00value is a %s with a refcount of %d, object pointer at %s\x00pure string\x00%p:%p\x00, internal representation %s\x00, string representation \"\x00, no string representation\x00can't parse a NULL pointer\x00extra characters after close-quote\x00extra characters after close-brace\x00ParseTokens encountered unknown character\x00missing close-brace for variable name\x00missing )\x00$\x00missing close-brace\x00: possible unbalanced brace in comment\x00missing \"\x00TclSubstParse: programming error\x00bad parse in TclSubstParse: %c\x00unexpected token type in TclSubstTokens: %d\x00Bad portion to TclPathPart\x00can't find object string representation\x00PATH\x00WTF\x00HOMELESS\x00NOUSER\x00Called UpdateStringOfFsPath with invalid object\x00channel \"%s\" wasn't opened for %s\x00writing\x00reading\x00EXEC\x00BADCHAN\x00couldn't %s file \"%s\": %s\x00can't specify \"%s\" as last word in command\x00child process lost (is SIGCHLD ignored or trapped?)\x00error waiting for process to exit: %s\x00%lu\x00%u\x00CHILDSTATUS\x00CHILDKILLED\x00child killed: %s\n\x00CHILDSUSP\x00child suspended: %s\n\x00child wait status didn't make sense\n\x00ODDWAITRESULT\x00error reading stderr output file: %s\x00child process exited abnormally\x00illegal use of | or |& in command\x00PIPESYNTAX\x00must specify \"%s\" as last word in command\x00couldn't create input file for command: %s\x00couldn't create input pipe for command: %s\x00couldn't create output pipe for command: %s\x00couldn't create error file for command: %s\x00couldn't create pipe: %s\x00can't read output from command: standard output was redirected\x00BADREDIRECT\x00can't write input to command: standard input was redirected\x00pipe for command could not be created\x00NOPIPE\x00conflicting versions provided for package \"%s\": %s, then %s\x00PACKAGE\x00VERSIONCONFLICT\x00Cannot load package \"%s\" in standalone executable: This package is not compiled with stub support\x00UNSTUBBED\x00bad return code: %d\x00BADRESULT\x00\n    (\"package unknown\" script)\x00can't find package %s\x00UNFOUND\x00version conflict for package \"%s\": have %s, need\x00circular package dependency: attempt to provide %s %s requires %s\x00attempt to provide package %s %s failed: no version of package %s provided\x00UNPROVIDED\x00attempt to provide package %s %s failed: package %s %s provided instead\x00WRONGPROVIDE\x00attempt to provide package %s %s failed: bad return code: %s\x00\n    (\"package ifneeded %s %s\" script)\x00package %s %s is not present\x00package %s is not present\x00option ?arg ...?\x00package version ?script?\x00package ?version?\x00?-exact? package ?requirement ...?\x00?command?\x00?latest|stable?\x00preference\x00version1 version2\x00version ?requirement ...?\x00Tcl_PackageObjCmd: bad option index to pkgOptions\x00ifneeded\x00prefer\x00present\x00provide\x00require\x00vcompare\x00versions\x00vsatisfies\x00latest\x00stable\x00expected version number but got \"%s\"\x00VERSION\x00expected versionMin-versionMax but got \"%s\"\x00VERSIONRANGE\x00 exactly %s\x00 %s\x00 0-\x00 -2\x00profiled\x0064bit\x00optimized\x00mem_debug\x00compile_debug\x00compile_stats\x00libdir,runtime\x00/usr/local/lib\x00bindir,runtime\x00/usr/local/bin\x00scriptdir,runtime\x00/usr/local/lib/tcl8.6\x00includedir,runtime\x00/usr/local/include\x00docdir,runtime\x00/usr/local/man\x00libdir,install\x00bindir,install\x00scriptdir,install\x00includedir,install\x00docdir,install\x00tcl\x00E2BIG\x00EACCES\x00EADDRINUSE\x00EADDRNOTAVAIL\x00EADV\x00EAFNOSUPPORT\x00EALREADY\x00EBADE\x00EBADF\x00EBADFD\x00EBADMSG\x00ECANCELED\x00EBADR\x00EBADRQC\x00EBADSLT\x00EBFONT\x00EBUSY\x00ECHILD\x00ECHRNG\x00ECOMM\x00ECONNABORTED\x00ECONNREFUSED\x00ECONNRESET\x00EDEADLK\x00EDESTADDRREQ\x00EDOM\x00EDOTDOT\x00EDQUOT\x00EEXIST\x00EFAULT\x00EFBIG\x00EHOSTDOWN\x00EHOSTUNREACH\x00EIDRM\x00EILSEQ\x00EINPROGRESS\x00EINTR\x00EINVAL\x00EIO\x00EISCONN\x00EISDIR\x00EL2HLT\x00EL2NSYNC\x00EL3HLT\x00EL3RST\x00ELIBACC\x00ELIBBAD\x00ELIBEXEC\x00ELIBMAX\x00ELIBSCN\x00ELNRNG\x00ELOOP\x00EMFILE\x00EMLINK\x00EMSGSIZE\x00EMULTIHOP\x00ENAMETOOLONG\x00ENAVAIL\x00ENETDOWN\x00ENETRESET\x00ENETUNREACH\x00ENFILE\x00ENOANO\x00ENOBUFS\x00ENOCSI\x00ENODATA\x00ENODEV\x00ENOENT\x00ENOEXEC\x00ENOLCK\x00ENOLINK\x00ENOMEM\x00ENOMSG\x00ENONET\x00ENOPKG\x00ENOPROTOOPT\x00ENOSPC\x00ENOSR\x00ENOSTR\x00ENOSYS\x00ENOTBLK\x00ENOTCONN\x00ENOTRECOVERABLE\x00ENOTDIR\x00ENOTEMPTY\x00ENOTNAM\x00ENOTSOCK\x00ENOTSUP\x00ENOTTY\x00ENOTUNIQ\x00ENXIO\x00EOVERFLOW\x00EOWNERDEAD\x00EPERM\x00EPFNOSUPPORT\x00EPIPE\x00EPROTO\x00EPROTONOSUPPORT\x00EPROTOTYPE\x00ERANGE\x00EREMCHG\x00EREMOTE\x00EREMOTEIO\x00EROFS\x00ESHUTDOWN\x00ESOCKTNOSUPPORT\x00ESPIPE\x00ESRCH\x00ESRMNT\x00ESTALE\x00ETIME\x00ETIMEDOUT\x00ETOOMANYREFS\x00ETXTBSY\x00EUCLEAN\x00EUNATCH\x00EUSERS\x00EXDEV\x00EXFULL\x00unknown error\x00argument list too long\x00permission denied\x00address already in use\x00cannot assign requested address\x00advertise error\x00address family not supported by protocol\x00resource temporarily unavailable\x00operation already in progress\x00bad exchange descriptor\x00bad file number\x00file descriptor in bad state\x00not a data message\x00operation canceled\x00bad request descriptor\x00bad request code\x00invalid slot\x00bad font file format\x00file busy\x00no children\x00channel number out of range\x00communication error on send\x00software caused connection abort\x00connection refused\x00connection reset by peer\x00resource deadlock avoided\x00destination address required\x00math argument out of range\x00cross mount point\x00disk quota exceeded\x00file already exists\x00bad address in system call argument\x00file too large\x00host is down\x00host is unreachable\x00identifier removed\x00illegal byte sequence\x00operation now in progress\x00interrupted system call\x00invalid argument\x00I/O error\x00socket is already connected\x00illegal operation on a directory\x00level 2 halted\x00level 2 not synchronized\x00level 3 halted\x00level 3 reset\x00cannot access a needed shared library\x00accessing a corrupted shared library\x00cannot exec a shared library directly\x00attempting to link in more shared libraries than system limit\x00.lib section in a.out corrupted\x00link number out of range\x00too many levels of symbolic links\x00too many open files\x00too many links\x00message too long\x00multihop attempted\x00file name too long\x00not available\x00network is down\x00network dropped connection on reset\x00network is unreachable\x00file table overflow\x00anode table overflow\x00no buffer space available\x00no CSI structure available\x00no data available\x00no such device\x00no such file or directory\x00exec format error\x00no locks available\x00link has been severed\x00not enough memory\x00no message of desired type\x00machine is not on the network\x00package not installed\x00bad protocol option\x00no space left on device\x00out of stream resources\x00not a stream device\x00function not implemented\x00block device required\x00socket is not connected\x00state not recoverable\x00not a directory\x00directory not empty\x00not a name file\x00socket operation on non-socket\x00operation not supported\x00inappropriate device for ioctl\x00name not unique on network\x00no such device or address\x00file too big\x00owner died\x00not owner\x00protocol family not supported\x00broken pipe\x00protocol error\x00protocol not supported\x00protocol wrong type for socket\x00math result unrepresentable\x00remote address changed\x00pathname hit remote file system\x00remote i/o error\x00read-only file system\x00cannot send after socket shutdown\x00socket type not supported\x00invalid seek\x00no such process\x00srmount error\x00stale remote file handle\x00timer expired\x00connection timed out\x00too many references: cannot splice\x00text file or pseudo-device busy\x00structure needs cleaning\x00protocol driver not attached\x00too many users\x00cross-domain link\x00message tables full\x00SIGABRT\x00SIGALRM\x00SIGBUS\x00SIGCHLD\x00SIGCONT\x00SIGFPE\x00SIGHUP\x00SIGILL\x00SIGINT\x00SIGIO\x00SIGKILL\x00SIGPIPE\x00SIGPROF\x00SIGPWR\x00SIGQUIT\x00SIGSEGV\x00SIGSTOP\x00SIGSYS\x00SIGTERM\x00SIGTRAP\x00SIGTSTP\x00SIGTTIN\x00SIGTTOU\x00SIGURG\x00SIGUSR1\x00SIGUSR2\x00SIGVTALRM\x00SIGWINCH\x00SIGXCPU\x00SIGXFSZ\x00unknown signal\x00alarm clock\x00bus error\x00child status changed\x00continue after stop\x00floating-point exception\x00hangup\x00illegal instruction\x00interrupt\x00input/output possible on file\x00kill signal\x00write on pipe with no readers\x00profiling alarm\x00power-fail restart\x00quit signal\x00segmentation violation\x00stop\x00bad argument to system call\x00software termination signal\x00trace trap\x00stop signal from tty\x00background tty read\x00background tty write\x00urgent I/O condition\x00user-defined signal 1\x00user-defined signal 2\x00virtual time alarm\x00window changed\x00exceeded CPU time limit\x00exceeded file size limit\x00Tcl_Release couldn't find reference for %p\x00Tcl_EventuallyFree called twice for %p\x00procbody\x00levelReference\x00lambdaExpr\x00\n    (creating proc \"\x00procedure \"%s\": arg list contains %d entries, precompiled header expects %d\x00BYTECODELIES\x00too many fields in argument specifier \"\x00FORMALARGUMENTFORMAT\x00argument with no name\x00formal parameter \"%s\" is an array element\x00formal parameter \"\x00\" is not a simple name\x00procedure \"%s\": formal parameter %d is inconsistent with precompiled body\x00procedure \"%s\": formal parameter \"\x00\" has default value inconsistent with precompiled body\x00STACKLEVEL\x00\n    (\"uplevel\" body line %d)\x00?level? command ?arg ...?\x00?\x00?arg ...?\x00body object for proc attached to frame is not a byte code type\x00body of lambda term\x00body of proc\x00invoked \"%s\" outside of a loop\x00UNEXPECTED\x00a precompiled script jumped interps\x00CROSSINTERPBYTECODE\x00\n    (procedure \"%.*s%s\" line %d)\x00TclUpdateReturnInfo: negative return level\x00can't interpret \"%s\" as a lambda expression\x00LAMBDA\x00\n    (parsing lambda expression \"%s\")\x00lambdaExpr ?arg ...?\x00\n    (lambda term \"%.*s%s\" line %d)\x00error while matching regular expression: \x00REG_UBACKREF\x00REG_ULOOKAHEAD\x00REG_UBOUNDS\x00REG_UBRACES\x00REG_UBSALNUM\x00REG_UPBOTCH\x00REG_UBBS\x00REG_UNONPOSIX\x00REG_UUNSPEC\x00REG_UUNPORT\x00REG_ULOCALE\x00REG_UEMPTYMATCH\x00REG_UIMPOSSIBLE\x00REG_USHORTEST\x00%s%s%s\x00couldn't compile regular expression pattern: \x00-errorline\x00-errorstack\x00bad %s value: expected dictionary but got \"%s\"\x00ILLEGAL_OPTIONS\x00bad -level value: expected non-negative integer but got \"%s\"\x00ILLEGAL_LEVEL\x00bad -errorcode value: expected a list but got \"%s\"\x00ILLEGAL_ERRORCODE\x00bad -errorstack value: expected a list but got \"%s\"\x00NONLIST_ERRORSTACK\x00forbidden odd-sized list for -errorstack: \"%s\"\x00ODDSIZEDLIST_ERRORSTACK\x00expected dict but got \"%s\"\x00\x00\x00\x00\x00cannot mix \"%\" and \"%n$\" conversion specifiers\x00FORMAT\x00MIXEDSPECTYPES\x00field width may not be specified in %c conversion\x00BADWIDTH\x00field size modifier may not be specified in %\x00 conversion\x00BADSIZE\x00unsigned bignum scans are invalid\x00BADUNSIGNED\x00unmatched [ in format string\x00BRACKET\x00bad scan conversion character \"\x00BADTYPE\x00variable is assigned by multiple \"%n$\" conversion specifiers\x00POLYASSIGNED\x00variable is not assigned by any conversion specifiers\x00UNASSIGNED\x00\"%n$\" argument index out of range\x00INDEXRANGE\x00different numbers of variable names and field specifiers\x00FIELDVARMISMATCH\x00string format ?varName ...?\x00TclParseNumber: bad acceptState %d parsing '%s'\x00TclParseNumber: state INITIAL can't happen here\x00expected %s but got \"\x00 (looks like invalid octal number)\x00Infinity\x00NaN\x00impossible conversion type in TclDoubleDigits\x00wrong digit!\x00in ShouldBankerRoundUp, trichotomy fails!\x00in ShouldBankerRoundUpToNext, trichotomy fails!\x00This code doesn't work on a decimal machine!\x00unknown floating point word order on this machine\x00(%lx)\x00Tcl_SetStringObj\x00Tcl_SetObjLength: negative length requested: %d (integer overflow?)\x00Tcl_SetObjLength\x00max length for a Tcl unicode value (%d chars) exceeded\x00Tcl_AttemptSetObjLength\x00Tcl_SetUnicodeObj\x00Tcl_AppendLimitedToObj\x00Tcl_AppendUnicodeToObj\x00Tcl_AppendStringsToObj\x00Tcl_AppendFormatToObj\x00format string ended in middle of field specifier\x00INCOMPLETE\x00unsigned bignum format is invalid\x000X\x000x\x000b\x00bad field specifier \"%c\"\x00max size for a Tcl value exceeded\x00Unable to format \"%s\" with supplied arguments: %s\x00interpreter uses an incompatible stubs mechanism\x00alloc: could not allocate new cache\x00alloc: could not allocate %d new objects\x00shared\x00thread%p\x00%lu %ld %ld %ld %ld %ld %ld\x00alloc: invalid block: %p: %x %x\x00unable to allocate TSDTable\x00unable to reallocate TSDTable\x00tclAfter\x00bad argument \"%s\": must be cancel, idle, info, or an integer\x00argument\x00after#%d\x00id|command\x00script ?script ...?\x00?id?\x00event \"%s\" doesn't exist\x00timer\x00Tcl_AfterObjCmd: bad subcommand index to afterSubCmds\x00after#\x00\n    (\"after\" script)\x00tcl::tommath\x00initialization failure in TclBNInitBignumFromLong\x00initialization failure in TclBNInitBignumFromWideUInt\x00epoch number mismatch\x00requires a later revision\x00execution\x00type ?arg ...?\x00type name\x00name ops command\x00bad operations \"%s\": should be one or more of rwua\x00TRACE\x00BADOPS\x00vdelete\x00vinfo\x00name opList command\x00bad operation list \"\": must be one or more of enter, leave, enterstep, or leavestep\x00NOOPS\x00operation\x00enter\x00leave\x00enterstep\x00leavestep\x00bad operation list \"\": must be one or more of delete or rename\x00bad operation list \"\": must be one or more of array, read, unset, or write\x00 rename\x00 delete\x00TraceExecutionProc: bad flag combination\x00 a\x00 r\x00 w\x00 u\x00 array\x00 read\x00 write\x00 unset\x00Cannot trace a variable with no name\x00trace array\x00\n    (%s trace on \"%s%s%s%s\")\x00bad result flag combination\x00tty\x00CTS\x00DSR\x00RING\x00DCD\x00-mode\x00-handshake\x00XONXOFF\x00RTSCTS\x00DTRDSR\x00%s not supported for this platform\x00-handshake DTRDSR\x00UNSUPPORTED\x00bad value for -handshake: must be one of xonxoff, rtscts, dtrdsr or none\x00FCONFIGURE\x00-xchar\x00bad value for -xchar: should be a list of two elements\x00-timeout\x00-ttycontrol\x00bad value for -ttycontrol: should be a list of signal,value pairs\x00DTR\x00RTS\x00BREAK\x00bad signal \"%s\" for -ttycontrol: must be DTR, RTS or BREAK\x00mode handshake timeout ttycontrol xchar\x00%d,%c,%d,%d\x00-queue\x00-ttystatus\x00mode queue ttystatus xchar\x00bad value for -mode\x00%d,%c,%d,%d%n\x00%s: should be baud,parity,data,stop\x00SERIALMODE\x00noems\x00%s parity: should be %s\x00n, o, e, m, or s\x00%s data: should be 5, 6, 7, or 8\x00%s stop: should be 1 or 2\x00TclpOpenFileChannel: invalid mode value\x00couldn't open \"\x00\": filename is invalid on this platform\x00file%d\x00/dev/tty\x00auto crlf\x00serial%d\x00TclGetDefaultStdChannel: Unexpected channel type\x00\"%s\" wasn't opened for writing\x00NOT_WRITABLE\x00\"%s\" wasn't opened for reading\x00NOT_READABLE\x00cannot get a FILE * for \"%s\"\x00FILE_FAILURE\x00\"%s\" cannot be used to get a FILE *\x00NO_DESCRIPTOR\x00TclUnixWaitForFile can't handle file id %d\x00-group\x00-owner\x00..\x00%0#5lo\x00could not set group for file \"%s\": group \"%s\" does not exist\x00SETGRP\x00NO_GROUP\x00could not set group for file \"%s\": %s\x00could not set owner for file \"%s\": user \"%s\" does not exist\x00SETOWN\x00NO_USER\x00could not set owner for file \"%s\": %s\x00unknown permission string format \"%s\"\x00PERMISSION\x00could not set permissions for file \"%s\": %s\x00_XXXXXX\x00TMPDIR\x00/tmp\x00:/bin:/usr/bin\x00couldn't read directory \"%s\": %s\x00/usr/local/lib/tcl8.6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00{/usr/local/lib} \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00ansi-1251\x00cp1251\x00ansi_x3.4-1968\x00big5\x00cp1250\x00cp1252\x00cp1253\x00cp1254\x00cp1255\x00cp1256\x00cp1257\x00cp1258\x00cp437\x00cp737\x00cp775\x00cp850\x00cp852\x00cp855\x00cp857\x00cp860\x00cp861\x00cp862\x00cp863\x00cp864\x00cp865\x00cp866\x00cp869\x00cp874\x00cp932\x00cp936\x00cp949\x00cp950\x00dingbats\x00ebcdic\x00euc-cn\x00euc-jp\x00euc-kr\x00eucjp\x00euckr\x00euctw\x00gb12345\x00gb1988\x00gb2312\x00gb2312-1980\x00gb2312-raw\x00greek8\x00ibm1250\x00ibm1251\x00ibm1252\x00ibm1253\x00ibm1254\x00ibm1255\x00ibm1256\x00ibm1257\x00ibm1258\x00ibm437\x00ibm737\x00ibm775\x00ibm850\x00ibm852\x00ibm855\x00ibm857\x00ibm860\x00ibm861\x00ibm862\x00ibm863\x00ibm864\x00ibm865\x00ibm866\x00ibm869\x00ibm874\x00ibm932\x00ibm936\x00ibm949\x00ibm950\x00iso-2022\x00iso2022\x00iso-2022-jp\x00iso2022-jp\x00iso-2022-kr\x00iso2022-kr\x00iso-8859-1\x00iso-8859-10\x00iso8859-10\x00iso-8859-13\x00iso8859-13\x00iso-8859-14\x00iso8859-14\x00iso-8859-15\x00iso8859-15\x00iso-8859-16\x00iso8859-16\x00iso-8859-2\x00iso8859-2\x00iso-8859-3\x00iso8859-3\x00iso-8859-4\x00iso8859-4\x00iso-8859-5\x00iso8859-5\x00iso-8859-6\x00iso8859-6\x00iso-8859-7\x00iso8859-7\x00iso-8859-8\x00iso8859-8\x00iso-8859-9\x00iso8859-9\x00iso88591\x00iso885915\x00iso88592\x00iso88595\x00iso88596\x00iso88597\x00iso88598\x00iso88599\x00ja\x00ja_jp\x00ja_jp.euc\x00ja_jp.eucjp\x00ja_jp.jis\x00ja_jp.mscode\x00shiftjis\x00ja_jp.sjis\x00ja_jp.ujis\x00japan\x00japanese\x00japanese-sjis\x00japanese-ujis\x00japanese.euc\x00japanese.sjis\x00jis0201\x00jis0208\x00jis0212\x00jp_jp\x00ko\x00ko_kr\x00ko_kr.euc\x00ko_kw.euckw\x00koi8-r\x00koi8-u\x00korean\x00ksc5601\x00maccenteuro\x00macCentEuro\x00maccroatian\x00macCroatian\x00maccyrillic\x00macCyrillic\x00macdingbats\x00macDingbats\x00macgreek\x00macGreek\x00maciceland\x00macIceland\x00macjapan\x00macJapan\x00macroman\x00macRoman\x00macromania\x00macRomania\x00macthai\x00macThai\x00macturkish\x00macTurkish\x00macukraine\x00macUkraine\x00roman8\x00ru\x00ru_ru\x00ru_su\x00sjis\x00symbol\x00tis-620\x00tis620\x00turkish8\x00utf8\x00zh\x00zh_cn.gb2312\x00zh_cn.gbk\x00zh_cz.gb2312\x00zh_tw\x00euc-tw\x00zh_tw.big5\x00/dev/null\x00TCL_LIBRARY\x00lib/tcl%s\x00LC_ALL\x00LC_CTYPE\x00LANG\x00unix\x00pathSeparator\x00%s: unable to start notifier thread\x00Tcl_FinalizeNotifier: %s\x00unable to write 'q' to triggerPipe\x00unable to join notifier thread\x00Tcl_ServiceModeHook\x00Tcl_WaitForEvent\x00Tcl_WaitForEvent: %s\x00unable to write to triggerPipe\x00NotifierThreadProc: %s\x00could not create trigger pipe\x00could not make receive pipe non blocking\x00could not make trigger pipe non blocking\x00could not make receive pipe close-on-exec\x00could not make trigger pipe close-on-exec\x00couldn't create temporary file: %s\x00pipe creation failed: %s\x00?channelId?\x00::tcl::unsupported::noReverseDNS\x00-connecting\x00-peername\x00can't get peername: %s\x00-sockname\x00can't get sockname: %s\x00connecting peername sockname\x00couldn't open socket: %s\x00sock%lx\x00couldn't open socket: \x00%u.%u.%u.%u\x00could not allocate lock\x00unable to allocate thread key!\x00unable to create pthread key!\x00unable to delete key!\x00unable to set global TSD value\x00end-offset\x00LIST\x00%s element in braces followed by \"%.*s\" instead of space\x00JUNK\x00%s element in quotes followed by \"%.*s\" instead of space\x00unmatched open brace in %s\x00BRACE\x00unmatched open quote in %s\x00QUOTE\x00internal error in Tcl_SplitList\x00INTERNAL\x00Tcl_SplitList\x00TclScanElement: string length overflow\x00Tcl_Concat: max size of Tcl value exceeded\x00 \f\v\r\t\n\x00 {\x00{\x00-Inf\x00Inf\x00e%+d\x00e%+03d\x00can't modify precision from a safe interpreter\x00improper value for precision\x000123456789\x00bad index \"%s\": must be integer?[+-]integer? or end?[+-]integer?\x00end-\x00bad index \"%s\": must be end?[+-]integer?\x00PGV Initializer did not initialize\x00***=\x00invalid escape sequence\x00BADESCAPE\x00$ not anchor\x00NONANCHOR\x00unhandled RE special char\x00UNHANDLED\x00excessive recursive glob backtrack potential\x00OVERCOMPLEX\x00RE2GLOB\x00variable is array\x00no such element in array\x00upvar refers to element in deleted array\x00upvar refers to variable in deleted namespace\x00parent namespace doesn't exist\x00missing variable name\x00localVarName\x00parsedVarName\x00array search\x00\"%s\" isn't an array\x00VARNAME\x00ELEMENT\x00varPtr must not be NULL\x00part1Ptr must not be NULL\x00READ\x00varName ?newValue?\x00newValuePtr must not be NULL\x00UNSET\x00varName ?value ...?\x00arrayName\x00s-%d-%s\x00arrayName searchId\x00arrayName ?pattern?\x00arrayName ?mode? ?pattern?\x00exact matching shouldn't get here\x00arrayName list\x00error reading array statistics\x00anymore\x00donesearch\x00nextelement\x00startsearch\x00statistics\x00bad variable name \"%s\": can't create namespace variable that refers to procedure variable\x00ObjMakeUpvar called with an index outside from a proc\x00bad variable name \"%s\": can't create a scalar variable that looks like an array element\x00can't upvar from variable to itself\x00variable \"%s\" has traces: can't use for upvar\x00TRACED\x00variable \"%s\" already exists\x00EXISTS\x00?level? otherVar localVar ?otherVar localVar ...?\x00illegal search identifier \"%s\"\x00ARRAYSEARCH\x00search identifier \"%s\" isn't for variable \"%s\"\x00couldn't find search \"%s\"\x00invalid part1Ptr and invalid index together\x00can't %s \"%s%s%s%s\": %s\x00%s of type %s should not be called\x00updateStringProc\x00setFromAnyProc\x00scalar parsedVarName without a string rep\x00unknown variable \"%s\"\x00zlib\x00STREAM\x00DATA\x00MEM\x00BUF\x00NEED_DICT\x00unexpected zlib result in error handler: Z_OK\x00unexpected zlib result in error handler: Z_STREAM_END\x00ZLIB\x00no latin-1 encoding\x00comment\x00crc\x00filename\x00text\x00incorrect zlib data format, must be TCL_ZLIB_FORMAT_ZLIB, TCL_ZLIB_FORMAT_GZIP or TCL_ZLIB_FORMAT_RAW\x00compression level should be between 0 (no compression) and 9 (best compression) or -1 for default compression level\x00incorrect zlib data format, must be TCL_ZLIB_FORMAT_ZLIB, TCL_ZLIB_FORMAT_GZIP, TCL_ZLIB_FORMAT_RAW or TCL_ZLIB_FORMAT_AUTO\x00bad mode, must be TCL_ZLIB_STREAM_DEFLATE or TCL_ZLIB_STREAM_INFLATE\x001.2.11\x00::incr ::tcl::zlib::cmdcounter\x00::tcl::zlib::streamcmd_\x00BUG: Stream command name already exists\x00EXISTING_CMD\x00already past compressed stream end\x00ZIP\x00CLOSED\x00unexpected zlib internal state during decompression\x00STATE\x00incorrect zlib data format, must be TCL_ZLIB_FORMAT_ZLIB, TCL_ZLIB_FORMAT_GZIP or TCL_ZLIB_FORMAT_ZLIB\x00compression level should be between 0 (uncompressed) and 9 (best compression) or -1 for default compression level\x00command arg ?...?\x00data ?startValue?\x00data ?level?\x00\n    (in -level option)\x00data ?-level level? ?-header header?\x00data ?bufferSize?\x00data ?-headerVar varName?\x00level must be 0 to 9\x00COMPRESSIONLEVEL\x00buffer size must be %d to %d\x00BUFFERSIZE\x00adler32\x00compress\x00crc32\x00decompress\x00deflate\x00gunzip\x00gzip\x00inflate\x00stream\x00-header\x00-headerVar\x00mode ?-option value...?\x00should be unreachable\x00mode channel ?options...?\x00compression may only be applied to writable channels\x00UNWRITABLE\x00decompression may only be applied to readable channels\x00UNREADABLE\x00value missing for %s option\x00NOVAL\x00read ahead limit must be 1 to %d\x00a compression dictionary may not be set in the gzip format\x00BADOPT\x00\n    (in \x00 option)\x00-limit\x00option data ?...?\x00?count?\x00checksum\x00fullflush\x00header\x00put\x00reset\x00\"-buffer\" option must be followed by integer decompression buffersize\x00buffer size must be 1 to %d\x00\"-dictionary\" option must be followed by compression dictionary bytes\x00\"-flush\", \"-fullflush\" and \"-finalize\" options are mutually exclusive\x00EXCLUSIVE\x00-buffer\x00-finalize\x00-flush\x00-fullflush\x00only gunzip streams can produce header information\x00BADOP\x00error while finalizing file: %s\x00problem flushing channel: %s\x00sync\x00unknown -flush type \"%s\": must be full or sync\x00FLUSH\x00-limit must be between 1 and 65536\x00READLIMIT\x00dictionary flush\x00dictionary limit\x00flush limit\x00-checksum\x00checksum dictionary\x00checksum dictionary limit\x00checksum header limit\x00unknown mode: %d\x00bad format: %d\x00namespace eval ::tcl::zlib {variable cmdcounter 0}\x00zlibVersion\x002.0.1\x00"
var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data
